pacemaker  3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
internal.h
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 #ifndef PCMK__CRM_PENGINE_INTERNAL__H
11 #define PCMK__CRM_PENGINE_INTERNAL__H
12 
13 #include <stdbool.h>
14 #include <stdint.h>
15 #include <string.h>
16 #include <crm/common/xml.h>
17 #include <crm/pengine/status.h>
19 #include <crm/common/internal.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 const char *pe__resource_description(const pcmk_resource_t *rsc,
29  uint32_t show_opts);
30 
31 bool pe__clone_is_ordered(const pcmk_resource_t *clone);
33 bool pe__clone_flag_is_set(const pcmk_resource_t *clone, uint32_t flags);
34 
35 bool pe__group_flag_is_set(const pcmk_resource_t *group, uint32_t flags);
37 
39  bool include_bundle);
40 
41 int pe__clone_max(const pcmk_resource_t *clone);
42 int pe__clone_node_max(const pcmk_resource_t *clone);
43 int pe__clone_promoted_max(const pcmk_resource_t *clone);
48  pcmk_action_t *start,
49  pcmk_action_t *started,
50  pcmk_action_t *stop,
51  pcmk_action_t *stopped);
52 
54  bool optional, bool runnable);
55 
57  bool any_promoting, bool any_demoting);
58 
59 bool pe_can_fence(const pcmk_scheduler_t *scheduler, const pcmk_node_t *node);
60 
61 char *native_parameter(pcmk_resource_t *rsc, pcmk_node_t *node, gboolean create,
62  const char *name, pcmk_scheduler_t *scheduler);
63 pcmk_node_t *native_location(const pcmk_resource_t *rsc, GList **list,
64  uint32_t target);
66  pcmk_scheduler_t *scheduler, gboolean failed);
67 
72 
73 pcmk_resource_t *native_find_rsc(pcmk_resource_t *rsc, const char *id,
74  const pcmk_node_t *node, int flags);
75 
76 gboolean native_active(pcmk_resource_t *rsc, gboolean all);
77 gboolean group_active(pcmk_resource_t *rsc, gboolean all);
78 gboolean clone_active(pcmk_resource_t *rsc, gboolean all);
79 gboolean pe__bundle_active(pcmk_resource_t *rsc, gboolean all);
80 
81 gchar *pcmk__native_output_string(const pcmk_resource_t *rsc, const char *name,
82  const pcmk_node_t *node, uint32_t show_opts,
83  const char *target_role, bool show_nodes);
84 
85 int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name,
86  ...) G_GNUC_NULL_TERMINATED;
87 char *pe__node_display_name(pcmk_node_t *node, bool print_detail);
88 
89 
90 // Clone notifications (pe_notif.c)
92  pcmk_resource_t *rsc,
93  pcmk_action_t *stonith_op);
94 
95 
96 // Resource output methods
97 int pe__clone_xml(pcmk__output_t *out, va_list args);
98 int pe__clone_default(pcmk__output_t *out, va_list args);
99 int pe__group_xml(pcmk__output_t *out, va_list args);
100 int pe__group_default(pcmk__output_t *out, va_list args);
101 int pe__bundle_xml(pcmk__output_t *out, va_list args);
102 int pe__bundle_html(pcmk__output_t *out, va_list args);
103 int pe__bundle_text(pcmk__output_t *out, va_list args);
104 int pe__node_html(pcmk__output_t *out, va_list args);
105 int pe__node_text(pcmk__output_t *out, va_list args);
106 int pe__node_xml(pcmk__output_t *out, va_list args);
107 int pe__resource_xml(pcmk__output_t *out, va_list args);
108 int pe__resource_html(pcmk__output_t *out, va_list args);
109 int pe__resource_text(pcmk__output_t *out, va_list args);
110 
111 void native_free(pcmk_resource_t *rsc);
112 void group_free(pcmk_resource_t *rsc);
113 void clone_free(pcmk_resource_t *rsc);
115 
117  gboolean current);
119  gboolean current);
121  gboolean current);
123  gboolean current);
124 
127 
128 void common_free(pcmk_resource_t *rsc);
129 
130 pcmk_node_t *pe__copy_node(const pcmk_node_t *this_node);
132 
133 /* Failure handling utilities (from failcounts.c) */
134 
135 int pe_get_failcount(const pcmk_node_t *node, pcmk_resource_t *rsc,
136  time_t *last_failure, uint32_t flags,
137  const xmlNode *xml_op);
138 
140  const pcmk_node_t *node, const char *reason,
142 
143 /* Functions for finding/counting a resource's active nodes */
144 
145 bool pe__count_active_node(const pcmk_resource_t *rsc, pcmk_node_t *node,
146  pcmk_node_t **active, unsigned int *count_all,
147  unsigned int *count_clean);
148 
150  unsigned int *count);
151 
152 /* Binary like operators for lists of nodes */
153 GHashTable *pe__node_list2table(const GList *list);
154 
156 gboolean order_actions(pcmk_action_t *first, pcmk_action_t *then,
157  uint32_t flags);
158 
159 void pe__show_node_scores_as(const char *file, const char *function,
160  int line, bool to_log, const pcmk_resource_t *rsc,
161  const char *comment, GHashTable *nodes,
163 
164 #define pe__show_node_scores(level, rsc, text, nodes, scheduler) \
165  pe__show_node_scores_as(__FILE__, __func__, __LINE__, \
166  (level), (rsc), (text), (nodes), (scheduler))
167 
169  const pcmk_node_t *node,
170  const char *action_name, guint interval_ms,
171  const xmlNode *action_config);
172 GHashTable *pcmk__unpack_action_rsc_params(const xmlNode *action_xml,
173  GHashTable *node_attrs,
174  pcmk_scheduler_t *data_set);
175 xmlNode *pcmk__find_action_config(const pcmk_resource_t *rsc,
176  const char *action_name, guint interval_ms,
177  bool include_disabled);
178 
180  const char *action_name);
181 
183  const char *action_name,
184  guint interval_ms, const char *value);
185 
187  const char *action_name,
188  enum pcmk__on_fail on_fail,
189  GHashTable *meta);
190 
191 pcmk_action_t *custom_action(pcmk_resource_t *rsc, char *key, const char *task,
192  const pcmk_node_t *on_node, gboolean optional,
194 
195 #define delete_key(rsc) pcmk__op_key((rsc)->id, PCMK_ACTION_DELETE, 0)
196 #define stop_key(rsc) pcmk__op_key((rsc)->id, PCMK_ACTION_STOP, 0)
197 #define reload_key(rsc) pcmk__op_key((rsc)->id, PCMK_ACTION_RELOAD_AGENT, 0)
198 #define start_key(rsc) pcmk__op_key((rsc)->id, PCMK_ACTION_START, 0)
199 #define promote_key(rsc) pcmk__op_key((rsc)->id, PCMK_ACTION_PROMOTE, 0)
200 #define demote_key(rsc) pcmk__op_key((rsc)->id, PCMK_ACTION_DEMOTE, 0)
201 
202 #define delete_action(rsc, node, optional) \
203  custom_action((rsc), delete_key(rsc), PCMK_ACTION_DELETE, \
204  (node), (optional), (rsc)->priv->scheduler)
205 
206 #define stop_action(rsc, node, optional) \
207  custom_action((rsc), stop_key(rsc), PCMK_ACTION_STOP, \
208  (node), (optional), (rsc)->priv->scheduler)
209 
210 #define start_action(rsc, node, optional) \
211  custom_action((rsc), start_key(rsc), PCMK_ACTION_START, \
212  (node), (optional), (rsc)->priv->scheduler)
213 
214 #define promote_action(rsc, node, optional) \
215  custom_action((rsc), promote_key(rsc), PCMK_ACTION_PROMOTE, \
216  (node), (optional), (rsc)->priv->scheduler)
217 
218 #define demote_action(rsc, node, optional) \
219  custom_action((rsc), demote_key(rsc), PCMK_ACTION_DEMOTE, \
220  (node), (optional), (rsc)->priv->scheduler)
221 
222 pcmk_action_t *find_first_action(const GList *input, const char *uuid,
223  const char *task, const pcmk_node_t *on_node);
224 
226  const char *name);
227 
228 GList *find_actions(GList *input, const char *key, const pcmk_node_t *on_node);
229 GList *find_actions_exact(GList *input, const char *key,
230  const pcmk_node_t *on_node);
231 GList *pe__resource_actions(const pcmk_resource_t *rsc, const pcmk_node_t *node,
232  const char *task, bool require_node);
233 
234 extern void pe_free_action(pcmk_action_t *action);
235 
236 void resource_location(pcmk_resource_t *rsc, const pcmk_node_t *node, int score,
237  const char *tag, pcmk_scheduler_t *scheduler);
238 
239 int pe__is_newer_op(const xmlNode *xml_a, const xmlNode *xml_b);
240 extern gint sort_op_by_callid(gconstpointer a, gconstpointer b);
241 gboolean get_target_role(const pcmk_resource_t *rsc, enum rsc_role_e *role);
242 void pe__set_next_role(pcmk_resource_t *rsc, enum rsc_role_e role,
243  const char *why);
244 
245 extern void destroy_ticket(gpointer data);
246 pcmk__ticket_t *ticket_new(const char *ticket_id, pcmk_scheduler_t *scheduler);
247 
248 // Resources for manipulating resource names
249 const char *pe_base_name_end(const char *id);
250 char *clone_strip(const char *last_rsc_id);
251 char *clone_zero(const char *last_rsc_id);
252 
253 static inline bool
254 pe_base_name_eq(const pcmk_resource_t *rsc, const char *id)
255 {
256  if (id && rsc && rsc->id) {
257  // Number of characters in rsc->id before any clone suffix
258  size_t base_len = pe_base_name_end(rsc->id) - rsc->id + 1;
259 
260  return (strlen(id) == base_len) && !strncmp(id, rsc->id, base_len);
261  }
262  return false;
263 }
264 
265 int pe__target_rc_from_xml(const xmlNode *xml_op);
266 
267 gint pe__cmp_node_name(gconstpointer a, gconstpointer b);
268 bool is_set_recursive(const pcmk_resource_t *rsc, long long flag, bool any);
269 
271  guint *interval_ms,
272  const pcmk_node_t *node,
273  const xmlNode *xml_op,
274  GHashTable *overrides,
275  bool calc_secure,
277 
278 void pe__free_digests(gpointer ptr);
279 
281  const xmlNode *xml_op,
282  pcmk_node_t *node,
284 
285 pcmk_action_t *pe_fence_op(pcmk_node_t *node, const char *op, bool optional,
286  const char *reason, bool priority_delay,
289  const char *reason, pcmk_action_t *dependency,
291 
293  enum pcmk__action_flags flag);
294 void pe_action_set_reason(pcmk_action_t *action, const char *reason,
295  bool overwrite);
296 void pe__add_action_expected_result(pcmk_action_t *action, int expected_result);
297 
301  uint64_t flag);
302 
303 int pe__rscs_brief_output(pcmk__output_t *out, GList *rsc_list, unsigned int options);
305  const char *reason, bool priority_delay);
306 
307 pcmk_node_t *pe_create_node(const char *id, const char *uname, const char *type,
308  int score, pcmk_scheduler_t *scheduler);
309 
311  const char *name, const pcmk_node_t *node,
312  unsigned int options);
314  const char *name, const pcmk_node_t *node,
315  unsigned int options);
316 
317 GList *pe__bundle_containers(const pcmk_resource_t *bundle);
318 
319 int pe__bundle_max(const pcmk_resource_t *rsc);
321  const pcmk_node_t *node);
326  bool (*fn)(pcmk__bundle_replica_t *, void *),
327  void *user_data);
329  bool (*fn)(const pcmk__bundle_replica_t *,
330  void *),
331  void *user_data);
333  const pcmk_node_t *node);
335 const char *pe__add_bundle_remote_name(pcmk_resource_t *rsc, xmlNode *xml,
336  const char *field);
338  const pcmk_scheduler_t *scheduler);
339 void pe__add_param_check(const xmlNode *rsc_op, pcmk_resource_t *rsc,
343  void (*cb)(pcmk_resource_t*, pcmk_node_t*,
344  const xmlNode*,
345  enum pcmk__check_parameters));
347 
348 bool pe__shutdown_requested(const pcmk_node_t *node);
350  const char *reason);
351 
359 
360 void pe__unpack_dataset_nvpairs(const xmlNode *xml_obj, const char *set_name,
361  const pe_rule_eval_data_t *rule_data,
362  GHashTable *hash, const char *always_first,
364 
367 
368 GList *pe__rscs_with_tag(pcmk_scheduler_t *scheduler, const char *tag_name);
369 GList *pe__unames_with_tag(pcmk_scheduler_t *scheduler, const char *tag_name);
370 bool pe__rsc_has_tag(pcmk_scheduler_t *scheduler, const char *rsc,
371  const char *tag);
372 bool pe__uname_has_tag(pcmk_scheduler_t *scheduler, const char *node,
373  const char *tag);
374 
376  const pcmk_node_t *node);
377 bool pe__rsc_running_on_any(pcmk_resource_t *rsc, GList *node_list);
378 GList *pe__filter_rsc_list(GList *rscs, GList *filter);
379 GList * pe__build_node_name_list(pcmk_scheduler_t *scheduler, const char *s);
380 GList * pe__build_rsc_list(pcmk_scheduler_t *scheduler, const char *s);
381 
382 bool pcmk__rsc_filtered_by_node(pcmk_resource_t *rsc, GList *only_node);
383 
384 gboolean pe__bundle_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc,
385  gboolean check_parent);
386 gboolean pe__clone_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc,
387  gboolean check_parent);
388 gboolean pe__group_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc,
389  gboolean check_parent);
390 gboolean pe__native_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc,
391  gboolean check_parent);
392 
393 xmlNode *pe__failed_probe_for_rsc(const pcmk_resource_t *rsc, const char *name);
394 
395 const char *pe__clone_child_id(const pcmk_resource_t *rsc);
396 
397 int pe__sum_node_health_scores(const pcmk_node_t *node, int base_health);
398 int pe__node_health(pcmk_node_t *node);
399 
400 static inline enum pcmk__health_strategy
401 pe__health_strategy(pcmk_scheduler_t *scheduler)
402 {
403  const char *strategy = pcmk__cluster_option(scheduler->priv->options,
405 
406  return pcmk__parse_health_strategy(strategy);
407 }
408 
409 #ifdef __cplusplus
410 }
411 #endif
412 
413 #endif // PCMK__CRM_PENGINE_INTERNAL__H
gboolean native_active(pcmk_resource_t *rsc, gboolean all)
Definition: native.c:346
char * pe__action2reason(const pcmk_action_t *action, enum pcmk__action_flags flag)
Definition: pe_actions.c:1543
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
Definition: complex.c:1043
void pe__count_bundle(pcmk_resource_t *rsc)
Definition: bundle.c:1906
bool pe_can_fence(const pcmk_scheduler_t *scheduler, const pcmk_node_t *node)
Definition: utils.c:36
pcmk__action_type
void pe__create_clone_notif_pseudo_ops(pcmk_resource_t *clone, pcmk_action_t *start, pcmk_action_t *started, pcmk_action_t *stop, pcmk_action_t *stopped)
Definition: clone.c:1216
bool pe__shutdown_requested(const pcmk_node_t *node)
Definition: utils.c:658
pcmk_node_t * pe__copy_node(const pcmk_node_t *this_node)
Definition: utils.c:91
void trigger_unfencing(pcmk_resource_t *rsc, pcmk_node_t *node, const char *reason, pcmk_action_t *dependency, pcmk_scheduler_t *scheduler)
Definition: utils.c:610
char data[0]
Definition: cpg.c:58
pcmk_action_t * get_pseudo_op(const char *name, pcmk_scheduler_t *scheduler)
Definition: pe_actions.c:1140
bool pe__is_universal_clone(const pcmk_resource_t *rsc, const pcmk_scheduler_t *scheduler)
Definition: clone.c:979
void pe__free_bundle(pcmk_resource_t *rsc)
Definition: bundle.c:1846
pcmk_resource_t * pe__find_bundle_replica(const pcmk_resource_t *bundle, const pcmk_node_t *node)
Definition: bundle.c:1369
gchar * pcmk__native_output_string(const pcmk_resource_t *rsc, const char *name, const pcmk_node_t *node, uint32_t show_opts, const char *target_role, bool show_nodes)
Definition: native.c:494
pcmk_node_t * pe__find_active_requires(const pcmk_resource_t *rsc, unsigned int *count)
Definition: complex.c:1217
const char * name
Definition: cib.c:26
enum pcmk_ipc_server type
Definition: cpg.c:51
gint pe__cmp_node_name(gconstpointer a, gconstpointer b)
Definition: utils.c:149
xmlNode * pe__failed_probe_for_rsc(const pcmk_resource_t *rsc, const char *name)
Definition: utils.c:882
pcmk__op_digest_t * rsc_action_digest_cmp(pcmk_resource_t *rsc, const xmlNode *xml_op, pcmk_node_t *node, pcmk_scheduler_t *scheduler)
Definition: pe_digest.c:392
int pe__target_rc_from_xml(const xmlNode *xml_op)
Definition: unpack.c:4277
void pe__foreach_bundle_replica(pcmk_resource_t *bundle, bool(*fn)(pcmk__bundle_replica_t *, void *), void *user_data)
Definition: bundle.c:207
const char * pe__add_bundle_remote_name(pcmk_resource_t *rsc, xmlNode *xml, const char *field)
Definition: bundle.c:908
gboolean get_target_role(const pcmk_resource_t *rsc, enum rsc_role_e *role)
Definition: utils.c:417
int pe__group_default(pcmk__output_t *out, va_list args)
const char * pe__resource_description(const pcmk_resource_t *rsc, uint32_t show_opts)
Definition: pe_output.c:22
GHashTable * pcmk__unpack_action_rsc_params(const xmlNode *action_xml, GHashTable *node_attrs, pcmk_scheduler_t *data_set)
Definition: pe_actions.c:247
pcmk_action_t * pe_fence_op(pcmk_node_t *node, const char *op, bool optional, const char *reason, bool priority_delay, pcmk_scheduler_t *scheduler)
Definition: pe_actions.c:1245
int pe__clone_max(const pcmk_resource_t *clone)
Definition: clone.c:56
pcmk__scheduler_private_t * priv
Definition: scheduler.h:99
void pe_action_set_reason(pcmk_action_t *action, const char *reason, bool overwrite)
Definition: pe_actions.c:1568
pcmk_node_t * pe_create_node(const char *id, const char *uname, const char *type, int score, pcmk_scheduler_t *scheduler)
Definition: unpack.c:444
int pe__clone_default(pcmk__output_t *out, va_list args)
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
Definition: pe_actions.c:1733
enum rsc_role_e native_resource_state(const pcmk_resource_t *rsc, gboolean current)
Definition: native.c:895
GList * pe__rscs_with_tag(pcmk_scheduler_t *scheduler, const char *tag_name)
Definition: tags.c:20
void pe_fence_node(pcmk_scheduler_t *scheduler, pcmk_node_t *node, const char *reason, bool priority_delay)
Schedule a fence action for a node.
Definition: unpack.c:114
pcmk__clone_flags
GList * pe__build_rsc_list(pcmk_scheduler_t *scheduler, const char *s)
Definition: utils.c:847
pcmk_action_t * pe__clear_failcount(pcmk_resource_t *rsc, const pcmk_node_t *node, const char *reason, pcmk_scheduler_t *scheduler)
Schedule a controller operation to clear a fail count.
Definition: failcounts.c:464
void pe__foreach_const_bundle_replica(const pcmk_resource_t *bundle, bool(*fn)(const pcmk__bundle_replica_t *, void *), void *user_data)
Definition: bundle.c:231
enum pcmk__health_strategy pcmk__parse_health_strategy(const char *value)
Definition: health.c:46
void pe__set_resource_flags_recursive(pcmk_resource_t *rsc, uint64_t flags)
Definition: utils.c:597
const char * pcmk__cluster_option(GHashTable *options, const char *name)
Definition: options.c:1400
GList * pe__resource_actions(const pcmk_resource_t *rsc, const pcmk_node_t *node, const char *task, bool require_node)
Find all actions of given type for a resource.
Definition: pe_actions.c:1517
enum rsc_role_e pcmk__role_after_failure(const pcmk_resource_t *rsc, const char *action_name, enum pcmk__on_fail on_fail, GHashTable *meta)
Definition: pe_actions.c:1012
enum pcmk__action_type get_complex_task(const pcmk_resource_t *rsc, const char *name)
Definition: pe_actions.c:1383
int pe__resource_text(pcmk__output_t *out, va_list args)
void pe__foreach_param_check(pcmk_scheduler_t *scheduler, void(*cb)(pcmk_resource_t *, pcmk_node_t *, const xmlNode *, enum pcmk__check_parameters))
Definition: remote.c:220
int pe__set_clone_flag(pcmk_resource_t *clone, enum pcmk__clone_flags flag)
Definition: clone.c:1060
int pe_get_failcount(const pcmk_node_t *node, pcmk_resource_t *rsc, time_t *last_failure, uint32_t flags, const xmlNode *xml_op)
Definition: failcounts.c:364
gboolean clone_unpack(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
Definition: clone.c:323
int pe__bundle_html(pcmk__output_t *out, va_list args)
const char * action
Definition: pcmk_fence.c:32
pcmk__on_fail
GList * pe__filter_rsc_list(GList *rscs, GList *filter)
Definition: utils.c:792
gboolean native_unpack(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
Definition: native.c:205
pcmk_node_t * native_location(const pcmk_resource_t *rsc, GList **list, uint32_t target)
Definition: native.c:918
gboolean group_unpack(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
Definition: group.c:184
pcmk_action_t * pe__new_rsc_pseudo_action(pcmk_resource_t *rsc, const char *task, bool optional, bool runnable)
Definition: pe_actions.c:1750
void pe__clear_resource_flags_on_all(pcmk_scheduler_t *scheduler, uint64_t flag)
Definition: utils.c:585
GList * find_actions_exact(GList *input, const char *key, const pcmk_node_t *on_node)
Definition: pe_actions.c:1479
void common_free(pcmk_resource_t *rsc)
Definition: complex.c:1060
Formatted output for pacemaker tools.
gboolean clone_active(pcmk_resource_t *rsc, gboolean all)
Definition: clone.c:442
void pe__set_next_role(pcmk_resource_t *rsc, enum rsc_role_e role, const char *why)
Definition: complex.c:1265
int pe__rscs_brief_output(pcmk__output_t *out, GList *rsc_list, unsigned int options)
int pe__bundle_text(pcmk__output_t *out, va_list args)
int pe__bundle_max(const pcmk_resource_t *rsc)
Definition: bundle.c:93
gboolean pe__bundle_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: bundle.c:1930
gboolean pe__clone_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: clone.c:993
const pcmk_resource_t * pe__get_rsc_in_container(const pcmk_resource_t *instance)
Definition: bundle.c:128
pcmk_resource_t * pe__last_group_member(const pcmk_resource_t *group)
Definition: group.c:37
int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name,...) G_GNUC_NULL_TERMINATED
Definition: pe_output.c:616
void resource_location(pcmk_resource_t *rsc, const pcmk_node_t *node, int score, const char *tag, pcmk_scheduler_t *scheduler)
Definition: utils.c:365
char * clone_strip(const char *last_rsc_id)
Definition: unpack.c:1945
void pe__free_param_checks(pcmk_scheduler_t *scheduler)
Definition: remote.c:236
pcmk__action_flags
pcmk__op_digest_t * pe__calculate_digests(pcmk_resource_t *rsc, const char *task, guint *interval_ms, const pcmk_node_t *node, const xmlNode *xml_op, GHashTable *overrides, bool calc_secure, pcmk_scheduler_t *scheduler)
Definition: pe_digest.c:303
int pe__clone_xml(pcmk__output_t *out, va_list args)
bool pe__rsc_running_on_any(pcmk_resource_t *rsc, GList *node_list)
Definition: utils.c:770
int pe__node_health(pcmk_node_t *node)
Definition: pe_health.c:130
enum rsc_role_e clone_resource_state(const pcmk_resource_t *rsc, gboolean current)
Definition: clone.c:951
bool pe__bundle_needs_remote_name(pcmk_resource_t *rsc)
Definition: bundle.c:890
void pe__create_promotable_pseudo_ops(pcmk_resource_t *clone, bool any_promoting, bool any_demoting)
Definition: clone.c:1103
GList * pe__unames_with_tag(pcmk_scheduler_t *scheduler, const char *tag_name)
Definition: tags.c:54
void pe__show_node_scores_as(const char *file, const char *function, int line, bool to_log, const pcmk_resource_t *rsc, const char *comment, GHashTable *nodes, pcmk_scheduler_t *scheduler)
Definition: utils.c:252
Wrappers for and extensions to libxml2.
rsc_role_e
Definition: roles.h:34
void group_free(pcmk_resource_t *rsc)
Definition: group.c:382
void native_free(pcmk_resource_t *rsc)
Definition: native.c:888
enum pcmk__requires pcmk__action_requires(const pcmk_resource_t *rsc, const char *action_name)
Definition: pe_actions.c:832
GHashTable * pe__node_list2table(const GList *list)
Definition: utils.c:119
enum rsc_role_e pe__bundle_resource_state(const pcmk_resource_t *rsc, gboolean current)
Definition: bundle.c:1880
GList * pe__build_node_name_list(pcmk_scheduler_t *scheduler, const char *s)
Definition: utils.c:814
bool pe__clone_flag_is_set(const pcmk_resource_t *clone, uint32_t flags)
Definition: clone.c:1084
void pe__free_digests(gpointer ptr)
Definition: pe_digest.c:33
void pe__register_messages(pcmk__output_t *out)
Definition: pe_output.c:3470
bool pe__rsc_has_tag(pcmk_scheduler_t *scheduler, const char *rsc, const char *tag)
Definition: tags.c:89
bool is_set_recursive(const pcmk_resource_t *rsc, long long flag, bool any)
Definition: clone.c:497
gboolean group_active(pcmk_resource_t *rsc, gboolean all)
Definition: group.c:235
int pe__clone_promoted_node_max(const pcmk_resource_t *clone)
Definition: clone.c:107
gboolean order_actions(pcmk_action_t *first, pcmk_action_t *then, uint32_t flags)
Definition: utils.c:465
int pe__clone_promoted_max(const pcmk_resource_t *clone)
Definition: clone.c:90
void pe__update_recheck_time(time_t recheck, pcmk_scheduler_t *scheduler, const char *reason)
Definition: utils.c:675
int pe__is_newer_op(const xmlNode *xml_a, const xmlNode *xml_b)
Definition: pe_actions.c:1612
void native_add_running(pcmk_resource_t *rsc, pcmk_node_t *node, pcmk_scheduler_t *scheduler, gboolean failed)
Definition: native.c:87
pcmk_action_t * custom_action(pcmk_resource_t *rsc, char *key, const char *task, const pcmk_node_t *on_node, gboolean optional, pcmk_scheduler_t *scheduler)
Create or update an action object.
Definition: pe_actions.c:1093
int pe__resource_xml(pcmk__output_t *out, va_list args)
A single instance of a bundle.
const char * target
Definition: pcmk_fence.c:31
void pe__add_action_expected_result(pcmk_action_t *action, int expected_result)
Definition: pe_actions.c:1776
#define PCMK_OPT_NODE_HEALTH_STRATEGY
Definition: options.h:51
char * native_parameter(pcmk_resource_t *rsc, pcmk_node_t *node, gboolean create, const char *name, pcmk_scheduler_t *scheduler)
Definition: native.c:326
pcmk_resource_t * native_find_rsc(pcmk_resource_t *rsc, const char *id, const pcmk_node_t *node, int flags)
Definition: native.c:270
pcmk__check_parameters
gboolean pe__native_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: native.c:1150
int pe__bundle_xml(pcmk__output_t *out, va_list args)
xmlNode * pcmk__find_action_config(const pcmk_resource_t *rsc, const char *action_name, guint interval_ms, bool include_disabled)
Definition: pe_actions.c:137
int pe__common_output_html(pcmk__output_t *out, const pcmk_resource_t *rsc, const char *name, const pcmk_node_t *node, unsigned int options)
Cluster status and scheduling.
gboolean pe__unpack_bundle(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
Definition: bundle.c:954
void pe__create_clone_notifications(pcmk_resource_t *clone)
Definition: clone.c:1167
int pe__node_text(pcmk__output_t *out, va_list args)
gboolean pe__bundle_active(pcmk_resource_t *rsc, gboolean all)
Definition: bundle.c:1321
void pe__clear_resource_flags_recursive(pcmk_resource_t *rsc, uint64_t flags)
Definition: utils.c:572
void pe__free_clone_notification_data(pcmk_resource_t *clone)
Definition: clone.c:1186
void pe__order_notifs_after_fencing(const pcmk_action_t *action, pcmk_resource_t *rsc, pcmk_action_t *stonith_op)
Definition: pe_notif.c:1000
pcmk_action_t * find_first_action(const GList *input, const char *uuid, const char *task, const pcmk_node_t *on_node)
Definition: pe_actions.c:1416
pcmk_scheduler_t * scheduler
int pe__common_output_text(pcmk__output_t *out, const pcmk_resource_t *rsc, const char *name, const pcmk_node_t *node, unsigned int options)
GList * find_actions(GList *input, const char *key, const pcmk_node_t *on_node)
Definition: pe_actions.c:1445
xmlNode * input
pcmk_resource_t * pe__first_container(const pcmk_resource_t *bundle)
Definition: bundle.c:184
char * clone_zero(const char *last_rsc_id)
Definition: unpack.c:1967
bool pcmk__rsc_filtered_by_node(pcmk_resource_t *rsc, GList *only_node)
Definition: utils.c:785
int pe__node_xml(pcmk__output_t *out, va_list args)
int pe__group_xml(pcmk__output_t *out, va_list args)
This structure contains everything that makes up a single output formatter.
bool pe__resource_is_disabled(const pcmk_resource_t *rsc)
Definition: utils.c:731
bool pe__uname_has_tag(pcmk_scheduler_t *scheduler, const char *node, const char *tag)
Definition: tags.c:105
void pe_free_action(pcmk_action_t *action)
Definition: pe_actions.c:1361
pcmk__health_strategy
char uname[MAX_NAME]
Definition: cpg.c:53
void pe__count_common(pcmk_resource_t *rsc)
Definition: complex.c:1234
char * pe__node_display_name(pcmk_node_t *node, bool print_detail)
Definition: pe_output.c:559
int pe__resource_html(pcmk__output_t *out, va_list args)
int pe__clone_node_max(const pcmk_resource_t *clone)
Definition: clone.c:73
void pe__clear_resource_history(pcmk_resource_t *rsc, const pcmk_node_t *node)
Definition: pe_actions.c:1594
void pe__unpack_dataset_nvpairs(const xmlNode *xml_obj, const char *set_name, const pe_rule_eval_data_t *rule_data, GHashTable *hash, const char *always_first, pcmk_scheduler_t *scheduler)
Definition: utils.c:701
void destroy_ticket(gpointer data)
Definition: utils.c:513
void clone_free(pcmk_resource_t *rsc)
Definition: clone.c:915
int pe__node_html(pcmk__output_t *out, va_list args)
pcmk_resource_t * pe__bundled_resource(const pcmk_resource_t *rsc)
Definition: bundle.c:110
enum rsc_role_e group_resource_state(const pcmk_resource_t *rsc, gboolean current)
Definition: group.c:405
pcmk__ticket_t * ticket_new(const char *ticket_id, pcmk_scheduler_t *scheduler)
Definition: utils.c:525
bool pe__count_active_node(const pcmk_resource_t *rsc, pcmk_node_t *node, pcmk_node_t **active, unsigned int *count_all, unsigned int *count_clean)
Definition: complex.c:1134
int pe__sum_node_health_scores(const pcmk_node_t *node, int base_health)
Definition: pe_health.c:110
enum pcmk__on_fail pcmk__parse_on_fail(const pcmk_resource_t *rsc, const char *action_name, guint interval_ms, const char *value)
Definition: pe_actions.c:870
bool pe__clone_is_ordered(const pcmk_resource_t *clone)
Definition: clone.c:1041
bool pe__rsc_running_on_only(const pcmk_resource_t *rsc, const pcmk_node_t *node)
Definition: utils.c:762
bool pe__group_flag_is_set(const pcmk_resource_t *group, uint32_t flags)
Definition: group.c:59
bool pe__node_is_bundle_instance(const pcmk_resource_t *bundle, const pcmk_node_t *node)
Definition: bundle.c:158
time_t get_effective_time(pcmk_scheduler_t *scheduler)
Definition: utils.c:402
gboolean pe__group_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: group.c:426
const char * pe_base_name_end(const char *id)
Definition: unpack.c:1905
const char * pe__clone_child_id(const pcmk_resource_t *rsc)
Definition: clone.c:1025
void pe__add_param_check(const xmlNode *rsc_op, pcmk_resource_t *rsc, pcmk_node_t *node, enum pcmk__check_parameters, pcmk_scheduler_t *scheduler)
Definition: remote.c:192
GList * pe__bundle_containers(const pcmk_resource_t *bundle)
Definition: bundle.c:1985
GHashTable * pcmk__unpack_action_meta(pcmk_resource_t *rsc, const pcmk_node_t *node, const char *action_name, guint interval_ms, const xmlNode *action_config)
Definition: pe_actions.c:682
pcmk__requires
uint64_t flags
Definition: remote.c:211