render / rpms / libvirt

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