[libvirt PATCH 107/351] meson: add storage rbd build option

Pavel Hrdina phrdina at redhat.com
Thu Jul 16 09:55:43 UTC 2020


Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 configure.ac           |  5 -----
 m4/virt-storage-rbd.m4 | 50 ------------------------------------------
 meson.build            |  8 +++++++
 meson_options.txt      |  1 +
 4 files changed, 9 insertions(+), 55 deletions(-)
 delete mode 100644 m4/virt-storage-rbd.m4

diff --git a/configure.ac b/configure.ac
index 465d9974ac4..ad43de7f39e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,21 +137,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
@@ -213,7 +210,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
@@ -226,7 +222,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 cd3b24ea2fa..00000000000
--- 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 <http://www.gnu.org/licenses/>.
-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 c30026bc696..b31e77b81a3 100644
--- a/meson.build
+++ b/meson.build
@@ -1976,6 +1976,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
@@ -2029,6 +2036,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 97e18987860..0e256fb1004 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -82,3 +82,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')
-- 
2.26.2




More information about the libvir-list mailing list