[libvirt] [PATCH 2/2] fix compilation on systems missing libnl and new includes
Matthias Bolte
matthias.bolte at googlemail.com
Thu Jun 23 14:55:23 UTC 2011
2011/6/23 Stefan Berger <stefanb at linux.vnet.ibm.com>:
> This patch fixes the compilation of netlink.c and interface.c on those
> systems missing either libnl or that have an older linux/if_link.h
> include file not supporting macvtap or VF_PORTS.
>
> WITH_MACVTAP is '1' if newer include files were detected, '0' otherwise.
>
> IFLA_PORT_MAX is defined in linux/if_link.h if yet more functionality is
> supported.
>
> Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
You're sending this from a different Email address than your usual
one, which makes make syntax-check unhappy.
> Index: libvirt-acl/src/util/netlink.c
> ===================================================================
> --- libvirt-acl.orig/src/util/netlink.c
> +++ libvirt-acl/src/util/netlink.c
> @@ -55,7 +55,7 @@
> * Returns 0 on success, -1 on error. In case of error, no response
> * buffer will be returned.
> */
> -#if __linux__
> +#if defined(__linux__) && WITH_MACVTAP
You could use HAVE_LIBNL here instead of WITH_MACVTAP, I think.
> int nlComm(struct nl_msg *nl_msg,
> unsigned char **respbuf, unsigned int *respbuflen,
> int nl_pid)
> @@ -143,7 +143,11 @@ int nlComm(struct nl_msg *nl_msg ATTRIBU
> int nl_pid ATTRIBUTE_UNUSED)
> {
> netlinkError(VIR_ERR_INTERNAL_ERROR, "%s",
> +# if defined(__linux__) && !defined(HAVE_LIBNL)
> + _("nlComm is not supported since libnl was not available"));
> +# else
> _("nlComm is not supported on non-linux platforms"));
> +# endif
> return -1;
> }
This fixes the problem for me as it restores the original conditionals
from before the refactoring.
ACK to the series, feel free to pick what ever version of 1/2 you like.
--
Matthias Bolte
http://photron.blogspot.com
More information about the libvir-list
mailing list