[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/11] commit: Use bdrv_append() in commit_start()
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PULL 10/11] commit: Use bdrv_append() in commit_start() |
Date: |
Tue, 7 May 2019 17:18:18 +0200 |
From: Alberto Garcia <address@hidden>
This function combines bdrv_set_backing_hd() and bdrv_replace_node()
so we can use it to simplify the code a bit in commit_start().
Signed-off-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/commit.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/block/commit.c b/block/commit.c
index 27537d995b..14e5bb394c 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -303,23 +303,14 @@ void commit_start(const char *job_id, BlockDriverState
*bs,
commit_top_bs->total_sectors = top->total_sectors;
bdrv_set_aio_context(commit_top_bs, bdrv_get_aio_context(top));
- bdrv_set_backing_hd(commit_top_bs, top, &local_err);
+ bdrv_append(commit_top_bs, top, &local_err);
if (local_err) {
- bdrv_unref(commit_top_bs);
- commit_top_bs = NULL;
- error_propagate(errp, local_err);
- goto fail;
- }
- bdrv_replace_node(top, commit_top_bs, &local_err);
- if (local_err) {
- bdrv_unref(commit_top_bs);
commit_top_bs = NULL;
error_propagate(errp, local_err);
goto fail;
}
s->commit_top_bs = commit_top_bs;
- bdrv_unref(commit_top_bs);
/* Block all nodes between top and base, because they will
* disappear from the chain after this operation. */
--
2.20.1
- [Qemu-devel] [PULL 00/11] Block patches, Max Reitz, 2019/05/07
- [Qemu-devel] [PULL 01/11] qcow2-refcount: fix check_oflag_copied, Max Reitz, 2019/05/07
- [Qemu-devel] [PULL 02/11] qcow2-refcount: avoid eating RAM, Max Reitz, 2019/05/07
- [Qemu-devel] [PULL 04/11] qcow2-refcount: check_refcounts_l2: don't count fixed cluster as allocated, Max Reitz, 2019/05/07
- [Qemu-devel] [PULL 03/11] qcow2-refcount: check_refcounts_l2: reduce ignored overlaps, Max Reitz, 2019/05/07
- [Qemu-devel] [PULL 05/11] qcow2-refcount: don't mask corruptions under internal errors, Max Reitz, 2019/05/07
- [Qemu-devel] [PULL 06/11] qcow2: discard bitmap when removed, Max Reitz, 2019/05/07
- [Qemu-devel] [PULL 08/11] block/ssh: Implement .bdrv_dirname(), Max Reitz, 2019/05/07
- [Qemu-devel] [PULL 07/11] block/ssh: Implement .bdrv_refresh_filename(), Max Reitz, 2019/05/07
- [Qemu-devel] [PULL 09/11] block: Assert that drv->bdrv_child_perm is set in bdrv_child_perm(), Max Reitz, 2019/05/07
- [Qemu-devel] [PULL 10/11] commit: Use bdrv_append() in commit_start(),
Max Reitz <=
- [Qemu-devel] [PULL 11/11] iotests: Fix iotests 110 and 126, Max Reitz, 2019/05/07
- Re: [Qemu-devel] [PULL 00/11] Block patches, Peter Maydell, 2019/05/09