]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tool/bluestore-tool: print target path for bluestore symlinks. 23103/head
authorIgor Fedotov <ifedotov@suse.com>
Mon, 15 Oct 2018 15:47:28 +0000 (18:47 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Wed, 17 Oct 2018 19:39:27 +0000 (22:39 +0300)
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
src/os/bluestore/bluestore_tool.cc

index 601b72879e3295cd14a08be132ad2498c84b262b..320f12ed577dbc7910ef6480f9da193e59eec313 100644 (file)
@@ -145,7 +145,20 @@ void add_devices(
   map<string, int> 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;