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_node_attr
  2. pcmk__colocation_has_influence

   1 /*
   2  * Copyright 2021-2024 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/lrmd_events.h>      // lrmd_event_data_t
  18 #include <crm/common/scheduler.h> // pcmk_action_t, pcmk_node_t, etc.
  19 #include <crm/pengine/internal.h> // pcmk__location_t
  20 
  21 // Colocation flags
  22 enum pcmk__coloc_flags {
  23     pcmk__coloc_none        = 0U,
  24 
  25     // Primary is affected even if already active
  26     pcmk__coloc_influence   = (1U << 0),
  27 
  28     // Colocation was explicitly configured in CIB
  29     pcmk__coloc_explicit    = (1U << 1),
  30 };
  31 
  32 // Flags to modify the behavior of add_colocated_node_scores()
  33 enum pcmk__coloc_select {
  34     // With no other flags, apply all "with this" colocations
  35     pcmk__coloc_select_default      = 0,
  36 
  37     // Apply "this with" colocations instead of "with this" colocations
  38     pcmk__coloc_select_this_with    = (1 << 0),
  39 
  40     // Apply only colocations with non-negative scores
  41     pcmk__coloc_select_nonnegative  = (1 << 1),
  42 
  43     // Apply only colocations with at least one matching node
  44     pcmk__coloc_select_active       = (1 << 2),
  45 };
  46 
  47 // Flags the update_ordered_actions() method can return
  48 enum pcmk__updated {
  49     pcmk__updated_none      = 0,        // Nothing changed
  50     pcmk__updated_first     = (1 << 0), // First action was updated
  51     pcmk__updated_then      = (1 << 1), // Then action was updated
  52 };
  53 
  54 #define pcmk__set_updated_flags(au_flags, action, flags_to_set) do {        \
  55         au_flags = pcmk__set_flags_as(__func__, __LINE__,                   \
  56                                       LOG_TRACE, "Action update",           \
  57                                       (action)->uuid, au_flags,             \
  58                                       (flags_to_set), #flags_to_set);       \
  59     } while (0)
  60 
  61 #define pcmk__clear_updated_flags(au_flags, action, flags_to_clear) do {    \
  62         au_flags = pcmk__clear_flags_as(__func__, __LINE__,                 \
  63                                         LOG_TRACE, "Action update",         \
  64                                         (action)->uuid, au_flags,           \
  65                                         (flags_to_clear), #flags_to_clear); \
  66     } while (0)
  67 
  68 // Resource assignment methods
  69 struct resource_alloc_functions_s {
  70     /*!
  71      * \internal
  72      * \brief Assign a resource to a node
  73      *
  74      * \param[in,out] rsc           Resource to assign to a node
  75      * \param[in]     prefer        Node to prefer, if all else is equal
  76      * \param[in]     stop_if_fail  If \c true and \p rsc can't be assigned to a
  77      *                              node, set next role to stopped and update
  78      *                              existing actions (if \p rsc is not a
  79      *                              primitive, this applies to its primitive
  80      *                              descendants instead)
  81      *
  82      * \return Node that \p rsc is assigned to, if assigned entirely to one node
  83      *
  84      * \note If \p stop_if_fail is \c false, then \c pcmk__unassign_resource()
  85      *       can completely undo the assignment. A successful assignment can be
  86      *       either undone or left alone as final. A failed assignment has the
  87      *       same effect as calling pcmk__unassign_resource(); there are no side
  88      *       effects on roles or actions.
  89      */
  90     pcmk_node_t *(*assign)(pcmk_resource_t *rsc, const pcmk_node_t *prefer,
  91                            bool stop_if_fail);
  92 
  93     /*!
  94      * \internal
  95      * \brief Create all actions needed for a given resource
  96      *
  97      * \param[in,out] rsc  Resource to create actions for
  98      */
  99     void (*create_actions)(pcmk_resource_t *rsc);
 100 
 101     /*!
 102      * \internal
 103      * \brief Schedule any probes needed for a resource on a node
 104      *
 105      * \param[in,out] rsc   Resource to create probe for
 106      * \param[in,out] node  Node to create probe on
 107      *
 108      * \return true if any probe was created, otherwise false
 109      */
 110     bool (*create_probe)(pcmk_resource_t *rsc, pcmk_node_t *node);
 111 
 112     /*!
 113      * \internal
 114      * \brief Create implicit constraints needed for a resource
 115      *
 116      * \param[in,out] rsc  Resource to create implicit constraints for
 117      */
 118     void (*internal_constraints)(pcmk_resource_t *rsc);
 119 
 120     /*!
 121      * \internal
 122      * \brief Apply a colocation's score to node scores or resource priority
 123      *
 124      * Given a colocation constraint, apply its score to the dependent's
 125      * allowed node scores (if we are still placing resources) or priority (if
 126      * we are choosing promotable clone instance roles).
 127      *
 128      * \param[in,out] dependent      Dependent resource in colocation
 129      * \param[in]     primary        Primary resource in colocation
 130      * \param[in]     colocation     Colocation constraint to apply
 131      * \param[in]     for_dependent  true if called on behalf of dependent
 132      *
 133      * \return The score added to the dependent's priority
 134      */
 135     int (*apply_coloc_score)(pcmk_resource_t *dependent,
 136                              const pcmk_resource_t *primary,
 137                              const pcmk__colocation_t *colocation,
 138                              bool for_dependent);
 139 
 140     /*!
 141      * \internal
 142      * \brief Create list of all resources in colocations with a given resource
 143      *
 144      * Given a resource, create a list of all resources involved in mandatory
 145      * colocations with it, whether directly or via chained colocations.
 146      *
 147      * \param[in]     rsc             Resource to add to colocated list
 148      * \param[in]     orig_rsc        Resource originally requested
 149      * \param[in,out] colocated_rscs  Existing list
 150      *
 151      * \return List of given resource and all resources involved in colocations
 152      *
 153      * \note This function is recursive; top-level callers should pass NULL as
 154      *       \p colocated_rscs and \p orig_rsc, and the desired resource as
 155      *       \p rsc. The recursive calls will use other values.
 156      */
 157     GList *(*colocated_resources)(const pcmk_resource_t *rsc,
 158                                   const pcmk_resource_t *orig_rsc,
 159                                   GList *colocated_rscs);
 160 
 161     /*!
 162      * \internal
 163      * \brief Add colocations affecting a resource as primary to a list
 164      *
 165      * Given a resource being assigned (\p orig_rsc) and a resource somewhere in
 166      * its chain of ancestors (\p rsc, which may be \p orig_rsc), get
 167      * colocations that affect the ancestor as primary and should affect the
 168      * resource, and add them to a given list.
 169      *
 170      * \param[in]     rsc       Resource whose colocations should be added
 171      * \param[in]     orig_rsc  Affected resource (\p rsc or a descendant)
 172      * \param[in,out] list      List of colocations to add to
 173      *
 174      * \note All arguments should be non-NULL.
 175      * \note The pcmk__with_this_colocations() wrapper should usually be used
 176      *       instead of using this method directly.
 177      */
 178     void (*with_this_colocations)(const pcmk_resource_t *rsc,
 179                                   const pcmk_resource_t *orig_rsc,
 180                                   GList **list);
 181 
 182     /*!
 183      * \internal
 184      * \brief Add colocations affecting a resource as dependent to a list
 185      *
 186      * Given a resource being assigned (\p orig_rsc) and a resource somewhere in
 187      * its chain of ancestors (\p rsc, which may be \p orig_rsc), get
 188      * colocations that affect the ancestor as dependent and should affect the
 189      * resource, and add them to a given list.
 190      *
 191      *
 192      * \param[in]     rsc       Resource whose colocations should be added
 193      * \param[in]     orig_rsc  Affected resource (\p rsc or a descendant)
 194      * \param[in,out] list      List of colocations to add to
 195      *
 196      * \note All arguments should be non-NULL.
 197      * \note The pcmk__this_with_colocations() wrapper should usually be used
 198      *       instead of using this method directly.
 199      */
 200     void (*this_with_colocations)(const pcmk_resource_t *rsc,
 201                                   const pcmk_resource_t *orig_rsc,
 202                                   GList **list);
 203 
 204     /*!
 205      * \internal
 206      * \brief Update nodes with scores of colocated resources' nodes
 207      *
 208      * Given a table of nodes and a resource, update the nodes' scores with the
 209      * scores of the best nodes matching the attribute used for each of the
 210      * resource's relevant colocations.
 211      *
 212      * \param[in,out] source_rsc  Resource whose node scores to add
 213      * \param[in]     target_rsc  Resource on whose behalf to update \p *nodes
 214      * \param[in]     log_id      Resource ID for logs (if \c NULL, use
 215      *                            \p source_rsc ID)
 216      * \param[in,out] nodes       Nodes to update (set initial contents to
 217      *                            \c NULL to copy allowed nodes from
 218      *                            \p source_rsc)
 219      * \param[in]     colocation  Original colocation constraint (used to get
 220      *                            configured primary resource's stickiness, and
 221      *                            to get colocation node attribute; if \c NULL,
 222      *                            <tt>source_rsc</tt>'s own matching node scores
 223      *                            will not be added, and \p *nodes must be
 224      *                            \c NULL as well)
 225      * \param[in]     factor      Incorporate scores multiplied by this factor
 226      * \param[in]     flags       Bitmask of enum pcmk__coloc_select values
 227      *
 228      * \note \c NULL \p target_rsc, \c NULL \p *nodes, \c NULL \p colocation,
 229      *       and the \c pcmk__coloc_select_this_with flag are used together (and
 230      *       only by \c cmp_resources()).
 231      * \note The caller remains responsible for freeing \p *nodes.
 232      */
 233     void (*add_colocated_node_scores)(pcmk_resource_t *source_rsc,
 234                                       const pcmk_resource_t *target_rsc,
 235                                       const char *log_id, GHashTable **nodes,
 236                                       const pcmk__colocation_t *colocation,
 237                                       float factor, uint32_t flags);
 238 
 239     /*!
 240      * \internal
 241      * \brief Apply a location constraint to a resource's allowed node scores
 242      *
 243      * \param[in,out] rsc       Resource to apply constraint to
 244      * \param[in,out] location  Location constraint to apply
 245      */
 246     void (*apply_location)(pcmk_resource_t *rsc, pcmk__location_t *location);
 247 
 248     /*!
 249      * \internal
 250      * \brief Return action flags for a given resource action
 251      *
 252      * \param[in,out] action  Action to get flags for
 253      * \param[in]     node    If not NULL, limit effects to this node
 254      *
 255      * \return Flags appropriate to \p action on \p node
 256      * \note For primitives, this will be the same as action->flags regardless
 257      *       of node. For collective resources, the flags can differ due to
 258      *       multiple instances possibly being involved.
 259      */
 260     uint32_t (*action_flags)(pcmk_action_t *action, const pcmk_node_t *node);
 261 
 262     /*!
 263      * \internal
 264      * \brief Update two actions according to an ordering between them
 265      *
 266      * Given information about an ordering of two actions, update the actions'
 267      * flags (and runnable_before members if appropriate) as appropriate for the
 268      * ordering. Effects may cascade to other orderings involving the actions as
 269      * well.
 270      *
 271      * \param[in,out] first      'First' action in an ordering
 272      * \param[in,out] then       'Then' action in an ordering
 273      * \param[in]     node       If not NULL, limit scope of ordering to this
 274      *                           node (only used when interleaving instances)
 275      * \param[in]     flags      Action flags for \p first for ordering purposes
 276      * \param[in]     filter     Action flags to limit scope of certain updates
 277      *                           (may include pcmk_action_optional to affect
 278      *                           only mandatory actions and pcmk_action_runnable
 279      *                           to affect only runnable actions)
 280      * \param[in]     type       Group of enum pcmk__action_relation_flags
 281      * \param[in,out] scheduler  Scheduler data
 282      *
 283      * \return Group of enum pcmk__updated flags indicating what was updated
 284      */
 285     uint32_t (*update_ordered_actions)(pcmk_action_t *first,
 286                                        pcmk_action_t *then,
 287                                        const pcmk_node_t *node, uint32_t flags,
 288                                        uint32_t filter, uint32_t type,
 289                                        pcmk_scheduler_t *scheduler);
 290 
 291     /*!
 292      * \internal
 293      * \brief Output a summary of scheduled actions for a resource
 294      *
 295      * \param[in,out] rsc  Resource to output actions for
 296      */
 297     void (*output_actions)(pcmk_resource_t *rsc);
 298 
 299     /*!
 300      * \internal
 301      * \brief Add a resource's actions to the transition graph
 302      *
 303      * \param[in,out] rsc  Resource whose actions should be added
 304      */
 305     void (*add_actions_to_graph)(pcmk_resource_t *rsc);
 306 
 307     /*!
 308      * \internal
 309      * \brief Add meta-attributes relevant to transition graph actions to XML
 310      *
 311      * If a given resource supports variant-specific meta-attributes that are
 312      * needed for transition graph actions, add them to a given XML element.
 313      *
 314      * \param[in]     rsc  Resource whose meta-attributes should be added
 315      * \param[in,out] xml  Transition graph action attributes XML to add to
 316      */
 317     void (*add_graph_meta)(const pcmk_resource_t *rsc, xmlNode *xml);
 318 
 319     /*!
 320      * \internal
 321      * \brief Add a resource's utilization to a table of utilization values
 322      *
 323      * This function is used when summing the utilization of a resource and all
 324      * resources colocated with it, to determine whether a node has sufficient
 325      * capacity. Given a resource and a table of utilization values, it will add
 326      * the resource's utilization to the existing values, if the resource has
 327      * not yet been assigned to a node.
 328      *
 329      * \param[in]     rsc          Resource with utilization to add
 330      * \param[in]     orig_rsc     Resource being assigned (for logging only)
 331      * \param[in]     all_rscs     List of all resources that will be summed
 332      * \param[in,out] utilization  Table of utilization values to add to
 333      */
 334     void (*add_utilization)(const pcmk_resource_t *rsc,
 335                             const pcmk_resource_t *orig_rsc, GList *all_rscs,
 336                             GHashTable *utilization);
 337 
 338     /*!
 339      * \internal
 340      * \brief Apply a shutdown lock for a resource, if appropriate
 341      *
 342      * \param[in,out] rsc       Resource to check for shutdown lock
 343      */
 344     void (*shutdown_lock)(pcmk_resource_t *rsc);
 345 };
 346 
 347 // Actions (pcmk_sched_actions.c)
 348 
 349 G_GNUC_INTERNAL
 350 void pcmk__update_action_for_orderings(pcmk_action_t *action,
 351                                        pcmk_scheduler_t *scheduler);
 352 
 353 G_GNUC_INTERNAL
 354 uint32_t pcmk__update_ordered_actions(pcmk_action_t *first, pcmk_action_t *then,
 355                                       const pcmk_node_t *node, uint32_t flags,
 356                                       uint32_t filter, uint32_t type,
 357                                       pcmk_scheduler_t *scheduler);
 358 
 359 G_GNUC_INTERNAL
 360 void pcmk__log_action(const char *pre_text, const pcmk_action_t *action,
 361                       bool details);
 362 
 363 G_GNUC_INTERNAL
 364 pcmk_action_t *pcmk__new_cancel_action(pcmk_resource_t *rsc, const char *name,
 365                                        guint interval_ms,
 366                                        const pcmk_node_t *node);
 367 
 368 G_GNUC_INTERNAL
 369 pcmk_action_t *pcmk__new_shutdown_action(pcmk_node_t *node);
 370 
 371 G_GNUC_INTERNAL
 372 bool pcmk__action_locks_rsc_to_node(const pcmk_action_t *action);
 373 
 374 G_GNUC_INTERNAL
 375 void pcmk__deduplicate_action_inputs(pcmk_action_t *action);
 376 
 377 G_GNUC_INTERNAL
 378 void pcmk__output_actions(pcmk_scheduler_t *scheduler);
 379 
 380 G_GNUC_INTERNAL
 381 bool pcmk__check_action_config(pcmk_resource_t *rsc, pcmk_node_t *node,
 382                                const xmlNode *xml_op);
 383 
 384 G_GNUC_INTERNAL
 385 void pcmk__handle_rsc_config_changes(pcmk_scheduler_t *scheduler);
 386 
 387 
 388 // Recurring actions (pcmk_sched_recurring.c)
 389 
 390 G_GNUC_INTERNAL
 391 void pcmk__create_recurring_actions(pcmk_resource_t *rsc);
 392 
 393 G_GNUC_INTERNAL
 394 void pcmk__schedule_cancel(pcmk_resource_t *rsc, const char *call_id,
 395                            const char *task, guint interval_ms,
 396                            const pcmk_node_t *node, const char *reason);
 397 
 398 G_GNUC_INTERNAL
 399 void pcmk__reschedule_recurring(pcmk_resource_t *rsc, const char *task,
 400                                 guint interval_ms, pcmk_node_t *node);
 401 
 402 G_GNUC_INTERNAL
 403 bool pcmk__action_is_recurring(const pcmk_action_t *action);
 404 
 405 
 406 // Producing transition graphs (pcmk_graph_producer.c)
 407 
 408 G_GNUC_INTERNAL
 409 bool pcmk__graph_has_loop(const pcmk_action_t *init_action,
 410                           const pcmk_action_t *action,
 411                           pcmk__related_action_t *input);
 412 
 413 G_GNUC_INTERNAL
 414 void pcmk__add_rsc_actions_to_graph(pcmk_resource_t *rsc);
 415 
 416 G_GNUC_INTERNAL
 417 void pcmk__create_graph(pcmk_scheduler_t *scheduler);
 418 
 419 
 420 // Fencing (pcmk_sched_fencing.c)
 421 
 422 G_GNUC_INTERNAL
 423 void pcmk__order_vs_fence(pcmk_action_t *stonith_op,
 424                           pcmk_scheduler_t *scheduler);
 425 
 426 G_GNUC_INTERNAL
 427 void pcmk__order_vs_unfence(const pcmk_resource_t *rsc, pcmk_node_t *node,
 428                             pcmk_action_t *action,
 429                             enum pcmk__action_relation_flags order);
 430 
 431 G_GNUC_INTERNAL
 432 void pcmk__fence_guest(pcmk_node_t *node);
 433 
 434 G_GNUC_INTERNAL
 435 bool pcmk__node_unfenced(const pcmk_node_t *node);
 436 
 437 G_GNUC_INTERNAL
 438 void pcmk__order_restart_vs_unfence(gpointer data, gpointer user_data);
 439 
 440 
 441 // Injected scheduler inputs (pcmk_sched_injections.c)
 442 
 443 void pcmk__inject_scheduler_input(pcmk_scheduler_t *scheduler, cib_t *cib,
 444                                   const pcmk_injections_t *injections);
 445 
 446 
 447 // Constraints of any type (pcmk_sched_constraints.c)
 448 
 449 G_GNUC_INTERNAL
 450 pcmk_resource_t *pcmk__find_constraint_resource(GList *rsc_list,
 451                                                 const char *id);
 452 
 453 G_GNUC_INTERNAL
 454 xmlNode *pcmk__expand_tags_in_sets(xmlNode *xml_obj,
 455                                    const pcmk_scheduler_t *scheduler);
 456 
 457 G_GNUC_INTERNAL
 458 bool pcmk__valid_resource_or_tag(const pcmk_scheduler_t *scheduler,
 459                                  const char *id, pcmk_resource_t **rsc,
 460                                  pcmk_tag_t **tag);
 461 
 462 G_GNUC_INTERNAL
 463 bool pcmk__tag_to_set(xmlNode *xml_obj, xmlNode **rsc_set, const char *attr,
 464                       bool convert_rsc, const pcmk_scheduler_t *scheduler);
 465 
 466 G_GNUC_INTERNAL
 467 void pcmk__create_internal_constraints(pcmk_scheduler_t *scheduler);
 468 
 469 
 470 // Location constraints
 471 
 472 G_GNUC_INTERNAL
 473 void pcmk__unpack_location(xmlNode *xml_obj, pcmk_scheduler_t *scheduler);
 474 
 475 G_GNUC_INTERNAL
 476 pcmk__location_t *pcmk__new_location(const char *id, pcmk_resource_t *rsc,
 477                                      int node_score, const char *discover_mode,
 478                                      pcmk_node_t *foo_node);
 479 
 480 G_GNUC_INTERNAL
 481 void pcmk__apply_locations(pcmk_scheduler_t *scheduler);
 482 
 483 G_GNUC_INTERNAL
 484 void pcmk__apply_location(pcmk_resource_t *rsc, pcmk__location_t *constraint);
 485 
 486 
 487 // Colocation constraints (pcmk_sched_colocation.c)
 488 
 489 enum pcmk__coloc_affects {
 490     pcmk__coloc_affects_nothing = 0,
 491     pcmk__coloc_affects_location,
 492     pcmk__coloc_affects_role,
 493 };
 494 
 495 /*!
 496  * \internal
 497  * \brief Get the value of a colocation's node attribute
 498  *
 499  * \param[in] node  Node on which to look up the attribute
 500  * \param[in] attr  Name of attribute to look up
 501  * \param[in] rsc   Resource on whose behalf to look up the attribute
 502  *
 503  * \return Value of \p attr on \p node or on the host of \p node, as appropriate
 504  */
 505 static inline const char *
 506 pcmk__colocation_node_attr(const pcmk_node_t *node, const char *attr,
     /* [previous][next][first][last][top][bottom][index][help] */
 507                            const pcmk_resource_t *rsc)
 508 {
 509     const char *target = NULL;
 510 
 511     /* A resource colocated with a bundle or its primitive can't run on the
 512      * bundle node itself (where only the primitive, if any, can run). Instead,
 513      * we treat it as a colocation with the bundle's containers, so always look
 514      * up colocation node attributes on the container host.
 515      */
 516     if (pcmk__is_bundle_node(node) && pcmk__is_bundled(rsc)
 517         && (pe__const_top_resource(rsc, false) == pe__bundled_resource(rsc))) {
 518         target = PCMK_VALUE_HOST;
 519 
 520     } else if (rsc != NULL) {
 521         target = g_hash_table_lookup(rsc->meta,
 522                                      PCMK_META_CONTAINER_ATTRIBUTE_TARGET);
 523     }
 524 
 525     return pcmk__node_attr(node, attr, target, pcmk__rsc_node_assigned);
 526 }
 527 
 528 G_GNUC_INTERNAL
 529 enum pcmk__coloc_affects pcmk__colocation_affects(const pcmk_resource_t
 530                                                     *dependent,
 531                                                   const pcmk_resource_t
 532                                                     *primary,
 533                                                   const pcmk__colocation_t
 534                                                     *colocation,
 535                                                   bool preview);
 536 
 537 G_GNUC_INTERNAL
 538 void pcmk__apply_coloc_to_scores(pcmk_resource_t *dependent,
 539                                  const pcmk_resource_t *primary,
 540                                  const pcmk__colocation_t *colocation);
 541 
 542 G_GNUC_INTERNAL
 543 int pcmk__apply_coloc_to_priority(pcmk_resource_t *dependent,
 544                                   const pcmk_resource_t *primary,
 545                                   const pcmk__colocation_t *colocation);
 546 
 547 G_GNUC_INTERNAL
 548 void pcmk__add_colocated_node_scores(pcmk_resource_t *source_rsc,
 549                                      const pcmk_resource_t *target_rsc,
 550                                      const char *log_id, GHashTable **nodes,
 551                                      const pcmk__colocation_t *colocation,
 552                                      float factor, uint32_t flags);
 553 
 554 G_GNUC_INTERNAL
 555 void pcmk__add_dependent_scores(gpointer data, gpointer user_data);
 556 
 557 G_GNUC_INTERNAL
 558 void pcmk__colocation_intersect_nodes(pcmk_resource_t *dependent,
 559                                       const pcmk_resource_t *primary,
 560                                       const pcmk__colocation_t *colocation,
 561                                       const GList *primary_nodes,
 562                                       bool merge_scores);
 563 
 564 G_GNUC_INTERNAL
 565 void pcmk__unpack_colocation(xmlNode *xml_obj, pcmk_scheduler_t *scheduler);
 566 
 567 G_GNUC_INTERNAL
 568 void pcmk__add_this_with(GList **list, const pcmk__colocation_t *colocation,
 569                          const pcmk_resource_t *rsc);
 570 
 571 G_GNUC_INTERNAL
 572 void pcmk__add_this_with_list(GList **list, GList *addition,
 573                               const pcmk_resource_t *rsc);
 574 
 575 G_GNUC_INTERNAL
 576 void pcmk__add_with_this(GList **list, const pcmk__colocation_t *colocation,
 577                          const pcmk_resource_t *rsc);
 578 
 579 G_GNUC_INTERNAL
 580 void pcmk__add_with_this_list(GList **list, GList *addition,
 581                               const pcmk_resource_t *rsc);
 582 
 583 G_GNUC_INTERNAL
 584 GList *pcmk__with_this_colocations(const pcmk_resource_t *rsc);
 585 
 586 G_GNUC_INTERNAL
 587 GList *pcmk__this_with_colocations(const pcmk_resource_t *rsc);
 588 
 589 G_GNUC_INTERNAL
 590 void pcmk__new_colocation(const char *id, const char *node_attr, int score,
 591                           pcmk_resource_t *dependent, pcmk_resource_t *primary,
 592                           const char *dependent_role, const char *primary_role,
 593                           uint32_t flags);
 594 
 595 G_GNUC_INTERNAL
 596 void pcmk__block_colocation_dependents(pcmk_action_t *action);
 597 
 598 /*!
 599  * \internal
 600  * \brief Check whether colocation's dependent preferences should be considered
 601  *
 602  * \param[in] colocation  Colocation constraint
 603  * \param[in] rsc         Primary instance (normally this will be
 604  *                        colocation->primary, which NULL will be treated as,
 605  *                        but for clones or bundles with multiple instances
 606  *                        this can be a particular instance)
 607  *
 608  * \return true if colocation influence should be effective, otherwise false
 609  */
 610 static inline bool
 611 pcmk__colocation_has_influence(const pcmk__colocation_t *colocation,
     /* [previous][next][first][last][top][bottom][index][help] */
 612                                const pcmk_resource_t *rsc)
 613 {
 614     if (rsc == NULL) {
 615         rsc = colocation->primary;
 616     }
 617 
 618     /* A bundle replica colocates its remote connection with its container,
 619      * using a finite score so that the container can run on Pacemaker Remote
 620      * nodes.
 621      *
 622      * Moving a connection is lightweight and does not interrupt the service,
 623      * while moving a container is heavyweight and does interrupt the service,
 624      * so don't move a clean, active container based solely on the preferences
 625      * of its connection.
 626      *
 627      * This also avoids problematic scenarios where two containers want to
 628      * perpetually swap places.
 629      */
 630     if (pcmk_is_set(colocation->dependent->flags,
 631                     pcmk_rsc_remote_nesting_allowed)
 632         && !pcmk_is_set(rsc->flags, pcmk_rsc_failed)
 633         && pcmk__list_of_1(rsc->running_on)) {
 634         return false;
 635     }
 636 
 637     /* The dependent in a colocation influences the primary's location
 638      * if the PCMK_XA_INFLUENCE option is true or the primary is not yet active.
 639      */
 640     return pcmk_is_set(colocation->flags, pcmk__coloc_influence)
 641            || (rsc->running_on == NULL);
 642 }
 643 
 644 
 645 // Ordering constraints (pcmk_sched_ordering.c)
 646 
 647 G_GNUC_INTERNAL
 648 void pcmk__new_ordering(pcmk_resource_t *first_rsc, char *first_task,
 649                         pcmk_action_t *first_action, pcmk_resource_t *then_rsc,
 650                         char *then_task, pcmk_action_t *then_action,
 651                         uint32_t flags, pcmk_scheduler_t *sched);
 652 
 653 G_GNUC_INTERNAL
 654 void pcmk__unpack_ordering(xmlNode *xml_obj, pcmk_scheduler_t *scheduler);
 655 
 656 G_GNUC_INTERNAL
 657 void pcmk__disable_invalid_orderings(pcmk_scheduler_t *scheduler);
 658 
 659 G_GNUC_INTERNAL
 660 void pcmk__order_stops_before_shutdown(pcmk_node_t *node,
 661                                        pcmk_action_t *shutdown_op);
 662 
 663 G_GNUC_INTERNAL
 664 void pcmk__apply_orderings(pcmk_scheduler_t *sched);
 665 
 666 G_GNUC_INTERNAL
 667 void pcmk__order_after_each(pcmk_action_t *after, GList *list);
 668 
 669 
 670 /*!
 671  * \internal
 672  * \brief Create a new ordering between two resource actions
 673  *
 674  * \param[in,out] first_rsc   Resource for 'first' action
 675  * \param[in,out] first_task  Action key for 'first' action
 676  * \param[in]     then_rsc    Resource for 'then' action
 677  * \param[in,out] then_task   Action key for 'then' action
 678  * \param[in]     flags       Group of enum pcmk__action_relation_flags
 679  */
 680 #define pcmk__order_resource_actions(first_rsc, first_task,                 \
 681                                      then_rsc, then_task, flags)            \
 682     pcmk__new_ordering((first_rsc),                                         \
 683                        pcmk__op_key((first_rsc)->id, (first_task), 0),      \
 684                        NULL,                                                \
 685                        (then_rsc),                                          \
 686                        pcmk__op_key((then_rsc)->id, (then_task), 0),        \
 687                        NULL, (flags), (first_rsc)->cluster)
 688 
 689 #define pcmk__order_starts(rsc1, rsc2, flags)                \
 690     pcmk__order_resource_actions((rsc1), PCMK_ACTION_START,  \
 691                                  (rsc2), PCMK_ACTION_START, (flags))
 692 
 693 #define pcmk__order_stops(rsc1, rsc2, flags)                 \
 694     pcmk__order_resource_actions((rsc1), PCMK_ACTION_STOP,   \
 695                                  (rsc2), PCMK_ACTION_STOP, (flags))
 696 
 697 
 698 // Ticket constraints (pcmk_sched_tickets.c)
 699 
 700 G_GNUC_INTERNAL
 701 void pcmk__unpack_rsc_ticket(xmlNode *xml_obj, pcmk_scheduler_t *scheduler);
 702 
 703 
 704 // Promotable clone resources (pcmk_sched_promotable.c)
 705 
 706 G_GNUC_INTERNAL
 707 void pcmk__add_promotion_scores(pcmk_resource_t *rsc);
 708 
 709 G_GNUC_INTERNAL
 710 void pcmk__require_promotion_tickets(pcmk_resource_t *rsc);
 711 
 712 G_GNUC_INTERNAL
 713 void pcmk__set_instance_roles(pcmk_resource_t *rsc);
 714 
 715 G_GNUC_INTERNAL
 716 void pcmk__create_promotable_actions(pcmk_resource_t *clone);
 717 
 718 G_GNUC_INTERNAL
 719 void pcmk__promotable_restart_ordering(pcmk_resource_t *rsc);
 720 
 721 G_GNUC_INTERNAL
 722 void pcmk__order_promotable_instances(pcmk_resource_t *clone);
 723 
 724 G_GNUC_INTERNAL
 725 void pcmk__update_dependent_with_promotable(const pcmk_resource_t *primary,
 726                                             pcmk_resource_t *dependent,
 727                                             const pcmk__colocation_t
 728                                                 *colocation);
 729 
 730 G_GNUC_INTERNAL
 731 int pcmk__update_promotable_dependent_priority(const pcmk_resource_t *primary,
 732                                                pcmk_resource_t *dependent,
 733                                                const pcmk__colocation_t
 734                                                    *colocation);
 735 
 736 
 737 // Pacemaker Remote nodes (pcmk_sched_remote.c)
 738 
 739 G_GNUC_INTERNAL
 740 bool pcmk__is_failed_remote_node(const pcmk_node_t *node);
 741 
 742 G_GNUC_INTERNAL
 743 void pcmk__order_remote_connection_actions(pcmk_scheduler_t *scheduler);
 744 
 745 G_GNUC_INTERNAL
 746 bool pcmk__rsc_corresponds_to_guest(const pcmk_resource_t *rsc,
 747                                     const pcmk_node_t *node);
 748 
 749 G_GNUC_INTERNAL
 750 pcmk_node_t *pcmk__connection_host_for_action(const pcmk_action_t *action);
 751 
 752 G_GNUC_INTERNAL
 753 void pcmk__substitute_remote_addr(pcmk_resource_t *rsc, GHashTable *params);
 754 
 755 G_GNUC_INTERNAL
 756 void pcmk__add_guest_meta_to_xml(xmlNode *args_xml,
 757                                  const pcmk_action_t *action);
 758 
 759 
 760 // Primitives (pcmk_sched_primitive.c)
 761 
 762 G_GNUC_INTERNAL
 763 pcmk_node_t *pcmk__primitive_assign(pcmk_resource_t *rsc,
 764                                     const pcmk_node_t *prefer,
 765                                     bool stop_if_fail);
 766 
 767 G_GNUC_INTERNAL
 768 void pcmk__primitive_create_actions(pcmk_resource_t *rsc);
 769 
 770 G_GNUC_INTERNAL
 771 void pcmk__primitive_internal_constraints(pcmk_resource_t *rsc);
 772 
 773 G_GNUC_INTERNAL
 774 uint32_t pcmk__primitive_action_flags(pcmk_action_t *action,
 775                                       const pcmk_node_t *node);
 776 
 777 G_GNUC_INTERNAL
 778 int pcmk__primitive_apply_coloc_score(pcmk_resource_t *dependent,
 779                                       const pcmk_resource_t *primary,
 780                                       const pcmk__colocation_t *colocation,
 781                                       bool for_dependent);
 782 
 783 G_GNUC_INTERNAL
 784 void pcmk__with_primitive_colocations(const pcmk_resource_t *rsc,
 785                                       const pcmk_resource_t *orig_rsc,
 786                                       GList **list);
 787 
 788 G_GNUC_INTERNAL
 789 void pcmk__primitive_with_colocations(const pcmk_resource_t *rsc,
 790                                       const pcmk_resource_t *orig_rsc,
 791                                       GList **list);
 792 
 793 G_GNUC_INTERNAL
 794 void pcmk__schedule_cleanup(pcmk_resource_t *rsc, const pcmk_node_t *node,
 795                             bool optional);
 796 
 797 G_GNUC_INTERNAL
 798 void pcmk__primitive_add_graph_meta(const pcmk_resource_t *rsc, xmlNode *xml);
 799 
 800 G_GNUC_INTERNAL
 801 void pcmk__primitive_add_utilization(const pcmk_resource_t *rsc,
 802                                      const pcmk_resource_t *orig_rsc,
 803                                      GList *all_rscs, GHashTable *utilization);
 804 
 805 G_GNUC_INTERNAL
 806 void pcmk__primitive_shutdown_lock(pcmk_resource_t *rsc);
 807 
 808 
 809 // Groups (pcmk_sched_group.c)
 810 
 811 G_GNUC_INTERNAL
 812 pcmk_node_t *pcmk__group_assign(pcmk_resource_t *rsc, const pcmk_node_t *prefer,
 813                                 bool stop_if_fail);
 814 
 815 G_GNUC_INTERNAL
 816 void pcmk__group_create_actions(pcmk_resource_t *rsc);
 817 
 818 G_GNUC_INTERNAL
 819 void pcmk__group_internal_constraints(pcmk_resource_t *rsc);
 820 
 821 G_GNUC_INTERNAL
 822 int pcmk__group_apply_coloc_score(pcmk_resource_t *dependent,
 823                                   const pcmk_resource_t *primary,
 824                                   const pcmk__colocation_t *colocation,
 825                                   bool for_dependent);
 826 
 827 G_GNUC_INTERNAL
 828 void pcmk__with_group_colocations(const pcmk_resource_t *rsc,
 829                                   const pcmk_resource_t *orig_rsc,
 830                                   GList **list);
 831 
 832 G_GNUC_INTERNAL
 833 void pcmk__group_with_colocations(const pcmk_resource_t *rsc,
 834                                   const pcmk_resource_t *orig_rsc,
 835                                   GList **list);
 836 
 837 G_GNUC_INTERNAL
 838 void pcmk__group_add_colocated_node_scores(pcmk_resource_t *source_rsc,
 839                                            const pcmk_resource_t *target_rsc,
 840                                            const char *log_id,
 841                                            GHashTable **nodes,
 842                                            const pcmk__colocation_t *colocation,
 843                                            float factor, uint32_t flags);
 844 
 845 G_GNUC_INTERNAL
 846 void pcmk__group_apply_location(pcmk_resource_t *rsc,
 847                                 pcmk__location_t *location);
 848 
 849 G_GNUC_INTERNAL
 850 uint32_t pcmk__group_action_flags(pcmk_action_t *action,
 851                                   const pcmk_node_t *node);
 852 
 853 G_GNUC_INTERNAL
 854 uint32_t pcmk__group_update_ordered_actions(pcmk_action_t *first,
 855                                             pcmk_action_t *then,
 856                                             const pcmk_node_t *node,
 857                                             uint32_t flags, uint32_t filter,
 858                                             uint32_t type,
 859                                             pcmk_scheduler_t *scheduler);
 860 
 861 G_GNUC_INTERNAL
 862 GList *pcmk__group_colocated_resources(const pcmk_resource_t *rsc,
 863                                        const pcmk_resource_t *orig_rsc,
 864                                        GList *colocated_rscs);
 865 
 866 G_GNUC_INTERNAL
 867 void pcmk__group_add_utilization(const pcmk_resource_t *rsc,
 868                                  const pcmk_resource_t *orig_rsc,
 869                                  GList *all_rscs, GHashTable *utilization);
 870 
 871 G_GNUC_INTERNAL
 872 void pcmk__group_shutdown_lock(pcmk_resource_t *rsc);
 873 
 874 
 875 // Clones (pcmk_sched_clone.c)
 876 
 877 G_GNUC_INTERNAL
 878 pcmk_node_t *pcmk__clone_assign(pcmk_resource_t *rsc, const pcmk_node_t *prefer,
 879                                 bool stop_if_fail);
 880 
 881 G_GNUC_INTERNAL
 882 void pcmk__clone_create_actions(pcmk_resource_t *rsc);
 883 
 884 G_GNUC_INTERNAL
 885 bool pcmk__clone_create_probe(pcmk_resource_t *rsc, pcmk_node_t *node);
 886 
 887 G_GNUC_INTERNAL
 888 void pcmk__clone_internal_constraints(pcmk_resource_t *rsc);
 889 
 890 G_GNUC_INTERNAL
 891 int pcmk__clone_apply_coloc_score(pcmk_resource_t *dependent,
 892                                   const pcmk_resource_t *primary,
 893                                   const pcmk__colocation_t *colocation,
 894                                   bool for_dependent);
 895 
 896 G_GNUC_INTERNAL
 897 void pcmk__with_clone_colocations(const pcmk_resource_t *rsc,
 898                                   const pcmk_resource_t *orig_rsc,
 899                                   GList **list);
 900 
 901 G_GNUC_INTERNAL
 902 void pcmk__clone_with_colocations(const pcmk_resource_t *rsc,
 903                                   const pcmk_resource_t *orig_rsc,
 904                                   GList **list);
 905 
 906 G_GNUC_INTERNAL
 907 void pcmk__clone_apply_location(pcmk_resource_t *rsc,
 908                                 pcmk__location_t *constraint);
 909 
 910 G_GNUC_INTERNAL
 911 uint32_t pcmk__clone_action_flags(pcmk_action_t *action,
 912                                   const pcmk_node_t *node);
 913 
 914 G_GNUC_INTERNAL
 915 void pcmk__clone_add_actions_to_graph(pcmk_resource_t *rsc);
 916 
 917 G_GNUC_INTERNAL
 918 void pcmk__clone_add_graph_meta(const pcmk_resource_t *rsc, xmlNode *xml);
 919 
 920 G_GNUC_INTERNAL
 921 void pcmk__clone_add_utilization(const pcmk_resource_t *rsc,
 922                                  const pcmk_resource_t *orig_rsc,
 923                                  GList *all_rscs, GHashTable *utilization);
 924 
 925 G_GNUC_INTERNAL
 926 void pcmk__clone_shutdown_lock(pcmk_resource_t *rsc);
 927 
 928 // Bundles (pcmk_sched_bundle.c)
 929 
 930 G_GNUC_INTERNAL
 931 pcmk_node_t *pcmk__bundle_assign(pcmk_resource_t *rsc,
 932                                  const pcmk_node_t *prefer, bool stop_if_fail);
 933 
 934 G_GNUC_INTERNAL
 935 void pcmk__bundle_create_actions(pcmk_resource_t *rsc);
 936 
 937 G_GNUC_INTERNAL
 938 bool pcmk__bundle_create_probe(pcmk_resource_t *rsc, pcmk_node_t *node);
 939 
 940 G_GNUC_INTERNAL
 941 void pcmk__bundle_internal_constraints(pcmk_resource_t *rsc);
 942 
 943 G_GNUC_INTERNAL
 944 int pcmk__bundle_apply_coloc_score(pcmk_resource_t *dependent,
 945                                    const pcmk_resource_t *primary,
 946                                    const pcmk__colocation_t *colocation,
 947                                    bool for_dependent);
 948 
 949 G_GNUC_INTERNAL
 950 void pcmk__with_bundle_colocations(const pcmk_resource_t *rsc,
 951                                    const pcmk_resource_t *orig_rsc,
 952                                    GList **list);
 953 
 954 G_GNUC_INTERNAL
 955 void pcmk__bundle_with_colocations(const pcmk_resource_t *rsc,
 956                                    const pcmk_resource_t *orig_rsc,
 957                                    GList **list);
 958 
 959 G_GNUC_INTERNAL
 960 void pcmk__bundle_apply_location(pcmk_resource_t *rsc,
 961                                  pcmk__location_t *constraint);
 962 
 963 G_GNUC_INTERNAL
 964 uint32_t pcmk__bundle_action_flags(pcmk_action_t *action,
 965                                    const pcmk_node_t *node);
 966 
 967 G_GNUC_INTERNAL
 968 void pcmk__output_bundle_actions(pcmk_resource_t *rsc);
 969 
 970 G_GNUC_INTERNAL
 971 void pcmk__bundle_add_actions_to_graph(pcmk_resource_t *rsc);
 972 
 973 G_GNUC_INTERNAL
 974 void pcmk__bundle_add_utilization(const pcmk_resource_t *rsc,
 975                                   const pcmk_resource_t *orig_rsc,
 976                                   GList *all_rscs, GHashTable *utilization);
 977 
 978 G_GNUC_INTERNAL
 979 void pcmk__bundle_shutdown_lock(pcmk_resource_t *rsc);
 980 
 981 
 982 // Clone instances or bundle replica containers (pcmk_sched_instances.c)
 983 
 984 G_GNUC_INTERNAL
 985 void pcmk__assign_instances(pcmk_resource_t *collective, GList *instances,
 986                             int max_total, int max_per_node);
 987 
 988 G_GNUC_INTERNAL
 989 void pcmk__create_instance_actions(pcmk_resource_t *rsc, GList *instances);
 990 
 991 G_GNUC_INTERNAL
 992 bool pcmk__instance_matches(const pcmk_resource_t *instance,
 993                             const pcmk_node_t *node, enum rsc_role_e role,
 994                             bool current);
 995 
 996 G_GNUC_INTERNAL
 997 pcmk_resource_t *pcmk__find_compatible_instance(const pcmk_resource_t *match_rsc,
 998                                                 const pcmk_resource_t *rsc,
 999                                                 enum rsc_role_e role,
1000                                                 bool current);
1001 
1002 G_GNUC_INTERNAL
1003 uint32_t pcmk__instance_update_ordered_actions(pcmk_action_t *first,
1004                                                pcmk_action_t *then,
1005                                                const pcmk_node_t *node,
1006                                                uint32_t flags, uint32_t filter,
1007                                                uint32_t type,
1008                                                pcmk_scheduler_t *scheduler);
1009 
1010 G_GNUC_INTERNAL
1011 uint32_t pcmk__collective_action_flags(pcmk_action_t *action,
1012                                        const GList *instances,
1013                                        const pcmk_node_t *node);
1014 
1015 
1016 // Injections (pcmk_injections.c)
1017 
1018 G_GNUC_INTERNAL
1019 xmlNode *pcmk__inject_node(cib_t *cib_conn, const char *node, const char *uuid);
1020 
1021 G_GNUC_INTERNAL
1022 xmlNode *pcmk__inject_node_state_change(cib_t *cib_conn, const char *node,
1023                                         bool up);
1024 
1025 G_GNUC_INTERNAL
1026 xmlNode *pcmk__inject_resource_history(pcmk__output_t *out, xmlNode *cib_node,
1027                                        const char *resource,
1028                                        const char *lrm_name,
1029                                        const char *rclass,
1030                                        const char *rtype,
1031                                        const char *rprovider);
1032 
1033 G_GNUC_INTERNAL
1034 void pcmk__inject_failcount(pcmk__output_t *out, cib_t *cib_conn,
1035                             xmlNode *cib_node, const char *resource,
1036                             const char *task, guint interval_ms, int rc);
1037 
1038 G_GNUC_INTERNAL
1039 xmlNode *pcmk__inject_action_result(xmlNode *cib_resource,
1040                                     lrmd_event_data_t *op, int target_rc);
1041 
1042 
1043 // Nodes (pcmk_sched_nodes.c)
1044 
1045 G_GNUC_INTERNAL
1046 bool pcmk__node_available(const pcmk_node_t *node, bool consider_score,
1047                           bool consider_guest);
1048 
1049 G_GNUC_INTERNAL
1050 bool pcmk__any_node_available(GHashTable *nodes);
1051 
1052 G_GNUC_INTERNAL
1053 GHashTable *pcmk__copy_node_table(GHashTable *nodes);
1054 
1055 G_GNUC_INTERNAL
1056 void pcmk__copy_node_tables(const pcmk_resource_t *rsc, GHashTable **copy);
1057 
1058 G_GNUC_INTERNAL
1059 void pcmk__restore_node_tables(pcmk_resource_t *rsc, GHashTable *backup);
1060 
1061 G_GNUC_INTERNAL
1062 GList *pcmk__sort_nodes(GList *nodes, pcmk_node_t *active_node);
1063 
1064 G_GNUC_INTERNAL
1065 void pcmk__apply_node_health(pcmk_scheduler_t *scheduler);
1066 
1067 G_GNUC_INTERNAL
1068 pcmk_node_t *pcmk__top_allowed_node(const pcmk_resource_t *rsc,
1069                                     const pcmk_node_t *node);
1070 
1071 
1072 // Functions applying to more than one variant (pcmk_sched_resource.c)
1073 
1074 G_GNUC_INTERNAL
1075 void pcmk__set_assignment_methods(pcmk_scheduler_t *scheduler);
1076 
1077 G_GNUC_INTERNAL
1078 bool pcmk__rsc_agent_changed(pcmk_resource_t *rsc, pcmk_node_t *node,
1079                              const xmlNode *rsc_entry, bool active_on_node);
1080 
1081 G_GNUC_INTERNAL
1082 GList *pcmk__rscs_matching_id(const char *id,
1083                               const pcmk_scheduler_t *scheduler);
1084 
1085 G_GNUC_INTERNAL
1086 GList *pcmk__colocated_resources(const pcmk_resource_t *rsc,
1087                                  const pcmk_resource_t *orig_rsc,
1088                                  GList *colocated_rscs);
1089 
1090 G_GNUC_INTERNAL
1091 void pcmk__noop_add_graph_meta(const pcmk_resource_t *rsc, xmlNode *xml);
1092 
1093 G_GNUC_INTERNAL
1094 void pcmk__output_resource_actions(pcmk_resource_t *rsc);
1095 
1096 G_GNUC_INTERNAL
1097 bool pcmk__assign_resource(pcmk_resource_t *rsc, pcmk_node_t *node, bool force,
1098                            bool stop_if_fail);
1099 
1100 G_GNUC_INTERNAL
1101 void pcmk__unassign_resource(pcmk_resource_t *rsc);
1102 
1103 G_GNUC_INTERNAL
1104 bool pcmk__threshold_reached(pcmk_resource_t *rsc, const pcmk_node_t *node,
1105                              pcmk_resource_t **failed);
1106 
1107 G_GNUC_INTERNAL
1108 void pcmk__sort_resources(pcmk_scheduler_t *scheduler);
1109 
1110 G_GNUC_INTERNAL
1111 gint pcmk__cmp_instance(gconstpointer a, gconstpointer b);
1112 
1113 G_GNUC_INTERNAL
1114 gint pcmk__cmp_instance_number(gconstpointer a, gconstpointer b);
1115 
1116 
1117 // Functions related to probes (pcmk_sched_probes.c)
1118 
1119 G_GNUC_INTERNAL
1120 bool pcmk__probe_rsc_on_node(pcmk_resource_t *rsc, pcmk_node_t *node);
1121 
1122 G_GNUC_INTERNAL
1123 void pcmk__order_probes(pcmk_scheduler_t *scheduler);
1124 
1125 G_GNUC_INTERNAL
1126 bool pcmk__probe_resource_list(GList *rscs, pcmk_node_t *node);
1127 
1128 G_GNUC_INTERNAL
1129 void pcmk__schedule_probes(pcmk_scheduler_t *scheduler);
1130 
1131 
1132 // Functions related to live migration (pcmk_sched_migration.c)
1133 
1134 void pcmk__create_migration_actions(pcmk_resource_t *rsc,
1135                                     const pcmk_node_t *current);
1136 
1137 void pcmk__abort_dangling_migration(void *data, void *user_data);
1138 
1139 bool pcmk__rsc_can_migrate(const pcmk_resource_t *rsc,
1140                            const pcmk_node_t *current);
1141 
1142 void pcmk__order_migration_equivalents(pcmk__action_relation_t *order);
1143 
1144 
1145 // Functions related to node utilization (pcmk_sched_utilization.c)
1146 
1147 G_GNUC_INTERNAL
1148 int pcmk__compare_node_capacities(const pcmk_node_t *node1,
1149                                   const pcmk_node_t *node2);
1150 
1151 G_GNUC_INTERNAL
1152 void pcmk__consume_node_capacity(GHashTable *current_utilization,
1153                                  const pcmk_resource_t *rsc);
1154 
1155 G_GNUC_INTERNAL
1156 void pcmk__release_node_capacity(GHashTable *current_utilization,
1157                                  const pcmk_resource_t *rsc);
1158 
1159 G_GNUC_INTERNAL
1160 const pcmk_node_t *pcmk__ban_insufficient_capacity(pcmk_resource_t *rsc);
1161 
1162 G_GNUC_INTERNAL
1163 void pcmk__create_utilization_constraints(pcmk_resource_t *rsc,
1164                                           const GList *allowed_nodes);
1165 
1166 G_GNUC_INTERNAL
1167 void pcmk__show_node_capacities(const char *desc, pcmk_scheduler_t *scheduler);
1168 
1169 
1170 // Functions related to the scheduler (pcmk_scheduler.c)
1171 
1172 G_GNUC_INTERNAL
1173 int pcmk__init_scheduler(pcmk__output_t *out, xmlNodePtr input, const crm_time_t *date,
1174                          pcmk_scheduler_t **scheduler);
1175 
1176 
1177 // General setup functions (pcmk_setup.c)
1178 
1179 G_GNUC_INTERNAL
1180 int pcmk__setup_output_cib_sched(pcmk__output_t **out, cib_t **cib,
1181                                  pcmk_scheduler_t **scheduler, xmlNode **xml);
1182 
1183 #endif // PCMK__LIBPACEMAKER_PRIVATE__H

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