]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add storage rbd build option
authorPavel Hrdina <phrdina@redhat.com>
Fri, 19 Jun 2020 15:09:22 +0000 (17:09 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:00 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
configure.ac
m4/virt-storage-rbd.m4 [deleted file]
meson.build
meson_options.txt

index 477da3658cc5337ccf16994ac78ff4023771d2fc..3a77df4c0c94f8e50c2a7d320eb8dd95b1be0645 100644 (file)
@@ -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 (file)
index cd3b24e..0000000
+++ /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'])
-])
index 6848d91f29ed3356c898b353dbd52644eec6f3e4..645deafdb803598d75cef4fa4b0f424b7fd7b7db 100644 (file)
@@ -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)
index f3635ef67c1883d2fb6309818bd6308e909c925f..3afa53124ddbcbb5e8af137de8e5a315b29cfc1e 100644 (file)
@@ -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')