mirror of
https://github.com/mii443/qemu.git
synced 2025-09-03 15:49:30 +00:00
qdev-monitor: print help to stdout
qdev_device_help() is used from command line "-device help", or from HMP "device_add". If used from command line, print help to stdout (it is only printed on explicit demand). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
20
monitor.c
20
monitor.c
@ -4492,6 +4492,20 @@ static void monitor_readline_flush(void *opaque)
|
||||
monitor_flush(opaque);
|
||||
}
|
||||
|
||||
/*
|
||||
* Print to current monitor if we have one, else to stream.
|
||||
* TODO should return int, so callers can calculate width, but that
|
||||
* requires surgery to monitor_vprintf(). Left for another day.
|
||||
*/
|
||||
void monitor_vfprintf(FILE *stream, const char *fmt, va_list ap)
|
||||
{
|
||||
if (cur_mon && !monitor_cur_is_qmp()) {
|
||||
monitor_vprintf(cur_mon, fmt, ap);
|
||||
} else {
|
||||
vfprintf(stream, fmt, ap);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Print to current monitor if we have one, else to stderr.
|
||||
* TODO should return int, so callers can calculate width, but that
|
||||
@ -4499,11 +4513,7 @@ static void monitor_readline_flush(void *opaque)
|
||||
*/
|
||||
void error_vprintf(const char *fmt, va_list ap)
|
||||
{
|
||||
if (cur_mon && !monitor_cur_is_qmp()) {
|
||||
monitor_vprintf(cur_mon, fmt, ap);
|
||||
} else {
|
||||
vfprintf(stderr, fmt, ap);
|
||||
}
|
||||
monitor_vfprintf(stderr, fmt, ap);
|
||||
}
|
||||
|
||||
void error_vprintf_unless_qmp(const char *fmt, va_list ap)
|
||||
|
Reference in New Issue
Block a user