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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2018-07-04 16:28:58 +02:00
parent ab435a4be4
commit 62ef8227e2

View 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;