github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/devices/tundev/tundev_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package tundev
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (t *tunDevice) StateTypeName() string {
    12  	return "pkg/sentry/devices/tundev.tunDevice"
    13  }
    14  
    15  func (t *tunDevice) StateFields() []string {
    16  	return []string{}
    17  }
    18  
    19  func (t *tunDevice) beforeSave() {}
    20  
    21  // +checklocksignore
    22  func (t *tunDevice) StateSave(stateSinkObject state.Sink) {
    23  	t.beforeSave()
    24  }
    25  
    26  func (t *tunDevice) afterLoad(context.Context) {}
    27  
    28  // +checklocksignore
    29  func (t *tunDevice) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    30  }
    31  
    32  func (fd *tunFD) StateTypeName() string {
    33  	return "pkg/sentry/devices/tundev.tunFD"
    34  }
    35  
    36  func (fd *tunFD) StateFields() []string {
    37  	return []string{
    38  		"vfsfd",
    39  		"FileDescriptionDefaultImpl",
    40  		"DentryMetadataFileDescriptionImpl",
    41  		"NoLockFD",
    42  		"device",
    43  	}
    44  }
    45  
    46  func (fd *tunFD) beforeSave() {}
    47  
    48  // +checklocksignore
    49  func (fd *tunFD) StateSave(stateSinkObject state.Sink) {
    50  	fd.beforeSave()
    51  	stateSinkObject.Save(0, &fd.vfsfd)
    52  	stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl)
    53  	stateSinkObject.Save(2, &fd.DentryMetadataFileDescriptionImpl)
    54  	stateSinkObject.Save(3, &fd.NoLockFD)
    55  	stateSinkObject.Save(4, &fd.device)
    56  }
    57  
    58  func (fd *tunFD) afterLoad(context.Context) {}
    59  
    60  // +checklocksignore
    61  func (fd *tunFD) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    62  	stateSourceObject.Load(0, &fd.vfsfd)
    63  	stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl)
    64  	stateSourceObject.Load(2, &fd.DentryMetadataFileDescriptionImpl)
    65  	stateSourceObject.Load(3, &fd.NoLockFD)
    66  	stateSourceObject.Load(4, &fd.device)
    67  }
    68  
    69  func init() {
    70  	state.Register((*tunDevice)(nil))
    71  	state.Register((*tunFD)(nil))
    72  }