votequorum: fix votequorum_getinfo man page and align struct name

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
This commit is contained in:
Fabio M. Di Nitto 2012-02-27 10:40:41 +01:00
parent c439bc3aa8
commit 03c76be696
4 changed files with 23 additions and 5 deletions

View File

@ -61,7 +61,7 @@ typedef uint64_t votequorum_handle_t;
struct votequorum_info {
unsigned int node_id;
unsigned int state;
unsigned int node_state;
unsigned int node_votes;
unsigned int node_expected_votes;
unsigned int highest_expected;

View File

@ -174,7 +174,7 @@ cs_error_t votequorum_getinfo (
error = res_lib_votequorum_getinfo.header.error;
info->node_id = res_lib_votequorum_getinfo.nodeid;
info->state = res_lib_votequorum_getinfo.state;
info->node_state = res_lib_votequorum_getinfo.state;
info->node_votes = res_lib_votequorum_getinfo.votes;
info->node_expected_votes = res_lib_votequorum_getinfo.expected_votes;
info->highest_expected = res_lib_votequorum_getinfo.highest_expected;

View File

@ -43,12 +43,17 @@ The
.B votequorum_getinfo
function is used to get information about the voting system and its nodes.
The
.I nodeid
argument indicates which node information should be stored in the votequorum_info structure.
The votequorum_info structure is defined as follows:
.nf
struct votequorum_info {
unsigned int node_id;
unsigned int node_state;
unsigned int node_votes;
unsigned int node_expected_votes;
unsigned int highest_expected;
@ -57,18 +62,31 @@ struct votequorum_info {
unsigned int flags;
};
.fi
The node_state is defined as:
.nf
#define NODESTATE_MEMBER 1
#define NODESTATE_DEAD 2
#define NODESTATE_LEAVING 3
.fi
The flags are defined as:
.nf
#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_INFO_LEAVE_REMOVE 32
#define VOTEQUORUM_INFO_QDEVICE 64
.fi
.PP
The members starting node_ hold information specific to the requested nodeid, the other are
general to the voting system.
.SH RETURN VALUE
This call returns the CS_OK value if successful, otherwise an error is returned.
This call returns the CS_OK value if successful, otherwise a generic error is returned.
.PP
.SH ERRORS
@COMMONIPCERRORS@

View File

@ -382,8 +382,8 @@ static int display_quorum_data(int is_quorate, uint32_t nodeid, int loop)
if ((err=votequorum_getinfo(v_handle, nodeid, &info)) == CS_OK) {
printf("Node votes: %d\n", info.node_votes);
printf("Node state: %s\n", decode_state(info.state));
if (info.state != NODESTATE_MEMBER) {
printf("Node state: %s\n", decode_state(info.node_state));
if (info.node_state != NODESTATE_MEMBER) {
return err;
}
printf("Expected votes: %d\n", info.node_expected_votes);