提交 4fc84496 编写于 作者: P Peter Krempa

conf: domain: Restore XPath context after virSecurityDeviceLabelDefParseXML

The function modifies the context but did not care to restore it back.
If a <seclabel> was used on a disk, the <privateData> would not be
parsed.

Use VIR_XPATH_NODE_AUTORESTORE and add a test case to validate that
everything works.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 c5fa3adf
......@@ -8872,6 +8872,7 @@ virSecurityDeviceLabelDefParseXML(virSecurityDeviceLabelDefPtr **seclabels_rtn,
xmlXPathContextPtr ctxt,
unsigned int flags)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt);
virSecurityDeviceLabelDefPtr *seclabels = NULL;
size_t nseclabels = 0;
int n;
......
......@@ -311,6 +311,9 @@
<backingStore type='file' index='1'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/base.qcow2'>
<seclabel model='dac' relabel='yes'>
<label>qemu:qemu</label>
</seclabel>
<reservations managed='yes'>
<source type='unix' path='/somepath/ux.sck' mode='client'/>
</reservations>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册