qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: peter.maydell@linaro.org
Cc: stefanha@gmail.com, sstabellini@kernel.org, stefanha@redhat.com,
	anthony.perard@citrix.com, xen-devel@lists.xenproject.org,
	qemu-devel@nongnu.org, Juergen Gross <jgross@suse.com>
Subject: [Qemu-devel] [PATCH 06/21] xen: use 5 digit xen versions
Date: Tue, 25 Apr 2017 11:34:58 -0700	[thread overview]
Message-ID: <1493145313-31311-6-git-send-email-sstabellini@kernel.org> (raw)
In-Reply-To: <1493145313-31311-1-git-send-email-sstabellini@kernel.org>

From: Juergen Gross <jgross@suse.com>

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 <jgross@suse.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 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 e333547..271bea8 100755
--- a/configure
+++ b/configure
@@ -2014,7 +2014,7 @@ EOF
       compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs"
     then
     xen_stable_libs="-lxendevicemodel $xen_stable_libs"
-    xen_ctrl_version=490
+    xen_ctrl_version=40900
     xen=yes
   elif
       cat > $TMPC <<EOF &&
@@ -2069,7 +2069,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs $xen_stable_libs"
     then
-    xen_ctrl_version=480
+    xen_ctrl_version=40800
     xen=yes
   elif
       cat > $TMPC <<EOF &&
@@ -2120,7 +2120,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs $xen_stable_libs"
     then
-    xen_ctrl_version=471
+    xen_ctrl_version=40701
     xen=yes
   elif
       cat > $TMPC <<EOF &&
@@ -2135,7 +2135,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs"
     then
-    xen_ctrl_version=470
+    xen_ctrl_version=40700
     xen=yes
 
   # Xen 4.6
@@ -2163,7 +2163,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs"
     then
-    xen_ctrl_version=460
+    xen_ctrl_version=40600
     xen=yes
 
   # Xen 4.5
@@ -2190,7 +2190,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs"
     then
-    xen_ctrl_version=450
+    xen_ctrl_version=40500
     xen=yes
 
   elif
@@ -2215,7 +2215,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs"
     then
-    xen_ctrl_version=420
+    xen_ctrl_version=40200
     xen=yes
 
   else
@@ -2227,7 +2227,7 @@ EOF
   fi
 
   if test "$xen" = yes; then
-    if test $xen_ctrl_version -ge 471  ; then
+    if test $xen_ctrl_version -ge 40701  ; then
       libs_softmmu="$xen_stable_libs $libs_softmmu"
     fi
     libs_softmmu="$xen_libs $libs_softmmu"
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 456a2d5..27df048 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -492,7 +492,7 @@ static int ioreq_map(struct ioreq *ioreq)
     return 0;
 }
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 480
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40800
 
 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 b1f5f53..fa990a0 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -26,7 +26,7 @@ extern xc_interface *xen_xc;
  * We don't support Xen prior to 4.2.0.
  */
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 490
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40900
 
 typedef xc_interface xendevicemodel_handle;
 
