5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-08 21:18:03 +03:00

vmstatus: don't set PID when VM is not running

by avoiding int(undef)

Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner 2021-06-18 13:36:40 +02:00 committed by Thomas Lamprecht
parent a200af1084
commit 8a0addab87

View File

@ -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';