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);
66 }
else if(node == NULL) {
83 CRM_CHECK(this_node != NULL,
return NULL);
85 new_node = calloc(1,
sizeof(
node_t));
102 GHashTable *result = hash;
103 node_t *other_node = NULL;
109 g_hash_table_iter_init(&iter, hash);
110 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
113 if (other_node == NULL) {
115 }
else if (merge_scores) {
120 for (; gIter != NULL; gIter = gIter->next) {
123 other_node = pe_hash_table_lookup(result, node->
details->
id);
125 if (other_node == NULL) {
129 g_hash_table_insert(result, (gpointer) new_node->
details->
id, new_node);
140 for (; gIter != NULL; gIter = gIter->next) {
144 g_hash_table_insert(result, (gpointer) n->details->id, n);
156 for (; gIter != NULL; gIter = gIter->next) {
160 if (filter && this_node->
weight < 0) {
168 if (new_node != NULL) {
169 result = g_list_prepend(result, new_node);
187 resource_t * rsc,
const char *comment, GHashTable * nodes)
189 GHashTable *hash = nodes;
204 int len =
sizeof(score);
207 GListPtr list = g_hash_table_get_values(hash);
212 for (; gIter != NULL; gIter = gIter->next) {
218 printf(
"%s: %s allocation score on %s: %s\n",
221 printf(
"%s: %s = %s\n", comment, node->
details->
uname, score);
229 int len =
sizeof(score);
230 g_hash_table_iter_init(&iter, hash);
231 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
237 "%s: %s allocation score on %s: %s", comment, rsc->
id,
250 for (; gIter != NULL; gIter = gIter->next) {
259 append_dump_text(gpointer key, gpointer value, gpointer user_data)
261 char **dump_text = user_data;
263 char *new_text = NULL;
265 len = strlen(*dump_text) + strlen(
" ") + strlen(key) + strlen(
"=") + strlen(value) + 1;
266 new_text = calloc(1, len);
267 sprintf(new_text,
"%s %s=%s", *dump_text, (
char *)key, (
char *)value);
270 *dump_text = new_text;
277 char *dump_text = NULL;
279 len = strlen(comment) + strlen(
": ") + strlen(node->
details->
uname) + strlen(
" capacity:") + 1;
280 dump_text = calloc(1, len);
281 sprintf(dump_text,
"%s: %s capacity:", comment, node->
details->
uname);
286 fprintf(stdout,
"%s\n", dump_text);
298 char *dump_text = NULL;
300 len = strlen(comment) + strlen(
": ") + strlen(rsc->
id) + strlen(
" utilization on ")
302 dump_text = calloc(1, len);
303 sprintf(dump_text,
"%s: %s utilization on %s:", comment, rsc->
id, node->
details->
uname);
305 g_hash_table_foreach(rsc->
utilization, append_dump_text, &dump_text);
308 fprintf(stdout,
"%s\n", dump_text);
322 if (a == NULL && b == NULL) {
349 if (a == NULL && b == NULL) {
372 node_t * on_node, gboolean optional, gboolean save_action,
379 CRM_CHECK(task != NULL, free(key);
return NULL);
381 if (save_action && rsc != NULL) {
383 }
else if(save_action) {
385 action = g_hash_table_lookup(data_set->
singletons, key);
396 if (possible_matches != NULL) {
397 if (g_list_length(possible_matches) > 1) {
398 pe_warn(
"Action %s for %s on %s exists %d times",
399 task, rsc ? rsc->
id :
"<NULL>",
400 on_node ? on_node->
details->
uname :
"<NULL>", g_list_length(possible_matches));
403 action = g_list_nth_data(possible_matches, 0);
404 pe_rsc_trace(rsc,
"Found existing action (%d) %s for %s on %s",
405 action->
id, task, rsc ? rsc->
id :
"<NULL>",
407 g_list_free(possible_matches);
410 if (action == NULL) {
412 pe_rsc_trace(rsc,
"Creating%s action %d: %s for %s on %s %d",
413 optional ?
"" :
" mandatory", data_set->
action_id, key,
414 rsc ? rsc->
id :
"<NULL>", on_node ? on_node->
details->
uname :
"<NULL>", optional);
417 action = calloc(1,
sizeof(
action_t));
425 action->
task = strdup(task);
429 action->
uuid = strdup(key);
453 action->
meta = g_hash_table_new_full(
crm_str_hash, g_str_equal, free, free);
463 action->
op_entry = find_rsc_op_entry_helper(rsc, key, TRUE);
477 if (optional == FALSE) {
487 warn_level = LOG_WARNING;
495 action->
extra, NULL, FALSE, data_set->
now);
501 }
else if (action->
node == NULL) {
515 do_crm_log(warn_level,
"Action %s on %s is unrunnable (offline)",
518 && save_action && a_task ==
stop_rsc 525 do_crm_log(warn_level,
"Action %s on %s is unrunnable (pending)",
538 action->runnable = TRUE;
581 unpack_operation_on_fail(
action_t * action)
591 xmlNode *operation = NULL;
592 const char *name = NULL;
593 const char *role = NULL;
594 const char *on_fail = NULL;
595 const char *interval = NULL;
596 const char *enabled = NULL;
600 for (operation = __xml_first_child(action->
rsc->
ops_xml);
601 operation && !value; operation = __xml_next_element(operation)) {
603 if (!
crm_str_eq((
const char *)operation->name,
"op", TRUE)) {
629 find_min_interval_mon(
resource_t * rsc, gboolean include_disabled)
632 int min_interval = -1;
633 const char *name = NULL;
634 const char *value = NULL;
635 const char *interval = NULL;
637 xmlNode *operation = NULL;
639 for (operation = __xml_first_child(rsc->
ops_xml); operation != NULL;
640 operation = __xml_next_element(operation)) {
642 if (
crm_str_eq((
const char *)operation->name,
"op", TRUE)) {
646 if (!include_disabled && value &&
crm_is_true(value) == FALSE) {
659 if (min_interval < 0 || number < min_interval) {
660 min_interval = number;
674 unsigned long long interval = 0;
675 unsigned long long start_delay = 0;
676 char *value_ms = NULL;
677 const char *value = NULL;
678 const char *field = NULL;
683 action->
meta, NULL, FALSE, data_set->
now);
686 xmlAttrPtr xIter = NULL;
688 for (xIter = xml_obj->properties; xIter; xIter = xIter->next) {
689 const char *prop_name = (
const char *)xIter->name;
692 g_hash_table_replace(action->
meta, strdup(prop_name), strdup(prop_value));
697 NULL, action->
meta, NULL, FALSE, data_set->
now);
700 NULL, action->
meta, NULL, FALSE, data_set->
now);
701 g_hash_table_remove(action->
meta,
"id");
704 value = g_hash_table_lookup(action->
meta, field);
709 g_hash_table_replace(action->
meta, strdup(field), value_ms);
712 g_hash_table_remove(action->
meta, field);
717 value = g_hash_table_lookup(action->
meta,
"requires");
722 value =
"nothing (not start/promote)";
734 crm_notice(
"%s requires unfencing but fencing is disabled", action->
rsc->
id);
741 crm_notice(
"%s requires fencing but fencing is disabled", action->
rsc->
id);
747 value =
"fencing (resource)";
751 value =
"quorum (resource)";
755 value =
"nothing (resource)";
760 value = unpack_operation_on_fail(action);
770 value =
"node fencing";
773 crm_config_err(
"Specifying on_fail=fence and" " stonith-enabled=false makes no sense");
776 value =
"stop resource";
781 value =
"node standby";
790 value =
"force migration";
795 value =
"stop resource";
799 value =
"restart (and possibly migrate)";
801 }
else if (
safe_str_eq(value,
"restart-container")) {
804 value =
"restart container (and possibly migrate)";
811 pe_err(
"Resource %s: Unknown failure type (%s)", action->
rsc->
id, value);
816 if (value == NULL && container) {
818 value =
"restart container (and possibly migrate) (default)";
837 value =
"stop unmanaged baremetal remote node (enforcing default)";
841 value =
"fence baremetal remote node (default)";
843 value =
"recover baremetal remote node connection (default)";
855 value =
"resource fence (default)";
859 value =
"resource block (default)";
862 }
else if (value == NULL) {
864 value =
"restart (and possibly migrate) (default)";
870 if (xml_obj != NULL) {
871 value = g_hash_table_lookup(action->
meta,
"role_after_failure");
888 value = g_hash_table_lookup(action->
meta, field);
894 start_delay = value_i;
896 g_hash_table_replace(action->
meta, strdup(field), value_ms);
904 if (origin == NULL) {
911 long long delay_s = 0;
912 int interval_s = (interval / 1000);
914 crm_trace(
"Origin: %s, interval: %d", value, interval_s);
941 start_delay = delay_s * 1000;
943 crm_info(
"Calculated a start delay of %llds for %s", delay_s,
ID(xml_obj));
952 value = g_hash_table_lookup(action->
meta, field);
954 xmlNode *min_interval_mon = find_min_interval_mon(action->
rsc, FALSE);
956 if (min_interval_mon) {
959 "\t%s uses the timeout value '%s' from the minimum interval monitor",
960 action->
uuid, value);
971 g_hash_table_replace(action->
meta, strdup(field), value_ms);
975 find_rsc_op_entry_helper(
resource_t * rsc,
const char *key, gboolean include_disabled)
977 unsigned long long number = 0;
978 gboolean do_retry = TRUE;
979 char *local_key = NULL;
980 const char *name = NULL;
981 const char *value = NULL;
982 const char *interval = NULL;
983 char *match_key = NULL;
985 xmlNode *operation = NULL;
988 for (operation = __xml_first_child(rsc->
ops_xml); operation != NULL;
989 operation = __xml_next_element(operation)) {
990 if (
crm_str_eq((
const char *)operation->name,
"op", TRUE)) {
994 if (!include_disabled && value &&
crm_is_true(value) == FALSE) {
1021 if (do_retry == FALSE) {
1031 }
else if (strstr(key,
"_notify_")) {
1043 return find_rsc_op_entry_helper(rsc, key, FALSE);
1050 crm_trace(
"%s%s: <NULL>", pre_text == NULL ?
"" : pre_text, pre_text == NULL ?
"" :
": ");
1055 crm_trace(
"%s%s%sNode %s: (weight=%d, fixed=%s)",
1056 pre_text == NULL ?
"" : pre_text,
1057 pre_text == NULL ?
"" :
": ",
1062 char *pe_mutable = strdup(
"\t\t");
1071 for (; gIter != NULL; gIter = gIter->next) {
1086 user_data == NULL ?
"" : (
char *)user_data,
1087 user_data == NULL ?
"" :
": ", (
char *)key, (
char *)value);
1097 pre_text == NULL ?
"" : pre_text, pre_text == NULL ?
"" :
": ");
1103 rsc->
fns->
print(rsc, pre_text, options, &log_level);
1109 if (action == NULL) {
1114 if (action->
extra) {
1115 g_hash_table_destroy(action->
extra);
1118 g_hash_table_destroy(action->
meta);
1130 const char *value = NULL;
1136 for (; gIter != NULL; gIter = gIter->next) {
1140 if (value == NULL) {
1146 }
else if (not_on_node == NULL) {
1148 result = g_list_prepend(result, action);
1150 }
else if (action->
node == NULL) {
1154 result = g_list_prepend(result, action);
1175 crm_trace(
"Folding %s back into its atomic counterpart for %s", name, rsc->
id);
1192 for (gIter = input; gIter != NULL; gIter = gIter->next) {
1201 }
else if (on_node == NULL) {
1204 }
else if (action->
node == NULL) {
1223 for (; gIter != NULL; gIter = gIter->next) {
1227 crm_trace(
"%s does not match action %s", key, action->
uuid);
1230 }
else if (on_node == NULL) {
1231 crm_trace(
"Action %s matches (ignoring node)", key);
1232 result = g_list_prepend(result, action);
1234 }
else if (action->
node == NULL) {
1235 crm_trace(
"Action %s matches (unallocated, assigning to %s)",
1239 result = g_list_prepend(result, action);
1243 result = g_list_prepend(result, action);
1246 crm_trace(
"Action %s on node %s does not match requested node %s",
1263 for (; gIter != NULL; gIter = gIter->next) {
1271 }
else if (on_node == NULL || action->
node == NULL) {
1272 crm_trace(
"on_node=%p, action->node=%p", on_node, action->
node);
1276 result = g_list_prepend(result, action);
1285 resource_node_score(
resource_t * rsc,
node_t * node,
int score,
const char *tag)
1292 for (; gIter != NULL; gIter = gIter->next) {
1295 resource_node_score(child_rsc, node, score, tag);
1301 if (match == NULL) {
1313 resource_node_score(rsc, node, score, tag);
1315 }
else if (data_set != NULL) {
1318 for (; gIter != NULL; gIter = gIter->next) {
1321 resource_node_score(rsc, node_iter, score, tag);
1326 node_t *node_iter = NULL;
1329 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node_iter)) {
1330 resource_node_score(rsc, node_iter, score, tag);
1334 if (node == NULL && score == -
INFINITY) {
1343 #define sort_return(an_int, why) do { \ 1346 crm_trace("%s (%d) %c %s (%d) : %s", \ 1347 a_xml_id, a_call_id, an_int>0?'>':an_int<0?'<':'=', \ 1348 b_xml_id, b_call_id, why); \ 1358 char *a_uuid = NULL;
1359 char *b_uuid = NULL;
1361 const xmlNode *xml_a = a;
1362 const xmlNode *xml_b = b;
1373 pe_err(
"Duplicate lrm_rsc_op entries named %s", a_xml_id);
1380 if (a_call_id == -1 && b_call_id == -1) {
1386 }
else if (a_call_id >= 0 && a_call_id < b_call_id) {
1389 }
else if (b_call_id >= 0 && a_call_id > b_call_id) {
1392 }
else if (b_call_id >= 0 && a_call_id == b_call_id) {
1403 crm_trace(
"rc-change: %d vs %d", last_a, last_b);
1404 if (last_a >= 0 && last_a < last_b) {
1407 }
else if (last_b >= 0 && last_a > last_b) {
1447 if (b_call_id == -1) {
1450 }
else if (a_call_id == -1) {
1454 }
else if ((a_id >= 0 && a_id < b_id) || b_id == -1) {
1457 }
else if ((b_id >= 0 && a_id > b_id) || a_id == -1) {
1471 if (data_set->
now == NULL) {
1490 if (value == NULL ||
safe_str_eq(
"started", value)
1508 crm_config_err(
"%s is not part of a master/slave resource, a %s of '%s' makes no sense",
1529 if (lh_action == NULL || rh_action == NULL) {
1540 for (; gIter != NULL; gIter = gIter->next) {
1543 if (after->
action == rh_action && (after->
type & order)) {
1549 wrapper->
action = rh_action;
1550 wrapper->
type = order;
1553 list = g_list_prepend(list, wrapper);
1562 wrapper->
action = lh_action;
1563 wrapper->
type = order;
1565 list = g_list_prepend(list, wrapper);
1576 op = g_hash_table_lookup(data_set->
singletons, name);
1579 op =
custom_action(NULL, strdup(name), name, NULL, TRUE, TRUE, data_set);
1592 if (ticket->
state) {
1593 g_hash_table_destroy(ticket->
state);
1604 if (ticket_id == NULL || strlen(ticket_id) == 0) {
1608 if (data_set->
tickets == NULL) {
1613 ticket = g_hash_table_lookup(data_set->
tickets, ticket_id);
1614 if (ticket == NULL) {
1616 ticket = calloc(1,
sizeof(
ticket_t));
1617 if (ticket == NULL) {
1618 crm_err(
"Cannot allocate ticket '%s'", ticket_id);
1622 crm_trace(
"Creaing ticket entry for %s", ticket_id);
1624 ticket->
id = strdup(ticket_id);
1631 g_hash_table_insert(data_set->
tickets, strdup(ticket->
id), ticket);
1638 filter_parameters(xmlNode * param_set,
const char *param_string,
bool need_present)
1644 if (param_set == NULL) {
1649 xmlAttrPtr xIter = param_set->properties;
1652 const char *prop_name = (
const char *)xIter->name;
1654 xIter = xIter->next;
1656 len = strlen(prop_name) + 3;
1660 sprintf(name,
" %s ", prop_name);
1662 match = strstr(param_string, name);
1665 if (need_present && match == NULL) {
1666 crm_trace(
"%s not found in %s", prop_name, param_string);
1669 }
else if (need_present == FALSE && match) {
1670 crm_trace(
"%s found in %s", prop_name, param_string);
1682 const char *attr_list[] = {
1687 const char *value_list[] = {
1698 value = g_hash_table_lookup(rsc->
parameters, name);
1703 for (
int lpc = 0; lpc <
DIMOF(attr_list); lpc++) {
1704 name = attr_list[lpc];
1706 if (
safe_str_eq(value, value_list[lpc]) == FALSE) {
1720 GHashTable *local_rsc_params = NULL;
1721 #ifdef ENABLE_VERSIONED_ATTRS 1722 xmlNode *local_versioned_params = NULL;
1729 const char *op_id =
ID(xml_op);
1732 const char *digest_all;
1733 const char *digest_restart;
1734 const char *secure_list;
1735 const char *restart_list;
1736 const char *op_version;
1759 action =
custom_action(rsc, key, task, node, TRUE, FALSE, data_set);
1762 local_rsc_params = g_hash_table_new_full(
crm_str_hash, g_str_equal,
1765 #ifdef ENABLE_VERSIONED_ATTRS 1767 pe_get_versioned_attributes(local_versioned_params, rsc, node, data_set);
1782 #ifdef ENABLE_VERSIONED_ATTRS 1783 crm_summarize_versioned_params(data->
params_all, rsc->versioned_parameters);
1784 crm_summarize_versioned_params(data->
params_all, local_versioned_params);
1798 if (digest_restart) {
1811 }
else if (digest_all == NULL) {
1820 g_hash_table_destroy(local_rsc_params);
1821 #ifdef ENABLE_VERSIONED_ATTRS 1832 return ID(rsc->
xml);
1843 for (; gIter != NULL; gIter = gIter->next) {
1856 for (; gIter != NULL; gIter = gIter->next) {
1876 stonith_op = g_hash_table_lookup(data_set->
singletons, key);
1879 if(stonith_op == NULL) {
1889 if(optional == FALSE) {
1924 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
1933 add_tag_ref(GHashTable * tags,
const char * tag_name,
const char * obj_ref)
1937 gboolean is_existing = FALSE;
1939 CRM_CHECK(tags && tag_name && obj_ref,
return FALSE);
1941 tag = g_hash_table_lookup(tags, tag_name);
1943 tag = calloc(1,
sizeof(
tag_t));
1947 tag->
id = strdup(tag_name);
1949 g_hash_table_insert(tags, strdup(tag_name), tag);
1952 for (gIter = tag->
refs; gIter != NULL; gIter = gIter->next) {
1953 const char *existing_ref = (
const char *) gIter->data;
1955 if (
crm_str_eq(existing_ref, obj_ref, TRUE)){
1961 if (is_existing == FALSE) {
1962 tag->
refs = g_list_append(tag->
refs, strdup(obj_ref));
1963 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
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)
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)
#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)
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)
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)
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)
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)
gboolean is_container_remote_node(node_t *node)
gint sort_node_uname(gconstpointer a, gconstpointer b)
bool fix_remote_addr(resource_t *rsc)
const char * stonith_action
const char * crm_element_value_const(const xmlNode *data, const char *name)
#define XML_AGENT_ATTR_PROVIDER
void pe_fence_node(pe_working_set_t *data_set, node_t *node, const char *reason)
Schedule a fence action for a node.
#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)
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)
void free_xml(xmlNode *child)
#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)
gboolean(* active)(resource_t *, gboolean)
void hash2metafield(gpointer key, gpointer value, gpointer user_data)
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
void dump_node_scores_worker(int level, const char *file, const char *function, int line, resource_t *rsc, const char *comment, GHashTable *nodes)
void(* print)(resource_t *, const char *, long, void *)
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)
#define crm_err(fmt, args...)
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)
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
gboolean remote_requires_reset
#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)
Generate an operation key.
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_itoa(int an_int)
#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 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 XML_AGENT_ATTR_CLASS
#define CRMD_ACTION_STATUS
void crm_time_free(crm_time_t *dt)