All of our users of this function currently either pass
'effective_cpus' or nothing (undef), and in cgroupv2 the
effective-cpuset file uses a different naming scheme.
Since this is only a distinction between "intended" and
"effective", use this as a boolean instead, for easier
future cgroupv2 support.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
+# Create a new set with the contents of a cgroup-v1 subdirectory
- my ($class, $cgroup, $kind) = @_;
+ my ($class, $cgroup, $effective) = @_;
+ my $kind = $effective ? 'effective_cpus' : 'cpus';
my $filename = "/sys/fs/cgroup/cpuset/$cgroup/cpuset.$kind";
my $set_text = PVE::Tools::file_read_firstline($filename) // '';
my $filename = "/sys/fs/cgroup/cpuset/$cgroup/cpuset.$kind";
my $set_text = PVE::Tools::file_read_firstline($filename) // '';