Explorar o código

votequorum: drop HASSTATE/SETSTATE

this is a leftover from killing DISALLOWED

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Fabio M. Di Nitto %!s(int64=14) %!d(string=hai) anos
pai
achega
f464038b17

+ 2 - 4
include/corosync/ipc_votequorum.h

@@ -47,7 +47,6 @@ enum req_votequorum_types {
 	MESSAGE_REQ_VOTEQUORUM_QDISK_UNREGISTER,
 	MESSAGE_REQ_VOTEQUORUM_QDISK_POLL,
 	MESSAGE_REQ_VOTEQUORUM_QDISK_GETINFO,
-	MESSAGE_REQ_VOTEQUORUM_SETSTATE,
 	MESSAGE_REQ_VOTEQUORUM_LEAVING,
 	MESSAGE_REQ_VOTEQUORUM_TRACKSTART,
 	MESSAGE_REQ_VOTEQUORUM_TRACKSTOP
@@ -103,9 +102,8 @@ struct res_lib_votequorum_status {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
-#define VOTEQUORUM_INFO_FLAG_HASSTATE   1
-#define VOTEQUORUM_INFO_FLAG_TWONODE    2
-#define VOTEQUORUM_INFO_FLAG_QUORATE    4
+#define VOTEQUORUM_INFO_FLAG_TWONODE    1
+#define VOTEQUORUM_INFO_FLAG_QUORATE    2
 
 struct res_lib_votequorum_getinfo {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));

+ 2 - 9
include/corosync/votequorum.h

@@ -44,9 +44,8 @@ typedef uint64_t votequorum_handle_t;
 
 #define VOTEQUORUM_MAX_QDISK_NAME_LEN 255
 
-#define VOTEQUORUM_INFO_FLAG_HASSTATE   1
-#define VOTEQUORUM_INFO_FLAG_TWONODE    2
-#define VOTEQUORUM_INFO_FLAG_QUORATE    4
+#define VOTEQUORUM_INFO_FLAG_TWONODE    1
+#define VOTEQUORUM_INFO_FLAG_QUORATE    2
 
 #define VOTEQUORUM_NODEID_US 0
 #define VOTEQUORUM_NODEID_QDEVICE -1
@@ -181,12 +180,6 @@ cs_error_t votequorum_qdisk_getinfo (
 	votequorum_handle_t handle,
 	struct votequorum_qdisk_info *info);
 
-/**
- * Set the "hasstate" bit for this node
- */
-cs_error_t votequorum_setstate (
-	votequorum_handle_t handle);
-
 /**
  * Track node and quorum changes
  */

+ 0 - 1
lib/libvotequorum.versions

@@ -11,7 +11,6 @@ COROSYNC_VOTEQUORUM_1.0 {
 		votequorum_qdisk_unregister;
 		votequorum_qdisk_poll;
 		votequorum_qdisk_getinfo;
-		votequorum_setstate;
 		votequorum_leaving;
 		votequorum_trackstart;
 		votequorum_trackstop;

+ 0 - 39
lib/votequorum.c

@@ -448,45 +448,6 @@ error_exit:
 	return (error);
 }
 
-cs_error_t votequorum_setstate (
-	votequorum_handle_t handle)
-{
-	cs_error_t error;
-	struct votequorum_inst *votequorum_inst;
-	struct iovec iov;
-	struct req_lib_votequorum_general req_lib_votequorum_general;
-	struct res_lib_votequorum_status res_lib_votequorum_status;
-
-	error = hdb_error_to_cs(hdb_handle_get (&votequorum_handle_t_db, handle, (void *)&votequorum_inst));
-	if (error != CS_OK) {
-		return (error);
-	}
-
-	req_lib_votequorum_general.header.size = sizeof (struct req_lib_votequorum_general);
-	req_lib_votequorum_general.header.id = MESSAGE_REQ_VOTEQUORUM_SETSTATE;
-
-	iov.iov_base = (char *)&req_lib_votequorum_general;
-	iov.iov_len = sizeof (struct req_lib_votequorum_general);
-
-        error = qb_to_cs_error(qb_ipcc_sendv_recv (
-		votequorum_inst->c,
-		&iov,
-		1,
-                &res_lib_votequorum_status,
-		sizeof (struct res_lib_votequorum_status), CS_IPC_TIMEOUT_MS));
-
-	if (error != CS_OK) {
-		goto error_exit;
-	}
-
-	error = res_lib_votequorum_status.header.error;
-
-error_exit:
-	hdb_handle_put (&votequorum_handle_t_db, handle);
-
-	return (error);
-}
-
 cs_error_t votequorum_leaving (
 	votequorum_handle_t handle)
 {

+ 5 - 37
services/votequorum.c

@@ -92,10 +92,9 @@ enum quorum_message_req_types {
 };
 
 #define NODE_FLAGS_BEENDOWN         1
-#define NODE_FLAGS_HASSTATE         8
-#define NODE_FLAGS_QDISK           16
-#define NODE_FLAGS_REMOVED         32
-#define NODE_FLAGS_US              64
+#define NODE_FLAGS_QDISK            8
+#define NODE_FLAGS_REMOVED         16
+#define NODE_FLAGS_US              32
 
 #define NODEID_US 0
 #define NODEID_QDEVICE -1
@@ -210,9 +209,6 @@ static void message_handler_req_lib_votequorum_qdisk_poll (void *conn,
 static void message_handler_req_lib_votequorum_qdisk_getinfo (void *conn,
 							      const void *message);
 
-static void message_handler_req_lib_votequorum_setstate (void *conn,
-							 const void *message);
-
 static void message_handler_req_lib_votequorum_leaving (void *conn,
 							const void *message);
 static void message_handler_req_lib_votequorum_trackstart (void *conn,
@@ -264,18 +260,14 @@ static struct corosync_lib_handler quorum_lib_service[] =
 		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	{ /* 7 */
-		.lib_handler_fn		= message_handler_req_lib_votequorum_setstate,
-		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
-	},
-	{ /* 8 */
 		.lib_handler_fn		= message_handler_req_lib_votequorum_leaving,
 		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
-	{ /* 9 */
+	{ /* 8 */
 		.lib_handler_fn		= message_handler_req_lib_votequorum_trackstart,
 		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
-	{ /* 10 */
+	{ /* 9 */
 		.lib_handler_fn		= message_handler_req_lib_votequorum_trackstop,
 		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	}
@@ -1281,9 +1273,6 @@ static void message_handler_req_lib_votequorum_getinfo (void *conn, const void *
 		res_lib_votequorum_getinfo.flags = 0;
 		res_lib_votequorum_getinfo.nodeid = node->node_id;
 
-		if (us->flags & NODE_FLAGS_HASSTATE) {
-			res_lib_votequorum_getinfo.flags |= VOTEQUORUM_INFO_FLAG_HASSTATE;
-		}
 		if (two_node) {
 			res_lib_votequorum_getinfo.flags |= VOTEQUORUM_INFO_FLAG_TWONODE;
 		}
@@ -1579,27 +1568,6 @@ static void message_handler_req_lib_votequorum_qdisk_getinfo (void *conn,
 	LEAVE();
 }
 
-static void message_handler_req_lib_votequorum_setstate (void *conn,
-							 const void *message)
-{
-	struct res_lib_votequorum_status res_lib_votequorum_status;
-	cs_error_t error = CS_OK;
-
-	ENTER();
-
-	us->flags |= NODE_FLAGS_HASSTATE;
-
-	/*
-	 * send status
-	 */
-	res_lib_votequorum_status.header.size = sizeof(res_lib_votequorum_status);
-	res_lib_votequorum_status.header.id = MESSAGE_RES_VOTEQUORUM_STATUS;
-	res_lib_votequorum_status.header.error = error;
-	corosync_api->ipc_response_send(conn, &res_lib_votequorum_status, sizeof(res_lib_votequorum_status));
-
-	LEAVE();
-}
-
 static void message_handler_req_lib_votequorum_trackstart (void *conn,
 							   const void *message)
 {

+ 0 - 2
test/testvotequorum1.c

@@ -128,7 +128,6 @@ int main(int argc, char *argv[])
 		printf("total votes      %d\n", info.total_votes);
 		printf("quorum           %d\n", info.quorum);
 		printf("flags            ");
-		if (info.flags & VOTEQUORUM_INFO_FLAG_HASSTATE) printf("HasState ");
 		if (info.flags & VOTEQUORUM_INFO_FLAG_TWONODE) printf("2Node ");
 		if (info.flags & VOTEQUORUM_INFO_FLAG_QUORATE) printf("Quorate ");
 		printf("\n");
@@ -154,7 +153,6 @@ int main(int argc, char *argv[])
 			printf("total votes      %d\n", info.total_votes);
 			printf("votequorum           %d\n", info.quorum);
 			printf("flags            ");
-			if (info.flags & VOTEQUORUM_INFO_FLAG_HASSTATE) printf("HasState ");
 			if (info.flags & VOTEQUORUM_INFO_FLAG_TWONODE) printf("2Node ");
 			if (info.flags & VOTEQUORUM_INFO_FLAG_QUORATE) printf("Quorate ");
 			printf("\n");

+ 0 - 1
tools/corosync-quorumtool.c

@@ -315,7 +315,6 @@ static int display_quorum_data(int is_quorate)
 		printf("Total votes:      %d\n", info.total_votes);
 		printf("Quorum:           %d %s\n", info.quorum, info.flags & VOTEQUORUM_INFO_FLAG_QUORATE?" ":"Activity blocked");
 		printf("Flags:            ");
-		if (info.flags & VOTEQUORUM_INFO_FLAG_HASSTATE) printf("HasState ");
 		if (info.flags & VOTEQUORUM_INFO_FLAG_TWONODE) printf("2Node ");
 		if (info.flags & VOTEQUORUM_INFO_FLAG_QUORATE) printf("Quorate ");
 		printf("\n");