aboutsummaryrefslogtreecommitdiff
path: root/block/mirror.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-06-05 14:39:03 +0200
committerFam Zheng <famz@redhat.com>2017-06-16 07:55:00 +0800
commit2119882c7eb7e2c612b24fc0c8d86f5887d6f1c3 (patch)
tree2c41a8155a0b8f1746f654fe374546d4e6860f5e /block/mirror.c
parent3783fa3dd3d0104e9780bde073f66f1e37f1ce1c (diff)
block: introduce dirty_bitmap_mutex
It protects only the list of dirty bitmaps; in the next patch we will also protect their content. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20170605123908.18777-15-pbonzini@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'block/mirror.c')
-rw-r--r--block/mirror.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/mirror.c b/block/mirror.c
index a2a970301c..88ae882c46 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -506,6 +506,8 @@ static void mirror_exit(BlockJob *job, void *opaque)
BlockDriverState *mirror_top_bs = s->mirror_top_bs;
Error *local_err = NULL;
+ bdrv_release_dirty_bitmap(src, s->dirty_bitmap);
+
/* Make sure that the source BDS doesn't go away before we called
* block_job_completed(). */
bdrv_ref(src);
@@ -904,7 +906,6 @@ immediate_exit:
g_free(s->cow_bitmap);
g_free(s->in_flight_bitmap);
bdrv_dirty_iter_free(s->dbi);
- bdrv_release_dirty_bitmap(bs, s->dirty_bitmap);
data = g_malloc(sizeof(*data));
data->ret = ret;