summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/socket
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-09-24 17:19:53 +0000
committergVisor bot <gvisor-bot@google.com>2020-09-24 17:19:53 +0000
commit61cc049caaa2317eda73e66f65f82b5099dd2bc2 (patch)
tree352bfc9c114c181e052a9656be9f3b2acd5f7b33 /pkg/sentry/socket
parent3102024707dc370e025f1b46fa2be12eade2f9cb (diff)
parent0a7075f38a4870ded687e117a299ac4996c0673e (diff)
Merge release-20200914.0-152-g0a7075f38 (automated)
Diffstat (limited to 'pkg/sentry/socket')
-rw-r--r--pkg/sentry/socket/unix/unix_state_autogen.go36
-rw-r--r--pkg/sentry/socket/unix/unix_vfs2.go2
2 files changed, 38 insertions, 0 deletions
diff --git a/pkg/sentry/socket/unix/unix_state_autogen.go b/pkg/sentry/socket/unix/unix_state_autogen.go
index 6966529c6..89d78a9ad 100644
--- a/pkg/sentry/socket/unix/unix_state_autogen.go
+++ b/pkg/sentry/socket/unix/unix_state_autogen.go
@@ -90,8 +90,44 @@ func (x *socketOpsCommon) StateLoad(m state.Source) {
m.Load(5, &x.abstractNamespace)
}
+func (x *SocketVFS2) StateTypeName() string {
+ return "pkg/sentry/socket/unix.SocketVFS2"
+}
+
+func (x *SocketVFS2) StateFields() []string {
+ return []string{
+ "vfsfd",
+ "FileDescriptionDefaultImpl",
+ "DentryMetadataFileDescriptionImpl",
+ "LockFD",
+ "socketOpsCommon",
+ }
+}
+
+func (x *SocketVFS2) beforeSave() {}
+
+func (x *SocketVFS2) StateSave(m state.Sink) {
+ x.beforeSave()
+ m.Save(0, &x.vfsfd)
+ m.Save(1, &x.FileDescriptionDefaultImpl)
+ m.Save(2, &x.DentryMetadataFileDescriptionImpl)
+ m.Save(3, &x.LockFD)
+ m.Save(4, &x.socketOpsCommon)
+}
+
+func (x *SocketVFS2) afterLoad() {}
+
+func (x *SocketVFS2) StateLoad(m state.Source) {
+ m.Load(0, &x.vfsfd)
+ m.Load(1, &x.FileDescriptionDefaultImpl)
+ m.Load(2, &x.DentryMetadataFileDescriptionImpl)
+ m.Load(3, &x.LockFD)
+ m.Load(4, &x.socketOpsCommon)
+}
+
func init() {
state.Register((*socketOpsCommonRefs)(nil))
state.Register((*SocketOperations)(nil))
state.Register((*socketOpsCommon)(nil))
+ state.Register((*SocketVFS2)(nil))
}
diff --git a/pkg/sentry/socket/unix/unix_vfs2.go b/pkg/sentry/socket/unix/unix_vfs2.go
index 3688f22d2..b76c0e6fb 100644
--- a/pkg/sentry/socket/unix/unix_vfs2.go
+++ b/pkg/sentry/socket/unix/unix_vfs2.go
@@ -37,6 +37,8 @@ import (
// SocketVFS2 implements socket.SocketVFS2 (and by extension,
// vfs.FileDescriptionImpl) for Unix sockets.
+//
+// +stateify savable
type SocketVFS2 struct {
vfsfd vfs.FileDescription
vfs.FileDescriptionDefaultImpl