From 8e9e73a984165d5e9a82ba1f4531bb30482db5a8 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 24 Jan 2020 14:14:58 +0100 Subject: [PATCH] qemu: snapshot: Always rewrite backingStore data when reusing existing images 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 Reviewed-by: Eric Blake --- 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 94703c67c2..a833951e47 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14699,7 +14699,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 { -- GitLab