mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-03 04:45:46 +00:00
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: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
c5fa3adf67
commit
4fc8449691
@ -8872,6 +8872,7 @@ virSecurityDeviceLabelDefParseXML(virSecurityDeviceLabelDefPtr **seclabels_rtn,
|
|||||||
xmlXPathContextPtr ctxt,
|
xmlXPathContextPtr ctxt,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
VIR_XPATH_NODE_AUTORESTORE(ctxt);
|
||||||
virSecurityDeviceLabelDefPtr *seclabels = NULL;
|
virSecurityDeviceLabelDefPtr *seclabels = NULL;
|
||||||
size_t nseclabels = 0;
|
size_t nseclabels = 0;
|
||||||
int n;
|
int n;
|
||||||
|
@ -311,6 +311,9 @@
|
|||||||
<backingStore type='file' index='1'>
|
<backingStore type='file' index='1'>
|
||||||
<format type='qcow2'/>
|
<format type='qcow2'/>
|
||||||
<source file='/var/lib/libvirt/images/base.qcow2'>
|
<source file='/var/lib/libvirt/images/base.qcow2'>
|
||||||
|
<seclabel model='dac' relabel='yes'>
|
||||||
|
<label>qemu:qemu</label>
|
||||||
|
</seclabel>
|
||||||
<reservations managed='yes'>
|
<reservations managed='yes'>
|
||||||
<source type='unix' path='/somepath/ux.sck' mode='client'/>
|
<source type='unix' path='/somepath/ux.sck' mode='client'/>
|
||||||
</reservations>
|
</reservations>
|
||||||
|
Loading…
Reference in New Issue
Block a user