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


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

Message: 1
Date: Mon, 19 Dec 2005 09:54:45 -0700 (MST)
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:
        control.c fsa.c 


Log Message:
BEAM Fixes: Use of constant expressions in macros

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/control.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -3 -r1.101 -r1.102
--- control.c   22 Nov 2005 02:40:24 -0000      1.101
+++ control.c   19 Dec 2005 16:54:43 -0000      1.102
@@ -526,7 +526,7 @@
 
        dc_heartbeat->period_ms = 0;
        
-       xml_child_iter(
+       xml_child_iter_filter(
                config, iter, XML_CIB_TAG_NVPAIR,
 
                const char *name  = crm_element_value(iter, 
XML_NVPAIR_ATTR_NAME);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/fsa.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -3 -r1.125 -r1.126
--- fsa.c       22 Nov 2005 02:44:41 -0000      1.125
+++ fsa.c       19 Dec 2005 16:54:43 -0000      1.126
@@ -73,24 +73,12 @@
 longclock_t action_diff = 0;
 unsigned int action_diff_ms = 0;
 
-#define IF_FSA_ACTION(an_action,function)                              \
-       if(is_set(fsa_actions,an_action)) {                             \
-          enum crmd_fsa_input result = I_NULL;                         \
-          last_action = an_action;                                     \
-          fsa_actions = clear_bit(fsa_actions, an_action);             \
-          crm_debug_3("Invoking action %s (%.16llx)",                  \
-                      fsa_action2string(an_action), an_action);        \
-          if(action_diff_max_ms > 0) {                                 \
-                  action_start = time_longclock();                     \
-          }                                                            \
-          result = function(an_action, fsa_data->fsa_cause, fsa_state, \
-                         fsa_data->fsa_input, fsa_data);               \
+#define FSA_ACTION_TIMECHECK(an_action)                                        
\
           if(action_diff_max_ms > 0) {                                 \
                   action_stop = time_longclock();                      \
                   action_diff = sub_longclock(action_stop, action_start); \
                   action_diff_ms = longclockto_ms(action_diff);        \
-                  if(an_action != A_CIB_START/*constant condition*/    \
-                     && action_diff_ms > action_diff_max_ms) {         \
+                  if(action_diff_ms > action_diff_max_ms) {            \
                           crm_err("Action %s took %dms to complete",   \
                                   fsa_action2string(an_action),        \
                                   action_diff_ms);                     \
@@ -99,12 +87,37 @@
                                    fsa_action2string(an_action),       \
                                    action_diff_ms);                    \
                   }                                                    \
+          }
+
+
+#define FSA_ACTION_RUN(an_action,function) {                           \
+          enum crmd_fsa_input result = I_NULL;                         \
+          last_action = an_action;                                     \
+          fsa_actions = clear_bit(fsa_actions, an_action);             \
+          crm_debug_3("Invoking action %s (%.16llx)",                  \
+                      fsa_action2string(an_action), an_action);        \
+          if(action_diff_max_ms > 0) {                                 \
+                  action_start = time_longclock();                     \
           }                                                            \
+          result = function(an_action, fsa_data->fsa_cause, fsa_state, \
+                         fsa_data->fsa_input, fsa_data);               \
           crm_debug_3("Action complete: %s (%.16llx)",                 \
                       fsa_action2string(an_action), an_action);        \
           CRM_DEV_ASSERT(result == I_NULL);                            \
           do_dot_action(DOT_PREFIX"\t// %s", fsa_action2string(an_action)); \
-   }
+       }
+
+#define IF_FSA_ACTION_NOTIME(an_action,function)                       \
+       if(is_set(fsa_actions,an_action)) {                             \
+               FSA_ACTION_RUN(an_action,function);                     \
+       }
+
+#define IF_FSA_ACTION(an_action,function)                              \
+       if(is_set(fsa_actions,an_action)) {                             \
+               FSA_ACTION_RUN(an_action,function);                     \
+               FSA_ACTION_TIMECHECK(an_action);                        \
+       }
+
 
 /* #define ELSEIF_FSA_ACTION(x,y) else IF_FSA_ACTION(x,y) */
 void init_dotfile(void);
@@ -359,7 +372,7 @@
 
                /* essential start tasks */
                else IF_FSA_ACTION(A_STARTUP,     do_startup)
-               else IF_FSA_ACTION(A_CIB_START,   do_cib_control)
+               else IF_FSA_ACTION_NOTIME(A_CIB_START,    do_cib_control)
                else IF_FSA_ACTION(A_HA_CONNECT,  do_ha_control)
                else IF_FSA_ACTION(A_READCONFIG,  do_read_config)
 




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

Message: 2
Date: Mon, 19 Dec 2005 09:54:45 -0700 (MST)
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:
BEAM Fixes: Use of constant expressions in macros

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/common/xml.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- xml.h       22 Nov 2005 02:44:41 -0000      1.36
+++ xml.h       19 Dec 2005 16:54:43 -0000      1.37
@@ -1,4 +1,4 @@
-/* $Id: xml.h,v 1.36 2005/11/22 02:44:41 andrew Exp $ */
+/* $Id: xml.h,v 1.37 2005/12/19 16:54:43 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -238,7 +238,29 @@
 extern gboolean xml_has_children(crm_data_t *root);                    
 
 #   define xmlGetNodePath(data) crm_element_value(data, XML_ATTR_TAGNAME)
-#   define xml_child_iter(parent, child, filter, loop_code)            \
+#   define xml_child_iter(parent, child, loop_code)                    \
+       if(parent != NULL) {                                            \
+               int __counter = 0;                                      \
+               crm_data_t *child = NULL;                               \
+               crm_validate_data(parent);                              \
+               for (__counter = 0; __counter < parent->nfields; __counter++) { 
\
+                       if(parent->types[__counter] != FT_STRUCT        \
+                          && parent->types[__counter] != FT_UNCOMPRESS) { \
+                               continue;                               \
+                       }                                               \
+                       child = parent->values[__counter];              \
+                       if(child == NULL) {                             \
+                               crm_debug_4("Skipping %s == NULL",      \
+                                         parent->names[__counter]);    \
+                       } else {                                        \
+                               loop_code;                              \
+                       }                                               \
+               }                                                       \
+       } else {                                                        \
+               crm_debug_4("Parent of loop was NULL");                 \
+       }
+
+#define xml_child_iter_filter(parent, child, filter, loop_code)                
\
        if(parent != NULL) {                                            \
                int __counter = 0;                                      \
                crm_data_t *child = NULL;                               \




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

Message: 3
Date: Mon, 19 Dec 2005 09:54:45 -0700 (MST)
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/tengine


Modified Files:
        callbacks.c unpack.c 


Log Message:
BEAM Fixes: Use of constant expressions in macros

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/tengine/callbacks.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -3 -r1.56 -r1.57
--- callbacks.c 3 Nov 2005 17:31:56 -0000       1.56
+++ callbacks.c 19 Dec 2005 16:54:44 -0000      1.57
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.56 2005/11/03 17:31:56 andrew Exp $ */
+/* $Id: callbacks.c,v 1.57 2005/12/19 16:54:44 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -134,25 +134,25 @@
        
        section = XML_CIB_TAG_NODES;
        section_xml = get_object_root(section, update);
-       xml_child_iter(section_xml, child, NULL,
+       xml_child_iter(section_xml, child, 
                       return section_xml;
                );
 
        section = XML_CIB_TAG_RESOURCES;
        section_xml = get_object_root(section, update);
-       xml_child_iter(section_xml, child, NULL,
+       xml_child_iter(section_xml, child, 
                       return section_xml;
                );
 
        section = XML_CIB_TAG_CONSTRAINTS;
        section_xml = get_object_root(section, update);
-       xml_child_iter(section_xml, child, NULL,
+       xml_child_iter(section_xml, child, 
                       return section_xml;
                );
 
        section = XML_CIB_TAG_CRMCONFIG;
        section_xml = get_object_root(section, update);
-       xml_child_iter(section_xml, child, NULL,
+       xml_child_iter(section_xml, child, 
                       return section_xml;
                );
        return NULL;
@@ -238,7 +238,7 @@
                section = XML_CIB_TAG_NODES;
                if(abort == FALSE) {
                        section_xml = get_object_root(section, update);
-                       xml_child_iter(section_xml, child, NULL,
+                       xml_child_iter(section_xml, child, 
                                       abort = TRUE;
                                       break;
                                );
@@ -246,7 +246,7 @@
                section = XML_CIB_TAG_RESOURCES;
                if(abort == FALSE) {
                        section_xml = get_object_root(section, update);
-                       xml_child_iter(section_xml, child, NULL,
+                       xml_child_iter(section_xml, child, 
                                       abort = TRUE;
                                       break;
                                );
@@ -254,7 +254,7 @@
                section = XML_CIB_TAG_CONSTRAINTS;
                if(abort == FALSE) {
                        section_xml = get_object_root(section, update);
-                       xml_child_iter(section_xml, child, NULL,
+                       xml_child_iter(section_xml, child, 
                                       abort = TRUE;
                                       break;
                                );
@@ -262,7 +262,7 @@
                section = XML_CIB_TAG_CRMCONFIG;
                if(abort == FALSE) {
                        section_xml = get_object_root(section, update);
-                       xml_child_iter(section_xml, child, NULL,
+                       xml_child_iter(section_xml, child, 
                                       abort = TRUE;
                                       break;
                                );
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/tengine/unpack.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- unpack.c    31 Oct 2005 08:53:04 -0000      1.50
+++ unpack.c    19 Dec 2005 16:54:44 -0000      1.51
@@ -1,4 +1,4 @@
-/* $Id: unpack.c,v 1.50 2005/10/31 08:53:04 andrew Exp $ */
+/* $Id: unpack.c,v 1.51 2005/12/19 16:54:44 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -82,7 +82,7 @@
        crm_info("Beginning transition %d : timeout set to %dms",
                 transition_counter, transition_timer->timeout);
 
-       xml_child_iter(
+       xml_child_iter_filter(
                xml_graph, synapse, "synapse",
 
                synapse_t *new_synapse = NULL;
@@ -102,11 +102,11 @@
                crm_debug_3("look for actions in synapse %s",
                          crm_element_value(synapse, XML_ATTR_ID));
 
-               xml_child_iter(
+               xml_child_iter_filter(
                        synapse, actions, "action_set",
 
                        xml_child_iter(
-                               actions, action, NULL,
+                               actions, action, 
                                
                                action_t *new_action = unpack_action(action);
                                num_actions++;
@@ -127,14 +127,14 @@
                crm_debug_3("look for inputs in synapse %s",
                          crm_element_value(synapse, XML_ATTR_ID));
 
-               xml_child_iter(
+               xml_child_iter_filter(
                        synapse, inputs, "inputs",
 
                        xml_child_iter(
-                               inputs, trigger, NULL,
+                               inputs, trigger, 
 
                                xml_child_iter(
-                                       trigger, input, NULL,
+                                       trigger, input, 
 
                                        action_t *new_input =
                                                unpack_action(input);
@@ -261,7 +261,7 @@
         <rsc_state id="" rsc_id="rsc4" node_id="node1" rsc_state="stopped"/>
 */
        crm_debug_4("Extracting event from %s", crm_element_name(msg));
-       xml_child_iter(
+       xml_child_iter_filter(
                msg, node_state, XML_CIB_TAG_STATE,
 
                crm_data_t *attrs = NULL;
@@ -297,9 +297,9 @@
 
                /* LRM resource update... */
                xml_child_iter(
-                       resources, rsc, NULL, 
+                       resources, rsc,  
                        xml_child_iter(
-                               rsc, rsc_op, NULL, 
+                               rsc, rsc_op,  
                                
                                crm_log_xml_debug_3(
                                        rsc_op, "Processing resource update");




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

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


End of Linux-ha-cvs Digest, Vol 25, Issue 43
********************************************

Reply via email to