QEMU Storage Daemon QMP Reference Manual
QEMU storage daemon protocol commands and structs
For a concise listing of all commands, events, and types in the QEMU storage daemon, please consult the QSD Index.
Common data types
- Enum IoOperationType (Since: 2.1)
An enumeration of the I/O operation types
- Values:
read – read operation
write – write operation
- Enum OnOffAuto (Since: 2.2)
An enumeration of three options: on, off, and auto
- Values:
auto – QEMU selects the value between on and off
on – Enabled
off – Disabled
- Enum OnOffSplit (Since: 2.6)
An enumeration of three values: on, off, and split
- Values:
on – Enabled
off – Disabled
split – Mixed
- Alternate StrOrNull (Since: 2.10)
This is a string value or the explicit lack of a string (null pointer in C). Intended for cases when ‘optional absent’ already has a different meaning.
- Alternatives:
s (
string
) – the string valuen (
null
) – no string value
- Enum OffAutoPCIBAR (Since: 2.12)
An enumeration of options for specifying a PCI BAR
- Values:
off – The specified feature is disabled
auto – The PCI BAR for the feature is automatically selected
bar0 – PCI BAR0 is used for the feature
bar1 – PCI BAR1 is used for the feature
bar2 – PCI BAR2 is used for the feature
bar3 – PCI BAR3 is used for the feature
bar4 – PCI BAR4 is used for the feature
bar5 – PCI BAR5 is used for the feature
- Enum PCIELinkSpeed (Since: 4.0)
An enumeration of PCIe link speeds in units of GT/s
- Values:
2_5 – 2.5GT/s
5 – 5.0GT/s
8 – 8.0GT/s
16 – 16.0GT/s
32 – 32.0GT/s (since 9.0)
64 – 64.0GT/s (since 9.0)
- Enum PCIELinkWidth (Since: 4.0)
An enumeration of PCIe link width
- Values:
1 – x1
2 – x2
4 – x4
8 – x8
12 – x12
16 – x16
32 – x32
- Enum HostMemPolicy (Since: 2.1)
Host memory policy types
- Values:
default – restore default policy, remove any nondefault policy
preferred – set the preferred host nodes for allocation
bind – a strict policy that restricts memory allocation to the host nodes specified
interleave – memory allocations are interleaved across the set of host nodes specified
- Enum NetFilterDirection (Since: 2.5)
Indicates whether a netfilter is attached to a netdev’s transmit queue or receive queue or both.
- Values:
all – the filter is attached both to the receive and the transmit queue of the netdev (default).
rx – the filter is attached to the receive queue of the netdev, where it will receive packets sent to the netdev.
tx – the filter is attached to the transmit queue of the netdev, where it will receive packets sent by the netdev.
- Enum GrabToggleKeys (Since: 4.0)
Key combinations to toggle input-linux between host and guest.
- Values:
ctrl-ctrl – left and right control key
alt-alt – left and right alt key
shift-shift – left and right shift key
meta-meta – left and right meta key
scrolllock – scroll lock key
ctrl-scrolllock – either control key and scroll lock key
- Object HumanReadableText (Since: 6.2)
- Members:
human-readable-text (
string
) – Formatted output intended for humans.
- Enum EndianMode (Since: 10.0)
- Values:
unspecified – Endianness not specified
little – Little endianness
big – Big endianness
Socket data types
- Enum NetworkAddressFamily (Since: 2.1)
The network address family
- Values:
ipv4 – IPV4 family
ipv6 – IPV6 family
unix – unix socket
vsock – vsock family (since 2.8)
unknown – otherwise
- Object InetSocketAddressBase
- Members:
host (
string
) – host part of the addressport (
string
) – port part of the address
- Object InetSocketAddress (Since: 1.3)
Captures a socket address or address range in the Internet namespace.
- Members:
numeric (
boolean
, optional) – true if the host/port are guaranteed to be numeric, false if name resolution should be attempted. Defaults to false. (Since 2.9)to (
int
, optional) – If present, this is range of possible addresses, with port betweenport
andto
.ipv4 (
boolean
, optional) – whether to accept IPv4 addresses, default try both IPv4 and IPv6ipv6 (
boolean
, optional) – whether to accept IPv6 addresses, default try both IPv4 and IPv6keep-alive (
boolean
, optional) – enable keep-alive when connecting to this socket. Not supported for passive sockets. (Since 4.2)mptcp (
boolean
, optional) – enable multi-path TCP. (Since 6.1)The members of
InetSocketAddressBase
.
- Object UnixSocketAddress (Since: 1.3)
Captures a socket address in the local (“Unix socket”) namespace.
- Members:
path (
string
) – filesystem path to useabstract (
boolean
, optional) – if true, this is a Linux abstract socket address.path
will be prefixed by a null byte, and optionally padded with null bytes. Defaults to false. (Since 5.1)tight (
boolean
, optional) – if false, pad an abstract socket address with enough null bytes to make it fill struct sockaddr_un member sun_path. Defaults to true. (Since 5.1)
- Object VsockSocketAddress (Since: 2.8)
Captures a socket address in the vsock namespace.
- Members:
cid (
string
) – unique host identifierport (
string
) – port
Note
String types are used to allow for possible future hostname or service resolution support.
- Object FdSocketAddress (Since: 1.2)
A file descriptor name or number.
- Members:
str (
string
) – decimal is for file descriptor number, otherwise it’s a file descriptor name. Named file descriptors are permitted in monitor commands, in combination with the ‘getfd’ command. Decimal file descriptors are permitted at startup or other contexts where no monitor context is active.
- Object InetSocketAddressWrapper (Since: 1.3)
- Members:
data (
InetSocketAddress
) – internet domain socket address
- Object UnixSocketAddressWrapper (Since: 1.3)
- Members:
data (
UnixSocketAddress
) – UNIX domain socket address
- Object VsockSocketAddressWrapper (Since: 2.8)
- Members:
data (
VsockSocketAddress
) – VSOCK domain socket address
- Object FdSocketAddressWrapper (Since: 1.3)
- Members:
data (
FdSocketAddress
) – file descriptor name or number
- Object SocketAddressLegacy (Since: 1.3)
Captures the address of a socket, which could also be a named file descriptor
- Members:
type (
SocketAddressType
) – Transport typeWhen
type
isinet
: The members ofInetSocketAddressWrapper
.When
type
isunix
: The members ofUnixSocketAddressWrapper
.When
type
isvsock
: The members ofVsockSocketAddressWrapper
.When
type
isfd
: The members ofFdSocketAddressWrapper
.
- Enum SocketAddressType (Since: 2.9)
Available SocketAddress types
- Values:
inet – Internet address
unix – Unix domain socket
vsock – VMCI address
fd – Socket file descriptor
- Object SocketAddress (Since: 2.9)
Captures the address of a socket, which could also be a socket file descriptor
- Members:
type (
SocketAddressType
) – Transport typeWhen
type
isinet
: The members ofInetSocketAddress
.When
type
isunix
: The members ofUnixSocketAddress
.When
type
isvsock
: The members ofVsockSocketAddress
.When
type
isfd
: The members ofFdSocketAddress
.
Cryptography
- Enum QCryptoTLSCredsEndpoint (Since: 2.5)
The type of network endpoint that will be using the credentials. Most types of credential require different setup / structures depending on whether they will be used in a server versus a client.
- Values:
client – the network endpoint is acting as the client
server – the network endpoint is acting as the server
- Enum QCryptoSecretFormat (Since: 2.6)
The data format that the secret is provided in
- Values:
raw – raw bytes. When encoded in JSON only valid UTF-8 sequences can be used
base64 – arbitrary base64 encoded binary data
- Enum QCryptoHashAlgo (Since: 2.6)
The supported algorithms for computing content digests
- Values:
md5 – MD5. Should not be used in any new code, legacy compat only
sha1 – SHA-1. Should not be used in any new code, legacy compat only
sha224 – SHA-224. (since 2.7)
sha256 – SHA-256. Current recommended strong hash.
sha384 – SHA-384. (since 2.7)
sha512 – SHA-512. (since 2.7)
ripemd160 – RIPEMD-160. (since 2.7)
sm3 – SM3. (since 9.2.0)
- Enum QCryptoCipherAlgo (Since: 2.6)
The supported algorithms for content encryption ciphers
- Values:
aes-128 – AES with 128 bit / 16 byte keys
aes-192 – AES with 192 bit / 24 byte keys
aes-256 – AES with 256 bit / 32 byte keys
des – DES with 56 bit / 8 byte keys. Do not use except in VNC. (since 6.1)
3des – 3DES(EDE) with 192 bit / 24 byte keys (since 2.9)
cast5-128 – Cast5 with 128 bit / 16 byte keys
serpent-128 – Serpent with 128 bit / 16 byte keys
serpent-192 – Serpent with 192 bit / 24 byte keys
serpent-256 – Serpent with 256 bit / 32 byte keys
twofish-128 – Twofish with 128 bit / 16 byte keys
twofish-192 – Twofish with 192 bit / 24 byte keys
twofish-256 – Twofish with 256 bit / 32 byte keys
sm4 – SM4 with 128 bit / 16 byte keys (since 9.0)
- Enum QCryptoCipherMode (Since: 2.6)
The supported modes for content encryption ciphers
- Values:
ecb – Electronic Code Book
cbc – Cipher Block Chaining
xts – XEX with tweaked code book and ciphertext stealing
ctr – Counter (Since 2.8)
- Enum QCryptoIVGenAlgo (Since: 2.6)
The supported algorithms for generating initialization vectors for full disk encryption. The ‘plain’ generator should not be used for disks with sector numbers larger than 2^32, except where compatibility with pre-existing Linux dm-crypt volumes is required.
- Values:
plain – 64-bit sector number truncated to 32-bits
plain64 – 64-bit sector number
essiv – 64-bit sector number encrypted with a hash of the encryption key
- Enum QCryptoBlockFormat (Since: 2.6)
The supported full disk encryption formats
- Values:
qcow – QCow/QCow2 built-in AES-CBC encryption. Use only for liberating data from old images.
luks – LUKS encryption format. Recommended for new images
- Object QCryptoBlockOptionsBase (Since: 2.6)
The common options that apply to all full disk encryption formats
- Members:
format (
QCryptoBlockFormat
) – the encryption format
- Object QCryptoBlockOptionsQCow (Since: 2.6)
The options that apply to QCow/QCow2 AES-CBC encryption format
- Members:
key-secret (
string
, optional) – the ID of a QCryptoSecret object providing the decryption key. Mandatory except when probing image for metadata only.
- Object QCryptoBlockOptionsLUKS (Since: 2.6)
The options that apply to LUKS encryption format
- Members:
key-secret (
string
, optional) – the ID of a QCryptoSecret object providing the decryption key. Mandatory except when probing image for metadata only.
- Object QCryptoBlockCreateOptionsLUKS (Since: 2.6)
The options that apply to LUKS encryption format initialization
- Members:
cipher-alg (
QCryptoCipherAlgo
, optional) – the cipher algorithm for data encryption Currently defaults to ‘aes-256’.cipher-mode (
QCryptoCipherMode
, optional) – the cipher mode for data encryption Currently defaults to ‘xts’ivgen-alg (
QCryptoIVGenAlgo
, optional) – the initialization vector generator Currently defaults to ‘plain64’ivgen-hash-alg (
QCryptoHashAlgo
, optional) – the initialization vector generator hash Currently defaults to ‘sha256’hash-alg (
QCryptoHashAlgo
, optional) – the master key hash algorithm Currently defaults to ‘sha256’iter-time (
int
, optional) – number of milliseconds to spend in PBKDF passphrase processing. Currently defaults to 2000. (since 2.8)The members of
QCryptoBlockOptionsLUKS
.
- Object QCryptoBlockOpenOptions (Since: 2.6)
The options that are available for all encryption formats when opening an existing volume
- Members:
The members of
QCryptoBlockOptionsBase
.When
format
isqcow
: The members ofQCryptoBlockOptionsQCow
.When
format
isluks
: The members ofQCryptoBlockOptionsLUKS
.
- Object QCryptoBlockCreateOptions (Since: 2.6)
The options that are available for all encryption formats when initializing a new volume
- Members:
The members of
QCryptoBlockOptionsBase
.When
format
isqcow
: The members ofQCryptoBlockOptionsQCow
.When
format
isluks
: The members ofQCryptoBlockCreateOptionsLUKS
.
- Object QCryptoBlockInfoBase (Since: 2.7)
The common information that applies to all full disk encryption formats
- Members:
format (
QCryptoBlockFormat
) – the encryption format
- Object QCryptoBlockInfoLUKSSlot (Since: 2.7)
Information about the LUKS block encryption key slot options
- Members:
active (
boolean
) – whether the key slot is currently in usekey-offset (
int
) – offset to the key material in bytesiters (
int
, optional) – number of PBKDF2 iterations for key materialstripes (
int
, optional) – number of stripes for splitting key material
- Object QCryptoBlockInfoLUKS (Since: 2.7)
Information about the LUKS block encryption options
- Members:
cipher-alg (
QCryptoCipherAlgo
) – the cipher algorithm for data encryptioncipher-mode (
QCryptoCipherMode
) – the cipher mode for data encryptionivgen-alg (
QCryptoIVGenAlgo
) – the initialization vector generatorivgen-hash-alg (
QCryptoHashAlgo
, optional) – the initialization vector generator hashhash-alg (
QCryptoHashAlgo
) – the master key hash algorithmdetached-header (
boolean
) – whether the LUKS header is detached (Since 9.0)payload-offset (
int
) – offset to the payload data in bytesmaster-key-iters (
int
) – number of PBKDF2 iterations for key materialuuid (
string
) – unique identifier for the volumeslots (
[
QCryptoBlockInfoLUKSSlot
]
) – information about each key slot
- Object QCryptoBlockInfo (Since: 2.7)
Information about the block encryption options
- Members:
The members of
QCryptoBlockInfoBase
.When
format
isluks
: The members ofQCryptoBlockInfoLUKS
.
- Enum QCryptoBlockLUKSKeyslotState (Since: 5.1)
Defines state of keyslots that are affected by the update
- Values:
active – The slots contain the given password and marked as active
inactive – The slots are erased (contain garbage) and marked as inactive
- Object QCryptoBlockAmendOptionsLUKS (Since: 5.1)
This struct defines the update parameters that activate/de-activate set of keyslots
- Members:
state (
QCryptoBlockLUKSKeyslotState
) – the desired state of the keyslotsnew-secret (
string
, optional) – The ID of a QCryptoSecret object providing the password to be written into added active keyslotsold-secret (
string
, optional) – Optional (for deactivation only) If given will deactivate all keyslots that match password located in QCryptoSecret with this IDiter-time (
int
, optional) – Optional (for activation only) Number of milliseconds to spend in PBKDF passphrase processing for the newly activated keyslot. Currently defaults to 2000.keyslot (
int
, optional) –Optional. ID of the keyslot to activate/deactivate. For keyslot activation, keyslot should not be active already (this is unsafe to update an active keyslot), but possible if ‘force’ parameter is given. If keyslot is not given, first free keyslot will be written.
For keyslot deactivation, this parameter specifies the exact keyslot to deactivate
secret (
string
, optional) – Optional. The ID of a QCryptoSecret object providing the password to use to retrieve current master key. Defaults to the same secret that was used to open the image
- Object QCryptoBlockAmendOptions (Since: 5.1)
The options that are available for all encryption formats when amending encryption settings
- Members:
The members of
QCryptoBlockOptionsBase
.When
format
isluks
: The members ofQCryptoBlockAmendOptionsLUKS
.
- Object SecretCommonProperties (Since: 2.6)
Properties for objects of classes derived from secret-common.
- Members:
format (
QCryptoSecretFormat
, optional) – the data format that the secret is provided in (default: raw)keyid (
string
, optional) – the name of another secret that should be used to decrypt the provided data. If not present, the data is assumed to be unencrypted.iv (
string
, optional) – the random initialization vector used for encryption of this particular secret. Should be a base64 encrypted string of the 16-byte IV. Mandatory ifkeyid
is given. Ignored ifkeyid
is absent.
- Object SecretProperties (Since: 2.6)
Properties for secret objects.
Either
data
orfile
must be provided, but not both.- Members:
data (
string
, optional) – the associated with the secret fromfile (
string
, optional) – the filename to load the data associated with the secret fromThe members of
SecretCommonProperties
.
- Object SecretKeyringProperties (Since: 5.1)
- Availability:
CONFIG_SECRET_KEYRING
Properties for secret_keyring objects.
- Members:
serial (
int
) – serial number that identifies a key to get from the kernelThe members of
SecretCommonProperties
.
- Object TlsCredsProperties (Since: 2.5)
Properties for objects of classes derived from tls-creds.
- Members:
verify-peer (
boolean
, optional) – if true the peer credentials will be verified once the handshake is completed. This is a no-op for anonymous credentials. (default: true)dir (
string
, optional) – the path of the directory that contains the credential filesendpoint (
QCryptoTLSCredsEndpoint
, optional) – whether the QEMU network backend that uses the credentials will be acting as a client or as a server (default: client)priority (
string
, optional) – a gnutls priority string as described at https://gnutls.org/manual/html_node/Priority-Strings.html
- Object TlsCredsAnonProperties (Since: 2.5)
Properties for tls-creds-anon objects.
- Members:
The members of
TlsCredsProperties
.
- Object TlsCredsPskProperties (Since: 3.0)
Properties for tls-creds-psk objects.
- Members:
username (
string
, optional) – the username which will be sent to the server. For clients only. If absent, “qemu” is sent and the property will read back as an empty string.The members of
TlsCredsProperties
.
- Object TlsCredsX509Properties (Since: 2.5)
Properties for tls-creds-x509 objects.
- Members:
sanity-check (
boolean
, optional) – if true, perform some sanity checks before using the credentials (default: true)passwordid (
string
, optional) – For the server-key.pem and client-key.pem files which contain sensitive private keys, it is possible to use an encrypted version by providing thepasswordid
parameter. This provides the ID of a previously created secret object containing the password for decryption.The members of
TlsCredsProperties
.
- Enum QCryptoAkCipherAlgo (Since: 7.1)
The supported algorithms for asymmetric encryption ciphers
- Values:
rsa – RSA algorithm
- Enum QCryptoAkCipherKeyType (Since: 7.1)
The type of asymmetric keys.
- Values:
public – public key
private – private key
- Enum QCryptoRSAPaddingAlgo (Since: 7.1)
The padding algorithm for RSA.
- Values:
raw – no padding used
pkcs1 – pkcs1#v1.5
- Object QCryptoAkCipherOptionsRSA (Since: 7.1)
Specific parameters for RSA algorithm.
- Members:
hash-alg (
QCryptoHashAlgo
) – QCryptoHashAlgopadding-alg (
QCryptoRSAPaddingAlgo
) – QCryptoRSAPaddingAlgo
- Object QCryptoAkCipherOptions (Since: 7.1)
The options that are available for all asymmetric key algorithms when creating a new QCryptoAkCipher.
- Members:
alg (
QCryptoAkCipherAlgo
) – encryption cipher algorithmWhen
alg
isrsa
: The members ofQCryptoAkCipherOptionsRSA
.
Background jobs
- Enum JobType (Since: 1.7)
Type of a background job.
- Values:
commit – block commit job type, see “block-commit”
stream – block stream job type, see “block-stream”
mirror – drive mirror job type, see “drive-mirror”
backup – drive backup job type, see “drive-backup”
create – image creation job type, see “blockdev-create” (since 3.0)
amend – image options amend job type, see “x-blockdev-amend” (since 5.1)
snapshot-load – snapshot load job type, see “snapshot-load” (since 6.0)
snapshot-save – snapshot save job type, see “snapshot-save” (since 6.0)
snapshot-delete – snapshot delete job type, see “snapshot-delete” (since 6.0)
- Enum JobStatus (Since: 2.12)
Indicates the present state of a given job in its lifetime.
- Values:
undefined – Erroneous, default state. Should not ever be visible.
created – The job has been created, but not yet started.
running – The job is currently running.
paused – The job is running, but paused. The pause may be requested by either the QMP user or by internal processes.
ready – The job is running, but is ready for the user to signal completion. This is used for long-running jobs like mirror that are designed to run indefinitely.
standby – The job is ready, but paused. This is nearly identical to
paused
. The job may return toready
or otherwise be canceled.waiting – The job is waiting for other jobs in the transaction to converge to the waiting state. This status will likely not be visible for the last job in a transaction.
pending – The job has finished its work, but has finalization steps that it needs to make prior to completing. These changes will require manual intervention via
job-finalize
if auto-finalize was set to false. These pending changes may still fail.aborting – The job is in the process of being aborted, and will finish with an error. The job will afterwards report that it is
concluded
. This status may not be visible to the management process.concluded – The job has finished all work. If auto-dismiss was set to false, the job will remain in the query list until it is dismissed via
job-dismiss
.null – The job is in the process of being dismantled. This state should not ever be visible externally.
- Enum JobVerb (Since: 2.12)
Represents command verbs that can be applied to a job.
- Values:
cancel – see
job-cancel
pause – see
job-pause
resume – see
job-resume
set-speed – see
block-job-set-speed
complete – see
job-complete
dismiss – see
job-dismiss
finalize – see
job-finalize
change – see
block-job-change
(since 8.2)
- Event JOB_STATUS_CHANGE (Since: 3.0)
Emitted when a job transitions to a different status.
- Members:
id (
string
) – The job identifierstatus (
JobStatus
) – The new job status
- Command job-pause (Since: 3.0)
Pause an active job.
This command returns immediately after marking the active job for pausing. Pausing an already paused job is an error.
The job will pause as soon as possible, which means transitioning into the PAUSED state if it was RUNNING, or into STANDBY if it was READY. The corresponding JOB_STATUS_CHANGE event will be emitted.
Cancelling a paused job automatically resumes it.
- Arguments:
id (
string
) – The job identifier.
- Command job-resume (Since: 3.0)
Resume a paused job.
This command returns immediately after resuming a paused job. Resuming an already running job is an error.
- Arguments:
id (
string
) – The job identifier.
- Command job-cancel (Since: 3.0)
Instruct an active background job to cancel at the next opportunity. This command returns immediately after marking the active job for cancellation.
The job will cancel as soon as possible and then emit a JOB_STATUS_CHANGE event. Usually, the status will change to ABORTING, but it is possible that a job successfully completes (e.g. because it was almost done and there was no opportunity to cancel earlier than completing the job) and transitions to PENDING instead.
- Arguments:
id (
string
) – The job identifier.
- Command job-complete (Since: 3.0)
Manually trigger completion of an active job in the READY state.
- Arguments:
id (
string
) – The job identifier.
- Command job-dismiss (Since: 3.0)
Deletes a job that is in the CONCLUDED state. This command only needs to be run explicitly for jobs that don’t have automatic dismiss enabled.
This command will refuse to operate on any job that has not yet reached its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of JOB_READY event, job-cancel or job-complete will still need to be used as appropriate.
- Arguments:
id (
string
) – The job identifier.
- Command job-finalize (Since: 3.0)
Instructs all jobs in a transaction (or a single job if it is not part of any transaction) to finalize any graph changes and do any necessary cleanup. This command requires that all involved jobs are in the PENDING state.
For jobs in a transaction, instructing one job to finalize will force ALL jobs in the transaction to finalize, so it is only necessary to instruct a single member job to finalize.
- Arguments:
id (
string
) – The identifier of any job in the transaction, or of a job that is not part of any transaction.
- Object JobInfo (Since: 3.0)
Information about a job.
- Members:
id (
string
) – The job identifiertype (
JobType
) – The kind of job that is being performedstatus (
JobStatus
) – Current job state/statuscurrent-progress (
int
) – Progress made until now. The unit is arbitrary and the value can only meaningfully be used for the ratio ofcurrent-progress
tototal-progress
. The value is monotonically increasing.total-progress (
int
) – Estimatedcurrent-progress
value at the completion of the job. This value can arbitrarily change while the job is running, in both directions.error (
string
, optional) –If this field is present, the job failed; if it is still missing in the CONCLUDED state, this indicates successful completion.
The value is a human-readable error message to describe the reason for the job failure. It should not be parsed by applications.
Block devices
Block device exports
- Object NbdServerOptionsBase
- Members:
handshake-max-seconds (
int
, optional) – Time limit, in seconds, at which a client that has not completed the negotiation handshake will be disconnected, or 0 for no limit (since 10.0; default: 10).tls-creds (
string
, optional) – ID of the TLS credentials object (since 2.6).tls-authz (
string
, optional) – ID of the QAuthZ authorization object used to validate the client’s x509 distinguished name. This object is is only resolved at time of use, so can be deleted and recreated on the fly while the NBD server is active. If missing, it will default to denying access (since 4.0).max-connections (
int
, optional) – The maximum number of connections to allow at the same time, 0 for unlimited. Setting this to 1 also stops the server from advertising multiple client support (since 5.2; default: 100).
- Object NbdServerOptions
Keep this type consistent with the NbdServerOptionsLegacy type. The only intended difference is using SocketAddress instead of SocketAddressLegacy.
- Members:
addr (
SocketAddress
) – Address on which to listen (since 4.2).The members of
NbdServerOptionsBase
.
- Object NbdServerOptionsLegacy
Keep this type consistent with the NbdServerOptions type. The only intended difference is using SocketAddressLegacy instead of SocketAddress.
- Members:
addr (
SocketAddressLegacy
) – Address on which to listen (since 1.3).The members of
NbdServerOptionsBase
.
- Command nbd-server-start (Since: 1.3)
Start an NBD server listening on the given host and port. Block devices can then be exported using
nbd-server-add
. The NBD server will present them as named exports; for example, another QEMU instance could refer to them as “nbd:HOST:PORT:exportname=NAME”.- Arguments:
The members of
NbdServerOptionsLegacy
.
- Errors:
if the server is already running
- Object BlockExportOptionsNbdBase (Since: 5.0)
An NBD block export (common options shared between nbd-server-add and the NBD branch of block-export-add).
- Members:
name (
string
, optional) – Export name. If unspecified, thedevice
parameter is used as the export name. (Since 2.12)description (
string
, optional) – Free-form description of the export, up to 4096 bytes. (Since 5.0)
- Object BlockExportOptionsNbd (Since: 5.2)
An NBD block export (distinct options used in the NBD branch of block-export-add).
- Members:
bitmaps (
[
BlockDirtyBitmapOrStr
]
, optional) – Also export each of the named dirty bitmaps reachable fromdevice
, so the NBD client can use NBD_OPT_SET_META_CONTEXT with the metadata context name “qemu:dirty-bitmap:BITMAP” to inspect each bitmap. Since 7.1 bitmap may be specified by node/name pair.allocation-depth (
boolean
, optional) – Also export the allocation depth map fordevice
, so the NBD client can use NBD_OPT_SET_META_CONTEXT with the metadata context name “qemu:allocation-depth” to inspect allocation details. (since 5.2)The members of
BlockExportOptionsNbdBase
.
- Object BlockExportOptionsVhostUserBlk (Since: 5.2)
A vhost-user-blk block export.
- Members:
addr (
SocketAddress
) – The vhost-user socket on which to listen. Both ‘unix’ and ‘fd’ SocketAddress types are supported. Passed fds must be UNIX domain sockets.logical-block-size (
int
, optional) – Logical block size in bytes. Defaults to 512 bytes.num-queues (
int
, optional) – Number of request virtqueues. Must be greater than 0. Defaults to 1.
- Enum FuseExportAllowOther (Since: 6.1)
Possible allow_other modes for FUSE exports.
- Values:
off – Do not pass allow_other as a mount option.
on – Pass allow_other as a mount option.
auto – Try mounting with allow_other first, and if that fails, retry without allow_other.
- Object BlockExportOptionsFuse (Since: 6.0)
- Availability:
CONFIG_FUSE
Options for exporting a block graph node on some (file) mountpoint as a raw image.
- Members:
mountpoint (
string
) – Path on which to export the block device via FUSE. This must point to an existing regular file.growable (
boolean
, optional) – Whether writes beyond the EOF should grow the block node accordingly. (default: false)allow-other (
FuseExportAllowOther
, optional) – If this is off, only qemu’s user is allowed access to this export. That cannot be changed even with chmod or chown. Enabling this option will allow other users access to the export with the FUSE mount option “allow_other”. Note that using allow_other as a non-root user requires user_allow_other to be enabled in the global fuse.conf configuration file. In auto mode (the default), the FUSE export driver will first attempt to mount the export with allow_other, and if that fails, try again without. (since 6.1; default: auto)
- Object BlockExportOptionsVduseBlk (Since: 7.1)
A vduse-blk block export.
- Members:
name (
string
) – the name of VDUSE device (must be unique across the host).num-queues (
int
, optional) – the number of virtqueues. Defaults to 1.queue-size (
int
, optional) – the size of virtqueue. Defaults to 256.logical-block-size (
int
, optional) – Logical block size in bytes. Range [512, PAGE_SIZE] and must be power of 2. Defaults to 512 bytes.serial (
string
, optional) – the serial number of virtio block device. Defaults to empty string.
- Object NbdServerAddOptions (Since: 5.0)
An NBD block export, per legacy nbd-server-add command.
- Members:
device (
string
) – The device name or node name of the node to be exportedwritable (
boolean
, optional) – Whether clients should be able to write to the device via the NBD connection (default false).bitmap (
string
, optional) – Also export a single dirty bitmap reachable fromdevice
, so the NBD client can use NBD_OPT_SET_META_CONTEXT with the metadata context name “qemu:dirty-bitmap:BITMAP” to inspect the bitmap (since 4.0).The members of
BlockExportOptionsNbdBase
.
- Command nbd-server-add (Since: 1.3)
- This command is deprecated.
Export a block node to QEMU’s embedded NBD server.
The export name will be used as the id for the resulting block export.
- Arguments:
The members of
NbdServerAddOptions
.
- Features:
deprecated – This command is deprecated. Use
block-export-add
instead.
- Errors:
if the server is not running
if an export with the same name already exists
- Enum BlockExportRemoveMode (Since: 2.12)
Mode for removing a block export.
- Values:
safe – Remove export if there are no existing connections, fail otherwise.
hard – Drop all connections immediately and remove export.
- Command nbd-server-remove (Since: 2.12)
- This command is deprecated.
Remove NBD export by name.
- Arguments:
name (
string
) – Block export id.mode (
BlockExportRemoveMode
, optional) – Mode of command operation. SeeBlockExportRemoveMode
description. Default is ‘safe’.
- Features:
deprecated – This command is deprecated. Use
block-export-del
instead.
- Errors:
if the server is not running
if export is not found
if mode is ‘safe’ and there are existing connections
- Command nbd-server-stop (Since: 1.3)
Stop QEMU’s embedded NBD server, and unregister all devices previously added via
nbd-server-add
.
- Enum BlockExportType (Since: 4.2)
An enumeration of block export types
- Values:
nbd – NBD export
vhost-user-blk – vhost-user-blk export (since 5.2)
fuse – FUSE export (since: 6.0)
vduse-blk – vduse-blk export (since 7.1)
- Object BlockExportOptions (Since: 4.2)
Describes a block export, i.e. how single node should be exported on an external interface.
- Members:
type (
BlockExportType
) – Block export typeid (
string
) – A unique identifier for the block export (across all export types)node-name (
string
) – The node name of the block node to be exported (since: 5.2)writable (
boolean
, optional) – True if clients should be able to write to the export (default false)writethrough (
boolean
, optional) – If true, caches are flushed after every write request to the export before completion is signalled. (since: 5.2; default: false)iothread (
string
, optional) – The name of the iothread object where the export will run. The default is to use the thread currently associated with the block node. (since: 5.2)fixed-iothread (
boolean
, optional) – True prevents the block node from being moved to another thread while the export is active. If true andiothread
is given, export creation fails if the block node cannot be moved to the iothread. The default is false. (since: 5.2)allow-inactive (
boolean
, optional) – If true, the export allows the exported node to be inactive. If it is created for an inactive block node, the node remains inactive. If the export type doesn’t support running on an inactive node, an error is returned. If false, inactive block nodes are automatically activated before creating the export and trying to inactivate them later fails. (since: 10.0; default: false)When
type
isnbd
: The members ofBlockExportOptionsNbd
.When
type
isvhost-user-blk
: The members ofBlockExportOptionsVhostUserBlk
.When
type
isfuse
: The members ofBlockExportOptionsFuse
.When
type
isvduse-blk
: The members ofBlockExportOptionsVduseBlk
.
- Command block-export-add (Since: 5.2)
Creates a new block export.
- Arguments:
The members of
BlockExportOptions
.
- Command block-export-del (Since: 5.2)
Request to remove a block export. This drops the user’s reference to the export, but the export may still stay around after this command returns until the shutdown of the export has completed.
- Arguments:
id (
string
) – Block export id.mode (
BlockExportRemoveMode
, optional) – Mode of command operation. SeeBlockExportRemoveMode
description. Default is ‘safe’.
- Errors:
if the export is not found
if
mode
is ‘safe’ and the export is still in use (e.g. by existing client connections)
- Event BLOCK_EXPORT_DELETED (Since: 5.2)
Emitted when a block export is removed and its id can be reused.
- Members:
id (
string
) – Block export id.
- Object BlockExportInfo (Since: 5.2)
Information about a single block export.
- Members:
id (
string
) – The unique identifier for the block exporttype (
BlockExportType
) – The block export typenode-name (
string
) – The node name of the block node that is exportedshutting-down (
boolean
) – True if the export is shutting down (e.g. after a block-export-del command, but before the shutdown has completed)
- Command query-block-exports (Since: 5.2)
- Return:
[
BlockExportInfo
]
– A list of BlockExportInfo describing all block exports
Character devices
- Object ChardevInfo (Since: 0.14)
Information about a character device.
- Members:
label (
string
) – the label of the character devicefilename (
string
) – the filename of the character devicefrontend-open (
boolean
) – shows whether the frontend device attached to this backend (e.g. with the chardev=… option) is in open or closed state (since 2.1)
Note
filename
is encoded using the QEMU command line character device encoding. See the QEMU man page for details.
- Command query-chardev (Since: 0.14)
Returns information about current character devices.
- Return:
[
ChardevInfo
]
– a list ofChardevInfo
Example:
-> { "execute": "query-chardev" } <- { "return": [ { "label": "charchannel0", "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server=on", "frontend-open": false }, { "label": "charmonitor", "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server=on", "frontend-open": true }, { "label": "charserial0", "filename": "pty:/dev/pts/2", "frontend-open": true } ] }
- Object ChardevBackendInfo (Since: 2.0)
Information about a character device backend
- Members:
name (
string
) – The backend name
- Command query-chardev-backends (Since: 2.0)
Returns information about character device backends.
- Return:
[
ChardevBackendInfo
]
– a list ofChardevBackendInfo
Example:
-> { "execute": "query-chardev-backends" } <- { "return":[ { "name":"udp" }, { "name":"tcp" }, { "name":"unix" }, { "name":"spiceport" } ] }
- Enum DataFormat (Since: 1.4)
An enumeration of data format.
- Values:
utf8 – Data is a UTF-8 string (RFC 3629)
base64 – Data is Base64 encoded binary (RFC 3548)
- Command ringbuf-write (Since: 1.4)
Write to a ring buffer character device.
- Arguments:
device (
string
) – the ring buffer character device namedata (
string
) – data to writeformat (
DataFormat
, optional) –data encoding (default ‘utf8’).
base64: data must be base64 encoded text. Its binary decoding gets written.
utf8: data’s UTF-8 encoding is written
data itself is always Unicode regardless of format, like any other string.
Example:
-> { "execute": "ringbuf-write", "arguments": { "device": "foo", "data": "abcdefgh", "format": "utf8" } } <- { "return": {} }
- Command ringbuf-read (Since: 1.4)
Read from a ring buffer character device.
- Arguments:
device (
string
) – the ring buffer character device namesize (
int
) – how many bytes to read at mostformat (
DataFormat
, optional) –data encoding (default ‘utf8’).
base64: the data read is returned in base64 encoding.
utf8: the data read is interpreted as UTF-8. Bug: can screw up when the buffer contains invalid UTF-8 sequences, NUL characters, after the ring buffer lost data, and when reading stops because the size limit is reached.
The return value is always Unicode regardless of format, like any other string.
- Return:
string
– data read from the device
Example:
-> { "execute": "ringbuf-read", "arguments": { "device": "foo", "size": 1000, "format": "utf8" } } <- { "return": "abcdefgh" }
- Object ChardevCommon (Since: 2.6)
Configuration shared across all chardev backends
- Members:
logfile (
string
, optional) – The name of a logfile to save outputlogappend (
boolean
, optional) – true to append instead of truncate (default to false to truncate)
- Object ChardevFile (Since: 1.4)
Configuration info for file chardevs.
- Members:
in (
string
, optional) – The name of the input fileout (
string
) – The name of the output fileappend (
boolean
, optional) – Open the file in append mode (default false to truncate) (Since 2.6)The members of
ChardevCommon
.
- Object ChardevHostdev (Since: 1.4)
Configuration info for device and pipe chardevs.
- Members:
device (
string
) – The name of the special file for the device, i.e. /dev/ttyS0 on Unix or COM1: on WindowsThe members of
ChardevCommon
.
- Object ChardevSocket (Since: 1.4)
Configuration info for (stream) socket chardevs.
- Members:
addr (
SocketAddressLegacy
) – socket address to listen on (server=true) or connect to (server=false)tls-creds (
string
, optional) – the ID of the TLS credentials object (since 2.6)tls-authz (
string
, optional) – the ID of the QAuthZ authorization object against which the client’s x509 distinguished name will be validated. This object is only resolved at time of use, so can be deleted and recreated on the fly while the chardev server is active. If missing, it will default to denying access (since 4.0)server (
boolean
, optional) – create server socket (default: true)wait (
boolean
, optional) – wait for incoming connection on server sockets (default: false). Silently ignored with server: false. This use is deprecated.nodelay (
boolean
, optional) – set TCP_NODELAY socket option (default: false)telnet (
boolean
, optional) – enable telnet protocol on server sockets (default: false)tn3270 (
boolean
, optional) – enable tn3270 protocol on server sockets (default: false) (Since: 2.10)websocket (
boolean
, optional) – enable websocket protocol on server sockets (default: false) (Since: 3.1)reconnect (
int
, optional) – For a client socket, if a socket is disconnected, then attempt a reconnect after the given number of seconds. Setting this to zero disables this function. The use of this member is deprecated, usereconnect-ms
instead. (default: 0) (Since: 2.2)reconnect-ms (
int
, optional) – For a client socket, if a socket is disconnected, then attempt a reconnect after the given number of milliseconds. Setting this to zero disables this function. This member is mutually exclusive withreconnect
. (default: 0) (Since: 9.2)The members of
ChardevCommon
.
- Features:
deprecated – Member
reconnect
is deprecated. Usereconnect-ms
instead.
- Object ChardevUdp (Since: 1.5)
Configuration info for datagram socket chardevs.
- Members:
remote (
SocketAddressLegacy
) – remote addresslocal (
SocketAddressLegacy
, optional) – local addressThe members of
ChardevCommon
.
- Object ChardevMux (Since: 1.5)
Configuration info for mux chardevs.
- Members:
chardev (
string
) – name of the base chardev.The members of
ChardevCommon
.
- Object ChardevHub (Since: 10.0)
Configuration info for hub chardevs.
- Members:
chardevs (
[
string
]
) – IDs to be added to this hub (maximum 4 devices).The members of
ChardevCommon
.
- Object ChardevStdio (Since: 1.5)
Configuration info for stdio chardevs.
- Members:
signal (
boolean
, optional) – Allow signals (such as SIGINT triggered by ^C) be delivered to qemu. Default: true.The members of
ChardevCommon
.
- Object ChardevSpiceChannel (Since: 1.5)
- Availability:
CONFIG_SPICE
Configuration info for spice vm channel chardevs.
- Members:
type (
string
) – kind of channel (for example vdagent).The members of
ChardevCommon
.
- Object ChardevSpicePort (Since: 1.5)
- Availability:
CONFIG_SPICE
Configuration info for spice port chardevs.
- Members:
fqdn (
string
) – name of the channel (see docs/spice-port-fqdn.txt)The members of
ChardevCommon
.
- Object ChardevDBus (Since: 7.0)
- Availability:
CONFIG_DBUS_DISPLAY
Configuration info for DBus chardevs.
- Members:
name (
string
) – name of the channel (following docs/spice-port-fqdn.txt)The members of
ChardevCommon
.
- Object ChardevVC (Since: 1.5)
Configuration info for virtual console chardevs.
- Members:
width (
int
, optional) – console width, in pixelsheight (
int
, optional) – console height, in pixelscols (
int
, optional) – console width, in charsrows (
int
, optional) – console height, in charsThe members of
ChardevCommon
.
Note
The options are only effective when the VNC or SDL graphical display backend is active. They are ignored with the GTK, Spice, VNC and D-Bus display backends.
- Object ChardevRingbuf (Since: 1.5)
Configuration info for ring buffer chardevs.
- Members:
size (
int
, optional) – ring buffer size, must be power of two, default is 65536The members of
ChardevCommon
.
- Object ChardevQemuVDAgent (Since: 6.1)
- Availability:
CONFIG_SPICE_PROTOCOL
Configuration info for qemu vdagent implementation.
- Members:
mouse (
boolean
, optional) – enable/disable mouse, default is enabled.clipboard (
boolean
, optional) – enable/disable clipboard, default is disabled.The members of
ChardevCommon
.
- Object ChardevPty (Since: 9.2)
Configuration info for pty implementation.
- Members:
path (
string
, optional) – optional path to create a symbolic link that points to the allocated PTYThe members of
ChardevCommon
.
- Enum ChardevBackendKind (Since: 1.4)
- Values:
file – regular files
serial – serial host device
parallel – parallel host device
pipe – pipes (since 1.5)
socket – stream socket
udp – datagram socket (since 1.5)
pty – pseudo-terminal
null – provides no input, throws away output
mux – (since 1.5)
hub – (since 10.0)
msmouse – emulated Microsoft serial mouse (since 1.5)
wctablet – emulated Wacom Penpartner serial tablet (since 2.9)
braille – Baum Braille device (since 1.5)
testdev – device for test-suite control (since 2.2)
stdio – standard I/O (since 1.5)
console – Windows console (since 1.5)
spicevmc – spice vm channel (since 1.5)
spiceport – Spice port channel (since 1.5)
qemu-vdagent – Spice vdagent (since 6.1)
dbus – D-Bus channel (since 7.0)
vc – virtual console (since 1.5)
ringbuf – memory ring buffer (since 1.6)
memory – synonym for
ringbuf
(since 1.5)
- Features:
deprecated – Member
memory
is deprecated. Useringbuf
instead.
- Object ChardevFileWrapper (Since: 1.4)
- Members:
data (
ChardevFile
) – Configuration info for file chardevs
- Object ChardevHostdevWrapper (Since: 1.4)
- Members:
data (
ChardevHostdev
) – Configuration info for device and pipe chardevs
- Object ChardevSocketWrapper (Since: 1.4)
- Members:
data (
ChardevSocket
) – Configuration info for (stream) socket chardevs
- Object ChardevUdpWrapper (Since: 1.5)
- Members:
data (
ChardevUdp
) – Configuration info for datagram socket chardevs
- Object ChardevCommonWrapper (Since: 2.6)
- Members:
data (
ChardevCommon
) – Configuration shared across all chardev backends
- Object ChardevMuxWrapper (Since: 1.5)
- Members:
data (
ChardevMux
) – Configuration info for mux chardevs
- Object ChardevHubWrapper (Since: 10.0)
- Members:
data (
ChardevHub
) – Configuration info for hub chardevs
- Object ChardevStdioWrapper (Since: 1.5)
- Members:
data (
ChardevStdio
) – Configuration info for stdio chardevs
- Object ChardevSpiceChannelWrapper (Since: 1.5)
- Availability:
CONFIG_SPICE
- Members:
data (
ChardevSpiceChannel
) – Configuration info for spice vm channel chardevs
- Object ChardevSpicePortWrapper (Since: 1.5)
- Availability:
CONFIG_SPICE
- Members:
data (
ChardevSpicePort
) – Configuration info for spice port chardevs
- Object ChardevQemuVDAgentWrapper (Since: 6.1)
- Availability:
CONFIG_SPICE_PROTOCOL
- Members:
data (
ChardevQemuVDAgent
) – Configuration info for qemu vdagent implementation
- Object ChardevDBusWrapper (Since: 7.0)
- Availability:
CONFIG_DBUS_DISPLAY
- Members:
data (
ChardevDBus
) – Configuration info for DBus chardevs
- Object ChardevVCWrapper (Since: 1.5)
- Members:
data (
ChardevVC
) – Configuration info for virtual console chardevs
- Object ChardevRingbufWrapper (Since: 1.5)
- Members:
data (
ChardevRingbuf
) – Configuration info for ring buffer chardevs
- Object ChardevPtyWrapper (Since: 9.2)
- Members:
data (
ChardevPty
) – Configuration info for pty chardevs
- Object ChardevBackend (Since: 1.4)
Configuration info for the new chardev backend.
- Members:
type (
ChardevBackendKind
) – backend typeWhen
type
isfile
: The members ofChardevFileWrapper
.When
type
isserial
: The members ofChardevHostdevWrapper
.When
type
isparallel
: The members ofChardevHostdevWrapper
.When
type
ispipe
: The members ofChardevHostdevWrapper
.When
type
issocket
: The members ofChardevSocketWrapper
.When
type
isudp
: The members ofChardevUdpWrapper
.When
type
ispty
: The members ofChardevPtyWrapper
.When
type
isnull
: The members ofChardevCommonWrapper
.When
type
ismux
: The members ofChardevMuxWrapper
.When
type
ishub
: The members ofChardevHubWrapper
.When
type
ismsmouse
: The members ofChardevCommonWrapper
.When
type
iswctablet
: The members ofChardevCommonWrapper
.When
type
isbraille
: The members ofChardevCommonWrapper
.When
type
istestdev
: The members ofChardevCommonWrapper
.When
type
isstdio
: The members ofChardevStdioWrapper
.When
type
isconsole
: The members ofChardevCommonWrapper
.When
type
isspicevmc
: The members ofChardevSpiceChannelWrapper
.When
type
isspiceport
: The members ofChardevSpicePortWrapper
.When
type
isqemu-vdagent
: The members ofChardevQemuVDAgentWrapper
.When
type
isdbus
: The members ofChardevDBusWrapper
.When
type
isvc
: The members ofChardevVCWrapper
.When
type
isringbuf
: The members ofChardevRingbufWrapper
.When
type
ismemory
: The members ofChardevRingbufWrapper
.
- Object ChardevReturn (Since: 1.4)
Return info about the chardev backend just created.
- Members:
pty (
string
, optional) – name of the slave pseudoterminal device, present if and only if a chardev of type ‘pty’ was created
- Command chardev-add (Since: 1.4)
Add a character device backend
- Arguments:
id (
string
) – the chardev’s ID, must be uniquebackend (
ChardevBackend
) – backend type and parameters
- Return:
ChardevReturn
– ChardevReturn.
Example:
-> { "execute" : "chardev-add", "arguments" : { "id" : "foo", "backend" : { "type" : "null", "data" : {} } } } <- { "return": {} }
Example:
-> { "execute" : "chardev-add", "arguments" : { "id" : "bar", "backend" : { "type" : "file", "data" : { "out" : "/tmp/bar.log" } } } } <- { "return": {} }
Example:
-> { "execute" : "chardev-add", "arguments" : { "id" : "baz", "backend" : { "type" : "pty", "data" : {} } } } <- { "return": { "pty" : "/dev/pty/42" } }
- Command chardev-change (Since: 2.10)
Change a character device backend
- Arguments:
id (
string
) – the chardev’s ID, must existbackend (
ChardevBackend
) – new backend type and parameters
- Return:
ChardevReturn
– ChardevReturn.
Example:
-> { "execute" : "chardev-change", "arguments" : { "id" : "baz", "backend" : { "type" : "pty", "data" : {} } } } <- { "return": { "pty" : "/dev/pty/42" } }
Example:
-> {"execute" : "chardev-change", "arguments" : { "id" : "charchannel2", "backend" : { "type" : "socket", "data" : { "addr" : { "type" : "unix" , "data" : { "path" : "/tmp/charchannel2.socket" } }, "server" : true, "wait" : false }}}} <- {"return": {}}
- Command chardev-remove (Since: 1.4)
Remove a character device backend
- Arguments:
id (
string
) – the chardev’s ID, must exist and not be in use
Example:
-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } } <- { "return": {} }
- Command chardev-send-break (Since: 2.10)
Send a break to a character device
- Arguments:
id (
string
) – the chardev’s ID, must exist
Example:
-> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } } <- { "return": {} }
- Event VSERPORT_CHANGE (Since: 2.1)
Emitted when the guest opens or closes a virtio-serial port.
- Members:
id (
string
) – device identifier of the virtio-serial portopen (
boolean
) – true if the guest has opened the virtio-serial port
Note
This event is rate-limited.
Example:
<- { "event": "VSERPORT_CHANGE", "data": { "id": "channel0", "open": true }, "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
Transactions
- Object Abort (Since: 1.6)
This action can be used to test transaction failure.
- Enum ActionCompletionMode (Since: 2.5)
An enumeration of Transactional completion modes.
- Values:
individual – Do not attempt to cancel any other Actions if any Actions fail after the Transaction request succeeds. All Actions that can complete successfully will do so without waiting on others. This is the default.
grouped – If any Action fails after the Transaction succeeds, cancel all Actions. Actions do not complete until all Actions are ready to complete. May be rejected by Actions that do not support this completion mode.
- Enum TransactionActionKind (Since: 1.1)
- Values:
abort – Since 1.6
block-dirty-bitmap-add – Since 2.5
block-dirty-bitmap-remove – Since 4.2
block-dirty-bitmap-clear – Since 2.5
block-dirty-bitmap-enable – Since 4.0
block-dirty-bitmap-disable – Since 4.0
block-dirty-bitmap-merge – Since 4.0
blockdev-backup – Since 2.3
blockdev-snapshot – Since 2.5
blockdev-snapshot-internal-sync – Since 1.7
blockdev-snapshot-sync – since 1.1
drive-backup – Since 1.6
- Features:
deprecated – Member
drive-backup
is deprecated. Use memberblockdev-backup
instead.
- Object BlockDirtyBitmapAddWrapper (Since: 2.5)
- Members:
data (
BlockDirtyBitmapAdd
) – Not documented
- Object BlockDirtyBitmapWrapper (Since: 2.5)
- Members:
data (
BlockDirtyBitmap
) – Not documented
- Object BlockDirtyBitmapMergeWrapper (Since: 4.0)
- Members:
data (
BlockDirtyBitmapMerge
) – Not documented
- Object BlockdevBackupWrapper (Since: 2.3)
- Members:
data (
BlockdevBackup
) – Not documented
- Object BlockdevSnapshotWrapper (Since: 2.5)
- Members:
data (
BlockdevSnapshot
) – Not documented
- Object BlockdevSnapshotInternalWrapper (Since: 1.7)
- Members:
data (
BlockdevSnapshotInternal
) – Not documented
- Object BlockdevSnapshotSyncWrapper (Since: 1.1)
- Members:
data (
BlockdevSnapshotSync
) – Not documented
- Object DriveBackupWrapper (Since: 1.6)
- Members:
data (
DriveBackup
) – Not documented
- Object TransactionAction (Since: 1.1)
A discriminated record of operations that can be performed with
transaction
.- Members:
type (
TransactionActionKind
) – the operation to be performedWhen
type
isabort
: The members ofAbortWrapper
.When
type
isblock-dirty-bitmap-add
: The members ofBlockDirtyBitmapAddWrapper
.When
type
isblock-dirty-bitmap-remove
: The members ofBlockDirtyBitmapWrapper
.When
type
isblock-dirty-bitmap-clear
: The members ofBlockDirtyBitmapWrapper
.When
type
isblock-dirty-bitmap-enable
: The members ofBlockDirtyBitmapWrapper
.When
type
isblock-dirty-bitmap-disable
: The members ofBlockDirtyBitmapWrapper
.When
type
isblock-dirty-bitmap-merge
: The members ofBlockDirtyBitmapMergeWrapper
.When
type
isblockdev-backup
: The members ofBlockdevBackupWrapper
.When
type
isblockdev-snapshot
: The members ofBlockdevSnapshotWrapper
.When
type
isblockdev-snapshot-internal-sync
: The members ofBlockdevSnapshotInternalWrapper
.When
type
isblockdev-snapshot-sync
: The members ofBlockdevSnapshotSyncWrapper
.When
type
isdrive-backup
: The members ofDriveBackupWrapper
.
- Object TransactionProperties (Since: 2.5)
Optional arguments to modify the behavior of a Transaction.
- Members:
completion-mode (
ActionCompletionMode
, optional) – Controls how jobs launched asynchronously by Actions will complete or fail as a group. SeeActionCompletionMode
for details.
- Command transaction (Since: 1.1)
Executes a number of transactionable QMP commands atomically. If any operation fails, then the entire set of actions will be abandoned and the appropriate error returned.
For external snapshots, the dictionary contains the device, the file to use for the new snapshot, and the format. The default format, if not specified, is qcow2.
Each new snapshot defaults to being created by QEMU (wiping any contents if the file already exists), but it is also possible to reuse an externally-created file. In the latter case, you should ensure that the new image file has the same contents as the current one; QEMU cannot perform any meaningful check. Typically this is achieved by using the current image file as the backing file for the new image.
On failure, the original disks pre-snapshot attempt will be used.
For internal snapshots, the dictionary contains the device and the snapshot’s name. If an internal snapshot matching name already exists, the request will be rejected. Only some image formats support it, for example, qcow2, and rbd,
On failure, qemu will try delete the newly created internal snapshot in the transaction. When an I/O error occurs during deletion, the user needs to fix it later with qemu-img or other command.
- Arguments:
actions (
[
TransactionAction
]
) – List ofTransactionAction
; information needed for the respective operations.properties (
TransactionProperties
, optional) – structure of additional options to control the execution of the transaction. SeeTransactionProperties
for additional detail.
- Errors:
Any errors from commands in the transaction
Note
The transaction aborts on the first failure. Therefore, there will be information on only one failed operation returned in an error condition, and subsequent actions will not have been attempted.
Example:
-> { "execute": "transaction", "arguments": { "actions": [ { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0", "snapshot-file": "/some/place/my-image", "format": "qcow2" } }, { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile", "snapshot-file": "/some/place/my-image2", "snapshot-node-name": "node3432", "mode": "existing", "format": "qcow2" } }, { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1", "snapshot-file": "/some/place/my-image2", "mode": "existing", "format": "qcow2" } }, { "type": "blockdev-snapshot-internal-sync", "data" : { "device": "ide-hd2", "name": "snapshot0" } } ] } } <- { "return": {} }
QMP monitor control
- Command qmp_capabilities (Since: 0.13)
Enable QMP capabilities.
- Arguments:
enable (
[
QMPCapability
]
, optional) – An optional list of QMPCapability values to enable. The client must not enable any capability that is not mentioned in the QMP greeting message. If the field is not provided, it means no QMP capabilities will be enabled. (since 2.12)
Example:
-> { "execute": "qmp_capabilities", "arguments": { "enable": [ "oob" ] } } <- { "return": {} }
Note
This command is valid exactly when first connecting: it must be issued before any other command will be accepted, and will fail once the monitor is accepting other commands. (see QEMU Machine Protocol Specification)
Note
The QMP client needs to explicitly enable QMP capabilities, otherwise all the QMP capabilities will be turned off by default.
- Enum QMPCapability (Since: 2.12)
Enumeration of capabilities to be advertised during initial client connection, used for agreeing on particular QMP extension behaviors.
- Values:
oob – QMP ability to support out-of-band requests. (Please refer to qmp-spec.rst for more information on OOB)
- Object VersionTriple (Since: 2.4)
A three-part version number.
- Members:
major (
int
) – The major version number.minor (
int
) – The minor version number.micro (
int
) – The micro version number.
- Object VersionInfo (Since: 0.14)
A description of QEMU’s version.
- Members:
qemu (
VersionTriple
) – The version of QEMU. By current convention, a micro version of 50 signifies a development branch. A micro version greater than or equal to 90 signifies a release candidate for the next minor version. A micro version of less than 50 signifies a stable release.package (
string
) – QEMU will always set this field to an empty string. Downstream versions of QEMU should set this to a non-empty string. The exact format depends on the downstream however it highly recommended that a unique name is used.
- Command query-version (Since: 0.14)
Returns the current version of QEMU.
- Return:
VersionInfo
– AVersionInfo
object describing the current version of QEMU.
Example:
-> { "execute": "query-version" } <- { "return":{ "qemu":{ "major":0, "minor":11, "micro":5 }, "package":"" } }
- Object CommandInfo (Since: 0.14)
Information about a QMP command
- Members:
name (
string
) – The command name
- Command query-commands (Since: 0.14)
Return a list of supported QMP commands by this server
- Return:
[
CommandInfo
]
– A list ofCommandInfo
for all supported commands
Example:
-> { "execute": "query-commands" } <- { "return":[ { "name":"query-balloon" }, { "name":"system_powerdown" }, ... ] }
This example has been shortened as the real response is too long.
- Command quit (Since: 0.14)
This command will cause the QEMU process to exit gracefully. While every attempt is made to send the QMP response before terminating, this is not guaranteed. When using this interface, a premature EOF would not be unexpected.
Example:
-> { "execute": "quit" } <- { "return": {} }
- Enum MonitorMode (Since: 5.0)
An enumeration of monitor modes.
- Values:
readline – HMP monitor (human-oriented command line interface)
control – QMP monitor (JSON-based machine interface)
- Object MonitorOptions (Since: 5.0)
Options to be used for adding a new monitor.
- Members:
id (
string
, optional) – Name of the monitormode (
MonitorMode
, optional) – Selects the monitor mode (default: readline in the system emulator, control in qemu-storage-daemon)pretty (
boolean
, optional) – Enables pretty printing (QMP only)chardev (
string
) – Name of a character device to expose the monitor on
QMP introspection
- Command query-qmp-schema (Since: 2.5)
Command query-qmp-schema exposes the QMP wire ABI as an array of SchemaInfo. This lets QMP clients figure out what commands and events are available in this QEMU, and their parameters and results.
However, the SchemaInfo can’t reflect all the rules and restrictions that apply to QMP. It’s interface introspection (figuring out what’s there), not interface specification. The specification is in the QAPI schema.
Furthermore, while we strive to keep the QMP wire format backwards-compatible across qemu versions, the introspection output is not guaranteed to have the same stability. For example, one version of qemu may list an object member as an optional non-variant, while another lists the same member only through the object’s variants; or the type of a member may change from a generic string into a specific enum or from one specific type into an alternate that includes the original type alongside something else.
- Return:
[
SchemaInfo
]
–array of
SchemaInfo
, where each element describes an entity in the ABI: command, event, type, …The order of the various SchemaInfo is unspecified; however, all names are guaranteed to be unique (no name will be duplicated with different meta-types).
Note
The QAPI schema is also used to help define internal interfaces, by defining QAPI types. These are not part of the QMP wire ABI, and therefore not returned by this command.
- Enum SchemaMetaType (Since: 2.5)
This is a
SchemaInfo
’s meta type, i.e. the kind of entity it describes.- Values:
builtin – a predefined type such as ‘int’ or ‘bool’.
enum – an enumeration type
array – an array type
object – an object type (struct or union)
alternate – an alternate type
command – a QMP command
event – a QMP event
- Object SchemaInfo (Since: 2.5)
- Members:
name (
string
) – the entity’s name, inherited frombase
. The SchemaInfo is always referenced by this name. Commands and events have the name defined in the QAPI schema. Unlike command and event names, type names are not part of the wire ABI. Consequently, type names are meaningless strings here, although they are still guaranteed unique regardless ofmeta-type
.meta-type (
SchemaMetaType
) – the entity’s meta type, inherited frombase
.features (
[
string
]
, optional) – names of features associated with the entity, in no particular order. (since 4.1 for object types, 4.2 for commands, 5.0 for the rest)When
meta-type
isbuiltin
: The members ofSchemaInfoBuiltin
.When
meta-type
isenum
: The members ofSchemaInfoEnum
.When
meta-type
isarray
: The members ofSchemaInfoArray
.When
meta-type
isobject
: The members ofSchemaInfoObject
.When
meta-type
isalternate
: The members ofSchemaInfoAlternate
.When
meta-type
iscommand
: The members ofSchemaInfoCommand
.When
meta-type
isevent
: The members ofSchemaInfoEvent
.
- Object SchemaInfoBuiltin (Since: 2.5)
Additional SchemaInfo members for meta-type ‘builtin’.
- Members:
json-type (
JSONType
) – the JSON type used for this type on the wire.
- Enum JSONType (Since: 2.5)
The four primitive and two structured types according to RFC 8259 section 1, plus ‘int’ (split off ‘number’), plus the obvious top type ‘value’.
- Values:
string – JSON string
number – JSON number
int – JSON number that is an integer
boolean – literal
false
ortrue
null – literal
null
object – JSON object
array – JSON array
value – any JSON value
- Object SchemaInfoEnum (Since: 2.5)
Additional SchemaInfo members for meta-type ‘enum’.
- Members:
members (
[
SchemaInfoEnumMember
]
) – the enum type’s members, in no particular order (since 6.2).values (
[
string
]
) – the enumeration type’s member names, in no particular order. Redundant withmembers
. Just for backward compatibility.
- Features:
deprecated – Member
values
is deprecated. Usemembers
instead.
Values of this type are JSON string on the wire.
- Object SchemaInfoEnumMember (Since: 6.2)
An object member.
- Members:
name (
string
) – the member’s name, as defined in the QAPI schema.features (
[
string
]
, optional) – names of features associated with the member, in no particular order.
- Object SchemaInfoArray (Since: 2.5)
Additional SchemaInfo members for meta-type ‘array’.
- Members:
element-type (
string
) – the array type’s element type.
Values of this type are JSON array on the wire.
- Object SchemaInfoObject (Since: 2.5)
Additional SchemaInfo members for meta-type ‘object’.
- Members:
members (
[
SchemaInfoObjectMember
]
) – the object type’s (non-variant) members, in no particular order.tag (
string
, optional) – the name of the member serving as type tag. An element ofmembers
with this name must exist.variants (
[
SchemaInfoObjectVariant
]
, optional) – variant members, i.e. additional members that depend on the type tag’s value. Present exactly whentag
is present. The variants are in no particular order, and may even differ from the order of the values of the enum type of thetag
.
Values of this type are JSON object on the wire.
- Object SchemaInfoObjectMember (Since: 2.5)
An object member.
- Members:
name (
string
) – the member’s name, as defined in the QAPI schema.type (
string
) – the name of the member’s type.default (
value
, optional) – default when used as command parameter. If absent, the parameter is mandatory. If present, the value must be null. The parameter is optional, and behavior when it’s missing is not specified here. Future extension: if present and non-null, the parameter is optional, and defaults to this value.features (
[
string
]
, optional) – names of features associated with the member, in no particular order. (since 5.0)
- Object SchemaInfoObjectVariant (Since: 2.5)
The variant members for a value of the type tag.
- Members:
case (
string
) – a value of the type tag.type (
string
) – the name of the object type that provides the variant members when the type tag has valuecase
.
- Object SchemaInfoAlternate (Since: 2.5)
Additional SchemaInfo members for meta-type ‘alternate’.
- Members:
members (
[
SchemaInfoAlternateMember
]
) – the alternate type’s members, in no particular order. The members’ wire encoding is distinct, see How to use the QAPI code generator section Alternate types.
On the wire, this can be any of the members.
- Object SchemaInfoAlternateMember (Since: 2.5)
An alternate member.
- Members:
type (
string
) – the name of the member’s type.
- Object SchemaInfoCommand (Since: 2.5)
Additional SchemaInfo members for meta-type ‘command’.
- Members:
arg-type (
string
) – the name of the object type that provides the command’s parameters.ret-type (
string
) – the name of the command’s result type.allow-oob (
boolean
, optional) – whether the command allows out-of-band execution, defaults to false (Since: 2.12)
- Object SchemaInfoEvent (Since: 2.5)
Additional SchemaInfo members for meta-type ‘event’.
- Members:
arg-type (
string
) – the name of the object type that provides the event’s parameters.
QEMU Object Model (QOM)
- Object ObjectPropertyInfo (Since: 1.2)
- Members:
name (
string
) – the name of the propertytype (
string
) –the type of the property. This will typically come in one of four forms:
A primitive type such as ‘u8’, ‘u16’, ‘bool’, ‘str’, or ‘double’. These types are mapped to the appropriate JSON type.
A child type in the form ‘child<subtype>’ where subtype is a qdev device type name. Child properties create the composition tree.
A link type in the form ‘link<subtype>’ where subtype is a qdev device type name. Link properties form the device model graph.
description (
string
, optional) – if specified, the description of the property.default-value (
value
, optional) – the default value, if any (since 5.0)
- Command qom-list (Since: 1.2)
This command will list any properties of a object given a path in the object model.
- Arguments:
path (
string
) – the path within the object model. Seeqom-get
for a description of this parameter.
- Return:
[
ObjectPropertyInfo
]
– a list ofObjectPropertyInfo
that describe the properties of the object.
Example:
-> { "execute": "qom-list", "arguments": { "path": "/chardevs" } } <- { "return": [ { "name": "type", "type": "string" }, { "name": "parallel0", "type": "child<chardev-vc>" }, { "name": "serial0", "type": "child<chardev-vc>" }, { "name": "mon0", "type": "child<chardev-stdio>" } ] }
- Command qom-get (Since: 1.2)
This command will get a property from a object model path and return the value.
- Arguments:
path (
string
) –The path within the object model. There are two forms of supported paths–absolute and partial paths.
Absolute paths are derived from the root object and can follow child<> or link<> properties. Since they can follow link<> properties, they can be arbitrarily long. Absolute paths look like absolute filenames and are prefixed with a leading slash.
Partial paths look like relative filenames. They do not begin with a prefix. The matching rules for partial paths are subtle but designed to make specifying objects easy. At each level of the composition tree, the partial path is matched as an absolute path. The first match is not returned. At least two matches are searched for. A successful result is only returned if only one match is found. If more than one match is found, a flag is return to indicate that the match was ambiguous.
property (
string
) – The property name to read
- Return:
value
– The property value. The type depends on the property type. child<> and link<> properties are returned as #str pathnames. All integer property types (u8, u16, etc) are returned as #int.
Example: Use absolute path
-> { "execute": "qom-get", "arguments": { "path": "/machine/unattached/device[0]", "property": "hotplugged" } } <- { "return": false }
Example: Use partial path
-> { "execute": "qom-get", "arguments": { "path": "unattached/sysbus", "property": "type" } } <- { "return": "System" }
- Command qom-set (Since: 1.2)
This command will set a property from a object model path.
- Arguments:
path (
string
) – seeqom-get
for a description of this parameterproperty (
string
) – the property name to setvalue (
value
) – a value who’s type is appropriate for the property type. Seeqom-get
for a description of type mapping.
Example:
-> { "execute": "qom-set", "arguments": { "path": "/machine", "property": "graphics", "value": false } } <- { "return": {} }
- Object ObjectTypeInfo (Since: 1.1)
This structure describes a search result from
qom-list-types
- Members:
name (
string
) – the type name found in the searchabstract (
boolean
, optional) – the type is abstract and can’t be directly instantiated. Omitted if false. (since 2.10)parent (
string
, optional) – Name of parent type, if any (since 2.10)
- Command qom-list-types (Since: 1.1)
This command will return a list of types given search parameters
- Arguments:
implements (
string
, optional) – if specified, only return types that implement this type nameabstract (
boolean
, optional) – if true, include abstract types in the results
- Return:
[
ObjectTypeInfo
]
– a list ofObjectTypeInfo
or an empty list if no results are found
- Command qom-list-properties (Since: 2.12)
List properties associated with a QOM object.
- Arguments:
typename (
string
) – the type name of an object
Note
Objects can create properties at runtime, for example to describe links between different devices and/or objects. These properties are not included in the output of this command.
- Return:
[
ObjectPropertyInfo
]
– a list of ObjectPropertyInfo describing object properties
- Object CanHostSocketcanProperties (Since: 2.12)
- Availability:
CONFIG_LINUX
Properties for can-host-socketcan objects.
- Members:
if (
string
) – interface name of the host system CAN bus to connect tocanbus (
string
) – object ID of the can-bus object to connect to the host interface
- Object ColoCompareProperties (Since: 2.8)
Properties for colo-compare objects.
- Members:
primary_in (
string
) – name of the character device backend to use for the primary input (incoming packets are redirected tooutdev
)secondary_in (
string
) – name of the character device backend to use for secondary input (incoming packets are only compared to the input onprimary_in
and then dropped)outdev (
string
) – name of the character device backend to use for outputiothread (
string
) – name of the iothread to run innotify_dev (
string
, optional) – name of the character device backend to be used to communicate with the remote colo-frame (only for Xen COLO)compare_timeout (
int
, optional) – the maximum time to hold a packet fromprimary_in
for comparison with an incoming packet onsecondary_in
in milliseconds (default: 3000)expired_scan_cycle (
int
, optional) – the interval at which colo-compare checks whether packets fromprimary
have timed out, in milliseconds (default: 3000)max_queue_size (
int
, optional) – the maximum number of packets to keep in the queue for comparing with incoming packets fromsecondary_in
. If the queue is full and additional packets are received, the additional packets are dropped. (default: 1024)vnet_hdr_support (
boolean
, optional) – if true, vnet header support is enabled (default: false)
- Object CryptodevBackendProperties (Since: 2.8)
Properties for cryptodev-backend and cryptodev-backend-builtin objects.
- Members:
queues (
int
, optional) – the number of queues for the cryptodev backend. Ignored for cryptodev-backend and must be 1 for cryptodev-backend-builtin. (default: 1)throttle-bps (
int
, optional) – limit total bytes per second (Since 8.0)throttle-ops (
int
, optional) – limit total operations per second (Since 8.0)
- Object CryptodevVhostUserProperties (Since: 2.12)
- Availability:
CONFIG_VHOST_CRYPTO
Properties for cryptodev-vhost-user objects.
- Members:
chardev (
string
) – the name of a Unix domain socket character device that connects to the vhost-user serverThe members of
CryptodevBackendProperties
.
- Object DBusVMStateProperties (Since: 5.0)
Properties for dbus-vmstate objects.
- Members:
addr (
string
) – the name of the DBus bus to connect toid-list (
string
, optional) – a comma separated list of DBus IDs of helpers whose data should be included in the VM state on migration
- Enum NetfilterInsert (Since: 5.0)
Indicates where to insert a netfilter relative to a given other filter.
- Values:
before – insert before the specified filter
behind – insert behind the specified filter
- Object NetfilterProperties (Since: 2.5)
Properties for objects of classes derived from netfilter.
- Members:
netdev (
string
) – id of the network device backend to filterqueue (
NetFilterDirection
, optional) – indicates which queue(s) to filter (default: all)status (
string
, optional) – indicates whether the filter is enabled (“on”) or disabled (“off”) (default: “on”)position (
string
, optional) – specifies where the filter should be inserted in the filter list. “head” means the filter is inserted at the head of the filter list, before any existing filters. “tail” means the filter is inserted at the tail of the filter list, behind any existing filters (default). “id=<id>” means the filter is inserted before or behind the filter specified by <id>, depending on theinsert
property. (default: “tail”)insert (
NetfilterInsert
, optional) – where to insert the filter relative to the filter given inposition
. Ignored ifposition
is “head” or “tail”. (default: behind)
- Object FilterBufferProperties (Since: 2.5)
Properties for filter-buffer objects.
- Members:
interval (
int
) – a non-zero interval in microseconds. All packets arriving in the given interval are delayed until the end of the interval.The members of
NetfilterProperties
.
- Object FilterDumpProperties (Since: 2.5)
Properties for filter-dump objects.
- Members:
file (
string
) – the filename where the dumped packets should be storedmaxlen (
int
, optional) – maximum number of bytes in a packet that are stored (default: 65536)The members of
NetfilterProperties
.
- Object FilterMirrorProperties (Since: 2.6)
Properties for filter-mirror objects.
- Members:
outdev (
string
) – the name of a character device backend to which all incoming packets are mirroredvnet_hdr_support (
boolean
, optional) – if true, vnet header support is enabled (default: false)The members of
NetfilterProperties
.
- Object FilterRedirectorProperties (Since: 2.6)
Properties for filter-redirector objects.
At least one of
indev
oroutdev
must be present. If both are present, they must not refer to the same character device backend.- Members:
indev (
string
, optional) – the name of a character device backend from which packets are received and redirected to the filtered network deviceoutdev (
string
, optional) – the name of a character device backend to which all incoming packets are redirectedvnet_hdr_support (
boolean
, optional) – if true, vnet header support is enabled (default: false)The members of
NetfilterProperties
.
- Object FilterRewriterProperties (Since: 2.8)
Properties for filter-rewriter objects.
- Members:
vnet_hdr_support (
boolean
, optional) – if true, vnet header support is enabled (default: false)The members of
NetfilterProperties
.
- Object InputBarrierProperties (Since: 4.2)
Properties for input-barrier objects.
- Members:
name (
string
) – the screen name as declared in the screens section of barrier.confserver (
string
, optional) – hostname of the Barrier server (default: “localhost”)port (
string
, optional) – TCP port of the Barrier server (default: “24800”)x-origin (
string
, optional) – x coordinate of the leftmost pixel on the guest screen (default: “0”)y-origin (
string
, optional) – y coordinate of the topmost pixel on the guest screen (default: “0”)width (
string
, optional) – the width of secondary screen in pixels (default: “1920”)height (
string
, optional) – the height of secondary screen in pixels (default: “1080”)
- Object InputLinuxProperties (Since: 2.6)
- Availability:
CONFIG_LINUX
Properties for input-linux objects.
- Members:
evdev (
string
) – the path of the host evdev device to usegrab_all (
boolean
, optional) – if true, grab is toggled for all devices (e.g. both keyboard and mouse) instead of just one device (default: false)repeat (
boolean
, optional) – enables auto-repeat events (default: false)grab-toggle (
GrabToggleKeys
, optional) – the key or key combination that toggles device grab (default: ctrl-ctrl)
- Object EventLoopBaseProperties (Since: 7.1)
Common properties for event loops
- Members:
aio-max-batch (
int
, optional) – maximum number of requests in a batch for the AIO engine, 0 means that the engine will use its default. (default: 0)thread-pool-min (
int
, optional) – minimum number of threads reserved in the thread pool (default:0)thread-pool-max (
int
, optional) – maximum number of threads the thread pool can contain (default:64)
- Object IothreadProperties (Since: 2.0)
Properties for iothread objects.
- Members:
poll-max-ns (
int
, optional) – the maximum number of nanoseconds to busy wait for events. 0 means polling is disabled (default: 32768 on POSIX hosts, 0 otherwise)poll-grow (
int
, optional) – the multiplier used to increase the polling time when the algorithm detects it is missing events due to not polling long enough. 0 selects a default behaviour (default: 0)poll-shrink (
int
, optional) – the divisor used to decrease the polling time when the algorithm detects it is spending too long polling without encountering events. 0 selects a default behaviour (default: 0)The members of
EventLoopBaseProperties
.
The
aio-max-batch
option is available since 6.1.
- Object MainLoopProperties (Since: 7.1)
Properties for the main-loop object.
- Members:
The members of
EventLoopBaseProperties
.
- Object MemoryBackendProperties (Since: 2.1)
Properties for objects of classes derived from memory-backend.
- Members:
merge (
boolean
, optional) – if true, mark the memory as mergeable (default depends on the machine type)dump (
boolean
, optional) – if true, include the memory in core dumps (default depends on the machine type)host-nodes (
[
int
]
, optional) – the list of NUMA host nodes to bind the memory topolicy (
HostMemPolicy
, optional) – the NUMA policy (default: ‘default’)prealloc (
boolean
, optional) – if true, preallocate memory (default: false)prealloc-threads (
int
, optional) – number of CPU threads to use for prealloc (default: 1)prealloc-context (
string
, optional) – thread context to use for creation of preallocation threads (default: none) (since 7.2)share (
boolean
, optional) – if false, the memory is private to QEMU; if true, it is shared (default false for backends memory-backend-file and memory-backend-ram, true for backends memory-backend-epc, memory-backend-memfd, and memory-backend-shm)reserve (
boolean
, optional) – if true, reserve swap space (or huge pages) if applicable (default: true) (since 6.1)size (
int
) – size of the memory region in bytesx-use-canonical-path-for-ramblock-id (
boolean
, optional) – if true, the canonical path is used for ramblock-id. Disable this for 4.0 machine types or older to allow migration with newer QEMU versions. (default: false generally, but true for machine types <= 4.0)
Note
prealloc=true and reserve=false cannot be set at the same time. With reserve=true, the behavior depends on the operating system: for example, Linux will not reserve swap space for shared file mappings – “not applicable”. In contrast, reserve=false will bail out if it cannot be configured accordingly.
- Object MemoryBackendFileProperties (Since: 2.1)
Properties for memory-backend-file objects.
- Members:
align (
int
, optional) – the base address alignment when QEMU mmap(2)smem-path
. Some backend stores specified bymem-path
require an alignment different than the default one used by QEMU, e.g. the device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In such cases, users can specify the required alignment via this option. 0 selects a default alignment (currently the page size). (default: 0)offset (
int
, optional) – the offset into the target file that the region starts at. You can use this option to back multiple regions with a single file. Must be a multiple of the page size. (default: 0) (since 8.1)discard-data (
boolean
, optional) – if true, the file contents can be destroyed when QEMU exits, to avoid unnecessarily flushing data to the backing file. Note thatdiscard-data
is only an optimization, and QEMU might not discard file contents if it aborts unexpectedly or is terminated using SIGKILL. (default: false)mem-path (
string
) – the path to either a shared memory or huge page filesystem mountpmem (
boolean
, optional) – specifies whether the backing file specified bymem-path
is in host persistent memory that can be accessed using the SNIA NVM programming model (e.g. Intel NVDIMM).readonly (
boolean
, optional) – if true, the backing file is opened read-only; if false, it is opened read-write. (default: false)rom (
OnOffAuto
, optional) – whether to create Read Only Memory (ROM) that cannot be modified by the VM. Any write attempts to such ROM will be denied. Most use cases want writable RAM instead of ROM. However, selected use cases, like R/O NVDIMMs, can benefit from ROM. If set to ‘on’, create ROM; if set to ‘off’, create writable RAM; if set to ‘auto’, the value of thereadonly
property is used. This property is primarily helpful when we want to have proper RAM in configurations that would traditionally create ROM before this property was introduced: VM templating, where we want to open a file readonly (readonly
set to true) and mark the memory to be private for QEMU (share
set to false). For this use case, we need writable RAM instead of ROM, and want to set this property to ‘off’. (default: auto, since 8.2)The members of
MemoryBackendProperties
.
- Object MemoryBackendMemfdProperties (Since: 2.12)
- Availability:
CONFIG_LINUX
Properties for memory-backend-memfd objects.
- Members:
hugetlb (
boolean
, optional) – if true, the file to be created resides in the hugetlbfs filesystem (default: false)hugetlbsize (
int
, optional) – the hugetlb page size on systems that support multiple hugetlb page sizes (it must be a power of 2 value supported by the system). 0 selects a default page size. This option is ignored ifhugetlb
is false. (default: 0)seal (
boolean
, optional) – if true, create a sealed-file, which will block further resizing of the memory (default: true)The members of
MemoryBackendProperties
.
- Object MemoryBackendShmProperties (Since: 9.1)
- Availability:
CONFIG_POSIX
Properties for memory-backend-shm objects.
This memory backend supports only shared memory, which is the default.
- Members:
The members of
MemoryBackendProperties
.
- Object MemoryBackendEpcProperties (Since: 6.2)
- Availability:
CONFIG_LINUX
Properties for memory-backend-epc objects.
The
merge
boolean option is false by default with epcThe
dump
boolean option is false by default with epc- Members:
The members of
MemoryBackendProperties
.
- Object PrManagerHelperProperties (Since: 2.11)
- Availability:
CONFIG_LINUX
Properties for pr-manager-helper objects.
- Members:
path (
string
) – the path to a Unix domain socket for connecting to the external helper
- Object QtestProperties (Since: 6.0)
Properties for qtest objects.
- Members:
chardev (
string
) – the chardev to be used to receive qtest commands on.log (
string
, optional) – the path to a log file
- Object RemoteObjectProperties (Since: 6.0)
Properties for x-remote-object objects.
- Members:
fd (
string
) – file descriptor name previously passed via ‘getfd’ commanddevid (
string
) – the id of the device to be associated with the file descriptor
- Object VfioUserServerProperties (Since: 7.1)
Properties for x-vfio-user-server objects.
- Members:
socket (
SocketAddress
) – socket to be used by the libvfio-user librarydevice (
string
) – the ID of the device to be emulated at the server
- Object IOMMUFDProperties (Since: 9.0)
Properties for iommufd objects.
- Members:
fd (
string
, optional) – file descriptor name previously passed via ‘getfd’ command, which represents a pre-opened /dev/iommu. This allows the iommufd object to be shared across several subsystems (VFIO, VDPA, …), and the file descriptor to be shared with other process, e.g. DPDK. (default: QEMU opens /dev/iommu by itself)
- Object AcpiGenericInitiatorProperties (Since: 9.0)
Properties for acpi-generic-initiator objects.
- Members:
pci-dev (
string
) – PCI device ID to be associated with the nodenode (
int
) – NUMA node associated with the PCI device
- Object AcpiGenericPortProperties (Since: 9.2)
Properties for acpi-generic-port objects.
- Members:
pci-bus (
string
) – QOM path of the PCI bus of the hostbridge associated with this SRAT Generic Port Affinity Structure. This is the same as the bus parameter for the root ports attached to this host bridge. The resulting SRAT Generic Port Affinity Structure will refer to the ACPI object in DSDT that represents the host bridge (e.g. ACPI0016 for CXL host bridges). See ACPI 6.5 Section 5.2.16.7 for more information.node (
int
) – Similar to a NUMA node ID, but instead of providing a reference point used for defining NUMA distances and access characteristics to memory or from an initiator (e.g. CPU), this node defines the boundary point between non-discoverable system buses which must be described by firmware, and a discoverable bus. NUMA distances and access characteristics are defined to and from that point. For system software to establish full initiator to target characteristics this information must be combined with information retrieved from the discoverable part of the path. An example would use CDAT (see UEFI.org) information read from devices and switches in conjunction with link characteristics read from PCIe Configuration space. To get the full path latency from CPU to CXL attached DRAM CXL device: Add the latency from CPU to Generic Port (from HMAT indexed via the the node ID in this SRAT structure) to that for CXL bus links, the latency across intermediate switches and from the EP port to the actual memory. Bandwidth is more complex as there may be interleaving across multiple devices and shared links in the path.
- Object RngProperties (Since: 1.3)
Properties for objects of classes derived from rng.
- Members:
opened (
boolean
, optional) – if true, the device is opened immediately when applying this option and will probably fail when processing the next option. Don’t use; only provided for compatibility. (default: false)
- Features:
deprecated – Member
opened
is deprecated. Setting true doesn’t make sense, and false is already the default.
- Object RngEgdProperties (Since: 1.3)
Properties for rng-egd objects.
- Members:
chardev (
string
) – the name of a character device backend that provides the connection to the RNG daemonThe members of
RngProperties
.
- Object RngRandomProperties (Since: 1.3)
- Availability:
CONFIG_POSIX
Properties for rng-random objects.
- Members:
filename (
string
, optional) – the filename of the device on the host to obtain entropy from (default: “/dev/urandom”)The members of
RngProperties
.
- Object SevCommonProperties (Since: 9.1)
Properties common to objects that are derivatives of sev-common.
- Members:
sev-device (
string
, optional) – SEV device to use (default: “/dev/sev”)cbitpos (
int
, optional) – C-bit location in page table entry (default: 0)reduced-phys-bits (
int
) – number of bits in physical addresses that become unavailable when SEV is enabledkernel-hashes (
boolean
, optional) – if true, add hashes of kernel/initrd/cmdline to a designated guest firmware page for measured boot with -kernel (default: false) (since 6.2)
- Object SevGuestProperties (Since: 2.12)
Properties for sev-guest objects.
- Members:
dh-cert-file (
string
, optional) – guest owners DH certificate (encoded with base64)session-file (
string
, optional) – guest owners session parameters (encoded with base64)policy (
int
, optional) – SEV policy value (default: 0x1)handle (
int
, optional) – SEV firmware handle (default: 0)legacy-vm-type (
OnOffAuto
, optional) – Use legacy KVM_SEV_INIT KVM interface for creating the VM. The newer KVM_SEV_INIT2 interface, from Linux >= 6.10, syncs additional vCPU state when initializing the VMSA structures, which will result in a different guest measurement. Set this to ‘on’ to force compatibility with older QEMU or kernel versions that rely on legacy KVM_SEV_INIT behavior. ‘auto’ will behave identically to ‘on’, but will automatically switch to using KVM_SEV_INIT2 if the user specifies any additional options that require it. If set to ‘off’, QEMU will require KVM_SEV_INIT2 unconditionally. (default: off) (since 9.1)The members of
SevCommonProperties
.
- Object SevSnpGuestProperties (Since: 9.1)
Properties for sev-snp-guest objects. Most of these are direct arguments for the KVM_SNP_* interfaces documented in the Linux kernel source under Documentation/arch/x86/amd-memory-encryption.rst, which are in turn closely coupled with the SNP_INIT/SNP_LAUNCH_* firmware commands documented in the SEV-SNP Firmware ABI Specification (Rev 0.9).
More usage information is also available in the QEMU source tree under docs/amd-memory-encryption.
- Members:
policy (
int
, optional) – the ‘POLICY’ parameter to the SNP_LAUNCH_START command, as defined in the SEV-SNP firmware ABI (default: 0x30000)guest-visible-workarounds (
string
, optional) – 16-byte, base64-encoded blob to report hypervisor-defined workarounds, corresponding to the ‘GOSVW’ parameter of the SNP_LAUNCH_START command defined in the SEV-SNP firmware ABI (default: all-zero)id-block (
string
, optional) – 96-byte, base64-encoded blob to provide the ‘ID Block’ structure for the SNP_LAUNCH_FINISH command defined in the SEV-SNP firmware ABI (default: all-zero)id-auth (
string
, optional) – 4096-byte, base64-encoded blob to provide the ‘ID Authentication Information Structure’ for the SNP_LAUNCH_FINISH command defined in the SEV-SNP firmware ABI (default: all-zero)author-key-enabled (
boolean
, optional) – true if ‘id-auth’ blob contains the ‘AUTHOR_KEY’ field defined SEV-SNP firmware ABI (default: false)host-data (
string
, optional) – 32-byte, base64-encoded, user-defined blob to provide to the guest, as documented for the ‘HOST_DATA’ parameter of the SNP_LAUNCH_FINISH command in the SEV-SNP firmware ABI (default: all-zero)vcek-disabled (
boolean
, optional) – Guests are by default allowed to choose between VLEK (Versioned Loaded Endorsement Key) or VCEK (Versioned Chip Endorsement Key) when requesting attestation reports from firmware. Set this to true to disable the use of VCEK. (default: false) (since: 9.1)The members of
SevCommonProperties
.
- Object ThreadContextProperties (Since: 7.2)
Properties for thread context objects.
- Members:
cpu-affinity (
[
int
]
, optional) – the list of host CPU numbers used as CPU affinity for all threads created in the thread context (default: QEMU main thread CPU affinity)node-affinity (
[
int
]
, optional) – the list of host node numbers that will be resolved to a list of host CPU numbers used as CPU affinity. This is a shortcut for specifying the list of host CPU numbers belonging to the host nodes manually by settingcpu-affinity
. (default: QEMU main thread affinity)
- Enum ObjectType (Since: 6.0)
- Values:
acpi-generic-initiator – Not documented
acpi-generic-port – Not documented
authz-list – Not documented
authz-listfile – Not documented
authz-pam – Not documented
authz-simple – Not documented
can-bus – Not documented
can-host-socketcan – Not documented
colo-compare – Not documented
cryptodev-backend – Not documented
cryptodev-backend-builtin – Not documented
cryptodev-backend-lkcf – Not documented
cryptodev-vhost-user – Not documented
dbus-vmstate – Not documented
filter-buffer – Not documented
filter-dump – Not documented
filter-mirror – Not documented
filter-redirector – Not documented
filter-replay – Not documented
filter-rewriter – Not documented
input-barrier – Not documented
input-linux – Not documented
iommufd – Not documented
iothread – Not documented
main-loop – Not documented
memory-backend-epc – Not documented
memory-backend-file – Not documented
memory-backend-memfd – Not documented
memory-backend-ram – Not documented
memory-backend-shm – Not documented
pef-guest – Not documented
pr-manager-helper – Not documented
qtest – Not documented
rng-builtin – Not documented
rng-egd – Not documented
rng-random – Not documented
secret – Not documented
secret_keyring – Not documented
sev-guest – Not documented
sev-snp-guest – Not documented
thread-context – Not documented
s390-pv-guest – Not documented
throttle-group – Not documented
tls-creds-anon – Not documented
tls-creds-psk – Not documented
tls-creds-x509 – Not documented
tls-cipher-suites – Not documented
x-remote-object – Not documented
x-vfio-user-server – Not documented
- Features:
unstable – Members
x-remote-object
andx-vfio-user-server
are experimental.
- Object ObjectOptions (Since: 6.0)
Describes the options of a user creatable QOM object.
- Members:
qom-type (
ObjectType
) – the class name for the object to be createdid (
string
) – the name of the new objectWhen
qom-type
isacpi-generic-initiator
: The members ofAcpiGenericInitiatorProperties
.When
qom-type
isacpi-generic-port
: The members ofAcpiGenericPortProperties
.When
qom-type
isauthz-list
: The members ofAuthZListProperties
.When
qom-type
isauthz-listfile
: The members ofAuthZListFileProperties
.When
qom-type
isauthz-pam
: The members ofAuthZPAMProperties
.When
qom-type
isauthz-simple
: The members ofAuthZSimpleProperties
.When
qom-type
iscan-host-socketcan
: The members ofCanHostSocketcanProperties
.When
qom-type
iscolo-compare
: The members ofColoCompareProperties
.When
qom-type
iscryptodev-backend
: The members ofCryptodevBackendProperties
.When
qom-type
iscryptodev-backend-builtin
: The members ofCryptodevBackendProperties
.When
qom-type
iscryptodev-backend-lkcf
: The members ofCryptodevBackendProperties
.When
qom-type
iscryptodev-vhost-user
: The members ofCryptodevVhostUserProperties
.When
qom-type
isdbus-vmstate
: The members ofDBusVMStateProperties
.When
qom-type
isfilter-buffer
: The members ofFilterBufferProperties
.When
qom-type
isfilter-dump
: The members ofFilterDumpProperties
.When
qom-type
isfilter-mirror
: The members ofFilterMirrorProperties
.When
qom-type
isfilter-redirector
: The members ofFilterRedirectorProperties
.When
qom-type
isfilter-replay
: The members ofNetfilterProperties
.When
qom-type
isfilter-rewriter
: The members ofFilterRewriterProperties
.When
qom-type
isinput-barrier
: The members ofInputBarrierProperties
.When
qom-type
isinput-linux
: The members ofInputLinuxProperties
.When
qom-type
isiommufd
: The members ofIOMMUFDProperties
.When
qom-type
isiothread
: The members ofIothreadProperties
.When
qom-type
ismain-loop
: The members ofMainLoopProperties
.When
qom-type
ismemory-backend-epc
: The members ofMemoryBackendEpcProperties
.When
qom-type
ismemory-backend-file
: The members ofMemoryBackendFileProperties
.When
qom-type
ismemory-backend-memfd
: The members ofMemoryBackendMemfdProperties
.When
qom-type
ismemory-backend-ram
: The members ofMemoryBackendProperties
.When
qom-type
ismemory-backend-shm
: The members ofMemoryBackendShmProperties
.When
qom-type
ispr-manager-helper
: The members ofPrManagerHelperProperties
.When
qom-type
isqtest
: The members ofQtestProperties
.When
qom-type
isrng-builtin
: The members ofRngProperties
.When
qom-type
isrng-egd
: The members ofRngEgdProperties
.When
qom-type
isrng-random
: The members ofRngRandomProperties
.When
qom-type
issecret
: The members ofSecretProperties
.When
qom-type
issecret_keyring
: The members ofSecretKeyringProperties
.When
qom-type
issev-guest
: The members ofSevGuestProperties
.When
qom-type
issev-snp-guest
: The members ofSevSnpGuestProperties
.When
qom-type
isthread-context
: The members ofThreadContextProperties
.When
qom-type
isthrottle-group
: The members ofThrottleGroupProperties
.When
qom-type
istls-creds-anon
: The members ofTlsCredsAnonProperties
.When
qom-type
istls-creds-psk
: The members ofTlsCredsPskProperties
.When
qom-type
istls-creds-x509
: The members ofTlsCredsX509Properties
.When
qom-type
istls-cipher-suites
: The members ofTlsCredsProperties
.When
qom-type
isx-remote-object
: The members ofRemoteObjectProperties
.When
qom-type
isx-vfio-user-server
: The members ofVfioUserServerProperties
.
- Command object-add (Since: 2.0)
Create a QOM object.
- Arguments:
The members of
ObjectOptions
.
- Errors:
Error if
qom-type
is not a valid class name
Example:
-> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1", "filename": "/dev/hwrng" } } <- { "return": {} }
- Command object-del (Since: 2.0)
Remove a QOM object.
- Arguments:
id (
string
) – the name of the QOM object to remove
- Errors:
Error if
id
is not a valid id for a QOM object
Example:
-> { "execute": "object-del", "arguments": { "id": "rng1" } } <- { "return": {} }