osaf/services/saf/amf/amfd/include/proc.h | 5 ----- osaf/services/saf/amf/amfd/include/sg.h | 14 ++++++++++++-- osaf/services/saf/amf/amfd/sg_2n_fsm.cc | 22 +--------------------- osaf/services/saf/amf/amfd/sg_nored_fsm.cc | 22 +--------------------- osaf/services/saf/amf/amfd/sg_npm_fsm.cc | 22 +--------------------- osaf/services/saf/amf/amfd/sg_nway_fsm.cc | 19 +------------------ osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc | 22 +--------------------- 7 files changed, 17 insertions(+), 109 deletions(-)
diff --git a/osaf/services/saf/amf/amfd/include/proc.h b/osaf/services/saf/amf/amfd/include/proc.h --- a/osaf/services/saf/amf/amfd/include/proc.h +++ b/osaf/services/saf/amf/amfd/include/proc.h @@ -53,7 +53,6 @@ uint32_t avd_sg_susi_mod_snd_honouring_s uint32_t avd_sg_su_si_del_snd(AVD_CL_CB *cb, AVD_SU *su); /* The following are for 2N redundancy model */ -uint32_t avd_sg_2n_su_fault_func(AVD_CL_CB *cb, AVD_SU *su); uint32_t avd_sg_2n_susi_sucss_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); uint32_t avd_sg_2n_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, @@ -63,7 +62,6 @@ void avd_sg_2n_init(AVD_SG *sg); /* The following are for N-Way redundancy model */ uint32_t avd_sg_nway_si_assign(AVD_CL_CB *, AVD_SG *); -uint32_t avd_sg_nway_su_fault_func(AVD_CL_CB *cb, AVD_SU *su); uint32_t avd_sg_nway_susi_sucss_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); uint32_t avd_sg_nway_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, @@ -72,7 +70,6 @@ uint32_t avd_sg_nway_su_admin_fail(AVD_C void avd_sg_nway_init(AVD_SG *sg); /* The following are for N+M redundancy model */ -uint32_t avd_sg_npm_su_fault_func(AVD_CL_CB *cb, AVD_SU *su); uint32_t avd_sg_npm_susi_sucss_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); uint32_t avd_sg_npm_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, @@ -81,7 +78,6 @@ uint32_t avd_sg_npm_su_admin_fail(AVD_CL void avd_sg_npm_init(AVD_SG *sg); /* The following are for No redundancy model */ -uint32_t avd_sg_nored_su_fault_func(AVD_CL_CB *cb, AVD_SU *su); uint32_t avd_sg_nored_susi_sucss_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); uint32_t avd_sg_nored_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, @@ -91,7 +87,6 @@ void avd_sg_nored_init(AVD_SG *sg); /* The following are for N-way Active redundancy model */ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD_CL_CB *cb, AVD_SG *sg); -uint32_t avd_sg_nacvred_su_fault_func(AVD_CL_CB *cb, AVD_SU *su); uint32_t avd_sg_nacvred_susi_sucss_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, AVSV_SUSI_ACT act, SaAmfHAStateT state); uint32_t avd_sg_nacvred_susi_fail_func(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi, diff --git a/osaf/services/saf/amf/amfd/include/sg.h b/osaf/services/saf/amf/amfd/include/sg.h --- a/osaf/services/saf/amf/amfd/include/sg.h +++ b/osaf/services/saf/amf/amfd/include/sg.h @@ -270,8 +270,13 @@ public: */ virtual uint32_t su_insvc(AVD_CL_CB *cb, AVD_SU *su) = 0; - // Handle SU failure and switch over assignments - uint32_t (*su_fault)(AVD_CL_CB *cb, AVD_SU *su); + /** + * Handle SU failure and switch over assignments + * @param cb + * @param su + * @return + */ + virtual uint32_t su_fault(AVD_CL_CB *cb, AVD_SU *su) = 0; // Handle SU admin op LOCK/SHUTDOWN uint32_t (*su_admin_down)(AVD_CL_CB *cb, AVD_SU *su, @@ -306,6 +311,7 @@ public: SaAisErrorT si_swap(AVD_SI *si, SaInvocationT invocation); uint32_t sg_admin_down(AVD_CL_CB *cb, AVD_SG *sg); uint32_t su_insvc(AVD_CL_CB *cb, AVD_SU *su); + uint32_t su_fault(AVD_CL_CB *cb, AVD_SU *su); }; /** @@ -320,6 +326,7 @@ public: uint32_t si_admin_down(AVD_CL_CB *cb, AVD_SI *si); uint32_t sg_admin_down(AVD_CL_CB *cb, AVD_SG *sg); uint32_t su_insvc(AVD_CL_CB *cb, AVD_SU *su); + uint32_t su_fault(AVD_CL_CB *cb, AVD_SU *su); }; /** @@ -334,6 +341,7 @@ public: uint32_t si_admin_down(AVD_CL_CB *cb, AVD_SI *si); uint32_t sg_admin_down(AVD_CL_CB *cb, AVD_SG *sg); uint32_t su_insvc(AVD_CL_CB *cb, AVD_SU *su); + uint32_t su_fault(AVD_CL_CB *cb, AVD_SU *su); }; /** @@ -348,6 +356,7 @@ public: uint32_t si_admin_down(AVD_CL_CB *cb, AVD_SI *si); uint32_t sg_admin_down(AVD_CL_CB *cb, AVD_SG *sg); uint32_t su_insvc(AVD_CL_CB *cb, AVD_SU *su); + uint32_t su_fault(AVD_CL_CB *cb, AVD_SU *su); }; /** @@ -362,6 +371,7 @@ public: uint32_t si_admin_down(AVD_CL_CB *cb, AVD_SI *si); uint32_t sg_admin_down(AVD_CL_CB *cb, AVD_SG *sg); uint32_t su_insvc(AVD_CL_CB *cb, AVD_SU *su); + uint32_t su_fault(AVD_CL_CB *cb, AVD_SU *su); }; diff --git a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc --- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc +++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc @@ -1191,26 +1191,7 @@ done: return rc; } - /***************************************************************************** - * Function: avd_sg_2n_su_fault_func - * - * Purpose: This function is called when a SU readiness state changes to - * OOS due to a fault. It will do the functionality specified in - * SG FSM. - * - * Input: cb - the AVD control block - * su - The pointer to the service unit. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * NOTES: None. - * - * - **************************************************************************/ - -uint32_t avd_sg_2n_su_fault_func(AVD_CL_CB *cb, AVD_SU *su) -{ +uint32_t SG_2N::su_fault(AVD_CL_CB *cb, AVD_SU *su) { AVD_SU *a_su; AVD_SU_SI_REL *l_susi, *o_susi; uint32_t rc = NCSCC_RC_FAILURE; @@ -4043,7 +4024,6 @@ AVD_SU *get_other_su_from_oper_list(AVD_ */ void avd_sg_2n_init(AVD_SG *sg) { - sg->su_fault = avd_sg_2n_su_fault_func; sg->su_admin_down = avd_sg_2n_su_admin_fail; sg->susi_success = avd_sg_2n_susi_sucss_func; sg->susi_failed = avd_sg_2n_susi_fail_func; diff --git a/osaf/services/saf/amf/amfd/sg_nored_fsm.cc b/osaf/services/saf/amf/amfd/sg_nored_fsm.cc --- a/osaf/services/saf/amf/amfd/sg_nored_fsm.cc +++ b/osaf/services/saf/amf/amfd/sg_nored_fsm.cc @@ -137,26 +137,7 @@ uint32_t SG_NORED::si_assign(AVD_CL_CB * return NCSCC_RC_SUCCESS; } - /***************************************************************************** - * Function: avd_sg_nored_su_fault_func - * - * Purpose: This function is called when a SU readiness state changes to - * OOS due to a fault. It will do the functionality specified in - * SG FSM. - * - * Input: cb - the AVD control block - * su - The pointer to the service unit. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * NOTES: None. - * - * - **************************************************************************/ - -uint32_t avd_sg_nored_su_fault_func(AVD_CL_CB *cb, AVD_SU *su) -{ +uint32_t SG_NORED::su_fault(AVD_CL_CB *cb, AVD_SU *su) { bool flag; AVD_AVND *su_node_ptr = NULL; @@ -1320,7 +1301,6 @@ uint32_t SG_NORED::sg_admin_down(AVD_CL_ */ void avd_sg_nored_init(AVD_SG *sg) { - sg->su_fault = avd_sg_nored_su_fault_func; sg->su_admin_down = avd_sg_nored_su_admin_fail; sg->susi_success = avd_sg_nored_susi_sucss_func; sg->susi_failed = avd_sg_nored_susi_fail_func; diff --git a/osaf/services/saf/amf/amfd/sg_npm_fsm.cc b/osaf/services/saf/amf/amfd/sg_npm_fsm.cc --- a/osaf/services/saf/amf/amfd/sg_npm_fsm.cc +++ b/osaf/services/saf/amf/amfd/sg_npm_fsm.cc @@ -1353,26 +1353,7 @@ static uint32_t avd_sg_npm_su_fault_sg_r return NCSCC_RC_SUCCESS; } - /***************************************************************************** - * Function: avd_sg_npm_su_fault_func - * - * Purpose: This function is called when a SU readiness state changes to - * OOS due to a fault. It will do the functionality specified in - * SG FSM. - * - * Input: cb - the AVD control block - * su - The pointer to the service unit. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * NOTES: None. - * - * - **************************************************************************/ - -uint32_t avd_sg_npm_su_fault_func(AVD_CL_CB *cb, AVD_SU *su) -{ +uint32_t SG_NPM::su_fault(AVD_CL_CB *cb, AVD_SU *su) { AVD_SU_SI_REL *a_susi; TRACE_ENTER2("%u", su->sg_of_su->sg_fsm_state); @@ -4500,7 +4481,6 @@ uint32_t SG_NPM::sg_admin_down(AVD_CL_CB */ void avd_sg_npm_init(AVD_SG *sg) { - sg->su_fault = avd_sg_npm_su_fault_func; sg->su_admin_down = avd_sg_npm_su_admin_fail; sg->susi_success = avd_sg_npm_susi_sucss_func; sg->susi_failed = avd_sg_npm_susi_fail_func; diff --git a/osaf/services/saf/amf/amfd/sg_nway_fsm.cc b/osaf/services/saf/amf/amfd/sg_nway_fsm.cc --- a/osaf/services/saf/amf/amfd/sg_nway_fsm.cc +++ b/osaf/services/saf/amf/amfd/sg_nway_fsm.cc @@ -172,23 +172,7 @@ done: return rc; } - /***************************************************************************** - * Function: avd_sg_nway_su_fault_func - * - * Purpose: This function is called when a SU readiness state changes to - * OOS due to a fault. It will do the functionality specified in - * SG FSM. - * - * Input: cb - the AVD control block - * su - The pointer to the service unit. - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * Notes: None. - * - **************************************************************************/ -uint32_t avd_sg_nway_su_fault_func(AVD_CL_CB *cb, AVD_SU *su) -{ +uint32_t SG_NWAY::su_fault(AVD_CL_CB *cb, AVD_SU *su) { uint32_t rc = NCSCC_RC_SUCCESS; TRACE_ENTER2(" SU '%s' sg_fsm_state %u", su->name.value, su->sg_of_su->sg_fsm_state); @@ -3592,7 +3576,6 @@ void avd_sg_nway_node_fail_sg_realign(AV */ void avd_sg_nway_init(AVD_SG *sg) { - sg->su_fault = avd_sg_nway_su_fault_func; sg->su_admin_down = avd_sg_nway_su_admin_fail; sg->susi_success = avd_sg_nway_susi_sucss_func; sg->susi_failed = avd_sg_nway_susi_fail_func; diff --git a/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc b/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc --- a/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc +++ b/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc @@ -249,26 +249,7 @@ uint32_t SG_NACV::si_assign(AVD_CL_CB *c return NCSCC_RC_SUCCESS; } - /***************************************************************************** - * Function: avd_sg_nacvred_su_fault_func - * - * Purpose: This function is called when a SU readiness state changes to - * OOS due to a fault. It will do the functionality specified in - * SG FSM. - * - * Input: cb - the AVD control block - * su - The pointer to the service unit. - * - * - * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE. - * - * NOTES: None. - * - * - **************************************************************************/ - -uint32_t avd_sg_nacvred_su_fault_func(AVD_CL_CB *cb, AVD_SU *su) -{ +uint32_t SG_NACV::su_fault(AVD_CL_CB *cb, AVD_SU *su) { bool flag; AVD_AVND *su_node_ptr = NULL; @@ -2043,7 +2024,6 @@ done: */ void avd_sg_nacv_init(AVD_SG *sg) { - sg->su_fault = avd_sg_nacvred_su_fault_func; sg->su_admin_down = avd_sg_nacvred_su_admin_fail; sg->susi_success = avd_sg_nacvred_susi_sucss_func; sg->susi_failed = avd_sg_nacvred_susi_fail_func; ------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://p.sf.net/sfu/hpccsystems _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel