]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add storage mpath build options
authorPavel Hrdina <phrdina@redhat.com>
Thu, 30 Apr 2020 09:01:46 +0000 (11:01 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:00 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
configure.ac
m4/virt-storage-mpath.m4 [deleted file]
meson.build
meson_options.txt

index b0d73893b04f67fff24396f5bc9468d316ad720c..477da3658cc5337ccf16994ac78ff4023771d2fc 100644 (file)
@@ -135,7 +135,6 @@ dnl Storage driver checks
 dnl
 
 LIBVIRT_STORAGE_ARG_SCSI
-LIBVIRT_STORAGE_ARG_MPATH
 LIBVIRT_STORAGE_ARG_RBD
 LIBVIRT_STORAGE_ARG_SHEEPDOG
 LIBVIRT_STORAGE_ARG_ZFS
@@ -143,7 +142,6 @@ LIBVIRT_STORAGE_ARG_VSTORAGE
 
 if test "$with_libvirtd" = "no"; then
   with_storage_scsi=no
-  with_storage_mpath=no
   with_storage_rbd=no
   with_storage_sheepdog=no
   with_storage_zfs=no
@@ -151,7 +149,6 @@ if test "$with_libvirtd" = "no"; then
 fi
 
 LIBVIRT_STORAGE_CHECK_SCSI
-LIBVIRT_STORAGE_CHECK_MPATH
 LIBVIRT_STORAGE_CHECK_RBD
 LIBVIRT_STORAGE_CHECK_SHEEPDOG
 LIBVIRT_STORAGE_CHECK_ZFS
@@ -214,7 +211,6 @@ AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Storage Drivers])
 AC_MSG_NOTICE([])
 LIBVIRT_STORAGE_RESULT_SCSI
-LIBVIRT_STORAGE_RESULT_MPATH
 LIBVIRT_STORAGE_RESULT_RBD
 LIBVIRT_STORAGE_RESULT_SHEEPDOG
 LIBVIRT_STORAGE_RESULT_ZFS
diff --git a/m4/virt-storage-mpath.m4 b/m4/virt-storage-mpath.m4
deleted file mode 100644 (file)
index d4f8ecf..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-dnl The storage mpath check
-dnl
-dnl Copyright (C) 2016 Red Hat, Inc.
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library.  If not, see
-dnl <http://www.gnu.org/licenses/>.
-dnl
-
-AC_DEFUN([LIBVIRT_STORAGE_ARG_MPATH], [
-  LIBVIRT_ARG_WITH_FEATURE([STORAGE_MPATH], [mpath backend for the storage driver],
-                           [check])
-])
-
-AC_DEFUN([LIBVIRT_STORAGE_CHECK_MPATH], [
-  AC_REQUIRE([LIBVIRT_CHECK_DEVMAPPER])
-
-  if test "$with_storage_mpath" = "check" || test "$with_storage_mpath" = "yes"; then
-    if test "$with_linux" = "yes"; then
-      with_storage_mpath=yes
-
-      AC_DEFINE_UNQUOTED([WITH_STORAGE_MPATH], 1,
-        [whether mpath backend for storage driver is enabled])
-    else
-      if test "$with_storage_mpath" = "yes"; then
-        AC_MSG_ERROR([mpath storage is only supported on Linux])
-      fi
-      with_storage_mpath=no
-    fi
-  fi
-
-  if test "x$with_storage_mpath" = "xyes"; then
-    if test "x$with_devmapper" = "xno"; then
-      AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper to compile libvirt with mpath storage driver])
-    fi
-  fi
-
-  AM_CONDITIONAL([WITH_STORAGE_MPATH], [test "$with_storage_mpath" = "yes"])
-])
-
-AC_DEFUN([LIBVIRT_STORAGE_RESULT_MPATH], [
-  LIBVIRT_RESULT([mpath], [$with_storage_mpath])
-])
index 36ee1d106fe887f48b185dd772d82308f4d89b72..6848d91f29ed3356c898b353dbd52644eec6f3e4 100644 (file)
@@ -1987,6 +1987,13 @@ if conf.has('WITH_LIBVIRTD')
       endforeach
     endif
   endif
+
+  if not get_option('storage_mpath').disabled() and host_machine.system() == 'linux' and devmapper_dep.found()
+    use_storage = true
+    conf.set('WITH_STORAGE_MPATH', 1)
+  elif get_option('storage_mpath').enabled()
+    error('mpath storage driver is supported only on Linux and you must install libdevmapper')
+  endif
 endif
 
 if use_storage
@@ -2038,6 +2045,7 @@ storagedriver_summary = {
   'LVM': conf.has('WITH_STORAGE_LVM'),
   'iSCSI': conf.has('WITH_STORAGE_ISCSI'),
   'iscsi-direct': conf.has('WITH_STORAGE_ISCSI_DIRECT'),
+  'mpath': conf.has('WITH_STORAGE_MPATH'),
   'Disk': conf.has('WITH_STORAGE_DISK'),
   'Gluster': conf.has('WITH_STORAGE_GLUSTER'),
 }
index d5b21a0503459f660cb14e18b322c93705ed12d0..f3635ef67c1883d2fb6309818bd6308e909c925f 100644 (file)
@@ -82,3 +82,4 @@ option('storage_gluster', type: 'feature', value: 'auto', description: 'Gluster
 option('storage_iscsi', type: 'feature', value: 'auto', description: 'iscsi backend for the storage driver')
 option('storage_iscsi_direct', type: 'feature', value: 'auto', description: 'iscsi-direct backend for the storage driver')
 option('storage_lvm', type: 'feature', value: 'auto', description: 'LVM backend for the storage driver')
+option('storage_mpath', type: 'feature', value: 'auto', description: 'mpath backend for the storage driver')