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(a)redhat.com>
---
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