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