]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/blkdev: fix non-linux build for get_device_id 22423/head
authorSage Weil <sage@redhat.com>
Mon, 11 Jun 2018 14:36:12 +0000 (09:36 -0500)
committerSage Weil <sage@redhat.com>
Mon, 11 Jun 2018 15:11:54 +0000 (10:11 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/CMakeLists.txt
src/common/blkdev.cc

index 78e21a669705cbaa5efa29a5ce05cbd8b51f69d2..4957d62baecb91fd3d08f9d3c67639b6ffbe1795 100644 (file)
@@ -641,8 +641,10 @@ set(ceph_common_deps
   ${BLKIN_LIBRARIES}
   ${CRYPTO_LIBS}
   ${CMAKE_THREAD_LIBS_INIT}
-  ${CMAKE_DL_LIBS}
-  ${UDEV_LIBRARIES})
+  ${CMAKE_DL_LIBS})
+if(HAVE_UDEV)
+  list(APPEND ceph_common_deps ${UDEV_LIBRARIES})
+endif()
 if(HAVE_RDMA)
   list(APPEND ceph_common_deps ${RDMA_LIBRARY})
 endif()
index 370cafccccd1e56335e6ebbc111a70cb003a1f1c..40deb9e3414962dda79ffc1a1dd4b38e172b43de 100644 (file)
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <dirent.h>
-#include <libudev.h>
 //#include "common/debug.h"
 #include "include/uuid.h"
 #include "blkdev.h"
 
 #ifdef __linux__
+#include <libudev.h>
 #include <linux/fs.h>
 #include <blkid/blkid.h>
 
@@ -543,6 +543,12 @@ bool get_vdo_utilization(int fd, uint64_t *total, uint64_t *avail)
   return false;
 }
 
+std::string get_device_id(const std::string& devname)
+{
+  // FIXME: implement me for freebsd
+  return std::string();
+}
+
 #else
 int get_block_device_size(int fd, int64_t *psize)
 {
@@ -586,4 +592,11 @@ bool get_vdo_utilization(int fd, uint64_t *total, uint64_t *avail)
 {
   return false;
 }
+
+std::string get_device_id(const std::string& devname)
+{
+  // not implemented
+  return std::string();
+}
+
 #endif