[libvirt] [PATCH 04/35] qemu: domain: Carefuly transfer configuration from disk to storage source

Peter Krempa posted 35 patches 7 years ago
[libvirt] [PATCH 04/35] qemu: domain: Carefuly transfer configuration from disk to storage source
Posted by Peter Krempa 7 years ago
Some properties don't make sense to be configured for every single layer
of the backing chain, but to avoid needing to pass the disk structure we
will copy them to the individual virStorageSource-s

Zero detection is applied only for the top layer image, while caching
and iomode for all layers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_domain.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 2c5de9508b..109f4f7f36 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11844,6 +11844,9 @@ qemuDomainPrepareDiskSourceChain(virDomainDiskDefPtr disk,
     if (!src)
         src = disk->src;

+    /* transfer properties valid only for the top level image */
+    src->detect_zeroes = disk->detect_zeroes;
+
     for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
         if (n->type == VIR_STORAGE_TYPE_NETWORK &&
             n->protocol == VIR_STORAGE_NET_PROTOCOL_GLUSTER &&
@@ -11854,6 +11857,11 @@ qemuDomainPrepareDiskSourceChain(virDomainDiskDefPtr disk,

         if (qemuDomainValidateStorageSource(n, qemuCaps) < 0)
             return -1;
+
+        /* transfer properties valid for the full chain */
+        n->iomode = disk->iomode;
+        n->cachemode = disk->cachemode;
+        n->discard = disk->discard;
     }

     return 0;
-- 
2.16.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 04/35] qemu: domain: Carefuly transfer configuration from disk to storage source
Posted by John Ferlan 7 years ago

On 04/25/2018 11:15 AM, Peter Krempa wrote:
> Some properties don't make sense to be configured for every single layer
> of the backing chain, but to avoid needing to pass the disk structure we
> will copy them to the individual virStorageSource-s

Source's ???

or just without the -s

> 
> Zero detection is applied only for the top layer image, while caching
> and iomode for all layers.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/qemu/qemu_domain.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

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