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:
parent
a200af1084
commit
8a0addab87
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user