[libvirt] [PATCH] configure: disable network and storage-fs drivers on mac os x

Disabling these two drivers on MacOS X, where they are known to not work, allows libvirt (including the daemon) to compile without any further changes. --- Whooo, we now run on MacOS X too. Anyone with a BSD around, that wants to check there, in case we get lucky? :) configure.ac | 39 ++++++++++++++++++++++++++++----------- 1 files changed, 28 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 6c4e828..2dbfc72 100644 --- a/configure.ac +++ b/configure.ac @@ -182,12 +182,24 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then sysconfdir='/etc' fi -dnl lxc and qemu drivers require linux headers +dnl Make some notes about which OS we're compiling for, as the lxc and qemu +dnl drivers require linux headers, while storage_mpath and nwfilter are also +dnl linux specific. The "network" and "storage_fs" drivers are known to not +dnl work on MacOS X presently, so we also make a note if compiling for that + +with_linux=no +with_osx=no case "$host" in *-*-linux*) # match linux here so the *) case will match anything non-linux + with_linux=yes ;; *) + case "$host" in + *-*-darwin*) + with_osx=yes + ;; + esac if test "x$with_lxc" != "xyes" then with_lxc=no @@ -198,6 +210,7 @@ case "$host" in fi ;; esac +AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) dnl Allow to build without Xen, QEMU/KVM, test or remote driver AC_ARG_WITH([xen], @@ -1306,12 +1319,18 @@ fi AC_SUBST([READLINE_CFLAGS]) AC_SUBST([VIRSH_LIBS]) +dnl check if the network driver should be compiled AC_ARG_WITH([network], AC_HELP_STRING([--with-network], [with virtual network driver @<:@default=yes@:>@]),[],[with_network=yes]) -if test "$with_libvirtd" = "no" ; then + +dnl theres no use compiling the network driver without the libvirt +dnl daemon, nor compiling it for MacOS X, where it breaks the compile + +if test "$with_libvirtd" = "no" || test "$with_osx" = "yes"; then with_network=no fi + if test "$with_network" = "yes" ; then AC_DEFINE_UNQUOTED([WITH_NETWORK], 1, [whether network driver is enabled]) fi @@ -1389,6 +1408,11 @@ if test "$with_storage_dir" = "yes" ; then fi AM_CONDITIONAL([WITH_STORAGE_DIR], [test "$with_storage_dir" = "yes"]) +dnl storage-fs does not work on MacOS X + +if test "$with_osx" = "yes"; then + with_storage_fs=no +fi if test "$with_storage_fs" = "yes" || test "$with_storage_fs" = "check"; then AC_PATH_PROG([MOUNT], [mount], [], [$PATH:/sbin:/usr/sbin]) @@ -1503,14 +1527,6 @@ if test "$with_storage_scsi" = "check"; then fi AM_CONDITIONAL([WITH_STORAGE_SCSI], [test "$with_storage_scsi" = "yes"]) -with_linux=no -case "$host" in - *-*-linux*) - with_linux=yes - ;; -esac -AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) - if test "$with_storage_mpath" = "check" && test "$with_linux" = "yes"; then with_storage_mpath=yes @@ -2030,6 +2046,8 @@ then fi AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"]) +dnl nwfilter should only be compiled for linux, and only if the +dnl libvirt daemon is also being compiled with_nwfilter=yes if test "$with_libvirtd" = "no" || test "$with_linux" != "yes"; then @@ -2040,7 +2058,6 @@ if test "$with_nwfilter" = "yes" ; then fi AM_CONDITIONAL([WITH_NWFILTER], [test "$with_nwfilter" = "yes"]) - AC_ARG_WITH([qemu-user], AC_HELP_STRING([--with-qemu-user], [username to run QEMU system instance as @<:@default=root@:>@]), [QEMU_USER=${withval}], -- 1.7.3

