Blame SOURCES/kvm-block-mirror-don-t-install-backing-chain-on-abort.patch

1bdc94
From ec75d6bf020a399a3caee05dcc37b463d438c332 Mon Sep 17 00:00:00 2001
1bdc94
From: John Snow <jsnow@redhat.com>
1bdc94
Date: Mon, 10 Sep 2018 18:17:52 +0200
1bdc94
Subject: [PATCH 14/25] block/mirror: don't install backing chain on abort
1bdc94
1bdc94
RH-Author: John Snow <jsnow@redhat.com>
1bdc94
Message-id: <20180910181803.11781-15-jsnow@redhat.com>
1bdc94
Patchwork-id: 82091
1bdc94
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 14/25] block/mirror: don't install backing chain on abort
1bdc94
Bugzilla: 1626061
1bdc94
RH-Acked-by: Max Reitz <mreitz@redhat.com>
1bdc94
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
1bdc94
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
1bdc94
1bdc94
In cases where we abort the block/mirror job, there's no point in
1bdc94
installing the new backing chain before we finish aborting.
1bdc94
1bdc94
Signed-off-by: John Snow <jsnow@redhat.com>
1bdc94
Message-id: 20180906130225.5118-6-jsnow@redhat.com
1bdc94
Reviewed-by: Jeff Cody <jcody@redhat.com>
1bdc94
Reviewed-by: Max Reitz <mreitz@redhat.com>
1bdc94
Signed-off-by: Max Reitz <mreitz@redhat.com>
1bdc94
(cherry picked from commit 46e2f0070a9bd82187c12b679ec5a69c6aabe128)
1bdc94
Signed-off-by: John Snow <jsnow@redhat.com>
1bdc94
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
1bdc94
---
1bdc94
 block/mirror.c | 2 +-
1bdc94
 1 file changed, 1 insertion(+), 1 deletion(-)
1bdc94
1bdc94
diff --git a/block/mirror.c b/block/mirror.c
1bdc94
index a80c359..1945000 100644
1bdc94
--- a/block/mirror.c
1bdc94
+++ b/block/mirror.c
1bdc94
@@ -514,7 +514,7 @@ static void mirror_exit(Job *job)
1bdc94
      * required before it could become a backing file of target_bs. */
1bdc94
     bdrv_child_try_set_perm(mirror_top_bs->backing, 0, BLK_PERM_ALL,
1bdc94
                             &error_abort);
1bdc94
-    if (s->backing_mode == MIRROR_SOURCE_BACKING_CHAIN) {
1bdc94
+    if (ret == 0 && s->backing_mode == MIRROR_SOURCE_BACKING_CHAIN) {
1bdc94
         BlockDriverState *backing = s->is_none_mode ? src : s->base;
1bdc94
         if (backing_bs(target_bs) != backing) {
1bdc94
             bdrv_set_backing_hd(target_bs, backing, &local_err);
1bdc94
-- 
1bdc94
1.8.3.1
1bdc94