53 attr_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_not_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);
83 #if ENABLE_VERSIONED_ATTRS
85 append_versioned_params(xmlNode *versioned_params,
const char *ra_version, xmlNode *params)
87 GHashTable *hash = pe_unpack_versioned_parameters(versioned_params, ra_version);
92 g_hash_table_iter_init(&iter, hash);
93 while (g_hash_table_iter_next(&iter, (gpointer *) &key, (gpointer *) &value)) {
96 g_hash_table_destroy(hash);
104 const char *ra_version = NULL;
105 xmlNode *local_versioned_params = NULL;
106 pe_rsc_action_details_t *details = pe_rsc_action_details(action);
109 pe_get_versioned_attributes(local_versioned_params, rsc, node, data_set);
110 if (xml_op != NULL) {
113 append_versioned_params(local_versioned_params, ra_version,
115 append_versioned_params(rsc->versioned_parameters, ra_version,
117 append_versioned_params(details->versioned_parameters, ra_version,
140 const char *task, guint *interval_ms,
141 xmlNode *xml_op,
const char *op_version,
153 crm_trace(
"Set address for bundle connection %s (on %s)",
158 if (overrides != NULL) {
159 const char *interval_s = g_hash_table_lookup(overrides,
CRM_META "_"
162 if (interval_s != NULL) {
166 && (value_ll >= 0) && (value_ll <= G_MAXUINT)) {
167 *interval_ms = (guint) value_ll;
173 task, node, TRUE, FALSE, data_set);
174 if (overrides != NULL) {
181 #if ENABLE_VERSIONED_ATTRS
182 append_all_versioned_params(rsc, node, action, xml_op, data_set);
195 is_fence_param(xmlAttrPtr attr,
void *user_data)
213 GHashTable *params, xmlNode *xml_op,
214 const char *op_version, GHashTable *overrides)
217 const char *secure_list = NULL;
219 if (xml_op == NULL) {
220 secure_list =
" passwd password user ";
226 if (overrides != NULL) {
231 if (secure_list != NULL) {
233 (
void *) secure_list);
274 const char *op_version)
276 const char *value = NULL;
279 if (xml_op == NULL) {
322 pe_node_t *node, xmlNode *xml_op, GHashTable *overrides,
327 GHashTable *params = NULL;
332 if (xml_op != NULL) {
337 calculate_main_digest(data, rsc, node, params, task, interval_ms, xml_op,
338 op_version, overrides, data_set);
340 calculate_secure_digest(data, rsc, params, xml_op, op_version,
343 calculate_restart_digest(data, xml_op, op_version);
362 rsc_action_digest(
pe_resource_t *rsc,
const char *task, guint interval_ms,
363 pe_node_t *node, xmlNode *xml_op,
bool calc_secure,
372 NULL, calc_secure, data_set);
396 guint interval_ms = 0;
398 const char *op_version;
400 const char *digest_all;
401 const char *digest_restart;
410 data = rsc_action_digest(rsc, task, interval_ms, node, xml_op,
416 pe_rsc_info(rsc,
"Parameters to %ums-interval %s action for %s on %s "
417 "changed: hash was %s vs. now %s (restart:%s) %s",
424 }
else if (digest_all == NULL) {
429 pe_rsc_info(rsc,
"Parameters to %ums-interval %s action for %s on %s "
430 "changed: hash was %s vs. now %s (%s:%s) %s",
433 (interval_ms > 0)?
"reschedule" :
"reload",
459 create_unfencing_summary(
const char *rsc_id,
const char *agent_type,
460 const char *param_digest)
482 unfencing_digest_matches(
const char *rsc_id,
const char *agent,
483 const char *digest_calc,
const char *node_summary)
485 bool matches = FALSE;
487 if (rsc_id && agent && digest_calc && node_summary) {
488 char *search_secure = create_unfencing_summary(rsc_id, agent,
494 matches = (strstr(node_summary, search_secure) != NULL);
495 crm_trace(
"Calculated unfencing digest '%s' %sfound in '%s'",
496 search_secure, matches?
"" :
"not ", node_summary);
506 #define STONITH_DIGEST_TASK "stonith-on"
523 const char *node_summary = NULL;
527 node, NULL, TRUE, data_set);
531 if (node_summary == NULL) {
550 out->
info(out,
"Only 'private' parameters to %s "
551 "for unfencing %s changed", rsc->
id,
560 if (data_set->
priv != NULL) {
562 char *digest = create_unfencing_summary(rsc->
id, agent,
565 out->
info(out,
"Parameters to %s for unfencing "
566 "%s changed, try '%s'", rsc->
id,
570 char *digest = create_unfencing_summary(rsc->
id, agent,
573 printf(
"Parameters to %s for unfencing %s changed, try '%s'\n",
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
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
#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)
#define XML_RSC_ATTR_REMOTE_RA_ADDR
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)
#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.
void pcmk__xe_remove_matching_attrs(xmlNode *element, bool(*match)(xmlAttrPtr, void *), void *user_data)
#define crm_trace(fmt, args...)
enum rsc_digest_cmp_val rc
char * digest_secure_calc
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
int(* info)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
struct pe_node_shared_s * details
GHashTable * pe_rsc_params(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
Get a table of resource parameters.
Wrappers for and extensions to libxml2.
xmlNode * create_xml_node(xmlNode *parent, const char *name)
#define CRM_ATTR_DIGESTS_SECURE
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
#define XML_LRM_ATTR_RESTART_DIGEST
void pe__free_digests(gpointer ptr)
#define XML_TAG_RSC_VER_ATTRS
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)
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)
#define STONITH_DIGEST_TASK
void xml_remove_prop(xmlNode *obj, const char *name)
This structure contains everything that makes up a single output formatter.
#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.
char * digest_restart_calc
#define XML_ATTR_RA_VERSION
void pe_free_action(pe_action_t *action)
#define pe_rsc_info(rsc, fmt, args...)
#define XML_AGENT_ATTR_CLASS
pe_action_t * custom_action(pe_resource_t *rsc, char *key, const char *task, pe_node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)