mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-15 22:53:43 +00:00
agent: ignore updating cpuset error when update cgroups
The result of `cpuset_controller.set_cpus(&cpu.cpus)` is unwrapped, this will lead creating container to fail if cpuset is set. The sandbox's `CreateContainer` sequence is: c, err := newContainer(s, &contConfig) err = c.create() c.sandbox.agent.createContainer(c.sandbox, c) (1) err = s.updateResources() oldCPUs, newCPUs, err := s.hypervisor.resizeVCPUs(sandboxVCPUs) (2) cpuset only avaiable after `s.hypervisor.resizeVCPUs` has been called at (2), and then cpuset is written to cgourps file. Fixes: #1159 Signed-off-by: bin liu <bin@hyper.sh>
This commit is contained in:
parent
1dd77e204f
commit
705182d04e
@ -365,7 +365,9 @@ fn set_cpu_resources(cg: &cgroups::Cgroup, cpu: &LinuxCPU) -> Result<()> {
|
||||
let cpuset_controller: &CpuSetController = cg.controller_of().unwrap();
|
||||
|
||||
if !cpu.cpus.is_empty() {
|
||||
cpuset_controller.set_cpus(&cpu.cpus)?;
|
||||
if let Err(e) = cpuset_controller.set_cpus(&cpu.cpus) {
|
||||
warn!(sl!(), "write cpuset failed: {:?}", e);
|
||||
}
|
||||
}
|
||||
|
||||
if !cpu.mems.is_empty() {
|
||||
|
Loading…
Reference in New Issue
Block a user