[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 2/2] error: Report certain hints on stderr when no mo
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL 2/2] error: Report certain hints on stderr when no monitor |
Date: |
Thu, 19 Jan 2017 15:53:57 +0100 |
From: Marc-André Lureau <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <address@hidden>
---
monitor.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/monitor.c b/monitor.c
index 0841d43..90c5baf 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.7.4