summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/pipe
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2018-08-01 19:56:12 -0700
committerShentubot <shentubot@google.com>2018-08-01 19:57:32 -0700
commit60add78980737a7330100d98bf6a214892dee3c0 (patch)
tree14433da4615d2010a5d34ade91ff94b938c5a9b5 /pkg/sentry/kernel/pipe
parentb9e1cf8404ce1263176643dee1a1cc835c9d1448 (diff)
Automated rollback of changelist 207007153
PiperOrigin-RevId: 207037226 Change-Id: I8b5f1a056d4f3eab17846f2e0193bb737ecb5428
Diffstat (limited to 'pkg/sentry/kernel/pipe')
-rw-r--r--pkg/sentry/kernel/pipe/BUILD20
-rw-r--r--pkg/sentry/kernel/pipe/buffers.go2
-rw-r--r--pkg/sentry/kernel/pipe/node.go2
-rw-r--r--pkg/sentry/kernel/pipe/pipe.go2
-rw-r--r--pkg/sentry/kernel/pipe/reader.go2
-rw-r--r--pkg/sentry/kernel/pipe/reader_writer.go2
-rw-r--r--pkg/sentry/kernel/pipe/writer.go2
7 files changed, 19 insertions, 13 deletions
diff --git a/pkg/sentry/kernel/pipe/BUILD b/pkg/sentry/kernel/pipe/BUILD
index 19b23c6d2..4600d19bd 100644
--- a/pkg/sentry/kernel/pipe/BUILD
+++ b/pkg/sentry/kernel/pipe/BUILD
@@ -1,6 +1,20 @@
package(licenses = ["notice"]) # Apache 2.0
-load("//tools/go_stateify:defs.bzl", "go_library", "go_test")
+load("//tools/go_stateify:defs.bzl", "go_library", "go_stateify", "go_test")
+
+go_stateify(
+ name = "pipe_state",
+ srcs = [
+ "buffers.go",
+ "node.go",
+ "pipe.go",
+ "reader.go",
+ "reader_writer.go",
+ "writer.go",
+ ],
+ out = "pipe_state.go",
+ package = "pipe",
+)
go_library(
name = "pipe",
@@ -9,6 +23,7 @@ go_library(
"device.go",
"node.go",
"pipe.go",
+ "pipe_state.go",
"reader.go",
"reader_writer.go",
"writer.go",
@@ -19,12 +34,15 @@ go_library(
"//pkg/abi/linux",
"//pkg/amutex",
"//pkg/ilist",
+ "//pkg/log",
+ "//pkg/refs",
"//pkg/sentry/arch",
"//pkg/sentry/context",
"//pkg/sentry/device",
"//pkg/sentry/fs",
"//pkg/sentry/fs/fsutil",
"//pkg/sentry/usermem",
+ "//pkg/state",
"//pkg/syserror",
"//pkg/waiter",
],
diff --git a/pkg/sentry/kernel/pipe/buffers.go b/pkg/sentry/kernel/pipe/buffers.go
index a82e45c3f..f300537c5 100644
--- a/pkg/sentry/kernel/pipe/buffers.go
+++ b/pkg/sentry/kernel/pipe/buffers.go
@@ -20,8 +20,6 @@ import (
// Buffer encapsulates a queueable byte buffer that can
// easily be truncated. It is designed only for use with pipes.
-//
-// +stateify savable
type Buffer struct {
ilist.Entry
data []byte
diff --git a/pkg/sentry/kernel/pipe/node.go b/pkg/sentry/kernel/pipe/node.go
index 23d692da1..e418cf174 100644
--- a/pkg/sentry/kernel/pipe/node.go
+++ b/pkg/sentry/kernel/pipe/node.go
@@ -24,8 +24,6 @@ import (
)
// inodeOperations wraps fs.InodeOperations operations with common pipe opening semantics.
-//
-// +stateify savable
type inodeOperations struct {
fs.InodeOperations
diff --git a/pkg/sentry/kernel/pipe/pipe.go b/pkg/sentry/kernel/pipe/pipe.go
index ced2559a7..9a21df5b4 100644
--- a/pkg/sentry/kernel/pipe/pipe.go
+++ b/pkg/sentry/kernel/pipe/pipe.go
@@ -41,8 +41,6 @@ const DefaultPipeSize = 65536
// Pipe is an encapsulation of a platform-independent pipe.
// It manages a buffered byte queue shared between a reader/writer
// pair.
-//
-// +stateify savable
type Pipe struct {
waiter.Queue `state:"nosave"`
diff --git a/pkg/sentry/kernel/pipe/reader.go b/pkg/sentry/kernel/pipe/reader.go
index 1fa5e9a32..40d5e4943 100644
--- a/pkg/sentry/kernel/pipe/reader.go
+++ b/pkg/sentry/kernel/pipe/reader.go
@@ -20,8 +20,6 @@ import (
// Reader satisfies the fs.FileOperations interface for read-only pipes.
// Reader should be used with !fs.FileFlags.Write to reject writes.
-//
-// +stateify savable
type Reader struct {
ReaderWriter
}
diff --git a/pkg/sentry/kernel/pipe/reader_writer.go b/pkg/sentry/kernel/pipe/reader_writer.go
index 82607367b..dc642a3a6 100644
--- a/pkg/sentry/kernel/pipe/reader_writer.go
+++ b/pkg/sentry/kernel/pipe/reader_writer.go
@@ -31,8 +31,6 @@ import (
// read and write requests. This should only be used directly for named pipes.
// pipe(2) and pipe2(2) only support unidirectional pipes and should use
// either pipe.Reader or pipe.Writer.
-//
-// +stateify savable
type ReaderWriter struct {
fsutil.PipeSeek `state:"nosave"`
fsutil.NotDirReaddir `state:"nosave"`
diff --git a/pkg/sentry/kernel/pipe/writer.go b/pkg/sentry/kernel/pipe/writer.go
index d93324b53..fd13008ac 100644
--- a/pkg/sentry/kernel/pipe/writer.go
+++ b/pkg/sentry/kernel/pipe/writer.go
@@ -20,8 +20,6 @@ import (
// Writer satisfies the fs.FileOperations interface for write-only pipes.
// Writer should be used with !fs.FileFlags.Read to reject reads.
-//
-// +stateify savable
type Writer struct {
ReaderWriter
}