summaryrefslogtreecommitdiff
path: root/block/commit.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2017-09-19 16:22:54 +0200
committerKevin Wolf <kwolf@redhat.com>2017-10-06 16:28:58 +0200
commit61f09cea01391eaa23ea3bc78ab37a7d2da565fb (patch)
treefebcbb8facee779caf76e9a5c6b394b922f5f1c1 /block/commit.c
parent6858eba09ed69e64c8d05d4f4b8167b42a011b7f (diff)
downloadqemu-61f09cea01391eaa23ea3bc78ab37a7d2da565fb.tar.gz
commit: Support multiple roots above top node
This changes the commit block job to support operation in a graph where there is more than a single active layer that references the top node. This involves inserting the commit filter node not only on the path between the given active node and the top node, but between the top node and all of its parents. On completion, bdrv_drop_intermediate() must consider all parents for updating the backing file link. These parents may be backing files themselves and as such read-only; reopen them temporarily if necessary. Previously this was achieved by the bdrv_reopen() calls in the commit block job that made overlay_bs read-write for the whole duration of the block job, even though write access is only needed on completion. Now that we consider all parents, overlay_bs is meaningless. It is left in place in this commit, but we'll remove it soon. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/commit.c')
-rw-r--r--block/commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/commit.c b/block/commit.c
index 8f0e83578a..610e1cd8f5 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -350,7 +350,7 @@ void commit_start(const char *job_id, BlockDriverState *bs,
error_propagate(errp, local_err);
goto fail;
}
- bdrv_set_backing_hd(overlay_bs, commit_top_bs, &local_err);
+ bdrv_replace_node(top, commit_top_bs, &local_err);
if (local_err) {
bdrv_unref(commit_top_bs);
commit_top_bs = NULL;