meson: add storage mpath build options

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-04-30 11:01:46 +02:00
parent f49fb5abc7
commit 0504324fc7
4 changed files with 9 additions and 57 deletions

View File

@ -135,7 +135,6 @@ dnl Storage driver checks
dnl dnl
LIBVIRT_STORAGE_ARG_SCSI LIBVIRT_STORAGE_ARG_SCSI
LIBVIRT_STORAGE_ARG_MPATH
LIBVIRT_STORAGE_ARG_RBD LIBVIRT_STORAGE_ARG_RBD
LIBVIRT_STORAGE_ARG_SHEEPDOG LIBVIRT_STORAGE_ARG_SHEEPDOG
LIBVIRT_STORAGE_ARG_ZFS LIBVIRT_STORAGE_ARG_ZFS
@ -143,7 +142,6 @@ LIBVIRT_STORAGE_ARG_VSTORAGE
if test "$with_libvirtd" = "no"; then if test "$with_libvirtd" = "no"; then
with_storage_scsi=no with_storage_scsi=no
with_storage_mpath=no
with_storage_rbd=no with_storage_rbd=no
with_storage_sheepdog=no with_storage_sheepdog=no
with_storage_zfs=no with_storage_zfs=no
@ -151,7 +149,6 @@ if test "$with_libvirtd" = "no"; then
fi fi
LIBVIRT_STORAGE_CHECK_SCSI LIBVIRT_STORAGE_CHECK_SCSI
LIBVIRT_STORAGE_CHECK_MPATH
LIBVIRT_STORAGE_CHECK_RBD LIBVIRT_STORAGE_CHECK_RBD
LIBVIRT_STORAGE_CHECK_SHEEPDOG LIBVIRT_STORAGE_CHECK_SHEEPDOG
LIBVIRT_STORAGE_CHECK_ZFS LIBVIRT_STORAGE_CHECK_ZFS
@ -214,7 +211,6 @@ AC_MSG_NOTICE([])
AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([Storage Drivers])
AC_MSG_NOTICE([]) AC_MSG_NOTICE([])
LIBVIRT_STORAGE_RESULT_SCSI LIBVIRT_STORAGE_RESULT_SCSI
LIBVIRT_STORAGE_RESULT_MPATH
LIBVIRT_STORAGE_RESULT_RBD LIBVIRT_STORAGE_RESULT_RBD
LIBVIRT_STORAGE_RESULT_SHEEPDOG LIBVIRT_STORAGE_RESULT_SHEEPDOG
LIBVIRT_STORAGE_RESULT_ZFS LIBVIRT_STORAGE_RESULT_ZFS

View File

@ -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])
])

View File

@ -1987,6 +1987,13 @@ if conf.has('WITH_LIBVIRTD')
endforeach endforeach
endif endif
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 endif
if use_storage if use_storage
@ -2038,6 +2045,7 @@ storagedriver_summary = {
'LVM': conf.has('WITH_STORAGE_LVM'), 'LVM': conf.has('WITH_STORAGE_LVM'),
'iSCSI': conf.has('WITH_STORAGE_ISCSI'), 'iSCSI': conf.has('WITH_STORAGE_ISCSI'),
'iscsi-direct': conf.has('WITH_STORAGE_ISCSI_DIRECT'), 'iscsi-direct': conf.has('WITH_STORAGE_ISCSI_DIRECT'),
'mpath': conf.has('WITH_STORAGE_MPATH'),
'Disk': conf.has('WITH_STORAGE_DISK'), 'Disk': conf.has('WITH_STORAGE_DISK'),
'Gluster': conf.has('WITH_STORAGE_GLUSTER'), 'Gluster': conf.has('WITH_STORAGE_GLUSTER'),
} }

View 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', 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_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_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')