mirror of
https://github.com/ceph/ceph
synced 2025-02-23 19:17:37 +00:00
rbd: translate pool id into name
Signed-off-by: Victor Denisov <denisovenator@gmail.com>
This commit is contained in:
parent
85f0348e3c
commit
18ea889807
@ -295,12 +295,24 @@ int execute_list_images(const po::variables_map &vm) {
|
||||
if (GROUP_IMAGE_STATE_INCOMPLETE == state) {
|
||||
state_string = "incomplete";
|
||||
}
|
||||
|
||||
std::string pool_name = "";
|
||||
|
||||
librados::Rados rados(io_ctx);
|
||||
librados::IoCtx pool_io_ctx;
|
||||
r = rados.ioctx_create2(image.pool, pool_io_ctx);
|
||||
if (r < 0) {
|
||||
pool_name = "<missing data pool " + stringify(image.pool) + ">";
|
||||
} else {
|
||||
pool_name = pool_io_ctx.get_pool_name();
|
||||
}
|
||||
|
||||
if (f) {
|
||||
f->dump_string("image name", image_name);
|
||||
f->dump_int("pool", image.pool);
|
||||
f->dump_string("pool", pool_name);
|
||||
f->dump_int("state", state);
|
||||
} else
|
||||
std::cout << image.pool << "/" << image_name << " " << state_string << std::endl;
|
||||
std::cout << pool_name << "/" << image_name << " " << state_string << std::endl;
|
||||
}
|
||||
|
||||
if (f) {
|
||||
|
Loading…
Reference in New Issue
Block a user