qemu: hotplug: Fix TLS setup on disk hotplug

We need to check if TLS is enabled as the variable is a tristate.
Currently we'd setup TLS even if it was explicitly turned off.
Thankfully TLS for disks was only used with the vxhs protocol so hardly
anybody would ever be able to hit the problem.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Peter Krempa 2018-06-01 17:21:02 +02:00
parent 0b9451f9d6
commit c495905bff

View File

@ -468,7 +468,7 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver,
else if (rv > 0)
prdStarted = true;
if (disk->src->haveTLS &&
if (disk->src->haveTLS == VIR_TRISTATE_BOOL_YES &&
qemuDomainAddDiskSrcTLSObject(driver, vm, disk->src) < 0)
goto error;