26 extern xmlNode *
get_object_root(
const char *object_type, xmlNode * the_root);
27 void print_str_str(gpointer key, gpointer value, gpointer user_data);
31 static xmlNode *find_rsc_op_entry_helper(
pe_resource_t * rsc,
const char *key,
32 gboolean include_disabled);
34 #if ENABLE_VERSIONED_ATTRS 35 pe_rsc_action_details_t *
38 pe_rsc_action_details_t *details;
42 if (
action->action_details == NULL) {
43 action->action_details = calloc(1,
sizeof(pe_rsc_action_details_t));
47 details = (pe_rsc_action_details_t *)
action->action_details;
48 if (details->versioned_parameters == NULL) {
52 if (details->versioned_meta == NULL) {
61 pe_rsc_action_details_t *details;
63 if ((
action == NULL) || (
action->action_details == NULL)) {
67 details = (pe_rsc_action_details_t *)
action->action_details;
69 if (details->versioned_parameters) {
70 free_xml(details->versioned_parameters);
72 if (details->versioned_meta) {
76 action->action_details = NULL;
98 for (GList *n = rsc->
running_on; n != NULL; n = n->next) {
120 }
else if(node == NULL) {
163 GHashTable *result = hash;
170 g_hash_table_iter_init(&iter, hash);
171 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
174 if (other_node == NULL) {
176 }
else if (merge_scores) {
181 for (; gIter != NULL; gIter = gIter->next) {
184 other_node = pe_hash_table_lookup(result, node->
details->
id);
186 if (other_node == NULL) {
190 g_hash_table_insert(result, (gpointer) new_node->
details->
id, new_node);
206 GHashTable *result = NULL;
209 for (GList *gIter = list; gIter != NULL; gIter = gIter->next) {
212 g_hash_table_insert(result, (gpointer) new_node->
details->
id, new_node);
221 ((
const pe_node_t *) b)->details->uname);
233 pe__output_node_weights(
pe_resource_t *rsc,
const char *comment,
240 GList *list = g_list_sort(g_hash_table_get_values(nodes),
sort_node_uname);
242 for (GList *gIter = list; gIter != NULL; gIter = gIter->next) {
263 pe__log_node_weights(
const char *file,
const char *
function,
int line,
273 g_hash_table_iter_init(&iter, nodes);
274 while (g_hash_table_iter_next(&iter, NULL, (
void **) &node)) {
277 qb_log_from_external_source(
function, file,
278 "%s: %s allocation score on %s: %s",
281 node->details->uname, score);
283 qb_log_from_external_source(
function, file,
"%s: %s = %s",
285 comment, node->details->uname,
318 pe__log_node_weights(file,
function, line, rsc, comment, nodes);
320 pe__output_node_weights(rsc, comment, nodes, data_set);
325 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
340 if (a == NULL && b == NULL) {
367 if (a == NULL && b == NULL) {
402 "no-quorum-policy=demote");
429 return g_hash_table_lookup(data_set->
singletons, action_uuid);
447 GList *matches = NULL;
455 if (matches == NULL) {
461 g_list_free(matches);
512 guint interval_ms = 0;
514 action->op_entry = find_rsc_op_entry_helper(rsc, key, TRUE);
521 pe_rsc_trace(rsc,
"Created %s action %d (%s): %s for %s on %s",
522 (optional?
"optional" :
"required"),
524 ((rsc == NULL)?
"no resource" : rsc->
id),
530 add_singleton(data_set,
action);
549 && (
action->op_entry != NULL)) {
554 .now = data_set->
now,
562 &rule_data,
action->extra, NULL,
581 && (g_hash_table_lookup(
action->meta,
590 }
else if (!optional) {
613 if (
action->node == NULL) {
619 && !(
action->node->details->online)
621 ||
action->node->details->remote_requires_reset)) {
624 "%s on %s is unrunnable (node is offline)",
629 && !(
action->node->details->unclean)) {
634 &&
action->node->details->pending) {
637 "Action %s on %s is unrunnable (node is pending)",
650 "(node's host cannot be fenced)",
655 "%s on %s does not require fencing or quorum",
661 switch (effective_quorum_policy(
action->rsc, data_set)) {
673 "%s on %s is unrunnable (no quorum)",
732 pe_node_t *on_node, gboolean optional, gboolean save_action,
737 CRM_ASSERT((key != NULL) && (task != NULL) && (data_set != NULL));
740 action = find_existing_action(key, rsc, on_node, data_set);
744 action = new_action(key, task, rsc, on_node, optional, save_action,
750 update_action_optional(
action, optional);
753 if (
action->node != NULL) {
754 unpack_action_node_attributes(
action, data_set);
757 update_resource_action_runnable(
action, save_action, data_set);
760 update_resource_flags_for_action(rsc,
action);
768 valid_stop_on_fail(
const char *value)
777 const char *
name = NULL;
778 const char *role = NULL;
779 const char *on_fail = NULL;
780 const char *interval_spec = NULL;
781 const char *enabled = NULL;
785 && !valid_stop_on_fail(value)) {
788 "action to default value because '%s' is not " 789 "allowed for stop",
action->rsc->id, value);
794 xmlNode *operation = NULL;
798 for (operation = pcmk__xe_first_child(
action->rsc->ops_xml);
799 (operation != NULL) && (value == NULL);
800 operation = pcmk__xe_next(operation)) {
802 if (!pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
842 "action to default value because 'demote' is not " 852 find_min_interval_mon(
pe_resource_t * rsc, gboolean include_disabled)
854 guint interval_ms = 0;
855 guint min_interval_ms = G_MAXUINT;
856 const char *
name = NULL;
857 const char *value = NULL;
858 const char *interval_spec = NULL;
860 xmlNode *operation = NULL;
862 for (operation = pcmk__xe_first_child(rsc->
ops_xml);
864 operation = pcmk__xe_next(operation)) {
866 if (pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
870 if (!include_disabled && value &&
crm_is_true(value) == FALSE) {
880 if (interval_ms && (interval_ms < min_interval_ms)) {
881 min_interval_ms = interval_ms;
891 unpack_start_delay(
const char *value, GHashTable *meta)
898 if (start_delay < 0) {
904 pcmk__itoa(start_delay));
913 unpack_interval_origin(
const char *value, xmlNode *xml_obj, guint interval_ms,
916 long long result = 0;
917 guint interval_sec = interval_ms / 1000;
921 if ((value == NULL) || (interval_ms == 0) || (now == NULL)) {
927 if (origin == NULL) {
929 "'%s' because '%s' is not valid",
930 (
ID(xml_obj)?
ID(xml_obj) :
"(missing ID)"), value);
939 result = result % interval_sec;
942 result = ((result <= 0)? 0 : interval_sec) - result;
943 crm_info(
"Calculated a start delay of %llds for operation '%s'",
945 (
ID(xml_obj)?
ID(xml_obj) :
"(unspecified)"));
947 if (start_delay != NULL) {
948 *start_delay = result * 1000;
954 unpack_timeout(
const char *value)
958 if (timeout_ms < 0) {
967 xmlNode *child = NULL;
968 GHashTable *action_meta = NULL;
969 const char *timeout_spec = NULL;
975 .now = data_set->
now,
990 if (timeout_spec == NULL && data_set->
op_defaults) {
993 &rule_data, action_meta, NULL, FALSE, data_set);
1001 if (timeout_ms < 0) {
1005 if (action_meta != NULL) {
1006 g_hash_table_destroy(action_meta);
1011 #if ENABLE_VERSIONED_ATTRS 1013 unpack_versioned_meta(xmlNode *versioned_meta, xmlNode *xml_obj,
1016 xmlNode *attrs = NULL;
1017 xmlNode *attr = NULL;
1019 for (attrs = pcmk__xe_first_child(versioned_meta); attrs != NULL;
1020 attrs = pcmk__xe_next(attrs)) {
1022 for (attr = pcmk__xe_first_child(attrs); attr != NULL;
1023 attr = pcmk__xe_next(attr)) {
1029 int start_delay = unpack_start_delay(value, NULL);
1033 long long start_delay = 0;
1035 if (unpack_interval_origin(value, xml_obj, interval_ms, now,
1042 int timeout_ms = unpack_timeout(value);
1069 const char *value = NULL;
1071 && (interval_ms == 0);
1072 #if ENABLE_VERSIONED_ATTRS 1073 pe_rsc_action_details_t *rsc_details = NULL;
1084 .interval = interval_ms
1090 .now = data_set->
now,
1092 .rsc_data = &rsc_rule_data,
1093 .op_data = &op_rule_data
1100 action->meta, NULL, FALSE, data_set);
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;
1122 action->meta, NULL, TRUE, data_set);
1124 #if ENABLE_VERSIONED_ATTRS 1125 rsc_details = pe_rsc_action_details(
action);
1127 pe_eval_versioned_attributes(data_set->
input, xml_obj,
1129 rsc_details->versioned_parameters,
1131 pe_eval_versioned_attributes(data_set->
input, xml_obj,
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 *value = NULL;
1379 const char *interval_spec = NULL;
1380 char *match_key = NULL;
1382 xmlNode *operation = NULL;
1385 for (operation = pcmk__xe_first_child(rsc->
ops_xml); operation != NULL;
1386 operation = pcmk__xe_next(operation)) {
1388 if (pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
1392 if (!include_disabled && value &&
crm_is_true(value) == FALSE) {
1419 if (do_retry == FALSE) {
1429 }
else if (strstr(key,
"_notify_")) {
1441 return find_rsc_op_entry_helper(rsc, key, FALSE);
1451 user_data == NULL ?
"" : (
char *)user_data,
1452 user_data == NULL ?
"" :
": ", (
char *)key, (
char *)value);
1461 g_list_free_full(
action->actions_before, free);
1462 g_list_free_full(
action->actions_after, free);
1464 g_hash_table_destroy(
action->extra);
1467 g_hash_table_destroy(
action->meta);
1469 #if ENABLE_VERSIONED_ATTRS 1471 pe_free_rsc_action_details(
action);
1474 free(
action->cancel_task);
1485 const char *value = NULL;
1486 GList *result = NULL;
1487 GList *gIter = input;
1491 for (; gIter != NULL; gIter = gIter->next) {
1495 if (value == NULL) {
1501 }
else if (not_on_node == NULL) {
1503 result = g_list_prepend(result,
action);
1505 }
else if (
action->node == NULL) {
1509 result = g_list_prepend(result,
action);
1530 crm_trace(
"Folding %s back into its atomic counterpart for %s",
name, rsc->
id);
1542 GList *gIter = NULL;
1546 for (gIter = input; gIter != NULL; gIter = gIter->next) {
1555 }
else if (on_node == NULL) {
1558 }
else if (
action->node == NULL) {
1572 GList *gIter = input;
1573 GList *result = NULL;
1577 for (; gIter != NULL; gIter = gIter->next) {
1583 }
else if (on_node == NULL) {
1584 crm_trace(
"Action %s matches (ignoring node)", key);
1585 result = g_list_prepend(result,
action);
1587 }
else if (
action->node == NULL) {
1588 crm_trace(
"Action %s matches (unallocated, assigning to %s)",
1592 result = g_list_prepend(result,
action);
1596 result = g_list_prepend(result,
action);
1606 GList *result = NULL;
1610 if (on_node == NULL) {
1614 for (GList *gIter = input; gIter != NULL; gIter = gIter->next) {
1617 if ((
action->node != NULL)
1623 result = g_list_prepend(result,
action);
1644 const char *task,
bool require_node)
1646 GList *result = NULL;
1674 for (; gIter != NULL; gIter = gIter->next) {
1677 resource_node_score(child_rsc, node, score, tag);
1683 if (match == NULL) {
1695 resource_node_score(rsc, node, score, tag);
1697 }
else if (data_set != NULL) {
1698 GList *gIter = data_set->
nodes;
1700 for (; gIter != NULL; gIter = gIter->next) {
1703 resource_node_score(rsc, node_iter, score, tag);
1707 GHashTableIter iter;
1711 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node_iter)) {
1712 resource_node_score(rsc, node_iter, score, tag);
1716 if (node == NULL && score == -
INFINITY) {
1725 #define sort_return(an_int, why) do { \ 1728 crm_trace("%s (%d) %c %s (%d) : %s", \ 1729 a_xml_id, a_call_id, an_int>0?'>':an_int<0?'<':'=', \ 1730 b_xml_id, b_call_id, why); \ 1740 char *a_uuid = NULL;
1741 char *b_uuid = NULL;
1743 const xmlNode *xml_a = a;
1744 const xmlNode *xml_b = b;
1755 pe_err(
"Duplicate lrm_rsc_op entries named %s", a_xml_id);
1762 if (a_call_id == -1 && b_call_id == -1) {
1768 }
else if (a_call_id >= 0 && a_call_id < b_call_id) {
1771 }
else if (b_call_id >= 0 && a_call_id > b_call_id) {
1774 }
else if (b_call_id >= 0 && a_call_id == b_call_id) {
1786 (
long long) last_a, (
long long) last_b);
1787 if (last_a >= 0 && last_a < last_b) {
1790 }
else if (last_b >= 0 && last_a > last_b) {
1831 if (b_call_id == -1) {
1834 }
else if (a_call_id == -1) {
1838 }
else if ((a_id >= 0 && a_id < b_id) || b_id == -1) {
1841 }
else if ((b_id >= 0 && a_id > b_id) || a_id == -1) {
1855 if (data_set->
now == NULL) {
1882 "because '%s' is not valid", rsc->
id, value);
1894 "because '%s' only makes sense for promotable " 1895 "clones", rsc->
id, value);
1907 GList *gIter = NULL;
1915 if (lh_action == NULL || rh_action == NULL) {
1919 crm_trace(
"Creating action wrappers for ordering: %s then %s",
1927 for (; gIter != NULL; gIter = gIter->next) {
1930 if (after->
action == rh_action && (after->
type & order)) {
1936 wrapper->
action = rh_action;
1937 wrapper->
type = order;
1939 list = g_list_prepend(list, wrapper);
1943 wrapper->
action = lh_action;
1944 wrapper->
type = order;
1946 list = g_list_prepend(list, wrapper);
1968 if (ticket->
state) {
1969 g_hash_table_destroy(ticket->
state);
1980 if (pcmk__str_empty(ticket_id)) {
1984 if (data_set->
tickets == NULL) {
1988 ticket = g_hash_table_lookup(data_set->
tickets, ticket_id);
1989 if (ticket == NULL) {
1992 if (ticket == NULL) {
1993 crm_err(
"Cannot allocate ticket '%s'", ticket_id);
1997 crm_trace(
"Creaing ticket entry for %s", ticket_id);
1999 ticket->
id = strdup(ticket_id);
2005 g_hash_table_insert(data_set->
tickets, strdup(ticket->
id), ticket);
2014 return ID(rsc->
xml);
2023 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
2031 for (GList *lpc = data_set->
resources; lpc != NULL; lpc = lpc->next) {
2041 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
2047 find_unfencing_devices(GList *candidates, GList *matches)
2049 for (GList *gIter = candidates; gIter != NULL; gIter = gIter->next) {
2051 const char *provides = g_hash_table_lookup(candidate->
meta,
2056 matches = find_unfencing_devices(candidate->
children, matches);
2061 matches = g_list_prepend(matches, candidate);
2070 int member_count = 0;
2071 int online_count = 0;
2072 int top_priority = 0;
2073 int lowest_priority = 0;
2074 GList *gIter = NULL;
2092 for (gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
2105 if (member_count == 1
2110 if (member_count == 1
2117 if (online_count > member_count / 2) {
2123 if (lowest_priority == top_priority) {
2138 char *op_key = NULL;
2147 stonith_op = lookup_singleton(data_set, op_key);
2148 if(stonith_op == NULL) {
2163 long digests_all_offset = 0;
2164 long digests_secure_offset = 0;
2166 char *digests_all = calloc(max,
sizeof(
char));
2167 char *digests_secure = calloc(max,
sizeof(
char));
2168 GList *matches = find_unfencing_devices(data_set->
resources, NULL);
2170 for (GList *gIter = matches; gIter != NULL; gIter = gIter->next) {
2172 const char *agent = g_hash_table_lookup(match->
meta,
2182 out->
info(out,
"notice: Unfencing %s (remote): because the definition of %s changed",
2187 digests_all_offset += snprintf(
2188 digests_all+digests_all_offset, max-digests_all_offset,
2189 "%s:%s:%s,", match->
id, agent,
data->digest_all_calc);
2191 digests_secure_offset += snprintf(
2192 digests_secure+digests_secure_offset, max-digests_secure_offset,
2193 "%s:%s:%s,", match->
id, agent,
data->digest_secure_calc);
2195 g_hash_table_insert(stonith_op->
meta,
2198 g_hash_table_insert(stonith_op->
meta,
2216 || g_hash_table_lookup(stonith_op->
meta,
2223 char *delay_s = pcmk__itoa(node_priority_fencing_delay(node, data_set));
2225 g_hash_table_insert(stonith_op->
meta,
2230 if(optional == FALSE &&
pe_can_fence(data_set, node)) {
2234 }
else if(reason && stonith_op->
reason == NULL) {
2235 stonith_op->
reason = strdup(reason);
2249 }
else if ((rsc != NULL)
2265 GHashTableIter iter;
2268 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
2269 if(node->details->online && node->details->unclean == FALSE && node->details->shutdown == FALSE) {
2277 add_tag_ref(GHashTable * tags,
const char * tag_name,
const char * obj_ref)
2280 GList *gIter = NULL;
2281 gboolean is_existing = FALSE;
2283 CRM_CHECK(tags && tag_name && obj_ref,
return FALSE);
2285 tag = g_hash_table_lookup(tags, tag_name);
2291 tag->
id = strdup(tag_name);
2293 g_hash_table_insert(tags, strdup(tag_name), tag);
2296 for (gIter = tag->
refs; gIter != NULL; gIter = gIter->next) {
2297 const char *existing_ref = (
const char *) gIter->data;
2305 if (is_existing == FALSE) {
2306 tag->
refs = g_list_append(tag->
refs, strdup(obj_ref));
2307 crm_trace(
"Added: tag=%s ref=%s", tag->
id, obj_ref);
2326 const char *change = NULL;
2331 change =
"unrunnable";
2334 change =
"required";
2342 (
action->rsc == NULL)?
"" :
" ",
2349 if (
action->reason != NULL && overwrite) {
2353 }
else if (
action->reason == NULL) {
2361 if (reason != NULL) {
2362 action->reason = strdup(reason);
2412 const char *always_first, gboolean overwrite,
2418 always_first, overwrite, next_change);
2430 const char *target_role = NULL;
2470 for (GList *ele = rsc->
running_on; ele; ele = ele->next) {
2490 GList *retval = NULL;
2492 for (GList *gIter = rscs; gIter; gIter = gIter->next) {
2500 retval = g_list_prepend(retval, rsc);
2509 GList *nodes = NULL;
2516 nodes = g_list_prepend(nodes, strdup(
"*"));
2524 nodes = g_list_prepend(nodes, strdup(s));
2541 GList *resources = NULL;
2544 resources = g_list_prepend(resources, strdup(
"*"));
2555 if (strstr(s,
":") != NULL) {
2556 resources = g_list_prepend(resources, strdup(rsc->
id));
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.
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.
#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
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)
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
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.
#define XML_TAG_META_SETS
Wrappers for and extensions to libxml2.
Internal state tracking when creating graph.
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
xmlNode * get_object_root(const char *object_type, xmlNode *the_root)
#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)
void add_hash_param(GHashTable *hash, const char *name, const char *value)
int pe__add_scores(int score1, int score2)
#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
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.
gboolean crm_is_true(const char *s)
#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...)
char * score2char_stack(int score, char *buf, size_t len)
#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)