From: Wolfgang Bumiller Date: Wed, 1 Apr 2020 10:20:58 +0000 (+0200) Subject: cpuset: allow empty cpusets X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=ea2884f04dd2af4a4e4c0a772c857912413ae84d cpuset: allow empty cpusets This is explicitly allowed in the documentation and happens easily with cgroupv2 as there it is used to inherit from the closest ancestor. Signed-off-by: Wolfgang Bumiller --- diff --git a/src/PVE/CpuSet.pm b/src/PVE/CpuSet.pm index 297e995..a16f7ee 100644 --- a/src/PVE/CpuSet.pm +++ b/src/PVE/CpuSet.pm @@ -40,9 +40,6 @@ sub new_from_path { my ($count, $members) = parse_cpuset($set_text); - die "got empty cpuset for cgroup '$path'\n" - if !$count; - return $class->new($members); } @@ -81,8 +78,6 @@ sub write_to_cgroup { $value .= $cpuid; } - die "unable to write empty cpu set\n" if !length($value); - open(my $fh, '>', $filename) || die "failed to open '$filename' - $!\n"; PVE::Tools::safe_print($filename, $fh, "$value\n"); close($fh) || die "failed to close '$filename' - $!\n";