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


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

Message: 1
Date: Thu, 26 Jan 2006 15:36:01 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by alan from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

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

Dir     : linux-ha/lib/clplumbing


Modified Files:
        cl_log.c 


Log Message:
Got rid of the 'enable using logging daemon' message...

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/clplumbing/cl_log.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- cl_log.c    8 Nov 2005 06:27:38 -0000       1.69
+++ cl_log.c    26 Jan 2006 22:35:59 -0000      1.70
@@ -1,4 +1,4 @@
-/* $Id: cl_log.c,v 1.69 2005/11/08 06:27:38 gshi Exp $ */
+/* $Id: cl_log.c,v 1.70 2006/01/26 22:35:59 alan Exp $ */
 /*
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -149,9 +149,6 @@
                if (sendq_length > 0){
                        cl_set_logging_wqueue_maxlen(sendq_length);
                }
-               cl_log(LOG_INFO, "Enable using logging daemon");
-       }else {
-               cl_log(LOG_INFO, "Disable using logging daemon");
        }
        
        return truefalse;




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

Message: 2
Date: Fri, 27 Jan 2006 04:15:49 -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/pengine


Modified Files:
        complex.c complex.h group.c incarnation.c master.c native.c 
        pengine.h 


Log Message:
Two new API calls for finding the list of children and correctly obtianing
  a resource's value for an option.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/complex.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -3 -r1.71 -r1.72
--- complex.c   19 Dec 2005 16:54:44 -0000      1.71
+++ complex.c   27 Jan 2006 11:15:49 -0000      1.72
@@ -1,4 +1,4 @@
-/* $Id: complex.c,v 1.71 2005/12/19 16:54:44 andrew Exp $ */
+/* $Id: complex.c,v 1.72 2006/01/27 11:15:49 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -55,6 +55,8 @@
                native_rsc_order_rh,
                native_rsc_location,
                native_expand,
+               native_children,
+               native_parameter,
                native_print,
                native_active,
                native_resource_state,
@@ -76,6 +78,8 @@
                group_rsc_order_rh,
                group_rsc_location,
                group_expand,
+               group_children,
+               native_parameter,
                group_print,
                group_active,
                group_resource_state,
@@ -97,6 +101,8 @@
                clone_rsc_order_rh,
                clone_rsc_location,
                clone_expand,
+               clone_children,
+               native_parameter,
                clone_print,
                clone_active,
                clone_resource_state,
@@ -118,6 +124,8 @@
                clone_rsc_order_rh,
                clone_rsc_location,
                clone_expand,
+               clone_children,
+               native_parameter,
                clone_print,
                clone_active,
                clone_resource_state,
@@ -126,9 +134,6 @@
        }
 };
 
-/* resource_object_functions_t resource_variants[] = resource_class_functions; 
*/
-
-
 int get_resource_type(const char *name)
 {
        if(safe_str_eq(name, XML_CIB_TAG_RESOURCE)) {
@@ -506,14 +511,4 @@
                g_hash_table_insert(hash, crm_strdup(name), crm_strdup(value));
        }
 }
-       
-const char *
-get_rsc_param(resource_t *rsc, const char *name)
-{
-       CRM_DEV_ASSERT(rsc != NULL);
-       if(crm_assert_failed) {
-               return NULL;
-       }
-       return g_hash_table_lookup(rsc->parameters, name);
-}
 
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/complex.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- complex.h   30 Sep 2005 13:01:15 -0000      1.29
+++ complex.h   27 Jan 2006 11:15:49 -0000      1.30
@@ -1,4 +1,4 @@
-/* $Id: complex.h,v 1.29 2005/09/30 13:01:15 andrew Exp $ */
+/* $Id: complex.h,v 1.30 2006/01/27 11:15:49 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -85,6 +85,13 @@
                void (*rsc_location)(resource_t *, rsc_to_node_t *);
 
                void (*expand)(resource_t *, pe_working_set_t *);
+               GListPtr (*children)(resource_t *);
+
+               /* parameter result must be free'd */
+               char *(*parameter)(
+                       resource_t *, node_t *, gboolean, const char *,
+                       pe_working_set_t *);
+
                void (*print)(resource_t *, const char *, long, void *);
                gboolean (*active)(resource_t *,gboolean);
                enum rsc_role_e (*state)(resource_t *);
@@ -94,7 +101,11 @@
                
 } resource_object_functions_t;
 
+extern char *native_parameter(
+       resource_t *rsc, node_t *node, gboolean create, const char *name,
+       pe_working_set_t *data_set);
 extern void native_unpack(resource_t *rsc, pe_working_set_t *data_set);
