From: Ian Jackson Subject: Re: [PATCH RFC 1/9] libxl idl: add comments to error enum Date: Fri, 26 Jun 2015 15:33:05 +0100 Message-ID: <21901.25249.450124.562601@mariner.uk.xensource.com> References: <1435153656-19485-1-git-send-email-rob.hoes@citrix.com> <1435153656-19485-2-git-send-email-rob.hoes@citrix.com> <21898.51085.533137.102452@mariner.uk.xensource.com> <89DF2239-8BCA-4D88-BE6A-D9323FCE0002@citrix.com> <1435328774.32500.191.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 1Z8Ugs-00040i-8e for xen-devel@lists.xenproject.org; Fri, 26 Jun 2015 14:33:14 +0000 In-Reply-To: <1435328774.32500.191.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: Ian Campbell Cc: "xen-devel@lists.xenproject.org" , Euan Harris , Rob Hoes List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [Xen-devel] [PATCH RFC 1/9] libxl idl: add comments to error enum"): > It would be a bit wrong to have an application specific error code in > the library space. Yes. > Perhaps we should declare some ranges which for specific uses. For > instance perhaps 0x7FFF0000..0x7FFFFFFF could be set aside for the > application, so xl can define itself some errors which it can use for > its own needs without needing to handle two separate error spaces. xl > could then define these codes itself. All libxl errors are negative and no libxl function returns (either (a nonnegative success value) or (a negative error code)). If we were just to promise that then the application has a wide space of numbers. > Likewise perhaps libxl internal errors should be given their own range, > which the application can legitimately expect never to see. This is unwise; they might escape... > I was originally think about this in the context of the xenstore patch > in this series, i.e. declaring that some range is used for the existing > XS error codes (e.g. 0x3000xxxx is a xenstore code). I'm not sure if > that's a good idea or not. I have no objection to mapping existing error code spaces into libxl ones. But we need to do this with a bit of care. I think passing xenstore or hypervisor errno numbers directly to the caller will often be a bad idea. Ian.