[libvirt] [PATCH v2 06/16] qemu: check that qemu is vhost-user-vga capable

Cole Robinson crobinso at redhat.com
Fri Aug 23 16:21:50 UTC 2019


From: Marc-André Lureau <marcandre.lureau at redhat.com>

To support virtio VGA with vhost-user, vhost-user-vga device is necessary.

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
Signed-off-by: Cole Robinson <crobinso at redhat.com>
---
 src/qemu/qemu_domain.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index d0722f8761..bf0531126d 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -12386,9 +12386,14 @@ bool
 qemuDomainSupportsVideoVga(virDomainVideoDefPtr video,
                            virQEMUCapsPtr qemuCaps)
 {
-    if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO &&
-        !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_VGA))
-        return false;
+    if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
+        if (video->vhostuser) {
+            if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_USER_VGA))
+                return false;
+        } else if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_VGA)) {
+            return false;
+        }
+    }
 
     return true;
 }
-- 
2.21.0




More information about the libvir-list mailing list