Hi Gary,

I got you point. But actually remain attributes use the same behavior.
I updated the fix and re-sent .

B.R
/Thang-CMW Maint

-----Original Message-----
From: Minh Hon Chau <minh.c...@dektech.com.au> 
Sent: Wednesday, June 20, 2018 4:15 PM
To: Gary Lee <gary....@dektech.com.au>; thang.nguyen 
<thang.d.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] amf: correct changing attribute 
saAmfCtDefDisableRestart [#2876]

I have missed this point, I thought the ccb is rejected if same value to be 
updated.


On 20/06/18 18:24, Gary Lee wrote:
> Hi Thang
>
> Is it possible to update the value, eg. comp_type->saAmfCtDefDisableRestart, 
> outside the loop going through the nodes?
>
> I think with the change, it will send unnecessary updates if you set it to 
> the same value?
>
> /Gary
>
> -----Original Message-----
> From: "thang.nguyen" <thang.d.ngu...@dektech.com.au>
> Date: Tuesday, 19 June 2018 at 2:50 pm
> To: gary <gary....@dektech.com.au>, <minh.c...@dektech.com.au>
> Cc: <opensaf-devel@lists.sourceforge.net>, "thang.nguyen" 
> <thang.d.ngu...@dektech.com.au>
> Subject: [PATCH 1/1] amf: correct changing attribute saAmfCtDefDisableRestart 
> [#2876]
>
>      Currently changing attribute saAmfCtDefDisableRestart of SaAmfCompType
>      object not affect to all components at runtime. Because the change
>      does not broadcast to all nodes.
>      
>      Broadcast the change once it is updated.
>      
>      Similar fix for attribute saAmfCtDefInstantiationLevel.
>      ---
>       src/amf/amfd/comptype.cc | 6 ++----
>       1 file changed, 2 insertions(+), 4 deletions(-)
>      
>      diff --git a/src/amf/amfd/comptype.cc b/src/amf/amfd/comptype.cc
>      index b6d4d6d..8a97d48 100644
>      --- a/src/amf/amfd/comptype.cc
>      +++ b/src/amf/amfd/comptype.cc
>      @@ -532,7 +532,6 @@ static void ccb_apply_modify_hdlr(const 
> CcbUtilOperationData_t *opdata) {
>               avd_snd_op_req_msg(avd_cb, *it, &param);
>             } else if (!strcmp(attribute->attrName, 
> "saAmfCtDefInstantiationLevel")) {
>               SaUint32T param_val;
>      -        SaUint32T old_value = comp_type->saAmfCtDefInstantiationLevel;
>               if ((attr_mod->modType == SA_IMM_ATTR_VALUES_DELETE) ||
>                   (attribute->attrValues == nullptr)) {
>                 param_val = 0;  // Default value as per Section 8.13.1 (B0401)
>      @@ -547,7 +546,7 @@ static void ccb_apply_modify_hdlr(const 
> CcbUtilOperationData_t *opdata) {
>               memcpy(param.value, &param_val, param.value_len);
>               param.attr_id = saAmfCtDefInstantiationLevel_ID;
>               comp_type->saAmfCtDefInstantiationLevel = param_val;
>      -        if (old_value != param_val) avd_snd_op_req_msg(avd_cb, *it, 
> &param);
>      +        avd_snd_op_req_msg(avd_cb, *it, &param);
>             } else if (!strcmp(attribute->attrName, 
> "saAmfCtDefRecoveryOnError")) {
>               SaAmfRecommendedRecoveryT *param_val =
>                   (SaAmfRecommendedRecoveryT *)attribute->attrValues[0];
>      @@ -561,7 +560,6 @@ static void ccb_apply_modify_hdlr(const 
> CcbUtilOperationData_t *opdata) {
>               avd_snd_op_req_msg(avd_cb, *it, &param);
>             } else if (!strcmp(attribute->attrName, 
> "saAmfCtDefDisableRestart")) {
>               SaBoolT param_val;
>      -        SaUint32T old_value = comp_type->saAmfCtDefDisableRestart;
>               if ((attr_mod->modType == SA_IMM_ATTR_VALUES_DELETE) ||
>                   (attribute->attrValues == nullptr)) {
>                 param_val = static_cast<SaBoolT>(
>      @@ -576,7 +574,7 @@ static void ccb_apply_modify_hdlr(const 
> CcbUtilOperationData_t *opdata) {
>               memcpy(param.value, &param_val, param.value_len);
>               param.attr_id = saAmfCtDefDisableRestart_ID;
>               comp_type->saAmfCtDefDisableRestart = param_val;
>      -        if (old_value != param_val) avd_snd_op_req_msg(avd_cb, *it, 
> &param);
>      +        avd_snd_op_req_msg(avd_cb, *it, &param);
>             } else
>               LOG_WA("Unexpected attribute name: %s", attribute->attrName);
>           }
>      --
>      2.7.4
>      
>      
>
>
>



------------------------------------------------------------------------------
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
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to