From: Luyao Huang Date: Thu, 21 May 2015 05:08:12 +0000 (+0800) Subject: conf: Restore the XML parser context in virDomainMemoryDefParseXML X-Git-Tag: v1.2.16-rc1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aef2a0a26c42efeedd25ad570269f5f1cc9da6b5;p=thirdparty%2Flibvirt.git 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 --- 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 + + + +