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: crm by andrew from
([email protected])
4. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Mon, 3 Apr 2006 09:56:09 -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/cib
Modified Files:
io.c
Log Message:
Need to set the error code
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/io.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -3 -r1.56 -r1.57
--- io.c 3 Apr 2006 15:14:56 -0000 1.56
+++ io.c 3 Apr 2006 15:56:09 -0000 1.57
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.56 2006/04/03 15:14:56 andrew Exp $ */
+/* $Id: io.c,v 1.57 2006/04/03 15:56:09 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -487,6 +487,7 @@
}
if (initializeCib(new_cib) == FALSE) {
+ error_code = cib_ACTIVATION;
crm_err("Ignoring invalid or NULL CIB");
if(saved_cib != NULL) {
crm_warn("Reverting to last known CIB");
------------------------------
Message: 2
Date: Mon, 3 Apr 2006 09:58:42 -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/cib
Modified Files:
messages.c
Log Message:
Tweak the erase operation
- remove the version check
- notify anyone thats interested that we replaced the entire CIB
- Increment the epoche and reset the number of updates to ensure
we are the "latest" CIB in existance
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/messages.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- messages.c 3 Apr 2006 15:15:46 -0000 1.72
+++ messages.c 3 Apr 2006 15:58:42 -0000 1.73
@@ -1,4 +1,4 @@
-/* $Id: messages.c,v 1.72 2006/04/03 15:15:46 andrew Exp $ */
+/* $Id: messages.c,v 1.73 2006/04/03 15:58:42 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -230,18 +230,21 @@
const char *op, int options, const char *section, crm_data_t *input,
crm_data_t *existing_cib, crm_data_t **result_cib, crm_data_t **answer)
{
+ crm_data_t *local_diff = NULL;
enum cib_errors result = cib_ok;
crm_debug_2("Processing \"%s\" event", op);
*answer = NULL;
*result_cib = createEmptyCib();
- result = revision_check(existing_cib, *result_cib, options);
copy_in_properties(*result_cib, existing_cib);
- if(result == cib_ok && !(options & cib_inhibit_bcast)) {
- cib_update_counter(*result_cib, XML_ATTR_NUMUPDATES, TRUE);
- }
+ cib_update_counter(*result_cib, XML_ATTR_GENERATION, FALSE);
+ cib_update_counter(*result_cib, XML_ATTR_NUMUPDATES, TRUE);
+
+ local_diff = diff_cib_object(existing_cib, *result_cib, FALSE);
+ cib_replace_notify(*result_cib, result, local_diff);
+ free_xml(local_diff);
return result;
}
------------------------------
Message: 3
Date: Mon, 3 Apr 2006 09:59: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/cib
Modified Files:
callbacks.c
Log Message:
Some really verbose logging in case i ever need it
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/callbacks.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -3 -r1.117 -r1.118
--- callbacks.c 3 Apr 2006 10:01:34 -0000 1.117
+++ callbacks.c 3 Apr 2006 15:59:17 -0000 1.118
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.117 2006/04/03 10:01:34 andrew Exp $ */
+/* $Id: callbacks.c,v 1.118 2006/04/03 15:59:17 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -96,9 +96,15 @@
} else if(safe_str_eq(crm_element_name(root), XML_TAG_FRAGMENT)) {
data = find_xml_node(root, XML_TAG_CIB, TRUE);
+ if(data != NULL) {
+ crm_debug_3("Extracted CIB from "XML_TAG_FRAGMENT);
+ } else {
+ crm_log_xml_debug_4(root, "No CIB");
+ }
} else {
data = root;
+ crm_log_xml_debug_4(root, "cib:input");
}
/* grab the section specified for the command */
@@ -106,7 +112,15 @@
int rc = revision_check(data, the_cib, 0/* call_options */);
if(rc == cib_ok) {
data = get_object_root(section, data);
+ if(data != NULL) {
+ crm_debug_3("Extracted %s from CIB", section);
+ } else {
+ crm_log_xml_debug_4(root, "No Section");
+ }
+ } else {
+ crm_debug_2("Revision check failed");
}
+
}
return data;
------------------------------
Message: 4
Date: Mon, 3 Apr 2006 10:11:00 -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/admin
Modified Files:
cibadmin.c
Log Message:
Remove a bunch of semi-broken crud and make sure the supplied input is passed
to the CIB API. Fixes a number of cases where cibadmin return:
"Call cib_create failed (-25): The update was empty"
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/admin/cibadmin.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- cibadmin.c 26 Jan 2006 10:16:09 -0000 1.48
+++ cibadmin.c 3 Apr 2006 16:10:59 -0000 1.49
@@ -1,4 +1,4 @@
-/* $Id: cibadmin.c,v 1.48 2006/01/26 10:16:09 andrew Exp $ */
+/* $Id: cibadmin.c,v 1.49 2006/04/03 16:10:59 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -63,7 +63,6 @@
int do_work(crm_data_t *input, int command_options, crm_data_t **output);
gboolean admin_msg_callback(IPC_Channel * source_data, void *private_data);
-crm_data_t *handleCibMod(crm_data_t *input);
gboolean admin_message_timeout(gpointer data);
void cib_connection_destroy(gpointer user_data);
void cibadmin_op_callback(const HA_Message *msg, int call_id, int rc,
@@ -374,92 +373,11 @@
return -exit_code;
}
-crm_data_t*
-handleCibMod(crm_data_t *cib_object)
-{
- crm_data_t *fragment = NULL;
-
- CRM_DEV_ASSERT(cib_object != NULL);
- if(cib_object == NULL) {
- return NULL;
- }
-
-
- if(do_id_check(cib_object, NULL)) {
- crm_err("ID Check failed.");
- return NULL;
- }
-
- crm_debug_4("Object creation complete");
-
- /* create the cib request */
- fragment = create_cib_fragment(cib_object, obj_type);
-
- return fragment;
-}
-
-
int
do_work(crm_data_t *input, int call_options, crm_data_t **output)
{
/* construct the request */
- if(strcmp(CIB_OP_QUERY, cib_action) == 0) {
- crm_debug_2("Querying the CIB for section: %s",
- obj_type);
-
- return the_cib->cmds->query_from(
- the_cib, host, obj_type, output, call_options);
-
- } else if (strcmp(CIB_OP_ERASE, cib_action) == 0) {
- crm_debug_4("CIB Erase op in progress");
- return the_cib->cmds->erase(the_cib, output, call_options);
-
- } else if (strcmp(CIB_OP_CREATE, cib_action) == 0) {
- enum cib_errors rc = cib_ok;
- crm_debug_4("Performing %s op...", cib_action);
- input = handleCibMod(input);
- rc = the_cib->cmds->create(
- the_cib, obj_type, input, output, call_options);
- free_xml(input);
- return rc;
-
- } else if (strcmp(CIB_OP_UPDATE, cib_action) == 0) {
- enum cib_errors rc = cib_ok;
- crm_debug_4("Performing %s op...", cib_action);
- input = handleCibMod(input);
- rc = the_cib->cmds->update(
- the_cib, obj_type, input, output, call_options);
- free_xml(input);
- return rc;
-
- } else if (strcmp(CIB_OP_MODIFY, cib_action) == 0) {
- enum cib_errors rc = cib_ok;
- crm_debug_4("Performing %s op...", cib_action);
-
- rc = the_cib->cmds->modify(
- the_cib, obj_type, input, output, call_options);
- free_xml(input);
- return rc;
-
- } else if (strcmp(CIB_OP_DELETE_ALT, cib_action) == 0) {
- enum cib_errors rc = cib_ok;
- crm_debug_4("Performing %s op...", cib_action);
- input = handleCibMod(input);
- rc = the_cib->cmds->delete_absolute(
- the_cib, obj_type, input, output, call_options);
- free_xml(input);
- return rc;
-
- } else if (strcmp(CIB_OP_DELETE, cib_action) == 0) {
- enum cib_errors rc = cib_ok;
- crm_debug_4("Performing %s op...", cib_action);
-
- rc = the_cib->cmds->delete(
- the_cib, obj_type, input, output, call_options);
- free_xml(input);
- return rc;
-
- } else if (strcmp(CIB_OP_SYNC, cib_action) == 0) {
+ if (strcmp(CIB_OP_SYNC, cib_action) == 0) {
crm_debug_4("Performing %s op...", cib_action);
return the_cib->cmds->sync_from(
the_cib, host, obj_type, call_options);
@@ -475,9 +393,14 @@
} else if(cib_action != NULL) {
crm_debug_4("Passing \"%s\" to variant_op...", cib_action);
+ if(input != NULL && do_id_check(input, NULL)) {
+ crm_err("ID Check failed.");
+ return cib_id_check;
+ }
+
return the_cib->cmds->variant_op(
the_cib, cib_action, host, obj_type,
- NULL, output, call_options);
+ input, output, call_options);
} else {
crm_err("You must specify an operation");
------------------------------
_______________________________________________
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 12
********************************************