qcow2

package module
v0.0.0-...-cbec6a0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2015 License: MIT Imports: 0 Imported by: 5

README

qcow2

WIP bindings for qcow2 file format

installing

go get github.com/vbatts/qcow2/cmd/qcow2-info

License

See LICENSE

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Magic is the front of the file fingerprint
	Magic = []byte{0x51, 0x46, 0x49, 0xFB}

	// V2HeaderSize is the image header at the beginning of the file
	V2HeaderSize = 72

	// V3HeaderSize is directly following the v2 header, up to 104
	V3HeaderSize = 104 - V2HeaderSize
)

Functions

This section is empty.

Types

type CryptMethod

type CryptMethod int

CryptMethod is whether no encryption (0), or AES encryption (1)

func (CryptMethod) String

func (qcm CryptMethod) String() string

type ExtHeader

type ExtHeader struct {
	Type HeaderExtensionType
	Size int
	Data []byte
}
type Header struct {
	// magic [:4]
	Version               Version     // [4:8]
	BackingFileOffset     int64       // [8:16]
	BackingFileSize       int         // [16:20]
	ClusterBits           int         // [20:24]
	Size                  int64       // [24:32]
	CryptMethod           CryptMethod // [32:36]
	L1Size                int         // [36:40]
	L1TableOffset         int64       // [40:48]
	RefcountTableOffset   int64       // [48:56]
	RefcountTableClusters int         // [56:60]
	NbSnapshots           int         // [60:64]
	SnapshotsOffset       int64       // [64:72]

	// v3
	IncompatibleFeatures int // [72:80] bitmask
	CompatibleFeatures   int // [80:88] bitmask
	AutoclearFeatures    int // [88:96] bitmask
	RefcountOrder        int // [96:100]
	HeaderLength         int // [100:104]

	// Header extensions
	ExtHeaders []ExtHeader
}

type HeaderExtensionType

type HeaderExtensionType int

HeaderExtensionType indicators the the entries in the optional header area

const (
	HdrExtEndOfArea         HeaderExtensionType = 0x00000000
	HdrExtBackingFileFormat HeaderExtensionType = 0xE2792ACA
	HdrExtFeatureNameTable  HeaderExtensionType = 0x6803f857 // TODO needs processing for feature name table

)

type Version

type Version int

Version number of this image. Valid versions are 2 or 3

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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