github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/socket/control/control_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package control 4 5 import ( 6 "context" 7 8 "github.com/metacubex/gvisor/pkg/state" 9 ) 10 11 func (c *scmCredentials) StateTypeName() string { 12 return "pkg/sentry/socket/control.scmCredentials" 13 } 14 15 func (c *scmCredentials) StateFields() []string { 16 return []string{ 17 "t", 18 "kuid", 19 "kgid", 20 } 21 } 22 23 func (c *scmCredentials) beforeSave() {} 24 25 // +checklocksignore 26 func (c *scmCredentials) StateSave(stateSinkObject state.Sink) { 27 c.beforeSave() 28 stateSinkObject.Save(0, &c.t) 29 stateSinkObject.Save(1, &c.kuid) 30 stateSinkObject.Save(2, &c.kgid) 31 } 32 33 func (c *scmCredentials) afterLoad(context.Context) {} 34 35 // +checklocksignore 36 func (c *scmCredentials) StateLoad(ctx context.Context, stateSourceObject state.Source) { 37 stateSourceObject.Load(0, &c.t) 38 stateSourceObject.Load(1, &c.kuid) 39 stateSourceObject.Load(2, &c.kgid) 40 } 41 42 func (fs *RightsFiles) StateTypeName() string { 43 return "pkg/sentry/socket/control.RightsFiles" 44 } 45 46 func (fs *RightsFiles) StateFields() []string { 47 return nil 48 } 49 50 func init() { 51 state.Register((*scmCredentials)(nil)) 52 state.Register((*RightsFiles)(nil)) 53 }