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;
43 action->
action_details = calloc(1,
sizeof(pe_rsc_action_details_t));
48 if (details->versioned_parameters == NULL) {
52 if (details->versioned_meta == NULL) {
61 pe_rsc_action_details_t *details;
69 if (details->versioned_parameters) {
70 free_xml(details->versioned_parameters);
72 if (details->versioned_meta) {
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",
283 qb_log_from_external_source(
function, file,
"%s: %s = %s",
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) {
429 action = g_hash_table_lookup(data_set->
singletons, key);
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);
455 if (action == NULL) {
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,
547 }
else if (action->
node == NULL) {
553 && g_hash_table_lookup(action->
meta,
555 pe_rsc_debug(rsc,
"%s on %s is optional (%s is unmanaged)",
566 "%s on %s is unrunnable (node is offline)",
569 && save_action && a_task ==
stop_rsc
578 "Action %s on %s is unrunnable (node is pending)",
591 "(node's host cannot be fenced)",
595 pe_rsc_trace(rsc,
"%s on %s does not require fencing or quorum",
606 action->runnable = TRUE;
650 valid_stop_on_fail(
const char *value)
659 const char *
name = NULL;
660 const char *role = NULL;
661 const char *on_fail = NULL;
662 const char *interval_spec = NULL;
663 const char *enabled = NULL;
667 && !valid_stop_on_fail(value)) {
670 "action to default value because '%s' is not "
671 "allowed for stop", action->
rsc->
id, value);
676 xmlNode *operation = NULL;
680 for (operation = pcmk__xe_first_child(action->
rsc->
ops_xml);
681 (operation != NULL) && (value == NULL);
682 operation = pcmk__xe_next(operation)) {
684 if (!pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
724 "action to default value because 'demote' is not "
725 "allowed for it", action->
rsc->
id, name);
734 find_min_interval_mon(
pe_resource_t * rsc, gboolean include_disabled)
736 guint interval_ms = 0;
737 guint min_interval_ms = G_MAXUINT;
738 const char *name = NULL;
739 const char *value = NULL;
740 const char *interval_spec = NULL;
742 xmlNode *operation = NULL;
744 for (operation = pcmk__xe_first_child(rsc->
ops_xml);
746 operation = pcmk__xe_next(operation)) {
748 if (pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
752 if (!include_disabled && value &&
crm_is_true(value) == FALSE) {
762 if (interval_ms && (interval_ms < min_interval_ms)) {
763 min_interval_ms = interval_ms;
773 unpack_start_delay(
const char *value, GHashTable *meta)
780 if (start_delay < 0) {
786 pcmk__itoa(start_delay));
795 unpack_interval_origin(
const char *value, xmlNode *xml_obj, guint interval_ms,
798 long long result = 0;
799 guint interval_sec = interval_ms / 1000;
803 if ((value == NULL) || (interval_ms == 0) || (now == NULL)) {
809 if (origin == NULL) {
811 "'%s' because '%s' is not valid",
812 (
ID(xml_obj)?
ID(xml_obj) :
"(missing ID)"), value);
821 result = result % interval_sec;
824 result = ((result <= 0)? 0 : interval_sec) - result;
825 crm_info(
"Calculated a start delay of %llds for operation '%s'",
827 (
ID(xml_obj)?
ID(xml_obj) :
"(unspecified)"));
829 if (start_delay != NULL) {
830 *start_delay = result * 1000;
836 unpack_timeout(
const char *value)
840 if (timeout_ms < 0) {
849 xmlNode *child = NULL;
850 GHashTable *action_meta = NULL;
851 const char *timeout_spec = NULL;
857 .now = data_set->
now,
872 if (timeout_spec == NULL && data_set->
op_defaults) {
875 &rule_data, action_meta, NULL, FALSE, data_set);
883 if (timeout_ms < 0) {
887 if (action_meta != NULL) {
888 g_hash_table_destroy(action_meta);
893 #if ENABLE_VERSIONED_ATTRS
895 unpack_versioned_meta(xmlNode *versioned_meta, xmlNode *xml_obj,
898 xmlNode *attrs = NULL;
899 xmlNode *attr = NULL;
901 for (attrs = pcmk__xe_first_child(versioned_meta); attrs != NULL;
902 attrs = pcmk__xe_next(attrs)) {
904 for (attr = pcmk__xe_first_child(attrs); attr != NULL;
905 attr = pcmk__xe_next(attr)) {
911 int start_delay = unpack_start_delay(value, NULL);
915 long long start_delay = 0;
917 if (unpack_interval_origin(value, xml_obj, interval_ms, now,
924 int timeout_ms = unpack_timeout(value);
951 const char *value = NULL;
953 && (interval_ms == 0);
954 #if ENABLE_VERSIONED_ATTRS
955 pe_rsc_action_details_t *rsc_details = NULL;
966 .interval = interval_ms
972 .now = data_set->
now,
974 .rsc_data = &rsc_rule_data,
975 .op_data = &op_rule_data
982 action->
meta, NULL, FALSE, data_set);
986 xmlNode *min_interval_mon = find_min_interval_mon(action->
rsc, FALSE);
988 if (min_interval_mon) {
991 crm_trace(
"\t%s: Setting default timeout to minimum-interval "
992 "monitor's timeout '%s'", action->
uuid, value);
1000 xmlAttrPtr xIter = NULL;
1004 action->
meta, NULL, TRUE, data_set);
1006 #if ENABLE_VERSIONED_ATTRS
1007 rsc_details = pe_rsc_action_details(action);
1009 pe_eval_versioned_attributes(data_set->
input, xml_obj,
1011 rsc_details->versioned_parameters,
1013 pe_eval_versioned_attributes(data_set->
input, xml_obj,
1015 rsc_details->versioned_meta,
1022 for (xIter = xml_obj->properties; xIter; xIter = xIter->next) {
1023 const char *prop_name = (
const char *)xIter->name;
1026 g_hash_table_replace(action->
meta, strdup(prop_name), strdup(prop_value));
1030 g_hash_table_remove(action->
meta,
"id");
1033 if (interval_ms > 0) {
1061 value = g_hash_table_lookup(params,
"pcmk_monitor_timeout");
1064 crm_trace(
"\t%s: Setting timeout to pcmk_monitor_timeout '%s', "
1065 "overriding default", action->
uuid, value);
1073 timeout_ms = unpack_timeout(value);
1075 pcmk__itoa(timeout_ms));
1079 value =
"nothing (not start or promote)";
1095 value = unpack_operation_on_fail(action);
1097 if (value == NULL) {
1106 value =
"node fencing";
1110 "operation '%s' to 'stop' because 'fence' is not "
1111 "valid when fencing is disabled", action->
uuid);
1114 value =
"stop resource";
1119 value =
"node standby";
1127 value =
"force migration";
1132 value =
"stop resource";
1136 value =
"restart (and possibly migrate)";
1138 }
else if (pcmk__str_eq(value,
"restart-container",
pcmk__str_casei)) {
1141 value =
"restart container (and possibly migrate)";
1149 value =
"demote instance";
1152 pe_err(
"Resource %s: Unknown failure type (%s)", action->
rsc->
id, value);
1157 if (value == NULL && container) {
1159 value =
"restart container (and possibly migrate) (default)";
1172 && (interval_ms == 0))
1178 value =
"stop unmanaged remote node (enforcing default)";
1182 value =
"fence remote node (default)";
1184 value =
"recover remote node connection (default)";
1196 value =
"resource fence (default)";
1200 value =
"resource block (default)";
1203 }
else if (value == NULL) {
1205 value =
"restart (and possibly migrate) (default)";
1209 action->
uuid, value);
1212 if (xml_obj != NULL) {
1213 value = g_hash_table_lookup(action->
meta,
"role_after_failure");
1216 "Support for role_after_failure is deprecated and will be removed in a future release");
1235 unpack_start_delay(value, action->
meta);
1237 long long start_delay = 0;
1240 if (unpack_interval_origin(value, xml_obj, interval_ms, data_set->
now,
1247 #if ENABLE_VERSIONED_ATTRS
1248 unpack_versioned_meta(rsc_details->versioned_meta, xml_obj, interval_ms,
1254 find_rsc_op_entry_helper(
pe_resource_t * rsc,
const char *key, gboolean include_disabled)
1256 guint interval_ms = 0;
1257 gboolean do_retry = TRUE;
1258 char *local_key = NULL;
1259 const char *name = NULL;
1260 const char *value = NULL;
1261 const char *interval_spec = NULL;
1262 char *match_key = NULL;
1264 xmlNode *operation = NULL;
1267 for (operation = pcmk__xe_first_child(rsc->
ops_xml); operation != NULL;
1268 operation = pcmk__xe_next(operation)) {
1270 if (pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
1274 if (!include_disabled && value &&
crm_is_true(value) == FALSE) {
1301 if (do_retry == FALSE) {
1311 }
else if (strstr(key,
"_notify_")) {
1323 return find_rsc_op_entry_helper(rsc, key, FALSE);
1333 user_data == NULL ?
"" : (
char *)user_data,
1334 user_data == NULL ?
"" :
": ", (
char *)key, (
char *)value);
1340 if (action == NULL) {
1345 if (action->
extra) {
1346 g_hash_table_destroy(action->
extra);
1349 g_hash_table_destroy(action->
meta);
1351 #if ENABLE_VERSIONED_ATTRS
1353 pe_free_rsc_action_details(action);
1367 const char *value = NULL;
1368 GList *result = NULL;
1369 GList *gIter = input;
1373 for (; gIter != NULL; gIter = gIter->next) {
1377 if (value == NULL) {
1383 }
else if (not_on_node == NULL) {
1385 result = g_list_prepend(result, action);
1387 }
else if (action->
node == NULL) {
1391 result = g_list_prepend(result, action);
1412 crm_trace(
"Folding %s back into its atomic counterpart for %s", name, rsc->
id);
1424 GList *gIter = NULL;
1428 for (gIter = input; gIter != NULL; gIter = gIter->next) {
1437 }
else if (on_node == NULL) {
1440 }
else if (action->
node == NULL) {
1454 GList *gIter = input;
1455 GList *result = NULL;
1459 for (; gIter != NULL; gIter = gIter->next) {
1463 crm_trace(
"%s does not match action %s", key, action->
uuid);
1466 }
else if (on_node == NULL) {
1467 crm_trace(
"Action %s matches (ignoring node)", key);
1468 result = g_list_prepend(result, action);
1470 }
else if (action->
node == NULL) {
1471 crm_trace(
"Action %s matches (unallocated, assigning to %s)",
1475 result = g_list_prepend(result, action);
1479 result = g_list_prepend(result, action);
1482 crm_trace(
"Action %s on node %s does not match requested node %s",
1494 GList *result = NULL;
1498 if (on_node == NULL) {
1499 crm_trace(
"Not searching for action %s because node not specified",
1504 for (GList *gIter = input; gIter != NULL; gIter = gIter->next) {
1507 if (action->
node == NULL) {
1508 crm_trace(
"Skipping comparison of %s vs action %s without node",
1512 crm_trace(
"Desired action %s doesn't match %s", key, action->
uuid);
1515 crm_trace(
"Action %s desired node ID %s doesn't match %s",
1520 result = g_list_prepend(result, action);
1541 const char *task,
bool require_node)
1543 GList *result = NULL;
1571 for (; gIter != NULL; gIter = gIter->next) {
1574 resource_node_score(child_rsc, node, score, tag);
1580 if (match == NULL) {
1592 resource_node_score(rsc, node, score, tag);
1594 }
else if (data_set != NULL) {
1595 GList *gIter = data_set->
nodes;
1597 for (; gIter != NULL; gIter = gIter->next) {
1600 resource_node_score(rsc, node_iter, score, tag);
1604 GHashTableIter iter;
1608 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node_iter)) {
1609 resource_node_score(rsc, node_iter, score, tag);
1613 if (node == NULL && score == -
INFINITY) {
1622 #define sort_return(an_int, why) do { \
1625 crm_trace("%s (%d) %c %s (%d) : %s", \
1626 a_xml_id, a_call_id, an_int>0?'>':an_int<0?'<':'=', \
1627 b_xml_id, b_call_id, why); \
1637 char *a_uuid = NULL;
1638 char *b_uuid = NULL;
1640 const xmlNode *xml_a = a;
1641 const xmlNode *xml_b = b;
1652 pe_err(
"Duplicate lrm_rsc_op entries named %s", a_xml_id);
1659 if (a_call_id == -1 && b_call_id == -1) {
1665 }
else if (a_call_id >= 0 && a_call_id < b_call_id) {
1668 }
else if (b_call_id >= 0 && a_call_id > b_call_id) {
1671 }
else if (b_call_id >= 0 && a_call_id == b_call_id) {
1683 (
long long) last_a, (
long long) last_b);
1684 if (last_a >= 0 && last_a < last_b) {
1687 }
else if (last_b >= 0 && last_a > last_b) {
1728 if (b_call_id == -1) {
1731 }
else if (a_call_id == -1) {
1735 }
else if ((a_id >= 0 && a_id < b_id) || b_id == -1) {
1738 }
else if ((b_id >= 0 && a_id > b_id) || a_id == -1) {
1752 if (data_set->
now == NULL) {
1779 "because '%s' is not valid", rsc->
id, value);
1791 "because '%s' only makes sense for promotable "
1792 "clones", rsc->
id, value);
1804 GList *gIter = NULL;
1812 if (lh_action == NULL || rh_action == NULL) {
1823 for (; gIter != NULL; gIter = gIter->next) {
1826 if (after->
action == rh_action && (after->
type & order)) {
1832 wrapper->
action = rh_action;
1833 wrapper->
type = order;
1835 list = g_list_prepend(list, wrapper);
1839 wrapper->
action = lh_action;
1840 wrapper->
type = order;
1842 list = g_list_prepend(list, wrapper);
1853 op = g_hash_table_lookup(data_set->
singletons, name);
1856 op =
custom_action(NULL, strdup(name), name, NULL, TRUE, TRUE, data_set);
1868 if (ticket->
state) {
1869 g_hash_table_destroy(ticket->
state);
1880 if (pcmk__str_empty(ticket_id)) {
1884 if (data_set->
tickets == NULL) {
1888 ticket = g_hash_table_lookup(data_set->
tickets, ticket_id);
1889 if (ticket == NULL) {
1892 if (ticket == NULL) {
1893 crm_err(
"Cannot allocate ticket '%s'", ticket_id);
1897 crm_trace(
"Creaing ticket entry for %s", ticket_id);
1899 ticket->
id = strdup(ticket_id);
1905 g_hash_table_insert(data_set->
tickets, strdup(ticket->
id), ticket);
1914 return ID(rsc->
xml);
1923 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
1931 for (GList *lpc = data_set->
resources; lpc != NULL; lpc = lpc->next) {
1941 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
1947 find_unfencing_devices(GList *candidates, GList *matches)
1949 for (GList *gIter = candidates; gIter != NULL; gIter = gIter->next) {
1951 const char *provides = g_hash_table_lookup(candidate->
meta,
1956 matches = find_unfencing_devices(candidate->
children, matches);
1961 matches = g_list_prepend(matches, candidate);
1970 int member_count = 0;
1971 int online_count = 0;
1972 int top_priority = 0;
1973 int lowest_priority = 0;
1974 GList *gIter = NULL;
1992 for (gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
2005 if (member_count == 1
2010 if (member_count == 1
2017 if (online_count > member_count / 2) {
2023 if (lowest_priority == top_priority) {
2038 char *op_key = NULL;
2048 stonith_op = g_hash_table_lookup(data_set->
singletons, op_key);
2051 if(stonith_op == NULL) {
2066 long digests_all_offset = 0;
2067 long digests_secure_offset = 0;
2069 char *digests_all = calloc(max,
sizeof(
char));
2070 char *digests_secure = calloc(max,
sizeof(
char));
2071 GList *matches = find_unfencing_devices(data_set->
resources, NULL);
2073 for (GList *gIter = matches; gIter != NULL; gIter = gIter->next) {
2075 const char *agent = g_hash_table_lookup(match->
meta,
2085 out->
info(out,
"notice: Unfencing %s (remote): because the definition of %s changed",
2090 digests_all_offset += snprintf(
2091 digests_all+digests_all_offset, max-digests_all_offset,
2094 digests_secure_offset += snprintf(
2095 digests_secure+digests_secure_offset, max-digests_secure_offset,
2098 g_hash_table_insert(stonith_op->
meta,
2101 g_hash_table_insert(stonith_op->
meta,
2119 || g_hash_table_lookup(stonith_op->
meta,
2126 char *delay_s = pcmk__itoa(node_priority_fencing_delay(node, data_set));
2128 g_hash_table_insert(stonith_op->
meta,
2133 if(optional == FALSE &&
pe_can_fence(data_set, node)) {
2135 }
else if(reason && stonith_op->
reason == NULL) {
2136 stonith_op->
reason = strdup(reason);
2150 }
else if ((rsc != NULL)
2166 GHashTableIter iter;
2169 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
2178 add_tag_ref(GHashTable * tags,
const char * tag_name,
const char * obj_ref)
2181 GList *gIter = NULL;
2182 gboolean is_existing = FALSE;
2184 CRM_CHECK(tags && tag_name && obj_ref,
return FALSE);
2186 tag = g_hash_table_lookup(tags, tag_name);
2192 tag->
id = strdup(tag_name);
2194 g_hash_table_insert(tags, strdup(tag_name), tag);
2197 for (gIter = tag->
refs; gIter != NULL; gIter = gIter->next) {
2198 const char *existing_ref = (
const char *) gIter->data;
2206 if (is_existing == FALSE) {
2207 tag->
refs = g_list_append(tag->
refs, strdup(obj_ref));
2208 crm_trace(
"Added: tag=%s ref=%s", tag->
id, obj_ref);
2219 bool update = FALSE;
2220 const char *change = NULL;
2224 change =
"unrunnable";
2227 change =
"required";
2231 change =
"unrunnable";
2233 change =
"dangling";
2235 change =
"required";
2237 crm_err(
"Unknown flag change to %x by %s: 0x%s",
2238 flags, action->
uuid, (reason? reason->
uuid :
"0"));
2254 if((change && update) || text) {
2255 char *reason_text = NULL;
2256 if(reason == NULL) {
2259 }
else if(reason->
rsc == NULL) {
2265 if(reason_text && action->
rsc != reason->
rsc) {
2274 if (action->
reason != NULL && overwrite) {
2278 }
else if (action->
reason == NULL) {
2286 if (reason != NULL) {
2287 action->
reason = strdup(reason);
2337 const char *always_first, gboolean overwrite,
2343 always_first, overwrite, next_change);
2355 const char *target_role = NULL;
2395 for (GList *ele = rsc->
running_on; ele; ele = ele->next) {
2414 GList *retval = NULL;
2416 for (GList *gIter = rscs; gIter; gIter = gIter->next) {
2424 retval = g_list_prepend(retval, rsc);
2433 GList *nodes = NULL;
2440 nodes = g_list_prepend(nodes, strdup(
"*"));
2448 nodes = g_list_prepend(nodes, strdup(s));
2465 GList *resources = NULL;
2468 resources = g_list_prepend(resources, strdup(
"*"));
2479 if (strstr(s,
":") != NULL) {
2480 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
#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)
enum rsc_start_requirement needs
void pe__clear_resource_flags_recursive(pe_resource_t *rsc, uint64_t flags)
enum pe_quorum_policy no_quorum_policy
gboolean parse_op_key(const char *key, char **rsc_id, char **op_type, guint *interval_ms)
GHashTable * pe__node_list2table(GList *list)
#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)
#define pe_rsc_debug(rsc, fmt, args...)
gint sort_rsc_priority(gconstpointer a, gconstpointer b)
#define XML_OP_ATTR_DIGESTS_ALL
GList * find_recurring_actions(GList *input, pe_node_t *not_on_node)
#define pe__set_action_flags(action, flags_to_set)
gint sort_rsc_index(gconstpointer a, gconstpointer b)
#define XML_EXPR_ATTR_TYPE
#define XML_ATTR_TRANSITION_MAGIC
bool crm_time_is_defined(const crm_time_t *t)
Check whether a time object has been initialized yet.
#define PCMK_STONITH_PROVIDES
pe_resource_t * container
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
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)
GList * pe__build_rsc_list(pe_working_set_t *data_set, const char *s)
#define XML_CONFIG_ATTR_PRIORITY_FENCING_DELAY
struct crm_time_s crm_time_t
void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set)
GList * find_actions(GList *input, const char *key, const pe_node_t *on_node)
int priority_fencing_delay
xmlNode * get_object_root(const char *object_type, xmlNode *the_root)
xmlNode * first_named_child(const xmlNode *parent, const char *name)
#define pe_action_required(action, reason, text)
gboolean pcmk__str_in_list(GList *lst, const gchar *s)
enum rsc_role_e next_role
enum action_fail_response on_fail
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...)
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)
resource_object_functions_t * fns
#define XML_LRM_ATTR_INTERVAL
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)
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
pe_node_t * pe__copy_node(const pe_node_t *this_node)
#define CRMD_ACTION_PROMOTE
int(* message)(pcmk__output_t *out, const char *message_id,...)
#define XML_NVPAIR_ATTR_NAME
void node_list_exclude(GHashTable *list, GList *list2, gboolean merge_scores)
#define XML_OP_ATTR_DIGESTS_SECURE
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
#define RSC_ROLE_PROMOTED_LEGACY_S
#define pcmk__log_else(level, else_action)
enum action_tasks text2task(const char *task)
time_t get_effective_time(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)
#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
gboolean remote_requires_reset
GList * pe__rscs_with_tag(pe_working_set_t *data_set, const char *tag_name)
#define pe__set_resource_flags(resource, 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)
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 CRMD_ACTION_START
GList * pe__filter_rsc_list(GList *rscs, GList *filter)
gboolean ghash_free_str_str(gpointer key, gpointer value, gpointer user_data)
void pe__set_resource_flags_recursive(pe_resource_t *rsc, uint64_t flags)
#define XML_TAG_ATTR_SETS
const char * role2text(enum rsc_role_e role)
guint remote_reconnect_ms
#define CRMD_ACTION_DEMOTE
void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite)
#define XML_RSC_ATTR_REQUIRES
pe_action_t * get_pseudo_op(const char *name, pe_working_set_t *data_set)
pe_resource_t * uber_parent(pe_resource_t *rsc)
#define XML_CIB_ATTR_SHUTDOWN
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
bool pe__is_guest_node(const pe_node_t *node)
#define pe_warn_once(pe_wo_bit, fmt...)
pe_ticket_t * ticket_new(const char *ticket_id, pe_working_set_t *data_set)
#define sort_return(an_int, why)
#define pe__clear_action_flags(action, flags_to_clear)
#define crm_trace(fmt, args...)
enum action_tasks get_complex_task(pe_resource_t *rsc, const char *name, gboolean allow_non_atomic)
#define do_crm_log(level, fmt, args...)
Log a message.
enum rsc_digest_cmp_val rc
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 * digest_secure_calc
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
int(* info)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
const char * stonith_action
struct pe_node_shared_s * details
gboolean get_target_role(pe_resource_t *rsc, enum rsc_role_e *role)
#define XML_TAG_OP_VER_META
bool pe__shutdown_requested(pe_node_t *node)
#define XML_AGENT_ATTR_PROVIDER
#define pe_rsc_needs_fencing
gboolean order_actions(pe_action_t *lh_action, pe_action_t *rh_action, enum pe_ordering order)
#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 * find_rsc_op_entry(pe_resource_t *rsc, const char *key)
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
xmlNode * create_xml_node(xmlNode *parent, const char *name)
long long int crm_time_get_seconds_since_epoch(crm_time_t *dt)
#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
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
int pe_get_configured_timeout(pe_resource_t *rsc, const char *action, pe_working_set_t *data_set)
#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)
bool pe_can_fence(pe_working_set_t *data_set, pe_node_t *node)
match resource ID or LRM history ID
GList * pe__build_node_name_list(pe_working_set_t *data_set, const char *s)
bool pcmk__rsc_filtered_by_node(pe_resource_t *rsc, GList *only_node)
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...)
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)
char guint crm_parse_interval_spec(const char *input)
Parse milliseconds from a Pacemaker interval specification.
const char * rsc_printable_id(pe_resource_t *rsc)
crm_time_t * crm_time_new(const char *string)
bool pe__rsc_running_on_any_node_in_list(pe_resource_t *rsc, GList *node_list)
void pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role, const char *why)
This structure contains everything that makes up a single output formatter.
#define XML_LRM_ATTR_INTERVAL_MS
void pe__clear_resource_flags_on_all(pe_working_set_t *data_set, uint64_t flag)
#define XML_LRM_ATTR_CALLID
#define CRMD_ACTION_MIGRATE
#define XML_NVPAIR_ATTR_VALUE
enum rsc_role_e fail_role
#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.
enum pe_action_flags flags
#define XML_OP_ATTR_START_DELAY
void destroy_ticket(gpointer data)
#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
GList * find_actions_exact(GList *input, const char *key, const pe_node_t *on_node)
#define pe_flag_enable_unfencing
#define XML_LRM_ATTR_TARGET
#define pe_rsc_trace(rsc, fmt, args...)
gboolean(* active)(pe_resource_t *, gboolean)
bool pe__resource_is_disabled(pe_resource_t *rsc)
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.
pe_action_t * pe__clear_resource_history(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
void print_str_str(gpointer key, gpointer value, gpointer user_data)
GList * pe__unames_with_tag(pe_working_set_t *data_set, const char *tag_name)
#define CRM_OP_LRM_DELETE
gint sort_node_uname(gconstpointer a, gconstpointer b)
#define CRMD_ACTION_CANCEL
#define crm_info(fmt, args...)
pe_action_t * find_first_action(GList *input, const char *uuid, const char *task, pe_node_t *on_node)
#define XML_TAG_OP_VER_ATTRS
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)
void pe_free_action(pe_action_t *action)
#define XML_AGENT_ATTR_CLASS
pe_action_t * custom_action(pe_resource_t *rsc, char *key, const char *task, pe_node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)
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)