[libvirt] Compilation Errors

I'm trying to compile libvirt 0.6.0 on Gentoo, but keep encountering the following error: network_driver.c:72: error: expected specifier-qualifier-list before 'brControl' network_driver.c: In function 'networkFindActiveConfigs': <snip - just a bunch of 'struct network_driver' has no member named * > network_driver.c:1382: error: 'struct network_driver' has no member named 'networkConfigDir' network_driver.c:1384: error: 'struct network_driver' has no member named 'networkAutostartDir' network_driver.c:1390: error: 'struct network_driver' has no member named 'networkAutostartDir' network_driver.c:1391: error: 'struct network_driver' has no member named 'networkAutostartDir' make[3]: *** [network_driver.lo] Error 1 make[3]: Leaving directory `/home/russell/libvirt/libvirt-0.6.0/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/russell/libvirt/libvirt-0.6.0/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/russell/libvirt/libvirt-0.6.0' make: *** [all] Error 2 Every error following the first one refers to networkConfigDir, networkAutostartDir, or logDir, all listed after brControl in the definition of network_driver. What looks to me like the same error has been reported against 0.5.1 here (I haven't tried it myself): http://bugs.gentoo.org/show_bug.cgi?id=254568 My configuration options: ./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --with-avahi --without-storage-iscsi --without-storage-lvm --without-lxc --with-hal --without-openvz --without-storage-disk --without-sasl --without-selinux --without-uml --without-xen --without-qemu --without-devkit --without-polkit --with-remote --disable-iptables-lokkit --localstatedir=/var --with-remote-pid-file=/var/run/libvirtd.pid --build=i686-pc-linux-gnu If other info would help resolve this I'd be happy to try and provide it. Thanks, -- Russell Haering System Administrator OSU Open Source Lab

Russell <russellhaering@gmail.com> wrote:
I'm trying to compile libvirt 0.6.0 on Gentoo, but keep encountering the following error:
network_driver.c:72: error: expected specifier-qualifier-list before 'brControl' ... make: *** [all] Error 2
Every error following the first one refers to networkConfigDir, networkAutostartDir, or logDir, all listed after brControl in the definition of network_driver.
What looks to me like the same error has been reported against 0.5.1 here (I haven't tried it myself): http://bugs.gentoo.org/show_bug.cgi?id=254568
My configuration options: ./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --with-avahi --without-storage-iscsi --without-storage-lvm --without-lxc --with-hal --without-openvz --without-storage-disk --without-sasl --without-selinux --without-uml --without-xen --without-qemu --without-devkit --without-polkit --with-remote --disable-iptables-lokkit --localstatedir=/var --with-remote-pid-file=/var/run/libvirtd.pid --build=i686-pc-linux-gnu
If other info would help resolve this I'd be happy to try and provide it.
You're compiling with neither LXC nor QEMU, and that turns off WITH_BRIDGE, yet parts of network_driver.c assume bridge-related functions are defined. If really you want neither LXC nor QEMU, then maybe you also want --without-network? I've confirmed that when configured with that additional option it does build. If being able to build --without-lxc --without-qemu --with-network is important, (even if just to forestall bug reports like this one ;-) then we'll make it work.

On Mon, Feb 16, 2009 at 11:24:19AM +0100, Jim Meyering wrote:
Russell <russellhaering@gmail.com> wrote:
I'm trying to compile libvirt 0.6.0 on Gentoo, but keep encountering the following error:
network_driver.c:72: error: expected specifier-qualifier-list before 'brControl' ... make: *** [all] Error 2
Every error following the first one refers to networkConfigDir, networkAutostartDir, or logDir, all listed after brControl in the definition of network_driver.
What looks to me like the same error has been reported against 0.5.1 here (I haven't tried it myself): http://bugs.gentoo.org/show_bug.cgi?id=254568
My configuration options: ./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --with-avahi --without-storage-iscsi --without-storage-lvm --without-lxc --with-hal --without-openvz --without-storage-disk --without-sasl --without-selinux --without-uml --without-xen --without-qemu --without-devkit --without-polkit --with-remote --disable-iptables-lokkit --localstatedir=/var --with-remote-pid-file=/var/run/libvirtd.pid --build=i686-pc-linux-gnu
If other info would help resolve this I'd be happy to try and provide it.
You're compiling with neither LXC nor QEMU, and that turns off WITH_BRIDGE, yet parts of network_driver.c assume bridge-related functions are defined.
If really you want neither LXC nor QEMU, then maybe you also want --without-network?
I've confirmed that when configured with that additional option it does build.
If being able to build --without-lxc --without-qemu --with-network is important, (even if just to forestall bug reports like this one ;-) then we'll make it work.
Yes, we need to make that work. The 'network' driver should be usable by any of the hypervisor drivers. So we'll need to make WITH_BRIDGE conditional also turned on when network is enabled. Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

"Daniel P. Berrange" <berrange@redhat.com> wrote:
If being able to build --without-lxc --without-qemu --with-network is important, (even if just to forestall bug reports like this one ;-) then we'll make it work.
Yes, we need to make that work. The 'network' driver should be usable by any of the hypervisor drivers. So we'll need to make WITH_BRIDGE conditional also turned on when network is enabled.
Here's the patch:
From edcfccd47c6abb6c2c94ae89c8d6260383423434 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Mon, 16 Feb 2009 11:53:14 +0100 Subject: [PATCH] accommodate configuring --without-lxc --without-qemu
* configure.in: Enable internal WITH_BRIDGE support not just for LXC or QEMU, but also for --with-network. Russell Haering reported that compilation failed when configured with --without-lxc --without-qemu. Details: http://thread.gmane.org/gmane.comp.emulators.libvirt/11928 * src/bridge.h: Use #if WITH_BRIDGE, rather than currently-equivalent "#if defined(WITH_QEMU) || defined(WITH_LXC)" --- configure.in | 13 ++++++------- src/bridge.h | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index 6e04d56..72a64dd 100644 --- a/configure.in +++ b/configure.in @@ -287,13 +287,6 @@ if test "$with_qemu" = "yes" ; then fi AM_CONDITIONAL([WITH_QEMU], [test "$with_qemu" = "yes"]) -with_bridge=no -if test "$with_qemu" = "yes" -o "$with_lxc" = "yes"; then - with_bridge=yes - AC_DEFINE_UNQUOTED([WITH_BRIDGE], 1, [whether bridge code is needed]) -fi -AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"]) - if test "$with_uml" = "yes" ; then AC_DEFINE_UNQUOTED([WITH_UML], 1, [whether UML driver is enabled]) fi @@ -729,6 +722,12 @@ if test "$with_network" = "yes" ; then fi AM_CONDITIONAL([WITH_NETWORK], [test "$with_network" = "yes"]) +with_bridge=no +if test "$with_qemu:$with_lxc:$with_network" != "no:no:no"; then + with_bridge=yes + AC_DEFINE_UNQUOTED([WITH_BRIDGE], 1, [whether bridge code is needed]) +fi +AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"]) dnl dnl Storage driver checks diff --git a/src/bridge.h b/src/bridge.h index 2491123..f37ab72 100644 --- a/src/bridge.h +++ b/src/bridge.h @@ -24,7 +24,7 @@ #include <config.h> -#if defined(WITH_QEMU) || defined(WITH_LXC) +#if defined(WITH_BRIDGE) #include <net/if.h> #include <netinet/in.h> @@ -101,6 +101,6 @@ int brGetEnableSTP (brControl *ctl, const char *bridge, int *enable); -#endif /* WITH_QEMU || WITH_LXC */ +#endif /* WITH_BRIDGE */ #endif /* __QEMUD_BRIDGE_H__ */ -- 1.6.2.rc0.264.g60787

Jim Meyering <jim@meyering.net> wrote:
If being able to build --without-lxc --without-qemu --with-network is important, (even if just to forestall bug reports like this one ;-) then we'll make it work.
If it's worth building, then it's worth making "make check" pass, too. And without the following, the daemon-conf test would fail with many diagnostics like this: testing with corrupted config: listen_addr testing with corrupted config: mdns_adv --- expected-err 2009-02-16 11:57:10.000000000 +0100 +++ err 2009-02-16 11:57:10.000000000 +0100 @@ -1,2 +1,2 @@ -remoteReadConfigFile: in6.conf: mdns_adv: invalid type: got string; expected long +remoteReadConfigFile: in6.conf: auth_tcp: unsupported auth sasl Here's the patch:
From 4ea57562ab66302d593c1877cbdf67b9251feb52 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Mon, 16 Feb 2009 12:11:04 +0100 Subject: [PATCH] don't fail daemon-conf test when configured --without-qemu
* tests/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER. * tests/daemon-conf: Use test-lib.sh. Skip this test when configured --without-qemu. --- tests/Makefile.am | 1 + tests/daemon-conf | 16 ++++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index e467a86..877884f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -120,6 +120,7 @@ TESTS_ENVIRONMENT = \ abs_top_srcdir=`cd '$(top_srcdir)'; pwd` \ abs_builddir=`cd '$(builddir)'; pwd` \ abs_srcdir=`cd '$(srcdir)'; pwd` \ + CONFIG_HEADER='$(abs_top_builddir)/lib/config.h' \ PATH="$(path_add)$(PATH_SEPARATOR)$$PATH" \ SHELL="$(SHELL)" \ LIBVIRT_DRIVER_DIR="$(abs_top_builddir)/src/.libs" \ diff --git a/tests/daemon-conf b/tests/daemon-conf index b357c39..7a53eff 100755 --- a/tests/daemon-conf +++ b/tests/daemon-conf @@ -6,16 +6,12 @@ if test "$VERBOSE" = yes; then libvirtd --version fi -# Boilerplate code to set up a test directory, cd into it, -# and to ensure we remove it upon completion. -this_test_() { echo "./$0" | sed 's,.*/,,'; } -t_=$(this_test_)-$$ -init_cwd_=$(pwd) -trap 'st=$?; d='"$t_"'; - cd '"$init_cwd_"' && chmod -R u+rwx "$d" && rm -rf "$d" && exit $st' 0 -trap '(exit $?); exit $?' 1 2 13 15 -mkdir "$t_" || fail=1 -cd "$t_" || fail=1 +test -z "$srcdir" && srcdir=$(pwd) +test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/.. +. $srcdir/test-lib.sh + +grep '^#define WITH_QEMU 1' $CONFIG_HEADER > /dev/null || + skip_test_ "configured without QEMU support" conf="$abs_top_srcdir/qemud/libvirtd.conf" -- 1.6.2.rc0.264.g60787
participants (3)
-
Daniel P. Berrange
-
Jim Meyering
-
Russell