mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-26 14:03:49 +03:00
storage: match RNG to supported driver types
At one point, the code passed through arbitrary strings for file formats, which supposedly lets qemu handle a new file type even before libvirt has been taught to handle it. However, to properly label files, libvirt has to learn the file type anyway, so we might as well make our life easier by only accepting file types that we are prepared to handle. This patch lets the RNG validation ensure that only known strings are let through. * docs/schemas/domaincommon.rng (driverFormat): Limit to list of supported strings. * docs/schemas/domainsnapshot.rng (driver): Likewise.
This commit is contained in:
parent
41e0edaf84
commit
e2c41e4860
@ -1188,11 +1188,32 @@
|
||||
<ref name="genericName"/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="type">
|
||||
<ref name="genericName"/>
|
||||
<attribute name='type'>
|
||||
<choice>
|
||||
<ref name='diskFormat'/>
|
||||
<value>aio</value> <!-- back-compat for 'raw' -->
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</define>
|
||||
<define name='diskFormat'>
|
||||
<choice>
|
||||
<value>raw</value>
|
||||
<value>dir</value>
|
||||
<value>bochs</value>
|
||||
<value>cloop</value>
|
||||
<value>cow</value>
|
||||
<value>dmg</value>
|
||||
<value>iso</value>
|
||||
<value>qcow</value>
|
||||
<value>qcow2</value>
|
||||
<value>qed</value>
|
||||
<value>vmdk</value>
|
||||
<value>vpc</value>
|
||||
<value>fat</value>
|
||||
<value>vhd</value>
|
||||
</choice>
|
||||
</define>
|
||||
<define name="driverCache">
|
||||
<attribute name="cache">
|
||||
<choice>
|
||||
@ -3356,7 +3377,7 @@
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name='format'>
|
||||
<ref name="genericName"/>
|
||||
<ref name='diskFormat'/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
|
@ -105,7 +105,7 @@
|
||||
<element name='driver'>
|
||||
<optional>
|
||||
<attribute name='type'>
|
||||
<ref name='genericName'/>
|
||||
<ref name='diskFormat'/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<empty/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user