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


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

Message: 1
Date: Mon, 22 May 2006 02:14:13 -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/pengine


Modified Files:
        incarnation.c 


Log Message:
back out the complete patch - only part of it was supposed to go in

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/incarnation.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -3 -r1.85 -r1.86
--- incarnation.c       22 May 2006 08:10:14 -0000      1.85
+++ incarnation.c       22 May 2006 08:14:13 -0000      1.86
@@ -1,4 +1,5 @@
-/* $Id: incarnation.c,v 1.85 2006/05/22 08:10:14 andrew Exp $ */
+Using CVS directory: .
+/* $Id: incarnation.c,v 1.86 2006/05/22 08:14:13 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -98,8 +99,8 @@
        clone_data->child_list = g_list_append(
                clone_data->child_list, child_rsc);
        
-       add_hash_param(child_rsc->meta, XML_RSC_ATTR_INCARNATION_MAX, inc_max);
-       add_hash_param(child_rsc->parameters, 
crm_meta_name(XML_RSC_ATTR_INCARNATION_MAX), inc_max);
+       add_rsc_param(child_rsc, XML_RSC_ATTR_INCARNATION, inc_num);
+       add_rsc_param(child_rsc, XML_RSC_ATTR_INCARNATION_MAX, inc_max);
        
        print_resource(LOG_DEBUG_3, "Added", child_rsc, FALSE);
        
@@ -118,14 +119,15 @@
        clone_variant_data_t *clone_data = NULL;
        resource_t *self = NULL;
 
-       const char *ordered = g_hash_table_lookup(
-               rsc->meta, XML_RSC_ATTR_ORDERED);
-       const char *interleave = g_hash_table_lookup(
-               rsc->meta, XML_RSC_ATTR_INTERLEAVE);
+       const char *ordered =
+               crm_element_value(xml_obj, XML_RSC_ATTR_ORDERED);
+       const char *interleave =
+               crm_element_value(xml_obj, XML_RSC_ATTR_INTERLEAVE);
+
        const char *max_clones = g_hash_table_lookup(
-               rsc->meta, XML_RSC_ATTR_INCARNATION_MAX);
+               rsc->parameters, XML_RSC_ATTR_INCARNATION_MAX);
        const char *max_clones_node = g_hash_table_lookup(
-               rsc->meta, XML_RSC_ATTR_INCARNATION_NODEMAX);
+               rsc->parameters, XML_RSC_ATTR_INCARNATION_NODEMAX);
 
        crm_debug_3("Processing resource %s...", rsc->id);
 
@@ -550,12 +552,12 @@
                               CRMD_ACTION_NOTIFY, NULL,
                               action->optional, TRUE, data_set);
        
-       add_hash_param(notify->meta, "notify_type", "pre");
-       add_hash_param(notify->meta, "notify_operation", action->task);
+       add_hash_param(notify->extra, "notify_type", "pre");
+       add_hash_param(notify->extra, "notify_operation", action->task);
        if(clone_data->notify_confirm) {
-               add_hash_param(notify->meta, "notify_confirm", "yes");
+               add_hash_param(notify->extra, "notify_confirm", "yes");
        } else {
-               add_hash_param(notify->meta, "notify_confirm", "no");
+               add_hash_param(notify->extra, "notify_confirm", "no");
        }
        notify->pseudo = TRUE;
 
@@ -565,12 +567,12 @@
        notify_complete = custom_action(clone_data->self, notify_key,
                               CRMD_ACTION_NOTIFIED, NULL,
                               action->optional, TRUE, data_set);
-       add_hash_param(notify_complete->meta, "notify_type", "pre");
-       add_hash_param(notify_complete->meta, "notify_operation", action->task);
+       add_hash_param(notify_complete->extra, "notify_type", "pre");
+       add_hash_param(notify_complete->extra, "notify_operation", 
action->task);
        if(clone_data->notify_confirm) {
-               add_hash_param(notify->meta, "notify_confirm", "yes");
+               add_hash_param(notify->extra, "notify_confirm", "yes");
        } else {
-               add_hash_param(notify->meta, "notify_confirm", "no");
+               add_hash_param(notify->extra, "notify_confirm", "no");
        }
        notify->pseudo = TRUE;
        notify_complete->pseudo = TRUE;
@@ -596,12 +598,12 @@
        notify = custom_action(clone_data->self, notify_key,
                               CRMD_ACTION_NOTIFY, NULL,
                               action_complete->optional, TRUE, data_set);
-       add_hash_param(notify->meta, "notify_type", "post");
-       add_hash_param(notify->meta, "notify_operation", action->task);
+       add_hash_param(notify->extra, "notify_type", "post");
+       add_hash_param(notify->extra, "notify_operation", action->task);
        if(clone_data->notify_confirm) {
-               add_hash_param(notify->meta, "notify_confirm", "yes");
+               add_hash_param(notify->extra, "notify_confirm", "yes");
        } else {
-               add_hash_param(notify->meta, "notify_confirm", "no");
+               add_hash_param(notify->extra, "notify_confirm", "no");
        }
        notify->pseudo = TRUE;
 
@@ -617,12 +619,12 @@
        notify_complete = custom_action(clone_data->self, notify_key,
                               CRMD_ACTION_NOTIFIED, NULL,
                               action->optional, TRUE, data_set);
-       add_hash_param(notify_complete->meta, "notify_type", "pre");
-       add_hash_param(notify_complete->meta, "notify_operation", action->task);
+       add_hash_param(notify_complete->extra, "notify_type", "pre");
+       add_hash_param(notify_complete->extra, "notify_operation", 
action->task);
        if(clone_data->notify_confirm) {
-               add_hash_param(notify->meta, "notify_confirm", "yes");
+               add_hash_param(notify->extra, "notify_confirm", "yes");
        } else {
-               add_hash_param(notify->meta, "notify_confirm", "no");
+               add_hash_param(notify->extra, "notify_confirm", "no");
        }
        notify_complete->pseudo = TRUE;
 
@@ -1235,7 +1237,7 @@
 /*             action, action_t, clone_data->self->actions, lpc2, */
 
 /*             if(safe_str_eq(action->task, CRMD_ACTION_NOTIFY)) { */
