vhd

package
v0.0.0-...-d12d6dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CookieMagic = 0x636f6e6563746978 // "conectix" as 64 bit big endian number

Constants for the VHD header

View Source
const CreatorApplicationMagic = 0x77696e20 // "win " as 4 bit big endian number. It's win<SPACE>
View Source
const CreatorHostOSMagic = 0x5769326b // "wi2k" as 4 bit big endian number
View Source
const CreatorVersionMagic = 0x000a0000
View Source
const DiskTypeDifferencing = 4
View Source
const DiskTypeDynamic = 3
View Source
const DiskTypeFixed = 2
View Source
const DiskTypeNone = 0

DiskType Constants DiskType = 1, 5, 6 are deprecated

View Source
const FeatureMask = 0x2
View Source
const FileFormatVersionMagic = 0x00010000
View Source
const FixedDataOffset = 0xFFFFFFFFFFFFFFFF
View Source
const FixedVHDHeaderSize int64 = 512
View Source
const MaxCHS = cMax * hMax * sMax * sectorBytes
View Source
const SaveStateNo = 0
View Source
const SaveStateYes = 1

Saved state constants

View Source
const TimeStart = "00 Jan 01 00:00 UTC"

Variables for time stamp

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter interface {
	ConvertToVHD(f *os.File) error
	ConvertFromVHD(f *os.File) error
}

Converter converts a disk image to and from a VHD format.

func NewFixedVHDConverter

func NewFixedVHDConverter() Converter

type FixedVHDHeader

type FixedVHDHeader struct {
	Cookie             uint64
	Features           uint32
	FileFormatVersion  uint32
	DataOffset         uint64
	TimeStamp          uint32
	CreatorApplication uint32
	CreatorVersion     uint32
	CreatorHostOS      uint32
	OriginalSize       uint64
	CurrentSize        uint64
	DiskGeometry       uint32
	DiskType           uint32
	Checksum           uint32
	UniqueID           [16]uint8
	SavedState         uint8
	Reserved           [427]uint8
}

FixedVHDHeader is the footer for a fixed VHD

func NewFixedVHDHeader

func NewFixedVHDHeader(size uint64) (*FixedVHDHeader, error)

func (*FixedVHDHeader) Bytes

func (hdr *FixedVHDHeader) Bytes() ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL