[libvirt] [PATCH 23/35] qemu: domain: Tolerate NULL 'cfg' in qemuDomainPrepareDiskSourceChain

Peter Krempa posted 35 patches 7 years ago
[libvirt] [PATCH 23/35] qemu: domain: Tolerate NULL 'cfg' in qemuDomainPrepareDiskSourceChain
Posted by Peter Krempa 7 years ago
The function will be reused in the test code where we don't care much
that the gluster debug level can't be populated from the qemu config.

Set the level only when 'cfg' is passed.

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 079655de87..564e4e7957 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11881,7 +11881,8 @@ qemuDomainPrepareDiskSourceChain(virDomainDiskDefPtr disk,
     src->detect_zeroes = disk->detect_zeroes;

     for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
-        if (n->type == VIR_STORAGE_TYPE_NETWORK &&
+        if (cfg &&
+            n->type == VIR_STORAGE_TYPE_NETWORK &&
             n->protocol == VIR_STORAGE_NET_PROTOCOL_GLUSTER &&
             virQEMUCapsGet(qemuCaps, QEMU_CAPS_GLUSTER_DEBUG_LEVEL)) {
             n->debug = true;
-- 
2.16.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 23/35] qemu: domain: Tolerate NULL 'cfg' in qemuDomainPrepareDiskSourceChain
Posted by John Ferlan 7 years ago

On 04/25/2018 11:15 AM, Peter Krempa wrote:
> The function will be reused in the test code where we don't care much
> that the gluster debug level can't be populated from the qemu config.
> 
> Set the level only when 'cfg' is passed.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/qemu/qemu_domain.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

Doubt very much anyone wants/needs gluster debugging in test output ;-)

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

John

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