From: Pan Liu Date: Thu, 8 Dec 2016 12:03:30 +0000 (+0800) Subject: rbd: --max_part and --nbds_max options for nbd map X-Git-Tag: v11.1.0~19^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F12379%2Fhead;p=ceph.git rbd: --max_part and --nbds_max options for nbd map Fixes: http://tracker.ceph.com/issues/18186 Signed-off-by: Pan Liu --- diff --git a/src/test/cli/rbd/help.t b/src/test/cli/rbd/help.t index 750af9311c18..df8ad63f851b 100644 --- a/src/test/cli/rbd/help.t +++ b/src/test/cli/rbd/help.t @@ -1087,6 +1087,7 @@ rbd help nbd map usage: rbd nbd map [--pool ] [--image ] [--snap ] [--read-only] [--exclusive] [--device ] + [--nbds_max ] [--max_part ] Map image to a nbd device. @@ -1102,6 +1103,8 @@ --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 diff --git a/src/tools/rbd/action/Nbd.cc b/src/tools/rbd/action/Nbd.cc index adc10110ff56..ab8db1f6f921 100644 --- a/src/tools/rbd/action/Nbd.cc +++ b/src/tools/rbd/action/Nbd.cc @@ -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(), "specify nbd device"); + ("device", po::value(), "specify nbd device") + ("nbds_max", po::value(), "override module param nbds_max") + ("max_part", po::value(), "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().c_str()); } + if (vm.count("nbds_max")) { + args.push_back("--nbds_max"); + args.push_back(vm["nbds_max"].as().c_str()); + } + if (vm.count("max_part")) { + args.push_back("--max_part"); + args.push_back(vm["max_part"].as().c_str()); + } return call_nbd_cmd(vm, args); }