From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v2 2/5] libxl: vcpuset: Return error values. Date: Wed, 18 Mar 2015 10:15:11 -0400 Message-ID: <20150318141510.GG13965@x230.dumpdata.com> References: <1426278403-12959-1-git-send-email-konrad.wilk@oracle.com> <1426278403-12959-3-git-send-email-konrad.wilk@oracle.com> <1426683978.14291.14.camel@citrix.com> <1426684085.14291.15.camel@citrix.com> <1426687747.2560.27.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYEkm-00076k-Cw for xen-devel@lists.xenproject.org; Wed, 18 Mar 2015 14:15:24 +0000 Content-Disposition: inline In-Reply-To: <1426687747.2560.27.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: Ian Jackson , Wei Liu , Stefano Stabellini , Ian Campbell , "xen-devel@lists.xenproject.org" List-Id: xen-devel@lists.xenproject.org On Wed, Mar 18, 2015 at 02:09:09PM +0000, Dario Faggioli wrote: > On Wed, 2015-03-18 at 13:08 +0000, Ian Campbell wrote: > > On Wed, 2015-03-18 at 13:06 +0000, Ian Campbell wrote: > > > On Fri, 2015-03-13 at 16:26 -0400, Konrad Rzeszutek Wilk wrote: > > > > The function does not return any values at all. Convert the > > > > internal libxl ones (ERROR_FAIL, ..., etc) to positive values > > > > and for the other cases just return standard libxl values. > > > > > > It's not clear why you want to do this, in particular returning > > > -ERROR_INVAL and inverting libxl error codes seems like a very strange > > > thing to be doing. > > > > BTW I know the xl error handling is horribly confused, and there are > > even a small number of instances of -ERROR_* already, but I think those > > are wrong and we shouldn't introduce more. > > > Indeed. I did some xl error code refactoring for a series of mine a few > days back, and as far as I could see, the most common pattern in xl is > returning 0 or 1. Gah, I seem to have looked at the wrong examples and thought that was the proper way! > > FWIW, I think we should not diverge any further from that and, at some > point, convert 0/1 to EXIT_SUCCESS/EXIT_FAILURE. > > > > I think you should either use ERROR_INVAL (not inverted) and propagate > > > libxl rc's directly or convert them into something which suits xl, i.e. > > > 0 and 1. > > > > Again, +1 for 0 or 1. > > Regards, > Dario