Received: from eggs.gnu.org ([2001:4830:134:3::10]:35598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXQls-0002Id-3q for qemu-devel@nongnu.org; Wed, 10 Aug 2016 06:30:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXQlm-0002wd-4f for qemu-devel@nongnu.org; Wed, 10 Aug 2016 06:29:59 -0400 Received: from smtp.citrix.com ([66.165.176.89]:44710) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXQlm-0002to-0C for qemu-devel@nongnu.org; Wed, 10 Aug 2016 06:29:54 -0400 Date: Wed, 10 Aug 2016 11:29:47 +0100 From: Anthony PERARD Message-ID: <20160810102947.GE1835@perard.uk.xensource.com> References: <1470146790-6168-1-git-send-email-paulinaszubarczyk@gmail.com> <1470146790-6168-3-git-send-email-paulinaszubarczyk@gmail.com> <20160809165602.GD1835@perard.uk.xensource.com> <57AA1416.6020307@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <57AA1416.6020307@gmail.com> Subject: Re: [Qemu-devel] [PATCH v4 2/2] qdisk - hw/block/xen_disk: grant copy implementation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paulina Szubarczyk Cc: xen-devel@lists.xenproject.org, roger.pau@citrix.com, wei.liu2@citrix.com, ian.jackson@eu.citrix.com, david.vrabel@citrix.com, sstabellini@kernel.org, qemu-devel@nongnu.org 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 > #include > #include > > #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