+extern GListPtr native_children(resource_t *rsc);
 extern resource_t *native_find_child(resource_t *rsc, const char *id);
 extern int  native_num_allowed_nodes(resource_t *rsc);
 extern color_t * native_color(resource_t *rsc, pe_working_set_t *data_set);
@@ -129,6 +140,7 @@
        pe_working_set_t *data_set);
 
 extern void group_unpack(resource_t *rsc, pe_working_set_t *data_set);
+extern GListPtr group_children(resource_t *rsc);
 extern resource_t *group_find_child(resource_t *rsc, const char *id);
 extern int  group_num_allowed_nodes(resource_t *rsc);
 extern color_t *group_color(resource_t *rsc, pe_working_set_t *data_set);
@@ -158,6 +170,7 @@
        pe_working_set_t *data_set);
 
 extern void clone_unpack(resource_t *rsc, pe_working_set_t *data_set);
+extern GListPtr clone_children(resource_t *rsc);
 extern resource_t *clone_find_child(resource_t *rsc, const char *id);
 extern int  clone_num_allowed_nodes(resource_t *rsc);
 extern color_t *clone_color(resource_t *rsc, pe_working_set_t *data_set);
@@ -212,7 +225,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 const char *get_rsc_param(resource_t *rsc, const char *prop);
 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);
 
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/group.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- group.c     7 Jan 2006 21:00:24 -0000       1.50
+++ group.c     27 Jan 2006 11:15:49 -0000      1.51
@@ -1,4 +1,4 @@
-/* $Id: group.c,v 1.50 2006/01/07 21:00:24 andrew Exp $ */
+/* $Id: group.c,v 1.51 2006/01/27 11:15:49 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -58,8 +58,11 @@
        crm_data_t *xml_obj = rsc->xml;
        crm_data_t *xml_self = copy_xml(rsc->xml);
        group_variant_data_t *group_data = NULL;
-       const char *group_ordered = get_rsc_param(rsc, "ordered");
-       const char *group_colocated = get_rsc_param(rsc, "colocated");
+       const char *group_ordered = g_hash_table_lookup(
+               rsc->parameters, "ordered");
+       const char *group_colocated = g_hash_table_lookup(
+               rsc->parameters, "colocated");
+       
 
        crm_debug_3("Processing resource %s...", rsc->id);
 /*     rsc->id = "dummy_group_rsc_id"; */
@@ -140,6 +143,13 @@
        return pe_find_resource(group_data->child_list, id);
 }
 
