1QUORUM_INITIALIZE(3C)orosync Cluster Engine Programmer's ManuQaUlORUM_INITIALIZE(3)
2
3
4
6 quorum_initialize - Create a new connection to the Quorum service
7
9 #include <corosync/quorum.h>
10
11 int quorum_initialize(quorum_handle_t *handle, quorum_callbacks_t
12 *callbacks, uint32_t *quorum_type);
13
15 The quorum_initialize function is used to initialize a connection to
16 the quorum API.
17
18 Each application may have several connections to the quorum API. Each
19 application uses the handle argument to uniquely identify the connec‐
20 tion. The handle argument is then used in other function calls to
21 identify the connection to be used for communication with the quorum
22 service.
23
24 Every time the voting configuration changes (eg a node joins or leave
25 the cluster) or the quorum status change, the callback is called. The
26 callback function is described by the following type definitions:
27
28 typedef void (*quorum_notification_fn_t) (
29 quorum_handle_t handle,
30 uint32_t quorate,
31 uint64_t ring_seq,
32 uint32_t view_list_entries,
33 uint32_t *view_list
34 );
35
36 The callbacks argument is of the type:
37
38 typedef struct {
39 quorum_notification_fn_t quorum_notify_fn;
40 } quorum_callbacks_t;
41
42 The quorum_type argument is set to:
43
44 #define QUORUM_FREE 0
45 #define QUORUM_SET 1
46
47 QUORUM_FREE value means that no quorum algorithm is loaded and that no
48 callbacks will take place.
49
50 QUORUM_SET value means that one quorum algorithm is configured and that
51 callbacks will take place.
52
53 When a configuration change occurs, the callback is called from the
54 quorum_dispatch() function.
55
57 This call returns the CS_OK value if successful, otherwise an error is
58 returned.
59
61 CS_ERR_TRY_AGAIN Resource temporarily unavailable
62
63 CS_ERR_INVALID_PARAM Invalid argument
64
65 CS_ERR_ACCESS Permission denied
66
67 CS_ERR_LIBRARY The connection failed
68
69 CS_ERR_INTERRUPT System call interrupted by a signal
70
71 CS_ERR_NOT_SUPPORTED The requested protocol/functionality not supported
72
73 CS_ERR_MESSAGE_ERROR Incorrect auth message received
74
75 CS_ERR_NO_MEMORY Not enough memory to complete the requested task
76
77
79 quorum_overview(3), quorum_model_initialize(3), quorum_finalize(3),
80 quorum_getquorate(3), quorum_trackstart(3), quorum_trackstop(3), quo‐
81 rum_fd_get(3), quorum_dispatch(3), quorum_context_set(3), quorum_con‐
82 text_get(3)
83
84corosync Man Page 2021-06-03 QUORUM_INITIALIZE(3)