pacemaker  2.0.4-2deceaa
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2020 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  */
10 #ifndef PE_INTERNAL__H
11 # define PE_INTERNAL__H
12 # include <string.h>
13 # include <crm/pengine/status.h>
15 # include <crm/common/output.h>
17 # define pe_rsc_info(rsc, fmt, args...) crm_log_tag(LOG_INFO, rsc ? rsc->id : "<NULL>", fmt, ##args)
18 # define pe_rsc_debug(rsc, fmt, args...) crm_log_tag(LOG_DEBUG, rsc ? rsc->id : "<NULL>", fmt, ##args)
19 # define pe_rsc_trace(rsc, fmt, args...) crm_log_tag(LOG_TRACE, rsc ? rsc->id : "<NULL>", fmt, ##args)
21 # define pe_err(fmt...) { was_processing_error = TRUE; crm_config_error = TRUE; crm_err(fmt); }
22 # define pe_warn(fmt...) { was_processing_warning = TRUE; crm_config_warning = TRUE; crm_warn(fmt); }
23 # define pe_proc_err(fmt...) { was_processing_error = TRUE; crm_err(fmt); }
24 # define pe_proc_warn(fmt...) { was_processing_warning = TRUE; crm_warn(fmt); }
25 # define pe_set_action_bit(action, bit) action->flags = crm_set_bit(__FUNCTION__, __LINE__, action->uuid, action->flags, bit)
26 # define pe_clear_action_bit(action, bit) action->flags = crm_clear_bit(__FUNCTION__, __LINE__, action->uuid, action->flags, bit)
28 // Some warnings we don't want to print every transition
31  pe_wo_blind = 0x0001,
33  pe_wo_role_after = 0x0004,
34  pe_wo_poweroff = 0x0008,
38 };
40 extern uint32_t pe_wo;
42 #define pe_warn_once(pe_wo_bit, fmt...) do { \
43  if (is_not_set(pe_wo, pe_wo_bit)) { \
44  if (pe_wo_bit == pe_wo_blind) { \
45  crm_warn(fmt); \
46  } else { \
47  pe_warn(fmt); \
48  } \
49  set_bit(pe_wo, pe_wo_bit); \
50  } \
51  } while (0);
54 typedef struct pe__location_constraint_s {
55  char *id; // Constraint XML ID
56  pe_resource_t *rsc_lh; // Resource being located
57  enum rsc_role_e role_filter; // Role to locate
58  enum pe_discover_e discover_mode; // Resource discovery
59  GListPtr node_list_rh; // List of pe_node_t*
62 typedef struct pe__order_constraint_s {
63  int id;
66  void *lh_opaque;
71  void *rh_opaque;
77 typedef struct notify_data_s {
78  GSList *keys; // Environment variable name/value pairs
80  const char *action;
87  GListPtr active; /* notify_entry_t* */
88  GListPtr inactive; /* notify_entry_t* */
89  GListPtr start; /* notify_entry_t* */
90  GListPtr stop; /* notify_entry_t* */
91  GListPtr demote; /* notify_entry_t* */
92  GListPtr promote; /* notify_entry_t* */
93  GListPtr master; /* notify_entry_t* */
94  GListPtr slave; /* notify_entry_t* */
95  GHashTable *allowed_nodes;
99 bool pe_can_fence(pe_working_set_t *data_set, pe_node_t *node);
101 int pe__add_scores(int score1, int score2);
102 void add_hash_param(GHashTable * hash, const char *name, const char *value);
104 char *native_parameter(pe_resource_t * rsc, pe_node_t * node, gboolean create, const char *name,
105  pe_working_set_t * data_set);
106 pe_node_t *native_location(const pe_resource_t *rsc, GList **list, int current);
108 void pe_metadata(void);
109 void verify_pe_options(GHashTable * options);
111 void common_update_score(pe_resource_t * rsc, const char *id, int score);
112 void native_add_running(pe_resource_t * rsc, pe_node_t * node, pe_working_set_t * data_set);
114 gboolean native_unpack(pe_resource_t * rsc, pe_working_set_t * data_set);
115 gboolean group_unpack(pe_resource_t * rsc, pe_working_set_t * data_set);
116 gboolean clone_unpack(pe_resource_t * rsc, pe_working_set_t * data_set);
117 gboolean pe__unpack_bundle(pe_resource_t *rsc, pe_working_set_t *data_set);
119 pe_resource_t *native_find_rsc(pe_resource_t *rsc, const char *id, const pe_node_t *node,
120  int flags);
122 gboolean native_active(pe_resource_t * rsc, gboolean all);
123 gboolean group_active(pe_resource_t * rsc, gboolean all);
124 gboolean clone_active(pe_resource_t * rsc, gboolean all);
125 gboolean pe__bundle_active(pe_resource_t *rsc, gboolean all);
127 void native_print(pe_resource_t * rsc, const char *pre_text, long options, void *print_data);
128 void group_print(pe_resource_t * rsc, const char *pre_text, long options, void *print_data);
129 void clone_print(pe_resource_t * rsc, const char *pre_text, long options, void *print_data);
130 void pe__print_bundle(pe_resource_t *rsc, const char *pre_text, long options,
131  void *print_data);
133 int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name
134  , size_t pairs_count, ...);
135 char *pe__node_display_name(pe_node_t *node, bool print_detail);
137 int pe__ban_html(pcmk__output_t *out, va_list args);
138 int pe__ban_text(pcmk__output_t *out, va_list args);
139 int pe__ban_xml(pcmk__output_t *out, va_list args);
140 int pe__clone_xml(pcmk__output_t *out, va_list args);
141 int pe__clone_html(pcmk__output_t *out, va_list args);
142 int pe__clone_text(pcmk__output_t *out, va_list args);
143 int pe__cluster_counts_html(pcmk__output_t *out, va_list args);
144 int pe__cluster_counts_text(pcmk__output_t *out, va_list args);
145 int pe__cluster_counts_xml(pcmk__output_t *out, va_list args);
146 int pe__cluster_dc_html(pcmk__output_t *out, va_list args);
147 int pe__cluster_dc_text(pcmk__output_t *out, va_list args);
148 int pe__cluster_dc_xml(pcmk__output_t *out, va_list args);
149 int pe__cluster_maint_mode_html(pcmk__output_t *out, va_list args);
150 int pe__cluster_maint_mode_text(pcmk__output_t *out, va_list args);
151 int pe__cluster_options_html(pcmk__output_t *out, va_list args);
152 int pe__cluster_options_log(pcmk__output_t *out, va_list args);
153 int pe__cluster_options_text(pcmk__output_t *out, va_list args);
154 int pe__cluster_options_xml(pcmk__output_t *out, va_list args);
155 int pe__cluster_stack_html(pcmk__output_t *out, va_list args);
156 int pe__cluster_stack_text(pcmk__output_t *out, va_list args);
157 int pe__cluster_stack_xml(pcmk__output_t *out, va_list args);
158 int pe__cluster_summary(pcmk__output_t *out, va_list args);
159 int pe__cluster_summary_html(pcmk__output_t *out, va_list args);
160 int pe__cluster_times_html(pcmk__output_t *out, va_list args);
161 int pe__cluster_times_xml(pcmk__output_t *out, va_list args);
162 int pe__cluster_times_text(pcmk__output_t *out, va_list args);
163 int pe__failed_action_text(pcmk__output_t *out, va_list args);
164 int pe__failed_action_xml(pcmk__output_t *out, va_list args);
165 int pe__group_xml(pcmk__output_t *out, va_list args);
166 int pe__group_html(pcmk__output_t *out, va_list args);
167 int pe__group_text(pcmk__output_t *out, va_list args);
168 int pe__bundle_xml(pcmk__output_t *out, va_list args);
169 int pe__bundle_html(pcmk__output_t *out, va_list args);
170 int pe__bundle_text(pcmk__output_t *out, va_list args);
171 int pe__node_html(pcmk__output_t *out, va_list args);
172 int pe__node_text(pcmk__output_t *out, va_list args);
173 int pe__node_xml(pcmk__output_t *out, va_list args);
174 int pe__node_attribute_html(pcmk__output_t *out, va_list args);
175 int pe__node_attribute_text(pcmk__output_t *out, va_list args);
176 int pe__node_attribute_xml(pcmk__output_t *out, va_list args);
177 int pe__node_list_html(pcmk__output_t *out, va_list args);
178 int pe__node_list_text(pcmk__output_t *out, va_list args);
179 int pe__node_list_xml(pcmk__output_t *out, va_list args);
180 int pe__op_history_text(pcmk__output_t *out, va_list args);
181 int pe__op_history_xml(pcmk__output_t *out, va_list args);
182 int pe__resource_history_text(pcmk__output_t *out, va_list args);
183 int pe__resource_history_xml(pcmk__output_t *out, va_list args);
184 int pe__resource_xml(pcmk__output_t *out, va_list args);
185 int pe__resource_html(pcmk__output_t *out, va_list args);
186 int pe__resource_text(pcmk__output_t *out, va_list args);
187 int pe__ticket_html(pcmk__output_t *out, va_list args);
188 int pe__ticket_text(pcmk__output_t *out, va_list args);
189 int pe__ticket_xml(pcmk__output_t *out, va_list args);
191 void native_free(pe_resource_t * rsc);
192 void group_free(pe_resource_t * rsc);
193 void clone_free(pe_resource_t * rsc);
194 void pe__free_bundle(pe_resource_t *rsc);
196 enum rsc_role_e native_resource_state(const pe_resource_t * rsc, gboolean current);
197 enum rsc_role_e group_resource_state(const pe_resource_t * rsc, gboolean current);
198 enum rsc_role_e clone_resource_state(const pe_resource_t * rsc, gboolean current);
200  gboolean current);
205 gboolean common_unpack(xmlNode * xml_obj, pe_resource_t ** rsc, pe_resource_t * parent,
206  pe_working_set_t * data_set);
207 void common_free(pe_resource_t * rsc);
209 pe_node_t *pe__copy_node(const pe_node_t *this_node);
210 extern time_t get_effective_time(pe_working_set_t * data_set);
212 /* Failure handling utilities (from failcounts.c) */
214 // bit flags for fail count handling options
217  pe_fc_effective = 0x01, // don't count expired failures
218  pe_fc_fillers = 0x02, // if container, include filler failures in count
219 };
221 int pe_get_failcount(pe_node_t *node, pe_resource_t *rsc, time_t *last_failure,
222  uint32_t flags, xmlNode *xml_op,
223  pe_working_set_t *data_set);
226  const char *reason,
227  pe_working_set_t *data_set);
229 /* Functions for finding/counting a resource's active nodes */
232  unsigned int *count_all,
233  unsigned int *count_clean);
235  unsigned int *count);
237 static inline pe_node_t *
238 pe__current_node(const pe_resource_t *rsc)
239 {
240  return pe__find_active_on(rsc, NULL, NULL);
241 }
244 /* Binary like operators for lists of nodes */
245 extern void node_list_exclude(GHashTable * list, GListPtr list2, gboolean merge_scores);
247 GHashTable *pe__node_list2table(GList *list);
249 static inline gpointer
250 pe_hash_table_lookup(GHashTable * hash, gconstpointer key)
251 {
252  if (hash) {
253  return g_hash_table_lookup(hash, key);
254  }
255  return NULL;
256 }
258 extern pe_action_t *get_pseudo_op(const char *name, pe_working_set_t * data_set);
259 extern gboolean order_actions(pe_action_t * lh_action, pe_action_t * rh_action, enum pe_ordering order);
261 /* Printing functions for debug */
262 extern void print_node(const char *pre_text, pe_node_t * node, gboolean details);
263 extern void print_str_str(gpointer key, gpointer value, gpointer user_data);
264 extern void pe__output_node(pe_node_t * node, gboolean details, pcmk__output_t *out);
266 extern void dump_node_capacity(int level, const char *comment, pe_node_t * node);
267 extern void dump_rsc_utilization(int level, const char *comment, pe_resource_t * rsc, pe_node_t * node);
269 void pe__show_node_weights_as(const char *file, const char *function,
270  int line, bool to_log, pe_resource_t *rsc,
271  const char *comment, GHashTable *nodes);
273 #define pe__show_node_weights(level, rsc, text, nodes) \
274  pe__show_node_weights_as(__FILE__, __FUNCTION__, __LINE__, \
275  (level), (rsc), (text), (nodes))
277 /* Sorting functions */
278 extern gint sort_rsc_priority(gconstpointer a, gconstpointer b);
279 extern gint sort_rsc_index(gconstpointer a, gconstpointer b);
281 extern xmlNode *find_rsc_op_entry(pe_resource_t * rsc, const char *key);
283 extern pe_action_t *custom_action(pe_resource_t * rsc, char *key, const char *task, pe_node_t * on_node,
284  gboolean optional, gboolean foo, pe_working_set_t * data_set);
286 # define delete_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_DELETE, 0)
287 # define delete_action(rsc, node, optional) custom_action( \
288  rsc, delete_key(rsc), CRMD_ACTION_DELETE, node, \
289  optional, TRUE, data_set);
291 # define stopped_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_STOPPED, 0)
292 # define stopped_action(rsc, node, optional) custom_action( \
293  rsc, stopped_key(rsc), CRMD_ACTION_STOPPED, node, \
294  optional, TRUE, data_set);
296 # define stop_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_STOP, 0)
297 # define stop_action(rsc, node, optional) custom_action( \
298  rsc, stop_key(rsc), CRMD_ACTION_STOP, node, \
299  optional, TRUE, data_set);
301 # define reload_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_RELOAD, 0)
302 # define start_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_START, 0)
303 # define start_action(rsc, node, optional) custom_action( \
304  rsc, start_key(rsc), CRMD_ACTION_START, node, \
305  optional, TRUE, data_set)
307 # define started_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_STARTED, 0)
308 # define started_action(rsc, node, optional) custom_action( \
309  rsc, started_key(rsc), CRMD_ACTION_STARTED, node, \
310  optional, TRUE, data_set)
312 # define promote_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_PROMOTE, 0)
313 # define promote_action(rsc, node, optional) custom_action( \
314  rsc, promote_key(rsc), CRMD_ACTION_PROMOTE, node, \
315  optional, TRUE, data_set)
317 # define promoted_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_PROMOTED, 0)
318 # define promoted_action(rsc, node, optional) custom_action( \
319  rsc, promoted_key(rsc), CRMD_ACTION_PROMOTED, node, \
320  optional, TRUE, data_set)
322 # define demote_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_DEMOTE, 0)
323 # define demote_action(rsc, node, optional) custom_action( \
324  rsc, demote_key(rsc), CRMD_ACTION_DEMOTE, node, \
325  optional, TRUE, data_set)
327 # define demoted_key(rsc) pcmk__op_key(rsc->id, CRMD_ACTION_DEMOTED, 0)
328 # define demoted_action(rsc, node, optional) custom_action( \
329  rsc, demoted_key(rsc), CRMD_ACTION_DEMOTED, node, \
330  optional, TRUE, data_set)
332 extern int pe_get_configured_timeout(pe_resource_t *rsc, const char *action,
333  pe_working_set_t *data_set);
335 extern pe_action_t *find_first_action(GListPtr input, const char *uuid, const char *task,
336  pe_node_t * on_node);
337 extern enum action_tasks get_complex_task(pe_resource_t * rsc, const char *name,
338  gboolean allow_non_atomic);
340 extern GListPtr find_actions(GListPtr input, const char *key, const pe_node_t *on_node);
341 GList *find_actions_exact(GList *input, const char *key,
342  const pe_node_t *on_node);
343 extern GListPtr find_recurring_actions(GListPtr input, pe_node_t * not_on_node);
344 GList *pe__resource_actions(const pe_resource_t *rsc, const pe_node_t *node,
345  const char *task, bool require_node);
347 extern void pe_free_action(pe_action_t * action);
349 extern void resource_location(pe_resource_t * rsc, pe_node_t * node, int score, const char *tag,
350  pe_working_set_t * data_set);
352 extern gint sort_op_by_callid(gconstpointer a, gconstpointer b);
353 extern gboolean get_target_role(pe_resource_t * rsc, enum rsc_role_e *role);
355 extern pe_resource_t *find_clone_instance(pe_resource_t * rsc, const char *sub_id,
356  pe_working_set_t * data_set);
358 extern void destroy_ticket(gpointer data);
359 extern pe_ticket_t *ticket_new(const char *ticket_id, pe_working_set_t * data_set);
361 // Resources for manipulating resource names
362 const char *pe_base_name_end(const char *id);
363 char *clone_strip(const char *last_rsc_id);
364 char *clone_zero(const char *last_rsc_id);
366 static inline bool
367 pe_base_name_eq(pe_resource_t *rsc, const char *id)
368 {
369  if (id && rsc && rsc->id) {
370  // Number of characters in rsc->id before any clone suffix
371  size_t base_len = pe_base_name_end(rsc->id) - rsc->id + 1;
373  return (strlen(id) == base_len) && !strncmp(id, rsc->id, base_len);
374  }
375  return FALSE;
376 }
378 int pe__target_rc_from_xml(xmlNode *xml_op);
380 gint sort_node_uname(gconstpointer a, gconstpointer b);
381 bool is_set_recursive(pe_resource_t * rsc, long long flag, bool any);
393 };
395 typedef struct op_digest_cache_s {
397  xmlNode *params_all;
398  xmlNode *params_secure;
399  xmlNode *params_restart;
405 op_digest_cache_t *rsc_action_digest_cmp(pe_resource_t * rsc, xmlNode * xml_op, pe_node_t * node,
406  pe_working_set_t * data_set);
408 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);
409 void trigger_unfencing(
410  pe_resource_t * rsc, pe_node_t *node, const char *reason, pe_action_t *dependency, pe_working_set_t * data_set);
412 void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite);
413 void pe_action_set_flag_reason(const char *function, long line, pe_action_t *action, pe_action_t *reason, const char *text, enum pe_action_flags flags, bool overwrite);
415 #define pe_action_required(action, reason, text) pe_action_set_flag_reason(__FUNCTION__, __LINE__, action, reason, text, pe_action_optional, FALSE)
416 #define pe_action_implies(action, reason, flag) pe_action_set_flag_reason(__FUNCTION__, __LINE__, action, reason, NULL, flag, FALSE)
418 void set_bit_recursive(pe_resource_t * rsc, unsigned long long flag);
419 void clear_bit_recursive(pe_resource_t * rsc, unsigned long long flag);
421 gboolean add_tag_ref(GHashTable * tags, const char * tag_name, const char * obj_ref);
423 void print_rscs_brief(GListPtr rsc_list, const char * pre_text, long options,
424  void * print_data, gboolean print_all);
425 int pe__rscs_brief_output(pcmk__output_t *out, GListPtr rsc_list, long options, gboolean print_all);
426 void pe_fence_node(pe_working_set_t * data_set, pe_node_t * node, const char *reason, bool priority_delay);
428 pe_node_t *pe_create_node(const char *id, const char *uname, const char *type,
429  const char *score, pe_working_set_t * data_set);
430 void common_print(pe_resource_t * rsc, const char *pre_text, const char *name, pe_node_t *node, long options, void *print_data);
431 int pe__common_output_text(pcmk__output_t *out, pe_resource_t * rsc, const char *name, pe_node_t *node, long options);
432 int pe__common_output_html(pcmk__output_t *out, pe_resource_t * rsc, const char *name, pe_node_t *node, long options);
434  const pe_node_t *node);
436 const char *pe__add_bundle_remote_name(pe_resource_t *rsc, xmlNode *xml,
437  const char *field);
438 const char *pe_node_attribute_calculated(const pe_node_t *node,
439  const char *name,
440  const pe_resource_t *rsc);
441 const char *pe_node_attribute_raw(pe_node_t *node, const char *name);
443  pe_working_set_t *data_set);
444 void pe__add_param_check(xmlNode *rsc_op, pe_resource_t *rsc, pe_node_t *node,
445  enum pe_check_parameters, pe_working_set_t *data_set);
447  void (*cb)(pe_resource_t*, pe_node_t*, xmlNode*,
448  enum pe_check_parameters,
449  pe_working_set_t*));
453 void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set);
455 #define BOOL2STR(x) ((x) ? "true" : "false")
462 void pe__unpack_dataset_nvpairs(xmlNode *xml_obj, const char *set_name,
463  GHashTable *node_hash, GHashTable *hash,
464  const char *always_first, gboolean overwrite,
465  pe_working_set_t *data_set);
469  pe_working_set_t *data_set);
471 GListPtr pe__unames_with_tag(pe_working_set_t *data_set, const char *tag_name);
472 bool pe__uname_has_tag(pe_working_set_t *data_set, const char *node, const char *tag);
476 bool pcmk__rsc_is_filtered(pe_resource_t *rsc, GListPtr only_show);
478 #endif
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:248
char uname[MAX_NAME]
Definition: internal.h:85
int pe__ticket_html(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1613
void verify_pe_options(GHashTable *options)
Definition: common.c:309
pe_action_t * lh_action
Definition: internal.h:68
enum rsc_role_e role_filter
Definition: internal.h:57
bool is_set_recursive(pe_resource_t *rsc, long long flag, bool any)
Definition: clone.c:338
GHashTable * pe__node_list2table(GList *list)
Definition: utils.c:201
int pe__common_output_html(pcmk__output_t *out, pe_resource_t *rsc, const char *name, pe_node_t *node, long options)
Definition: native.c:716
int pe__cluster_maint_mode_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:705
int pe__target_rc_from_xml(xmlNode *xml_op)
Definition: unpack.c:3277
const char * pe_node_attribute_calculated(const pe_node_t *node, const char *name, const pe_resource_t *rsc)
Definition: common.c:590
void group_free(pe_resource_t *rsc)
Definition: group.c:268
gint sort_rsc_priority(gconstpointer a, gconstpointer b)
Definition: utils.c:458
gint sort_rsc_index(gconstpointer a, gconstpointer b)
Definition: utils.c:431
int pe__failed_action_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:930
void group_print(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: group.c:132
int pe__ticket_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1634
Formatted output for pacemaker tools.
void pe_metadata(void)
Definition: common.c:299
Definition: pe_types.h:182
GHashTable * allowed_nodes
Definition: internal.h:95
int pe__cluster_summary(pcmk__output_t *out, va_list args)
int pe__failed_action_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:941
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:222
pe_node_t * pe__find_active_on(const pe_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
Definition: complex.c:858
bool pe__rsc_running_on_any_node_in_list(pe_resource_t *rsc, GListPtr node_list)
Definition: utils.c:2753
void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set)
Definition: utils.c:2681
void pe__free_bundle(pe_resource_t *rsc)
Definition: bundle.c:1891
enum rsc_role_e pe__bundle_resource_state(const pe_resource_t *rsc, gboolean current)
Definition: bundle.c:1925
struct op_digest_cache_s op_digest_cache_t
void pe__count_common(pe_resource_t *rsc)
Definition: complex.c:947
int pe__ban_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:482
int pe__cluster_options_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:770
int pe__cluster_options_log(pcmk__output_t *out, va_list args)
Definition: pe_output.c:757
GListPtr slave
Definition: internal.h:94
gboolean group_active(pe_resource_t *rsc, gboolean all)
Definition: group.c:87
pe_node_t * native_location(const pe_resource_t *rsc, GList **list, int current)
Definition: native.c:1178
void pe_action_set_flag_reason(const char *function, long line, pe_action_t *action, pe_action_t *reason, const char *text, enum pe_action_flags flags, bool overwrite)
Definition: utils.c:2574
pe_node_t * pe__copy_node(const pe_node_t *this_node)
Definition: utils.c:139
int pe__cluster_times_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:913
int pe__cluster_counts_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:565
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
Definition: utils.c:1653
void print_node(const char *pre_text, pe_node_t *node, gboolean details)
Definition: utils.c:1310
time_t get_effective_time(pe_working_set_t *data_set)
Definition: utils.c:1770
pe_action_t * rh_action
Definition: internal.h:73
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:1609
xmlNode * params_restart
Definition: internal.h:399
int pe__cluster_dc_html(pcmk__output_t *out, va_list args)
Definition: pe_output.c:629
int pe__ban_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:465
GListPtr pe__unames_with_tag(pe_working_set_t *data_set, const char *tag_name)
Definition: tags.c:18
pe_resource_t * rsc_lh
Definition: internal.h:56
void clear_bit_recursive(pe_resource_t *rsc, unsigned long long flag)
Definition: utils.c:2285
int pe__resource_text(pcmk__output_t *out, va_list args)
Definition: native.c:1131
void pe__print_bundle(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: bundle.c:1789
void print_rscs_brief(GListPtr rsc_list, const char *pre_text, long options, void *print_data, gboolean print_all)
Definition: native.c:1305
Definition: pe_types.h:454
bool pe__bundle_needs_remote_name(pe_resource_t *rsc)
Definition: bundle.c:956
int pe__group_text(pcmk__output_t *out, va_list args)
Definition: group.c:244
gboolean pe__unpack_bundle(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: bundle.c:1025
int pe__cluster_times_html(pcmk__output_t *out, va_list args)
Definition: pe_output.c:868
char * pe__node_display_name(pe_node_t *node, bool print_detail)
Definition: pe_output.c:361
int pe__bundle_html(pcmk__output_t *out, va_list args)
Definition: bundle.c:1594
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:51
void native_free(pe_resource_t *rsc)
Definition: native.c:1149
int pe__op_history_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1465
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:2504
void clone_free(pe_resource_t *rsc)
Definition: clone.c:1035
int pe__clone_html(pcmk__output_t *out, va_list args)
Definition: clone.c:619
int pe__node_list_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1300
enum rsc_role_e group_resource_state(const pe_resource_t *rsc, gboolean current)
Definition: group.c:289
pe_resource_t * pe__find_bundle_replica(const pe_resource_t *bundle, const pe_node_t *node)
Definition: bundle.c:1410
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:58
void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite)
Definition: utils.c:2632
Definition: pe_types.h:276
struct pe__order_constraint_s pe__ordering_t
int pe__bundle_text(pcmk__output_t *out, va_list args)
Definition: bundle.c:1694
pe_action_t * get_pseudo_op(const char *name, pe_working_set_t *data_set)
Definition: utils.c:1875
GListPtr stop
Definition: internal.h:90
gboolean clone_active(pe_resource_t *rsc, gboolean all)
Definition: clone.c:237
GListPtr find_recurring_actions(GListPtr input, pe_node_t *not_on_node)
Definition: utils.c:1384
char * digest_all_calc
Definition: internal.h:400
char * clone_strip(const char *last_rsc_id)
Definition: unpack.c:1537
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:413
pe_action_t * post
Definition: internal.h:83
pe_ticket_t * ticket_new(const char *ticket_id, pe_working_set_t *data_set)
Definition: utils.c:1904
int pe__ticket_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1655
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:315
const char * pe__add_bundle_remote_name(pe_resource_t *rsc, xmlNode *xml, const char *field)
Definition: bundle.c:986
int pe__group_html(pcmk__output_t *out, va_list args)
Definition: group.c:219
enum action_tasks get_complex_task(pe_resource_t *rsc, const char *name, gboolean allow_non_atomic)
Definition: utils.c:1418
enum rsc_digest_cmp_val rc
Definition: internal.h:396
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:85
int pe__clone_xml(pcmk__output_t *out, va_list args)
Definition: clone.c:575
GListPtr master
Definition: internal.h:93
char * digest_secure_calc
Definition: internal.h:401
GListPtr find_actions(GListPtr input, const char *key, const pe_node_t *on_node)
Definition: utils.c:1472
gboolean get_target_role(pe_resource_t *rsc, enum rsc_role_e *role)
Definition: utils.c:1785
int pe__node_attribute_html(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1214
void pe__unpack_dataset_nvpairs(xmlNode *xml_obj, const char *set_name, GHashTable *node_hash, GHashTable *hash, const char *always_first, gboolean overwrite, pe_working_set_t *data_set)
Definition: utils.c:2695
bool pe__shutdown_requested(pe_node_t *node)
Definition: utils.c:2666
pe_resource_t * find_clone_instance(pe_resource_t *rsc, const char *sub_id, pe_working_set_t *data_set)
Definition: clone.c:41
void common_free(pe_resource_t *rsc)
Definition: complex.c:776
gboolean order_actions(pe_action_t *lh_action, pe_action_t *rh_action, enum pe_ordering order)
Definition: utils.c:1823
int pe__node_attribute_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1244
xmlNode * find_rsc_op_entry(pe_resource_t *rsc, const char *key)
Definition: utils.c:1304
int pe__cluster_times_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:892
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
Definition: utils.c:2538
pe_resource_t * lh_rsc
Definition: internal.h:67
int pe__resource_history_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1547
enum rsc_role_e native_resource_state(const pe_resource_t *rsc, gboolean current)
Definition: native.c:1156
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
Definition: common.c:629
void clone_print(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: clone.c:369
GSList * keys
Definition: internal.h:78
void native_print(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: native.c:1021
int pe__node_list_html(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1265
int pe__cluster_summary_html(pcmk__output_t *out, va_list args)
enum pe_ordering type
Definition: internal.h:64
void pe__register_messages(pcmk__output_t *out)
Definition: pe_output.c:1756
int pe__cluster_dc_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:663
int pe_get_configured_timeout(pe_resource_t *rsc, const char *action, pe_working_set_t *data_set)
Definition: utils.c:870
void common_update_score(pe_resource_t *rsc, const char *id, int score)
Definition: complex.c:723
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:869
xmlNode * params_all
Definition: internal.h:397
int pe__cluster_counts_html(pcmk__output_t *out, va_list args)
Definition: pe_output.c:503
Definition: internal.h:30
void pe__free_param_checks(pe_working_set_t *data_set)
Definition: remote.c:263
int pe__cluster_stack_html(pcmk__output_t *out, va_list args)
Definition: pe_output.c:837
GListPtr active
Definition: internal.h:87
int pe__resource_history_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1569
gboolean native_active(pe_resource_t *rsc, gboolean all)
Definition: native.c:360
pe_action_t * post_done
Definition: internal.h:85
int pe__resource_xml(pcmk__output_t *out, va_list args)
Definition: native.c:1043
int pe__cluster_options_html(pcmk__output_t *out, va_list args)
Definition: pe_output.c:714
int pe__cluster_options_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:802
void native_add_running(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
Definition: native.c:83
bool pe_can_fence(pe_working_set_t *data_set, pe_node_t *node)
Definition: utils.c:87
uint32_t pe_wo
Definition: unpack.c:57
void dump_node_capacity(int level, const char *comment, pe_node_t *node)
Definition: utils.c:395
int pe__bundle_xml(pcmk__output_t *out, va_list args)
Definition: bundle.c:1498
Cluster status and scheduling.
pe_resource_t * native_find_rsc(pe_resource_t *rsc, const char *id, const pe_node_t *node, int flags)
Definition: native.c:260
int pe__clone_text(pcmk__output_t *out, va_list args)
Definition: clone.c:828
int pe__node_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1063
void add_hash_param(GHashTable *hash, const char *name, const char *value)
Definition: common.c:573
GListPtr demote
Definition: internal.h:91
bool pcmk__rsc_is_filtered(pe_resource_t *rsc, GListPtr only_show)
Definition: utils.c:2766
int pe__add_scores(int score1, int score2)
Definition: common.c:510
gboolean clone_unpack(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: clone.c:111
int pe__ban_html(pcmk__output_t *out, va_list args)
Definition: pe_output.c:445
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:360
void node_list_exclude(GHashTable *list, GListPtr list2, gboolean merge_scores)
Definition: utils.c:158
int pe__cluster_maint_mode_html(pcmk__output_t *out, va_list args)
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: utils.c:2095
int pe__cluster_stack_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:849
char * clone_zero(const char *last_rsc_id)
Definition: unpack.c:1559
GListPtr inactive
Definition: internal.h:88
int pe__node_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1120
int pe__group_xml(pcmk__output_t *out, va_list args)
Definition: group.c:182
This structure contains everything that makes up a single output formatter.
Definition: output.h:153
void dump_rsc_utilization(int level, const char *comment, pe_resource_t *rsc, pe_node_t *node)
Definition: utils.c:412
xmlNode * params_secure
Definition: internal.h:398
int pe__node_attribute_text(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1188
char data[0]
Definition: internal.h:90
int pe__resource_html(pcmk__output_t *out, va_list args)
Definition: native.c:1112
int pe__cluster_dc_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:682
Definition: common.h:76
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:369
void destroy_ticket(gpointer data)
Definition: utils.c:1892
pe_resource_t * rh_rsc
Definition: internal.h:72
int pe__node_html(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1001
gboolean common_unpack(xmlNode *xml_obj, pe_resource_t **rsc, pe_resource_t *parent, pe_working_set_t *data_set)
Definition: complex.c:366
int pe__cluster_counts_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:599
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)
Definition: utils.c:350
GListPtr promote
Definition: internal.h:92
GList * find_actions_exact(GList *input, const char *key, const pe_node_t *on_node)
Definition: utils.c:1512
void set_bit_recursive(pe_resource_t *rsc, unsigned long long flag)
Definition: utils.c:2298
pe_node_t * pe__find_active_requires(const pe_resource_t *rsc, unsigned int *count)
Definition: complex.c:938
struct notify_data_s notify_data_t
bool pe__resource_is_disabled(pe_resource_t *rsc)
Definition: utils.c:2713
pe_action_t * find_first_action(GListPtr input, const char *uuid, const char *task, pe_node_t *on_node)
Definition: utils.c:1442
void pe__output_node(pe_node_t *node, gboolean details, pcmk__output_t *out)
Definition: pe_output.c:1761
GListPtr start
Definition: internal.h:89
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:1561
pe_action_t * pe__clear_resource_history(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
Definition: utils.c:2741
void print_str_str(gpointer key, gpointer value, gpointer user_data)
Definition: utils.c:1349
const char * action
Definition: internal.h:80
char * name
Definition: pcmk_fence.c:30
int pe__rscs_brief_output(pcmk__output_t *out, GListPtr rsc_list, long options, gboolean print_all)
Definition: native.c:1385
Definition: internal.h:215
gboolean native_unpack(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: native.c:191
int pe__op_history_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1482
int pe__common_output_text(pcmk__output_t *out, pe_resource_t *rsc, const char *name, pe_node_t *node, long options)
Definition: native.c:805
gint sort_node_uname(gconstpointer a, gconstpointer b)
Definition: utils.c:215
const char * pe_base_name_end(const char *id)
Definition: unpack.c:1497
int pe__node_list_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:1439
GList * GListPtr
Definition: crm.h:214
struct pe__location_constraint_s pe__location_t
char * digest_restart_calc
Definition: internal.h:402
int pe__cluster_stack_xml(pcmk__output_t *out, va_list args)
Definition: pe_output.c:857
void pe__count_bundle(pe_resource_t *rsc)
Definition: bundle.c:1952
pe_action_t * pre_done
Definition: internal.h:84
Definition: pe_types.h:461
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
Definition: common.h:47
pe_action_t * pre
Definition: internal.h:82
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:2398
void pe_free_action(pe_action_t *action)
Definition: utils.c:1357
Definition: internal.h:383
enum crm_ais_msg_types type
Definition: internal.h:83
gboolean pe__bundle_active(pe_resource_t *rsc, gboolean all)
Definition: bundle.c:1362
char * id
Definition: pe_types.h:305
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)
Definition: utils.c:485
gboolean group_unpack(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: group.c:22