From patchwork Sun Aug 23 09:34:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731465 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E918E722 for ; Sun, 23 Aug 2020 09:37:32 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF2C420768 for ; Sun, 23 Aug 2020 09:37:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF2C420768 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPN-0004t3-HC; Sun, 23 Aug 2020 09:35:25 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPM-0004sy-GF for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:24 +0000 X-Inumbo-ID: c3a2dcc9-c64c-4949-bdd4-4dcf18c40360 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c3a2dcc9-c64c-4949-bdd4-4dcf18c40360; Sun, 23 Aug 2020 09:35:23 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 29BBCAC7F; Sun, 23 Aug 2020 09:35:52 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Samuel Thibault Subject: [PATCH v3 01/38] stubdom: add stubdom/mini-os.mk for Xen paths used by Mini-OS Date: Sun, 23 Aug 2020 11:34:42 +0200 Message-Id: <20200823093519.18386-2-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" stubdom/mini-os.mk should contain paths used by Mini-OS when built as stubdom. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- stubdom/mini-os.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 stubdom/mini-os.mk diff --git a/stubdom/mini-os.mk b/stubdom/mini-os.mk new file mode 100644 index 0000000000..32528bb91f --- /dev/null +++ b/stubdom/mini-os.mk @@ -0,0 +1,17 @@ +# Included by Mini-OS stubdom builds to set variables depending on Xen +# internal paths. +# +# Input variables are: +# XEN_ROOT +# MINIOS_TARGET_ARCH + +XENSTORE_CPPFLAGS = -isystem $(XEN_ROOT)/tools/xenstore/include +TOOLCORE_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toolcore +TOOLLOG_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog +EVTCHN_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn +GNTTAB_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/gnttab +CALL_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/call +FOREIGNMEMORY_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/foreignmemory +DEVICEMODEL_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/devicemodel +CTRL_PATH = $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) +GUEST_PATH = $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) From patchwork Sun Aug 23 09:34:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731483 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4D12C722 for ; Sun, 23 Aug 2020 09:37:51 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 288FA20768 for ; Sun, 23 Aug 2020 09:37:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 288FA20768 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPf-000529-OE; Sun, 23 Aug 2020 09:35:43 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPd-0004t9-Rz for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:41 +0000 X-Inumbo-ID: fbaca798-90e0-4597-aa41-c9a61750642d Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id fbaca798-90e0-4597-aa41-c9a61750642d; Sun, 23 Aug 2020 09:35:23 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4E87CAD26; Sun, 23 Aug 2020 09:35:52 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , George Dunlap , Nick Rosbrook Subject: [PATCH v3 02/38] tools: switch XEN_LIBXEN* make variables to lower case (XEN_libxen*) Date: Sun, 23 Aug 2020 11:34:43 +0200 Message-Id: <20200823093519.18386-3-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" In order to harmonize names of library related make variables switch XEN_LIBXEN* names to XEN_libxen*, as all other related variables (e.g. CFLAGS_libxen*, SHDEPS_libxen*, ...) already use this pattern. Rename XEN_LIBXC to XEN_libxenctrl, XEN_XENSTORE to XEN_libxenstore, XEN_XENLIGHT to XEN_libxenlight, XEN_XLUTIL to XEN_libxlutil, and XEN_LIBVCHAN to XEN_libxenvchan for the same reason. Introduce XEN_libxenguest with the same value as XEN_libxenctrl. No functional change. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/Rules.mk | 120 +++++++++++++++--------------- tools/golang/xenlight/Makefile | 4 +- tools/libs/call/Makefile | 2 +- tools/libs/devicemodel/Makefile | 2 +- tools/libs/evtchn/Makefile | 2 +- tools/libs/foreignmemory/Makefile | 2 +- tools/libs/gnttab/Makefile | 2 +- tools/libs/hypfs/Makefile | 2 +- tools/libs/toolcore/Makefile | 2 +- tools/libs/toollog/Makefile | 2 +- tools/libvchan/Makefile | 2 +- tools/libxc/Makefile | 2 +- tools/xenstat/libxenstat/Makefile | 2 +- tools/xenstore/Makefile | 2 +- 14 files changed, 75 insertions(+), 73 deletions(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index 5ed5664bf7..b42e50ebf6 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -12,21 +12,23 @@ INSTALL = $(XEN_ROOT)/tools/cross-install LDFLAGS += $(PREPEND_LDFLAGS_XEN_TOOLS) XEN_INCLUDE = $(XEN_ROOT)/tools/include -XEN_LIBXENTOOLCORE = $(XEN_ROOT)/tools/libs/toolcore -XEN_LIBXENTOOLLOG = $(XEN_ROOT)/tools/libs/toollog -XEN_LIBXENEVTCHN = $(XEN_ROOT)/tools/libs/evtchn -XEN_LIBXENGNTTAB = $(XEN_ROOT)/tools/libs/gnttab -XEN_LIBXENCALL = $(XEN_ROOT)/tools/libs/call -XEN_LIBXENFOREIGNMEMORY = $(XEN_ROOT)/tools/libs/foreignmemory -XEN_LIBXENDEVICEMODEL = $(XEN_ROOT)/tools/libs/devicemodel -XEN_LIBXENHYPFS = $(XEN_ROOT)/tools/libs/hypfs -XEN_LIBXC = $(XEN_ROOT)/tools/libxc -XEN_XENLIGHT = $(XEN_ROOT)/tools/libxl +XEN_libxentoolcore = $(XEN_ROOT)/tools/libs/toolcore +XEN_libxentoollog = $(XEN_ROOT)/tools/libs/toollog +XEN_libxenevtchn = $(XEN_ROOT)/tools/libs/evtchn +XEN_libxengnttab = $(XEN_ROOT)/tools/libs/gnttab +XEN_libxencall = $(XEN_ROOT)/tools/libs/call +XEN_libxenforeignmemory = $(XEN_ROOT)/tools/libs/foreignmemory +XEN_libxendevicemodel = $(XEN_ROOT)/tools/libs/devicemodel +XEN_libxenhypfs = $(XEN_ROOT)/tools/libs/hypfs +XEN_libxenctrl = $(XEN_ROOT)/tools/libxc +# Currently libxenguest lives in the same directory as libxenctrl +XEN_libxenguest = $(XEN_libxenctrl) +XEN_libxenlight = $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight -XEN_XLUTIL = $(XEN_XENLIGHT) -XEN_XENSTORE = $(XEN_ROOT)/tools/xenstore -XEN_LIBXENSTAT = $(XEN_ROOT)/tools/xenstat/libxenstat/src -XEN_LIBVCHAN = $(XEN_ROOT)/tools/libvchan +XEN_libxlutil = $(XEN_libxenlight) +XEN_libxenstore = $(XEN_ROOT)/tools/xenstore +XEN_libxenstat = $(XEN_ROOT)/tools/xenstat/libxenstat/src +XEN_libxenvchan = $(XEN_ROOT)/tools/libvchan CFLAGS_xeninclude = -I$(XEN_INCLUDE) @@ -97,75 +99,75 @@ endif # Consumers of libfoo should not directly use $(SHDEPS_libfoo) or # $(SHLIB_libfoo) -CFLAGS_libxentoollog = -I$(XEN_LIBXENTOOLLOG)/include $(CFLAGS_xeninclude) +CFLAGS_libxentoollog = -I$(XEN_libxentoollog)/include $(CFLAGS_xeninclude) SHDEPS_libxentoollog = -LDLIBS_libxentoollog = $(SHDEPS_libxentoollog) $(XEN_LIBXENTOOLLOG)/libxentoollog$(libextension) -SHLIB_libxentoollog = $(SHDEPS_libxentoollog) -Wl,-rpath-link=$(XEN_LIBXENTOOLLOG) +LDLIBS_libxentoollog = $(SHDEPS_libxentoollog) $(XEN_libxentoollog)/libxentoollog$(libextension) +SHLIB_libxentoollog = $(SHDEPS_libxentoollog) -Wl,-rpath-link=$(XEN_libxentoollog) -CFLAGS_libxentoolcore = -I$(XEN_LIBXENTOOLCORE)/include $(CFLAGS_xeninclude) +CFLAGS_libxentoolcore = -I$(XEN_libxentoolcore)/include $(CFLAGS_xeninclude) SHDEPS_libxentoolcore = -LDLIBS_libxentoolcore = $(SHDEPS_libxentoolcore) $(XEN_LIBXENTOOLCORE)/libxentoolcore$(libextension) -SHLIB_libxentoolcore = $(SHDEPS_libxentoolcore) -Wl,-rpath-link=$(XEN_LIBXENTOOLCORE) +LDLIBS_libxentoolcore = $(SHDEPS_libxentoolcore) $(XEN_libxentoolcore)/libxentoolcore$(libextension) +SHLIB_libxentoolcore = $(SHDEPS_libxentoolcore) -Wl,-rpath-link=$(XEN_libxentoolcore) -CFLAGS_libxenevtchn = -I$(XEN_LIBXENEVTCHN)/include $(CFLAGS_xeninclude) +CFLAGS_libxenevtchn = -I$(XEN_libxenevtchn)/include $(CFLAGS_xeninclude) SHDEPS_libxenevtchn = $(SHLIB_libxentoolcore) -LDLIBS_libxenevtchn = $(SHDEPS_libxenevtchn) $(XEN_LIBXENEVTCHN)/libxenevtchn$(libextension) -SHLIB_libxenevtchn = $(SHDEPS_libxenevtchn) -Wl,-rpath-link=$(XEN_LIBXENEVTCHN) +LDLIBS_libxenevtchn = $(SHDEPS_libxenevtchn) $(XEN_libxenevtchn)/libxenevtchn$(libextension) +SHLIB_libxenevtchn = $(SHDEPS_libxenevtchn) -Wl,-rpath-link=$(XEN_libxenevtchn) -CFLAGS_libxengnttab = -I$(XEN_LIBXENGNTTAB)/include $(CFLAGS_xeninclude) +CFLAGS_libxengnttab = -I$(XEN_libxengnttab)/include $(CFLAGS_xeninclude) SHDEPS_libxengnttab = $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) -LDLIBS_libxengnttab = $(SHDEPS_libxengnttab) $(XEN_LIBXENGNTTAB)/libxengnttab$(libextension) -SHLIB_libxengnttab = $(SHDEPS_libxengnttab) -Wl,-rpath-link=$(XEN_LIBXENGNTTAB) +LDLIBS_libxengnttab = $(SHDEPS_libxengnttab) $(XEN_libxengnttab)/libxengnttab$(libextension) +SHLIB_libxengnttab = $(SHDEPS_libxengnttab) -Wl,-rpath-link=$(XEN_libxengnttab) -CFLAGS_libxencall = -I$(XEN_LIBXENCALL)/include $(CFLAGS_xeninclude) +CFLAGS_libxencall = -I$(XEN_libxencall)/include $(CFLAGS_xeninclude) SHDEPS_libxencall = $(SHLIB_libxentoolcore) -LDLIBS_libxencall = $(SHDEPS_libxencall) $(XEN_LIBXENCALL)/libxencall$(libextension) -SHLIB_libxencall = $(SHDEPS_libxencall) -Wl,-rpath-link=$(XEN_LIBXENCALL) +LDLIBS_libxencall = $(SHDEPS_libxencall) $(XEN_libxencall)/libxencall$(libextension) +SHLIB_libxencall = $(SHDEPS_libxencall) -Wl,-rpath-link=$(XEN_libxencall) -CFLAGS_libxenforeignmemory = -I$(XEN_LIBXENFOREIGNMEMORY)/include $(CFLAGS_xeninclude) +CFLAGS_libxenforeignmemory = -I$(XEN_libxenforeignmemory)/include $(CFLAGS_xeninclude) SHDEPS_libxenforeignmemory = $(SHLIB_libxentoolcore) -LDLIBS_libxenforeignmemory = $(SHDEPS_libxenforeignmemory) $(XEN_LIBXENFOREIGNMEMORY)/libxenforeignmemory$(libextension) -SHLIB_libxenforeignmemory = $(SHDEPS_libxenforeignmemory) -Wl,-rpath-link=$(XEN_LIBXENFOREIGNMEMORY) +LDLIBS_libxenforeignmemory = $(SHDEPS_libxenforeignmemory) $(XEN_libxenforeignmemory)/libxenforeignmemory$(libextension) +SHLIB_libxenforeignmemory = $(SHDEPS_libxenforeignmemory) -Wl,-rpath-link=$(XEN_libxenforeignmemory) -CFLAGS_libxendevicemodel = -I$(XEN_LIBXENDEVICEMODEL)/include $(CFLAGS_xeninclude) +CFLAGS_libxendevicemodel = -I$(XEN_libxendevicemodel)/include $(CFLAGS_xeninclude) SHDEPS_libxendevicemodel = $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) $(SHLIB_libxencall) -LDLIBS_libxendevicemodel = $(SHDEPS_libxendevicemodel) $(XEN_LIBXENDEVICEMODEL)/libxendevicemodel$(libextension) -SHLIB_libxendevicemodel = $(SHDEPS_libxendevicemodel) -Wl,-rpath-link=$(XEN_LIBXENDEVICEMODEL) +LDLIBS_libxendevicemodel = $(SHDEPS_libxendevicemodel) $(XEN_libxendevicemodel)/libxendevicemodel$(libextension) +SHLIB_libxendevicemodel = $(SHDEPS_libxendevicemodel) -Wl,-rpath-link=$(XEN_libxendevicemodel) -CFLAGS_libxenhypfs = -I$(XEN_LIBXENHYPFS)/include $(CFLAGS_xeninclude) +CFLAGS_libxenhypfs = -I$(XEN_libxenhypfs)/include $(CFLAGS_xeninclude) SHDEPS_libxenhypfs = $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) $(SHLIB_libxencall) -LDLIBS_libxenhypfs = $(SHDEPS_libxenhypfs) $(XEN_LIBXENHYPFS)/libxenhypfs$(libextension) -SHLIB_libxenhypfs = $(SHDEPS_libxenhypfs) -Wl,-rpath-link=$(XEN_LIBXENHYPFS) +LDLIBS_libxenhypfs = $(SHDEPS_libxenhypfs) $(XEN_libxenhypfs)/libxenhypfs$(libextension) +SHLIB_libxenhypfs = $(SHDEPS_libxenhypfs) -Wl,-rpath-link=$(XEN_libxenhypfs) # code which compiles against libxenctrl get __XEN_TOOLS__ and # therefore sees the unstable hypercall interfaces. -CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) $(CFLAGS_xeninclude) -D__XEN_TOOLS__ +CFLAGS_libxenctrl = -I$(XEN_libxenctrl)/include $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) $(CFLAGS_xeninclude) -D__XEN_TOOLS__ SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxencall) $(SHLIB_libxenforeignmemory) $(SHLIB_libxendevicemodel) -LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libextension) -SHLIB_libxenctrl = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_LIBXC) +LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_libxenctrl)/libxenctrl$(libextension) +SHLIB_libxenctrl = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_libxenctrl) -CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_libxenevtchn) $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude) +CFLAGS_libxenguest = -I$(XEN_libxenguest)/include $(CFLAGS_libxenevtchn) $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude) SHDEPS_libxenguest = $(SHLIB_libxenevtchn) -LDLIBS_libxenguest = $(SHDEPS_libxenguest) $(XEN_LIBXC)/libxenguest$(libextension) -SHLIB_libxenguest = $(SHDEPS_libxenguest) -Wl,-rpath-link=$(XEN_LIBXC) +LDLIBS_libxenguest = $(SHDEPS_libxenguest) $(XEN_libxenguest)/libxenguest$(libextension) +SHLIB_libxenguest = $(SHDEPS_libxenguest) -Wl,-rpath-link=$(XEN_libxenguest) -CFLAGS_libxenstore = -I$(XEN_XENSTORE)/include $(CFLAGS_xeninclude) +CFLAGS_libxenstore = -I$(XEN_libxenstore)/include $(CFLAGS_xeninclude) SHDEPS_libxenstore = $(SHLIB_libxentoolcore) -LDLIBS_libxenstore = $(SHDEPS_libxenstore) $(XEN_XENSTORE)/libxenstore$(libextension) -SHLIB_libxenstore = $(SHDEPS_libxenstore) -Wl,-rpath-link=$(XEN_XENSTORE) +LDLIBS_libxenstore = $(SHDEPS_libxenstore) $(XEN_libxenstore)/libxenstore$(libextension) +SHLIB_libxenstore = $(SHDEPS_libxenstore) -Wl,-rpath-link=$(XEN_libxenstore) ifeq ($(CONFIG_Linux),y) LDLIBS_libxenstore += -ldl endif -CFLAGS_libxenstat = -I$(XEN_LIBXENSTAT) +CFLAGS_libxenstat = -I$(XEN_libxenstat) SHDEPS_libxenstat = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) -LDLIBS_libxenstat = $(SHDEPS_libxenstat) $(XEN_LIBXENSTAT)/libxenstat$(libextension) -SHLIB_libxenstat = $(SHDEPS_libxenstat) -Wl,-rpath-link=$(XEN_LIBXENSTAT) +LDLIBS_libxenstat = $(SHDEPS_libxenstat) $(XEN_libxenstat)/libxenstat$(libextension) +SHLIB_libxenstat = $(SHDEPS_libxenstat) -Wl,-rpath-link=$(XEN_libxenstat) -CFLAGS_libxenvchan = -I$(XEN_LIBVCHAN) $(CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn) +CFLAGS_libxenvchan = -I$(XEN_libxenvchan) $(CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn) SHDEPS_libxenvchan = $(SHLIB_libxentoollog) $(SHLIB_libxenstore) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) -LDLIBS_libxenvchan = $(SHDEPS_libxenvchan) $(XEN_LIBVCHAN)/libxenvchan$(libextension) -SHLIB_libxenvchan = $(SHDEPS_libxenvchan) -Wl,-rpath-link=$(XEN_LIBVCHAN) +LDLIBS_libxenvchan = $(SHDEPS_libxenvchan) $(XEN_libxenvchan)/libxenvchan$(libextension) +SHLIB_libxenvchan = $(SHDEPS_libxenvchan) -Wl,-rpath-link=$(XEN_libxenvchan) ifeq ($(debug),y) # Disable optimizations @@ -176,15 +178,15 @@ else CFLAGS += -O2 -fomit-frame-pointer endif -CFLAGS_libxenlight = -I$(XEN_XENLIGHT) $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude) +CFLAGS_libxenlight = -I$(XEN_libxenlight) $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude) SHDEPS_libxenlight = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenhypfs) -LDLIBS_libxenlight = $(SHDEPS_libxenlight) $(XEN_XENLIGHT)/libxenlight$(libextension) -SHLIB_libxenlight = $(SHDEPS_libxenlight) -Wl,-rpath-link=$(XEN_XENLIGHT) +LDLIBS_libxenlight = $(SHDEPS_libxenlight) $(XEN_libxenlight)/libxenlight$(libextension) +SHLIB_libxenlight = $(SHDEPS_libxenlight) -Wl,-rpath-link=$(XEN_libxenlight) -CFLAGS_libxlutil = -I$(XEN_XLUTIL) +CFLAGS_libxlutil = -I$(XEN_libxlutil) SHDEPS_libxlutil = $(SHLIB_libxenlight) -LDLIBS_libxlutil = $(SHDEPS_libxlutil) $(XEN_XLUTIL)/libxlutil$(libextension) -SHLIB_libxlutil = $(SHDEPS_libxlutil) -Wl,-rpath-link=$(XEN_XLUTIL) +LDLIBS_libxlutil = $(SHDEPS_libxlutil) $(XEN_libxlutil)/libxlutil$(libextension) +SHLIB_libxlutil = $(SHDEPS_libxlutil) -Wl,-rpath-link=$(XEN_libxlutil) CFLAGS += -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile index eac9dbf12a..a83fff7573 100644 --- a/tools/golang/xenlight/Makefile +++ b/tools/golang/xenlight/Makefile @@ -30,11 +30,11 @@ idl-gen: $(GOXL_GEN_FILES) # # NB that because the users of this library need to be able to # recompile the library from source, it needs to include '-lxenlight' -# in the LDFLAGS; and thus we need to add -L$(XEN_XENLIGHT) here +# in the LDFLAGS; and thus we need to add -L$(XEN_libxenlight) here # so that it can find the actual library. .PHONY: build build: xenlight.go $(GOXL_GEN_FILES) - CGO_CFLAGS="$(CFLAGS_libxenlight) $(CFLAGS_libxentoollog)" CGO_LDFLAGS="$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -L$(XEN_XENLIGHT) -L$(XEN_LIBXENTOOLLOG)" $(GO) build -x + CGO_CFLAGS="$(CFLAGS_libxenlight) $(CFLAGS_libxentoollog)" CGO_LDFLAGS="$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -L$(XEN_libxenlight) -L$(XEN_libxentoollog)" $(GO) build -x .PHONY: install install: build diff --git a/tools/libs/call/Makefile b/tools/libs/call/Makefile index 7f6dc3fcbd..7994b411fa 100644 --- a/tools/libs/call/Makefile +++ b/tools/libs/call/Makefile @@ -15,5 +15,5 @@ SRCS-$(CONFIG_MiniOS) += minios.c include $(XEN_ROOT)/tools/libs/libs.mk -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_LIBXENCALL)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxencall)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) diff --git a/tools/libs/devicemodel/Makefile b/tools/libs/devicemodel/Makefile index 61bfa35273..d9d1d1b850 100644 --- a/tools/libs/devicemodel/Makefile +++ b/tools/libs/devicemodel/Makefile @@ -15,5 +15,5 @@ SRCS-$(CONFIG_MiniOS) += compat.c include $(XEN_ROOT)/tools/libs/libs.mk -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_LIBXENDEVICEMODEL)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxendevicemodel)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile index 9206f622ef..d7aa4d402f 100644 --- a/tools/libs/evtchn/Makefile +++ b/tools/libs/evtchn/Makefile @@ -15,4 +15,4 @@ SRCS-$(CONFIG_MiniOS) += minios.c include $(XEN_ROOT)/tools/libs/libs.mk -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_LIBXENEVTCHN)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenevtchn)/include diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/Makefile index 28f1bddc96..823989681d 100644 --- a/tools/libs/foreignmemory/Makefile +++ b/tools/libs/foreignmemory/Makefile @@ -15,5 +15,5 @@ SRCS-$(CONFIG_MiniOS) += minios.c include $(XEN_ROOT)/tools/libs/libs.mk -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_LIBXENFOREIGNMEMORY)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenforeignmemory)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) diff --git a/tools/libs/gnttab/Makefile b/tools/libs/gnttab/Makefile index 2da8fbbb7f..c0fffdac71 100644 --- a/tools/libs/gnttab/Makefile +++ b/tools/libs/gnttab/Makefile @@ -17,5 +17,5 @@ SRCS-$(CONFIG_NetBSD) += gnttab_unimp.c gntshr_unimp.c include $(XEN_ROOT)/tools/libs/libs.mk -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_LIBXENGNTTAB)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxengnttab)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) diff --git a/tools/libs/hypfs/Makefile b/tools/libs/hypfs/Makefile index 06dd449929..b4c41f6189 100644 --- a/tools/libs/hypfs/Makefile +++ b/tools/libs/hypfs/Makefile @@ -12,5 +12,5 @@ SRCS-y += core.c include ../libs.mk -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_LIBXENHYPFS)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenhypfs)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) diff --git a/tools/libs/toolcore/Makefile b/tools/libs/toolcore/Makefile index 9c5a92d93f..85ff2b26fd 100644 --- a/tools/libs/toolcore/Makefile +++ b/tools/libs/toolcore/Makefile @@ -10,7 +10,7 @@ SRCS-y += handlereg.c include $(XEN_ROOT)/tools/libs/libs.mk -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_LIBXENTOOLCORE)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxentoolcore)/include $(LIB_OBJS): $(AUTOINCS) $(PIC_OBJS): $(AUTOINCS) diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile index 9156e5d08e..2d3ae4e627 100644 --- a/tools/libs/toollog/Makefile +++ b/tools/libs/toollog/Makefile @@ -10,4 +10,4 @@ SRCS-y += xtl_logger_stdio.c include $(XEN_ROOT)/tools/libs/libs.mk -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_LIBXENTOOLLOG)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxentoollog)/include diff --git a/tools/libvchan/Makefile b/tools/libvchan/Makefile index d99a6137e1..a5441162a0 100644 --- a/tools/libvchan/Makefile +++ b/tools/libvchan/Makefile @@ -35,7 +35,7 @@ endif PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_LIBVCHAN) +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenvchan) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index 955cd5ab18..c1e41a8ee9 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -168,7 +168,7 @@ endif PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_LIBXC)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenctrl)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile index ab980852da..b5e623b155 100644 --- a/tools/xenstat/libxenstat/Makefile +++ b/tools/xenstat/libxenstat/Makefile @@ -50,7 +50,7 @@ endif PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_LIBXENSTAT) +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenstat) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) .PHONY: all diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile index 445e9911b2..0a64ac1571 100644 --- a/tools/xenstore/Makefile +++ b/tools/xenstore/Makefile @@ -128,7 +128,7 @@ endif PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_XENSTORE)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenstore)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) From patchwork Sun Aug 23 09:34:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731473 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE6CF913 for ; Sun, 23 Aug 2020 09:37:40 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C4CB12075B for ; Sun, 23 Aug 2020 09:37:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C4CB12075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPT-0004uc-3w; Sun, 23 Aug 2020 09:35:31 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPR-0004sy-F3 for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:29 +0000 X-Inumbo-ID: 31f48b51-f822-4cfb-b635-0984090c8e7f Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 31f48b51-f822-4cfb-b635-0984090c8e7f; Sun, 23 Aug 2020 09:35:24 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7F8CAAD39; Sun, 23 Aug 2020 09:35:52 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v3 03/38] tools: add a copy of library headers in tools/include Date: Sun, 23 Aug 2020 11:34:44 +0200 Message-Id: <20200823093519.18386-4-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The headers.chk target in tools/Rules.mk tries to compile all headers stand alone for testing them not to include any internal header. Unfortunately the headers tested against are not complete, as any header for a Xen library is not included in the include path of the test compile run, resulting in a failure in case any of the tested headers in including an official Xen library header. Fix that by copying the official headers located in tools/libs/*/include to tools/include. In order to support libraries with header name other than xen.h or with multiple headers add a LIBHEADER make variable a lib specific Makefile can set in that case. Move the headers.chk target from Rules.mk to libs.mk as it is used for libraries in tools/libs only. Add NO_HEADERS_CHK variable to skip checking headers as this will be needed e.g. for libxenctrl. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- .gitignore | 1 + tools/Rules.mk | 8 -------- tools/libs/libs.mk | 26 +++++++++++++++++++++++--- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 36ce2ea104..5ea48af818 100644 --- a/.gitignore +++ b/.gitignore @@ -188,6 +188,7 @@ tools/hotplug/Linux/xendomains tools/hotplug/NetBSD/rc.d/xencommons tools/hotplug/NetBSD/rc.d/xendriverdomain tools/include/acpi +tools/include/*.h tools/include/xen/* tools/include/xen-xsm/* tools/include/xen-foreign/*.(c|h|size) diff --git a/tools/Rules.mk b/tools/Rules.mk index b42e50ebf6..5d699cfd39 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -225,14 +225,6 @@ INSTALL_PYTHON_PROG = \ %.opic: %.S $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) $(CFLAGS.opic) -fPIC -c -o $@ $< $(APPEND_CFLAGS) -headers.chk: - for i in $(filter %.h,$^); do \ - $(CC) -x c -ansi -Wall -Werror $(CFLAGS_xeninclude) \ - -S -o /dev/null $$i || exit 1; \ - echo $$i; \ - done >$@.new - mv $@.new $@ - subdirs-all subdirs-clean subdirs-install subdirs-distclean subdirs-uninstall: .phony @set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y); do \ $(MAKE) subdir-$(patsubst subdirs-%,%,$@)-$$subdir; \ diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 8027ae7400..8045c00e9a 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -34,6 +34,10 @@ endif PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) +LIBHEADER ?= xen$(LIBNAME).h +LIBHEADERS = $(foreach h, $(LIBHEADER), include/$(h)) +LIBHEADERSGLOB = $(foreach h, $(LIBHEADER), $(XEN_ROOT)/tools/include/$(h)) + $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) @@ -47,7 +51,22 @@ build: .PHONY: libs libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) -headers.chk: $(wildcard include/*.h) $(AUTOINCS) +ifneq ($(NO_HEADERS_CHK),y) +headers.chk: + for i in $(filter %.h,$^); do \ + $(CC) -x c -ansi -Wall -Werror $(CFLAGS_xeninclude) \ + -S -o /dev/null $$i || exit 1; \ + echo $$i; \ + done >$@.new + mv $@.new $@ +else +.PHONY: headers.chk +endif + +headers.chk: $(LIBHEADERSGLOB) $(AUTOINCS) + +$(LIBHEADERSGLOB): $(LIBHEADERS) + for i in $(realpath $(LIBHEADERS)); do ln -sf $$i $(XEN_ROOT)/tools/include; done libxen$(LIBNAME).a: $(LIB_OBJS) $(AR) rc $@ $^ @@ -68,13 +87,13 @@ install: build $(INSTALL_DATA) libxen$(LIBNAME).a $(DESTDIR)$(libdir) $(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR) $(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so - $(INSTALL_DATA) include/xen$(LIBNAME).h $(DESTDIR)$(includedir) + for i in $(LIBHEADERS); do $(INSTALL_DATA) $$i $(DESTDIR)$(includedir); done $(INSTALL_DATA) xen$(LIBNAME).pc $(DESTDIR)$(PKG_INSTALLDIR) .PHONY: uninstall uninstall: rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xen$(LIBNAME).pc - rm -f $(DESTDIR)$(includedir)/xen$(LIBNAME).h + for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$(LIBHEADER); done rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR) rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR).$(MINOR) @@ -90,6 +109,7 @@ clean: rm -f libxen$(LIBNAME).so.$(MAJOR).$(MINOR) libxen$(LIBNAME).so.$(MAJOR) rm -f headers.chk rm -f xen$(LIBNAME).pc + rm -f $(LIBHEADERSGLOB) .PHONY: distclean distclean: clean From patchwork Sun Aug 23 09:34:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731477 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B0BE6913 for ; Sun, 23 Aug 2020 09:37:45 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 96E922075B for ; Sun, 23 Aug 2020 09:37:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96E922075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPV-0004vW-D0; Sun, 23 Aug 2020 09:35:33 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPT-0004t9-Ri for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:31 +0000 X-Inumbo-ID: 7dc5b9e7-29de-43ca-b90f-ee05f966f50a Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7dc5b9e7-29de-43ca-b90f-ee05f966f50a; Sun, 23 Aug 2020 09:35:24 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9F9AAAD3C; Sun, 23 Aug 2020 09:35:52 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 04/38] tools: don't call make recursively from libs.mk Date: Sun, 23 Aug 2020 11:34:45 +0200 Message-Id: <20200823093519.18386-5-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" During build of a xen library make is called again via libs.mk. This is not necessary as the same can be achieved by a simple dependency. Signed-off-by: Juergen Gross Reviewed-by: Ian Jackson Acked-by: Wei Liu --- tools/libs/libs.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 8045c00e9a..764f5441e2 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -45,8 +45,7 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) all: build .PHONY: build -build: - $(MAKE) libs +build: libs .PHONY: libs libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) From patchwork Sun Aug 23 09:34:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731485 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92B10913 for ; Sun, 23 Aug 2020 09:37:52 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7916920768 for ; Sun, 23 Aug 2020 09:37:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7916920768 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPX-0004wq-MX; Sun, 23 Aug 2020 09:35:35 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPW-0004sy-F8 for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:34 +0000 X-Inumbo-ID: 37512d6a-d983-48be-a810-28b218093e3f Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 37512d6a-d983-48be-a810-28b218093e3f; Sun, 23 Aug 2020 09:35:24 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C87D1AD6F; Sun, 23 Aug 2020 09:35:52 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH v3 05/38] tools: define ROUNDUP() in tools/include/xen-tools/libs.h Date: Sun, 23 Aug 2020 11:34:46 +0200 Message-Id: <20200823093519.18386-6-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Today there are multiple copies of the ROUNDUP() macro in various sources and headers. Define it once in tools/include/xen-tools/libs.h. Using xen-tools/libs.h enables removing copies of MIN() and MAX(), too. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/console/daemon/io.c | 6 +----- tools/include/xen-tools/libs.h | 4 ++++ tools/libs/call/buffer.c | 3 +-- tools/libs/foreignmemory/linux.c | 3 +-- tools/libs/gnttab/private.h | 3 --- tools/libxc/xg_private.h | 1 - tools/libxl/libxl_internal.h | 3 --- tools/xenstore/xenstored_core.c | 2 -- 8 files changed, 7 insertions(+), 18 deletions(-) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index a43c57edad..4af27ffc5d 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -49,9 +49,7 @@ #include #include #endif - -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#include /* Each 10 bits takes ~ 3 digits, plus one, plus one for nul terminator. */ #define MAX_STRLEN(x) ((sizeof(x) * CHAR_BIT + CHAR_BIT-1) / 10 * 3 + 2) @@ -80,8 +78,6 @@ static struct pollfd *fds; static unsigned int current_array_size; static unsigned int nr_fds; -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1)) - struct buffer { char *data; size_t consumed; diff --git a/tools/include/xen-tools/libs.h b/tools/include/xen-tools/libs.h index cc7dfc8c64..a16e0c3807 100644 --- a/tools/include/xen-tools/libs.h +++ b/tools/include/xen-tools/libs.h @@ -59,4 +59,8 @@ }) #endif +#ifndef ROUNDUP +#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1)) +#endif + #endif /* __XEN_TOOLS_LIBS__ */ diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c index 0b6af2db60..085674d882 100644 --- a/tools/libs/call/buffer.c +++ b/tools/libs/call/buffer.c @@ -16,14 +16,13 @@ #include #include #include +#include #include "private.h" #define DBGPRINTF(_m...) \ xtl_log(xcall->logger, XTL_DEBUG, -1, "xencall:buffer", _m) -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1)) - pthread_mutex_t cache_mutex = PTHREAD_MUTEX_INITIALIZER; static void cache_lock(xencall_handle *xcall) diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c index 8daa5828e3..fe73d5ab72 100644 --- a/tools/libs/foreignmemory/linux.c +++ b/tools/libs/foreignmemory/linux.c @@ -25,11 +25,10 @@ #include #include +#include #include "private.h" -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1)) - #ifndef O_CLOEXEC #define O_CLOEXEC 0 #endif diff --git a/tools/libs/gnttab/private.h b/tools/libs/gnttab/private.h index c5e23639b1..eb6a6abe54 100644 --- a/tools/libs/gnttab/private.h +++ b/tools/libs/gnttab/private.h @@ -5,9 +5,6 @@ #include #include -/* Set of macros/defines used by both Linux and FreeBSD */ -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1)) - #define GTERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gnttab", _f) #define GSERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gntshr", _f) diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h index f0a4b2c616..40b5baecde 100644 --- a/tools/libxc/xg_private.h +++ b/tools/libxc/xg_private.h @@ -95,7 +95,6 @@ typedef uint64_t x86_pgentry_t; #define PAGE_SIZE_X86 (1UL << PAGE_SHIFT_X86) #define PAGE_MASK_X86 (~(PAGE_SIZE_X86-1)) -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1)) #define NRPAGES(x) (ROUNDUP(x, PAGE_SHIFT) >> PAGE_SHIFT) diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 94a23179d3..c63d0686fd 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -132,9 +132,6 @@ #define MB(_mb) (_AC(_mb, ULL) << 20) #define GB(_gb) (_AC(_gb, ULL) << 30) -#define ROUNDUP(_val, _order) \ - (((unsigned long)(_val)+(1UL<<(_order))-1) & ~((1UL<<(_order))-1)) - #define DIV_ROUNDUP(n, d) (((n) + (d) - 1) / (d)) #define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m))) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index 7bd959f28b..9700772d40 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -73,8 +73,6 @@ static unsigned int nr_fds; static int sock = -1; static int ro_sock = -1; -#define ROUNDUP(_x, _w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1)) - static bool verbose = false; LIST_HEAD(connections); int tracefd = -1; From patchwork Sun Aug 23 09:34:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731469 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72216722 for ; Sun, 23 Aug 2020 09:37:37 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5784B2075B for ; Sun, 23 Aug 2020 09:37:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5784B2075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPP-0004tH-R3; Sun, 23 Aug 2020 09:35:27 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPP-0004t9-2Y for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:27 +0000 X-Inumbo-ID: 49da23b1-b10f-40a4-bf47-daf5264da9ff Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 49da23b1-b10f-40a4-bf47-daf5264da9ff; Sun, 23 Aug 2020 09:35:25 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E851DADC4; Sun, 23 Aug 2020 09:35:52 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 06/38] tools: generate most contents of library make variables Date: Sun, 23 Aug 2020 11:34:47 +0200 Message-Id: <20200823093519.18386-7-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Library related make variables (CFLAGS_lib*, SHDEPS_lib*, LDLIBS_lib* and SHLIB_lib*) mostly have a common pattern for their values. Generate most of this content automatically by adding a new per-library variable defining on which other libraries a lib is depending. Those definitions are put into an own file in order to make it possible to include it from various Makefiles, especially for stubdom. This in turn makes it possible to drop the USELIB variable from each library Makefile. The LIBNAME variable can be dropped, too, as it can be derived from the directory name the library is residing in. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/Rules.mk | 59 +++++++------------------------ tools/libs/call/Makefile | 2 -- tools/libs/devicemodel/Makefile | 2 -- tools/libs/evtchn/Makefile | 2 -- tools/libs/foreignmemory/Makefile | 2 -- tools/libs/gnttab/Makefile | 2 -- tools/libs/hypfs/Makefile | 2 -- tools/libs/libs.mk | 8 ++--- tools/libs/toolcore/Makefile | 1 - tools/libs/toollog/Makefile | 1 - tools/libs/uselibs.mk | 18 ++++++++++ 11 files changed, 34 insertions(+), 65 deletions(-) create mode 100644 tools/libs/uselibs.mk diff --git a/tools/Rules.mk b/tools/Rules.mk index 5d699cfd39..7e019a8a65 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -12,14 +12,9 @@ INSTALL = $(XEN_ROOT)/tools/cross-install LDFLAGS += $(PREPEND_LDFLAGS_XEN_TOOLS) XEN_INCLUDE = $(XEN_ROOT)/tools/include -XEN_libxentoolcore = $(XEN_ROOT)/tools/libs/toolcore -XEN_libxentoollog = $(XEN_ROOT)/tools/libs/toollog -XEN_libxenevtchn = $(XEN_ROOT)/tools/libs/evtchn -XEN_libxengnttab = $(XEN_ROOT)/tools/libs/gnttab -XEN_libxencall = $(XEN_ROOT)/tools/libs/call -XEN_libxenforeignmemory = $(XEN_ROOT)/tools/libs/foreignmemory -XEN_libxendevicemodel = $(XEN_ROOT)/tools/libs/devicemodel -XEN_libxenhypfs = $(XEN_ROOT)/tools/libs/hypfs + +include $(XEN_ROOT)/tools/libs/uselibs.mk + XEN_libxenctrl = $(XEN_ROOT)/tools/libxc # Currently libxenguest lives in the same directory as libxenctrl XEN_libxenguest = $(XEN_libxenctrl) @@ -99,45 +94,15 @@ endif # Consumers of libfoo should not directly use $(SHDEPS_libfoo) or # $(SHLIB_libfoo) -CFLAGS_libxentoollog = -I$(XEN_libxentoollog)/include $(CFLAGS_xeninclude) -SHDEPS_libxentoollog = -LDLIBS_libxentoollog = $(SHDEPS_libxentoollog) $(XEN_libxentoollog)/libxentoollog$(libextension) -SHLIB_libxentoollog = $(SHDEPS_libxentoollog) -Wl,-rpath-link=$(XEN_libxentoollog) - -CFLAGS_libxentoolcore = -I$(XEN_libxentoolcore)/include $(CFLAGS_xeninclude) -SHDEPS_libxentoolcore = -LDLIBS_libxentoolcore = $(SHDEPS_libxentoolcore) $(XEN_libxentoolcore)/libxentoolcore$(libextension) -SHLIB_libxentoolcore = $(SHDEPS_libxentoolcore) -Wl,-rpath-link=$(XEN_libxentoolcore) - -CFLAGS_libxenevtchn = -I$(XEN_libxenevtchn)/include $(CFLAGS_xeninclude) -SHDEPS_libxenevtchn = $(SHLIB_libxentoolcore) -LDLIBS_libxenevtchn = $(SHDEPS_libxenevtchn) $(XEN_libxenevtchn)/libxenevtchn$(libextension) -SHLIB_libxenevtchn = $(SHDEPS_libxenevtchn) -Wl,-rpath-link=$(XEN_libxenevtchn) - -CFLAGS_libxengnttab = -I$(XEN_libxengnttab)/include $(CFLAGS_xeninclude) -SHDEPS_libxengnttab = $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) -LDLIBS_libxengnttab = $(SHDEPS_libxengnttab) $(XEN_libxengnttab)/libxengnttab$(libextension) -SHLIB_libxengnttab = $(SHDEPS_libxengnttab) -Wl,-rpath-link=$(XEN_libxengnttab) - -CFLAGS_libxencall = -I$(XEN_libxencall)/include $(CFLAGS_xeninclude) -SHDEPS_libxencall = $(SHLIB_libxentoolcore) -LDLIBS_libxencall = $(SHDEPS_libxencall) $(XEN_libxencall)/libxencall$(libextension) -SHLIB_libxencall = $(SHDEPS_libxencall) -Wl,-rpath-link=$(XEN_libxencall) - -CFLAGS_libxenforeignmemory = -I$(XEN_libxenforeignmemory)/include $(CFLAGS_xeninclude) -SHDEPS_libxenforeignmemory = $(SHLIB_libxentoolcore) -LDLIBS_libxenforeignmemory = $(SHDEPS_libxenforeignmemory) $(XEN_libxenforeignmemory)/libxenforeignmemory$(libextension) -SHLIB_libxenforeignmemory = $(SHDEPS_libxenforeignmemory) -Wl,-rpath-link=$(XEN_libxenforeignmemory) - -CFLAGS_libxendevicemodel = -I$(XEN_libxendevicemodel)/include $(CFLAGS_xeninclude) -SHDEPS_libxendevicemodel = $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) $(SHLIB_libxencall) -LDLIBS_libxendevicemodel = $(SHDEPS_libxendevicemodel) $(XEN_libxendevicemodel)/libxendevicemodel$(libextension) -SHLIB_libxendevicemodel = $(SHDEPS_libxendevicemodel) -Wl,-rpath-link=$(XEN_libxendevicemodel) - -CFLAGS_libxenhypfs = -I$(XEN_libxenhypfs)/include $(CFLAGS_xeninclude) -SHDEPS_libxenhypfs = $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) $(SHLIB_libxencall) -LDLIBS_libxenhypfs = $(SHDEPS_libxenhypfs) $(XEN_libxenhypfs)/libxenhypfs$(libextension) -SHLIB_libxenhypfs = $(SHDEPS_libxenhypfs) -Wl,-rpath-link=$(XEN_libxenhypfs) +define LIB_defs = + XEN_libxen$(1) = $$(XEN_ROOT)/tools/libs/$(1) + CFLAGS_libxen$(1) = -I$$(XEN_libxen$(1))/include $$(CFLAGS_xeninclude) + SHDEPS_libxen$(1) = $$(foreach use,$$(USELIBS_$(1)),$$(SHLIB_libxen$$(use))) + LDLIBS_libxen$(1) = $$(SHDEPS_libxen$(1)) $$(XEN_libxen$(1))/libxen$(1)$$(libextension) + SHLIB_libxen$(1) = $$(SHDEPS_libxen$(1)) -Wl,-rpath-link=$$(XEN_libxen$(1)) +endef + +$(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_defs,$(lib)))) # code which compiles against libxenctrl get __XEN_TOOLS__ and # therefore sees the unstable hypercall interfaces. diff --git a/tools/libs/call/Makefile b/tools/libs/call/Makefile index 7994b411fa..81c7478efd 100644 --- a/tools/libs/call/Makefile +++ b/tools/libs/call/Makefile @@ -3,8 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR = 1 MINOR = 2 -LIBNAME := call -USELIBS := toollog toolcore SRCS-y += core.c buffer.c SRCS-$(CONFIG_Linux) += linux.c diff --git a/tools/libs/devicemodel/Makefile b/tools/libs/devicemodel/Makefile index d9d1d1b850..42417958f2 100644 --- a/tools/libs/devicemodel/Makefile +++ b/tools/libs/devicemodel/Makefile @@ -3,8 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR = 1 MINOR = 3 -LIBNAME := devicemodel -USELIBS := toollog toolcore call SRCS-y += core.c SRCS-$(CONFIG_Linux) += linux.c diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile index d7aa4d402f..aec76641e8 100644 --- a/tools/libs/evtchn/Makefile +++ b/tools/libs/evtchn/Makefile @@ -3,8 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR = 1 MINOR = 1 -LIBNAME := evtchn -USELIBS := toollog toolcore SRCS-y += core.c SRCS-$(CONFIG_Linux) += linux.c diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/Makefile index 823989681d..cf444d3c1a 100644 --- a/tools/libs/foreignmemory/Makefile +++ b/tools/libs/foreignmemory/Makefile @@ -3,8 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR = 1 MINOR = 3 -LIBNAME := foreignmemory -USELIBS := toollog toolcore SRCS-y += core.c SRCS-$(CONFIG_Linux) += linux.c diff --git a/tools/libs/gnttab/Makefile b/tools/libs/gnttab/Makefile index c0fffdac71..d8d4d55e27 100644 --- a/tools/libs/gnttab/Makefile +++ b/tools/libs/gnttab/Makefile @@ -3,8 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR = 1 MINOR = 2 -LIBNAME := gnttab -USELIBS := toollog toolcore SRCS-GNTTAB += gnttab_core.c SRCS-GNTSHR += gntshr_core.c diff --git a/tools/libs/hypfs/Makefile b/tools/libs/hypfs/Makefile index b4c41f6189..668d68853f 100644 --- a/tools/libs/hypfs/Makefile +++ b/tools/libs/hypfs/Makefile @@ -3,8 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR = 1 MINOR = 0 -LIBNAME := hypfs -USELIBS := toollog toolcore call APPEND_LDFLAGS += -lz diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 764f5441e2..19efc5e743 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -1,18 +1,18 @@ # Common Makefile for building a lib. # # Variables taken as input: -# LIBNAME: name of lib to build, will be prepended with "libxen" # MAJOR: major version of lib # MINOR: minor version of lib -# USELIBS: xen libs to use (e.g. "toolcore toollog") + +LIBNAME := $(notdir $(CURDIR)) SHLIB_LDFLAGS += -Wl,--version-script=libxen$(LIBNAME).map CFLAGS += -Werror -Wmissing-prototypes CFLAGS += -I./include $(CFLAGS_xeninclude) -CFLAGS += $(foreach lib, $(USELIBS), $(CFLAGS_libxen$(lib))) +CFLAGS += $(foreach lib, $(USELIBS_$(LIBNAME)), $(CFLAGS_libxen$(lib))) -LDUSELIBS = $(foreach lib, $(USELIBS), $(LDLIBS_libxen$(lib))) +LDUSELIBS = $(foreach lib, $(USELIBS_$(LIBNAME)), $(LDLIBS_libxen$(lib))) LIB_OBJS := $(SRCS-y:.c=.o) PIC_OBJS := $(SRCS-y:.c=.opic) diff --git a/tools/libs/toolcore/Makefile b/tools/libs/toolcore/Makefile index 85ff2b26fd..34b08a4236 100644 --- a/tools/libs/toolcore/Makefile +++ b/tools/libs/toolcore/Makefile @@ -3,7 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR = 1 MINOR = 0 -LIBNAME := toolcore AUTOINCS := include/_xentoolcore_list.h SRCS-y += handlereg.c diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile index 2d3ae4e627..3f986835d6 100644 --- a/tools/libs/toollog/Makefile +++ b/tools/libs/toollog/Makefile @@ -3,7 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR = 1 MINOR = 0 -LIBNAME := toollog SRCS-y += xtl_core.c SRCS-y += xtl_logger_stdio.c diff --git a/tools/libs/uselibs.mk b/tools/libs/uselibs.mk new file mode 100644 index 0000000000..db73fe314e --- /dev/null +++ b/tools/libs/uselibs.mk @@ -0,0 +1,18 @@ +# Libraries below tools/libs/ and their dependencies + +LIBS_LIBS += toolcore +USELIBS_toolcore := +LIBS_LIBS += toollog +USELIBS_toollog := +LIBS_LIBS += evtchn +USELIBS_evtchn := toollog toolcore +LIBS_LIBS += gnttab +USELIBS_gnttab := toollog toolcore +LIBS_LIBS += call +USELIBS_call := toollog toolcore +LIBS_LIBS += foreignmemory +USELIBS_foreignmemory := toollog toolcore +LIBS_LIBS += devicemodel +USELIBS_devicemodel := toollog toolcore call +LIBS_LIBS += hypfs +USELIBS_hypfs := toollog toolcore call From patchwork Sun Aug 23 09:34:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731479 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E29BB913 for ; Sun, 23 Aug 2020 09:37:47 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C94632075B for ; Sun, 23 Aug 2020 09:37:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C94632075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPc-00050D-EF; Sun, 23 Aug 2020 09:35:40 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPb-0004sy-FD for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:39 +0000 X-Inumbo-ID: 3672458b-09c3-42b9-b597-b23e1a75522c Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 3672458b-09c3-42b9-b597-b23e1a75522c; Sun, 23 Aug 2020 09:35:26 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1B4FAADD6; Sun, 23 Aug 2020 09:35:53 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , Samuel Thibault Subject: [PATCH v3 07/38] stubdom: add correct dependencies for Xen libraries Date: Sun, 23 Aug 2020 11:34:48 +0200 Message-Id: <20200823093519.18386-8-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The stubdom Makefile is missing several dependencies between Xen libraries. Add them. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- stubdom/Makefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/stubdom/Makefile b/stubdom/Makefile index af8cde41b9..a95212e363 100644 --- a/stubdom/Makefile +++ b/stubdom/Makefile @@ -23,6 +23,13 @@ endif -include $(XEN_ROOT)/config/Stubdom.mk +include $(XEN_ROOT)/tools/libs/uselibs.mk + +define LIB_deps = + LIBDEPS_$(1) = $$(foreach use,$$(USELIBS_$(1)),libxen$$(use)) +endef +$(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_deps,$(lib)))) + GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH) ifeq ($(XEN_TARGET_ARCH),x86_32) GNU_TARGET_ARCH:=i686 @@ -387,6 +394,7 @@ $(TARGETS_MINIOS): mini-os-%: .PHONY: libxentoolcore libxentoolcore: libs-$(XEN_TARGET_ARCH)/toolcore/libxentoolcore.a +libs-$(XEN_TARGET_ARCH)/toolcore/libxentoolcore.a: $(LIBDEPS_toolcore) libs-$(XEN_TARGET_ARCH)/toolcore/libxentoolcore.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/toolcore @@ -396,6 +404,7 @@ libs-$(XEN_TARGET_ARCH)/toolcore/libxentoolcore.a: mk-headers-$(XEN_TARGET_ARCH) .PHONY: libxentoollog libxentoollog: libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a +libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: $(LIBDEPS_toollog) libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/toollog @@ -405,6 +414,7 @@ libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_ARCH) $ .PHONY: libxenevtchn libxenevtchn: libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a +libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: $(LIBDEPS_evtchn) libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/evtchn @@ -414,6 +424,7 @@ libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: mk-headers-$(XEN_TARGET_ARCH) $(N .PHONY: libxengnttab libxengnttab: libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a +libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: $(LIBDEPS_gnttab) libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/gnttab @@ -423,6 +434,7 @@ libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(N .PHONY: libxencall libxencall: libs-$(XEN_TARGET_ARCH)/call/libxencall.a +libs-$(XEN_TARGET_ARCH)/call/libxencall.a: $(LIBDEPS_call) libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/call @@ -432,6 +444,7 @@ libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLI .PHONY: libxenforeignmemory libxenforeignmemory: libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a +libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: $(LIBDEPS_foreignmemory) libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/foreignmemory @@ -441,6 +454,7 @@ libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: mk-headers-$(XEN_TA .PHONY: libxendevicemodel libxendevicemodel: libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a +libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a: $(LIBDEPS_devicemodel) libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/devicemodel @@ -450,7 +464,7 @@ libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a: mk-headers-$(XEN_TARGET .PHONY: libxc libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a -libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoolcore libxentoollog libxenevtchn libxengnttab libxencall libxenforeignmemory libxendevicemodel cross-zlib +libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn libxengnttab libxencall libxenforeignmemory libxendevicemodel cross-zlib CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH) libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a From patchwork Sun Aug 23 09:34:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731475 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE41D722 for ; Sun, 23 Aug 2020 09:37:41 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C44AB2075B for ; Sun, 23 Aug 2020 09:37:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C44AB2075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPa-0004ye-4U; Sun, 23 Aug 2020 09:35:38 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPY-0004t9-Ry for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:36 +0000 X-Inumbo-ID: 84808e03-5e73-4a97-9599-33ffbbfa352a Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 84808e03-5e73-4a97-9599-33ffbbfa352a; Sun, 23 Aug 2020 09:35:26 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 413C3ADE0; Sun, 23 Aug 2020 09:35:53 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , Samuel Thibault Subject: [PATCH v3 08/38] stubdom: simplify building xen libraries for stubdoms Date: Sun, 23 Aug 2020 11:34:49 +0200 Message-Id: <20200823093519.18386-9-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The pattern for building a Xen library with sources under tools/libs is always the same. Simplify stubdom/Makefile by defining a callable make program for those libraries. Even if not needed right now add the possibility for defining additional dependencies for a library. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- stubdom/Makefile | 120 ++++++++++------------------------------------- 1 file changed, 24 insertions(+), 96 deletions(-) diff --git a/stubdom/Makefile b/stubdom/Makefile index a95212e363..4fd86dd44b 100644 --- a/stubdom/Makefile +++ b/stubdom/Makefile @@ -327,6 +327,16 @@ ioemu/linkfarm.stamp: touch ioemu/linkfarm.stamp endif +####### +# libraries under tools/libs +####### + +STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel + +####### +# common handling +####### + define do_links mkdir -p $(dir $@)include cd $(dir $@); \ @@ -337,26 +347,21 @@ define do_links touch $@ endef -libs-$(XEN_TARGET_ARCH)/toolcore/stamp: $(XEN_ROOT)/tools/libs/toolcore/Makefile - $(do_links) - -libs-$(XEN_TARGET_ARCH)/toollog/stamp: $(XEN_ROOT)/tools/libs/toollog/Makefile - $(do_links) +define BUILD_lib + .PHONY: libxen$(1) clean-libxen$(1) + libxen$(1): libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a + libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: $$(LIBDEPS_$(1)) $$(LIBDEP_$(1)) + libs-$$(XEN_TARGET_ARCH)/$(1)/libxen$(1).a: mk-headers-$$(XEN_TARGET_ARCH) $$(NEWLIB_STAMPFILE) + CPPFLAGS="$$(TARGET_CPPFLAGS)" CFLAGS="$$(TARGET_CFLAGS)" $$(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libs-$$(XEN_TARGET_ARCH)/$(1) -libs-$(XEN_TARGET_ARCH)/evtchn/stamp: $(XEN_ROOT)/tools/libs/evtchn/Makefile - $(do_links) + clean-libxen$(1): + [ ! -e libs-$$(XEN_TARGET_ARCH)/$(1)/Makefile ] || $$(MAKE) DESTDIR= -C libs-$$(XEN_TARGET_ARCH)/$(1) clean -libs-$(XEN_TARGET_ARCH)/gnttab/stamp: $(XEN_ROOT)/tools/libs/gnttab/Makefile - $(do_links) - -libs-$(XEN_TARGET_ARCH)/call/stamp: $(XEN_ROOT)/tools/libs/call/Makefile - $(do_links) - -libs-$(XEN_TARGET_ARCH)/foreignmemory/stamp: $(XEN_ROOT)/tools/libs/foreignmemory/Makefile - $(do_links) + libs-$$(XEN_TARGET_ARCH)/$(1)/stamp: $$(XEN_ROOT)/tools/libs/$(1)/Makefile + $$(do_links) +endef -libs-$(XEN_TARGET_ARCH)/devicemodel/stamp: $(XEN_ROOT)/tools/libs/devicemodel/Makefile - $(do_links) +$(foreach lib,$(STUB_LIBS),$(eval $(call BUILD_lib,$(lib)))) libxc-$(XEN_TARGET_ARCH)/stamp: $(XEN_ROOT)/tools/libxc/Makefile $(do_links) @@ -364,8 +369,7 @@ libxc-$(XEN_TARGET_ARCH)/stamp: $(XEN_ROOT)/tools/libxc/Makefile xenstore/stamp: $(XEN_ROOT)/tools/xenstore/Makefile $(do_links) -LINK_LIBS_DIRS := toolcore toollog evtchn gnttab call foreignmemory devicemodel -LINK_DIRS := libxc-$(XEN_TARGET_ARCH) xenstore $(foreach dir,$(LINK_LIBS_DIRS),libs-$(XEN_TARGET_ARCH)/$(dir)) +LINK_DIRS := libxc-$(XEN_TARGET_ARCH) xenstore $(foreach dir,$(STUB_LIBS),libs-$(XEN_TARGET_ARCH)/$(dir)) LINK_STAMPS := $(foreach dir,$(LINK_DIRS),$(dir)/stamp) mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET) $(LINK_STAMPS) @@ -388,76 +392,6 @@ $(TARGETS_MINIOS): mini-os-%: mkdir -p $@/$$i ; \ done -####### -# libxentoolcore -####### - -.PHONY: libxentoolcore -libxentoolcore: libs-$(XEN_TARGET_ARCH)/toolcore/libxentoolcore.a -libs-$(XEN_TARGET_ARCH)/toolcore/libxentoolcore.a: $(LIBDEPS_toolcore) -libs-$(XEN_TARGET_ARCH)/toolcore/libxentoolcore.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) - CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/toolcore - -####### -# libxentoollog -####### - -.PHONY: libxentoollog -libxentoollog: libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a -libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: $(LIBDEPS_toollog) -libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) - CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/toollog - -####### -# libxenevtchn -####### - -.PHONY: libxenevtchn -libxenevtchn: libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a -libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: $(LIBDEPS_evtchn) -libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) - CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/evtchn - -####### -# libxengnttab -####### - -.PHONY: libxengnttab -libxengnttab: libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a -libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: $(LIBDEPS_gnttab) -libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) - CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/gnttab - -####### -# libxencall -####### - -.PHONY: libxencall -libxencall: libs-$(XEN_TARGET_ARCH)/call/libxencall.a -libs-$(XEN_TARGET_ARCH)/call/libxencall.a: $(LIBDEPS_call) -libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) - CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/call - -####### -# libxenforeignmemory -####### - -.PHONY: libxenforeignmemory -libxenforeignmemory: libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a -libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: $(LIBDEPS_foreignmemory) -libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) - CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/foreignmemory - -####### -# libxendevicemodel -####### - -.PHONY: libxendevicemodel -libxendevicemodel: libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a -libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a: $(LIBDEPS_devicemodel) -libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) - CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/devicemodel - ####### # libxc ####### @@ -672,6 +606,7 @@ uninstall-vtpmmgr: # Only clean the libxc/ioemu/mini-os part .PHONY: clean +clean: $(foreach lib,$(STUB_LIBS),clean-libxen$(lib)) clean: rm -fr mini-os-$(XEN_TARGET_ARCH)-ioemu rm -fr mini-os-$(XEN_TARGET_ARCH)-c @@ -688,13 +623,6 @@ clean: rm -f $(STUBDOMPATH) rm -f *-minios-config.mk rm -fr pkg-config - [ ! -e libs-$(XEN_TARGET_ARCH)/toolcore/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/toolcore clean - [ ! -e libs-$(XEN_TARGET_ARCH)/toollog/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/toollog clean - [ ! -e libs-$(XEN_TARGET_ARCH)/evtchn/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/evtchn clean - [ ! -e libs-$(XEN_TARGET_ARCH)/gnttab/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/gnttab clean - [ ! -e libs-$(XEN_TARGET_ARCH)/call/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/call clean - [ ! -e libs-$(XEN_TARGET_ARCH)/foreignmemory/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/foreignmemory clean - [ ! -e libs-$(XEN_TARGET_ARCH)/devicemodel/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/devicemodel clean [ ! -e libxc-$(XEN_TARGET_ARCH)/Makefile ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean -[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean -[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean From patchwork Sun Aug 23 09:34:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731451 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0854115E4 for ; Sun, 23 Aug 2020 09:36:18 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D77182075B for ; Sun, 23 Aug 2020 09:36:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D77182075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPh-00053X-7B; Sun, 23 Aug 2020 09:35:45 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPg-0004sy-FX for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:44 +0000 X-Inumbo-ID: 24254a33-80c3-4139-a7cd-8e08c719ab0a Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 24254a33-80c3-4139-a7cd-8e08c719ab0a; Sun, 23 Aug 2020 09:35:26 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 60131AE02; Sun, 23 Aug 2020 09:35:53 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 09/38] tools: drop explicit path specifications for qemu build Date: Sun, 23 Aug 2020 11:34:50 +0200 Message-Id: <20200823093519.18386-10-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Since more than three years now qemu is capable to set the needed include and library paths for the Xen libraries via pkg-config. So drop the specification of those paths in tools/Makefile. This will enable to move libxenctrl away from tools/libxc, as qemu's configure script has special treatment of this path. Signed-off-by: Juergen Gross --- tools/Makefile | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 198b239edc..7c9f9fc900 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -245,32 +245,8 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find -DXC_WANT_COMPAT_GNTTAB_API=1 \ -DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \ -DXC_WANT_COMPAT_DEVICEMODEL_API=1 \ - -I$(XEN_ROOT)/tools/include \ - -I$(XEN_ROOT)/tools/libs/toolcore/include \ - -I$(XEN_ROOT)/tools/libs/toollog/include \ - -I$(XEN_ROOT)/tools/libs/evtchn/include \ - -I$(XEN_ROOT)/tools/libs/gnttab/include \ - -I$(XEN_ROOT)/tools/libs/foreignmemory/include \ - -I$(XEN_ROOT)/tools/libs/devicemodel/include \ - -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 \ - -L$(XEN_ROOT)/tools/libs/toolcore \ - -L$(XEN_ROOT)/tools/libs/evtchn \ - -L$(XEN_ROOT)/tools/libs/gnttab \ - -L$(XEN_ROOT)/tools/libs/foreignmemory \ - -L$(XEN_ROOT)/tools/libs/devicemodel \ - -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toolcore \ - -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog \ - -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/evtchn \ - -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/gnttab \ - -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/call \ - -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/foreignmemory \ - -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/devicemodel \ - $(QEMU_UPSTREAM_RPATH)" \ + --extra-ldflags="$(QEMU_UPSTREAM_RPATH)" \ --bindir=$(LIBEXEC_BIN) \ --datadir=$(SHAREDIR)/qemu-xen \ --localstatedir=$(localstatedir) \ From patchwork Sun Aug 23 09:34:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731481 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 782BE722 for ; Sun, 23 Aug 2020 09:37:50 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5EB3D2075B for ; Sun, 23 Aug 2020 09:37:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5EB3D2075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPk-000568-H7; Sun, 23 Aug 2020 09:35:48 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPi-0004t9-SE for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:46 +0000 X-Inumbo-ID: 1d8ae420-85a1-49a4-872d-a4336f0f0338 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1d8ae420-85a1-49a4-872d-a4336f0f0338; Sun, 23 Aug 2020 09:35:26 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8361FAE09; Sun, 23 Aug 2020 09:35:53 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 10/38] tools: tweak tools/libs/libs.mk for being able to support libxenctrl Date: Sun, 23 Aug 2020 11:34:51 +0200 Message-Id: <20200823093519.18386-11-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" tools/libs/libs.mk needs to be modified for being able to support building libxenctrl, as the pkg-config file of that library is not following the same conventions as those of the other libraries. So add support for specifying PKG_CONFIG before including libs.mk. In order to make life easier for unstable libraries like libxenctrl set MAJOR and MINOR automatically to the Xen-version and 0 when not specified. This removes the need to bump the versions of unstable libraries when switching to a new Xen version. As all libraries built via libs.mk require a map file generate a dummy one in case there is none existing. This again will help avoiding the need to bump the libarary version in the map file of an unstable library in case it is exporting all symbols. The clean target is missing the removal of _paths.h. Finally drop the foreach loop when setting PKG_CONFIG_LOCAL, as there is always only one element in PKG_CONFIG. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/libs/libs.mk | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 19efc5e743..8b1ca2aa62 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -1,10 +1,13 @@ # Common Makefile for building a lib. # # Variables taken as input: -# MAJOR: major version of lib -# MINOR: minor version of lib +# PKG_CONFIG: name of pkg-config file (xen$(LIBNAME).pc if empty) +# MAJOR: major version of lib (Xen version if empty) +# MINOR: minor version of lib (0 if empty) LIBNAME := $(notdir $(CURDIR)) +MAJOR ?= $(shell $(XEN_ROOT)/version.sh $(XEN_ROOT)/xen/Makefile) +MINOR ?= 0 SHLIB_LDFLAGS += -Wl,--version-script=libxen$(LIBNAME).map @@ -22,7 +25,7 @@ ifneq ($(nosharedlibs),y) LIB += libxen$(LIBNAME).so endif -PKG_CONFIG := xen$(LIBNAME).pc +PKG_CONFIG ?= xen$(LIBNAME).pc PKG_CONFIG_VERSION := $(MAJOR).$(MINOR) ifneq ($(CONFIG_LIBXC_MINIOS),y) @@ -32,7 +35,7 @@ $(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir) $(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir) endif -PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) +PKG_CONFIG_LOCAL := $(PKG_CONFIG_DIR)/$(PKG_CONFIG) LIBHEADER ?= xen$(LIBNAME).h LIBHEADERS = $(foreach h, $(LIBHEADER), include/$(h)) @@ -45,7 +48,7 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) all: build .PHONY: build -build: libs +build: libs libxen$(LIBNAME).map .PHONY: libs libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) @@ -64,6 +67,9 @@ endif headers.chk: $(LIBHEADERSGLOB) $(AUTOINCS) +libxen$(LIBNAME).map: + echo 'VERS_$(MAJOR).$(MINOR) { global: *; };' >$@ + $(LIBHEADERSGLOB): $(LIBHEADERS) for i in $(realpath $(LIBHEADERS)); do ln -sf $$i $(XEN_ROOT)/tools/include; done @@ -87,7 +93,7 @@ install: build $(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR) $(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so for i in $(LIBHEADERS); do $(INSTALL_DATA) $$i $(DESTDIR)$(includedir); done - $(INSTALL_DATA) xen$(LIBNAME).pc $(DESTDIR)$(PKG_INSTALLDIR) + $(INSTALL_DATA) $(PKG_CONFIG) $(DESTDIR)$(PKG_INSTALLDIR) .PHONY: uninstall uninstall: @@ -107,8 +113,9 @@ clean: rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS) rm -f libxen$(LIBNAME).so.$(MAJOR).$(MINOR) libxen$(LIBNAME).so.$(MAJOR) rm -f headers.chk - rm -f xen$(LIBNAME).pc + rm -f $(PKG_CONFIG) rm -f $(LIBHEADERSGLOB) + rm -f _paths.h .PHONY: distclean distclean: clean From patchwork Sun Aug 23 09:34:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731487 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A125C913 for ; Sun, 23 Aug 2020 09:37:55 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86FA52075B for ; Sun, 23 Aug 2020 09:37:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86FA52075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPm-000581-SK; Sun, 23 Aug 2020 09:35:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPl-0004sy-FU for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:49 +0000 X-Inumbo-ID: 51975e79-3ce9-4372-8999-e53432a36c79 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 51975e79-3ce9-4372-8999-e53432a36c79; Sun, 23 Aug 2020 09:35:27 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A7578AC7F; Sun, 23 Aug 2020 09:35:53 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , =?utf-8?q?Marek_Marczykowski-G=C3=B3rec?= =?utf-8?q?ki?= , Ian Jackson , Wei Liu Subject: [PATCH v3 11/38] tools/python: drop libxenguest from setup.py Date: Sun, 23 Aug 2020 11:34:52 +0200 Message-Id: <20200823093519.18386-12-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There is not a single wrapper for a libxenguest function defined. So drop libxenguest from tools/python/setup.py. Signed-off-by: Juergen Gross Acked-by: Marek Marczykowski-Górecki --- tools/python/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/python/setup.py b/tools/python/setup.py index 8faf1c0ddc..44696b3998 100644 --- a/tools/python/setup.py +++ b/tools/python/setup.py @@ -21,8 +21,8 @@ xc = Extension("xc", PATH_LIBXC + "/include", "xen/lowlevel/xc" ], library_dirs = [ PATH_LIBXC ], - libraries = [ "xenctrl", "xenguest" ], - depends = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so" ], + libraries = [ "xenctrl" ], + depends = [ PATH_LIBXC + "/libxenctrl.so" ], extra_link_args = [ "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ], sources = [ "xen/lowlevel/xc/xc.c" ]) From patchwork Sun Aug 23 09:34:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731495 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4320C913 for ; Sun, 23 Aug 2020 09:38:10 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 29A4C2075B for ; Sun, 23 Aug 2020 09:38:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29A4C2075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPr-0005CW-Id; Sun, 23 Aug 2020 09:35:55 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPq-0004sy-Fg for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:54 +0000 X-Inumbo-ID: 4466b611-dd4e-412a-bf93-4a4b5c2f8947 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4466b611-dd4e-412a-bf93-4a4b5c2f8947; Sun, 23 Aug 2020 09:35:27 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D2BBDAE0D; Sun, 23 Aug 2020 09:35:53 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 12/38] tools: fix pkg-config file for libxenguest Date: Sun, 23 Aug 2020 11:34:53 +0200 Message-Id: <20200823093519.18386-13-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The pkg-config file for libxenguest is missing the private dependency on libxenctrl. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/libxc/xenguest.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxc/xenguest.pc.in b/tools/libxc/xenguest.pc.in index 225ac0b9c8..6b43b67e63 100644 --- a/tools/libxc/xenguest.pc.in +++ b/tools/libxc/xenguest.pc.in @@ -7,4 +7,4 @@ Description: The Xenguest library for Xen hypervisor Version: @@version@@ Cflags: -I${includedir} Libs: @@libsflag@@${libdir} -lxenguest -Requires.private: xentoollog,xencall,xenforeignmemory,xenevtchn +Requires.private: xentoollog,xencall,xenforeignmemory,xenevtchn,xencontrol From patchwork Sun Aug 23 09:34:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731467 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 55C65913 for ; Sun, 23 Aug 2020 09:37:35 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C6422075B for ; Sun, 23 Aug 2020 09:37:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C6422075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPw-0005Hj-6b; Sun, 23 Aug 2020 09:36:00 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPv-0004sy-Fj for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:59 +0000 X-Inumbo-ID: e68f3319-201d-4e14-b4ab-c472cd002eeb Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e68f3319-201d-4e14-b4ab-c472cd002eeb; Sun, 23 Aug 2020 09:35:27 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 05288AE18; Sun, 23 Aug 2020 09:35:54 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH v3 13/38] tools: don't assume libxenguest and libxenctrl to be in same directory Date: Sun, 23 Aug 2020 11:34:54 +0200 Message-Id: <20200823093519.18386-14-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There are quite some places in Makefiles assuming libxenguest and libxenctrl being built in the same directory via a single Makefile. Drop this assumption by specifying the dependencies and path variables for both libraries correctly. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/Rules.mk | 7 +++---- tools/libxl/Makefile | 2 +- tools/misc/Makefile | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index 7e019a8a65..191fe8e080 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -16,8 +16,7 @@ XEN_INCLUDE = $(XEN_ROOT)/tools/include include $(XEN_ROOT)/tools/libs/uselibs.mk XEN_libxenctrl = $(XEN_ROOT)/tools/libxc -# Currently libxenguest lives in the same directory as libxenctrl -XEN_libxenguest = $(XEN_libxenctrl) +XEN_libxenguest = $(XEN_ROOT)/tools/libxc XEN_libxenlight = $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight XEN_libxlutil = $(XEN_libxenlight) @@ -117,7 +116,7 @@ LDLIBS_libxenguest = $(SHDEPS_libxenguest) $(XEN_libxenguest)/libxenguest$(libex SHLIB_libxenguest = $(SHDEPS_libxenguest) -Wl,-rpath-link=$(XEN_libxenguest) CFLAGS_libxenstore = -I$(XEN_libxenstore)/include $(CFLAGS_xeninclude) -SHDEPS_libxenstore = $(SHLIB_libxentoolcore) +SHDEPS_libxenstore = $(SHLIB_libxentoolcore) $(SHLIB_libxenctrl) LDLIBS_libxenstore = $(SHDEPS_libxenstore) $(XEN_libxenstore)/libxenstore$(libextension) SHLIB_libxenstore = $(SHDEPS_libxenstore) -Wl,-rpath-link=$(XEN_libxenstore) ifeq ($(CONFIG_Linux),y) @@ -144,7 +143,7 @@ CFLAGS += -O2 -fomit-frame-pointer endif CFLAGS_libxenlight = -I$(XEN_libxenlight) $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude) -SHDEPS_libxenlight = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenhypfs) +SHDEPS_libxenlight = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenhypfs) $(SHLIB_libxenguest) LDLIBS_libxenlight = $(SHDEPS_libxenlight) $(XEN_libxenlight)/libxenlight$(libextension) SHLIB_libxenlight = $(SHDEPS_libxenlight) -Wl,-rpath-link=$(XEN_libxenlight) diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 0e8dfc6193..65f3968947 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -188,7 +188,7 @@ libxl_dom.o: CFLAGS += -I$(XEN_ROOT)/tools # include libacpi/x86.h libxl_x86_acpi.o: CFLAGS += -I$(XEN_ROOT)/tools SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o -$(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn) +$(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn) $(CFLAGS_libxenguest) PKG_CONFIG = xenlight.pc xlutil.pc PKG_CONFIG_VERSION := $(MAJOR).$(MINOR) diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 9fdb13597f..e7e74db85f 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -6,6 +6,7 @@ CFLAGS += -Werror CFLAGS += -include $(XEN_ROOT)/tools/config.h CFLAGS += $(CFLAGS_libxenevtchn) CFLAGS += $(CFLAGS_libxenctrl) +CFLAGS += $(CFLAGS_libxenguest) CFLAGS += $(CFLAGS_xeninclude) CFLAGS += $(CFLAGS_libxenstore) From patchwork Sun Aug 23 09:34:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731457 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E5BB722 for ; Sun, 23 Aug 2020 09:37:11 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 146862075B for ; Sun, 23 Aug 2020 09:37:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 146862075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQ2-0005P4-5O; Sun, 23 Aug 2020 09:36:06 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQ0-0004sy-Fs for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:04 +0000 X-Inumbo-ID: c2b9faae-2a0e-46a8-b818-65f69ea8efc7 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c2b9faae-2a0e-46a8-b818-65f69ea8efc7; Sun, 23 Aug 2020 09:35:27 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 24927AE1A; Sun, 23 Aug 2020 09:35:54 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 14/38] tools/misc: don't use libxenctrl internals from xen-hptool Date: Sun, 23 Aug 2020 11:34:55 +0200 Message-Id: <20200823093519.18386-15-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" xen-hptool is including private headers from tools/libxc without any need. Switch it to use official headers only. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/misc/Makefile | 2 -- tools/misc/xen-hptool.c | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/misc/Makefile b/tools/misc/Makefile index e7e74db85f..2a7f2ec42d 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -94,8 +94,6 @@ xenhypfs: xenhypfs.o xenlockprof: xenlockprof.o $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS) -# xen-hptool incorrectly uses libxc internals -xen-hptool.o: CFLAGS += -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall) xen-hptool: xen-hptool.o $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(APPEND_LDFLAGS) diff --git a/tools/misc/xen-hptool.c b/tools/misc/xen-hptool.c index 6e27d9cf43..7f17f24942 100644 --- a/tools/misc/xen-hptool.c +++ b/tools/misc/xen-hptool.c @@ -1,9 +1,11 @@ +#include +#include +#include #include #include -#include -#include +#include #include -#include +#include static xc_interface *xch; From patchwork Sun Aug 23 09:34:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731455 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5483915E4 for ; Sun, 23 Aug 2020 09:36:45 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3ADF62075B for ; Sun, 23 Aug 2020 09:36:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3ADF62075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQ7-0005WJ-6c; Sun, 23 Aug 2020 09:36:11 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQ5-0004sy-G0 for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:09 +0000 X-Inumbo-ID: 8cad8ddb-6128-4a5c-974f-c19f0f7a7083 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8cad8ddb-6128-4a5c-974f-c19f0f7a7083; Sun, 23 Aug 2020 09:35:27 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 460EBAE1C; Sun, 23 Aug 2020 09:35:54 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 15/38] tools/misc: don't include xg_save_restore.h from xen-mfndump.c Date: Sun, 23 Aug 2020 11:34:56 +0200 Message-Id: <20200823093519.18386-16-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" xen-mfndump.c is including the libxc private header xg_save_restore.h. Avoid that by moving the definition of is_mapped() to xen-mfndump.c (it is used there only) and by duplicating the definition of M2P_SIZE() in xen-mfndump.c. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/libxc/xg_save_restore.h | 4 ---- tools/misc/xen-mfndump.c | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/libxc/xg_save_restore.h b/tools/libxc/xg_save_restore.h index 303081df0d..b904296997 100644 --- a/tools/libxc/xg_save_restore.h +++ b/tools/libxc/xg_save_restore.h @@ -109,10 +109,6 @@ static inline int get_platform_info(xc_interface *xch, uint32_t dom, #define M2P_SIZE(_m) ROUNDUP(((_m) * sizeof(xen_pfn_t)), M2P_SHIFT) #define M2P_CHUNKS(_m) (M2P_SIZE((_m)) >> M2P_SHIFT) -/* Returns TRUE if the PFN is currently mapped */ -#define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL)) - - #define GET_FIELD(_p, _f, _w) (((_w) == 8) ? ((_p)->x64._f) : ((_p)->x32._f)) #define SET_FIELD(_p, _f, _v, _w) do { \ diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c index 858bd0e26b..cb15d08c7e 100644 --- a/tools/misc/xen-mfndump.c +++ b/tools/misc/xen-mfndump.c @@ -5,7 +5,10 @@ #include #include -#include "xg_save_restore.h" +#include + +#define M2P_SIZE(_m) ROUNDUP(((_m) * sizeof(xen_pfn_t)), 21) +#define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL)) static xc_interface *xch; From patchwork Sun Aug 23 09:34:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731499 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FF48913 for ; Sun, 23 Aug 2020 09:38:22 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 75E6A2075B for ; Sun, 23 Aug 2020 09:38:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75E6A2075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQX-00062F-J0; Sun, 23 Aug 2020 09:36:37 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQA-0004sy-GG for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:14 +0000 X-Inumbo-ID: 6ad82288-5f6c-4bc0-bfcb-34aa9499ad8f Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6ad82288-5f6c-4bc0-bfcb-34aa9499ad8f; Sun, 23 Aug 2020 09:35:27 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 693D7AE24; Sun, 23 Aug 2020 09:35:54 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 16/38] tools/misc: replace PAGE_SIZE with XC_PAGE_SIZE in xen-mfndump.c Date: Sun, 23 Aug 2020 11:34:57 +0200 Message-Id: <20200823093519.18386-17-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The definition of PAGE_SIZE comes from xc_private.h, which shouldn't be used by xen-mfndump.c. Replace PAGE_SIZE by XC_PAGE_SIZE, as xc_private.h contains: #define PAGE_SIZE XC_PAGE_SIZE For the same reason PAGE_SHIFT_X86 needs to replaced with XC_PAGE_SHIFT. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/misc/xen-mfndump.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c index cb15d08c7e..92bc954ce0 100644 --- a/tools/misc/xen-mfndump.c +++ b/tools/misc/xen-mfndump.c @@ -207,7 +207,7 @@ int dump_ptes_func(int argc, char *argv[]) goto out; } - page = xc_map_foreign_range(xch, domid, PAGE_SIZE, PROT_READ, + page = xc_map_foreign_range(xch, domid, XC_PAGE_SIZE, PROT_READ, minfo.p2m_table[pfn]); if ( !page ) { @@ -216,7 +216,7 @@ int dump_ptes_func(int argc, char *argv[]) goto out; } - pte_num = PAGE_SIZE / 8; + pte_num = XC_PAGE_SIZE / 8; printf(" --- Dumping %d PTEs for domain %d ---\n", pte_num, domid); printf(" Guest Width: %u, PT Levels: %u P2M size: = %lu\n", @@ -252,7 +252,7 @@ int dump_ptes_func(int argc, char *argv[]) out: if ( page ) - munmap(page, PAGE_SIZE); + munmap(page, XC_PAGE_SIZE); xc_unmap_domain_meminfo(xch, &minfo); munmap(m2p_table, M2P_SIZE(max_mfn)); return rc; @@ -290,7 +290,7 @@ int lookup_pte_func(int argc, char *argv[]) return -1; } - pte_num = PAGE_SIZE / 8; + pte_num = XC_PAGE_SIZE / 8; printf(" --- Lookig for PTEs mapping mfn 0x%lx for domain %d ---\n", mfn, domid); @@ -302,7 +302,7 @@ int lookup_pte_func(int argc, char *argv[]) if ( !(minfo.pfn_type[i] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) ) continue; - page = xc_map_foreign_range(xch, domid, PAGE_SIZE, PROT_READ, + page = xc_map_foreign_range(xch, domid, XC_PAGE_SIZE, PROT_READ, minfo.p2m_table[i]); if ( !page ) continue; @@ -312,15 +312,15 @@ int lookup_pte_func(int argc, char *argv[]) uint64_t pte = ((const uint64_t*)page)[j]; #define __MADDR_BITS_X86 ((minfo.guest_width == 8) ? 52 : 44) -#define __MFN_MASK_X86 ((1ULL << (__MADDR_BITS_X86 - PAGE_SHIFT_X86)) - 1) - if ( ((pte >> PAGE_SHIFT_X86) & __MFN_MASK_X86) == mfn) +#define __MFN_MASK_X86 ((1ULL << (__MADDR_BITS_X86 - XC_PAGE_SHIFT)) - 1) + if ( ((pte >> XC_PAGE_SHIFT) & __MFN_MASK_X86) == mfn) printf(" 0x%lx <-- [0x%lx][%lu]: 0x%"PRIx64"\n", mfn, minfo.p2m_table[i], j, pte); #undef __MADDR_BITS_X86 #undef __MFN_MASK_X8 } - munmap(page, PAGE_SIZE); + munmap(page, XC_PAGE_SIZE); page = NULL; } @@ -355,8 +355,8 @@ int memcmp_mfns_func(int argc, char *argv[]) return -1; } - page1 = xc_map_foreign_range(xch, domid1, PAGE_SIZE, PROT_READ, mfn1); - page2 = xc_map_foreign_range(xch, domid2, PAGE_SIZE, PROT_READ, mfn2); + page1 = xc_map_foreign_range(xch, domid1, XC_PAGE_SIZE, PROT_READ, mfn1); + page2 = xc_map_foreign_range(xch, domid2, XC_PAGE_SIZE, PROT_READ, mfn2); if ( !page1 || !page2 ) { ERROR("Failed to map either 0x%lx[dom %d] or 0x%lx[dom %d]\n", @@ -368,13 +368,13 @@ int memcmp_mfns_func(int argc, char *argv[]) printf(" --- Comparing the content of 2 MFNs ---\n"); printf(" 1: 0x%lx[dom %d], 2: 0x%lx[dom %d]\n", mfn1, domid1, mfn2, domid2); - printf(" memcpy(1, 2) = %d\n", memcmp(page1, page2, PAGE_SIZE)); + printf(" memcpy(1, 2) = %d\n", memcmp(page1, page2, XC_PAGE_SIZE)); out: if ( page1 ) - munmap(page1, PAGE_SIZE); + munmap(page1, XC_PAGE_SIZE); if ( page2 ) - munmap(page2, PAGE_SIZE); + munmap(page2, XC_PAGE_SIZE); return rc; } From patchwork Sun Aug 23 09:34:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731489 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67AAD722 for ; Sun, 23 Aug 2020 09:37:58 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E1602075B for ; Sun, 23 Aug 2020 09:37:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E1602075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPp-0005AK-7x; Sun, 23 Aug 2020 09:35:53 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPn-0004t9-SC for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:51 +0000 X-Inumbo-ID: c7b2dc0b-7136-4b0a-8abf-e88d0c8fa61d Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c7b2dc0b-7136-4b0a-8abf-e88d0c8fa61d; Sun, 23 Aug 2020 09:35:27 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 89FBCAE25; Sun, 23 Aug 2020 09:35:54 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 17/38] tools/misc: drop all libxc internals from xen-mfndump.c Date: Sun, 23 Aug 2020 11:34:58 +0200 Message-Id: <20200823093519.18386-18-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The last libxc internal used by xen-mfndump.c is the ERROR() macro. Add a simple definition for that macro to xen-mfndump.c and replace the libxc private header includes by official ones. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/misc/Makefile | 2 -- tools/misc/xen-mfndump.c | 13 +++++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 2a7f2ec42d..7d37f297a9 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -99,8 +99,6 @@ xen-hptool: xen-hptool.o xenhypfs.o: CFLAGS += $(CFLAGS_libxenhypfs) -# xen-mfndump incorrectly uses libxc internals -xen-mfndump.o: CFLAGS += -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall) xen-mfndump: xen-mfndump.o $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS) diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c index 92bc954ce0..62121bd241 100644 --- a/tools/misc/xen-mfndump.c +++ b/tools/misc/xen-mfndump.c @@ -1,15 +1,20 @@ -#define XC_WANT_COMPAT_MAP_FOREIGN_API -#include -#include -#include +#include +#include +#include #include #include +#define XC_WANT_COMPAT_MAP_FOREIGN_API +#include +#include + #include #define M2P_SIZE(_m) ROUNDUP(((_m) * sizeof(xen_pfn_t)), 21) #define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL)) +#define ERROR(msg, args...) fprintf(stderr, msg, ## args) + static xc_interface *xch; int help_func(int argc, char *argv[]) From patchwork Sun Aug 23 09:34:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731453 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 30DC61510 for ; Sun, 23 Aug 2020 09:36:41 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16C412075B for ; Sun, 23 Aug 2020 09:36:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16C412075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPy-0005Kc-J9; Sun, 23 Aug 2020 09:36:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPx-0004t9-SW for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:01 +0000 X-Inumbo-ID: 6bf889bf-5600-4c9a-a4d3-bb6511c51298 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6bf889bf-5600-4c9a-a4d3-bb6511c51298; Sun, 23 Aug 2020 09:35:27 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id AD28BAE30; Sun, 23 Aug 2020 09:35:54 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 18/38] tools/libxc: remove unused headers xc_efi.h and xc_elf.h Date: Sun, 23 Aug 2020 11:34:59 +0200 Message-Id: <20200823093519.18386-19-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Remove xc_efi.h and xc_elf.h as they aren't used anywhere. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/libxc/xc_efi.h | 158 ------------------------------------------- tools/libxc/xc_elf.h | 16 ----- 2 files changed, 174 deletions(-) delete mode 100644 tools/libxc/xc_efi.h delete mode 100644 tools/libxc/xc_elf.h diff --git a/tools/libxc/xc_efi.h b/tools/libxc/xc_efi.h deleted file mode 100644 index dbe105be8f..0000000000 --- a/tools/libxc/xc_efi.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Extensible Firmware Interface - * Based on 'Extensible Firmware Interface Specification' version 0.9, April 30, 1999 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; If not, see . - * - * Copyright (C) 1999 VA Linux Systems - * Copyright (C) 1999 Walt Drummond - * Copyright (C) 1999, 2002-2003 Hewlett-Packard Co. - * David Mosberger-Tang - * Stephane Eranian - */ - -#ifndef XC_EFI_H -#define XC_EFI_H - -/* definitions from xen/include/asm-ia64/linux-xen/linux/efi.h */ - -typedef struct { - uint8_t b[16]; -} efi_guid_t; - -#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ -((efi_guid_t) \ -{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \ - (b) & 0xff, ((b) >> 8) & 0xff, \ - (c) & 0xff, ((c) >> 8) & 0xff, \ - (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}) - -/* - * Generic EFI table header - */ -typedef struct { - uint64_t signature; - uint32_t revision; - uint32_t headersize; - uint32_t crc32; - uint32_t reserved; -} efi_table_hdr_t; - -/* - * Memory map descriptor: - */ - -/* Memory types: */ -#define EFI_RESERVED_TYPE 0 -#define EFI_LOADER_CODE 1 -#define EFI_LOADER_DATA 2 -#define EFI_BOOT_SERVICES_CODE 3 -#define EFI_BOOT_SERVICES_DATA 4 -#define EFI_RUNTIME_SERVICES_CODE 5 -#define EFI_RUNTIME_SERVICES_DATA 6 -#define EFI_CONVENTIONAL_MEMORY 7 -#define EFI_UNUSABLE_MEMORY 8 -#define EFI_ACPI_RECLAIM_MEMORY 9 -#define EFI_ACPI_MEMORY_NVS 10 -#define EFI_MEMORY_MAPPED_IO 11 -#define EFI_MEMORY_MAPPED_IO_PORT_SPACE 12 -#define EFI_PAL_CODE 13 -#define EFI_MAX_MEMORY_TYPE 14 - -/* Attribute values: */ -#define EFI_MEMORY_UC ((uint64_t)0x0000000000000001ULL) /* uncached */ -#define EFI_MEMORY_WC ((uint64_t)0x0000000000000002ULL) /* write-coalescing */ -#define EFI_MEMORY_WT ((uint64_t)0x0000000000000004ULL) /* write-through */ -#define EFI_MEMORY_WB ((uint64_t)0x0000000000000008ULL) /* write-back */ -#define EFI_MEMORY_WP ((uint64_t)0x0000000000001000ULL) /* write-protect */ -#define EFI_MEMORY_RP ((uint64_t)0x0000000000002000ULL) /* read-protect */ -#define EFI_MEMORY_XP ((uint64_t)0x0000000000004000ULL) /* execute-protect */ -#define EFI_MEMORY_RUNTIME ((uint64_t)0x8000000000000000ULL) /* range requires runtime mapping */ -#define EFI_MEMORY_DESCRIPTOR_VERSION 1 - -#define EFI_PAGE_SHIFT 12 - -/* - * For current x86 implementations of EFI, there is - * additional padding in the mem descriptors. This is not - * the case in ia64. Need to have this fixed in the f/w. - */ -typedef struct { - uint32_t type; - uint32_t pad; - uint64_t phys_addr; - uint64_t virt_addr; - uint64_t num_pages; - uint64_t attribute; -#if defined (__i386__) - uint64_t pad1; -#endif -} efi_memory_desc_t; - -/* - * EFI Runtime Services table - */ -#define EFI_RUNTIME_SERVICES_SIGNATURE ((uint64_t)0x5652453544e5552ULL) -#define EFI_RUNTIME_SERVICES_REVISION 0x00010000 - -typedef struct { - efi_table_hdr_t hdr; - unsigned long get_time; - unsigned long set_time; - unsigned long get_wakeup_time; - unsigned long set_wakeup_time; - unsigned long set_virtual_address_map; - unsigned long convert_pointer; - unsigned long get_variable; - unsigned long get_next_variable; - unsigned long set_variable; - unsigned long get_next_high_mono_count; - unsigned long reset_system; -} efi_runtime_services_t; - -/* - * EFI Configuration Table and GUID definitions - */ -#define NULL_GUID \ - EFI_GUID( 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ) -#define ACPI_20_TABLE_GUID \ - EFI_GUID( 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 ) -#define SAL_SYSTEM_TABLE_GUID \ - EFI_GUID( 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) - -typedef struct { - efi_guid_t guid; - unsigned long table; -} efi_config_table_t; - -#define EFI_SYSTEM_TABLE_SIGNATURE ((uint64_t)0x5453595320494249ULL) -#define EFI_SYSTEM_TABLE_REVISION ((1 << 16) | 00) - -typedef struct { - efi_table_hdr_t hdr; - unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */ - uint32_t fw_revision; - unsigned long con_in_handle; - unsigned long con_in; - unsigned long con_out_handle; - unsigned long con_out; - unsigned long stderr_handle; - unsigned long stderr; - efi_runtime_services_t *runtime; - unsigned long boottime; - unsigned long nr_tables; - unsigned long tables; -} efi_system_table_t; - -#endif /* XC_EFI_H */ diff --git a/tools/libxc/xc_elf.h b/tools/libxc/xc_elf.h deleted file mode 100644 index acbc0280bd..0000000000 --- a/tools/libxc/xc_elf.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; If not, see . - */ - -#include From patchwork Sun Aug 23 09:35:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731461 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D6AB722 for ; Sun, 23 Aug 2020 09:37:20 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 537962075B for ; Sun, 23 Aug 2020 09:37:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 537962075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQc-00067u-Ay; Sun, 23 Aug 2020 09:36:42 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQF-0004sy-GQ for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:19 +0000 X-Inumbo-ID: 5daa8c70-5f58-4e82-8b31-1de38d3830db Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5daa8c70-5f58-4e82-8b31-1de38d3830db; Sun, 23 Aug 2020 09:35:28 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D32DEAE39; Sun, 23 Aug 2020 09:35:54 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 19/38] tools/libxc: move xc_[un]map_domain_meminfo() into new source xg_domain.c Date: Sun, 23 Aug 2020 11:35:00 +0200 Message-Id: <20200823093519.18386-20-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Move xc_[un]map_domain_meminfo() functions to new source xg_domain.c as they are defined in include/xenguest.h and should be in libxenguest. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/libxc/Makefile | 4 +- tools/libxc/xc_domain.c | 126 --------------------------------- tools/libxc/xg_domain.c | 149 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+), 127 deletions(-) create mode 100644 tools/libxc/xg_domain.c diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index c1e41a8ee9..f3f1edc07b 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -52,7 +52,9 @@ CTRL_SRCS-y += xc_gnttab_compat.c CTRL_SRCS-y += xc_devicemodel_compat.c GUEST_SRCS-y := -GUEST_SRCS-y += xg_private.c xc_suspend.c +GUEST_SRCS-y += xg_private.c +GUEST_SRCS-y += xg_domain.c +GUEST_SRCS-y += xc_suspend.c ifeq ($(CONFIG_MIGRATE),y) GUEST_SRCS-y += xc_sr_common.c GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86.c diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index 71829c2bce..fbc22c4df6 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -1892,132 +1892,6 @@ int xc_domain_unbind_pt_spi_irq(xc_interface *xch, PT_IRQ_TYPE_SPI, 0, 0, 0, 0, spi)); } -int xc_unmap_domain_meminfo(xc_interface *xch, struct xc_domain_meminfo *minfo) -{ - struct domain_info_context _di = { .guest_width = minfo->guest_width, - .p2m_size = minfo->p2m_size}; - struct domain_info_context *dinfo = &_di; - - free(minfo->pfn_type); - if ( minfo->p2m_table ) - munmap(minfo->p2m_table, P2M_FL_ENTRIES * PAGE_SIZE); - minfo->p2m_table = NULL; - - return 0; -} - -int xc_map_domain_meminfo(xc_interface *xch, uint32_t domid, - struct xc_domain_meminfo *minfo) -{ - struct domain_info_context _di; - struct domain_info_context *dinfo = &_di; - - xc_dominfo_t info; - shared_info_any_t *live_shinfo; - xen_capabilities_info_t xen_caps = ""; - int i; - - /* Only be initialized once */ - if ( minfo->pfn_type || minfo->p2m_table ) - { - errno = EINVAL; - return -1; - } - - if ( xc_domain_getinfo(xch, domid, 1, &info) != 1 ) - { - PERROR("Could not get domain info"); - return -1; - } - - if ( xc_domain_get_guest_width(xch, domid, &minfo->guest_width) ) - { - PERROR("Could not get domain address size"); - return -1; - } - _di.guest_width = minfo->guest_width; - - /* Get page table levels (see get_platform_info() in xg_save_restore.h */ - if ( xc_version(xch, XENVER_capabilities, &xen_caps) ) - { - PERROR("Could not get Xen capabilities (for page table levels)"); - return -1; - } - if ( strstr(xen_caps, "xen-3.0-x86_64") ) - /* Depends on whether it's a compat 32-on-64 guest */ - minfo->pt_levels = ( (minfo->guest_width == 8) ? 4 : 3 ); - else if ( strstr(xen_caps, "xen-3.0-x86_32p") ) - minfo->pt_levels = 3; - else if ( strstr(xen_caps, "xen-3.0-x86_32") ) - minfo->pt_levels = 2; - else - { - errno = EFAULT; - return -1; - } - - /* We need the shared info page for mapping the P2M */ - live_shinfo = xc_map_foreign_range(xch, domid, PAGE_SIZE, PROT_READ, - info.shared_info_frame); - if ( !live_shinfo ) - { - PERROR("Could not map the shared info frame (MFN 0x%lx)", - info.shared_info_frame); - return -1; - } - - if ( xc_core_arch_map_p2m_writable(xch, minfo->guest_width, &info, - live_shinfo, &minfo->p2m_table, - &minfo->p2m_size) ) - { - PERROR("Could not map the P2M table"); - munmap(live_shinfo, PAGE_SIZE); - return -1; - } - munmap(live_shinfo, PAGE_SIZE); - _di.p2m_size = minfo->p2m_size; - - /* Make space and prepare for getting the PFN types */ - minfo->pfn_type = calloc(sizeof(*minfo->pfn_type), minfo->p2m_size); - if ( !minfo->pfn_type ) - { - PERROR("Could not allocate memory for the PFN types"); - goto failed; - } - for ( i = 0; i < minfo->p2m_size; i++ ) - minfo->pfn_type[i] = xc_pfn_to_mfn(i, minfo->p2m_table, - minfo->guest_width); - - /* Retrieve PFN types in batches */ - for ( i = 0; i < minfo->p2m_size ; i+=1024 ) - { - int count = ((minfo->p2m_size - i ) > 1024 ) ? - 1024: (minfo->p2m_size - i); - - if ( xc_get_pfn_type_batch(xch, domid, count, minfo->pfn_type + i) ) - { - PERROR("Could not get %d-eth batch of PFN types", (i+1)/1024); - goto failed; - } - } - - return 0; - -failed: - if ( minfo->pfn_type ) - { - free(minfo->pfn_type); - minfo->pfn_type = NULL; - } - if ( minfo->p2m_table ) - { - munmap(minfo->p2m_table, P2M_FL_ENTRIES * PAGE_SIZE); - minfo->p2m_table = NULL; - } - - return -1; -} - int xc_domain_memory_mapping( xc_interface *xch, uint32_t domid, diff --git a/tools/libxc/xg_domain.c b/tools/libxc/xg_domain.c new file mode 100644 index 0000000000..58713cd35d --- /dev/null +++ b/tools/libxc/xg_domain.c @@ -0,0 +1,149 @@ +/****************************************************************************** + * xg_domain.c + * + * API for manipulating and obtaining information on domains. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; If not, see . + * + * Copyright (c) 2003, K A Fraser. + */ + +#include "xg_private.h" +#include "xc_core.h" + +int xc_unmap_domain_meminfo(xc_interface *xch, struct xc_domain_meminfo *minfo) +{ + struct domain_info_context _di = { .guest_width = minfo->guest_width, + .p2m_size = minfo->p2m_size}; + struct domain_info_context *dinfo = &_di; + + free(minfo->pfn_type); + if ( minfo->p2m_table ) + munmap(minfo->p2m_table, P2M_FL_ENTRIES * PAGE_SIZE); + minfo->p2m_table = NULL; + + return 0; +} + +int xc_map_domain_meminfo(xc_interface *xch, uint32_t domid, + struct xc_domain_meminfo *minfo) +{ + struct domain_info_context _di; + struct domain_info_context *dinfo = &_di; + + xc_dominfo_t info; + shared_info_any_t *live_shinfo; + xen_capabilities_info_t xen_caps = ""; + int i; + + /* Only be initialized once */ + if ( minfo->pfn_type || minfo->p2m_table ) + { + errno = EINVAL; + return -1; + } + + if ( xc_domain_getinfo(xch, domid, 1, &info) != 1 ) + { + PERROR("Could not get domain info"); + return -1; + } + + if ( xc_domain_get_guest_width(xch, domid, &minfo->guest_width) ) + { + PERROR("Could not get domain address size"); + return -1; + } + _di.guest_width = minfo->guest_width; + + /* Get page table levels (see get_platform_info() in xg_save_restore.h */ + if ( xc_version(xch, XENVER_capabilities, &xen_caps) ) + { + PERROR("Could not get Xen capabilities (for page table levels)"); + return -1; + } + if ( strstr(xen_caps, "xen-3.0-x86_64") ) + /* Depends on whether it's a compat 32-on-64 guest */ + minfo->pt_levels = ( (minfo->guest_width == 8) ? 4 : 3 ); + else if ( strstr(xen_caps, "xen-3.0-x86_32p") ) + minfo->pt_levels = 3; + else if ( strstr(xen_caps, "xen-3.0-x86_32") ) + minfo->pt_levels = 2; + else + { + errno = EFAULT; + return -1; + } + + /* We need the shared info page for mapping the P2M */ + live_shinfo = xc_map_foreign_range(xch, domid, PAGE_SIZE, PROT_READ, + info.shared_info_frame); + if ( !live_shinfo ) + { + PERROR("Could not map the shared info frame (MFN 0x%lx)", + info.shared_info_frame); + return -1; + } + + if ( xc_core_arch_map_p2m_writable(xch, minfo->guest_width, &info, + live_shinfo, &minfo->p2m_table, + &minfo->p2m_size) ) + { + PERROR("Could not map the P2M table"); + munmap(live_shinfo, PAGE_SIZE); + return -1; + } + munmap(live_shinfo, PAGE_SIZE); + _di.p2m_size = minfo->p2m_size; + + /* Make space and prepare for getting the PFN types */ + minfo->pfn_type = calloc(sizeof(*minfo->pfn_type), minfo->p2m_size); + if ( !minfo->pfn_type ) + { + PERROR("Could not allocate memory for the PFN types"); + goto failed; + } + for ( i = 0; i < minfo->p2m_size; i++ ) + minfo->pfn_type[i] = xc_pfn_to_mfn(i, minfo->p2m_table, + minfo->guest_width); + + /* Retrieve PFN types in batches */ + for ( i = 0; i < minfo->p2m_size ; i+=1024 ) + { + int count = ((minfo->p2m_size - i ) > 1024 ) ? + 1024: (minfo->p2m_size - i); + + if ( xc_get_pfn_type_batch(xch, domid, count, minfo->pfn_type + i) ) + { + PERROR("Could not get %d-eth batch of PFN types", (i+1)/1024); + goto failed; + } + } + + return 0; + +failed: + if ( minfo->pfn_type ) + { + free(minfo->pfn_type); + minfo->pfn_type = NULL; + } + if ( minfo->p2m_table ) + { + munmap(minfo->p2m_table, P2M_FL_ENTRIES * PAGE_SIZE); + minfo->p2m_table = NULL; + } + + return -1; +} From patchwork Sun Aug 23 09:35:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731459 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B54C913 for ; Sun, 23 Aug 2020 09:37:16 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 151FB2075B for ; Sun, 23 Aug 2020 09:37:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 151FB2075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQ8-0005YX-LH; Sun, 23 Aug 2020 09:36:12 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQ7-0004t9-Se for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:11 +0000 X-Inumbo-ID: 666e2964-7854-4f3c-a61e-e217fa76ea62 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 666e2964-7854-4f3c-a61e-e217fa76ea62; Sun, 23 Aug 2020 09:35:28 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 01E0DAE46; Sun, 23 Aug 2020 09:35:55 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 20/38] tools/libxc: rename all libxenguest sources to xg_* Date: Sun, 23 Aug 2020 11:35:01 +0200 Message-Id: <20200823093519.18386-21-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Some sources of libxenguest are named xg_*.c and some xc_*.c. Rename the xc_*.c files to xg_*.c. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/libxc/Makefile | 59 ++++++++++--------- .../libxc/{xc_cpuid_x86.c => xg_cpuid_x86.c} | 0 tools/libxc/{xc_dom_arm.c => xg_dom_arm.c} | 0 ...imageloader.c => xg_dom_armzimageloader.c} | 0 ...{xc_dom_binloader.c => xg_dom_binloader.c} | 0 tools/libxc/{xc_dom_boot.c => xg_dom_boot.c} | 0 ...bzimageloader.c => xg_dom_bzimageloader.c} | 0 ...m_compat_linux.c => xg_dom_compat_linux.c} | 0 tools/libxc/{xc_dom_core.c => xg_dom_core.c} | 0 ...compress_lz4.c => xg_dom_decompress_lz4.c} | 0 ...ss_unsafe.c => xg_dom_decompress_unsafe.c} | 0 ...ip2.c => xg_dom_decompress_unsafe_bzip2.c} | 0 ...lzma.c => xg_dom_decompress_unsafe_lzma.c} | 0 ...o1x.c => xg_dom_decompress_unsafe_lzo1x.c} | 0 ...afe_xz.c => xg_dom_decompress_unsafe_xz.c} | 0 ...{xc_dom_elfloader.c => xg_dom_elfloader.c} | 0 ...{xc_dom_hvmloader.c => xg_dom_hvmloader.c} | 0 tools/libxc/{xc_dom_x86.c => xg_dom_x86.c} | 0 .../libxc/{xc_nomigrate.c => xg_nomigrate.c} | 0 .../{xc_offline_page.c => xg_offline_page.c} | 0 .../libxc/{xc_sr_common.c => xg_sr_common.c} | 0 ...{xc_sr_common_x86.c => xg_sr_common_x86.c} | 0 ..._common_x86_pv.c => xg_sr_common_x86_pv.c} | 0 .../{xc_sr_restore.c => xg_sr_restore.c} | 0 ...tore_x86_hvm.c => xg_sr_restore_x86_hvm.c} | 0 ...estore_x86_pv.c => xg_sr_restore_x86_pv.c} | 0 tools/libxc/{xc_sr_save.c => xg_sr_save.c} | 0 ...sr_save_x86_hvm.c => xg_sr_save_x86_hvm.c} | 0 ...c_sr_save_x86_pv.c => xg_sr_save_x86_pv.c} | 0 tools/libxc/{xc_suspend.c => xg_suspend.c} | 0 30 files changed, 30 insertions(+), 29 deletions(-) rename tools/libxc/{xc_cpuid_x86.c => xg_cpuid_x86.c} (100%) rename tools/libxc/{xc_dom_arm.c => xg_dom_arm.c} (100%) rename tools/libxc/{xc_dom_armzimageloader.c => xg_dom_armzimageloader.c} (100%) rename tools/libxc/{xc_dom_binloader.c => xg_dom_binloader.c} (100%) rename tools/libxc/{xc_dom_boot.c => xg_dom_boot.c} (100%) rename tools/libxc/{xc_dom_bzimageloader.c => xg_dom_bzimageloader.c} (100%) rename tools/libxc/{xc_dom_compat_linux.c => xg_dom_compat_linux.c} (100%) rename tools/libxc/{xc_dom_core.c => xg_dom_core.c} (100%) rename tools/libxc/{xc_dom_decompress_lz4.c => xg_dom_decompress_lz4.c} (100%) rename tools/libxc/{xc_dom_decompress_unsafe.c => xg_dom_decompress_unsafe.c} (100%) rename tools/libxc/{xc_dom_decompress_unsafe_bzip2.c => xg_dom_decompress_unsafe_bzip2.c} (100%) rename tools/libxc/{xc_dom_decompress_unsafe_lzma.c => xg_dom_decompress_unsafe_lzma.c} (100%) rename tools/libxc/{xc_dom_decompress_unsafe_lzo1x.c => xg_dom_decompress_unsafe_lzo1x.c} (100%) rename tools/libxc/{xc_dom_decompress_unsafe_xz.c => xg_dom_decompress_unsafe_xz.c} (100%) rename tools/libxc/{xc_dom_elfloader.c => xg_dom_elfloader.c} (100%) rename tools/libxc/{xc_dom_hvmloader.c => xg_dom_hvmloader.c} (100%) rename tools/libxc/{xc_dom_x86.c => xg_dom_x86.c} (100%) rename tools/libxc/{xc_nomigrate.c => xg_nomigrate.c} (100%) rename tools/libxc/{xc_offline_page.c => xg_offline_page.c} (100%) rename tools/libxc/{xc_sr_common.c => xg_sr_common.c} (100%) rename tools/libxc/{xc_sr_common_x86.c => xg_sr_common_x86.c} (100%) rename tools/libxc/{xc_sr_common_x86_pv.c => xg_sr_common_x86_pv.c} (100%) rename tools/libxc/{xc_sr_restore.c => xg_sr_restore.c} (100%) rename tools/libxc/{xc_sr_restore_x86_hvm.c => xg_sr_restore_x86_hvm.c} (100%) rename tools/libxc/{xc_sr_restore_x86_pv.c => xg_sr_restore_x86_pv.c} (100%) rename tools/libxc/{xc_sr_save.c => xg_sr_save.c} (100%) rename tools/libxc/{xc_sr_save_x86_hvm.c => xg_sr_save_x86_hvm.c} (100%) rename tools/libxc/{xc_sr_save_x86_pv.c => xg_sr_save_x86_pv.c} (100%) rename tools/libxc/{xc_suspend.c => xg_suspend.c} (100%) diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index f3f1edc07b..e1b2c24106 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -54,20 +54,20 @@ CTRL_SRCS-y += xc_devicemodel_compat.c GUEST_SRCS-y := GUEST_SRCS-y += xg_private.c GUEST_SRCS-y += xg_domain.c -GUEST_SRCS-y += xc_suspend.c +GUEST_SRCS-y += xg_suspend.c ifeq ($(CONFIG_MIGRATE),y) -GUEST_SRCS-y += xc_sr_common.c -GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86.c -GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86_pv.c -GUEST_SRCS-$(CONFIG_X86) += xc_sr_restore_x86_pv.c -GUEST_SRCS-$(CONFIG_X86) += xc_sr_restore_x86_hvm.c -GUEST_SRCS-$(CONFIG_X86) += xc_sr_save_x86_pv.c -GUEST_SRCS-$(CONFIG_X86) += xc_sr_save_x86_hvm.c -GUEST_SRCS-y += xc_sr_restore.c -GUEST_SRCS-y += xc_sr_save.c -GUEST_SRCS-y += xc_offline_page.c +GUEST_SRCS-y += xg_sr_common.c +GUEST_SRCS-$(CONFIG_X86) += xg_sr_common_x86.c +GUEST_SRCS-$(CONFIG_X86) += xg_sr_common_x86_pv.c +GUEST_SRCS-$(CONFIG_X86) += xg_sr_restore_x86_pv.c +GUEST_SRCS-$(CONFIG_X86) += xg_sr_restore_x86_hvm.c +GUEST_SRCS-$(CONFIG_X86) += xg_sr_save_x86_pv.c +GUEST_SRCS-$(CONFIG_X86) += xg_sr_save_x86_hvm.c +GUEST_SRCS-y += xg_sr_restore.c +GUEST_SRCS-y += xg_sr_save.c +GUEST_SRCS-y += xg_offline_page.c else -GUEST_SRCS-y += xc_nomigrate.c +GUEST_SRCS-y += xg_nomigrate.c endif vpath %.c ../../xen/common/libelf @@ -88,25 +88,26 @@ GUEST_SRCS-y += cpuid.c msr.c endif # new domain builder -GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c -GUEST_SRCS-y += xc_dom_elfloader.c -GUEST_SRCS-$(CONFIG_X86) += xc_dom_bzimageloader.c -GUEST_SRCS-$(CONFIG_X86) += xc_dom_decompress_lz4.c -GUEST_SRCS-$(CONFIG_X86) += xc_dom_hvmloader.c -GUEST_SRCS-$(CONFIG_ARM) += xc_dom_armzimageloader.c -GUEST_SRCS-y += xc_dom_binloader.c -GUEST_SRCS-y += xc_dom_compat_linux.c - -GUEST_SRCS-$(CONFIG_X86) += xc_dom_x86.c -GUEST_SRCS-$(CONFIG_X86) += xc_cpuid_x86.c -GUEST_SRCS-$(CONFIG_ARM) += xc_dom_arm.c +GUEST_SRCS-y += xg_dom_core.c +GUEST_SRCS-y += xg_dom_boot.c +GUEST_SRCS-y += xg_dom_elfloader.c +GUEST_SRCS-$(CONFIG_X86) += xg_dom_bzimageloader.c +GUEST_SRCS-$(CONFIG_X86) += xg_dom_decompress_lz4.c +GUEST_SRCS-$(CONFIG_X86) += xg_dom_hvmloader.c +GUEST_SRCS-$(CONFIG_ARM) += xg_dom_armzimageloader.c +GUEST_SRCS-y += xg_dom_binloader.c +GUEST_SRCS-y += xg_dom_compat_linux.c + +GUEST_SRCS-$(CONFIG_X86) += xg_dom_x86.c +GUEST_SRCS-$(CONFIG_X86) += xg_cpuid_x86.c +GUEST_SRCS-$(CONFIG_ARM) += xg_dom_arm.c ifeq ($(CONFIG_LIBXC_MINIOS),y) -GUEST_SRCS-y += xc_dom_decompress_unsafe.c -GUEST_SRCS-y += xc_dom_decompress_unsafe_bzip2.c -GUEST_SRCS-y += xc_dom_decompress_unsafe_lzma.c -GUEST_SRCS-y += xc_dom_decompress_unsafe_lzo1x.c -GUEST_SRCS-y += xc_dom_decompress_unsafe_xz.c +GUEST_SRCS-y += xg_dom_decompress_unsafe.c +GUEST_SRCS-y += xg_dom_decompress_unsafe_bzip2.c +GUEST_SRCS-y += xg_dom_decompress_unsafe_lzma.c +GUEST_SRCS-y += xg_dom_decompress_unsafe_lzo1x.c +GUEST_SRCS-y += xg_dom_decompress_unsafe_xz.c endif -include $(XEN_TARGET_ARCH)/Makefile diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xg_cpuid_x86.c similarity index 100% rename from tools/libxc/xc_cpuid_x86.c rename to tools/libxc/xg_cpuid_x86.c diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xg_dom_arm.c similarity index 100% rename from tools/libxc/xc_dom_arm.c rename to tools/libxc/xg_dom_arm.c diff --git a/tools/libxc/xc_dom_armzimageloader.c b/tools/libxc/xg_dom_armzimageloader.c similarity index 100% rename from tools/libxc/xc_dom_armzimageloader.c rename to tools/libxc/xg_dom_armzimageloader.c diff --git a/tools/libxc/xc_dom_binloader.c b/tools/libxc/xg_dom_binloader.c similarity index 100% rename from tools/libxc/xc_dom_binloader.c rename to tools/libxc/xg_dom_binloader.c diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xg_dom_boot.c similarity index 100% rename from tools/libxc/xc_dom_boot.c rename to tools/libxc/xg_dom_boot.c diff --git a/tools/libxc/xc_dom_bzimageloader.c b/tools/libxc/xg_dom_bzimageloader.c similarity index 100% rename from tools/libxc/xc_dom_bzimageloader.c rename to tools/libxc/xg_dom_bzimageloader.c diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xg_dom_compat_linux.c similarity index 100% rename from tools/libxc/xc_dom_compat_linux.c rename to tools/libxc/xg_dom_compat_linux.c diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xg_dom_core.c similarity index 100% rename from tools/libxc/xc_dom_core.c rename to tools/libxc/xg_dom_core.c diff --git a/tools/libxc/xc_dom_decompress_lz4.c b/tools/libxc/xg_dom_decompress_lz4.c similarity index 100% rename from tools/libxc/xc_dom_decompress_lz4.c rename to tools/libxc/xg_dom_decompress_lz4.c diff --git a/tools/libxc/xc_dom_decompress_unsafe.c b/tools/libxc/xg_dom_decompress_unsafe.c similarity index 100% rename from tools/libxc/xc_dom_decompress_unsafe.c rename to tools/libxc/xg_dom_decompress_unsafe.c diff --git a/tools/libxc/xc_dom_decompress_unsafe_bzip2.c b/tools/libxc/xg_dom_decompress_unsafe_bzip2.c similarity index 100% rename from tools/libxc/xc_dom_decompress_unsafe_bzip2.c rename to tools/libxc/xg_dom_decompress_unsafe_bzip2.c diff --git a/tools/libxc/xc_dom_decompress_unsafe_lzma.c b/tools/libxc/xg_dom_decompress_unsafe_lzma.c similarity index 100% rename from tools/libxc/xc_dom_decompress_unsafe_lzma.c rename to tools/libxc/xg_dom_decompress_unsafe_lzma.c diff --git a/tools/libxc/xc_dom_decompress_unsafe_lzo1x.c b/tools/libxc/xg_dom_decompress_unsafe_lzo1x.c similarity index 100% rename from tools/libxc/xc_dom_decompress_unsafe_lzo1x.c rename to tools/libxc/xg_dom_decompress_unsafe_lzo1x.c diff --git a/tools/libxc/xc_dom_decompress_unsafe_xz.c b/tools/libxc/xg_dom_decompress_unsafe_xz.c similarity index 100% rename from tools/libxc/xc_dom_decompress_unsafe_xz.c rename to tools/libxc/xg_dom_decompress_unsafe_xz.c diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xg_dom_elfloader.c similarity index 100% rename from tools/libxc/xc_dom_elfloader.c rename to tools/libxc/xg_dom_elfloader.c diff --git a/tools/libxc/xc_dom_hvmloader.c b/tools/libxc/xg_dom_hvmloader.c similarity index 100% rename from tools/libxc/xc_dom_hvmloader.c rename to tools/libxc/xg_dom_hvmloader.c diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xg_dom_x86.c similarity index 100% rename from tools/libxc/xc_dom_x86.c rename to tools/libxc/xg_dom_x86.c diff --git a/tools/libxc/xc_nomigrate.c b/tools/libxc/xg_nomigrate.c similarity index 100% rename from tools/libxc/xc_nomigrate.c rename to tools/libxc/xg_nomigrate.c diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xg_offline_page.c similarity index 100% rename from tools/libxc/xc_offline_page.c rename to tools/libxc/xg_offline_page.c diff --git a/tools/libxc/xc_sr_common.c b/tools/libxc/xg_sr_common.c similarity index 100% rename from tools/libxc/xc_sr_common.c rename to tools/libxc/xg_sr_common.c diff --git a/tools/libxc/xc_sr_common_x86.c b/tools/libxc/xg_sr_common_x86.c similarity index 100% rename from tools/libxc/xc_sr_common_x86.c rename to tools/libxc/xg_sr_common_x86.c diff --git a/tools/libxc/xc_sr_common_x86_pv.c b/tools/libxc/xg_sr_common_x86_pv.c similarity index 100% rename from tools/libxc/xc_sr_common_x86_pv.c rename to tools/libxc/xg_sr_common_x86_pv.c diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xg_sr_restore.c similarity index 100% rename from tools/libxc/xc_sr_restore.c rename to tools/libxc/xg_sr_restore.c diff --git a/tools/libxc/xc_sr_restore_x86_hvm.c b/tools/libxc/xg_sr_restore_x86_hvm.c similarity index 100% rename from tools/libxc/xc_sr_restore_x86_hvm.c rename to tools/libxc/xg_sr_restore_x86_hvm.c diff --git a/tools/libxc/xc_sr_restore_x86_pv.c b/tools/libxc/xg_sr_restore_x86_pv.c similarity index 100% rename from tools/libxc/xc_sr_restore_x86_pv.c rename to tools/libxc/xg_sr_restore_x86_pv.c diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xg_sr_save.c similarity index 100% rename from tools/libxc/xc_sr_save.c rename to tools/libxc/xg_sr_save.c diff --git a/tools/libxc/xc_sr_save_x86_hvm.c b/tools/libxc/xg_sr_save_x86_hvm.c similarity index 100% rename from tools/libxc/xc_sr_save_x86_hvm.c rename to tools/libxc/xg_sr_save_x86_hvm.c diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xg_sr_save_x86_pv.c similarity index 100% rename from tools/libxc/xc_sr_save_x86_pv.c rename to tools/libxc/xg_sr_save_x86_pv.c diff --git a/tools/libxc/xc_suspend.c b/tools/libxc/xg_suspend.c similarity index 100% rename from tools/libxc/xc_suspend.c rename to tools/libxc/xg_suspend.c From patchwork Sun Aug 23 09:35:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731497 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 39D20913 for ; Sun, 23 Aug 2020 09:38:12 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F2972075B for ; Sun, 23 Aug 2020 09:38:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F2972075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQp-0006MG-PX; Sun, 23 Aug 2020 09:36:55 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQC-0004t9-Sv for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:16 +0000 X-Inumbo-ID: 66337d56-829d-449b-81b1-563af571eb55 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 66337d56-829d-449b-81b1-563af571eb55; Sun, 23 Aug 2020 09:35:28 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 254B9AE48; Sun, 23 Aug 2020 09:35:55 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 21/38] tools/libxc: rename libxenguest internal headers Date: Sun, 23 Aug 2020 11:35:02 +0200 Message-Id: <20200823093519.18386-22-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Rename the header files private to libxenguest from xc_*.h to xg_*.h. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/libxc/xg_dom_bzimageloader.c | 2 +- tools/libxc/{xc_dom_decompress.h => xg_dom_decompress.h} | 2 +- tools/libxc/xg_dom_decompress_lz4.c | 2 +- tools/libxc/xg_dom_decompress_unsafe.c | 2 +- .../{xc_dom_decompress_unsafe.h => xg_dom_decompress_unsafe.h} | 0 tools/libxc/xg_dom_decompress_unsafe_bzip2.c | 2 +- tools/libxc/xg_dom_decompress_unsafe_lzma.c | 2 +- tools/libxc/xg_dom_decompress_unsafe_lzo1x.c | 2 +- tools/libxc/xg_dom_decompress_unsafe_xz.c | 2 +- tools/libxc/xg_sr_common.c | 2 +- tools/libxc/{xc_sr_common.h => xg_sr_common.h} | 2 +- tools/libxc/xg_sr_common_x86.c | 2 +- tools/libxc/{xc_sr_common_x86.h => xg_sr_common_x86.h} | 2 +- tools/libxc/xg_sr_common_x86_pv.c | 2 +- tools/libxc/{xc_sr_common_x86_pv.h => xg_sr_common_x86_pv.h} | 2 +- tools/libxc/xg_sr_restore.c | 2 +- tools/libxc/xg_sr_restore_x86_hvm.c | 2 +- tools/libxc/xg_sr_restore_x86_pv.c | 2 +- tools/libxc/xg_sr_save.c | 2 +- tools/libxc/xg_sr_save_x86_hvm.c | 2 +- tools/libxc/xg_sr_save_x86_pv.c | 2 +- tools/libxc/{xc_sr_stream_format.h => xg_sr_stream_format.h} | 0 22 files changed, 20 insertions(+), 20 deletions(-) rename tools/libxc/{xc_dom_decompress.h => xg_dom_decompress.h} (77%) rename tools/libxc/{xc_dom_decompress_unsafe.h => xg_dom_decompress_unsafe.h} (100%) rename tools/libxc/{xc_sr_common.h => xg_sr_common.h} (99%) rename tools/libxc/{xc_sr_common_x86.h => xg_sr_common_x86.h} (98%) rename tools/libxc/{xc_sr_common_x86_pv.h => xg_sr_common_x86_pv.h} (98%) rename tools/libxc/{xc_sr_stream_format.h => xg_sr_stream_format.h} (100%) diff --git a/tools/libxc/xg_dom_bzimageloader.c b/tools/libxc/xg_dom_bzimageloader.c index a7d70cc7c6..f959a77602 100644 --- a/tools/libxc/xg_dom_bzimageloader.c +++ b/tools/libxc/xg_dom_bzimageloader.c @@ -32,7 +32,7 @@ #include #include "xg_private.h" -#include "xc_dom_decompress.h" +#include "xg_dom_decompress.h" #include diff --git a/tools/libxc/xc_dom_decompress.h b/tools/libxc/xg_dom_decompress.h similarity index 77% rename from tools/libxc/xc_dom_decompress.h rename to tools/libxc/xg_dom_decompress.h index 42cefa3f0e..d9a21cf297 100644 --- a/tools/libxc/xc_dom_decompress.h +++ b/tools/libxc/xg_dom_decompress.h @@ -1,7 +1,7 @@ #ifndef __MINIOS__ # include "xc_dom.h" #else -# include "xc_dom_decompress_unsafe.h" +# include "xg_dom_decompress_unsafe.h" #endif int xc_try_lz4_decode(struct xc_dom_image *dom, void **blob, size_t *size); diff --git a/tools/libxc/xg_dom_decompress_lz4.c b/tools/libxc/xg_dom_decompress_lz4.c index b6a33f27a8..97ba620d86 100644 --- a/tools/libxc/xg_dom_decompress_lz4.c +++ b/tools/libxc/xg_dom_decompress_lz4.c @@ -4,7 +4,7 @@ #include #include "xg_private.h" -#include "xc_dom_decompress.h" +#include "xg_dom_decompress.h" #define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS diff --git a/tools/libxc/xg_dom_decompress_unsafe.c b/tools/libxc/xg_dom_decompress_unsafe.c index 164e35558f..21d964787d 100644 --- a/tools/libxc/xg_dom_decompress_unsafe.c +++ b/tools/libxc/xg_dom_decompress_unsafe.c @@ -3,7 +3,7 @@ #include #include "xg_private.h" -#include "xc_dom_decompress_unsafe.h" +#include "xg_dom_decompress_unsafe.h" static struct xc_dom_image *unsafe_dom; static unsigned char *output_blob; diff --git a/tools/libxc/xc_dom_decompress_unsafe.h b/tools/libxc/xg_dom_decompress_unsafe.h similarity index 100% rename from tools/libxc/xc_dom_decompress_unsafe.h rename to tools/libxc/xg_dom_decompress_unsafe.h diff --git a/tools/libxc/xg_dom_decompress_unsafe_bzip2.c b/tools/libxc/xg_dom_decompress_unsafe_bzip2.c index 4dcabe4061..9d3709e6cc 100644 --- a/tools/libxc/xg_dom_decompress_unsafe_bzip2.c +++ b/tools/libxc/xg_dom_decompress_unsafe_bzip2.c @@ -3,7 +3,7 @@ #include #include "xg_private.h" -#include "xc_dom_decompress_unsafe.h" +#include "xg_dom_decompress_unsafe.h" #include "../../xen/common/bunzip2.c" diff --git a/tools/libxc/xg_dom_decompress_unsafe_lzma.c b/tools/libxc/xg_dom_decompress_unsafe_lzma.c index 4ee8cdbab1..5d178f0c43 100644 --- a/tools/libxc/xg_dom_decompress_unsafe_lzma.c +++ b/tools/libxc/xg_dom_decompress_unsafe_lzma.c @@ -3,7 +3,7 @@ #include #include "xg_private.h" -#include "xc_dom_decompress_unsafe.h" +#include "xg_dom_decompress_unsafe.h" #include "../../xen/common/unlzma.c" diff --git a/tools/libxc/xg_dom_decompress_unsafe_lzo1x.c b/tools/libxc/xg_dom_decompress_unsafe_lzo1x.c index 59888b9da2..a4f8ebd42d 100644 --- a/tools/libxc/xg_dom_decompress_unsafe_lzo1x.c +++ b/tools/libxc/xg_dom_decompress_unsafe_lzo1x.c @@ -5,7 +5,7 @@ #include #include "xg_private.h" -#include "xc_dom_decompress_unsafe.h" +#include "xg_dom_decompress_unsafe.h" typedef uint8_t u8; typedef uint32_t u32; diff --git a/tools/libxc/xg_dom_decompress_unsafe_xz.c b/tools/libxc/xg_dom_decompress_unsafe_xz.c index fe7a7f49b4..ff6824b38d 100644 --- a/tools/libxc/xg_dom_decompress_unsafe_xz.c +++ b/tools/libxc/xg_dom_decompress_unsafe_xz.c @@ -6,7 +6,7 @@ #include #include "xg_private.h" -#include "xc_dom_decompress_unsafe.h" +#include "xg_dom_decompress_unsafe.h" // TODO #define XZ_DEC_X86 diff --git a/tools/libxc/xg_sr_common.c b/tools/libxc/xg_sr_common.c index 7c54b03414..17567ab133 100644 --- a/tools/libxc/xg_sr_common.c +++ b/tools/libxc/xg_sr_common.c @@ -1,6 +1,6 @@ #include -#include "xc_sr_common.h" +#include "xg_sr_common.h" #include diff --git a/tools/libxc/xc_sr_common.h b/tools/libxc/xg_sr_common.h similarity index 99% rename from tools/libxc/xc_sr_common.h rename to tools/libxc/xg_sr_common.h index f3bdea8006..35f23fabb5 100644 --- a/tools/libxc/xc_sr_common.h +++ b/tools/libxc/xg_sr_common.h @@ -8,7 +8,7 @@ #include "xc_dom.h" #include "xc_bitops.h" -#include "xc_sr_stream_format.h" +#include "xg_sr_stream_format.h" /* String representation of Domain Header types. */ const char *dhdr_type_to_str(uint32_t type); diff --git a/tools/libxc/xg_sr_common_x86.c b/tools/libxc/xg_sr_common_x86.c index 77ea044a74..6f12483907 100644 --- a/tools/libxc/xg_sr_common_x86.c +++ b/tools/libxc/xg_sr_common_x86.c @@ -1,4 +1,4 @@ -#include "xc_sr_common_x86.h" +#include "xg_sr_common_x86.h" int write_x86_tsc_info(struct xc_sr_context *ctx) { diff --git a/tools/libxc/xc_sr_common_x86.h b/tools/libxc/xg_sr_common_x86.h similarity index 98% rename from tools/libxc/xc_sr_common_x86.h rename to tools/libxc/xg_sr_common_x86.h index e08d81e0e7..b55758c96d 100644 --- a/tools/libxc/xc_sr_common_x86.h +++ b/tools/libxc/xg_sr_common_x86.h @@ -1,7 +1,7 @@ #ifndef __COMMON_X86__H #define __COMMON_X86__H -#include "xc_sr_common.h" +#include "xg_sr_common.h" /* * Obtains a domains TSC information from Xen and writes a X86_TSC_INFO record diff --git a/tools/libxc/xg_sr_common_x86_pv.c b/tools/libxc/xg_sr_common_x86_pv.c index d3d425cb82..cd33406aab 100644 --- a/tools/libxc/xg_sr_common_x86_pv.c +++ b/tools/libxc/xg_sr_common_x86_pv.c @@ -1,6 +1,6 @@ #include -#include "xc_sr_common_x86_pv.h" +#include "xg_sr_common_x86_pv.h" xen_pfn_t mfn_to_pfn(struct xc_sr_context *ctx, xen_pfn_t mfn) { diff --git a/tools/libxc/xc_sr_common_x86_pv.h b/tools/libxc/xg_sr_common_x86_pv.h similarity index 98% rename from tools/libxc/xc_sr_common_x86_pv.h rename to tools/libxc/xg_sr_common_x86_pv.h index 2ed03309af..953b5bfb8d 100644 --- a/tools/libxc/xc_sr_common_x86_pv.h +++ b/tools/libxc/xg_sr_common_x86_pv.h @@ -1,7 +1,7 @@ #ifndef __COMMON_X86_PV_H #define __COMMON_X86_PV_H -#include "xc_sr_common_x86.h" +#include "xg_sr_common_x86.h" /* Virtual address ranges reserved for hypervisor. */ #define HYPERVISOR_VIRT_START_X86_64 0xFFFF800000000000ULL diff --git a/tools/libxc/xg_sr_restore.c b/tools/libxc/xg_sr_restore.c index bc811e6e3a..b57a787519 100644 --- a/tools/libxc/xg_sr_restore.c +++ b/tools/libxc/xg_sr_restore.c @@ -2,7 +2,7 @@ #include -#include "xc_sr_common.h" +#include "xg_sr_common.h" /* * Read and validate the Image and Domain headers. diff --git a/tools/libxc/xg_sr_restore_x86_hvm.c b/tools/libxc/xg_sr_restore_x86_hvm.c index a77624cc9d..d6ea6f3012 100644 --- a/tools/libxc/xg_sr_restore_x86_hvm.c +++ b/tools/libxc/xg_sr_restore_x86_hvm.c @@ -1,7 +1,7 @@ #include #include -#include "xc_sr_common_x86.h" +#include "xg_sr_common_x86.h" /* * Process an HVM_CONTEXT record from the stream. diff --git a/tools/libxc/xg_sr_restore_x86_pv.c b/tools/libxc/xg_sr_restore_x86_pv.c index d086271efb..dc50b0f5a8 100644 --- a/tools/libxc/xg_sr_restore_x86_pv.c +++ b/tools/libxc/xg_sr_restore_x86_pv.c @@ -1,6 +1,6 @@ #include -#include "xc_sr_common_x86_pv.h" +#include "xg_sr_common_x86_pv.h" static xen_pfn_t pfn_to_mfn(const struct xc_sr_context *ctx, xen_pfn_t pfn) { diff --git a/tools/libxc/xg_sr_save.c b/tools/libxc/xg_sr_save.c index 80b1d5de1f..d74c72cba6 100644 --- a/tools/libxc/xg_sr_save.c +++ b/tools/libxc/xg_sr_save.c @@ -1,7 +1,7 @@ #include #include -#include "xc_sr_common.h" +#include "xg_sr_common.h" /* * Writes an Image header and Domain header into the stream. diff --git a/tools/libxc/xg_sr_save_x86_hvm.c b/tools/libxc/xg_sr_save_x86_hvm.c index 0b2abb26bd..1634a7bc43 100644 --- a/tools/libxc/xg_sr_save_x86_hvm.c +++ b/tools/libxc/xg_sr_save_x86_hvm.c @@ -1,6 +1,6 @@ #include -#include "xc_sr_common_x86.h" +#include "xg_sr_common_x86.h" #include diff --git a/tools/libxc/xg_sr_save_x86_pv.c b/tools/libxc/xg_sr_save_x86_pv.c index c7e246ef4f..4964f1f7b8 100644 --- a/tools/libxc/xg_sr_save_x86_pv.c +++ b/tools/libxc/xg_sr_save_x86_pv.c @@ -1,7 +1,7 @@ #include #include -#include "xc_sr_common_x86_pv.h" +#include "xg_sr_common_x86_pv.h" /* Check a 64 bit virtual address for being canonical. */ static inline bool is_canonical_address(xen_vaddr_t vaddr) diff --git a/tools/libxc/xc_sr_stream_format.h b/tools/libxc/xg_sr_stream_format.h similarity index 100% rename from tools/libxc/xc_sr_stream_format.h rename to tools/libxc/xg_sr_stream_format.h From patchwork Sun Aug 23 09:35:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731505 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 209ED913 for ; Sun, 23 Aug 2020 09:48:02 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EFA1F2074D for ; Sun, 23 Aug 2020 09:48:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFA1F2074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maO-0008HV-So; Sun, 23 Aug 2020 09:46:48 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQM-0004t9-TA for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:26 +0000 X-Inumbo-ID: 99de0ecf-0c56-4b16-a832-98ba257ad99c Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 99de0ecf-0c56-4b16-a832-98ba257ad99c; Sun, 23 Aug 2020 09:35:28 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5794CB6F1; Sun, 23 Aug 2020 09:35:55 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Samuel Thibault , Ian Jackson , Wei Liu , Anthony PERARD , =?utf-8?q?Marek_Marczykowski-G?= =?utf-8?q?=C3=B3recki?= Subject: [PATCH v3 22/38] tools/misc: rename xc_dom.h do xenctrl_dom.h Date: Sun, 23 Aug 2020 11:35:03 +0200 Message-Id: <20200823093519.18386-23-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" For being able to disentangle lixenctrl and libxenguest headers xc_dom.h will need to be public. Prepare that by renaming xc_dom.h to xenctrl_dom.h. Signed-off-by: Juergen Gross Acked-by: Marek Marczykowski-Górecki Acked-by: Wei Liu --- stubdom/grub/kexec.c | 2 +- tools/helpers/init-xenstore-domain.c | 2 +- tools/libxc/include/{xc_dom.h => xenctrl_dom.h} | 0 tools/libxc/xc_core.c | 2 +- tools/libxc/xc_private.c | 2 +- tools/libxc/xg_dom_arm.c | 2 +- tools/libxc/xg_dom_armzimageloader.c | 2 +- tools/libxc/xg_dom_binloader.c | 2 +- tools/libxc/xg_dom_boot.c | 2 +- tools/libxc/xg_dom_compat_linux.c | 2 +- tools/libxc/xg_dom_core.c | 2 +- tools/libxc/xg_dom_decompress.h | 2 +- tools/libxc/xg_dom_decompress_unsafe.h | 2 +- tools/libxc/xg_dom_elfloader.c | 2 +- tools/libxc/xg_dom_hvmloader.c | 2 +- tools/libxc/xg_dom_x86.c | 2 +- tools/libxc/xg_offline_page.c | 2 +- tools/libxc/xg_sr_common.h | 2 +- tools/libxl/libxl_arm.c | 2 +- tools/libxl/libxl_arm.h | 2 +- tools/libxl/libxl_create.c | 2 +- tools/libxl/libxl_dm.c | 2 +- tools/libxl/libxl_dom.c | 2 +- tools/libxl/libxl_internal.h | 2 +- tools/libxl/libxl_vnuma.c | 2 +- tools/libxl/libxl_x86.c | 2 +- tools/libxl/libxl_x86_acpi.c | 2 +- tools/python/xen/lowlevel/xc/xc.c | 2 +- tools/xcutils/readnotes.c | 2 +- 29 files changed, 28 insertions(+), 28 deletions(-) rename tools/libxc/include/{xc_dom.h => xenctrl_dom.h} (100%) diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c index 0e68b969a2..24001220a9 100644 --- a/stubdom/grub/kexec.c +++ b/stubdom/grub/kexec.c @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c index 4ce8299c3c..5bdb48dc80 100644 --- a/tools/helpers/init-xenstore-domain.c +++ b/tools/helpers/init-xenstore-domain.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xenctrl_dom.h similarity index 100% rename from tools/libxc/include/xc_dom.h rename to tools/libxc/include/xenctrl_dom.h diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c index 2ee1d205b4..7df1fccd62 100644 --- a/tools/libxc/xc_core.c +++ b/tools/libxc/xc_core.c @@ -62,7 +62,7 @@ #include "xg_private.h" #include "xc_core.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include #include diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index 90974d572e..6ecdf6953f 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -19,7 +19,7 @@ #include "xc_private.h" #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include #include #include diff --git a/tools/libxc/xg_dom_arm.c b/tools/libxc/xg_dom_arm.c index 931404c222..3f66f1d890 100644 --- a/tools/libxc/xg_dom_arm.c +++ b/tools/libxc/xg_dom_arm.c @@ -24,7 +24,7 @@ #include #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #define NR_MAGIC_PAGES 4 #define CONSOLE_PFN_OFFSET 0 diff --git a/tools/libxc/xg_dom_armzimageloader.c b/tools/libxc/xg_dom_armzimageloader.c index 0df8c2a4b1..4246c8e5fa 100644 --- a/tools/libxc/xg_dom_armzimageloader.c +++ b/tools/libxc/xg_dom_armzimageloader.c @@ -25,7 +25,7 @@ #include #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include /* XXX ntohl is not the right function... */ diff --git a/tools/libxc/xg_dom_binloader.c b/tools/libxc/xg_dom_binloader.c index d6f7f2a500..870a921427 100644 --- a/tools/libxc/xg_dom_binloader.c +++ b/tools/libxc/xg_dom_binloader.c @@ -83,7 +83,7 @@ #include #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #define round_pgup(_p) (((_p)+(PAGE_SIZE_X86-1))&PAGE_MASK_X86) #define round_pgdown(_p) ((_p)&PAGE_MASK_X86) diff --git a/tools/libxc/xg_dom_boot.c b/tools/libxc/xg_dom_boot.c index bb599b33ba..1e31e92244 100644 --- a/tools/libxc/xg_dom_boot.c +++ b/tools/libxc/xg_dom_boot.c @@ -31,7 +31,7 @@ #include #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "xc_core.h" #include #include diff --git a/tools/libxc/xg_dom_compat_linux.c b/tools/libxc/xg_dom_compat_linux.c index b3d43feed9..b645f0b14b 100644 --- a/tools/libxc/xg_dom_compat_linux.c +++ b/tools/libxc/xg_dom_compat_linux.c @@ -30,7 +30,7 @@ #include "xenctrl.h" #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" /* ------------------------------------------------------------------------ */ diff --git a/tools/libxc/xg_dom_core.c b/tools/libxc/xg_dom_core.c index 327c8a8575..1c91cce315 100644 --- a/tools/libxc/xg_dom_core.c +++ b/tools/libxc/xg_dom_core.c @@ -32,7 +32,7 @@ #include #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "_paths.h" /* ------------------------------------------------------------------------ */ diff --git a/tools/libxc/xg_dom_decompress.h b/tools/libxc/xg_dom_decompress.h index d9a21cf297..c5ab2e59eb 100644 --- a/tools/libxc/xg_dom_decompress.h +++ b/tools/libxc/xg_dom_decompress.h @@ -1,5 +1,5 @@ #ifndef __MINIOS__ -# include "xc_dom.h" +# include "xenctrl_dom.h" #else # include "xg_dom_decompress_unsafe.h" #endif diff --git a/tools/libxc/xg_dom_decompress_unsafe.h b/tools/libxc/xg_dom_decompress_unsafe.h index 64f68864b1..fb84b6add8 100644 --- a/tools/libxc/xg_dom_decompress_unsafe.h +++ b/tools/libxc/xg_dom_decompress_unsafe.h @@ -1,4 +1,4 @@ -#include "xc_dom.h" +#include "xenctrl_dom.h" typedef int decompress_fn(unsigned char *inbuf, unsigned int len, int (*fill)(void*, unsigned int), diff --git a/tools/libxc/xg_dom_elfloader.c b/tools/libxc/xg_dom_elfloader.c index b327db219d..7043c3bbba 100644 --- a/tools/libxc/xg_dom_elfloader.c +++ b/tools/libxc/xg_dom_elfloader.c @@ -26,7 +26,7 @@ #include #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "xc_bitops.h" #define XEN_VER "xen-3.0" diff --git a/tools/libxc/xg_dom_hvmloader.c b/tools/libxc/xg_dom_hvmloader.c index 3f0bd65547..995a0f3dc3 100644 --- a/tools/libxc/xg_dom_hvmloader.c +++ b/tools/libxc/xg_dom_hvmloader.c @@ -26,7 +26,7 @@ #include #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "xc_bitops.h" /* ------------------------------------------------------------------------ */ diff --git a/tools/libxc/xg_dom_x86.c b/tools/libxc/xg_dom_x86.c index 9439805eaa..842dbcccdd 100644 --- a/tools/libxc/xg_dom_x86.c +++ b/tools/libxc/xg_dom_x86.c @@ -38,7 +38,7 @@ #include #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "xenctrl.h" /* ------------------------------------------------------------------------ */ diff --git a/tools/libxc/xg_offline_page.c b/tools/libxc/xg_offline_page.c index 19538fc436..77e8889b11 100644 --- a/tools/libxc/xg_offline_page.c +++ b/tools/libxc/xg_offline_page.c @@ -28,7 +28,7 @@ #include #include "xc_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "xg_private.h" #include "xg_save_restore.h" diff --git a/tools/libxc/xg_sr_common.h b/tools/libxc/xg_sr_common.h index 35f23fabb5..13fcc47420 100644 --- a/tools/libxc/xg_sr_common.h +++ b/tools/libxc/xg_sr_common.h @@ -5,7 +5,7 @@ #include "xg_private.h" #include "xg_save_restore.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "xc_bitops.h" #include "xg_sr_stream_format.h" diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c index 34f8a29056..975a4d730a 100644 --- a/tools/libxl/libxl_arm.c +++ b/tools/libxl/libxl_arm.c @@ -3,7 +3,7 @@ #include "libxl_libfdt_compat.h" #include "libxl_arm.h" -#include +#include #include #include #include diff --git a/tools/libxl/libxl_arm.h b/tools/libxl/libxl_arm.h index 8aef210d4c..52c2ab5e3a 100644 --- a/tools/libxl/libxl_arm.h +++ b/tools/libxl/libxl_arm.h @@ -17,7 +17,7 @@ #include "libxl_internal.h" #include "libxl_arch.h" -#include +#include _hidden int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 2814818e34..1031b75159 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -20,7 +20,7 @@ #include "libxl_internal.h" #include "libxl_arch.h" -#include +#include #include #include #include diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index f2dc5696b9..fec4e0fbe5 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -19,7 +19,7 @@ #include "libxl_internal.h" -#include +#include #include #include #include diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index f8661e90d4..e2dca64aa1 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -20,7 +20,7 @@ #include "libxl_internal.h" #include "libxl_arch.h" -#include +#include #include #include #include diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index c63d0686fd..e16ae9630b 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include diff --git a/tools/libxl/libxl_vnuma.c b/tools/libxl/libxl_vnuma.c index 8ec2abb2e6..c2e144ceae 100644 --- a/tools/libxl/libxl_vnuma.c +++ b/tools/libxl/libxl_vnuma.c @@ -17,7 +17,7 @@ #include "libxl_arch.h" #include -#include +#include bool libxl__vnuma_configured(const libxl_domain_build_info *b_info) { diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c index e57f63282e..7d95506e00 100644 --- a/tools/libxl/libxl_x86.c +++ b/tools/libxl/libxl_x86.c @@ -1,7 +1,7 @@ #include "libxl_internal.h" #include "libxl_arch.h" -#include +#include int libxl__arch_domain_prepare_config(libxl__gc *gc, libxl_domain_config *d_config, diff --git a/tools/libxl/libxl_x86_acpi.c b/tools/libxl/libxl_x86_acpi.c index ed6610c84e..3df86c7be5 100644 --- a/tools/libxl/libxl_x86_acpi.c +++ b/tools/libxl/libxl_x86_acpi.c @@ -18,7 +18,7 @@ #include #include "libacpi/libacpi.h" -#include +#include /* Number of pages holding ACPI tables */ #define NUM_ACPI_PAGES 16 diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index 8fde5f311f..8c7b184f0b 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -17,7 +17,7 @@ #include #include -#include "xc_dom.h" +#include "xenctrl_dom.h" #include #include diff --git a/tools/xcutils/readnotes.c b/tools/xcutils/readnotes.c index e682dd1a21..a6b7358e70 100644 --- a/tools/xcutils/readnotes.c +++ b/tools/xcutils/readnotes.c @@ -12,7 +12,7 @@ #include #include -#include /* gunzip bits */ +#include /* gunzip bits */ #include From patchwork Sun Aug 23 09:35:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731471 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3420913 for ; Sun, 23 Aug 2020 09:37:39 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE5632075B for ; Sun, 23 Aug 2020 09:37:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE5632075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQV-0005z0-2Q; Sun, 23 Aug 2020 09:36:35 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQK-0004sy-Ga for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:24 +0000 X-Inumbo-ID: df85f13b-fa7f-45e2-ae9c-4636f1447fc6 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id df85f13b-fa7f-45e2-ae9c-4636f1447fc6; Sun, 23 Aug 2020 09:35:28 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 79797AD39; Sun, 23 Aug 2020 09:35:55 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 23/38] tools/libxc: untangle libxenctrl from libxenguest Date: Sun, 23 Aug 2020 11:35:04 +0200 Message-Id: <20200823093519.18386-24-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Sources of libxenctrl and libxenguest are completely entangled. In practice libxenguest is a user of libxenctrl, so don't let any source libxenctrl include xg_private.h. This can be achieved by moving all definitions used by libxenctrl from xg_private.h to xc_private.h. Export xenctrl_dom.h as it will now be included by other public headers. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/libxc/Makefile | 3 ++- tools/libxc/include/xenctrl_dom.h | 10 +++++++-- tools/libxc/include/xenguest.h | 8 ++----- tools/libxc/xc_core.c | 5 +++-- tools/libxc/xc_core.h | 2 +- tools/libxc/xc_core_arm.c | 2 +- tools/libxc/xc_core_x86.c | 6 ++---- tools/libxc/xc_domain.c | 3 +-- tools/libxc/xc_hcall_buf.c | 1 - tools/libxc/xc_private.c | 1 - tools/libxc/xc_private.h | 36 +++++++++++++++++++++++++++++++ tools/libxc/xc_resume.c | 2 -- tools/libxc/xg_private.h | 22 ------------------- tools/libxc/xg_save_restore.h | 9 -------- 14 files changed, 56 insertions(+), 54 deletions(-) diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index e1b2c24106..1e4065f87c 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -193,7 +193,7 @@ 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) include/xenctrl.h include/xenctrl_compat.h $(DESTDIR)$(includedir) + $(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h include/xenctrl_dom.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) @@ -213,6 +213,7 @@ uninstall: rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xencontrol.pc rm -f $(DESTDIR)$(includedir)/xenctrl.h rm -f $(DESTDIR)$(includedir)/xenctrl_compat.h + rm -f $(DESTDIR)$(includedir)/xenctrl_dom.h rm -f $(DESTDIR)$(libdir)/libxenctrl.so rm -f $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR) rm -f $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR).$(MINOR) diff --git a/tools/libxc/include/xenctrl_dom.h b/tools/libxc/include/xenctrl_dom.h index 52a4d6c8c0..40b85b7755 100644 --- a/tools/libxc/include/xenctrl_dom.h +++ b/tools/libxc/include/xenctrl_dom.h @@ -17,9 +17,7 @@ #define _XC_DOM_H #include -#include -#define INVALID_PFN ((xen_pfn_t)-1) #define X86_HVM_NR_SPECIAL_PAGES 8 #define X86_HVM_END_SPECIAL_REGION 0xff000u #define XG_MAX_MODULES 2 @@ -38,6 +36,12 @@ struct xc_dom_seg { xen_pfn_t pages; }; +struct xc_hvm_firmware_module { + uint8_t *data; + uint32_t length; + uint64_t guest_addr_out; +}; + struct xc_dom_mem { struct xc_dom_mem *next; void *ptr; @@ -255,6 +259,8 @@ struct xc_dom_arch { int (*setup_pgtables) (struct xc_dom_image * dom); /* arch-specific data structs setup */ + /* in Mini-OS environment start_info might be a macro, avoid collision. */ +#undef start_info int (*start_info) (struct xc_dom_image * dom); int (*shared_info) (struct xc_dom_image * dom, void *shared_info); int (*vcpu) (struct xc_dom_image * dom); diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h index 7a12d21ff2..4643384790 100644 --- a/tools/libxc/include/xenguest.h +++ b/tools/libxc/include/xenguest.h @@ -22,6 +22,8 @@ #ifndef XENGUEST_H #define XENGUEST_H +#include + #define XC_NUMA_NO_NODE (~0U) #define XCFLAGS_LIVE (1 << 0) @@ -249,12 +251,6 @@ int xc_linux_build(xc_interface *xch, unsigned int console_evtchn, unsigned long *console_mfn); -struct xc_hvm_firmware_module { - uint8_t *data; - uint32_t length; - uint64_t guest_addr_out; -}; - /* * Sets *lockfd to -1. * Has deallocated everything even on error. diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c index 7df1fccd62..e8c6fb96f9 100644 --- a/tools/libxc/xc_core.c +++ b/tools/libxc/xc_core.c @@ -60,12 +60,13 @@ * */ -#include "xg_private.h" +#include "xc_private.h" #include "xc_core.h" -#include "xenctrl_dom.h" #include #include +#include + /* number of pages to write at a time */ #define DUMP_INCREMENT (4 * 1024) diff --git a/tools/libxc/xc_core.h b/tools/libxc/xc_core.h index ed7ed53ca5..36fb755da2 100644 --- a/tools/libxc/xc_core.h +++ b/tools/libxc/xc_core.h @@ -21,7 +21,7 @@ #define XC_CORE_H #include "xen/version.h" -#include "xg_private.h" +#include "xc_private.h" #include "xen/libelf/elfstructs.h" /* section names */ diff --git a/tools/libxc/xc_core_arm.c b/tools/libxc/xc_core_arm.c index c3c492c971..7b587b4cc5 100644 --- a/tools/libxc/xc_core_arm.c +++ b/tools/libxc/xc_core_arm.c @@ -16,7 +16,7 @@ * */ -#include "xg_private.h" +#include "xc_private.h" #include "xc_core.h" #include diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c index 54852a2d1a..cb76e6207b 100644 --- a/tools/libxc/xc_core_x86.c +++ b/tools/libxc/xc_core_x86.c @@ -17,12 +17,10 @@ * */ -#include "xg_private.h" +#include "xc_private.h" #include "xc_core.h" #include -#define GET_FIELD(_p, _f) ((dinfo->guest_width==8) ? ((_p)->x64._f) : ((_p)->x32._f)) - int xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt, unsigned long pfn) @@ -98,7 +96,7 @@ xc_core_arch_map_p2m_rw(xc_interface *xch, struct domain_info_context *dinfo, xc live_p2m_frame_list_list = xc_map_foreign_range(xch, dom, PAGE_SIZE, PROT_READ, - GET_FIELD(live_shinfo, arch.pfn_to_mfn_frame_list_list)); + GET_FIELD(live_shinfo, arch.pfn_to_mfn_frame_list_list, dinfo->guest_width)); if ( !live_p2m_frame_list_list ) { diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index fbc22c4df6..43fab50c06 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -21,8 +21,7 @@ #include "xc_private.h" #include "xc_core.h" -#include "xg_private.h" -#include "xg_save_restore.h" +#include "xc_private.h" #include #include diff --git a/tools/libxc/xc_hcall_buf.c b/tools/libxc/xc_hcall_buf.c index c1230a1e2b..200671f36f 100644 --- a/tools/libxc/xc_hcall_buf.c +++ b/tools/libxc/xc_hcall_buf.c @@ -19,7 +19,6 @@ #include #include "xc_private.h" -#include "xg_private.h" xc_hypercall_buffer_t XC__HYPERCALL_BUFFER_NAME(HYPERCALL_BUFFER_NULL) = { .hbuf = NULL, diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index 6ecdf6953f..8af96b1b7e 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -18,7 +18,6 @@ */ #include "xc_private.h" -#include "xg_private.h" #include "xenctrl_dom.h" #include #include diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h index c77edb3c4c..f0b5f83ac8 100644 --- a/tools/libxc/xc_private.h +++ b/tools/libxc/xc_private.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include "_paths.h" @@ -62,6 +63,39 @@ struct iovec { #include #endif +#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1)) + +#define GET_FIELD(_p, _f, _w) (((_w) == 8) ? ((_p)->x64._f) : ((_p)->x32._f)) + +#define SET_FIELD(_p, _f, _v, _w) do { \ + if ((_w) == 8) \ + (_p)->x64._f = (_v); \ + else \ + (_p)->x32._f = (_v); \ +} while (0) + +/* XXX SMH: following skanky macros rely on variable p2m_size being set */ +/* XXX TJD: also, "guest_width" should be the guest's sizeof(unsigned long) */ + +struct domain_info_context { + unsigned int guest_width; + unsigned long p2m_size; +}; + +/* Number of xen_pfn_t in a page */ +#define FPP (PAGE_SIZE/(dinfo->guest_width)) + +/* Number of entries in the pfn_to_mfn_frame_list_list */ +#define P2M_FLL_ENTRIES (((dinfo->p2m_size)+(FPP*FPP)-1)/(FPP*FPP)) + +/* Number of entries in the pfn_to_mfn_frame_list */ +#define P2M_FL_ENTRIES (((dinfo->p2m_size)+FPP-1)/FPP) + +/* Size in bytes of the pfn_to_mfn_frame_list */ +#define P2M_GUEST_FL_SIZE ((P2M_FL_ENTRIES) * (dinfo->guest_width)) +#define P2M_TOOLS_FL_SIZE ((P2M_FL_ENTRIES) * \ + max_t(size_t, sizeof(xen_pfn_t), dinfo->guest_width)) + #define DECLARE_DOMCTL struct xen_domctl domctl #define DECLARE_SYSCTL struct xen_sysctl sysctl #define DECLARE_PHYSDEV_OP struct physdev_op physdev_op @@ -75,6 +109,8 @@ struct iovec { #define PAGE_SIZE XC_PAGE_SIZE #define PAGE_MASK XC_PAGE_MASK +#define INVALID_PFN ((xen_pfn_t)-1) + /* ** Define max dirty page cache to permit during save/restore -- need to balance ** keeping cache usage down with CPU impact of invalidating too often. diff --git a/tools/libxc/xc_resume.c b/tools/libxc/xc_resume.c index c169204fac..94c6c9fb31 100644 --- a/tools/libxc/xc_resume.c +++ b/tools/libxc/xc_resume.c @@ -14,8 +14,6 @@ */ #include "xc_private.h" -#include "xg_private.h" -#include "xg_save_restore.h" #if defined(__i386__) || defined(__x86_64__) diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h index 40b5baecde..0000b2b9b6 100644 --- a/tools/libxc/xg_private.h +++ b/tools/libxc/xg_private.h @@ -97,15 +97,6 @@ typedef uint64_t x86_pgentry_t; #define NRPAGES(x) (ROUNDUP(x, PAGE_SHIFT) >> PAGE_SHIFT) - -/* XXX SMH: following skanky macros rely on variable p2m_size being set */ -/* XXX TJD: also, "guest_width" should be the guest's sizeof(unsigned long) */ - -struct domain_info_context { - unsigned int guest_width; - unsigned long p2m_size; -}; - static inline xen_pfn_t xc_pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m, unsigned gwidth) { @@ -121,19 +112,6 @@ static inline xen_pfn_t xc_pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m, } } -/* Number of xen_pfn_t in a page */ -#define FPP (PAGE_SIZE/(dinfo->guest_width)) - -/* Number of entries in the pfn_to_mfn_frame_list_list */ -#define P2M_FLL_ENTRIES (((dinfo->p2m_size)+(FPP*FPP)-1)/(FPP*FPP)) - -/* Number of entries in the pfn_to_mfn_frame_list */ -#define P2M_FL_ENTRIES (((dinfo->p2m_size)+FPP-1)/FPP) - -/* Size in bytes of the pfn_to_mfn_frame_list */ -#define P2M_GUEST_FL_SIZE ((P2M_FL_ENTRIES) * (dinfo->guest_width)) -#define P2M_TOOLS_FL_SIZE ((P2M_FL_ENTRIES) * \ - max_t(size_t, sizeof(xen_pfn_t), dinfo->guest_width)) /* Masks for PTE<->PFN conversions */ #define MADDR_BITS_X86 ((dinfo->guest_width == 8) ? 52 : 44) diff --git a/tools/libxc/xg_save_restore.h b/tools/libxc/xg_save_restore.h index b904296997..88120eb54b 100644 --- a/tools/libxc/xg_save_restore.h +++ b/tools/libxc/xg_save_restore.h @@ -109,15 +109,6 @@ static inline int get_platform_info(xc_interface *xch, uint32_t dom, #define M2P_SIZE(_m) ROUNDUP(((_m) * sizeof(xen_pfn_t)), M2P_SHIFT) #define M2P_CHUNKS(_m) (M2P_SIZE((_m)) >> M2P_SHIFT) -#define GET_FIELD(_p, _f, _w) (((_w) == 8) ? ((_p)->x64._f) : ((_p)->x32._f)) - -#define SET_FIELD(_p, _f, _v, _w) do { \ - if ((_w) == 8) \ - (_p)->x64._f = (_v); \ - else \ - (_p)->x32._f = (_v); \ -} while (0) - #define UNFOLD_CR3(_c) \ ((uint64_t)((dinfo->guest_width == 8) \ ? ((_c) >> 12) \ From patchwork Sun Aug 23 09:35:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731491 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3DEC1913 for ; Sun, 23 Aug 2020 09:38:03 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2460A2075B for ; Sun, 23 Aug 2020 09:38:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2460A2075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPu-0005G8-Rt; Sun, 23 Aug 2020 09:35:58 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mPs-0004t9-SY for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:35:56 +0000 X-Inumbo-ID: 77f96788-d6a1-4109-83f3-c050a5399b78 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 77f96788-d6a1-4109-83f3-c050a5399b78; Sun, 23 Aug 2020 09:35:28 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9E094B707; Sun, 23 Aug 2020 09:35:55 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 24/38] tools/xcutils: use official headers in readnotes Date: Sun, 23 Aug 2020 11:35:05 +0200 Message-Id: <20200823093519.18386-25-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" readnotes.c is including xg_private.h. Now that the xenctrl headers are structured better this is no longer needed. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/xcutils/Makefile | 3 +-- tools/xcutils/readnotes.c | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile index 2811893980..82d42624c8 100644 --- a/tools/xcutils/Makefile +++ b/tools/xcutils/Makefile @@ -15,8 +15,7 @@ PROGRAMS = readnotes lsevtchn CFLAGS += -Werror -# incorrectly uses libxc internals -CFLAGS_readnotes.o := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall) +CFLAGS_readnotes.o := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) CFLAGS_lsevtchn.o := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl) .PHONY: all diff --git a/tools/xcutils/readnotes.c b/tools/xcutils/readnotes.c index a6b7358e70..ff684c7dcb 100644 --- a/tools/xcutils/readnotes.c +++ b/tools/xcutils/readnotes.c @@ -11,8 +11,9 @@ #include #include -#include -#include /* gunzip bits */ +#include +#include +#include #include From patchwork Sun Aug 23 09:35:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731507 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94C9D109B for ; Sun, 23 Aug 2020 09:48:02 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7BA952074D for ; Sun, 23 Aug 2020 09:48:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BA952074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maA-00087o-7Q; Sun, 23 Aug 2020 09:46:34 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQP-0004sy-Go for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:29 +0000 X-Inumbo-ID: 8a1f53b2-e71a-4aee-bc0b-62ee9be74759 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8a1f53b2-e71a-4aee-bc0b-62ee9be74759; Sun, 23 Aug 2020 09:35:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C170AB725; Sun, 23 Aug 2020 09:35:55 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 25/38] tools/xenpaging: remove libxc internals Date: Sun, 23 Aug 2020 11:35:06 +0200 Message-Id: <20200823093519.18386-26-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" xenpaging is using libxc internals. Fix that. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/xenpaging/Makefile | 3 +- tools/xenpaging/file_ops.c | 8 ++-- tools/xenpaging/pagein.c | 2 +- tools/xenpaging/policy_default.c | 2 +- tools/xenpaging/xenpaging.c | 32 +++++++-------- tools/xenpaging/xenpaging.h | 70 +++++++++++++++++++++++++++++++- 6 files changed, 92 insertions(+), 25 deletions(-) diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile index 968678c4e8..04743b335c 100644 --- a/tools/xenpaging/Makefile +++ b/tools/xenpaging/Makefile @@ -1,8 +1,7 @@ XEN_ROOT=$(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk -# xenpaging.c and file_ops.c incorrectly use libxc internals -CFLAGS += $(CFLAGS_libxentoollog) $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall) +CFLAGS += $(CFLAGS_libxentoollog) $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) $(CFLAGS_libxencall) LDLIBS += $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS) LDFLAGS += $(PTHREAD_LDFLAGS) diff --git a/tools/xenpaging/file_ops.c b/tools/xenpaging/file_ops.c index 8210f426df..301fb3427c 100644 --- a/tools/xenpaging/file_ops.c +++ b/tools/xenpaging/file_ops.c @@ -20,7 +20,7 @@ #include -#include +#include static int file_op(int fd, void *page, int i, ssize_t (*fn)(int, void *, size_t)) @@ -29,13 +29,13 @@ static int file_op(int fd, void *page, int i, int total = 0; int bytes; - offset = lseek(fd, offset << PAGE_SHIFT, SEEK_SET); + offset = lseek(fd, offset << XC_PAGE_SHIFT, SEEK_SET); if ( offset == (off_t)-1 ) return -1; - while ( total < PAGE_SIZE ) + while ( total < XC_PAGE_SIZE ) { - bytes = fn(fd, page + total, PAGE_SIZE - total); + bytes = fn(fd, page + total, XC_PAGE_SIZE - total); if ( bytes <= 0 ) return -1; diff --git a/tools/xenpaging/pagein.c b/tools/xenpaging/pagein.c index 2a298b436c..1c8a7d983d 100644 --- a/tools/xenpaging/pagein.c +++ b/tools/xenpaging/pagein.c @@ -43,7 +43,7 @@ static void *page_in(void *arg) /* Ignore errors */ page = xc_map_foreign_pages(pia->xch, pia->dom, PROT_READ, gfns, num); if (page) - munmap(page, PAGE_SIZE * num); + munmap(page, XC_PAGE_SIZE * num); } page_in_possible = 0; pthread_exit(NULL); diff --git a/tools/xenpaging/policy_default.c b/tools/xenpaging/policy_default.c index 3324835957..979d251230 100644 --- a/tools/xenpaging/policy_default.c +++ b/tools/xenpaging/policy_default.c @@ -18,8 +18,8 @@ * along with this program; If not, see . */ +#include -#include "xc_bitops.h" #include "policy.h" diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c index d0571cabac..33098046c2 100644 --- a/tools/xenpaging/xenpaging.c +++ b/tools/xenpaging/xenpaging.c @@ -30,7 +30,6 @@ #include #include -#include "xc_bitops.h" #include "file_ops.h" #include "policy.h" #include "xenpaging.h" @@ -183,12 +182,12 @@ static void *init_page(void) void *buffer; /* Allocated page memory */ - errno = posix_memalign(&buffer, PAGE_SIZE, PAGE_SIZE); + errno = posix_memalign(&buffer, XC_PAGE_SIZE, XC_PAGE_SIZE); if ( errno != 0 ) return NULL; /* Lock buffer in memory so it can't be paged out */ - if ( mlock(buffer, PAGE_SIZE) < 0 ) + if ( mlock(buffer, XC_PAGE_SIZE) < 0 ) { free(buffer); buffer = NULL; @@ -277,7 +276,6 @@ static struct xenpaging *xenpaging_init(int argc, char *argv[]) struct xenpaging *paging; xc_domaininfo_t domain_info; xc_interface *xch = NULL; - xentoollog_logger *dbg = NULL; char *p; int rc; unsigned long ring_pfn, mmap_pfn; @@ -291,12 +289,11 @@ static struct xenpaging *xenpaging_init(int argc, char *argv[]) if ( xenpaging_getopts(paging, argc, argv) ) goto err; - /* Enable debug output */ - if ( paging->debug ) - dbg = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, XTL_DEBUG, 0); + paging->logger = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, + paging->debug ? XTL_DEBUG : XTL_PROGRESS, 0); /* Open connection to xen */ - paging->xc_handle = xch = xc_interface_open(dbg, NULL, 0); + paging->xc_handle = xch = xc_interface_open(paging->logger, NULL, 0); if ( !xch ) goto err; @@ -416,7 +413,7 @@ static struct xenpaging *xenpaging_init(int argc, char *argv[]) SHARED_RING_INIT((vm_event_sring_t *)paging->vm_event.ring_page); BACK_RING_INIT(&paging->vm_event.back_ring, (vm_event_sring_t *)paging->vm_event.ring_page, - PAGE_SIZE); + XC_PAGE_SIZE); /* Now that the ring is set, remove it from the guest's physmap */ if ( xc_domain_decrease_reservation_exact(xch, @@ -490,15 +487,17 @@ static struct xenpaging *xenpaging_init(int argc, char *argv[]) xs_close(paging->xs_handle); if ( xch ) xc_interface_close(xch); + if ( paging->logger ) + xtl_logger_destroy(paging->logger); if ( paging->paging_buffer ) { - munlock(paging->paging_buffer, PAGE_SIZE); + munlock(paging->paging_buffer, XC_PAGE_SIZE); free(paging->paging_buffer); } if ( paging->vm_event.ring_page ) { - munmap(paging->vm_event.ring_page, PAGE_SIZE); + munmap(paging->vm_event.ring_page, XC_PAGE_SIZE); } free(dom_path); @@ -523,7 +522,7 @@ static void xenpaging_teardown(struct xenpaging *paging) paging->xc_handle = NULL; /* Tear down domain paging in Xen */ - munmap(paging->vm_event.ring_page, PAGE_SIZE); + munmap(paging->vm_event.ring_page, XC_PAGE_SIZE); rc = xc_mem_paging_disable(xch, paging->vm_event.domain_id); if ( rc != 0 ) { @@ -551,6 +550,8 @@ static void xenpaging_teardown(struct xenpaging *paging) /* Close connection to Xen */ xc_interface_close(xch); + + xtl_logger_destroy(paging->logger); } static void get_request(struct vm_event *vm_event, vm_event_request_t *req) @@ -598,8 +599,7 @@ static int xenpaging_evict_page(struct xenpaging *paging, unsigned long gfn, int void *page; xen_pfn_t victim = gfn; int ret; - - DECLARE_DOMCTL; + struct xen_domctl domctl; /* Nominate page */ ret = xc_mem_paging_nominate(xch, paging->vm_event.domain_id, gfn); @@ -627,13 +627,13 @@ static int xenpaging_evict_page(struct xenpaging *paging, unsigned long gfn, int if ( ret < 0 ) { PERROR("Error copying page %lx", gfn); - munmap(page, PAGE_SIZE); + munmap(page, XC_PAGE_SIZE); ret = -1; goto out; } /* Release page */ - munmap(page, PAGE_SIZE); + munmap(page, XC_PAGE_SIZE); /* Tell Xen to evict page */ ret = xc_mem_paging_evict(xch, paging->vm_event.domain_id, gfn); diff --git a/tools/xenpaging/xenpaging.h b/tools/xenpaging/xenpaging.h index d6c8ee5221..e0fc7b31b8 100644 --- a/tools/xenpaging/xenpaging.h +++ b/tools/xenpaging/xenpaging.h @@ -23,11 +23,17 @@ #ifndef __XEN_PAGING2_H__ #define __XEN_PAGING2_H__ +#include +#include +#include +#include +#include +#include #include #define XC_WANT_COMPAT_MAP_FOREIGN_API #include -#include +// #include #include #include @@ -44,6 +50,7 @@ struct vm_event { struct xenpaging { xc_interface *xc_handle; + xentoollog_logger *logger; struct xs_handle *xs_handle; unsigned long *bitmap; @@ -67,9 +74,70 @@ struct xenpaging { unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE]; }; +#define DPRINTF(msg, args...) xtl_log(paging->logger, XTL_DETAIL, 0, \ + "paging", msg, ## args) +#define ERROR(msg, args...) xtl_log(paging->logger, XTL_ERROR, -1, \ + "paging", msg, ## args) +#define PERROR(msg, args...) xtl_log(paging->logger, XTL_ERROR, -1, \ + "paging", msg "(%d = %s)", ## args, \ + errno, strerror(errno)) + extern void create_page_in_thread(struct xenpaging *paging); extern void page_in_trigger(void); +#define BITS_PER_LONG (sizeof(unsigned long) * 8) +#define ORDER_LONG (sizeof(unsigned long) == 4 ? 5 : 6) + +#define BITMAP_ENTRY(_nr,_bmap) ((_bmap))[(_nr) / 8] +#define BITMAP_SHIFT(_nr) ((_nr) % 8) + +static inline int bitmap_size(int nr_bits) +{ + return (nr_bits + 7) / 8; +} + +static inline void *bitmap_alloc(int nr_bits) +{ + return calloc(1, bitmap_size(nr_bits)); +} + +static inline void bitmap_clear(void *addr, int nr_bits) +{ + memset(addr, 0, bitmap_size(nr_bits)); +} + +static inline int test_bit(int nr, const void *_addr) +{ + const char *addr = _addr; + return (BITMAP_ENTRY(nr, addr) >> BITMAP_SHIFT(nr)) & 1; +} + +static inline void clear_bit(int nr, void *_addr) +{ + char *addr = _addr; + BITMAP_ENTRY(nr, addr) &= ~(1UL << BITMAP_SHIFT(nr)); +} + +static inline void set_bit(int nr, void *_addr) +{ + char *addr = _addr; + BITMAP_ENTRY(nr, addr) |= (1UL << BITMAP_SHIFT(nr)); +} + +static inline int test_and_clear_bit(int nr, void *addr) +{ + int oldbit = test_bit(nr, addr); + clear_bit(nr, addr); + return oldbit; +} + +static inline int test_and_set_bit(int nr, void *addr) +{ + int oldbit = test_bit(nr, addr); + set_bit(nr, addr); + return oldbit; +} + #endif // __XEN_PAGING_H__ From patchwork Sun Aug 23 09:35:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731523 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44E54109B for ; Sun, 23 Aug 2020 09:48:33 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1FEF62074D for ; Sun, 23 Aug 2020 09:48:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FEF62074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maR-0008L7-24; Sun, 23 Aug 2020 09:46:51 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQU-0004sy-Gz for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:34 +0000 X-Inumbo-ID: e884b5a9-0211-4810-8209-b6abe38243cb Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e884b5a9-0211-4810-8209-b6abe38243cb; Sun, 23 Aug 2020 09:35:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 33799B7C2; Sun, 23 Aug 2020 09:35:56 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org, xen-devel@dornerworks.com Cc: Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Samuel Thibault , Josh Whitehead , Stewart Hildebrand , Christian Lindig , David Scott , =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= Subject: [PATCH v3 26/38] tools: move libxenctrl below tools/libs Date: Sun, 23 Aug 2020 11:35:07 +0200 Message-Id: <20200823093519.18386-27-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Today tools/libxc needs to be built after tools/libs as libxenctrl is depending on some libraries in tools/libs. This in turn blocks moving other libraries depending on libxenctrl below tools/libs. So carve out libxenctrl from tools/libxc and move it into tools/libs/ctrl. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault (stubdom parts) Acked-by: Marek Marczykowski-Górecki (python parts) Acked-by: Wei Liu --- .gitignore | 8 ++ MAINTAINERS | 2 +- stubdom/Makefile | 9 +- stubdom/grub/Makefile | 4 +- stubdom/mini-os.mk | 2 +- tools/Rules.mk | 8 +- tools/libs/Makefile | 1 + tools/libs/ctrl/Makefile | 71 +++++++++++++ tools/{libxc => libs/ctrl}/include/xenctrl.h | 0 .../ctrl}/include/xenctrl_compat.h | 0 .../ctrl}/include/xenctrl_dom.h | 0 tools/{libxc => libs/ctrl}/xc_altp2m.c | 0 tools/{libxc => libs/ctrl}/xc_arinc653.c | 0 tools/{libxc => libs/ctrl}/xc_bitops.h | 0 tools/{libxc => libs/ctrl}/xc_core.c | 0 tools/{libxc => libs/ctrl}/xc_core.h | 0 tools/{libxc => libs/ctrl}/xc_core_arm.c | 0 tools/{libxc => libs/ctrl}/xc_core_arm.h | 0 tools/{libxc => libs/ctrl}/xc_core_x86.c | 0 tools/{libxc => libs/ctrl}/xc_core_x86.h | 0 tools/{libxc => libs/ctrl}/xc_cpu_hotplug.c | 0 tools/{libxc => libs/ctrl}/xc_cpupool.c | 0 tools/{libxc => libs/ctrl}/xc_csched.c | 0 tools/{libxc => libs/ctrl}/xc_csched2.c | 0 .../ctrl}/xc_devicemodel_compat.c | 0 tools/{libxc => libs/ctrl}/xc_domain.c | 0 tools/{libxc => libs/ctrl}/xc_evtchn.c | 0 tools/{libxc => libs/ctrl}/xc_evtchn_compat.c | 0 tools/{libxc => libs/ctrl}/xc_flask.c | 0 .../{libxc => libs/ctrl}/xc_foreign_memory.c | 0 tools/{libxc => libs/ctrl}/xc_freebsd.c | 0 tools/{libxc => libs/ctrl}/xc_gnttab.c | 0 tools/{libxc => libs/ctrl}/xc_gnttab_compat.c | 0 tools/{libxc => libs/ctrl}/xc_hcall_buf.c | 0 tools/{libxc => libs/ctrl}/xc_kexec.c | 0 tools/{libxc => libs/ctrl}/xc_linux.c | 0 tools/{libxc => libs/ctrl}/xc_mem_access.c | 0 tools/{libxc => libs/ctrl}/xc_mem_paging.c | 0 tools/{libxc => libs/ctrl}/xc_memshr.c | 0 tools/{libxc => libs/ctrl}/xc_minios.c | 0 tools/{libxc => libs/ctrl}/xc_misc.c | 0 tools/{libxc => libs/ctrl}/xc_monitor.c | 0 tools/{libxc => libs/ctrl}/xc_msr_x86.h | 0 tools/{libxc => libs/ctrl}/xc_netbsd.c | 0 tools/{libxc => libs/ctrl}/xc_pagetab.c | 0 tools/{libxc => libs/ctrl}/xc_physdev.c | 0 tools/{libxc => libs/ctrl}/xc_pm.c | 0 tools/{libxc => libs/ctrl}/xc_private.c | 0 tools/{libxc => libs/ctrl}/xc_private.h | 0 tools/{libxc => libs/ctrl}/xc_psr.c | 0 tools/{libxc => libs/ctrl}/xc_resource.c | 0 tools/{libxc => libs/ctrl}/xc_resume.c | 0 tools/{libxc => libs/ctrl}/xc_rt.c | 0 tools/{libxc => libs/ctrl}/xc_solaris.c | 0 tools/{libxc => libs/ctrl}/xc_tbuf.c | 0 tools/{libxc => libs/ctrl}/xc_vm_event.c | 0 tools/{libxc => libs/ctrl}/xencontrol.pc.in | 0 tools/libs/uselibs.mk | 2 + tools/libxc/Makefile | 99 +++---------------- tools/ocaml/xenstored/Makefile | 2 +- tools/python/Makefile | 2 +- tools/python/setup.py | 8 +- 62 files changed, 110 insertions(+), 108 deletions(-) create mode 100644 tools/libs/ctrl/Makefile rename tools/{libxc => libs/ctrl}/include/xenctrl.h (100%) rename tools/{libxc => libs/ctrl}/include/xenctrl_compat.h (100%) rename tools/{libxc => libs/ctrl}/include/xenctrl_dom.h (100%) rename tools/{libxc => libs/ctrl}/xc_altp2m.c (100%) rename tools/{libxc => libs/ctrl}/xc_arinc653.c (100%) rename tools/{libxc => libs/ctrl}/xc_bitops.h (100%) rename tools/{libxc => libs/ctrl}/xc_core.c (100%) rename tools/{libxc => libs/ctrl}/xc_core.h (100%) rename tools/{libxc => libs/ctrl}/xc_core_arm.c (100%) rename tools/{libxc => libs/ctrl}/xc_core_arm.h (100%) rename tools/{libxc => libs/ctrl}/xc_core_x86.c (100%) rename tools/{libxc => libs/ctrl}/xc_core_x86.h (100%) rename tools/{libxc => libs/ctrl}/xc_cpu_hotplug.c (100%) rename tools/{libxc => libs/ctrl}/xc_cpupool.c (100%) rename tools/{libxc => libs/ctrl}/xc_csched.c (100%) rename tools/{libxc => libs/ctrl}/xc_csched2.c (100%) rename tools/{libxc => libs/ctrl}/xc_devicemodel_compat.c (100%) rename tools/{libxc => libs/ctrl}/xc_domain.c (100%) rename tools/{libxc => libs/ctrl}/xc_evtchn.c (100%) rename tools/{libxc => libs/ctrl}/xc_evtchn_compat.c (100%) rename tools/{libxc => libs/ctrl}/xc_flask.c (100%) rename tools/{libxc => libs/ctrl}/xc_foreign_memory.c (100%) rename tools/{libxc => libs/ctrl}/xc_freebsd.c (100%) rename tools/{libxc => libs/ctrl}/xc_gnttab.c (100%) rename tools/{libxc => libs/ctrl}/xc_gnttab_compat.c (100%) rename tools/{libxc => libs/ctrl}/xc_hcall_buf.c (100%) rename tools/{libxc => libs/ctrl}/xc_kexec.c (100%) rename tools/{libxc => libs/ctrl}/xc_linux.c (100%) rename tools/{libxc => libs/ctrl}/xc_mem_access.c (100%) rename tools/{libxc => libs/ctrl}/xc_mem_paging.c (100%) rename tools/{libxc => libs/ctrl}/xc_memshr.c (100%) rename tools/{libxc => libs/ctrl}/xc_minios.c (100%) rename tools/{libxc => libs/ctrl}/xc_misc.c (100%) rename tools/{libxc => libs/ctrl}/xc_monitor.c (100%) rename tools/{libxc => libs/ctrl}/xc_msr_x86.h (100%) rename tools/{libxc => libs/ctrl}/xc_netbsd.c (100%) rename tools/{libxc => libs/ctrl}/xc_pagetab.c (100%) rename tools/{libxc => libs/ctrl}/xc_physdev.c (100%) rename tools/{libxc => libs/ctrl}/xc_pm.c (100%) rename tools/{libxc => libs/ctrl}/xc_private.c (100%) rename tools/{libxc => libs/ctrl}/xc_private.h (100%) rename tools/{libxc => libs/ctrl}/xc_psr.c (100%) rename tools/{libxc => libs/ctrl}/xc_resource.c (100%) rename tools/{libxc => libs/ctrl}/xc_resume.c (100%) rename tools/{libxc => libs/ctrl}/xc_rt.c (100%) rename tools/{libxc => libs/ctrl}/xc_solaris.c (100%) rename tools/{libxc => libs/ctrl}/xc_tbuf.c (100%) rename tools/{libxc => libs/ctrl}/xc_vm_event.c (100%) rename tools/{libxc => libs/ctrl}/xencontrol.pc.in (100%) diff --git a/.gitignore b/.gitignore index 5ea48af818..a17d7e1e1b 100644 --- a/.gitignore +++ b/.gitignore @@ -114,6 +114,9 @@ tools/libs/hypfs/headers.chk tools/libs/hypfs/xenhypfs.pc tools/libs/call/headers.chk tools/libs/call/xencall.pc +tools/libs/ctrl/_*.[ch] +tools/libs/ctrl/libxenctrl.map +tools/libs/ctrl/xencontrol.pc tools/libs/foreignmemory/headers.chk tools/libs/foreignmemory/xenforeignmemory.pc tools/libs/devicemodel/headers.chk @@ -195,6 +198,11 @@ tools/include/xen-foreign/*.(c|h|size) tools/include/xen-foreign/checker tools/libvchan/xenvchan.pc tools/libxc/*.pc +tools/libxc/xc_bitops.h +tools/libxc/xc_core.h +tools/libxc/xc_core_arm.h +tools/libxc/xc_core_x86.h +tools/libxc/xc_private.h tools/libxl/_libxl.api-for-check tools/libxl/*.api-ok tools/libxl/*.pc diff --git a/MAINTAINERS b/MAINTAINERS index 33fe51324e..91ca2c9c40 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -226,7 +226,7 @@ M: Stewart Hildebrand S: Supported L: xen-devel@dornerworks.com F: xen/common/sched/arinc653.c -F: tools/libxc/xc_arinc653.c +F: tools/libs/ctrl/xc_arinc653.c ARM (W/ VIRTUALISATION EXTENSIONS) ARCHITECTURE M: Stefano Stabellini diff --git a/stubdom/Makefile b/stubdom/Makefile index 4fd86dd44b..193941827d 100644 --- a/stubdom/Makefile +++ b/stubdom/Makefile @@ -331,7 +331,7 @@ endif # libraries under tools/libs ####### -STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel +STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel ctrl ####### # common handling @@ -397,12 +397,11 @@ $(TARGETS_MINIOS): mini-os-%: ####### .PHONY: libxc -libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a -libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn libxengnttab libxencall libxenforeignmemory libxendevicemodel cross-zlib +libxc: libxc-$(XEN_TARGET_ARCH)/libxenguest.a +libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxenevtchn libxenctrl cross-zlib +libxc-$(XEN_TARGET_ARCH)/libxenguest.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH) - libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a - ####### # ioemu ####### diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile index 26dff45a8f..d33fa2f71e 100644 --- a/stubdom/grub/Makefile +++ b/stubdom/grub/Makefile @@ -6,7 +6,9 @@ vpath %.c ../grub-upstream BOOT=$(OBJ_DIR)/boot-$(XEN_TARGET_ARCH).o DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/toollog/include -DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc/include -I$(XEN_ROOT)/tools/include -I. +DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/ctrl/include +DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc/include +DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/include -I. DEF_CPPFLAGS += -I../grub-upstream/stage1 DEF_CPPFLAGS += -I../grub-upstream/stage2 DEF_CPPFLAGS += -I../grub-upstream/netboot diff --git a/stubdom/mini-os.mk b/stubdom/mini-os.mk index 32528bb91f..b1387df3f8 100644 --- a/stubdom/mini-os.mk +++ b/stubdom/mini-os.mk @@ -13,5 +13,5 @@ GNTTAB_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/gnttab CALL_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/call FOREIGNMEMORY_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/foreignmemory DEVICEMODEL_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/devicemodel -CTRL_PATH = $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) +CTRL_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/ctrl GUEST_PATH = $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) diff --git a/tools/Rules.mk b/tools/Rules.mk index 191fe8e080..6ec480388c 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -15,7 +15,6 @@ XEN_INCLUDE = $(XEN_ROOT)/tools/include include $(XEN_ROOT)/tools/libs/uselibs.mk -XEN_libxenctrl = $(XEN_ROOT)/tools/libxc XEN_libxenguest = $(XEN_ROOT)/tools/libxc XEN_libxenlight = $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight @@ -105,13 +104,10 @@ $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_defs,$(lib)))) # code which compiles against libxenctrl get __XEN_TOOLS__ and # therefore sees the unstable hypercall interfaces. -CFLAGS_libxenctrl = -I$(XEN_libxenctrl)/include $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxencall) $(SHLIB_libxenforeignmemory) $(SHLIB_libxendevicemodel) -LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_libxenctrl)/libxenctrl$(libextension) -SHLIB_libxenctrl = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_libxenctrl) +CFLAGS_libxenctrl += $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) -D__XEN_TOOLS__ CFLAGS_libxenguest = -I$(XEN_libxenguest)/include $(CFLAGS_libxenevtchn) $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude) -SHDEPS_libxenguest = $(SHLIB_libxenevtchn) +SHDEPS_libxenguest = $(SHLIB_libxenevtchn) $(SHLIB_libxenctrl) LDLIBS_libxenguest = $(SHDEPS_libxenguest) $(XEN_libxenguest)/libxenguest$(libextension) SHLIB_libxenguest = $(SHDEPS_libxenguest) -Wl,-rpath-link=$(XEN_libxenguest) diff --git a/tools/libs/Makefile b/tools/libs/Makefile index 69cdfb5975..7648ea0e4c 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -9,6 +9,7 @@ SUBDIRS-y += gnttab SUBDIRS-y += call SUBDIRS-y += foreignmemory SUBDIRS-y += devicemodel +SUBDIRS-y += ctrl SUBDIRS-y += hypfs ifeq ($(CONFIG_RUMP),y) diff --git a/tools/libs/ctrl/Makefile b/tools/libs/ctrl/Makefile new file mode 100644 index 0000000000..f15b5b8435 --- /dev/null +++ b/tools/libs/ctrl/Makefile @@ -0,0 +1,71 @@ +XEN_ROOT = $(CURDIR)/../../.. +include $(XEN_ROOT)/tools/Rules.mk + +SRCS-y += xc_altp2m.c +SRCS-y += xc_core.c +SRCS-$(CONFIG_X86) += xc_core_x86.c +SRCS-$(CONFIG_ARM) += xc_core_arm.c +SRCS-y += xc_cpupool.c +SRCS-y += xc_domain.c +SRCS-y += xc_evtchn.c +SRCS-y += xc_gnttab.c +SRCS-y += xc_misc.c +SRCS-y += xc_flask.c +SRCS-y += xc_physdev.c +SRCS-y += xc_private.c +SRCS-y += xc_csched.c +SRCS-y += xc_csched2.c +SRCS-y += xc_arinc653.c +SRCS-y += xc_rt.c +SRCS-y += xc_tbuf.c +SRCS-y += xc_pm.c +SRCS-y += xc_cpu_hotplug.c +SRCS-y += xc_resume.c +SRCS-y += xc_vm_event.c +SRCS-y += xc_monitor.c +SRCS-y += xc_mem_paging.c +SRCS-y += xc_mem_access.c +SRCS-y += xc_memshr.c +SRCS-y += xc_hcall_buf.c +SRCS-y += xc_foreign_memory.c +SRCS-y += xc_kexec.c +SRCS-y += xc_resource.c +SRCS-$(CONFIG_X86) += xc_psr.c +SRCS-$(CONFIG_X86) += xc_pagetab.c +SRCS-$(CONFIG_Linux) += xc_linux.c +SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c +SRCS-$(CONFIG_SunOS) += xc_solaris.c +SRCS-$(CONFIG_NetBSD) += xc_netbsd.c +SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c +SRCS-$(CONFIG_MiniOS) += xc_minios.c +SRCS-y += xc_evtchn_compat.c +SRCS-y += xc_gnttab_compat.c +SRCS-y += xc_devicemodel_compat.c + +CFLAGS += -D__XEN_TOOLS__ +CFLAGS += $(PTHREAD_CFLAGS) +CFLAGS += -include $(XEN_ROOT)/tools/config.h + +# Needed for posix_fadvise64() in xc_linux.c +CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE + +LIBHEADER := xenctrl.h xenctrl_compat.h xenctrl_dom.h +PKG_CONFIG := xencontrol.pc + +NO_HEADERS_CHK := y + +include $(XEN_ROOT)/tools/libs/libs.mk + +genpath-target = $(call buildmakevars2header,_paths.h) +$(eval $(genpath-target)) + +$(LIB_OBJS) $(PIC_OBJS): _paths.h + +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenctrl)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) + +clean: cleanlocal + +.PHONY: cleanlocal +cleanlocal: + rm -f libxenctrl.map diff --git a/tools/libxc/include/xenctrl.h b/tools/libs/ctrl/include/xenctrl.h similarity index 100% rename from tools/libxc/include/xenctrl.h rename to tools/libs/ctrl/include/xenctrl.h diff --git a/tools/libxc/include/xenctrl_compat.h b/tools/libs/ctrl/include/xenctrl_compat.h similarity index 100% rename from tools/libxc/include/xenctrl_compat.h rename to tools/libs/ctrl/include/xenctrl_compat.h diff --git a/tools/libxc/include/xenctrl_dom.h b/tools/libs/ctrl/include/xenctrl_dom.h similarity index 100% rename from tools/libxc/include/xenctrl_dom.h rename to tools/libs/ctrl/include/xenctrl_dom.h diff --git a/tools/libxc/xc_altp2m.c b/tools/libs/ctrl/xc_altp2m.c similarity index 100% rename from tools/libxc/xc_altp2m.c rename to tools/libs/ctrl/xc_altp2m.c diff --git a/tools/libxc/xc_arinc653.c b/tools/libs/ctrl/xc_arinc653.c similarity index 100% rename from tools/libxc/xc_arinc653.c rename to tools/libs/ctrl/xc_arinc653.c diff --git a/tools/libxc/xc_bitops.h b/tools/libs/ctrl/xc_bitops.h similarity index 100% rename from tools/libxc/xc_bitops.h rename to tools/libs/ctrl/xc_bitops.h diff --git a/tools/libxc/xc_core.c b/tools/libs/ctrl/xc_core.c similarity index 100% rename from tools/libxc/xc_core.c rename to tools/libs/ctrl/xc_core.c diff --git a/tools/libxc/xc_core.h b/tools/libs/ctrl/xc_core.h similarity index 100% rename from tools/libxc/xc_core.h rename to tools/libs/ctrl/xc_core.h diff --git a/tools/libxc/xc_core_arm.c b/tools/libs/ctrl/xc_core_arm.c similarity index 100% rename from tools/libxc/xc_core_arm.c rename to tools/libs/ctrl/xc_core_arm.c diff --git a/tools/libxc/xc_core_arm.h b/tools/libs/ctrl/xc_core_arm.h similarity index 100% rename from tools/libxc/xc_core_arm.h rename to tools/libs/ctrl/xc_core_arm.h diff --git a/tools/libxc/xc_core_x86.c b/tools/libs/ctrl/xc_core_x86.c similarity index 100% rename from tools/libxc/xc_core_x86.c rename to tools/libs/ctrl/xc_core_x86.c diff --git a/tools/libxc/xc_core_x86.h b/tools/libs/ctrl/xc_core_x86.h similarity index 100% rename from tools/libxc/xc_core_x86.h rename to tools/libs/ctrl/xc_core_x86.h diff --git a/tools/libxc/xc_cpu_hotplug.c b/tools/libs/ctrl/xc_cpu_hotplug.c similarity index 100% rename from tools/libxc/xc_cpu_hotplug.c rename to tools/libs/ctrl/xc_cpu_hotplug.c diff --git a/tools/libxc/xc_cpupool.c b/tools/libs/ctrl/xc_cpupool.c similarity index 100% rename from tools/libxc/xc_cpupool.c rename to tools/libs/ctrl/xc_cpupool.c diff --git a/tools/libxc/xc_csched.c b/tools/libs/ctrl/xc_csched.c similarity index 100% rename from tools/libxc/xc_csched.c rename to tools/libs/ctrl/xc_csched.c diff --git a/tools/libxc/xc_csched2.c b/tools/libs/ctrl/xc_csched2.c similarity index 100% rename from tools/libxc/xc_csched2.c rename to tools/libs/ctrl/xc_csched2.c diff --git a/tools/libxc/xc_devicemodel_compat.c b/tools/libs/ctrl/xc_devicemodel_compat.c similarity index 100% rename from tools/libxc/xc_devicemodel_compat.c rename to tools/libs/ctrl/xc_devicemodel_compat.c diff --git a/tools/libxc/xc_domain.c b/tools/libs/ctrl/xc_domain.c similarity index 100% rename from tools/libxc/xc_domain.c rename to tools/libs/ctrl/xc_domain.c diff --git a/tools/libxc/xc_evtchn.c b/tools/libs/ctrl/xc_evtchn.c similarity index 100% rename from tools/libxc/xc_evtchn.c rename to tools/libs/ctrl/xc_evtchn.c diff --git a/tools/libxc/xc_evtchn_compat.c b/tools/libs/ctrl/xc_evtchn_compat.c similarity index 100% rename from tools/libxc/xc_evtchn_compat.c rename to tools/libs/ctrl/xc_evtchn_compat.c diff --git a/tools/libxc/xc_flask.c b/tools/libs/ctrl/xc_flask.c similarity index 100% rename from tools/libxc/xc_flask.c rename to tools/libs/ctrl/xc_flask.c diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libs/ctrl/xc_foreign_memory.c similarity index 100% rename from tools/libxc/xc_foreign_memory.c rename to tools/libs/ctrl/xc_foreign_memory.c diff --git a/tools/libxc/xc_freebsd.c b/tools/libs/ctrl/xc_freebsd.c similarity index 100% rename from tools/libxc/xc_freebsd.c rename to tools/libs/ctrl/xc_freebsd.c diff --git a/tools/libxc/xc_gnttab.c b/tools/libs/ctrl/xc_gnttab.c similarity index 100% rename from tools/libxc/xc_gnttab.c rename to tools/libs/ctrl/xc_gnttab.c diff --git a/tools/libxc/xc_gnttab_compat.c b/tools/libs/ctrl/xc_gnttab_compat.c similarity index 100% rename from tools/libxc/xc_gnttab_compat.c rename to tools/libs/ctrl/xc_gnttab_compat.c diff --git a/tools/libxc/xc_hcall_buf.c b/tools/libs/ctrl/xc_hcall_buf.c similarity index 100% rename from tools/libxc/xc_hcall_buf.c rename to tools/libs/ctrl/xc_hcall_buf.c diff --git a/tools/libxc/xc_kexec.c b/tools/libs/ctrl/xc_kexec.c similarity index 100% rename from tools/libxc/xc_kexec.c rename to tools/libs/ctrl/xc_kexec.c diff --git a/tools/libxc/xc_linux.c b/tools/libs/ctrl/xc_linux.c similarity index 100% rename from tools/libxc/xc_linux.c rename to tools/libs/ctrl/xc_linux.c diff --git a/tools/libxc/xc_mem_access.c b/tools/libs/ctrl/xc_mem_access.c similarity index 100% rename from tools/libxc/xc_mem_access.c rename to tools/libs/ctrl/xc_mem_access.c diff --git a/tools/libxc/xc_mem_paging.c b/tools/libs/ctrl/xc_mem_paging.c similarity index 100% rename from tools/libxc/xc_mem_paging.c rename to tools/libs/ctrl/xc_mem_paging.c diff --git a/tools/libxc/xc_memshr.c b/tools/libs/ctrl/xc_memshr.c similarity index 100% rename from tools/libxc/xc_memshr.c rename to tools/libs/ctrl/xc_memshr.c diff --git a/tools/libxc/xc_minios.c b/tools/libs/ctrl/xc_minios.c similarity index 100% rename from tools/libxc/xc_minios.c rename to tools/libs/ctrl/xc_minios.c diff --git a/tools/libxc/xc_misc.c b/tools/libs/ctrl/xc_misc.c similarity index 100% rename from tools/libxc/xc_misc.c rename to tools/libs/ctrl/xc_misc.c diff --git a/tools/libxc/xc_monitor.c b/tools/libs/ctrl/xc_monitor.c similarity index 100% rename from tools/libxc/xc_monitor.c rename to tools/libs/ctrl/xc_monitor.c diff --git a/tools/libxc/xc_msr_x86.h b/tools/libs/ctrl/xc_msr_x86.h similarity index 100% rename from tools/libxc/xc_msr_x86.h rename to tools/libs/ctrl/xc_msr_x86.h diff --git a/tools/libxc/xc_netbsd.c b/tools/libs/ctrl/xc_netbsd.c similarity index 100% rename from tools/libxc/xc_netbsd.c rename to tools/libs/ctrl/xc_netbsd.c diff --git a/tools/libxc/xc_pagetab.c b/tools/libs/ctrl/xc_pagetab.c similarity index 100% rename from tools/libxc/xc_pagetab.c rename to tools/libs/ctrl/xc_pagetab.c diff --git a/tools/libxc/xc_physdev.c b/tools/libs/ctrl/xc_physdev.c similarity index 100% rename from tools/libxc/xc_physdev.c rename to tools/libs/ctrl/xc_physdev.c diff --git a/tools/libxc/xc_pm.c b/tools/libs/ctrl/xc_pm.c similarity index 100% rename from tools/libxc/xc_pm.c rename to tools/libs/ctrl/xc_pm.c diff --git a/tools/libxc/xc_private.c b/tools/libs/ctrl/xc_private.c similarity index 100% rename from tools/libxc/xc_private.c rename to tools/libs/ctrl/xc_private.c diff --git a/tools/libxc/xc_private.h b/tools/libs/ctrl/xc_private.h similarity index 100% rename from tools/libxc/xc_private.h rename to tools/libs/ctrl/xc_private.h diff --git a/tools/libxc/xc_psr.c b/tools/libs/ctrl/xc_psr.c similarity index 100% rename from tools/libxc/xc_psr.c rename to tools/libs/ctrl/xc_psr.c diff --git a/tools/libxc/xc_resource.c b/tools/libs/ctrl/xc_resource.c similarity index 100% rename from tools/libxc/xc_resource.c rename to tools/libs/ctrl/xc_resource.c diff --git a/tools/libxc/xc_resume.c b/tools/libs/ctrl/xc_resume.c similarity index 100% rename from tools/libxc/xc_resume.c rename to tools/libs/ctrl/xc_resume.c diff --git a/tools/libxc/xc_rt.c b/tools/libs/ctrl/xc_rt.c similarity index 100% rename from tools/libxc/xc_rt.c rename to tools/libs/ctrl/xc_rt.c diff --git a/tools/libxc/xc_solaris.c b/tools/libs/ctrl/xc_solaris.c similarity index 100% rename from tools/libxc/xc_solaris.c rename to tools/libs/ctrl/xc_solaris.c diff --git a/tools/libxc/xc_tbuf.c b/tools/libs/ctrl/xc_tbuf.c similarity index 100% rename from tools/libxc/xc_tbuf.c rename to tools/libs/ctrl/xc_tbuf.c diff --git a/tools/libxc/xc_vm_event.c b/tools/libs/ctrl/xc_vm_event.c similarity index 100% rename from tools/libxc/xc_vm_event.c rename to tools/libs/ctrl/xc_vm_event.c diff --git a/tools/libxc/xencontrol.pc.in b/tools/libs/ctrl/xencontrol.pc.in similarity index 100% rename from tools/libxc/xencontrol.pc.in rename to tools/libs/ctrl/xencontrol.pc.in diff --git a/tools/libs/uselibs.mk b/tools/libs/uselibs.mk index db73fe314e..8e45e8d917 100644 --- a/tools/libs/uselibs.mk +++ b/tools/libs/uselibs.mk @@ -16,3 +16,5 @@ LIBS_LIBS += devicemodel USELIBS_devicemodel := toollog toolcore call LIBS_LIBS += hypfs USELIBS_hypfs := toollog toolcore call +LIBS_LIBS += ctrl +USELIBS_ctrl := toollog call evtchn gnttab foreignmemory devicemodel diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index 1e4065f87c..a52264c74c 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -9,47 +9,10 @@ ifeq ($(CONFIG_LIBXC_MINIOS),y) override CONFIG_MIGRATE := n endif -CTRL_SRCS-y := -CTRL_SRCS-y += xc_altp2m.c -CTRL_SRCS-y += xc_core.c -CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c -CTRL_SRCS-$(CONFIG_ARM) += xc_core_arm.c -CTRL_SRCS-y += xc_cpupool.c -CTRL_SRCS-y += xc_domain.c -CTRL_SRCS-y += xc_evtchn.c -CTRL_SRCS-y += xc_gnttab.c -CTRL_SRCS-y += xc_misc.c -CTRL_SRCS-y += xc_flask.c -CTRL_SRCS-y += xc_physdev.c -CTRL_SRCS-y += xc_private.c -CTRL_SRCS-y += xc_csched.c -CTRL_SRCS-y += xc_csched2.c -CTRL_SRCS-y += xc_arinc653.c -CTRL_SRCS-y += xc_rt.c -CTRL_SRCS-y += xc_tbuf.c -CTRL_SRCS-y += xc_pm.c -CTRL_SRCS-y += xc_cpu_hotplug.c -CTRL_SRCS-y += xc_resume.c -CTRL_SRCS-y += xc_vm_event.c -CTRL_SRCS-y += xc_monitor.c -CTRL_SRCS-y += xc_mem_paging.c -CTRL_SRCS-y += xc_mem_access.c -CTRL_SRCS-y += xc_memshr.c -CTRL_SRCS-y += xc_hcall_buf.c -CTRL_SRCS-y += xc_foreign_memory.c -CTRL_SRCS-y += xc_kexec.c -CTRL_SRCS-y += xc_resource.c -CTRL_SRCS-$(CONFIG_X86) += xc_psr.c -CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c -CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c -CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c -CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c -CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c -CTRL_SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c -CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c -CTRL_SRCS-y += xc_evtchn_compat.c -CTRL_SRCS-y += xc_gnttab_compat.c -CTRL_SRCS-y += xc_devicemodel_compat.c +LINK_FILES := xc_private.h xc_core.h xc_core_x86.h xc_core_arm.h xc_bitops.h + +$(LINK_FILES): + ln -sf $(XEN_ROOT)/tools/libs/ctrl/$(notdir $@) $@ GUEST_SRCS-y := GUEST_SRCS-y += xg_private.c @@ -124,26 +87,14 @@ CFLAGS += $(CFLAGS_libxentoollog) CFLAGS += $(CFLAGS_libxenevtchn) CFLAGS += $(CFLAGS_libxendevicemodel) -CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y)) -CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y)) - GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y)) GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y)) -$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \ -$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h +$(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxenguest includes xc_private.h, so needs this despite not using # this functionality directly. -$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \ -$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += $(CFLAGS_libxencall) $(CFLAGS_libxenforeignmemory) - -$(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS): CFLAGS += $(CFLAGS_libxengnttab) - -LIB := libxenctrl.a -ifneq ($(nosharedlibs),y) -LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR) -endif +$(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS): CFLAGS += $(CFLAGS_libxencall) $(CFLAGS_libxenforeignmemory) LIB += libxenguest.a ifneq ($(nosharedlibs),y) @@ -155,10 +106,9 @@ $(eval $(genpath-target)) xc_private.h: _paths.h -$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \ -$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): xc_private.h +$(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS): $(LINK_FILES) -PKG_CONFIG := xencontrol.pc xenguest.pc +PKG_CONFIG := xenguest.pc PKG_CONFIG_VERSION := $(MAJOR).$(MINOR) ifneq ($(CONFIG_LIBXC_MINIOS),y) @@ -189,17 +139,11 @@ libs: $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) install: build $(INSTALL_DIR) $(DESTDIR)$(libdir) $(INSTALL_DIR) $(DESTDIR)$(includedir) - $(INSTALL_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir) - $(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) include/xenctrl.h include/xenctrl_compat.h include/xenctrl_dom.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) include/xenguest.h $(DESTDIR)$(includedir) - $(INSTALL_DATA) xencontrol.pc $(DESTDIR)$(PKG_INSTALLDIR) $(INSTALL_DATA) xenguest.pc $(DESTDIR)$(PKG_INSTALLDIR) .PHONY: uninstall @@ -210,14 +154,6 @@ uninstall: rm -f $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR) rm -f $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR).$(MINOR) rm -f $(DESTDIR)$(libdir)/libxenguest.a - rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xencontrol.pc - rm -f $(DESTDIR)$(includedir)/xenctrl.h - rm -f $(DESTDIR)$(includedir)/xenctrl_compat.h - rm -f $(DESTDIR)$(includedir)/xenctrl_dom.h - rm -f $(DESTDIR)$(libdir)/libxenctrl.so - rm -f $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR) - rm -f $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR).$(MINOR) - rm -f $(DESTDIR)$(libdir)/libxenctrl.a .PHONY: TAGS TAGS: @@ -227,8 +163,8 @@ TAGS: clean: rm -rf *.rpm $(LIB) *~ $(DEPS_RM) \ _paths.h \ - xencontrol.pc xenguest.pc \ - $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \ + $(LINK_FILES) \ + xenguest.pc \ $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS) .PHONY: distclean @@ -244,19 +180,6 @@ rpm: build mv staging/i386/*.rpm . rm -rf staging -# libxenctrl - -libxenctrl.a: $(CTRL_LIB_OBJS) - $(AR) rc $@ $^ - -libxenctrl.so: libxenctrl.so.$(MAJOR) - $(SYMLINK_SHLIB) $< $@ -libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR) - $(SYMLINK_SHLIB) $< $@ - -libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS) - $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxencall) $(LDLIBS_libxenforeignmemory) $(LDLIBS_libxendevicemodel) $(PTHREAD_LIBS) $(APPEND_LDFLAGS) - # libxenguest libxenguest.a: $(GUEST_LIB_OBJS) @@ -277,7 +200,7 @@ xc_dom_bzimageloader.o: CFLAGS += $(filter -D%,$(zlib-options)) xc_dom_bzimageloader.opic: CFLAGS += $(filter -D%,$(zlib-options)) libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(filter -l%,$(zlib-options)) -libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so +libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS) -include $(DEPS_INCLUDE) diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile index 692a62584e..89ec3ec76a 100644 --- a/tools/ocaml/xenstored/Makefile +++ b/tools/ocaml/xenstored/Makefile @@ -69,7 +69,7 @@ XENSTOREDLIBS = \ -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/eventchn $(OCAML_TOPLEVEL)/libs/eventchn/xeneventchn.cmxa \ -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xc $(OCAML_TOPLEVEL)/libs/xc/xenctrl.cmxa \ -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xb $(OCAML_TOPLEVEL)/libs/xb/xenbus.cmxa \ - -ccopt -L -ccopt $(XEN_ROOT)/tools/libxc + -ccopt -L -ccopt $(XEN_ROOT)/tools/libs/ctrl PROGRAMS = oxenstored diff --git a/tools/python/Makefile b/tools/python/Makefile index 8d22c03676..8dc755d6e8 100644 --- a/tools/python/Makefile +++ b/tools/python/Makefile @@ -33,7 +33,7 @@ uninstall: .PHONY: test test: - LD_LIBRARY_PATH=$$(readlink -f ../libxc):$$(readlink -f ../xenstore) $(PYTHON) -m unittest discover + LD_LIBRARY_PATH=$$(readlink -f ../libs/ctrl):$$(readlink -f ../xenstore) $(PYTHON) -m unittest discover .PHONY: clean clean: diff --git a/tools/python/setup.py b/tools/python/setup.py index 44696b3998..24b284af39 100644 --- a/tools/python/setup.py +++ b/tools/python/setup.py @@ -9,7 +9,7 @@ extra_compile_args = [ "-fno-strict-aliasing", "-Werror" ] PATH_XEN = XEN_ROOT + "/tools/include" PATH_LIBXENTOOLLOG = XEN_ROOT + "/tools/libs/toollog" PATH_LIBXENEVTCHN = XEN_ROOT + "/tools/libs/evtchn" -PATH_LIBXC = XEN_ROOT + "/tools/libxc" +PATH_LIBXENCTRL = XEN_ROOT + "/tools/libs/ctrl" PATH_LIBXL = XEN_ROOT + "/tools/libxl" PATH_XENSTORE = XEN_ROOT + "/tools/xenstore" @@ -18,11 +18,11 @@ xc = Extension("xc", include_dirs = [ PATH_XEN, PATH_LIBXENTOOLLOG + "/include", PATH_LIBXENEVTCHN + "/include", - PATH_LIBXC + "/include", + PATH_LIBXENCTRL + "/include", "xen/lowlevel/xc" ], - library_dirs = [ PATH_LIBXC ], + library_dirs = [ PATH_LIBXENCTRL ], libraries = [ "xenctrl" ], - depends = [ PATH_LIBXC + "/libxenctrl.so" ], + depends = [ PATH_LIBXENCTRL + "/libxenctrl.so" ], extra_link_args = [ "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ], sources = [ "xen/lowlevel/xc/xc.c" ]) From patchwork Sun Aug 23 09:35:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731521 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B3EE913 for ; Sun, 23 Aug 2020 09:48:29 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 56DAB2074D for ; Sun, 23 Aug 2020 09:48:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56DAB2074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maR-0008MT-PZ; Sun, 23 Aug 2020 09:46:51 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQj-0004sy-HM for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:49 +0000 X-Inumbo-ID: 821841dd-1d7b-4e4e-a433-8a5b6bbdf2ed Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 821841dd-1d7b-4e4e-a433-8a5b6bbdf2ed; Sun, 23 Aug 2020 09:35:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 890B2AD3C; Sun, 23 Aug 2020 09:35:56 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Samuel Thibault Subject: [PATCH v3 27/38] tools/libxc: move libxenguest to tools/libs/guest Date: Sun, 23 Aug 2020 11:35:08 +0200 Message-Id: <20200823093519.18386-28-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" tools/libxc now contains libxenguest only. Move it to tools/libs/guest. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault Acked-by: Wei Liu --- .gitignore | 16 +- stubdom/Makefile | 34 +-- stubdom/grub/Makefile | 2 +- stubdom/mini-os.mk | 2 +- tools/Makefile | 3 +- tools/Rules.mk | 7 +- tools/libs/Makefile | 1 + tools/{libxc => libs/guest}/COPYING | 0 tools/libs/guest/Makefile | 121 ++++++++++ .../{libxc => libs/guest}/include/xenguest.h | 0 tools/{libxc => libs/guest}/xenguest.pc.in | 0 tools/{libxc => libs/guest}/xg_cpuid_x86.c | 0 tools/{libxc => libs/guest}/xg_dom_arm.c | 0 .../guest}/xg_dom_armzimageloader.c | 0 .../{libxc => libs/guest}/xg_dom_binloader.c | 0 tools/{libxc => libs/guest}/xg_dom_boot.c | 0 .../guest}/xg_dom_bzimageloader.c | 0 .../guest}/xg_dom_compat_linux.c | 0 tools/{libxc => libs/guest}/xg_dom_core.c | 0 .../{libxc => libs/guest}/xg_dom_decompress.h | 0 .../guest}/xg_dom_decompress_lz4.c | 0 .../guest}/xg_dom_decompress_unsafe.c | 0 .../guest}/xg_dom_decompress_unsafe.h | 0 .../guest}/xg_dom_decompress_unsafe_bzip2.c | 0 .../guest}/xg_dom_decompress_unsafe_lzma.c | 0 .../guest}/xg_dom_decompress_unsafe_lzo1x.c | 0 .../guest}/xg_dom_decompress_unsafe_xz.c | 0 .../{libxc => libs/guest}/xg_dom_elfloader.c | 0 .../{libxc => libs/guest}/xg_dom_hvmloader.c | 0 tools/{libxc => libs/guest}/xg_dom_x86.c | 0 tools/{libxc => libs/guest}/xg_domain.c | 0 tools/{libxc => libs/guest}/xg_nomigrate.c | 0 tools/{libxc => libs/guest}/xg_offline_page.c | 0 tools/{libxc => libs/guest}/xg_private.c | 0 tools/{libxc => libs/guest}/xg_private.h | 0 tools/{libxc => libs/guest}/xg_save_restore.h | 0 tools/{libxc => libs/guest}/xg_sr_common.c | 0 tools/{libxc => libs/guest}/xg_sr_common.h | 0 .../{libxc => libs/guest}/xg_sr_common_x86.c | 0 .../{libxc => libs/guest}/xg_sr_common_x86.h | 0 .../guest}/xg_sr_common_x86_pv.c | 0 .../guest}/xg_sr_common_x86_pv.h | 0 tools/{libxc => libs/guest}/xg_sr_restore.c | 0 .../guest}/xg_sr_restore_x86_hvm.c | 0 .../guest}/xg_sr_restore_x86_pv.c | 0 tools/{libxc => libs/guest}/xg_sr_save.c | 0 .../guest}/xg_sr_save_x86_hvm.c | 0 .../{libxc => libs/guest}/xg_sr_save_x86_pv.c | 0 .../guest}/xg_sr_stream_format.h | 0 tools/{libxc => libs/guest}/xg_suspend.c | 0 tools/libs/uselibs.mk | 2 + tools/libxc/Makefile | 207 ------------------ 52 files changed, 147 insertions(+), 248 deletions(-) rename tools/{libxc => libs/guest}/COPYING (100%) create mode 100644 tools/libs/guest/Makefile rename tools/{libxc => libs/guest}/include/xenguest.h (100%) rename tools/{libxc => libs/guest}/xenguest.pc.in (100%) rename tools/{libxc => libs/guest}/xg_cpuid_x86.c (100%) rename tools/{libxc => libs/guest}/xg_dom_arm.c (100%) rename tools/{libxc => libs/guest}/xg_dom_armzimageloader.c (100%) rename tools/{libxc => libs/guest}/xg_dom_binloader.c (100%) rename tools/{libxc => libs/guest}/xg_dom_boot.c (100%) rename tools/{libxc => libs/guest}/xg_dom_bzimageloader.c (100%) rename tools/{libxc => libs/guest}/xg_dom_compat_linux.c (100%) rename tools/{libxc => libs/guest}/xg_dom_core.c (100%) rename tools/{libxc => libs/guest}/xg_dom_decompress.h (100%) rename tools/{libxc => libs/guest}/xg_dom_decompress_lz4.c (100%) rename tools/{libxc => libs/guest}/xg_dom_decompress_unsafe.c (100%) rename tools/{libxc => libs/guest}/xg_dom_decompress_unsafe.h (100%) rename tools/{libxc => libs/guest}/xg_dom_decompress_unsafe_bzip2.c (100%) rename tools/{libxc => libs/guest}/xg_dom_decompress_unsafe_lzma.c (100%) rename tools/{libxc => libs/guest}/xg_dom_decompress_unsafe_lzo1x.c (100%) rename tools/{libxc => libs/guest}/xg_dom_decompress_unsafe_xz.c (100%) rename tools/{libxc => libs/guest}/xg_dom_elfloader.c (100%) rename tools/{libxc => libs/guest}/xg_dom_hvmloader.c (100%) rename tools/{libxc => libs/guest}/xg_dom_x86.c (100%) rename tools/{libxc => libs/guest}/xg_domain.c (100%) rename tools/{libxc => libs/guest}/xg_nomigrate.c (100%) rename tools/{libxc => libs/guest}/xg_offline_page.c (100%) rename tools/{libxc => libs/guest}/xg_private.c (100%) rename tools/{libxc => libs/guest}/xg_private.h (100%) rename tools/{libxc => libs/guest}/xg_save_restore.h (100%) rename tools/{libxc => libs/guest}/xg_sr_common.c (100%) rename tools/{libxc => libs/guest}/xg_sr_common.h (100%) rename tools/{libxc => libs/guest}/xg_sr_common_x86.c (100%) rename tools/{libxc => libs/guest}/xg_sr_common_x86.h (100%) rename tools/{libxc => libs/guest}/xg_sr_common_x86_pv.c (100%) rename tools/{libxc => libs/guest}/xg_sr_common_x86_pv.h (100%) rename tools/{libxc => libs/guest}/xg_sr_restore.c (100%) rename tools/{libxc => libs/guest}/xg_sr_restore_x86_hvm.c (100%) rename tools/{libxc => libs/guest}/xg_sr_restore_x86_pv.c (100%) rename tools/{libxc => libs/guest}/xg_sr_save.c (100%) rename tools/{libxc => libs/guest}/xg_sr_save_x86_hvm.c (100%) rename tools/{libxc => libs/guest}/xg_sr_save_x86_pv.c (100%) rename tools/{libxc => libs/guest}/xg_sr_stream_format.h (100%) rename tools/{libxc => libs/guest}/xg_suspend.c (100%) delete mode 100644 tools/libxc/Makefile diff --git a/.gitignore b/.gitignore index a17d7e1e1b..c84a5fd4db 100644 --- a/.gitignore +++ b/.gitignore @@ -71,7 +71,6 @@ stubdom/include stubdom/ioemu stubdom/ioemu/ stubdom/libs-* -stubdom/libxc-* stubdom/libxencall-* stubdom/libxenevtchn-* stubdom/libxenforeignmemory-* @@ -121,6 +120,14 @@ tools/libs/foreignmemory/headers.chk tools/libs/foreignmemory/xenforeignmemory.pc tools/libs/devicemodel/headers.chk tools/libs/devicemodel/xendevicemodel.pc +tools/libs/guest/_*.[ch] +tools/libs/guest/libxenguest.map +tools/libs/guest/xenguest.pc +tools/libs/guest/xc_bitops.h +tools/libs/guest/xc_core.h +tools/libs/guest/xc_core_arm.h +tools/libs/guest/xc_core_x86.h +tools/libs/guest/xc_private.h tools/console/xenconsole tools/console/xenconsoled tools/console/client/_paths.h @@ -197,12 +204,6 @@ tools/include/xen-xsm/* tools/include/xen-foreign/*.(c|h|size) tools/include/xen-foreign/checker tools/libvchan/xenvchan.pc -tools/libxc/*.pc -tools/libxc/xc_bitops.h -tools/libxc/xc_core.h -tools/libxc/xc_core_arm.h -tools/libxc/xc_core_x86.h -tools/libxc/xc_private.h tools/libxl/_libxl.api-for-check tools/libxl/*.api-ok tools/libxl/*.pc @@ -369,7 +370,6 @@ tools/include/xen-foreign/arm64.h tools/misc/xen-hptool tools/misc/xen-mfndump tools/libs/toolcore/include/_*.h -tools/libxc/_*.[ch] tools/libxl/_*.[ch] tools/libxl/testidl tools/libxl/testidl.c diff --git a/stubdom/Makefile b/stubdom/Makefile index 193941827d..f780cc8054 100644 --- a/stubdom/Makefile +++ b/stubdom/Makefile @@ -331,7 +331,9 @@ endif # libraries under tools/libs ####### -STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel ctrl +STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel ctrl guest + +LIBDEP_guest := cross-zlib ####### # common handling @@ -363,13 +365,10 @@ endef $(foreach lib,$(STUB_LIBS),$(eval $(call BUILD_lib,$(lib)))) -libxc-$(XEN_TARGET_ARCH)/stamp: $(XEN_ROOT)/tools/libxc/Makefile - $(do_links) - xenstore/stamp: $(XEN_ROOT)/tools/xenstore/Makefile $(do_links) -LINK_DIRS := libxc-$(XEN_TARGET_ARCH) xenstore $(foreach dir,$(STUB_LIBS),libs-$(XEN_TARGET_ARCH)/$(dir)) +LINK_DIRS := xenstore $(foreach dir,$(STUB_LIBS),libs-$(XEN_TARGET_ARCH)/$(dir)) LINK_STAMPS := $(foreach dir,$(LINK_DIRS),$(dir)/stamp) mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET) $(LINK_STAMPS) @@ -392,16 +391,6 @@ $(TARGETS_MINIOS): mini-os-%: mkdir -p $@/$$i ; \ done -####### -# libxc -####### - -.PHONY: libxc -libxc: libxc-$(XEN_TARGET_ARCH)/libxenguest.a -libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxenevtchn libxenctrl cross-zlib -libxc-$(XEN_TARGET_ARCH)/libxenguest.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) - CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH) - ####### # ioemu ####### @@ -410,7 +399,7 @@ ioemu-minios-config.mk: $(CURDIR)/ioemu-minios.cfg MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config .PHONY: ioemu -ioemu: cross-zlib cross-libpci libxc ioemu-minios-config.mk +ioemu: cross-zlib cross-libpci libxenguest ioemu-minios-config.mk [ -f ioemu/config-host.mak ] || \ ( $(buildmakevars2shellvars); \ cd ioemu ; \ @@ -504,15 +493,15 @@ xenstore: $(CROSS_ROOT) xenstore-minios-config.mk .PHONY: ioemu-stubdom ioemu-stubdom: APP_OBJS=$(CURDIR)/ioemu/i386-stubdom/qemu.a $(CURDIR)/ioemu/i386-stubdom/libqemu.a $(CURDIR)/ioemu/libqemu_common.a -ioemu-stubdom: mini-os-$(XEN_TARGET_ARCH)-ioemu lwip-$(XEN_TARGET_ARCH) libxc ioemu +ioemu-stubdom: mini-os-$(XEN_TARGET_ARCH)-ioemu lwip-$(XEN_TARGET_ARCH) libxenguest ioemu DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/ioemu-minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(APP_OBJS)" .PHONY: caml-stubdom -caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc cross-ocaml caml +caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxenguest cross-ocaml caml DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/caml/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(CURDIR)/caml/main-caml.o $(CURDIR)/caml/caml.o $(CAMLLIB)/libasmrun.a" .PHONY: c-stubdom -c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c +c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxenguest c DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a .PHONY: vtpm-stubdom @@ -524,11 +513,11 @@ vtpmmgr-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm -lpolarssl" .PHONY: pv-grub -pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub +pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxenguest grub DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a .PHONY: xenstore-stubdom -xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore +xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxenguest xenstore DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/xenstore-minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/xenstore/xenstored.a ######### @@ -622,7 +611,6 @@ clean: rm -f $(STUBDOMPATH) rm -f *-minios-config.mk rm -fr pkg-config - [ ! -e libxc-$(XEN_TARGET_ARCH)/Makefile ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean -[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean -[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean @@ -633,7 +621,7 @@ crossclean: clean rm -fr newlib-$(XEN_TARGET_ARCH) rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH) rm -fr libs-$(XEN_TARGET_ARCH) - rm -fr libxc-$(XEN_TARGET_ARCH) ioemu xenstore + rm -fr ioemu xenstore rm -fr gmp-$(XEN_TARGET_ARCH) rm -fr polarssl-$(XEN_TARGET_ARCH) rm -fr openssl-$(XEN_TARGET_ARCH) diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile index d33fa2f71e..7397661c9b 100644 --- a/stubdom/grub/Makefile +++ b/stubdom/grub/Makefile @@ -7,7 +7,7 @@ BOOT=$(OBJ_DIR)/boot-$(XEN_TARGET_ARCH).o DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/toollog/include DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/ctrl/include -DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc/include +DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/guest/include DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/include -I. DEF_CPPFLAGS += -I../grub-upstream/stage1 DEF_CPPFLAGS += -I../grub-upstream/stage2 diff --git a/stubdom/mini-os.mk b/stubdom/mini-os.mk index b1387df3f8..e1640a7cbc 100644 --- a/stubdom/mini-os.mk +++ b/stubdom/mini-os.mk @@ -14,4 +14,4 @@ CALL_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/call FOREIGNMEMORY_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/foreignmemory DEVICEMODEL_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/devicemodel CTRL_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/ctrl -GUEST_PATH = $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) +GUEST_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/guest diff --git a/tools/Makefile b/tools/Makefile index 7c9f9fc900..f9b4012290 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -6,7 +6,6 @@ include $(XEN_ROOT)/tools/Rules.mk SUBDIRS-y := SUBDIRS-y += libs -SUBDIRS-y += libxc SUBDIRS-y += flask SUBDIRS-y += fuzz SUBDIRS-y += xenstore @@ -44,7 +43,7 @@ SUBDIRS-y += pygrub SUBDIRS-$(OCAML_TOOLS) += ocaml ifeq ($(CONFIG_RUMP),y) -SUBDIRS-y := libs libxc xenstore +SUBDIRS-y := libs xenstore endif # For the sake of linking, set the sys-root diff --git a/tools/Rules.mk b/tools/Rules.mk index 6ec480388c..b969dcfccb 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -15,7 +15,6 @@ XEN_INCLUDE = $(XEN_ROOT)/tools/include include $(XEN_ROOT)/tools/libs/uselibs.mk -XEN_libxenguest = $(XEN_ROOT)/tools/libxc XEN_libxenlight = $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight XEN_libxlutil = $(XEN_libxenlight) @@ -105,11 +104,7 @@ $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_defs,$(lib)))) # code which compiles against libxenctrl get __XEN_TOOLS__ and # therefore sees the unstable hypercall interfaces. CFLAGS_libxenctrl += $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) -D__XEN_TOOLS__ - -CFLAGS_libxenguest = -I$(XEN_libxenguest)/include $(CFLAGS_libxenevtchn) $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude) -SHDEPS_libxenguest = $(SHLIB_libxenevtchn) $(SHLIB_libxenctrl) -LDLIBS_libxenguest = $(SHDEPS_libxenguest) $(XEN_libxenguest)/libxenguest$(libextension) -SHLIB_libxenguest = $(SHDEPS_libxenguest) -Wl,-rpath-link=$(XEN_libxenguest) +CFLAGS_libxenguest += $(CFLAGS_libxenevtchn) $(CFLAGS_libxenforeignmemory) CFLAGS_libxenstore = -I$(XEN_libxenstore)/include $(CFLAGS_xeninclude) SHDEPS_libxenstore = $(SHLIB_libxentoolcore) $(SHLIB_libxenctrl) diff --git a/tools/libs/Makefile b/tools/libs/Makefile index 7648ea0e4c..f15c1688f7 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -10,6 +10,7 @@ SUBDIRS-y += call SUBDIRS-y += foreignmemory SUBDIRS-y += devicemodel SUBDIRS-y += ctrl +SUBDIRS-y += guest SUBDIRS-y += hypfs ifeq ($(CONFIG_RUMP),y) diff --git a/tools/libxc/COPYING b/tools/libs/guest/COPYING similarity index 100% rename from tools/libxc/COPYING rename to tools/libs/guest/COPYING diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile new file mode 100644 index 0000000000..e53aeabd3e --- /dev/null +++ b/tools/libs/guest/Makefile @@ -0,0 +1,121 @@ +XEN_ROOT = $(CURDIR)/../../.. +include $(XEN_ROOT)/tools/Rules.mk + +ifeq ($(CONFIG_LIBXC_MINIOS),y) +# Save/restore of a domain is currently incompatible with a stubdom environment +override CONFIG_MIGRATE := n +endif + +LINK_FILES := xc_private.h xc_core.h xc_core_x86.h xc_core_arm.h xc_bitops.h + +$(LINK_FILES): + ln -sf $(XEN_ROOT)/tools/libs/ctrl/$(notdir $@) $@ + +SRCS-y += xg_private.c +SRCS-y += xg_domain.c +SRCS-y += xg_suspend.c +ifeq ($(CONFIG_MIGRATE),y) +SRCS-y += xg_sr_common.c +SRCS-$(CONFIG_X86) += xg_sr_common_x86.c +SRCS-$(CONFIG_X86) += xg_sr_common_x86_pv.c +SRCS-$(CONFIG_X86) += xg_sr_restore_x86_pv.c +SRCS-$(CONFIG_X86) += xg_sr_restore_x86_hvm.c +SRCS-$(CONFIG_X86) += xg_sr_save_x86_pv.c +SRCS-$(CONFIG_X86) += xg_sr_save_x86_hvm.c +SRCS-y += xg_sr_restore.c +SRCS-y += xg_sr_save.c +SRCS-y += xg_offline_page.c +else +SRCS-y += xg_nomigrate.c +endif + +vpath %.c ../../../xen/common/libelf +CFLAGS += -I../../../xen/common/libelf + +ELF_SRCS-y += libelf-tools.c libelf-loader.c +ELF_SRCS-y += libelf-dominfo.c + +SRCS-y += $(ELF_SRCS-y) + +$(patsubst %.c,%.o,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign +$(patsubst %.c,%.opic,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign + +ifeq ($(CONFIG_X86),y) # Add libx86 to the build +vpath %.c ../../../xen/lib/x86 + +SRCS-y += cpuid.c msr.c +endif + +# new domain builder +SRCS-y += xg_dom_core.c +SRCS-y += xg_dom_boot.c +SRCS-y += xg_dom_elfloader.c +SRCS-$(CONFIG_X86) += xg_dom_bzimageloader.c +SRCS-$(CONFIG_X86) += xg_dom_decompress_lz4.c +SRCS-$(CONFIG_X86) += xg_dom_hvmloader.c +SRCS-$(CONFIG_ARM) += xg_dom_armzimageloader.c +SRCS-y += xg_dom_binloader.c +SRCS-y += xg_dom_compat_linux.c + +SRCS-$(CONFIG_X86) += xg_dom_x86.c +SRCS-$(CONFIG_X86) += xg_cpuid_x86.c +SRCS-$(CONFIG_ARM) += xg_dom_arm.c + +ifeq ($(CONFIG_LIBXC_MINIOS),y) +SRCS-y += xg_dom_decompress_unsafe.c +SRCS-y += xg_dom_decompress_unsafe_bzip2.c +SRCS-y += xg_dom_decompress_unsafe_lzma.c +SRCS-y += xg_dom_decompress_unsafe_lzo1x.c +SRCS-y += xg_dom_decompress_unsafe_xz.c +endif + +-include $(XEN_TARGET_ARCH)/Makefile + +CFLAGS += -Werror -Wmissing-prototypes +CFLAGS += -I. -I./include $(CFLAGS_xeninclude) +CFLAGS += -D__XEN_TOOLS__ +CFLAGS += -include $(XEN_ROOT)/tools/config.h + +# Needed for posix_fadvise64() in xc_linux.c +CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE + +CFLAGS += $(PTHREAD_CFLAGS) +CFLAGS += $(CFLAGS_libxentoollog) +CFLAGS += $(CFLAGS_libxenevtchn) +CFLAGS += $(CFLAGS_libxendevicemodel) + +# libxenguest includes xc_private.h, so needs this despite not using +# this functionality directly. +CFLAGS += $(CFLAGS_libxencall) $(CFLAGS_libxenforeignmemory) + +ifeq ($(CONFIG_MiniOS),y) +zlib-options = +else +zlib-options = $(ZLIB) +endif + +xc_dom_bzimageloader.o: CFLAGS += $(filter -D%,$(zlib-options)) +xc_dom_bzimageloader.opic: CFLAGS += $(filter -D%,$(zlib-options)) + +LIBHEADER := xenguest.h + +NO_HEADERS_CHK := y + +include $(XEN_ROOT)/tools/libs/libs.mk + +libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(filter -l%,$(zlib-options)) +libxenguest.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += $(COMPRESSION_LIBS) -lz + +genpath-target = $(call buildmakevars2header,_paths.h) +$(eval $(genpath-target)) + +xc_private.h: _paths.h + +$(LIB_OBJS) $(PIC_OBJS): $(LINK_FILES) + +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenctrl)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) + +.PHONY: cleanlocal +cleanlocal: + rm -f libxenguest.map diff --git a/tools/libxc/include/xenguest.h b/tools/libs/guest/include/xenguest.h similarity index 100% rename from tools/libxc/include/xenguest.h rename to tools/libs/guest/include/xenguest.h diff --git a/tools/libxc/xenguest.pc.in b/tools/libs/guest/xenguest.pc.in similarity index 100% rename from tools/libxc/xenguest.pc.in rename to tools/libs/guest/xenguest.pc.in diff --git a/tools/libxc/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c similarity index 100% rename from tools/libxc/xg_cpuid_x86.c rename to tools/libs/guest/xg_cpuid_x86.c diff --git a/tools/libxc/xg_dom_arm.c b/tools/libs/guest/xg_dom_arm.c similarity index 100% rename from tools/libxc/xg_dom_arm.c rename to tools/libs/guest/xg_dom_arm.c diff --git a/tools/libxc/xg_dom_armzimageloader.c b/tools/libs/guest/xg_dom_armzimageloader.c similarity index 100% rename from tools/libxc/xg_dom_armzimageloader.c rename to tools/libs/guest/xg_dom_armzimageloader.c diff --git a/tools/libxc/xg_dom_binloader.c b/tools/libs/guest/xg_dom_binloader.c similarity index 100% rename from tools/libxc/xg_dom_binloader.c rename to tools/libs/guest/xg_dom_binloader.c diff --git a/tools/libxc/xg_dom_boot.c b/tools/libs/guest/xg_dom_boot.c similarity index 100% rename from tools/libxc/xg_dom_boot.c rename to tools/libs/guest/xg_dom_boot.c diff --git a/tools/libxc/xg_dom_bzimageloader.c b/tools/libs/guest/xg_dom_bzimageloader.c similarity index 100% rename from tools/libxc/xg_dom_bzimageloader.c rename to tools/libs/guest/xg_dom_bzimageloader.c diff --git a/tools/libxc/xg_dom_compat_linux.c b/tools/libs/guest/xg_dom_compat_linux.c similarity index 100% rename from tools/libxc/xg_dom_compat_linux.c rename to tools/libs/guest/xg_dom_compat_linux.c diff --git a/tools/libxc/xg_dom_core.c b/tools/libs/guest/xg_dom_core.c similarity index 100% rename from tools/libxc/xg_dom_core.c rename to tools/libs/guest/xg_dom_core.c diff --git a/tools/libxc/xg_dom_decompress.h b/tools/libs/guest/xg_dom_decompress.h similarity index 100% rename from tools/libxc/xg_dom_decompress.h rename to tools/libs/guest/xg_dom_decompress.h diff --git a/tools/libxc/xg_dom_decompress_lz4.c b/tools/libs/guest/xg_dom_decompress_lz4.c similarity index 100% rename from tools/libxc/xg_dom_decompress_lz4.c rename to tools/libs/guest/xg_dom_decompress_lz4.c diff --git a/tools/libxc/xg_dom_decompress_unsafe.c b/tools/libs/guest/xg_dom_decompress_unsafe.c similarity index 100% rename from tools/libxc/xg_dom_decompress_unsafe.c rename to tools/libs/guest/xg_dom_decompress_unsafe.c diff --git a/tools/libxc/xg_dom_decompress_unsafe.h b/tools/libs/guest/xg_dom_decompress_unsafe.h similarity index 100% rename from tools/libxc/xg_dom_decompress_unsafe.h rename to tools/libs/guest/xg_dom_decompress_unsafe.h diff --git a/tools/libxc/xg_dom_decompress_unsafe_bzip2.c b/tools/libs/guest/xg_dom_decompress_unsafe_bzip2.c similarity index 100% rename from tools/libxc/xg_dom_decompress_unsafe_bzip2.c rename to tools/libs/guest/xg_dom_decompress_unsafe_bzip2.c diff --git a/tools/libxc/xg_dom_decompress_unsafe_lzma.c b/tools/libs/guest/xg_dom_decompress_unsafe_lzma.c similarity index 100% rename from tools/libxc/xg_dom_decompress_unsafe_lzma.c rename to tools/libs/guest/xg_dom_decompress_unsafe_lzma.c diff --git a/tools/libxc/xg_dom_decompress_unsafe_lzo1x.c b/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c similarity index 100% rename from tools/libxc/xg_dom_decompress_unsafe_lzo1x.c rename to tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c diff --git a/tools/libxc/xg_dom_decompress_unsafe_xz.c b/tools/libs/guest/xg_dom_decompress_unsafe_xz.c similarity index 100% rename from tools/libxc/xg_dom_decompress_unsafe_xz.c rename to tools/libs/guest/xg_dom_decompress_unsafe_xz.c diff --git a/tools/libxc/xg_dom_elfloader.c b/tools/libs/guest/xg_dom_elfloader.c similarity index 100% rename from tools/libxc/xg_dom_elfloader.c rename to tools/libs/guest/xg_dom_elfloader.c diff --git a/tools/libxc/xg_dom_hvmloader.c b/tools/libs/guest/xg_dom_hvmloader.c similarity index 100% rename from tools/libxc/xg_dom_hvmloader.c rename to tools/libs/guest/xg_dom_hvmloader.c diff --git a/tools/libxc/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c similarity index 100% rename from tools/libxc/xg_dom_x86.c rename to tools/libs/guest/xg_dom_x86.c diff --git a/tools/libxc/xg_domain.c b/tools/libs/guest/xg_domain.c similarity index 100% rename from tools/libxc/xg_domain.c rename to tools/libs/guest/xg_domain.c diff --git a/tools/libxc/xg_nomigrate.c b/tools/libs/guest/xg_nomigrate.c similarity index 100% rename from tools/libxc/xg_nomigrate.c rename to tools/libs/guest/xg_nomigrate.c diff --git a/tools/libxc/xg_offline_page.c b/tools/libs/guest/xg_offline_page.c similarity index 100% rename from tools/libxc/xg_offline_page.c rename to tools/libs/guest/xg_offline_page.c diff --git a/tools/libxc/xg_private.c b/tools/libs/guest/xg_private.c similarity index 100% rename from tools/libxc/xg_private.c rename to tools/libs/guest/xg_private.c diff --git a/tools/libxc/xg_private.h b/tools/libs/guest/xg_private.h similarity index 100% rename from tools/libxc/xg_private.h rename to tools/libs/guest/xg_private.h diff --git a/tools/libxc/xg_save_restore.h b/tools/libs/guest/xg_save_restore.h similarity index 100% rename from tools/libxc/xg_save_restore.h rename to tools/libs/guest/xg_save_restore.h diff --git a/tools/libxc/xg_sr_common.c b/tools/libs/guest/xg_sr_common.c similarity index 100% rename from tools/libxc/xg_sr_common.c rename to tools/libs/guest/xg_sr_common.c diff --git a/tools/libxc/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h similarity index 100% rename from tools/libxc/xg_sr_common.h rename to tools/libs/guest/xg_sr_common.h diff --git a/tools/libxc/xg_sr_common_x86.c b/tools/libs/guest/xg_sr_common_x86.c similarity index 100% rename from tools/libxc/xg_sr_common_x86.c rename to tools/libs/guest/xg_sr_common_x86.c diff --git a/tools/libxc/xg_sr_common_x86.h b/tools/libs/guest/xg_sr_common_x86.h similarity index 100% rename from tools/libxc/xg_sr_common_x86.h rename to tools/libs/guest/xg_sr_common_x86.h diff --git a/tools/libxc/xg_sr_common_x86_pv.c b/tools/libs/guest/xg_sr_common_x86_pv.c similarity index 100% rename from tools/libxc/xg_sr_common_x86_pv.c rename to tools/libs/guest/xg_sr_common_x86_pv.c diff --git a/tools/libxc/xg_sr_common_x86_pv.h b/tools/libs/guest/xg_sr_common_x86_pv.h similarity index 100% rename from tools/libxc/xg_sr_common_x86_pv.h rename to tools/libs/guest/xg_sr_common_x86_pv.h diff --git a/tools/libxc/xg_sr_restore.c b/tools/libs/guest/xg_sr_restore.c similarity index 100% rename from tools/libxc/xg_sr_restore.c rename to tools/libs/guest/xg_sr_restore.c diff --git a/tools/libxc/xg_sr_restore_x86_hvm.c b/tools/libs/guest/xg_sr_restore_x86_hvm.c similarity index 100% rename from tools/libxc/xg_sr_restore_x86_hvm.c rename to tools/libs/guest/xg_sr_restore_x86_hvm.c diff --git a/tools/libxc/xg_sr_restore_x86_pv.c b/tools/libs/guest/xg_sr_restore_x86_pv.c similarity index 100% rename from tools/libxc/xg_sr_restore_x86_pv.c rename to tools/libs/guest/xg_sr_restore_x86_pv.c diff --git a/tools/libxc/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c similarity index 100% rename from tools/libxc/xg_sr_save.c rename to tools/libs/guest/xg_sr_save.c diff --git a/tools/libxc/xg_sr_save_x86_hvm.c b/tools/libs/guest/xg_sr_save_x86_hvm.c similarity index 100% rename from tools/libxc/xg_sr_save_x86_hvm.c rename to tools/libs/guest/xg_sr_save_x86_hvm.c diff --git a/tools/libxc/xg_sr_save_x86_pv.c b/tools/libs/guest/xg_sr_save_x86_pv.c similarity index 100% rename from tools/libxc/xg_sr_save_x86_pv.c rename to tools/libs/guest/xg_sr_save_x86_pv.c diff --git a/tools/libxc/xg_sr_stream_format.h b/tools/libs/guest/xg_sr_stream_format.h similarity index 100% rename from tools/libxc/xg_sr_stream_format.h rename to tools/libs/guest/xg_sr_stream_format.h diff --git a/tools/libxc/xg_suspend.c b/tools/libs/guest/xg_suspend.c similarity index 100% rename from tools/libxc/xg_suspend.c rename to tools/libs/guest/xg_suspend.c diff --git a/tools/libs/uselibs.mk b/tools/libs/uselibs.mk index 8e45e8d917..9619c576ba 100644 --- a/tools/libs/uselibs.mk +++ b/tools/libs/uselibs.mk @@ -18,3 +18,5 @@ LIBS_LIBS += hypfs USELIBS_hypfs := toollog toolcore call LIBS_LIBS += ctrl USELIBS_ctrl := toollog call evtchn gnttab foreignmemory devicemodel +LIBS_LIBS += guest +USELIBS_guest := evtchn ctrl diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile deleted file mode 100644 index a52264c74c..0000000000 --- a/tools/libxc/Makefile +++ /dev/null @@ -1,207 +0,0 @@ -XEN_ROOT = $(CURDIR)/../.. -include $(XEN_ROOT)/tools/Rules.mk - -MAJOR = 4.15 -MINOR = 0 - -ifeq ($(CONFIG_LIBXC_MINIOS),y) -# Save/restore of a domain is currently incompatible with a stubdom environment -override CONFIG_MIGRATE := n -endif - -LINK_FILES := xc_private.h xc_core.h xc_core_x86.h xc_core_arm.h xc_bitops.h - -$(LINK_FILES): - ln -sf $(XEN_ROOT)/tools/libs/ctrl/$(notdir $@) $@ - -GUEST_SRCS-y := -GUEST_SRCS-y += xg_private.c -GUEST_SRCS-y += xg_domain.c -GUEST_SRCS-y += xg_suspend.c -ifeq ($(CONFIG_MIGRATE),y) -GUEST_SRCS-y += xg_sr_common.c -GUEST_SRCS-$(CONFIG_X86) += xg_sr_common_x86.c -GUEST_SRCS-$(CONFIG_X86) += xg_sr_common_x86_pv.c -GUEST_SRCS-$(CONFIG_X86) += xg_sr_restore_x86_pv.c -GUEST_SRCS-$(CONFIG_X86) += xg_sr_restore_x86_hvm.c -GUEST_SRCS-$(CONFIG_X86) += xg_sr_save_x86_pv.c -GUEST_SRCS-$(CONFIG_X86) += xg_sr_save_x86_hvm.c -GUEST_SRCS-y += xg_sr_restore.c -GUEST_SRCS-y += xg_sr_save.c -GUEST_SRCS-y += xg_offline_page.c -else -GUEST_SRCS-y += xg_nomigrate.c -endif - -vpath %.c ../../xen/common/libelf -CFLAGS += -I../../xen/common/libelf - -ELF_SRCS-y += libelf-tools.c libelf-loader.c -ELF_SRCS-y += libelf-dominfo.c - -GUEST_SRCS-y += $(ELF_SRCS-y) - -$(patsubst %.c,%.o,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign -$(patsubst %.c,%.opic,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign - -ifeq ($(CONFIG_X86),y) # Add libx86 to the build -vpath %.c ../../xen/lib/x86 - -GUEST_SRCS-y += cpuid.c msr.c -endif - -# new domain builder -GUEST_SRCS-y += xg_dom_core.c -GUEST_SRCS-y += xg_dom_boot.c -GUEST_SRCS-y += xg_dom_elfloader.c -GUEST_SRCS-$(CONFIG_X86) += xg_dom_bzimageloader.c -GUEST_SRCS-$(CONFIG_X86) += xg_dom_decompress_lz4.c -GUEST_SRCS-$(CONFIG_X86) += xg_dom_hvmloader.c -GUEST_SRCS-$(CONFIG_ARM) += xg_dom_armzimageloader.c -GUEST_SRCS-y += xg_dom_binloader.c -GUEST_SRCS-y += xg_dom_compat_linux.c - -GUEST_SRCS-$(CONFIG_X86) += xg_dom_x86.c -GUEST_SRCS-$(CONFIG_X86) += xg_cpuid_x86.c -GUEST_SRCS-$(CONFIG_ARM) += xg_dom_arm.c - -ifeq ($(CONFIG_LIBXC_MINIOS),y) -GUEST_SRCS-y += xg_dom_decompress_unsafe.c -GUEST_SRCS-y += xg_dom_decompress_unsafe_bzip2.c -GUEST_SRCS-y += xg_dom_decompress_unsafe_lzma.c -GUEST_SRCS-y += xg_dom_decompress_unsafe_lzo1x.c -GUEST_SRCS-y += xg_dom_decompress_unsafe_xz.c -endif - --include $(XEN_TARGET_ARCH)/Makefile - -CFLAGS += -Werror -Wmissing-prototypes -CFLAGS += -I. -I./include $(CFLAGS_xeninclude) -CFLAGS += -D__XEN_TOOLS__ - -# Needed for posix_fadvise64() in xc_linux.c -CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE - -CFLAGS += $(PTHREAD_CFLAGS) -CFLAGS += $(CFLAGS_libxentoollog) -CFLAGS += $(CFLAGS_libxenevtchn) -CFLAGS += $(CFLAGS_libxendevicemodel) - -GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y)) -GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y)) - -$(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h - -# libxenguest includes xc_private.h, so needs this despite not using -# this functionality directly. -$(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS): CFLAGS += $(CFLAGS_libxencall) $(CFLAGS_libxenforeignmemory) - -LIB += libxenguest.a -ifneq ($(nosharedlibs),y) -LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR) -endif - -genpath-target = $(call buildmakevars2header,_paths.h) -$(eval $(genpath-target)) - -xc_private.h: _paths.h - -$(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS): $(LINK_FILES) - -PKG_CONFIG := xenguest.pc -PKG_CONFIG_VERSION := $(MAJOR).$(MINOR) - -ifneq ($(CONFIG_LIBXC_MINIOS),y) -PKG_CONFIG_INST := $(PKG_CONFIG) -$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix) -$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir) -$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir) -endif - -PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) - -$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenctrl)/include -$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) - -.PHONY: all -all: build - -.PHONY: build -build: - $(MAKE) libs - -.PHONY: libs -libs: $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) - -.PHONY: install -install: build - $(INSTALL_DIR) $(DESTDIR)$(libdir) - $(INSTALL_DIR) $(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) include/xenguest.h $(DESTDIR)$(includedir) - $(INSTALL_DATA) xenguest.pc $(DESTDIR)$(PKG_INSTALLDIR) - -.PHONY: uninstall -uninstall: - rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xenguest.pc - rm -f $(DESTDIR)$(includedir)/xenguest.h - rm -f $(DESTDIR)$(libdir)/libxenguest.so - rm -f $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR) - rm -f $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR).$(MINOR) - rm -f $(DESTDIR)$(libdir)/libxenguest.a - -.PHONY: TAGS -TAGS: - etags -t *.c *.h - -.PHONY: clean -clean: - rm -rf *.rpm $(LIB) *~ $(DEPS_RM) \ - _paths.h \ - $(LINK_FILES) \ - xenguest.pc \ - $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS) - -.PHONY: distclean -distclean: clean - -.PHONY: rpm -rpm: build - rm -rf staging - mkdir staging - mkdir staging/i386 - rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \ - --define "_rpmdir$$PWD/staging" -bb rpm.spec - mv staging/i386/*.rpm . - rm -rf staging - -# libxenguest - -libxenguest.a: $(GUEST_LIB_OBJS) - $(AR) rc $@ $^ - -libxenguest.so: libxenguest.so.$(MAJOR) - $(SYMLINK_SHLIB) $< $@ -libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR) - $(SYMLINK_SHLIB) $< $@ - -ifeq ($(CONFIG_MiniOS),y) -zlib-options = -else -zlib-options = $(ZLIB) -endif - -xc_dom_bzimageloader.o: CFLAGS += $(filter -D%,$(zlib-options)) -xc_dom_bzimageloader.opic: CFLAGS += $(filter -D%,$(zlib-options)) - -libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(filter -l%,$(zlib-options)) -libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) - $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS) - --include $(DEPS_INCLUDE) - From patchwork Sun Aug 23 09:35:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731511 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C0556913 for ; Sun, 23 Aug 2020 09:48:09 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9B6192074D for ; Sun, 23 Aug 2020 09:48:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B6192074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maA-00087w-Fq; Sun, 23 Aug 2020 09:46:34 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQW-0004t9-Tb for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:36 +0000 X-Inumbo-ID: 7aae9369-6850-4b58-a10a-03c6e7761f0a Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7aae9369-6850-4b58-a10a-03c6e7761f0a; Sun, 23 Aug 2020 09:35:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D6CCFB7C3; Sun, 23 Aug 2020 09:35:56 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Samuel Thibault , =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= Subject: [PATCH v3 28/38] tools: split libxenstore into new tools/libs/store directory Date: Sun, 23 Aug 2020 11:35:09 +0200 Message-Id: <20200823093519.18386-29-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There is no reason why libxenstore is not placed in the tools/libs directory. The common files between libxenstore and xenstored are kept in the tools/xenstore directory to be easily accessible by xenstore-stubdom which needs the xenstored files to be built. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- .gitignore | 7 +- stubdom/mini-os.mk | 2 +- tools/Makefile | 2 +- tools/Rules.mk | 5 -- tools/libs/Makefile | 1 + tools/libs/store/Makefile | 64 +++++++++++++++ .../store}/include/compat/xs.h | 0 .../store}/include/compat/xs_lib.h | 0 .../store}/include/xenstore.h | 0 tools/libs/store/libxenstore.map | 49 +++++++++++ tools/{xenstore => libs/store}/xenstore.pc.in | 0 tools/{xenstore => libs/store}/xs.c | 0 tools/libs/uselibs.mk | 2 + tools/python/setup.py | 2 +- tools/xenstore/Makefile | 82 +------------------ tools/xenstore/{include => }/xenstore_lib.h | 0 16 files changed, 129 insertions(+), 87 deletions(-) create mode 100644 tools/libs/store/Makefile rename tools/{xenstore => libs/store}/include/compat/xs.h (100%) rename tools/{xenstore => libs/store}/include/compat/xs_lib.h (100%) rename tools/{xenstore => libs/store}/include/xenstore.h (100%) create mode 100644 tools/libs/store/libxenstore.map rename tools/{xenstore => libs/store}/xenstore.pc.in (100%) rename tools/{xenstore => libs/store}/xs.c (100%) rename tools/xenstore/{include => }/xenstore_lib.h (100%) diff --git a/.gitignore b/.gitignore index c84a5fd4db..cdfc456aae 100644 --- a/.gitignore +++ b/.gitignore @@ -128,6 +128,12 @@ tools/libs/guest/xc_core.h tools/libs/guest/xc_core_arm.h tools/libs/guest/xc_core_x86.h tools/libs/guest/xc_private.h +tools/libs/store/headers.chk +tools/libs/store/list.h +tools/libs/store/utils.h +tools/libs/store/xenstore.pc +tools/libs/store/xs_lib.c +tools/libs/store/include/xenstore_lib.h tools/console/xenconsole tools/console/xenconsoled tools/console/client/_paths.h @@ -282,7 +288,6 @@ tools/xenstore/xenstore-control tools/xenstore/xenstore-ls tools/xenstore/xenstored tools/xenstore/xenstored_test -tools/xenstore/xenstore.pc tools/xenstore/xs_tdb_dump tools/xentrace/xentrace_setsize tools/xentrace/tbctl diff --git a/stubdom/mini-os.mk b/stubdom/mini-os.mk index e1640a7cbc..420e9a8771 100644 --- a/stubdom/mini-os.mk +++ b/stubdom/mini-os.mk @@ -5,7 +5,7 @@ # XEN_ROOT # MINIOS_TARGET_ARCH -XENSTORE_CPPFLAGS = -isystem $(XEN_ROOT)/tools/xenstore/include +XENSTORE_CPPFLAGS = -isystem $(XEN_ROOT)/tools/libs/store/include TOOLCORE_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toolcore TOOLLOG_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog EVTCHN_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn diff --git a/tools/Makefile b/tools/Makefile index f9b4012290..4a3646871c 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -43,7 +43,7 @@ SUBDIRS-y += pygrub SUBDIRS-$(OCAML_TOOLS) += ocaml ifeq ($(CONFIG_RUMP),y) -SUBDIRS-y := libs xenstore +SUBDIRS-y := libs endif # For the sake of linking, set the sys-root diff --git a/tools/Rules.mk b/tools/Rules.mk index b969dcfccb..69a9100b1c 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -18,7 +18,6 @@ include $(XEN_ROOT)/tools/libs/uselibs.mk XEN_libxenlight = $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight XEN_libxlutil = $(XEN_libxenlight) -XEN_libxenstore = $(XEN_ROOT)/tools/xenstore XEN_libxenstat = $(XEN_ROOT)/tools/xenstat/libxenstat/src XEN_libxenvchan = $(XEN_ROOT)/tools/libvchan @@ -106,10 +105,6 @@ $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_defs,$(lib)))) CFLAGS_libxenctrl += $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) -D__XEN_TOOLS__ CFLAGS_libxenguest += $(CFLAGS_libxenevtchn) $(CFLAGS_libxenforeignmemory) -CFLAGS_libxenstore = -I$(XEN_libxenstore)/include $(CFLAGS_xeninclude) -SHDEPS_libxenstore = $(SHLIB_libxentoolcore) $(SHLIB_libxenctrl) -LDLIBS_libxenstore = $(SHDEPS_libxenstore) $(XEN_libxenstore)/libxenstore$(libextension) -SHLIB_libxenstore = $(SHDEPS_libxenstore) -Wl,-rpath-link=$(XEN_libxenstore) ifeq ($(CONFIG_Linux),y) LDLIBS_libxenstore += -ldl endif diff --git a/tools/libs/Makefile b/tools/libs/Makefile index f15c1688f7..62bd8f5292 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -12,6 +12,7 @@ SUBDIRS-y += devicemodel SUBDIRS-y += ctrl SUBDIRS-y += guest SUBDIRS-y += hypfs +SUBDIRS-y += store ifeq ($(CONFIG_RUMP),y) SUBDIRS-y := toolcore diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile new file mode 100644 index 0000000000..4da502646e --- /dev/null +++ b/tools/libs/store/Makefile @@ -0,0 +1,64 @@ +XEN_ROOT=$(CURDIR)/../../.. +include $(XEN_ROOT)/tools/Rules.mk + +MAJOR = 3.0 +MINOR = 3 + +ifeq ($(CONFIG_Linux),y) +APPEND_LDFLAGS += -ldl +endif + +SRCS-y += xs_lib.c +SRCS-y += xs.c + +LIBHEADER = xenstore.h xenstore_lib.h + +include ../libs.mk + +# Include configure output (config.h) +CFLAGS += -include $(XEN_ROOT)/tools/config.h +CFLAGS += $(CFLAGS_libxentoolcore) +CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\"" +CFLAGS += -DXEN_RUN_STORED="\"$(XEN_RUN_STORED)\"" + +LINK_FILES = xs_lib.c include/xenstore_lib.h list.h utils.h + +$(LIB_OBJS): $(LINK_FILES) + +$(LINK_FILES): + ln -sf $(XEN_ROOT)/tools/xenstore/$(notdir $@) $@ + +xs.opic: CFLAGS += -DUSE_PTHREAD +ifeq ($(CONFIG_Linux),y) +xs.opic: CFLAGS += -DUSE_DLSYM +else +PKG_CONFIG_REMOVE += -ldl +endif + +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenstore)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) + +.PHONY: install +install: install-headers + +.PHONY: install-headers +install-headers: + $(INSTALL_DIR) $(DESTDIR)$(includedir) + $(INSTALL_DIR) $(DESTDIR)$(includedir)/xenstore-compat + $(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 + +.PHONY: uninstall +uninstall: uninstall-headers + +.PHONY: uninstall-headers +uninstall-headers: + rm -f $(DESTDIR)$(includedir)/xs_lib.h + rm -f $(DESTDIR)$(includedir)/xs.h + rm -f $(DESTDIR)$(includedir)/xenstore-compat/xs_lib.h + rm -f $(DESTDIR)$(includedir)/xenstore-compat/xs.h + if [ -d $(DESTDIR)$(includedir)/xenstore-compat ]; then \ + rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/xenstore-compat; \ + fi diff --git a/tools/xenstore/include/compat/xs.h b/tools/libs/store/include/compat/xs.h similarity index 100% rename from tools/xenstore/include/compat/xs.h rename to tools/libs/store/include/compat/xs.h diff --git a/tools/xenstore/include/compat/xs_lib.h b/tools/libs/store/include/compat/xs_lib.h similarity index 100% rename from tools/xenstore/include/compat/xs_lib.h rename to tools/libs/store/include/compat/xs_lib.h diff --git a/tools/xenstore/include/xenstore.h b/tools/libs/store/include/xenstore.h similarity index 100% rename from tools/xenstore/include/xenstore.h rename to tools/libs/store/include/xenstore.h diff --git a/tools/libs/store/libxenstore.map b/tools/libs/store/libxenstore.map new file mode 100644 index 0000000000..9854305a2c --- /dev/null +++ b/tools/libs/store/libxenstore.map @@ -0,0 +1,49 @@ +VERS_3.0.3 { + global: + xs_open; + xs_close; + xs_daemon_open; + xs_domain_open; + xs_daemon_open_readonly; + xs_daemon_close; + xs_daemon_destroy_postfork; + xs_directory; + xs_read; + xs_write; + xs_mkdir; + xs_rm; + xs_restrict; + xs_get_permissions; + xs_set_permissions; + xs_watch; + xs_fileno; + xs_check_watch; + xs_read_watch; + xs_unwatch; + xs_transaction_start; + xs_transaction_end; + xs_introduce_domain; + xs_set_target; + xs_resume_domain; + xs_release_domain; + xs_get_domain_path; + xs_path_is_subpath; + xs_is_domain_introduced; + xs_control_command; + xs_debug_command; + xs_suspend_evtchn_port; + xs_daemon_rootdir; + xs_daemon_rundir; + xs_daemon_socket; + xs_daemon_socket_ro; + xs_domain_dev; + xs_daemon_tdb; + xs_write_all; + xs_strings_to_perms; + xs_perm_to_string; + xs_count_strings; + expanding_buffer_ensure; + sanitise_value; + unsanitise_value; + local: *; /* Do not expose anything by default */ +}; diff --git a/tools/xenstore/xenstore.pc.in b/tools/libs/store/xenstore.pc.in similarity index 100% rename from tools/xenstore/xenstore.pc.in rename to tools/libs/store/xenstore.pc.in diff --git a/tools/xenstore/xs.c b/tools/libs/store/xs.c similarity index 100% rename from tools/xenstore/xs.c rename to tools/libs/store/xs.c diff --git a/tools/libs/uselibs.mk b/tools/libs/uselibs.mk index 9619c576ba..a0fe0402ff 100644 --- a/tools/libs/uselibs.mk +++ b/tools/libs/uselibs.mk @@ -20,3 +20,5 @@ LIBS_LIBS += ctrl USELIBS_ctrl := toollog call evtchn gnttab foreignmemory devicemodel LIBS_LIBS += guest USELIBS_guest := evtchn ctrl +LIBS_LIBS += store +USELIBS_store := toolcore diff --git a/tools/python/setup.py b/tools/python/setup.py index 24b284af39..8254464aff 100644 --- a/tools/python/setup.py +++ b/tools/python/setup.py @@ -11,7 +11,7 @@ PATH_LIBXENTOOLLOG = XEN_ROOT + "/tools/libs/toollog" PATH_LIBXENEVTCHN = XEN_ROOT + "/tools/libs/evtchn" PATH_LIBXENCTRL = XEN_ROOT + "/tools/libs/ctrl" PATH_LIBXL = XEN_ROOT + "/tools/libxl" -PATH_XENSTORE = XEN_ROOT + "/tools/xenstore" +PATH_XENSTORE = XEN_ROOT + "/tools/libs/store" xc = Extension("xc", extra_compile_args = extra_compile_args, diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile index 0a64ac1571..9a0f0d012d 100644 --- a/tools/xenstore/Makefile +++ b/tools/xenstore/Makefile @@ -34,17 +34,7 @@ XENSTORED_OBJS_$(CONFIG_MiniOS) = xenstored_minios.o XENSTORED_OBJS += $(XENSTORED_OBJS_y) LDLIBS_xenstored += -lrt -ifneq ($(XENSTORE_STATIC_CLIENTS),y) -LIBXENSTORE := libxenstore.so -else -LIBXENSTORE := libxenstore.a -xenstore xenstore-control: CFLAGS += -static -endif - -ALL_TARGETS = libxenstore.a clients -ifneq ($(nosharedlibs),y) -ALL_TARGETS += libxenstore.so -endif +ALL_TARGETS = clients ifeq ($(XENSTORE_XENSTORED),y) ALL_TARGETS += xs_tdb_dump xenstored endif @@ -87,60 +77,21 @@ xenstored.a: $(XENSTORED_OBJS) $(CLIENTS): xenstore ln -f xenstore $@ -xenstore: xenstore_client.o $(LIBXENSTORE) +xenstore: xenstore_client.o $(CC) $< $(LDFLAGS) $(LDLIBS_libxenstore) $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS) -xenstore-control: xenstore_control.o $(LIBXENSTORE) +xenstore-control: xenstore_control.o $(CC) $< $(LDFLAGS) $(LDLIBS_libxenstore) $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS) xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o $(CC) $^ $(LDFLAGS) -o $@ $(APPEND_LDFLAGS) -libxenstore.so: libxenstore.so.$(MAJOR) - ln -sf $< $@ -libxenstore.so.$(MAJOR): libxenstore.so.$(MAJOR).$(MINOR) - ln -sf $< $@ - -xs.opic: CFLAGS += -DUSE_PTHREAD -ifeq ($(CONFIG_Linux),y) -xs.opic: CFLAGS += -DUSE_DLSYM -libxenstore.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS += -ldl -else -PKG_CONFIG_REMOVE += -ldl -endif - -libxenstore.so.$(MAJOR).$(MINOR): xs.opic xs_lib.opic - $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenstore.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoolcore) $(SOCKET_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS) - -libxenstore.a: xs.o xs_lib.o - $(AR) rcs $@ $^ - -PKG_CONFIG := xenstore.pc -PKG_CONFIG_VERSION := $(MAJOR).$(MINOR) - -ifneq ($(CONFIG_LIBXC_MINIOS),y) -PKG_CONFIG_INST := $(PKG_CONFIG) -$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix) -$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir) -$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir) -endif - -PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) - -$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenstore)/include -$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) - -$(LIBXENSTORE): $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) - .PHONY: clean clean: - rm -f *.a *.o *.opic *.so* xenstored_probes.h + rm -f *.a *.o xenstored_probes.h rm -f xenstored xs_random xs_stress xs_crashme rm -f xs_tdb_dump xenstore-control init-xenstore-domain rm -f xenstore $(CLIENTS) - rm -f xenstore.pc $(RM) $(DEPS_RM) .PHONY: distclean @@ -157,8 +108,6 @@ tarball: clean .PHONY: install install: all $(INSTALL_DIR) $(DESTDIR)$(bindir) - $(INSTALL_DIR) $(DESTDIR)$(includedir) - $(INSTALL_DIR) $(DESTDIR)$(includedir)/xenstore-compat ifeq ($(XENSTORE_XENSTORED),y) $(INSTALL_DIR) $(DESTDIR)$(sbindir) $(INSTALL_DIR) $(DESTDIR)$(XEN_LIB_STORED) @@ -169,32 +118,9 @@ endif set -e ; for c in $(CLIENTS) ; do \ ln -f $(DESTDIR)$(bindir)/xenstore $(DESTDIR)$(bindir)/$${c} ; \ done - $(INSTALL_DIR) $(DESTDIR)$(libdir) - $(INSTALL_SHLIB) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir) - 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) 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 - $(INSTALL_DATA) xenstore.pc $(DESTDIR)$(PKG_INSTALLDIR) .PHONY: uninstall uninstall: - rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xenstore.pc - rm -f $(DESTDIR)$(includedir)/xs_lib.h - rm -f $(DESTDIR)$(includedir)/xs.h - rm -f $(DESTDIR)$(includedir)/xenstore-compat/xs_lib.h - rm -f $(DESTDIR)$(includedir)/xenstore-compat/xs.h - rm -f $(DESTDIR)$(includedir)/xenstore_lib.h - rm -f $(DESTDIR)$(includedir)/xenstore.h - rm -f $(DESTDIR)$(libdir)/libxenstore.a - rm -f $(DESTDIR)$(libdir)/libxenstore.so - rm -f $(DESTDIR)$(libdir)/libxenstore.so.$(MAJOR) - rm -f $(DESTDIR)$(libdir)/libxenstore.so.$(MAJOR).$(MINOR) rm -f $(addprefix $(DESTDIR)$(bindir)/, $(CLIENTS)) rm -f $(DESTDIR)$(bindir)/xenstore rm -f $(DESTDIR)$(bindir)/xenstore-control diff --git a/tools/xenstore/include/xenstore_lib.h b/tools/xenstore/xenstore_lib.h similarity index 100% rename from tools/xenstore/include/xenstore_lib.h rename to tools/xenstore/xenstore_lib.h From patchwork Sun Aug 23 09:35:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731519 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77AD0913 for ; Sun, 23 Aug 2020 09:48:27 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D7BF2074D for ; Sun, 23 Aug 2020 09:48:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D7BF2074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maS-0008NB-52; Sun, 23 Aug 2020 09:46:52 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQo-0004sy-HM for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:54 +0000 X-Inumbo-ID: 0e0af9ef-73bc-4219-867a-052ad65ca214 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0e0af9ef-73bc-4219-867a-052ad65ca214; Sun, 23 Aug 2020 09:35:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1AE34AD6F; Sun, 23 Aug 2020 09:35:57 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v3 29/38] tools: split libxenvchan into new tools/libs/vchan directory Date: Sun, 23 Aug 2020 11:35:10 +0200 Message-Id: <20200823093519.18386-30-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There is no reason why libvchan is not placed in the tools/libs directory. At the same time move libxenvchan.h to a dedicated include directory in tools/libs/vchan in order to follow the same pattern as the other libraries in tools/libs. As tools/libvchan now contains no library any longer rename it to tools/vchan. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- .gitignore | 8 +- tools/Makefile | 2 +- tools/Rules.mk | 6 -- tools/libs/Makefile | 1 + tools/libs/uselibs.mk | 2 + tools/libs/vchan/Makefile | 20 ++++ .../vchan/include}/libxenvchan.h | 0 tools/{libvchan => libs/vchan}/init.c | 0 tools/{libvchan => libs/vchan}/io.c | 0 tools/{libvchan => libs/vchan}/xenvchan.pc.in | 0 tools/libvchan/Makefile | 95 ------------------- tools/vchan/Makefile | 37 ++++++++ tools/{libvchan => vchan}/node-select.c | 0 tools/{libvchan => vchan}/node.c | 0 .../{libvchan => vchan}/vchan-socket-proxy.c | 0 15 files changed, 66 insertions(+), 105 deletions(-) create mode 100644 tools/libs/vchan/Makefile rename tools/{libvchan => libs/vchan/include}/libxenvchan.h (100%) rename tools/{libvchan => libs/vchan}/init.c (100%) rename tools/{libvchan => libs/vchan}/io.c (100%) rename tools/{libvchan => libs/vchan}/xenvchan.pc.in (100%) delete mode 100644 tools/libvchan/Makefile create mode 100644 tools/vchan/Makefile rename tools/{libvchan => vchan}/node-select.c (100%) rename tools/{libvchan => vchan}/node.c (100%) rename tools/{libvchan => vchan}/vchan-socket-proxy.c (100%) diff --git a/.gitignore b/.gitignore index cdfc456aae..b7171ff2eb 100644 --- a/.gitignore +++ b/.gitignore @@ -134,6 +134,9 @@ tools/libs/store/utils.h tools/libs/store/xenstore.pc tools/libs/store/xs_lib.c tools/libs/store/include/xenstore_lib.h +tools/libs/vchan/headers.chk +tools/libs/vchan/libxenvchan.map +tools/libs/vchan/xenvchan.pc tools/console/xenconsole tools/console/xenconsoled tools/console/client/_paths.h @@ -209,7 +212,6 @@ tools/include/xen/* tools/include/xen-xsm/* tools/include/xen-foreign/*.(c|h|size) tools/include/xen-foreign/checker -tools/libvchan/xenvchan.pc tools/libxl/_libxl.api-for-check tools/libxl/*.api-ok tools/libxl/*.pc @@ -388,8 +390,8 @@ tools/misc/xenhypfs tools/misc/xenwatchdogd tools/misc/xen-hvmcrash tools/misc/xen-lowmemd -tools/libvchan/vchan-node[12] -tools/libvchan/vchan-socket-proxy +tools/vchan/vchan-node[12] +tools/vchan/vchan-socket-proxy tools/ocaml/*/.ocamldep.make tools/ocaml/*/*.cm[ixao] tools/ocaml/*/*.cmxa diff --git a/tools/Makefile b/tools/Makefile index 4a3646871c..0db01707a4 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -20,7 +20,7 @@ SUBDIRS-y += xenmon SUBDIRS-y += xenstat SUBDIRS-$(CONFIG_NetBSD) += xenbackendd SUBDIRS-y += libfsimage -SUBDIRS-$(CONFIG_Linux) += libvchan +SUBDIRS-$(CONFIG_Linux) += vchan # do not recurse in to a dir we are about to delete ifneq "$(MAKECMDGOALS)" "distclean" diff --git a/tools/Rules.mk b/tools/Rules.mk index 69a9100b1c..c5f7cd26e0 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -19,7 +19,6 @@ XEN_libxenlight = $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight XEN_libxlutil = $(XEN_libxenlight) XEN_libxenstat = $(XEN_ROOT)/tools/xenstat/libxenstat/src -XEN_libxenvchan = $(XEN_ROOT)/tools/libvchan CFLAGS_xeninclude = -I$(XEN_INCLUDE) @@ -114,11 +113,6 @@ SHDEPS_libxenstat = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) LDLIBS_libxenstat = $(SHDEPS_libxenstat) $(XEN_libxenstat)/libxenstat$(libextension) SHLIB_libxenstat = $(SHDEPS_libxenstat) -Wl,-rpath-link=$(XEN_libxenstat) -CFLAGS_libxenvchan = -I$(XEN_libxenvchan) $(CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn) -SHDEPS_libxenvchan = $(SHLIB_libxentoollog) $(SHLIB_libxenstore) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) -LDLIBS_libxenvchan = $(SHDEPS_libxenvchan) $(XEN_libxenvchan)/libxenvchan$(libextension) -SHLIB_libxenvchan = $(SHDEPS_libxenvchan) -Wl,-rpath-link=$(XEN_libxenvchan) - ifeq ($(debug),y) # Disable optimizations CFLAGS += -O0 -fno-omit-frame-pointer diff --git a/tools/libs/Makefile b/tools/libs/Makefile index 62bd8f5292..756d059ee7 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -13,6 +13,7 @@ SUBDIRS-y += ctrl SUBDIRS-y += guest SUBDIRS-y += hypfs SUBDIRS-y += store +SUBDIRS-$(CONFIG_Linux) += vchan ifeq ($(CONFIG_RUMP),y) SUBDIRS-y := toolcore diff --git a/tools/libs/uselibs.mk b/tools/libs/uselibs.mk index a0fe0402ff..edb4b34256 100644 --- a/tools/libs/uselibs.mk +++ b/tools/libs/uselibs.mk @@ -22,3 +22,5 @@ LIBS_LIBS += guest USELIBS_guest := evtchn ctrl LIBS_LIBS += store USELIBS_store := toolcore +LIBS_LIBS += vchan +USELIBS_vchan := toollog store gnttab evtchn diff --git a/tools/libs/vchan/Makefile b/tools/libs/vchan/Makefile new file mode 100644 index 0000000000..87ff608f45 --- /dev/null +++ b/tools/libs/vchan/Makefile @@ -0,0 +1,20 @@ +XEN_ROOT = $(CURDIR)/../../.. +include $(XEN_ROOT)/tools/Rules.mk + +CFLAGS += $(CFLAGS_libxenctrl) + +LIBHEADER := libxenvchan.h + +SRCS-y += init.c +SRCS-y += io.c + +include $(XEN_ROOT)/tools/libs/libs.mk + +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenvchan)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) + +clean: cleanlocal + +.PHONY: cleanlocal +cleanlocal: + rm -f libxenvchan.map diff --git a/tools/libvchan/libxenvchan.h b/tools/libs/vchan/include/libxenvchan.h similarity index 100% rename from tools/libvchan/libxenvchan.h rename to tools/libs/vchan/include/libxenvchan.h diff --git a/tools/libvchan/init.c b/tools/libs/vchan/init.c similarity index 100% rename from tools/libvchan/init.c rename to tools/libs/vchan/init.c diff --git a/tools/libvchan/io.c b/tools/libs/vchan/io.c similarity index 100% rename from tools/libvchan/io.c rename to tools/libs/vchan/io.c diff --git a/tools/libvchan/xenvchan.pc.in b/tools/libs/vchan/xenvchan.pc.in similarity index 100% rename from tools/libvchan/xenvchan.pc.in rename to tools/libs/vchan/xenvchan.pc.in diff --git a/tools/libvchan/Makefile b/tools/libvchan/Makefile deleted file mode 100644 index a5441162a0..0000000000 --- a/tools/libvchan/Makefile +++ /dev/null @@ -1,95 +0,0 @@ -# -# tools/libvchan/Makefile -# - -XEN_ROOT = $(CURDIR)/../.. -include $(XEN_ROOT)/tools/Rules.mk - -LIBVCHAN_OBJS = init.o io.o -NODE_OBJS = node.o -NODE2_OBJS = node-select.o - -LIBVCHAN_PIC_OBJS = $(patsubst %.o,%.opic,$(LIBVCHAN_OBJS)) -LIBVCHAN_LIBS = $(LDLIBS_libxenstore) $(LDLIBS_libxengnttab) $(LDLIBS_libxenevtchn) -$(LIBVCHAN_OBJS) $(LIBVCHAN_PIC_OBJS): CFLAGS += $(CFLAGS_libxenstore) $(CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn) -$(NODE_OBJS) $(NODE2_OBJS): CFLAGS += $(CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn) -vchan-socket-proxy.o: CFLAGS += $(CFLAGS_libxenstore) $(CFLAGS_libxenctrl) $(CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn) - -MAJOR = 4.15 -MINOR = 0 - -CFLAGS += -I../include -I. - -io.o io.opic: CFLAGS += $(CFLAGS_libxenctrl) # for xen_mb et al - -PKG_CONFIG := xenvchan.pc -PKG_CONFIG_VERSION := $(MAJOR).$(MINOR) - -ifneq ($(CONFIG_LIBXC_MINIOS),y) -PKG_CONFIG_INST := $(PKG_CONFIG) -$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix) -$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir) -$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir) -endif - -PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) - -$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenvchan) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) - -.PHONY: all -all: libxenvchan.so vchan-node1 vchan-node2 vchan-socket-proxy libxenvchan.a $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) - -libxenvchan.so: libxenvchan.so.$(MAJOR) - ln -sf $< $@ - -libxenvchan.so.$(MAJOR): libxenvchan.so.$(MAJOR).$(MINOR) - ln -sf $< $@ - -libxenvchan.so.$(MAJOR).$(MINOR): $(LIBVCHAN_PIC_OBJS) - $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenvchan.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBVCHAN_LIBS) $(APPEND_LDFLAGS) - -libxenvchan.a: $(LIBVCHAN_OBJS) - $(AR) rcs libxenvchan.a $^ - -vchan-node1: $(NODE_OBJS) libxenvchan.so - $(CC) $(LDFLAGS) -o $@ $(NODE_OBJS) $(LDLIBS_libxenvchan) $(APPEND_LDFLAGS) - -vchan-node2: $(NODE2_OBJS) libxenvchan.so - $(CC) $(LDFLAGS) -o $@ $(NODE2_OBJS) $(LDLIBS_libxenvchan) $(APPEND_LDFLAGS) - -vchan-socket-proxy: vchan-socket-proxy.o libxenvchan.so - $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenvchan) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS) - -.PHONY: install -install: all - $(INSTALL_DIR) $(DESTDIR)$(libdir) - $(INSTALL_DIR) $(DESTDIR)$(includedir) - $(INSTALL_DIR) $(DESTDIR)$(bindir) - $(INSTALL_PROG) libxenvchan.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir) - ln -sf libxenvchan.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenvchan.so.$(MAJOR) - ln -sf libxenvchan.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenvchan.so - $(INSTALL_PROG) vchan-socket-proxy $(DESTDIR)$(bindir) - $(INSTALL_DATA) libxenvchan.h $(DESTDIR)$(includedir) - $(INSTALL_DATA) libxenvchan.a $(DESTDIR)$(libdir) - $(INSTALL_DATA) xenvchan.pc $(DESTDIR)$(PKG_INSTALLDIR) - -.PHONY: uninstall -uninstall: - rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xenvchan.pc - rm -f $(DESTDIR)$(libdir)/libxenvchan.a - rm -f $(DESTDIR)$(includedir)/libxenvchan.h - rm -f $(DESTDIR)$(libdir)/libxenvchan.so - rm -f $(DESTDIR)$(libdir)/libxenvchan.so.$(MAJOR) - rm -f $(DESTDIR)$(libdir)/libxenvchan.so.$(MAJOR).$(MINOR) - -.PHONY: clean -clean: - $(RM) -f *.o *.opic *.so* *.a vchan-node1 vchan-node2 $(DEPS_RM) - $(RM) -f xenvchan.pc - -distclean: clean - --include $(DEPS_INCLUDE) diff --git a/tools/vchan/Makefile b/tools/vchan/Makefile new file mode 100644 index 0000000000..a731e0e073 --- /dev/null +++ b/tools/vchan/Makefile @@ -0,0 +1,37 @@ +# +# tools/vchan/Makefile +# + +XEN_ROOT = $(CURDIR)/../.. +include $(XEN_ROOT)/tools/Rules.mk + +NODE_OBJS = node.o +NODE2_OBJS = node-select.o + +$(NODE_OBJS) $(NODE2_OBJS): CFLAGS += $(CFLAGS_libxenvchan) $(CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn) +vchan-socket-proxy.o: CFLAGS += $(CFLAGS_libxenvchan) $(CFLAGS_libxenstore) $(CFLAGS_libxenctrl) $(CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn) + +.PHONY: all +all: vchan-node1 vchan-node2 vchan-socket-proxy + +vchan-node1: $(NODE_OBJS) + $(CC) $(LDFLAGS) -o $@ $(NODE_OBJS) $(LDLIBS_libxenvchan) $(APPEND_LDFLAGS) + +vchan-node2: $(NODE2_OBJS) + $(CC) $(LDFLAGS) -o $@ $(NODE2_OBJS) $(LDLIBS_libxenvchan) $(APPEND_LDFLAGS) + +vchan-socket-proxy: vchan-socket-proxy.o + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenvchan) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS) + +.PHONY: install +install: all + $(INSTALL_DIR) $(DESTDIR)$(bindir) + $(INSTALL_PROG) vchan-socket-proxy $(DESTDIR)$(bindir) + +.PHONY: clean +clean: + $(RM) -f *.o vchan-node1 vchan-node2 $(DEPS_RM) + +distclean: clean + +-include $(DEPS_INCLUDE) diff --git a/tools/libvchan/node-select.c b/tools/vchan/node-select.c similarity index 100% rename from tools/libvchan/node-select.c rename to tools/vchan/node-select.c diff --git a/tools/libvchan/node.c b/tools/vchan/node.c similarity index 100% rename from tools/libvchan/node.c rename to tools/vchan/node.c diff --git a/tools/libvchan/vchan-socket-proxy.c b/tools/vchan/vchan-socket-proxy.c similarity index 100% rename from tools/libvchan/vchan-socket-proxy.c rename to tools/vchan/vchan-socket-proxy.c From patchwork Sun Aug 23 09:35:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731515 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FF0E109B for ; Sun, 23 Aug 2020 09:48:14 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3AC342074D for ; Sun, 23 Aug 2020 09:48:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3AC342074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maF-0008Br-Hl; Sun, 23 Aug 2020 09:46:39 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQb-0004t9-Tw for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:41 +0000 X-Inumbo-ID: 40544d03-8f5f-4fb8-a53a-b5e25912074c Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 40544d03-8f5f-4fb8-a53a-b5e25912074c; Sun, 23 Aug 2020 09:35:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5BA0CADD6; Sun, 23 Aug 2020 09:35:57 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v3 30/38] tools: split libxenstat into new tools/libs/stat directory Date: Sun, 23 Aug 2020 11:35:11 +0200 Message-Id: <20200823093519.18386-31-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There is no reason why libxenstat is not placed in the tools/libs directory. At the same time move xenstat.h to a dedicated include directory in tools/libs/stat in order to follow the same pattern as the other libraries in tools/libs. As now xentop is the only left directory in xenstat move it directly under tools and get rid of tools/xenstat. Fix some missing prototype errors (add one prototype and make two functions static). Signed-off-by: Juergen Gross Acked-by: Wei Liu --- .gitignore | 8 +- tools/Makefile | 2 +- tools/Rules.mk | 6 -- tools/libs/Makefile | 1 + .../{xenstat/libxenstat => libs/stat}/COPYING | 0 .../libxenstat => libs/stat}/Makefile | 100 ++++-------------- .../stat}/bindings/swig/perl/.empty | 0 .../stat}/bindings/swig/python/.empty | 0 .../stat}/bindings/swig/xenstat.i | 0 .../src => libs/stat/include}/xenstat.h | 3 + .../libxenstat/src => libs/stat}/xenstat.c | 0 .../libxenstat => libs/stat}/xenstat.pc.in | 2 +- .../src => libs/stat}/xenstat_freebsd.c | 0 .../src => libs/stat}/xenstat_linux.c | 4 +- .../src => libs/stat}/xenstat_netbsd.c | 0 .../src => libs/stat}/xenstat_priv.h | 0 .../src => libs/stat}/xenstat_qmp.c | 0 .../src => libs/stat}/xenstat_solaris.c | 0 tools/libs/uselibs.mk | 2 + tools/xenstat/Makefile | 10 -- tools/{xenstat => }/xentop/Makefile | 2 +- tools/{xenstat => }/xentop/TODO | 0 tools/{xenstat => }/xentop/xentop.c | 0 23 files changed, 37 insertions(+), 103 deletions(-) rename tools/{xenstat/libxenstat => libs/stat}/COPYING (100%) rename tools/{xenstat/libxenstat => libs/stat}/Makefile (55%) rename tools/{xenstat/libxenstat => libs/stat}/bindings/swig/perl/.empty (100%) rename tools/{xenstat/libxenstat => libs/stat}/bindings/swig/python/.empty (100%) rename tools/{xenstat/libxenstat => libs/stat}/bindings/swig/xenstat.i (100%) rename tools/{xenstat/libxenstat/src => libs/stat/include}/xenstat.h (98%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat.c (100%) rename tools/{xenstat/libxenstat => libs/stat}/xenstat.pc.in (82%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat_freebsd.c (100%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat_linux.c (98%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat_netbsd.c (100%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat_priv.h (100%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat_qmp.c (100%) rename tools/{xenstat/libxenstat/src => libs/stat}/xenstat_solaris.c (100%) delete mode 100644 tools/xenstat/Makefile rename tools/{xenstat => }/xentop/Makefile (97%) rename tools/{xenstat => }/xentop/TODO (100%) rename tools/{xenstat => }/xentop/xentop.c (100%) diff --git a/.gitignore b/.gitignore index b7171ff2eb..44abbc7e43 100644 --- a/.gitignore +++ b/.gitignore @@ -128,6 +128,10 @@ tools/libs/guest/xc_core.h tools/libs/guest/xc_core_arm.h tools/libs/guest/xc_core_x86.h tools/libs/guest/xc_private.h +tools/libs/stat/_paths.h +tools/libs/stat/headers.chk +tools/libs/stat/libxenstat.map +tools/libs/stat/xenstat.pc tools/libs/store/headers.chk tools/libs/store/list.h tools/libs/store/utils.h @@ -276,9 +280,6 @@ tools/xenmon/xentrace_setmask tools/xenmon/xenbaked tools/xenpaging/xenpaging tools/xenpmd/xenpmd -tools/xenstat/libxenstat/src/_paths.h -tools/xenstat/libxenstat/xenstat.pc -tools/xenstat/xentop/xentop tools/xenstore/xenstore tools/xenstore/xenstore-chmod tools/xenstore/xenstore-exists @@ -291,6 +292,7 @@ tools/xenstore/xenstore-ls tools/xenstore/xenstored tools/xenstore/xenstored_test tools/xenstore/xs_tdb_dump +tools/xentop/xentop tools/xentrace/xentrace_setsize tools/xentrace/tbctl tools/xentrace/xenctx diff --git a/tools/Makefile b/tools/Makefile index 0db01707a4..ea69675cca 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -17,7 +17,7 @@ SUBDIRS-$(CONFIG_XCUTILS) += xcutils SUBDIRS-$(CONFIG_X86) += firmware SUBDIRS-y += console SUBDIRS-y += xenmon -SUBDIRS-y += xenstat +SUBDIRS-y += xentop SUBDIRS-$(CONFIG_NetBSD) += xenbackendd SUBDIRS-y += libfsimage SUBDIRS-$(CONFIG_Linux) += vchan diff --git a/tools/Rules.mk b/tools/Rules.mk index c5f7cd26e0..241e8e7d9a 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -18,7 +18,6 @@ include $(XEN_ROOT)/tools/libs/uselibs.mk XEN_libxenlight = $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight XEN_libxlutil = $(XEN_libxenlight) -XEN_libxenstat = $(XEN_ROOT)/tools/xenstat/libxenstat/src CFLAGS_xeninclude = -I$(XEN_INCLUDE) @@ -108,11 +107,6 @@ ifeq ($(CONFIG_Linux),y) LDLIBS_libxenstore += -ldl endif -CFLAGS_libxenstat = -I$(XEN_libxenstat) -SHDEPS_libxenstat = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) -LDLIBS_libxenstat = $(SHDEPS_libxenstat) $(XEN_libxenstat)/libxenstat$(libextension) -SHLIB_libxenstat = $(SHDEPS_libxenstat) -Wl,-rpath-link=$(XEN_libxenstat) - ifeq ($(debug),y) # Disable optimizations CFLAGS += -O0 -fno-omit-frame-pointer diff --git a/tools/libs/Makefile b/tools/libs/Makefile index 756d059ee7..e8fcd59214 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -13,6 +13,7 @@ SUBDIRS-y += ctrl SUBDIRS-y += guest SUBDIRS-y += hypfs SUBDIRS-y += store +SUBDIRS-y += stat SUBDIRS-$(CONFIG_Linux) += vchan ifeq ($(CONFIG_RUMP),y) diff --git a/tools/xenstat/libxenstat/COPYING b/tools/libs/stat/COPYING similarity index 100% rename from tools/xenstat/libxenstat/COPYING rename to tools/libs/stat/COPYING diff --git a/tools/xenstat/libxenstat/Makefile b/tools/libs/stat/Makefile similarity index 55% rename from tools/xenstat/libxenstat/Makefile rename to tools/libs/stat/Makefile index b5e623b155..5463f5f7ca 100644 --- a/tools/xenstat/libxenstat/Makefile +++ b/tools/libs/stat/Makefile @@ -15,80 +15,24 @@ XEN_ROOT=$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk -LDCONFIG=ldconfig -MAKE_LINK=ln -sf - -MAJOR=4.15 -MINOR=0 - -LIB=src/libxenstat.a -SHLIB=src/libxenstat.so.$(MAJOR).$(MINOR) -SHLIB_LINKS=src/libxenstat.so.$(MAJOR) src/libxenstat.so -OBJECTS-y=src/xenstat.o src/xenstat_qmp.o -OBJECTS-$(CONFIG_Linux) += src/xenstat_linux.o -OBJECTS-$(CONFIG_SunOS) += src/xenstat_solaris.o -OBJECTS-$(CONFIG_NetBSD) += src/xenstat_netbsd.o -OBJECTS-$(CONFIG_FreeBSD) += src/xenstat_freebsd.o -SONAME_FLAGS=-Wl,$(SONAME_LDFLAG) -Wl,libxenstat.so.$(MAJOR) - -CFLAGS+=-fPIC -Werror -CFLAGS+=-Isrc $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) -include $(XEN_ROOT)/tools/config.h - -LDLIBS-y = $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) -lyajl -LDLIBS-$(CONFIG_SunOS) += -lkstat - -PKG_CONFIG := xenstat.pc -PKG_CONFIG_VERSION := $(MAJOR).$(MINOR) - -ifneq ($(CONFIG_LIBXC_MINIOS),y) -PKG_CONFIG_INST := $(PKG_CONFIG) -$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix) -$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir) -$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir) -endif - -PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) +CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) -include $(XEN_ROOT)/tools/config.h -$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenstat) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) +SRCS-y += xenstat.c +SRCS-y += xenstat_qmp.c +SRCS-$(CONFIG_Linux) += xenstat_linux.c +SRCS-$(CONFIG_SunOS) += xenstat_solaris.c +SRCS-$(CONFIG_NetBSD) += xenstat_netbsd.c +SRCS-$(CONFIG_FreeBSD) += xenstat_freebsd.c -.PHONY: all -all: $(LIB) $(SHLIB) $(SHLIB_LINKS) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) - -$(OBJECTS-y): src/_paths.h - -$(LIB): $(OBJECTS-y) - $(AR) rc $@ $^ - $(RANLIB) $@ - -$(SHLIB): $(OBJECTS-y) - $(CC) $(LDFLAGS) $(SONAME_FLAGS) $(SHLIB_LDFLAGS) -o $@ \ - $(OBJECTS-y) $(LDLIBS-y) $(APPEND_LDFLAGS) +LDLIBS-y += -lyajl +LDLIBS-$(CONFIG_SunOS) += -lkstat +APPEND_LDFLAGS += $(LDLIBS-y) -src/libxenstat.so.$(MAJOR): $(SHLIB) - $(MAKE_LINK) $( X-Patchwork-Id: 11731493 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5AB81722 for ; Sun, 23 Aug 2020 09:38:09 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 40FC72075B for ; Sun, 23 Aug 2020 09:38:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40FC72075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQb-00067I-V7; Sun, 23 Aug 2020 09:36:41 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQH-0004t9-T7 for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:21 +0000 X-Inumbo-ID: 3b359747-b860-4779-8c0d-9e54c9bfffa8 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 3b359747-b860-4779-8c0d-9e54c9bfffa8; Sun, 23 Aug 2020 09:35:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 80451ADE0; Sun, 23 Aug 2020 09:35:57 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH v3 31/38] tools/libxl: fix dependencies of libxl tests Date: Sun, 23 Aug 2020 11:35:12 +0200 Message-Id: <20200823093519.18386-32-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Today building the libxl internal tests depends on libxlutil having been built, in spite of the tests not using any functionality og libxlutil. Fix this by dropping the dependency. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/libxl/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 65f3968947..1541d25f72 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -317,14 +317,14 @@ libxlutil.so.$(XLUMAJOR).$(XLUMINOR): $(LIBXLU_OBJS) libxenlight.so libxlutil.a: $(LIBXLU_OBJS) $(AR) rcs libxlutil.a $^ -test_%: test_%.o test_common.o libxlutil.so libxenlight_test.so +test_%: test_%.o test_common.o libxenlight_test.so $(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) -lyajl $(APPEND_LDFLAGS) libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so $(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS) -testidl: testidl.o libxlutil.so libxenlight.so - $(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS) +testidl: testidl.o libxenlight.so + $(CC) $(LDFLAGS) -o $@ testidl.o $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS) .PHONY: install install: all From patchwork Sun Aug 23 09:35:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731517 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08FCE913 for ; Sun, 23 Aug 2020 09:48:20 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E375C2074D for ; Sun, 23 Aug 2020 09:48:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E375C2074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maS-0008O4-J1; Sun, 23 Aug 2020 09:46:52 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQe-0004sy-HB for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:44 +0000 X-Inumbo-ID: 7b7fd969-8cc3-4c62-98de-b1967d13a608 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7b7fd969-8cc3-4c62-98de-b1967d13a608; Sun, 23 Aug 2020 09:35:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A7E3EB7CE; Sun, 23 Aug 2020 09:35:57 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH v3 32/38] tools/libxl: don't include libxl_osdeps.h from libxlutil sources Date: Sun, 23 Aug 2020 11:35:13 +0200 Message-Id: <20200823093519.18386-33-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There is no need for the sources of libxlutil to include libxl_osdeps.h as the only dependency is the leading #define _GNU_SOURCE in libxl_osdeps.h. So replace including libxl_osdeps.h by the needed define. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/libxl/libxlu_cfg.c | 3 +-- tools/libxl/libxlu_cfg_i.h | 1 - tools/libxl/libxlu_disk.c | 1 - tools/libxl/libxlu_disk_l.c | 14 +++++++------- tools/libxl/libxlu_disk_l.h | 8 ++++---- tools/libxl/libxlu_disk_l.l | 2 +- tools/libxl/libxlu_pci.c | 3 ++- tools/libxl/libxlu_vif.c | 3 ++- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/tools/libxl/libxlu_cfg.c b/tools/libxl/libxlu_cfg.c index f9e8aa2f3a..874f5abfb9 100644 --- a/tools/libxl/libxlu_cfg.c +++ b/tools/libxl/libxlu_cfg.c @@ -15,8 +15,7 @@ * GNU Lesser General Public License for more details. */ - -#include "libxl_osdeps.h" /* must come before any other headers */ +#define _GNU_SOURCE #include diff --git a/tools/libxl/libxlu_cfg_i.h b/tools/libxl/libxlu_cfg_i.h index 87b19df311..4217f5b28d 100644 --- a/tools/libxl/libxlu_cfg_i.h +++ b/tools/libxl/libxlu_cfg_i.h @@ -18,7 +18,6 @@ #ifndef LIBXLU_CFG_I_H #define LIBXLU_CFG_I_H -#include "libxl_osdeps.h" /* must come before any other headers */ #include "libxlu_internal.h" #include "libxlu_cfg_y.h" diff --git a/tools/libxl/libxlu_disk.c b/tools/libxl/libxlu_disk.c index 18fe386dbe..1de16a6a06 100644 --- a/tools/libxl/libxlu_disk.c +++ b/tools/libxl/libxlu_disk.c @@ -1,4 +1,3 @@ -#include "libxl_osdeps.h" /* must come before any other headers */ #include "libxlu_internal.h" #include "libxlu_disk_l.h" #include "libxlu_disk_i.h" diff --git a/tools/libxl/libxlu_disk_l.c b/tools/libxl/libxlu_disk_l.c index 05f7ac74a0..32d4b74b58 100644 --- a/tools/libxl/libxlu_disk_l.c +++ b/tools/libxl/libxlu_disk_l.c @@ -1,7 +1,7 @@ -#line 2 "libxlu_disk_l.c" -#include "libxl_osdeps.h" /* must come before any other headers */ +#line 1 "libxlu_disk_l.c" +#define _GNU_SOURCE -#line 5 "libxlu_disk_l.c" +#line 4 "libxlu_disk_l.c" #define YY_INT_ALIGNED short int @@ -1199,9 +1199,9 @@ static int vdev_and_devtype(DiskParseContext *dpc, char *str) { #undef DPC /* needs to be defined differently the actual lexer */ #define DPC ((DiskParseContext*)yyextra) -#line 1203 "libxlu_disk_l.c" +#line 1202 "libxlu_disk_l.c" -#line 1205 "libxlu_disk_l.c" +#line 1204 "libxlu_disk_l.c" #define INITIAL 0 #define LEXERR 1 @@ -1483,7 +1483,7 @@ YY_DECL #line 180 "libxlu_disk_l.l" /*----- the scanner rules which do the parsing -----*/ -#line 1487 "libxlu_disk_l.c" +#line 1486 "libxlu_disk_l.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1836,7 +1836,7 @@ YY_RULE_SETUP #line 291 "libxlu_disk_l.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1840 "libxlu_disk_l.c" +#line 1839 "libxlu_disk_l.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(LEXERR): yyterminate(); diff --git a/tools/libxl/libxlu_disk_l.h b/tools/libxl/libxlu_disk_l.h index 54f4662d7a..6abeecf279 100644 --- a/tools/libxl/libxlu_disk_l.h +++ b/tools/libxl/libxlu_disk_l.h @@ -2,10 +2,10 @@ #define xlu__disk_yyHEADER_H 1 #define xlu__disk_yyIN_HEADER 1 -#line 6 "libxlu_disk_l.h" -#include "libxl_osdeps.h" /* must come before any other headers */ +#line 5 "libxlu_disk_l.h" +#define _GNU_SOURCE -#line 9 "libxlu_disk_l.h" +#line 8 "libxlu_disk_l.h" #define YY_INT_ALIGNED short int @@ -696,6 +696,6 @@ extern int yylex (yyscan_t yyscanner); #line 291 "libxlu_disk_l.l" -#line 700 "libxlu_disk_l.h" +#line 699 "libxlu_disk_l.h" #undef xlu__disk_yyIN_HEADER #endif /* xlu__disk_yyHEADER_H */ diff --git a/tools/libxl/libxlu_disk_l.l b/tools/libxl/libxlu_disk_l.l index 7a46f4a30c..3bd639aab0 100644 --- a/tools/libxl/libxlu_disk_l.l +++ b/tools/libxl/libxlu_disk_l.l @@ -28,7 +28,7 @@ */ %top{ -#include "libxl_osdeps.h" /* must come before any other headers */ +#define _GNU_SOURCE } %{ diff --git a/tools/libxl/libxlu_pci.c b/tools/libxl/libxlu_pci.c index 7947687661..bbce719e91 100644 --- a/tools/libxl/libxlu_pci.c +++ b/tools/libxl/libxlu_pci.c @@ -1,4 +1,5 @@ -#include "libxl_osdeps.h" /* must come before any other headers */ +#define _GNU_SOURCE + #include "libxlu_internal.h" #include "libxlu_disk_l.h" #include "libxlu_disk_i.h" diff --git a/tools/libxl/libxlu_vif.c b/tools/libxl/libxlu_vif.c index 0665e624dc..ccf0cbdf57 100644 --- a/tools/libxl/libxlu_vif.c +++ b/tools/libxl/libxlu_vif.c @@ -1,4 +1,5 @@ -#include "libxl_osdeps.h" /* must come before any other headers */ +#define _GNU_SOURCE + #include "libxlu_internal.h" static const char *vif_bytes_per_sec_re = "^[0-9]+[GMK]?[Bb]/s$"; From patchwork Sun Aug 23 09:35:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731509 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 98127913 for ; Sun, 23 Aug 2020 09:48:07 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7DAE82074D for ; Sun, 23 Aug 2020 09:48:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DAE82074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maR-0008LZ-CI; Sun, 23 Aug 2020 09:46:51 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQZ-0004sy-HF for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:39 +0000 X-Inumbo-ID: f4de2cb4-7230-4c2b-99f5-5c6ce396cef6 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f4de2cb4-7230-4c2b-99f5-5c6ce396cef6; Sun, 23 Aug 2020 09:35:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id CD53CB7CF; Sun, 23 Aug 2020 09:35:57 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH v3 33/38] tools/libxl: add missing items to clean target Date: Sun, 23 Aug 2020 11:35:14 +0200 Message-Id: <20200823093519.18386-34-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Some generated files are not removed by "make clean". Add them. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/libxl/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 1541d25f72..1476c7897f 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -363,8 +363,10 @@ clean: $(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS_RM) $(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check $(RM) -f testidl.c.new testidl.c *.api-ok + $(RM) -f $(TEST_PROGS) $(RM) -f xenlight.pc $(RM) -f xlutil.pc + $(RM) -rf __pycache__ $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) clean distclean: clean From patchwork Sun Aug 23 09:35:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731513 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDC85109B for ; Sun, 23 Aug 2020 09:48:09 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C46262074D for ; Sun, 23 Aug 2020 09:48:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C46262074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maE-0008AL-0s; Sun, 23 Aug 2020 09:46:38 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQR-0004t9-TR for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:31 +0000 X-Inumbo-ID: 289043b6-5232-4b76-a6dd-61807808931c Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 289043b6-5232-4b76-a6dd-61807808931c; Sun, 23 Aug 2020 09:35:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 00BBCAE02; Sun, 23 Aug 2020 09:35:58 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH v3 34/38] tools/libxl: move xl parsing checks to tools/xl Date: Sun, 23 Aug 2020 11:35:15 +0200 Message-Id: <20200823093519.18386-35-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" check-xl-* scripts and data are not libxl- but xl-specific. Move them from tools/libxl/ to tools/xl/. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/{libxl => xl}/check-xl-disk-parse | 0 tools/{libxl => xl}/check-xl-vcpupin-parse | 0 tools/{libxl => xl}/check-xl-vcpupin-parse.data-example | 0 tools/{libxl => xl}/check-xl-vif-parse | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename tools/{libxl => xl}/check-xl-disk-parse (100%) rename tools/{libxl => xl}/check-xl-vcpupin-parse (100%) rename tools/{libxl => xl}/check-xl-vcpupin-parse.data-example (100%) rename tools/{libxl => xl}/check-xl-vif-parse (100%) diff --git a/tools/libxl/check-xl-disk-parse b/tools/xl/check-xl-disk-parse similarity index 100% rename from tools/libxl/check-xl-disk-parse rename to tools/xl/check-xl-disk-parse diff --git a/tools/libxl/check-xl-vcpupin-parse b/tools/xl/check-xl-vcpupin-parse similarity index 100% rename from tools/libxl/check-xl-vcpupin-parse rename to tools/xl/check-xl-vcpupin-parse diff --git a/tools/libxl/check-xl-vcpupin-parse.data-example b/tools/xl/check-xl-vcpupin-parse.data-example similarity index 100% rename from tools/libxl/check-xl-vcpupin-parse.data-example rename to tools/xl/check-xl-vcpupin-parse.data-example diff --git a/tools/libxl/check-xl-vif-parse b/tools/xl/check-xl-vif-parse similarity index 100% rename from tools/libxl/check-xl-vif-parse rename to tools/xl/check-xl-vif-parse From patchwork Sun Aug 23 09:35:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731501 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13828913 for ; Sun, 23 Aug 2020 09:46:55 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E13702074D for ; Sun, 23 Aug 2020 09:46:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E13702074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maE-0008Ah-A4; Sun, 23 Aug 2020 09:46:38 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQt-0004sy-HP for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:59 +0000 X-Inumbo-ID: d1a48996-de82-4357-97b1-82a97f12588a Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d1a48996-de82-4357-97b1-82a97f12588a; Sun, 23 Aug 2020 09:35:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 34C2CB7D0; Sun, 23 Aug 2020 09:35:58 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH v3 35/38] tools/xl: don't assume libxl and libxlutil are in one directory Date: Sun, 23 Aug 2020 11:35:16 +0200 Message-Id: <20200823093519.18386-36-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Add the correct flags for both, libxenlight and libxlutil, when building xl. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- tools/xl/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/xl/Makefile b/tools/xl/Makefile index af4912e67a..407dd7554c 100644 --- a/tools/xl/Makefile +++ b/tools/xl/Makefile @@ -13,6 +13,7 @@ CFLAGS += $(PTHREAD_CFLAGS) LDFLAGS += $(PTHREAD_LDFLAGS) CFLAGS_XL += $(CFLAGS_libxenlight) +CFLAGS_XL += $(CFLAGS_libxlutil) CFLAGS_XL += -Wshadow XL_OBJS-$(CONFIG_X86) = xl_psr.o From patchwork Sun Aug 23 09:35:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731527 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5EB47109B for ; Sun, 23 Aug 2020 09:48:45 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D68920768 for ; Sun, 23 Aug 2020 09:48:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D68920768 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maP-0008Hv-8L; Sun, 23 Aug 2020 09:46:49 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQq-0004t9-Ub for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:57 +0000 X-Inumbo-ID: d540fa58-8549-4150-b507-ffe87720f715 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d540fa58-8549-4150-b507-ffe87720f715; Sun, 23 Aug 2020 09:35:30 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 92D41AD26; Sun, 23 Aug 2020 09:35:58 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Anthony PERARD , Shriram Rajagopalan , Yang Hongyang , Christian Lindig , David Scott Subject: [PATCH v3 36/38] tools/libxl: move libxenlight to tools/libs/light Date: Sun, 23 Aug 2020 11:35:17 +0200 Message-Id: <20200823093519.18386-37-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Carve out all libxenlight related sources and move them to tools/libs/light in order to use the generic library build environment. The closely related sources for libxl-save-helper and the libxl test environment are being moved, too. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- .gitignore | 31 +- tools/Rules.mk | 11 +- tools/configure | 2 +- tools/configure.ac | 2 +- tools/libs/Makefile | 1 + tools/libs/light/CODING_STYLE | 330 ++++++++++++++++++ tools/libs/light/Makefile | 291 +++++++++++++++ .../light}/check-libxl-api-rules | 0 tools/{libxl => libs/light}/flexarray.c | 0 tools/{libxl => libs/light}/flexarray.h | 0 tools/{libxl => libs/light}/gentest.py | 0 tools/{libxl => libs/light}/gentypes.py | 0 tools/{libxl => libs/light}/idl.py | 0 tools/{libxl => libs/light}/idl.txt | 0 tools/{libxl => libs/light/include}/libxl.h | 0 .../light/include}/libxl_event.h | 0 .../light/include}/libxl_json.h | 0 .../light/include}/libxl_utils.h | 0 .../light/include}/libxl_uuid.h | 0 tools/{libxl => libs/light}/libxl.c | 0 tools/{libxl => libs/light}/libxl_9pfs.c | 0 tools/{libxl => libs/light}/libxl_aoutils.c | 0 tools/{libxl => libs/light}/libxl_arch.h | 0 tools/{libxl => libs/light}/libxl_arm.c | 0 tools/{libxl => libs/light}/libxl_arm.h | 0 tools/{libxl => libs/light}/libxl_arm_acpi.c | 0 .../{libxl => libs/light}/libxl_arm_no_acpi.c | 0 .../{libxl => libs/light}/libxl_bootloader.c | 0 .../light}/libxl_checkpoint_device.c | 0 tools/{libxl => libs/light}/libxl_colo.h | 0 tools/{libxl => libs/light}/libxl_colo_nic.c | 0 .../{libxl => libs/light}/libxl_colo_proxy.c | 0 .../{libxl => libs/light}/libxl_colo_qdisk.c | 0 .../light}/libxl_colo_restore.c | 0 tools/{libxl => libs/light}/libxl_colo_save.c | 0 tools/{libxl => libs/light}/libxl_console.c | 0 .../light}/libxl_convert_callout.c | 0 tools/{libxl => libs/light}/libxl_cpuid.c | 0 tools/{libxl => libs/light}/libxl_cpupool.c | 0 tools/{libxl => libs/light}/libxl_create.c | 0 tools/{libxl => libs/light}/libxl_device.c | 0 tools/{libxl => libs/light}/libxl_disk.c | 0 tools/{libxl => libs/light}/libxl_dm.c | 0 tools/{libxl => libs/light}/libxl_dom.c | 0 tools/{libxl => libs/light}/libxl_dom_save.c | 0 .../{libxl => libs/light}/libxl_dom_suspend.c | 0 tools/{libxl => libs/light}/libxl_domain.c | 0 tools/{libxl => libs/light}/libxl_event.c | 0 tools/{libxl => libs/light}/libxl_exec.c | 0 tools/{libxl => libs/light}/libxl_flask.c | 0 tools/{libxl => libs/light}/libxl_fork.c | 0 tools/{libxl => libs/light}/libxl_freebsd.c | 0 tools/{libxl => libs/light}/libxl_genid.c | 0 tools/{libxl => libs/light}/libxl_internal.c | 0 tools/{libxl => libs/light}/libxl_internal.h | 0 tools/{libxl => libs/light}/libxl_json.c | 0 .../light}/libxl_libfdt_compat.c | 0 .../light}/libxl_libfdt_compat.h | 0 tools/{libxl => libs/light}/libxl_linux.c | 0 tools/{libxl => libs/light}/libxl_mem.c | 0 tools/{libxl => libs/light}/libxl_netbsd.c | 0 tools/{libxl => libs/light}/libxl_netbuffer.c | 0 tools/{libxl => libs/light}/libxl_nic.c | 0 tools/{libxl => libs/light}/libxl_no_colo.c | 0 .../light}/libxl_no_convert_callout.c | 0 tools/{libxl => libs/light}/libxl_nocpuid.c | 0 .../{libxl => libs/light}/libxl_nonetbuffer.c | 0 tools/{libxl => libs/light}/libxl_numa.c | 0 tools/{libxl => libs/light}/libxl_osdeps.h | 0 tools/{libxl => libs/light}/libxl_paths.c | 0 tools/{libxl => libs/light}/libxl_pci.c | 0 tools/{libxl => libs/light}/libxl_psr.c | 0 tools/{libxl => libs/light}/libxl_pvcalls.c | 0 tools/{libxl => libs/light}/libxl_qmp.c | 0 tools/{libxl => libs/light}/libxl_remus.c | 0 .../light}/libxl_remus_disk_drbd.c | 0 .../light}/libxl_save_callout.c | 0 .../{libxl => libs/light}/libxl_save_helper.c | 0 .../light}/libxl_save_msgs_gen.pl | 0 tools/{libxl => libs/light}/libxl_sched.c | 0 .../light}/libxl_sr_stream_format.h | 0 .../{libxl => libs/light}/libxl_stream_read.c | 0 .../light}/libxl_stream_write.c | 0 .../light}/libxl_test_fdevent.c | 0 .../light}/libxl_test_fdevent.h | 0 .../light}/libxl_test_timedereg.c | 0 .../light}/libxl_test_timedereg.h | 0 tools/{libxl => libs/light}/libxl_tmem.c | 0 tools/{libxl => libs/light}/libxl_types.idl | 0 .../light}/libxl_types_internal.idl | 0 tools/{libxl => libs/light}/libxl_usb.c | 0 tools/{libxl => libs/light}/libxl_utils.c | 0 tools/{libxl => libs/light}/libxl_uuid.c | 0 tools/{libxl => libs/light}/libxl_vdispl.c | 0 tools/{libxl => libs/light}/libxl_vkb.c | 0 tools/{libxl => libs/light}/libxl_vnuma.c | 0 tools/{libxl => libs/light}/libxl_vsnd.c | 0 tools/{libxl => libs/light}/libxl_vtpm.c | 0 tools/{libxl => libs/light}/libxl_x86.c | 0 tools/{libxl => libs/light}/libxl_x86_acpi.c | 0 tools/{libxl => libs/light}/libxl_x86_acpi.h | 0 tools/{libxl => libs/light}/libxl_xshelp.c | 0 tools/{libxl => libs/light}/osdeps.c | 0 tools/{libxl => libs/light}/test_common.c | 0 tools/{libxl => libs/light}/test_common.h | 0 .../{libxl => libs/light}/test_fdderegrace.c | 0 tools/{libxl => libs/light}/test_timedereg.c | 0 tools/{libxl => libs/light}/xenlight.pc.in | 0 tools/libs/uselibs.mk | 2 + tools/libxl/Makefile | 281 +-------------- tools/ocaml/libs/xl/Makefile | 8 +- 111 files changed, 658 insertions(+), 301 deletions(-) create mode 100644 tools/libs/light/CODING_STYLE create mode 100644 tools/libs/light/Makefile rename tools/{libxl => libs/light}/check-libxl-api-rules (100%) rename tools/{libxl => libs/light}/flexarray.c (100%) rename tools/{libxl => libs/light}/flexarray.h (100%) rename tools/{libxl => libs/light}/gentest.py (100%) rename tools/{libxl => libs/light}/gentypes.py (100%) rename tools/{libxl => libs/light}/idl.py (100%) rename tools/{libxl => libs/light}/idl.txt (100%) rename tools/{libxl => libs/light/include}/libxl.h (100%) rename tools/{libxl => libs/light/include}/libxl_event.h (100%) rename tools/{libxl => libs/light/include}/libxl_json.h (100%) rename tools/{libxl => libs/light/include}/libxl_utils.h (100%) rename tools/{libxl => libs/light/include}/libxl_uuid.h (100%) rename tools/{libxl => libs/light}/libxl.c (100%) rename tools/{libxl => libs/light}/libxl_9pfs.c (100%) rename tools/{libxl => libs/light}/libxl_aoutils.c (100%) rename tools/{libxl => libs/light}/libxl_arch.h (100%) rename tools/{libxl => libs/light}/libxl_arm.c (100%) rename tools/{libxl => libs/light}/libxl_arm.h (100%) rename tools/{libxl => libs/light}/libxl_arm_acpi.c (100%) rename tools/{libxl => libs/light}/libxl_arm_no_acpi.c (100%) rename tools/{libxl => libs/light}/libxl_bootloader.c (100%) rename tools/{libxl => libs/light}/libxl_checkpoint_device.c (100%) rename tools/{libxl => libs/light}/libxl_colo.h (100%) rename tools/{libxl => libs/light}/libxl_colo_nic.c (100%) rename tools/{libxl => libs/light}/libxl_colo_proxy.c (100%) rename tools/{libxl => libs/light}/libxl_colo_qdisk.c (100%) rename tools/{libxl => libs/light}/libxl_colo_restore.c (100%) rename tools/{libxl => libs/light}/libxl_colo_save.c (100%) rename tools/{libxl => libs/light}/libxl_console.c (100%) rename tools/{libxl => libs/light}/libxl_convert_callout.c (100%) rename tools/{libxl => libs/light}/libxl_cpuid.c (100%) rename tools/{libxl => libs/light}/libxl_cpupool.c (100%) rename tools/{libxl => libs/light}/libxl_create.c (100%) rename tools/{libxl => libs/light}/libxl_device.c (100%) rename tools/{libxl => libs/light}/libxl_disk.c (100%) rename tools/{libxl => libs/light}/libxl_dm.c (100%) rename tools/{libxl => libs/light}/libxl_dom.c (100%) rename tools/{libxl => libs/light}/libxl_dom_save.c (100%) rename tools/{libxl => libs/light}/libxl_dom_suspend.c (100%) rename tools/{libxl => libs/light}/libxl_domain.c (100%) rename tools/{libxl => libs/light}/libxl_event.c (100%) rename tools/{libxl => libs/light}/libxl_exec.c (100%) rename tools/{libxl => libs/light}/libxl_flask.c (100%) rename tools/{libxl => libs/light}/libxl_fork.c (100%) rename tools/{libxl => libs/light}/libxl_freebsd.c (100%) rename tools/{libxl => libs/light}/libxl_genid.c (100%) rename tools/{libxl => libs/light}/libxl_internal.c (100%) rename tools/{libxl => libs/light}/libxl_internal.h (100%) rename tools/{libxl => libs/light}/libxl_json.c (100%) rename tools/{libxl => libs/light}/libxl_libfdt_compat.c (100%) rename tools/{libxl => libs/light}/libxl_libfdt_compat.h (100%) rename tools/{libxl => libs/light}/libxl_linux.c (100%) rename tools/{libxl => libs/light}/libxl_mem.c (100%) rename tools/{libxl => libs/light}/libxl_netbsd.c (100%) rename tools/{libxl => libs/light}/libxl_netbuffer.c (100%) rename tools/{libxl => libs/light}/libxl_nic.c (100%) rename tools/{libxl => libs/light}/libxl_no_colo.c (100%) rename tools/{libxl => libs/light}/libxl_no_convert_callout.c (100%) rename tools/{libxl => libs/light}/libxl_nocpuid.c (100%) rename tools/{libxl => libs/light}/libxl_nonetbuffer.c (100%) rename tools/{libxl => libs/light}/libxl_numa.c (100%) rename tools/{libxl => libs/light}/libxl_osdeps.h (100%) rename tools/{libxl => libs/light}/libxl_paths.c (100%) rename tools/{libxl => libs/light}/libxl_pci.c (100%) rename tools/{libxl => libs/light}/libxl_psr.c (100%) rename tools/{libxl => libs/light}/libxl_pvcalls.c (100%) rename tools/{libxl => libs/light}/libxl_qmp.c (100%) rename tools/{libxl => libs/light}/libxl_remus.c (100%) rename tools/{libxl => libs/light}/libxl_remus_disk_drbd.c (100%) rename tools/{libxl => libs/light}/libxl_save_callout.c (100%) rename tools/{libxl => libs/light}/libxl_save_helper.c (100%) rename tools/{libxl => libs/light}/libxl_save_msgs_gen.pl (100%) rename tools/{libxl => libs/light}/libxl_sched.c (100%) rename tools/{libxl => libs/light}/libxl_sr_stream_format.h (100%) rename tools/{libxl => libs/light}/libxl_stream_read.c (100%) rename tools/{libxl => libs/light}/libxl_stream_write.c (100%) rename tools/{libxl => libs/light}/libxl_test_fdevent.c (100%) rename tools/{libxl => libs/light}/libxl_test_fdevent.h (100%) rename tools/{libxl => libs/light}/libxl_test_timedereg.c (100%) rename tools/{libxl => libs/light}/libxl_test_timedereg.h (100%) rename tools/{libxl => libs/light}/libxl_tmem.c (100%) rename tools/{libxl => libs/light}/libxl_types.idl (100%) rename tools/{libxl => libs/light}/libxl_types_internal.idl (100%) rename tools/{libxl => libs/light}/libxl_usb.c (100%) rename tools/{libxl => libs/light}/libxl_utils.c (100%) rename tools/{libxl => libs/light}/libxl_uuid.c (100%) rename tools/{libxl => libs/light}/libxl_vdispl.c (100%) rename tools/{libxl => libs/light}/libxl_vkb.c (100%) rename tools/{libxl => libs/light}/libxl_vnuma.c (100%) rename tools/{libxl => libs/light}/libxl_vsnd.c (100%) rename tools/{libxl => libs/light}/libxl_vtpm.c (100%) rename tools/{libxl => libs/light}/libxl_x86.c (100%) rename tools/{libxl => libs/light}/libxl_x86_acpi.c (100%) rename tools/{libxl => libs/light}/libxl_x86_acpi.h (100%) rename tools/{libxl => libs/light}/libxl_xshelp.c (100%) rename tools/{libxl => libs/light}/osdeps.c (100%) rename tools/{libxl => libs/light}/test_common.c (100%) rename tools/{libxl => libs/light}/test_common.h (100%) rename tools/{libxl => libs/light}/test_fdderegrace.c (100%) rename tools/{libxl => libs/light}/test_timedereg.c (100%) rename tools/{libxl => libs/light}/xenlight.pc.in (100%) diff --git a/.gitignore b/.gitignore index 44abbc7e43..94af7a4aee 100644 --- a/.gitignore +++ b/.gitignore @@ -128,6 +128,22 @@ tools/libs/guest/xc_core.h tools/libs/guest/xc_core_arm.h tools/libs/guest/xc_core_x86.h tools/libs/guest/xc_private.h +tools/libs/light/_*.[ch] +tools/libs/light/*.pyc +tools/libs/light/_libxl.api-for-check +tools/libs/light/*.api-ok +tools/libs/light/libxenlight.map +tools/libs/light/libxl-save-helper +tools/libs/light/dsdt* +tools/libs/light/mk_dsdt +tools/libs/light/ssdt* +tools/libs/light/testidl +tools/libs/light/testidl.c +tools/libs/light/test_timedereg +tools/libs/light/test_fdderegrace +tools/libs/light/tmp.* +tools/libs/light/xenlight.pc +tools/libs/light/include/_*.h tools/libs/stat/_paths.h tools/libs/stat/headers.chk tools/libs/stat/libxenstat.map @@ -216,16 +232,8 @@ tools/include/xen/* tools/include/xen-xsm/* tools/include/xen-foreign/*.(c|h|size) tools/include/xen-foreign/checker -tools/libxl/_libxl.api-for-check -tools/libxl/*.api-ok tools/libxl/*.pc -tools/libxl/dsdt* tools/libxl/libxlu_cfg_y.output -tools/libxl/mk_dsdt -tools/libxl/ssdt* -tools/libxl/testenum -tools/libxl/testenum.c -tools/libxl/tmp.* tools/misc/cpuperf/cpuperf-perfcntr tools/misc/cpuperf/cpuperf-xen tools/misc/xc_shadow @@ -379,13 +387,6 @@ tools/include/xen-foreign/arm64.h tools/misc/xen-hptool tools/misc/xen-mfndump tools/libs/toolcore/include/_*.h -tools/libxl/_*.[ch] -tools/libxl/testidl -tools/libxl/testidl.c -tools/libxl/*.pyc -tools/libxl/libxl-save-helper -tools/libxl/test_timedereg -tools/libxl/test_fdderegrace tools/firmware/etherboot/eb-roms.h tools/firmware/etherboot/gpxe-git-snapshot.tar.gz tools/misc/xenhypfs diff --git a/tools/Rules.mk b/tools/Rules.mk index 241e8e7d9a..8ecaf063b5 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -15,9 +15,7 @@ XEN_INCLUDE = $(XEN_ROOT)/tools/include include $(XEN_ROOT)/tools/libs/uselibs.mk -XEN_libxenlight = $(XEN_ROOT)/tools/libxl -# Currently libxlutil lives in the same directory as libxenlight -XEN_libxlutil = $(XEN_libxenlight) +XEN_libxlutil = $(XEN_ROOT)/tools/libxl CFLAGS_xeninclude = -I$(XEN_INCLUDE) @@ -107,6 +105,8 @@ ifeq ($(CONFIG_Linux),y) LDLIBS_libxenstore += -ldl endif +CFLAGS_libxenlight += $(CFLAGS_libxenctrl) + ifeq ($(debug),y) # Disable optimizations CFLAGS += -O0 -fno-omit-frame-pointer @@ -116,11 +116,6 @@ else CFLAGS += -O2 -fomit-frame-pointer endif -CFLAGS_libxenlight = -I$(XEN_libxenlight) $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude) -SHDEPS_libxenlight = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenhypfs) $(SHLIB_libxenguest) -LDLIBS_libxenlight = $(SHDEPS_libxenlight) $(XEN_libxenlight)/libxenlight$(libextension) -SHLIB_libxenlight = $(SHDEPS_libxenlight) -Wl,-rpath-link=$(XEN_libxenlight) - CFLAGS_libxlutil = -I$(XEN_libxlutil) SHDEPS_libxlutil = $(SHLIB_libxenlight) LDLIBS_libxlutil = $(SHDEPS_libxlutil) $(XEN_libxlutil)/libxlutil$(libextension) diff --git a/tools/configure b/tools/configure index edcdcf4f73..8a708e9baa 100755 --- a/tools/configure +++ b/tools/configure @@ -585,7 +585,7 @@ PACKAGE_STRING='Xen Hypervisor Tools 4.15' PACKAGE_BUGREPORT='xen-devel@lists.xen.org' PACKAGE_URL='https://www.xen.org/' -ac_unique_file="libxl/libxl.c" +ac_unique_file="libs/light/libxl.c" # Factoring default headers for most tests. ac_includes_default="\ #include diff --git a/tools/configure.ac b/tools/configure.ac index 6614a4f130..ee8ba5ff24 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -4,7 +4,7 @@ AC_PREREQ([2.67]) AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]), [xen-devel@lists.xen.org], [xen], [https://www.xen.org/]) -AC_CONFIG_SRCDIR([libxl/libxl.c]) +AC_CONFIG_SRCDIR([libs/light/libxl.c]) AC_CONFIG_FILES([ ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons diff --git a/tools/libs/Makefile b/tools/libs/Makefile index e8fcd59214..c41455c604 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -15,6 +15,7 @@ SUBDIRS-y += hypfs SUBDIRS-y += store SUBDIRS-y += stat SUBDIRS-$(CONFIG_Linux) += vchan +SUBDIRS-y += light ifeq ($(CONFIG_RUMP),y) SUBDIRS-y := toolcore diff --git a/tools/libs/light/CODING_STYLE b/tools/libs/light/CODING_STYLE new file mode 100644 index 0000000000..3d572f6925 --- /dev/null +++ b/tools/libs/light/CODING_STYLE @@ -0,0 +1,330 @@ +LIBXENLIGHT CODING STYLE +======================== + + +AN APOLOGY AND WARNING +---------------------- + +Much of the code in libxl does not yet follow this coding style +document in every respect. However, new code is expected to conform. + +Patches to improve the style of existing code are welcome. Please +separate these out from functional changes. + +If it is not feasible to conform fully to the style while patching old +code, without doing substantial style reengineering first, we may +accept patches which contain nonconformant elements, provided that +they don't make the coding style problem worse overall. + +In this case, the new code should conform to the prevailing style in +the area being touched. + + +MEMORY ALLOCATION +----------------- + +Memory allocation for libxl-internal purposes should normally be done +with the provided gc mechanisms; there is then no need to free. See +"libxl memory management" in libxl.h. + + +CONVENTIONAL VARIABLE NAMES +--------------------------- + +The following local variable names should be used where applicable: + + int rc; /* a libxl error code - and not anything else */ + int r; /* the return value from a system call (or libxc call) */ + bool ok; /* the success return value from a boolean function */ + + uint32_t domid; + libxl__gc *gc; + libxl__egc *egc; + libxl__ao *ao; + + libxl_foo_bar_state *fbs; /* local variable */ + libxl_foo_bar_state foo_bar; /* inside another state struct */ + + +CONVENIENCE MACROS +------------------ + +There are a number of convenience macros which shorten the program and +avoid opportunity for mistakes. In some cases non-use of the macros +produces functional bugs or incorrect error handling. Use the macros +whenever they are applicable. For example: + + Usually, don't use: Instead, use (see libxl_internal.h): + libxl__log[v] LOG, LOGE, LOGEV + libxl__sprintf GCSPRINTF + libxl__*alloc et al. GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY + isalnum etc. directly CTYPE + libxl__ctx_[un]lock CTX_LOCK, CTX_UNLOCK + gc=...; ao=...; EGC_GC, AO_GC, STATE_AO_GC + explicit gc creation GC_INIT, GC_FREE + memset(..,0,sizeof..) FILLZERO + +Instead of malloc et al one should (as an exception to the above) use +libxl__{zalloc,calloc,realloc} etc but passing NOGC. + +ERROR HANDLING +-------------- + +Unless, there are good reasons to do otherwise, the following error +handling and cleanup paradigm should be used: + + * All local variables referring to resources which might need + cleaning up are declared at the top of the function, and + initialised to a sentinel value indicating "nothing allocated". + For example, + libxl_evgen_disk_eject *evg = NULL; + int nullfd = -1; + + * If the function is to return a libxl error value, `rc' is + used to contain the error code, but it is NOT initialised: + int rc; + + * There is only one error cleanup path out of the function. It + starts with a label `out:'. That error cleanup path checks for + each allocated resource and frees it iff necessary. It then + returns rc. For example, + out: + if (evg) libxl__evdisable_disk_eject(gc, evg); + if (nullfd >= 0) close(nullfd); + return rc; + + * Function calls which might fail (ie most function calls) are + handled by putting the return/status value into a variable, and + then checking it in a separate statement: + char *dompath = libxl__xs_get_dompath(gc, bl->domid); + if (!dompath) { rc = ERROR_FAIL; goto out; } + + * If a resource is freed in the main body of the function (for + example, in a loop), the corresponding variable has to be reset to + the sentinel at the point where it's freed. + +Whether to use the `out' path for successful returns as well as error +returns is a matter of taste and convenience for the specific +function. Not reusing the out path is fine if the duplicated function +exit code is only `CTX_UNLOCK; GC_FREE;' (or similar). + +If you reuse the `out' path for successful returns, there may be +resources which are to be returned to the caller rather than freed. +In that case you have to reset the local variable to `nothing here', +to avoid the resource being freed on the out path. That resetting +should be done immediately after the resource value is stored at the +applicable _r function parameter (or equivalent). Do not test `rc' in +the out section, to discover whether to free things. + +The uses of the single-line formatting in the examples above are +permitted exceptions to the usual libxl code formatting rules. + + + +IDEMPOTENT DATA STRUCTURE CONSTRUCTION/DESTRUCTION +-------------------------------------------------- + +Nontrivial data structures (in structs) should come with an idempotent +_dispose function, which must free all resources associated with the +data structure (but not free the struct itself). + +Such a struct should also come with an _init function which +initialises the struct so that _dispose is a no-op. + + +ASYNCHRONOUS/LONG-RUNNING OPERATIONS +------------------------------------ + +All long-running operations in libxl need to use the asynchronous +operation machinery. Consult the programmer documentation in +libxl_internal.h for details - search for "Machinery for asynchronous +operations". + +The code for asynchronous operations should be laid out in +chronological order. That is, where there is a chain of callback +functions, each subsequent function should be, textually, the next +function in the file. This will normally involve predeclaring the +callback functions. Synchronous helper functions should be separated +out into a section preceding the main callback chain. + +Control flow arrangements in asynchronous operations should be made as +simple as possible, because it can otherwise be very hard to see +through the tangle. + + +When inventing a new sub-operation in asynchronous code, consider +whether to structure it formally as a sub-operation with its own state +structure. (See, for example, libxl__datacopier_*.) + +An ao-suboperation state structure should contain, in this order: + * fields that the caller must fill in, and which are, + effectively, the parameters to the operation, including: + - libxl__ao *ao + - the callback function pointer(s), which + should be named callback or callback_*. + * shared information fields or ones used for returning information + to the calling operation + * private fields +These sections should be clearly demarcated by comments. + +An asynchronous operation should normally have an idempotent stop or +cancel function. It should normally also have an _init function for +its state struct, which arranges that the stop is a no-op. + +The permitted order of calls into your ao operation's methods must be +documented in comments, if it is nontrivial. + + +When using an ao sub-operation, you should normally: + * Physically include the sub-operation state struct in your + own state struct; + * Use CONTAINER_OF to find your own state struct at the start of + your implementations of the sub-operation callback functions; + * Unconditionally initialise the sub-operation's struct (with its + _init method) in your own _init method. + * Unconditionally cancel or destroy the sub-operation in your own + cancel or destroy method. + + +FORMATTING AND NAMING +--------------------- + +Blatantly copied from qemu and linux with few modifications. + + +1. Whitespace + +Of course, the most important aspect in any coding style is whitespace. +Crusty old coders who have trouble spotting the glasses on their noses +can tell the difference between a tab and eight spaces from a distance +of approximately fifteen parsecs. Many a flamewar have been fought and +lost on this issue. + +Libxenlight indents are four spaces. Tabs are never used, except in +Makefiles where they have been irreversibly coded into the syntax. +Spaces of course are superior to tabs because: + + - You have just one way to specify whitespace, not two. Ambiguity breeds + mistakes. + - The confusion surrounding 'use tabs to indent, spaces to justify' is gone. + - Tab indents push your code to the right, making your screen seriously + unbalanced. + - Tabs will be rendered incorrectly on editors who are misconfigured not + to use tab stops of eight positions. + - Tabs are rendered badly in patches, causing off-by-one errors in almost + every line. + - It is the libxenlight coding style. + +Do not leave whitespace dangling off the ends of lines. + + +2. Line width + +Lines are limited to 75 characters. + +Rationale: + - Some people like to tile their 24" screens with a 6x4 matrix of 80x24 + xterms and use vi in all of them. The best way to punish them is to + let them keep doing it. + - In an 80 column terminal, some room needs to be left for > quoting + characters, +/- diff characters, and so on, in emails. + - Code and especially patches is much more readable if limited to a sane + line length. Eighty is traditional. + - It is the libxenlight coding style. + + +3. Naming + +C is a Spartan language, and so should your naming be. Unlike Modula-2 +and Pascal programmers, C programmers do not use cute names like +ThisVariableIsATemporaryCounter. A C programmer would call that +variable "tmp", which is much easier to write, and not the least more +difficult to understand. + +HOWEVER, while mixed-case names are frowned upon, descriptive names for +global variables are a must. To call a global function "foo" is a +shooting offense. + +GLOBAL variables (to be used only if you _really_ need them) need to +have descriptive names, as do global functions. If you have a function +that counts the number of active users, you should call that +"count_active_users()" or similar, you should _not_ call it "cntusr()". + +Encoding the type of a function into the name (so-called Hungarian +notation) is brain damaged - the compiler knows the types anyway and can +check those, and it only confuses the programmer. + +LOCAL variable names should be short, and to the point. If you have +some random integer loop counter, it should probably be called "i". +Calling it "loop_counter" is non-productive, if there is no chance of it +being mis-understood. Similarly, "tmp" can be just about any type of +variable that is used to hold a temporary value. + +Local variables used to store return values should have descriptive name +like "rc" or "ret". Following the same reasoning the label used as exit +path should be called "out". + +Function arguments which are used to return values to the caller +should be suffixed `_r' or `_out'. + +Variables, type names and function names are +lower_case_with_underscores. +Type names and function names use the prefix libxl__ when internal to +libxenlight and libxl_ when exported in libxl.h. +Xl should avoid using libxl_ and libxl__ as prefix for its own function +names. + +When wrapping standard library functions, use the prefix libxl_ to alert +readers that they are seeing a wrapped version; otherwise avoid this prefix. + +Typedefs are used to eliminate the redundant 'struct' keyword. +It is the libxenlight coding style. + + +4. Statements + +Don't put multiple statements on a single line. +Don't put multiple assignments on a single line either. +Error code paths with an if statement and a goto or a return on the same +line are allowed. Examples: + + if (rc) goto out; + if (rc < 0) return; + +Libxenlight coding style is super simple. Avoid tricky expressions. + + +5. Block structure + +Every indented statement is braced, but blocks that contain just one +statement may have the braces omitted. To avoid confusion, either all +the blocks in an if...else chain have braces, or none of them do. + +The opening brace is on the line that contains the control flow +statement that introduces the new block; the closing brace is on the +same line as the else keyword, or on a line by itself if there is no +else keyword. Examples: + + if (a == 5) { + printf("a was 5.\n"); + } else if (a == 6) { + printf("a was 6.\n"); + } else { + printf("a was something else entirely.\n"); + } + + if (a == 5) + printf("a was 5.\n"); + +An exception is the opening brace for a function; for reasons of tradition +and clarity it comes on a line by itself: + + void a_function(void) + { + do_something(); + } + +Rationale: a consistent (except for functions...) bracing style reduces +ambiguity and avoids needless churn when lines are added or removed. +Furthermore, it is the libxenlight coding style. + diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile new file mode 100644 index 0000000000..a8a715a4da --- /dev/null +++ b/tools/libs/light/Makefile @@ -0,0 +1,291 @@ +XEN_ROOT = $(CURDIR)/../../.. +include $(XEN_ROOT)/tools/Rules.mk + +SRCS-y += osdeps.c +SRCS-y += libxl_paths.c +SRCS-y += libxl_bootloader.c +SRCS-y += flexarray.c +ifeq ($(CONFIG_LIBNL),y) +SRCS-y += libxl_netbuffer.c +else +SRCS-y += libxl_nonetbuffer.c +endif +ifeq ($(CONFIG_X86),y) +SRCS-y += libxl_convert_callout.c +else +SRCS-y += libxl_no_convert_callout.c +endif +SRCS-y += libxl_remus.c +SRCS-y += libxl_checkpoint_device.c +SRCS-y += libxl_remus_disk_drbd.c +ifeq ($(CONFIG_LIBNL),y) +SRCS-y += libxl_colo_restore.c +SRCS-y += libxl_colo_save.c +SRCS-y += libxl_colo_qdisk.c +SRCS-y += libxl_colo_proxy.c +SRCS-y += libxl_colo_nic.c +else +SRCS-y += libxl_no_colo.c +endif + +ACPI_PATH = $(XEN_ROOT)/tools/libacpi +DSDT_FILES-$(CONFIG_X86) = dsdt_pvh.c +ACPI_OBJS = $(patsubst %.c,%.o,$(DSDT_FILES-y)) build.o static_tables.o +ACPI_PIC_OBJS = $(patsubst %.o,%.opic,$(ACPI_OBJS)) +$(DSDT_FILES-y): acpi +vpath build.c $(ACPI_PATH)/ +vpath static_tables.c $(ACPI_PATH)/ + +.PHONY: acpi +acpi: + $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) DSDT_FILES="$(DSDT_FILES-y)" + +SRCS-$(CONFIG_X86) += $(ACPI_OBJS:.o=.c) + +CFLAGS += -Wno-format-zero-length -Wmissing-declarations \ + -Wno-declaration-after-statement -Wformat-nonliteral +CFLAGS += -I. + +SRCS-$(CONFIG_X86) += libxl_cpuid.c +SRCS-$(CONFIG_X86) += libxl_x86.c +SRCS-$(CONFIG_X86) += libxl_psr.c +SRCS-$(CONFIG_X86) += libxl_x86_acpi.c +SRCS-$(CONFIG_ARM) += libxl_nocpuid.c +SRCS-$(CONFIG_ARM) += libxl_arm.c +SRCS-$(CONFIG_ARM) += libxl_libfdt_compat.c +ifeq ($(CONFIG_ARM_64),y) +DSDT_FILES-y = dsdt_anycpu_arm.c +SRCS-y += libxl_arm_acpi.c +SRCS-y += $(DSDT_FILES-y) +dsdt_anycpu_arm.c: + $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) DSDT_FILES="$(DSDT_FILES-y)" +else +SRCS-$(CONFIG_ARM) += libxl_arm_no_acpi.c +endif + +SRCS-OS-$(CONFIG_NetBSD) = libxl_netbsd.c +SRCS-OS-$(CONFIG_Linux) = libxl_linux.c +SRCS-OS-$(CONFIG_FreeBSD) = libxl_freebsd.c +ifeq ($(SRCS-OS-y),) +$(error Your Operating System is not supported by libxenlight, \ +please check libxl_linux.c and libxl_netbsd.c to see how to get it ported) +endif +SRCS-y += $(SRCS-OS-y) + +SRCS-y += libxl.c +SRCS-y += libxl_create.c +SRCS-y += libxl_dm.c +SRCS-y += libxl_pci.c +SRCS-y += libxl_dom.c +SRCS-y += libxl_exec.c +SRCS-y += libxl_xshelp.c +SRCS-y += libxl_device.c +SRCS-y += libxl_internal.c +SRCS-y += libxl_utils.c +SRCS-y += libxl_uuid.c +SRCS-y += libxl_json.c +SRCS-y += libxl_aoutils.c +SRCS-y += libxl_numa.c +SRCS-y += libxl_vnuma.c +SRCS-y += libxl_stream_read.c +SRCS-y += libxl_stream_write.c +SRCS-y += libxl_save_callout.c +SRCS-y += _libxl_save_msgs_callout.c +SRCS-y += libxl_qmp.c +SRCS-y += libxl_event.c +SRCS-y += libxl_fork.c +SRCS-y += libxl_dom_suspend.c +SRCS-y += libxl_dom_save.c +SRCS-y += libxl_usb.c +SRCS-y += libxl_vtpm.c +SRCS-y += libxl_nic.c +SRCS-y += libxl_disk.c +SRCS-y += libxl_console.c +SRCS-y += libxl_cpupool.c +SRCS-y += libxl_mem.c +SRCS-y += libxl_sched.c +SRCS-y += libxl_tmem.c +SRCS-y += libxl_9pfs.c +SRCS-y += libxl_domain.c +SRCS-y += libxl_vdispl.c +SRCS-y += libxl_pvcalls.c +SRCS-y += libxl_vsnd.c +SRCS-y += libxl_vkb.c +SRCS-y += libxl_genid.c +SRCS-y += _libxl_types.c +SRCS-y += libxl_flask.c +SRCS-y += _libxl_types_internal.c + +ifeq ($(CONFIG_LIBNL),y) +CFLAGS_LIBXL += $(LIBNL3_CFLAGS) +endif +CFLAGS_LIBXL += -Wshadow +ifeq ($(debug),y) +CFLAGS_LIBXL += -DCONFIG_DEBUG +endif + +CFLAGS += $(PTHREAD_CFLAGS) +LDFLAGS += $(PTHREAD_LDFLAGS) + +LIBXL_TESTS += timedereg +LIBXL_TESTS_PROGS = $(LIBXL_TESTS) fdderegrace +LIBXL_TESTS_INSIDE = $(LIBXL_TESTS) fdevent + +# Each entry FOO in LIBXL_TESTS has two main .c files: +# libxl_test_FOO.c "inside libxl" code to support the test case +# test_FOO.c "outside libxl" code to exercise the test case +# Conventionally there will also be: +# libxl_test_FOO.h interface between the "inside" and "outside" parts +# The "inside libxl" file is compiled exactly like a piece of libxl, and the +# "outside libxl" file is compiled exactly like a piece of application +# code. They must share information via explicit libxl entrypoints. +# Unlike proper parts of libxl, it is permissible for libxl_test_FOO.c +# to use private global variables for its state. Note that all the +# "inside" parts are compiled into a single test library, so their +# symbol names must be unique. +# +# To run these tests, either use LD_PRELOAD to get libxenlight_test.so +# loaded, or rename it to libxenlight.so so it is the target of the +# appropriate symlinks. + +LIBXL_TEST_OBJS += $(foreach t, $(LIBXL_TESTS_INSIDE),libxl_test_$t.opic) +TEST_PROG_OBJS += $(foreach t, $(LIBXL_TESTS_PROGS),test_$t.o) test_common.o +TEST_PROGS += $(foreach t, $(LIBXL_TESTS_PROGS),test_$t) + +AUTOINCS = _libxl_list.h _paths.h _libxl_save_msgs_callout.h _libxl_save_msgs_helper.h +AUTOSRCS = _libxl_save_msgs_callout.c _libxl_save_msgs_helper.c + +CLIENTS = testidl libxl-save-helper + +SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o + +LIBHEADER := libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h + +NO_HEADERS_CHK := y + +include $(XEN_ROOT)/tools/libs/libs.mk + +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(CURDIR) +$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) + +LDUSELIBS-y += $(PTYFUNCS_LIBS) +LDUSELIBS-$(CONFIG_LIBNL) += $(LIBNL3_LIBS) +LDUSELIBS-$(CONFIG_Linux) += -luuid +LDUSELIBS-$(CONFIG_Linux) += -lrt +LDUSELIBS-$(CONFIG_ARM) += -lfdt +LDUSELIBS-y += $(PTHREAD_LIBS) +LDUSELIBS-y += -lyajl +LDUSELIBS += $(LDUSELIBS-y) + +$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h +$(ACPI_OBJS) $(ACPI_PIC_OBJS): CFLAGS += -I. -DLIBACPI_STDUTILS=\"$(CURDIR)/libxl_x86_acpi.h\" +$(TEST_PROG_OBJS) _libxl.api-for-check: CFLAGS += $(CFLAGS_libxentoollog) $(CFLAGS_libxentoolcore) +libxl_dom.o libxl_dom.opic: CFLAGS += -I$(XEN_ROOT)/tools # include libacpi/x86.h +libxl_x86_acpi.o libxl_x86_acpi.opic: CFLAGS += -I$(XEN_ROOT)/tools +$(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn) $(CFLAGS_libxenguest) + +testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight) +testidl.c: libxl_types.idl gentest.py include/libxl.h $(AUTOINCS) + $(PYTHON) gentest.py libxl_types.idl testidl.c.new + mv testidl.c.new testidl.c + +build: $(CLIENTS) $(TEST_PROGS) $(AUTOSRCS) $(AUTOINCS) idl-external + +$(LIB_OBJS) $(PIC_OBJS) $(SAVE_HELPER_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): $(AUTOINCS) libxl.api-ok + +genpath-target = $(call buildmakevars2header,_paths.h) +$(eval $(genpath-target)) + +libxl.api-ok: check-libxl-api-rules _libxl.api-for-check + $(PERL) $^ + touch $@ + +_%.api-for-check: include/%.h $(AUTOINCS) + $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \ + -DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \ + >$@.new + mv -f $@.new $@ + +_libxl_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h + $(PERL) $^ --prefix=libxl >$@.new + $(call move-if-changed,$@.new,$@) + +_libxl_save_msgs_helper.c _libxl_save_msgs_callout.c \ +_libxl_save_msgs_helper.h _libxl_save_msgs_callout.h: \ + libxl_save_msgs_gen.pl + $(PERL) -w $< $@ >$@.new + $(call move-if-changed,$@.new,$@) + +include/libxl.h: _libxl_types.h _libxl_list.h +include/libxl_json.h: _libxl_types_json.h +libxl_internal.h: _libxl_types_internal.h _libxl_types_private.h _libxl_types_internal_private.h _paths.h +libxl_internal_json.h: _libxl_types_internal_json.h +xl.h: _paths.h + +$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): include/libxl.h +$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h + +_libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py + $(eval stem = $(notdir $*)) + $(PYTHON) gentypes.py libxl_type$(stem).idl __libxl_type$(stem).h __libxl_type$(stem)_private.h \ + __libxl_type$(stem)_json.h __libxl_type$(stem).c + $(call move-if-changed,__libxl_type$(stem).h,_libxl_type$(stem).h) + $(call move-if-changed,__libxl_type$(stem)_private.h,_libxl_type$(stem)_private.h) + $(call move-if-changed,__libxl_type$(stem)_json.h,_libxl_type$(stem)_json.h) + $(call move-if-changed,__libxl_type$(stem).c,_libxl_type$(stem).c) + +include/_%.h: _%.h + cp $< $@ + +# NOTE: This is safe to do at the moment because idl-external and +# idl-gen are only called from libxl/Makefile:all, which must return +# before golang/Makefile is callid. idl-external and idl-gen must +# never be called from another part of the make system without careful thought +# about races with tools/golang/xenlight/Makefile:all +.PHONY: idl-external +idl-external: + $(MAKE) -C $(XEN_ROOT)/tools/golang/xenlight idl-gen + +LIBXL_IDLGEN_FILES = include/_libxl_types.h include/_libxl_types_json.h _libxl_types_private.h _libxl_types.c \ + _libxl_types_internal.h _libxl_types_internal_json.h _libxl_types_internal_private.h _libxl_types_internal.c + +idl-gen: $(LIBXL_GEN_FILES) idl-external + +libxenlight_test.so: $(PIC_OBJS) $(LIBXL_TEST_OBJS) + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDUSELIBS) $(APPEND_LDFLAGS) + +test_%: test_%.o test_common.o libxenlight_test.so + $(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) -lyajl $(APPEND_LDFLAGS) + +libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so + $(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS) + +testidl: testidl.o libxenlight.so + $(CC) $(LDFLAGS) -o $@ testidl.o $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS) + +install: installlocal $(LIBHEADERS) + +.PHONY: installlocal +installlocal: + $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN) + $(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN) + +uninstall: uninstalllocal + +.PHONY: uninstalllocal +uninstalllocal: + rm -f $(DESTDIR)$(LIBEXEC_BIN)/libxl-save-helper + +clean: cleanlocal + +.PHONY: cleanlocal +cleanlocal: + $(RM) -f $(LIBXL_IDLGEN_FILES) *.o $(CLIENTS) + $(RM) -f *.pyc _paths.*.tmp _*.api-for-check + $(RM) -f testidl.c.new testidl.c *.api-ok + $(RM) -f $(TEST_PROGS) + $(RM) -rf __pycache__ + $(RM) -f include/_*.h + $(RM) -f libxenlight.map + $(RM) -f $(AUTOSRCS) $(AUTOINCS) + $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) clean diff --git a/tools/libxl/check-libxl-api-rules b/tools/libs/light/check-libxl-api-rules similarity index 100% rename from tools/libxl/check-libxl-api-rules rename to tools/libs/light/check-libxl-api-rules diff --git a/tools/libxl/flexarray.c b/tools/libs/light/flexarray.c similarity index 100% rename from tools/libxl/flexarray.c rename to tools/libs/light/flexarray.c diff --git a/tools/libxl/flexarray.h b/tools/libs/light/flexarray.h similarity index 100% rename from tools/libxl/flexarray.h rename to tools/libs/light/flexarray.h diff --git a/tools/libxl/gentest.py b/tools/libs/light/gentest.py similarity index 100% rename from tools/libxl/gentest.py rename to tools/libs/light/gentest.py diff --git a/tools/libxl/gentypes.py b/tools/libs/light/gentypes.py similarity index 100% rename from tools/libxl/gentypes.py rename to tools/libs/light/gentypes.py diff --git a/tools/libxl/idl.py b/tools/libs/light/idl.py similarity index 100% rename from tools/libxl/idl.py rename to tools/libs/light/idl.py diff --git a/tools/libxl/idl.txt b/tools/libs/light/idl.txt similarity index 100% rename from tools/libxl/idl.txt rename to tools/libs/light/idl.txt diff --git a/tools/libxl/libxl.h b/tools/libs/light/include/libxl.h similarity index 100% rename from tools/libxl/libxl.h rename to tools/libs/light/include/libxl.h diff --git a/tools/libxl/libxl_event.h b/tools/libs/light/include/libxl_event.h similarity index 100% rename from tools/libxl/libxl_event.h rename to tools/libs/light/include/libxl_event.h diff --git a/tools/libxl/libxl_json.h b/tools/libs/light/include/libxl_json.h similarity index 100% rename from tools/libxl/libxl_json.h rename to tools/libs/light/include/libxl_json.h diff --git a/tools/libxl/libxl_utils.h b/tools/libs/light/include/libxl_utils.h similarity index 100% rename from tools/libxl/libxl_utils.h rename to tools/libs/light/include/libxl_utils.h diff --git a/tools/libxl/libxl_uuid.h b/tools/libs/light/include/libxl_uuid.h similarity index 100% rename from tools/libxl/libxl_uuid.h rename to tools/libs/light/include/libxl_uuid.h diff --git a/tools/libxl/libxl.c b/tools/libs/light/libxl.c similarity index 100% rename from tools/libxl/libxl.c rename to tools/libs/light/libxl.c diff --git a/tools/libxl/libxl_9pfs.c b/tools/libs/light/libxl_9pfs.c similarity index 100% rename from tools/libxl/libxl_9pfs.c rename to tools/libs/light/libxl_9pfs.c diff --git a/tools/libxl/libxl_aoutils.c b/tools/libs/light/libxl_aoutils.c similarity index 100% rename from tools/libxl/libxl_aoutils.c rename to tools/libs/light/libxl_aoutils.c diff --git a/tools/libxl/libxl_arch.h b/tools/libs/light/libxl_arch.h similarity index 100% rename from tools/libxl/libxl_arch.h rename to tools/libs/light/libxl_arch.h diff --git a/tools/libxl/libxl_arm.c b/tools/libs/light/libxl_arm.c similarity index 100% rename from tools/libxl/libxl_arm.c rename to tools/libs/light/libxl_arm.c diff --git a/tools/libxl/libxl_arm.h b/tools/libs/light/libxl_arm.h similarity index 100% rename from tools/libxl/libxl_arm.h rename to tools/libs/light/libxl_arm.h diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libs/light/libxl_arm_acpi.c similarity index 100% rename from tools/libxl/libxl_arm_acpi.c rename to tools/libs/light/libxl_arm_acpi.c diff --git a/tools/libxl/libxl_arm_no_acpi.c b/tools/libs/light/libxl_arm_no_acpi.c similarity index 100% rename from tools/libxl/libxl_arm_no_acpi.c rename to tools/libs/light/libxl_arm_no_acpi.c diff --git a/tools/libxl/libxl_bootloader.c b/tools/libs/light/libxl_bootloader.c similarity index 100% rename from tools/libxl/libxl_bootloader.c rename to tools/libs/light/libxl_bootloader.c diff --git a/tools/libxl/libxl_checkpoint_device.c b/tools/libs/light/libxl_checkpoint_device.c similarity index 100% rename from tools/libxl/libxl_checkpoint_device.c rename to tools/libs/light/libxl_checkpoint_device.c diff --git a/tools/libxl/libxl_colo.h b/tools/libs/light/libxl_colo.h similarity index 100% rename from tools/libxl/libxl_colo.h rename to tools/libs/light/libxl_colo.h diff --git a/tools/libxl/libxl_colo_nic.c b/tools/libs/light/libxl_colo_nic.c similarity index 100% rename from tools/libxl/libxl_colo_nic.c rename to tools/libs/light/libxl_colo_nic.c diff --git a/tools/libxl/libxl_colo_proxy.c b/tools/libs/light/libxl_colo_proxy.c similarity index 100% rename from tools/libxl/libxl_colo_proxy.c rename to tools/libs/light/libxl_colo_proxy.c diff --git a/tools/libxl/libxl_colo_qdisk.c b/tools/libs/light/libxl_colo_qdisk.c similarity index 100% rename from tools/libxl/libxl_colo_qdisk.c rename to tools/libs/light/libxl_colo_qdisk.c diff --git a/tools/libxl/libxl_colo_restore.c b/tools/libs/light/libxl_colo_restore.c similarity index 100% rename from tools/libxl/libxl_colo_restore.c rename to tools/libs/light/libxl_colo_restore.c diff --git a/tools/libxl/libxl_colo_save.c b/tools/libs/light/libxl_colo_save.c similarity index 100% rename from tools/libxl/libxl_colo_save.c rename to tools/libs/light/libxl_colo_save.c diff --git a/tools/libxl/libxl_console.c b/tools/libs/light/libxl_console.c similarity index 100% rename from tools/libxl/libxl_console.c rename to tools/libs/light/libxl_console.c diff --git a/tools/libxl/libxl_convert_callout.c b/tools/libs/light/libxl_convert_callout.c similarity index 100% rename from tools/libxl/libxl_convert_callout.c rename to tools/libs/light/libxl_convert_callout.c diff --git a/tools/libxl/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c similarity index 100% rename from tools/libxl/libxl_cpuid.c rename to tools/libs/light/libxl_cpuid.c diff --git a/tools/libxl/libxl_cpupool.c b/tools/libs/light/libxl_cpupool.c similarity index 100% rename from tools/libxl/libxl_cpupool.c rename to tools/libs/light/libxl_cpupool.c diff --git a/tools/libxl/libxl_create.c b/tools/libs/light/libxl_create.c similarity index 100% rename from tools/libxl/libxl_create.c rename to tools/libs/light/libxl_create.c diff --git a/tools/libxl/libxl_device.c b/tools/libs/light/libxl_device.c similarity index 100% rename from tools/libxl/libxl_device.c rename to tools/libs/light/libxl_device.c diff --git a/tools/libxl/libxl_disk.c b/tools/libs/light/libxl_disk.c similarity index 100% rename from tools/libxl/libxl_disk.c rename to tools/libs/light/libxl_disk.c diff --git a/tools/libxl/libxl_dm.c b/tools/libs/light/libxl_dm.c similarity index 100% rename from tools/libxl/libxl_dm.c rename to tools/libs/light/libxl_dm.c diff --git a/tools/libxl/libxl_dom.c b/tools/libs/light/libxl_dom.c similarity index 100% rename from tools/libxl/libxl_dom.c rename to tools/libs/light/libxl_dom.c diff --git a/tools/libxl/libxl_dom_save.c b/tools/libs/light/libxl_dom_save.c similarity index 100% rename from tools/libxl/libxl_dom_save.c rename to tools/libs/light/libxl_dom_save.c diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libs/light/libxl_dom_suspend.c similarity index 100% rename from tools/libxl/libxl_dom_suspend.c rename to tools/libs/light/libxl_dom_suspend.c diff --git a/tools/libxl/libxl_domain.c b/tools/libs/light/libxl_domain.c similarity index 100% rename from tools/libxl/libxl_domain.c rename to tools/libs/light/libxl_domain.c diff --git a/tools/libxl/libxl_event.c b/tools/libs/light/libxl_event.c similarity index 100% rename from tools/libxl/libxl_event.c rename to tools/libs/light/libxl_event.c diff --git a/tools/libxl/libxl_exec.c b/tools/libs/light/libxl_exec.c similarity index 100% rename from tools/libxl/libxl_exec.c rename to tools/libs/light/libxl_exec.c diff --git a/tools/libxl/libxl_flask.c b/tools/libs/light/libxl_flask.c similarity index 100% rename from tools/libxl/libxl_flask.c rename to tools/libs/light/libxl_flask.c diff --git a/tools/libxl/libxl_fork.c b/tools/libs/light/libxl_fork.c similarity index 100% rename from tools/libxl/libxl_fork.c rename to tools/libs/light/libxl_fork.c diff --git a/tools/libxl/libxl_freebsd.c b/tools/libs/light/libxl_freebsd.c similarity index 100% rename from tools/libxl/libxl_freebsd.c rename to tools/libs/light/libxl_freebsd.c diff --git a/tools/libxl/libxl_genid.c b/tools/libs/light/libxl_genid.c similarity index 100% rename from tools/libxl/libxl_genid.c rename to tools/libs/light/libxl_genid.c diff --git a/tools/libxl/libxl_internal.c b/tools/libs/light/libxl_internal.c similarity index 100% rename from tools/libxl/libxl_internal.c rename to tools/libs/light/libxl_internal.c diff --git a/tools/libxl/libxl_internal.h b/tools/libs/light/libxl_internal.h similarity index 100% rename from tools/libxl/libxl_internal.h rename to tools/libs/light/libxl_internal.h diff --git a/tools/libxl/libxl_json.c b/tools/libs/light/libxl_json.c similarity index 100% rename from tools/libxl/libxl_json.c rename to tools/libs/light/libxl_json.c diff --git a/tools/libxl/libxl_libfdt_compat.c b/tools/libs/light/libxl_libfdt_compat.c similarity index 100% rename from tools/libxl/libxl_libfdt_compat.c rename to tools/libs/light/libxl_libfdt_compat.c diff --git a/tools/libxl/libxl_libfdt_compat.h b/tools/libs/light/libxl_libfdt_compat.h similarity index 100% rename from tools/libxl/libxl_libfdt_compat.h rename to tools/libs/light/libxl_libfdt_compat.h diff --git a/tools/libxl/libxl_linux.c b/tools/libs/light/libxl_linux.c similarity index 100% rename from tools/libxl/libxl_linux.c rename to tools/libs/light/libxl_linux.c diff --git a/tools/libxl/libxl_mem.c b/tools/libs/light/libxl_mem.c similarity index 100% rename from tools/libxl/libxl_mem.c rename to tools/libs/light/libxl_mem.c diff --git a/tools/libxl/libxl_netbsd.c b/tools/libs/light/libxl_netbsd.c similarity index 100% rename from tools/libxl/libxl_netbsd.c rename to tools/libs/light/libxl_netbsd.c diff --git a/tools/libxl/libxl_netbuffer.c b/tools/libs/light/libxl_netbuffer.c similarity index 100% rename from tools/libxl/libxl_netbuffer.c rename to tools/libs/light/libxl_netbuffer.c diff --git a/tools/libxl/libxl_nic.c b/tools/libs/light/libxl_nic.c similarity index 100% rename from tools/libxl/libxl_nic.c rename to tools/libs/light/libxl_nic.c diff --git a/tools/libxl/libxl_no_colo.c b/tools/libs/light/libxl_no_colo.c similarity index 100% rename from tools/libxl/libxl_no_colo.c rename to tools/libs/light/libxl_no_colo.c diff --git a/tools/libxl/libxl_no_convert_callout.c b/tools/libs/light/libxl_no_convert_callout.c similarity index 100% rename from tools/libxl/libxl_no_convert_callout.c rename to tools/libs/light/libxl_no_convert_callout.c diff --git a/tools/libxl/libxl_nocpuid.c b/tools/libs/light/libxl_nocpuid.c similarity index 100% rename from tools/libxl/libxl_nocpuid.c rename to tools/libs/light/libxl_nocpuid.c diff --git a/tools/libxl/libxl_nonetbuffer.c b/tools/libs/light/libxl_nonetbuffer.c similarity index 100% rename from tools/libxl/libxl_nonetbuffer.c rename to tools/libs/light/libxl_nonetbuffer.c diff --git a/tools/libxl/libxl_numa.c b/tools/libs/light/libxl_numa.c similarity index 100% rename from tools/libxl/libxl_numa.c rename to tools/libs/light/libxl_numa.c diff --git a/tools/libxl/libxl_osdeps.h b/tools/libs/light/libxl_osdeps.h similarity index 100% rename from tools/libxl/libxl_osdeps.h rename to tools/libs/light/libxl_osdeps.h diff --git a/tools/libxl/libxl_paths.c b/tools/libs/light/libxl_paths.c similarity index 100% rename from tools/libxl/libxl_paths.c rename to tools/libs/light/libxl_paths.c diff --git a/tools/libxl/libxl_pci.c b/tools/libs/light/libxl_pci.c similarity index 100% rename from tools/libxl/libxl_pci.c rename to tools/libs/light/libxl_pci.c diff --git a/tools/libxl/libxl_psr.c b/tools/libs/light/libxl_psr.c similarity index 100% rename from tools/libxl/libxl_psr.c rename to tools/libs/light/libxl_psr.c diff --git a/tools/libxl/libxl_pvcalls.c b/tools/libs/light/libxl_pvcalls.c similarity index 100% rename from tools/libxl/libxl_pvcalls.c rename to tools/libs/light/libxl_pvcalls.c diff --git a/tools/libxl/libxl_qmp.c b/tools/libs/light/libxl_qmp.c similarity index 100% rename from tools/libxl/libxl_qmp.c rename to tools/libs/light/libxl_qmp.c diff --git a/tools/libxl/libxl_remus.c b/tools/libs/light/libxl_remus.c similarity index 100% rename from tools/libxl/libxl_remus.c rename to tools/libs/light/libxl_remus.c diff --git a/tools/libxl/libxl_remus_disk_drbd.c b/tools/libs/light/libxl_remus_disk_drbd.c similarity index 100% rename from tools/libxl/libxl_remus_disk_drbd.c rename to tools/libs/light/libxl_remus_disk_drbd.c diff --git a/tools/libxl/libxl_save_callout.c b/tools/libs/light/libxl_save_callout.c similarity index 100% rename from tools/libxl/libxl_save_callout.c rename to tools/libs/light/libxl_save_callout.c diff --git a/tools/libxl/libxl_save_helper.c b/tools/libs/light/libxl_save_helper.c similarity index 100% rename from tools/libxl/libxl_save_helper.c rename to tools/libs/light/libxl_save_helper.c diff --git a/tools/libxl/libxl_save_msgs_gen.pl b/tools/libs/light/libxl_save_msgs_gen.pl similarity index 100% rename from tools/libxl/libxl_save_msgs_gen.pl rename to tools/libs/light/libxl_save_msgs_gen.pl diff --git a/tools/libxl/libxl_sched.c b/tools/libs/light/libxl_sched.c similarity index 100% rename from tools/libxl/libxl_sched.c rename to tools/libs/light/libxl_sched.c diff --git a/tools/libxl/libxl_sr_stream_format.h b/tools/libs/light/libxl_sr_stream_format.h similarity index 100% rename from tools/libxl/libxl_sr_stream_format.h rename to tools/libs/light/libxl_sr_stream_format.h diff --git a/tools/libxl/libxl_stream_read.c b/tools/libs/light/libxl_stream_read.c similarity index 100% rename from tools/libxl/libxl_stream_read.c rename to tools/libs/light/libxl_stream_read.c diff --git a/tools/libxl/libxl_stream_write.c b/tools/libs/light/libxl_stream_write.c similarity index 100% rename from tools/libxl/libxl_stream_write.c rename to tools/libs/light/libxl_stream_write.c diff --git a/tools/libxl/libxl_test_fdevent.c b/tools/libs/light/libxl_test_fdevent.c similarity index 100% rename from tools/libxl/libxl_test_fdevent.c rename to tools/libs/light/libxl_test_fdevent.c diff --git a/tools/libxl/libxl_test_fdevent.h b/tools/libs/light/libxl_test_fdevent.h similarity index 100% rename from tools/libxl/libxl_test_fdevent.h rename to tools/libs/light/libxl_test_fdevent.h diff --git a/tools/libxl/libxl_test_timedereg.c b/tools/libs/light/libxl_test_timedereg.c similarity index 100% rename from tools/libxl/libxl_test_timedereg.c rename to tools/libs/light/libxl_test_timedereg.c diff --git a/tools/libxl/libxl_test_timedereg.h b/tools/libs/light/libxl_test_timedereg.h similarity index 100% rename from tools/libxl/libxl_test_timedereg.h rename to tools/libs/light/libxl_test_timedereg.h diff --git a/tools/libxl/libxl_tmem.c b/tools/libs/light/libxl_tmem.c similarity index 100% rename from tools/libxl/libxl_tmem.c rename to tools/libs/light/libxl_tmem.c diff --git a/tools/libxl/libxl_types.idl b/tools/libs/light/libxl_types.idl similarity index 100% rename from tools/libxl/libxl_types.idl rename to tools/libs/light/libxl_types.idl diff --git a/tools/libxl/libxl_types_internal.idl b/tools/libs/light/libxl_types_internal.idl similarity index 100% rename from tools/libxl/libxl_types_internal.idl rename to tools/libs/light/libxl_types_internal.idl diff --git a/tools/libxl/libxl_usb.c b/tools/libs/light/libxl_usb.c similarity index 100% rename from tools/libxl/libxl_usb.c rename to tools/libs/light/libxl_usb.c diff --git a/tools/libxl/libxl_utils.c b/tools/libs/light/libxl_utils.c similarity index 100% rename from tools/libxl/libxl_utils.c rename to tools/libs/light/libxl_utils.c diff --git a/tools/libxl/libxl_uuid.c b/tools/libs/light/libxl_uuid.c similarity index 100% rename from tools/libxl/libxl_uuid.c rename to tools/libs/light/libxl_uuid.c diff --git a/tools/libxl/libxl_vdispl.c b/tools/libs/light/libxl_vdispl.c similarity index 100% rename from tools/libxl/libxl_vdispl.c rename to tools/libs/light/libxl_vdispl.c diff --git a/tools/libxl/libxl_vkb.c b/tools/libs/light/libxl_vkb.c similarity index 100% rename from tools/libxl/libxl_vkb.c rename to tools/libs/light/libxl_vkb.c diff --git a/tools/libxl/libxl_vnuma.c b/tools/libs/light/libxl_vnuma.c similarity index 100% rename from tools/libxl/libxl_vnuma.c rename to tools/libs/light/libxl_vnuma.c diff --git a/tools/libxl/libxl_vsnd.c b/tools/libs/light/libxl_vsnd.c similarity index 100% rename from tools/libxl/libxl_vsnd.c rename to tools/libs/light/libxl_vsnd.c diff --git a/tools/libxl/libxl_vtpm.c b/tools/libs/light/libxl_vtpm.c similarity index 100% rename from tools/libxl/libxl_vtpm.c rename to tools/libs/light/libxl_vtpm.c diff --git a/tools/libxl/libxl_x86.c b/tools/libs/light/libxl_x86.c similarity index 100% rename from tools/libxl/libxl_x86.c rename to tools/libs/light/libxl_x86.c diff --git a/tools/libxl/libxl_x86_acpi.c b/tools/libs/light/libxl_x86_acpi.c similarity index 100% rename from tools/libxl/libxl_x86_acpi.c rename to tools/libs/light/libxl_x86_acpi.c diff --git a/tools/libxl/libxl_x86_acpi.h b/tools/libs/light/libxl_x86_acpi.h similarity index 100% rename from tools/libxl/libxl_x86_acpi.h rename to tools/libs/light/libxl_x86_acpi.h diff --git a/tools/libxl/libxl_xshelp.c b/tools/libs/light/libxl_xshelp.c similarity index 100% rename from tools/libxl/libxl_xshelp.c rename to tools/libs/light/libxl_xshelp.c diff --git a/tools/libxl/osdeps.c b/tools/libs/light/osdeps.c similarity index 100% rename from tools/libxl/osdeps.c rename to tools/libs/light/osdeps.c diff --git a/tools/libxl/test_common.c b/tools/libs/light/test_common.c similarity index 100% rename from tools/libxl/test_common.c rename to tools/libs/light/test_common.c diff --git a/tools/libxl/test_common.h b/tools/libs/light/test_common.h similarity index 100% rename from tools/libxl/test_common.h rename to tools/libs/light/test_common.h diff --git a/tools/libxl/test_fdderegrace.c b/tools/libs/light/test_fdderegrace.c similarity index 100% rename from tools/libxl/test_fdderegrace.c rename to tools/libs/light/test_fdderegrace.c diff --git a/tools/libxl/test_timedereg.c b/tools/libs/light/test_timedereg.c similarity index 100% rename from tools/libxl/test_timedereg.c rename to tools/libs/light/test_timedereg.c diff --git a/tools/libxl/xenlight.pc.in b/tools/libs/light/xenlight.pc.in similarity index 100% rename from tools/libxl/xenlight.pc.in rename to tools/libs/light/xenlight.pc.in diff --git a/tools/libs/uselibs.mk b/tools/libs/uselibs.mk index a9dc2ce994..685f368aed 100644 --- a/tools/libs/uselibs.mk +++ b/tools/libs/uselibs.mk @@ -26,3 +26,5 @@ LIBS_LIBS += vchan USELIBS_vchan := toollog store gnttab evtchn LIBS_LIBS += stat USELIBS_stat := ctrl store +LIBS_LIBS += light +USELIBS_light := toollog evtchn toolcore ctrl store hypfs guest diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 1476c7897f..8d930dc047 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -5,9 +5,6 @@ XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk -MAJOR = 4.15 -MINOR = 0 - XLUMAJOR = 4.15 XLUMINOR = 0 @@ -15,107 +12,11 @@ CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \ -Wno-declaration-after-statement -Wformat-nonliteral CFLAGS += -I. -fPIC -ifeq ($(CONFIG_Linux),y) -LIBUUID_LIBS += -luuid -endif - -LIBXL_LIBS = -LIBXL_LIBS = $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenhypfs) $(LDLIBS_libxenstore) $(LDLIBS_libxentoolcore) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS) -ifeq ($(CONFIG_LIBNL),y) -LIBXL_LIBS += $(LIBNL3_LIBS) -endif -ifeq ($(CONFIG_Linux),y) -LIBXL_LIBS += -lrt -endif - -CFLAGS_LIBXL += $(CFLAGS_libxentoollog) -CFLAGS_LIBXL += $(CFLAGS_libxentoolcore) -CFLAGS_LIBXL += $(CFLAGS_libxenevtchn) -CFLAGS_LIBXL += $(CFLAGS_libxenctrl) -CFLAGS_LIBXL += $(CFLAGS_libxenguest) -CFLAGS_LIBXL += $(CFLAGS_libxenhypfs) -CFLAGS_LIBXL += $(CFLAGS_libxenstore) -ifeq ($(CONFIG_LIBNL),y) -CFLAGS_LIBXL += $(LIBNL3_CFLAGS) -endif -CFLAGS_LIBXL += -Wshadow -ifeq ($(debug),y) -CFLAGS_LIBXL += -DCONFIG_DEBUG -endif - -LIBXL_LIBS-$(CONFIG_ARM) += -lfdt - CFLAGS += $(PTHREAD_CFLAGS) LDFLAGS += $(PTHREAD_LDFLAGS) -LIBXL_LIBS += $(PTHREAD_LIBS) -LIBXL_LIBS += $(LIBXL_LIBS-y) LIBXLU_LIBS = $(LDLIBS_libxenlight) -LIBXL_OBJS-y = osdeps.o libxl_paths.o libxl_bootloader.o flexarray.o - -ifeq ($(CONFIG_LIBNL),y) -LIBXL_OBJS-y += libxl_netbuffer.o -else -LIBXL_OBJS-y += libxl_nonetbuffer.o -endif - -ifeq ($(CONFIG_X86),y) -LIBXL_OBJS-y += libxl_convert_callout.o -else -LIBXL_OBJS-y += libxl_no_convert_callout.o -endif - -LIBXL_OBJS-y += libxl_remus.o libxl_checkpoint_device.o libxl_remus_disk_drbd.o - -ifeq ($(CONFIG_LIBNL),y) -LIBXL_OBJS-y += libxl_colo_restore.o libxl_colo_save.o -LIBXL_OBJS-y += libxl_colo_qdisk.o -LIBXL_OBJS-y += libxl_colo_proxy.o -LIBXL_OBJS-y += libxl_colo_nic.o -else -LIBXL_OBJS-y += libxl_no_colo.o -endif - -ACPI_PATH = $(XEN_ROOT)/tools/libacpi -DSDT_FILES-$(CONFIG_X86) = dsdt_pvh.c -ACPI_OBJS = $(patsubst %.c,%.o,$(DSDT_FILES-y)) build.o static_tables.o -$(DSDT_FILES-y): acpi -$(ACPI_OBJS): CFLAGS += -I. -DLIBACPI_STDUTILS=\"$(CURDIR)/libxl_x86_acpi.h\" -vpath build.c $(ACPI_PATH)/ -vpath static_tables.c $(ACPI_PATH)/ -LIBXL_OBJS-$(CONFIG_X86) += $(ACPI_OBJS) - -.PHONY: acpi -acpi: - $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) DSDT_FILES="$(DSDT_FILES-y)" - -LIBXL_OBJS-$(CONFIG_X86) += libxl_cpuid.o libxl_x86.o libxl_psr.o libxl_x86_acpi.o -LIBXL_OBJS-$(CONFIG_ARM) += libxl_nocpuid.o libxl_arm.o libxl_libfdt_compat.o -ifeq ($(CONFIG_ARM_64),y) -DSDT_FILES-y = dsdt_anycpu_arm.c -LIBXL_OBJS-y += libxl_arm_acpi.o $(patsubst %.c,%.o,$(DSDT_FILES-y)) -dsdt_anycpu_arm.c: - $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) DSDT_FILES="$(DSDT_FILES-y)" -else -LIBXL_OBJS-$(CONFIG_ARM) += libxl_arm_no_acpi.o -endif - -ifeq ($(CONFIG_NetBSD),y) -LIBXL_OBJS-y += libxl_netbsd.o -else -ifeq ($(CONFIG_Linux),y) -LIBXL_OBJS-y += libxl_linux.o -else -ifeq ($(CONFIG_FreeBSD),y) -LIBXL_OBJS-y += libxl_freebsd.o -else -$(error Your Operating System is not supported by libxenlight, \ -please check libxl_linux.c and libxl_netbsd.c to see how to get it ported) -endif -endif -endif - ifeq ($(FLEX),) %.c %.h:: %.l $(warning Flex is needed to rebuild some libxl parsers and \ @@ -128,74 +29,16 @@ ifeq ($(BISON),) scanners, please install it an rerun configure) endif -LIBXL_LIBS += -lyajl - -LIBXL_OBJS = flexarray.o libxl.o libxl_create.o libxl_dm.o libxl_pci.o \ - libxl_dom.o libxl_exec.o libxl_xshelp.o libxl_device.o \ - libxl_internal.o libxl_utils.o libxl_uuid.o \ - libxl_json.o libxl_aoutils.o libxl_numa.o libxl_vnuma.o \ - libxl_stream_read.o libxl_stream_write.o \ - libxl_save_callout.o _libxl_save_msgs_callout.o \ - libxl_qmp.o libxl_event.o libxl_fork.o \ - libxl_dom_suspend.o libxl_dom_save.o libxl_usb.o \ - libxl_vtpm.o libxl_nic.o libxl_disk.o libxl_console.o \ - libxl_cpupool.o libxl_mem.o libxl_sched.o libxl_tmem.o \ - libxl_9pfs.o libxl_domain.o libxl_vdispl.o \ - libxl_pvcalls.o libxl_vsnd.o libxl_vkb.o $(LIBXL_OBJS-y) -LIBXL_OBJS += libxl_genid.o -LIBXL_OBJS += _libxl_types.o libxl_flask.o _libxl_types_internal.o - -LIBXL_TESTS += timedereg -LIBXL_TESTS_PROGS = $(LIBXL_TESTS) fdderegrace -LIBXL_TESTS_INSIDE = $(LIBXL_TESTS) fdevent - -# Each entry FOO in LIBXL_TESTS has two main .c files: -# libxl_test_FOO.c "inside libxl" code to support the test case -# test_FOO.c "outside libxl" code to exercise the test case -# Conventionally there will also be: -# libxl_test_FOO.h interface between the "inside" and "outside" parts -# The "inside libxl" file is compiled exactly like a piece of libxl, and the -# "outside libxl" file is compiled exactly like a piece of application -# code. They must share information via explicit libxl entrypoints. -# Unlike proper parts of libxl, it is permissible for libxl_test_FOO.c -# to use private global variables for its state. Note that all the -# "inside" parts are compiled into a single test library, so their -# symbol names must be unique. -# -# To run these tests, either use LD_PRELOAD to get libxenlight_test.so -# loaded, or rename it to libxenlight.so so it is the target of the -# appropriate symlinks. - -LIBXL_TEST_OBJS += $(foreach t, $(LIBXL_TESTS_INSIDE),libxl_test_$t.o) -TEST_PROG_OBJS += $(foreach t, $(LIBXL_TESTS_PROGS),test_$t.o) test_common.o -TEST_PROGS += $(foreach t, $(LIBXL_TESTS_PROGS),test_$t) - -$(LIBXL_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h - -AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h _libxl_list.h _paths.h \ - libxlu_disk_l.h _libxl_save_msgs_callout.h _libxl_save_msgs_helper.h +AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h libxlu_disk_l.h AUTOSRCS= libxlu_cfg_y.c libxlu_cfg_l.c -AUTOSRCS += _libxl_save_msgs_callout.c _libxl_save_msgs_helper.c LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_l.o libxlu_cfg.o \ libxlu_disk_l.o libxlu_disk.o libxlu_vif.o libxlu_pci.o $(LIBXLU_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h -$(TEST_PROG_OBJS) _libxl.api-for-check: CFLAGS += $(CFLAGS_libxentoollog) $(CFLAGS_libxentoolcore) - -CLIENTS = testidl libxl-save-helper - -libxl_dom.o: CFLAGS += -I$(XEN_ROOT)/tools # include libacpi/x86.h -libxl_x86_acpi.o: CFLAGS += -I$(XEN_ROOT)/tools - -SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o -$(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn) $(CFLAGS_libxenguest) - -PKG_CONFIG = xenlight.pc xlutil.pc -PKG_CONFIG_VERSION := $(MAJOR).$(MINOR) +PKG_CONFIG = xlutil.pc ifneq ($(CONFIG_LIBXC_MINIOS),y) PKG_CONFIG_INST := $(PKG_CONFIG) -xenlight.pc: PKG_CONFIG_VERSION = $(MAJOR).$(MINOR) xlutil.pc: PKG_CONFIG_VERSION = $(XLUMAJOR).$(XLUMINOR) $(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix) $(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir) @@ -204,26 +47,16 @@ endif PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) -$(PKG_CONFIG_DIR)/xenlight.pc: PKG_CONFIG_VERSION = $(MAJOR).$(MINOR) $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_VERSION = $(XLUMAJOR).$(XLUMINOR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT) $(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) -testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight) -testidl.c: libxl_types.idl gentest.py libxl.h $(AUTOINCS) - $(PYTHON) gentest.py libxl_types.idl testidl.c.new - mv testidl.c.new testidl.c - .PHONY: all -all: $(CLIENTS) $(TEST_PROGS) $(PKG_CONFIG) $(PKG_CONFIG_LOCAL) \ - libxenlight.so libxenlight.a libxlutil.so libxlutil.a \ - $(AUTOSRCS) $(AUTOINCS) idl-external +all: libxlutil.so libxlutil.a $(AUTOSRCS) $(AUTOINCS) $(PKG_CONFIG) $(PKG_CONFIG_LOCAL) -$(LIBXL_OBJS) $(LIBXLU_OBJS) $(SAVE_HELPER_OBJS) \ - $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): \ - $(AUTOINCS) libxl.api-ok +$(LIBXLU_OBJS): $(AUTOINCS) %.c %.h:: %.y @rm -f $*.[ch] @@ -236,138 +69,42 @@ $(LIBXL_OBJS) $(LIBXLU_OBJS) $(SAVE_HELPER_OBJS) \ genpath-target = $(call buildmakevars2header,_paths.h) $(eval $(genpath-target)) -libxl.api-ok: check-libxl-api-rules _libxl.api-for-check - $(PERL) $^ - touch $@ - -_%.api-for-check: %.h $(AUTOINCS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \ - -DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \ - >$@.new - mv -f $@.new $@ - -_libxl_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h - $(PERL) $^ --prefix=libxl >$@.new - $(call move-if-changed,$@.new,$@) - -_libxl_save_msgs_helper.c _libxl_save_msgs_callout.c \ -_libxl_save_msgs_helper.h _libxl_save_msgs_callout.h: \ - libxl_save_msgs_gen.pl - $(PERL) -w $< $@ >$@.new - $(call move-if-changed,$@.new,$@) - -libxl.h: _libxl_types.h _libxl_list.h -libxl_json.h: _libxl_types_json.h -libxl_internal.h: _libxl_types_internal.h _libxl_types_private.h _libxl_types_internal_private.h _paths.h -libxl_internal_json.h: _libxl_types_internal_json.h -xl.h: _paths.h - -$(LIBXL_OBJS) $(LIBXL_TEST_OBJS) $(LIBXLU_OBJS) \ - $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): libxl.h -$(LIBXL_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h - -_libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py - $(eval stem = $(notdir $*)) - $(PYTHON) gentypes.py libxl_type$(stem).idl __libxl_type$(stem).h __libxl_type$(stem)_private.h \ - __libxl_type$(stem)_json.h __libxl_type$(stem).c - $(call move-if-changed,__libxl_type$(stem).h,_libxl_type$(stem).h) - $(call move-if-changed,__libxl_type$(stem)_private.h,_libxl_type$(stem)_private.h) - $(call move-if-changed,__libxl_type$(stem)_json.h,_libxl_type$(stem)_json.h) - $(call move-if-changed,__libxl_type$(stem).c,_libxl_type$(stem).c) - -# NOTE: This is safe to do at the moment because idl-external and -# idl-gen are only called from libxl/Makefile:all, which must return -# before golang/Makefile is callid. idl-external and idl-gen must -# never be called from another part of the make system without careful thought -# about races with tools/golang/xenlight/Makefile:all -.PHONY: idl-external -idl-external: - $(MAKE) -C $(XEN_ROOT)/tools/golang/xenlight idl-gen - -LIBXL_IDLGEN_FILES = _libxl_types.h _libxl_types_json.h _libxl_types_private.h _libxl_types.c \ - _libxl_types_internal.h _libxl_types_internal_json.h _libxl_types_internal_private.h _libxl_types_internal.c - - -idl-gen: $(LIBXL_GEN_FILES) idl-external - -libxenlight.so: libxenlight.so.$(MAJOR) - $(SYMLINK_SHLIB) $< $@ - -libxenlight.so.$(MAJOR): libxenlight.so.$(MAJOR).$(MINOR) - $(SYMLINK_SHLIB) $< $@ - -libxenlight.so.$(MAJOR).$(MINOR): $(LIBXL_OBJS) - $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) $(APPEND_LDFLAGS) - -libxenlight_test.so: $(LIBXL_OBJS) $(LIBXL_TEST_OBJS) - $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) $(APPEND_LDFLAGS) - -libxenlight.a: $(LIBXL_OBJS) - $(AR) rcs libxenlight.a $^ - libxlutil.so: libxlutil.so.$(XLUMAJOR) $(SYMLINK_SHLIB) $< $@ libxlutil.so.$(XLUMAJOR): libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(SYMLINK_SHLIB) $< $@ -libxlutil.so.$(XLUMAJOR).$(XLUMINOR): $(LIBXLU_OBJS) libxenlight.so +libxlutil.so.$(XLUMAJOR).$(XLUMINOR): $(LIBXLU_OBJS) $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxlutil.so.$(XLUMAJOR) $(SHLIB_LDFLAGS) -o $@ $(LIBXLU_OBJS) $(LIBXLU_LIBS) $(APPEND_LDFLAGS) libxlutil.a: $(LIBXLU_OBJS) $(AR) rcs libxlutil.a $^ -test_%: test_%.o test_common.o libxenlight_test.so - $(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) -lyajl $(APPEND_LDFLAGS) - -libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so - $(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS) - -testidl: testidl.o libxenlight.so - $(CC) $(LDFLAGS) -o $@ testidl.o $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS) - .PHONY: install install: all $(INSTALL_DIR) $(DESTDIR)$(libdir) $(INSTALL_DIR) $(DESTDIR)$(includedir) - $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN) - $(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN) - $(INSTALL_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir) - $(SYMLINK_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenlight.so.$(MAJOR) - $(SYMLINK_SHLIB) libxenlight.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenlight.so - $(INSTALL_DATA) libxenlight.a $(DESTDIR)$(libdir) $(INSTALL_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(libdir) $(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(libdir)/libxlutil.so.$(XLUMAJOR) $(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(libdir)/libxlutil.so $(INSTALL_DATA) libxlutil.a $(DESTDIR)$(libdir) - $(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h libxlutil.h $(DESTDIR)$(includedir) - $(INSTALL_DATA) xenlight.pc $(DESTDIR)$(PKG_INSTALLDIR) + $(INSTALL_DATA) libxlutil.h $(DESTDIR)$(includedir) $(INSTALL_DATA) xlutil.pc $(DESTDIR)$(PKG_INSTALLDIR) .PHONY: uninstall uninstall: - rm -f $(addprefix $(DESTDIR)$(PKG_INSTALLDIR)/,xlutil.pc xenlight.pc) - rm -f $(addprefix $(DESTDIR)$(includedir)/,libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h libxlutil.h) + rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xlutil.pc + rm -f $(DESTDIR)$(includedir)/libxlutil.h rm -f $(DESTDIR)$(libdir)/libxlutil.a rm -f $(DESTDIR)$(libdir)/libxlutil.so rm -f $(DESTDIR)$(libdir)/libxlutil.so.$(XLUMAJOR) rm -f $(DESTDIR)$(libdir)/libxlutil.so.$(XLUMAJOR).$(XLUMINOR) - rm -f $(DESTDIR)$(libdir)/libxenlight.a - rm -f $(DESTDIR)$(libdir)/libxenlight.so - rm -f $(DESTDIR)$(libdir)/libxenlight.so.$(MAJOR) - rm -f $(DESTDIR)$(libdir)/libxenlight.so.$(MAJOR).$(MINOR) - rm -f $(DESTDIR)$(LIBEXEC_BIN)/libxl-save-helper .PHONY: clean clean: - $(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS_RM) - $(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check - $(RM) -f testidl.c.new testidl.c *.api-ok - $(RM) -f $(TEST_PROGS) - $(RM) -f xenlight.pc + $(RM) -f _*.h *.o *.so* *.a $(DEPS_RM) $(RM) -f xlutil.pc - $(RM) -rf __pycache__ - $(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) clean distclean: clean diff --git a/tools/ocaml/libs/xl/Makefile b/tools/ocaml/libs/xl/Makefile index 0d1549dd3a..cbe1569cc5 100644 --- a/tools/ocaml/libs/xl/Makefile +++ b/tools/ocaml/libs/xl/Makefile @@ -50,10 +50,10 @@ xenlight.mli: xenlight.mli.in _libxl_types.mli.in < xenlight.mli.in > xenlight.mli.tmp $(Q)mv xenlight.mli.tmp xenlight.mli -_libxl_types.ml.in _libxl_types.mli.in _libxl_types.inc: genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \ - $(XEN_ROOT)/tools/libxl/idl.py - PYTHONPATH=$(XEN_ROOT)/tools/libxl $(PYTHON) genwrap.py \ - $(XEN_ROOT)/tools/libxl/libxl_types.idl \ +_libxl_types.ml.in _libxl_types.mli.in _libxl_types.inc: genwrap.py $(XEN_ROOT)/tools/libs/light/libxl_types.idl \ + $(XEN_ROOT)/tools/libs/light/idl.py + PYTHONPATH=$(XEN_ROOT)/tools/libs/light $(PYTHON) genwrap.py \ + $(XEN_ROOT)/tools/libs/light/libxl_types.idl \ _libxl_types.mli.in _libxl_types.ml.in _libxl_types.inc libs: $(LIBS) From patchwork Sun Aug 23 09:35:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731525 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4D20E913 for ; Sun, 23 Aug 2020 09:48:40 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 32E7B2074D for ; Sun, 23 Aug 2020 09:48:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32E7B2074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9maT-0008QL-Ei; Sun, 23 Aug 2020 09:46:53 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQg-0004t9-U7 for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:46 +0000 X-Inumbo-ID: 5bc1115a-a029-44ce-9d06-989ee2105bdc Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5bc1115a-a029-44ce-9d06-989ee2105bdc; Sun, 23 Aug 2020 09:35:30 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BD6A7ADC4; Sun, 23 Aug 2020 09:35:58 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu Subject: [PATCH v3 37/38] tools: add support for library names other than libxen* Date: Sun, 23 Aug 2020 11:35:18 +0200 Message-Id: <20200823093519.18386-38-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" All Xen libraries but one (libxlutil) are named libxen... Add support in the generic library build framework for that different naming by adding another indirection layer. For a library LIB_PREFIX_ can be set in tools/libs/uselibs.mk. The default is "xen", assuming that all libraries are starting with "lib". For now don't expand this support to stubdoms, as it isn't needed there yet. Signed-off-by: Juergen Gross --- tools/Rules.mk | 12 ++++++----- tools/libs/libs.mk | 51 ++++++++++++++++++++++++---------------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index 8ecaf063b5..5537056d00 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -87,11 +87,13 @@ endif # $(SHLIB_libfoo) define LIB_defs = - XEN_libxen$(1) = $$(XEN_ROOT)/tools/libs/$(1) - CFLAGS_libxen$(1) = -I$$(XEN_libxen$(1))/include $$(CFLAGS_xeninclude) - SHDEPS_libxen$(1) = $$(foreach use,$$(USELIBS_$(1)),$$(SHLIB_libxen$$(use))) - LDLIBS_libxen$(1) = $$(SHDEPS_libxen$(1)) $$(XEN_libxen$(1))/libxen$(1)$$(libextension) - SHLIB_libxen$(1) = $$(SHDEPS_libxen$(1)) -Wl,-rpath-link=$$(XEN_libxen$(1)) + LIB_PREFIX_$(1) ?= xen + LIBREF_$(1) = lib$$(LIB_PREFIX_$(1))$(1) + XEN_$$(LIBREF_$(1)) = $$(XEN_ROOT)/tools/libs/$(1) + CFLAGS_$$(LIBREF_$(1)) = -I$$(XEN_$$(LIBREF_$(1)))/include $$(CFLAGS_xeninclude) + SHDEPS_$$(LIBREF_$(1)) = $$(foreach use,$$(USELIBS_$(1)),$$(SHLIB_$$(LIBREF_$$(use)))) + LDLIBS_$$(LIBREF_$(1)) = $$(SHDEPS_$$(LIBREF_$(1))) $$(XEN_$$(LIBREF_$(1)))/$$(LIBREF_$(1))$$(libextension) + SHLIB_$$(LIBREF_$(1)) = $$(SHDEPS_$$(LIBREF_$(1))) -Wl,-rpath-link=$$(XEN_$$(LIBREF_$(1))) endef $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_defs,$(lib)))) diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 8b1ca2aa62..fca8228d25 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -9,23 +9,26 @@ LIBNAME := $(notdir $(CURDIR)) MAJOR ?= $(shell $(XEN_ROOT)/version.sh $(XEN_ROOT)/xen/Makefile) MINOR ?= 0 -SHLIB_LDFLAGS += -Wl,--version-script=libxen$(LIBNAME).map +my_lib := $(LIBREF_$(LIBNAME)) +my_name := $(LIB_PREFIX_$(LIBNAME))$(LIBNAME) + +SHLIB_LDFLAGS += -Wl,--version-script=$(my_lib).map CFLAGS += -Werror -Wmissing-prototypes CFLAGS += -I./include $(CFLAGS_xeninclude) -CFLAGS += $(foreach lib, $(USELIBS_$(LIBNAME)), $(CFLAGS_libxen$(lib))) +CFLAGS += $(foreach lib, $(USELIBS_$(LIBNAME)), $(CFLAGS_$(LIBREF_$(lib)))) -LDUSELIBS = $(foreach lib, $(USELIBS_$(LIBNAME)), $(LDLIBS_libxen$(lib))) +LDUSELIBS = $(foreach lib, $(USELIBS_$(LIBNAME)), $(LDLIBS_$(LIBREF_$(lib)))) LIB_OBJS := $(SRCS-y:.c=.o) PIC_OBJS := $(SRCS-y:.c=.opic) -LIB := libxen$(LIBNAME).a +LIB := $(my_lib).a ifneq ($(nosharedlibs),y) -LIB += libxen$(LIBNAME).so +LIB += $(my_lib).so endif -PKG_CONFIG ?= xen$(LIBNAME).pc +PKG_CONFIG ?= $(my_name).pc PKG_CONFIG_VERSION := $(MAJOR).$(MINOR) ifneq ($(CONFIG_LIBXC_MINIOS),y) @@ -37,7 +40,7 @@ endif PKG_CONFIG_LOCAL := $(PKG_CONFIG_DIR)/$(PKG_CONFIG) -LIBHEADER ?= xen$(LIBNAME).h +LIBHEADER ?= $(my_name).h LIBHEADERS = $(foreach h, $(LIBHEADER), include/$(h)) LIBHEADERSGLOB = $(foreach h, $(LIBHEADER), $(XEN_ROOT)/tools/include/$(h)) @@ -48,7 +51,7 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) all: build .PHONY: build -build: libs libxen$(LIBNAME).map +build: libs $(my_lib).map .PHONY: libs libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) @@ -67,42 +70,42 @@ endif headers.chk: $(LIBHEADERSGLOB) $(AUTOINCS) -libxen$(LIBNAME).map: +$(my_lib).map: echo 'VERS_$(MAJOR).$(MINOR) { global: *; };' >$@ $(LIBHEADERSGLOB): $(LIBHEADERS) for i in $(realpath $(LIBHEADERS)); do ln -sf $$i $(XEN_ROOT)/tools/include; done -libxen$(LIBNAME).a: $(LIB_OBJS) +$(my_lib).a: $(LIB_OBJS) $(AR) rc $@ $^ -libxen$(LIBNAME).so: libxen$(LIBNAME).so.$(MAJOR) +$(my_lib).so: $(my_lib).so.$(MAJOR) $(SYMLINK_SHLIB) $< $@ -libxen$(LIBNAME).so.$(MAJOR): libxen$(LIBNAME).so.$(MAJOR).$(MINOR) +$(my_lib).so.$(MAJOR): $(my_lib).so.$(MAJOR).$(MINOR) $(SYMLINK_SHLIB) $< $@ -libxen$(LIBNAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map - $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxen$(LIBNAME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEND_LDFLAGS) +$(my_lib).so.$(MAJOR).$(MINOR): $(PIC_OBJS) $(my_lib).map + $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,$(my_lib).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEND_LDFLAGS) .PHONY: install install: build $(INSTALL_DIR) $(DESTDIR)$(libdir) $(INSTALL_DIR) $(DESTDIR)$(includedir) - $(INSTALL_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir) - $(INSTALL_DATA) libxen$(LIBNAME).a $(DESTDIR)$(libdir) - $(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR) - $(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so + $(INSTALL_SHLIB) $(my_lib).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir) + $(INSTALL_DATA) $(my_lib).a $(DESTDIR)$(libdir) + $(SYMLINK_SHLIB) $(my_lib).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/$(my_lib).so.$(MAJOR) + $(SYMLINK_SHLIB) $(my_lib).so.$(MAJOR) $(DESTDIR)$(libdir)/$(my_lib).so for i in $(LIBHEADERS); do $(INSTALL_DATA) $$i $(DESTDIR)$(includedir); done $(INSTALL_DATA) $(PKG_CONFIG) $(DESTDIR)$(PKG_INSTALLDIR) .PHONY: uninstall uninstall: - rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xen$(LIBNAME).pc + rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(my_name).pc for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$(LIBHEADER); done - rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so - rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR) - rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR).$(MINOR) - rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).a + rm -f $(DESTDIR)$(libdir)/$(my_lib).so + rm -f $(DESTDIR)$(libdir)/$(my_lib).so.$(MAJOR) + rm -f $(DESTDIR)$(libdir)/$(my_lib).so.$(MAJOR).$(MINOR) + rm -f $(DESTDIR)$(libdir)/$(my_lib).a .PHONY: TAGS TAGS: @@ -111,7 +114,7 @@ TAGS: .PHONY: clean clean: rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS) - rm -f libxen$(LIBNAME).so.$(MAJOR).$(MINOR) libxen$(LIBNAME).so.$(MAJOR) + rm -f $(my_lib).so.$(MAJOR).$(MINOR) $(my_lib).so.$(MAJOR) rm -f headers.chk rm -f $(PKG_CONFIG) rm -f $(LIBHEADERSGLOB) From patchwork Sun Aug 23 09:35:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11731503 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD2D4109B for ; Sun, 23 Aug 2020 09:47:59 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97AF82074D for ; Sun, 23 Aug 2020 09:47:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97AF82074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9ma3-00086V-VG; Sun, 23 Aug 2020 09:46:27 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k9mQl-0004t9-UL for xen-devel@lists.xenproject.org; Sun, 23 Aug 2020 09:36:51 +0000 X-Inumbo-ID: ee3fe154-c5ad-4f93-b546-ba5c236694b9 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ee3fe154-c5ad-4f93-b546-ba5c236694b9; Sun, 23 Aug 2020 09:35:30 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 0A50DAC7F; Sun, 23 Aug 2020 09:35:59 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Anthony PERARD Subject: [PATCH v3 38/38] tools: move libxlutil to tools/libs/util Date: Sun, 23 Aug 2020 11:35:19 +0200 Message-Id: <20200823093519.18386-39-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823093519.18386-1-jgross@suse.com> References: <20200823093519.18386-1-jgross@suse.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Move the libxlutil source to tools/libs/util and delete tools/libxl. Signed-off-by: Juergen Gross --- .gitignore | 6 +- tools/Makefile | 1 - tools/Rules.mk | 7 -- tools/libs/Makefile | 1 + tools/libs/uselibs.mk | 3 + tools/{libxl => libs/util}/CODING_STYLE | 0 tools/libs/util/Makefile | 61 ++++++++++ .../{libxl => libs/util/include}/libxlutil.h | 0 tools/{libxl => libs/util}/libxlu_cfg.c | 0 tools/{libxl => libs/util}/libxlu_cfg_i.h | 0 tools/{libxl => libs/util}/libxlu_cfg_l.c | 0 tools/{libxl => libs/util}/libxlu_cfg_l.h | 0 tools/{libxl => libs/util}/libxlu_cfg_l.l | 0 tools/{libxl => libs/util}/libxlu_cfg_y.c | 0 tools/{libxl => libs/util}/libxlu_cfg_y.h | 0 tools/{libxl => libs/util}/libxlu_cfg_y.y | 0 tools/{libxl => libs/util}/libxlu_disk.c | 0 tools/{libxl => libs/util}/libxlu_disk_i.h | 0 tools/{libxl => libs/util}/libxlu_disk_l.c | 0 tools/{libxl => libs/util}/libxlu_disk_l.h | 0 tools/{libxl => libs/util}/libxlu_disk_l.l | 0 tools/{libxl => libs/util}/libxlu_internal.h | 0 tools/{libxl => libs/util}/libxlu_pci.c | 0 tools/{libxl => libs/util}/libxlu_vif.c | 0 tools/{libxl => libs/util}/xlutil.pc.in | 0 tools/libxl/Makefile | 114 ------------------ 26 files changed, 69 insertions(+), 124 deletions(-) rename tools/{libxl => libs/util}/CODING_STYLE (100%) create mode 100644 tools/libs/util/Makefile rename tools/{libxl => libs/util/include}/libxlutil.h (100%) rename tools/{libxl => libs/util}/libxlu_cfg.c (100%) rename tools/{libxl => libs/util}/libxlu_cfg_i.h (100%) rename tools/{libxl => libs/util}/libxlu_cfg_l.c (100%) rename tools/{libxl => libs/util}/libxlu_cfg_l.h (100%) rename tools/{libxl => libs/util}/libxlu_cfg_l.l (100%) rename tools/{libxl => libs/util}/libxlu_cfg_y.c (100%) rename tools/{libxl => libs/util}/libxlu_cfg_y.h (100%) rename tools/{libxl => libs/util}/libxlu_cfg_y.y (100%) rename tools/{libxl => libs/util}/libxlu_disk.c (100%) rename tools/{libxl => libs/util}/libxlu_disk_i.h (100%) rename tools/{libxl => libs/util}/libxlu_disk_l.c (100%) rename tools/{libxl => libs/util}/libxlu_disk_l.h (100%) rename tools/{libxl => libs/util}/libxlu_disk_l.l (100%) rename tools/{libxl => libs/util}/libxlu_internal.h (100%) rename tools/{libxl => libs/util}/libxlu_pci.c (100%) rename tools/{libxl => libs/util}/libxlu_vif.c (100%) rename tools/{libxl => libs/util}/xlutil.pc.in (100%) delete mode 100644 tools/libxl/Makefile diff --git a/.gitignore b/.gitignore index 94af7a4aee..6dbbd691cb 100644 --- a/.gitignore +++ b/.gitignore @@ -154,6 +154,10 @@ tools/libs/store/utils.h tools/libs/store/xenstore.pc tools/libs/store/xs_lib.c tools/libs/store/include/xenstore_lib.h +tools/libs/util/*.pc +tools/libs/util/_paths.h +tools/libs/util/libxlu_cfg_y.output +tools/libs/util/libxlutil.map tools/libs/vchan/headers.chk tools/libs/vchan/libxenvchan.map tools/libs/vchan/xenvchan.pc @@ -232,8 +236,6 @@ tools/include/xen/* tools/include/xen-xsm/* tools/include/xen-foreign/*.(c|h|size) tools/include/xen-foreign/checker -tools/libxl/*.pc -tools/libxl/libxlu_cfg_y.output tools/misc/cpuperf/cpuperf-perfcntr tools/misc/cpuperf/cpuperf-xen tools/misc/xc_shadow diff --git a/tools/Makefile b/tools/Makefile index ea69675cca..9c77ee6763 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -29,7 +29,6 @@ SUBDIRS-$(CONFIG_QEMU_XEN) += qemu-xen-dir endif SUBDIRS-y += xenpmd -SUBDIRS-y += libxl SUBDIRS-$(CONFIG_GOLANG) += golang SUBDIRS-y += xl SUBDIRS-y += helpers diff --git a/tools/Rules.mk b/tools/Rules.mk index 5537056d00..7f0b2c2f24 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -15,8 +15,6 @@ XEN_INCLUDE = $(XEN_ROOT)/tools/include include $(XEN_ROOT)/tools/libs/uselibs.mk -XEN_libxlutil = $(XEN_ROOT)/tools/libxl - CFLAGS_xeninclude = -I$(XEN_INCLUDE) XENSTORE_XENSTORED ?= y @@ -118,11 +116,6 @@ else CFLAGS += -O2 -fomit-frame-pointer endif -CFLAGS_libxlutil = -I$(XEN_libxlutil) -SHDEPS_libxlutil = $(SHLIB_libxenlight) -LDLIBS_libxlutil = $(SHDEPS_libxlutil) $(XEN_libxlutil)/libxlutil$(libextension) -SHLIB_libxlutil = $(SHDEPS_libxlutil) -Wl,-rpath-link=$(XEN_libxlutil) - CFLAGS += -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ # Get gcc to generate the dependencies for us. diff --git a/tools/libs/Makefile b/tools/libs/Makefile index c41455c604..1afcd12e2b 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -16,6 +16,7 @@ SUBDIRS-y += store SUBDIRS-y += stat SUBDIRS-$(CONFIG_Linux) += vchan SUBDIRS-y += light +SUBDIRS-y += util ifeq ($(CONFIG_RUMP),y) SUBDIRS-y := toolcore diff --git a/tools/libs/uselibs.mk b/tools/libs/uselibs.mk index 685f368aed..74913717a6 100644 --- a/tools/libs/uselibs.mk +++ b/tools/libs/uselibs.mk @@ -28,3 +28,6 @@ LIBS_LIBS += stat USELIBS_stat := ctrl store LIBS_LIBS += light USELIBS_light := toollog evtchn toolcore ctrl store hypfs guest +LIBS_LIBS += util +USELIBS_util := light +LIB_PREFIX_util := xl diff --git a/tools/libxl/CODING_STYLE b/tools/libs/util/CODING_STYLE similarity index 100% rename from tools/libxl/CODING_STYLE rename to tools/libs/util/CODING_STYLE diff --git a/tools/libs/util/Makefile b/tools/libs/util/Makefile new file mode 100644 index 0000000000..96508a49e2 --- /dev/null +++ b/tools/libs/util/Makefile @@ -0,0 +1,61 @@ +XEN_ROOT = $(CURDIR)/../../.. +include $(XEN_ROOT)/tools/Rules.mk + +SRCS-y += libxlu_cfg_y.c +SRCS-y += libxlu_cfg_l.c +SRCS-y += libxlu_cfg.c +SRCS-y += libxlu_disk_l.c +SRCS-y += libxlu_disk.c +SRCS-y += libxlu_vif.c +SRCS-y += libxlu_pci.c + +CFLAGS += -Wno-format-zero-length -Wmissing-declarations \ + -Wno-declaration-after-statement -Wformat-nonliteral +CFLAGS += -I. $(CFLAGS_libxenctrl) + +CFLAGS += $(PTHREAD_CFLAGS) +LDFLAGS += $(PTHREAD_LDFLAGS) + +ifeq ($(FLEX),) +%.c %.h:: %.l + $(warning Flex is needed to rebuild some libxl parsers and \ + scanners, please install it and rerun configure) +endif + +ifeq ($(BISON),) +%.c %.h:: %.y + $(warning Bison is needed to rebuild some libxl parsers and \ + scanners, please install it an rerun configure) +endif + +AUTOINCS = libxlu_cfg_y.h libxlu_cfg_l.h libxlu_disk_l.h +AUTOSRCS = libxlu_cfg_y.c libxlu_cfg_l.c + +LIBHEADER := libxlutil.h + +NO_HEADERS_CHK := y + +include $(XEN_ROOT)/tools/libs/libs.mk + +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxlutil)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) + +$(LIB_OBJS) $(PIC_OBJS): $(AUTOINCS) _paths.h + +%.c %.h:: %.y + @rm -f $*.[ch] + $(BISON) --output=$*.c $< + +%.c %.h:: %.l + @rm -f $*.[ch] + $(FLEX) --header-file=$*.h --outfile=$*.c $< + +genpath-target = $(call buildmakevars2header,_paths.h) +$(eval $(genpath-target)) + +clean: cleanlocal + +.PHONY: cleanlocal +cleanlocal: + $(RM) -f _*.h + $(RM) -f libxlutil.map diff --git a/tools/libxl/libxlutil.h b/tools/libs/util/include/libxlutil.h similarity index 100% rename from tools/libxl/libxlutil.h rename to tools/libs/util/include/libxlutil.h diff --git a/tools/libxl/libxlu_cfg.c b/tools/libs/util/libxlu_cfg.c similarity index 100% rename from tools/libxl/libxlu_cfg.c rename to tools/libs/util/libxlu_cfg.c diff --git a/tools/libxl/libxlu_cfg_i.h b/tools/libs/util/libxlu_cfg_i.h similarity index 100% rename from tools/libxl/libxlu_cfg_i.h rename to tools/libs/util/libxlu_cfg_i.h diff --git a/tools/libxl/libxlu_cfg_l.c b/tools/libs/util/libxlu_cfg_l.c similarity index 100% rename from tools/libxl/libxlu_cfg_l.c rename to tools/libs/util/libxlu_cfg_l.c diff --git a/tools/libxl/libxlu_cfg_l.h b/tools/libs/util/libxlu_cfg_l.h similarity index 100% rename from tools/libxl/libxlu_cfg_l.h rename to tools/libs/util/libxlu_cfg_l.h diff --git a/tools/libxl/libxlu_cfg_l.l b/tools/libs/util/libxlu_cfg_l.l similarity index 100% rename from tools/libxl/libxlu_cfg_l.l rename to tools/libs/util/libxlu_cfg_l.l diff --git a/tools/libxl/libxlu_cfg_y.c b/tools/libs/util/libxlu_cfg_y.c similarity index 100% rename from tools/libxl/libxlu_cfg_y.c rename to tools/libs/util/libxlu_cfg_y.c diff --git a/tools/libxl/libxlu_cfg_y.h b/tools/libs/util/libxlu_cfg_y.h similarity index 100% rename from tools/libxl/libxlu_cfg_y.h rename to tools/libs/util/libxlu_cfg_y.h diff --git a/tools/libxl/libxlu_cfg_y.y b/tools/libs/util/libxlu_cfg_y.y similarity index 100% rename from tools/libxl/libxlu_cfg_y.y rename to tools/libs/util/libxlu_cfg_y.y diff --git a/tools/libxl/libxlu_disk.c b/tools/libs/util/libxlu_disk.c similarity index 100% rename from tools/libxl/libxlu_disk.c rename to tools/libs/util/libxlu_disk.c diff --git a/tools/libxl/libxlu_disk_i.h b/tools/libs/util/libxlu_disk_i.h similarity index 100% rename from tools/libxl/libxlu_disk_i.h rename to tools/libs/util/libxlu_disk_i.h diff --git a/tools/libxl/libxlu_disk_l.c b/tools/libs/util/libxlu_disk_l.c similarity index 100% rename from tools/libxl/libxlu_disk_l.c rename to tools/libs/util/libxlu_disk_l.c diff --git a/tools/libxl/libxlu_disk_l.h b/tools/libs/util/libxlu_disk_l.h similarity index 100% rename from tools/libxl/libxlu_disk_l.h rename to tools/libs/util/libxlu_disk_l.h diff --git a/tools/libxl/libxlu_disk_l.l b/tools/libs/util/libxlu_disk_l.l similarity index 100% rename from tools/libxl/libxlu_disk_l.l rename to tools/libs/util/libxlu_disk_l.l diff --git a/tools/libxl/libxlu_internal.h b/tools/libs/util/libxlu_internal.h similarity index 100% rename from tools/libxl/libxlu_internal.h rename to tools/libs/util/libxlu_internal.h diff --git a/tools/libxl/libxlu_pci.c b/tools/libs/util/libxlu_pci.c similarity index 100% rename from tools/libxl/libxlu_pci.c rename to tools/libs/util/libxlu_pci.c diff --git a/tools/libxl/libxlu_vif.c b/tools/libs/util/libxlu_vif.c similarity index 100% rename from tools/libxl/libxlu_vif.c rename to tools/libs/util/libxlu_vif.c diff --git a/tools/libxl/xlutil.pc.in b/tools/libs/util/xlutil.pc.in similarity index 100% rename from tools/libxl/xlutil.pc.in rename to tools/libs/util/xlutil.pc.in diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile deleted file mode 100644 index 8d930dc047..0000000000 --- a/tools/libxl/Makefile +++ /dev/null @@ -1,114 +0,0 @@ -# -# tools/libxl/Makefile -# - -XEN_ROOT = $(CURDIR)/../.. -include $(XEN_ROOT)/tools/Rules.mk - -XLUMAJOR = 4.15 -XLUMINOR = 0 - -CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \ - -Wno-declaration-after-statement -Wformat-nonliteral -CFLAGS += -I. -fPIC - -CFLAGS += $(PTHREAD_CFLAGS) -LDFLAGS += $(PTHREAD_LDFLAGS) - -LIBXLU_LIBS = $(LDLIBS_libxenlight) - -ifeq ($(FLEX),) -%.c %.h:: %.l - $(warning Flex is needed to rebuild some libxl parsers and \ - scanners, please install it and rerun configure) -endif - -ifeq ($(BISON),) -%.c %.h:: %.y - $(warning Bison is needed to rebuild some libxl parsers and \ - scanners, please install it an rerun configure) -endif - -AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h libxlu_disk_l.h -AUTOSRCS= libxlu_cfg_y.c libxlu_cfg_l.c -LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_l.o libxlu_cfg.o \ - libxlu_disk_l.o libxlu_disk.o libxlu_vif.o libxlu_pci.o -$(LIBXLU_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h - -PKG_CONFIG = xlutil.pc - -ifneq ($(CONFIG_LIBXC_MINIOS),y) -PKG_CONFIG_INST := $(PKG_CONFIG) -xlutil.pc: PKG_CONFIG_VERSION = $(XLUMAJOR).$(XLUMINOR) -$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix) -$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir) -$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir) -endif - -PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) - -$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_VERSION = $(XLUMAJOR).$(XLUMINOR) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(CURDIR) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) - -.PHONY: all -all: libxlutil.so libxlutil.a $(AUTOSRCS) $(AUTOINCS) $(PKG_CONFIG) $(PKG_CONFIG_LOCAL) - -$(LIBXLU_OBJS): $(AUTOINCS) - -%.c %.h:: %.y - @rm -f $*.[ch] - $(BISON) --output=$*.c $< - -%.c %.h:: %.l - @rm -f $*.[ch] - $(FLEX) --header-file=$*.h --outfile=$*.c $< - -genpath-target = $(call buildmakevars2header,_paths.h) -$(eval $(genpath-target)) - -libxlutil.so: libxlutil.so.$(XLUMAJOR) - $(SYMLINK_SHLIB) $< $@ - -libxlutil.so.$(XLUMAJOR): libxlutil.so.$(XLUMAJOR).$(XLUMINOR) - $(SYMLINK_SHLIB) $< $@ - -libxlutil.so.$(XLUMAJOR).$(XLUMINOR): $(LIBXLU_OBJS) - $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxlutil.so.$(XLUMAJOR) $(SHLIB_LDFLAGS) -o $@ $(LIBXLU_OBJS) $(LIBXLU_LIBS) $(APPEND_LDFLAGS) - -libxlutil.a: $(LIBXLU_OBJS) - $(AR) rcs libxlutil.a $^ - -.PHONY: install -install: all - $(INSTALL_DIR) $(DESTDIR)$(libdir) - $(INSTALL_DIR) $(DESTDIR)$(includedir) - $(INSTALL_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(libdir) - $(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(libdir)/libxlutil.so.$(XLUMAJOR) - $(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(libdir)/libxlutil.so - $(INSTALL_DATA) libxlutil.a $(DESTDIR)$(libdir) - $(INSTALL_DATA) libxlutil.h $(DESTDIR)$(includedir) - $(INSTALL_DATA) xlutil.pc $(DESTDIR)$(PKG_INSTALLDIR) - -.PHONY: uninstall -uninstall: - rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xlutil.pc - rm -f $(DESTDIR)$(includedir)/libxlutil.h - rm -f $(DESTDIR)$(libdir)/libxlutil.a - rm -f $(DESTDIR)$(libdir)/libxlutil.so - rm -f $(DESTDIR)$(libdir)/libxlutil.so.$(XLUMAJOR) - rm -f $(DESTDIR)$(libdir)/libxlutil.so.$(XLUMAJOR).$(XLUMINOR) - -.PHONY: clean -clean: - $(RM) -f _*.h *.o *.so* *.a $(DEPS_RM) - $(RM) -f xlutil.pc - -distclean: clean - -realclean: distclean - $(RM) -f $(AUTOSRCS) $(AUTOINCS) - --include $(DEPS_INCLUDE)