qmpcmd

package
v0.0.0-...-ede35a2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package qmpcmd defines a subset of possible QMP commands that are used by machina.

Index

Constants

View Source
const Quit = Action("quit")

Quit is a QMP command that requests immediate and ungraceful termination of a virtual machine.

View Source
const SystemPowerdown = Action("system_powerdown")

SystemPowerdown is a QMP command that issues a graceful shutdown request to a virtual machine.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

Action is a QMP command with no arguments and no expected response.

func (Action) Command

func (action Action) Command() string

Command returns the action as the command name.

func (Action) CommandArgs

func (action Action) CommandArgs() ([]byte, error)

CommandArgs returns a nil JSON byte slice.

func (Action) CommandResponse

func (action Action) CommandResponse([]byte) error

CommandResponse unmarshals a JSON-encoded response to a QMP command.

No response is expected for actions, so this function does nothing.

type Capabilities

type Capabilities struct {
	// Enable holds the set of QMP capabilities requested by a client.
	Enable []string `json:"enable,omitempty"`
}

Capabilities is a QMP command that declares QMP capabilities requested by the client.

func (Capabilities) Command

func (caps Capabilities) Command() string

Command returns the command name "qmp_capabilities".

func (Capabilities) CommandArgs

func (caps Capabilities) CommandArgs() ([]byte, error)

CommandArgs returns the QMP capabilities command arguments marshaled as a JSON byte slice.

func (Capabilities) CommandResponse

func (caps Capabilities) CommandResponse([]byte) error

CommandResponse unmarshals a JSON-encoded response to a QMP capabilities command.

No response is expected, so this function does nothing.

type QueryCPU

type QueryCPU struct {
	Response string
}

QueryCPU is a QMP command that returns information about the CPU in a virtual machine.

func (QueryCPU) Command

func (action QueryCPU) Command() string

Command returns the QMP command name.

func (QueryCPU) CommandArgs

func (action QueryCPU) CommandArgs() ([]byte, error)

CommandArgs returns a nil JSON byte slice.

func (*QueryCPU) CommandResponse

func (action *QueryCPU) CommandResponse(response []byte) error

CommandResponse unmarshals the JSON-encoded response to a QMP command.

type QueryPCI

type QueryPCI struct {
	Response string
}

QueryCPU is a QMP command that returns information about the PCI bus in a virtual machine.

func (QueryPCI) Command

func (action QueryPCI) Command() string

Command returns the QMP command name.

func (QueryPCI) CommandArgs

func (action QueryPCI) CommandArgs() ([]byte, error)

CommandArgs returns a nil JSON byte slice.

func (*QueryPCI) CommandResponse

func (action *QueryPCI) CommandResponse(response []byte) error

CommandResponse unmarshals the JSON-encoded response to a QMP command.

Jump to

Keyboard shortcuts

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