]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: use image-spec and snap-spec in rbd help
authorVikhyat Umrao <vumrao@redhat.com>
Thu, 16 Jul 2015 16:09:54 +0000 (21:39 +0530)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 27 Jul 2015 09:22:04 +0000 (12:22 +0300)
This patch changes image-name instances to image-spec and snap-name
instances to snap-spec to try to clarify usage for some commands and
disambiguate the term {image,snap}-name, which has been used to denote
both simple names and compound names (specs).

<image-spec> is [<pool-name>]/<image-name>
<snap-spec> is [<pool-name>]/<image-name>@<snap-name>

This patch also removes duplicate checks for image-name and snap-name.

Signed-off-by: Vikhyat Umrao <vumrao@redhat.com>
[idryomov@gmail.com: some commands take either image-spec or snap-spec,
other fixes, formatting, changelog]
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
doc/man/8/rbd.rst
src/common/ceph_argparse.cc
src/rbd.cc
src/test/cli/rbd/help.t

index e7724146e5613606a62aa6919d8868ecff736e58..b20a5f1a7e5406639e72ad0c305f6873fceef0fe 100644 (file)
@@ -35,7 +35,7 @@ Options
 
    Connect to specified monitor (instead of looking through ceph.conf).
 
-.. option:: -p pool, --pool pool
+.. option:: -p pool-name, --pool pool-name
 
    Interact with the given pool. Required by most commands.
 
@@ -170,16 +170,17 @@ Commands
 
   If the RBD fast-diff feature isn't enabled on images, this operation will
   require querying the OSDs for every potential object within the image.
-:command:`info` [*image-name*]
+
+:command:`info` [*image-spec*] | [*snap-spec*]
   Will dump information (such as size and order) about a specific rbd image.
   If image is a clone, information about its parent is also displayed.
   If a snapshot is specified, whether it is protected is shown as well.
 
-:command:`create` [*image-name*]
+:command:`create` [*image-spec*]
   Will create a new rbd image. You must also specify the size via --size.  The
   --stripe-unit and --stripe-count arguments are optional, but must be used together.
 
-:command:`clone` [*parent-snapname*] [*image-name*]
+:command:`clone` [*parent-snap-spec*] [*child-image-spec*]
   Will create a clone (copy-on-write child) of the parent snapshot.
   Object order will be identical to that of the parent image unless
   specified. Size will be the same as the parent snapshot. The --stripe-unit
@@ -188,7 +189,7 @@ Commands
   The parent snapshot must be protected (see `rbd snap protect`).
   This requires image format 2.
 
-:command:`flatten` [*image-name*]
+:command:`flatten` [*image-spec*]
   If image is a clone, copy all shared blocks from the parent snapshot and
   make the child independent of the parent, severing the link between
   parent snap and child.  The parent snapshot can be unprotected and
@@ -196,24 +197,24 @@ Commands
 
   This requires image format 2.
 
-:command:`children` [*image-name*]
+:command:`children` [*snap-spec*]
   List the clones of the image at the given snapshot. This checks
   every pool, and outputs the resulting poolname/imagename.
 
   This requires image format 2.
 
-:command:`resize` [*image-name*] [--allow-shrink]
+:command:`resize` [*image-spec*] [--allow-shrink]
   Resizes rbd image. The size parameter also needs to be specified.
   The --allow-shrink option lets the size be reduced.
 
-:command:`rm` [*image-name*]
+:command:`rm` [*image-spec*]
   Deletes an rbd image (including all data blocks). If the image has
   snapshots, this fails and nothing is deleted.
 
-:command:`export` [*image-name*] [*dest-path*]
+:command:`export` ([*image-spec*] | [*snap-spec*]) [*dest-path*]
   Exports image to dest path (use - for stdout).
 
-:command:`import` [*path*] [*dest-image*]
+:command:`import` [*path*] [*image-spec*]
   Creates a new image and imports its data from path (use - for
   stdin).  The import operation will try to create sparse rbd images 
   if possible.  For import from stdin, the sparsification unit is
