github.com/Microsoft/azure-vhd-utils@v0.0.0-20230613175315-7c30a3748a1b/vhdcore/footer/vhdFeature.go (about)

     1  package footer
     2  
     3  import "fmt"
     4  
     5  // VhdFeature represents a bit field used to indicate specific feature support.
     6  // Value is stored in the footer in big-endian format.
     7  //
     8  type VhdFeature uint32
     9  
    10  const (
    11  	// VhdFeatureNoFeaturesEnabled indicates that hard disk image has no special features enabled in it.
    12  	//
    13  	VhdFeatureNoFeaturesEnabled VhdFeature = 0x00000000
    14  	// VhdFeatureTemporary indicates that current disk is a temporary disk. A temporary disk designation
    15  	// indicates to an application that this disk is a candidate for deletion on shutdown.
    16  	//
    17  	VhdFeatureTemporary = 0x00000001
    18  	// VhdFeatureReserved represents a bit must always be set to 1. All other bits are also reserved
    19  	// and should be set to 0
    20  	//
    21  	VhdFeatureReserved = 0x00000002
    22  )
    23  
    24  // String returns the string representation of the VhdFeature. If the int VhdFeature
    25  // value does not match with the predefined VhdFeatures then this function convert
    26  // int to string and return
    27  //
    28  func (v VhdFeature) String() string {
    29  	switch v {
    30  	case VhdFeatureNoFeaturesEnabled:
    31  		return "NoFeaturesEnabled"
    32  	case VhdFeatureTemporary:
    33  		return "Temporary"
    34  	case VhdFeatureReserved:
    35  		return "Reserved"
    36  	}
    37  
    38  	return fmt.Sprintf("%d", v)
    39  }