All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@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, xen-devel@lists.xenproject.org,
	roger.pau@citrix.com
Subject: Re: [PATCH v4 2/2] qdisk - hw/block/xen_disk: grant copy implementation
Date: Wed, 10 Aug 2016 11:29:47 +0100	[thread overview]
Message-ID: <20160810102947.GE1835__5712.72957972742$1470825059$gmane$org@perard.uk.xensource.com> (raw)
In-Reply-To: <57AA1416.6020307@gmail.com>

On Tue, Aug 09, 2016 at 07:34:14PM +0200, Paulina Szubarczyk wrote:
> On 08/09/2016 06:56 PM, Anthony PERARD wrote:
> > On Tue, Aug 02, 2016 at 04:06:30PM +0200, Paulina Szubarczyk wrote:
> > > diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
> > > index 640c31e..e80c61f 100644
> > > --- a/include/hw/xen/xen_common.h
> > > +++ b/include/hw/xen/xen_common.h
> > > @@ -25,6 +25,31 @@
> > >    */
> > > 
> > >   /* Xen 4.2 through 4.6 */
> > > +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 480
> > > +
> > > +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;
> > > +};
> > 
> > I don't think it's a good idee to define a struct that is not going to
> > be used, and does not belong here. The typedef is OK.
> 
> I added it since it is needed to know all the fields of that struct in
> ioreq_copy but if I could replace that function with stubs I will do that.
> 
> > 
> > In xen_disk.c, you could use "#if CONFIG_XEN_CTRL_INTERFACE_VERSION ..."
> > around free_buffers, ioreq_init_copy_buffers and ioreq_copy, and replace
> > them by stubs when Xen does not support grant copy. I think that would
> > be better.
> > 
> > Also, could you try to compile again xen unstable, without your other patch?
> > Right now, it does not compile.
> 
> That is true, I am sorry. I need to add the headers that are included in the
> #else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 471 */
> 
> #include <xenevtchn.h>
> #include <xengnttab.h>
> #include <xenforeignmemory.h>
> 
> #endif
> 
> May I move that part to separate #if CONFIG_XEN_CTRL_INTERFACE_VERSION >=
> 471 in that header?

You could could add your code at the end of xen_common.h instead of the
beginning, I think that would work. (At the end of xen_common.h,
xengnttab_handle should be define, either in the file or via an
include.)

> > 
> > > +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)
> > > +{
> > > +    return -1;
> > 
> > return -ENOSYS would be more appropriate.
> > 
> > 
> > Otherwise, the patch looks good.
> > 
> > Thanks,
> > 
> Thank you,
> 
> Paulina

-- 
Anthony PERARD

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

      parent reply	other threads:[~2016-08-10 10:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 14:06 [Qemu-devel] [PATCH v4 0/2] qemu-qdisk: Implementation of grant copy operation Paulina Szubarczyk
2016-08-02 14:06 ` Paulina Szubarczyk
2016-08-02 14:06 ` [Qemu-devel] [PATCH v4 1/2] Interface for grant copy operation in libs Paulina Szubarczyk
2016-08-02 14:06   ` Paulina Szubarczyk
2016-08-03 14:36   ` David Vrabel
2016-08-03 14:36   ` [Qemu-devel] [Xen-devel] " David Vrabel
2016-08-04  9:42     ` David Vrabel
2016-08-04  9:42     ` David Vrabel
2016-08-04  9:38   ` Wei Liu
2016-08-04  9:38   ` [Qemu-devel] " Wei Liu
2016-08-04 10:27     ` Paulina Szubarczyk
2016-08-04 10:27       ` Paulina Szubarczyk
2016-08-02 14:06 ` [Qemu-devel] [PATCH v4 2/2] qdisk - hw/block/xen_disk: grant copy implementation Paulina Szubarczyk
2016-08-02 14:06   ` Paulina Szubarczyk
2016-08-08 11:11   ` [Qemu-devel] " Roger Pau Monné
2016-08-08 11:11     ` Roger Pau Monné
2016-08-08 11:34     ` [Qemu-devel] " Paulina Szubarczyk
2016-08-08 11:34     ` Paulina Szubarczyk
2016-08-08 11:44   ` Paulina Szubarczyk
2016-08-08 11:44   ` [Qemu-devel] " Paulina Szubarczyk
2016-08-09 16:56   ` Anthony PERARD
2016-08-09 16:56     ` Anthony PERARD
2016-08-09 17:34     ` [Qemu-devel] " Paulina Szubarczyk
2016-08-09 17:34       ` Paulina Szubarczyk
2016-08-10 10:29       ` [Qemu-devel] " Anthony PERARD
2016-08-10 10:29       ` Anthony PERARD [this message]

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='20160810102947.GE1835__5712.72957972742$1470825059$gmane$org@perard.uk.xensource.com' \
    --to=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=wei.liu2@citrix.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.