From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v2 5/5] libxl: Add explicit cast to libxl_psr_cat_set_cbm Date: Tue, 19 Jan 2016 14:31:07 +0000 Message-ID: <569E48AB.6060704@citrix.com> References: <1451925649.13361.193.camel@citrix.com> <1453183100-50700-1-git-send-email-czylin@uwaterloo.ca> <22174.17133.666899.340909@mariner.uk.xensource.com> <1453213287.29930.52.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1453213287.29930.52.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 , Ian Jackson , Chester Lin Cc: stefano.stabellini@eu.citrix.com, george.dunlap@eu.citrix.com, dario.faggioli@citrix.com, xen-devel@lists.xen.org, jtotto@uwaterloo.ca, hjarmstr@uwaterloo.ca List-Id: xen-devel@lists.xenproject.org On 19/01/16 14:21, Ian Campbell wrote: > On Tue, 2016-01-19 at 14:06 +0000, Ian Jackson wrote: >> I am not a fan of the cast as a solution. I would rather, prefer to >> regularise the situation. If my co-maintainers agree about the >> desirability of expecting libxl callers to use enum values from Xen >> public headers, > I think part of the problem is that it is hard to expose just the desired > bits through to the user of libxl without also exposing the full xen > hypercall interface (the vast majority of which would be inappropriate to > expose to them since libxl is suppose to encapsulate such things). I agree with this sentiment... > As a possible alternative, we could make it such that the IDL generator > knows about the linkage and enforces the use of the same values, and > automatically provides conversion helpers (essential a cast wrapped in some > syntax) for _internal_ use. ...and using the IDL to enforce or generate values was my first thought. -George