summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot
diff options
context:
space:
mode:
authorJustine Olshan <justineolshan@google.com>2018-06-19 15:22:23 -0700
committerShentubot <shentubot@google.com>2018-06-19 15:23:36 -0700
commita6dbef045ff684e92f472280eb6f7f688b9bc87a (patch)
tree35aad9e3d975e0c217f12adec007d9a35521fc3d /runsc/boot
parentbda2a1ed3503699b8cb814bb3cc7ad0b9694155b (diff)
Added a resume command to unpause a paused container.
Resume checks the status of the container and unpauses the kernel if its status is paused. Otherwise nothing happens. Tests were added to ensure that the process is in the correct state after various commands. PiperOrigin-RevId: 201251234 Change-Id: Ifd11b336c33b654fea6238738f864fcf2bf81e19
Diffstat (limited to 'runsc/boot')
-rw-r--r--runsc/boot/controller.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/runsc/boot/controller.go b/runsc/boot/controller.go
index 564f2d271..ae727f144 100644
--- a/runsc/boot/controller.go
+++ b/runsc/boot/controller.go
@@ -44,6 +44,9 @@ const (
// processes running in a container.
ContainerProcesses = "containerManager.Processes"
+ // ContainerResume unpauses the paused container.
+ ContainerResume = "containerManager.Resume"
+
// ContainerSignal is used to send a signal to a container.
ContainerSignal = "containerManager.Signal"
@@ -156,12 +159,18 @@ func (cm *containerManager) Checkpoint(o *control.SaveOpts, _ *struct{}) error {
return state.Save(o, nil)
}
-// Pause suspends the process in a container.
+// Pause suspends a container.
func (cm *containerManager) Pause(_, _ *struct{}) error {
cm.k.Pause()
return nil
}
+// Resume unpauses a container.
+func (cm *containerManager) Resume(_, _ *struct{}) error {
+ cm.k.Unpause()
+ 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