rbd help map
usage: rbd map [--pool <pool>] [--image <image>] [--snap <snap>]
- [--options <options>] [--read-only]
+ [--options <options>] [--read-only] [--exclusive]
<image-or-snap-spec>
Map image to a block device using the kernel.
--snap arg snapshot name
-o [ --options ] arg map options
--read-only map read-only
+ --exclusive disable automatic exclusive lock transitions
rbd help merge-diff
usage: rbd merge-diff [--path <path>] [--no-progress]
return -EINVAL;
} else if (!strcmp(this_char, "lock_on_read")) {
put_map_option("lock_on_read", this_char);
+ } else if (!strcmp(this_char, "exclusive")) {
+ put_map_option("exclusive", this_char);
} else {
std::cerr << "rbd: unknown map option '" << this_char << "'" << std::endl;
return -EINVAL;
at::ARGUMENT_MODIFIER_NONE);
options->add_options()
("options,o", po::value<std::string>(), "map options")
- ("read-only", po::bool_switch(), "map read-only");
+ ("read-only", po::bool_switch(), "map read-only")
+ ("exclusive", po::bool_switch(), "disable automatic exclusive lock transitions");
}
int execute_map(const po::variables_map &vm) {
if (vm["read-only"].as<bool>()) {
put_map_option("rw", "ro");
}
+ if (vm["exclusive"].as<bool>()) {
+ put_map_option("exclusive", "exclusive");
+ }
// parse default options first so they can be overwritten by cli options
char *default_map_options = strdup(g_conf->rbd_default_map_options.c_str());
return 0;
}
-Shell::SwitchArguments switched_arguments({"read-only"});
+Shell::SwitchArguments switched_arguments({"read-only", "exclusive"});
Shell::Action action_show(
{"showmapped"}, {}, "Show the rbd images mapped by the kernel.", "",
&get_show_arguments, &execute_show);