]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qmp/hmp: disable screendump if PIXMAN is missing
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 30 Aug 2023 09:38:29 +0000 (13:38 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 7 Nov 2023 10:04:25 +0000 (14:04 +0400)
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>
hmp-commands.hx
qapi/ui.json
ui/ui-hmp-cmds.c
ui/ui-qmp-cmds.c

index c0a27688b64c15da9d239446f452449482647c7e..765349ed14995c5c63c121d765474c08394433c9 100644 (file)
@@ -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",
index 006616aa7769a715b51c81db83b7370046a707ce..e74cc3efb6e1713783a6857b44169cf17cbb2ce8 100644 (file)
 { 'command': 'screendump',
   'data': {'filename': 'str', '*device': 'str', '*head': 'int',
            '*format': 'ImageFormat'},
-  'coroutine': true }
+  'coroutine': true,
+  'if': 'CONFIG_PIXMAN' }
 
 ##
 # == Spice
index c671389473d80956ae4cc06f18f7328b6b7f75df..26c8ced1f273f802943011e71533a3aa097b3eaa 100644 (file)
@@ -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)
 {
index debc07d6783102b3394f494d396a119f45786f42..d772e1cb7f0520b301d4303766f42351201e4116 100644 (file)
@@ -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 */