[Libguestfs] [PATCH 1/5] configure: error out if using libvirt backend and no header files

Lin Ma lma at suse.com
Tue Apr 10 07:42:52 UTC 2018


It should error out instead of warning if users provide the option
'--with-default-backend=libvirt' and no libvirt devel package installed.

Signed-off-by: Lin Ma <lma at suse.com>
---
 m4/guestfs-libraries.m4 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/m4/guestfs-libraries.m4 b/m4/guestfs-libraries.m4
index 6d5f3e3c1..88d4f1cde 100644
--- a/m4/guestfs-libraries.m4
+++ b/m4/guestfs-libraries.m4
@@ -269,8 +269,13 @@ AS_IF([test "$with_libvirt" != "no"],[
         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])])
+    ],[
+        if test "$DEFAULT_BACKEND" = "libvirt"; then
+            AC_MSG_ERROR([Please install the libvirt devel package])
+        else
+            AC_MSG_WARN([libvirt not found, some core features will be disabled])
+        fi
+    ])
 ])
 AM_CONDITIONAL([HAVE_LIBVIRT],[test "x$LIBVIRT_LIBS" != "x"])
 
-- 
2.15.1




More information about the Libguestfs mailing list