xen-devel
Re: [Xen-devel] Re: [Qemu-devel] [PATCH V10 03/15] xen: Support new libx
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
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] Re: [Qemu-devel] [PATCH V10 06/15] xen: Add the Xen platform pci device, (continued)
[Xen-devel] [PATCH V10 08/15] xen: Introduce Xen Interrupt Controller, anthony . perard
[Xen-devel] [PATCH V10 10/15] configure: Always use 64bits target physical addresses with xen enabled., anthony . perard
[Xen-devel] [PATCH V10 03/15] xen: Support new libxc calls from xen unstable., anthony . perard
[Xen-devel] [PATCH V10 11/15] Introduce qemu_put_ram_ptr, anthony . perard
[Xen-devel] [PATCH V10 12/15] vl.c: Introduce getter for shutdown_requested and reset_requested., anthony . perard
[Xen-devel] [PATCH V10 01/15] xen: Replace some tab-indents with spaces (clean-up)., anthony . perard
[Xen-devel] [PATCH V10 13/15] xen: Initialize event channels and io rings, anthony . perard
[Xen-devel] [PATCH V10 14/15] xen: Set running state in xenstore., anthony . perard
[Xen-devel] [PATCH V10 09/15] xen: Introduce the Xen mapcache, anthony . perard
[Xen-devel] [PATCH V10 15/15] xen: Add Xen hypercall for sleep state in the cmos_s3 callback., anthony . perard
[Xen-devel] Re: [Qemu-devel] [PATCH V10 00/15] Xen device model support, Anthony Liguori
|
|
|