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.
This commit is contained in:
Richard W.M. Jones
2012-10-13 20:52:31 +01:00
parent 085bf7c97a
commit 07d0546f5d
2 changed files with 8 additions and 7 deletions

View File

@@ -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)

View File

@@ -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,