qemu

package
v0.3.11-8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	OS_NAME_LINUX   = "Linux"
	OS_NAME_WINDOWS = "Windows"
	OS_NAME_MACOS   = "macOS"
	OS_NAME_ANDROID = "Android"
	OS_NAME_VMWARE  = "VMWare"
	OS_NAME_CIRROS  = "Cirros"
	OS_NAME_OPENWRT = "OpenWrt"

	MODE_READLINE = "readline"
	MODE_CONTROL  = "control"

	DISK_DRIVER_VIRTIO = "virtio"
	DISK_DRIVER_SCSI   = "scsi"
	DISK_DRIVER_PVSCSI = "pvscsi"
	DISK_DRIVER_IDE    = "ide"
	DISK_DRIVER_SATA   = "sata"

	BIOS_UEFI = "UEFI"
)

Variables

This section is empty.

Functions

func GenerateStartOptions

func GenerateStartOptions(
	input *GenerateStartOptionsInput,
) (string, error)

func GetDiskDeviceModel

func GetDiskDeviceModel(driver string) string

func GetNicDeviceModel

func GetNicDeviceModel(name string) string

func RegisterCmd

func RegisterCmd(cmds ...QemuCommand)

Types

type Arch

type Arch string
const (
	Arch_x86_64  Arch = "x86_64"
	Arch_aarch64 Arch = "aarch64"
)

type CPUOption

type CPUOption struct {
	EnableKVM          bool
	IsKVMSupport       bool
	HostCPUPassthrough bool
	IsCPUIntel         bool
	IsCPUAMD           bool
	EnableNested       bool
	IsolatedDeviceCPU  string
}

type GenerateStartOptionsInput

type GenerateStartOptionsInput struct {
	QemuVersion Version
	QemuArch    Arch

	GuestDesc    *desc.SGuestDesc
	IsKVMSupport bool
	NicTraffics  map[string]api.SNicTrafficRecord

	EnableUUID       bool
	OsName           string
	HugepagesEnabled bool
	EnableMemfd      bool

	OVNIntegrationBridge string
	Devices              []string
	OVMFPath             string
	VNCPort              uint
	VNCPassword          bool
	EnableLog            bool
	HMPMonitor           *Monitor
	QMPMonitor           *Monitor
	IsVdiSpice           bool
	SpicePort            uint
	PidFilePath          string
	HomeDir              string
	ExtraOptions         []string
	EnableRNGRandom      bool
	EnableSerialDevice   bool
	NeedMigrate          bool
	LiveMigratePort      uint
	LiveMigrateUseTLS    bool
	EnablePvpanic        bool

	EncryptKeyPath string

	RescueInitrdPath string // rescue initramfs path
	RescueKernelPath string // rescue kernel path
}

func (*GenerateStartOptionsInput) HasBootIndex

func (input *GenerateStartOptionsInput) HasBootIndex() bool

type Monitor

type Monitor struct {
	Id   string
	Port uint
	Mode string
}

type QemuCommand

type QemuCommand interface {
	GetVersion() Version
	GetArch() Arch
	GetOptions() QemuOptions
}

func EnsureGetCommand

func EnsureGetCommand(version Version, arch Arch) QemuCommand

func GetCommand

func GetCommand(version Version, arch Arch) (QemuCommand, bool)

type QemuOptions

type QemuOptions interface {
	IsArm() bool
	Log(enable bool) string
	RTC() string
	FreezeCPU() string
	Daemonize() string
	Nodefaults() string
	Nodefconfig() string
	NoHpet() (bool, string)
	Global() string
	KeyboardLayoutLanguage(lang string) string
	Name(name string) string
	UUID(enable bool, uuid string) string
	MemPath(sizeMB uint64, p string) string
	MemDev(sizeMB uint64) string
	MemFd(sizeMB uint64) string
	Boot(order *string, enableMenu bool) string
	BIOS(ovmfPath, homedir string) (string, error)
	Device(devStr string) string
	Drive(driveStr string) string
	Chardev(backend string, id string, name string) string
	MonitorChardev(id string, port uint, host string) string
	Mon(chardev string, id string, mode string) string
	Object(typeName string, props map[string]string) string
	Pidfile(file string) string
	USB() string
	VNC(port uint, usePasswd bool) string
	Initrd(initrdPath string) string
	Kernel(kernelPath string) string
}

type Version

type Version string
const (
	Version_4_2_0  Version = "4.2.0"
	Version_4_0_1  Version = "4.0.1"
	Version_2_12_1 Version = "2.12.1"
	Version_9_0_1  Version = "9.0.1"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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