diff options
author | Kevin Wolf <kwolf@redhat.com> | 2017-03-06 16:12:44 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-03-07 14:53:28 +0100 |
commit | 88f9d1b3d2fa8df276b2f75dcbd7fb78ed08be20 (patch) | |
tree | a0515934b43057228edfb2a5ef09b9d3859f235a /block/mirror.c | |
parent | 0bf74767ff7f0ae23615162807961c5d7e73507c (diff) | |
download | qemu-88f9d1b3d2fa8df276b2f75dcbd7fb78ed08be20.zip qemu-88f9d1b3d2fa8df276b2f75dcbd7fb78ed08be20.tar.gz qemu-88f9d1b3d2fa8df276b2f75dcbd7fb78ed08be20.tar.bz2 |
mirror: Fix error path for dirty bitmap creation
mirror_top_bs must be removed from the graph again when creating the
dirty bitmap fails.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block/mirror.c')
-rw-r--r-- | block/mirror.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/block/mirror.c b/block/mirror.c index 001b5f0..f24dc51 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1197,10 +1197,7 @@ static void mirror_start_job(const char *job_id, BlockDriverState *bs, s->dirty_bitmap = bdrv_create_dirty_bitmap(bs, granularity, NULL, errp); if (!s->dirty_bitmap) { - g_free(s->replaces); - blk_unref(s->target); - block_job_unref(&s->common); - return; + goto fail; } /* Required permissions are already taken with blk_new() */ |