[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/cman cman_tool/main.c daemon/cnxman-so ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield sourceware org	2008-02-08 14:09:28

Modified files:
	cman/cman_tool : main.c 
	cman/daemon    : cnxman-socket.h commands.c 
	cman/lib       : libcman.c libcman.h 

Log message:
	Implement a nicer way of getting the quorum disk information.
	The libcman API remains the same but the connection to cman itself
	works using the normal GETNODE call.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/main.c.diff?cvsroot=cluster&r1=1.61&r2=1.62
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cnxman-socket.h.diff?cvsroot=cluster&r1=1.21&r2=1.22
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.83&r2=1.84
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/lib/libcman.c.diff?cvsroot=cluster&r1=1.41&r2=1.42
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/lib/libcman.h.diff?cvsroot=cluster&r1=1.39&r2=1.40

--- cluster/cman/cman_tool/main.c	2007/12/05 14:28:58	1.61
+++ cluster/cman/cman_tool/main.c	2008/02/08 14:09:27	1.62
@@ -201,7 +201,7 @@
 	char info_buf[PIPE_BUF];
 	char tmpbuf[1024];
 	cman_extra_info_t *einfo = (cman_extra_info_t *)info_buf;
-	cman_qdev_info qinfo;
+	cman_qdev_info_t qinfo;
 	int quorate;
 	int i;
 	int j;
@@ -229,7 +229,7 @@
 							  einfo->ei_node_state));
 	printf("Nodes: %d\n", einfo->ei_members);
 	printf("Expected votes: %d\n", einfo->ei_expected_votes);
-	if (cman_get_quorum_device(h, &qinfo) == 0 && qinfo.qi_state == 1)
+	if (cman_get_quorum_device(h, &qinfo) == 0 && qinfo.qi_state == 2)
 		printf("Quorum device votes: %d\n", qinfo.qi_votes);
 	printf("Total votes: %d\n", einfo->ei_total_votes);
 
--- cluster/cman/daemon/cnxman-socket.h	2007/12/05 14:28:58	1.21
+++ cluster/cman/daemon/cnxman-socket.h	2008/02/08 14:09:28	1.22
@@ -54,7 +54,6 @@
 #define CMAN_CMD_STOP_CONFCHG       0x000000c1
 #define CMAN_CMD_SET_DIRTY          0x800000c2
 #define CMAN_CMD_SET_DEBUGLOG       0x800000c3
-#define CMAN_CMD_GET_QUORUMDEV      0x000000c4
 
 #define CMAN_CMD_DATA               0x00000100
 #define CMAN_CMD_BIND               0x00000101
--- cluster/cman/daemon/commands.c	2008/02/04 10:54:26	1.83
+++ cluster/cman/daemon/commands.c	2008/02/08 14:09:28	1.84
@@ -1024,21 +1024,6 @@
         return 0;
 }
 
-static int do_cmd_get_quorum_device(char *cmdbuf, char *retbuf, int *retlen)
-{
-	struct cl_qdev_info *qdi = (struct cl_qdev_info *)retbuf;
-
-        if (!quorum_device)
-                return -EINVAL;
-
-	strcpy(qdi->name, quorum_device->name);
-	qdi->state = (quorum_device->state == NODESTATE_MEMBER);
-	qdi->votes = quorum_device->votes;
-	*retlen = sizeof(struct cl_qdev_info);
-
-	return 0;
-}
-
 static void ccsd_timer_fn(void *arg)
 {
 	int ccs_err;
@@ -1291,10 +1276,6 @@
 		err = do_cmd_get_cluster(cmdbuf, outbuf+offset, retlen);
 		break;
 
-	case CMAN_CMD_GET_QUORUMDEV:
-		err = do_cmd_get_quorum_device(cmdbuf, outbuf+offset, retlen);
-		break;
-
 	case CMAN_CMD_GETEXTRAINFO:
 		err = do_cmd_get_extrainfo(cmdbuf, retbuf, retsize, retlen, offset);
 		break;
--- cluster/cman/lib/libcman.c	2008/01/07 18:53:14	1.41
+++ cluster/cman/lib/libcman.c	2008/02/08 14:09:28	1.42
@@ -1041,14 +1041,15 @@
 {
 	struct cman_handle *h = (struct cman_handle *)handle;
 	int ret;
-	struct cl_qdev_info q;
+	struct cl_cluster_node cman_node;
 	VALIDATE_HANDLE(h);
 
-	ret = info_call(h, CMAN_CMD_GET_QUORUMDEV, NULL, 0, &q, sizeof(q));
+	cman_node.node_id = CLUSTER_GETNODE_QUORUMDEV;
+	ret = info_call(h, CMAN_CMD_GETNODE, &cman_node, sizeof(cman_node), &cman_node, sizeof(cman_node));
 	if (!ret) {
-		strcpy(info->qi_name, q.name);
-		info->qi_state = q.state;
-		info->qi_votes = q.votes;
+		strcpy(info->qi_name, cman_node.name);
+		info->qi_state = cman_node.state;
+		info->qi_votes = cman_node.votes;
 	}
 	return ret;
 }
--- cluster/cman/lib/libcman.h	2007/12/11 10:48:01	1.39
+++ cluster/cman/lib/libcman.h	2008/02/08 14:09:28	1.40
@@ -186,7 +186,7 @@
 	char qi_name[CMAN_MAX_NODENAME_LEN+1];
 	int  qi_state;
 	int  qi_votes;
-} cman_qdev_info;
+} cman_qdev_info_t;
 
 /*
  * NOTE: Apart from cman_replyto_shutdown(), you must not


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]