libvirt/libvirt-qemu_tpm-Only-warn-about-missing-locking-feature-on-shared-filesystems.patch
Jiri Denemark 59d640378f libvirt-11.5.0-2.el10
- virSystemdCreateMachine: Document @maxthreds (RHEL-95361)
- cgroup: Unexport 'virDomainCgroupInitCgroup' (RHEL-95361)
- qemu: conf: Store 'autoShutdown' config in virDomainDriverAutoShutdownConfig (RHEL-95361)
- hypervisor: domain: Extract logic for auto shutdown to virDomainDriverAutoShutdownActive (RHEL-95361)
- virSystemdCreateMachine: Add flag to invert machined unit dependencies (RHEL-95361)
- cgroup: Plumb the 'daemonDomainShutdown' parameter of 'virSystemdCreateMachine' to drivers (RHEL-95361)
- qemu: Fix auto-shutdown of qemu VMs by the qemu driver (RHEL-95361)
- hypervisor: Split out individual steps out of virDomainDriverAutoShutdown (RHEL-95196)
- virDomainDriverAutoShutdownDoSave: Don't attempt to save transient VMs (RHEL-95196)
- virDomainDriverAutoShutdown: Refactor selection logic for VMs (RHEL-95196)
- tls: Don't require 'keyEncipherment' to be enabled altoghther (RHEL-100711)
- kbase: tlscerts: Drop 'encryption_key' feature request (RHEL-100711)
- tests: virnettls*test: Drop use of GNUTLS_KEY_KEY_ENCIPHERMENT (RHEL-100711)
- qemu_tpm: Rename qemuTPMHasSharedStorage -> qemuTPMDomainHasSharedStorage (RHEL-80155)
- qemu_tpm: Extract per-TPM functionality from qemuTPMDomainHasSharedStorage (RHEL-80155)
- qemu_tpm: Only warn about missing locking feature on shared filesystems (RHEL-80155)

Resolves: RHEL-100711, RHEL-80155, RHEL-95196, RHEL-95361
2025-07-18 13:14:31 +02:00

68 lines
2.7 KiB
Diff

From 0a38abe57db307e11f28710fd33b10b7dd2988b2 Mon Sep 17 00:00:00 2001
Message-ID: <0a38abe57db307e11f28710fd33b10b7dd2988b2.1752837271.git.jdenemar@redhat.com>
From: Martin Kletzander <mkletzan@redhat.com>
Date: Thu, 17 Jul 2025 11:58:32 +0200
Subject: [PATCH] qemu_tpm: Only warn about missing locking feature on shared
filesystems
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The warning pollutes the logs and might give a bad impression on someone
reading them even though the locking is not always needed. This way we
at least limit the logging in unnecessary cases.
Resolves: https://issues.redhat.com/browse/RHEL-80155
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 3451987fca7c89a1aa9c5b0701471b6bc23dda3d)
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
src/qemu/qemu_tpm.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c
index 855d732e60..cdbd6e3993 100644
--- a/src/qemu/qemu_tpm.c
+++ b/src/qemu/qemu_tpm.c
@@ -660,12 +660,16 @@ qemuTPMVirCommandSwtpmAddEncryption(virCommand *cmd,
static void
qemuTPMVirCommandSwtpmAddTPMState(virCommand *cmd,
- const virDomainTPMEmulatorDef *emulator)
+ const virDomainTPMEmulatorDef *emulator,
+ const virDomainTPMDef *tpmDef,
+ const virQEMUDriverConfig *cfg)
{
const char *lock = ",lock";
if (!virTPMSwtpmCapsGet(VIR_TPM_SWTPM_FEATURE_TPMSTATE_OPT_LOCK)) {
- VIR_WARN("This swtpm version doesn't support explicit locking");
+ if (qemuTPMHasSharedStorage(cfg, tpmDef))
+ VIR_WARN("This swtpm version doesn't support explicit locking");
+
lock = "";
}
@@ -721,7 +725,7 @@ qemuTPMEmulatorUpdateProfileName(virDomainTPMEmulatorDef *emulator,
virCommandAddArgList(cmd, "socket", "--print-info", "0x20", "--tpm2", NULL);
- qemuTPMVirCommandSwtpmAddTPMState(cmd, emulator);
+ qemuTPMVirCommandSwtpmAddTPMState(cmd, emulator, persistentTPMDef, cfg);
if (qemuTPMVirCommandSwtpmAddEncryption(cmd, emulator, swtpm) < 0)
return -1;
@@ -848,7 +852,7 @@ qemuTPMEmulatorBuildCommand(virDomainTPMDef *tpm,
virCommandAddArgFormat(cmd, "type=unixio,path=%s,mode=0600",
tpm->data.emulator.source->data.nix.path);
- qemuTPMVirCommandSwtpmAddTPMState(cmd, &tpm->data.emulator);
+ qemuTPMVirCommandSwtpmAddTPMState(cmd, &tpm->data.emulator, persistentTPMDef, cfg);
virCommandAddArg(cmd, "--log");
if (tpm->data.emulator.debug != 0)
--
2.50.1