From 0d6b50d474090b9085c595e2475c40cfdc092411 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 5 Jan 2017 14:59:57 +0100 Subject: [PATCH] error: Report certain hints on stderr when no monitor MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Hints printed with error_printf_unless_qmp() are suppressed outside monitor context. Reproducer: $ qemu-system-x86_64 -m 1Z qemu-system-x86_64: -m 1Z: Parameter 'size' expects a size Print to stderr instead. The reproducer now additionally prints: You may use k, M, G or T suffixes for kilobytes, megabytes, gigabytes and terabytes. Signed-off-by: Marc-André Lureau Message-Id: <20170105135957.12003-1-marcandre.lureau@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster [Commit message tweaked] Signed-off-by: Markus Armbruster --- monitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monitor.c b/monitor.c index 0841d436b0..90c5bafcc3 100644 --- a/monitor.c +++ b/monitor.c @@ -3973,6 +3973,8 @@ void error_vprintf_unless_qmp(const char *fmt, va_list ap) { if (cur_mon && !monitor_cur_is_qmp()) { monitor_vprintf(cur_mon, fmt, ap); + } else if (!cur_mon) { + vfprintf(stderr, fmt, ap); } } -- 2.11.4.GIT