qemu

package
v0.0.0-...-7dbd9af Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package qemu implement the XXX interface on qemu

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPath = "qemu-system-x86_64"
	DefaultArgs = []string{"-m", "1024",

		"-object", "rng-random,filename=/dev/urandom,id=rng0",
		"-device", "virtio-rng-pci,rng=rng0",
	}
)

Default configuration values

Functions

This section is empty.

Types

type VM

type VM struct {
	exec.Cmd
	// contains filtered or unexported fields
}

VM represent a managed qemu session

func NewVM

func NewVM(path string, extraArgs ...string) (*VM, error)

NewVM creates a new qemu vm

func (*VM) Close

func (vm *VM) Close() error

Close the VM session

func (*VM) Open

func (vm *VM) Open() error

Open a new VM session

func (*VM) PowerDown

func (vm *VM) PowerDown() error

PowerDown stops the VM

func (*VM) PowerStatus

func (vm *VM) PowerStatus() (bool, error)

PowerStatus returns the current power status

func (*VM) PowerUp

func (vm *VM) PowerUp() error

PowerUp starts the VM

func (*VM) Spawn

func (vm *VM) Spawn(timeout time.Duration, opts ...exp.Option) (*exp.GExpect, <-chan error, error)

Spawn return a goexpect.GExpect for the VM TODO: Open should not be called before Spawn for qemu while it must for ipmi

Jump to

Keyboard shortcuts

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