]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: restrict 'virgl=' option to non-vhostuser video type
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 23 Sep 2019 10:44:32 +0000 (14:44 +0400)
committerCole Robinson <crobinso@redhat.com>
Tue, 24 Sep 2019 16:30:33 +0000 (12:30 -0400)
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>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/virtio-options.args

index 90e090c72ea96b2e386c1a9175c469edf8ee5403..3f127dad1f22127c032f44d64c78848919514a18 100644 (file)
@@ -4542,9 +4542,12 @@ 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->backend != VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER &&
+        video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
+        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) {
index 40f85fdaa4c0467948280ebfe58d33bef482525b..92bce8283cac6dd66fbc800339e9a606b90ef7ac 100644 (file)
@@ -49,8 +49,7 @@ ats=on \
 ats=on \
 -device virtio-input-host-pci,id=input3,evdev=/dev/input/event1234,bus=pci.0,\
 addr=0x12,iommu_platform=on,ats=on \
--device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2,iommu_platform=on,\
-ats=on \
+-device virtio-gpu-pci,id=video0,bus=pci.0,addr=0x2,iommu_platform=on,ats=on \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc,iommu_platform=on,\
 ats=on \
 -object rng-random,id=objrng0,filename=/dev/random \