public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] vm start: only print tpm-related message if there is an instance
@ 2021-10-27  6:49 Fabian Ebner
  2021-10-27 11:23 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Ebner @ 2021-10-27  6:49 UTC (permalink / raw)
  To: pve-devel

Otherwise, this can produce an undef warning and be misleading.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 56f442c..6ee7b55 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5453,8 +5453,10 @@ sub vm_start_nolock {
 
 	    my $exitcode = run_command($cmd, %run_params);
 	    if ($exitcode) {
-		warn "stopping swtpm instance (pid $tpmpid) due to QEMU startup error\n";
-		kill 'TERM', $tpmpid if $tpmpid;
+		if ($tpmpid) {
+		    warn "stopping swtpm instance (pid $tpmpid) due to QEMU startup error\n";
+		    kill 'TERM', $tpmpid;
+		}
 		die "QEMU exited with code $exitcode\n";
 	    }
 	};
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-27 11:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27  6:49 [pve-devel] [PATCH qemu-server] vm start: only print tpm-related message if there is an instance Fabian Ebner
2021-10-27 11:23 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal