From 3aca4865a8c76d72ba936953078e18dc417b6c82 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 10 Jul 2020 14:54:09 +0200 Subject: [PATCH] qemuDomainSecretHostdevDestroy: Don't clear secinfo alias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need the alias to deal with hot-unplug of the hostdev. Use qemuDomainSecretInfoDestroy which clears only the secrets and not the alias. The same function is used also for handling disk secrets. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 4a2daffc0a..26f70238ed 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1221,8 +1221,8 @@ qemuDomainSecretHostdevDestroy(virDomainHostdevDefPtr hostdev) if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) { srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(iscsisrc->src); - if (srcPriv && srcPriv->secinfo) - g_clear_pointer(&srcPriv->secinfo, qemuDomainSecretInfoFree); + if (srcPriv) + qemuDomainSecretInfoDestroy(srcPriv->secinfo); } } }