docs, conf, schema: add support for shmem device

This patch adds parsing/formatting code as well as documentation for
shared memory devices.  This will currently be only accessible in QEMU
using it's ivshmem device, but is designed as generic as possible to
allow future expansion for other hypervisors.

In the devices section in the domain XML users may specify:

- For shmem device using a server:

 <shmem name='shmem0'>
   <server path='/tmp/socket-ivshmem0'/>
   <size unit='M'>32</size>
   <msi vectors='32' ioeventfd='on'/>
 </shmem>

- For ivshmem device not using an ivshmem server:

 <shmem name='shmem1'>
   <size unit='M'>32</size>
 </shmem>

Most of the configuration is made optional so it also allows
specifications like:

 <shmem name='shmem1/>
 <shmem name='shmem2'>
   <server/>
 </shmem>

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander
2014-09-22 10:49:39 +02:00
parent e9392e48d4
commit 540a84ec89
9 changed files with 377 additions and 1 deletions

View File

@@ -5582,6 +5582,58 @@ qemu-kvm -net nic,model=? /dev/null
</dd>
</dl>
<h4><a name="elementsShmem">Shared memory device</a></h4>
<p>
A shared memory device allows to share a memory region between
different virtual machines and the host.
<span class="since">Since 1.2.9, QEMU and KVM only</span>
</p>
<pre>
...
&lt;devices&gt;
&lt;shmem name='my_shmem0'&gt;
&lt;size unit='M'&gt;4&lt;/size&gt;
&lt;/shmem&gt;
&lt;shmem name='shmem_server'&gt;
&lt;size unit='M'&gt;2&lt;/size&gt;
&lt;server path='/tmp/socket-shmem'/&gt;
&lt;msi vectors='32' ioeventfd='on'/&gt;
&lt;/shmem&gt;
&lt;/devices&gt;
...
</pre>
<dl>
<dt><code>shmem</code></dt>
<dd>
The <code>shmem</code> element has one mandatory attribute,
<code>name</code> to identify the shared memory.
</dd>
<dt><code>size</code></dt>
<dd>
The optional <code>size</code> element specifies the size of the shared
memory. This must be power of 2 and greater than or equal to 1 MiB.
</dd>
<dt><code>server</code></dt>
<dd>
The optional <code>server</code> element can be used to configure a server
socket the device is supposed to connect to. The optional
<code>path</code> attribute specifies the path to the unix socket and
defaults to <code>/var/lib/libvirt/shmem/$shmem-$name-sock</code>.
</dd>
<dt><code>msi</code></dt>
<dd>
The optional <code>msi</code> element enables/disables (values "on"/"off",
respectively) MSI interrupts. This option can currently be used only
together with the <code>server</code> element. The <code>vectors</code>
attribute can be used to specify the number of interrupt
vectors. The <code>ioeventd</code> attribute enables/disables (values
"on"/"off", respectively) ioeventfd.
</dd>
</dl>
<h3><a name="seclabel">Security label</a></h3>
<p>