From 8a0addab877a38979c11cc43470920fa82fd7cd7 Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Fri, 18 Jun 2021 13:36:40 +0200 Subject: [PATCH] vmstatus: don't set PID when VM is not running by avoiding int(undef) Reported-by: Thomas Lamprecht Signed-off-by: Fabian Ebner --- PVE/QemuServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 7630829f..6962d7d2 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -2654,7 +2654,7 @@ sub vmstatus { my $conf = PVE::QemuConfig->load_config($vmid); my $d = { vmid => int($vmid) }; - $d->{pid} = int($list->{$vmid}->{pid}); + $d->{pid} = int($list->{$vmid}->{pid}) if $list->{$vmid}->{pid}; # fixme: better status? $d->{status} = $list->{$vmid}->{pid} ? 'running' : 'stopped';