qemu: Adapt to virtio-vga-gl device

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@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Han Han 2021-06-09 16:32:26 +08:00 committed by Michal Privoznik
parent b99762b61e
commit 0c67324648

View File

@ -4243,6 +4243,10 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
}
} else {
virBufferAsprintf(&buf, "%s", model);
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL) &&
accel3d == VIR_TRISTATE_SWITCH_ON &&
STREQ(model, "virtio-vga"))
virBufferAddLit(&buf, "-gl");
}
virBufferAsprintf(&buf, ",id=%s", video->info.alias);