by avoiding int(undef)

Reported-by: Thomas Lamprecht <t.lampre...@proxmox.com>
Signed-off-by: Fabian Ebner <f.eb...@proxmox.com>
---

LXC does not have the same problem as it's guarded by a check that the container
is active already.

 PVE/QemuServer.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 7630829..6962d7d 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';
-- 
2.30.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to