mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Introduce new XMLs to specify disk source using libvirt storage
With this patch, one can specify the disk source using libvirt
storage like:
<disk type='volume' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source pool='default' volume='fc18.img'/>
<target dev='vdb' bus='virtio'/>
</disk>
"seclabels" and "startupPolicy" are not supported for this new
disk type ("volume"). They will be supported in later patches.
docs/formatdomain.html.in:
* Add documents for new XMLs
docs/schemas/domaincommon.rng:
* Add rng for new XMLs;
src/conf/domain_conf.h:
* New struct for 'volume' type disk source (virDomainDiskSourcePoolDef)
* Add VIR_DOMAIN_DISK_TYPE_VOLUME for enum virDomainDiskType
src/conf/domain_conf.c:
* New helper virDomainDiskSourcePoolDefParse to parse the 'volume'
type disk source.
* New helper virDomainDiskSourcePoolDefFree to free the source def
if 'volume' type disk.
tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml:
tests/qemuxml2xmltest.c:
* New test
This commit is contained in:
@@ -1372,6 +1372,11 @@
|
||||
<blockio logical_block_size='512' physical_block_size='4096'/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
</disk>
|
||||
<disk type='volume' device='disk'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<source pool='blk-pool0' volume='blk-pool0-vol0'/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
</disk>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
@@ -1452,10 +1457,16 @@
|
||||
<code>iqn.1992-01.com.example/1</code>); the default LUN is zero.
|
||||
When the disk <code>type</code> is "network", the <code>source</code>
|
||||
may have zero or more <code>host</code> sub-elements used to
|
||||
specify the hosts to connect.
|
||||
specify the hosts to connect. If the disk <code>type</code> is
|
||||
"volume", the underlying disk source is represented by attributes
|
||||
<code>pool</code> and <code>volume</code>. Attribute <code>pool</code>
|
||||
specifies the name of storage pool (managed by libvirt) where the disk
|
||||
source resides, and attribute <code>volume</code> specifies the name of
|
||||
storage volume (managed by libvirt) used as the disk source.
|
||||
<span class="since">Since 0.0.3; <code>type='dir'</code> since
|
||||
0.7.5; <code>type='network'</code> since
|
||||
0.8.7; <code>protocol='iscsi'</code> since 1.0.4</span><br/>
|
||||
0.8.7; <code>protocol='iscsi'</code> since 1.0.4;
|
||||
<code>type='volume'</code> since 1.0.5;</span><br/>
|
||||
For a "file" disk type which represents a cdrom or floppy
|
||||
(the <code>device</code> attribute), it is possible to define
|
||||
policy what to do with the disk if the source file is not accessible.
|
||||
|
||||
@@ -1107,6 +1107,24 @@
|
||||
<ref name="diskspec"/>
|
||||
</interleave>
|
||||
</group>
|
||||
<group>
|
||||
<attribute name="type">
|
||||
<value>volume</value>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<optional>
|
||||
<element name="source">
|
||||
<attribute name="pool">
|
||||
<ref name="genericName"/>
|
||||
</attribute>
|
||||
<attribute name="volume">
|
||||
<ref name="volName"/>
|
||||
</attribute>
|
||||
</element>
|
||||
</optional>
|
||||
<ref name="diskspec"/>
|
||||
</interleave>
|
||||
</group>
|
||||
<ref name="diskspec"/>
|
||||
</choice>
|
||||
</element>
|
||||
|
||||
Reference in New Issue
Block a user