summaryrefslogtreecommitdiff
path: root/block/commit.c
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2016-09-15 17:53:04 +0300
committerKevin Wolf <kwolf@redhat.com>2016-09-23 13:36:10 +0200
commit0fe282bb4b29ad51adefc2e500bcecfb3c499e10 (patch)
tree633d628eecfe7f0a207d67166ede445f0f23382a /block/commit.c
parent5b7ba05fe7313b03712e129a86fa70c2c215e908 (diff)
downloadqemu-0fe282bb4b29ad51adefc2e500bcecfb3c499e10.tar.gz
commit: Add 'base' to the reopen queue before 'overlay_bs'
Now that we're checking for duplicates in the reopen queue, there's no need to force a specific order in which the queue is constructed so we can revert 3db2bd5508c86a1605258bc77c9672d93b5c350e. Since both ways of constructing the queue are now valid, this patch doesn't have any effect on the behavior of QEMU and is not strictly necessary. However it can help us check that the fix for the reopen queue is robust: if it stops working properly at some point, iotest 040 will break. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/commit.c')
-rw-r--r--block/commit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/commit.c b/block/commit.c
index a02539bacc..9f67a8b121 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -242,14 +242,14 @@ void commit_start(const char *job_id, BlockDriverState *bs,
orig_overlay_flags = bdrv_get_flags(overlay_bs);
/* convert base & overlay_bs to r/w, if necessary */
- if (!(orig_overlay_flags & BDRV_O_RDWR)) {
- reopen_queue = bdrv_reopen_queue(reopen_queue, overlay_bs, NULL,
- orig_overlay_flags | BDRV_O_RDWR);
- }
if (!(orig_base_flags & BDRV_O_RDWR)) {
reopen_queue = bdrv_reopen_queue(reopen_queue, base, NULL,
orig_base_flags | BDRV_O_RDWR);
}
+ if (!(orig_overlay_flags & BDRV_O_RDWR)) {
+ reopen_queue = bdrv_reopen_queue(reopen_queue, overlay_bs, NULL,
+ orig_overlay_flags | BDRV_O_RDWR);
+ }
if (reopen_queue) {
bdrv_reopen_multiple(reopen_queue, &local_err);
if (local_err != NULL) {