Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/libcrun/cgroup-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ enum
CGROUP_CPUSET = 1 << 3,
CGROUP_PIDS = 1 << 4,
CGROUP_IO = 1 << 5,
CGROUP_MISC = 1 << 6,
};

struct libcrun_cgroup_status
Expand Down
7 changes: 5 additions & 2 deletions src/libcrun/cgroup-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,8 @@ read_available_controllers (const char *path, libcrun_error_t *err)
available |= CGROUP_PIDS;
else if (strcmp (token, "io") == 0)
available |= CGROUP_IO;
else if (strcmp (token, "misc") == 0)
available |= CGROUP_MISC;
}
return available;
}
Expand All @@ -761,10 +763,11 @@ write_controller_file (const char *path, int controllers_to_enable, libcrun_erro
int ret;

controllers_len = xasprintf (
&controllers, "%s %s %s %s %s %s", (controllers_to_enable & CGROUP_CPU) ? "+cpu" : "",
&controllers, "%s %s %s %s %s %s %s", (controllers_to_enable & CGROUP_CPU) ? "+cpu" : "",
(controllers_to_enable & CGROUP_IO) ? "+io" : "", (controllers_to_enable & CGROUP_MEMORY) ? "+memory" : "",
(controllers_to_enable & CGROUP_PIDS) ? "+pids" : "", (controllers_to_enable & CGROUP_CPUSET) ? "+cpuset" : "",
(controllers_to_enable & CGROUP_HUGETLB) ? "+hugetlb" : "");
(controllers_to_enable & CGROUP_HUGETLB) ? "+hugetlb" : "",
(controllers_to_enable & CGROUP_MISC) ? "+misc" : "");

ret = append_paths (&subtree_control, err, CGROUP_ROOT, path, "cgroup.subtree_control", NULL);
if (UNLIKELY (ret < 0))
Expand Down
Loading