aboutsummaryrefslogtreecommitdiff
path: root/block/vvfat.c
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2016-09-15 17:53:02 +0300
committerKevin Wolf <kwolf@redhat.com>2016-09-23 13:36:10 +0200
commitf87a0e29a9814a7ab6ee92b238989fed6186c4f3 (patch)
tree7c1ffdb94b7d3680c9d2117262b0bfecba174f05 /block/vvfat.c
parent9b7e8691670fab57c387b6955dc14a09696ae034 (diff)
downloadqemu-f87a0e29a9814a7ab6ee92b238989fed6186c4f3.zip
qemu-f87a0e29a9814a7ab6ee92b238989fed6186c4f3.tar.gz
qemu-f87a0e29a9814a7ab6ee92b238989fed6186c4f3.tar.bz2
block: Add "read-only" to the options QDict
This adds the "read-only" option to the QDict. One important effect of this change is that when a child inherits options from its parent, the existing "read-only" mode can be preserved if it was explicitly set previously. This addresses scenarios like this: [E] <- [D] <- [C] <- [B] <- [A] In this case, if we reopen [D] with read-only=off, and later reopen [B], then [D] will not inherit read-only=on from its parent during the bdrv_reopen_queue_child() stage. The BDRV_O_RDWR flag is not removed yet, but its keep in sync with the value of the "read-only" option. Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vvfat.c')
-rw-r--r--block/vvfat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/vvfat.c b/block/vvfat.c
index ba2620f..ded2109 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -2971,7 +2971,8 @@ static BlockDriver vvfat_write_target = {
static void vvfat_qcow_options(int *child_flags, QDict *child_options,
int parent_flags, QDict *parent_options)
{
- *child_flags = BDRV_O_RDWR | BDRV_O_NO_FLUSH;
+ qdict_set_default_str(child_options, BDRV_OPT_READ_ONLY, "off");
+ *child_flags = BDRV_O_NO_FLUSH;
}
static const BdrvChildRole child_vvfat_qcow = {