mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: Introduce qemuTPMEmulatorCleanupHost()
This leaves qemuExtTPMCleanupHost() to only deal with looping over TPM devices, same as other qemuExtTPMDoThing() functions. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
5d35e2f2cc
commit
c2c8cf3ed4
@ -259,6 +259,20 @@ qemuTPMEmulatorGetPid(const char *swtpmStateDir,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* qemuTPMEmulatorCleanupHost:
|
||||
* @tpm: TPM definition
|
||||
*
|
||||
* Clean up persistent storage for the swtpm.
|
||||
*/
|
||||
static void
|
||||
qemuTPMEmulatorCleanupHost(virDomainTPMDef *tpm)
|
||||
{
|
||||
if (!tpm->data.emulator.persistent_state)
|
||||
qemuTPMEmulatorDeleteStorage(tpm);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* qemuTPMEmulatorPrepareHost:
|
||||
*
|
||||
@ -885,8 +899,7 @@ qemuExtTPMCleanupHost(virDomainDef *def)
|
||||
if (def->tpms[i]->type != VIR_DOMAIN_TPM_TYPE_EMULATOR)
|
||||
continue;
|
||||
|
||||
if (!def->tpms[i]->data.emulator.persistent_state)
|
||||
qemuTPMEmulatorDeleteStorage(def->tpms[i]);
|
||||
qemuTPMEmulatorCleanupHost(def->tpms[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user