On 25-Nov-15 12:42 PM, Quyen Dao wrote:
> Hi Praveen,
>
> When the cluster starts, the saAmfCtDefInstantiationLevel is <Empty>.
>
>      root@SC-1:~# immlist -a saAmfCtDefInstantiationLevel
> safVersion=4.0.0,safCompType=OpenSafCompTypeAMFWDOG
>      saAmfCtDefInstantiationLevel=<Empty>
>
> If I change saAmfCtDefInstantiationLevel to 1 then change it back to
> <Empty>.
> It fails at changing back to <Empty>, the admin op is rejected due to the
> change/intention of your patch
>
>      root@SC-1:~# immcfg -a saAmfCtDefInstantiationLevel=1
> safVersion=4.0.0,safCompType=OpenSafCompTypeAMFWDOG
>      root@SC-1:~# immcfg -a saAmfCtDefInstantiationLevel=""
> safVersion=4.0.0,safCompType=OpenSafCompTypeAMFWDOG
>      error - saImmOmCcbApply FAILED: SA_AIS_ERR_FAILED_OPERATION (21)
>      OI reports: IMM: Validation abort: Completed validation fails
> (ERR_BAD_OPERATION)
>     OI reports: Value deletion for 'saAmfCtDefInstantiationLevel' is not
> supported
>
>     root@SC-1:~# immlist -a saAmfCtDefInstantiationLevel
> safVersion=4.0.0,safCompType=OpenSafCompTypeAMFWDOG
>     saAmfCtDefInstantiationLevel=1
>     root@SC-1:~#
>
>  From the user perspective, I would expect that saAmfCtDefInstantiationLevel
> can be set back to <Empty>
> as its initial value of saAmfCtDefInstantiationLevel is <Empty>.
>
> Please give your comment.
>
As per AMF spec section 8.13.1 comptype class diagram, default values 
for  saAmfCtDefDisableRestart and saAmfCtDefInstantiationLevel is 0. But 
class definition in imm.xml does not contain 
"<default-value>0</default-value>" for these attributes. Because of this 
reason, user will see <Empty> value in immlist where instead of  0 if 
not configured.

Now setting saAmfCtDefInstantiationLevel="" generates a replacement 
operation and replacement to empty value is not a valid replacement for 
these attributes.

But I have seen we are accepting such a operation for sirank and or 
other attributes and hence can be handled in same way for these two 
attributes also. So I will send a V2 of this patch.

At the same time there is a new enhancement #1425 in IMM after which we 
can revisit all those attributes which have default value in spec.

Thanks,
Praveen

