osaf/services/saf/amf/amfd/include/si.h | 2 ++
osaf/services/saf/amf/amfd/si_dep.cc | 25 ++++++++++++-------------
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/osaf/services/saf/amf/amfd/include/si.h
b/osaf/services/saf/amf/amfd/include/si.h
--- a/osaf/services/saf/amf/amfd/include/si.h
+++ b/osaf/services/saf/amf/amfd/include/si.h
@@ -149,6 +149,8 @@ public:
void screen_si_dependencies();
void send_active_to_dependents();
bool sponsors_assigned_active();
+ uint32_t unassign_dependent(AVD_CL_CB *cb);
+
private:
AVD_SI(const AVD_SI&);
diff --git a/osaf/services/saf/amf/amfd/si_dep.cc
b/osaf/services/saf/amf/amfd/si_dep.cc
--- a/osaf/services/saf/amf/amfd/si_dep.cc
+++ b/osaf/services/saf/amf/amfd/si_dep.cc
@@ -161,7 +161,6 @@ AmfDb<std::pair<std::string, std::string
/* static function prototypes */
static void sidep_update_si_dep_state_for_spons_unassign(AVD_CL_CB *cb, AVD_SI
*dep_si, AVD_SI_DEP *si_dep_rec);
-static uint32_t sidep_unassign_dependent(AVD_CL_CB *cb, AVD_SI *si);
static uint32_t sidep_sg_red_si_process_assignment(AVD_CL_CB *cb, AVD_SI *si);
static uint32_t sidep_si_dep_state_evt_send(AVD_CL_CB *cb, AVD_SI *si,
AVD_EVT_TYPE evt_type);
static uint32_t sidep_cyclic_dep_find(AVD_SI_DEP *sidep);
@@ -396,7 +395,7 @@ void sidep_stop_tol_timer(AVD_CL_CB *cb,
}
/*****************************************************************************
- * Function: sidep_unassign_dependent
+ * Function: unassign_dependent
*
* Purpose: This function removes the active and the quiescing HA states for
* SI from all service units and if si is a dependent si then moves
@@ -411,14 +410,14 @@ void sidep_stop_tol_timer(AVD_CL_CB *cb,
* NOTES:
*
**************************************************************************/
-uint32_t sidep_unassign_dependent(AVD_CL_CB *cb, AVD_SI *si)
+uint32_t AVD_SI::unassign_dependent(AVD_CL_CB *cb)
{
AVD_SU_SI_REL *susi = NULL;
uint32_t rc = NCSCC_RC_FAILURE;
- TRACE_ENTER2("'%s'", si->name.value);
+ TRACE_ENTER2("'%s'", name.value);
- susi = si->list_of_sisu;
+ susi = list_of_sisu;
while (susi != AVD_SU_SI_REL_NULL && susi->fsm !=
AVD_SU_SI_STATE_UNASGN) {
if ((rc = avd_susi_del_send(susi)) != NCSCC_RC_SUCCESS)
goto done;
@@ -428,13 +427,13 @@ uint32_t sidep_unassign_dependent(AVD_CL
susi = susi->si_next;
}
- if(si->spons_si_list == NULL)
- si->set_dep_state(AVD_SI_NO_DEPENDENCY);
+ if(spons_si_list == NULL)
+ set_dep_state(AVD_SI_NO_DEPENDENCY);
else
- si->set_dep_state(AVD_SI_SPONSOR_UNASSIGNED);
+ set_dep_state(AVD_SI_SPONSOR_UNASSIGNED);
/* transition to sg-realign state */
- m_AVD_SET_SG_FSM(cb, si->sg_of_si, AVD_SG_FSM_SG_REALIGN);
+ m_AVD_SET_SG_FSM(cb, sg_of_si, AVD_SG_FSM_SG_REALIGN);
done:
TRACE_LEAVE2("rc:%u", rc);
@@ -606,7 +605,7 @@ void avd_sidep_tol_tmr_evh(AVD_CL_CB *cb
*/
if (si->si_active() == true) {
LOG_NO("Unassigning due to dep'%s'",si->name.value);
- sidep_unassign_dependent(cb, si);
+ si->unassign_dependent(cb);
}
else
si->set_dep_state(AVD_SI_SPONSOR_UNASSIGNED);
@@ -823,7 +822,7 @@ void sidep_si_dep_start_unassign(AVD_CL_
goto done;
}
- if (sidep_unassign_dependent(cb, si) != NCSCC_RC_SUCCESS) {
+ if (si->unassign_dependent(cb) != NCSCC_RC_SUCCESS) {
LOG_ER("'%s' unassignment failed",si->name.value);
}
@@ -2340,7 +2339,7 @@ void sidep_si_take_action(AVD_SI *si)
unassigned.*/
if (si->spons_si_list == NULL)
/*If sponsor SI then unassigned it.*/
- sidep_unassign_dependent(avd_cb,si);
+ si->unassign_dependent(avd_cb);
else
/*For dependent SI start the tolerance timer or
unassign it*/
sidep_process_ready_to_unassign_depstate(si);
@@ -2355,7 +2354,7 @@ void sidep_si_take_action(AVD_SI *si)
/*Action will be taken at the expiry of tolerance
timer.*/
break;
case AVD_SI_UNASSIGNING_DUE_TO_DEP:
- sidep_unassign_dependent(avd_cb,si);
+ si->unassign_dependent(avd_cb);
break;
case AVD_SI_FAILOVER_UNDER_PROGRESS:
/*No action action will taken during failover.*/
------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel