github.com/nicocha30/gvisor-ligolo@v0.0.0-20230726075806-989fa2c0a413/pkg/sentry/fsimpl/host/host_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package host
     4  
     5  import (
     6  	"github.com/nicocha30/gvisor-ligolo/pkg/state"
     7  )
     8  
     9  func (v *virtualOwner) StateTypeName() string {
    10  	return "pkg/sentry/fsimpl/host.virtualOwner"
    11  }
    12  
    13  func (v *virtualOwner) StateFields() []string {
    14  	return []string{
    15  		"enabled",
    16  		"uid",
    17  		"gid",
    18  		"mode",
    19  	}
    20  }
    21  
    22  func (v *virtualOwner) beforeSave() {}
    23  
    24  // +checklocksignore
    25  func (v *virtualOwner) StateSave(stateSinkObject state.Sink) {
    26  	v.beforeSave()
    27  	stateSinkObject.Save(0, &v.enabled)
    28  	stateSinkObject.Save(1, &v.uid)
    29  	stateSinkObject.Save(2, &v.gid)
    30  	stateSinkObject.Save(3, &v.mode)
    31  }
    32  
    33  func (v *virtualOwner) afterLoad() {}
    34  
    35  // +checklocksignore
    36  func (v *virtualOwner) StateLoad(stateSourceObject state.Source) {
    37  	stateSourceObject.Load(0, &v.enabled)
    38  	stateSourceObject.Load(1, &v.uid)
    39  	stateSourceObject.Load(2, &v.gid)
    40  	stateSourceObject.Load(3, &v.mode)
    41  }
    42  
    43  func (i *inode) StateTypeName() string {
    44  	return "pkg/sentry/fsimpl/host.inode"
    45  }
    46  
    47  func (i *inode) StateFields() []string {
    48  	return []string{
    49  		"CachedMappable",
    50  		"InodeNoStatFS",
    51  		"InodeAnonymous",
    52  		"InodeNotDirectory",
    53  		"InodeNotSymlink",
    54  		"InodeTemporary",
    55  		"InodeWatches",
    56  		"locks",
    57  		"inodeRefs",
    58  		"hostFD",
    59  		"ino",
    60  		"ftype",
    61  		"epollable",
    62  		"seekable",
    63  		"isTTY",
    64  		"savable",
    65  		"readonly",
    66  		"queue",
    67  		"virtualOwner",
    68  		"haveBuf",
    69  		"buf",
    70  	}
    71  }
    72  
    73  // +checklocksignore
    74  func (i *inode) StateSave(stateSinkObject state.Sink) {
    75  	i.beforeSave()
    76  	stateSinkObject.Save(0, &i.CachedMappable)
    77  	stateSinkObject.Save(1, &i.InodeNoStatFS)
    78  	stateSinkObject.Save(2, &i.InodeAnonymous)
    79  	stateSinkObject.Save(3, &i.InodeNotDirectory)
    80  	stateSinkObject.Save(4, &i.InodeNotSymlink)
    81  	stateSinkObject.Save(5, &i.InodeTemporary)
    82  	stateSinkObject.Save(6, &i.InodeWatches)
    83  	stateSinkObject.Save(7, &i.locks)
    84  	stateSinkObject.Save(8, &i.inodeRefs)
    85  	stateSinkObject.Save(9, &i.hostFD)
    86  	stateSinkObject.Save(10, &i.ino)
    87  	stateSinkObject.Save(11, &i.ftype)
    88  	stateSinkObject.Save(12, &i.epollable)
    89  	stateSinkObject.Save(13, &i.seekable)
    90  	stateSinkObject.Save(14, &i.isTTY)
    91  	stateSinkObject.Save(15, &i.savable)
    92  	stateSinkObject.Save(16, &i.readonly)
    93  	stateSinkObject.Save(17, &i.queue)
    94  	stateSinkObject.Save(18, &i.virtualOwner)
    95  	stateSinkObject.Save(19, &i.haveBuf)
    96  	stateSinkObject.Save(20, &i.buf)
    97  }
    98  
    99  // +checklocksignore
   100  func (i *inode) StateLoad(stateSourceObject state.Source) {
   101  	stateSourceObject.Load(0, &i.CachedMappable)
   102  	stateSourceObject.Load(1, &i.InodeNoStatFS)
   103  	stateSourceObject.Load(2, &i.InodeAnonymous)
   104  	stateSourceObject.Load(3, &i.InodeNotDirectory)
   105  	stateSourceObject.Load(4, &i.InodeNotSymlink)
   106  	stateSourceObject.Load(5, &i.InodeTemporary)
   107  	stateSourceObject.Load(6, &i.InodeWatches)
   108  	stateSourceObject.Load(7, &i.locks)
   109  	stateSourceObject.Load(8, &i.inodeRefs)
   110  	stateSourceObject.Load(9, &i.hostFD)
   111  	stateSourceObject.Load(10, &i.ino)
   112  	stateSourceObject.Load(11, &i.ftype)
   113  	stateSourceObject.Load(12, &i.epollable)
   114  	stateSourceObject.Load(13, &i.seekable)
   115  	stateSourceObject.Load(14, &i.isTTY)
   116  	stateSourceObject.Load(15, &i.savable)
   117  	stateSourceObject.Load(16, &i.readonly)
   118  	stateSourceObject.Load(17, &i.queue)
   119  	stateSourceObject.Load(18, &i.virtualOwner)
   120  	stateSourceObject.Load(19, &i.haveBuf)
   121  	stateSourceObject.Load(20, &i.buf)
   122  	stateSourceObject.AfterLoad(i.afterLoad)
   123  }
   124  
   125  func (f *filesystemType) StateTypeName() string {
   126  	return "pkg/sentry/fsimpl/host.filesystemType"
   127  }
   128  
   129  func (f *filesystemType) StateFields() []string {
   130  	return []string{}
   131  }
   132  
   133  func (f *filesystemType) beforeSave() {}
   134  
   135  // +checklocksignore
   136  func (f *filesystemType) StateSave(stateSinkObject state.Sink) {
   137  	f.beforeSave()
   138  }
   139  
   140  func (f *filesystemType) afterLoad() {}
   141  
   142  // +checklocksignore
   143  func (f *filesystemType) StateLoad(stateSourceObject state.Source) {
   144  }
   145  
   146  func (fs *filesystem) StateTypeName() string {
   147  	return "pkg/sentry/fsimpl/host.filesystem"
   148  }
   149  
   150  func (fs *filesystem) StateFields() []string {
   151  	return []string{
   152  		"Filesystem",
   153  		"devMinor",
   154  	}
   155  }
   156  
   157  func (fs *filesystem) beforeSave() {}
   158  
   159  // +checklocksignore
   160  func (fs *filesystem) StateSave(stateSinkObject state.Sink) {
   161  	fs.beforeSave()
   162  	stateSinkObject.Save(0, &fs.Filesystem)
   163  	stateSinkObject.Save(1, &fs.devMinor)
   164  }
   165  
   166  func (fs *filesystem) afterLoad() {}
   167  
   168  // +checklocksignore
   169  func (fs *filesystem) StateLoad(stateSourceObject state.Source) {
   170  	stateSourceObject.Load(0, &fs.Filesystem)
   171  	stateSourceObject.Load(1, &fs.devMinor)
   172  }
   173  
   174  func (f *fileDescription) StateTypeName() string {
   175  	return "pkg/sentry/fsimpl/host.fileDescription"
   176  }
   177  
   178  func (f *fileDescription) StateFields() []string {
   179  	return []string{
   180  		"vfsfd",
   181  		"FileDescriptionDefaultImpl",
   182  		"LockFD",
   183  		"inode",
   184  		"offset",
   185  	}
   186  }
   187  
   188  func (f *fileDescription) beforeSave() {}
   189  
   190  // +checklocksignore
   191  func (f *fileDescription) StateSave(stateSinkObject state.Sink) {
   192  	f.beforeSave()
   193  	stateSinkObject.Save(0, &f.vfsfd)
   194  	stateSinkObject.Save(1, &f.FileDescriptionDefaultImpl)
   195  	stateSinkObject.Save(2, &f.LockFD)
   196  	stateSinkObject.Save(3, &f.inode)
   197  	stateSinkObject.Save(4, &f.offset)
   198  }
   199  
   200  func (f *fileDescription) afterLoad() {}
   201  
   202  // +checklocksignore
   203  func (f *fileDescription) StateLoad(stateSourceObject state.Source) {
   204  	stateSourceObject.Load(0, &f.vfsfd)
   205  	stateSourceObject.Load(1, &f.FileDescriptionDefaultImpl)
   206  	stateSourceObject.Load(2, &f.LockFD)
   207  	stateSourceObject.Load(3, &f.inode)
   208  	stateSourceObject.Load(4, &f.offset)
   209  }
   210  
   211  func (r *inodeRefs) StateTypeName() string {
   212  	return "pkg/sentry/fsimpl/host.inodeRefs"
   213  }
   214  
   215  func (r *inodeRefs) StateFields() []string {
   216  	return []string{
   217  		"refCount",
   218  	}
   219  }
   220  
   221  func (r *inodeRefs) beforeSave() {}
   222  
   223  // +checklocksignore
   224  func (r *inodeRefs) StateSave(stateSinkObject state.Sink) {
   225  	r.beforeSave()
   226  	stateSinkObject.Save(0, &r.refCount)
   227  }
   228  
   229  // +checklocksignore
   230  func (r *inodeRefs) StateLoad(stateSourceObject state.Source) {
   231  	stateSourceObject.Load(0, &r.refCount)
   232  	stateSourceObject.AfterLoad(r.afterLoad)
   233  }
   234  
   235  func (t *TTYFileDescription) StateTypeName() string {
   236  	return "pkg/sentry/fsimpl/host.TTYFileDescription"
   237  }
   238  
   239  func (t *TTYFileDescription) StateFields() []string {
   240  	return []string{
   241  		"fileDescription",
   242  		"session",
   243  		"fgProcessGroup",
   244  		"termios",
   245  	}
   246  }
   247  
   248  func (t *TTYFileDescription) beforeSave() {}
   249  
   250  // +checklocksignore
   251  func (t *TTYFileDescription) StateSave(stateSinkObject state.Sink) {
   252  	t.beforeSave()
   253  	stateSinkObject.Save(0, &t.fileDescription)
   254  	stateSinkObject.Save(1, &t.session)
   255  	stateSinkObject.Save(2, &t.fgProcessGroup)
   256  	stateSinkObject.Save(3, &t.termios)
   257  }
   258  
   259  func (t *TTYFileDescription) afterLoad() {}
   260  
   261  // +checklocksignore
   262  func (t *TTYFileDescription) StateLoad(stateSourceObject state.Source) {
   263  	stateSourceObject.Load(0, &t.fileDescription)
   264  	stateSourceObject.Load(1, &t.session)
   265  	stateSourceObject.Load(2, &t.fgProcessGroup)
   266  	stateSourceObject.Load(3, &t.termios)
   267  }
   268  
   269  func init() {
   270  	state.Register((*virtualOwner)(nil))
   271  	state.Register((*inode)(nil))
   272  	state.Register((*filesystemType)(nil))
   273  	state.Register((*filesystem)(nil))
   274  	state.Register((*fileDescription)(nil))
   275  	state.Register((*inodeRefs)(nil))
   276  	state.Register((*TTYFileDescription)(nil))
   277  }