Documentation ¶
Index ¶
Constants ¶
const ( // ExtImg is a constant for the .img extenstion ExtImg = ".img" // ExtIso is a constant for the .iso extenstion ExtIso = ".iso" // ExtGz is a constant for the .gz extenstion ExtGz = ".gz" // ExtQcow2 is a constant for the .qcow2 extenstion ExtQcow2 = ".qcow2" // ExtTar is a constant for the .tar extenstion ExtTar = ".tar" // ExtXz is a constant for the .xz extenstion ExtXz = ".xz" // ExtTarXz is a constant for the .tar.xz extenstion ExtTarXz = ExtTar + ExtXz // ExtTarGz is a constant for the .tar.gz extenstion ExtTarGz = ExtTar + ExtGz )
const MaxExpectedHdrSize = 512
MaxExpectedHdrSize defines the Size of buffer used to read file headers. Note: this is the size of tar's header. If a larger number is used the tar unarchive operation
creates the destination file too large, by the difference between this const and 512.
Variables ¶
This section is empty.
Functions ¶
func ConvertQcow2ToRaw ¶
ConvertQcow2ToRaw is a wrapper for qemu-img convert which takes a qcow2 file (specified by src) and converts it to a raw image (written to the provided dest file)
func ConvertQcow2ToRawStream ¶
ConvertQcow2ToRawStream converts an http accessible qcow2 image to raw format without locally caching the qcow2 image
Types ¶
type Header ¶
type Header struct { Format string SizeOff int // in bytes SizeLen int // in bytes // contains filtered or unexported fields }
Header represents our parameters for a file format header
type Headers ¶
Headers provides a map for header info, key is file format, eg. "gz" or "tar", value is metadata describing the layout for this hdr
func CopyKnownHdrs ¶
func CopyKnownHdrs() Headers
CopyKnownHdrs performs a simple map copy since := assignment copies the reference to the map, not contents.
type QEMUOperations ¶
type QEMUOperations interface { ConvertQcow2ToRaw(string, string) error ConvertQcow2ToRawStream(*url.URL, string) error Validate(string, string) error }
QEMUOperations defines the interface for executing qemu subprocesses
func NewQEMUOperations ¶
func NewQEMUOperations() QEMUOperations
NewQEMUOperations returns the default implementation of QEMUOperations