github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/devices/memdev/memdev_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package memdev 4 5 import ( 6 "context" 7 8 "github.com/metacubex/gvisor/pkg/state" 9 ) 10 11 func (f *fullDevice) StateTypeName() string { 12 return "pkg/sentry/devices/memdev.fullDevice" 13 } 14 15 func (f *fullDevice) StateFields() []string { 16 return []string{} 17 } 18 19 func (f *fullDevice) beforeSave() {} 20 21 // +checklocksignore 22 func (f *fullDevice) StateSave(stateSinkObject state.Sink) { 23 f.beforeSave() 24 } 25 26 func (f *fullDevice) afterLoad(context.Context) {} 27 28 // +checklocksignore 29 func (f *fullDevice) StateLoad(ctx context.Context, stateSourceObject state.Source) { 30 } 31 32 func (fd *fullFD) StateTypeName() string { 33 return "pkg/sentry/devices/memdev.fullFD" 34 } 35 36 func (fd *fullFD) StateFields() []string { 37 return []string{ 38 "vfsfd", 39 "FileDescriptionDefaultImpl", 40 "DentryMetadataFileDescriptionImpl", 41 "NoLockFD", 42 } 43 } 44 45 func (fd *fullFD) beforeSave() {} 46 47 // +checklocksignore 48 func (fd *fullFD) StateSave(stateSinkObject state.Sink) { 49 fd.beforeSave() 50 stateSinkObject.Save(0, &fd.vfsfd) 51 stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl) 52 stateSinkObject.Save(2, &fd.DentryMetadataFileDescriptionImpl) 53 stateSinkObject.Save(3, &fd.NoLockFD) 54 } 55 56 func (fd *fullFD) afterLoad(context.Context) {} 57 58 // +checklocksignore 59 func (fd *fullFD) StateLoad(ctx context.Context, stateSourceObject state.Source) { 60 stateSourceObject.Load(0, &fd.vfsfd) 61 stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl) 62 stateSourceObject.Load(2, &fd.DentryMetadataFileDescriptionImpl) 63 stateSourceObject.Load(3, &fd.NoLockFD) 64 } 65 66 func (n *nullDevice) StateTypeName() string { 67 return "pkg/sentry/devices/memdev.nullDevice" 68 } 69 70 func (n *nullDevice) StateFields() []string { 71 return []string{} 72 } 73 74 func (n *nullDevice) beforeSave() {} 75 76 // +checklocksignore 77 func (n *nullDevice) StateSave(stateSinkObject state.Sink) { 78 n.beforeSave() 79 } 80 81 func (n *nullDevice) afterLoad(context.Context) {} 82 83 // +checklocksignore 84 func (n *nullDevice) StateLoad(ctx context.Context, stateSourceObject state.Source) { 85 } 86 87 func (fd *nullFD) StateTypeName() string { 88 return "pkg/sentry/devices/memdev.nullFD" 89 } 90 91 func (fd *nullFD) StateFields() []string { 92 return []string{ 93 "vfsfd", 94 "FileDescriptionDefaultImpl", 95 "DentryMetadataFileDescriptionImpl", 96 "NoLockFD", 97 } 98 } 99 100 func (fd *nullFD) beforeSave() {} 101 102 // +checklocksignore 103 func (fd *nullFD) StateSave(stateSinkObject state.Sink) { 104 fd.beforeSave() 105 stateSinkObject.Save(0, &fd.vfsfd) 106 stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl) 107 stateSinkObject.Save(2, &fd.DentryMetadataFileDescriptionImpl) 108 stateSinkObject.Save(3, &fd.NoLockFD) 109 } 110 111 func (fd *nullFD) afterLoad(context.Context) {} 112 113 // +checklocksignore 114 func (fd *nullFD) StateLoad(ctx context.Context, stateSourceObject state.Source) { 115 stateSourceObject.Load(0, &fd.vfsfd) 116 stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl) 117 stateSourceObject.Load(2, &fd.DentryMetadataFileDescriptionImpl) 118 stateSourceObject.Load(3, &fd.NoLockFD) 119 } 120 121 func (r *randomDevice) StateTypeName() string { 122 return "pkg/sentry/devices/memdev.randomDevice" 123 } 124 125 func (r *randomDevice) StateFields() []string { 126 return []string{} 127 } 128 129 func (r *randomDevice) beforeSave() {} 130 131 // +checklocksignore 132 func (r *randomDevice) StateSave(stateSinkObject state.Sink) { 133 r.beforeSave() 134 } 135 136 func (r *randomDevice) afterLoad(context.Context) {} 137 138 // +checklocksignore 139 func (r *randomDevice) StateLoad(ctx context.Context, stateSourceObject state.Source) { 140 } 141 142 func (fd *randomFD) StateTypeName() string { 143 return "pkg/sentry/devices/memdev.randomFD" 144 } 145 146 func (fd *randomFD) StateFields() []string { 147 return []string{ 148 "vfsfd", 149 "FileDescriptionDefaultImpl", 150 "DentryMetadataFileDescriptionImpl", 151 "NoLockFD", 152 "off", 153 } 154 } 155 156 func (fd *randomFD) beforeSave() {} 157 158 // +checklocksignore 159 func (fd *randomFD) StateSave(stateSinkObject state.Sink) { 160 fd.beforeSave() 161 stateSinkObject.Save(0, &fd.vfsfd) 162 stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl) 163 stateSinkObject.Save(2, &fd.DentryMetadataFileDescriptionImpl) 164 stateSinkObject.Save(3, &fd.NoLockFD) 165 stateSinkObject.Save(4, &fd.off) 166 } 167 168 func (fd *randomFD) afterLoad(context.Context) {} 169 170 // +checklocksignore 171 func (fd *randomFD) StateLoad(ctx context.Context, stateSourceObject state.Source) { 172 stateSourceObject.Load(0, &fd.vfsfd) 173 stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl) 174 stateSourceObject.Load(2, &fd.DentryMetadataFileDescriptionImpl) 175 stateSourceObject.Load(3, &fd.NoLockFD) 176 stateSourceObject.Load(4, &fd.off) 177 } 178 179 func (z *zeroDevice) StateTypeName() string { 180 return "pkg/sentry/devices/memdev.zeroDevice" 181 } 182 183 func (z *zeroDevice) StateFields() []string { 184 return []string{} 185 } 186 187 func (z *zeroDevice) beforeSave() {} 188 189 // +checklocksignore 190 func (z *zeroDevice) StateSave(stateSinkObject state.Sink) { 191 z.beforeSave() 192 } 193 194 func (z *zeroDevice) afterLoad(context.Context) {} 195 196 // +checklocksignore 197 func (z *zeroDevice) StateLoad(ctx context.Context, stateSourceObject state.Source) { 198 } 199 200 func (fd *zeroFD) StateTypeName() string { 201 return "pkg/sentry/devices/memdev.zeroFD" 202 } 203 204 func (fd *zeroFD) StateFields() []string { 205 return []string{ 206 "vfsfd", 207 "FileDescriptionDefaultImpl", 208 "DentryMetadataFileDescriptionImpl", 209 "NoLockFD", 210 } 211 } 212 213 func (fd *zeroFD) beforeSave() {} 214 215 // +checklocksignore 216 func (fd *zeroFD) StateSave(stateSinkObject state.Sink) { 217 fd.beforeSave() 218 stateSinkObject.Save(0, &fd.vfsfd) 219 stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl) 220 stateSinkObject.Save(2, &fd.DentryMetadataFileDescriptionImpl) 221 stateSinkObject.Save(3, &fd.NoLockFD) 222 } 223 224 func (fd *zeroFD) afterLoad(context.Context) {} 225 226 // +checklocksignore 227 func (fd *zeroFD) StateLoad(ctx context.Context, stateSourceObject state.Source) { 228 stateSourceObject.Load(0, &fd.vfsfd) 229 stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl) 230 stateSourceObject.Load(2, &fd.DentryMetadataFileDescriptionImpl) 231 stateSourceObject.Load(3, &fd.NoLockFD) 232 } 233 234 func init() { 235 state.Register((*fullDevice)(nil)) 236 state.Register((*fullFD)(nil)) 237 state.Register((*nullDevice)(nil)) 238 state.Register((*nullFD)(nil)) 239 state.Register((*randomDevice)(nil)) 240 state.Register((*randomFD)(nil)) 241 state.Register((*zeroDevice)(nil)) 242 state.Register((*zeroFD)(nil)) 243 }