vm

package
v2.4.6 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadModules

func LoadModules()

LoadModules loads vhost-net kernel module

Types

type BMCInfo

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

type BMCServer

type BMCServer interface {
	// Start runs BMC Server that servers
	Start(ctx context.Context) error
}

func NewBMCServer

func NewBMCServer(vms map[string]VM, networks []dcnet.Network, ch <-chan BMCInfo) BMCServer

NewBMCServer creates a BMCServer instance

type ExecuteCommand

type ExecuteCommand struct {
	Execute string `json:"execute"`
}

ExecuteCommand represents QMP's execute command

type Node

type Node interface {
	// Prepare initializes node volumes
	Prepare(context.Context, *util.Cache) error
	// Setup creates volumes and taps, and then run a virtual machine as a QEMU process
	Setup(context.Context, *Runtime, int, chan<- BMCInfo) (VM, string, error)
	// Taps returns Tap information
	Taps() map[string]string
	// Cleanup removes taps placemat added
	Cleanup()
	// CleanupGarbage cleanups all garbage
	CleanupGarbage(*Runtime)
}

Node represents a virtual machine.

func NewNode

func NewNode(spec *types.NodeSpec, imageSpecs []*types.ImageSpec, deviceClassSpecs []*types.DeviceClassSpec) (Node, error)

NewNode creates a Node from spec.

type QueryStatusResponse

type QueryStatusResponse struct {
	Return QueryStatusReturn `json:"return"`
}

QueryStatusResponse represents QMP's query-status command response

type QueryStatusReturn

type QueryStatusReturn struct {
	Status     string `json:"status"`
	Singlestep bool   `json:"singlestep"`
	Running    bool   `json:"running"`
}

QueryStatusReturn represents QMP's Return field

type Runtime

type Runtime struct {
	Force      bool
	Graphic    bool
	RunDir     string
	DataDir    string
	ListenAddr string
	ImageCache *util.Cache
}

Runtime contains the runtime information to run Cluster.

func NewRuntime

func NewRuntime(force, graphic bool, runDir, dataDir, cacheDir, listenAddr string) (*Runtime, error)

NewRuntime initializes a new Runtime.

type VM

type VM interface {
	virtualbmc.Machine
	// Wait waits until VM process exits
	Wait() error
	// SocketPath returns socket path
	SocketPath() string
	// Cleanup remove all socket files created by the VM
	Cleanup()
}

Jump to

Keyboard shortcuts

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