[libvirt] Magic error introduced by commit f09accc

Eric Blake eblake at redhat.com
Fri May 6 22:33:13 UTC 2011


On 05/06/2011 01:18 PM, Jiri Denemark wrote:
>>> I must admit I don't understand why including stdarg.h (which seems to be the
>>> only change visible in macvtap.c) results in this warning.
>>>
>>> Does anyone have an idea?
>>
>> Which version of libnl and gcc?
> 
> libnl-1.1, gcc-4.4.5
> 
> You are right, that the commit results in -std=gnu99 being added to gcc
> command line. However, the nl_object_priv is declared as
> 
> extern inline void *            nl_object_priv(struct nl_object *);
> 
> So not 'static inline' but 'extern inline', I guess the issue is the same,
> right?

We discussed more on IRC.  The problem is due to a bug in out-of-the-box
libnl headers, and has been patched in most distros to just delete the
'inline' as then you don't have to worry about whether you had old or
new gcc semantics for 'extern inline'.  That is, libvirt could probably
work around the issue by doing:

#define inline
#include <netlink/msg.h>
#undef inline

in src/util/macvtap.c.

However, I don't know if we should do that.  In one regards, the only
people that ever run into this are those that are using incompatible
self-built gcc and libnl (Jirka was testing on a gentoo system), and
we're doing the user a favor to have them patch their libnl headers
rather than making libvirt work around it.  Most distros (including RHEL
5, which stands as the current litmus test of how much workarounds we
have to support in libvirt) have already patched the header, or have an
old enough gcc that the problem doesn't hit in the first place.  And
someday, we should be moving on to newer libnl.

So unless anyone else speaks up, I won't bother writing a patch for
libvirt to work around the libnl bug.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110506/96508c8f/attachment-0001.sig>


More information about the libvir-list mailing list