From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1D65165E37 for ; Thu, 5 Nov 2020 11:35:57 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0CB171683E for ; Thu, 5 Nov 2020 11:35:27 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 934B716834 for ; Thu, 5 Nov 2020 11:35:26 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 5A4234601A; Thu, 5 Nov 2020 11:35:26 +0100 (CET) Date: Thu, 5 Nov 2020 11:35:25 +0100 From: Wolfgang Bumiller To: Alexandre Derumier Cc: pve-devel@lists.proxmox.com Message-ID: <20201105103525.mdljzdwpdx6cszhd@olga.proxmox.com> References: <20201030094217.53131-1-aderumier@odiso.com> <20201030094217.53131-3-aderumier@odiso.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201030094217.53131-3-aderumier@odiso.com> User-Agent: NeoMutt/20180716 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.010 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [cgroup.pm] Subject: Re: [pve-devel] [PATCH pve-common 2/4] Cgroups: remove specific lxc code X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2020 10:35:57 -0000 On Fri, Oct 30, 2020 at 10:42:15AM +0100, Alexandre Derumier wrote: > --- > src/PVE/CGroup.pm | 46 ++++------------------------------------------ > 1 file changed, 4 insertions(+), 42 deletions(-) > > diff --git a/src/PVE/CGroup.pm b/src/PVE/CGroup.pm > index 7e12af9..f542b3a 100644 > --- a/src/PVE/CGroup.pm > +++ b/src/PVE/CGroup.pm > @@ -162,42 +161,6 @@ sub cpuset_controller_path() { > return wantarray ? ($CG_PATH_CPUSET, $CG_VER_CPUSET) : $CG_PATH_CPUSET; > } > > -# Get a subdirectory (without the cgroup mount point) for a controller. > -# > -# If `$controller` is `undef`, get the unified (cgroupv2) path. > -# > -# Note that in cgroup v2, lxc uses the activated controller names > -# (`cgroup.controllers` file) as list of controllers for the unified hierarchy, > -# so this returns a result when a `controller` is provided even when using > -# a pure cgroupv2 setup. > -my sub get_subdir { Since this is now an abstract base class, instead of removing, please add a dummy with our usual `die "implement in subclass";`, keeping the parameter list visible: sub get_subdir { my ($self, $controller, $limiting) = @_; die "imlement in subclass"; } > - my ($self, $controller, $limiting) = @_; > - > - my $entry_name = $controller || 'unified'; > - my $entry = ($self->{controllers}->{$entry_name} //= {}); > - > - my $kind = $limiting ? 'limit' : 'ns'; > - my $path = $entry->{$kind}; > - > - return $path if defined $path; > - > - $path = PVE::LXC::Command::get_cgroup_path( > - $self->{vmid}, > - $controller, > - $limiting, > - ) or return undef; > - > - # untaint: > - if ($path =~ /\.\./) { > - die "lxc returned suspicious path: '$path'\n"; > - } > - ($path) = ($path =~ /^(.*)$/s); > - > - $entry->{$kind} = $path; > - > - return $path; > -} > - > # Get path and version for a controller. > # > # `$controller` may be `undef`, see get_subdir above for details.