[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 28/36] block: Make auto-read-only=on default for -dri
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 28/36] block: Make auto-read-only=on default for -drive |
Date: |
Mon, 5 Nov 2018 17:37:36 +0100 |
While we want machine interfaces like -blockdev and QMP blockdev-add to
add as little auto-detection as possible so that management tools are
explicit about their needs, -drive is a convenience option for human
users. Enabling auto-read-only=on by default there enables users to use
read-only images for read-only guest devices without having to specify
read-only=on explicitly. If they try to attach the image to a read-write
device, they will still get an error message.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
blockdev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/blockdev.c b/blockdev.c
index fc8794862f..e5b5eb46e2 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -590,6 +590,7 @@ static BlockBackend *blockdev_init(const char *file, QDict
*bs_opts,
qdict_set_default_str(bs_opts, BDRV_OPT_CACHE_NO_FLUSH, "off");
qdict_set_default_str(bs_opts, BDRV_OPT_READ_ONLY,
read_only ? "on" : "off");
+ qdict_set_default_str(bs_opts, BDRV_OPT_AUTO_READ_ONLY, "on");
assert((bdrv_flags & BDRV_O_CACHE_MASK) == 0);
if (runstate_check(RUN_STATE_INMIGRATE)) {
--
2.19.1
- [Qemu-devel] [PULL 15/36] quorum: Return an error if the blkverify mode has invalid settings, (continued)
- [Qemu-devel] [PULL 15/36] quorum: Return an error if the blkverify mode has invalid settings, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 30/36] option: Make option help nicer to read, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 19/36] block: Update flags in bdrv_set_read_only(), Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 31/36] chardev: Indent list of chardevs, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 18/36] iotest: Test x-blockdev-change on a Quorum, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 23/36] nbd: Support auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 14/36] quorum: Remove quorum_err(), Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 11/36] vpc: Don't leak opts in vpc_open(), Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 32/36] qdev-monitor: Make device options help nicer, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 35/36] vdi: Use a literal number of bytes for DEFAULT_CLUSTER_SIZE, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 28/36] block: Make auto-read-only=on default for -drive,
Kevin Wolf <=
- [Qemu-devel] [PULL 20/36] block: Add auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 34/36] fw_cfg: Drop newline in @file description, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 29/36] qemu-iotests: Test auto-read-only with -drive and -blockdev, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 24/36] file-posix: Support auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 21/36] rbd: Close image in qemu_rbd_open() error path, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 26/36] gluster: Support auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 36/36] include: Add a comment to explain the origin of sizes' lookup table, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 33/36] object: Make option help nicer to read, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 25/36] curl: Support auto-read-only option, Kevin Wolf, 2018/11/05