libvirt/docs/schemas/storagevol.rng

226 lines
5.0 KiB
Plaintext
Raw Normal View History

<?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='volName'/>
</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'>
xml: output memory unit for clarity Make it obvious to 'dumpxml' readers what unit we are using, since our default of KiB for memory (1024) differs from qemu's default of MiB; and differs from our use of bytes for storage. Tests were updated via: $ find tests/*data tests/*out -name '*.xml' | \ xargs sed -i 's/<\(memory\|currentMemory\|hard_limit\|soft_limit\|min_guarantee\|swap_hard_limit\)>/<\1 unit='"'KiB'>/" $ find tests/*data tests/*out -name '*.xml' | \ xargs sed -i 's/<\(capacity\|allocation\|available\)>/<\1 unit='"'bytes'>/" followed by a few fixes for the stragglers. Note that with this patch, the RNG for <memory> still forbids validation of anything except unit='KiB', since the code silently ignores the attribute; a later patch will expand <memory> to allow scaled input in the code and update the RNG to match. * docs/schemas/basictypes.rng (unit): Add 'bytes'. (scaledInteger): New define. * docs/schemas/storagevol.rng (sizing): Use it. * docs/schemas/storagepool.rng (sizing): Likewise. * docs/schemas/domaincommon.rng (memoryKBElement): New define; use for memory elements. * src/conf/storage_conf.c (virStoragePoolDefFormat) (virStorageVolDefFormat): Likewise. * src/conf/domain_conf.h (_virDomainDef): Document unit used internally. * src/conf/storage_conf.h (_virStoragePoolDef, _virStorageVolDef): Likewise. * tests/*data/*.xml: Update all tests. * tests/*out/*.xml: Likewise. * tests/define-dev-segfault: Likewise. * tests/openvzutilstest.c (testReadNetworkConf): Likewise. * tests/qemuargv2xmltest.c (blankProblemElements): Likewise.
2012-02-23 00:48:38 +00:00
<ref name='scaledInteger'/>
</element>
</optional>
<optional>
<element name='allocation'>
xml: output memory unit for clarity Make it obvious to 'dumpxml' readers what unit we are using, since our default of KiB for memory (1024) differs from qemu's default of MiB; and differs from our use of bytes for storage. Tests were updated via: $ find tests/*data tests/*out -name '*.xml' | \ xargs sed -i 's/<\(memory\|currentMemory\|hard_limit\|soft_limit\|min_guarantee\|swap_hard_limit\)>/<\1 unit='"'KiB'>/" $ find tests/*data tests/*out -name '*.xml' | \ xargs sed -i 's/<\(capacity\|allocation\|available\)>/<\1 unit='"'bytes'>/" followed by a few fixes for the stragglers. Note that with this patch, the RNG for <memory> still forbids validation of anything except unit='KiB', since the code silently ignores the attribute; a later patch will expand <memory> to allow scaled input in the code and update the RNG to match. * docs/schemas/basictypes.rng (unit): Add 'bytes'. (scaledInteger): New define. * docs/schemas/storagevol.rng (sizing): Use it. * docs/schemas/storagepool.rng (sizing): Likewise. * docs/schemas/domaincommon.rng (memoryKBElement): New define; use for memory elements. * src/conf/storage_conf.c (virStoragePoolDefFormat) (virStorageVolDefFormat): Likewise. * src/conf/domain_conf.h (_virDomainDef): Document unit used internally. * src/conf/storage_conf.h (_virStoragePoolDef, _virStorageVolDef): Likewise. * tests/*data/*.xml: Update all tests. * tests/*out/*.xml: Likewise. * tests/define-dev-segfault: Likewise. * tests/openvzutilstest.c (testReadNetworkConf): Likewise. * tests/qemuargv2xmltest.c (blankProblemElements): Likewise.
2012-02-23 00:48:38 +00:00
<ref name='scaledInteger'/>
</element>
</optional>
</define>
<define name='permissions'>
<optional>
<element name='permissions'>
<element name='mode'>
<ref name='octalMode'/>
</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='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>
<define name='target'>
<element name='target'>
<optional>
<element name='path'>
<data type='anyURI'/>
</element>
</optional>
<ref name='format'/>
<ref name='permissions'/>
<ref name='timestamps'/>
<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>
<value>ocfs2</value>
</choice>
</define>
<define name='formatfile'>
<choice>
<value>unknown</value>
<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>
</choice>
</define>
<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>
<define name='format'>
<optional>
<element name='format'>
<attribute name='type'>
<choice>
<ref name='formatfile'/>
<ref name='formatdev'/>
<ref name='formatdisk'/>
</choice>
</attribute>
</element>
</optional>
</define>
</grammar>