diff options
author | Brielle Broder <bbroder@google.com> | 2018-06-12 13:24:22 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-12 13:25:23 -0700 |
commit | 711a9869e54743b05fc3478be5adce31d45cefe5 (patch) | |
tree | 7e0b61d5b8a075f96dc868a7c548252b231101ed /runsc/container/container.go | |
parent | 7a10df454b1c12b207f479cdda7338fff2875d5f (diff) |
Runsc checkpoint works.
This is the first iteration of checkpoint that actually saves to a file.
Tests for checkpoint are included.
Ran into an issue when private unix sockets are enabled. An error message
was added for this case and the mutex state was set.
PiperOrigin-RevId: 200269470
Change-Id: I28d29a9f92c44bf73dc4a4b12ae0509ee4070e93
Diffstat (limited to 'runsc/container/container.go')
-rw-r--r-- | runsc/container/container.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runsc/container/container.go b/runsc/container/container.go index 66a2f27a1..d323388fb 100644 --- a/runsc/container/container.go +++ b/runsc/container/container.go @@ -339,13 +339,14 @@ func (c *Container) Signal(sig syscall.Signal) error { } // Checkpoint sends the checkpoint call to the container. -func (c *Container) Checkpoint() error { +// The statefile will be written to f, the file at the specified image-path. +func (c *Container) Checkpoint(f *os.File) 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) + return c.Sandbox.Checkpoint(c.ID, f) } // State returns the metadata of the container. |