On 10/04/2010 06:57 AM, Justin Clift wrote:
+with_linux=no +with_osx=no case "$host" in *-*-linux*) # match linux here so the *) case will match anything non-linux + with_linux=yes ;; *) + case "$host" in + *-*-darwin*) + with_osx=yes + ;; + esac if test "x$with_lxc" != "xyes"
Hmm; the nested case $host seems odd to me. Maybe a better layout is: with_linux=no with_osx=no case $host in *-*-linux*) with_linux=yes ;; *-*-darwin*) with_osx=yes ;; esac if $with_linux = no; then if test "x$with_lxc" != xyes ... fi That is, use only a single host-detection case statement, and rely on the results of that for future checks, rather than mixing host-detection and actions based on host-detection into a nested case statement. And yes, I trimmed out some of the redundant "" from the shell code in the example above (the shell word after case does not need "" unless it contains shell metacharacters to be taken literally, because it is not subject to field splitting; and $with_linux is exactly 'yes' or 'no' at the point where it is checked, so it is a safe expansion without quotes; whereas $with_lxc is user-provided and might begin with - or contain whitespace).
AC_ARG_WITH([network], AC_HELP_STRING([--with-network], [with virtual network driver @<:@default=yes@:>@]),[],[with_network=yes]) -if test "$with_libvirtd" = "no" ; then + +dnl theres no use compiling the network driver without the libvirt
s/theres/there's/
+dnl daemon, nor compiling it for MacOS X, where it breaks the compile + +if test "$with_libvirtd" = "no" || test "$with_osx" = "yes"; then with_network=no fi
Mostly looks okay, but probably worth a v2 to make sure the $host-detection case statement rewrite is still good. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 10/05/2010 04:07 AM, Eric Blake wrote: <snip>
Hmm; the nested case $host seems odd to me. Maybe a better layout is:
with_linux=no with_osx=no case $host in *-*-linux*) with_linux=yes ;; *-*-darwin*) with_osx=yes ;; esac if $with_linux = no; then if test "x$with_lxc" != xyes ... fi
Ahhh, that's a much better idea. Will do. :)
AC_ARG_WITH([network], AC_HELP_STRING([--with-network], [with virtual network driver @<:@default=yes@:>@]),[],[with_network=yes]) -if test "$with_libvirtd" = "no" ; then + +dnl theres no use compiling the network driver without the libvirt
s/theres/there's/
Oops. Thanks. :)
+dnl daemon, nor compiling it for MacOS X, where it breaks the compile + +if test "$with_libvirtd" = "no" || test "$with_osx" = "yes"; then with_network=no fi
Mostly looks okay, but probably worth a v2 to make sure the $host-detection case statement rewrite is still good.
No worries. It'll be a tomorrow job though. :)

