[PATCH 4/7] qemu: Add qemuDomainSupportsNonLegacyShmem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That function checks whether ivshmem_plain/doorbell devices are
supported so that we don't decide on the capability on multiple places,
it also unifies error reporting.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 12 ++++++++++++
 src/qemu/qemu_domain.h |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index f533086b8eef..2ed0187cd49e 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5994,6 +5994,18 @@ qemuDomainSupportsNetdev(virDomainDefPtr def,
 }


+bool
+qemuDomainSupportsNonLegacyShmem(virQEMUCapsPtr qemuCaps,
+                                 virDomainShmemDefPtr shmem)
+{
+    int device_cap = shmem->server.enabled ?
+        QEMU_CAPS_DEVICE_IVSHMEM_DOORBELL :
+        QEMU_CAPS_DEVICE_IVSHMEM_PLAIN;
+
+    return virQEMUCapsGet(qemuCaps, device_cap);
+}
+
+
 int
 qemuDomainNetVLAN(virDomainNetDefPtr def)
 {
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index c2fab3ba3521..7932764c9fe8 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -670,6 +670,9 @@ bool qemuDomainSupportsNetdev(virDomainDefPtr def,
                               virQEMUCapsPtr qemuCaps,
                               virDomainNetDefPtr net);

+bool qemuDomainSupportsNonLegacyShmem(virQEMUCapsPtr qemuCaps,
+                                      virDomainShmemDefPtr shmem);
+
 int qemuDomainNetVLAN(virDomainNetDefPtr def);

 int qemuDomainSetPrivatePaths(virQEMUDriverPtr driver,
-- 
2.10.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]