qcow2

package
v0.0.0-...-79a645e Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SectorSize = 0x200
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	Magic                 uint32 //     [0:3] magic: QCOW magic string ("QFI\xfb")
	Version               uint32 //     [4:7] Version number
	BackingFileOffset     uint64 //    [8:15] Offset into the image file at which the backing file name is stored.
	BackingFileSize       uint32 //   [16:19] Length of the backing file name in bytes.
	ClusterBits           uint32 //   [20:23] Number of bits that are used for addressing an offset whithin a cluster.
	Size                  uint64 //   [24:31] Virtual disk size in bytes
	CryptMethod           uint32 //   [32:35] Crypt method
	L1Size                uint32 //   [36:39] Number of entries in the active L1 table
	L1TableOffset         uint64 //   [40:47] Offset into the image file at which the active L1 table starts
	RefcountTableOffset   uint64 //   [48:55] Offset into the image file at which the refcount table starts
	RefcountTableClusters uint32 //   [56:59] Number of clusters that the refcount table occupies
	NbSnapshots           uint32 //   [60:63] Number of snapshots contained in the image
	SnapshotsOffset       uint64 //   [64:71] Offset into the image file at which the snapshot table starts
	IncompatibleFeatures  uint64 //   [72:79] for version >= 3: Bitmask of incomptible feature
	CompatibleFeatures    uint64 //   [80:87] for version >= 3: Bitmask of compatible feature
	AutoclearFeatures     uint64 //   [88:95] for version >= 3: Bitmask of auto-clear feature
	RefcountOrder         uint32 //   [96:99] for version >= 3: Describes the width of a reference count block entry
	HeaderLength          uint32 // [100:103] for version >= 3: Length of the header structure in bytes
}

type HolePredictor

type HolePredictor interface {
	Size() int64
	RegionIsHole(begin, size int64) bool
}

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(w io.WriteSeeker, h HolePredictor) (*Writer, error)

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) Seek

func (w *Writer) Seek(offset int64, whence int) (int64, error)

func (*Writer) Write

func (w *Writer) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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