]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: ensure storage driver is used
authorEric Blake <eblake@redhat.com>
Tue, 5 Jun 2012 16:28:52 +0000 (10:28 -0600)
committerOsier Yang <jyang@redhat.com>
Wed, 6 Jun 2012 04:16:07 +0000 (12:16 +0800)
Commit 1c275e9a accidentally dropped the storage driver from
libvirtd, because it depended on a C preprocessor macro that
was not defined.  Furthermore, if you do './configure
--without-storage-dir --with-storage-disk' or any other combination
where you explicitly build a subset of storage backends excluding
the dir backend, then the build is broken.

Based on analysis by Osier Yang.

* configure.ac (WITH_STORAGE): Define top-level conditional.
* src/Makefile.am (mod_LTLIBRARIES): Build driver even when
storage_dir is disabled.
* daemon/libvirtd.c: Pick up storage driver for any backend, not
just dir.
* daemon/Makefile.am (libvirtd_LDADD): Likewise.

configure.ac
daemon/Makefile.am
daemon/libvirtd.c
src/Makefile.am

index 7d8d26b1e60081bdff8ae47f6e60c13bfc8fa98d..dda764d3f0a4f6d2fe59c9c84a82e7f2af66b528 100644 (file)
@@ -2076,6 +2076,19 @@ fi
 AC_SUBST([DEVMAPPER_CFLAGS])
 AC_SUBST([DEVMAPPER_LIBS])
 
+with_storage=no
+for backend in dir fs lvm iscsi scsi mpath rbd disk; do
+    if eval test \$with_storage_$backend = yes; then
+        with_storage=yes
+        break
+    fi
+done
+if test $with_storage = yes; then
+    AC_DEFINE([WITH_STORAGE], [1],
+      [Define to 1 if at least one storage backend is in use])
+fi
+AM_CONDITIONAL([WITH_STORAGE], [test "$with_storage" = "yes"])
+
 dnl
 dnl check for libcurl (ESX/XenAPI)
 dnl
index b1518c58c3b0c3797f5121cf5f7a9df4f47cab11..fbb0ae1f90180a8c333617cdc3be5f0963c182cd 100644 (file)
@@ -140,7 +140,7 @@ if WITH_UML
     libvirtd_LDADD += ../src/libvirt_driver_uml.la
 endif
 
-if WITH_STORAGE_DIR
+if WITH_STORAGE
     libvirtd_LDADD += ../src/libvirt_driver_storage.la
 endif
 
index c74cd43092bf97a7d6a3ed92af820e32c885c14b..d5ad05e92da2712f6e7953f13520ddfa709c1b4b 100644 (file)
@@ -77,7 +77,7 @@
 # ifdef WITH_NETCF
 #  include "interface/netcf_driver.h"
 # endif
-# ifdef WITH_STORAGE_DIR
+# ifdef WITH_STORAGE
 #  include "storage/storage_driver.h"
 # endif
 # ifdef WITH_NODE_DEVICES
@@ -403,7 +403,7 @@ static void daemonInitialize(void)
 # ifdef WITH_NETCF
     interfaceRegister();
 # endif
-# ifdef WITH_STORAGE_DIR
+# ifdef WITH_STORAGE
     storageRegister();
 # endif
 # ifdef WITH_NODE_DEVICES
index dd1af6595e26c74a0130745174f9c0e6b81fabbb..2d737afff9eb0e6a59eda9a9558a1f649f417197 100644 (file)
@@ -967,7 +967,7 @@ if HAVE_LIBBLKID
 libvirt_driver_storage_la_CFLAGS += $(BLKID_CFLAGS)
 libvirt_driver_storage_la_LIBADD += $(BLKID_LIBS)
 endif
-if WITH_STORAGE_DIR
+if WITH_STORAGE
 if WITH_DRIVER_MODULES
 mod_LTLIBRARIES += libvirt_driver_storage.la
 else