QEMU 6.1 will replace the virgl property of virtio-vga device to
virtio-vga-gl device. Adapt to that update.
Resolves:
https://gitlab.com/libvirt/libvirt/-/issues/167
Signed-off-by: Han Han <hhan(a)redhat.com>
---
src/qemu/qemu_command.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index a79e96a121..c3de5baa26 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4238,6 +4238,9 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
}
} else {
virBufferAsprintf(&buf, "%s", model);
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL) &&
+ STREQ(model, "virtio-vga"))
+ virBufferAddLit(&buf, "-gl");
}
virBufferAsprintf(&buf, ",id=%s", video->info.alias);
@@ -4247,6 +4250,7 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
if (video->accel &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL) &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL) &&
(video->accel->accel3d == VIR_TRISTATE_SWITCH_ON ||
video->accel->accel3d == VIR_TRISTATE_SWITCH_OFF)) {
virBufferAsprintf(&buf, ",virgl=%s",
--
2.31.1