]> git.proxmox.com Git - pve-common.git/commitdiff
cpuset: also split write methods
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 1 Apr 2020 10:20:59 +0000 (12:20 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 1 Apr 2020 15:02:13 +0000 (17:02 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/CpuSet.pm

index a16f7ee0854f0f416d33ccfb7094f342d7b4fa6b..12bda2ce07a912d2a82ad208b507727bd7783a48 100644 (file)
@@ -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();