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/memmap | |
parent | cab13958a54419262aba2a0cd7f1075ed02c8ee0 (diff) | |
parent | 364ac92baf83f2352f78b718090472639bd92a76 (diff) |
Merge release-20200608.0-119-g364ac92ba (automated)
Diffstat (limited to 'pkg/sentry/memmap')
-rw-r--r-- | pkg/sentry/memmap/memmap_impl_state_autogen.go | 111 | ||||
-rw-r--r-- | pkg/sentry/memmap/memmap_state_autogen.go | 59 |
2 files changed, 121 insertions, 49 deletions
diff --git a/pkg/sentry/memmap/memmap_impl_state_autogen.go b/pkg/sentry/memmap/memmap_impl_state_autogen.go index b66b03884..ed4ab58cb 100644 --- a/pkg/sentry/memmap/memmap_impl_state_autogen.go +++ b/pkg/sentry/memmap/memmap_impl_state_autogen.go @@ -6,60 +6,105 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *MappingSet) StateTypeName() string { + return "pkg/sentry/memmap.MappingSet" +} + +func (x *MappingSet) StateFields() []string { + return []string{ + "root", + } +} + func (x *MappingSet) beforeSave() {} -func (x *MappingSet) save(m state.Map) { + +func (x *MappingSet) StateSave(m state.Sink) { x.beforeSave() var root *MappingSegmentDataSlices = x.saveRoot() - m.SaveValue("root", root) + m.SaveValue(0, root) } func (x *MappingSet) afterLoad() {} -func (x *MappingSet) load(m state.Map) { - m.LoadValue("root", new(*MappingSegmentDataSlices), func(y interface{}) { x.loadRoot(y.(*MappingSegmentDataSlices)) }) + +func (x *MappingSet) StateLoad(m state.Source) { + m.LoadValue(0, new(*MappingSegmentDataSlices), func(y interface{}) { x.loadRoot(y.(*MappingSegmentDataSlices)) }) +} + +func (x *Mappingnode) StateTypeName() string { + return "pkg/sentry/memmap.Mappingnode" +} + +func (x *Mappingnode) StateFields() []string { + return []string{ + "nrSegments", + "parent", + "parentIndex", + "hasChildren", + "maxGap", + "keys", + "values", + "children", + } } func (x *Mappingnode) beforeSave() {} -func (x *Mappingnode) save(m state.Map) { + +func (x *Mappingnode) StateSave(m state.Sink) { x.beforeSave() - m.Save("nrSegments", &x.nrSegments) - m.Save("parent", &x.parent) - m.Save("parentIndex", &x.parentIndex) - m.Save("hasChildren", &x.hasChildren) - m.Save("maxGap", &x.maxGap) - m.Save("keys", &x.keys) - m.Save("values", &x.values) - m.Save("children", &x.children) + m.Save(0, &x.nrSegments) + m.Save(1, &x.parent) + m.Save(2, &x.parentIndex) + m.Save(3, &x.hasChildren) + m.Save(4, &x.maxGap) + m.Save(5, &x.keys) + m.Save(6, &x.values) + m.Save(7, &x.children) } func (x *Mappingnode) afterLoad() {} -func (x *Mappingnode) load(m state.Map) { - m.Load("nrSegments", &x.nrSegments) - m.Load("parent", &x.parent) - m.Load("parentIndex", &x.parentIndex) - m.Load("hasChildren", &x.hasChildren) - m.Load("maxGap", &x.maxGap) - m.Load("keys", &x.keys) - m.Load("values", &x.values) - m.Load("children", &x.children) + +func (x *Mappingnode) StateLoad(m state.Source) { + m.Load(0, &x.nrSegments) + m.Load(1, &x.parent) + m.Load(2, &x.parentIndex) + m.Load(3, &x.hasChildren) + m.Load(4, &x.maxGap) + m.Load(5, &x.keys) + m.Load(6, &x.values) + m.Load(7, &x.children) +} + +func (x *MappingSegmentDataSlices) StateTypeName() string { + return "pkg/sentry/memmap.MappingSegmentDataSlices" +} + +func (x *MappingSegmentDataSlices) StateFields() []string { + return []string{ + "Start", + "End", + "Values", + } } func (x *MappingSegmentDataSlices) beforeSave() {} -func (x *MappingSegmentDataSlices) save(m state.Map) { + +func (x *MappingSegmentDataSlices) StateSave(m state.Sink) { x.beforeSave() - m.Save("Start", &x.Start) - m.Save("End", &x.End) - m.Save("Values", &x.Values) + m.Save(0, &x.Start) + m.Save(1, &x.End) + m.Save(2, &x.Values) } func (x *MappingSegmentDataSlices) afterLoad() {} -func (x *MappingSegmentDataSlices) load(m state.Map) { - m.Load("Start", &x.Start) - m.Load("End", &x.End) - m.Load("Values", &x.Values) + +func (x *MappingSegmentDataSlices) StateLoad(m state.Source) { + m.Load(0, &x.Start) + m.Load(1, &x.End) + m.Load(2, &x.Values) } func init() { - state.Register("pkg/sentry/memmap.MappingSet", (*MappingSet)(nil), state.Fns{Save: (*MappingSet).save, Load: (*MappingSet).load}) - state.Register("pkg/sentry/memmap.Mappingnode", (*Mappingnode)(nil), state.Fns{Save: (*Mappingnode).save, Load: (*Mappingnode).load}) - state.Register("pkg/sentry/memmap.MappingSegmentDataSlices", (*MappingSegmentDataSlices)(nil), state.Fns{Save: (*MappingSegmentDataSlices).save, Load: (*MappingSegmentDataSlices).load}) + state.Register((*MappingSet)(nil)) + state.Register((*Mappingnode)(nil)) + state.Register((*MappingSegmentDataSlices)(nil)) } diff --git a/pkg/sentry/memmap/memmap_state_autogen.go b/pkg/sentry/memmap/memmap_state_autogen.go index 2072dbad2..d7cd50786 100644 --- a/pkg/sentry/memmap/memmap_state_autogen.go +++ b/pkg/sentry/memmap/memmap_state_autogen.go @@ -6,35 +6,62 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *MappableRange) StateTypeName() string { + return "pkg/sentry/memmap.MappableRange" +} + +func (x *MappableRange) StateFields() []string { + return []string{ + "Start", + "End", + } +} + func (x *MappableRange) beforeSave() {} -func (x *MappableRange) save(m state.Map) { + +func (x *MappableRange) StateSave(m state.Sink) { x.beforeSave() - m.Save("Start", &x.Start) - m.Save("End", &x.End) + m.Save(0, &x.Start) + m.Save(1, &x.End) } func (x *MappableRange) afterLoad() {} -func (x *MappableRange) load(m state.Map) { - m.Load("Start", &x.Start) - m.Load("End", &x.End) + +func (x *MappableRange) StateLoad(m state.Source) { + m.Load(0, &x.Start) + m.Load(1, &x.End) +} + +func (x *MappingOfRange) StateTypeName() string { + return "pkg/sentry/memmap.MappingOfRange" +} + +func (x *MappingOfRange) StateFields() []string { + return []string{ + "MappingSpace", + "AddrRange", + "Writable", + } } func (x *MappingOfRange) beforeSave() {} -func (x *MappingOfRange) save(m state.Map) { + +func (x *MappingOfRange) StateSave(m state.Sink) { x.beforeSave() - m.Save("MappingSpace", &x.MappingSpace) - m.Save("AddrRange", &x.AddrRange) - m.Save("Writable", &x.Writable) + m.Save(0, &x.MappingSpace) + m.Save(1, &x.AddrRange) + m.Save(2, &x.Writable) } func (x *MappingOfRange) afterLoad() {} -func (x *MappingOfRange) load(m state.Map) { - m.Load("MappingSpace", &x.MappingSpace) - m.Load("AddrRange", &x.AddrRange) - m.Load("Writable", &x.Writable) + +func (x *MappingOfRange) StateLoad(m state.Source) { + m.Load(0, &x.MappingSpace) + m.Load(1, &x.AddrRange) + m.Load(2, &x.Writable) } func init() { - state.Register("pkg/sentry/memmap.MappableRange", (*MappableRange)(nil), state.Fns{Save: (*MappableRange).save, Load: (*MappableRange).load}) - state.Register("pkg/sentry/memmap.MappingOfRange", (*MappingOfRange)(nil), state.Fns{Save: (*MappingOfRange).save, Load: (*MappingOfRange).load}) + state.Register((*MappableRange)(nil)) + state.Register((*MappingOfRange)(nil)) } |