Disabling these two drivers on MacOS X, where they are known to not work, allows libvirt (including the daemon) to compile without any further changes. --- This 2nd version of the patch incorporates Erics suggestion for a better case statement approach, and fixes a typo in a comment. Apart from that, this is the final patch needed to compile out of the box on MacOS X. (further work should be done at some point to fix the ssh connectivity problem to PolicyKit enabled servers though) Anyone with a BSD around, that wants to check there, in case we get lucky? :) configure.ac | 51 +++++++++++++++++++++++++++++++-------------------- 1 files changed, 31 insertions(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index 6c4e828..bd92b65 100644 --- a/configure.ac +++ b/configure.ac @@ -182,22 +182,29 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then sysconfdir='/etc' fi -dnl lxc and qemu drivers require linux headers -case "$host" in - *-*-linux*) - # match linux here so the *) case will match anything non-linux - ;; - *) - if test "x$with_lxc" != "xyes" +dnl Make some notes about which OS we're compiling for, as the lxc and qemu +dnl drivers require linux headers, while storage_mpath and nwfilter are also +dnl linux specific. The "network" and storage_fs drivers are known to not +dnl work on MacOS X presently, so we also make a note if compiling for that + +with_linux=no with_osx=no +case $host in + *-*-linux*) with_linux=yes ;; + *-*-darwin*) with_osx=yes ;; +esac + +if test $with_linux = no; then + if test "x$with_lxc" != xyes then with_lxc=no fi - if test "x$with_qemu" != "xyes" + if test "x$with_qemu" != xyes then with_qemu=no fi - ;; -esac +fi + +AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) dnl Allow to build without Xen, QEMU/KVM, test or remote driver AC_ARG_WITH([xen], @@ -1306,12 +1313,18 @@ fi AC_SUBST([READLINE_CFLAGS]) AC_SUBST([VIRSH_LIBS]) +dnl check if the network driver should be compiled AC_ARG_WITH([network], AC_HELP_STRING([--with-network], [with virtual network driver @<:@default=yes@:>@]),[],[with_network=yes]) -if test "$with_libvirtd" = "no" ; then + +dnl there's no use compiling the network driver without the libvirt +dnl daemon, nor compiling it for MacOS X, where it breaks the compile + +if test "$with_libvirtd" = "no" || test "$with_osx" = "yes"; then with_network=no fi + if test "$with_network" = "yes" ; then AC_DEFINE_UNQUOTED([WITH_NETWORK], 1, [whether network driver is enabled]) fi @@ -1389,6 +1402,11 @@ if test "$with_storage_dir" = "yes" ; then fi AM_CONDITIONAL([WITH_STORAGE_DIR], [test "$with_storage_dir" = "yes"]) +dnl storage-fs does not work on MacOS X + +if test "$with_osx" = "yes"; then + with_storage_fs=no +fi if test "$with_storage_fs" = "yes" || test "$with_storage_fs" = "check"; then AC_PATH_PROG([MOUNT], [mount], [], [$PATH:/sbin:/usr/sbin]) @@ -1503,14 +1521,6 @@ if test "$with_storage_scsi" = "check"; then fi AM_CONDITIONAL([WITH_STORAGE_SCSI], [test "$with_storage_scsi" = "yes"]) -with_linux=no -case "$host" in - *-*-linux*) - with_linux=yes - ;; -esac -AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) - if test "$with_storage_mpath" = "check" && test "$with_linux" = "yes"; then with_storage_mpath=yes @@ -2030,6 +2040,8 @@ then fi AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"]) +dnl nwfilter should only be compiled for linux, and only if the +dnl libvirt daemon is also being compiled with_nwfilter=yes if test "$with_libvirtd" = "no" || test "$with_linux" != "yes"; then @@ -2040,7 +2052,6 @@ if test "$with_nwfilter" = "yes" ; then fi AM_CONDITIONAL([WITH_NWFILTER], [test "$with_nwfilter" = "yes"]) - AC_ARG_WITH([qemu-user], AC_HELP_STRING([--with-qemu-user], [username to run QEMU system instance as @<:@default=root@:>@]), [QEMU_USER=${withval}], -- 1.7.3

