[devel] [PATCH 1 of 1] amfnd: during headless donot read config from imm [#1916]

2016-07-18 Thread nagendra . k
 osaf/services/saf/amf/amfnd/compdb.cc |  14 --
 1 files changed, 12 insertions(+), 2 deletions(-)


During headless, IMM returns TRY_AGAIN.
Also, if Imm is restarted during headless state, Imm returns TRY_AGAIN.
If Amfnd waits for TRY_AGAIN, then Amf Watchdog will kill it.
So, Amfnd should not read imm config and reuse the old config
for instantiating a component.

diff --git a/osaf/services/saf/amf/amfnd/compdb.cc 
b/osaf/services/saf/amf/amfnd/compdb.cc
--- a/osaf/services/saf/amf/amfnd/compdb.cc
+++ b/osaf/services/saf/amf/amfnd/compdb.cc
@@ -1908,9 +1908,19 @@ int avnd_comp_config_reinit(AVND_COMP *c
TRACE_1("%s", comp->name.value);
 
error = saImmOmInitialize_cond(&immOmHandle, nullptr, &immVersion);
+   /* If this is a case of headless, then proceed without reading the
+  configuration. */
if (error != SA_AIS_OK) {
-   LOG_CR("saImmOmInitialize FAILED for '%s'", comp->name.value);
-   goto done1;
+   if (avnd_cb->is_avd_down == true) {
+   LOG_WA("saImmOmInitialize FAILED(error: '%u') for '%s' 
in"
+   " headless state, continuing with old 
configuration",
+   error, comp->name.value);
+   res = 0;
+   goto done1;
+   } else {
+   LOG_CR("saImmOmInitialize FAILED for '%s', error %u", 
comp->name.value, error);
+   goto done1;
+   }
}
error = immutil_saImmOmAccessorInitialize(immOmHandle, &accessorHandle);
if (error != SA_AIS_OK) {

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
___
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 amfnd: during headless donot read config from imm [#1916]

2016-07-18 Thread nagendra . k
Summary: amfnd: during headless donot read config from imm [#1916]
Review request for Trac Ticket(s): #1916
Peer Reviewer(s): Amf Dev
Pull request to: <>
Affected branch(es): 5.0.x
Development branch: 5.0.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 163876cb89a860df56381ea2afb1c0ef7456f580
Author: Nagendra Kumar
Date:   Mon, 18 Jul 2016 18:04:11 +0530

amfnd: during headless donot read config from imm [#1916] During 
headless,
IMM returns TRY_AGAIN. Also, if Imm is restarted during headless state, 
Imm
returns TRY_AGAIN. If Amfnd waits for TRY_AGAIN, then Amf Watchdog will 
kill
it. So, Amfnd should not read imm config and reuse the old config for
instantiating a component.


Complete diffstat:
--
 osaf/services/saf/amf/amfnd/compdb.cc |  14 --
 1 files changed, 12 insertions(+), 2 deletions(-)


Testing Commands:
-
Please check the ticket.

Testing, Expected Results:
--
Component should be restarted successfully.

Conditions of Submission:
-
Ack from Amf Dev

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.


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
___
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 libs/core: do not assume SaNameT is null terminated in osaf_encode_sanamet [#1674]

2016-07-18 Thread Gary Lee
Summary: libs/core: do not assume SaNameT is null terminated in 
osaf_encode_sanamet [#1674] 
Review request for Trac Ticket(s): 1674 
Peer Reviewer(s): ramesh.bet...@oracle.com, anders.wid...@ericsson.com 
Pull request to: <>
Affected branch(es): 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  y 
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-

changeset 7804:51007c69ef63 broke AMF unit tests as the unit tests do not 
terminate legacy SaNameT variables
with a NULL character.

changeset 8aea5368e62acfd2d3734c96d6c63fe3f94034d2
Author: Gary Lee 
Date:   Tue, 19 Jul 2016 11:28:29 +1000

libs/core: do not assume SaNameT is null terminated in 
osaf_encode_sanamet
[#1674]

modify osaf_encode_sanamet() so it does not assume the SaNameT varable 
being
encoded is null terminated


Complete diffstat:
--
 osaf/libs/core/include/ncsencdec_pub.h |   1 -
 osaf/libs/core/leap/hj_enc.c   |  55 
+--
 2 files changed, 21 insertions(+), 35 deletions(-)


Testing Commands:
-
run 'make check' in osaf/services/saf/amf/amfd/tests

Testing, Expected Results:
--
unit tests should pass

Conditions of Submission:
-
 <>


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.


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] libs/core: do not assume SaNameT is null terminated in osaf_encode_sanamet [#1674]

2016-07-18 Thread Gary Lee
 osaf/libs/core/include/ncsencdec_pub.h |   1 -
 osaf/libs/core/leap/hj_enc.c   |  55 -
 2 files changed, 21 insertions(+), 35 deletions(-)


modify osaf_encode_sanamet() so it does not assume the SaNameT varable being 
encoded
is null terminated

diff --git a/osaf/libs/core/include/ncsencdec_pub.h 
b/osaf/libs/core/include/ncsencdec_pub.h
--- a/osaf/libs/core/include/ncsencdec_pub.h
+++ b/osaf/libs/core/include/ncsencdec_pub.h
@@ -153,7 +153,6 @@ void osaf_encode_uint64(NCS_UBAID *ub, u
 void osaf_decode_uint64(NCS_UBAID *ub, uint64_t *to);
 void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name);
 void osaf_decode_sanamet(NCS_UBAID *ub, SaNameT *name);
-void osaf_encode_sanamet_o2(NCS_UBAID *ub, SaConstStringT name);
 void osaf_encode_saconststring(NCS_UBAID *ub, SaConstStringT str);
 void osaf_encode_satimet(NCS_UBAID *ub, SaTimeT time);
 void osaf_decode_satimet(NCS_UBAID *ub, SaTimeT *time);
diff --git a/osaf/libs/core/leap/hj_enc.c b/osaf/libs/core/leap/hj_enc.c
--- a/osaf/libs/core/leap/hj_enc.c
+++ b/osaf/libs/core/leap/hj_enc.c
@@ -378,13 +378,29 @@ void osaf_decode_uint64(NCS_UBAID *ub, u
 
 void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name)
 {
-   TRACE_ENTER();
+   int i;
+   const size_t len = osaf_extended_name_length(name);
+   SaConstStringT str = osaf_extended_name_borrow(name);
 
-   SaConstStringT str = osaf_extended_name_borrow(name);
-   TRACE("str %s (%zu)", str, osaf_extended_name_length(name));
-   osaf_encode_sanamet_o2(ub, str);
+   if (len < SA_MAX_UNEXTENDED_NAME_LENGTH) {
+   // encode a fixed 256 char string, to ensure
+   // we are backwards compatible
+   osaf_encode_uint16(ub, len);
 
-   TRACE_LEAVE();
+   for (i = 0; i < len; i++) {
+   osaf_encode_uint8(ub, str[i]);
+   }
+
+   // need to encode SA_MAX_UNEXTENDED_NAME_LENGTH characters to 
remain
+   // compatible with legacy osaf_decode_sanamet() [without long 
DN support]
+   for (i = len; i < SA_MAX_UNEXTENDED_NAME_LENGTH; i++) {
+   osaf_encode_uint8(ub, 0);
+   }
+   } else {
+   // encode as a variable string
+   SaConstStringT str = osaf_extended_name_borrow(name);
+   osaf_encode_saconststring(ub, str);
+   }
 }
 
 void osaf_decode_sanamet(NCS_UBAID *ub, SaNameT *name)
@@ -443,35 +459,6 @@ void osaf_decode_saclmnodeaddresst(NCS_U
}
 }
 
-void osaf_encode_sanamet_o2(NCS_UBAID *ub, SaConstStringT name)
-{
-   TRACE_ENTER();
-
-   int i;
-   const size_t len = strlen(name);
-
-   if (len < SA_MAX_UNEXTENDED_NAME_LENGTH) {
-   // encode a fixed 256 char string, to ensure
-   // we are backwards compatible
-   osaf_encode_uint16(ub, len);
-
-   for (i = 0; i < len; i++) {
-   osaf_encode_uint8(ub, name[i]);
-   }
-
-   // need to encode SA_MAX_UNEXTENDED_NAME_LENGTH characters to 
remain
-   // compatible with legacy osaf_decode_sanamet() [without long 
DN support]
-   for (i = len; i < SA_MAX_UNEXTENDED_NAME_LENGTH; i++) {
-   osaf_encode_uint8(ub, 0);
-   }
-   } else {
-   // encode as a variable string
-   osaf_encode_saconststring(ub, name);
-   }
-
-   TRACE_LEAVE();
-}
-
 void osaf_encode_saconststring(NCS_UBAID *ub, SaConstStringT str)
 {
size_t len = strlen(str);

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] amfnd: during headless donot read config from imm [#1916]

2016-07-18 Thread Gary Lee
ack (review only)

Thanks
Gary

> On 18 Jul 2016, at 10:36 PM, nagendr...@oracle.com wrote:
> 
> osaf/services/saf/amf/amfnd/compdb.cc |  14 --
> 1 files changed, 12 insertions(+), 2 deletions(-)
> 
> 
> During headless, IMM returns TRY_AGAIN.
> Also, if Imm is restarted during headless state, Imm returns TRY_AGAIN.
> If Amfnd waits for TRY_AGAIN, then Amf Watchdog will kill it.
> So, Amfnd should not read imm config and reuse the old config
> for instantiating a component.
> 
> diff --git a/osaf/services/saf/amf/amfnd/compdb.cc 
> b/osaf/services/saf/amf/amfnd/compdb.cc
> --- a/osaf/services/saf/amf/amfnd/compdb.cc
> +++ b/osaf/services/saf/amf/amfnd/compdb.cc
> @@ -1908,9 +1908,19 @@ int avnd_comp_config_reinit(AVND_COMP *c
>   TRACE_1("%s", comp->name.value);
> 
>   error = saImmOmInitialize_cond(&immOmHandle, nullptr, &immVersion);
> + /* If this is a case of headless, then proceed without reading the
> +configuration. */
>   if (error != SA_AIS_OK) {
> - LOG_CR("saImmOmInitialize FAILED for '%s'", comp->name.value);
> - goto done1;
> + if (avnd_cb->is_avd_down == true) {
> + LOG_WA("saImmOmInitialize FAILED(error: '%u') for '%s' 
> in"
> + " headless state, continuing with old 
> configuration",
> + error, comp->name.value);
> + res = 0;
> + goto done1;
> + } else {
> + LOG_CR("saImmOmInitialize FAILED for '%s', error %u", 
> comp->name.value, error);
> + goto done1;
> + }
>   }
>   error = immutil_saImmOmAccessorInitialize(immOmHandle, &accessorHandle);
>   if (error != SA_AIS_OK) {


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] clm: fix return error codes in IMM callbacks [#1917]

2016-07-18 Thread Mathivanan Naickan Palanivelu
Ack,
Mathi.

> -Original Message-
> From: Zoran Milinkovic [mailto:zoran.milinko...@ericsson.com]
> Sent: Friday, July 15, 2016 4:13 PM
> To: Mathivanan Naickan Palanivelu
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] clm: fix return error codes in IMM callbacks [#1917]
> 
>  osaf/services/saf/clmsv/clms/clms_imm.c |  12 ++--
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> 
> Wrong used error codes SA_AIS_ERR_NOT_SUPPORTED and
> SA_AIS_ERR_INAVLID_PARAM are replaced with
> SA_AIS_ERR_BAD_OPERATION.
> 
> diff --git a/osaf/services/saf/clmsv/clms/clms_imm.c
> b/osaf/services/saf/clmsv/clms/clms_imm.c
> --- a/osaf/services/saf/clmsv/clms/clms_imm.c
> +++ b/osaf/services/saf/clmsv/clms/clms_imm.c
> @@ -1401,7 +1401,7 @@ static SaAisErrorT clms_imm_ccb_obj_crea
>   /* Find the RDN attribute and store the object DN */
>   while ((attrValue = attr[i++]) != NULL) {
>   if (!strncmp(attrValue->attrName, "safCluster", 10)) {
> - rc = SA_AIS_ERR_NOT_SUPPORTED;
> + rc = SA_AIS_ERR_BAD_OPERATION;
>   goto done;
>   } else if (!strncmp(attrValue->attrName, "safNode",
> 7)) {
>   if (attrValue->attrValueType ==
> SA_IMM_ATTR_SASTRINGT) { @@ -1423,7 +1423,7 @@ static SaAisErrorT
> clms_imm_ccb_obj_crea
> 
>   if ((rt = clms_node_dn_chk(&operation->objectName)) !=
> NCSCC_RC_SUCCESS) {
>   TRACE("Node DN name is incorrect");
> - rc = SA_AIS_ERR_INVALID_PARAM;
> + rc = SA_AIS_ERR_BAD_OPERATION;
>   }
> 
>   done:
> @@ -1452,7 +1452,7 @@ static SaAisErrorT clms_imm_ccb_obj_dele
> 
>   if (!strncmp((const char *)objectName->value, "safCluster=", 11)) {
>   LOG_ER("Deletion of the present single cluster Object not
> supported");
> - rc = SA_AIS_ERR_NOT_SUPPORTED;
> + rc = SA_AIS_ERR_BAD_OPERATION;
>   }
> 
>   TRACE_LEAVE();
> @@ -1547,11 +1547,11 @@ SaAisErrorT clms_node_ccb_comp_modify(Cc
>   }
>   } else if (!strcmp(attribute->attrName,
> "saClmNodeAddressFamily")) {
>   LOG_NO("Modification of saClmNodeAddressFamily
> of object %s not allowed",opdata->objectName.value);
> - rc = SA_AIS_ERR_NOT_SUPPORTED;
> + rc = SA_AIS_ERR_BAD_OPERATION;
>   goto done;
>   } else if (!strcmp(attribute->attrName,
> "saClmNodeAddress")) {
>   LOG_NO("Modification of saClmNodeAddress of
> object %s not allowed",opdata->objectName.value);
> - rc = SA_AIS_ERR_NOT_SUPPORTED;
> + rc = SA_AIS_ERR_BAD_OPERATION;
>   goto done;
>   } else if (!strcmp(attribute->attrName,
> "saClmNodeLockCallbackTimeout")) {
>   SaTimeT Timeout = *((SaTimeT *)value); @@ -1567,7
> +1567,7 @@ SaAisErrorT clms_node_ccb_comp_modify(Cc
>   goto done;
>   } else {
>   LOG_NO("saClmNodeEE attribute change of
> object %s is not supported",opdata->objectName.value);
> - rc = SA_AIS_ERR_NOT_SUPPORTED;
> + rc = SA_AIS_ERR_BAD_OPERATION;
>   goto done;
>   }
>   } else {

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel