render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
a41c76
From 647f43ec778b6d5dafb256d5dbe4ad1f0a4e9776 Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <647f43ec778b6d5dafb256d5dbe4ad1f0a4e9776@dist-git>
a41c76
From: Peter Krempa <pkrempa@redhat.com>
a41c76
Date: Tue, 4 Feb 2020 15:07:47 +0100
a41c76
Subject: [PATCH] qemu: snapshot: Always rewrite backingStore data when reusing
a41c76
 existing images
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Don't adopt the backing store data when reusing images provided by the
a41c76
user. This will force a backing chain re-probe as users might have
a41c76
passed in something unexpected in the overlay where our view of the
a41c76
backing chain would not correspond.
a41c76
a41c76
This is done only for inactive snapshots as there we have way less
a41c76
verification.
a41c76
a41c76
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
a41c76
Reviewed-by: Eric Blake <eblake@redhat.com>
a41c76
(cherry picked from commit 8e9e73a984165d5e9a82ba1f4531bb30482db5a8)
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1524278
a41c76
Message-Id: <baa37a0240d05d2441a54e7ad1c1a8648c7e7f65.1580824112.git.pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 src/qemu/qemu_driver.c | 3 ++-
a41c76
 1 file changed, 2 insertions(+), 1 deletion(-)
a41c76
a41c76
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
a41c76
index e651c9e819..5c72db2544 100644
a41c76
--- a/src/qemu/qemu_driver.c
a41c76
+++ b/src/qemu/qemu_driver.c
a41c76
@@ -14678,7 +14678,8 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
a41c76
         if (virStorageSourceInitChainElement(newsrc, defdisk->src, false) < 0)
a41c76
             goto cleanup;
a41c76
 
a41c76
-        if (virStorageSourceHasBacking(defdisk->src)) {
a41c76
+        if (!reuse &&
a41c76
+            virStorageSourceHasBacking(defdisk->src)) {
a41c76
             defdisk->src->readonly = true;
a41c76
             newsrc->backingStore = g_steal_pointer(&defdisk->src);
a41c76
         } else {
a41c76
-- 
a41c76
2.25.0
a41c76