4
0
Эх сурвалжийг харах

votequorum: display flags for all features

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Fabio M. Di Nitto 14 жил өмнө
parent
commit
1cf165e776

+ 5 - 2
include/corosync/ipc_votequorum.h

@@ -102,8 +102,11 @@ struct res_lib_votequorum_status {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
-#define VOTEQUORUM_INFO_FLAG_TWONODE    1
-#define VOTEQUORUM_INFO_FLAG_QUORATE    2
+#define VOTEQUORUM_INFO_FLAG_TWONODE	        1
+#define VOTEQUORUM_INFO_FLAG_QUORATE	        2
+#define VOTEQUORUM_INFO_WAIT_FOR_ALL	        4
+#define VOTEQUORUM_INFO_LAST_MAN_STANDING       8
+#define VOTEQUORUM_INFO_AUTO_TIE_BREAKER       16
 
 struct res_lib_votequorum_getinfo {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));

+ 5 - 2
include/corosync/votequorum.h

@@ -44,8 +44,11 @@ typedef uint64_t votequorum_handle_t;
 
 #define VOTEQUORUM_MAX_QDISK_NAME_LEN 255
 
-#define VOTEQUORUM_INFO_FLAG_TWONODE    1
-#define VOTEQUORUM_INFO_FLAG_QUORATE    2
+#define VOTEQUORUM_INFO_FLAG_TWONODE            1
+#define VOTEQUORUM_INFO_FLAG_QUORATE            2
+#define VOTEQUORUM_INFO_WAIT_FOR_ALL            4
+#define VOTEQUORUM_INFO_LAST_MAN_STANDING       8
+#define VOTEQUORUM_INFO_AUTO_TIE_BREAKER       16
 
 #define VOTEQUORUM_NODEID_US 0
 #define VOTEQUORUM_NODEID_QDEVICE -1

+ 5 - 3
man/votequorum_getinfo.3

@@ -62,9 +62,11 @@ struct votequorum_info {
 	unsigned int flags;
 };
 
-#define VOTEQUORUM_INFO_FLAG_DIRTY      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_INFO_WAIT_FOR_ALL            4
+#define VOTEQUORUM_INFO_LAST_MAN_STANDING       8
+#define VOTEQUORUM_INFO_AUTO_TIE_BREAKER       16
 
 .ta
 .fi

+ 9 - 0
services/votequorum.c

@@ -1279,6 +1279,15 @@ static void message_handler_req_lib_votequorum_getinfo (void *conn, const void *
 		if (cluster_is_quorate) {
 			res_lib_votequorum_getinfo.flags |= VOTEQUORUM_INFO_FLAG_QUORATE;
 		}
+		if (wait_for_all) {
+			res_lib_votequorum_getinfo.flags |= VOTEQUORUM_INFO_WAIT_FOR_ALL;
+		}
+		if (last_man_standing) {
+			res_lib_votequorum_getinfo.flags |= VOTEQUORUM_INFO_LAST_MAN_STANDING;
+		}
+		if (auto_tie_breaker) {
+			res_lib_votequorum_getinfo.flags |= VOTEQUORUM_INFO_AUTO_TIE_BREAKER;
+		}
 	} else {
 		error = CS_ERR_NOT_EXIST;
 	}

+ 7 - 0
test/testvotequorum1.c

@@ -130,6 +130,10 @@ int main(int argc, char *argv[])
 		printf("flags            ");
 		if (info.flags & VOTEQUORUM_INFO_FLAG_TWONODE) printf("2Node ");
 		if (info.flags & VOTEQUORUM_INFO_FLAG_QUORATE) printf("Quorate ");
+		if (info.flags & VOTEQUORUM_INFO_WAIT_FOR_ALL) printf("WaitForAll ");
+		if (info.flags & VOTEQUORUM_INFO_LAST_MAN_STANDING) printf("LastManStanding ");
+		if (info.flags & VOTEQUORUM_INFO_AUTO_TIE_BREAKER) printf("AutoTieBreaker ");
+
 		printf("\n");
 	}
 
@@ -155,6 +159,9 @@ int main(int argc, char *argv[])
 			printf("flags            ");
 			if (info.flags & VOTEQUORUM_INFO_FLAG_TWONODE) printf("2Node ");
 			if (info.flags & VOTEQUORUM_INFO_FLAG_QUORATE) printf("Quorate ");
+			if (info.flags & VOTEQUORUM_INFO_WAIT_FOR_ALL) printf("WaitForAll ");
+			if (info.flags & VOTEQUORUM_INFO_LAST_MAN_STANDING) printf("LastManStanding ");
+			if (info.flags & VOTEQUORUM_INFO_AUTO_TIE_BREAKER) printf("AutoTieBreaker ");
 			printf("\n");
 		}
 	}

+ 3 - 0
tools/corosync-quorumtool.c

@@ -320,6 +320,9 @@ static int display_quorum_data(int is_quorate, int loop)
 		printf("Flags:            ");
 		if (info.flags & VOTEQUORUM_INFO_FLAG_TWONODE) printf("2Node ");
 		if (info.flags & VOTEQUORUM_INFO_FLAG_QUORATE) printf("Quorate ");
+		if (info.flags & VOTEQUORUM_INFO_WAIT_FOR_ALL) printf("WaitForAll ");
+		if (info.flags & VOTEQUORUM_INFO_LAST_MAN_STANDING) printf("LastManStanding ");
+		if (info.flags & VOTEQUORUM_INFO_AUTO_TIE_BREAKER) printf("AutoTieBreaker ");
 		printf("\n");
 	} else {
 		fprintf(stderr, "votequorum_getinfo FAILED: %d\n", err);