@@ -36,7 +36,7 @@ static inline xendevicemodel_handle *xendevicemodel_open(
     return xen_xc;
 }
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 450
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40500
 
 static inline int xendevicemodel_create_ioreq_server(
     xendevicemodel_handle *dmod, domid_t domid, int handle_bufioreq,
@@ -99,7 +99,7 @@ static inline int xendevicemodel_set_ioreq_server_state(
     return xc_hvm_set_ioreq_server_state(dmod, domid, id, enabled);
 }
 
-#endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 450 */
+#endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40500 */
 
 static inline int xendevicemodel_set_pci_intx_level(
     xendevicemodel_handle *dmod, domid_t domid, uint16_t segment,
@@ -151,7 +151,7 @@ static inline int xendevicemodel_set_mem_type(
     return xc_hvm_set_mem_type(dmod, domid, mem_type, first_pfn, nr);
 }
 
-#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 490 */
+#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40900 */
 
 #undef XC_WANT_COMPAT_DEVICEMODEL_API
 #include <xendevicemodel.h>
@@ -207,7 +207,7 @@ static inline int xen_modified_memory(domid_t domid, uint64_t first_pfn,
 }
 
 /* Xen 4.2 through 4.6 */
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 471
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40701
 
 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,
 
 #define xenforeignmemory_unmap(h, p, s) munmap(p, s * XC_PAGE_SIZE)
 
-#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 471 */
+#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40701 */
 
 #include <xenevtchn.h>
 #include <xengnttab.h>
@@ -284,7 +284,7 @@ static inline int xen_get_vmport_regs_pfn(xc_interface *xc, domid_t dom,
 #endif
 
 /* Xen before 4.6 */
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 460
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40600
 
 #ifndef HVM_IOREQSRV_BUFIOREQ_ATOMIC
 #define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2
@@ -330,7 +330,7 @@ static inline int xen_get_default_ioreq_server_info(domid_t dom,
 }
 
 /* Xen before 4.5 */
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 450
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40500
 
 #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 dom,
 
 #endif
 
-#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_interface *xch, uint32_t domid
 #endif
 
 #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 flags,
                                     uint32_t *pdomid)
@@ -611,7 +611,7 @@ static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
 
 /* Xen before 4.8 */
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 480
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40800
 
 
 typedef void *xengnttab_grant_copy_segment_t;
-- 
1.9.1

  parent reply	other threads:[~2017-04-25 18:35 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25 18:34 [Qemu-devel] [PULL 0/21] Please pull xen-20170421-v2-tag for 2.10 Stefano Stabellini
2017-04-25 18:34 ` [Qemu-devel] [PATCH 01/21] xen: make use of xen_xc implicit in xen_common.h inlines Stefano Stabellini
2017-04-25 18:34   ` [Qemu-devel] [PATCH 02/21] xen: rename xen_modified_memory() to xen_hvm_modified_memory() Stefano Stabellini
2017-04-25 18:34   ` [Qemu-devel] [PATCH 03/21] xen: create wrappers for all other uses of xc_hvm_XXX() functions Stefano Stabellini
2017-04-25 18:34   ` [Qemu-devel] [PATCH 04/21] configure: detect presence of libxendevicemodel Stefano Stabellini
2017-04-25 18:34   ` [Qemu-devel] [PATCH 05/21] xen: use libxendevicemodel when available Stefano Stabellini
2017-04-25 18:34   ` Stefano Stabellini [this message]
2017-04-25 18:34   ` [Qemu-devel] [PATCH 07/21] xen: use libxendevice model to restrict operations Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 08/21] xen: additionally restrict xenforeignmemory operations Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 09/21] configure: use pkg-config for obtaining xen version Stefano Stabellini
2018-12-11 10:34     ` Peter Maydell
2018-12-11 10:43       ` Daniel P. Berrangé
2019-01-02 21:21       ` Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 10/21] xen: import ring.h from xen Stefano Stabellini
2017-04-26  1:52     ` Philippe Mathieu-Daudé
2017-04-25 18:35   ` [Qemu-devel] [PATCH 11/21] 9p: introduce a type for the 9p header Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 12/21] xen/9pfs: introduce Xen 9pfs backend Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 13/21] xen/9pfs: connect to the frontend Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 14/21] xen/9pfs: receive requests from " Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 15/21] xen/9pfs: implement in/out_iov_from_pdu and vmarshal/vunmarshal Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 16/21] xen/9pfs: send responses back to the frontend Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 17/21] xen/9pfs: build and register Xen 9pfs backend Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 18/21] add xen-9p-backend to MAINTAINERS under Xen Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 19/21] move xen-common.c to hw/xen/ Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 20/21] move xen-hvm.c to hw/i386/xen/ Stefano Stabellini
2017-04-25 18:35   ` [Qemu-devel] [PATCH 21/21] move xen-mapcache.c " Stefano Stabellini
2017-04-26 10:39 ` [Qemu-devel] [PULL 0/21] Please pull xen-20170421-v2-tag for 2.10 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1493145313-31311-6-git-send-email-sstabellini@kernel.org \
    --to=sstabellini@kernel.org \
    --cc=anthony.perard@citrix.com \
    --cc=jgross@suse.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).