qemu-devel
[Top][All Lists]
Advanced

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

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


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 04/23] error: Use error_report_err() instead of ad hoc prints
Date: Thu, 17 Dec 2015 13:10:32 -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:
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  contrib/ivshmem-server/main.c | 4 +---
>  qdev-monitor.c                | 3 +--
>  qemu-nbd.c                    | 3 +--
>  3 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c
> index 54ff001..00508b5 100644
> --- a/contrib/ivshmem-server/main.c
> +++ b/contrib/ivshmem-server/main.c
> @@ -106,9 +106,7 @@ ivshmem_server_parse_args(IvshmemServerArgs *args, int 
> argc, char *argv[])
>          case 'l': /* shm_size */
>              parse_option_size("shm_size", optarg, &args->shm_size, &errp);

Idea for a followup patch: The name 'errp' is most often associated with
type 'Error **'; but here it is 'Error *', which is confusing.

Other offenders in hmp.c, hw/core/nmi.c, include/qemu/sockets.h, and
tests/test-string-output-visitor.c.

>              if (errp) {
> -                fprintf(stderr, "cannot parse shm size: %s\n",
> -                        error_get_pretty(errp));
> -                error_free(errp);
> +                error_report_err(errp);

This loses the "cannot parse shm size: " prefix; but I don't think that
hurts.  Could use a mention in the commit message, though.

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]