qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 01/12] qemu-img: introduce qemu_img_handle_er


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 01/12] qemu-img: introduce qemu_img_handle_error()
Date: Wed, 24 Apr 2013 10:44:03 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5

On 04/24/2013 09:31 AM, Pavel Hrdina wrote:
> Later in the patch series we will use this function a few times.
> This will avoid duplicating the code.
> 
> Signed-off-by: Pavel Hrdina <address@hidden>
> ---
>  qemu-img.c | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)


>  
> +static int qemu_img_handle_error(Error *err)
> +{
> +    if (error_is_set(&err)) {
> +        error_report("%s", error_get_pretty(err));
> +        error_free(err);
> +        return 1;
> +    }
> +    return 0;

Maybe it's just me, but I think returning EXIT_SUCCESS/EXIT_FAILURE
instead of 0/1 is a bit nicer at expressing why we chose a positive
value; but that would be a separate cleanup to all of qemu-img.c.
Hence, I have no problems giving:

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]