]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: --max_part and --nbds_max options for nbd map 12379/head
authorPan Liu <pan.liu@istuary.com>
Thu, 8 Dec 2016 12:03:30 +0000 (20:03 +0800)
committerPan Liu <pan.liu@istuary.com>
Thu, 8 Dec 2016 12:03:30 +0000 (20:03 +0800)
Fixes: http://tracker.ceph.com/issues/18186
Signed-off-by: Pan Liu <pan.liu@istuary.com>
src/test/cli/rbd/help.t
src/tools/rbd/action/Nbd.cc

index 750af9311c181ff1b8b0d4ffba6d3990eb58149f..df8ad63f851b4d7bc9726ea8e99f42c4b43c7125 100644 (file)
   rbd help nbd map
   usage: rbd nbd map [--pool <pool>] [--image <image>] [--snap <snap>] 
                      [--read-only] [--exclusive] [--device <device>] 
+                     [--nbds_max <nbds_max>] [--max_part <max_part>] 
                      <image-or-snap-spec> 
   
   Map image to a nbd device.
     --read-only           mount read-only
     --exclusive           forbid other clients write
     --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 adc10110ff562331e5a05a88ea0f5f5ddd0223e1..ab8db1f6f92177b48340a9d11a36052e45fcdc5f 100644 (file)
@@ -101,7 +101,9 @@ void get_map_arguments(po::options_description *positional,
   options->add_options()
     ("read-only", po::bool_switch(), "mount read-only")
     ("exclusive", po::bool_switch(), "forbid other clients write")
-    ("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)
@@ -141,6 +143,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);
 }