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);
100 const pe_node_t *node, GHashTable *params,
101 const char *task, guint *interval_ms,
102 const 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,
const 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 const pe_node_t *node,
const xmlNode *xml_op,
300 GHashTable *overrides,
bool calc_secure,
304 const char *op_version = NULL;
305 GHashTable *params = NULL;
313 if (xml_op != NULL) {
321 if (op_version == NULL) {
326 calculate_main_digest(
data, rsc, node, params, task, interval_ms, xml_op,
329 calculate_secure_digest(
data, rsc, params, xml_op, op_version,
332 calculate_restart_digest(
data, xml_op, op_version);
351 rsc_action_digest(
pe_resource_t *rsc,
const char *task, guint interval_ms,
385 guint interval_ms = 0;
387 const char *op_version;
389 const char *digest_all;
390 const char *digest_restart;
399 data = rsc_action_digest(rsc, task, interval_ms, node, xml_op,
403 if (digest_restart &&
data->digest_restart_calc && strcmp(
data->digest_restart_calc, digest_restart) != 0) {
404 pe_rsc_info(rsc,
"Parameters to %ums-interval %s action for %s on %s " 405 "changed: hash was %s vs. now %s (restart:%s) %s",
406 interval_ms, task, rsc->
id, pe__node_name(node),
407 pcmk__s(digest_restart,
"missing"),
408 data->digest_restart_calc,
413 }
else if (digest_all == NULL) {
417 }
else if (strcmp(digest_all,
data->digest_all_calc) != 0) {
429 pe_rsc_info(rsc,
"Parameters containing extra ones to %ums-interval" 430 " %s action for %s on %s " 431 "changed: hash was %s vs. now %s (restart:%s) %s",
432 interval_ms, task, rsc->
id, pe__node_name(node),
433 pcmk__s(digest_all,
"missing"),
data->digest_all_calc,
438 pe_rsc_info(rsc,
"Parameters to %ums-interval %s action for %s on %s " 439 "changed: hash was %s vs. now %s (%s:%s) %s",
440 interval_ms, task, rsc->
id, pe__node_name(node),
441 pcmk__s(digest_all,
"missing"),
data->digest_all_calc,
442 (interval_ms > 0)?
"reschedule" :
"reload",
472 create_unfencing_summary(
const char *rsc_id,
const char *agent_type,
473 const char *param_digest)
495 unfencing_digest_matches(
const char *rsc_id,
const char *agent,
496 const char *digest_calc,
const char *node_summary)
498 bool matches = FALSE;
500 if (rsc_id && agent && digest_calc && node_summary) {
501 char *search_secure = create_unfencing_summary(rsc_id, agent,
507 matches = (strstr(node_summary, search_secure) != NULL);
508 crm_trace(
"Calculated unfencing digest '%s' %sfound in '%s'",
509 search_secure, matches?
"" :
"not ", node_summary);
519 #define STONITH_DIGEST_TASK "stonith-on" 536 const char *node_summary = NULL;
544 if (node_summary == NULL) {
550 if (unfencing_digest_matches(rsc->
id, agent,
data->digest_all_calc,
558 if (unfencing_digest_matches(rsc->
id, agent,
data->digest_secure_calc,
563 out->
info(out,
"Only 'private' parameters to %s " 564 "for unfencing %s changed", rsc->
id,
565 pe__node_name(node));
575 char *digest = create_unfencing_summary(rsc->
id, agent,
576 data->digest_secure_calc);
578 out->
info(out,
"Parameters to %s for unfencing " 579 "%s changed, try '%s'", rsc->
id,
580 pe__node_name(node), digest);
583 char *digest = create_unfencing_summary(rsc->
id, agent,
584 data->digest_secure_calc);
586 printf(
"Parameters to %s for unfencing %s changed, try '%s'\n",
587 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
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)
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.
op_digest_cache_t * rsc_action_digest_cmp(pe_resource_t *rsc, const xmlNode *xml_op, pe_node_t *node, pe_working_set_t *data_set)
#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)
op_digest_cache_t * pe__calculate_digests(pe_resource_t *rsc, const char *task, guint *interval_ms, const pe_node_t *node, const xmlNode *xml_op, GHashTable *overrides, bool calc_secure, pe_working_set_t *data_set)
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