From 599bfd8cb81b477da03f0df12c630d5c4d01ac2a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 11 Jun 2018 09:36:12 -0500 Subject: [PATCH] common/blkdev: fix non-linux build for get_device_id Signed-off-by: Sage Weil --- src/CMakeLists.txt | 6 ++++-- src/common/blkdev.cc | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 78e21a669705..4957d62baecb 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 370cafccccd1..40deb9e34149 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 -- 2.47.3