mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
rng: Forbid to validate mismatched <disk> 'device' and 'type' attributes
According to docs, using 'lun' as a value for device attribute is only valid with disk types 'block' and 'network'. However current RNG schema also allows a combination type='file' device='lun' which results in a successfull xml validation, but fails at qemuBuildCommandLine. Besides fixing the RNG schema, this patch also adds a qemuxml2argvtest for this case. https://bugzilla.redhat.com/show_bug.cgi?id=1210669
This commit is contained in:
@@ -1180,12 +1180,14 @@
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<interleave>
|
||||
<ref name="diskSource"/>
|
||||
<ref name="diskSpecsExtra"/>
|
||||
</interleave>
|
||||
</group>
|
||||
<group>
|
||||
<attribute name="device">
|
||||
<choice>
|
||||
<value>lun</value>
|
||||
</choice>
|
||||
<value>lun</value>
|
||||
</attribute>
|
||||
<optional>
|
||||
<ref name="rawIO"/>
|
||||
@@ -1198,19 +1200,28 @@
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<interleave>
|
||||
<choice>
|
||||
<ref name="diskSourceNetwork"/>
|
||||
<ref name="diskSourceBlock"/>
|
||||
</choice>
|
||||
<ref name="diskSpecsExtra"/>
|
||||
</interleave>
|
||||
</group>
|
||||
</choice>
|
||||
<optional>
|
||||
<ref name="snapshot"/>
|
||||
</optional>
|
||||
<interleave>
|
||||
<ref name="diskSource"/>
|
||||
<ref name="storageSourceExtra"/>
|
||||
<ref name="diskBackingChain"/>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name="diskSpecsExtra">
|
||||
<interleave>
|
||||
<ref name="storageSourceExtra"/>
|
||||
<ref name="diskBackingChain"/>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name="diskBackingChain">
|
||||
<choice>
|
||||
<ref name="diskBackingStore"/>
|
||||
|
||||
Reference in New Issue
Block a user