From: Ian Campbell Subject: Re: [PATCH v3-RESEND 09/28] libxl: make the libxl error type an IDL enum Date: Thu, 31 Oct 2013 18:07:54 +0000 Message-ID: <1383242874.5436.45.camel@dagon.hellion.org.uk> References: <1382362365-6645-1-git-send-email-rob.hoes@citrix.com> <1382362365-6645-10-git-send-email-rob.hoes@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1382362365-6645-10-git-send-email-rob.hoes@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: Rob Hoes Cc: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, 2013-10-21 at 14:32 +0100, Rob Hoes wrote: > diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c > index 16a92a4..11c53cf 100644 > --- a/tools/libxl/libxl_device.c > +++ b/tools/libxl/libxl_device.c > @@ -497,7 +497,7 @@ static void multidev_one_callback(libxl__egc *egc, libxl__ao_device *aodev) > { > STATE_AO_GC(aodev->ao); > libxl__multidev *multidev = aodev->multidev; > - int i, error = 0; > + int i, err = 0; Why the spurious s/error/err/ ? > diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl > index 5c43d6f..778a416 100644 > --- a/tools/libxl/libxl_types.idl > +++ b/tools/libxl/libxl_types.idl > @@ -28,6 +28,23 @@ MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT") > # Constants / Enumerations > # > > +libxl_error = Enumeration("error", [ [...] > + ], namespace = "") Ah, because you've defined "enum error" as an unnamespaced type. Irrespective of the clash you've found I think this is a no go since an application might reasonably be using "error" (also, err is a standard function too, see err.h and/or err(3)). Assuming the idl doesn't support anonymous enums (I don't recall writing anything to do that ;-)) and you quite reasonably don't want to add such support I think enum libxl_error as the name is fine. I wonder if we should begin transitioning over to using this as the return type. Probably mostly involves horrible pain... > + > libxl_domain_type = Enumeration("domain_type", [ > (-1, "INVALID"), > (1, "HVM"),