static string dir_oid = RBD_DIRECTORY;
static string dir_info_oid = RBD_INFO;
+bool udevadm_settle = true;
+
void usage()
{
cout <<
" format 2 supports cloning\n"
" --id <username> rados user (without 'client.' prefix) to authenticate as\n"
" --keyfile <path> file containing secret key for use with cephx\n"
-" --shared <tag> take a shared (rather than exclusive) lock\n";
+" --shared <tag> take a shared (rather than exclusive) lock\n"
+" --no-settle do not wait for udevadm to settle on map/unmap\n";
}
static string feature_str(uint64_t features)
r = safe_write(fd, add.c_str(), add.size());
close(fd);
+ // let udevadm do its job before we return
+ if (udevadm_settle)
+ system("/sbin/udevadm settle");
+
return r;
}
}
r = close(fd);
+
+ // let udevadm finish, if present
+ if (udevadm_settle)
+ system("/sbin/udevadm settle");
+
if (r < 0)
r = -errno;
return r;
imgname = strdup(val.c_str());
} else if (ceph_argparse_witharg(args, i, &val, "--shared", (char *)NULL)) {
lock_tag = strdup(val.c_str());
+ } else if (ceph_argparse_flag(args, i, "--no-settle", (char *)NULL)) {
+ udevadm_settle = false;
} else {
++i;
}
--id <username> rados user (without 'client.' prefix) to authenticate as
--keyfile <path> file containing secret key for use with cephx
--shared <tag> take a shared (rather than exclusive) lock
+ --no-settle do not wait for udevadm to settle on map/unmap