-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVBD.enums.gen.go
145 lines (115 loc) · 2.35 KB
/
VBD.enums.gen.go
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
143
144
// This is a generated file. DO NOT EDIT manually.
package go_xen_client
//VbdOperations: vbd_operations enum type
type VbdOperations int
const(
VbdOperationsAttach VbdOperations = iota //Attempting to attach this VBD to a VM
VbdOperationsEject //Attempting to eject the media from this VBD
VbdOperationsInsert //Attempting to insert new media into this VBD
VbdOperationsPlug //Attempting to hotplug this VBD
VbdOperationsUnplug //Attempting to hot unplug this VBD
VbdOperationsUnplugForce //Attempting to forcibly unplug this VBD
VbdOperationsPause //Attempting to pause a block device backend
VbdOperationsUnpause //Attempting to unpause a block device backend
)
func (e VbdOperations) String() string {
switch e {
case 0:
return "attach"
case 1:
return "eject"
case 2:
return "insert"
case 3:
return "plug"
case 4:
return "unplug"
case 5:
return "unplug_force"
case 6:
return "pause"
case 7:
return "unpause"
default:
return ""
}
}
func ToVbdOperations(strValue string) VbdOperations {
switch strValue {
case "attach":
return 0
case "eject":
return 1
case "insert":
return 2
case "plug":
return 3
case "unplug":
return 4
case "unplug_force":
return 5
case "pause":
return 6
case "unpause":
return 7
default:
return -1
}
}
//VbdType: vbd_type enum type
type VbdType int
const(
VbdTypeCD VbdType = iota //VBD will appear to guest as CD
VbdTypeDisk //VBD will appear to guest as disk
VbdTypeFloppy //VBD will appear as a floppy
)
func (e VbdType) String() string {
switch e {
case 0:
return "CD"
case 1:
return "Disk"
case 2:
return "Floppy"
default:
return ""
}
}
func ToVbdType(strValue string) VbdType {
switch strValue {
case "CD":
return 0
case "Disk":
return 1
case "Floppy":
return 2
default:
return -1
}
}
//VbdMode: vbd_mode enum type
type VbdMode int
const(
VbdModeRO VbdMode = iota //only read-only access will be allowed
VbdModeRW //read-write access will be allowed
)
func (e VbdMode) String() string {
switch e {
case 0:
return "RO"
case 1:
return "RW"
default:
return ""
}
}
func ToVbdMode(strValue string) VbdMode {
switch strValue {
case "RO":
return 0
case "RW":
return 1
default:
return -1
}
}