Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
configure.ac | 4 ---
m4/virt-storage-mpath.m4 | 53 ----------------------------------------
meson.build | 8 ++++++
meson_options.txt | 1 +
4 files changed, 9 insertions(+), 57 deletions(-)
delete mode 100644 m4/virt-storage-mpath.m4
diff --git a/configure.ac b/configure.ac
index acfad8737ee..465d9974ac4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,7 +137,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
@@ -145,7 +144,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
@@ -153,7 +151,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
@@ -216,7 +213,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
index d4f8ecfb9ea..00000000000
--- a/m4/virt-storage-mpath.m4
+++ /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])
-])
diff --git a/meson.build b/meson.build
index cecc161ed85..c30026bc696 100644
--- a/meson.build
+++ b/meson.build
@@ -1969,6 +1969,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
@@ -2020,6 +2027,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'),
}
diff --git a/meson_options.txt b/meson_options.txt
index 66e232f59dc..97e18987860 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -81,3 +81,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')
--
2.26.2