]> git.proxmox.com Git - pve-container.git/commitdiff
vmstatus: correctly set numver of used cpus
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 30 Oct 2015 09:01:12 +0000 (10:01 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 30 Oct 2015 09:01:12 +0000 (10:01 +0100)
return the number of host cpus if cpulimit is 0. This also avoid a
division by zero error.

src/PVE/LXC.pm

index e3160e48bb4c3e9faf5981218fdd9ea4c44dddb2..7c1ea534998135233129355a27d70ca420064826 100644 (file)
@@ -809,7 +809,7 @@ sub vmstatus {
        $d->{name} = $conf->{'hostname'} || "CT$vmid";
        $d->{name} =~ s/[\s]//g;
 
-       $d->{cpus} = $conf->{cpulimit} // 0;
+       $d->{cpus} = $conf->{cpulimit} || $cpucount;
 
        if ($running) {
            my $res = get_container_disk_usage($vmid);