]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/CpuSet.pm
cpuset: replace 'kind' with an 'effective' boolean
[pve-common.git] / src / PVE / CpuSet.pm
index aab2c9a7f454197f47ab59f79a064241a0d17e48..fe36536badc8bdb50fdcf97a4e67ab0892da2a4d 100644 (file)
@@ -14,10 +14,11 @@ sub new {
     return $self;
 }
 
+# Create a new set with the contents of a cgroup-v1 subdirectory
 sub new_from_cgroup {
-    my ($class, $cgroup, $kind) = @_;
+    my ($class, $cgroup, $effective) = @_;
 
-    $kind //= 'cpus';
+    my $kind = $effective ? 'effective_cpus' : 'cpus';
 
     my $filename = "/sys/fs/cgroup/cpuset/$cgroup/cpuset.$kind";
     my $set_text = PVE::Tools::file_read_firstline($filename) // '';