]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: domain: Tolerate NULL 'cfg' in qemuDomainPrepareDiskSourceChain
authorPeter Krempa <pkrempa@redhat.com>
Thu, 19 Apr 2018 13:54:18 +0000 (15:54 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 7 May 2018 13:42:33 +0000 (15:42 +0200)
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>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_domain.c

index f732639cb16721930a95c6f2406402543139298f..b13e6d8ca4f5449c169a132da3434c36bf15e8fc 100644 (file)
@@ -11871,7 +11871,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;