osaf/services/saf/avsv/avnd/avnd_comp.c | 2 +- osaf/services/saf/avsv/avnd/avnd_susm.c | 44 ++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 10 deletions(-)
diff --git a/osaf/services/saf/avsv/avnd/avnd_comp.c b/osaf/services/saf/avsv/avnd/avnd_comp.c --- a/osaf/services/saf/avsv/avnd/avnd_comp.c +++ b/osaf/services/saf/avsv/avnd/avnd_comp.c @@ -1314,7 +1314,7 @@ } } - /* initiate csi assignment to npi comp */ + /* initiate CSI removal for NPI comp */ if (!m_AVND_COMP_TYPE_IS_PREINSTANTIABLE(comp)) { /* get the only csi record */ curr_csi = csi; diff --git a/osaf/services/saf/avsv/avnd/avnd_susm.c b/osaf/services/saf/avsv/avnd/avnd_susm.c --- a/osaf/services/saf/avsv/avnd/avnd_susm.c +++ b/osaf/services/saf/avsv/avnd/avnd_susm.c @@ -386,6 +386,7 @@ goto done; } csi_rec->single_csi_add_rem_in_si = AVSV_SUSI_ACT_DEL; + LOG_NO("Removing CSI '%s'", csi_param->csi_name.value); } rc = avnd_su_si_remove(cb, su, si); } @@ -780,16 +781,32 @@ /* initiate the si removal for npi su */ if (!m_AVND_SU_IS_PREINSTANTIABLE(su)) { - /* nothing to be done, termination already done in - quiescing/quiesced state */ - if (su->pres == SA_AMF_PRESENCE_INSTANTIATED) { - rc = avnd_su_pres_fsm_run(cb, su, 0, AVND_SU_PRES_FSM_EV_TERM); - if (NCSCC_RC_SUCCESS != rc) - goto done; + if ((si != NULL) && (si->single_csi_add_rem_in_si == AVSV_SUSI_ACT_DEL) && + (si->curr_state == SA_AMF_HA_ACTIVE)) { + /* we are removing a single CSI, first find it */ + for (curr_csi = (AVND_COMP_CSI_REC *)m_NCS_DBLIST_FIND_FIRST(&si->csi_list); + curr_csi != NULL; + curr_csi = (AVND_COMP_CSI_REC *)m_NCS_DBLIST_FIND_NEXT(&curr_csi->si_dll_node)) { + if (AVSV_SUSI_ACT_DEL == curr_csi->single_csi_add_rem_in_si) + break; + } + + osafassert(curr_csi != NULL); + rc = avnd_comp_csi_remove(cb, curr_csi->comp, curr_csi); + if (rc == NCSCC_RC_SUCCESS) + avnd_su_pres_state_set(su, SA_AMF_PRESENCE_TERMINATING); } else { - rc = avnd_su_si_oper_done(cb, su, si); - if (NCSCC_RC_SUCCESS != rc) - goto done; + /* nothing to be done, termination already done in + quiescing/quiesced state */ + if (su->pres == SA_AMF_PRESENCE_INSTANTIATED) { + rc = avnd_su_pres_fsm_run(cb, su, 0, AVND_SU_PRES_FSM_EV_TERM); + if (NCSCC_RC_SUCCESS != rc) + goto done; + } else { + rc = avnd_su_si_oper_done(cb, su, si); + if (NCSCC_RC_SUCCESS != rc) + goto done; + } } } @@ -2393,6 +2410,15 @@ m_AVND_COMP_CSI_CURR_ASSIGN_STATE_SET(curr_csi, AVND_COMP_CSI_ASSIGN_STATE_ASSIGNED); m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, curr_csi, AVND_CKPT_COMP_CSI_CURR_ASSIGN_STATE); + + if (curr_csi->single_csi_add_rem_in_si == AVSV_SUSI_ACT_DEL) { + /* get here when a CSI is removed from a component in an NPI SU */ + assert(curr_csi->si->single_csi_add_rem_in_si == AVSV_SUSI_ACT_DEL); + rc = avnd_su_si_oper_done(cb, su, curr_csi->si); + avnd_su_pres_state_set(su, SA_AMF_PRESENCE_INSTANTIATED); + goto done; + } + /* get the prv csi */ curr_csi = (AVND_COMP_CSI_REC *)m_NCS_DBLIST_FIND_PREV(&curr_csi->si_dll_node); if (curr_csi) { ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel