diff --git a/include/corosync/ipc_votequorum.h b/include/corosync/ipc_votequorum.h index 26ebced1..e17aeb6d 100644 --- a/include/corosync/ipc_votequorum.h +++ b/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))); diff --git a/include/corosync/votequorum.h b/include/corosync/votequorum.h index b52cad00..8e1cb843 100644 --- a/include/corosync/votequorum.h +++ b/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 diff --git a/man/votequorum_getinfo.3 b/man/votequorum_getinfo.3 index e6fce8b0..213e8a0a 100644 --- a/man/votequorum_getinfo.3 +++ b/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 diff --git a/services/votequorum.c b/services/votequorum.c index 9dd624ef..9f780207 100644 --- a/services/votequorum.c +++ b/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; } diff --git a/test/testvotequorum1.c b/test/testvotequorum1.c index 61c35e31..cb0f9290 100644 --- a/test/testvotequorum1.c +++ b/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"); } } diff --git a/tools/corosync-quorumtool.c b/tools/corosync-quorumtool.c index c6ef137f..f0ee1653 100644 --- a/tools/corosync-quorumtool.c +++ b/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);