]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: tpm: Pass --migration option to swtpm if supported and needed
authorStefan Berger <stefanb@linux.ibm.com>
Mon, 24 Oct 2022 10:28:46 +0000 (06:28 -0400)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 9 Nov 2022 11:26:35 +0000 (12:26 +0100)
commit188dfeb3987683e921398ae53f107cca68cadc4c
tree0834445724f63e5500cdd357a3500a3be0b90c4a
parent5597476e403cbd258cc2ef3652a83148d9e0e50b
qemu: tpm: Pass --migration option to swtpm if supported and needed

Pass the --migration option to swtpm if swptm supports it (starting
with v0.8) and if the TPM's state is written on shared storage. If this
is the case apply the 'release-lock-outgoing' parameter with this
option and apply the 'incoming' parameter for incoming migration so that
swtpm releases the file lock on the source side when the state is migrated
and locks the file on the destination side when the state is received.

If a started swtpm instance is running with the necessary options of
migrating with share storage then remember this with a flag in the
virDomainTPMPrivateDef.

Report an error if swtpm does not support the --migration option and an
incoming migration across shared storage is requested.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_migration.c
src/qemu/qemu_tpm.c
src/qemu/qemu_tpm.h