From nobody Fri Apr 19 10:22:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1637751545; cv=none; d=zohomail.com; s=zohoarc; b=YrAjcb2wqlYY/qkfgn+Fzq7MH3qV4LrRyBcMUVQikElD4WNTDmRMGd+dM0Ot4VaC1JFgNu9ts3wWUiGbOxEiCly967PF0tMsOx8CvKlgctKyZ9fQ9GZ+hmeuFycWcwsx/RYPGXkv/uPGZd7OClidV7b3QK4hOLgHTAMpHGxGSDc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637751545; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ScdARQRVqXU3b+jHdEsG5TXUMRbo6YORvYfy6G8ltEU=; b=TX8W6AQFkfpU8LLYrs9gpMDbEfPbGZmQ0qk0N5o9NiiGONepHLg41el+ALpen/wRs8jzWvwT4Nruic6Nm5OK6Y+QsA+y/HnGFzHBtbstgDdoqJ9BRoAU+kG7rf48cH+BVx7O4UOafJtwomoL3k4UN7gLbl/c/qH/8wIEo+BL6DA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 16377515458351018.2125232885377; Wed, 24 Nov 2021 02:59:05 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-541-ma6v4t6CPLu2Q-0ACuSucg-1; Wed, 24 Nov 2021 05:59:02 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8575D1006AA0; Wed, 24 Nov 2021 10:58:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 856D026DEA; Wed, 24 Nov 2021 10:58:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 45F084BB7C; Wed, 24 Nov 2021 10:58:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AOAwpQF022911 for ; Wed, 24 Nov 2021 05:58:51 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1050460CC3; Wed, 24 Nov 2021 10:58:51 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71C1C60C05; Wed, 24 Nov 2021 10:58:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637751544; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ScdARQRVqXU3b+jHdEsG5TXUMRbo6YORvYfy6G8ltEU=; b=U4njg6oWHfDaSrswy2U7BMrZ9HygPwImR3FS7PBL6CYxQ2be25pWp3bI8NLRjNA0sOTbbR bLy3ts2TfUrjGKMOz/IBAV0YmKQ23sXGbrvqFoaP3XBSSmmSI8U+lEapAo1/uc960f6zV7 HlXP1MbmWmHn1UKCYgPUowBi2rd9hCw= X-MC-Unique: ma6v4t6CPLu2Q-0ACuSucg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [PATCH] util: fix cache invalidation of swtpm capabilities Date: Wed, 24 Nov 2021 10:58:38 +0000 Message-Id: <20211124105838.243746-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637751546916100001 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 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- src/util/virtpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virtpm.c b/src/util/virtpm.c index 8a77ba98ff..ffec23a535 100644 --- a/src/util/virtpm.c +++ b/src/util/virtpm.c @@ -301,7 +301,7 @@ virTPMEmulatorInit(void) findit =3D true; =20 if (!findit && - &statbuf.st_mtime !=3D &prgs[i].stat->st_mtime) + statbuf.st_mtime !=3D prgs[i].stat->st_mtime) findit =3D true; } =20 --=20 2.33.1