[pve-devel] [PATCH common 1/2] cpuset: allow empty cpusets

w.bumiller at proxmox.com w.bumiller at proxmox.com
Wed Apr 1 12:20:58 CEST 2020


From: Wolfgang Bumiller <w.bumiller at proxmox.com>

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 <w.bumiller at proxmox.com>
---
 src/PVE/CpuSet.pm | 5 -----
 1 file changed, 5 deletions(-)

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";
-- 
2.20.1





More information about the pve-devel mailing list