]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: --max_part and --nbds_max options for nbd map 12426/head
authorPan Liu <pan.liu@istuary.com>
Thu, 8 Dec 2016 12:03:30 +0000 (20:03 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 9 Dec 2016 23:15:14 +0000 (00:15 +0100)
Fixes: http://tracker.ceph.com/issues/18186
Signed-off-by: Pan Liu <pan.liu@istuary.com>
(cherry picked from commit 45ceb389b685a5ec7bc0b8ef9e180ce851646082)

Conflicts:
src/test/cli/rbd/help.t (no --exclusive in jewel-next)
src/tools/rbd/action/Nbd.cc (no --exclusive in jewel-next)

src/test/cli/rbd/help.t
src/tools/rbd/action/Nbd.cc

index 6c86a413a3d5bc537a6379699173141391d9c7d1..9c7bd9e55411083efdc907e5a239df7ed1b40502 100644 (file)
   
   rbd help nbd map
   usage: rbd nbd map [--pool <pool>] [--image <image>] [--snap <snap>] 
-                     [--read-only] [--device <device>] 
+                     [--read-only] [--device <device>] [--nbds_max <nbds_max>] 
+                     [--max_part <max_part>] 
                      <image-or-snap-spec> 
   
   Map image to a nbd device.
     --snap arg            snapshot name
     --read-only           mount read-only
     --device arg          specify nbd device
+    --nbds_max arg        override module param nbds_max
+    --max_part arg        override module param max_part
   
   rbd help nbd unmap
   usage: rbd nbd unmap 
index 478e42ae9648996f4f2d6158b1c5c9cf74632f72..32710969b84a917e7d3599036e82aaf2d4d43c13 100644 (file)
@@ -100,7 +100,9 @@ void get_map_arguments(po::options_description *positional,
                                      at::ARGUMENT_MODIFIER_NONE);
   options->add_options()
     ("read-only", po::bool_switch(), "mount read-only")
-    ("device", po::value<std::string>(), "specify nbd device");
+    ("device", po::value<std::string>(), "specify nbd device")
+    ("nbds_max", po::value<std::string>(), "override module param nbds_max")
+    ("max_part", po::value<std::string>(), "override module param max_part");
 }
 
 int execute_map(const po::variables_map &vm)
@@ -137,6 +139,14 @@ int execute_map(const po::variables_map &vm)
     args.push_back("--device");
     args.push_back(vm["device"].as<std::string>().c_str());
   }
+  if (vm.count("nbds_max")) {
+    args.push_back("--nbds_max");
+    args.push_back(vm["nbds_max"].as<std::string>().c_str());
+  }
+  if (vm.count("max_part")) {
+    args.push_back("--max_part");
+    args.push_back(vm["max_part"].as<std::string>().c_str());
+  }
 
   return call_nbd_cmd(vm, args);
 }