diff mbox series

[v2,08/16] qemu: restrict 'virgl=' option to non-vhostuser video type

Message ID 4d4c6ee46622dbfaf84cef5dfd2471111e9a5723.1566576129.git.crobinso@redhat.com
State New
Headers show
Series Add vhost-user-gpu support | expand

Commit Message

Cole Robinson Aug. 23, 2019, 4:21 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

vhost-user device doesn't have a virgl option, it is passed to the
vhost-user-gpu helper process instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 src/qemu/qemu_command.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 49652a8565..8bef103f68 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4683,9 +4683,11 @@  qemuBuildDeviceVideoStr(const virDomainDef *def,
 
     virBufferAsprintf(&buf, ",id=%s", video->info.alias);
 
-    if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) {
-        virBufferAsprintf(&buf, ",virgl=%s",
-                          virTristateSwitchTypeToString(video->accel->accel3d));
+    if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && !video->vhostuser) {
+        if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) {
+            virBufferAsprintf(&buf, ",virgl=%s",
+                              virTristateSwitchTypeToString(video->accel->accel3d));
+        }
     }
 
     if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {