All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: peter.maydell@linaro.org, stefanha@gmail.com
Cc: sstabellini@kernel.org, stefanha@redhat.com,
	anthony.perard@citrix.com, xen-devel@lists.xenproject.org,
	qemu-devel@nongnu.org, Paul Durrant <paul.durrant@citrix.com>
Subject: [Qemu-devel] [PULL 07/15] xen: add a meaningful declaration of grant_copy_segment into xen_common.h
Date: Mon, 21 May 2018 12:34:56 -0700	[thread overview]
Message-ID: <1526931304-7289-7-git-send-email-sstabellini@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1805211229070.4520@sstabellini-ThinkPad-X260>

From: Paul Durrant <paul.durrant@citrix.com>

Currently the xen_disk source has to carry #ifdef exclusions to compile
against Xen older then 4.8. This is a bit messy so this patch lifts the
definition of struct xengnttab_grant_copy_segment and adds it into the
pre-4.8 compat area in xen_common.h, which allows xen_disk to be cleaned
up.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
---
 hw/block/xen_disk.c         | 18 ------------------
 include/hw/xen/xen_common.h | 17 +++++++++++++++--
 2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index f74fcd4..78bfb41 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -496,8 +496,6 @@ static int ioreq_map(struct ioreq *ioreq)
     return 0;
 }
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40800
-
 static void ioreq_free_copy_buffers(struct ioreq *ioreq)
 {
     int i;
@@ -579,22 +577,6 @@ static int ioreq_grant_copy(struct ioreq *ioreq)
 
     return rc;
 }
-#else
-static void ioreq_free_copy_buffers(struct ioreq *ioreq)
-{
-    abort();
-}
-
-static int ioreq_init_copy_buffers(struct ioreq *ioreq)
-{
-    abort();
-}
-
-static int ioreq_grant_copy(struct ioreq *ioreq)
-{
-    abort();
-}
-#endif
 
 static int ioreq_runio_qemu_aio(struct ioreq *ioreq);
 
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 5f1402b..bbf207d 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -667,8 +667,21 @@ static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
 
 #if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40800
 
-
-typedef void *xengnttab_grant_copy_segment_t;
+struct xengnttab_grant_copy_segment {
+    union xengnttab_copy_ptr {
+        void *virt;
+        struct {
+            uint32_t ref;
+            uint16_t offset;
+            uint16_t domid;
+        } foreign;
+    } source, dest;
+    uint16_t len;
+    uint16_t flags;
+    int16_t status;
+};
+
+typedef struct xengnttab_grant_copy_segment xengnttab_grant_copy_segment_t;
 
 static inline int xengnttab_grant_copy(xengnttab_handle *xgt, uint32_t count,
                                        xengnttab_grant_copy_segment_t *segs)
-- 
1.9.1

WARNING: multiple messages have this Message-ID (diff)
From: Stefano Stabellini <sstabellini@kernel.org>
To: peter.maydell@linaro.org, stefanha@gmail.com
Cc: sstabellini@kernel.org, qemu-devel@nongnu.org,
	Paul Durrant <paul.durrant@citrix.com>,
	stefanha@redhat.com, anthony.perard@citrix.com,
	xen-devel@lists.xenproject.org
Subject: [PULL 07/15] xen: add a meaningful declaration of grant_copy_segment into xen_common.h
Date: Mon, 21 May 2018 12:34:56 -0700	[thread overview]
Message-ID: <1526931304-7289-7-git-send-email-sstabellini@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1805211229070.4520@sstabellini-ThinkPad-X260>

From: Paul Durrant <paul.durrant@citrix.com>

Currently the xen_disk source has to carry #ifdef exclusions to compile
against Xen older then 4.8. This is a bit messy so this patch lifts the
definition of struct xengnttab_grant_copy_segment and adds it into the
pre-4.8 compat area in xen_common.h, which allows xen_disk to be cleaned
up.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
---
 hw/block/xen_disk.c         | 18 ------------------
 include/hw/xen/xen_common.h | 17 +++++++++++++++--
 2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index f74fcd4..78bfb41 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -496,8 +496,6 @@ static int ioreq_map(struct ioreq *ioreq)
     return 0;
 }
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40800
-
 static void ioreq_free_copy_buffers(struct ioreq *ioreq)
 {
     int i;
@@ -579,22 +577,6 @@ static int ioreq_grant_copy(struct ioreq *ioreq)
 
     return rc;
 }
-#else
-static void ioreq_free_copy_buffers(struct ioreq *ioreq)
-{
-    abort();
-}
-
-static int ioreq_init_copy_buffers(struct ioreq *ioreq)
-{
-    abort();
-}
-
-static int ioreq_grant_copy(struct ioreq *ioreq)
-{
-    abort();
-}
-#endif
 
 static int ioreq_runio_qemu_aio(struct ioreq *ioreq);
 
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 5f1402b..bbf207d 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -667,8 +667,21 @@ static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
 
 #if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40800
 
