aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2018-09-06 09:02:14 -0400
committerMax Reitz <mreitz@redhat.com>2018-09-25 15:31:15 +0200
commitc2924ceaa7f1866148e2847c969fc1902a2524fa (patch)
treef66b5e6ceb57ef985c3b2a10b44797cace04c340
parent22dffcbec62ba918db690ed44beba4bd4e970bb9 (diff)
block/mirror: don't install backing chain on abort
In cases where we abort the block/mirror job, there's no point in installing the new backing chain before we finish aborting. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20180906130225.5118-6-jsnow@redhat.com Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
-rw-r--r--block/mirror.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/mirror.c b/block/mirror.c
index cba555b4ef..bd3e908710 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -642,7 +642,7 @@ static void mirror_exit(Job *job)
* required before it could become a backing file of target_bs. */
bdrv_child_try_set_perm(mirror_top_bs->backing, 0, BLK_PERM_ALL,
&error_abort);
- if (s->backing_mode == MIRROR_SOURCE_BACKING_CHAIN) {
+ if (ret == 0 && s->backing_mode == MIRROR_SOURCE_BACKING_CHAIN) {
BlockDriverState *backing = s->is_none_mode ? src : s->base;
if (backing_bs(target_bs) != backing) {
bdrv_set_backing_hd(target_bs, backing, &local_err);