mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 06:44:23 +01:00
dependency: update cgroups-rs
Update cgroups-rs. Fixes: #6039 Signed-off-by: Bin Liu <bin@hyper.sh>
This commit is contained in:
@@ -14,7 +14,7 @@ anyhow = "^1.0"
|
||||
async-trait = "0.1.48"
|
||||
bitflags = "1.2.1"
|
||||
byte-unit = "4.0.14"
|
||||
cgroups-rs = "0.2.9"
|
||||
cgroups-rs = "0.3.0"
|
||||
futures = "0.3.11"
|
||||
lazy_static = "1.4.0"
|
||||
libc = ">=0.2.39"
|
||||
|
||||
@@ -69,7 +69,7 @@ impl CgroupsResource {
|
||||
// will either hold all the pod threads (sandbox_cgroup_only is true)
|
||||
// or only the virtual CPU ones (sandbox_cgroup_only is false).
|
||||
let hier = cgroups_rs::hierarchies::auto();
|
||||
let cgroup_manager = CgroupBuilder::new(&config.path).build(hier);
|
||||
let cgroup_manager = CgroupBuilder::new(&config.path).build(hier)?;
|
||||
|
||||
// The shim configuration is requesting that we do not put all threads
|
||||
// into the sandbox resource controller.
|
||||
@@ -77,7 +77,7 @@ impl CgroupsResource {
|
||||
// the vCPU threads will eventually make it there.
|
||||
let overhead_cgroup_manager = if !config.sandbox_cgroup_only {
|
||||
let hier = cgroups_rs::hierarchies::auto();
|
||||
Some(CgroupBuilder::new(&config.overhead_path).build(hier))
|
||||
Some(CgroupBuilder::new(&config.overhead_path).build(hier)?)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
@@ -109,7 +109,7 @@ impl CgroupsResource {
|
||||
/// overhead_cgroup_manager to the parent and then delete the cgroups.
|
||||
pub async fn delete(&self) -> Result<()> {
|
||||
for cg_pid in self.cgroup_manager.tasks() {
|
||||
self.cgroup_manager.remove_task(cg_pid);
|
||||
self.cgroup_manager.remove_task(cg_pid)?;
|
||||
}
|
||||
|
||||
self.cgroup_manager
|
||||
@@ -118,7 +118,7 @@ impl CgroupsResource {
|
||||
|
||||
if let Some(overhead) = self.overhead_cgroup_manager.as_ref() {
|
||||
for cg_pid in overhead.tasks() {
|
||||
overhead.remove_task(cg_pid);
|
||||
overhead.remove_task(cg_pid)?;
|
||||
}
|
||||
overhead.delete().context("delete overhead")?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user