]> git.proxmox.com Git - pve-container.git/commitdiff
change cpu shares: hard-code cgroupv1 default parameter
authorFiona Ebner <f.ebner@proxmox.com>
Fri, 7 Oct 2022 12:41:42 +0000 (14:41 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 8 Nov 2022 13:51:28 +0000 (14:51 +0100)
so that the description of the default can be changed to reflect that
it depends on cgroup version.

Not strictly necessary, because the function currently will ignore the
value anyways. But certainly more future-proof then starting to pass
something invalid.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
src/PVE/LXC/Config.pm

index 2bdc9d850f72a103b74c8af4334ea06bc46054f5..f7820ed8bb751a98ea8a5d4bff56db6e12154755 100644 (file)
@@ -1343,7 +1343,7 @@ sub vmconfig_hotplug_pending {
            } elsif ($opt eq 'cpulimit') {
                $cgroup->change_cpu_quota(undef, undef); # reset, cgroup module can better decide values
            } elsif ($opt eq 'cpuunits') {
-               $cgroup->change_cpu_shares(undef, $confdesc->{cpuunits}->{default});
+               $cgroup->change_cpu_shares(undef, 1024);
            } elsif ($opt =~ m/^net(\d)$/) {
                my $netid = $1;
                PVE::Network::veth_delete("veth${vmid}i$netid");
@@ -1368,7 +1368,7 @@ sub vmconfig_hotplug_pending {
                my $quota = 100000 * $value;
                $cgroup->change_cpu_quota(int(100000 * $value), 100000);
            } elsif ($opt eq 'cpuunits') {
-               $cgroup->change_cpu_shares($value, $confdesc->{cpuunits}->{default});
+               $cgroup->change_cpu_shares($value, 1024);
            } elsif ($opt =~ m/^net(\d+)$/) {
                my $netid = $1;
                my $net = $class->parse_lxc_network($value);