all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 1/3] fix #5562: tpm: avoid warning about undefined value when version is not explicitly set
Date: Thu, 27 Jun 2024 13:03:15 +0200	[thread overview]
Message-ID: <20240627110317.23787-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20240627110317.23787-1-f.ebner@proxmox.com>

Fixes: f9dde219 ("fix #3075: add TPM v1.2 and v2.0 support via swtpm")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 5e2f5e2a..55ad8a7a 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3163,9 +3163,9 @@ sub start_swtpm {
 	    "--not-overwrite", # ignore existing state, do not modify
 	];
 
-	push @$setup_cmd, "--tpm2" if $tpm->{version} eq 'v2.0';
+	push @$setup_cmd, "--tpm2" if $tpm->{version} && $tpm->{version} eq 'v2.0';
 	# TPM 2.0 supports ECC crypto, use if possible
-	push @$setup_cmd, "--ecc" if $tpm->{version} eq 'v2.0';
+	push @$setup_cmd, "--ecc" if $tpm->{version} && $tpm->{version} eq 'v2.0';
 
 	run_command($setup_cmd, outfunc => sub {
 	    print "swtpm_setup: $1\n";
@@ -3189,7 +3189,7 @@ sub start_swtpm {
 	"--log",
 	"file=/run/qemu-server/$vmid-swtpm.log,level=1,prefix=$log_prefix",
     ];
-    push @$emulator_cmd, "--tpm2" if $tpm->{version} eq 'v2.0';
+    push @$emulator_cmd, "--tpm2" if $tpm->{version} && $tpm->{version} eq 'v2.0';
     run_command($emulator_cmd, outfunc => sub { print $1; });
 
     my $tries = 100; # swtpm may take a bit to start before daemonizing, wait up to 5s for pid
-- 
2.39.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2024-06-27 11:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 11:03 [pve-devel] [PATCH qemu-server 0/3] minor tpm state handling improvements Fiona Ebner
2024-06-27 11:03 ` Fiona Ebner [this message]
2024-06-27 11:03 ` [pve-devel] [PATCH qemu-server 2/3] drive: tpm: fix default version in schema Fiona Ebner
2024-06-27 11:03 ` [pve-devel] [PATCH qemu-server 3/3] fix #5563: api: update vm: prohibit changing version of TPM state Fiona Ebner
2024-06-27 11:27   ` Fiona Ebner
2024-07-01  8:45 ` [pve-devel] applied: [PATCH qemu-server 0/3] minor tpm state handling improvements Fabian Grünbichler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240627110317.23787-2-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal