QEMU 6.1 will add virtio-gpu-gl-pci device to replace the virgl property
of virtio-gpu-pci device. Adapt to that change.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1967356

Signed-off-by: Han Han <[email protected]>
---
 src/qemu/qemu_command.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7834fc2130..6b9f13b219 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4228,6 +4228,11 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
     }
 
     if (STREQ(model, "virtio-gpu") || STREQ(model, "vhost-user-gpu")) {
+        if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) &&
+            (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) &&
+            STREQ(model, "virtio-gpu"))
+            model = "virtio-gpu-gl";
+
         if (qemuBuildVirtioDevStr(&buf, model, qemuCaps,
                                   VIR_DOMAIN_DEVICE_VIDEO, video) < 0) {
             return NULL;
-- 
2.31.1

Reply via email to