]> git.proxmox.com Git - pve-common.git/commitdiff
cpuset: allow empty cpusets
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 1 Apr 2020 10:20:58 +0000 (12:20 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 1 Apr 2020 15:02:13 +0000 (17:02 +0200)
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@proxmox.com>
src/PVE/CpuSet.pm

index 297e995ab5983a7cc60962d83b916c43cbb121c3..a16f7ee0854f0f416d33ccfb7094f342d7b4fa6b 100644 (file)
@@ -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";