Ack, code review only/Regards HansN
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: den 24 juli 2014 16:05
To: Hans Feldt; Hans Nordebäck; [email protected]
Cc: [email protected]
Subject: [PATCH 1 of 1] amfd: return admin op when csi assign/remove is over
[#372]
osaf/services/saf/amf/amfd/ndproc.cc | 14 ++++++++++++++
osaf/services/saf/amf/amfd/sgproc.cc | 9 +++++++++
osaf/services/saf/amf/amfd/si.cc | 5 ++---
3 files changed, 25 insertions(+), 3 deletions(-)
As of now, amf return admin op except si swap immediately after admin op is
invoked.
Ideally, amf should first complete csi assignment or csi removal then only amf
should return admin op.
diff --git a/osaf/services/saf/amf/amfd/ndproc.cc
b/osaf/services/saf/amf/amfd/ndproc.cc
--- a/osaf/services/saf/amf/amfd/ndproc.cc
+++ b/osaf/services/saf/amf/amfd/ndproc.cc
@@ -758,6 +758,20 @@ void avd_data_update_req_evh(AVD_CL_CB *
} else if (su->pend_cbk.invocation !=
0) {
su_admin_op_report_to_imm(su,
static_cast<SaAmfPresenceStateT>(l_val));
}
+ if (l_val ==
SA_AMF_PRESENCE_TERMINATION_FAILED) {
+ for (AVD_SI* si =
su->sg_of_su->list_of_si; si != NULL;
+ si =
si->sg_list_of_si_next) {
+ if (si->invocation !=
0) {
+
report_admin_op_error(cb->immOiHandle, si->invocation,
+
SA_AIS_ERR_REPAIR_PENDING,
+
NULL,
+
"SU '%s' moved to 'termination failed' state",
+
su->name.value);
+ si->invocation
= 0;
+ }
+ }
+ }
+
/* send response to pending clm
callback */
if (su->su_on_node->clm_pend_inv != 0)
clm_pend_response(su,
static_cast<SaAmfPresenceStateT>(l_val));
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
@@ -1200,6 +1200,15 @@ void avd_su_si_assign_evh(AVD_CL_CB *cb,
} else
; // wait for SG to become STABLE
}
+ if (su->sg_of_su->sg_fsm_state == AVD_SG_FSM_STABLE){
+ for (AVD_SI* si = su->sg_of_su->list_of_si; si
!= NULL; si = si->sg_list_of_si_next) {
+ if (si->invocation != 0) {
+
avd_saImmOiAdminOperationResult(avd_cb->immOiHandle,
+ si->invocation,
SA_AIS_OK);
+ si->invocation = 0;
+ }
+ }
+ }
}
/* also check for pending clm callback operations */
if (su->su_on_node->clm_pend_inv != 0) { diff --git
a/osaf/services/saf/amf/amfd/si.cc b/osaf/services/saf/amf/amfd/si.cc
--- a/osaf/services/saf/amf/amfd/si.cc
+++ b/osaf/services/saf/amf/amfd/si.cc
@@ -819,7 +819,7 @@ static void si_admin_op_cb(SaImmOiHandle
si->set_admin_state(SA_AMF_ADMIN_LOCKED);
goto done;
}
-
+ si->invocation = invocation;
break;
case SA_AMF_ADMIN_SHUTDOWN:
@@ -882,6 +882,7 @@ static void si_admin_op_cb(SaImmOiHandle
"SI shutdown/lock of %s failed",
objectName->value);
goto done;
}
+ si->invocation = invocation;
break;
@@ -905,8 +906,6 @@ static void si_admin_op_cb(SaImmOiHandle
goto done;
}
- if ((operationId != SA_AMF_ADMIN_SI_SWAP))
- avd_saImmOiAdminOperationResult(immOiHandle, invocation, rc);
done:
TRACE_LEAVE();
}
------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel