configure: fail rbd configure check on wrong rados_create2 signature
authorSitsofe Wheeler <sitsofe@yahoo.com>
Wed, 16 Aug 2017 20:45:35 +0000 (21:45 +0100)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Wed, 16 Aug 2017 21:26:02 +0000 (22:26 +0100)
Alter the rbd/rados/ceph configure check so it will fail if the
rados_create2() signature is incorrect or if the function is
unavailable. Completes the suggestion in commit
ff56a4e2e0a87e4e3b1cc1e74547d55b295967a6 ("travis: don't enable rbd").

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
configure

index afb88ca..59af1b6 100755 (executable)
--- a/configure
+++ b/configure
@@ -1483,12 +1483,16 @@ int main(int argc, char **argv)
 {
   rados_t cluster;
   rados_ioctx_t io_ctx;
+  const char cluster_name[] = "ceph";
+  const char user_name[] = "client.admin";
   const char pool[] = "rbd";
-
   int major, minor, extra;
-  rbd_version(&major, &minor, &extra);
 
+  rbd_version(&major, &minor, &extra);
+  /* The rados_create2 signature required was only introduced in ceph 0.65 */
+  rados_create2(&cluster, cluster_name, user_name, 0);
   rados_ioctx_create(cluster, pool, &io_ctx);
+
   return 0;
 }
 EOF