qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 08/11] qemu-img: introduce qemu_img_handle_er


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 08/11] qemu-img: introduce qemu_img_handle_error
Date: Thu, 28 Mar 2013 15:55:49 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

On 03/28/2013 03:42 PM, Eric Blake wrote:
> On 03/28/2013 10:47 AM, Pavel Hrdina wrote:
>> Signed-off-by: Pavel Hrdina <address@hidden>
>> ---
>>  qemu-img.c | 18 ++++++++++++------
>>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> Reviewed-by: Eric Blake <address@hidden>
> 
>> +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;
> 
> A non-bool positive number is unusual for errors (-1, or a true/false
> scheme, tend to be more common)...
> 
>> -    if (error_is_set(&local_err)) {
>> -        error_report("%s", error_get_pretty(local_err));
>> -        error_free(local_err);
>> -        return 1;
> 
> ...but it is accurate code motion, so it doesn't impact my review.

And in reading 9/11, I found out why it struck me as unusual.  I usually
spell it EXIT_FAILURE instead of 1, for a return status intended to be
used in a final exit() or return from main().  But that's a pre-existing
syndrome that affects much more of qemu-img.c, not worth changing here.

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