public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-container 2/3] use PVE::CGroup
Date: Fri, 30 Oct 2020 10:42:27 +0100	[thread overview]
Message-ID: <20201030094228.53423-3-aderumier@odiso.com> (raw)
In-Reply-To: <20201030094228.53423-1-aderumier@odiso.com>

---
 src/PVE/LXC.pm            | 7 ++++---
 src/lxc-pve-prestart-hook | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 9c150d9..5cfcf28 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -33,6 +33,7 @@ use PVE::GuestHelpers qw(safe_string_ne safe_num_ne safe_boolean_ne);
 use PVE::LXC::Tools;
 use PVE::LXC::CGroup;
 use PVE::LXC::Monitor;
+use PVE::CGroup;
 
 use Time::HiRes qw (gettimeofday);
 my $have_sdn;
@@ -402,9 +403,9 @@ sub parse_ipv4_cidr {
     die "unable to parse ipv4 address/mask\n";
 }
 
-# Deprecated. Use `PVE::LXC::CGroup::get_cgroup_controllers()` instead.
+# Deprecated. Use `PVE::CGroup::get_cgroup_controllers()` instead.
 sub get_cgroup_subsystems {
-    PVE::LXC::CGroup::get_v1_controllers();
+    PVE::CGroup::get_v1_controllers();
 }
 
 # With seccomp trap to userspace we now have the ability to optionally forward
@@ -708,7 +709,7 @@ sub update_lxc_config {
     }
 
     my $cpuset;
-    my ($cpuset_cgroup, $cpuset_version) = eval { PVE::LXC::CGroup::cpuset_controller_path() };
+    my ($cpuset_cgroup, $cpuset_version) = eval { PVE::CGroup::cpuset_controller_path() };
     if (defined($cpuset_cgroup)) {
 	$cpuset = eval { PVE::CpuSet->new_from_path("$cpuset_cgroup/lxc", 1) }
 	    || PVE::CpuSet->new_from_path($cpuset_cgroup, 1);
diff --git a/src/lxc-pve-prestart-hook b/src/lxc-pve-prestart-hook
index 8823cad..40d58c4 100755
--- a/src/lxc-pve-prestart-hook
+++ b/src/lxc-pve-prestart-hook
@@ -144,7 +144,7 @@ PVE::LXC::Tools::lxc_hook('pre-start', 'lxc', sub {
 sub cleanup_cgroups($) {
     my ($vmid) = @_;
 
-    if (PVE::LXC::CGroup::cgroup_mode() == 2) {
+    if (PVE::CGroup::cgroup_mode() == 2) {
 	rmdir_recursive("/sys/fs/cgroup/lxc/$vmid");
 	rmdir_recursive("/sys/fs/cgroup/lxc.monitor/$vmid");
     } else {
-- 
2.20.1




  parent reply	other threads:[~2020-10-30  9:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30  9:42 [pve-devel] [PATCH pve-container 0/3] use generic CGroup module Alexandre Derumier
2020-10-30  9:42 ` [pve-devel] [PATCH pve-container 1/3] Cgroups: use base PVE::CGroup and keep specific lxc code Alexandre Derumier
2020-10-30  9:42 ` Alexandre Derumier [this message]
2020-10-30  9:42 ` [pve-devel] [PATCH pve-container 3/3] cgroup: get_subdir: return cgroupv2 path for undef controller Alexandre Derumier
2020-11-24 10:45   ` Wolfgang Bumiller
2020-11-24 10:51 ` [pve-devel] partially applied series: [PATCH pve-container 0/3] use generic CGroup module 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=20201030094228.53423-3-aderumier@odiso.com \
    --to=aderumier@odiso.com \
    --cc=pve-devel@lists.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal