From 30a772170221f885e6d591bfc4e0cd2828e79dfc Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 19 Apr 2018 15:54:18 +0200 Subject: [PATCH] qemu: domain: Tolerate NULL 'cfg' in qemuDomainPrepareDiskSourceChain 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 Reviewed-by: John Ferlan --- 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 f732639cb1..b13e6d8ca4 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -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; -- 2.47.2