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: include by andrew from 
      ([email protected])
   2. Linux-HA CVS: lib by andrew from 
      ([email protected])
   3. Linux-HA CVS: crm by andrew from 
      ([email protected])


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

Message: 1
Date: Sun, 21 May 2006 14:24:24 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: include by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : include

Dir     : linux-ha/include/crm/common


Modified Files:
        xml.h 


Log Message:
Tags with no attributes were able to be added to the CIB without having an 
  ID added to them

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/common/xml.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- xml.h       15 May 2006 10:21:05 -0000      1.46
+++ xml.h       21 May 2006 20:24:23 -0000      1.47
@@ -1,4 +1,4 @@
-/* $Id: xml.h,v 1.46 2006/05/15 10:21:05 andrew Exp $ */
+/* $Id: xml.h,v 1.47 2006/05/21 20:24:23 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -54,6 +54,8 @@
 #endif
 extern void hash2nvpair(gpointer key, gpointer value, gpointer user_data);
 extern void hash2field(gpointer key, gpointer value, gpointer user_data);
+extern void hash2metafield(gpointer key, gpointer value, gpointer user_data);
+
 extern gboolean do_id_check(crm_data_t *xml_obj, GHashTable *id_hash,
                            gboolean silent_add, gboolean silent_rename);
 




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

Message: 2
Date: Sun, 21 May 2006 14:24:24 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : lib

Dir     : linux-ha/lib/crm/common


Modified Files:
        xml.c 


Log Message:
Tags with no attributes were able to be added to the CIB without having an 
  ID added to them

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/common/xml.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -3 -r1.83 -r1.84
--- xml.c       15 May 2006 10:21:05 -0000      1.83
+++ xml.c       21 May 2006 20:24:23 -0000      1.84
@@ -1,4 +1,4 @@
-/* $Id: xml.c,v 1.83 2006/05/15 10:21:05 andrew Exp $ */
+/* $Id: xml.c,v 1.84 2006/05/21 20:24:23 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -1042,10 +1042,10 @@
        char *value_copy = NULL;
        crm_validate_data(data);
        value = cl_get_string(data, name);
+       if(value != NULL) {
 #if XML_PARANOIA_CHECKS
-       CRM_CHECK(cl_is_allocated(value) == 1, return NULL);
+               CRM_CHECK(cl_is_allocated(value) == 1, return NULL);
 #endif
-       if(value != NULL) {
                value_copy = crm_strdup(value);
        }
        return value_copy;
@@ -2114,6 +2114,20 @@
        }
 }
 
+void
+hash2metafield(gpointer key, gpointer value, gpointer user_data) 
+{
+       char *crm_name = NULL;
+
+       if(key == NULL || value == NULL) {
+               return;
+       }
+       
+       crm_name = crm_concat(CRM_META, key, '_');
+       hash2field(crm_name, value, user_data);
+       crm_free(crm_name);
+}
+
 
 #if CRM_DEPRECATED_SINCE_2_0_3
 GHashTable *
@@ -2217,6 +2231,8 @@
                XML_CIB_TAG_CONSTRAINTS,
                XML_CIB_TAG_STATUS,
                XML_LRM_TAG_RESOURCES,
+               "configuration",
+               "crm_config",
                "attributes",
                "operations",
        };
@@ -2281,49 +2297,38 @@
 
        tag_id = ID(xml_obj);
        tag_name = TYPE(xml_obj);
-       if(tag_id != NULL) {
-               old_id = crm_strdup(tag_id);
-       }
        
-       xml_prop_iter(
-               xml_obj, local_prop_name, local_prop_value,
-               
-               if(tag_needs_id(tag_name) == FALSE) {
-                       crm_debug_5("%s does not need an ID", tag_name);
-                       break;
-
-               } else if(tag_id != NULL && non_unique_allowed(tag_name)){
-                       crm_debug_5("%s does not need top be unique", tag_name);
-                       break;
-
-               } else if(safe_str_eq(local_prop_name, XML_DIFF_MARKER)) {
-                       crm_err("Detected "XML_DIFF_MARKER" attribute");
-                       continue;
-               }
-
-               lookup_id = NULL;
-               if(tag_id != NULL) {
-                       lookup_id = crm_concat(tag_name, tag_id, '-');
-                       lookup_value = g_hash_table_lookup(id_hash, lookup_id);
-                       if(lookup_value == NULL) {
-                               g_hash_table_insert(
-                                       id_hash, lookup_id, crm_strdup(tag_id));
-                               break;
-                       }
-                       modified |= (!silent_rename);
+       if(tag_needs_id(tag_name) == FALSE) {
+               crm_debug_5("%s does not need an ID", tag_name);
+               return modified;
 
-               } else {
-                       modified |= (!silent_add);
+       } else if(tag_id != NULL && non_unique_allowed(tag_name)){
+               crm_debug_5("%s does not need top be unique", tag_name);
+               return modified;
+       }
+       
+       lookup_id = NULL;
+       if(tag_id != NULL) {
+               lookup_id = crm_concat(tag_name, tag_id, '-');
+               lookup_value = g_hash_table_lookup(id_hash, lookup_id);
+               if(lookup_value == NULL) {
+                       g_hash_table_insert(id_hash, lookup_id, 
crm_strdup(tag_id));
+                       return modified;
                }
+               modified |= (!silent_rename);
                
-               crm_free(lookup_id);
-               assign_uuid(xml_obj);
-               tag_id = ID(xml_obj);
-
-               /* the first attribute was enough to do everything needed */
-               break;
-               );
+       } else {
+               modified |= (!silent_add);
+       }
 
