[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] Re: [Qemu-devel] [PATCH V10 03/15] xen: Support new libxc calls from xen unstable.
On Fri, Feb 25, 2011 at 14:11, Anthony Liguori <anthony@xxxxxxxxxxxxx> wrote: >>> I think I gave this feedback before but I'd really like to see static >>> inlines here. >>> >>> It's very likely that you'll either want to have tracing or some commands >>> can have a NULL function pointer in which case having a central location >>> to >>> do this is very useful. >>> >>> Plus, it's more natural to read code that's making a function call >>> instead >>> of going through a function pointer in a structure redirection. >>> >>> Can probably do this with just a sed over the current patch. >>> >> >> Is it good to have a .h with functions like that? : >> >> static inline XenXC qemu_xc_interface_open(xentoollog_logger *logger, >> Â Â Â Â Â Â Â Â Â Â Â Â Â Â xentoollog_logger *dombuild_logger, >> Â Â Â Â Â Â Â Â Â Â Â Â Â Â unsigned open_flags) >> { >> #if CONFIG_XEN_CTRL_INTERFACE_VERSION< Â410 >> Â Â return xc_interface_open(); >> #else >> Â Â return xc_interface_open(logger, dombuild_logger, open_flags); >> #endif >> } >> >> >> So there will have no more structure redirection. >> > > It would be better to have two versions of the header, one that implemented > the < 410 functions and one that implemented the newer functions. > > If you're just using the new signature for everything, you could even just > #define in the later header. Actually, the #define in the later header was done in a previous version of this patch series. But I change to the structure redirection after a comment of Alexander Graf and by taking one of his patches for Xenner. Here is the comment of Alexander: http://lists.nongnu.org/archive/html/qemu-devel/2010-11/msg01251.html The function pointers help switch at run time to either Xen or Xenner implementation. This message is why I did not use static inline. http://lists.nongnu.org/archive/html/qemu-devel/2011-01/msg03125.html So, I can go for multiple version of the header that defines the static inlines functions, or just have a few define. BTW, I think there are now only 4 functions with a different prototype between old and new version of Xen. Other prototype change are only the "handler" parameter, but a typedef handle it. Regards, -- Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |