[PATCH v2 1/2] qemu: snapshot: Always rewrite backingStore data when reusing existing images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Don't adopt the backing store data when reusing images provided by the
user. This will force a backing chain re-probe as users might have
passed in something unexpected in the overlay where our view of the
backing chain would not correspond.

This is done only for inactive snapshots as there we have way less
verification.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0b23c747ce..e5e7b05e93 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14676,7 +14676,8 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
         if (virStorageSourceInitChainElement(newsrc, defdisk->src, false) < 0)
             goto cleanup;

-        if (virStorageSourceHasBacking(defdisk->src)) {
+        if (!reuse &&
+            virStorageSourceHasBacking(defdisk->src)) {
             defdisk->src->readonly = true;
             newsrc->backingStore = g_steal_pointer(&defdisk->src);
         } else {
-- 
2.24.1





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux