[pve-devel] [PATCH common 2/2] cpuset: also split write methods

w.bumiller at proxmox.com w.bumiller at proxmox.com
Wed Apr 1 12:20:59 CEST 2020


From: Wolfgang Bumiller <w.bumiller at proxmox.com>

Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 src/PVE/CpuSet.pm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/PVE/CpuSet.pm b/src/PVE/CpuSet.pm
index a16f7ee..12bda2c 100644
--- a/src/PVE/CpuSet.pm
+++ b/src/PVE/CpuSet.pm
@@ -15,6 +15,7 @@ sub new {
 }
 
 # Create a new set with the contents of a cgroup-v1 subdirectory.
+# Deprecated:
 sub new_from_cgroup {
     my ($class, $cgroup, $effective) = @_;
 
@@ -66,10 +67,19 @@ sub parse_cpuset {
     return ($count, $members);
 }
 
+# Deprecated:
 sub write_to_cgroup {
     my ($self, $cgroup) = @_;
 
-    my $filename = "/sys/fs/cgroup/cpuset/$cgroup/cpuset.cpus";
+    return $self->write_to_path("/sys/fs/cgroup/cpuset/$cgroup");
+}
+
+# Takes the cgroup directory containing the cpuset.cpus file (to be closer to
+# new_from_path behavior this doesn't take the complete file name).
+sub write_to_path {
+    my ($self, $path) = @_;
+
+    my $filename = "$path/cpuset.cpus";
 
     my $value = '';
     my @members = $self->members();
-- 
2.20.1





More information about the pve-devel mailing list