[devel] [PATCH 1 of 1] IMM: fix memory leak in saImmOmAccessorGet_2 [#549]

2013-08-21 Thread Zoran Milinkovic
 osaf/libs/agents/saf/imma/imma_om_api.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


The fix frees a memory for an object name in saImmOmAccessorGet_2.

diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -5505,6 +5505,7 @@ mds_send_fail:

if(out_evt-info.imma.info.searchNextRsp-attrValuesList) {

immsv_free_attrvalues_list(out_evt-info.imma.info.searchNextRsp-attrValuesList);
}
+   
free(out_evt-info.imma.info.searchNextRsp-objectName.buf);
free(out_evt-info.imma.info.searchNextRsp);
out_evt-info.imma.info.searchNextRsp = NULL;
}

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for IMM: fix memory leak in saImmOmAccessorGet_2 [#549]

2013-08-21 Thread Zoran Milinkovic
Summary: IMM: fix memory leak in saImmOmAccessorGet_2 [#549]
Review request for Trac Ticket(s): 549
Peer Reviewer(s): Neel
Pull request to: Zoran
Affected branch(es): default(4.4)
Development branch: default(4.4)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 1e990cf4235cec566e9f093b1331791e475d0ea7
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Wed, 21 Aug 2013 14:11:16 +0200

IMM: fix memory leak in saImmOmAccessorGet_2 [#549]

The fix frees a memory for an object name in saImmOmAccessorGet_2.


Complete diffstat:
--
 osaf/libs/agents/saf/imma/imma_om_api.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


Testing Commands:
-
valgrind --leak-check=full immomtest


Testing, Expected Results:
--
Run immomtest using valgrind. Memory leak in immsv_evt_dec_inline_string 
should be gone.


Conditions of Submission:
-
Ack from Neel.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] IMM: fix memory leak when SaAnyT atrribute is size of 0 [#550]

2013-08-22 Thread Zoran Milinkovic
 osaf/libs/agents/saf/imma/imma_init.c |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)


diff --git a/osaf/libs/agents/saf/imma/imma_init.c 
b/osaf/libs/agents/saf/imma/imma_init.c
--- a/osaf/libs/agents/saf/imma/imma_init.c
+++ b/osaf/libs/agents/saf/imma/imma_init.c
@@ -366,9 +366,7 @@ void imma_freeAttrValue3(SaImmAttrValueT
break;
case SA_IMM_ATTR_SAANYT:
saAnyTp = (SaAnyT *)p;
-   if (saAnyTp-bufferSize) {
-   free(saAnyTp-bufferAddr);
-   }
+   free(saAnyTp-bufferAddr);
break;
 
default:

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for IMM: fix memory leak when SaAnyT atrribute is size of 0 [#550]

2013-08-22 Thread Zoran Milinkovic
Summary: IMM: fix memory leak when SaAnyT atrribute is size of 0 [#550]
Review request for Trac Ticket(s): 550
Peer Reviewer(s): Neel
Pull request to: Zoran
Affected branch(es): opensaf-4.2.x, opensaf-4.3.x, default(4.4)
Development branch: default(4.4)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset ad9c0007a7bbe0ea58fc692d213f78a002ed5b24
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Wed, 21 Aug 2013 15:00:12 +0200

IMM: fix memory leak when SaAnyT atrribute is size of 0 [#550]


Complete diffstat:
--
 osaf/libs/agents/saf/imma/imma_init.c |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)


Testing Commands:
-
valgrind --leak-check=full immomtest 6 16


Testing, Expected Results:
--
Run immomtest using valgrind, and check that there is no memory leaks in 
immsv_evt_dec_att_val.


Conditions of Submission:
-
Ack from Neel.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for IMM: fix memory leak in saImmOmAccessorGet_2 [#549]

2013-08-27 Thread Zoran Milinkovic
Summary: IMM: fix memory leak in saImmOmAccessorGet_2 [#549]
Review request for Trac Ticket(s): 549
Peer Reviewer(s): Neel
Pull request to: Zoran
Affected branch(es): default(4.4)
Development branch: default(4.4)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 3ee0573bc266a5686c7d590d5f65952cc83fd647
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 27 Aug 2013 10:38:10 +0200

IMM: fix memory leak in saImmOmAccessorGet_2 [#549]


Complete diffstat:
--
 osaf/libs/agents/saf/imma/imma_db.c |  31 +++
 osaf/libs/agents/saf/imma/imma_om_api.c |  28 +---
 2 files changed, 32 insertions(+), 27 deletions(-)


Testing Commands:
-
valgrind --leak-check=full immomtest


Testing, Expected Results:
--
Run immomtest using valgrind. Memory leaks in immsv_evt_dec_inline_string and 
saImmOmAccessorGet_2 should be gone.


Conditions of Submission:
-
Ack from Neel


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] IMM: fix memory leak in saImmOmAccessorGet_2 [#549]

2013-08-27 Thread Zoran Milinkovic
 osaf/libs/agents/saf/imma/imma_db.c |  31 +++
 osaf/libs/agents/saf/imma/imma_om_api.c |  28 +---
 2 files changed, 32 insertions(+), 27 deletions(-)


diff --git a/osaf/libs/agents/saf/imma/imma_db.c 
b/osaf/libs/agents/saf/imma/imma_db.c
--- a/osaf/libs/agents/saf/imma/imma_db.c
+++ b/osaf/libs/agents/saf/imma/imma_db.c
@@ -1192,6 +1192,9 @@ uint32_t imma_search_node_delete(IMMA_CB
free(search_node-searchBundle-searchResult);
free(search_node-searchBundle);
search_node-searchBundle = NULL;
+   } else if (!search_node-mSearchId  search_node-mLastAttributes) {
+   imma_freeSearchAttrs(search_node-mLastAttributes);
+   search_node-mLastAttributes = NULL;
}
 
/* Remove the Node from the tree */
@@ -1356,3 +1359,31 @@ SaStringT* imma_getErrorStrings(IMMSV_SA
  done:
return errStringArr;
 }
+
+void imma_freeSearchAttrs(SaImmAttrValuesT_2 **attr)
+{
+   SaImmAttrValuesT_2 *att = NULL;
+   int ix;
+   for (ix = 0; attr[ix]; ++ix) {
+   int ix2; 
+
+   att = attr[ix];
+   free(att-attrName);/*free-3 */
+   att-attrName = NULL;
+
+   for (ix2 = 0; ix2  att-attrValuesNumber; ++ix2) {
+   SaImmAttrValueT aval = att-attrValues[ix2];
+   imma_freeAttrValue3(aval, att-attrValueType);  
/*free-5 */
+   }
+   free(att-attrValues);  /*free-4 */
+   att-attrValues = NULL;
+   att-attrValuesNumber = 0; 
+   att-attrValueType = 0; 
+
+   free(att);  /*free-2 */
+   attr[ix] = NULL;
+   }
+
+   free(attr); /*free-1 */
+}
+
diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -5505,6 +5505,7 @@ mds_send_fail:

if(out_evt-info.imma.info.searchNextRsp-attrValuesList) {

immsv_free_attrvalues_list(out_evt-info.imma.info.searchNextRsp-attrValuesList);
}
+   
free(out_evt-info.imma.info.searchNextRsp-objectName.buf);
free(out_evt-info.imma.info.searchNextRsp);
out_evt-info.imma.info.searchNextRsp = NULL;
}
@@ -6656,33 +6657,6 @@ searchresult:
return error;
 }
 
-void imma_freeSearchAttrs(SaImmAttrValuesT_2 **attr)
-{
-   SaImmAttrValuesT_2 *att = NULL;
-   int ix;
-   for (ix = 0; attr[ix]; ++ix) {
-   int ix2;
-
-   att = attr[ix];
-   free(att-attrName);/*free-3 */
-   att-attrName = NULL;
-
-   for (ix2 = 0; ix2  att-attrValuesNumber; ++ix2) {
-   SaImmAttrValueT aval = att-attrValues[ix2];
-   imma_freeAttrValue3(aval, att-attrValueType);  
/*free-5 */
-   }
-   free(att-attrValues);  /*free-4 */
-   att-attrValues = NULL;
-   att-attrValuesNumber = 0;
-   att-attrValueType = 0;
-
-   free(att);  /*free-2 */
-   attr[ix] = NULL;
-   }
-
-   free(attr); /*free-1 */
-}
-
 SaAisErrorT saImmOmSearchFinalize(SaImmSearchHandleT searchHandle)
 {
SaAisErrorT error = SA_AIS_OK;

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] IMMTOOL: Cleanup the code and fix memory problem [#552]

2013-08-27 Thread Zoran Milinkovic
 tests/immsv/common/immtest.c|   4 
 tests/immsv/implementer/test_SaImmOiRtAttrUpdateCallbackT.c |   2 +-
 tests/immsv/implementer/test_cleanup.c  |   3 ++-
 tests/immsv/management/test_cleanup.c   |   3 ++-
 tests/immsv/management/test_saImmOmAdminOwnerFinalize.c |   1 +
 tests/immsv/management/test_saImmOmInitialize.c |   1 +
 tests/immsv/management/test_saImmOmThreadInterference.c |  10 +++---
 7 files changed, 18 insertions(+), 6 deletions(-)


Cleanup IMM test code and fix memory problems reported by valgrind.

diff --git a/tests/immsv/common/immtest.c b/tests/immsv/common/immtest.c
--- a/tests/immsv/common/immtest.c
+++ b/tests/immsv/common/immtest.c
@@ -18,6 +18,7 @@
 #include stdlib.h
 #include sys/time.h
 #include unistd.h
+#include pthread.h
 #include immtest.h
 
 const SaVersionT constImmVersion = {'A', 0x02, 0x0c}; 
@@ -68,6 +69,9 @@ int main(int argc, char **argv)
 if(test_cleanup)
 test_cleanup();
 
+/* Added pthread_exit() to remove dlopen@@GLIBC leak from valgrind */
+pthread_exit(NULL);
+
 return rc;
 }  
 
diff --git a/tests/immsv/implementer/test_SaImmOiRtAttrUpdateCallbackT.c 
b/tests/immsv/implementer/test_SaImmOiRtAttrUpdateCallbackT.c
--- a/tests/immsv/implementer/test_SaImmOiRtAttrUpdateCallbackT.c
+++ b/tests/immsv/implementer/test_SaImmOiRtAttrUpdateCallbackT.c
@@ -138,9 +138,9 @@ static void *test_saImmOmAccessorGet_2(v
 safassert(saImmOmInitialize(immOmHandle, immOmCallbacks, immVersion), 
SA_AIS_OK);
 safassert(saImmOmAccessorInitialize(immOmHandle, accessorHandle), 
SA_AIS_OK);
 safassert(saImmOmAccessorGet_2(accessorHandle, dn, attributeNames, 
attributes), SA_AIS_OK);
-safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
 assert(attributes[0]-attrValueType == SA_IMM_ATTR_SAINT32T);
 assert(*((SaInt32T*) attributes[0]-attrValues[0]) == int1Value);
+safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
 
 TRACE_LEAVE();
 return NULL;
diff --git a/tests/immsv/implementer/test_cleanup.c 
b/tests/immsv/implementer/test_cleanup.c
--- a/tests/immsv/implementer/test_cleanup.c
+++ b/tests/immsv/implementer/test_cleanup.c
@@ -64,13 +64,14 @@ static void cleanup() {
 
/* Delete objects */
int len;
-   SaNameT objectName;
+   SaNameT objectName = {0};
SaNameT *objectNames[2] = { objectName, NULL };
obj = objects;
while(*obj) {
len = strlen(*obj);
objectName.length = (len  SA_MAX_NAME_LENGTH) ? 
SA_MAX_NAME_LENGTH : len;
strncpy((char *)objectName.value, *obj, objectName.length);
+   objectName.value[objectName.length] = 0;
 
rc = saImmOmAdminOwnerSet(ownerHandle, (const SaNameT 
**)objectNames, SA_IMM_ONE);
if(rc == SA_AIS_ERR_NOT_EXIST) {
diff --git a/tests/immsv/management/test_cleanup.c 
b/tests/immsv/management/test_cleanup.c
--- a/tests/immsv/management/test_cleanup.c
+++ b/tests/immsv/management/test_cleanup.c
@@ -70,13 +70,14 @@ static void cleanup() {
 
/* Delete objects */
int len;
-   SaNameT objectName;
+   SaNameT objectName = {0};
SaNameT *objectNames[2] = { objectName, NULL };
obj = objects;
while(*obj) {
len = strlen(*obj);
objectName.length = (len  SA_MAX_NAME_LENGTH) ? 
SA_MAX_NAME_LENGTH : len;
strncpy((char *)objectName.value, *obj, objectName.length);
+   objectName.value[objectName.length] = 0;
 
rc = saImmOmAdminOwnerSet(ownerHandle, (const SaNameT 
**)objectNames, SA_IMM_ONE);
if(rc == SA_AIS_ERR_NOT_EXIST) {
diff --git a/tests/immsv/management/test_saImmOmAdminOwnerFinalize.c 
b/tests/immsv/management/test_saImmOmAdminOwnerFinalize.c
--- a/tests/immsv/management/test_saImmOmAdminOwnerFinalize.c
+++ b/tests/immsv/management/test_saImmOmAdminOwnerFinalize.c
@@ -74,4 +74,5 @@ void saImmOmAdminOwnerFinalize_03(void)
 
 /* Cleanup */ 
 safassert(saImmOmAdminOwnerFinalize(rudeGuyHandle), SA_AIS_OK);
+safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
 }
diff --git a/tests/immsv/management/test_saImmOmInitialize.c 
b/tests/immsv/management/test_saImmOmInitialize.c
--- a/tests/immsv/management/test_saImmOmInitialize.c
+++ b/tests/immsv/management/test_saImmOmInitialize.c
@@ -243,6 +243,7 @@ void saImmOmInitialize_10(void)
 
 test_validate(rc, SA_AIS_OK);
 
+safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
 }
 
 void saImmOmInitialize_11(void)
diff --git a/tests/immsv/management/test_saImmOmThreadInterference.c 
b/tests/immsv/management/test_saImmOmThreadInterference.c
--- a/tests/immsv/management/test_saImmOmThreadInterference.c
+++ b/tests/immsv/management/test_saImmOmThreadInterference.c
@@ -88,7 +88,7 @@ void saImmOmThreadInterference_01(void) 
SaImmAdminOwnerHandleT ownerHandle;
SaImmSearchHandleT 

[devel] [PATCH 0 of 1] Review Request for IMMTOOL: Cleanup the code and fix memory problem [#552]

2013-08-27 Thread Zoran Milinkovic
Summary: IMMTOOL: Cleanup the code and fix memory problem [#552]
Review request for Trac Ticket(s): 552
Peer Reviewer(s): Neel
Pull request to: Zoran
Affected branch(es): default(4.4)
Development branch: default(4.4)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each y above):
-

changeset 0cdd2a5765b3dbf0a471ddb0c09bd99587ec1e9d
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 27 Aug 2013 10:53:50 +0200

IMMTOOL: Cleanup the code and fix memory problem [#552]

Cleanup IMM test code and fix memory problems reported by valgrind.


Complete diffstat:
--
 tests/immsv/common/immtest.c|   4 
 tests/immsv/implementer/test_SaImmOiRtAttrUpdateCallbackT.c |   2 +-
 tests/immsv/implementer/test_cleanup.c  |   3 ++-
 tests/immsv/management/test_cleanup.c   |   3 ++-
 tests/immsv/management/test_saImmOmAdminOwnerFinalize.c |   1 +
 tests/immsv/management/test_saImmOmInitialize.c |   1 +
 tests/immsv/management/test_saImmOmThreadInterference.c |  10 +++---
 7 files changed, 18 insertions(+), 6 deletions(-)


Testing Commands:
-
valgrind --leak-check=full --show-reachable=yes immomtest
valgrind --leak-check=full --show-reachable=yes immoitest


Testing, Expected Results:
--
Running immoitest and immomtest using valgrind, valgrind should not report any 
memory leak.


Conditions of Submission:
-
Ack from Neel


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk

[devel] [PATCH 0 of 1] Review Request for IMMTOOL: add missing library to Makefile.am of immcfg [#20]

2013-09-06 Thread Zoran Milinkovic
Summary: IMMTOOL: add missing library to Makefile.am of immcfg [#20]
Review request for Trac Ticket(s): 20
Peer Reviewer(s): Neel, Hans
Pull request to: Zoran
Affected branch(es): default(4.4)
Development branch: 


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset e4cce0be0c180ff2448e11557defb7d142e30886
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Fri, 06 Sep 2013 16:49:40 +0200

IMMTOOL: add missing library to Makefile.am of immcfg [#20]

Add libdl library to Makefile.am for immcfg. On Ubuntu 13.04 with gcc 
4.7.3,
it's not possible to link files without missing library.


Complete diffstat:
--
 osaf/tools/safimm/immcfg/Makefile.am |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
After applying the patch, it should be possible to compile OpenSAF on Ubuntu 
13.04.


Conditions of Submission:
-
Ack from Neel


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for IMM: fix memory leak in imma_search_node_delete function [#549]

2013-09-09 Thread Zoran Milinkovic
Summary: IMM: fix memory leak in imma_search_node_delete function [#549]
Review request for Trac Ticket(s): 549
Peer Reviewer(s): Neel
Pull request to: Zoran
Affected branch(es): opensaf-4.2.x, opensaf-4.3.x
Development branch: opensaf-4.2.x


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 98d90041a07d10622a16883cdd3d934512401b5e
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Mon, 09 Sep 2013 14:58:45 +0200

IMM: fix memory leak in imma_search_node_delete function [#549]


Complete diffstat:
--
 osaf/libs/agents/saf/imma/imma_db.c |  33 +
 osaf/libs/agents/saf/imma/imma_om_api.c |  27 ---
 2 files changed, 33 insertions(+), 27 deletions(-)


Testing Commands:
-
valgrind --leak-check=full immomtest


Testing, Expected Results:
--
Valgrind should not report any memory leak in immomtest for OpenSAF 4.2 and 
OpenSAF 4.3.


Conditions of Submission:
-
Ack from Neel.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for IMMTEST: Cleanup the code and fix memory problem [#552]

2013-09-12 Thread Zoran Milinkovic
Summary: IMMTEST: Cleanup the code and fix memory problem [#552]
Review request for Trac Ticket(s): 552
Peer Reviewer(s): Neel
Pull request to: Zoran
Affected branch(es): opensaf-4.3.x
Development branch: opensaf-4.3.x


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each y above):
-

changeset 6e718b7dfad5d813286331a7498cdc3351591288
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 12 Sep 2013 04:40:23 -0400

IMMTEST: Cleanup the code and fix memory problem [#552]


Complete diffstat:
--
 tests/immsv/common/immtest.c|   4 
 tests/immsv/implementer/test_SaImmOiRtAttrUpdateCallbackT.c |   2 +-
 tests/immsv/implementer/test_cleanup.c  |   2 +-
 tests/immsv/management/test_cleanup.c   |   2 +-
 tests/immsv/management/test_saImmOmAdminOwnerFinalize.c |   1 +
 tests/immsv/management/test_saImmOmInitialize.c |   1 +
 tests/immsv/management/test_saImmOmSearchInitialize_2.c |   2 +-
 tests/immsv/management/test_saImmOmThreadInterference.c |  10 +++---
 8 files changed, 17 insertions(+), 7 deletions(-)


Testing Commands:
-
valgrind --leak-check=full --show-reachable=yes --track-origins=yes immomtest
valgrind --leak-check=full --show-reachable=yes --track-origins=yes immoitest


Testing, Expected Results:
--
Valgrind should not report any memory leak.


Conditions of Submission:
-
Ack from Neel.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=5127iu=/4140/ostg.clktrk

Re: [devel] [PATCH 1 of 1] IMM: fix the memory leaks when ncs_lock failed in IMM agent

2013-09-20 Thread Zoran Milinkovic
In

@@ -6469,8 +6478,7 @@ SaAisErrorT saImmOmSearchNext_2(SaImmSea
 
if (m_NCS_LOCK(cb-cb_lock, NCS_LOCK_WRITE) != NCSCC_RC_SUCCESS) {
TRACE_4(ERR_LIBRARY: Lock error);
-   return SA_AIS_ERR_LIBRARY;
-   /*Error case will leak memory. */
+   goto release_evt;
}
locked = true;

you forgot to set return error code error = SA_AIS_ERR_LIBRARY;

Regrards,
Zoran

From: reddy.neelaka...@oracle.com [reddy.neelaka...@oracle.com]
Sent: Wednesday, 11 September 2013 2:43 PM
To: Anders Björnerstedt
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1 of 1] IMM: fix the memory leaks when ncs_lock failed 
in IMM   agent

 osaf/libs/agents/saf/imma/imma_oi_api.c |   6 +-
 osaf/libs/agents/saf/imma/imma_om_api.c |  84 +++
 2 files changed, 50 insertions(+), 40 deletions(-)


In the IMM API's if ncs_lock fails with SA_AIS_ERR_LIBRARY, memory if any 
aloocated in the API must be freed.
In the saImmOmClassDescriptionMemoryFree_2 API is modified to use 
imma_freeAttrValue3

diff --git a/osaf/libs/agents/saf/imma/imma_oi_api.c 
b/osaf/libs/agents/saf/imma/imma_oi_api.c
--- a/osaf/libs/agents/saf/imma/imma_oi_api.c
+++ b/osaf/libs/agents/saf/imma/imma_oi_api.c
@@ -1457,7 +1457,7 @@ SaAisErrorT saImmOiImplementerClear(SaIm
rc = SA_AIS_ERR_LIBRARY;
/* Losing track of the pending reply count, but ERR_LIBRARY 
dominates*/
TRACE_4(ERR_LIBRARY: LOCK failed);
-   goto lock_fail;
+   goto lock_fail1;
}
locked = true;

@@ -1507,6 +1507,7 @@ SaAisErrorT saImmOiImplementerClear(SaIm
if (locked)
m_NCS_UNLOCK(cb-cb_lock, NCS_LOCK_WRITE);

+ lock_fail1:
if (out_evt)
free(out_evt);

@@ -2465,7 +2466,7 @@ SaAisErrorT saImmOiRtObjectUpdate_2(SaIm
rc = SA_AIS_ERR_LIBRARY;
/* Losing track of the pending reply count, but ERR_LIBRARY 
dominates*/
TRACE_4(ERR_LIBRARY: Lock failed);
-   goto lock_fail;
+   goto lock_fail1;
}
locked = true;

@@ -2496,6 +2497,7 @@ SaAisErrorT saImmOiRtObjectUpdate_2(SaIm

  skip_over_send:
  bad_sync:
+ lock_fail1:
if (evt.info.immnd.info.objModify.objectName.buf) { /*free-1 */
free(evt.info.immnd.info.objModify.objectName.buf);
evt.info.immnd.info.objModify.objectName.buf = NULL;
diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -376,6 +376,7 @@ static SaAisErrorT initialize_common(SaI
imma_callback_ipc_destroy(cl_node);

  ipc_init_fail:
+ lock_fail:
if (rc != SA_AIS_OK) {
free(cl_node);
cl_node=NULL;
@@ -384,7 +385,6 @@ static SaAisErrorT initialize_common(SaI
if (locked)
m_NCS_UNLOCK(cb-cb_lock, NCS_LOCK_WRITE);

- lock_fail:

if (out_evt) {
free(out_evt);
@@ -3604,7 +3604,7 @@ static SaAisErrorT admin_op_invoke_commo
if (!locked  m_NCS_LOCK(cb-cb_lock, NCS_LOCK_WRITE) != 
NCSCC_RC_SUCCESS) {
TRACE_4(ERR_LIBRARY: Lock failed);
rc = SA_AIS_ERR_LIBRARY;
-   goto lock_fail;
+   goto lock_fail1;
}
locked = true;

@@ -3645,6 +3645,24 @@ static SaAisErrorT admin_op_invoke_commo
if (locked)
m_NCS_UNLOCK(cb-cb_lock, NCS_LOCK_WRITE);

+ lock_fail1:
+   if(returnParams  *returnParams != NULL  rc == SA_AIS_ERR_LIBRARY) {
+   SaImmAdminOperationParamsT_2 **Params = *returnParams;
+   SaImmAdminOperationParamsT_2 *q = NULL;
+   unsigned int ix = 0;
+   while(Params[ix]) {
+   q = Params[ix];
+   imma_freeAttrValue3(q-paramBuffer, q-paramType);
+   free(q-paramName);
+   q-paramName = NULL;
+   free(q);
+   ++ix;
+   }
+
+   free(Params);
+   }
+
+
  lock_fail:

  done:
@@ -4754,7 +4772,7 @@ SaAisErrorT saImmOmClassDescriptionGet_2
rc = SA_AIS_ERR_LIBRARY;
TRACE_4(ERR_LIBRARY: Lock failed);
/* Losing track of the pending reply count, but ERR_LIBRARY 
dominates*/
-   goto lock_fail;
+   goto lock_fail1;
}
locked = true;

@@ -4779,6 +4797,24 @@ SaAisErrorT saImmOmClassDescriptionGet_2
if (locked)
m_NCS_UNLOCK(cb-cb_lock, NCS_LOCK_WRITE);

+ lock_fail1:
+
+   if (attrDefinition  rc == SA_AIS_ERR_LIBRARY) {
+   SaImmAttrDefinitionT_2 **attr1 = *attrDefinition;
+   int i;
+   for (i = 0; attr1[i]; ++i) {
+   

Re: [devel] [PATCH 1 of 1] IMM: free the client node intialization of IMMA fails(#602)

2013-10-23 Thread Zoran Milinkovic
NACK from me.

cl_node and NCS_UNLOCK are not related at all, and freeing cl_node before 
NCS_UNLOCK does not have any effect on NCS_UNLOCK.

There is a bug in locking/unlocking of the control block lock in #560 that I 
missed in the review, and which may cause this assert if a client uses multiple 
threads.

195 proc_rc = imma_startup(NCSMDS_SVC_ID_IMMA_OM);
196 if (NCSCC_RC_SUCCESS != proc_rc) {
197 TRACE_4(ERR_LIBRARY: imma startup failed:%u, proc_rc);
198 rc = SA_AIS_ERR_LIBRARY;
199 goto lock_fail;
200 }
201 
202 if (false == cb-is_immnd_up) {
203 TRACE_2(ERR_TRY_AGAIN: IMMND is DOWN);
204 rc = SA_AIS_ERR_TRY_AGAIN;
205 goto lock_fail;
206 }

... and...

219 if (m_NCS_LOCK(cb-cb_lock, NCS_LOCK_WRITE) != 
NCSCC_RC_SUCCESS) {
220 TRACE_4(ERR_LIBRARY: Lock failed);
221 rc = SA_AIS_ERR_LIBRARY;
222 goto lock_fail;
223 }

If any of these IF statements fails, the execution goes to lock_fail label, 
where IMMA control block lock will be unlocked, even if it's not locked earlier 
by the same thread. It may cause unwanted results in other threads.
Keep in mind that initially locked I set to true, and next code unlocks the 
control block lock:

385 if (locked)
386 m_NCS_UNLOCK(cb-cb_lock, NCS_LOCK_WRITE);

Best regards,
Zoran

-Original Message-
From: reddy.neelaka...@oracle.com [mailto:reddy.neelaka...@oracle.com] 
Sent: den 22 oktober 2013 15:41
To: Anders Björnerstedt
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1 of 1] IMM: free the client node intialization of IMMA 
fails(#602)

 osaf/libs/agents/saf/imma/imma_om_api.c |  12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)


If the intialization of IMMA agen fails, then free the cl_node.

diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -202,7 +202,7 @@ static SaAisErrorT initialize_common(SaI
if (false == cb-is_immnd_up) {
TRACE_2(ERR_TRY_AGAIN: IMMND is DOWN);
rc = SA_AIS_ERR_TRY_AGAIN;
-   goto lock_fail;
+   goto end;
}
 
if((timeout_env_value = getenv(IMMA_SYNCR_TIMEOUT))!=NULL) {
@@ -377,10 +377,6 @@ static SaAisErrorT initialize_common(SaI
 
  ipc_init_fail:
  lock_fail:
-   if (rc != SA_AIS_OK) {
-   free(cl_node);
-   cl_node=NULL;
-   }
 
if (locked)
m_NCS_UNLOCK(cb-cb_lock, NCS_LOCK_WRITE);
@@ -395,7 +391,7 @@ static SaAisErrorT initialize_common(SaI
/* Went well, return immHandle to the application */
*immHandle = cl_node-handle;
}
-
+ end:
if (rc != SA_AIS_OK) {
if (NCSCC_RC_SUCCESS != imma_shutdown(NCSMDS_SVC_ID_IMMA_OM)) {
/* Oh boy. Failure in imma_shutdown when we already have
@@ -404,6 +400,10 @@ static SaAisErrorT initialize_common(SaI
 
rc = SA_AIS_ERR_LIBRARY;
}
+   if (cl_node){
+   free(cl_node);
+   cl_node=NULL;
+   }
}
 
TRACE_LEAVE();

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60135991iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60135991iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 1] Review Request for IMM: free the client node intialization if IMMA fails(#602)

2013-10-24 Thread Zoran Milinkovic
Ack from me with a minor change.

Checking, if cl_node is NULL, is not necessary.

Best regards,
Zoran

-Original Message-
From: reddy.neelaka...@oracle.com [mailto:reddy.neelaka...@oracle.com] 
Sent: den 24 oktober 2013 10:43
To: Anders Björnerstedt
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 0 of 1] Review Request for IMM: free the client node 
intialization if IMMA fails(#602)

Summary: IMM: free the client node intialization if IMMA fails(#602)
Review request for Trac Ticket(s):602 
Peer Reviewer(s): AndersBj, Zoran
Affected branch(es):4.2.x,4.3.x,default 
Development branch:default 


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-
 EXPLAIN/COMMENT THE PATCH SERIES HERE

changeset 964454a09b0ab914c69616475d4470e2f2c99bc2
Author: Neelakanta Reddyreddy.neelaka...@oracle.com
Date:   Thu, 24 Oct 2013 14:09:21 +0530

IMM: free the client node intialization if IMMA fails(#602) 
Intialization of
IMMA agent fails, then free the cl_node and changed the goto tag names.

Testing Commands:
-
If any application tries to initialize when IMMND is down, will be asserted.

Testing, Expected Results:
--
Application must not assert when IMMND is down.

Conditions of Submission:
-
Ack from AndersBj

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60135991iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] IMM: fix memory problem in saImmOmSearchNext_2 [#612]

2013-11-01 Thread Zoran Milinkovic
 osaf/libs/agents/saf/imma/imma_om_api.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Fix free of memory in saImmOmSearchNext_2 when imma type is not 
IMMA_EVT_ND2A_SEARCHNEXT_RSP.

diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -6415,7 +6415,7 @@ SaAisErrorT saImmOmSearchNext_2(SaImmSea
 
if (out_evt) {
/* Free the search_next structure. */
-   if (out_evt-info.imma.info.searchNextRsp) {
+   if ((out_evt-info.imma.type == IMMA_EVT_ND2A_SEARCHNEXT_RSP) 
 out_evt-info.imma.info.searchNextRsp) {

free(out_evt-info.imma.info.searchNextRsp-objectName.buf);
out_evt-info.imma.info.searchNextRsp-objectName.buf = 
NULL;
out_evt-info.imma.info.searchNextRsp-objectName.size 
= 0;

--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 1] Review Request for IMM: Support for immadm -a (--admin-owner) (#613)

2013-11-06 Thread Zoran Milinkovic
Ack from me.
Reviewed and tested.

Zoran

-Original Message-
From: Anders Bjornerstedt [mailto:anders.bjornerst...@ericsson.com] 
Sent: den 5 november 2013 07:48
To: reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 0 of 1] Review Request for IMM: Support for immadm -a 
(--admin-owner) (#613)

Summary: IMM: Support for 'immadm -a (--admin-owner) admo-name' [#613]
Review request for Trac Ticket(s): 613
Peer Reviewer(s): Neel, Zoran
Pull request to: 
Affected branch(es): default (4.4)
Development branch: 


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n

Comments (indicate scope for each y above):
-

changeset fd1cd7c8d9808b8a11c9cedc5da348c60c234bee
Author: Anders Bjornerstedt anders.bjornerst...@ericsson.com
Date:   Tue, 05 Nov 2013 07:10:57 +0100

IMM: Support for 'immadm -a (--admin-owner) admo-name' [#613]

Allow user to request immadm to set admin-owner to a specific admin 
owner
name. By default, a temprary admin-oener name is allocated by the immadm
commnad. The '-a' argument allows the user to choose the explicit admin-
owner name that shall be set for the object on which the administrative
operation is to be invoked on. This is typically only needed if the 
object
already has admin owner set, more or less permanently. Because of this, 
no
admin-owner-release will be done by immadm when explicit admin-owner 
name is
used.

Complete diffstat:
--
 osaf/tools/safimm/immadm/imm_admin.c |  22 --
 1 files changed, 16 insertions(+), 6 deletions(-)

Testing Commands:
-
Used for example when requesting 2PBE to enter 1-safe mode.
This would be to open up for allowing CCBs to proceed when one
SC is down in a 2PBE system. 

   immadm -o 1 -p opensafImmNostdFlags:SA_UINT32_T:8  \
  -a safImmService   opensafImm=opensafImm,safApp=safImmService

Because the object opensafImm=opensafImm,safApp=safImmService has admin-owner 
permanently set to 'safImmService', the user invoking an admin-operation on
this objects needs to set the same admin-owner-name for the handle they use.
Should admin-owner-name later need to be released from the object(s), this may
be done using 'immcfg --admin-owner-clear object-names'

Testing, Expected Results:
--
Invoking an admin-operation using an explicitly set admin-owner-name shall be
possible. 

Conditions of Submission:
-
Ack from Neel.

--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 3] IMM: API support for NO_DANGLING flag [#49]

2013-11-22 Thread Zoran Milinkovic
 osaf/libs/agents/saf/imma/imma_om_api.c   |  36 +--
 osaf/libs/common/immsv/include/immpbe_dump.hh |   2 +-
 osaf/libs/saf/include/Makefile.am |   3 +-
 osaf/libs/saf/include/saImmOm_A_2_12.h|   2 +
 osaf/libs/saf/include/saImmOm_A_2_13.h|  60 +++
 osaf/libs/saf/libSaImm/Makefile.am|   2 +-
 6 files changed, 97 insertions(+), 8 deletions(-)


IMM API support for reference integrity (NO_DANGLING flag)

diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -4158,7 +4158,7 @@ SaAisErrorT saImmOmClassCreate_2(SaImmHa
for (i = 0; attr != 0; attr = attrDefinitions[++i]) {
if (attr-attrName == NULL)  {
TRACE(NULL attrName , not allowed.);
-   TRACE_LEAVE();
+   TRACE_LEAVE();
return SA_AIS_ERR_INVALID_PARAM;
}
 
@@ -4166,21 +4166,47 @@ SaAisErrorT saImmOmClassCreate_2(SaImmHa
if(((attr-attrValueType != SA_IMM_ATTR_SANAMET )  
(attr-attrValueType != 
SA_IMM_ATTR_SASTRINGT))) {
TRACE(ERR_INVALID_PARAM: RDN '%s' must be of 
type SaNameT or SaStringT, attr-attrName);
-   TRACE_LEAVE();
+   TRACE_LEAVE();
return SA_AIS_ERR_INVALID_PARAM;
}
 
if(attr-attrFlags  SA_IMM_ATTR_MULTI_VALUE) {
TRACE(ERR_INVALID_PARAM: RDN '%s' can not be 
multivalued, attr-attrName);
TRACE_LEAVE();
-return SA_AIS_ERR_INVALID_PARAM;
-   }
+   return SA_AIS_ERR_INVALID_PARAM;
+   }
+
+   if(attr-attrFlags  SA_IMM_ATTR_NO_DANGLING) {
+   TRACE(ERR_INVALID_PARAM: RDN '%s' can not have 
NO_DANGLING flag, attr-attrName);
+   TRACE_LEAVE();
+   return SA_AIS_ERR_INVALID_PARAM;
+   }
+   }
+
+   if(attr-attrFlags  SA_IMM_ATTR_NO_DANGLING) {
+   if(classCategory == SA_IMM_CLASS_RUNTIME) {
+   TRACE(ERR_INVALID_PARAM: NO_DANGLING attribute 
'%s' cannot be defined for runtime class, attr-attrName);
+   TRACE_LEAVE();
+   return SA_AIS_ERR_INVALID_PARAM;
+   }
+
+   if(attr-attrValueType != SA_IMM_ATTR_SANAMET) {
+   TRACE(ERR_INVALID_PARAM: Attribute '%s' is 
flagged NO_DANGLING, must be of type SaNameT, attr-attrName);
+   TRACE_LEAVE();
+   return SA_AIS_ERR_INVALID_PARAM;
+   }
+
+   if(attr-attrFlags  SA_IMM_ATTR_RUNTIME) {
+   TRACE(ERR_INVALID_PARAM: Runtime attribute 
'%s' cannot have NO_DANGLING flag, attr-attrName);
+   TRACE_LEAVE();
+   return SA_AIS_ERR_INVALID_PARAM;
+   }
}
}
 
if (cb-is_immnd_up == false) {
TRACE_2(ERR_TRY_AGAIN: IMMND is DOWN);
-TRACE_LEAVE();
+   TRACE_LEAVE();
return SA_AIS_ERR_TRY_AGAIN;
}
 
diff --git a/osaf/libs/common/immsv/include/immpbe_dump.hh 
b/osaf/libs/common/immsv/include/immpbe_dump.hh
--- a/osaf/libs/common/immsv/include/immpbe_dump.hh
+++ b/osaf/libs/common/immsv/include/immpbe_dump.hh
@@ -31,7 +31,7 @@
 
 #define RELEASE_CODE 'A'
 #define MAJOR_VERSION 2
-#define MINOR_VERSION 12
+#define MINOR_VERSION 13
 
 /* Prototypes */
 typedef std::mapstd::string, SaImmAttrFlagsT AttrMap;
diff --git a/osaf/libs/saf/include/Makefile.am 
b/osaf/libs/saf/include/Makefile.am
--- a/osaf/libs/saf/include/Makefile.am
+++ b/osaf/libs/saf/include/Makefile.am
@@ -35,6 +35,7 @@ include_HEADERS = \
saSmf.h \
saImmOi_A_2_11.h \
saImmOm_A_2_11.h \
-   saImmOm_A_2_12.h
+   saImmOm_A_2_12.h \
+   saImmOm_A_2_13.h
 
 
diff --git a/osaf/libs/saf/include/saImmOm_A_2_12.h 
b/osaf/libs/saf/include/saImmOm_A_2_12.h
--- a/osaf/libs/saf/include/saImmOm_A_2_12.h
+++ b/osaf/libs/saf/include/saImmOm_A_2_12.h
@@ -73,4 +73,6 @@ extern C {
 }
 #endif
 
+#include saImmOm_A_2_13.h
+
 #endif   /* _SA_IMM_OM_A_2_12_H */
diff --git a/osaf/libs/saf/include/saImmOm_A_2_13.h 
b/osaf/libs/saf/include/saImmOm_A_2_13.h
new file mode 100644
--- /dev/null
+++ b/osaf/libs/saf/include/saImmOm_A_2_13.h
@@ -0,0 +1,60 @@
+/*  -*- OpenSAF  -*-
+ *
+ * (C) Copyright 

[devel] [PATCH 3 of 3] IMMTOOLS: Add support of NO_DANGLING flag to IMM tools [#49]

2013-11-22 Thread Zoran Milinkovic
 osaf/tools/safimm/immcfg/imm_import.cc |  2 ++
 osaf/tools/safimm/immdump/imm_xmlw_dump.cc |  9 +
 osaf/tools/safimm/immlist/imm_list.c   |  3 +++
 3 files changed, 14 insertions(+), 0 deletions(-)


Support reference integrity (NO_DANGLING flag) to IMM tools

diff --git a/osaf/tools/safimm/immcfg/imm_import.cc 
b/osaf/tools/safimm/immcfg/imm_import.cc
--- a/osaf/tools/safimm/immcfg/imm_import.cc
+++ b/osaf/tools/safimm/immcfg/imm_import.cc
@@ -1612,6 +1612,8 @@ static SaImmAttrFlagsT charsToFlagsHelpe
return SA_IMM_ATTR_NOTIFY;
} else if (len == strlen(SA_NO_DUPLICATES)  strncmp((const 
char*)str, SA_NO_DUPLICATES, len) == 0) {
return SA_IMM_ATTR_NO_DUPLICATES;
+   } else if (len == strlen(SA_NO_DANGLING)  strncmp((const char*)str, 
SA_NO_DANGLING, len) == 0) {
+   return SA_IMM_ATTR_NO_DANGLING;
}
 
LOG_ER(UNKNOWN FLAGS, %s, str);
diff --git a/osaf/tools/safimm/immdump/imm_xmlw_dump.cc 
b/osaf/tools/safimm/immdump/imm_xmlw_dump.cc
--- a/osaf/tools/safimm/immdump/imm_xmlw_dump.cc
+++ b/osaf/tools/safimm/immdump/imm_xmlw_dump.cc
@@ -508,6 +508,15 @@ void flagsToXMLw(SaImmAttrDefinitionT_2*
 }
 }
 
+if (flags  SA_IMM_ATTR_NO_DANGLING)
+{   
+if(xmlTextWriterWriteElement(writer, (xmlChar*) flag,
+   (xmlChar*) SA_NO_DANGLING)  0 ) { 
+std::cout  Error at xmlTextWriterWriteElement (flag - 
SA_NO_DANGLING)  std::endl;
+exit(1);
+}   
+}
+
 }
 
 void typeToXMLw(SaImmAttrDefinitionT_2* p, xmlTextWriterPtr writer)
diff --git a/osaf/tools/safimm/immlist/imm_list.c 
b/osaf/tools/safimm/immlist/imm_list.c
--- a/osaf/tools/safimm/immlist/imm_list.c
+++ b/osaf/tools/safimm/immlist/imm_list.c
@@ -323,6 +323,9 @@ static void display_class_definition(con
if (attrDefinition-attrFlags  
SA_IMM_ATTR_NO_DUPLICATES)
printf(, NO_DUPLICATES);
 
+   if (attrDefinition-attrFlags  SA_IMM_ATTR_NO_DANGLING)
+   printf(, NO_DANGLING);
+
} else if (attrDefinition-attrFlags  SA_IMM_ATTR_RUNTIME) {
if (attrDefinition-attrDefaultValue != NULL) {
printf( = );

--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 3] IMM: API support for NO_DANGLING flag [#49]

2013-12-05 Thread Zoran Milinkovic
 osaf/libs/agents/saf/imma/imma_om_api.c   |  36 +--
 osaf/libs/common/immsv/include/immpbe_dump.hh |   2 +-
 osaf/libs/common/immsv/include/immsv_api.h|   9 
 osaf/libs/saf/include/Makefile.am |   3 +-
 osaf/libs/saf/include/saImmOm_A_2_12.h|   2 +
 osaf/libs/saf/include/saImmOm_A_2_13.h|  60 +++
 osaf/libs/saf/libSaImm/Makefile.am|   2 +-
 7 files changed, 106 insertions(+), 8 deletions(-)


IMM API support for reference integrity (NO_DANGLING flag)

diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -4173,7 +4173,7 @@ SaAisErrorT saImmOmClassCreate_2(SaImmHa
for (i = 0; attr != 0; attr = attrDefinitions[++i]) {
if (attr-attrName == NULL)  {
TRACE(NULL attrName , not allowed.);
-   TRACE_LEAVE();
+   TRACE_LEAVE();
return SA_AIS_ERR_INVALID_PARAM;
}
 
@@ -4181,21 +4181,47 @@ SaAisErrorT saImmOmClassCreate_2(SaImmHa
if(((attr-attrValueType != SA_IMM_ATTR_SANAMET )  
(attr-attrValueType != 
SA_IMM_ATTR_SASTRINGT))) {
TRACE(ERR_INVALID_PARAM: RDN '%s' must be of 
type SaNameT or SaStringT, attr-attrName);
-   TRACE_LEAVE();
+   TRACE_LEAVE();
return SA_AIS_ERR_INVALID_PARAM;
}
 
if(attr-attrFlags  SA_IMM_ATTR_MULTI_VALUE) {
TRACE(ERR_INVALID_PARAM: RDN '%s' can not be 
multivalued, attr-attrName);
TRACE_LEAVE();
-return SA_AIS_ERR_INVALID_PARAM;
-   }
+   return SA_AIS_ERR_INVALID_PARAM;
+   }
+
+   if(attr-attrFlags  SA_IMM_ATTR_NO_DANGLING) {
+   TRACE(ERR_INVALID_PARAM: RDN '%s' can not have 
NO_DANGLING flag, attr-attrName);
+   TRACE_LEAVE();
+   return SA_AIS_ERR_INVALID_PARAM;
+   }
+   }
+
+   if(attr-attrFlags  SA_IMM_ATTR_NO_DANGLING) {
+   if(classCategory == SA_IMM_CLASS_RUNTIME) {
+   TRACE(ERR_INVALID_PARAM: NO_DANGLING attribute 
'%s' cannot be defined for runtime class, attr-attrName);
+   TRACE_LEAVE();
+   return SA_AIS_ERR_INVALID_PARAM;
+   }
+
+   if(attr-attrValueType != SA_IMM_ATTR_SANAMET) {
+   TRACE(ERR_INVALID_PARAM: Attribute '%s' is 
flagged NO_DANGLING, must be of type SaNameT, attr-attrName);
+   TRACE_LEAVE();
+   return SA_AIS_ERR_INVALID_PARAM;
+   }
+
+   if(attr-attrFlags  SA_IMM_ATTR_RUNTIME) {
+   TRACE(ERR_INVALID_PARAM: Runtime attribute 
'%s' cannot have NO_DANGLING flag, attr-attrName);
+   TRACE_LEAVE();
+   return SA_AIS_ERR_INVALID_PARAM;
+   }
}
}
 
if (cb-is_immnd_up == false) {
TRACE_2(ERR_TRY_AGAIN: IMMND is DOWN);
-TRACE_LEAVE();
+   TRACE_LEAVE();
return SA_AIS_ERR_TRY_AGAIN;
}
 
diff --git a/osaf/libs/common/immsv/include/immpbe_dump.hh 
b/osaf/libs/common/immsv/include/immpbe_dump.hh
--- a/osaf/libs/common/immsv/include/immpbe_dump.hh
+++ b/osaf/libs/common/immsv/include/immpbe_dump.hh
@@ -31,7 +31,7 @@
 
 #define RELEASE_CODE 'A'
 #define MAJOR_VERSION 2
-#define MINOR_VERSION 12
+#define MINOR_VERSION 13
 
 /* Prototypes */
 typedef std::mapstd::string, SaImmAttrFlagsT AttrMap;
diff --git a/osaf/libs/common/immsv/include/immsv_api.h 
b/osaf/libs/common/immsv/include/immsv_api.h
--- a/osaf/libs/common/immsv/include/immsv_api.h
+++ b/osaf/libs/common/immsv/include/immsv_api.h
@@ -76,6 +76,15 @@ extern C {
 #define OPENSAF_IMM_REPL_B_NAME @OpenSafImmReplicatorB
 
 /* Used internally in the SaImmCcbFlagsT space to indicate that
+   a ccb currently contains at lest one operation that either
+   a) creates an object with no dangling attribute(s) (that is/are not empty).
+   b) deletes an object that has no dangling attribute(s) (that are not empty).
+   c) modifies a NO_DANGLING attribute,
+   d) deletes an object that is referred to by some NO_DANGLING attribute.
+*/
+#define OPENSAF_IMM_CCB_NO_DANGLING_MUTATE 0x4000
+
+/* Used internally in the SaImmCcbFlagsT space to indicate that
a ccb 

Re: [devel] [PATCH 3 of 3] IMMTOOLS: Add support of NO_DANGLING flag to IMM tools [#49]

2013-12-10 Thread Zoran Milinkovic
Hi,

I will add saImmOm_A_2_13.h to the spec file.

Thanks,
Zoran

-Original Message-
From: Sirisha Alla [mailto:sirisha.a...@oracle.com] 
Sent: den 10 december 2013 08:13
To: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 3 of 3] IMMTOOLS: Add support of NO_DANGLING flag 
to IMM tools [#49]

Hi Zoran,

make rpm fails after applying this patch series. Entry needs to be added for 
saImmOm_A_2_13.h in opensaf.spec file.

Regards,
Sirisha

On 12/05/2013 08:34 PM, Zoran Milinkovic wrote:
   osaf/tools/safimm/immcfg/imm_import.cc |  2 ++
   osaf/tools/safimm/immdump/imm_xmlw_dump.cc |  9 +
   osaf/tools/safimm/immlist/imm_list.c   |  3 +++
   3 files changed, 14 insertions(+), 0 deletions(-)


 Support reference integrity (NO_DANGLING flag) to IMM tools

 diff --git a/osaf/tools/safimm/immcfg/imm_import.cc 
 b/osaf/tools/safimm/immcfg/imm_import.cc
 --- a/osaf/tools/safimm/immcfg/imm_import.cc
 +++ b/osaf/tools/safimm/immcfg/imm_import.cc
 @@ -1832,6 +1832,8 @@ static SaImmAttrFlagsT charsToFlagsHelpe
   return SA_IMM_ATTR_NOTIFY;
   } else if (len == strlen(SA_NO_DUPLICATES)  strncmp((const 
 char*)str, SA_NO_DUPLICATES, len) == 0) {
   return SA_IMM_ATTR_NO_DUPLICATES;
 + } else if (len == strlen(SA_NO_DANGLING)  strncmp((const char*)str, 
 SA_NO_DANGLING, len) == 0) {
 + return SA_IMM_ATTR_NO_DANGLING;
   }

   /* strlen(SA_NO_DUPLICATES) == 16 (the longest flag name) diff 
 --git a/osaf/tools/safimm/immdump/imm_xmlw_dump.cc 
 b/osaf/tools/safimm/immdump/imm_xmlw_dump.cc
 --- a/osaf/tools/safimm/immdump/imm_xmlw_dump.cc
 +++ b/osaf/tools/safimm/immdump/imm_xmlw_dump.cc
 @@ -508,6 +508,15 @@ void flagsToXMLw(SaImmAttrDefinitionT_2*
   }
   }

 +if (flags  SA_IMM_ATTR_NO_DANGLING)
 +{
 +if(xmlTextWriterWriteElement(writer, (xmlChar*) flag,
 +   (xmlChar*) SA_NO_DANGLING)  0 ) {
 +std::cout  Error at xmlTextWriterWriteElement (flag - 
 SA_NO_DANGLING)  std::endl;
 +exit(1);
 +}
 +}
 +
   }

   void typeToXMLw(SaImmAttrDefinitionT_2* p, xmlTextWriterPtr writer) 
 diff --git a/osaf/tools/safimm/immlist/imm_list.c 
 b/osaf/tools/safimm/immlist/imm_list.c
 --- a/osaf/tools/safimm/immlist/imm_list.c
 +++ b/osaf/tools/safimm/immlist/imm_list.c
 @@ -323,6 +323,9 @@ static void display_class_definition(con
   if (attrDefinition-attrFlags  
 SA_IMM_ATTR_NO_DUPLICATES)
   printf(, NO_DUPLICATES);

 + if (attrDefinition-attrFlags  SA_IMM_ATTR_NO_DANGLING)
 + printf(, NO_DANGLING);
 +
   } else if (attrDefinition-attrFlags  SA_IMM_ATTR_RUNTIME) {
   if (attrDefinition-attrDefaultValue != NULL) {
   printf( = );

 --
 
 Sponsored by Intel(R) XDK
 Develop, test and display web and hybrid apps with a single code base.
 Download it for free now!
 http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.
 clktrk ___
 Opensaf-devel mailing list
 Opensaf-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/opensaf-devel

--
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 3] Review Request for IMM: Implementation of NO_DANGLING flag [#49]

2013-12-12 Thread Zoran Milinkovic
Hi Neelakanta,

1. I will fix this.
2. That is correct behavior. If both objects are deleted in the same CCB, then 
it's possible to delete both of them. Number of same no dangling references in 
multivalue attribute does not matter on deletion objects. Having one reference 
is the same as having more.
3. Yes, a class may have more attributes with NO_DANGLING flags. Test cases for 
supporting more attributes with no dangling flags is up to applications, and 
I'm pretty sure if we limit a class to have only one attribute with NO_DANGLING 
flag, it will be a problem soon.

4. and 5. These issues have been already mentioned in earlier review comments.

Thanks,
Zoran

-Original Message-
From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com] 
Sent: den 12 december 2013 14:20
To: Zoran Milinkovic; Anders Björnerstedt
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0 of 3] Review Request for IMM: Implementation of 
NO_DANGLING flag [#49]

Hi Zoran/AndersBj,

The following are the comments:

1. when tried to modify the class (adding a new Attribute with 
NO_DANGLING) by using opensafImmNostdFlags on, the immnd asserted with 
the following log(No objects are created for the class yet):

Dec 12 17:02:16 Slot-4 def_523.o: logtrace: trace enabled to file 
/var/log/opensaf/imma.trace, mask=0x
Dec 12 17:02:16 Slot-4 def_523.o: NO IMMA library TRACE initialize done 
pid:19426 svid:26 file:/var/log/opensaf/imma.trace
Dec 12 17:02:16 Slot-4 osafimmnd[16888]: NO Class 'testClass6' exist - 
check implied schema upgrade
Dec 12 17:02:16 Slot-4 osafimmnd[16888]: NO New attribute Attr2 added by 
new class def
Dec 12 17:02:16 Slot-4 osafimmnd[16888]: NO Schema change for class 
testClass6 ACCEPTED. Adding 1 and changing 0 attribute defs
Dec 12 17:02:16 Slot-4 osafimmnd[16888]: ImmModel.cc:4596: 
addNoDanglingReferences: Assertion 'avmi != object-mAttrValueMap.end()' 
failed.
Dec 12 17:02:16 Slot-4 osafamfnd[16983]: NO 
'safComp=IMMND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF' faulted due to 
'avaDown' : Recovery is 'componentRestart'
Dec 12 17:02:16 Slot-4 osafimmd[16873]: WA IMMND coordinator at 2010f 
apparently crashed = electing new coord
Dec 12 17:02:16 Slot-4 osafimmd[16873]: ER Failed to find candidate for 
new IMMND coordinator
Dec 12 17:02:16 Slot-4 osafimmd[16873]: ER Active IMMD has to restart 
the IMMSv. All IMMNDs will restart
Dec 12 17:02:16 Slot-4 osafimmd[16873]: ER IMM RELOAD with NO persistent 
back end = ensure cluster restart by IMMD exit at both SCs, exiting
Dec 12 17:02:16 Slot-4 osafamfnd[16983]: NO 
'safComp=IMMD,safSu=SC-1,safSg=2N,safApp=OpenSAF' faulted due to 
'avaDown' : Recovery is 'nodeFailfast'
Dec 12 17:02:16 Slot-4 osafamfnd[16983]: ER 
safComp=IMMD,safSu=SC-1,safSg=2N,safApp=OpenSAF Faulted due to:avaDown 
Recovery is:nodeFailfast
Dec 12 17:02:16 Slot-4 osafamfnd[16983]: Rebooting OpenSAF NodeId = 
131343 EE Name = , Reason: Component faulted: recovery is node fail

2. If the NO_DANGLING attribute is MULTI_VALUE attribute. AN object x 
is created with multiple referece as object y and object z .
If Y object and x object are in same CCB for deletion, then the object X 
is deleted and is not giving error because it is still referencing y

3. Is class can have Multiple NO_DANGLING attributes? (when I tested it 
is supported) . Is there any specific use case to support(this 
enhancement already supports MULTI_VALUE for NO_DANGLING attributes).

4. As anders pointed each function must have Comments as what the 
function is doing.

5. The function names must be short and understandable.

/Neel.

On Thursday 05 December 2013 08:34 PM, Zoran Milinkovic wrote:
 Summary: IMM: Implementation of NO_DANGLING flag [#49]
 Review request for Trac Ticket(s): 49
 Peer Reviewer(s): Neelakanta, Anders
 Pull request to: Zoran
 Affected branch(es): default(4.4)
 Development branch: default(4.4)

 
 Impacted area   Impact y/n
 
   Docsn
   Build systemn
   RPM/packaging   n
   Configuration files n
   Startup scripts n
   SAF servicesy
   OpenSAF servicesn
   Core libraries  n
   Samples n
   Tests   n
   Other   n


 Comments (indicate scope for each y above):
 -

 changeset 262748c382d21cb6ec391e1b1fcf4a8a1e6256ae
 Author:   Zoran Milinkovic zoran.milinko...@ericsson.com
 Date: Thu, 05 Dec 2013 15:56:17 +0100

   IMM: API support for NO_DANGLING flag [#49]

   IMM API support for reference integrity (NO_DANGLING flag)

 changeset 121f26d8504c86c63643c03bb81840460e66a69b
 Author:   Zoran Milinkovic zoran.milinko...@ericsson.com
 Date: Thu, 05 Dec 2013 15:57:11 +0100

   IMM: IMM service implementation of NO_DANGLING flag [#49]

   Implementation of reference integrity (NO_DANGLING flag) to IMMSV

 changeset

[devel] [PATCH 0 of 3] Review Request for IMM: Add support for NO_DANGLING flag [#49]

2013-12-15 Thread Zoran Milinkovic
Summary: IMM: Add support for NO_DANGLING flag [#49]
Review request for Trac Ticket(s): 49
Peer Reviewer(s): Neel, Anders
Pull request to: Zoran
Affected branch(es): default(4.4)
Development branch: default(4.4)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 5581ca82a63f307e4a7e6427fd1d898a9505ea4a
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Sun, 15 Dec 2013 16:42:12 +0100

IMM: Add support for NO_DANGLING flag to API [#49]

changeset d0d8baa7648c017838535aad044df58e3047afe2
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Sun, 15 Dec 2013 16:42:41 +0100

IMM: Add support for NO_DANGLING flag to the service [#49]

changeset 073674c99718039ad86e50e499f1415bc365dfed
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Sun, 15 Dec 2013 16:43:09 +0100

IMMTOOLS: Add support for NO_DANGLING flag to tools [#49]


Added Files:

 osaf/libs/saf/include/saImmOm_A_2_13.h
 osaf/services/saf/immsv/schema/SAI-AIS-IMM-XSD-A.02.13.xsd


Complete diffstat:
--
 opensaf.spec.in| 1 +
 osaf/libs/agents/saf/imma/imma_cb.h| 1 +
 osaf/libs/agents/saf/imma/imma_def.h   | 2 +-
 osaf/libs/agents/saf/imma/imma_oi_api.c|12 +-
 osaf/libs/agents/saf/imma/imma_om_api.c|58 ++-
 osaf/libs/common/immsv/include/immpbe_dump.hh  | 2 +-
 osaf/libs/common/immsv/include/immsv_api.h | 9 +
 osaf/libs/saf/include/Makefile.am  | 3 +-
 osaf/libs/saf/include/saImmOm_A_2_12.h | 2 +
 osaf/libs/saf/include/saImmOm_A_2_13.h |60 
 osaf/libs/saf/libSaImm/Makefile.am | 2 +-
 osaf/services/saf/immsv/immloadd/imm_loader.cc | 8 +-
 osaf/services/saf/immsv/immloadd/imm_pbe_load.cc   | 2 +-
 osaf/services/saf/immsv/immnd/ImmAttrValue.hh  | 2 +
 osaf/services/saf/immsv/immnd/ImmModel.cc  |  1034 
+++-
 osaf/services/saf/immsv/immnd/ImmModel.hh  |41 +-
 osaf/services/saf/immsv/schema/SAI-AIS-IMM-XSD-A.02.13.xsd |   180 
+
 osaf/tools/safimm/immadm/imm_admin.c   | 2 +-
 osaf/tools/safimm/immcfg/imm_cfg.c | 2 +-
 osaf/tools/safimm/immcfg/imm_import.cc | 4 +-
 osaf/tools/safimm/immdump/imm_dumper.cc| 2 +-
 osaf/tools/safimm/immdump/imm_xmlw_dump.cc | 9 +
 osaf/tools/safimm/immlist/imm_list.c   | 3 +
 23 files changed, 1348 insertions(+), 93 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
The patches need to support:
- immload support for NO_DANGLING flag
- immdump support for NO_DANGLING flag
- immcfg support for NO_DANGLING flag (immcfg -f)
- immlist support for NO_DANGLING flag (NO_DANGLING flag is listed)
- IMM library support for NO_DANGLING (classCreate - basic checks)
- schema update (adding and removing NO_DANGLING flag)
- default values
- create object (NO_DANGLING attributes with and without values)
- modify object (add, replace and delete)
- delete object
- CCB apply
- CCB abort/terminate
- support for missing objects, created later in the same CCB


Conditions of Submission:
-
Ack from Neel and Anders


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your

[devel] [PATCH 2 of 2] IMM: Add support for searching NO_DANGLING references on an object to the service [#50]

2013-12-17 Thread Zoran Milinkovic
 osaf/services/saf/immsv/immnd/ImmModel.cc |  101 +-
 osaf/services/saf/immsv/immnd/ImmModel.hh |4 +
 2 files changed, 103 insertions(+), 2 deletions(-)


diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc 
b/osaf/services/saf/immsv/immnd/ImmModel.cc
--- a/osaf/services/saf/immsv/immnd/ImmModel.cc
+++ b/osaf/services/saf/immsv/immnd/ImmModel.cc
@@ -9209,6 +9209,34 @@ ImmModel::filterMatch(ObjectInfo* obj, I
 return j-second-hasMatchingValue(tmpos);
 }
 
+bool
+ImmModel::noDanglingRefExist(ObjectInfo *obj, const char *noDanglingRef)
+{
+ImmAttrValueMap::iterator avmi;
+ImmAttrValue *av;
+AttrMap::iterator ami = obj-mClassInfo-mAttrMap.begin();
+for(; ami != obj-mClassInfo-mAttrMap.end(); ++ami) {
+if(ami-second-mFlags  SA_IMM_ATTR_NO_DANGLING) {
+avmi = obj-mAttrValueMap.find(ami-first);
+osafassert(avmi != obj-mAttrValueMap.end());
+av = avmi-second;
+while(av) {
+if(av-getValueC_str()  !strcmp(av-getValueC_str(), 
noDanglingRef)) {
+return true;
+}
+
+if(av-isMultiValued()) {
+av = ((ImmAttrMultiValue *)av)-getNextAttrValue();
+} else {
+break;
+}
+}
+}
+}
+
+return false;
+}
+
 SaAisErrorT
 ImmModel::searchInitialize(ImmsvOmSearchInit* req, ImmSearchOp op)
 {
@@ -9224,9 +9252,19 @@ ImmModel::searchInitialize(ImmsvOmSearch
 ObjectInfo* obj = NULL;
 ObjectMap::iterator omi;
 ObjectSet::iterator osi;
+bool noDanglingSearch = req-searchOptions  
SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS;
+ObjectInfo* refObj = NULL;
+ObjectMMap::iterator ommi = sReverseRefsNoDanglingMMap.end();
+std::string refObjectName;
 SaUint32T childCount=0;
 
 if(scope == SA_IMM_ONE) {
+if(noDanglingSearch) {
+ LOG_NO(ERR_INVALID_PARAM: SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS 
+ flag cannot be used with SA_IMM_ONE scope);
+ return SA_AIS_ERR_INVALID_PARAM;
+}
+
 return this-accessorGet(req, op);
 }
 
@@ -9245,7 +9283,8 @@ ImmModel::searchInitialize(ImmsvOmSearch
   SA_IMM_SEARCH_GET_SOME_ATTR |
   SA_IMM_SEARCH_GET_CONFIG_ATTR |
   SA_IMM_SEARCH_PERSISTENT_ATTRS |
-  SA_IMM_SEARCH_SYNC_CACHED_ATTRS);
+  SA_IMM_SEARCH_SYNC_CACHED_ATTRS |
+  SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS);
 
 if(unknownOptions) {
 LOG_NO(ERR_INVALID_PARAM: invalid search option 0x%llx,
@@ -9372,6 +9411,51 @@ ImmModel::searchInitialize(ImmsvOmSearch
 */
 osafassert(nameToInternal(objectName));
 }
+} else if(noDanglingSearch) {
+// Validate parameters for searching no dangling references
+if(req-searchParam.choice.oneAttrParam.attrName.size != 0) {
+LOG_NO(ERR_INVALID_PARAM: attrName must be NULL 
+when SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS flag is set);
+err = SA_AIS_ERR_INVALID_PARAM;
+goto searchInitializeExit;
+}
+if(req-searchParam.choice.oneAttrParam.attrValueType != 
SA_IMM_ATTR_SANAMET 
+req-searchParam.choice.oneAttrParam.attrValueType != 
SA_IMM_ATTR_SASTRINGT) {
+LOG_NO(ERR_INVALID_PARAM: attrValueType must be type of SaNameT 
or SaStringT 
+   when SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS flag is set);
+err = SA_AIS_ERR_INVALID_PARAM;
+goto searchInitializeExit;
+}
+
+refObjectName = 
std::string(req-searchParam.choice.oneAttrParam.attrValue.val.x.buf,
+
strnlen(req-searchParam.choice.oneAttrParam.attrValue.val.x.buf,
+
req-searchParam.choice.oneAttrParam.attrValue.val.x.size));
+
+omi = sObjectMap.find(refObjectName);
+if(omi == sObjectMap.end() || (omi-second-mObjFlags  
IMM_CREATE_LOCK)) {
+LOG_NO(ERR_INVALID_PARAM: attrValue contains a DN of non-existing 
object %s,
+   refObjectName.c_str());
+err = SA_AIS_ERR_INVALID_PARAM;
+goto searchInitializeExit;
+}
+
+// Set initialize variables
+refObj = omi-second;
+omi = sObjectMap.end();
+
+ommi = sReverseRefsNoDanglingMMap.find(refObj);
+while(ommi != sReverseRefsNoDanglingMMap.end()  ommi-first == 
refObj 
+!noDanglingRefExist(ommi-second, refObjectName.c_str())) {
+++ommi;
+}
+
+if(ommi != sReverseRefsNoDanglingMMap.end()  ommi-first == refObj) {
+obj = ommi-second;
+getObjectName(obj, objectName);
+} else {
+// There is no any match
+goto searchInitializeExit;
+}
 } else {
 if(childCount  1) {
 /* A root was provided and it has children = Initialize */
@@ -9392,8 +9476,10 @@ 

[devel] [PATCH 1 of 2] IMM: Add support for searching NO_DANGLING references on an object to API [#50]

2013-12-17 Thread Zoran Milinkovic
 osaf/libs/agents/saf/imma/imma_om_api.c |  64 +++-
 osaf/libs/saf/include/saImmOm_A_2_13.h  |  13 ++
 2 files changed, 66 insertions(+), 11 deletions(-)


diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -6027,6 +6027,7 @@ SaAisErrorT saImmOmSearchInitialize_2(Sa
uint32_t proc_rc = NCSCC_RC_SUCCESS;
bool locked = true;
bool isAccGetConfigAttrs = false;
+   bool isNoDanglingSearch = searchOptions  
SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS;
IMMA_CB *cb = imma_cb;
IMMSV_EVT evt;
IMMSV_EVT *out_evt = NULL;
@@ -6059,8 +6060,9 @@ SaAisErrorT saImmOmSearchInitialize_2(Sa
return SA_AIS_ERR_INVALID_PARAM;
}
 
-   if ((searchParam)  ((searchParam-searchOneAttr.attrName == NULL)  
-   (searchParam-searchOneAttr.attrValue != NULL))) {
+   if ((searchParam)  !isNoDanglingSearch 
+   ((searchParam-searchOneAttr.attrName == NULL) 
+   (searchParam-searchOneAttr.attrValue != NULL))) {
TRACE_2(ERR_INVALID_PARAM: attrName is NULL but attrValue is 
not NULL);
TRACE_LEAVE();
return SA_AIS_ERR_INVALID_PARAM;
@@ -6132,6 +6134,40 @@ SaAisErrorT saImmOmSearchInitialize_2(Sa
goto release_lock;
}
 
+   if (isNoDanglingSearch) {
+   if(!cl_node-isImmA2d) {
+   TRACE(ERR_VERSION: search option 
SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS 
+   requires IMM version A.02.13 or 
higher);
+   rc = SA_AIS_ERR_VERSION;
+   goto release_lock;
+   }
+   if(scope == SA_IMM_ONE) {
+   TRACE(ERR_INVALID_PARAM: 
SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS 
+   flag cannot be used with SA_IMM_ONE 
scope);
+   rc = SA_AIS_ERR_INVALID_PARAM;
+   goto release_lock;
+   }
+   if(!searchParam || !searchParam-searchOneAttr.attrValue) {
+   TRACE(ERR_INVALID_PARAM: DN of an object must be 
specified 
+   when 
SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS flag is used);
+   rc = SA_AIS_ERR_INVALID_PARAM;
+   goto release_lock;
+   }
+   if(searchParam-searchOneAttr.attrName) {
+   TRACE(ERR_INVALID_PARAM: attrName must be NULL 
+   when 
SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS flag is used);
+   rc = SA_AIS_ERR_INVALID_PARAM;
+   goto release_lock;
+   }
+   if(searchParam-searchOneAttr.attrValueType != 
SA_IMM_ATTR_SANAMET
+searchParam-searchOneAttr.attrValueType != 
SA_IMM_ATTR_SASTRINGT) {
+   TRACE(ERR_INVALID_PARAM: attrValueType must be 
SA_IMM_ATTR_SANAMET or 
+   SA_IMM_ATTR_SASTRINGT when 
SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS flag is used);
+   rc = SA_AIS_ERR_INVALID_PARAM;
+   goto release_lock;
+   }
+   }
+
/*Create search-node  handle   */
search_node = (IMMA_SEARCH_NODE *)
calloc(1, sizeof(IMMA_SEARCH_NODE));
@@ -6188,18 +6224,24 @@ SaAisErrorT saImmOmSearchInitialize_2(Sa
 
req-scope = scope;
req-searchOptions = searchOptions;
-   if (!searchParam || (!searchParam-searchOneAttr.attrName)) {
+   if (!searchParam || (!searchParam-searchOneAttr.attrName  
!isNoDanglingSearch)) {
req-searchParam.present = ImmOmSearchParameter_PR_NOTHING;
} else {
req-searchParam.present = ImmOmSearchParameter_PR_oneAttrParam;
-   req-searchParam.choice.oneAttrParam.attrName.size = 
strlen(searchParam-searchOneAttr.attrName) + 1;
-   req-searchParam.choice.oneAttrParam.attrName.buf = 
/*alloc-2 */
-   
malloc(req-searchParam.choice.oneAttrParam.attrName.size);
-   strncpy(req-searchParam.choice.oneAttrParam.attrName.buf,
-   (char *)searchParam-searchOneAttr.attrName,
-   
(size_t)req-searchParam.choice.oneAttrParam.attrName.size);
-   
req-searchParam.choice.oneAttrParam.attrName.buf[req-searchParam.choice.oneAttrParam.attrName.size
 -
- 1] = 0;
+
+   if(searchParam-searchOneAttr.attrName) {
+   req-searchParam.choice.oneAttrParam.attrName.size = 
strlen(searchParam-searchOneAttr.attrName) + 1;
+   req-searchParam.choice.oneAttrParam.attrName.buf = 
/*alloc-2 */

[devel] [PATCH 0 of 1] Review Request for IMMTOOLS: fix RDN value with a DN of an associated object in immcfg [#702]

2014-01-02 Thread Zoran Milinkovic
Summary: IMMTOOLS: fix RDN value with a DN of an associated object in immcfg 
[#702]
Review request for Trac Ticket(s): 702
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.2.x, opensaf-4.3.x, default(4.4)
Development branch: default(4.4)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset c1d4723658c97fd09efae45e4ac1efe2dcfc1ae7
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 02 Jan 2014 13:15:55 +0100

IMMTOOLS: fix RDN value with a DN of an associated object in immcfg 
[#702]

Fix RDN value with a DN of an associated object when a new object is 
created
by immcfg.


Complete diffstat:
--
 osaf/tools/safimm/immcfg/imm_cfg.c |  36 +++-
 1 files changed, 19 insertions(+), 17 deletions(-)


Testing Commands:
-
Example:
immcfg -c TestClass 'id=testid=1\,testid=5'


Testing, Expected Results:
--
Create a test class.
Using immcfg, create an object of the new created class with a DN that has only 
object RDN, without parent DN.
With the provided patch, immcfg should not crash.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] IMMTOOLS: fix RDN value with a DN of an associated object in immcfg [#702]

2014-01-02 Thread Zoran Milinkovic
 osaf/tools/safimm/immcfg/imm_cfg.c |  36 +++-
 1 files changed, 19 insertions(+), 17 deletions(-)


Fix RDN value with a DN of an associated object when a new object is created by 
immcfg.

diff --git a/osaf/tools/safimm/immcfg/imm_cfg.c 
b/osaf/tools/safimm/immcfg/imm_cfg.c
--- a/osaf/tools/safimm/immcfg/imm_cfg.c
+++ b/osaf/tools/safimm/immcfg/imm_cfg.c
@@ -427,30 +427,32 @@ int object_create(const SaNameT **object
str = strdup((char*)objectNames[i]-value);
if ((delim = strchr(str, ',')) != NULL) {
/* a parent exist */
-   while (*(delim - 1) == 0x5c) {
+   while (delim  *(delim - 1) == 0x5c) {
/* comma delimiter is escaped, search again */
delim += 2;
delim = strchr(delim, ',');
}
 
-   *delim = '\0';
-   parent = delim + 1;
-   if (!parent) {
-   fprintf(stderr, error - malformed object 
DN\n);
-   goto done;
-   }
+   if(delim) {
+   *delim = '\0';
+   parent = delim + 1;
+   if (!parent) {
+   fprintf(stderr, error - malformed 
object DN\n);
+   goto done;
+   }
 
-   dn.length = sprintf((char*)dn.value, %s, parent);
-   parentName = dn;
-   parentNames[0] = parentName;
+   dn.length = sprintf((char*)dn.value, %s, 
parent);
+   parentName = dn;
+   parentNames[0] = parentName;
 
-   VERBOSE_INFO(call saImmOmAdminOwnerSet for parent: 
%s\n, parent);
-   if ((error = immutil_saImmOmAdminOwnerSet(ownerHandle, 
parentNames, SA_IMM_SUBTREE)) != SA_AIS_OK) {
-   if (error == SA_AIS_ERR_NOT_EXIST)
-   fprintf(stderr, error - parent '%s' 
does not exist\n, dn.value);
-   else {
-   fprintf(stderr, error - 
saImmOmAdminOwnerSet FAILED: %s\n, saf_error(error));
-   goto done;
+   VERBOSE_INFO(call saImmOmAdminOwnerSet for 
parent: %s\n, parent);
+   if ((error = 
immutil_saImmOmAdminOwnerSet(ownerHandle, parentNames, SA_IMM_SUBTREE)) != 
SA_AIS_OK) {
+   if (error == SA_AIS_ERR_NOT_EXIST)
+   fprintf(stderr, error - parent 
'%s' does not exist\n, dn.value);
+   else {
+   fprintf(stderr, error - 
saImmOmAdminOwnerSet FAILED: %s\n, saf_error(error));
+   goto done;
+   }
}
}
}

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 1] Review Request for clm: fix test suites [#219]

2014-01-03 Thread Zoran Milinkovic
Hi Mathi,

OpenSAF fails to compile after pushing the patch #219.

  CC clmtest-tet_saClmResponse.o
../../tests/clmsv/src/tet_saClmResponse.c: In function 'saClmResponse_01':
../../tests/clmsv/src/tet_saClmResponse.c:94:13: error: variable 'ret' set but 
not used [-Werror=unused-but-set-variable]
../../tests/clmsv/src/tet_saClmResponse.c: In function 'saClmResponse_02':
../../tests/clmsv/src/tet_saClmResponse.c:134:13: error: variable 'ret' set but 
not used [-Werror=unused-but-set-variable]
../../tests/clmsv/src/tet_saClmResponse.c: In function 'saClmResponse_03':
../../tests/clmsv/src/tet_saClmResponse.c:175:13: error: variable 'ret' set but 
not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make[2]: *** [clmtest-tet_saClmResponse.o] Error 1

Best regards,
Zoran

-Original Message-
From: mathi.naic...@oracle.com [mailto:mathi.naic...@oracle.com] 
Sent: den 30 december 2013 13:56
To: ramesh.bet...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 0 of 1] Review Request for clm: fix test suites [#219]

Summary: clm: fix test suites [#219]
Review request for Trac Ticket(s): #219
Peer Reviewer(s): Ramesh
Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE Affected branch(es): 
LIST ALL AFFECTED BRANCH(ES) Development branch: IF ANY GIVE THE REPO 
URL


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each y above):
-
This patch attempts a stab at fixing the CLM test suites.

changeset 8c074b46a75594e2b64a74ab71839b8c725e4dcd
Author: Mathivanan N.P.mathi.naic...@oracle.com
Date:   Mon, 30 Dec 2013 18:22:04 +0530

clm: fix test suites [#219] Test suites 7 and 9, even though can be run
manually, it is not guaranteed to succeed always because it involves 
admin
operations on CLM nodes and by default it works on PL-3. 9 would require
manual run in parallel with admin operations. This is just a first stab


Complete diffstat:
--
 tests/clmsv/src/tet_ClmOiOps.c |  12 ++--
 tests/clmsv/src/tet_saClmClusterNodeGet.c  |  31 
---
 tests/clmsv/src/tet_saClmClusterNodeGetAsync.c |   4 ++--
 tests/clmsv/src/tet_saClmClusterNotificationFree.c |   2 +-
 tests/clmsv/src/tet_saClmClusterTrack.c|  52 
+++-
 tests/clmsv/src/tet_saClmClusterTrackStop.c|   4 ++--
 tests/clmsv/src/tet_saClmResponse.c|  91 
++-
 7 files changed, 140 insertions(+), 56 deletions(-)


Testing Commands:
-
./clmtest 1 ... 10

Testing, Expected Results:
--
Except one or two, the rest of them should pass.

Conditions of Submission:
-
Ack from Ramesh or timeout on thursday.

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y 
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have 

[devel] [PATCH 0 of 1] Review Request for IMMTEST: add new test cases for NO_DANGLING flag [#636]

2014-01-16 Thread Zoran Milinkovic
Summary: IMMTEST: add new test cases for NO_DANGLING flag [#636]
Review request for Trac Ticket(s): 636
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.4.x, default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each y above):
-

changeset 2712ca2144d20f371dc462264ba722e6eb82031f
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 16 Jan 2014 12:48:29 +0100

IMMTEST: add new test cases for NO_DANGLING flag [#636]


Complete diffstat:
--
 tests/immsv/common/immtest.c   |  145 
+++-
 tests/immsv/common/immtest.h   |   23 ++
 tests/immsv/implementer/test_saImmOiAugmentCcbInitialize.c |   26 +-
 tests/immsv/management/test_cleanup.c  |6 ++-
 tests/immsv/management/test_saImmOmCcbInitialize.c |   38 

 tests/immsv/management/test_saImmOmCcbObjectCreate_2.c |  328 
++
 tests/immsv/management/test_saImmOmCcbObjectDelete.c   |  262 

 tests/immsv/management/test_saImmOmCcbObjectModify_2.c |  234 

 tests/immsv/management/test_saImmOmClassCreate_2.c |   36 

 tests/immsv/management/test_saImmOmClassDescriptionGet_2.c |   35 
+++
 10 files changed, 1116 insertions(+), 17 deletions(-)


Testing Commands:
-
immomtest


Testing, Expected Results:
--
All tests must pass


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain

[devel] [PATCH 0 of 1] Review Request for IMM: fix wrong error codes in README.NO_DANGLING [#726]

2014-01-16 Thread Zoran Milinkovic
Summary: IMM: fix wrong error codes in README.NO_DANGLING [#726]
Review request for Trac Ticket(s): 726
Peer Reviewer(s): Neelakanta, Anders
Pull request to: Zoran
Affected branch(es): opensaf-4.4.x, default(4.5)
Development branch: 


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 831e17f0116b2b157a14ea8be9f798f5336a8205
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 16 Jan 2014 13:20:37 +0100

IMM: fix wrong error codes in README.NO_DANGLING [#726]


Complete diffstat:
--
 osaf/services/saf/immsv/README.NO_DANGLING |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] IMM: fix wrong error codes in README.NO_DANGLING [#726]

2014-01-16 Thread Zoran Milinkovic
 osaf/services/saf/immsv/README.NO_DANGLING |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/osaf/services/saf/immsv/README.NO_DANGLING 
b/osaf/services/saf/immsv/README.NO_DANGLING
--- a/osaf/services/saf/immsv/README.NO_DANGLING
+++ b/osaf/services/saf/immsv/README.NO_DANGLING
@@ -65,7 +65,7 @@ of ccbApply:
 -  CCB Object Create:
 
 o   If the created object has a NO_DANGLING reference to a non-persistent
-runtime object, return BAD_OPERATION.
+runtime object, return INVALID_PARAM.
 
 o   If the created object has a NO_DANGLING reference to an object deleted
 within the same CCB, return BAD_OPERATION.
@@ -79,7 +79,7 @@ o   If the created object has a NO_DANGL
 -  CCB Object Modify (Add or Replace attribute value):
 
 o   If an updated attribute value has a NO_DANGLING reference to a
-non-persistent runtime object, return BAD_OPERATION.
+non-persistent runtime object, return INVALID_PARAM.
 
 o   If an updated attribute value has a NO_DANGLING reference to an object that
 is deleted within the same CCB, return BAD_OPERATION.

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 1] Review Request for IMM: README clarified ccb-op return codes for NO_DANGLING errors (#754)

2014-01-31 Thread Zoran Milinkovic
Hi Anders,

Ack from me,
Zoran

-Original Message-
From: Anders Björnerstedt 
Sent: den 30 januari 2014 14:23
To: reddy.neelaka...@oracle.com; Zoran Milinkovic; sirisha.a...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 0 of 1] Review Request for IMM: README clarified ccb-op return 
codes for NO_DANGLING errors (#754)

Summary: IMM: README clarified ccb-op return codes for NO_DANGLING errors 
(#754) Review request for Trac Ticket(s): 754 Peer Reviewer(s): Neel, Sirisha, 
Zoran Pull request to: 
Affected branch(es): 4.4; default(4.5)
Development branch: 


Impacted area   Impact y/n

 Docsy
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 20857d0d451e3b89befc70eb614b98741fb1932e
Author: Anders Bjornerstedt anders.bjornerst...@ericsson.com
Date:   Thu, 30 Jan 2014 14:15:57 +0100

IMM: README clarified ccb-op return codes for NO_DANGLING errors (#754)


Complete diffstat:
--
 osaf/services/saf/immsv/README.NO_DANGLING |  36 
+---
 1 files changed, 29 insertions(+), 7 deletions(-)


Testing Commands:
-

Testing, Expected Results:
--

Conditions of Submission:
-

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] osaf: fix compiling problem for 32-bit environment [#758]

2014-02-03 Thread Zoran Milinkovic
 osaf/libs/saf/include/saImmOm_A_2_13.h|  2 +-
 osaf/libs/saf/include/saNtf.h |  2 +-
 tests/clmsv/src/tet_saClmClusterNodeGet.c |  2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/osaf/libs/saf/include/saImmOm_A_2_13.h 
b/osaf/libs/saf/include/saImmOm_A_2_13.h
--- a/osaf/libs/saf/include/saImmOm_A_2_13.h
+++ b/osaf/libs/saf/include/saImmOm_A_2_13.h
@@ -63,7 +63,7 @@ extern C {
 #define SA_IMM_SEARCH_GET_CONFIG_ATTR 0x0001   / * See: 
http://devel.opensaf.org/ticket/1897
   Supported in OpenSaf 4.3 * /
 */
-#define SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS  0x0001/* See: 
https://sourceforge.net/p/opensaf/tickets/50/
+#define SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS  0x0001ull/* See: 
https://sourceforge.net/p/opensaf/tickets/50/

Supported in OpenSaf 4.4 */
 
 
diff --git a/osaf/libs/saf/include/saNtf.h b/osaf/libs/saf/include/saNtf.h
--- a/osaf/libs/saf/include/saNtf.h
+++ b/osaf/libs/saf/include/saNtf.h
@@ -622,7 +622,7 @@ typedef struct {
 SaNtfNotificationFilterHandleT miscellaneousFilterHandle;
 } SaNtfNotificationTypeFilterHandlesT_3;
 
-#define SA_NTF_FILTER_HANDLE_NULL   ((SaNtfNotificationFilterHandleT) NULL)
+#define SA_NTF_FILTER_HANDLE_NULL   ((SaNtfNotificationFilterHandleT) 0)
 
 #if defined(SA_NTF_A01) || defined(SA_NTF_A02)
 typedef struct {
diff --git a/tests/clmsv/src/tet_saClmClusterNodeGet.c 
b/tests/clmsv/src/tet_saClmClusterNodeGet.c
--- a/tests/clmsv/src/tet_saClmClusterNodeGet.c
+++ b/tests/clmsv/src/tet_saClmClusterNodeGet.c
@@ -20,7 +20,7 @@
 SaClmClusterNodeT clusterNode_1;
 SaClmClusterNodeT_4 clusterNode_4;
 SaClmNodeIdT nodeId;
-SaTimeT timeout = 100;
+SaTimeT timeout = 100ll;
 
 void saClmClusterNodeGet_01(void)
 {  

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for osaf: fix compiling problem for 32-bit environment [#758]

2014-02-03 Thread Zoran Milinkovic
Summary: osaf: fix compiling problem for 32-bit environment [#758]
Review request for Trac Ticket(s): 758
Peer Reviewer(s): Sirisha
Pull request to: Zoran
Affected branch(es): opensaf-4.4.x, default(4.5)
Development branch: opensaf-4.4.x


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each y above):
-

changeset dd89c701f85342ff48f64c0e18637dff6cd60ea0
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Mon, 03 Feb 2014 13:12:15 +0100

osaf: fix compiling problem for 32-bit environment [#758]


Complete diffstat:
--
 osaf/libs/saf/include/saImmOm_A_2_13.h|  2 +-
 osaf/libs/saf/include/saNtf.h |  2 +-
 tests/clmsv/src/tet_saClmClusterNodeGet.c |  2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
The code should compile in 32-bit environment


Conditions of Submission:
-
Ack from Sirisha


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 2 of 2] IMMTOOLS: add support for forwards compatibility of attribute flags [#116]

2014-02-18 Thread Zoran Milinkovic
 osaf/tools/safimm/immcfg/imm_cfg.c |   31 +++-
 osaf/tools/safimm/immcfg/imm_import.cc |  196 -
 osaf/tools/safimm/immdump/imm_dumper.cc|  170 +++-
 osaf/tools/safimm/immdump/imm_dumper.hh|2 +
 osaf/tools/safimm/immdump/imm_xmlw_dump.cc |   13 +-
 osaf/tools/safimm/immlist/Makefile.am  |4 +
 osaf/tools/safimm/immlist/imm_list.c   |  191 -
 osaf/tools/safimm/immload/imm_loader.cc|  164 -
 8 files changed, 749 insertions(+), 22 deletions(-)


For forwards compatibility, OpenSAF schema, where unknown attribute flags are 
defined, must be provided to IMM tools (immcfg, immlist, immfind) using -X flag.
If immload finds unknown attribute flag, immload will try to find the attribute 
flag in the schema defined in the top element of the loading IMM XML file.

diff --git a/osaf/tools/safimm/immcfg/imm_cfg.c 
b/osaf/tools/safimm/immcfg/imm_cfg.c
--- a/osaf/tools/safimm/immcfg/imm_cfg.c
+++ b/osaf/tools/safimm/immcfg/imm_cfg.c
@@ -56,7 +56,7 @@ typedef enum {
 #define VERBOSE_INFO(format, args...) if (verbose) { fprintf(stderr, format, 
##args); }
 
 // The interface function which implements the -f opton (imm_import.cc)
-int importImmXML(char* xmlfileC, char* adminOwnerName, int verbose, int 
ccb_safe);
+int importImmXML(char* xmlfileC, char* adminOwnerName, int verbose, int 
ccb_safe, const char *xsdPath);
 
 const SaImmCcbFlagsT defCcbFlags = SA_IMM_CCB_REGISTERED_OI | 
SA_IMM_CCB_ALLOW_NULL_OI;
 
@@ -86,6 +86,7 @@ static void usage(const char *progname)
printf(\t--ignore-duplicates  (only valid with -f/--file option, 
default)\n);
printf(\t--delete-class classname [classname2]... \n);
printf(\t-u, --unsafe\n);
+   printf(\t-X, --xsd path_to_schema.xsd\n);
 
printf(\nEXAMPLE\n);
printf(\timmcfg -a saAmfNodeSuFailoverMax=7 
safAmfNode=Node01,safAmfCluster=1\n);
@@ -102,6 +103,10 @@ static void usage(const char *progname)
printf(\t\tremove a value from an attribute\n);
printf(\timmcfg -u .\n);
printf(\t\tThe CCBs generated by immcfg will have 
SA_IMM_CCB_REGISTERED_OI set to false, allowing ccb commit when OIs are 
missing\n);
+   printf(\timmcfg -X /etc/opensaf/schema.xsd -f imm.xml\n);
+   printf(\t\timmcfg will load unsupported attribute flags in the current 
OpenSAF version from /etc/opensaf/schema.xsd, and use them to successfully 
import imm.xml);
+   printf(\timmcfg -X /etc/opensaf -f imm.xml\n);
+   printf(\t\timmcfg will load unsupported attribute flags in the current 
OpenSAF version from the schema specified in imm.xml which is stored in 
/etc/opensaf, and use loaded flags to successfully import imm.xml);
 }
 
 /* signal handler for SIGALRM */
@@ -682,6 +687,7 @@ int main(int argc, char *argv[])
{timeout, required_argument, NULL, 't'},
{verbose, no_argument, NULL, 'v'},
{unsafe, no_argument, NULL, 'u'},
+   {xsd, required_argument, NULL, 'X'},
{0, 0, 0, 0}
};
SaAisErrorT error;
@@ -703,9 +709,11 @@ int main(int argc, char *argv[])
int i;
unsigned long timeoutVal = 60;
 
+   char *xsdPath = NULL;
+
while (1) {
int option_index = 0;
-   c = getopt_long(argc, argv, a:c:f:t:dhmvu, long_options, 
option_index);
+   c = getopt_long(argc, argv, a:c:f:t:dhmvuX:, long_options, 
option_index);
 
if (c == -1)/* have all command-line options have been 
parsed? */
break;
@@ -751,6 +759,13 @@ int main(int argc, char *argv[])
op = verify_setoption(op, MODIFY_OBJECT);
break;
}
+   case 'X':
+   if(xsdPath) {
+   fprintf(stderr, XSD path is already set\n);
+   exit(EXIT_FAILURE);
+   }
+   xsdPath = strdup(optarg);
+   break;
default:
fprintf(stderr, Try '%s --help' for more 
information\n, argv[0]);
exit(EXIT_FAILURE);
@@ -767,7 +782,7 @@ int main(int argc, char *argv[])

if (op == LOAD_IMMFILE) {
VERBOSE_INFO(importImmXML(xmlFilename=%s, verbose=%d)\n, 
xmlFilename, verbose);
-   rc = importImmXML(xmlFilename, adminOwnerName, verbose, 
ccb_safe);
+   rc = importImmXML(xmlFilename, adminOwnerName, verbose, 
ccb_safe, xsdPath);
exit(rc);
}
 
@@ -854,10 +869,14 @@ int main(int argc, char *argv[])
  done_om_finalize:
error = immutil_saImmOmFinalize(immHandle);
if (SA_AIS_OK != error) {
-fprintf(stderr, error - saImmOmFinalize FAILED: %s\n, 
saf_error(error));
-rc = EXIT_FAILURE;
-}
+

[devel] [PATCH 1 of 2] IMM: add support for forwards compatibility of attribute flags [#116]

2014-02-18 Thread Zoran Milinkovic
 osaf/services/saf/immsv/immnd/ImmModel.cc  |  39 
-
 osaf/services/saf/immsv/immnd/ImmSearchOp.cc   |   2 +-
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh   |   4 +-
 osaf/services/saf/immsv/schema/SAI-AIS-IMM-XSD-A.01.02_OpenSAF.xsd |  10 +-
 4 files changed, 40 insertions(+), 15 deletions(-)


diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc 
b/osaf/services/saf/immsv/immnd/ImmModel.cc
--- a/osaf/services/saf/immsv/immnd/ImmModel.cc
+++ b/osaf/services/saf/immsv/immnd/ImmModel.cc
@@ -72,7 +72,7 @@ struct AttrInfo
 {
 AttrInfo():mValueType(0), mFlags(0), mNtfId(0){}
 SaUint32T   mValueType;
-SaUint32T   mFlags;
+SaImmAttrFlagsT mFlags;
 SaUint32T   mNtfId;
 ImmAttrValuemDefaultValue;
 };
@@ -2219,6 +2219,7 @@ ImmModel::classCreate(const ImmsvOmClass
 int illegal=0;
 bool persistentRt = false;
 bool persistentRdn = false;
+bool useUnknownFlag = false;
 ClassInfo* classInfo = NULL;
 ClassInfo* prevClassInfo = NULL;
 ClassInfo dummyClass(req-classCategory);
@@ -2423,7 +2424,10 @@ ImmModel::classCreate(const ImmsvOmClass
 }
 }
 err = attrCreate(classInfo, attr, attrName);
-if(err != SA_AIS_OK) {
+if(err == SA_AIS_ERR_NOT_SUPPORTED) {
+useUnknownFlag = true;
+err = SA_AIS_OK;
+} else if(err != SA_AIS_OK) {
 illegal = 1;
 }
 list = list-next;
@@ -2476,6 +2480,10 @@ ImmModel::classCreate(const ImmsvOmClass
 goto done;
 }
 
+if(useUnknownFlag) {
+LOG_NO(At least one attribute in class %s has unsupported attribute 
flag, className.c_str());
+}
+
 /* All checks passed, now install the class def. */
 
 if(!schemaChange) {
@@ -3054,12 +3062,29 @@ ImmModel::attrCreate(ClassInfo* classInf
 }
 }
 
-TRACE_5(create attribute '%s', attrName.c_str());
+SaImmAttrFlagsT unknownFlags = attr-attrFlags 
+  ~(SA_IMM_ATTR_MULTI_VALUE |
+SA_IMM_ATTR_RDN |
+SA_IMM_ATTR_CONFIG |
+SA_IMM_ATTR_WRITABLE |
+SA_IMM_ATTR_INITIALIZED |
+SA_IMM_ATTR_RUNTIME |
+SA_IMM_ATTR_PERSISTENT |
+SA_IMM_ATTR_CACHED);
+
+if(unknownFlags) {
+/* This error means that at least one attribute flag is not 
supported by OpenSAF,
+ * but because of forward compatibility, future flags must be 
supported.
+ */
+err = SA_AIS_ERR_NOT_SUPPORTED;
+TRACE_5(create attribute '%s' with unknown flag(s), attribute 
flag: %llu, attrName.c_str(), attr-attrFlags);
+} else {
+TRACE_5(create attribute '%s', attrName.c_str());
+}
 
 AttrInfo* attrInfo = new AttrInfo;
 attrInfo-mValueType = attr-attrValueType;
-osafassert(attr-attrFlags  0x);
-attrInfo-mFlags = (SaUint32T) attr-attrFlags;
+attrInfo-mFlags = attr-attrFlags;
 attrInfo-mNtfId = attr-attrNtfId;
 if(attr-attrDefaultValue) {
 IMMSV_OCTET_STRING tmpos; //temporary octet string
@@ -3142,13 +3167,13 @@ ImmModel::classDescriptionGet(const IMMS
 
 struct AttrFlagIncludes
 {
-AttrFlagIncludes(SaUint32T attrFlag) : mFlag(attrFlag) { }
+AttrFlagIncludes(SaImmAttrFlagsT attrFlag) : mFlag(attrFlag) { }
 
 bool operator() (AttrMap::value_type item) const {
 return (item.second-mFlags  mFlag) != 0;
 }
 
-SaUint32T mFlag;
+SaImmAttrFlagsT mFlag;
 };
 
 struct IdIs
diff --git a/osaf/services/saf/immsv/immnd/ImmSearchOp.cc 
b/osaf/services/saf/immsv/immnd/ImmSearchOp.cc
--- a/osaf/services/saf/immsv/immnd/ImmSearchOp.cc
+++ b/osaf/services/saf/immsv/immnd/ImmSearchOp.cc
@@ -51,7 +51,7 @@ ImmSearchOp::addObject(
 void
 ImmSearchOp::addAttribute(const std::string attributeName, 
 SaUint32T valueType,
-SaUint32T flags)
+SaImmAttrFlagsT flags)
 
 {
 SearchObject obj = mResultList.back();
diff --git a/osaf/services/saf/immsv/immnd/ImmSearchOp.hh 
b/osaf/services/saf/immsv/immnd/ImmSearchOp.hh
--- a/osaf/services/saf/immsv/immnd/ImmSearchOp.hh
+++ b/osaf/services/saf/immsv/immnd/ImmSearchOp.hh
@@ -32,7 +32,7 @@ struct SearchAttribute
 std::string name;
 ImmAttrValue* valuep;
 SaImmValueTypeT  valueType;
-SaUint32T flags;
+SaImmAttrFlagsT flags;
 
 ~SearchAttribute();
 };
@@ -63,7 +63,7 @@ public:
 void  addAttribute(
const std::string attributeName, 
SaUint32T valueType,
-   SaUint32T flags);
+   SaImmAttrFlagsT flags);
 void  addAttrValue(const ImmAttrValue value);
 void  setImplementer(
  SaUint32T conn, 
diff --git 

[devel] [PATCH 0 of 2] Review Request for IMM: add support for forwards compatibility of attribute flags [#116]

2014-02-18 Thread Zoran Milinkovic
Summary: IMM: add support for forwards compatibility of attribute flags [#116]
Review request for Trac Ticket(s): 116
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.2.x
Development branch: opensaf-4.2.x


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 7f121b591dd1c5464ee9f1070058ded74650b913
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 18 Feb 2014 15:56:38 +0100

IMM: add support for forwards compatibility of attribute flags [#116]

changeset 46e2af8f3017b450b8e714574df02b3dcea20a98
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 18 Feb 2014 16:06:11 +0100

IMMTOOLS: add support for forwards compatibility of attribute flags 
[#116]

For forwards compatibility, OpenSAF schema, where unknown attribute 
flags
are defined, must be provided to IMM tools (immcfg, immlist, immfind) 
using
-X flag. If immload finds unknown attribute flag, immload will try to 
find
the attribute flag in the schema defined in the top element of the 
loading
IMM XML file.


Complete diffstat:
--
 osaf/services/saf/immsv/immnd/ImmModel.cc  |   39 
++
 osaf/services/saf/immsv/immnd/ImmSearchOp.cc   |2 +-
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh   |4 +-
 osaf/services/saf/immsv/schema/SAI-AIS-IMM-XSD-A.01.02_OpenSAF.xsd |   10 
+++---
 osaf/tools/safimm/immcfg/imm_cfg.c |   31 
+
 osaf/tools/safimm/immcfg/imm_import.cc |  196 
+++--
 osaf/tools/safimm/immdump/imm_dumper.cc|  170 
---
 osaf/tools/safimm/immdump/imm_dumper.hh|2 +
 osaf/tools/safimm/immdump/imm_xmlw_dump.cc |   13 
-
 osaf/tools/safimm/immlist/Makefile.am  |4 ++
 osaf/tools/safimm/immlist/imm_list.c   |  191 
+-
 osaf/tools/safimm/immload/imm_loader.cc|  164 
++-
 12 files changed, 789 insertions(+), 37 deletions(-)


Testing Commands:
-
immcfg -X schema_with_unknown_flags.xsd imm.xml
immlist -X schema_with_unknown_flags.xsd -c test_class
immdump -X schema_with_unknown_flags.xsd test.xml


Testing, Expected Results:
--
Beside IMM tools test, it must be tested that unknown flags imported into IMM 
will survive OpenSAF restart.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code

[devel] [PATCH 0 of 2] Review Request for IMM: add support for forwards compatibility of attribute flags [#116]

2014-02-18 Thread Zoran Milinkovic
Summary: IMM: add support for forwards compatibility of attribute flags [#116]
Review request for Trac Ticket(s): 116
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.3.x
Development branch: opensaf-4.3.x


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 4e107d75f25bb46d71db0de3fd6ca8700be57f61
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 18 Feb 2014 15:57:23 +0100

IMM: add support for forwards compatibility of attribute flags [#116]

changeset 91e6dc516587d64e91c4ad3c5e1e6b6db4d8ca0b
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 18 Feb 2014 16:06:28 +0100

IMMTOOLS: add support for forwards compatibility of attribute flags 
[#116]

For forwards compatibility, OpenSAF schema, where unknown attribute 
flags
are defined, must be provided to IMM tools (immcfg, immlist, immfind) 
using
-X flag. If immload finds unknown attribute flag, immload will try to 
find
the attribute flag in the schema defined in the top element of the 
loading
IMM XML file.


Complete diffstat:
--
 osaf/libs/common/immsv/immpbe_dump.cc  |2 +-
 osaf/services/saf/immsv/immloadd/imm_loader.cc |  164 
+-
 osaf/services/saf/immsv/immnd/ImmModel.cc  |   36 
--
 osaf/services/saf/immsv/immnd/ImmSearchOp.cc   |2 +-
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh   |4 +-
 osaf/services/saf/immsv/schema/SAI-AIS-IMM-XSD-A.02.12.xsd |   14 +-
 osaf/tools/safimm/immcfg/imm_cfg.c |   31 
++
 osaf/tools/safimm/immcfg/imm_import.cc |  196 
+++--
 osaf/tools/safimm/immdump/imm_dumper.cc|  168 
++--
 osaf/tools/safimm/immdump/imm_dumper.hh|2 +
 osaf/tools/safimm/immdump/imm_xmlw_dump.cc |   11 
 osaf/tools/safimm/immlist/Makefile.am  |4 ++
 osaf/tools/safimm/immlist/imm_list.c   |  191 
+-
 13 files changed, 780 insertions(+), 45 deletions(-)


Testing Commands:
-
immcfg -X schema_with_unknown_flags.xsd imm.xml
immlist -X schema_with_unknown_flags.xsd -c test_class
immdump -X schema_with_unknown_flags.xsd test.xml


Testing, Expected Results:
--
Beside IMM tools test, it must be tested that unknown flags imported into IMM 
will survive OpenSAF restart.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code

[devel] [PATCH 1 of 2] IMM: add support for forwards compatibility of attribute flags [#116]

2014-02-18 Thread Zoran Milinkovic
 osaf/libs/common/immsv/immpbe_dump.cc  |2 +-
 osaf/services/saf/immsv/immloadd/imm_loader.cc |  164 -
 osaf/services/saf/immsv/immnd/ImmModel.cc  |   36 +-
 osaf/services/saf/immsv/immnd/ImmSearchOp.cc   |2 +-
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh   |4 +-
 osaf/services/saf/immsv/schema/SAI-AIS-IMM-XSD-A.02.12.xsd |   14 +-
 6 files changed, 196 insertions(+), 26 deletions(-)


diff --git a/osaf/libs/common/immsv/immpbe_dump.cc 
b/osaf/libs/common/immsv/immpbe_dump.cc
--- a/osaf/libs/common/immsv/immpbe_dump.cc
+++ b/osaf/libs/common/immsv/immpbe_dump.cc
@@ -873,7 +873,7 @@ ClassInfo* classToPBE(std::string classN
LOG_ER(Failed to bind attr_type with error code: %d, 
rc);
goto bailout;
}
-   if((rc = sqlite3_bind_int(stmt, 4, (*p)-attrFlags)) != 
SQLITE_OK) {
+   if((rc = sqlite3_bind_int64(stmt, 4, (*p)-attrFlags)) != 
SQLITE_OK) {
LOG_ER(Failed to bind attr_flags with error code: %d, 
rc);
goto bailout;
}
diff --git a/osaf/services/saf/immsv/immloadd/imm_loader.cc 
b/osaf/services/saf/immsv/immloadd/imm_loader.cc
--- a/osaf/services/saf/immsv/immloadd/imm_loader.cc
+++ b/osaf/services/saf/immsv/immloadd/imm_loader.cc
@@ -18,6 +18,7 @@
 #include imm_loader.hh
 #include iostream
 #include libxml/parser.h
+#include libxml/xpath.h
 #include stdio.h
 #include stdlib.h
 #include unistd.h
@@ -26,6 +27,7 @@
 #include configmake.h
 #include logtrace.h
 #include sys/stat.h
+#include errno.h
 
 #define MAX_DEPTH 10
 #define MAX_CHAR_BUFFER_SIZE 8192  //8k
@@ -111,6 +113,22 @@ typedef struct ParserStateStruct
 SaImmHandleT ccbHandle;
 } ParserState;
 
+bool isXsdLoaded;
+std::string xsddir;
+std::string xsd;
+typedef std::mapstd::string, SaImmAttrFlagsT AttrFlagMap;
+AttrFlagMap attrFlagMap;
+
+static SaImmAttrFlagsT attrFlagMask = (SA_IMM_ATTR_RUNTIME
+   | SA_IMM_ATTR_CONFIG
+   | SA_IMM_ATTR_MULTI_VALUE
+   | SA_IMM_ATTR_WRITABLE
+   | SA_IMM_ATTR_INITIALIZED
+   | SA_IMM_ATTR_PERSISTENT
+   | SA_IMM_ATTR_CACHED
+   | SA_IMM_ATTR_NOTIFY
+   | SA_IMM_ATTR_NO_DUPLICATES);
+
 /* Helper functions */
 
 static void addToAttrTypeCache(ParserState*, SaImmValueTypeT);
@@ -874,6 +892,13 @@ static void startElementHandler(void* us
 else if (strcmp((const char*)name, imm:IMM-contents) == 0)
 {
 state-state[state-depth] = IMM_CONTENTS;
+char *schema = (char *)getAttributeValue(attrs, (xmlChar 
*)noNamespaceSchemaLocation);
+if(!schema) {
+schema = (char *)getAttributeValue(attrs, (xmlChar 
*)xsi:noNamespaceSchemaLocation);
+}
+if(schema) {
+xsd = schema;
+}
 }
 else
 {
@@ -1424,6 +1449,121 @@ static xmlEntityPtr
 return xmlGetPredefinedEntity(name);
 }
 
+static inline char *getAttrValue(xmlAttributePtr attr) {
+if(!attr || !attr-children) {
+return NULL;
+}
+
+return (char *)attr-children-content;
+}
+
+static bool loadXsd(const char *xsdFile) {
+   struct stat st;
+   if(stat(xsdFile, st)) {
+   if(errno == ENOENT) {
+   LOG_ER(%s does not exist, xsdFile);
+   } else {
+   LOG_ER(stat of %s return error: %d, xsdFile, errno);
+   }
+
+   return false;
+   }
+   // It should be a file or a directory
+   if(!S_ISREG(st.st_mode)) {
+   LOG_ER(%s is not a file, xsdFile);
+   return false;
+   }
+
+   xmlNodePtr xsdDocRoot;
+   xmlDocPtr xsdDoc = xmlParseFile(xsdFile);
+   if(!xsdDoc) {
+   return false;
+   }
+
+   bool rc = true;
+   xmlXPathContextPtr ctx = xmlXPathNewContext(xsdDoc);
+   if(!ctx) {
+   rc = false;
+   goto freedoc;
+   }
+
+   //  Add namespace of the first element
+   xsdDocRoot = xmlDocGetRootElement(xsdDoc);
+   if(xsdDocRoot-ns) {
+   ctx-namespaces = (xmlNsPtr *)malloc(sizeof(xmlNsPtr));
+   ctx-namespaces[0] = xsdDocRoot-ns;
+   ctx-nsNr = 1;
+   }
+
+   xmlXPathObjectPtr xpathObj;
+   xpathObj = xmlXPathEval((const 
xmlChar*)/xs:schema/xs:simpleType[@name=\attr-flags\]/xs:restriction/xs:enumeration,
 ctx);
+   if(!xpathObj || !xpathObj-nodesetval) {
+   rc = false;
+   goto freectx;
+   }
+
+   xmlElementPtr element;
+   xmlAttributePtr attr;
+   char *id;
+   char *value;
+   int size;
+
+   size = xpathObj-nodesetval-nodeNr;
+   for(int i=0; isize; i++) {
+   id = NULL;
+   value = NULL;
+   element = (xmlElementPtr)xpathObj-nodesetval-nodeTab[i];
+   attr = 

[devel] [PATCH 2 of 2] IMMTOOLS: add support for forwards compatibility of attribute flags [#116]

2014-02-18 Thread Zoran Milinkovic
 osaf/tools/safimm/immcfg/imm_cfg.c |   31 +++-
 osaf/tools/safimm/immcfg/imm_import.cc |  196 -
 osaf/tools/safimm/immdump/imm_dumper.cc|  168 +++-
 osaf/tools/safimm/immdump/imm_dumper.hh|2 +
 osaf/tools/safimm/immdump/imm_xmlw_dump.cc |   11 +
 osaf/tools/safimm/immlist/Makefile.am  |4 +
 osaf/tools/safimm/immlist/imm_list.c   |  191 -
 7 files changed, 584 insertions(+), 19 deletions(-)


For forwards compatibility, OpenSAF schema, where unknown attribute flags are 
defined, must be provided to IMM tools (immcfg, immlist, immfind) using -X flag.
If immload finds unknown attribute flag, immload will try to find the attribute 
flag in the schema defined in the top element of the loading IMM XML file.

diff --git a/osaf/tools/safimm/immcfg/imm_cfg.c 
b/osaf/tools/safimm/immcfg/imm_cfg.c
--- a/osaf/tools/safimm/immcfg/imm_cfg.c
+++ b/osaf/tools/safimm/immcfg/imm_cfg.c
@@ -65,7 +65,7 @@ typedef enum {
 #define VERBOSE_INFO(format, args...) if (verbose) { fprintf(stderr, format, 
##args); }
 
 // Interface functions which implement -f and -L options (imm_import.cc)
-int importImmXML(char* xmlfileC, char* adminOwnerName, int verbose, int 
ccb_safe);
+int importImmXML(char* xmlfileC, char* adminOwnerName, int verbose, int 
ccb_safe, const char *xsdPath);
 int validateImmXML(const char *xmlfile, int verbose);
 
 
@@ -103,6 +103,7 @@ static void usage(const char *progname)
printf(\t-L, --validate imm.xml file\n);
printf(\t-o, --admin-owner admin owner name\n);
printf(\t--admin-owner-clear\n);
+   printf(\t-X, --xsd path_to_schema.xsd\n);
 
printf(\nEXAMPLE\n);
printf(\timmcfg -a saAmfNodeSuFailoverMax=7 
safAmfNode=Node01,safAmfCluster=1\n);
@@ -127,6 +128,10 @@ static void usage(const char *progname)
printf(\t\tuse 'myAdminOwnerName' as admin owner name for changing one 
attribute of one object\n);
printf(\timmcfg --admin-owner-clear 
safAmfNode=Node01,safAmfCluster=1\n);
printf(\t\tclear admin owner from one object\n);
+   printf(\timmcfg -X /etc/opensaf/schema.xsd -f imm.xml\n);
+   printf(\t\timmcfg will load unsupported attribute flags in the current 
OpenSAF version from /etc/opensaf/schema.xsd, and use them to successfully 
import imm.xml);
+   printf(\timmcfg -X /etc/opensaf -f imm.xml\n);
+   printf(\t\timmcfg will load unsupported attribute flags in the current 
OpenSAF version from the schema specified in imm.xml which is stored in 
/etc/opensaf, and use loaded flags to successfully import imm.xml);
 }
 
 /* signal handler for SIGALRM */
@@ -854,6 +859,7 @@ int main(int argc, char *argv[])
{disable-attr-notify, no_argument, NULL, 0},
{admin-owner, required_argument, NULL, 'o'},
{admin-owner-clear, no_argument, NULL, 0},
+   {xsd, required_argument, NULL, 'X'},
{0, 0, 0, 0}
};
SaAisErrorT error;
@@ -879,9 +885,11 @@ int main(int argc, char *argv[])
unsigned long timeoutVal = 60;
attr_notify_t attrNotify = NOTIFY_UNDEFINED;
 
+   char *xsdPath = NULL;
+
while (1) {
int option_index = 0;
-   c = getopt_long(argc, argv, a:c:f:t:dhmvuL:o:, long_options, 
option_index);
+   c = getopt_long(argc, argv, a:c:f:t:dhmvuL:o:X:, 
long_options, option_index);
 
if (c == -1)/* have all command-line options have been 
parsed? */
break;
@@ -963,6 +971,13 @@ int main(int argc, char *argv[])
adminOwnerName = 
(SaImmAdminOwnerNameT)malloc(strlen(optarg) + 1);
strcpy(adminOwnerName, optarg);
break;
+   case 'X':
+   if(xsdPath) {
+   fprintf(stderr, XSD path is already set\n);
+   exit(EXIT_FAILURE);
+   }
+   xsdPath = strdup(optarg);
+   break;
default:
free(adminOwnerName);
fprintf(stderr, Try '%s --help' for more 
information\n, argv[0]);
@@ -994,7 +1009,7 @@ int main(int argc, char *argv[])

if (op == LOAD_IMMFILE) {
VERBOSE_INFO(importImmXML(xmlFilename=%s, verbose=%d)\n, 
xmlFilename, verbose);
-   rc = importImmXML(xmlFilename, adminOwnerName, verbose, 
ccb_safe);
+   rc = importImmXML(xmlFilename, adminOwnerName, verbose, 
ccb_safe, xsdPath);
free(adminOwnerName);
exit(rc);
}
@@ -1113,10 +1128,14 @@ int main(int argc, char *argv[])
free(attributeNames);
error = immutil_saImmOmFinalize(immHandle);
if (SA_AIS_OK != error) {
-fprintf(stderr, error - saImmOmFinalize FAILED: %s\n, 
saf_error(error));
-

[devel] [PATCH 0 of 2] Review Request for IMM: add support for forwards compatibility of attribute flags [#116]

2014-02-18 Thread Zoran Milinkovic
Summary: IMM: add support for forwards compatibility of attribute flags [#116]
Review request for Trac Ticket(s): 116
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.4.x, default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 3112b9aeccd503e2f876afb3909480aed2d53bcb
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 18 Feb 2014 15:57:47 +0100

IMM: add support for forwards compatibility of attribute flags [#116]

changeset ea5a93c4f68d3f8f620309356acb101165148893
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 18 Feb 2014 16:07:47 +0100

IMMTOOLS: add support for forwards compatibility of attribute flags 
[#116]

For forwards compatibility, OpenSAF schema, where unknown attribute 
flags
are defined, must be provided to IMM tools (immcfg, immlist, immfind) 
using
-X flag. If immload finds unknown attribute flag, immload will try to 
find
the attribute flag in the schema defined in the top element of the 
loading
IMM XML file.


Complete diffstat:
--
 osaf/libs/common/immsv/immpbe_dump.cc  |2 +-
 osaf/services/saf/immsv/immloadd/imm_loader.cc |  165 
+-
 osaf/services/saf/immsv/immnd/ImmModel.cc  |   36 
++-
 osaf/services/saf/immsv/immnd/ImmSearchOp.cc   |2 +-
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh   |4 +-
 osaf/services/saf/immsv/schema/SAI-AIS-IMM-XSD-A.02.12.xsd |   14 
 osaf/services/saf/immsv/schema/SAI-AIS-IMM-XSD-A.02.13.xsd |   16 +-
 osaf/tools/safimm/immcfg/imm_cfg.c |   29 
+--
 osaf/tools/safimm/immcfg/imm_import.cc |  218 
++---
 osaf/tools/safimm/immdump/imm_dumper.cc|  172 
--
 osaf/tools/safimm/immdump/imm_dumper.hh|2 +
 osaf/tools/safimm/immdump/imm_xmlw_dump.cc |   11 +++
 osaf/tools/safimm/immlist/Makefile.am  |4 ++
 osaf/tools/safimm/immlist/imm_list.c   |  192 
+++-
 14 files changed, 802 insertions(+), 65 deletions(-)


Testing Commands:
-
immcfg -X schema_with_unknown_flags.xsd imm.xml
immlist -X schema_with_unknown_flags.xsd -c test_class
immdump -X schema_with_unknown_flags.xsd test.xml


Testing, Expected Results:
--
Beside IMM tools test, it must be tested that unknown flags imported into IMM 
will survive OpenSAF restart.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical

[devel] [PATCH 0 of 2] Review Request for IMM: add support for forwards compatibility of attribute flags [#116]

2014-02-21 Thread Zoran Milinkovic
Summary: IMM: add support for forwards compatibility of attribute flags [#116]
Review request for Trac Ticket(s): 116
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.2.x
Development branch: opensaf-4.2.x


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 5d03eb30ac8a399dfef00880331ac5673c5842ac
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Fri, 21 Feb 2014 17:18:28 +0100

IMM: add support for forwards compatibility of attribute flags [#116]

changeset fa1c55912ed6115122be1960ad4d31631fe42de3
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Fri, 21 Feb 2014 17:21:37 +0100

IMMTOOLS: add support for forwards compatibility of attribute flags 
[#116]

For forwards compatibility, OpenSAF schema, where unknown attribute 
flags
are defined, must be provided to immcfg using -X flag. If immload finds
unknown attribute flag, immload will try to find the attribute flag in 
the
schema defined in the top element of the loading IMM XML file.


Complete diffstat:
--
 osaf/services/saf/immsv/immnd/ImmModel.cc|   39 
--
 osaf/services/saf/immsv/immnd/ImmSearchOp.cc |2 +-
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh |4 +-
 osaf/tools/safimm/immcfg/imm_cfg.c   |   31 ++-
 osaf/tools/safimm/immcfg/imm_import.cc   |  178 
+++
 osaf/tools/safimm/immlist/imm_list.c |6 -
 osaf/tools/safimm/immload/imm_loader.cc  |  150 
+
 7 files changed, 368 insertions(+), 42 deletions(-)


Testing Commands:
-
immcfg -X schema_with_unknown_flags.xsd imm.xml


Testing, Expected Results:
--
When OpenSAF starts without PBE enabled, immload must successfuly load imm.xml 
with unknown flags, if unknown flags are defined in a schema of loading imm.xml 
file. The schema must be in the same directory as imm.xml.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have

[devel] [PATCH 2 of 2] IMMTOOLS: add support for forwards compatibility of attribute flags [#116]

2014-02-21 Thread Zoran Milinkovic
 osaf/tools/safimm/immcfg/imm_cfg.c  |   31 -
 osaf/tools/safimm/immcfg/imm_import.cc  |  178 ++-
 osaf/tools/safimm/immlist/imm_list.c|6 -
 osaf/tools/safimm/immload/imm_loader.cc |  150 +-
 4 files changed, 333 insertions(+), 32 deletions(-)


For forwards compatibility, OpenSAF schema, where unknown attribute flags are 
defined, must be provided to immcfg using -X flag.
If immload finds unknown attribute flag, immload will try to find the attribute 
flag in the schema defined in the top element of the loading IMM XML file.

diff --git a/osaf/tools/safimm/immcfg/imm_cfg.c 
b/osaf/tools/safimm/immcfg/imm_cfg.c
--- a/osaf/tools/safimm/immcfg/imm_cfg.c
+++ b/osaf/tools/safimm/immcfg/imm_cfg.c
@@ -56,7 +56,7 @@ typedef enum {
 #define VERBOSE_INFO(format, args...) if (verbose) { fprintf(stderr, format, 
##args); }
 
 // The interface function which implements the -f opton (imm_import.cc)
-int importImmXML(char* xmlfileC, char* adminOwnerName, int verbose, int 
ccb_safe);
+int importImmXML(char* xmlfileC, char* adminOwnerName, int verbose, int 
ccb_safe, const char *xsdPath);
 
 const SaImmCcbFlagsT defCcbFlags = SA_IMM_CCB_REGISTERED_OI | 
SA_IMM_CCB_ALLOW_NULL_OI;
 
@@ -86,6 +86,7 @@ static void usage(const char *progname)
printf(\t--ignore-duplicates  (only valid with -f/--file option, 
default)\n);
printf(\t--delete-class classname [classname2]... \n);
printf(\t-u, --unsafe\n);
+   printf(\t-X, --xsd path_to_schema.xsd\n);
 
printf(\nEXAMPLE\n);
printf(\timmcfg -a saAmfNodeSuFailoverMax=7 
safAmfNode=Node01,safAmfCluster=1\n);
@@ -102,6 +103,10 @@ static void usage(const char *progname)
printf(\t\tremove a value from an attribute\n);
printf(\timmcfg -u .\n);
printf(\t\tThe CCBs generated by immcfg will have 
SA_IMM_CCB_REGISTERED_OI set to false, allowing ccb commit when OIs are 
missing\n);
+   printf(\timmcfg -X /etc/opensaf/schema.xsd -f imm.xml\n);
+   printf(\t\timmcfg will load unsupported attribute flags in the current 
OpenSAF version from /etc/opensaf/schema.xsd, and use them to successfully 
import imm.xml);
+   printf(\timmcfg -X /etc/opensaf -f imm.xml\n);
+   printf(\t\timmcfg will load unsupported attribute flags in the current 
OpenSAF version from the schema specified in imm.xml which is stored in 
/etc/opensaf, and use loaded flags to successfully import imm.xml);
 }
 
 /* signal handler for SIGALRM */
@@ -682,6 +687,7 @@ int main(int argc, char *argv[])
{timeout, required_argument, NULL, 't'},
{verbose, no_argument, NULL, 'v'},
{unsafe, no_argument, NULL, 'u'},
+   {xsd, required_argument, NULL, 'X'},
{0, 0, 0, 0}
};
SaAisErrorT error;
@@ -703,9 +709,11 @@ int main(int argc, char *argv[])
int i;
unsigned long timeoutVal = 60;
 
+   char *xsdPath = NULL;
+
while (1) {
int option_index = 0;
-   c = getopt_long(argc, argv, a:c:f:t:dhmvu, long_options, 
option_index);
+   c = getopt_long(argc, argv, a:c:f:t:dhmvuX:, long_options, 
option_index);
 
if (c == -1)/* have all command-line options have been 
parsed? */
break;
@@ -751,6 +759,13 @@ int main(int argc, char *argv[])
op = verify_setoption(op, MODIFY_OBJECT);
break;
}
+   case 'X':
+   if(xsdPath) {
+   fprintf(stderr, XSD path is already set\n);
+   exit(EXIT_FAILURE);
+   }
+   xsdPath = strdup(optarg);
+   break;
default:
fprintf(stderr, Try '%s --help' for more 
information\n, argv[0]);
exit(EXIT_FAILURE);
@@ -767,7 +782,7 @@ int main(int argc, char *argv[])

if (op == LOAD_IMMFILE) {
VERBOSE_INFO(importImmXML(xmlFilename=%s, verbose=%d)\n, 
xmlFilename, verbose);
-   rc = importImmXML(xmlFilename, adminOwnerName, verbose, 
ccb_safe);
+   rc = importImmXML(xmlFilename, adminOwnerName, verbose, 
ccb_safe, xsdPath);
exit(rc);
}
 
@@ -854,10 +869,14 @@ int main(int argc, char *argv[])
  done_om_finalize:
error = immutil_saImmOmFinalize(immHandle);
if (SA_AIS_OK != error) {
-fprintf(stderr, error - saImmOmFinalize FAILED: %s\n, 
saf_error(error));
-rc = EXIT_FAILURE;
-}
+   fprintf(stderr, error - saImmOmFinalize FAILED: %s\n, 
saf_error(error));
+   rc = EXIT_FAILURE;
+   }
 
+   if(xsdPath) {
+   free(xsdPath);
+   xsdPath = NULL;
+   }
 
exit(rc);
 }
diff --git a/osaf/tools/safimm/immcfg/imm_import.cc 

[devel] [PATCH 1 of 2] IMM: add support for forwards compatibility of attribute flags [#116]

2014-02-21 Thread Zoran Milinkovic
 osaf/libs/common/immsv/immpbe_dump.cc  |2 +-
 osaf/services/saf/immsv/immloadd/imm_loader.cc |  140 -
 osaf/services/saf/immsv/immnd/ImmModel.cc  |   36 +++--
 osaf/services/saf/immsv/immnd/ImmSearchOp.cc   |2 +-
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh   |4 +-
 5 files changed, 165 insertions(+), 19 deletions(-)


Add support for 64-bit attribute flags to IMM service.
If immload finds unknown attribute flag, immload will try to find the attribute 
flag in the schema defined in the top element of the loading IMM XML file.

diff --git a/osaf/libs/common/immsv/immpbe_dump.cc 
b/osaf/libs/common/immsv/immpbe_dump.cc
--- a/osaf/libs/common/immsv/immpbe_dump.cc
+++ b/osaf/libs/common/immsv/immpbe_dump.cc
@@ -873,7 +873,7 @@ ClassInfo* classToPBE(std::string classN
LOG_ER(Failed to bind attr_type with error code: %d, 
rc);
goto bailout;
}
-   if((rc = sqlite3_bind_int(stmt, 4, (*p)-attrFlags)) != 
SQLITE_OK) {
+   if((rc = sqlite3_bind_int64(stmt, 4, (*p)-attrFlags)) != 
SQLITE_OK) {
LOG_ER(Failed to bind attr_flags with error code: %d, 
rc);
goto bailout;
}
diff --git a/osaf/services/saf/immsv/immloadd/imm_loader.cc 
b/osaf/services/saf/immsv/immloadd/imm_loader.cc
--- a/osaf/services/saf/immsv/immloadd/imm_loader.cc
+++ b/osaf/services/saf/immsv/immloadd/imm_loader.cc
@@ -17,7 +17,9 @@
 
 #include imm_loader.hh
 #include iostream
+#include set
 #include libxml/parser.h
+#include libxml/xpath.h
 #include stdio.h
 #include stdlib.h
 #include unistd.h
@@ -26,6 +28,7 @@
 #include configmake.h
 #include logtrace.h
 #include sys/stat.h
+#include errno.h
 
 #define MAX_DEPTH 10
 #define MAX_CHAR_BUFFER_SIZE 8192  //8k
@@ -111,6 +114,12 @@ typedef struct ParserStateStruct
 SaImmHandleT ccbHandle;
 } ParserState;
 
+bool isXsdLoaded;
+std::string xsddir;
+std::string xsd;
+typedef std::setstd::string AttrFlagSet;
+AttrFlagSet attrFlagSet;
+
 /* Helper functions */
 
 static void addToAttrTypeCache(ParserState*, SaImmValueTypeT);
@@ -874,6 +883,13 @@ static void startElementHandler(void* us
 else if (strcmp((const char*)name, imm:IMM-contents) == 0)
 {
 state-state[state-depth] = IMM_CONTENTS;
+char *schema = (char *)getAttributeValue(attrs, (xmlChar 
*)noNamespaceSchemaLocation);
+if(!schema) {
+schema = (char *)getAttributeValue(attrs, (xmlChar 
*)xsi:noNamespaceSchemaLocation);
+}
+if(schema) {
+xsd = schema;
+}
 }
 else
 {
@@ -1424,6 +1440,106 @@ static xmlEntityPtr
 return xmlGetPredefinedEntity(name);
 }
 
+static inline char *getAttrValue(xmlAttributePtr attr) {
+if(!attr || !attr-children) {
+return NULL;
+}
+
+return (char *)attr-children-content;
+}
+
+static bool loadXsd(const char *xsdFile) {
+struct stat st;
+if(stat(xsdFile, st)) {
+if(errno == ENOENT) {
+LOG_ER(%s does not exist, xsdFile);
+} else {
+LOG_ER(stat of %s return error: %d, xsdFile, errno);
+}
+
+return false;
+}
+// It should be a file or a directory
+if(!S_ISREG(st.st_mode)) {
+LOG_ER(%s is not a file, xsdFile);
+return false;
+}
+
+xmlNodePtr xsdDocRoot;
+xmlDocPtr xsdDoc = xmlParseFile(xsdFile);
+if(!xsdDoc) {
+return false;
+}
+
+bool rc = true;
+xmlXPathContextPtr ctx = xmlXPathNewContext(xsdDoc);
+if(!ctx) {
+rc = false;
+goto freedoc;
+}
+
+//Add namespace of the first element
+xsdDocRoot = xmlDocGetRootElement(xsdDoc);
+if(xsdDocRoot-ns) {
+ctx-namespaces = (xmlNsPtr *)malloc(sizeof(xmlNsPtr));
+ctx-namespaces[0] = xsdDocRoot-ns;
+ctx-nsNr = 1;
+}
+
+xmlXPathObjectPtr xpathObj;
+xpathObj = xmlXPathEval((const 
xmlChar*)/xs:schema/xs:simpleType[@name=\attr-flags\]/xs:restriction/xs:enumeration,
 ctx);
+if(!xpathObj || !xpathObj-nodesetval) {
+rc = false;
+goto freectx;
+}
+
+xmlElementPtr element;
+xmlAttributePtr attr;
+char *value;
+int size;
+
+size = xpathObj-nodesetval-nodeNr;
+for(int i=0; isize; i++) {
+value = NULL;
+element = (xmlElementPtr)xpathObj-nodesetval-nodeTab[i];
+attr = element-attributes;
+while(attr) {
+if(!strcmp((char *)attr-name, value)) {
+value = getAttrValue(attr);
+}
+
+if(value) {
+break;
+}
+
+attr = (xmlAttributePtr)attr-next;
+}
+
+if(value) {
+if(strcmp(value, SA_RUNTIME)  strcmp(value, SA_CONFIG) 
+strcmp(value, SA_MULTI_VALUE)  strcmp(value, 
SA_WRITABLE) 
+strcmp(value, SA_INITIALIZED)  strcmp(value, 
SA_PERSISTENT) 
+   

[devel] [PATCH 0 of 2] Review Request for IMM: add support for forwards compatibility of attribute flags [#116]

2014-02-21 Thread Zoran Milinkovic
Summary: IMM: add support for forwards compatibility of attribute flags [#116]
Review request for Trac Ticket(s): 116
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.3.x
Development branch: opensaf-4.3.x


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset a4a323a7c56dc5db04cbbf373a7585de0a456074
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Fri, 21 Feb 2014 17:28:23 +0100

IMM: add support for forwards compatibility of attribute flags [#116]

Add support for 64-bit attribute flags to IMM service. If immload finds
unknown attribute flag, immload will try to find the attribute flag in 
the
schema defined in the top element of the loading IMM XML file.

changeset 437a840e80d0dca16408a6341d8f37969056b8f0
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Fri, 21 Feb 2014 17:29:00 +0100

IMMTOOLS: add support for forwards compatibility of attribute flags 
[#116]

For forwards compatibility, OpenSAF schema, where unknown attribute 
flags
are defined, must be provided to immcfg using -X flag.


Complete diffstat:
--
 osaf/libs/common/immsv/immpbe_dump.cc  |2 +-
 osaf/services/saf/immsv/immloadd/imm_loader.cc |  140 
+++-
 osaf/services/saf/immsv/immnd/ImmModel.cc  |   36 

 osaf/services/saf/immsv/immnd/ImmSearchOp.cc   |2 +-
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh   |4 +-
 osaf/tools/safimm/immcfg/imm_cfg.c |   31 
++-
 osaf/tools/safimm/immcfg/imm_import.cc |  172 
++---
 7 files changed, 358 insertions(+), 29 deletions(-)


Testing Commands:
-
immcfg -X schema_with_unknown_flags.xsd imm.xml


Testing, Expected Results:
--
When OpenSAF starts without PBE enabled, immload must successfuly load imm.xml 
with unknown flags, if unknown flags are defined in a schema of loading imm.xml 
file. The schema must be in the same directory as imm.xml.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change

[devel] [PATCH 2 of 2] IMMTOOLS: add support for forwards compatibility of attribute flags [#116]

2014-02-21 Thread Zoran Milinkovic
 osaf/tools/safimm/immcfg/imm_cfg.c |   31 -
 osaf/tools/safimm/immcfg/imm_import.cc |  172 -
 2 files changed, 193 insertions(+), 10 deletions(-)


For forwards compatibility, OpenSAF schema, where unknown attribute flags are 
defined, must be provided to immcfg using -X flag.

diff --git a/osaf/tools/safimm/immcfg/imm_cfg.c 
b/osaf/tools/safimm/immcfg/imm_cfg.c
--- a/osaf/tools/safimm/immcfg/imm_cfg.c
+++ b/osaf/tools/safimm/immcfg/imm_cfg.c
@@ -65,7 +65,7 @@ typedef enum {
 #define VERBOSE_INFO(format, args...) if (verbose) { fprintf(stderr, format, 
##args); }
 
 // Interface functions which implement -f and -L options (imm_import.cc)
-int importImmXML(char* xmlfileC, char* adminOwnerName, int verbose, int 
ccb_safe);
+int importImmXML(char* xmlfileC, char* adminOwnerName, int verbose, int 
ccb_safe, const char *xsdPath);
 int validateImmXML(const char *xmlfile, int verbose);
 
 
@@ -103,6 +103,7 @@ static void usage(const char *progname)
printf(\t-L, --validate imm.xml file\n);
printf(\t-o, --admin-owner admin owner name\n);
printf(\t--admin-owner-clear\n);
+   printf(\t-X, --xsd path_to_schema.xsd\n);
 
printf(\nEXAMPLE\n);
printf(\timmcfg -a saAmfNodeSuFailoverMax=7 
safAmfNode=Node01,safAmfCluster=1\n);
@@ -127,6 +128,10 @@ static void usage(const char *progname)
printf(\t\tuse 'myAdminOwnerName' as admin owner name for changing one 
attribute of one object\n);
printf(\timmcfg --admin-owner-clear 
safAmfNode=Node01,safAmfCluster=1\n);
printf(\t\tclear admin owner from one object\n);
+   printf(\timmcfg -X /etc/opensaf/schema.xsd -f imm.xml\n);
+   printf(\t\timmcfg will load unsupported attribute flags in the current 
OpenSAF version from /etc/opensaf/schema.xsd, and use them to successfully 
import imm.xml);
+   printf(\timmcfg -X /etc/opensaf -f imm.xml\n);
+   printf(\t\timmcfg will load unsupported attribute flags in the current 
OpenSAF version from the schema specified in imm.xml which is stored in 
/etc/opensaf, and use loaded flags to successfully import imm.xml);
 }
 
 /* signal handler for SIGALRM */
@@ -854,6 +859,7 @@ int main(int argc, char *argv[])
{disable-attr-notify, no_argument, NULL, 0},
{admin-owner, required_argument, NULL, 'o'},
{admin-owner-clear, no_argument, NULL, 0},
+   {xsd, required_argument, NULL, 'X'},
{0, 0, 0, 0}
};
SaAisErrorT error;
@@ -879,9 +885,11 @@ int main(int argc, char *argv[])
unsigned long timeoutVal = 60;
attr_notify_t attrNotify = NOTIFY_UNDEFINED;
 
+   char *xsdPath = NULL;
+
while (1) {
int option_index = 0;
-   c = getopt_long(argc, argv, a:c:f:t:dhmvuL:o:, long_options, 
option_index);
+   c = getopt_long(argc, argv, a:c:f:t:dhmvuL:o:X:, 
long_options, option_index);
 
if (c == -1)/* have all command-line options have been 
parsed? */
break;
@@ -963,6 +971,13 @@ int main(int argc, char *argv[])
adminOwnerName = 
(SaImmAdminOwnerNameT)malloc(strlen(optarg) + 1);
strcpy(adminOwnerName, optarg);
break;
+   case 'X':
+   if(xsdPath) {
+   fprintf(stderr, XSD path is already set\n);
+   exit(EXIT_FAILURE);
+   }
+   xsdPath = strdup(optarg);
+   break;
default:
free(adminOwnerName);
fprintf(stderr, Try '%s --help' for more 
information\n, argv[0]);
@@ -994,7 +1009,7 @@ int main(int argc, char *argv[])

if (op == LOAD_IMMFILE) {
VERBOSE_INFO(importImmXML(xmlFilename=%s, verbose=%d)\n, 
xmlFilename, verbose);
-   rc = importImmXML(xmlFilename, adminOwnerName, verbose, 
ccb_safe);
+   rc = importImmXML(xmlFilename, adminOwnerName, verbose, 
ccb_safe, xsdPath);
free(adminOwnerName);
exit(rc);
}
@@ -1113,10 +1128,14 @@ int main(int argc, char *argv[])
free(attributeNames);
error = immutil_saImmOmFinalize(immHandle);
if (SA_AIS_OK != error) {
-fprintf(stderr, error - saImmOmFinalize FAILED: %s\n, 
saf_error(error));
-rc = EXIT_FAILURE;
-}
+   fprintf(stderr, error - saImmOmFinalize FAILED: %s\n, 
saf_error(error));
+   rc = EXIT_FAILURE;
+   }
 
+   if(xsdPath) {
+   free(xsdPath);
+   xsdPath = NULL;
+   }
 
exit(rc);
 }
diff --git a/osaf/tools/safimm/immcfg/imm_import.cc 
b/osaf/tools/safimm/immcfg/imm_import.cc
--- a/osaf/tools/safimm/immcfg/imm_import.cc
+++ b/osaf/tools/safimm/immcfg/imm_import.cc
@@ -21,6 +21,8 @@
 

[devel] [PATCH 0 of 2] Review Request for IMM: add support for forwards compatibility of attribute flags [#116]

2014-02-21 Thread Zoran Milinkovic
Summary: IMM: add support for forwards compatibility of attribute flags [#116]
Review request for Trac Ticket(s): 116
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.4.x, default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 4d742de378fe7a3f25f7e80637d4f41be5c29544
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Fri, 21 Feb 2014 17:30:37 +0100

IMM: add support for forwards compatibility of attribute flags [#116]

Add support for 64-bit attribute flags to IMM service. If immload finds
unknown attribute flag, immload will try to find the attribute flag in 
the
schema defined in the top element of the loading IMM XML file.

changeset 950ce6e540c64d839a94607037574912bbf21acf
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Fri, 21 Feb 2014 17:31:05 +0100

IMMTOOLS: add support for forwards compatibility of attribute flags 
[#116]

For forwards compatibility, OpenSAF schema, where unknown attribute 
flags
are defined, must be provided to immcfg using -X flag.


Complete diffstat:
--
 osaf/libs/common/immsv/immpbe_dump.cc  |2 +-
 osaf/services/saf/immsv/immloadd/imm_loader.cc |  140 
++-
 osaf/services/saf/immsv/immnd/ImmModel.cc  |   36 
++---
 osaf/services/saf/immsv/immnd/ImmSearchOp.cc   |2 +-
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh   |4 +-
 osaf/tools/safimm/immcfg/imm_cfg.c |   29 +--
 osaf/tools/safimm/immcfg/imm_import.cc |  191 
+++--
 7 files changed, 365 insertions(+), 39 deletions(-)


Testing Commands:
-
immcfg -X schema_with_unknown_flags.xsd imm.xml


Testing, Expected Results:
--
When OpenSAF starts without PBE enabled, immload must successfuly load imm.xml 
with unknown flags, if unknown flags are defined in a schema of loading imm.xml 
file. The schema must be in the same directory as imm.xml.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests

[devel] [PATCH 1 of 1] IMMTOOLS: fix incorrect error message for deleting class in immcfg [#794]

2014-02-25 Thread Zoran Milinkovic
 osaf/tools/safimm/immcfg/imm_cfg.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/osaf/tools/safimm/immcfg/imm_cfg.c 
b/osaf/tools/safimm/immcfg/imm_cfg.c
--- a/osaf/tools/safimm/immcfg/imm_cfg.c
+++ b/osaf/tools/safimm/immcfg/imm_cfg.c
@@ -690,7 +690,7 @@ int class_delete(const SaImmClassNameT *
if (error == SA_AIS_ERR_NOT_EXIST)
fprintf(stderr, error - class does not exist 
:%s\n, classNames[i]);
else
-   fprintf(stderr, error - saImmOmAdminOwnerSet 
FAILED: %s\n, saf_error(error));
+   fprintf(stderr, error - saImmOmClassDelete 
FAILED: %s\n, saf_error(error));
 
goto done;
}

--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis  security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for IMMTOOLS: fix incorrect error message for deleting class in immcfg [#794]

2014-02-25 Thread Zoran Milinkovic
Summary: IMMTOOLS: fix incorrect error message for deleting class in immcfg 
[#794]
Review request for Trac Ticket(s): 794
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.3.x, opensaf-4.4.x, default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 49265005f0316416e76efec4bfa3eabf5456d8c7
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 25 Feb 2014 09:58:18 +0100

IMMTOOLS: fix incorrect error message for deleting class in immcfg 
[#794]


Complete diffstat:
--
 osaf/tools/safimm/immcfg/imm_cfg.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Testing Commands:
-
immcfg --delete-class ClassName


Testing, Expected Results:
--
The error message can be easily produced if immcfg tries to delete a class that 
already has the class instances.
With the patch, immcfg should report the correct error message.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis  security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] IMMTOOLS: fix the schema name for immxml tools to comply with the latest schema known by the release [#796]

2014-03-06 Thread Zoran Milinkovic
 osaf/services/infrastructure/fm/config/fm_objects.xml   |  2 +-
 osaf/services/infrastructure/fm/config/fm_sc_template.xml   |  2 +-
 osaf/services/infrastructure/rde/config/rde_objects.xml |  2 +-
 osaf/services/infrastructure/rde/config/rde_sc_template.xml |  2 +-
 osaf/services/saf/avsv/config/amfwdog_objects.xml   |  2 +-
 osaf/services/saf/avsv/config/amfwdog_pl_template.xml   |  2 +-
 osaf/services/saf/avsv/config/amfwdog_sc_template.xml   |  2 +-
 osaf/services/saf/avsv/config/avsv_classes.xml  |  2 +-
 osaf/services/saf/avsv/config/avsv_objects.xml  |  2 +-
 osaf/services/saf/avsv/config/common_pl_template.xml|  2 +-
 osaf/services/saf/avsv/config/common_sc_template.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_classes.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_objects.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_pl_template.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_plm_pl_template.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_plm_sc_template.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_sc_template.xml|  2 +-
 osaf/services/saf/cpsv/config/cpsv_classes.xml  |  2 +-
 osaf/services/saf/cpsv/config/cpsv_objects.xml  |  2 +-
 osaf/services/saf/cpsv/config/cpsv_pl_template.xml  |  2 +-
 osaf/services/saf/cpsv/config/cpsv_sc_template.xml  |  2 +-
 osaf/services/saf/edsv/config/edsv_classes.xml  |  2 +-
 osaf/services/saf/edsv/config/edsv_objects.xml  |  2 +-
 osaf/services/saf/edsv/config/edsv_sc_template.xml  |  2 +-
 osaf/services/saf/glsv/config/glsv_classes.xml  |  2 +-
 osaf/services/saf/glsv/config/glsv_objects.xml  |  2 +-
 osaf/services/saf/glsv/config/glsv_pl_template.xml  |  2 +-
 osaf/services/saf/glsv/config/glsv_sc_template.xml  |  2 +-
 osaf/services/saf/immsv/config/imm.xml.sample   |  2 +-
 osaf/services/saf/immsv/config/imm_copyright.xml|  2 +-
 osaf/services/saf/immsv/config/immsv_classes.xml|  2 +-
 osaf/services/saf/immsv/config/immsv_objects.xml|  2 +-
 osaf/services/saf/immsv/config/immsv_pl_template.xml|  2 +-
 osaf/services/saf/immsv/config/immsv_sc_template.xml|  2 +-
 osaf/services/saf/logsv/config/logsv_classes.xml|  2 +-
 osaf/services/saf/logsv/config/logsv_objects.xml|  2 +-
 osaf/services/saf/logsv/config/logsv_sc_template.xml|  2 +-
 osaf/services/saf/mqsv/config/mqsv_classes.xml  |  2 +-
 osaf/services/saf/mqsv/config/mqsv_objects.xml  |  2 +-
 osaf/services/saf/mqsv/config/mqsv_pl_template.xml  |  2 +-
 osaf/services/saf/mqsv/config/mqsv_sc_template.xml  |  2 +-
 osaf/services/saf/ntfsv/config/ntfsv_objects.xml|  2 +-
 osaf/services/saf/ntfsv/config/ntfsv_sc_template.xml|  2 +-
 osaf/services/saf/plmsv/config/plmsv_classes.xml|  2 +-
 osaf/services/saf/plmsv/config/plmsv_objects.xml|  2 +-
 osaf/services/saf/plmsv/config/plmsv_objects.xml.atca   |  2 +-
 osaf/services/saf/plmsv/config/plmsv_objects.xml.hp |  2 +-
 osaf/services/saf/plmsv/config/plmsv_objects.xml.pc |  2 +-
 osaf/services/saf/plmsv/config/plmsv_pl_template.xml|  2 +-
 osaf/services/saf/plmsv/config/plmsv_sc_template.xml|  2 +-
 osaf/services/saf/smfsv/config/smfsv_classes.xml|  2 +-
 osaf/services/saf/smfsv/config/smfsv_objects.xml|  2 +-
 osaf/services/saf/smfsv/config/smfsv_pl_template.xml|  2 +-
 osaf/services/saf/smfsv/config/smfsv_sc_template.xml|  2 +-
 osaf/tools/safimm/immxml/baseimm.py |  2 +-
 osaf/tools/safimm/immxml/immxml-nodegen |  2 +-
 56 files changed, 56 insertions(+), 56 deletions(-)


diff --git a/osaf/services/infrastructure/fm/config/fm_objects.xml 
b/osaf/services/infrastructure/fm/config/fm_objects.xml
--- a/osaf/services/infrastructure/fm/config/fm_objects.xml
+++ b/osaf/services/infrastructure/fm/config/fm_objects.xml
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=utf-8?
-imm:IMM-contents xmlns:imm=http://www.saforum.org/IMMSchema; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:noNamespaceSchemaLocation=SAI-AIS-IMM-XSD-A.01.01.xsd
+imm:IMM-contents xmlns:imm=http://www.saforum.org/IMMSchema; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:noNamespaceSchemaLocation=SAI-AIS-IMM-XSD-A.02.12.xsd
object class=SaAmfCompBaseType
dnsafCompType=OpenSafCompTypeFMS/dn
/object
diff --git a/osaf/services/infrastructure/fm/config/fm_sc_template.xml 
b/osaf/services/infrastructure/fm/config/fm_sc_template.xml
--- a/osaf/services/infrastructure/fm/config/fm_sc_template.xml
+++ b/osaf/services/infrastructure/fm/config/fm_sc_template.xml
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=utf-8?
-imm:IMM-contents 

[devel] [PATCH 0 of 1] Review Request for IMMTOOLS: fix the schema name for immxml tools to comply with the latest schema known by the release [#796]

2014-03-06 Thread Zoran Milinkovic
Summary: IMMTOOLS: fix the schema name for immxml tools to comply with the 
latest schema known by the release [#796]
Review request for Trac Ticket(s): 796
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.4.x, default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset e392e08b28e60d6ea541a52b50238039cec9f770
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 06 Mar 2014 14:39:12 +0100

IMMTOOLS: fix the schema name for immxml tools to comply with the latest
schema known by the release [#796]


Complete diffstat:
--
 osaf/services/infrastructure/fm/config/fm_objects.xml   |  2 +-
 osaf/services/infrastructure/fm/config/fm_sc_template.xml   |  2 +-
 osaf/services/infrastructure/rde/config/rde_objects.xml |  2 +-
 osaf/services/infrastructure/rde/config/rde_sc_template.xml |  2 +-
 osaf/services/saf/amf/config/amf_classes.xml|  2 +-
 osaf/services/saf/amf/config/amf_objects.xml|  2 +-
 osaf/services/saf/amf/config/amfwdog_objects.xml|  2 +-
 osaf/services/saf/amf/config/amfwdog_pl_template.xml|  2 +-
 osaf/services/saf/amf/config/amfwdog_sc_template.xml|  2 +-
 osaf/services/saf/amf/config/common_pl_template.xml |  2 +-
 osaf/services/saf/amf/config/common_sc_template.xml |  2 +-
 osaf/services/saf/clmsv/config/clmsv_classes.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_objects.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_pl_template.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_plm_pl_template.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_plm_sc_template.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_sc_template.xml|  2 +-
 osaf/services/saf/cpsv/config/cpsv_classes.xml  |  2 +-
 osaf/services/saf/cpsv/config/cpsv_objects.xml  |  2 +-
 osaf/services/saf/cpsv/config/cpsv_pl_template.xml  |  2 +-
 osaf/services/saf/cpsv/config/cpsv_sc_template.xml  |  2 +-
 osaf/services/saf/edsv/config/edsv_classes.xml  |  2 +-
 osaf/services/saf/edsv/config/edsv_objects.xml  |  2 +-
 osaf/services/saf/edsv/config/edsv_sc_template.xml  |  2 +-
 osaf/services/saf/glsv/config/glsv_classes.xml  |  2 +-
 osaf/services/saf/glsv/config/glsv_objects.xml  |  2 +-
 osaf/services/saf/glsv/config/glsv_pl_template.xml  |  2 +-
 osaf/services/saf/glsv/config/glsv_sc_template.xml  |  2 +-
 osaf/services/saf/immsv/config/imm.xml.sample   |  2 +-
 osaf/services/saf/immsv/config/imm_copyright.xml|  2 +-
 osaf/services/saf/immsv/config/immsv_classes.xml|  2 +-
 osaf/services/saf/immsv/config/immsv_objects.xml|  2 +-
 osaf/services/saf/immsv/config/immsv_pl_template.xml|  2 +-
 osaf/services/saf/immsv/config/immsv_sc_template.xml|  2 +-
 osaf/services/saf/logsv/config/logsv_classes.xml|  2 +-
 osaf/services/saf/logsv/config/logsv_objects.xml|  2 +-
 osaf/services/saf/logsv/config/logsv_sc_template.xml|  2 +-
 osaf/services/saf/mqsv/config/mqsv_classes.xml  |  2 +-
 osaf/services/saf/mqsv/config/mqsv_objects.xml  |  2 +-
 osaf/services/saf/mqsv/config/mqsv_pl_template.xml  |  2 +-
 osaf/services/saf/mqsv/config/mqsv_sc_template.xml  |  2 +-
 osaf/services/saf/ntfsv/config/ntfsv_objects.xml|  2 +-
 osaf/services/saf/ntfsv/config/ntfsv_sc_template.xml|  2 +-
 osaf/services/saf/plmsv/config/plmsv_classes.xml|  2 +-
 osaf/services/saf/plmsv/config/plmsv_objects.xml|  2 +-
 osaf/services/saf/plmsv/config/plmsv_objects.xml.atca   |  2 +-
 osaf/services/saf/plmsv/config/plmsv_objects.xml.hp |  2 +-
 osaf/services/saf/plmsv/config/plmsv_objects.xml.pc |  2 +-
 osaf/services/saf/plmsv/config/plmsv_pl_template.xml|  2 +-
 osaf/services/saf/plmsv/config/plmsv_sc_template.xml|  2 +-
 osaf/services/saf/smfsv/config/smfsv_classes.xml|  2 +-
 osaf/services/saf/smfsv/config/smfsv_objects.xml|  2 +-
 osaf/services/saf/smfsv/config/smfsv_pl_template.xml|  2 +-
 osaf/services/saf/smfsv/config/smfsv_sc_template.xml|  2 +-
 osaf/tools/safimm/immxml/baseimm.py |  2 +-
 osaf/tools/safimm/immxml/immxml-nodegen |  2 +-
 56 files changed, 56 insertions(+), 56

[devel] [PATCH 1 of 1] IMMTOOLS: fix the schema name for immxml tools to comply with the latest schema known by the release [#796]

2014-03-06 Thread Zoran Milinkovic
 osaf/services/infrastructure/fm/config/fm_objects.xml   |  2 +-
 osaf/services/infrastructure/fm/config/fm_sc_template.xml   |  2 +-
 osaf/services/infrastructure/rde/config/rde_objects.xml |  2 +-
 osaf/services/infrastructure/rde/config/rde_sc_template.xml |  2 +-
 osaf/services/saf/amf/config/amf_classes.xml|  2 +-
 osaf/services/saf/amf/config/amf_objects.xml|  2 +-
 osaf/services/saf/amf/config/amfwdog_objects.xml|  2 +-
 osaf/services/saf/amf/config/amfwdog_pl_template.xml|  2 +-
 osaf/services/saf/amf/config/amfwdog_sc_template.xml|  2 +-
 osaf/services/saf/amf/config/common_pl_template.xml |  2 +-
 osaf/services/saf/amf/config/common_sc_template.xml |  2 +-
 osaf/services/saf/clmsv/config/clmsv_classes.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_objects.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_pl_template.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_plm_pl_template.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_plm_sc_template.xml|  2 +-
 osaf/services/saf/clmsv/config/clmsv_sc_template.xml|  2 +-
 osaf/services/saf/cpsv/config/cpsv_classes.xml  |  2 +-
 osaf/services/saf/cpsv/config/cpsv_objects.xml  |  2 +-
 osaf/services/saf/cpsv/config/cpsv_pl_template.xml  |  2 +-
 osaf/services/saf/cpsv/config/cpsv_sc_template.xml  |  2 +-
 osaf/services/saf/edsv/config/edsv_classes.xml  |  2 +-
 osaf/services/saf/edsv/config/edsv_objects.xml  |  2 +-
 osaf/services/saf/edsv/config/edsv_sc_template.xml  |  2 +-
 osaf/services/saf/glsv/config/glsv_classes.xml  |  2 +-
 osaf/services/saf/glsv/config/glsv_objects.xml  |  2 +-
 osaf/services/saf/glsv/config/glsv_pl_template.xml  |  2 +-
 osaf/services/saf/glsv/config/glsv_sc_template.xml  |  2 +-
 osaf/services/saf/immsv/config/imm.xml.sample   |  2 +-
 osaf/services/saf/immsv/config/imm_copyright.xml|  2 +-
 osaf/services/saf/immsv/config/immsv_classes.xml|  2 +-
 osaf/services/saf/immsv/config/immsv_objects.xml|  2 +-
 osaf/services/saf/immsv/config/immsv_pl_template.xml|  2 +-
 osaf/services/saf/immsv/config/immsv_sc_template.xml|  2 +-
 osaf/services/saf/logsv/config/logsv_classes.xml|  2 +-
 osaf/services/saf/logsv/config/logsv_objects.xml|  2 +-
 osaf/services/saf/logsv/config/logsv_sc_template.xml|  2 +-
 osaf/services/saf/mqsv/config/mqsv_classes.xml  |  2 +-
 osaf/services/saf/mqsv/config/mqsv_objects.xml  |  2 +-
 osaf/services/saf/mqsv/config/mqsv_pl_template.xml  |  2 +-
 osaf/services/saf/mqsv/config/mqsv_sc_template.xml  |  2 +-
 osaf/services/saf/ntfsv/config/ntfsv_objects.xml|  2 +-
 osaf/services/saf/ntfsv/config/ntfsv_sc_template.xml|  2 +-
 osaf/services/saf/plmsv/config/plmsv_classes.xml|  2 +-
 osaf/services/saf/plmsv/config/plmsv_objects.xml|  2 +-
 osaf/services/saf/plmsv/config/plmsv_objects.xml.atca   |  2 +-
 osaf/services/saf/plmsv/config/plmsv_objects.xml.hp |  2 +-
 osaf/services/saf/plmsv/config/plmsv_objects.xml.pc |  2 +-
 osaf/services/saf/plmsv/config/plmsv_pl_template.xml|  2 +-
 osaf/services/saf/plmsv/config/plmsv_sc_template.xml|  2 +-
 osaf/services/saf/smfsv/config/smfsv_classes.xml|  2 +-
 osaf/services/saf/smfsv/config/smfsv_objects.xml|  2 +-
 osaf/services/saf/smfsv/config/smfsv_pl_template.xml|  2 +-
 osaf/services/saf/smfsv/config/smfsv_sc_template.xml|  2 +-
 osaf/tools/safimm/immxml/baseimm.py |  2 +-
 osaf/tools/safimm/immxml/immxml-nodegen |  2 +-
 56 files changed, 56 insertions(+), 56 deletions(-)


diff --git a/osaf/services/infrastructure/fm/config/fm_objects.xml 
b/osaf/services/infrastructure/fm/config/fm_objects.xml
--- a/osaf/services/infrastructure/fm/config/fm_objects.xml
+++ b/osaf/services/infrastructure/fm/config/fm_objects.xml
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=utf-8?
-imm:IMM-contents xmlns:imm=http://www.saforum.org/IMMSchema; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:noNamespaceSchemaLocation=SAI-AIS-IMM-XSD-A.01.01.xsd
+imm:IMM-contents xmlns:imm=http://www.saforum.org/IMMSchema; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:noNamespaceSchemaLocation=SAI-AIS-IMM-XSD-A.02.13.xsd
object class=SaAmfCompBaseType
dnsafCompType=OpenSafCompTypeFMS/dn
/object
diff --git a/osaf/services/infrastructure/fm/config/fm_sc_template.xml 
b/osaf/services/infrastructure/fm/config/fm_sc_template.xml
--- a/osaf/services/infrastructure/fm/config/fm_sc_template.xml
+++ b/osaf/services/infrastructure/fm/config/fm_sc_template.xml
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=utf-8?
-imm:IMM-contents 

[devel] [PATCH 1 of 1] IMMTOOLS: fix printing and dumping for float and double values [#53]

2014-03-25 Thread Zoran Milinkovic
 osaf/libs/common/immsv/immpbe_dump.cc |  2 ++
 osaf/tools/safimm/immlist/imm_list.c  |  8 
 2 files changed, 6 insertions(+), 4 deletions(-)


diff --git a/osaf/libs/common/immsv/immpbe_dump.cc 
b/osaf/libs/common/immsv/immpbe_dump.cc
--- a/osaf/libs/common/immsv/immpbe_dump.cc
+++ b/osaf/libs/common/immsv/immpbe_dump.cc
@@ -3175,9 +3175,11 @@ std::string valueToString(SaImmAttrValue
ost  *((unsigned long long *) value);
break;
case SA_IMM_ATTR_SAFLOATT:
+   ost.precision(8);
ost  *((float *) value);
break;
case SA_IMM_ATTR_SADOUBLET:
+   ost.precision(17);
ost  *((double *) value);
break;
case SA_IMM_ATTR_SANAMET:
diff --git a/osaf/tools/safimm/immlist/imm_list.c 
b/osaf/tools/safimm/immlist/imm_list.c
--- a/osaf/tools/safimm/immlist/imm_list.c
+++ b/osaf/tools/safimm/immlist/imm_list.c
@@ -96,10 +96,10 @@ static void print_attr_value_raw(SaImmVa
printf(%llu,  *((SaTimeT *)attrValue));
break;
case SA_IMM_ATTR_SAFLOATT:
-   printf(%f, *((SaFloatT *)attrValue));
+   printf(%.8g, *((SaFloatT *)attrValue));
break;
case SA_IMM_ATTR_SADOUBLET:
-   printf(%17.15f, *((SaDoubleT *)attrValue));
+   printf(%.17g, *((SaDoubleT *)attrValue));
break;
case SA_IMM_ATTR_SANAMET: {
SaNameT *myNameT = (SaNameT *)attrValue;
@@ -158,10 +158,10 @@ static void print_attr_value(SaImmValueT
break;
}
case SA_IMM_ATTR_SAFLOATT:
-   printf(%f , *((SaFloatT *)attrValue));
+   printf(%.8g, *((SaFloatT *)attrValue));
break;
case SA_IMM_ATTR_SADOUBLET:
-   printf(%17.15f, *((SaDoubleT *)attrValue));
+   printf(%.17g, *((SaDoubleT *)attrValue));
break;
case SA_IMM_ATTR_SANAMET:
{

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] IMM:Removed Implementer name for config objects while loading [#543]

2014-03-27 Thread Zoran Milinkovic
Hi Neelakanta,

Generally, ack from me, with a comment to Anders's comment.

I think you can use state-attrDefinitions to determine if a class is 
persistent runtime or not.
state-attrDefinitions is used just before you add a class name to 
runtimeClass set.

Best regards,
Zoran

-Original Message-
From: Anders Bjornerstedt [mailto:anders.bjornerst...@ericsson.com] 
Sent: den 27 mars 2014 13:03
To: reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 1 of 1] IMM:Removed Implementer name for config 
objects while loading [#543]

Ack with two minor comments, only one of which requires a small change.
I tested for both config objecs and persistent RTOs and the patch works.
I.e. it removes the implementer-name for config objects and does not remove it 
for PRTOs.

See minor comments below

reddy.neelaka...@oracle.com wrote:
  osaf/services/saf/immsv/immloadd/imm_loader.cc   |  32 +---
  osaf/services/saf/immsv/immloadd/imm_loader.hh   |   1 +
  osaf/services/saf/immsv/immloadd/imm_pbe_load.cc |   5 ++
  3 files changed, 32 insertions(+), 6 deletions(-)


 When the loading is done from imm.xml or imm.db which has implementer name 
 for config objects.
 The implementer name is Nullified while loading from imm.xml or imm.db with 
 this patch for config objects.

 diff --git a/osaf/services/saf/immsv/immloadd/imm_loader.cc 
 b/osaf/services/saf/immsv/immloadd/imm_loader.cc
 --- a/osaf/services/saf/immsv/immloadd/imm_loader.cc
 +++ b/osaf/services/saf/immsv/immloadd/imm_loader.cc
 @@ -121,6 +121,7 @@ bool isXsdLoaded;
  std::string xsddir;
  std::string xsd;
  typedef std::setstd::string AttrFlagSet;
 +std::setstd::string runtimeClass;
  AttrFlagSet attrFlagSet;
  
  /* Helper functions */
 @@ -1056,6 +1057,9 @@ static void endElementHandler(void* user
  LOG_ER(Failed to create class %s - 
 exiting,state-className);
  exit(1);
  }
 + if(state-classCategory == SA_IMM_CLASS_RUNTIME) {
 + runtimeClass.insert(state-className);
   
This creates the set of names for all runtime classes. Ideally one would have 
liked to have only the subset of the names for all persistent runtime object 
classes.
But perhaps this is tricky to compute in this context.
Only persistent RTOs get dumped and reloaded.
And only persistent RTOs have a corresponding base table in the PBE sqlite 
representation.
Only if this is simple to fix would I fix it.
 + }
  state-attrFlags = 0;
  
  state-attrValueTypeSet= 0;
 @@ -1089,12 +1093,28 @@ static void endElementHandler(void* user
  else
  {
  //addObjectAttributeDefinition(state);
 -addObjectAttributeDefinition(state-objectClass,
 -state-attrName,
 -(state-attrValueBuffers),
 -getClassAttrValueType((state-classAttrTypeMap),
 -state-objectClass, state-attrName),
 -(state-attrValuesList));
 + std::setstd::string::iterator clit = 
 +runtimeClass.find(state-objectClass);
   
The above line is redundant and I in fact get a compiler warning for it (build 
failed for me on error as warnings).
So just remove the above line.
You are probably using an older GCC that missed this, I am using GCC 4.6.2.

Thanks
/AndersBj
 + if((strcmp (state-attrName,SaImmAttrImplementerName)==0)){ 
 + std::setstd::string::iterator clit = 
 runtimeClass.find(state-objectClass);
 + if(clit != runtimeClass.end()){
 + addObjectAttributeDefinition(state-objectClass,
 + state-attrName,
 + (state-attrValueBuffers),
 + 
 getClassAttrValueType((state-classAttrTypeMap),
 + state-objectClass, state-attrName),
 + (state-attrValuesList));
 + }
 + } 
 + else
 + {
 +  addObjectAttributeDefinition(state-objectClass,
 +state-attrName,
 +(state-attrValueBuffers),
 +getClassAttrValueType((state-classAttrTypeMap),
 +state-objectClass, state-attrName),
 +(state-attrValuesList));
 + }
 + 
  }
  /* /object */
  }
 diff --git a/osaf/services/saf/immsv/immloadd/imm_loader.hh 
 b/osaf/services/saf/immsv/immloadd/imm_loader.hh
 --- a/osaf/services/saf/immsv/immloadd/imm_loader.hh
 +++ b/osaf/services/saf/immsv/immloadd/imm_loader.hh
 @@ -36,6 +36,7 @@ struct ClassInfo
  {
   std::string className;
   AttrInfoVector attrInfoVector;
 + SaImmClassCategoryT class_category;
  };
  
  typedef  std::mapstd::string, ClassInfo*  ClassInfoMap;
 diff --git a/osaf/services/saf/immsv/immloadd/imm_pbe_load.cc 
 

[devel] [PATCH 1 of 1] IMM: release inactive search handles [#47]

2014-03-28 Thread Zoran Milinkovic
 osaf/services/saf/immsv/immnd/ImmModel.cc|  49 +++-
 osaf/services/saf/immsv/immnd/ImmSearchOp.cc |   1 +
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh |   4 ++
 3 files changed, 53 insertions(+), 1 deletions(-)


diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc 
b/osaf/services/saf/immsv/immnd/ImmModel.cc
--- a/osaf/services/saf/immsv/immnd/ImmModel.cc
+++ b/osaf/services/saf/immsv/immnd/ImmModel.cc
@@ -33,6 +33,7 @@
 #define PRT_LOW_THRESHOLD 1 /* See ImmModel::immNotPbeWritable */
 #define PRT_HIGH_THRESHOLD 4 /* See ImmModel::immNotPbeWritable */
 #define CCB_CRIT_THRESHOLD 8 /* See ImmModel::immNotPbeWritable */
+#define SEARCH_TIMEOUT_SEC 600 /* Search timeout */
 
 
 struct ContinuationInfo2
@@ -968,6 +969,46 @@ immModel_cleanTheBasement(IMMND_CB *cb,
 osafassert(ix==(*pbePrtoReqArrSize));
 }
 
+time_t now = time(NULL);
+ImmSearchOp *op;
+IMMND_OM_SEARCH_NODE *searchOp;
+IMMND_OM_SEARCH_NODE **prevSearchOp;
+IMMND_IMM_CLIENT_NODE *cl_node =
+(IMMND_IMM_CLIENT_NODE 
*)ncs_patricia_tree_getnext(cb-client_info_db, NULL);
+int clearCounter = 0;
+while(cl_node) {
+if(!cl_node-mIsSync) {
+clearCounter = 0;
+searchOp = cl_node-searchOpList;
+prevSearchOp = cl_node-searchOpList;
+while(searchOp) {
+assert(searchOp-searchOp);
+op = (ImmSearchOp *)searchOp-searchOp;
+if(!op-isSync()  now - op-getLastSearchTime()  
SEARCH_TIMEOUT_SEC) {
+TRACE_2(Clear search result. Timeout %dsec. Search id: 
%d, OM handle: %llx,
+SEARCH_TIMEOUT_SEC, searchOp-searchId, 
cl_node-imm_app_hdl);
+*prevSearchOp = searchOp-next;
+immModel_deleteSearchOp(op);
+free(searchOp);
+searchOp = *prevSearchOp;
+clearCounter++;
+} else {
+prevSearchOp = searchOp-next;
+searchOp = searchOp-next;
+}
+}
+
+if(clearCounter) {
+LOG_NO(Clear %d search result(s) for OM handle %llx. Search 
timeout %dsec,
+clearCounter, cl_node-imm_app_hdl, 
SEARCH_TIMEOUT_SEC);
+}
+}
+
+cl_node = (IMMND_IMM_CLIENT_NODE *)ncs_patricia_tree_getnext(
+cb-client_info_db,
+cl_node-patnode.key_info);
+}
+
 return stuck;
 }
 
@@ -9284,6 +9325,9 @@ ImmModel::searchInitialize(ImmsvOmSearch
 std::string refObjectName;
 SaUint32T childCount=0;
 
+/* Reset search time */
+op.updateSearchTime();
+
 if(scope == SA_IMM_ONE) {
 if(noDanglingSearch) {
  LOG_NO(ERR_INVALID_PARAM: SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS 
@@ -9293,7 +9337,7 @@ ImmModel::searchInitialize(ImmsvOmSearch
 
 return this-accessorGet(req, op);
 }
-
+
 size_t sz = strnlen((char *) req-rootName.buf, 
 (size_t)req-rootName.size);
 std::string rootName((const char*)req-rootName.buf, sz);
@@ -9723,6 +9767,9 @@ SaAisErrorT ImmModel::nextSyncResult(Imm
 ImmAttrValueMap::iterator j;
 IMMSV_OM_RSP_SEARCH_NEXT* p = NULL;
 
+/* Reset search time */
+op.updateSearchTime();
+
 if((*osip) == classInfo-mExtent.end()) {
 delete osip;
 op.syncOsi = NULL;
diff --git a/osaf/services/saf/immsv/immnd/ImmSearchOp.cc 
b/osaf/services/saf/immsv/immnd/ImmSearchOp.cc
--- a/osaf/services/saf/immsv/immnd/ImmSearchOp.cc
+++ b/osaf/services/saf/immsv/immnd/ImmSearchOp.cc
@@ -27,6 +27,7 @@ ImmSearchOp::ImmSearchOp()
 syncOsi=NULL;
 attrNameList=NULL;
 classInfo=NULL;
+lastSearch = 0;
 }
 
 ImmSearchOp::~ImmSearchOp()
diff --git a/osaf/services/saf/immsv/immnd/ImmSearchOp.hh 
b/osaf/services/saf/immsv/immnd/ImmSearchOp.hh
--- a/osaf/services/saf/immsv/immnd/ImmSearchOp.hh
+++ b/osaf/services/saf/immsv/immnd/ImmSearchOp.hh
@@ -22,6 +22,7 @@
 #include ImmAttrValue.hh
 #include string
 #include list
+#include time.h
 
 
 struct SearchAttribute
@@ -88,6 +89,8 @@ public:
 void  setIsAccessor() {mIsAccessor = true;}
 bool  isSync() {return mIsSync;}
 bool  isAccessor() {return mIsAccessor;}
+time_tgetLastSearchTime() { return lastSearch; }
+void  updateSearchTime() { lastSearch = time(NULL); }
 void* syncOsi;
 void* attrNameList;
 void* classInfo;
@@ -98,6 +101,7 @@ private:
 AttributeList mRtsToFetch;
 bool mIsSync;
 bool mIsAccessor;
+time_t lastSearch;
 };
 
 #endif

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 1] Review Request for immutil #827

2014-03-31 Thread Zoran Milinkovic
Reviewed and tested.
Ack from me.

Regards,
Zoran

-Original Message-
From: Hans Feldt [mailto:osafde...@gmail.com] 
Sent: den 31 mars 2014 08:05
To: Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 0 of 1] Review Request for immutil #827

Summary: immutil: change to char* for some functions
Review request for Trac Ticket(s): 827
Peer Reviewer(s): Zoran
Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE
Affected branch(es): default
Development branch: IF ANY GIVE THE REPO URL


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  y
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 2fa5825e5d917c6c2f7d88c035479dc5136bfc32
Author: Hans Feldt hans.fe...@ericsson.com
Date:   Mon, 31 Mar 2014 08:04:04 +0200

immutil: change to char* for some functions [#827]


Complete diffstat:
--
 osaf/libs/common/immsv/include/immutil.h |   8 
 osaf/tools/safimm/src/immutil.c  |  20 
 2 files changed, 16 insertions(+), 12 deletions(-)


Testing Commands:
-
 opensaf build


Testing, Expected Results:
--
 builds fine


Conditions of Submission:
-
 Ack from Zoran


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] IMM: release inactive search handles [#47]

2014-04-01 Thread Zoran Milinkovic
 osaf/services/saf/immsv/immnd/ImmModel.cc|  59 +++-
 osaf/services/saf/immsv/immnd/ImmSearchOp.cc |   1 +
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh |   4 +
 osaf/services/saf/immsv/immnd/immnd_cb.h |   4 +
 4 files changed, 67 insertions(+), 1 deletions(-)


diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc 
b/osaf/services/saf/immsv/immnd/ImmModel.cc
--- a/osaf/services/saf/immsv/immnd/ImmModel.cc
+++ b/osaf/services/saf/immsv/immnd/ImmModel.cc
@@ -33,6 +33,7 @@
 #define PRT_LOW_THRESHOLD 1 /* See ImmModel::immNotPbeWritable */
 #define PRT_HIGH_THRESHOLD 4 /* See ImmModel::immNotPbeWritable */
 #define CCB_CRIT_THRESHOLD 8 /* See ImmModel::immNotPbeWritable */
+#define SEARCH_TIMEOUT_SEC 600 /* Search timeout */
 
 
 struct ContinuationInfo2
@@ -968,6 +969,56 @@ immModel_cleanTheBasement(IMMND_CB *cb,
 osafassert(ix==(*pbePrtoReqArrSize));
 }
 
+time_t now = time(NULL);
+time_t nextSearch = 0;
+time_t opSearchTime;
+ImmSearchOp *op;
+IMMND_OM_SEARCH_NODE *searchOp;
+IMMND_OM_SEARCH_NODE **prevSearchOp;
+IMMND_IMM_CLIENT_NODE *cl_node =
+(IMMND_IMM_CLIENT_NODE 
*)ncs_patricia_tree_getnext(cb-client_info_db, NULL);
+int clearCounter = 0;
+while(cl_node) {
+if(!cl_node-mIsSync  cl_node-searchOpList
+ (now - cl_node-mLastSearch  SEARCH_TIMEOUT_SEC)) {
+nextSearch = now;
+clearCounter = 0;
+searchOp = cl_node-searchOpList;
+prevSearchOp = cl_node-searchOpList;
+while(searchOp) {
+osafassert(searchOp-searchOp);
+op = (ImmSearchOp *)searchOp-searchOp;
+opSearchTime = op-getLastSearchTime();
+if(!op-isSync()  now - opSearchTime  SEARCH_TIMEOUT_SEC) {
+TRACE_2(Clear search result. Timeout %dsec. Search id: 
%d, OM handle: %llx,
+SEARCH_TIMEOUT_SEC, searchOp-searchId, 
cl_node-imm_app_hdl);
+*prevSearchOp = searchOp-next;
+immModel_deleteSearchOp(op);
+free(searchOp);
+searchOp = *prevSearchOp;
+clearCounter++;
+} else {
+if(opSearchTime  nextSearch) {
+   nextSearch = opSearchTime;
+}
+prevSearchOp = searchOp-next;
+searchOp = searchOp-next;
+}
+}
+
+cl_node-mLastSearch = nextSearch;
+
+if(clearCounter) {
+LOG_NO(Clear %d search result(s) for OM handle %llx. Search 
timeout %dsec,
+clearCounter, cl_node-imm_app_hdl, 
SEARCH_TIMEOUT_SEC);
+}
+}
+
+cl_node = (IMMND_IMM_CLIENT_NODE *)ncs_patricia_tree_getnext(
+cb-client_info_db,
+cl_node-patnode.key_info);
+}
+
 return stuck;
 }
 
@@ -1281,6 +1332,9 @@ immModel_nextResult(IMMND_CB *cb, void* 
 }
 err = ImmModel::instance(cb-immModel)-nextSyncResult(rsp, *op);
 } else {
+/* Reset search time */
+op-updateSearchTime();
+
 err = op-nextResult(rsp, implConn, implNodeId,
 (rtAttrsToFetch)?(rtAttrs):NULL,
 (SaUint64T*) implDest);
@@ -9284,6 +9338,9 @@ ImmModel::searchInitialize(ImmsvOmSearch
 std::string refObjectName;
 SaUint32T childCount=0;
 
+/* Reset search time */
+op.updateSearchTime();
+
 if(scope == SA_IMM_ONE) {
 if(noDanglingSearch) {
  LOG_NO(ERR_INVALID_PARAM: SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS 
@@ -9293,7 +9350,7 @@ ImmModel::searchInitialize(ImmsvOmSearch
 
 return this-accessorGet(req, op);
 }
-
+
 size_t sz = strnlen((char *) req-rootName.buf, 
 (size_t)req-rootName.size);
 std::string rootName((const char*)req-rootName.buf, sz);
diff --git a/osaf/services/saf/immsv/immnd/ImmSearchOp.cc 
b/osaf/services/saf/immsv/immnd/ImmSearchOp.cc
--- a/osaf/services/saf/immsv/immnd/ImmSearchOp.cc
+++ b/osaf/services/saf/immsv/immnd/ImmSearchOp.cc
@@ -27,6 +27,7 @@ ImmSearchOp::ImmSearchOp()
 syncOsi=NULL;
 attrNameList=NULL;
 classInfo=NULL;
+mLastSearch = 0;
 }
 
 ImmSearchOp::~ImmSearchOp()
diff --git a/osaf/services/saf/immsv/immnd/ImmSearchOp.hh 
b/osaf/services/saf/immsv/immnd/ImmSearchOp.hh
--- a/osaf/services/saf/immsv/immnd/ImmSearchOp.hh
+++ b/osaf/services/saf/immsv/immnd/ImmSearchOp.hh
@@ -22,6 +22,7 @@
 #include ImmAttrValue.hh
 #include string
 #include list
+#include time.h
 
 
 struct SearchAttribute
@@ -88,6 +89,8 @@ public:
 void  setIsAccessor() {mIsAccessor = true;}
 bool  isSync() {return mIsSync;}
 bool  isAccessor() {return mIsAccessor;}
+time_tgetLastSearchTime() { return mLastSearch; }
+void  updateSearchTime() { mLastSearch = time(NULL); }
 void* 

[devel] [PATCH 0 of 1] Review Request for IMM: release inactive search handles [#47]

2014-04-01 Thread Zoran Milinkovic
Summary: IMM: release inactive search handles [#47]
Review request for Trac Ticket(s): 47
Peer Reviewer(s): Anders, Neelakanta
Pull request to: Zoran
Affected branch(es): default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset edaff973d0ca8a1d3a5f1466fced05445e2f68a2
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 01 Apr 2014 10:34:54 +0200

IMM: release inactive search handles [#47]


Complete diffstat:
--
 osaf/services/saf/immsv/immnd/ImmModel.cc|  59 
++-
 osaf/services/saf/immsv/immnd/ImmSearchOp.cc |   1 +
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh |   4 
 osaf/services/saf/immsv/immnd/immnd_cb.h |   4 
 4 files changed, 67 insertions(+), 1 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
Initialize a search, wait for more than 10 minutes, and then search for a next 
search result. The function should return ERR_BAD_HANDLE error code.
Pause for more than 10 minutes can be done after few search next results.


Conditions of Submission:
-
Ack from Neelakanta and Anders


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 2 of 2] IMMTOOLS: write error strings for ERR_NOT_EXIST error code in immcfg [#459]

2014-04-02 Thread Zoran Milinkovic
 osaf/tools/safimm/immcfg/imm_cfg.c |  69 +++--
 1 files changed, 36 insertions(+), 33 deletions(-)


diff --git a/osaf/tools/safimm/immcfg/imm_cfg.c 
b/osaf/tools/safimm/immcfg/imm_cfg.c
--- a/osaf/tools/safimm/immcfg/imm_cfg.c
+++ b/osaf/tools/safimm/immcfg/imm_cfg.c
@@ -477,18 +477,19 @@ int object_create(const SaNameT **object
fprintf(stderr, error - saImmOmCcbObjectCreate_2 
FAILED with %s\n,
saf_error(error));
 
-   if((error == SA_AIS_ERR_NOT_EXIST)  ccb_safe) {
-   fprintf(stderr, Missing: implementer, or 
object, or attribute 
-   (see: immcfg -h under '--unsafe')\n);
+   SaAisErrorT rc2 = saImmOmCcbGetErrorStrings(ccbHandle, 
errStrings);
+   if(errStrings) {
+   int ix = 0;
+   while(errStrings[ix]) {
+   fprintf(stderr, OI reports: %s\n, 
errStrings[ix]);
+   ++ix;
+   }
} else {
-   SaAisErrorT rc2 = 
saImmOmCcbGetErrorStrings(ccbHandle, errStrings);
-   if(errStrings) {
-   int ix = 0;
-   while(errStrings[ix]) {
-   fprintf(stderr, OI reports: 
%s\n, errStrings[ix]);
-   ++ix;
-   }
-   } else if(rc2 != SA_AIS_OK) {
+   if((error == SA_AIS_ERR_NOT_EXIST)  ccb_safe) 
{
+   fprintf(stderr, Missing: implementer, 
or object, or attribute 
+   (see: immcfg -h under 
'--unsafe')\n);
+   }
+   if(rc2 != SA_AIS_OK) {
fprintf(stderr, 
saImmOmCcbGetErrorStrings failed: %u\n, rc2);
}
}
@@ -581,18 +582,19 @@ int object_modify(const SaNameT **object
(const SaImmAttrModificationT_2 **)attrMods)) != 
SA_AIS_OK) {
fprintf(stderr, error - saImmOmCcbObjectModify_2 
FAILED: %s\n, saf_error(error));
 
-   if((error == SA_AIS_ERR_NOT_EXIST)  ccb_safe) {
-   fprintf(stderr, Missing: implementer, or 
object, or attribute 
-   (see: immcfg -h under '--unsafe')\n);
+   SaAisErrorT rc2 = saImmOmCcbGetErrorStrings(ccbHandle, 
errStrings);
+   if(errStrings) {
+   int ix = 0;
+   while(errStrings[ix]) {
+   fprintf(stderr, OI reports: %s\n, 
errStrings[ix]);
+   ++ix;
+   }
} else {
-   SaAisErrorT rc2 = 
saImmOmCcbGetErrorStrings(ccbHandle, errStrings);
-   if(errStrings) {
-   int ix = 0;
-   while(errStrings[ix]) {
-   fprintf(stderr, OI reports: 
%s\n, errStrings[ix]);
-   ++ix;
-   }
-   } else if(rc2 != SA_AIS_OK) {
+   if((error == SA_AIS_ERR_NOT_EXIST)  ccb_safe) 
{
+   fprintf(stderr, Missing: implementer, 
or object, or attribute 
+   (see: immcfg -h under 
'--unsafe')\n);
+   }
+   if(rc2 != SA_AIS_OK) {
fprintf(stderr, 
saImmOmCcbGetErrorStrings failed: %u\n, rc2);
}
}
@@ -652,18 +654,19 @@ int object_delete(const SaNameT **object
fprintf(stderr, error - saImmOmCcbObjectDelete for 
'%s' FAILED: %s\n,
objectNames[i]-value, saf_error(error));
 
-   if((error == SA_AIS_ERR_NOT_EXIST)  ccb_safe) {
-   fprintf(stderr, Missing: implementer, or 
object, or attribute 
-   (see: immcfg -h under '--unsafe')\n);
+   SaAisErrorT rc2 = saImmOmCcbGetErrorStrings(ccbHandle, 
errStrings);
+   if(errStrings) {
+   int ix = 0;
+   while(errStrings[ix]) {
+   

[devel] [PATCH 0 of 2] Review Request for IMM: add error strings for CCB operations for ERR_NOT_EXIST error [#459]

2014-04-02 Thread Zoran Milinkovic
Summary: IMM: add error strings for CCB operations for ERR_NOT_EXIST error 
[#459]
Review request for Trac Ticket(s): 459
Peer Reviewer(s): Anders, Neelakanta
Pull request to: Zoran
Affected branch(es): default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset a866790f3345c3f99c57d7cb9aa9579a1d5c34ad
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Wed, 02 Apr 2014 15:22:02 +0200

IMM: add error strings for CCB operations for ERR_NOT_EXIST error [#459]

When an implementer is detached from an object/class, CCB operations 
return
ERR_NOT_EXIST error code. The patch should give more information 
regarding
the error code in the error string.

changeset b02f4b505de84c6fb338880292835ba45074ce6a
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Wed, 02 Apr 2014 15:24:46 +0200

IMMTOOLS: write error strings for ERR_NOT_EXIST error code in immcfg 
[#459]


Complete diffstat:
--
 osaf/services/saf/immsv/immnd/ImmModel.cc |  60 

 osaf/services/saf/immsv/immnd/ImmModel.hh |   5 +
 osaf/services/saf/immsv/immnd/immnd_evt.c |  27 ---
 osaf/tools/safimm/immcfg/imm_cfg.c|  69 
-
 4 files changed, 125 insertions(+), 36 deletions(-)


Testing Commands:
-
immcfg -a attr=123 id=1
immcfg -d id=1
immcfg -c TestClass id=2


Testing, Expected Results:
--
Create an object of a TestClass (immcfg -c TestClass id=1).
Attach an implementer to the class using immapplier (immapplier -a TestImpl 
TestClass).
Exit from immapplier (Ctrl+C).
1. Modify id=1 (immcfg -a attr=123 id=1), and the error string 
(ERR_NOT_EXIST) should be written to the output
2. Delete id=1 (immcfg -d id=1), and the error string (ERR_NOT_EXIST) should 
be written to the output
3. Create a new object of class TestClass (immcfg -c TestClass id=2), and the 
error string (ERR_NOT_EXIST) should be written to the output.


Conditions of Submission:
-
Ack from Anders and Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing

[devel] [PATCH 1 of 2] IMM: add error strings for CCB operations for ERR_NOT_EXIST error [#459]

2014-04-02 Thread Zoran Milinkovic
 osaf/services/saf/immsv/immnd/ImmModel.cc |  60 +++
 osaf/services/saf/immsv/immnd/ImmModel.hh |   5 ++
 osaf/services/saf/immsv/immnd/immnd_evt.c |  27 -
 3 files changed, 89 insertions(+), 3 deletions(-)


When an implementer is detached from an object/class, CCB operations return 
ERR_NOT_EXIST error code.
The patch should give more information regarding the error code in the error 
string.

diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc 
b/osaf/services/saf/immsv/immnd/ImmModel.cc
--- a/osaf/services/saf/immsv/immnd/ImmModel.cc
+++ b/osaf/services/saf/immsv/immnd/ImmModel.cc
@@ -6950,6 +6950,10 @@ SaAisErrorT ImmModel::ccbObjectCreate(Im
 TRACE_7(ERR_NOT_EXIST: object '%s' does not have an 
 implementer and flag SA_IMM_CCB_REGISTERED_OI is 
set, 
 objectName.c_str());
+setCcbErrorString(ccb,
+ERR_NOT_EXIST: object '%s' does not have an 
+implementer and flag SA_IMM_CCB_REGISTERED_OI is 
set,
+objectName.c_str());
 err = SA_AIS_ERR_NOT_EXIST;
 }
 } else { /* SA_IMM_CCB_REGISTERED_OI NOT set */
@@ -7790,6 +7794,10 @@ ImmModel::ccbObjectModify(const ImmsvOmC
 TRACE_7(ERR_NOT_EXIST: object '%s' does not have an 
 implementer and flag SA_IMM_CCB_REGISTERED_OI is set, 
 objectName.c_str());
+setCcbErrorString(ccb,
+ERR_NOT_EXIST: object '%s' does not have an 
+implementer and flag SA_IMM_CCB_REGISTERED_OI is set,
+objectName.c_str());
 err = SA_AIS_ERR_NOT_EXIST;
 }
 } else { /* SA_IMM_CCB_REGISTERED_OI NOT set */
@@ -8201,6 +8209,10 @@ ImmModel::deleteObject(ObjectMap::iterat
 TRACE_7(ERR_NOT_EXIST: object '%s' does not have an 
implementer 
 and flag SA_IMM_CCB_REGISTERED_OI is set, 
 oi-first.c_str());
+setCcbErrorString(ccb,
+ERR_NOT_EXIST: object '%s' does not have an 
implementer 
+and flag SA_IMM_CCB_REGISTERED_OI is set,
+oi-first.c_str());
 return SA_AIS_ERR_NOT_EXIST;
 } 
 } else {  /* SA_IMM_CCB_REGISTERED_OI NOT set */
@@ -8370,6 +8382,54 @@ ImmModel::deleteObject(ObjectMap::iterat
 return SA_AIS_OK;
 }
 
+void
+ImmModel::setCcbErrorString(CcbInfo *ccb, const char *errorString, ...)
+{
+int errLen = strlen(errorString) + 1;
+char *fmtError = (char *)malloc(errLen);
+int len;
+va_list vl;
+
+va_start(vl, errorString);
+len = vsnprintf(fmtError, errLen, errorString, vl);
+va_end(vl);
+
+osafassert(len = 0);
+len++; /* Reserve one byte for null-terminated sign '\0' */
+if(len  errLen) {
+fmtError = (char *)realloc(fmtError, len);
+va_start(vl, errorString);
+osafassert(vsnprintf(fmtError, len, errorString, vl) = 0);
+va_end(vl);
+}
+
+unsigned int ix=0;
+ImmsvAttrNameList* errStr = ccb-mErrorStrings;
+ImmsvAttrNameList** errStrTail = (ccb-mErrorStrings);
+while(errStr) {
+if(!strncmp(fmtError, errStr-name.buf, len)) {
+TRACE_5(Discarding duplicate error string '%s' for ccb id %u,
+fmtError, ccb-mId);
+free(fmtError);
+return;
+}
+++ix;
+errStrTail = (errStr-next);
+errStr = errStr-next;
+}
+
+if(ix = IMMSV_MAX_ATTRIBUTES) {
+TRACE_5(Discarding error string '%s' for ccb id %u (too many),
+fmtError, ccb-mId);
+free(fmtError);
+} else {
+(*errStrTail) = (ImmsvAttrNameList *) 
malloc(sizeof(ImmsvAttrNameList));
+(*errStrTail)-next = NULL;
+(*errStrTail)-name.size = len;
+(*errStrTail)-name.buf = fmtError;
+}
+}
+
 bool
 ImmModel::hasLocalClassAppliers(ClassInfo* classInfo)
 {
diff --git a/osaf/services/saf/immsv/immnd/ImmModel.hh 
b/osaf/services/saf/immsv/immnd/ImmModel.hh
--- a/osaf/services/saf/immsv/immnd/ImmModel.hh
+++ b/osaf/services/saf/immsv/immnd/ImmModel.hh
@@ -259,6 +259,11 @@ public:
  IdVector continuations,
  unsigned int pbeIsLocal);
 
+voidsetCcbErrorString(
+  CcbInfo *ccb,
+  const char *errorString,
+  ...);
+
 boolhasLocalClassAppliers(ClassInfo* classInfo);
 boolhasLocalObjAppliers(const std::string objName);
 
diff --git a/osaf/services/saf/immsv/immnd/immnd_evt.c 
b/osaf/services/saf/immsv/immnd/immnd_evt.c
--- 

[devel] [PATCH 0 of 1] Review Request for IMM: fix memory leak in IMM [#834]

2014-04-03 Thread Zoran Milinkovic
Summary: IMM: fix memory leak in IMM [#834]
Review request for Trac Ticket(s): 834
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.3.x, opensaf-4.4.x, default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset cd5fa346756eb5e5d48a9e6345bff5c33136e683
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 03 Apr 2014 11:13:35 +0200

IMM: fix memory leak in IMM [#834]


Complete diffstat:
--
 osaf/services/saf/immsv/immnd/immnd_evt.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Testing Commands:
-



Testing, Expected Results:
--
Check that valgrind does not report any memoty leak.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread Zoran Milinkovic
+  typename AmfDbMap::iterator it = db.find(name);
+  db.erase(it);

The code above can be replaced with:

db.erase(name);

So, no extra checks for iterators.

Regards,
Zoran

-Original Message-
From: praveen malviya [mailto:praveen.malv...@oracle.com] 
Sent: den 4 april 2014 15:24
To: Hans Nordebäck
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace 
patricia tree db V2 [#713]

Please find comments inline with [Praveen].

Thanks,
Praveen

On 26-Mar-14 4:57 PM, Hans Nordeback wrote:
   osaf/services/saf/amf/amfd/include/db_template.h |  63 
 
   1 files changed, 63 insertions(+), 0 deletions(-)


 diff --git a/osaf/services/saf/amf/amfd/include/db_template.h 
 b/osaf/services/saf/amf/amfd/include/db_template.h
 new file mode 100644
 --- /dev/null
 +++ b/osaf/services/saf/amf/amfd/include/db_template.h
 @@ -0,0 +1,63 @@
 +/*  -*- OpenSAF  -*-
 + *
 + * (C) Copyright 2014 The OpenSAF Foundation
 + *
 + * This program is distributed in the hope that it will be useful, 
 +but
 + * WITHOUT ANY WARRANTY; without even the implied warranty of 
 +MERCHANTABILITY
 + * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are 
 +licensed
 + * under the GNU Lesser General Public License Version 2.1, February 1999.
 + * The complete license can be accessed from the following location:
 + * http://opensource.org/licenses/lgpl-license.php
 + * See the Copying file included with the OpenSAF distribution for 
 +full
 + * licensing terms.
 + *
 + * Author(s): Ericsson AB
 + *
 + */
 +#ifndef DB_TEMPLATE_H
 +#define  DB_TEMPLATE_H
 +
 +#include map
 +#include string
 +
 +template typename T
 +class AmfDb {
 +  public:
 +   void insert(T *obj);
 +   void erase(T *obj);
 +   T *find(const SaNameT *name);
 +
 +   typedef std::mapstd::string, T* AmfDbMap;
 +   typedef typename AmfDbMap::const_iterator const_iterator;
 +
 +   const_iterator begin() const {return db.begin();}
 +   const_iterator end() const {return db.end();}
 +
 +  private:
 +   AmfDbMap db;
 +};
 +
 +template typename T
 +void AmfDbT::insert(T *obj) {
 +  std::string name((const char*)obj-name.value, obj-name.length);
 +  db[name] = obj;
 +}
 +
[Praveen] Patricia tree returns failure for duplicate entry or if addition 
itself fails. Don't we require such return code here?
We check return code after addition.
Also can we make argument as constant.
 +template typename T
 +void AmfDbT::erase(T *obj) {
 +  std::string name((const char*)obj-name.value, obj-name.length);
 +  typename AmfDbMap::iterator it = db.find(name);
 +  db.erase(it);
 +}
[Praveen] If db.find returns NULL then this function should return error 
otherwise it crashes.
something like this:
  if (it == db.end())
   return ERROR;
   db.erase(it);

Also can we make argument as constant.

 +
 +template typename T
 +T *AmfDbT::find(const SaNameT *dn) {
 +  std::string name((const char*)dn-value, dn-length);
 +  typename AmfDbMap::iterator it = db.find(name);
 +  if (it == db.end())
 +return NULL;
 +  else
 +return it-second;
 +}
 +
 +#endif   /* DB_TEMPLATE_H */


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 2] IMM: add error strings for CCB operations for ERR_NOT_EXIST error [#459]

2014-04-07 Thread Zoran Milinkovic
The ticket had been written only for the first case ERR_NOT_EXIST: object 
'%s' exist but no implementer (which is required).
I'll change the text before I push the code.

Regards,
Zoran

-Original Message-
From: Hans Feldt 
Sent: den 7 april 2014 13:49
To: Zoran Milinkovic; reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 1 of 2] IMM: add error strings for CCB operations 
for ERR_NOT_EXIST error [#459]

Some feedback on the strings produced:

instead of:
ERR_NOT_EXIST: object '%s' does not have an implementer and flag 
SA_IMM_CCB_REGISTERED_OI is set

we could have:
ERR_NOT_EXIST: object '%s' exist but no implementer (which is required)

and:
ERR_NOT_EXIST: object '%s' does not exist

Any comments?
/Hans

On 04/02/2014 03:36 PM, Zoran Milinkovic wrote:
   osaf/services/saf/immsv/immnd/ImmModel.cc |  60 
 +++
   osaf/services/saf/immsv/immnd/ImmModel.hh |   5 ++
   osaf/services/saf/immsv/immnd/immnd_evt.c |  27 -
   3 files changed, 89 insertions(+), 3 deletions(-)


 When an implementer is detached from an object/class, CCB operations return 
 ERR_NOT_EXIST error code.
 The patch should give more information regarding the error code in the error 
 string.

 diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc 
 b/osaf/services/saf/immsv/immnd/ImmModel.cc
 --- a/osaf/services/saf/immsv/immnd/ImmModel.cc
 +++ b/osaf/services/saf/immsv/immnd/ImmModel.cc
 @@ -6950,6 +6950,10 @@ SaAisErrorT ImmModel::ccbObjectCreate(Im
   TRACE_7(ERR_NOT_EXIST: object '%s' does not have an 
   implementer and flag SA_IMM_CCB_REGISTERED_OI is 
 set,
   objectName.c_str());
 +setCcbErrorString(ccb,
 +ERR_NOT_EXIST: object '%s' does not have an 
 +implementer and flag SA_IMM_CCB_REGISTERED_OI 
 is set,
 +objectName.c_str());
   err = SA_AIS_ERR_NOT_EXIST;
   }
   } else { /* SA_IMM_CCB_REGISTERED_OI NOT set */ @@ 
 -7790,6 +7794,10 @@ ImmModel::ccbObjectModify(const ImmsvOmC
   TRACE_7(ERR_NOT_EXIST: object '%s' does not have an 
   implementer and flag SA_IMM_CCB_REGISTERED_OI is set,
   objectName.c_str());
 +setCcbErrorString(ccb,
 +ERR_NOT_EXIST: object '%s' does not have an 
 +implementer and flag SA_IMM_CCB_REGISTERED_OI is 
 set,
 +objectName.c_str());
   err = SA_AIS_ERR_NOT_EXIST;
   }
   } else { /* SA_IMM_CCB_REGISTERED_OI NOT set */ @@ -8201,6 
 +8209,10 @@ ImmModel::deleteObject(ObjectMap::iterat
   TRACE_7(ERR_NOT_EXIST: object '%s' does not have an 
 implementer 
   and flag SA_IMM_CCB_REGISTERED_OI is set,
   oi-first.c_str());
 +setCcbErrorString(ccb,
 +ERR_NOT_EXIST: object '%s' does not have an 
 implementer 
 +and flag SA_IMM_CCB_REGISTERED_OI is set,
 +oi-first.c_str());
   return SA_AIS_ERR_NOT_EXIST;
   }
   } else {  /* SA_IMM_CCB_REGISTERED_OI NOT set */ @@ -8370,6 
 +8382,54 @@ ImmModel::deleteObject(ObjectMap::iterat
   return SA_AIS_OK;
   }

 +void
 +ImmModel::setCcbErrorString(CcbInfo *ccb, const char *errorString, 
 +...) {
 +int errLen = strlen(errorString) + 1;
 +char *fmtError = (char *)malloc(errLen);
 +int len;
 +va_list vl;
 +
 +va_start(vl, errorString);
 +len = vsnprintf(fmtError, errLen, errorString, vl);
 +va_end(vl);
 +
 +osafassert(len = 0);
 +len++;   /* Reserve one byte for null-terminated sign '\0' */
 +if(len  errLen) {
 +fmtError = (char *)realloc(fmtError, len);
 +va_start(vl, errorString);
 +osafassert(vsnprintf(fmtError, len, errorString, vl) = 0);
 +va_end(vl);
 +}
 +
 +unsigned int ix=0;
 +ImmsvAttrNameList* errStr = ccb-mErrorStrings;
 +ImmsvAttrNameList** errStrTail = (ccb-mErrorStrings);
 +while(errStr) {
 +if(!strncmp(fmtError, errStr-name.buf, len)) {
 +TRACE_5(Discarding duplicate error string '%s' for ccb id %u,
 +fmtError, ccb-mId);
 +free(fmtError);
 +return;
 +}
 +++ix;
 +errStrTail = (errStr-next);
 +errStr = errStr-next;
 +}
 +
 +if(ix = IMMSV_MAX_ATTRIBUTES) {
 +TRACE_5(Discarding error string '%s' for ccb id %u (too many),
 +fmtError, ccb-mId);
 +free(fmtError);
 +} else {
 +(*errStrTail) = (ImmsvAttrNameList *) 
 malloc(sizeof(ImmsvAttrNameList));
 +(*errStrTail)-next = NULL;
 +(*errStrTail)-name.size = len;
 +(*errStrTail)-name.buf

[devel] [PATCH 0 of 1] Review Request for IMMTOOLS: fix errors compiled with 32-bit compiler [#838]

2014-04-08 Thread Zoran Milinkovic
Summary: IMMTOOLS: fix errors compiled with 32-bit compiler [#838]
Review request for Trac Ticket(s): 838
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.4.x, default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 4f9d846cfc5c07bbd957a08491c32a3556ccb97f
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 08 Apr 2014 10:38:16 +0200

IMMTOOLS: fix errors compiled with 32-bit compiler [#838]


Complete diffstat:
--
 osaf/tools/safimm/immcfg/imm_import.cc |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
Compiling with 32-bit compiler should succeed.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test  Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] IMMTOOLS: fix errors compiled with 32-bit compiler [#838]

2014-04-08 Thread Zoran Milinkovic
I'll change to ULL when I push the code.

Thanks,
Zoran

-Original Message-
From: Hans Nordebäck 
Sent: den 8 april 2014 11:00
To: Zoran Milinkovic; reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [devel] [PATCH 1 of 1] IMMTOOLS: fix errors compiled with 32-bit 
compiler [#838]

Hi, use ULL, e.g 0x123ULL for the constant. Or use UINT64_C(0x123) from 
stdint.h/BR HansN

-Original Message-
From: Zoran Milinkovic [mailto:zoran.milinko...@ericsson.com] 
Sent: den 8 april 2014 10:46
To: reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1 of 1] IMMTOOLS: fix errors compiled with 32-bit 
compiler [#838]

 osaf/tools/safimm/immcfg/imm_import.cc |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/osaf/tools/safimm/immcfg/imm_import.cc 
b/osaf/tools/safimm/immcfg/imm_import.cc
--- a/osaf/tools/safimm/immcfg/imm_import.cc
+++ b/osaf/tools/safimm/immcfg/imm_import.cc
@@ -1930,7 +1930,7 @@ static void charactersHandler(void* user
case FLAG:
{
SaImmAttrFlagsT flg = charsToFlagsHelper(chars, 
(size_t)len);
-   if(flg == 0x) {
+   if(flg == 0xllu) {
stopParser(state);
state-parsingStatus = 1;
} else {
@@ -2003,7 +2003,7 @@ static SaImmAttrFlagsT charsToFlagsHelpe
 
LOG_ER(UNKNOWN FLAGS, %s, flag.c_str());
 
-   return 0x;
+   return 0xllu;
 }
 
 /**

--
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration Continuously Automate 
Build, Test  Deployment Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

--
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test  Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 3] IMM: Support for saImmOmCcbAbort API [#798]

2014-04-08 Thread Zoran Milinkovic
Ack from me.
Reviewed and tested.

Find minor comments below in the code started with [Zoran]

Best regards,
Zoran

-Original Message-
From: Anders Björnerstedt 
Sent: den 4 april 2014 14:53
To: reddy.neelaka...@oracle.com; Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 3] IMM: Support for saImmOmCcbAbort API [#798]

 osaf/libs/agents/saf/imma/imma_cb.h|   1 +
 osaf/libs/agents/saf/imma/imma_def.h   |   2 +-
 osaf/libs/agents/saf/imma/imma_oi_api.c|   9 +-
 osaf/libs/agents/saf/imma/imma_om_api.c|  82 +-
 osaf/libs/saf/include/saImmOm_A_2_13.h |   2 +
 osaf/libs/saf/include/saImmOm_A_2_14.h |  46 ++
 tests/immsv/common/immtest.c   |   4 +-
 tests/immsv/management/test_saImmOmCcbApply.c  |  95 ++
 tests/immsv/management/test_saImmOmCcbInitialize.c |   4 +
 9 files changed, 231 insertions(+), 14 deletions(-)


See ticket or osaf/services/saf/immsv/README for details.

diff --git a/osaf/libs/agents/saf/imma/imma_cb.h 
b/osaf/libs/agents/saf/imma/imma_cb.h
--- a/osaf/libs/agents/saf/imma/imma_cb.h
+++ b/osaf/libs/agents/saf/imma/imma_cb.h
@@ -60,6 +60,7 @@ typedef struct imma_client_node {
bool isImmA2b;   /* Version A.02.11 */
bool isImmA2bCbk;/* Version A.02.11 callback*/
bool isImmA2d;   /* Version A.02.13 */
+   bool isImmA2e;   /* Version A.02.14 */
bool isApplier; /* True = This is an Applier-OI */
bool isAug; /* True = handle internal to OI augmented CCB */
bool isBusy;/* True = handle is locked by a thread until a 
function execution is done */
diff --git a/osaf/libs/agents/saf/imma/imma_def.h 
b/osaf/libs/agents/saf/imma/imma_def.h
--- a/osaf/libs/agents/saf/imma/imma_def.h
+++ b/osaf/libs/agents/saf/imma/imma_def.h
@@ -22,7 +22,7 @@
 /* Macros for Validating Version */
 #define IMMA_RELEASE_CODE 'A'
 #define IMMA_MAJOR_VERSION 0x02
-#define IMMA_MINOR_VERSION 0x0d
+#define IMMA_MINOR_VERSION 0x0e
 
 #define IMMSV_WAIT_TIME  1000 /* Default MDS wait time in 10ms units =10 sec*/
 
diff --git a/osaf/libs/agents/saf/imma/imma_oi_api.c 
b/osaf/libs/agents/saf/imma/imma_oi_api.c
--- a/osaf/libs/agents/saf/imma/imma_oi_api.c
+++ b/osaf/libs/agents/saf/imma/imma_oi_api.c
@@ -121,9 +121,12 @@ SaAisErrorT saImmOiInitialize_2(SaImmOiH
TRACE_2(OI client version A.2.%u, 
requested_version.minorVersion);
if(requested_version.minorVersion = 0x0b) {
cl_node-isImmA2b = 0x1;
-   }
-   if(requested_version.minorVersion = 0x0d) {
-   cl_node-isImmA2d = 0x1;
+   if(requested_version.minorVersion = 0x0d) {
+   cl_node-isImmA2d = true;
+   if(requested_version.minorVersion = 0x0e) {
+   cl_node-isImmA2e = true;
+   }
+   }
}
}
 
diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -53,7 +53,7 @@ static const char *sysaAdmName = SA_IMM_
 static const char *sysaImplName = SA_IMM_ATTR_IMPLEMENTER_NAME;
 
 static int imma_om_resurrect(IMMA_CB *cb, IMMA_CLIENT_NODE *cl_node, bool 
*locked);
-
+static SaAisErrorT imma_finalizeCcb(SaImmCcbHandleT ccbHandle, bool 
keepCcbHandleOpen);
 
 /
   Name  :  SaImmOmInitialize
@@ -124,6 +124,9 @@ SaAisErrorT saImmOmInitialize_o2(SaImmHa
 
if(requested_version.minorVersion = 0x0d) {
cl_node-isImmA2d = true;
+   if(requested_version.minorVersion = 0x0e) {
+   cl_node-isImmA2e = true;
+   }
}
 
/* Store the callback functions, if set */
@@ -170,9 +173,12 @@ SaAisErrorT saImmOmInitialize(SaImmHandl
TRACE(OM client version A.2.%u, 
requested_version.minorVersion);
if(requested_version.minorVersion = 0x0b) {
cl_node-isImmA2b = true;
-   }
-   if(requested_version.minorVersion = 0x0d) {
-   cl_node-isImmA2d = true;
+   if(requested_version.minorVersion = 0x0d) {
+   cl_node-isImmA2d = true;
+   if(requested_version.minorVersion = 0x0e) {
+   cl_node-isImmA2e = true;
+   }
+   }
}
}
 
@@ -3259,6 +3265,40 @@ SaAisErrorT saImmOmCcbApply(SaImmCcbHand
 }
 
 /
+  Name  :  saImmOmCcbAbort
+ 
+  Description

Re: [devel] [PATCH 2 of 3] IMM: Support for saImmOmCcbValidate API [#798]

2014-04-08 Thread Zoran Milinkovic
When IMM handle is initialized with lower version than A.2.14, after ccbApply, 
ccbAbort should return ERR_VERSION, but SA_AIS_OK is returned.
When CCB is not applied, ccbAbort works fine and returns ERR_VERSION.
The rest of the code is reviewed and tested, and it's ok.

NACK until the version is fixed.

Best regards,
Zoran

-Original Message-
From: Anders Björnerstedt 
Sent: den 4 april 2014 14:53
To: reddy.neelaka...@oracle.com; Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 2 of 3] IMM: Support for saImmOmCcbValidate API [#798]

 osaf/libs/agents/saf/imma/imma_cb.h|1 +
 osaf/libs/agents/saf/imma/imma_oi_api.c|2 +-
 osaf/libs/agents/saf/imma/imma_om_api.c|  166 -
 osaf/libs/common/immsv/immsv_evt.c |4 +
 osaf/libs/common/immsv/include/immsv_evt.h |1 +
 osaf/libs/saf/include/saImmOm_A_2_14.h |3 +
 osaf/services/saf/immsv/immnd/ImmModel.cc  |  167 ++--
 osaf/services/saf/immsv/immnd/ImmModel.hh  |3 +-
 osaf/services/saf/immsv/immnd/immnd_evt.c  |   73 -
 osaf/services/saf/immsv/immnd/immnd_init.h |4 +-
 tests/immsv/implementer/test_SaImmOiCcb.c  |  120 -
 tests/immsv/implementer/test_saImmOiAugmentCcbInitialize.c |   38 ++-
 tests/immsv/management/test_saImmOmCcbApply.c  |   89 ++
 tests/immsv/management/test_saImmOmCcbInitialize.c |4 +
 tests/unit_test_fw/src/utest.c |2 +-
 15 files changed, 607 insertions(+), 70 deletions(-)


See ticket or osaf/services/saf/immsv/README for details.

diff --git a/osaf/libs/agents/saf/imma/imma_cb.h 
b/osaf/libs/agents/saf/imma/imma_cb.h
--- a/osaf/libs/agents/saf/imma/imma_cb.h
+++ b/osaf/libs/agents/saf/imma/imma_cb.h
@@ -98,6 +98,7 @@ typedef struct imma_ccb_node {
  timeout = Ccb-outcome to be 
recovered. */
bool mApplied; /* Current mCcbId appliedterminated */
bool mAborted; /* Current mCcbId aborted */
+   bool mValidated;   /* Current mCcbId validated */
bool mAugCcb;  /* Current and only mCcbId is an augment. */
bool mAugIsTainted;/* AugCcb has tainted root CCB = apply aug or abort 
root*/
 } IMMA_CCB_NODE;
diff --git a/osaf/libs/agents/saf/imma/imma_oi_api.c 
b/osaf/libs/agents/saf/imma/imma_oi_api.c
--- a/osaf/libs/agents/saf/imma/imma_oi_api.c
+++ b/osaf/libs/agents/saf/imma/imma_oi_api.c
@@ -3417,7 +3417,7 @@ SaAisErrorT saImmOiAugmentCcbInitialize(
IMMA_CALLBACK_INFO * cbi=NULL;
SaImmHandleT privateOmHandle = 0LL;
SaImmAdminOwnerHandleT privateAoHandle = 0LL;
-   SaVersionT version = {'A', 2, 11};
+   SaVersionT version = {'A', 2, 14};
SaUint32T adminOwnerId = 0;
SaUint32T ccbId = 0;
 
diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -54,6 +54,7 @@ static const char *sysaImplName = SA_IMM
 
 static int imma_om_resurrect(IMMA_CB *cb, IMMA_CLIENT_NODE *cl_node, bool 
*locked);
 static SaAisErrorT imma_finalizeCcb(SaImmCcbHandleT ccbHandle, bool 
keepCcbHandleOpen);
+static SaAisErrorT imma_applyCcb(SaImmCcbHandleT ccbHandle, bool onlyValidate);
 
 /
   Name  :  SaImmOmInitialize
@@ -2873,6 +2874,11 @@ SaAisErrorT saImmOmCcbObjectDelete(SaImm
 **/
 SaAisErrorT saImmOmCcbApply(SaImmCcbHandleT ccbHandle)
 {
+   return imma_applyCcb(ccbHandle, false);
+}
+
+SaAisErrorT imma_applyCcb(SaImmCcbHandleT ccbHandle, bool onlyValidate)
+{
SaAisErrorT rc = SA_AIS_OK;
IMMA_CB *cb = imma_cb;
IMMSV_EVT evt;
@@ -2924,7 +2930,9 @@ SaAisErrorT saImmOmCcbApply(SaImmCcbHand
   ccb-id has been EXPLICITLY applied by the user. 
   This can only be done by a successful explicit 
   saImmOmCcbApply. A ccb-handle with an aborted ccb-id
-  can not be used any more. Only finalize is allowed on handle.
+  can only be used again after an explcit saImmOmCcbAbort() 
has been
+  invoked on the handle. Otherwise only finalize is allowed on
+   the handle.
 
   Setting mApplied to true opens for the IMPLICIT 
   start of a new ccb-id with the current and same 
SaImmCcbHandleT value.
@@ -2949,6 +2957,11 @@ SaAisErrorT saImmOmCcbApply(SaImmCcbHand
goto done;
}
 
+   if (ccb_node-mValidated  onlyValidate) {
+   rc = SA_AIS_OK; /* Validation is idempotent on clientr side */
+   goto done

Re: [devel] [PATCH 0 of 1] Review Request for IMMTOOLS: fix printing and dumping for float and double values [#53]

2014-04-09 Thread Zoran Milinkovic
Hi Neelakanta,

Can you be more specific where the precision is not followed ?
There is no need for another ticket. We can fix it in this ticket.

Best regards,
Zoran

-Original Message-
From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com] 
Sent: den 9 april 2014 12:46
To: Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0 of 1] Review Request for IMMTOOLS: fix printing and 
dumping for float and double values [#53]

Hi Zoran,

Reviewed and tested the patch.
Ack.

The published patch, work fine when dumping for float and double is for xml 
format.

where as either in PBE or in dumpcase  the precision is not yet followed 
(probably a new ticket may be created for fixing at later stage)

/Neel.



On Tuesday 25 March 2014 06:29 PM, Zoran Milinkovic wrote:
 Summary: IMMTOOLS: fix printing and dumping for float and double 
 values [#53] Review request for Trac Ticket(s): 53 Peer Reviewer(s): 
 Neelakanta Pull request to: Zoran Affected branch(es): default(4.5) 
 Development branch: default(4.5)

 
 Impacted area   Impact y/n
 
   Docsn
   Build systemn
   RPM/packaging   n
   Configuration files n
   Startup scripts n
   SAF servicesy
   OpenSAF servicesn
   Core libraries  n
   Samples n
   Tests   n
   Other   n


 Comments (indicate scope for each y above):
 -

 changeset 2421ad9733ede8656aacf1f94d4b5ae70cf6b156
 Author:   Zoran Milinkovic zoran.milinko...@ericsson.com
 Date: Tue, 25 Mar 2014 11:11:51 +0100

   IMMTOOLS: fix printing and dumping for float and double values [#53]


 Complete diffstat:
 --
   osaf/libs/common/immsv/immpbe_dump.cc |  2 ++
   osaf/tools/safimm/immlist/imm_list.c  |  8 
   2 files changed, 6 insertions(+), 4 deletions(-)


 Testing Commands:
 -
 immdump test.xml
 immlist DN


 Testing, Expected Results:
 --
 immdump must export big float and double values in a scientific format 
 (including exponent).
 immlist must print big float and double values in a scientific format.
 immload must import big float and double values from XML file dumped by 
 immdump. The precision should not be lost.


 Conditions of Submission:
 -
 Ack from Neelakanta


 Arch  Built StartedLinux distro
 ---
 mipsn  n
 mips64  n  n
 x86 n  n
 x86_64  n  n
 powerpc n  n
 powerpc64   n  n


 Reviewer Checklist:
 ---
 [Submitters: make sure that your review doesn't trigger any 
 checkmarks!]


 Your checkin has not passed review because (see checked entries):

 ___ Your RR template is generally incomplete; it has too many blank entries
  that need proper data filled in.

 ___ You have failed to nominate the proper persons for review and push.

 ___ Your patches do not have proper short+long header

 ___ You have grammar/spelling in your header that is unacceptable.

 ___ You have exceeded a sensible line length in your headers/comments/text.

 ___ You have failed to put in a proper Trac Ticket # into your commits.

 ___ You have incorrectly put/left internal data in your comments/files
  (i.e. internal bug tracking tool IDs, product names etc)

 ___ You have not given any evidence of testing beyond basic build tests.
  Demonstrate some level of runtime or other sanity testing.

 ___ You have ^M present in some of your files. These have to be removed.

 ___ You have needlessly changed whitespace or added whitespace crimes
  like trailing spaces, or spaces before tabs.

 ___ You have mixed real technical changes with whitespace and other
  cosmetic code cleanup changes. These have to be separate commits.

 ___ You need to refactor your submission into logical chunks; there is
  too much content into a single commit.

 ___ You have extraneous garbage in your review (merge commits etc)

 ___ You have giant attachments which should never have been sent;
  Instead you should place your content in a public tree to be pulled.

 ___ You have too many commits attached to an e-mail; resend as threaded
  commits, or place in a public tree for a pull.

 ___ You have resent this content multiple times without a clear indication
  of what has changed between each re-send.

 ___ You have failed to adequately and individually address all of the
  comments and change requests that were proposed in the initial review.

 ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

 ___ Your computer have a badly configured date and time; confusing the
  the threaded patch review.

 ___ Your changes affect IPC mechanism, and you don't present any results

Re: [devel] [PATCH 0 of 1] Review Request for IMMTOOLS: fix printing and dumping for float and double values [#53]

2014-04-09 Thread Zoran Milinkovic
Hi Neelakanta,

It seems that sqlite has a problem in keeping floating point precision using 
sqlite3_column_text. It could be a bug in sqlite.
Unfortunately, we use sqlite3_column_text() for all data types, including float 
and double.

I'll write a new ticket for fixing immload to use a correct sqlite3 function 
for retrieving results.

Best regards,
Zoran

-Original Message-
From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com] 
Sent: den 9 april 2014 13:15
To: Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0 of 1] Review Request for IMMTOOLS: fix printing and 
dumping for float and double values [#53]

Hi zoran,

when we dump to a db eg:
immdump -p /tmp/dump.db

and try to open the db, you still see the precession is not 
followed(same with PBE).
#sqlite3 /tmp/dump.db .dump  /tmp/dump.sql


Eg:

# immlist testClass=1
Name   Type Value(s)

testClass  SA_STRING_T testClass=1
fattr  SA_FLOAT_T 3.1415927
dattr  SA_DOUBLE_T 
3.1415927410125732
SaImmAttrImplementerName   SA_STRING_T Empty
SaImmAttrClassName SA_STRING_T TestClass
SaImmAttrAdminOwnerNameSA_STRING_T IMMLOADER


where as in db it is:
INSERT INTO TestClass 
VALUES(354,'testClass=1',3.14159274101257,3.14159274101257,NULL,'TestClass','IMMLOADER');

This may not have impact, but the precision is not followed.

/Neel.

On Wednesday 09 April 2014 04:30 PM, Zoran Milinkovic wrote:
 Hi Neelakanta,

 Can you be more specific where the precision is not followed ?
 There is no need for another ticket. We can fix it in this ticket.

 Best regards,
 Zoran

 -Original Message-
 From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com]
 Sent: den 9 april 2014 12:46
 To: Zoran Milinkovic
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: Re: [PATCH 0 of 1] Review Request for IMMTOOLS: fix printing and 
 dumping for float and double values [#53]

 Hi Zoran,

 Reviewed and tested the patch.
 Ack.

 The published patch, work fine when dumping for float and double is for xml 
 format.

 where as either in PBE or in dumpcase  the precision is not yet followed 
 (probably a new ticket may be created for fixing at later stage)

 /Neel.



 On Tuesday 25 March 2014 06:29 PM, Zoran Milinkovic wrote:
 Summary: IMMTOOLS: fix printing and dumping for float and double
 values [#53] Review request for Trac Ticket(s): 53 Peer Reviewer(s):
 Neelakanta Pull request to: Zoran Affected branch(es): default(4.5)
 Development branch: default(4.5)

 
 Impacted area   Impact y/n
 
Docsn
Build systemn
RPM/packaging   n
Configuration files n
Startup scripts n
SAF servicesy
OpenSAF servicesn
Core libraries  n
Samples n
Tests   n
Other   n


 Comments (indicate scope for each y above):
 -

 changeset 2421ad9733ede8656aacf1f94d4b5ae70cf6b156
 Author:  Zoran Milinkovic zoran.milinko...@ericsson.com
 Date:Tue, 25 Mar 2014 11:11:51 +0100

  IMMTOOLS: fix printing and dumping for float and double values [#53]


 Complete diffstat:
 --
osaf/libs/common/immsv/immpbe_dump.cc |  2 ++
osaf/tools/safimm/immlist/imm_list.c  |  8 
2 files changed, 6 insertions(+), 4 deletions(-)


 Testing Commands:
 -
 immdump test.xml
 immlist DN


 Testing, Expected Results:
 --
 immdump must export big float and double values in a scientific format 
 (including exponent).
 immlist must print big float and double values in a scientific format.
 immload must import big float and double values from XML file dumped by 
 immdump. The precision should not be lost.


 Conditions of Submission:
 -
 Ack from Neelakanta


 Arch  Built StartedLinux distro
 ---
 mipsn  n
 mips64  n  n
 x86 n  n
 x86_64  n  n
 powerpc n  n
 powerpc64   n  n


 Reviewer Checklist:
 ---
 [Submitters: make sure that your review doesn't trigger any
 checkmarks!]


 Your checkin has not passed review because (see checked entries):

 ___ Your RR template is generally incomplete; it has too many blank entries
   that need proper data filled in.

 ___ You have failed to nominate the proper persons for review and push.

 ___ Your patches do not have proper short+long header

 ___ You have grammar/spelling in your header

[devel] [PATCH 1 of 2] IMM: add error strings for CCB operations for ERR_NOT_EXIST error [#459]

2014-04-14 Thread Zoran Milinkovic
 osaf/services/saf/immsv/immnd/ImmModel.cc |  66 +++
 osaf/services/saf/immsv/immnd/ImmModel.hh |   5 ++
 osaf/services/saf/immsv/immnd/immnd_evt.c |  27 +++-
 3 files changed, 95 insertions(+), 3 deletions(-)


IMM service should give more information in the error string for ERR_NOT_EXIST 
error code from CCB operation.

diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc 
b/osaf/services/saf/immsv/immnd/ImmModel.cc
--- a/osaf/services/saf/immsv/immnd/ImmModel.cc
+++ b/osaf/services/saf/immsv/immnd/ImmModel.cc
@@ -6305,6 +6305,7 @@ SaAisErrorT ImmModel::ccbObjectCreate(Im
 
 if (i3 == sClassMap.end()) {
 TRACE_7(ERR_NOT_EXIST: class '%s' does not exist, className.c_str());
+setCcbErrorString(ccb, ERR_NOT_EXIST: class '%s' does not exist, 
className.c_str());
 err = SA_AIS_ERR_NOT_EXIST;
 goto ccbObjectCreateExit;
 } else if(sPbeRtMutations.find(className) != sPbeRtMutations.end()) {
@@ -6571,6 +6572,8 @@ SaAisErrorT ImmModel::ccbObjectCreate(Im
 
 if (i6 == object-mAttrValueMap.end()) {
 TRACE_7(ERR_NOT_EXIST: attr '%s' not defined, 
attrName.c_str());
+setCcbErrorString(ccb, ERR_NOT_EXIST: attr '%s' not defined,
+attrName.c_str());
 err = SA_AIS_ERR_NOT_EXIST;
 break; //out of for-loop
 }
@@ -6950,6 +6953,10 @@ SaAisErrorT ImmModel::ccbObjectCreate(Im
 TRACE_7(ERR_NOT_EXIST: object '%s' does not have an 
 implementer and flag SA_IMM_CCB_REGISTERED_OI is 
set, 
 objectName.c_str());
+setCcbErrorString(ccb,
+ERR_NOT_EXIST: object '%s' exist but 
+no implementer (which is required),
+objectName.c_str());
 err = SA_AIS_ERR_NOT_EXIST;
 }
 } else { /* SA_IMM_CCB_REGISTERED_OI NOT set */
@@ -7380,6 +7387,9 @@ ImmModel::ccbObjectModify(const ImmsvOmC
 if(i4==classInfo-mAttrMap.end()) {
 TRACE_7(ERR_NOT_EXIST: attr '%s' does not exist in object %s,
 attrName.c_str(), objectName.c_str());
+setCcbErrorString(ccb,
+ERR_NOT_EXIST: attr '%s' does not exist in object %s,
+attrName.c_str(), objectName.c_str());
 err = SA_AIS_ERR_NOT_EXIST;
 break; //out of for-loop
 }
@@ -7790,6 +7800,10 @@ ImmModel::ccbObjectModify(const ImmsvOmC
 TRACE_7(ERR_NOT_EXIST: object '%s' does not have an 
 implementer and flag SA_IMM_CCB_REGISTERED_OI is set, 
 objectName.c_str());
+setCcbErrorString(ccb,
+ERR_NOT_EXIST: object '%s' exist but 
+no implementer (which is required),
+objectName.c_str());
 err = SA_AIS_ERR_NOT_EXIST;
 }
 } else { /* SA_IMM_CCB_REGISTERED_OI NOT set */
@@ -8201,6 +8215,10 @@ ImmModel::deleteObject(ObjectMap::iterat
 TRACE_7(ERR_NOT_EXIST: object '%s' does not have an 
implementer 
 and flag SA_IMM_CCB_REGISTERED_OI is set, 
 oi-first.c_str());
+setCcbErrorString(ccb,
+ERR_NOT_EXIST: object '%s' exist but 
+no implementer (which is required),
+oi-first.c_str());
 return SA_AIS_ERR_NOT_EXIST;
 } 
 } else {  /* SA_IMM_CCB_REGISTERED_OI NOT set */
@@ -8370,6 +8388,54 @@ ImmModel::deleteObject(ObjectMap::iterat
 return SA_AIS_OK;
 }
 
+void
+ImmModel::setCcbErrorString(CcbInfo *ccb, const char *errorString, ...)
+{
+int errLen = strlen(errorString) + 1;
+char *fmtError = (char *)malloc(errLen);
+int len;
+va_list vl;
+
+va_start(vl, errorString);
+len = vsnprintf(fmtError, errLen, errorString, vl);
+va_end(vl);
+
+osafassert(len = 0);
+len++; /* Reserve one byte for null-terminated sign '\0' */
+if(len  errLen) {
+fmtError = (char *)realloc(fmtError, len);
+va_start(vl, errorString);
+osafassert(vsnprintf(fmtError, len, errorString, vl) = 0);
+va_end(vl);
+}
+
+unsigned int ix=0;
+ImmsvAttrNameList* errStr = ccb-mErrorStrings;
+ImmsvAttrNameList** errStrTail = (ccb-mErrorStrings);
+while(errStr) {
+if(!strncmp(fmtError, errStr-name.buf, len)) {
+TRACE_5(Discarding duplicate error string '%s' for ccb id %u,
+fmtError, ccb-mId);
+free(fmtError);
+return;
+}
+++ix;
+errStrTail = (errStr-next);
+errStr = errStr-next;
+}
+
+if(ix = IMMSV_MAX_ATTRIBUTES) {
+TRACE_5(Discarding error string '%s' for ccb id %u (too many),
+

[devel] [PATCH 0 of 2] Review Request for IMM: add error strings for CCB operations for ERR_NOT_EXIST error [#459]

2014-04-14 Thread Zoran Milinkovic
Summary: IMM: add error strings for CCB operations for ERR_NOT_EXIST error 
[#459]
Review request for Trac Ticket(s): 459
Peer Reviewer(s): Anders, Neelakanta
Pull request to: Zoran
Affected branch(es): default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset c6f33ab8ac26a7f39a4ad270f151b9b42270633e
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Mon, 14 Apr 2014 13:56:55 +0200

IMM: add error strings for CCB operations for ERR_NOT_EXIST error [#459]

IMM service should give more information in the error string for
ERR_NOT_EXIST error code from CCB operation.

changeset c88c183a7e18527a20ce5c0265cd5d628bee5123
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Mon, 14 Apr 2014 13:59:21 +0200

IMMTOOLS: write error strings for ERR_NOT_EXIST error code in immcfg 
[#459]

Add possibility to write error strings for all error codes if they 
exist.


Complete diffstat:
--
 osaf/services/saf/immsv/immnd/ImmModel.cc |  66 
++
 osaf/services/saf/immsv/immnd/ImmModel.hh |   5 +
 osaf/services/saf/immsv/immnd/immnd_evt.c |  27 ---
 osaf/tools/safimm/immcfg/imm_cfg.c|  69 
-
 4 files changed, 131 insertions(+), 36 deletions(-)


Testing Commands:
-
immcfg -a attr=123 id=1
immcfg -d id=1
immcfg -c TestClass id=2


Testing, Expected Results:
--
Test for detached implementer.
Create an object of a TestClass (immcfg -c TestClass id=1).
Attach an implementer to the class using immapplier (immapplier -a TestImpl 
TestClass).
Exit from immapplier (Ctrl+C).
1. Modify id=1 (immcfg -a attr=123 id=1), and the error string 
(ERR_NOT_EXIST) should be written to the output
2. Delete id=1 (immcfg -d id=1), and the error string (ERR_NOT_EXIST) should 
be written to the output
3. Create a new object of class TestClass (immcfg -c TestClass id=2), and the 
error string (ERR_NOT_EXIST) should be written to the output.

Cases when class does not exist and when attribute is not define, need to be 
tested for ccbCreate.
For ccbModify, the case when attribute is not defined needs to be tested.


Conditions of Submission:
-
Ack from Anders, Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments

[devel] [PATCH 1 of 2] IMMTOOLS: fix printing and dumping for float and double values [#53]

2014-04-15 Thread Zoran Milinkovic
 osaf/libs/common/immsv/immpbe_dump.cc |  2 ++
 osaf/tools/safimm/immlist/imm_list.c  |  8 
 2 files changed, 6 insertions(+), 4 deletions(-)


Set a correct floating point precision for printed and dumped float and double 
values, so that the floating point precision is not lost when the floating 
point value in a string representation is converted back to float and double 
value.

diff --git a/osaf/libs/common/immsv/immpbe_dump.cc 
b/osaf/libs/common/immsv/immpbe_dump.cc
--- a/osaf/libs/common/immsv/immpbe_dump.cc
+++ b/osaf/libs/common/immsv/immpbe_dump.cc
@@ -3176,9 +3176,11 @@ std::string valueToString(SaImmAttrValue
ost  *((unsigned long long *) value);
break;
case SA_IMM_ATTR_SAFLOATT:
+   ost.precision(8);
ost  *((float *) value);
break;
case SA_IMM_ATTR_SADOUBLET:
+   ost.precision(17);
ost  *((double *) value);
break;
case SA_IMM_ATTR_SANAMET:
diff --git a/osaf/tools/safimm/immlist/imm_list.c 
b/osaf/tools/safimm/immlist/imm_list.c
--- a/osaf/tools/safimm/immlist/imm_list.c
+++ b/osaf/tools/safimm/immlist/imm_list.c
@@ -96,10 +96,10 @@ static void print_attr_value_raw(SaImmVa
printf(%llu,  *((SaTimeT *)attrValue));
break;
case SA_IMM_ATTR_SAFLOATT:
-   printf(%f, *((SaFloatT *)attrValue));
+   printf(%.8g, *((SaFloatT *)attrValue));
break;
case SA_IMM_ATTR_SADOUBLET:
-   printf(%17.15f, *((SaDoubleT *)attrValue));
+   printf(%.17g, *((SaDoubleT *)attrValue));
break;
case SA_IMM_ATTR_SANAMET: {
SaNameT *myNameT = (SaNameT *)attrValue;
@@ -158,10 +158,10 @@ static void print_attr_value(SaImmValueT
break;
}
case SA_IMM_ATTR_SAFLOATT:
-   printf(%f , *((SaFloatT *)attrValue));
+   printf(%.8g, *((SaFloatT *)attrValue));
break;
case SA_IMM_ATTR_SADOUBLET:
-   printf(%17.15f, *((SaDoubleT *)attrValue));
+   printf(%.17g, *((SaDoubleT *)attrValue));
break;
case SA_IMM_ATTR_SANAMET:
{

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for IMMTOOLS: revert old way of parsing default values and add a flag for more strict parsing values in immcfg [#861]

2014-04-22 Thread Zoran Milinkovic
Summary: IMMTOOLS: revert old way of parsing default values and add a flag for 
more strict parsing values in immcfg [#861]
Review request for Trac Ticket(s): 861
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.4.x, default(4.5)
Development branch: opensaf-4.4.x


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset c59d3d9d25a39fd3325a3f455ac10c551f4b93ad
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 22 Apr 2014 16:52:30 +0200

IMMTOOLS: revert old way of parsing default values and add a flag for 
more
strict parsing values in immcfg [#861]

For backwards compatibility, it's needed to revert the code for old way 
of
parsing default values. Flag --strict is added for a more strict parsing
values, which fail immcfg if an attribute value does not match the 
attribute
data type.


Complete diffstat:
--
 osaf/tools/safimm/immcfg/imm_cfg.c |  13 +
 osaf/tools/safimm/immcfg/imm_import.cc |  34 ++
 2 files changed, 31 insertions(+), 16 deletions(-)


Testing Commands:
-
immcfg --strict -L imm.xml
immcfg -L imm.xml
immcfg --strict -f imm.xml
immcfg -f imm.xml


Testing, Expected Results:
--
Create an XML file with a class that has an attribute of integer type, and 
string default value.
immcfg with new flag --strict should fail for both -f and -L.
If --strict flag is missing, immcfg with -f and -L should succeed to load 
and verify XML file.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your

[devel] [PATCH 1 of 1] IMMTOOLS: revert old way of parsing default values and add a flag for more strict parsing values in immcfg [#861]

2014-04-22 Thread Zoran Milinkovic
 osaf/tools/safimm/immcfg/imm_cfg.c |  13 +
 osaf/tools/safimm/immcfg/imm_import.cc |  34 ++
 2 files changed, 31 insertions(+), 16 deletions(-)


For backwards compatibility, it's needed to revert the code for old way of 
parsing default values.
Flag --strict is added for a more strict parsing values, which fail immcfg if 
an attribute value does not match the attribute data type.

diff --git a/osaf/tools/safimm/immcfg/imm_cfg.c 
b/osaf/tools/safimm/immcfg/imm_cfg.c
--- a/osaf/tools/safimm/immcfg/imm_cfg.c
+++ b/osaf/tools/safimm/immcfg/imm_cfg.c
@@ -81,8 +81,8 @@ typedef enum {
 // Interface functions which implement -f and -L options (imm_import.cc)
 int importImmXML(char* xmlfileC, char* adminOwnerName, int verbose, int 
ccb_safe,
SaImmHandleT *immHandle, SaImmAdminOwnerHandleT *ownerHandle,
-   SaImmCcbHandleT *ccbHandle, int mode, const char *xsdPath);
-int validateImmXML(const char *xmlfile, int verbose, int mode);
+   SaImmCcbHandleT *ccbHandle, int mode, const char *xsdPath, int 
strictParse);
+int validateImmXML(const char *xmlfile, int verbose, int mode, int 
strictParse);
 static int imm_operation(int argc, char *argv[]);
 
 char *(*readln)(const char *);
@@ -1100,6 +1100,7 @@ static int imm_operation(int argc, char 
{ccb-apply, no_argument, NULL, 0},
{ccb-abort, no_argument, NULL, 0},
{xsd, required_argument, NULL, 'X'},
+   {strict, no_argument, NULL, 0},
{0, 0, 0, 0}
};
SaAisErrorT error;
@@ -1123,6 +1124,7 @@ static int imm_operation(int argc, char 
attr_notify_t attrNotify = NOTIFY_UNDEFINED;
 
char *xsdPath = NULL;
+   int strictParse = 0;
 
while (1) {
int option_index = 0;
@@ -1182,6 +1184,8 @@ static int imm_operation(int argc, char 
exit(EXIT_FAILURE);
}
op = verify_setoption(op, CCB_ABORT);
+   } else if (strcmp(strict, 
long_options[option_index].name) == 0) {
+   strictParse = 1;
}
break;
case 'a':
@@ -1273,7 +1277,7 @@ static int imm_operation(int argc, char 
 
if (op == VALIDATE_IMMFILE) {
VERBOSE_INFO(validateImmXML(xmlFilename=%s, verbose=%d)\n, 
xmlFilename, verbose);
-   rc = validateImmXML(xmlFilename, verbose, transaction_mode);
+   rc = validateImmXML(xmlFilename, verbose, transaction_mode, 
strictParse);
 
if(rc == 0)
printf(Validation is successful\n);
@@ -1289,7 +1293,8 @@ static int imm_operation(int argc, char 
if (op == LOAD_IMMFILE) {
VERBOSE_INFO(importImmXML(xmlFilename=%s, verbose=%d)\n, 
xmlFilename, verbose);
rc = importImmXML(xmlFilename, adminOwnerName, verbose, 
ccb_safe,
-   immHandle, ownerHandle, ccbHandle, 
transaction_mode, xsdPath);
+   immHandle, ownerHandle, ccbHandle, 
transaction_mode,
+   xsdPath, strictParse);
if(transaction_mode) {
if(rc) {
fprintf(stderr, CCB is aborted\n);
diff --git a/osaf/tools/safimm/immcfg/imm_import.cc 
b/osaf/tools/safimm/immcfg/imm_import.cc
--- a/osaf/tools/safimm/immcfg/imm_import.cc
+++ b/osaf/tools/safimm/immcfg/imm_import.cc
@@ -64,8 +64,8 @@ extern C
 {
int importImmXML(char* xmlfileC, char* adminOwnerName, int verbose, int 
ccb_safe,
SaImmHandleT *immHandle, SaImmAdminOwnerHandleT 
*ownerHandle,
-   SaImmCcbHandleT *ccbHandle, int mode, const char 
*xsdPath);
-   int validateImmXML(const char *xmlfile, int verbose, int mode);
+   SaImmCcbHandleT *ccbHandle, int mode, const char 
*xsdPath, int strictParse);
+   int validateImmXML(const char *xmlfile, int verbose, int mode, int 
strictParse);
 }
 
 extern ImmutilErrorFnT immutilError;
@@ -146,6 +146,7 @@ typedef struct ParserStateStruct {
bool validation;
xmlParserCtxtPtr ctxt;
int parsingStatus;  /* 0 = ok */
+   bool strictParse;
 } ParserState;
 
 bool isXsdLoaded = false;
@@ -168,7 +169,8 @@ static void getDNForClass(ParserState*,
  SaImmAttrValuesT_2*);
 static int charsToValueHelper(SaImmAttrValueT*,
   SaImmValueTypeT,
-  const char*);
+  const char*,
+  bool strictParse);
 static SaImmValueTypeT charsToTypeHelper(const xmlChar* str, size_t len);
 static 

Re: [devel] [PATCH 0 of 1] Review Request for IMMTOOLS: revert old way of parsing default values and add a flag for more strict parsing values in immcfg [#861]

2014-04-25 Thread Zoran Milinkovic
Thanks for the comment.
I'll add it to the help before I push the code.

Thanks,
Zoran

-Original Message-
From: Reddy Neelakanta Reddy Peddavandla [mailto:reddy.neelaka...@oracle.com] 
Sent: den 24 april 2014 16:07
To: Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0 of 1] Review Request for IMMTOOLS: revert old way of 
parsing default values and add a flag for more strict parsing values in immcfg 
[#861]


Hi zoran,

Reviewed and tested the patch with minor comment.
Ack.

--strict must be mentioned in the help of immcfg.

/Neel.


- Original Message -
From: zoran.milinko...@ericsson.com
To: reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Sent: Tuesday, April 22, 2014 8:28:08 PM GMT +05:30 Chennai, Kolkata, Mumbai, 
New Delhi
Subject: [PATCH 0 of 1] Review Request for IMMTOOLS: revert old way of parsing 
default values and add a flag for more strict parsing values in immcfg [#861]

Summary: IMMTOOLS: revert old way of parsing default values and add a flag for 
more strict parsing values in immcfg [#861] Review request for Trac Ticket(s): 
861 Peer Reviewer(s): Neelakanta Pull request to: Zoran Affected branch(es): 
opensaf-4.4.x, default(4.5) Development branch: opensaf-4.4.x


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset c59d3d9d25a39fd3325a3f455ac10c551f4b93ad
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 22 Apr 2014 16:52:30 +0200

IMMTOOLS: revert old way of parsing default values and add a flag for 
more
strict parsing values in immcfg [#861]

For backwards compatibility, it's needed to revert the code for old way 
of
parsing default values. Flag --strict is added for a more strict parsing
values, which fail immcfg if an attribute value does not match the 
attribute
data type.


Complete diffstat:
--
 osaf/tools/safimm/immcfg/imm_cfg.c |  13 +
 osaf/tools/safimm/immcfg/imm_import.cc |  34 ++
 2 files changed, 31 insertions(+), 16 deletions(-)


Testing Commands:
-
immcfg --strict -L imm.xml
immcfg -L imm.xml
immcfg --strict -f imm.xml
immcfg -f imm.xml


Testing, Expected Results:
--
Create an XML file with a class that has an attribute of integer type, and 
string default value.
immcfg with new flag --strict should fail for both -f and -L.
If --strict flag is missing, immcfg with -f and -L should succeed to load 
and verify XML file.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have

Re: [devel] [PATCH 0 of 1] Review Request for Imm:Make immcfg aware of safImmService admin owner for opensafImm=opensafImm, safApp=safImmService [#840]

2014-04-25 Thread Zoran Milinkovic
Hi Neelakanta,

I have few comments to the patch:
1. Why did you disable enabling and disabling notifications in explicit commit 
mode ?
2. strcpy() in line 788 is not safe. adminOwnerName may have less allocated 
bytes than safImmService. For example: if an application change immcfg name 
into one byte name like i. In this case allocated memory for adminOwnerName 
is less than safImmService.
You should either check the size of adminOwnerName and resize it if 
it's needed or simply use OPENSAF_IMM_SERVICE_NAME directly in 
immutil_saImmOmAdminOwnerInitialize() without coping safImmService into 
adminOwnerName.
3. Enabling and disabling notifications is not a transactional operation, so 
class_change function may initialize its own OM handle and admin owner handle. 
There is no need for using the same OM handle (which is used for CCBs) for 
enabling/disabling notifications. In this case, you don't need to change other 
functions.

NACK from me for now.

Best 

-Original Message-
From: reddy.neelaka...@oracle.com [mailto:reddy.neelaka...@oracle.com] 
Sent: den 18 april 2014 15:25
To: Anders Björnerstedt
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 0 of 1] Review Request for Imm:Make immcfg aware of 
safImmService admin owner for opensafImm=opensafImm, safApp=safImmService [#840]

Summary:IMM :Make immcfg aware of safImmService admin owner for 
opensafImm=opensafImm,safApp=safImmService [#840] Review request for Trac 
Ticket(s): 840 Peer Reviewer(s): AndersBj, Zoran Affected branch(es): 4.4.x, 
default Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 38bdc703daf9ecd702ed9e12cb5740a52b0bc5c4
Author: Neelakanta Reddyreddy.neelaka...@oracle.com
Date:   Fri, 18 Apr 2014 18:48:42 +0530

Imm:Make immcfg aware of safImmService admin owner for
opensafImm=opensafImm,safApp=safImmService [#840] enable or disable
notififications using immcfg does not work on a system running 2PBE. In 
the
2PBE the IMM internal object opensafImm=opensafImm,safApp=safImmService 
has
admin owner safImmService. To modify the IMM object the adminoner has 
to be
set to safImmService.


Testing Commands:
-
All the immcfg commands must work for 2PBE,1PBE, OPBE

Testing, Expected Results:
--
with this patch while testing in explicit commit mode (transaction mode) enable 
or disable notififications is not supported. 
And all other immcfg commands must work.

Conditions of Submission:
-
Ack from AndersBj and zoran


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this 

Re: [devel] [PATCH 1 of 1] Imm:Make immcfg aware of safImmService admin owner for opensafImm=opensafImm, safApp=safImmService [#840]

2014-05-02 Thread Zoran Milinkovic
Hi Neelakanta,

I have 2 comments on next block:
867 if(!isSchemaChangeEnabled  ownerHandle1) {
868 error = immutil_saImmOmAdminOwnerFinalize(ownerHandle1);
869 if (SA_AIS_OK != error) {
870 fprintf(stderr, error - 
saImmOmAdminOwnerFinalize FAILED: %s\n, saf_error(error));
871 exit(EXIT_FAILURE);
872 }
873 }

1. It should be moved under done: label, so that ownerHandle1 is released if 
an error occurs in the code above the block.
2. In line 871, exit(EXIT_FAILURE); should be replaced with rc = 
EXIT_FAILURE;

Reviewed and tested.
Ack from me when two commented issues are fixed.
No need for sending a new code for the review.

Best regards,
Zoran

-Original Message-
From: reddy.neelaka...@oracle.com [mailto:reddy.neelaka...@oracle.com] 
Sent: den 1 maj 2014 11:32
To: Anders Björnerstedt; Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] Imm:Make immcfg aware of safImmService admin owner for 
opensafImm=opensafImm, safApp=safImmService [#840]

 osaf/tools/safimm/immcfg/imm_cfg.c |  44 +++--
 1 files changed, 32 insertions(+), 12 deletions(-)


Enable or Disable notififications using immcfg does not work on a system 
running 2PBE.
In the 2PBE the IMM internal object opensafImm=opensafImm,safApp=safImmService 
has
admin owner safImmService. To modify the IMM object the adminoner has to be
set to safImmService.

diff --git a/osaf/tools/safimm/immcfg/imm_cfg.c 
b/osaf/tools/safimm/immcfg/imm_cfg.c
--- a/osaf/tools/safimm/immcfg/imm_cfg.c
+++ b/osaf/tools/safimm/immcfg/imm_cfg.c
@@ -42,6 +42,7 @@
 #include saImmOm.h
 #include immutil.h
 #include saf_error.h
+#include immsv_api.h
 
 
 static SaVersionT immVersion = { 'A', 2, 13 };
@@ -385,7 +386,7 @@ static SaImmAttrValuesT_2 *new_attr_valu
  * @return int
  */
 int object_create(const SaNameT **objectNames, const SaImmClassNameT className,
-   SaImmAdminOwnerHandleT ownerHandle, char **optargs, int optargs_len)
+char **optargs, int optargs_len)
 {
SaAisErrorT error;
int i;
@@ -540,7 +541,7 @@ done:
  *
  * @return int
  */
-int object_modify(const SaNameT **objectNames, SaImmAdminOwnerHandleT 
ownerHandle, char **optargs, int optargs_len)
+int object_modify(const SaNameT **objectNames, char **optargs, int optargs_len)
 {
SaAisErrorT error;
int i;
@@ -626,7 +627,7 @@ int object_modify(const SaNameT **object
  *
  * @return int
  */
-int object_delete(const SaNameT **objectNames, SaImmAdminOwnerHandleT 
ownerHandle)
+int object_delete(const SaNameT **objectNames)
 {
SaAisErrorT error;
int rc = EXIT_FAILURE;
@@ -740,8 +741,8 @@ static int admin_owner_clear(const SaNam
return 0;
 }
 
-static int class_change(SaImmHandleT immHandle, const SaImmAdminOwnerNameT 
adminOwnerName,
-   const SaImmClassNameT className, const char **attributeNames, 
attr_notify_t attrNotify)
+static int class_change(SaImmHandleT immHandle, const SaImmClassNameT 
className, 
+   const char **attributeNames, attr_notify_t attrNotify)
 {
SaAisErrorT error;
SaImmAccessorHandleT accessorHandle;
@@ -755,6 +756,7 @@ static int class_change(SaImmHandleT imm

2 - PBE disabled*/
SaImmClassCategoryT classCategory;
SaImmAttrDefinitionT_2 **attrDefinitions = NULL;
+   SaImmAdminOwnerHandleT ownerHandle1 = 0;
int rc = 0;
 
int attrNum = 0;
@@ -809,6 +811,14 @@ static int class_change(SaImmHandleT imm
 
attrNum++;
}
+   if(!isSchemaChangeEnabled) {
+   error = immutil_saImmOmAdminOwnerInitialize(immHandle, 
OPENSAF_IMM_SERVICE_NAME, SA_TRUE, ownerHandle1);
+   if (error != SA_AIS_OK) {
+   fprintf(stderr, error - saImmOmAdminOwnerInitialize 
FAILED: %s\n, saf_error(error));
+   rc = EXIT_FAILURE;
+   goto done;
+   }
+   }
 
/* if schema change is disable, then turn it on until the class change 
is done */
if(!isSchemaChangeEnabled) {
@@ -817,13 +827,13 @@ static int class_change(SaImmHandleT imm
SaImmAdminOperationParamsT_2 param = { opensafImmNostdFlags, 
SA_IMM_ATTR_SAUINT32T, (SaImmAttrValueT)nostdFlag };
const SaImmAdminOperationParamsT_2 *params[2] = { param, NULL 
};
 
-   if((error = immutil_saImmOmAdminOwnerSet(ownerHandle, 
objectNameList, SA_IMM_ONE)) != SA_AIS_OK) {
+   if((error = immutil_saImmOmAdminOwnerSet(ownerHandle1, 
objectNameList, SA_IMM_ONE)) != SA_AIS_OK) {
fprintf(stderr, Cannot set admin owner on 
'opensafImm=opensafImm,safApp=safImmService'\n);
rc = EXIT_FAILURE;
goto

Re: [devel] [PATCH 0 of 1] Review Request for imm: Allow admin-operations directly targeting an implementer/applier [#799]

2014-05-06 Thread Zoran Milinkovic
Ack from me.
Reviewed the code, but didn't test.

Best regards,
Zoran

-Original Message-
From: Anders Björnerstedt 
Sent: den 29 april 2014 16:37
To: reddy.neelaka...@oracle.com; Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 0 of 1] Review Request for imm: Allow admin-operations directly 
targeting an implementer/applier [#799]

Summary: imm: Allow admin-operations directly targeting an implementer/applier 
[#799]
Review request for Trac Ticket(s): 799
Peer Reviewer(s): Neel; Zoran
Pull request to: 
Affected branch(es): default(4.5)
Development branch: 


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-
 EXPLAIN/COMMENT THE PATCH SERIES HERE

changeset f3bd590108f2bdb2bada136baf9b31bc8d963460
Author: Anders Bjornerstedt anders.bjornerst...@ericsson.com
Date:   Tue, 29 Apr 2014 16:17:10 +0200

imm: Allow admin-operations directly targeting an implementer/applier 
[#799]

This enhancement (#799) extends the scope of the existing OpenSAF API 
for
administrative-operations such that it supports the direct invocation of
admin-operations on an implementer or applier. See the included patch 
of:
osaf/services/saf/immsv/README for details.


Complete diffstat:
--
 osaf/libs/agents/saf/imma/imma_oi_api.c  |   6 
 osaf/services/saf/immsv/README   |  84 
+++-
 osaf/services/saf/immsv/immnd/ImmModel.cc|  14 +++
 osaf/tools/safimm/immadm/imm_admin.c |   7 -
 tests/immsv/implementer/test_SaImmOiAdminOperation.c |  34 
+++
 5 files changed, 131 insertions(+), 14 deletions(-)


Testing Commands:
-
A new test case is included as 'immoitest 5 13'.

Manual testing is also possible using the tool 'immapplier' to set up
an OI or an applier; and the 'immadm' tool to invoke an admin operation.

Set up an OI for example on SC1:

immapplier -a MyOI OpensafImmTest

The class name is only needed here tpo satisfy the immapplier tool.
You could uswe any class that does not have an existing OI, or use *any*
class and set up as an @pplier.

Invoke an admin-op towards the OI.
Use the OI-name (or applier name) plus explicitly set admin-owner also
to be the same OI-name (or applier name):

immadm -a MyOI -o 1 MyOI

You can also try invoking bogus admin-operations directly on say the 
saAmfService:

immadm -a safAmfService -o 4711 safAmfService
AdminOwnerName == ImplementerName (safAmfService) - Could be direct 
admin-op on OI
error - saImmOmAdminOperationInvoke_2 admin-op RETURNED: 
SA_AIS_ERR_INVALID_PARAM (7)
error-string: Admin operation not supported for safAmfService (0)

This is a good test of the robustness of the OIs.
Some OIs are not so robust and crash only because they receive an unexpected 
admin-operation.


Testing, Expected Results:
--
Invoking an admin-opertion directly on OI or applier should result in the 
admin-op
reaching that OI or applier.


Conditions of Submission:
-
Ack from Neel
(Ack from Zoran not mandatory)


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed

[devel] [PATCH 1 of 3] imm: add support for configurable OI callback timeout [#16]

2014-05-08 Thread Zoran Milinkovic
 osaf/libs/common/immsv/immsv_evt.c   |  56 ++-
 osaf/libs/common/immsv/include/immsv_evt.h   |   4 +
 osaf/libs/common/immsv/include/immsv_evt_model.h |   1 +
 osaf/services/saf/immsv/immd/immd_evt.c  |   9 ++-
 osaf/services/saf/immsv/immnd/ImmModel.cc|  89 ++-
 osaf/services/saf/immsv/immnd/ImmModel.hh|   6 +-
 osaf/services/saf/immsv/immnd/immnd_evt.c|  38 -
 osaf/services/saf/immsv/immnd/immnd_init.h   |   8 +-
 8 files changed, 175 insertions(+), 36 deletions(-)


When an implementer is set, the configurable timeout is sent to IMM service. 
The configurable timeout is used for calculating timeouts for OI callbacks and 
waiting on search replies from RTA update callback.

diff --git a/osaf/libs/common/immsv/immsv_evt.c 
b/osaf/libs/common/immsv/immsv_evt.c
--- a/osaf/libs/common/immsv/immsv_evt.c
+++ b/osaf/libs/common/immsv/immsv_evt.c
@@ -64,6 +64,7 @@ static const char *immd_evt_names[] = {
IMMD_EVT_ND2D_FEVS_REQ_2,
IMMD_EVT_ND2D_LOADING_COMPLETED,
IMMD_EVT_ND2D_2PBE_PRELOAD,
+   IMMD_EVT_ND2D_IMPLSET_REQ_2,
undefined (high)
 };
 
@@ -173,6 +174,8 @@ static const char *immnd_evt_names[] = {
IMMND_EVT_A2ND_CL_TIMEOUT,
IMMND_EVT_A2ND_ACCESSOR_GET,
IMMND_EVT_A2ND_CCB_VALIDATE,  /* saImmOmCcbValidate */
+   IMMND_EVT_A2ND_OI_IMPL_SET_2, /* saImmOiImplementerSet */
+   IMMND_EVT_D2ND_IMPLSET_RSP_2, /* Implementer set reply from D with 
impl id */
undefined (high)
 };
 
@@ -1511,7 +1514,8 @@ static uint32_t immsv_evt_enc_sublevels(
(i_evt-info.immd.type == IMMD_EVT_ND2D_FEVS_REQ_2)) {
IMMSV_OCTET_STRING *os = 
(i_evt-info.immd.info.fevsReq.msg);
immsv_evt_enc_inline_string(o_ub, os);
-   } else if (i_evt-info.immd.type == IMMD_EVT_ND2D_IMPLSET_REQ) {
+   } else if ((i_evt-info.immd.type == IMMD_EVT_ND2D_IMPLSET_REQ) 
||
+   (i_evt-info.immd.type == 
IMMD_EVT_ND2D_IMPLSET_REQ_2)) {
IMMSV_OCTET_STRING *os = 
(i_evt-info.immd.info.impl_set.r.impl_name);
if(!immsv_evt_enc_inline_text(__LINE__, o_ub, os)) {
return NCSCC_RC_OUT_OF_MEM;
@@ -1564,7 +1568,9 @@ static uint32_t immsv_evt_enc_sublevels(
IMMSV_OCTET_STRING *os = 
(i_evt-info.immnd.info.fevsReq.msg);
immsv_evt_enc_inline_string(o_ub, os);
} else if ((i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_IMPL_SET) ||
+  (i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_IMPL_SET_2) ||
   (i_evt-info.immnd.type == 
IMMND_EVT_D2ND_IMPLSET_RSP) ||
+  (i_evt-info.immnd.type == 
IMMND_EVT_D2ND_IMPLSET_RSP_2) ||
   (i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_CL_IMPL_SET) ||
   (i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_CL_IMPL_REL) ||
   (i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_OBJ_IMPL_SET) ||
@@ -2141,7 +2147,8 @@ static uint32_t immsv_evt_dec_sublevels(
(o_evt-info.immd.type == IMMD_EVT_ND2D_FEVS_REQ_2)) {
IMMSV_OCTET_STRING *os = 
(o_evt-info.immd.info.fevsReq.msg);
immsv_evt_dec_inline_string(i_ub, os);
-   } else if (o_evt-info.immd.type == IMMD_EVT_ND2D_IMPLSET_REQ) {
+   } else if ((o_evt-info.immd.type == IMMD_EVT_ND2D_IMPLSET_REQ) 
||
+   (o_evt-info.immd.type == 
IMMD_EVT_ND2D_IMPLSET_REQ_2)) {
IMMSV_OCTET_STRING *os = 
(o_evt-info.immd.info.impl_set.r.impl_name);
immsv_evt_dec_inline_string(i_ub, os);
} else if (o_evt-info.immd.type == 
IMMD_EVT_ND2D_OI_OBJ_MODIFY) {
@@ -2177,7 +2184,9 @@ static uint32_t immsv_evt_dec_sublevels(
immsv_evt_dec_inline_string(i_ub, os);
} else
if ((o_evt-info.immnd.type == IMMND_EVT_A2ND_OI_IMPL_SET) 
||
+   (o_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_IMPL_SET_2) ||
(o_evt-info.immnd.type == IMMND_EVT_D2ND_IMPLSET_RSP) 
||
+   (o_evt-info.immnd.type == 
IMMND_EVT_D2ND_IMPLSET_RSP_2) ||
(o_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_CL_IMPL_SET) ||
(o_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_CL_IMPL_REL) ||
(o_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_OBJ_IMPL_SET) ||
@@ -2949,6 +2958,7 @@ static uint32_t immsv_evt_enc_toplevel(I
break;
 
case IMMD_EVT_ND2D_IMPLSET_REQ: /*OiImplementerSet */
+   case IMMD_EVT_ND2D_IMPLSET_REQ_2:   /*OiImplementerSet */
IMMSV_RSRV_SPACE_ASSERT(p8, o_ub, 8);

[devel] [PATCH 3 of 3] immtests: add test cases for OI callback timeout [#16]

2014-05-08 Thread Zoran Milinkovic
 tests/immsv/implementer/test_cleanup.c   |1 +
 tests/immsv/implementer/test_saImmOiImplementerSet.c |  287 +++
 2 files changed, 288 insertions(+), 0 deletions(-)


Test cases cover OI callback timeout and timeout on searching for an object 
with RTA

diff --git a/tests/immsv/implementer/test_cleanup.c 
b/tests/immsv/implementer/test_cleanup.c
--- a/tests/immsv/implementer/test_cleanup.c
+++ b/tests/immsv/implementer/test_cleanup.c
@@ -31,6 +31,7 @@ static char *objects[] = {

123456789012345678901234567890123456789012345678901234567890123,123456789012345678901234567890123456789012345678901234567890123,123456789012345678901234567890123456789012345678901234567890123,rdn=root,
Test,rdn=root,
rdn=root,
+   obj=1,
NULL
 };
 
diff --git a/tests/immsv/implementer/test_saImmOiImplementerSet.c 
b/tests/immsv/implementer/test_saImmOiImplementerSet.c
--- a/tests/immsv/implementer/test_saImmOiImplementerSet.c
+++ b/tests/immsv/implementer/test_saImmOiImplementerSet.c
@@ -16,6 +16,10 @@
  */
 
 #include immtest.h
+#include unistd.h
+#include pthread.h
+#include poll.h
+#include stdlib.h
 
 void saImmOiImplementerSet_01(void)
 {
@@ -70,6 +74,284 @@ void saImmOiImplementerSet_05(void)
 safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
 }
 
+int saImmOiImplementerSet_callback_wait = 15;
+SaImmClassNameT saImmOiImplementerSet_className = NULL;
+
+static SaAisErrorT saImmOiImplementerSet_ModifyCallback(SaImmOiHandleT 
immOiHandle, SaImmOiCcbIdT ccbId,
+   const SaNameT *objectName, const SaImmAttrModificationT_2 
**attrMods) {
+
+   sleep(saImmOiImplementerSet_callback_wait);
+   return SA_AIS_OK;
+}
+
+static SaAisErrorT saImmOiImplementerSet_RtAttrUpdateCallbackT(SaImmOiHandleT 
immOiHandle, const SaNameT *objectName, const SaImmAttrNameT *attributeNames) {
+   SaUint32T attrVal = (SaUint32T)random();
+   SaImmAttrValueT attrValues[1] = { attrVal };
+   SaImmAttrModificationT_2 attrMod = { SA_IMM_ATTR_VALUES_REPLACE, { 
attr1, SA_IMM_ATTR_SAUINT32T, 1, attrValues } };
+   const SaImmAttrModificationT_2 *attrMods[2] = { attrMod, NULL };
+
+   sleep(saImmOiImplementerSet_callback_wait);
+
+   saImmOiRtObjectUpdate_2(immOiHandle, objectName, attrMods);
+
+   return SA_AIS_OK;
+}
+
+void *saImmOiImplementerSet_modify_thread(void *arg) {
+   int *ready = (int *)arg;
+   SaImmOiHandleT immOiHandle;
+   SaSelectionObjectT selObj;
+   SaImmOiCallbacksT_2 configImmOiCallbacks = { NULL , NULL , NULL , NULL 
, NULL , NULL , saImmOiImplementerSet_ModifyCallback , NULL };
+   SaImmOiCallbacksT_2 rtImmOiCallbacks = { NULL , NULL , NULL , NULL , 
NULL , NULL , NULL , saImmOiImplementerSet_RtAttrUpdateCallbackT };
+   SaNameT rdn = { 5, obj=1 };
+   struct pollfd pfd;
+   int rc = 1;
+   int config = 1;
+
+   assert(saImmOiImplementerSet_className != NULL);
+
+   if(!strcmp(saImmOiImplementerSet_className, runtimeClassName)) {
+   SaImmAttrValueT attrVal[1] = { rdn };
+   SaImmAttrValuesT_2 rdnVal = { rdn, SA_IMM_ATTR_SANAMET, 1, 
attrVal };
+   const SaImmAttrValuesT_2 *attrValues[2] = { rdnVal, NULL };
+
+   safassert(saImmOiInitialize_2(immOiHandle, rtImmOiCallbacks, 
immVersion), SA_AIS_OK);
+   safassert(saImmOiSelectionObjectGet(immOiHandle, selObj), 
SA_AIS_OK);
+   safassert(saImmOiImplementerSet(immOiHandle, 
(SaImmOiImplementerNameT)__FUNCTION__), SA_AIS_OK);
+   safassert(saImmOiRtObjectCreate_2(immOiHandle, 
runtimeClassName, NULL, attrValues), SA_AIS_OK);
+   config = 0;
+   } else {
+   safassert(saImmOiInitialize_2(immOiHandle, 
configImmOiCallbacks, immVersion), SA_AIS_OK);
+   safassert(saImmOiSelectionObjectGet(immOiHandle, selObj), 
SA_AIS_OK);
+   safassert(saImmOiImplementerSet(immOiHandle, 
(SaImmOiImplementerNameT)__FUNCTION__), SA_AIS_OK);
+   safassert(saImmOiClassImplementerSet(immOiHandle, 
saImmOiImplementerSet_className), SA_AIS_OK);
+   }
+
+   *ready = 1;
+
+   while((!rc || rc == 1)  *ready) {
+   pfd.fd = selObj;
+   pfd.events = POLLIN;
+   rc = poll(pfd, 1, 100);
+
+   safassert(saImmOiDispatch(immOiHandle, SA_DISPATCH_ONE), 
SA_AIS_OK);
+   }
+
+   if(!config) {
+   safassert(saImmOiRtObjectDelete(immOiHandle, rdn), SA_AIS_OK);
+   } else {
+   safassert(saImmOiClassImplementerRelease(immOiHandle, 
saImmOiImplementerSet_className), SA_AIS_OK);
+   }
+
+   safassert(saImmOiImplementerClear(immOiHandle), SA_AIS_OK);
+   safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
+
+   *ready = 1;
+
+   return NULL;
+}
+
+void saImmOiImplementerSet_06(void)
+{
+   SaImmHandleT immHandle;
+   SaImmAdminOwnerHandleT ownerHandle;
+   

[devel] [PATCH 2 of 3] imm: use IMMA_OI_CALLBACK_TIMEOUT for setting OI callback timeout [#16]

2014-05-08 Thread Zoran Milinkovic
 osaf/libs/agents/saf/imma/imma_cb.h |   1 +
 osaf/libs/agents/saf/imma/imma_def.h|   1 +
 osaf/libs/agents/saf/imma/imma_oi_api.c |  23 ++-
 3 files changed, 24 insertions(+), 1 deletions(-)


IMMA uses IMMA_OI_CALLBACK_TIMEOUT for sending OI timeout to IMM service using 
implementer set operations.

diff --git a/osaf/libs/agents/saf/imma/imma_cb.h 
b/osaf/libs/agents/saf/imma/imma_cb.h
--- a/osaf/libs/agents/saf/imma/imma_cb.h
+++ b/osaf/libs/agents/saf/imma/imma_cb.h
@@ -71,6 +71,7 @@ typedef struct imma_client_node {
  * enviroment variable IMMA_MAX_OPEN_SEARCHES_PER_HANDLE */
 uint32_t maxSearchHandles;
uint32_t searchHandleSize;  /* Number of open search handles */
+   uint32_t oiTimeout; /* Timeout for OI callback. If the value is 0, 
the default timeout (6s) will be used */
 } IMMA_CLIENT_NODE;
 
 /* Node to store adminOwner info */
diff --git a/osaf/libs/agents/saf/imma/imma_def.h 
b/osaf/libs/agents/saf/imma/imma_def.h
--- a/osaf/libs/agents/saf/imma/imma_def.h
+++ b/osaf/libs/agents/saf/imma/imma_def.h
@@ -25,6 +25,7 @@
 #define IMMA_MINOR_VERSION 0x0e
 
 #define IMMSV_WAIT_TIME  1000 /* Default MDS wait time in 10ms units =10 sec*/
+#define IMMSV_OI_CALLBACK_WAIT_TIME  6 /* Default wait time for OI callback to 
reply in seconds = 6 sec*/
 
 
 
diff --git a/osaf/libs/agents/saf/imma/imma_oi_api.c 
b/osaf/libs/agents/saf/imma/imma_oi_api.c
--- a/osaf/libs/agents/saf/imma/imma_oi_api.c
+++ b/osaf/libs/agents/saf/imma/imma_oi_api.c
@@ -139,6 +139,21 @@ SaAisErrorT saImmOiInitialize_2(SaImmOiH
cl_node-syncr_timeout = IMMSV_WAIT_TIME; /* Default */
}
 
+   if((timeout_env_value = getenv(IMMA_OI_CALLBACK_TIMEOUT))!=NULL) {
+   char *endp = NULL;
+   cl_node-oiTimeout = strtol(timeout_env_value, endp, 10);
+   if(!endp || *endp) {
+   TRACE_2(Failed to parse IMMA_OI_CALLBACK_TIMEOUT. 
+   OI timeout will be set to the default 
value: %u,
+   IMMSV_OI_CALLBACK_WAIT_TIME);
+   cl_node-oiTimeout = IMMSV_OI_CALLBACK_WAIT_TIME;
+   } else {
+   TRACE_2(IMMA library OI timeout set to:%u, 
cl_node-oiTimeout);
+   }
+   } else {
+   cl_node-oiTimeout = IMMSV_OI_CALLBACK_WAIT_TIME;
+   }
+
/* Take the CB Lock */
if (m_NCS_LOCK(cb-cb_lock, NCS_LOCK_WRITE) != NCSCC_RC_SUCCESS) {
TRACE_4(ERR_LIBRARY: LOCK failed);
@@ -1276,11 +1291,17 @@ SaAisErrorT saImmOiImplementerSet(SaImmO
/* Populate  Send the Open Event to IMMND */
memset(evt, 0, sizeof(IMMSV_EVT));
evt.type = IMMSV_EVT_TYPE_IMMND;
-   evt.info.immnd.type = IMMND_EVT_A2ND_OI_IMPL_SET;
evt.info.immnd.info.implSet.client_hdl = immOiHandle;
evt.info.immnd.info.implSet.impl_name.size = nameLen;
evt.info.immnd.info.implSet.impl_name.buf = implementerName;
 
+   if(cl_node-isImmA2d  cl_node-oiTimeout != 
IMMSV_OI_CALLBACK_WAIT_TIME) {
+   evt.info.immnd.info.implSet.oi_timeout = cl_node-oiTimeout;
+   evt.info.immnd.type = IMMND_EVT_A2ND_OI_IMPL_SET_2;
+   } else {
+   evt.info.immnd.type = IMMND_EVT_A2ND_OI_IMPL_SET;
+   }
+
/* Unlock before MDS Send */
m_NCS_UNLOCK(cb-cb_lock, NCS_LOCK_WRITE);
locked = false;

--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for imm: fix memory leak in IMM library when search handle is closed [#907]

2014-05-13 Thread Zoran Milinkovic
Summary: imm: fix memory leak in IMM library when search handle is closed [#907]
Review request for Trac Ticket(s): 907
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): opensaf-4.4.x, default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 174e38438e18982b0433476fdac513a83fa5a8d0
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 13 May 2014 10:20:48 +0200

imm: fix memory leak in IMM library when search handle is closed [#907]

The patch provides the fix for fixing memory leak when search handles 
are
closed before saImmOmSearchNext function reach the last object in the 
search
result.


Complete diffstat:
--
 osaf/libs/agents/saf/imma/imma_db.c |  5 -
 osaf/libs/agents/saf/imma/imma_om_api.c |  3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
Initialize a search with more objects in the result. Call saImmOmSearchNext 
function once or more times, and saImmOmSearchNext should not reach the end of 
the search result. Then close the search handle either by saImmOmSearchFinalize 
or by saImmOmfinalize. Check that there is no more a memory leak in the library.
The check can be done by valgrind.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https

Re: [devel] [PATCH 0 of 3] Review Request for imm: add support for configurable OI callback timeout [#16]

2014-05-15 Thread Zoran Milinkovic
Hi Neelakanta,

Find my answers inline.

Best regards,
Zoran

-Original Message-
From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com] 
Sent: den 15 maj 2014 11:49
To: Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0 of 3] Review Request for imm: add support for 
configurable OI callback timeout [#16]

Hi zoran,

Following are the comments:

1. The patch is not compatible at upgrade.
Eg: If one node having new release and other node having older release, then 
following is the errors:
osafimmnd[15258]: ER Illegal IMMND message type:97
osafimmnd[15258]: ER Edu decode Failed
osafimmnd[15258]: ER PROBLEM 2 WITH msg no:1810
osafimmnd[15258]: NO Ccb 2 ABORTED (immcfg_Slot-3_377)
osafimmnd[15258]: WA ccb id 2 missing or terminated
osafimmnd[15258]: WA discardImplementer: Implementer 16 is missing - ignoring

[Zoran] This is expected behavior. You are testing an application that uses IMM 
A.2.14, and new features will not work in earlier IMM versions. If you set IMM 
version to a version as the lowest IMM version is in the cluster, I'm sure that 
your application will work.

And here Ccb2 is applyed in other node with this patch.
[Zoran] This is something I need to talk to Anders when he comes back from 
vacation.
I see similar behavior only if I test a cluster with different OpenSAF versions.

2.  The PBE timeout should not be the implementer timeout.
There should be separate variable somewhere  either in immnd.conf or in immpbed 
which can be set the PBE OI timer.

[Zoran] This is a good point. PBE should be excluded from #16, and should work 
as it works today. When I push the code, I'll change a line in 
saImmOiImplementerSet (imm_oi_api.c):
if(cl_node-isImmA2e  cl_node-oiTimeout) {
... to...
if(cl_node-isImmA2e  !cl_node-isPbe  cl_node-oiTimeout) {

3. If the Implementerset has set timeout to 8. For the second run the 
application decides to change it to 10.
The second run timeout is not reflected because, class already has class 
implementer.

[Zoran] This works for me.
Can you provide more details how you tested this case ?

NACK, until the comments are fixed.

/Neel.


On Thursday 08 May 2014 05:16 PM, Zoran Milinkovic wrote:
 Summary: imm: add support for configurable OI callback timeout [#16] 
 Review request for Trac Ticket(s): 16 Peer Reviewer(s): Neelakanta, 
 Anders Pull request to: Zoran Affected branch(es): default(4.5) 
 Development branch: default(4.5)

 
 Impacted area   Impact y/n
 
   Docsn
   Build systemn
   RPM/packaging   n
   Configuration files n
   Startup scripts n
   SAF servicesy
   OpenSAF servicesn
   Core libraries  n
   Samples n
   Tests   n
   Other   n


 Comments (indicate scope for each y above):
 -

 changeset da62b083125842a8e6b1437fdc6224b3f1e6720e
 Author:   Zoran Milinkovic zoran.milinko...@ericsson.com
 Date: Thu, 08 May 2014 13:40:11 +0200

   imm: add support for configurable OI callback timeout [#16]

   When an implementer is set, the configurable timeout is sent to IMM 
 service.
   The configurable timeout is used for calculating timeouts for OI 
 callbacks
   and waiting on search replies from RTA update callback.

 changeset bcd50a218ba95178ea86735ff322b722bdf577f7
 Author:   Zoran Milinkovic zoran.milinko...@ericsson.com
 Date: Thu, 08 May 2014 13:27:07 +0200

   imm: use IMMA_OI_CALLBACK_TIMEOUT for setting OI callback timeout 
 [#16]

   IMMA uses IMMA_OI_CALLBACK_TIMEOUT for sending OI timeout to IMM service
   using implementer set operations.

 changeset d11cb26e44f7554d6b22476d874086044d22d624
 Author:   Zoran Milinkovic zoran.milinko...@ericsson.com
 Date: Thu, 08 May 2014 13:41:57 +0200

   immtests: add test cases for OI callback timeout [#16]

   Test cases cover OI callback timeout and timeout on searching for an 
 object
   with RTA


 Complete diffstat:
 --
   osaf/libs/agents/saf/imma/imma_cb.h  |1 +
   osaf/libs/agents/saf/imma/imma_def.h |1 +
   osaf/libs/agents/saf/imma/imma_oi_api.c  |   23 +++-
   osaf/libs/common/immsv/immsv_evt.c   |   56 
 -
   osaf/libs/common/immsv/include/immsv_evt.h   |4 ++
   osaf/libs/common/immsv/include/immsv_evt_model.h |1 +
   osaf/services/saf/immsv/immd/immd_evt.c  |9 -
   osaf/services/saf/immsv/immnd/ImmModel.cc|   89 
 +++--
   osaf/services/saf/immsv/immnd/ImmModel.hh|6 ++-
   osaf/services/saf/immsv/immnd/immnd_evt.c|   38 
 ---
   osaf/services/saf/immsv/immnd/immnd_init.h   |8 ++-
   tests/immsv

[devel] [PATCH 0 of 1] Review Request for imm: fix loading the first value of a double type attribute in immload [#53]

2014-05-20 Thread Zoran Milinkovic
Summary: imm: fix loading the first value of a double type attribute in immload 
[#53]
Review request for Trac Ticket(s): 53
Peer Reviewer(s): Neelakanta
Pull request to: Zoran
Affected branch(es): default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 49409a21fed3a54a1690d59ac9fd7db421ad83b8
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Tue, 20 May 2014 17:33:02 +0200

imm: fix loading the first value of a double type attribute in immload 
[#53]

When immload loads data from PBE, in the first loaded value of a double 
type
attribute, the floating-point precision is not fully supported. The 
patch
provides the fix for correct loading the first value of a double type
attribute.


Complete diffstat:
--
 osaf/services/saf/immsv/immloadd/imm_pbe_load.cc |  80 
+---
 1 files changed, 57 insertions(+), 23 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
Test multivalue and non-mulitvalue double type attributes with enough long 
mantissa before and after cluster reboot.
Double values of attributes after the cluster reboot must be the same as double 
values before the cluster reboot.
PBE must be enabled.


Conditions of Submission:
-
Ack from Neelakanta


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs
___
Opensaf-devel mailing list
Opensaf-devel

[devel] [PATCH 1 of 1] imm: fix loading the first value of a double type attribute in immload [#53]

2014-05-20 Thread Zoran Milinkovic
 osaf/services/saf/immsv/immloadd/imm_pbe_load.cc |  80 +--
 1 files changed, 57 insertions(+), 23 deletions(-)


When immload loads data from PBE, in the first loaded value of a double type 
attribute, the floating-point precision is not fully supported.
The patch provides the fix for correct loading the first value of a double type 
attribute.

diff --git a/osaf/services/saf/immsv/immloadd/imm_pbe_load.cc 
b/osaf/services/saf/immsv/immloadd/imm_pbe_load.cc
--- a/osaf/services/saf/immsv/immloadd/imm_pbe_load.cc
+++ b/osaf/services/saf/immsv/immloadd/imm_pbe_load.cc
@@ -436,9 +436,7 @@ bool loadObjectFromPbe(void* pbeHandle, 
sqlite3* dbHandle = (sqlite3 *) pbeHandle;
sqlite3_stmt *stmt = NULL;
int rc=0;
-   char **resultF=NULL;
char *zErr=NULL;
-   int nrows=0;
int ncols=0;
int c;
std::string sqlF(select \);
@@ -486,33 +484,44 @@ bool loadObjectFromPbe(void* pbeHandle, 
 
TRACE(GENERATED F:%s, sqlF.c_str());
 
-   rc = sqlite3_get_table(dbHandle, sqlF.c_str(), resultF, nrows,
-   ncols, zErr);
-   if(rc) {
+   rc = sqlite3_prepare_v2(dbHandle, sqlF.c_str(), -1, stmt, NULL);
+   if(rc != SQLITE_OK) {
+   LOG_IN(Failed to prepare SQL statement);
+   goto bailout;
+   }
+
+   rc = sqlite3_step(stmt);
+   if(rc != SQLITE_ROW  rc != SQLITE_DONE) {
LOG_IN(Could not access table '%s', error:%s,
class_info-className.c_str(), zErr);
sqlite3_free(zErr);
goto bailout;
}
-   if(nrows != 1) {
-   LOG_ER(Expected 1 row got %u rows, nrows);
+
+   if(rc == SQLITE_DONE) {
+   LOG_ER(Expected 1 row got 0 rows);
goto bailout;
}
+
+   ncols = sqlite3_column_count(stmt);
TRACE_2(Successfully accessed '%s' table. cols:%u,
class_info-className.c_str(), ncols);
 
+   const unsigned char *res;
for(c=0; cncols; ++c) {
-   if(resultF[ncols+c]) {
-   std::listchar* attrValueBuffers;
+   res = sqlite3_column_text(stmt, c);
+   if(res) {
SaImmValueTypeT attrType = (SaImmValueTypeT) 0;
-   size_t len = strlen(resultF[ncols+c]);
-   char * str = (char *) malloc(len+1);
-   strncpy(str, (const char *) resultF[ncols+c], len);
-   str[len] = '\0';
-   attrValueBuffers.push_front(str);
+   const char *colname = sqlite3_column_name(stmt, c);
+   assert(colname != NULL);
+
+   if((strcmp(colname, SaImmAttrImplementerName) == 0) 
+   (class_info-class_category == 
SA_IMM_CLASS_CONFIG))
+   continue;
+
it = class_info-attrInfoVector.begin();
while(it != class_info-attrInfoVector.end()) {
-   if((*it)-attrName == std::string(resultF[c]))
+   if((*it)-attrName == std::string(colname))
{
attrType = (*it)-attrValueType;
break;
@@ -520,17 +529,42 @@ bool loadObjectFromPbe(void* pbeHandle, 
++it;
}
assert(it != class_info-attrInfoVector.end());
-   if((strcmp(resultF[c], SaImmAttrImplementerName) == 
0)  
-   (class_info-class_category == 
SA_IMM_CLASS_CONFIG))
-   continue;
-   
-   addObjectAttributeDefinition((char *) 
-   class_info-className.c_str(), 
-   resultF[c], attrValueBuffers, 
+
+   char *val;
+   if(attrType == SA_IMM_ATTR_SADOUBLET) {
+   double dbl = sqlite3_column_double(stmt, c);
+
+   val = (char *)malloc(30);
+   int size = snprintf(val, 30, %.17g, dbl);
+   size++;
+   if(size  30) {
+   val = (char *)realloc(val, size);
+   snprintf(val, size, %.17g, dbl);
+   }
+   } else {
+   val = strdup((const char *)res);
+   }
+
+   std::listchar* attrValueBuffers;
+   attrValueBuffers.push_front(val);
+
+   addObjectAttributeDefinition((char *)
+   class_info-className.c_str(),
+

Re: [devel] [PATCH 0 of 3] Review Request for imm: add support for configurable OI callback timeout [#16]

2014-05-21 Thread Zoran Milinkovic
Hi Neelakanta,

Find comments inline

-Original Message-
From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com] 
Sent: den 15 maj 2014 17:14
To: Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0 of 3] Review Request for imm: add support for 
configurable OI callback timeout [#16]

Hi zoran,

comments inline.

/Neel.

On Thursday 15 May 2014 08:09 PM, Zoran Milinkovic wrote:
 Hi Neelakanta,

 Find my answers inline.

 Best regards,
 Zoran

 -Original Message-
 From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com]
 Sent: den 15 maj 2014 11:49
 To: Zoran Milinkovic
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: Re: [PATCH 0 of 3] Review Request for imm: add support for 
 configurable OI callback timeout [#16]

 Hi zoran,

 Following are the comments:

 1. The patch is not compatible at upgrade.
 Eg: If one node having new release and other node having older release, then 
 following is the errors:
 osafimmnd[15258]: ER Illegal IMMND message type:97
 osafimmnd[15258]: ER Edu decode Failed
 osafimmnd[15258]: ER PROBLEM 2 WITH msg no:1810
 osafimmnd[15258]: NO Ccb 2 ABORTED (immcfg_Slot-3_377)
 osafimmnd[15258]: WA ccb id 2 missing or terminated
 osafimmnd[15258]: WA discardImplementer: Implementer 16 is missing - 
 ignoring

 [Zoran] This is expected behavior. You are testing an application that uses 
 IMM A.2.14, and new features will not work in earlier IMM versions. If you 
 set IMM version to a version as the lowest IMM version is in the cluster, I'm 
 sure that your application will work.
At upgrade, case there may be application using A.2.14, when all nodes are not 
yet upgraded fully

[Zoran] I will implement support for 4.5, when #842 is pushed. Then I'll send a 
new source code for the review.

 And here Ccb2 is applyed in other node with this patch.
 [Zoran] This is something I need to talk to Anders when he comes back from 
 vacation.
will wait for andersBj comments.
 I see similar behavior only if I test a cluster with different OpenSAF 
 versions.

 2.  The PBE timeout should not be the implementer timeout.
 There should be separate variable somewhere  either in immnd.conf or in 
 immpbed which can be set the PBE OI timer.

 [Zoran] This is a good point. PBE should be excluded from #16, and should 
 work as it works today. When I push the code, I'll change a line in 
 saImmOiImplementerSet (imm_oi_api.c):
 if(cl_node-isImmA2e  cl_node-oiTimeout) { ... to...
 if(cl_node-isImmA2e  !cl_node-isPbe  cl_node-oiTimeout) {
Here i am talking about at IMMND server side, the timeout should be 
DEFAULT_TIMEOUT , until IMMPBE OI explicitly sets the timeout.

if((*i3)-mPbeRestartId) {
  LOG_WA(Ccb: %u in critical state when PBE 
restarted, (*i3)-mId);
  ccbsStuck=1;
-} else if(now - (*i3)-mWaitStartTime = 
(DEFAULT_TIMEOUT_SEC + addSecs)){
+} else if(now - (*i3)-mWaitStartTime =
(max_oi_timeout + addSecs)){

[Zoran] This is a very good catch that I didn't see it in the beginning, and 
it's a bit tricky to find it. I will change this code in the new code review.

 3. If the Implementerset has set timeout to 8. For the second run the 
 application decides to change it to 10.
  The second run timeout is not reflected because, class already has class 
 implementer.

 [Zoran] This works for me.
 Can you provide more details how you tested this case ?
I came across this scenario when the following steps are followed:

a. create config class with rt attribute
b. create the object for the above class.
c. implementer which implements SaImmOiRtAttrUpdateCallbackT
 In the  SaImmOiRtAttrUpdateCallbackT sleep for more than OI 
callback timeout.
d. export IMMA_OI_CALLBACK_TIMEOUT=6. date;immlist object_name;date
  see timeout as 6 seconds for acessorget

e. export IMMA_OI_CALLBACK_TIMEOUT=8.
adjust timeout to OI callback timeout (in this case more than 8 sec)
  date;immlist object_name;date
still, see timeout as 6 seconds for acessorget

[Zoran] This is still an issue for the discussion. It still works for me.
OI callback timeout is linked to OI handle. It's not clear what you meant for 
second run... did you use the same OI handle when you changed the timeout ?

Best regards,
Zoran

 NACK, until the comments are fixed.

 /Neel.


 On Thursday 08 May 2014 05:16 PM, Zoran Milinkovic wrote:
 Summary: imm: add support for configurable OI callback timeout [#16]
 Review request for Trac Ticket(s): 16 Peer Reviewer(s): Neelakanta,
 Anders Pull request to: Zoran Affected branch(es): default(4.5)
 Development branch: default(4.5)

 
 Impacted area   Impact y/n
 
Docsn
Build systemn
RPM/packaging   n
Configuration files n
Startup scripts n
SAF servicesy
OpenSAF servicesn
Core libraries  n
Samples

Re: [devel] [PATCH 0 of 1] Review Request for imm: adjust imm constants for bigger MDS message [#862]

2014-05-27 Thread Zoran Milinkovic
Good work.
Ack from me.

Best regards,
Zoran

-Original Message-
From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com] 
Sent: den 27 maj 2014 06:11
To: Anders Björnerstedt; Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 0 of 1] Review Request for imm: adjust imm constants for bigger 
MDS message [#862]

Summary:imm: adjust imm constants for bigger MDS message [#862] 
Review request for Trac Ticket(s): #862
Peer Reviewer(s):  Anders/Zoran
Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE
Affected branch(es): default 
Development branch: IF ANY GIVE THE REPO URL


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 8525ca706261f2233e4d953eed54280e34ae7e91
Author: A V Mahesh mahesh.va...@oracle.com
Date:   Tue, 27 May 2014 09:34:27 +0530

imm: adjust imm constants for bigger MDS message [#862] No functional
changes. Adjust the default values to utilize new MDS_DIRECT_BUF_MAXSIZE
of 65479. After this changes you will observed considerable improvement 
in
Node Sync Measurements. I tested with 300k Objects with single PBE (
loading imm.db) It use to take 77 sec previously , after this changes 
it is
taking 14 sec only.

IMP Note : You need to prepare fresh/NEW with 300k Objects and then file
to see the improvement ( opensafImmSyncBatchSize size will be 65479). If
you are using old imm.db ,you will NOT see the advantage in sync
performance ,even after new binaries are installed ( 
opensafImmSyncBatchSize
size with 4096 )

Some how I failed to modif opensafImmSyncBatchSize value from 4096 to 
new
value 65479 of object at run-time. (immcfg -a 
opensafImmSyncBatchSize=65479
opensafImm=opensafImm,safApp=safImmService)


Complete diffstat:
--
 osaf/libs/common/immsv/include/immsv_api.h |   6 +++---
 osaf/services/saf/immsv/immloadd/imm_loader.cc |   1 +
 osaf/services/saf/immsv/immnd/immnd_evt.c  |  10 +-
 3 files changed, 9 insertions(+), 8 deletions(-)


Testing Commands:
-

Prepare fresh/NEW  with 300k Objects and do Node Sync Measurements with single 
PBE ( loading imm.db) 
( opensafImmSyncBatchSize  size will be 65479)


Testing, Expected Results:
--
 PASTE COMMAND OUTPUTS / TEST RESULTS


Conditions of Submission:
-
 HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately

[devel] [PATCH 0 of 3] Review Request for imm: add support for configurable OI callback timeout [#16]

2014-06-05 Thread Zoran Milinkovic
Summary: imm: add support for configurable OI callback timeout [#16]
Review request for Trac Ticket(s): 16
Peer Reviewer(s): Neelakanta, Anders
Pull request to: Zoran
Affected branch(es): default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each y above):
-

changeset eaf47d593b82de803a1c174bc0cb1076723735d3
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 05 Jun 2014 14:32:15 +0200

imm: add support for configurable OI callback timeout [#16]

When an implementer is set, the configurable timeout is sent to IMM 
service.
The configurable timeout is used for calculating timeouts for OI 
callbacks
and waiting on search replies from RTA update callback.

changeset 4c5fa9f8386539a7744c2125fb0d62215e5545ea
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 05 Jun 2014 14:33:38 +0200

imm: use IMMA_OI_CALLBACK_TIMEOUT for setting OI callback timeout [#16]

IMMA uses IMMA_OI_CALLBACK_TIMEOUT for sending OI timeout to IMM service
using implementer set operations.

changeset 6e01f9bceb8042001ea44f2c51584b8558e7f2b0
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 05 Jun 2014 14:36:23 +0200

immtests: add test cases for OI callbacki timeout [#16]

Test cases cover OI callback timeout and timeout on searching for an 
object
with RTA


Complete diffstat:
--
 osaf/libs/agents/saf/imma/imma_cb.h  |1 +
 osaf/libs/agents/saf/imma/imma_oi_api.c  |   22 +-
 osaf/libs/common/immsv/immsv_evt.c   |   56 
-
 osaf/libs/common/immsv/include/immsv_evt.h   |4 +
 osaf/libs/common/immsv/include/immsv_evt_model.h |1 +
 osaf/services/saf/immsv/immd/immd_evt.c  |9 +++-
 osaf/services/saf/immsv/immnd/ImmModel.cc|   95 
-
 osaf/services/saf/immsv/immnd/ImmModel.hh|6 +-
 osaf/services/saf/immsv/immnd/immnd_evt.c|   46 
+---
 osaf/services/saf/immsv/immnd/immnd_init.h   |8 ++-
 tests/immsv/implementer/test_cleanup.c   |1 +
 tests/immsv/implementer/test_saImmOiImplementerSet.c |  336 
++
 12 files changed, 547 insertions(+), 38 deletions(-)


Testing Commands:
-
immoitest


Testing, Expected Results:
--
immoitest must pass all tests


Conditions of Submission:
-
Ack from Neelakanta and Anders


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits

[devel] [PATCH 1 of 3] imm: add support for configurable OI callback timeout [#16]

2014-06-05 Thread Zoran Milinkovic
 osaf/libs/common/immsv/immsv_evt.c   |  56 +-
 osaf/libs/common/immsv/include/immsv_evt.h   |   4 +
 osaf/libs/common/immsv/include/immsv_evt_model.h |   1 +
 osaf/services/saf/immsv/immd/immd_evt.c  |   9 ++-
 osaf/services/saf/immsv/immnd/ImmModel.cc|  95 ++-
 osaf/services/saf/immsv/immnd/ImmModel.hh|   6 +-
 osaf/services/saf/immsv/immnd/immnd_evt.c|  46 +-
 osaf/services/saf/immsv/immnd/immnd_init.h   |   8 +-
 8 files changed, 188 insertions(+), 37 deletions(-)


When an implementer is set, the configurable timeout is sent to IMM service.
The configurable timeout is used for calculating timeouts for OI callbacks and 
waiting on search replies from RTA update callback.

diff --git a/osaf/libs/common/immsv/immsv_evt.c 
b/osaf/libs/common/immsv/immsv_evt.c
--- a/osaf/libs/common/immsv/immsv_evt.c
+++ b/osaf/libs/common/immsv/immsv_evt.c
@@ -64,6 +64,7 @@ static const char *immd_evt_names[] = {
IMMD_EVT_ND2D_FEVS_REQ_2,
IMMD_EVT_ND2D_LOADING_COMPLETED,
IMMD_EVT_ND2D_2PBE_PRELOAD,
+   IMMD_EVT_ND2D_IMPLSET_REQ_2,
undefined (high)
 };
 
@@ -173,6 +174,8 @@ static const char *immnd_evt_names[] = {
IMMND_EVT_A2ND_CL_TIMEOUT,
IMMND_EVT_A2ND_ACCESSOR_GET,
IMMND_EVT_A2ND_CCB_VALIDATE,  /* saImmOmCcbValidate */
+   IMMND_EVT_A2ND_OI_IMPL_SET_2, /* saImmOiImplementerSet */
+   IMMND_EVT_D2ND_IMPLSET_RSP_2, /* Implementer set reply from D with 
impl id */
undefined (high)
 };
 
@@ -1511,7 +1514,8 @@ static uint32_t immsv_evt_enc_sublevels(
(i_evt-info.immd.type == IMMD_EVT_ND2D_FEVS_REQ_2)) {
IMMSV_OCTET_STRING *os = 
(i_evt-info.immd.info.fevsReq.msg);
immsv_evt_enc_inline_string(o_ub, os);
-   } else if (i_evt-info.immd.type == IMMD_EVT_ND2D_IMPLSET_REQ) {
+   } else if ((i_evt-info.immd.type == IMMD_EVT_ND2D_IMPLSET_REQ) 
||
+   (i_evt-info.immd.type == 
IMMD_EVT_ND2D_IMPLSET_REQ_2)) {
IMMSV_OCTET_STRING *os = 
(i_evt-info.immd.info.impl_set.r.impl_name);
if(!immsv_evt_enc_inline_text(__LINE__, o_ub, os)) {
return NCSCC_RC_OUT_OF_MEM;
@@ -1564,7 +1568,9 @@ static uint32_t immsv_evt_enc_sublevels(
IMMSV_OCTET_STRING *os = 
(i_evt-info.immnd.info.fevsReq.msg);
immsv_evt_enc_inline_string(o_ub, os);
} else if ((i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_IMPL_SET) ||
+  (i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_IMPL_SET_2) ||
   (i_evt-info.immnd.type == 
IMMND_EVT_D2ND_IMPLSET_RSP) ||
+  (i_evt-info.immnd.type == 
IMMND_EVT_D2ND_IMPLSET_RSP_2) ||
   (i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_CL_IMPL_SET) ||
   (i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_CL_IMPL_REL) ||
   (i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_OBJ_IMPL_SET) ||
@@ -2141,7 +2147,8 @@ static uint32_t immsv_evt_dec_sublevels(
(o_evt-info.immd.type == IMMD_EVT_ND2D_FEVS_REQ_2)) {
IMMSV_OCTET_STRING *os = 
(o_evt-info.immd.info.fevsReq.msg);
immsv_evt_dec_inline_string(i_ub, os);
-   } else if (o_evt-info.immd.type == IMMD_EVT_ND2D_IMPLSET_REQ) {
+   } else if ((o_evt-info.immd.type == IMMD_EVT_ND2D_IMPLSET_REQ) 
||
+   (o_evt-info.immd.type == 
IMMD_EVT_ND2D_IMPLSET_REQ_2)) {
IMMSV_OCTET_STRING *os = 
(o_evt-info.immd.info.impl_set.r.impl_name);
immsv_evt_dec_inline_string(i_ub, os);
} else if (o_evt-info.immd.type == 
IMMD_EVT_ND2D_OI_OBJ_MODIFY) {
@@ -2177,7 +2184,9 @@ static uint32_t immsv_evt_dec_sublevels(
immsv_evt_dec_inline_string(i_ub, os);
} else
if ((o_evt-info.immnd.type == IMMND_EVT_A2ND_OI_IMPL_SET) 
||
+   (o_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_IMPL_SET_2) ||
(o_evt-info.immnd.type == IMMND_EVT_D2ND_IMPLSET_RSP) 
||
+   (o_evt-info.immnd.type == 
IMMND_EVT_D2ND_IMPLSET_RSP_2) ||
(o_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_CL_IMPL_SET) ||
(o_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_CL_IMPL_REL) ||
(o_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_OBJ_IMPL_SET) ||
@@ -2949,6 +2958,7 @@ static uint32_t immsv_evt_enc_toplevel(I
break;
 
case IMMD_EVT_ND2D_IMPLSET_REQ: /*OiImplementerSet */
+   case IMMD_EVT_ND2D_IMPLSET_REQ_2:   /*OiImplementerSet */
IMMSV_RSRV_SPACE_ASSERT(p8, o_ub, 8);
 

[devel] [PATCH 3 of 3] immtests: add test cases for OI callbacki timeout [#16]

2014-06-05 Thread Zoran Milinkovic
 tests/immsv/implementer/test_cleanup.c   |1 +
 tests/immsv/implementer/test_saImmOiImplementerSet.c |  336 +++
 2 files changed, 337 insertions(+), 0 deletions(-)


Test cases cover OI callback timeout and timeout on searching for an object 
with RTA

diff --git a/tests/immsv/implementer/test_cleanup.c 
b/tests/immsv/implementer/test_cleanup.c
--- a/tests/immsv/implementer/test_cleanup.c
+++ b/tests/immsv/implementer/test_cleanup.c
@@ -31,6 +31,7 @@ static char *objects[] = {

123456789012345678901234567890123456789012345678901234567890123,123456789012345678901234567890123456789012345678901234567890123,123456789012345678901234567890123456789012345678901234567890123,rdn=root,
Test,rdn=root,
rdn=root,
+   obj=1,
NULL
 };
 
diff --git a/tests/immsv/implementer/test_saImmOiImplementerSet.c 
b/tests/immsv/implementer/test_saImmOiImplementerSet.c
--- a/tests/immsv/implementer/test_saImmOiImplementerSet.c
+++ b/tests/immsv/implementer/test_saImmOiImplementerSet.c
@@ -16,6 +16,10 @@
  */
 
 #include immtest.h
+#include unistd.h
+#include pthread.h
+#include poll.h
+#include stdlib.h
 
 void saImmOiImplementerSet_01(void)
 {
@@ -70,6 +74,332 @@ void saImmOiImplementerSet_05(void)
 safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
 }
 
+int saImmOiImplementerSet_callback_wait = 15;
+SaImmClassNameT saImmOiImplementerSet_className = NULL;
+
+static SaAisErrorT saImmOiImplementerSet_ModifyCallback(SaImmOiHandleT 
immOiHandle, SaImmOiCcbIdT ccbId,
+   const SaNameT *objectName, const SaImmAttrModificationT_2 
**attrMods) {
+
+   sleep(saImmOiImplementerSet_callback_wait);
+   return SA_AIS_OK;
+}
+
+static SaAisErrorT saImmOiImplementerSet_RtAttrUpdateCallbackT(SaImmOiHandleT 
immOiHandle, const SaNameT *objectName, const SaImmAttrNameT *attributeNames) {
+   SaUint32T attrVal = (SaUint32T)random();
+   SaImmAttrValueT attrValues[1] = { attrVal };
+   SaImmAttrModificationT_2 attrMod = { SA_IMM_ATTR_VALUES_REPLACE, { 
attr1, SA_IMM_ATTR_SAUINT32T, 1, attrValues } };
+   const SaImmAttrModificationT_2 *attrMods[2] = { attrMod, NULL };
+
+   sleep(saImmOiImplementerSet_callback_wait);
+
+   saImmOiRtObjectUpdate_2(immOiHandle, objectName, attrMods);
+
+   return SA_AIS_OK;
+}
+
+void *saImmOiImplementerSet_modify_thread(void *arg) {
+   int *ready = (int *)arg;
+   SaImmOiHandleT immOiHandle;
+   SaSelectionObjectT selObj;
+   SaImmOiCallbacksT_2 configImmOiCallbacks = { NULL , NULL , NULL , NULL 
, NULL , NULL , saImmOiImplementerSet_ModifyCallback , NULL };
+   SaImmOiCallbacksT_2 rtImmOiCallbacks = { NULL , NULL , NULL , NULL , 
NULL , NULL , NULL , saImmOiImplementerSet_RtAttrUpdateCallbackT };
+   SaNameT rdn = { 5, obj=1 };
+   struct pollfd pfd;
+   int rc = 1;
+   int config = 1;
+
+   assert(saImmOiImplementerSet_className != NULL);
+
+   if(!strcmp(saImmOiImplementerSet_className, runtimeClassName)) {
+   SaImmAttrValueT attrVal[1] = { rdn };
+   SaImmAttrValuesT_2 rdnVal = { rdn, SA_IMM_ATTR_SANAMET, 1, 
attrVal };
+   const SaImmAttrValuesT_2 *attrValues[2] = { rdnVal, NULL };
+
+   safassert(saImmOiInitialize_2(immOiHandle, rtImmOiCallbacks, 
immVersion), SA_AIS_OK);
+   safassert(saImmOiSelectionObjectGet(immOiHandle, selObj), 
SA_AIS_OK);
+   safassert(saImmOiImplementerSet(immOiHandle, 
(SaImmOiImplementerNameT)__FUNCTION__), SA_AIS_OK);
+   safassert(saImmOiRtObjectCreate_2(immOiHandle, 
runtimeClassName, NULL, attrValues), SA_AIS_OK);
+   config = 0;
+   } else {
+   safassert(saImmOiInitialize_2(immOiHandle, 
configImmOiCallbacks, immVersion), SA_AIS_OK);
+   safassert(saImmOiSelectionObjectGet(immOiHandle, selObj), 
SA_AIS_OK);
+   safassert(saImmOiImplementerSet(immOiHandle, 
(SaImmOiImplementerNameT)__FUNCTION__), SA_AIS_OK);
+   safassert(saImmOiClassImplementerSet(immOiHandle, 
saImmOiImplementerSet_className), SA_AIS_OK);
+   }
+
+   *ready = 1;
+
+   while((!rc || rc == 1)  *ready) {
+   pfd.fd = selObj;
+   pfd.events = POLLIN;
+   rc = poll(pfd, 1, 100);
+
+   safassert(saImmOiDispatch(immOiHandle, SA_DISPATCH_ONE), 
SA_AIS_OK);
+   }
+
+   if(!config) {
+   safassert(saImmOiRtObjectDelete(immOiHandle, rdn), SA_AIS_OK);
+   } else {
+   safassert(saImmOiClassImplementerRelease(immOiHandle, 
saImmOiImplementerSet_className), SA_AIS_OK);
+   }
+
+   safassert(saImmOiImplementerClear(immOiHandle), SA_AIS_OK);
+   safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
+
+   *ready = 1;
+
+   return NULL;
+}
+
+void saImmOiImplementerSet_06(void)
+{
+   SaImmHandleT immHandle;
+   SaImmAdminOwnerHandleT ownerHandle;
+   

Re: [devel] [PATCH 0 of 1] Review Request for IMM: Add config attribute opensafLongDnsAllowed to class OpensafImm [#897]

2014-06-10 Thread Zoran Milinkovic
Review but didn't test.
Ack from me.

Best regards,
Zoran

-Original Message-
From: Anders Bjornerstedt [mailto:anders.bjornerst...@ericsson.com] 
Sent: den 9 juni 2014 08:18
To: reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 0 of 1] Review Request for IMM: Add config attribute 
opensafLongDnsAllowed to class OpensafImm [#897]

Summary: IMM: Add config attribute 'opensafLongDnsAllowed' to class 
'OpensafImm' [#897]
Review request for Trac Ticket(s): 897
Peer Reviewer(s): Neel; Zoran
Pull request to: 
Affected branch(es): default(4.5)
Development branch:


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 83fa169f43de5cb6b7fb70048bffc68f7fa4c390
Author: Anders Bjornerstedt anders.bjornerst...@ericsson.com
Date:   Thu, 05 Jun 2014 14:55:19 +0200

IMM: Add config attribute 'opensafLongDnsAllowed' to class 'OpensafImm'
[#897]

A config attribute named 'opensafLongDnsAllowed' is added to the class
'OpensafImm'. The default value is 0 with the intended meaning that 
long DNs
are not allowed. Any other value has the meaning that long DNs are 
allowed.
A boolean function 'getLongDnsAllowed()' has been added to ImmModel. 
This
function will be used by the function ImmModel::ccbObjectCreate() when 
it
detects that an object proposed to be created has a DN longer than 255
bytes. The creation will only be allowed if getLongDnsAllowed() returns
true.

Validation of updates to the value of 'opensafLongDnsAllowed' will be 
added
as part of ticket #934. Transitioning from true to false will only be
allowed if the imm database currently has no object with a long DN.

An imm xml file containing the extended class definition for OpensafImm 
has
been added at samples/immsv/OpensafImm.xml The xml file should be used 
for
upgrading the class when older OpenSAF systems are upgraded to OpenSAF 
4.5.


Added Files:

 samples/immsv/OpensafImm.xml


Complete diffstat:
--
 osaf/libs/common/immsv/include/immsv_api.h |   2 ++
 osaf/services/saf/immsv/immloadd/imm_loader.cc |  10 --
 osaf/services/saf/immsv/immnd/ImmModel.cc  |  24 
 osaf/services/saf/immsv/immnd/ImmModel.hh  |   1 +
 samples/immsv/OpensafImm.xml   |  64 

 5 files changed, 99 insertions(+), 2 deletions(-)


Testing Commands:
-
Nothing much except the existence of the new attribute can be tested 
currently since the functionality that the attribute is intended for
has not yet been added. Support for long DNs in the IMM is tracked by
ticket #886 'IMM: Add support for long DNs in existing IMM APIs'

it should be possible to test upgrading the class on older systems
via 'immcfg -f samples/immsv/OpensafImm.xml'. Note that the flag
for allowing schema chanes then needs to be set to on.

Testing, Expected Results:
--
This review is mainly concerned with establishing consensus on
the naming and mechanism for allowing long DNs on a per-site
basis. 


Conditions of Submission:
-
Ack from Neel and Zoran.



Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace 

Re: [devel] [PATCH 1 of 5] NTF: Adapt NTF API to support long DNs [#873]

2014-07-04 Thread Zoran Milinkovic
Hi,

Find my comments on ntfsv_sanamet_clone_strptr cases inline.

-Original Message-
From: Minh Hon Chau [mailto:minh.c...@dektech.com.au] 
Sent: den 2 juli 2014 07:50
To: Anders Widell; mathi.naic...@oracle.com; Hans Feldt; 
praveen.malv...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1 of 5] NTF: Adapt NTF API to support long DNs [#873]

 osaf/libs/agents/saf/ntfa/Makefile.am |   1 +
 osaf/libs/agents/saf/ntfa/ntfa_api.c  |  25 -
 osaf/libs/saf/libSaNtf/Makefile.am|   1 +
 3 files changed, 18 insertions(+), 9 deletions(-)


diff --git a/osaf/libs/agents/saf/ntfa/Makefile.am 
b/osaf/libs/agents/saf/ntfa/Makefile.am
--- a/osaf/libs/agents/saf/ntfa/Makefile.am
+++ b/osaf/libs/agents/saf/ntfa/Makefile.am
@@ -25,6 +25,7 @@ noinst_HEADERS = \
 noinst_LTLIBRARIES = libntfa.la
 
 libntfa_la_CPPFLAGS = \
+   -DSA_EXTENDED_NAME_SOURCE \
$(AM_CPPFLAGS) \
-I$(top_srcdir)/osaf/libs/common/ntfsv/include
 
diff --git a/osaf/libs/agents/saf/ntfa/ntfa_api.c 
b/osaf/libs/agents/saf/ntfa/ntfa_api.c
--- a/osaf/libs/agents/saf/ntfa/ntfa_api.c
+++ b/osaf/libs/agents/saf/ntfa/ntfa_api.c
@@ -18,7 +18,8 @@
 #include string.h
 #include ntfa.h
 #include ntfsv_mem.h
-
+#include osaf_extended_name.h
+#include saAis.h
 #define NCS_SAF_MIN_ACCEPT_TIME 10
 #define NTFS_WAIT_TIME 1000
 
@@ -304,9 +305,10 @@ static SaAisErrorT checkSecurityAlarmFil
 static SaAisErrorT checkHeader(SaNtfNotificationHeaderT *nh)
 {
int i =0;
-
-   if (nh-notificationObject-length  SA_MAX_NAME_LENGTH || 
nh-notifyingObject-length  SA_MAX_NAME_LENGTH) {
-   TRACE_1(SaNameT length too big);
+   
+   if (!ntfsv_sanamet_is_valid(nh-notificationObject) ||
+   !ntfsv_sanamet_is_valid(nh-notifyingObject)) {
+   TRACE_1(SaNameT is invaild);
return SA_AIS_ERR_INVALID_PARAM;
}
 
@@ -517,12 +519,17 @@ static SaAisErrorT fillSendStruct(SaNtfN
/* nodificationId set to zero means that this is a new notification */
/* and not an sync message send from the server. */
*(notificationHeader-notificationId) = 0;
+   
+   /* For long dn object, clone the string pointer */
+   ntfsv_sanamet_clone_strptr(notificationHeader-notificationObject);

[Zoran] Looks like ntfsv_sanamet_clone_strptr makes memory leak here for long 
dn ??? Why does long dn need to be cloned ?

-   if (notificationHeader-notifyingObject-length == 0) {
-   notificationHeader-notifyingObject-length = 
notificationHeader-notificationObject-length;
-   (void)memcpy(notificationHeader-notifyingObject-value, 
notificationHeader-notificationObject-value,
-notificationHeader-notifyingObject-length);
-   }
+   /* Copy notificationObject to notifyingObject if it's empty */
+   if (osaf_is_extended_name_empty(notificationHeader-notifyingObject))
+   rc = ntfsv_sanamet_copy(notificationHeader-notifyingObject, 
+   
notificationHeader-notificationObject);
+   else/* Not empty and it's long dn object, clone the string pointer 
*/
+   ntfsv_sanamet_clone_strptr(notificationHeader-notifyingObject);

[Zoran] Another case of using ntfsv_sanamet_clone_strptr, and same questions as 
above.

Best regards,
Zoran

+
return rc;
 }
 
diff --git a/osaf/libs/saf/libSaNtf/Makefile.am 
b/osaf/libs/saf/libSaNtf/Makefile.am
--- a/osaf/libs/saf/libSaNtf/Makefile.am
+++ b/osaf/libs/saf/libSaNtf/Makefile.am
@@ -29,6 +29,7 @@ lib_LTLIBRARIES = libSaNtf.la
 libSaNtf_la_SOURCES = 
 
 libSaNtf_la_CPPFLAGS = \
+   -DSA_EXTENDED_NAME_SOURCE \
$(AM_CPPFLAGS)
 
 if HAVE_LD_VERSION_SCRIPT

--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 2 of 5] NTF: Adapt NTF common library to support long DNs [#873]

2014-07-04 Thread Zoran Milinkovic
Hi,

Find my comments inline started with [Zoran].


-Original Message-
From: Minh Hon Chau [mailto:minh.c...@dektech.com.au] 
Sent: den 2 juli 2014 07:50
To: Anders Widell; mathi.naic...@oracle.com; Hans Feldt; 
praveen.malv...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 2 of 5] NTF: Adapt NTF common library to support long 
DNs [#873]

 osaf/libs/common/ntfsv/Makefile.am |1 +
 osaf/libs/common/ntfsv/include/ntfsv_mem.h |7 +
 osaf/libs/common/ntfsv/ntfsv_enc_dec.c |   37 --
 osaf/libs/common/ntfsv/ntfsv_mem.c |  167 +++-
 4 files changed, 191 insertions(+), 21 deletions(-)


diff --git a/osaf/libs/common/ntfsv/Makefile.am 
b/osaf/libs/common/ntfsv/Makefile.am
--- a/osaf/libs/common/ntfsv/Makefile.am
+++ b/osaf/libs/common/ntfsv/Makefile.am
@@ -23,6 +23,7 @@ SUBDIRS = include
 noinst_LTLIBRARIES = libntfsv_common.la
 
 libntfsv_common_la_CPPFLAGS = \
+   -DSA_EXTENDED_NAME_SOURCE \
$(AM_CPPFLAGS) \
-I$(top_srcdir)/osaf/libs/common/ntfsv/include
 
diff --git a/osaf/libs/common/ntfsv/include/ntfsv_mem.h 
b/osaf/libs/common/ntfsv/include/ntfsv_mem.h
--- a/osaf/libs/common/ntfsv/include/ntfsv_mem.h
+++ b/osaf/libs/common/ntfsv/include/ntfsv_mem.h
@@ -97,6 +97,13 @@ extern C {
void 
ntfsv_filter_obj_cr_del_free(SaNtfObjectCreateDeleteNotificationFilterT *f);
void ntfsv_filter_attr_ch_free(SaNtfAttributeChangeNotificationFilterT 
*f);
 
+   SaAisErrorT ntfsv_sanamet_copy(SaNameT* pDes, SaNameT* pSrc);
+   bool ntfsv_sanamet_is_valid(const SaNameT* pName);
+   void ntfsv_sanamet_clone_strptr(SaNameT* pName);
+   SaStringT ntfs_sanamet_strdup(SaNameT* pName);
+   size_t ntfs_sanamet_length(const SaNameT* pName);
+   void ntfs_sanamet_steal(SaStringT value, size_t length, SaNameT* pName);
+   void ntfs_sanamet_alloc(SaConstStringT value, size_t length, SaNameT* 
pName);
 #ifdef  __cplusplus
 }
 #endif
diff --git a/osaf/libs/common/ntfsv/ntfsv_enc_dec.c 
b/osaf/libs/common/ntfsv/ntfsv_enc_dec.c
--- a/osaf/libs/common/ntfsv/ntfsv_enc_dec.c
+++ b/osaf/libs/common/ntfsv/ntfsv_enc_dec.c
@@ -18,6 +18,8 @@
 #include ncsencdec_pub.h
 #include ntfsv_enc_dec.h
 #include ntfsv_mem.h
+#include osaf_extended_name.h
+#include saAis.h
 
 typedef union {
uint32_t uint32_val;
@@ -334,19 +336,22 @@ static uint32_t decodeSaNtfAttribute(NCS
 static uint32_t encodeSaNameT(NCS_UBAID *uba, uint8_t *p8, SaNameT *name)
 {
uint32_t rv;
-   
p8 = ncs_enc_reserve_space(uba, 2);
if (!p8) {
TRACE(ncs_enc_reserve_space failed);
return NCSCC_RC_OUT_OF_MEM;
}
-   if (name-length  SA_MAX_NAME_LENGTH) {
-   LOG_ER(SaNameT length too long %hd, name-length);
-   osafassert(0);
-   }
-   ncs_encode_16bit(p8, name-length);
-   ncs_enc_claim_space(uba, 2);
-   rv = ncs_encode_n_octets_in_uba(uba, name-value, 
(uint32_t)name-length);
+
+   if (!ntfsv_sanamet_is_valid(name)) {
+   LOG_ER(SaNameT is invalid);
+   osafassert(0);
+   }
+
+   SaConstStringT value = osaf_extended_name_borrow(name);
+   size_t length = ntfs_sanamet_length(name);
+   ncs_encode_16bit(p8, length);
+   ncs_enc_claim_space(uba, 2);
+   rv = ncs_encode_n_octets_in_uba(uba, (uint8_t*) value, (uint32_t) 
length);
return rv;
 }
 
@@ -355,14 +360,22 @@ static uint32_t decodeSaNameT(NCS_UBAID 
uint8_t local_data[2];
uint32_t rv;
p8 = ncs_dec_flatten_space(uba, local_data, 2);
-   name-length = ncs_decode_16bit(p8);
-   if (name-length  SA_MAX_NAME_LENGTH) {
-   LOG_ER(SaNameT length too long: %hd, name-length);
+   size_t length = ncs_decode_16bit(p8);
+   if (length  kMaxDnLength) {
+   LOG_ER(SaNameT length too long: %zu, length);
/* this should not happen */
osafassert(0);
}
ncs_dec_skip_space(uba, 2);
-   rv = ncs_decode_n_octets_from_uba(uba, name-value, 
(uint32_t)name-length);
+   char* value = (char*) malloc(length + 1);
+   if (value == NULL) {
+   LOG_ER(Out of memory);
+   /* this should not happen */
+   osafassert(0);
+   }
+   rv = ncs_decode_n_octets_from_uba(uba, (uint8_t*) value, (uint32_t) 
length);
+   value[length] = '\0';
+   ntfs_sanamet_steal(value, length, name);
return rv;
 }
 
diff --git a/osaf/libs/common/ntfsv/ntfsv_mem.c 
b/osaf/libs/common/ntfsv/ntfsv_mem.c
--- a/osaf/libs/common/ntfsv/ntfsv_mem.c
+++ b/osaf/libs/common/ntfsv/ntfsv_mem.c
@@ -18,6 +18,8 @@
 #include saNtf.h
 #include stdlib.h
 #include ntfsv_mem.h
+#include osaf_extended_name.h
+#include saAis.h
 #include logtrace.h
 
 void ntfsv_free_header(const SaNtfNotificationHeaderT *notificationHeader)
@@ -27,10 +29,14 @@ void ntfsv_free_header(const SaNtfNotifi

[devel] [PATCH 4 of 4] imm: add test cases for long DN [#886]

2014-07-14 Thread Zoran Milinkovic
 tests/immsv/common/immtest.c |   30 +-
 tests/immsv/implementer/Makefile.am  |1 +
 tests/immsv/implementer/applier.c|   24 +-
 tests/immsv/implementer/test_cleanup.c   |   38 +-
 tests/immsv/implementer/test_saImmOiLongDn.c |  621 +++
 tests/immsv/management/Makefile.am   |1 +
 tests/immsv/management/test_cleanup.c|   38 +-
 tests/immsv/management/test_saImmOmLongDn.c  |  368 
 8 files changed, 1075 insertions(+), 46 deletions(-)


New test cases have been added to immomtest and immoitest.
If SA_ENABLE_EXTENDED_NAMES is not set, immomtest and immoitest can use 
--longDn parameter to set SA_ENABLE_EXTENDED_NAMES for testing.

diff --git a/tests/immsv/common/immtest.c b/tests/immsv/common/immtest.c
--- a/tests/immsv/common/immtest.c
+++ b/tests/immsv/common/immtest.c
@@ -47,17 +47,26 @@ int main(int argc, char **argv)
 {
 int suite = ALL_SUITES, tcase = ALL_TESTS;
 int rc = 0;
+int i;
+int index = 0;
+int longDn = 0;
 
 srandom(getpid());
 
-if (argc  1)
-{
-suite = atoi(argv[1]);
+for(i=1; iargc; i++) {
+   if(!strcmp(argv[i], --longDn)) {
+   longDn = 1;
+   } else if(index == 0) {
+   suite = atoi(argv[i]);
+   index++;
+   } else if(index == 1) {
+   tcase = atoi(argv[i]);
+   index++;
+   }
 }
 
-if (argc  2)
-{
-tcase = atoi(argv[2]);
+if(longDn) {
+   setenv(SA_ENABLE_EXTENDED_NAMES, 1, 1);
 }
 
 if(test_setup)
@@ -111,7 +120,10 @@ SaAisErrorT config_class_create(SaImmHan
 SaImmAttrDefinitionT_2 attr7 = {
 attr7, SA_IMM_ATTR_SAANYT, SA_IMM_ATTR_CONFIG | SA_IMM_ATTR_WRITABLE 
| SA_IMM_ATTR_MULTI_VALUE | SA_IMM_ATTR_NO_DUPLICATES, NULL};
 
-const SaImmAttrDefinitionT_2* attributes[] = {rdn, attr1, attr2, 
attr3, attr4, attr5, attr6, attr7, NULL};
+SaImmAttrDefinitionT_2 attr8 = {
+attr8, SA_IMM_ATTR_SANAMET, SA_IMM_ATTR_CONFIG | 
SA_IMM_ATTR_WRITABLE, NULL};
+
+const SaImmAttrDefinitionT_2* attributes[] = {rdn, attr1, attr2, 
attr3, attr4, attr5, attr6, attr7, attr8, NULL};
 
 err = saImmOmClassCreate_2(immHandle, configClassName, SA_IMM_CLASS_CONFIG,
 attributes);
@@ -142,8 +154,10 @@ SaAisErrorT runtime_class_create(SaImmHa
 
 SaImmAttrDefinitionT_2 attr1 = {
 attr1, SA_IMM_ATTR_SAUINT32T, SA_IMM_ATTR_RUNTIME, NULL};
+SaImmAttrDefinitionT_2 attr2 = {
+attr2, SA_IMM_ATTR_SANAMET, SA_IMM_ATTR_RUNTIME, NULL};
 
-const SaImmAttrDefinitionT_2* attributes[] = {rdn, attr1, NULL};
+const SaImmAttrDefinitionT_2* attributes[] = {rdn, attr1, attr2, NULL};
 
 return  saImmOmClassCreate_2(immHandle, runtimeClassName, 
SA_IMM_CLASS_RUNTIME,
 attributes);
diff --git a/tests/immsv/implementer/Makefile.am 
b/tests/immsv/implementer/Makefile.am
--- a/tests/immsv/implementer/Makefile.am
+++ b/tests/immsv/implementer/Makefile.am
@@ -44,6 +44,7 @@ immoitest_SOURCES = \
test_SaImmOiCcb.c \
test_SaImmOiAdminOperation.c \
test_saImmOiAugmentCcbInitialize.c \
+   test_saImmOiLongDn.c \
test_cleanup.c
 
 immoitest_LDADD = \
diff --git a/tests/immsv/implementer/applier.c 
b/tests/immsv/implementer/applier.c
--- a/tests/immsv/implementer/applier.c
+++ b/tests/immsv/implementer/applier.c
@@ -41,6 +41,9 @@
 #include immutil.h
 #include saf_error.h
 #include poll.h
+
+#include osaf_extended_name.h
+
 #ifdef HAVE_CONFIG_H
 #include config.h
 #endif
@@ -74,7 +77,7 @@ static SaAisErrorT saImmOiCcbObjectModif
  const SaNameT *objectName, 
const SaImmAttrModificationT_2 **attrMods)
 {
SaAisErrorT rc = SA_AIS_OK;
-   printf(Modify callback on %s - object:%s ccbId:%llu\n, implName, 
objectName-value, ccbId);
+   printf(Modify callback on %s - object:%s ccbId:%llu\n, implName, 
osaf_extended_name_borrow(objectName), ccbId);
 
struct CcbUtilCcbData *ccbUtilCcbData;
if ((ccbUtilCcbData = ccbutil_findCcbData(ccbId)) == NULL) {
@@ -100,7 +103,7 @@ static SaAisErrorT saImmOiCcbObjectCreat
SaAisErrorT rc = SA_AIS_OK;
struct CcbUtilCcbData *ccbUtilCcbData;
 
-   printf(Create callback on %s - parent:%s ccbId:%llu\n, implName, 
parentName-value, ccbId);
+   printf(Create callback on %s - parent:%s ccbId:%llu\n, implName, 
osaf_extended_name_borrow(parentName), ccbId);
 
if ((ccbUtilCcbData = ccbutil_findCcbData(ccbId)) == NULL) {
if ((ccbUtilCcbData = ccbutil_getCcbData(ccbId)) == NULL) {
@@ -120,7 +123,7 @@ static SaAisErrorT saImmOiCcbObjectDelet
 {
SaAisErrorT rc = SA_AIS_OK;
struct CcbUtilCcbData *ccbUtilCcbData;
-   printf(Delete callback on %s - object:%s ccbId:%llu\n, implName, 
objectName-value, ccbId);
+   printf(Delete callback on %s - object:%s ccbId:%llu\n, implName, 
osaf_extended_name_borrow(objectName), 

[devel] [PATCH 0 of 4] Review Request for imm: add support for long DN [#886]

2014-07-14 Thread Zoran Milinkovic
Summary: imm: add support for long DN [#886]
Review request for Trac Ticket(s): 886
Peer Reviewer(s): Neelakanta, Anders
Pull request to: Zoran
Affected branch(es): default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each y above):
-

changeset 60ba40f3a2b55b564b73630d38bb594ac4eeced7
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Mon, 14 Jul 2014 16:29:00 +0200

imm: add support for long DN to IMM service [#886]

The patch contains a code for the support long DNs in IMM service

changeset 6c8c17209176a70e3d922d5294cf02dd489590bb
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Mon, 14 Jul 2014 16:30:49 +0200

imm: add support for long DN to IMM library [#886]

The patch contains a code for the support long DNs in IMM library

changeset 54ee330a6132782883d3df036f99298df9153dad
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Mon, 14 Jul 2014 16:31:40 +0200

imm: add support for long DN to IMM tools [#886]

The patch contains a code for the support long DNs in IMM tools

changeset e003b7c7c3e7054811ec237ba48d4562b7105432
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Mon, 14 Jul 2014 16:35:03 +0200

imm: add test cases for long DN [#886]

New test cases have been added to immomtest and immoitest. If
SA_ENABLE_EXTENDED_NAMES is not set, immomtest and immoitest can use
--longDn parameter to set SA_ENABLE_EXTENDED_NAMES for testing.


Added Files:

 tests/immsv/implementer/test_saImmOiLongDn.c
 tests/immsv/management/test_saImmOmLongDn.c


Complete diffstat:
--
 osaf/libs/agents/saf/imma/Makefile.am|4 +-
 osaf/libs/agents/saf/imma/imma_cb.h  |1 +
 osaf/libs/agents/saf/imma/imma_db.c  |3 +
 osaf/libs/agents/saf/imma/imma_init.c|   28 ---
 osaf/libs/agents/saf/imma/imma_oi_api.c  |  139 
++-
 osaf/libs/agents/saf/imma/imma_om_api.c  |  228 
-
 osaf/libs/agents/saf/imma/imma_proc.c|  134 
--
 osaf/libs/common/immsv/Makefile.am   |1 +
 osaf/libs/common/immsv/immpbe_dump.cc|   30 +++
 osaf/libs/common/immsv/immsv_evt.c   |  111 
++-
 osaf/libs/common/immsv/include/immsv_api.h   |5 +
 osaf/services/saf/immsv/immd/Makefile.am |2 +-
 osaf/services/saf/immsv/immd/immd_amf.c  |3 +-
 osaf/services/saf/immsv/immd/immd_evt.c  |3 +-
 osaf/services/saf/immsv/immloadd/Makefile.am |1 +
 osaf/services/saf/immsv/immloadd/imm_loader.cc   |   54 ++
 osaf/services/saf/immsv/immnd/ImmModel.cc|  240 
-
 osaf/services/saf/immsv/immnd/Makefile.am|2 +-
 osaf/services/saf/immsv/immnd/immnd_amf.c|3 +-
 osaf/services/saf/immsv/immnd/immnd_evt.c|   36 +
 osaf/services/saf/immsv/immnd/immnd_proc.c   |6 +-
 osaf/services/saf/immsv/immpbed/Makefile.am  |1 +
 osaf/services/saf/immsv/immpbed/immpbe.cc|8 +-
 osaf/services/saf/immsv/immpbed/immpbe_daemon.cc |  130 
++---
 osaf/tools/safimm/immadm/Makefile.am |1 +
 osaf/tools/safimm/immadm/imm_admin.c |   14 +--
 osaf/tools/safimm/immcfg/Makefile.am |1 +
 osaf/tools/safimm/immcfg/imm_cfg.c   |   22 +++--
 osaf/tools/safimm/immcfg/imm_import.cc   |   61 +
 osaf/tools/safimm/immdump/Makefile.am|1 +
 osaf/tools/safimm/immdump/imm_xmlw_dump.cc   |   10 +-
 osaf/tools/safimm/immfind/Makefile.am|1 +
 osaf/tools/safimm/immfind/imm_find.c |   16 ++--
 osaf/tools/safimm/immlist/Makefile.am|1 +
 osaf/tools/safimm/immlist/imm_list.c |8 +-
 osaf/tools/safimm/src/immutil.c  |   92 
--
 tests/immsv/common/immtest.c |   30 ++--
 tests/immsv/implementer/Makefile.am  |1 +
 tests/immsv/implementer/applier.c|   24 --
 tests/immsv/implementer/test_cleanup.c   |   38 ++
 tests/immsv/implementer/test_saImmOiLongDn.c |  621

Re: [devel] [PATCH 2 of 7] NTF: Adapt NTF common library to support long DNs [#873] v3

2014-07-17 Thread Zoran Milinkovic
Hi Mathi,

I'll explain you the endian problem on an example.

Let's say that we have a SaNameT string of size 400 (which is in hexadecimal 
0x190). Type of size_t is 64  bits (8 bytes)
On little endian system, 400 bytes is represented in memory as
90 01 00 00 00 00 00 00
On big endian system, 400 bytes is represented in memory  as
00 00 00 00 00 00 01 90

Now, when we copy first 2 bytes of 64 bit integer to 2 byte unsigned integer on 
big endian system, we actually copy two zeros.
And opposite, when we copy 2 byte unsigned integer to 64 bit integer, then we 
get a huge number. In this case, on big endian system, size_t variable will 
have value 01 90 00 00 00 00 00 00.

On little endian systems, memcpy works fine.

Regards,
Zoran


-Original Message-
From: Mathivanan Naickan Palanivelu [mailto:mathi.naic...@oracle.com] 
Sent: den 16 juli 2014 10:42
To: Minh Chau H
Cc: Anders Björnerstedt; Hans Feldt; Zoran Milinkovic; 
opensaf-devel@lists.sourceforge.net; Anders Widell; praveen.malv...@oracle.com
Subject: Re: [PATCH 2 of 7] NTF: Adapt NTF common library to support long DNs 
[#873] v3

Hi,

Could you point out the endianness problem that is mentioned in the review 
request Thanks, Mathi.

- minh.c...@dektech.com.au wrote:

 osaf/libs/common/ntfsv/Makefile.am |1 +
  osaf/libs/common/ntfsv/include/ntfsv_mem.h |7 +
  osaf/libs/common/ntfsv/ntfsv_enc_dec.c |   37 --
  osaf/libs/common/ntfsv/ntfsv_mem.c |  151
 +++-
  4 files changed, 175 insertions(+), 21 deletions(-)
 
 
 (1)Fix endian issue in ntfs_sanamet_length, ntfsv_sanamet_alloc, 
 ntfsv_sanamet_steal
 
 diff --git a/osaf/libs/common/ntfsv/Makefile.am
 b/osaf/libs/common/ntfsv/Makefile.am
 --- a/osaf/libs/common/ntfsv/Makefile.am
 +++ b/osaf/libs/common/ntfsv/Makefile.am
 @@ -23,6 +23,7 @@ SUBDIRS = include
  noinst_LTLIBRARIES = libntfsv_common.la
  
  libntfsv_common_la_CPPFLAGS = \
 + -DSA_EXTENDED_NAME_SOURCE \
   $(AM_CPPFLAGS) \
   -I$(top_srcdir)/osaf/libs/common/ntfsv/include
  
 diff --git a/osaf/libs/common/ntfsv/include/ntfsv_mem.h
 b/osaf/libs/common/ntfsv/include/ntfsv_mem.h
 --- a/osaf/libs/common/ntfsv/include/ntfsv_mem.h
 +++ b/osaf/libs/common/ntfsv/include/ntfsv_mem.h
 @@ -97,6 +97,13 @@ extern C {
   void
 ntfsv_filter_obj_cr_del_free(SaNtfObjectCreateDeleteNotificationFilter
 T
 *f);
   void
 ntfsv_filter_attr_ch_free(SaNtfAttributeChangeNotificationFilterT
 *f);
  
 + SaAisErrorT ntfsv_sanamet_copy(SaNameT* pDes, SaNameT* pSrc);
 + bool ntfsv_sanamet_is_valid(const SaNameT* pName);
 + void ntfsv_sanamet_clone_strptr(SaNameT* pName);
 + SaStringT ntfs_sanamet_strdup(SaNameT* pName);
 + size_t ntfs_sanamet_length(const SaNameT* pName);
 + void ntfs_sanamet_steal(SaStringT value, size_t length, SaNameT*
 pName);
 + void ntfs_sanamet_alloc(SaConstStringT value, size_t length,
 SaNameT* pName);
  #ifdef  __cplusplus
  }
  #endif
 diff --git a/osaf/libs/common/ntfsv/ntfsv_enc_dec.c
 b/osaf/libs/common/ntfsv/ntfsv_enc_dec.c
 --- a/osaf/libs/common/ntfsv/ntfsv_enc_dec.c
 +++ b/osaf/libs/common/ntfsv/ntfsv_enc_dec.c
 @@ -18,6 +18,8 @@
  #include ncsencdec_pub.h
  #include ntfsv_enc_dec.h
  #include ntfsv_mem.h
 +#include osaf_extended_name.h
 +#include saAis.h
  
  typedef union {
   uint32_t uint32_val;
 @@ -334,19 +336,22 @@ static uint32_t decodeSaNtfAttribute(NCS  static 
 uint32_t encodeSaNameT(NCS_UBAID *uba, uint8_t *p8, SaNameT
 *name)
  {
   uint32_t rv;
 - 
   p8 = ncs_enc_reserve_space(uba, 2);
   if (!p8) {
   TRACE(ncs_enc_reserve_space failed);
   return NCSCC_RC_OUT_OF_MEM;
   }
 - if (name-length  SA_MAX_NAME_LENGTH) {
 - LOG_ER(SaNameT length too long %hd, name-length);
 - osafassert(0);
 - }
 - ncs_encode_16bit(p8, name-length);
 - ncs_enc_claim_space(uba, 2);
 - rv = ncs_encode_n_octets_in_uba(uba, name-value,
 (uint32_t)name-length);
 +
 + if (!ntfsv_sanamet_is_valid(name)) {
 + LOG_ER(SaNameT is invalid);
 + osafassert(0);
 + }
 +
 + SaConstStringT value = osaf_extended_name_borrow(name);
 + size_t length = ntfs_sanamet_length(name);
 + ncs_encode_16bit(p8, length);
 + ncs_enc_claim_space(uba, 2);
 + rv = ncs_encode_n_octets_in_uba(uba, (uint8_t*) value, (uint32_t)
 length);
   return rv;
  }
  
 @@ -355,14 +360,22 @@ static uint32_t decodeSaNameT(NCS_UBAID 
   uint8_t local_data[2];
   uint32_t rv;
   p8 = ncs_dec_flatten_space(uba, local_data, 2);
 - name-length = ncs_decode_16bit(p8);
 - if (name-length  SA_MAX_NAME_LENGTH) {
 - LOG_ER(SaNameT length too long: %hd, name-length);
 + size_t length = ncs_decode_16bit(p8);
 + if (length  kMaxDnLength) {
 + LOG_ER(SaNameT length too long: %zu, length);
   /* this should not happen */
   osafassert(0);
   }
   ncs_dec_skip_space

[devel] [PATCH 3 of 3] immtests: add test cases for OI callback timeout [#16]

2014-07-17 Thread Zoran Milinkovic
 tests/immsv/implementer/test_cleanup.c   |1 +
 tests/immsv/implementer/test_saImmOiImplementerSet.c |  336 +++
 2 files changed, 337 insertions(+), 0 deletions(-)


Test cases cover OI callback timeout and timeout on searching for an object 
with RTA

diff --git a/tests/immsv/implementer/test_cleanup.c 
b/tests/immsv/implementer/test_cleanup.c
--- a/tests/immsv/implementer/test_cleanup.c
+++ b/tests/immsv/implementer/test_cleanup.c
@@ -31,6 +31,7 @@ static char *objects[] = {

123456789012345678901234567890123456789012345678901234567890123,123456789012345678901234567890123456789012345678901234567890123,123456789012345678901234567890123456789012345678901234567890123,rdn=root,
Test,rdn=root,
rdn=root,
+   obj=1,
NULL
 };
 
diff --git a/tests/immsv/implementer/test_saImmOiImplementerSet.c 
b/tests/immsv/implementer/test_saImmOiImplementerSet.c
--- a/tests/immsv/implementer/test_saImmOiImplementerSet.c
+++ b/tests/immsv/implementer/test_saImmOiImplementerSet.c
@@ -16,6 +16,10 @@
  */
 
 #include immtest.h
+#include unistd.h
+#include pthread.h
+#include poll.h
+#include stdlib.h
 
 void saImmOiImplementerSet_01(void)
 {
@@ -70,6 +74,332 @@ void saImmOiImplementerSet_05(void)
 safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
 }
 
+int saImmOiImplementerSet_callback_wait = 15;
+SaImmClassNameT saImmOiImplementerSet_className = NULL;
+
+static SaAisErrorT saImmOiImplementerSet_ModifyCallback(SaImmOiHandleT 
immOiHandle, SaImmOiCcbIdT ccbId,
+   const SaNameT *objectName, const SaImmAttrModificationT_2 
**attrMods) {
+
+   sleep(saImmOiImplementerSet_callback_wait);
+   return SA_AIS_OK;
+}
+
+static SaAisErrorT saImmOiImplementerSet_RtAttrUpdateCallbackT(SaImmOiHandleT 
immOiHandle, const SaNameT *objectName, const SaImmAttrNameT *attributeNames) {
+   SaUint32T attrVal = (SaUint32T)random();
+   SaImmAttrValueT attrValues[1] = { attrVal };
+   SaImmAttrModificationT_2 attrMod = { SA_IMM_ATTR_VALUES_REPLACE, { 
attr1, SA_IMM_ATTR_SAUINT32T, 1, attrValues } };
+   const SaImmAttrModificationT_2 *attrMods[2] = { attrMod, NULL };
+
+   sleep(saImmOiImplementerSet_callback_wait);
+
+   saImmOiRtObjectUpdate_2(immOiHandle, objectName, attrMods);
+
+   return SA_AIS_OK;
+}
+
+void *saImmOiImplementerSet_modify_thread(void *arg) {
+   int *ready = (int *)arg;
+   SaImmOiHandleT immOiHandle;
+   SaSelectionObjectT selObj;
+   SaImmOiCallbacksT_2 configImmOiCallbacks = { NULL , NULL , NULL , NULL 
, NULL , NULL , saImmOiImplementerSet_ModifyCallback , NULL };
+   SaImmOiCallbacksT_2 rtImmOiCallbacks = { NULL , NULL , NULL , NULL , 
NULL , NULL , NULL , saImmOiImplementerSet_RtAttrUpdateCallbackT };
+   SaNameT rdn = { 5, obj=1 };
+   struct pollfd pfd;
+   int rc = 1;
+   int config = 1;
+
+   assert(saImmOiImplementerSet_className != NULL);
+
+   if(!strcmp(saImmOiImplementerSet_className, runtimeClassName)) {
+   SaImmAttrValueT attrVal[1] = { rdn };
+   SaImmAttrValuesT_2 rdnVal = { rdn, SA_IMM_ATTR_SANAMET, 1, 
attrVal };
+   const SaImmAttrValuesT_2 *attrValues[2] = { rdnVal, NULL };
+
+   safassert(saImmOiInitialize_2(immOiHandle, rtImmOiCallbacks, 
immVersion), SA_AIS_OK);
+   safassert(saImmOiSelectionObjectGet(immOiHandle, selObj), 
SA_AIS_OK);
+   safassert(saImmOiImplementerSet(immOiHandle, 
(SaImmOiImplementerNameT)__FUNCTION__), SA_AIS_OK);
+   safassert(saImmOiRtObjectCreate_2(immOiHandle, 
runtimeClassName, NULL, attrValues), SA_AIS_OK);
+   config = 0;
+   } else {
+   safassert(saImmOiInitialize_2(immOiHandle, 
configImmOiCallbacks, immVersion), SA_AIS_OK);
+   safassert(saImmOiSelectionObjectGet(immOiHandle, selObj), 
SA_AIS_OK);
+   safassert(saImmOiImplementerSet(immOiHandle, 
(SaImmOiImplementerNameT)__FUNCTION__), SA_AIS_OK);
+   safassert(saImmOiClassImplementerSet(immOiHandle, 
saImmOiImplementerSet_className), SA_AIS_OK);
+   }
+
+   *ready = 1;
+
+   while((!rc || rc == 1)  *ready) {
+   pfd.fd = selObj;
+   pfd.events = POLLIN;
+   rc = poll(pfd, 1, 100);
+
+   safassert(saImmOiDispatch(immOiHandle, SA_DISPATCH_ONE), 
SA_AIS_OK);
+   }
+
+   if(!config) {
+   safassert(saImmOiRtObjectDelete(immOiHandle, rdn), SA_AIS_OK);
+   } else {
+   safassert(saImmOiClassImplementerRelease(immOiHandle, 
saImmOiImplementerSet_className), SA_AIS_OK);
+   }
+
+   safassert(saImmOiImplementerClear(immOiHandle), SA_AIS_OK);
+   safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
+
+   *ready = 1;
+
+   return NULL;
+}
+
+void saImmOiImplementerSet_06(void)
+{
+   SaImmHandleT immHandle;
+   SaImmAdminOwnerHandleT ownerHandle;
+   

[devel] [PATCH 1 of 3] imm: add support for configurable OI callback timeout [#16]

2014-07-17 Thread Zoran Milinkovic
 osaf/libs/common/immsv/immsv_evt.c   |   54 +++-
 osaf/libs/common/immsv/include/immsv_evt.h   |4 +
 osaf/libs/common/immsv/include/immsv_evt_model.h |1 +
 osaf/services/saf/immsv/immd/immd_evt.c  |9 +-
 osaf/services/saf/immsv/immnd/ImmModel.cc|  101 --
 osaf/services/saf/immsv/immnd/ImmModel.hh|6 +-
 osaf/services/saf/immsv/immnd/ImmSearchOp.cc |   24 ++---
 osaf/services/saf/immsv/immnd/ImmSearchOp.hh |   19 +--
 osaf/services/saf/immsv/immnd/immnd_evt.c|   46 -
 osaf/services/saf/immsv/immnd/immnd_init.h   |9 +-
 10 files changed, 200 insertions(+), 73 deletions(-)


When an implementer is set, the configurable timeout is sent to IMM service.
The configurable timeout is used for calculating timeouts for OI callbacks and 
waiting on search replies from RTA update callback.

diff --git a/osaf/libs/common/immsv/immsv_evt.c 
b/osaf/libs/common/immsv/immsv_evt.c
--- a/osaf/libs/common/immsv/immsv_evt.c
+++ b/osaf/libs/common/immsv/immsv_evt.c
@@ -64,6 +64,7 @@ static const char *immd_evt_names[] = {
IMMD_EVT_ND2D_FEVS_REQ_2,
IMMD_EVT_ND2D_LOADING_COMPLETED,
IMMD_EVT_ND2D_2PBE_PRELOAD,
+   IMMD_EVT_ND2D_IMPLSET_REQ_2,
undefined (high)
 };
 
@@ -173,6 +174,8 @@ static const char *immnd_evt_names[] = {
IMMND_EVT_A2ND_CL_TIMEOUT,
IMMND_EVT_A2ND_ACCESSOR_GET,
IMMND_EVT_A2ND_CCB_VALIDATE,  /* saImmOmCcbValidate */
+   IMMND_EVT_A2ND_OI_IMPL_SET_2, /* saImmOiImplementerSet */
+   IMMND_EVT_D2ND_IMPLSET_RSP_2, /* Implementer set reply from D with 
impl id */
undefined (high)
 };
 
@@ -1511,7 +1514,8 @@ static uint32_t immsv_evt_enc_sublevels(
(i_evt-info.immd.type == IMMD_EVT_ND2D_FEVS_REQ_2)) {
IMMSV_OCTET_STRING *os = 
(i_evt-info.immd.info.fevsReq.msg);
immsv_evt_enc_inline_string(o_ub, os);
-   } else if (i_evt-info.immd.type == IMMD_EVT_ND2D_IMPLSET_REQ) {
+   } else if ((i_evt-info.immd.type == IMMD_EVT_ND2D_IMPLSET_REQ) 
||
+   (i_evt-info.immd.type == 
IMMD_EVT_ND2D_IMPLSET_REQ_2)) {
IMMSV_OCTET_STRING *os = 
(i_evt-info.immd.info.impl_set.r.impl_name);
if(!immsv_evt_enc_inline_text(__LINE__, o_ub, os)) {
return NCSCC_RC_OUT_OF_MEM;
@@ -1564,7 +1568,9 @@ static uint32_t immsv_evt_enc_sublevels(
IMMSV_OCTET_STRING *os = 
(i_evt-info.immnd.info.fevsReq.msg);
immsv_evt_enc_inline_string(o_ub, os);
} else if ((i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_IMPL_SET) ||
+  (i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_IMPL_SET_2) ||
   (i_evt-info.immnd.type == 
IMMND_EVT_D2ND_IMPLSET_RSP) ||
+  (i_evt-info.immnd.type == 
IMMND_EVT_D2ND_IMPLSET_RSP_2) ||
   (i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_CL_IMPL_SET) ||
   (i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_CL_IMPL_REL) ||
   (i_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_OBJ_IMPL_SET) ||
@@ -2141,7 +2147,8 @@ static uint32_t immsv_evt_dec_sublevels(
(o_evt-info.immd.type == IMMD_EVT_ND2D_FEVS_REQ_2)) {
IMMSV_OCTET_STRING *os = 
(o_evt-info.immd.info.fevsReq.msg);
immsv_evt_dec_inline_string(i_ub, os);
-   } else if (o_evt-info.immd.type == IMMD_EVT_ND2D_IMPLSET_REQ) {
+   } else if ((o_evt-info.immd.type == IMMD_EVT_ND2D_IMPLSET_REQ) 
||
+   (o_evt-info.immd.type == 
IMMD_EVT_ND2D_IMPLSET_REQ_2)) {
IMMSV_OCTET_STRING *os = 
(o_evt-info.immd.info.impl_set.r.impl_name);
immsv_evt_dec_inline_string(i_ub, os);
} else if (o_evt-info.immd.type == 
IMMD_EVT_ND2D_OI_OBJ_MODIFY) {
@@ -2177,7 +2184,9 @@ static uint32_t immsv_evt_dec_sublevels(
immsv_evt_dec_inline_string(i_ub, os);
} else
if ((o_evt-info.immnd.type == IMMND_EVT_A2ND_OI_IMPL_SET) 
||
+   (o_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_IMPL_SET_2) ||
(o_evt-info.immnd.type == IMMND_EVT_D2ND_IMPLSET_RSP) 
||
+   (o_evt-info.immnd.type == 
IMMND_EVT_D2ND_IMPLSET_RSP_2) ||
(o_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_CL_IMPL_SET) ||
(o_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_CL_IMPL_REL) ||
(o_evt-info.immnd.type == 
IMMND_EVT_A2ND_OI_OBJ_IMPL_SET) ||
@@ -2949,6 +2958,7 @@ static uint32_t immsv_evt_enc_toplevel(I
break;
 
case IMMD_EVT_ND2D_IMPLSET_REQ: /*OiImplementerSet */
+   case 

Re: [devel] [PATCH 0 of 4] Review Request for imm: add support for long DN [#886]

2014-07-23 Thread Zoran Milinkovic
Hi Neelakanta,

The reason you are getting these errors is that you didn't enable extended 
names on server side.
You must add to immnd.conf:
export SA_ENABLE_EXTENDED_NAMES=1

I'll add this line to immnd.conf.

Best regards,
Zoran


-Original Message-
From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com] 
Sent: den 23 juli 2014 16:48
To: Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0 of 4] Review Request for imm: add support for long DN 
[#886]

Hi zoran,

Reviewed and tested the patch.
  have the same comments as AndersBj.
Regarding the patch 4 add test cases for long DN
Ack  for the first three patches.

But for patch 4:
Ack, when immomtest and immoitest is fixed.

The test cases are not running:

I enabled longdDns, Following are the errors.:

immcfg -m -a longDnsAllowed=1 opensafImm=opensafImm,safApp=safImmService

root@Slot-3 ~]# immoitest --longDn 7

Suite 7: Long DN
 1  FAILEDSA_AIS_OK - Object create callback (expected 
SA_AIS_OK, got SA_AIS_ERR_NAME_TOO_LONG)
error: in test_saImmOiLongDn.c at 52: SA_AIS_ERR_NAME_TOO_LONG, expected 
SA_AIS_OK - exiting


syslog:

Jul 23 20:10:35 Slot-3 osafimmnd[3056]: NO implementer for class 
'TestClassConfig' is test_saImmOiLongDn.c = class extent is safe.
Jul 23 20:10:35 Slot-3 osafimmnd[3056]: NO ERR_NAME_TOO_LONG: RDN 
attribute has long name. Support for extended names is not enabled
Jul 23 20:10:35 Slot-3 osafimmnd[3056]: NO implementer for class 
'TestClassConfig' is released = class extent is UNSAFE


[root@Slot-3 ~]# immomtest --longDn 8

Suite 8: Long DN
error: in test_saImmOmLongDn.c at 91: SA_AIS_ERR_NOT_EXIST, expected 
SA_AIS_OK - exiting


syslog:

Jul 23 20:11:56 Slot-3 osafimmnd[3056]: NO ERR_LIBRARY: attr 'attr' of 
type SaNameT is too long:307. Extended names is not enabled
Jul 23 20:11:56 Slot-3 osafimmnd[3056]: NO ERR_INVALID_PARAM: Problem 
with new class 'LongDnClass'


/Neel.

On Monday 14 July 2014 08:10 PM, Zoran Milinkovic wrote:
 Summary: imm: add support for long DN [#886]
 Review request for Trac Ticket(s): 886
 Peer Reviewer(s): Neelakanta, Anders
 Pull request to: Zoran
 Affected branch(es): default(4.5)
 Development branch: default(4.5)

 
 Impacted area   Impact y/n
 
   Docsn
   Build systemn
   RPM/packaging   n
   Configuration files n
   Startup scripts n
   SAF servicesy
   OpenSAF servicesn
   Core libraries  n
   Samples n
   Tests   y
   Other   n


 Comments (indicate scope for each y above):
 -

 changeset 60ba40f3a2b55b564b73630d38bb594ac4eeced7
 Author:   Zoran Milinkovic zoran.milinko...@ericsson.com
 Date: Mon, 14 Jul 2014 16:29:00 +0200

   imm: add support for long DN to IMM service [#886]

   The patch contains a code for the support long DNs in IMM service

 changeset 6c8c17209176a70e3d922d5294cf02dd489590bb
 Author:   Zoran Milinkovic zoran.milinko...@ericsson.com
 Date: Mon, 14 Jul 2014 16:30:49 +0200

   imm: add support for long DN to IMM library [#886]

   The patch contains a code for the support long DNs in IMM library

 changeset 54ee330a6132782883d3df036f99298df9153dad
 Author:   Zoran Milinkovic zoran.milinko...@ericsson.com
 Date: Mon, 14 Jul 2014 16:31:40 +0200

   imm: add support for long DN to IMM tools [#886]

   The patch contains a code for the support long DNs in IMM tools

 changeset e003b7c7c3e7054811ec237ba48d4562b7105432
 Author:   Zoran Milinkovic zoran.milinko...@ericsson.com
 Date: Mon, 14 Jul 2014 16:35:03 +0200

   imm: add test cases for long DN [#886]

   New test cases have been added to immomtest and immoitest. If
   SA_ENABLE_EXTENDED_NAMES is not set, immomtest and immoitest can use
   --longDn parameter to set SA_ENABLE_EXTENDED_NAMES for testing.


 Added Files:
 
   tests/immsv/implementer/test_saImmOiLongDn.c
   tests/immsv/management/test_saImmOmLongDn.c


 Complete diffstat:
 --
   osaf/libs/agents/saf/imma/Makefile.am|4 +-
   osaf/libs/agents/saf/imma/imma_cb.h  |1 +
   osaf/libs/agents/saf/imma/imma_db.c  |3 +
   osaf/libs/agents/saf/imma/imma_init.c|   28 ---
   osaf/libs/agents/saf/imma/imma_oi_api.c  |  139 
 ++-
   osaf/libs/agents/saf/imma/imma_om_api.c  |  228 
 -
   osaf/libs/agents/saf/imma/imma_proc.c|  134 
 --
   osaf/libs/common/immsv/Makefile.am   |1 +
   osaf/libs/common/immsv/immpbe_dump.cc|   30 +++
   osaf/libs/common/immsv/immsv_evt.c   |  111 
 ++-
   osaf/libs/common/immsv/include

[devel] [PATCH 0 of 4] Review Request for imm: add support for longDN [#886]

2014-07-24 Thread Zoran Milinkovic
Summary: imm: add support for long DN [#886]
Review request for Trac Ticket(s): 886
Peer Reviewer(s): Neelakanta, Anders
Pull request to: Zoran
Affected branch(es): default(4.5)
Development branch: default(4.5)


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each y above):
-

changeset b29dc6b34fa33948bf6e3d390ad908257fa353d6
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 24 Jul 2014 10:07:37 +0200

imm: add support for long DN to IMM service [#886]

The patch contains a code for the support long DNs in IMM service

changeset c65950deb0e2818a2225cea0cf51b2683514638e
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 24 Jul 2014 10:08:50 +0200

imm: add support for long DN to IMM library [#886]

The patch contains a code for the support long DNs in IMM library

changeset a5d2bd5f66470876670e9d195c447a79c2a79267
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 24 Jul 2014 10:11:28 +0200

immtools: add support for long DN to IMM tools [#886]

The patch contains a code for the support long DNs in IMM tools

changeset 234bac18dcc49bd34e717bb415dad1c4d67a7910
Author: Zoran Milinkovic zoran.milinko...@ericsson.com
Date:   Thu, 24 Jul 2014 10:14:40 +0200

immtest: add test cases for long DN [#886]

New test cases have been added to immomtest and immoitest. If
SA_ENABLE_EXTENDED_NAMES is not set, immomtest and immoitest can use
--longDn parameter to set SA_ENABLE_EXTENDED_NAMES for testing. Option 
-h
and --help have been added to show the usage of immomtest and immoitest


Added Files:

 tests/immsv/implementer/test_saImmOiLongDn.c
 tests/immsv/management/test_saImmOmLongDn.c


Complete diffstat:
--
 osaf/libs/agents/saf/imma/Makefile.am  |4 +-
 osaf/libs/agents/saf/imma/imma_cb.h|1 +
 osaf/libs/agents/saf/imma/imma_db.c|3 +
 osaf/libs/agents/saf/imma/imma_init.c  |   28 ---
 osaf/libs/agents/saf/imma/imma_oi_api.c|  139 
++
 osaf/libs/agents/saf/imma/imma_om_api.c|  228 
+++
 osaf/libs/agents/saf/imma/imma_proc.c  |  134 
+++--
 osaf/libs/common/immsv/Makefile.am |1 +
 osaf/libs/common/immsv/immpbe_dump.cc  |   30 +++
 osaf/libs/common/immsv/immsv_evt.c |  134 
-
 osaf/libs/common/immsv/include/immsv_api.h |5 +
 osaf/services/saf/immsv/config/immnd.conf  |3 +
 osaf/services/saf/immsv/immd/Makefile.am   |2 +-
 osaf/services/saf/immsv/immd/immd_amf.c|3 +-
 osaf/services/saf/immsv/immd/immd_evt.c|3 +-
 osaf/services/saf/immsv/immloadd/Makefile.am   |1 +
 osaf/services/saf/immsv/immloadd/imm_loader.cc |   54 ++
 osaf/services/saf/immsv/immnd/ImmModel.cc  |  245 

 osaf/services/saf/immsv/immnd/Makefile.am  |2 +-
 osaf/services/saf/immsv/immnd/immnd_amf.c  |3 +-
 osaf/services/saf/immsv/immnd/immnd_evt.c  |   36 +
 osaf/services/saf/immsv/immnd/immnd_proc.c |6 +-
 osaf/services/saf/immsv/immpbed/Makefile.am|1 +
 osaf/services/saf/immsv/immpbed/immpbe_daemon.cc   |  130 
++--
 osaf/tools/safimm/immadm/Makefile.am   |1 +
 osaf/tools/safimm/immadm/imm_admin.c   |   14 +--
 osaf/tools/safimm/immcfg/Makefile.am   |1 +
 osaf/tools/safimm/immcfg/imm_cfg.c |   22 +++--
 osaf/tools/safimm/immcfg/imm_import.cc |   61 +---
 osaf/tools/safimm/immdump/Makefile.am  |1 +
 osaf/tools/safimm/immdump/imm_xmlw_dump.cc |   10 +-
 osaf/tools/safimm/immfind/Makefile.am  |1 +
 osaf/tools/safimm/immfind/imm_find.c   |   16 +--
 osaf/tools/safimm/immlist/Makefile.am  |1 +
 osaf/tools/safimm/immlist/imm_list.c   |8 +-
 osaf/tools/safimm/src/immutil.c|   92 
+++--
 tests/immsv/common/immtest.c   |   60

  1   2   3   4   5   6   7   >