From: Ian Campbell Subject: Re: [PATCH 2/6] xl: Implement XENMEM_claim_pages support via 'claim_mode' global config Date: Mon, 15 Apr 2013 10:26:32 +0100 Message-ID: <1366017992.4963.19.camel@zakaz.uk.xensource.com> References: <1365623998-13710-1-git-send-email-konrad.wilk@oracle.com> <1365623998-13710-3-git-send-email-konrad.wilk@oracle.com> <20840.16881.907625.772933@mariner.uk.xensource.com> <20840.19597.331764.59016@mariner.uk.xensource.com> <20130412195104.GD19721@phenom.dumpdata.com> <20130412200759.GB20464@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130412200759.GB20464@phenom.dumpdata.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: Konrad Rzeszutek Wilk Cc: George Dunlap , Dan Magenheimer , "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org On Fri, 2013-04-12 at 21:07 +0100, Konrad Rzeszutek Wilk wrote: > On Fri, Apr 12, 2013 at 03:51:04PM -0400, Konrad Rzeszutek Wilk wrote: > > > Of these I prefer 1. Opinions ? Whatever we do needs to be in 4.3. > > > > There is also option 5. Define a new macro: > > > > diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h > > index 4922313..4a6ee76 100644 > > --- a/tools/libxl/libxl.h > > +++ b/tools/libxl/libxl.h > > @@ -359,6 +359,11 @@ typedef struct { > > int val; > > } libxl_defbool; > > > > +#define DEFINE_BOOL(name, _val) \ > > + libxl_defbool name = { .val = _val } > > +#define DEFINE_FALSE_BOOL(name) DEFINE_BOOL(name, LIBXL__DEFBOOL_FALSE) > > +#define DEFINE_TRUE_BOOL(name) DEFINE_BOOL(name, LIBXL__DEFBOOL_TRUE) > > + > > void libxl_defbool_set(libxl_defbool *db, bool b); > > /* Resets to default */ > > void libxl_defbool_unset(libxl_defbool *db); > > > > > > And use DEFINE_FALSE_BOOL(claim_mode) in the xl.h file. > > > > Correction (But now that I look at it, it is not that much nicer as you > end up with LIBXL__DEFBOOL in the header file. If this is the right way to go (I'm not sure) then I thing you just want to stop using defbool and use regular booleans, like the other xl options do. Ian.