]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_tpm: Do not use persistent definition during pre-start checks
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 18 Jul 2025 12:47:58 +0000 (14:47 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 21 Jul 2025 08:06:45 +0000 (10:06 +0200)
commit3a39cfacc36b26be559ab6217fce2a44a2b15159
tree597e1642f722870ebc15cbdce9ae81b36db5072f
parent93c1571d90b3d875d918c2cbc2c46e5634173d4e
qemu_tpm: Do not use persistent definition during pre-start checks

Commit 3451987fca7c used the persistent TPM Definition in both calls to
qemuTPMVirCommandSwtpmAddTPMState() but in one of the two cases it
might've been NULL and what's more, it is not the right definition which
should've been used.  Change that to @tpm which is the current
definition.  The other call does not have access to the current
definition and is only called during updating the profile.  But for the
sake of fewer future mistakes, keep the other one as is because there is
no issue with calling it that way and adding logic that just skips the
extra check on NULL could mistake someone in the future.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_tpm.c