From 91c73df113a7e65716f4341bfc73c1c8a19340e8 Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Mon, 15 Oct 2018 18:47:28 +0300 Subject: [PATCH] tool/bluestore-tool: print target path for bluestore symlinks. Signed-off-by: Igor Fedotov --- src/os/bluestore/bluestore_tool.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/os/bluestore/bluestore_tool.cc b/src/os/bluestore/bluestore_tool.cc index 601b72879e32..320f12ed577d 100644 --- a/src/os/bluestore/bluestore_tool.cc +++ b/src/os/bluestore/bluestore_tool.cc @@ -145,7 +145,20 @@ void add_devices( map got; parse_devices(cct, devs, &got, nullptr, nullptr); for(auto e : got) { - cout << " slot " << e.second << " " << e.first << std::endl; + char target_path[PATH_MAX] = ""; + if(!e.first.empty()) { + if (realpath(e.first.c_str(), target_path) == nullptr) { + cerr << "failed to retrieve absolute path for " << e.first + << ": " << cpp_strerror(errno) + << std::endl; + } + } + + cout << " slot " << e.second << " " << e.first; + if (target_path[0]) { + cout << " -> " << target_path; + } + cout << std::endl; int r = fs->add_block_device(e.second, e.first, false); if (r < 0) { cerr << "unable to open " << e.first << ": " << cpp_strerror(r) << std::endl; -- 2.47.3