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

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