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

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