Exemple #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
}
Exemple #2
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
	}

	c.Freezer = state

	freezer := subsystems["freezer"]

	return freezer.Set(d)
}