[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 07/15] xen: add a meaningful declaration of grant_
From: |
Stefano Stabellini |
Subject: |
[Qemu-devel] [PULL v2 07/15] xen: add a meaningful declaration of grant_copy_segment into xen_common.h |
Date: |
Tue, 22 May 2018 11:46:34 -0700 |
From: Paul Durrant <address@hidden>
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 <address@hidden>
Acked-by: Anthony PERARD <address@hidden>
Signed-off-by: Stefano Stabellini <address@hidden>
---
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
- [Qemu-devel] [PULL v2 00/15] xen-20180522-tag, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 01/15] xen-pvdevice: Introduce a simplistic xen-pvdevice save state, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 02/15] xen/pt: use address_space_memory object for memory region hooks, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 10/15] xen: remove other open-coded use of libxengnttab, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 15/15] xen_disk: be consistent with use of xendev and blkdev->xendev, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 05/15] xen-hvm: create separate function for ioreq server initialization, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 04/15] xen_pt: Present the size of 64 bit BARs correctly, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 03/15] configure: Add explanation for --enable-xen-pci-passthrough, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 07/15] xen: add a meaningful declaration of grant_copy_segment into xen_common.h,
Stefano Stabellini <=
- [Qemu-devel] [PULL v2 11/15] xen_backend: add an emulation of grant copy, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 06/15] checkpatch: generalize xen handle matching in the list of types, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 14/15] xen_disk: use a single entry iovec, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 13/15] xen_backend: make the xen_feature_grant_copy flag private, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 08/15] xen_backend: add grant table helpers, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 09/15] xen_disk: remove open-coded use of libxengnttab, Stefano Stabellini, 2018/05/22
- [Qemu-devel] [PULL v2 12/15] xen_disk: remove use of grant map/unmap, Stefano Stabellini, 2018/05/22
- Re: [Qemu-devel] [PULL v2 00/15] xen-20180522-tag, Peter Maydell, 2018/05/24