1
2
3
4
5
6
7
8
9
10 #ifndef CONTROLD_GLOBALS__H
11 # define CONTROLD_GLOBALS__H
12
13 #include <crm_internal.h>
14
15 #include <stdint.h>
16 #include <glib.h>
17 #include <crm/cib.h>
18 #include <pacemaker-internal.h>
19 #include <controld_fsa.h>
20
21 typedef struct {
22
23
24
25 uint32_t flags;
26
27
28
29
30
31 enum crmd_fsa_state fsa_state;
32
33
34 uint64_t fsa_actions;
35
36
37 uint64_t fsa_input_register;
38
39
40 GList *fsa_message_queue;
41
42
43
44
45
46 cib_t *cib_conn;
47
48
49
50
51
52 char *fsa_pe_ref;
53
54
55
56
57
58 char *te_uuid;
59
60
61 pcmk__graph_t *transition_graph;
62
63
64
65
66
67 pcmk__output_t *logger_out;
68
69
70
71
72
73 char *cluster_name;
74
75
76 char *dc_name;
77
78
79 char *dc_version;
80
81
82 char *our_nodename;
83
84
85 char *our_uuid;
86
87
88 unsigned long long membership_id;
89
90
91 guint shutdown_lock_limit;
92
93
94 guint node_pending_timeout;
95
96
97 GMainLoop *mainloop;
98 } controld_globals_t;
99
100 extern controld_globals_t controld_globals;
101
102
103
104
105
106
107 enum controld_flags {
108
109 controld_dc_left = (1 << 0),
110
111
112 controld_fsa_is_stalled = (1 << 1),
113
114
115 controld_ever_had_quorum = (1 << 2),
116
117
118 controld_has_quorum = (1 << 3),
119
120
121 controld_no_quorum_panic = (1 << 4),
122
123
124 controld_shutdown_lock_enabled = (1 << 5),
125 };
126
127 # define controld_set_global_flags(flags_to_set) do { \
128 controld_globals.flags = pcmk__set_flags_as(__func__, __LINE__, \
129 LOG_TRACE, \
130 "Global", "controller", \
131 controld_globals.flags, \
132 (flags_to_set), \
133 #flags_to_set); \
134 } while (0)
135
136 # define controld_clear_global_flags(flags_to_clear) do { \
137 controld_globals.flags \
138 = pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, "Global", \
139 "controller", controld_globals.flags, \
140 (flags_to_clear), #flags_to_clear); \
141 } while (0)
142
143 #endif