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 andrew from
([email protected])
2. Linux-HA CVS: crm by andrew from
([email protected])
3. Linux-HA CVS: lib 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: 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/cib
Modified Files:
cib_attrs.c cib_client.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/lib/crm/cib/cib_attrs.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- cib_attrs.c 20 Jan 2006 15:57:27 -0000 1.12
+++ cib_attrs.c 3 Feb 2006 08:29:22 -0000 1.13
@@ -1,4 +1,4 @@
-/* $Id: cib_attrs.c,v 1.12 2006/01/20 15:57:27 andrew Exp $ */
+/* $Id: cib_attrs.c,v 1.13 2006/02/03 08:29:22 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -159,9 +159,18 @@
cib_error2string(rc));
return rc;
}
-
- a_node = find_xml_node(fragment, XML_TAG_CIB, TRUE);
- xml_obj = get_object_root(section, a_node);
+
+#if CRM_DEPRECATED_SINCE_2_0_4
+ if(safe_str_eq(crm_element_name(fragment), section)) {
+ xml_obj = fragment;
+ } else {
+ a_node = find_xml_node(fragment, XML_TAG_CIB, TRUE);
+ xml_obj = get_object_root(section, a_node);
+ }
+#else
+ xml_obj = fragment;
+ CRM_DEV_ASSERT(safe_str_eq(crm_element_name(xml_obj), XML_TAG_CIB));
+#endif
CRM_ASSERT(xml_obj != NULL);
crm_log_xml_debug_2(xml_obj, "Result section");
@@ -306,8 +315,17 @@
return rc;
}
- xml_obj = find_xml_node(fragment, XML_TAG_CIB, TRUE);
- xml_obj = get_object_root(XML_CIB_TAG_NODES, xml_obj);
+#if CRM_DEPRECATED_SINCE_2_0_4
+ if(safe_str_eq(crm_element_name(fragment), XML_CIB_TAG_NODES)) {
+ xml_obj = fragment;
+ } else {
+ xml_obj = find_xml_node(fragment, XML_TAG_CIB, TRUE);
+ xml_obj = get_object_root(XML_CIB_TAG_NODES, xml_obj);
+ }
+#else
+ xml_obj = fragment;
+ CRM_DEV_ASSERT(safe_str_eq(crm_element_name(xml_obj), XML_TAG_CIB));
+#endif
CRM_ASSERT(xml_obj != NULL);
crm_log_xml_debug(xml_obj, "Result section");
@@ -348,8 +366,17 @@
return rc;
}
- xml_obj = find_xml_node(fragment, XML_TAG_CIB, TRUE);
- xml_obj = get_object_root(XML_CIB_TAG_NODES, xml_obj);
+#if CRM_DEPRECATED_SINCE_2_0_4
+ if(safe_str_eq(crm_element_name(fragment), XML_CIB_TAG_NODES)) {
+ xml_obj = fragment;
+ } else {
+ xml_obj = find_xml_node(fragment, XML_TAG_CIB, TRUE);
+ xml_obj = get_object_root(XML_CIB_TAG_NODES, xml_obj);
+ }
+#else
+ xml_obj = fragment;
+ CRM_DEV_ASSERT(safe_str_eq(crm_element_name(xml_obj), XML_TAG_CIB));
+#endif
CRM_ASSERT(xml_obj != NULL);
crm_log_xml_debug_2(xml_obj, "Result section");
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/cib/cib_client.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- cib_client.c 26 Jan 2006 10:24:06 -0000 1.48
+++ cib_client.c 3 Feb 2006 08:29:22 -0000 1.49
@@ -927,11 +927,19 @@
return NULL;
}
- xml_cib_copy = copy_xml(
- find_xml_node(xml_cib, XML_TAG_CIB, TRUE));
+ if(safe_str_eq(crm_element_name(xml_cib), XML_TAG_CIB)) {
+ return xml_cib;
+
+#if CRM_DEPRECATED_SINCE_2_0_4
+ } else {
+ xml_cib_copy = copy_xml(
+ find_xml_node(xml_cib, XML_TAG_CIB, TRUE));
+ free_xml(xml_cib);
+ return xml_cib_copy;
+#endif
+ }
free_xml(xml_cib);
-
- return xml_cib_copy;
+ return NULL;
}
crm_data_t*
@@ -1193,7 +1201,7 @@
if(object_type == NULL
|| strlen(object_type) == 0
- || safe_str_eq("all", object_type)
+ || safe_str_eq(XML_CIB_TAG_SECTION_ALL, object_type)
|| safe_str_eq(XML_TAG_CIB, object_type)) {
/* get the whole cib */
return the_root;
@@ -1240,10 +1248,11 @@
if(safe_str_eq(value, "")) {
value = NULL;
}
- return value;
+ return value;
}
+#define USE_PESKY_FRAGMENTS 1
crm_data_t*
create_cib_fragment_adv(
@@ -1251,7 +1260,9 @@
{
crm_data_t *cib = NULL;
gboolean whole_cib = FALSE;
+#if USE_PESKY_FRAGMENTS
crm_data_t *fragment = create_xml_node(NULL, XML_TAG_FRAGMENT);
+#endif
crm_data_t *object_root = NULL;
const char *update_name = NULL;
@@ -1260,7 +1271,8 @@
if(update == NULL && update_section == NULL) {
crm_debug_3("Creating a blank fragment");
update = createEmptyCib();
- whole_cib = TRUE;
+ crm_xml_add(cib, "debug_source", source);
+ return update;
} else if(update == NULL) {
crm_err("No update to create a fragment for");
@@ -1274,33 +1286,49 @@
whole_cib = TRUE;
}
+#if USE_PESKY_FRAGMENTS
crm_xml_add(fragment, XML_ATTR_SECTION, update_section);
-
+#endif
+
if(whole_cib == FALSE) {
cib = createEmptyCib();
crm_xml_add(cib, "debug_source", source);
object_root = get_object_root(update_section, cib);
add_node_copy(object_root, update);
+#if USE_PESKY_FRAGMENTS
add_node_copy(fragment, cib);
free_xml(cib);
cib = find_xml_node(fragment, XML_TAG_CIB, TRUE);
-
+#endif
} else {
+#if USE_PESKY_FRAGMENTS
add_node_copy(fragment, update);
cib = find_xml_node(fragment, XML_TAG_CIB, TRUE);
+#else
crm_xml_add(cib, "debug_source", source);
+#endif
}
crm_debug_3("Verifying created fragment");
if(verifyCibXml(cib) == FALSE) {
crm_err("Fragment creation failed");
+#if USE_PESKY_FRAGMENTS
crm_log_xml_err(update, "[src]");
crm_log_xml_err(fragment, "[created]");
free_xml(fragment);
fragment = NULL;
+#else
+ crm_log_xml_err(cib, "[src]");
+ free_xml(cib);
+ cib = NULL;
+#endif
}
+#if USE_PESKY_FRAGMENTS
return fragment;
+#else
+ return cib;
+#endif
}
/*
------------------------------
Message: 2
Date: Fri, 3 Feb 2006 01:33:04 -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:
callbacks.c
Log Message:
Make sure query channels cant modify the CIB
- the value of privileged was being ignored :(
Mark the code that needs to change when we stop doing cib_fragments
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/callbacks.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -3 -r1.103 -r1.104
--- callbacks.c 2 Feb 2006 11:57:57 -0000 1.103
+++ callbacks.c 3 Feb 2006 08:33:04 -0000 1.104
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.103 2006/02/02 11:57:57 andrew Exp $ */
+/* $Id: callbacks.c,v 1.104 2006/02/03 08:33:04 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -145,7 +145,9 @@
cib_cleanup_query(const char *op, HA_Message **data, HA_Message **output)
{
CRM_DEV_ASSERT(*data == NULL);
+#if USE_PESKY_FRAGMENTS
free_xml(*output);
+#endif
return cib_ok;
}
@@ -801,7 +803,9 @@
cl_get_string(request, F_CIB_CLIENTID),
cl_get_string(request, F_CIB_CALLID), update);
- rc = cib_process_command(request, &op_reply, &result_diff,
TRUE);
+ rc = cib_process_command(
+ request, &op_reply, &result_diff, privileged);
+
crm_debug_2("Processing complete");
if(rc == cib_diff_resync || rc == cib_diff_failed
------------------------------
Message: 3
Date: Fri, 3 Feb 2006 01:33:36 -0700 (MST)
From: [email protected]
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/common
Modified Files:
ipc.c
Log Message:
Dont assume its not NULL.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/common/ipc.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- ipc.c 2 Feb 2006 16:04:02 -0000 1.17
+++ ipc.c 3 Feb 2006 08:33:35 -0000 1.18
@@ -1,4 +1,4 @@
-/* $Id: ipc.c,v 1.17 2006/02/02 16:04:02 andrew Exp $ */
+/* $Id: ipc.c,v 1.18 2006/02/03 08:33:35 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -109,7 +109,8 @@
{
gboolean all_is_good = TRUE;
int fail_level = LOG_WARNING;
- if(ipc_client->conntype == IPC_CLIENT) {
+
+ if(ipc_client != NULL && ipc_client->conntype == IPC_CLIENT) {
fail_level = LOG_ERR;
}
------------------------------
_______________________________________________
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 20
********************************************