]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: translate group pool to name
authorVictor Denisov <denisovenator@gmail.com>
Sun, 7 Jan 2018 22:31:25 +0000 (14:31 -0800)
committerJason Dillaman <dillaman@redhat.com>
Thu, 11 Jan 2018 15:38:23 +0000 (10:38 -0500)
Signed-off-by: Victor Denisov <denisovenator@gmail.com>
src/tools/rbd/action/Info.cc

index 127357ebbb93b2093a11fb9388148ff63fe8010a..1d9914dfe18fc486ad472d2d3ac025d268468c46 100644 (file)
@@ -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 = "<missing group pool " + stringify(group_spec.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);