diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-10-13 20:52:31 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-10-13 20:52:31 +0100 |
commit | 07d0546f5d210d1cee048de8d42bdf58302f0d93 (patch) | |
tree | 6d8ad8cfd505558bdb6298f5c8e8eebd18876ec3 | |
parent | 085bf7c97aae67e8f84fe95f97ee4bfee849d523 (diff) | |
download | libguestfs-07d0546f5d210d1cee048de8d42bdf58302f0d93.tar.gz libguestfs-07d0546f5d210d1cee048de8d42bdf58302f0d93.tar.xz libguestfs-07d0546f5d210d1cee048de8d42bdf58302f0d93.zip |
configure: Add --without-libvirt option.
Normally we check if libvirt is installed, and the default is still to
do this.
However having this option makes it simpler to check if a change to
the code has broken the case where libvirt is not installed.
In fact, this change revealed one such place, which is also fixed in
this commit.
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | src/launch-libvirt.c | 6 |
2 files changed, 8 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 431be751..a6aacb1e 100644 --- a/configure.ac +++ b/configure.ac @@ -693,12 +693,19 @@ AC_CHECK_LIB([magic],[magic_file], [AC_MSG_WARN([libmagic not found, some core features will be disabled])]) dnl libvirt (highly recommended) -PKG_CHECK_MODULES([LIBVIRT], [libvirt], +AC_ARG_WITH([libvirt], + [AS_HELP_STRING([--without-libvirt], + [disable libvirt support @<:@default=check@:>@])], + [], + [with_libvirt=check]) +AS_IF([test "$with_libvirt" != "no"],[ + PKG_CHECK_MODULES([LIBVIRT], [libvirt], [AC_SUBST([LIBVIRT_CFLAGS]) AC_SUBST([LIBVIRT_LIBS]) AC_DEFINE([HAVE_LIBVIRT],[1],[libvirt found at compile time.]) ], [AC_MSG_WARN([libvirt not found, some core features will be disabled])]) +]) AM_CONDITIONAL([HAVE_LIBVIRT],[test "x$LIBVIRT_LIBS" != "x"]) dnl libxml2 (highly recommended) diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c index 4f015e3a..aac5d291 100644 --- a/src/launch-libvirt.c +++ b/src/launch-libvirt.c @@ -1523,12 +1523,6 @@ max_disks_libvirt (guestfs_h *g) NOT_IMPL (-1); } -static int -hot_add_drive_libvirt (guestfs_h *g, struct drive *drv, size_t drv_index) -{ - NOT_IMPL (-1); -} - struct attach_ops attach_ops_libvirt = { .launch = launch_libvirt, .shutdown = shutdown_libvirt, |