From 0ddc684b6c2e228aa9c81dab6a242ab5783fc91a Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Fri, 16 Feb 2018 15:48:46 +0200 Subject: [PATCH] rbd: show when parent is migration source in info output Signed-off-by: Mykola Golub --- src/tools/rbd/action/Info.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tools/rbd/action/Info.cc b/src/tools/rbd/action/Info.cc index db8de5778378d..df8b09aabc6be 100644 --- a/src/tools/rbd/action/Info.cc +++ b/src/tools/rbd/action/Info.cc @@ -295,14 +295,20 @@ static int do_show_info(librados::IoCtx &io_ctx, librbd::Image& image, if (trash_image_info_valid) { f->dump_string("trash", parent_id); } + if ((features & RBD_FEATURE_MIGRATING) != 0) { + f->dump_bool("migration_source", true); + } f->dump_unsigned("overlap", overlap); f->close_section(); } else { std::cout << "\tparent: " << parent_pool << "/" << parent_name - << "@" << parent_snapname; + << (parent_snapname.empty() ? "" : "@") << parent_snapname; if (trash_image_info_valid) { std::cout << " (trash " << parent_id << ")"; } + if ((features & RBD_FEATURE_MIGRATING) != 0) { + std::cout << " (migration source)"; + } std::cout << std::endl; std::cout << "\toverlap: " << byte_u_t(overlap) << std::endl; } -- 2.39.5