WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH,RFC] More consistent error handling in libxl

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH,RFC] More consistent error handling in libxl
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Wed, 21 Jul 2010 17:13:42 +0100
Cc: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Gianni Tedesco \(3P\)" <gianni.tedesco@xxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Wed, 21 Jul 2010 09:13:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19527.5845.961826.356384@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1279554263.1723.1889.camel@xxxxxxxxxxxxxxxxxxxxxx> <19527.5845.961826.356384@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Wed, 21 Jul 2010, Ian Jackson 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.
> 
 
The patch is an improvement over what we have now, besides
libxl_xc_error is capable of handling -1, even though it just returns
ERROR_FAIL in that case. The other libxc return codes might be useful so
it would be nice to keep them. We could make libxl_xc_error smarter too.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>