31 extern xmlNode *
get_object_root(
const char *object_type, xmlNode * the_root);
32 void print_str_str(gpointer key, gpointer value, gpointer user_data);
36 static xmlNode *find_rsc_op_entry_helper(
resource_t * rsc,
const char *key,
37 gboolean include_disabled);
53 }
else if(node == NULL) {
70 CRM_CHECK(this_node != NULL,
return NULL);
72 new_node = calloc(1,
sizeof(
node_t));
89 GHashTable *result = hash;
96 g_hash_table_iter_init(&iter, hash);
97 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
100 if (other_node == NULL) {
102 }
else if (merge_scores) {
107 for (; gIter != NULL; gIter = gIter->next) {
110 other_node = pe_hash_table_lookup(result, node->
details->
id);
112 if (other_node == NULL) {
116 g_hash_table_insert(result, (gpointer) new_node->
details->
id, new_node);
127 for (; gIter != NULL; gIter = gIter->next) {
131 g_hash_table_insert(result, (gpointer) n->details->id, n);
143 for (; gIter != NULL; gIter = gIter->next) {
147 if (filter && this_node->
weight < 0) {
155 if (new_node != NULL) {
156 result = g_list_prepend(result, new_node);
174 resource_t * rsc,
const char *comment, GHashTable * nodes)
176 GHashTable *hash = nodes;
191 int len =
sizeof(score);
194 GListPtr list = g_hash_table_get_values(hash);
199 for (; gIter != NULL; gIter = gIter->next) {
205 printf(
"%s: %s allocation score on %s: %s\n",
208 printf(
"%s: %s = %s\n", comment, node->
details->
uname, score);
216 int len =
sizeof(score);
217 g_hash_table_iter_init(&iter, hash);
218 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
224 "%s: %s allocation score on %s: %s", comment, rsc->
id,
237 for (; gIter != NULL; gIter = gIter->next) {
246 append_dump_text(gpointer key, gpointer value, gpointer user_data)
248 char **dump_text = user_data;
250 char *new_text = NULL;
252 len = strlen(*dump_text) + strlen(
" ") + strlen(key) + strlen(
"=") + strlen(value) + 1;
253 new_text = calloc(1, len);
254 sprintf(new_text,
"%s %s=%s", *dump_text, (
char *)key, (
char *)value);
257 *dump_text = new_text;
264 char *dump_text = NULL;
266 len = strlen(comment) + strlen(
": ") + strlen(node->
details->
uname) + strlen(
" capacity:") + 1;
267 dump_text = calloc(1, len);
268 sprintf(dump_text,
"%s: %s capacity:", comment, node->
details->
uname);
273 fprintf(stdout,
"%s\n", dump_text);
285 char *dump_text = NULL;
287 len = strlen(comment) + strlen(
": ") + strlen(rsc->
id) + strlen(
" utilization on ")
289 dump_text = calloc(1, len);
290 sprintf(dump_text,
"%s: %s utilization on %s:", comment, rsc->
id, node->
details->
uname);
292 g_hash_table_foreach(rsc->
utilization, append_dump_text, &dump_text);
295 fprintf(stdout,
"%s\n", dump_text);
309 if (a == NULL && b == NULL) {
336 if (a == NULL && b == NULL) {
359 node_t * on_node, gboolean optional, gboolean save_action,
366 CRM_CHECK(task != NULL, free(key);
return NULL);
368 if (save_action && rsc != NULL) {
370 }
else if(save_action) {
372 action = g_hash_table_lookup(data_set->
singletons, key);
383 if (possible_matches != NULL) {
384 if (g_list_length(possible_matches) > 1) {
385 pe_warn(
"Action %s for %s on %s exists %d times",
386 task, rsc ? rsc->
id :
"<NULL>",
387 on_node ? on_node->
details->
uname :
"<NULL>", g_list_length(possible_matches));
390 action = g_list_nth_data(possible_matches, 0);
391 pe_rsc_trace(rsc,
"Found existing action (%d) %s for %s on %s",
392 action->
id, task, rsc ? rsc->
id :
"<NULL>",
394 g_list_free(possible_matches);
397 if (action == NULL) {
399 pe_rsc_trace(rsc,
"Creating%s action %d: %s for %s on %s %d",
400 optional ?
"" :
" mandatory", data_set->
action_id, key,
401 rsc ? rsc->
id :
"<NULL>", on_node ? on_node->
details->
uname :
"<NULL>", optional);
404 action = calloc(1,
sizeof(
action_t));
412 action->
task = strdup(task);
416 action->
uuid = strdup(key);
440 action->
meta = g_hash_table_new_full(
crm_str_hash, g_str_equal, free, free);
450 action->
op_entry = find_rsc_op_entry_helper(rsc, key, TRUE);
464 if (optional == FALSE) {
474 warn_level = LOG_WARNING;
482 action->
extra, NULL, FALSE, data_set->
now);
488 }
else if (action->
node == NULL) {
501 do_crm_log(warn_level,
"Action %s on %s is unrunnable (offline)",
504 && save_action && a_task ==
stop_rsc) {
510 do_crm_log(warn_level,
"Action %s on %s is unrunnable (pending)",
523 action->runnable = TRUE;
566 unpack_operation_on_fail(
action_t * action)
576 xmlNode *operation = NULL;
577 const char *name = NULL;
578 const char *role = NULL;
579 const char *on_fail = NULL;
580 const char *interval = NULL;
581 const char *enabled = NULL;
585 for (operation = __xml_first_child(action->
rsc->
ops_xml);
586 operation && !value; operation = __xml_next_element(operation)) {
588 if (!
crm_str_eq((
const char *)operation->name,
"op", TRUE)) {
614 find_min_interval_mon(
resource_t * rsc, gboolean include_disabled)
617 int min_interval = -1;
618 const char *name = NULL;
619 const char *value = NULL;
620 const char *interval = NULL;
622 xmlNode *operation = NULL;
624 for (operation = __xml_first_child(rsc->
ops_xml); operation != NULL;
625 operation = __xml_next_element(operation)) {
627 if (
crm_str_eq((
const char *)operation->name,
"op", TRUE)) {
631 if (!include_disabled && value &&
crm_is_true(value) == FALSE) {
644 if (min_interval < 0 || number < min_interval) {
645 min_interval = number;
659 unsigned long long interval = 0;
660 unsigned long long start_delay = 0;
661 char *value_ms = NULL;
662 const char *value = NULL;
663 const char *field = NULL;
668 action->
meta, NULL, FALSE, data_set->
now);
671 xmlAttrPtr xIter = NULL;
673 for (xIter = xml_obj->properties; xIter; xIter = xIter->next) {
674 const char *prop_name = (
const char *)xIter->name;
677 g_hash_table_replace(action->
meta, strdup(prop_name), strdup(prop_value));
682 NULL, action->
meta, NULL, FALSE, data_set->
now);
685 NULL, action->
meta, NULL, FALSE, data_set->
now);
686 g_hash_table_remove(action->
meta,
"id");
689 value = g_hash_table_lookup(action->
meta, field);
694 g_hash_table_replace(action->
meta, strdup(field), value_ms);
697 g_hash_table_remove(action->
meta, field);
702 value = g_hash_table_lookup(action->
meta,
"requires");
707 value =
"nothing (not start/promote)";
719 crm_notice(
"%s requires unfencing but fencing is disabled", action->
rsc->
id);
726 crm_notice(
"%s requires fencing but fencing is disabled", action->
rsc->
id);
732 value =
"fencing (resource)";
736 value =
"quorum (resource)";
740 value =
"nothing (resource)";
745 value = unpack_operation_on_fail(action);
755 value =
"node fencing";
758 crm_config_err(
"Specifying on_fail=fence and" " stonith-enabled=false makes no sense");
761 value =
"stop resource";
766 value =
"node standby";
775 value =
"force migration";
780 value =
"stop resource";
784 value =
"restart (and possibly migrate)";
786 }
else if (
safe_str_eq(value,
"restart-container")) {
789 value =
"restart container (and possibly migrate)";
796 pe_err(
"Resource %s: Unknown failure type (%s)", action->
rsc->
id, value);
801 if (value == NULL && container) {
803 value =
"restart container (and possibly migrate) (default)";
814 }
else if (value == NULL &&
820 value =
"fence baremetal remote node (default)";
822 value =
"recover baremetal remote node connection (default)";
832 value =
"resource fence (default)";
836 value =
"resource block (default)";
839 }
else if (value == NULL) {
841 value =
"restart (and possibly migrate) (default)";
847 if (xml_obj != NULL) {
848 value = g_hash_table_lookup(action->
meta,
"role_after_failure");
865 value = g_hash_table_lookup(action->
meta, field);
871 start_delay = value_i;
873 g_hash_table_replace(action->
meta, strdup(field), value_ms);
881 if (origin == NULL) {
888 long long delay_s = 0;
889 int interval_s = (interval / 1000);
891 crm_trace(
"Origin: %s, interval: %d", value, interval_s);
918 start_delay = delay_s * 1000;
920 crm_info(
"Calculated a start delay of %llds for %s", delay_s,
ID(xml_obj));
929 value = g_hash_table_lookup(action->
meta, field);
931 xmlNode *min_interval_mon = find_min_interval_mon(action->
rsc, FALSE);
933 if (min_interval_mon) {
936 "\t%s uses the timeout value '%s' from the minimum interval monitor",
937 action->
uuid, value);
948 g_hash_table_replace(action->
meta, strdup(field), value_ms);
952 find_rsc_op_entry_helper(
resource_t * rsc,
const char *key, gboolean include_disabled)
954 unsigned long long number = 0;
955 gboolean do_retry = TRUE;
956 char *local_key = NULL;
957 const char *name = NULL;
958 const char *value = NULL;
959 const char *interval = NULL;
960 char *match_key = NULL;
962 xmlNode *operation = NULL;
965 for (operation = __xml_first_child(rsc->
ops_xml); operation != NULL;
966 operation = __xml_next_element(operation)) {
967 if (
crm_str_eq((
const char *)operation->name,
"op", TRUE)) {
971 if (!include_disabled && value &&
crm_is_true(value) == FALSE) {
998 if (do_retry == FALSE) {
1008 }
else if (strstr(key,
"_notify_")) {
1020 return find_rsc_op_entry_helper(rsc, key, FALSE);
1027 crm_trace(
"%s%s: <NULL>", pre_text == NULL ?
"" : pre_text, pre_text == NULL ?
"" :
": ");
1032 crm_trace(
"%s%s%sNode %s: (weight=%d, fixed=%s)",
1033 pre_text == NULL ?
"" : pre_text,
1034 pre_text == NULL ?
"" :
": ",
1039 char *pe_mutable = strdup(
"\t\t");
1048 for (; gIter != NULL; gIter = gIter->next) {
1063 user_data == NULL ?
"" : (
char *)user_data,
1064 user_data == NULL ?
"" :
": ", (
char *)key, (
char *)value);
1074 pre_text == NULL ?
"" : pre_text, pre_text == NULL ?
"" :
": ");
1080 rsc->
fns->
print(rsc, pre_text, options, &log_level);
1086 if (action == NULL) {
1091 if (action->
extra) {
1092 g_hash_table_destroy(action->
extra);
1095 g_hash_table_destroy(action->
meta);
1107 const char *value = NULL;
1113 for (; gIter != NULL; gIter = gIter->next) {
1117 if (value == NULL) {
1123 }
else if (not_on_node == NULL) {
1125 result = g_list_prepend(result, action);
1127 }
else if (action->
node == NULL) {
1131 result = g_list_prepend(result, action);
1152 crm_trace(
"Folding %s back into its atomic counterpart for %s", name, rsc->
id);
1169 for (gIter = input; gIter != NULL; gIter = gIter->next) {
1178 }
else if (on_node == NULL) {
1181 }
else if (action->
node == NULL) {
1200 for (; gIter != NULL; gIter = gIter->next) {
1204 crm_trace(
"%s does not match action %s", key, action->
uuid);
1207 }
else if (on_node == NULL) {
1208 crm_trace(
"Action %s matches (ignoring node)", key);
1209 result = g_list_prepend(result, action);
1211 }
else if (action->
node == NULL) {
1212 crm_trace(
"Action %s matches (unallocated, assigning to %s)",
1216 result = g_list_prepend(result, action);
1220 result = g_list_prepend(result, action);
1223 crm_trace(
"Action %s on node %s does not match requested node %s",
1240 for (; gIter != NULL; gIter = gIter->next) {
1248 }
else if (on_node == NULL || action->
node == NULL) {
1249 crm_trace(
"on_node=%p, action->node=%p", on_node, action->
node);
1253 result = g_list_prepend(result, action);
1262 resource_node_score(
resource_t * rsc,
node_t * node,
int score,
const char *tag)
1269 for (; gIter != NULL; gIter = gIter->next) {
1272 resource_node_score(child_rsc, node, score, tag);
1278 if (match == NULL) {
1291 resource_node_score(rsc, node, score, tag);
1293 }
else if (data_set != NULL) {
1296 for (; gIter != NULL; gIter = gIter->next) {
1299 resource_node_score(rsc, node_iter, score, tag);
1304 node_t *node_iter = NULL;
1307 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node_iter)) {
1308 resource_node_score(rsc, node_iter, score, tag);
1312 if (node == NULL && score == -
INFINITY) {
1321 #define sort_return(an_int, why) do { \
1324 crm_trace("%s (%d) %c %s (%d) : %s", \
1325 a_xml_id, a_call_id, an_int>0?'>':an_int<0?'<':'=', \
1326 b_xml_id, b_call_id, why); \
1336 char *a_uuid = NULL;
1337 char *b_uuid = NULL;
1339 const xmlNode *xml_a = a;
1340 const xmlNode *xml_b = b;
1351 pe_err(
"Duplicate lrm_rsc_op entries named %s", a_xml_id);
1358 if (a_call_id == -1 && b_call_id == -1) {
1364 }
else if (a_call_id >= 0 && a_call_id < b_call_id) {
1367 }
else if (b_call_id >= 0 && a_call_id > b_call_id) {
1370 }
else if (b_call_id >= 0 && a_call_id == b_call_id) {
1381 crm_trace(
"rc-change: %d vs %d", last_a, last_b);
1382 if (last_a >= 0 && last_a < last_b) {
1385 }
else if (last_b >= 0 && last_a > last_b) {
1425 if (b_call_id == -1) {
1428 }
else if (a_call_id == -1) {
1432 }
else if ((a_id >= 0 && a_id < b_id) || b_id == -1) {
1435 }
else if ((b_id >= 0 && a_id > b_id) || a_id == -1) {
1449 if (data_set->
now == NULL) {
1460 struct fail_search {
1470 get_failcount_by_prefix(gpointer key_p, gpointer value, gpointer user_data)
1472 struct fail_search *search = user_data;
1473 const char *attr_id = key_p;
1474 const char *match = strstr(attr_id, search->key);
1477 if (match == NULL) {
1488 if (parent == NULL || parent != search->rsc) {
1491 if (strstr(attr_id,
"last-failure-") == attr_id) {
1494 }
else if (strstr(attr_id,
"fail-count-") == attr_id) {
1506 is_matched_failure(
const char * rsc_id, xmlNode * conf_op_xml, xmlNode * lrm_op_xml)
1508 gboolean matched = FALSE;
1509 const char *conf_op_name = NULL;
1510 int conf_op_interval = 0;
1511 const char *lrm_op_task = NULL;
1512 int lrm_op_interval = 0;
1513 const char *lrm_op_id = NULL;
1514 char *last_failure_key = NULL;
1516 if (rsc_id == NULL || conf_op_xml == NULL || lrm_op_xml == NULL) {
1525 if (
safe_str_eq(conf_op_name, lrm_op_task) == FALSE
1526 || conf_op_interval != lrm_op_interval) {
1530 lrm_op_id =
ID(lrm_op_xml);
1537 char *expected_op_key =
generate_op_key(rsc_id, conf_op_name, conf_op_interval);
1544 if (rc != target_rc) {
1548 free(expected_op_key);
1551 free(last_failure_key);
1559 char *xpath =
crm_strdup_printf(
"//primitive[@id='%s']//op[@on-fail='block']", xml_name);
1561 gboolean should_block = FALSE;
1566 int max = numXpathResults(xpathObj);
1569 for (lpc = 0; lpc < max; lpc++) {
1573 should_block = is_matched_failure(xml_name, pref, xml_op);
1579 const char *conf_op_name = NULL;
1580 int conf_op_interval = 0;
1581 char *lrm_op_xpath = NULL;
1582 xmlXPathObject *lrm_op_xpathObj = NULL;
1588 "//lrm_resource[@id='%s']"
1589 "/lrm_rsc_op[@operation='%s'][@interval='%d']",
1591 conf_op_name, conf_op_interval);
1596 if (lrm_op_xpathObj) {
1597 int max2 = numXpathResults(lrm_op_xpathObj);
1600 for (lpc2 = 0; lpc2 < max2; lpc2++) {
1603 should_block = is_matched_failure(xml_name, pref, lrm_op_xml);
1621 return should_block;
1629 const char *value = NULL;
1630 struct fail_search search = { rsc, data_set, 0, 0, NULL };
1634 value = g_hash_table_lookup(node->
details->
attrs, key);
1641 value = g_hash_table_lookup(node->
details->
attrs, key);
1652 g_hash_table_foreach(node->
details->
attrs, get_failcount_by_prefix, &search);
1657 if (search.count != 0 && search.last != 0 && last_failure) {
1658 *last_failure = search.last;
1663 if (block_failure(node, rsc, xml_op, data_set)) {
1664 pe_warn(
"Setting %s.failure-timeout=%d conflicts with on-fail=block: ignoring timeout", rsc->
id, rsc->
failure_timeout);
1675 if (effective && search.count != 0 && search.last != 0 && rsc->
failure_timeout) {
1676 if (search.last > 0) {
1680 crm_debug(
"Failcount for %s on %s has expired (limit was %ds)",
1687 if (search.count != 0) {
1694 return search.count;
1701 int failcount_all = 0;
1703 failcount_all =
get_failcount(node, rsc, last_failure, data_set);
1708 for (gIter = rsc->
fillers; gIter != NULL; gIter = gIter->next) {
1710 time_t filler_last_failure = 0;
1712 failcount_all +=
get_failcount(node, filler, &filler_last_failure, data_set);
1714 if (last_failure && filler_last_failure > *last_failure) {
1715 *last_failure = filler_last_failure;
1719 if (failcount_all != 0) {
1722 crm_info(
"Container %s and the resources within it have failed %s times on %s",
1728 return failcount_all;
1739 if (value == NULL ||
safe_str_eq(
"started", value)
1757 crm_config_err(
"%s is not part of a master/slave resource, a %s of '%s' makes no sense",
1778 if (lh_action == NULL || rh_action == NULL) {
1789 for (; gIter != NULL; gIter = gIter->next) {
1792 if (after->
action == rh_action && (after->
type & order)) {
1798 wrapper->
action = rh_action;
1799 wrapper->
type = order;
1802 list = g_list_prepend(list, wrapper);
1811 wrapper->
action = lh_action;
1812 wrapper->
type = order;
1814 list = g_list_prepend(list, wrapper);
1825 op = g_hash_table_lookup(data_set->
singletons, name);
1828 op =
custom_action(NULL, strdup(name), name, NULL, TRUE, TRUE, data_set);
1841 if (ticket->
state) {
1842 g_hash_table_destroy(ticket->
state);
1853 if (ticket_id == NULL || strlen(ticket_id) == 0) {
1857 if (data_set->
tickets == NULL) {
1862 ticket = g_hash_table_lookup(data_set->
tickets, ticket_id);
1863 if (ticket == NULL) {
1865 ticket = calloc(1,
sizeof(
ticket_t));
1866 if (ticket == NULL) {
1867 crm_err(
"Cannot allocate ticket '%s'", ticket_id);
1871 crm_trace(
"Creaing ticket entry for %s", ticket_id);
1873 ticket->
id = strdup(ticket_id);
1880 g_hash_table_insert(data_set->
tickets, strdup(ticket->
id), ticket);
1887 filter_parameters(xmlNode * param_set,
const char *param_string,
bool need_present)
1893 if (param_set == NULL) {
1898 xmlAttrPtr xIter = param_set->properties;
1901 const char *prop_name = (
const char *)xIter->name;
1903 xIter = xIter->next;
1905 len = strlen(prop_name) + 3;
1909 sprintf(name,
" %s ", prop_name);
1911 match = strstr(param_string, name);
1914 if (need_present && match == NULL) {
1915 crm_trace(
"%s not found in %s", prop_name, param_string);
1918 }
else if (need_present == FALSE && match) {
1919 crm_trace(
"%s found in %s", prop_name, param_string);
1933 GHashTable *local_rsc_params = NULL;
1939 const char *op_id =
ID(xml_op);
1942 const char *digest_all;
1943 const char *digest_restart;
1944 const char *secure_list;
1945 const char *restart_list;
1946 const char *op_version;
1966 action =
custom_action(rsc, key, task, node, TRUE, FALSE, data_set);
1969 local_rsc_params = g_hash_table_new_full(
crm_str_hash, g_str_equal,
1990 if (digest_restart) {
2003 }
else if (digest_all == NULL) {
2012 g_hash_table_destroy(local_rsc_params);
2021 return ID(rsc->
xml);
2032 for (; gIter != NULL; gIter = gIter->next) {
2045 for (; gIter != NULL; gIter = gIter->next) {
2065 stonith_op = g_hash_table_lookup(data_set->
singletons, key);
2068 if(stonith_op == NULL) {
2078 if(optional == FALSE) {
2113 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
2122 add_tag_ref(GHashTable * tags,
const char * tag_name,
const char * obj_ref)
2126 gboolean is_existing = FALSE;
2128 CRM_CHECK(tags && tag_name && obj_ref,
return FALSE);
2130 tag = g_hash_table_lookup(tags, tag_name);
2132 tag = calloc(1,
sizeof(
tag_t));
2136 tag->
id = strdup(tag_name);
2138 g_hash_table_insert(tags, strdup(tag_name), tag);
2141 for (gIter = tag->
refs; gIter != NULL; gIter = gIter->next) {
2142 const char *existing_ref = (
const char *) gIter->data;
2144 if (
crm_str_eq(existing_ref, obj_ref, TRUE)){
2150 if (is_existing == FALSE) {
2151 tag->
refs = g_list_append(tag->
refs, strdup(obj_ref));
2152 crm_trace(
"Added: tag=%s ref=%s", tag->
id, obj_ref);
#define XML_OP_ATTR_ORIGIN
#define CRM_CHECK(expr, failure_action)
#define XML_RSC_OP_LAST_CHANGE
enum rsc_start_requirement needs
long long crm_get_msec(const char *input)
action_t * custom_action(resource_t *rsc, char *key, const char *task, node_t *on_node, gboolean optional, gboolean save_action, pe_working_set_t *data_set)
void destroy_ticket(gpointer data)
#define crm_notice(fmt, args...)
#define CRMD_ACTION_MIGRATED
enum action_tasks get_complex_task(resource_t *rsc, const char *name, gboolean allow_non_atomic)
#define pe_rsc_debug(rsc, fmt, args...)
#define pe_flag_have_stonith_resource
void crm_time_add_seconds(crm_time_t *dt, int value)
gboolean safe_str_neq(const char *a, const char *b)
#define pe_rsc_needs_unfencing
time_t get_effective_time(pe_working_set_t *data_set)
#define XML_ATTR_TRANSITION_MAGIC
GHashTable * node_hash_from_list(GListPtr list)
int crm_element_value_const_int(const xmlNode *data, const char *name, int *dest)
#define crm_time_log_timeofday
#define pe_flag_enable_unfencing
pe_working_set_t * pe_dataset
void node_list_exclude(GHashTable *hash, GListPtr list, gboolean merge_scores)
struct crm_time_s crm_time_t
bool pe_can_fence(pe_working_set_t *data_set, node_t *node)
#define crm_config_err(fmt...)
#define pe_rsc_needs_quorum
enum action_fail_response on_fail
long long crm_int_helper(const char *text, char **end_text)
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
xmlNode * find_rsc_op_entry(resource_t *rsc, const char *key)
enum pe_obj_types variant
#define XML_LRM_ATTR_INTERVAL
#define XML_LRM_ATTR_OP_DIGEST
#define CRMD_ACTION_PROMOTE
#define XML_LRM_ATTR_OP_RESTART
int crm_parse_int(const char *text, const char *default_text)
void get_rsc_attributes(GHashTable *meta_hash, resource_t *rsc, node_t *node, pe_working_set_t *data_set)
int get_failcount(node_t *node, resource_t *rsc, time_t *last_failure, pe_working_set_t *data_set)
enum action_tasks text2task(const char *task)
no_quorum_policy_t no_quorum_policy
GListPtr find_actions_exact(GListPtr input, const char *key, node_t *on_node)
const char * pe_pref(GHashTable *options, const char *name)
void dump_node_capacity(int level, const char *comment, node_t *node)
action_t * find_first_action(GListPtr input, const char *uuid, const char *task, node_t *on_node)
#define do_crm_log_alias(level, file, function, line, fmt, args...)
Log a message as if it came from a different code location.
resource_t * uber_parent(resource_t *rsc)
#define clear_bit(word, bit)
void resource_location(resource_t *rsc, node_t *node, int score, const char *tag, pe_working_set_t *data_set)
int get_target_rc(xmlNode *xml_op)
#define XML_OP_ATTR_ON_FAIL
node_t * node_copy(const node_t *this_node)
gboolean get_target_role(resource_t *rsc, enum rsc_role_e *role)
void print_resource(int log_level, const char *pre_text, resource_t *rsc, gboolean details)
#define crm_time_log_duration
gboolean order_actions(action_t *lh_action, action_t *rh_action, enum pe_ordering order)
#define XML_LRM_ATTR_OP_SECURE
gboolean is_rsc_baremetal_remote_node(resource_t *rsc, pe_working_set_t *data_set)
#define CRMD_ACTION_START
xmlNode * copy_xml(xmlNode *src_node)
int get_failcount_all(node_t *node, resource_t *rsc, time_t *last_failure, pe_working_set_t *data_set)
gboolean ghash_free_str_str(gpointer key, gpointer value, gpointer user_data)
#define XML_TAG_ATTR_SETS
#define XML_LRM_ATTR_TASK
const char * role2text(enum rsc_role_e role)
void hash2field(gpointer key, gpointer value, gpointer user_data)
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
gboolean(* active)(resource_t *, gboolean)
struct node_shared_s * details
char * calculate_operation_digest(xmlNode *local_cib, const char *version)
Calculate and return digest of XML operation.
#define CRMD_ACTION_DEMOTE
#define set_bit(word, bit)
#define crm_debug(fmt, args...)
GListPtr find_recurring_actions(GListPtr input, node_t *not_on_node)
char * clone_strip(const char *last_rsc_id)
crm_time_t * crm_time_calculate_duration(crm_time_t *dt, crm_time_t *value)
ticket_t * ticket_new(const char *ticket_id, pe_working_set_t *data_set)
char * score2char(int score)
resource_object_functions_t * fns
#define sort_return(an_int, why)
void pe_free_action(action_t *action)
GHashTable * allowed_nodes
unsigned long long crm_get_interval(const char *input)
GHashTable * digest_cache
#define crm_trace(fmt, args...)
#define do_crm_log(level, fmt, args...)
Log a message.
enum rsc_digest_cmp_val rc
void set_bit_recursive(resource_t *rsc, unsigned long long flag)
char * digest_secure_calc
void dump_rsc_utilization(int level, const char *comment, resource_t *rsc, node_t *node)
gint sort_node_uname(gconstpointer a, gconstpointer b)
const char * stonith_action
const char * crm_element_value_const(const xmlNode *data, const char *name)
int get_failcount_full(node_t *node, resource_t *rsc, time_t *last_failure, bool effective, xmlNode *xml_op, pe_working_set_t *data_set)
void pe_fence_node(pe_working_set_t *data_set, node_t *node, const char *reason)
#define XML_TAG_META_SETS
Wrappers for and extensions to libxml2.
xmlNode * create_xml_node(xmlNode *parent, const char *name)
long long int crm_time_get_seconds_since_epoch(crm_time_t *dt)
int crm_element_value_int(xmlNode *data, const char *name, int *dest)
const char * crm_element_value(xmlNode *data, const char *name)
#define crm_time_log(level, prefix, dt, flags)
xmlNode * get_object_root(const char *object_type, xmlNode *the_root)
#define XML_RSC_ATTR_TARGET_ROLE
#define XML_LRM_ATTR_RESTART_DIGEST
void unpack_operation(action_t *action, xmlNode *xml_obj, resource_t *container, pe_working_set_t *data_set)
#define crm_time_log_with_timezone
enum rsc_role_e text2role(const char *role)
gboolean crm_str_eq(const char *a, const char *b, gboolean use_case)
void filter_action_parameters(xmlNode *param_set, const char *version)
int remote_reconnect_interval
gboolean decode_transition_magic(const char *magic, char **uuid, int *transition_id, int *action_id, int *op_status, int *op_rc, int *target_rc)
#define XML_LRM_ATTR_TARGET_UUID
long long int crm_time_get_seconds(crm_time_t *dt)
void hash2metafield(gpointer key, gpointer value, gpointer user_data)
void dump_node_scores_worker(int level, const char *file, const char *function, int line, resource_t *rsc, const char *comment, GHashTable *nodes)
gint sort_rsc_index(gconstpointer a, gconstpointer b)
void trigger_unfencing(resource_t *rsc, node_t *node, const char *reason, action_t *dependency, pe_working_set_t *data_set)
const char * rsc_printable_id(resource_t *rsc)
void add_hash_param(GHashTable *hash, const char *name, const char *value)
#define pe_set_action_bit(action, bit)
GListPtr find_actions(GListPtr input, const char *key, const node_t *on_node)
int char2score(const char *score)
#define crm_err(fmt, args...)
xmlXPathObjectPtr xpath_search(xmlNode *xml_top, const char *path)
void(* print)(resource_t *, const char *, long, void *)
crm_time_t * crm_time_new(const char *string)
#define pe_clear_action_bit(action, bit)
op_digest_cache_t * rsc_action_digest_cmp(resource_t *rsc, xmlNode *xml_op, node_t *node, pe_working_set_t *data_set)
enum rsc_role_e next_role
void xml_remove_prop(xmlNode *obj, const char *name)
xmlNode * getXpathResult(xmlXPathObjectPtr xpathObj, int index)
void print_str_str(gpointer key, gpointer value, gpointer user_data)
int merge_weights(int w1, int w2)
#define XML_LRM_ATTR_CALLID
#define CRMD_ACTION_MIGRATE
enum rsc_role_e fail_role
#define XML_ATTR_CRM_VERSION
int crm_time_compare(crm_time_t *dt, crm_time_t *rhs)
char * generate_op_key(const char *rsc_id, const char *op_type, int interval)
node_t * pe_find_node_id(GListPtr node_list, const char *id)
enum pe_action_flags flags
#define XML_OP_ATTR_START_DELAY
#define pe_flag_have_quorum
void unpack_instance_attributes(xmlNode *top, xmlNode *xml_obj, const char *set_name, GHashTable *node_hash, GHashTable *hash, const char *always_first, gboolean overwrite, crm_time_t *now)
action_t * get_pseudo_op(const char *name, pe_working_set_t *data_set)
gboolean crm_is_true(const char *s)
action_t * pe_fence_op(node_t *node, const char *op, bool optional, pe_working_set_t *data_set)
#define XML_LRM_ATTR_TARGET
#define pe_rsc_trace(rsc, fmt, args...)
char * crm_concat(const char *prefix, const char *suffix, char join)
char * crm_itoa(int an_int)
resource_t * pe_find_resource(GListPtr rsc_list, const char *id_rh)
#define pe_rsc_needs_fencing
#define safe_str_eq(a, b)
char * crm_strdup_printf(char const *format,...) __attribute__((__format__(__printf__
gint sort_rsc_priority(gconstpointer a, gconstpointer b)
void freeXpathObject(xmlXPathObjectPtr xpathObj)
void print_node(const char *pre_text, node_t *node, gboolean details)
#define pe_flag_sanitized
#define pe_rsc_fence_device
#define CRMD_ACTION_CANCEL
#define crm_info(fmt, args...)
char * digest_restart_calc
void g_hash_destroy_str(gpointer data)
GListPtr node_list_dup(GListPtr list1, gboolean reset, gboolean filter)
char * score2char_stack(int score, char *buf, size_t len)
#define crm_time_log_date
#define pe_flag_stonith_enabled
void clear_bit_recursive(resource_t *rsc, unsigned long long flag)
#define CRMD_ACTION_STATUS
void crm_time_free(crm_time_t *dt)