qemu aio: add XML parsing

Allows io={threads|native} as an optional attribute to <driver>.

Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Matthias Dahl
2010-04-21 16:28:21 +02:00
committed by Eric Blake
parent eb1be58e0e
commit 91ef4e05ea
6 changed files with 83 additions and 7 deletions

View File

@@ -716,7 +716,7 @@
&lt;/disk&gt;
...
&lt;disk type='network'&gt;
&lt;driver name="qemu" type="raw"/&gt;
&lt;driver name="qemu" type="raw" io="threads"/&gt;
&lt;source protocol="sheepdog" name="image_name"&gt;
&lt;host name="hostname" port="7000"/&gt;
&lt;/source&gt;
@@ -768,12 +768,38 @@
<span class="since">Since 0.0.3; <code>bus</code> attribute since 0.4.3;
"usb" attribute value since after 0.4.4</span></dd>
<dt><code>driver</code></dt>
<dd>If the hypervisor supports multiple backend drivers, then the optional
<code>driver</code> element allows them to be selected. The <code>name</code>
attribute is the primary backend driver name, while the optional <code>type</code>
attribute provides the sub-type. The optional <code>cache</code> attribute
controls the cache mechanism, possible values are "default", "none",
"writethrough" and "writeback". <span class="since">Since 0.1.8</span>
<dd>
The optional driver element allows specifying further details
related to the hypervisor driver used to provide the disk.
<span class="since">Since 0.1.8; <code>io</code> attribute
since 0.8.8</span>
<ul>
<li>
If the hypervisor supports multiple backend drivers, then
the <code>name</code> attribute selects the primary
backend driver name, while the optional <code>type</code>
attribute provides the sub-type. For example, xen
supports a name of "tap", "tap2", "phy", or "file", with a
type of "aio", while qemu only supports a name of "qemu",
but multiple types including "raw", "bochs", "qcow2", and
"qed".
</li>
<li>
The optional <code>cache</code> attribute controls the
cache mechanism, possible values are "default", "none",
"writethrough" and "writeback".
</li>
<li>
The optional <code>error_policy</code> attribute controls
how the hypervisor will behave on an error, possible
values are "stop", "ignore", and "enospace".
</li>
<li>
The optional <code>io</code> attribute controls specific
policies on I/O; qemu guests support "threads" and
"native".
</li>
</ul>
</dd>
<dt><code>boot</code></dt>
<dd>Specifies that the disk is bootable. The <code>order</code>

View File

@@ -696,6 +696,9 @@
<optional>
<ref name="driverErrorPolicy"/>
</optional>
<optional>
<ref name="driverIO"/>
</optional>
<empty/>
</element>
</define>
@@ -727,6 +730,14 @@
</choice>
</attribute>
</define>
<define name="driverIO">
<attribute name="io">
<choice>
<value>threads</value>
<value>native</value>
</choice>
</attribute>
</define>
<define name="controller">
<element name="controller">
<choice>