From: Sage Weil Date: Mon, 11 Jun 2018 14:36:12 +0000 (-0500) Subject: common/blkdev: fix non-linux build for get_device_id X-Git-Tag: v14.0.1~1131^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F22423%2Fhead;p=ceph.git common/blkdev: fix non-linux build for get_device_id Signed-off-by: Sage Weil --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 78e21a669705c..4957d62baecb9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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() diff --git a/src/common/blkdev.cc b/src/common/blkdev.cc index 370cafccccd1e..40deb9e341496 100644 --- a/src/common/blkdev.cc +++ b/src/common/blkdev.cc @@ -19,12 +19,12 @@ #include #include #include -#include //#include "common/debug.h" #include "include/uuid.h" #include "blkdev.h" #ifdef __linux__ +#include #include #include @@ -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