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:
Erik Skultety
2015-04-17 13:14:12 +02:00
parent e4725cdb12
commit cea1b86fa7
3 changed files with 49 additions and 8 deletions

View File

@@ -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"/>