提交 e2c41e48 编写于 作者: E Eric Blake

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.
上级 41e0edaf
......@@ -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/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册