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 /pkg/sentry/fs/gofer | |
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 'pkg/sentry/fs/gofer')
-rw-r--r-- | pkg/sentry/fs/gofer/session.go | 5 | ||||
-rw-r--r-- | pkg/sentry/fs/gofer/session_state.go | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/pkg/sentry/fs/gofer/session.go b/pkg/sentry/fs/gofer/session.go index 1076e3e55..baf00d8e7 100644 --- a/pkg/sentry/fs/gofer/session.go +++ b/pkg/sentry/fs/gofer/session.go @@ -28,8 +28,9 @@ import ( ) type endpointMap struct { - mu sync.RWMutex - m map[device.MultiDeviceKey]unix.BoundEndpoint + mu sync.RWMutex `state:"nosave"` + // TODO: Make map with private unix sockets savable. + m map[device.MultiDeviceKey]unix.BoundEndpoint } // add adds the endpoint to the map. diff --git a/pkg/sentry/fs/gofer/session_state.go b/pkg/sentry/fs/gofer/session_state.go index 4d993a219..0154810c8 100644 --- a/pkg/sentry/fs/gofer/session_state.go +++ b/pkg/sentry/fs/gofer/session_state.go @@ -22,6 +22,15 @@ import ( "gvisor.googlesource.com/gvisor/pkg/unet" ) +// beforeSave is invoked by stateify. +// +// TODO: Make map with private unix sockets savable. +func (e *endpointMap) beforeSave() { + if len(e.m) != 0 { + panic("EndpointMap with existing private unix sockets cannot be saved") + } +} + // afterLoad is invoked by stateify. func (s *session) afterLoad() { // The restore environment contains the 9p connection of this mount. |