-/*                     action->meta_xml = notify_xml; */
+/*                     action->extra_xml = notify_xml; */
 /*             } */
 /*             ); */
        
@@ -1404,8 +1406,7 @@
        slist_iter(
                child_rsc, resource_t, clone_data->child_list, lpc,
 
-               if(rsc->globally_unique == FALSE
-                  && num_probes >= clone_data->clone_node_max) {
+               if(num_probes >= clone_data->clone_node_max) {
                        return FALSE;
                }
                if(pe_find_node_id(child_rsc->running_on, node->details->id)) {




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

Message: 2
Date: Mon, 22 May 2006 02:15:37 -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/pengine


Modified Files:
        incarnation.c 


Log Message:
Try again...
Globally Unique clones need to have every instance probed for

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/incarnation.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -3 -r1.86 -r1.87
--- incarnation.c       22 May 2006 08:14:13 -0000      1.86
+++ incarnation.c       22 May 2006 08:15:37 -0000      1.87
@@ -1,5 +1,4 @@
-Using CVS directory: .
-/* $Id: incarnation.c,v 1.86 2006/05/22 08:14:13 andrew Exp $ */
+/* $Id: incarnation.c,v 1.87 2006/05/22 08:15:37 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -1406,7 +1405,8 @@
        slist_iter(
                child_rsc, resource_t, clone_data->child_list, lpc,
 
-               if(num_probes >= clone_data->clone_node_max) {
+               if(rsc->globally_unique == FALSE
+                  && num_probes >= clone_data->clone_node_max) {
                        return FALSE;
                }
                if(pe_find_node_id(child_rsc->running_on, node->details->id)) {




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

Message: 3
Date: Mon, 22 May 2006 02:27:34 -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/pengine


Modified Files:
        complex.c complex.h graph.c group.c incarnation.c master.c 
        native.c pengine.h stages.c unpack.c utils.c 


Log Message:
Differentiate between parameters that the admin supplied for the RA and
  paramters that tell us how the resource should behave (ie. colocated) 
  as well as parameters we synthesize (ie. notify_operation)
The new approach also means that resource attributes will not show up in the
  list of parameters (which can cause resource restarts if changed)
If we so choose, we can also give them to the RA with an extra prefix

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/complex.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- complex.h   5 May 2006 13:08:49 -0000       1.33
+++ complex.h   22 May 2006 08:27:33 -0000      1.34
@@ -1,4 +1,4 @@
-/* $Id: complex.h,v 1.33 2006/05/05 13:08:49 andrew Exp $ */
+/* $Id: complex.h,v 1.34 2006/05/22 08:27:33 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -234,7 +234,6 @@
 extern void unpack_instance_attributes(
        crm_data_t *xml_obj, const char *set_name, node_t *node, GHashTable 
*hash,
        const char **attr_filter, int attrs_length, pe_working_set_t *data_set);
-extern void add_rsc_param(resource_t *rsc, const char *name, const char 
*value);
 extern void add_hash_param(GHashTable *hash, const char *name, const char 
*value);
 
 #if CURSES_ENABLED
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/graph.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -3 -r1.87 -r1.88
--- graph.c     5 May 2006 13:08:49 -0000       1.87
+++ graph.c     22 May 2006 08:27:33 -0000      1.88
@@ -1,4 +1,4 @@
-/* $Id: graph.c,v 1.87 2006/05/05 13:08:49 andrew Exp $ */
+/* $Id: graph.c,v 1.88 2006/05/22 08:27:33 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -83,7 +83,7 @@
                        
                } else if(safe_str_eq(other->action->task, CRMD_ACTION_START)) {
                        const char *interval = g_hash_table_lookup(
-                               action->extra, XML_LRM_ATTR_INTERVAL);
+                               action->meta, XML_LRM_ATTR_INTERVAL);
                        int interval_i = 0;
                        if(interval != NULL) {
                                interval_i = crm_parse_int(interval, NULL);
@@ -379,9 +379,8 @@
        }
 
        if(action->failure_is_fatal == FALSE) {
-               g_hash_table_insert(
-                       action->extra, crm_strdup(XML_ATTR_TE_ALLOWFAIL),
-                       crm_strdup(XML_BOOLEAN_TRUE));
+               add_hash_param(action->meta,
+                              XML_ATTR_TE_ALLOWFAIL, XML_BOOLEAN_TRUE);
        }
        
        if(as_input) {
@@ -390,25 +389,42 @@
 
        if(action->notify_keys != NULL) {
                g_hash_table_foreach(
-                       action->notify_keys, dup_attr, action->extra);
+                       action->notify_keys, dup_attr, action->meta);
        }
        if(action->rsc != NULL && action->pseudo == FALSE) {
+               int lpc = 0;
+               
                crm_data_t *rsc_xml = create_xml_node(
                        action_xml, crm_element_name(action->rsc->xml));
 
-               copy_in_properties(rsc_xml, action->rsc->xml);
+               const char *attr_list[] = {
+                       XML_AGENT_ATTR_CLASS,
+                       XML_AGENT_ATTR_PROVIDER,
+                       XML_ATTR_TYPE
+               };
+
                crm_xml_add(rsc_xml, XML_ATTR_ID, action->rsc->id);
                crm_xml_add(rsc_xml, XML_ATTR_ID_LONG, action->rsc->long_name);
+
+               for(lpc = 0; lpc < DIMOF(attr_list); lpc++) {
+                       crm_xml_add(rsc_xml, attr_list[lpc],
+                                   g_hash_table_lookup(action->rsc->meta, 
attr_list[lpc]));
+               }
                
                args_xml = create_xml_node(action_xml, XML_TAG_ATTRS);
-               g_hash_table_foreach(action->extra, hash2field, args_xml);
-               
+               crm_xml_add(args_xml, XML_ATTR_CRM_VERSION, CRM_FEATURE_SET);
+
                g_hash_table_foreach(
                        action->rsc->parameters, hash2field, args_xml);
 
+               g_hash_table_foreach(action->extra, hash2field, args_xml);
+/*             g_hash_table_foreach(action->meta, hash2metafield, args_xml); */
+               g_hash_table_foreach(action->meta, hash2field, args_xml);
+               
        } else {
                args_xml = create_xml_node(action_xml, XML_TAG_ATTRS);
-               g_hash_table_foreach(action->extra, hash2field, args_xml);
+               crm_xml_add(args_xml, XML_ATTR_CRM_VERSION, CRM_FEATURE_SET);
+               g_hash_table_foreach(action->meta, hash2metafield, args_xml);
        }
        crm_log_xml_debug_2(action_xml, "dumped action");
        
@@ -422,7 +438,7 @@
 
        CRM_CHECK(action != NULL, return FALSE);
 
-       interval = g_hash_table_lookup(action->extra, XML_LRM_ATTR_INTERVAL);
+       interval = g_hash_table_lookup(action->meta, XML_LRM_ATTR_INTERVAL);
        if(action->optional) {
                crm_debug_5("action %d was optional", action->id);
                return FALSE;
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/group.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -3 -r1.61 -r1.62
--- group.c     5 May 2006 13:08:49 -0000       1.61
+++ group.c     22 May 2006 08:27:33 -0000      1.62
@@ -1,4 +1,4 @@
-/* $Id: group.c,v 1.61 2006/05/05 13:08:49 andrew Exp $ */
+/* $Id: group.c,v 1.62 2006/05/22 08:27:33 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -62,9 +62,9 @@
        crm_data_t *xml_self = copy_xml(rsc->xml);
        group_variant_data_t *group_data = NULL;
        const char *group_ordered = g_hash_table_lookup(
-               rsc->parameters, XML_RSC_ATTR_ORDERED);
+               rsc->meta, XML_RSC_ATTR_ORDERED);
        const char *group_colocated = g_hash_table_lookup(
-               rsc->parameters, "collocated");
+               rsc->meta, "collocated");
        const char *clone_id = NULL;
        
        crm_debug_3("Processing resource %s...", rsc->id);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/incarnation.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -3 -r1.87 -r1.88
--- incarnation.c       22 May 2006 08:15:37 -0000      1.87
+++ incarnation.c       22 May 2006 08:27:33 -0000      1.88
@@ -1,4 +1,4 @@
-/* $Id: incarnation.c,v 1.87 2006/05/22 08:15:37 andrew Exp $ */
+/* $Id: incarnation.c,v 1.88 2006/05/22 08:27:33 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -98,8 +98,8 @@
        clone_data->child_list = g_list_append(
                clone_data->child_list, child_rsc);
        
-       add_rsc_param(child_rsc, XML_RSC_ATTR_INCARNATION, inc_num);
-       add_rsc_param(child_rsc, XML_RSC_ATTR_INCARNATION_MAX, inc_max);
+       add_hash_param(child_rsc->meta, XML_RSC_ATTR_INCARNATION_MAX, inc_max);
+       add_hash_param(child_rsc->parameters, 
crm_meta_name(XML_RSC_ATTR_INCARNATION_MAX), inc_max);
        
        print_resource(LOG_DEBUG_3, "Added", child_rsc, FALSE);
        
@@ -118,15 +118,14 @@
        clone_variant_data_t *clone_data = NULL;
        resource_t *self = NULL;
 
-       const char *ordered =
-               crm_element_value(xml_obj, XML_RSC_ATTR_ORDERED);
-       const char *interleave =
-               crm_element_value(xml_obj, XML_RSC_ATTR_INTERLEAVE);
-
+       const char *ordered = g_hash_table_lookup(
+               rsc->meta, XML_RSC_ATTR_ORDERED);
+       const char *interleave = g_hash_table_lookup(
+               rsc->meta, XML_RSC_ATTR_INTERLEAVE);
        const char *max_clones = g_hash_table_lookup(
-               rsc->parameters, XML_RSC_ATTR_INCARNATION_MAX);
+               rsc->meta, XML_RSC_ATTR_INCARNATION_MAX);
        const char *max_clones_node = g_hash_table_lookup(
-               rsc->parameters, XML_RSC_ATTR_INCARNATION_NODEMAX);
+               rsc->meta, XML_RSC_ATTR_INCARNATION_NODEMAX);
 
        crm_debug_3("Processing resource %s...", rsc->id);
 
@@ -551,12 +550,12 @@
                               CRMD_ACTION_NOTIFY, NULL,
                               action->optional, TRUE, data_set);
        
-       add_hash_param(notify->extra, "notify_type", "pre");
-       add_hash_param(notify->extra, "notify_operation", action->task);
+       add_hash_param(notify->meta, "notify_type", "pre");
+       add_hash_param(notify->meta, "notify_operation", action->task);
        if(clone_data->notify_confirm) {
-               add_hash_param(notify->extra, "notify_confirm", "yes");
+               add_hash_param(notify->meta, "notify_confirm", "yes");
        } else {
-               add_hash_param(notify->extra, "notify_confirm", "no");
+               add_hash_param(notify->meta, "notify_confirm", "no");
        }
        notify->pseudo = TRUE;
 
@@ -566,12 +565,12 @@
        notify_complete = custom_action(clone_data->self, notify_key,
                               CRMD_ACTION_NOTIFIED, NULL,
                               action->optional, TRUE, data_set);
-       add_hash_param(notify_complete->extra, "notify_type", "pre");
-       add_hash_param(notify_complete->extra, "notify_operation", 
action->task);
+       add_hash_param(notify_complete->meta, "notify_type", "pre");
+       add_hash_param(notify_complete->meta, "notify_operation", action->task);
        if(clone_data->notify_confirm) {
-               add_hash_param(notify->extra, "notify_confirm", "yes");
+               add_hash_param(notify->meta, "notify_confirm", "yes");
        } else {
-               add_hash_param(notify->extra, "notify_confirm", "no");
+               add_hash_param(notify->meta, "notify_confirm", "no");
        }
        notify->pseudo = TRUE;
        notify_complete->pseudo = TRUE;
@@ -597,12 +596,12 @@
        notify = custom_action(clone_data->self, notify_key,
                               CRMD_ACTION_NOTIFY, NULL,
                               action_complete->optional, TRUE, data_set);
-       add_hash_param(notify->extra, "notify_type", "post");
-       add_hash_param(notify->extra, "notify_operation", action->task);
+       add_hash_param(notify->meta, "notify_type", "post");
+       add_hash_param(notify->meta, "notify_operation", action->task);
        if(clone_data->notify_confirm) {
-               add_hash_param(notify->extra, "notify_confirm", "yes");
+               add_hash_param(notify->meta, "notify_confirm", "yes");
        } else {
-               add_hash_param(notify->extra, "notify_confirm", "no");
+               add_hash_param(notify->meta, "notify_confirm", "no");
        }
        notify->pseudo = TRUE;
 
@@ -618,12 +617,12 @@
        notify_complete = custom_action(clone_data->self, notify_key,
                               CRMD_ACTION_NOTIFIED, NULL,
                               action->optional, TRUE, data_set);
-       add_hash_param(notify_complete->extra, "notify_type", "pre");
-       add_hash_param(notify_complete->extra, "notify_operation", 
action->task);
+       add_hash_param(notify_complete->meta, "notify_type", "pre");
+       add_hash_param(notify_complete->meta, "notify_operation", action->task);
        if(clone_data->notify_confirm) {
-               add_hash_param(notify->extra, "notify_confirm", "yes");
+               add_hash_param(notify->meta, "notify_confirm", "yes");
        } else {
-               add_hash_param(notify->extra, "notify_confirm", "no");
+               add_hash_param(notify->meta, "notify_confirm", "no");
        }
        notify_complete->pseudo = TRUE;
 
@@ -1236,7 +1235,7 @@
 /*             action, action_t, clone_data->self->actions, lpc2, */
 
 /*             if(safe_str_eq(action->task, CRMD_ACTION_NOTIFY)) { */
-/*                     action->extra_xml = notify_xml; */
+/*                     action->meta_xml = notify_xml; */
 /*             } */
 /*             ); */
        
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/master.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- master.c    6 May 2006 07:56:31 -0000       1.17
+++ master.c    22 May 2006 08:27:33 -0000      1.18
@@ -1,4 +1,4 @@
-/* $Id: master.c,v 1.17 2006/05/06 07:56:31 andrew Exp $ */
+/* $Id: master.c,v 1.18 2006/05/22 08:27:33 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -56,7 +56,8 @@
 
 void master_unpack(resource_t *rsc, pe_working_set_t *data_set)
 {
-       add_hash_param(rsc->parameters, "stateful", XML_BOOLEAN_TRUE);
+       add_hash_param(rsc->parameters, crm_meta_name("stateful"),
+                      XML_BOOLEAN_TRUE);
        clone_unpack(rsc, data_set);
 }
 
@@ -232,9 +233,9 @@
        resource_t *last_promote_rsc = NULL;
        resource_t *last_demote_rsc = NULL;
        const char *master_max_s = g_hash_table_lookup(
-               rsc->parameters, XML_RSC_ATTR_MASTER_MAX);
+               rsc->meta, XML_RSC_ATTR_MASTER_MAX);
        const char *master_node_max_s = g_hash_table_lookup(
-               rsc->parameters, XML_RSC_ATTR_MASTER_NODEMAX);
+               rsc->meta, XML_RSC_ATTR_MASTER_NODEMAX);
 
        int promoted = 0;
        int master_max = crm_parse_int(master_max_s, "1");
@@ -395,8 +396,8 @@
                        default:
                                CRM_CHECK(FALSE/* unhandled */, ;);
                }
-               add_hash_param(child_rsc->parameters,
-                              "crm_role", role2text(child_rsc->next_role));
+               add_hash_param(child_rsc->parameters, crm_meta_name("role"),
+                              role2text(child_rsc->next_role));
                );
        crm_info("Promoted %d (of %d) slaves to master", promoted, master_max);
        g_hash_table_destroy(master_hash);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/native.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -3 -r1.133 -r1.134
