From 0504324fc72b42248aba0eb23a4b9c11b1da044c Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Thu, 30 Apr 2020 11:01:46 +0200 Subject: [PATCH] meson: add storage mpath build options Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa Reviewed-by: Neal Gompa --- 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 b0d73893b0..477da3658c 100644 --- a/configure.ac +++ b/configure.ac @@ -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 index d4f8ecfb9e..0000000000 --- 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 . -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 36ee1d106f..6848d91f29 100644 --- a/meson.build +++ b/meson.build @@ -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'), } diff --git a/meson_options.txt b/meson_options.txt index d5b21a0503..f3635ef67c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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')