votequorum.c File Reference
`#include <config.h>`
`#include <sys/types.h>`
`#include <sys/stat.h>`
`#include <fcntl.h>`
`#include <stdint.h>`
`#include <unistd.h>`
`#include <qb/qblist.h>`
`#include <qb/qbipc_common.h>`
`#include "quorum.h"`
`#include <corosync/corodefs.h>`
`#include <corosync/logsys.h>`
`#include <corosync/coroapi.h>`
`#include <corosync/icmap.h>`
`#include <corosync/votequorum.h>`
`#include <corosync/ipc_votequorum.h>`
`#include "service.h"`
`#include "util.h"`
`#include "votequorum.h"`
Include dependency graph for exec/votequorum.c:

Go to the source code of this file.

## Data Structures

struct | req_exec_quorum_nodeinfo
struct | req_exec_quorum_reconfigure
struct | req_exec_quorum_qdevice_reg
struct | req_exec_quorum_qdevice_reconfigure
struct | cluster_node
struct | quorum_pd

## Macros

#define | DEFAULT_LMS_WIN 10000
#define | MESSAGE_REQ_EXEC_VOTEQUORUM_NODEINFO 0
#define | MESSAGE_REQ_EXEC_VOTEQUORUM_RECONFIGURE 1
#define | MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_REG 2
#define | MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_RECONFIGURE 3
#define | VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES 1
#define | VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES 2
#define | VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA 3
#define | VOTEQUORUM_QDEVICE_OPERATION_UNREGISTER 0
#define | VOTEQUORUM_QDEVICE_OPERATION_REGISTER 1
#define | NODE_FLAGS_QUORATE 1
#define | NODE_FLAGS_LEAVING 2
#define | NODE_FLAGS_WFASTATUS 4
#define | NODE_FLAGS_FIRST 8
#define | NODE_FLAGS_QDEVICE_REGISTERED 16
#define | NODE_FLAGS_QDEVICE_ALIVE 32
#define | NODE_FLAGS_QDEVICE_CAST_VOTE 64
#define | NODE_FLAGS_QDEVICE_MASTER_WINS 128
#define | max(a, b) (((a) > (b)) ? (a) : (b))
#define | VOTEQUORUM_READCONFIG_STARTUP 0
#define | VOTEQUORUM_READCONFIG_RUNTIME 1

## Enumerations

enum | { ATB_NONE , ATB_LOWEST , ATB_HIGHEST , ATB_LIST }
enum | nodestate_t { NODESTATE_MEMBER =1 , NODESTATE_DEAD , NODESTATE_LEAVING }

## Functions

| LOGSYS_DECLARE_SUBSYS ("VOTEQ")
struct req_exec_quorum_nodeinfo | __attribute__ ((packed))
struct qb_ipc_request_header header | __attribute__ ((aligned(8)))
struct corosync_service_engine * | votequorum_get_service_engine_ver0 (void)
char * | votequorum_init (struct corosync_api_v1 *api, quorum_set_quorate_fn_t q_set_quorate_fn)

## Variables

typedef | __attribute__
uint32_t | nodeid
uint32_t | votes
uint32_t | expected_votes
uint32_t | flags
uint32_t | value
uint8_t | param
uint8_t | _pad0
uint8_t | _pad1
uint8_t | _pad2
uint32_t | operation
char | oldname [VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
char | newname [VOTEQUORUM_QDEVICE_MAX_NAME_LEN]

## Macro Definition Documentation

## DEFAULT_LMS_WIN

#define DEFAULT_LMS_WIN 10000

Definition at line 89 of file exec/votequorum.c.

## max

#define max | ( |  | a,
|  |  | b
| ) |  | (((a) > (b)) ? (a) : (b))

Definition at line 433 of file exec/votequorum.c.

## MESSAGE_REQ_EXEC_VOTEQUORUM_NODEINFO

#define MESSAGE_REQ_EXEC_VOTEQUORUM_NODEINFO 0

Definition at line 144 of file exec/votequorum.c.

## MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_RECONFIGURE

#define MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_RECONFIGURE 3

Definition at line 147 of file exec/votequorum.c.

## MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_REG

#define MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_REG 2

Definition at line 146 of file exec/votequorum.c.

## MESSAGE_REQ_EXEC_VOTEQUORUM_RECONFIGURE

#define MESSAGE_REQ_EXEC_VOTEQUORUM_RECONFIGURE 1

Definition at line 145 of file exec/votequorum.c.

## NODE_FLAGS_FIRST

#define NODE_FLAGS_FIRST 8

Definition at line 172 of file exec/votequorum.c.

## NODE_FLAGS_LEAVING

#define NODE_FLAGS_LEAVING 2

Definition at line 170 of file exec/votequorum.c.

## NODE_FLAGS_QDEVICE_ALIVE

#define NODE_FLAGS_QDEVICE_ALIVE 32

Definition at line 174 of file exec/votequorum.c.

## NODE_FLAGS_QDEVICE_CAST_VOTE

#define NODE_FLAGS_QDEVICE_CAST_VOTE 64

Definition at line 175 of file exec/votequorum.c.

## NODE_FLAGS_QDEVICE_MASTER_WINS

#define NODE_FLAGS_QDEVICE_MASTER_WINS 128

Definition at line 176 of file exec/votequorum.c.

## NODE_FLAGS_QDEVICE_REGISTERED

#define NODE_FLAGS_QDEVICE_REGISTERED 16

Definition at line 173 of file exec/votequorum.c.

## NODE_FLAGS_QUORATE

