cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

26ba25
From 2bc98e9eaddaa3a7381b0f245ec37bb47f8baf81 Mon Sep 17 00:00:00 2001
26ba25
From: John Snow <jsnow@redhat.com>
26ba25
Date: Tue, 25 Sep 2018 22:34:20 +0100
26ba25
Subject: [PATCH 17/28] block/mirror: don't install backing chain on abort
26ba25
26ba25
RH-Author: John Snow <jsnow@redhat.com>
26ba25
Message-id: <20180925223431.24791-15-jsnow@redhat.com>
26ba25
Patchwork-id: 82277
26ba25
O-Subject: [RHEL8/rhel qemu-kvm PATCH 14/25] block/mirror: don't install backing chain on abort
26ba25
Bugzilla: 1632939
26ba25
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
26ba25
RH-Acked-by: Max Reitz <mreitz@redhat.com>
26ba25
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
26ba25
26ba25
In cases where we abort the block/mirror job, there's no point in
26ba25
installing the new backing chain before we finish aborting.
26ba25
26ba25
Signed-off-by: John Snow <jsnow@redhat.com>
26ba25
Message-id: 20180906130225.5118-6-jsnow@redhat.com
26ba25
Reviewed-by: Jeff Cody <jcody@redhat.com>
26ba25
Reviewed-by: Max Reitz <mreitz@redhat.com>
26ba25
Signed-off-by: Max Reitz <mreitz@redhat.com>
26ba25
(cherry picked from commit c2924ceaa7f1866148e2847c969fc1902a2524fa)
26ba25
Signed-off-by: John Snow <jsnow@redhat.com>
26ba25
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
26ba25
---
26ba25
 block/mirror.c | 2 +-
26ba25
 1 file changed, 1 insertion(+), 1 deletion(-)
26ba25
26ba25
diff --git a/block/mirror.c b/block/mirror.c
26ba25
index 9bed603..057db7c 100644
26ba25
--- a/block/mirror.c
26ba25
+++ b/block/mirror.c
26ba25
@@ -514,7 +514,7 @@ static void mirror_exit(Job *job)
26ba25
      * required before it could become a backing file of target_bs. */
26ba25
     bdrv_child_try_set_perm(mirror_top_bs->backing, 0, BLK_PERM_ALL,
26ba25
                             &error_abort);
26ba25
-    if (s->backing_mode == MIRROR_SOURCE_BACKING_CHAIN) {
26ba25
+    if (ret == 0 && s->backing_mode == MIRROR_SOURCE_BACKING_CHAIN) {
26ba25
         BlockDriverState *backing = s->is_none_mode ? src : s->base;
26ba25
         if (backing_bs(target_bs) != backing) {
26ba25
             bdrv_set_backing_hd(target_bs, backing, &local_err);
26ba25
-- 
26ba25
1.8.3.1
26ba25