26 void print_str_str(gpointer key, gpointer value, gpointer user_data);
30 static xmlNode *find_rsc_op_entry_helper(
pe_resource_t * rsc,
const char *key,
31 gboolean include_disabled);
33 #if ENABLE_VERSIONED_ATTRS 34 pe_rsc_action_details_t *
37 pe_rsc_action_details_t *details;
41 if (
action->action_details == NULL) {
42 action->action_details = calloc(1,
sizeof(pe_rsc_action_details_t));
46 details = (pe_rsc_action_details_t *)
action->action_details;
47 if (details->versioned_parameters == NULL) {
51 if (details->versioned_meta == NULL) {
60 pe_rsc_action_details_t *details;
62 if ((
action == NULL) || (
action->action_details == NULL)) {
66 details = (pe_rsc_action_details_t *)
action->action_details;
68 if (details->versioned_parameters) {
69 free_xml(details->versioned_parameters);
71 if (details->versioned_meta) {
75 action->action_details = NULL;
97 for (GList *n = rsc->
running_on; n != NULL; n = n->next) {
119 }
else if(node == NULL) {
162 GHashTable *
result = hash;
169 g_hash_table_iter_init(&iter, hash);
170 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
173 if (other_node == NULL) {
175 }
else if (merge_scores) {
180 for (; gIter != NULL; gIter = gIter->next) {
185 if (other_node == NULL) {
189 g_hash_table_insert(
result, (gpointer) new_node->
details->
id, new_node);
205 GHashTable *
result = NULL;
208 for (GList *gIter = list; gIter != NULL; gIter = gIter->next) {
211 g_hash_table_insert(
result, (gpointer) new_node->
details->
id, new_node);
220 ((
const pe_node_t *) b)->details->uname);
232 pe__output_node_weights(
pe_resource_t *rsc,
const char *comment,
239 GList *list = g_list_sort(g_hash_table_get_values(nodes),
sort_node_uname);
241 for (GList *gIter = list; gIter != NULL; gIter = gIter->next) {
262 pe__log_node_weights(
const char *file,
const char *
function,
int line,
272 g_hash_table_iter_init(&iter, nodes);
273 while (g_hash_table_iter_next(&iter, NULL, (
void **) &node)) {
276 qb_log_from_external_source(
function, file,
277 "%s: %s allocation score on %s: %s",
280 node->details->uname, score);
282 qb_log_from_external_source(
function, file,
"%s: %s = %s",
284 comment, node->details->uname,
317 pe__log_node_weights(file,
function, line, rsc, comment, nodes);
319 pe__output_node_weights(rsc, comment, nodes,
data_set);
324 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
339 if (a == NULL && b == NULL) {
366 if (a == NULL && b == NULL) {
401 "no-quorum-policy=demote");
446 GList *matches = NULL;
454 if (matches == NULL) {
460 g_list_free(matches);
511 guint interval_ms = 0;
513 action->op_entry = find_rsc_op_entry_helper(rsc, key, TRUE);
520 pe_rsc_trace(rsc,
"Created %s action %d (%s): %s for %s on %s",
521 (optional?
"optional" :
"required"),
523 ((rsc == NULL)?
"no resource" : rsc->
id),
548 && (
action->op_entry != NULL)) {
561 &rule_data,
action->extra, NULL,
580 && (g_hash_table_lookup(
action->meta,
589 }
else if (!optional) {
612 if (
action->node == NULL) {
618 && !(
action->node->details->online)
620 ||
action->node->details->remote_requires_reset)) {
623 "%s on %s is unrunnable (node is offline)",
628 && !(
action->node->details->unclean)) {
633 &&
action->node->details->pending) {
636 "Action %s on %s is unrunnable (node is pending)",
649 "(node's host cannot be fenced)",
654 "%s on %s does not require fencing or quorum",
672 "%s on %s is unrunnable (no quorum)",
731 pe_node_t *on_node, gboolean optional, gboolean save_action,
743 action = new_action(key, task, rsc, on_node, optional, save_action,
749 update_action_optional(
action, optional);
752 if (
action->node != NULL) {
759 update_resource_flags_for_action(rsc,
action);
767 valid_stop_on_fail(
const char *value)
776 const char *
name = NULL;
777 const char *role = NULL;
778 const char *on_fail = NULL;
779 const char *interval_spec = NULL;
783 && !valid_stop_on_fail(value)) {
786 "action to default value because '%s' is not " 787 "allowed for stop",
action->rsc->id, value);
792 xmlNode *operation = NULL;
796 for (operation = pcmk__xe_first_child(
action->rsc->ops_xml);
797 (operation != NULL) && (value == NULL);
798 operation = pcmk__xe_next(operation)) {
799 bool enabled =
false;
801 if (!pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
840 "action to default value because 'demote' is not " 850 find_min_interval_mon(
pe_resource_t * rsc, gboolean include_disabled)
852 guint interval_ms = 0;
853 guint min_interval_ms = G_MAXUINT;
854 const char *
name = NULL;
855 const char *interval_spec = NULL;
857 xmlNode *operation = NULL;
859 for (operation = pcmk__xe_first_child(rsc->
ops_xml);
861 operation = pcmk__xe_next(operation)) {
863 if (pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
864 bool enabled =
false;
879 if (interval_ms && (interval_ms < min_interval_ms)) {
880 min_interval_ms = interval_ms;
890 unpack_start_delay(
const char *value, GHashTable *meta)
897 if (start_delay < 0) {
903 pcmk__itoa(start_delay));
912 unpack_interval_origin(
const char *value, xmlNode *xml_obj, guint interval_ms,
916 guint interval_sec = interval_ms / 1000;
920 if ((value == NULL) || (interval_ms == 0) || (now == NULL)) {
926 if (origin == NULL) {
928 "'%s' because '%s' is not valid",
929 (
ID(xml_obj)?
ID(xml_obj) :
"(missing ID)"), value);
942 crm_info(
"Calculated a start delay of %llds for operation '%s'",
944 (
ID(xml_obj)?
ID(xml_obj) :
"(unspecified)"));
946 if (start_delay != NULL) {
947 *start_delay =
result * 1000;
953 unpack_timeout(
const char *value)
957 if (timeout_ms < 0) {
966 xmlNode *child = NULL;
967 GHashTable *action_meta = NULL;
968 const char *timeout_spec = NULL;
992 &rule_data, action_meta, NULL, FALSE,
data_set);
1000 if (timeout_ms < 0) {
1004 if (action_meta != NULL) {
1005 g_hash_table_destroy(action_meta);
1010 #if ENABLE_VERSIONED_ATTRS 1012 unpack_versioned_meta(xmlNode *versioned_meta, xmlNode *xml_obj,
1015 xmlNode *attrs = NULL;
1016 xmlNode *attr = NULL;
1018 for (attrs = pcmk__xe_first_child(versioned_meta); attrs != NULL;
1019 attrs = pcmk__xe_next(attrs)) {
1021 for (attr = pcmk__xe_first_child(attrs); attr != NULL;
1022 attr = pcmk__xe_next(attr)) {
1028 int start_delay = unpack_start_delay(value, NULL);
1032 long long start_delay = 0;
1034 if (unpack_interval_origin(value, xml_obj, interval_ms, now,
1041 int timeout_ms = unpack_timeout(value);
1068 const char *value = NULL;
1069 bool is_probe =
false;
1070 #if ENABLE_VERSIONED_ATTRS 1071 pe_rsc_action_details_t *rsc_details = NULL;
1082 .interval = interval_ms
1090 .rsc_data = &rsc_rule_data,
1091 .op_data = &op_rule_data
1104 xmlNode *min_interval_mon = find_min_interval_mon(
action->rsc, FALSE);
1106 if (min_interval_mon) {
1109 crm_trace(
"\t%s: Setting default timeout to minimum-interval " 1110 "monitor's timeout '%s'",
action->uuid, value);
1118 xmlAttrPtr xIter = NULL;
1124 #if ENABLE_VERSIONED_ATTRS 1125 rsc_details = pe_rsc_action_details(
action);
1133 rsc_details->versioned_meta,
1140 for (xIter = xml_obj->properties; xIter; xIter = xIter->next) {
1141 const char *prop_name = (
const char *)xIter->name;
1144 g_hash_table_replace(
action->meta, strdup(prop_name), strdup(prop_value));
1148 g_hash_table_remove(
action->meta,
"id");
1151 if (interval_ms > 0) {
1179 value = g_hash_table_lookup(params,
"pcmk_monitor_timeout");
1182 crm_trace(
"\t%s: Setting timeout to pcmk_monitor_timeout '%s', " 1183 "overriding default",
action->uuid, value);
1191 timeout_ms = unpack_timeout(value);
1193 pcmk__itoa(timeout_ms));
1197 value =
"nothing (not start or promote)";
1213 value = unpack_operation_on_fail(
action);
1215 if (value == NULL) {
1224 value =
"node fencing";
1228 "operation '%s' to 'stop' because 'fence' is not " 1229 "valid when fencing is disabled",
action->uuid);
1232 value =
"stop resource";
1237 value =
"node standby";
1245 value =
"force migration";
1250 value =
"stop resource";
1254 value =
"restart (and possibly migrate)";
1256 }
else if (pcmk__str_eq(value,
"restart-container",
pcmk__str_casei)) {
1259 value =
"restart container (and possibly migrate)";
1267 value =
"demote instance";
1270 pe_err(
"Resource %s: Unknown failure type (%s)",
action->rsc->id, value);
1275 if (value == NULL && container) {
1277 value =
"restart container (and possibly migrate) (default)";
1290 && (interval_ms == 0))
1296 value =
"stop unmanaged remote node (enforcing default)";
1300 value =
"fence remote node (default)";
1302 value =
"recover remote node connection (default)";
1305 if (
action->rsc->remote_reconnect_ms) {
1314 value =
"resource fence (default)";
1318 value =
"resource block (default)";
1321 }
else if (value == NULL) {
1323 value =
"restart (and possibly migrate) (default)";
1330 if (xml_obj != NULL) {
1331 value = g_hash_table_lookup(
action->meta,
"role_after_failure");
1334 "Support for role_after_failure is deprecated and will be removed in a future release");
1353 unpack_start_delay(value,
action->meta);
1355 long long start_delay = 0;
1358 if (unpack_interval_origin(value, xml_obj, interval_ms,
data_set->
now,
1365 #if ENABLE_VERSIONED_ATTRS 1366 unpack_versioned_meta(rsc_details->versioned_meta, xml_obj, interval_ms,
1372 find_rsc_op_entry_helper(
pe_resource_t * rsc,
const char *key, gboolean include_disabled)
1374 guint interval_ms = 0;
1375 gboolean do_retry = TRUE;
1376 char *local_key = NULL;
1377 const char *
name = NULL;
1378 const char *interval_spec = NULL;
1379 char *match_key = NULL;
1381 xmlNode *operation = NULL;
1384 for (operation = pcmk__xe_first_child(rsc->
ops_xml); operation != NULL;
1385 operation = pcmk__xe_next(operation)) {
1387 if (pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
1388 bool enabled =
false;
1420 if (do_retry == FALSE) {
1430 }
else if (strstr(key,
"_notify_")) {
1442 return find_rsc_op_entry_helper(rsc, key, FALSE);
1452 user_data == NULL ?
"" : (
char *)user_data,
1453 user_data == NULL ?
"" :
": ", (
char *)key, (
char *)value);
1462 g_list_free_full(
action->actions_before, free);
1463 g_list_free_full(
action->actions_after, free);
1465 g_hash_table_destroy(
action->extra);
1468 g_hash_table_destroy(
action->meta);
1470 #if ENABLE_VERSIONED_ATTRS 1472 pe_free_rsc_action_details(
action);
1475 free(
action->cancel_task);
1486 const char *value = NULL;
1488 GList *gIter =
input;
1492 for (; gIter != NULL; gIter = gIter->next) {
1496 if (value == NULL) {
1502 }
else if (not_on_node == NULL) {
1506 }
else if (
action->node == NULL) {
1531 crm_trace(
"Folding %s back into its atomic counterpart for %s",
name, rsc->
id);
1543 GList *gIter = NULL;
1547 for (gIter =
input; gIter != NULL; gIter = gIter->next) {
1556 }
else if (on_node == NULL) {
1559 }
else if (
action->node == NULL) {
1573 GList *gIter =
input;
1578 for (; gIter != NULL; gIter = gIter->next) {
1584 }
else if (on_node == NULL) {
1585 crm_trace(
"Action %s matches (ignoring node)", key);
1588 }
else if (
action->node == NULL) {
1589 crm_trace(
"Action %s matches (unallocated, assigning to %s)",
1611 if (on_node == NULL) {
1615 for (GList *gIter =
input; gIter != NULL; gIter = gIter->next) {
1618 if ((
action->node != NULL)
1645 const char *task,
bool require_node)
1675 for (; gIter != NULL; gIter = gIter->next) {
1678 resource_node_score(child_rsc, node, score, tag);
1684 if (match == NULL) {
1696 resource_node_score(rsc, node, score, tag);
1701 for (; gIter != NULL; gIter = gIter->next) {
1704 resource_node_score(rsc, node_iter, score, tag);
1708 GHashTableIter iter;
1712 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node_iter)) {
1713 resource_node_score(rsc, node_iter, score, tag);
1717 if (node == NULL && score == -
INFINITY) {
1726 #define sort_return(an_int, why) do { \ 1729 crm_trace("%s (%d) %c %s (%d) : %s", \ 1730 a_xml_id, a_call_id, an_int>0?'>':an_int<0?'<':'=', \ 1731 b_xml_id, b_call_id, why); \ 1741 char *a_uuid = NULL;
1742 char *b_uuid = NULL;
1744 const xmlNode *xml_a = a;
1745 const xmlNode *xml_b = b;
1756 pe_err(
"Duplicate lrm_rsc_op entries named %s", a_xml_id);
1763 if (a_call_id == -1 && b_call_id == -1) {
1769 }
else if (a_call_id >= 0 && a_call_id < b_call_id) {
1772 }
else if (b_call_id >= 0 && a_call_id > b_call_id) {
1775 }
else if (b_call_id >= 0 && a_call_id == b_call_id) {
1787 (
long long) last_a, (
long long) last_b);
1788 if (last_a >= 0 && last_a < last_b) {
1791 }
else if (last_b >= 0 && last_a > last_b) {
1832 if (b_call_id == -1) {
1835 }
else if (a_call_id == -1) {
1839 }
else if ((a_id >= 0 && a_id < b_id) || b_id == -1) {
1842 }
else if ((b_id >= 0 && a_id > b_id) || a_id == -1) {
1883 "because '%s' is not valid", rsc->
id, value);
1895 "because '%s' only makes sense for promotable " 1896 "clones", rsc->
id, value);
1908 GList *gIter = NULL;
1916 if (lh_action == NULL || rh_action == NULL) {
1920 crm_trace(
"Creating action wrappers for ordering: %s then %s",
1928 for (; gIter != NULL; gIter = gIter->next) {
1931 if (after->
action == rh_action && (after->
type & order)) {
1937 wrapper->
action = rh_action;
1938 wrapper->
type = order;
1940 list = g_list_prepend(list, wrapper);
1944 wrapper->
action = lh_action;
1945 wrapper->
type = order;
1947 list = g_list_prepend(list, wrapper);
1969 if (ticket->
state) {
1970 g_hash_table_destroy(ticket->
state);
1981 if (pcmk__str_empty(ticket_id)) {
1990 if (ticket == NULL) {
1993 if (ticket == NULL) {
1994 crm_err(
"Cannot allocate ticket '%s'", ticket_id);
1998 crm_trace(
"Creaing ticket entry for %s", ticket_id);
2000 ticket->
id = strdup(ticket_id);
2015 return ID(rsc->
xml);
2024 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
2042 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
2048 find_unfencing_devices(GList *candidates, GList *matches)
2050 for (GList *gIter = candidates; gIter != NULL; gIter = gIter->next) {
2052 const char *provides = g_hash_table_lookup(candidate->
meta,
2057 matches = find_unfencing_devices(candidate->
children, matches);
2062 matches = g_list_prepend(matches, candidate);
2071 int member_count = 0;
2072 int online_count = 0;
2073 int top_priority = 0;
2074 int lowest_priority = 0;
2075 GList *gIter = NULL;
2093 for (gIter =
data_set->
nodes; gIter != NULL; gIter = gIter->next) {
2106 if (member_count == 1
2111 if (member_count == 1
2118 if (online_count > member_count / 2) {
2124 if (lowest_priority == top_priority) {
2139 char *op_key = NULL;
2148 stonith_op = lookup_singleton(
data_set, op_key);
2149 if(stonith_op == NULL) {
2164 long digests_all_offset = 0;
2165 long digests_secure_offset = 0;
2167 char *digests_all = calloc(max,
sizeof(
char));
2168 char *digests_secure = calloc(max,
sizeof(
char));
2171 for (GList *gIter = matches; gIter != NULL; gIter = gIter->next) {
2173 const char *agent = g_hash_table_lookup(match->
meta,
2183 out->
info(out,
"notice: Unfencing %s (remote): because the definition of %s changed",
2188 digests_all_offset += snprintf(
2189 digests_all+digests_all_offset, max-digests_all_offset,
2190 "%s:%s:%s,", match->
id, agent,
data->digest_all_calc);
2192 digests_secure_offset += snprintf(
2193 digests_secure+digests_secure_offset, max-digests_secure_offset,
2194 "%s:%s:%s,", match->
id, agent,
data->digest_secure_calc);
2196 g_hash_table_insert(stonith_op->
meta,
2199 g_hash_table_insert(stonith_op->
meta,
2218 || g_hash_table_lookup(stonith_op->
meta,
2225 char *delay_s = pcmk__itoa(node_priority_fencing_delay(node,
data_set));
2227 g_hash_table_insert(stonith_op->
meta,
2236 }
else if(reason && stonith_op->
reason == NULL) {
2237 stonith_op->
reason = strdup(reason);
2251 }
else if ((rsc != NULL)
2267 GHashTableIter iter;
2270 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
2271 if(node->details->online && node->details->unclean == FALSE && node->details->shutdown == FALSE) {
2279 add_tag_ref(GHashTable * tags,
const char * tag_name,
const char * obj_ref)
2282 GList *gIter = NULL;
2283 gboolean is_existing = FALSE;
2285 CRM_CHECK(tags && tag_name && obj_ref,
return FALSE);
2287 tag = g_hash_table_lookup(tags, tag_name);
2293 tag->
id = strdup(tag_name);
2295 g_hash_table_insert(tags, strdup(tag_name), tag);
2298 for (gIter = tag->
refs; gIter != NULL; gIter = gIter->next) {
2299 const char *existing_ref = (
const char *) gIter->data;
2307 if (is_existing == FALSE) {
2308 tag->
refs = g_list_append(tag->
refs, strdup(obj_ref));
2309 crm_trace(
"Added: tag=%s ref=%s", tag->
id, obj_ref);
2328 const char *change = NULL;
2333 change =
"unrunnable";
2336 change =
"required";
2344 (
action->rsc == NULL)?
"" :
" ",
2351 if (
action->reason != NULL && overwrite) {
2354 }
else if (
action->reason == NULL) {
2409 const char *always_first, gboolean overwrite,
2415 always_first, overwrite, next_change);
2427 const char *target_role = NULL;
2467 for (GList *ele = rsc->
running_on; ele; ele = ele->next) {
2487 GList *retval = NULL;
2489 for (GList *gIter = rscs; gIter; gIter = gIter->next) {
2497 retval = g_list_prepend(retval, rsc);
2506 GList *nodes = NULL;
2513 nodes = g_list_prepend(nodes, strdup(
"*"));
2521 nodes = g_list_prepend(nodes, strdup(s));
2538 GList *resources = NULL;
2541 resources = g_list_prepend(resources, strdup(
"*"));
2552 if (strstr(s,
":") != NULL) {
2553 resources = g_list_prepend(resources, strdup(rsc->
id));
2573 const char *rsc_id = rsc->
id;
2581 for (xmlNode *xml_op = pcmk__xml_first_child(rsc->
cluster->
failed); xml_op != NULL;
2582 xml_op = pcmk__xml_next(xml_op)) {
2583 const char *value = NULL;
2601 if (!
parse_op_key(value ? value :
ID(xml_op), &op_id, NULL, NULL)) {
crm_time_t * crm_time_new_undefined(void)
Allocate memory for an uninitialized time object.
#define XML_OP_ATTR_ORIGIN
pe_action_t * pe_fence_op(pe_node_t *node, const char *op, bool optional, const char *reason, bool priority_delay, pe_working_set_t *data_set)
bool pe__shutdown_requested(pe_node_t *node)
#define CRM_CHECK(expr, failure_action)
#define XML_RSC_OP_LAST_CHANGE
pe_node_t * pe_find_node(GList *node_list, const char *uname)
GList * find_actions(GList *input, const char *key, const pe_node_t *on_node)
enum pe_quorum_policy no_quorum_policy
gboolean parse_op_key(const char *key, char **rsc_id, char **op_type, guint *interval_ms)
void destroy_ticket(gpointer data)
#define crm_notice(fmt, args...)
#define CRMD_ACTION_MIGRATED
pe_resource_t * pe_find_resource_with_flags(GList *rsc_list, const char *id, enum pe_find flags)
bool pe__is_guest_or_remote_node(const pe_node_t *node)
pe_node_t * pe__copy_node(const pe_node_t *this_node)
#define pe_rsc_debug(rsc, fmt, args...)
#define XML_OP_ATTR_DIGESTS_ALL
#define pe__set_action_flags(action, flags_to_set)
void trigger_unfencing(pe_resource_t *rsc, pe_node_t *node, const char *reason, pe_action_t *dependency, pe_working_set_t *data_set)
#define XML_EXPR_ATTR_TYPE
time_t get_effective_time(pe_working_set_t *data_set)
gboolean order_actions(pe_action_t *lh_action, pe_action_t *rh_action, enum pe_ordering order)
#define XML_ATTR_TRANSITION_MAGIC
bool crm_time_is_defined(const crm_time_t *t)
Check whether a time object has been initialized yet.
GList * pe__build_rsc_list(pe_working_set_t *data_set, const char *s)
#define PCMK_STONITH_PROVIDES
pe_resource_t * container
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
int(* message)(pcmk__output_t *out, const char *message_id,...)
void pe_eval_nvpairs(xmlNode *top, xmlNode *xml_obj, const char *set_name, pe_rule_eval_data_t *rule_data, GHashTable *hash, const char *always_first, gboolean overwrite, crm_time_t *next_change)
#define XML_CONFIG_ATTR_PRIORITY_FENCING_DELAY
struct crm_time_s crm_time_t
int pe_get_configured_timeout(pe_resource_t *rsc, const char *action, pe_working_set_t *data_set)
void resource_location(pe_resource_t *rsc, pe_node_t *node, int score, const char *tag, pe_working_set_t *data_set)
int priority_fencing_delay
xmlNode * first_named_child(const xmlNode *parent, const char *name)
GList * find_recurring_actions(GList *input, pe_node_t *not_on_node)
enum rsc_role_e next_role
const char * crm_xml_add_int(xmlNode *node, const char *name, int value)
Create an XML attribute with specified name and integer value.
gboolean exclusive_discover
#define pcmk__config_err(fmt...)
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
pe_resource_t * remote_rsc
long long crm_get_msec(const char *input)
Parse a time+units string and return milliseconds equivalent.
char * score2char_stack(int score, char *buf, size_t len)
Convert an integer score to a string, using a provided buffer.
resource_object_functions_t * fns
#define XML_LRM_ATTR_INTERVAL
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
bool pcmk_is_probe(const char *task, guint interval)
#define CRMD_ACTION_PROMOTE
#define XML_NVPAIR_ATTR_NAME
#define XML_OP_ATTR_DIGESTS_SECURE
#define RSC_ROLE_PROMOTED_LEGACY_S
#define pcmk__log_else(level, else_action)
enum action_tasks text2task(const char *task)
#define CRM_LOG_ASSERT(expr)
int(* info)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
void pe__show_node_weights_as(const char *file, const char *function, int line, bool to_log, pe_resource_t *rsc, const char *comment, GHashTable *nodes, pe_working_set_t *data_set)
bool pcmk__rsc_filtered_by_node(pe_resource_t *rsc, GList *only_node)
bool pe_can_fence(pe_working_set_t *data_set, pe_node_t *node)
#define XML_OP_ATTR_ON_FAIL
int crm_element_value_int(const xmlNode *data, const char *name, int *dest)
Retrieve the integer value of an XML attribute.
#define pe_flag_have_quorum
pe_action_t * find_first_action(GList *input, const char *uuid, const char *task, pe_node_t *on_node)
pe_ticket_t * ticket_new(const char *ticket_id, pe_working_set_t *data_set)
void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite)
void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set)
GList * pe__rscs_with_tag(pe_working_set_t *data_set, const char *tag_name)
#define pe__set_resource_flags(resource, flags_to_set)
bool pe__resource_is_disabled(pe_resource_t *rsc)
#define CRMD_ACTION_START
#define XML_LRM_ATTR_TASK_KEY
gboolean ghash_free_str_str(gpointer key, gpointer value, gpointer user_data)
#define XML_TAG_ATTR_SETS
const char * role2text(enum rsc_role_e role)
const char * pe__clone_child_id(pe_resource_t *rsc)
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
#define CRMD_ACTION_DEMOTE
void pe__unpack_dataset_nvpairs(xmlNode *xml_obj, const char *set_name, pe_rule_eval_data_t *rule_data, GHashTable *hash, const char *always_first, gboolean overwrite, pe_working_set_t *data_set)
#define XML_RSC_ATTR_REQUIRES
int pcmk__xe_get_bool_attr(xmlNodePtr node, const char *name, bool *value)
guint crm_parse_interval_spec(const char *input)
Parse milliseconds from a Pacemaker interval specification.
pe_resource_t * uber_parent(pe_resource_t *rsc)
#define XML_CIB_ATTR_SHUTDOWN
bool pe__rsc_running_on_any(pe_resource_t *rsc, GList *node_list)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
void node_list_exclude(GHashTable *hash, GList *list, gboolean merge_scores)
bool pe__is_guest_node(const pe_node_t *node)
GHashTable * pe__node_list2table(GList *list)
gboolean get_target_role(pe_resource_t *rsc, enum rsc_role_e *role)
#define pe_warn_once(pe_wo_bit, fmt...)
#define sort_return(an_int, why)
#define pe__clear_action_flags(action, flags_to_clear)
#define crm_trace(fmt, args...)
#define do_crm_log(level, fmt, args...)
Log a message.
void pe_fence_node(pe_working_set_t *data_set, pe_node_t *node, const char *reason, bool priority_delay)
Schedule a fence action for a node.
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
gint sort_node_uname(gconstpointer a, gconstpointer b)
const char * stonith_action
struct pe_node_shared_s * details
#define XML_TAG_OP_VER_META
#define XML_AGENT_ATTR_PROVIDER
#define pe_rsc_needs_fencing
enum action_tasks get_complex_task(pe_resource_t *rsc, const char *name, gboolean allow_non_atomic)
#define pe_rsc_promotable
GHashTable * pe_rsc_params(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
Get a table of resource parameters.
pe_working_set_t * data_set
#define XML_TAG_META_SETS
void pcmk__str_update(char **str, const char *value)
Wrappers for and extensions to libxml2.
Internal state tracking when creating graph.
bool pcmk_xe_mask_probe_failure(xmlNode *xml_op)
gboolean pcmk__str_in_list(const gchar *s, GList *lst, uint32_t flags)
xmlNode * create_xml_node(xmlNode *parent, const char *name)
long long int crm_time_get_seconds_since_epoch(crm_time_t *dt)
void pe_free_action(pe_action_t *action)
#define pe_flag_stonith_enabled
int crm_element_value_epoch(const xmlNode *xml, const char *name, time_t *dest)
Retrieve the seconds-since-epoch value of an XML attribute.
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
#define CRM_DEFAULT_OP_TIMEOUT_S
#define XML_RSC_ATTR_TARGET_ROLE
pe_action_t * custom_action(pe_resource_t *rsc, char *key, const char *task, pe_node_t *on_node, gboolean optional, gboolean save_action, pe_working_set_t *data_set)
Create or update an action object.
void pe__clear_resource_flags_recursive(pe_resource_t *rsc, uint64_t flags)
void free_xml(xmlNode *child)
match base name of any clone instance
enum rsc_role_e text2role(const char *role)
op_digest_cache_t * pe__compare_fencing_digest(pe_resource_t *rsc, const char *agent, pe_node_t *node, pe_working_set_t *data_set)
enum pe_obj_types variant
#define RSC_ROLE_PROMOTED_S
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
#define XML_LRM_ATTR_TARGET_UUID
const char * crm_xml_add_ll(xmlNode *node, const char *name, long long value)
Create an XML attribute with specified name and long long int value.
#define pe_rsc_fence_device
long long int crm_time_get_seconds(crm_time_t *dt)
pe_node_t * pe_find_node_id(GList *node_list, const char *id)
xmlNode * find_rsc_op_entry(pe_resource_t *rsc, const char *key)
match resource ID or LRM history ID
gint sort_rsc_index(gconstpointer a, gconstpointer b)
GList * pe__build_node_name_list(pe_working_set_t *data_set, const char *s)
GHashTable * pcmk__strkey_table(GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)
pcmk__action_result_t result
void add_hash_param(GHashTable *hash, const char *name, const char *value)
#define crm_err(fmt, args...)
crm_time_t * crm_time_new(const char *string)
void pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role, const char *why)
pe_action_t * pe__clear_resource_history(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
This structure contains everything that makes up a single output formatter.
void print_str_str(gpointer key, gpointer value, gpointer user_data)
#define XML_LRM_ATTR_INTERVAL_MS
GList * find_actions_exact(GList *input, const char *key, const pe_node_t *on_node)
#define XML_LRM_ATTR_CALLID
#define CRMD_ACTION_MIGRATE
#define XML_NVPAIR_ATTR_VALUE
#define pe__clear_resource_flags(resource, flags_to_clear)
gboolean decode_transition_magic(const char *magic, char **uuid, int *transition_id, int *action_id, int *op_status, int *op_rc, int *target_rc)
Parse a transition magic string into its constituent parts.
int pcmk__numeric_strcasecmp(const char *s1, const char *s2)
rsc_role_e
Possible roles that a resource can be in.
void pe__set_resource_flags_recursive(pe_resource_t *rsc, uint64_t flags)
#define XML_OP_ATTR_START_DELAY
pe_working_set_t * cluster
int pcmk__add_scores(int score1, int score2)
void pe__clear_resource_flags_on_all(pe_working_set_t *data_set, uint64_t flag)
GList * pe__filter_rsc_list(GList *rscs, GList *filter)
#define pe_rsc_needs_quorum
bool pe__resource_is_remote_conn(const pe_resource_t *rsc, const pe_working_set_t *data_set)
uint32_t pcmk_get_ra_caps(const char *standard)
Get capabilities of a resource agent standard.
#define pe_flag_have_stonith_resource
#define pe_flag_enable_unfencing
char * pe__action2reason(pe_action_t *action, enum pe_action_flags flag)
const char * rsc_printable_id(pe_resource_t *rsc)
#define XML_LRM_ATTR_TARGET
#define pe_rsc_trace(rsc, fmt, args...)
gint sort_rsc_priority(gconstpointer a, gconstpointer b)
GList * pe__unames_with_tag(pe_working_set_t *data_set, const char *tag_name)
#define CRM_OP_LRM_DELETE
pe_action_t * get_pseudo_op(const char *name, pe_working_set_t *data_set)
#define CRMD_ACTION_CANCEL
GList * pe__resource_actions(const pe_resource_t *rsc, const pe_node_t *node, const char *task, bool require_node)
Find all actions of given type for a resource.
#define crm_info(fmt, args...)
xmlNode * pe__failed_probe_for_rsc(pe_resource_t *rsc, const char *name)
#define XML_TAG_OP_VER_ATTRS
gboolean(* active)(pe_resource_t *, gboolean)
#define XML_AGENT_ATTR_CLASS
GHashTable * allowed_nodes
#define CRMD_ACTION_STATUS
xmlNode * crm_next_same_xml(const xmlNode *sibling)
Get next instance of same XML tag.
void crm_time_free(crm_time_t *dt)