From bf5863baf5ec242cfd770c82395d36c53d5c0769 Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Tue, 25 May 2021 13:43:52 +0200 Subject: [PATCH] doc/rbd: document cp versus deep cp I found that the difference between "rbd cp" and "rbd deep cp", i.e. what "deep" means in this context, is documented only in the mailing list archive and in the Mimic reelase notes. Let's make the difference explicit in the manpage and in rbd --help. Signed-off-by: Jan "Yenya" Kasprzak --- doc/man/8/rbd.rst | 2 ++ src/test/cli/rbd/help.t | 5 +++-- src/tools/rbd/action/Copy.cc | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/man/8/rbd.rst b/doc/man/8/rbd.rst index cdef0ef4d60..7c61d0a5dd7 100644 --- a/doc/man/8/rbd.rst +++ b/doc/man/8/rbd.rst @@ -237,6 +237,8 @@ Commands :command:`cp` (*src-image-spec* | *src-snap-spec*) *dest-image-spec* Copy the content of a src-image into the newly created dest-image. dest-image will have the same size, object size, and image format as src-image. + Note: snapshots are not copied, use `deep cp` command to include + snapshots. :command:`create` (-s | --size *size-in-M/G/T*) [--image-format *format-id*] [--object-size *size-in-B/K/M*] [--stripe-unit *size-in-B/K/M* --stripe-count *num*] [--thick-provision] [--no-progress] [--image-feature *feature-name*]... [--image-shared] *image-spec* Will create a new rbd image. You must also specify the size via --size. The diff --git a/src/test/cli/rbd/help.t b/src/test/cli/rbd/help.t index 993ed2a1d7b..3f4c5437787 100644 --- a/src/test/cli/rbd/help.t +++ b/src/test/cli/rbd/help.t @@ -26,7 +26,8 @@ config pool set Set a pool-level configuration override. copy (cp) Copy src image to dest. create Create an empty image. - deep copy (deep cp) Deep copy src image to dest. + deep copy (deep cp) Deep copy (including snapshots) src image + to dest. device attach Attach image to device. device detach Detach image from device. device list (showmapped) List mapped rbd images. @@ -533,7 +534,7 @@ [--no-progress] - Deep copy src image to dest. + Deep copy (including snapshots) src image to dest. Positional arguments source image or snapshot specification diff --git a/src/tools/rbd/action/Copy.cc b/src/tools/rbd/action/Copy.cc index 9a248437109..9e42c06529d 100644 --- a/src/tools/rbd/action/Copy.cc +++ b/src/tools/rbd/action/Copy.cc @@ -187,7 +187,7 @@ int execute_deep(const po::variables_map &vm, } Shell::Action action_deep( - {"deep", "copy"}, {"deep", "cp"}, "Deep copy src image to dest.", + {"deep", "copy"}, {"deep", "cp"}, "Deep copy (including snapshots) src image to dest.", at::get_long_features_help(), &get_arguments_deep, &execute_deep); } // namespace copy -- 2.39.5