diff options
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)) +} |