mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
cgroup: collect path of cgroup when running a container in a container
Path of cgroup is wrong when running a container in a container. Use the root path of mountinfo fetched from /proc/$(shim_pid)/mountinfo to trim the path obtained from /proc/self/mountinfo. Fixes: #131 Signed-off-by: 乔琛 10307740 <qiao.chen@zte.com.cn>
This commit is contained in:
+3
-3
@@ -540,10 +540,10 @@ impl ControllerInternal for MemController {
|
||||
|
||||
impl MemController {
|
||||
/// Contructs a new `MemController` with `root` serving as the root of the control group.
|
||||
pub fn new(root: PathBuf, v2: bool) -> Self {
|
||||
pub fn new(point: PathBuf, root: PathBuf, v2: bool) -> Self {
|
||||
Self {
|
||||
base: root.clone(),
|
||||
path: root,
|
||||
base: root,
|
||||
path: point,
|
||||
v2,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user