root/lib/pacemaker/libpacemaker_private.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. pcmk__colocation_has_influence

   1 /*
   2  * Copyright 2021-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 PCMK__LIBPACEMAKER_PRIVATE__H
  11 #  define PCMK__LIBPACEMAKER_PRIVATE__H
  12 
  13 /* This header is for the sole use of libpacemaker, so that functions can be
  14  * declared with G_GNUC_INTERNAL for efficiency.
  15  */
  16 
  17 #include <crm/pengine/pe_types.h> // pe_action_t, pe_node_t, pe_working_set_t
  18 
  19 // Flags to modify the behavior of pcmk__add_colocated_node_scores()
  20 enum pcmk__coloc_select {
  21     // With no other flags, apply all "with this" colocations
  22     pcmk__coloc_select_default      = 0,
  23 
  24     // Apply "this with" colocations instead of "with this" colocations
  25     pcmk__coloc_select_this_with    = (1 << 0),
  26 
  27     // Apply only colocations with non-negative scores
  28     pcmk__coloc_select_nonnegative  = (1 << 1),
  29 
  30     // Apply only colocations with at least one matching node
  31     pcmk__coloc_select_active       = (1 << 2),
  32 };
  33 
  34 // Flags the update_ordered_actions() method can return
  35 enum pcmk__updated {
  36     pcmk__updated_none      = 0,        // Nothing changed
  37     pcmk__updated_first     = (1 << 0), // First action was updated
  38     pcmk__updated_then      = (1 << 1), // Then action was updated
  39 };
  40 
  41 #define pcmk__set_updated_flags(au_flags, action, flags_to_set) do {        \
  42         au_flags = pcmk__set_flags_as(__func__, __LINE__,                   \
  43                                       LOG_TRACE, "Action update",           \
  44                                       (action)->uuid, au_flags,             \
  45                                       (flags_to_set), #flags_to_set);       \
  46     } while (0)
  47 
  48 #define pcmk__clear_updated_flags(au_flags, action, flags_to_clear) do {    \
  49         au_flags = pcmk__clear_flags_as(__func__, __LINE__,                 \
  50                                         LOG_TRACE, "Action update",         \
  51                                         (action)->uuid, au_flags,           \
  52                                         (flags_to_clear), #flags_to_clear); \
  53     } while (0)
  54 
  55 // Resource allocation methods
  56 struct resource_alloc_functions_s {
  57     /*!
  58      * \internal
  59      * \brief Assign a resource to a node
  60      *
  61      * \param[in,out] rsc     Resource to assign to a node
  62      * \param[in]     prefer  Node to prefer, if all else is equal
  63      *
  64      * \return Node that \p rsc is assigned to, if assigned entirely to one node
  65      */
  66     pe_node_t *(*assign)(pe_resource_t *rsc, const pe_node_t *prefer);
  67 
  68     /*!
  69      * \internal
  70      * \brief Create all actions needed for a given resource
  71      *
  72      * \param[in,out] rsc  Resource to create actions for
  73      */
  74     void (*create_actions)(pe_resource_t *rsc);
  75 
  76     /*!
  77      * \internal
  78      * \brief Schedule any probes needed for a resource on a node
  79      *
  80      * \param[in] rsc   Resource to create probe for
  81      * \param[in] node  Node to create probe on
  82      *
  83      * \return true if any probe was created, otherwise false
  84      */
  85     bool (*create_probe)(pe_resource_t *rsc, pe_node_t *node);
  86 
  87     /*!
  88      * \internal
  89      * \brief Create implicit constraints needed for a resource
  90      *
  91      * \param[in,out] rsc  Resource to create implicit constraints for
  92      */
  93     void (*internal_constraints)(pe_resource_t *rsc);
  94 
  95     /*!
  96      * \internal
  97      * \brief Apply a colocation's score to node weights or resource priority
  98      *
  99      * Given a colocation constraint, apply its score to the dependent's
 100      * allowed node weights (if we are still placing resources) or priority (if
 101      * we are choosing promotable clone instance roles).
 102      *
 103      * \param[in,out] dependent      Dependent resource in colocation
 104      * \param[in]     primary        Primary resource in colocation
 105      * \param[in]     colocation     Colocation constraint to apply
 106      * \param[in]     for_dependent  true if called on behalf of dependent
 107      */
 108     void (*apply_coloc_score) (pe_resource_t *dependent,
 109                                const pe_resource_t *primary,
 110                                const pcmk__colocation_t *colocation,
 111                                bool for_dependent);
 112 
 113     /*!
 114      * \internal
 115      * \brief Create list of all resources in colocations with a given resource
 116      *
 117      * Given a resource, create a list of all resources involved in mandatory
 118      * colocations with it, whether directly or indirectly via chained colocations.
 119      *
 120      * \param[in] rsc             Resource to add to colocated list
 121      * \param[in] orig_rsc        Resource originally requested
 122      * \param[in] colocated_rscs  Existing list
 123      *
 124      * \return List of given resource and all resources involved in colocations
 125      *
 126      * \note This function is recursive; top-level callers should pass NULL as
 127      *       \p colocated_rscs and \p orig_rsc, and the desired resource as
 128      *       \p rsc. The recursive calls will use other values.
 129      */
 130     GList *(*colocated_resources)(pe_resource_t *rsc, pe_resource_t *orig_rsc,
 131                                   GList *colocated_rscs);
 132 
 133     /*!
 134      * \internal
 135      * \brief Apply a location constraint to a resource's allowed node scores
 136      *
 137      * \param[in,out] rsc       Resource to apply constraint to
 138      * \param[in,out] location  Location constraint to apply
 139      */
 140     void (*apply_location)(pe_resource_t *rsc, pe__location_t *location);
 141 
 142     /*!
 143      * \internal
 144      * \brief Return action flags for a given resource action
 145      *
 146      * \param[in,out] action  Action to get flags for
 147      * \param[in]     node    If not NULL, limit effects to this node
 148      *
 149      * \return Flags appropriate to \p action on \p node
 150      * \note For primitives, this will be the same as action->flags regardless
 151      *       of node. For collective resources, the flags can differ due to
 152      *       multiple instances possibly being involved.
 153      */
 154     enum pe_action_flags (*action_flags)(pe_action_t *action,
 155                                          const pe_node_t *node);
 156 
 157     /*!
 158      * \internal
 159      * \brief Update two actions according to an ordering between them
 160      *
 161      * Given information about an ordering of two actions, update the actions'
 162      * flags (and runnable_before members if appropriate) as appropriate for the
 163      * ordering. In some cases, the ordering could be disabled as well.
 164      *
 165      * \param[in,out] first     'First' action in an ordering
 166      * \param[in,out] then      'Then' action in an ordering
 167      * \param[in]     node      If not NULL, limit scope of ordering to this
 168      *                          node (only used when interleaving instances)
 169      * \param[in]     flags     Action flags for \p first for ordering purposes
 170      * \param[in]     filter    Action flags to limit scope of certain updates
 171      *                          (may include pe_action_optional to affect only
 172      *                          mandatory actions, and pe_action_runnable to
 173      *                          affect only runnable actions)
 174      * \param[in]     type      Group of enum pe_ordering flags to apply
 175      * \param[in,out] data_set  Cluster working set
 176      *
 177      * \return Group of enum pcmk__updated flags indicating what was updated
 178      */
 179     uint32_t (*update_ordered_actions)(pe_action_t *first, pe_action_t *then,
 180                                        const pe_node_t *node, uint32_t flags,
 181                                        uint32_t filter, uint32_t type,
 182                                        pe_working_set_t *data_set);
 183 
 184     void (*output_actions)(pe_resource_t *rsc);
 185 
 186     /*!
 187      * \internal
 188      * \brief Add a resource's actions to the transition graph
 189      *
 190      * \param[in] rsc  Resource whose actions should be added
 191      */
 192     void (*add_actions_to_graph)(pe_resource_t *rsc);
 193 
 194     /*!
 195      * \internal
 196      * \brief Add meta-attributes relevant to transition graph actions to XML
 197      *
 198      * If a given resource supports variant-specific meta-attributes that are
 199      * needed for transition graph actions, add them to a given XML element.
 200      *
 201      * \param[in]     rsc  Resource whose meta-attributes should be added
 202      * \param[in,out] xml  Transition graph action attributes XML to add to
 203      */
 204     void (*add_graph_meta)(pe_resource_t *rsc, xmlNode *xml);
 205 
 206     /*!
 207      * \internal
 208      * \brief Add a resource's utilization to a table of utilization values
 209      *
 210      * This function is used when summing the utilization of a resource and all
 211      * resources colocated with it, to determine whether a node has sufficient
 212      * capacity. Given a resource and a table of utilization values, it will add
 213      * the resource's utilization to the existing values, if the resource has
 214      * not yet been allocated to a node.
 215      *
 216      * \param[in]     rsc          Resource with utilization to add
 217      * \param[in]     orig_rsc     Resource being allocated (for logging only)
 218      * \param[in]     all_rscs     List of all resources that will be summed
 219      * \param[in,out] utilization  Table of utilization values to add to
 220      */
 221     void (*add_utilization)(const pe_resource_t *rsc,
 222                             const pe_resource_t *orig_rsc, GList *all_rscs,
 223                             GHashTable *utilization);
 224 
 225     /*!
 226      * \internal
 227      * \brief Apply a shutdown lock for a resource, if appropriate
 228      *
 229      * \param[in] rsc       Resource to check for shutdown lock
 230      */
 231     void (*shutdown_lock)(pe_resource_t *rsc);
 232 };
 233 
 234 // Actions (pcmk_sched_actions.c)
 235 
 236 G_GNUC_INTERNAL
 237 void pcmk__update_action_for_orderings(pe_action_t *action,
 238                                        pe_working_set_t *data_set);
 239 
 240 G_GNUC_INTERNAL
 241 uint32_t pcmk__update_ordered_actions(pe_action_t *first, pe_action_t *then,
 242                                       const pe_node_t *node, uint32_t flags,
 243                                       uint32_t filter, uint32_t type,
 244                                       pe_working_set_t *data_set);
 245 
 246 G_GNUC_INTERNAL
 247 void pcmk__log_action(const char *pre_text, pe_action_t *action, bool details);
 248 
 249 G_GNUC_INTERNAL
 250 pe_action_t *pcmk__new_cancel_action(pe_resource_t *rsc, const char *name,
 251                                      guint interval_ms, const pe_node_t *node);
 252 
 253 G_GNUC_INTERNAL
 254 pe_action_t *pcmk__new_shutdown_action(pe_node_t *node);
 255 
 256 G_GNUC_INTERNAL
 257 bool pcmk__action_locks_rsc_to_node(const pe_action_t *action);
 258 
 259 G_GNUC_INTERNAL
 260 void pcmk__deduplicate_action_inputs(pe_action_t *action);
 261 
 262 G_GNUC_INTERNAL
 263 void pcmk__output_actions(pe_working_set_t *data_set);
 264 
 265 G_GNUC_INTERNAL
 266 bool pcmk__check_action_config(pe_resource_t *rsc, pe_node_t *node,
 267                                xmlNode *xml_op);
 268 
 269 G_GNUC_INTERNAL
 270 void pcmk__handle_rsc_config_changes(pe_working_set_t *data_set);
 271 
 272 
 273 // Recurring actions (pcmk_sched_recurring.c)
 274 
 275 G_GNUC_INTERNAL
 276 void pcmk__create_recurring_actions(pe_resource_t *rsc);
 277 
 278 G_GNUC_INTERNAL
 279 void pcmk__schedule_cancel(pe_resource_t *rsc, const char *call_id,
 280                            const char *task, guint interval_ms,
 281                            const pe_node_t *node, const char *reason);
 282 
 283 G_GNUC_INTERNAL
 284 void pcmk__reschedule_recurring(pe_resource_t *rsc, const char *task,
 285                                 guint interval_ms, pe_node_t *node);
 286 
 287 G_GNUC_INTERNAL
 288 bool pcmk__action_is_recurring(const pe_action_t *action);
 289 
 290 
 291 // Producing transition graphs (pcmk_graph_producer.c)
 292 
 293 G_GNUC_INTERNAL
 294 bool pcmk__graph_has_loop(pe_action_t *init_action, pe_action_t *action,
 295                           pe_action_wrapper_t *input);
 296 
 297 G_GNUC_INTERNAL
 298 void pcmk__add_rsc_actions_to_graph(pe_resource_t *rsc);
 299 
 300 G_GNUC_INTERNAL
 301 void pcmk__create_graph(pe_working_set_t *data_set);
 302 
 303 
 304 // Fencing (pcmk_sched_fencing.c)
 305 
 306 G_GNUC_INTERNAL
 307 void pcmk__order_vs_fence(pe_action_t *stonith_op, pe_working_set_t *data_set);
 308 
 309 G_GNUC_INTERNAL
 310 void pcmk__order_vs_unfence(pe_resource_t *rsc, pe_node_t *node,
 311                             pe_action_t *action, enum pe_ordering order);
 312 
 313 G_GNUC_INTERNAL
 314 void pcmk__fence_guest(pe_node_t *node);
 315 
 316 G_GNUC_INTERNAL
 317 bool pcmk__node_unfenced(pe_node_t *node);
 318 
 319 G_GNUC_INTERNAL
 320 void pcmk__order_restart_vs_unfence(gpointer data, gpointer user_data);
 321 
 322 
 323 // Injected scheduler inputs (pcmk_sched_injections.c)
 324 
 325 void pcmk__inject_scheduler_input(pe_working_set_t *data_set, cib_t *cib,
 326                                   pcmk_injections_t *injections);
 327 
 328 
 329 // Constraints of any type (pcmk_sched_constraints.c)
 330 
 331 G_GNUC_INTERNAL
 332 pe_resource_t *pcmk__find_constraint_resource(GList *rsc_list, const char *id);
 333 
 334 G_GNUC_INTERNAL
 335 xmlNode *pcmk__expand_tags_in_sets(xmlNode *xml_obj,
 336                                    pe_working_set_t *data_set);
 337 
 338 G_GNUC_INTERNAL
 339 bool pcmk__valid_resource_or_tag(pe_working_set_t *data_set, const char *id,
 340                                  pe_resource_t **rsc, pe_tag_t **tag);
 341 
 342 G_GNUC_INTERNAL
 343 bool pcmk__tag_to_set(xmlNode *xml_obj, xmlNode **rsc_set, const char *attr,
 344                       bool convert_rsc, pe_working_set_t *data_set);
 345 
 346 G_GNUC_INTERNAL
 347 void pcmk__create_internal_constraints(pe_working_set_t *data_set);
 348 
 349 
 350 // Location constraints
 351 
 352 G_GNUC_INTERNAL
 353 void pcmk__unpack_location(xmlNode *xml_obj, pe_working_set_t *data_set);
 354 
 355 G_GNUC_INTERNAL
 356 pe__location_t *pcmk__new_location(const char *id, pe_resource_t *rsc,
 357                                    int node_weight, const char *discover_mode,
 358                                    pe_node_t *foo_node,
 359                                    pe_working_set_t *data_set);
 360 
 361 G_GNUC_INTERNAL
 362 void pcmk__apply_locations(pe_working_set_t *data_set);
 363 
 364 G_GNUC_INTERNAL
 365 void pcmk__apply_location(pe_resource_t *rsc, pe__location_t *constraint);
 366 
 367 
 368 // Colocation constraints (pcmk_sched_colocation.c)
 369 
 370 enum pcmk__coloc_affects {
 371     pcmk__coloc_affects_nothing = 0,
 372     pcmk__coloc_affects_location,
 373     pcmk__coloc_affects_role,
 374 };
 375 
 376 G_GNUC_INTERNAL
 377 enum pcmk__coloc_affects pcmk__colocation_affects(const pe_resource_t *dependent,
 378                                                   const pe_resource_t *primary,
 379                                                   const pcmk__colocation_t *colocation,
 380                                                   bool preview);
 381 
 382 G_GNUC_INTERNAL
 383 void pcmk__apply_coloc_to_weights(pe_resource_t *dependent,
 384                                   const pe_resource_t *primary,
 385                                   const pcmk__colocation_t *colocation);
 386 
 387 G_GNUC_INTERNAL
 388 void pcmk__apply_coloc_to_priority(pe_resource_t *dependent,
 389                                    const pe_resource_t *primary,
 390                                    const pcmk__colocation_t *colocation);
 391 
 392 G_GNUC_INTERNAL
 393 void pcmk__add_colocated_node_scores(pe_resource_t *rsc, const char *log_id,
 394                                      GHashTable **nodes, const char *attr,
 395                                      float factor, uint32_t flags);
 396 
 397 G_GNUC_INTERNAL
 398 void pcmk__unpack_colocation(xmlNode *xml_obj, pe_working_set_t *data_set);
 399 
 400 G_GNUC_INTERNAL
 401 void pcmk__add_this_with(pe_resource_t *rsc, pcmk__colocation_t *colocation);
 402 
 403 G_GNUC_INTERNAL
 404 void pcmk__add_with_this(pe_resource_t *rsc, pcmk__colocation_t *colocation);
 405 
 406 G_GNUC_INTERNAL
 407 void pcmk__new_colocation(const char *id, const char *node_attr, int score,
 408                           pe_resource_t *dependent, pe_resource_t *primary,
 409                           const char *dependent_role, const char *primary_role,
 410                           bool influence, pe_working_set_t *data_set);
 411 
 412 G_GNUC_INTERNAL
 413 void pcmk__block_colocation_dependents(pe_action_t *action,
 414                                        pe_working_set_t *data_set);
 415 
 416 /*!
 417  * \internal
 418  * \brief Check whether colocation's dependent preferences should be considered
 419  *
 420  * \param[in] colocation  Colocation constraint
 421  * \param[in] rsc         Primary instance (normally this will be
 422  *                        colocation->primary, which NULL will be treated as,
 423  *                        but for clones or bundles with multiple instances
 424  *                        this can be a particular instance)
 425  *
 426  * \return true if colocation influence should be effective, otherwise false
 427  */
 428 static inline bool
 429 pcmk__colocation_has_influence(const pcmk__colocation_t *colocation,
     /* [previous][next][first][last][top][bottom][index][help] */
 430                                const pe_resource_t *rsc)
 431 {
 432     if (rsc == NULL) {
 433         rsc = colocation->primary;
 434     }
 435 
 436     /* A bundle replica colocates its remote connection with its container,
 437      * using a finite score so that the container can run on Pacemaker Remote
 438      * nodes.
 439      *
 440      * Moving a connection is lightweight and does not interrupt the service,
 441      * while moving a container is heavyweight and does interrupt the service,
 442      * so don't move a clean, active container based solely on the preferences
 443      * of its connection.
 444      *
 445      * This also avoids problematic scenarios where two containers want to
 446      * perpetually swap places.
 447      */
 448     if (pcmk_is_set(colocation->dependent->flags, pe_rsc_allow_remote_remotes)
 449         && !pcmk_is_set(rsc->flags, pe_rsc_failed)
 450         && pcmk__list_of_1(rsc->running_on)) {
 451         return false;
 452     }
 453 
 454     /* The dependent in a colocation influences the primary's location
 455      * if the influence option is true or the primary is not yet active.
 456      */
 457     return colocation->influence || (rsc->running_on == NULL);
 458 }
 459 
 460 
 461 // Ordering constraints (pcmk_sched_ordering.c)
 462 
 463 G_GNUC_INTERNAL
 464 void pcmk__new_ordering(pe_resource_t *first_rsc, char *first_task,
 465                         pe_action_t *first_action, pe_resource_t *then_rsc,
 466                         char *then_task, pe_action_t *then_action,
 467                         uint32_t flags, pe_working_set_t *data_set);
 468 
 469 G_GNUC_INTERNAL
 470 void pcmk__unpack_ordering(xmlNode *xml_obj, pe_working_set_t *data_set);
 471 
 472 G_GNUC_INTERNAL
 473 void pcmk__disable_invalid_orderings(pe_working_set_t *data_set);
 474 
 475 G_GNUC_INTERNAL
 476 void pcmk__order_stops_before_shutdown(pe_node_t *node,
 477                                        pe_action_t *shutdown_op);
 478 
 479 G_GNUC_INTERNAL
 480 void pcmk__apply_orderings(pe_working_set_t *data_set);
 481 
 482 G_GNUC_INTERNAL
 483 void pcmk__order_after_each(pe_action_t *after, GList *list);
 484 
 485 
 486 /*!
 487  * \internal
 488  * \brief Create a new ordering between two resource actions
 489  *
 490  * \param[in] first_rsc   Resource for 'first' action
 491  * \param[in] then_rsc    Resource for 'then' action
 492  * \param[in] first_task  Action key for 'first' action
 493  * \param[in] then_task   Action key for 'then' action
 494  * \param[in] flags       Bitmask of enum pe_ordering flags
 495  * \param[in] data_set    Cluster working set to add ordering to
 496  */
 497 #define pcmk__order_resource_actions(first_rsc, first_task,                 \
 498                                      then_rsc, then_task, flags)            \
 499     pcmk__new_ordering((first_rsc),                                         \
 500                        pcmk__op_key((first_rsc)->id, (first_task), 0),      \
 501                        NULL,                                                \
 502                        (then_rsc),                                          \
 503                        pcmk__op_key((then_rsc)->id, (then_task), 0),        \
 504                        NULL, (flags), (first_rsc)->cluster)
 505 
 506 #define pcmk__order_starts(rsc1, rsc2, flags)                \
 507     pcmk__order_resource_actions((rsc1), CRMD_ACTION_START,  \
 508                                  (rsc2), CRMD_ACTION_START, (flags))
 509 
 510 #define pcmk__order_stops(rsc1, rsc2, flags)                 \
 511     pcmk__order_resource_actions((rsc1), CRMD_ACTION_STOP,   \
 512                                  (rsc2), CRMD_ACTION_STOP, (flags))
 513 
 514 
 515 // Ticket constraints (pcmk_sched_tickets.c)
 516 
 517 G_GNUC_INTERNAL
 518 void pcmk__unpack_rsc_ticket(xmlNode *xml_obj, pe_working_set_t *data_set);
 519 
 520 
 521 // Promotable clone resources (pcmk_sched_promotable.c)
 522 
 523 G_GNUC_INTERNAL
 524 void pcmk__add_promotion_scores(pe_resource_t *rsc);
 525 
 526 G_GNUC_INTERNAL
 527 void pcmk__require_promotion_tickets(pe_resource_t *rsc);
 528 
 529 G_GNUC_INTERNAL
 530 void pcmk__set_instance_roles(pe_resource_t *rsc);
 531 
 532 G_GNUC_INTERNAL
 533 void pcmk__create_promotable_actions(pe_resource_t *clone);
 534 
 535 G_GNUC_INTERNAL
 536 void pcmk__promotable_restart_ordering(pe_resource_t *rsc);
 537 
 538 G_GNUC_INTERNAL
 539 void pcmk__order_promotable_instances(pe_resource_t *clone);
 540 
 541 G_GNUC_INTERNAL
 542 void pcmk__update_dependent_with_promotable(const pe_resource_t *primary,
 543                                             pe_resource_t *dependent,
 544                                             const pcmk__colocation_t *colocation);
 545 
 546 G_GNUC_INTERNAL
 547 void pcmk__update_promotable_dependent_priority(const pe_resource_t *primary,
 548                                                 pe_resource_t *dependent,
 549                                                 const pcmk__colocation_t *colocation);
 550 
 551 
 552 // Pacemaker Remote nodes (pcmk_sched_remote.c)
 553 
 554 G_GNUC_INTERNAL
 555 bool pcmk__is_failed_remote_node(pe_node_t *node);
 556 
 557 G_GNUC_INTERNAL
 558 void pcmk__order_remote_connection_actions(pe_working_set_t *data_set);
 559 
 560 G_GNUC_INTERNAL
 561 bool pcmk__rsc_corresponds_to_guest(pe_resource_t *rsc, pe_node_t *node);
 562 
 563 G_GNUC_INTERNAL
 564 pe_node_t *pcmk__connection_host_for_action(pe_action_t *action);
 565 
 566 G_GNUC_INTERNAL
 567 void pcmk__substitute_remote_addr(pe_resource_t *rsc, GHashTable *params);
 568 
 569 G_GNUC_INTERNAL
 570 void pcmk__add_bundle_meta_to_xml(xmlNode *args_xml, pe_action_t *action);
 571 
 572 
 573 // Primitives (pcmk_sched_primitive.c)
 574 
 575 G_GNUC_INTERNAL
 576 pe_node_t *pcmk__primitive_assign(pe_resource_t *rsc, const pe_node_t *prefer);
 577 
 578 G_GNUC_INTERNAL
 579 void pcmk__primitive_create_actions(pe_resource_t *rsc);
 580 
 581 G_GNUC_INTERNAL
 582 void pcmk__primitive_internal_constraints(pe_resource_t *rsc);
 583 
 584 G_GNUC_INTERNAL
 585 enum pe_action_flags pcmk__primitive_action_flags(pe_action_t *action,
 586                                                   const pe_node_t *node);
 587 
 588 G_GNUC_INTERNAL
 589 void pcmk__primitive_apply_coloc_score(pe_resource_t *dependent,
 590                                        const pe_resource_t *primary,
 591                                        const pcmk__colocation_t *colocation,
 592                                        bool for_dependent);
 593 
 594 G_GNUC_INTERNAL
 595 void pcmk__schedule_cleanup(pe_resource_t *rsc, const pe_node_t *node,
 596                             bool optional);
 597 
 598 G_GNUC_INTERNAL
 599 void pcmk__primitive_add_graph_meta(pe_resource_t *rsc, xmlNode *xml);
 600 
 601 G_GNUC_INTERNAL
 602 void pcmk__primitive_add_utilization(const pe_resource_t *rsc,
 603                                      const pe_resource_t *orig_rsc,
 604                                      GList *all_rscs, GHashTable *utilization);
 605 
 606 G_GNUC_INTERNAL
 607 void pcmk__primitive_shutdown_lock(pe_resource_t *rsc);
 608 
 609 
 610 // Groups (pcmk_sched_group.c)
 611 
 612 G_GNUC_INTERNAL
 613 pe_node_t *pcmk__group_assign(pe_resource_t *rsc, const pe_node_t *prefer);
 614 
 615 G_GNUC_INTERNAL
 616 void pcmk__group_create_actions(pe_resource_t *rsc);
 617 
 618 G_GNUC_INTERNAL
 619 void pcmk__group_internal_constraints(pe_resource_t *rsc);
 620 
 621 G_GNUC_INTERNAL
 622 void pcmk__group_apply_coloc_score(pe_resource_t *dependent,
 623                                    const pe_resource_t *primary,
 624                                    const pcmk__colocation_t *colocation,
 625                                    bool for_dependent);
 626 
 627 G_GNUC_INTERNAL
 628 void pcmk__group_apply_location(pe_resource_t *rsc, pe__location_t *location);
 629 
 630 G_GNUC_INTERNAL
 631 enum pe_action_flags pcmk__group_action_flags(pe_action_t *action,
 632                                               const pe_node_t *node);
 633 
 634 G_GNUC_INTERNAL
 635 uint32_t pcmk__group_update_ordered_actions(pe_action_t *first,
 636                                             pe_action_t *then,
 637                                             const pe_node_t *node,
 638                                             uint32_t flags, uint32_t filter,
 639                                             uint32_t type,
 640                                             pe_working_set_t *data_set);
 641 
 642 G_GNUC_INTERNAL
 643 GList *pcmk__group_colocated_resources(pe_resource_t *rsc,
 644                                        pe_resource_t *orig_rsc,
 645                                        GList *colocated_rscs);
 646 
 647 G_GNUC_INTERNAL
 648 void pcmk__group_add_utilization(const pe_resource_t *rsc,
 649                                  const pe_resource_t *orig_rsc, GList *all_rscs,
 650                                  GHashTable *utilization);
 651 
 652 G_GNUC_INTERNAL
 653 void pcmk__group_shutdown_lock(pe_resource_t *rsc);
 654 
 655 
 656 // Clones (pcmk_sched_clone.c)
 657 
 658 G_GNUC_INTERNAL
 659 void pcmk__clone_apply_coloc_score(pe_resource_t *dependent,
 660                                    const pe_resource_t *primary,
 661                                    const pcmk__colocation_t *colocation,
 662                                    bool for_dependent);
 663 
 664 // Bundles (pcmk_sched_bundle.c)
 665 
 666 G_GNUC_INTERNAL
 667 void pcmk__bundle_apply_coloc_score(pe_resource_t *dependent,
 668                                     const pe_resource_t *primary,
 669                                     const pcmk__colocation_t *colocation,
 670                                     bool for_dependent);
 671 
 672 G_GNUC_INTERNAL
 673 void pcmk__output_bundle_actions(pe_resource_t *rsc);
 674 
 675 
 676 // Injections (pcmk_injections.c)
 677 
 678 G_GNUC_INTERNAL
 679 xmlNode *pcmk__inject_node(cib_t *cib_conn, const char *node, const char *uuid);
 680 
 681 G_GNUC_INTERNAL
 682 xmlNode *pcmk__inject_node_state_change(cib_t *cib_conn, const char *node,
 683                                         bool up);
 684 
 685 G_GNUC_INTERNAL
 686 xmlNode *pcmk__inject_resource_history(pcmk__output_t *out, xmlNode *cib_node,
 687                                        const char *resource,
 688                                        const char *lrm_name,
 689                                        const char *rclass,
 690                                        const char *rtype,
 691                                        const char *rprovider);
 692 
 693 G_GNUC_INTERNAL
 694 void pcmk__inject_failcount(pcmk__output_t *out, xmlNode *cib_node,
 695                             const char *resource, const char *task,
 696                             guint interval_ms, int rc);
 697 
 698 G_GNUC_INTERNAL
 699 xmlNode *pcmk__inject_action_result(xmlNode *cib_resource,
 700                                     lrmd_event_data_t *op, int target_rc);
 701 
 702 
 703 // Nodes (pcmk_sched_nodes.c)
 704 
 705 G_GNUC_INTERNAL
 706 bool pcmk__node_available(const pe_node_t *node, bool consider_score,
 707                           bool consider_guest);
 708 
 709 G_GNUC_INTERNAL
 710 bool pcmk__any_node_available(GHashTable *nodes);
 711 
 712 G_GNUC_INTERNAL
 713 GHashTable *pcmk__copy_node_table(GHashTable *nodes);
 714 
 715 G_GNUC_INTERNAL
 716 GList *pcmk__sort_nodes(GList *nodes, pe_node_t *active_node);
 717 
 718 G_GNUC_INTERNAL
 719 void pcmk__apply_node_health(pe_working_set_t *data_set);
 720 
 721 G_GNUC_INTERNAL
 722 pe_node_t *pcmk__top_allowed_node(const pe_resource_t *rsc,
 723                                   const pe_node_t *node);
 724 
 725 
 726 // Functions applying to more than one variant (pcmk_sched_resource.c)
 727 
 728 G_GNUC_INTERNAL
 729 void pcmk__set_allocation_methods(pe_working_set_t *data_set);
 730 
 731 G_GNUC_INTERNAL
 732 bool pcmk__rsc_agent_changed(pe_resource_t *rsc, pe_node_t *node,
 733                              const xmlNode *rsc_entry, bool active_on_node);
 734 
 735 G_GNUC_INTERNAL
 736 GList *pcmk__rscs_matching_id(const char *id, pe_working_set_t *data_set);
 737 
 738 G_GNUC_INTERNAL
 739 GList *pcmk__colocated_resources(pe_resource_t *rsc, pe_resource_t *orig_rsc,
 740                                  GList *colocated_rscs);
 741 
 742 G_GNUC_INTERNAL
 743 void pcmk__noop_add_graph_meta(pe_resource_t *rsc, xmlNode *xml);
 744 
 745 G_GNUC_INTERNAL
 746 void pcmk__output_resource_actions(pe_resource_t *rsc);
 747 
 748 G_GNUC_INTERNAL
 749 bool pcmk__finalize_assignment(pe_resource_t *rsc, pe_node_t *chosen,
 750                                bool force);
 751 
 752 G_GNUC_INTERNAL
 753 bool pcmk__assign_resource(pe_resource_t *rsc, pe_node_t *node, bool force);
 754 
 755 G_GNUC_INTERNAL
 756 void pcmk__unassign_resource(pe_resource_t *rsc);
 757 
 758 G_GNUC_INTERNAL
 759 bool pcmk__threshold_reached(pe_resource_t *rsc, pe_node_t *node,
 760                              pe_resource_t **failed);
 761 
 762 G_GNUC_INTERNAL
 763 void pcmk__sort_resources(pe_working_set_t *data_set);
 764 
 765 G_GNUC_INTERNAL
 766 gint pcmk__cmp_instance(gconstpointer a, gconstpointer b);
 767 
 768 G_GNUC_INTERNAL
 769 gint pcmk__cmp_instance_number(gconstpointer a, gconstpointer b);
 770 
 771 
 772 // Functions related to probes (pcmk_sched_probes.c)
 773 
 774 G_GNUC_INTERNAL
 775 bool pcmk__probe_rsc_on_node(pe_resource_t *rsc, pe_node_t *node);
 776 
 777 G_GNUC_INTERNAL
 778 void pcmk__order_probes(pe_working_set_t *data_set);
 779 
 780 G_GNUC_INTERNAL
 781 bool pcmk__probe_resource_list(GList *rscs, pe_node_t *node);
 782 
 783 G_GNUC_INTERNAL
 784 void pcmk__schedule_probes(pe_working_set_t *data_set);
 785 
 786 
 787 // Functions related to live migration (pcmk_sched_migration.c)
 788 
 789 void pcmk__create_migration_actions(pe_resource_t *rsc,
 790                                     const pe_node_t *current);
 791 
 792 void pcmk__abort_dangling_migration(void *data, void *user_data);
 793 
 794 bool pcmk__rsc_can_migrate(const pe_resource_t *rsc, const pe_node_t *current);
 795 
 796 void pcmk__order_migration_equivalents(pe__ordering_t *order);
 797 
 798 
 799 // Functions related to node utilization (pcmk_sched_utilization.c)
 800 
 801 G_GNUC_INTERNAL
 802 int pcmk__compare_node_capacities(const pe_node_t *node1,
 803                                   const pe_node_t *node2);
 804 
 805 G_GNUC_INTERNAL
 806 void pcmk__consume_node_capacity(GHashTable *current_utilization,
 807                                  pe_resource_t *rsc);
 808 
 809 G_GNUC_INTERNAL
 810 void pcmk__release_node_capacity(GHashTable *current_utilization,
 811                                  const pe_resource_t *rsc);
 812 
 813 G_GNUC_INTERNAL
 814 const pe_node_t *pcmk__ban_insufficient_capacity(pe_resource_t *rsc);
 815 
 816 G_GNUC_INTERNAL
 817 void pcmk__create_utilization_constraints(pe_resource_t *rsc,
 818                                           GList *allowed_nodes);
 819 
 820 G_GNUC_INTERNAL
 821 void pcmk__show_node_capacities(const char *desc, pe_working_set_t *data_set);
 822 
 823 #endif // PCMK__LIBPACEMAKER_PRIVATE__H

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