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: mgmt by zhenh from
([email protected])
2. Linux-HA CVS: include by zhenh from
([email protected])
3. Linux-HA CVS: mgmt by zhenh from
([email protected])
4. Linux-HA CVS: mgmt by zhenh from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Tue, 4 Apr 2006 00:09:47 -0600 (MDT)
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/client
Modified Files:
haclient.py.in
Log Message:
fix a bug. remove the out-of-date cache code
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/client/haclient.py.in,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- haclient.py.in 3 Apr 2006 09:54:55 -0000 1.18
+++ haclient.py.in 4 Apr 2006 06:09:46 -0000 1.19
@@ -1786,7 +1786,6 @@
if attrs == None :
return None
order = dict(zip(order_attr_names,attrs))
- self.cache_update(order,"constraint_"+type, id)
return order
elif type == "rsc_colocation" :
colocation_attr_names = ["id","from","to","score"]
------------------------------
Message: 2
Date: Tue, 4 Apr 2006 00:12:07 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: include by zhenh from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : zhenh
Host :
Project : linux-ha
Module : include
Dir : linux-ha/include/mgmt
Modified Files:
mgmt_common.h
Log Message:
return the version of cib, asked by cim provider to implement it's own cache
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/mgmt/mgmt_common.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- mgmt_common.h 3 Apr 2006 08:27:02 -0000 1.4
+++ mgmt_common.h 4 Apr 2006 06:12:06 -0000 1.5
@@ -83,6 +83,18 @@
/*
description:
+ return CIB version
+format:
+ MSG_CIB_VERSION
+return:
+ MSG_OK version
+or
+ MSG_FAIL
+*/
+#define MSG_CIB_VERSION "cib_version"
+
+/*
+description:
return CRM configuration
format:
MSG_CRM_CONFIG
------------------------------
Message: 3
Date: Tue, 4 Apr 2006 00:15:19 -0600 (MDT)
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
Log Message:
return the version of cib, asked by cim provider to implement it's own cache
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_crm.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- mgmt_crm.c 3 Apr 2006 08:27:51 -0000 1.20
+++ mgmt_crm.c 4 Apr 2006 06:15:18 -0000 1.21
@@ -45,6 +45,8 @@
static void on_cib_diff(const char *event, HA_Message *msg);
+static char* on_get_cib_version(char* argv[], int argc);
+
static char* on_get_crm_config(char* argv[], int argc);
static char* on_update_crm_config(char* argv[], int argc);
static char* on_get_activenodes(char* argv[], int argc);
@@ -258,6 +260,7 @@
ret = cib_conn->cmds->set_connection_dnotify(cib_conn
, on_cib_connection_destroy);
+ reg_msg(MSG_CIB_VERSION, on_get_cib_version);
reg_msg(MSG_CRM_CONFIG, on_get_crm_config);
reg_msg(MSG_UP_CRM_CONFIG, on_update_crm_config);
@@ -342,6 +345,25 @@
/* cluster functions */
char*
+on_get_cib_version(char* argv[], int argc)
+{
+ const char* version = NULL;
+ pe_working_set_t* data_set;
+ char* ret;
+
+ data_set = get_data_set();
+ version = ha_msg_value(data_set->input, "num_updates");
+ if (version != NULL) {
+ ret = cl_strdup(MSG_OK);
+ ret = mgmt_msg_append(ret, version);
+ }
+ else {
+ ret = cl_strdup(MSG_FAIL);
+ }
+ free_data_set(data_set);
+ return ret;
+}
+char*
on_get_crm_config(char* argv[], int argc)
{
char buf [255];
------------------------------
Message: 4
Date: Tue, 4 Apr 2006 00:56:34 -0600 (MDT)
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
Log Message:
fix memory leak of mgmtd
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_crm.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- mgmt_crm.c 4 Apr 2006 06:15:18 -0000 1.21
+++ mgmt_crm.c 4 Apr 2006 06:56:33 -0000 1.22
@@ -102,11 +102,11 @@
int cib_cache_enable = FALSE;
#define GET_RESOURCE() if (argc != 2) { \
- return cl_strdup(MSG_FAIL); \
+ return cl_strdup(MSG_FAIL"\nwrong parameter number"); \
} \
rsc = pe_find_resource(data_set->resources, argv[1]); \
if (rsc == NULL) { \
- return cl_strdup(MSG_FAIL); \
+ return cl_strdup(MSG_FAIL"\nno such resource"); \
}
/* internal functions */
@@ -143,7 +143,7 @@
rc = cib_conn->cmds->delete(
cib_conn, type, cib_object, output, cib_sync_call);
-
+ free_xml(cib_object);
if (rc < 0) {
return -1;
}
@@ -398,7 +398,7 @@
int rc;
crm_data_t* fragment = NULL;
crm_data_t* cib_object = NULL;
- crm_data_t* output;
+ crm_data_t* output = NULL;
char xml[MAX_STRLEN];
ARGC_CHECK(3);
@@ -415,11 +415,12 @@
rc = cib_conn->cmds->update(
cib_conn, "crm_config", fragment, &output,
cib_sync_call);
-
+ free_xml(fragment);
+ free_xml(cib_object);
if (rc < 0) {
return failed_msg(output, rc);
}
-
+ free_xml(output);
return cl_strdup(MSG_OK);
}
@@ -563,10 +564,12 @@
rc = cib_conn->cmds->update(
cib_conn, "nodes", fragment, &output, cib_sync_call);
+ free_xml(fragment);
+ free_xml(cib_object);
if (rc < 0) {
return failed_msg(output, rc);
}
-
+ free_xml(output);
return cl_strdup(MSG_OK);
}
@@ -612,11 +615,12 @@
mgmt_log(LOG_DEBUG, "(delete resources)xml:%s",xml);
rc = cib_conn->cmds->delete(
cib_conn, "resources", cib_object, &output,
cib_sync_call);
-
+
+ free_xml(cib_object);
if (rc < 0) {
return failed_msg(output, rc);
}
-
+ free_xml(output);
return cl_strdup(MSG_OK);
}
static int
@@ -646,8 +650,10 @@
crm_free(key);
if(send_ipc_message(crmd_channel, cmd)) {
+ free_xml(cmd);
return 0;
}
+ free_xml(cmd);
return -1;
}
@@ -664,8 +670,10 @@
CRM_SYSTEM_CRMD, client_name, our_pid);
if(send_ipc_message(crmd_channel, cmd)) {
+ free_xml(cmd);
return 0;
}
+ free_xml(cmd);
return -1;
}
@@ -797,9 +805,12 @@
cib_conn, "resources", fragment, &output,
cib_sync_call);
}
+ free_xml(fragment);
+ free_xml(cib_object);
if (rc < 0) {
return failed_msg(output, rc);
}
+ free_xml(output);
return cl_strdup(MSG_OK);
}
@@ -821,11 +832,14 @@
mgmt_log(LOG_INFO, "xml:%s",xml);
fragment = create_cib_fragment(cib_object, "resources");
rc = cib_conn->cmds->create(cib_conn, "resources", fragment, &output,
cib_sync_call);
+
+ free_xml(fragment);
+ free_xml(cib_object);
if (rc < 0) {
return failed_msg(output, rc);
}
+ free_xml(output);
return cl_strdup(MSG_OK);
-
}
/* get all resources*/
char*
@@ -1062,9 +1076,12 @@
rc = cib_conn->cmds->update(
cib_conn, "resources", fragment, &output,
cib_sync_call);
+ free_xml(fragment);
+ free_xml(cib_object);
if (rc < 0) {
return failed_msg(output, rc);
}
+ free_xml(output);
return cl_strdup(MSG_OK);
}
char*
@@ -1142,9 +1159,12 @@
rc = cib_conn->cmds->update(
cib_conn, "resources", fragment, &output,
cib_sync_call);
+ free_xml(fragment);
+ free_xml(cib_object);
if (rc < 0) {
return failed_msg(output, rc);
}
+ free_xml(output);
return cl_strdup(MSG_OK);
}
char*
@@ -1211,9 +1231,12 @@
mgmt_log(LOG_INFO, "xml:%s",xml);
fragment = create_cib_fragment(cib_object, "resources");
rc = cib_conn->cmds->update(cib_conn, "resources", fragment, &output,
cib_sync_call);
+ free_xml(fragment);
+ free_xml(cib_object);
if (rc < 0) {
return failed_msg(output, rc);
}
+ free_xml(output);
return cl_strdup(MSG_OK);
}
/* master functions */
@@ -1280,9 +1303,12 @@
mgmt_log(LOG_INFO, "xml:%s",xml);
fragment = create_cib_fragment(cib_object, "resources");
rc = cib_conn->cmds->update(cib_conn, "resources", fragment, &output,
cib_sync_call);
+ free_xml(fragment);
+ free_xml(cib_object);
if (rc < 0) {
return failed_msg(output, rc);
}
+ free_xml(output);
return cl_strdup(MSG_OK);
}
@@ -1440,9 +1466,12 @@
rc = cib_conn->cmds->update(
cib_conn, "constraints", fragment, &output,
cib_sync_call);
+ free_xml(fragment);
+ free_xml(cib_object);
if (rc < 0) {
return failed_msg(output, rc);
}
+ free_xml(output);
return cl_strdup(MSG_OK);
}
------------------------------
_______________________________________________
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 14
********************************************