Documentation
¶
Index ¶
- Constants
- func AcceptableAsBaseDisk(info *Info) error
- type Info
- type InfoChild
- type InfoFormatSpecific
- type InfoFormatSpecificDataQcow2
- type InfoFormatSpecificDataVmdk
- type InfoFormatSpecificDataVmdkExtent
- type QemuImageUtil
- func (q *QemuImageUtil) ConvertToRaw(source, dest string, size *int64, allowSourceWithBackingFile bool) error
- func (q *QemuImageUtil) CreateDisk(disk string, size int64) error
- func (q *QemuImageUtil) MakeSparse(_ *os.File, _ int64) error
- func (q *QemuImageUtil) ResizeDisk(disk string, size int64) error
Constants ¶
View Source
const QemuImgFormat = "qcow2"
Variables ¶
This section is empty.
Functions ¶
func AcceptableAsBaseDisk ¶
AcceptableAsBaseDisk checks if a disk image is acceptable as a base disk.
Types ¶
type Info ¶
type Info struct { Filename string `json:"filename,omitempty"` // since QEMU 1.3 Format string `json:"format,omitempty"` // since QEMU 1.3 VSize int64 `json:"virtual-size,omitempty"` // since QEMU 1.3 ActualSize int64 `json:"actual-size,omitempty"` // since QEMU 1.3 DirtyFlag bool `json:"dirty-flag,omitempty"` // since QEMU 5.2 ClusterSize int `json:"cluster-size,omitempty"` // since QEMU 1.3 BackingFilename string `json:"backing-filename,omitempty"` // since QEMU 1.3 FullBackingFilename string `json:"full-backing-filename,omitempty"` // since QEMU 1.3 BackingFilenameFormat string `json:"backing-filename-format,omitempty"` // since QEMU 1.3 FormatSpecific *InfoFormatSpecific `json:"format-specific,omitempty"` // since QEMU 1.7 Children []InfoChild `json:"children,omitempty"` // since QEMU 8.0 }
Info corresponds to the output of `qemu-img info --output=json FILE`.
type InfoFormatSpecific ¶
type InfoFormatSpecific struct { Type string `json:"type,omitempty"` // since QEMU 1.7 Data json.RawMessage `json:"data,omitempty"` // since QEMU 1.7 }
func (*InfoFormatSpecific) Qcow2 ¶
func (sp *InfoFormatSpecific) Qcow2() *InfoFormatSpecificDataQcow2
func (*InfoFormatSpecific) Vmdk ¶
func (sp *InfoFormatSpecific) Vmdk() *InfoFormatSpecificDataVmdk
type InfoFormatSpecificDataQcow2 ¶
type InfoFormatSpecificDataQcow2 struct { Compat string `json:"compat,omitempty"` // since QEMU 1.7 LazyRefcounts bool `json:"lazy-refcounts,omitempty"` // since QEMU 1.7 Corrupt bool `json:"corrupt,omitempty"` // since QEMU 2.2 RefcountBits int `json:"refcount-bits,omitempty"` // since QEMU 2.3 CompressionType string `json:"compression-type,omitempty"` // since QEMU 5.1 ExtendedL2 bool `json:"extended-l2,omitempty"` // since QEMU 5.2 }
type InfoFormatSpecificDataVmdk ¶
type InfoFormatSpecificDataVmdk struct { CreateType string `json:"create-type,omitempty"` // since QEMU 1.7 CID int `json:"cid,omitempty"` // since QEMU 1.7 ParentCID int `json:"parent-cid,omitempty"` // since QEMU 1.7 Extents []InfoFormatSpecificDataVmdkExtent `json:"extents,omitempty"` // since QEMU 1.7 }
type QemuImageUtil ¶
type QemuImageUtil struct {
DefaultFormat string // Default disk format, e.g., "qcow2"
}
QemuImageUtil is the QEMU implementation of the imgutil Interface.
func (*QemuImageUtil) ConvertToRaw ¶
func (q *QemuImageUtil) ConvertToRaw(source, dest string, size *int64, allowSourceWithBackingFile bool) error
ConvertToRaw converts a disk image to raw format.
func (*QemuImageUtil) CreateDisk ¶
func (q *QemuImageUtil) CreateDisk(disk string, size int64) error
CreateDisk creates a new disk image with the specified size.
func (*QemuImageUtil) MakeSparse ¶
func (q *QemuImageUtil) MakeSparse(_ *os.File, _ int64) error
MakeSparse is a stub implementation as the qemu package doesn't provide this functionality.
func (*QemuImageUtil) ResizeDisk ¶
func (q *QemuImageUtil) ResizeDisk(disk string, size int64) error
ResizeDisk resizes an existing disk image to the specified size.
Click to show internal directories.
Click to hide internal directories.