qemu

package
v0.0.0-...-79a645e Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Allocator virtualizers.VirtualizerAllocator = &allocator{}

Allocator for QEMU

View Source
var VirtualizerID = "qemu"

VirtualizerID is a unique identifier for QEMU

Functions

func Create

func Create(mgr *virtualizers.Manager, name string, headless bool) error

Create creates a virtualizer using the provided manager

Types

type Config

type Config struct {
	Headless bool
}

Config required for creating a QEMU VM

func (*Config) Marshal

func (c *Config) Marshal() []byte

Marshal the config into a byte[]

func (*Config) Unmarshal

func (c *Config) Unmarshal(data []byte) error

Unmarshal the byte[] array into a config struct

type Virtualizer

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

Virtualizer is a struct which will implement the interface so the manager can create VMs

func (*Virtualizer) Bind

func (v *Virtualizer) Bind(args string, i int, j int, protocol string, port virtualizers.RouteMap, networkType string) (string, string, bool, error)

func (*Virtualizer) Close

func (v *Virtualizer) Close(force bool) error

Close shuts down the virtual machine and cleans up the disk and folders

func (*Virtualizer) Detach

func (v *Virtualizer) Detach(source string) error

Detach removes the vm from the list and moves contents out of temp to source and writes shell script to run qemu

func (*Virtualizer) Details

func (v *Virtualizer) Details() (string, string, string, []virtualizers.NetworkInterface, time.Time, *vcfg.VCFG, interface{})

Details returns data to for the ConverToVM function on util

func (*Virtualizer) Download

func (v *Virtualizer) Download() (vio.File, error)

Download returns the disk

func (*Virtualizer) ForceStop

func (v *Virtualizer) ForceStop() error

ForceStop is the same as stop without the sleep so we get no logs and the disk is freed to be deleted quicker.

func (*Virtualizer) GenerateScript

func (v *Virtualizer) GenerateScript(source string) error

GenerateScript generates a .sh file to be able to run the disk with qemu standalone

func (*Virtualizer) Initialize

func (v *Virtualizer) Initialize(data []byte) error

Initialize passes the arguments from creation to create a virtualizer

func (*Virtualizer) Prepare

Prepare prepares the virtualizer with the appropriate fields to run the virtual machine

func (*Virtualizer) Serial

func (v *Virtualizer) Serial() *logger.Logger

Serial returns the serial logger which contains the serial output of the app.

func (*Virtualizer) Start

func (v *Virtualizer) Start() error

Start creates the virtualmachine and runs it

func (*Virtualizer) State

func (v *Virtualizer) State() string

State returns the state of the virtual machine

func (*Virtualizer) Stop

func (v *Virtualizer) Stop() error

Stop stops the vm and changes the status back to 'ready'

func (*Virtualizer) Type

func (v *Virtualizer) Type() string

Type returns the type of virtualizer

Jump to

Keyboard shortcuts

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