[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.


  • To: Anthony Liguori <anthony@xxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Fri, 25 Feb 2011 16:01:47 +0000
  • Cc: Alexander Graf <agraf@xxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, QEMU-devel <qemu-devel@xxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 25 Feb 2011 08:03:20 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=pURXaof6ekPD44JWcfIDfOf8w5350DEleV/UAHL2Kyqxj0zei19O8c+axK/kG3E4OF Gopt3QwI+DFDZwWjejkQF5YK4hMfYnCaeHuuD74oLrx7AQDhZ79zT05Vez005C5B8cq/ ETKkOgiSDl9PCkNZZcr+pRRFS0BmMQ2Z/K5CE=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.