From: Victor Denisov Date: Sun, 7 Jan 2018 22:31:25 +0000 (-0800) Subject: rbd: translate group pool to name X-Git-Tag: v13.0.2~545^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=85f0348e3c90ba8478bbbcb3ac06546945012727;p=ceph.git rbd: translate group pool to name Signed-off-by: Victor Denisov --- diff --git a/src/tools/rbd/action/Info.cc b/src/tools/rbd/action/Info.cc index 127357ebbb9..1d9914dfe18 100644 --- a/src/tools/rbd/action/Info.cc +++ b/src/tools/rbd/action/Info.cc @@ -137,8 +137,19 @@ static int do_show_info(librados::IoCtx &io_ctx, librbd::Image& image, } std::string group_string = ""; - if (RBD_GROUP_INVALID_POOL != group_spec.pool) - group_string = group_spec.pool + "/" + group_spec.name; + if (RBD_GROUP_INVALID_POOL != group_spec.pool) { + std::string group_pool; + librados::Rados rados(io_ctx); + librados::IoCtx group_io_ctx; + r = rados.ioctx_create2(group_spec.pool, group_io_ctx); + if (r < 0) { + group_pool = ""; + } else { + group_pool = group_io_ctx.get_pool_name(); + } + + group_string = group_pool + "/" + group_spec.name; + } struct timespec create_timestamp; image.get_create_timestamp(&create_timestamp);