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, 27 Apr 2006 00:50:22 -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/mof


Modified Files:
        LinuxHA.mof 


Log Message:
add Class for constriant rule
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cim/mof/LinuxHA.mof,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- LinuxHA.mof 26 Apr 2006 08:07:21 -0000      1.11
+++ LinuxHA.mof 27 Apr 2006 06:50:22 -0000      1.12
@@ -518,9 +518,6 @@
                 HA_ResourceConstraint {
         string Resource;
         string Score;
-
-       [ Description ("Rules, in format: attribute<operation>value") ]
-       string Rule [];
 }; 
 
 [ Provider ("cmpi:HA_LocationConstraintRuleProvider" ) ]
@@ -533,14 +530,16 @@
        string Attribute;
        string Operation;
        string Value;
+       string Caption;
 };
 
-[ Provider ("cmpi:HA_RuleOfLocationConstraintProvider" ) ]
+[ Association, Aggregation,
+       Provider ("cmpi:HA_RuleOfLocationConstraintProvider" ) ]
 class HA_RuleOfLocationConstraint {
        [Key]
        HA_LocationConstraint REF Constraint;
        [Key]
-       HA_LocationConstraint REF Rule;
+       HA_LocationConstraintRule REF Rule;
 };
 
 //-----------------------------------------------




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

Message: 2
Date: Thu, 27 Apr 2006 00:52: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:
        constraint_common.c 


Log Message:
rules are in HA_LocationConstraintRule now
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cim/constraint_common.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- constraint_common.c 26 Apr 2006 08:10:00 -0000      1.5
+++ constraint_common.c 27 Apr 2006 06:52:25 -0000      1.6
@@ -46,55 +46,6 @@
 static CMPIInstance *  make_instance(CMPIBroker * broker, char * classname, 
                                CMPIObjectPath *op, struct ha_msg *cons, 
                                int type, CMPIStatus * rc);
-static void            location_set_rules(CMPIBroker * broker, 
-                               CMPIInstance * ci, struct ha_msg* constraint, 
-                               CMPIStatus * rc);
-static void            location_get_rules(CMPIBroker * broker, 
-                               CMPIInstance * ci, struct ha_msg* constraint,
-                               CMPIStatus * rc);
-static void 
-location_set_rules(CMPIBroker *broker, CMPIInstance *ci, 
-               struct ha_msg *constraint, CMPIStatus *rc)
-{
-        CMPIArray * array = NULL;
-       int i, size;
-
-       DEBUG_ENTER();  
-
-        size = cim_msg_children_count(constraint);
-        if (( array = CMNewArray(broker, size, CMPI_chars, rc)) == NULL ){
-                return;
-        }
-
-        for ( i = 0; i < size; i++ ) {
-                const char *id, *attribute, *operation, *value;
-                int stringlen;
-                char *tmp;
-               struct ha_msg *rule;
-
-               rule = cim_msg_child_index(constraint, i);
-                id        = cl_get_string(rule, "id");
-                attribute = cl_get_string(rule, "attribute");
-                operation = cl_get_string(rule, "operation");
-               value     = cl_get_string(rule, "value");
-
-                stringlen = strlen(id) + strlen(attribute) + 
-                        strlen(operation) + strlen(value) +
-                        strlen("id") + strlen("attribute") +
-                        strlen("operation") + strlen("value") + 8;
-
-                if ( (tmp = (char *)cim_malloc(stringlen)) == NULL ) { 
-                       return; 
-               }
-
-                snprintf(tmp,stringlen, "%s<%s>%s", attribute,operation,value);
-                CMSetArrayElementAt(array, i, &tmp, CMPI_chars);
-        }
-
-        CMSetProperty(ci, "Rule", &array, CMPI_charsA);
-       DEBUG_LEAVE();
-}
-
 static CMPIInstance *
 make_instance(CMPIBroker *broker, char *classname, CMPIObjectPath *op, 
                struct ha_msg* constraint, int type, CMPIStatus *rc)
@@ -127,7 +78,6 @@
         } else if ( type == TID_CONS_LOCATION ) {
                cmpi_msg2inst(broker, ci, 
                                HA_LOCATION_CONSTRAINT, constraint, rc);
-                location_set_rules(broker, ci, constraint, rc);
         } else if ( type == TID_CONS_COLOCATION ) {
                cmpi_msg2inst(broker, ci, 
                                HA_COLOCATION_CONSTRAINT, constraint, rc);
@@ -315,53 +265,6 @@
        return HA_OK;
 }
 
