[libvirt] [PATCH] desactivate lxc and qemu support on non-linux systems

On Mon, Apr 26, 2010 at 12:09:19PM +0200, Daniel Veillard wrote:
On Mon, Apr 26, 2010 at 01:40:11AM -0600, gary mazzaferro wrote:
Hi,
I'm revisiting my libVirt install for opensolaris. I downloaded libvirt 0.8.0..
This is a bit embarassing, but I forgot how to build libVirt on opensolaris. (It's been a while) I'm currently stuck with the configure script failing to find linux kernel headers. Error: "configure: error: You must install kernel-headers in order to compile libvirt"
Can anyone post the instructions to build under opensolaris?
Well you need to desactivate qemu and lxc builds to avoid this error:
./configure --without-lxc --without-qemu ...
that should be done automatically on non-linux systems, it's a bug,
Very small patch to this intent. The requirement is imposed by the following test later on in configure.ac: ----------------------------------------------- dnl dnl check for kernel headers required by src/bridge.c dnl if test "$with_qemu" = "yes" || test "$with_lxc" = "yes" ; then AC_CHECK_HEADERS([linux/param.h linux/sockios.h linux/if_bridge.h linux/if_tun.h],, AC_MSG_ERROR([You must install kernel-headers in order to compile libvirt])) fi ----------------------------------------------- note that with_qemu is set to yes by default Daniel diff --git a/configure.ac b/configure.ac index 99bc906..d360b4e 100644 --- a/configure.ac +++ b/configure.ac @@ -205,6 +205,18 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then sysconfdir='/etc' fi +dnl lxc and qemu drivers require linux headers +if test `uname -s` != "Linux" +then + if test "x$with_lxc" != "xyes" + then + with_lxc=no + fi + if test "x$with_qemu" != "xyes" + then + with_qemu=no + fi +fi dnl Allow to build without Xen, QEMU/KVM, test or remote driver AC_ARG_WITH([xen], -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On 04/26/2010 07:41 AM, Daniel Veillard wrote:
note that with_qemu is set to yes by default
Daniel
diff --git a/configure.ac b/configure.ac index 99bc906..d360b4e 100644 --- a/configure.ac +++ b/configure.ac @@ -205,6 +205,18 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then sysconfdir='/etc' fi
+dnl lxc and qemu drivers require linux headers +if test `uname -s` != "Linux" +then + if test "x$with_lxc" != "xyes" + then + with_lxc=no + fi + if test "x$with_qemu" != "xyes" + then + with_qemu=no + fi +fi
ACK, unless Matthias' recent patches to configure.ac already covered this in another manner. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2010/4/26 Eric Blake <eblake@redhat.com>:
On 04/26/2010 07:41 AM, Daniel Veillard wrote:
note that with_qemu is set to yes by default
Daniel
diff --git a/configure.ac b/configure.ac index 99bc906..d360b4e 100644 --- a/configure.ac +++ b/configure.ac @@ -205,6 +205,18 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then sysconfdir='/etc' fi
+dnl lxc and qemu drivers require linux headers +if test `uname -s` != "Linux" +then + if test "x$with_lxc" != "xyes" + then + with_lxc=no + fi + if test "x$with_qemu" != "xyes" + then + with_qemu=no + fi +fi
ACK, unless Matthias' recent patches to configure.ac already covered this in another manner.
ACK. I saw this problem too, but didn't post a patch for it yet. I posted a patch related to this that improved the error message and made it saying that Linux kernel headers are required for QEMU and LXC support. Actually with some recent changes from Stefan, Linux kernel headers are now always required when compiling on/for Linux because src/util/interface.c includes linux/if.h. Matthias

On Mon, Apr 26, 2010 at 08:44:29PM +0200, Matthias Bolte wrote:
2010/4/26 Eric Blake <eblake@redhat.com>:
On 04/26/2010 07:41 AM, Daniel Veillard wrote:
note that with_qemu is set to yes by default
Daniel
diff --git a/configure.ac b/configure.ac index 99bc906..d360b4e 100644 --- a/configure.ac +++ b/configure.ac @@ -205,6 +205,18 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then sysconfdir='/etc' fi
+dnl lxc and qemu drivers require linux headers +if test `uname -s` != "Linux" +then + if test "x$with_lxc" != "xyes" + then + with_lxc=no + fi + if test "x$with_qemu" != "xyes" + then + with_qemu=no + fi +fi
ACK, unless Matthias' recent patches to configure.ac already covered this in another manner.
ACK.
I saw this problem too, but didn't post a patch for it yet. I posted a patch related to this that improved the error message and made it saying that Linux kernel headers are required for QEMU and LXC support.
okay, pushed,
Actually with some recent changes from Stefan, Linux kernel headers are now always required when compiling on/for Linux because src/util/interface.c includes linux/if.h.
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"]) that seems to imply network support would have to be disabled on Solaris, as the bridge.c is full of linux includes. Mutipath code is also linux only (no surprise) For interface I now see #ifdef __linux__ # include <linux/if.h> #endif so that probably compile there now. Someone has an OpenSolaris VM to try to get the build through ? Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel Veillard
-
Eric Blake
-
Matthias Bolte