]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rbd: add "help" command to rbd-wnbd
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 20 Nov 2020 07:06:39 +0000 (07:06 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Sun, 22 Nov 2020 17:37:13 +0000 (17:37 +0000)
At the moment, "rbd-wnbd" says that "help" is an unsupported command,
only "rbd-wnbd -h" works. This isn't very user friendly.

Although "rbd-wnbd" isn't supposed to be used directly in most cases,
users might want to retrieve device specific arguments that can be
passed using "rbd device -o".

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/tools/rbd_wnbd/rbd_wnbd.cc

index 2468a47324d4f781abd58c90bad2f3619bcc0592..fbf7392d18494488eec36bb9928bd43e683e313b 100644 (file)
@@ -590,7 +590,7 @@ Service options:
   --hard-disconnect           Skip attempting a soft disconnect
   --soft-disconnect-timeout   Cummulative soft disconnect timeout in seconds,
                               used when disconnecting existing mappings. A hard
-                              disconnect will be issuedwhen hitting the timeout.
+                              disconnect will be issued when hitting the timeout
   --service-thread-count      The number of workers used when mapping or
                               unmapping images. Default: 8
 
@@ -1138,6 +1138,8 @@ static int parse_args(std::vector<const char*>& args,
       cmd = Service;
     } else if (strcmp(*args.begin(), "stats") == 0) {
       cmd = Stats;
+    } else if (strcmp(*args.begin(), "help") == 0) {
+      return HELP_INFO;
     } else {
       *err_msg << "rbd-wnbd: unknown command: " <<  *args.begin();
       return -EINVAL;