diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-06-12 10:43:32 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-06-12 10:43:32 +0100 |
commit | 475df9d809b1f3a7ebe8b15abd208216591f0143 (patch) | |
tree | 887ca246dba04fb0f1752ccdbf44cb473eef8e82 /block/commit.c | |
parent | bbfa326fc8028e275eddf8c9965c2a1b59405b2e (diff) | |
parent | 719fc28c80a22ab9f1533d775bae09c14442bbbe (diff) |
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches
# gpg: Signature made Fri 09 Jun 2017 12:47:31 BST
# gpg: using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6
* remotes/kevin/tags/for-upstream:
block: fix external snapshot abort permission error
block/qcow.c: Fix memory leak in qcow_create()
qemu-iotests: Test automatic commit job cancel on hot unplug
commit: Fix use after free in completion
qemu-iotests: Block migration test
migration/block: Clean up BBs in block_save_complete()
migration: Inactivate images after .save_live_complete_precopy()
block: Fix anonymous BBs in blk_root_inactivate()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'block/commit.c')
-rw-r--r-- | block/commit.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/block/commit.c b/block/commit.c index a3028b20f3..af6fa68cf3 100644 --- a/block/commit.c +++ b/block/commit.c @@ -89,6 +89,10 @@ static void commit_complete(BlockJob *job, void *opaque) int ret = data->ret; bool remove_commit_top_bs = false; + /* Make sure overlay_bs and top stay around until bdrv_set_backing_hd() */ + bdrv_ref(top); + bdrv_ref(overlay_bs); + /* Remove base node parent that still uses BLK_PERM_WRITE/RESIZE before * the normal backing chain can be restored. */ blk_unref(s->base); @@ -124,6 +128,9 @@ static void commit_complete(BlockJob *job, void *opaque) if (remove_commit_top_bs) { bdrv_set_backing_hd(overlay_bs, top, &error_abort); } + + bdrv_unref(overlay_bs); + bdrv_unref(top); } static void coroutine_fn commit_run(void *opaque) |