pacemaker 2.1.8-2.1.8
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
scheduler.c
Go to the documentation of this file.
1/*
2 * Copyright 2004-2024 the Pacemaker project contributors
3 *
4 * The version control history for this file may have further details.
5 *
6 * This source code is licensed under the GNU Lesser General Public License
7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8 */
9
10#include <crm_internal.h>
11
12#include <stdint.h> // uint32_t
13#include <errno.h> // EINVAL
14#include <glib.h> // gboolean, FALSE
15#include <libxml/tree.h> // xmlNode
16
18
19uint32_t pcmk__warnings = 0;
20
21gboolean was_processing_error = FALSE;
22gboolean was_processing_warning = FALSE;
23
34{
35 return (scheduler == NULL)? NULL : scheduler->dc_node;
36}
37
48{
49 if (scheduler == NULL) {
50 return pcmk_no_quorum_stop; // The default
51 }
53}
54
66int
68{
69 if (scheduler == NULL) {
70 return EINVAL;
71 }
72 scheduler->input = cib;
73 return pcmk_rc_ok;
74}
75
84bool
86{
87 if (scheduler == NULL) {
88 return false;
89 }
91}
92
103pcmk_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}
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
Definition util.h:98
pcmk__warnings
pcmk_scheduler_t * scheduler
pcmk_node_t * pcmk__find_node_in_list(const GList *nodes, const char *node_name)
Definition nodes.c:150
@ pcmk_rc_ok
Definition results.h:162
int pcmk_set_scheduler_cib(pcmk_scheduler_t *scheduler, xmlNode *cib)
Definition scheduler.c:67
bool pcmk_has_quorum(const pcmk_scheduler_t *scheduler)
Definition scheduler.c:85
gboolean was_processing_error
Definition scheduler.c:21
pcmk_node_t * pcmk_find_node(const pcmk_scheduler_t *scheduler, const char *node_name)
Find a node by name in scheduler data.
Definition scheduler.c:103
gboolean was_processing_warning
Definition scheduler.c:22
pcmk_node_t * pcmk_get_dc(const pcmk_scheduler_t *scheduler)
Definition scheduler.c:33
enum pe_quorum_policy pcmk_get_no_quorum_policy(const pcmk_scheduler_t *scheduler)
Definition scheduler.c:47
Scheduler API.
pe_quorum_policy
Possible responses to loss of quorum.
Definition scheduler.h:40
@ pcmk_no_quorum_stop
Definition scheduler.h:42
@ pcmk_sched_quorate
Definition scheduler.h:80
xmlNode * input
Definition scheduler.h:196
unsigned long long flags
Definition scheduler.h:211
pcmk_node_t * dc_node
Definition scheduler.h:203
enum pe_quorum_policy no_quorum_policy
Definition scheduler.h:217