Add a cleanup method to cgroup fs. This will help in building a

standalone cgroup test util. systemd does auto cleanup on empty, so
doesn't need an extra interface.

Docker-DCO-1.1-Signed-off-by: Rohit Jnagal <jnagal@google.com> (github: rjnagal)
This commit is contained in:
Rohit Jnagal 2014-07-08 18:49:45 +00:00
parent 99458b9c57
commit d712d29b9a
1 changed files with 8 additions and 0 deletions

View File

@ -52,6 +52,14 @@ func Apply(c *cgroups.Cgroup, pid int) (cgroups.ActiveCgroup, error) {
return d, nil
}
func Cleanup(c *cgroups.Cgroup) error {
d, err := getCgroupData(c, 0)
if err != nil {
return fmt.Errorf("Could not get Cgroup data %s", err)
}
return d.Cleanup()
}
func GetStats(c *cgroups.Cgroup) (*cgroups.Stats, error) {
stats := cgroups.NewStats()