diff options
author | Googler <noreply@google.com> | 2018-06-06 12:31:01 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-06 12:31:53 -0700 |
commit | 0c34b460f21d6f756b6402688203cfc5e533caa1 (patch) | |
tree | 6dca9efb3e781ef5112d96209010052c5cc18174 /runsc/container/container.go | |
parent | 722275c3d1a7b420915e6e6a3d623ae941c494cf (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/container/container.go')
-rw-r--r-- | runsc/container/container.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/runsc/container/container.go b/runsc/container/container.go index f20ec2453..eee148f5a 100644 --- a/runsc/container/container.go +++ b/runsc/container/container.go @@ -299,6 +299,16 @@ func (c *Container) Signal(sig syscall.Signal) error { return c.Sandbox.Signal(c.ID, sig) } +// Checkpoint sends the checkpoint call to the container. +func (c *Container) Checkpoint() error { + log.Debugf("Checkpoint container %q", c.ID) + if c.Status == Stopped { + log.Warningf("container %q not running, not checkpointing", c.ID) + return nil + } + return c.Sandbox.Checkpoint(c.ID) +} + // State returns the metadata of the container. func (c *Container) State() specs.State { return specs.State{ |