mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Add support for storage format in FS <driver>
Extend the <driver> element in filesystem devices to allow a storage format to be set. The new attribute uses 'format' to reflect the storage format. This is different from the <driver> element in disk devices which use 'type' to reflect the storage format. This is because the 'type' attribute on filesystem devices is already used for the driver backend, for which the disk devices use the 'name' attribute. Arggggh. Anyway for disks we have <driver name="qemu" type="raw"/> And for filesystems this change means we now have <driver type="loop" format="raw"/> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
@@ -1883,6 +1883,13 @@
|
||||
<target dir='/import/from/host'/>
|
||||
<readonly/>
|
||||
</filesystem>
|
||||
<filesystem type='file' accessmode='passthrough'>
|
||||
<driver name='loop' type='raw'/>
|
||||
<driver type='path' wrpolicy='immediate'/>
|
||||
<source file='/export/to/guest.img'/>
|
||||
<target dir='/import/from/host'/>
|
||||
<readonly/>
|
||||
</filesystem>
|
||||
...
|
||||
</devices>
|
||||
...</pre>
|
||||
@@ -1974,6 +1981,23 @@
|
||||
|
||||
</dd>
|
||||
|
||||
<dt><code>driver</code></dt>
|
||||
<dd>
|
||||
The optional driver element allows specifying further details
|
||||
related to the hypervisor driver used to provide the filesystem.
|
||||
<span class="since">Since 1.0.6</span>
|
||||
<ul>
|
||||
<li>
|
||||
If the hypervisor supports multiple backend drivers, then
|
||||
the <code>type</code> attribute selects the primary
|
||||
backend driver name, while the <code>format</code>
|
||||
attribute provides the format type. For example, LXC
|
||||
supports a type of "loop", with a format of "raw". QEMU
|
||||
supports a type of "path" or "handle", but no formats.
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt><code>source</code></dt>
|
||||
<dd>
|
||||
The resource on the host that is being accessed in the guest. The
|
||||
|
||||
@@ -888,7 +888,7 @@
|
||||
<define name="diskspec">
|
||||
<interleave>
|
||||
<optional>
|
||||
<ref name="driver"/>
|
||||
<ref name="diskDriver"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name='diskMirror'/>
|
||||
@@ -1270,7 +1270,7 @@
|
||||
<!--
|
||||
Disk may use a special driver for access.
|
||||
-->
|
||||
<define name="driver">
|
||||
<define name="diskDriver">
|
||||
<element name="driver">
|
||||
<choice>
|
||||
<group>
|
||||
@@ -1314,13 +1314,13 @@
|
||||
<optional>
|
||||
<attribute name='type'>
|
||||
<choice>
|
||||
<ref name='diskFormat'/>
|
||||
<ref name='storageFormat'/>
|
||||
<value>aio</value> <!-- back-compat for 'raw' -->
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</define>
|
||||
<define name='diskFormat'>
|
||||
<define name='storageFormat'>
|
||||
<choice>
|
||||
<value>raw</value>
|
||||
<value>dir</value>
|
||||
@@ -1518,6 +1518,9 @@
|
||||
<attribute name="type">
|
||||
<value>file</value>
|
||||
</attribute>
|
||||
<optional>
|
||||
<ref name="fsDriver"/>
|
||||
</optional>
|
||||
<interleave>
|
||||
<element name="source">
|
||||
<attribute name="file">
|
||||
@@ -1531,6 +1534,9 @@
|
||||
<attribute name="type">
|
||||
<value>block</value>
|
||||
</attribute>
|
||||
<optional>
|
||||
<ref name="fsDriver"/>
|
||||
</optional>
|
||||
<interleave>
|
||||
<element name="source">
|
||||
<attribute name="dev">
|
||||
@@ -1547,6 +1553,9 @@
|
||||
<value>mount</value>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="fsDriver"/>
|
||||
</optional>
|
||||
<interleave>
|
||||
<element name="source">
|
||||
<attribute name="dir">
|
||||
@@ -1554,22 +1563,6 @@
|
||||
</attribute>
|
||||
<empty/>
|
||||
</element>
|
||||
<optional>
|
||||
<element name="driver">
|
||||
<attribute name="type">
|
||||
<choice>
|
||||
<value>path</value>
|
||||
<value>handle</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="wrpolicy">
|
||||
<value>immediate</value>
|
||||
</attribute>
|
||||
</optional>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
</group>
|
||||
<group>
|
||||
@@ -1578,6 +1571,9 @@
|
||||
<value>bind</value>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="fsDriver"/>
|
||||
</optional>
|
||||
<interleave>
|
||||
<element name="source">
|
||||
<attribute name="dir">
|
||||
@@ -1591,6 +1587,9 @@
|
||||
<attribute name="type">
|
||||
<value>template</value>
|
||||
</attribute>
|
||||
<optional>
|
||||
<ref name="fsDriver"/>
|
||||
</optional>
|
||||
<interleave>
|
||||
<element name="source">
|
||||
<attribute name="name">
|
||||
@@ -1604,6 +1603,9 @@
|
||||
<attribute name="type">
|
||||
<value>ram</value>
|
||||
</attribute>
|
||||
<optional>
|
||||
<ref name="fsDriver"/>
|
||||
</optional>
|
||||
<interleave>
|
||||
<element name="source">
|
||||
<attribute name="usage">
|
||||
@@ -1661,6 +1663,35 @@
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
<define name="fsDriver">
|
||||
<element name="driver">
|
||||
<!-- Annoying inconsistency. 'disk' uses 'name'
|
||||
for this kind of info, and 'type' for the
|
||||
storage format. We need the latter too, so
|
||||
had to invent a new attribute name -->
|
||||
<optional>
|
||||
<attribute name="type">
|
||||
<choice>
|
||||
<value>path</value>
|
||||
<value>handle</value>
|
||||
<value>loop</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="format">
|
||||
<ref name="storageFormat"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="wrpolicy">
|
||||
<value>immediate</value>
|
||||
</attribute>
|
||||
</optional>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<!--
|
||||
An interface description can either be of type bridge in which case
|
||||
it will use a bridging source, or of type ethernet which uses a device
|
||||
@@ -3838,7 +3869,7 @@
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name='format'>
|
||||
<ref name='diskFormat'/>
|
||||
<ref name='storageFormat'/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
<element name='driver'>
|
||||
<optional>
|
||||
<attribute name='type'>
|
||||
<ref name='diskFormat'/>
|
||||
<ref name='storageFormat'/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<empty/>
|
||||
|
||||
Reference in New Issue
Block a user