Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: cim by panjiam from 
      ([email protected])
   2. Linux-HA CVS: cim by panjiam from 
      ([email protected])
   3. Linux-HA CVS: cim by panjiam from 
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Thu, 13 Apr 2006 02:07:49 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cim by panjiam from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : panjiam
Host    : 
Project : linux-ha
Module  : cim

Dir     : linux-ha/cim


Modified Files:
        operation_provider.c 


Log Message:
these functions are not necessary.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cim/operation_provider.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- operation_provider.c        10 Apr 2006 10:28:30 -0000      1.4
+++ operation_provider.c        13 Apr 2006 08:07:48 -0000      1.5
@@ -41,14 +41,6 @@
 static char            ClassName []    = "HA_Operation";
 static CMPIBroker *    Broker          = NULL;
 
-static int             operation_update_inst(CMPIContext *, CMPIResult *, 
-                               CMPIObjectPath * cop, CMPIInstance * ci, 
-                               char ** properties, CMPIStatus * rc);
-static struct ha_msg * find_operation(const char * rscid, const char *opid);
-static CMPIInstance *  operation_make_instance(CMPIObjectPath*, char* rscid,
-                               const char * opid, struct ha_msg *operation, 
-                               CMPIStatus * rc);
-
 DeclareInstanceFunctions(Operation);
 
 static struct ha_msg * 
@@ -90,79 +82,6 @@
 }
 
 static int
-operation_update_inst(CMPIContext *ctx, CMPIResult *rslt, CMPIObjectPath *cop,
-               CMPIInstance * ci, char ** properties, CMPIStatus * rc)
-{
-       struct ha_msg *operation;
-       char *id, *rscid;
-
-        DEBUG_ENTER();
-       id = CMGetKeyString(cop, "Id", rc);
-       rscid = CMGetKeyString(cop, "ResourceId", rc);
-       if ((operation = find_operation(rscid, id)) == NULL ) {
-               return HA_OK; 
-       }
-       cmpi_inst2msg(ci, HA_OPERATION, operation, rc);
-       cim_update_rscop(rscid, id, operation);
-       rc->rc = CMPI_RC_OK;
-
-       DEBUG_LEAVE();
-       return HA_OK;
-}
-
-static int
-operation_create_inst(CMPIContext *ctx, CMPIResult *rslt, CMPIObjectPath *cop,
-               CMPIInstance * ci, CMPIStatus * rc)
-{
-       struct ha_msg *operation;
-       char *id, *rscid; 
-
-       id    = CMGetKeyString(cop, "Id", rc);
-        rscid = CMGetKeyString(cop, "ResourceId", rc);
-
-       /* create an empty operatoin */
-       if ((operation = ha_msg_new(16)) == NULL ) {
-                cl_log(LOG_ERR, "%s: operation alloc failed.", __FUNCTION__);
-               rc->rc = CMPI_RC_ERR_FAILED;
-               return HA_FAIL;
-       }
-
-       /* fill operation */
-       cmpi_inst2msg(ci, HA_OPERATION, operation, rc);
-
-       /* add op to resource */
-       if (cim_add_rscop(rscid, operation) != HA_OK ) {
-               rc->rc = CMPI_RC_ERR_FAILED;
-               ha_msg_del(operation);
-               return HA_FAIL;
-       } 
-       
-       ha_msg_del(operation);
-       rc->rc = CMPI_RC_OK;
-       return HA_OK;
-}
-
-
-
-static int
-operation_delete_inst(CMPIContext *ctx, CMPIResult *rslt, 
-                       CMPIObjectPath *cop, CMPIStatus * rc)
-{
-       char *id, *rscid; 
-
-       id    = CMGetKeyString(cop, "Id", rc);
-        rscid = CMGetKeyString(cop, "ResourceId", rc);
-       
-       if ( cim_del_rscop(rscid, id) == HA_OK ) {
-               rc->rc = CMPI_RC_OK;
-               return HA_OK;
-       } else {
-               rc->rc = CMPI_RC_ERR_FAILED;
-               return HA_FAIL;
-       }
-}
-
-static int
 operation_enum_insts(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt,
                CMPIObjectPath * ref, int EnumInst, CMPIStatus * rc)
 {
@@ -212,6 +131,7 @@
                        cim_free(opid);
                }
        }
