From 07d0546f5d210d1cee048de8d42bdf58302f0d93 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 13 Oct 2012 20:52:31 +0100 Subject: 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. --- configure.ac | 9 ++++++++- 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, -- cgit