On April 11, 2024 12:03 pm, Wolfgang Bumiller wrote:
> On Thu, Apr 11, 2024 at 09:23:53AM +0200, Fabian Grünbichler wrote:
>> On April 10, 2024 3:13 pm, Fabian Grünbichler wrote:
>> > Signed-off-by: Fabian Grünbichler <f.gruenbich...@proxmox.com>
>> > ---
>> >  src/PVE/API2/LXC/Config.pm | 21 +++++++++++++++++++++
>> >  1 file changed, 21 insertions(+)
>> > 
>> > diff --git a/src/PVE/API2/LXC/Config.pm b/src/PVE/API2/LXC/Config.pm
>> > index e6c0980..3fb3885 100644
>> > --- a/src/PVE/API2/LXC/Config.pm
>> > +++ b/src/PVE/API2/LXC/Config.pm
>> > @@ -208,6 +208,27 @@ __PACKAGE__->register_method({
>> >  
>> >        my $running = PVE::LXC::check_running($vmid);
>> >  
>> > +      my $usage = PVE::LXC::Config->get_pool_usage($conf);
>> > +      if (defined($param->{memory}) || defined($param->{swap})) {
>> > +          my $old = $usage->{mem};
>> > +          my $new = $param->{memory} || $usage->{memory};
>> > +          $new *= ($param->{swap} || $usage->{swap});
>> 
>> as Dominik pointed out off-list, this should be an addition, not a
>> multiplication..
> 
> Do we even want to mix mem & swap? Feels cgroupv1-y... (as in bad)

well, we want a single value (because both VMs and CTs count against the
pool limit, so counting swap separately doesn't make much sense..). I
guess we could either ignore swap altogether (assuming v2), or
conditionalize based on current cgroup mode?


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

Reply via email to