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 <pkrempa@xxxxxxxxxx> --- 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 248e259634..3141a94136 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1216,8 +1216,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); } } } -- 2.26.2