and valid), diff-iterate is now guaranteed to execute locally if exclusive
lock is available. This brings a dramatic performance improvement for QEMU
live disk synchronization and backup use cases.
+* RBD: The ``try-netlink`` mapping option for rbd-nbd has become the default
+ and is now deprecated. If the NBD netlink interface is not supported by the
+ kernel, then the mapping is retried using the legacy ioctl interface.
>=18.0.0
unmap_device ${DEV} ${PID}
# resize test
+# also test that try-netlink option is accepted for compatibility
DEV=`_sudo rbd device -t nbd -o try-netlink map ${POOL}/${IMAGE}`
get_pid ${POOL}
devname=$(basename ${DEV})
expect_false grep 'quiesce failed' ${LOG_FILE}
# test detach/attach
-OUT=`_sudo rbd device --device-type nbd --options try-netlink,show-cookie map ${POOL}/${IMAGE}`
+OUT=`_sudo rbd device --device-type nbd --show-cookie map ${POOL}/${IMAGE}`
read DEV COOKIE <<< "${OUT}"
get_pid ${POOL}
_sudo mount ${DEV} ${TEMPDIR}/mnt
unmap_device ${DEV} ${PID}
# if kernel supports cookies
if [ -n "${COOKIE}" ]; then
- OUT=`_sudo rbd device --device-type nbd --show-cookie --cookie "abc de" --options try-netlink map ${POOL}/${IMAGE}`
+ OUT=`_sudo rbd device --device-type nbd --show-cookie --cookie "abc de" map ${POOL}/${IMAGE}`
read DEV ANOTHER_COOKIE <<< "${OUT}"
get_pid ${POOL}
test "${ANOTHER_COOKIE}" = "abc de"
# test detach/attach with --snap-id
SNAPID=`rbd snap ls ${POOL}/${IMAGE} | awk '$2 == "snap" {print $1}'`
-OUT=`_sudo rbd device --device-type nbd --options try-netlink,show-cookie map --snap-id ${SNAPID} ${POOL}/${IMAGE}`
+OUT=`_sudo rbd device --device-type nbd --show-cookie map --snap-id ${SNAPID} ${POOL}/${IMAGE}`
read DEV COOKIE <<< "${OUT}"
get_pid ${POOL}
_sudo rbd device detach ${POOL}/${IMAGE} --snap-id ${SNAPID} --device-type nbd
bool quiesce = false;
bool readonly = false;
bool set_max_part = false;
- bool try_netlink = false;
bool show_cookie = false;
std::string poolname;
<< " --read-only Map read-only\n"
<< " --reattach-timeout <sec> Set nbd re-attach timeout\n"
<< " (default: " << Config().reattach_timeout << ")\n"
- << " --try-netlink Use the nbd netlink interface\n"
<< " --show-cookie Show device cookie\n"
<< " --cookie Specify device cookie\n"
<< " --snap-id <snap-id> Specify snapshot by ID instead of by name\n"
unsigned long flags;
unsigned long size;
unsigned long blksize = RBD_NBD_BLKSIZE;
- bool use_netlink;
+ bool use_netlink = true;
int fd[2];
server = start_server(fd[1], image, cfg);
- use_netlink = cfg->try_netlink || reconnect;
- if (use_netlink) {
- // generate when the cookie is not supplied at CLI
- if (!reconnect && cfg->cookie.empty()) {
- uuid_d uuid_gen;
- uuid_gen.generate_random();
- cfg->cookie = uuid_gen.to_string();
- }
- r = try_netlink_setup(cfg, fd[0], size, flags, reconnect);
- if (r < 0) {
- goto free_server;
- } else if (r == 1) {
- use_netlink = false;
- }
+ // generate when the cookie is not supplied at CLI
+ if (!reconnect && cfg->cookie.empty()) {
+ uuid_d uuid_gen;
+ uuid_gen.generate_random();
+ cfg->cookie = uuid_gen.to_string();
+ }
+ r = try_netlink_setup(cfg, fd[0], size, flags, reconnect);
+ if (r < 0) {
+ goto free_server;
+ } else if (r == 1) {
+ use_netlink = false;
}
if (!use_netlink) {
} else if (ceph_argparse_flag(args, i, "--pretty-format", (char *)NULL)) {
cfg->pretty_format = true;
} else if (ceph_argparse_flag(args, i, "--try-netlink", (char *)NULL)) {
- cfg->try_netlink = true;
+ // netlink used by default. option not required anymore.
+ // accept for compatibility.
} else if (ceph_argparse_flag(args, i, "--show-cookie", (char *)NULL)) {
cfg->show_cookie = true;
} else if (ceph_argparse_witharg(args, i, &cfg->cookie, "--cookie", (char *)NULL)) {