mirror of
https://github.com/ceph/ceph
synced 2025-02-24 11:37:37 +00:00
tool/bluestore-tool: print target path for bluestore symlinks.
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
This commit is contained in:
parent
02b5768a4f
commit
91c73df113
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user