qmp

package
v0.0.0-...-c012b7a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMonitorBadConsole = fmt.Errorf("Requested console couldn't be found")

ErrMonitorBadConsole is retuned when the requested console doesn't exist.

View Source
var ErrMonitorBadReturn = fmt.Errorf("Monitor returned invalid data")

ErrMonitorBadReturn is returned when the QMP data cannot be deserialized.

View Source
var ErrMonitorDisconnect = fmt.Errorf("Monitor is disconnected")

ErrMonitorDisconnect is returned when interacting with a disconnected Monitor.

View Source
var RingbufSize = 16

RingbufSize is the size of the agent serial ringbuffer in bytes

Functions

This section is empty.

Types

type Monitor

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

Monitor represents a QMP monitor.

func Connect

func Connect(path string, serialCharDev string, eventHandler func(name string, data map[string]interface{})) (*Monitor, error)

Connect creates or retrieves an existing QMP monitor for the path.

func (*Monitor) AddNIC

func (m *Monitor) AddNIC(netDev map[string]interface{}, device map[string]string) error

AddNIC adds a NIC device.

func (*Monitor) AgentReady

func (m *Monitor) AgentReady() bool

AgentReady indicates whether an agent has been detected.

func (*Monitor) Console

func (m *Monitor) Console(target string) (*os.File, error)

Console fetches the File for a particular console.

func (*Monitor) Disconnect

func (m *Monitor) Disconnect()

Disconnect forces a disconnection from QEMU.

func (*Monitor) GetCPUs

func (m *Monitor) GetCPUs() ([]int, error)

GetCPUs fetches the vCPU information for pinning.

func (*Monitor) GetMemoryBalloonSizeBytes

func (m *Monitor) GetMemoryBalloonSizeBytes() (int64, error)

GetMemoryBalloonSizeBytes returns effective size of the memory in bytes (considering the current balloon size).

func (*Monitor) GetMemorySizeBytes

func (m *Monitor) GetMemorySizeBytes() (int64, error)

GetMemorySizeBytes returns the current size of the base memory in bytes.

func (*Monitor) Migrate

func (m *Monitor) Migrate(uri string) error

Migrate starts a migration stream.

func (*Monitor) MigrateIncoming

func (m *Monitor) MigrateIncoming(uri string) error

MigrateIncoming starts the receiver of a migration stream.

func (*Monitor) Pause

func (m *Monitor) Pause() error

Pause tells QEMU to temporarily stop the emulation.

func (*Monitor) Powerdown

func (m *Monitor) Powerdown() error

Powerdown tells the VM to gracefully shutdown.

func (*Monitor) QueryPCI

func (m *Monitor) QueryPCI() ([]PCIDevice, error)

QueryPCI returns info about PCI devices.

func (*Monitor) Quit

func (m *Monitor) Quit() error

Quit tells QEMU to exit immediately.

func (*Monitor) RemoveNIC

func (m *Monitor) RemoveNIC(netDevID string, deviceID string) error

RemoveNIC removes a NIC device.

func (*Monitor) Reset

func (m *Monitor) Reset() error

Reset VM.

func (*Monitor) SendFile

func (m *Monitor) SendFile(name string, file *os.File) error

SendFile adds a new file descriptor to the QMP fd table associated to name.

func (*Monitor) SetMemoryBalloonSizeBytes

func (m *Monitor) SetMemoryBalloonSizeBytes(sizeBytes int64) error

SetMemoryBalloonSizeBytes sets the size of the memory in bytes (which will resize the balloon as needed).

func (*Monitor) Start

func (m *Monitor) Start() error

Start tells QEMU to start the emulation.

func (*Monitor) Status

func (m *Monitor) Status() (string, error)

Status returns the current VM status.

func (*Monitor) Wait

func (m *Monitor) Wait() (chan struct{}, error)

Wait returns a channel that will be closed on disconnection.

type PCIBridge

type PCIBridge struct {
	Devices []PCIDevice `json:"devices"`
}

PCIBridge represents a PCI bridge.

type PCIClassInfo

type PCIClassInfo struct {
	Class       int    `json:"class"`
	Description string `json:"desc"`
}

PCIClassInfo info about a device's class.

type PCIDevice

type PCIDevice struct {
	DevID    string       `json:"qdev_id"`
	Bus      int          `json:"bus"`
	Slot     int          `json:"slot"`
	Function int          `json:"function"`
	Devices  []PCIDevice  `json:"devices"`
	Class    PCIClassInfo `json:"class_info"`
	Bridge   PCIBridge    `json:"pci_bridge"`
}

PCIDevice represents a PCI device.

Jump to

Keyboard shortcuts

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