From 354191c5f18aeb152cfe9f9d682fb3c4b32a88a6 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 7 Apr 2017 15:12:08 +0100 Subject: [PATCH] Fix detection of required RBD version If building libvirt against Ubuntu precise, the librbd.h is lacking many functions that libvirt expects. We have no version check, so we were enabling RBD even though it cannot compile. This configure check uses existance of 'rbd_get_features' as an identifier for the min required version. Signed-off-by: Daniel P. Berrange --- m4/virt-storage-rbd.m4 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/m4/virt-storage-rbd.m4 b/m4/virt-storage-rbd.m4 index 48522a6a72..727bd715e1 100644 --- a/m4/virt-storage-rbd.m4 +++ b/m4/virt-storage-rbd.m4 @@ -28,12 +28,24 @@ AC_DEFUN([LIBVIRT_STORAGE_CHECK_RBD], [ AC_CHECK_HEADER([rbd/librbd.h], [LIBRBD_FOUND=yes; break;]) if test "$LIBRBD_FOUND" = "yes"; then - with_storage_rbd=yes LIBRBD_LIBS="-lrbd -lrados" + + old_LIBS="$LIBS" + LIBS="$LIBS $LIBRBD_LIBS" + AC_CHECK_FUNCS([rbd_get_features],[],[LIBRBD_FOUND=no]) + LIBS="$old_LIBS" + fi + + if test "$LIBRDB_FOUND" = "yes"; then + with_storage_rbd=yes AC_DEFINE_UNQUOTED([WITH_STORAGE_RBD], [1], [whether RBD backend for storage driver is enabled]) else - with_storage_rbd=no + 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"])