Hi Hans, Sure. Would you like to combine two saflog into one ? Thanks -Nagu -----Original Message----- From: Hans Feldt [mailto:hans.fe...@ericsson.com] Sent: 20 November 2013 12:34 To: Nagendra Kumar; hans.nordeb...@ericsson.com Cc: opensaf-devel@lists.sourceforge.net Subject: Re: [devel] [PATCH 1 of 1] amfd: Add support for admin op result strings [#85]
I can see you have pushed but I have some minor improvements that can give us problems if not fixed now: 1) the saflog call in report_admin_op_error() needs to be protected so it is not called when the error code is TRYAGAIN 2) the error string should be logged to saflog, otherwise on case of SMF doing the admin op there will be nothing logged and troubleshooting will be hard. Patch attached, please review and I can push. Thanks, Hans On 11/19/2013 11:36 AM, Nagendra Kumar wrote: > Would like to push it as soon as possible. Comments ?? > > Thanks > -Nagu > -----Original Message----- > From: Nagendra Kumar > Sent: 15 November 2013 12:34 > To: hans.fe...@ericsson.com; hans.nordeb...@ericsson.com > Cc: opensaf-devel@lists.sourceforge.net > Subject: Re: [devel] [PATCH 1 of 1] amfd: Add support for admin op result > strings [#85] > > Hi, > Just to inform you that I have not converted all Error cases in this > patch. > For example: > In file sg_2n_fsm.cc: function avd_sg_2n_susi_fail_func(): > avd_saImmOiAdminOperationResult(cb->immOiHandle, l_susi->si->invocation, > SA_AIS_ERR_BAD_OPERATION); > > Other places like in sgproc.cc : su_complete_admin_op(i_su, > SA_AIS_ERR_TIMEOUT); su_disable_comps(i_su, SA_AIS_ERR_TIMEOUT); > > Here we don't have any reason explicit, so response will go as usual. > > Any comments ? > > Thanks > -Nagu > > -----Original Message----- > From: Nagendra Kumar > Sent: 14 November 2013 14:32 > To: hans.fe...@ericsson.com; hans.nordeb...@ericsson.com > Cc: opensaf-devel@lists.sourceforge.net > Subject: [devel] [PATCH 1 of 1] amfd: Add support for admin op result strings > [#85] > > osaf/services/saf/amf/amfd/app.cc | 24 +++--- > osaf/services/saf/amf/amfd/cluster.cc | 6 +- > osaf/services/saf/amf/amfd/comp.cc | 36 ++++------ > osaf/services/saf/amf/amfd/imm.cc | 41 +++++++++++++ > osaf/services/saf/amf/amfd/include/imm.h | 3 + > osaf/services/saf/amf/amfd/ndproc.cc | 51 +++++++--------- > osaf/services/saf/amf/amfd/node.cc | 99 > +++++++++++++++++-------------- > osaf/services/saf/amf/amfd/sg.cc | 87 +++++++++++++++------------ > osaf/services/saf/amf/amfd/sgproc.cc | 14 +-- > osaf/services/saf/amf/amfd/si.cc | 70 ++++++++++++---------- > osaf/services/saf/amf/amfd/su.cc | 86 +++++++++++++-------------- > 11 files changed, 281 insertions(+), 236 deletions(-) > > > diff --git a/osaf/services/saf/amf/amfd/app.cc > b/osaf/services/saf/amf/amfd/app.cc > --- a/osaf/services/saf/amf/amfd/app.cc > +++ b/osaf/services/saf/amf/amfd/app.cc > @@ -357,7 +357,6 @@ static void app_admin_op_cb(SaImmOiHandl > const SaNameT *object_name, SaImmAdminOperationIdT op_id, > const SaImmAdminOperationParamsT_2 **params) > { > - SaAisErrorT rc; > AVD_APP *app; > > TRACE_ENTER2("%s", object_name->value); > @@ -368,28 +367,28 @@ static void app_admin_op_cb(SaImmOiHandl > > if (op_id == SA_AMF_ADMIN_UNLOCK) { > if (app->saAmfApplicationAdminState == SA_AMF_ADMIN_UNLOCKED) { > - LOG_ER("%s is already unlocked", object_name->value); > - rc = SA_AIS_ERR_NO_OP; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "%s is already unlocked", > object_name->value); > goto done; > } > > if (app->saAmfApplicationAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) { > - LOG_ER("%s is locked instantiation", > object_name->value); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "%s is locked instantiation", > object_name->value); > goto done; > } > } > > if (op_id == SA_AMF_ADMIN_LOCK) { > if (app->saAmfApplicationAdminState == SA_AMF_ADMIN_LOCKED) { > - LOG_ER("%s is already locked", object_name->value); > - rc = SA_AIS_ERR_NO_OP; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "%s is already locked", > object_name->value); > goto done; > } > > if (app->saAmfApplicationAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) { > - LOG_ER("%s is locked instantiation", > object_name->value); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "%s is locked instantiation", > object_name->value); > goto done; > } > } > @@ -409,11 +408,12 @@ static void app_admin_op_cb(SaImmOiHandl > case SA_AMF_ADMIN_UNLOCK_INSTANTIATION: > case SA_AMF_ADMIN_RESTART: > default: > - rc = SA_AIS_ERR_NOT_SUPPORTED; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NOT_SUPPORTED, NULL, > + "Not supported"); > break; > } > - done: > - avd_saImmOiAdminOperationResult(immOiHandle, invocation, rc); > +done: > + TRACE_LEAVE(); > } > > static SaAisErrorT app_rt_attr_cb(SaImmOiHandleT immOiHandle, > diff --git a/osaf/services/saf/amf/amfd/cluster.cc > b/osaf/services/saf/amf/amfd/cluster.cc > --- a/osaf/services/saf/amf/amfd/cluster.cc > +++ b/osaf/services/saf/amf/amfd/cluster.cc > @@ -177,8 +177,6 @@ static void cluster_admin_op_cb(SaImmOiH > SaInvocationT invocation, const SaNameT *object_name, > SaImmAdminOperationIdT op_id, const SaImmAdminOperationParamsT_2 > **params) > { > - SaAisErrorT rc = SA_AIS_OK; > - > switch (op_id) { > case SA_AMF_ADMIN_SHUTDOWN: > case SA_AMF_ADMIN_UNLOCK: > @@ -187,11 +185,9 @@ static void cluster_admin_op_cb(SaImmOiH > case SA_AMF_ADMIN_UNLOCK_INSTANTIATION: > case SA_AMF_ADMIN_RESTART: > default: > - rc = SA_AIS_ERR_NOT_SUPPORTED; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NOT_SUPPORTED, NULL, "Not supported"); > break; > } > - > - avd_saImmOiAdminOperationResult(immOiHandle, invocation, rc); > } > > /** > diff --git a/osaf/services/saf/amf/amfd/comp.cc > b/osaf/services/saf/amf/amfd/comp.cc > --- a/osaf/services/saf/amf/amfd/comp.cc > +++ b/osaf/services/saf/amf/amfd/comp.cc > @@ -701,8 +701,6 @@ static void comp_admin_op_cb(SaImmOiHand > const SaNameT *objectName, SaImmAdminOperationIdT opId, > const SaImmAdminOperationParamsT_2 **params) > { > - SaAisErrorT rc = SA_AIS_OK; > - > TRACE_ENTER2("%llu, '%s', %llu", invocation, objectName->value, > opId); > > AVD_COMP *comp = avd_comp_get(objectName); > @@ -712,24 +710,24 @@ static void comp_admin_op_cb(SaImmOiHand > /* Valid B.04 AMF comp admin operations */ > case SA_AMF_ADMIN_RESTART: > if (comp->comp_info.comp_restart == true) { > - LOG_WA("Component Restart disabled '%s'", > objectName->value); > - rc = SA_AIS_ERR_NOT_SUPPORTED; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NOT_SUPPORTED, NULL, > + "Component Restart disabled '%s'", > objectName->value); > } > else if (comp->admin_pend_cbk.invocation != 0) { > - LOG_WA("Component undergoing admin operation '%s'", > objectName->value); > - rc = SA_AIS_ERR_TRY_AGAIN; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "Component undergoing admin operation > '%s'", objectName->value); > } > else if (comp->su->pend_cbk.invocation != 0) { > - LOG_WA("SU undergoing admin operation '%s'", > objectName->value); > - rc = SA_AIS_ERR_TRY_AGAIN; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "SU undergoing admin operation '%s'", > objectName->value); > } > else if (comp->su->su_on_node->admin_node_pend_cbk.invocation > != 0) { > - LOG_WA("Node undergoing admin operation '%s'", > objectName->value); > - rc = SA_AIS_ERR_TRY_AGAIN; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "Node undergoing admin operation '%s'", > objectName->value); > } > else if (comp->saAmfCompPresenceState != > SA_AMF_PRESENCE_INSTANTIATED) { > - LOG_WA("Component not instantiated '%s'", > objectName->value); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "Component not instantiated '%s'", > objectName->value); > } > else { > /* prepare the admin op req message and queue it */ > @@ -737,11 +735,10 @@ static void comp_admin_op_cb(SaImmOiHand > static_cast<SaAmfAdminOperationIdT>(opId), > comp->su->su_on_node) == NCSCC_RC_SUCCESS) { > comp->admin_pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(opId); > comp->admin_pend_cbk.invocation = invocation; > - rc = SA_AIS_OK; > } > else { > - LOG_WA("Admin op request send failed '%s'", > objectName->value); > - rc = SA_AIS_ERR_TIMEOUT; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TIMEOUT, NULL, > + "Admin op request send failed > '%s'", objectName->value); > } > } > break; > @@ -749,15 +746,12 @@ static void comp_admin_op_cb(SaImmOiHand > case SA_AMF_ADMIN_EAM_START: > case SA_AMF_ADMIN_EAM_STOP: > default: > - LOG_WA("Unsupported admin operation '%llu'", opId); > - rc = SA_AIS_ERR_NOT_SUPPORTED; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NOT_SUPPORTED, NULL, > + "Unsupported admin operation '%llu'", opId); > break; > } > > - if (rc != SA_AIS_OK) > - avd_saImmOiAdminOperationResult(immOiHandle, invocation, rc); > - > - TRACE_LEAVE2("(%u)",rc); > + TRACE_LEAVE(); > } > > static SaAisErrorT comp_rt_attr_cb(SaImmOiHandleT immOiHandle, > diff --git a/osaf/services/saf/amf/amfd/imm.cc > b/osaf/services/saf/amf/amfd/imm.cc > --- a/osaf/services/saf/amf/amfd/imm.cc > +++ b/osaf/services/saf/amf/amfd/imm.cc > @@ -1798,4 +1798,45 @@ void report_ccb_validation_error(const C > else > LOG_WA("%s", err_str); > } > +/** > + * Respond admin op to IMM > + * @param immOiHandle > + * @param invocation > + * @param result > + * @param pend_cbk > + * @param format > + * @param ... > + */ > +void report_admin_op_error(SaImmOiHandleT immOiHandle, SaInvocationT > invocation, SaAisErrorT result, > + AVD_ADMIN_OPER_CBK *pend_cbk, const char *format, ...) > +{ > + char ao_err_string[256]; > + SaAisErrorT error; > + SaStringT p_ao_err_string = ao_err_string; > + SaImmAdminOperationParamsT_2 ao_err_param = { > + const_cast<SaStringT>(SA_IMM_PARAM_ADMOP_ERROR), > + SA_IMM_ATTR_SASTRINGT, > + const_cast<SaStringT *> (&p_ao_err_string)}; > + const SaImmAdminOperationParamsT_2 *ao_err_params[2] = { > + &ao_err_param, > + NULL }; > + ao_err_string[sizeof(ao_err_string) - 1] = 0; > > + va_list ap; > + va_start(ap, format); > + (void) vsnprintf(ao_err_string, sizeof(ao_err_string), format, ap); > + va_end(ap); > + TRACE_ENTER2("inv:%llu, res:%u, Error String: '%s'", invocation, > result, ao_err_string); > + saflog(LOG_NOTICE, amfSvcUsrName, "Admin op done for invocation: %llu, > result %u", > + invocation, result); > + > + error= saImmOiAdminOperationResult_o2(immOiHandle, invocation, result, > ao_err_params); > + if (error != SA_AIS_OK) > + LOG_ER("saImmOiAdminOperationResult_o2 for %llu failed %u", > invocation, error); > + > + if (pend_cbk) { > + pend_cbk->admin_oper = static_cast<SaAmfAdminOperationIdT>(0); > + pend_cbk->invocation = 0; > + } > + > +} > diff --git a/osaf/services/saf/amf/amfd/include/imm.h > b/osaf/services/saf/amf/amfd/include/imm.h > --- a/osaf/services/saf/amf/amfd/include/imm.h > +++ b/osaf/services/saf/amf/amfd/include/imm.h > @@ -88,5 +88,8 @@ extern void avd_saImmOiAdminOperationRes > > SaAisErrorT result); > void report_ccb_validation_error(const CcbUtilOperationData_t *opdata, > const char *format, ...) __attribute__ ((format(printf, 2, 3))); > +void report_admin_op_error(SaImmOiHandleT immOiHandle, SaInvocationT > invocation, SaAisErrorT result, > + struct admin_oper_cbk *pend_cbk, > + const char *format, ...) __attribute__ ((format(printf, 5, 6))); > > #endif > diff --git a/osaf/services/saf/amf/amfd/ndproc.cc > b/osaf/services/saf/amf/amfd/ndproc.cc > --- a/osaf/services/saf/amf/amfd/ndproc.cc > +++ b/osaf/services/saf/amf/amfd/ndproc.cc > @@ -292,15 +292,17 @@ static void comp_admin_op_report_to_imm( > if (comp->admin_pend_cbk.admin_oper == SA_AMF_ADMIN_RESTART) { > if ((comp->saAmfCompPresenceState == > SA_AMF_PRESENCE_INSTANTIATED) && > (pres != SA_AMF_PRESENCE_RESTARTING)) { > - > avd_saImmOiAdminOperationResult(cb->immOiHandle,comp->admin_pend_cbk.invocation, > SA_AIS_ERR_BAD_OPERATION); > - comp->admin_pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > - comp->admin_pend_cbk.invocation = 0; > + report_admin_op_error(cb->immOiHandle, > comp->admin_pend_cbk.invocation, > + SA_AIS_ERR_BAD_OPERATION, > &comp->admin_pend_cbk, > + "Couldn't restart Comp '%s'", > comp->comp_info.name.value); > } > else if (comp->saAmfCompPresenceState == > SA_AMF_PRESENCE_RESTARTING) { > if (pres == SA_AMF_PRESENCE_INSTANTIATED) > > avd_saImmOiAdminOperationResult(cb->immOiHandle,comp->admin_pend_cbk.invocation, > SA_AIS_OK); > else > - > avd_saImmOiAdminOperationResult(cb->immOiHandle,comp->admin_pend_cbk.invocation, > SA_AIS_ERR_REPAIR_PENDING); > + report_admin_op_error(cb->immOiHandle, > comp->admin_pend_cbk.invocation, > + SA_AIS_ERR_REPAIR_PENDING, > &comp->admin_pend_cbk, > + "Couldn't restart Comp '%s'", > comp->comp_info.name.value); > > comp->admin_pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > comp->admin_pend_cbk.invocation = 0; > @@ -328,10 +330,8 @@ static void su_admin_op_report_to_imm(AV > su->pend_cbk.invocation = 0; > su->pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > } else if (pres == SA_AMF_PRESENCE_TERMINATION_FAILED) { > - avd_saImmOiAdminOperationResult(cb->immOiHandle, > su->pend_cbk.invocation, > - > SA_AIS_ERR_REPAIR_PENDING); > - su->pend_cbk.invocation = 0; > - su->pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > + report_admin_op_error(cb->immOiHandle, > su->pend_cbk.invocation, SA_AIS_ERR_REPAIR_PENDING, > + &su->pend_cbk, "SU '%s' moved to > 'termination failed' state", su->name.value); > } > break; > case SA_AMF_ADMIN_UNLOCK_INSTANTIATION: > @@ -341,10 +341,9 @@ static void su_admin_op_report_to_imm(AV > su->pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > } else if ((pres == SA_AMF_PRESENCE_INSTANTIATION_FAILED) || > (pres == SA_AMF_PRESENCE_TERMINATION_FAILED)) { > - avd_saImmOiAdminOperationResult(cb->immOiHandle, > su->pend_cbk.invocation, > - > SA_AIS_ERR_REPAIR_PENDING); > - su->pend_cbk.invocation = 0; > - su->pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > + report_admin_op_error(cb->immOiHandle, > su->pend_cbk.invocation, SA_AIS_ERR_REPAIR_PENDING, > + &su->pend_cbk, "SU '%s' moved to > 'instantiation/termination failed' state", > + su->name.value); > } > break; > case SA_AMF_ADMIN_REPAIRED: > @@ -354,13 +353,13 @@ static void su_admin_op_report_to_imm(AV > > /* Hand over to SG and let it do the rest */ > (void) avd_sg_app_su_inst_func(cb, su->sg_of_su); > + su->pend_cbk.invocation = 0; > + su->pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > } else { > - LOG_WA("Bad presence state %u after '%s' adm repaired", > pres, su->name.value); > - avd_saImmOiAdminOperationResult(cb->immOiHandle, > - su->pend_cbk.invocation, > SA_AIS_ERR_BAD_OPERATION); > + report_admin_op_error(cb->immOiHandle, > su->pend_cbk.invocation, SA_AIS_ERR_BAD_OPERATION, > + &su->pend_cbk, "Bad presence state %u > after '%s' adm repaired", pres, > + su->name.value); > } > - su->pend_cbk.invocation = 0; > - su->pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > break; > default: > break; > @@ -395,11 +394,9 @@ static void node_admin_op_report_to_imm( > su->su_on_node->admin_node_pend_cbk.admin_oper > = static_cast<SaAmfAdminOperationIdT>(0); > } > } else if (pres == SA_AMF_PRESENCE_TERMINATION_FAILED) { > - avd_saImmOiAdminOperationResult(cb->immOiHandle, > - > su->su_on_node->admin_node_pend_cbk.invocation, > - > SA_AIS_ERR_REPAIR_PENDING); > - su->su_on_node->admin_node_pend_cbk.invocation = 0; > - su->su_on_node->admin_node_pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > + report_admin_op_error(cb->immOiHandle, > su->su_on_node->admin_node_pend_cbk.invocation, > + SA_AIS_ERR_REPAIR_PENDING, > &su->su_on_node->admin_node_pend_cbk, > + "SU '%s' moved to 'termination failed' > state", su->name.value); > su->su_on_node->su_cnt_admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > } /* else do nothing > ::SA_AMF_PRESENCE_TERMINATING update is valid */ > break; > @@ -416,12 +413,10 @@ static void node_admin_op_report_to_imm( > su->su_on_node->admin_node_pend_cbk.admin_oper > = static_cast<SaAmfAdminOperationIdT>(0); > } > } else if ((pres == SA_AMF_PRESENCE_TERMINATION_FAILED) || > - (pres == SA_AMF_PRESENCE_INSTANTIATION_FAILED)) { > - avd_saImmOiAdminOperationResult(cb->immOiHandle, > - > su->su_on_node->admin_node_pend_cbk.invocation, > - > SA_AIS_ERR_REPAIR_PENDING); > - su->su_on_node->admin_node_pend_cbk.invocation = 0; > - su->su_on_node->admin_node_pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > + (pres == SA_AMF_PRESENCE_INSTANTIATION_FAILED)) > { > + report_admin_op_error(cb->immOiHandle, > su->su_on_node->admin_node_pend_cbk.invocation, > + SA_AIS_ERR_REPAIR_PENDING, > &su->su_on_node->admin_node_pend_cbk, > + "SU '%s' moved to > 'instantiation/termination failed' state", su->name.value); > su->su_on_node->su_cnt_admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > } /* else do nothing :: > SA_AMF_PRESENCE_INSTANTIATING update is valid */ > break; > diff --git a/osaf/services/saf/amf/amfd/node.cc > b/osaf/services/saf/amf/amfd/node.cc > --- a/osaf/services/saf/amf/amfd/node.cc > +++ b/osaf/services/saf/amf/amfd/node.cc > @@ -819,7 +819,8 @@ void avd_node_admin_lock_unlock_shutdown > LOG_WA("invalid sg state %u for unlock", > su->sg_of_su->sg_fsm_state); > > if (invocation != 0) > - > avd_saImmOiAdminOperationResult(cb->immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN); > + report_admin_op_error(cb->immOiHandle, > invocation, SA_AIS_ERR_TRY_AGAIN, NULL, > + "invalid sg state %u > for unlock", su->sg_of_su->sg_fsm_state); > goto end; > } > > @@ -895,7 +896,10 @@ void avd_node_admin_lock_unlock_shutdown > (new_admin_state == > SA_AMF_ADMIN_LOCKED)))) { > LOG_WA("Node lock/shutdown not > allowed with two SUs on same node"); > if (invocation != 0) > - > avd_saImmOiAdminOperationResult(cb->immOiHandle, > invocation,SA_AIS_ERR_NOT_SUPPORTED); > + > report_admin_op_error(cb->immOiHandle, invocation, > + > SA_AIS_ERR_NOT_SUPPORTED, NULL, > + "Node > lock/shutdown not allowed with two SUs" > + " on > same node"); > else { > > saClmResponse_4(cb->clmHandle, node->clm_pend_inv, > SA_CLM_CALLBACK_RESPONSE_ERROR); > node->clm_pend_inv = 0; > @@ -917,7 +921,10 @@ void avd_node_admin_lock_unlock_shutdown > LOG_WA("invalid sg state %u for > lock/shutdown", > > su->sg_of_su->sg_fsm_state); > if (invocation != 0) > - > avd_saImmOiAdminOperationResult(cb->immOiHandle, > invocation,SA_AIS_ERR_TRY_AGAIN); > + > report_admin_op_error(cb->immOiHandle, invocation, > + > SA_AIS_ERR_TRY_AGAIN, NULL, > + > "invalid sg state %u for lock/shutdown", > + > su->sg_of_su->sg_fsm_state); > else { > > saClmResponse_4(cb->clmHandle, node->clm_pend_inv, > SA_CLM_CALLBACK_RESPONSE_ERROR); > node->clm_pend_inv = 0; > @@ -1037,8 +1044,8 @@ static void node_admin_op_cb(SaImmOiHand > TRACE_ENTER2("%llu, '%s', %llu", invocation, objectName->value, > operationId); > > if (avd_cb->init_state != AVD_APP_STATE) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("AVD not in APP_STATE"); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "AVD not in APP_STATE"); > goto done; > } > > @@ -1046,8 +1053,10 @@ static void node_admin_op_cb(SaImmOiHand > osafassert(node != AVD_AVND_NULL); > > if (node->admin_node_pend_cbk.admin_oper != 0) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("Node undergoing admin operation"); > + /* Donot pass node->admin_node_pend_cbk here as previous > counters will get reset in > + report_admin_op_error. */ > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "Node undergoing admin operation"); > goto done; > } > > @@ -1056,36 +1065,36 @@ static void node_admin_op_cb(SaImmOiHand > su = node->list_of_su; > while (su != NULL) { > if (su->pend_cbk.admin_oper != 0) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("SU on this node is undergoing admin op (%s)", > su->name.value); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "SU on this node is undergoing admin op > (%s)", su->name.value); > goto done; > } > if (su->sg_of_su->sg_fsm_state != AVD_SG_FSM_STABLE) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("SG of SU on this node not in STABLE state > (%s)", su->name.value); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "SG of SU on this node not in STABLE > state (%s)", su->name.value); > goto done; > } > su = su->avnd_list_su_next; > } > > if (node->clm_pend_inv != 0) { > - LOG_NO("Clm lock operation going on"); > - rc = SA_AIS_ERR_TRY_AGAIN; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "Clm lock operation going on"); > goto done; > } > > switch (operationId) { > case SA_AMF_ADMIN_SHUTDOWN: > if (node->saAmfNodeAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) { > - rc = SA_AIS_ERR_NO_OP; > - LOG_WA("'%s' Already in SHUTTING DOWN state", > node->name.value); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "'%s' Already in SHUTTING DOWN state", > node->name.value); > goto done; > } > > if (node->saAmfNodeAdminState != SA_AMF_ADMIN_UNLOCKED) { > - rc = SA_AIS_ERR_BAD_OPERATION; > - LOG_WA("'%s' Invalid Admin Operation SHUTDOWN in state > %s", > - node->name.value, > avd_adm_state_name[node->saAmfNodeAdminState]); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "'%s' Invalid Admin Operation SHUTDOWN > in state %s", > + node->name.value, > avd_adm_state_name[node->saAmfNodeAdminState]); > goto done; > } > > @@ -1101,15 +1110,15 @@ static void node_admin_op_cb(SaImmOiHand > > case SA_AMF_ADMIN_UNLOCK: > if (node->saAmfNodeAdminState == SA_AMF_ADMIN_UNLOCKED) { > - rc = SA_AIS_ERR_NO_OP; > - LOG_WA("'%s' Already in UNLOCKED state", > node->name.value); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "'%s' Already in UNLOCKED state", > node->name.value); > goto done; > } > > if (node->saAmfNodeAdminState != SA_AMF_ADMIN_LOCKED) { > - rc = SA_AIS_ERR_BAD_OPERATION; > - LOG_WA("'%s' Invalid Admin Operation UNLOCK in state > %s", > - node->name.value, > avd_adm_state_name[node->saAmfNodeAdminState]); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "'%s' Invalid Admin Operation UNLOCK in > state %s", > + node->name.value, > avd_adm_state_name[node->saAmfNodeAdminState]); > goto done; > } > > @@ -1125,15 +1134,15 @@ static void node_admin_op_cb(SaImmOiHand > > case SA_AMF_ADMIN_LOCK: > if (node->saAmfNodeAdminState == SA_AMF_ADMIN_LOCKED) { > - rc = SA_AIS_ERR_NO_OP; > - LOG_WA("'%s' Already in LOCKED state", > node->name.value); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "'%s' Already in LOCKED state", > node->name.value); > goto done; > } > > if (node->saAmfNodeAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) { > - rc = SA_AIS_ERR_BAD_OPERATION; > - LOG_WA("'%s' Invalid Admin Operation LOCK in state %s", > - node->name.value, > avd_adm_state_name[node->saAmfNodeAdminState]); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "'%s' Invalid Admin Operation LOCK in > state %s", > + node->name.value, > avd_adm_state_name[node->saAmfNodeAdminState]); > goto done; > } > > @@ -1149,15 +1158,15 @@ static void node_admin_op_cb(SaImmOiHand > > case SA_AMF_ADMIN_LOCK_INSTANTIATION: > if (node->saAmfNodeAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION) { > - rc = SA_AIS_ERR_NO_OP; > - LOG_WA("'%s' Already in LOCKED INSTANTIATION state", > node->name.value); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "'%s' Already in LOCKED INSTANTIATION > state", node->name.value); > goto done; > } > > if (node->saAmfNodeAdminState != SA_AMF_ADMIN_LOCKED) { > - rc = SA_AIS_ERR_BAD_OPERATION; > - LOG_WA("'%s' Invalid Admin Operation LOCK_INSTANTIATION > in state %s", > - node->name.value, > avd_adm_state_name[node->saAmfNodeAdminState]); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "'%s' Invalid Admin Operation > LOCK_INSTANTIATION in state %s", > + node->name.value, > avd_adm_state_name[node->saAmfNodeAdminState]); > goto done; > } > > @@ -1188,8 +1197,8 @@ static void node_admin_op_cb(SaImmOiHand > else > avd_saImmOiAdminOperationResult(immOiHandle, > invocation, SA_AIS_OK); > } else { > - rc = SA_AIS_ERR_REPAIR_PENDING; > - LOG_WA("LOCK_INSTANTIATION FAILED"); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_REPAIR_PENDING, NULL, > + "LOCK_INSTANTIATION FAILED"); > avd_node_oper_state_set(node, > SA_AMF_OPERATIONAL_DISABLED); > goto done; > } > @@ -1197,15 +1206,15 @@ static void node_admin_op_cb(SaImmOiHand > > case SA_AMF_ADMIN_UNLOCK_INSTANTIATION: > if (node->saAmfNodeAdminState == SA_AMF_ADMIN_LOCKED) { > - rc = SA_AIS_ERR_NO_OP; > - LOG_WA("'%s' Already in LOCKED state", > node->name.value); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "'%s' Already in LOCKED state", > node->name.value); > goto done; > } > > if (node->saAmfNodeAdminState != > SA_AMF_ADMIN_LOCKED_INSTANTIATION) { > - rc = SA_AIS_ERR_BAD_OPERATION; > - LOG_WA("'%s' Invalid Admin Operation > UNLOCK_INSTANTIATION in state %s", > - node->name.value, > avd_adm_state_name[node->saAmfNodeAdminState]); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "'%s' Invalid Admin Operation > UNLOCK_INSTANTIATION in state %s", > + node->name.value, > avd_adm_state_name[node->saAmfNodeAdminState]); > goto done; > } > > @@ -1237,21 +1246,19 @@ static void node_admin_op_cb(SaImmOiHand > avd_saImmOiAdminOperationResult(immOiHandle, > invocation, SA_AIS_OK); > } else { > rc = SA_AIS_ERR_TIMEOUT; > - LOG_WA("UNLOCK_INSTANTIATION FAILED"); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TIMEOUT, NULL, > + "UNLOCK_INSTANTIATION FAILED"); > goto done; > } > break; > > default: > - rc = SA_AIS_ERR_NOT_SUPPORTED; > - LOG_WA("UNSUPPORTED ADMIN OPERATION (%llu)", operationId); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NOT_SUPPORTED, NULL, > + "UNSUPPORTED ADMIN OPERATION (%llu)", > operationId); > break; > } > > done: > - if (rc != SA_AIS_OK) > - avd_saImmOiAdminOperationResult(immOiHandle, invocation, rc); > - > TRACE_LEAVE2("%u", rc); > } > > diff --git a/osaf/services/saf/amf/amfd/sg.cc > b/osaf/services/saf/amf/amfd/sg.cc > --- a/osaf/services/saf/amf/amfd/sg.cc > +++ b/osaf/services/saf/amf/amfd/sg.cc > @@ -1041,7 +1041,6 @@ static void sg_admin_op_cb(SaImmOiHandle > const SaNameT *object_name, SaImmAdminOperationIdT op_id, > const SaImmAdminOperationParamsT_2 **params) > { > - SaAisErrorT rc = SA_AIS_OK; > AVD_SG *sg; > SaAmfAdminStateT adm_state; > AVD_SU *su; > @@ -1051,14 +1050,14 @@ static void sg_admin_op_cb(SaImmOiHandle > sg = avd_sg_get(object_name); > > if (sg->sg_ncs_spec == SA_TRUE) { > - LOG_ER("Admin Op on OpenSAF MW SG is not allowed"); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "Admin Op on OpenSAF MW SG is not allowed"); > goto done; > } > > if (sg->sg_fsm_state != AVD_SG_FSM_STABLE) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("SG not in STABLE state (%s)", sg->name.value); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "SG not in STABLE state (%s)", sg->name.value); > goto done; > } > > @@ -1066,14 +1065,15 @@ static void sg_admin_op_cb(SaImmOiHandle > for (su = sg->list_of_su; su != NULL; su = su->sg_list_su_next) { > m_AVD_GET_SU_NODE_PTR(avd_cb, su, node); > if (su->pend_cbk.invocation != 0) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("Admin operation'%u' is already going on su'%s' > belonging to the same SG", > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "Admin operation'%u' is already going > on su'%s' belonging to the same SG", > su->pend_cbk.admin_oper, > su->name.value); > goto done; > } else if (node->admin_node_pend_cbk.admin_oper != 0) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("Node'%s' hosting SU'%s' belonging to the same > SG, undergoing admin operation'%u'", > - node->name.value, su->name.value, > node->admin_node_pend_cbk.admin_oper); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "Node'%s' hosting SU'%s' belonging to > the same SG, undergoing admin" > + " operation'%u'", node->name.value, > su->name.value, > + node->admin_node_pend_cbk.admin_oper); > goto done; > } > } > @@ -1081,21 +1081,22 @@ static void sg_admin_op_cb(SaImmOiHandle > > /* if Tolerance timer is running for any SI's withing this SG, then > return SA_AIS_ERR_TRY_AGAIN */ > if (sg_is_tolerance_timer_running_for_any_si(sg)) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("Tolerance timer is running for some of the SI's in the > SG '%s', so differing admin opr",sg->name.value); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "Tolerance timer is running for some of the > SI's in the SG '%s'," > + " so differing admin opr", sg->name.value); > goto done; > } > switch (op_id) { > case SA_AMF_ADMIN_UNLOCK: > if (sg->saAmfSGAdminState == SA_AMF_ADMIN_UNLOCKED) { > - LOG_ER("%s is already unlocked", object_name->value); > - rc = SA_AIS_ERR_NO_OP; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "%s is already unlocked", > object_name->value); > goto done; > } > > if (sg->saAmfSGAdminState == SA_AMF_ADMIN_LOCKED_INSTANTIATION) > { > - LOG_ER("%s is locked instantiation", > object_name->value); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "%s is locked instantiation", > object_name->value); > goto done; > } > > @@ -1103,21 +1104,22 @@ static void sg_admin_op_cb(SaImmOiHandle > avd_sg_admin_state_set(sg, SA_AMF_ADMIN_UNLOCKED); > if (avd_sg_app_sg_admin_func(avd_cb, sg) != NCSCC_RC_SUCCESS) { > avd_sg_admin_state_set(sg, adm_state); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + NULL); > goto done; > } > break; > > case SA_AMF_ADMIN_LOCK: > if (sg->saAmfSGAdminState == SA_AMF_ADMIN_LOCKED) { > - LOG_ER("%s is already locked", object_name->value); > - rc = SA_AIS_ERR_NO_OP; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "%s is already locked", > object_name->value); > goto done; > } > > if (sg->saAmfSGAdminState == SA_AMF_ADMIN_LOCKED_INSTANTIATION) > { > - LOG_ER("%s is locked instantiation", > object_name->value); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "%s is locked instantiation", > object_name->value); > goto done; > } > > @@ -1125,22 +1127,23 @@ static void sg_admin_op_cb(SaImmOiHandle > avd_sg_admin_state_set(sg, SA_AMF_ADMIN_LOCKED); > if (avd_sg_app_sg_admin_func(avd_cb, sg) != NCSCC_RC_SUCCESS) { > avd_sg_admin_state_set(sg, adm_state); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + NULL); > goto done; > } > > break; > case SA_AMF_ADMIN_SHUTDOWN: > if (sg->saAmfSGAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) { > - LOG_ER("%s is shutting down", object_name->value); > - rc = SA_AIS_ERR_NO_OP; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "%s is shutting down", > object_name->value); > goto done; > } > > if ((sg->saAmfSGAdminState == SA_AMF_ADMIN_LOCKED) || > (sg->saAmfSGAdminState == > SA_AMF_ADMIN_LOCKED_INSTANTIATION)) { > - LOG_ER("%s is locked (instantiation)", > object_name->value); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "%s is locked (instantiation)", > object_name->value); > goto done; > } > > @@ -1148,20 +1151,21 @@ static void sg_admin_op_cb(SaImmOiHandle > avd_sg_admin_state_set(sg, SA_AMF_ADMIN_SHUTTING_DOWN); > if (avd_sg_app_sg_admin_func(avd_cb, sg) != NCSCC_RC_SUCCESS) { > avd_sg_admin_state_set(sg, adm_state); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + NULL); > goto done; > } > break; > case SA_AMF_ADMIN_LOCK_INSTANTIATION: > if (sg->saAmfSGAdminState == SA_AMF_ADMIN_LOCKED_INSTANTIATION) > { > - LOG_ER("%s is already locked-instantiation", > object_name->value); > - rc = SA_AIS_ERR_NO_OP; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "%s is already locked-instantiation", > object_name->value); > goto done; > } > > if (sg->saAmfSGAdminState != SA_AMF_ADMIN_LOCKED) { > - LOG_ER("%s is not locked", object_name->value); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "%s is not locked", object_name->value); > goto done; > } > > @@ -1169,21 +1173,22 @@ static void sg_admin_op_cb(SaImmOiHandle > avd_sg_admin_state_set(sg, SA_AMF_ADMIN_LOCKED_INSTANTIATION); > if (sg_app_sg_admin_lock_inst(avd_cb, sg) != NCSCC_RC_SUCCESS) { > avd_sg_admin_state_set(sg, adm_state); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + NULL); > goto done; > } > > break; > case SA_AMF_ADMIN_UNLOCK_INSTANTIATION: > if (sg->saAmfSGAdminState == SA_AMF_ADMIN_LOCKED) { > - LOG_ER("%s is already locked", object_name->value); > - rc = SA_AIS_ERR_NO_OP; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "%s is already locked", > object_name->value); > goto done; > } > > if (sg->saAmfSGAdminState != SA_AMF_ADMIN_LOCKED_INSTANTIATION) > { > - LOG_ER("%s is not in locked instantiation state", > object_name->value); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "%s is not in locked instantiation > state", object_name->value); > goto done; > } > > @@ -1193,11 +1198,13 @@ static void sg_admin_op_cb(SaImmOiHandle > break; > case SA_AMF_ADMIN_SG_ADJUST: > default: > - rc = SA_AIS_ERR_NOT_SUPPORTED; > - break; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NOT_SUPPORTED, NULL, > + "Admin Operation '%llu' not supported", op_id); > + goto done; > } > - done: > - avd_saImmOiAdminOperationResult(immOiHandle, invocation, rc); > + avd_saImmOiAdminOperationResult(immOiHandle, invocation, SA_AIS_OK); > +done: > + TRACE_LEAVE(); > } > > static SaAisErrorT sg_rt_attr_cb(SaImmOiHandleT immOiHandle, > diff --git a/osaf/services/saf/amf/amfd/sgproc.cc > b/osaf/services/saf/amf/amfd/sgproc.cc > --- a/osaf/services/saf/amf/amfd/sgproc.cc > +++ b/osaf/services/saf/amf/amfd/sgproc.cc > @@ -1104,11 +1104,9 @@ void avd_su_si_assign_evh(AVD_CL_CB *cb, > su->su_on_node->admin_node_pend_cbk.invocation > = 0; > su->su_on_node->admin_node_pend_cbk.admin_oper > = static_cast<SaAmfAdminOperationIdT>(0); > } else if (n2d_msg->msg_info.n2d_su_si_assign.error != > NCSCC_RC_SUCCESS) { > - avd_saImmOiAdminOperationResult(cb->immOiHandle, > - > su->su_on_node->admin_node_pend_cbk.invocation, > - SA_AIS_ERR_REPAIR_PENDING); > - su->su_on_node->admin_node_pend_cbk.invocation > = 0; > - su->su_on_node->admin_node_pend_cbk.admin_oper > = static_cast<SaAmfAdminOperationIdT>(0); > + report_admin_op_error(cb->immOiHandle, > su->su_on_node->admin_node_pend_cbk.invocation, > + SA_AIS_ERR_REPAIR_PENDING, > &su->su_on_node->admin_node_pend_cbk, > + NULL); > su->su_on_node->su_cnt_admin_oper = 0; > } > /* else admin oper still not complete */ > @@ -1519,10 +1517,8 @@ void avd_node_down_mw_susi_failover(AVD_ > /* send pending callback for this node if any */ > if (avnd->admin_node_pend_cbk.invocation != 0) { > LOG_WA("Response to admin callback due to node fail"); > - avd_saImmOiAdminOperationResult(cb->immOiHandle, > avnd->admin_node_pend_cbk.invocation, > - SA_AIS_ERR_REPAIR_PENDING); > - avnd->admin_node_pend_cbk.invocation = 0; > - avnd->admin_node_pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(0); > + report_admin_op_error(cb->immOiHandle, > avnd->admin_node_pend_cbk.invocation, > + SA_AIS_ERR_REPAIR_PENDING, > &avnd->admin_node_pend_cbk, "node failure"); > avnd->su_cnt_admin_oper = 0; > } > > diff --git a/osaf/services/saf/amf/amfd/si.cc > b/osaf/services/saf/amf/amfd/si.cc > --- a/osaf/services/saf/amf/amfd/si.cc > +++ b/osaf/services/saf/amf/amfd/si.cc > @@ -772,39 +772,40 @@ static void si_admin_op_cb(SaImmOiHandle > const SaNameT *objectName, SaImmAdminOperationIdT operationId, > const SaImmAdminOperationParamsT_2 **params) > { > - SaAisErrorT rc = SA_AIS_OK; > uint32_t err = NCSCC_RC_FAILURE; > AVD_SI *si; > SaAmfAdminStateT adm_state = static_cast<SaAmfAdminStateT>(0); > SaAmfAdminStateT back_val; > + SaAisErrorT rc = SA_AIS_OK; > > TRACE_ENTER2("%s op=%llu", objectName->value, operationId); > > si = avd_si_get(objectName); > > if ((operationId != SA_AMF_ADMIN_SI_SWAP) && (si->sg_of_si->sg_ncs_spec > == SA_TRUE)) { > - rc = SA_AIS_ERR_NOT_SUPPORTED; > - LOG_WA("Admin operation %llu on MW SI is not allowed", > operationId); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NOT_SUPPORTED, NULL, > + "Admin operation %llu on MW SI is not allowed", > operationId); > goto done; > } > /* if Tolerance timer is running for any SI's withing this SG, then > return SA_AIS_ERR_TRY_AGAIN */ > if (sg_is_tolerance_timer_running_for_any_si(si->sg_of_si)) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("Tolerance timer is running for some of the SI's in > the SG '%s', so differing admin opr",si->sg_of_si->name.value); > - goto done; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "Tolerance timer is running for some of the > SI's in the SG '%s', " > + "so differing admin > opr",si->sg_of_si->name.value); > + goto done; > } > > switch (operationId) { > case SA_AMF_ADMIN_UNLOCK: > if (SA_AMF_ADMIN_UNLOCKED == si->saAmfSIAdminState) { > - LOG_WA("SI unlock of %s failed, already unlocked", > objectName->value); > - rc = SA_AIS_ERR_NO_OP; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "SI unlock of %s failed, already > unlocked", objectName->value); > goto done; > } > > if (si->sg_of_si->sg_fsm_state != AVD_SG_FSM_STABLE) { > - LOG_WA("SI unlock of %s failed, SG not stable", > objectName->value); > - rc = SA_AIS_ERR_TRY_AGAIN; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "SI unlock of %s failed, SG not > stable", objectName->value); > goto done; > } > > @@ -812,24 +813,25 @@ static void si_admin_op_cb(SaImmOiHandle > > err = si->sg_of_si->si_func(avd_cb, si); > if (err != NCSCC_RC_SUCCESS) { > - LOG_WA("SI unlock of %s failed", objectName->value); > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "SI unlock of %s failed", > objectName->value); > avd_si_admin_state_set(si, SA_AMF_ADMIN_LOCKED); > - rc = SA_AIS_ERR_BAD_OPERATION; > + goto done; > } > > break; > > case SA_AMF_ADMIN_SHUTDOWN: > if (SA_AMF_ADMIN_SHUTTING_DOWN == si->saAmfSIAdminState) { > - LOG_WA("SI unlock of %s failed, already shutting down", > objectName->value); > - rc = SA_AIS_ERR_NO_OP; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "SI unlock of %s failed, already > shutting down", objectName->value); > goto done; > } > > if ((SA_AMF_ADMIN_LOCKED == si->saAmfSIAdminState) || > (SA_AMF_ADMIN_LOCKED_INSTANTIATION == > si->saAmfSIAdminState)) { > - LOG_WA("SI unlock of %s failed, is locked > (instantiation)", objectName->value); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "SI unlock of %s failed, is locked > (instantiation)", objectName->value); > goto done; > } > adm_state = SA_AMF_ADMIN_SHUTTING_DOWN; > @@ -841,8 +843,8 @@ static void si_admin_op_cb(SaImmOiHandle > adm_state = SA_AMF_ADMIN_LOCKED; > > if (SA_AMF_ADMIN_LOCKED == si->saAmfSIAdminState) { > - LOG_WA("SI lock of %s failed, already locked", > objectName->value); > - rc = SA_AIS_ERR_NO_OP; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "SI lock of %s failed, already locked", > objectName->value); > goto done; > } > > @@ -862,8 +864,8 @@ static void si_admin_op_cb(SaImmOiHandle > if ((si->sg_of_si->sg_fsm_state != AVD_SG_FSM_SI_OPER) > || > (si->saAmfSIAdminState != > SA_AMF_ADMIN_SHUTTING_DOWN) || > (adm_state != SA_AMF_ADMIN_LOCKED)) { > - LOG_WA("'%s' other semantics...", > objectName->value); > - rc = SA_AIS_ERR_TRY_AGAIN; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "'%s' other semantics...", > objectName->value); > goto done; > } > } > @@ -873,20 +875,26 @@ static void si_admin_op_cb(SaImmOiHandle > > err = si->sg_of_si->si_admin_down(avd_cb, si); > if (err != NCSCC_RC_SUCCESS) { > - LOG_WA("SI shutdown/lock of %s failed", > objectName->value); > avd_si_admin_state_set(si, back_val); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "SI shutdown/lock of %s failed", > objectName->value); > + goto done; > } > > break; > > case SA_AMF_ADMIN_SI_SWAP: > - if (si->sg_of_si->si_swap != NULL) > + if (si->sg_of_si->si_swap != NULL) { > rc = si->sg_of_si->si_swap(si, invocation); > - else { > - LOG_WA("SI SWAP of %s failed, not supported for > redundancy model", > + if (rc != SA_AIS_OK) { > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "SI Swap of %s failed", > objectName->value); > + goto done; > + } > + } else { > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NOT_SUPPORTED, NULL, > + "SI SWAP of %s failed, not supported > for redundancy model", > objectName->value); > - rc = SA_AIS_ERR_NOT_SUPPORTED; > goto done; > } > break; > @@ -895,14 +903,14 @@ static void si_admin_op_cb(SaImmOiHandle > case SA_AMF_ADMIN_UNLOCK_INSTANTIATION: > case SA_AMF_ADMIN_RESTART: > default: > - LOG_WA("SI Admin operation %llu not supported", operationId); > - rc = SA_AIS_ERR_NOT_SUPPORTED; > - break; > + report_admin_op_error(immOiHandle, invocation, > SA_AIS_ERR_NOT_SUPPORTED, NULL, > + "SI Admin operation %llu not supported", > operationId); > + goto done; > } > > + if ((operationId != SA_AMF_ADMIN_SI_SWAP)) > + avd_saImmOiAdminOperationResult(immOiHandle, invocation, rc); > done: > - if ((operationId != SA_AMF_ADMIN_SI_SWAP) || (rc != SA_AIS_OK)) > - avd_saImmOiAdminOperationResult(immOiHandle, invocation, rc); > TRACE_LEAVE(); > } > > diff --git a/osaf/services/saf/amf/amfd/su.cc > b/osaf/services/saf/amf/amfd/su.cc > --- a/osaf/services/saf/amf/amfd/su.cc > +++ b/osaf/services/saf/amf/amfd/su.cc > @@ -875,19 +875,18 @@ static void su_admin_op_cb(SaImmOiHandle > SaAmfAdminStateT adm_state = > static_cast<SaAmfAdminStateT>(SA_AMF_ADMIN_LOCK); > SaAmfReadinessStateT back_red_state; > SaAmfAdminStateT back_admin_state; > - SaAisErrorT rc = SA_AIS_OK; > > TRACE_ENTER2("%llu, '%s', %llu", invocation, su_name->value, op_id); > > if ( op_id > SA_AMF_ADMIN_SHUTDOWN && op_id != SA_AMF_ADMIN_REPAIRED) { > - rc = SA_AIS_ERR_NOT_SUPPORTED; > - LOG_WA("Unsupported admin op for SU: %llu", op_id); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_NOT_SUPPORTED, NULL, > + "Unsupported admin op for SU: %llu", op_id); > goto done; > } > > if (cb->init_state != AVD_APP_STATE ) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("AMF (state %u) is not available for admin ops", > cb->init_state); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "AMF (state %u) is not available for admin > ops", cb->init_state); > goto done; > } > > @@ -899,29 +898,30 @@ static void su_admin_op_cb(SaImmOiHandle > > if ((su->sg_of_su->sg_ncs_spec == SA_TRUE) > && (cb->node_id_avd == su->su_on_node->node_info.nodeId)) { > - rc = SA_AIS_ERR_NOT_SUPPORTED; > - LOG_WA("Admin operation on Active middleware SU is not > allowed"); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_NOT_SUPPORTED, NULL, > + "Admin operation on Active middleware SU is not > allowed"); > goto done; > } > > /* Avoid multiple admin operations on other SUs belonging to the same > SG. */ > for (su_ptr = su->sg_of_su->list_of_su; su_ptr != NULL; su_ptr = > su_ptr->sg_list_su_next) { > if (su_ptr->pend_cbk.invocation != 0) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("Admin operation is already going on (su'%s')", > su_ptr->name.value); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "Admin operation is already going on > (su'%s')", su_ptr->name.value); > goto done; > } > } > > if (su->sg_of_su->sg_fsm_state != AVD_SG_FSM_STABLE) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("SG state is not stable"); /* whatever that means... */ > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "SG state is not stable"); /* whatever that > means... */ > goto done; > } > /* if Tolerance timer is running for any SI's withing this SG, then > return SA_AIS_ERR_TRY_AGAIN */ > if (sg_is_tolerance_timer_running_for_any_si(su->sg_of_su)) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("Tolerance timer is running for some of the SI's in the > SG '%s', so differing admin opr",su->sg_of_su->name.value); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "Tolerance timer is running for some of the > SI's in the SG '%s', " > + "so differing admin > opr",su->sg_of_su->name.value); > goto done; > } > > @@ -931,8 +931,9 @@ static void su_admin_op_cb(SaImmOiHandle > (op_id == SA_AMF_ADMIN_LOCK_INSTANTIATION)) > || > ((su->saAmfSUAdminState == SA_AMF_ADMIN_LOCKED) && (op_id == > SA_AMF_ADMIN_UNLOCK_INSTANTIATION))) { > > - rc = SA_AIS_ERR_NO_OP; > - LOG_WA("Admin operation (%llu) has no effect on current state > (%u)", op_id, su->saAmfSUAdminState); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "Admin operation (%llu) has no effect on > current state (%u)", op_id, > + su->saAmfSUAdminState); > goto done; > } > > @@ -950,16 +951,16 @@ static void su_admin_op_cb(SaImmOiHandle > ((su->saAmfSUAdminState != SA_AMF_ADMIN_UNLOCKED) && > (op_id == SA_AMF_ADMIN_SHUTDOWN))) { > > - rc = SA_AIS_ERR_BAD_OPERATION; > - LOG_WA("State transition invalid, state %u, op %llu", > su->saAmfSUAdminState, op_id); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "State transition invalid, state %u, op %llu", > su->saAmfSUAdminState, op_id); > goto done; > } > > m_AVD_GET_SU_NODE_PTR(cb, su, node); > if (node->admin_node_pend_cbk.admin_oper != 0) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("Node'%s' hosting SU'%s', undergoing admin > operation'%u'", node->name.value, su->name.value, > - node->admin_node_pend_cbk.admin_oper); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "Node'%s' hosting SU'%s', undergoing admin > operation'%u'", node->name.value, > + su->name.value, > node->admin_node_pend_cbk.admin_oper); > goto done; > } > > @@ -1000,8 +1001,8 @@ static void su_admin_op_cb(SaImmOiHandle > } else { > avd_su_readiness_state_set(su, > SA_AMF_READINESS_OUT_OF_SERVICE); > avd_su_admin_state_set(su, SA_AMF_ADMIN_LOCKED); > - rc = SA_AIS_ERR_FAILED_OPERATION; > - LOG_WA("SG redundancy model specific handler failed"); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_FAILED_OPERATION, NULL, > + "SG redundancy model specific handler > failed"); > goto done; > } > > @@ -1042,8 +1043,8 @@ static void su_admin_op_cb(SaImmOiHandle > } else { > avd_su_readiness_state_set(su, back_red_state); > avd_su_admin_state_set(su, back_admin_state); > - rc = SA_AIS_ERR_FAILED_OPERATION; > - LOG_WA("SG redundancy model specific handler failed"); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_FAILED_OPERATION, NULL, > + "SG redundancy model specific handler > failed"); > goto done; > } > > @@ -1059,8 +1060,8 @@ static void su_admin_op_cb(SaImmOiHandle > } > > if ( su->list_of_susi != NULL ) { > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_WA("SIs still assigned to this SU"); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "SIs still assigned to this SU"); > goto done; > } > > @@ -1089,8 +1090,8 @@ static void su_admin_op_cb(SaImmOiHandle > > goto done; > } > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_ER("Internal error, could not send message to > avnd"); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_TRY_AGAIN, NULL, > + "Internal error, could not send message > to avnd"); > goto done; > } else { > avd_su_admin_state_set(su, > SA_AMF_ADMIN_LOCKED_INSTANTIATION); > @@ -1103,8 +1104,8 @@ static void su_admin_op_cb(SaImmOiHandle > case SA_AMF_ADMIN_UNLOCK_INSTANTIATION: > > if (NULL == su->list_of_comp) { > - LOG_WA("There is no component configured for SU '%s'.", > su->name.value); > - rc = SA_AIS_ERR_BAD_OPERATION; > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "There is no component configured for > SU '%s'.", su->name.value); > goto done; > } > > @@ -1119,9 +1120,9 @@ static void su_admin_op_cb(SaImmOiHandle > } > > if (su->saAmfSUPresenceState != SA_AMF_PRESENCE_UNINSTANTIATED) > { > - LOG_WA("Can't instantiate '%s', whose presense state is > '%u'", su_name->value, > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_BAD_OPERATION, NULL, > + "Can't instantiate '%s', whose presense > state is '%u'", su_name->value, > su->saAmfSUPresenceState); > - rc = SA_AIS_ERR_BAD_OPERATION; > goto done; > } > > @@ -1141,8 +1142,8 @@ static void su_admin_op_cb(SaImmOiHandle > > goto done; > } > - rc = SA_AIS_ERR_TRY_AGAIN; > - LOG_ER("Internal error, could not send message to > avnd"); > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_TRY_AGAIN, &su->pend_cbk, > + "Internal error, could not send message > to avnd"); > } else { > avd_su_admin_state_set(su, SA_AMF_ADMIN_LOCKED); > avd_saImmOiAdminOperationResult(immoi_handle, > invocation, SA_AIS_OK); > @@ -1152,8 +1153,8 @@ static void su_admin_op_cb(SaImmOiHandle > break; > case SA_AMF_ADMIN_REPAIRED: > if (su->saAmfSUOperState == SA_AMF_OPERATIONAL_ENABLED) { > - LOG_NO("Admin repair request for '%s', op state already > enabled", su_name->value); > - rc = SA_AIS_ERR_NO_OP; > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_NO_OP, NULL, > + "Admin repair request for '%s', op > state already enabled", su_name->value); > goto done; > } > > @@ -1162,24 +1163,21 @@ static void su_admin_op_cb(SaImmOiHandle > su->su_on_node) == NCSCC_RC_SUCCESS) { > su->pend_cbk.admin_oper = > static_cast<SaAmfAdminOperationIdT>(op_id); > su->pend_cbk.invocation = invocation; > - rc = SA_AIS_OK; > } > else { > - LOG_WA("Admin op request send failed '%s'", > su_name->value); > - rc = SA_AIS_ERR_TIMEOUT; > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_TIMEOUT, NULL, > + "Admin op request send failed '%s'", > su_name->value); > } > break; > default: > - LOG_ER("Unsupported admin op"); > - rc = SA_AIS_ERR_INVALID_PARAM; > + report_admin_op_error(immoi_handle, invocation, > SA_AIS_ERR_INVALID_PARAM, NULL, > + "Unsupported admin op"); > break; > } > > done: > - if (rc != SA_AIS_OK) > - avd_saImmOiAdminOperationResult(immoi_handle, invocation, rc); > > - TRACE_LEAVE2("%u", rc); > + TRACE_LEAVE2(); > } > > static SaAisErrorT su_rt_attr_cb(SaImmOiHandleT immOiHandle, > > ------------------------------------------------------------------------------ > DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps > OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access > Free app hosting. Or install the open source package on any LAMP server. > Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! > http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk > _______________________________________________ > Opensaf-devel mailing list > Opensaf-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/opensaf-devel > > ------------------------------------------------------------------------------ > DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps > OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access > Free app hosting. Or install the open source package on any LAMP server. > Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! > http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk > _______________________________________________ > Opensaf-devel mailing list > Opensaf-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/opensaf-devel > > ------------------------------------------------------------------------------ Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel