cgroups/systemd: remove useless code
I think the remove code and devices.Set do the same things. Signed-off-by: Andrey Vagin <avagin@openvz.org>
This commit is contained in:
parent
984ec36fa1
commit
755bc77482
|
@ -398,33 +398,7 @@ func joinDevices(c *configs.Cgroup, pid int) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
devices := subsystems["devices"]
|
devices := subsystems["devices"]
|
||||||
if err := devices.Set(path, c); err != nil {
|
return devices.Set(path, c)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if !c.AllowAllDevices {
|
|
||||||
if err := writeFile(path, "devices.deny", "a"); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
for _, dev := range c.AllowedDevices {
|
|
||||||
if err := writeFile(path, "devices.allow", dev.CgroupString()); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := writeFile(path, "devices.allow", "a"); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, dev := range c.DeniedDevices {
|
|
||||||
if err := writeFile(path, "devices.deny", dev.CgroupString()); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Symmetrical public function to update device based cgroups. Also available
|
// Symmetrical public function to update device based cgroups. Also available
|
||||||
|
|
Loading…
Reference in New Issue