mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
storage: allow interleave in pool XML
The RNG grammar did not allow arbitrary interleaving, which makes it harder than necessary to create a new pool from handwritten XML. * docs/schemas/storagepool.rng: Allow interleaving. * tests/storagepoolxml2xmlin/pool-sheepdog.xml: Test interleave. * tests/storagepoolxml2xmlin/pool-iscsi-auth.xml: Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
59dce8d278
commit
caf516db51
@ -29,103 +29,124 @@
|
||||
<attribute name='type'>
|
||||
<value>dir</value>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcedir'/>
|
||||
<ref name='target'/>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='poolfs'>
|
||||
<attribute name='type'>
|
||||
<value>fs</value>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcefs'/>
|
||||
<ref name='target'/>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='poolnetfs'>
|
||||
<attribute name='type'>
|
||||
<value>netfs</value>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcenetfs'/>
|
||||
<ref name='target'/>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='poollogical'>
|
||||
<attribute name='type'>
|
||||
<value>logical</value>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcelogical'/>
|
||||
<ref name='targetlogical'/>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='pooldisk'>
|
||||
<attribute name='type'>
|
||||
<value>disk</value>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcedisk'/>
|
||||
<ref name='target'/>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='pooliscsi'>
|
||||
<attribute name='type'>
|
||||
<value>iscsi</value>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourceiscsi'/>
|
||||
<ref name='target'/>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='poolscsi'>
|
||||
<attribute name='type'>
|
||||
<value>scsi</value>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcescsi'/>
|
||||
<ref name='target'/>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='poolmpath'>
|
||||
<attribute name='type'>
|
||||
<value>mpath</value>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<optional>
|
||||
<ref name='sourcempath'/>
|
||||
</optional>
|
||||
<ref name='target'/>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='poolrbd'>
|
||||
<attribute name='type'>
|
||||
<value>rbd</value>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcerbd'/>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='poolsheepdog'>
|
||||
<attribute name='type'>
|
||||
<value>sheepdog</value>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcesheepdog'/>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='sourceinfovendor'>
|
||||
<interleave>
|
||||
<optional>
|
||||
<element name='vendor'>
|
||||
<attribute name='name'>
|
||||
@ -140,9 +161,11 @@
|
||||
</attribute>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='commonmetadata'>
|
||||
<interleave>
|
||||
<element name='name'>
|
||||
<ref name='genericName'/>
|
||||
</element>
|
||||
@ -151,9 +174,11 @@
|
||||
<ref name='UUID'/>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='sizing'>
|
||||
<interleave>
|
||||
<optional>
|
||||
<element name='capacity'>
|
||||
<ref name='scaledInteger'/>
|
||||
@ -169,11 +194,13 @@
|
||||
<ref name='scaledInteger'/>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name='permissions'>
|
||||
<optional>
|
||||
<element name='permissions'>
|
||||
<interleave>
|
||||
<element name='mode'>
|
||||
<ref name='octalMode'/>
|
||||
</element>
|
||||
@ -194,27 +221,32 @@
|
||||
<text/>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name='target'>
|
||||
<element name='target'>
|
||||
<interleave>
|
||||
<element name='path'>
|
||||
<ref name='absFilePath'/>
|
||||
</element>
|
||||
<ref name='permissions'/>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='targetlogical'>
|
||||
<element name='target'>
|
||||
<interleave>
|
||||
<optional>
|
||||
<element name='path'>
|
||||
<ref name='absFilePath'/>
|
||||
</element>
|
||||
</optional>
|
||||
<ref name='permissions'/>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
@ -413,27 +445,32 @@
|
||||
|
||||
<define name='sourcefs'>
|
||||
<element name='source'>
|
||||
<interleave>
|
||||
<ref name='sourceinfodev'/>
|
||||
<ref name='sourcefmtfs'/>
|
||||
<optional>
|
||||
<ref name='sourceinfovendor'/>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcenetfs'>
|
||||
<element name='source'>
|
||||
<interleave>
|
||||
<ref name='sourceinfohost'/>
|
||||
<ref name='sourceinfodir'/>
|
||||
<ref name='sourcefmtnetfs'/>
|
||||
<optional>
|
||||
<ref name='sourceinfovendor'/>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcelogical'>
|
||||
<element name='source'>
|
||||
<interleave>
|
||||
<oneOrMore>
|
||||
<optional>
|
||||
<ref name='sourceinfoname'/>
|
||||
@ -446,21 +483,25 @@
|
||||
<optional>
|
||||
<ref name='sourceinfovendor'/>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcedisk'>
|
||||
<element name='source'>
|
||||
<interleave>
|
||||
<ref name='sourceinfodev'/>
|
||||
<ref name='sourcefmtdisk'/>
|
||||
<optional>
|
||||
<ref name='sourceinfovendor'/>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourceiscsi'>
|
||||
<element name='source'>
|
||||
<interleave>
|
||||
<ref name='sourceinfohost'/>
|
||||
<ref name='sourceinfodev'/>
|
||||
<optional>
|
||||
@ -472,15 +513,18 @@
|
||||
<optional>
|
||||
<ref name='sourceinfovendor'/>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcescsi'>
|
||||
<element name='source'>
|
||||
<interleave>
|
||||
<ref name='sourceinfoadapter'/>
|
||||
<optional>
|
||||
<ref name='sourceinfovendor'/>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
@ -492,18 +536,22 @@
|
||||
|
||||
<define name='sourcerbd'>
|
||||
<element name='source'>
|
||||
<interleave>
|
||||
<ref name='sourceinfoname'/>
|
||||
<ref name='sourceinfohost'/>
|
||||
<optional>
|
||||
<ref name='sourceinfoauth'/>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcesheepdog'>
|
||||
<element name='source'>
|
||||
<interleave>
|
||||
<ref name='sourceinfohost'/>
|
||||
<ref name='sourceinfoname'/>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
<pool type='iscsi'>
|
||||
<name>virtimages</name>
|
||||
<uuid>e9392370-2917-565e-692b-d057f46512d6</uuid>
|
||||
<source>
|
||||
<host name="iscsi.example.com"/>
|
||||
<device path="demo-target"/>
|
||||
<auth type='chap' username='admin'>
|
||||
<secret uuid='2ec115d7-3a88-3ceb-bc12-0ac909a6fd87'/>
|
||||
</auth>
|
||||
<device path="demo-target"/>
|
||||
<host name="iscsi.example.com"/>
|
||||
</source>
|
||||
<uuid>e9392370-2917-565e-692b-d057f46512d6</uuid>
|
||||
<target>
|
||||
<path>/dev/disk/by-path</path>
|
||||
<permissions>
|
||||
<mode>0700</mode>
|
||||
<owner>0</owner>
|
||||
<mode>0700</mode>
|
||||
<group>0</group>
|
||||
</permissions>
|
||||
<path>/dev/disk/by-path</path>
|
||||
</target>
|
||||
<name>virtimages</name>
|
||||
</pool>
|
||||
|
@ -1,8 +1,8 @@
|
||||
<pool type='sheepdog'>
|
||||
<name>sheepdog</name>
|
||||
<uuid>65fcba04-5b13-bd93-cff3-52ce48e11ad7</uuid>
|
||||
<source>
|
||||
<host name='localhost' port='7000'/>
|
||||
<name>sheepdog</name>
|
||||
<host name='localhost' port='7000'/>
|
||||
</source>
|
||||
<uuid>65fcba04-5b13-bd93-cff3-52ce48e11ad7</uuid>
|
||||
<name>sheepdog</name>
|
||||
</pool>
|
||||
|
Loading…
Reference in New Issue
Block a user