--- native.c    10 May 2006 17:08:45 -0000      1.133
+++ native.c    22 May 2006 08:27:33 -0000      1.134
@@ -1,4 +1,4 @@
-/* $Id: native.c,v 1.133 2006/05/10 17:08:45 andrew Exp $ */
+/* $Id: native.c,v 1.134 2006/05/22 08:27:33 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -451,8 +451,8 @@
                                        FALSE, TRUE, data_set);
 
                                mon->task = CRMD_ACTION_CANCEL;
-                               add_hash_param(mon->extra, 
XML_LRM_ATTR_INTERVAL, interval);
-                               add_hash_param(mon->extra, "task", name);
+                               add_hash_param(mon->meta, 
XML_LRM_ATTR_INTERVAL, interval);
+                               add_hash_param(mon->meta, XML_LRM_ATTR_TASK, 
name);
                                
                                custom_action_order(
                                        rsc, NULL, mon,
@@ -500,7 +500,7 @@
 
                if(rsc->next_role == RSC_ROLE_MASTER) {
                        char *running_master = crm_itoa(EXECRA_RUNNING_MASTER);
-                       add_hash_param(mon->extra, XML_ATTR_TE_TARGET_RC, 
running_master);
+                       add_hash_param(mon->meta, XML_ATTR_TE_TARGET_RC, 
running_master);
                        custom_action_order(
                                rsc, promote_key(rsc), NULL,
                                rsc, NULL, mon,
@@ -1679,8 +1679,10 @@
                crm_debug_4("No notificaitons required for %s", op->task);
                return;
        }
-
-       next_node = rsc->color->details->chosen_node;
+       if(rsc->color != NULL) {
+               next_node = rsc->color->details->chosen_node;
+       }
+       
        op_key = generate_op_key(rsc->id, op->task, 0);
        possible_matches = find_actions(rsc->actions, op_key, NULL);
        
@@ -1753,8 +1755,8 @@
 
        CRM_CHECK(node != NULL, return NULL);
 
-       value = g_hash_table_lookup(op->extra, "notify_type");
-       task = g_hash_table_lookup(op->extra, "notify_operation");
+       value = g_hash_table_lookup(op->meta, "notify_type");
+       task = g_hash_table_lookup(op->meta, "notify_operation");
 
        crm_debug_2("Creating actions for %s: %s (%s-%s)",
                    op->uuid, rsc->id, value, task);
@@ -1762,7 +1764,7 @@
        key = generate_notify_key(rsc->id, value, task);
        trigger = custom_action(rsc, key, op->task, node,
                                op->optional, TRUE, data_set);
-       g_hash_table_foreach(op->extra, dup_attr, trigger->extra);
+       g_hash_table_foreach(op->meta, dup_attr, trigger->extra);
        trigger->notify_keys = n_data->keys;
 
        /* pseudo_notify before notify */
