[libvirt] [PATCH v4 2/6] conf, qemu: Add newer shmem models

Martin Kletzander mkletzan at redhat.com
Wed Oct 26 10:51:33 UTC 2016


The old ivshmem is deprecated in QEMU, so let's use the better
ivshmem-{plain,doorbell} variants instead.

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
 docs/formatdomain.html.in     | 10 +++++++---
 docs/schemas/domaincommon.rng |  2 ++
 src/conf/domain_conf.c        |  4 +++-
 src/conf/domain_conf.h        |  2 ++
 src/qemu/qemu_command.c       |  7 +++++++
 5 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 10a692de2553..11b3330cee87 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -6826,10 +6826,11 @@ qemu-kvm -net nic,model=? /dev/null
   ...
   <devices>
     <shmem name='my_shmem0'>
+      <model type='ivshmem-plain'/>
       <size unit='M'>4</size>
     </shmem>
     <shmem name='shmem_server'>
-      <model type='ivshmem'/>
+      <model type='ivshmem-doorbell'/>
       <size unit='M'>2</size>
       <server path='/tmp/socket-shmem'/>
       <msi vectors='32' ioeventfd='on'/>
@@ -6848,8 +6849,11 @@ qemu-kvm -net nic,model=? /dev/null
     <dd>
       Attribute <code>type</code> of the optional element <code>model</code>
       specifies the model of the underlying device providing the
-      <code>shmem</code> device.  Currently the only supported model is
-      <code>ivshmem</code>.
+      <code>shmem</code> device.  The models currently supported are
+      <code>ivshmem</code> (supports both server and server-less shmem, but is
+      deprecated by newer QEMU in favour of the -plain and -doorbell variants),
+      <code>ivshmem-plain</code> (only for server-less shmem) and
+      <code>ivshmem-doorbell</code> (only for shmem with the server).
     </dd>
     <dt><code>size</code></dt>
     <dd>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 99e0eb6cb448..19d45fd6eae3 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3596,6 +3596,8 @@
             <attribute name="type">
               <choice>
                 <value>ivshmem</value>
+                <value>ivshmem-plain</value>
+                <value>ivshmem-doorbell</value>
               </choice>
             </attribute>
           </element>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 108a48ee974e..a233c0c4208a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -845,7 +845,9 @@ VIR_ENUM_IMPL(virDomainMemoryModel, VIR_DOMAIN_MEMORY_MODEL_LAST,
               "", "dimm")

 VIR_ENUM_IMPL(virDomainShmemModel, VIR_DOMAIN_SHMEM_MODEL_LAST,
-              "ivshmem")
+              "ivshmem",
+              "ivshmem-plain",
+              "ivshmem-doorbell")

 static virClassPtr virDomainObjClass;
 static virClassPtr virDomainXMLOptionClass;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index d2a9289e077d..541b6003c87e 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1564,6 +1564,8 @@ struct _virDomainNVRAMDef {

 typedef enum {
     VIR_DOMAIN_SHMEM_MODEL_IVSHMEM,
+    VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_PLAIN,
+    VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_DOORBELL,

     VIR_DOMAIN_SHMEM_MODEL_LAST
 } virDomainShmemModel;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f05f2fd1c5c4..558122b4cf7e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -8504,6 +8504,13 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager,
         devstr = qemuBuildShmemDevLegacyStr(def, shmem, qemuCaps);
         break;

+    case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_PLAIN:
+    case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_DOORBELL:
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("%s device is not supported with this QEMU binary"),
+                       virDomainShmemModelTypeToString(shmem->model));
+        break;
+
     case VIR_DOMAIN_SHMEM_MODEL_LAST:
         break;
     }
-- 
2.10.1




More information about the libvir-list mailing list