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 <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>
This commit is contained in:
Luyao Huang 2015-05-21 13:08:12 +08:00 committed by Peter Krempa
parent bc89ebe564
commit aef2a0a26c
2 changed files with 5 additions and 0 deletions

View File

@ -11836,6 +11836,7 @@ virDomainMemoryDefParseXML(xmlNodePtr memdevNode,
if (virDomainDeviceInfoParseXML(memdevNode, NULL, &def->info, flags) < 0)
goto error;
ctxt->node = save;
return def;
error:

View 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>