@@ -1781,7 +1783,7 @@
        op->actions_after = g_list_append(op->actions_after, wrapper);
 
        
-       value = g_hash_table_lookup(op->extra, "notify_confirm");
+       value = g_hash_table_lookup(op->meta, "notify_confirm");
        if(crm_is_true(value)) {
                /* notify before pseudo_notified */
                crm_debug_3("Ordering %s before %s (%d->%d)",
@@ -1970,7 +1972,7 @@
        refresh = custom_action(
                NULL, crm_strdup(CRM_OP_LRM_REFRESH), CRM_OP_LRM_REFRESH,
                node, FALSE, TRUE, data_set);
-       add_hash_param(refresh->extra, XML_ATTR_TE_NOWAIT, XML_BOOLEAN_TRUE);
+       add_hash_param(refresh->meta, XML_ATTR_TE_NOWAIT, XML_BOOLEAN_TRUE);
 
        custom_action_order(
                rsc, NULL, delete, NULL, NULL, refresh, 
@@ -2093,16 +2095,11 @@
        
        crm_notice("%s: Created probe for %s", node->details->uname, rsc->id);
        
-       g_hash_table_insert(probe->extra,
-                           crm_strdup(XML_ATTR_TE_TARGET_RC), target_rc);
-
-       g_hash_table_insert(probe->extra,
-                           crm_strdup(XML_ATTR_LRM_PROBE),
-                           crm_strdup(XML_BOOLEAN_TRUE));
-       
+       add_hash_param(probe->meta, XML_ATTR_TE_TARGET_RC, target_rc);
        custom_action_order(rsc, NULL, probe, rsc, NULL, complete,
-                           pe_ordering_manditory, data_set);   
+                           pe_ordering_manditory, data_set);
 
+       crm_free(target_rc);
        return TRUE;
 }
 
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/pengine.h,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -3 -r1.110 -r1.111
--- pengine.h   5 May 2006 13:08:49 -0000       1.110
+++ pengine.h   22 May 2006 08:27:33 -0000      1.111
@@ -1,4 +1,4 @@
-/* $Id: pengine.h,v 1.110 2006/05/05 13:08:49 andrew Exp $ */
+/* $Id: pengine.h,v 1.111 2006/05/22 08:27:33 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -317,6 +317,7 @@
                enum rsc_role_e role;
                enum rsc_role_e next_role;
 
+               GHashTable *meta;          
                GHashTable *parameters;    
 };
 
@@ -372,6 +373,7 @@
                
                int seen_count;
 
+               GHashTable *meta;
                GHashTable *extra;
                GHashTable *notify_keys;  /* do NOT free */
                
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/stages.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -3 -r1.93 -r1.94
--- stages.c    15 May 2006 09:40:54 -0000      1.93
+++ stages.c    22 May 2006 08:27:33 -0000      1.94
@@ -1,4 +1,4 @@
-/* $Id: stages.c,v 1.93 2006/05/15 09:40:54 andrew Exp $ */
+/* $Id: stages.c,v 1.94 2006/05/22 08:27:33 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -197,7 +197,7 @@
                        NULL, crm_strdup(CRM_OP_PROBED),
                        CRM_OP_PROBED, node, FALSE, TRUE, data_set);
                probe_node_complete->optional = crm_is_true(probed);
-               add_hash_param(probe_node_complete->extra,
+               add_hash_param(probe_node_complete->meta,
                               XML_ATTR_TE_NOWAIT, XML_BOOLEAN_TRUE);
                
                custom_action_order(NULL, NULL, probe_node_complete,
@@ -346,15 +346,15 @@
                        stonith_op->runnable = TRUE;
 
                        add_hash_param(
-                               stonith_op->extra, XML_LRM_ATTR_TARGET,
+                               stonith_op->meta, XML_LRM_ATTR_TARGET,
                                node->details->uname);
 
                        add_hash_param(
-                               stonith_op->extra, XML_LRM_ATTR_TARGET_UUID,
+                               stonith_op->meta, XML_LRM_ATTR_TARGET_UUID,
                                node->details->id);
 
                        add_hash_param(
-                               stonith_op->extra, "stonith_action",
+                               stonith_op->meta, "stonith_action",
                                data_set->stonith_action);
                        
                        if(down_op != NULL) {
@@ -380,7 +380,7 @@
                crm_debug_2("Ordering shutdowns before %s on %s (DC)",
                        down_op->task, down_op->node->details->uname);
 
-               add_hash_param(dc_down->extra, XML_ATTR_TE_NOWAIT,
+               add_hash_param(dc_down->meta, XML_ATTR_TE_NOWAIT,
                               XML_BOOLEAN_TRUE);
                
                slist_iter(
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/unpack.c,v
retrieving revision 1.194
retrieving revision 1.195
diff -u -3 -r1.194 -r1.195
--- unpack.c    10 May 2006 18:14:15 -0000      1.194
+++ unpack.c    22 May 2006 08:27:33 -0000      1.195
@@ -1,4 +1,4 @@
-/* $Id: unpack.c,v 1.194 2006/05/10 18:14:15 andrew Exp $ */
+/* $Id: unpack.c,v 1.195 2006/05/22 08:27:33 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -1038,7 +1038,7 @@
                process_rsc_state(rsc, node, on_fail, data_set);
        }
        
-       value = g_hash_table_lookup(rsc->parameters, XML_RSC_ATTR_TARGET_ROLE);
+       value = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_TARGET_ROLE);
        if(value != NULL && safe_str_neq("default", value)) {
                enum rsc_role_e req_role = text2role(value);
                if(req_role != RSC_ROLE_UNKNOWN && req_role != rsc->next_role){
@@ -1195,8 +1195,8 @@
 check_action_definition(resource_t *rsc, node_t *active_node, crm_data_t 
*xml_op,
                        pe_working_set_t *data_set)
 {
-       int interval = 0;
        char *key = NULL;
+       int interval = 0;
        const char *interval_s = NULL;
        
        gboolean did_change = FALSE;
@@ -1214,6 +1214,7 @@
 
        action_t *action = NULL;
        const char *task = crm_element_value(xml_op, XML_LRM_ATTR_TASK);
+       const char *op_version = crm_element_value(xml_op, 
XML_ATTR_CRM_VERSION);
 
        CRM_CHECK(active_node != NULL, return FALSE);
 
@@ -1224,30 +1225,34 @@
        if(interval > 0) {
                crm_data_t *op_match = NULL;
 
-               crm_debug_2("Checking parameters for %s %s", key, task);
+               crm_err("Checking parameters for %s %s", key, task);
                op_match = find_rsc_op_entry(rsc, key);
 
                if(op_match == NULL && data_set->stop_action_orphans) {
                        /* create a cancel action */
                        action_t *cancel = NULL;
-                       pe_config_warn("Orphan action will be stopped: %s", 
key);
+                       pe_config_err("Orphan action will be stopped: %s on %s",
+                                     key, active_node->details->uname);
 
                        crm_free(key);
                        key = generate_op_key(rsc->id, CRMD_ACTION_CANCEL, 
interval);
-                       
+
                        cancel = custom_action(
                                rsc, key, CRMD_ACTION_CANCEL, active_node,
                                FALSE, TRUE, data_set);
 
-                       add_hash_param(cancel->extra, XML_LRM_ATTR_TASK, task);
-                       add_hash_param(cancel->extra,
+                       add_hash_param(cancel->meta, XML_LRM_ATTR_TASK, task);
+                       add_hash_param(cancel->meta,
                                       XML_LRM_ATTR_INTERVAL, interval_s);
-                       
+
                        custom_action_order(
                                rsc, NULL, cancel,
                                rsc, stop_key(rsc), NULL,
                                pe_ordering_optional, data_set);
-
+               }
+               if(op_match == NULL) {
+                       pe_config_err("Orphan action detected: %s on %s",
+                                     key, active_node->details->uname);
                        return TRUE;
                }
        }
