From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Oguz Bektas <o.bektas@proxmox.com>,
Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Wolfgang Bumiller <w.bumiller@proxmox.com>
Subject: Re: [pve-devel] [PATCH container v3] fix #3516: fix unmanaged containers
Date: Tue, 20 Jul 2021 13:59:45 +0200 [thread overview]
Message-ID: <95dc2d98-ec11-e8c9-1761-9fe91d18af1a@proxmox.com> (raw)
In-Reply-To: <YPa432Ubk3HI2L5a@gaia>
On 20.07.21 13:51, Oguz Bektas wrote:
> On Tue, Jul 20, 2021 at 01:49:45PM +0200, Thomas Lamprecht wrote:
>> On 20.07.21 13:40, Wolfgang Bumiller wrote:
>>> On Wed, Jul 14, 2021 at 11:51:51AM +0200, Oguz Bektas wrote:
>>>> unmanaged containers should run the unified cgroupv2 code from our base
>>>> plugin so that they can start correctly instead of erroring out
>>>>
>>>> Tested-by: Stoiko Ivanov <s.ivanov@proxmox.com>
>>>> Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
>>>> Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
>>>> ---
>>>> v2-> v3:
>>>> * added comment from stoiko's reply
>>>>
>>>>
>>>> src/PVE/LXC/Setup.pm | 4 ++++
>>>> 1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm
>>>> index 9abdc85..4408dcc 100644
>>>> --- a/src/PVE/LXC/Setup.pm
>>>> +++ b/src/PVE/LXC/Setup.pm
>>>> @@ -424,6 +424,10 @@ sub get_ct_os_release {
>>>> sub unified_cgroupv2_support {
>>>> my ($self) = @_;
>>>>
>>>> + # code in base plugin is a generic check and should work
>>>> + # for most distributions
>>>> + $self->{plugin} //= 'PVE::LXC::Setup::Base'; # unmanaged
>>>
>>> This has the side effect that all later checks for unmanaged containers
>>> via `$self->{plugin}` are broken.
>>> Please either move this *into* the `protected_call` below (and add a
>>> comment that the assignment is temporary due to how `protected_call`
>>> works), or cleanup this change afterwards (but that would need to be
>>> `die`-safe (iow. would need an eval around the `protected_call`)
>>>
>>
>> for that it could have just used a local variable, e.g.:
>>
>> my $plugin = $self->{plugin} // 'PVE::LXC::Setup::Base'; # fallback to base for unmanaged
>>
>> $self->protected_call(sub { $plugin->unified_cgroupv2_support() });
>>
>> but I'd rather avoid adding more of those "unmanaged hacks" in general.
>
> i think this is acceptable approach, if you don't mind i'd send another
> version with that.
no. As said, I do not want any more hacks even if they're at least correct
like the proposal.
>
> or we can simply skip it like in the v1 but with a true return value to
> omit systemd error message
>
or we can avoid further hacks, separate the plugin ABI in an actual "interface only"
module which base and a new unmanaged plugin depends on, so that we can actually drop
that special case and with it all the `return if !$self->{plugin}; # unmanaged` stanzas
completely...
next prev parent reply other threads:[~2021-07-20 12:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-14 9:51 Oguz Bektas
2021-07-20 11:29 ` Oguz Bektas
2021-07-20 11:44 ` Thomas Lamprecht
2021-07-20 11:40 ` Wolfgang Bumiller
2021-07-20 11:49 ` Thomas Lamprecht
2021-07-20 11:51 ` Oguz Bektas
2021-07-20 11:59 ` Thomas Lamprecht [this message]
2021-07-20 12:08 ` Wolfgang Bumiller
2021-07-20 11:50 ` Wolfgang Bumiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=95dc2d98-ec11-e8c9-1761-9fe91d18af1a@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=o.bektas@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=w.bumiller@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox