From: Ian Jackson Subject: Re: [PATCH,RFC] More consistent error handling in libxl Date: Wed, 21 Jul 2010 16:49:11 +0100 Message-ID: <19527.5879.880920.412724@mariner.uk.xensource.com> References: <1279554263.1723.1889.camel@qabil.uk.xensource.com> <19527.5845.961826.356384@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <19527.5845.961826.356384@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Gianni Tedesco , Xen Devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org I wrote: > Gianni Tedesco writes ("[Xen-devel] [PATCH,RFC] More consistent error handling in libxl"): > > + int rc; > > + rc = xc_domain_pause(ctx->xch, domid); > > + return libxl_xc_error(rc); > > I'm afraid this pattern is wrong for two reasons. Firstly, > xc_domain_pause and functions like it do not return XC_ERROR_* values. > They typically return -1 on error, and set errno. > > Secondly, the error codes from libxc are not really all that useful. > They mostly serve to identify where the error originated. > > See the comment in xenctrl.h near line 70. I see Stefano has applied this already. I'm going to revert it. Ian.