@@ -222,7 +223,7 @@ Commands
   The --stripe-unit and --stripe-count arguments are optional, but must be
   used together.
 
-:command:`export-diff` [*image-name*] [*dest-path*] [--from-snap *snapname*] [--object-extents]
+:command:`export-diff` ([*image-spec*] | [*snap-spec*]) [*dest-path*] [--from-snap *snap-name*] [--object-extents]
   Exports an incremental diff for an image to dest path (use - for stdout).  If
   an initial snapshot is specified, only changes since that snapshot are included; otherwise,
   any regions of the image that contain data are included.  The end snapshot is specified
@@ -238,59 +239,59 @@ Commands
   'rbd merge-diff first second - | rbd merge-diff - third result'. Note this command
   currently only support the source incremental diff with stripe_count == 1
 
-:command:`import-diff` [*src-path*] [*image-name*]
+:command:`import-diff` [*src-path*] [*image-spec*]
   Imports an incremental diff of an image and applies it to the current image.  If the diff
   was generated relative to a start snapshot, we verify that snapshot already exists before
   continuing.  If there was an end snapshot we verify it does not already exist before
   applying the changes, and create the snapshot when we are done.
 
-:command:`diff` [*image-name*] [--from-snap *snapname*] [--object-extents]
+:command:`diff` [*image-spec*] | [*snap-spec*] [--from-snap *snap-name*] [--object-extents]
   Dump a list of byte extents in the image that have changed since the specified start
   snapshot, or since the image was created.  Each output line includes the starting offset
   (in bytes), the length of the region (in bytes), and either 'zero' or 'data' to indicate
   whether the region is known to be zeros or may contain other data.
 
-:command:`cp` [*src-image*] [*dest-image*]
+:command:`cp` ([*src-image-spec*] | [*src-snap-spec*]) [*dest-image-spec*]
   Copies the content of a src-image into the newly created dest-image.
   dest-image will have the same size, order, and image format as src-image.
 
-:command:`mv` [*src-image*] [*dest-image*]
+:command:`mv` [*src-image-spec*] [*dest-image-spec*]
   Renames an image.  Note: rename across pools is not supported.
 
-:command:`image-meta list` [*image-name*]
+:command:`image-meta list` [*image-spec*]
   Show metadata held on the image. The first column is the key
   and the second column is the value.
 
-:command:`image-meta get` [*image-name*] [*key*]
+:command:`image-meta get` [*image-spec*] [*key*]
   Get metadata value with the key.
 
-:command:`image-meta set` [*image-name*] [*key*] [*value*]
+:command:`image-meta set` [*image-spec*] [*key*] [*value*]
   Set metadata key with the value. They will displayed in `metadata-list`
 
-:command:`image-meta remove` [*image-name*] [*key*]
+:command:`image-meta remove` [*image-spec*] [*key*]
   Remove metadata key with the value.
 
-:command:`object-map` rebuild [*image-name*]
+:command:`object-map` rebuild [*image-spec*] | [*snap-spec*]
   Rebuilds an invalid object map for the specified image. An image snapshot can be
   specified to rebuild an invalid object map for a snapshot.
 
-:command:`snap` ls [*image-name*]
+:command:`snap` ls [*image-spec*]
   Dumps the list of snapshots inside a specific image.
 
-:command:`snap` create [*image-name*]
+:command:`snap` create [*snap-spec*]
   Creates a new snapshot. Requires the snapshot name parameter specified.
 
-:command:`snap` rollback [*image-name*]
+:command:`snap` rollback [*snap-spec*]
   Rollback image content to snapshot. This will iterate through the entire blocks
   array and update the data head content to the snapshotted version.
 
-:command:`snap` rm [*image-name*]
+:command:`snap` rm [*snap-spec*]
   Removes the specified snapshot.
 
-:command:`snap` purge [*image-name*]
+:command:`snap` purge [*image-spec*]
   Removes all snapshots from an image.
 
