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

storage: allow interleave in volume XML

The RNG grammar did not allow arbitrary interleaving, which makes
it harder than necessary to create a new volume from handwritten XML.
(Compare also to commit caf516db for pools).

* docs/schemas/storagevol.rng: Support interleaving.
* tests/storagevolxml2xmlin/vol-file-backing.xml: Test it.
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 d68f1644
......@@ -13,6 +13,7 @@
<define name='vol'>
<element name='volume'>
<interleave>
<element name='name'>
<ref name='volName'/>
</element>
......@@ -29,10 +30,12 @@
<optional>
<ref name='backingStore'/>
</optional>
</interleave>
</element>
</define>
<define name='sizing'>
<interleave>
<optional>
<element name='capacity'>
<ref name='scaledInteger'/>
......@@ -43,11 +46,13 @@
<ref name='scaledInteger'/>
</element>
</optional>
</interleave>
</define>
<define name='permissions'>
<optional>
<element name='permissions'>
<interleave>
<element name='mode'>
<ref name='octalMode'/>
</element>
......@@ -62,6 +67,7 @@
<text/>
</element>
</optional>
</interleave>
</element>
</optional>
</define>
......@@ -103,6 +109,7 @@
<define name='target'>
<element name='target'>
<interleave>
<optional>
<element name='path'>
<choice>
......@@ -123,16 +130,19 @@
<optional>
<ref name='fileFormatFeatures'/>
</optional>
</interleave>
</element>
</define>
<define name='backingStore'>
<element name='backingStore'>
<interleave>
<element name='path'>
<ref name='absFilePath'/>
</element>
<ref name='format'/>
<ref name='permissions'/>
</interleave>
</element>
</define>
......
<volume>
<name>sparse.img</name>
<!-- lines scrambled to test interleaves -->
<key>/var/lib/libvirt/images/sparse.img</key>
<source/>
<capacity unit='GB'>10</capacity>
<allocation unit='MiB'>0</allocation>
<source/>
<target>
<path>/var/lib/libvirt/images/sparse.img</path>
<permissions>
<mode>0</mode>
<owner>0744</owner>
<mode>0</mode>
<group>0</group>
</permissions>
<path>/var/lib/libvirt/images/sparse.img</path>
</target>
<allocation unit='MiB'>0</allocation>
<backingStore>
<path>/var/lib/virt/images/master.img</path>
<format type='vmdk'/>
<path>/var/lib/virt/images/master.img</path>
<permissions>
<mode>0744</mode>
<label>virt_image_t</label>
<owner>1</owner>
<group>1</group>
<label>virt_image_t</label>
</permissions>
</backingStore>
<name>sparse.img</name>
</volume>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册