pacemaker  2.1.4-dc6eb4362
Scalable High-Availability cluster resource manager
internal.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2022 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 # include <stdint.h>
13 # include <string.h>
14 # include <crm/pengine/status.h>
16 # include <crm/common/internal.h>
19 
20 # define pe_rsc_info(rsc, fmt, args...) crm_log_tag(LOG_INFO, rsc ? rsc->id : "<NULL>", fmt, ##args)
21 # define pe_rsc_debug(rsc, fmt, args...) crm_log_tag(LOG_DEBUG, rsc ? rsc->id : "<NULL>", fmt, ##args)
22 # define pe_rsc_trace(rsc, fmt, args...) crm_log_tag(LOG_TRACE, rsc ? rsc->id : "<NULL>", fmt, ##args)
23 
24 # define pe_err(fmt...) do { \
25  was_processing_error = TRUE; \
26  pcmk__config_err(fmt); \
27  } while (0)
28 
29 # define pe_warn(fmt...) do { \
30  was_processing_warning = TRUE; \
31  pcmk__config_warn(fmt); \
32  } while (0)
33 
34 # define pe_proc_err(fmt...) { was_processing_error = TRUE; crm_err(fmt); }
35 # define pe_proc_warn(fmt...) { was_processing_warning = TRUE; crm_warn(fmt); }
36 
37 #define pe__set_working_set_flags(working_set, flags_to_set) do { \
38  (working_set)->flags = pcmk__set_flags_as(__func__, __LINE__, \
39  LOG_TRACE, "Working set", crm_system_name, \
40  (working_set)->flags, (flags_to_set), #flags_to_set); \
41  } while (0)
42 
43 #define pe__clear_working_set_flags(working_set, flags_to_clear) do { \
44  (working_set)->flags = pcmk__clear_flags_as(__func__, __LINE__, \
45  LOG_TRACE, "Working set", crm_system_name, \
46  (working_set)->flags, (flags_to_clear), #flags_to_clear); \
47  } while (0)
48 
49 #define pe__set_resource_flags(resource, flags_to_set) do { \
50  (resource)->flags = pcmk__set_flags_as(__func__, __LINE__, \
51  LOG_TRACE, "Resource", (resource)->id, (resource)->flags, \
52  (flags_to_set), #flags_to_set); \
53  } while (0)
54 
55 #define pe__clear_resource_flags(resource, flags_to_clear) do { \
56  (resource)->flags = pcmk__clear_flags_as(__func__, __LINE__, \
57  LOG_TRACE, "Resource", (resource)->id, (resource)->flags, \
58  (flags_to_clear), #flags_to_clear); \
59  } while (0)
60 
61 #define pe__set_action_flags(action, flags_to_set) do { \
62  (action)->flags = pcmk__set_flags_as(__func__, __LINE__, \
63  LOG_TRACE, \
64  "Action", (action)->uuid, \
65  (action)->flags, \
66  (flags_to_set), \
67  #flags_to_set); \
68  } while (0)
69 
70 #define pe__clear_action_flags(action, flags_to_clear) do { \
71  (action)->flags = pcmk__clear_flags_as(__func__, __LINE__, \
72  LOG_TRACE, \
73  "Action", (action)->uuid, \
74  (action)->flags, \
75  (flags_to_clear), \
76  #flags_to_clear); \
77  } while (0)
78 
79 #define pe__set_raw_action_flags(action_flags, action_name, flags_to_set) do { \
80  action_flags = pcmk__set_flags_as(__func__, __LINE__, \
81  LOG_TRACE, "Action", action_name, \
82  (action_flags), \
83  (flags_to_set), #flags_to_set); \
84  } while (0)
85 
86 #define pe__clear_raw_action_flags(action_flags, action_name, flags_to_clear) do { \
87  action_flags = pcmk__clear_flags_as(__func__, __LINE__, \
88  LOG_TRACE, \
89  "Action", action_name, \
90  (action_flags), \
91  (flags_to_clear), \
92  #flags_to_clear); \
93  } while (0)
94 
95 #define pe__set_action_flags_as(function, line, action, flags_to_set) do { \
96  (action)->flags = pcmk__set_flags_as((function), (line), \
97  LOG_TRACE, \
98  "Action", (action)->uuid, \
99  (action)->flags, \
100  (flags_to_set), \
101  #flags_to_set); \
102  } while (0)
103 
104 #define pe__clear_action_flags_as(function, line, action, flags_to_clear) do { \
105  (action)->flags = pcmk__clear_flags_as((function), (line), \
106  LOG_TRACE, \
107  "Action", (action)->uuid, \
108  (action)->flags, \
109  (flags_to_clear), \
110  #flags_to_clear); \
111  } while (0)
112 
113 #define pe__set_order_flags(order_flags, flags_to_set) do { \
114  order_flags = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \
115  "Ordering", "constraint", \
116  order_flags, (flags_to_set), \
117  #flags_to_set); \
118  } while (0)
119 
120 #define pe__clear_order_flags(order_flags, flags_to_clear) do { \
121  order_flags = pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, \
122  "Ordering", "constraint", \
123  order_flags, (flags_to_clear), \
124  #flags_to_clear); \
125  } while (0)
126 
127 #define pe__set_graph_flags(graph_flags, gr_action, flags_to_set) do { \
128  graph_flags = pcmk__set_flags_as(__func__, __LINE__, \
129  LOG_TRACE, "Graph", \
130  (gr_action)->uuid, graph_flags, \
131  (flags_to_set), #flags_to_set); \
132  } while (0)
133 
134 #define pe__clear_graph_flags(graph_flags, gr_action, flags_to_clear) do { \
135  graph_flags = pcmk__clear_flags_as(__func__, __LINE__, \
136  LOG_TRACE, "Graph", \
137  (gr_action)->uuid, graph_flags, \
138  (flags_to_clear), #flags_to_clear); \
139  } while (0)
140 
141 // Some warnings we don't want to print every transition
142 
144  pe_wo_blind = (1 << 0),
145  pe_wo_restart_type = (1 << 1),
146  pe_wo_role_after = (1 << 2),
147  pe_wo_poweroff = (1 << 3),
148  pe_wo_require_all = (1 << 4),
149  pe_wo_order_score = (1 << 5),
151  pe_wo_remove_after = (1 << 7),
152  pe_wo_ping_node = (1 << 8),
153 };
154 
155 extern uint32_t pe_wo;
156 
157 #define pe_warn_once(pe_wo_bit, fmt...) do { \
158  if (!pcmk_is_set(pe_wo, pe_wo_bit)) { \
159  if (pe_wo_bit == pe_wo_blind) { \
160  crm_warn(fmt); \
161  } else { \
162  pe_warn(fmt); \
163  } \
164  pe_wo = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \
165  "Warn-once", "logging", pe_wo, \
166  (pe_wo_bit), #pe_wo_bit); \
167  } \
168  } while (0);
169 
170 
172  char *id; // Constraint XML ID
173  pe_resource_t *rsc_lh; // Resource being located
174  enum rsc_role_e role_filter; // Role to locate
175  enum pe_discover_e discover_mode; // Resource discovery
176  GList *node_list_rh; // List of pe_node_t*
178 
179 typedef struct pe__order_constraint_s {
180  int id;
182 
183  void *lh_opaque;
187 
188  void *rh_opaque;
193 
194 typedef struct notify_data_s {
195  GSList *keys; // Environment variable name/value pairs
196 
197  const char *action;
198 
203 
204  GList *active; /* notify_entry_t* */
205  GList *inactive; /* notify_entry_t* */
206  GList *start; /* notify_entry_t* */
207  GList *stop; /* notify_entry_t* */
208  GList *demote; /* notify_entry_t* */
209  GList *promote; /* notify_entry_t* */
210  GList *promoted; /* notify_entry_t* */
211  GList *unpromoted; /* notify_entry_t* */
212  GHashTable *allowed_nodes;
213 
214 } notify_data_t;
215 
217 
218 void add_hash_param(GHashTable * hash, const char *name, const char *value);
219 
220 char *native_parameter(pe_resource_t * rsc, pe_node_t * node, gboolean create, const char *name,
222 pe_node_t *native_location(const pe_resource_t *rsc, GList **list, int current);
223 
224 void pe_metadata(pcmk__output_t *out);
225 void verify_pe_options(GHashTable * options);
226 
227 void common_update_score(pe_resource_t * rsc, const char *id, int score);
228 void native_add_running(pe_resource_t * rsc, pe_node_t * node, pe_working_set_t * data_set, gboolean failed);
229 
234 
235 pe_resource_t *native_find_rsc(pe_resource_t *rsc, const char *id, const pe_node_t *node,
236  int flags);
237 
238 gboolean native_active(pe_resource_t * rsc, gboolean all);
239 gboolean group_active(pe_resource_t * rsc, gboolean all);
240 gboolean clone_active(pe_resource_t * rsc, gboolean all);
241 gboolean pe__bundle_active(pe_resource_t *rsc, gboolean all);
242 
243 void native_print(pe_resource_t * rsc, const char *pre_text, long options, void *print_data);
244 void group_print(pe_resource_t * rsc, const char *pre_text, long options, void *print_data);
245 void clone_print(pe_resource_t * rsc, const char *pre_text, long options, void *print_data);
246 void pe__print_bundle(pe_resource_t *rsc, const char *pre_text, long options,
247  void *print_data);
248 
249 gchar * pcmk__native_output_string(pe_resource_t *rsc, const char *name, pe_node_t *node,
250  uint32_t show_opts, const char *target_role, bool show_nodes);
251 
252 int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name
253  , size_t pairs_count, ...);
254 char *pe__node_display_name(pe_node_t *node, bool print_detail);
255 
256 static inline const char *
257 pe__rsc_bool_str(pe_resource_t *rsc, uint64_t rsc_flag)
258 {
259  return pcmk__btoa(pcmk_is_set(rsc->flags, rsc_flag));
260 }
261 
262 int pe__clone_xml(pcmk__output_t *out, va_list args);
263 int pe__clone_default(pcmk__output_t *out, va_list args);
264 int pe__group_xml(pcmk__output_t *out, va_list args);
265 int pe__group_default(pcmk__output_t *out, va_list args);
266 int pe__bundle_xml(pcmk__output_t *out, va_list args);
267 int pe__bundle_html(pcmk__output_t *out, va_list args);
268 int pe__bundle_text(pcmk__output_t *out, va_list args);
269 int pe__node_html(pcmk__output_t *out, va_list args);
270 int pe__node_text(pcmk__output_t *out, va_list args);
271 int pe__node_xml(pcmk__output_t *out, va_list args);
272 int pe__resource_xml(pcmk__output_t *out, va_list args);
273 int pe__resource_html(pcmk__output_t *out, va_list args);
274 int pe__resource_text(pcmk__output_t *out, va_list args);
275 
276 void native_free(pe_resource_t * rsc);
277 void group_free(pe_resource_t * rsc);
278 void clone_free(pe_resource_t * rsc);
279 void pe__free_bundle(pe_resource_t *rsc);
280 
281 enum rsc_role_e native_resource_state(const pe_resource_t * rsc, gboolean current);
282 enum rsc_role_e group_resource_state(const pe_resource_t * rsc, gboolean current);
283 enum rsc_role_e clone_resource_state(const pe_resource_t * rsc, gboolean current);
285  gboolean current);
286 
289 
290 gboolean common_unpack(xmlNode * xml_obj, pe_resource_t ** rsc, pe_resource_t * parent,
292 void common_free(pe_resource_t * rsc);
293 
294 pe_node_t *pe__copy_node(const pe_node_t *this_node);
296 
297 /* Failure handling utilities (from failcounts.c) */
298 
299 // bit flags for fail count handling options
301  pe_fc_default = (1 << 0),
302  pe_fc_effective = (1 << 1), // don't count expired failures
303  pe_fc_fillers = (1 << 2), // if container, include filler failures in count
304 };
305 
306 int pe_get_failcount(pe_node_t *node, pe_resource_t *rsc, time_t *last_failure,
307  uint32_t flags, xmlNode *xml_op,
309 
311  const char *reason,
313 
314 /* Functions for finding/counting a resource's active nodes */
315 
317  unsigned int *count_all,
318  unsigned int *count_clean);
320  unsigned int *count);
321 
322 static inline pe_node_t *
323 pe__current_node(const pe_resource_t *rsc)
324 {
325  return pe__find_active_on(rsc, NULL, NULL);
326 }
327 
328 
329 /* Binary like operators for lists of nodes */
330 extern void node_list_exclude(GHashTable * list, GList *list2, gboolean merge_scores);
331 
332 GHashTable *pe__node_list2table(GList *list);
333 
334 static inline gpointer
335 pe_hash_table_lookup(GHashTable * hash, gconstpointer key)
336 {
337  if (hash) {
338  return g_hash_table_lookup(hash, key);
339  }
340  return NULL;
341 }
342 
343 extern pe_action_t *get_pseudo_op(const char *name, pe_working_set_t * data_set);
344 extern gboolean order_actions(pe_action_t * lh_action, pe_action_t * rh_action, enum pe_ordering order);
345 
346 /* Printing functions for debug */
347 extern void print_str_str(gpointer key, gpointer value, gpointer user_data);
348 extern void pe__output_node(pe_node_t * node, gboolean details, pcmk__output_t *out);
349 
350 void pe__show_node_weights_as(const char *file, const char *function,
351  int line, bool to_log, pe_resource_t *rsc,
352  const char *comment, GHashTable *nodes,
354 
355 #define pe__show_node_weights(level, rsc, text, nodes, data_set) \
356  pe__show_node_weights_as(__FILE__, __func__, __LINE__, \
357  (level), (rsc), (text), (nodes), (data_set))
358 
359 /* Sorting functions */
360 extern gint sort_rsc_priority(gconstpointer a, gconstpointer b);
361 extern gint sort_rsc_index(gconstpointer a, gconstpointer b);
362 
363 extern xmlNode *find_rsc_op_entry(pe_resource_t * rsc, const char *key);
364 
365 extern pe_action_t *custom_action(pe_resource_t * rsc, char *key, const char *task, pe_node_t * on_node,
366  gboolean optional, gboolean foo, pe_working_set_t * data_set);
367 
368 # define delete_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_DELETE, 0)
369 # define delete_action(rsc, node, optional) custom_action( \
370  rsc, delete_key(rsc), CRMD_ACTION_DELETE, node, \
371  optional, TRUE, data_set);
372 
373 # define stopped_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_STOPPED, 0)
374 # define stopped_action(rsc, node, optional) custom_action( \
375  rsc, stopped_key(rsc), CRMD_ACTION_STOPPED, node, \
376  optional, TRUE, data_set);
377 
378 # define stop_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_STOP, 0)
379 # define stop_action(rsc, node, optional) custom_action( \
380  rsc, stop_key(rsc), CRMD_ACTION_STOP, node, \
381  optional, TRUE, data_set);
382 
383 # define reload_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_RELOAD_AGENT, 0)
384 # define start_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_START, 0)
385 # define start_action(rsc, node, optional) custom_action( \
386  rsc, start_key(rsc), CRMD_ACTION_START, node, \
387  optional, TRUE, data_set)
388 
389 # define started_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_STARTED, 0)
390 # define started_action(rsc, node, optional) custom_action( \
391  rsc, started_key(rsc), CRMD_ACTION_STARTED, node, \
392  optional, TRUE, data_set)
393 
394 # define promote_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_PROMOTE, 0)
395 # define promote_action(rsc, node, optional) custom_action( \
396  rsc, promote_key(rsc), CRMD_ACTION_PROMOTE, node, \
397  optional, TRUE, data_set)
398 
399 # define promoted_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_PROMOTED, 0)
400 # define promoted_action(rsc, node, optional) custom_action( \
401  rsc, promoted_key(rsc), CRMD_ACTION_PROMOTED, node, \
402  optional, TRUE, data_set)
403 
404 # define demote_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_DEMOTE, 0)
405 # define demote_action(rsc, node, optional) custom_action( \
406  rsc, demote_key(rsc), CRMD_ACTION_DEMOTE, node, \
407  optional, TRUE, data_set)
408 
409 # define demoted_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_DEMOTED, 0)
410 # define demoted_action(rsc, node, optional) custom_action( \
411  rsc, demoted_key(rsc), CRMD_ACTION_DEMOTED, node, \
412  optional, TRUE, data_set)
413 
414 extern int pe_get_configured_timeout(pe_resource_t *rsc, const char *action,
416 
417 extern pe_action_t *find_first_action(GList *input, const char *uuid, const char *task,
418  pe_node_t * on_node);
419 extern enum action_tasks get_complex_task(pe_resource_t * rsc, const char *name,
420  gboolean allow_non_atomic);
421 
422 extern GList *find_actions(GList *input, const char *key, const pe_node_t *on_node);
423 GList *find_actions_exact(GList *input, const char *key,
424  const pe_node_t *on_node);
425 extern GList *find_recurring_actions(GList *input, pe_node_t * not_on_node);
426 GList *pe__resource_actions(const pe_resource_t *rsc, const pe_node_t *node,
427  const char *task, bool require_node);
428 
429 extern void pe_free_action(pe_action_t * action);
430 
431 extern void resource_location(pe_resource_t * rsc, pe_node_t * node, int score, const char *tag,
433 
434 extern gint sort_op_by_callid(gconstpointer a, gconstpointer b);
435 extern gboolean get_target_role(pe_resource_t * rsc, enum rsc_role_e *role);
436 void pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role,
437  const char *why);
438 
439 extern pe_resource_t *find_clone_instance(pe_resource_t * rsc, const char *sub_id,
441 
442 extern void destroy_ticket(gpointer data);
443 extern pe_ticket_t *ticket_new(const char *ticket_id, pe_working_set_t * data_set);
444 
445 // Resources for manipulating resource names
446 const char *pe_base_name_end(const char *id);
447 char *clone_strip(const char *last_rsc_id);
448 char *clone_zero(const char *last_rsc_id);
449 
450 static inline bool
451 pe_base_name_eq(pe_resource_t *rsc, const char *id)
452 {
453  if (id && rsc && rsc->id) {
454  // Number of characters in rsc->id before any clone suffix
455  size_t base_len = pe_base_name_end(rsc->id) - rsc->id + 1;
456 
457  return (strlen(id) == base_len) && !strncmp(id, rsc->id, base_len);
458  }
459  return false;
460 }
461 
462 int pe__target_rc_from_xml(xmlNode *xml_op);
463 
464 gint sort_node_uname(gconstpointer a, gconstpointer b);
465 bool is_set_recursive(pe_resource_t * rsc, long long flag, bool any);
466 
477 };
478 
479 typedef struct op_digest_cache_s {
481  xmlNode *params_all;
482  xmlNode *params_secure;
483  xmlNode *params_restart;
488 
490  guint *interval_ms, pe_node_t *node,
491  xmlNode *xml_op, GHashTable *overrides,
492  bool calc_secure,
494 
495 void pe__free_digests(gpointer ptr);
496 
497 op_digest_cache_t *rsc_action_digest_cmp(pe_resource_t * rsc, xmlNode * xml_op, pe_node_t * node,
499 
500 pe_action_t *pe_fence_op(pe_node_t * node, const char *op, bool optional, const char *reason, bool priority_delay, pe_working_set_t * data_set);
501 void trigger_unfencing(
502  pe_resource_t * rsc, pe_node_t *node, const char *reason, pe_action_t *dependency, pe_working_set_t * data_set);
503 
505 void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite);
506 
510 
511 gboolean add_tag_ref(GHashTable * tags, const char * tag_name, const char * obj_ref);
512 
513 void print_rscs_brief(GList *rsc_list, const char * pre_text, long options,
514  void * print_data, gboolean print_all);
515 int pe__rscs_brief_output(pcmk__output_t *out, GList *rsc_list, unsigned int options);
516 void pe_fence_node(pe_working_set_t * data_set, pe_node_t * node, const char *reason, bool priority_delay);
517 
518 pe_node_t *pe_create_node(const char *id, const char *uname, const char *type,
519  const char *score, pe_working_set_t * data_set);
520 void common_print(pe_resource_t * rsc, const char *pre_text, const char *name, pe_node_t *node, long options, void *print_data);
521 int pe__common_output_text(pcmk__output_t *out, pe_resource_t * rsc, const char *name, pe_node_t *node, unsigned int options);
522 int pe__common_output_html(pcmk__output_t *out, pe_resource_t * rsc, const char *name, pe_node_t *node, unsigned int options);
524  const pe_node_t *node);
529  xmlNode *xml, const char *field);
530 const char *pe_node_attribute_calculated(const pe_node_t *node,
531  const char *name,
532  const pe_resource_t *rsc);
533 const char *pe_node_attribute_raw(pe_node_t *node, const char *name);
536 void pe__add_param_check(xmlNode *rsc_op, pe_resource_t *rsc, pe_node_t *node,
539  void (*cb)(pe_resource_t*, pe_node_t*, xmlNode*,
540  enum pe_check_parameters,
541  pe_working_set_t*));
543 
545 void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set);
546 
552 
553 void pe__unpack_dataset_nvpairs(xmlNode *xml_obj, const char *set_name,
554  pe_rule_eval_data_t *rule_data, GHashTable *hash,
555  const char *always_first, gboolean overwrite,
557 
561 
562 GList *pe__rscs_with_tag(pe_working_set_t *data_set, const char *tag_name);
563 GList *pe__unames_with_tag(pe_working_set_t *data_set, const char *tag_name);
564 bool pe__rsc_has_tag(pe_working_set_t *data_set, const char *rsc, const char *tag);
565 bool pe__uname_has_tag(pe_working_set_t *data_set, const char *node, const char *tag);
566 
567 bool pe__rsc_running_on_any(pe_resource_t *rsc, GList *node_list);
568 GList *pe__filter_rsc_list(GList *rscs, GList *filter);
569 GList * pe__build_node_name_list(pe_working_set_t *data_set, const char *s);
570 GList * pe__build_rsc_list(pe_working_set_t *data_set, const char *s);
571 
572 bool pcmk__rsc_filtered_by_node(pe_resource_t *rsc, GList *only_node);
573 
574 gboolean pe__bundle_is_filtered(pe_resource_t *rsc, GList *only_rsc, gboolean check_parent);
575 gboolean pe__clone_is_filtered(pe_resource_t *rsc, GList *only_rsc, gboolean check_parent);
576 gboolean pe__group_is_filtered(pe_resource_t *rsc, GList *only_rsc, gboolean check_parent);
577 gboolean pe__native_is_filtered(pe_resource_t *rsc, GList *only_rsc, gboolean check_parent);
578 
579 xmlNode *pe__failed_probe_for_rsc(pe_resource_t *rsc, const char *name);
580 
581 const char *pe__clone_child_id(pe_resource_t *rsc);
582 
583 int pe__sum_node_health_scores(const pe_node_t *node, int base_health);
584 int pe__node_health(pe_node_t *node);
585 
586 static inline enum pcmk__health_strategy
587 pe__health_strategy(pe_working_set_t *data_set)
588 {
591 }
592 
593 static inline int
594 pe__health_score(const char *option, pe_working_set_t *data_set)
595 {
596  return char2score(pe_pref(data_set->config_hash, option));
597 }
598 
599 #endif
int pe__node_health(pe_node_t *node)
Definition: pe_health.c:112
void pe__foreach_param_check(pe_working_set_t *data_set, void(*cb)(pe_resource_t *, pe_node_t *, xmlNode *, enum pe_check_parameters, pe_working_set_t *))
Definition: remote.c:246
void verify_pe_options(GHashTable *options)
Definition: common.c:299
pe_action_t * lh_action
Definition: internal.h:185
enum rsc_role_e role_filter
Definition: internal.h:174
void pe__clear_resource_flags_recursive(pe_resource_t *rsc, uint64_t flags)
Definition: utils.c:2021
bool is_set_recursive(pe_resource_t *rsc, long long flag, bool any)
Definition: clone.c:448
GHashTable * pe__node_list2table(GList *list)
Definition: utils.c:203
int pe__target_rc_from_xml(xmlNode *xml_op)
Definition: unpack.c:3553
const char * pe_node_attribute_calculated(const pe_node_t *node, const char *name, const pe_resource_t *rsc)
Definition: common.c:521
void group_free(pe_resource_t *rsc)
Definition: group.c:363
char * pe__action2reason(pe_action_t *action, enum pe_action_flags flag)
Definition: utils.c:2326
char data[0]
Definition: cpg.c:55
gint sort_rsc_priority(gconstpointer a, gconstpointer b)
Definition: utils.c:361
GList * find_recurring_actions(GList *input, pe_node_t *not_on_node)
Definition: utils.c:1484
gint sort_rsc_index(gconstpointer a, gconstpointer b)
Definition: utils.c:334
void group_print(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: group.c:211
int pe__common_output_html(pcmk__output_t *out, pe_resource_t *rsc, const char *name, pe_node_t *node, unsigned int options)
pe_check_parameters
Definition: pe_types.h:202
GHashTable * allowed_nodes
Definition: internal.h:212
void pe__add_param_check(xmlNode *rsc_op, pe_resource_t *rsc, pe_node_t *node, enum pe_check_parameters, pe_working_set_t *data_set)
Definition: remote.c:220
pe_node_t * pe__find_active_on(const pe_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
Definition: complex.c:1009
const char * name
Definition: cib.c:24
GList * pe__build_rsc_list(pe_working_set_t *data_set, const char *s)
Definition: utils.c:2537
GList * start
Definition: internal.h:206
void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set)
Definition: utils.c:2393
void pe__free_bundle(pe_resource_t *rsc)
Definition: bundle.c:1974
GList * find_actions(GList *input, const char *key, const pe_node_t *on_node)
Definition: utils.c:1571
enum rsc_role_e pe__bundle_resource_state(const pe_resource_t *rsc, gboolean current)
Definition: bundle.c:2008
struct op_digest_cache_s op_digest_cache_t
void pe__count_common(pe_resource_t *rsc)
Definition: complex.c:1098
gboolean pe__group_is_filtered(pe_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: group.c:403
gboolean group_active(pe_resource_t *rsc, gboolean all)
Definition: group.c:166
int pe__group_default(pcmk__output_t *out, va_list args)
Definition: group.c:311
int char2score(const char *score)
Get the integer value of a score string.
Definition: scores.c:36
pe_node_t * native_location(const pe_resource_t *rsc, GList **list, int current)
Definition: native.c:1058
pe_node_t * pe__copy_node(const pe_node_t *this_node)
Definition: utils.c:141
int pe__clone_default(pcmk__output_t *out, va_list args)
Definition: clone.c:757
bool pe__bundle_needs_remote_name(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: bundle.c:943
void print_rscs_brief(GList *rsc_list, const char *pre_text, long options, void *print_data, gboolean print_all)
Definition: native.c:1190
void node_list_exclude(GHashTable *list, GList *list2, gboolean merge_scores)
Definition: utils.c:160
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
Definition: utils.c:1736
time_t get_effective_time(pe_working_set_t *data_set)
Definition: utils.c:1853
const char * pe_pref(GHashTable *options, const char *name)
Definition: common.c:305
pe_action_t * rh_action
Definition: internal.h:190
void resource_location(pe_resource_t *rsc, pe_node_t *node, int score, const char *tag, pe_working_set_t *data_set)
Definition: utils.c:1692
xmlNode * params_restart
Definition: internal.h:483
enum crm_ais_msg_types type
Definition: cpg.c:48
pe_resource_t * rsc_lh
Definition: internal.h:173
bool pe__rsc_running_on_any(pe_resource_t *rsc, GList *node_list)
Definition: utils.c:2465
enum pcmk__health_strategy pcmk__parse_health_strategy(const char *value)
Definition: health.c:41
int pe__resource_text(pcmk__output_t *out, va_list args)
Definition: native.c:1005
void pe__print_bundle(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: bundle.c:1872
pe_discover_e
Definition: pe_types.h:490
GList * inactive
Definition: internal.h:205
gboolean pe__unpack_bundle(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: bundle.c:1007
char * pe__node_display_name(pe_node_t *node, bool print_detail)
Definition: pe_output.c:444
int pe__bundle_html(pcmk__output_t *out, va_list args)
Definition: bundle.c:1615
const char * action
Definition: pcmk_fence.c:29
bool pe__uname_has_tag(pe_working_set_t *data_set, const char *node, const char *tag)
Definition: tags.c:99
void native_free(pe_resource_t *rsc)
Definition: native.c:1028
op_digest_cache_t * pe__calculate_digests(pe_resource_t *rsc, const char *task, guint *interval_ms, pe_node_t *node, xmlNode *xml_op, GHashTable *overrides, bool calc_secure, pe_working_set_t *data_set)
Definition: pe_digest.c:321
GList * pe__rscs_with_tag(pe_working_set_t *data_set, const char *tag_name)
Definition: tags.c:20
void trigger_unfencing(pe_resource_t *rsc, pe_node_t *node, const char *reason, pe_action_t *dependency, pe_working_set_t *data_set)
Definition: utils.c:2244
void clone_free(pe_resource_t *rsc)
Definition: clone.c:1035
void pe__unpack_dataset_nvpairs(xmlNode *xml_obj, const char *set_name, pe_rule_eval_data_t *rule_data, GHashTable *hash, const char *always_first, gboolean overwrite, pe_working_set_t *data_set)
Definition: utils.c:2407
GList * pe__filter_rsc_list(GList *rscs, GList *filter)
Definition: utils.c:2485
int pe__common_output_text(pcmk__output_t *out, pe_resource_t *rsc, const char *name, pe_node_t *node, unsigned int options)
enum rsc_role_e group_resource_state(const pe_resource_t *rsc, gboolean current)
Definition: group.c:384
void pe__set_resource_flags_recursive(pe_resource_t *rsc, uint64_t flags)
Definition: utils.c:2039
GList * active
Definition: internal.h:204
const char * pe__clone_child_id(pe_resource_t *rsc)
Definition: clone.c:1137
pe_resource_t * pe__find_bundle_replica(const pe_resource_t *bundle, const pe_node_t *node)
Definition: bundle.c:1403
enum rsc_role_e clone_resource_state(const pe_resource_t *rsc, gboolean current)
Definition: clone.c:1069
enum pe_discover_e discover_mode
Definition: internal.h:175
Formatted output for pacemaker tools.
GList * stop
Definition: internal.h:207
void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite)
Definition: utils.c:2349
pe_action_flags
Definition: pe_types.h:305
gboolean pe__native_is_filtered(pe_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: native.c:1362
int pe__rscs_brief_output(pcmk__output_t *out, GList *rsc_list, unsigned int options)
struct pe__order_constraint_s pe__ordering_t
int pe__bundle_text(pcmk__output_t *out, va_list args)
Definition: bundle.c:1743
pe_action_t * get_pseudo_op(const char *name, pe_working_set_t *data_set)
Definition: utils.c:1953
gboolean clone_active(pe_resource_t *rsc, gboolean all)
Definition: clone.c:346
char * digest_all_calc
Definition: internal.h:484
char * clone_strip(const char *last_rsc_id)
Definition: unpack.c:1635
int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name, size_t pairs_count,...)
Definition: pe_output.c:496
pe_action_t * post
Definition: internal.h:200
bool pe__rsc_has_tag(pe_working_set_t *data_set, const char *rsc, const char *tag)
Definition: tags.c:84
pe_ticket_t * ticket_new(const char *ticket_id, pe_working_set_t *data_set)
Definition: utils.c:1977
char * native_parameter(pe_resource_t *rsc, pe_node_t *node, gboolean create, const char *name, pe_working_set_t *data_set)
Definition: native.c:324
enum action_tasks get_complex_task(pe_resource_t *rsc, const char *name, gboolean allow_non_atomic)
Definition: utils.c:1518
enum rsc_digest_cmp_val rc
Definition: internal.h:480
void pe_fence_node(pe_working_set_t *data_set, pe_node_t *node, const char *reason, bool priority_delay)
Schedule a fence action for a node.
Definition: unpack.c:95
int pe__clone_xml(pcmk__output_t *out, va_list args)
Definition: clone.c:695
char * digest_secure_calc
Definition: internal.h:485
GList * promote
Definition: internal.h:209
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
Definition: util.h:122
void pe_metadata(pcmk__output_t *out)
Definition: common.c:288
gboolean get_target_role(pe_resource_t *rsc, enum rsc_role_e *role)
Definition: utils.c:1868
bool pe__shutdown_requested(pe_node_t *node)
Definition: utils.c:2378
pe_resource_t * find_clone_instance(pe_resource_t *rsc, const char *sub_id, pe_working_set_t *data_set)
Definition: clone.c:135
void common_free(pe_resource_t *rsc)
Definition: complex.c:927
gboolean order_actions(pe_action_t *lh_action, pe_action_t *rh_action, enum pe_ordering order)
Definition: utils.c:1906
unsigned long long flags
Definition: pe_types.h:362
pe_working_set_t * data_set
GHashTable * config_hash
Definition: pe_types.h:158
xmlNode * find_rsc_op_entry(pe_resource_t *rsc, const char *key)
Definition: utils.c:1440
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
Definition: utils.c:2279
pe_resource_t * lh_rsc
Definition: internal.h:184
enum rsc_role_e native_resource_state(const pe_resource_t *rsc, gboolean current)
Definition: native.c:1035
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
Definition: common.c:560
void clone_print(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: clone.c:479
GSList * keys
Definition: internal.h:195
void native_print(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: native.c:888
enum pe_ordering type
Definition: internal.h:181
gboolean pe__bundle_is_filtered(pe_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: bundle.c:2059
void pe__free_digests(gpointer ptr)
Definition: pe_digest.c:34
void pe__register_messages(pcmk__output_t *out)
Definition: pe_output.c:2923
GList * promoted
Definition: internal.h:210
int pe_get_configured_timeout(pe_resource_t *rsc, const char *action, pe_working_set_t *data_set)
Definition: utils.c:964
void common_update_score(pe_resource_t *rsc, const char *id, int score)
Definition: complex.c:874
#define PCMK__OPT_NODE_HEALTH_STRATEGY
void common_print(pe_resource_t *rsc, const char *pre_text, const char *name, pe_node_t *node, long options, void *print_data)
Definition: native.c:773
xmlNode * params_all
Definition: internal.h:481
pe_warn_once_e
Definition: internal.h:143
void pe__free_param_checks(pe_working_set_t *data_set)
Definition: remote.c:261
const char * pe__add_bundle_remote_name(pe_resource_t *rsc, pe_working_set_t *data_set, xmlNode *xml, const char *field)
Definition: bundle.c:961
gboolean native_active(pe_resource_t *rsc, gboolean all)
Definition: native.c:346
pe_action_t * post_done
Definition: internal.h:202
int pe__resource_xml(pcmk__output_t *out, va_list args)
Definition: native.c:910
bool pe_can_fence(pe_working_set_t *data_set, pe_node_t *node)
Definition: utils.c:89
GList * pe__build_node_name_list(pe_working_set_t *data_set, const char *s)
Definition: utils.c:2505
uint32_t pe_wo
Definition: unpack.c:67
int pe__bundle_xml(pcmk__output_t *out, va_list args)
Definition: bundle.c:1491
xmlNode * pe__failed_probe_for_rsc(pe_resource_t *rsc, const char *name)
Definition: utils.c:2570
Cluster status and scheduling.
bool pcmk__rsc_filtered_by_node(pe_resource_t *rsc, GList *only_node)
Definition: utils.c:2479
pe_resource_t * native_find_rsc(pe_resource_t *rsc, const char *id, const pe_node_t *node, int flags)
Definition: native.c:270
GList * unpromoted
Definition: internal.h:211
gchar * pcmk__native_output_string(pe_resource_t *rsc, const char *name, pe_node_t *node, uint32_t show_opts, const char *target_role, bool show_nodes)
Definition: native.c:543
int pe__node_text(pcmk__output_t *out, va_list args)
void add_hash_param(GHashTable *hash, const char *name, const char *value)
Definition: common.c:504
gboolean clone_unpack(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: clone.c:205
void pe__show_node_weights_as(const char *file, const char *function, int line, bool to_log, pe_resource_t *rsc, const char *comment, GHashTable *nodes, pe_working_set_t *data_set)
Definition: utils.c:303
pe_action_t * pe__clear_failcount(pe_resource_t *rsc, pe_node_t *node, const char *reason, pe_working_set_t *data_set)
Schedule a controller operation to clear a fail count.
Definition: failcounts.c:366
op_digest_cache_t * rsc_action_digest_cmp(pe_resource_t *rsc, xmlNode *xml_op, pe_node_t *node, pe_working_set_t *data_set)
Definition: pe_digest.c:392
xmlNode * input
void pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role, const char *why)
Definition: complex.c:1126
char * clone_zero(const char *last_rsc_id)
Definition: unpack.c:1657
int pe__node_xml(pcmk__output_t *out, va_list args)
int pe__group_xml(pcmk__output_t *out, va_list args)
Definition: group.c:261
This structure contains everything that makes up a single output formatter.
xmlNode * params_secure
Definition: internal.h:482
void pe__clear_resource_flags_on_all(pe_working_set_t *data_set, uint64_t flag)
Definition: utils.c:2030
void native_add_running(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set, gboolean failed)
Definition: native.c:92
pcmk__health_strategy
char uname[MAX_NAME]
Definition: cpg.c:50
GList * demote
Definition: internal.h:208
int pe__resource_html(pcmk__output_t *out, va_list args)
Definition: native.c:981
rsc_role_e
Possible roles that a resource can be in.
Definition: common.h:92
bool pe__is_universal_clone(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: clone.c:1095
pe_node_t * pe_create_node(const char *id, const char *uname, const char *type, const char *score, pe_working_set_t *data_set)
Definition: unpack.c:381
void destroy_ticket(gpointer data)
Definition: utils.c:1965
pe_resource_t * rh_rsc
Definition: internal.h:189
int pe__node_html(pcmk__output_t *out, va_list args)
gboolean common_unpack(xmlNode *xml_obj, pe_resource_t **rsc, pe_resource_t *parent, pe_working_set_t *data_set)
Definition: complex.c:493
GList * find_actions_exact(GList *input, const char *key, const pe_node_t *on_node)
Definition: utils.c:1605
pe_node_t * pe__find_active_requires(const pe_resource_t *rsc, unsigned int *count)
Definition: complex.c:1089
struct notify_data_s notify_data_t
bool pe__resource_is_disabled(pe_resource_t *rsc)
Definition: utils.c:2425
const char * parent
Definition: cib.c:25
void pe__output_node(pe_node_t *node, gboolean details, pcmk__output_t *out)
Definition: pe_output.c:2928
GList * pe__resource_actions(const pe_resource_t *rsc, const pe_node_t *node, const char *task, bool require_node)
Find all actions of given type for a resource.
Definition: utils.c:1644
pe_action_t * pe__clear_resource_history(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
Definition: utils.c:2453
void print_str_str(gpointer key, gpointer value, gpointer user_data)
Definition: utils.c:1449
const char * action
Definition: internal.h:197
pe_fc_flags_e
Definition: internal.h:300
GList * pe__unames_with_tag(pe_working_set_t *data_set, const char *tag_name)
Definition: tags.c:51
gboolean native_unpack(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: native.c:200
gint sort_node_uname(gconstpointer a, gconstpointer b)
Definition: utils.c:217
const char * pe_base_name_end(const char *id)
Definition: unpack.c:1595
int pe__sum_node_health_scores(const pe_node_t *node, int base_health)
Definition: pe_health.c:94
gboolean pe__clone_is_filtered(pe_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: clone.c:1110
struct pe__location_constraint_s pe__location_t
char * digest_restart_calc
Definition: internal.h:486
pe_action_t * find_first_action(GList *input, const char *uuid, const char *task, pe_node_t *on_node)
Definition: utils.c:1541
void pe__count_bundle(pe_resource_t *rsc)
Definition: bundle.c:2035
pe_action_t * pre_done
Definition: internal.h:201
pe_ordering
Definition: pe_types.h:497
uint64_t flags
Definition: remote.c:149
int pe_get_failcount(pe_node_t *node, pe_resource_t *rsc, time_t *last_failure, uint32_t flags, xmlNode *xml_op, pe_working_set_t *data_set)
Definition: failcounts.c:251
action_tasks
Definition: common.h:61
pe_action_t * pre
Definition: internal.h:199
pe_action_t * pe_fence_op(pe_node_t *node, const char *op, bool optional, const char *reason, bool priority_delay, pe_working_set_t *data_set)
Definition: utils.c:2136
void pe_free_action(pe_action_t *action)
Definition: utils.c:1457
rsc_digest_cmp_val
Definition: internal.h:467
gboolean pe__bundle_active(pe_resource_t *rsc, gboolean all)
Definition: bundle.c:1355
char * id
Definition: pe_types.h:336
pe_action_t * custom_action(pe_resource_t *rsc, char *key, const char *task, pe_node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)
Create or update an action object.
Definition: utils.c:730
gboolean group_unpack(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: group.c:99