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

     1  // automatically generated by stateify.
     2  
     3  package tpuproxy
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (dev *tpuDevice) StateTypeName() string {
    12  	return "pkg/sentry/devices/tpuproxy.tpuDevice"
    13  }
    14  
    15  func (dev *tpuDevice) StateFields() []string {
    16  	return []string{
    17  		"mu",
    18  		"minor",
    19  	}
    20  }
    21  
    22  func (dev *tpuDevice) beforeSave() {}
    23  
    24  // +checklocksignore
    25  func (dev *tpuDevice) StateSave(stateSinkObject state.Sink) {
    26  	dev.beforeSave()
    27  	stateSinkObject.Save(0, &dev.mu)
    28  	stateSinkObject.Save(1, &dev.minor)
    29  }
    30  
    31  func (dev *tpuDevice) afterLoad(context.Context) {}
    32  
    33  // +checklocksignore
    34  func (dev *tpuDevice) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    35  	stateSourceObject.Load(0, &dev.mu)
    36  	stateSourceObject.Load(1, &dev.minor)
    37  }
    38  
    39  func init() {
    40  	state.Register((*tpuDevice)(nil))
    41  }