[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 31/41] block: Fix flags in reopen queue
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 31/41] block: Fix flags in reopen queue |
Date: |
Tue, 13 Mar 2018 17:17:53 +0100 |
From: Fam Zheng <address@hidden>
Reopen flags are not synchronized according to the
bdrv_reopen_queue_child precedence until bdrv_reopen_prepare. It is a
bit too late: we already check the consistency in bdrv_check_perm before
that.
This fixes the bug that when bdrv_reopen a RO node as RW, the flags for
backing child are wrong. Before, we could recurse with flags.rw=1; now,
role->inherit_options + update_flags_from_options will make sure to
clear the bit when necessary. Note that this will not clear an
explicitly set bit, as in the case of parallel block jobs (e.g.
test_stream_parallel in 030), because the explicit options include
'read-only=false' (for an intermediate node used by a different job).
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/block.c b/block.c
index 75a9fd49de..e02d83b027 100644
--- a/block.c
+++ b/block.c
@@ -2883,8 +2883,16 @@ static BlockReopenQueue
*bdrv_reopen_queue_child(BlockReopenQueue *bs_queue,
/* Inherit from parent node */
if (parent_options) {
+ QemuOpts *opts;
+ QDict *options_copy;
assert(!flags);
role->inherit_options(&flags, options, parent_flags, parent_options);
+ options_copy = qdict_clone_shallow(options);
+ opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
+ qemu_opts_absorb_qdict(opts, options_copy, NULL);
+ update_flags_from_options(&flags, opts);
+ qemu_opts_del(opts);
+ QDECREF(options_copy);
}
/* Old values are used for options that aren't set yet */
--
2.13.6
- [Qemu-block] [PULL 29/41] vdi: Move file creation to vdi_co_create_opts, (continued)
- [Qemu-block] [PULL 29/41] vdi: Move file creation to vdi_co_create_opts, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 27/41] qemu-iotests: Test luks QMP image creation, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 26/41] luks: Catch integer overflow for huge sizes, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 19/41] blockjobs: Expose manual property, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 21/41] tests/test-blockjob: test cancellations, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 25/41] luks: Turn invalid assertion into check, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 34/41] qemu-iotests: Enable write tests for parallels, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 28/41] vdi: Pull option parsing from vdi_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 38/41] vhdx: Support .bdrv_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 30/41] vdi: Implement .bdrv_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 31/41] block: Fix flags in reopen queue,
Kevin Wolf <=
- [Qemu-block] [PULL 32/41] iotests: Add regression test for commit base locking, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 33/41] parallels: Support .bdrv_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 37/41] vdi: Make comments consistent with other drivers, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 35/41] qcow: Support .bdrv_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 36/41] qed: Support .bdrv_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 40/41] vpc: Require aligned size in .bdrv_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 39/41] vpc: Support .bdrv_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PULL 41/41] block/mirror: change the semantic of 'force' of block-job-cancel, Kevin Wolf, 2018/03/13
- Re: [Qemu-block] [Qemu-devel] [PULL 00/41] Block layer patches, no-reply, 2018/03/13
- Re: [Qemu-block] [PULL 00/41] Block layer patches, Peter Maydell, 2018/03/15