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