+       ha_msg_del(rsclist);
 done:
        rc->rc = CMPI_RC_OK;
         CMReturnDone(rslt);
@@ -264,8 +184,7 @@
 
        PROVIDER_INIT_LOGGER();
 
-        DEBUG_ENTER();
-       id = CMGetKeyString(cop, "Id", &rc);
+       id    = CMGetKeyString(cop, "Id", &rc);
        rscid = CMGetKeyString(cop, "ResourceId", &rc);
 
        op = CMNewObjectPath(Broker, CMGetCharPtr(CMGetNameSpace(cop, &rc)), 
@@ -293,7 +212,6 @@
 
         CMReturnInstance(rslt, ci);
         CMReturnDone(rslt);
-       DEBUG_LEAVE();
         CMReturn(CMPI_RC_OK);
 }
 
@@ -302,7 +220,32 @@
                CMPIResult * rslt, CMPIObjectPath * cop, CMPIInstance * ci)
 {
        CMPIStatus rc = {CMPI_RC_OK, NULL};
-       operation_create_inst(ctx, rslt, cop, ci, &rc);
+       struct ha_msg *operation;
+       char *id, *rscid; 
+
+       id    = CMGetKeyString(cop, "Id", &rc);
+        rscid = CMGetKeyString(cop, "ResourceId", &rc);
+
+       /* create an empty operatoin */
+       if ((operation = ha_msg_new(16)) == NULL ) {
+                cl_log(LOG_ERR, "%s: operation alloc failed.", __FUNCTION__);
+               rc.rc = CMPI_RC_ERR_FAILED;
+               goto done;
+       }
+
+       /* fill operation */
+       cmpi_inst2msg(ci, HA_OPERATION, operation, &rc);
+
+       /* add op to resource */
+       if (cim_add_rscop(rscid, operation) != HA_OK ) {
+               rc.rc = CMPI_RC_ERR_FAILED;
+               ha_msg_del(operation);
+               goto done;
+       } 
+       
+       ha_msg_del(operation);
+       rc.rc = CMPI_RC_OK;
+done:
        return rc;
 }
 
@@ -313,7 +256,19 @@
                CMPIInstance * ci, char ** properties)
 {
         CMPIStatus rc = {CMPI_RC_OK, NULL};
-       operation_update_inst(ctx, rslt, cop, ci, properties, &rc);
+       struct ha_msg *operation;
+       char *id, *rscid;
+
+       id    = CMGetKeyString(cop, "Id", &rc);
+       rscid = CMGetKeyString(cop, "ResourceId", &rc);
+       if ((operation = find_operation(rscid, id)) == NULL ) {
+               rc.rc = CMPI_RC_ERR_FAILED;
+               goto done;
+       }
+       cmpi_inst2msg(ci, HA_OPERATION, operation, &rc);
+       cim_update_rscop(rscid, id, operation);
+       rc.rc = CMPI_RC_OK;
+done:
         return rc;
 }
 
@@ -323,7 +278,15 @@
                 CMPIResult * rslt, CMPIObjectPath * cop)
 {
         CMPIStatus rc = {CMPI_RC_OK, NULL};
-       operation_delete_inst(ctx, rslt, cop, &rc);
+       char *id, *rscid; 
+       id    = CMGetKeyString(cop, "Id", &rc);
+        rscid = CMGetKeyString(cop, "ResourceId", &rc);
+       
+       if ( cim_del_rscop(rscid, id) == HA_OK ) {
+               rc.rc = CMPI_RC_OK;
+       } else {
+               rc.rc = CMPI_RC_ERR_FAILED;
+       }
        return rc;
 }
 




------------------------------

