From: Peter Krempa Date: Wed, 4 Jul 2018 14:28:58 +0000 (+0200) Subject: qemu: hotplug: Do not try to add secret object for TLS if it does not exist X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=62ef8227e2717618c96fa17f2d4f5b7570bbe980;p=libvirt.git qemu: hotplug: Do not try to add secret object for TLS if it does not exist The check whether the object holding secret for decryption of the TLS environment was wrong and would always attempt to add the object. This lead to a crash due to recent refactors. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1598015 Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index d22237b86e..3dfa51b0a0 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1341,7 +1341,7 @@ qemuDomainAddTLSObjects(virQEMUDriverPtr driver, if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) return -1; - if (secProps && + if (secProps && *secProps && qemuMonitorAddObject(priv->mon, secProps, &secAlias) < 0) goto error;