@@ -1267,7 +1272,7 @@
        g_hash_table_foreach(rsc->parameters, hash2field, pnow);
        g_hash_table_foreach(local_rsc_params, hash2field, pnow);
 
-       filter_action_parameters(pnow, NULL);
+       filter_action_parameters(pnow, op_version);
        pnow_digest = calculate_xml_digest(pnow, TRUE);
        param_digest = crm_element_value(xml_op, XML_LRM_ATTR_OP_DIGEST);
 
@@ -1278,60 +1283,47 @@
        if(params != NULL) {
                crm_data_t *local_params = copy_xml(params);
 
-               crm_info("Faking parameter digest creation for %s", ID(xml_op));
-               
-               filter_action_parameters(local_params, NULL);
+               crm_warn("Faking parameter digest creation for %s", 
ID(xml_op));                
+               filter_action_parameters(local_params, op_version);
+               xml_remove_prop(local_params, "interval");
+               xml_remove_prop(local_params, "timeout");
+               crm_log_xml_warn(local_params, "params:used");
+
                local_param_digest = calculate_xml_digest(local_params, TRUE);
                param_digest = local_param_digest;
                
                free_xml(local_params);
        }
 #endif
-/*
-#if CRM_DEPRECATED_SINCE_2_0_5
-       if(safe_str_neq(pnow_digest, param_digest)) {
-               char *fallback_digest = NULL;
-               filter_action_parameters(pnow, "1.0.5");
-               fallback_digest = calculate_xml_digest(pnow, TRUE);
-               if(safe_str_eq(fallback_digest, param_digest)) {
-                       crm_free(pnow_digest);
-                       pnow_digest = fallback_digest;
-                       fallback_digest = NULL;
-               }
-               crm_free(fallback_digest);
-       }
-#endif
-*/
+
        if(safe_str_neq(pnow_digest, param_digest)) {
 #if CRM_DEPRECATED_SINCE_2_0_4
                if(params) {
                        crm_data_t *local_params = copy_xml(params);
-                       filter_action_parameters(local_params, NULL);
+                       filter_action_parameters(local_params, op_version);
+                       xml_remove_prop(local_params, "interval");
+                       xml_remove_prop(local_params, "timeout");
                        
-                       crm_log_xml_err(local_params, "params:used");
                        free_xml(local_params);
                }
 #endif
                did_change = TRUE;
-               crm_info("Parameters to %s on %s changed: calculated %s vs. 
actual %s",
+               crm_log_xml_info(pnow, "params:calc");
+               crm_warn("Parameters to %s on %s changed: recorded %s vs. 
calculated %s",
                         ID(xml_op), active_node->details->uname,
-                        pnow_digest, crm_str(param_digest));
+                        crm_str(param_digest), pnow_digest);
 
-               crm_log_xml_debug(pnow, "params:calc");
-               
                key = generate_op_key(rsc->id, task, interval);
                custom_action(rsc, key, task, NULL, FALSE, TRUE, data_set);
        }