+       if(tag_id != NULL) {
+               old_id = crm_strdup(tag_id);
+       }
+       
+       crm_free(lookup_id);
+       assign_uuid(xml_obj);
+       tag_id = ID(xml_obj);
+       
        if(modified == FALSE) {
                /* nothing to report */
                




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

Message: 3
Date: Mon, 22 May 2006 01:16:32 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : crm

Dir     : linux-ha/crm/crmd


Modified Files:
        lrm.c 


Log Message:
Supply the version number that an lrm_rsc_op entry conforms to.
This will allow the PE to accurately detect attribute changes.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/lrm.c,v
retrieving revision 1.192
retrieving revision 1.193
diff -u -3 -r1.192 -r1.193
--- lrm.c       11 May 2006 09:25:23 -0000      1.192
+++ lrm.c       22 May 2006 07:16:31 -0000      1.193
@@ -486,10 +486,11 @@
        crm_xml_add_int(xml_op,  XML_LRM_ATTR_CALLID, op->call_id);
 
        /* set these on 'xml_rsc' too to make life easy for the PE */
+       crm_xml_add(xml_op, XML_ATTR_CRM_VERSION, caller_version);
        crm_xml_add_int(xml_op, XML_LRM_ATTR_RC, op->rc);
        crm_xml_add_int(xml_op, XML_LRM_ATTR_OPSTATUS, op->op_status);
        crm_xml_add_int(xml_op, XML_LRM_ATTR_INTERVAL, op->interval);
-
+       
        if(safe_str_neq(op->op_type, CRMD_ACTION_STOP)) {
                /* this will enable us to later determin that the
                 *   resource's parameters have changed and we should force
@@ -501,7 +502,7 @@
                crm_data_t *args_xml = NULL;
                crm_data_t *args_parent = NULL;
 #if CRM_DEPRECATED_SINCE_2_0_4
-               if(compare_version("1.0.5", caller_version) > 0) {
+               if(compare_version("1.0.4", caller_version) > 0) {
                        args_parent = xml_op;
                }
 #endif
@@ -877,22 +878,23 @@
                        const char *op_task = NULL;
                        const char *op_interval = NULL;
 
-                       crm_log_xml_debug(input->xml, "CancelOp");
+                       CRM_CHECK(params != NULL,
+                                 crm_log_xml_warn(input->xml, "Bad command");
+                                 return I_NULL);
 
-                       op_interval = crm_element_value(params, "interval");
-                       
-                       if(params != NULL) {
-                               op_task = crm_element_value(
-                                       params, XML_LRM_ATTR_TASK);
-#if CRM_DEPRECATED_SINCE_2_0_4
+                       op_task = crm_element_value(params, 
crm_meta_name(XML_LRM_ATTR_TASK));
+                       op_interval = crm_element_value(params, 
crm_meta_name("interval"));
+#if CRM_DEPRECATED_SINCE_2_0_5
+                       if(op_interval == NULL) {
+                               op_interval = crm_element_value(params, 
"interval");
+                       }
+                       if(op_task == NULL) {
+                               op_task = crm_element_value(params, 
XML_LRM_ATTR_TASK);
                                if(op_task == NULL) {
                                        op_task = crm_element_value(params, 
"task");
                                }
-#endif
                        }
-                       CRM_CHECK(params != NULL,
-                                 crm_log_xml_warn(input->xml, "Bad command");
-                                 return I_NULL);
+#endif
                        CRM_CHECK(op_task != NULL,
                                  crm_log_xml_warn(input->xml, "Bad command");
                                  return I_NULL);
@@ -962,6 +964,10 @@
 construct_op(crm_data_t *rsc_op, const char *rsc_id, const char *operation)
 {
        lrm_op_t *op = NULL;
+       const char *op_delay = NULL;
+       const char *op_timeout = NULL;
+       const char *op_interval = NULL;
+       
        const char *transition = NULL;
        CRM_DEV_ASSERT(rsc_id != NULL);
 
@@ -1007,29 +1013,35 @@
        if(op->params == NULL) {
                CRM_DEV_ASSERT(safe_str_eq(CRMD_ACTION_STOP, operation));
        }
+
+       op_delay = g_hash_table_lookup(op->params, 
crm_meta_name("start_delay"));
+       op_timeout = g_hash_table_lookup(op->params, crm_meta_name("timeout"));
+       op_interval = g_hash_table_lookup(op->params, 
crm_meta_name("interval"));
+#if CRM_DEPRECATED_SINCE_2_0_5
+       if(op_delay == NULL) {
+               op_delay = g_hash_table_lookup(op->params, "start_delay");
+       }
+       if(op_timeout == NULL) {
+               op_timeout = g_hash_table_lookup(op->params, "timeout");
+       }
+       if(op_interval == NULL) {
+               op_interval = g_hash_table_lookup(op->params, "interval");
+       }
+#endif
        
-       op->interval = crm_parse_int(
-               g_hash_table_lookup(op->params, "interval"),    "0");
-       op->timeout  = crm_parse_int(
-               g_hash_table_lookup(op->params, "timeout"),     "0");
-       op->start_delay = crm_parse_int(
-               g_hash_table_lookup(op->params, "start_delay"), "0");
+       op->interval = crm_parse_int(op_interval, "0");
+       op->timeout  = crm_parse_int(op_timeout,  "0");
+       op->start_delay = crm_parse_int(op_delay, "0");
 
        /* sanity */
        if(op->interval < 0) {
                op->interval = 0;
-               g_hash_table_replace(
-                       op->params, crm_strdup("interval"), crm_strdup("0"));
        }
        if(op->timeout < 0) {
                op->timeout = 0;
-               g_hash_table_replace(
-                       op->params, crm_strdup("timeout"), crm_strdup("0"));
        }
        if(op->start_delay < 0) {
                op->start_delay = 0;
-               g_hash_table_replace(
-                       op->params, crm_strdup("start_delay"), crm_strdup("0"));
        }
 
        transition = crm_element_value(rsc_op, XML_ATTR_TRANSITION_KEY);
@@ -1038,11 +1050,12 @@
        op->user_data = crm_strdup(transition);
        op->user_data_len = 1+strlen(op->user_data);
 
-       if(safe_str_eq(operation, CRMD_ACTION_START)
-          || safe_str_eq(operation, CRMD_ACTION_STOP)) {
-               char *interval_s = g_hash_table_lookup(op->params, "interval");
-               CRM_CHECK(op->interval == 0, return NULL);
-               CRM_CHECK(interval_s == NULL, return NULL);
+       if(op->interval != 0) {
+               if(safe_str_eq(operation, CRMD_ACTION_START)
+                  || safe_str_eq(operation, CRMD_ACTION_STOP)) {
+                       crm_err("Start and Stop actions cannot have an 
interval");
+                       op->interval = 0;
+               }
        }
 
        crm_debug_2("Constructed %s op for %s: interval=%d",
@@ -1211,7 +1224,6 @@
                } else {
                        crm_err("Invalid call_id %d for %s",
                                op->call_id, rsc->id);
-                       /* TODO: we probably need to look up the LRM to find it 
*/
                }
        }
 }
@@ -1440,15 +1452,15 @@
 process_lrm_event(lrm_op_t *op)
 {
        const char *last_op = NULL;
-       const char *probe_s = NULL;
        gboolean is_probe = FALSE;
        int log_rsc_err = LOG_WARNING;
        
        CRM_CHECK(op != NULL, return I_NULL);
        CRM_CHECK(op->rsc_id != NULL, return I_NULL);
 
-       probe_s = g_hash_table_lookup(op->params, XML_ATTR_LRM_PROBE);
-       is_probe = crm_is_true(probe_s);
+       if(op->interval == 0 && safe_str_eq(op->op_type, CRMD_ACTION_STATUS)) {
+               is_probe = TRUE;
+       }
 
        switch(op->op_status) {
                case LRM_OP_PENDING:




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

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


End of Linux-ha-cvs Digest, Vol 30, Issue 63
********************************************

Reply via email to