[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 11/23] qmp/hmp: disable screendump if PIXMAN is missing
From: |
marcandre . lureau |
Subject: |
[PATCH v6 11/23] qmp/hmp: disable screendump if PIXMAN is missing |
Date: |
Wed, 25 Oct 2023 23:08:05 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
The command requires color conversion and line-by-line feeding. We could
have a simple fallback for simple formats though.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
qapi/ui.json | 3 ++-
ui/ui-hmp-cmds.c | 2 ++
ui/ui-qmp-cmds.c | 2 ++
hmp-commands.hx | 2 ++
4 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/qapi/ui.json b/qapi/ui.json
index 006616aa77..e74cc3efb6 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -200,7 +200,8 @@
{ 'command': 'screendump',
'data': {'filename': 'str', '*device': 'str', '*head': 'int',
'*format': 'ImageFormat'},
- 'coroutine': true }
+ 'coroutine': true,
+ 'if': 'CONFIG_PIXMAN' }
##
# == Spice
diff --git a/ui/ui-hmp-cmds.c b/ui/ui-hmp-cmds.c
index c671389473..26c8ced1f2 100644
--- a/ui/ui-hmp-cmds.c
+++ b/ui/ui-hmp-cmds.c
@@ -437,6 +437,7 @@ void sendkey_completion(ReadLineState *rs, int nb_args,
const char *str)
}
}
+#ifdef CONFIG_PIXMAN
void coroutine_fn
hmp_screendump(Monitor *mon, const QDict *qdict)
{
@@ -458,6 +459,7 @@ hmp_screendump(Monitor *mon, const QDict *qdict)
end:
hmp_handle_error(mon, err);
}
+#endif
void hmp_client_migrate_info(Monitor *mon, const QDict *qdict)
{
diff --git a/ui/ui-qmp-cmds.c b/ui/ui-qmp-cmds.c
index debc07d678..d772e1cb7f 100644
--- a/ui/ui-qmp-cmds.c
+++ b/ui/ui-qmp-cmds.c
@@ -212,6 +212,7 @@ void qmp_client_migrate_info(const char *protocol, const
char *hostname,
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "protocol", "'spice'");
}
+#ifdef CONFIG_PIXMAN
#ifdef CONFIG_PNG
/**
* png_save: Take a screenshot as PNG
@@ -391,3 +392,4 @@ qmp_screendump(const char *filename, const char *device,
}
}
}
+#endif /* CONFIG_PIXMAN */
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 63eac22734..c343d82fbc 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -252,6 +252,7 @@ SRST
ERST
+#ifdef CONFIG_PIXMAN
{
.name = "screendump",
.args_type = "filename:F,format:-fs,device:s?,head:i?",
@@ -267,6 +268,7 @@ SRST
``screendump`` *filename*
Save screen into PPM image *filename*.
ERST
+#endif
{
.name = "logfile",
--
2.41.0
- [PATCH v6 03/23] ui: compile out some qemu-pixman functions when !PIXMAN, (continued)
- [PATCH v6 03/23] ui: compile out some qemu-pixman functions when !PIXMAN, marcandre . lureau, 2023/10/25
- [PATCH v6 02/23] build-sys: drop needless warning pragmas for old pixman, marcandre . lureau, 2023/10/25
- [PATCH v6 04/23] ui: add pixman-minimal.h, marcandre . lureau, 2023/10/25
- [PATCH v6 05/23] vl: drop needless -spice checks, marcandre . lureau, 2023/10/25
- [PATCH v6 06/23] qemu-options: define -vnc only #ifdef CONFIG_VNC, marcandre . lureau, 2023/10/25
- [PATCH v6 07/23] vl: simplify display_remote logic, marcandre . lureau, 2023/10/25
- [PATCH v6 11/23] qmp/hmp: disable screendump if PIXMAN is missing,
marcandre . lureau <=
- [PATCH v6 09/23] ui/console: allow to override the default VC, marcandre . lureau, 2023/10/25
- [PATCH v6 10/23] ui/vc: console-vc requires PIXMAN, marcandre . lureau, 2023/10/25
- [PATCH v6 08/23] vl: move display early init before default devices, marcandre . lureau, 2023/10/25
- [PATCH v6 14/23] vhost-user-gpu: skip VHOST_USER_GPU_UPDATE when !PIXMAN, marcandre . lureau, 2023/10/25