WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [Qemu-devel] [PATCH V6 02/15] xen: Support new libxc cal

To: Alexander Graf <agraf@xxxxxxx>
Subject: [Xen-devel] Re: [Qemu-devel] [PATCH V6 02/15] xen: Support new libxc calls from xen unstable.
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Mon, 15 Nov 2010 13:57:22 +0000
Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, QEMU-devel <qemu-devel@xxxxxxxxxx>, Stefano
Delivery-date: Mon, 15 Nov 2010 06:13:49 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <B23F6815-FDC5-4756-856C-ABC07ADE9D6A@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1287682587-18642-1-git-send-email-anthony.perard@xxxxxxxxxx> <1287682587-18642-3-git-send-email-anthony.perard@xxxxxxxxxx> <B23F6815-FDC5-4756-856C-ABC07ADE9D6A@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Mon, 15 Nov 2010, Alexander Graf wrote:
> > /*
> > - * tweaks needed to build with different xen versions
> > - *  0x00030205 -> 3.1.0
> > - *  0x00030207 -> 3.2.0
> > - *  0x00030208 -> unstable
> > + * We don't support Xen prior to 3.3.0.
> >  */
> > -#include <xen/xen-compat.h>
> > -#if __XEN_LATEST_INTERFACE_VERSION__ < 0x00030205
> > -# define evtchn_port_or_error_t int
> > -#endif
> > -#if __XEN_LATEST_INTERFACE_VERSION__ < 0x00030207
> > -# define xc_map_foreign_pages xc_map_foreign_batch
> > -#endif
> > -#if __XEN_LATEST_INTERFACE_VERSION__ < 0x00030208
> > -# define xen_mb()  mb()
> > -# define xen_rmb() rmb()
> > -# define xen_wmb() wmb()
> > +
> > +/* Xen unstable */
> > +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 410
> > +typedef int qemu_xc_interface;
> > +#  define XC_HANDLER_INITIAL_VALUE               -1
> > +#  define xc_fd(xen_xc)                          xen_xc
> > +#  define xc_interface_open(l, dl, f)            xc_interface_open()
> > +#  define xc_gnttab_open(xc)                     xc_gnttab_open()
> > +#  define xc_gnttab_map_grant_ref(xc, gnt, domid, ref, flags) \
> > +    xc_gnttab_map_grant_ref(gnt, domid, ref, flags)
> > +#  define xc_gnttab_map_grant_refs(xc, gnt, count, domids, refs, flags) \
> > +    xc_gnttab_map_grant_refs(gnt, count, domids, refs, flags)
> > +#  define xc_gnttab_munmap(xc, gnt, pages, niov) xc_gnttab_munmap(gnt, 
> > pages, niov)
> > +#  define xc_gnttab_close(xc, dev)               xc_gnttab_close(dev)
> 
> All these defines are very icky. In my patchset I replace all those libxc 
> calls by indirect calls through a struct anyways. Maybe it'd make sense to 
> integrate that part into your series already.
> 
> That way you could make this whole compat stuff a lot cleaner. You could use 
> static inline functions to create wrappers to the real calls and just assign 
> those as callbacks in the dispatch struct.
> 
> In general, I'd disagree to the preprocessor approach here. If you're not 
> going with the libxc dispatch struct patch, I'd at least like to see all 
> those converted to static inline functions called with different names 
> internally.
> 
 
Yeah, I am not a fan of preprocessor magic as well, it is probably worth
investigating the indirect calls approach, surely would be easier to
read.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>