root/include/crm/pengine/internal.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. pe__rsc_bool_str
  2. pe__current_node
  3. pe_hash_table_lookup
  4. pe_base_name_eq
  5. pe__health_strategy
  6. pe__health_score

   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>
  15 #  include <crm/pengine/remote_internal.h>
  16 #  include <crm/common/internal.h>
  17 #  include <crm/common/options_internal.h>
  18 #  include <crm/common/output_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 
 143 enum pe_warn_once_e {
 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),
 150     pe_wo_neg_threshold = (1 << 6),
 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 
 171 typedef struct pe__location_constraint_s {
 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*
 177 } pe__location_t;
 178 
 179 typedef struct pe__order_constraint_s {
 180     int id;
 181     enum pe_ordering type;
 182 
 183     void *lh_opaque;
 184     pe_resource_t *lh_rsc;
 185     pe_action_t *lh_action;
 186     char *lh_action_task;
 187 
 188     void *rh_opaque;
 189     pe_resource_t *rh_rsc;
 190     pe_action_t *rh_action;
 191     char *rh_action_task;
 192 } pe__ordering_t;
 193 
 194 typedef struct notify_data_s {
 195     GSList *keys;               // Environment variable name/value pairs
 196 
 197     const char *action;
 198 
 199     pe_action_t *pre;
 200     pe_action_t *post;
 201     pe_action_t *pre_done;
 202     pe_action_t *post_done;
 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 
 216 bool pe_can_fence(pe_working_set_t *data_set, pe_node_t *node);
 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,
 221                        pe_working_set_t * data_set);
 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 
 230 gboolean native_unpack(pe_resource_t * rsc, pe_working_set_t * data_set);
 231 gboolean group_unpack(pe_resource_t * rsc, pe_working_set_t * data_set);
 232 gboolean clone_unpack(pe_resource_t * rsc, pe_working_set_t * data_set);
 233 gboolean pe__unpack_bundle(pe_resource_t *rsc, pe_working_set_t *data_set);
 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)
     /* [previous][next][first][last][top][bottom][index][help] */
 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);
 284 enum rsc_role_e pe__bundle_resource_state(const pe_resource_t *rsc,
 285                                           gboolean current);
 286 
 287 void pe__count_common(pe_resource_t *rsc);
 288 void pe__count_bundle(pe_resource_t *rsc);
 289 
 290 gboolean common_unpack(xmlNode * xml_obj, pe_resource_t ** rsc, pe_resource_t * parent,
 291                        pe_working_set_t * data_set);
 292 void common_free(pe_resource_t * rsc);
 293 
 294 pe_node_t *pe__copy_node(const pe_node_t *this_node);
 295 extern time_t get_effective_time(pe_working_set_t * data_set);
 296 
 297 /* Failure handling utilities (from failcounts.c) */
 298 
 299 // bit flags for fail count handling options
 300 enum pe_fc_flags_e {
 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,
 308                      pe_working_set_t *data_set);
 309 
 310 pe_action_t *pe__clear_failcount(pe_resource_t *rsc, pe_node_t *node,
 311                                  const char *reason,
 312                                  pe_working_set_t *data_set);
 313 
 314 /* Functions for finding/counting a resource's active nodes */
 315 
 316 pe_node_t *pe__find_active_on(const pe_resource_t *rsc,
 317                               unsigned int *count_all,
 318                               unsigned int *count_clean);
 319 pe_node_t *pe__find_active_requires(const pe_resource_t *rsc,
 320                                     unsigned int *count);
 321 
 322 static inline pe_node_t *
 323 pe__current_node(const pe_resource_t *rsc)
     /* [previous][next][first][last][top][bottom][index][help] */
 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)
     /* [previous][next][first][last][top][bottom][index][help] */
 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,
 353                               pe_working_set_t *data_set);
 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,
 415                                      pe_working_set_t *data_set);
 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,
 432                               pe_working_set_t * data_set);
 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,
 440                                           pe_working_set_t * data_set);
 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)
     /* [previous][next][first][last][top][bottom][index][help] */
 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 
 467 enum rsc_digest_cmp_val {
 468     /*! Digests are the same */
 469     RSC_DIGEST_MATCH = 0,
 470     /*! Params that require a restart changed */
 471     RSC_DIGEST_RESTART,
 472     /*! Some parameter changed.  */
 473     RSC_DIGEST_ALL,
 474     /*! rsc op didn't have a digest associated with it, so
 475      *  it is unknown if parameters changed or not. */
 476     RSC_DIGEST_UNKNOWN,
 477 };
 478 
 479 typedef struct op_digest_cache_s {
 480     enum rsc_digest_cmp_val rc;
 481     xmlNode *params_all;
 482     xmlNode *params_secure;
 483     xmlNode *params_restart;
 484     char *digest_all_calc;
 485     char *digest_secure_calc;
 486     char *digest_restart_calc;
 487 } op_digest_cache_t;
 488 
 489 op_digest_cache_t *pe__calculate_digests(pe_resource_t *rsc, const char *task,
 490                                          guint *interval_ms, pe_node_t *node,
 491                                          xmlNode *xml_op, GHashTable *overrides,
 492                                          bool calc_secure,
 493                                          pe_working_set_t *data_set);
 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,
 498                                          pe_working_set_t * data_set);
 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 
 504 char *pe__action2reason(pe_action_t *action, enum pe_action_flags flag);
 505 void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite);
 506 
 507 void pe__set_resource_flags_recursive(pe_resource_t *rsc, uint64_t flags);
 508 void pe__clear_resource_flags_recursive(pe_resource_t *rsc, uint64_t flags);
 509 void pe__clear_resource_flags_on_all(pe_working_set_t *data_set, uint64_t flag);
 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);
 523 pe_resource_t *pe__find_bundle_replica(const pe_resource_t *bundle,
 524                                        const pe_node_t *node);
 525 bool pe__bundle_needs_remote_name(pe_resource_t *rsc,
 526                                   pe_working_set_t *data_set);
 527 const char *pe__add_bundle_remote_name(pe_resource_t *rsc,
 528                                        pe_working_set_t *data_set,
 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);
 534 bool pe__is_universal_clone(pe_resource_t *rsc,
 535                             pe_working_set_t *data_set);
 536 void pe__add_param_check(xmlNode *rsc_op, pe_resource_t *rsc, pe_node_t *node,
 537                          enum pe_check_parameters, pe_working_set_t *data_set);
 538 void pe__foreach_param_check(pe_working_set_t *data_set,
 539                              void (*cb)(pe_resource_t*, pe_node_t*, xmlNode*,
 540                                         enum pe_check_parameters,
 541                                         pe_working_set_t*));
 542 void pe__free_param_checks(pe_working_set_t *data_set);
 543 
 544 bool pe__shutdown_requested(pe_node_t *node);
 545 void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set);
 546 
 547 /*!
 548  * \internal
 549  * \brief Register xml formatting message functions.
 550  */
 551 void pe__register_messages(pcmk__output_t *out);
 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,
 556                                 pe_working_set_t *data_set);
 557 
 558 bool pe__resource_is_disabled(pe_resource_t *rsc);
 559 pe_action_t *pe__clear_resource_history(pe_resource_t *rsc, pe_node_t *node,
 560                                         pe_working_set_t *data_set);
 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)
     /* [previous][next][first][last][top][bottom][index][help] */
 588 {
 589     return pcmk__parse_health_strategy(pe_pref(data_set->config_hash,
 590                                                PCMK__OPT_NODE_HEALTH_STRATEGY));
 591 }
 592 
 593 static inline int
 594 pe__health_score(const char *option, pe_working_set_t *data_set)
     /* [previous][next][first][last][top][bottom][index][help] */
 595 {
 596     return char2score(pe_pref(data_set->config_hash, option));
 597 }
 598 
 599 #endif

/* [previous][next][first][last][top][bottom][index][help] */