From patchwork Fri Aug 1 15:32:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 34714 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C180720540 for ; Fri, 1 Aug 2014 15:35:38 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id wn1sf18379371obc.6 for ; Fri, 01 Aug 2014 08:35:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=FC8wDSLr9xrm4aTkJlAMaiy7MzwUNVxfMkjQ74+avEI=; b=hrXg0ebgunQ7L6TfplOYMn5aPYUn1VcHumhNmb6SmUHS8IUCsj6tCbkClQuekyHuqp xu7SanNXLpMA+vj9ZTNFAyApkyFJmhwuSLq0W6mCsY6aeeW9XGdVoh9gvy6q8fQESKnr 9KDqe60Ia7pVmPvA/xYL9QemWeF17TEgG3KDOB8pHfQ272Zj13V2TvU/4gqX29kKB90f Z5QT/Yv+33KTNqLy12J+Lx86aNsbWhR5W3Mqb3FxnLBHX/KoTLC9t/iID0ao3k1f4mwh 8i89397A9NT5r4aiwnoRJhJvKnn3UVdVHMXz7KOqcwDc41IO0L+f9s0N672T4ToQbXtF 2gBg== X-Gm-Message-State: ALoCoQkDA31aDmQQXTklN3CmD+zy9n3EEoa9ymNwoGII4E8Os/7hpsZhUJujr9Uyho1Lxu7R1XSy X-Received: by 10.50.117.10 with SMTP id ka10mr2325875igb.1.1406907337024; Fri, 01 Aug 2014 08:35:37 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.37 with SMTP id q34ls66611qgd.5.gmail; Fri, 01 Aug 2014 08:35:36 -0700 (PDT) X-Received: by 10.220.46.5 with SMTP id h5mr3631018vcf.55.1406907336878; Fri, 01 Aug 2014 08:35:36 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id cu9si7633179vec.14.2014.08.01.08.35.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Aug 2014 08:35:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so6929037vcb.29 for ; Fri, 01 Aug 2014 08:35:36 -0700 (PDT) X-Received: by 10.52.144.14 with SMTP id si14mr2401019vdb.95.1406907336520; Fri, 01 Aug 2014 08:35:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp120110vcb; Fri, 1 Aug 2014 08:35:36 -0700 (PDT) X-Received: by 10.50.32.73 with SMTP id g9mr8919116igi.31.1406907335178; Fri, 01 Aug 2014 08:35:35 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id l15si7243740igk.10.2014.08.01.08.35.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 01 Aug 2014 08:35:35 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XDEpv-0004G2-4c; Fri, 01 Aug 2014 15:33:39 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XDEpu-0004FV-02 for xen-devel@lists.xensource.com; Fri, 01 Aug 2014 15:33:38 +0000 Received: from [85.158.139.211:40874] by server-3.bemta-5.messagelabs.com id 6F/45-13873-153BBD35; Fri, 01 Aug 2014 15:33:37 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-15.tower-206.messagelabs.com!1406907213!8012963!3 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3944 invoked from network); 1 Aug 2014 15:33:36 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 1 Aug 2014 15:33:36 -0000 X-IronPort-AV: E=Sophos;i="5.01,780,1400025600"; d="scan'208";a="158505086" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.3.181.6; Fri, 1 Aug 2014 11:33:32 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XDEpj-0005vC-CJ; Fri, 01 Aug 2014 16:33:27 +0100 From: Stefano Stabellini To: Date: Fri, 1 Aug 2014 16:32:17 +0100 Message-ID: <1406907139-16800-1-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH v4 1/3] Move xenstore and libxc public headers to include subdir X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Also moves xc_dom.h to include as it is used often by other xen tools. Use the new include subdirectories to build Xen tools and qemu-xen. Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require internal libxc headers to build. This patch should be applied at the same time at this patch for qemu-xen-traditional (also sent as part of this series): http://marc.info/?l=xen-devel&m=140500949902568 Signed-off-by: Stefano Stabellini Also moves xc_dom.h to include as it is used often by other xen tools. Use the new include subdirectories to build Xen tools and qemu-xen. Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require internal libxc headers to build. Signed-off-by: Stefano Stabellini --- tools/Makefile | 6 +++--- tools/Rules.mk | 6 +++--- tools/blktap2/drivers/Makefile | 2 ++ tools/libxc/Makefile | 6 +++--- tools/libxc/{ => include}/xc_dom.h | 0 tools/libxc/{ => include}/xenctrl.h | 0 tools/libxc/{ => include}/xenctrlosdep.h | 0 tools/libxc/{ => include}/xenguest.h | 0 tools/libxc/{ => include}/xentoollog.h | 0 tools/misc/Makefile | 2 ++ tools/python/setup.py | 6 +++--- tools/xcutils/Makefile | 3 ++- tools/xenpaging/Makefile | 3 ++- tools/xenstore/Makefile | 9 +++++---- tools/xenstore/{ => include}/compat/xs.h | 0 tools/xenstore/{ => include}/compat/xs_lib.h | 0 tools/xenstore/{ => include}/xenstore.h | 0 tools/xenstore/{ => include}/xenstore_lib.h | 0 18 files changed, 25 insertions(+), 18 deletions(-) rename tools/libxc/{ => include}/xc_dom.h (100%) rename tools/libxc/{ => include}/xenctrl.h (100%) rename tools/libxc/{ => include}/xenctrlosdep.h (100%) rename tools/libxc/{ => include}/xenguest.h (100%) rename tools/libxc/{ => include}/xentoollog.h (100%) rename tools/xenstore/{ => include}/compat/xs.h (100%) rename tools/xenstore/{ => include}/compat/xs_lib.h (100%) rename tools/xenstore/{ => include}/xenstore.h (100%) rename tools/xenstore/{ => include}/xenstore_lib.h (100%) diff --git a/tools/xenstore/compat/xs.h b/tools/xenstore/include/compat/xs.h similarity index 100% rename from tools/xenstore/compat/xs.h rename to tools/xenstore/include/compat/xs.h diff --git a/tools/xenstore/compat/xs_lib.h b/tools/xenstore/include/compat/xs_lib.h similarity index 100% rename from tools/xenstore/compat/xs_lib.h rename to tools/xenstore/include/compat/xs_lib.h diff --git a/tools/xenstore/xenstore.h b/tools/xenstore/include/xenstore.h similarity index 100% rename from tools/xenstore/xenstore.h rename to tools/xenstore/include/xenstore.h diff --git a/tools/xenstore/xenstore_lib.h b/tools/xenstore/include/xenstore_lib.h similarity index 100% rename from tools/xenstore/xenstore_lib.h rename to tools/xenstore/include/xenstore_lib.h diff --git a/tools/Makefile b/tools/Makefile index b6476c9..1130369 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -192,9 +192,9 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find --includedir=$(PREFIX)/lib/xen/include \ --source-path=$$source \ --extra-cflags="-I$(XEN_ROOT)/tools/include \ - -I$(XEN_ROOT)/tools/libxc \ - -I$(XEN_ROOT)/tools/xenstore \ - -I$(XEN_ROOT)/tools/xenstore/compat \ + -I$(XEN_ROOT)/tools/libxc/include \ + -I$(XEN_ROOT)/tools/xenstore/include \ + -I$(XEN_ROOT)/tools/xenstore/compat/include \ $(EXTRA_CFLAGS_QEMU_XEN)" \ --extra-ldflags="-L$(XEN_ROOT)/tools/libxc \ -L$(XEN_ROOT)/tools/xenstore \ diff --git a/tools/Rules.mk b/tools/Rules.mk index 0aa1e6b..4e07e82 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -35,15 +35,15 @@ INSTALL_SHLIB = : install-shlib-unsupported-fail SYMLINK_SHLIB = : symlink-shlib-unsupported-fail endif -CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude) +CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude) LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension) SHLIB_libxenctrl = -Wl,-rpath-link=$(XEN_LIBXC) -CFLAGS_libxenguest = -I$(XEN_LIBXC) $(CFLAGS_xeninclude) +CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude) LDLIBS_libxenguest = $(XEN_LIBXC)/libxenguest$(libextension) SHLIB_libxenguest = -Wl,-rpath-link=L$(XEN_LIBXC) -CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_xeninclude) +CFLAGS_libxenstore = -I$(XEN_XENSTORE)/include $(CFLAGS_xeninclude) LDLIBS_libxenstore = $(XEN_XENSTORE)/libxenstore$(libextension) SHLIB_libxenstore = -Wl,-rpath-link=$(XEN_XENSTORE) diff --git a/tools/blktap2/drivers/Makefile b/tools/blktap2/drivers/Makefile index 1129ca1..7df9bc4 100644 --- a/tools/blktap2/drivers/Makefile +++ b/tools/blktap2/drivers/Makefile @@ -16,6 +16,8 @@ CFLAGS += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += -D_GNU_SOURCE CFLAGS += -DUSE_NFS_LOCKS +# drivers/block-log.c incorrectly uses libxc internals +CFLAGS += -I$(XEN_ROOT)/tools/libxc ifeq ($(CONFIG_X86_64),y) CFLAGS += -fPIC diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index 22eef8e..83fcd3c 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -89,7 +89,7 @@ OSDEP_SRCS-y += xenctrl_osdep_ENOSYS.c -include $(XEN_TARGET_ARCH)/Makefile CFLAGS += -Werror -Wmissing-prototypes -CFLAGS += -I. $(CFLAGS_xeninclude) +CFLAGS += -I. -I./include $(CFLAGS_xeninclude) # Needed for posix_fadvise64() in xc_linux.c CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE @@ -140,12 +140,12 @@ install: build $(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(LIBDIR) $(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR) $(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so - $(INSTALL_DATA) xenctrl.h xenctrlosdep.h xentoollog.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h include/xentoollog.h $(DESTDIR)$(INCLUDEDIR) $(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR) $(INSTALL_DATA) libxenguest.a $(DESTDIR)$(LIBDIR) $(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR) $(SYMLINK_SHLIB) libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so - $(INSTALL_DATA) xenguest.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) include/xenguest.h $(DESTDIR)$(INCLUDEDIR) .PHONY: TAGS TAGS: diff --git a/tools/libxc/xc_dom.h b/tools/libxc/include/xc_dom.h similarity index 100% rename from tools/libxc/xc_dom.h rename to tools/libxc/include/xc_dom.h diff --git a/tools/libxc/xenctrl.h b/tools/libxc/include/xenctrl.h similarity index 100% rename from tools/libxc/xenctrl.h rename to tools/libxc/include/xenctrl.h diff --git a/tools/libxc/xenctrlosdep.h b/tools/libxc/include/xenctrlosdep.h similarity index 100% rename from tools/libxc/xenctrlosdep.h rename to tools/libxc/include/xenctrlosdep.h diff --git a/tools/libxc/xenguest.h b/tools/libxc/include/xenguest.h similarity index 100% rename from tools/libxc/xenguest.h rename to tools/libxc/include/xenguest.h diff --git a/tools/libxc/xentoollog.h b/tools/libxc/include/xentoollog.h similarity index 100% rename from tools/libxc/xentoollog.h rename to tools/libxc/include/xentoollog.h diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 69b1817..266fd16 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -6,6 +6,8 @@ CFLAGS += -Werror CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += $(CFLAGS_xeninclude) CFLAGS += $(CFLAGS_libxenstore) +# xen-hptool.c and xen-mfndump.c incorrectly use libxc internals +CFLAGS += -I$(XEN_ROOT)/tools/libxc HDRS = $(wildcard *.h) diff --git a/tools/python/setup.py b/tools/python/setup.py index 17ebb4a..439c429 100644 --- a/tools/python/setup.py +++ b/tools/python/setup.py @@ -13,7 +13,7 @@ PATH_XENSTORE = XEN_ROOT + "/tools/xenstore" xc = Extension("xc", extra_compile_args = extra_compile_args, - include_dirs = [ PATH_XEN, PATH_LIBXC, "xen/lowlevel/xc" ], + include_dirs = [ PATH_XEN, PATH_LIBXC + "/include", "xen/lowlevel/xc" ], library_dirs = [ PATH_LIBXC ], libraries = [ "xenctrl", "xenguest" ], depends = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so" ], @@ -21,7 +21,7 @@ xc = Extension("xc", xs = Extension("xs", extra_compile_args = extra_compile_args, - include_dirs = [ PATH_XEN, PATH_XENSTORE, "xen/lowlevel/xs" ], + include_dirs = [ PATH_XEN, PATH_XENSTORE + "/include", "xen/lowlevel/xs" ], library_dirs = [ PATH_XENSTORE ], libraries = [ "xenstore" ], depends = [ PATH_XENSTORE + "/libxenstore.so" ], @@ -29,7 +29,7 @@ xs = Extension("xs", xl = Extension("xl", extra_compile_args = extra_compile_args, - include_dirs = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC, "xen/lowlevel/xl" ], + include_dirs = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC + "/include", "xen/lowlevel/xl" ], library_dirs = [ PATH_LIBXL ], libraries = [ "xenlight" ], depends = [ PATH_LIBXL + "/libxenlight.so" ], diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile index 98706bf..f71703d 100644 --- a/tools/xcutils/Makefile +++ b/tools/xcutils/Makefile @@ -15,7 +15,8 @@ PROGRAMS = readnotes lsevtchn CFLAGS += -Werror -CFLAGS_readnotes.o := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) +# incorrectly uses libxc internals +CFLAGS_readnotes.o := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) -I$(XEN_ROOT)/tools/libxc CFLAGS_lsevtchn.o := $(CFLAGS_libxenctrl) .PHONY: all diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile index 548d9dd..054562d 100644 --- a/tools/xenpaging/Makefile +++ b/tools/xenpaging/Makefile @@ -1,7 +1,8 @@ XEN_ROOT=$(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk -CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) +# xenpaging.c and file_ops.c incorrectly use libxc internals +CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) -I$(XEN_ROOT)/tools/libxc LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS) LDFLAGS += $(PTHREAD_LDFLAGS) diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile index 08460c8..d0ac949 100644 --- a/tools/xenstore/Makefile +++ b/tools/xenstore/Makefile @@ -7,6 +7,7 @@ MINOR = 3 CFLAGS += -Werror CFLAGS += -I. CFLAGS += -I$(XEN_ROOT)/tools/ +CFLAGS += -I./include CFLAGS += $(CFLAGS_libxenctrl) CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod @@ -135,10 +136,10 @@ endif ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR) ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so $(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR) - $(INSTALL_DATA) xenstore.h $(DESTDIR)$(INCLUDEDIR) - $(INSTALL_DATA) xenstore_lib.h $(DESTDIR)$(INCLUDEDIR) - $(INSTALL_DATA) compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h - $(INSTALL_DATA) compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h + $(INSTALL_DATA) include/xenstore.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) include/xenstore_lib.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) include/compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h + $(INSTALL_DATA) include/compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h ln -sf xenstore-compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xs.h ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xs_lib.h