-
-typedef void *xengnttab_grant_copy_segment_t;
+struct xengnttab_grant_copy_segment {
+    union xengnttab_copy_ptr {
+        void *virt;
+        struct {
+            uint32_t ref;
+            uint16_t offset;
+            uint16_t domid;
+        } foreign;
+    } source, dest;
+    uint16_t len;
+    uint16_t flags;
+    int16_t status;
+};
+
+typedef struct xengnttab_grant_copy_segment xengnttab_grant_copy_segment_t;
 
 static inline int xengnttab_grant_copy(xengnttab_handle *xgt, uint32_t count,
                                        xengnttab_grant_copy_segment_t *segs)
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-05-21 19:35 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 19:34 [Qemu-devel] [PULL 00/15] xen-20180521-tag Stefano Stabellini
2018-05-21 19:34 ` Stefano Stabellini
2018-05-21 19:34 ` [Qemu-devel] [PULL 01/15] xen-pvdevice: Introduce a simplistic xen-pvdevice save state Stefano Stabellini
2018-05-21 19:34   ` Stefano Stabellini
2018-05-21 19:34 ` [Qemu-devel] [PULL 02/15] xen/pt: use address_space_memory object for memory region hooks Stefano Stabellini
2018-05-21 19:34   ` Stefano Stabellini
2018-05-21 19:34 ` [Qemu-devel] [PULL 03/15] configure: Add explanation for --enable-xen-pci-passthrough Stefano Stabellini
2018-05-21 19:34   ` Stefano Stabellini
2018-05-21 19:34 ` [Qemu-devel] [PULL 04/15] xen_pt: Present the size of 64 bit BARs correctly Stefano Stabellini
2018-05-21 19:34   ` Stefano Stabellini
2018-05-21 19:34 ` [Qemu-devel] [PULL 05/15] xen-hvm: create separate function for ioreq server initialization Stefano Stabellini
2018-05-21 19:34   ` Stefano Stabellini
2018-05-21 19:34 ` [Qemu-devel] [PULL 06/15] All the xen stable APIs define handle types of the form: Stefano Stabellini
2018-05-21 19:34   ` Stefano Stabellini
2018-05-21 19:34 ` Stefano Stabellini [this message]
2018-05-21 19:34   ` [PULL 07/15] xen: add a meaningful declaration of grant_copy_segment into xen_common.h Stefano Stabellini
2018-05-21 19:34 ` [Qemu-devel] [PULL 08/15] xen_backend: add grant table helpers Stefano Stabellini
2018-05-21 19:34   ` Stefano Stabellini
2018-05-21 19:34 ` [Qemu-devel] [PULL 09/15] xen_disk: remove open-coded use of libxengnttab Stefano Stabellini
2018-05-21 19:34   ` Stefano Stabellini
2018-05-21 19:34 ` [Qemu-devel] [PULL 10/15] xen: remove other " Stefano Stabellini
2018-05-21 19:34   ` Stefano Stabellini
2018-05-21 19:35 ` [Qemu-devel] [PULL 11/15] xen_backend: add an emulation of grant copy Stefano Stabellini
2018-05-21 19:35   ` Stefano Stabellini
2018-05-21 19:35 ` [Qemu-devel] [PULL 12/15] xen_disk: remove use of grant map/unmap Stefano Stabellini
2018-05-21 19:35   ` Stefano Stabellini
2018-05-21 19:35 ` [Qemu-devel] [PULL 13/15] xen_backend: make the xen_feature_grant_copy flag private Stefano Stabellini
2018-05-21 19:35   ` Stefano Stabellini
2018-05-21 19:35 ` [Qemu-devel] [PULL 14/15] xen_disk: use a single entry iovec Stefano Stabellini
2018-05-21 19:35   ` Stefano Stabellini
2018-05-21 19:35 ` [Qemu-devel] [PULL 15/15] xen_disk: be consistent with use of xendev and blkdev->xendev Stefano Stabellini
2018-05-21 19:35   ` Stefano Stabellini
2018-05-21 19:57 ` [Qemu-devel] [PULL 00/15] xen-20180521-tag no-reply
2018-05-21 19:57   ` no-reply
2018-05-22 10:11 ` Peter Maydell
2018-05-22 10:11   ` Peter Maydell
2018-05-22 18:35   ` Stefano Stabellini
2018-05-22 18:35   ` [Qemu-devel] " 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=1526931304-7289-7-git-send-email-sstabellini@kernel.org \
    --to=sstabellini@kernel.org \
    --cc=anthony.perard@citrix.com \
    --cc=paul.durrant@citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.