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: include by andrew from
([email protected])
4. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Fri, 3 Feb 2006 01:29:22 -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/admin
Modified Files:
crm_mon.c crm_resource.c
Log Message:
Wrapping the contents of the CIB into "<cib_fragment>"s makes processing
harder/annoying and is quite wasteful in CPU-terms.
2.0.4 will remove this behaviour USE_PESKY_FRAGMENTS and these changes
will allow 2.0.3 to support both behaviours (and thus allow rolling upgrades)
The server already supports both cases (since 2.0.2), this set of updates
affects clients of the CIB.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/admin/crm_mon.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- crm_mon.c 22 Nov 2005 02:37:08 -0000 1.17
+++ crm_mon.c 3 Feb 2006 08:29:21 -0000 1.18
@@ -1,4 +1,4 @@
-/* $Id: crm_mon.c,v 1.17 2005/11/22 02:37:08 andrew Exp $ */
+/* $Id: crm_mon.c,v 1.18 2006/02/03 08:29:21 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -297,7 +297,16 @@
const char *prefix = NULL;
if(rc == cib_ok) {
crm_data_t *cib = NULL;
- cib = find_xml_node(output,XML_TAG_CIB,TRUE);
+#if CRM_DEPRECATED_SINCE_2_0_4
+ if( safe_str_eq(crm_element_name(output), XML_TAG_CIB) ) {
+ cib = output;
+ } else {
+ cib = find_xml_node(output,XML_TAG_CIB,TRUE);
+ }
+#else
+ cib = output;
+ CRM_DEV_ASSERT(safe_str_eq(crm_element_name(cib), XML_TAG_CIB));
+#endif
if(as_html_file) {
print_html_status(cib, as_html_file);
} else {
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/admin/crm_resource.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- crm_resource.c 26 Jan 2006 11:36:58 -0000 1.11
+++ crm_resource.c 3 Feb 2006 08:29:21 -0000 1.12
@@ -1,4 +1,4 @@
-/* $Id: crm_resource.c,v 1.11 2006/01/26 11:36:58 andrew Exp $ */
+/* $Id: crm_resource.c,v 1.12 2006/02/03 08:29:21 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -324,7 +324,16 @@
crm_data_t *dont_run = NULL;
fragment = create_cib_fragment(NULL, NULL);
- cib = find_xml_node(fragment, XML_TAG_CIB, TRUE);
+#if CRM_DEPRECATED_SINCE_2_0_4
+ if(safe_str_eq(crm_element_name(fragment), XML_TAG_CIB)) {
+ cib = fragment;
+ } else {
+ cib = find_xml_node(fragment, XML_TAG_CIB, TRUE);
+ }
+#else
+ cib = fragment;
+ CRM_DEV_ASSERT(safe_str_eq(crm_element_name(cib), XML_TAG_CIB));
+#endif
constraints = get_object_root(XML_CIB_TAG_CONSTRAINTS, cib);
id = crm_concat("cli-prefer", rsc_id, '-');
------------------------------
Message: 2
Date: Fri, 3 Feb 2006 01:29:22 -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
Log Message:
Wrapping the contents of the CIB into "<cib_fragment>"s makes processing
harder/annoying and is quite wasteful in CPU-terms.
2.0.4 will remove this behaviour USE_PESKY_FRAGMENTS and these changes
will allow 2.0.3 to support both behaviours (and thus allow rolling upgrades)
The server already supports both cases (since 2.0.2), this set of updates
affects clients of the CIB.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/tengine/callbacks.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -3 -r1.59 -r1.60
--- callbacks.c 2 Feb 2006 15:56:44 -0000 1.59
+++ callbacks.c 3 Feb 2006 08:29:22 -0000 1.60
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.59 2006/02/02 15:56:44 andrew Exp $ */
+/* $Id: callbacks.c,v 1.60 2006/02/03 08:29:22 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -315,7 +315,16 @@
#ifdef TESTING
} else if(strcmp(op, CRM_OP_EVENTCC) == 0) {
crm_debug_4("Processing %s...", op);
- xml_obj = find_xml_node(xml_data, XML_TAG_CIB, TRUE);
+#if CRM_DEPRECATED_SINCE_2_0_4
+ if(safe_str_eq(crm_element_name(xml_data), XML_TAG_CIB)) {
+ xml_obj = xml_data;
+ } else {
+ xml_obj = find_xml_node(xml_data, XML_TAG_CIB, TRUE);
+ }
+#else
+ xml_obj = xml_data;
+ CRM_DEV_ASSERT(safe_str_eq(crm_element_name(xml_obj),
XML_TAG_CIB));
+#endif
CRM_DEV_ASSERT(xml_obj != NULL);
if(xml_obj != NULL) {
xml_obj = get_object_root(XML_CIB_TAG_STATUS, xml_obj);
@@ -333,7 +342,16 @@
&& safe_str_eq(sys_from, CRM_SYSTEM_LRMD)
/* && safe_str_eq(type, XML_ATTR_RESPONSE) */
){
- xml_obj = find_xml_node(xml_data, XML_TAG_CIB, TRUE);
+#if CRM_DEPRECATED_SINCE_2_0_4
+ if(safe_str_eq(crm_element_name(xml_data), XML_TAG_CIB)) {
+ xml_obj = xml_data;
+ } else {
+ xml_obj = find_xml_node(xml_data, XML_TAG_CIB, TRUE);
+ }
+#else
+ xml_obj = xml_data;
+ CRM_DEV_ASSERT(safe_str_eq(crm_element_name(xml_obj),
XML_TAG_CIB));
+#endif
CRM_DEV_ASSERT(xml_obj != NULL);
if(xml_obj != NULL) {
xml_obj = get_object_root(XML_CIB_TAG_STATUS, xml_obj);
------------------------------
Message: 3
Date: Fri, 3 Feb 2006 01:29:22 -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
Modified Files:
cib.h
Log Message:
Wrapping the contents of the CIB into "<cib_fragment>"s makes processing
harder/annoying and is quite wasteful in CPU-terms.
2.0.4 will remove this behaviour USE_PESKY_FRAGMENTS and these changes
will allow 2.0.3 to support both behaviours (and thus allow rolling upgrades)
The server already supports both cases (since 2.0.2), this set of updates
affects clients of the CIB.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/cib.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- cib.h 26 Jan 2006 10:24:06 -0000 1.37
+++ cib.h 3 Feb 2006 08:29:22 -0000 1.38
@@ -1,4 +1,4 @@
-/* $Id: cib.h,v 1.37 2006/01/26 10:24:06 andrew Exp $ */
+/* $Id: cib.h,v 1.38 2006/02/03 08:29:22 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -27,6 +27,7 @@
#include <ha_msg.h>
#define CIB_FEATURE_SET "1.2"
+#define USE_PESKY_FRAGMENTS 1
/* use compare_version() for doing comparisons */
enum cib_variant {
------------------------------
Message: 4
Date: Fri, 3 Feb 2006 01:29:23 -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/cib
Modified Files:
messages.c
Log Message:
Wrapping the contents of the CIB into "<cib_fragment>"s makes processing
harder/annoying and is quite wasteful in CPU-terms.
2.0.4 will remove this behaviour USE_PESKY_FRAGMENTS and these changes
will allow 2.0.3 to support both behaviours (and thus allow rolling upgrades)
The server already supports both cases (since 2.0.2), this set of updates
affects clients of the CIB.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/messages.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -3 -r1.63 -r1.64
--- messages.c 26 Jan 2006 11:29:22 -0000 1.63
+++ messages.c 3 Feb 2006 08:29:22 -0000 1.64
@@ -1,4 +1,4 @@
-/* $Id: messages.c,v 1.63 2006/01/26 11:29:22 andrew Exp $ */
+/* $Id: messages.c,v 1.64 2006/02/03 08:29:22 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -58,7 +58,9 @@
crm_data_t *local_cib, crm_data_t *update_command, crm_data_t *failed,
int operation, const char *section);
+#if CRM_DEPRECATED_SINCE_2_0_4
crm_data_t *createCibFragmentAnswer(const char *section, crm_data_t *failed);
+#endif
enum cib_errors replace_section(
const char *section, crm_data_t *tmpCib, crm_data_t *command);
@@ -80,7 +82,7 @@
{
enum cib_errors result = cib_ok;
crm_debug_2("Processing \"%s\" event", op);
- if(answer != NULL) { *answer = NULL; }
+ *answer = NULL;
if(op == NULL) {
result = cib_operation;
@@ -152,9 +154,7 @@
{
enum cib_errors result = cib_ok;
crm_debug_2("Processing \"%s\" event", op);
- if(answer != NULL) {
- *answer = createPingAnswerFragment(CRM_SYSTEM_CIB, "ok");
- }
+ *answer = createPingAnswerFragment(CRM_SYSTEM_CIB, "ok");
return result;
}
@@ -170,23 +170,21 @@
crm_debug_2("Processing \"%s\" event for section=%s",
op, crm_str(section));
- if(answer != NULL) { *answer = NULL; }
- else { return cib_output_ptr; }
+ *answer = NULL;
if (safe_str_eq(XML_CIB_TAG_SECTION_ALL, section)) {
section = NULL;
}
- *answer = create_xml_node(NULL, XML_TAG_FRAGMENT);
-/* crm_xml_add(*answer, XML_ATTR_SECTION, section); */
-
obj_root = get_object_root(section, existing_cib);
if(obj_root == NULL) {
result = cib_NOTEXISTS;
+#if USE_PESKY_FRAGMENTS
} else if(obj_root == existing_cib) {
crm_xml_add(obj_root, "origin", cib_our_uname);
+ *answer = create_xml_node(NULL, XML_TAG_FRAGMENT);
add_node_copy(*answer, obj_root);
} else {
@@ -200,8 +198,13 @@
add_node_copy(query_obj_root, an_obj);
);
+ *answer = create_xml_node(NULL, XML_TAG_FRAGMENT);
add_node_copy(*answer, cib);
free_xml(cib);
+#else
+ } else {
+ *answer = obj_root;
+#endif
}
if(result == cib_ok && *answer == NULL) {
@@ -220,8 +223,7 @@
enum cib_errors result = cib_ok;
crm_debug_2("Processing \"%s\" event", op);
- if(answer != NULL) { *answer = NULL; }
-
+ *answer = NULL;
*result_cib = createEmptyCib();
result = revision_check(existing_cib, *result_cib, options);
@@ -231,10 +233,9 @@
cib_update_counter(*result_cib, XML_ATTR_NUMUPDATES, TRUE);
}
- if(answer != NULL) {
- *answer = createCibFragmentAnswer(NULL, NULL);
- }
-
+#if CRM_DEPRECATED_SINCE_2_0_4
+ *answer = createCibFragmentAnswer(NULL, NULL);
+#endif
return result;
}
@@ -248,17 +249,15 @@
crm_debug_2("Processing \"%s\" event for epoch=%s",
op, crm_str(crm_element_value(the_cib, XML_ATTR_GENERATION)));
- if(answer != NULL) { *answer = NULL; }
-
+ *answer = NULL;
*result_cib = copy_xml(the_cib);
cib_update_counter(*result_cib, XML_ATTR_GENERATION, FALSE);
cib_update_counter(*result_cib, XML_ATTR_NUMUPDATES, FALSE);
- if(answer != NULL) {
- *answer = createCibFragmentAnswer(NULL, NULL);
- }
-
+#if CRM_DEPRECATED_SINCE_2_0_4
+ *answer = createCibFragmentAnswer(NULL, NULL);
+#endif
return result;
}
@@ -481,7 +480,7 @@
enum cib_errors result = cib_ok;
crm_debug_2("Processing \"%s\" event for section=%s", op,
crm_str(section));
- if(answer != NULL) { *answer = NULL; }
+ *answer = NULL;
if (options & cib_verbose) {
verbose = TRUE;
@@ -555,10 +554,11 @@
cib_update_counter(*result_cib, XML_ATTR_NUMUPDATES, FALSE);
}
- if (answer != NULL && (verbose || result != cib_ok)) {
+#if CRM_DEPRECATED_SINCE_2_0_4
+ if (verbose || result != cib_ok) {
*answer = createCibFragmentAnswer(section, NULL);
}
-
+#endif
return result;
}
@@ -705,11 +705,14 @@
crm_log_xml_err(failed, "CIB Update failures");
}
+#if USE_PESKY_FRAGMENTS
if (verbose || xml_has_children(failed) || result != cib_ok) {
*answer = createCibFragmentAnswer(section, failed);
}
-
free_xml(failed);
+#else
+ *answer = failed;
+#endif
return result;
}
@@ -797,6 +800,7 @@
return rc;
}
+#if CRM_DEPRECATED_SINCE_2_0_4
crm_data_t*
createCibFragmentAnswer(const char *section, crm_data_t *failed)
{
@@ -833,6 +837,7 @@
crm_xml_add(fragment, "generated_on", cib_our_uname);
return fragment;
}
+#endif
gboolean
check_generation(crm_data_t *newCib, crm_data_t *oldCib)
@@ -854,9 +859,9 @@
const char *operation_msg = NULL;
crm_data_t *xml_node = NULL;
- operation_msg = cib_op2string(operation);
if (return_code != cib_ok) {
+ operation_msg = cib_op2string(operation);
error_msg = cib_error2string(return_code);
xml_node = create_xml_node(failed, XML_FAIL_TAG_CIB);
@@ -872,9 +877,6 @@
crm_warn("Action %s failed: %s (cde=%d)",
operation_msg, error_msg, return_code);
-
- } else {
- crm_debug_3("CIB %s passed", operation_msg);
}
return was_error;
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 27, Issue 19
********************************************