-       
-       g_hash_table_destroy(action->extra);
-       crm_free(action->uuid);
-       crm_free(action);
+
        free_xml(pnow);
        crm_free(pnow_digest);
        crm_free(local_param_digest);
-       
        g_hash_table_destroy(local_rsc_params);
 
+       pe_free_action(action);
+       
        return did_change;
 }
 
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/utils.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -3 -r1.136 -r1.137
--- utils.c     11 May 2006 09:11:33 -0000      1.136
+++ utils.c     22 May 2006 08:27:33 -0000      1.137
@@ -1,4 +1,4 @@
-/* $Id: utils.c,v 1.136 2006/05/11 09:11:33 andrew Exp $ */
+/* $Id: utils.c,v 1.137 2006/05/22 08:27:33 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -717,13 +717,10 @@
                                g_str_hash, g_str_equal,
                                g_hash_destroy_str, g_hash_destroy_str);
 
-                       /* include our version number...
-                        *   so future versions know what to be compatible
-                        *   with when we're DC
-                        */
-                       add_hash_param(action->extra,
-                                      XML_ATTR_CRM_VERSION, CRM_FEATURE_SET);
-                       
+                       action->meta = g_hash_table_new_full(
+                               g_str_hash, g_str_equal,
+                               g_hash_destroy_str, g_hash_destroy_str);
+
                        if(save_action) {
                                data_set->actions = g_list_append(
                                        data_set->actions, action);
@@ -758,7 +755,8 @@
                if(save_action) {
                        warn_level = LOG_WARNING;
                }
-               if(action->node != NULL) {
+
+               if(action->node != NULL && action->op_entry != NULL) {
                        unpack_instance_attributes(
                                action->op_entry, XML_TAG_ATTR_SETS,
                                action->node, action->extra, NULL,0, data_set);
@@ -865,7 +863,7 @@
        }
        if(value == NULL && safe_str_eq(action->task, CRMD_ACTION_START)) {
                value = g_hash_table_lookup(
-                       action->rsc->parameters, "start_prereq");
+                       action->rsc->meta, "start_prereq");
        }
        
        if(value == NULL && safe_str_neq(action->task, CRMD_ACTION_START)) {
@@ -903,7 +901,7 @@
        }
        if(value == NULL && safe_str_eq(action->task, CRMD_ACTION_STOP)) {
                value = g_hash_table_lookup(
-                       action->rsc->parameters, "on_stopfail");
+                       action->rsc->meta, "on_stopfail");
                if(value != NULL) {
 #if CRM_DEPRECATED_SINCE_2_0_2
                        pe_config_err("The \"on_stopfail\" attribute used in"
@@ -995,17 +993,17 @@
        for(;lpc < DIMOF(fields); lpc++) {
                value = crm_element_value(xml_obj, fields[lpc]);
                if(value != NULL) {
-                       int tmp_i = crm_get_msec(value);
                        char *tmp_ms = NULL;
+                       int tmp_i = crm_get_msec(value);
                        if(tmp_i < 0) {
                                tmp_i = 0;
                        }
                        tmp_ms = crm_itoa(tmp_i);
                        g_hash_table_insert(
-                               action->extra, crm_strdup(fields[lpc]), tmp_ms);
+                               action->meta, crm_strdup(fields[lpc]), tmp_ms);
                }
        }
-
+       
 /*     if(safe_str_eq(native_data->agent->class, "stonith")) { */
 /*             if(rsc->start_needs == rsc_req_stonith) { */
 /*                     pe_err("Stonith resources (eg. %s) cannot require" */
@@ -1603,6 +1601,7 @@
        pe_free_shallow(action->actions_before);/* action_warpper_t* */
        pe_free_shallow(action->actions_after); /* action_warpper_t* */
        g_hash_table_destroy(action->extra);
+       g_hash_table_destroy(action->meta);
        crm_free(action->uuid);
        crm_free(action);
 }
@@ -1665,7 +1664,7 @@
        
        slist_iter(
                action, action_t, input, lpc,
-               value = g_hash_table_lookup(action->extra, 
XML_LRM_ATTR_INTERVAL);
+               value = g_hash_table_lookup(action->meta, 
XML_LRM_ATTR_INTERVAL);
                if(value == NULL) {
                        /* skip */
                } else if(safe_str_eq(CRMD_ACTION_CANCEL, action->task)) {




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

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

Reply via email to