Skip to content

Commit f38aa2c

Browse files
committed
qmp/hmp: disable screendump if PIXMAN is missing
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 <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Thomas Huth <[email protected]>
1 parent 600179c commit f38aa2c

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

hmp-commands.hx

+2
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ SRST
252252

253253
ERST
254254

255+
#ifdef CONFIG_PIXMAN
255256
{
256257
.name = "screendump",
257258
.args_type = "filename:F,format:-fs,device:s?,head:i?",
@@ -267,6 +268,7 @@ SRST
267268
``screendump`` *filename*
268269
Save screen into PPM image *filename*.
269270
ERST
271+
#endif
270272

271273
{
272274
.name = "logfile",

qapi/ui.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@
200200
{ 'command': 'screendump',
201201
'data': {'filename': 'str', '*device': 'str', '*head': 'int',
202202
'*format': 'ImageFormat'},
203-
'coroutine': true }
203+
'coroutine': true,
204+
'if': 'CONFIG_PIXMAN' }
204205

205206
##
206207
# == Spice

ui/ui-hmp-cmds.c

+2
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ void sendkey_completion(ReadLineState *rs, int nb_args, const char *str)
437437
}
438438
}
439439

440+
#ifdef CONFIG_PIXMAN
440441
void coroutine_fn
441442
hmp_screendump(Monitor *mon, const QDict *qdict)
442443
{
@@ -458,6 +459,7 @@ hmp_screendump(Monitor *mon, const QDict *qdict)
458459
end:
459460
hmp_handle_error(mon, err);
460461
}
462+
#endif
461463

462464
void hmp_client_migrate_info(Monitor *mon, const QDict *qdict)
463465
{

ui/ui-qmp-cmds.c

+2
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ void qmp_client_migrate_info(const char *protocol, const char *hostname,
212212
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "protocol", "'spice'");
213213
}
214214

215+
#ifdef CONFIG_PIXMAN
215216
#ifdef CONFIG_PNG
216217
/**
217218
* png_save: Take a screenshot as PNG
@@ -391,3 +392,4 @@ qmp_screendump(const char *filename, const char *device,
391392
}
392393
}
393394
}
395+
#endif /* CONFIG_PIXMAN */

0 commit comments

Comments
 (0)