Documentation ¶
Overview ¶
Package qemugen translates the high level concepts used by Machina into concrete virtual machine descriptions use by QEMU. It generates QEMU virtual machine definitions from Machina virtual machine definitions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type StorageHandler ¶
type StorageHandler interface { NodeName(spec VolumeSpec) blockdev.NodeName Apply(VolumeSpec, Target) error }
StorageHandler is an interface that can interpret volume specifications for a particular storage type.
type StorageHandlerMap ¶
type StorageHandlerMap map[machina.StorageType]StorageHandler
StorageHandlerMap maps storage types to storage handlers that are capable of adding storage to QEMU virtual machine definitions.
func DefaultStorageHandlers ¶
func DefaultStorageHandlers() StorageHandlerMap
DefaultStorageHandlers returns the set of default storage handlers provided by the machina library.
func (StorageHandlerMap) Apply ¶
func (m StorageHandlerMap) Apply(spec VolumeSpec, t Target) error
Apply applies the given volume specification to the virtual machine. If successful, it returns the block device node name that backs the volume.
func (StorageHandlerMap) NodeName ¶
func (m StorageHandlerMap) NodeName(spec VolumeSpec) (blockdev.NodeName, error)
NodeName returns the node name that would be assigned to for the given volume specification.
type Target ¶
type Target struct { VM *qvm.Definition Controllers *qdev.ControllerMap BootOrder *qdev.BootOrder }
Target holds information about the target QEMU virtual machine that is being generated.
type VolumeSpec ¶
type VolumeSpec struct { Machine machina.MachineInfo Vars machina.Vars Volume machina.Volume Storage machina.Storage }
VolumeSpec describes a volume within a storage pool.
func (VolumeSpec) VolumePath ¶
func (spec VolumeSpec) VolumePath() machina.VolumePath
VolumePath returns the path of the volume within the storage pool.