43 free(
data->digest_all_calc);
44 free(
data->digest_restart_calc);
45 free(
data->digest_secure_calc);
53 attr_not_in_string(xmlAttrPtr a,
void *user_data)
58 if (strstr((
const char *) user_data,
name) == NULL) {
59 crm_trace(
"Filtering %s (not found in '%s')",
60 (
const char *) a->name, (
const char *) user_data);
69 attr_in_string(xmlAttrPtr a,
void *user_data)
74 if (strstr((
const char *) user_data,
name) != NULL) {
76 (
const char *) a->name, (
const char *) user_data);
101 const char *task, guint *interval_ms,
102 xmlNode *xml_op,
const char *op_version,
116 if (overrides != NULL) {
117 const char *interval_s = g_hash_table_lookup(overrides,
CRM_META "_" 120 if (interval_s != NULL) {
124 && (value_ll >= 0) && (value_ll <= G_MAXUINT)) {
125 *interval_ms = (guint) value_ll;
132 if (overrides != NULL) {
150 if (*interval_ms == 0
151 && g_hash_table_size(
action->extra) > 0) {
163 is_fence_param(xmlAttrPtr attr,
void *user_data)
181 GHashTable *params, xmlNode *xml_op,
182 const char *op_version, GHashTable *overrides)
185 const char *secure_list = NULL;
188 if (xml_op == NULL) {
189 secure_list =
" passwd password user ";
196 if (overrides != NULL) {
207 if (secure_list != NULL) {
209 (
void *) secure_list);
251 const char *op_version)
253 const char *value = NULL;
256 if (xml_op == NULL) {
299 pe_node_t *node, xmlNode *xml_op, GHashTable *overrides,
303 const char *op_version = NULL;
304 GHashTable *params = NULL;
312 if (xml_op != NULL) {
320 if (op_version == NULL) {
325 calculate_main_digest(
data, rsc, node, params, task, interval_ms, xml_op,
328 calculate_secure_digest(
data, rsc, params, xml_op, op_version,
331 calculate_restart_digest(
data, xml_op, op_version);
350 rsc_action_digest(
pe_resource_t *rsc,
const char *task, guint interval_ms,
351 pe_node_t *node, xmlNode *xml_op,
bool calc_secure,
384 guint interval_ms = 0;
386 const char *op_version;
388 const char *digest_all;
389 const char *digest_restart;
398 data = rsc_action_digest(rsc, task, interval_ms, node, xml_op,
402 if (digest_restart &&
data->digest_restart_calc && strcmp(
data->digest_restart_calc, digest_restart) != 0) {
403 pe_rsc_info(rsc,
"Parameters to %ums-interval %s action for %s on %s " 404 "changed: hash was %s vs. now %s (restart:%s) %s",
405 interval_ms, task, rsc->
id, pe__node_name(node),
406 pcmk__s(digest_restart,
"missing"),
407 data->digest_restart_calc,
412 }
else if (digest_all == NULL) {
416 }
else if (strcmp(digest_all,
data->digest_all_calc) != 0) {
428 pe_rsc_info(rsc,
"Parameters containing extra ones to %ums-interval" 429 " %s action for %s on %s " 430 "changed: hash was %s vs. now %s (restart:%s) %s",
431 interval_ms, task, rsc->
id, pe__node_name(node),
432 pcmk__s(digest_all,
"missing"),
data->digest_all_calc,
437 pe_rsc_info(rsc,
"Parameters to %ums-interval %s action for %s on %s " 438 "changed: hash was %s vs. now %s (%s:%s) %s",
439 interval_ms, task, rsc->
id, pe__node_name(node),
440 pcmk__s(digest_all,
"missing"),
data->digest_all_calc,
441 (interval_ms > 0)?
"reschedule" :
"reload",
471 create_unfencing_summary(
const char *rsc_id,
const char *agent_type,
472 const char *param_digest)
494 unfencing_digest_matches(
const char *rsc_id,
const char *agent,
495 const char *digest_calc,
const char *node_summary)
497 bool matches = FALSE;
499 if (rsc_id && agent && digest_calc && node_summary) {
500 char *search_secure = create_unfencing_summary(rsc_id, agent,
506 matches = (strstr(node_summary, search_secure) != NULL);
507 crm_trace(
"Calculated unfencing digest '%s' %sfound in '%s'",
508 search_secure, matches?
"" :
"not ", node_summary);
518 #define STONITH_DIGEST_TASK "stonith-on" 535 const char *node_summary = NULL;
543 if (node_summary == NULL) {
549 if (unfencing_digest_matches(rsc->
id, agent,
data->digest_all_calc,
557 if (unfencing_digest_matches(rsc->
id, agent,
data->digest_secure_calc,
562 out->
info(out,
"Only 'private' parameters to %s " 563 "for unfencing %s changed", rsc->
id,
564 pe__node_name(node));
574 char *digest = create_unfencing_summary(rsc->
id, agent,
575 data->digest_secure_calc);
577 out->
info(out,
"Parameters to %s for unfencing " 578 "%s changed, try '%s'", rsc->
id,
579 pe__node_name(node), digest);
582 char *digest = create_unfencing_summary(rsc->
id, agent,
583 data->digest_secure_calc);
585 printf(
"Parameters to %s for unfencing %s changed, try '%s'\n",
586 rsc->
id, pe__node_name(node), digest);
void hash2field(gpointer key, gpointer value, gpointer user_data)
Set XML attribute based on hash table entry.
#define XML_ATTR_TRANSITION_MAGIC
op_digest_cache_t * rsc_action_digest_cmp(pe_resource_t *rsc, xmlNode *xml_op, pe_node_t *node, pe_working_set_t *data_set)
bool pcmk_stonith_param(const char *param)
Check whether a given stonith parameter is handled by Pacemaker.
#define XML_LRM_ATTR_INTERVAL
#define XML_LRM_ATTR_OP_DIGEST
#define XML_LRM_ATTR_OP_RESTART
#define CRM_ATTR_DIGESTS_ALL
void pcmk__filter_op_for_digest(xmlNode *param_set)
int(* info)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
#define XML_RSC_ATTR_REMOTE_RA_ADDR
#define XML_LRM_ATTR_OP_SECURE
xmlNode * copy_xml(xmlNode *src_node)
#define XML_LRM_ATTR_TASK
int pcmk__scan_ll(const char *text, long long *result, long long default_value)
char * calculate_operation_digest(xmlNode *local_cib, const char *version)
Calculate and return digest of XML operation.
int crm_element_value_ms(const xmlNode *data, const char *name, guint *dest)
Retrieve the millisecond value of an XML attribute.
#define pe_flag_sanitized
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
const char * pe_node_attribute_raw(const pe_node_t *node, const char *name)
void pcmk__xe_remove_matching_attrs(xmlNode *element, bool(*match)(xmlAttrPtr, void *), void *user_data)
#define crm_trace(fmt, args...)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
struct pe_node_shared_s * details
pe_working_set_t * data_set
Wrappers for and extensions to libxml2.
xmlNode * create_xml_node(xmlNode *parent, const char *name)
#define CRM_ATTR_DIGESTS_SECURE
#define XML_LRM_ATTR_RESTART_DIGEST
void free_xml(xmlNode *child)
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)
op_digest_cache_t * pe__calculate_digests(pe_resource_t *rsc, const char *task, guint *interval_ms, pe_node_t *node, xmlNode *xml_op, GHashTable *overrides, bool calc_secure, pe_working_set_t *data_set)
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
const char * pe__add_bundle_remote_name(pe_resource_t *rsc, pe_working_set_t *data_set, xmlNode *xml, const char *field)
#define STONITH_DIGEST_TASK
void xml_remove_prop(xmlNode *obj, const char *name)
This structure contains everything that makes up a single output formatter.
int compare_version(const char *version1, const char *version2)
GHashTable * pe_rsc_params(pe_resource_t *rsc, const pe_node_t *node, pe_working_set_t *data_set)
Get a table of resource parameters.
#define XML_LRM_ATTR_INTERVAL_MS
void hash2metafield(gpointer key, gpointer value, gpointer user_data)
Set XML attribute based on hash table entry, as meta-attribute name.
#define XML_ATTR_CRM_VERSION
GHashTable * digest_cache
cache of calculated resource digests
uint32_t pcmk_get_ra_caps(const char *standard)
Get capabilities of a resource agent standard.
void pe__free_digests(gpointer ptr)
pe_action_t * custom_action(pe_resource_t *rsc, char *key, const char *task, const pe_node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)
Create or update an action object.
void pe_free_action(pe_action_t *action)
#define pe_rsc_info(rsc, fmt, args...)
#define XML_AGENT_ATTR_CLASS