From: Ian Jackson Subject: Re: [PATCH] Consistent handling of libxc errors in libxl (take 2) Date: Fri, 23 Jul 2010 17:26:44 +0100 Message-ID: <19529.49860.276842.907019@mariner.uk.xensource.com> References: <1279818801.1723.2025.camel@qabil.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1279818801.1723.2025.camel@qabil.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 Cc: Xen Devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Gianni Tedesco writes ("[Xen-devel] [PATCH] Consistent handling of libxc errors in libxl (take 2)"): > Removed mapping from libxc error codes to libxl - this is redundant because > libxl ought to return -1 with errno set to a meaningful value. Now simply log > the contents of errno before returning ERROR_FAIL if an xc call fails. Every > caller in libxl should now be covered this way except for pci device removals > and domain destroys where release of resources ought to continue even if an > error occurs in an early step. In this case the error is still logged at least Thanks for that patch. It all looks great apart from this: > diff -r b0b1a6163203 -r 8eaf5d79718f tools/libxl/libxl_dom.c > --- a/tools/libxl/libxl_dom.c Thu Jul 22 15:24:49 2010 +0100 > +++ b/tools/libxl/libxl_dom.c Thu Jul 22 18:11:52 2010 +0100 > @@ -212,7 +212,7 @@ int build_pv(struct libxl_ctx *ctx, uint > ret = 0; > out: > xc_dom_release(dom); > - return libxl_xc_error(ret); > + return ERROR_FAIL; > } This isn't correct because ret might be 0. I've fixed it up and applied it. Thanks, Ian.