-:command:`snap` protect [*image-name*]
+:command:`snap` protect [*snap-spec*]
   Protect a snapshot from deletion, so that clones can be made of it
   (see `rbd clone`).  Snapshots must be protected before clones are made;
   protection implies that there exist dependent cloned children that
@@ -299,38 +300,38 @@ Commands
 
   This requires image format 2.
 
-:command:`snap` unprotect [*image-name*]
+:command:`snap` unprotect [*snap-spec*]
   Unprotect a snapshot from deletion (undo `snap protect`).  If cloned
   children remain, `snap unprotect` fails.  (Note that clones may exist
   in different pools than the parent snapshot.)
 
   This requires image format 2.
 
-:command:`map` [*image-name*] [-o | --options *map-options* ] [--read-only]
+:command:`map` [*image-spec*] | [*snap-spec*] [-o | --options *map-options* ] [--read-only]
   Maps the specified image to a block device via the rbd kernel module.
 
-:command:`unmap` [*image-name*] | [*device-path*]
+:command:`unmap` [*image-spec*] | [*snap-spec*] | [*device-path*]
   Unmaps the block device that was mapped via the rbd kernel module.
 
 :command:`showmapped`
   Show the rbd images that are mapped via the rbd kernel module.
 
-:command:`status` [*image-name*]
+:command:`status` [*image-spec*]
   Show the status of the image, including which clients have it open.
 
-:command:`feature` disable [*image-name*] [*feature*]
+:command:`feature` disable [*image-spec*] [*feature*]
   Disables the specified feature on the specified image. Multiple features can
   be specified.
 
-:command:`feature` enable [*image-name*] [*feature*]
+:command:`feature` enable [*image-spec*] [*feature*]
   Enables the specified feature on the specified image. Multiple features can
   be specified.
 
-:command:`lock` list [*image-name*]
+:command:`lock` list [*image-spec*]
   Show locks held on the image. The first column is the locker
   to use with the `lock remove` command.
 
-:command:`lock` add [*image-name*] [*lock-id*]
+:command:`lock` add [*image-spec*] [*lock-id*]
   Lock an image. The lock-id is an arbitrary name for the user's
   convenience. By default, this is an exclusive lock, meaning it
   will fail if the image is already locked. The --shared option
@@ -338,26 +339,26 @@ Commands
   any operation other than adding a lock. It does not
   protect an image from being deleted.
 
-:command:`lock` remove [*image-name*] [*lock-id*] [*locker*]
+:command:`lock` remove [*image-spec*] [*lock-id*] [*locker*]
   Release a lock on an image. The lock id and locker are
   as output by lock ls.
 
-:command:`bench-write` [*image-name*] --io-size [*io-size-in-bytes*] --io-threads [*num-ios-in-flight*] --io-total [*total-bytes-to-write*]
+:command:`bench-write` [*image-spec*] --io-size [*io-size-in-bytes*] --io-threads [*num-ios-in-flight*] --io-total [*total-bytes-to-write*]
   Generate a series of sequential writes to the image and measure the
   write throughput and latency.  Defaults are: --io-size 4096, --io-threads 16, 
   --io-total 1GB
 
-Image name
-==========
-
-In addition to using the --pool and the --snap options, the image name can include both
-the pool name and the snapshot name. The image name format is as follows::
+Image and snap specs
+====================
 
