[libvirt] [PATCH 17/38] qemu: domain: Properly setup data relevant for top disk image

Peter Krempa posted 38 patches 6 years, 11 months ago
[libvirt] [PATCH 17/38] qemu: domain: Properly setup data relevant for top disk image
Posted by Peter Krempa 6 years, 11 months ago
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@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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 17/38] qemu: domain: Properly setup data relevant for top disk image
Posted by Ján Tomko 6 years, 11 months ago
On Wed, May 30, 2018 at 02:41:13PM +0200, Peter Krempa wrote:
>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@redhat.com>
>---
> src/qemu/qemu_domain.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list