aboutsummaryrefslogtreecommitdiff
path: root/block/backup-top.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-12-19 19:26:38 +0100
committerMax Reitz <mreitz@redhat.com>2020-01-06 14:26:23 +0100
commit503ca1262bab2c11c533a4816d1ff4297d4f58a6 (patch)
treed49fae5fbf67941fac45bd5789fb3b7a6a566b67 /block/backup-top.c
parent75ab574b4c722e96d56b7f787a531981f659b5f8 (diff)
backup-top: Begin drain earlier
When dropping backup-top, we need to drain the node before freeing the BlockCopyState. Otherwise, requests may still be in flight and then the assertion in shres_destroy() will fail. (This becomes visible in intermittent failure of 056.) Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20191219182638.104621-1-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/backup-top.c')
-rw-r--r--block/backup-top.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/backup-top.c b/block/backup-top.c
index 7cdb1f8eba..818d3f26b4 100644
--- a/block/backup-top.c
+++ b/block/backup-top.c
@@ -257,12 +257,12 @@ void bdrv_backup_top_drop(BlockDriverState *bs)
BDRVBackupTopState *s = bs->opaque;
AioContext *aio_context = bdrv_get_aio_context(bs);
- block_copy_state_free(s->bcs);
-
aio_context_acquire(aio_context);
bdrv_drained_begin(bs);
+ block_copy_state_free(s->bcs);
+
s->active = false;
bdrv_child_refresh_perms(bs, bs->backing, &error_abort);
bdrv_replace_node(bs, backing_bs(bs), &error_abort);