qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 03/23] error: Use error_report_err() instead


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 03/23] error: Use error_report_err() instead of monitor_printf()
Date: Thu, 17 Dec 2015 11:06:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 12/17/2015 09:49 AM, Markus Armbruster wrote:
> Using error_report_err() instead of monitor_printf() makes no
> difference when monitor_printf() is used correctly, i.e. within an HMP
> monitor.  Elsewhere, monitor_printf() does nothing, while
> error_report_err() reports to stderr.
> 
> Most changed functions are HMP command handlers.  These should only
> run within an HMP monitor.  The one exception is bdrv_password_cb(),
> which should also only run within an HMP monitor.
> 
> Four command handlers prefix the error message with the command name:
> balloon, migrate_set_capability, migrate_set_parameter, migrate.
> Pointless, drop.
> 
> Coccinelle semantic patch:
> 
>     @@
>     expression M, E;
>     @@
>     -    monitor_printf(M, "%s\n", error_get_pretty(E));
>     -    error_free(E);
>     +    error_report_err(E);
>     @r1@
>     expression M, E;
>     format F;
>     position p;
>     @@
>     -    monitor_printf(M, "address@hidden@\n", error_get_pretty(E));@p
>     -    error_free(E);
>     +    error_report_err(E);
>     @script:python@
>       p << r1.p;
>     @@
>     print "%s:%s:%s: prefix dropped" % (p[0].file, p[0].line, p[0].column)
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  hmp.c                 | 29 +++++++++--------------------
>  hw/s390x/s390-skeys.c |  3 +--
>  migration/savevm.c    |  3 +--
>  monitor.c             |  6 ++----
>  4 files changed, 13 insertions(+), 28 deletions(-)

Reviewed-by: Eric Blake <address@hidden>

-- 
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]