diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-06-24 06:37:35 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-06-24 06:37:35 +0000 |
commit | 9183888b520beeee8609170819a28bea89202909 (patch) | |
tree | 3cdcfa4de9ced4c539ab7c57e4cf58ffea980f6c /pkg/sentry/kernel/pipe | |
parent | cab13958a54419262aba2a0cd7f1075ed02c8ee0 (diff) | |
parent | 364ac92baf83f2352f78b718090472639bd92a76 (diff) |
Merge release-20200608.0-119-g364ac92ba (automated)
Diffstat (limited to 'pkg/sentry/kernel/pipe')
-rw-r--r-- | pkg/sentry/kernel/pipe/pipe_state_autogen.go | 145 |
1 files changed, 106 insertions, 39 deletions
diff --git a/pkg/sentry/kernel/pipe/pipe_state_autogen.go b/pkg/sentry/kernel/pipe/pipe_state_autogen.go index b49ab46f9..df55abce6 100644 --- a/pkg/sentry/kernel/pipe/pipe_state_autogen.go +++ b/pkg/sentry/kernel/pipe/pipe_state_autogen.go @@ -6,79 +6,146 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *inodeOperations) StateTypeName() string { + return "pkg/sentry/kernel/pipe.inodeOperations" +} + +func (x *inodeOperations) StateFields() []string { + return []string{ + "InodeSimpleAttributes", + "p", + } +} + func (x *inodeOperations) beforeSave() {} -func (x *inodeOperations) save(m state.Map) { + +func (x *inodeOperations) StateSave(m state.Sink) { x.beforeSave() - m.Save("InodeSimpleAttributes", &x.InodeSimpleAttributes) - m.Save("p", &x.p) + m.Save(0, &x.InodeSimpleAttributes) + m.Save(1, &x.p) } func (x *inodeOperations) afterLoad() {} -func (x *inodeOperations) load(m state.Map) { - m.Load("InodeSimpleAttributes", &x.InodeSimpleAttributes) - m.Load("p", &x.p) + +func (x *inodeOperations) StateLoad(m state.Source) { + m.Load(0, &x.InodeSimpleAttributes) + m.Load(1, &x.p) +} + +func (x *Pipe) StateTypeName() string { + return "pkg/sentry/kernel/pipe.Pipe" +} + +func (x *Pipe) StateFields() []string { + return []string{ + "isNamed", + "atomicIOBytes", + "readers", + "writers", + "view", + "max", + "hadWriter", + } } func (x *Pipe) beforeSave() {} -func (x *Pipe) save(m state.Map) { + +func (x *Pipe) StateSave(m state.Sink) { x.beforeSave() - m.Save("isNamed", &x.isNamed) - m.Save("atomicIOBytes", &x.atomicIOBytes) - m.Save("readers", &x.readers) - m.Save("writers", &x.writers) - m.Save("view", &x.view) - m.Save("max", &x.max) - m.Save("hadWriter", &x.hadWriter) + m.Save(0, &x.isNamed) + m.Save(1, &x.atomicIOBytes) + m.Save(2, &x.readers) + m.Save(3, &x.writers) + m.Save(4, &x.view) + m.Save(5, &x.max) + m.Save(6, &x.hadWriter) } func (x *Pipe) afterLoad() {} -func (x *Pipe) load(m state.Map) { - m.Load("isNamed", &x.isNamed) - m.Load("atomicIOBytes", &x.atomicIOBytes) - m.Load("readers", &x.readers) - m.Load("writers", &x.writers) - m.Load("view", &x.view) - m.Load("max", &x.max) - m.Load("hadWriter", &x.hadWriter) + +func (x *Pipe) StateLoad(m state.Source) { + m.Load(0, &x.isNamed) + m.Load(1, &x.atomicIOBytes) + m.Load(2, &x.readers) + m.Load(3, &x.writers) + m.Load(4, &x.view) + m.Load(5, &x.max) + m.Load(6, &x.hadWriter) +} + +func (x *Reader) StateTypeName() string { + return "pkg/sentry/kernel/pipe.Reader" +} + +func (x *Reader) StateFields() []string { + return []string{ + "ReaderWriter", + } } func (x *Reader) beforeSave() {} -func (x *Reader) save(m state.Map) { + +func (x *Reader) StateSave(m state.Sink) { x.beforeSave() - m.Save("ReaderWriter", &x.ReaderWriter) + m.Save(0, &x.ReaderWriter) } func (x *Reader) afterLoad() {} -func (x *Reader) load(m state.Map) { - m.Load("ReaderWriter", &x.ReaderWriter) + +func (x *Reader) StateLoad(m state.Source) { + m.Load(0, &x.ReaderWriter) +} + +func (x *ReaderWriter) StateTypeName() string { + return "pkg/sentry/kernel/pipe.ReaderWriter" +} + +func (x *ReaderWriter) StateFields() []string { + return []string{ + "Pipe", + } } func (x *ReaderWriter) beforeSave() {} -func (x *ReaderWriter) save(m state.Map) { + +func (x *ReaderWriter) StateSave(m state.Sink) { x.beforeSave() - m.Save("Pipe", &x.Pipe) + m.Save(0, &x.Pipe) } func (x *ReaderWriter) afterLoad() {} -func (x *ReaderWriter) load(m state.Map) { - m.Load("Pipe", &x.Pipe) + +func (x *ReaderWriter) StateLoad(m state.Source) { + m.Load(0, &x.Pipe) +} + +func (x *Writer) StateTypeName() string { + return "pkg/sentry/kernel/pipe.Writer" +} + +func (x *Writer) StateFields() []string { + return []string{ + "ReaderWriter", + } } func (x *Writer) beforeSave() {} -func (x *Writer) save(m state.Map) { + +func (x *Writer) StateSave(m state.Sink) { x.beforeSave() - m.Save("ReaderWriter", &x.ReaderWriter) + m.Save(0, &x.ReaderWriter) } func (x *Writer) afterLoad() {} -func (x *Writer) load(m state.Map) { - m.Load("ReaderWriter", &x.ReaderWriter) + +func (x *Writer) StateLoad(m state.Source) { + m.Load(0, &x.ReaderWriter) } func init() { - state.Register("pkg/sentry/kernel/pipe.inodeOperations", (*inodeOperations)(nil), state.Fns{Save: (*inodeOperations).save, Load: (*inodeOperations).load}) - state.Register("pkg/sentry/kernel/pipe.Pipe", (*Pipe)(nil), state.Fns{Save: (*Pipe).save, Load: (*Pipe).load}) - state.Register("pkg/sentry/kernel/pipe.Reader", (*Reader)(nil), state.Fns{Save: (*Reader).save, Load: (*Reader).load}) - state.Register("pkg/sentry/kernel/pipe.ReaderWriter", (*ReaderWriter)(nil), state.Fns{Save: (*ReaderWriter).save, Load: (*ReaderWriter).load}) - state.Register("pkg/sentry/kernel/pipe.Writer", (*Writer)(nil), state.Fns{Save: (*Writer).save, Load: (*Writer).load}) + state.Register((*inodeOperations)(nil)) + state.Register((*Pipe)(nil)) + state.Register((*Reader)(nil)) + state.Register((*ReaderWriter)(nil)) + state.Register((*Writer)(nil)) } |