On Wed, Dec 07, 2022 at 12:20:52PM +0100, Michal Privoznik wrote:
Historically, QEMU took screenshots in PPM. While this might use
to be popular format, as of v7.1.0-rc0~125^2~6 it is possible to
take screenshots in PNG. This is more popular and renders almost
everywhere, which is not the case for PPM (for instance, modern
browsers do not render it).
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index f6683cbb0a..d509582719 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3291,6 +3291,7 @@ qemuDomainScreenshot(virDomainPtr dom,
const char *videoAlias = NULL;
char *ret = NULL;
bool unlink_tmp = false;
+ const char *format = NULL;
virCheckFlags(0, NULL);
@@ -3339,6 +3340,10 @@ qemuDomainScreenshot(virDomainPtr dom,
}
}
+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SCREENSHOT_FORMAT_PNG)) {
+ format = "png";
+ }
+
Curly brackets are discouraged for one-line condition bodies IIRC ;)