From: Ian Jackson Subject: Re: [PATCH/RFC] don't include in libxl.h Date: Fri, 7 Oct 2011 18:43:41 +0100 Message-ID: <20111.14925.196745.735565@mariner.uk.xensource.com> References: <20111005181413.GA32317@bogon.sigxcpu.org> <20111007170528.GA21562@bogon.sigxcpu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20111007170528.GA21562@bogon.sigxcpu.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Guido =?iso-8859-1?Q?G=FCnther?= Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Guido Günther writes ("[Xen-devel] [PATCH/RFC] don't include in l> Hi, > I'm unsure if libvirt qualifies as "node control tool": Not in this context. > In file included from /tmp/usr/include/libxl.h:137:0, > from libxl/libxl_conf.c:28: > /tmp/usr/include/xen/sysctl.h:31:2: error: #error "sysctl operations are intended for use by node control tools only" > In file included from /tmp/usr/include/xen/sysctl.h:35:0, > from /tmp/usr/include/libxl.h:137, > from libxl/libxl_conf.c:28: > > If not it makes sense to remove the include from libxl.h and include it > in xl_cmdimpl.c directly. This allows libvirt to include libxl.h again > without defining __XEN_TOOLS__. I think neither libxl.h nor xl_cmdimpl should drag in sysctl.h this way. xl needs them because of this: if (info.phys_cap & XEN_SYSCTL_PHYSCAP_hvm) printf(" hvm"); if (info.phys_cap & XEN_SYSCTL_PHYSCAP_hvm_directio) printf(" hvm_directio"); Either libxl should proxy these kinds of flags, or the flags should be moved to a public header file, or all libxl callers should automatically get __XEN_TOOLS__. Ian.