summaryrefslogtreecommitdiffhomepage
path: root/runsc/sandbox
diff options
context:
space:
mode:
authorGoogler <noreply@google.com>2018-06-06 12:31:01 -0700
committerShentubot <shentubot@google.com>2018-06-06 12:31:53 -0700
commit0c34b460f21d6f756b6402688203cfc5e533caa1 (patch)
tree6dca9efb3e781ef5112d96209010052c5cc18174 /runsc/sandbox
parent722275c3d1a7b420915e6e6a3d623ae941c494cf (diff)
Add runsc checkpoint command.
Checkpoint command is plumbed through container and sandbox. Restore has also been added but it is only a stub. None of this works yet. More changes to come. PiperOrigin-RevId: 199510105 Change-Id: Ibd08d57f4737847eb25ca20b114518e487320185
Diffstat (limited to 'runsc/sandbox')
-rw-r--r--runsc/sandbox/sandbox.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/runsc/sandbox/sandbox.go b/runsc/sandbox/sandbox.go
index bfaead1f2..2a434cfb7 100644
--- a/runsc/sandbox/sandbox.go
+++ b/runsc/sandbox/sandbox.go
@@ -440,6 +440,21 @@ func (s *Sandbox) Signal(cid string, sig syscall.Signal) error {
return nil
}
+// Checkpoint sends the checkpoint call for a container in the sandbox.
+func (s *Sandbox) Checkpoint(cid string) error {
+ log.Debugf("Checkpoint sandbox %q", s.ID)
+ conn, err := s.connect()
+ if err != nil {
+ return err
+ }
+ defer conn.Close()
+
+ if err := conn.Call(boot.ContainerCheckpoint, nil, nil); err != nil {
+ return fmt.Errorf("err checkpointing container %q: %v", cid, err)
+ }
+ return nil
+}
+
// IsRunning returns true if the sandbox or gofer process is running.
func (s *Sandbox) IsRunning() bool {
if s.Pid != 0 {