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])
4. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Thu, 6 Apr 2006 04:48:18 -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
Modified Files:
crm-1.0.dtd
Log Message:
Require instance_attributes and cluster_property_set to have an ID and
optionally a score attribute which we use to determin the order in
which they are applied.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crm-1.0.dtd,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -3 -r1.53 -r1.54
--- crm-1.0.dtd 4 Apr 2006 13:21:53 -0000 1.53
+++ crm-1.0.dtd 6 Apr 2006 10:48:18 -0000 1.54
@@ -40,7 +40,8 @@
<!ELEMENT crm_config (cluster_property_set|nvpair)*>
<!ELEMENT cluster_property_set (rule*, attributes)>
<!ATTLIST cluster_property_set
- id CDATA #IMPLIED>
+ id CDATA #REQUIRED
+ score CDATA #IMPLIED>
<!ELEMENT nodes (node*)>
<!-- Annotated version -->
@@ -134,7 +135,10 @@
<!-- Annotated version -->
<!ELEMENT instance_attributes (rule*, attributes)>
-<!ATTLIST instance_attributes id CDATA #IMPLIED>
+<!ATTLIST instance_attributes
+ id CDATA #REQUIRED
+ score CDATA #IMPLIED>
+
<!-- Annotated version -->
<!ELEMENT constraints (rsc_order*, rsc_colocation*, rsc_location*)>
------------------------------
Message: 2
Date: Thu, 6 Apr 2006 04:51:07 -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
Modified Files:
cib.h
Log Message:
Update the CIB version number
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/cib.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- cib.h 4 Apr 2006 13:07:36 -0000 1.39
+++ cib.h 6 Apr 2006 10:51:06 -0000 1.40
@@ -1,4 +1,4 @@
-/* $Id: cib.h,v 1.39 2006/04/04 13:07:36 andrew Exp $ */
+/* $Id: cib.h,v 1.40 2006/04/06 10:51:06 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -26,8 +26,10 @@
#include <crm/common/xml.h>
#include <ha_msg.h>
-#define CIB_FEATURE_SET "1.2"
+#define CIB_FEATURE_SET "1.3"
#define USE_PESKY_FRAGMENTS 1
+
+#define CIB_OPTIONS_FIRST "cib-bootstrap-options"
/* use compare_version() for doing comparisons */
enum cib_variant {
------------------------------
Message: 3
Date: Thu, 6 Apr 2006 05:00:39 -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
Log Message:
Consistently apply sets of attributes.
Sort attribute sets based on an admin defined score.
Look for a specially named set:
#define CIB_OPTIONS_FIRST "cib-bootstrap-options"
which is *always* applied first. This allows admin tools (CLIs and GUIs)
to reliably set options using update_attr() and have them take effect.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/complex.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- complex.c 3 Apr 2006 10:10:46 -0000 1.77
+++ complex.c 6 Apr 2006 11:00:39 -0000 1.78
@@ -1,4 +1,4 @@
-/* $Id: complex.c,v 1.77 2006/04/03 10:10:46 andrew Exp $ */
+/* $Id: complex.c,v 1.78 2006/04/06 11:00:39 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -434,13 +434,81 @@
crm_debug_5("Resource freed");
}
+typedef struct sorted_set_s
+{
+ const char *name;
+ int score;
+ crm_data_t *attr_set;
+ node_t *node;
+ GHashTable *hash;
+ pe_working_set_t *data_set;
+ int attrs_length;
+ const char **attrs;
+} sorted_set_t;
+
+static gint
+sort_pairs(gconstpointer a, gconstpointer b)
+{
+ const sorted_set_t *pair_a = a;
+ const sorted_set_t *pair_b = b;
+
+ if(a == NULL && b == NULL) {
+ return 0;
+ } else if(a == NULL) {
+ return 1;
+ } else if(b == NULL) {
+ return -1;
+ }
+
+ if(safe_str_eq(pair_a->name, CIB_OPTIONS_FIRST)) {
+ return -1;
+
+ } else if(safe_str_eq(pair_b->name, CIB_OPTIONS_FIRST)) {
+ return 1;
+ }
+
+ if(pair_a->score < pair_b->score) {
+ return 1;
+ } else if(pair_a->score > pair_b->score) {
+ return -1;
+ }
+ return 0;
+}
+
+static void
+unpack_attr_set(gpointer data, gpointer user_data)
+{
+ sorted_set_t *pair = data;
+ sorted_set_t *unpack_data = user_data;
+ crm_data_t *attributes = NULL;
+
+ if(test_ruleset(pair->attr_set,
+ unpack_data->node, unpack_data->data_set) == FALSE) {
+ return;
+ }
+
+ crm_debug_2("Adding attributes from %s", pair->name);
+ attributes = cl_get_struct(pair->attr_set, XML_TAG_ATTRS);
+ populate_hash(attributes, unpack_data->hash,
+ unpack_data->attrs, unpack_data->attrs_length);
+}
+
+static void
+free_pair(gpointer data, gpointer user_data)
+{
+ sorted_set_t *pair = data;
+ crm_free(pair);
+}
+
void
unpack_instance_attributes(
crm_data_t *xml_obj, const char *set_name, node_t *node,
GHashTable *hash, const char **attrs, int attrs_length,
pe_working_set_t *data_set)
{
- crm_data_t *attributes = NULL;
+ GListPtr sorted = NULL;
+ const char *score = NULL;
+ sorted_set_t *pair = NULL;
if(xml_obj == NULL) {
crm_debug_4("No instance attributes");
@@ -452,25 +520,35 @@
crm_debug_2("No instance attributes allowed");
return;
}
-
+
crm_debug_2("Checking for attributes");
xml_child_iter_filter(
xml_obj, attr_set, set_name,
- /* check any rules */
- if(test_ruleset(attr_set, node, data_set) == FALSE) {
- continue;
- }
-
- crm_debug_2("Adding attributes");
- attributes = cl_get_struct(attr_set, XML_TAG_ATTRS);
- if(attributes == NULL) {
- pe_err("%s with no %s child", set_name, XML_TAG_ATTRS);
- } else {
- populate_hash(attributes, hash, attrs, attrs_length);
- }
+ pair = NULL;
+ crm_malloc0(pair, sizeof(sorted_set_t));
+ pair->name = ID(attr_set);
+ pair->attr_set = attr_set;
+ score = crm_element_value(attr_set, XML_RULE_ATTR_SCORE);
+ pair->score = char2score(score);
+
+ sorted = g_list_prepend(sorted, pair);
+
);
+
+ if(pair != NULL) {
+ pair->hash = hash;
+ pair->node = node;
+ pair->attrs = attrs;
+ pair->data_set = data_set;
+ pair->attrs_length = attrs_length;
+ }
+
+ sorted = g_list_sort(sorted, sort_pairs);
+ g_list_foreach(sorted, unpack_attr_set, pair);
+ g_list_foreach(sorted, free_pair, NULL);
+ g_list_free(sorted);
}
void
------------------------------
Message: 4
Date: Thu, 6 Apr 2006 05:05:53 -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:
ccm.c
Log Message:
If this is really important the CCM can check for it
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/ccm.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -3 -r1.101 -r1.102
--- ccm.c 19 Feb 2006 09:03:16 -0000 1.101
+++ ccm.c 6 Apr 2006 11:05:53 -0000 1.102
@@ -1,4 +1,4 @@
-/* $Id: ccm.c,v 1.101 2006/02/19 09:03:16 andrew Exp $ */
+/* $Id: ccm.c,v 1.102 2006/04/06 11:05:53 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -186,8 +186,6 @@
return I_NULL;
}
- CRM_DEV_ASSERT(oc->m_n_in != 0 || oc->m_n_out != 0);
-
if(AM_I_DC == FALSE && oc->m_n_out != 0) {
/* Possibly move this logic to ghash_update_cib_node() */
unsigned lpc = 0;
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 29, Issue 30
********************************************