From: Daniel P. Berrangé Date: Wed, 24 Nov 2021 10:56:02 +0000 (+0000) Subject: util: fix cache invalidation of swtpm capabilities X-Git-Tag: v7.10.0-rc1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e18fff6c85485e45ea17385862b80af9dc37383e;p=thirdparty%2Flibvirt.git util: fix cache invalidation of swtpm capabilities The check for whether the swtpm binary was modified is checking pointers to the mtime field in two distinct structs, so will always compare different. This resulted in re-probing swtpm capabilities every time, as many as 20 times for a single VM launch. Fixes: commit 01cf7a1bb9f1da27ad8bcbaa82c4f7a948c6a793 Author: Stefan Berger Date: Thu Jul 25 14:22:04 2019 -0400 tpm: Check whether previously found executables were updated Reviewed-by: Michal Privoznik Reviewed-by: Martin Kletzander Reviewed-by: Ján Tomko Signed-off-by: Daniel P. Berrangé --- diff --git a/src/util/virtpm.c b/src/util/virtpm.c index 7fa870b803..2c0dd707b0 100644 --- a/src/util/virtpm.c +++ b/src/util/virtpm.c @@ -301,7 +301,7 @@ virTPMEmulatorInit(void) findit = true; if (!findit && - &statbuf.st_mtime != &prgs[i].stat->st_mtime) + statbuf.st_mtime != prgs[i].stat->st_mtime) findit = true; }