]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: hotplug: Do not try to add secret object for TLS if it does not exist
authorPeter Krempa <pkrempa@redhat.com>
Wed, 4 Jul 2018 14:28:58 +0000 (16:28 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 10 Jul 2018 15:32:58 +0000 (17:32 +0200)
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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_hotplug.c

index d22237b86e3fcd7285e003f1ec0f5e11ed811996..3dfa51b0a0fee36176b4c4a64fe78ced23b7f06a 100644 (file)
@@ -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;