-       [pool/]image-name[@snap]
+| *image-spec* is [*pool-name*]/*image-name*
+| *snap-spec*  is [*pool-name*]/*image-name*\ @\ *snap-name*
 
-Thus an image name that contains a slash character ('/') requires specifying the pool
-name explicitly.
+The default for *pool-name* is "rbd".  If an image name contains a slash
+character ('/'), *pool-name* is required.
 
+You may specify each name individually, using --pool, --image and --snap
+options, but this is discouraged in favor of the above spec syntax.
 
 Striping
 ========
index 924b68077f2be9a58d3901245d074b481f34b400..858882baf0efded1de65551a5203d1e523cf495b 100644 (file)
@@ -367,7 +367,7 @@ static int va_ceph_argparse_witharg(std::vector<const char*> &args,
       else if (first[strlen_a] == '\0') {
        // find second part (or not)
        if (i+1 == args.end()) {
-         oss << "Option " << *i << " requires an argument.";
+         oss << "Option " << *i << " requires an argument." << std::endl;
          i = args.erase(i);
          return -EINVAL;
        }
index ca8bb3c211299a180f7018065595fb78ec737f86..d2f6dac2a2fb5589cc8c1e21e6fceb4b613331a5 100644 (file)
@@ -91,82 +91,88 @@ void usage()
   cout <<
 "usage: rbd [-n <auth user>] [OPTIONS] <cmd> ...\n"
 "where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of:\n"
-"  (ls | list) [-l | --long ] [pool-name] list rbd images\n"
+"  (ls | list) [-l | --long ] [pool-name]      list rbd images\n"
 "                                              (-l includes snapshots/clones)\n"
 "  (du | disk-usage) [--image <name>] [pool-name]\n"
 "                                              show pool image disk usage stats\n"
-"  info <image-name>                           show information about image size,\n"
+"  info <image-spec> | <snap-spec>             show information about image size,\n"
 "                                              striping, etc.\n"
 "  create [--order <bits>] [--image-features <features>] [--image-shared]\n"
-"         --size <M/G/T> <image-name>          create an empty image\n"
+"         --size <M/G/T> <image-spec>          create an empty image\n"
 "  clone [--order <bits>] [--image-features <features>] [--image-shared]\n"
-"        <parentsnap> <clonename>              clone a snapshot into a COW\n"
+"         <parent-snap-spec> <child-image-spec>\n"
+"                                              clone a snapshot into a COW\n"
 "                                              child image\n"
-"  children <snap-name>                        display children of snapshot\n"
-"  flatten <image-name>                        fill clone with parent data\n"
+"  children <snap-spec>                        display children of snapshot\n"
+"  flatten <image-spec>                        fill clone with parent data\n"
 "                                              (make it independent)\n"
-"  resize --size <M/G/T> <image-name>          resize (expand or contract) image\n"
-"  rm <image-name>                             delete an image\n"
-"  export <image-name> <path>                  export image to file\n"
+"  resize --size <M/G/T> <image-spec>          resize (expand or contract) image\n"
+"  rm <image-spec>                             delete an image\n"
+"  export (<image-spec> | <snap-spec>) <path>  export image to file\n"
 "                                              \"-\" for stdout\n"
 "  import [--image-features <features>] [--image-shared]\n"
-"         <path> <image-name>                  import image from file (dest\n"
+"         <path> <image-spec>                  import image from file (dest\n"
 "                                              defaults as the filename part\n"
 "                                              of file). \"-\" for stdin\n"
-"  diff [--from-snap <snap-name>] [--object-extents] <image-name>\n"
-"                                              print extents that differ since\n"
+"  diff [--from-snap <snap-name>] [--object-extents]\n"
+"         <image-spec> | <snap-spec>           print extents that differ since\n"
 "                                              a previous snap, or image creation\n"
-"  export-diff [--from-snap <snap-name>] [--object-extents] <image-name> <path>\n"
-"                                              export an incremental diff to\n"
+"  export-diff [--from-snap <snap-name>] [--object-extents]\n"
+"         (<image-spec> | <snap-spec>) <path>  export an incremental diff to\n"
 "                                              path, or \"-\" for stdout\n"
 "  merge-diff <diff1> <diff2> <path>           merge <diff1> and <diff2> into\n"
 "                                              <path>, <diff1> could be \"-\"\n"
 "                                              for stdin, and <path> could be \"-\"\n"
 "                                              for stdout\n"
-"  import-diff <path> <image-name>             import an incremental diff from\n"
+"  import-diff <path> <image-spec>             import an incremental diff from\n"
 "                                              path or \"-\" for stdin\n"
-"  (cp | copy) <src> <dest>                    copy src image to dest\n"
-"  (mv | rename) <src> <dest>                  rename src image to dest\n"
-"  image-meta list <image-name>                image metadata list keys with values\n"
-"  image-meta get <image-name> <key>           image metadata get the value associated with the key\n"
-"  image-meta set <image-name> <key> <value>   image metadata set key with value\n"
-"  image-meta remove <image-name> <key>        image metadata remove the key and value associated\n"
-"  object-map rebuild <image-name>             rebuild an invalid object map\n"
-"  snap ls <image-name>                        dump list of image snapshots\n"
-"  snap create <snap-name>                     create a snapshot\n"
-"  snap rollback <snap-name>                   rollback image to snapshot\n"
-"  snap rm <snap-name>                         deletes a snapshot\n"
-"  snap purge <image-name>                     deletes all snapshots\n"
-"  snap protect <snap-name>                    prevent a snapshot from being deleted\n"
-"  snap unprotect <snap-name>                  allow a snapshot to be deleted\n"
-"  watch <image-name>                          watch events on image\n"
-"  status <image-name>                         show the status of this image\n"
-"  map <image-name>                            map image to a block device\n"
+"  (cp | copy) (<src-image-spec> | <src-snap-spec>) <dest-image-spec>\n"
+"                                              copy src image to dest\n"
+"  (mv | rename) <src-image-spec> <dest-image-spec>\n"
+"                                              rename src image to dest\n"
+"  image-meta list <image-spec>                image metadata list keys with values\n"
+"  image-meta get <image-spec> <key>           image metadata get the value associated with the key\n"
+"  image-meta set <image-spec> <key> <value>   image metadata set key with value\n"
+"  image-meta remove <image-spec> <key>        image metadata remove the key and value associated\n"
+"  object-map rebuild <image-spec> | <snap-spec>\n"
+"                                              rebuild an invalid object map\n"
+"  snap ls <image-spec>                        dump list of image snapshots\n"
+"  snap create <snap-spec>                     create a snapshot\n"
+"  snap rollback <snap-spec>                   rollback image to snapshot\n"
+"  snap rm <snap-spec>                         deletes a snapshot\n"
+"  snap purge <image-spec>                     deletes all snapshots\n"
+"  snap protect <snap-spec>                    prevent a snapshot from being deleted\n"
+"  snap unprotect <snap-spec>                  allow a snapshot to be deleted\n"
+"  watch <image-spec>                          watch events on image\n"
+"  status <image-spec>                         show the status of this image\n"
+"  map <image-spec> | <snap-spec>              map image to a block device\n"
 "                                              using the kernel\n"
-"  unmap <image-name> | <device>               unmap a rbd device that was\n"
+"  unmap <image-spec> | <snap-spec> | <device> unmap a rbd device that was\n"
 "                                              mapped by the kernel\n"
 "  showmapped                                  show the rbd images mapped\n"
 "                                              by the kernel\n"
-"  feature disable <image-name> <feature>      disable the specified image feature\n"
-"  feature enable <image-name> <feature>       enable the specified image feature\n"
-"  lock list <image-name>                      show locks held on an image\n"
-"  lock add <image-name> <id> [--shared <tag>] take a lock called id on an image\n"
-"  lock remove <image-name> <id> <locker>      release a lock on an image\n"
-"  bench-write <image-name>                    simple write benchmark\n"
+"  feature disable <image-spec> <feature>      disable the specified image feature\n"
+"  feature enable <image-spec> <feature>       enable the specified image feature\n"
+"  lock list <image-spec>                      show locks held on an image\n"
+"  lock add <image-spec> <id> [--shared <tag>] take a lock called id on an image\n"
+"  lock remove <image-spec> <id> <locker>      release a lock on an image\n"
+"  bench-write <image-spec>                    simple write benchmark\n"
 "                 --io-size <bytes>              write size\n"
 "                 --io-threads <num>             ios in flight\n"
 "                 --io-total <bytes>             total bytes to write\n"
 "                 --io-pattern <seq|rand>        write pattern\n"
 "\n"
-"<image-name>, <snap-name> are [pool/]name[@snap], or you may specify\n"
-"individual pieces of names with -p/--pool, --image, and/or --snap.\n"
+"<image-spec> is [<pool-name>]/<image-name>,\n"
+"<snap-spec> is [<pool-name>]/<image-name>@<snap-name>,\n"
+"or you may specify individual pieces of names with -p/--pool <pool-name>,\n"
+"--image <image-name> and/or --snap <snap-name>.\n"
 "\n"
 "Other input options:\n"
-"  -p, --pool <pool>                  source pool name\n"
+"  -p, --pool <pool-name>             source pool name\n"
+"  --dest-pool <pool-name>            destination pool name\n"
 "  --image <image-name>               image name\n"
-"  --dest <image-name>                destination [pool and] image name\n"
+"  --dest <image-name>                destination image name\n"
 "  --snap <snap-name>                 snapshot name\n"
-"  --dest-pool <name>                 destination pool name\n"
 "  --path <path-name>                 path name for import/export\n"
 "  -s, --size <size in M/G/T>         size of image for create and resize\n"
 "  --order <bits>                     the object size in bits; object size will be\n"
@@ -3294,11 +3300,6 @@ if (!set_conf_param(v, p1, p2, p3)) { \
     }
   }
 
-  if (opt_cmd == OPT_EXPORT && !imgname) {
-    cerr << "rbd: image name was not specified" << std::endl;
-    return EXIT_FAILURE;
-  }
-
   if ((opt_cmd == OPT_IMPORT || opt_cmd == OPT_IMPORT_DIFF) && !path) {
     cerr << "rbd: path was not specified" << std::endl;
     return EXIT_FAILURE;
@@ -3663,10 +3664,6 @@ if (!set_conf_param(v, p1, p2, p3)) { \
     break;
 
   case OPT_SNAP_LIST:
-    if (!imgname) {
-      cerr << "rbd: snap list requires an image parameter" << std::endl;
-      return EXIT_FAILURE;
-    }
     r = do_list_snaps(image, formatter.get());
     if (r < 0) {
       cerr << "rbd: failed to list snapshots: " << cpp_strerror(-r)
@@ -3676,10 +3673,6 @@ if (!set_conf_param(v, p1, p2, p3)) { \
     break;
 
   case OPT_SNAP_CREATE:
-    if (!imgname || !snapname) {
-      cerr << "rbd: snap create requires image and snapname" << std::endl;
-      return EINVAL;
-    }
     r = do_add_snap(image, snapname);
     if (r < 0) {
       cerr << "rbd: failed to create snapshot: " << cpp_strerror(-r)
@@ -3689,10 +3682,6 @@ if (!set_conf_param(v, p1, p2, p3)) { \
     break;
 
   case OPT_SNAP_ROLLBACK:
-    if (!imgname) {
-      cerr << "rbd: snap rollback requires image name" << std::endl;
-      return EINVAL;
-    }
     r = do_rollback_snap(image, snapname);
     if (r < 0) {
       cerr << "rbd: rollback failed: " << cpp_strerror(-r) << std::endl;
@@ -3701,10 +3690,6 @@ if (!set_conf_param(v, p1, p2, p3)) { \
     break;
 
   case OPT_SNAP_REMOVE:
-    if (!imgname) {
-      cerr << "rbd: snap remove requires image name" << std::endl;
-      return EINVAL;
-    }
     r = do_remove_snap(image, snapname);
     if (r < 0) {
       if (r == -EBUSY) {
@@ -3719,10 +3704,6 @@ if (!set_conf_param(v, p1, p2, p3)) { \
     break;
 
   case OPT_SNAP_PURGE:
-    if (!imgname) {
-      cerr << "rbd: snap purge requires image name" << std::endl;
-      return EINVAL;
-    }
     r = do_purge_snaps(image);
     if (r < 0) {
       cerr << "rbd: removing snaps failed: " << cpp_strerror(-r) << std::endl;
@@ -3731,10 +3712,6 @@ if (!set_conf_param(v, p1, p2, p3)) { \
     break;
 
   case OPT_SNAP_PROTECT:
-    if (!imgname) {
-      cerr << "rbd: snap protect requires image name" << std::endl;
-      return EINVAL;
-    }
     r = do_protect_snap(image, snapname);
     if (r < 0) {
       cerr << "rbd: protecting snap failed: " << cpp_strerror(-r) << std::endl;
@@ -3743,10 +3720,6 @@ if (!set_conf_param(v, p1, p2, p3)) { \
     break;
 
   case OPT_SNAP_UNPROTECT:
-    if (!imgname) {
-      cerr << "rbd: snap unprotect requires image name" << std::endl;
-      return EINVAL;
-    }
     r = do_unprotect_snap(image, snapname);
     if (r < 0) {
       cerr << "rbd: unprotecting snap failed: " << cpp_strerror(-r)
index 19b4879fb5f4363b3ad6c48216e44142425f5248..d38c28e6969f0e36e23728d7ac8966840d59c915 100644 (file)
@@ -1,82 +1,88 @@
   $ rbd --help
   usage: rbd [-n <auth user>] [OPTIONS] <cmd> ...
   where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of:
-    (ls | list) [-l | --long ] [pool-name] list rbd images
+    (ls | list) [-l | --long ] [pool-name]      list rbd images
                                                 (-l includes snapshots/clones)
     (du | disk-usage) [--image <name>] [pool-name]
                                                 show pool image disk usage stats
-    info <image-name>                           show information about image size,
+    info <image-spec> | <snap-spec>             show information about image size,
                                                 striping, etc.
     create [--order <bits>] [--image-features <features>] [--image-shared]
-           --size <M/G/T> <image-name>          create an empty image
+           --size <M/G/T> <image-spec>          create an empty image
     clone [--order <bits>] [--image-features <features>] [--image-shared]
-          <parentsnap> <clonename>              clone a snapshot into a COW
+           <parent-snap-spec> <child-image-spec>
+                                                clone a snapshot into a COW
                                                 child image
-    children <snap-name>                        display children of snapshot
-    flatten <image-name>                        fill clone with parent data
+    children <snap-spec>                        display children of snapshot
+    flatten <image-spec>                        fill clone with parent data
                                                 (make it independent)
-    resize --size <M/G/T> <image-name>          resize (expand or contract) image
-    rm <image-name>                             delete an image
-    export <image-name> <path>                  export image to file
+    resize --size <M/G/T> <image-spec>          resize (expand or contract) image
+    rm <image-spec>                             delete an image
+    export (<image-spec> | <snap-spec>) <path>  export image to file
                                                 "-" for stdout
     import [--image-features <features>] [--image-shared]
-           <path> <image-name>                  import image from file (dest
+           <path> <image-spec>                  import image from file (dest
                                                 defaults as the filename part
                                                 of file). "-" for stdin
-    diff [--from-snap <snap-name>] [--object-extents] <image-name>
-                                                print extents that differ since
+    diff [--from-snap <snap-name>] [--object-extents]
+           <image-spec> | <snap-spec>           print extents that differ since
                                                 a previous snap, or image creation
-    export-diff [--from-snap <snap-name>] [--object-extents] <image-name> <path>
-                                                export an incremental diff to
+    export-diff [--from-snap <snap-name>] [--object-extents]
+           (<image-spec> | <snap-spec>) <path>  export an incremental diff to
                                                 path, or "-" for stdout
     merge-diff <diff1> <diff2> <path>           merge <diff1> and <diff2> into
                                                 <path>, <diff1> could be "-"
                                                 for stdin, and <path> could be "-"
                                                 for stdout
-    import-diff <path> <image-name>             import an incremental diff from
+    import-diff <path> <image-spec>             import an incremental diff from
                                                 path or "-" for stdin
-    (cp | copy) <src> <dest>                    copy src image to dest
-    (mv | rename) <src> <dest>                  rename src image to dest
-    image-meta list <image-name>                image metadata list keys with values
-    image-meta get <image-name> <key>           image metadata get the value associated with the key
-    image-meta set <image-name> <key> <value>   image metadata set key with value
-    image-meta remove <image-name> <key>        image metadata remove the key and value associated
-    object-map rebuild <image-name>             rebuild an invalid object map
-    snap ls <image-name>                        dump list of image snapshots
-    snap create <snap-name>                     create a snapshot
-    snap rollback <snap-name>                   rollback image to snapshot
-    snap rm <snap-name>                         deletes a snapshot
-    snap purge <image-name>                     deletes all snapshots
-    snap protect <snap-name>                    prevent a snapshot from being deleted
-    snap unprotect <snap-name>                  allow a snapshot to be deleted
-    watch <image-name>                          watch events on image
-    status <image-name>                         show the status of this image
-    map <image-name>                            map image to a block device
+    (cp | copy) (<src-image-spec> | <src-snap-spec>) <dest-image-spec>
+                                                copy src image to dest
+    (mv | rename) <src-image-spec> <dest-image-spec>
+                                                rename src image to dest
+    image-meta list <image-spec>                image metadata list keys with values
+    image-meta get <image-spec> <key>           image metadata get the value associated with the key
+    image-meta set <image-spec> <key> <value>   image metadata set key with value
+    image-meta remove <image-spec> <key>        image metadata remove the key and value associated
+    object-map rebuild <image-spec> | <snap-spec>
+                                                rebuild an invalid object map
+    snap ls <image-spec>                        dump list of image snapshots
+    snap create <snap-spec>                     create a snapshot
+    snap rollback <snap-spec>                   rollback image to snapshot
+    snap rm <snap-spec>                         deletes a snapshot
+    snap purge <image-spec>                     deletes all snapshots
+    snap protect <snap-spec>                    prevent a snapshot from being deleted
+    snap unprotect <snap-spec>                  allow a snapshot to be deleted
+    watch <image-spec>                          watch events on image
+    status <image-spec>                         show the status of this image
+    map <image-spec> | <snap-spec>              map image to a block device
                                                 using the kernel
-    unmap <image-name> | <device>               unmap a rbd device that was
+    unmap <image-spec> | <snap-spec> | <device> unmap a rbd device that was
                                                 mapped by the kernel
     showmapped                                  show the rbd images mapped
                                                 by the kernel
-    feature disable <image-name> <feature>      disable the specified image feature
-    feature enable <image-name> <feature>       enable the specified image feature
-    lock list <image-name>                      show locks held on an image
-    lock add <image-name> <id> [--shared <tag>] take a lock called id on an image
-    lock remove <image-name> <id> <locker>      release a lock on an image
-    bench-write <image-name>                    simple write benchmark
+    feature disable <image-spec> <feature>      disable the specified image feature
+    feature enable <image-spec> <feature>       enable the specified image feature
+    lock list <image-spec>                      show locks held on an image
+    lock add <image-spec> <id> [--shared <tag>] take a lock called id on an image
+    lock remove <image-spec> <id> <locker>      release a lock on an image
+    bench-write <image-spec>                    simple write benchmark
                    --io-size <bytes>              write size
                    --io-threads <num>             ios in flight
                    --io-total <bytes>             total bytes to write
                    --io-pattern <seq|rand>        write pattern
   
-  <image-name>, <snap-name> are [pool/]name[@snap], or you may specify
-  individual pieces of names with -p/--pool, --image, and/or --snap.
+  <image-spec> is [<pool-name>]/<image-name>,
+  <snap-spec> is [<pool-name>]/<image-name>@<snap-name>,
+  or you may specify individual pieces of names with -p/--pool <pool-name>,
+  --image <image-name> and/or --snap <snap-name>.
   
   Other input options:
-    -p, --pool <pool>                  source pool name
+    -p, --pool <pool-name>             source pool name
+    --dest-pool <pool-name>            destination pool name
     --image <image-name>               image name
-    --dest <image-name>                destination [pool and] image name
+    --dest <image-name>                destination image name
     --snap <snap-name>                 snapshot name
-    --dest-pool <name>                 destination pool name
     --path <path-name>                 path name for import/export
     -s, --size <size in M/G/T>         size of image for create and resize
     --order <bits>                     the object size in bits; object size will be