[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1 of 5] remus: add libnl3 dependency to autoconf scripts



On 26/08/2013 00:45, rshriram@xxxxxxxxx wrote:
> # HG changeset patch
> # User Shriram Rajagopalan <rshriram@xxxxxxxxx>
> # Date 1377473602 25200
> # Node ID 0ae8b121b67b3cb3a6b00f2cc97e98fec5758e20
> # Parent  40b079bd57dea24c3b000f233ed123763483a4d5
> remus: add libnl3 dependency to autoconf scripts
>
> Libnl3 is required for controlling Remus network buffering.
> This patch adds dependency on libnl3 (>= 3.2.8) to autoconf scripts.
> Also provide ability to configure tools without libnl3 support, that
> is without network buffering support.
>
> Signed-off-by: Shriram Rajagopalan <rshriram@xxxxxxxxx>

As identified in the patch 0, libnl3 is not present for CentOS (so by
implication RHEL and derivatives) and various BSDs, so enabling it by
default and erroring out of autoconf if it cant be found is not really
acceptable imo.

It would be better to detect the presence/absence of an appropriate
libnl3, and use that as the default.  Then, the logic would be: "By
default build in libnl3 support if it is available, but don't if it is
not.  If the user explicitlicy configures --with-remusnetbuf and libnl3
is not present, present an error" which is far more appropriate for an
option which affects a large swathe of distributions.

~Andrew

>
> diff -r 40b079bd57de -r 0ae8b121b67b config/Tools.mk.in
> --- a/config/Tools.mk.in      Sun Aug 25 14:39:36 2013 -0700
> +++ b/config/Tools.mk.in      Sun Aug 25 16:33:22 2013 -0700
> @@ -35,6 +35,7 @@ PTHREAD_LDFLAGS     := @PTHREAD_LDFLAGS@
>  PTHREAD_LIBS        := @PTHREAD_LIBS@
>  
>  PTYFUNCS_LIBS       := @PTYFUNCS_LIBS@
> +LIBNL3_LIBS         := @LIBNL3_LIBS@
>  
>  # Download GIT repositories via HTTP or GIT's own protocol?
>  # GIT's protocol is faster and more robust, when it works at all (firewalls
> @@ -54,6 +55,7 @@ CONFIG_QEMU_TRAD    := @qemu_traditional
>  CONFIG_QEMU_XEN     := @qemu_xen@
>  CONFIG_XEND         := @xend@
>  CONFIG_BLKTAP1      := @blktap1@
> +CONFIG_REMUS_NETBUF := @remusnetbuf@
>  
>  #System options
>  ZLIB                := @zlib@
> diff -r 40b079bd57de -r 0ae8b121b67b tools/configure.ac
> --- a/tools/configure.ac      Sun Aug 25 14:39:36 2013 -0700
> +++ b/tools/configure.ac      Sun Aug 25 16:33:22 2013 -0700
> @@ -56,6 +56,8 @@ AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disa
>  AX_ARG_DEFAULT_DISABLE([ovmf], [Enable OVMF])
>  AX_ARG_DEFAULT_ENABLE([rombios], [Disable ROM BIOS])
>  AX_ARG_DEFAULT_ENABLE([seabios], [Disable SeaBIOS])
> +AX_ARG_DEFAULT_ENABLE([remusnetbuf], [ Enable/Disable Remus 
> +                                  network buffering support (requires 
> libnl3)])
>  AX_ARG_DEFAULT_ENABLE([debug], [Disable debug build of tools])
>  AX_ARG_DEFAULT_ENABLE([xend], [Disable xend toolstack])
>  AX_ARG_DEFAULT_DISABLE([blktap1], [Disable blktap1 tools])
> @@ -208,4 +210,29 @@ AC_SUBST(libiconv)
>  # Checks for header files.
>  AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h])
>  
> +AS_IF([test "x$remusnetbuf" = "xy"], [
> +
> +dnl Need libnl version 3.2.8 or higher for plug qdisc support
> +  AS_IF(
> +       [ pkg-config --exists 'libnl-3.0 >= 3.2.8 libnl-route-3.0 >= 3.2.8 
> libnl-cli-3.0 >= 3.2.8' ],
> +       [], [
> +           AC_MSG_ERROR([Need libnl3, libnl-route-3 and libnl-cli-3 (>= 
> 3.2.8) for Remus network buffering])
> +       ])
> +
> +  AC_CHECK_HEADER([netlink/route/qdisc/plug.h], [
> +        AC_CHECK_LIB(nl-3, nl_socket_alloc, [
> +             AC_CHECK_LIB(nl-route-3, rtnl_qdisc_alloc, [
> +                     LIBNL3_LIBS="-lnl-3 -lnl-route-3"
> +                     AC_SUBST(LIBNL3_LIBS)
> +             ], [
> +                AC_MSG_ERROR([Could not find libnl-route-3])
> +             ])
> +        ], [
> +           AC_MSG_ERROR([Could not find libnl3])
> +        ])
> +     ], [
> +        AC_MSG_ERROR([Could not find libnl3 dev headers (esp. plug.h)])
> +     ])
> +], [])
> +
>  AC_OUTPUT()
> diff -r 40b079bd57de -r 0ae8b121b67b tools/libxl/Makefile
> --- a/tools/libxl/Makefile    Sun Aug 25 14:39:36 2013 -0700
> +++ b/tools/libxl/Makefile    Sun Aug 25 16:33:22 2013 -0700
> @@ -20,7 +20,7 @@ LIBUUID_LIBS += -luuid
>  endif
>  
>  LIBXL_LIBS =
> -LIBXL_LIBS = $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) 
> $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS)
> +LIBXL_LIBS = $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) 
> $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS) 
> $(LIBNL3_LIBS)
>  
>  CFLAGS_LIBXL += $(CFLAGS_libxenctrl)
>  CFLAGS_LIBXL += $(CFLAGS_libxenguest)
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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