github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/devices/nvproxy/nvproxy_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package nvproxy 4 5 import ( 6 "context" 7 8 "github.com/metacubex/gvisor/pkg/state" 9 ) 10 11 func (dev *frontendDevice) StateTypeName() string { 12 return "pkg/sentry/devices/nvproxy.frontendDevice" 13 } 14 15 func (dev *frontendDevice) StateFields() []string { 16 return []string{ 17 "nvp", 18 "minor", 19 } 20 } 21 22 func (dev *frontendDevice) beforeSave() {} 23 24 // +checklocksignore 25 func (dev *frontendDevice) StateSave(stateSinkObject state.Sink) { 26 dev.beforeSave() 27 stateSinkObject.Save(0, &dev.nvp) 28 stateSinkObject.Save(1, &dev.minor) 29 } 30 31 func (dev *frontendDevice) afterLoad(context.Context) {} 32 33 // +checklocksignore 34 func (dev *frontendDevice) StateLoad(ctx context.Context, stateSourceObject state.Source) { 35 stateSourceObject.Load(0, &dev.nvp) 36 stateSourceObject.Load(1, &dev.minor) 37 } 38 39 func (n *nvproxy) StateTypeName() string { 40 return "pkg/sentry/devices/nvproxy.nvproxy" 41 } 42 43 func (n *nvproxy) StateFields() []string { 44 return []string{ 45 "version", 46 } 47 } 48 49 // +checklocksignore 50 func (n *nvproxy) StateSave(stateSinkObject state.Sink) { 51 n.beforeSave() 52 stateSinkObject.Save(0, &n.version) 53 } 54 55 // +checklocksignore 56 func (n *nvproxy) StateLoad(ctx context.Context, stateSourceObject state.Source) { 57 stateSourceObject.Load(0, &n.version) 58 stateSourceObject.AfterLoad(func() { n.afterLoad(ctx) }) 59 } 60 61 func (o *object) StateTypeName() string { 62 return "pkg/sentry/devices/nvproxy.object" 63 } 64 65 func (o *object) StateFields() []string { 66 return []string{ 67 "impl", 68 } 69 } 70 71 func (o *object) beforeSave() {} 72 73 // +checklocksignore 74 func (o *object) StateSave(stateSinkObject state.Sink) { 75 o.beforeSave() 76 stateSinkObject.Save(0, &o.impl) 77 } 78 79 func (o *object) afterLoad(context.Context) {} 80 81 // +checklocksignore 82 func (o *object) StateLoad(ctx context.Context, stateSourceObject state.Source) { 83 stateSourceObject.Load(0, &o.impl) 84 } 85 86 func (o *osDescMem) StateTypeName() string { 87 return "pkg/sentry/devices/nvproxy.osDescMem" 88 } 89 90 func (o *osDescMem) StateFields() []string { 91 return []string{ 92 "object", 93 "pinnedRanges", 94 } 95 } 96 97 func (o *osDescMem) beforeSave() {} 98 99 // +checklocksignore 100 func (o *osDescMem) StateSave(stateSinkObject state.Sink) { 101 o.beforeSave() 102 stateSinkObject.Save(0, &o.object) 103 stateSinkObject.Save(1, &o.pinnedRanges) 104 } 105 106 func (o *osDescMem) afterLoad(context.Context) {} 107 108 // +checklocksignore 109 func (o *osDescMem) StateLoad(ctx context.Context, stateSourceObject state.Source) { 110 stateSourceObject.Load(0, &o.object) 111 stateSourceObject.Load(1, &o.pinnedRanges) 112 } 113 114 func (dev *uvmDevice) StateTypeName() string { 115 return "pkg/sentry/devices/nvproxy.uvmDevice" 116 } 117 118 func (dev *uvmDevice) StateFields() []string { 119 return []string{ 120 "nvp", 121 } 122 } 123 124 func (dev *uvmDevice) beforeSave() {} 125 126 // +checklocksignore 127 func (dev *uvmDevice) StateSave(stateSinkObject state.Sink) { 128 dev.beforeSave() 129 stateSinkObject.Save(0, &dev.nvp) 130 } 131 132 func (dev *uvmDevice) afterLoad(context.Context) {} 133 134 // +checklocksignore 135 func (dev *uvmDevice) StateLoad(ctx context.Context, stateSourceObject state.Source) { 136 stateSourceObject.Load(0, &dev.nvp) 137 } 138 139 func (v *DriverVersion) StateTypeName() string { 140 return "pkg/sentry/devices/nvproxy.DriverVersion" 141 } 142 143 func (v *DriverVersion) StateFields() []string { 144 return []string{ 145 "major", 146 "minor", 147 "patch", 148 } 149 } 150 151 func (v *DriverVersion) beforeSave() {} 152 153 // +checklocksignore 154 func (v *DriverVersion) StateSave(stateSinkObject state.Sink) { 155 v.beforeSave() 156 stateSinkObject.Save(0, &v.major) 157 stateSinkObject.Save(1, &v.minor) 158 stateSinkObject.Save(2, &v.patch) 159 } 160 161 func (v *DriverVersion) afterLoad(context.Context) {} 162 163 // +checklocksignore 164 func (v *DriverVersion) StateLoad(ctx context.Context, stateSourceObject state.Source) { 165 stateSourceObject.Load(0, &v.major) 166 stateSourceObject.Load(1, &v.minor) 167 stateSourceObject.Load(2, &v.patch) 168 } 169 170 func init() { 171 state.Register((*frontendDevice)(nil)) 172 state.Register((*nvproxy)(nil)) 173 state.Register((*object)(nil)) 174 state.Register((*osDescMem)(nil)) 175 state.Register((*uvmDevice)(nil)) 176 state.Register((*DriverVersion)(nil)) 177 }