[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 10/20] qemu-nbd: Add "--no-lock/-L" option
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PATCH v7 10/20] qemu-nbd: Add "--no-lock/-L" option |
Date: |
Mon, 8 Aug 2016 21:13:23 +0800 |
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <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 e3571c2..145156c 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -102,6 +102,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"
@@ -474,7 +475,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:T:";
+ const char *sopt = "hVb:o:p:rsnLP:c:dvk:e:f:tl:x:T:";
struct option lopt[] = {
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'V' },
@@ -483,6 +484,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' },
@@ -638,6 +640,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 91ebf04..5936b37 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.7.4
- [Qemu-devel] [PATCH v7 00/20] block: Image locking series for 2.8, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 01/20] block: Add flag bits for image locking, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 02/20] qapi: Add lock-mode in blockdev-add options, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 03/20] block: Add and parse "lock-mode" option for image locking, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 04/20] block: Introduce image file locking, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 05/20] osdep: Add qemu_lock_fd and qemu_unlock_fd, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 07/20] qemu-io: Add "-L" option for BDRV_O_NO_LOCK, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 06/20] raw-posix: Add image locking support, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 08/20] qemu-img: Add "-L" option to sub commands, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 09/20] qemu-img: Update documentation of "-L" option, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 10/20] qemu-nbd: Add "--no-lock/-L" option,
Fam Zheng <=
- [Qemu-devel] [PATCH v7 11/20] block: Don't lock drive-backup target image in none mode, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 12/20] qemu-iotests: 046: Move version detection out from verify_io, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 13/20] qemu-iotests: Wait for QEMU processes before checking image in 091, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 15/20] iotests: 087: Disable image locking in cases where file is shared, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 16/20] iotests: 130: Check image info locklessly, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 19/20] block: Turn on image locking by default, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 18/20] tests: Use null-co:// instead of /dev/null, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 17/20] iotests: Disable image locking in 085, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 20/20] qemu-iotests: Add test case 153 for image locking, Fam Zheng, 2016/08/08
- [Qemu-devel] [PATCH v7 14/20] qemu-iotests: 030: Disable image locking when checking test image, Fam Zheng, 2016/08/08