SHA256
1
0
forked from pool/pacemaker
pacemaker/pacemaker-pengine-nvpair-id-ref.patch

170 lines
5.1 KiB
Diff
Raw Normal View History

commit 3912538a8954158d44a57f23aa219c5529a170ab
- xml: Memory leak when free'ing xml documents - systemd: Prevent use-of-NULL when determining if an agent exists - xml: Fix segfault in TRACKING_CHANGES() - PE: Memory leak when updating cancel operations - xml: Prevent memory leak in xml _private field - pengine: Performance increase, stack allocated score2char - crm_report: Only gather dlm data if dlm_controld is running - Fix: memory leak found by valgrind was corrected. - Fencing: Add the ability to call stonith_api_time() from stonith_admin - Fencing: Pass the correct options when looking up the history by node name - cib: Ensure 'cibadmin -R/--replace' commands get replies - xml: Correctly initialize and find v1-style patch version numbers - crm_mon: Add -R switch to show clone details - Build: Install compatibility.h - fencing: Teach stonith-ng about finding device and topology changes in the v2 patch format - crm_report: Additional dlm detail - crm_report: Allow ssh alternatives to be used - crmd: Correctly recognise operation cancellations we initiated - crmd: Improved logging of transition cancellations - crmd: Correctly detect lrm refreshes - crmd: Ignore 'move' operations to the cib, we only care about content changes - PE: Ensure instance numbers are preserved for cloned templates - Bug cl#5196 - PE: Check values after expanding templates - crm_mon: Ensure resource attributes have been unpacked before displaying connectivity data - Upstream version cs: ca8234daf2bbb2d0fd2fb47cdbb6667f892081bb - pengine: Support id-ref in nvpair with optional "name" (FATE#316118) * pacemaker-pengine-nvpair-id-ref.patch * pacemaker-pengine-nvpair-id-ref-test.patch OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=111
2014-03-03 07:56:37 +00:00
Author: Gao,Yan <ygao@suse.com>
Date: Wed Jan 29 14:07:44 2014 +0800
Feature: pengine: Support id-ref in nvpair with optional "name"
- xml: Memory leak when free'ing xml documents - systemd: Prevent use-of-NULL when determining if an agent exists - xml: Fix segfault in TRACKING_CHANGES() - PE: Memory leak when updating cancel operations - xml: Prevent memory leak in xml _private field - pengine: Performance increase, stack allocated score2char - crm_report: Only gather dlm data if dlm_controld is running - Fix: memory leak found by valgrind was corrected. - Fencing: Add the ability to call stonith_api_time() from stonith_admin - Fencing: Pass the correct options when looking up the history by node name - cib: Ensure 'cibadmin -R/--replace' commands get replies - xml: Correctly initialize and find v1-style patch version numbers - crm_mon: Add -R switch to show clone details - Build: Install compatibility.h - fencing: Teach stonith-ng about finding device and topology changes in the v2 patch format - crm_report: Additional dlm detail - crm_report: Allow ssh alternatives to be used - crmd: Correctly recognise operation cancellations we initiated - crmd: Improved logging of transition cancellations - crmd: Correctly detect lrm refreshes - crmd: Ignore 'move' operations to the cib, we only care about content changes - PE: Ensure instance numbers are preserved for cloned templates - Bug cl#5196 - PE: Check values after expanding templates - crm_mon: Ensure resource attributes have been unpacked before displaying connectivity data - Upstream version cs: ca8234daf2bbb2d0fd2fb47cdbb6667f892081bb - pengine: Support id-ref in nvpair with optional "name" (FATE#316118) * pacemaker-pengine-nvpair-id-ref.patch * pacemaker-pengine-nvpair-id-ref-test.patch OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=111
2014-03-03 07:56:37 +00:00
If "name" isn't specified, it inherits the name from the referenced
nvpair.
diff --git a/lib/pengine/rules.c b/lib/pengine/rules.c
index f80aa47..626d7b2 100644
--- a/lib/pengine/rules.c
+++ b/lib/pengine/rules.c
@@ -607,7 +607,7 @@ sort_pairs(gconstpointer a, gconstpointer b)
}
static void
-populate_hash(xmlNode * nvpair_list, GHashTable * hash, gboolean overwrite)
+populate_hash(xmlNode * nvpair_list, GHashTable * hash, gboolean overwrite, xmlNode * top)
{
const char *name = NULL;
const char *value = NULL;
@@ -622,10 +622,18 @@ populate_hash(xmlNode * nvpair_list, GHashTable * hash, gboolean overwrite)
for (an_attr = __xml_first_child(list); an_attr != NULL; an_attr = __xml_next(an_attr)) {
if (crm_str_eq((const char *)an_attr->name, XML_CIB_TAG_NVPAIR, TRUE)) {
+ xmlNode *ref_nvpair = expand_idref(an_attr, top);
+
name = crm_element_value(an_attr, XML_NVPAIR_ATTR_NAME);
+ if (name == NULL) {
+ name = crm_element_value(ref_nvpair, XML_NVPAIR_ATTR_NAME);
+ }
crm_trace("Setting attribute: %s", name);
value = crm_element_value(an_attr, XML_NVPAIR_ATTR_VALUE);
+ if (value == NULL) {
+ value = crm_element_value(ref_nvpair, XML_NVPAIR_ATTR_VALUE);
+ }
if (name == NULL || value == NULL) {
continue;
@@ -657,6 +665,7 @@ struct unpack_data_s {
GHashTable *node_hash;
GHashTable *hash;
crm_time_t *now;
+ xmlNode *top;
};
static void
@@ -670,7 +679,7 @@ unpack_attr_set(gpointer data, gpointer user_data)
}
crm_trace("Adding attributes from %s", pair->name);
- populate_hash(pair->attr_set, unpack_data->hash, unpack_data->overwrite);
+ populate_hash(pair->attr_set, unpack_data->hash, unpack_data->overwrite, unpack_data->top);
}
void
@@ -717,6 +726,7 @@ unpack_instance_attributes(xmlNode * top, xmlNode * xml_obj, const char *set_nam
data.node_hash = node_hash;
data.now = now;
data.overwrite = overwrite;
+ data.top = top;
}
sorted = g_list_sort(unsorted, sort_pairs);
diff --git a/xml/nodes-1.3.rng b/xml/nodes-1.3.rng
index c28b5df..1ded570 100644
--- a/xml/nodes-1.3.rng
+++ b/xml/nodes-1.3.rng
@@ -30,10 +30,10 @@
<zeroOrMore>
<choice>
<element name="instance_attributes">
- <externalRef href="nvset.rng"/>
+ <externalRef href="nvset-1.3.rng"/>
</element>
<element name="utilization">
- <externalRef href="nvset.rng"/>
+ <externalRef href="nvset-1.3.rng"/>
</element>
</choice>
</zeroOrMore>
diff --git a/xml/nvset-1.3.rng b/xml/nvset-1.3.rng
- xml: Memory leak when free'ing xml documents - systemd: Prevent use-of-NULL when determining if an agent exists - xml: Fix segfault in TRACKING_CHANGES() - PE: Memory leak when updating cancel operations - xml: Prevent memory leak in xml _private field - pengine: Performance increase, stack allocated score2char - crm_report: Only gather dlm data if dlm_controld is running - Fix: memory leak found by valgrind was corrected. - Fencing: Add the ability to call stonith_api_time() from stonith_admin - Fencing: Pass the correct options when looking up the history by node name - cib: Ensure 'cibadmin -R/--replace' commands get replies - xml: Correctly initialize and find v1-style patch version numbers - crm_mon: Add -R switch to show clone details - Build: Install compatibility.h - fencing: Teach stonith-ng about finding device and topology changes in the v2 patch format - crm_report: Additional dlm detail - crm_report: Allow ssh alternatives to be used - crmd: Correctly recognise operation cancellations we initiated - crmd: Improved logging of transition cancellations - crmd: Correctly detect lrm refreshes - crmd: Ignore 'move' operations to the cib, we only care about content changes - PE: Ensure instance numbers are preserved for cloned templates - Bug cl#5196 - PE: Check values after expanding templates - crm_mon: Ensure resource attributes have been unpacked before displaying connectivity data - Upstream version cs: ca8234daf2bbb2d0fd2fb47cdbb6667f892081bb - pengine: Support id-ref in nvpair with optional "name" (FATE#316118) * pacemaker-pengine-nvpair-id-ref.patch * pacemaker-pengine-nvpair-id-ref-test.patch OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=111
2014-03-03 07:56:37 +00:00
new file mode 100644
index 0000000..8f1696c
- xml: Memory leak when free'ing xml documents - systemd: Prevent use-of-NULL when determining if an agent exists - xml: Fix segfault in TRACKING_CHANGES() - PE: Memory leak when updating cancel operations - xml: Prevent memory leak in xml _private field - pengine: Performance increase, stack allocated score2char - crm_report: Only gather dlm data if dlm_controld is running - Fix: memory leak found by valgrind was corrected. - Fencing: Add the ability to call stonith_api_time() from stonith_admin - Fencing: Pass the correct options when looking up the history by node name - cib: Ensure 'cibadmin -R/--replace' commands get replies - xml: Correctly initialize and find v1-style patch version numbers - crm_mon: Add -R switch to show clone details - Build: Install compatibility.h - fencing: Teach stonith-ng about finding device and topology changes in the v2 patch format - crm_report: Additional dlm detail - crm_report: Allow ssh alternatives to be used - crmd: Correctly recognise operation cancellations we initiated - crmd: Improved logging of transition cancellations - crmd: Correctly detect lrm refreshes - crmd: Ignore 'move' operations to the cib, we only care about content changes - PE: Ensure instance numbers are preserved for cloned templates - Bug cl#5196 - PE: Check values after expanding templates - crm_mon: Ensure resource attributes have been unpacked before displaying connectivity data - Upstream version cs: ca8234daf2bbb2d0fd2fb47cdbb6667f892081bb - pengine: Support id-ref in nvpair with optional "name" (FATE#316118) * pacemaker-pengine-nvpair-id-ref.patch * pacemaker-pengine-nvpair-id-ref-test.patch OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=111
2014-03-03 07:56:37 +00:00
--- /dev/null
+++ b/xml/nvset-1.3.rng
@@ -0,0 +1,45 @@
- xml: Memory leak when free'ing xml documents - systemd: Prevent use-of-NULL when determining if an agent exists - xml: Fix segfault in TRACKING_CHANGES() - PE: Memory leak when updating cancel operations - xml: Prevent memory leak in xml _private field - pengine: Performance increase, stack allocated score2char - crm_report: Only gather dlm data if dlm_controld is running - Fix: memory leak found by valgrind was corrected. - Fencing: Add the ability to call stonith_api_time() from stonith_admin - Fencing: Pass the correct options when looking up the history by node name - cib: Ensure 'cibadmin -R/--replace' commands get replies - xml: Correctly initialize and find v1-style patch version numbers - crm_mon: Add -R switch to show clone details - Build: Install compatibility.h - fencing: Teach stonith-ng about finding device and topology changes in the v2 patch format - crm_report: Additional dlm detail - crm_report: Allow ssh alternatives to be used - crmd: Correctly recognise operation cancellations we initiated - crmd: Improved logging of transition cancellations - crmd: Correctly detect lrm refreshes - crmd: Ignore 'move' operations to the cib, we only care about content changes - PE: Ensure instance numbers are preserved for cloned templates - Bug cl#5196 - PE: Check values after expanding templates - crm_mon: Ensure resource attributes have been unpacked before displaying connectivity data - Upstream version cs: ca8234daf2bbb2d0fd2fb47cdbb6667f892081bb - pengine: Support id-ref in nvpair with optional "name" (FATE#316118) * pacemaker-pengine-nvpair-id-ref.patch * pacemaker-pengine-nvpair-id-ref-test.patch OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=111
2014-03-03 07:56:37 +00:00
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- types: http://www.w3.org/TR/xmlschema-2/#dateTime -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <start>
+ <ref name="element-nvset"/>
+ </start>
+
+ <define name="element-nvset">
+ <choice>
+ <attribute name="id-ref"><data type="IDREF"/></attribute>
+ <group>
+ <attribute name="id"><data type="ID"/></attribute>
+ <interleave>
+ <optional>
+ <externalRef href="rule.rng"/>
+ </optional>
+ <zeroOrMore>
+ <element name="nvpair">
+ <choice>
+ <group>
+ <attribute name="id-ref"><data type="IDREF"/></attribute>
+ <optional>
+ <attribute name="name"><text/></attribute>
+ </optional>
+ </group>
+ <group>
+ <attribute name="id"><data type="ID"/></attribute>
+ <attribute name="name"><text/></attribute>
+ <optional>
+ <attribute name="value"><text/></attribute>
+ </optional>
+ </group>
+ </choice>
+ </element>
+ </zeroOrMore>
+ <optional>
+ <externalRef href="score.rng"/>
+ </optional>
+ </interleave>
+ </group>
+ </choice>
+ </define>
+
+</grammar>
diff --git a/xml/resources-1.3.rng b/xml/resources-1.3.rng
index a3640d1..9faf9fc 100644
--- a/xml/resources-1.3.rng
+++ b/xml/resources-1.3.rng
@@ -53,7 +53,7 @@
<ref name="element-operations"/>
<zeroOrMore>
<element name="utilization">
- <externalRef href="nvset.rng"/>
+ <externalRef href="nvset-1.3.rng"/>
</element>
</zeroOrMore>
</interleave>
@@ -86,7 +86,7 @@
<ref name="element-operations"/>
<zeroOrMore>
<element name="utilization">
- <externalRef href="nvset.rng"/>
+ <externalRef href="nvset-1.3.rng"/>
</element>
</zeroOrMore>
</interleave>
@@ -144,10 +144,10 @@
<zeroOrMore>
<choice>
<element name="meta_attributes">
- <externalRef href="nvset.rng"/>
+ <externalRef href="nvset-1.3.rng"/>
- xml: Memory leak when free'ing xml documents - systemd: Prevent use-of-NULL when determining if an agent exists - xml: Fix segfault in TRACKING_CHANGES() - PE: Memory leak when updating cancel operations - xml: Prevent memory leak in xml _private field - pengine: Performance increase, stack allocated score2char - crm_report: Only gather dlm data if dlm_controld is running - Fix: memory leak found by valgrind was corrected. - Fencing: Add the ability to call stonith_api_time() from stonith_admin - Fencing: Pass the correct options when looking up the history by node name - cib: Ensure 'cibadmin -R/--replace' commands get replies - xml: Correctly initialize and find v1-style patch version numbers - crm_mon: Add -R switch to show clone details - Build: Install compatibility.h - fencing: Teach stonith-ng about finding device and topology changes in the v2 patch format - crm_report: Additional dlm detail - crm_report: Allow ssh alternatives to be used - crmd: Correctly recognise operation cancellations we initiated - crmd: Improved logging of transition cancellations - crmd: Correctly detect lrm refreshes - crmd: Ignore 'move' operations to the cib, we only care about content changes - PE: Ensure instance numbers are preserved for cloned templates - Bug cl#5196 - PE: Check values after expanding templates - crm_mon: Ensure resource attributes have been unpacked before displaying connectivity data - Upstream version cs: ca8234daf2bbb2d0fd2fb47cdbb6667f892081bb - pengine: Support id-ref in nvpair with optional "name" (FATE#316118) * pacemaker-pengine-nvpair-id-ref.patch * pacemaker-pengine-nvpair-id-ref-test.patch OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=111
2014-03-03 07:56:37 +00:00
</element>
<element name="instance_attributes">
- <externalRef href="nvset.rng"/>
+ <externalRef href="nvset-1.3.rng"/>
- xml: Memory leak when free'ing xml documents - systemd: Prevent use-of-NULL when determining if an agent exists - xml: Fix segfault in TRACKING_CHANGES() - PE: Memory leak when updating cancel operations - xml: Prevent memory leak in xml _private field - pengine: Performance increase, stack allocated score2char - crm_report: Only gather dlm data if dlm_controld is running - Fix: memory leak found by valgrind was corrected. - Fencing: Add the ability to call stonith_api_time() from stonith_admin - Fencing: Pass the correct options when looking up the history by node name - cib: Ensure 'cibadmin -R/--replace' commands get replies - xml: Correctly initialize and find v1-style patch version numbers - crm_mon: Add -R switch to show clone details - Build: Install compatibility.h - fencing: Teach stonith-ng about finding device and topology changes in the v2 patch format - crm_report: Additional dlm detail - crm_report: Allow ssh alternatives to be used - crmd: Correctly recognise operation cancellations we initiated - crmd: Improved logging of transition cancellations - crmd: Correctly detect lrm refreshes - crmd: Ignore 'move' operations to the cib, we only care about content changes - PE: Ensure instance numbers are preserved for cloned templates - Bug cl#5196 - PE: Check values after expanding templates - crm_mon: Ensure resource attributes have been unpacked before displaying connectivity data - Upstream version cs: ca8234daf2bbb2d0fd2fb47cdbb6667f892081bb - pengine: Support id-ref in nvpair with optional "name" (FATE#316118) * pacemaker-pengine-nvpair-id-ref.patch * pacemaker-pengine-nvpair-id-ref-test.patch OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=111
2014-03-03 07:56:37 +00:00
</element>
</choice>
</zeroOrMore>