[pve-devel] [PATCH container] fix #4192: add new architecture-dependent path to check for newer versions of systemd

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Sep 12 11:43:41 CEST 2022


On 12/09/2022 11:30, Dominik Csapak wrote:
> On 9/12/22 11:30, Dominik Csapak wrote:
>>>>   # non systemd based containers work with pure cgroupv2
>>>>   sub unified_cgroupv2_support {
>>>> -    my ($self) = @_;
>>>> +    my ($self, $conf) = @_;
>>>
>>> why pass the whole config if you just need the arch? Please avoid overly generic
>>> parameter in signatures if only one specific thing is required.
>>>
>>
>> AFAICS, not even that is necessary, since a 'LXC::Setup' object has the config in self
>> so we could do there a '$self->{confg}->{arch}' and omit the parameter passing completely
> 
> i meant '$self->{conf}->{arch}' ofc
> 
>> (or am i missing something else here?) 


This is the plugin though, where $self isn't LXC::Setup but basing off LXC::Setup::Plugin,
and there we don't have any $conf object available, and we explicitly pass $conf to those
methods in most case, which I'd guess is where Leo copied this off from.
Still, I'd like to avoid that pattern for newer adaptions if possible, iow. if only using
up two or three config params at max, as heuristic.





More information about the pve-devel mailing list