[libvirt] [RFC v2 15/16] qemu: build vhost-user-gpu video device arguments

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Tue Aug 28 21:39:33 UTC 2018


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

Change the model name to "vhost-user-gpu-pci" if running on PCI.

Set the "max_outputs" property.

Associate the device with the "vhost-user" backend.

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 src/qemu/qemu_command.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 5d08ea7d50..78535fbd03 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4421,7 +4421,7 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
         goto error;
     }
 
-    if (STREQ(model, "virtio-gpu")) {
+    if (STREQ(model, "virtio-gpu") || STREQ(model, "vhost-user-gpu")) {
         if (video->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
             virBufferAsprintf(&buf, "%s-ccw", model);
         else
@@ -4469,6 +4469,10 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
             if (video->heads)
                 virBufferAsprintf(&buf, ",max_outputs=%u", video->heads);
         }
+    } else if (video->type == VIR_DOMAIN_VIDEO_TYPE_VHOST_USER) {
+        if (video->heads)
+            virBufferAsprintf(&buf, ",max_outputs=%u", video->heads);
+        virBufferAsprintf(&buf, ",vhost-user=vu-%s", video->info.alias);
     } else if (video->vram &&
         ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA &&
           virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) ||
-- 
2.19.0.rc0.48.gb9dfa238d5




More information about the libvir-list mailing list