Merge pull request #74 from rjnagal/cgroup_testing

Add a cleanup method to cgroup fs. This will help in building a
This commit is contained in:
Victor Marmol 2014-07-08 13:21:45 -07:00
commit a01dde8b65
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 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) { func GetStats(c *cgroups.Cgroup) (*cgroups.Stats, error) {
stats := cgroups.NewStats() stats := cgroups.NewStats()