+GListPtr group_children(resource_t *rsc)
+{
+       group_variant_data_t *group_data = NULL;
+       get_group_variant_data(group_data, rsc);
+       return group_data->child_list;
+}
+
 int group_num_allowed_nodes(resource_t *rsc)
 {
        group_variant_data_t *group_data = NULL;
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/incarnation.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -3 -r1.71 -r1.72
--- incarnation.c       10 Jan 2006 14:13:22 -0000      1.71
+++ incarnation.c       27 Jan 2006 11:15:49 -0000      1.72
@@ -1,4 +1,4 @@
-/* $Id: incarnation.c,v 1.71 2006/01/10 14:13:22 andrew Exp $ */
+/* $Id: incarnation.c,v 1.72 2006/01/27 11:15:49 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -127,10 +127,10 @@
        const char *interleave =
                crm_element_value(xml_obj, XML_RSC_ATTR_INTERLEAVE);
 
-       const char *max_clones =
-               get_rsc_param(rsc, XML_RSC_ATTR_INCARNATION_MAX);
-       const char *max_clones_node =
-               get_rsc_param(rsc, XML_RSC_ATTR_INCARNATION_NODEMAX);
+       const char *max_clones = g_hash_table_lookup(
+               rsc->parameters, XML_RSC_ATTR_INCARNATION_MAX);
+       const char *max_clones_node = g_hash_table_lookup(
+               rsc->parameters, XML_RSC_ATTR_INCARNATION_NODEMAX);
 
        crm_debug_3("Processing resource %s...", rsc->id);
 
@@ -191,9 +191,6 @@
                    clone_data->clone_max, rsc->id);
 }
 
-
-
-
 resource_t *
 clone_find_child(resource_t *rsc, const char *id)
 {
@@ -202,6 +199,13 @@
        return pe_find_resource(clone_data->child_list, id);
 }
 
+GListPtr clone_children(resource_t *rsc)
+{
+       clone_variant_data_t *clone_data = NULL;
+       get_clone_variant_data(clone_data, rsc);
+       return clone_data->child_list;
+}
+
 int clone_num_allowed_nodes(resource_t *rsc)
 {
        int num_nodes = 0;
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/master.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- master.c    25 Oct 2005 14:02:15 -0000      1.7
+++ master.c    27 Jan 2006 11:15:49 -0000      1.8
@@ -1,4 +1,4 @@
-/* $Id: master.c,v 1.7 2005/10/25 14:02:15 andrew Exp $ */
+/* $Id: master.c,v 1.8 2006/01/27 11:15:49 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -231,10 +231,10 @@
        gboolean any_demoting = FALSE;
        resource_t *last_promote_rsc = NULL;
        resource_t *last_demote_rsc = NULL;
-       const char *master_max_s =
-               get_rsc_param(rsc, XML_RSC_ATTR_MASTER_MAX);
-       const char *master_node_max_s =
-               get_rsc_param(rsc, XML_RSC_ATTR_MASTER_NODEMAX);
+       const char *master_max_s = g_hash_table_lookup(
+               rsc->parameters, XML_RSC_ATTR_MASTER_MAX);
+       const char *master_node_max_s = g_hash_table_lookup(
+               rsc->parameters, XML_RSC_ATTR_MASTER_NODEMAX);
 
        int promoted = 0;
        int max_nodes = 0;
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/native.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -3 -r1.107 -r1.108
--- native.c    12 Jan 2006 15:11:08 -0000      1.107
+++ native.c    27 Jan 2006 11:15:49 -0000      1.108
@@ -1,4 +1,4 @@
-/* $Id: native.c,v 1.107 2006/01/12 15:11:08 andrew Exp $ */
+/* $Id: native.c,v 1.108 2006/01/27 11:15:49 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -179,6 +179,71 @@
        return NULL;
 }
 
+GListPtr native_children(resource_t *rsc)
+{
+       return NULL;
+}
+
+static void
+hash_copy_field(gpointer key, gpointer value, gpointer user_data) 
+{
+       const char *name    = key;
+       const char *s_value = value;
+
+       GHashTable *hash_copy = user_data;
+       g_hash_table_insert(hash_copy, crm_strdup(name), crm_strdup(s_value));
+}
+
+char *
+native_parameter(
+       resource_t *rsc, node_t *node, gboolean create, const char *name,
+       pe_working_set_t *data_set)
+{
+       char *value_copy = NULL;
+       const char *value = NULL;
+
+       CRM_DEV_ASSERT(rsc != NULL);
+       if(crm_assert_failed) {
+               return NULL;
+       }
+
+       crm_debug_2("Looking up %s in %s", name, rsc->id);
+       
+       if(create) {
+               GHashTable *local_hash = NULL;
+
+               if(node != NULL) {
+                       crm_debug_2("Creating hash with node %s",
+                                 node->details->uname);
+               } else {
+                       crm_debug_2("Creating default hash");
+               }
+               
+               local_hash = g_hash_table_new_full(
+                       g_str_hash, g_str_equal,
+                       g_hash_destroy_str, g_hash_destroy_str);
+
+               g_hash_table_foreach(
+                       rsc->parameters, hash_copy_field, local_hash);
+               unpack_instance_attributes(
+                       rsc->xml, XML_TAG_ATTR_SETS, node, local_hash,
+                       NULL, 0, data_set);
+
+               value = g_hash_table_lookup(local_hash, name);
+               if(value != NULL) {
+                       value_copy = crm_strdup(value);
+               }
+               g_hash_table_destroy(local_hash);
+
+       } else {
+               value = g_hash_table_lookup(rsc->parameters, name);
+               if(value != NULL) {
+                       value_copy = crm_strdup(value);
+               }
+       }
+       return value_copy;
+}
+
 int native_num_allowed_nodes(resource_t *rsc)
 {
        int num_nodes = 0;
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/pengine.h,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -3 -r1.104 -r1.105
--- pengine.h   16 Jan 2006 09:16:32 -0000      1.104
+++ pengine.h   27 Jan 2006 11:15:49 -0000      1.105
@@ -1,4 +1,4 @@
-/* $Id: pengine.h,v 1.104 2006/01/16 09:16:32 andrew Exp $ */
+/* $Id: pengine.h,v 1.105 2006/01/27 11:15:49 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -315,7 +315,7 @@
                enum rsc_role_e role;
                enum rsc_role_e next_role;
 
-               GHashTable *parameters;
+               GHashTable *parameters;    
 };
 
 




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

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


End of Linux-ha-cvs Digest, Vol 26, Issue 62
********************************************

Reply via email to