예제 #1
0
// Freeze toggles the container's freezer cgroup depending on the state
// provided
func Freeze(c *cgroups.Cgroup, state cgroups.FreezerState) error {
	d, err := getCgroupData(c, 0)
	if err != nil {
		return err
	}

	prevState := c.Freezer
	c.Freezer = state

	freezer := subsystems["freezer"]
	err = freezer.Set(d)
	if err != nil {
		c.Freezer = prevState
		return err
	}

	return nil
}
예제 #2
0
파일: apply_raw.go 프로젝트: Gandi/docker
// Freeze toggles the container's freezer cgroup depending on the state
// provided
func Freeze(c *cgroups.Cgroup, state cgroups.FreezerState) error {
	d, err := getCgroupData(c, 0)
	if err != nil {
		return err
	}

	c.Freezer = state

	freezer := subsystems["freezer"]

	return freezer.Set(d)
}