[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 16/27] qemu-nbd: Add "--no-lock/-L" option
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PATCH v3 16/27] qemu-nbd: Add "--no-lock/-L" option |
Date: |
Thu, 28 Apr 2016 20:57:35 +0800 |
Signed-off-by: Fam Zheng <address@hidden>
---
qemu-nbd.c | 7 ++++++-
qemu-nbd.texi | 2 ++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 2c9754e..6bd4d05 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -95,6 +95,7 @@ static void usage(const char *name)
"Block device options:\n"
" -f, --format=FORMAT set image format (raw, qcow2, ...)\n"
" -r, --read-only export read-only\n"
+" -L, --no-lock disable image locking\n"
" -s, --snapshot use FILE as an external snapshot, create a
temporary\n"
" file with backing_file=FILE, redirect the write
to\n"
" the temporary one\n"
@@ -464,7 +465,7 @@ int main(int argc, char **argv)
off_t fd_size;
QemuOpts *sn_opts = NULL;
const char *sn_id_or_name = NULL;
- const char *sopt = "hVb:o:p:rsnP:c:dvk:e:f:tl:x:";
+ const char *sopt = "hVb:o:p:rsnLP:c:dvk:e:f:tl:x:";
struct option lopt[] = {
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'V' },
@@ -473,6 +474,7 @@ int main(int argc, char **argv)
{ "socket", required_argument, NULL, 'k' },
{ "offset", required_argument, NULL, 'o' },
{ "read-only", no_argument, NULL, 'r' },
+ { "no-lock", no_argument, NULL, 'L' },
{ "partition", required_argument, NULL, 'P' },
{ "connect", required_argument, NULL, 'c' },
{ "disconnect", no_argument, NULL, 'd' },
@@ -628,6 +630,9 @@ int main(int argc, char **argv)
nbdflags |= NBD_FLAG_READ_ONLY;
flags &= ~BDRV_O_RDWR;
break;
+ case 'L':
+ flags |= BDRV_O_NO_LOCK;
+ break;
case 'P':
partition = strtol(optarg, &end, 0);
if (*end) {
diff --git a/qemu-nbd.texi b/qemu-nbd.texi
index 9f23343..6b7b1d1 100644
--- a/qemu-nbd.texi
+++ b/qemu-nbd.texi
@@ -43,6 +43,8 @@ Force the use of the block driver for format @var{fmt}
instead of
auto-detecting
@item -r, --read-only
Export the disk as read-only
address@hidden -L, --no-lock
+Disable image locking
@item -P, address@hidden
Only expose partition @var{num}
@item -s, --snapshot
--
2.8.0
- [Qemu-devel] [PATCH v3 06/27] block: Make bdrv_reopen_{commit, abort} private functions, (continued)
- [Qemu-devel] [PATCH v3 06/27] block: Make bdrv_reopen_{commit, abort} private functions, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 08/27] osdep: Add qemu_lock_fd and qemu_unlock_fd, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 10/27] raw-posix: Use qemu_dup, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 09/27] osdep: Introduce qemu_dup, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 11/27] raw-posix: Implement .bdrv_lockf, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 12/27] gluster: Implement .bdrv_lockf, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 13/27] qemu-io: Add "-L" option for BDRV_O_NO_LOCK, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 14/27] qemu-img: Add "-L" option to sub commands, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 15/27] qemu-img: Update documentation of "-L" option, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 17/27] block: Don't lock drive-backup target image in none mode, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 16/27] qemu-nbd: Add "--no-lock/-L" option,
Fam Zheng <=
- [Qemu-devel] [PATCH v3 18/27] mirror: Disable image locking on target backing chain, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 20/27] qemu-iotests: 046: Move version detection out from verify_io, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 19/27] qemu-iotests: 140: Disable image lock for qemu-io access, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 21/27] qemu-iotests: Wait for QEMU processes before checking image in 091, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 22/27] qemu-iotests: 030: Disable image lock when checking test image, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 23/27] iotests: 087: Disable image lock in cases where file is shared, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 24/27] iotests: Disable image locking in 085, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 25/27] tests: Use null-co:// instead of /dev/null, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 26/27] block: Turn on image locking by default, Fam Zheng, 2016/04/28
- [Qemu-devel] [PATCH v3 27/27] qemu-iotests: Add test case 153 for image locking, Fam Zheng, 2016/04/28