summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/host/host_state_autogen.go
blob: e689cd52c3a68642f4958393ea7b204ae3494864 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// automatically generated by stateify.

package host

import (
	"gvisor.dev/gvisor/pkg/state"
)

func (x *descriptor) save(m state.Map) {
	x.beforeSave()
	m.Save("donated", &x.donated)
	m.Save("origFD", &x.origFD)
	m.Save("wouldBlock", &x.wouldBlock)
}

func (x *descriptor) load(m state.Map) {
	m.Load("donated", &x.donated)
	m.Load("origFD", &x.origFD)
	m.Load("wouldBlock", &x.wouldBlock)
	m.AfterLoad(x.afterLoad)
}

func (x *fileOperations) beforeSave() {}
func (x *fileOperations) save(m state.Map) {
	x.beforeSave()
	m.Save("iops", &x.iops)
	m.Save("dirCursor", &x.dirCursor)
}

func (x *fileOperations) afterLoad() {}
func (x *fileOperations) load(m state.Map) {
	m.LoadWait("iops", &x.iops)
	m.Load("dirCursor", &x.dirCursor)
}

func (x *Filesystem) beforeSave() {}
func (x *Filesystem) save(m state.Map) {
	x.beforeSave()
	m.Save("paths", &x.paths)
}

func (x *Filesystem) afterLoad() {}
func (x *Filesystem) load(m state.Map) {
	m.Load("paths", &x.paths)
}

func (x *superOperations) beforeSave() {}
func (x *superOperations) save(m state.Map) {
	x.beforeSave()
	m.Save("SimpleMountSourceOperations", &x.SimpleMountSourceOperations)
	m.Save("root", &x.root)
	m.Save("inodeMappings", &x.inodeMappings)
	m.Save("mounter", &x.mounter)
	m.Save("dontTranslateOwnership", &x.dontTranslateOwnership)
}

func (x *superOperations) afterLoad() {}
func (x *superOperations) load(m state.Map) {
	m.Load("SimpleMountSourceOperations", &x.SimpleMountSourceOperations)
	m.Load("root", &x.root)
	m.Load("inodeMappings", &x.inodeMappings)
	m.Load("mounter", &x.mounter)
	m.Load("dontTranslateOwnership", &x.dontTranslateOwnership)
}

func (x *inodeOperations) beforeSave() {}
func (x *inodeOperations) save(m state.Map) {
	x.beforeSave()
	m.Save("fileState", &x.fileState)
	m.Save("cachingInodeOps", &x.cachingInodeOps)
}

func (x *inodeOperations) afterLoad() {}
func (x *inodeOperations) load(m state.Map) {
	m.LoadWait("fileState", &x.fileState)
	m.Load("cachingInodeOps", &x.cachingInodeOps)
}

func (x *inodeFileState) save(m state.Map) {
	x.beforeSave()
	if !state.IsZeroValue(x.queue) {
		m.Failf("queue is %v, expected zero", x.queue)
	}
	m.Save("mops", &x.mops)
	m.Save("descriptor", &x.descriptor)
	m.Save("sattr", &x.sattr)
	m.Save("savedUAttr", &x.savedUAttr)
}

func (x *inodeFileState) load(m state.Map) {
	m.LoadWait("mops", &x.mops)
	m.LoadWait("descriptor", &x.descriptor)
	m.LoadWait("sattr", &x.sattr)
	m.Load("savedUAttr", &x.savedUAttr)
	m.AfterLoad(x.afterLoad)
}

func (x *ConnectedEndpoint) save(m state.Map) {
	x.beforeSave()
	m.Save("ref", &x.ref)
	m.Save("queue", &x.queue)
	m.Save("path", &x.path)
	m.Save("srfd", &x.srfd)
	m.Save("stype", &x.stype)
}

func (x *ConnectedEndpoint) load(m state.Map) {
	m.Load("ref", &x.ref)
	m.Load("queue", &x.queue)
	m.Load("path", &x.path)
	m.LoadWait("srfd", &x.srfd)
	m.Load("stype", &x.stype)
	m.AfterLoad(x.afterLoad)
}

func (x *TTYFileOperations) beforeSave() {}
func (x *TTYFileOperations) save(m state.Map) {
	x.beforeSave()
	m.Save("fileOperations", &x.fileOperations)
	m.Save("session", &x.session)
	m.Save("fgProcessGroup", &x.fgProcessGroup)
	m.Save("termios", &x.termios)
}

func (x *TTYFileOperations) afterLoad() {}
func (x *TTYFileOperations) load(m state.Map) {
	m.Load("fileOperations", &x.fileOperations)
	m.Load("session", &x.session)
	m.Load("fgProcessGroup", &x.fgProcessGroup)
	m.Load("termios", &x.termios)
}

func init() {
	state.Register("pkg/sentry/fs/host.descriptor", (*descriptor)(nil), state.Fns{Save: (*descriptor).save, Load: (*descriptor).load})
	state.Register("pkg/sentry/fs/host.fileOperations", (*fileOperations)(nil), state.Fns{Save: (*fileOperations).save, Load: (*fileOperations).load})
	state.Register("pkg/sentry/fs/host.Filesystem", (*Filesystem)(nil), state.Fns{Save: (*Filesystem).save, Load: (*Filesystem).load})
	state.Register("pkg/sentry/fs/host.superOperations", (*superOperations)(nil), state.Fns{Save: (*superOperations).save, Load: (*superOperations).load})
	state.Register("pkg/sentry/fs/host.inodeOperations", (*inodeOperations)(nil), state.Fns{Save: (*inodeOperations).save, Load: (*inodeOperations).load})
	state.Register("pkg/sentry/fs/host.inodeFileState", (*inodeFileState)(nil), state.Fns{Save: (*inodeFileState).save, Load: (*inodeFileState).load})
	state.Register("pkg/sentry/fs/host.ConnectedEndpoint", (*ConnectedEndpoint)(nil), state.Fns{Save: (*ConnectedEndpoint).save, Load: (*ConnectedEndpoint).load})
	state.Register("pkg/sentry/fs/host.TTYFileOperations", (*TTYFileOperations)(nil), state.Fns{Save: (*TTYFileOperations).save, Load: (*TTYFileOperations).load})
}