Blame SOURCES/kvm-blockdev-enable-non-root-nodes-for-backup-source.patch

357786
From 305bd87b4d721989679d4c3407e355e032e2c005 Mon Sep 17 00:00:00 2001
357786
From: John Snow <jsnow@redhat.com>
357786
Date: Wed, 18 Jul 2018 22:54:46 +0200
357786
Subject: [PATCH 61/89] blockdev: enable non-root nodes for backup source
357786
357786
RH-Author: John Snow <jsnow@redhat.com>
357786
Message-id: <20180718225511.14878-11-jsnow@redhat.com>
357786
Patchwork-id: 81395
357786
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 10/35] blockdev: enable non-root nodes for backup source
357786
Bugzilla: 1207657
357786
RH-Acked-by: Eric Blake <eblake@redhat.com>
357786
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
357786
RH-Acked-by: Fam Zheng <famz@redhat.com>
357786
357786
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
357786
357786
This is needed to implement the image-fleecing workflow where we
357786
create a temporary node backed by an active node, then start
357786
backupdev-backup sync=none from the active node to the temp node.
357786
357786
In this case, the active node is now a root node AND a backing node,
357786
so it no longer qualifies as a root node, so we loosen the restriction
357786
on which nodes can be considered as the source for a backup.
357786
357786
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
357786
Reviewed-by: Eric Blake <eblake@redhat.com>
357786
Signed-off-by: John Snow <jsnow@redhat.com>
357786
Message-Id: <20180702194630.9360-2-jsnow@redhat.com>
357786
Signed-off-by: Eric Blake <eblake@redhat.com>
357786
(cherry picked from commit 930fe17f9900e9c879834f2d2e5c301992623332)
357786
Signed-off-by: John Snow <jsnow@redhat.com>
357786
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
---
357786
 blockdev.c | 4 ++--
357786
 1 file changed, 2 insertions(+), 2 deletions(-)
357786
357786
diff --git a/blockdev.c b/blockdev.c
357786
index 9beef10..baa7e18 100644
357786
--- a/blockdev.c
357786
+++ b/blockdev.c
357786
@@ -2010,7 +2010,7 @@ static void blockdev_backup_prepare(BlkActionState *common, Error **errp)
357786
     assert(common->action->type == TRANSACTION_ACTION_KIND_BLOCKDEV_BACKUP);
357786
     backup = common->action->u.blockdev_backup.data;
357786
 
357786
-    bs = qmp_get_root_bs(backup->device, errp);
357786
+    bs = bdrv_lookup_bs(backup->device, backup->device, errp);
357786
     if (!bs) {
357786
         return;
357786
     }
357786
@@ -3674,7 +3674,7 @@ BlockJob *do_blockdev_backup(BlockdevBackup *backup, JobTxn *txn,
357786
         backup->compress = false;
357786
     }
357786
 
357786
-    bs = qmp_get_root_bs(backup->device, errp);
357786
+    bs = bdrv_lookup_bs(backup->device, backup->device, errp);
357786
     if (!bs) {
357786
         return NULL;
357786
     }
357786
-- 
357786
1.8.3.1
357786