From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Change the model name to "vhost-user-gpu-pci" if running on PCI.
Set the "max_outputs" property.
Associate the device with the "vhost-user" backend.
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
src/qemu/qemu_command.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index b3a2bba28e..b4afcd2e8c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4319,7 +4319,7 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
goto error;
}
- if (STREQ(model, "virtio-gpu")) {
+ if (STREQ(model, "virtio-gpu") || STREQ(model, "vhost-user-gpu"))
{
if (video->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
virBufferAsprintf(&buf, "%s-ccw", model);
else
@@ -4367,6 +4367,10 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
if (video->heads)
virBufferAsprintf(&buf, ",max_outputs=%u",
video->heads);
}
+ } else if (video->type == VIR_DOMAIN_VIDEO_TYPE_VHOST_USER) {
+ if (video->heads)
+ virBufferAsprintf(&buf, ",max_outputs=%u", video->heads);
+ virBufferAsprintf(&buf, ",vhost-user=vu-%s",
video->info.alias);
} else if (video->vram &&
((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) ||
--
2.18.0.129.ge3331758f1