mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Windows reboot recreates the TPM device while the swtpm process keeps running. Leaving the transferred data fd open made a later CmdSetDatafd fail, and the backend could remain unstarted after CmdInit. Close both ends on setup failure, close the local transferred fd after success, close the data fd on drop, and issue TPM2_Startup(CLEAR) after CmdInit while tolerating an already-started TPM. Assisted-by: Copilot:GPT-5.5 Signed-off-by: Wei Liu <liuwe@microsoft.com>