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

V2: - added missing AC_ARG_WITH() for --with-virtualport 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@us.ibm.com> diff --git a/configure.ac b/configure.ac index 6100610..da38b8b 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,35 @@ 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]) -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 +AC_ARG_WITH([virtualport], + AC_HELP_STRING([--with-virtualport],[enable virtual port support @<:@default=check@:>@]), + [with_virtualport=${withval}], + [with_virtualport=check]) + +if test "$with_virtualport" != "no"; then + if test "$with_macvtap" = "no"; then + AC_MSG_ERROR([--with-virtualport requires --with-macvtap]) + fi + AC_MSG_CHECKING([whether to compile with virtual port support]) + AC_TRY_COMPILE([ #include <sys/socket.h> + #include <linux/rtnetlink.h> ], + [ int x = IFLA_PORT_MAX; ], + [ with_virtualport=yes ], + [ if test "$with_virtualport" = "yes" ; then + AC_MSG_ERROR([Installed linux headers don't show support for virtual port support.]) + fi + with_virtualport=no ]) + if test "$with_virtualport" = "yes"; then + val=1 + else + val=0 + fi + AC_DEFINE_UNQUOTED([WITH_VIRTUALPORT], $val, + [whether vsi vepa support is enabled]) + AC_MSG_RESULT([$with_virtualport]) fi -AC_DEFINE_UNQUOTED([WITH_VIRTUALPORT], $val, - [whether vsi vepa support is enabled]) AM_CONDITIONAL([WITH_VIRTUALPORT], [test "$with_virtualport" = "yes"]) @@ -2096,7 +2113,7 @@ dnl netlink library LIBNL_CFLAGS="" LIBNL_LIBS="" -if test "$with_macvtap" = "yes" || test "$with_virtualport" = "yes"; then +if test "$with_macvtap" = "yes"; then PKG_CHECK_MODULES([LIBNL], [libnl-1 >= $LIBNL_REQUIRED], [ ], [ AC_MSG_ERROR([libnl >= $LIBNL_REQUIRED is required for macvtap support])

On 09/28/2010 12:31 PM, Stefan Berger wrote:
V2: - added missing AC_ARG_WITH() for --with-virtualport
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@us.ibm.com>
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 09/28/2010 03:14 PM, Eric Blake wrote:
On 09/28/2010 12:31 PM, Stefan Berger wrote:
V2: - added missing AC_ARG_WITH() for --with-virtualport
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@us.ibm.com>
ACK.
Pushed. Stefan

On 09/29/2010 09:58 PM, Stefan Berger wrote: <snip>
ACK.
Pushed.
Ouch, that appears to have j Ouch, this just broke the ./configure script on Mac OS X: ***************** checking for iconv... yes checking how to link with libiconv... -liconv checking for GNU gettext in libintl... yes checking whether to use NLS... yes checking where the gettext function comes from... external libintl checking how to link with libintl... -lintl checking for HAL... no checking for UDEV... no checking whether to compile with macvtap support... no configure: error: --with-virtualport requires --with-macvtap $ ***************** That's with using only this configure line: ./configure --without-network --without-storage-fs Backing out your patch manually, allows the configure to complete. Do you want to look into it, or do you want me to? Regards and best wishes, Justin Clift

On 09/29/2010 10:44 PM, Justin Clift wrote:
On 09/29/2010 09:58 PM, Stefan Berger wrote: <snip>
ACK.
Pushed.
Ouch, that appears to have j
Ouch, this just broke the ./configure script on Mac OS X:
*****************
checking for iconv... yes checking how to link with libiconv... -liconv checking for GNU gettext in libintl... yes checking whether to use NLS... yes checking where the gettext function comes from... external libintl checking how to link with libintl... -lintl checking for HAL... no checking for UDEV... no checking whether to compile with macvtap support... no configure: error: --with-virtualport requires --with-macvtap $
*****************
Turns out this isn't an OS X problem. :( Just tested on a "known good" Linux box (Fedora 13), and this triggers it: ./configure --without-macvtap ... checking for UDEV... yes checking for PCIACCESS... yes checking whether to compile with macvtap support... no configure: error: --with-virtualport requires --with-macvtap $ Looks like a logic flaw in the patch fragment here: if test "$with_virtualport" != "no"; then if test "$with_macvtap" = "no"; then AC_MSG_ERROR([--with-virtualport requires --with-macvtap]) fi With the default value of "check" for $with_virtualport, anything that causes $with_macvtap to equal "no" causes this abort. Created a patch to fix the problem and also let the "check" approach still work. It'll be the message following this (in this thread). :) Regards and best wishes, Justin Clift

This fixes a small logic bug, where passing --without-macvtap on the configure line, or otherwise indicating a lack of support for macvtap, causes configure to bail. --- configure.ac | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index 8dcd756..f9b0d0f 100644 --- a/configure.ac +++ b/configure.ac @@ -2083,10 +2083,21 @@ AC_ARG_WITH([virtualport], [with_virtualport=${withval}], [with_virtualport=check]) -if test "$with_virtualport" != "no"; then +dnl Warn the user and error out if they requested virtualport support with configure +dnl options, but the required macvtap support isn't available + +if test "$with_virtualport" = "yes"; then if test "$with_macvtap" = "no"; then AC_MSG_ERROR([--with-virtualport requires --with-macvtap]) fi +fi + +dnl virtualport checks + +if test "$with_macvtap" != "yes"; then + with_virtualport=no +fi +if test "$with_virtualport" != "no"; then AC_MSG_CHECKING([whether to compile with virtual port support]) AC_TRY_COMPILE([ #include <sys/socket.h> #include <linux/rtnetlink.h> ], -- 1.7.2.3

On 09/29/2010 08:22 AM, Justin Clift wrote:
This fixes a small logic bug, where passing --without-macvtap on the configure line, or otherwise indicating a lack of support for macvtap, causes configure to bail. --- configure.ac | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)
ACK, and the dnl comments help. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 09/30/2010 12:38 AM, Eric Blake wrote:
On 09/29/2010 08:22 AM, Justin Clift wrote:
This fixes a small logic bug, where passing --without-macvtap on the configure line, or otherwise indicating a lack of support for macvtap, causes configure to bail. --- configure.ac | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)
ACK, and the dnl comments help.
Thanks, pushed. :)

This fixes a small logic bug, where passing --without-macvtap on the configure line, or otherwise indicating a lack of support for macvtap, causes configure to bail. --- configure.ac | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac index 8dcd756..f9b0d0f 100644 --- a/configure.ac +++ b/configure.ac @@ -2083,10 +2083,21 @@ AC_ARG_WITH([virtualport], [with_virtualport=${withval}], [with_virtualport=check])
-if test "$with_virtualport" != "no"; then +dnl Warn the user and error out if they requested virtualport support with configure +dnl options, but the required macvtap support isn't available + +if test "$with_virtualport" = "yes"; then if test "$with_macvtap" = "no"; then AC_MSG_ERROR([--with-virtualport requires --with-macvtap]) fi +fi + +dnl virtualport checks + +if test "$with_macvtap" != "yes"; then + with_virtualport=no +fi +if test "$with_virtualport" != "no"; then AC_MSG_CHECKING([whether to compile with virtual port support]) AC_TRY_COMPILE([ #include<sys/socket.h> #include<linux/rtnetlink.h> ], Thanks. I saw the configure failure you posted, started working on a
On 09/29/2010 10:22 AM, Justin Clift wrote: patch and then got busy doing something else... Stefan
participants (3)
-
Eric Blake
-
Justin Clift
-
Stefan Berger