summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/device/device_state_autogen.go
blob: 53fcb5d84582a4c080018311cdfd408079ee4d57 (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
// automatically generated by stateify.

package device

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

func (r *Registry) StateTypeName() string {
	return "pkg/sentry/device.Registry"
}

func (r *Registry) StateFields() []string {
	return []string{
		"lastAnonDeviceMinor",
		"devices",
	}
}

func (r *Registry) beforeSave() {}

func (r *Registry) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.lastAnonDeviceMinor)
	stateSinkObject.Save(1, &r.devices)
}

func (r *Registry) afterLoad() {}

func (r *Registry) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.lastAnonDeviceMinor)
	stateSourceObject.Load(1, &r.devices)
}

func (i *ID) StateTypeName() string {
	return "pkg/sentry/device.ID"
}

func (i *ID) StateFields() []string {
	return []string{
		"Major",
		"Minor",
	}
}

func (i *ID) beforeSave() {}

func (i *ID) StateSave(stateSinkObject state.Sink) {
	i.beforeSave()
	stateSinkObject.Save(0, &i.Major)
	stateSinkObject.Save(1, &i.Minor)
}

func (i *ID) afterLoad() {}

func (i *ID) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &i.Major)
	stateSourceObject.Load(1, &i.Minor)
}

func (d *Device) StateTypeName() string {
	return "pkg/sentry/device.Device"
}

func (d *Device) StateFields() []string {
	return []string{
		"ID",
		"last",
	}
}

func (d *Device) beforeSave() {}

func (d *Device) StateSave(stateSinkObject state.Sink) {
	d.beforeSave()
	stateSinkObject.Save(0, &d.ID)
	stateSinkObject.Save(1, &d.last)
}

func (d *Device) afterLoad() {}

func (d *Device) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &d.ID)
	stateSourceObject.Load(1, &d.last)
}

func init() {
	state.Register((*Registry)(nil))
	state.Register((*ID)(nil))
	state.Register((*Device)(nil))
}