thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

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

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