mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
cgroups: add ability to update CPUSet
Add function for applying a cpuset change to a cgroup Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
This commit is contained in:
parent
b812d4f7fa
commit
b6cf68a985
@ -331,3 +331,16 @@ func (m *Manager) RemoveDevice(device string) error {
|
|||||||
m.Unlock()
|
m.Unlock()
|
||||||
return fmt.Errorf("device %v not found in the cgroup", device)
|
return fmt.Errorf("device %v not found in the cgroup", device)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Manager) SetCPUSet(cpuset string) error {
|
||||||
|
cgroups, err := m.GetCgroups()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
m.Lock()
|
||||||
|
cgroups.CpusetCpus = cpuset
|
||||||
|
m.Unlock()
|
||||||
|
|
||||||
|
return m.Apply()
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user