> Thanks,
> Quyen
>
> P.S. same comment for saAmfCtDefDisableRestart
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Wednesday, November 25, 2015 12:20 PM
> To: [email protected]; [email protected];
> [email protected]
> Cc: [email protected]
> Subject: [PATCH 1 of 1] amfd: fix amfd crash during attribute modification
> in compType [#1593]
>
>   osaf/services/saf/amf/amfd/comptype.cc |  28 ++++++++++++++++++++++++++++
>   1 files changed, 28 insertions(+), 0 deletions(-)
>
>
> Following commands causes amfd crash:
> immcfg -a saAmfCtDefQuiescingCompleteTimeout=
> safVersion=4.0.0,safCompType=OpenSafCompTypeAMFWDOG
> immcfg -a saAmfCtDefInstantiationLevel=
> safVersion=4.0.0,safCompType=OpenSafCompTypeAMFWDOG
> immcfg -a saAmfCtDefDisableRestart=
> safVersion=4.0.0,safCompType=OpenSafCompTypeAMFWDOG
>
> Patch adds check to prevent CCB modification to null value.
>
> diff --git a/osaf/services/saf/amf/amfd/comptype.cc
> b/osaf/services/saf/amf/amfd/comptype.cc
> --- a/osaf/services/saf/amf/amfd/comptype.cc
> +++ b/osaf/services/saf/amf/amfd/comptype.cc
> @@ -587,6 +587,13 @@ static SaAisErrorT ccb_completed_modify_
>               } else if (strcmp(mod->modAttr.attrName,
> "osafAmfCtDefHcCmdArgv") == 0) {
>                       ; // Allow modification, no validation can be done
>               } else if (strcmp(mod->modAttr.attrName,
> "saAmfCtDefQuiescingCompleteTimeout") == 0) {
> +                     if ((mod->modType == SA_IMM_ATTR_VALUES_DELETE) ||
> +                                     (mod->modAttr.attrValues ==
> nullptr)) {
> +                             report_ccb_validation_error(opdata,
> +                                     "Value deletion for '%s' is not
> supported", mod->modAttr.attrName);
> +                             rc = SA_AIS_ERR_BAD_OPERATION;
> +                             goto done;
> +                     }
>                       SaTimeT value = *((SaTimeT
> *)mod->modAttr.attrValues[0]);
>                       if (value < 100 * SA_TIME_ONE_MILLISECOND) {
>                               report_ccb_validation_error(opdata,
> @@ -595,6 +602,13 @@ static SaAisErrorT ccb_completed_modify_
>                               goto done;
>                       }
>               } else if (!strcmp(mod->modAttr.attrName,
> "saAmfCtDefInstantiationLevel")) {
> +                     if ((mod->modType == SA_IMM_ATTR_VALUES_DELETE) ||
> +                                     (mod->modAttr.attrValues ==
> nullptr)) {
> +                             report_ccb_validation_error(opdata,
> +                                     "Value deletion for '%s' is not
> supported", mod->modAttr.attrName);
> +                             rc = SA_AIS_ERR_BAD_OPERATION;
> +                             goto done;
> +                     }
>                       uint32_t num_inst = *((SaUint32T
> *)mod->modAttr.attrValues[0]);
>                       if (num_inst == 0) {
>                               report_ccb_validation_error(opdata,
> "Modification of saAmfCtDefInstantiationLevel Fail,"
> @@ -603,6 +617,13 @@ static SaAisErrorT ccb_completed_modify_
>                               goto done;
>                       }
>               } else if (strcmp(mod->modAttr.attrName,
> "saAmfCtDefRecoveryOnError") == 0) {
> +                     if ((mod->modType == SA_IMM_ATTR_VALUES_DELETE) ||
> +                                     (mod->modAttr.attrValues ==
> nullptr)) {
> +                             report_ccb_validation_error(opdata,
> +                                     "Value deletion for '%s' is not
> supported", mod->modAttr.attrName);
> +                             rc = SA_AIS_ERR_BAD_OPERATION;
> +                             goto done;
> +                     }
>                       uint32_t value = *((SaUint32T
> *)mod->modAttr.attrValues[0]);
>                       if ((value < SA_AMF_COMPONENT_RESTART) || (value >
> SA_AMF_NODE_FAILFAST)) {
>                               report_ccb_validation_error(opdata,
> @@ -611,6 +632,13 @@ static SaAisErrorT ccb_completed_modify_
>                               goto done;
>                       }
>               } else if (strcmp(mod->modAttr.attrName,
> "saAmfCtDefDisableRestart") == 0) {
> +                     if ((mod->modType == SA_IMM_ATTR_VALUES_DELETE) ||
> +                                     (mod->modAttr.attrValues ==
> nullptr)) {
> +                             report_ccb_validation_error(opdata,
> +                                     "Value deletion for '%s' is not
> supported", mod->modAttr.attrName);
> +                             rc = SA_AIS_ERR_BAD_OPERATION;
> +                             goto done;
> +                     }
>                       uint32_t value = *((SaUint32T
> *)mod->modAttr.attrValues[0]);
>                       if (value > SA_TRUE) {
>                               report_ccb_validation_error(opdata,
>

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to