github.com/nicocha30/gvisor-ligolo@v0.0.0-20230726075806-989fa2c0a413/pkg/sentry/platform/kvm/kvm_unsafe_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  //go:build go1.18 && go1.18
     4  // +build go1.18,go1.18
     5  
     6  package kvm
     7  
     8  import (
     9  	"github.com/nicocha30/gvisor-ligolo/pkg/state"
    10  )
    11  
    12  func (p *machineAtomicPtr) StateTypeName() string {
    13  	return "pkg/sentry/platform/kvm.machineAtomicPtr"
    14  }
    15  
    16  func (p *machineAtomicPtr) StateFields() []string {
    17  	return []string{
    18  		"ptr",
    19  	}
    20  }
    21  
    22  func (p *machineAtomicPtr) beforeSave() {}
    23  
    24  // +checklocksignore
    25  func (p *machineAtomicPtr) StateSave(stateSinkObject state.Sink) {
    26  	p.beforeSave()
    27  	var ptrValue *machine
    28  	ptrValue = p.savePtr()
    29  	stateSinkObject.SaveValue(0, ptrValue)
    30  }
    31  
    32  func (p *machineAtomicPtr) afterLoad() {}
    33  
    34  // +checklocksignore
    35  func (p *machineAtomicPtr) StateLoad(stateSourceObject state.Source) {
    36  	stateSourceObject.LoadValue(0, new(*machine), func(y any) { p.loadPtr(y.(*machine)) })
    37  }
    38  
    39  func init() {
    40  	state.Register((*machineAtomicPtr)(nil))
    41  }