[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH for-2.7 03/15] blockdev: Add and parse "lock-image"
From: |
Fam Zheng |
Subject: |
[Qemu-block] [PATCH for-2.7 03/15] blockdev: Add and parse "lock-image" option for block devices |
Date: |
Wed, 13 Apr 2016 17:09:52 +0800 |
Honor the locking switch specified in CLI or QMP, and set the open flags for
the image accordingly.
Signed-off-by: Fam Zheng <address@hidden>
---
blockdev.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/blockdev.c b/blockdev.c
index f1f520a..93bd43e 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -382,6 +382,10 @@ static void extract_common_blockdev_options(QemuOpts
*opts, int *bdrv_flags,
return;
}
}
+
+ if (!qemu_opt_get_bool(opts, "lock-image", false)) {
+ *bdrv_flags |= BDRV_O_NO_LOCK;
+ }
}
/* disk I/O throttling */
@@ -4249,6 +4253,10 @@ QemuOptsList qemu_common_drive_opts = {
.type = QEMU_OPT_BOOL,
.help = "whether to account for failed I/O operations "
"in the statistics",
+ },{
+ .name = "lock-image",
+ .type = QEMU_OPT_BOOL,
+ .help = "whether to lock the image (default: on)",
},
{ /* end of list */ }
},
--
2.8.0
- [Qemu-block] [PATCH for-2.7 00/15] block: Lock images when opening, Fam Zheng, 2016/04/13
- [Qemu-block] [PATCH for-2.7 01/15] block: Add BDRV_O_NO_LOCK, Fam Zheng, 2016/04/13
- [Qemu-block] [PATCH for-2.7 02/15] qapi: Add lock-image in blockdev-add options, Fam Zheng, 2016/04/13
- [Qemu-block] [PATCH for-2.7 03/15] blockdev: Add and parse "lock-image" option for block devices,
Fam Zheng <=
- [Qemu-block] [PATCH for-2.7 04/15] block: Introduce image file locking interface, Fam Zheng, 2016/04/13
- [Qemu-block] [PATCH for-2.7 05/15] raw-posix: Implement .bdrv_lockf, Fam Zheng, 2016/04/13
- [Qemu-block] [PATCH for-2.7 07/15] qemu-io: Add "-L" option for BDRV_O_NO_LOCK, Fam Zheng, 2016/04/13
- [Qemu-block] [PATCH for-2.7 06/15] gluster: Implement .bdrv_lockf, Fam Zheng, 2016/04/13
- [Qemu-block] [PATCH for-2.7 08/15] qemu-iotests: 140: Disable image lock for qemu-io access, Fam Zheng, 2016/04/13
- [Qemu-block] [PATCH for-2.7 09/15] qemu-iotests: 046: Move version detection out from verify_io, Fam Zheng, 2016/04/13