mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu_tpm: Try harder to create emulator state
If a per-domain SWTPM state directory exists but is empty our code still considers it a valid state and skips running 'swtpm_setup' (handled in qemuTPMEmulatorRunSetup()). While we should not try to inspect individual files created by swtpm, we can still consider empty folder as non-existent state. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/320 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
1b33578854
commit
6c3ef66cc6
@ -186,7 +186,8 @@ qemuTPMEmulatorCreateStorage(virDomainTPMDef *tpm,
|
||||
|
||||
*created = false;
|
||||
|
||||
if (!virFileExists(storagepath))
|
||||
if (!virFileExists(storagepath) ||
|
||||
virDirIsEmpty(storagepath, true) > 0)
|
||||
*created = true;
|
||||
|
||||
if (virDirCreate(storagepath, 0700, swtpm_user, swtpm_group,
|
||||
|
Loading…
x
Reference in New Issue
Block a user