[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH for-2.10 3/5] block: Set BDRV_O_ALLOW_RDWR during rw
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PATCH for-2.10 3/5] block: Set BDRV_O_ALLOW_RDWR during rw reopen |
Date: |
Thu, 3 Aug 2017 17:02:59 +0200 |
Reopening an image should be consistent with opening it, so we should
set BDRV_O_ALLOW_RDWR for any image that is reopened read-write like in
bdrv_open_inherit().
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index 2711c3dd3b..3615a6809e 100644
--- a/block.c
+++ b/block.c
@@ -2729,8 +2729,11 @@ static BlockReopenQueue
*bdrv_reopen_queue_child(BlockReopenQueue *bs_queue,
bdrv_join_options(bs, options, old_options);
QDECREF(old_options);
- /* bdrv_open() masks this flag out */
+ /* bdrv_open_inherit() sets and clears some additional flags internally */
flags &= ~BDRV_O_PROTOCOL;
+ if (flags & BDRV_O_RDWR) {
+ flags |= BDRV_O_ALLOW_RDWR;
+ }
QLIST_FOREACH(child, &bs->children, next) {
QDict *new_child_options;
--
2.13.3
- Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 2/5] block: Allow reopen rw without BDRV_O_ALLOW_RDWR, (continued)
Re: [Qemu-block] [PATCH for-2.10 2/5] block: Allow reopen rw without BDRV_O_ALLOW_RDWR, Jeff Cody, 2017/08/03
[Qemu-block] [PATCH for-2.10 1/5] block: Fix order in bdrv_replace_child(), Kevin Wolf, 2017/08/03
[Qemu-block] [PATCH for-2.10 4/5] qemu-io: Allow reopen read-write, Kevin Wolf, 2017/08/03
[Qemu-block] [PATCH for-2.10 3/5] block: Set BDRV_O_ALLOW_RDWR during rw reopen,
Kevin Wolf <=
[Qemu-block] [PATCH for-2.10 5/5] qemu-iotests: Test reopen between read-only and read-write, Kevin Wolf, 2017/08/03
Re: [Qemu-block] [PATCH for-2.10 0/5] block: bdrv_reopen() fixes, John Snow, 2017/08/07
Re: [Qemu-block] [PATCH for-2.10 0/5] block: bdrv_reopen() fixes, Kevin Wolf, 2017/08/08