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");
416 pe_node_t * on_node, gboolean optional, gboolean save_action,
420 GList *possible_matches = NULL;
423 CRM_CHECK(task != NULL, free(key);
return NULL);
425 if (save_action && rsc != NULL) {
427 }
else if(save_action) {
440 if (possible_matches != NULL) {
441 if (pcmk__list_of_multiple(possible_matches)) {
442 pe_warn(
"Action %s for %s on %s exists %d times",
443 task, rsc ? rsc->
id :
"<NULL>",
444 on_node ? on_node->
details->
uname :
"<NULL>", g_list_length(possible_matches));
447 action = g_list_nth_data(possible_matches, 0);
448 pe_rsc_trace(rsc,
"Found action %d: %s for %s (%s) on %s",
449 action->id, task, (rsc? rsc->
id :
"no resource"),
452 g_list_free(possible_matches);
457 pe_rsc_trace(rsc,
"Creating action %d (%s): %s for %s (%s) on %s",
459 (optional?
"optional" :
"required"),
460 task, (rsc? rsc->
id :
"no resource"), key,
471 action->task = strdup(task);
475 action->uuid = strdup(key);
500 guint interval_ms = 0;
502 action->op_entry = find_rsc_op_entry_helper(rsc, key, TRUE);
520 enum pe_quorum_policy quorum_policy = effective_quorum_policy(rsc, data_set);
524 warn_level = LOG_WARNING;
532 .now = data_set->
now,
540 &rule_data,
action->extra, NULL,
548 && (g_hash_table_lookup(
action->meta,
550 pe_rsc_debug(rsc,
"%s on %s is optional (%s is unmanaged)",
561 }
else if (
action->node == NULL) {
567 && !(
action->node->details->online)
569 ||
action->node->details->remote_requires_reset)) {
572 "%s on %s is unrunnable (node is offline)",
575 && save_action && a_task ==
stop_rsc 576 &&
action->node->details->unclean == FALSE) {
581 &&
action->node->details->pending) {
584 "Action %s on %s is unrunnable (node is pending)",
597 "(node's host cannot be fenced)",
601 pe_rsc_trace(rsc,
"%s on %s does not require fencing or quorum",
656 valid_stop_on_fail(
const char *value)
665 const char *
name = NULL;
666 const char *role = NULL;
667 const char *on_fail = NULL;
668 const char *interval_spec = NULL;
669 const char *enabled = NULL;
673 && !valid_stop_on_fail(value)) {
676 "action to default value because '%s' is not " 677 "allowed for stop",
action->rsc->id, value);
682 xmlNode *operation = NULL;
686 for (operation = pcmk__xe_first_child(
action->rsc->ops_xml);
687 (operation != NULL) && (value == NULL);
688 operation = pcmk__xe_next(operation)) {
690 if (!pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
730 "action to default value because 'demote' is not " 740 find_min_interval_mon(
pe_resource_t * rsc, gboolean include_disabled)
742 guint interval_ms = 0;
743 guint min_interval_ms = G_MAXUINT;
744 const char *
name = NULL;
745 const char *value = NULL;
746 const char *interval_spec = NULL;
748 xmlNode *operation = NULL;
750 for (operation = pcmk__xe_first_child(rsc->
ops_xml);
752 operation = pcmk__xe_next(operation)) {
754 if (pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
758 if (!include_disabled && value &&
crm_is_true(value) == FALSE) {
768 if (interval_ms && (interval_ms < min_interval_ms)) {
769 min_interval_ms = interval_ms;
779 unpack_start_delay(
const char *value, GHashTable *meta)
786 if (start_delay < 0) {
792 pcmk__itoa(start_delay));
801 unpack_interval_origin(
const char *value, xmlNode *xml_obj, guint interval_ms,
804 long long result = 0;
805 guint interval_sec = interval_ms / 1000;
809 if ((value == NULL) || (interval_ms == 0) || (now == NULL)) {
815 if (origin == NULL) {
817 "'%s' because '%s' is not valid",
818 (
ID(xml_obj)?
ID(xml_obj) :
"(missing ID)"), value);
827 result = result % interval_sec;
830 result = ((result <= 0)? 0 : interval_sec) - result;
831 crm_info(
"Calculated a start delay of %llds for operation '%s'",
833 (
ID(xml_obj)?
ID(xml_obj) :
"(unspecified)"));
835 if (start_delay != NULL) {
836 *start_delay = result * 1000;
842 unpack_timeout(
const char *value)
846 if (timeout_ms < 0) {
855 xmlNode *child = NULL;
856 GHashTable *action_meta = NULL;
857 const char *timeout_spec = NULL;
863 .now = data_set->
now,
878 if (timeout_spec == NULL && data_set->
op_defaults) {
881 &rule_data, action_meta, NULL, FALSE, data_set);
889 if (timeout_ms < 0) {
893 if (action_meta != NULL) {
894 g_hash_table_destroy(action_meta);
899 #if ENABLE_VERSIONED_ATTRS 901 unpack_versioned_meta(xmlNode *versioned_meta, xmlNode *xml_obj,
904 xmlNode *attrs = NULL;
905 xmlNode *attr = NULL;
907 for (attrs = pcmk__xe_first_child(versioned_meta); attrs != NULL;
908 attrs = pcmk__xe_next(attrs)) {
910 for (attr = pcmk__xe_first_child(attrs); attr != NULL;
911 attr = pcmk__xe_next(attr)) {
917 int start_delay = unpack_start_delay(value, NULL);
921 long long start_delay = 0;
923 if (unpack_interval_origin(value, xml_obj, interval_ms, now,
930 int timeout_ms = unpack_timeout(value);
957 const char *value = NULL;
959 && (interval_ms == 0);
960 #if ENABLE_VERSIONED_ATTRS 961 pe_rsc_action_details_t *rsc_details = NULL;
972 .interval = interval_ms
978 .now = data_set->
now,
980 .rsc_data = &rsc_rule_data,
981 .op_data = &op_rule_data
988 action->meta, NULL, FALSE, data_set);
992 xmlNode *min_interval_mon = find_min_interval_mon(
action->rsc, FALSE);
994 if (min_interval_mon) {
997 crm_trace(
"\t%s: Setting default timeout to minimum-interval " 998 "monitor's timeout '%s'",
action->uuid, value);
1006 xmlAttrPtr xIter = NULL;
1010 action->meta, NULL, TRUE, data_set);
1012 #if ENABLE_VERSIONED_ATTRS 1013 rsc_details = pe_rsc_action_details(
action);
1015 pe_eval_versioned_attributes(data_set->
input, xml_obj,
1017 rsc_details->versioned_parameters,
1019 pe_eval_versioned_attributes(data_set->
input, xml_obj,
1021 rsc_details->versioned_meta,
1028 for (xIter = xml_obj->properties; xIter; xIter = xIter->next) {
1029 const char *prop_name = (
const char *)xIter->name;
1032 g_hash_table_replace(
action->meta, strdup(prop_name), strdup(prop_value));
1036 g_hash_table_remove(
action->meta,
"id");
1039 if (interval_ms > 0) {
1067 value = g_hash_table_lookup(params,
"pcmk_monitor_timeout");
1070 crm_trace(
"\t%s: Setting timeout to pcmk_monitor_timeout '%s', " 1071 "overriding default",
action->uuid, value);
1079 timeout_ms = unpack_timeout(value);
1081 pcmk__itoa(timeout_ms));
1085 value =
"nothing (not start or promote)";
1101 value = unpack_operation_on_fail(
action);
1103 if (value == NULL) {
1112 value =
"node fencing";
1116 "operation '%s' to 'stop' because 'fence' is not " 1117 "valid when fencing is disabled",
action->uuid);
1120 value =
"stop resource";
1125 value =
"node standby";
1133 value =
"force migration";
1138 value =
"stop resource";
1142 value =
"restart (and possibly migrate)";
1144 }
else if (pcmk__str_eq(value,
"restart-container",
pcmk__str_casei)) {
1147 value =
"restart container (and possibly migrate)";
1155 value =
"demote instance";
1158 pe_err(
"Resource %s: Unknown failure type (%s)",
action->rsc->id, value);
1163 if (value == NULL && container) {
1165 value =
"restart container (and possibly migrate) (default)";
1178 && (interval_ms == 0))
1184 value =
"stop unmanaged remote node (enforcing default)";
1188 value =
"fence remote node (default)";
1190 value =
"recover remote node connection (default)";
1193 if (
action->rsc->remote_reconnect_ms) {
1202 value =
"resource fence (default)";
1206 value =
"resource block (default)";
1209 }
else if (value == NULL) {
1211 value =
"restart (and possibly migrate) (default)";
1218 if (xml_obj != NULL) {
1219 value = g_hash_table_lookup(
action->meta,
"role_after_failure");
1222 "Support for role_after_failure is deprecated and will be removed in a future release");
1241 unpack_start_delay(value,
action->meta);
1243 long long start_delay = 0;
1246 if (unpack_interval_origin(value, xml_obj, interval_ms, data_set->
now,
1253 #if ENABLE_VERSIONED_ATTRS 1254 unpack_versioned_meta(rsc_details->versioned_meta, xml_obj, interval_ms,
1260 find_rsc_op_entry_helper(
pe_resource_t * rsc,
const char *key, gboolean include_disabled)
1262 guint interval_ms = 0;
1263 gboolean do_retry = TRUE;
1264 char *local_key = NULL;
1265 const char *
name = NULL;
1266 const char *value = NULL;
1267 const char *interval_spec = NULL;
1268 char *match_key = NULL;
1270 xmlNode *operation = NULL;
1273 for (operation = pcmk__xe_first_child(rsc->
ops_xml); operation != NULL;
1274 operation = pcmk__xe_next(operation)) {
1276 if (pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
1280 if (!include_disabled && value &&
crm_is_true(value) == FALSE) {
1307 if (do_retry == FALSE) {
1317 }
else if (strstr(key,
"_notify_")) {
1329 return find_rsc_op_entry_helper(rsc, key, FALSE);
1339 user_data == NULL ?
"" : (
char *)user_data,
1340 user_data == NULL ?
"" :
": ", (
char *)key, (
char *)value);
1349 g_list_free_full(
action->actions_before, free);
1350 g_list_free_full(
action->actions_after, free);
1352 g_hash_table_destroy(
action->extra);
1355 g_hash_table_destroy(
action->meta);
1357 #if ENABLE_VERSIONED_ATTRS 1359 pe_free_rsc_action_details(
action);
1362 free(
action->cancel_task);
1373 const char *value = NULL;
1374 GList *result = NULL;
1375 GList *gIter = input;
1379 for (; gIter != NULL; gIter = gIter->next) {
1383 if (value == NULL) {
1389 }
else if (not_on_node == NULL) {
1391 result = g_list_prepend(result,
action);
1393 }
else if (
action->node == NULL) {
1397 result = g_list_prepend(result,
action);
1418 crm_trace(
"Folding %s back into its atomic counterpart for %s",
name, rsc->
id);
1430 GList *gIter = NULL;
1434 for (gIter = input; gIter != NULL; gIter = gIter->next) {
1443 }
else if (on_node == NULL) {
1446 }
else if (
action->node == NULL) {
1460 GList *gIter = input;
1461 GList *result = NULL;
1465 for (; gIter != NULL; gIter = gIter->next) {
1472 }
else if (on_node == NULL) {
1473 crm_trace(
"Action %s matches (ignoring node)", key);
1474 result = g_list_prepend(result,
action);
1476 }
else if (
action->node == NULL) {
1477 crm_trace(
"Action %s matches (unallocated, assigning to %s)",
1481 result = g_list_prepend(result,
action);
1485 result = g_list_prepend(result,
action);
1488 crm_trace(
"Action %s on node %s does not match requested node %s",
1489 key,
action->node->details->uname,
1500 GList *result = NULL;
1504 if (on_node == NULL) {
1505 crm_trace(
"Not searching for action %s because node not specified",
1510 for (GList *gIter = input; gIter != NULL; gIter = gIter->next) {
1513 if (
action->node == NULL) {
1514 crm_trace(
"Skipping comparison of %s vs action %s without node",
1521 crm_trace(
"Action %s desired node ID %s doesn't match %s",
1526 result = g_list_prepend(result,
action);
1547 const char *task,
bool require_node)
1549 GList *result = NULL;
1577 for (; gIter != NULL; gIter = gIter->next) {
1580 resource_node_score(child_rsc, node, score, tag);
1586 if (match == NULL) {
1598 resource_node_score(rsc, node, score, tag);
1600 }
else if (data_set != NULL) {
1601 GList *gIter = data_set->
nodes;
1603 for (; gIter != NULL; gIter = gIter->next) {
1606 resource_node_score(rsc, node_iter, score, tag);
1610 GHashTableIter iter;
1614 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node_iter)) {
1615 resource_node_score(rsc, node_iter, score, tag);
1619 if (node == NULL && score == -
INFINITY) {
1628 #define sort_return(an_int, why) do { \ 1631 crm_trace("%s (%d) %c %s (%d) : %s", \ 1632 a_xml_id, a_call_id, an_int>0?'>':an_int<0?'<':'=', \ 1633 b_xml_id, b_call_id, why); \ 1643 char *a_uuid = NULL;
1644 char *b_uuid = NULL;
1646 const xmlNode *xml_a = a;
1647 const xmlNode *xml_b = b;
1658 pe_err(
"Duplicate lrm_rsc_op entries named %s", a_xml_id);
1665 if (a_call_id == -1 && b_call_id == -1) {
1671 }
else if (a_call_id >= 0 && a_call_id < b_call_id) {
1674 }
else if (b_call_id >= 0 && a_call_id > b_call_id) {
1677 }
else if (b_call_id >= 0 && a_call_id == b_call_id) {
1689 (
long long) last_a, (
long long) last_b);
1690 if (last_a >= 0 && last_a < last_b) {
1693 }
else if (last_b >= 0 && last_a > last_b) {
1734 if (b_call_id == -1) {
1737 }
else if (a_call_id == -1) {
1741 }
else if ((a_id >= 0 && a_id < b_id) || b_id == -1) {
1744 }
else if ((b_id >= 0 && a_id > b_id) || a_id == -1) {
1758 if (data_set->
now == NULL) {
1785 "because '%s' is not valid", rsc->
id, value);
1797 "because '%s' only makes sense for promotable " 1798 "clones", rsc->
id, value);
1810 GList *gIter = NULL;
1818 if (lh_action == NULL || rh_action == NULL) {
1829 for (; gIter != NULL; gIter = gIter->next) {
1832 if (after->
action == rh_action && (after->
type & order)) {
1838 wrapper->
action = rh_action;
1839 wrapper->
type = order;
1841 list = g_list_prepend(list, wrapper);
1845 wrapper->
action = lh_action;
1846 wrapper->
type = order;
1848 list = g_list_prepend(list, wrapper);
1874 if (ticket->
state) {
1875 g_hash_table_destroy(ticket->
state);
1886 if (pcmk__str_empty(ticket_id)) {
1890 if (data_set->
tickets == NULL) {
1894 ticket = g_hash_table_lookup(data_set->
tickets, ticket_id);
1895 if (ticket == NULL) {
1898 if (ticket == NULL) {
1899 crm_err(
"Cannot allocate ticket '%s'", ticket_id);
1903 crm_trace(
"Creaing ticket entry for %s", ticket_id);
1905 ticket->
id = strdup(ticket_id);
1911 g_hash_table_insert(data_set->
tickets, strdup(ticket->
id), ticket);
1920 return ID(rsc->
xml);
1929 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
1937 for (GList *lpc = data_set->
resources; lpc != NULL; lpc = lpc->next) {
1947 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
1953 find_unfencing_devices(GList *candidates, GList *matches)
1955 for (GList *gIter = candidates; gIter != NULL; gIter = gIter->next) {
1957 const char *provides = g_hash_table_lookup(candidate->
meta,
1962 matches = find_unfencing_devices(candidate->
children, matches);
1967 matches = g_list_prepend(matches, candidate);
1976 int member_count = 0;
1977 int online_count = 0;
1978 int top_priority = 0;
1979 int lowest_priority = 0;
1980 GList *gIter = NULL;
1998 for (gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
2011 if (member_count == 1
2016 if (member_count == 1
2023 if (online_count > member_count / 2) {
2029 if (lowest_priority == top_priority) {
2044 char *op_key = NULL;
2054 stonith_op = g_hash_table_lookup(data_set->
singletons, op_key);
2057 if(stonith_op == NULL) {
2072 long digests_all_offset = 0;
2073 long digests_secure_offset = 0;
2075 char *digests_all = calloc(max,
sizeof(
char));
2076 char *digests_secure = calloc(max,
sizeof(
char));
2077 GList *matches = find_unfencing_devices(data_set->
resources, NULL);
2079 for (GList *gIter = matches; gIter != NULL; gIter = gIter->next) {
2081 const char *agent = g_hash_table_lookup(match->
meta,
2091 out->
info(out,
"notice: Unfencing %s (remote): because the definition of %s changed",
2096 digests_all_offset += snprintf(
2097 digests_all+digests_all_offset, max-digests_all_offset,
2098 "%s:%s:%s,", match->
id, agent,
data->digest_all_calc);
2100 digests_secure_offset += snprintf(
2101 digests_secure+digests_secure_offset, max-digests_secure_offset,
2102 "%s:%s:%s,", match->
id, agent,
data->digest_secure_calc);
2104 g_hash_table_insert(stonith_op->
meta,
2107 g_hash_table_insert(stonith_op->
meta,
2125 || g_hash_table_lookup(stonith_op->
meta,
2132 char *delay_s = pcmk__itoa(node_priority_fencing_delay(node, data_set));
2134 g_hash_table_insert(stonith_op->
meta,
2139 if(optional == FALSE &&
pe_can_fence(data_set, node)) {
2141 }
else if(reason && stonith_op->
reason == NULL) {
2142 stonith_op->
reason = strdup(reason);
2156 }
else if ((rsc != NULL)
2172 GHashTableIter iter;
2175 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
2176 if(node->details->online && node->details->unclean == FALSE && node->details->shutdown == FALSE) {
2184 add_tag_ref(GHashTable * tags,
const char * tag_name,
const char * obj_ref)
2187 GList *gIter = NULL;
2188 gboolean is_existing = FALSE;
2190 CRM_CHECK(tags && tag_name && obj_ref,
return FALSE);
2192 tag = g_hash_table_lookup(tags, tag_name);
2198 tag->
id = strdup(tag_name);
2200 g_hash_table_insert(tags, strdup(tag_name), tag);
2203 for (gIter = tag->
refs; gIter != NULL; gIter = gIter->next) {
2204 const char *existing_ref = (
const char *) gIter->data;
2212 if (is_existing == FALSE) {
2213 tag->
refs = g_list_append(tag->
refs, strdup(obj_ref));
2214 crm_trace(
"Added: tag=%s ref=%s", tag->
id, obj_ref);
2225 bool update = FALSE;
2226 const char *change = NULL;
2230 change =
"unrunnable";
2233 change =
"required";
2237 change =
"unrunnable";
2239 change =
"dangling";
2241 change =
"required";
2243 crm_err(
"Unknown flag change to %x by %s: 0x%s",
2260 if((change && update) || text) {
2261 char *reason_text = NULL;
2262 if(reason == NULL) {
2265 }
else if(reason->
rsc == NULL) {
2271 if(reason_text &&
action->rsc != reason->
rsc) {
2280 if (
action->reason != NULL && overwrite) {
2284 }
else if (
action->reason == NULL) {
2292 if (reason != NULL) {
2293 action->reason = strdup(reason);
2343 const char *always_first, gboolean overwrite,
2349 always_first, overwrite, next_change);
2361 const char *target_role = NULL;
2401 for (GList *ele = rsc->
running_on; ele; ele = ele->next) {
2420 GList *retval = NULL;
2422 for (GList *gIter = rscs; gIter; gIter = gIter->next) {
2430 retval = g_list_prepend(retval, rsc);
2439 GList *nodes = NULL;
2446 nodes = g_list_prepend(nodes, strdup(
"*"));
2454 nodes = g_list_prepend(nodes, strdup(s));
2471 GList *resources = NULL;
2474 resources = g_list_prepend(resources, strdup(
"*"));
2485 if (strstr(s,
":") != NULL) {
2486 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 pe__clear_action_flags_as(function, line, action, flags_to_clear)
#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)
void pe_action_set_flag_reason(const char *function, long line, pe_action_t *action, pe_action_t *reason, const char *text, enum pe_action_flags flags, bool overwrite)
#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)
#define pe_action_required(action, reason, text)
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
gboolean pcmk__str_in_list(GList *lst, const gchar *s, uint32_t flags)
#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)
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.
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)
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
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)
#define pe__set_action_flags_as(function, line, action, flags_to_set)