Message: 2
Date: Thu, 13 Apr 2006 02:25:49 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cim by panjiam from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : panjiam
Host    : 
Project : linux-ha
Module  : cim

Dir     : linux-ha/cim


Modified Files:
        mof_map.c 


Log Message:
add HA_INSTANCE_ATTRIBUTES.,
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cim/mof_map.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- mof_map.c   10 Apr 2006 10:15:21 -0000      1.1
+++ mof_map.c   13 Apr 2006 08:25:49 -0000      1.2
@@ -139,6 +139,12 @@
         {"resource",   "Resource",     CMPI_chars}
 };
 
+static const map_entry_t HA_INSTANCE_ATTRIBUTES_entry [] = {
+       {"id",          "Id",           CMPI_chars},
+       {"name",        "Name",         CMPI_chars},
+       {"value",       "Value",        CMPI_chars}
+};
+
 #define MAKE_ENTRY(id,entry) {id, MAPDIM(entry), entry}
 static const struct map_t map_table [] =
 {
@@ -151,7 +157,8 @@
        MAKE_ENTRY(HA_OPERATION, HA_OPERATION_entry),
        MAKE_ENTRY(HA_ORDER_CONSTRAINT, HA_ORDER_CONSTRAINT_entry),
        MAKE_ENTRY(HA_COLOCATION_CONSTRAINT, HA_COLOCATION_CONSTRAINT_entry),
-       MAKE_ENTRY(HA_LOCATION_CONSTRAINT, HA_LOCATION_CONSTRAINT_entry)
+       MAKE_ENTRY(HA_LOCATION_CONSTRAINT, HA_LOCATION_CONSTRAINT_entry),
+       MAKE_ENTRY(HA_INSTANCE_ATTRIBUTES, HA_INSTANCE_ATTRIBUTES_entry),
 };
 
 




------------------------------

Message: 3
Date: Thu, 13 Apr 2006 02:27:26 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cim by panjiam from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : panjiam
Host    : 
Project : linux-ha
Module  : cim

Dir     : linux-ha/cim


Modified Files:
        cluster_node_provider.c 


Log Message:
removed enter/leave debug
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cim/cluster_node_provider.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- cluster_node_provider.c     10 Apr 2006 10:28:30 -0000      1.4
+++ cluster_node_provider.c     13 Apr 2006 08:27:26 -0000      1.5
@@ -123,10 +123,8 @@
        struct ha_msg *nodes;
        char *nspace;
 
-       DEBUG_ENTER();
        if ((hbstatus = cim_get_hb_status()) != HB_RUNNING ) {
                CMReturnDone(rslt);
-               DEBUG_LEAVE();
                return HA_OK;
        }
        nspace = CMGetCharPtr(CMGetNameSpace(ref, rc));
@@ -136,10 +134,9 @@
 
        nodes = cim_query_dispatch(GET_NODE_LIST, NULL, NULL); 
         if ( nodes == NULL ) {
-                cl_log(LOG_ERR, "Can not get node information"); 
+                cl_log(LOG_ERR, "%s: Can not get node list.", __FUNCTION__); 
                 CMSetStatusWithChars(Broker, rc,
-                       CMPI_RC_ERR_FAILED, "Could not get node information");
-               DEBUG_LEAVE();
+                       CMPI_RC_ERR_FAILED, "Could not get node list.");
                 return HA_FAIL;
         }
        len = cim_list_length(nodes);
@@ -160,7 +157,6 @@
                         if ((ci = make_node_instance(op, uname, rc))==NULL) {
                                rc->rc = CMPI_RC_ERR_FAILED;
                                ha_msg_del(nodes);
-                               DEBUG_LEAVE();
                                 return HA_FAIL;
                         }
                         CMReturnInstance(rslt, ci);
@@ -173,7 +169,6 @@
 
         CMReturnDone(rslt);
        ha_msg_del(nodes);
-       DEBUG_LEAVE();
         return HA_OK;
 }
 




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 29, Issue 80
********************************************

Reply via email to