pacemaker  2.1.9-49aab99839
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 PE_INTERNAL__H
11 # define PE_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 const char *pe__resource_description(const pcmk_resource_t *rsc,
25  uint32_t show_opts);
26 
27 bool pe__clone_is_ordered(const pcmk_resource_t *clone);
29 bool pe__clone_flag_is_set(const pcmk_resource_t *clone, uint32_t flags);
30 
31 bool pe__group_flag_is_set(const pcmk_resource_t *group, uint32_t flags);
33 
35  bool include_bundle);
36 
37 int pe__clone_max(const pcmk_resource_t *clone);
38 int pe__clone_node_max(const pcmk_resource_t *clone);
39 int pe__clone_promoted_max(const pcmk_resource_t *clone);
44  pcmk_action_t *start,
45  pcmk_action_t *started,
46  pcmk_action_t *stop,
47  pcmk_action_t *stopped);
48 
50  bool optional, bool runnable);
51 
53  bool any_promoting, bool any_demoting);
54 
55 bool pe_can_fence(const pcmk_scheduler_t *scheduler, const pcmk_node_t *node);
56 
57 char *native_parameter(pcmk_resource_t *rsc, pcmk_node_t *node, gboolean create,
58  const char *name, pcmk_scheduler_t *scheduler);
59 pcmk_node_t *native_location(const pcmk_resource_t *rsc, GList **list,
60  int current);
62  pcmk_scheduler_t *scheduler, gboolean failed);
63 
68 
69 pcmk_resource_t *native_find_rsc(pcmk_resource_t *rsc, const char *id,
70  const pcmk_node_t *node, int flags);
71 
72 gboolean native_active(pcmk_resource_t *rsc, gboolean all);
73 gboolean group_active(pcmk_resource_t *rsc, gboolean all);
74 gboolean clone_active(pcmk_resource_t *rsc, gboolean all);
75 gboolean pe__bundle_active(pcmk_resource_t *rsc, gboolean all);
76 
78 void native_print(pcmk_resource_t *rsc, const char *pre_text, long options,
79  void *print_data);
80 
82 void group_print(pcmk_resource_t *rsc, const char *pre_text, long options,
83  void *print_data);
84 
86 void clone_print(pcmk_resource_t *rsc, const char *pre_text, long options,
87  void *print_data);
88 
90 void pe__print_bundle(pcmk_resource_t *rsc, const char *pre_text, long options,
91  void *print_data);
92 
93 gchar *pcmk__native_output_string(const pcmk_resource_t *rsc, const char *name,
94  const pcmk_node_t *node, uint32_t show_opts,
95  const char *target_role, bool show_nodes);
96 
97 int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name,
98  ...) G_GNUC_NULL_TERMINATED;
99 char *pe__node_display_name(pcmk_node_t *node, bool print_detail);
100 
101 
102 // Clone notifications (pe_notif.c)
104  pcmk_resource_t *rsc,
105  pcmk_action_t *stonith_op);
106 
107 
108 // Resource output methods
109 int pe__clone_xml(pcmk__output_t *out, va_list args);
110 int pe__clone_default(pcmk__output_t *out, va_list args);
111 int pe__group_xml(pcmk__output_t *out, va_list args);
112 int pe__group_default(pcmk__output_t *out, va_list args);
113 int pe__bundle_xml(pcmk__output_t *out, va_list args);
114 int pe__bundle_html(pcmk__output_t *out, va_list args);
115 int pe__bundle_text(pcmk__output_t *out, va_list args);
116 int pe__node_html(pcmk__output_t *out, va_list args);
117 int pe__node_text(pcmk__output_t *out, va_list args);
118 int pe__node_xml(pcmk__output_t *out, va_list args);
119 int pe__resource_xml(pcmk__output_t *out, va_list args);
120 int pe__resource_html(pcmk__output_t *out, va_list args);
121 int pe__resource_text(pcmk__output_t *out, va_list args);
122 
123 void native_free(pcmk_resource_t *rsc);
124 void group_free(pcmk_resource_t *rsc);
125 void clone_free(pcmk_resource_t *rsc);
127 
129  gboolean current);
131  gboolean current);
133  gboolean current);
135  gboolean current);
136 
139 
140 void common_free(pcmk_resource_t *rsc);
141 
142 pcmk_node_t *pe__copy_node(const pcmk_node_t *this_node);
144 
145 /* Failure handling utilities (from failcounts.c) */
146 
147 int pe_get_failcount(const pcmk_node_t *node, pcmk_resource_t *rsc,
148  time_t *last_failure, uint32_t flags,
149  const xmlNode *xml_op);
150 
152  const pcmk_node_t *node, const char *reason,
154 
155 /* Functions for finding/counting a resource's active nodes */
156 
157 bool pe__count_active_node(const pcmk_resource_t *rsc, pcmk_node_t *node,
158  pcmk_node_t **active, unsigned int *count_all,
159  unsigned int *count_clean);
160 
162  unsigned int *count);
163 
164 /* Binary like operators for lists of nodes */
165 GHashTable *pe__node_list2table(const GList *list);
166 
168 gboolean order_actions(pcmk_action_t *first, pcmk_action_t *then,
169  uint32_t flags);
170 
171 void pe__show_node_scores_as(const char *file, const char *function,
172  int line, bool to_log, const pcmk_resource_t *rsc,
173  const char *comment, GHashTable *nodes,
175 
176 #define pe__show_node_scores(level, rsc, text, nodes, scheduler) \
177  pe__show_node_scores_as(__FILE__, __func__, __LINE__, \
178  (level), (rsc), (text), (nodes), (scheduler))
179 
181  const pcmk_node_t *node,
182  const char *action_name, guint interval_ms,
183  const xmlNode *action_config);
184 GHashTable *pcmk__unpack_action_rsc_params(const xmlNode *action_xml,
185  GHashTable *node_attrs,
186  pcmk_scheduler_t *data_set);
187 xmlNode *pcmk__find_action_config(const pcmk_resource_t *rsc,
188  const char *action_name, guint interval_ms,
189  bool include_disabled);
190 
192  const char *action_name);
193 
195  const char *action_name,
196  guint interval_ms,
197  const char *value);
198 
200  const char *action_name,
201  enum action_fail_response on_fail,
202  GHashTable *meta);
203 
204 pcmk_action_t *custom_action(pcmk_resource_t *rsc, char *key, const char *task,
205  const pcmk_node_t *on_node, gboolean optional,
207 
208 # define delete_key(rsc) pcmk__op_key(rsc->id, PCMK_ACTION_DELETE, 0)
209 # define delete_action(rsc, node, optional) custom_action( \
210  rsc, delete_key(rsc), PCMK_ACTION_DELETE, node, \
211  optional, rsc->cluster);
212 
213 # define stop_key(rsc) pcmk__op_key(rsc->id, PCMK_ACTION_STOP, 0)
214 # define stop_action(rsc, node, optional) custom_action( \
215  rsc, stop_key(rsc), PCMK_ACTION_STOP, node, \
216  optional, rsc->cluster);
217 
218 # define reload_key(rsc) pcmk__op_key(rsc->id, PCMK_ACTION_RELOAD_AGENT, 0)
219 # define start_key(rsc) pcmk__op_key(rsc->id, PCMK_ACTION_START, 0)
220 # define start_action(rsc, node, optional) custom_action( \
221  rsc, start_key(rsc), PCMK_ACTION_START, node, \
222  optional, rsc->cluster)
223 
224 # define promote_key(rsc) pcmk__op_key(rsc->id, PCMK_ACTION_PROMOTE, 0)
225 # define promote_action(rsc, node, optional) custom_action( \
226  rsc, promote_key(rsc), PCMK_ACTION_PROMOTE, node, \
227  optional, rsc->cluster)
228 
229 # define demote_key(rsc) pcmk__op_key(rsc->id, PCMK_ACTION_DEMOTE, 0)
230 # define demote_action(rsc, node, optional) custom_action( \
231  rsc, demote_key(rsc), PCMK_ACTION_DEMOTE, node, \
232  optional, rsc->cluster)
233 
234 pcmk_action_t *find_first_action(const GList *input, const char *uuid,
235  const char *task, const pcmk_node_t *on_node);
236 
238  const char *name);
239 
240 GList *find_actions(GList *input, const char *key, const pcmk_node_t *on_node);
241 GList *find_actions_exact(GList *input, const char *key,
242  const pcmk_node_t *on_node);
243 GList *pe__resource_actions(const pcmk_resource_t *rsc, const pcmk_node_t *node,
244  const char *task, bool require_node);
245 
246 extern void pe_free_action(pcmk_action_t *action);
247 
248 void resource_location(pcmk_resource_t *rsc, const pcmk_node_t *node, int score,
249  const char *tag, pcmk_scheduler_t *scheduler);
250 
251 extern int pe__is_newer_op(const xmlNode *xml_a, const xmlNode *xml_b,
252  bool same_node_default);
253 extern gint sort_op_by_callid(gconstpointer a, gconstpointer b);
254 gboolean get_target_role(const pcmk_resource_t *rsc, enum rsc_role_e *role);
255 void pe__set_next_role(pcmk_resource_t *rsc, enum rsc_role_e role,
256  const char *why);
257 
259  const char *sub_id);
260 
261 extern void destroy_ticket(gpointer data);
262 pcmk_ticket_t *ticket_new(const char *ticket_id, pcmk_scheduler_t *scheduler);
263 
264 // Resources for manipulating resource names
265 const char *pe_base_name_end(const char *id);
266 char *clone_strip(const char *last_rsc_id);
267 char *clone_zero(const char *last_rsc_id);
268 
269 static inline bool
270 pe_base_name_eq(const pcmk_resource_t *rsc, const char *id)
271 {
272  if (id && rsc && rsc->id) {
273  // Number of characters in rsc->id before any clone suffix
274  size_t base_len = pe_base_name_end(rsc->id) - rsc->id + 1;
275 
276  return (strlen(id) == base_len) && !strncmp(id, rsc->id, base_len);
277  }
278  return false;
279 }
280 
281 int pe__target_rc_from_xml(const xmlNode *xml_op);
282 
283 gint pe__cmp_node_name(gconstpointer a, gconstpointer b);
284 bool is_set_recursive(const pcmk_resource_t *rsc, long long flag, bool any);
285 
287  guint *interval_ms,
288  const pcmk_node_t *node,
289  const xmlNode *xml_op,
290  GHashTable *overrides,
291  bool calc_secure,
293 
294 void pe__free_digests(gpointer ptr);
295 
297  const xmlNode *xml_op,
298  pcmk_node_t *node,
300 
301 pcmk_action_t *pe_fence_op(pcmk_node_t *node, const char *op, bool optional,
302  const char *reason, bool priority_delay,
305  const char *reason, pcmk_action_t *dependency,
307 
308 char *pe__action2reason(const pcmk_action_t *action, enum pe_action_flags flag);
309 void pe_action_set_reason(pcmk_action_t *action, const char *reason,
310  bool overwrite);
311 void pe__add_action_expected_result(pcmk_action_t *action, int expected_result);
312 
316  uint64_t flag);
317 
318 gboolean add_tag_ref(GHashTable * tags, const char * tag_name, const char * obj_ref);
319 
321 void print_rscs_brief(GList *rsc_list, const char * pre_text, long options,
322  void * print_data, gboolean print_all);
323 int pe__rscs_brief_output(pcmk__output_t *out, GList *rsc_list, unsigned int options);
325  const char *reason, bool priority_delay);
326 
327 pcmk_node_t *pe_create_node(const char *id, const char *uname, const char *type,
328  int score, pcmk_scheduler_t *scheduler);
329 
331 void common_print(pcmk_resource_t *rsc, const char *pre_text, const char *name,
332  const pcmk_node_t *node, long options, void *print_data);
334  const char *name, const pcmk_node_t *node,
335  unsigned int options);
337  const char *name, const pcmk_node_t *node,
338  unsigned int options);
339 
340 GList *pe__bundle_containers(const pcmk_resource_t *bundle);
341 
342 int pe__bundle_max(const pcmk_resource_t *rsc);
344  const pcmk_node_t *node);
349  bool (*fn)(pcmk__bundle_replica_t *, void *),
350  void *user_data);
352  bool (*fn)(const pcmk__bundle_replica_t *,
353  void *),
354  void *user_data);
356  const pcmk_node_t *node);
358 const char *pe__add_bundle_remote_name(pcmk_resource_t *rsc, xmlNode *xml,
359  const char *field);
361  const pcmk_scheduler_t *scheduler);
362 void pe__add_param_check(const xmlNode *rsc_op, pcmk_resource_t *rsc,
366  void (*cb)(pcmk_resource_t*, pcmk_node_t*,
367  const xmlNode*,
368  enum pcmk__check_parameters));
370 
371 bool pe__shutdown_requested(const pcmk_node_t *node);
373  const char *reason);
374 
382 
383 void pe__unpack_dataset_nvpairs(const xmlNode *xml_obj, const char *set_name,
384  const pe_rule_eval_data_t *rule_data,
385  GHashTable *hash, const char *always_first,
386  gboolean overwrite,
388 
391 
392 GList *pe__rscs_with_tag(pcmk_scheduler_t *scheduler, const char *tag_name);
393 GList *pe__unames_with_tag(pcmk_scheduler_t *scheduler, const char *tag_name);
394 bool pe__rsc_has_tag(pcmk_scheduler_t *scheduler, const char *rsc,
395  const char *tag);
396 bool pe__uname_has_tag(pcmk_scheduler_t *scheduler, const char *node,
397  const char *tag);
398 
400  const pcmk_node_t *node);
401 bool pe__rsc_running_on_any(pcmk_resource_t *rsc, GList *node_list);
402 GList *pe__filter_rsc_list(GList *rscs, GList *filter);
403 GList * pe__build_node_name_list(pcmk_scheduler_t *scheduler, const char *s);
404 GList * pe__build_rsc_list(pcmk_scheduler_t *scheduler, const char *s);
405 
406 bool pcmk__rsc_filtered_by_node(pcmk_resource_t *rsc, GList *only_node);
407 
408 gboolean pe__bundle_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc,
409  gboolean check_parent);
410 gboolean pe__clone_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc,
411  gboolean check_parent);
412 gboolean pe__group_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc,
413  gboolean check_parent);
414 gboolean pe__native_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc,
415  gboolean check_parent);
416 
417 xmlNode *pe__failed_probe_for_rsc(const pcmk_resource_t *rsc, const char *name);
418 
419 const char *pe__clone_child_id(const pcmk_resource_t *rsc);
420 
421 int pe__sum_node_health_scores(const pcmk_node_t *node, int base_health);
422 int pe__node_health(pcmk_node_t *node);
423 
424 static inline enum pcmk__health_strategy
425 pe__health_strategy(pcmk_scheduler_t *scheduler)
426 {
427  const char *strategy = pcmk__cluster_option(scheduler->config_hash,
429 
430  return pcmk__parse_health_strategy(strategy);
431 }
432 
433 #endif
gboolean native_active(pcmk_resource_t *rsc, gboolean all)
Definition: native.c:345
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
Definition: complex.c:1071
void pe__count_bundle(pcmk_resource_t *rsc)
Definition: bundle.c:2101
bool pe_can_fence(const pcmk_scheduler_t *scheduler, const pcmk_node_t *node)
Definition: utils.c:36
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:1519
bool pe__shutdown_requested(const pcmk_node_t *node)
Definition: utils.c:677
pcmk_ticket_t * ticket_new(const char *ticket_id, pcmk_scheduler_t *scheduler)
Definition: utils.c:517
pcmk_node_t * pe__copy_node(const pcmk_node_t *this_node)
Definition: utils.c:89
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:591
char data[0]
Definition: cpg.c:58
pcmk_action_t * get_pseudo_op(const char *name, pcmk_scheduler_t *scheduler)
Definition: pe_actions.c:1177
bool pe__is_universal_clone(const pcmk_resource_t *rsc, const pcmk_scheduler_t *scheduler)
Definition: clone.c:1283
void pe__free_bundle(pcmk_resource_t *rsc)
Definition: bundle.c:2041
pcmk_resource_t * pe__find_bundle_replica(const pcmk_resource_t *bundle, const pcmk_node_t *node)
Definition: bundle.c:1402
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:559
pcmk_node_t * pe__find_active_requires(const pcmk_resource_t *rsc, unsigned int *count)
Definition: complex.c:1247
const char * name
Definition: cib.c:26
gint pe__cmp_node_name(gconstpointer a, gconstpointer b)
Definition: utils.c:145
xmlNode * pe__failed_probe_for_rsc(const pcmk_resource_t *rsc, const char *name)
Definition: utils.c:883
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:394
int pe__target_rc_from_xml(const xmlNode *xml_op)
Definition: unpack.c:4418
void pe__foreach_bundle_replica(pcmk_resource_t *bundle, bool(*fn)(pcmk__bundle_replica_t *, void *), void *user_data)
Definition: bundle.c:208
const char * pe__add_bundle_remote_name(pcmk_resource_t *rsc, xmlNode *xml, const char *field)
Definition: bundle.c:938
gboolean get_target_role(const pcmk_resource_t *rsc, enum rsc_role_e *role)
Definition: utils.c:410
int pe__is_newer_op(const xmlNode *xml_a, const xmlNode *xml_b, bool same_node_default)
Definition: pe_actions.c:1648
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
void common_print(pcmk_resource_t *rsc, const char *pre_text, const char *name, const pcmk_node_t *node, long options, void *print_data)
Definition: native.c:819
GHashTable * pcmk__unpack_action_rsc_params(const xmlNode *action_xml, GHashTable *node_attrs, pcmk_scheduler_t *data_set)
Definition: pe_actions.c:241
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:1281
int pe__clone_max(const pcmk_resource_t *clone)
Definition: clone.c:63
void pe_action_set_reason(pcmk_action_t *action, const char *reason, bool overwrite)
Definition: pe_actions.c:1604
pcmk_node_t * pe_create_node(const char *id, const char *uname, const char *type, int score, pcmk_scheduler_t *scheduler)
Definition: unpack.c:470
int pe__clone_default(pcmk__output_t *out, va_list args)
void print_rscs_brief(GList *rsc_list, const char *pre_text, long options, void *print_data, gboolean print_all)
Definition: native.c:1271
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
Definition: pe_actions.c:1784
enum rsc_role_e native_resource_state(const pcmk_resource_t *rsc, gboolean current)
Definition: native.c:1111
action_tasks
Definition: actions.h:83
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:112
action_fail_response
Definition: actions.h:130
pcmk__clone_flags
GList * pe__build_rsc_list(pcmk_scheduler_t *scheduler, const char *s)
Definition: utils.c:848
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:470
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:232
enum crm_ais_msg_types type
Definition: cpg.c:51
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:581
const char * pcmk__cluster_option(GHashTable *options, const char *name)
Definition: options.c:1419
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:1553
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:216
int pe__set_clone_flag(pcmk_resource_t *clone, enum pcmk__clone_flags flag)
Definition: clone.c:1363
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:373
gboolean clone_unpack(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
Definition: clone.c:348
int pe__bundle_html(pcmk__output_t *out, va_list args)
const char * action
Definition: pcmk_fence.c:30
rsc_start_requirement
Definition: resources.h:52
GList * pe__filter_rsc_list(GList *rscs, GList *filter)
Definition: utils.c:795
gboolean native_unpack(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
Definition: native.c:204
void pe__print_bundle(pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: bundle.c:1939
gboolean group_unpack(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
Definition: group.c:180
pcmk_action_t * pe__new_rsc_pseudo_action(pcmk_resource_t *rsc, const char *task, bool optional, bool runnable)
Definition: pe_actions.c:1804
void pe__clear_resource_flags_on_all(pcmk_scheduler_t *scheduler, uint64_t flag)
Definition: utils.c:572
GList * find_actions_exact(GList *input, const char *key, const pcmk_node_t *on_node)
Definition: pe_actions.c:1514
void common_free(pcmk_resource_t *rsc)
Definition: complex.c:1088
Formatted output for pacemaker tools.
gboolean clone_active(pcmk_resource_t *rsc, gboolean all)
Definition: clone.c:465
void pe__set_next_role(pcmk_resource_t *rsc, enum rsc_role_e role, const char *why)
Definition: complex.c:1292
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:94
gboolean pe__bundle_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: bundle.c:2125
gboolean pe__clone_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: clone.c:1297
const pcmk_resource_t * pe__get_rsc_in_container(const pcmk_resource_t *instance)
Definition: bundle.c:129
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:611
void resource_location(pcmk_resource_t *rsc, const pcmk_node_t *node, int score, const char *tag, pcmk_scheduler_t *scheduler)
Definition: utils.c:359
char * clone_strip(const char *last_rsc_id)
Definition: unpack.c:1988
void pe__free_param_checks(pcmk_scheduler_t *scheduler)
Definition: remote.c:232
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:306
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:775
int pe__node_health(pcmk_node_t *node)
Definition: pe_health.c:130
enum rsc_start_requirement pcmk__action_requires(const pcmk_resource_t *rsc, const char *action_name)
Definition: pe_actions.c:852
enum rsc_role_e clone_resource_state(const pcmk_resource_t *rsc, gboolean current)
Definition: clone.c:1257
bool pe__bundle_needs_remote_name(pcmk_resource_t *rsc)
Definition: bundle.c:920
void pe__create_promotable_pseudo_ops(pcmk_resource_t *clone, bool any_promoting, bool any_demoting)
Definition: clone.c:1406
GList * pe__unames_with_tag(pcmk_scheduler_t *scheduler, const char *tag_name)
Definition: tags.c:52
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:249
Wrappers for and extensions to libxml2.
GHashTable * config_hash
Definition: scheduler.h:219
rsc_role_e
Definition: roles.h:34
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
Definition: utils.c:627
void group_free(pcmk_resource_t *rsc)
Definition: group.c:458
void native_free(pcmk_resource_t *rsc)
Definition: native.c:1104
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, gboolean overwrite, pcmk_scheduler_t *scheduler)
Definition: utils.c:719
GHashTable * pe__node_list2table(const GList *list)
Definition: utils.c:115
enum rsc_role_e pe__bundle_resource_state(const pcmk_resource_t *rsc, gboolean current)
Definition: bundle.c:2075
pe_action_flags
Definition: actions.h:199
void group_print(pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: group.c:290
GList * pe__build_node_name_list(pcmk_scheduler_t *scheduler, const char *s)
Definition: utils.c:815
bool pe__clone_flag_is_set(const pcmk_resource_t *clone, uint32_t flags)
Definition: clone.c:1387
void pe__free_digests(gpointer ptr)
Definition: pe_digest.c:33
void pe__register_messages(pcmk__output_t *out)
Definition: pe_output.c:3451
bool pe__rsc_has_tag(pcmk_scheduler_t *scheduler, const char *rsc, const char *tag)
Definition: tags.c:85
bool is_set_recursive(const pcmk_resource_t *rsc, long long flag, bool any)
Definition: clone.c:588
gboolean group_active(pcmk_resource_t *rsc, gboolean all)
Definition: group.c:236
int pe__clone_promoted_node_max(const pcmk_resource_t *clone)
Definition: clone.c:114
gboolean order_actions(pcmk_action_t *first, pcmk_action_t *then, uint32_t flags)
Definition: utils.c:457
int pe__clone_promoted_max(const pcmk_resource_t *clone)
Definition: clone.c:97
void pe__update_recheck_time(time_t recheck, pcmk_scheduler_t *scheduler, const char *reason)
Definition: utils.c:694
void native_add_running(pcmk_resource_t *rsc, pcmk_node_t *node, pcmk_scheduler_t *scheduler, gboolean failed)
Definition: native.c:91
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:1129
int pe__resource_xml(pcmk__output_t *out, va_list args)
A single instance of a bundle.
void pe__add_action_expected_result(pcmk_action_t *action, int expected_result)
Definition: pe_actions.c:1830
#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:325
pcmk_resource_t * native_find_rsc(pcmk_resource_t *rsc, const char *id, const pcmk_node_t *node, int flags)
Definition: native.c:271
pcmk__check_parameters
gboolean pe__native_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: native.c:1443
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:132
void clone_print(pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: clone.c:623
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:984
void pe__create_clone_notifications(pcmk_resource_t *clone)
Definition: clone.c:1470
int pe__node_text(pcmk__output_t *out, va_list args)
gboolean pe__bundle_active(pcmk_resource_t *rsc, gboolean all)
Definition: bundle.c:1354
void pe__clear_resource_flags_recursive(pcmk_resource_t *rsc, uint64_t flags)
Definition: utils.c:562
void pe__free_clone_notification_data(pcmk_resource_t *clone)
Definition: clone.c:1489
void pe__order_notifs_after_fencing(const pcmk_action_t *action, pcmk_resource_t *rsc, pcmk_action_t *stonith_op)
Definition: pe_notif.c:988
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:1451
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:1480
xmlNode * input
pcmk_resource_t * pe__first_container(const pcmk_resource_t *bundle)
Definition: bundle.c:185
char * clone_zero(const char *last_rsc_id)
Definition: unpack.c:2010
bool pcmk__rsc_filtered_by_node(pcmk_resource_t *rsc, GList *only_node)
Definition: utils.c:789
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:737
bool pe__uname_has_tag(pcmk_scheduler_t *scheduler, const char *node, const char *tag)
Definition: tags.c:101
void pe_free_action(pcmk_action_t *action)
Definition: pe_actions.c:1396
pcmk__health_strategy
char uname[MAX_NAME]
Definition: cpg.c:53
void pe__count_common(pcmk_resource_t *rsc)
Definition: complex.c:1264
char * pe__node_display_name(pcmk_node_t *node, bool print_detail)
Definition: pe_output.c:558
int pe__resource_html(pcmk__output_t *out, va_list args)
int pe__clone_node_max(const pcmk_resource_t *clone)
Definition: clone.c:80
void pe__clear_resource_history(pcmk_resource_t *rsc, const pcmk_node_t *node)
Definition: pe_actions.c:1630
void destroy_ticket(gpointer data)
Definition: utils.c:505
void clone_free(pcmk_resource_t *rsc)
Definition: clone.c:1223
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:111
enum rsc_role_e group_resource_state(const pcmk_resource_t *rsc, gboolean current)
Definition: group.c:479
enum action_fail_response pcmk__parse_on_fail(const pcmk_resource_t *rsc, const char *action_name, guint interval_ms, const char *value)
Definition: pe_actions.c:890
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:1166
int pe__sum_node_health_scores(const pcmk_node_t *node, int base_health)
Definition: pe_health.c:110
bool pe__clone_is_ordered(const pcmk_resource_t *clone)
Definition: clone.c:1344
pcmk_node_t * native_location(const pcmk_resource_t *rsc, GList **list, int current)
Definition: native.c:1134
bool pe__rsc_running_on_only(const pcmk_resource_t *rsc, const pcmk_node_t *node)
Definition: utils.c:767
pcmk_resource_t * find_clone_instance(const pcmk_resource_t *rsc, const char *sub_id)
Definition: clone.c:229
bool pe__group_flag_is_set(const pcmk_resource_t *group, uint32_t flags)
Definition: group.c:57
char * pe__action2reason(const pcmk_action_t *action, enum pe_action_flags flag)
Definition: pe_actions.c:1579
enum rsc_role_e pcmk__role_after_failure(const pcmk_resource_t *rsc, const char *action_name, enum action_fail_response on_fail, GHashTable *meta)
Definition: pe_actions.c:1031
bool pe__node_is_bundle_instance(const pcmk_resource_t *bundle, const pcmk_node_t *node)
Definition: bundle.c:159
enum action_tasks get_complex_task(const pcmk_resource_t *rsc, const char *name)
Definition: pe_actions.c:1418
time_t get_effective_time(pcmk_scheduler_t *scheduler)
Definition: utils.c:395
gboolean pe__group_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: group.c:498
const char * pe_base_name_end(const char *id)
Definition: unpack.c:1948
const char * pe__clone_child_id(const pcmk_resource_t *rsc)
Definition: clone.c:1328
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:189
GList * pe__bundle_containers(const pcmk_resource_t *bundle)
Definition: bundle.c:2169
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:702
uint64_t flags
Definition: remote.c:215
void native_print(pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: native.c:939