mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-13 16:28:37 +00: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 $conf = PVE::QemuConfig->load_config($vmid);
|
||||||
|
|
||||||
my $d = { vmid => int($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?
|
# fixme: better status?
|
||||||
$d->{status} = $list->{$vmid}->{pid} ? 'running' : 'stopped';
|
$d->{status} = $list->{$vmid}->{pid} ? 'running' : 'stopped';
|
||||||
|
Loading…
Reference in New Issue
Block a user