[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/13] block: Freeze the backing chain for the durat
From: |
Alberto Garcia |
Subject: |
[Qemu-devel] [PATCH 02/13] block: Freeze the backing chain for the duration of the commit job |
Date: |
Thu, 17 Jan 2019 17:33:53 +0200 |
Signed-off-by: Alberto Garcia <address@hidden>
---
block/commit.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/block/commit.c b/block/commit.c
index 53148e610b..8824d135e0 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -73,6 +73,8 @@ static int commit_prepare(Job *job)
{
CommitBlockJob *s = container_of(job, CommitBlockJob, common.job);
+ bdrv_unfreeze_backing_chain(s->commit_top_bs, s->base_bs);
+
/* Remove base node parent that still uses BLK_PERM_WRITE/RESIZE before
* the normal backing chain can be restored. */
blk_unref(s->base);
@@ -89,6 +91,8 @@ static void commit_abort(Job *job)
CommitBlockJob *s = container_of(job, CommitBlockJob, common.job);
BlockDriverState *top_bs = blk_bs(s->top);
+ bdrv_unfreeze_backing_chain(s->commit_top_bs, s->base_bs);
+
/* Make sure commit_top_bs and top stay around until bdrv_replace_node() */
bdrv_ref(top_bs);
bdrv_ref(s->commit_top_bs);
@@ -336,6 +340,10 @@ void commit_start(const char *job_id, BlockDriverState *bs,
}
}
+ if (bdrv_freeze_backing_chain(commit_top_bs, base, errp) < 0) {
+ goto fail;
+ }
+
ret = block_job_add_bdrv(&s->common, "base", base, 0, BLK_PERM_ALL, errp);
if (ret < 0) {
goto fail;
--
2.11.0
- [Qemu-devel] [PATCH 00/13] Add a 'x-blockdev-reopen' QMP command, Alberto Garcia, 2019/01/17
- [Qemu-devel] [PATCH 04/13] block: Freeze the backing chain for the duration of the stream job, Alberto Garcia, 2019/01/17
- [Qemu-devel] [PATCH 11/13] block: Remove the AioContext parameter from bdrv_reopen_multiple(), Alberto Garcia, 2019/01/17
- [Qemu-devel] [PATCH 03/13] block: Freeze the backing chain for the duration of the mirror job, Alberto Garcia, 2019/01/17
- [Qemu-devel] [PATCH 07/13] block: Allow omitting the 'backing' option in certain cases, Alberto Garcia, 2019/01/17
- [Qemu-devel] [PATCH 10/13] block: Add bdrv_reset_options_allowed(), Alberto Garcia, 2019/01/17
- [Qemu-devel] [PATCH 08/13] block: Allow changing the backing file on reopen, Alberto Garcia, 2019/01/17
- [Qemu-devel] [PATCH 02/13] block: Freeze the backing chain for the duration of the commit job,
Alberto Garcia <=
- [Qemu-devel] [PATCH 01/13] block: Allow freezing BdrvChild links, Alberto Garcia, 2019/01/17
- [Qemu-devel] [PATCH 06/13] block: Handle child references in bdrv_reopen_queue(), Alberto Garcia, 2019/01/17
- [Qemu-devel] [PATCH 12/13] block: Add an 'x-blockdev-reopen' QMP command, Alberto Garcia, 2019/01/17
- [Qemu-devel] [PATCH 09/13] block: Add 'runtime_opts' and 'mutable_opts' fields to BlockDriver, Alberto Garcia, 2019/01/17
- [Qemu-devel] [PATCH 05/13] block: Add 'keep_old_opts' parameter to bdrv_reopen_queue(), Alberto Garcia, 2019/01/17
- [Qemu-devel] [PATCH 13/13] qemu-iotests: Test the x-blockdev-reopen QMP command, Alberto Garcia, 2019/01/17
- Re: [Qemu-devel] [PATCH 00/13] Add a 'x-blockdev-reopen' QMP command, Eric Blake, 2019/01/17