qmp

package
v0.0.0-...-a810e79 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 10 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) 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) Quit

func (m *Monitor) Quit() error

Quit tells QEMU to exit immediately.

func (*Monitor) SendFile

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

SendFile adds a new file to the QMP fd table.

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.

Jump to

Keyboard shortcuts

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