[libvirt] [PATCH] Rework configure logic for virtualport support

Eric Blake eblake at redhat.com
Tue Sep 28 17:52:07 UTC 2010


On 09/28/2010 11:01 AM, Stefan Berger wrote:
> In this patch I am reworking the logic around detecting virtual port
> support and requiring the libnl dependency.
>
> - It requires --with-macvtap and displays an error in case of
> --without-macvtap --with-virtualport.
> - It tests for availability of certain data in include files and
> displays an error in case the include file is not at the correct level
> and --with-virtualport was chosen
> - displays 'checking' messages for macvtap and virtualport support and
> results
> - libnl support is required when macvtap is found or requested; if libnl
> is not there, please supply without-macvtap
>
> Signed-off-by: Stefan Berger <stefanb at us.ibm.com>
>
>
> diff --git a/configure.ac b/configure.ac
> index 6100610..d94b510 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2058,6 +2058,7 @@ AC_ARG_WITH([macvtap],
> [with_macvtap=${withval}],
> [with_macvtap=check])
>
> +AC_MSG_CHECKING([whether to compile with macvtap support])
> if test "$with_macvtap" != "no" ; then
> AC_TRY_COMPILE([ #include <sys/socket.h>
> #include <linux/rtnetlink.h> ],
> @@ -2075,19 +2076,31 @@ if test "$with_macvtap" != "no" ; then
> AC_DEFINE_UNQUOTED([WITH_MACVTAP], $val, [whether macvtap support is
> enabled])
> fi
> AM_CONDITIONAL([WITH_MACVTAP], [test "$with_macvtap" = "yes"])
> +AC_MSG_RESULT([$with_macvtap])

This part's nice.

>
> -AC_TRY_COMPILE([ #include <sys/socket.h>
> - #include <linux/rtnetlink.h> ],
> - [ int x = IFLA_PORT_MAX; ],
> - [ with_virtualport=yes ],
> - [ with_virtualport=no ])
> -if test "$with_virtualport" = "yes"; then
> - val=1
> -else
> - val=0
> +val=0
> +if test "$with_virtualport" != "no"; then

Hmm - here you use $with_virtualport without adding an 
AC_ARG_WITH([virtualport]), which means the user doesn't have an easy 
way to set this variable via ./configure --with-virtualport.

I think we need a v2 that adds the AC_ARG_WITH.

>
> -if test "$with_macvtap" = "yes" || test "$with_virtualport" = "yes"; then
> +if test "$with_macvtap" = "yes"; then
> PKG_CHECK_MODULES([LIBNL], [libnl-1 >= $LIBNL_REQUIRED], [

So virtualport doesn't require libnl.  The rest of your logic looks 
okay, once we get the AC_ARG_WITH sorted out.

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




More information about the libvir-list mailing list