pacemaker  2.0.3-4b1f869f0f
Scalable High-Availability cluster resource manager
internal.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2019 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 <string.h>
13 # include <crm/pengine/status.h>
15 # include <crm/common/output.h>
16 
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)
20 
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)
27 
28 typedef struct pe__location_constraint_s {
29  char *id; // Constraint XML ID
30  pe_resource_t *rsc_lh; // Resource being located
31  enum rsc_role_e role_filter; // Role to locate
32  enum pe_discover_e discover_mode; // Resource discovery
33  GListPtr node_list_rh; // List of pe_node_t*
35 
36 typedef struct pe__order_constraint_s {
37  int id;
39 
40  void *lh_opaque;
44 
45  void *rh_opaque;
50 
51 typedef struct notify_data_s {
52  GSList *keys; // Environment variable name/value pairs
53 
54  const char *action;
55 
60 
61  GListPtr active; /* notify_entry_t* */
62  GListPtr inactive; /* notify_entry_t* */
63  GListPtr start; /* notify_entry_t* */
64  GListPtr stop; /* notify_entry_t* */
65  GListPtr demote; /* notify_entry_t* */
66  GListPtr promote; /* notify_entry_t* */
67  GListPtr master; /* notify_entry_t* */
68  GListPtr slave; /* notify_entry_t* */
69  GHashTable *allowed_nodes;
70 
72 
73 bool pe_can_fence(pe_working_set_t *data_set, node_t *node);
74 
75 int merge_weights(int w1, int w2);
76 void add_hash_param(GHashTable * hash, const char *name, const char *value);
77 
78 char *native_parameter(resource_t * rsc, node_t * node, gboolean create, const char *name,
79  pe_working_set_t * data_set);
80 pe_node_t *native_location(const pe_resource_t *rsc, GList **list, int current);
81 
82 void pe_metadata(void);
83 void verify_pe_options(GHashTable * options);
84 
85 void common_update_score(resource_t * rsc, const char *id, int score);
86 void native_add_running(resource_t * rsc, node_t * node, pe_working_set_t * data_set);
87 
88 gboolean native_unpack(resource_t * rsc, pe_working_set_t * data_set);
89 gboolean group_unpack(resource_t * rsc, pe_working_set_t * data_set);
90 gboolean clone_unpack(resource_t * rsc, pe_working_set_t * data_set);
91 gboolean pe__unpack_bundle(pe_resource_t *rsc, pe_working_set_t *data_set);
92 
93 resource_t *native_find_rsc(resource_t *rsc, const char *id, const node_t *node,
94  int flags);
95 
96 gboolean native_active(resource_t * rsc, gboolean all);
97 gboolean group_active(resource_t * rsc, gboolean all);
98 gboolean clone_active(resource_t * rsc, gboolean all);
99 gboolean pe__bundle_active(pe_resource_t *rsc, gboolean all);
100 
101 void native_print(resource_t * rsc, const char *pre_text, long options, void *print_data);
102 void group_print(resource_t * rsc, const char *pre_text, long options, void *print_data);
103 void clone_print(resource_t * rsc, const char *pre_text, long options, void *print_data);
104 void pe__print_bundle(pe_resource_t *rsc, const char *pre_text, long options,
105  void *print_data);
106 
107 int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name
108  , size_t pairs_count, ...);
109 
110 int pe__clone_xml(pcmk__output_t *out, va_list args);
111 int pe__clone_html(pcmk__output_t *out, va_list args);
112 int pe__clone_text(pcmk__output_t *out, va_list args);
113 int pe__group_xml(pcmk__output_t *out, va_list args);
114 int pe__group_html(pcmk__output_t *out, va_list args);
115 int pe__group_text(pcmk__output_t *out, va_list args);
116 int pe__bundle_xml(pcmk__output_t *out, va_list args);
117 int pe__bundle_html(pcmk__output_t *out, va_list args);
118 int pe__bundle_text(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(resource_t * rsc);
124 void group_free(resource_t * rsc);
125 void clone_free(resource_t * rsc);
126 void pe__free_bundle(pe_resource_t *rsc);
127 
128 enum rsc_role_e native_resource_state(const resource_t * rsc, gboolean current);
129 enum rsc_role_e group_resource_state(const resource_t * rsc, gboolean current);
130 enum rsc_role_e clone_resource_state(const resource_t * rsc, gboolean current);
132  gboolean current);
133 
136 
137 gboolean common_unpack(xmlNode * xml_obj, resource_t ** rsc, resource_t * parent,
138  pe_working_set_t * data_set);
139 void common_free(resource_t * rsc);
140 
141 extern node_t *node_copy(const node_t *this_node);
142 extern time_t get_effective_time(pe_working_set_t * data_set);
143 
144 /* Failure handling utilities (from failcounts.c) */
145 
146 // bit flags for fail count handling options
149  pe_fc_effective = 0x01, // don't count expired failures
150  pe_fc_fillers = 0x02, // if container, include filler failures in count
151 };
152 
153 int pe_get_failcount(node_t *node, resource_t *rsc, time_t *last_failure,
154  uint32_t flags, xmlNode *xml_op,
155  pe_working_set_t *data_set);
156 
158  const char *reason,
159  pe_working_set_t *data_set);
160 
161 /* Functions for finding/counting a resource's active nodes */
162 
164  unsigned int *count_all,
165  unsigned int *count_clean);
167  unsigned int *count);
168 
169 static inline pe_node_t *
170 pe__current_node(const pe_resource_t *rsc)
171 {
172  return pe__find_active_on(rsc, NULL, NULL);
173 }
174 
175 
176 /* Binary like operators for lists of nodes */
177 extern void node_list_exclude(GHashTable * list, GListPtr list2, gboolean merge_scores);
178 extern GListPtr node_list_dup(GListPtr list, gboolean reset, gboolean filter);
179 
180 extern GHashTable *node_hash_from_list(GListPtr list);
181 static inline gpointer
182 pe_hash_table_lookup(GHashTable * hash, gconstpointer key)
183 {
184  if (hash) {
185  return g_hash_table_lookup(hash, key);
186  }
187  return NULL;
188 }
189 
190 extern action_t *get_pseudo_op(const char *name, pe_working_set_t * data_set);
191 extern gboolean order_actions(action_t * lh_action, action_t * rh_action, enum pe_ordering order);
192 
193 GHashTable *node_hash_dup(GHashTable * hash);
194 
195 /* Printing functions for debug */
196 extern void print_node(const char *pre_text, node_t * node, gboolean details);
197 extern void print_str_str(gpointer key, gpointer value, gpointer user_data);
198 extern void pe__output_node(node_t * node, gboolean details, pcmk__output_t *out);
199 
200 extern void dump_node_scores_worker(int level, const char *file, const char *function, int line,
201  resource_t * rsc, const char *comment, GHashTable * nodes);
202 
203 extern void dump_node_capacity(int level, const char *comment, node_t * node);
204 extern void dump_rsc_utilization(int level, const char *comment, resource_t * rsc, node_t * node);
205 
206 # define dump_node_scores(level, rsc, text, nodes) do { \
207  dump_node_scores_worker(level, __FILE__, __FUNCTION__, __LINE__, rsc, text, nodes); \
208  } while(0)
209 
210 /* Sorting functions */
211 extern gint sort_rsc_priority(gconstpointer a, gconstpointer b);
212 extern gint sort_rsc_index(gconstpointer a, gconstpointer b);
213 
214 extern xmlNode *find_rsc_op_entry(resource_t * rsc, const char *key);
215 
216 extern action_t *custom_action(resource_t * rsc, char *key, const char *task, node_t * on_node,
217  gboolean optional, gboolean foo, pe_working_set_t * data_set);
218 
219 # define delete_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_DELETE, 0)
220 # define delete_action(rsc, node, optional) custom_action( \
221  rsc, delete_key(rsc), CRMD_ACTION_DELETE, node, \
222  optional, TRUE, data_set);
223 
224 # define stopped_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_STOPPED, 0)
225 # define stopped_action(rsc, node, optional) custom_action( \
226  rsc, stopped_key(rsc), CRMD_ACTION_STOPPED, node, \
227  optional, TRUE, data_set);
228 
229 # define stop_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_STOP, 0)
230 # define stop_action(rsc, node, optional) custom_action( \
231  rsc, stop_key(rsc), CRMD_ACTION_STOP, node, \
232  optional, TRUE, data_set);
233 
234 # define reload_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_RELOAD, 0)
235 # define start_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_START, 0)
236 # define start_action(rsc, node, optional) custom_action( \
237  rsc, start_key(rsc), CRMD_ACTION_START, node, \
238  optional, TRUE, data_set)
239 
240 # define started_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_STARTED, 0)
241 # define started_action(rsc, node, optional) custom_action( \
242  rsc, started_key(rsc), CRMD_ACTION_STARTED, node, \
243  optional, TRUE, data_set)
244 
245 # define promote_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_PROMOTE, 0)
246 # define promote_action(rsc, node, optional) custom_action( \
247  rsc, promote_key(rsc), CRMD_ACTION_PROMOTE, node, \
248  optional, TRUE, data_set)
249 
250 # define promoted_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_PROMOTED, 0)
251 # define promoted_action(rsc, node, optional) custom_action( \
252  rsc, promoted_key(rsc), CRMD_ACTION_PROMOTED, node, \
253  optional, TRUE, data_set)
254 
255 # define demote_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_DEMOTE, 0)
256 # define demote_action(rsc, node, optional) custom_action( \
257  rsc, demote_key(rsc), CRMD_ACTION_DEMOTE, node, \
258  optional, TRUE, data_set)
259 
260 # define demoted_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_DEMOTED, 0)
261 # define demoted_action(rsc, node, optional) custom_action( \
262  rsc, demoted_key(rsc), CRMD_ACTION_DEMOTED, node, \
263  optional, TRUE, data_set)
264 
265 extern int pe_get_configured_timeout(resource_t *rsc, const char *action,
266  pe_working_set_t *data_set);
267 
268 extern action_t *find_first_action(GListPtr input, const char *uuid, const char *task,
269  node_t * on_node);
270 extern enum action_tasks get_complex_task(resource_t * rsc, const char *name,
271  gboolean allow_non_atomic);
272 
273 extern GListPtr find_actions(GListPtr input, const char *key, const node_t *on_node);
274 GList *find_actions_exact(GList *input, const char *key,
275  const pe_node_t *on_node);
276 extern GListPtr find_recurring_actions(GListPtr input, node_t * not_on_node);
277 GList *pe__resource_actions(const pe_resource_t *rsc, const pe_node_t *node,
278  const char *task, bool require_node);
279 
280 extern void pe_free_action(action_t * action);
281 
282 extern void resource_location(resource_t * rsc, node_t * node, int score, const char *tag,
283  pe_working_set_t * data_set);
284 
285 extern gint sort_op_by_callid(gconstpointer a, gconstpointer b);
286 extern gboolean get_target_role(resource_t * rsc, enum rsc_role_e *role);
287 
288 extern resource_t *find_clone_instance(resource_t * rsc, const char *sub_id,
289  pe_working_set_t * data_set);
290 
291 extern void destroy_ticket(gpointer data);
292 extern ticket_t *ticket_new(const char *ticket_id, pe_working_set_t * data_set);
293 
294 // Resources for manipulating resource names
295 const char *pe_base_name_end(const char *id);
296 char *clone_strip(const char *last_rsc_id);
297 char *clone_zero(const char *last_rsc_id);
298 
299 static inline bool
300 pe_base_name_eq(resource_t *rsc, const char *id)
301 {
302  if (id && rsc && rsc->id) {
303  // Number of characters in rsc->id before any clone suffix
304  size_t base_len = pe_base_name_end(rsc->id) - rsc->id + 1;
305 
306  return (strlen(id) == base_len) && !strncmp(id, rsc->id, base_len);
307  }
308  return FALSE;
309 }
310 
311 int pe__target_rc_from_xml(xmlNode *xml_op);
312 
313 gint sort_node_uname(gconstpointer a, gconstpointer b);
314 bool is_set_recursive(resource_t * rsc, long long flag, bool any);
315 
326 };
327 
328 typedef struct op_digest_cache_s {
330  xmlNode *params_all;
331  xmlNode *params_secure;
332  xmlNode *params_restart;
337 
338 op_digest_cache_t *rsc_action_digest_cmp(resource_t * rsc, xmlNode * xml_op, node_t * node,
339  pe_working_set_t * data_set);
340 
341 action_t *pe_fence_op(node_t * node, const char *op, bool optional, const char *reason, pe_working_set_t * data_set);
342 void trigger_unfencing(
343  resource_t * rsc, node_t *node, const char *reason, action_t *dependency, pe_working_set_t * data_set);
344 
345 void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite);
346 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);
347 
348 #define pe_action_required(action, reason, text) pe_action_set_flag_reason(__FUNCTION__, __LINE__, action, reason, text, pe_action_optional, FALSE)
349 #define pe_action_implies(action, reason, flag) pe_action_set_flag_reason(__FUNCTION__, __LINE__, action, reason, NULL, flag, FALSE)
350 
351 void set_bit_recursive(resource_t * rsc, unsigned long long flag);
352 void clear_bit_recursive(resource_t * rsc, unsigned long long flag);
353 
354 gboolean add_tag_ref(GHashTable * tags, const char * tag_name, const char * obj_ref);
355 
356 void print_rscs_brief(GListPtr rsc_list, const char * pre_text, long options,
357  void * print_data, gboolean print_all);
358 void pe__rscs_brief_output(pcmk__output_t *out, GListPtr rsc_list, long options, gboolean print_all);
359 void pe_fence_node(pe_working_set_t * data_set, node_t * node, const char *reason);
360 
361 node_t *pe_create_node(const char *id, const char *uname, const char *type,
362  const char *score, pe_working_set_t * data_set);
363 bool remote_id_conflict(const char *remote_name, pe_working_set_t *data);
364 void common_print(resource_t * rsc, const char *pre_text, const char *name, node_t *node, long options, void *print_data);
365 void pe__common_output_text(pcmk__output_t *out, resource_t * rsc, const char *name, node_t *node, long options);
366 void pe__common_output_html(pcmk__output_t *out, resource_t * rsc, const char *name, node_t *node, long options);
368  const pe_node_t *node);
370 const char *pe__add_bundle_remote_name(pe_resource_t *rsc, xmlNode *xml,
371  const char *field);
372 const char *pe_node_attribute_calculated(const pe_node_t *node,
373  const char *name,
374  const resource_t *rsc);
375 const char *pe_node_attribute_raw(pe_node_t *node, const char *name);
377  pe_working_set_t *data_set);
378 void pe__add_param_check(xmlNode *rsc_op, pe_resource_t *rsc, pe_node_t *node,
379  enum pe_check_parameters, pe_working_set_t *data_set);
381  void (*cb)(pe_resource_t*, pe_node_t*, xmlNode*,
382  enum pe_check_parameters,
383  pe_working_set_t*));
385 
387 void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set);
388 
389 #define BOOL2STR(x) ((x) ? "true" : "false")
390 
395 
396 void pe__unpack_dataset_nvpairs(xmlNode *xml_obj, const char *set_name,
397  GHashTable *node_hash, GHashTable *hash,
398  const char *always_first, gboolean overwrite,
399  pe_working_set_t *data_set);
400 
402 
403 #endif
pe_action_flags
pe_action_flags
Definition: pe_types.h:265
find_actions_exact
GList * find_actions_exact(GList *input, const char *key, const pe_node_t *on_node)
Definition: utils.c:1469
get_target_role
gboolean get_target_role(resource_t *rsc, enum rsc_role_e *role)
Definition: utils.c:1742
pe__unpack_dataset_nvpairs
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:2558
pe_base_name_end
const char * pe_base_name_end(const char *id)
Definition: unpack.c:1499
RSC_DIGEST_RESTART
Definition: internal.h:320
GListPtr
GList * GListPtr
Definition: crm.h:214
remote_internal.h
pe__bundle_resource_state
enum rsc_role_e pe__bundle_resource_state(const pe_resource_t *rsc, gboolean current)
Definition: bundle.c:1891
order_actions
gboolean order_actions(action_t *lh_action, action_t *rh_action, enum pe_ordering order)
Definition: utils.c:1778
pe__clone_html
int pe__clone_html(pcmk__output_t *out, va_list args)
Definition: clone.c:600
native_resource_state
enum rsc_role_e native_resource_state(const resource_t *rsc, gboolean current)
Definition: native.c:1183
rsc_digest_cmp_val
rsc_digest_cmp_val
Definition: internal.h:316
pe_fc_default
Definition: internal.h:148
find_rsc_op_entry
xmlNode * find_rsc_op_entry(resource_t *rsc, const char *key)
Definition: utils.c:1261
pe__location_constraint_s::rsc_lh
pe_resource_t * rsc_lh
Definition: internal.h:30
group_active
gboolean group_active(resource_t *rsc, gboolean all)
Definition: group.c:93
op_digest_cache_s::rc
enum rsc_digest_cmp_val rc
Definition: internal.h:329
op_digest_cache_s::digest_secure_calc
char * digest_secure_calc
Definition: internal.h:334
notify_data_s::action
const char * action
Definition: internal.h:54
flags
uint64_t flags
Definition: remote.c:148
pe__count_common
void pe__count_common(pe_resource_t *rsc)
Definition: complex.c:949
pe__rscs_brief_output
void pe__rscs_brief_output(pcmk__output_t *out, GListPtr rsc_list, long options, gboolean print_all)
Definition: native.c:1412
dump_node_capacity
void dump_node_capacity(int level, const char *comment, node_t *node)
Definition: utils.c:367
data
char data[0]
Definition: internal.h:90
common_update_score
void common_update_score(resource_t *rsc, const char *id, int score)
Definition: complex.c:725
common_free
void common_free(resource_t *rsc)
Definition: complex.c:778
clone_resource_state
enum rsc_role_e clone_resource_state(const resource_t *rsc, gboolean current)
Definition: clone.c:1006
sort_rsc_index
gint sort_rsc_index(gconstpointer a, gconstpointer b)
Definition: utils.c:401
native_unpack
gboolean native_unpack(resource_t *rsc, pe_working_set_t *data_set)
Definition: native.c:145
notify_data_s::pre
action_t * pre
Definition: internal.h:56
pe__common_output_html
void pe__common_output_html(pcmk__output_t *out, resource_t *rsc, const char *name, node_t *node, long options)
Definition: native.c:657
pe_resource_s::id
char * id
Definition: pe_types.h:292
op_digest_cache_s::params_secure
xmlNode * params_secure
Definition: internal.h:331
pe__order_constraint_s::rh_opaque
void * rh_opaque
Definition: internal.h:45
pe__clone_xml
int pe__clone_xml(pcmk__output_t *out, va_list args)
Definition: clone.c:572
pe_fc_fillers
Definition: internal.h:150
rsc_role_e
rsc_role_e
Definition: common.h:86
native_find_rsc
resource_t * native_find_rsc(resource_t *rsc, const char *id, const node_t *node, int flags)
Definition: native.c:214
pe__location_constraint_s::id
char * id
Definition: internal.h:29
pe__order_constraint_s::lh_action
action_t * lh_action
Definition: internal.h:42
sort_rsc_priority
gint sort_rsc_priority(gconstpointer a, gconstpointer b)
Definition: utils.c:428
pe_fc_effective
Definition: internal.h:149
print_rscs_brief
void print_rscs_brief(GListPtr rsc_list, const char *pre_text, long options, void *print_data, gboolean print_all)
Definition: native.c:1332
get_complex_task
enum action_tasks get_complex_task(resource_t *rsc, const char *name, gboolean allow_non_atomic)
Definition: utils.c:1375
custom_action
action_t * custom_action(resource_t *rsc, char *key, const char *task, node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)
Definition: utils.c:455
op_digest_cache_t
struct op_digest_cache_s op_digest_cache_t
notify_data_s::master
GListPtr master
Definition: internal.h:67
find_clone_instance
resource_t * find_clone_instance(resource_t *rsc, const char *sub_id, pe_working_set_t *data_set)
Definition: clone.c:42
type
enum crm_ais_msg_types type
Definition: internal.h:83
pe_can_fence
bool pe_can_fence(pe_working_set_t *data_set, node_t *node)
Definition: utils.c:89
pe_get_configured_timeout
int pe_get_configured_timeout(resource_t *rsc, const char *action, pe_working_set_t *data_set)
Definition: utils.c:829
pe__update_recheck_time
void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set)
Definition: utils.c:2544
RSC_DIGEST_MATCH
Definition: internal.h:318
native_location
pe_node_t * native_location(const pe_resource_t *rsc, GList **list, int current)
Definition: native.c:1205
pe_ticket_s
Definition: pe_types.h:419
notify_data_s::active
GListPtr active
Definition: internal.h:61
pe__order_constraint_s::rh_action
action_t * rh_action
Definition: internal.h:47
trigger_unfencing
void trigger_unfencing(resource_t *rsc, node_t *node, const char *reason, action_t *dependency, pe_working_set_t *data_set)
Definition: utils.c:2371
pe__count_bundle
void pe__count_bundle(pe_resource_t *rsc)
Definition: bundle.c:1918
pe_action_set_flag_reason
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:2441
pe__group_xml
int pe__group_xml(pcmk__output_t *out, va_list args)
Definition: group.c:187
op_digest_cache_s::params_all
xmlNode * params_all
Definition: internal.h:330
pe__ordering_t
struct pe__order_constraint_s pe__ordering_t
pe__bundle_text
int pe__bundle_text(pcmk__output_t *out, va_list args)
Definition: bundle.c:1670
common_unpack
gboolean common_unpack(xmlNode *xml_obj, resource_t **rsc, resource_t *parent, pe_working_set_t *data_set)
Definition: complex.c:368
pe_get_failcount
int pe_get_failcount(node_t *node, resource_t *rsc, time_t *last_failure, uint32_t flags, xmlNode *xml_op, pe_working_set_t *data_set)
Definition: failcounts.c:251
pe__resource_html
int pe__resource_html(pcmk__output_t *out, va_list args)
Definition: native.c:1141
pe_discover_e
pe_discover_e
Definition: pe_types.h:439
native_free
void native_free(resource_t *rsc)
Definition: native.c:1176
clone_print
void clone_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: clone.c:368
common_print
void common_print(resource_t *rsc, const char *pre_text, const char *name, node_t *node, long options, void *print_data)
Definition: native.c:808
print_node
void print_node(const char *pre_text, node_t *node, gboolean details)
Definition: utils.c:1267
get_pseudo_op
action_t * get_pseudo_op(const char *name, pe_working_set_t *data_set)
Definition: utils.c:1830
pe__group_text
int pe__group_text(pcmk__output_t *out, va_list args)
Definition: group.c:235
pe__unpack_bundle
gboolean pe__unpack_bundle(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: bundle.c:1024
set_bit_recursive
void set_bit_recursive(resource_t *rsc, unsigned long long flag)
Definition: utils.c:2255
pe__resource_is_disabled
bool pe__resource_is_disabled(pe_resource_t *rsc)
Definition: utils.c:2576
pe_fence_node
void pe_fence_node(pe_working_set_t *data_set, node_t *node, const char *reason)
Schedule a fence action for a node.
Definition: unpack.c:78
node_list_dup
GListPtr node_list_dup(GListPtr list, gboolean reset, gboolean filter)
Definition: utils.c:205
pe_action_s
Definition: pe_types.h:369
pe__print_bundle
void pe__print_bundle(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: bundle.c:1755
rsc_action_digest_cmp
op_digest_cache_t * rsc_action_digest_cmp(resource_t *rsc, xmlNode *xml_op, node_t *node, pe_working_set_t *data_set)
Definition: utils.c:2050
notify_data_s::inactive
GListPtr inactive
Definition: internal.h:62
pe_fc_flags_e
pe_fc_flags_e
Definition: internal.h:147
pe__order_constraint_s::id
int id
Definition: internal.h:37
pe__order_constraint_s::rh_action_task
char * rh_action_task
Definition: internal.h:48
pe__location_constraint_s::role_filter
enum rsc_role_e role_filter
Definition: internal.h:31
clone_free
void clone_free(resource_t *rsc)
Definition: clone.c:972
group_print
void group_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: group.c:138
pe__bundle_html
int pe__bundle_html(pcmk__output_t *out, va_list args)
Definition: bundle.c:1580
is_set_recursive
bool is_set_recursive(resource_t *rsc, long long flag, bool any)
Definition: clone.c:337
pe__find_bundle_replica
pe_resource_t * pe__find_bundle_replica(const pe_resource_t *bundle, const pe_node_t *node)
Definition: bundle.c:1411
pe__free_bundle
void pe__free_bundle(pe_resource_t *rsc)
Definition: bundle.c:1857
notify_data_s::start
GListPtr start
Definition: internal.h:63
uname
char uname[MAX_NAME]
Definition: internal.h:85
pe__order_constraint_s::rh_rsc
resource_t * rh_rsc
Definition: internal.h:46
notify_data_s::post
action_t * post
Definition: internal.h:57
pe_action_set_reason
void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite)
Definition: utils.c:2499
op_digest_cache_s::digest_all_calc
char * digest_all_calc
Definition: internal.h:333
op_digest_cache_s::params_restart
xmlNode * params_restart
Definition: internal.h:332
clone_unpack
gboolean clone_unpack(resource_t *rsc, pe_working_set_t *data_set)
Definition: clone.c:112
pe_node_attribute_calculated
const char * pe_node_attribute_calculated(const pe_node_t *node, const char *name, const resource_t *rsc)
Definition: common.c:429
notify_data_s::promote
GListPtr promote
Definition: internal.h:66
pe__register_messages
void pe__register_messages(pcmk__output_t *out)
Definition: pe_output.c:125
pe__foreach_param_check
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:241
pe__resource_xml
int pe__resource_xml(pcmk__output_t *out, va_list args)
Definition: native.c:1074
native_add_running
void native_add_running(resource_t *rsc, node_t *node, pe_working_set_t *data_set)
Definition: native.c:39
sort_op_by_callid
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
Definition: utils.c:1610
pe__order_constraint_s::lh_action_task
char * lh_action_task
Definition: internal.h:43
get_effective_time
time_t get_effective_time(pe_working_set_t *data_set)
Definition: utils.c:1727
pe__location_constraint_s::discover_mode
enum pe_discover_e discover_mode
Definition: internal.h:32
clone_strip
char * clone_strip(const char *last_rsc_id)
Definition: unpack.c:1539
pe__bundle_xml
int pe__bundle_xml(pcmk__output_t *out, va_list args)
Definition: bundle.c:1498
pe_working_set_s
Definition: pe_types.h:117
pe__shutdown_requested
bool pe__shutdown_requested(pe_node_t *node)
Definition: utils.c:2529
pe_metadata
void pe_metadata(void)
Definition: common.c:172
pe__group_html
int pe__group_html(pcmk__output_t *out, va_list args)
Definition: group.c:212
node_copy
node_t * node_copy(const node_t *this_node)
Definition: utils.c:132
RSC_DIGEST_ALL
Definition: internal.h:322
pe__find_active_on
pe_node_t * pe__find_active_on(const pe_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
Definition: complex.c:860
pe__common_output_text
void pe__common_output_text(pcmk__output_t *out, resource_t *rsc, const char *name, node_t *node, long options)
Definition: native.c:745
node_hash_from_list
GHashTable * node_hash_from_list(GListPtr list)
Definition: utils.c:188
clone_active
gboolean clone_active(resource_t *rsc, gboolean all)
Definition: clone.c:236
op_digest_cache_s::digest_restart_calc
char * digest_restart_calc
Definition: internal.h:335
pe_create_node
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:342
sort_node_uname
gint sort_node_uname(gconstpointer a, gconstpointer b)
Definition: utils.c:231
ticket_new
ticket_t * ticket_new(const char *ticket_id, pe_working_set_t *data_set)
Definition: utils.c:1859
pe__location_t
struct pe__location_constraint_s pe__location_t
add_hash_param
void add_hash_param(GHashTable *hash, const char *name, const char *value)
Definition: common.c:412
pe__order_constraint_s::lh_rsc
resource_t * lh_rsc
Definition: internal.h:41
add_tag_ref
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
Definition: utils.c:2405
pe__location_constraint_s::node_list_rh
GListPtr node_list_rh
Definition: internal.h:33
pe_fence_op
action_t * pe_fence_op(node_t *node, const char *op, bool optional, const char *reason, pe_working_set_t *data_set)
Definition: utils.c:2289
node_hash_dup
GHashTable * node_hash_dup(GHashTable *hash)
Definition: pcmk_sched_native.c:286
pcmk__output_s
This structure contains everything that makes up a single output formatter.
Definition: output.h:150
resource_location
void resource_location(resource_t *rsc, node_t *node, int score, const char *tag, pe_working_set_t *data_set)
Definition: utils.c:1566
native_parameter
char * native_parameter(resource_t *rsc, node_t *node, gboolean create, const char *name, pe_working_set_t *data_set)
Definition: native.c:269
find_actions
GListPtr find_actions(GListPtr input, const char *key, const node_t *on_node)
Definition: utils.c:1429
remote_id_conflict
bool remote_id_conflict(const char *remote_name, pe_working_set_t *data)
Definition: unpack.c:403
verify_pe_options
void verify_pe_options(GHashTable *options)
Definition: common.c:181
notify_data_s::slave
GListPtr slave
Definition: internal.h:68
dump_node_scores_worker
void dump_node_scores_worker(int level, const char *file, const char *function, int line, resource_t *rsc, const char *comment, GHashTable *nodes)
Definition: utils.c:283
notify_data_s::allowed_nodes
GHashTable * allowed_nodes
Definition: internal.h:69
group_free
void group_free(resource_t *rsc)
Definition: group.c:258
dump_rsc_utilization
void dump_rsc_utilization(int level, const char *comment, resource_t *rsc, node_t *node)
Definition: utils.c:384
notify_data_s::post_done
action_t * post_done
Definition: internal.h:59
pe__free_param_checks
void pe__free_param_checks(pe_working_set_t *data_set)
Definition: remote.c:256
notify_data_s::stop
GListPtr stop
Definition: internal.h:64
pe_check_parameters
pe_check_parameters
Definition: pe_types.h:172
pe__clone_text
int pe__clone_text(pcmk__output_t *out, va_list args)
Definition: clone.c:787
pe__order_constraint_s::lh_opaque
void * lh_opaque
Definition: internal.h:40
pe__add_param_check
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:215
pe__resource_text
int pe__resource_text(pcmk__output_t *out, va_list args)
Definition: native.c:1158
native_print
void native_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: native.c:1053
pe__bundle_needs_remote_name
bool pe__bundle_needs_remote_name(pe_resource_t *rsc)
Definition: bundle.c:955
pe__resource_actions
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:1518
print_str_str
void print_str_str(gpointer key, gpointer value, gpointer user_data)
Definition: utils.c:1306
pe__clear_failcount
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
group_resource_state
enum rsc_role_e group_resource_state(const resource_t *rsc, gboolean current)
Definition: group.c:279
pe__find_active_requires
pe_node_t * pe__find_active_requires(const pe_resource_t *rsc, unsigned int *count)
Definition: complex.c:940
node_list_exclude
void node_list_exclude(GHashTable *list, GListPtr list2, gboolean merge_scores)
Definition: utils.c:153
pe_node_attribute_raw
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
Definition: common.c:468
group_unpack
gboolean group_unpack(resource_t *rsc, pe_working_set_t *data_set)
Definition: group.c:22
RSC_DIGEST_UNKNOWN
Definition: internal.h:325
notify_data_s::pre_done
action_t * pre_done
Definition: internal.h:58
merge_weights
int merge_weights(int w1, int w2)
Definition: common.c:375
pe_resource_s
Definition: pe_types.h:291
notify_data_s::demote
GListPtr demote
Definition: internal.h:65
pe__location_constraint_s
Definition: internal.h:28
native_active
gboolean native_active(resource_t *rsc, gboolean all)
Definition: native.c:314
clone_zero
char * clone_zero(const char *last_rsc_id)
Definition: unpack.c:1561
pe__order_constraint_s
Definition: internal.h:36
pe__output_node
void pe__output_node(node_t *node, gboolean details, pcmk__output_t *out)
Definition: pe_output.c:130
pe_free_action
void pe_free_action(action_t *action)
Definition: utils.c:1314
pe__bundle_active
gboolean pe__bundle_active(pe_resource_t *rsc, gboolean all)
Definition: bundle.c:1363
clear_bit_recursive
void clear_bit_recursive(resource_t *rsc, unsigned long long flag)
Definition: utils.c:2242
destroy_ticket
void destroy_ticket(gpointer data)
Definition: utils.c:1847
notify_data_s::keys
GSList * keys
Definition: internal.h:52
notify_data_s
Definition: internal.h:51
action_tasks
action_tasks
Definition: common.h:57
pe_node_s
Definition: pe_types.h:216
pe__order_constraint_s::type
enum pe_ordering type
Definition: internal.h:38
pe__is_universal_clone
bool pe__is_universal_clone(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: clone.c:1032
status.h
Cluster status and scheduling.
pe__name_and_nvpairs_xml
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:15
pe__add_bundle_remote_name
const char * pe__add_bundle_remote_name(pe_resource_t *rsc, xmlNode *xml, const char *field)
Definition: bundle.c:985
notify_data_t
struct notify_data_s notify_data_t
pe__target_rc_from_xml
int pe__target_rc_from_xml(xmlNode *xml_op)
Definition: unpack.c:3250
output.h
Formatted output for pacemaker tools.
find_recurring_actions
GListPtr find_recurring_actions(GListPtr input, node_t *not_on_node)
Definition: utils.c:1341
find_first_action
action_t * find_first_action(GListPtr input, const char *uuid, const char *task, node_t *on_node)
Definition: utils.c:1399
op_digest_cache_s
Definition: internal.h:328
pe_ordering
pe_ordering
Definition: pe_types.h:446