From: Pavel Hrdina Date: Fri, 19 Jun 2020 15:09:22 +0000 (+0200) Subject: meson: add storage rbd build option X-Git-Tag: v6.7.0-rc1~496 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c435deb77d9cb14577519dc884d4f7d7bfbd9be;p=thirdparty%2Flibvirt.git meson: add storage rbd build option Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa Reviewed-by: Neal Gompa --- diff --git a/configure.ac b/configure.ac index 477da3658c..3a77df4c0c 100644 --- a/configure.ac +++ b/configure.ac @@ -135,21 +135,18 @@ dnl Storage driver checks dnl LIBVIRT_STORAGE_ARG_SCSI -LIBVIRT_STORAGE_ARG_RBD LIBVIRT_STORAGE_ARG_SHEEPDOG LIBVIRT_STORAGE_ARG_ZFS LIBVIRT_STORAGE_ARG_VSTORAGE if test "$with_libvirtd" = "no"; then with_storage_scsi=no - with_storage_rbd=no with_storage_sheepdog=no with_storage_zfs=no with_storage_vstorage=no fi LIBVIRT_STORAGE_CHECK_SCSI -LIBVIRT_STORAGE_CHECK_RBD LIBVIRT_STORAGE_CHECK_SHEEPDOG LIBVIRT_STORAGE_CHECK_ZFS LIBVIRT_STORAGE_CHECK_VSTORAGE @@ -211,7 +208,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) LIBVIRT_STORAGE_RESULT_SCSI -LIBVIRT_STORAGE_RESULT_RBD LIBVIRT_STORAGE_RESULT_SHEEPDOG LIBVIRT_STORAGE_RESULT_ZFS LIBVIRT_STORAGE_RESULT_VSTORAGE @@ -224,7 +220,6 @@ AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS -LIBVIRT_RESULT_RBD AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) diff --git a/m4/virt-storage-rbd.m4 b/m4/virt-storage-rbd.m4 deleted file mode 100644 index cd3b24ea2f..0000000000 --- a/m4/virt-storage-rbd.m4 +++ /dev/null @@ -1,50 +0,0 @@ -dnl The storage RBD 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_RBD], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_RBD], - [RADOS Block Device backend for the storage driver], [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_RBD], [ - LIBRBD_LIBS= - if test "$with_storage_rbd" = "yes" || test "$with_storage_rbd" = "check"; then - if test "$LIBRBD_FOUND" = "yes"; then - with_storage_rbd=yes - AC_DEFINE_UNQUOTED([WITH_STORAGE_RBD], [1], - [whether RBD backend for storage driver is enabled]) - else - if test "$with_storage_rbd" = "yes"; then - AC_MSG_ERROR([You must install the librbd library & headers to compile libvirt]) - else - with_storage_rbd=no - fi - fi - fi - AM_CONDITIONAL([WITH_STORAGE_RBD], [test "$with_storage_rbd" = "yes"]) - AC_SUBST([LIBRBD_LIBS]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_RBD], [ - LIBVIRT_RESULT([RBD], [$with_storage_rbd]) -]) - -AC_DEFUN([LIBVIRT_RESULT_RBD], [ - LIBVIRT_RESULT([rbd], [$with_storage_rbd], [CFLAGS='' LIBS='$LIBRBD_LIBS']) -]) diff --git a/meson.build b/meson.build index 6848d91f29..645deafdb8 100644 --- a/meson.build +++ b/meson.build @@ -1994,6 +1994,13 @@ if conf.has('WITH_LIBVIRTD') elif get_option('storage_mpath').enabled() error('mpath storage driver is supported only on Linux and you must install libdevmapper') endif + + if not get_option('storage_rbd').disabled() and rbd_dep.found() + use_storage = true + conf.set('WITH_STORAGE_RBD', 1) + elif get_option('storage_rbd').enabled() + error('You must install the librbd library & headers to compile libvirt') + endif endif if use_storage @@ -2047,6 +2054,7 @@ storagedriver_summary = { 'iscsi-direct': conf.has('WITH_STORAGE_ISCSI_DIRECT'), 'mpath': conf.has('WITH_STORAGE_MPATH'), 'Disk': conf.has('WITH_STORAGE_DISK'), + 'RBD': conf.has('WITH_STORAGE_RBD'), 'Gluster': conf.has('WITH_STORAGE_GLUSTER'), } summary(storagedriver_summary, section: 'Storage Drivers', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index f3635ef67c..3afa53124d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -83,3 +83,4 @@ option('storage_iscsi', type: 'feature', value: 'auto', description: 'iscsi back 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') +option('storage_rbd', type: 'feature', value: 'auto', description: 'RADOS Block Device backend for the storage driver')