github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/sentry/kernel/ipc/ipc_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package ipc
     4  
     5  import (
     6  	"github.com/MerlinKodo/gvisor/pkg/state"
     7  )
     8  
     9  func (o *Object) StateTypeName() string {
    10  	return "pkg/sentry/kernel/ipc.Object"
    11  }
    12  
    13  func (o *Object) StateFields() []string {
    14  	return []string{
    15  		"UserNS",
    16  		"ID",
    17  		"Key",
    18  		"CreatorUID",
    19  		"CreatorGID",
    20  		"OwnerUID",
    21  		"OwnerGID",
    22  		"Mode",
    23  	}
    24  }
    25  
    26  func (o *Object) beforeSave() {}
    27  
    28  // +checklocksignore
    29  func (o *Object) StateSave(stateSinkObject state.Sink) {
    30  	o.beforeSave()
    31  	stateSinkObject.Save(0, &o.UserNS)
    32  	stateSinkObject.Save(1, &o.ID)
    33  	stateSinkObject.Save(2, &o.Key)
    34  	stateSinkObject.Save(3, &o.CreatorUID)
    35  	stateSinkObject.Save(4, &o.CreatorGID)
    36  	stateSinkObject.Save(5, &o.OwnerUID)
    37  	stateSinkObject.Save(6, &o.OwnerGID)
    38  	stateSinkObject.Save(7, &o.Mode)
    39  }
    40  
    41  func (o *Object) afterLoad() {}
    42  
    43  // +checklocksignore
    44  func (o *Object) StateLoad(stateSourceObject state.Source) {
    45  	stateSourceObject.Load(0, &o.UserNS)
    46  	stateSourceObject.Load(1, &o.ID)
    47  	stateSourceObject.Load(2, &o.Key)
    48  	stateSourceObject.Load(3, &o.CreatorUID)
    49  	stateSourceObject.Load(4, &o.CreatorGID)
    50  	stateSourceObject.Load(5, &o.OwnerUID)
    51  	stateSourceObject.Load(6, &o.OwnerGID)
    52  	stateSourceObject.Load(7, &o.Mode)
    53  }
    54  
    55  func (r *Registry) StateTypeName() string {
    56  	return "pkg/sentry/kernel/ipc.Registry"
    57  }
    58  
    59  func (r *Registry) StateFields() []string {
    60  	return []string{
    61  		"UserNS",
    62  		"objects",
    63  		"keysToIDs",
    64  		"lastIDUsed",
    65  	}
    66  }
    67  
    68  func (r *Registry) beforeSave() {}
    69  
    70  // +checklocksignore
    71  func (r *Registry) StateSave(stateSinkObject state.Sink) {
    72  	r.beforeSave()
    73  	stateSinkObject.Save(0, &r.UserNS)
    74  	stateSinkObject.Save(1, &r.objects)
    75  	stateSinkObject.Save(2, &r.keysToIDs)
    76  	stateSinkObject.Save(3, &r.lastIDUsed)
    77  }
    78  
    79  func (r *Registry) afterLoad() {}
    80  
    81  // +checklocksignore
    82  func (r *Registry) StateLoad(stateSourceObject state.Source) {
    83  	stateSourceObject.Load(0, &r.UserNS)
    84  	stateSourceObject.Load(1, &r.objects)
    85  	stateSourceObject.Load(2, &r.keysToIDs)
    86  	stateSourceObject.Load(3, &r.lastIDUsed)
    87  }
    88  
    89  func init() {
    90  	state.Register((*Object)(nil))
    91  	state.Register((*Registry)(nil))
    92  }