Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgroup: use default sandbox cgroup path #124

Merged
merged 1 commit into from
Apr 8, 2024
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 vmm/sandbox/src/cgroup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use crate::{
vm::VcpuThreads,
};

pub const DEFAULT_CGROUP_PARENT_PATH: &str = "kuasar-vmm";
pub const VCPU_CGROUP_NAME: &str = "vcpu";
pub const POD_OVERHEAD_CGROUP_NAME: &str = "pod_overhead";

Expand Down
12 changes: 3 additions & 9 deletions vmm/sandbox/src/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use vmm_common::{
};

use crate::{
cgroup::SandboxCgroup,
cgroup::{SandboxCgroup, DEFAULT_CGROUP_PARENT_PATH},
client::{
client_check, client_sync_clock, client_update_interfaces, client_update_routes,
new_sandbox_client,
Expand Down Expand Up @@ -154,14 +154,8 @@ where
}

let mut sandbox_cgroups = SandboxCgroup::default();
let cgroup_parent_path = match get_sandbox_cgroup_parent_path(&s.sandbox) {
Some(cgroup_parent_path) => cgroup_parent_path,
None => {
return Err(Error::Other(anyhow!(
"Failed to get sandbox cgroup parent path."
)))
}
};
let cgroup_parent_path = get_sandbox_cgroup_parent_path(&s.sandbox)
.unwrap_or(DEFAULT_CGROUP_PARENT_PATH.to_string());
// Currently only support cgroup V1, cgroup V2 is not supported now
if !cgroups_rs::hierarchies::is_cgroup2_unified_mode() {
// Create sandbox's cgroup and apply sandbox's resources limit
Expand Down
Loading