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

Re: [Xen-devel] Re: [Qemu-devel] [PATCH V10 03/15] xen: Support new libx

To: Anthony Liguori <anthony@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [Qemu-devel] [PATCH V10 03/15] xen: Support new libxc calls from xen unstable.
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:from :date:x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=z0R3kkUw9gXFIF3f6En6AhKCl+vL6txpBr6stk60xC8=; b=b2SMza+77iJik/ytxCi/HmlojzQkfXL1Un1bB/AB5CpSgXU4U6gvBV0YLiFPvozyYG e6mEqffWHBysiclKE3qEL6rEceyVMyejRyzVD/WVyDwN7ptVhxsWf1foQkkXkwBR9UBF m1muxE7dYHKxXf/+EHC/rScvEEliPWJhhJ5Y0=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D67B87F.4020108@xxxxxxxxxxxxx>
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: <1296658172-16609-1-git-send-email-anthony.perard@xxxxxxxxxx> <1296658172-16609-4-git-send-email-anthony.perard@xxxxxxxxxx> <4D669572.2010606@xxxxxxxxxxxxx> <AANLkTinwodD_K30UXEUvb-54q7QxUUqLCHHTX9Rtyghx@xxxxxxxxxxxxxx> <4D67B87F.4020108@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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>