kata-containers / cgroups-rs

Native Rust library for managing control groups under Linux
https://crates.io/crates/cgroups-rs
Other
114 stars 45 forks source link

Determine cgroup mode in add_task() #104

Closed yaoyinnan closed 1 year ago

yaoyinnan commented 1 year ago

Determine the cgroup mode in add_task() to avoid the wrong operation of the caller writing threads to cgroup.threads in non-thread mode.

Fixes: #103

Signed-off-by: yaoyinnan yaoyinnan@foxmail.com

yaoyinnan commented 1 year ago

@Tim-Zhang @liubin I fixed add_task(). In cgroup v2, it is only allowed to write to cgroup.threads when cgroup type is threaded or domain threaded. At other times, an error message prompts that the method is called in the wrong cgroup mode.