]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Restore the XML parser context in virDomainMemoryDefParseXML
authorLuyao Huang <lhuang@redhat.com>
Thu, 21 May 2015 05:08:12 +0000 (13:08 +0800)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 21 May 2015 09:06:18 +0000 (11:06 +0200)
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 <idmap> 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 <lhuang@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
src/conf/domain_conf.c
tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.xml

index b3cef0d502f9dd9a1ac53ab6bde60a9d87592341..394890e8be00218b2100e591ed6b665f27ed7a98 100644 (file)
@@ -11836,6 +11836,7 @@ virDomainMemoryDefParseXML(xmlNodePtr memdevNode,
     if (virDomainDeviceInfoParseXML(memdevNode, NULL, &def->info, flags) < 0)
         goto error;
 
+    ctxt->node = save;
     return def;
 
  error:
index 78088e2127cb367976cb57358582cd78fd8b5c3d..fa6013abc27d2a1c727a1808aaf41a72fd3817f4 100644 (file)
@@ -9,6 +9,10 @@
     <type arch='i686' machine='pc'>hvm</type>
     <boot dev='hd'/>
   </os>
+  <idmap>
+    <uid start='0' target='1000' count='10'/>
+    <gid start='0' target='1000' count='10'/>
+  </idmap>
   <cpu>
     <topology sockets='2' cores='1' threads='1'/>
     <numa>