From: Paul Durrant <paul.durrant@citrix.com>
To: xen-devel@lists.xenproject.org, qemu-block@nongnu.org,
qemu-devel@nongnu.org
Cc: Anthony Perard <anthony.perard@citrix.com>,
Paul Durrant <paul.durrant@citrix.com>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v4 1/9] xen: add a meaningful declaration of grant_copy_segment into xen_common.h
Date: Thu, 17 May 2018 16:35:50 +0100 [thread overview]
Message-ID: <1526571358-26685-2-git-send-email-paul.durrant@citrix.com> (raw)
In-Reply-To: <1526571358-26685-1-git-send-email-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>
---
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
v4:
- New in v4
---
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)
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-05-17 15:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 15:35 [PATCH v4 0/9] xen_disk: legacy code removal and cleanup Paul Durrant
2018-05-17 15:35 ` Paul Durrant [this message]
2018-05-18 10:37 ` [PATCH v4 1/9] xen: add a meaningful declaration of grant_copy_segment into xen_common.h Anthony PERARD
2018-05-17 15:35 ` [PATCH v4 2/9] xen_backend: add grant table helpers Paul Durrant
2018-05-18 10:42 ` Anthony PERARD
2018-05-17 15:35 ` [PATCH v4 3/9] xen_disk: remove open-coded use of libxengnttab Paul Durrant
2018-05-17 15:35 ` [PATCH v4 4/9] xen: remove other " Paul Durrant
2018-05-17 15:35 ` [PATCH v4 5/9] xen_backend: add an emulation of grant copy Paul Durrant
2018-05-18 10:44 ` Anthony PERARD
2018-05-17 15:35 ` [PATCH v4 6/9] xen_disk: remove use of grant map/unmap Paul Durrant
2018-05-17 15:35 ` [PATCH v4 7/9] xen_backend: make the xen_feature_grant_copy flag private Paul Durrant
2018-05-17 15:35 ` [PATCH v4 8/9] xen_disk: use a single entry iovec Paul Durrant
2018-05-17 15:35 ` [PATCH v4 9/9] xen_disk: be consistent with use of xendev and blkdev->xendev Paul Durrant
2018-05-17 15:37 ` Paul Durrant
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=1526571358-26685-2-git-send-email-paul.durrant@citrix.com \
--to=paul.durrant@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--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).