From nobody Thu May 9 01:58:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1489674071113881.9135957749387; Thu, 16 Mar 2017 07:21:11 -0700 (PDT) Received: from localhost ([::1]:43801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coWH4-0002cd-Gb for importer@patchew.org; Thu, 16 Mar 2017 10:21:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coWGA-0002a8-4c for qemu-devel@nongnu.org; Thu, 16 Mar 2017 10:20:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1coWG4-0008Ur-0E for qemu-devel@nongnu.org; Thu, 16 Mar 2017 10:20:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:60559) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1coWG3-0008SU-MN for qemu-devel@nongnu.org; Thu, 16 Mar 2017 10:20:03 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A27DBABC6; Thu, 16 Mar 2017 14:20:00 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: qemu-devel@nongnu.org, xen-devel@lists.xenproject.org Date: Thu, 16 Mar 2017 15:19:52 +0100 Message-Id: <20170316141953.16161-2-jgross@suse.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170316141953.16161-1-jgross@suse.com> References: <20170316141953.16161-1-jgross@suse.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 Subject: [Qemu-devel] [PATCH 1/2] xen: use 5 digit xen versions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: anthony.perard@citrix.com, Juergen Gross , sstabellini@kernel.org, kraxel@redhat.com, paul.durrant@citrix.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Today qemu is using e.g. the value 480 for Xen version 4.8.0. As some Xen version tests are using ">" relations this scheme will lead to problems when Xen version 4.10.0 is being reached. Instead of the 3 digit schem use a 5 digit scheme (e.g. 40800 for version 4.8.0). Signed-off-by: Juergen Gross Reviewed-by: Stefano Stabellini --- configure | 16 ++++++++-------- hw/block/xen_disk.c | 2 +- include/hw/xen/xen_common.h | 22 +++++++++++----------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/configure b/configure index b187222..aabf098 100755 --- a/configure +++ b/configure @@ -2001,7 +2001,7 @@ EOF compile_prog "" "$xen_libs $xen_stable_libs -lxendevicemodel" then xen_stable_libs=3D"$xen_stable_libs -lxendevicemodel" - xen_ctrl_version=3D490 + xen_ctrl_version=3D40900 xen=3Dyes elif cat > $TMPC < $TMPC < $TMPC <=3D 480 +#if CONFIG_XEN_CTRL_INTERFACE_VERSION >=3D 40800 =20 static void ioreq_free_copy_buffers(struct ioreq *ioreq) { diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h index 274accc..df098c7 100644 --- a/include/hw/xen/xen_common.h +++ b/include/hw/xen/xen_common.h @@ -27,7 +27,7 @@ extern xc_interface *xen_xc; * We don't support Xen prior to 4.2.0. */ =20 -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 490 +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40900 =20 typedef xc_interface xendevicemodel_handle; =20 @@ -37,7 +37,7 @@ static inline xendevicemodel_handle *xendevicemodel_open( return xen_xc; } =20 -#if CONFIG_XEN_CTRL_INTERFACE_VERSION >=3D 450 +#if CONFIG_XEN_CTRL_INTERFACE_VERSION >=3D 40500 =20 static inline int xendevicemodel_create_ioreq_server( xendevicemodel_handle *dmod, domid_t domid, int handle_bufioreq, @@ -100,7 +100,7 @@ static inline int xendevicemodel_set_ioreq_server_state( return xc_hvm_set_ioreq_server_state(dmod, domid, id, enabled); } =20 -#endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION >=3D 450 */ +#endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION >=3D 40500 */ =20 static inline int xendevicemodel_set_pci_intx_level( xendevicemodel_handle *dmod, domid_t domid, uint16_t segment, @@ -152,7 +152,7 @@ static inline int xendevicemodel_set_mem_type( return xc_hvm_set_mem_type(dmod, domid, mem_type, first_pfn, nr); } =20 -#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >=3D 490 */ +#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >=3D 40900 */ =20 #include =20 @@ -207,7 +207,7 @@ static inline int xen_modified_memory(domid_t domid, ui= nt64_t first_pfn, } =20 /* Xen 4.2 through 4.6 */ -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 471 +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40701 =20 typedef xc_interface xenforeignmemory_handle; typedef xc_evtchn xenevtchn_handle; @@ -248,7 +248,7 @@ static inline void *xenforeignmemory_map(xc_interface *= h, uint32_t dom, =20 #define xenforeignmemory_unmap(h, p, s) munmap(p, s * XC_PAGE_SIZE) =20 -#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >=3D 471 */ +#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >=3D 40701 */ =20 #include #include @@ -284,7 +284,7 @@ static inline int xen_get_vmport_regs_pfn(xc_interface = *xc, domid_t dom, #endif =20 /* Xen before 4.6 */ -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 460 +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40600 =20 #ifndef HVM_IOREQSRV_BUFIOREQ_ATOMIC #define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2 @@ -330,7 +330,7 @@ static inline int xen_get_default_ioreq_server_info(dom= id_t dom, } =20 /* Xen before 4.5 */ -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 450 +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40500 =20 #ifndef HVM_PARAM_BUFIOREQ_EVTCHN #define HVM_PARAM_BUFIOREQ_EVTCHN 26 @@ -569,7 +569,7 @@ static inline int xen_set_ioreq_server_state(domid_t do= m, =20 #endif =20 -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 460 +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40600 static inline int xen_xc_domain_add_to_physmap(xc_interface *xch, uint32_t= domid, unsigned int space, unsigned long idx, @@ -592,7 +592,7 @@ static inline int xen_xc_domain_add_to_physmap(xc_inter= face *xch, uint32_t domid #endif =20 #ifdef CONFIG_XEN_PV_DOMAIN_BUILD -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 470 +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40700 static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref, xen_domain_handle_t handle, uint32_t f= lags, uint32_t *pdomid) @@ -611,7 +611,7 @@ static inline int xen_domain_create(xc_interface *xc, u= int32_t ssidref, =20 /* Xen before 4.8 */ =20 -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 480 +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40800 =20 =20 typedef void *xengnttab_grant_copy_segment_t; --=20 2.10.2 From nobody Thu May 9 01:58:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1489674068399305.5317285322243; Thu, 16 Mar 2017 07:21:08 -0700 (PDT) Received: from localhost ([::1]:43800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coWH4-0002cX-4b for importer@patchew.org; Thu, 16 Mar 2017 10:21:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coWG7-0002Xj-2Q for qemu-devel@nongnu.org; Thu, 16 Mar 2017 10:20:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1coWG3-0008Ud-Sq for qemu-devel@nongnu.org; Thu, 16 Mar 2017 10:20:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:60566) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1coWG3-0008SY-Lp for qemu-devel@nongnu.org; Thu, 16 Mar 2017 10:20:03 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 10528AD70; Thu, 16 Mar 2017 14:20:01 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: qemu-devel@nongnu.org, xen-devel@lists.xenproject.org Date: Thu, 16 Mar 2017 15:19:53 +0100 Message-Id: <20170316141953.16161-3-jgross@suse.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170316141953.16161-1-jgross@suse.com> References: <20170316141953.16161-1-jgross@suse.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 Subject: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: anthony.perard@citrix.com, Juergen Gross , sstabellini@kernel.org, kraxel@redhat.com, paul.durrant@citrix.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Instead of trying to guess the Xen version to use by compiling various test programs first just ask the system via pkg-config. Only if it can't return the version fall back to the test program scheme. Signed-off-by: Juergen Gross --- configure | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/configure b/configure index aabf098..b43fbd5 100755 --- a/configure +++ b/configure @@ -1983,26 +1983,12 @@ EOF fi xen=3Dno =20 - # Xen unstable - elif - cat > $TMPC < -int main(void) { - xendevicemodel_handle *xd; - - xd =3D xendevicemodel_open(0, 0); - xendevicemodel_close(xd); - - return 0; -} -EOF - compile_prog "" "$xen_libs $xen_stable_libs -lxendevicemodel" - then - xen_stable_libs=3D"$xen_stable_libs -lxendevicemodel" - xen_ctrl_version=3D40900 + # Xen version via pkg-config (Xen 4.9.0 and newer) + elif $pkg_config --exists xencontrol ; then + xen_ctrl_version=3D"$(printf '%d%02d%02d' \ + $($pkg_config --modversion xencontrol | sed 's/\./ /g') )" xen=3Dyes + elif cat > $TMPC <