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])
5. Linux-HA CVS: mgmt by zhenh from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Thu, 16 Mar 2006 17:43:29 -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/crmd
Modified Files:
lrm.c
Log Message:
Make the cancellation code more flexible
- now we can ack any cancelled operation, not just monitors
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/lrm.c,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -3 -r1.171 -r1.172
--- lrm.c 16 Mar 2006 23:45:41 -0000 1.171
+++ lrm.c 17 Mar 2006 00:43:29 -0000 1.172
@@ -823,11 +823,18 @@
if(safe_str_eq(operation, CRMD_ACTION_CANCEL)) {
lrm_op_t* op = NULL;
+ crm_data_t *params = NULL;
const char *op_key = NULL;
+ const char *op_task = NULL;
- op_key = crm_element_value(xml_rsc, "operation_key");
- op = construct_op(
- input->xml, id_from_cib, CRMD_ACTION_STATUS);
+ crm_log_xml_debug(input->xml, "CancelOp");
+
+ op_key = crm_element_value(xml_rsc, "operation_key");
+ params = find_xml_node(input->xml, XML_TAG_ATTRS,TRUE);
+ if(params != NULL) {
+ op_task = crm_element_value(params, "task");
+ }
+ op = construct_op(input->xml, id_from_cib, op_task);
CRM_ASSERT(op != NULL);
if(op_key == NULL) {
------------------------------
Message: 2
Date: Thu, 16 Mar 2006 18:05:58 -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 100% sure that crm_assert_failed is FALSE when we start processing
a command.
Remove an erroneous check for crm_assert_failed
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/callbacks.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -3 -r1.115 -r1.116
--- callbacks.c 23 Feb 2006 17:51:01 -0000 1.115
+++ callbacks.c 17 Mar 2006 01:05:58 -0000 1.116
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.115 2006/02/23 17:51:01 andrew Exp $ */
+/* $Id: callbacks.c,v 1.116 2006/03/17 01:05:58 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -554,7 +554,7 @@
ha_msg_add(op_request, F_CIB_CLIENTID, cib_client->id);
ha_msg_add(op_request, F_CIB_CLIENTNAME, cib_client->name);
- if(rc == cib_ok && crm_assert_failed == FALSE) {
+ if(rc == cib_ok) {
cib_process_request(
op_request, force_synchronous, privileged, FALSE,
cib_client);
@@ -605,6 +605,7 @@
}
lpc++;
+ crm_assert_failed = FALSE;
cib_common_callback_worker(
op_request, cib_client, force_synchronous, privileged);
------------------------------
Message: 3
Date: Thu, 16 Mar 2006 18:07:30 -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/crmd
Modified Files:
callbacks.c
Log Message:
When a node joins, remove the cached value for its UUID
- it *may* have changed. unlikely but possible if for example the machine
was rebuilt inbetween.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/callbacks.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -3 -r1.109 -r1.110
--- callbacks.c 20 Feb 2006 19:11:33 -0000 1.109
+++ callbacks.c 17 Mar 2006 01:07:29 -0000 1.110
@@ -369,6 +369,11 @@
crm_notice("Status update: Client %s/%s now has status [%s]",
node, client, status);
+ if(safe_str_eq(status, ONLINESTATUS)) {
+ /* remove the cached value in case it changed */
+ unget_uuid(node);
+ }
+
if(safe_str_eq(node, fsa_our_dc)
&& safe_str_eq(status, OFFLINESTATUS)) {
/* did our DC leave us */
------------------------------
Message: 4
Date: Thu, 16 Mar 2006 18:09:01 -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:
Likewise for this delete operation, deleteing an object that doesn't
exist is not an error condition.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/messages.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -3 -r1.68 -r1.69
--- messages.c 10 Mar 2006 10:09:07 -0000 1.68
+++ messages.c 17 Mar 2006 01:09:01 -0000 1.69
@@ -1,4 +1,4 @@
-/* $Id: messages.c,v 1.68 2006/03/10 10:09:07 andrew Exp $ */
+/* $Id: messages.c,v 1.69 2006/03/17 01:09:01 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -573,7 +573,7 @@
crm_validate_data(*result_cib);
if(delete_xml_child(NULL, *result_cib, input) == FALSE) {
- return cib_NOTEXISTS;
+ crm_debug_2("No matching object to delete");
}
cib_update_counter(*result_cib, XML_ATTR_NUMUPDATES, FALSE);
------------------------------
Message: 5
Date: Fri, 17 Mar 2006 02:10:22 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: mgmt by zhenh from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : zhenh
Host :
Project : linux-ha
Module : mgmt
Dir : linux-ha/mgmt/daemon
Modified Files:
mgmt_crm.c mgmt_internal.h
Log Message:
using sync call and return fail reason to client
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_crm.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- mgmt_crm.c 7 Feb 2006 09:13:14 -0000 1.13
+++ mgmt_crm.c 17 Mar 2006 09:10:21 -0000 1.14
@@ -84,13 +84,14 @@
static char* on_delete_constraint(char* argv[], int argc);
static resource_t* find_resource(GList* rsc_list, const char* id);
-static int delete_object(const char* type, const char* entry, const char* id);
+static int delete_object(const char* type, const char* entry, const char* id,
crm_data_t** output);
static GList* find_xml_node_list(crm_data_t *root, const char *search_path);
static int refresh_lrm(IPC_Channel *crmd_channel, const char *host_uname);
static int delete_lrm_rsc(IPC_Channel *crmd_channel, const char *host_uname,
const char *rsc_id);
static pe_working_set_t* get_data_set(void);
static void free_data_set(pe_working_set_t* data_set);
-void on_cib_connection_destroy(gpointer user_data);
+static void on_cib_connection_destroy(gpointer user_data);
+static char* failed_msg(crm_data_t* output, int rc);
#define GET_RESOURCE() if (argc != 2) {
\
return cl_strdup(MSG_FAIL);
\
@@ -133,11 +134,10 @@
}
int
-delete_object(const char* type, const char* entry, const char* id)
+delete_object(const char* type, const char* entry, const char* id,
crm_data_t** output)
{
int rc;
crm_data_t* cib_object = NULL;
- crm_data_t* output;
char xml[MAX_STRLEN];
snprintf(xml, MAX_STRLEN, "<%s id=\"%s\">", entry, id);
@@ -150,7 +150,7 @@
mgmt_log(LOG_DEBUG, "(delete)xml:%s",xml);
rc = cib_conn->cmds->delete(
- cib_conn, type, cib_object, &output, 0);
+ cib_conn, type, cib_object, output, cib_sync_call);
if (rc < 0) {
return -1;
@@ -177,6 +177,30 @@
cleanup_calculations(data_set);
cl_free(data_set);
}
+char*
+failed_msg(crm_data_t* output, int rc)
+{
+ const char* reason = NULL;
+ crm_data_t* failed_tag;
+ char* ret = cl_strdup(MSG_FAIL);
+
+ ret = mgmt_msg_append(ret, cib_error2string(rc));
+
+ if (output == NULL) {
+ return ret;
+ }
+
+ failed_tag = cl_get_struct(output, XML_FAIL_TAG_CIB);
+ if (failed_tag != NULL) {
+ reason = ha_msg_value(failed_tag, XML_FAILCIB_ATTR_REASON);
+ if (reason != NULL) {
+ ret = mgmt_msg_append(ret, reason);
+ }
+ }
+ free_xml(output);
+
+ return ret;
+}
/* mgmtd functions */
int
@@ -186,6 +210,7 @@
int i, max_try = 5;
mgmt_log(LOG_INFO,"init_crm");
+ crm_log_level = LOG_ERR;
cib_conn = cib_new();
in_shutdown = FALSE;
@@ -334,10 +359,10 @@
mgmt_log(LOG_DEBUG, "(update)xml:%s",xml);
rc = cib_conn->cmds->update(
- cib_conn, "crm_config", fragment, &output, 0);
+ cib_conn, "crm_config", fragment, &output,
cib_sync_call);
if (rc < 0) {
- return cl_strdup(MSG_FAIL);
+ return failed_msg(output, rc);
}
return cl_strdup(MSG_OK);
@@ -499,10 +524,10 @@
mgmt_log(LOG_DEBUG, "(delete resources)xml:%s",xml);
rc = cib_conn->cmds->delete(
- cib_conn, "resources", cib_object, &output, 0);
+ cib_conn, "resources", cib_object, &output,
cib_sync_call);
if (rc < 0) {
- return cl_strdup(MSG_FAIL);
+ return failed_msg(output, rc);
}
return cl_strdup(MSG_OK);
@@ -599,7 +624,7 @@
int rc, i, in_group;
crm_data_t* fragment = NULL;
crm_data_t* cib_object = NULL;
- crm_data_t* output;
+ crm_data_t* output = NULL;
char xml[MAX_STRLEN];
char buf[MAX_STRLEN];
int clone, master, has_param;
@@ -678,14 +703,15 @@
if (in_group) {
rc = cib_conn->cmds->update(
- cib_conn, "resources", fragment, &output, 0);
+ cib_conn, "resources", fragment, &output,
cib_sync_call);
}
else {
rc = cib_conn->cmds->create(
- cib_conn, "resources", fragment, &output, 0);
+ cib_conn, "resources", fragment, &output,
cib_sync_call);
}
+
if (rc < 0) {
- return cl_strdup(MSG_FAIL);
+ return failed_msg(output, rc);
}
return cl_strdup(MSG_OK);
@@ -707,9 +733,9 @@
}
mgmt_log(LOG_INFO, "xml:%s",xml);
fragment = create_cib_fragment(cib_object, "resources");
- rc = cib_conn->cmds->create(cib_conn, "resources", fragment, &output,
0);
+ rc = cib_conn->cmds->create(cib_conn, "resources", fragment, &output,
cib_sync_call);
if (rc < 0) {
- return cl_strdup(MSG_FAIL);
+ return failed_msg(output, rc);
}
return cl_strdup(MSG_OK);
@@ -942,20 +968,22 @@
fragment = create_cib_fragment(cib_object, "resources");
rc = cib_conn->cmds->update(
- cib_conn, "resources", fragment, &output, 0);
+ cib_conn, "resources", fragment, &output,
cib_sync_call);
if (rc < 0) {
- return cl_strdup(MSG_FAIL);
+ return failed_msg(output, rc);
}
return cl_strdup(MSG_OK);
}
char*
on_delete_rsc_param(char* argv[], int argc)
{
+ crm_data_t * output;
+ int rc;
ARGC_CHECK(2)
- if (delete_object("resources", "nvpair", argv[1]) < 0) {
- return cl_strdup(MSG_FAIL);
+ if ((rc=delete_object("resources", "nvpair", argv[1], &output)) < 0) {
+ return failed_msg(output, rc);
}
return cl_strdup(MSG_OK);
}
@@ -1020,20 +1048,22 @@
fragment = create_cib_fragment(cib_object, "resources");
rc = cib_conn->cmds->update(
- cib_conn, "resources", fragment, &output, 0);
+ cib_conn, "resources", fragment, &output,
cib_sync_call);
if (rc < 0) {
- return cl_strdup(MSG_FAIL);
+ return failed_msg(output, rc);
}
return cl_strdup(MSG_OK);
}
char*
on_delete_rsc_op(char* argv[], int argc)
{
+ int rc;
+ crm_data_t * output;
ARGC_CHECK(2)
- if (delete_object("resources", "op", argv[1]) < 0) {
- return cl_strdup(MSG_FAIL);
+ if ((rc=delete_object("resources", "op", argv[1], &output)) < 0) {
+ return failed_msg(output, rc);
}
return cl_strdup(MSG_OK);
}
@@ -1088,9 +1118,9 @@
}
mgmt_log(LOG_INFO, "xml:%s",xml);
fragment = create_cib_fragment(cib_object, "resources");
- rc = cib_conn->cmds->update(cib_conn, "resources", fragment, &output,
0);
+ rc = cib_conn->cmds->update(cib_conn, "resources", fragment, &output,
cib_sync_call);
if (rc < 0) {
- return cl_strdup(MSG_FAIL);
+ return failed_msg(output, rc);
}
return cl_strdup(MSG_OK);
}
@@ -1157,9 +1187,9 @@
}
mgmt_log(LOG_INFO, "xml:%s",xml);
fragment = create_cib_fragment(cib_object, "resources");
- rc = cib_conn->cmds->update(cib_conn, "resources", fragment, &output,
0);
+ rc = cib_conn->cmds->update(cib_conn, "resources", fragment, &output,
cib_sync_call);
if (rc < 0) {
- return cl_strdup(MSG_FAIL);
+ return failed_msg(output, rc);
}
return cl_strdup(MSG_OK);
@@ -1264,10 +1294,12 @@
char*
on_delete_constraint(char* argv[], int argc)
{
+ int rc;
+ crm_data_t * output;
ARGC_CHECK(3)
- if (delete_object("constraints", argv[1], argv[2]) < 0) {
- return cl_strdup(MSG_FAIL);
+ if ((rc=delete_object("constraints", argv[1], argv[2], &output)) < 0) {
+ return failed_msg(output, rc);
}
return cl_strdup(MSG_OK);
}
@@ -1314,10 +1346,10 @@
fragment = create_cib_fragment(cib_object, "constraints");
rc = cib_conn->cmds->update(
- cib_conn, "constraints", fragment, &output, 0);
+ cib_conn, "constraints", fragment, &output,
cib_sync_call);
if (rc < 0) {
- return cl_strdup(MSG_FAIL);
+ return failed_msg(output, rc);
}
return cl_strdup(MSG_OK);
}
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_internal.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- mgmt_internal.h 8 Dec 2005 08:50:34 -0000 1.3
+++ mgmt_internal.h 17 Mar 2006 09:10:21 -0000 1.4
@@ -40,7 +40,7 @@
#define ARGC_CHECK(n); \
if (argc != (n)) { \
mgmt_log(LOG_DEBUG, "%s msg should have %d params, but %d
given",argv[0],n,argc); \
- return cl_strdup(MSG_FAIL); \
+ return cl_strdup(MSG_FAIL"\nwrong parameter number");
\
}
extern const char* client_name;
extern int debug_level;
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 28, Issue 34
********************************************