[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 31/39] block: Create the commit block job before reop
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 31/39] block: Create the commit block job before reopening any image |
Date: |
Thu, 16 Jun 2016 16:08:20 +0200 |
From: Alberto Garcia <address@hidden>
If the base or overlay images need to be reopened in read-write mode
but the block_job_create() call fails then no one will put those
images back in read-only mode.
We can solve this problem easily by calling block_job_create() first.
Signed-off-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
block/commit.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/block/commit.c b/block/commit.c
index 8a00e11..444333b 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -236,6 +236,11 @@ void commit_start(BlockDriverState *bs, BlockDriverState
*base,
return;
}
+ s = block_job_create(&commit_job_driver, bs, speed, cb, opaque, errp);
+ if (!s) {
+ return;
+ }
+
orig_base_flags = bdrv_get_flags(base);
orig_overlay_flags = bdrv_get_flags(overlay_bs);
@@ -252,16 +257,12 @@ void commit_start(BlockDriverState *bs, BlockDriverState
*base,
bdrv_reopen_multiple(reopen_queue, &local_err);
if (local_err != NULL) {
error_propagate(errp, local_err);
+ block_job_unref(&s->common);
return;
}
}
- s = block_job_create(&commit_job_driver, bs, speed, cb, opaque, errp);
- if (!s) {
- return;
- }
-
s->base = blk_new();
blk_insert_bs(s->base, base);
--
1.8.3.1
- [Qemu-block] [PULL 20/39] doc: Fix mailing list address in tests/qemu-iotests/README, (continued)
- [Qemu-block] [PULL 20/39] doc: Fix mailing list address in tests/qemu-iotests/README, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 24/39] block: Make bdrv_load/save_vmstate coroutine_fns, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 18/39] block: Don't enforce 512 byte minimum alignment, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 29/39] block: use the block job list in qmp_query_block_jobs(), Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 30/39] block: Prevent sleeping jobs from resuming if they have been paused, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 27/39] block: Fix snapshot=on with aio=native, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 25/39] qcow2: Let vmstate call qcow2_co_preadv/pwrite directly, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 22/39] block: Make .bdrv_load_vmstate() vectored, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 28/39] block: use the block job list in bdrv_drain_all(), Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 32/39] iotests: 095: Clean up QEMU before showing image info, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 31/39] block: Create the commit block job before reopening any image,
Kevin Wolf <=
- [Qemu-block] [PULL 26/39] block: Remove bs->zero_beyond_eof, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 38/39] iotests: Add test for oVirt-like storage migration, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 37/39] iotests: Add test for post-mirror backing chains, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 33/39] rbd:change error_setg() to error_setg_errno(), Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 34/39] block: Allow replacement of a BDS by its overlay, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 39/39] hbitmap: add 'pos < size' asserts, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 35/39] block/mirror: Fix target backing BDS, Kevin Wolf, 2016/06/16
- [Qemu-block] [PULL 36/39] block/null: Implement bdrv_refresh_filename(), Kevin Wolf, 2016/06/16
- Re: [Qemu-block] [Qemu-devel] [PULL 00/39] Block layer patches, Peter Maydell, 2016/06/16