]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rbd: improve mirror image status and validation error messages 68015/head
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 26 Mar 2026 18:44:45 +0000 (00:14 +0530)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 26 Mar 2026 18:59:50 +0000 (00:29 +0530)
commit9b9a23727f2ae92566a6aeda06262696ec37171d
tree6c24b9ac0120930a79279fd208191b2c9784d270
parenta50a27312f52a347c0e7ecda1a36a7f375a8fb98
rbd: improve mirror image status and validation error messages

When a mirror image is left in a transitional state such as DISABLING,
the current mirror image status command reports:

  $ rbd mirror image status test_pool/test_image1
  rbd: mirroring not enabled on the image

This is the same message shown when mirroring is disabled or not yet
enabled, which can give the impression that mirroring is already
disabled.

Improve the validation logic and error messages to distinguish between
the DISABLED state and other non-enabled states, and include the image
name and current state in the output.

Examples:

When the image is completely disabled:

  $ rbd mirror image status test_pool/test_image1
  rbd: mirroring disabled on image 'test_image1'

When the image is in a transitional state (ex: DISABLING):

  $ rbd mirror image status test_pool/test_image1
  rbd: mirroring not enabled on image 'test_image1' (state: disabling)

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
src/tools/rbd/action/MirrorImage.cc