qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code
Date: Thu, 18 Jan 2018 17:19:56 -0500 (EST)

----- Eduardo Habkost <address@hidden> ha scritto:
> We can do some effort to document the preferred convention to
> return success/failure, but I don't think we will be able to
> convert the existing void/ret/bool functions to a single style
> (whatever it is) in a reasonable time.
> 
> That said, IMO returning 0/-1 or true/false is always preferred
> to returning void, so there's no need to add more local_err
> boilerplate code.

I strongly prefer having one way to say things, and having return value and 
Error*
(with no clear winner for return value) is a disadvantage. Your solution is
slightly more verbose in that it makes it harder to use && and ||, but I am not
even sure it is a disadvantage.  And the clear advantage that a full conversion
is mandatory and can be automated...

Paolo

> 
> -- 
> Eduardo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]