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: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code
Date: Thu, 18 Jan 2018 20:39:47 -0200
User-agent: Mutt/1.9.1 (2017-09-22)

On Thu, Jan 18, 2018 at 05:19:56PM -0500, Paolo Bonzini wrote:
> 
> ----- 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. [...]


I sympathize with this argument.

...wait, now we're repeating the discussion from the previous
thread:

https://www.mail-archive.com/address@hidden/msg461702.html


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

Well, even if we don't decide about void vs non-void right now,
we would still need something better to live with until a
conversion to non-void is finished.  I think I should rebase and
resubmit my ERR_IS_SET series.

-- 
Eduardo



reply via email to

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