xml: share 'unit' in RNG
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.
2012-02-29 12:16:28 +08:00
|
|
|
<?xml version="1.0"?>
|
2009-08-05 17:56:56 +08:00
|
|
|
<!-- A Relax NG schema for the libvirt storage volume XML format -->
|
2009-01-27 23:29:53 +08:00
|
|
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
|
|
|
|
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
xml: share 'unit' in RNG
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.
2012-02-29 12:16:28 +08:00
|
|
|
<include href='basictypes.rng'/>
|
2009-01-27 23:29:53 +08:00
|
|
|
<start>
|
|
|
|
<ref name='vol'/>
|
|
|
|
</start>
|
|
|
|
|
2014-04-12 09:33:45 +08:00
|
|
|
<include href='storagecommon.rng'/>
|
2009-07-21 06:28:11 +08:00
|
|
|
|
2009-01-27 23:29:53 +08:00
|
|
|
|
|
|
|
<define name='vol'>
|
|
|
|
<element name='volume'>
|
2013-11-20 04:14:54 +08:00
|
|
|
<optional>
|
|
|
|
<attribute name='type'>
|
|
|
|
<choice>
|
|
|
|
<value>file</value>
|
|
|
|
<value>block</value>
|
|
|
|
<value>dir</value>
|
|
|
|
<value>network</value>
|
2013-11-19 07:43:06 +08:00
|
|
|
<value>netdir</value>
|
2013-11-20 04:14:54 +08:00
|
|
|
</choice>
|
|
|
|
</attribute>
|
|
|
|
</optional>
|
2013-11-23 03:40:15 +08:00
|
|
|
<interleave>
|
|
|
|
<element name='name'>
|
|
|
|
<ref name='volName'/>
|
2010-03-02 03:09:26 +08:00
|
|
|
</element>
|
2013-11-23 03:40:15 +08:00
|
|
|
<optional>
|
|
|
|
<element name='key'>
|
|
|
|
<text/>
|
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
<optional>
|
|
|
|
<ref name='source'/>
|
|
|
|
</optional>
|
|
|
|
<ref name='sizing'/>
|
|
|
|
<ref name='target'/>
|
|
|
|
<optional>
|
|
|
|
<ref name='backingStore'/>
|
|
|
|
</optional>
|
|
|
|
</interleave>
|
2009-01-27 23:29:53 +08:00
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name='sizing'>
|
2013-11-23 03:40:15 +08:00
|
|
|
<interleave>
|
|
|
|
<optional>
|
|
|
|
<element name='capacity'>
|
|
|
|
<ref name='scaledInteger'/>
|
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
<optional>
|
|
|
|
<element name='allocation'>
|
|
|
|
<ref name='scaledInteger'/>
|
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
</interleave>
|
2009-01-27 23:29:53 +08:00
|
|
|
</define>
|
|
|
|
|
2012-07-25 15:43:37 +08:00
|
|
|
<define name='timestamps'>
|
|
|
|
<optional>
|
|
|
|
<element name='timestamps'>
|
|
|
|
<interleave>
|
|
|
|
<optional>
|
|
|
|
<element name='atime'>
|
|
|
|
<ref name='timestamp'/>
|
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
<optional>
|
|
|
|
<element name='btime'>
|
|
|
|
<ref name='timestamp'/>
|
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
<optional>
|
|
|
|
<element name='ctime'>
|
|
|
|
<ref name='timestamp'/>
|
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
<optional>
|
|
|
|
<element name='mtime'>
|
|
|
|
<ref name='timestamp'/>
|
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
</interleave>
|
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name='timestamp'>
|
|
|
|
<data type='string'>
|
|
|
|
<param name="pattern">[0-9]+(\.[0-9]{0,9})?</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
|
|
|
|
2009-01-27 23:29:53 +08:00
|
|
|
<define name='target'>
|
|
|
|
<element name='target'>
|
2013-11-23 03:40:15 +08:00
|
|
|
<interleave>
|
|
|
|
<optional>
|
|
|
|
<element name='path'>
|
|
|
|
<choice>
|
|
|
|
<data type='anyURI'/>
|
|
|
|
<ref name='absFilePath'/>
|
|
|
|
</choice>
|
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
<ref name='format'/>
|
|
|
|
<ref name='permissions'/>
|
|
|
|
<ref name='timestamps'/>
|
|
|
|
<optional>
|
|
|
|
<ref name='encryption'/>
|
|
|
|
</optional>
|
|
|
|
<optional>
|
|
|
|
<ref name='compat'/>
|
|
|
|
</optional>
|
2014-07-15 16:49:46 +08:00
|
|
|
<optional>
|
|
|
|
<element name='nocow'>
|
|
|
|
<empty/>
|
|
|
|
</element>
|
|
|
|
</optional>
|
2013-11-23 03:40:15 +08:00
|
|
|
<optional>
|
|
|
|
<ref name='fileFormatFeatures'/>
|
|
|
|
</optional>
|
|
|
|
</interleave>
|
2009-01-27 23:29:53 +08:00
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name='backingStore'>
|
|
|
|
<element name='backingStore'>
|
2013-11-23 03:40:15 +08:00
|
|
|
<interleave>
|
|
|
|
<element name='path'>
|
|
|
|
<ref name='absFilePath'/>
|
|
|
|
</element>
|
|
|
|
<ref name='format'/>
|
|
|
|
<ref name='permissions'/>
|
|
|
|
</interleave>
|
2009-01-27 23:29:53 +08:00
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
|
|
|
|
<define name='source'>
|
|
|
|
<element name='source'>
|
|
|
|
<zeroOrMore>
|
2010-03-02 03:09:26 +08:00
|
|
|
<ref name='sourcedev'/>
|
2009-01-27 23:29:53 +08:00
|
|
|
</zeroOrMore>
|
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name='sourcedev'>
|
|
|
|
<element name='device'>
|
|
|
|
<attribute name='path'>
|
xml: share 'unit' in RNG
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.
2012-02-29 12:16:28 +08:00
|
|
|
<ref name='absFilePath'/>
|
2009-01-27 23:29:53 +08:00
|
|
|
</attribute>
|
|
|
|
<choice>
|
2010-03-02 03:09:26 +08:00
|
|
|
<empty/>
|
|
|
|
<ref name='devextents'/>
|
2009-01-27 23:29:53 +08:00
|
|
|
</choice>
|
|
|
|
</element>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name='devextents'>
|
|
|
|
<oneOrMore>
|
|
|
|
<element name='extent'>
|
2010-03-02 03:09:26 +08:00
|
|
|
<attribute name='start'>
|
xml: share 'unit' in RNG
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.
2012-02-29 12:16:28 +08:00
|
|
|
<ref name='unsignedLong'/>
|
2010-03-02 03:09:26 +08:00
|
|
|
</attribute>
|
|
|
|
<attribute name='end'>
|
xml: share 'unit' in RNG
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.
2012-02-29 12:16:28 +08:00
|
|
|
<ref name='unsignedLong'/>
|
2010-03-02 03:09:26 +08:00
|
|
|
</attribute>
|
2009-01-27 23:29:53 +08:00
|
|
|
</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>
|
2013-02-26 20:41:21 +08:00
|
|
|
<value>ocfs2</value>
|
2009-01-27 23:29:53 +08:00
|
|
|
</choice>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
<define name='formatfile'>
|
|
|
|
<choice>
|
2012-07-19 03:06:58 +08:00
|
|
|
<value>unknown</value>
|
2014-04-15 06:54:13 +08:00
|
|
|
<ref name='storageFormat'/>
|
2009-01-27 23:29:53 +08:00
|
|
|
</choice>
|
|
|
|
</define>
|
|
|
|
|
2013-03-20 19:53:32 +08:00
|
|
|
<define name='formatdisk'>
|
|
|
|
<choice>
|
|
|
|
<value>none</value>
|
|
|
|
<value>linux</value>
|
|
|
|
<value>fat16</value>
|
|
|
|
<value>fat32</value>
|
|
|
|
<value>linux-swap</value>
|
|
|
|
<value>linux-lvm</value>
|
|
|
|
<value>linux-raid</value>
|
|
|
|
<value>extended</value>
|
|
|
|
</choice>
|
|
|
|
</define>
|
|
|
|
|
2009-01-27 23:29:53 +08:00
|
|
|
<define name='format'>
|
|
|
|
<optional>
|
|
|
|
<element name='format'>
|
2010-03-02 03:09:26 +08:00
|
|
|
<attribute name='type'>
|
|
|
|
<choice>
|
|
|
|
<ref name='formatfile'/>
|
|
|
|
<ref name='formatdev'/>
|
2013-03-20 19:53:32 +08:00
|
|
|
<ref name='formatdisk'/>
|
2010-03-02 03:09:26 +08:00
|
|
|
</choice>
|
|
|
|
</attribute>
|
2009-01-27 23:29:53 +08:00
|
|
|
</element>
|
|
|
|
</optional>
|
|
|
|
</define>
|
|
|
|
|
|
|
|
</grammar>
|