diff options
Diffstat (limited to 'pkg/sentry/state/state.go')
-rw-r--r-- | pkg/sentry/state/state.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/sentry/state/state.go b/pkg/sentry/state/state.go index 5bec4e018..c306091da 100644 --- a/pkg/sentry/state/state.go +++ b/pkg/sentry/state/state.go @@ -27,6 +27,8 @@ import ( "gvisor.googlesource.com/gvisor/pkg/state/statefile" ) +var previousMetadata map[string]string + // ErrStateFile is returned when the state file cannot be opened. type ErrStateFile struct { err error @@ -103,11 +105,13 @@ type LoadOpts struct { // Load loads the given kernel, setting the provided platform and stack. func (opts LoadOpts) Load(k *kernel.Kernel, p platform.Platform, n inet.Stack) error { // Open the file. - r, _, err := statefile.NewReader(opts.Source, opts.Key) + r, m, err := statefile.NewReader(opts.Source, opts.Key) if err != nil { return ErrStateFile{err} } + previousMetadata = m + // Restore the Kernel object graph. return k.LoadFrom(r, p, n) } |