github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/kernel/ipc/ipc_state_autogen.go (about)

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