From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx> Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx> --- :100644 100644 26ebced... e17aeb6... M include/corosync/ipc_votequorum.h :100644 100644 b52cad0... 8e1cb84... M include/corosync/votequorum.h :100644 100644 e6fce8b... 213e8a0... M man/votequorum_getinfo.3 :100644 100644 62dca5b... 550cde5... M services/votequorum.c :100644 100644 61c35e3... cb0f929... M test/testvotequorum1.c :100644 100644 c6ef137... f0ee165... M tools/corosync-quorumtool.c include/corosync/ipc_votequorum.h | 7 +++++-- include/corosync/votequorum.h | 7 +++++-- man/votequorum_getinfo.3 | 8 +++++--- services/votequorum.c | 9 +++++++++ test/testvotequorum1.c | 7 +++++++ tools/corosync-quorumtool.c | 3 +++ 6 files changed, 34 insertions(+), 7 deletions(-) diff --git a/include/corosync/ipc_votequorum.h b/include/corosync/ipc_votequorum.h index 26ebced..e17aeb6 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 b52cad0..8e1cb84 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 e6fce8b..213e8a0 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 62dca5b..550cde5 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 61c35e3..cb0f929 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 c6ef137..f0ee165 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); -- 1.7.7.5 _______________________________________________ discuss mailing list discuss@xxxxxxxxxxxx http://lists.corosync.org/mailman/listinfo/discuss