]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tools/rbd/action/Kernel.cc: create stubs for FreeBSD
authorWillem Jan Withagen <wjw@digiware.nl>
Thu, 5 Jan 2017 11:20:38 +0000 (12:20 +0100)
committerWillem Jan Withagen <wjw@digiware.nl>
Thu, 12 Jan 2017 15:12:41 +0000 (16:12 +0100)
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
src/include/config-h.in.cmake
src/tools/rbd/action/Kernel.cc

index dd92974c4492c23166ac257fadc88d2e3ce154ec..8576904cbbc201af444209fe0a8fe587e439f84a 100644 (file)
 /* define if rbd enabled */
 #cmakedefine WITH_RBD
 
+/* define if kernel rbd enabled */
+#cmakedefine WITH_KRBD
+
 /* define if key-value-store is enabled */
 #cmakedefine WITH_KVS
 
index ee640062ce8a5401e6493ae430a4cc047f9e4bc2..5720dc09325295defc6daa00c44006a83c3642de 100644 (file)
@@ -1,6 +1,7 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
+#include "acconfig.h"
 #include "tools/rbd/ArgumentTypes.h"
 #include "tools/rbd/Shell.h"
 #include "tools/rbd/Utils.h"
@@ -163,6 +164,7 @@ static int parse_unmap_options(char *options)
 
 static int do_kernel_showmapped(Formatter *f)
 {
+#if defined(WITH_KRBD)
   struct krbd_ctx *krbd;
   int r;
 
@@ -174,6 +176,10 @@ static int do_kernel_showmapped(Formatter *f)
 
   krbd_destroy(krbd);
   return r;
+#else
+  return -1;
+#endif
+
 }
 
 /*
@@ -218,6 +224,7 @@ static void print_error_description(const char *poolname, const char *imgname,
 static int do_kernel_map(const char *poolname, const char *imgname,
                          const char *snapname)
 {
+#if defined(WITH_KRBD)
   struct krbd_ctx *krbd;
   std::ostringstream oss;
   char *devnode;
@@ -254,11 +261,15 @@ static int do_kernel_map(const char *poolname, const char *imgname,
 out:
   krbd_destroy(krbd);
   return r;
+#else
+  return -1;
+#endif
 }
 
 static int do_kernel_unmap(const char *dev, const char *poolname,
                            const char *imgname, const char *snapname)
 {
+#if defined(WITH_KRBD)
   struct krbd_ctx *krbd;
   std::ostringstream oss;
   int r;
@@ -281,6 +292,10 @@ static int do_kernel_unmap(const char *dev, const char *poolname,
 
   krbd_destroy(krbd);
   return r;
+#else
+  return -1;
+#endif
+
 }
 
 void get_show_arguments(po::options_description *positional,