Detect subsystems and get root from /proc/self/mountinfo

Delete check_support and stop detecting subsystems by finding in the
root folders because the detecting method is not accurate.

Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
Tim Zhang
2020-11-12 20:06:03 +08:00
parent fbd7164c29
commit 1f188be405
17 changed files with 83 additions and 180 deletions

View File

@@ -465,12 +465,8 @@ impl ControllerInternal for MemController {
}
impl MemController {
/// Contructs a new `MemController` with `oroot` serving as the root of the control group.
pub fn new(oroot: PathBuf, v2: bool) -> Self {
let mut root = oroot;
if !v2 {
root.push(Self::controller_type().to_string());
}
/// Contructs a new `MemController` with `root` serving as the root of the control group.
pub fn new(root: PathBuf, v2: bool) -> Self {
Self {
base: root.clone(),
path: root,