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 const xmlNode *xml_op,
const char *op_version,
105 xmlNode *action_config = NULL;
115 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;
151 if ((*interval_ms == 0) && (g_hash_table_size(params) > 0)) {
155 g_hash_table_destroy(params);
161 g_hash_table_destroy(params);
171 is_fence_param(xmlAttrPtr attr,
void *user_data)
189 GHashTable *params,
const xmlNode *xml_op,
190 const char *op_version, GHashTable *overrides)
193 const char *secure_list = NULL;
196 if (xml_op == NULL) {
197 secure_list =
" passwd password user ";
204 if (overrides != NULL) {
215 if (secure_list != NULL) {
217 (
void *) secure_list);
259 const char *op_version)
261 const char *value = NULL;
264 if (xml_op == NULL) {
308 const xmlNode *xml_op, GHashTable *overrides,
312 const char *op_version = NULL;
313 GHashTable *params = NULL;
321 if (xml_op != NULL) {
329 if (op_version == NULL) {
334 calculate_main_digest(
data, rsc, node, params, task, interval_ms, xml_op,
337 calculate_secure_digest(
data, rsc, params, xml_op, op_version,
340 calculate_restart_digest(
data, xml_op, op_version);
359 rsc_action_digest(
pcmk_resource_t *rsc,
const char *task, guint interval_ms,
393 guint interval_ms = 0;
395 const char *op_version;
397 const char *digest_all;
398 const char *digest_restart;
407 data = rsc_action_digest(rsc, task, interval_ms, node, xml_op,
412 if (digest_restart &&
data->digest_restart_calc && strcmp(
data->digest_restart_calc, digest_restart) != 0) {
413 pe_rsc_info(rsc,
"Parameters to %ums-interval %s action for %s on %s " 414 "changed: hash was %s vs. now %s (restart:%s) %s",
415 interval_ms, task, rsc->
id, pe__node_name(node),
416 pcmk__s(digest_restart,
"missing"),
417 data->digest_restart_calc,
422 }
else if (digest_all == NULL) {
426 }
else if (strcmp(digest_all,
data->digest_all_calc) != 0) {
437 pe_rsc_info(rsc,
"Parameters containing extra ones to %ums-interval" 438 " %s action for %s on %s " 439 "changed: hash was %s vs. now %s (restart:%s) %s",
440 interval_ms, task, rsc->
id, pe__node_name(node),
441 pcmk__s(digest_all,
"missing"),
data->digest_all_calc,
446 pe_rsc_info(rsc,
"Parameters to %ums-interval %s action for %s on %s " 447 "changed: hash was %s vs. now %s (%s:%s) %s",
448 interval_ms, task, rsc->
id, pe__node_name(node),
449 pcmk__s(digest_all,
"missing"),
data->digest_all_calc,
450 (interval_ms > 0)?
"reschedule" :
"reload",
480 create_unfencing_summary(
const char *rsc_id,
const char *agent_type,
481 const char *param_digest)
503 unfencing_digest_matches(
const char *rsc_id,
const char *agent,
504 const char *digest_calc,
const char *node_summary)
506 bool matches = FALSE;
508 if (rsc_id && agent && digest_calc && node_summary) {
509 char *search_secure = create_unfencing_summary(rsc_id, agent,
515 matches = (strstr(node_summary, search_secure) != NULL);
516 crm_trace(
"Calculated unfencing digest '%s' %sfound in '%s'",
517 search_secure, matches?
"" :
"not ", node_summary);
527 #define STONITH_DIGEST_TASK "stonith-on" 544 const char *node_summary = NULL;
552 if (node_summary == NULL) {
558 if (unfencing_digest_matches(rsc->
id, agent,
data->digest_all_calc,
566 if (unfencing_digest_matches(rsc->
id, agent,
data->digest_secure_calc,
571 out->
info(out,
"Only 'private' parameters to %s " 572 "for unfencing %s changed", rsc->
id,
573 pe__node_name(node));
581 && (
data->digest_secure_calc != NULL)) {
585 char *digest = create_unfencing_summary(rsc->
id, agent,
586 data->digest_secure_calc);
588 out->
info(out,
"Parameters to %s for unfencing " 589 "%s changed, try '%s'", rsc->
id,
590 pe__node_name(node), digest);
593 char *digest = create_unfencing_summary(rsc->
id, agent,
594 data->digest_secure_calc);
596 printf(
"Parameters to %s for unfencing %s changed, try '%s'\n",
597 rsc->
id, pe__node_name(node), digest);
GHashTable * attrs
Node attributes.
void pcmk__filter_op_for_digest(xmlNode *param_set)
void hash2field(gpointer key, gpointer value, gpointer user_data)
Set XML attribute based on hash table entry.
#define XML_ATTR_TRANSITION_MAGIC
const char * pe_node_attribute_raw(const pcmk_node_t *node, const char *name)
bool pcmk_stonith_param(const char *param)
Check whether a given stonith parameter is handled by Pacemaker.
GHashTable * pcmk__unpack_action_rsc_params(const xmlNode *action_xml, GHashTable *node_attrs, pcmk_scheduler_t *data_set)
#define XML_LRM_ATTR_INTERVAL
#define XML_LRM_ATTR_OP_DIGEST
#define XML_LRM_ATTR_OP_RESTART
#define CRM_ATTR_DIGESTS_ALL
int(* info)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
Implementation of pcmk_scheduler_t.
#define XML_RSC_ATTR_REMOTE_RA_ADDR
#define XML_LRM_ATTR_OP_SECURE
xmlNode * copy_xml(xmlNode *src_node)
#define XML_LRM_ATTR_TASK
op_digest_cache_t * pe__compare_fencing_digest(pcmk_resource_t *rsc, const char *agent, pcmk_node_t *node, pcmk_scheduler_t *scheduler)
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.
Implementation of pcmk_resource_t.
const char * pe__add_bundle_remote_name(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler, xmlNode *xml, const char *field)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
void pcmk__xe_remove_matching_attrs(xmlNode *element, bool(*match)(xmlAttrPtr, void *), void *user_data)
#define crm_trace(fmt, args...)
void * priv
For Pacemaker use only.
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
Basic node information.
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
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
void free_xml(xmlNode *child)
Implementation of pcmk_node_t.
Whether sensitive resource attributes have been masked.
xmlNode * pcmk__find_action_config(const pcmk_resource_t *rsc, const char *action_name, guint interval_ms, bool include_disabled)
pcmk_scheduler_t * scheduler
#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)
#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(pcmk_resource_t *rsc, const char *task, guint *interval_ms, const pcmk_node_t *node, const xmlNode *xml_op, GHashTable *overrides, bool calc_secure, pcmk_scheduler_t *scheduler)
GHashTable * pe_rsc_params(pcmk_resource_t *rsc, const pcmk_node_t *node, pcmk_scheduler_t *scheduler)
Get a table of resource parameters.
unsigned long long flags
Group of enum pcmk_scheduler_flags.
op_digest_cache_t * rsc_action_digest_cmp(pcmk_resource_t *rsc, const xmlNode *xml_op, pcmk_node_t *node, pcmk_scheduler_t *scheduler)
GHashTable * pcmk__unpack_action_meta(pcmk_resource_t *rsc, const pcmk_node_t *node, const char *action_name, guint interval_ms, const xmlNode *action_config)
#define pe_rsc_info(rsc, fmt, args...)
#define XML_AGENT_ATTR_CLASS
char * id
Resource ID in configuration.