tpm_emulator: Avoid double initialization during migration
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Mon, 1 Aug 2022 14:25:25 +0000 (15:25 +0100)
committerStefan Berger <stefanb@linux.ibm.com>
Fri, 9 Sep 2022 21:55:45 +0000 (17:55 -0400)
commita0bcec03761477371ff7c2e80dc07fff14222d92
tree9bdd6968b7d5bfbc7c08ae16a3ba808999bd4e9b
parent79dfa177ae348bb5ab5f97c0915359b13d6186e2
tpm_emulator: Avoid double initialization during migration

When resuming after a migration, the backend sends CMD_INIT to the
emulator from the startup callback, then it sends the migration state
from the vmstate to the emulator, then it sends CMD_INIT again. Skip the
first CMD_INIT during a migration to avoid initializing the TPM twice.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
backends/tpm/tpm_emulator.c