Ack, code review only.
Thanks,
Praveen
On 06-Feb-17 1:28 PM, Nguyen TK Luu wrote:
> src/amf/amfd/comp.cc | 15 +++++++++++++++
> src/amf/amfd/ndproc.cc | 3 ++-
> src/amf/amfnd/compdb.cc | 2 ++
> src/amf/common/amf_defs.h | 4 +++-
> src/amf/config/amf_classes.xml | 1 +
> 5 files changed, 23 insertions(+), 2 deletions(-)
>
>
> Current OpenSAF implementation defines the attribute saAmfCompCmdEnv
> in the SaAmfComp class as non-writable according to last AMF specification.
> This restriction doesn't allow the upgrade of environment attributes defined
> at component instance, or to remove it.
>
> The attribute was made writable in an errata to the AMF model
> (www.saforum.org/HOA/assn16627/images/SAI-IM-XMI-A.04.02.errata.xml.zip).
> OpenSAF should comply to this change in the errata to enable the upgrade of
> environment attributes defined at component instance level.
>
> diff --git a/src/amf/amfd/comp.cc b/src/amf/amfd/comp.cc
> --- a/src/amf/amfd/comp.cc
> +++ b/src/amf/amfd/comp.cc
> @@ -1,6 +1,7 @@
> /* -*- OpenSAF -*-
> *
> * (C) Copyright 2008 The OpenSAF Foundation
> + * (C) Copyright 2017 Ericsson AB - All Rights Reserved.
> *
> * This program is distributed in the hope that it will be useful, but
> * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
> @@ -963,6 +964,15 @@
> }
> }
> }
> + } else if (!strcmp(attribute->attrName, "saAmfCompCmdEnv")) {
> + if (value_is_deleted == true)
> + continue;
> + char *param_val = *(static_cast<char **>(value));
> + if (nullptr == param_val) {
> + report_ccb_validation_error(opdata,
> + "Modification of
> saAmfCompCmdEnv Fail, nullptr arg");
> + goto done;
> + }
> } else if (!strcmp(attribute->attrName,
> "saAmfCompInstantiateCmdArgv")) {
> if (value_is_deleted == true)
> continue;
> @@ -1314,6 +1324,11 @@
> param.attr_id = saAmfCompType_ID;
> param.name_sec = *dn;
>
> + } else if (!strcmp(attribute->attrName, "saAmfCompCmdEnv")) {
> + /* Node director will reread configuration from IMM
> */
> + param.attr_id = saAmfCompCmdEnv_ID;
> + TRACE("saAmfCompCmdEnv modified.");
> +
> } else if (!strcmp(attribute->attrName,
> "saAmfCompInstantiateCmdArgv")) {
>
> /* Node director will reread configuration from IMM */
> diff --git a/src/amf/amfd/ndproc.cc b/src/amf/amfd/ndproc.cc
> --- a/src/amf/amfd/ndproc.cc
> +++ b/src/amf/amfd/ndproc.cc
> @@ -1,6 +1,7 @@
> /* -*- OpenSAF -*-
> *
> * (C) Copyright 2008 The OpenSAF Foundation
> + * (C) Copyright 2017 Ericsson AB - All Rights Reserved.
> *
> * This program is distributed in the hope that it will be useful, but
> * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
> @@ -270,7 +271,7 @@
> goto done;
> }
>
> - LOG_ER("Operation request FAILED, sender %x, '%s'",
> + LOG_WA("Operation request FAILED, sender %x, '%s'",
> n2d_msg->msg_info.n2d_op_req.node_id,
> osaf_extended_name_borrow(&n2d_msg->msg_info.n2d_op_req.param_info.name));
>
> done:
> diff --git a/src/amf/amfnd/compdb.cc b/src/amf/amfnd/compdb.cc
> --- a/src/amf/amfnd/compdb.cc
> +++ b/src/amf/amfnd/compdb.cc
> @@ -1,6 +1,7 @@
> /* -*- OpenSAF -*-
> *
> * (C) Copyright 2008 The OpenSAF Foundation
> + * (C) Copyright 2017 Ericsson AB - All Rights Reserved.
> *
> * This program is distributed in the hope that it will be useful, but
> * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
> @@ -366,6 +367,7 @@
> case saAmfCompCleanupCmd_ID:
> case saAmfCompAmStartCmd_ID:
> case saAmfCompAmStopCmd_ID:
> + case saAmfCompCmdEnv_ID:
> comp->config_is_valid = 0;
> break;
> case saAmfCompInstantiateTimeout_ID:
> diff --git a/src/amf/common/amf_defs.h b/src/amf/common/amf_defs.h
> --- a/src/amf/common/amf_defs.h
> +++ b/src/amf/common/amf_defs.h
> @@ -1,6 +1,7 @@
> /* -*- OpenSAF -*-
> *
> * (C) Copyright 2008 The OpenSAF Foundation
> + * (C) Copyright 2017 Ericsson AB - All Rights Reserved.
> *
> * This program is distributed in the hope that it will be useful, but
> * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
> @@ -247,7 +248,8 @@
> saAmfCompCurrProxyName_ID = 37,
> saAmfCompAMEnable_ID = 38,
> saAmfCompProxyStatus_ID = 39,
> - saAmfCompType_ID,
> + saAmfCompType_ID = 40,
> + saAmfCompCmdEnv_ID,
> } AVSV_AMF_COMP_ATTR_ID;
>
> /* Attribute ID enum for the saAmfCompType class */
> diff --git a/src/amf/config/amf_classes.xml b/src/amf/config/amf_classes.xml
> --- a/src/amf/config/amf_classes.xml
> +++ b/src/amf/config/amf_classes.xml
> @@ -1056,6 +1056,7 @@
> <name>saAmfCompCmdEnv</name>
> <type>SA_STRING_T</type>
> <category>SA_CONFIG</category>
> + <flag>SA_WRITABLE</flag>
> <flag>SA_MULTI_VALUE</flag>
> </attr>
> <attr>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel