Send Linux-ha-cvs mailing list submissions to
        linux-ha-cvs@lists.linux-ha.org

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: cts by andrew from 
      (linux-ha-cvs@lists.linux-ha.org)
   2. Linux-HA CVS: lib by andrew from 
      (linux-ha-cvs@lists.linux-ha.org)
   3. Linux-HA CVS: include by andrew from 
      (linux-ha-cvs@lists.linux-ha.org)


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

Message: 1
Date: Mon, 14 Aug 2006 03:00:57 -0600 (MDT)
From: linux-ha-cvs@lists.linux-ha.org
Subject: [Linux-ha-cvs] Linux-HA CVS: cts by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

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

Dir     : linux-ha/cts


Modified Files:
        CIB.py.in 


Log Message:
Separate action timeouts from network delays by introducing the network-delay 
option 
Add the beginnings of a better option processing infrastructure

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/CIB.py.in,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- CIB.py.in   14 Aug 2006 08:56:40 -0000      1.18
+++ CIB.py.in   14 Aug 2006 09:00:56 -0000      1.19
@@ -17,6 +17,7 @@
     <cluster_property_set id="cib-bootstrap-options">
        <attributes>
         <nvpair id="cib-bootstrap-options-default_action_timeout"  
name="default_action_timeout" value="5s"/>
+        <nvpair id="cib-bootstrap-options-network-delay"           
name="network-delay"          value="30s"/>
         <nvpair id="cib-bootstrap-options-symmetric_cluster"       
name="symmetric_cluster"      value="true"/>
         <nvpair id="cib-bootstrap-options-stop_orphan_resources"   
name="stop_orphan_resources"  value="true"/>
         <nvpair id="cib-bootstrap-options-stop_orphan_actions"     
name="stop_orphan_actions"    value="true"/>




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

Message: 2
Date: Mon, 14 Aug 2006 03:00:58 -0600 (MDT)
From: linux-ha-cvs@lists.linux-ha.org
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/pengine


Modified Files:
        common.c status.c unpack.c utils.c 


Log Message:
Separate action timeouts from network delays by introducing the network-delay 
option 
Add the beginnings of a better option processing infrastructure

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/pengine/common.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- common.c    7 Jun 2006 12:46:56 -0000       1.2
+++ common.c    14 Aug 2006 09:00:57 -0000      1.3
@@ -1,4 +1,4 @@
-/* $Id: common.c,v 1.2 2006/06/07 12:46:56 andrew Exp $ */
+/* $Id: common.c,v 1.3 2006/08/14 09:00:57 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -295,3 +295,59 @@
        }
 }
 
+
+static gboolean
+check_action_timeout(const char *value) 
+{
+       long tmp = crm_get_msec(value);
+       if(tmp < 5) {
+               return FALSE;
+       }
+       return TRUE;
+}
+
+const char *
+default_action_timeout(GHashTable* options)
+{
+       return cluster_option(options, &check_action_timeout,
+                             "default_action_timeout",
+                             "transition_idle_timeout", "60s");
+}
+
+const char *
+cluster_option(GHashTable* options, gboolean(*validate)(const char*),
+              const char *name, const char *old_name, const char *def_value)
+{
+       const char *value = NULL;
+       CRM_ASSERT(name != NULL);
+       CRM_ASSERT(options != NULL);
+
+       return "60s";
+       
+       value = g_hash_table_lookup(options, name);
+       if(value == NULL && old_name) {
+               value = g_hash_table_lookup(options, old_name);
+               if(value != NULL) {
+                       pe_config_warn("Using deprecated name '%s' for"
+                                      " cluster option '%s'", old_name, name);
+               }
+       }
+
+       if(value == NULL) {
+               g_hash_table_insert(
+                       options, crm_strdup(name), crm_strdup(def_value));
+               value = g_hash_table_lookup(options, name);
+               crm_notice("Using default value '%s' for cluster option '%s'",
+                          value, name);
+       }
+       
+       if(validate && validate(value) == FALSE) {
+               pe_config_err("Value '%s' for cluster option '%s' is invalid."
+                             "  Defaulting to %s", value, name, def_value);
+               g_hash_table_replace(options, crm_strdup(name),
+                                    crm_strdup(def_value));
+               value = g_hash_table_lookup(options, name);
+       }
+       
+       return value;
+}
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/pengine/status.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- status.c    4 Jul 2006 07:36:01 -0000       1.7
+++ status.c    14 Aug 2006 09:00:57 -0000      1.8
@@ -1,4 +1,4 @@
-/* $Id: status.c,v 1.7 2006/07/04 07:36:01 andrew Exp $ */
+/* $Id: status.c,v 1.8 2006/08/14 09:00:57 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -205,7 +205,7 @@
        data_set->now = NULL;
        data_set->graph = NULL;
        
-       data_set->transition_idle_timeout = crm_strdup("60s");
+       data_set->transition_idle_timeout = NULL;
        data_set->dc_uuid            = NULL;
        data_set->dc_node            = NULL;
        data_set->have_quorum        = FALSE;
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/pengine/unpack.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- unpack.c    14 Aug 2006 08:51:23 -0000      1.14
+++ unpack.c    14 Aug 2006 09:00:57 -0000      1.15
@@ -1,4 +1,4 @@
-/* $Id: unpack.c,v 1.14 2006/08/14 08:51:23 andrew Exp $ */
+/* $Id: unpack.c,v 1.15 2006/08/14 09:00:57 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -82,21 +82,8 @@
                );
 #endif
        
-       get_cluster_pref("default_action_timeout");
-       if(value == NULL) {
-               get_cluster_pref("transition_idle_timeout");
-       }
-       if(value != NULL) {
-               long tmp = crm_get_msec(value);
-               if(tmp > 0) {
-                       crm_free(data_set->transition_idle_timeout);
-                       data_set->transition_idle_timeout = crm_strdup(value);
-               } else {
-                       crm_err("Invalid value for default_action_timeout: %s",
-                               value);
-               }
-       }
-       
+       data_set->transition_idle_timeout = crm_strdup(
+               default_action_timeout(data_set->config_hash));
        crm_debug("default_action_timeout set to: %s", 
data_set->transition_idle_timeout);
 
        get_cluster_pref("default_"XML_RSC_ATTR_STICKINESS);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/pengine/utils.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- utils.c     22 Jun 2006 16:21:51 -0000      1.8
+++ utils.c     14 Aug 2006 09:00:57 -0000      1.9
@@ -1,4 +1,4 @@
-/* $Id: utils.c,v 1.8 2006/06/22 16:21:51 andrew Exp $ */
+/* $Id: utils.c,v 1.9 2006/08/14 09:00:57 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -704,8 +704,9 @@
        }
        
        if(g_hash_table_lookup(action->meta, "timeout") == NULL) {
-               g_hash_table_insert(action->meta, crm_strdup("timeout"),
-                                   
crm_strdup(data_set->transition_idle_timeout));
+               g_hash_table_insert(
+                      action->meta, crm_strdup("timeout"),
+                      
crm_strdup(default_action_timeout(data_set->config_hash)));
        }
        
        for(;lpc < DIMOF(fields); lpc++) {




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

Message: 3
Date: Mon, 14 Aug 2006 03:00:58 -0600 (MDT)
From: linux-ha-cvs@lists.linux-ha.org
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/pengine


Modified Files:
        common.h 


Log Message:
Separate action timeouts from network delays by introducing the network-delay 
option 
Add the beginnings of a better option processing infrastructure

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/pengine/common.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- common.h    8 Jun 2006 14:08:09 -0000       1.2
+++ common.h    14 Aug 2006 09:00:57 -0000      1.3
@@ -1,4 +1,4 @@
-/* $Id: common.h,v 1.2 2006/06/08 14:08:09 andrew Exp $ */
+/* $Id: common.h,v 1.3 2006/08/14 09:00:57 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -141,6 +141,10 @@
 extern char *score2char(int score);
 
 extern void add_hash_param(GHashTable *hash, const char *name, const char 
*value);
+extern const char *default_action_timeout(GHashTable* options);
+extern const char *cluster_option(
+       GHashTable* options, gboolean(*validate)(const char*),
+       const char *name, const char *old_name, const char *def_value);
 
 
 /* Helper macros to avoid NULL pointers */




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

_______________________________________________
Linux-ha-cvs mailing list
Linux-ha-cvs@lists.linux-ha.org
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 33, Issue 16
********************************************

Reply via email to