mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
qemu: domain: Destroy secrets for complete backing chain
This commit is contained in:
parent
e53a42f0f6
commit
d565877312
@ -1325,6 +1325,19 @@ qemuDomainSecretInfoTLSNew(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
qemuDomainSecretStorageSourceDestroy(virStorageSourcePtr src)
|
||||||
|
{
|
||||||
|
qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
|
||||||
|
|
||||||
|
if (srcPriv && srcPriv->secinfo)
|
||||||
|
qemuDomainSecretInfoFree(&srcPriv->secinfo);
|
||||||
|
|
||||||
|
if (srcPriv && srcPriv->encinfo)
|
||||||
|
qemuDomainSecretInfoFree(&srcPriv->encinfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* qemuDomainSecretDiskDestroy:
|
/* qemuDomainSecretDiskDestroy:
|
||||||
* @disk: Pointer to a disk definition
|
* @disk: Pointer to a disk definition
|
||||||
*
|
*
|
||||||
@ -1333,13 +1346,10 @@ qemuDomainSecretInfoTLSNew(virConnectPtr conn,
|
|||||||
void
|
void
|
||||||
qemuDomainSecretDiskDestroy(virDomainDiskDefPtr disk)
|
qemuDomainSecretDiskDestroy(virDomainDiskDefPtr disk)
|
||||||
{
|
{
|
||||||
qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src);
|
virStorageSourcePtr next;
|
||||||
|
|
||||||
if (srcPriv && srcPriv->secinfo)
|
for (next = disk->src; virStorageSourceIsBacking(next); next = next->backingStore)
|
||||||
qemuDomainSecretInfoFree(&srcPriv->secinfo);
|
qemuDomainSecretStorageSourceDestroy(next);
|
||||||
|
|
||||||
if (srcPriv && srcPriv->encinfo)
|
|
||||||
qemuDomainSecretInfoFree(&srcPriv->encinfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user