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 andrew from
([email protected])
2. Linux-HA CVS: mgmt 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: Sun, 26 Mar 2006 22:48:13 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: mgmt by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : mgmt
Dir : linux-ha/mgmt/daemon
Modified Files:
mgmt_crm.c
Log Message:
Use pe_find_resource() provided by the PE library
Remove the hack for removing the group name for resources in a group
(fixed in the PE so there is no need now)
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_crm.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- mgmt_crm.c 18 Mar 2006 17:17:19 -0000 1.15
+++ mgmt_crm.c 27 Mar 2006 05:48:13 -0000 1.16
@@ -34,6 +34,7 @@
#include <crm/cib.h>
#include <crm/msg_xml.h>
#include <crm/pengine/pengine.h>
+#include <crm/pengine/pe_utils.h>
extern resource_t *group_find_child(resource_t *rsc, const char *id);
@@ -83,7 +84,6 @@
static char* on_update_constraint(char* argv[], int argc);
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,
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);
@@ -93,14 +93,14 @@
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);
\
- }
\
- rsc = find_resource(data_set->resources, argv[1]);
\
- if (rsc == NULL) {
\
- return cl_strdup(MSG_FAIL);
\
- }
-
+#define GET_RESOURCE() if (argc != 2) { \
+ return cl_strdup(MSG_FAIL); \
+ } \
+ rsc = pe_find_resource(data_set->resources, argv[1]); \
+ if (rsc == NULL) { \
+ return cl_strdup(MSG_FAIL); \
+ }
+
/* internal functions */
GList* find_xml_node_list(crm_data_t *root, const char *child_name)
{
@@ -114,25 +114,6 @@
return list;
}
-resource_t*
-find_resource(GList* rsc_list, const char* id)
-{
- resource_t* ret;
- GList* cur = rsc_list;
- while (cur != NULL) {
- resource_t* rsc = (resource_t*)cur->data;
- if (strcmp(id, rsc->id) == 0) {
- return rsc;
- }
- ret = rsc->fns->find_child(rsc, id);
- if (ret != NULL) {
- return ret;
- }
- cur = g_list_next(cur);
- }
- return NULL;
-}
-
int
delete_object(const char* type, const char* entry, const char* id,
crm_data_t** output)
{
@@ -474,6 +455,7 @@
free_data_set(data_set);
return cl_strdup(MSG_FAIL);
}
+
/* resource functions */
/* add/delete resource */
char*
@@ -481,7 +463,6 @@
{
int rc;
resource_t* rsc;
- const char* rsc_id;
crm_data_t* cib_object = NULL;
crm_data_t* output;
char xml[MAX_STRLEN];
@@ -492,15 +473,7 @@
switch (rsc->variant) {
case pe_native:
- /* if the resource is in group, remove the prefix */
- rsc_id = strrchr(rsc->id, ':');
- if (rsc_id == NULL) {
- rsc_id = rsc->id;
- }
- else {
- rsc_id ++;
- }
- snprintf(xml, MAX_STRLEN, "<primitive id=\"%s\"/>",
rsc_id);
+ snprintf(xml, MAX_STRLEN, "<primitive id=\"%s\"/>",
rsc->id);
break;
case pe_group:
snprintf(xml, MAX_STRLEN, "<group id=\"%s\"/>",
rsc->id);
------------------------------
Message: 2
Date: Sun, 26 Mar 2006 23:54:49 -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_hb.c
Log Message:
mgmtd use -1 as failure
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_hb.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- mgmt_hb.c 25 Jan 2006 02:30:25 -0000 1.4
+++ mgmt_hb.c 27 Mar 2006 06:54:48 -0000 1.5
@@ -117,7 +117,7 @@
mgmt_log(LOG_ERR, "REASON: %s", hb->llc_ops->errmsg(hb));
hb->llc_ops->delete(hb);
hb = NULL;
- return HA_FAIL;
+ return -1;
}
G_main_add_IPC_Channel(G_PRIORITY_LOW, hb->llc_ops->ipcchan(hb),
FALSE, on_hb_input, NULL, on_hb_quit);
------------------------------
Message: 3
Date: Sun, 26 Mar 2006 23:57:29 -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_lib.c
Log Message:
check the return value of init funcs
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_lib.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- mgmt_lib.c 27 Mar 2006 05:42:32 -0000 1.5
+++ mgmt_lib.c 27 Mar 2006 06:57:28 -0000 1.6
@@ -77,13 +77,19 @@
/* init modules */
if (components & ENABLE_HB) {
- init_heartbeat();
+ if (init_heartbeat() != 0) {
+ return -1;
+ }
}
if (components & ENABLE_LRM) {
- init_lrm();
+ if (init_lrm() != 0) {
+ return -1;
+ }
}
if (components & ENABLE_CRM) {
- init_crm();
+ if (init_crm() != 0 ) {
+ return -1;
+ }
}
return 0;
}
------------------------------
Message: 4
Date: Mon, 27 Mar 2006 00:00:24 -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:
mgmtd.c
Log Message:
we can't continue if we can't initialize the library
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmtd.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- mgmtd.c 27 Mar 2006 05:42:32 -0000 1.16
+++ mgmtd.c 27 Mar 2006 07:00:23 -0000 1.17
@@ -310,6 +310,7 @@
int ssock;
struct sockaddr_in saddr;
GIOChannel* sch;
+ int ret;
/* register pid */
if (cl_lock_pidfile(PID_FILE) < 0) {
mgmt_log(LOG_ERR, "already running: [pid %d]."
@@ -340,7 +341,11 @@
mainloop = g_main_new(FALSE);
/* init library */
- init_mgmt_lib(mgmtd_name, ENABLE_HB|ENABLE_LRM|ENABLE_CRM);
+ if ((ret = init_mgmt_lib(mgmtd_name, ENABLE_HB|ENABLE_LRM|ENABLE_CRM))
!= 0) {
+ mgmt_log(LOG_ERR, "Can't initialize management library."
+ "Shutting down.(%d)",ret);
+ exit(1);
+ }
/* init ham & gnutls lib */
tls_init_server();
------------------------------
_______________________________________________
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 66
********************************************