This source file includes following definitions.
- pcmk_get_dc
- pcmk_get_no_quorum_policy
- pcmk_set_scheduler_cib
- pcmk_has_quorum
- pcmk_find_node
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <stdint.h>
13 #include <errno.h>
14 #include <glib.h>
15 #include <libxml/tree.h>
16
17 #include <crm/common/scheduler.h>
18
19 uint32_t pcmk__warnings = 0;
20
21
22
23
24
25
26
27
28
29 pcmk_node_t *
30 pcmk_get_dc(const pcmk_scheduler_t *scheduler)
31 {
32 return (scheduler == NULL)? NULL : scheduler->dc_node;
33 }
34
35
36
37
38
39
40
41
42
43 enum pe_quorum_policy
44 pcmk_get_no_quorum_policy(const pcmk_scheduler_t *scheduler)
45 {
46 if (scheduler == NULL) {
47 return pcmk_no_quorum_stop;
48 }
49 return scheduler->no_quorum_policy;
50 }
51
52
53
54
55
56
57
58
59
60
61
62
63 int
64 pcmk_set_scheduler_cib(pcmk_scheduler_t *scheduler, xmlNode *cib)
65 {
66 if (scheduler == NULL) {
67 return EINVAL;
68 }
69 scheduler->input = cib;
70 return pcmk_rc_ok;
71 }
72
73
74
75
76
77
78
79
80
81 bool
82 pcmk_has_quorum(const pcmk_scheduler_t *scheduler)
83 {
84 if (scheduler == NULL) {
85 return false;
86 }
87 return pcmk_is_set(scheduler->flags, pcmk__sched_quorate);
88 }
89
90
91
92
93
94
95
96
97
98
99 pcmk_node_t *
100 pcmk_find_node(const pcmk_scheduler_t *scheduler, const char *node_name)
101 {
102 if ((scheduler == NULL) || (node_name == NULL)) {
103 return NULL;
104 }
105 return pcmk__find_node_in_list(scheduler->nodes, node_name);
106 }