new-api: implement Pause() and Resume()

Signed-off-by: Andrey Vagin <avagin@openvz.org>
This commit is contained in:
Andrey Vagin 2015-01-19 16:19:28 +03:00 committed by Andrew Vagin
parent 9586935441
commit 9c50d819ae
1 changed files with 7 additions and 4 deletions

View File

@ -48,6 +48,11 @@ func (c *linuxContainer) RunState() (configs.RunState, error) {
return 0, err
}
if c.config.Cgroups != nil &&
c.config.Cgroups.Freezer == cgroups.Frozen {
return configs.Paused, nil
}
//FIXME get a cgroup state to check other states
return configs.Running, nil
@ -163,13 +168,11 @@ func (c *linuxContainer) Destroy() error {
}
func (c *linuxContainer) Pause() error {
glog.Info("pause container")
panic("not implemented")
return c.cgroupManager.Freeze(cgroups.Frozen)
}
func (c *linuxContainer) Resume() error {
glog.Info("resume container")
panic("not implemented")
return c.cgroupManager.Freeze(cgroups.Thawed)
}
func (c *linuxContainer) Signal(pid, signal int) error {