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);
54 }
else if(node == NULL) {
71 CRM_CHECK(this_node != NULL,
return NULL);
73 new_node = calloc(1,
sizeof(
node_t));
90 GHashTable *result = hash;
97 g_hash_table_iter_init(&iter, hash);
98 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
101 if (other_node == NULL) {
103 }
else if (merge_scores) {
108 for (; gIter != NULL; gIter = gIter->next) {
111 other_node = pe_hash_table_lookup(result, node->
details->
id);
113 if (other_node == NULL) {
117 g_hash_table_insert(result, (gpointer) new_node->
details->
id, new_node);
128 for (; gIter != NULL; gIter = gIter->next) {
132 g_hash_table_insert(result, (gpointer) n->details->id, n);
144 for (; gIter != NULL; gIter = gIter->next) {
148 if (filter && this_node->
weight < 0) {
156 if (new_node != NULL) {
157 result = g_list_prepend(result, new_node);
175 resource_t * rsc,
const char *comment, GHashTable * nodes)
177 GHashTable *hash = nodes;
192 int len =
sizeof(score);
195 GListPtr list = g_hash_table_get_values(hash);
200 for (; gIter != NULL; gIter = gIter->next) {
206 printf(
"%s: %s allocation score on %s: %s\n",
209 printf(
"%s: %s = %s\n", comment, node->
details->
uname, score);
217 int len =
sizeof(score);
218 g_hash_table_iter_init(&iter, hash);
219 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
225 "%s: %s allocation score on %s: %s", comment, rsc->
id,
238 for (; gIter != NULL; gIter = gIter->next) {
247 append_dump_text(gpointer key, gpointer value, gpointer user_data)
249 char **dump_text = user_data;
251 char *new_text = NULL;
253 len = strlen(*dump_text) + strlen(
" ") + strlen(key) + strlen(
"=") + strlen(value) + 1;
254 new_text = calloc(1, len);
255 sprintf(new_text,
"%s %s=%s", *dump_text, (
char *)key, (
char *)value);
258 *dump_text = new_text;
265 char *dump_text = NULL;
267 len = strlen(comment) + strlen(
": ") + strlen(node->
details->
uname) + strlen(
" capacity:") + 1;
268 dump_text = calloc(1, len);
269 sprintf(dump_text,
"%s: %s capacity:", comment, node->
details->
uname);
274 fprintf(stdout,
"%s\n", dump_text);
286 char *dump_text = NULL;
288 len = strlen(comment) + strlen(
": ") + strlen(rsc->
id) + strlen(
" utilization on ")
290 dump_text = calloc(1, len);
291 sprintf(dump_text,
"%s: %s utilization on %s:", comment, rsc->
id, node->
details->
uname);
293 g_hash_table_foreach(rsc->
utilization, append_dump_text, &dump_text);
296 fprintf(stdout,
"%s\n", dump_text);
310 if (a == NULL && b == NULL) {
337 if (a == NULL && b == NULL) {
360 node_t * on_node, gboolean optional, gboolean save_action,
367 CRM_CHECK(task != NULL, free(key);
return NULL);
369 if (save_action && rsc != NULL) {
371 }
else if(save_action) {
373 action = g_hash_table_lookup(data_set->
singletons, key);
384 if (possible_matches != NULL) {
385 if (g_list_length(possible_matches) > 1) {
386 pe_warn(
"Action %s for %s on %s exists %d times",
387 task, rsc ? rsc->
id :
"<NULL>",
388 on_node ? on_node->
details->
uname :
"<NULL>", g_list_length(possible_matches));
391 action = g_list_nth_data(possible_matches, 0);
392 pe_rsc_trace(rsc,
"Found existing action (%d) %s for %s on %s",
393 action->
id, task, rsc ? rsc->
id :
"<NULL>",
395 g_list_free(possible_matches);
398 if (action == NULL) {
400 pe_rsc_trace(rsc,
"Creating%s action %d: %s for %s on %s %d",
401 optional ?
"" :
" manditory", data_set->
action_id, key,
402 rsc ? rsc->
id :
"<NULL>", on_node ? on_node->
details->
uname :
"<NULL>", optional);
405 action = calloc(1,
sizeof(
action_t));
413 action->
task = strdup(task);
417 action->
uuid = strdup(key);
441 action->
meta = g_hash_table_new_full(
crm_str_hash, g_str_equal, free, free);
451 action->
op_entry = find_rsc_op_entry_helper(rsc, key, TRUE);
465 if (optional == FALSE) {
475 warn_level = LOG_WARNING;
483 action->
extra, NULL, FALSE, data_set->
now);
489 }
else if (action->
node == NULL) {
502 do_crm_log(warn_level,
"Action %s on %s is unrunnable (offline)",
505 && save_action && a_task ==
stop_rsc) {
511 do_crm_log(warn_level,
"Action %s on %s is unrunnable (pending)",
524 action->runnable = TRUE;
567 unpack_operation_on_fail(
action_t * action)
577 xmlNode *operation = NULL;
578 const char *name = NULL;
579 const char *role = NULL;
580 const char *on_fail = NULL;
581 const char *interval = NULL;
582 const char *enabled = NULL;
586 for (operation = __xml_first_child(action->
rsc->
ops_xml);
587 operation && !value; operation = __xml_next_element(operation)) {
589 if (!
crm_str_eq((
const char *)operation->name,
"op", TRUE)) {
615 find_min_interval_mon(
resource_t * rsc, gboolean include_disabled)
618 int min_interval = -1;
619 const char *name = NULL;
620 const char *value = NULL;
621 const char *interval = NULL;
623 xmlNode *operation = NULL;
625 for (operation = __xml_first_child(rsc->
ops_xml); operation != NULL;
626 operation = __xml_next_element(operation)) {
628 if (
crm_str_eq((
const char *)operation->name,
"op", TRUE)) {
632 if (!include_disabled && value &&
crm_is_true(value) == FALSE) {
645 if (min_interval < 0 || number < min_interval) {
646 min_interval = number;
660 unsigned long long interval = 0;
661 unsigned long long start_delay = 0;
662 char *value_ms = NULL;
663 const char *value = NULL;
664 const char *field = NULL;
669 action->
meta, NULL, FALSE, data_set->
now);
672 xmlAttrPtr xIter = NULL;
674 for (xIter = xml_obj->properties; xIter; xIter = xIter->next) {
675 const char *prop_name = (
const char *)xIter->name;
678 g_hash_table_replace(action->
meta, strdup(prop_name), strdup(prop_value));
683 NULL, action->
meta, NULL, FALSE, data_set->
now);
686 NULL, action->
meta, NULL, FALSE, data_set->
now);
687 g_hash_table_remove(action->
meta,
"id");
690 value = g_hash_table_lookup(action->
meta, field);
695 g_hash_table_replace(action->
meta, strdup(field), value_ms);
698 g_hash_table_remove(action->
meta, field);
703 value = g_hash_table_lookup(action->
meta,
"requires");
708 value =
"nothing (not start/promote)";
720 crm_notice(
"%s requires (un)fencing but fencing is disabled", action->
rsc->
id);
727 crm_notice(
"%s requires fencing but fencing is disabled", action->
rsc->
id);
733 value =
"fencing (resource)";
737 value =
"quorum (resource)";
741 value =
"nothing (resource)";
746 value = unpack_operation_on_fail(action);
756 value =
"node fencing";
759 crm_config_err(
"Specifying on_fail=fence and" " stonith-enabled=false makes no sense");
762 value =
"stop resource";
767 value =
"node standby";
776 value =
"force migration";
781 value =
"stop resource";
785 value =
"restart (and possibly migrate)";
787 }
else if (
safe_str_eq(value,
"restart-container")) {
790 value =
"restart container (and possibly migrate)";
797 pe_err(
"Resource %s: Unknown failure type (%s)", action->
rsc->
id, value);
802 if (value == NULL && container) {
804 value =
"restart container (and possibly migrate) (default)";
815 }
else if (value == NULL &&
816 is_rsc_baremetal_remote_node(action->
rsc, data_set) &&
821 value =
"fence baremetal remote node (default)";
823 value =
"recover baremetal remote node connection (default)";
833 value =
"resource fence (default)";
837 value =
"resource block (default)";
840 }
else if (value == NULL) {
842 value =
"restart (and possibly migrate) (default)";
848 if (xml_obj != NULL) {
849 value = g_hash_table_lookup(action->
meta,
"role_after_failure");
866 value = g_hash_table_lookup(action->
meta, field);
872 start_delay = value_i;
874 g_hash_table_replace(action->
meta, strdup(field), value_ms);
882 if (origin == NULL) {
889 long long delay_s = 0;
890 int interval_s = (interval / 1000);
892 crm_trace(
"Origin: %s, interval: %d", value, interval_s);
919 start_delay = delay_s * 1000;
921 crm_info(
"Calculated a start delay of %llds for %s", delay_s,
ID(xml_obj));
930 value = g_hash_table_lookup(action->
meta, field);
932 xmlNode *min_interval_mon = find_min_interval_mon(action->
rsc, FALSE);
934 if (min_interval_mon) {
937 "\t%s uses the timeout value '%s' from the minimum interval monitor",
938 action->
uuid, value);
948 value_i += start_delay;
950 g_hash_table_replace(action->
meta, strdup(field), value_ms);
954 find_rsc_op_entry_helper(
resource_t * rsc,
const char *key, gboolean include_disabled)
956 unsigned long long number = 0;
957 gboolean do_retry = TRUE;
958 char *local_key = NULL;
959 const char *name = NULL;
960 const char *value = NULL;
961 const char *interval = NULL;
962 char *match_key = NULL;
964 xmlNode *operation = NULL;
967 for (operation = __xml_first_child(rsc->
ops_xml); operation != NULL;
968 operation = __xml_next_element(operation)) {
969 if (
crm_str_eq((
const char *)operation->name,
"op", TRUE)) {
973 if (!include_disabled && value &&
crm_is_true(value) == FALSE) {
1000 if (do_retry == FALSE) {
1010 }
else if (strstr(key,
"_notify_")) {
1022 return find_rsc_op_entry_helper(rsc, key, FALSE);
1029 crm_trace(
"%s%s: <NULL>", pre_text == NULL ?
"" : pre_text, pre_text == NULL ?
"" :
": ");
1034 crm_trace(
"%s%s%sNode %s: (weight=%d, fixed=%s)",
1035 pre_text == NULL ?
"" : pre_text,
1036 pre_text == NULL ?
"" :
": ",
1041 char *pe_mutable = strdup(
"\t\t");
1050 for (; gIter != NULL; gIter = gIter->next) {
1065 user_data == NULL ?
"" : (
char *)user_data,
1066 user_data == NULL ?
"" :
": ", (
char *)key, (
char *)value);
1076 pre_text == NULL ?
"" : pre_text, pre_text == NULL ?
"" :
": ");
1082 rsc->
fns->
print(rsc, pre_text, options, &log_level);
1088 if (action == NULL) {
1093 if (action->
extra) {
1094 g_hash_table_destroy(action->
extra);
1097 g_hash_table_destroy(action->
meta);
1109 const char *value = NULL;
1115 for (; gIter != NULL; gIter = gIter->next) {
1119 if (value == NULL) {
1125 }
else if (not_on_node == NULL) {
1127 result = g_list_prepend(result, action);
1129 }
else if (action->
node == NULL) {
1133 result = g_list_prepend(result, action);
1154 crm_trace(
"Folding %s back into its atomic counterpart for %s", name, rsc->
id);
1171 for (gIter = input; gIter != NULL; gIter = gIter->next) {
1180 }
else if (on_node == NULL) {
1183 }
else if (action->
node == NULL) {
1202 for (; gIter != NULL; gIter = gIter->next) {
1209 }
else if (on_node == NULL) {
1210 result = g_list_prepend(result, action);
1212 }
else if (action->
node == NULL) {
1214 crm_trace(
"While looking for %s action on %s, "
1215 "found an unallocated one. Assigning"
1216 " it to the requested node...", key, on_node->
details->
uname);
1219 result = g_list_prepend(result, action);
1222 result = g_list_prepend(result, action);
1237 for (; gIter != NULL; gIter = gIter->next) {
1245 }
else if (on_node == NULL || action->
node == NULL) {
1246 crm_trace(
"on_node=%p, action->node=%p", on_node, action->
node);
1250 result = g_list_prepend(result, action);
1259 resource_node_score(
resource_t * rsc,
node_t * node,
int score,
const char *tag)
1266 for (; gIter != NULL; gIter = gIter->next) {
1269 resource_node_score(child_rsc, node, score, tag);
1275 if (match == NULL) {
1288 resource_node_score(rsc, node, score, tag);
1290 }
else if (data_set != NULL) {
1293 for (; gIter != NULL; gIter = gIter->next) {
1296 resource_node_score(rsc, node, score, tag);
1304 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
1305 resource_node_score(rsc, node, score, tag);
1309 if (node == NULL && score == -
INFINITY) {
1318 #define sort_return(an_int, why) do { \
1321 crm_trace("%s (%d) %c %s (%d) : %s", \
1322 a_xml_id, a_call_id, an_int>0?'>':an_int<0?'<':'=', \
1323 b_xml_id, b_call_id, why); \
1333 char *a_uuid = NULL;
1334 char *b_uuid = NULL;
1336 const xmlNode *xml_a = a;
1337 const xmlNode *xml_b = b;
1348 pe_err(
"Duplicate lrm_rsc_op entries named %s", a_xml_id);
1355 if (a_call_id == -1 && b_call_id == -1) {
1361 }
else if (a_call_id >= 0 && a_call_id < b_call_id) {
1364 }
else if (b_call_id >= 0 && a_call_id > b_call_id) {
1367 }
else if (b_call_id >= 0 && a_call_id == b_call_id) {
1378 crm_trace(
"rc-change: %d vs %d", last_a, last_b);
1379 if (last_a >= 0 && last_a < last_b) {
1382 }
else if (last_b >= 0 && last_a > last_b) {
1422 if (b_call_id == -1) {
1425 }
else if (a_call_id == -1) {
1429 }
else if ((a_id >= 0 && a_id < b_id) || b_id == -1) {
1432 }
else if ((b_id >= 0 && a_id > b_id) || a_id == -1) {
1446 if (data_set->
now == NULL) {
1457 struct fail_search {
1467 get_failcount_by_prefix(gpointer key_p, gpointer value, gpointer user_data)
1469 struct fail_search *search = user_data;
1470 const char *attr_id = key_p;
1471 const char *match = strstr(attr_id, search->key);
1474 if (match == NULL) {
1485 if (parent == NULL || parent != search->rsc) {
1488 if (strstr(attr_id,
"last-failure-") == attr_id) {
1491 }
else if (strstr(attr_id,
"fail-count-") == attr_id) {
1503 is_matched_failure(
const char * rsc_id, xmlNode * conf_op_xml, xmlNode * lrm_op_xml)
1505 gboolean matched = FALSE;
1506 const char *conf_op_name = NULL;
1507 int conf_op_interval = 0;
1508 const char *lrm_op_task = NULL;
1509 int lrm_op_interval = 0;
1510 const char *lrm_op_id = NULL;
1511 char *last_failure_key = NULL;
1513 if (rsc_id == NULL || conf_op_xml == NULL || lrm_op_xml == NULL) {
1522 if (
safe_str_eq(conf_op_name, lrm_op_task) == FALSE
1523 || conf_op_interval != lrm_op_interval) {
1527 lrm_op_id =
ID(lrm_op_xml);
1534 char *expected_op_key =
generate_op_key(rsc_id, conf_op_name, conf_op_interval);
1541 if (rc != target_rc) {
1545 free(expected_op_key);
1548 free(last_failure_key);
1556 char *xpath =
crm_strdup_printf(
"//primitive[@id='%s']//op[@on-fail='block']", xml_name);
1558 gboolean should_block = FALSE;
1563 int max = numXpathResults(xpathObj);
1566 for (lpc = 0; lpc < max; lpc++) {
1570 should_block = is_matched_failure(xml_name, pref, xml_op);
1576 const char *conf_op_name = NULL;
1577 int conf_op_interval = 0;
1578 char *lrm_op_xpath = NULL;
1579 xmlXPathObject *lrm_op_xpathObj = NULL;
1585 "//lrm_resource[@id='%s']"
1586 "/lrm_rsc_op[@operation='%s'][@interval='%d']",
1588 conf_op_name, conf_op_interval);
1593 if (lrm_op_xpathObj) {
1594 int max2 = numXpathResults(lrm_op_xpathObj);
1597 for (lpc2 = 0; lpc2 < max2; lpc2++) {
1600 should_block = is_matched_failure(xml_name, pref, lrm_op_xml);
1618 return should_block;
1626 const char *value = NULL;
1627 struct fail_search search = { rsc, data_set, 0, 0, NULL };
1631 value = g_hash_table_lookup(node->
details->
attrs, key);
1638 value = g_hash_table_lookup(node->
details->
attrs, key);
1649 g_hash_table_foreach(node->
details->
attrs, get_failcount_by_prefix, &search);
1654 if (search.count != 0 && search.last != 0 && last_failure) {
1655 *last_failure = search.last;
1660 if (block_failure(node, rsc, xml_op, data_set)) {
1661 pe_warn(
"Setting %s.failure-timeout=%d conflicts with on-fail=block: ignoring timeout", rsc->
id, rsc->
failure_timeout);
1672 if (effective && search.count != 0 && search.last != 0 && rsc->
failure_timeout) {
1673 if (search.last > 0) {
1677 crm_debug(
"Failcount for %s on %s has expired (limit was %ds)",
1684 if (search.count != 0) {
1691 return search.count;
1698 int failcount_all = 0;
1700 failcount_all =
get_failcount(node, rsc, last_failure, data_set);
1705 for (gIter = rsc->
fillers; gIter != NULL; gIter = gIter->next) {
1707 time_t filler_last_failure = 0;
1709 failcount_all +=
get_failcount(node, filler, &filler_last_failure, data_set);
1711 if (last_failure && filler_last_failure > *last_failure) {
1712 *last_failure = filler_last_failure;
1716 if (failcount_all != 0) {
1719 crm_info(
"Container %s and the resources within it have failed %s times on %s",
1725 return failcount_all;
1736 if (value == NULL ||
safe_str_eq(
"started", value)
1754 crm_config_err(
"%s is not part of a master/slave resource, a %s of '%s' makes no sense",
1775 if (lh_action == NULL || rh_action == NULL) {
1786 for (; gIter != NULL; gIter = gIter->next) {
1789 if (after->
action == rh_action && (after->
type & order)) {
1795 wrapper->
action = rh_action;
1796 wrapper->
type = order;
1799 list = g_list_prepend(list, wrapper);
1808 wrapper->
action = lh_action;
1809 wrapper->
type = order;
1811 list = g_list_prepend(list, wrapper);
1822 op = g_hash_table_lookup(data_set->
singletons, name);
1825 op =
custom_action(NULL, strdup(name), name, NULL, TRUE, TRUE, data_set);
1838 if (ticket->
state) {
1839 g_hash_table_destroy(ticket->
state);
1850 if (ticket_id == NULL || strlen(ticket_id) == 0) {
1854 if (data_set->
tickets == NULL) {
1859 ticket = g_hash_table_lookup(data_set->
tickets, ticket_id);
1860 if (ticket == NULL) {
1862 ticket = calloc(1,
sizeof(
ticket_t));
1863 if (ticket == NULL) {
1864 crm_err(
"Cannot allocate ticket '%s'", ticket_id);
1868 crm_trace(
"Creaing ticket entry for %s", ticket_id);
1870 ticket->
id = strdup(ticket_id);
1877 g_hash_table_insert(data_set->
tickets, strdup(ticket->
id), ticket);
1884 filter_parameters(xmlNode * param_set,
const char *param_string,
bool need_present)
1890 if (param_set == NULL) {
1895 xmlAttrPtr xIter = param_set->properties;
1898 const char *prop_name = (
const char *)xIter->name;
1900 xIter = xIter->next;
1902 len = strlen(prop_name) + 3;
1906 sprintf(name,
" %s ", prop_name);
1908 match = strstr(param_string, name);
1911 if (need_present && match == NULL) {
1912 crm_trace(
"%s not found in %s", prop_name, param_string);
1915 }
else if (need_present == FALSE && match) {
1916 crm_trace(
"%s found in %s", prop_name, param_string);
1930 GHashTable *local_rsc_params = NULL;
1936 const char *op_id =
ID(xml_op);
1939 const char *digest_all;
1940 const char *digest_restart;
1941 const char *secure_list;
1942 const char *restart_list;
1943 const char *op_version;
1963 action =
custom_action(rsc, key, task, node, TRUE, FALSE, data_set);
1966 local_rsc_params = g_hash_table_new_full(
crm_str_hash, g_str_equal,
1987 if (digest_restart) {
2000 }
else if (digest_all == NULL) {
2009 g_hash_table_destroy(local_rsc_params);
2018 return ID(rsc->
xml);
2078 for (gIter = rsc->
fillers; gIter != NULL; gIter = gIter->next) {
2108 for (; gIter != NULL; gIter = gIter->next) {
2121 for (; gIter != NULL; gIter = gIter->next) {
2141 stonith_op = g_hash_table_lookup(data_set->
singletons, key);
2144 if(stonith_op == NULL) {
2154 if(optional == FALSE) {
2189 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
2198 add_tag_ref(GHashTable * tags,
const char * tag_name,
const char * obj_ref)
2202 gboolean is_existing = FALSE;
2204 CRM_CHECK(tags && tag_name && obj_ref,
return FALSE);
2206 tag = g_hash_table_lookup(tags, tag_name);
2208 tag = calloc(1,
sizeof(
tag_t));
2212 tag->
id = strdup(tag_name);
2214 g_hash_table_insert(tags, strdup(tag_name), tag);
2217 for (gIter = tag->
refs; gIter != NULL; gIter = gIter->next) {
2218 const char *existing_ref = (
const char *) gIter->data;
2220 if (
crm_str_eq(existing_ref, obj_ref, TRUE)){
2226 if (is_existing == FALSE) {
2227 tag->
refs = g_list_append(tag->
refs, strdup(obj_ref));
2228 crm_trace(
"Added: tag=%s ref=%s", tag->
id, obj_ref);
#define XML_OP_ATTR_ORIGIN
gboolean xml_contains_remote_node(xmlNode *xml)
#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)
#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
char * crm_concat(const char *prefix, const char *suffix, char join)
void node_list_exclude(GHashTable *hash, GListPtr list, gboolean merge_scores)
struct crm_time_s crm_time_t
#define pe_flag_have_remote_nodes
gboolean is_container_remote_node(node_t *node)
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
void g_hash_destroy_str(gpointer data)
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
node_t * node_copy(node_t *this_node)
#define XML_LRM_ATTR_INTERVAL
gboolean safe_str_neq(const char *a, const char *b)
#define XML_LRM_ATTR_OP_DIGEST
#define CRMD_ACTION_PROMOTE
#define XML_LRM_ATTR_OP_RESTART
void get_rsc_attributes(GHashTable *meta_hash, resource_t *rsc, node_t *node, pe_working_set_t *data_set)
node_t * pe_find_node(GListPtr node_list, const char *uname)
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)
gboolean is_remote_node(node_t *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
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
#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
resource_t * rsc_contains_remote_node(pe_working_set_t *data_set, resource_t *rsc)
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)
#define XML_AGENT_ATTR_PROVIDER
gboolean is_baremetal_remote_node(node_t *node)
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)
long long crm_int_helper(const char *text, char **end_text)
char * crm_itoa(int an_int)
gboolean crm_is_true(const char *s)
#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)
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)
GListPtr find_actions(GListPtr input, const char *key, node_t *on_node)
#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)
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 *)
int crm_parse_int(const char *text, const char *default_text)
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)
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...)
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...)
gboolean crm_str_eq(const char *a, const char *b, gboolean use_case)
char * digest_restart_calc
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)