Documentation
¶
Overview ¶
Package qemu provides utilities for running QEMU virtual machines.
Index ¶
- Constants
- func BinaryAndPackageForArch(arch string) (binary, pkg string)
- func CanUseKVM(targetArch string) bool
- func CheckPrerequisites(ctx opctx.Ctx, arch string) error
- func GoArchToQEMUArch(goarch string) string
- func MachineAndCPUForArch(arch string, useKVM bool) (machine, cpu string)
- func SupportedArchitectures() []string
- type Arch
- type RunOptions
- type Runner
Constants ¶
const ( // Architecture names used by QEMU. ArchX86_64 = "x86_64" ArchAarch64 = "aarch64" )
Variables ¶
This section is empty.
Functions ¶
func BinaryAndPackageForArch ¶
BinaryAndPackageForArch returns the QEMU binary name and package for the given architecture.
func CanUseKVM ¶
CanUseKVM returns true if KVM acceleration can be used for the given target architecture. KVM is only available when the target architecture matches the host architecture.
func CheckPrerequisites ¶
CheckPrerequisites verifies that QEMU and sudo are available for the given architecture.
func GoArchToQEMUArch ¶
GoArchToQEMUArch converts Go's GOARCH to QEMU architecture names.
func MachineAndCPUForArch ¶
MachineAndCPUForArch returns the QEMU machine type and CPU for the given architecture.
func SupportedArchitectures ¶
func SupportedArchitectures() []string
SupportedArchitectures returns the list of supported QEMU architectures.
Types ¶
type Arch ¶
type Arch string
Arch represents a QEMU architecture and implements pflag.Value for flag parsing.
type RunOptions ¶
type RunOptions struct {
Arch string
FirmwarePath string
NVRAMPath string
DiskPath string
DiskType string
CloudInitISOPath string
SecureBoot bool
SSHPort int
CPUs int
Memory string
}
RunOptions contains configuration for running a QEMU VM.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner encapsulates options and dependencies for invoking QEMU.