Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Rings:1-MinimalX
pacemaker
pacemaker-lrmd-pengine-dont-support-versioned-a...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pacemaker-lrmd-pengine-dont-support-versioned-attributes-by-default.patch of Package pacemaker
commit f049588fe0f51d018df3fbd54a38669fe3d7a60a Author: Ken Gaillot <kgaillot@redhat.com> Date: Mon May 8 10:34:45 2017 -0500 Feature: lrmd,pengine: don't support versioned attributes by default not ready for release Index: pacemaker-1.1.16+20170320.77ea74d/crmd/lrm.c =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/crmd/lrm.c +++ pacemaker-1.1.16+20170320.77ea74d/crmd/lrm.c @@ -641,6 +641,7 @@ build_parameter_list(lrmd_event_data_t * value = g_hash_table_lookup(op->params, name); if(value != NULL) { +#ifdef ENABLE_VERSIONED_ATTRS char *summary = crm_versioned_param_summary(op->versioned_params, name); if (summary) { @@ -648,9 +649,12 @@ build_parameter_list(lrmd_event_data_t * crm_xml_add(result, name, summary); free(summary); } else { +#endif crm_trace("Adding attr %s=%s to the xml result", name, value); crm_xml_add(result, name, value); +#ifdef ENABLE_VERSIONED_ATTRS } +#endif } } } @@ -1860,7 +1864,9 @@ construct_op(lrm_state_t * lrm_state, xm const char *op_timeout = NULL; const char *op_interval = NULL; GHashTable *params = NULL; +#ifdef ENABLE_VERSIONED_ATTRS xmlNode *versioned_params = NULL; +#endif const char *transition = NULL; @@ -1895,6 +1901,7 @@ construct_op(lrm_state_t * lrm_state, xm params = xml2list(rsc_op); g_hash_table_remove(params, CRM_META "_op_target_rc"); +#ifdef ENABLE_VERSIONED_ATTRS if (!is_remote_lrmd_ra(NULL, NULL, rsc_id)) { xmlNode *ptr = first_named_child(rsc_op, XML_TAG_VER_ATTRS); @@ -1903,6 +1910,7 @@ construct_op(lrm_state_t * lrm_state, xm versioned_params = copy_xml(ptr); } } +#endif op_delay = crm_meta_value(params, XML_OP_ATTR_START_DELAY); op_timeout = crm_meta_value(params, XML_ATTR_TIMEOUT); @@ -1914,7 +1922,9 @@ construct_op(lrm_state_t * lrm_state, xm if (safe_str_neq(operation, RSC_STOP)) { op->params = params; +#ifdef ENABLE_VERSIONED_ATTRS op->versioned_params = versioned_params; +#endif } else { rsc_history_t *entry = g_hash_table_lookup(lrm_state->resource_history, rsc_id); @@ -1923,7 +1933,9 @@ construct_op(lrm_state_t * lrm_state, xm * whatever we are given */ if (!entry || !entry->stop_params) { op->params = params; +#ifdef ENABLE_VERSIONED_ATTRS op->versioned_params = versioned_params; +#endif } else { /* Copy the cached parameter list so that we stop the resource * with the old attributes, not the new ones */ @@ -1934,12 +1946,15 @@ construct_op(lrm_state_t * lrm_state, xm g_hash_table_foreach(entry->stop_params, copy_instance_keys, op->params); g_hash_table_destroy(params); params = NULL; +#ifdef ENABLE_VERSIONED_ATTRS op->versioned_params = NULL; free_xml(versioned_params); +#endif } } +#ifdef ENABLE_VERSIONED_ATTRS if (op->versioned_params) { char *versioned_params_text = dump_xml_unformatted(op->versioned_params); @@ -1947,6 +1962,7 @@ construct_op(lrm_state_t * lrm_state, xm g_hash_table_insert(op->params, strdup("#" XML_TAG_VER_ATTRS), versioned_params_text); } } +#endif /* sanity */ if (op->interval < 0) { Index: pacemaker-1.1.16+20170320.77ea74d/include/crm/lrmd.h =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/include/crm/lrmd.h +++ pacemaker-1.1.16+20170320.77ea74d/include/crm/lrmd.h @@ -186,6 +186,10 @@ enum lrmd_callback_event { /* *INDENT-ON* */ +#ifdef ENABLE_VERSIONED_ATTRS +#include <libxml/tree.h> +#endif + typedef struct lrmd_event_data_s { /*! Type of event, register, unregister, call_completed... */ enum lrmd_callback_event type; @@ -238,9 +242,11 @@ typedef struct lrmd_event_data_s { /*! exit failure reason string from resource agent operation */ const char *exit_reason; +#ifdef ENABLE_VERSIONED_ATTRS /* This is an xmlNode containing the versioned parameters * that should be evaluated */ xmlNode *versioned_params; +#endif } lrmd_event_data_t; Index: pacemaker-1.1.16+20170320.77ea74d/include/crm/msg_xml.h =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/include/crm/msg_xml.h +++ pacemaker-1.1.16+20170320.77ea74d/include/crm/msg_xml.h @@ -177,7 +177,9 @@ # define XML_TAG_ATTR_SETS "instance_attributes" # define XML_TAG_META_SETS "meta_attributes" # define XML_TAG_ATTRS "attributes" +#ifdef ENABLE_VERSIONED_ATTRS # define XML_TAG_VER_ATTRS "versioned_attributes" +#endif # define XML_TAG_PARAMS "parameters" # define XML_TAG_PARAM "param" # define XML_TAG_UTILIZATION "utilization" Index: pacemaker-1.1.16+20170320.77ea74d/include/crm/pengine/complex.h =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/include/crm/pengine/complex.h +++ pacemaker-1.1.16+20170320.77ea74d/include/crm/pengine/complex.h @@ -56,8 +56,10 @@ void get_meta_attributes(GHashTable * me void get_rsc_attributes(GHashTable * meta_hash, resource_t * rsc, node_t * node, pe_working_set_t * data_set); +#ifdef ENABLE_VERSIONED_ATTRS void pe_get_versioned_attributes(xmlNode * meta_hash, resource_t * rsc, node_t * node, pe_working_set_t * data_set); +#endif typedef struct resource_alloc_functions_s resource_alloc_functions_t; Index: pacemaker-1.1.16+20170320.77ea74d/include/crm/pengine/rules.h =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/include/crm/pengine/rules.h +++ pacemaker-1.1.16+20170320.77ea74d/include/crm/pengine/rules.h @@ -31,7 +31,9 @@ enum expression_type { loc_expr, role_expr, time_expr, +#ifdef ENABLE_VERSIONED_ATTRS version_expr +#endif }; typedef struct pe_re_match_data { @@ -59,8 +61,10 @@ void unpack_instance_attributes(xmlNode GHashTable * node_hash, GHashTable * hash, const char *always_first, gboolean overwrite, crm_time_t * now); +#ifdef ENABLE_VERSIONED_ATTRS void pe_unpack_versioned_attributes(xmlNode * top, xmlNode * xml_obj, const char *set_name, GHashTable * node_hash, xmlNode * hash, crm_time_t * now); +#endif char *pe_expand_re_matches(const char *string, pe_re_match_data_t * match_data); Index: pacemaker-1.1.16+20170320.77ea74d/include/crm/pengine/status.h =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/include/crm/pengine/status.h +++ pacemaker-1.1.16+20170320.77ea74d/include/crm/pengine/status.h @@ -305,8 +305,10 @@ struct resource_s { int remote_reconnect_interval; pe_working_set_t *cluster; +#ifdef ENABLE_VERSIONED_ATTRS xmlNode *versioned_parameters; +#endif }; struct pe_action_s { Index: pacemaker-1.1.16+20170320.77ea74d/include/crm_internal.h =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/include/crm_internal.h +++ pacemaker-1.1.16+20170320.77ea74d/include/crm_internal.h @@ -378,6 +378,8 @@ void remote_proxy_end_session(const char void remote_proxy_free(gpointer data); int remote_proxy_check(lrmd_t * lrmd, GHashTable *hash); +#ifdef ENABLE_VERSIONED_ATTRS char* crm_versioned_param_summary(xmlNode *versioned_params, const char *name); void crm_summarize_versioned_params(xmlNode *param_set, xmlNode *versioned_params); +#endif #endif /* CRM_INTERNAL__H */ Index: pacemaker-1.1.16+20170320.77ea74d/lib/common/digest.c =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/lib/common/digest.c +++ pacemaker-1.1.16+20170320.77ea74d/lib/common/digest.c @@ -242,6 +242,7 @@ crm_digest_verify(xmlNode *input, const return passed; } +#ifdef ENABLE_VERSIONED_ATTRS char* crm_versioned_param_summary(xmlNode *versioned_params, const char *name) { @@ -307,3 +308,4 @@ crm_summarize_versioned_params(xmlNode * } } } +#endif Index: pacemaker-1.1.16+20170320.77ea74d/lib/common/utils.c =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/lib/common/utils.c +++ pacemaker-1.1.16+20170320.77ea74d/lib/common/utils.c @@ -1564,7 +1564,9 @@ append_digest(lrmd_event_data_t * op, xm args_xml = create_xml_node(NULL, XML_TAG_PARAMS); g_hash_table_foreach(op->params, hash2field, args_xml); filter_action_parameters(args_xml, version); +#ifdef ENABLE_VERSIONED_ATTRS crm_summarize_versioned_params(args_xml, op->versioned_params); +#endif digest = calculate_operation_digest(args_xml, version); #if 0 Index: pacemaker-1.1.16+20170320.77ea74d/lib/lrmd/lrmd_client.c =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/lib/lrmd/lrmd_client.c +++ pacemaker-1.1.16+20170320.77ea74d/lib/lrmd/lrmd_client.c @@ -220,9 +220,11 @@ lrmd_copy_event(lrmd_event_data_t * even } } +#ifdef ENABLE_VERSIONED_ATTRS if (event->versioned_params) { copy->versioned_params = copy_xml(event->versioned_params); } +#endif return copy; } @@ -244,9 +246,11 @@ lrmd_free_event(lrmd_event_data_t * even if (event->params) { g_hash_table_destroy(event->params); } +#ifdef ENABLE_VERSIONED_ATTRS if (event->versioned_params) { free_xml(event->versioned_params); } +#endif free(event); } @@ -297,7 +301,9 @@ lrmd_dispatch_internal(lrmd_t * lrmd, xm event.type = lrmd_event_exec_complete; event.params = xml2list(msg); +#ifdef ENABLE_VERSIONED_ATTRS event.versioned_params = first_named_child(msg, XML_TAG_VER_ATTRS); +#endif } else if (crm_str_eq(type, LRMD_OP_NEW_CLIENT, TRUE)) { event.type = lrmd_event_new_client; } else if (crm_str_eq(type, LRMD_OP_POKE, TRUE)) { @@ -1999,7 +2005,9 @@ lrmd_api_exec(lrmd_t * lrmd, const char xmlNode *data = create_xml_node(NULL, F_LRMD_RSC); xmlNode *args = create_xml_node(data, XML_TAG_ATTRS); lrmd_key_value_t *tmp = NULL; +#ifdef ENABLE_VERSIONED_ATTRS const char *versioned_args_key = "#" XML_TAG_VER_ATTRS; +#endif crm_xml_add(data, F_LRMD_ORIGIN, __FUNCTION__); crm_xml_add(data, F_LRMD_RSC_ID, rsc_id); @@ -2010,6 +2018,7 @@ lrmd_api_exec(lrmd_t * lrmd, const char crm_xml_add_int(data, F_LRMD_RSC_START_DELAY, start_delay); for (tmp = params; tmp; tmp = tmp->next) { +#ifdef ENABLE_VERSIONED_ATTRS if (safe_str_eq(tmp->key, versioned_args_key)) { xmlNode *versioned_args = string2xml(tmp->value); @@ -2017,8 +2026,11 @@ lrmd_api_exec(lrmd_t * lrmd, const char add_node_nocopy(data, NULL, versioned_args); } } else { +#endif hash2smartfield((gpointer) tmp->key, (gpointer) tmp->value, args); +#ifdef ENABLE_VERSIONED_ATTRS } +#endif } rc = lrmd_send_command(lrmd, LRMD_OP_RSC_EXEC, data, NULL, timeout, options, TRUE); Index: pacemaker-1.1.16+20170320.77ea74d/lib/pengine/complex.c =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/lib/pengine/complex.c +++ pacemaker-1.1.16+20170320.77ea74d/lib/pengine/complex.c @@ -173,6 +173,7 @@ get_rsc_attributes(GHashTable * meta_has } } +#ifdef ENABLE_VERSIONED_ATTRS void pe_get_versioned_attributes(xmlNode * meta_hash, resource_t * rsc, node_t * node, pe_working_set_t * data_set) @@ -196,6 +197,7 @@ pe_get_versioned_attributes(xmlNode * me node_hash, meta_hash, data_set->now); } } +#endif static char * template_op_key(xmlNode * op) @@ -414,6 +416,7 @@ common_unpack(xmlNode * xml_obj, resourc const char *id = crm_element_value(xml_obj, XML_ATTR_ID); int container_remote_node = 0; int baremetal_remote_node = 0; + bool has_versioned_params = FALSE; crm_log_xml_trace(xml_obj, "Processing resource input..."); @@ -461,7 +464,9 @@ common_unpack(xmlNode * xml_obj, resourc (*rsc)->parameters = g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, g_hash_destroy_str); +#ifdef ENABLE_VERSIONED_ATTRS (*rsc)->versioned_parameters = create_xml_node(NULL, XML_TAG_VER_ATTRS); +#endif (*rsc)->meta = g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, g_hash_destroy_str); @@ -485,7 +490,9 @@ common_unpack(xmlNode * xml_obj, resourc get_meta_attributes((*rsc)->meta, *rsc, NULL, data_set); get_rsc_attributes((*rsc)->parameters, *rsc, NULL, data_set); +#ifdef ENABLE_VERSIONED_ATTRS pe_get_versioned_attributes((*rsc)->versioned_parameters, *rsc, NULL, data_set); +#endif (*rsc)->flags = 0; set_bit((*rsc)->flags, pe_rsc_runnable); @@ -524,12 +531,14 @@ common_unpack(xmlNode * xml_obj, resourc } value = g_hash_table_lookup((*rsc)->meta, XML_OP_ATTR_ALLOW_MIGRATE); - if (crm_is_true(value) && xml_has_children((*rsc)->versioned_parameters)) { +#ifdef ENABLE_VERSIONED_ATTRS + has_versioned_params = xml_has_children((*rsc)->versioned_parameters); +#endif + if (crm_is_true(value) && has_versioned_params) { pe_rsc_trace((*rsc), "Migration is disabled for resources with versioned parameters"); } else if (crm_is_true(value)) { set_bit((*rsc)->flags, pe_rsc_allow_migrate); - } else if (value == NULL && baremetal_remote_node && - !xml_has_children((*rsc)->versioned_parameters)) { + } else if ((value == NULL) && baremetal_remote_node && !has_versioned_params) { /* by default, we want baremetal remote-nodes to be able * to float around the cluster without having to stop all the * resources within the remote-node before moving. Allowing @@ -839,9 +848,11 @@ common_free(resource_t * rsc) if (rsc->parameters != NULL) { g_hash_table_destroy(rsc->parameters); } +#ifdef ENABLE_VERSIONED_ATTRS if (rsc->versioned_parameters != NULL) { free_xml(rsc->versioned_parameters); } +#endif if (rsc->meta != NULL) { g_hash_table_destroy(rsc->meta); } Index: pacemaker-1.1.16+20170320.77ea74d/lib/pengine/rules.c =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/lib/pengine/rules.c +++ pacemaker-1.1.16+20170320.77ea74d/lib/pengine/rules.c @@ -138,6 +138,7 @@ pe_test_expression_re(xmlNode * expr, GH accept = test_role_expression(expr, role, now); break; +#ifdef ENABLE_VERSIONED_ATTRS case version_expr: if (node_hash && g_hash_table_lookup_extended(node_hash, "#ra-version", NULL, NULL)) { @@ -147,6 +148,7 @@ pe_test_expression_re(xmlNode * expr, GH accept = TRUE; } break; +#endif default: CRM_CHECK(FALSE /* bad type */ , return FALSE); @@ -185,8 +187,10 @@ find_expression_type(xmlNode * expr) } else if (safe_str_eq(attr, "#role")) { return role_expr; +#ifdef ENABLE_VERSIONED_ATTRS } else if (safe_str_eq(attr, "#ra-version")) { return version_expr; +#endif } return attr_expr; @@ -711,6 +715,7 @@ populate_hash(xmlNode * nvpair_list, GHa } } +#ifdef ENABLE_VERSIONED_ATTRS static xmlNode* get_versioned_rule(xmlNode * attr_set) { @@ -798,6 +803,7 @@ add_versioned_attributes(xmlNode * attr_ add_node_nocopy(versioned_attrs, NULL, attr_set_copy); } +#endif typedef struct unpack_data_s { gboolean overwrite; @@ -817,16 +823,19 @@ unpack_attr_set(gpointer data, gpointer return; } +#ifdef ENABLE_VERSIONED_ATTRS if (get_versioned_rule(pair->attr_set) && !(unpack_data->node_hash && g_hash_table_lookup_extended(unpack_data->node_hash, "#ra-version", NULL, NULL))) { // we haven't actually tested versioned expressions yet return; } +#endif crm_trace("Adding attributes from %s", pair->name); populate_hash(pair->attr_set, unpack_data->hash, unpack_data->overwrite, unpack_data->top); } +#ifdef ENABLE_VERSIONED_ATTRS static void unpack_versioned_attr_set(gpointer data, gpointer user_data) { @@ -839,6 +848,7 @@ unpack_versioned_attr_set(gpointer data, add_versioned_attributes(pair->attr_set, unpack_data->hash); } +#endif static GListPtr make_pairs_and_populate_data(xmlNode * top, xmlNode * xml_obj, const char *set_name, @@ -907,6 +917,7 @@ unpack_instance_attributes(xmlNode * top } } +#ifdef ENABLE_VERSIONED_ATTRS void pe_unpack_versioned_attributes(xmlNode * top, xmlNode * xml_obj, const char *set_name, GHashTable * node_hash, xmlNode * hash, crm_time_t * now) @@ -920,6 +931,7 @@ pe_unpack_versioned_attributes(xmlNode * g_list_free_full(pairs, free); } } +#endif char * pe_expand_re_matches(const char *string, pe_re_match_data_t *match_data) Index: pacemaker-1.1.16+20170320.77ea74d/lib/pengine/utils.c =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/lib/pengine/utils.c +++ pacemaker-1.1.16+20170320.77ea74d/lib/pengine/utils.c @@ -1681,7 +1681,9 @@ rsc_action_digest_cmp(resource_t * rsc, op_digest_cache_t *data = NULL; GHashTable *local_rsc_params = NULL; +#ifdef ENABLE_VERSIONED_ATTRS xmlNode *local_versioned_params = NULL; +#endif action_t *action = NULL; char *key = NULL; @@ -1720,16 +1722,20 @@ rsc_action_digest_cmp(resource_t * rsc, local_rsc_params = g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, g_hash_destroy_str); get_rsc_attributes(local_rsc_params, rsc, node, data_set); +#ifdef ENABLE_VERSIONED_ATTRS local_versioned_params = create_xml_node(NULL, XML_TAG_VER_ATTRS); pe_get_versioned_attributes(local_versioned_params, rsc, node, data_set); +#endif data->params_all = create_xml_node(NULL, XML_TAG_PARAMS); g_hash_table_foreach(local_rsc_params, hash2field, data->params_all); g_hash_table_foreach(action->extra, hash2field, data->params_all); g_hash_table_foreach(rsc->parameters, hash2field, data->params_all); g_hash_table_foreach(action->meta, hash2metafield, data->params_all); filter_action_parameters(data->params_all, op_version); +#ifdef ENABLE_VERSIONED_ATTRS crm_summarize_versioned_params(data->params_all, rsc->versioned_parameters); crm_summarize_versioned_params(data->params_all, local_versioned_params); +#endif data->digest_all_calc = calculate_operation_digest(data->params_all, op_version); @@ -1765,7 +1771,9 @@ rsc_action_digest_cmp(resource_t * rsc, g_hash_table_insert(node->details->digest_cache, strdup(op_id), data); g_hash_table_destroy(local_rsc_params); +#ifdef ENABLE_VERSIONED_ATTRS free_xml(local_versioned_params); +#endif pe_free_action(action); return data; Index: pacemaker-1.1.16+20170320.77ea74d/lrmd/lrmd.c =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/lrmd/lrmd.c +++ pacemaker-1.1.16+20170320.77ea74d/lrmd/lrmd.c @@ -28,7 +28,9 @@ #include <crm/common/ipc.h> #include <crm/common/ipcs.h> #include <crm/msg_xml.h> +#ifdef ENABLE_VERSIONED_ATTRS #include <crm/pengine/rules.h> +#endif #include <lrmd_private.h> @@ -39,8 +41,10 @@ #define EXIT_REASON_MAX_LEN 128 GHashTable *rsc_list = NULL; +#ifdef ENABLE_VERSIONED_ATTRS regex_t *version_format_regex = NULL; GHashTable *ra_version_hash = NULL; +#endif typedef struct lrmd_cmd_s { int timeout; @@ -171,6 +175,7 @@ dup_attr(gpointer key, gpointer value, g g_hash_table_replace(user_data, strdup(key), strdup(value)); } +#ifdef ENABLE_VERSIONED_ATTRS static gboolean valid_version_format(const char *version) { @@ -255,6 +260,7 @@ get_ra_version(const char *class, const return version; } +#endif static lrmd_cmd_t * create_lrmd_cmd(xmlNode * msg, crm_client_t * client, lrmd_rsc_t *rsc) @@ -282,6 +288,7 @@ create_lrmd_cmd(xmlNode * msg, crm_clien cmd->params = xml2list(rsc_xml); +#ifdef ENABLE_VERSIONED_ATTRS cmd->versioned_attrs = first_named_child(rsc_xml, XML_TAG_VER_ATTRS); if (cmd->versioned_attrs) { @@ -297,6 +304,7 @@ create_lrmd_cmd(xmlNode * msg, crm_clien g_hash_table_destroy(node_hash); g_hash_table_destroy(hash); } +#endif cmd->isolation_wrapper = g_hash_table_lookup(cmd->params, "CRM_meta_isolation_wrapper"); @@ -330,9 +338,11 @@ free_lrmd_cmd(lrmd_cmd_t * cmd) if (cmd->params) { g_hash_table_destroy(cmd->params); } +#ifdef ENABLE_VERSIONED_ATTRS if (cmd->versioned_attrs) { free_xml(cmd->versioned_attrs); } +#endif free(cmd->origin); free(cmd->action); free(cmd->real_action); @@ -650,11 +660,13 @@ send_cmd_complete_notify(lrmd_cmd_t * cm hash2smartfield((gpointer) key, (gpointer) value, args); } } +#ifdef ENABLE_VERSIONED_ATTRS if (cmd->versioned_attrs) { add_node_copy(notify, cmd->versioned_attrs); } +#endif if (cmd->client_id && (cmd->call_opts & lrmd_opt_notify_orig_only)) { crm_client_t *client = crm_client_get_by_id(cmd->client_id); Index: pacemaker-1.1.16+20170320.77ea74d/lrmd/lrmd_private.h =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/lrmd/lrmd_private.h +++ pacemaker-1.1.16+20170320.77ea74d/lrmd/lrmd_private.h @@ -21,7 +21,9 @@ # define LRMD_PVT__H # include <glib.h> +#ifdef ENABLE_VERSIONED_ATTRS # include <regex.h> +#endif # include <crm/common/ipcs.h> # include <crm/lrmd.h> # include <crm/stonith-ng.h> @@ -34,8 +36,10 @@ #define LRMD_ISOLATION_PROVIDER ".isolation" GHashTable *rsc_list; +#ifdef ENABLE_VERSIONED_ATTRS extern regex_t *version_format_regex; extern GHashTable *ra_version_hash; +#endif typedef struct lrmd_rsc_s { char *rsc_id; Index: pacemaker-1.1.16+20170320.77ea74d/lrmd/main.c =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/lrmd/main.c +++ pacemaker-1.1.16+20170320.77ea74d/lrmd/main.c @@ -285,6 +285,7 @@ lrmd_exit(gpointer data) if (ipcs) { mainloop_del_ipc_server(ipcs); } +#ifdef ENABLE_VERSIONED_ATTRS if (version_format_regex) { regfree(version_format_regex); free(version_format_regex); @@ -292,6 +293,7 @@ lrmd_exit(gpointer data) if (ra_version_hash) { g_hash_table_destroy(ra_version_hash); } +#endif #ifdef ENABLE_PCMK_REMOTE lrmd_tls_server_destroy(); Index: pacemaker-1.1.16+20170320.77ea74d/pengine/graph.c =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/pengine/graph.c +++ pacemaker-1.1.16+20170320.77ea74d/pengine/graph.c @@ -1095,24 +1095,32 @@ action2xml(action_t * action, gboolean a g_hash_table_foreach(action->extra, hash2field, args_xml); if (action->rsc != NULL && action->node) { GHashTable *p = g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, g_hash_destroy_str); +#ifdef ENABLE_VERSIONED_ATTRS xmlNode *versioned_parameters = create_xml_node(NULL, XML_TAG_VER_ATTRS); +#endif get_rsc_attributes(p, action->rsc, action->node, data_set); g_hash_table_foreach(p, hash2smartfield, args_xml); +#ifdef ENABLE_VERSIONED_ATTRS pe_get_versioned_attributes(versioned_parameters, action->rsc, action->node, data_set); if (xml_has_children(versioned_parameters)) { add_node_copy(action_xml, versioned_parameters); } +#endif g_hash_table_destroy(p); +#ifdef ENABLE_VERSIONED_ATTRS free_xml(versioned_parameters); +#endif } else if(action->rsc && action->rsc->variant <= pe_native) { g_hash_table_foreach(action->rsc->parameters, hash2smartfield, args_xml); +#ifdef ENABLE_VERSIONED_ATTRS if (xml_has_children(action->rsc->versioned_parameters)) { add_node_copy(action_xml, action->rsc->versioned_parameters); } +#endif } g_hash_table_foreach(action->meta, hash2metafield, args_xml);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor