From: Ian Jackson Subject: Re: [PATCH v2] tools/libxl: libxl_get_scheduler should return an int Date: Fri, 21 Mar 2014 15:02:14 +0000 Message-ID: <21292.21622.375572.803747@mariner.uk.xensource.com> References: <1395404743-13833-1-git-send-email-julien.grall@linaro.org> <21292.19607.305924.483523@mariner.uk.xensource.com> <532C4F45.6020101@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WR0xp-0004Iy-Jy for xen-devel@lists.xenproject.org; Fri, 21 Mar 2014 15:02:29 +0000 In-Reply-To: <532C4F45.6020101@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org Julien Grall writes ("Re: [PATCH v2] tools/libxl: libxl_get_scheduler should return an int"): > On 03/21/2014 02:28 PM, Ian Jackson wrote: > > But then I don't understand why you changed this too. Either of these > > changes would suffice by itself, and the former is marginally less > > fiddly. > > The variable sched is a libxl_scheduler in this function. I can't modify > the type because it's used with lixbl_scheduler_from_string (see > xl_cmdimpl.c:6703). Ah. I think libxl_scheduler_from_string should be changed too. Having enums in APIs is not a good idea. One reason is that on some architectures the size or passing convention can depend on the range of the enum. So backporting a patch that adds a new _value_ to an enum can result in ABI breakage, even if the new value is never actually used! I realise that this is rather counterintuitive and I'm sorry I didn't spot this when it went in. Ian.