#define NODE_FLAGS_QUORATE 1

Definition at line 169 of file exec/votequorum.c.

## NODE_FLAGS_WFASTATUS

#define NODE_FLAGS_WFASTATUS 4

Definition at line 171 of file exec/votequorum.c.

## VOTEQUORUM_QDEVICE_OPERATION_REGISTER

#define VOTEQUORUM_QDEVICE_OPERATION_REGISTER 1

Definition at line 163 of file exec/votequorum.c.

## VOTEQUORUM_QDEVICE_OPERATION_UNREGISTER

#define VOTEQUORUM_QDEVICE_OPERATION_UNREGISTER 0

Definition at line 162 of file exec/votequorum.c.

## VOTEQUORUM_READCONFIG_RUNTIME

#define VOTEQUORUM_READCONFIG_RUNTIME 1

Definition at line 1241 of file exec/votequorum.c.

## VOTEQUORUM_READCONFIG_STARTUP

#define VOTEQUORUM_READCONFIG_STARTUP 0

Definition at line 1240 of file exec/votequorum.c.

## VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA

#define VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA 3

Definition at line 155 of file exec/votequorum.c.

## VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES

#define VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES 1

Definition at line 153 of file exec/votequorum.c.

## VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES

#define VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES 2

Definition at line 154 of file exec/votequorum.c.

## Enumeration Type Documentation

## anonymous enum

anonymous enum

Enumerator
ATB_NONE |
ATB_LOWEST |
ATB_HIGHEST |
ATB_LIST |

Definition at line 85 of file exec/votequorum.c.

## nodestate_t

enum nodestate_t

Enumerator
NODESTATE_MEMBER |
NODESTATE_DEAD |
NODESTATE_LEAVING |

Definition at line 178 of file exec/votequorum.c.

## Function Documentation

## __attribute__() [1/2]

struct qb_ipc_request_header header __attribute__::__attribute__ | ( | (aligned(8)) |  | ) |

## __attribute__() [2/2]

struct req_exec_quorum_nodeinfo __attribute__ | ( | (packed) |  | ) |

## LOGSYS_DECLARE_SUBSYS()

LOGSYS_DECLARE_SUBSYS | ( | "VOTEQ" |  | ) |

## votequorum_get_service_engine_ver0()

struct corosync_service_engine * votequorum_get_service_engine_ver0 | ( | void |  | ) |

Definition at line 416 of file exec/votequorum.c.

## votequorum_init()

char * votequorum_init | ( | struct corosync_api_v1 * | api,
|  | quorum_set_quorate_fn_t | q_set_quorate_fn
| ) |  |

Definition at line 2486 of file exec/votequorum.c.

References corosync_service_link_and_init(), ENTER, LEAVE, and nodeid.

## Variable Documentation

## __attribute__

typedef __attribute__

## _pad0

uint8_t _pad0

Definition at line 4 of file exec/votequorum.c.

## _pad1

uint8_t _pad1

Definition at line 5 of file exec/votequorum.c.

## _pad2

uint8_t _pad2

Definition at line 6 of file exec/votequorum.c.

## expected_votes

uint32_t expected_votes

Definition at line 3 of file exec/votequorum.c.

Referenced by votequorum_setexpected().

## flags

uint32_t flags

Definition at line 4 of file exec/votequorum.c.

Referenced by corosync_cfg_try_shutdown(), quorum_trackstart(), totempg_stats_clear(), totemsrp_stats_clear(), and votequorum_trackstart().

## newname

char newname[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]

Definition at line 2 of file exec/votequorum.c.

Referenced by votequorum_qdevice_update().

## nodeid

uint32_t nodeid

Definition at line 1 of file exec/votequorum.c.

Referenced by votequorum_init().

## oldname

char oldname[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]

Definition at line 1 of file exec/votequorum.c.

Referenced by votequorum_qdevice_update().

## operation

uint32_t operation

Definition at line 1 of file exec/votequorum.c.

## param

uint8_t param

Definition at line 3 of file exec/votequorum.c.

Referenced by stats_add_schedmiss_event(), stats_ipcs_add_connection(), stats_ipcs_del_connection(), stats_knet_add_handle(), stats_knet_add_member(), stats_knet_del_member(), and stats_map_init().

## value

uint32_t value

Definition at line 2 of file exec/votequorum.c.

Referenced by cmap_get(), cmap_set(), cmap_set_double(), cmap_set_float(), cmap_set_int16(), cmap_set_int32(), cmap_set_int64(), cmap_set_int8(), cmap_set_string(), cmap_set_uint16(), cmap_set_uint32(), cmap_set_uint64(), cmap_set_uint8(), icmap_copy_map(), icmap_get(), icmap_get_r(), icmap_set(), icmap_set_double(), icmap_set_double_r(), icmap_set_float(), icmap_set_float_r(), icmap_set_int16(), icmap_set_int16_r(), icmap_set_int32(), icmap_set_int32_r(), icmap_set_int64(), icmap_set_int64_r(), icmap_set_int8(), icmap_set_int8_r(), icmap_set_r(), icmap_set_string(), icmap_set_string_r(), icmap_set_uint16(), icmap_set_uint16_r(), icmap_set_uint32(), icmap_set_uint32_r(), icmap_set_uint64(), icmap_set_uint64_r(), icmap_set_uint8(), icmap_set_uint8_r(), stats_map_get(), stats_trigger_trackers(), and totempg_event_signal().

## votes

uint32_t votes

Definition at line 2 of file exec/votequorum.c.

Referenced by votequorum_setvotes().