libvirt/docs/schemas/storagepool.rng

562 lines
12 KiB
Plaintext
Raw Normal View History

<?xml version="1.0"?>
<!-- A Relax NG schema for the libvirt storage pool 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='pool'/>
</start>
<define name='pool'>
<element name='pool'>
<choice>
<ref name='pooldir'/>
<ref name='poolfs'/>
<ref name='poolnetfs'/>
<ref name='poollogical'/>
<ref name='pooldisk'/>
<ref name='pooliscsi'/>
<ref name='poolscsi'/>
<ref name='poolmpath'/>
<ref name='poolrbd'/>
<ref name='poolsheepdog'/>
</choice>
</element>
</define>
<define name='pooldir'>
<attribute name='type'>
<value>dir</value>
</attribute>
<ref name='commonmetadata'/>
<ref name='sizing'/>
<ref name='sourcedir'/>
<ref name='target'/>
</define>
<define name='poolfs'>
<attribute name='type'>
<value>fs</value>
</attribute>
<ref name='commonmetadata'/>
<ref name='sizing'/>
<ref name='sourcefs'/>
<ref name='target'/>
</define>
<define name='poolnetfs'>
<attribute name='type'>
<value>netfs</value>
</attribute>
<ref name='commonmetadata'/>
<ref name='sizing'/>
<ref name='sourcenetfs'/>
<ref name='target'/>
</define>
<define name='poollogical'>
<attribute name='type'>
<value>logical</value>
</attribute>
<ref name='commonmetadata'/>
<ref name='sizing'/>
<ref name='sourcelogical'/>
<ref name='target'/>
</define>
<define name='pooldisk'>
<attribute name='type'>
<value>disk</value>
</attribute>
<ref name='commonmetadata'/>
<ref name='sizing'/>
<ref name='sourcedisk'/>
<ref name='target'/>
</define>
<define name='pooliscsi'>
<attribute name='type'>
<value>iscsi</value>
</attribute>
<ref name='commonmetadata'/>
<ref name='sizing'/>
<ref name='sourceiscsi'/>
<ref name='target'/>
</define>
<define name='poolscsi'>
<attribute name='type'>
<value>scsi</value>
</attribute>
<ref name='commonmetadata'/>
<ref name='sizing'/>
<ref name='sourcescsi'/>
<ref name='target'/>
</define>
<define name='poolmpath'>
<attribute name='type'>
<value>mpath</value>
</attribute>
<ref name='commonmetadata'/>
<ref name='sizing'/>
<optional>
<ref name='sourcempath'/>
</optional>
<ref name='target'/>
</define>
<define name='poolrbd'>
<attribute name='type'>
<value>rbd</value>
</attribute>
<ref name='commonmetadata'/>
<ref name='sizing'/>
<ref name='sourcerbd'/>
</define>
<define name='poolsheepdog'>
<attribute name='type'>
<value>sheepdog</value>
</attribute>
<ref name='commonmetadata'/>
<ref name='sizing'/>
<ref name='sourcesheepdog'/>
</define>
<define name='sourceinfovendor'>
<optional>
<element name='vendor'>
<attribute name='name'>
<text/>
</attribute>
</element>
</optional>
<optional>
<element name='product'>
<attribute name='name'>
<text/>
</attribute>
</element>
</optional>
</define>
<define name='commonmetadata'>
<element name='name'>
<ref name='genericName'/>
</element>
<optional>
<element name='uuid'>
<ref name='UUID'/>
</element>
</optional>
</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>
<optional>
<element name='available'>
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'>
<choice>
<ref name='unsignedInt'/>
<value>-1</value>
</choice>
</element>
<element name='group'>
<choice>
<ref name='unsignedInt'/>
<value>-1</value>
</choice>
</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='permissions'/>
</element>
</define>
<define name='sourceinfohost'>
<oneOrMore>
<element name='host'>
<attribute name='name'>
<text/>
</attribute>
<optional>
<attribute name='port'>
<ref name="PortNumber"/>
</attribute>
</optional>
<empty/>
</element>
</oneOrMore>
</define>
<define name='sourceinfodev'>
<element name='device'>
<attribute name='path'>
<choice>
<ref name='absFilePath'/>
<ref name='genericName'/>
<ref name='IscsiQualifiedName'/>
</choice>
</attribute>
<choice>
<empty/>
<ref name='devextents'/>
</choice>
</element>
</define>
<define name='initiatorinfo'>
<element name='initiator'>
<element name='iqn'>
<attribute name='name'>
<text/>
</attribute>
<empty/>
</element>
</element>
</define>
<define name='devextents'>
<oneOrMore>
<element name='freeExtent'>
<attribute name='start'>
<ref name='unsignedLong'/>
</attribute>
<attribute name='end'>
<ref name='unsignedLong'/>
</attribute>
</element>
</oneOrMore>
</define>
<define name='sourceinfodir'>
<element name='dir'>
<attribute name='path'>
<ref name='absFilePath'/>
</attribute>
<empty/>
</element>
</define>
<define name='sourceinfoadapter'>
<element name='adapter'>
New XML attributes for storage pool source adapter This introduces 4 new attributes for storage pool source adapter. E.g. <adapter type='fc_host' parent='scsi_host5' wwnn='20000000c9831b4b' wwpn='10000000c9831b4b'/> Attribute 'type' can be either 'scsi_host' or 'fc_host', and defaults to 'scsi_host' if attribute 'name' is specified. I.e. It's optional for 'scsi_host' adapter, for back-compat reason. However, mandatory for 'fc_host' adapter and any new future adapter types. Attribute 'parent' is to specify the parent for the fc_host adapter. * docs/formatstorage.html.in: - Add documents for the 4 new attrs * docs/schemas/storagepool.rng: - Add RNG schema * src/conf/storage_conf.c: - Parse and format the new XMLs * src/conf/storage_conf.h: - New struct virStoragePoolSourceAdapter, replace "char *adapter" with it; - New enum virStoragePoolSourceAdapterType * src/libvirt_private.syms: - Export TypeToString and TypeFromString * src/phyp/phyp_driver.c: - Replace "adapter" with "adapter.data.name", which is member of the union of the new struct virStoragePoolSourceAdapter now. Later patch will add the checking, as "adapter.data.name" is only valid for "scsi_host" adapter. * src/storage/storage_backend_scsi.c: - Like above * tests/storagepoolxml2xmlin/pool-scsi-type-scsi-host.xml: * tests/storagepoolxml2xmlin/pool-scsi-type-fc-host.xml: - New test for 'fc_host' and "scsi_host" adapter * tests/storagepoolxml2xmlout/pool-scsi.xml: - Change the expected output, as the 'type' defaults to 'scsi_host' if 'name" specified now * tests/storagepoolxml2xmlout/pool-scsi-type-scsi-host.xml: * tests/storagepoolxml2xmlout/pool-scsi-type-fc-host.xml: - New test * tests/storagepoolxml2xmltest.c: - Include the test
2013-03-25 16:43:36 +00:00
<choice>
<group>
<!-- To keep back-compat, 'type' is not mandatory for
scsi_host adapter -->
<optional>
<attribute name='type'>
<value>scsi_host</value>
</attribute>
</optional>
<attribute name='name'>
<text/>
</attribute>
</group>
<group>
<attribute name='type'>
<value>fc_host</value>
</attribute>
<optional>
<attribute name='parent'>
<text/>
</attribute>
</optional>
<attribute name='wwnn'>
<ref name='wwn'/>
</attribute>
<attribute name='wwpn'>
<ref name='wwn'/>
</attribute>
</group>
</choice>
<empty/>
</element>
</define>
<define name='sourceinfoname'>
<element name='name'>
<text/>
</element>
</define>
<define name='sourceinfoauth'>
<element name='auth'>
<attribute name='type'>
<choice>
<value>chap</value>
<value>ceph</value>
</choice>
</attribute>
<choice>
<attribute name='login'>
<text/>
</attribute>
<attribute name='username'>
<text/>
</attribute>
</choice>
<optional>
<attribute name='passwd'>
<text/>
</attribute>
</optional>
<optional>
<ref name='sourceinfoauthsecret'/>
</optional>
</element>
</define>
<define name='sourceinfoauthsecret'>
<element name='secret'>
<choice>
<attribute name='uuid'>
<text/>
</attribute>
<attribute name='usage'>
<text/>
</attribute>
</choice>
</element>
</define>
<define name='sourcefmtfs'>
<optional>
<element name='format'>
<attribute name='type'>
<choice>
<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>
</attribute>
</element>
</optional>
</define>
<define name='sourcefmtnetfs'>
<optional>
<element name='format'>
<attribute name='type'>
<choice>
<value>auto</value>
<value>nfs</value>
</choice>
</attribute>
<optional>
<ref name='sourceinfovendor'/>
</optional>
</element>
</optional>
</define>
<define name='sourcefmtdisk'>
<optional>
<element name='format'>
<attribute name='type'>
<choice>
<value>none</value>
<value>dos</value>
<value>dvh</value>
<value>gpt</value>
<value>mac</value>
<value>bsd</value>
<value>pc98</value>
<value>sun</value>
<value>lvm2</value>
</choice>
</attribute>
<optional>
<ref name='sourceinfovendor'/>
</optional>
</element>
</optional>
</define>
<define name='sourcefmtlogical'>
<optional>
<element name='format'>
<attribute name='type'>
<choice>
<value>auto</value>
<value>lvm2</value>
</choice>
</attribute>
<optional>
<ref name='sourceinfovendor'/>
</optional>
</element>
</optional>
</define>
<define name='sourcedir'>
<optional>
<element name='source'>
<empty/>
<optional>
<ref name='sourceinfovendor'/>
</optional>
</element>
</optional>
</define>
<define name='sourcefs'>
<element name='source'>
<ref name='sourceinfodev'/>
<ref name='sourcefmtfs'/>
<optional>
<ref name='sourceinfovendor'/>
</optional>
</element>
</define>
<define name='sourcenetfs'>
<element name='source'>
<ref name='sourceinfohost'/>
<ref name='sourceinfodir'/>
<ref name='sourcefmtnetfs'/>
<optional>
<ref name='sourceinfovendor'/>
</optional>
</element>
</define>
<define name='sourcelogical'>
<element name='source'>
<oneOrMore>
<optional>
<ref name='sourceinfoname'/>
</optional>
<optional>
<ref name='sourceinfodev'/>
</optional>
</oneOrMore>
<ref name='sourcefmtlogical'/>
<optional>
<ref name='sourceinfovendor'/>
</optional>
</element>
</define>
<define name='sourcedisk'>
<element name='source'>
<ref name='sourceinfodev'/>
<ref name='sourcefmtdisk'/>
<optional>
<ref name='sourceinfovendor'/>
</optional>
</element>
</define>
<define name='sourceiscsi'>
<element name='source'>
<ref name='sourceinfohost'/>
<ref name='sourceinfodev'/>
<optional>
<ref name='initiatorinfo'/>
</optional>
<optional>
<ref name='sourceinfoauth'/>
</optional>
<optional>
<ref name='sourceinfovendor'/>
</optional>
</element>
</define>
<define name='sourcescsi'>
<element name='source'>
<ref name='sourceinfoadapter'/>
<optional>
<ref name='sourceinfovendor'/>
</optional>
</element>
</define>
<define name='sourcempath'>
<element name='source'>
<empty/>
</element>
</define>
<define name='sourcerbd'>
<element name='source'>
<ref name='sourceinfoname'/>
<ref name='sourceinfohost'/>
<optional>
<ref name='sourceinfoauth'/>
</optional>
</element>
</define>
<define name='sourcesheepdog'>
<element name='source'>
<ref name='sourceinfohost'/>
<ref name='sourceinfoname'/>
</element>
</define>
<define name='IscsiQualifiedName'>
<data type='string'>
<param name="pattern">iqn\.[0-9]{4}-(0[1-9]|1[0-2])\.[a-zA-Z0-9\.\-]+(:.+)?</param>
</data>
</define>
<define name="PortNumber">
<data type="short">
<param name="minInclusive">-1</param>
</data>
</define>
</grammar>