From: Wei Liu <wei.liu2@citrix.com>
To: Paulina Szubarczyk <paulinaszubarczyk@gmail.com>
Cc: sstabellini@kernel.org, wei.liu2@citrix.com,
ian.jackson@eu.citrix.com, qemu-devel@nongnu.org,
david.vrabel@citrix.com, anthony.perard@citrix.com,
xen-devel@lists.xenproject.org, roger.pau@citrix.com
Subject: Re: [PATCH v7 1/2] libs/gnttab: introduce grant copy interface
Date: Mon, 19 Sep 2016 16:58:23 +0100 [thread overview]
Message-ID: <20160919155823.GP30319@citrix.com> (raw)
In-Reply-To: <1473880203-4360-2-git-send-email-paulinaszubarczyk@gmail.com>
On Wed, Sep 14, 2016 at 09:10:02PM +0200, Paulina Szubarczyk wrote:
> In a linux part an ioctl(gntdev, IOCTL_GNTDEV_GRANT_COPY, ..)
> system call is invoked. In mini-os the operation is yet not
> implemented. For the OSs that does not implement gnttab the
> call of the grant copy operation causes abort.
>
> Signed-off-by: Paulina Szubarczyk <paulinaszubarczyk@gmail.com>
> Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Paulina, this is mostly for your information. No action is needed on
your side. Thanks for putting in the effort to contribute to Xen.
Because Ian prefers another way of dealing with BUILD_BUG_ON, I've sent
out another patch for that. I also write the following patch to fix up
this patch.
---8<---
From 096fef32bffaef5b3e273bdfe75d620d8a7c8792 Mon Sep 17 00:00:00 2001
From: Wei Liu <wei.liu2@citrix.com>
Date: Mon, 19 Sep 2016 16:50:35 +0100
Subject: [PATCH] fixup! libs/gnttab: introduce grant copy interface
---
tools/libs/gnttab/linux.c | 116 +++++++++++++++++++++++-----------------------
1 file changed, 59 insertions(+), 57 deletions(-)
diff --git a/tools/libs/gnttab/linux.c b/tools/libs/gnttab/linux.c
index 6bd9bd2..69b7e26 100644
--- a/tools/libs/gnttab/linux.c
+++ b/tools/libs/gnttab/linux.c
@@ -31,6 +31,8 @@
#include <xen/sys/gntdev.h>
#include <xen/sys/gntalloc.h>
+#include <xen-tools/libs.h>
+
#include "private.h"
#define DEVXEN "/dev/xen/"
@@ -244,63 +246,63 @@ int osdep_gnttab_grant_copy(xengnttab_handle *xgt,
int fd = xgt->fd;
struct ioctl_gntdev_grant_copy copy;
- XENGNTTAB_BUILD_BUG_ON(sizeof(struct ioctl_gntdev_grant_copy_segment) !=
- sizeof(xengnttab_grant_copy_segment_t));
-
- XENGNTTAB_BUILD_BUG_ON(__alignof__(struct ioctl_gntdev_grant_copy_segment) !=
- __alignof__(xengnttab_grant_copy_segment_t));
-
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- source.virt) !=
- offsetof(xengnttab_grant_copy_segment_t,
- source.virt));
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- source.foreign) !=
- offsetof(xengnttab_grant_copy_segment_t,
- source.foreign));
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- source.foreign.ref) !=
- offsetof(xengnttab_grant_copy_segment_t,
- source.foreign));
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- source.foreign.offset) !=
- offsetof(xengnttab_grant_copy_segment_t,
- source.foreign.offset));
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- source.foreign.domid) !=
- offsetof(xengnttab_grant_copy_segment_t,
- source.foreign.domid));
-
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- dest.virt) !=
- offsetof(xengnttab_grant_copy_segment_t,
- dest.virt));
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- dest.foreign) !=
- offsetof(xengnttab_grant_copy_segment_t,
- dest.foreign));
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- dest.foreign.ref) !=
- offsetof(xengnttab_grant_copy_segment_t,
- dest.foreign));
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- dest.foreign.offset) !=
- offsetof(xengnttab_grant_copy_segment_t,
- dest.foreign.offset));
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- dest.foreign.domid) !=
- offsetof(xengnttab_grant_copy_segment_t,
- dest.foreign.domid));
-
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- len) !=
- offsetof(xengnttab_grant_copy_segment_t, len));
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- flags) !=
- offsetof(xengnttab_grant_copy_segment_t, flags));
- XENGNTTAB_BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
- status) !=
- offsetof(xengnttab_grant_copy_segment_t, status));
+ BUILD_BUG_ON(sizeof(struct ioctl_gntdev_grant_copy_segment) !=
+ sizeof(xengnttab_grant_copy_segment_t));
+
+ BUILD_BUG_ON(__alignof__(struct ioctl_gntdev_grant_copy_segment) !=
+ __alignof__(xengnttab_grant_copy_segment_t));
+
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ source.virt) !=
+ offsetof(xengnttab_grant_copy_segment_t,
+ source.virt));
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ source.foreign) !=
+ offsetof(xengnttab_grant_copy_segment_t,
+ source.foreign));
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ source.foreign.ref) !=
+ offsetof(xengnttab_grant_copy_segment_t,
+ source.foreign));
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ source.foreign.offset) !=
+ offsetof(xengnttab_grant_copy_segment_t,
+ source.foreign.offset));
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ source.foreign.domid) !=
+ offsetof(xengnttab_grant_copy_segment_t,
+ source.foreign.domid));
+
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ dest.virt) !=
+ offsetof(xengnttab_grant_copy_segment_t,
+ dest.virt));
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ dest.foreign) !=
+ offsetof(xengnttab_grant_copy_segment_t,
+ dest.foreign));
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ dest.foreign.ref) !=
+ offsetof(xengnttab_grant_copy_segment_t,
+ dest.foreign));
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ dest.foreign.offset) !=
+ offsetof(xengnttab_grant_copy_segment_t,
+ dest.foreign.offset));
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ dest.foreign.domid) !=
+ offsetof(xengnttab_grant_copy_segment_t,
+ dest.foreign.domid));
+
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ len) !=
+ offsetof(xengnttab_grant_copy_segment_t, len));
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ flags) !=
+ offsetof(xengnttab_grant_copy_segment_t, flags));
+ BUILD_BUG_ON(offsetof(struct ioctl_gntdev_grant_copy_segment,
+ status) !=
+ offsetof(xengnttab_grant_copy_segment_t, status));
copy.segments = (struct ioctl_gntdev_grant_copy_segment *)segs;
copy.count = count;
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-09-19 15:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-14 19:10 [PATCH v7 0/2] qemu-qdisk: Implementation of grant copy operation Paulina Szubarczyk
2016-09-14 19:10 ` [PATCH v7 1/2] libs/gnttab: introduce grant copy interface Paulina Szubarczyk
2016-09-15 10:02 ` Wei Liu
2016-09-19 15:58 ` Wei Liu [this message]
2016-09-19 16:20 ` Wei Liu
2016-09-14 19:10 ` [PATCH v7 2/2] qdisk - hw/block/xen_disk: grant copy implementation Paulina Szubarczyk
2016-09-15 1:33 ` [PATCH v7 0/2] qemu-qdisk: Implementation of grant copy operation Stefano Stabellini
2016-09-15 9:11 ` Wei Liu
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=20160919155823.GP30319@citrix.com \
--to=wei.liu2@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=david.vrabel@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=paulinaszubarczyk@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=roger.pau@citrix.com \
--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).