forked from microsoft/azure-vhd-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vhdFeature.go
39 lines (34 loc) · 1.17 KB
/
vhdFeature.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
package footer
import "fmt"
// VhdFeature represents a bit field used to indicate specific feature support.
// Value is stored in the footer in big-endian format.
//
type VhdFeature uint32
const (
// VhdFeatureNoFeaturesEnabled indicates that hard disk image has no special features enabled in it.
//
VhdFeatureNoFeaturesEnabled VhdFeature = 0x00000000
// VhdFeatureTemporary indicates that current disk is a temporary disk. A temporary disk designation
// indicates to an application that this disk is a candidate for deletion on shutdown.
//
VhdFeatureTemporary = 0x00000001
// VhdFeatureReserved represents a bit must always be set to 1. All other bits are also reserved
// and should be set to 0
//
VhdFeatureReserved = 0x00000002
)
// String returns the string representation of the VhdFeature. If the int VhdFeature
// value does not match with the predefined VhdFeatures then this function convert
// int to string and return
//
func (v VhdFeature) String() string {
switch v {
case VhdFeatureNoFeaturesEnabled:
return "NoFeaturesEnabled"
case VhdFeatureTemporary:
return "Temporary"
case VhdFeatureReserved:
return "Reserved"
}
return fmt.Sprintf("%d", v)
}