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: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] error: report hints on stderr when no monitor
Date: Thu, 5 Jan 2017 09:39:15 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

On 01/05/2017 07:59 AM, Marc-André Lureau wrote:
> Report the error hint when running from the command line and reaching an
> 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.

[unrelated, but this reminds me: qemu-io allows '1m' and '1M' as
synonyms, but our command line parser is picky and requires the spelling
'1M'.  I wouldn't mind if we unified those two parsers, and make size
parsing case-insensitive everywhere]

> 
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
>  monitor.c | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Eric Blake <address@hidden>

> 
> 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);
>      }
>  }
>  
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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