ack, code review only/Regards HansN
On 06/03/14 07:24, Hans Feldt wrote:
>   osaf/services/saf/amf/amfd/include/su.h |   2 ++
>   osaf/services/saf/amf/amfd/sgproc.cc    |  26 +++-----------------------
>   osaf/services/saf/amf/amfd/su.cc        |  19 +++++++++++++++++++
>   3 files changed, 24 insertions(+), 23 deletions(-)
>
>
> diff --git a/osaf/services/saf/amf/amfd/include/su.h 
> b/osaf/services/saf/amf/amfd/include/su.h
> --- a/osaf/services/saf/amf/amfd/include/su.h
> +++ b/osaf/services/saf/amf/amfd/include/su.h
> @@ -120,6 +120,8 @@ class AVD_SU {
>       bool is_in_service(void);
>       void reset_all_comps_assign_flag();
>       AVD_COMP *find_unassigned_comp_that_provides_cstype(const SaNameT 
> *cstype);
> +     void disable_comps(SaAisErrorT result);
> +
>   
>    private:
>       void send_attribute_update(AVSV_AMF_SU_ATTR_ID attrib_id);
> 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
> @@ -293,7 +293,7 @@ static uint32_t sg_su_failover_func(AVD_
>               su_complete_admin_op(su, SA_AIS_OK);
>       else
>               su_complete_admin_op(su, SA_AIS_ERR_TIMEOUT);
> -     su_disable_comps(su, SA_AIS_ERR_TIMEOUT);
> +     su->disable_comps(SA_AIS_ERR_TIMEOUT);
>       if (su->su_on_node->admin_node_pend_cbk.invocation != 0) {
>               /* Node level operation is going on the node hosting the SU for 
> which
>                  sufailover got escalated. Sufailover event will always come 
> after the
> @@ -1563,7 +1563,7 @@ void avd_node_down_mw_susi_failover(AVD_
>               i_su->set_pres_state(SA_AMF_PRESENCE_UNINSTANTIATED);
>               i_su->set_readiness_state(SA_AMF_READINESS_OUT_OF_SERVICE);
>               su_complete_admin_op(i_su, SA_AIS_ERR_TIMEOUT);
> -             su_disable_comps(i_su, SA_AIS_ERR_TIMEOUT);
> +             i_su->disable_comps(SA_AIS_ERR_TIMEOUT);
>   
>               /* Now analyze the service group for the new HA state
>                * assignments and send the SU SI assign messages
> @@ -1616,7 +1616,7 @@ void avd_node_down_appl_susi_failover(AV
>   
>               /* Check if there was any admin operations going on this SU. */
>               su_complete_admin_op(i_su, SA_AIS_ERR_TIMEOUT);
> -             su_disable_comps(i_su, SA_AIS_ERR_TIMEOUT);
> +             i_su->disable_comps(SA_AIS_ERR_TIMEOUT);
>   
>               i_su = i_su->avnd_list_su_next;
>       } /* while (i_su != AVD_SU_NULL) */
> @@ -2041,23 +2041,3 @@ void comp_complete_admin_op(AVD_COMP *co
>               comp->admin_pend_cbk.admin_oper = 
> static_cast<SaAmfAdminOperationIdT>(0);
>       }
>   }
> -/**
> - * @brief    Disable all components since SU is disabled and out of service.
> - *              It takes care of response to IMM for any admin operation 
> pending on components.
> - * @param    ptr to su
> - * @param    result
> - *
> - */
> -void su_disable_comps(AVD_SU *su, SaAisErrorT result)
> -{
> -     AVD_COMP *comp;
> -     for (comp = su->list_of_comp; comp; comp = comp->su_comp_next) {
> -             comp->curr_num_csi_actv = 0;
> -             comp->curr_num_csi_stdby = 0;
> -             avd_comp_oper_state_set(comp, SA_AMF_OPERATIONAL_DISABLED);
> -             avd_comp_pres_state_set(comp, SA_AMF_PRESENCE_UNINSTANTIATED);
> -             comp->saAmfCompRestartCount = 0;
> -             comp_complete_admin_op(comp, result);
> -             m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, comp, 
> AVSV_CKPT_AVD_COMP_CONFIG);
> -     }
> -}
> 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
> @@ -1826,3 +1826,22 @@ AVD_COMP *AVD_SU::find_unassigned_comp_t
>   
>       return l_comp;
>   }
> +
> +/**
> + * Disables all components since SU is disabled and out of service.
> + * Takes care of response to IMM for any admin operation pending on 
> components.
> + * @param result
> + */
> +void AVD_SU::disable_comps(SaAisErrorT result)
> +{
> +     AVD_COMP *comp;
> +     for (comp = list_of_comp; comp; comp = comp->su_comp_next) {
> +             comp->curr_num_csi_actv = 0;
> +             comp->curr_num_csi_stdby = 0;
> +             avd_comp_oper_state_set(comp, SA_AMF_OPERATIONAL_DISABLED);
> +             avd_comp_pres_state_set(comp, SA_AMF_PRESENCE_UNINSTANTIATED);
> +             comp->saAmfCompRestartCount = 0;
> +             comp_complete_admin_op(comp, result);
> +             m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, comp, 
> AVSV_CKPT_AVD_COMP_CONFIG);
> +     }
> +}


------------------------------------------------------------------------------
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://www.hpccsystems.com
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to