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, "...%@F@\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 <arm...@redhat.com>
> ---
>  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 <ebl...@redhat.com>

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