diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-09-24 17:19:53 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-09-24 17:19:53 +0000 |
commit | 61cc049caaa2317eda73e66f65f82b5099dd2bc2 (patch) | |
tree | 352bfc9c114c181e052a9656be9f3b2acd5f7b33 /pkg/sentry/fsimpl/eventfd | |
parent | 3102024707dc370e025f1b46fa2be12eade2f9cb (diff) | |
parent | 0a7075f38a4870ded687e117a299ac4996c0673e (diff) |
Merge release-20200914.0-152-g0a7075f38 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/eventfd')
-rw-r--r-- | pkg/sentry/fsimpl/eventfd/eventfd.go | 2 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/eventfd/eventfd_state_autogen.go | 52 |
2 files changed, 54 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/eventfd/eventfd.go b/pkg/sentry/fsimpl/eventfd/eventfd.go index bb0bf3a07..1c27ad700 100644 --- a/pkg/sentry/fsimpl/eventfd/eventfd.go +++ b/pkg/sentry/fsimpl/eventfd/eventfd.go @@ -33,6 +33,8 @@ import ( // EventFileDescription implements vfs.FileDescriptionImpl for file-based event // notification (eventfd). Eventfds are usually internal to the Sentry but in // certain situations they may be converted into a host-backed eventfd. +// +// +stateify savable type EventFileDescription struct { vfsfd vfs.FileDescription vfs.FileDescriptionDefaultImpl diff --git a/pkg/sentry/fsimpl/eventfd/eventfd_state_autogen.go b/pkg/sentry/fsimpl/eventfd/eventfd_state_autogen.go index e83f6aed8..0507be064 100644 --- a/pkg/sentry/fsimpl/eventfd/eventfd_state_autogen.go +++ b/pkg/sentry/fsimpl/eventfd/eventfd_state_autogen.go @@ -1,3 +1,55 @@ // automatically generated by stateify. package eventfd + +import ( + "gvisor.dev/gvisor/pkg/state" +) + +func (x *EventFileDescription) StateTypeName() string { + return "pkg/sentry/fsimpl/eventfd.EventFileDescription" +} + +func (x *EventFileDescription) StateFields() []string { + return []string{ + "vfsfd", + "FileDescriptionDefaultImpl", + "DentryMetadataFileDescriptionImpl", + "NoLockFD", + "val", + "semMode", + "hostfd", + } +} + +func (x *EventFileDescription) beforeSave() {} + +func (x *EventFileDescription) StateSave(m state.Sink) { + x.beforeSave() + if !state.IsZeroValue(&x.queue) { + state.Failf("queue is %#v, expected zero", &x.queue) + } + m.Save(0, &x.vfsfd) + m.Save(1, &x.FileDescriptionDefaultImpl) + m.Save(2, &x.DentryMetadataFileDescriptionImpl) + m.Save(3, &x.NoLockFD) + m.Save(4, &x.val) + m.Save(5, &x.semMode) + m.Save(6, &x.hostfd) +} + +func (x *EventFileDescription) afterLoad() {} + +func (x *EventFileDescription) StateLoad(m state.Source) { + m.Load(0, &x.vfsfd) + m.Load(1, &x.FileDescriptionDefaultImpl) + m.Load(2, &x.DentryMetadataFileDescriptionImpl) + m.Load(3, &x.NoLockFD) + m.Load(4, &x.val) + m.Load(5, &x.semMode) + m.Load(6, &x.hostfd) +} + +func init() { + state.Register((*EventFileDescription)(nil)) +} |