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/limits | |
parent | cab13958a54419262aba2a0cd7f1075ed02c8ee0 (diff) | |
parent | 364ac92baf83f2352f78b718090472639bd92a76 (diff) |
Merge release-20200608.0-119-g364ac92ba (automated)
Diffstat (limited to 'pkg/sentry/limits')
-rw-r--r-- | pkg/sentry/limits/limits_state_autogen.go | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/pkg/sentry/limits/limits_state_autogen.go b/pkg/sentry/limits/limits_state_autogen.go index aa42533a9..72503d1d7 100644 --- a/pkg/sentry/limits/limits_state_autogen.go +++ b/pkg/sentry/limits/limits_state_autogen.go @@ -6,31 +6,56 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *Limit) StateTypeName() string { + return "pkg/sentry/limits.Limit" +} + +func (x *Limit) StateFields() []string { + return []string{ + "Cur", + "Max", + } +} + func (x *Limit) beforeSave() {} -func (x *Limit) save(m state.Map) { + +func (x *Limit) StateSave(m state.Sink) { x.beforeSave() - m.Save("Cur", &x.Cur) - m.Save("Max", &x.Max) + m.Save(0, &x.Cur) + m.Save(1, &x.Max) } func (x *Limit) afterLoad() {} -func (x *Limit) load(m state.Map) { - m.Load("Cur", &x.Cur) - m.Load("Max", &x.Max) + +func (x *Limit) StateLoad(m state.Source) { + m.Load(0, &x.Cur) + m.Load(1, &x.Max) +} + +func (x *LimitSet) StateTypeName() string { + return "pkg/sentry/limits.LimitSet" +} + +func (x *LimitSet) StateFields() []string { + return []string{ + "data", + } } func (x *LimitSet) beforeSave() {} -func (x *LimitSet) save(m state.Map) { + +func (x *LimitSet) StateSave(m state.Sink) { x.beforeSave() - m.Save("data", &x.data) + m.Save(0, &x.data) } func (x *LimitSet) afterLoad() {} -func (x *LimitSet) load(m state.Map) { - m.Load("data", &x.data) + +func (x *LimitSet) StateLoad(m state.Source) { + m.Load(0, &x.data) } func init() { - state.Register("pkg/sentry/limits.Limit", (*Limit)(nil), state.Fns{Save: (*Limit).save, Load: (*Limit).load}) - state.Register("pkg/sentry/limits.LimitSet", (*LimitSet)(nil), state.Fns{Save: (*LimitSet).save, Load: (*LimitSet).load}) + state.Register((*Limit)(nil)) + state.Register((*LimitSet)(nil)) } |