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, ¶m); } 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, ¶m_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, ¶m); + avd_snd_op_req_msg(avd_cb, *it, ¶m); } 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, ¶m); } 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, ¶m_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, ¶m); + avd_snd_op_req_msg(avd_cb, *it, ¶m); } 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