root/lib/pacemaker/libpacemaker_private.h

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

INCLUDED FROM


   1 /*
   2  * Copyright 2021 the Pacemaker project contributors
   3  *
   4  * The version control history for this file may have further details.
   5  *
   6  * This source code is licensed under the GNU Lesser General Public License
   7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #ifndef PCMK__LIBPACEMAKER_PRIVATE__H
  11 #  define PCMK__LIBPACEMAKER_PRIVATE__H
  12 
  13 /* This header is for the sole use of libpacemaker, so that functions can be
  14  * declared with G_GNUC_INTERNAL for efficiency.
  15  */
  16 
  17 #include <crm/pengine/pe_types.h> // pe_action_t, pe_node_t, pe_working_set_t
  18 
  19 G_GNUC_INTERNAL
  20 bool pcmk__graph_has_loop(pe_action_t *init_action, pe_action_t *action,
  21                           pe_action_wrapper_t *input);
  22 
  23 G_GNUC_INTERNAL
  24 void pcmk__order_vs_fence(pe_action_t *stonith_op, pe_working_set_t *data_set);
  25 
  26 G_GNUC_INTERNAL
  27 void pcmk__order_vs_unfence(pe_resource_t *rsc, pe_node_t *node,
  28                             pe_action_t *action, enum pe_ordering order,
  29                             pe_working_set_t *data_set);
  30 
  31 G_GNUC_INTERNAL
  32 void pcmk__fence_guest(pe_node_t *node, pe_working_set_t *data_set);
  33 
  34 G_GNUC_INTERNAL
  35 bool pcmk__node_unfenced(pe_node_t *node);
  36 
  37 G_GNUC_INTERNAL
  38 bool pcmk__is_unfence_device(const pe_resource_t *rsc,
  39                              const pe_working_set_t *data_set);
  40 
  41 G_GNUC_INTERNAL
  42 pe_resource_t *pcmk__find_constraint_resource(GList *rsc_list, const char *id);
  43 
  44 G_GNUC_INTERNAL
  45 xmlNode *pcmk__expand_tags_in_sets(xmlNode *xml_obj,
  46                                    pe_working_set_t *data_set);
  47 
  48 G_GNUC_INTERNAL
  49 bool pcmk__valid_resource_or_tag(pe_working_set_t *data_set, const char *id,
  50                                  pe_resource_t **rsc, pe_tag_t **tag);
  51 
  52 G_GNUC_INTERNAL
  53 bool pcmk__tag_to_set(xmlNode *xml_obj, xmlNode **rsc_set, const char *attr,
  54                       bool convert_rsc, pe_working_set_t *data_set);
  55 
  56 G_GNUC_INTERNAL
  57 void pcmk__create_internal_constraints(pe_working_set_t *data_set);
  58 
  59 
  60 // Location constraints
  61 
  62 G_GNUC_INTERNAL
  63 void pcmk__unpack_location(xmlNode *xml_obj, pe_working_set_t *data_set);
  64 
  65 G_GNUC_INTERNAL
  66 pe__location_t *pcmk__new_location(const char *id, pe_resource_t *rsc,
  67                                    int node_weight, const char *discover_mode,
  68                                    pe_node_t *foo_node,
  69                                    pe_working_set_t *data_set);
  70 
  71 G_GNUC_INTERNAL
  72 void pcmk__apply_locations(pe_working_set_t *data_set);
  73 
  74 G_GNUC_INTERNAL
  75 void pcmk__apply_location(pe__location_t *constraint, pe_resource_t *rsc);
  76 
  77 
  78 // Colocation constraints
  79 
  80 enum pcmk__coloc_affects {
  81     pcmk__coloc_affects_nothing = 0,
  82     pcmk__coloc_affects_location,
  83     pcmk__coloc_affects_role,
  84 };
  85 
  86 G_GNUC_INTERNAL
  87 enum pcmk__coloc_affects pcmk__colocation_affects(pe_resource_t *dependent,
  88                                                   pe_resource_t *primary,
  89                                                   pcmk__colocation_t *constraint,
  90                                                   bool preview);
  91 
  92 G_GNUC_INTERNAL
  93 void pcmk__apply_coloc_to_weights(pe_resource_t *dependent,
  94                                   pe_resource_t *primary,
  95                                   pcmk__colocation_t *constraint);
  96 
  97 G_GNUC_INTERNAL
  98 void pcmk__apply_coloc_to_priority(pe_resource_t *dependent,
  99                                    pe_resource_t *primary,
 100                                    pcmk__colocation_t *constraint);
 101 
 102 G_GNUC_INTERNAL
 103 void pcmk__unpack_colocation(xmlNode *xml_obj, pe_working_set_t *data_set);
 104 
 105 G_GNUC_INTERNAL
 106 void pcmk__new_colocation(const char *id, const char *node_attr, int score,
 107                           pe_resource_t *dependent, pe_resource_t *primary,
 108                           const char *dependent_role, const char *primary_role,
 109                           bool influence, pe_working_set_t *data_set);
 110 
 111 G_GNUC_INTERNAL
 112 void pcmk__block_colocated_starts(pe_action_t *action,
 113                                   pe_working_set_t *data_set);
 114 
 115 G_GNUC_INTERNAL
 116 void pcmk__new_ordering(pe_resource_t *lh_rsc, char *lh_task,
 117                         pe_action_t *lh_action, pe_resource_t *rh_rsc,
 118                         char *rh_task, pe_action_t *rh_action,
 119                         enum pe_ordering type, pe_working_set_t *data_set);
 120 
 121 G_GNUC_INTERNAL
 122 void pcmk__unpack_ordering(xmlNode *xml_obj, pe_working_set_t *data_set);
 123 
 124 G_GNUC_INTERNAL
 125 void pcmk__disable_invalid_orderings(pe_working_set_t *data_set);
 126 
 127 G_GNUC_INTERNAL
 128 void pcmk__order_stops_before_shutdown(pe_node_t *node,
 129                                        pe_action_t *shutdown_op,
 130                                        pe_working_set_t *data_set);
 131 
 132 G_GNUC_INTERNAL
 133 void pcmk__apply_orderings(pe_working_set_t *data_set);
 134 
 135 /*!
 136  * \internal
 137  * \brief Create a new ordering between two resource actions
 138  *
 139  * \param[in] lh_rsc    Resource for 'first' action
 140  * \param[in] rh_rsc    Resource for 'then' action
 141  * \param[in] lh_task   Action key for 'first' action
 142  * \param[in] rh_task   Action key for 'then' action
 143  * \param[in] flags     Bitmask of enum pe_ordering flags
 144  * \param[in] data_set  Cluster working set to add ordering to
 145  */
 146 #define pcmk__order_resource_actions(lh_rsc, lh_task, rh_rsc, rh_task,      \
 147                                      flags, data_set)                       \
 148     pcmk__new_ordering((lh_rsc), pcmk__op_key((lh_rsc)->id, (lh_task), 0),  \
 149                        NULL,                                                \
 150                        (rh_rsc), pcmk__op_key((rh_rsc)->id, (rh_task), 0),  \
 151                        NULL, (flags), (data_set))
 152 
 153 #define pcmk__order_starts(rsc1, rsc2, type, data_set)       \
 154     pcmk__order_resource_actions((rsc1), CRMD_ACTION_START,  \
 155                                  (rsc2), CRMD_ACTION_START, (type), (data_set))
 156 
 157 #define pcmk__order_stops(rsc1, rsc2, type, data_set)        \
 158     pcmk__order_resource_actions((rsc1), CRMD_ACTION_STOP,   \
 159                                  (rsc2), CRMD_ACTION_STOP, (type), (data_set))
 160 
 161 G_GNUC_INTERNAL
 162 void pcmk__unpack_rsc_ticket(xmlNode *xml_obj, pe_working_set_t *data_set);
 163 
 164 G_GNUC_INTERNAL
 165 void pcmk__order_probes(pe_working_set_t *data_set);
 166 
 167 G_GNUC_INTERNAL
 168 bool pcmk__is_failed_remote_node(pe_node_t *node);
 169 
 170 G_GNUC_INTERNAL
 171 void pcmk__order_remote_connection_actions(pe_working_set_t *data_set);
 172 
 173 G_GNUC_INTERNAL
 174 bool pcmk__rsc_corresponds_to_guest(pe_resource_t *rsc, pe_node_t *node);
 175 
 176 G_GNUC_INTERNAL
 177 pe_node_t *pcmk__connection_host_for_action(pe_action_t *action);
 178 
 179 G_GNUC_INTERNAL
 180 void pcmk__substitute_remote_addr(pe_resource_t *rsc, GHashTable *params,
 181                                   pe_working_set_t *data_set);
 182 
 183 G_GNUC_INTERNAL
 184 void pcmk__add_bundle_meta_to_xml(xmlNode *args_xml, pe_action_t *action);
 185 
 186 
 187 // Groups (pcmk_sched_group.c)
 188 
 189 G_GNUC_INTERNAL
 190 GList *pcmk__group_colocated_resources(pe_resource_t *rsc,
 191                                        pe_resource_t *orig_rsc,
 192                                        GList *colocated_rscs);
 193 
 194 
 195 // Functions applying to more than one variant (pcmk_sched_resource.c)
 196 
 197 G_GNUC_INTERNAL
 198 GList *pcmk__colocated_resources(pe_resource_t *rsc, pe_resource_t *orig_rsc,
 199                                  GList *colocated_rscs);
 200 
 201 #endif // PCMK__LIBPACEMAKER_PRIVATE__H

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