From nobody Sun Apr 28 05:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1594830361; cv=none; d=zohomail.com; s=zohoarc; b=YvumJz9vUEAQ+UPA5AtwKeg6Hl42IS9uEyWoaIFklixCR9yAD9GBqRO4DhMc0FqpZhSoQjVA8empVGEpiDlXzX20t78vRF2tlQmUsUTWCLHLG+BoHX369eld7DC93AeKePdQ3h+HKdpQgemx06ttqeTX2b4p8FlQvwe2H+Y/A9E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594830361; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=/SzgjURKpQdufeU3mkXdT/V1+rT7yBiTEq3uzPPn+dE=; b=QMae46UU9XJ+iz+9rZMndznPE0FwJXz5rH4BgI/5TmuxkvJI2rHOU00bgDo1YigSgihelajJePATiH1TiShJeCTq200eDR1KkY8nog5is838220q5oEvIxjKXJQ1NWd1ZNmHR9nGZZkCrbGaLnOdBezekvLMZT9hc8HOIcYrtPM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1594830361219576.4717278362461; Wed, 15 Jul 2020 09:26:01 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkE3-0002Zn-Vm; Wed, 15 Jul 2020 16:25:43 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkE2-0002Yi-A6 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:25:42 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d00b3dae-c6b7-11ea-bca7-bc764e2007e4; Wed, 15 Jul 2020 16:25:36 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDv-0001sU-Je; Wed, 15 Jul 2020 17:25:35 +0100 X-Inumbo-ID: d00b3dae-c6b7-11ea-bca7-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [PATCH 01/12] stubdom: add stubdom/mini-os.mk for Xen paths used by Mini-OS Date: Wed, 15 Jul 2020 17:25:00 +0100 Message-Id: <20200715162511.5941-3-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Juergen Gross , Samuel Thibault , ian.jackson@eu.citrix.com Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" From: Juergen Gross 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 =3D -isystem $(XEN_ROOT)/tools/xenstore/include +TOOLCORE_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toolcore +TOOLLOG_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog +EVTCHN_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn +GNTTAB_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/gnttab +CALL_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/call +FOREIGNMEMORY_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/fore= ignmemory +DEVICEMODEL_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/device= model +CTRL_PATH =3D $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) +GUEST_PATH =3D $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) --=20 2.20.1 From nobody Sun Apr 28 05:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1594830361; cv=none; d=zohomail.com; s=zohoarc; b=hU63QCzLbQPPvcyeuTNAGIWRW/alYB2VTRd1Q1eIIKbzi5oQj2hX+KY4t4EkNRBul1Pg2v1VX7NE81uoY0Nf7X+iNn33+g07zTuwi9C68X2z9D0tX/bKFw/ByzAFhqI3xLK5WA2aoDbL69EFpsh5uigtepljnIeUoGvKRiz/gJg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594830361; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=t+eqsmIpngzoBD1DDU0sNX1lisg4SwFO0dTwjbfzFcI=; b=UbBJDYMl6yDofCWG8RtAt1s8ReNPh29y6ZKAF5sZLSYkHbae6mcX6Jb6KFALKsPa0wxzBBr4fxxUqDyrWmELOgYdNvxB4KmrZP6fUMYb3/PzEplh3TAWGrErEkku5fw7JFd5o4ETUU66QT86cVJWfOTfQcDxIM3NGnFrcF34gf0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1594830361373994.9049279203828; Wed, 15 Jul 2020 09:26:01 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkDy-0002ZO-LS; Wed, 15 Jul 2020 16:25: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 1jvkDx-0002Yi-9z for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:25:37 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id cfe5c24a-c6b7-11ea-bca7-bc764e2007e4; Wed, 15 Jul 2020 16:25:36 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDv-0001sU-91; Wed, 15 Jul 2020 17:25:35 +0100 X-Inumbo-ID: cfe5c24a-c6b7-11ea-bca7-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [PATCH 1/1] docs/process/branching-checklist: Get osstest branch right Date: Wed, 15 Jul 2020 17:24:59 +0100 Message-Id: <20200715162511.5941-2-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall , Wei Liu , Andrew Cooper , ian.jackson@eu.citrix.com, George Dunlap , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" The runes for this manual osstest were wrong. It needs to run as osstest, and cr-for-branches should be run from testing.git. Signed-off-by: Ian Jackson --- docs/process/branching-checklist.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/process/branching-checklist.txt b/docs/process/branching-= checklist.txt index e286e65962..0e83272caa 100644 --- a/docs/process/branching-checklist.txt +++ b/docs/process/branching-checklist.txt @@ -86,8 +86,8 @@ including turning off debug. =20 Set off a manual osstest run, since the osstest cr-for-branches change will take a while to take effect: - ssh osstest.test-lab - cd branches/for-xen-$v-testing.git + ssh osstest@osstest.test-lab + cd testing.git screen -S $v BRANCHES=3Dxen-$v-testing ./cr-for-branches branches -w "./cr-daily-bran= ch --real" =20 --=20 2.20.1 From nobody Sun Apr 28 05:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1594830373; cv=none; d=zohomail.com; s=zohoarc; b=kqwTZGmX9+F+jKV3A25fsDV7Nfp2PKu+8r928h8Y5Juyrr84KoX1bZxDWciKyZZZw4C9TKwbF3qrTro6OX9Mex8lkdggPes19agTD0qwv7sERYqGcmXzj4+WKkga98ZWV8V556PuO63sEKHQa2cEP7I/vIHltorgsMT2c6gnGi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594830373; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=NM2JUjtLafjY7+QiNhzFHxhk/klCSZ4M206DfM6hASE=; b=b2IRoOICKLT6WKki99OLmpsly7Df3+TAanQJsH5xG1KvP8f4Hv0Lzi5AXSrKhflS6CkNJsxcBfk+9KQ5vuBEOVurxEVT1kzUoJSEGeVP+QryYngSwK2mmvYZRsCQ1NmNA7SS8u1MfM+VoCQJ2GMxFjg7e7eSNf36eAVb7rLjni0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1594830373661947.4656421611475; Wed, 15 Jul 2020 09:26:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkED-0002d9-Mj; Wed, 15 Jul 2020 16:25:53 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkEC-0002Yi-AI for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:25:52 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d0395734-c6b7-11ea-b7bb-bc764e2007e4; Wed, 15 Jul 2020 16:25:36 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDv-0001sU-SJ; Wed, 15 Jul 2020 17:25:35 +0100 X-Inumbo-ID: d0395734-c6b7-11ea-b7bb-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [PATCH 02/12] tools: switch XEN_LIBXEN* make variables to lower case (XEN_libxen*) Date: Wed, 15 Jul 2020 17:25:01 +0100 Message-Id: <20200715162511.5941-4-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Juergen Gross , ian.jackson@eu.citrix.com, George Dunlap , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" From: Juergen Gross 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 --- 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 =3D $(XEN_ROOT)/tools/cross-install LDFLAGS +=3D $(PREPEND_LDFLAGS_XEN_TOOLS) =20 XEN_INCLUDE =3D $(XEN_ROOT)/tools/include -XEN_LIBXENTOOLCORE =3D $(XEN_ROOT)/tools/libs/toolcore -XEN_LIBXENTOOLLOG =3D $(XEN_ROOT)/tools/libs/toollog -XEN_LIBXENEVTCHN =3D $(XEN_ROOT)/tools/libs/evtchn -XEN_LIBXENGNTTAB =3D $(XEN_ROOT)/tools/libs/gnttab -XEN_LIBXENCALL =3D $(XEN_ROOT)/tools/libs/call -XEN_LIBXENFOREIGNMEMORY =3D $(XEN_ROOT)/tools/libs/foreignmemory -XEN_LIBXENDEVICEMODEL =3D $(XEN_ROOT)/tools/libs/devicemodel -XEN_LIBXENHYPFS =3D $(XEN_ROOT)/tools/libs/hypfs -XEN_LIBXC =3D $(XEN_ROOT)/tools/libxc -XEN_XENLIGHT =3D $(XEN_ROOT)/tools/libxl +XEN_libxentoolcore =3D $(XEN_ROOT)/tools/libs/toolcore +XEN_libxentoollog =3D $(XEN_ROOT)/tools/libs/toollog +XEN_libxenevtchn =3D $(XEN_ROOT)/tools/libs/evtchn +XEN_libxengnttab =3D $(XEN_ROOT)/tools/libs/gnttab +XEN_libxencall =3D $(XEN_ROOT)/tools/libs/call +XEN_libxenforeignmemory =3D $(XEN_ROOT)/tools/libs/foreignmemory +XEN_libxendevicemodel =3D $(XEN_ROOT)/tools/libs/devicemodel +XEN_libxenhypfs =3D $(XEN_ROOT)/tools/libs/hypfs +XEN_libxenctrl =3D $(XEN_ROOT)/tools/libxc +# Currently libxenguest lives in the same directory as libxenctrl +XEN_libxenguest =3D $(XEN_libxenctrl) +XEN_libxenlight =3D $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight -XEN_XLUTIL =3D $(XEN_XENLIGHT) -XEN_XENSTORE =3D $(XEN_ROOT)/tools/xenstore -XEN_LIBXENSTAT =3D $(XEN_ROOT)/tools/xenstat/libxenstat/src -XEN_LIBVCHAN =3D $(XEN_ROOT)/tools/libvchan +XEN_libxlutil =3D $(XEN_libxenlight) +XEN_libxenstore =3D $(XEN_ROOT)/tools/xenstore +XEN_libxenstat =3D $(XEN_ROOT)/tools/xenstat/libxenstat/src +XEN_libxenvchan =3D $(XEN_ROOT)/tools/libvchan =20 CFLAGS_xeninclude =3D -I$(XEN_INCLUDE) =20 @@ -97,75 +99,75 @@ endif # Consumers of libfoo should not directly use $(SHDEPS_libfoo) or # $(SHLIB_libfoo) =20 -CFLAGS_libxentoollog =3D -I$(XEN_LIBXENTOOLLOG)/include $(CFLAGS_xeninclud= e) +CFLAGS_libxentoollog =3D -I$(XEN_libxentoollog)/include $(CFLAGS_xeninclud= e) SHDEPS_libxentoollog =3D -LDLIBS_libxentoollog =3D $(SHDEPS_libxentoollog) $(XEN_LIBXENTOOLLOG)/libx= entoollog$(libextension) -SHLIB_libxentoollog =3D $(SHDEPS_libxentoollog) -Wl,-rpath-link=3D$(XEN_L= IBXENTOOLLOG) +LDLIBS_libxentoollog =3D $(SHDEPS_libxentoollog) $(XEN_libxentoollog)/libx= entoollog$(libextension) +SHLIB_libxentoollog =3D $(SHDEPS_libxentoollog) -Wl,-rpath-link=3D$(XEN_l= ibxentoollog) =20 -CFLAGS_libxentoolcore =3D -I$(XEN_LIBXENTOOLCORE)/include $(CFLAGS_xenincl= ude) +CFLAGS_libxentoolcore =3D -I$(XEN_libxentoolcore)/include $(CFLAGS_xenincl= ude) SHDEPS_libxentoolcore =3D -LDLIBS_libxentoolcore =3D $(SHDEPS_libxentoolcore) $(XEN_LIBXENTOOLCORE)/l= ibxentoolcore$(libextension) -SHLIB_libxentoolcore =3D $(SHDEPS_libxentoolcore) -Wl,-rpath-link=3D$(XEN= _LIBXENTOOLCORE) +LDLIBS_libxentoolcore =3D $(SHDEPS_libxentoolcore) $(XEN_libxentoolcore)/l= ibxentoolcore$(libextension) +SHLIB_libxentoolcore =3D $(SHDEPS_libxentoolcore) -Wl,-rpath-link=3D$(XEN= _libxentoolcore) =20 -CFLAGS_libxenevtchn =3D -I$(XEN_LIBXENEVTCHN)/include $(CFLAGS_xeninclude) +CFLAGS_libxenevtchn =3D -I$(XEN_libxenevtchn)/include $(CFLAGS_xeninclude) SHDEPS_libxenevtchn =3D $(SHLIB_libxentoolcore) -LDLIBS_libxenevtchn =3D $(SHDEPS_libxenevtchn) $(XEN_LIBXENEVTCHN)/libxene= vtchn$(libextension) -SHLIB_libxenevtchn =3D $(SHDEPS_libxenevtchn) -Wl,-rpath-link=3D$(XEN_LIB= XENEVTCHN) +LDLIBS_libxenevtchn =3D $(SHDEPS_libxenevtchn) $(XEN_libxenevtchn)/libxene= vtchn$(libextension) +SHLIB_libxenevtchn =3D $(SHDEPS_libxenevtchn) -Wl,-rpath-link=3D$(XEN_lib= xenevtchn) =20 -CFLAGS_libxengnttab =3D -I$(XEN_LIBXENGNTTAB)/include $(CFLAGS_xeninclude) +CFLAGS_libxengnttab =3D -I$(XEN_libxengnttab)/include $(CFLAGS_xeninclude) SHDEPS_libxengnttab =3D $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) -LDLIBS_libxengnttab =3D $(SHDEPS_libxengnttab) $(XEN_LIBXENGNTTAB)/libxeng= nttab$(libextension) -SHLIB_libxengnttab =3D $(SHDEPS_libxengnttab) -Wl,-rpath-link=3D$(XEN_LIB= XENGNTTAB) +LDLIBS_libxengnttab =3D $(SHDEPS_libxengnttab) $(XEN_libxengnttab)/libxeng= nttab$(libextension) +SHLIB_libxengnttab =3D $(SHDEPS_libxengnttab) -Wl,-rpath-link=3D$(XEN_lib= xengnttab) =20 -CFLAGS_libxencall =3D -I$(XEN_LIBXENCALL)/include $(CFLAGS_xeninclude) +CFLAGS_libxencall =3D -I$(XEN_libxencall)/include $(CFLAGS_xeninclude) SHDEPS_libxencall =3D $(SHLIB_libxentoolcore) -LDLIBS_libxencall =3D $(SHDEPS_libxencall) $(XEN_LIBXENCALL)/libxencall$(l= ibextension) -SHLIB_libxencall =3D $(SHDEPS_libxencall) -Wl,-rpath-link=3D$(XEN_LIBXENC= ALL) +LDLIBS_libxencall =3D $(SHDEPS_libxencall) $(XEN_libxencall)/libxencall$(l= ibextension) +SHLIB_libxencall =3D $(SHDEPS_libxencall) -Wl,-rpath-link=3D$(XEN_libxenc= all) =20 -CFLAGS_libxenforeignmemory =3D -I$(XEN_LIBXENFOREIGNMEMORY)/include $(CFLA= GS_xeninclude) +CFLAGS_libxenforeignmemory =3D -I$(XEN_libxenforeignmemory)/include $(CFLA= GS_xeninclude) SHDEPS_libxenforeignmemory =3D $(SHLIB_libxentoolcore) -LDLIBS_libxenforeignmemory =3D $(SHDEPS_libxenforeignmemory) $(XEN_LIBXENF= OREIGNMEMORY)/libxenforeignmemory$(libextension) -SHLIB_libxenforeignmemory =3D $(SHDEPS_libxenforeignmemory) -Wl,-rpath-li= nk=3D$(XEN_LIBXENFOREIGNMEMORY) +LDLIBS_libxenforeignmemory =3D $(SHDEPS_libxenforeignmemory) $(XEN_libxenf= oreignmemory)/libxenforeignmemory$(libextension) +SHLIB_libxenforeignmemory =3D $(SHDEPS_libxenforeignmemory) -Wl,-rpath-li= nk=3D$(XEN_libxenforeignmemory) =20 -CFLAGS_libxendevicemodel =3D -I$(XEN_LIBXENDEVICEMODEL)/include $(CFLAGS_x= eninclude) +CFLAGS_libxendevicemodel =3D -I$(XEN_libxendevicemodel)/include $(CFLAGS_x= eninclude) SHDEPS_libxendevicemodel =3D $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore= ) $(SHLIB_libxencall) -LDLIBS_libxendevicemodel =3D $(SHDEPS_libxendevicemodel) $(XEN_LIBXENDEVIC= EMODEL)/libxendevicemodel$(libextension) -SHLIB_libxendevicemodel =3D $(SHDEPS_libxendevicemodel) -Wl,-rpath-link= =3D$(XEN_LIBXENDEVICEMODEL) +LDLIBS_libxendevicemodel =3D $(SHDEPS_libxendevicemodel) $(XEN_libxendevic= emodel)/libxendevicemodel$(libextension) +SHLIB_libxendevicemodel =3D $(SHDEPS_libxendevicemodel) -Wl,-rpath-link= =3D$(XEN_libxendevicemodel) =20 -CFLAGS_libxenhypfs =3D -I$(XEN_LIBXENHYPFS)/include $(CFLAGS_xeninclude) +CFLAGS_libxenhypfs =3D -I$(XEN_libxenhypfs)/include $(CFLAGS_xeninclude) SHDEPS_libxenhypfs =3D $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) $(SH= LIB_libxencall) -LDLIBS_libxenhypfs =3D $(SHDEPS_libxenhypfs) $(XEN_LIBXENHYPFS)/libxenhypf= s$(libextension) -SHLIB_libxenhypfs =3D $(SHDEPS_libxenhypfs) -Wl,-rpath-link=3D$(XEN_LIBXE= NHYPFS) +LDLIBS_libxenhypfs =3D $(SHDEPS_libxenhypfs) $(XEN_libxenhypfs)/libxenhypf= s$(libextension) +SHLIB_libxenhypfs =3D $(SHDEPS_libxenhypfs) -Wl,-rpath-link=3D$(XEN_libxe= nhypfs) =20 # code which compiles against libxenctrl get __XEN_TOOLS__ and # therefore sees the unstable hypercall interfaces. -CFLAGS_libxenctrl =3D -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFL= AGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) $(CFLAGS_xeninclude) -= D__XEN_TOOLS__ +CFLAGS_libxenctrl =3D -I$(XEN_libxenctrl)/include $(CFLAGS_libxentoollog) = $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) $(CFLAGS_xeninclu= de) -D__XEN_TOOLS__ SHDEPS_libxenctrl =3D $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB= _libxengnttab) $(SHLIB_libxencall) $(SHLIB_libxenforeignmemory) $(SHLIB_lib= xendevicemodel) -LDLIBS_libxenctrl =3D $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libext= ension) -SHLIB_libxenctrl =3D $(SHDEPS_libxenctrl) -Wl,-rpath-link=3D$(XEN_LIBXC) +LDLIBS_libxenctrl =3D $(SHDEPS_libxenctrl) $(XEN_libxenctrl)/libxenctrl$(l= ibextension) +SHLIB_libxenctrl =3D $(SHDEPS_libxenctrl) -Wl,-rpath-link=3D$(XEN_libxenc= trl) =20 -CFLAGS_libxenguest =3D -I$(XEN_LIBXC)/include $(CFLAGS_libxenevtchn) $(CFL= AGS_libxenforeignmemory) $(CFLAGS_xeninclude) +CFLAGS_libxenguest =3D -I$(XEN_libxenguest)/include $(CFLAGS_libxenevtchn)= $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude) SHDEPS_libxenguest =3D $(SHLIB_libxenevtchn) -LDLIBS_libxenguest =3D $(SHDEPS_libxenguest) $(XEN_LIBXC)/libxenguest$(lib= extension) -SHLIB_libxenguest =3D $(SHDEPS_libxenguest) -Wl,-rpath-link=3D$(XEN_LIBXC) +LDLIBS_libxenguest =3D $(SHDEPS_libxenguest) $(XEN_libxenguest)/libxengues= t$(libextension) +SHLIB_libxenguest =3D $(SHDEPS_libxenguest) -Wl,-rpath-link=3D$(XEN_libxe= nguest) =20 -CFLAGS_libxenstore =3D -I$(XEN_XENSTORE)/include $(CFLAGS_xeninclude) +CFLAGS_libxenstore =3D -I$(XEN_libxenstore)/include $(CFLAGS_xeninclude) SHDEPS_libxenstore =3D $(SHLIB_libxentoolcore) -LDLIBS_libxenstore =3D $(SHDEPS_libxenstore) $(XEN_XENSTORE)/libxenstore$(= libextension) -SHLIB_libxenstore =3D $(SHDEPS_libxenstore) -Wl,-rpath-link=3D$(XEN_XENST= ORE) +LDLIBS_libxenstore =3D $(SHDEPS_libxenstore) $(XEN_libxenstore)/libxenstor= e$(libextension) +SHLIB_libxenstore =3D $(SHDEPS_libxenstore) -Wl,-rpath-link=3D$(XEN_libxe= nstore) ifeq ($(CONFIG_Linux),y) LDLIBS_libxenstore +=3D -ldl endif =20 -CFLAGS_libxenstat =3D -I$(XEN_LIBXENSTAT) +CFLAGS_libxenstat =3D -I$(XEN_libxenstat) SHDEPS_libxenstat =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) -LDLIBS_libxenstat =3D $(SHDEPS_libxenstat) $(XEN_LIBXENSTAT)/libxenstat$(= libextension) -SHLIB_libxenstat =3D $(SHDEPS_libxenstat) -Wl,-rpath-link=3D$(XEN_LIBXEN= STAT) +LDLIBS_libxenstat =3D $(SHDEPS_libxenstat) $(XEN_libxenstat)/libxenstat$(= libextension) +SHLIB_libxenstat =3D $(SHDEPS_libxenstat) -Wl,-rpath-link=3D$(XEN_libxen= stat) =20 -CFLAGS_libxenvchan =3D -I$(XEN_LIBVCHAN) $(CFLAGS_libxengnttab) $(CFLAGS_l= ibxenevtchn) +CFLAGS_libxenvchan =3D -I$(XEN_libxenvchan) $(CFLAGS_libxengnttab) $(CFLAG= S_libxenevtchn) SHDEPS_libxenvchan =3D $(SHLIB_libxentoollog) $(SHLIB_libxenstore) $(SHLIB= _libxenevtchn) $(SHLIB_libxengnttab) -LDLIBS_libxenvchan =3D $(SHDEPS_libxenvchan) $(XEN_LIBVCHAN)/libxenvchan$(= libextension) -SHLIB_libxenvchan =3D $(SHDEPS_libxenvchan) -Wl,-rpath-link=3D$(XEN_LIBVC= HAN) +LDLIBS_libxenvchan =3D $(SHDEPS_libxenvchan) $(XEN_libxenvchan)/libxenvcha= n$(libextension) +SHLIB_libxenvchan =3D $(SHDEPS_libxenvchan) -Wl,-rpath-link=3D$(XEN_libxe= nvchan) =20 ifeq ($(debug),y) # Disable optimizations @@ -176,15 +178,15 @@ else CFLAGS +=3D -O2 -fomit-frame-pointer endif =20 -CFLAGS_libxenlight =3D -I$(XEN_XENLIGHT) $(CFLAGS_libxenctrl) $(CFLAGS_xen= include) +CFLAGS_libxenlight =3D -I$(XEN_libxenlight) $(CFLAGS_libxenctrl) $(CFLAGS_= xeninclude) SHDEPS_libxenlight =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_li= bxenhypfs) -LDLIBS_libxenlight =3D $(SHDEPS_libxenlight) $(XEN_XENLIGHT)/libxenlight$(= libextension) -SHLIB_libxenlight =3D $(SHDEPS_libxenlight) -Wl,-rpath-link=3D$(XEN_XENLI= GHT) +LDLIBS_libxenlight =3D $(SHDEPS_libxenlight) $(XEN_libxenlight)/libxenligh= t$(libextension) +SHLIB_libxenlight =3D $(SHDEPS_libxenlight) -Wl,-rpath-link=3D$(XEN_libxe= nlight) =20 -CFLAGS_libxlutil =3D -I$(XEN_XLUTIL) +CFLAGS_libxlutil =3D -I$(XEN_libxlutil) SHDEPS_libxlutil =3D $(SHLIB_libxenlight) -LDLIBS_libxlutil =3D $(SHDEPS_libxlutil) $(XEN_XLUTIL)/libxlutil$(libexten= sion) -SHLIB_libxlutil =3D $(SHDEPS_libxlutil) -Wl,-rpath-link=3D$(XEN_XLUTIL) +LDLIBS_libxlutil =3D $(SHDEPS_libxlutil) $(XEN_libxlutil)/libxlutil$(libex= tension) +SHLIB_libxlutil =3D $(SHDEPS_libxlutil) -Wl,-rpath-link=3D$(XEN_libxlutil) =20 CFLAGS +=3D -D__XEN_INTERFACE_VERSION__=3D__XEN_LATEST_INTERFACE_VERSION__ =20 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=3D"$(CFLAGS_libxenlight) $(CFLAGS_libxentoollog)" CGO_LDFLAGS= =3D"$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -L$(XEN_XENLIGHT) -L$(XEN= _LIBXENTOOLLOG)" $(GO) build -x + CGO_CFLAGS=3D"$(CFLAGS_libxenlight) $(CFLAGS_libxentoollog)" CGO_LDFLAGS= =3D"$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -L$(XEN_libxenlight) -L$(= XEN_libxentoollog)" $(GO) build -x =20 .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) +=3D minios.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENCALL)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxencall)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) diff --git a/tools/libs/devicemodel/Makefile b/tools/libs/devicemodel/Makef= ile index 61bfa35273..d9d1d1b850 100644 --- a/tools/libs/devicemodel/Makefile +++ b/tools/libs/devicemodel/Makefile @@ -15,5 +15,5 @@ SRCS-$(CONFIG_MiniOS) +=3D compat.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENDEVICEMODEL)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxendevicemodel)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(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) +=3D minios.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENEVTCHN)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenevtchn)/include diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/M= akefile index 28f1bddc96..823989681d 100644 --- a/tools/libs/foreignmemory/Makefile +++ b/tools/libs/foreignmemory/Makefile @@ -15,5 +15,5 @@ SRCS-$(CONFIG_MiniOS) +=3D minios.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENFOREIGNMEMORY)/incl= ude +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenforeignmemory)/incl= ude $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(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) +=3D gnttab_unimp.c gntshr_unimp.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENGNTTAB)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxengnttab)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(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 +=3D core.c =20 include ../libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENHYPFS)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenhypfs)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(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 +=3D handlereg.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENTOOLCORE)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxentoolcore)/include =20 $(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 +=3D xtl_logger_stdio.c =20 include $(XEN_ROOT)/tools/libs/libs.mk =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENTOOLLOG)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxentoollog)/include diff --git a/tools/libvchan/Makefile b/tools/libvchan/Makefile index 913bcc8884..025a935cb7 100644 --- a/tools/libvchan/Makefile +++ b/tools/libvchan/Makefile @@ -35,7 +35,7 @@ endif PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) =20 $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBVCHAN) +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenvchan) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) =20 diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index fae5969a73..1e64116bd4 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -168,7 +168,7 @@ endif PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) =20 $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXC)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenctrl)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) =20 diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/M= akefile index 03cb212e3b..3d05ecdd9f 100644 --- a/tools/xenstat/libxenstat/Makefile +++ b/tools/xenstat/libxenstat/Makefile @@ -50,7 +50,7 @@ endif PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) =20 $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_LIBXENSTAT) +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenstat) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) =20 .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 :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) =20 $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_XENSTORE)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenstore)/include $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) =20 --=20 2.20.1 From nobody Sun Apr 28 05:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1594830366; cv=none; d=zohomail.com; s=zohoarc; b=bIVX1H+4K7X4m//K8/kc1VpX5yKHOuj9MCZmRTbjbvSBz3+fqOEejUXx7AEvdZJLv70NDbhxyP+vB3OPvtL0jU1sZZF/gF5GRzQSx7hiXSeTbtUPCNZMldTKUU1oevgi8ZAqDcxkZ17LVT8wscSDwK7r2gYkMs4lT9rUVhWiQjc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594830366; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=87NWDHB6CCcZkH3FuBcYmz3WXrGaMgWNG/O2uM1Kz0A=; b=hg54e+Chy9GhcwrR4unir2I5ZXp6dGuABGIUCgvBdJwORH49vhpFX6UR1fRdAijrm8b9RPjjZa3n7fGirTQbcLbjmpGTKzciqcWUhObH0hsTW+6TTC0nXUm45ek6jM33FJ16Kyj2c0JPJ5qZCv6T4JI5HWVUhnv8oee97v+8eD4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 159483036682983.49131461803836; Wed, 15 Jul 2020 09:26:06 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkE8-0002b5-CA; Wed, 15 Jul 2020 16:25:48 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkE7-0002Yi-AH for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:25:47 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d073c1b2-c6b7-11ea-b7bb-bc764e2007e4; Wed, 15 Jul 2020 16:25:37 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDw-0001sU-8D; Wed, 15 Jul 2020 17:25:36 +0100 X-Inumbo-ID: d073c1b2-c6b7-11ea-b7bb-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [PATCH 03/12] tools: add a copy of library headers in tools/include Date: Wed, 15 Jul 2020 17:25:02 +0100 Message-Id: <20200715162511.5941-5-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Juergen Gross , Stefano Stabellini , Julien Grall , Wei Liu , Andrew Cooper , ian.jackson@eu.citrix.com, George Dunlap , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" From: Juergen Gross 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 --- .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 =3D \ %.opic: %.S $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) $(CFLAGS.opic) -fPIC -c -o $@ $< $(APPE= ND_CFLAGS) =20 -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-uninst= all: .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 =20 PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) =20 +LIBHEADER ?=3D xen$(LIBNAME).h +LIBHEADERS =3D $(foreach h, $(LIBHEADER), include/$(h)) +LIBHEADERSGLOB =3D $(foreach h, $(LIBHEADER), $(XEN_ROOT)/tools/include/$(= h)) + $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) =20 @@ -47,7 +51,22 @@ build: .PHONY: libs libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) =20 -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/inclu= de; done =20 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); d= one $(INSTALL_DATA) xen$(LIBNAME).pc $(DESTDIR)$(PKG_INSTALLDIR) =20 .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) =20 .PHONY: distclean distclean: clean --=20 2.20.1 From nobody Sun Apr 28 05:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1594830373; cv=none; d=zohomail.com; s=zohoarc; b=Gv7sed5e4Y4J9zu8lOSJsz4jfx02m19C/wBtEtslS+L0jX2cf8txB2+AG5QvF++MVQ8ZQHxEDlrgIaFFkEfeZ5awaEzDxX+tsp0qXg6des1O83UfhJQaFZSzxnjTKdd+XcAYJN8sVJF5FeeoHDa5MR/gvt+VsRthqOIDIF+9BPQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594830373; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=D2m19fvPdoYLtE1spqFGsmUfeaEXV7tJ9Ox6wPfSt8c=; b=NXZ5IlDEYh1vqiEO0V0VdLVwipI8zWuX0wCTSkPLj5fEhuTK5HACx4CF6+HY9VkXaHw2nuB2jcXf0b43ACgYard+sOvb6BoyQRDOk8rpQa3woVu3Awd8s76Tv6k1x9dDgoBStHYS9585EZpQvPpp2LqxxCTGy1duZsiWVm82qf4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 159483037359525.687818447887594; Wed, 15 Jul 2020 09:26:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkEI-0002fY-83; Wed, 15 Jul 2020 16:25:58 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkEH-0002Yi-AT for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:25:57 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d0b03a0c-c6b7-11ea-bb8b-bc764e2007e4; Wed, 15 Jul 2020 16:25:37 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDw-0001sU-Gu; Wed, 15 Jul 2020 17:25:36 +0100 X-Inumbo-ID: d0b03a0c-c6b7-11ea-bb8b-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [PATCH 04/12] tools: don't call make recursively from libs.mk Date: Wed, 15 Jul 2020 17:25:03 +0100 Message-Id: <20200715162511.5941-6-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Juergen Gross , ian.jackson@eu.citrix.com, Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" From: Juergen Gross 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 --- 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 =3D $(CURDIR) all: build =20 .PHONY: build -build: - $(MAKE) libs +build: libs =20 .PHONY: libs libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) --=20 2.20.1 From nobody Sun Apr 28 05:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1594830374; cv=none; d=zohomail.com; s=zohoarc; b=FSUjEnyOd7Wx+NXI5rgSw4vpu2sorsv+xXUzvwbI+m991BV1v5uZdXFs2rv89AF7KhRNq9743Tr0e8JjQ1mURs2hY4fc3DYa8d7tOKzxUgGAsIB0mAHX4BFsaBOCIjfUTRvL8rE6D1mr6Fa58cz9/CvoE8Kw9rL5dBmaDAcF8Qs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594830374; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=7ovFIuCfccTo5lR9GobO3MSwamsLm8bZcjS6YjcqPow=; b=KepsYGqNnrgh3VqeI4Jm/+GNI0Sf6m36VdgmwlvuuAYS+oP6OnVAF4nBi9KyJxE+tu4zzxie8CYjbESUWa6lCOHJ/TPQ58SCN8DZ1BW7utihsDnECjst8fW+ltXcik4OgE4AVLn1lnJCklQo+e65HsdVtGHbXV+pXZSGCeNeIKM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1594830374995518.1858145585933; Wed, 15 Jul 2020 09:26:14 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkEN-0002iF-JS; Wed, 15 Jul 2020 16:26:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkEM-0002Yi-Am for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:26:02 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d0e35540-c6b7-11ea-b7bb-bc764e2007e4; Wed, 15 Jul 2020 16:25:37 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDw-0001sU-VQ; Wed, 15 Jul 2020 17:25:37 +0100 X-Inumbo-ID: d0e35540-c6b7-11ea-b7bb-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [PATCH 05/12] tools: define ROUNDUP() in tools/include/xen-tools/libs.h Date: Wed, 15 Jul 2020 17:25:04 +0100 Message-Id: <20200715162511.5941-7-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Juergen Gross , Anthony PERARD , ian.jackson@eu.citrix.com, Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" From: Juergen Gross 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 --- 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 =20 /* 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; =20 -#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 =20 +#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 =20 #include "private.h" =20 #define DBGPRINTF(_m...) \ xtl_log(xcall->logger, XTL_DEBUG, -1, "xencall:buffer", _m) =20 -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w)= )-1)) - pthread_mutex_t cache_mutex =3D PTHREAD_MUTEX_INITIALIZER; =20 static void cache_lock(xencall_handle *xcall) diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/li= nux.c index 8daa5828e3..fe73d5ab72 100644 --- a/tools/libs/foreignmemory/linux.c +++ b/tools/libs/foreignmemory/linux.c @@ -25,11 +25,10 @@ =20 #include #include +#include =20 #include "private.h" =20 -#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 =20 -/* 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) =20 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)) =20 -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w)= )-1)) #define NRPAGES(x) (ROUNDUP(x, PAGE_SHIFT) >> PAGE_SHIFT) =20 =20 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) =20 -#define ROUNDUP(_val, _order) \ - (((unsigned long)(_val)+(1UL<<(_order))-1) & ~((1UL<<(_order))-1)) - #define DIV_ROUNDUP(n, d) (((n) + (d) - 1) / (d)) =20 #define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m))) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_cor= e.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 =3D -1; static int ro_sock =3D -1; =20 -#define ROUNDUP(_x, _w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w= ))-1)) - static bool verbose =3D false; LIST_HEAD(connections); int tracefd =3D -1; --=20 2.20.1 From nobody Sun Apr 28 05:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1594830386; cv=none; d=zohomail.com; s=zohoarc; b=FBHap8QxVNmg9OTZ4HcEWQR01tXlyQZW0opJsTET5wArJTH7BxJOEjH77t+6EuFmXmdSN5GYIQatdy3xAsq0yliAr88TmbIw7oWjubm6AVIN1P0XEdByTqPUqDKqSsiQ3loxfVblnedmEJ3Ee7uqXWZSemkaYD3nmrOZb4k6Uag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594830386; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=a+u/JnnUxltVXzdc5URoolsZIdq6q98aVoWaUsUb6gQ=; b=MOlnj8mgeWTTjoL+Kf4W/cBfhv+uULXUN9D31uye7Rjnudq7Ev9nx2R4CQyD23mJEMJPW/6Fr4Kn7Nt5PhT2KvttJUCgLAWD2V3DgmfvJu5XFtmA7uGsxg+PvDGPT4/Ca+zdOmA7+ATkjPdKT4LVSFUNTuAWVE2xUspv70hTstM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1594830386101164.04092575716095; Wed, 15 Jul 2020 09:26:26 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkET-0002ku-0w; Wed, 15 Jul 2020 16:26:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkER-0002Yi-Al for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:26:07 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d10c44f0-c6b7-11ea-bca7-bc764e2007e4; Wed, 15 Jul 2020 16:25:38 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDx-0001sU-94; Wed, 15 Jul 2020 17:25:37 +0100 X-Inumbo-ID: d10c44f0-c6b7-11ea-bca7-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [PATCH 06/12] tools/misc: don't use libxenctrl internals from misc tools Date: Wed, 15 Jul 2020 17:25:05 +0100 Message-Id: <20200715162511.5941-8-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Juergen Gross , ian.jackson@eu.citrix.com, Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" From: Juergen Gross xen-hptool and xen-mfndump are using internals from libxenctrl e.g. by including private headers. Fix that by using either the correct official headers or use other means. Signed-off-by: Juergen Gross --- tools/libxc/xg_save_restore.h | 4 -- tools/misc/Makefile | 4 -- tools/misc/xen-hptool.c | 8 ++-- tools/misc/xen-mfndump.c | 70 +++++++++++++++++++---------------- 4 files changed, 43 insertions(+), 43 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) =20 -/* Returns TRUE if the PFN is currently mapped */ -#define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL)) - - #define GET_FIELD(_p, _f, _w) (((_w) =3D=3D 8) ? ((_p)->x64._f) : ((_p)->x= 32._f)) =20 #define SET_FIELD(_p, _f, _v, _w) do { \ diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 9fdb13597f..4e2e8f3b17 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -93,15 +93,11 @@ xenhypfs: xenhypfs.o xenlockprof: xenlockprof.o $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS) =20 -# xen-hptool incorrectly uses libxc internals -xen-hptool.o: CFLAGS +=3D -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall) xen-hptool: xen-hptool.o $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(L= DLIBS_libxenguest) $(LDLIBS_libxenstore) $(APPEND_LDFLAGS) =20 xenhypfs.o: CFLAGS +=3D $(CFLAGS_libxenhypfs) =20 -# xen-mfndump incorrectly uses libxc internals -xen-mfndump.o: CFLAGS +=3D -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall) xen-mfndump: xen-mfndump.o $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(L= DLIBS_libxenguest) $(APPEND_LDFLAGS) =20 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 =20 static xc_interface *xch; =20 diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c index 858bd0e26b..39ab00eb55 100644 --- a/tools/misc/xen-mfndump.c +++ b/tools/misc/xen-mfndump.c @@ -1,11 +1,17 @@ -#define XC_WANT_COMPAT_MAP_FOREIGN_API -#include -#include -#include +#include +#include +#include #include #include =20 -#include "xg_save_restore.h" +#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)) =20 static xc_interface *xch; =20 @@ -41,13 +47,13 @@ int dump_m2p_func(int argc, char *argv[]) /* Map M2P and obtain gpfn */ if ( xc_maximum_ram_page(xch, &max_mfn) < 0 ) { - ERROR("Failed to get the maximum mfn"); + fprintf(stderr, "Failed to get the maximum mfn"); return -1; } =20 if ( !(m2p_table =3D xc_map_m2p(xch, max_mfn, PROT_READ, NULL)) ) { - ERROR("Failed to map live M2P table"); + fprintf(stderr, "Failed to map live M2P table"); return -1; } =20 @@ -80,7 +86,7 @@ int dump_p2m_func(int argc, char *argv[]) if ( xc_domain_getinfo(xch, domid, 1, &info) !=3D 1 || info.domid !=3D domid ) { - ERROR("Failed to obtain info for domain %d\n", domid); + fprintf(stderr, "Failed to obtain info for domain %d\n", domid); return -1; } =20 @@ -88,7 +94,7 @@ int dump_p2m_func(int argc, char *argv[]) memset(&minfo, 0, sizeof(minfo)); if ( xc_map_domain_meminfo(xch, domid, &minfo) ) { - ERROR("Could not map domain %d memory information\n", domid); + fprintf(stderr, "Could not map domain %d memory information\n", do= mid); return -1; } =20 @@ -167,7 +173,7 @@ int dump_ptes_func(int argc, char *argv[]) if ( xc_domain_getinfo(xch, domid, 1, &info) !=3D 1 || info.domid !=3D domid ) { - ERROR("Failed to obtain info for domain %d\n", domid); + fprintf(stderr, "Failed to obtain info for domain %d\n", domid); return -1; } =20 @@ -175,7 +181,7 @@ int dump_ptes_func(int argc, char *argv[]) memset(&minfo, 0, sizeof(minfo)); if ( xc_map_domain_meminfo(xch, domid, &minfo) ) { - ERROR("Could not map domain %d memory information\n", domid); + fprintf(stderr, "Could not map domain %d memory information\n", do= mid); return -1; } =20 @@ -185,35 +191,35 @@ int dump_ptes_func(int argc, char *argv[]) !(m2p_table =3D xc_map_m2p(xch, max_mfn, PROT_READ, NULL)) ) { xc_unmap_domain_meminfo(xch, &minfo); - ERROR("Failed to map live M2P table"); + fprintf(stderr, "Failed to map live M2P table"); return -1; } =20 pfn =3D m2p_table[mfn]; if ( pfn >=3D minfo.p2m_size ) { - ERROR("pfn 0x%lx out of range for domain %d\n", pfn, domid); + fprintf(stderr, "pfn 0x%lx out of range for domain %d\n", pfn, dom= id); rc =3D -1; goto out; } =20 if ( !(minfo.pfn_type[pfn] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) ) { - ERROR("pfn 0x%lx for domain %d is not a PT\n", pfn, domid); + fprintf(stderr, "pfn 0x%lx for domain %d is not a PT\n", pfn, domi= d); rc =3D -1; goto out; } =20 - page =3D xc_map_foreign_range(xch, domid, PAGE_SIZE, PROT_READ, + page =3D xc_map_foreign_range(xch, domid, XC_PAGE_SIZE, PROT_READ, minfo.p2m_table[pfn]); if ( !page ) { - ERROR("Failed to map 0x%lx\n", minfo.p2m_table[pfn]); + fprintf(stderr, "Failed to map 0x%lx\n", minfo.p2m_table[pfn]); rc =3D -1; goto out; } =20 - pte_num =3D PAGE_SIZE / 8; + pte_num =3D XC_PAGE_SIZE / 8; =20 printf(" --- Dumping %d PTEs for domain %d ---\n", pte_num, domid); printf(" Guest Width: %u, PT Levels: %u P2M size: =3D %lu\n", @@ -249,7 +255,7 @@ int dump_ptes_func(int argc, char *argv[]) =20 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; @@ -275,7 +281,7 @@ int lookup_pte_func(int argc, char *argv[]) if ( xc_domain_getinfo(xch, domid, 1, &info) !=3D 1 || info.domid !=3D domid ) { - ERROR("Failed to obtain info for domain %d\n", domid); + fprintf(stderr, "Failed to obtain info for domain %d\n", domid); return -1; } =20 @@ -283,11 +289,11 @@ int lookup_pte_func(int argc, char *argv[]) memset(&minfo, 0, sizeof(minfo)); if ( xc_map_domain_meminfo(xch, domid, &minfo) ) { - ERROR("Could not map domain %d memory information\n", domid); + fprintf(stderr, "Could not map domain %d memory information\n", do= mid); return -1; } =20 - pte_num =3D PAGE_SIZE / 8; + pte_num =3D XC_PAGE_SIZE / 8; =20 printf(" --- Lookig for PTEs mapping mfn 0x%lx for domain %d ---\n", mfn, domid); @@ -299,7 +305,7 @@ int lookup_pte_func(int argc, char *argv[]) if ( !(minfo.pfn_type[i] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) ) continue; =20 - page =3D xc_map_foreign_range(xch, domid, PAGE_SIZE, PROT_READ, + page =3D xc_map_foreign_range(xch, domid, XC_PAGE_SIZE, PROT_READ, minfo.p2m_table[i]); if ( !page ) continue; @@ -309,15 +315,15 @@ int lookup_pte_func(int argc, char *argv[]) uint64_t pte =3D ((const uint64_t*)page)[j]; =20 #define __MADDR_BITS_X86 ((minfo.guest_width =3D=3D 8) ? 52 : 44) -#define __MFN_MASK_X86 ((1ULL << (__MADDR_BITS_X86 - PAGE_SHIFT_X86)) -= 1) - if ( ((pte >> PAGE_SHIFT_X86) & __MFN_MASK_X86) =3D=3D mfn) +#define __MFN_MASK_X86 ((1ULL << (__MADDR_BITS_X86 - XC_PAGE_SHIFT)) - = 1) + if ( ((pte >> XC_PAGE_SHIFT) & __MFN_MASK_X86) =3D=3D 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 } =20 - munmap(page, PAGE_SIZE); + munmap(page, XC_PAGE_SIZE); page =3D NULL; } =20 @@ -348,15 +354,15 @@ int memcmp_mfns_func(int argc, char *argv[]) xc_domain_getinfo(xch, domid2, 1, &info2) !=3D 1 || info1.domid !=3D domid1 || info2.domid !=3D domid2) { - ERROR("Failed to obtain info for domains\n"); + fprintf(stderr, "Failed to obtain info for domains\n"); return -1; } =20 - page1 =3D xc_map_foreign_range(xch, domid1, PAGE_SIZE, PROT_READ, mfn1= ); - page2 =3D xc_map_foreign_range(xch, domid2, PAGE_SIZE, PROT_READ, mfn2= ); + page1 =3D xc_map_foreign_range(xch, domid1, XC_PAGE_SIZE, PROT_READ, m= fn1); + page2 =3D xc_map_foreign_range(xch, domid2, XC_PAGE_SIZE, PROT_READ, m= fn2); if ( !page1 || !page2 ) { - ERROR("Failed to map either 0x%lx[dom %d] or 0x%lx[dom %d]\n", + fprintf(stderr, "Failed to map either 0x%lx[dom %d] or 0x%lx[dom %= d]\n", mfn1, domid1, mfn2, domid2); rc =3D -1; goto out; @@ -365,13 +371,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) =3D %d\n", memcmp(page1, page2, PAGE_SIZE)); + printf(" memcpy(1, 2) =3D %d\n", memcmp(page1, page2, XC_PAGE_SIZE)); =20 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; } =20 --=20 2.20.1 From nobody Sun Apr 28 05:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1594830399; cv=none; d=zohomail.com; s=zohoarc; b=Ajrpb8A93BdHE0MBKt+5fUpwKy5yfiI5GBfILTlhS2WFTae//xdImMUZfJL9gLdpmyNadf20ocb+4+qMJ4plrGUA3z0kwrUfxiDzCJiyEkusxRtDQD7n886At+ofkkpAAIduBldiBQOBpEYSAQGXGOI6xRxoSqz1wQs2w8zTm6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594830399; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=git0QoVqBceMsRL/sNtHLZ7HcHwJAU+n0wq2hePVKEw=; b=YCYRhGRn+kfhJm5P9JoODZVqKASyP9Mex5kkTBOFBQwFud9SJKxt1k+lFazfaoHw7fLhyn4WbmJH8kEOKJgWxPHhf7j2/vxdTICBwes28SgAjojNYCIXt12ndtprXbxPmxhkXr3fgdDUILC7syK7l7wvHqWo/RxNehFtEqW4iD8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1594830399201278.0931719953945; Wed, 15 Jul 2020 09:26:39 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkEY-0002oT-Bb; Wed, 15 Jul 2020 16:26:14 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkEW-0002Yi-B3 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:26:12 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d157443c-c6b7-11ea-b7bb-bc764e2007e4; Wed, 15 Jul 2020 16:25:38 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDx-0001sU-JK; Wed, 15 Jul 2020 17:25:37 +0100 X-Inumbo-ID: d157443c-c6b7-11ea-b7bb-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [PATCH 07/12] tools/libxc: untangle libxenctrl from libxenguest Date: Wed, 15 Jul 2020 17:25:06 +0100 Message-Id: <20200715162511.5941-9-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Juergen Gross , Wei Liu , ian.jackson@eu.citrix.com, =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Samuel Thibault Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" From: Juergen Gross 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. Additionally xc_dom.h needs to be exported, so rename it to xenctrl_dom.h. Rename all libxenguest sources from xc_* to xg_*. Move xc_[un]map_domain_meminfo() fnctions to new source xg_domain.c as they are defined in include/xenguest.h and should be in libxenguest. Remove xc_efi.h and xc_elf.h as they aren't used anywhere. Signed-off-by: Juergen Gross --- stubdom/grub/kexec.c | 2 +- tools/helpers/init-xenstore-domain.c | 2 +- tools/libxc/Makefile | 64 +++---- .../libxc/include/{xc_dom.h =3D> 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 | 129 +------------- tools/libxc/xc_efi.h | 158 ------------------ tools/libxc/xc_elf.h | 16 -- tools/libxc/xc_hcall_buf.c | 1 - tools/libxc/xc_private.c | 3 +- tools/libxc/xc_private.h | 36 ++++ tools/libxc/xc_resume.c | 2 - .../libxc/{xc_cpuid_x86.c =3D> xg_cpuid_x86.c} | 0 tools/libxc/{xc_dom_arm.c =3D> xg_dom_arm.c} | 2 +- ...imageloader.c =3D> xg_dom_armzimageloader.c} | 2 +- ...{xc_dom_binloader.c =3D> xg_dom_binloader.c} | 2 +- tools/libxc/{xc_dom_boot.c =3D> xg_dom_boot.c} | 2 +- ...bzimageloader.c =3D> xg_dom_bzimageloader.c} | 2 +- ...m_compat_linux.c =3D> xg_dom_compat_linux.c} | 2 +- tools/libxc/{xc_dom_core.c =3D> xg_dom_core.c} | 2 +- ...c_dom_decompress.h =3D> xg_dom_decompress.h} | 4 +- ...compress_lz4.c =3D> xg_dom_decompress_lz4.c} | 2 +- ...ss_unsafe.c =3D> xg_dom_decompress_unsafe.c} | 2 +- ...ss_unsafe.h =3D> xg_dom_decompress_unsafe.h} | 2 +- ...ip2.c =3D> xg_dom_decompress_unsafe_bzip2.c} | 2 +- ...lzma.c =3D> xg_dom_decompress_unsafe_lzma.c} | 2 +- ...o1x.c =3D> xg_dom_decompress_unsafe_lzo1x.c} | 2 +- ...afe_xz.c =3D> xg_dom_decompress_unsafe_xz.c} | 2 +- ...{xc_dom_elfloader.c =3D> xg_dom_elfloader.c} | 2 +- ...{xc_dom_hvmloader.c =3D> xg_dom_hvmloader.c} | 2 +- tools/libxc/{xc_dom_x86.c =3D> xg_dom_x86.c} | 2 +- tools/libxc/xg_domain.c | 149 +++++++++++++++++ .../libxc/{xc_nomigrate.c =3D> xg_nomigrate.c} | 0 .../{xc_offline_page.c =3D> xg_offline_page.c} | 2 +- tools/libxc/xg_private.h | 22 --- tools/libxc/xg_save_restore.h | 9 - .../libxc/{xc_sr_common.c =3D> xg_sr_common.c} | 2 +- .../libxc/{xc_sr_common.h =3D> xg_sr_common.h} | 4 +- ...{xc_sr_common_x86.c =3D> xg_sr_common_x86.c} | 2 +- ...{xc_sr_common_x86.h =3D> xg_sr_common_x86.h} | 2 +- ..._common_x86_pv.c =3D> xg_sr_common_x86_pv.c} | 2 +- ..._common_x86_pv.h =3D> xg_sr_common_x86_pv.h} | 2 +- .../{xc_sr_restore.c =3D> xg_sr_restore.c} | 2 +- ...tore_x86_hvm.c =3D> xg_sr_restore_x86_hvm.c} | 2 +- ...estore_x86_pv.c =3D> xg_sr_restore_x86_pv.c} | 2 +- tools/libxc/{xc_sr_save.c =3D> xg_sr_save.c} | 2 +- ...sr_save_x86_hvm.c =3D> xg_sr_save_x86_hvm.c} | 2 +- ...c_sr_save_x86_pv.c =3D> xg_sr_save_x86_pv.c} | 2 +- ..._stream_format.h =3D> xg_sr_stream_format.h} | 0 tools/libxc/{xc_suspend.c =3D> xg_suspend.c} | 0 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 +- 65 files changed, 284 insertions(+), 430 deletions(-) rename tools/libxc/include/{xc_dom.h =3D> xenctrl_dom.h} (98%) delete mode 100644 tools/libxc/xc_efi.h delete mode 100644 tools/libxc/xc_elf.h rename tools/libxc/{xc_cpuid_x86.c =3D> xg_cpuid_x86.c} (100%) rename tools/libxc/{xc_dom_arm.c =3D> xg_dom_arm.c} (99%) rename tools/libxc/{xc_dom_armzimageloader.c =3D> xg_dom_armzimageloader.c= } (99%) rename tools/libxc/{xc_dom_binloader.c =3D> xg_dom_binloader.c} (99%) rename tools/libxc/{xc_dom_boot.c =3D> xg_dom_boot.c} (99%) rename tools/libxc/{xc_dom_bzimageloader.c =3D> xg_dom_bzimageloader.c} (9= 9%) rename tools/libxc/{xc_dom_compat_linux.c =3D> xg_dom_compat_linux.c} (99%) rename tools/libxc/{xc_dom_core.c =3D> xg_dom_core.c} (99%) rename tools/libxc/{xc_dom_decompress.h =3D> xg_dom_decompress.h} (62%) rename tools/libxc/{xc_dom_decompress_lz4.c =3D> xg_dom_decompress_lz4.c} = (98%) rename tools/libxc/{xc_dom_decompress_unsafe.c =3D> xg_dom_decompress_unsa= fe.c} (96%) rename tools/libxc/{xc_dom_decompress_unsafe.h =3D> xg_dom_decompress_unsa= fe.h} (97%) rename tools/libxc/{xc_dom_decompress_unsafe_bzip2.c =3D> xg_dom_decompres= s_unsafe_bzip2.c} (87%) rename tools/libxc/{xc_dom_decompress_unsafe_lzma.c =3D> xg_dom_decompress= _unsafe_lzma.c} (87%) rename tools/libxc/{xc_dom_decompress_unsafe_lzo1x.c =3D> xg_dom_decompres= s_unsafe_lzo1x.c} (96%) rename tools/libxc/{xc_dom_decompress_unsafe_xz.c =3D> xg_dom_decompress_u= nsafe_xz.c} (95%) rename tools/libxc/{xc_dom_elfloader.c =3D> xg_dom_elfloader.c} (99%) rename tools/libxc/{xc_dom_hvmloader.c =3D> xg_dom_hvmloader.c} (99%) rename tools/libxc/{xc_dom_x86.c =3D> xg_dom_x86.c} (99%) create mode 100644 tools/libxc/xg_domain.c rename tools/libxc/{xc_nomigrate.c =3D> xg_nomigrate.c} (100%) rename tools/libxc/{xc_offline_page.c =3D> xg_offline_page.c} (99%) rename tools/libxc/{xc_sr_common.c =3D> xg_sr_common.c} (99%) rename tools/libxc/{xc_sr_common.h =3D> xg_sr_common.h} (99%) rename tools/libxc/{xc_sr_common_x86.c =3D> xg_sr_common_x86.c} (99%) rename tools/libxc/{xc_sr_common_x86.h =3D> xg_sr_common_x86.h} (98%) rename tools/libxc/{xc_sr_common_x86_pv.c =3D> xg_sr_common_x86_pv.c} (99%) rename tools/libxc/{xc_sr_common_x86_pv.h =3D> xg_sr_common_x86_pv.h} (98%) rename tools/libxc/{xc_sr_restore.c =3D> xg_sr_restore.c} (99%) rename tools/libxc/{xc_sr_restore_x86_hvm.c =3D> xg_sr_restore_x86_hvm.c} = (99%) rename tools/libxc/{xc_sr_restore_x86_pv.c =3D> xg_sr_restore_x86_pv.c} (9= 9%) rename tools/libxc/{xc_sr_save.c =3D> xg_sr_save.c} (99%) rename tools/libxc/{xc_sr_save_x86_hvm.c =3D> xg_sr_save_x86_hvm.c} (99%) rename tools/libxc/{xc_sr_save_x86_pv.c =3D> xg_sr_save_x86_pv.c} (99%) rename tools/libxc/{xc_sr_stream_format.h =3D> xg_sr_stream_format.h} (100= %) rename tools/libxc/{xc_suspend.c =3D> xg_suspend.c} (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 =20 #include -#include +#include =20 #include #include diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xens= tore-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/Makefile b/tools/libxc/Makefile index 1e64116bd4..6f94b5bb4c 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -52,20 +52,22 @@ CTRL_SRCS-y +=3D xc_gnttab_compat.c CTRL_SRCS-y +=3D xc_devicemodel_compat.c =20 GUEST_SRCS-y :=3D -GUEST_SRCS-y +=3D xg_private.c xc_suspend.c +GUEST_SRCS-y +=3D xg_private.c +GUEST_SRCS-y +=3D xg_domain.c +GUEST_SRCS-y +=3D xg_suspend.c ifeq ($(CONFIG_MIGRATE),y) -GUEST_SRCS-y +=3D xc_sr_common.c -GUEST_SRCS-$(CONFIG_X86) +=3D xc_sr_common_x86.c -GUEST_SRCS-$(CONFIG_X86) +=3D xc_sr_common_x86_pv.c -GUEST_SRCS-$(CONFIG_X86) +=3D xc_sr_restore_x86_pv.c -GUEST_SRCS-$(CONFIG_X86) +=3D xc_sr_restore_x86_hvm.c -GUEST_SRCS-$(CONFIG_X86) +=3D xc_sr_save_x86_pv.c -GUEST_SRCS-$(CONFIG_X86) +=3D xc_sr_save_x86_hvm.c -GUEST_SRCS-y +=3D xc_sr_restore.c -GUEST_SRCS-y +=3D xc_sr_save.c -GUEST_SRCS-y +=3D xc_offline_page.c +GUEST_SRCS-y +=3D xg_sr_common.c +GUEST_SRCS-$(CONFIG_X86) +=3D xg_sr_common_x86.c +GUEST_SRCS-$(CONFIG_X86) +=3D xg_sr_common_x86_pv.c +GUEST_SRCS-$(CONFIG_X86) +=3D xg_sr_restore_x86_pv.c +GUEST_SRCS-$(CONFIG_X86) +=3D xg_sr_restore_x86_hvm.c +GUEST_SRCS-$(CONFIG_X86) +=3D xg_sr_save_x86_pv.c +GUEST_SRCS-$(CONFIG_X86) +=3D xg_sr_save_x86_hvm.c +GUEST_SRCS-y +=3D xg_sr_restore.c +GUEST_SRCS-y +=3D xg_sr_save.c +GUEST_SRCS-y +=3D xg_offline_page.c else -GUEST_SRCS-y +=3D xc_nomigrate.c +GUEST_SRCS-y +=3D xg_nomigrate.c endif =20 vpath %.c ../../xen/common/libelf @@ -86,25 +88,26 @@ GUEST_SRCS-y +=3D cpuid.c msr.c endif =20 # new domain builder -GUEST_SRCS-y +=3D xc_dom_core.c xc_dom_boot.c -GUEST_SRCS-y +=3D xc_dom_elfloader.c -GUEST_SRCS-$(CONFIG_X86) +=3D xc_dom_bzimageloader.c -GUEST_SRCS-$(CONFIG_X86) +=3D xc_dom_decompress_lz4.c -GUEST_SRCS-$(CONFIG_X86) +=3D xc_dom_hvmloader.c -GUEST_SRCS-$(CONFIG_ARM) +=3D xc_dom_armzimageloader.c -GUEST_SRCS-y +=3D xc_dom_binloader.c -GUEST_SRCS-y +=3D xc_dom_compat_linux.c - -GUEST_SRCS-$(CONFIG_X86) +=3D xc_dom_x86.c -GUEST_SRCS-$(CONFIG_X86) +=3D xc_cpuid_x86.c -GUEST_SRCS-$(CONFIG_ARM) +=3D xc_dom_arm.c +GUEST_SRCS-y +=3D xg_dom_core.c +GUEST_SRCS-y +=3D xg_dom_boot.c +GUEST_SRCS-y +=3D xg_dom_elfloader.c +GUEST_SRCS-$(CONFIG_X86) +=3D xg_dom_bzimageloader.c +GUEST_SRCS-$(CONFIG_X86) +=3D xg_dom_decompress_lz4.c +GUEST_SRCS-$(CONFIG_X86) +=3D xg_dom_hvmloader.c +GUEST_SRCS-$(CONFIG_ARM) +=3D xg_dom_armzimageloader.c +GUEST_SRCS-y +=3D xg_dom_binloader.c +GUEST_SRCS-y +=3D xg_dom_compat_linux.c + +GUEST_SRCS-$(CONFIG_X86) +=3D xg_dom_x86.c +GUEST_SRCS-$(CONFIG_X86) +=3D xg_cpuid_x86.c +GUEST_SRCS-$(CONFIG_ARM) +=3D xg_dom_arm.c =20 ifeq ($(CONFIG_LIBXC_MINIOS),y) -GUEST_SRCS-y +=3D xc_dom_decompress_unsafe.c -GUEST_SRCS-y +=3D xc_dom_decompress_unsafe_bzip2.c -GUEST_SRCS-y +=3D xc_dom_decompress_unsafe_lzma.c -GUEST_SRCS-y +=3D xc_dom_decompress_unsafe_lzo1x.c -GUEST_SRCS-y +=3D xc_dom_decompress_unsafe_xz.c +GUEST_SRCS-y +=3D xg_dom_decompress_unsafe.c +GUEST_SRCS-y +=3D xg_dom_decompress_unsafe_bzip2.c +GUEST_SRCS-y +=3D xg_dom_decompress_unsafe_lzma.c +GUEST_SRCS-y +=3D xg_dom_decompress_unsafe_lzo1x.c +GUEST_SRCS-y +=3D xg_dom_decompress_unsafe_xz.c endif =20 -include $(XEN_TARGET_ARCH)/Makefile @@ -190,7 +193,7 @@ install: build $(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(libdir) $(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libx= enctrl.so.$(MAJOR) $(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenctrl.so - $(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h $(DESTDIR)$(in= cludedir) + $(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h include/xenctr= l_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)/lib= xenguest.so.$(MAJOR) @@ -210,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/xc_dom.h b/tools/libxc/include/xenctrl_dom= .h similarity index 98% rename from tools/libxc/include/xc_dom.h rename to tools/libxc/include/xenctrl_dom.h index 52a4d6c8c0..40b85b7755 100644 --- a/tools/libxc/include/xc_dom.h +++ b/tools/libxc/include/xenctrl_dom.h @@ -17,9 +17,7 @@ #define _XC_DOM_H =20 #include -#include =20 -#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; }; =20 +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); =20 /* 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 =20 +#include + #define XC_NUMA_NO_NODE (~0U) =20 #define XCFLAGS_LIVE (1 << 0) @@ -249,12 +251,6 @@ int xc_linux_build(xc_interface *xch, unsigned int console_evtchn, unsigned long *console_mfn); =20 -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 2ee1d205b4..e8c6fb96f9 100644 --- a/tools/libxc/xc_core.c +++ b/tools/libxc/xc_core.c @@ -60,12 +60,13 @@ * */ =20 -#include "xg_private.h" +#include "xc_private.h" #include "xc_core.h" -#include "xc_dom.h" #include #include =20 +#include + /* number of pages to write at a time */ #define DUMP_INCREMENT (4 * 1024) =20 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 =20 #include "xen/version.h" -#include "xg_private.h" +#include "xc_private.h" #include "xen/libelf/elfstructs.h" =20 /* 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 @@ * */ =20 -#include "xg_private.h" +#include "xc_private.h" #include "xc_core.h" =20 #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 @@ * */ =20 -#include "xg_private.h" +#include "xc_private.h" #include "xc_core.h" #include =20 -#define GET_FIELD(_p, _f) ((dinfo->guest_width=3D=3D8) ? ((_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 =20 live_p2m_frame_list_list =3D 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)); =20 if ( !live_p2m_frame_list_list ) { diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index 71829c2bce..43fab50c06 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -21,8 +21,7 @@ =20 #include "xc_private.h" #include "xc_core.h" -#include "xg_private.h" -#include "xg_save_restore.h" +#include "xc_private.h" #include #include =20 @@ -1892,132 +1891,6 @@ int xc_domain_unbind_pt_spi_irq(xc_interface *xch, PT_IRQ_TYPE_SPI, 0, 0, 0, 0, spi)); } =20 -int xc_unmap_domain_meminfo(xc_interface *xch, struct xc_domain_meminfo *m= info) -{ - struct domain_info_context _di =3D { .guest_width =3D minfo->guest_wid= th, - .p2m_size =3D minfo->p2m_size}; - struct domain_info_context *dinfo =3D &_di; - - free(minfo->pfn_type); - if ( minfo->p2m_table ) - munmap(minfo->p2m_table, P2M_FL_ENTRIES * PAGE_SIZE); - minfo->p2m_table =3D 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 =3D &_di; - - xc_dominfo_t info; - shared_info_any_t *live_shinfo; - xen_capabilities_info_t xen_caps =3D ""; - int i; - - /* Only be initialized once */ - if ( minfo->pfn_type || minfo->p2m_table ) - { - errno =3D EINVAL; - return -1; - } - - if ( xc_domain_getinfo(xch, domid, 1, &info) !=3D 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 =3D 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 =3D ( (minfo->guest_width =3D=3D 8) ? 4 : 3 ); - else if ( strstr(xen_caps, "xen-3.0-x86_32p") ) - minfo->pt_levels =3D 3; - else if ( strstr(xen_caps, "xen-3.0-x86_32") ) - minfo->pt_levels =3D 2; - else - { - errno =3D EFAULT; - return -1; - } - - /* We need the shared info page for mapping the P2M */ - live_shinfo =3D 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 =3D minfo->p2m_size; - - /* Make space and prepare for getting the PFN types */ - minfo->pfn_type =3D 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 =3D 0; i < minfo->p2m_size; i++ ) - minfo->pfn_type[i] =3D xc_pfn_to_mfn(i, minfo->p2m_table, - minfo->guest_width); - - /* Retrieve PFN types in batches */ - for ( i =3D 0; i < minfo->p2m_size ; i+=3D1024 ) - { - int count =3D ((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 =3D NULL; - } - if ( minfo->p2m_table ) - { - munmap(minfo->p2m_table, P2M_FL_ENTRIES * PAGE_SIZE); - minfo->p2m_table =3D NULL; - } - - return -1; -} - int xc_domain_memory_mapping( xc_interface *xch, uint32_t domid, 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, Apr= il 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) /* un= cached */ -#define EFI_MEMORY_WC ((uint64_t)0x0000000000000002ULL) /* wr= ite-coalescing */ -#define EFI_MEMORY_WT ((uint64_t)0x0000000000000004ULL) /* wr= ite-through */ -#define EFI_MEMORY_WB ((uint64_t)0x0000000000000008ULL) /* wr= ite-back */ -#define EFI_MEMORY_WP ((uint64_t)0x0000000000001000ULL) /* wr= ite-protect */ -#define EFI_MEMORY_RP ((uint64_t)0x0000000000002000ULL) /* re= ad-protect */ -#define EFI_MEMORY_XP ((uint64_t)0x0000000000004000ULL) /* ex= ecute-protect */ -#define EFI_MEMORY_RUNTIME ((uint64_t)0x8000000000000000ULL) /* ra= nge 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, 0= x00, 0x00, 0x00 ) -#define ACPI_20_TABLE_GUID \ - EFI_GUID( 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x= 3c, 0x88, 0x81 ) -#define SAL_SYSTEM_TABLE_GUID \ - EFI_GUID( 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x= 3f, 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 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 =20 #include "xc_private.h" -#include "xg_private.h" =20 xc_hypercall_buffer_t XC__HYPERCALL_BUFFER_NAME(HYPERCALL_BUFFER_NULL) =3D= { .hbuf =3D NULL, diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index 90974d572e..8af96b1b7e 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -18,8 +18,7 @@ */ =20 #include "xc_private.h" -#include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include #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 =20 #include "_paths.h" @@ -62,6 +63,39 @@ struct iovec { #include #endif =20 +#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w)= )-1)) + +#define GET_FIELD(_p, _f, _w) (((_w) =3D=3D 8) ? ((_p)->x64._f) : ((_p)->x= 32._f)) + +#define SET_FIELD(_p, _f, _v, _w) do { \ + if ((_w) =3D=3D 8) \ + (_p)->x64._f =3D (_v); \ + else \ + (_p)->x32._f =3D (_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_w= idth)) + #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 =20 +#define INVALID_PFN ((xen_pfn_t)-1) + /* ** Define max dirty page cache to permit during save/restore -- need to ba= lance=20 ** 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 @@ */ =20 #include "xc_private.h" -#include "xg_private.h" -#include "xg_save_restore.h" =20 #if defined(__i386__) || defined(__x86_64__) =20 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 99% rename from tools/libxc/xc_dom_arm.c rename to tools/libxc/xg_dom_arm.c index 931404c222..3f66f1d890 100644 --- a/tools/libxc/xc_dom_arm.c +++ b/tools/libxc/xg_dom_arm.c @@ -24,7 +24,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" =20 #define NR_MAGIC_PAGES 4 #define CONSOLE_PFN_OFFSET 0 diff --git a/tools/libxc/xc_dom_armzimageloader.c b/tools/libxc/xg_dom_armz= imageloader.c similarity index 99% rename from tools/libxc/xc_dom_armzimageloader.c rename to tools/libxc/xg_dom_armzimageloader.c index 0df8c2a4b1..4246c8e5fa 100644 --- a/tools/libxc/xc_dom_armzimageloader.c +++ b/tools/libxc/xg_dom_armzimageloader.c @@ -25,7 +25,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" =20 #include /* XXX ntohl is not the right function... */ =20 diff --git a/tools/libxc/xc_dom_binloader.c b/tools/libxc/xg_dom_binloader.c similarity index 99% rename from tools/libxc/xc_dom_binloader.c rename to tools/libxc/xg_dom_binloader.c index d6f7f2a500..870a921427 100644 --- a/tools/libxc/xc_dom_binloader.c +++ b/tools/libxc/xg_dom_binloader.c @@ -83,7 +83,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" =20 #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/xc_dom_boot.c b/tools/libxc/xg_dom_boot.c similarity index 99% rename from tools/libxc/xc_dom_boot.c rename to tools/libxc/xg_dom_boot.c index bb599b33ba..1e31e92244 100644 --- a/tools/libxc/xc_dom_boot.c +++ b/tools/libxc/xg_dom_boot.c @@ -31,7 +31,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "xc_core.h" #include #include diff --git a/tools/libxc/xc_dom_bzimageloader.c b/tools/libxc/xg_dom_bzimag= eloader.c similarity index 99% rename from tools/libxc/xc_dom_bzimageloader.c rename to tools/libxc/xg_dom_bzimageloader.c index a7d70cc7c6..f959a77602 100644 --- a/tools/libxc/xc_dom_bzimageloader.c +++ b/tools/libxc/xg_dom_bzimageloader.c @@ -32,7 +32,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom_decompress.h" +#include "xg_dom_decompress.h" =20 #include =20 diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xg_dom_compat_= linux.c similarity index 99% rename from tools/libxc/xc_dom_compat_linux.c rename to tools/libxc/xg_dom_compat_linux.c index b3d43feed9..b645f0b14b 100644 --- a/tools/libxc/xc_dom_compat_linux.c +++ b/tools/libxc/xg_dom_compat_linux.c @@ -30,7 +30,7 @@ =20 #include "xenctrl.h" #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" =20 /* -----------------------------------------------------------------------= - */ =20 diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xg_dom_core.c similarity index 99% rename from tools/libxc/xc_dom_core.c rename to tools/libxc/xg_dom_core.c index 327c8a8575..1c91cce315 100644 --- a/tools/libxc/xc_dom_core.c +++ b/tools/libxc/xg_dom_core.c @@ -32,7 +32,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "_paths.h" =20 /* -----------------------------------------------------------------------= - */ diff --git a/tools/libxc/xc_dom_decompress.h b/tools/libxc/xg_dom_decompres= s.h similarity index 62% rename from tools/libxc/xc_dom_decompress.h rename to tools/libxc/xg_dom_decompress.h index 42cefa3f0e..c5ab2e59eb 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" +# include "xenctrl_dom.h" #else -# include "xc_dom_decompress_unsafe.h" +# include "xg_dom_decompress_unsafe.h" #endif =20 int xc_try_lz4_decode(struct xc_dom_image *dom, void **blob, size_t *size); diff --git a/tools/libxc/xc_dom_decompress_lz4.c b/tools/libxc/xg_dom_decom= press_lz4.c similarity index 98% rename from tools/libxc/xc_dom_decompress_lz4.c rename to tools/libxc/xg_dom_decompress_lz4.c index b6a33f27a8..97ba620d86 100644 --- a/tools/libxc/xc_dom_decompress_lz4.c +++ b/tools/libxc/xg_dom_decompress_lz4.c @@ -4,7 +4,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom_decompress.h" +#include "xg_dom_decompress.h" =20 #define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS =20 diff --git a/tools/libxc/xc_dom_decompress_unsafe.c b/tools/libxc/xg_dom_de= compress_unsafe.c similarity index 96% rename from tools/libxc/xc_dom_decompress_unsafe.c rename to tools/libxc/xg_dom_decompress_unsafe.c index 164e35558f..21d964787d 100644 --- a/tools/libxc/xc_dom_decompress_unsafe.c +++ b/tools/libxc/xg_dom_decompress_unsafe.c @@ -3,7 +3,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom_decompress_unsafe.h" +#include "xg_dom_decompress_unsafe.h" =20 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_de= compress_unsafe.h similarity index 97% rename from tools/libxc/xc_dom_decompress_unsafe.h rename to tools/libxc/xg_dom_decompress_unsafe.h index 64f68864b1..fb84b6add8 100644 --- a/tools/libxc/xc_dom_decompress_unsafe.h +++ b/tools/libxc/xg_dom_decompress_unsafe.h @@ -1,4 +1,4 @@ -#include "xc_dom.h" +#include "xenctrl_dom.h" =20 typedef int decompress_fn(unsigned char *inbuf, unsigned int len, int (*fill)(void*, unsigned int), diff --git a/tools/libxc/xc_dom_decompress_unsafe_bzip2.c b/tools/libxc/xg_= dom_decompress_unsafe_bzip2.c similarity index 87% rename from tools/libxc/xc_dom_decompress_unsafe_bzip2.c rename to tools/libxc/xg_dom_decompress_unsafe_bzip2.c index 4dcabe4061..9d3709e6cc 100644 --- a/tools/libxc/xc_dom_decompress_unsafe_bzip2.c +++ b/tools/libxc/xg_dom_decompress_unsafe_bzip2.c @@ -3,7 +3,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom_decompress_unsafe.h" +#include "xg_dom_decompress_unsafe.h" =20 #include "../../xen/common/bunzip2.c" =20 diff --git a/tools/libxc/xc_dom_decompress_unsafe_lzma.c b/tools/libxc/xg_d= om_decompress_unsafe_lzma.c similarity index 87% rename from tools/libxc/xc_dom_decompress_unsafe_lzma.c rename to tools/libxc/xg_dom_decompress_unsafe_lzma.c index 4ee8cdbab1..5d178f0c43 100644 --- a/tools/libxc/xc_dom_decompress_unsafe_lzma.c +++ b/tools/libxc/xg_dom_decompress_unsafe_lzma.c @@ -3,7 +3,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom_decompress_unsafe.h" +#include "xg_dom_decompress_unsafe.h" =20 #include "../../xen/common/unlzma.c" =20 diff --git a/tools/libxc/xc_dom_decompress_unsafe_lzo1x.c b/tools/libxc/xg_= dom_decompress_unsafe_lzo1x.c similarity index 96% rename from tools/libxc/xc_dom_decompress_unsafe_lzo1x.c rename to tools/libxc/xg_dom_decompress_unsafe_lzo1x.c index 59888b9da2..a4f8ebd42d 100644 --- a/tools/libxc/xc_dom_decompress_unsafe_lzo1x.c +++ b/tools/libxc/xg_dom_decompress_unsafe_lzo1x.c @@ -5,7 +5,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom_decompress_unsafe.h" +#include "xg_dom_decompress_unsafe.h" =20 typedef uint8_t u8; typedef uint32_t u32; diff --git a/tools/libxc/xc_dom_decompress_unsafe_xz.c b/tools/libxc/xg_dom= _decompress_unsafe_xz.c similarity index 95% rename from tools/libxc/xc_dom_decompress_unsafe_xz.c rename to tools/libxc/xg_dom_decompress_unsafe_xz.c index fe7a7f49b4..ff6824b38d 100644 --- a/tools/libxc/xc_dom_decompress_unsafe_xz.c +++ b/tools/libxc/xg_dom_decompress_unsafe_xz.c @@ -6,7 +6,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom_decompress_unsafe.h" +#include "xg_dom_decompress_unsafe.h" =20 // TODO #define XZ_DEC_X86 diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xg_dom_elfloader.c similarity index 99% rename from tools/libxc/xc_dom_elfloader.c rename to tools/libxc/xg_dom_elfloader.c index b327db219d..7043c3bbba 100644 --- a/tools/libxc/xc_dom_elfloader.c +++ b/tools/libxc/xg_dom_elfloader.c @@ -26,7 +26,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "xc_bitops.h" =20 #define XEN_VER "xen-3.0" diff --git a/tools/libxc/xc_dom_hvmloader.c b/tools/libxc/xg_dom_hvmloader.c similarity index 99% rename from tools/libxc/xc_dom_hvmloader.c rename to tools/libxc/xg_dom_hvmloader.c index 3f0bd65547..995a0f3dc3 100644 --- a/tools/libxc/xc_dom_hvmloader.c +++ b/tools/libxc/xg_dom_hvmloader.c @@ -26,7 +26,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "xc_bitops.h" =20 /* -----------------------------------------------------------------------= - */ diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xg_dom_x86.c similarity index 99% rename from tools/libxc/xc_dom_x86.c rename to tools/libxc/xg_dom_x86.c index 9439805eaa..842dbcccdd 100644 --- a/tools/libxc/xc_dom_x86.c +++ b/tools/libxc/xg_dom_x86.c @@ -38,7 +38,7 @@ #include =20 #include "xg_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "xenctrl.h" =20 /* -----------------------------------------------------------------------= - */ diff --git a/tools/libxc/xg_domain.c b/tools/libxc/xg_domain.c new file mode 100644 index 0000000000..e982f7f077 --- /dev/null +++ b/tools/libxc/xg_domain.c @@ -0,0 +1,149 @@ +/*************************************************************************= ***** + * xc_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 *m= info) +{ + struct domain_info_context _di =3D { .guest_width =3D minfo->guest_wid= th, + .p2m_size =3D minfo->p2m_size}; + struct domain_info_context *dinfo =3D &_di; + + free(minfo->pfn_type); + if ( minfo->p2m_table ) + munmap(minfo->p2m_table, P2M_FL_ENTRIES * PAGE_SIZE); + minfo->p2m_table =3D 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 =3D &_di; + + xc_dominfo_t info; + shared_info_any_t *live_shinfo; + xen_capabilities_info_t xen_caps =3D ""; + int i; + + /* Only be initialized once */ + if ( minfo->pfn_type || minfo->p2m_table ) + { + errno =3D EINVAL; + return -1; + } + + if ( xc_domain_getinfo(xch, domid, 1, &info) !=3D 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 =3D 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 =3D ( (minfo->guest_width =3D=3D 8) ? 4 : 3 ); + else if ( strstr(xen_caps, "xen-3.0-x86_32p") ) + minfo->pt_levels =3D 3; + else if ( strstr(xen_caps, "xen-3.0-x86_32") ) + minfo->pt_levels =3D 2; + else + { + errno =3D EFAULT; + return -1; + } + + /* We need the shared info page for mapping the P2M */ + live_shinfo =3D 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 =3D minfo->p2m_size; + + /* Make space and prepare for getting the PFN types */ + minfo->pfn_type =3D 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 =3D 0; i < minfo->p2m_size; i++ ) + minfo->pfn_type[i] =3D xc_pfn_to_mfn(i, minfo->p2m_table, + minfo->guest_width); + + /* Retrieve PFN types in batches */ + for ( i =3D 0; i < minfo->p2m_size ; i+=3D1024 ) + { + int count =3D ((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 =3D NULL; + } + if ( minfo->p2m_table ) + { + munmap(minfo->p2m_table, P2M_FL_ENTRIES * PAGE_SIZE); + minfo->p2m_table =3D NULL; + } + + return -1; +} 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 99% rename from tools/libxc/xc_offline_page.c rename to tools/libxc/xg_offline_page.c index 19538fc436..77e8889b11 100644 --- a/tools/libxc/xc_offline_page.c +++ b/tools/libxc/xg_offline_page.c @@ -28,7 +28,7 @@ #include =20 #include "xc_private.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "xg_private.h" #include "xg_save_restore.h" =20 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; =20 #define NRPAGES(x) (ROUNDUP(x, PAGE_SHIFT) >> PAGE_SHIFT) =20 - -/* 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, x= en_pfn_t *p2m, } } =20 -/* 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_w= idth)) =20 /* Masks for PTE<->PFN conversions */ #define MADDR_BITS_X86 ((dinfo->guest_width =3D=3D 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) =20 -#define GET_FIELD(_p, _f, _w) (((_w) =3D=3D 8) ? ((_p)->x64._f) : ((_p)->x= 32._f)) - -#define SET_FIELD(_p, _f, _v, _w) do { \ - if ((_w) =3D=3D 8) \ - (_p)->x64._f =3D (_v); \ - else \ - (_p)->x32._f =3D (_v); \ -} while (0) - #define UNFOLD_CR3(_c) \ ((uint64_t)((dinfo->guest_width =3D=3D 8) = \ ? ((_c) >> 12) \ diff --git a/tools/libxc/xc_sr_common.c b/tools/libxc/xg_sr_common.c similarity index 99% rename from tools/libxc/xc_sr_common.c rename to tools/libxc/xg_sr_common.c index 7c54b03414..17567ab133 100644 --- a/tools/libxc/xc_sr_common.c +++ b/tools/libxc/xg_sr_common.c @@ -1,6 +1,6 @@ #include =20 -#include "xc_sr_common.h" +#include "xg_sr_common.h" =20 #include =20 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..13fcc47420 100644 --- a/tools/libxc/xc_sr_common.h +++ b/tools/libxc/xg_sr_common.h @@ -5,10 +5,10 @@ =20 #include "xg_private.h" #include "xg_save_restore.h" -#include "xc_dom.h" +#include "xenctrl_dom.h" #include "xc_bitops.h" =20 -#include "xc_sr_stream_format.h" +#include "xg_sr_stream_format.h" =20 /* String representation of Domain Header types. */ const char *dhdr_type_to_str(uint32_t type); diff --git a/tools/libxc/xc_sr_common_x86.c b/tools/libxc/xg_sr_common_x86.c similarity index 99% rename from tools/libxc/xc_sr_common_x86.c rename to tools/libxc/xg_sr_common_x86.c index 77ea044a74..6f12483907 100644 --- a/tools/libxc/xc_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" =20 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 =20 -#include "xc_sr_common.h" +#include "xg_sr_common.h" =20 /* * Obtains a domains TSC information from Xen and writes a X86_TSC_INFO re= cord diff --git a/tools/libxc/xc_sr_common_x86_pv.c b/tools/libxc/xg_sr_common_x= 86_pv.c similarity index 99% rename from tools/libxc/xc_sr_common_x86_pv.c rename to tools/libxc/xg_sr_common_x86_pv.c index d3d425cb82..cd33406aab 100644 --- a/tools/libxc/xc_sr_common_x86_pv.c +++ b/tools/libxc/xg_sr_common_x86_pv.c @@ -1,6 +1,6 @@ #include =20 -#include "xc_sr_common_x86_pv.h" +#include "xg_sr_common_x86_pv.h" =20 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_x= 86_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 =20 -#include "xc_sr_common_x86.h" +#include "xg_sr_common_x86.h" =20 /* Virtual address ranges reserved for hypervisor. */ #define HYPERVISOR_VIRT_START_X86_64 0xFFFF800000000000ULL diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xg_sr_restore.c similarity index 99% rename from tools/libxc/xc_sr_restore.c rename to tools/libxc/xg_sr_restore.c index bc811e6e3a..b57a787519 100644 --- a/tools/libxc/xc_sr_restore.c +++ b/tools/libxc/xg_sr_restore.c @@ -2,7 +2,7 @@ =20 #include =20 -#include "xc_sr_common.h" +#include "xg_sr_common.h" =20 /* * Read and validate the Image and Domain headers. diff --git a/tools/libxc/xc_sr_restore_x86_hvm.c b/tools/libxc/xg_sr_restor= e_x86_hvm.c similarity index 99% rename from tools/libxc/xc_sr_restore_x86_hvm.c rename to tools/libxc/xg_sr_restore_x86_hvm.c index a77624cc9d..d6ea6f3012 100644 --- a/tools/libxc/xc_sr_restore_x86_hvm.c +++ b/tools/libxc/xg_sr_restore_x86_hvm.c @@ -1,7 +1,7 @@ #include #include =20 -#include "xc_sr_common_x86.h" +#include "xg_sr_common_x86.h" =20 /* * Process an HVM_CONTEXT record from the stream. diff --git a/tools/libxc/xc_sr_restore_x86_pv.c b/tools/libxc/xg_sr_restore= _x86_pv.c similarity index 99% rename from tools/libxc/xc_sr_restore_x86_pv.c rename to tools/libxc/xg_sr_restore_x86_pv.c index d086271efb..dc50b0f5a8 100644 --- a/tools/libxc/xc_sr_restore_x86_pv.c +++ b/tools/libxc/xg_sr_restore_x86_pv.c @@ -1,6 +1,6 @@ #include =20 -#include "xc_sr_common_x86_pv.h" +#include "xg_sr_common_x86_pv.h" =20 static xen_pfn_t pfn_to_mfn(const struct xc_sr_context *ctx, xen_pfn_t pfn) { diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xg_sr_save.c similarity index 99% rename from tools/libxc/xc_sr_save.c rename to tools/libxc/xg_sr_save.c index 80b1d5de1f..d74c72cba6 100644 --- a/tools/libxc/xc_sr_save.c +++ b/tools/libxc/xg_sr_save.c @@ -1,7 +1,7 @@ #include #include =20 -#include "xc_sr_common.h" +#include "xg_sr_common.h" =20 /* * Writes an Image header and Domain header into the stream. diff --git a/tools/libxc/xc_sr_save_x86_hvm.c b/tools/libxc/xg_sr_save_x86_= hvm.c similarity index 99% rename from tools/libxc/xc_sr_save_x86_hvm.c rename to tools/libxc/xg_sr_save_x86_hvm.c index 0b2abb26bd..1634a7bc43 100644 --- a/tools/libxc/xc_sr_save_x86_hvm.c +++ b/tools/libxc/xg_sr_save_x86_hvm.c @@ -1,6 +1,6 @@ #include =20 -#include "xc_sr_common_x86.h" +#include "xg_sr_common_x86.h" =20 #include =20 diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xg_sr_save_x86_p= v.c similarity index 99% rename from tools/libxc/xc_sr_save_x86_pv.c rename to tools/libxc/xg_sr_save_x86_pv.c index c7e246ef4f..4964f1f7b8 100644 --- a/tools/libxc/xc_sr_save_x86_pv.c +++ b/tools/libxc/xg_sr_save_x86_pv.c @@ -1,7 +1,7 @@ #include #include =20 -#include "xc_sr_common_x86_pv.h" +#include "xg_sr_common_x86_pv.h" =20 /* 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_f= ormat.h similarity index 100% rename from tools/libxc/xc_sr_stream_format.h rename to tools/libxc/xg_sr_stream_format.h 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 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" =20 -#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" =20 -#include +#include =20 _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" =20 -#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 @@ =20 #include "libxl_internal.h" =20 -#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" =20 -#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 =20 #include =20 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 =20 -#include +#include =20 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" =20 -#include +#include =20 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" =20 -#include +#include =20 /* 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 =20 #include -#include "xc_dom.h" +#include "xenctrl_dom.h" #include #include =20 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 =20 #include -#include /* gunzip bits */ +#include /* gunzip bits */ =20 #include =20 --=20 2.20.1 From nobody Sun Apr 28 05:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1594830399; cv=none; d=zohomail.com; s=zohoarc; b=dmFzUJ7nljHWSMYlFH9tMEx1Wd0s0qXBl1aea4HN4mYG8Rd5/WG9W3wL/LpGD0+8YPT96qYDpvDxNGsVqWbPpU2zHi9YOq5JBPK9wWQI1UUCBjDAKRU6VVTmjAcWqZC6LFpeUTX0fCw5bVgHLYRfpv1vNJjbQvCIdBR44iMUEjk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594830399; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=pauaF28Yo/tQaTeP2USviz6CafBZbZGadYjcOekqhLA=; b=SSJlpR0HIt/sWExjnFkAX9j7hgt+AMZgzzzBH6+/F+8eYMR11lA/AY1dUBxXBTHhkFEFKRALqnCreDnlt++11V5QEaMGmWVgYCmV/WPYJrOrO7Vh7R9EZa+onkr7Z4xu4XbraqIjKDCHOjUPefhLSjOA6jhhoXJ6jREXxtUWDnc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1594830399037746.4315129679266; Wed, 15 Jul 2020 09:26:39 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkEd-0002s5-2J; Wed, 15 Jul 2020 16:26:19 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkEb-0002Yi-B7 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:26:17 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d1acb2dc-c6b7-11ea-bca7-bc764e2007e4; Wed, 15 Jul 2020 16:25:39 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDy-0001sU-51; Wed, 15 Jul 2020 17:25:38 +0100 X-Inumbo-ID: d1acb2dc-c6b7-11ea-bca7-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org, xen-devel@dornerworks.com Subject: [PATCH 08/12] tools: move libxenctrl below tools/libs Date: Wed, 15 Jul 2020 17:25:07 +0100 Message-Id: <20200715162511.5941-10-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Juergen Gross , Stefano Stabellini , Julien Grall , Wei Liu , Andrew Cooper , ian.jackson@eu.citrix.com, George Dunlap , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Josh Whitehead , Jan Beulich , Stewart Hildebrand , Samuel Thibault Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" From: Juergen Gross 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 --- .gitignore | 7 ++ MAINTAINERS | 2 +- stubdom/Makefile | 29 +++++- stubdom/mini-os.mk | 2 +- tools/Makefile | 3 + tools/Rules.mk | 9 +- tools/libs/Makefile | 1 + tools/libs/ctrl/Makefile | 69 +++++++++++++ tools/{libxc =3D> libs/ctrl}/include/xenctrl.h | 0 .../ctrl}/include/xenctrl_compat.h | 0 .../ctrl}/include/xenctrl_dom.h | 0 tools/libs/ctrl/libxenctrl.map | 3 + tools/{libxc =3D> libs/ctrl}/xc_altp2m.c | 0 tools/{libxc =3D> libs/ctrl}/xc_arinc653.c | 0 tools/{libxc =3D> libs/ctrl}/xc_bitops.h | 0 tools/{libxc =3D> libs/ctrl}/xc_core.c | 0 tools/{libxc =3D> libs/ctrl}/xc_core.h | 0 tools/{libxc =3D> libs/ctrl}/xc_core_arm.c | 0 tools/{libxc =3D> libs/ctrl}/xc_core_arm.h | 0 tools/{libxc =3D> libs/ctrl}/xc_core_x86.c | 0 tools/{libxc =3D> libs/ctrl}/xc_core_x86.h | 0 tools/{libxc =3D> libs/ctrl}/xc_cpu_hotplug.c | 0 tools/{libxc =3D> libs/ctrl}/xc_cpupool.c | 0 tools/{libxc =3D> libs/ctrl}/xc_csched.c | 0 tools/{libxc =3D> libs/ctrl}/xc_csched2.c | 0 .../ctrl}/xc_devicemodel_compat.c | 0 tools/{libxc =3D> libs/ctrl}/xc_domain.c | 0 tools/{libxc =3D> libs/ctrl}/xc_evtchn.c | 0 tools/{libxc =3D> libs/ctrl}/xc_evtchn_compat.c | 0 tools/{libxc =3D> libs/ctrl}/xc_flask.c | 0 .../{libxc =3D> libs/ctrl}/xc_foreign_memory.c | 0 tools/{libxc =3D> libs/ctrl}/xc_freebsd.c | 0 tools/{libxc =3D> libs/ctrl}/xc_gnttab.c | 0 tools/{libxc =3D> libs/ctrl}/xc_gnttab_compat.c | 0 tools/{libxc =3D> libs/ctrl}/xc_hcall_buf.c | 0 tools/{libxc =3D> libs/ctrl}/xc_kexec.c | 0 tools/{libxc =3D> libs/ctrl}/xc_linux.c | 0 tools/{libxc =3D> libs/ctrl}/xc_mem_access.c | 0 tools/{libxc =3D> libs/ctrl}/xc_mem_paging.c | 0 tools/{libxc =3D> libs/ctrl}/xc_memshr.c | 0 tools/{libxc =3D> libs/ctrl}/xc_minios.c | 0 tools/{libxc =3D> libs/ctrl}/xc_misc.c | 0 tools/{libxc =3D> libs/ctrl}/xc_monitor.c | 0 tools/{libxc =3D> libs/ctrl}/xc_msr_x86.h | 0 tools/{libxc =3D> libs/ctrl}/xc_netbsd.c | 0 tools/{libxc =3D> libs/ctrl}/xc_pagetab.c | 0 tools/{libxc =3D> libs/ctrl}/xc_physdev.c | 0 tools/{libxc =3D> libs/ctrl}/xc_pm.c | 0 tools/{libxc =3D> libs/ctrl}/xc_private.c | 0 tools/{libxc =3D> libs/ctrl}/xc_private.h | 0 tools/{libxc =3D> libs/ctrl}/xc_psr.c | 0 tools/{libxc =3D> libs/ctrl}/xc_resource.c | 0 tools/{libxc =3D> libs/ctrl}/xc_resume.c | 0 tools/{libxc =3D> libs/ctrl}/xc_rt.c | 0 tools/{libxc =3D> libs/ctrl}/xc_solaris.c | 0 tools/{libxc =3D> libs/ctrl}/xc_tbuf.c | 0 tools/{libxc =3D> libs/ctrl}/xc_vm_event.c | 0 .../ctrl/xenctrl.pc.in} | 0 tools/libxc/Makefile | 99 +++---------------- tools/libxl/Makefile | 2 +- tools/misc/Makefile | 1 + tools/python/Makefile | 2 +- tools/python/setup.py | 10 +- 63 files changed, 132 insertions(+), 107 deletions(-) create mode 100644 tools/libs/ctrl/Makefile rename tools/{libxc =3D> libs/ctrl}/include/xenctrl.h (100%) rename tools/{libxc =3D> libs/ctrl}/include/xenctrl_compat.h (100%) rename tools/{libxc =3D> libs/ctrl}/include/xenctrl_dom.h (100%) create mode 100644 tools/libs/ctrl/libxenctrl.map rename tools/{libxc =3D> libs/ctrl}/xc_altp2m.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_arinc653.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_bitops.h (100%) rename tools/{libxc =3D> libs/ctrl}/xc_core.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_core.h (100%) rename tools/{libxc =3D> libs/ctrl}/xc_core_arm.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_core_arm.h (100%) rename tools/{libxc =3D> libs/ctrl}/xc_core_x86.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_core_x86.h (100%) rename tools/{libxc =3D> libs/ctrl}/xc_cpu_hotplug.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_cpupool.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_csched.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_csched2.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_devicemodel_compat.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_domain.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_evtchn.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_evtchn_compat.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_flask.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_foreign_memory.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_freebsd.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_gnttab.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_gnttab_compat.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_hcall_buf.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_kexec.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_linux.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_mem_access.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_mem_paging.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_memshr.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_minios.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_misc.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_monitor.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_msr_x86.h (100%) rename tools/{libxc =3D> libs/ctrl}/xc_netbsd.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_pagetab.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_physdev.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_pm.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_private.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_private.h (100%) rename tools/{libxc =3D> libs/ctrl}/xc_psr.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_resource.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_resume.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_rt.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_solaris.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_tbuf.c (100%) rename tools/{libxc =3D> libs/ctrl}/xc_vm_event.c (100%) rename tools/{libxc/xencontrol.pc.in =3D> libs/ctrl/xenctrl.pc.in} (100%) diff --git a/.gitignore b/.gitignore index 5ea48af818..e28c21641c 100644 --- a/.gitignore +++ b/.gitignore @@ -114,6 +114,8 @@ tools/libs/hypfs/headers.chk tools/libs/hypfs/xenhypfs.pc tools/libs/call/headers.chk tools/libs/call/xencall.pc +tools/libs/ctrl/_paths.h +tools/libs/ctrl/xenctrl.pc tools/libs/foreignmemory/headers.chk tools/libs/foreignmemory/xenforeignmemory.pc tools/libs/devicemodel/headers.chk @@ -195,6 +197,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 e374816755..7d25ed9c95 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 =20 ARM (W/ VIRTUALISATION EXTENSIONS) ARCHITECTURE M: Stefano Stabellini diff --git a/stubdom/Makefile b/stubdom/Makefile index af8cde41b9..8147635ad0 100644 --- a/stubdom/Makefile +++ b/stubdom/Makefile @@ -351,13 +351,16 @@ libs-$(XEN_TARGET_ARCH)/foreignmemory/stamp: $(XEN_RO= OT)/tools/libs/foreignmemor libs-$(XEN_TARGET_ARCH)/devicemodel/stamp: $(XEN_ROOT)/tools/libs/devicemo= del/Makefile $(do_links) =20 +libs-$(XEN_TARGET_ARCH)/ctrl/stamp: $(XEN_ROOT)/tools/libs/ctrl/Makefile + $(do_links) + libxc-$(XEN_TARGET_ARCH)/stamp: $(XEN_ROOT)/tools/libxc/Makefile $(do_links) =20 xenstore/stamp: $(XEN_ROOT)/tools/xenstore/Makefile $(do_links) =20 -LINK_LIBS_DIRS :=3D toolcore toollog evtchn gnttab call foreignmemory devi= cemodel +LINK_LIBS_DIRS :=3D toolcore toollog evtchn gnttab call foreignmemory devi= cemodel ctrl LINK_DIRS :=3D libxc-$(XEN_TARGET_ARCH) xenstore $(foreach dir,$(LINK_LIBS= _DIRS),libs-$(XEN_TARGET_ARCH)/$(dir)) LINK_STAMPS :=3D $(foreach dir,$(LINK_DIRS),$(dir)/stamp) =20 @@ -405,6 +408,7 @@ libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-hea= ders-$(XEN_TARGET_ARCH) $ =20 .PHONY: libxenevtchn libxenevtchn: libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a +libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: libxentoolcore libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: mk-headers-$(XEN_TARGET_ARC= H) $(NEWLIB_STAMPFILE) CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTD= IR=3D -C libs-$(XEN_TARGET_ARCH)/evtchn =20 @@ -414,6 +418,7 @@ libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: mk-heade= rs-$(XEN_TARGET_ARCH) $(N =20 .PHONY: libxengnttab libxengnttab: libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a +libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: libxentoolcore libxentoollog libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARC= H) $(NEWLIB_STAMPFILE) CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTD= IR=3D -C libs-$(XEN_TARGET_ARCH)/gnttab =20 @@ -423,6 +428,7 @@ libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-heade= rs-$(XEN_TARGET_ARCH) $(N =20 .PHONY: libxencall libxencall: libs-$(XEN_TARGET_ARCH)/call/libxencall.a +libs-$(XEN_TARGET_ARCH)/call/libxencall.a: libxentoolcore libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $= (NEWLIB_STAMPFILE) CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTD= IR=3D -C libs-$(XEN_TARGET_ARCH)/call =20 @@ -432,6 +438,7 @@ libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$= (XEN_TARGET_ARCH) $(NEWLI =20 .PHONY: libxenforeignmemory libxenforeignmemory: libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignme= mory.a +libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: libxentoolcore libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: mk-headers-$(= XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTD= IR=3D -C libs-$(XEN_TARGET_ARCH)/foreignmemory =20 @@ -441,20 +448,31 @@ libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignme= mory.a: mk-headers-$(XEN_TA =20 .PHONY: libxendevicemodel libxendevicemodel: libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a +libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a: libxentoolcore li= bxentoollog libxencall libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a: mk-headers-$(XEN_= TARGET_ARCH) $(NEWLIB_STAMPFILE) CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTD= IR=3D -C libs-$(XEN_TARGET_ARCH)/devicemodel =20 +####### +####### +# libxenctrl +####### + +.PHONY: libxenctrl +libxenctrl: libs-$(XEN_TARGET_ARCH)/ctrl/libxenctrl.a +libs-$(XEN_TARGET_ARCH)/ctrl/libxenctrl.a: libxentoollog libxencall libxen= evtchn libxengnttab libxenforeignmemory libxendevicemodel +libs-$(XEN_TARGET_ARCH)/ctrl/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) $= (NEWLIB_STAMPFILE) + CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTD= IR=3D CONFIG_LIBXC_MINIOS=3Dy -C libs-$(XEN_TARGET_ARCH)/ctrl + ####### # libxc ####### =20 .PHONY: libxc -libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libx= enguest.a -libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxe= ntoolcore libxentoollog libxenevtchn libxengnttab libxencall libxenforeignm= emory 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) $(NE= WLIB_STAMPFILE) CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTD= IR=3D CONFIG_LIBXC_MINIOS=3Dy -C libxc-$(XEN_TARGET_ARCH) =20 - libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenct= rl.a - ####### # ioemu ####### @@ -681,6 +699,7 @@ clean: [ ! -e libs-$(XEN_TARGET_ARCH)/call/Makefile ] || $(MAKE) DESTDIR=3D -C l= ibs-$(XEN_TARGET_ARCH)/call clean [ ! -e libs-$(XEN_TARGET_ARCH)/foreignmemory/Makefile ] || $(MAKE) DESTDI= R=3D -C libs-$(XEN_TARGET_ARCH)/foreignmemory clean [ ! -e libs-$(XEN_TARGET_ARCH)/devicemodel/Makefile ] || $(MAKE) DESTDIR= =3D -C libs-$(XEN_TARGET_ARCH)/devicemodel clean + [ ! -e libs-$(XEN_TARGET_ARCH)/ctrl/Makefile ] || $(MAKE) DESTDIR=3D -C l= ibs-$(XEN_TARGET_ARCH)/ctrl clean [ ! -e libxc-$(XEN_TARGET_ARCH)/Makefile ] || $(MAKE) DESTDIR=3D -C libxc= -$(XEN_TARGET_ARCH) clean -[ ! -d ioemu ] || $(MAKE) DESTDIR=3D -C ioemu clean -[ ! -d xenstore ] || $(MAKE) DESTDIR=3D -C xenstore clean 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 =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_= ARCH)/gnttab CALL_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/call FOREIGNMEMORY_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/fore= ignmemory DEVICEMODEL_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/device= model -CTRL_PATH =3D $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) +CTRL_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/ctrl GUEST_PATH =3D $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) diff --git a/tools/Makefile b/tools/Makefile index c10946e3b1..7c62c599dd 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -255,6 +255,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find -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/libs/ctrl/include \ -I$(XEN_ROOT)/tools/libxc/include \ -I$(XEN_ROOT)/tools/xenstore/include \ -I$(XEN_ROOT)/tools/xenstore/compat/include \ @@ -266,6 +267,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find -L$(XEN_ROOT)/tools/libs/gnttab \ -L$(XEN_ROOT)/tools/libs/foreignmemory \ -L$(XEN_ROOT)/tools/libs/devicemodel \ + -L$(XEN_ROOT)/tools/libs/ctrl \ -Wl,-rpath-link=3D$(XEN_ROOT)/tools/libs/toolcore \ -Wl,-rpath-link=3D$(XEN_ROOT)/tools/libs/toollog \ -Wl,-rpath-link=3D$(XEN_ROOT)/tools/libs/evtchn \ @@ -273,6 +275,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find -Wl,-rpath-link=3D$(XEN_ROOT)/tools/libs/call \ -Wl,-rpath-link=3D$(XEN_ROOT)/tools/libs/foreignmemory \ -Wl,-rpath-link=3D$(XEN_ROOT)/tools/libs/devicemodel \ + -Wl,-rpath-link=3D$(XEN_ROOT)/tools/libs/ctrl \ $(QEMU_UPSTREAM_RPATH)" \ --bindir=3D$(LIBEXEC_BIN) \ --datadir=3D$(SHAREDIR)/qemu-xen \ diff --git a/tools/Rules.mk b/tools/Rules.mk index 5d699cfd39..6bc3347a1c 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -20,9 +20,8 @@ XEN_libxencall =3D $(XEN_ROOT)/tools/libs/call XEN_libxenforeignmemory =3D $(XEN_ROOT)/tools/libs/foreignmemory XEN_libxendevicemodel =3D $(XEN_ROOT)/tools/libs/devicemodel XEN_libxenhypfs =3D $(XEN_ROOT)/tools/libs/hypfs -XEN_libxenctrl =3D $(XEN_ROOT)/tools/libxc -# Currently libxenguest lives in the same directory as libxenctrl -XEN_libxenguest =3D $(XEN_libxenctrl) +XEN_libxenctrl =3D $(XEN_ROOT)/tools/libs/ctrl +XEN_libxenguest =3D $(XEN_ROOT)/tools/libxc XEN_libxenlight =3D $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight XEN_libxlutil =3D $(XEN_libxenlight) @@ -147,7 +146,7 @@ LDLIBS_libxenctrl =3D $(SHDEPS_libxenctrl) $(XEN_libxen= ctrl)/libxenctrl$(libextens SHLIB_libxenctrl =3D $(SHDEPS_libxenctrl) -Wl,-rpath-link=3D$(XEN_libxenc= trl) =20 CFLAGS_libxenguest =3D -I$(XEN_libxenguest)/include $(CFLAGS_libxenevtchn)= $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude) -SHDEPS_libxenguest =3D $(SHLIB_libxenevtchn) +SHDEPS_libxenguest =3D $(SHLIB_libxenevtchn) $(SHLIB_libxenctrl) LDLIBS_libxenguest =3D $(SHDEPS_libxenguest) $(XEN_libxenguest)/libxengues= t$(libextension) SHLIB_libxenguest =3D $(SHDEPS_libxenguest) -Wl,-rpath-link=3D$(XEN_libxe= nguest) =20 @@ -179,7 +178,7 @@ CFLAGS +=3D -O2 -fomit-frame-pointer endif =20 CFLAGS_libxenlight =3D -I$(XEN_libxenlight) $(CFLAGS_libxenctrl) $(CFLAGS_= xeninclude) -SHDEPS_libxenlight =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_li= bxenhypfs) +SHDEPS_libxenlight =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_li= bxenhypfs) $(SHLIB_libxenguest) LDLIBS_libxenlight =3D $(SHDEPS_libxenlight) $(XEN_libxenlight)/libxenligh= t$(libextension) SHLIB_libxenlight =3D $(SHDEPS_libxenlight) -Wl,-rpath-link=3D$(XEN_libxe= nlight) =20 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 +=3D gnttab SUBDIRS-y +=3D call SUBDIRS-y +=3D foreignmemory SUBDIRS-y +=3D devicemodel +SUBDIRS-y +=3D ctrl SUBDIRS-y +=3D hypfs =20 ifeq ($(CONFIG_RUMP),y) diff --git a/tools/libs/ctrl/Makefile b/tools/libs/ctrl/Makefile new file mode 100644 index 0000000000..bda0b43dfa --- /dev/null +++ b/tools/libs/ctrl/Makefile @@ -0,0 +1,69 @@ +XEN_ROOT =3D $(CURDIR)/../../.. +include $(XEN_ROOT)/tools/Rules.mk + +MAJOR =3D 4.14 +MINOR =3D 0 +LIBNAME :=3D ctrl +USELIBS :=3D toollog call evtchn gnttab foreignmemory devicemodel + +SRCS-y +=3D xc_altp2m.c +SRCS-y +=3D xc_core.c +SRCS-$(CONFIG_X86) +=3D xc_core_x86.c +SRCS-$(CONFIG_ARM) +=3D xc_core_arm.c +SRCS-y +=3D xc_cpupool.c +SRCS-y +=3D xc_domain.c +SRCS-y +=3D xc_evtchn.c +SRCS-y +=3D xc_gnttab.c +SRCS-y +=3D xc_misc.c +SRCS-y +=3D xc_flask.c +SRCS-y +=3D xc_physdev.c +SRCS-y +=3D xc_private.c +SRCS-y +=3D xc_csched.c +SRCS-y +=3D xc_csched2.c +SRCS-y +=3D xc_arinc653.c +SRCS-y +=3D xc_rt.c +SRCS-y +=3D xc_tbuf.c +SRCS-y +=3D xc_pm.c +SRCS-y +=3D xc_cpu_hotplug.c +SRCS-y +=3D xc_resume.c +SRCS-y +=3D xc_vm_event.c +SRCS-y +=3D xc_monitor.c +SRCS-y +=3D xc_mem_paging.c +SRCS-y +=3D xc_mem_access.c +SRCS-y +=3D xc_memshr.c +SRCS-y +=3D xc_hcall_buf.c +SRCS-y +=3D xc_foreign_memory.c +SRCS-y +=3D xc_kexec.c +SRCS-y +=3D xc_resource.c +SRCS-$(CONFIG_X86) +=3D xc_psr.c +SRCS-$(CONFIG_X86) +=3D xc_pagetab.c +SRCS-$(CONFIG_Linux) +=3D xc_linux.c +SRCS-$(CONFIG_FreeBSD) +=3D xc_freebsd.c +SRCS-$(CONFIG_SunOS) +=3D xc_solaris.c +SRCS-$(CONFIG_NetBSD) +=3D xc_netbsd.c +SRCS-$(CONFIG_NetBSDRump) +=3D xc_netbsd.c +SRCS-$(CONFIG_MiniOS) +=3D xc_minios.c +SRCS-y +=3D xc_evtchn_compat.c +SRCS-y +=3D xc_gnttab_compat.c +SRCS-y +=3D xc_devicemodel_compat.c + +CFLAGS +=3D -D__XEN_TOOLS__ +CFLAGS +=3D $(PTHREAD_CFLAGS) +CFLAGS +=3D -include $(XEN_ROOT)/tools/config.h + +# Needed for posix_fadvise64() in xc_linux.c +CFLAGS-$(CONFIG_Linux) +=3D -D_GNU_SOURCE + +LIBHEADER :=3D xenctrl.h xenctrl_compat.h xenctrl_dom.h + +NO_HEADERS_CHK :=3D y + +include $(XEN_ROOT)/tools/libs/libs.mk + +genpath-target =3D $(call buildmakevars2header,_paths.h) +$(eval $(genpath-target)) + +xc_private.h: _paths.h + +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenctrl)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) diff --git a/tools/libxc/include/xenctrl.h b/tools/libs/ctrl/include/xenctr= l.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/xe= nctrl_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/libs/ctrl/libxenctrl.map b/tools/libs/ctrl/libxenctrl.map new file mode 100644 index 0000000000..26f1402d6d --- /dev/null +++ b/tools/libs/ctrl/libxenctrl.map @@ -0,0 +1,3 @@ +VERS_4.14.0 { + global: *; /* Expose everything */ +}; 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_devic= emodel_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_com= pat.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_m= emory.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_com= pat.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/xenctrl.pc.in similarity index 100% rename from tools/libxc/xencontrol.pc.in rename to tools/libs/ctrl/xenctrl.pc.in diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index 6f94b5bb4c..1312223093 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -9,47 +9,10 @@ ifeq ($(CONFIG_LIBXC_MINIOS),y) override CONFIG_MIGRATE :=3D n endif =20 -CTRL_SRCS-y :=3D -CTRL_SRCS-y +=3D xc_altp2m.c -CTRL_SRCS-y +=3D xc_core.c -CTRL_SRCS-$(CONFIG_X86) +=3D xc_core_x86.c -CTRL_SRCS-$(CONFIG_ARM) +=3D xc_core_arm.c -CTRL_SRCS-y +=3D xc_cpupool.c -CTRL_SRCS-y +=3D xc_domain.c -CTRL_SRCS-y +=3D xc_evtchn.c -CTRL_SRCS-y +=3D xc_gnttab.c -CTRL_SRCS-y +=3D xc_misc.c -CTRL_SRCS-y +=3D xc_flask.c -CTRL_SRCS-y +=3D xc_physdev.c -CTRL_SRCS-y +=3D xc_private.c -CTRL_SRCS-y +=3D xc_csched.c -CTRL_SRCS-y +=3D xc_csched2.c -CTRL_SRCS-y +=3D xc_arinc653.c -CTRL_SRCS-y +=3D xc_rt.c -CTRL_SRCS-y +=3D xc_tbuf.c -CTRL_SRCS-y +=3D xc_pm.c -CTRL_SRCS-y +=3D xc_cpu_hotplug.c -CTRL_SRCS-y +=3D xc_resume.c -CTRL_SRCS-y +=3D xc_vm_event.c -CTRL_SRCS-y +=3D xc_monitor.c -CTRL_SRCS-y +=3D xc_mem_paging.c -CTRL_SRCS-y +=3D xc_mem_access.c -CTRL_SRCS-y +=3D xc_memshr.c -CTRL_SRCS-y +=3D xc_hcall_buf.c -CTRL_SRCS-y +=3D xc_foreign_memory.c -CTRL_SRCS-y +=3D xc_kexec.c -CTRL_SRCS-y +=3D xc_resource.c -CTRL_SRCS-$(CONFIG_X86) +=3D xc_psr.c -CTRL_SRCS-$(CONFIG_X86) +=3D xc_pagetab.c -CTRL_SRCS-$(CONFIG_Linux) +=3D xc_linux.c -CTRL_SRCS-$(CONFIG_FreeBSD) +=3D xc_freebsd.c -CTRL_SRCS-$(CONFIG_SunOS) +=3D xc_solaris.c -CTRL_SRCS-$(CONFIG_NetBSD) +=3D xc_netbsd.c -CTRL_SRCS-$(CONFIG_NetBSDRump) +=3D xc_netbsd.c -CTRL_SRCS-$(CONFIG_MiniOS) +=3D xc_minios.c -CTRL_SRCS-y +=3D xc_evtchn_compat.c -CTRL_SRCS-y +=3D xc_gnttab_compat.c -CTRL_SRCS-y +=3D xc_devicemodel_compat.c +LINK_FILES :=3D xc_private.h xc_core.h xc_core_x86.h xc_core_arm.h xc_bito= ps.h + +$(LINK_FILES): + ln -sf $(XEN_ROOT)/tools/libs/ctrl/$(notdir $@) $@ =20 GUEST_SRCS-y :=3D GUEST_SRCS-y +=3D xg_private.c @@ -124,26 +87,14 @@ CFLAGS +=3D $(CFLAGS_libxentoollog) CFLAGS +=3D $(CFLAGS_libxenevtchn) CFLAGS +=3D $(CFLAGS_libxendevicemodel) =20 -CTRL_LIB_OBJS :=3D $(patsubst %.c,%.o,$(CTRL_SRCS-y)) -CTRL_PIC_OBJS :=3D $(patsubst %.c,%.opic,$(CTRL_SRCS-y)) - GUEST_LIB_OBJS :=3D $(patsubst %.c,%.o,$(GUEST_SRCS-y)) GUEST_PIC_OBJS :=3D $(patsubst %.c,%.opic,$(GUEST_SRCS-y)) =20 -$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \ -$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS +=3D -include $(XEN_ROOT)/tools= /config.h +$(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS): CFLAGS +=3D -include $(XEN_ROOT)/tool= s/config.h =20 # 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 +=3D $(CFLAGS_libxencall) $(CFL= AGS_libxenforeignmemory) - -$(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS): CFLAGS +=3D $(CFLAGS_libxengnttab) - -LIB :=3D libxenctrl.a -ifneq ($(nosharedlibs),y) -LIB +=3D libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MIN= OR) -endif +$(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS): CFLAGS +=3D $(CFLAGS_libxencall) $(CF= LAGS_libxenforeignmemory) =20 LIB +=3D libxenguest.a ifneq ($(nosharedlibs),y) @@ -155,10 +106,9 @@ $(eval $(genpath-target)) =20 xc_private.h: _paths.h =20 -$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \ -$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): xc_private.h +$(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS): $(LINK_FILES) =20 -PKG_CONFIG :=3D xencontrol.pc xenguest.pc +PKG_CONFIG :=3D xenguest.pc PKG_CONFIG_VERSION :=3D $(MAJOR).$(MINOR) =20 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)/libx= enctrl.so.$(MAJOR) - $(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenctrl.so - $(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h include/xenctr= l_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)/lib= xenguest.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) =20 .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 =20 .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) =20 .PHONY: distclean @@ -244,19 +180,6 @@ rpm: build mv staging/i386/*.rpm . rm -rf staging =20 -# 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.s= o.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxe= nevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxencall) $(LDLIBS_libxenforeign= memory) $(LDLIBS_libxendevicemodel) $(PTHREAD_LIBS) $(APPEND_LDFLAGS) - # libxenguest =20 libxenguest.a: $(GUEST_LIB_OBJS) @@ -277,7 +200,7 @@ xc_dom_bzimageloader.o: CFLAGS +=3D $(filter -D%,$(zlib= -options)) xc_dom_bzimageloader.opic: CFLAGS +=3D $(filter -D%,$(zlib-options)) =20 libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS =3D $(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_libxenev= tchn) $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS) =20 -include $(DEPS_INCLUDE) diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 38cd43abae..b1cd5d8ef2 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -188,7 +188,7 @@ libxl_dom.o: CFLAGS +=3D -I$(XEN_ROOT)/tools # include= libacpi/x86.h libxl_x86_acpi.o: CFLAGS +=3D -I$(XEN_ROOT)/tools =20 SAVE_HELPER_OBJS =3D libxl_save_helper.o _libxl_save_msgs_helper.o -$(SAVE_HELPER_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtch= n) +$(SAVE_HELPER_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtch= n) $(CFLAGS_libxenguest) =20 PKG_CONFIG =3D xenlight.pc xlutil.pc PKG_CONFIG_VERSION :=3D $(MAJOR).$(MINOR) diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 4e2e8f3b17..7d37f297a9 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -6,6 +6,7 @@ CFLAGS +=3D -Werror CFLAGS +=3D -include $(XEN_ROOT)/tools/config.h CFLAGS +=3D $(CFLAGS_libxenevtchn) CFLAGS +=3D $(CFLAGS_libxenctrl) +CFLAGS +=3D $(CFLAGS_libxenguest) CFLAGS +=3D $(CFLAGS_xeninclude) CFLAGS +=3D $(CFLAGS_libxenstore) =20 diff --git a/tools/python/Makefile b/tools/python/Makefile index 8d22c03676..bd3d62a36c 100644 --- a/tools/python/Makefile +++ b/tools/python/Makefile @@ -33,7 +33,7 @@ uninstall: =20 .PHONY: test test: - LD_LIBRARY_PATH=3D$$(readlink -f ../libxc):$$(readlink -f ../xenstore) $(= PYTHON) -m unittest discover + LD_LIBRARY_PATH=3D$$(readlink -f ../libs/ctrl):$$(readlink -f ../libxc):$= $(readlink -f ../xenstore) $(PYTHON) -m unittest discover =20 .PHONY: clean clean: diff --git a/tools/python/setup.py b/tools/python/setup.py index 8faf1c0ddc..24b284af39 100644 --- a/tools/python/setup.py +++ b/tools/python/setup.py @@ -9,7 +9,7 @@ extra_compile_args =3D [ "-fno-strict-aliasing", "-Werror"= ] PATH_XEN =3D XEN_ROOT + "/tools/include" PATH_LIBXENTOOLLOG =3D XEN_ROOT + "/tools/libs/toollog" PATH_LIBXENEVTCHN =3D XEN_ROOT + "/tools/libs/evtchn" -PATH_LIBXC =3D XEN_ROOT + "/tools/libxc" +PATH_LIBXENCTRL =3D XEN_ROOT + "/tools/libs/ctrl" PATH_LIBXL =3D XEN_ROOT + "/tools/libxl" PATH_XENSTORE =3D XEN_ROOT + "/tools/xenstore" =20 @@ -18,11 +18,11 @@ xc =3D Extension("xc", include_dirs =3D [ PATH_XEN, PATH_LIBXENTOOLLOG + "/include", PATH_LIBXENEVTCHN + "/include", - PATH_LIBXC + "/include", + PATH_LIBXENCTRL + "/include", "xen/lowlevel/xc" ], - library_dirs =3D [ PATH_LIBXC ], - libraries =3D [ "xenctrl", "xenguest" ], - depends =3D [ PATH_LIBXC + "/libxenctrl.so", PAT= H_LIBXC + "/libxenguest.so" ], + library_dirs =3D [ PATH_LIBXENCTRL ], + libraries =3D [ "xenctrl" ], + depends =3D [ PATH_LIBXENCTRL + "/libxenctrl.so"= ], extra_link_args =3D [ "-Wl,-rpath-link=3D"+PATH_LIBXENTO= OLLOG ], sources =3D [ "xen/lowlevel/xc/xc.c" ]) =20 --=20 2.20.1 From nobody Sun Apr 28 05:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1594832127; cv=none; d=zohomail.com; s=zohoarc; b=XHBthxK1fVcN6YryFMKRb4nhzFcm6dvEAoju4b1z1f2nhMkHUoXuKF+XnCfzQRqBYIE9cBTIcBlD+MsUm5vPkqo1oPZuJT7v9y/II3l/0x31MsjFP9dH2zDb49Tc2+YmmwGqQ4sAkrmJiAmY1uIXs6W+/zErOGicIw+FtJJ0AQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594832127; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=SKyltmmpP8+DFTgDrSFU6oJlon0jQaMtjkCDRMuJLJs=; b=ejajBdZ0JqfvUIxSF/kJ7sAkd4HD0ExaLfycZqKy225XWr0UoPj+kEYthiBvkg4V93DBx0PLOxhbHo+HmbBBQW/GW5wc+E99AJzd2HNYh7OMA+gPKg3P6yR9FBgDdWxIa7ZMQyi7+/kmdd+/WLOLN3aXdqfTwUyFUeMD6RZlmjw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1594832127768565.7049629731492; Wed, 15 Jul 2020 09:55:27 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkgX-00062m-Ko; Wed, 15 Jul 2020 16:55:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkgW-00062T-1z for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:55:08 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id eee4a2ac-c6bb-11ea-b7bb-bc764e2007e4; Wed, 15 Jul 2020 16:55:06 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDy-0001sU-JH; Wed, 15 Jul 2020 17:25:38 +0100 X-Inumbo-ID: eee4a2ac-c6bb-11ea-b7bb-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [PATCH 09/12] tools: split libxenstore into new tools/libs/store directory Date: Wed, 15 Jul 2020 17:25:08 +0100 Message-Id: <20200715162511.5941-11-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Juergen Gross , Stefano Stabellini , Julien Grall , Wei Liu , Andrew Cooper , ian.jackson@eu.citrix.com, George Dunlap , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jan Beulich , Samuel Thibault Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" From: Juergen Gross 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 --- .gitignore | 7 +- stubdom/mini-os.mk | 2 +- tools/Makefile | 8 +- tools/Rules.mk | 2 +- tools/libs/Makefile | 1 + tools/libs/store/Makefile | 66 +++++++++++++++ .../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 =3D> libs/store}/xenstore.pc.in | 0 tools/{xenstore =3D> libs/store}/xs.c | 0 tools/python/setup.py | 2 +- tools/xenstore/Makefile | 82 +------------------ tools/xenstore/{include =3D> }/xenstore_lib.h | 0 15 files changed, 133 insertions(+), 86 deletions(-) create mode 100644 tools/libs/store/Makefile rename tools/{xenstore =3D> libs/store}/include/compat/xs.h (100%) rename tools/{xenstore =3D> libs/store}/include/compat/xs_lib.h (100%) rename tools/{xenstore =3D> libs/store}/include/xenstore.h (100%) create mode 100644 tools/libs/store/libxenstore.map rename tools/{xenstore =3D> libs/store}/xenstore.pc.in (100%) rename tools/{xenstore =3D> libs/store}/xs.c (100%) rename tools/xenstore/{include =3D> }/xenstore_lib.h (100%) diff --git a/.gitignore b/.gitignore index e28c21641c..dad694a979 100644 --- a/.gitignore +++ b/.gitignore @@ -120,6 +120,12 @@ tools/libs/foreignmemory/headers.chk tools/libs/foreignmemory/xenforeignmemory.pc tools/libs/devicemodel/headers.chk tools/libs/devicemodel/xendevicemodel.pc +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 @@ -280,7 +286,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 b1387df3f8..55b26c9517 100644 --- a/stubdom/mini-os.mk +++ b/stubdom/mini-os.mk @@ -5,7 +5,7 @@ # XEN_ROOT # MINIOS_TARGET_ARCH =20 -XENSTORE_CPPFLAGS =3D -isystem $(XEN_ROOT)/tools/xenstore/include +XENSTORE_CPPFLAGS =3D -isystem $(XEN_ROOT)/tools/libs/store/include TOOLCORE_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toolcore TOOLLOG_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog EVTCHN_PATH =3D $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn diff --git a/tools/Makefile b/tools/Makefile index 7c62c599dd..88231856d7 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -47,7 +47,7 @@ SUBDIRS-$(OCAML_TOOLS) +=3D ocaml endif =20 ifeq ($(CONFIG_RUMP),y) -SUBDIRS-y :=3D libs libxc xenstore +SUBDIRS-y :=3D libs libxc endif =20 # For the sake of linking, set the sys-root @@ -256,12 +256,12 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find -I$(XEN_ROOT)/tools/libs/foreignmemory/include \ -I$(XEN_ROOT)/tools/libs/devicemodel/include \ -I$(XEN_ROOT)/tools/libs/ctrl/include \ + -I$(XEN_ROOT)/tools/libs/store/include \ + -I$(XEN_ROOT)/tools/libs/store/compat/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=3D"-L$(XEN_ROOT)/tools/libxc \ - -L$(XEN_ROOT)/tools/xenstore \ + -L$(XEN_ROOT)/tools/libs/store \ -L$(XEN_ROOT)/tools/libs/toolcore \ -L$(XEN_ROOT)/tools/libs/evtchn \ -L$(XEN_ROOT)/tools/libs/gnttab \ diff --git a/tools/Rules.mk b/tools/Rules.mk index 6bc3347a1c..cd1b49bca8 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -21,11 +21,11 @@ XEN_libxenforeignmemory =3D $(XEN_ROOT)/tools/libs/fore= ignmemory XEN_libxendevicemodel =3D $(XEN_ROOT)/tools/libs/devicemodel XEN_libxenhypfs =3D $(XEN_ROOT)/tools/libs/hypfs XEN_libxenctrl =3D $(XEN_ROOT)/tools/libs/ctrl +XEN_libxenstore =3D $(XEN_ROOT)/tools/libs/store XEN_libxenguest =3D $(XEN_ROOT)/tools/libxc XEN_libxenlight =3D $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight XEN_libxlutil =3D $(XEN_libxenlight) -XEN_libxenstore =3D $(XEN_ROOT)/tools/xenstore XEN_libxenstat =3D $(XEN_ROOT)/tools/xenstat/libxenstat/src XEN_libxenvchan =3D $(XEN_ROOT)/tools/libvchan =20 diff --git a/tools/libs/Makefile b/tools/libs/Makefile index 7648ea0e4c..27a7df9b31 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -11,6 +11,7 @@ SUBDIRS-y +=3D foreignmemory SUBDIRS-y +=3D devicemodel SUBDIRS-y +=3D ctrl SUBDIRS-y +=3D hypfs +SUBDIRS-y +=3D store =20 ifeq ($(CONFIG_RUMP),y) SUBDIRS-y :=3D toolcore diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile new file mode 100644 index 0000000000..76b30145cf --- /dev/null +++ b/tools/libs/store/Makefile @@ -0,0 +1,66 @@ +XEN_ROOT=3D$(CURDIR)/../../.. +include $(XEN_ROOT)/tools/Rules.mk + +MAJOR =3D 3.0 +MINOR =3D 3 +LIBNAME :=3D store +USELIBS :=3D toolcore + +ifeq ($(CONFIG_Linux),y) +APPEND_LDFLAGS +=3D -ldl +endif + +SRCS-y +=3D xs_lib.c +SRCS-y +=3D xs.c + +LIBHEADER =3D xenstore.h xenstore_lib.h + +include ../libs.mk + +# Include configure output (config.h) +CFLAGS +=3D -include $(XEN_ROOT)/tools/config.h +CFLAGS +=3D $(CFLAGS_libxentoolcore) +CFLAGS +=3D -DXEN_LIB_STORED=3D"\"$(XEN_LIB_STORED)\"" +CFLAGS +=3D -DXEN_RUN_STORED=3D"\"$(XEN_RUN_STORED)\"" + +LINK_FILES =3D 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 +=3D -DUSE_PTHREAD +ifeq ($(CONFIG_Linux),y) +xs.opic: CFLAGS +=3D -DUSE_DLSYM +else +PKG_CONFIG_REMOVE +=3D -ldl +endif + +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenstore)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(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-comp= at/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/incl= ude/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/x= enstore.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/libxenstor= e.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/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 =3D XEN_ROOT + "/tools/libs/toollog" PATH_LIBXENEVTCHN =3D XEN_ROOT + "/tools/libs/evtchn" PATH_LIBXENCTRL =3D XEN_ROOT + "/tools/libs/ctrl" PATH_LIBXL =3D XEN_ROOT + "/tools/libxl" -PATH_XENSTORE =3D XEN_ROOT + "/tools/xenstore" +PATH_XENSTORE =3D XEN_ROOT + "/tools/libs/store" =20 xc =3D Extension("xc", extra_compile_args =3D 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) =3D xenstored_minios.o XENSTORED_OBJS +=3D $(XENSTORED_OBJS_y) LDLIBS_xenstored +=3D -lrt =20 -ifneq ($(XENSTORE_STATIC_CLIENTS),y) -LIBXENSTORE :=3D libxenstore.so -else -LIBXENSTORE :=3D libxenstore.a -xenstore xenstore-control: CFLAGS +=3D -static -endif - -ALL_TARGETS =3D libxenstore.a clients -ifneq ($(nosharedlibs),y) -ALL_TARGETS +=3D libxenstore.so -endif +ALL_TARGETS =3D clients ifeq ($(XENSTORE_XENSTORED),y) ALL_TARGETS +=3D xs_tdb_dump xenstored endif @@ -87,60 +77,21 @@ xenstored.a: $(XENSTORED_OBJS) $(CLIENTS): xenstore ln -f xenstore $@ =20 -xenstore: xenstore_client.o $(LIBXENSTORE) +xenstore: xenstore_client.o $(CC) $< $(LDFLAGS) $(LDLIBS_libxenstore) $(LDLIBS_libxentoolcore) $(SOCK= ET_LIBS) -o $@ $(APPEND_LDFLAGS) =20 -xenstore-control: xenstore_control.o $(LIBXENSTORE) +xenstore-control: xenstore_control.o $(CC) $< $(LDFLAGS) $(LDLIBS_libxenstore) $(LDLIBS_libxentoolcore) $(SOCK= ET_LIBS) -o $@ $(APPEND_LDFLAGS) =20 xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o $(CC) $^ $(LDFLAGS) -o $@ $(APPEND_LDFLAGS) =20 -libxenstore.so: libxenstore.so.$(MAJOR) - ln -sf $< $@ -libxenstore.so.$(MAJOR): libxenstore.so.$(MAJOR).$(MINOR) - ln -sf $< $@ - -xs.opic: CFLAGS +=3D -DUSE_PTHREAD -ifeq ($(CONFIG_Linux),y) -xs.opic: CFLAGS +=3D -DUSE_DLSYM -libxenstore.so.$(MAJOR).$(MINOR): APPEND_LDFLAGS +=3D -ldl -else -PKG_CONFIG_REMOVE +=3D -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_LIB= S) $(PTHREAD_LIBS) $(APPEND_LDFLAGS) - -libxenstore.a: xs.o xs_lib.o - $(AR) rcs $@ $^ - -PKG_CONFIG :=3D xenstore.pc -PKG_CONFIG_VERSION :=3D $(MAJOR).$(MINOR) - -ifneq ($(CONFIG_LIBXC_MINIOS),y) -PKG_CONFIG_INST :=3D $(PKG_CONFIG) -$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX =3D $(prefix) -$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR =3D $(includedir) -$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR =3D $(libdir) -endif - -PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) - -$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenstore)/include -$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(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) =20 .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.s= o.$(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-comp= at/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) =20 .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/xenstor= e_lib.h similarity index 100% rename from tools/xenstore/include/xenstore_lib.h rename to tools/xenstore/xenstore_lib.h --=20 2.20.1 From nobody Sun Apr 28 05:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1594832135; cv=none; d=zohomail.com; s=zohoarc; b=BNTDq/3gNtKPmzo7oNqgTGadWA9BywLPj7fLEZkpSFHp2HMp9/unlGZxlQ3RgrgXktoRqicg4HgBCBYFV1JTQjPXllyE2raqjqhs/4qwcD7/Cdo5zDIiVG8O+IGMzoP/WBy8ViC1VNKRwVMXdD/haa577uom+V6zmjJqgXUx3YQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594832135; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=jyx3TLH9dvBpCT4l5ST93WjA8sCqFq3llQ5zdDUB+t8=; b=SRRUATT3kz8Gl6TvCzSWiCuChVDS2TPGYdQkgEkSUCKzkxg/cmwVvX0VopYxN/6Sz5DBJaAerdLQO6kZC4l7QoYWZ6/h8JIpJlyJa9h9pEZdEXyWRPnRMWUHS9ugAEwD9/PxuRmb+Qde48JpQDd0VL3nK9kIoJqDRLGHs7XEcPQ= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1594832135123121.86764758249058; Wed, 15 Jul 2020 09:55:35 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkgg-00065E-UZ; Wed, 15 Jul 2020 16:55:18 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkgf-00064u-Oc for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:55:17 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f5198b9c-c6bb-11ea-8496-bc764e2007e4; Wed, 15 Jul 2020 16:55:16 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDz-0001sU-2q; Wed, 15 Jul 2020 17:25:39 +0100 X-Inumbo-ID: f5198b9c-c6bb-11ea-8496-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [PATCH 10/12] tools: split libxenvchan into new tools/libs/vchan directory Date: Wed, 15 Jul 2020 17:25:09 +0100 Message-Id: <20200715162511.5941-12-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Juergen Gross , Stefano Stabellini , Julien Grall , Wei Liu , Andrew Cooper , ian.jackson@eu.citrix.com, George Dunlap , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" From: Juergen Gross 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 --- .gitignore | 7 +- tools/Makefile | 2 +- tools/Rules.mk | 4 +- tools/libs/Makefile | 1 + tools/libs/vchan/Makefile | 19 ++++ .../vchan/include}/libxenvchan.h | 0 tools/{libvchan =3D> libs/vchan}/init.c | 0 tools/{libvchan =3D> libs/vchan}/io.c | 0 tools/libs/vchan/libxenvchan.map | 16 ++++ tools/{libvchan =3D> libs/vchan}/xenvchan.pc.in | 0 tools/libvchan/Makefile | 95 ------------------- tools/vchan/Makefile | 37 ++++++++ tools/{libvchan =3D> vchan}/node-select.c | 0 tools/{libvchan =3D> vchan}/node.c | 0 .../{libvchan =3D> vchan}/vchan-socket-proxy.c | 0 15 files changed, 80 insertions(+), 101 deletions(-) create mode 100644 tools/libs/vchan/Makefile rename tools/{libvchan =3D> libs/vchan/include}/libxenvchan.h (100%) rename tools/{libvchan =3D> libs/vchan}/init.c (100%) rename tools/{libvchan =3D> libs/vchan}/io.c (100%) create mode 100644 tools/libs/vchan/libxenvchan.map rename tools/{libvchan =3D> libs/vchan}/xenvchan.pc.in (100%) delete mode 100644 tools/libvchan/Makefile create mode 100644 tools/vchan/Makefile rename tools/{libvchan =3D> vchan}/node-select.c (100%) rename tools/{libvchan =3D> vchan}/node.c (100%) rename tools/{libvchan =3D> vchan}/vchan-socket-proxy.c (100%) diff --git a/.gitignore b/.gitignore index dad694a979..3e130b0596 100644 --- a/.gitignore +++ b/.gitignore @@ -126,6 +126,8 @@ 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/xenvchan.pc tools/console/xenconsole tools/console/xenconsoled tools/console/client/_paths.h @@ -201,7 +203,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/libxc/*.pc tools/libxc/xc_bitops.h tools/libxc/xc_core.h @@ -387,8 +388,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 88231856d7..ed119fffd7 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -21,7 +21,7 @@ SUBDIRS-y +=3D xenmon SUBDIRS-y +=3D xenstat SUBDIRS-$(CONFIG_NetBSD) +=3D xenbackendd SUBDIRS-y +=3D libfsimage -SUBDIRS-$(CONFIG_Linux) +=3D libvchan +SUBDIRS-$(CONFIG_Linux) +=3D vchan =20 # 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 cd1b49bca8..30ee379484 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -22,12 +22,12 @@ XEN_libxendevicemodel =3D $(XEN_ROOT)/tools/libs/device= model XEN_libxenhypfs =3D $(XEN_ROOT)/tools/libs/hypfs XEN_libxenctrl =3D $(XEN_ROOT)/tools/libs/ctrl XEN_libxenstore =3D $(XEN_ROOT)/tools/libs/store +XEN_libxenvchan =3D $(XEN_ROOT)/tools/libs/vchan XEN_libxenguest =3D $(XEN_ROOT)/tools/libxc XEN_libxenlight =3D $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight XEN_libxlutil =3D $(XEN_libxenlight) XEN_libxenstat =3D $(XEN_ROOT)/tools/xenstat/libxenstat/src -XEN_libxenvchan =3D $(XEN_ROOT)/tools/libvchan =20 CFLAGS_xeninclude =3D -I$(XEN_INCLUDE) =20 @@ -163,7 +163,7 @@ SHDEPS_libxenstat =3D $(SHLIB_libxenctrl) $(SHLIB_libx= enstore) LDLIBS_libxenstat =3D $(SHDEPS_libxenstat) $(XEN_libxenstat)/libxenstat$(= libextension) SHLIB_libxenstat =3D $(SHDEPS_libxenstat) -Wl,-rpath-link=3D$(XEN_libxen= stat) =20 -CFLAGS_libxenvchan =3D -I$(XEN_libxenvchan) $(CFLAGS_libxengnttab) $(CFLAG= S_libxenevtchn) +CFLAGS_libxenvchan =3D -I$(XEN_libxenvchan)/include $(CFLAGS_libxengnttab)= $(CFLAGS_libxenevtchn) SHDEPS_libxenvchan =3D $(SHLIB_libxentoollog) $(SHLIB_libxenstore) $(SHLIB= _libxenevtchn) $(SHLIB_libxengnttab) LDLIBS_libxenvchan =3D $(SHDEPS_libxenvchan) $(XEN_libxenvchan)/libxenvcha= n$(libextension) SHLIB_libxenvchan =3D $(SHDEPS_libxenvchan) -Wl,-rpath-link=3D$(XEN_libxe= nvchan) diff --git a/tools/libs/Makefile b/tools/libs/Makefile index 27a7df9b31..396116b0b3 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -12,6 +12,7 @@ SUBDIRS-y +=3D devicemodel SUBDIRS-y +=3D ctrl SUBDIRS-y +=3D hypfs SUBDIRS-y +=3D store +SUBDIRS-$(CONFIG_Linux) +=3D vchan =20 ifeq ($(CONFIG_RUMP),y) SUBDIRS-y :=3D toolcore diff --git a/tools/libs/vchan/Makefile b/tools/libs/vchan/Makefile new file mode 100644 index 0000000000..bf944d251c --- /dev/null +++ b/tools/libs/vchan/Makefile @@ -0,0 +1,19 @@ +XEN_ROOT =3D $(CURDIR)/../../.. +include $(XEN_ROOT)/tools/Rules.mk + +MAJOR =3D 4.14 +MINOR =3D 0 +LIBNAME :=3D vchan +USELIBS :=3D toollog store evtchn gnttab + +CFLAGS +=3D $(CFLAGS_libxenctrl) + +LIBHEADER :=3D libxenvchan.h + +SRCS-y +=3D init.c +SRCS-y +=3D io.c + +include $(XEN_ROOT)/tools/libs/libs.mk + +$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenvchan)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) diff --git a/tools/libvchan/libxenvchan.h b/tools/libs/vchan/include/libxen= vchan.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/libs/vchan/libxenvchan.map b/tools/libs/vchan/libxenvcha= n.map new file mode 100644 index 0000000000..9ac00c5b45 --- /dev/null +++ b/tools/libs/vchan/libxenvchan.map @@ -0,0 +1,16 @@ +VERS_4.14.0 { + global: + libxenvchan_server_init; + libxenvchan_client_init; + libxenvchan_close; + libxenvchan_recv; + libxenvchan_read; + libxenvchan_send; + libxenvchan_write; + libxenvchan_wait; + libxenvchan_fd_for_select; + libxenvchan_is_open; + libxenvchan_data_ready; + libxenvchan_buffer_space; + local: *; /* Do not expose anything by default */ +}; 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 025a935cb7..0000000000 --- a/tools/libvchan/Makefile +++ /dev/null @@ -1,95 +0,0 @@ -# -# tools/libvchan/Makefile -# - -XEN_ROOT =3D $(CURDIR)/../.. -include $(XEN_ROOT)/tools/Rules.mk - -LIBVCHAN_OBJS =3D init.o io.o -NODE_OBJS =3D node.o -NODE2_OBJS =3D node-select.o - -LIBVCHAN_PIC_OBJS =3D $(patsubst %.o,%.opic,$(LIBVCHAN_OBJS)) -LIBVCHAN_LIBS =3D $(LDLIBS_libxenstore) $(LDLIBS_libxengnttab) $(LDLIBS_li= bxenevtchn) -$(LIBVCHAN_OBJS) $(LIBVCHAN_PIC_OBJS): CFLAGS +=3D $(CFLAGS_libxenstore) $= (CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn) -$(NODE_OBJS) $(NODE2_OBJS): CFLAGS +=3D $(CFLAGS_libxengnttab) $(CFLAGS_li= bxenevtchn) -vchan-socket-proxy.o: CFLAGS +=3D $(CFLAGS_libxenstore) $(CFLAGS_libxenctr= l) $(CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn) - -MAJOR =3D 4.14 -MINOR =3D 0 - -CFLAGS +=3D -I../include -I. - -io.o io.opic: CFLAGS +=3D $(CFLAGS_libxenctrl) # for xen_mb et al - -PKG_CONFIG :=3D xenvchan.pc -PKG_CONFIG_VERSION :=3D $(MAJOR).$(MINOR) - -ifneq ($(CONFIG_LIBXC_MINIOS),y) -PKG_CONFIG_INST :=3D $(PKG_CONFIG) -$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX =3D $(prefix) -$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR =3D $(includedir) -$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR =3D $(libdir) -endif - -PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) - -$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenvchan) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(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_LDFLAG= S) - -vchan-node2: $(NODE2_OBJS) libxenvchan.so - $(CC) $(LDFLAGS) -o $@ $(NODE2_OBJS) $(LDLIBS_libxenvchan) $(APPEND_LDFLA= GS) - -vchan-socket-proxy: vchan-socket-proxy.o libxenvchan.so - $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenvchan) $(LDLIBS_libxenstore) $(L= DLIBS_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.s= o.$(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 =3D $(CURDIR)/../.. +include $(XEN_ROOT)/tools/Rules.mk + +NODE_OBJS =3D node.o +NODE2_OBJS =3D node-select.o + +$(NODE_OBJS) $(NODE2_OBJS): CFLAGS +=3D $(CFLAGS_libxenvchan) $(CFLAGS_lib= xengnttab) $(CFLAGS_libxenevtchn) +vchan-socket-proxy.o: CFLAGS +=3D $(CFLAGS_libxenvchan) $(CFLAGS_libxensto= re) $(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_LDFLAG= S) + +vchan-node2: $(NODE2_OBJS) + $(CC) $(LDFLAGS) -o $@ $(NODE2_OBJS) $(LDLIBS_libxenvchan) $(APPEND_LDFLA= GS) + +vchan-socket-proxy: vchan-socket-proxy.o + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenvchan) $(LDLIBS_libxenstore) $(L= DLIBS_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 --=20 2.20.1 From nobody Sun Apr 28 05:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1594832167; cv=none; d=zohomail.com; s=zohoarc; b=AYOEjuEQXFswgFqinSu3e4mUfWmC0x05Ujc44osDshSncEDcV3XqqtUbXSBAeEcWRw3UByMS3k883+ytb8GjKO/Qg8I9AQnWYLNSeC77xb8yrY1JRxvr356snaD6L+b0gFOvsfBCMzb5RtjyVWavxQ8PYJOAHlvsuZYcf/6MBGA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594832167; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=TM7s7YWGL1g2dBwJeUxoarSXWWKBYUJzv3BYuXrvDnU=; b=TKKbJxHZYt4ZNPkSfCBr0bfKgxQkUD9Bo6bl1vuDA2ypZKHt/Bd+sJmuZiVnwTNatcJCnqNYZRTYVfKHD+wMarGEudvlY09lMViVk3vDKiAqc3qkf6CKQWdfPr6hX3yA12QzhTMsplRTmQCrKqeNmkUOPqXShMe/GWm4goR0y3A= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1594832167702167.30114114197124; Wed, 15 Jul 2020 09:56:07 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkh6-0006DN-CX; Wed, 15 Jul 2020 16:55:44 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkh5-0006Bo-58 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:55:43 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0124f41c-c6bc-11ea-bb8b-bc764e2007e4; Wed, 15 Jul 2020 16:55:36 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDz-0001sU-HT; Wed, 15 Jul 2020 17:25:39 +0100 X-Inumbo-ID: 0124f41c-c6bc-11ea-bb8b-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [PATCH 11/12] tools: split libxenstat into new tools/libs/stat directory Date: Wed, 15 Jul 2020 17:25:10 +0100 Message-Id: <20200715162511.5941-13-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Juergen Gross , Stefano Stabellini , Julien Grall , Wei Liu , Andrew Cooper , ian.jackson@eu.citrix.com, George Dunlap , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" From: Juergen Gross 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 --- .gitignore | 7 +- tools/Makefile | 2 +- tools/Rules.mk | 4 +- tools/libs/Makefile | 1 + .../{xenstat/libxenstat =3D> libs/stat}/COPYING | 0 .../libxenstat =3D> libs/stat}/Makefile | 98 ++++--------------- .../stat}/bindings/swig/perl/.empty | 0 .../stat}/bindings/swig/python/.empty | 0 .../stat}/bindings/swig/xenstat.i | 0 .../src =3D> libs/stat/include}/xenstat.h | 3 + tools/libs/stat/libxenstat.map | 54 ++++++++++ .../libxenstat/src =3D> libs/stat}/xenstat.c | 0 .../libxenstat =3D> libs/stat}/xenstat.pc.in | 2 +- .../src =3D> libs/stat}/xenstat_freebsd.c | 0 .../src =3D> libs/stat}/xenstat_linux.c | 4 +- .../src =3D> libs/stat}/xenstat_netbsd.c | 0 .../src =3D> libs/stat}/xenstat_priv.h | 0 .../src =3D> libs/stat}/xenstat_qmp.c | 0 .../src =3D> libs/stat}/xenstat_solaris.c | 0 tools/xenstat/Makefile | 10 -- tools/{xenstat =3D> }/xentop/Makefile | 2 +- tools/{xenstat =3D> }/xentop/TODO | 0 tools/{xenstat =3D> }/xentop/xentop.c | 0 23 files changed, 90 insertions(+), 97 deletions(-) rename tools/{xenstat/libxenstat =3D> libs/stat}/COPYING (100%) rename tools/{xenstat/libxenstat =3D> libs/stat}/Makefile (56%) rename tools/{xenstat/libxenstat =3D> libs/stat}/bindings/swig/perl/.empty= (100%) rename tools/{xenstat/libxenstat =3D> libs/stat}/bindings/swig/python/.emp= ty (100%) rename tools/{xenstat/libxenstat =3D> libs/stat}/bindings/swig/xenstat.i (= 100%) rename tools/{xenstat/libxenstat/src =3D> libs/stat/include}/xenstat.h (98= %) create mode 100644 tools/libs/stat/libxenstat.map rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat.c (100%) rename tools/{xenstat/libxenstat =3D> libs/stat}/xenstat.pc.in (82%) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat_freebsd.c (10= 0%) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat_linux.c (98%) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat_netbsd.c (100= %) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat_priv.h (100%) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat_qmp.c (100%) rename tools/{xenstat/libxenstat/src =3D> libs/stat}/xenstat_solaris.c (10= 0%) delete mode 100644 tools/xenstat/Makefile rename tools/{xenstat =3D> }/xentop/Makefile (97%) rename tools/{xenstat =3D> }/xentop/TODO (100%) rename tools/{xenstat =3D> }/xentop/xentop.c (100%) diff --git a/.gitignore b/.gitignore index 3e130b0596..5c240c25db 100644 --- a/.gitignore +++ b/.gitignore @@ -120,6 +120,9 @@ tools/libs/foreignmemory/headers.chk tools/libs/foreignmemory/xenforeignmemory.pc tools/libs/devicemodel/headers.chk tools/libs/devicemodel/xendevicemodel.pc +tools/libs/stat/_paths.h +tools/libs/stat/headers.chk +tools/libs/stat/xenstat.pc tools/libs/store/headers.chk tools/libs/store/list.h tools/libs/store/utils.h @@ -273,9 +276,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 @@ -288,6 +288,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 ed119fffd7..e37b4c0f12 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -18,7 +18,7 @@ SUBDIRS-$(CONFIG_XCUTILS) +=3D xcutils SUBDIRS-$(CONFIG_X86) +=3D firmware SUBDIRS-y +=3D console SUBDIRS-y +=3D xenmon -SUBDIRS-y +=3D xenstat +SUBDIRS-y +=3D xentop SUBDIRS-$(CONFIG_NetBSD) +=3D xenbackendd SUBDIRS-y +=3D libfsimage SUBDIRS-$(CONFIG_Linux) +=3D vchan diff --git a/tools/Rules.mk b/tools/Rules.mk index 30ee379484..279df14152 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -22,12 +22,12 @@ XEN_libxendevicemodel =3D $(XEN_ROOT)/tools/libs/device= model XEN_libxenhypfs =3D $(XEN_ROOT)/tools/libs/hypfs XEN_libxenctrl =3D $(XEN_ROOT)/tools/libs/ctrl XEN_libxenstore =3D $(XEN_ROOT)/tools/libs/store +XEN_libxenstat =3D $(XEN_ROOT)/tools/libs/stat XEN_libxenvchan =3D $(XEN_ROOT)/tools/libs/vchan XEN_libxenguest =3D $(XEN_ROOT)/tools/libxc XEN_libxenlight =3D $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight XEN_libxlutil =3D $(XEN_libxenlight) -XEN_libxenstat =3D $(XEN_ROOT)/tools/xenstat/libxenstat/src =20 CFLAGS_xeninclude =3D -I$(XEN_INCLUDE) =20 @@ -158,7 +158,7 @@ ifeq ($(CONFIG_Linux),y) LDLIBS_libxenstore +=3D -ldl endif =20 -CFLAGS_libxenstat =3D -I$(XEN_libxenstat) +CFLAGS_libxenstat =3D -I$(XEN_libxenstat)/include SHDEPS_libxenstat =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) LDLIBS_libxenstat =3D $(SHDEPS_libxenstat) $(XEN_libxenstat)/libxenstat$(= libextension) SHLIB_libxenstat =3D $(SHDEPS_libxenstat) -Wl,-rpath-link=3D$(XEN_libxen= stat) diff --git a/tools/libs/Makefile b/tools/libs/Makefile index 396116b0b3..a1985cf7a7 100644 --- a/tools/libs/Makefile +++ b/tools/libs/Makefile @@ -12,6 +12,7 @@ SUBDIRS-y +=3D devicemodel SUBDIRS-y +=3D ctrl SUBDIRS-y +=3D hypfs SUBDIRS-y +=3D store +SUBDIRS-y +=3D stat SUBDIRS-$(CONFIG_Linux) +=3D vchan =20 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 56% rename from tools/xenstat/libxenstat/Makefile rename to tools/libs/stat/Makefile index 3d05ecdd9f..6162395a9a 100644 --- a/tools/xenstat/libxenstat/Makefile +++ b/tools/libs/stat/Makefile @@ -15,80 +15,29 @@ XEN_ROOT=3D$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk =20 -LDCONFIG=3Dldconfig -MAKE_LINK=3Dln -sf - -MAJOR=3D4.14 -MINOR=3D0 - -LIB=3Dsrc/libxenstat.a -SHLIB=3Dsrc/libxenstat.so.$(MAJOR).$(MINOR) -SHLIB_LINKS=3Dsrc/libxenstat.so.$(MAJOR) src/libxenstat.so -OBJECTS-y=3Dsrc/xenstat.o src/xenstat_qmp.o -OBJECTS-$(CONFIG_Linux) +=3D src/xenstat_linux.o -OBJECTS-$(CONFIG_SunOS) +=3D src/xenstat_solaris.o -OBJECTS-$(CONFIG_NetBSD) +=3D src/xenstat_netbsd.o -OBJECTS-$(CONFIG_FreeBSD) +=3D src/xenstat_freebsd.o -SONAME_FLAGS=3D-Wl,$(SONAME_LDFLAG) -Wl,libxenstat.so.$(MAJOR) - -CFLAGS+=3D-fPIC -Werror -CFLAGS+=3D-Isrc $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninc= lude) -include $(XEN_ROOT)/tools/config.h - -LDLIBS-y =3D $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) -lyajl -LDLIBS-$(CONFIG_SunOS) +=3D -lkstat - -PKG_CONFIG :=3D xenstat.pc -PKG_CONFIG_VERSION :=3D $(MAJOR).$(MINOR) - -ifneq ($(CONFIG_LIBXC_MINIOS),y) -PKG_CONFIG_INST :=3D $(PKG_CONFIG) -$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX =3D $(prefix) -$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR =3D $(includedir) -$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR =3D $(libdir) -endif - -PKG_CONFIG_LOCAL :=3D $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc)) +MAJOR =3D 4.14 +MINOR =3D 0 +LIBNAME :=3D stat +USELIBS :=3D ctrl store =20 -$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX =3D $(XEN_ROOT) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR =3D $(XEN_libxenstat) -$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) +CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude= ) -include $(XEN_ROOT)/tools/config.h =20 -.PHONY: all -all: $(LIB) $(SHLIB) $(SHLIB_LINKS) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) +SRCS-y +=3D xenstat.c +SRCS-y +=3D xenstat_qmp.c +SRCS-$(CONFIG_Linux) +=3D xenstat_linux.c +SRCS-$(CONFIG_SunOS) +=3D xenstat_solaris.c +SRCS-$(CONFIG_NetBSD) +=3D xenstat_netbsd.c +SRCS-$(CONFIG_FreeBSD) +=3D xenstat_freebsd.c =20 -$(OBJECTS-y): src/_paths.h - -$(LIB): $(OBJECTS-y) - $(AR) rc $@ $^ - $(RANLIB) $@ +LDLIBS-y +=3D -lyajl +LDLIBS-$(CONFIG_SunOS) +=3D -lkstat +APPEND_LDFLAGS +=3D $(LDLIBS-y) =20 -$(SHLIB): $(OBJECTS-y) - $(CC) $(LDFLAGS) $(SONAME_FLAGS) $(SHLIB_LDFLAGS) -o $@ \ - $(OBJECTS-y) $(LDLIBS-y) $(APPEND_LDFLAGS) +include $(XEN_ROOT)/tools/libs/libs.mk =20 -src/libxenstat.so.$(MAJOR): $(SHLIB) - $(MAKE_LINK) $( (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 159483216756092.0799398989451; Wed, 15 Jul 2020 09:56:07 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jvkhC-0006Fb-M7; Wed, 15 Jul 2020 16:55: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 1jvkhB-0006F0-G5 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2020 16:55:49 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 08084f72-c6bc-11ea-bca7-bc764e2007e4; Wed, 15 Jul 2020 16:55:48 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jvkDz-0001sU-Qh; Wed, 15 Jul 2020 17:25:39 +0100 X-Inumbo-ID: 08084f72-c6bc-11ea-bca7-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [PATCH 12/12] tools: generate most contents of library make variables Date: Wed, 15 Jul 2020 17:25:11 +0100 Message-Id: <20200715162511.5941-14-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200715162511.5941-1-ian.jackson@eu.citrix.com> References: <20200715162511.5941-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: incoming+61544a64d0c2dc4555813e58f3810dd7@incoming.gitlab.com, xen-devel@lists.xenproject.org Cc: Juergen Gross , ian.jackson@eu.citrix.com, Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" From: Juergen Gross 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. This in turn makes it possible to drop the USELIB variable from each library Makefile. Signed-off-by: Juergen Gross --- tools/Rules.mk | 103 ++++++++++-------------------- tools/libs/call/Makefile | 1 - tools/libs/ctrl/Makefile | 1 - tools/libs/devicemodel/Makefile | 1 - tools/libs/evtchn/Makefile | 1 - tools/libs/foreignmemory/Makefile | 1 - tools/libs/gnttab/Makefile | 1 - tools/libs/hypfs/Makefile | 1 - tools/libs/libs.mk | 5 +- tools/libs/stat/Makefile | 1 - tools/libs/store/Makefile | 1 - tools/libs/vchan/Makefile | 1 - 12 files changed, 35 insertions(+), 83 deletions(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index 279df14152..89b28e3fad 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -12,18 +12,38 @@ INSTALL =3D $(XEN_ROOT)/tools/cross-install LDFLAGS +=3D $(PREPEND_LDFLAGS_XEN_TOOLS) =20 XEN_INCLUDE =3D $(XEN_ROOT)/tools/include -XEN_libxentoolcore =3D $(XEN_ROOT)/tools/libs/toolcore -XEN_libxentoollog =3D $(XEN_ROOT)/tools/libs/toollog -XEN_libxenevtchn =3D $(XEN_ROOT)/tools/libs/evtchn -XEN_libxengnttab =3D $(XEN_ROOT)/tools/libs/gnttab -XEN_libxencall =3D $(XEN_ROOT)/tools/libs/call -XEN_libxenforeignmemory =3D $(XEN_ROOT)/tools/libs/foreignmemory -XEN_libxendevicemodel =3D $(XEN_ROOT)/tools/libs/devicemodel -XEN_libxenhypfs =3D $(XEN_ROOT)/tools/libs/hypfs -XEN_libxenctrl =3D $(XEN_ROOT)/tools/libs/ctrl -XEN_libxenstore =3D $(XEN_ROOT)/tools/libs/store -XEN_libxenstat =3D $(XEN_ROOT)/tools/libs/stat -XEN_libxenvchan =3D $(XEN_ROOT)/tools/libs/vchan + +LIBS_LIBS +=3D toolcore +USELIBS_toolcore :=3D +LIBS_LIBS +=3D toollog +USELIBS_toollog :=3D +LIBS_LIBS +=3D evtchn +USELIBS_evtchn :=3D toollog toolcore +LIBS_LIBS +=3D gnttab +USELIBS_gnttab :=3D toollog toolcore +LIBS_LIBS +=3D call +USELIBS_call :=3D toollog toolcore +LIBS_LIBS +=3D foreignmemory +USELIBS_foreignmemory :=3D toollog toolcore +LIBS_LIBS +=3D devicemodel +USELIBS_devicemodel :=3D toollog toolcore call +LIBS_LIBS +=3D hypfs +USELIBS_hypfs :=3D toollog toolcore call +LIBS_LIBS +=3D ctrl +USELIBS_ctrl :=3D toollog call evtchn gnttab foreignmemory devicemodel +LIBS_LIBS +=3D store +USELIBS_store :=3D toolcore +LIBS_LIBS +=3D stat +USELIBS_stat :=3D ctrl store +LIBS_LIBS +=3D vchan +USELIBS_vchan :=3D toollog store gnttab evtchn + +$(foreach lib,$(LIBS_LIBS),$(eval XEN_libxen$(lib) =3D $(XEN_ROOT)/tools/l= ibs/$(lib))) +$(foreach lib,$(LIBS_LIBS),$(eval CFLAGS_libxen$(lib) =3D -I$(XEN_libxen$(= lib))/include $(CFLAGS_xeninclude))) +$(foreach lib,$(LIBS_LIBS),$(eval SHDEPS_libxen$(lib) =3D $(foreach use,$(= USELIBS_$(lib)),$(SHLIB_libxen$(use))))) +$(foreach lib,$(LIBS_LIBS),$(eval LDLIBS_libxen$(lib) =3D $(SHDEPS_libxen$= (lib)) $(XEN_libxen$(lib))/libxen$(lib)$(libextension))) +$(foreach lib,$(LIBS_LIBS),$(eval SHLIB_libxen$(lib) =3D $(SHDEPS_libxen$(= lib)) -Wl,-rpath-link=3D$(XEN_libxen$(lib)))) + XEN_libxenguest =3D $(XEN_ROOT)/tools/libxc XEN_libxenlight =3D $(XEN_ROOT)/tools/libxl # Currently libxlutil lives in the same directory as libxenlight @@ -98,76 +118,19 @@ endif # Consumers of libfoo should not directly use $(SHDEPS_libfoo) or # $(SHLIB_libfoo) =20 -CFLAGS_libxentoollog =3D -I$(XEN_libxentoollog)/include $(CFLAGS_xeninclud= e) -SHDEPS_libxentoollog =3D -LDLIBS_libxentoollog =3D $(SHDEPS_libxentoollog) $(XEN_libxentoollog)/libx= entoollog$(libextension) -SHLIB_libxentoollog =3D $(SHDEPS_libxentoollog) -Wl,-rpath-link=3D$(XEN_l= ibxentoollog) - -CFLAGS_libxentoolcore =3D -I$(XEN_libxentoolcore)/include $(CFLAGS_xenincl= ude) -SHDEPS_libxentoolcore =3D -LDLIBS_libxentoolcore =3D $(SHDEPS_libxentoolcore) $(XEN_libxentoolcore)/l= ibxentoolcore$(libextension) -SHLIB_libxentoolcore =3D $(SHDEPS_libxentoolcore) -Wl,-rpath-link=3D$(XEN= _libxentoolcore) - -CFLAGS_libxenevtchn =3D -I$(XEN_libxenevtchn)/include $(CFLAGS_xeninclude) -SHDEPS_libxenevtchn =3D $(SHLIB_libxentoolcore) -LDLIBS_libxenevtchn =3D $(SHDEPS_libxenevtchn) $(XEN_libxenevtchn)/libxene= vtchn$(libextension) -SHLIB_libxenevtchn =3D $(SHDEPS_libxenevtchn) -Wl,-rpath-link=3D$(XEN_lib= xenevtchn) - -CFLAGS_libxengnttab =3D -I$(XEN_libxengnttab)/include $(CFLAGS_xeninclude) -SHDEPS_libxengnttab =3D $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) -LDLIBS_libxengnttab =3D $(SHDEPS_libxengnttab) $(XEN_libxengnttab)/libxeng= nttab$(libextension) -SHLIB_libxengnttab =3D $(SHDEPS_libxengnttab) -Wl,-rpath-link=3D$(XEN_lib= xengnttab) - -CFLAGS_libxencall =3D -I$(XEN_libxencall)/include $(CFLAGS_xeninclude) -SHDEPS_libxencall =3D $(SHLIB_libxentoolcore) -LDLIBS_libxencall =3D $(SHDEPS_libxencall) $(XEN_libxencall)/libxencall$(l= ibextension) -SHLIB_libxencall =3D $(SHDEPS_libxencall) -Wl,-rpath-link=3D$(XEN_libxenc= all) - -CFLAGS_libxenforeignmemory =3D -I$(XEN_libxenforeignmemory)/include $(CFLA= GS_xeninclude) -SHDEPS_libxenforeignmemory =3D $(SHLIB_libxentoolcore) -LDLIBS_libxenforeignmemory =3D $(SHDEPS_libxenforeignmemory) $(XEN_libxenf= oreignmemory)/libxenforeignmemory$(libextension) -SHLIB_libxenforeignmemory =3D $(SHDEPS_libxenforeignmemory) -Wl,-rpath-li= nk=3D$(XEN_libxenforeignmemory) - -CFLAGS_libxendevicemodel =3D -I$(XEN_libxendevicemodel)/include $(CFLAGS_x= eninclude) -SHDEPS_libxendevicemodel =3D $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore= ) $(SHLIB_libxencall) -LDLIBS_libxendevicemodel =3D $(SHDEPS_libxendevicemodel) $(XEN_libxendevic= emodel)/libxendevicemodel$(libextension) -SHLIB_libxendevicemodel =3D $(SHDEPS_libxendevicemodel) -Wl,-rpath-link= =3D$(XEN_libxendevicemodel) - -CFLAGS_libxenhypfs =3D -I$(XEN_libxenhypfs)/include $(CFLAGS_xeninclude) -SHDEPS_libxenhypfs =3D $(SHLIB_libxentoollog) $(SHLIB_libxentoolcore) $(SH= LIB_libxencall) -LDLIBS_libxenhypfs =3D $(SHDEPS_libxenhypfs) $(XEN_libxenhypfs)/libxenhypf= s$(libextension) -SHLIB_libxenhypfs =3D $(SHDEPS_libxenhypfs) -Wl,-rpath-link=3D$(XEN_libxe= nhypfs) - # code which compiles against libxenctrl get __XEN_TOOLS__ and # therefore sees the unstable hypercall interfaces. -CFLAGS_libxenctrl =3D -I$(XEN_libxenctrl)/include $(CFLAGS_libxentoollog) = $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) $(CFLAGS_xeninclu= de) -D__XEN_TOOLS__ -SHDEPS_libxenctrl =3D $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB= _libxengnttab) $(SHLIB_libxencall) $(SHLIB_libxenforeignmemory) $(SHLIB_lib= xendevicemodel) -LDLIBS_libxenctrl =3D $(SHDEPS_libxenctrl) $(XEN_libxenctrl)/libxenctrl$(l= ibextension) -SHLIB_libxenctrl =3D $(SHDEPS_libxenctrl) -Wl,-rpath-link=3D$(XEN_libxenc= trl) +CFLAGS_libxenctrl +=3D (CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory= ) $(CFLAGS_libxendevicemodel) -D__XEN_TOOLS__ =20 CFLAGS_libxenguest =3D -I$(XEN_libxenguest)/include $(CFLAGS_libxenevtchn)= $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude) SHDEPS_libxenguest =3D $(SHLIB_libxenevtchn) $(SHLIB_libxenctrl) LDLIBS_libxenguest =3D $(SHDEPS_libxenguest) $(XEN_libxenguest)/libxengues= t$(libextension) SHLIB_libxenguest =3D $(SHDEPS_libxenguest) -Wl,-rpath-link=3D$(XEN_libxe= nguest) =20 -CFLAGS_libxenstore =3D -I$(XEN_libxenstore)/include $(CFLAGS_xeninclude) -SHDEPS_libxenstore =3D $(SHLIB_libxentoolcore) -LDLIBS_libxenstore =3D $(SHDEPS_libxenstore) $(XEN_libxenstore)/libxenstor= e$(libextension) -SHLIB_libxenstore =3D $(SHDEPS_libxenstore) -Wl,-rpath-link=3D$(XEN_libxe= nstore) ifeq ($(CONFIG_Linux),y) LDLIBS_libxenstore +=3D -ldl endif =20 -CFLAGS_libxenstat =3D -I$(XEN_libxenstat)/include -SHDEPS_libxenstat =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) -LDLIBS_libxenstat =3D $(SHDEPS_libxenstat) $(XEN_libxenstat)/libxenstat$(= libextension) -SHLIB_libxenstat =3D $(SHDEPS_libxenstat) -Wl,-rpath-link=3D$(XEN_libxen= stat) - -CFLAGS_libxenvchan =3D -I$(XEN_libxenvchan)/include $(CFLAGS_libxengnttab)= $(CFLAGS_libxenevtchn) -SHDEPS_libxenvchan =3D $(SHLIB_libxentoollog) $(SHLIB_libxenstore) $(SHLIB= _libxenevtchn) $(SHLIB_libxengnttab) -LDLIBS_libxenvchan =3D $(SHDEPS_libxenvchan) $(XEN_libxenvchan)/libxenvcha= n$(libextension) -SHLIB_libxenvchan =3D $(SHDEPS_libxenvchan) -Wl,-rpath-link=3D$(XEN_libxe= nvchan) - ifeq ($(debug),y) # Disable optimizations CFLAGS +=3D -O0 -fno-omit-frame-pointer diff --git a/tools/libs/call/Makefile b/tools/libs/call/Makefile index 7994b411fa..acddc41928 100644 --- a/tools/libs/call/Makefile +++ b/tools/libs/call/Makefile @@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR =3D 1 MINOR =3D 2 LIBNAME :=3D call -USELIBS :=3D toollog toolcore =20 SRCS-y +=3D core.c buffer.c SRCS-$(CONFIG_Linux) +=3D linux.c diff --git a/tools/libs/ctrl/Makefile b/tools/libs/ctrl/Makefile index bda0b43dfa..9d9b32cd2b 100644 --- a/tools/libs/ctrl/Makefile +++ b/tools/libs/ctrl/Makefile @@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR =3D 4.14 MINOR =3D 0 LIBNAME :=3D ctrl -USELIBS :=3D toollog call evtchn gnttab foreignmemory devicemodel =20 SRCS-y +=3D xc_altp2m.c SRCS-y +=3D xc_core.c diff --git a/tools/libs/devicemodel/Makefile b/tools/libs/devicemodel/Makef= ile index d9d1d1b850..0c0d9114cb 100644 --- a/tools/libs/devicemodel/Makefile +++ b/tools/libs/devicemodel/Makefile @@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR =3D 1 MINOR =3D 3 LIBNAME :=3D devicemodel -USELIBS :=3D toollog toolcore call =20 SRCS-y +=3D core.c SRCS-$(CONFIG_Linux) +=3D linux.c diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile index d7aa4d402f..ea529e5fb7 100644 --- a/tools/libs/evtchn/Makefile +++ b/tools/libs/evtchn/Makefile @@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR =3D 1 MINOR =3D 1 LIBNAME :=3D evtchn -USELIBS :=3D toollog toolcore =20 SRCS-y +=3D core.c SRCS-$(CONFIG_Linux) +=3D linux.c diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/M= akefile index 823989681d..17057fc1e1 100644 --- a/tools/libs/foreignmemory/Makefile +++ b/tools/libs/foreignmemory/Makefile @@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR =3D 1 MINOR =3D 3 LIBNAME :=3D foreignmemory -USELIBS :=3D toollog toolcore =20 SRCS-y +=3D core.c SRCS-$(CONFIG_Linux) +=3D linux.c diff --git a/tools/libs/gnttab/Makefile b/tools/libs/gnttab/Makefile index c0fffdac71..2467330d1a 100644 --- a/tools/libs/gnttab/Makefile +++ b/tools/libs/gnttab/Makefile @@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR =3D 1 MINOR =3D 2 LIBNAME :=3D gnttab -USELIBS :=3D toollog toolcore =20 SRCS-GNTTAB +=3D gnttab_core.c SRCS-GNTSHR +=3D gntshr_core.c diff --git a/tools/libs/hypfs/Makefile b/tools/libs/hypfs/Makefile index b4c41f6189..af358547f2 100644 --- a/tools/libs/hypfs/Makefile +++ b/tools/libs/hypfs/Makefile @@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR =3D 1 MINOR =3D 0 LIBNAME :=3D hypfs -USELIBS :=3D toollog toolcore call =20 APPEND_LDFLAGS +=3D -lz =20 diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk index 764f5441e2..dde0360b1e 100644 --- a/tools/libs/libs.mk +++ b/tools/libs/libs.mk @@ -4,15 +4,14 @@ # 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") =20 SHLIB_LDFLAGS +=3D -Wl,--version-script=3Dlibxen$(LIBNAME).map =20 CFLAGS +=3D -Werror -Wmissing-prototypes CFLAGS +=3D -I./include $(CFLAGS_xeninclude) -CFLAGS +=3D $(foreach lib, $(USELIBS), $(CFLAGS_libxen$(lib))) +CFLAGS +=3D $(foreach lib, $(USELIBS_$(LIBNAME)), $(CFLAGS_libxen$(lib))) =20 -LDUSELIBS =3D $(foreach lib, $(USELIBS), $(LDLIBS_libxen$(lib))) +LDUSELIBS =3D $(foreach lib, $(USELIBS_$(LIBNAME)), $(LDLIBS_libxen$(lib))) =20 LIB_OBJS :=3D $(SRCS-y:.c=3D.o) PIC_OBJS :=3D $(SRCS-y:.c=3D.opic) diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile index 6162395a9a..87bfa1b91c 100644 --- a/tools/libs/stat/Makefile +++ b/tools/libs/stat/Makefile @@ -18,7 +18,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR =3D 4.14 MINOR =3D 0 LIBNAME :=3D stat -USELIBS :=3D ctrl store =20 CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude= ) -include $(XEN_ROOT)/tools/config.h =20 diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile index 76b30145cf..2aa8add521 100644 --- a/tools/libs/store/Makefile +++ b/tools/libs/store/Makefile @@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR =3D 3.0 MINOR =3D 3 LIBNAME :=3D store -USELIBS :=3D toolcore =20 ifeq ($(CONFIG_Linux),y) APPEND_LDFLAGS +=3D -ldl diff --git a/tools/libs/vchan/Makefile b/tools/libs/vchan/Makefile index bf944d251c..5b59ff5265 100644 --- a/tools/libs/vchan/Makefile +++ b/tools/libs/vchan/Makefile @@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk MAJOR =3D 4.14 MINOR =3D 0 LIBNAME :=3D vchan -USELIBS :=3D toollog store evtchn gnttab =20 CFLAGS +=3D $(CFLAGS_libxenctrl) =20 --=20 2.20.1