votequorum: display flags for all features

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
Fabio M. Di Nitto 2012-01-12 10:46:05 +01:00
parent 2fee0e70f9
commit 1cf165e776
6 changed files with 34 additions and 7 deletions

View File

@ -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)));

View File

@ -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

View File

@ -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

View File

@ -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;
}

View File

@ -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");
}
}

View File

@ -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);