qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: stefano.stabellini@eu.citrix.com, qemu-devel@nongnu.org
Cc: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Subject: [Qemu-devel] [PATCH 4/5] xen: move xenforeignmemory compat layer into common place
Date: Tue, 9 Feb 2016 16:17:15 +0000	[thread overview]
Message-ID: <1455034636-27829-4-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1455034615.19857.96.camel@citrix.com>

Now that we no longer support Xen 4.2 and earlier only the <470 case
needs this so it can live with all the others.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 include/hw/xen/xen_common.h | 34 ++++++++++++++--------------------
 1 file changed, 14 insertions(+), 20 deletions(-)

diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 254ef14..7a3cce0 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -53,7 +53,20 @@ typedef xc_gnttab xengnttab_handle;
 #define xengnttab_map_grant_refs(h, c, d, r, p) \
     xc_gnttab_map_grant_refs(h, c, d, r, p)
 
-/* See below for xenforeignmemory_* APIs */
+#define xenforeignmemory_open(l, f) xen_xc
+
+static inline void *xenforeignmemory_map(xc_interface *h, uint32_t dom,
+                                         int prot, size_t pages,
+                                         const xen_pfn_t arr[/*pages*/],
+                                         int err[/*pages*/])
+{
+    if (err)
+        return xc_map_foreign_bulk(h, dom, prot, arr, err, pages);
+    else
+        return xc_map_foreign_pages(h, dom, prot, arr, pages);
+}
+
+#define xenforeignmemory_unmap(h, p, s) munmap(p, s * XC_PAGE_SIZE)
 
 #else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 471 */
 
@@ -359,23 +372,4 @@ static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
 #endif
 #endif
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 471
-
-#define xenforeignmemory_open(l, f) xen_xc
-
-static inline void *xenforeignmemory_map(xc_interface *h, uint32_t dom,
-                                         int prot, size_t pages,
-                                         const xen_pfn_t arr[/*pages*/],
-                                         int err[/*pages*/])
-{
-    if (err)
-        return xc_map_foreign_bulk(h, dom, prot, arr, err, pages);
-    else
-        return xc_map_foreign_pages(h, dom, prot, arr, pages);
-}
-
-#define xenforeignmemory_unmap(h, p, s) munmap(p, s * XC_PAGE_SIZE)
-
-#endif
-
 #endif /* QEMU_HW_XEN_COMMON_H */
-- 
2.1.4

  parent reply	other threads:[~2016-02-09 16:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 16:16 [Qemu-devel] [PATCH 0/5] Drop support for Xen 4.1 and older from qemu-xen Ian Campbell
2016-02-09 16:17 ` [Qemu-devel] [PATCH 1/5] xen: drop support for Xen 4.1 and older Ian Campbell
2016-02-09 16:27   ` Peter Maydell
2016-02-09 16:50   ` Stefano Stabellini
2016-02-10 10:30     ` Ian Campbell
2016-02-10 10:45       ` Stefano Stabellini
2016-02-09 16:17 ` [Qemu-devel] [PATCH 2/5] xen: drop xen_xc_hvm_inject_msi wrapper Ian Campbell
2016-02-09 16:54   ` Stefano Stabellini
2016-02-09 16:17 ` [Qemu-devel] [PATCH 3/5] xen: drop XenXC and associated interface wrappers Ian Campbell
2016-02-09 17:18   ` Stefano Stabellini
2016-02-09 16:17 ` Ian Campbell [this message]
2016-02-09 17:18   ` [Qemu-devel] [PATCH 4/5] xen: move xenforeignmemory compat layer into common place Stefano Stabellini
2016-02-09 16:17 ` [Qemu-devel] [PATCH 5/5] xen: Drop __XEN_LATEST_INTERFACE_VERSION__ checks from prior to Xen 4.2 Ian Campbell
2016-02-09 17:23   ` Stefano Stabellini

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=1455034636-27829-4-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.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).