diff options
author | Justine Olshan <justineolshan@google.com> | 2018-06-15 16:08:20 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-15 16:09:09 -0700 |
commit | 0786707cd94b8feffaeb083077eccaf10873e682 (patch) | |
tree | 9dba432e5b695936e5f9907a92dae12bd5dc666a /runsc/boot/controller.go | |
parent | bd2d1aaa16474202b1a2c1edbf62e6782fa2dc36 (diff) |
Added code for a pause command for a container process.
Like runc, the pause command will pause the processes of the given container.
It will set that container's status to "paused."
A resume command will be be added to unpause and continue running the process.
PiperOrigin-RevId: 200789624
Change-Id: I72a5d7813d90ecfc4d01cc252d6018855016b1ea
Diffstat (limited to 'runsc/boot/controller.go')
-rw-r--r-- | runsc/boot/controller.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/runsc/boot/controller.go b/runsc/boot/controller.go index 095b0a9b9..564f2d271 100644 --- a/runsc/boot/controller.go +++ b/runsc/boot/controller.go @@ -37,6 +37,9 @@ const ( // container.. ContainerExecute = "containerManager.Execute" + // ContainerPause pauses the container. + ContainerPause = "containerManager.Pause" + // ContainerProcesses is the URPC endpoint for getting the list of // processes running in a container. ContainerProcesses = "containerManager.Processes" @@ -153,6 +156,12 @@ func (cm *containerManager) Checkpoint(o *control.SaveOpts, _ *struct{}) error { return state.Save(o, nil) } +// Pause suspends the process in a container. +func (cm *containerManager) Pause(_, _ *struct{}) error { + cm.k.Pause() + return nil +} + // Wait waits for the init process in the given container. func (cm *containerManager) Wait(cid *string, waitStatus *uint32) error { // TODO: Use the cid and wait on the init process in that |