-static void
-location_get_rules(CMPIBroker * broker, CMPIInstance * ci, 
-               struct ha_msg * constraint, CMPIStatus * rc)
-{
-       CMPIArray * array = NULL;
-       int len, i;
-
-        array = CMGetProperty(ci, "Rule", rc).value.array;
-       if(array == NULL || rc->rc != CMPI_RC_OK ) {
-               cl_log(LOG_ERR, "%s: get array failed.", __FUNCTION__);
-               return ;
-       }
-       len = CMGetArrayCount(array, rc);
-       for(i = 0; i < len; i++) {
-               CMPIString * s = NULL;
-               char * rule = NULL, tmp[MAXLEN]="exp_id_";
-               char ** v = NULL;
-               int vlen = 0;
-               struct ha_msg * t;
-
-               if( ( t = ha_msg_new(4)) == NULL ) {
-                       return;
-               }
-
-               s = CMGetArrayElementAt(array, i, rc).value.string;
-               if ( s == NULL ) {
-                       ha_msg_del(t);
-                       continue;
-               }
-               rule = CMGetCharPtr(s);         
-
-               /* parse v*/
-               v = split_string(rule, &vlen, "< >");
-               if ( vlen != 3 ) {
-                       continue;
-               }
-               ha_msg_add(t, "attribute", v[0]);
-               ha_msg_add(t, "operation", v[1]);
-               ha_msg_add(t, "value", v[2]);
-
-               snprintf(tmp, MAXLEN, "%s_exp_id_%d", v[0], i);
-               ha_msg_add(t, "id", tmp);
-
-               cim_msg_add_child(constraint, tmp, t);
-       }
-}
-
 int    
 constraint_update_inst(CMPIBroker * broker, char * classname,
                CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, 
@@ -389,7 +292,6 @@
        case TID_CONS_LOCATION:
                t = cim_query_dispatch(GET_LOCATION_CONSTRAINT, id, NULL); 
                cmpi_inst2msg(ci, HA_LOCATION_CONSTRAINT, t, rc); 
-               location_get_rules(broker, ci, t, rc);
                ret = cim_update_dispatch(UPDATE_LOCATION_CONSTRAINT, NULL, t, 
NULL); 
                break;
        case TID_CONS_COLOCATION:
@@ -429,7 +331,6 @@
                break;
        case TID_CONS_LOCATION:
                cmpi_inst2msg(ci, HA_LOCATION_CONSTRAINT, t, rc); 
-               location_get_rules(broker, ci, t, rc);
                ret = cim_update_dispatch(UPDATE_LOCATION_CONSTRAINT, NULL, t, 
NULL); 
                break;
        case TID_CONS_COLOCATION:




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

Message: 3
Date: Thu, 27 Apr 2006 00:53:10 -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:
        Makefile.am 


Log Message:
updated for new providers
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cim/Makefile.am,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- Makefile.am 13 Apr 2006 08:33:25 -0000      1.19
+++ Makefile.am 27 Apr 2006 06:53:10 -0000      1.20
@@ -70,7 +70,9 @@
                            libHA_IndicationProvider.la                  \
                            libHA_ClusteringServiceProvider.la          \
                            libHA_InstanceAttributesProvider.la         \
-                           libHA_AttributesOfResourceProvider.la
+                           libHA_AttributesOfResourceProvider.la       \
+                           libHA_LocationConstraintRuleProvider.la     \
+                           libHA_RuleOfLocationConstraintProvider.la
 
 
 #--------------------------------------------------------------
@@ -138,6 +140,13 @@
 libHA_ClusteringServiceProvider_la_SOURCES        = 
clustering_service_provider.c
 libHA_ClusteringServiceProvider_la_LIBADD         = libHAClusterInfo.la
 #--------------------------------------------------------------
+libHA_LocationConstraintRuleProvider_la_SOURCES = constraint_common.c 
constraint_rule_provider.c
+libHA_LocationConstraintRuleProvider_la_LIBADD  = libHAClusterInfo.la
+#--------------------------------------------------------------
+libHA_RuleOfLocationConstraintProvider_la_SOURCES = 
rule_of_constraint_provider.c
+libHA_RuleOfLocationConstraintProvider_la_LIBADD  = libHAClusterInfo.la
+#--------------------------------------------------------------
+
 noinst_PROGRAMS            = simpletest
 simpletest_SOURCES  = simple_test.c
 simpletest_LDADD    = libHAClusterInfo.la 




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

_______________________________________________
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 140
*********************************************

Reply via email to