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 gboolean was_processing_error = FALSE;
22 gboolean was_processing_warning = FALSE;
23
24
25
26
27
28
29
30
31
32 pcmk_node_t *
33 pcmk_get_dc(const pcmk_scheduler_t *scheduler)
34 {
35 return (scheduler == NULL)? NULL : scheduler->dc_node;
36 }
37
38
39
40
41
42
43
44
45
46 enum pe_quorum_policy
47 pcmk_get_no_quorum_policy(const pcmk_scheduler_t *scheduler)
48 {
49 if (scheduler == NULL) {
50 return pcmk_no_quorum_stop;
51 }
52 return scheduler->no_quorum_policy;
53 }
54
55
56
57
58
59
60
61
62
63
64
65
66 int
67 pcmk_set_scheduler_cib(pcmk_scheduler_t *scheduler, xmlNode *cib)
68 {
69 if (scheduler == NULL) {
70 return EINVAL;
71 }
72 scheduler->input = cib;
73 return pcmk_rc_ok;
74 }
75
76
77
78
79
80
81
82
83
84 bool
85 pcmk_has_quorum(const pcmk_scheduler_t *scheduler)
86 {
87 if (scheduler == NULL) {
88 return false;
89 }
90 return pcmk_is_set(scheduler->flags, pcmk_sched_quorate);
91 }
92
93
94
95
96
97
98
99
100
101
102 pcmk_node_t *
103 pcmk_find_node(const pcmk_scheduler_t *scheduler, const char *node_name)
104 {
105 if ((scheduler == NULL) || (node_name == NULL)) {
106 return NULL;
107 }
108 return pcmk__find_node_in_list(scheduler->nodes, node_name);
109 }