* Again remove the change in avnd_su_pres_fsm_run() and move the same
to the SU FSM state handlers or avnd_su_pres_st_chng_prc(). If some
handling is missing for NPI SUs it needs to be fixed.
* Remove the check of redundancy model in avnd_sufailover_in_progress()
* Rename avnd_sufailover_in_progress() to su_failover_in_progress()
* Again remove all_comps_terminated_in_su(), not needed. The same
information is there when SU enters UNINSTANTIATED pres state

Thanks,
Hans

On 28 June 2013 08:22,  <[email protected]> wrote:
>  osaf/services/saf/avsv/avnd/avnd_clc.c  |   82 +++++++++++---------
>  osaf/services/saf/avsv/avnd/avnd_comp.c |    2 +-
>  osaf/services/saf/avsv/avnd/avnd_su.c   |    1 +
>  osaf/services/saf/avsv/avnd/avnd_susm.c |  127 
> ++++++++++++++++++++++++-------
>  4 files changed, 146 insertions(+), 66 deletions(-)
>
>
> Refloating the patch after incorporating comments.
>
> diff --git a/osaf/services/saf/avsv/avnd/avnd_clc.c 
> b/osaf/services/saf/avsv/avnd/avnd_clc.c
> --- a/osaf/services/saf/avsv/avnd/avnd_clc.c
> +++ b/osaf/services/saf/avsv/avnd/avnd_clc.c
> @@ -1065,8 +1065,8 @@ uint32_t avnd_comp_clc_st_chng_prc(AVND_
>                         if (m_AVND_COMP_IS_FAILED(comp) && 
> !comp->csi_list.n_nodes &&
>                             !m_AVND_SU_IS_ADMN_TERM(comp->su) &&
>                             (cb->oper_state == SA_AMF_OPERATIONAL_ENABLED)) {
> -                               /* No need to restart component during 
> shutdown */
> -                               if (!m_AVND_IS_SHUTTING_DOWN(cb))
> +                               /* No need to restart component during 
> shutdown and during sufailover*/
> +                               if (!m_AVND_IS_SHUTTING_DOWN(cb) && 
> !avnd_sufailover_in_progress(comp->su))
>                                         rc = avnd_comp_clc_fsm_trigger(cb, 
> comp, AVND_COMP_CLC_PRES_FSM_EV_INST);
>                         } else if (m_AVND_COMP_IS_FAILED(comp) && 
> !comp->csi_list.n_nodes) {
>                                 m_AVND_COMP_FAILED_RESET(comp); /*if we moved 
> from restart -> term
> @@ -1099,33 +1099,38 @@ uint32_t avnd_comp_clc_st_chng_prc(AVND_
>                                 goto done;
>                         m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp, 
> AVND_CKPT_COMP_OPER_STATE);
>
> -                       if (!m_AVND_COMP_IS_FAILED(comp)) {
> -                               /* csi-set / csi-rem succeeded.. generate 
> csi-done indication */
> -                               csi = 
> m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(m_NCS_DBLIST_FIND_FIRST(&comp->csi_list));
> -                               osafassert(csi);
> -                               if 
> (m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_ASSIGNING(csi))
> -                                       rc = avnd_comp_csi_assign_done(cb, 
> comp,
> -                                                                      
> m_AVND_COMP_IS_ALL_CSI(comp) ? 0 : csi);
> -                               else if 
> (m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_REMOVING(csi))
> -                                       rc = avnd_comp_csi_remove_done(cb, 
> comp,
> -                                                                      
> m_AVND_COMP_IS_ALL_CSI(comp) ? 0 : csi);
> -                               if (NCSCC_RC_SUCCESS != rc)
> -                                       goto done;
> -                       } else {
> -                               /* failed su is ready to take on si 
> assignment.. inform avd */
> -                               if (!comp->csi_list.n_nodes) {
> -                                       m_AVND_SU_IS_ENABLED(comp->su, is_en);
> -                                       if (true == is_en) {
> -                                               
> m_AVND_SU_OPER_STATE_SET(comp->su,SA_AMF_OPERATIONAL_ENABLED);
> -                                               
> m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp->su, AVND_CKPT_SU_OPER_STATE);
> -                                               rc = avnd_di_oper_send(cb, 
> comp->su, 0);
> -                                               if (NCSCC_RC_SUCCESS != rc)
> -                                                       goto done;
> +                       if (avnd_sufailover_in_progress(comp->su)) {
> +                               /*Do not reset any flag, this will be done as 
> a part of repair.*/
> +                       }
> +                       else {
> +                               if (!m_AVND_COMP_IS_FAILED(comp)) {
> +                                       /* csi-set / csi-rem succeeded.. 
> generate csi-done indication */
> +                                       csi = 
> m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(m_NCS_DBLIST_FIND_FIRST(&comp->csi_list));
> +                                       osafassert(csi);
> +                                       if 
> (m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_ASSIGNING(csi))
> +                                               rc = 
> avnd_comp_csi_assign_done(cb, comp,
> +                                                               
> m_AVND_COMP_IS_ALL_CSI(comp) ? 0 : csi);
> +                                       else if 
> (m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_REMOVING(csi))
> +                                               rc = 
> avnd_comp_csi_remove_done(cb, comp,
> +                                                               
> m_AVND_COMP_IS_ALL_CSI(comp) ? 0 : csi);
> +                                       if (NCSCC_RC_SUCCESS != rc)
> +                                               goto done;
> +                               } else {
> +                                       /* failed su is ready to take on si 
> assignment.. inform avd */
> +                                       if (!comp->csi_list.n_nodes) {
> +                                               
> m_AVND_SU_IS_ENABLED(comp->su, is_en);
> +                                               if (true == is_en) {
> +                                                       
> m_AVND_SU_OPER_STATE_SET(comp->su,SA_AMF_OPERATIONAL_ENABLED);
> +                                                       
> m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp->su, AVND_CKPT_SU_OPER_STATE);
> +                                                       rc = 
> avnd_di_oper_send(cb, comp->su, 0);
> +                                                       if (NCSCC_RC_SUCCESS 
> != rc)
> +                                                               goto done;
> +                                               }
> +                                               
> m_AVND_COMP_FAILED_RESET(comp);
> +                                               
> m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp, AVND_CKPT_COMP_FLAG_CHANGE);
>                                         }
> -                                       m_AVND_COMP_FAILED_RESET(comp);
> -                                       m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, 
> comp, AVND_CKPT_COMP_FLAG_CHANGE);
> +
>                                 }
> -
>                         }
>                 }
>
> @@ -1190,12 +1195,17 @@ uint32_t avnd_comp_clc_st_chng_prc(AVND_
>
>                 /* terminating -> uninstantiated */
>                 if ((SA_AMF_PRESENCE_TERMINATING == prv_st) && 
> (SA_AMF_PRESENCE_UNINSTANTIATED == final_st)) {
> -                       /* npi comps are enabled in uninstantiated state */
> -                       m_AVND_COMP_OPER_STATE_SET(comp, 
> SA_AMF_OPERATIONAL_ENABLED);
> -                       m_AVND_COMP_OPER_STATE_AVD_SYNC(cb, comp, rc);
> -                       if (NCSCC_RC_SUCCESS != rc)
> -                               goto done;
> -                       m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp, 
> AVND_CKPT_COMP_OPER_STATE);
> +                       if (avnd_sufailover_in_progress(comp->su)) {
> +                               /*Do not reset any flag, this will be done as 
> a part of repair.*/
> +                       }
> +                       else {
> +                               /* npi comps are enabled in uninstantiated 
> state */
> +                               m_AVND_COMP_OPER_STATE_SET(comp, 
> SA_AMF_OPERATIONAL_ENABLED);
> +                               m_AVND_COMP_OPER_STATE_AVD_SYNC(cb, comp, rc);
> +                               if (NCSCC_RC_SUCCESS != rc)
> +                                       goto done;
> +                               m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp, 
> AVND_CKPT_COMP_OPER_STATE);
> +                       }
>                 }
>
>                 /* Instantiating -> Instantiationfailed */
> @@ -2763,7 +2773,7 @@ uint32_t avnd_comp_clc_cmd_execute(AVND_
>  uint32_t avnd_instfail_su_failover(AVND_CB *cb, AVND_SU *su, AVND_COMP 
> *failed_comp)
>  {
>         uint32_t rc = NCSCC_RC_SUCCESS;
> -       TRACE_ENTER2("Executing SU Failover: Instantiation failed SU: '%s' : 
> Failed component: '%s'",
> +       TRACE_ENTER2("Executing Component Failover: Instantiation failed SU: 
> '%s' : Failed component: '%s'",
>                                                                 
> su->name.value, failed_comp->name.value);
>
>         /* mark the comp failed */
> @@ -2812,12 +2822,12 @@ uint32_t avnd_instfail_su_failover(AVND_
>                 m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
> AVND_CKPT_SU_OPER_STATE);
>
>                 /* inform AvD */
> -               rc = avnd_di_oper_send(cb, su, AVSV_ERR_RCVR_SU_FAILOVER);
> +               rc = avnd_di_oper_send(cb, su, SA_AMF_COMPONENT_FAILOVER);
>         }
>
>   done:
>         if (rc == NCSCC_RC_SUCCESS)
> -               LOG_NO("SU Failover trigerred for '%s': Failed component: 
> '%s'",
> +               LOG_NO("Component Failover trigerred for '%s': Failed 
> component: '%s'",
>                         su->name.value, failed_comp->name.value);
>         TRACE_LEAVE2("%u", rc);
>         return rc;
> 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
> @@ -872,7 +872,7 @@ uint32_t avnd_comp_unreg_prc(AVND_CB *cb
>                         m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp->su, 
> AVND_CKPT_SU_OPER_STATE);
>
>                         /* inform AvD */
> -                       rc = avnd_di_oper_send(cb, comp->su, 0);
> +                       rc = avnd_di_oper_send(cb, comp->su, 
> SA_AMF_COMPONENT_FAILOVER);
>                 }
>         }
>
> diff --git a/osaf/services/saf/avsv/avnd/avnd_su.c 
> b/osaf/services/saf/avsv/avnd/avnd_su.c
> --- a/osaf/services/saf/avsv/avnd/avnd_su.c
> +++ b/osaf/services/saf/avsv/avnd/avnd_su.c
> @@ -494,6 +494,7 @@ uint32_t avnd_evt_su_admin_op_req(AVND_C
>                 m_AVND_SU_OPER_STATE_SET(su, SA_AMF_OPERATIONAL_ENABLED);
>                 avnd_di_uns32_upd_send(AVSV_SA_AMF_SU, saAmfSUOperState_ID, 
> &su->name, su->oper);
>                 avnd_su_pres_state_set(su, SA_AMF_PRESENCE_UNINSTANTIATED);
> +               rc = avnd_di_oper_send(cb, su, 0);
>
>                 if (!comp_in_term_failed_state())
>                         avnd_failed_state_file_delete();
> 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
> @@ -56,7 +56,6 @@ static uint32_t avnd_su_pres_inst_compin
>  static uint32_t avnd_su_pres_instfailed_compuninst(AVND_CB *, AVND_SU *, 
> AVND_COMP *);
>
>  static uint32_t avnd_su_pres_st_chng_prc(AVND_CB *, AVND_SU *, 
> SaAmfPresenceStateT, SaAmfPresenceStateT);
> -
>  /****************************************************************************
>   * S E R V I C E  U N I T  P R E S  F S M  M A T R I X  D E F I N I T I O N *
>   
> ****************************************************************************/
> @@ -1262,6 +1261,32 @@ done:
>         return rc;
>  }
>
> +
> +/**
> + * Check if all components have been terminated in the su.
> + * @param su
> + * @return bool
> + */
> +static bool all_comps_terminated_in_su(AVND_SU *su)
> +{
> +       AVND_COMP *comp;
> +
> +       for (comp = 
> m_AVND_COMP_FROM_SU_DLL_NODE_GET(m_NCS_DBLIST_FIND_FIRST(&su->comp_list));
> +                       comp;
> +                       comp = 
> m_AVND_COMP_FROM_SU_DLL_NODE_GET(m_NCS_DBLIST_FIND_NEXT(&comp->su_dll_node))) 
> {
> +
> +               if ((comp->pres != SA_AMF_PRESENCE_UNINSTANTIATED) &&
> +                               (comp->pres != 
> SA_AMF_PRESENCE_INSTANTIATION_FAILED) &&
> +                               (comp->pres != 
> SA_AMF_PRESENCE_TERMINATION_FAILED)) {
> +
> +                       TRACE("'%s' not terminated, pres.st=%u", 
> comp->name.value, comp->pres);
> +                       return false;
> +               }
> +       }
> +
> +       return true;
> +}
> +
>  /****************************************************************************
>    Name          : avnd_su_pres_fsm_run
>
> @@ -1300,6 +1325,21 @@ uint32_t avnd_su_pres_fsm_run(AVND_CB *c
>
>         TRACE_1("Exited SU presence state FSM: New State = %u",final_st);
>
> +       /*Complete su failover at amfnd*/
> +        if (avnd_sufailover_in_progress(su) && 
> (all_comps_terminated_in_su(su))) {
> +                TRACE("SU_FAILOVER for '%s'", su->name.value);
> +                /* Since all components got successfully terminated, finish 
> sufailover at amfnd
> +                   by deleting SUSIs at amfnd and informing amfd about 
> sufailover.*/
> +                LOG_NO("Terminated all components in '%s'", su->name.value);
> +                LOG_NO("Informing director of sufailover");
> +                rc = avnd_di_oper_send(avnd_cb, su, 
> AVSV_ERR_RCVR_SU_FAILOVER);
> +                osafassert(NCSCC_RC_SUCCESS == rc);
> +                avnd_su_si_del(avnd_cb, &su->name);
> +               if (!m_AVND_SU_IS_PREINSTANTIABLE(su))
> +                       avnd_su_pres_state_set(su, 
> SA_AMF_PRESENCE_UNINSTANTIATED);
> +               goto done;
> +        }
> +
>         /* process state change */
>         if (prv_st != final_st)
>                 rc = avnd_su_pres_st_chng_prc(cb, su, prv_st, final_st);
> @@ -1411,17 +1451,24 @@ uint32_t avnd_su_pres_st_chng_prc(AVND_C
>                 /* terminating -> uninstantiated */
>                 if ((SA_AMF_PRESENCE_TERMINATING == prv_st) && 
> (SA_AMF_PRESENCE_UNINSTANTIATED == final_st)) {
>                         TRACE("SU Terminating -> Uninstantiated");
> -                       /* reset the su failed flag */
> -                       if (m_AVND_SU_IS_FAILED(su)) {
> -                               m_AVND_SU_FAILED_RESET(su);
> -                               m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
> AVND_CKPT_SU_FLAG_CHANGE);
> +                       if (avnd_sufailover_in_progress(su)) {
> +                               /*Do not reset any flag, this will be done as 
> a part of repair.*/
>                         }
> +                       else
> +                       {
> +                               /* reset the su failed flag */
> +                               if (m_AVND_SU_IS_FAILED(su)) {
> +                                       m_AVND_SU_FAILED_RESET(su);
> +                                       m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, 
> su, AVND_CKPT_SU_FLAG_CHANGE);
> +                               }
>
> -                       /* reset the su restart falg */
> -                       if (m_AVND_SU_IS_RESTART(su)) {
> -                               m_AVND_SU_RESTART_RESET(su);
> -                               m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
> AVND_CKPT_SU_FLAG_CHANGE);
> +                               /* reset the su restart flag */
> +                               if (m_AVND_SU_IS_RESTART(su)) {
> +                                       m_AVND_SU_RESTART_RESET(su);
> +                                       m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, 
> su, AVND_CKPT_SU_FLAG_CHANGE);
> +                               }
>                         }
> +                       goto done;
>                 }
>
>                 /* instantiating -> inst-failed */
> @@ -1430,7 +1477,7 @@ uint32_t avnd_su_pres_st_chng_prc(AVND_C
>                         /* send the su-oper state msg (to indicate that 
> instantiation failed) */
>                         m_AVND_SU_OPER_STATE_SET(su, 
> SA_AMF_OPERATIONAL_DISABLED);
>                         m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
> AVND_CKPT_SU_OPER_STATE);
> -                       rc = avnd_di_oper_send(cb, su, 
> AVSV_ERR_RCVR_SU_FAILOVER);
> +                       rc = avnd_di_oper_send(cb, su, 
> SA_AMF_COMPONENT_FAILOVER);
>                         if (NCSCC_RC_SUCCESS != rc)
>                                 goto done;
>                 }
> @@ -1457,7 +1504,7 @@ uint32_t avnd_su_pres_st_chng_prc(AVND_C
>                                 TRACE("SU oper state is enabled");
>                                 m_AVND_SU_OPER_STATE_SET(su, 
> SA_AMF_OPERATIONAL_DISABLED);
>                                 m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
> AVND_CKPT_SU_OPER_STATE);
> -                               rc = avnd_di_oper_send(cb, su, 
> AVSV_ERR_RCVR_SU_FAILOVER);
> +                               rc = avnd_di_oper_send(cb, su, 
> SA_AMF_COMPONENT_FAILOVER);
>                                 if (NCSCC_RC_SUCCESS != rc)
>                                         goto done;
>                         }
> @@ -1471,7 +1518,7 @@ uint32_t avnd_su_pres_st_chng_prc(AVND_C
>                         m_AVND_SU_OPER_STATE_SET(su, 
> SA_AMF_OPERATIONAL_DISABLED);
>                         m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
> AVND_CKPT_SU_OPER_STATE);
>                         /* inform AvD about oper state change */
> -                       rc = avnd_di_oper_send(cb, su, 0);
> +                       rc = avnd_di_oper_send(cb, su, 
> SA_AMF_COMPONENT_FAILOVER);
>                         if (NCSCC_RC_SUCCESS != rc)
>                                 goto done;
>
> @@ -1515,7 +1562,7 @@ uint32_t avnd_su_pres_st_chng_prc(AVND_C
>                         m_AVND_SU_OPER_STATE_SET(su, 
> SA_AMF_OPERATIONAL_DISABLED);
>                         m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
> AVND_CKPT_SU_OPER_STATE);
>
> -                       rc = avnd_di_oper_send(cb, su, 
> AVSV_ERR_RCVR_SU_FAILOVER);
> +                       rc = avnd_di_oper_send(cb, su, 
> SA_AMF_COMPONENT_FAILOVER);
>
>                 }
>
> @@ -1531,15 +1578,21 @@ uint32_t avnd_su_pres_st_chng_prc(AVND_C
>                 /* terminating -> uninstantiated */
>                 if ((SA_AMF_PRESENCE_TERMINATING == prv_st) && 
> (SA_AMF_PRESENCE_UNINSTANTIATED == final_st)) {
>                         TRACE("Terminating -> UnInstantiated");
> -                       /* si assignment/removal success.. generate si-oper 
> done indication */
> -                       rc = avnd_su_si_oper_done(cb, su, 
> m_AVND_SU_IS_ALL_SI(su) ? 0 : si);
> -                       m_AVND_SU_ALL_SI_RESET(su);
> -                       m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
> AVND_CKPT_SU_FLAG_CHANGE);
> +                       if (avnd_sufailover_in_progress(su)) {
> +                               /*Do not reset any flag, this will be done as 
> a part of repair.*/
> +                       }
> +                       else
> +                       {
> +                               /* si assignment/removal success.. generate 
> si-oper done indication */
> +                               rc = avnd_su_si_oper_done(cb, su, 
> m_AVND_SU_IS_ALL_SI(su) ? 0 : si);
> +                               m_AVND_SU_ALL_SI_RESET(su);
> +                               m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
> AVND_CKPT_SU_FLAG_CHANGE);
>
> -                       /* npi su is enabled in uninstantiated state */
> -                       m_AVND_SU_OPER_STATE_SET(su, 
> SA_AMF_OPERATIONAL_ENABLED);
> -                       m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
> AVND_CKPT_SU_OPER_STATE);
> -                       rc = avnd_di_oper_send(cb, su, 0);
> +                               /* npi su is enabled in uninstantiated state 
> */
> +                               m_AVND_SU_OPER_STATE_SET(su, 
> SA_AMF_OPERATIONAL_ENABLED);
> +                               m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
> AVND_CKPT_SU_OPER_STATE);
> +                               rc = avnd_di_oper_send(cb, su, 0);
> +                       }
>                 }
>
>                 /* terminating/instantiated/restarting -> term-failed */
> @@ -1550,7 +1603,7 @@ uint32_t avnd_su_pres_st_chng_prc(AVND_C
>                         m_AVND_SU_OPER_STATE_SET(su, 
> SA_AMF_OPERATIONAL_DISABLED);
>                         m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, su, 
> AVND_CKPT_SU_OPER_STATE);
>                         /* inform AvD about oper state change */
> -                       rc = avnd_di_oper_send(cb, su, 0);
> +                       rc = avnd_di_oper_send(cb, su, 
> SA_AMF_COMPONENT_FAILOVER);
>
>                         /* si assignment/removal failed.. inform AvD */
>                         rc = avnd_di_susi_resp_send(cb, su, 
> m_AVND_SU_IS_ALL_SI(su) ? 0 : si);
> @@ -2085,11 +2138,9 @@ uint32_t avnd_su_pres_inst_compterming_h
>         TRACE_ENTER2("CompTerminating event in the Instantiated state:'%s' : 
> '%s'",
>                                  su->name.value, compname);
>
> -       if (m_AVND_SU_IS_PREINSTANTIABLE(su)) {
> -               if (m_AVND_SU_IS_FAILED(su)) {
> -                       /* transition to terminating state */
> -                       avnd_su_pres_state_set(su, 
> SA_AMF_PRESENCE_TERMINATING);
> -               }
> +       if (m_AVND_SU_IS_FAILED(su)) {
> +               /* transition to terminating state */
> +               avnd_su_pres_state_set(su, SA_AMF_PRESENCE_TERMINATING);
>         }
>
>         TRACE_LEAVE2("%u", rc);
> @@ -2258,7 +2309,9 @@ uint32_t avnd_su_pres_terming_compuninst
>                                  su->name.value, compname);
>
>         /* This case is for handling the case of admn su term while su is 
> restarting */
> -       if (m_AVND_SU_IS_PREINSTANTIABLE(su) && m_AVND_SU_IS_FAILED(su) && 
> m_AVND_SU_IS_ADMN_TERM(su)) {
> +       if (m_AVND_SU_IS_PREINSTANTIABLE(su) && m_AVND_SU_IS_FAILED(su) &&
> +                       (m_AVND_SU_IS_ADMN_TERM(su) || 
> avnd_sufailover_in_progress(su)))
> +       {
>                 TRACE("PI SU");
>                 for (curr_comp = 
> m_AVND_COMP_FROM_SU_DLL_NODE_GET(m_NCS_DBLIST_FIND_FIRST(&su->comp_list));
>                      curr_comp;
> @@ -2274,6 +2327,7 @@ uint32_t avnd_su_pres_terming_compuninst
>                 }
>         }
>
> +
>         /*
>          * If pi su, pick the prv pi comp & trigger it's FSM with TermEv.
>          */
> @@ -2304,7 +2358,7 @@ uint32_t avnd_su_pres_terming_compuninst
>         /*
>          * If npi su, pick the prv csi & trigger it's comp fsm with TermEv.
>          */
> -       if (!m_AVND_SU_IS_PREINSTANTIABLE(su)) {
> +       if (!m_AVND_SU_IS_PREINSTANTIABLE(su) &&  !m_AVND_SU_IS_FAILED(su)) {
>                 TRACE("NPI SU");
>                 /* get the only csi rec */
>                 curr_csi = 
> m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(m_NCS_DBLIST_FIND_FIRST(&comp->csi_list));
> @@ -2730,3 +2784,18 @@ uint32_t avnd_su_pres_instfailed_compuni
>         return rc;
>  }
>
> +/**
> + * This function checks if the sufailover is going on.
> + * @param su: ptr to the SU .
> + *
> + * @return true/false.
> + */
> +bool avnd_sufailover_in_progress(AVND_SU *su)
> +{
> +       if (m_AVND_SU_IS_FAILED(su) && (su->sufailover) &&
> +                       ((su->sg_redundancy_model == 
> SA_AMF_2N_REDUNDANCY_MODEL) ||
> +                        (su->sg_redundancy_model == 
> SA_AMF_NO_REDUNDANCY_MODEL)) &&
> +                        (avnd_cb->oper_state != SA_AMF_OPERATIONAL_DISABLED) 
> && (!su->is_ncs))
> +                               return true;
> +       return false;
> +}
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> Opensaf-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to