From 48b0a20bd42b5ec678f77bd7bd0ad5394a0a9bef Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Tue, 17 Sep 2024 14:48:03 +0530 Subject: [PATCH] rbd: display mirror uuid for mirror pool info output Includes the mirror_uuid in the mirror pool info command output. Signed-off-by: N Balachandran --- doc/man/8/rbd.rst | 4 ++-- src/tools/rbd/action/MirrorPool.cc | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/man/8/rbd.rst b/doc/man/8/rbd.rst index 24d4fa4a31d..4039e78fad3 100644 --- a/doc/man/8/rbd.rst +++ b/doc/man/8/rbd.rst @@ -543,9 +543,9 @@ Commands :command:`mirror pool info` [*pool-name*] Show information about the pool or namespace mirroring configuration. - For both pools and namespaces, it includes the mirroring mode + For both pools and namespaces, it includes the mirroring mode, mirror UUID and remote namespace. For pools, it additionally includes the site name, - peer UUID, mirror UUID, remote cluster name, and remote client name. + peer UUID, remote cluster name, and remote client name. :command:`mirror pool peer add` [*pool-name*] *remote-cluster-spec* Add a mirroring peer to a pool. diff --git a/src/tools/rbd/action/MirrorPool.cc b/src/tools/rbd/action/MirrorPool.cc index 88e578cba91..58e2d4dc329 100644 --- a/src/tools/rbd/action/MirrorPool.cc +++ b/src/tools/rbd/action/MirrorPool.cc @@ -1437,6 +1437,10 @@ int execute_info(const po::variables_map &vm, } if (mirror_mode != RBD_MIRROR_MODE_DISABLED) { + r = rbd.mirror_uuid_get(io_ctx, &mirror_uuid); + if (r < 0) { + return r; + } r = rbd.mirror_remote_namespace_get(io_ctx, &remote_namespace); if (r < 0) { return r; @@ -1475,8 +1479,10 @@ int execute_info(const po::variables_map &vm, } } if (formatter != nullptr) { + formatter->dump_string("mirror_uuid", mirror_uuid); formatter->dump_string("remote_namespace", remote_namespace); } else { + std::cout << "Mirror UUID: " << mirror_uuid << std::endl; std::cout << "Remote Namespace: " << remote_namespace << std::endl << std::endl; } -- 2.39.5