From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecIqo-0001ln-DQ for qemu-devel@nongnu.org; Thu, 18 Jan 2018 17:40:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecIql-0000Y7-BC for qemu-devel@nongnu.org; Thu, 18 Jan 2018 17:40:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34072) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ecIql-0000Xt-3V for qemu-devel@nongnu.org; Thu, 18 Jan 2018 17:39:59 -0500 Date: Thu, 18 Jan 2018 20:39:47 -0200 From: Eduardo Habkost Message-ID: <20180118223947.GK5292@localhost.localdomain> References: <20180118025245.13042-1-famz@redhat.com> <59cde1ab-cf5f-b40a-4377-b33091b593a2@redhat.com> <20180118213805.GI5292@localhost.localdomain> <800158468.913862.1516313996908.JavaMail.zimbra@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <800158468.913862.1516313996908.JavaMail.zimbra@redhat.com> Subject: Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Eric Blake , Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , Fam Zheng , "qemu-devel@nongnu.org Developers" , Stefan Hajnoczi , Markus Armbruster On Thu, Jan 18, 2018 at 05:19:56PM -0500, Paolo Bonzini wrote: > > ----- Eduardo Habkost 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/qemu-devel@nongnu.org/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