qemu

package
v0.0.0-...-bbc9ce3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNetwork   = "10.0.2.0/24"
	DefaultDHCPStart = "10.0.2.15"
	DefaultGateway   = "10.0.2.2"
	DefaultDNS       = "10.0.2.3"
)
View Source
const (
	DeviceModelVirtioBlkPCI = "virtio-blk-pci"
	DeviceModelVirtioNetPCI = "virtio-net-pci"
)

DeviceModel constants.

View Source
const (
	// XHCI is the Extensible Host Controller Interface.
	// https://en.wikipedia.org/wiki/Extensible_Host_Controller_Interface
	XHCI = "xhci"
)

Host Controller Interface constants.

Variables

View Source
var TargetEnum = &targetList{
	AArch64: "aarch64",
	X86_64:  "x86_64",
}

TargetEnum provides accessors to valid QEMU target strings.

Functions

This section is empty.

Types

type AEMUCommandBuilder

type AEMUCommandBuilder struct {
	QEMUCommandBuilder
	// contains filtered or unexported fields
}

func NewAEMUCommandBuilder

func NewAEMUCommandBuilder() *AEMUCommandBuilder

func (*AEMUCommandBuilder) AddSerial

func (a *AEMUCommandBuilder) AddSerial(c Chardev)

func (*AEMUCommandBuilder) Build

func (a *AEMUCommandBuilder) Build() ([]string, error)

func (*AEMUCommandBuilder) SetAEMUFlag

func (a *AEMUCommandBuilder) SetAEMUFlag(args ...string)

func (*AEMUCommandBuilder) SetFeature

func (a *AEMUCommandBuilder) SetFeature(feature string)

func (*AEMUCommandBuilder) SetGPU

func (a *AEMUCommandBuilder) SetGPU(gpu string)

func (*AEMUCommandBuilder) SetTarget

func (a *AEMUCommandBuilder) SetTarget(target Target, kvm bool)

type Chardev

type Chardev struct {
	// ID is the character device identifier.
	ID string

	// Logfile is a path to write the output to.
	Logfile string

	// Signal controls whether signals are enabled on the terminal.
	Signal bool
}

type Device

type Device struct {
	Model string
	// contains filtered or unexported fields
}

func (*Device) AddOption

func (d *Device) AddOption(key, val string)

func (*Device) String

func (d *Device) String() string

type DeviceModel

type DeviceModel string

type Drive

type Drive struct {

	// ID is the block device identifier.
	ID string

	// File is the disk image file.
	File string

	// Addr is the PCI address of the block device.
	Addr string
}

type Forward

type Forward struct {
	// HostPort is the port on the host.
	HostPort int

	// GuestPort is the port on the guest.
	GuestPort int
}

type HCI

type HCI string

HCI identifies a Host Controller Interface.

type Netdev

type Netdev struct {
	Device

	// User is a netdev user backend.
	User *NetdevUser

	// Tap is a netdev tap backend.
	Tap *NetdevTap

	// ID is the network device identifier.
	ID string
}

type NetdevTap

type NetdevTap struct {
	// Name is the name of the interface.
	Name string
}

NetdevTap defines a netdev backend giving a tap interface.

type NetdevUser

type NetdevUser struct {
	// Network is the network block.
	Network string

	// DHCPStart is the address at which the DHCP allocation starts.
	DHCPStart string

	// DNS is the address of the builtin DNS server.
	DNS string

	// Host is the host IP address.
	Host string

	// Forwards are the host forwardings.
	Forwards []Forward
}

NetdevUser defines a netdev backend giving user networking.

type QEMUCommandBuilder

type QEMUCommandBuilder struct {
	// contains filtered or unexported fields
}

QEMUCommandBuilder provides methods to construct an arbitrary QEMU invocation, it does not validate inputs only that the resulting invocation is structurely valid.

func (*QEMUCommandBuilder) AddHCI

func (q *QEMUCommandBuilder) AddHCI(hci HCI)

AddHCI adds an host-controller-interface.

func (*QEMUCommandBuilder) AddKernelArg

func (q *QEMUCommandBuilder) AddKernelArg(kernelArg string)

func (*QEMUCommandBuilder) AddNetwork

func (q *QEMUCommandBuilder) AddNetwork(n Netdev)

func (*QEMUCommandBuilder) AddSerial

func (q *QEMUCommandBuilder) AddSerial(c Chardev)

func (*QEMUCommandBuilder) AddUSBDrive

func (q *QEMUCommandBuilder) AddUSBDrive(d Drive)

func (*QEMUCommandBuilder) AddVirtioBlkPciDrive

func (q *QEMUCommandBuilder) AddVirtioBlkPciDrive(d Drive)

func (*QEMUCommandBuilder) Build

func (q *QEMUCommandBuilder) Build() ([]string, error)

Build creates a QEMU invocation given a particular configuration, a list of images, and any specified command-line arguments.

func (*QEMUCommandBuilder) SetBinary

func (q *QEMUCommandBuilder) SetBinary(qemuPath string)

func (*QEMUCommandBuilder) SetCPUCount

func (q *QEMUCommandBuilder) SetCPUCount(cpuCount int)

func (*QEMUCommandBuilder) SetFlag

func (q *QEMUCommandBuilder) SetFlag(args ...string)

func (*QEMUCommandBuilder) SetInitrd

func (q *QEMUCommandBuilder) SetInitrd(initrd string)

func (*QEMUCommandBuilder) SetKernel

func (q *QEMUCommandBuilder) SetKernel(kernel string)

func (*QEMUCommandBuilder) SetMemory

func (q *QEMUCommandBuilder) SetMemory(memoryBytes int)

func (*QEMUCommandBuilder) SetTarget

func (q *QEMUCommandBuilder) SetTarget(target Target, kvm bool)

type Target

type Target string

Target is a QEMU architecture target.

Jump to

Keyboard shortcuts

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