mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-14 00:40:25 +00:00
cpuset: replace 'kind' with an 'effective' boolean
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>
This commit is contained in:
parent
591be96958
commit
3e02302a64
@ -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) // '';
|
||||
|
Loading…
Reference in New Issue
Block a user