From: Igor Fedotov Date: Mon, 15 Oct 2018 15:47:28 +0000 (+0300) Subject: tool/bluestore-tool: print target path for bluestore symlinks. X-Git-Tag: v14.1.0~1131^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=91c73df113a7e65716f4341bfc73c1c8a19340e8;p=ceph.git tool/bluestore-tool: print target path for bluestore symlinks. Signed-off-by: Igor Fedotov --- diff --git a/src/os/bluestore/bluestore_tool.cc b/src/os/bluestore/bluestore_tool.cc index 601b72879e3..320f12ed577 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;