]> git.proxmox.com Git - pve-container.git/commitdiff
use float for cpulimit
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 2 Jun 2015 13:33:30 +0000 (15:33 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 2 Jun 2015 13:33:30 +0000 (15:33 +0200)
src/PVE/LXC.pm

index a943d7b9be760850f84592ef93c164e779ccf20a..0f339c4d28ae2a3dd412550953a5e9434b886abd 100644 (file)
@@ -532,7 +532,7 @@ my $confdesc = {
     startup => get_standard_option('pve-startup-order'),
     cpulimit => {
        optional => 1,
-       type => 'integer',
+       type => 'number',
        description => "Limit of CPU usage. Note if the computer has 2 CPUs, it has total of '2' CPU time. Value '0' indicates no CPU limit.",
        minimum => 0,
        maximum => 128,
@@ -916,7 +916,7 @@ sub lxc_conf_to_pve {
            my $cfs_quota_us = $lxc_conf->{'lxc.cgroup.cpu.cfs_quota_us'};
            
            if ($cfs_period_us && $cfs_quota_us) {
-               $conf->{$k} = int($cfs_quota_us/$cfs_period_us);
+               $conf->{$k} = $cfs_quota_us/$cfs_period_us;
            } else {
                $conf->{$k} = 0;
            }