On Tue, Oct 05, 2010 at 01:02:35PM +1100, Justin Clift wrote:
Disabling these two drivers on MacOS X, where they are known to not work, allows libvirt (including the daemon) to compile without any further changes. --- This 2nd version of the patch incorporates Erics suggestion for a better case statement approach, and fixes a typo in a comment.
Apart from that, this is the final patch needed to compile out of the box on MacOS X. (further work should be done at some point to fix the ssh connectivity problem to PolicyKit enabled servers though)
Anyone with a BSD around, that wants to check there, in case we get lucky? :) configure.ac | 51 +++++++++++++++++++++++++++++++-------------------- 1 files changed, 31 insertions(+), 20 deletions(-)
diff --git a/configure.ac b/configure.ac index 6c4e828..bd92b65 100644 --- a/configure.ac +++ b/configure.ac @@ -182,22 +182,29 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then sysconfdir='/etc' fi
-dnl lxc and qemu drivers require linux headers -case "$host" in - *-*-linux*) - # match linux here so the *) case will match anything non-linux - ;; - *) - if test "x$with_lxc" != "xyes" +dnl Make some notes about which OS we're compiling for, as the lxc and qemu +dnl drivers require linux headers, while storage_mpath and nwfilter are also +dnl linux specific. The "network" and storage_fs drivers are known to not +dnl work on MacOS X presently, so we also make a note if compiling for that + +with_linux=no with_osx=no +case $host in + *-*-linux*) with_linux=yes ;; + *-*-darwin*) with_osx=yes ;; +esac + +if test $with_linux = no; then + if test "x$with_lxc" != xyes then with_lxc=no fi - if test "x$with_qemu" != "xyes" + if test "x$with_qemu" != xyes then with_qemu=no fi - ;; -esac +fi + +AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
dnl Allow to build without Xen, QEMU/KVM, test or remote driver AC_ARG_WITH([xen], @@ -1306,12 +1313,18 @@ fi AC_SUBST([READLINE_CFLAGS]) AC_SUBST([VIRSH_LIBS])
+dnl check if the network driver should be compiled
AC_ARG_WITH([network], AC_HELP_STRING([--with-network], [with virtual network driver @<:@default=yes@:>@]),[],[with_network=yes]) -if test "$with_libvirtd" = "no" ; then + +dnl there's no use compiling the network driver without the libvirt +dnl daemon, nor compiling it for MacOS X, where it breaks the compile + +if test "$with_libvirtd" = "no" || test "$with_osx" = "yes"; then with_network=no fi + if test "$with_network" = "yes" ; then AC_DEFINE_UNQUOTED([WITH_NETWORK], 1, [whether network driver is enabled]) fi @@ -1389,6 +1402,11 @@ if test "$with_storage_dir" = "yes" ; then fi AM_CONDITIONAL([WITH_STORAGE_DIR], [test "$with_storage_dir" = "yes"])
+dnl storage-fs does not work on MacOS X + +if test "$with_osx" = "yes"; then + with_storage_fs=no +fi
if test "$with_storage_fs" = "yes" || test "$with_storage_fs" = "check"; then AC_PATH_PROG([MOUNT], [mount], [], [$PATH:/sbin:/usr/sbin]) @@ -1503,14 +1521,6 @@ if test "$with_storage_scsi" = "check"; then fi AM_CONDITIONAL([WITH_STORAGE_SCSI], [test "$with_storage_scsi" = "yes"])
-with_linux=no -case "$host" in - *-*-linux*) - with_linux=yes - ;; -esac -AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) - if test "$with_storage_mpath" = "check" && test "$with_linux" = "yes"; then with_storage_mpath=yes
@@ -2030,6 +2040,8 @@ then fi AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"])
+dnl nwfilter should only be compiled for linux, and only if the +dnl libvirt daemon is also being compiled
with_nwfilter=yes if test "$with_libvirtd" = "no" || test "$with_linux" != "yes"; then @@ -2040,7 +2052,6 @@ if test "$with_nwfilter" = "yes" ; then fi AM_CONDITIONAL([WITH_NWFILTER], [test "$with_nwfilter" = "yes"])
- AC_ARG_WITH([qemu-user], AC_HELP_STRING([--with-qemu-user], [username to run QEMU system instance as @<:@default=root@:>@]), [QEMU_USER=${withval}],
ACK, 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/

On 10/05/2010 11:53 PM, Daniel Veillard wrote:
On Tue, Oct 05, 2010 at 01:02:35PM +1100, Justin Clift wrote:
Disabling these two drivers on MacOS X, where they are known to not work, allows libvirt (including the daemon) to compile without any further changes. <snip>
ACK,
Thanks, pushed. :)
Daniel
participants (3)
-
Daniel Veillard
-
Eric Blake
-
Justin Clift