qemuDomainPrepareDiskSourceChain should set up the disk zero detection
mode only for the top level image. Since it's invoked also for the
middle of the chain we need to check that it's really only the top level
image.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_domain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 99656fcd6d..e459e1eeee 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -12404,7 +12404,8 @@ qemuDomainPrepareDiskSourceChain(virDomainDiskDefPtr disk,
src = disk->src;
/* transfer properties valid only for the top level image */
- src->detect_zeroes = disk->detect_zeroes;
+ if (src == disk->src)
+ src->detect_zeroes = disk->detect_zeroes;
for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
if (cfg &&
--
2.16.2