Nack, this seems like a quick hack...
My previously proposed solution would have solved this problem too.
Let's take it after the holidays

Skickat från min Sony Xperia™-smartphone

nagendr...@oracle.com skrev:


 osaf/libs/common/immsv/include/immutil.h |   1 +
 osaf/services/saf/amf/amfd/csi.cc        |  12 +++++++++++-
 osaf/tools/safimm/src/immutil.c          |  15 +++++++++++++++
 3 files changed, 27 insertions(+), 1 deletions(-)


diff --git a/osaf/libs/common/immsv/include/immutil.h 
b/osaf/libs/common/immsv/include/immutil.h
--- a/osaf/libs/common/immsv/include/immutil.h
+++ b/osaf/libs/common/immsv/include/immutil.h
@@ -172,6 +172,7 @@ CcbUtilOperationData_t *ccbutil_getNextC
  * @return CcbUtilOperationData_t*
  */
 CcbUtilOperationData_t *ccbutil_getCcbOpDataByDN(SaImmOiCcbIdT id, const 
SaNameT *dn);
+CcbUtilOperationData_t *ccbutil_getCcbOpDataByClassName(SaImmOiCcbIdT ccbId, 
CcbUtilOperationData_t *opData);

 /*@}*/
 /**
diff --git a/osaf/services/saf/amf/amfd/csi.cc 
b/osaf/services/saf/amf/amfd/csi.cc
--- a/osaf/services/saf/amf/amfd/csi.cc
+++ b/osaf/services/saf/amf/amfd/csi.cc
@@ -424,7 +424,17 @@ static SaAisErrorT csi_ccb_completed_cre

        avsv_sanamet_init(&opdata->objectName, &si_name, "safSi");
        avd_si = avd_si_get(&si_name);
-
+       /* Donot allow two csi in single ccb if si is already assigned. */
+       if ((opdata != NULL) && (avd_si != NULL)) {
+               if ((ccbutil_getCcbOpDataByClassName(opdata->ccbId, opdata) != 
NULL) &&
+                               (NULL != avd_si->list_of_sisu)) {
+                       report_ccb_validation_error(opdata, "'%s' More than one 
csi in CCB for assigned si,"
+                                       " not allowed", 
opdata->objectName.value);
+                       rc = SA_AIS_ERR_BAD_OPERATION;
+                       LOG_WA("More than one csi in CCB for assigned si");
+                       goto done;
+               }
+       }
        if (NULL != avd_si) {
                /* Check whether si has been assigned to any SU. */
                if (NULL != avd_si->list_of_sisu) {
diff --git a/osaf/tools/safimm/src/immutil.c b/osaf/tools/safimm/src/immutil.c
--- a/osaf/tools/safimm/src/immutil.c
+++ b/osaf/tools/safimm/src/immutil.c
@@ -222,6 +222,21 @@ CcbUtilOperationData_t *ccbutil_getCcbOp
         return opData;
 }

+CcbUtilOperationData_t *ccbutil_getCcbOpDataByClassName(SaImmOiCcbIdT ccbId, 
CcbUtilOperationData_t *opData)
+{
+        CcbUtilOperationData_t *opData_p = ccbutil_getNextCcbOp(ccbId, NULL);
+
+        while (opData_p != NULL) {
+               if ((strcmp(opData->param.create.className, 
opData_p->param.create.className) == 0) &&
+                               (opData_p != opData)) /* Should return another 
object with the same name. */
+                       break;
+
+               opData_p = ccbutil_getNextCcbOp(ccbId, opData_p);
+       }
+
+        return opData_p;
+}
+
 /* ----------------------------------------------------------------------
  * General IMM help utilities;
  */

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to