[libvirt] [PATCH v3 2/4] qemu: Generate 'xres' and 'yres' for video devices

jcfaracco at gmail.com jcfaracco at gmail.com
Tue Oct 8 03:35:57 UTC 2019


From: Julio Faracco <jcfaracco at gmail.com>

Now, QEMU command line can define 'xres' and 'yres' if XML contains both
properties from video model. This is generetaed if resolution was set.
Code let QEMU handle if video model supports this feature.

Signed-off-by: Julio Faracco <jcfaracco at gmail.com>
---
 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 cbf25d5f07..99b43243e3 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4596,6 +4596,11 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
             virBufferAsprintf(&buf, ",vgamem=%uk", video->vram);
     }
 
+    if (video->res && video->res->x && video->res->y) {
+        /* QEMU accepts resolution xres and yres. */
+        virBufferAsprintf(&buf, ",xres=%u,yres=%u", video->res->x, video->res->y);
+    }
+
     if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0)
         return NULL;
 
-- 
2.20.1




More information about the libvir-list mailing list