]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: explicitly disable virgl when requested
authorJonathon Jongsma <jjongsma@redhat.com>
Fri, 24 Jan 2020 23:12:26 +0000 (17:12 -0600)
committerMichal Privoznik <mprivozn@redhat.com>
Sat, 25 Jan 2020 06:51:08 +0000 (07:51 +0100)
If a domain is configured to have an egl-headless display and a virtio
video device, virgl will be enabled automatically within the guest, even
if the video device is configured with accel3d='no'.

In this case we should explicitly pass 'virgl=off' to qemu.

See https://bugzilla.redhat.com/show_bug.cgi?id=1791236 for more
information.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_command.c

index 46680fd829ac3eed5b833b3d8f41c1cc96c6ab69..3378413ee1126f51acdc1c5fa44706c69ac33994 100644 (file)
@@ -4429,7 +4429,10 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
 
     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) {
+        if (video->accel &&
+            virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL) &&
+            (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON ||
+             video->accel->accel3d == VIR_TRISTATE_SWITCH_OFF)) {
             virBufferAsprintf(&buf, ",virgl=%s",
                               virTristateSwitchTypeToString(video->accel->accel3d));
         }