github.com/nicocha30/gvisor-ligolo@v0.0.0-20230726075806-989fa2c0a413/pkg/sentry/kernel/pipe/pipe_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package pipe 4 5 import ( 6 "github.com/nicocha30/gvisor-ligolo/pkg/state" 7 ) 8 9 func (p *Pipe) StateTypeName() string { 10 return "pkg/sentry/kernel/pipe.Pipe" 11 } 12 13 func (p *Pipe) StateFields() []string { 14 return []string{ 15 "queue", 16 "isNamed", 17 "readers", 18 "totalReaders", 19 "writers", 20 "totalWriters", 21 "buf", 22 "off", 23 "size", 24 "max", 25 "hadWriter", 26 } 27 } 28 29 func (p *Pipe) beforeSave() {} 30 31 // +checklocksignore 32 func (p *Pipe) StateSave(stateSinkObject state.Sink) { 33 p.beforeSave() 34 stateSinkObject.Save(0, &p.queue) 35 stateSinkObject.Save(1, &p.isNamed) 36 stateSinkObject.Save(2, &p.readers) 37 stateSinkObject.Save(3, &p.totalReaders) 38 stateSinkObject.Save(4, &p.writers) 39 stateSinkObject.Save(5, &p.totalWriters) 40 stateSinkObject.Save(6, &p.buf) 41 stateSinkObject.Save(7, &p.off) 42 stateSinkObject.Save(8, &p.size) 43 stateSinkObject.Save(9, &p.max) 44 stateSinkObject.Save(10, &p.hadWriter) 45 } 46 47 // +checklocksignore 48 func (p *Pipe) StateLoad(stateSourceObject state.Source) { 49 stateSourceObject.Load(0, &p.queue) 50 stateSourceObject.Load(1, &p.isNamed) 51 stateSourceObject.Load(2, &p.readers) 52 stateSourceObject.Load(3, &p.totalReaders) 53 stateSourceObject.Load(4, &p.writers) 54 stateSourceObject.Load(5, &p.totalWriters) 55 stateSourceObject.Load(6, &p.buf) 56 stateSourceObject.Load(7, &p.off) 57 stateSourceObject.Load(8, &p.size) 58 stateSourceObject.Load(9, &p.max) 59 stateSourceObject.Load(10, &p.hadWriter) 60 stateSourceObject.AfterLoad(p.afterLoad) 61 } 62 63 func (vp *VFSPipe) StateTypeName() string { 64 return "pkg/sentry/kernel/pipe.VFSPipe" 65 } 66 67 func (vp *VFSPipe) StateFields() []string { 68 return []string{ 69 "pipe", 70 } 71 } 72 73 func (vp *VFSPipe) beforeSave() {} 74 75 // +checklocksignore 76 func (vp *VFSPipe) StateSave(stateSinkObject state.Sink) { 77 vp.beforeSave() 78 stateSinkObject.Save(0, &vp.pipe) 79 } 80 81 func (vp *VFSPipe) afterLoad() {} 82 83 // +checklocksignore 84 func (vp *VFSPipe) StateLoad(stateSourceObject state.Source) { 85 stateSourceObject.Load(0, &vp.pipe) 86 } 87 88 func (fd *VFSPipeFD) StateTypeName() string { 89 return "pkg/sentry/kernel/pipe.VFSPipeFD" 90 } 91 92 func (fd *VFSPipeFD) StateFields() []string { 93 return []string{ 94 "vfsfd", 95 "FileDescriptionDefaultImpl", 96 "DentryMetadataFileDescriptionImpl", 97 "LockFD", 98 "pipe", 99 } 100 } 101 102 func (fd *VFSPipeFD) beforeSave() {} 103 104 // +checklocksignore 105 func (fd *VFSPipeFD) StateSave(stateSinkObject state.Sink) { 106 fd.beforeSave() 107 stateSinkObject.Save(0, &fd.vfsfd) 108 stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl) 109 stateSinkObject.Save(2, &fd.DentryMetadataFileDescriptionImpl) 110 stateSinkObject.Save(3, &fd.LockFD) 111 stateSinkObject.Save(4, &fd.pipe) 112 } 113 114 func (fd *VFSPipeFD) afterLoad() {} 115 116 // +checklocksignore 117 func (fd *VFSPipeFD) StateLoad(stateSourceObject state.Source) { 118 stateSourceObject.Load(0, &fd.vfsfd) 119 stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl) 120 stateSourceObject.Load(2, &fd.DentryMetadataFileDescriptionImpl) 121 stateSourceObject.Load(3, &fd.LockFD) 122 stateSourceObject.Load(4, &fd.pipe) 123 } 124 125 func init() { 126 state.Register((*Pipe)(nil)) 127 state.Register((*VFSPipe)(nil)) 128 state.Register((*VFSPipeFD)(nil)) 129 }