From: Ian Campbell Subject: Re: [xen-devel] [PATCH] libxl: fix compile error of libvirt Date: Fri, 24 Feb 2012 12:42:02 +0000 Message-ID: <1330087322.8557.195.camel@zakaz.uk.xensource.com> References: <4F427C2B0200003000000BDD@novprvlin0050.provo.novell.com> <20291.56383.499378.463797@mariner.uk.xensource.com> <4F45109C02000030000011FC@novprvlin0050.provo.novell.com> <20292.55062.209546.961330@mariner.uk.xensource.com> <4F4560BC.30002@suse.com> <20295.32799.308331.653289@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20295.32799.308331.653289@mariner.uk.xensource.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 Jackson Cc: Jim Fehlig , "xen-devel@lists.xensource.com" , Bamvor Jian Zhang List-Id: xen-devel@lists.xenproject.org On Fri, 2012-02-24 at 12:18 +0000, Ian Jackson wrote: > Jim Fehlig writes ("Re: [Xen-devel] [xen-devel] [PATCH] libxl: fix compile error of libvirt"): > > The libvirt libxl driver doesn't use libxc directly. AFAICT, the problem > > is that libxl.h includes , which has this > > > > #if !defined(__XEN__) && !defined(__XEN_TOOLS__) > > #error "sysctl operations are intended for use by node control tools only" > > #endif > > > > Without the defines, Bamvor is hitting the #error directive. > > I see. Hmm. I have investigated further and: > > xl.c contained #include which is definitely very wrong. > when I > (a) #undef __XEN_TOOLS__ at the top of xl.c > (b) remove that > I can reproduce the error in-tree. Doing this with the two patches I sent yesterday works. (I resewnt them at the head of my repost of the "libxl: improved handling for default values in API" series. We should arrange for xl*.c to not have __XEN_TOOLS__ defined though. -D__XEN_TOOLS__ is part of the base CFLAGS defined in tools/Rules.mk but perhaps we could add -U__XEN_TOOLS__ to the xl specific cflags? > I'm unsure as to whether we should expect libxl callers include > . I think my view is that including these Xen public > headers for things like Xen sysctl numbers, scheduler parameter > numbers, etc., is fine. Ian, what do you think ? > > But we definitely need to do something to stop libxl callers, > including xl, including xenctrl.h. We can stop xl by just not doing it (TM), for other callers of libxl -- well, we say you shouldn't need it for toolstack operations and that libxl should provide all the functionality but if they _really_ want to ignore that... Also a toolstack may have functionality which is not considered "toolstack functionality" per the remit of libxl and for which they wish to use xenctrl directly. e.g. perhaps they communicate with a guest agent using their own shared ring protocol for which they require the ability to map domain memory. Ian.