qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] error: report hints on stderr when no monitor


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH] error: report hints on stderr when no monitor
Date: Mon, 09 Jan 2017 13:18:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Marc-André Lureau <address@hidden> writes:

> Report the error hint when running from the command line and reaching an

Not just any hint, only the ones printed with error_printf_unless_qmp().

> error, ex:
>
> $ qemu-system-x86_64 -m 1Z
> qemu-system-x86_64: -m 1Z: Parameter 'size' expects a size
> You may use k, M, G or T suffixes for kilobytes, megabytes, gigabytes and 
> terabytes.

The last line is due to this patch.

Suggest to rephrase the commit message:

    error: Report certain hints on stderr when no monitor

    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>
> ---
>  monitor.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/monitor.c b/monitor.c
> index a82f547488..e5cc11b5a5 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);
>      }
>  }

Preferably with an improved commit message:
Reviewed-by: Markus Armbruster <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]