mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-20 11:48:28 -06:00
The code supported unit='E' for "exabyte", but the RNG did not; conversely, the RNG supported "z" and "y" but the code did not (I'm jealous if you have that much storage, particularly since it won't fit in 64-bit off_t). Also, the code supported <allocation unit='...'>, but not the RNG. In an effort to make 'unit' more worthwhile in future patches, it's easier to share it between files. In making this factorization, note that absFilePath is more permissive than 'path', so storage pools and storage volumes will now validate with a wider set of file names than before. I don't think this should be a problem in practice. * docs/schemas/storagepool.rng: Include basic types, rather than repeating things here. * docs/schemas/storagevol.rng: Likewise. * docs/schemas/basictypes.rng: Add 'unsignedLong', 'unit', and fix to match storage code.
191 lines
4.1 KiB
XML
191 lines
4.1 KiB
XML
<?xml version="1.0"?>
|
|
<!-- A Relax NG schema for the libvirt storage volume XML format -->
|
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
|
|
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
<include href='basictypes.rng'/>
|
|
<start>
|
|
<ref name='vol'/>
|
|
</start>
|
|
|
|
<include href='storageencryption.rng'/>
|
|
|
|
|
|
<define name='vol'>
|
|
<element name='volume'>
|
|
<element name='name'>
|
|
<ref name='name'/>
|
|
</element>
|
|
<optional>
|
|
<element name='key'>
|
|
<text/>
|
|
</element>
|
|
</optional>
|
|
<ref name='source'/>
|
|
<ref name='sizing'/>
|
|
<ref name='target'/>
|
|
<optional>
|
|
<ref name='backingStore'/>
|
|
</optional>
|
|
</element>
|
|
</define>
|
|
|
|
<define name='sizing'>
|
|
<optional>
|
|
<element name='capacity'>
|
|
<optional>
|
|
<attribute name='unit'>
|
|
<ref name='unit'/>
|
|
</attribute>
|
|
</optional>
|
|
<ref name='unsignedLong'/>
|
|
</element>
|
|
</optional>
|
|
<optional>
|
|
<element name='allocation'>
|
|
<optional>
|
|
<attribute name='unit'>
|
|
<ref name='unit'/>
|
|
</attribute>
|
|
</optional>
|
|
<ref name='unsignedLong'/>
|
|
</element>
|
|
</optional>
|
|
</define>
|
|
|
|
<define name='permissions'>
|
|
<optional>
|
|
<element name='permissions'>
|
|
<element name='mode'>
|
|
<ref name='unsignedInt'/>
|
|
</element>
|
|
<element name='owner'>
|
|
<ref name='unsignedInt'/>
|
|
</element>
|
|
<element name='group'>
|
|
<ref name='unsignedInt'/>
|
|
</element>
|
|
<optional>
|
|
<element name='label'>
|
|
<text/>
|
|
</element>
|
|
</optional>
|
|
</element>
|
|
</optional>
|
|
</define>
|
|
|
|
<define name='target'>
|
|
<element name='target'>
|
|
<optional>
|
|
<element name='path'>
|
|
<ref name='absFilePath'/>
|
|
</element>
|
|
</optional>
|
|
<ref name='format'/>
|
|
<ref name='permissions'/>
|
|
<optional>
|
|
<ref name='encryption'/>
|
|
</optional>
|
|
</element>
|
|
</define>
|
|
|
|
<define name='backingStore'>
|
|
<element name='backingStore'>
|
|
<element name='path'>
|
|
<ref name='absFilePath'/>
|
|
</element>
|
|
<ref name='format'/>
|
|
<ref name='permissions'/>
|
|
</element>
|
|
</define>
|
|
|
|
|
|
<define name='source'>
|
|
<element name='source'>
|
|
<zeroOrMore>
|
|
<ref name='sourcedev'/>
|
|
</zeroOrMore>
|
|
</element>
|
|
</define>
|
|
|
|
<define name='sourcedev'>
|
|
<element name='device'>
|
|
<attribute name='path'>
|
|
<ref name='absFilePath'/>
|
|
</attribute>
|
|
<choice>
|
|
<empty/>
|
|
<ref name='devextents'/>
|
|
</choice>
|
|
</element>
|
|
</define>
|
|
|
|
<define name='devextents'>
|
|
<oneOrMore>
|
|
<element name='extent'>
|
|
<attribute name='start'>
|
|
<ref name='unsignedLong'/>
|
|
</attribute>
|
|
<attribute name='end'>
|
|
<ref name='unsignedLong'/>
|
|
</attribute>
|
|
</element>
|
|
</oneOrMore>
|
|
</define>
|
|
|
|
<define name='formatdev'>
|
|
<choice>
|
|
<value>none</value>
|
|
<value>auto</value>
|
|
<value>ext2</value>
|
|
<value>ext3</value>
|
|
<value>ext4</value>
|
|
<value>ufs</value>
|
|
<value>iso9660</value>
|
|
<value>udf</value>
|
|
<value>gfs</value>
|
|
<value>gfs2</value>
|
|
<value>vfat</value>
|
|
<value>hfs+</value>
|
|
<value>xfs</value>
|
|
</choice>
|
|
|
|
</define>
|
|
|
|
|
|
<define name='formatfile'>
|
|
<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>vmdk</value>
|
|
<value>vpc</value>
|
|
</choice>
|
|
</define>
|
|
|
|
<define name='format'>
|
|
<optional>
|
|
<element name='format'>
|
|
<attribute name='type'>
|
|
<choice>
|
|
<ref name='formatfile'/>
|
|
<ref name='formatdev'/>
|
|
</choice>
|
|
</attribute>
|
|
</element>
|
|
</optional>
|
|
</define>
|
|
|
|
<define name='name'>
|
|
<data type='string'>
|
|
<param name="pattern">[a-zA-Z0-9_\+\-\.]+</param>
|
|
</data>
|
|
</define>
|
|
|
|
</grammar>
|