Skip to content

Commit

Permalink
task: ignore not exist kernel param
Browse files Browse the repository at this point in the history
Signed-off-by: Zhang Tianyang <[email protected]>
  • Loading branch information
Burning1020 committed Aug 16, 2024
1 parent 064a4e9 commit 3ac32b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vmm/task/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ lazy_static! {
// allocate more memory than is physically available
map.insert("/proc/sys/vm/overcommit_memory", "1");
// Enable automatic expiration of nodest connections
// Enable automatic expiration of nodest connections in IPVS
map.insert("/proc/sys/net/ipv4/vs/expire_nodest_conn", "1");
map
};
Expand All @@ -329,9 +329,12 @@ async fn init_vm_rootfs() -> Result<()> {

// Set default sysctl
for sysctl in DEFAULT_SYSCTL.iter() {
if !Path::new(&sysctl.0).exists() {
continue;
}
tokio::fs::write(&sysctl.0, &sysctl.1)
.await
.map_err(io_error!(e, "failed to set cgroup hierarchy to 1"))?;
.map_err(io_error!(e, "failed to write kernel parameter "))?;
}

Ok(())
Expand Down

0 comments on commit 3ac32b1

Please sign in to comment.