From aef2a0a26c42efeedd25ad570269f5f1cc9da6b5 Mon Sep 17 00:00:00 2001 From: Luyao Huang Date: Thu, 21 May 2015 13:08:12 +0800 Subject: [PATCH] conf: Restore the XML parser context in virDomainMemoryDefParseXML After parsing the memory device XML the function would not restore the XML parser context causing invalid XPath starting point for the rest of the elements. This is a regression since 3e4230d2. The test case addition uses the element that is currently unused by qemu, but parsed after the memory device definition and formatted always. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1223631 Signed-off-by: Luyao Huang Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 1 + tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.xml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b3cef0d502..394890e8be 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11836,6 +11836,7 @@ virDomainMemoryDefParseXML(xmlNodePtr memdevNode, if (virDomainDeviceInfoParseXML(memdevNode, NULL, &def->info, flags) < 0) goto error; + ctxt->node = save; return def; error: diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.xml b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.xml index 78088e2127..fa6013abc2 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.xml @@ -9,6 +9,10 @@ hvm + + + + -- 2.47.2