QEMU-STORAGE-DAEMON-QMP-REF(7)
π qemu-storage-daemon-qmp-ref β the QEMU Storage Daemon QMP Reference Manual π
okay so bestie, welcome to the QEMU Storage Daemon QMP Reference Manual β this is the glow-up doc for the QEMU storage daemon QMP, and it's genuinely a lot, so buckle up π
Here's the whole map, literally everything in this thing:
- Introduction
- Common data types
- Socket data types
- Cryptography
- Background jobs
- Block devices
- Block core (VM unrelated)
- Block device exports
- Character devices
- User authorization
- Transactions
- QMP monitor control
- QMP introspection
- QEMU Object Model (QOM)
β¨ INTRODUCTION β¨
This manual describes the commands and events supported by the QEMU storage daemon QMP. That's it, that's the whole vibe.
For locating a particular item, please see the QSD Index <>. (iykyk β go look it up, it's right there.)
The following notation is used in examples:
Example: -> ... text sent by client (commands) ... <- ... text sent by server (command responses and events) ...
Example text is formatted for readability. However, in real protocol usage, it's commonly emitted as a single line. (yes, one long line, no cap β that's just how the protocol likes it π )
Please refer to the QEMU Machine Protocol Specification <> for the general format of commands, responses, and events. Like, the whole general format situation lives over there, bestie.
π¦ COMMON DATA TYPES π¦
Enum IoOperationType (Since: 2.1)
An enumeration of the I/O operation types. Just the two, that's the whole menu.
Values
readβ read operationwriteβ write operation
Enum OnOffAuto (Since: 2.2)
An enumeration of three options: on, off, and auto. The classic little trio π
Values
autoβ QEMU selects the value betweenonandoffonβ Enabledoffβ Disabled
Enum OnOffSplit (Since: 2.6)
An enumeration of three values: on, off, and split.
Values
onβ Enabledoffβ Disabledsplitβ 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. So like, "no string here" is a whole distinct mood from "didn't say anything at all" β very main character of it honestly.
Alternatives
s(string) β the string valuen(null) β no string value
Enum OffAutoPCIBAR (Since: 2.12)
An enumeration of options for specifying a PCI BAR. Pick your fighter π
Values
offβ The specified feature is disabledautoβ The PCI BAR for the feature is automatically selectedbar0β PCI BAR0 is used for the featurebar1β PCI BAR1 is used for the featurebar2β PCI BAR2 is used for the featurebar3β PCI BAR3 is used for the featurebar4β PCI BAR4 is used for the featurebar5β PCI BAR5 is used for the feature
Enum PCIELinkSpeed (Since: 4.0)
An enumeration of PCIe link speeds in units of GT/s. Go fast, queen β‘
Values
2_5β 2.5GT/s5β 5.0GT/s8β 8.0GT/s16β 16.0GT/s32β 32.0GT/s (since 9.0)64β 64.0GT/s (since 9.0)
Enum PCIELinkWidth (Since: 4.0)
An enumeration of PCIe link width. Width is a vibe too β¨
Values
1β x12β x24β x48β x812β x1216β x1632β x32
Enum HostMemPolicy (Since: 2.1)
Host memory policy types. Where the memory gets to live, basically π
Values
defaultβ restore default policy, remove any nondefault policypreferredβ set the preferred host nodes for allocationbindβ a strict policy that restricts memory allocation to the host nodes specifiedinterleaveβ 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. Which queue is getting the filter, bestie π¬
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. Pick your keyboard combo, make it iconic β¨
Values
ctrl-ctrlβ left and right control keyalt-altβ left and right alt keyshift-shiftβ left and right shift keymeta-metaβ left and right meta keyscrolllockβ scroll lock keyctrl-scrolllockβ either control key and scroll lock key
Object HumanReadableText (Since: 6.2)
For when the output is meant to be, you know, read by a human π
Members
human-readable-text(string) β Formatted output intended for humans.
Enum EndianMode (Since: 10.0)
Which way the bytes go π
Values
unspecifiedβ Endianness not specifiedlittleβ Little endiannessbigβ Big endianness
π SOCKET DATA TYPES π
Ok bestie, this whole section is just how we describe addresses. Like, a socket needs to know where it lives, and there are So Many Flavors. Buckle up. π
β¨ Enum NetworkAddressFamily (Since: 2.1) β¨
It's giving "what kind of address are you, bestie?" β the network address family.
Values
ipv4β the IPV4 family, classic, iconic, still hereipv6β the IPV6 family, the future (allegedly)unixβ unix socket, local vibes onlyvsockβ vsock family (since 2.8)unknownβ otherwise. literally the "idk her" option π
πΈ Object InetSocketAddressBase πΈ
The base-layer glue that the internet-y addresses inherit from, no cap.
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. Yes, a range. She contains multitudes π
Members
numeric(boolean, optional) βtrueif the host/port are guaranteed to be numeric,falseif name resolution should be attempted. Defaults tofalse. (Since 2.9)to(int, optional) β if present, this is a range of possible addresses, with port betweenportandto.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/listening on this socket. (Since 4.2, not supported for listening sockets until 10.1)keep-alive-count(int, optional) β number of keep-alive packets sent before the connection is closed. Only supported for TCP sockets on systems whereTCP_KEEPCNTsocket option is defined (this includes Linux, Windows, macOS, FreeBSD, but not OpenBSD). When set to0, system setting is used. (Since 10.1)keep-alive-idle(int, optional) β time in seconds the connection needs to be idle before sending a keepalive packet. Only supported for TCP sockets on systems whereTCP_KEEPIDLEsocket option is defined (this includes Linux, Windows, macOS, FreeBSD, but not OpenBSD). When set to0, system setting is used. (Since 10.1)keep-alive-interval(int, optional) β time in seconds between keep-alive packets. Only supported for TCP sockets on systems whereTCP_KEEPINTVLis defined (this includes Linux, Windows, macOS, FreeBSD, but not OpenBSD). When set to0, system setting is used. (Since 10.1)mptcp(boolean, optional) β enable multi-path TCP. (Since 6.1)- The members of
InetSocketAddressBase. (yes, she inherits, we love a legacy moment)
Ngl the OpenBSD erasure in those keep-alive notes is sending me π β those three options are TCP-socket-only and defined-option-only, fr fr.
π§ Object UnixSocketAddress (Since: 1.3) π§
Captures a socket address in the local ("Unix socket") namespace. Cozy. Local. No internet drama. π
Members
path(string) β filesystem path to useabstract(boolean, optional) β iftrue, this is a Linux abstract socket address.pathwill be prefixed by a null byte, and optionally padded with null bytes. Defaults tofalse. (Since 5.1)tight(boolean, optional) β iffalse, pad an abstract socket address with enough null bytes to make it fillstruct sockaddr_unmembersun_path. Defaults totrue. (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. (so like, strings now, options later, iykyk β¨)
π Object FdSocketAddress (Since: 1.2) π
A file descriptor name or number. Short king.
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 thegetfd <#command-QMP-misc.getfd>command. Decimal file descriptors are permitted at startup or other contexts where no monitor context is active.
π The Wrapper Objects π
These are literally just little envelopes. One member each. data. That's it. She's a one-trick pony and honestly? Respect. π«Ά
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. The name says legacy bestie, you know what that means π
Members
type(SocketAddressType) β Transport type- When
typeisinet: The members ofInetSocketAddressWrapper. - When
typeisunix: The members ofUnixSocketAddressWrapper. - When
typeisvsock: The members ofVsockSocketAddressWrapper. - When
typeisfd: The members ofFdSocketAddressWrapper.
π₯ Enum SocketAddressType (Since: 2.9) π₯
Available SocketAddress types. The vibe check of addresses.
Values
inetβ Internet addressunixβ Unix domain socketvsockβ VMCI addressfdβ Socket file descriptor
π Object SocketAddress (Since: 2.9) π
Captures the address of a socket, which could also be a socket file descriptor. She's the glow-up version β notice she pulls the non-wrapper types, main character energy only π
Members
type(SocketAddressType) β Transport type- When
typeisinet: The members ofInetSocketAddress. - When
typeisunix: The members ofUnixSocketAddress. - When
typeisvsock: The members ofVsockSocketAddress. - When
typeisfd: The members ofFdSocketAddress.
π CRYPTOGRAPHY π
Locking things down, bestie. This is the whole vault: TLS creds, secrets, hashes, ciphers, IV generation, and full disk encryption formats. Slay but make it secure. π§ββοΈ
π
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. (like, server you and client you are two different girls, ok?)
Values
clientβ the network endpoint is acting as the clientserverβ 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 usedbase64β arbitrary base64 encoded binary data
πΈ Enum QCryptoHashAlgo (Since: 2.6) πΈ
The supported algorithms for computing content digests. Pick your girlies carefully β¨
Values
md5β MD5. Should not be used in any new code, legacy compat onlysha1β SHA-1. Should not be used in any new code, legacy compat onlysha224β 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)
Fr fr:md5andsha1are legacy-compat only. Do not put them in any new code. I'm not gonna be nice about that one π€
π¦ Enum QCryptoCipherAlgo (Since: 2.6) π¦
The supported algorithms for content encryption ciphers. A whole lineup, we stan a diverse cast.
Values
aes-128β AES with 128 bit / 16 byte keysaes-192β AES with 192 bit / 24 byte keysaes-256β AES with 256 bit / 32 byte keysdesβ 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 keysserpent-128β Serpent with 128 bit / 16 byte keysserpent-192β Serpent with 192 bit / 24 byte keysserpent-256β Serpent with 256 bit / 32 byte keystwofish-128β Twofish with 128 bit / 16 byte keystwofish-192β Twofish with 192 bit / 24 byte keystwofish-256β Twofish with 256 bit / 32 byte keyssm4β SM4 with 128 bit / 16 byte keys (since 9.0)
des is right there with a whole "Do not use except in VNC" warning bestie. She's on thin ice π
π Enum QCryptoCipherMode (Since: 2.6) π
The supported modes for content encryption ciphers.
Values
ecbβ Electronic Code Bookcbcβ Cipher Block Chainingxtsβ XEX with tweaked code book and ciphertext stealing (say that five times fast π)ctrβ Counter (Since: 2.8)
π Enum QCryptoIVGenAlgo (Since: 2.6) π
The supported algorithms for generating initialization vectors for full disk encryption.
Okay this one has an actual warning so pay attention: theplaingenerator should not be used for disks with sector numbers larger than2^32, except where compatibility with pre-existing Linuxdm-cryptvolumes is required. Like, only if you must, bestie. β οΈ
Values
plainβ 64-bit sector number truncated to 32-bitsplain64β 64-bit sector numberessivβ 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. (she's a rescue mission, not a lifestyle π«Ά)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 aQCryptoSecretobject providing the decryption key. Mandatory except when probing image for metadata only.
Read that twice: key-secret is optional only in the metadata-probing case. Everywhere else she's required, no exceptions, periodt. π
πΈ Object QCryptoBlockOptionsLUKS (Since: 2.6)
okay so these are the options that apply to the LUKS encryption format π
Members
key-secret(string, optional) β the ID of aQCryptoSecretobject providing the decryption key. Mandatory except when you're just probing an image for metadata only β that's the one lil exception, bestie π«Ά
β¨ Object QCryptoBlockCreateOptionsLUKS (Since: 2.6)
the options that apply to LUKS encryption format initialization β aka when you're making a new one, not opening an old one π
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 to2000. (since 2.8)- plus, obvi, the members of
QCryptoBlockOptionsLUKSβ
π¦ Object QCryptoBlockOpenOptions (Since: 2.6)
the options that are available for all encryption formats when opening an existing volume β it's giving "one interface, many formats" π
Members
- The members of
QCryptoBlockOptionsBase. - When
formatisqcow: the members ofQCryptoBlockOptionsQCow. - When
formatisluks: 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
formatisqcow: the members ofQCryptoBlockOptionsQCow. - When
formatisluks: the members ofQCryptoBlockCreateOptionsLUKS.
π Object QCryptoBlockInfoBase (Since: 2.7)
the common info that applies to all full disk encryption formats, no cap π
Members
format(QCryptoBlockFormat) β the encryption format
π Object QCryptoBlockInfoLUKSSlot (Since: 2.7)
info about the LUKS block encryption key slot options β yes, the slots have lore ποΈ
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)
info about the LUKS block encryption options β the whole glow-up report π«Ά
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)
info about the block encryption options, the general version π¦
Members
- The members of
QCryptoBlockInfoBase. - When
formatisluks: the members ofQCryptoBlockInfoLUKS.
π Enum QCryptoBlockLUKSKeyslotState (Since: 5.1)
defines the state of keyslots that are affected by the update β pick a lane, slot π
Values
activeβ the slots contain the given password and marked as activeinactiveβ 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 a set of keyslots β it's literally the keyslot glow-up/down control panel ποΈ
Members
state(QCryptoBlockLUKSKeyslotState) β the desired state of the keyslotsnew-secret(string, optional) β the ID of aQCryptoSecretobject 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 the password located in theQCryptoSecretwith 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 to2000.keyslot(int, optional) β optional. ID of the keyslot to activate/deactivate.
for keyslot activation, the keyslot should not be active already β this is unsafe to update an active keyslot π β but it's possible if the 'force' parameter is given. If keyslot is not given, the first free keyslot will be written.
for keyslot deactivation, this parameter specifies the exact keyslot to deactivate.
secret(string, optional) β optional. The ID of aQCryptoSecretobject providing the password to use to retrieve the 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 β the "we're changing things, bestie" bundle π
Members
- The members of
QCryptoBlockOptionsBase. - When
formatisluks: the members ofQCryptoBlockAmendOptionsLUKS.
π Object SecretCommonProperties (Since: 2.6)
properties for objects of classes derived from secret-common β the shared secret lore π
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 ifkeyidis given. Ignored ifkeyidis absent.
π Object SecretProperties (Since: 2.6)
properties for secret objects π
Eitherdataorfilemust be provided, but not both. pick one, babe, not both π
Members
data(string, optional) β the associated with the secret from (yeah that's the whole sentence in the source, slay)file(string, optional) β the filename to load the data associated with the secret from- The members of
SecretCommonProperties.
π§ Object SecretKeyringProperties (Since: 5.1)
Availability: CONFIG_SECRET_KEYRING
properties for secret_keyring objects β kernel keyring edition π
Members
serial(int) β serial number that identifies a key to get from the kernel- The members of
SecretCommonProperties.
π¦ Object TlsCredsProperties (Since: 2.5)
properties for objects of classes derived from tls-creds β the whole TLS vibe check π
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 athttps://gnutls.org/manual/html_node/Priority-Strings.html
π Object TlsCredsAnonProperties (Since: 2.5)
properties for tls-creds-anon objects β anonymous creds, iconic, no name needed π
Members
- The members of
TlsCredsProperties.
β Object TlsCredsPskProperties (Since: 3.0)
properties for tls-creds-psk objects β pre-shared key girlies rise ποΈ
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 β certificates, but make it cute π
Members
sanity-check(boolean, optional) β if true, perform some sanity checks before using the credentials (default:true)passwordid(string, optional) β for theserver-key.pemandclient-key.pemfiles which contain sensitive private keys, it is possible to use an encrypted version by providing thepasswordidparameter. This provides the ID of a previously created secret object containing the password for decryption. π₯- The members of
TlsCredsProperties.
Enum QCryptoAkCipherAlgo (Since: 7.1)
Okay so this enum is the supported algorithms for asymmetric encryption ciphers π
Values
rsaβ RSA algorithm π
Enum QCryptoAkCipherKeyType (Since: 7.1)
This one tells you the type of asymmetric keys you're working with, bestie π
Values
publicβ public key πΈprivateβ private key π
Enum QCryptoRSAPaddingAlgo (Since: 7.1)
The padding algorithm for RSA β yes, paddings have lore π
Values
rawβ no padding used πpkcs1βpkcs1#v1.5β
Object QCryptoAkCipherOptionsRSA (Since: 7.1)
This object holds the specific parameters for the RSA algorithm π§
Members
hash-alg(QCryptoHashAlgo) βQCryptoHashAlgoπpadding-alg(QCryptoRSAPaddingAlgo) βQCryptoRSAPaddingAlgoπ
Object QCryptoAkCipherOptions (Since: 7.1)
These are the options that are available for all asymmetric key algorithms when creating a new QCryptoAkCipher β¨
Members
alg(QCryptoAkCipherAlgo) β encryption cipher algorithm π- When
algisrsa: The members ofQCryptoAkCipherOptionsRSA. π¦
β¨ BACKGROUND JOBS β¨
Enum JobType (Since: 1.7)
The vibe check on what kind of background job we're dealing with, bestie.
Values
commitβ block commit job type, seeblock-commitstreamβ block stream job type, seeblock-streammirrorβ drive mirror job type, seedrive-mirrorbackupβ drive backup job type, seedrive-backupcreateβ image creation job type, seeblockdev-create(since 3.0)amendβ image options amend job type, seex-blockdev-amend(since 5.1)snapshot-loadβ snapshot load job type, seesnapshot-load(since 6.0)snapshot-saveβ snapshot save job type, seesnapshot-save(since 6.0)snapshot-deleteβ snapshot delete job type, seesnapshot-delete(since 6.0)
Enum JobStatus (Since: 2.12)
This one's the whole character arc of a job, like its present state in its own little lifetime. Every era of the job's existence lives here.
Values
undefinedβ erroneous, default state. Should not ever be visible. Like fr, if you see this one something went sideways. πcreatedβ the job has been created, but not yet started. Baby job, still in the group chat but hasn't said anything yet.runningβ the job is currently running. Main character era, it's doing the thing.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. So it's basically "i could be done but i'm living here now" energy.standbyβ the job is ready, but paused. Nearly identical topaused. The job may return toreadyor otherwise be canceled.waitingβ the job is waiting for other jobs in the transaction to converge to thewaitingstate. This status will likely not be visible for the last job in a transaction. (The last one never has to wait for anyone, iconic.)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 viajob-finalizeifauto-finalizewas set tofalse. 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. Ifauto-dismisswas set tofalse, the job will remain in this state until it is dismissed viajob-dismiss.nullβ the job is in the process of being dismantled. This state should not ever be visible externally. We don't talk about this one. π
Enum JobVerb (Since: 2.12)
The list of command verbs that can be applied to a job. Like, all the things you're allowed to say to it.
Values
cancelβ seejob-cancelpauseβ seejob-pauseresumeβ seejob-resumeset-speedβ seeblock-job-set-speedcompleteβ seejob-completedismissβ seejob-dismissfinalizeβ seejob-finalizechangeβ seeblock-job-change(since 8.2)
Event JOB_STATUS_CHANGE (Since: 3.0)
Emitted when a job transitions to a different status. It's the job's "not me changing my whole personality rn" moment. β¨
Members
id(string) β the job identifierstatus(JobStatus) β the new job status
Command job-pause (Since: 3.0)
Okay so, this one pauses an active job. π
This command returns immediately after marking the active job for pausing. Pausing an already paused job is an error β yeah, you can't double-pause, that's not a thing.
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. (Little plot twist for you there.)
Arguments
id(string) β the job identifier.
Command job-resume (Since: 3.0)
Resumes a paused job. The "okay come back, i miss you" of commands. π«Ά
This command returns immediately after resuming a paused job. Resuming an already running job is an error.
This command also clears the error status for block-jobs (stream, commit, mirror, backup).
Arguments
id(string) β the job identifier.
Command job-cancel (Since: 3.0)
Instructs an active background job to cancel at the next opportunity. This command returns immediately after marking the active job for cancellation. No waiting around, we just leave a note. π
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. So like, it might just finish anyway. Noted.
Arguments
id(string) β the job identifier.
Command job-complete (Since: 3.0)
Manually trigger completion of an active job in the READY or STANDBY state. Completing the job in any other state is an error β don't try it, it's not that kind of party.
This is supported only for drive mirroring, where it also switches the device to write to the target path only. Note that drive mirroring includes drive-mirror, blockdev-mirror and block-commit job (only in case of "active commit", when the node being committed is used by the guest). The ability to complete is signaled with a BLOCK_JOB_READY event.
This command completes an active background block operation synchronously. The ordering of this command's return with the BLOCK_JOB_COMPLETED event is not defined. Note that if an I/O error occurs during the processing of this command:
- the command itself will fail;
- the error will be processed according to the
rerror/werrorarguments that were specified when starting the operation.
Arguments
id(string) β the job identifier.
Command job-dismiss (Since: 3.0)
Deletes a job that is in the CONCLUDED state. Goodbye, you did great, go rest. π¦
This command only needs to be run explicitly for jobs that don't have automatic dismiss enabled. In turn, automatic dismiss may be enabled only for jobs that have auto-dismiss option, which are drive-backup, blockdev-backup, drive-mirror, blockdev-mirror, block-commit and block-stream. auto-dismiss is enabled by default for these jobs.
This command will refuse to operate on any job that has not yet reached its terminal state, CONCLUDED. For jobs that make use of the 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. One text, whole group chat shows up. π
The command is applicable only to jobs which have auto-finalize option and only when this option is set to false.
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)
All the tea 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-progresstototal-progress. The value is monotonically increasing. So like, it only ever goes up. Respect.total-progress(int) β estimatedcurrent-progressvalue at the completion of the job. This value can arbitrarily change while the job is running, in both directions. Yeah it can go backwards, don't @ me, that's just how it is.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. (Read it with your eyes, not your parser. π )
Command query-jobs (Since: 3.0)
Return information about jobs. The "so what's everyone up to" command.
Return [JobInfo] β a list with info for each active job
πΈ BLOCK DEVICES πΈ
Block core (VM unrelated)
Object SnapshotInfo (Since: 1.3)
Members
id(string) β unique snapshot idname(string) β user chosen namevm-state-size(int) β size of the VM statedate-sec(int) β UTC date of the snapshot in secondsdate-nsec(int) β fractional part in nano seconds to be used withdate-secvm-clock-sec(int) β VM clock relative to boot in secondsvm-clock-nsec(int) β fractional part in nano seconds to be used withvm-clock-secicount(int, optional) β current instruction count. Appears when execution record/replay is enabled. Used for "time-traveling" to match the moment in the recorded execution with the snapshots. This counter may be obtained throughquery-replaycommand (since 5.2) β yes, literally time travel, we said what we said. β
Object ImageInfoSpecificQCow2EncryptionBase (Since: 2.10)
Members
format(BlockdevQcow2EncryptionFormat) β the encryption format, bestie π
Object ImageInfoSpecificQCow2Encryption (Since: 2.10) π
Members
- The members of
ImageInfoSpecificQCow2EncryptionBase. - When
formatisluks: the members ofQCryptoBlockInfoLUKS. β¨
Object ImageInfoSpecificQCow2 (Since: 1.7) π
Members
compat(string) β compatibility leveldata-file(string, optional) β the filename of the external data file that is stored in the image and used as a default for opening the image (since: 4.0)data-file-raw(boolean, optional) βTrueif the external data file must stay valid as a standalone (read-only) raw image without looking at qcow2 metadata (since: 4.0)extended-l2(boolean, optional) βtrueif the image has extended L2 entries; only valid forcompat >= 1.1(since 5.2)lazy-refcounts(boolean, optional) β on or off; only valid forcompat >= 1.1corrupt(boolean, optional) βtrueif the image has been marked corrupt; only valid forcompat >= 1.1(since 2.2)refcount-bits(int) β width of a refcount entry in bits (since 2.3)encrypt(ImageInfoSpecificQCow2Encryption, optional) β details about encryption parameters; only set if image is encrypted (since 2.10)bitmaps([Qcow2BitmapInfo], optional) β A list of qcow2 bitmap details (since 4.0)compression-type(Qcow2CompressionType) β the image cluster compression method (since 5.1)
Object ImageInfoSpecificVmdk (Since: 1.7) π¦
Members
create-type(string) β The create type of VMDK imagecid(int) β Content id of imageparent-cid(int) β Parent VMDK image's cidextents([VmdkExtentInfo]) β List of extent files
Object VmdkExtentInfo (Since: 8.0) πΈ
Information about a VMDK extent file, iykyk π«Ά
Members
filename(string) β Name of the extent fileformat(string) β Extent type (e.g.FLATorSPARSE)virtual-size(int) β Number of bytes covered by this extentcluster-size(int, optional) β Cluster size in bytes (for non-flat extents)compressed(boolean, optional) β Whether this extent contains compressed data
Object ImageInfoSpecificRbd (Since: 6.1) π
Members
encryption-format(RbdImageEncryptionFormat, optional) β Image encryption format. If encryption is enabled for the image (seeencryptedinBlockNodeInfo), this is the actual format in which the image is accessed. If encryption is not enabled, this is the result of probing when the image was opened, to give a suggestion which encryption format could be enabled.
β οΈ Okay so this next bit matters, bestie: probing results can be changed by the guest by writing a (possibly partial) encryption format header to the image, so don't treat this information as trusted if the guest is not trusted. No cap. π
Object ImageInfoSpecificFile (Since: 8.0) π
Members
extent-size-hint(int, optional) β Extent size hint (if available)
Enum ImageInfoSpecificKind (Since: 1.7) β
Values
luksβ Since 2.7rbdβ Since 6.1fileβ Since 8.0qcow2β Not documentedvmdkβ Not documented
Object ImageInfoSpecificQCow2Wrapper (Since: 1.7) π§
Members
data(ImageInfoSpecificQCow2) β image information specific to QCOW2
Object ImageInfoSpecificVmdkWrapper (Since: 6.1) π§
Members
data(ImageInfoSpecificVmdk) β image information specific to VMDK
Object ImageInfoSpecificLUKSWrapper (Since: 2.7) π§
Members
data(QCryptoBlockInfoLUKS) β image information specific to LUKS
Object ImageInfoSpecificRbdWrapper (Since: 6.1) π§
Members
data(ImageInfoSpecificRbd) β image information specific to RBD
Object ImageInfoSpecificFileWrapper (Since: 8.0) π§
Members
data(ImageInfoSpecificFile) β image information specific to files
Object ImageInfoSpecific (Since: 1.7) π
A discriminated record of image format specific information structures. Basically a little pick-your-format situation π
Members
type(ImageInfoSpecificKind) β block driver name- When
typeisqcow2: The members ofImageInfoSpecificQCow2Wrapper. - When
typeisvmdk: The members ofImageInfoSpecificVmdkWrapper. - When
typeisluks: The members ofImageInfoSpecificLUKSWrapper. - When
typeisrbd: The members ofImageInfoSpecificRbdWrapper. - When
typeisfile: The members ofImageInfoSpecificFileWrapper.
Object BlockLimitsInfo π₯
Members
request-alignment(int) β Alignment requirement, in bytes, for offset/length of I/O requests.max-discard(int, optional) β Maximum number of bytes that can be discarded at once. If not present, there is no specific maximum.discard-alignment(int, optional) β Optimal alignment for discard requests in bytes. Note that this doesn't have to be a power of two. If not present, discards don't have a alignment requirement different fromrequest-alignment.max-write-zeroes(int, optional) β Maximum number of bytes that can be zeroed out at once. If not present, there is no specific maximum.write-zeroes-alignment(int, optional) β Optimal alignment for write zeroes requests in bytes. Note that this doesn't have to be a power of two. If not present,write_zeroesdoesn't have a alignment requirement different fromrequest-alignment.opt-transfer(int, optional) β Optimal transfer length in bytes. If not present, there is no preferred size.max-transfer(int, optional) β Maximal transfer length in bytes. If not present, there is no specific maximum.max-hw-transfer(int, optional) β Maximal hardware transfer length in bytes. Applies whenever transfers to the device bypass the kernel I/O scheduler, for example withSG_IO. If not present, there is no specific maximum.max-iov(int) β Maximum number of scatter/gather elementsmax-hw-iov(int, optional) β Maximum number of scatter/gather elements allowed by the hardware. Applies whenever transfers to the device bypass the kernel I/O scheduler, for example withSG_IO. If not present, the hardware limits is unknown andmax-iovis always used.min-mem-alignment(int) β Minimal required memory alignment in bytes for zero-copy I/O to succeed. For unaligned requests, a bounce buffer will be used.opt-mem-alignment(int) β Optimal memory alignment in bytes. This is the alignment used for any buffer allocations QEMU performs internally.
Object BlockNodeInfo (Since: 8.0) π
Information about a QEMU image file β¨
Members
filename(string) β name of the image fileformat(string) β format of the image filevirtual-size(int) β maximum capacity in bytes of the imageactual-size(int, optional) β actual size on disk in bytes of the imagedirty-flag(boolean, optional) βtrueif image is not cleanly closedcluster-size(int, optional) β size of a cluster in bytesencrypted(boolean, optional) βtrueif the image is encryptedcompressed(boolean, optional) βtrueif the image is compressed (Since 1.7)backing-filename(string, optional) β name of the backing filefull-backing-filename(string, optional) β full path of the backing filebacking-filename-format(string, optional) β the format of the backing filesnapshots([SnapshotInfo], optional) β list of VM snapshotslimits(BlockLimitsInfo, optional) β block limits that are used for I/O on the node (Since 10.2)format-specific(ImageInfoSpecific, optional) β structure supplying additional format-specific information (since 1.7)
Object ImageInfo (Since: 1.3) π
Information about a QEMU image file, and potentially its backing image. The way it can justβ¦ have a whole other image behind it π
Members
backing-image(ImageInfo, optional) β info of the backing image- The members of
BlockNodeInfo.
Object BlockChildInfo (Since: 8.0) π¦
Information about all nodes in the block graph starting at some node, annotated with information about that node in relation to its parent. It's giving family tree but make it block devices πΈ
Members
name(string) β Child name of the root node in theBlockGraphInfostruct, in its role as the child of some undescribed parent nodeinfo(BlockGraphInfo) β Block graph information starting at this node
π Object BlockGraphInfo (Since: 8.0)
Okay so this is the full picture of every node in a block (sub)graph, and it comes at you in the form of BlockNodeInfo data. The base BlockNodeInfo struct is holding the info for the (sub)graph's root node, bestie β that's the anchor of the whole thing.
Members π
children([BlockChildInfo]) β array of links to this node's child nodes' information. It's giving family tree, but for block nodes π«Ά- The members of
BlockNodeInfo. β yep, it inherits all of those too, no cap.
π©Ί Object ImageCheck (Since: 1.4)
All the tea about a QEMU image file check. Like, what happened when we went poking at that image.
Members β¨
filename(string) β name of the image file checkedformat(string) β format of the image file checkedcheck-errors(int) β number of unexpected errors occurred during check πimage-end-offset(int, optional) β offset (in bytes) where the image ends. This field is present if the driver for the image format supports itcorruptions(int, optional) β number of corruptions found during the check if any πleaks(int, optional) β number of leaks found during the check if anycorruptions-fixed(int, optional) β number of corruptions fixed during the check if any πleaks-fixed(int, optional) β number of leaks fixed during the check if anytotal-clusters(int, optional) β total number of clusters, this field is present if the driver for the image format supports itallocated-clusters(int, optional) β total number of allocated clusters, this field is present if the driver for the image format supports itfragmented-clusters(int, optional) β total number of fragmented clusters, this field is present if the driver for the image format supports itcompressed-clusters(int, optional) β total number of compressed clusters, this field is present if the driver for the image format supports it
πΊοΈ Object MapEntry (Since: 2.6)
The mapping info that connects a virtual block range to a host file range. Lowkey the translator between two worlds.
Members π¦
start(int) β virtual (guest) offset of the first byte described by this entrylength(int) β the number of bytes of the mapped virtual rangedata(boolean) β reading the image will actually read data from a file (in particular, ifoffsetis present this means that the sectors are not simply preallocated, but contain actual data in raw format)zero(boolean) β whether the virtual blocks read as zeroescompressed(boolean) β true if the data is stored compressed (since 8.2)depth(int) β number of layers (0= top image,1= top image's backing file, ...,n - 1= bottom image (wherenis the number of images in the chain)) before reaching one for which the range is allocatedpresent(boolean) β true if this layer provides the data, false if adding a backing layer could impact this region (since 6.1)offset(int, optional) β if present, the image file stores the data for this range in raw format at the given (host) offsetfilename(string, optional) β filename that is referred to byoffset
πΎ Object BlockdevCacheInfo (Since: 2.3)
Cache mode info for a block device. Basically the vibe check on how it's caching.
Members πΈ
writeback(boolean) β true if writeback mode is enableddirect(boolean) β true if the host page cache is bypassed (O_DIRECT)no-flush(boolean) β true if flush requests are ignored for the device
πΆ Object BlockdevChild (Since: 10.1)
Not me leaving this one without a description β the original literally just gives you the members, so that's what you get, bestie π
Members π
child(string) β The name of the child, for example'file'or'backing'.node-name(string) β The name of the child's block driver node.
π§± Object BlockDeviceInfo (Since: 0.14)
Information about the backing device for a block device. Big one incoming, stay with me π₯
Members π
file(string) β the filename of the backing devicenode-name(string) β the name of the block driver node (Since 2.0)ro(boolean) β true if the backing device was open read-onlydrv(string) β the name of the block format used to open the backing device. As of 0.14 this can be:'blkdebug','bochs','cloop','cow','dmg','file','file','ftp','ftps','host_cdrom','host_device','http','https','luks','nbd','parallels','qcow','qcow2','raw','vdi','vmdk','vpc','vvfat'. Then 2.2:'archipelago'added,'cow'dropped. 2.3:'host_floppy'deprecated. 2.5:'host_floppy'dropped. 2.6:'luks'added. 2.8:'replication'added,'tftp'dropped. 2.9:'archipelago'droppedbacking_file(string, optional) β the name of the backing file (for copy-on-write)backing_file_depth(int) β number of files in the backing file chain (since: 1.2)children([BlockdevChild]) β Information about child block nodes. (since: 10.1)active(boolean) β true if the backend is active; typical cases for inactive backends are on the migration source instance after migration completes and on the destination before it completes. (since: 10.0)encrypted(boolean) β true if the backing device is encrypteddetect_zeroes(BlockdevDetectZeroesOptions) β detect and optimize zero writes (Since 2.1)bps(int) β total throughput limit in bytes per second is specifiedbps_rd(int) β read throughput limit in bytes per second is specifiedbps_wr(int) β write throughput limit in bytes per second is specifiediops(int) β total I/O operations per second is specifiediops_rd(int) β read I/O operations per second is specifiediops_wr(int) β write I/O operations per second is specifiedimage(ImageInfo) β the info of image used (since: 1.6)bps_max(int, optional) β total throughput limit during bursts, in bytes (Since 1.7)bps_rd_max(int, optional) β read throughput limit during bursts, in bytes (Since 1.7)bps_wr_max(int, optional) β write throughput limit during bursts, in bytes (Since 1.7)iops_max(int, optional) β total I/O operations per second during bursts, in bytes (Since 1.7)iops_rd_max(int, optional) β read I/O operations per second during bursts, in bytes (Since 1.7)iops_wr_max(int, optional) β write I/O operations per second during bursts, in bytes (Since 1.7)bps_max_length(int, optional) β maximum length of thebps_maxburst period, in seconds. (Since 2.6)bps_rd_max_length(int, optional) β maximum length of thebps_rd_maxburst period, in seconds. (Since 2.6)bps_wr_max_length(int, optional) β maximum length of thebps_wr_maxburst period, in seconds. (Since 2.6)iops_max_length(int, optional) β maximum length of theiopsburst period, in seconds. (Since 2.6)iops_rd_max_length(int, optional) β maximum length of theiops_rd_maxburst period, in seconds. (Since 2.6)iops_wr_max_length(int, optional) β maximum length of theiops_wr_maxburst period, in seconds. (Since 2.6)iops_size(int, optional) β an I/O size in bytes (Since 1.7)group(string, optional) β throttle group name (Since 2.4)cache(BlockdevCacheInfo) β the cache mode used for the block device (since: 2.3)write_threshold(int) β configured write threshold for the device.0if disabled. (Since 2.3)dirty-bitmaps([BlockDirtyInfo], optional) β dirty bitmaps information (only present if node has one or more dirty bitmaps) (Since 4.2)
Yeah thedrvlist really does say'file'twice in the original and yes we are keeping it, character for character, because that is the assignment π
π Enum BlockDeviceIoStatus (Since: 1.0)
An enumeration of block device I/O status. Just the three moods an I/O operation can be in, honestly.
Values β
okβ The last I/O operation has succeeded β¨failedβ The last I/O operation has failed πnospaceβ The last I/O operation has failed due to a no-space condition π
π§Ό Object BlockDirtyInfo (Since: 1.3)
Block dirty bitmap information. Tracking what's changed, iconic behaviour.
Members π
name(string, optional) β the name of the dirty bitmap (Since 2.4)count(int) β number of dirty bytes according to the dirty bitmapgranularity(int) β granularity of the dirty bitmap in bytes (since 1.4)recording(boolean) β true if the bitmap is recording new writes from the guest. (since 4.0)busy(boolean) β true if the bitmap is in-use by some operation (NBD or jobs) and cannot be modified via QMP or used by another operation. (since 4.0)persistent(boolean) β true if the bitmap was stored on disk, is scheduled to be stored on disk, or both. (since 4.0)inconsistent(boolean, optional) β true if this is a persistent bitmap that got stored improperly π¬. It impliespersistentis true, andrecordingandbusyare false. Basically this bitmap is not usable, bestie. To get rid of it, hit it withblock-dirty-bitmap-remove. (Since 4.0)
β¨ Enum Qcow2BitmapInfoFlags (Since: 4.0)
An enumeration of flags that a bitmap can report to you, the user π«Ά.
Values
in-useβ this flag gets set by any process that's actively modifying the qcow2 file, and it's cleared when the updated bitmap is flushed to the qcow2 image. So if you see this flag on an offline image, that means the bitmap wasn't saved correctly after its last usage π β and it may contain inconsistent data.autoβ the bitmap must reflect all changes of the virtual disk made by any application that would write to this qcow2 file.
π Object Qcow2BitmapInfo (Since: 4.0)
Qcow2 bitmap information, iconic.
Members
name(string) β the name of the bitmapgranularity(int) β granularity of the bitmap in bytesflags([Qcow2BitmapInfoFlags]) β flags of the bitmap
πΈ Object BlockLatencyHistogramInfo (Since: 4.0)
Block latency histogram. It's giving data visualization π .
Members
boundaries([int]) β list of interval boundary values in nanoseconds, all greater than zero and in ascending order. For example, the list[10, 50, 100]produces the following histogram intervals:[0, 10),[10, 50),[50, 100),[100, +inf).bins([int]) β list of io request counts corresponding to histogram intervals, one more element thanboundarieshas. For the example above,binsmay be something like[3, 1, 5, 2], and the corresponding histogram looks like:
5| *
4| *
3| * *
2| * * *
1| * * * *
+------------------
10 50 100
π¦ Object BlockInfo (Since: 0.14)
Block device information. This structure describes a virtual device and the backing device associated with it. Main character energy fr fr.
Members
device(string) β the device name associated with the virtual device.qdev(string, optional) β the qdev ID, or if no ID is assigned, the QOM path of the block device. (since 2.10)type(string) β this field is returned only for compatibility reasons, and it should not be used (it always returns'unknown'). Lowkey a fossil, ignore it π.removable(boolean) β true if the device supports removable media.locked(boolean) β true if the guest has locked this device from having its media removed.tray_open(boolean, optional) β true if the device's tray is open (only present if it has a tray).io-status(BlockDeviceIoStatus, optional) βBlockDeviceIoStatus. Only present if the device supports it and the VM is configured to stop on errors (supported device models:virtio-blk,IDE,SCSIexceptscsi-generic).inserted(BlockDeviceInfo, optional) βBlockDeviceInfodescribing the device if media is present.
β Object BlockMeasureInfo (Since: 2.10)
Image file size calculation information. This structure describes the size requirements for creating a new image file π§.
The size requirements depend on the new image file format. File size always equals virtual disk size for the 'raw' format, even for sparse POSIX files. Compact formats such as 'qcow2' represent unallocated and zero regions efficiently, so file size may be smaller than virtual disk size β¨.
The values are upper bounds that are guaranteed to fit the new image file. Subsequent modification, such as an internal snapshot or further bitmap creation, may require additional space, and that's not covered here π.
Members
required(int) β size required for a new image file, in bytes, when copying just allocated guest-visible contents.fully-allocated(int) β image file size, in bytes, once data has been written to all sectors, when copying just guest-visible contents.bitmaps(int, optional) β additional size required if all the top-level bitmap metadata in the source image were to be copied to the destination; present only when source and destination both support persistent bitmaps. (since 5.1)
π Command query-block (Since: 0.14)
Get a list of BlockInfo for all virtual block devices. Slay.
Arguments
flat(boolean, optional) β omit nested data about the backing image, i.e.BlockInfomember'inserted.image.backing-image'will be absent. Default isfalse. (Since 11.0)
Return [BlockInfo] β a list describing each virtual block device. Filter nodes that were created implicitly are skipped over.
π₯ Example time, bestie:
-> { "execute": "query-block" }
<- {
"return":[
{
"io-status": "ok",
"device":"ide0-hd0",
"locked":false,
"removable":false,
"inserted":{
"ro":false,
"drv":"qcow2",
"encrypted":false,
"file":"disks/test.qcow2",
"backing_file_depth":1,
"bps":1000000,
"bps_rd":0,
"bps_wr":0,
"iops":1000000,
"iops_rd":0,
"iops_wr":0,
"bps_max": 8000000,
"bps_rd_max": 0,
"bps_wr_max": 0,
"iops_max": 0,
"iops_rd_max": 0,
"iops_wr_max": 0,
"iops_size": 0,
"detect_zeroes": "on",
"write_threshold": 0,
"image":{
"filename":"disks/test.qcow2",
"format":"qcow2",
"virtual-size":2048000,
"backing_file":"base.qcow2",
"full-backing-filename":"disks/base.qcow2",
"backing-filename-format":"qcow2",
"snapshots":[
{
"id": "1",
"name": "snapshot1",
"vm-state-size": 0,
"date-sec": 10000200,
"date-nsec": 12,
"vm-clock-sec": 206,
"vm-clock-nsec": 30
}
],
"backing-image":{
"filename":"disks/base.qcow2",
"format":"qcow2",
"virtual-size":2048000
}
}
},
"qdev": "ide_disk",
"type":"unknown"
},
{
"io-status": "ok",
"device":"ide1-cd0",
"locked":false,
"removable":true,
"qdev": "/machine/unattached/device[23]",
"tray_open": false,
"type":"unknown"
},
{
"device":"floppy0",
"locked":false,
"removable":true,
"qdev": "/machine/unattached/device[20]",
"type":"unknown"
},
{
"device":"sd0",
"locked":false,
"removable":true,
"type":"unknown"
}
]
}
π Object BlockDeviceTimedStats (Since: 2.5)
Statistics of a block device during a given interval of time. Numbers go brrr π.
Members
interval_length(int) β interval used for calculating the statistics, in seconds.min_rd_latency_ns(int) β minimum latency of read operations in the defined interval, in nanoseconds.min_wr_latency_ns(int) β minimum latency of write operations in the defined interval, in nanoseconds.min_zone_append_latency_ns(int) β minimum latency of zone append operations in the defined interval, in nanoseconds (since 8.1)min_flush_latency_ns(int) β minimum latency of flush operations in the defined interval, in nanoseconds.max_rd_latency_ns(int) β maximum latency of read operations in the defined interval, in nanoseconds.max_wr_latency_ns(int) β maximum latency of write operations in the defined interval, in nanoseconds.max_zone_append_latency_ns(int) β the maximum latency of zone append ops in the defined interval, in nanoseconds (since 8.1) π¦max_flush_latency_ns(int) β the max latency of flush ops in the defined interval, in nanoseconds. periodt.avg_rd_latency_ns(int) β average latency of read ops in the defined interval, nanoseconds bestie.avg_wr_latency_ns(int) β average latency of write ops in the defined interval, nanoseconds.avg_zone_append_latency_ns(int) β average latency of zone append ops in the defined interval, in nanoseconds (since 8.1) β¨avg_flush_latency_ns(int) β average latency of flush ops in the defined interval, nanoseconds.avg_rd_queue_depth(number) β average number of pending read ops in the defined interval πavg_wr_queue_depth(number) β average number of pending write ops in the defined interval.avg_zone_append_queue_depth(number) β average number of pending zone append ops in the defined interval (since 8.1). π«Ά
πΈ Object BlockDeviceStats (Since: 0.14)
Stats of a virtual block device or a block backing device. It's giving "receipts for your disk" π
Members
rd_bytes(int) β how many bytes the device read.wr_bytes(int) β how many bytes the device wrote.zone_append_bytes(int) β how many bytes the zoned devices appended (since 8.1) πunmap_bytes(int) β how many bytes the device unmapped (Since 4.2).rd_operations(int) β number of read operations the device performed.wr_operations(int) β number of write operations the device performed.zone_append_operations(int) β number of zone append ops performed by the zoned devices (since 8.1) πflush_operations(int) β number of cache flush ops the device performed (since 0.15).unmap_operations(int) β number of unmap ops the device performed (Since 4.2).rd_total_time_ns(int) β total time spent on reads, in nanoseconds (since 0.15).wr_total_time_ns(int) β total time spent on writes, in nanoseconds (since 0.15).zone_append_total_time_ns(int) β total time spent on zone append writes, in nanoseconds (since 8.1).flush_total_time_ns(int) β total time spent on cache flushes, in nanoseconds (since 0.15). π«unmap_total_time_ns(int) β total time spent on unmap ops, in nanoseconds (Since 4.2).wr_highest_offset(int) β the offset right after the greatest byte ever written to the device. The whole point of this one is growable sparse files (likeqcow2) that live on top of a physical device, iykyk.rd_merged(int) β number of read requests that got merged into another request (Since 2.3).wr_merged(int) β number of write requests that got merged into another request (Since 2.3).zone_append_merged(int) β number of zone append requests merged into another request (since 8.1) π₯unmap_merged(int) β number of unmap requests merged into another request (Since 4.2).idle_time_ns(int, optional) β time since the last I/O operation, in nanoseconds. Not me telling you that if this field is absent it means there haven't been any operations yet (Since 2.5). πfailed_rd_operations(int) β number of failed read ops the device performed (Since 2.5).failed_wr_operations(int) β number of failed write ops the device performed (Since 2.5).failed_zone_append_operations(int) β number of failed zone append write ops performed by the zoned devices (since 8.1) πfailed_flush_operations(int) β number of failed flush ops the device performed (Since 2.5).failed_unmap_operations(int) β number of failed unmap ops the device performed (Since 4.2).invalid_rd_operations(int) β number of invalid read ops the device performed (Since 2.5).invalid_wr_operations(int) β number of invalid write ops the device performed (Since 2.5).invalid_zone_append_operations(int) β number of invalid zone append ops performed by the zoned device (since 8.1) πinvalid_flush_operations(int) β number of invalid flush ops the device performed (Since 2.5).invalid_unmap_operations(int) β number of invalid unmap ops the device performed (Since 4.2).account_invalid(boolean) β whether invalid operations get counted in the last access statistics (Since 2.5).account_failed(boolean) β whether failed operations get counted in the latency and last access statistics (Since 2.5). both, bestie πtimed_stats([BlockDeviceTimedStats]) β statistics specific to the set of previously defined intervals of time (Since 2.5).rd_latency_histogram(BlockLatencyHistogramInfo, optional) βBlockLatencyHistogramInfo. (Since 4.0)wr_latency_histogram(BlockLatencyHistogramInfo, optional) βBlockLatencyHistogramInfo. (Since 4.0)zone_append_latency_histogram(BlockLatencyHistogramInfo, optional) βBlockLatencyHistogramInfo. (since 8.1) βflush_latency_histogram(BlockLatencyHistogramInfo, optional) βBlockLatencyHistogramInfo. (Since 4.0)
π§ Object BlockStatsSpecificFile (Since: 4.2)
Stats for the file driver. Very "what happens on the filesystem stays on the filesystem" energy πΈ
Members
discard-nb-ok(int) β how many discard operations the driver pulled off successfully.discard-nb-failed(int) β how many discard operations the driver failed. it happens πdiscard-bytes-ok(int) β how many bytes the driver discarded.
π Object BlockStatsSpecificNvme (Since: 5.2)
NVMe driver stats, for the storage girlies who like it fast π₯
Members
completion-errors(int) β the number of completion errors.aligned-accesses(int) β the number of aligned accesses the driver performed. slay.unaligned-accesses(int) β the number of unaligned accesses the driver performed. chaotic but we respect it π
π Object BlockStatsSpecific (Since: 4.2)
Block driver specific stats β the part where the driver finally gets to be a main character.
Members
driver(BlockdevDriver) β block driver name.- When
driverisfile: the members ofBlockStatsSpecificFile. π - When
driverishost_device: the members ofBlockStatsSpecificFile. (yes, same ones, bestie) - When
driverisnvme: the members ofBlockStatsSpecificNvme. β¨
π¦ Object BlockStats (Since: 0.14)
Statistics of a virtual block device or a block backing device. The full picture, with lore.
Members
device(string, optional) β if the stats are for a virtual block device, this is the name that corresponds to that virtual block device.node-name(string, optional) β the node name of the device. (Since 2.3)qdev(string, optional) β the qdev ID, or, if no ID is assigned, the QOM path of the block device. (since 3.0) π«Άstats(BlockDeviceStats) β aBlockDeviceStatsfor the device.driver-specific(BlockStatsSpecific, optional) β optional driver-specific stats. (Since 4.2)parent(BlockStats, optional) β this describes the file block device if it has one. It recursively contains the statistics of the underlying protocol (e.g. the host file for aqcow2image) π. If there's no underlying protocol, this field is just... omitted.backing(BlockStats, optional) β this describes the backing block device if it has one. (Since 2.0)
π Command query-blockstats (Since: 0.14)
Query the BlockStats for all virtual block devices. Receipts for everyone. π
Arguments
query-nodes(boolean, optional) β if true, the command queries all the block nodes that have a node name, in a list that includes"parent"information but not"backing". If false or omitted, the behavior is as before β query all the device backends, recursively including their"parent"and"backing". Nodes that were created implicitly are skipped over in this mode. (Since 2.3) π
Return [BlockStats] β a list of statistics for each virtual block device.
Example:
okay so this is what an actual query-blockstats round-trip looks like in the wild β the request goes up, and the whole reply comes back like:
-> { "execute": "query-blockstats" }
<- {
"return":[
{
"device":"ide0-hd0",
"parent":{
"stats":{
"wr_highest_offset":3686448128,
"wr_bytes":9786368,
"wr_operations":751,
"rd_bytes":122567168,
"rd_operations":36772
"wr_total_times_ns":313253456
"rd_total_times_ns":3465673657
"flush_total_times_ns":49653
"flush_operations":61,
"rd_merged":0,
"wr_merged":0,
"idle_time_ns":2953431879,
"account_invalid":true,
"account_failed":false
}
},
"stats":{
"wr_highest_offset":2821110784,
"wr_bytes":9786368,
"wr_operations":692,
"rd_bytes":122739200,
"rd_operations":36604
"flush_operations":51,
"wr_total_times_ns":313253456
"rd_total_times_ns":3465673657
"flush_total_times_ns":49653,
"rd_merged":0,
"wr_merged":0,
"idle_time_ns":2953431879,
"account_invalid":true,
"account_failed":false
},
"qdev": "/machine/unattached/device[23]"
},
{
"device":"ide1-cd0",
"stats":{
"wr_highest_offset":0,
"wr_bytes":0,
"wr_operations":0,
"rd_bytes":0,
"rd_operations":0
"flush_operations":0,
"wr_total_times_ns":0
"rd_total_times_ns":0
"flush_total_times_ns":0,
"rd_merged":0,
"wr_merged":0,
"account_invalid":false,
"account_failed":false
},
"qdev": "/machine/unattached/device[24]"
},
{
"device":"floppy0",
"stats":{
"wr_highest_offset":0,
"wr_bytes":0,
"wr_operations":0,
"rd_bytes":0,
"rd_operations":0
"flush_operations":0,
"wr_total_times_ns":0
"rd_total_times_ns":0
"flush_total_times_ns":0,
"rd_merged":0,
"wr_merged":0,
"account_invalid":false,
"account_failed":false
},
"qdev": "/machine/unattached/device[16]"
},
{
"device":"sd0",
"stats":{
"wr_highest_offset":0,
"wr_bytes":0,
"wr_operations":0,
"rd_bytes":0,
"rd_operations":0
"flush_operations":0,
"wr_total_times_ns":0
"rd_total_times_ns":0
"flush_total_times_ns":0,
"rd_merged":0,
"wr_merged":0,
"account_invalid":false,
"account_failed":false
}
}
]
}
πΈ Enum BlockdevOnError (Since: 1.3)
okay so this one is literally the "what do we do when I/O goes wrong" menu π it's an enumeration of possible behaviors for errors on I/O operations, and bestie, the exact meaning depends on whether the I/O was initiated by a guest or by a block job β so keep that in mind, it's giving dual citizenship.
Values
reportβ for guest operations, report the error to the guest; for jobs, cancel the jobignoreβ ignore the error, only report a QMP event (BLOCK_IO_ERRORorBLOCK_JOB_ERROR). The backup, mirror and commit block jobs retry the failing request later and may still complete successfully. The stream block job continues to stream and will complete with an error.enospcβ same as stop on ENOSPC, same as report otherwise.stopβ for guest operations, stop the virtual machine; for jobs, pause the jobautoβ inherit the error handling policy of the backend (since: 2.7)
π¦ Enum MirrorSyncMode (Since: 1.3)
the "what do we copy first" dropdown for the initial synchronization phase of storage mirroring β¨ an enumeration of possible behaviors, and every option hits different.
Values
topβ copies data in the topmost image to the destinationfullβ copies data from all images to the destinationnoneβ only copy data written from now onincrementalβ only copy data described by the dirty bitmap. (since: 2.4)bitmapβ only copy data described by the dirty bitmap. Behavior on completion is determined by theBitmapSyncMode. (since: 4.2)
π Enum BitmapSyncMode (Since: 4.2)
so when you're using a bitmap for data copy operations, this enum is the "how do we sync it tho" enum π«Ά possible behaviors, coming right up.
Values
on-successβ The bitmap is only synced when the operation is successful. This is the behavior always used for incremental backups.neverβ The bitmap is never synchronized with the operation, and is treated solely as a read-only manifest of blocks to copy.alwaysβ The bitmap is always synchronized with the operation, regardless of whether or not the operation was successful.
π Enum MirrorCopyMode (Since: 3.0)
an enumeration whose values tell the mirror block job when to trigger writes to the target β like, the timing of it all, iconic honestly.
Values
backgroundβ copy data in background only.write-blockingβ when data is written to the source, write it (synchronously) to the target as well. In addition, data is copied in background just like inbackgroundmode.
π Object BlockJobInfoMirror (Since: 8.2)
the little extra info packet that's specific to mirror block jobs only π it's a choose-your-own-member situation and there's literally one.
Members
actively-synced(boolean) β Whether the source is actively synced to the target, i.e. same data and new writes are done synchronously to both.
π Object BlockJobInfo (Since: 1.1)
the full vibe check on a long-running block device operation β every field you need to know what it's doing and how far along it is π
Members
type(JobType) β the job type ('stream' for image streaming)device(string) β The job identifier. Originally the device name but other values are allowed since QEMU 2.7len(int) β Estimated offset value at the completion of the job. This value can arbitrarily change while the job is running, in both directions.offset(int) β Progress made until now. The unit is arbitrary and the value can only meaningfully be used for the ratio of offset to len. The value is monotonically increasing.busy(boolean) β false if the job is known to be in a quiescent state, with no pending I/O. (Since 1.3)paused(boolean) β whether the job is paused or, if busy is true, will pause itself as soon as possible. (Since 1.3)speed(int) β the rate limit, bytes per secondio-status(BlockDeviceIoStatus) β the status of the job (since 1.3)ready(boolean) β true if the job may be completed (since 2.2)status(JobStatus) β Current job state/status (since 2.12)auto-finalize(boolean) β Job will finalize itself whenPENDING, moving to theCONCLUDEDstate. (since 2.12)auto-dismiss(boolean) β Job will dismiss itself whenCONCLUDED, and disappear. (since 2.12)error(string, optional) β Error information if the job did not complete successfully. Not set if the job completed successfully. (since 2.12.1)- When
typeismirror: The members ofBlockJobInfoMirror.
π₯ Command query-block-jobs (Since: 1.1)
Return information about long-running block device operations β like, "hey what are all my jobs up to rn" π₯
Return [BlockJobInfo] β a list of job info for each active block job
π Command block_resize (Since: 0.14)
Resize a block image while a guest is running β live resize, no shutdown era π
bestie listen: eitherdeviceornode-namemust be set but not both. Pick a lane, okay? π
Arguments
device(string, optional) β the name of the device to get the image resizednode-name(string, optional) β graph node name to get the image resized (Since 2.0)size(int) β new image size in bytes
Errors
- If
deviceis not a valid block device,DeviceNotFound
Example:
(the example JSON is literally right there in the next chunk β stay with me, bestie β¨)
-> { "execute": "block_resize",
"arguments": { "device": "scratch", "size": 1073741824 } }
<- { "return": {} }
...and that's the block_resize example wrapping up, bestie. Back to business π
Enum NewImageMode (Since: 1.1)
Okay so this little enum is literally just QEMU's little instruction card for how to set the backing file path inside a brand-new image file. That's it. That's the whole job. π
Values
existingβ QEMU should look for an existing image file. Go find it, girly. πabsolute-pathsβ QEMU should create a new image with absolute paths for the backing file. And if there's no backing file available? Then the new image won't be backed either. No backing, no problem. β¨
Object BlockdevSnapshotSync
Heads up bestie, this one has a rule: either device or node-name must be set but not both. Pick one. Not both. I'm serious. π«Ά
Members
device(string, optional) β the name of the device to take a snapshot of.node-name(string, optional) β graph node name to generate the snapshot from (Since 2.0)snapshot-file(string) β the target of the new overlay image. If the file exists, or if it is a device, the overlay will be created in the existing file/device. Otherwise, a new file will be created. Very "if it exists, use it" of it. πsnapshot-node-name(string, optional) β the graph node name of the new image (Since 2.0)format(string, optional) β the format of the overlay image, default is'qcow2'.mode(NewImageMode, optional) β whether and how QEMU should create a new image, default is'absolute-paths'.
Object BlockdevSnapshot (Since: 2.5)
Members
node(string) β device or node name that will have a snapshot taken.overlay(string) β reference to the existing block device that will become the overlay ofnode, as part of taking the snapshot. It must not have a current backing file β and like, you can achieve that by passing"backing": nulltoblockdev-add. Slay. πΈ
Object BackupPerf (Since: 6.0)
Optional parameters for backup. These parameters don't affect functionality β they're purely a performance vibe. But ngl, they may significantly affect performance. So likeβ¦ pay attention. π₯
Members
use-copy-range(boolean, optional) β Use copy offloading. Defaultfalse.max-workers(int, optional) β Maximum number of parallel requests for the sustained background copying process. Doesn't influence copy-before-write operations. Default64.max-chunk(int, optional) β Maximum request length for the sustained background copying process. Doesn't influence copy-before-write operations.0means unlimited. Ifmax-chunkis non-zero then it should not be less than job cluster size, which is calculated as maximum of target image cluster size and64k. Default0.min-cluster-size(int, optional) β Minimum size of blocks used by copy-before-write and background copy operations. Has to be a power of 2. No effect if smaller than the maximum of the target's cluster size and64 KiB. Default0. (Since 9.2)
Object BackupCommon (Since: 4.2)
The shared glow-up that both backup flavors inherit. π
Members
job-id(string, optional) β identifier for the newly-created block job. If omitted, the device name will be used. (Since 2.7)device(string) β the device name or node-name of a root node which should be copied.sync(MirrorSyncMode) β what parts of the disk image should be copied to the destination. Like: all the disk, only the sectors allocated in the topmost image, from a dirty bitmap, or only new I/O. Pick your fighter. βspeed(int, optional) β the maximum speed, in bytes per second. The default is0, for unlimited.bitmap(string, optional) β The name of a dirty bitmap to use. Must be present ifsyncis"bitmap"or"incremental". Can be present ifsyncis"full"or"top". Must not be present otherwise. (Since 2.4 (drive-backup), 3.1 (blockdev-backup))bitmap-mode(BitmapSyncMode, optional) β Specifies the type of data the bitmap should contain after the operation concludes. Must be present if a bitmap was provided, must not be present otherwise. (Since 4.2)compress(boolean, optional) βtrueto compress data, if the target format supports it. (default:false) (since 2.8)on-source-error(BlockdevOnError, optional) β the action to take on an error on the source, default'report'.'stop'and'enospc'can only be used if the block device supports io-status (seeBlockInfo).on-target-error(BlockdevOnError, optional) β the action to take on an error on the target, default'report'(no limitations, since this applies to a different block device thandevice).on-cbw-error(OnCbwError, optional) β policy defining behavior on I/O errors in copy-before-write jobs; defaults tobreak-guest-write. (Since 10.1)auto-finalize(boolean, optional) β Whenfalse, this job will wait in a PENDING state after it has finished its work, waiting forjob-finalizebefore making any block graph changes. Whentrue, this job will automatically perform its abort or commit actions. Defaults totrue. (Since 2.12)auto-dismiss(boolean, optional) β Whenfalse, this job will wait in a CONCLUDED state after it has completely ceased all work, and awaitsjob-dismiss. Whentrue, this job will automatically disappear without user intervention. Defaults totrue. (Since 2.12)filter-node-name(string, optional) β the node name that should be assigned to the filter driver that the backup job inserts into the graph abovenodespecified bydrive. If this option is not given, a node name is autogenerated. (Since: 4.2)discard-source(boolean, optional) β Discard blocks on source which have already been copied to the target. (Since 9.1)x-perf(BackupPerf, optional) β Performance options. (Since 6.0)
Features
unstableβ Memberx-perfis experimental. It's giving "we're still cooking" π§
Note:on-source-errorandon-target-erroronly affect background I/O. If an error occurs during a guest write request, the device'srerror/werroractions will be used. So like, don't blame these two for everything, okay? π
Object DriveBackup (Since: 1.6)
Members
target(string) β the target of the new image. If the file exists, or if it is a device, the existing file/device will be used as the new destination. If it does not exist, a new file will be created.format(string, optional) β the format of the new destination, default is to probe ifmodeis'existing', else the format of the sourcemode(NewImageMode, optional) β whether and how QEMU should create a new image, default is'absolute-paths'.- The members of
BackupCommon. (Look up, bestie, they're all right there π)
Object BlockdevBackup (Since: 2.3)
Members
target(string) β the device name or node-name of the backup target node.- The members of
BackupCommon.
Command blockdev-snapshot-sync (Since: 0.14)
Takes a synchronous snapshot of a block device. Syn-chro-nous. It waits. Iconic behavior honestly. π
Arguments
- The members of
BlockdevSnapshotSync.
Errors
- If
deviceis not a valid block device,DeviceNotFound
Example:
-> { "execute": "blockdev-snapshot-sync",
"arguments": { "device": "ide-hd0",
"snapshot-file":
"/some/place/my-image",
"format": "qcow2" } }
<- { "return": {} }
Command blockdev-snapshot (Since: 2.5)
Takes a snapshot of a block device.
So here's the tea: it takes a snapshot by installing 'node' as the backing image of 'overlay'. And on top of that, if 'node' is associated with a block device, the block device changes to using 'overlay' as its new active image. Main character energy, truly. π¦
Arguments
- The members of
BlockdevSnapshot.
Features
allow-write-only-overlayβ If present, the check whether this operation is safe was relaxed so that it can be used to change backing file of a destination of ablockdev-mirror. (since 5.0)
Example:
-> { "execute": "blockdev-add",
"arguments": { "driver": "qcow2",
"node-name": "node1534",
"file": { "driver": "file",
"filename": "hd1.qcow2" },
"backing": null } }
<- { "return": {} }
-> { "execute": "blockdev-snapshot",
"arguments": { "node": "ide-hd0",
"overlay": "node1534" } }
<- { "return": {} }
Command change-backing-file (Since: 2.1)
Change the backing file in the image file metadata. Important caveat bestie, lowkey crucial: this does not cause QEMU to reopen the image file to reparse the backing filename. (It may, however, perform a reopen to change permissions from r/o -> r/w -> r/o, if needed.) The new backing file string is written into the image file metadata, and the QEMU internal strings are updated. π
Arguments
β¦
image-node-name(string) β the name of the block driver state node of the image you wanna mess with π . Thedeviceargument gets used to double-check thatimage-node-nameis actually in the chain thatdevicedescribes β like, no sneaking random nodes in, bestie.device(string) β the device name, or the node-name of the root node that ownsimage-node-name.backing-file(string) β the string that gets written as the backing file. Heads up: this string is not validated π«£ so be careful what you put here, or the image chain might not be reopenable later. Not a drill.
Errors
- If
devicedoesn't exist or can't be determined βDeviceNotFound
π Command block-commit (Since: 1.3)
Live commit of data from overlay image nodes down into backing nodes β like, it literally writes the data between top and base into base. Very "tidying up my room by shoving everything into the closet" energy π§Ήβ¨
If top == base, that's an error, periodt. And if top has no overlays sitting on top of it, or if it's in use by a writer, the job will not finish by itself β you, the user, have to complete it with the job-complete command after you get the ready event. (Since 2.0) π
If the base image is smaller than top, then base gets resized to be the same size as top. If top is smaller than base, base does not get truncated. If you want the base image size to match the smaller top, you can safely truncate it yourself once the commit operation has successfully completed β but only then, okay? π«Ά
Arguments
job-id(string, optional) β identifier for the newly-created block job. If you omit it, the device name gets used instead. (Since 2.7)device(string) β the device name or node-name of a root node.base-node(string, optional) β the node name of the backing image to write data into. If you don't specify it, it's the deepest backing image. (since: 3.1)base(string, optional) β same asbase-node, except it's a file name instead of a node name. This has to be the exact filename string that was used to open the node; other strings β even ones pointing at the same actual file β are not accepted π€top-node(string, optional) β the node name of the backing image within the image chain that contains the topmost data to be committed down. If not specified, it's the active layer. (since: 3.1)top(string, optional) β same astop-node, except it's a file name rather than a node name. Again: this must be the exact filename string used to open the node; other strings, even if they address the same file, are not accepted π ββοΈbacking-file(string, optional) β
The backing file string to write into the overlay image of top. If top doesn't have an overlay image, or if top is in use by a writer, specifying a backing file string is an error.
This filename is not validated. If a pathname string is such that it can't be resolved by QEMU, that means any subsequent QMP or HMP commands must use node-names for that image, because filename lookup methods will fail π
If you don't specify it, QEMU will automatically figure out the backing file string to use β or error out if there's no obvious choice. So be careful when specifying the string: give a valid filename or protocol. (Since 2.1)
backing-mask-protocol(boolean, optional) β if true, replaces any protocol mentioned in the 'backing file format' withraw, rather than storing the protocol name as the backing format. Works even when no image header will be updated (defaultfalse; since 9.0).speed(int, optional) β the maximum speed, in bytes per second.on-error(BlockdevOnError, optional) β the action to take on an error.'ignore'means the request should be retried. (default:report; since: 5.0)filter-node-name(string, optional) β the node name that should be assigned to the filter driver that the commit job inserts into the graph abovetop. If you don't give this option, a node name gets autogenerated. (Since: 2.9)auto-finalize(boolean, optional) β when false, this job waits in aPENDINGstate after it's finished its work, waiting forjob-finalizebefore making any block graph changes. When true, the job automatically performs its abort or commit actions. Defaults totrue. (Since 3.1)auto-dismiss(boolean, optional) β when false, this job waits in aCONCLUDEDstate after it has completely ceased all work, and awaitsjob-dismiss. When true, this job automatically disappears without any user intervention. Defaults totrue. (Since 3.1)
Features
deprecatedβ thebaseandtopmembers are deprecated π« usebase-nodeandtop-nodeinstead.
Errors
- If
devicedoesn't exist βDeviceNotFound
Example:
-> { "execute": "block-commit",
"arguments": { "device": "virtio0",
"top": "/tmp/snap1.qcow2" } }
<- { "return": {} }
β οΈ Command drive-backup (Since: 1.6)
π¨ This command is deprecated. Like, fully. Use blockdev-backup instead, bestie.
Start a point-in-time copy of a block device to a new destination. You can check on the status of ongoing drive-backup operations with query-block-jobs, where the BlockJobInfo.type field has the value 'backup' π And you can stop the operation before it finishes using the job-cancel or block-job-cancel command.
Arguments
- The members of
DriveBackup.
Features
deprecatedβ This command is deprecated. Useblockdev-backupinstead.
Errors
- If
deviceisn't a valid block device βGenericError
Example:
-> { "execute": "drive-backup",
"arguments": { "device": "drive0",
"sync": "full",
"target": "backup.img" } }
<- { "return": {} }
β¨ Command blockdev-backup (Since: 2.3)
Start a point-in-time copy of a block device to a new destination β the shiny non-deprecated one π Status of ongoing blockdev-backup operations can be checked with query-block-jobs, where the BlockJobInfo.type field has the value 'backup'. And yep, you can stop it before it's done with the job-cancel or block-job-cancel command.
Arguments
- The members of
BlockdevBackup.
Errors
- If
deviceisn't a valid block device βDeviceNotFound
Example:
-> { "execute": "blockdev-backup",
"arguments": { "device": "src-id",
"sync": "full",
"target": "tgt-id" } }
<- { "return": {} }
πΈ Command query-named-block-nodes (Since: 2.0)
Get the named block driver list π β literally just hands you the list, no cap.
Arguments
flat(boolean, optional) β omit the nested data about the backing image (the"backing-image"key) if true. Default isfalse(Since 5.0).
Return
[BlockDeviceInfo]
Example:
-> { "execute": "query-named-block-nodes" }
<- { "return": [ { "ro":false,
"drv":"qcow2",
"encrypted":false,
"file":"disks/test.qcow2",
"node-name": "my-node",
"backing_file_depth":1,
"detect_zeroes":"off",
"bps":1000000,
"bps_rd":0,
"bps_wr":0,
"iops":1000000,
"iops_rd":0,
"iops_wr":0,
"bps_max": 8000000,
"bps_rd_max": 0,
"bps_wr_max": 0,
"iops_max": 0,
"iops_rd_max": 0,
"iops_wr_max": 0,
"iops_size": 0,
"write_threshold": 0,
"image":{
"filename":"disks/test.qcow2",
"format":"qcow2",
"virtual-size":2048000,
"backing_file":"base.qcow2",
"full-backing-filename":"disks/base.qcow2",
"backing-filename-format":"qcow2",
"snapshots":[
{
"id": "1",
"name": "snapshot1",
"vm-state-size": 0,
"date-sec": 10000200,
"date-nsec": 12,
"vm-clock-sec": 206,
"vm-clock-nsec": 30
}
],
"backing-image":{
"filename":"disks/base.qcow2",
"format":"qcow2",
"virtual-size":2048000
}
} } ] }
okay so that was the full return payload β look at her, she's gorgeous, she's thorough, she has everything. π
β¨ Enum XDbgBlockGraphNodeType (Since: 4.0) β¨
so this one's just a lil tag that says what kinda thing a graph node is π
Values
block-backendβ corresponds toBlockBackendblock-jobβ corresponds toBlockJobblock-driverβ corresponds toBlockDriverState
π¦ Object XDbgBlockGraphNode (Since: 4.0) π¦
a single node in the block graph, bestie. like a little dot on the map πΊοΈ
Members
id(int) β Block graph node identifier. This id is generated only forx-debug-query-block-graphand does not relate to any other identifiers in QEMU. (she's her own main character, no cap)type(XDbgBlockGraphNodeType) β Type of graph node. Can be one ofblock-backend,block-joborblock-driver-state.name(string) β Human readable name of the node. Corresponds tonode-nameforblock-driver-statenodes; is not guaranteed to be unique in the whole graph (withblock-jobsandblock-backends). so likeβ¦ don't assume two nodes with the same name are the same node, mmkay? π
π Enum BlockPermission (Since: 4.0) π
"Enum of base block permissions." β the permission slips of the block world, fr fr π«
Values
consistent-readβ A user that has the "permission" of consistent reads is guaranteed that their view of the contents of the block device is complete and self-consistent, representing the contents of a disk at a specific point. For most block devices (including their backing files) this is true, but the property cannot be maintained in a few situations like for intermediate nodes of a commit block job. (tl;dr: usually promised, occasionally not β she's honest about it π)writeβ This permission is required to change the visible disk contents.write-unchangedβ This permission (which is weaker thanBLK_PERM_WRITE) is both enough and required for writes to the block node when the caller promises that the visible disk content doesn't change. As theBLK_PERM_WRITEpermission is strictly stronger, either is sufficient to perform an unchanging write.resizeβ This permission is required to change the size of a block node.
πΈ Object XDbgBlockGraphEdge (Since: 4.0) πΈ
"Block Graph edge description for x-debug-query-block-graph." β it's the line connecting two dots, the situationship between two nodes π
Members
parent(int) β parent idchild(int) β child idname(string) β name of the relation (examples are'file'and'backing')perm([BlockPermission]) β granted permissions for the parent operating on the childshared-perm([BlockPermission]) β permissions that can still be granted to other users of the child while it is still attached to this parent
π₯ Object XDbgBlockGraph (Since: 4.0) π₯
"Block Graph - list of nodes and list of edges." β the whole friend group, honestly π«Ά
Members
nodes([XDbgBlockGraphNode]) β Not documentededges([XDbgBlockGraphEdge]) β Not documented
not documented is so real of them honestly. sometimes the mystery IS the lore.
β Command x-debug-query-block-graph (Since: 4.0) β
This command is unstable/experimental.
Get the block graph.
Return XDbgBlockGraph
Features
unstableβ This command is meant for debugging.
so likeβ¦ it's a debug tool, it's experimental, it's unstable. use it, love it, but don't build your whole personality on it π
π Command drive-mirror (Since: 1.3) π
Start mirroring a block device's writes to a new destination. target specifies the target of the new image. If the file exists, or if it is a device, it will be used as the new destination for writes. If it does not exist, a new file will be created. format specifies the format of the mirror image, default is to probe if mode='existing', else the format of the source.
Arguments
- The members of
DriveMirror.
Errors
- If
deviceis not a valid block device,GenericError
Example:
-> { "execute": "drive-mirror",
"arguments": { "device": "ide-hd0",
"target": "/some/place/my-image",
"sync": "full",
"format": "qcow2" } }
<- { "return": {} }
π Object DriveMirror (Since: 1.3) π
"A set of parameters describing drive mirror setup." β the settings menu for your mirroring moment β¨
Members
job-id(string, optional) β identifier for the newly-created block job. If omitted, the device name will be used. (Since 2.7)device(string) β the device name ornode-nameof a root node whose writes should be mirrored.target(string) β the target of the new image. If the file exists, or if it is a device, the existing file/device will be used as the new destination. If it does not exist, a new file will be created.format(string, optional) β the format of the new destination, default is to probe ifmodeis'existing', else the format of the sourcenode-name(string, optional) β the new block driver state node name in the graph (Since 2.1)replaces(string, optional) β withsync=fullgraph node name to be replaced by the new image when a whole image copy is done. This can be used to repair broken Quorum files. By default,deviceis replaced, although implicitly created filters on it are kept. (Since 2.1)mode(NewImageMode, optional) β whether and how QEMU should create a new image, default is'absolute-paths'.speed(int, optional) β the maximum speed, in bytes per secondsync(MirrorSyncMode) β what parts of the disk image should be copied to the destination (all the disk, only the sectors allocated in the topmost image, or only new I/O).granularity(int, optional) β granularity of the dirty bitmap, default is64Kif the image format doesn't have clusters,4Kif the clusters are smaller than that, else the cluster size. Must be a power of 2 between512and64M(since 1.4). likeβ¦ the vibes must be a power of two, no exceptions π§buf-size(int, optional) β maximum amount of data in flight from source to target (since 1.4).on-source-error(BlockdevOnError, optional) β the action to take on an error on the source, default'report'.'stop'and'enospc'can only be used if the block device supportsio-status(seeBlockInfo).on-target-error(BlockdevOnError, optional) β the action to take on an error on the target, default'report'(no limitations, since this applies to a different block device thandevice).unmap(boolean, optional) β Whether to try to unmap target sectors where source has only zero. If true, and target unallocated sectors will read as zero, target image sectors will be unmapped; otherwise, zeroes will be written. Both will result in identical contents. Default is true. (Since 2.4)copy-mode(MirrorCopyMode, optional) β when to copy data to the destination; defaults to'background'(Since: 3.0)auto-finalize(boolean, optional) β When false, this job will wait in aPENDINGstate after it has finished its work, waiting forjob-finalizebefore making any block graph changes. When true, this job will automatically perform its abort or commit actions. Defaults to true. (Since 3.1)auto-dismiss(boolean, optional) β bestie, when this isfalsethe job justβ¦ sits there in aCONCLUDEDstate after it's fully finished all its work, vibing and waiting forjob-dismissto come get it. Whentrue, it dips automatically, no user intervention needed. Defaults totrue. (Since 3.1)
πΈ Object BlockDirtyBitmap (Since: 2.4) πΈ
Members
node(string) β the name of the device/node that this bitmap is out here tracking, periodtname(string) β the name of the dirty bitmap π
π Object BlockDirtyBitmapAdd (Since: 2.4) π
Members
node(string) β name of the device/node that the bitmap is trackingname(string) β the name of the dirty bitmap (and heads up, it must be less than 1024 bytes)granularity(int, optional) β the bitmap granularity; default is64kforblock-dirty-bitmap-addpersistent(boolean, optional) β the bitmap is persistent, like it's saved to the corresponding block device image file when it closes. For now only Qcow2 disks support persistent bitmaps, iykyk. Default isfalseforblock-dirty-bitmap-add. β οΈ This fails if the node is read-only or inactive, because such a bitmap could never be stored β it's giving "no thoughts, no storage".disabled(boolean, optional) β the bitmap gets created in the disabled state, meaning it will not track drive changes. You can enable it later withblock-dirty-bitmap-enable. Default isfalse. (Since: 4.0)
β¨ Alternate BlockDirtyBitmapOrStr (Since: 4.1) β¨
Alternatives
local(string) β name of the bitmap, attached to the same node as the target bitmapexternal(BlockDirtyBitmap) β bitmap with a specified node
π¦ Object BlockDirtyBitmapMerge (Since: 4.0) π¦
Members
node(string) β name of the device/node that the target bitmap is trackingtarget(string) β name of the destination dirty bitmapbitmaps([BlockDirtyBitmapOrStr]) β name(s) of the source dirty bitmap(s) atnodeand/or fully specifiedBlockDirtyBitmapelements. The latter are supported since 4.1. π
π Command block-dirty-bitmap-add (Since: 2.4) π
Create a dirty bitmap with a name on the node, and start tracking the writes. Main character behavior fr.
Arguments
- The members of
BlockDirtyBitmapAdd.
Errors
- If
nodeis not a valid block device or node βDeviceNotFound - If
nameis already taken βGenericError
Example:
-> { "execute": "block-dirty-bitmap-add",
"arguments": { "node": "drive0", "name": "bitmap0" } }
<- { "return": {} }
π₯ Command block-dirty-bitmap-remove (Since: 2.4) π₯
Stop write tracking and remove the dirty bitmap that was created with block-dirty-bitmap-add. And if the bitmap is persistent, remove it from its storage too β like fully clearing it out, no leftovers. π§Ή
Arguments
- The members of
BlockDirtyBitmap.
Errors
- If
nodeis not a valid block device or node βDeviceNotFound - If
nameis not found βGenericError - If
nameis frozen by an operation βGenericError
Example:
-> { "execute": "block-dirty-bitmap-remove",
"arguments": { "node": "drive0", "name": "bitmap0" } }
<- { "return": {} }
π Command block-dirty-bitmap-clear (Since: 2.4) π
Clear (reset) a dirty bitmap on the device, so that an incremental backup from this point in time forward will only backup clusters modified after this clear operation. Like a fresh start, a glow-up for your bitmap. β¨
Arguments
- The members of
BlockDirtyBitmap.
Errors
- If
nodeis not a valid block device βDeviceNotFound - If
nameis not found βGenericError
Example:
-> { "execute": "block-dirty-bitmap-clear",
"arguments": { "node": "drive0", "name": "bitmap0" } }
<- { "return": {} }
π Command block-dirty-bitmap-enable (Since: 4.0) π
Enables a dirty bitmap so that it will begin tracking disk changes. Wake up babe, the bitmap is back on duty. π
Arguments
- The members of
BlockDirtyBitmap.
Errors
- If
nodeis not a valid block device βDeviceNotFound - If
nameis not found βGenericError
Example:
-> { "execute": "block-dirty-bitmap-enable",
"arguments": { "node": "drive0", "name": "bitmap0" } }
<- { "return": {} }
π«Ά Command block-dirty-bitmap-disable (Since: 4.0) π«Ά
Disables a dirty bitmap so that it will stop tracking disk changes. It's taking a little nap, respect it. π΄
Arguments
- The members of
BlockDirtyBitmap.
Errors
- If
nodeis not a valid block device βDeviceNotFound - If
nameis not found βGenericError
Example:
-> { "execute": "block-dirty-bitmap-disable",
"arguments": { "node": "drive0", "name": "bitmap0" } }
<- { "return": {} }
π Command block-dirty-bitmap-merge (Since: 4.0) π
Merge the dirty bitmaps listed in bitmaps into the target dirty bitmap. Dirty bitmaps in bitmaps will be unchanged β except if one of them also appears as the target bitmap. Any bits already set in target will still be set after the merge, i.e. this operation does not clear the target. And on error, target is unchanged. No cap. π«‘
The resulting bitmap will count as dirty any clusters that were dirty in any of the source bitmaps. This can be used to achieve backup checkpoints, or, in simpler usages, to copy bitmaps. Iconic multitasking tbh.
Arguments
- The members of
BlockDirtyBitmapMerge.
Errors
- If
nodeis not a valid block device βDeviceNotFound - If any bitmap in
bitmapsortargetis not found βGenericError - If any of the bitmaps have different sizes or granularities β
GenericError
Example:
-> { "execute": "block-dirty-bitmap-merge",
"arguments": { "node": "drive0", "target": "bitmap0",
"bitmaps": ["bitmap1"] } }
<- { "return": {} }
β Object BlockDirtyBitmapSha256 (Since: 2.10) β
SHA256 hash of dirty bitmap data. Very "I hashed it for science" energy.
Members
sha256(string) β ASCII representation of the SHA256 bitmap hash
π Command x-debug-block-dirty-bitmap-sha256 (Since: 2.10) π
β οΈ This command is unstable/experimental. Like, handle with care bestie.
Get bitmap SHA256.
Arguments
- The members of
BlockDirtyBitmap.
Features
unstableβ This command is meant for debugging.
Return BlockDirtyBitmapSha256
Errors
- If
nodeis not a valid block device βDeviceNotFound - If
nameis not found or if hashing has failed βGenericError
πΈ Command blockdev-mirror (Since: 2.6) πΈ
Start mirroring a block device's writes to a new destination. It's giving "copy me but make it live". πͺ
Arguments
job-id(string, optional) β identifier for the newly-created block job. If you omit it, the device name gets used instead. (Since 2.7)device(string) β the device name or node-name of a root node whose writes should be mirroredtarget(string) β theidor node-name of the block device to mirror to. π¨ This mustn't be attached to the guest.replaces(string, optional) β withsync=full, the graph node name to be replaced by the new image when a whole image copy is done. This can be used to repair broken Quorum files, which is lowkey iconic. By default,deviceis replaced, although implicitly created filters on it are kept.speed(int, optional) β the maximum speed, in bytes per secondsync(MirrorSyncMode) β what parts of the disk image should be copied to the destination (all the disk, only the sectors allocated in the topmost image, or only new I/O)granularity(int, optional) β granularity of the dirty bitmap. Default is64Kif the image format doesn't have clusters,4Kif the clusters are smaller than that, else the cluster size. Must be a power of 2 between512and64M.buf-size(int, optional) β maximum amount of data in flight from source to targeton-source-error(BlockdevOnError, optional) β the action to take on an error on the source, default'report'.'stop'and'enospc'can only be used if the block device supportsio-status(seeBlockInfo).on-target-error(BlockdevOnError, optional) β the action to take on an error on the target, default'report'(no limitations, since this applies to a different block device thandevice)filter-node-name(string, optional) β the node name that should be assigned to the filter driver that the mirror job inserts into the graph abovedevice. If this option is not given, a node name is autogenerated. (Since: 2.9)copy-mode(MirrorCopyMode, optional) β when to copy data to the destination; defaults to'background'(Since: 3.0)auto-finalize(boolean, optional) β whenfalse, this job will wait in aPENDINGstate after it has finished its work, waiting forjob-finalizebefore making any block graph changes. Whentrue, this job will automatically perform its abort or commit actions. Defaults totrue. (Since 3.1)auto-dismiss(boolean, optional) β so when you set this tofalse, the job justβ¦ sits there in aCONCLUDEDstate once it's fully done with all its work, lowkey waiting for you to come dismiss it withjob-dismiss. Set it totrueand the job dips out on its own, no user intervention needed. Defaults totrue. (Since 3.1) β¨target-is-zero(boolean, optional) β tells QEMU to assume the destination already reads as all zeroes before the mirror even started. Flipping this totruecan speed up the mirror, bestie. But β οΈ if the destination is not actually all zero, setting this totruecan corrupt the destination β no cap, that's the whole warning. (Since 10.1)
Example:
-> { "execute": "blockdev-mirror",
"arguments": { "device": "ide-hd0",
"target": "target0",
"sync": "full" } }
<- { "return": {} }
π Object BlockIOThrottle (Since: 1.1)
A whole little bundle of parameters that describes block throttling. It's giving "how hard am I allowed to yeet I/O at this thing" energy.
Members
device(string, optional) β block device nameid(string, optional) β the name or QOM path of the guest device (since: 2.8)bps(int) β total throughput limit in bytes per secondbps_rd(int) β read throughput limit in bytes per secondbps_wr(int) β write throughput limit in bytes per secondiops(int) β total I/O operations per secondiops_rd(int) β read I/O operations per secondiops_wr(int) β write I/O operations per secondbps_max(int, optional) β total throughput limit during bursts, in bytes (Since 1.7)bps_rd_max(int, optional) β read throughput limit during bursts, in bytes (Since 1.7)bps_wr_max(int, optional) β write throughput limit during bursts, in bytes (Since 1.7)iops_max(int, optional) β total I/O operations per second during bursts, in bytes (Since 1.7)iops_rd_max(int, optional) β read I/O operations per second during bursts, in bytes (Since 1.7)iops_wr_max(int, optional) β write I/O operations per second during bursts, in bytes (Since 1.7)bps_max_length(int, optional) β the maximum length of thebps_maxburst period, in seconds. Heads up: you can only set this ifbps_maxis set as well. Defaults to1. (Since 2.6)bps_rd_max_length(int, optional) β the maximum length of thebps_rd_maxburst period, in seconds. Only set it ifbps_rd_maxis set as well. Defaults to1. (Since 2.6)bps_wr_max_length(int, optional) β the maximum length of thebps_wr_maxburst period, in seconds. Only set it ifbps_wr_maxis set as well. Defaults to1. (Since 2.6)iops_max_length(int, optional) β the maximum length of theiopsburst period, in seconds. Only set it ifiops_maxis set as well. Defaults to1. (Since 2.6)iops_rd_max_length(int, optional) β the maximum length of theiops_rd_maxburst period, in seconds. Only set it ifiops_rd_maxis set as well. Defaults to1. (Since 2.6)iops_wr_max_length(int, optional) β the maximum length of theiops_wr_maxburst period, in seconds. Only set it ifiops_wr_maxis set as well. Defaults to1. (Since 2.6)iops_size(int, optional) β an I/O size in bytes (Since 1.7)group(string, optional) β throttle group name (Since 2.4)
Features
deprecatedβ memberdeviceis deprecated π useidinstead, fr fr.
π¦ Object ThrottleLimits (Since: 2.11)
Limit parameters for throttling. Okay so real talk: some limit combos are just straight-up illegal, so limits should always be set in one transaction β don't be out here setting them one at a time. Every single field is optional, and when you're setting limits, if a field is missing, its current value stays exactly as it is (no sneaky resets). π«Ά
Members
iops-total(int, optional) β limit total I/O operations per secondiops-total-max(int, optional) β I/O operations burstiops-total-max-length(int, optional) β length of theiops-total-maxburst period, in seconds. It must only be set ifiops-total-maxis set as well.iops-read(int, optional) β limit read operations per secondiops-read-max(int, optional) β I/O operations read burstiops-read-max-length(int, optional) β length of theiops-read-maxburst period, in seconds. It must only be set ifiops-read-maxis set as well.iops-write(int, optional) β limit write operations per secondiops-write-max(int, optional) β I/O operations write burstiops-write-max-length(int, optional) β length of theiops-write-maxburst period, in seconds. It must only be set ifiops-write-maxis set as well.bps-total(int, optional) β limit total bytes per secondbps-total-max(int, optional) β total bytes burstbps-total-max-length(int, optional) β length of thebps-total-maxburst period, in seconds. It must only be set ifbps-total-maxis set as well.bps-read(int, optional) β limit read bytes per secondbps-read-max(int, optional) β total bytes read burstbps-read-max-length(int, optional) β length of thebps-read-maxburst period, in seconds. It must only be set ifbps-read-maxis set as well.bps-write(int, optional) β limit write bytes per secondbps-write-max(int, optional) β total bytes write burstbps-write-max-length(int, optional) β length of thebps-write-maxburst period, in seconds. It must only be set ifbps-write-maxis set as well.iops-size(int, optional) β when limiting by iops, the max size of an I/O in bytes
π Object ThrottleGroupProperties (Since: 2.11)
Properties for throttle-group objects. Slay, very demure, very mindful.
Members
limits(ThrottleLimits, optional) β limits to apply for this throttle groupx-iops-total(int, optional) β Not documentedx-iops-total-max(int, optional) β Not documentedx-iops-total-max-length(int, optional) β Not documentedx-iops-read(int, optional) β Not documentedx-iops-read-max(int, optional) β Not documentedx-iops-read-max-length(int, optional) β Not documentedx-iops-write(int, optional) β Not documentedx-iops-write-max(int, optional) β Not documentedx-iops-write-max-length(int, optional) β Not documentedx-bps-total(int, optional) β Not documentedx-bps-total-max(int, optional) β Not documentedx-bps-total-max-length(int, optional) β Not documentedx-bps-read(int, optional) β Not documentedx-bps-read-max(int, optional) β Not documentedx-bps-read-max-length(int, optional) β Not documentedx-bps-write(int, optional) β Not documentedx-bps-write-max(int, optional) β Not documentedx-bps-write-max-length(int, optional) β Not documentedx-iops-size(int, optional) β Not documented
Features
unstableβ okay bestie, listen: all members starting withx-are just aliases for the same key without thex-, over in thelimitsobject. This is not a stable interface and it may be removed or changed incompatibly in the future π. Uselimitsif you want a supported, stable interface. Periodt.
π Command block-stream (Since: 1.1)
Copy data from a backing file into a block device. Iconic behaviour, honestly.
The block streaming operation runs in the background until the entire backing file has been copied. The command returns immediately once streaming has started β it does not wait around for the whole thing like some clingy main character. You can check the status of ongoing block streaming operations with query-block-jobs. And if you wanna stop it before it's finished, that's what job-cancel or block-job-cancel are for. π
The node that receives the data is called the top image. It can live in any part of the chain (but always above the base image β see below), and you can name it with its device or node name. Earlier QEMU versions only let device name the top level node; if you spot the base-node parameter during introspection, that's your witness that you've got the enhanced semantics of device. β¨
If a base file is specified, then sectors are not copied from that base file and its backing chain. That's the whole point, actually β it lets you stream just a subset of the backing file chain instead of flattening the entire image. When streaming completes, the image file will have the base file as its backing file β unless that node got changed while the job was running π. In that case, base's parent's backing (or filtered, whichever exists) child (i.e., base at the beginning of the job) will be the new backing file.
On successful completion, the image file is updated to drop the backing file, and the BLOCK_JOB_COMPLETED event is emitted. π
In case device is a filter node, block-stream modifies the first non-filter overlay node below it to point to the new backing node, instead of modifying device itself. Noted, bestie.
Arguments
job-id(string, optional) β the identifier for the brand-new block job β¨ if you don't give one, the device name gets used instead. (Since 2.7)device(string) β the device name or node name of the top image πbase(string, optional) β the common backing file name. Heads up: you literally cannot set this ifbase-nodeorbottomis also set πbase-node(string, optional) β the node name of the backing file. Also can't be set ifbaseorbottomis set. (Since 2.8)bottom(string, optional) β the last node in the chain that should be streamed into top. Nope, can't set this ifbaseorbase-nodeis set either. And it cannot be a filter node. (Since 6.0)backing-file(string, optional) β okay so this one's got lore:
The backing file string to write into the top image. This filename is not validated π«
If a pathname string is such that it cannot be resolved by QEMU, that means that subsequent QMP or HMP commands must use node-names for the image in question, because filename lookup methods will fail.
If not specified, QEMU will automatically determine the backing file string to use, or error out if there is no obvious choice. Care should be taken when specifying the string, to specify a valid filename or protocol. (Since 2.1)
backing-mask-protocol(boolean, optional) β if true, replace any protocol mentioned in the 'backing file format' withraw, rather than storing the protocol name as the backing format. Can be used even when no image header will be updated (default false; since 9.0).speed(int, optional) β the maximum speed, in bytes per second ποΈon-error(BlockdevOnError, optional) β the action to take on an error (defaultreport).stopandenospccan only be used if the block device supports io-status (seeBlockInfo). (Since 1.3)filter-node-name(string, optional) β the node name that should be assigned to the filter driver that the stream job inserts into the graph abovedevice. If this option isn't given, a node name is autogenerated. (Since: 6.0)auto-finalize(boolean, optional) β when false, this job will wait in a PENDING state after it's finished its work, waiting forjob-finalizebefore making any block graph changes. When true, this job will automatically perform its abort or commit actions. Defaults to true. (Since 3.1)auto-dismiss(boolean, optional) β when false, this job will wait in a CONCLUDED state after it has completely ceased all work, and awaitsjob-dismiss. When true, this job will automatically disappear without user intervention. Defaults to true. (Since 3.1)
Errors π¨
- If
devicedoes not exist,DeviceNotFound.
Example:
-> { "execute": "block-stream",
"arguments": { "device": "virtio0",
"base": "/tmp/master.qcow2" } }
<- { "return": {} }
Command block-job-set-speed (Since: 1.1)
Set the maximum speed for a background block operation π₯
This command can only be issued when there is an active block job, so don't come at it with nothing running.
Throttling can be disabled by setting the speed to 0 π
Arguments
device(string) β the job identifier. This used to be a device name (hence the name of the parameter), but since QEMU 2.7 it can have other values. iykyk π«speed(int) β the maximum speed, in bytes per second, or0for unlimited. Defaults to0.
Errors
- If no background operation is active on this device,
DeviceNotActive
Command block-job-cancel (Since: 1.1)
Stop an active background block operation β
This command returns immediately after marking the active background block operation for cancellation. It's an error to call this command if no operation is in progress, bestie. No notes.
The operation will cancel as soon as possible and then emit the BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when enumerated using query-block-jobs.
Note that if you issueblock-job-cancelafterdrive-mirrorhas indicated (via the eventBLOCK_JOB_READY) that the source and destination are synchronized, then the event triggered by this command changes toBLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the destination now has a point-in-time copy tied to the time of the cancellation π
For streaming, the image file retains its backing file unless the streaming operation happens to complete just as it is being cancelled. A new streaming operation can be started at a later time to finish copying all data from the backing file πΈ
Arguments
device(string) β the job identifier. This used to be a device name (hence the name of the parameter), but since QEMU 2.7 it can have other values.force(boolean, optional) β if true, and the job has already emitted the eventBLOCK_JOB_READY, abandon the job immediately (even if it is paused) instead of waiting for the destination to complete its final synchronization (since 1.3)
Errors
- If no background operation is active on this device,
DeviceNotActive
Command block-job-pause (Since: 1.3)
β οΈ This command is deprecated.
Pause an active background block operation βΈοΈ
This command returns immediately after marking the active job for pausing. Pausing an already paused job is an error, so don't spam it.
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. Slay.
Arguments
device(string) β the job identifier. This used to be a device name (hence the name of the parameter), but since QEMU 2.7 it can have other values.
Features
deprecatedβ this command is deprecated. Usejob-pauseinstead π
Errors
- If no background operation is active on this device,
DeviceNotActive
Command block-job-resume (Since: 1.3)
β οΈ This command is deprecated.
Resume an active background block operation βΆοΈ
This command returns immediately after resuming a paused job. Resuming an already running job is an error π«
This command also clears the error status of the job. Iconic behaviour, honestly.
Arguments
device(string) β the job identifier. This used to be a device name (hence the name of the parameter), but since QEMU 2.7 it can have other values.
Features
deprecatedβ this command is deprecated. Usejob-resumeinstead π
Errors
- If no background operation is active on this device,
DeviceNotActive
Command block-job-complete (Since: 1.3)
β οΈ This command is deprecated.
Manually trigger completion of an active job in the READY or STANDBY state π¬ completing the job in any other state is an error, no cap.
This is supported only for drive mirroring, where it also switches the device to write to the target path only. Note that drive mirroring includes drive-mirror, blockdev-mirror and block-commit job (only in case of "active commit", when the node being committed is used by the guest). The ability to complete is signaled with a BLOCK_JOB_READY event β¨
This command completes an active background block operation synchronously. The ordering of this command's return with the BLOCK_JOB_COMPLETED event is not defined. Note that if an I/O error occurs during the processing of this command: 1) the command itself will fail; 2) the error will be processed according to the rerror/werror arguments that were specified when starting the operation π
Arguments
device(string) β the job identifier. This used to be a device name (hence the name of the parameter), but since QEMU 2.7 it can have other values.
Features
deprecatedβ this command is deprecated. Usejob-completeinstead π
Errors
- If no background operation is active on this device,
DeviceNotActive
Command block-job-dismiss (Since: 2.12)
β οΈ This command is deprecated.
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. In turn, automatic dismiss may be enabled only for jobs that have the auto-dismiss option, which are drive-backup, blockdev-backup, drive-mirror, blockdev-mirror, block-commit and block-stream. auto-dismiss is enabled by default for these jobs π
This command will refuse to operate on any job that has not yet reached its terminal state, CONCLUDED. For jobs that make use of the BLOCK_JOB_READY event, job-cancel, block-job-cancel or job-complete will still need to be used as appropriate.
Arguments
id(string) β the job identifier.
Features
deprecatedβ this command is deprecated. Usejob-dismissinstead π
Command block-job-finalize (Since: 2.12)
β οΈ This command is deprecated.
Instructs all jobs in a transaction (or a single job if it's 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.
The command is applicable only to jobs which have the auto-finalize option and only when this option is set to false.
Arguments
id(string) β the job identifier π«
Features
deprecatedβ this command is deprecated. Usejob-finalizeinstead. (yes bestie, it's giving legacy energy, switch already π)
π¦ Object BlockJobChangeOptionsMirror (Since: 8.2)
Members
copy-mode(MirrorCopyMode) β switch to this copy mode. Currently, only the switch from'background'to'write-blocking'is implemented. (literally just the one glow-up so far β¨)
π Object BlockJobChangeOptions (Since: 8.2)
Block job options that can be changed after job creation. (post-launch edits, iykyk π )
Members
id(string) β the job identifiertype(JobType) β the job type- When
typeismirror: the members ofBlockJobChangeOptionsMirror. (so it's giving "depends on your type" main character energy π)
π₯ Command block-job-change (Since: 8.2)
Change the block job's options. (a little post-creation remix, no cap)
Arguments
- The members of
BlockJobChangeOptions.
π Enum BlockdevDiscardOptions (Since: 2.9)
Determines how to handle discard requests. (aka: what even happens when something says "throw this away" π€)
Values
ignoreβ ignore the request (respectfully, no thank you β)unmapβ forward as an unmap request (okay go off, tell the next layer π«Ά)
πΈ Enum BlockdevDetectZeroesOptions (Since: 2.1)
Describes the operation mode for the automatic conversion of plain zero writes by the OS to driver specific optimized zero write commands. (turning boring zero-writes into β¨optimizedβ¨ zero-writes)
Values
offβ disabled (default)onβ enabledunmapβ enabled and even try to unmap blocks if possible. This requires also thatBlockdevDiscardOptionsis set tounmapfor this device. (so slay but read the fine print bestie π)
β Enum BlockdevAioOptions (Since: 2.9)
Selects the AIO backend to handle I/O requests. (picking your fave worker, they all different vibes)
Values
threadsβ use QEMU's thread poolnativeβ use native AIO backend (only Linux and Windows)io_uringβ use linuxio_uring(since 5.0)
π Object BlockdevCacheOptions (Since: 2.9)
Includes cache-related options for block devices. (the caching corner of the group chat π§)
Members
direct(boolean, optional) β enables use ofO_DIRECT(bypass the host page cache; default:false)no-flush(boolean, optional) β ignore any flush requests for the device (default:false)
π Enum BlockdevDriver (Since: 2.9)
Drivers that are supported in block device operations. (the whole roster, fr fr π)
Values
throttleβ since 2.11nvmeβ since 2.12copy-on-readβ since 3.0blklogwritesβ since 3.0blkreplayβ since 4.2compressβ since 5.0copy-before-writeβ since 6.2snapshot-accessβ since 7.0blkdebugβ not documentedblkverifyβ not documentedbochsβ not documentedcloopβ not documenteddmgβ not documentedfileβ not documentedftpβ not documentedftpsβ not documentedhost_cdromβ not documentedhost_deviceβ not documentedhttpβ not documentedhttpsβ not documentedio_uringβ not documentediscsiβ not documentedluksβ not documentednbdβ not documentednfsβ not documentednull-aioβ not documentednull-coβ not documentednvme-io_uringβ not documentedparallelsβ not documentedpreallocateβ not documentedqcowβ not documentedqcow2β not documentedqedβ not documentedquorumβ not documentedrawβ not documentedrbdβ not documentedreplicationβ not documentedsshβ not documentedvdiβ not documentedvhdxβ not documentedvirtio-blk-vfio-pciβ not documentedvirtio-blk-vhost-userβ not documentedvirtio-blk-vhost-vdpaβ not documentedvmdkβ not documentedvpcβ not documentedvvfatβ not documented
The "not documented" girlies are all valid values too, they're just mysterious. Don't come for me, I'm only relaying what the page says π
π Object BlockdevOptionsFile (Since: 2.9)
Driver specific block device options for the file backend. (the classic, the blueprint, the file-on-your-disk icon π)
Members
filename(string) β path to the image filepr-manager(string, optional) β the id for the object that will handle persistent reservations for this device (default: none, forward the commands viaSG_IO; since 2.11)aio(BlockdevAioOptions, optional) β AIO backend (default:threads) (since: 2.8)aio-max-batch(int, optional) β maximum number of requests to batch together into a single submission in the AIO backend. The smallest value between this and theaio-max-batchvalue of theIOThreadobject is chosen.0means that the AIO backend will handle it automatically. (default:0, since 6.2)locking(OnOffAuto, optional) β whether to enable file locking. If set to'auto', only enable when Open File Descriptor (OFD) locking API is available (default:auto, since 2.10)drop-cache(boolean, optional) β invalidate page cache during live migration. This prevents stale data on the migration destination withcache.direct=off. Currently only supported on Linux hosts. (default:on, since: 4.0)x-check-cache-dropped(boolean, optional) β whether to check that page cache was dropped on live migration. May cause noticeable delays if the image file is large, do not use in production. (default:off) (since: 3.0)
Features
dynamic-auto-read-onlyβ if present, enabledauto-read-onlymeans that the driver will open the image read-only at first, dynamically reopen the image file read-write when the first writer is attached to the node and reopen read-only when the last writer is detached. This allows giving QEMU write permissions only on demand when an operation actually needs write access. (so it's giving "permissions on demand", very considerate of it π«Ά)unstableβ memberx-check-cache-droppedis meant for debugging. (debug-only, do NOT ship it, bestie π)
π§ Object BlockdevOptionsNull (Since: 2.9)
Driver specific block device options for the null backend. (the void, the nothing, the /dev/null of it all)
Members
size(int, optional) β size of the device in bytes.latency-ns(int, optional) β emulated latency (in nanoseconds) in processing requests. Default to zero which completes requests immediately. (Since 2.4)read-zeroes(boolean, optional) β if true, reads from the device produce zeroes; if false, the buffer is left unchanged. (default:false; since: 4.1)
π
Object BlockdevOptionsNVMe (Since: 2.12)
Driver specific block device options for the NVMe backend.
Members
device(string) β PCI controller address of the NVMe device in formathhhh:bb:ss.f(host:bus:slot.function)namespace(int) β namespace number of the device, starting from 1.
Note that the PCI device must have been unbound from any host kernel driver before instructing QEMU to add the blockdev.
Fr fr, unbind it first. QEMU can't just snatch a device that some kernel driver is already holding hands with π
πΈ Object BlockdevOptionsVVFAT (Since: 2.9)
Driver specific block device options for the vvfat protocol.
Members
dir(string) β directory to be exported as FAT imagefat-type(int, optional) β FAT type:12,16or32floppy(boolean, optional) β whether to export a floppy image (true) or partitioned hard disk (false; default)label(string, optional) β set the volume label, limited to 11 bytes. FAT16 and FAT32 traditionally have some restrictions on labels, which are ignored by most operating systems. Defaults to"QEMU VVFAT". (since 2.4)rw(boolean, optional) β whether to allow write operations (default:false)
π¦ Object BlockdevOptionsGenericFormat (Since: 2.9)
Driver specific block device options for image format that have no option besides their data source. (minimalist queen, only has her source and her vibes β¨)
Members
file(BlockdevRef) β reference to or definition of the data source block device
π Object BlockdevOptionsLUKS (Since: 2.9)
Driver specific block device options for LUKS. (encrypted, mysterious, locked-down icon behavior π₯)
Members
key-secret(string, optional) β the ID of aQCryptoSecretobject providing the decryption key. Mandatory except when doing a metadata-only probe of the image. (since 2.6)header(BlockdevRef, optional) β block device holding a detached LUKS header. (since 9.0)- The members of
BlockdevOptionsGenericFormat. (yes, they come too, package deal π)
π Object BlockdevOptionsGenericCOWFormat (Since: 2.9)
Driver specific block device options for image format that have no option besides their data source and an optional backing file. (the COW girlies, copy-on-write and thriving πβ¨)
Members
backing(BlockdevRefOrNull, optional) β a reference to, or a whole inline definition of, the backing file block device. Setting it tonullkills the backing file completely, no backing file, none, gone π. If you don't say anything, it defaults to the backing file stored in the image file.- plus everything from
BlockdevOptionsGenericFormatπ«Ά
πΈ Enum Qcow2OverlapCheckMode (Since: 2.9) πΈ
The general vibe check modes for overlap checking β¨
Values
noneβ do literally no checks, live your truth πconstantβ only run the checks that can be done in constant time and without reading anything from diskcachedβ only run checks that can be done without reading anything from diskallβ run every single check available π
π Object Qcow2OverlapCheckFlags (Since: 2.9) π
This is the flags struct for each metadata structure. Set a field to true and QEMU will guard that Qcow2 format structure against unintended overwriting π‘οΈ. For the detailed lore on these structures, go check the Qcow2 format specification β it's all there, iykyk. The default value gets picked according to the template you give it.
Members
template(Qcow2OverlapCheckMode, optional) β picks a template mode that you can then tweak with the other flags. Defaults tocached.main-header(boolean, optional) β the Qcow2 format headeractive-l1(boolean, optional) β the Qcow2 active L1 tableactive-l2(boolean, optional) β the Qcow2 active L2 tablerefcount-table(boolean, optional) β the Qcow2 refcount tablerefcount-block(boolean, optional) β the Qcow2 refcount blockssnapshot-table(boolean, optional) β the Qcow2 snapshot tableinactive-l1(boolean, optional) β the Qcow2 inactive L1 tablesinactive-l2(boolean, optional) β the Qcow2 inactive L2 tablesbitmap-directory(boolean, optional) β the Qcow2 bitmap directory (since 3.0)
π Alternate Qcow2OverlapChecks (Since: 2.9) π
Tells you which metadata structures should be guarded against unintended overwriting π
Alternatives
flags(Qcow2OverlapCheckFlags) β a set of flags so you can specify each metadata structure type separately, one by one, very main character energymode(Qcow2OverlapCheckMode) β a named mode that just picks a specific set of flags for you, lowkey convenient
π¦ Enum BlockdevQcowEncryptionFormat (Since: 2.10) π¦
Values
aesβ AES-CBC with plain64 initialization vectors π
π Object BlockdevQcowEncryption (Since: 2.10) π
Members
format(BlockdevQcowEncryptionFormat) β the encryption format- when
formatisaes: the members ofQCryptoBlockOptionsQCowβ¨
β Object BlockdevOptionsQcow (Since: 2.10) β
Driver-specific block device options for qcow, bestie.
Members
encrypt(BlockdevQcowEncryption, optional) β image decryption options. This one's mandatory for encrypted images β except when you're just doing a metadata-only probe of the image.- plus the members of
BlockdevOptionsGenericCOWFormatπ«Ά
π Enum BlockdevQcow2EncryptionFormat (Since: 2.10) π
Values
aesβ AES-CBC with plain64 initialization vectorsluksβ Not documented π
π§ Object BlockdevQcow2Encryption (Since: 2.10) π§
Members
format(BlockdevQcow2EncryptionFormat) β the encryption format- when
formatisaes: the members ofQCryptoBlockOptionsQCow - when
formatisluks: the members ofQCryptoBlockOptionsLUKS
π₯ Object BlockdevOptionsPreallocate (Since: 6.0) π₯
A filter driver whose whole personality is being inserted between the format and protocol node and doing preallocation in the protocol node on write βοΈ
Members
prealloc-align(int, optional) β on preallocation, align the file length to this number. Default is1048576(1M).prealloc-size(int, optional) β how much to preallocate. Default is134217728(128M).- plus the members of
BlockdevOptionsGenericFormatπ
π Object BlockdevOptionsQcow2 (Since: 2.9) π
Driver-specific block device options for qcow2 β this is the big one, buckle up bestie π’
Members
lazy-refcounts(boolean, optional) β whether to enable the lazy refcounts feature. The default is taken from the image file, so the image kinda decides for you.pass-discard-request(boolean, optional) β whether discard requests to the qcow2 device should be forwarded to the data sourcepass-discard-snapshot(boolean, optional) β whether discard requests for the data source should be issued when a snapshot operation (e.g. deleting a snapshot) frees clusters in the qcow2 filepass-discard-other(boolean, optional) β whether discard requests for the data source should be issued on other occasions where a cluster gets freeddiscard-no-unref(boolean, optional) β when enabled, data clusters stay preallocated even when they're no longer used, e.g. because they got discarded or converted to zero clusters. As usual, whether the old data is actually discarded or kept at the protocol level (i.e. in the image file) depends on how you set thepass-discard-requestoption. Keeping the clusters preallocated prevents qcow2 fragmentation that would otherwise happen from freeing and re-allocating them later. And heads up: besides potential performance degradation, that kind of fragmentation can lead to increased allocation of clusters past the end of the image file, which means image files whose file length can grow much larger than their guest disk size would suggest π. If image file length is something you care about (e.g. when storing qcow2 images directly on block devices), you should consider enabling this option. (since 8.1)overlap-check(Qcow2OverlapChecks, optional) β which overlap checks to perform for writes to the image. Defaults tocached. (since 2.2)cache-size(int, optional) β the maximum total size of the L2 table and refcount block caches, in bytes (since 2.2)l2-cache-size(int, optional) β the maximum size of the L2 table cache, in bytes (since 2.2)l2-cache-entry-size(int, optional) β the size of each entry in the L2 cache, in bytes. It must be a power of two between512and the cluster size. Default value is the cluster size. (since 2.12)refcount-cache-size(int, optional) β the maximum size of the refcount block cache, in bytes (since 2.2)cache-clean-interval(int, optional) β clean unused entries in the L2 and refcount caches. The interval is in seconds. Default value is600on supporting platforms, and0on other platforms.0disables this feature. (since 2.5)encrypt(BlockdevQcow2Encryption, optional) β image decryption options. Mandatory for encrypted images β except when doing a metadata-only probe of the image. (since 2.10)data-file(BlockdevRef, optional) β a reference to, or definition of, the external data file. This may only be specified for images that require an external data file. If you don't specify it for such an image, the data file name gets loaded from the image file. (since 4.0)- plus the members of
BlockdevOptionsGenericCOWFormatπ«Ά
πΈ Enum SshHostKeyCheckMode (Since: 2.12) πΈ
Values
noneβ don't check the host key at all, yolo πhashβ compare the host key with a given hashknown_hostsβ check the host key against theknown_hostsfile
π Enum SshHostKeyCheckHashType (Since: 2.12) π
Values
md5β the given hash is an md5 hashsha1β the given hash is an sha1 hashsha256β the given hash is an sha256 hash
β¨ Object SshHostKeyHash (Since: 2.12) β¨
Members
type(SshHostKeyCheckHashType) β the hash algorithm used for the hashhash(string) β the expected hash value
π
Object SshHostKeyCheck (Since: 2.12) π
Members
mode(SshHostKeyCheckMode) β how to check the host key- when
modeishash: the members ofSshHostKeyHashπ
π¦ Object BlockdevOptionsSsh (Since: 2.9) π¦
Members
server(InetSocketAddress) β host addresspath(string) β path to the image on the hostuser(string, optional) β the user to connect as. Defaults to the current local user name.host-key-check(SshHostKeyCheck, optional) β defines how and what to check the host key against. Default:known_hosts.
π Enum BlkdebugEvent (Since: 2.9) π
The trigger events blkdebug supports π―
Values
l1_shrink_write_tableβ write zeros to the l1 table to shrink the image. (since 2.11)l1_shrink_free_l2_clustersβ discard the l2 tables. (since 2.11)cor_writeβ a write due to copy-on-read (since 2.11)cluster_alloc_spaceβ an allocation of file space for a cluster (since 4.1)noneβ triggers once at creation of the blkdebug node (since 4.1)l1_updateβ Not documentedl1_grow_alloc_tableβ Not documentedl1_grow_write_tableβ Not documentedl1_grow_activate_tableβ Not documentedl2_loadβ Not documentedl2_updateβ Not documented π (bestie, they really just left us on read)l2_update_compressedβ Not documented πl2_alloc_cow_readβ Not documented πl2_alloc_writeβ Not documented πread_aioβ Not documented πread_backing_aioβ Not documented πread_compressedβ Not documented πwrite_aioβ Not documented πwrite_compressedβ Not documented πvmstate_loadβ Not documented πvmstate_saveβ Not documented πcow_readβ Not documented πcow_writeβ Not documented πreftable_loadβ Not documented πreftable_growβ Not documented πreftable_updateβ Not documented πrefblock_loadβ Not documented πrefblock_updateβ Not documented πrefblock_update_partβ Not documented πrefblock_allocβ Not documented πrefblock_alloc_hookupβ Not documented πrefblock_alloc_writeβ Not documented πrefblock_alloc_write_blocksβ Not documented πrefblock_alloc_write_tableβ Not documented πrefblock_alloc_switch_tableβ Not documented πcluster_allocβ Not documented πcluster_alloc_bytesβ Not documented πcluster_freeβ Not documented πflush_to_osβ Not documented πflush_to_diskβ Not documented πpwritev_rmw_headβ Not documented πpwritev_rmw_after_headβ Not documented πpwritev_rmw_tailβ Not documented πpwritev_rmw_after_tailβ Not documented πpwritevβ Not documented πpwritev_zeroβ Not documented πpwritev_doneβ Not documented πempty_image_prepareβ Not documented π«Ά
okay that's the whole "Not documented" era of the list, we made it through together β¨
π Enum BlkdebugIOType (Since: 4.1)
The different flavors of I/O that blkdebug is allowed to inject errors into. It's giving "let me ruin your day, but, like, on purpose and in a very specific way" π
Values
readβ maps to.bdrv_co_preadv()writeβ maps to.bdrv_co_pwritev()write-zeroesβ maps to.bdrv_co_pwrite_zeroes()discardβ maps to.bdrv_co_pdiscard()flushβ maps to.bdrv_co_flush_to_disk()block-statusβ maps to.bdrv_co_block_status()
πΈ Object BlkdebugInjectErrorOptions (Since: 2.9)
Describes exactly one error injection for blkdebug. One error, fully described, very much main character energy π
Members
event(BlkdebugEvent) β the trigger event π₯state(int, optional) β the state identifierblkdebugneeds to be in for the event to actually trigger; defaults to"any"iotype(BlkdebugIOType, optional) β the type of I/O operations this error gets injected on; defaults to"all read, write, write-zeroes, discard, and flush operations"(since: 4.1)errno(int, optional) β the error identifier (errno) to return; defaults toEIOdelay-ns(int, optional) β request delay before completion, in nanoseconds (default:0, since: 11.1)sector(int, optional) β the sector index that has to be affected for the event to actually trigger; defaults to"any sector"once(boolean, optional) β turns off further events after this one has fired; defaults tofalseimmediately(boolean, optional) β fail immediately; defaults tofalse
π Object BlkdebugSetStateOptions (Since: 2.9)
Describes a single state-change event for blkdebug. Glow-up, but for state machines β¨
Members
event(BlkdebugEvent) β the trigger event π₯state(int, optional) β the current state identifierblkdebugneeds to be in; defaults to"any"new_state(int) β the state identifierblkdebugis supposed to assume once this event is triggered
π¦ Object BlockdevOptionsBlkdebug (Since: 2.9)
Driver-specific block device options for blkdebug. This is the whole menu, bestie, every flag on it π
Members
image(BlockdevRef) β the underlying raw block device (or image file)config(string, optional) β filename of the configuration filealign(int, optional) β required alignment for requests, in bytes; must be a positive power of2, or0for the defaultmax-transfer(int, optional) β maximum size for I/O transfers, in bytes; must be a positive multiple ofalignand of the underlying file's request alignment (it does not have to be a power of2), or0for the default (since 2.10)opt-write-zero(int, optional) β preferred alignment for write-zero requests, in bytes; must be a positive multiple ofalignand of the underlying file's request alignment (doesn't need to be a power of2), or0for the default (since 2.10)max-write-zero(int, optional) β maximum size for write-zero requests, in bytes; must be a positive multiple ofalign, ofopt-write-zero, and of the underlying file's request alignment (power of2not required), or0for the default (since 2.10)opt-discard(int, optional) β preferred alignment for discard requests, in bytes; must be a positive multiple ofalignand of the underlying file's request alignment (again, no power-of-2requirement), or0for the default (since 2.10)max-discard(int, optional) β maximum size for discard requests, in bytes; must be a positive multiple ofalign, ofopt-discard, and of the underlying file's request alignment (still not required to be a power of2), or0for the default (since 2.10)inject-error([BlkdebugInjectErrorOptions], optional) β array of error injection descriptionsset-state([BlkdebugSetStateOptions], optional) β array of state-change descriptionstake-child-perms([BlockPermission], optional) β permissions to take onimageon top of whatever is necessary anyway (which depends on how theblkdebugnode is used). Defaults to none. (since 5.0)unshare-child-perms([BlockPermission], optional) β permissions not to share onimage, on top of whatever cannot be shared anyway (which depends on how theblkdebugnode is used). Defaults to none. (since 5.0)
π Object BlockdevOptionsBlklogwrites (Since: 3.0)
Driver-specific block device options for blklogwrites. Logging your writes like a little diary π
Members
file(BlockdevRef) β block devicelog(BlockdevRef) β block device used to log writes tofilelog-sector-size(int, optional) β sector size used when logging writes tofile; this decides the granularity of the offsets and sizes of writes (default:512)log-append(boolean, optional) β append to an existing log (default:false)log-super-update-interval(int, optional) β interval of write requests after which the log super block gets updated to disk (default:4096)
β Object BlockdevOptionsBlkverify (Since: 2.9)
Driver-specific block device options for blkverify. Trust but verify, bestie π
Members
test(BlockdevRef) β block device to be testedraw(BlockdevRef) β raw image used for verification
π§ Object BlockdevOptionsBlkreplay (Since: 4.2)
Driver-specific block device options for blkreplay.
Members
image(BlockdevRef) β the disk image that should be controlled withblkreplay
π Enum QuorumReadPattern (Since: 2.9)
An enumeration of quorum read patterns. Democracy, but for reads π³οΈ
Values
quorumβ read all the children and do a quorum vote on readsfifoβ read only from the first child that has not failed
π Object BlockdevOptionsQuorum (Since: 2.9)
Driver-specific block device options for Quorum π«Ά
Members
blkverify(boolean, optional) βtrueif the driver must print content mismatch; set tofalseby defaultchildren([BlockdevRef]) β the children block devices to usevote-threshold(int) β the vote limit under which a read will failrewrite-corrupted(boolean, optional) β rewrite corrupted data when quorum is reached (Since 2.1)read-pattern(QuorumReadPattern, optional) β choose the read pattern; set toquorumby default (Since 2.2)
π
Object BlockdevOptionsIoUring (Since: 7.2)
Availability: CONFIG_BLKIO
Driver-specific block device options for the io_uring backend β¨
Members
filename(string) β path to the image file
π¦ Object BlockdevOptionsNvmeIoUring (Since: 7.2)
Availability: CONFIG_BLKIO
Driver-specific block device options for the nvme-io_uring backend.
Members
path(string) β path to the NVMe namespace's character device (e.g./dev/ng0n1)
πΈ Object BlockdevOptionsVirtioBlkVfioPci (Since: 7.2)
Availability: CONFIG_BLKIO
Driver-specific block device options for the virtio-blk-vfio-pci backend.
Members
path(string) β path to the PCI device's sysfs directory (e.g./sys/bus/pci/devices/0000:00:01.0)
π Object BlockdevOptionsVirtioBlkVhostUser (Since: 7.2)
Availability: CONFIG_BLKIO
Driver-specific block device options for the virtio-blk-vhost-user backend.
Members
path(string) β path to the vhost-user UNIX domain socket
π§ Object BlockdevOptionsVirtioBlkVhostVdpa (Since: 7.2)
Availability: CONFIG_BLKIO
Driver-specific block device options for the virtio-blk-vhost-vdpa backend.
Members π
path(string) β the path to the vhost-vdpa character device. that's it, that's the whole vibe β¨
Features π
fdsetβ this member'spathcan do the special"/dev/fdset/N"thing (since 8.1). yes bestie, that fdset path π«Ά
π Enum IscsiTransport (Since: 2.9)
okay so this is just the list of libiscsi transport types, no cap:
Values
tcpβ not documented πiserβ not documented π
π¦ Enum IscsiHeaderDigest (Since: 2.9)
the header digests libiscsi can handle, periodt:
Values
crc32cβ not documented πnoneβ not documented πcrc32c-noneβ not documented πnone-crc32cβ not documented π
π Object BlockdevOptionsIscsi (Since: 2.9)
driver-specific block device options for iscsi β the whole iscsi starter pack π
Members
transport(IscsiTransport) β the iscsi transport typeportal(string) β the address of the iscsi portaltarget(string) β the target iqn namelun(int, optional) β the LUN you're connecting to. defaults to0.user(string, optional) β the user name to log in with. if you omit it, no CHAP authentication happens, fr fr.password-secret(string, optional) β the ID of aQCryptoSecretobject that provides the password for the login. this one is required ifuseris specified πinitiator-name(string, optional) β the iqn name we want to identify ourselves to the target as. if you don't specify it, an initiator name gets generated automatically β¨header-digest(IscsiHeaderDigest, optional) β the desired header digest. defaults tonone-crc32c.timeout(int, optional) β timeout in seconds, after which a request will time out.0means no timeout, and that's the default.
π Enum RbdAuthMode (Since: 3.0)
Values
cephxβ not documented πnoneβ not documented π
πΈ Enum RbdImageEncryptionFormat (Since: 6.1)
Values
luks-anyβ used for opening either luks or luks2 (since 8.0) π«Άluksβ not documented πluks2β not documented π
π Object RbdEncryptionOptionsLUKSBase (Since: 6.1)
Members
key-secret(string) β ID of aQCryptoSecretobject providing a passphrase for unlocking the encryption π
π§ Object RbdEncryptionCreateOptionsLUKSBase (Since: 6.1)
Members
cipher-alg(QCryptoCipherAlgo, optional) β the encryption algorithm- The members of
RbdEncryptionOptionsLUKSBase. (yes, it just inherits the whole thing, iconic)
π Object RbdEncryptionOptionsLUKS (Since: 6.1)
Members
- The members of
RbdEncryptionOptionsLUKSBase.
β Object RbdEncryptionOptionsLUKS2 (Since: 6.1)
Members
- The members of
RbdEncryptionOptionsLUKSBase.
π Object RbdEncryptionOptionsLUKSAny (Since: 8.0)
Members
- The members of
RbdEncryptionOptionsLUKSBase.
π Object RbdEncryptionCreateOptionsLUKS (Since: 6.1)
Members
- The members of
RbdEncryptionCreateOptionsLUKSBase.
π Object RbdEncryptionCreateOptionsLUKS2 (Since: 6.1)
Members
- The members of
RbdEncryptionCreateOptionsLUKSBase.
π¦ Object RbdEncryptionOptions (Since: 6.1)
Members
format(RbdImageEncryptionFormat) β encryption format.parent(RbdEncryptionOptions, optional) β parent image encryption options, for cloned images. you can leave this unspecified if this cloned image is encrypted using the same format and secret as its parent image (i.e. it wasn't explicitly formatted), or if its parent image isn't encrypted at all. (Since 8.0) π- When
formatisluks: the members ofRbdEncryptionOptionsLUKS. - When
formatisluks2: the members ofRbdEncryptionOptionsLUKS2. - When
formatisluks-any: the members ofRbdEncryptionOptionsLUKSAny.
π₯ Object RbdEncryptionCreateOptions (Since: 6.1)
Members
format(RbdImageEncryptionFormat) β encryption format.- When
formatisluks: the members ofRbdEncryptionCreateOptionsLUKS. - When
formatisluks2: the members ofRbdEncryptionCreateOptionsLUKS2.
π Object BlockdevOptionsRbd (Since: 2.9)
the Ceph/RBD block device options, main character energy all the way π
Members
pool(string) β Ceph pool name.namespace(string, optional) β Rados namespace name in the Ceph pool. (Since 5.0)image(string) β image name in the Ceph pool.conf(string, optional) β path to the Ceph configuration file. values in that config file get overridden by options you specify via QAPI, so QAPI wins πsnapshot(string, optional) β Ceph snapshot name.encrypt(RbdEncryptionOptions, optional) β image encryption options. (Since 6.1) πuser(string, optional) β Ceph id name.auth-client-required([RbdAuthMode], optional) β the acceptable authentication modes. this maps to the Ceph configuration option"auth_client_required". (Since 3.0)key-secret(string, optional) β ID of aQCryptoSecretobject providing a key for cephx authentication. this maps to the Ceph configuration option"key". (Since 3.0)server([InetSocketAddressBase], optional) β monitor host address and port. this maps to the"mon_host"Ceph option.
π Enum ReplicationMode (Since: 2.9)
Availability: CONFIG_REPLICATION β so if that's not compiled in, don't come crying to me bestie π
an enumeration of replication modes, periodt.
Values
primaryβ primary mode: the vm's state gets sent to the secondary QEMU. π€secondaryβ secondary mode: receive the vm's state from the primary QEMU. π₯
π Object BlockdevOptionsReplication (Since: 2.9)
Availability: CONFIG_REPLICATION
driver-specific block device options for replication, slay:
Members
mode(ReplicationMode) β the replication modetop-id(string, optional) β in secondary mode, the node name or device ID of the root node who owns the replication node chain. must not be given in primary mode. π«- The members of
BlockdevOptionsGenericFormat.
πΈ Enum NFSTransport (Since: 2.9)
an enumeration of NFS transport types:
Values
inetβ TCP transport
π Object NFSServer (Since: 2.9)
captures the address of the socket π§¦
Members
type(NFSTransport) β transport type used for NFS (only TCP supported, so yeah,inetit is)host(string) β host address for the NFS server
π«Ά Object BlockdevOptionsNfs (Since: 2.9)
driver-specific block device options for NFS β the whole mount-and-chill package π
Members
server(NFSServer) β host addresspath(string) β path of the image on the hostuser(int, optional) β UID value to use when talking to the server (defaults to65534on Windows andgetuid()on unix)group(int, optional) β GID value to use when talking to the server (defaults to65534on Windows andgetgid()in unix)tcp-syn-count(int, optional) β number of SYNs during the session establishment (defaults to the libnfs default)readahead-size(int, optional) β sets the readahead size in bytes (defaults to the libnfs default)page-cache-size(int, optional) β sets the pagecache size in bytes (defaults to the libnfs default)debug(int, optional) β sets the NFS debug level (max2) (defaults to the libnfs default)
β Object BlockdevOptionsCurlBase (Since: 2.9)
driver-specific block device options shared by all protocols the curl backend supports β the common denominator era π
Members
url(string) β URL of the image filereadahead(int, optional) β size of the read-ahead cache; must be a multiple of512(defaults to256 kB)timeout(int, optional) β timeout for connections, in seconds (defaults to5)username(string, optional) β username for authentication (defaults to none)password-secret(string, optional) β ID of aQCryptoSecretobject providing a password for authentication (defaults to no password)proxy-username(string, optional) β username for proxy authentication (defaults to none)proxy-password-secret(string, optional) β ID of aQCryptoSecretobject providing a password for proxy authentication (defaults to no password)
π¦ Object BlockdevOptionsCurlHttp (Since: 2.9)
driver-specific block device options for HTTP connections over the curl backend. URLs must start with "http://" β non-negotiable bestie π
Members
cookie(string, optional) β list of cookies to set; the format is"name1=content1; name2=content2;"as explained byCURLOPT_COOKIE(3). defaults to no cookies. πͺcookie-secret(string, optional) β ID of aQCryptoSecretobject providing the cookie data in a secure way. seecookiefor the format. (since 2.10)force-range(boolean, optional) β don't issue a HEAD HTTP request to discover if the http server supports range requests, and rely only on GET requests. this is especially useful for S3 presigned URLs where HEAD requests are unauthorized. (default:false; since 11.0)- The members of
BlockdevOptionsCurlBase.
π Object BlockdevOptionsCurlHttps (Since: 2.9) π
okay so these are the driver-specific block device options for HTTPS connections going through the curl backend. important vibe check: your URLs must start with <https:// β like, non-negotiable bestie.
Members
sslverify(boolean, optional) β do we verify that the SSL cert is actually valid? defaults totrueπ- plus all the members of
BlockdevOptionsCurlHttp.
π¦ Object BlockdevOptionsCurlFtp (Since: 2.9) π¦
driver-specific block device options for FTP connections over the curl backend. and yeah, URLs have to start with <ftp:// or it's simply not giving.
Members
- the members of
BlockdevOptionsCurlBaseβ that's the whole menu, no extras π«Ά
πΈ Object BlockdevOptionsCurlFtps (Since: 2.9) πΈ
same energy but FTPS over the curl backend this time. URLs must start with ftps:// (noted, no < > on this one β that's literally how it's written, don't come for me).
Members
sslverify(boolean, optional) β whether to verify the SSL certificate's validity (defaults totrue) β¨- the members of
BlockdevOptionsCurlBase.
π Object BlockdevOptionsNbd (Since: 2.9) π
driver-specific block device options for NBD. this one's stacked, bestie β lots to cover.
Members
server(SocketAddress) β the NBD server address πexport(string, optional) β export nametls-creds(string, optional) β TLS credentials IDtls-hostname(string, optional) β TLS hostname override for certificate validation (Since 7.0)x-dirty-bitmap(string, optional) β a metadata context name like"qemu:dirty-bitmap:NAME"or"qemu:allocation-depth"to query instead of the traditional"base:allocation"block status (peepNBD_OPT_LIST_META_CONTEXTin the NBD protocol; and yes, naming this optionx-contextwould have made more sense β the manpage said it, not me π) (since 3.0)reconnect-delay(int, optional) β when there's an unexpected disconnect, the nbd client keeps trying to connect again until it succeeds or hits a serious error. during the firstreconnect-delayseconds, all requests are paused and get rerun on a successful reconnect. after that time, any delayed requests β plus every future request before a successful reconnect β will immediately fail. default0(Since 4.2) π₯open-timeout(int, optional) β in seconds. if zero, the nbd driver tries the connection only once and fails to open if the connection fails. if non-zero, the nbd driver repeats connection attempts until successful or untilopen-timeoutseconds have elapsed. default0(Since 7.0)
Features
unstableβ memberx-dirty-bitmapis experimental. handle with care, it's giving beta energy π
π Object BlockdevOptionsRaw (Since: 2.9) π
driver-specific block device options for the raw driver. simple, clean, iconic.
Members
offset(int, optional) β position where the block device startssize(int, optional) β the assumed size of the device- plus the members of
BlockdevOptionsGenericFormat.
β Object BlockdevOptionsThrottle (Since: 2.11) β
driver-specific block device options for the throttle driver. rate-limiting but make it fashion.
Members
throttle-group(string) β the name of thethrottle-groupobject to use. it has to already exist, no creating it on the fly bestie.file(BlockdevRef) β reference to, or definition of, the data source block device
π§ Object BlockdevOptionsCor (Since: 6.0) π§
driver-specific block device options for the copy-on-read driver.
Members
bottom(string, optional) β the name of a non-filter node (an allocation-bearing layer) that limits the COR operations in the backing chain (inclusive), so that no data below this node gets copied by this filter. if the option is absent, the limit isn't applied, so data from all backing layers may be copied. lowkey a big deal, choose wisely π- plus the members of
BlockdevOptionsGenericFormat.
π Enum OnCbwError (Since: 7.1) π
an enumeration of the possible behaviors when copy-before-write operations fail. pick your fighter.
Values
break-guest-writeβ report the error to the guest. this way the guest can't overwrite areas that can't be backed up, so the backup process stays valid. βbreak-snapshotβ continue the guest write. doing so makes the provided snapshot state invalid, and any backup or export process based on it will finally fail. yikes, proceed with caution π«£
π Object BlockdevOptionsCbw (Since: 6.2) π
driver-specific block device options for the copy-before-write driver, which does exactly what it says on the tin: when data is written to the filter, the filter first reads the corresponding blocks from its file child and copies them to the target child. after copying successfully, the write request is propagated to the file child. if the copying fails, the original write request fails too β and no data gets written to the file child. main character filter behavior fr fr.
Members
target(BlockdevRef) β the target for copy-before-write operations π―bitmap(BlockDirtyBitmap, optional) β if specified, the copy-before-write filter does copy-before-write operations only for dirty regions of the bitmap. the bitmap size must be equal to the length of thefileandtargetchildren of the filter. also note: the bitmap is used only to initialize the internal bitmap of the process, so further modifications (or removing) of the specified bitmap doesn't influence the filter. (Since 7.0) π¦on-cbw-error(OnCbwError, optional) β behavior on failure of a copy-before-write operation. default isbreak-guest-write. (Since 7.1)cbw-timeout(int, optional) β zero means no limit. non-zero sets the timeout in seconds for the copy-before-write operation. when a timeout occurs, that respective copy-before-write operation fails, and theon-cbw-errorparameter decides how that failure is handled. default0. (Since 7.1) β°min-cluster-size(int, optional) β minimum size of blocks used by copy-before-write operations. has to be a power of 2. no effect if it's smaller than the maximum of the target's cluster size and 64 KiB. default0. (Since 9.2)- plus the members of
BlockdevOptionsGenericFormat.
β¨ Object BlockdevOptions (Since: 2.9) β¨
the big one β options for creating a block device. so many options are available for all block devices, totally independent of the block driver. this is the shared starter pack, bestie.
Members
driver(BlockdevDriver) β block driver namenode-name(string, optional) β the node name of the new node. this option is required on the top level ofblockdev-add. valid node names start with an alphabetic character and may contain only alphanumeric characters,'-','.'and'_'. their maximum length is 31 characters. (Since 2.0) πdiscard(BlockdevDiscardOptions, optional) β discard-related options (default:ignore)cache(BlockdevCacheOptions, optional) β cache-related optionsactive(boolean, optional) β whether the block node should be activated (default:true). having inactive block nodes is useful primarily for migration, because it lets you open an image on the destination while the source is still holding locks for it. (Since 10.0) π₯read-only(boolean, optional) β whether the block device should be read-only (default:false). heads up: some block drivers support only read-only access, either generally or in certain configurations. in that case the default value doesn't work and you have to specify the option explicitly. no cap.auto-read-only(boolean, optional) β iftrueandread-onlyisfalse, QEMU may automatically decide not to open the image read-write as requested, and fall back to read-only instead (switching between the modes later), e.g. depending on whether the image file is writable or whether a writing user is attached to the node (default:false, since 3.1)detect-zeroes(BlockdevDetectZeroesOptions, optional) β detect and optimize zero writes (Since 2.1) (default:off)force-share(boolean, optional) β force share all permission on added nodes. requiresread-only=true. (Since 2.10) β οΈ- when
driverisblkdebug: the members ofBlockdevOptionsBlkdebug. - when
driverisblklogwrites: the members ofBlockdevOptionsBlklogwrites. - when
driverisblkverify: the members ofBlockdevOptionsBlkverify. - when
driverisblkreplay: the members ofBlockdevOptionsBlkreplay. - when
driverisbochs: the members ofBlockdevOptionsGenericFormat. - when
driveriscloop: the members ofBlockdevOptionsGenericFormat. - when
driveriscompress: the members ofBlockdevOptionsGenericFormat. - when
driveriscopy-before-write: the members ofBlockdevOptionsCbw. - when
driveriscopy-on-read: the members ofBlockdevOptionsCor. - when
driverisdmg: the members ofBlockdevOptionsGenericFormat. - when
driverisfile: the members ofBlockdevOptionsFile. - when
driverisftp: the members ofBlockdevOptionsCurlFtp. - when
driverisftps: the members ofBlockdevOptionsCurlFtps. host_cdromβ pulls in the members ofBlockdevOptionsFile. πΏhost_deviceβ pulls in the members ofBlockdevOptionsFile. π₯οΈhttpβ pulls in the members ofBlockdevOptionsCurlHttp.httpsβ pulls in the members ofBlockdevOptionsCurlHttps. πio_uringβ pulls in the members ofBlockdevOptionsIoUring.iscsiβ pulls in the members ofBlockdevOptionsIscsi.luksβ pulls in the members ofBlockdevOptionsLUKS. πnbdβ pulls in the members ofBlockdevOptionsNbd.nfsβ pulls in the members ofBlockdevOptionsNfs.null-aioβ pulls in the members ofBlockdevOptionsNull.null-coβ pulls in the members ofBlockdevOptionsNull.nvmeβ pulls in the members ofBlockdevOptionsNVMe.nvme-io_uringβ pulls in the members ofBlockdevOptionsNvmeIoUring.parallelsβ pulls in the members ofBlockdevOptionsGenericFormat.preallocateβ pulls in the members ofBlockdevOptionsPreallocate.qcow2β pulls in the members ofBlockdevOptionsQcow2. β¨qcowβ pulls in the members ofBlockdevOptionsQcow.qedβ pulls in the members ofBlockdevOptionsGenericCOWFormat.quorumβ pulls in the members ofBlockdevOptionsQuorum.rawβ pulls in the members ofBlockdevOptionsRaw.rbdβ pulls in the members ofBlockdevOptionsRbd.replicationβ pulls in the members ofBlockdevOptionsReplication.snapshot-accessβ pulls in the members ofBlockdevOptionsGenericFormat.sshβ pulls in the members ofBlockdevOptionsSsh.throttleβ pulls in the members ofBlockdevOptionsThrottle.vdiβ pulls in the members ofBlockdevOptionsGenericFormat.vhdxβ pulls in the members ofBlockdevOptionsGenericFormat.virtio-blk-vfio-pciβ pulls in the members ofBlockdevOptionsVirtioBlkVfioPci.virtio-blk-vhost-userβ pulls in the members ofBlockdevOptionsVirtioBlkVhostUser.virtio-blk-vhost-vdpaβ pulls in the members ofBlockdevOptionsVirtioBlkVhostVdpa.vmdkβ pulls in the members ofBlockdevOptionsGenericCOWFormat.vpcβ pulls in the members ofBlockdevOptionsGenericFormat.vvfatβ pulls in the members ofBlockdevOptionsVVFAT.
π«Ά Alternate BlockdevRef (Since: 2.9)
Okay so this one is literally just a reference to a block device. That's the whole vibe.
Alternatives π
definition(BlockdevOptions) β defines a new block device inline, right there on the spot πreference(string) β references the ID of an existing block device
π³οΈ Alternate BlockdevRefOrNull (Since: 2.9)
Same energy β a reference to a block device β but this one can also say "nah, nothing" π
Alternatives π
definition(BlockdevOptions) β defines a new block device inlinereference(string) β references the ID of an existing block device. An empty string means that no block device should be referenced. Deprecated; usenullinstead. β οΈnull(null) β No block device should be referenced (since 2.10)
π§± Command blockdev-add (Since: 2.9)
Creates a new block device. Fresh out the box, brand new, main character energy. π
Arguments
- The members of
BlockdevOptions.
Example:
-> { "execute": "blockdev-add",
"arguments": {
"driver": "qcow2",
"node-name": "test1",
"file": {
"driver": "file",
"filename": "test.qcow2"
}
}
}
<- { "return": {} }
Example:
-> { "execute": "blockdev-add",
"arguments": {
"driver": "qcow2",
"node-name": "node0",
"discard": "unmap",
"cache": {
"direct": true
},
"file": {
"driver": "file",
"filename": "/tmp/test.qcow2"
},
"backing": {
"driver": "raw",
"file": {
"driver": "file",
"filename": "/dev/fdset/4"
}
}
}
}
<- { "return": {} }
π Command blockdev-reopen (Since: 6.1)
Reopens one or more block devices using the given set of options. Big "we're doing a little refresh" energy. β¨
So here's the tea: any option not specified will be reset to its default value regardless of its previous status π. And if an option can't be changed, or a particular driver just doesn't support reopening, then the command will return an error. All devices in the list are reopened in one transaction, so if one of them fails then the whole transaction is cancelled β it's all or nothing, bestie, no half measures. π
The command receives a list of block devices to reopen. For each one of them, the top-level node-name option (from BlockdevOptions) must be specified and is used to select the block device to be reopened. Other node-name options must be either omitted or set to the current name of the appropriate node. This command won't change any node name and any attempt to do it will result in an error. π«
In the case of options that refer to child nodes, the behavior of this command depends on the value:
- A set of options (
BlockdevOptions): the child is reopened with the specified set of options. - A reference to the current child: the child is reopened using its existing set of options.
- A reference to a different node: the current child is replaced with the specified one.
null: the current child (if any) is detached.
Options (1) and (2) are supported in all cases. Option (3) is supported for file and backing, and option (4) for backing only. π
Unlike with blockdev-add, the backing option must always be present unless the node being reopened does not have a backing file and its image does not have a default backing file name as part of its metadata. So don't come for me when it complains, okay? π
Arguments
options([BlockdevOptions]) β Not documented
ποΈ Command blockdev-del (Since: 2.9)
Deletes a block device that has been added using blockdev-add. The command will fail if the node is attached to a device or is otherwise being used β you can't just yank it out while it's doing stuff, rude. π«
Arguments
node-name(string) β Name of the graph node to delete.
Example:
-> { "execute": "blockdev-add",
"arguments": {
"driver": "qcow2",
"node-name": "node0",
"file": {
"driver": "file",
"filename": "test.qcow2"
}
}
}
<- { "return": {} }
-> { "execute": "blockdev-del",
"arguments": { "node-name": "node0" }
}
<- { "return": {} }
π Command blockdev-set-active (Since: 10.0)
Activate or deactivate a block device. Use this to manage the handover of block devices on migration with qemu-storage-daemon. It's giving β¨passing the batonβ¨.
Activating a node automatically activates all of its child nodes first. Deactivating a node automatically deactivates any of its child nodes that are not in use by a still active node. The way it cascades is honestly iconic. π
Arguments
node-name(string, optional) β Name of the graph node to activate or deactivate. By default, all nodes are affected by the operation.active(boolean) βtrueif the nodes should be active when the command returns success,falseif they should be inactive.
Example:
-> { "execute": "blockdev-set-active",
"arguments": {
"node-name": "node0",
"active": false
}
}
<- { "return": {} }
π Object BlockdevCreateOptionsFile (Since: 2.12)
Driver specific image creation options for file. Let's build a whole image file from scratch, slay. π
Members
filename(string) β Filename for the new image filesize(int) β Size of the virtual disk in bytespreallocation(PreallocMode, optional) β Preallocation mode for the new image (default:off; allowed values:off,falloc(ifCONFIG_POSIX_FALLOCATE),full(ifCONFIG_POSIX))nocow(boolean, optional) β Turn off copy-on-write (valid only on btrfs; default:off)extent-size-hint(int, optional) β Extent size hint to add to the image file;0for not adding an extent size hint (default: 1 MB, since 5.1)
π Object BlockdevCreateOptionsLUKS (Since: 2.12)
Driver specific image creation options for LUKS. Encrypted, mysterious, locked down β she's private. π€«
Members
file(BlockdevRef, optional) β Node to create the image format on, mandatory except when 'preallocation' is not requestedheader(BlockdevRef, optional) β a block device that's holding a detached LUKS header, like the header got its own apartment. (since 9.0) πsize(int) β size of the virtual disk, in bytespreallocation(PreallocMode, optional) β preallocation mode for the new image (since: 4.2) (default:off; allowed values:off,metadata,falloc,full)- plus the members of
QCryptoBlockCreateOptionsLUKSβ they ride along in here, no cap π«Ά
πΈ Object BlockdevCreateOptionsNfs (Since: 2.12)
Driver specific image creation options for NFS. network storage bestie we love to see it β¨
Members
location(BlockdevOptionsNfs) β where to store the new image filesize(int) β size of the virtual disk, in bytes
π¦ Object BlockdevCreateOptionsParallels (Since: 2.12)
Driver specific image creation options for parallels. β¨
Members
file(BlockdevRef) β node to create the image format onsize(int) β size of the virtual disk, in bytescluster-size(int, optional) β cluster size in bytes (default:1 MB)
π Object BlockdevCreateOptionsQcow (Since: 2.12)
Driver specific image creation options for qcow. the original original, respect the elders π
Members
file(BlockdevRef) β node to create the image format onsize(int) β size of the virtual disk, in bytesbacking-file(string, optional) β file name of the backing file, if a backing file should be usedencrypt(QCryptoBlockCreateOptions, optional) β encryption options, if the image should be encrypted π
π§ Enum BlockdevQcow2Version (Since: 2.12)
Values
v2β the original QCOW2 format as introduced in QEMU 0.10 (version 2) β vintage, iconic, a little retro πv3β the extended QCOW2 format as introduced in QEMU 1.1 (version 3) β glow-up era β¨
π Enum Qcow2CompressionType (Since: 5.1)
Compression type used in qcow2 image file. so the image file gets β¨squishedβ¨
Values
zlibβ zlib compression, see <<http://zlib.net/>>zstdβ zstd compression, see <<http://github.com/facebook/zstd>>
π Object BlockdevCreateOptionsQcow2 (Since: 2.12)
Driver specific image creation options for qcow2. the main character of image formats, fr fr π
Members
file(BlockdevRef) β node to create the image format ondata-file(BlockdevRef, optional) β node to use as an external data file in which all guest data is stored, so that only metadata remains in the qcow2 file (since: 4.0) β metadata stays home, the actual data goes out πͺdata-file-raw(boolean, optional) βtrueif the external data file must stay valid as a standalone (read-only) raw image without looking at qcow2 metadata (default:false; since: 4.0)extended-l2(boolean, optional) βtrueto make the image have extended L2 entries (default:false; since 5.2)size(int) β size of the virtual disk, in bytesversion(BlockdevQcow2Version, optional) β compatibility level (default:v3)backing-file(string, optional) β file name of the backing file, if a backing file should be usedbacking-fmt(BlockdevDriver, optional) β name of the block driver to use for the backing fileencrypt(QCryptoBlockCreateOptions, optional) β encryption options, if the image should be encrypted πcluster-size(int, optional) β qcow2 cluster size in bytes (default:65536)preallocation(PreallocMode, optional) β preallocation mode for the new image (default:off; allowed values:off,falloc,full,metadata)lazy-refcounts(boolean, optional) βtrueif refcounts may be updated lazily (default:off) β procrastination, but make it filesystem πrefcount-bits(int, optional) β width of reference counts in bits (default:16)compression-type(Qcow2CompressionType, optional) β the image cluster compression method (default:zlib, since 5.1)
β Object BlockdevCreateOptionsQed (Since: 2.12)
Driver specific image creation options for qed. yes qed, the format, not the word, stay with me π«Ά
Members
file(BlockdevRef) β node to create the image format onsize(int) β size of the virtual disk, in bytesbacking-file(string, optional) β file name of the backing file, if a backing file should be usedbacking-fmt(BlockdevDriver, optional) β name of the block driver to use for the backing filecluster-size(int, optional) β cluster size in bytes (default:65536)table-size(int, optional) β L1/L2 table size (in clusters)
π₯ Object BlockdevCreateOptionsRbd (Since: 2.12)
Driver specific image creation options for rbd/Ceph. cluster storage era π
Members
location(BlockdevOptionsRbd) β where to store the new image file. β οΈ This location cannot point to a snapshot.size(int) β size of the virtual disk, in bytescluster-size(int, optional) β RBD object sizeencrypt(RbdEncryptionCreateOptions, optional) β image encryption options. (Since 6.1) π
π Enum BlockdevVmdkSubformat (Since: 4.0)
Subformat options for VMDK images. pick your fighter π
Values
monolithicSparseβ single file image with sparse cluster allocationmonolithicFlatβ single flat data image and a descriptor filetwoGbMaxExtentSparseβ data is split into 2GB (per virtual LBA) sparse extent files, in addition to a descriptor filetwoGbMaxExtentFlatβ data is split into 2GB (per virtual LBA) flat extent files, in addition to a descriptor filestreamOptimizedβ single file image sparse cluster allocation, optimized for streaming over network.
π Enum BlockdevVmdkAdapterType (Since: 4.0)
Adapter type info for VMDK images. and honestly? the docs are giving "we'll tell you later" π
Values
ideβ Not documentedbuslogicβ Not documentedlsilogicβ Not documentedlegacyESXβ Not documented
not a single crumb of documentation for these four, we simply respect the mystery π
π Object BlockdevCreateOptionsVmdk (Since: 4.0)
Driver specific image creation options for VMDK.
Members
file(BlockdevRef) β where to store the new image file. This refers to the image file formonolithcSparseandstreamOptimizedformat, or the descriptor file for other formats.size(int) β size of the virtual disk, in bytesextents([BlockdevRef], optional) β where to store the data extents. Required formonolithcFlat,twoGbMaxExtentSparseandtwoGbMaxExtentFlatformats. FormonolithicFlat, only one entry is required; fortwoGbMaxExtent*formats, the number of entries required is calculated asextent_number = virtual_size / 2GB. β οΈ Providing more extents than will be used is an error.subformat(BlockdevVmdkSubformat, optional) β the subformat of the VMDK image. Default:"monolithicSparse".backing-file(string, optional) β the path of backing file. Default: no backing file is used.adapter-type(BlockdevVmdkAdapterType, optional) β the adapter type used to fill in the descriptor. Default:ide.hwversion(string, optional) β hardware version. The meaningful options are"4"or"6". Default:"4".toolsversion(string, optional) β VMware guest tools version. Default:"2147483647"(Since 6.2)zeroed-grain(boolean, optional) β whether to enable zeroed-grain feature for sparse subformats. Default:false.
π¦ Object BlockdevCreateOptionsSsh (Since: 2.12)
Driver specific image creation options for SSH. image file, but make it remote π»β¨
Members
location(BlockdevOptionsSsh) β where to store the new image filesize(int) β size of the virtual disk, in bytes
πΈ Object BlockdevCreateOptionsVdi (Since: 2.12)
Driver specific image creation options for VDI.
Members
file(BlockdevRef) β node to create the image format onsize(int) β size of the virtual disk, in bytespreallocation(PreallocMode, optional) β preallocation mode for the new image (default:off; allowed values:off,metadata)
π Enum BlockdevVhdxSubformat (Since: 2.12)
Values
dynamicβ growing image file π±fixedβ preallocated fixed-size image file π§±
π Object BlockdevCreateOptionsVhdx (Since: 2.12)
Driver specific image creation options for vhdx.
Members
file(BlockdevRef) β node to create the image format onsize(int) β size of the virtual disk, in byteslog-size(int, optional) β log size in bytes, must be a multiple of1 MB(default:1 MB)block-size(int, optional) β block size in bytes, must be a multiple of1 MBand not larger than256 MB(default: automatically choose a block size depending on the image size)subformat(BlockdevVhdxSubformat, optional) β vhdx subformat (default:dynamic)block-state-zero(boolean, optional) β force use of payload blocks of type'ZERO'. Non-standard, but default. β οΈ Do not set to'off'when usingqemu-img convertwithsubformat=dynamic.
fr fr, that last one is not a vibe. leaveblock-state-zeroalone if you're converting withsubformat=dynamicπ
π Enum BlockdevVpcSubformat (Since: 2.12)
Values
dynamicβ growing image file π±fixedβ preallocated fixed-size image file π§±
β Object BlockdevCreateOptionsVpc (Since: 2.12)
Driver specific image creation options for vpc (VHD).
Members
file(BlockdevRef) β the node where the image format actually gets created πsize(int) β size of the virtual disk, in bytessubformat(BlockdevVpcSubformat, optional) β the vhdx subformat (default:dynamic)force-size(boolean, optional) β makes it use that exact byte size instead of rounding up to the next size that CHS geometry can represent (default:false)
π Object BlockdevCreateOptions (Since: 2.12)
Okay so this is the big umbrella one β options for creating an image format on a given node. Think of it as the "pick your fighter" wrapper π
Members
driver(BlockdevDriver) β which block driver is gonna create the image format- When
driverisfile: the members ofBlockdevCreateOptionsFile. ποΈ - When
driverisluks: the members ofBlockdevCreateOptionsLUKS. - When
driverisnfs: the members ofBlockdevCreateOptionsNfs. - When
driverisparallels: the members ofBlockdevCreateOptionsParallels. - When
driverisqcow: the members ofBlockdevCreateOptionsQcow. - When
driverisqcow2: the members ofBlockdevCreateOptionsQcow2. - When
driverisqed: the members ofBlockdevCreateOptionsQed. - When
driverisrbd: the members ofBlockdevCreateOptionsRbd. - When
driverisssh: the members ofBlockdevCreateOptionsSsh. - When
driverisvdi: the members ofBlockdevCreateOptionsVdi. - When
driverisvhdx: the members ofBlockdevCreateOptionsVhdx. - When
driverisvmdk: the members ofBlockdevCreateOptionsVmdk. - When
driverisvpc: the members ofBlockdevCreateOptionsVpc.
π οΈ Command blockdev-create (Since: 3.0)
Starts a job that creates an image format on a given node. And bestie, listen β the job finalizes itself automatically, but you still gotta do a manual job-dismiss afterward. No skipping that step, it's giving "close the door behind you" energy π
Arguments
job-id(string) β identifier for the newly created joboptions(BlockdevCreateOptions) β the options for the image creation
π Object BlockdevAmendOptionsLUKS (Since: 5.1)
Driver-specific image amend options for LUKS. slay π₯
Members
- The members of
QCryptoBlockAmendOptionsLUKS.
π§ Object BlockdevAmendOptionsQcow2 (Since: 5.1)
Driver-specific image amend options for qcow2. And for now? Only encryption options can be amended. That's it. That's the whole menu π
Members
encrypt(QCryptoBlockAmendOptions, optional) β the encryption options to be amended
β¨ Object BlockdevAmendOptions (Since: 5.1)
Options for amending an image format. Yes, amend. Like, changing your mind, but for disk images π¦
Members
driver(BlockdevDriver) β the block driver of the node you're amending- When
driverisluks: the members ofBlockdevAmendOptionsLUKS. - When
driverisqcow2: the members ofBlockdevAmendOptionsQcow2.
β οΈ Command x-blockdev-amend (Since: 5.1)
This command is unstable/experimental. π
Starts a job to amend format-specific options of an existing open block device. Same deal as before: the job is automatically finalized, but you do need a manual job-dismiss.
Arguments
job-id(string) β identifier for the newly created jobnode-name(string) β name of the block node to work onoptions(BlockdevAmendOptions) β options (driver specific)force(boolean, optional) β allows unsafe operations, format specific. Forluksthat means it allows erasing the last active keyslot (permanent loss of data, fr fr π) and replacement of an active keyslot (possible loss of data if an IO error happens)
Features
unstableβ this command is experimental.
π¨ Enum BlockErrorAction (Since: 2.1)
An enumeration of the action that's been taken when a DISK I/O occurs.
Values
ignoreβ the error has been ignoredreportβ the error has been reported to the devicestopβ the error caused the VM to be stopped π
π©Ή Event BLOCK_IMAGE_CORRUPTED (Since: 1.7)
Fires when a disk image is getting marked corrupt. You can identify the image by its device or node name. And heads up β the device field is always present for compatibility reasons, but it can be empty ("") if the image doesn't have a device name associated. Just how it is π«Ά
Members
device(string) β device name. This is always present for compatibility reasons, but it can be empty ("") if the image doesn't have a device name associated.node-name(string, optional) β node name (Since: 2.4)msg(string) β an informative message for human consumption, like the kind of corruption being detected. Do not parse this by machine β it is not guaranteed to be stable, bestie πoffset(int, optional) β if the corruption resulted from an image access, this is the host's access offset into the imagesize(int, optional) β if the corruption resulted from an image access, this is the access sizefatal(boolean) β if set, the image is marked corrupt and therefore unusable after this event and must be repaired (Since 2.2; before that, everyBLOCK_IMAGE_CORRUPTEDevent was fatal π)
Note: ifactionis"stop", aSTOPevent (<#event-QMP-run-state.STOP>) will eventually follow theBLOCK_IO_ERRORevent.
Example:
<- { "event": "BLOCK_IMAGE_CORRUPTED",
"data": { "device": "", "node-name": "drive", "fatal": false,
"msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)" },
"timestamp": { "seconds": 1648243240, "microseconds": 906060 } }
π₯ Event BLOCK_IO_ERROR (Since: 0.13)
Fires when a disk I/O error occurs. not the vibe π
Members
qom-path(string) β path to the device object in the QOM tree (since 9.2)device(string) β device name. This is always present for compatibility reasons, but it can be empty ("") if the image doesn't have a device name associated.node-name(string, optional) β node name. Note that errors may be reported for the root node that is directly attached to a guest device rather than for the node where the error actually occurred. The node name is not present if the drive is empty. (Since: 2.8)operation(IoOperationType) β the I/O operationaction(BlockErrorAction) β the action that has been takennospace(boolean, optional) βtrueif the I/O error was caused by a no-space condition. This key is only present ifquery-block'sio-statusis present, so please see thequery-blockdocumentation for more info (since: 2.2)reason(string) β a human-readable string describing the error cause. (This field is a debugging aid for humans β it should not be parsed by applications) (since: 2.2)
Note: ifactionis"stop", aSTOPevent (<#event-QMP-run-state.STOP>) will eventually follow theBLOCK_IO_ERRORevent.
Note: this event is rate-limited β except ifactionis"stop". π
Example:
<- { "event": "BLOCK_IO_ERROR",
"data": { "qom-path": "/machine/unattached/device[0]",
"device": "ide0-hd1",
"node-name": "#block212",
"operation": "write",
"action": "stop",
"reason": "No space left on device" },
"timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
β
Event BLOCK_JOB_COMPLETED (Since: 1.1)
Fires when a block job has completed. we love a finished job π
Members
type(JobType) β job typedevice(string) β the job identifier. Originally the device name, but other values are allowed since QEMU 2.7len(int) β maximum progress valueoffset(int) β current progress value. On success this is equal tolen. On failure this is less thanlen.speed(int) β rate limit, in bytes per seconderror(string, optional) β error message. Only present on failure. This field contains a human-readable error message. There are no semantics other than that streaming has failed, and clients should not try to interpret the error string π ββοΈ
Example:
<- { "event": "BLOCK_JOB_COMPLETED",
"data": { "type": "stream", "device": "virtio-disk0",
"len": 10737418240, "offset": 10737418240,
"speed": 0 },
"timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
β Event BLOCK_JOB_CANCELLED (Since: 1.1)
Fires when a block job has been cancelled. it's giving "we don't do that anymore" π«
Members
type(JobType) β job typedevice(string) β the job identifier. Originally the device name, but other values are allowed since QEMU 2.7len(int) β maximum progress valueoffset(int) β current progress value. On success this is equal tolen. On failure this is less thanlen.speed(int) β rate limit, in bytes per second
Example:
<- { "event": "BLOCK_JOB_CANCELLED",
"data": { "type": "stream", "device": "virtio-disk0",
"len": 10737418240, "offset": 134217728,
"speed": 0 },
"timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
π«Ά Event BLOCK_JOB_ERROR (Since: 1.3)
Fires off the moment a block job hits an error, bestie. Like the group chat notification you never wanna see.
Members
device(string) β the job identifier. Originally this was just the device name, but other values have been allowed since QEMU 2.7 π«operation(IoOperationType) β the I/O operationaction(BlockErrorAction) β the action that has been taken
Example:
<- { "event": "BLOCK_JOB_ERROR",
"data": { "device": "ide0-hd1",
"operation": "write",
"action": "stop" },
"timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
π Event BLOCK_JOB_READY (Since: 1.3)
Emitted when a block job is ready to complete. It's giving "I'm done, come get me" energy, honestly.
Members
type(JobType) β job typedevice(string) β the job identifier. Originally the device name, but other values are allowed since QEMU 2.7len(int) β maximum progress valueoffset(int) β current progress value. On success this equalslen. On failure it's less thanlenspeed(int) β rate limit, bytes per second
Note: the "ready to complete" status is always reset by a BLOCK_JOB_ERROR event. No cap, that's just how it is π«
Example:
<- { "event": "BLOCK_JOB_READY",
"data": { "device": "drive0", "type": "mirror", "speed": 0,
"len": 2097152, "offset": 2097152 },
"timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
β Event BLOCK_JOB_PENDING (Since: 2.12)
Emitted when a block job is waiting for explicit authorization to finalize graph changes via job-finalize. And like, if this job is part of a transaction, it won't emit this event until the transaction has converged first. Patience, bestie π§
Members
type(JobType) β job typeid(string) β the job identifier
Example:
<- { "event": "BLOCK_JOB_PENDING",
"data": { "type": "mirror", "id": "backup_1" },
"timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
πΈ Enum PreallocMode (Since: 2.2)
Preallocation mode of a QEMU image file. Preallocating is literally just reserving your seat before the movie starts π
Values
offβ no preallocationmetadataβ preallocate only for metadatafallocβ like full preallocation but it allocates disk space byposix_fallocate()rather than writing datafullβ preallocate all data by writing it to the device to ensure disk space is really available. This data may or may not be zero, depending on the image format and storage.fullpreallocation also sets up metadata correctly
π₯ Event BLOCK_WRITE_THRESHOLD (Since: 2.3)
Emitted when writes on a block device reach or exceed the configured write threshold. For thin-provisioned devices that means the device should be extended so it doesn't pause for disk exhaustion. Heads up: this event is one shot. Once it triggers, it needs to be re-registered with another block-set-write-threshold command. One and done, periodt β¨
Members
node-name(string) β graph node name on which the threshold was exceededamount-exceeded(int) β amount of data which exceeded the threshold, in byteswrite-threshold(int) β last configured threshold, in bytes
π Command block-set-write-threshold (Since: 2.3)
Changes the write threshold for a block drive. An event gets delivered if a write to this block drive crosses the configured threshold. The threshold is an offset, so it must be non-negative β no funny business with negative numbers bestie. Default is no write threshold. Setting the threshold to zero disables it.
It's useful for transparently resizing thin-provisioned drives without the guest OS noticing. Sneaky? A little. Iconic? Absolutely π
Arguments
node-name(string) β graph node name on which the threshold must be setwrite-threshold(int) β configured threshold for the block device, in bytes. Use0to disable the threshold
Example:
-> { "execute": "block-set-write-threshold",
"arguments": { "node-name": "mydev",
"write-threshold": 17179869184 } }
<- { "return": {} }
π¦ Command x-blockdev-change (Since: 2.7)
This command is unstable/experimental. π
Dynamically reconfigures the block driver state graph. Okay so right now it only supports adding and deleting quorum children. A child gets added at the end of the list of children, and its contents must be consistent with the other childrens' contents. Deleting a child that isn't last in the list of children is problematic, because it "renumbers" the children following it. Messy, lowkey π
Arguments
parent(string) β the id or name of the parent nodechild(string, optional) β the name of a child to be deleted. Mutually exclusive withnodenode(string, optional) β the name of the node to be added. Mutually exclusive withchild
Features
unstableβ this command is experimental
Example: add a new node to a quorum
-> { "execute": "blockdev-add",
"arguments": {
"driver": "raw",
"node-name": "new_node",
"file": { "driver": "file",
"filename": "test.raw" } } }
<- { "return": {} }
-> { "execute": "x-blockdev-change",
"arguments": { "parent": "disk1",
"node": "new_node" } }
<- { "return": {} }
Example: delete a quorum's node
-> { "execute": "x-blockdev-change",
"arguments": { "parent": "disk1",
"child": "children.1" } }
<- { "return": {} }
π Command x-blockdev-set-iothread (Since: 2.12)
This command is unstable/experimental. π
Moves a node and its children into the iothread. If iothread is null then it moves the node and its children into the main loop instead. Switching vibes, basically.
Important though: the node must not be attached to a BlockBackend. β
Arguments
node-name(string) β the name of the block driver nodeiothread(StrOrNull) β the name of theIOThreadobject, or null for the main loopforce(boolean, optional) βtrueif the node and its children should be moved when aBlockBackendis already attached
Features
unstableβ this command is experimental and intended for test cases that need control overIOThreads only
Example: move a node into an IOThread
-> { "execute": "x-blockdev-set-iothread",
"arguments": { "node-name": "disk1",
"iothread": "iothread0" } }
<- { "return": {} }
Example: move a node into the main loop
-> { "execute": "x-blockdev-set-iothread",
"arguments": { "node-name": "disk1",
"iothread": null } }
<- { "return": {} }
π Enum QuorumOpType (Since: 2.6)
An enumeration of the quorum operation types. The holy trinity of block operations, fr fr.
Values
readβ read operationwriteβ write operationflushβ flush operation
π Event QUORUM_FAILURE (Since: 2.0)
Emitted by the Quorum block driver if it fails to establish a quorum. The group project didn't reach consensus, imagining that π
Members
reference(string) β device name if defined, else node namesector-num(int) β number of the first sector of the failed read operationsectors-count(int) β failed read operation sector count
Note: this event is rate-limited. π¦
Example:
<- { "event": "QUORUM_FAILURE",
"data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
"timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
π Event QUORUM_REPORT_BAD (Since: 2.0)
Emitted to report a corruption of a Quorum file. Snitching on bad data, respectfully π«Ά
Members
type(QuorumOpType) β quorum operation type (Since 2.6)error(string, optional) β error message. Only present on failure. This field contains a human-readable error message. There are no semantics other than that the block layer reported an error, and clients should not try to interpret the error string. Don't overthink it πnode-name(string) β the graph node name of the block driver statesector-num(int) β number of the first sector of the failed read operationsectors-count(int) β failed read operation sector count
Note: this event is rate-limited. π¦
Example: read operation
<- { "event": "QUORUM_REPORT_BAD",
"data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
"type": "read" },
"timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
Example: flush operation
<- { "event": "QUORUM_REPORT_BAD",
"data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
"type": "flush", "error": "Broken pipe" },
"timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
π Object BlockdevSnapshotInternal (Since: 1.7)
The blueprint for an internal snapshot, bestie. Main character object energy.
Members
device(string) β the device name ornode-nameof a root node to generate the snapshot fromname(string) β the name of the internal snapshot to be created
πΈ Command blockdev-snapshot-internal-sync (Since: 1.7)
Okay so this one takes an internal snapshot of a block device, and it does it synchronously β meaning it finishes the whole thing before it answers you, no "yeah sure I'll get to it" energy. It only works when the image format you're using actually supports internal snapshots, bestie. And heads up: if name is an empty string, or a snapshot with that name is already chilling there, the whole thing just fails. No cap.
Arguments
- The members of
BlockdevSnapshotInternal.
Errors
- If
deviceis not a valid block device βGenericError - If any snapshot matching
namealready exists, ornameis empty βGenericError - If the format of the image used does not support it β
GenericError
Only some image formats such asqcow2andrbdsupport internal snapshots. Likeβ¦ check your format first, babe π
Example:
-> { "execute": "blockdev-snapshot-internal-sync",
"arguments": { "device": "ide-hd0",
"name": "snapshot0" }
}
<- { "return": {} }
ποΈ Command blockdev-snapshot-delete-internal-sync (Since: 1.7)
The synchronous delete to the sync's add β¨ It removes an internal snapshot of a block device, again only when the image format actually supports that. The snapshot gets identified by name or id or both β and yes, you need at least one of them, you can't just vibe and hope. On success it returns a SnapshotInfo for the snapshot it just yeeted.
Arguments
device(string) β the device name or node-name of a root node to delete the snapshot fromid(string, optional) β optional the snapshot's ID to be deletedname(string, optional) β optional the snapshot's name to be deleted
Return SnapshotInfo
Errors
- If
deviceis not a valid block device βGenericError - If snapshot not found β
GenericError - If the format of the image used does not support it β
GenericError - If
idandnameare both not specified βGenericError
Example:
-> { "execute": "blockdev-snapshot-delete-internal-sync",
"arguments": { "device": "ide-hd0",
"name": "snapshot0" }
}
<- { "return": {
"id": "1",
"name": "snapshot0",
"vm-state-size": 0,
"date-sec": 1000012,
"date-nsec": 10,
"vm-clock-sec": 100,
"vm-clock-nsec": 20,
"icount": 220414
}
}
π§© Object DummyBlockCoreForceArrays (Since: 8.0)
This one is literally not used by QMP at all β it's a hack to let us use BlockGraphInfoList internally. That's the whole personality. Iconic honestly.
Members
unused-block-graph-info([BlockGraphInfo]) β Not documented π
π 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, or0for 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 theQAuthZauthorization object used to validate the client's x509 distinguished name. This object is only resolved at time of use, so it 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,0for unlimited. Setting this to1also stops the server from advertising multiple client support (since 5.2; default: 100).
π‘ Object NbdServerOptions
Keep this type consistent with the NbdServerOptionsLegacy type, okay? The only intended difference is that it uses SocketAddress instead of SocketAddressLegacy. That's it. That's the tea. π«
Members
addr(SocketAddress) β Address on which to listen (since 4.2).- The members of
NbdServerOptionsBase.
π‘ Object NbdServerOptionsLegacy
The twin π« Keep this type consistent with the NbdServerOptions type β the only intended difference is that it uses 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, slay. Block devices can then be exported using nbd-server-add. The NBD server will present them as named exports β so for example, another QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME". Cute, right? π₯
Arguments
- The members of
NbdServerOptionsLegacy.
Errors
- if the server is already running
π·οΈ Object BlockExportOptionsNbdBase (Since: 5.0)
An NBD block export β these are the common options shared between nbd-server-add and the NBD branch of block-export-add. Sibling energy.
Members
name(string, optional) β Export name. If unspecified, thedeviceparameter 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 β these are the distinct options used in the NBD branch of block-export-add. Different branch, different vibe.
Members
bitmaps([BlockDirtyBitmapOrStr], optional) β Also export each of the named dirty bitmaps reachable fromdevice, so the NBD client can useNBD_OPT_SET_META_CONTEXTwith 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 useNBD_OPT_SET_META_CONTEXTwith 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. Very demure, very mindful.
Members
addr(SocketAddress) β Thevhost-usersocket on which to listen. Both'unix'and'fd'SocketAddresstypes 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. Pick your fighter:
Values
offβ Do not passallow_otheras a mount option.onβ Passallow_otheras a mount option.autoβ Try mounting withallow_otherfirst, and if that fails, retry withoutallow_other.
πͺ Object BlockExportOptionsFuse (Since: 6.0)
Availability: CONFIG_FUSE
Options for exporting a block graph node on some (file) mountpoint as a raw image. FUSE said "let me cook" and honestly it did.
Multi-threading note: The FUSE export supports multi-threading. Currently, requests are distributed across these threads in a round-robin fashion, i.e. independently of the CPU core from which a request originates. Rotating cast energy π
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 isoff, only QEMU's user is allowed access to this export. That cannot be changed even withchmodorchown. Enabling this option will allow other users access to the export with the FUSE mount option"allow_other". Note that usingallow_otheras a non-root user requiresuser_allow_otherto be enabled in the globalfuse.confconfiguration file. Inautomode (the default), the FUSE export driver will first attempt to mount the export withallow_other, and if that fails, try again without. (since 6.1; default: auto)
π§ Object BlockExportOptionsVduseBlk (Since: 7.1)
A vduse-blk block export. (Yes that's a whole thing, and yes it's serving.)
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 the legacy nbd-server-add command. Legacy but still cute π
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 exports a single dirty bitmap reachable from device, so the NBD client can useNBD_OPT_SET_META_CONTEXTwith the metadata context name"qemu:dirty-bitmap:BITMAP"to inspect that bitmap (since 4.0). π- the members of
BlockExportOptionsNbdBaseβ yep, those are included here too. π«Ά
π« Command nbd-server-add (Since: 1.3)
bestie, this command is deprecated. Not the vibe anymore.
Exports 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β that's the argument crew for this command.
Features
deprecatedβ This command is deprecated. Useblock-export-addinstead.
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)
deprecated alert π¨ β this one is also on the deprecated list.
Remove NBD export by name.
Arguments
name(string) β Block export id.mode(BlockExportRemoveMode, optional) β Mode of command operation. SeeBlockExportRemoveModedescription. Default is'safe'.
Features
deprecatedβ This command is deprecated. Useblock-export-delinstead.
Errors
- if the server is not running
- if export is not found
- if
modeis'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 exportvhost-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(BlockExportIothreads, optional) β The name(s) of one or more iothread object(s) where the export will run. The default is to use the thread currently associated with the block node. (since: 5.2; multi-threading since 10.1)fixed-iothread(boolean, optional) β True prevents the block node from being moved to another thread while the export is active. If true andiothreadis given, export creation fails if the block node cannot be moved to the iothread. Must not be true when giving multiple iothreads foriothread. 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
typeisnbd: The members ofBlockExportOptionsNbd. - When
typeisvhost-user-blk: The members ofBlockExportOptionsVhostUserBlk. - When
typeisfuse: The members ofBlockExportOptionsFuse. - When
typeisvduse-blk: The members ofBlockExportOptionsVduseBlk.
π§΅ Alternate BlockExportIothreads (Since: 10.1)
Specify a single or multiple I/O threads in which to run a block export's I/O.
Alternatives
single(string) β Run the export's I/O in the given single I/O thread.multi([string]) β Use multi-threading across the given set of I/O threads, which must not be empty.
Note: Passing a single I/O thread via this variant is still treated as multi-threading, which is different from using thesinglevariant. In particular, even if there only is a single I/O thread in the set, export types that do not support multi-threading will generally reject this variant, andBlockExportOptions.fixed-iothreadis always incompatible with it.
β¨ Command block-export-add (Since: 5.2)
Creates a new block export.
Arguments
- the members of
BlockExportOptionsβ that's what you pass in here.
ποΈ 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. SeeBlockExportRemoveModedescription. Default is'safe'.
Errors
- if the export is not found
- if
modeis'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 ablock-export-delcommand, but before the shutdown has completed)
π Command query-block-exports (Since: 5.2)
Return [BlockExportInfo] β A list 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 thechardev=...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)
Return information about current character devices.
Return [ChardevInfo]
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)
Return information about character device backends.
Return [ChardevBackendInfo]
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
πΎ 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β the data has to be base64-encoded text, and what gets written is its binary decoding πutf8β the UTF-8 encoding ofdatais what gets written β¨dataitself is always Unicode no matter which format you pick, just like every other string in QMP π
Okay so, example time, and yes it's giving main character:
-> { "execute": "ringbuf-write",
"arguments": { "device": "foo",
"data": "abcdefgh",
"format": "utf8" } }
<- { "return": {} }
π Command ringbuf-read (Since: 1.4)
Read from a ring buffer character device. Like, grab the tea straight out of the buffer π
Arguments
device(string) β the ring buffer character device namesize(int) β how many bytes to read at mostformat(DataFormat, optional) β the encoding of the data (defaults to'utf8'):base64β the data read gets returned in base64 encoding π«Άutf8β the data read gets interpreted as UTF-8. Bug alert π¨: this 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. Not ideal, but that's the situation, no cap.- The return value is always Unicode regardless of format, like any other string π
Return: string β the data read from the device
Example, because visuals help:
-> { "execute": "ringbuf-read",
"arguments": { "device": "foo",
"size": 1000,
"format": "utf8" } }
<- { "return": "abcdefgh" }
π¦ Object ChardevCommon (Since: 2.6)
Configuration shared across all chardev backends. The group chat settings everyone inherits π
Members
logfile(string, optional) β the name of a logfile to save output intologappend(boolean, optional) βtrueto append instead of truncate (defaults to false, which truncates)logtimestamp(boolean, optional) βtrueto insert timestamps into the logfile (default false) (since 11.0)
πΈ Object ChardevFile (Since: 1.4)
Configuration info for file chardevs. File girlies rise up π
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, which truncates) (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/ttyS0on Unix orCOM1:on Windows- The members of
ChardevCommonπ«Ά
π Object ChardevSocket (Since: 1.4)
Configuration info for (stream) socket chardevs. Big one, buckle up bestie π’
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 theQAuthZauthorization object against which the client's x509 distinguished name will be validated. This object is only resolved at time of use, so it can be deleted and recreated on the fly while the chardev server is active. If it's missing, it defaults 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 withserver: false. This use is deprecated πnodelay(boolean, optional) β setTCP_NODELAYsocket 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-ms(int, optional) β for a client socket, if a socket gets disconnected, then attempt a reconnect after the given number of milliseconds. Setting this to zero disables the function. (default: 0) (Since: 9.2)- The members of
ChardevCommonπ«Ά
π Object ChardevUdp (Since: 1.5)
Configuration info for datagram socket chardevs.
Members
remote(SocketAddressLegacy) β remote addresslocal(SocketAddressLegacy, optional) β local address- The 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. It's a whole little network in there fr fr.
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 asSIGINTtriggered by ^C) to 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 examplevdagent)- 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 (seedocs/spice-port-fqdn.txt)- The members of
ChardevCommonπ«Ά
π Enum ChardevVCEncoding (Since: 11.1)
Character encoding expected from the guest on a virtual console. Very "what language are we speaking" of it π¬
Values
cp437β CP437 (8-bit Extended ASCII / VGA). Every byte maps directly to a glyph; suitable for DOS or other guests that output raw CP437 π₯οΈutf8β UTF-8. Multi-byte sequences are decoded and then mapped back to CP437 glyphs for display; unmappable codepoints are shown as'?'. Suitable for modern Linux guests π§
β Object ChardevDBus (Since: 7.0)
Availability: CONFIG_DBUS_DISPLAY
Configuration info for DBus chardevs.
Members
name(string) β name of the channel (followingdocs/spice-port-fqdn.txt)encoding(ChardevVCEncoding, optional) β character encoding the guest is expected to use (since 11.1)- 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 charsencoding(ChardevVCEncoding, optional) β character encoding the guest is expected to use (since 11.1)- The members of
ChardevCommonπ«Ά
Note: these 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 π (yes, that's VNC in both lists β not me, that's literally what it says)
π¦ Object ChardevRingbuf (Since: 1.5)
Configuration info for ring buffer chardevs.
Members
size(int, optional) β ring buffer size, must be power of two, default is65536- The 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 PTY π- The members of
ChardevCommonπ«Ά
π
Enum ChardevBackendKind (Since: 1.4)
The full menu of chardev flavors. Order up π½οΈ
Values
fileβ regular filesserialβ serial host deviceparallelβ parallel host devicepipeβ pipes (since 1.5)socketβ stream socketudpβ datagram socket (since 1.5)ptyβ pseudo-terminalnullβ 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β lowkey just a synonym forringbuf(since 1.5)
Features πΈ
deprecatedβ ok somemoryis deprecated, bestie. useringbufinstead, fr fr.
Object wrappers β the glow-up era β¨
Object ChardevFileWrapper (Since: 1.4)
Members:
data(ChardevFile) β the config info for file chardevs π
Object ChardevHostdevWrapper (Since: 1.4)
Members:
data(ChardevHostdev) β config 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) β config info for datagram socket chardevs
Object ChardevCommonWrapper (Since: 2.6)
Members:
data(ChardevCommon) β the configuration that's shared across all chardev backends, iconic behavior honestly π
Object ChardevMuxWrapper (Since: 1.5)
Members:
data(ChardevMux) β configuration info for mux chardevs
Object ChardevHubWrapper (Since: 10.0)
Members:
data(ChardevHub) β config 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) β config 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) β config info for the 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) β config 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) β config info for pty chardevs
Object ChardevBackend (Since: 1.4) π
This is the configuration info for the new chardev backend, bestie β the whole package.
Members:
type(ChardevBackendKind) β the backend type- When
typeisfile: it's giving the members ofChardevFileWrapper. - When
typeisserial: the members ofChardevHostdevWrapper. - When
typeisparallel: the members ofChardevHostdevWrapper. - When
typeispipe: the members ofChardevHostdevWrapper. - When
typeissocket: the members ofChardevSocketWrapper. - When
typeisudp: the members ofChardevUdpWrapper. - When
typeispty: the members ofChardevPtyWrapper. - When
typeisnull: the members ofChardevCommonWrapper. - When
typeismux: the members ofChardevMuxWrapper. - When
typeishub: the members ofChardevHubWrapper. - When
typeismsmouse: the members ofChardevCommonWrapper. - When
typeiswctablet: the members ofChardevCommonWrapper. - When
typeisbraille: the members ofChardevCommonWrapper. - When
typeistestdev: the members ofChardevCommonWrapper. - When
typeisstdio: the members ofChardevStdioWrapper. - When
typeisconsole: the members ofChardevCommonWrapper. - When
typeisspicevmc: the members ofChardevSpiceChannelWrapper. - When
typeisspiceport: the members ofChardevSpicePortWrapper. - When
typeisqemu-vdagent: the members ofChardevQemuVDAgentWrapper. - When
typeisdbus: the members ofChardevDBusWrapper. - When
typeisvc: the members ofChardevVCWrapper. - When
typeisringbuf: the members ofChardevRingbufWrapper. - When
typeismemory: the members ofChardevRingbufWrapper.
Object ChardevReturn (Since: 1.4) π
The return info about the chardev backend you just created. slay.
Members:
pty(string, optional) β the name of the slave pseudoterminal device. it's present if and only if a chardev of type'pty'was created. no notes. π
Command chardev-add (Since: 1.4) π₯
Adds a character device backend. main character energy.
Arguments:
id(string) β the chardev's ID. must be unique, no sharing bestie.backend(ChardevBackend) β backend type and parameters
Returns: 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) π¦
Changes a character device backend. glow-up in progress.
Arguments:
id(string) β the chardev's IDbackend(ChardevBackend) β the new backend type and parameters
Returns: 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) π§
Removes a character device backend. we're blocking them.
Arguments:
id(string) β the chardev's ID. must not be in use, so don't even try it.
Example:
-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
<- { "return": {} }
Command chardev-send-break (Since: 2.10) π
Sends a break to a character device. rude but make it protocol.
Arguments:
id(string) β the chardev's ID
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. she's always keeping you posted.
Members:
id(string) β the device identifier of the virtio-serial portopen(boolean) βtrueif the guest has opened the virtio-serial port
Note: this event is rate-limited, bestie. don't spam it. π
Example:
<- { "event": "VSERPORT_CHANGE",
"data": { "id": "channel0", "open": true },
"timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
π‘οΈ USER AUTHORIZATION π‘οΈ
Okay bestie, this is the part where QEMU decides who's allowed in the club. Like a bouncer but for users. Let's go π
Enum QAuthZListPolicy <span>(Since: 4.0)</span>
The authorization policy result β basically, the verdict the bouncer hands down. yea or nay, no in-between fr.
Values
denyβ deny access π ββοΈ (sorry bestie, not today)allowβ allow access β¨ (come on in, icon)
Enum QAuthZListFormat <span>(Since: 4.0)</span>
The authorization policy match format β i.e. how we're comparing the username against the rule. Are we being literal or are we doing the wildcard thing? π€
Values
exactβ an exact string match π― (character for character, no cap)globβ string with?and*shell wildcard support π¦ (yes, the same wildcards your shell uses, iconic behaviour)
Object QAuthZListRule <span>(Since: 4.0)</span>
A single authorization rule. One line item on the bouncer's clipboard, if you will π
Members
match(string) β a string or glob to match against a user identity π«Ά (this is the thing we're comparing)policy(QAuthZListPolicy) β the result to return ifmatchevaluates to true π (so like, if this matches, this is what we say)format(QAuthZListFormat, optional) β the format of thematchrule (default'exact') πΈ (leave it off and we're being literal, mwah)
Object AuthZListProperties <span>(Since: 4.0)</span>
Properties for authz-list objects. Your basic hand-written rulebook, lowkey the simplest flavour π
Members
policy(QAuthZListPolicy, optional) β Default policy to apply when no rule matches (default:deny) π (yes, deny by default β if nothing matched, you're not getting in)rules([QAuthZListRule], optional) β Authorization rules based on matching user π (the actual list of rules, one per user match)
Object AuthZListFileProperties <span>(Since: 4.0)</span>
Properties for authz-listfile objects β same energy as above but the rulebook lives in a file, very main character π
Members
filename(string) β File name to load the configuration from. The file must contain valid JSON forAuthZListProperties. π§ (yep, valid JSON or we're not doing this)refresh(boolean, optional) β If true,inotifyis used to monitor the file, automatically reloading changes. If an error occurs during reloading, all authorizations will fail until the file is next successfully loaded. (default: true if the binary was built withCONFIG_INOTIFY1, false otherwise) π₯
β οΈ Not me warning you: that reload-error behaviour is serious. Break the file mid-flight and everyone gets locked out until it loads clean again. No pressure π
Object AuthZPAMProperties <span>(Since: 4.0)</span>
Properties for authz-pam objects. Delegating the vibes check to PAM, honestly a slay π
Members
service(string) β PAM service name to use for authorization π (that's it, that's the whole thing)
Object AuthZSimpleProperties <span>(Since: 4.0)</span>
Properties for authz-simple objects. One identity, one allow-list, extremely minimalist of it β¨
Members
identity(string) β Identifies the allowed user. Its format depends on the network service that authorization object is associated with. For authorizing based on TLS x509 certificates, the identity must be the x509 distinguished name. π
π«Ά Little reminder tucked in there: the format of identity isn't fixed β it's whatever the associated network service expects. And for TLS x509 cert authz specifically, it's gotta be the x509 distinguished name, periodt.
π TRANSACTIONS π
okay bestie, this is the group-chat of QMP β a bunch of actions all happening together, and if one of them flops it's giving whole-plan-cancelled energy. let's go β¨
Object Abort (Since: 1.6)
This action can be used to test transaction failure. fr, it's the "let's see if the error handling actually works" button π
Enum ActionCompletionMode (Since: 2.5)
An enumeration of transactional completion modes. like, how do we wanna finish this thing π
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. no cap, everybody does their own thing πΈ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. it's giving ride-or-die, all for one π«Ά
Enum TransactionActionKind (Since: 1.1)
the menu of what you can actually put in a transaction π
Values
abortβ Since 1.6block-dirty-bitmap-addβ Since 2.5block-dirty-bitmap-removeβ Since 4.2block-dirty-bitmap-clearβ Since 2.5block-dirty-bitmap-enableβ Since 4.0block-dirty-bitmap-disableβ Since 4.0block-dirty-bitmap-mergeβ Since 4.0blockdev-backupβ Since 2.3blockdev-snapshotβ Since 2.5blockdev-snapshot-internal-syncβ Since 1.7blockdev-snapshot-syncβ since 1.1drive-backupβ Since 1.6
Features
deprecatedβ Memberdrive-backupis deprecated. Use memberblockdev-backupinstead. ok so this one's old news, swap it out bestie π
Object AbortWrapper (Since: 1.6)
Members
data(Abort) β Not documented
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. it's the little envelope βοΈ β the type tag tells you which payload to unwrap, iykyk
Members
type(TransactionActionKind) β the operation to be performed- When
typeisabort: The members ofAbortWrapper. - When
typeisblock-dirty-bitmap-add: The members ofBlockDirtyBitmapAddWrapper. - When
typeisblock-dirty-bitmap-remove: The members ofBlockDirtyBitmapWrapper. - When
typeisblock-dirty-bitmap-clear: The members ofBlockDirtyBitmapWrapper. - When
typeisblock-dirty-bitmap-enable: The members ofBlockDirtyBitmapWrapper. - When
typeisblock-dirty-bitmap-disable: The members ofBlockDirtyBitmapWrapper. - When
typeisblock-dirty-bitmap-merge: The members ofBlockDirtyBitmapMergeWrapper. - When
typeisblockdev-backup: The members ofBlockdevBackupWrapper. - When
typeisblockdev-snapshot: The members ofBlockdevSnapshotWrapper. - When
typeisblockdev-snapshot-internal-sync: The members ofBlockdevSnapshotInternalWrapper. - When
typeisblockdev-snapshot-sync: The members ofBlockdevSnapshotSyncWrapper. - When
typeisdrive-backup: The members ofDriveBackupWrapper.
Object TransactionProperties (Since: 2.5)
Optional arguments to modify the behavior of a Transaction. the lil settings panel ποΈ
Members
completion-mode(ActionCompletionMode, optional) β Controls how jobs launched asynchronously by Actions will complete or fail as a group. SeeActionCompletionModefor 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. all-or-nothing, it's giving "we ride together, we die together" π₯
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.
β οΈ bestie read this twice: if you hand QEMU a file that already exists, it will wipe it. and when you bring your own externally-created file, QEMU literally cannot verify it matches β that's on you π
On failure, the original disks pre-snapshot attempt will be used. phew, our faves are safe π
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. SeeTransactionPropertiesfor 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. so like, you only get the first L reported, not the whole pile π
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": {} }
and that's the transaction tea π β next part's coming, don't go anywhere π¦
β¨ QMP MONITOR CONTROL β¨
Okay bestie, this is the monitor-control corner of the QMP universe β the part where you talk to the monitor itself, check versions, list commands, and gracefully dip out. No cap, every detail is here. π
πΈ Command qmp_capabilities (Since: 0.13)
Enable QMP capabilities. Itβs giving βturn on the extra-feature vibesβ for your QMP session.
Arguments
enable([QMPCapability], optional) β An optional list ofQMPCapabilityvalues 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 toqmp-spec.rstfor more information on OOB)
π Object VersionTriple (Since: 2.4)
A three-part version number. Basically the version-number trio, slay.
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 of50signifies a development branch. A micro version greater than or equal to90signifies a release candidate for the next minor version. A micro version of less than50signifies 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)
Return the current version of QEMU.
Return VersionInfo β An 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 of 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)
Request graceful QEMU process termination. Very βexit stage leftβ of it, honestly.
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:readlinein the system emulator,controlinqemu-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)
Okay so query-qmp-schema is literally the "what's even in here" command. It exposes the QMP wire ABI as an array of SchemaInfo. So like, QMP clients can figure out what commands and events this particular QEMU has, plus their parameters and their results. Iconic, honestly. π
Big caveat though bestie β the SchemaInfo can't reflect, like, all the rules and restrictions that apply to QMP. It's interface introspection (figuring out what's there), not interface specification. The actual spec lives in the QAPI schema. Periodt.
Also, and this is the part where you go "waitβ", while we strive to keep the QMP wire format backwards-compatible across QEMU versions, the introspection output is not guaranteed to have that same stability. Example time: one version of QEMU may list an object member as an optional non-variant, while another lists that 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. So yeah, vibe check before you hardcode anything. π
Returns [SchemaInfo] β
- an array where each element describes an entity in the ABI: command, event, type, ...
The order of the various elements is unspecified; however, all names are guaranteed to be unique (no name will be duplicated with different meta-types). Slay.
Note: the QAPI schema is also used to help define internal interfaces, by defining QAPI types. Those are not part of the QMP wire ABI, and therefore not returned by this command. Don't come for them, they're just not invited. π
Enum SchemaMetaType (Since: 2.5)
This is a SchemaInfo's meta type, i.e. the kind of entity it describes. The "what even are you" field.
Values
builtinβ a predefined type such as'int'or'bool'.enumβ an enumeration typearrayβ an array typeobjectβ an object type (struct or union)alternateβ an alternate typecommandβ a QMP commandeventβ a QMP event
Object SchemaInfo (Since: 2.5)
Members
name(string) β the entity's name, inherited from base. TheSchemaInfois 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 of meta-type.meta-type(SchemaMetaType) β the entity's meta type, inherited from base.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-typeisbuiltin: The members ofSchemaInfoBuiltin. - When
meta-typeisenum: The members ofSchemaInfoEnum. - When
meta-typeisarray: The members ofSchemaInfoArray. - When
meta-typeisobject: The members ofSchemaInfoObject. - When
meta-typeisalternate: The members ofSchemaInfoAlternate. - When
meta-typeiscommand: The members ofSchemaInfoCommand. - When
meta-typeisevent: 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'. Math girlies stay winning β¨
Values
stringβ JSON stringnumberβ JSON numberintβ JSON number that is an integerbooleanβ literalfalseortruenullβ literalnullobjectβ JSON objectarrayβ JSON arrayvalueβ 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β Membervaluesis deprecated. Usemembersinstead.
Values of this type are JSON string on the wire. No cap.
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 ofmemberswith this name must exist. (no skipping, bestie)variants([SchemaInfoObjectVariant], optional) β variant members, i.e. additional members that depend on the type tag's value. Present exactly whentagis present. The variants are in no particular order, and may even differ from the order of the values of the enum type of the tag.
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. (sneak peek energy π)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. (choose your fighter π)
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 tofalse(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. πΈοΈ
bestie it literally says "one of four forms" and then lists three. That's just how the page is. Don't @ me π
description(string, optional) β if specified, the description of the property.default-value(value, optional) β the default value, if any (since 5.0)
Object ObjectPropertyValue (Since: 10.1)
Members
name(string) β the name of the property.type(string) β the type of the property, as described inObjectPropertyInfo.value(value, optional) β the value of the property. Absent when the property cannot be read. (she's not ghosting you, she just can't be read π)
Object ObjectPropertiesValues (Since: 10.1)
Members
β¦and the member list keeps rolling straight into the next chunk, so stay tuned π
properties([ObjectPropertyValue]) β a list of properties, bestie. That's the vibe. π
Command qom-list (Since: 1.2) πΈ
Lists out the properties of an object when you hand it a path into the object model. Like a little tour of the house.
Arguments
path(string) β the path within the object model. Peepqom-getfor what this parameter actually means, iykyk.
Return [ObjectPropertyInfo] β a list that describes the properties of the object. Slay.
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) β¨
Gets you a property value. The main character of property reads, honestly.
Arguments
path(string) β
The path within the object model. There are two forms of supported paths β absolute and partial paths. Two flavors, both iconic. π
Absolute paths are derived from the root object and can follow child<> or link<> properties. And because they can follow link<> properties, they can be arbitrarily long β no cap, fr fr. 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 returned to indicate that the match was ambiguous. Lowkey chaotic but it works. π
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-list-get (Since: 10.1) π¦
Lists properties and their values for each object path in the input list. Glow-up behavior honestly β you get everything in one trip.
Arguments
paths([string]) β the absolute or partial path for each object, as described inqom-get.
Errors
- If any path is not valid or is ambiguous π
Return [ObjectPropertiesValues] β a list where each element is the result for the corresponding element of paths. One-to-one, matching energy, periodt.
Command qom-set (Since: 1.2) π₯
Sets a property value. Yes bestie, we're writing now.
Arguments
path(string) β seeqom-getfor a description of this parameter.property(string) β the property name to set.value(value) β a value whose type is appropriate for the property type. Seeqom-getfor 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. It's giving "search result card."
Members
name(string) β the type name found in the search.abstract(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) π
Returns a list of types given search parameters. Filter it how you like.
Arguments
implements(string, optional) β if specified, only return types that implement this type name.abstract(boolean, optional) β if true, include abstract types in the results.
Return [ObjectTypeInfo] β a list of types, or an empty list if no results are found. Empty list is still valid, we don't ghost here. π«Ά
Command qom-list-properties (Since: 2.12) β
Lists the 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. Heads up, bestie β some stuff just doesn't show up here. π
Return [ObjectPropertyInfo] β a list 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 to.canbus(string) β object ID of thecan-busobject 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_inand then dropped). Rude but efficient. πoutdev(string) β name of the character device backend to use for output.iothread(string) β name of the iothread to run in.notify_dev(string, optional) β name of the character device backend to be used to communicate with the remotecolo-frame(only for Xen COLO).compare_timeout(int, optional) β the maximum time to hold a packet fromprimary_infor comparison with an incoming packet onsecondary_in, in milliseconds (default:3000).expired_scan_cycle(int, optional) β the interval at whichcolo-comparechecks whether packets fromprimaryhave 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. Both of them, together, bestie.
Members
queues(int, optional) β the number of queues for the cryptodev backend. Ignored forcryptodev-backendand must be1forcryptodev-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 server.- The members of
CryptodevBackendProperties. (Yes, all of them β it inherits the whole fit. π)
Object DBusVMStateProperties (Since: 5.0) πΈ
Properties for dbus-vmstate objects.
Members
addr(string) β the name of the DBus bus to connect to.id-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. Placement is everything, honestly.
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 filter.queue(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 theinsertproperty. (default:"tail")insert(NetfilterInsert, optional) β this one tells QEMU where to slot the filter in, relative to whatever filter you named inposition. It's literally ignored ifpositionis"head"or"tail"(like, why would it matter, bestie, the ends are the ends π). Default:behind.
π§Ί Object FilterBufferProperties (Since: 2.5)
Properties for filter-buffer objects β the one that holds packets back like "girl wait a sec".
Members
interval(int) β a non-zero interval in microseconds. Every packet that shows up during that interval gets delayed until the interval ends. No cap, it's a real delay.- The members of
NetfilterProperties.
π¦ Object FilterDumpProperties (Since: 2.5)
Properties for filter-dump objects β the little data hoarder.
Members
file(string) β the filename where the dumped packets should be stored ποΈmaxlen(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 β it copies, it does not steal, very demure.
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.
Real talk: at least one ofindevoroutdevmust be present. And if you give it both, they must not point at the same character device backend. Non-negotiable π«Ά
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 β it edits packets mid-flight, main character energy fr.
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 β sharing one keyboard/mouse across machines, iconic behaviour.
Members
name(string) β the screen name as declared in thescreenssection ofbarrier.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. Linux girlies only, sorry π
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 β the shared DNA, iykyk.
Members
aio-max-batch(int, optional) β maximum number of requests in a batch for the AIO engine,0means 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.0means polling is disabled (default:32768on POSIX hosts,0otherwise)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.0selects 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.0selects a default behaviour (default:0)poll-weight(int, optional) β the weight factor for adaptive polling. Determines how much the most recent event interval affects the next polling duration calculation. If set to0, the system default value of3is used. Typical values:1(high weight on recent interval),2-4(moderate weight on recent interval). (default:0) (since 11.1)- The members of
EventLoopBaseProperties.
Fun fact that is also a fact: 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 β the whole memory family tree π³
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 (defaultfalsefor backendsmemory-backend-fileandmemory-backend-ram,truefor backendsmemory-backend-epc,memory-backend-memfd, andmemory-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 forramblock-id. Disable this for4.0machine types or older to allow migration with newer QEMU versions. (default:falsegenerally, buttruefor machine types<= 4.0)
Note:prealloc=trueandreserve=falsecannot be set at the same time. Withreserve=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=falsewill bail out if it cannot be configured accordingly. So likeβ¦ pick your combo carefully bestie π
π Object MemoryBackendFileProperties (Since: 2.1)
Properties for memory-backend-file objects β file-backed memory, the classic.
Members
align(int, optional) β the base address alignment when QEMUmmap(2)smem-path. Some backend stores specified bymem-pathrequire an alignment different than the default one used by QEMU, e.g. the device DAX/dev/dax0.0requires2Malignment rather than4K. In such cases, users can specify the required alignment via this option.0selects 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-datais only an optimization, and QEMU might not discard file contents if it aborts unexpectedly or is terminated usingSIGKILL. (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-pathis 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) β do we make Read Only Memory (ROM) that the VM literally cannot write to? Because any write attempt to that ROM gets denied, no cap. Most of the time you actually want writable RAM instead of ROM. But some specific use cases β like R/O NVDIMMs β really do eat with ROM. Here's the vibe check: set it to'on'and you get ROM, set it to'off'and you get writable RAM, and set it to'auto'and it just uses whatever thereadonlyproperty says. This property is mostly here to help when we want proper RAM in configs that would traditionally make ROM before this property even existed β think VM templating, where we want to open a file readonly (readonlyset to true) and mark the memory private for QEMU (shareset to false). For that use case we need writable RAM, not ROM, so you'd set this 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 we create lives in thehugetlbfsfilesystem (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).0picks a default page size. This option is ignored ifhugetlbis false. (default:0)seal(boolean, optional) β if true, create a sealed-file, which blocks any 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. Periodt. π
Members
- The members of
MemoryBackendProperties.
Object MemoryBackendEpcProperties (Since: 6.2)
Availability: CONFIG_LINUX
Properties for memory-backend-epc objects.
Heads up bestie: the merge boolean option is false by default with epc.
Also the 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 viagetfd <#command-QMP-misc.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 thelibvfio-userlibrarydevice(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 viagetfd <#command-QMP-misc.getfd>command, which represents a pre-opened/dev/iommu. This lets the iommufd object be shared across several subsystems (VFIO, VDPA, ...), and lets the file descriptor be shared with another process, e.g. DPDK. (default: QEMU opens/dev/iommuby 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.ACPI0016for 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 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.
ngl that node one is a whole essay, but it's all in the original so we're keeping every word of it. π
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 this; it's only provided for compatibility. (default:false)
Features
deprecatedβ Memberopenedis deprecated. Setting it to 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 daemon- The 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 IgvmCfgProperties (Since: 10.1)
Availability: CONFIG_IGVM
Properties common to objects that handle IGVM files.
Members
file(string) β IGVM file to use to configure guest
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)
Features
confidential-guest-resetβ If present, the hypervisor supports confidential guest resets (since 11.0).
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 legacyKVM_SEV_INITKVM interface for creating the VM. The newerKVM_SEV_INIT2interface, from Linux >= 6.10, syncs additional vCPU state when initializing the VMSA structures, which results in a different guest measurement. Set this to'on'to force compatibility with older QEMU or kernel versions that rely on legacyKVM_SEV_INITbehavior.'auto'will behave identically to'on', but will automatically switch to usingKVM_SEV_INIT2if the user specifies any additional options that require it. If set to'off', QEMU will requireKVM_SEV_INIT2unconditionally. (default:off) (since 9.1)- The members of
SevCommonProperties.
π Object SevSnpGuestProperties (Since: 9.1)
okay so these are the properties for sev-snp-guest objects β¨ heads up: most of them are literally direct arguments for the KVM_SNP_* interfaces, which are documented in the Linux kernel source under Documentation/arch/x86/amd-memory-encryption.rst, and those are in turn super tightly coupled with the SNP_INIT/SNP_LAUNCH_* firmware commands that live in the SEV-SNP Firmware ABI Specification (Rev 0.9). iykyk π
more usage info is also chilling in the QEMU source tree under docs/amd-memory-encryption. go look, bestie π«Ά
Members
policy(int, optional) β the'POLICY'parameter for theSNP_LAUNCH_STARTcommand, as defined in the SEV-SNP firmware ABI (default:0x30000)guest-visible-workarounds(string, optional) β a 16-byte, base64-encoded blob used to report hypervisor-defined workarounds, matching the'GOSVW'parameter of theSNP_LAUNCH_STARTcommand defined in the SEV-SNP firmware ABI (default: all-zero)id-block(string, optional) β a 96-byte, base64-encoded blob that provides the'ID Block'structure for theSNP_LAUNCH_FINISHcommand defined in the SEV-SNP firmware ABI (default: all-zero)id-auth(string, optional) β a 4096-byte, base64-encoded blob that provides the'ID Authentication Information Structure'for theSNP_LAUNCH_FINISHcommand defined in the SEV-SNP firmware ABI (default: all-zero)author-key-enabled(boolean, optional) βtrueif the'id-auth'blob contains the'AUTHOR_KEY'field defined in the SEV-SNP firmware ABI (default:false)host-data(string, optional) β a 32-byte, base64-encoded, user-defined blob to hand over to the guest, as documented for the'HOST_DATA'parameter of theSNP_LAUNCH_FINISHcommand in the SEV-SNP firmware ABI (default: all-zero)vcek-disabled(boolean, optional) β by default, guests are allowed to choose between VLEK (Versioned Loaded Endorsement Key) or VCEK (Versioned Chip Endorsement Key) when they request attestation reports from firmware. set this totrueto disable the use of VCEK. (default:false) (since: 9.1)- the members of
SevCommonProperties, bestie π
π₯ Object TdxGuestProperties (Since: 10.1)
properties for tdx-guest objects π§
Members
attributes(int, optional) β the'attributes'of a TD guest, passed toKVM_TDX_INIT_VMsept-ve-disable(boolean, optional) β toggles bit 28 of the TD attributes to control disabling of EPT violation conversion to#VEwhen a guest TD accesses PENDING pages. some guest OSes (e.g., Linux TD guest) may require this to be set β otherwise they literally refuse to boot πmrconfigid(string, optional) β ID for non-owner-defined configuration of the guest TD, e.g., run-time or OS configuration (base64 encoded SHA384 digest). defaults to all zeros.mrowner(string, optional) β ID for the guest TD's owner (base64 encoded SHA384 digest). defaults to all zeros.mrownerconfig(string, optional) β ID for owner-defined configuration of the guest TD, e.g., something specific to the workload rather than the run-time or OS (base64 encoded SHA384 digest). defaults to all zeros.quote-generation-socket(SocketAddress, optional) β socket address for the Quote Generation Service (QGS). QGS is a daemon running on the host. without it, the guest will not be able to get a TD quote for attestation π
Features
confidential-guest-resetβ if present, the hypervisor supports confidential guest resets (since 11.0) β¨
π§΅ 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 into a list of host CPU numbers used as CPU affinity. this is a shortcut for manually specifying the list of host CPU numbers belonging to the host nodes by settingcpu-affinity. (default: QEMU main thread affinity)
π₯οΈ Object MonitorProperties (Since: 11.1)
properties for all monitors π
Members
chardev(string) β the ID of the character device providing the monitor transport
β¨οΈ Object MonitorHMPProperties (Since: 11.1)
properties for the HMP monitor π
Members
readline(boolean, optional) β whether to enable readline for line editing (default:true)- the members of
MonitorProperties
πͺ Enum MonitorQMPCloseAction (Since: 11.1)
the action to take when the character device backend gets closed π«Ά
Values
noneβ take no actiondeleteβ delete both the'monitor-qmp'object and its associated character device backend object
π¬ Object MonitorQMPProperties (Since: 11.1)
properties for the QMP monitor β
Members
pretty(boolean, optional) β whether to pretty print JSON responses (default:false)close-action(MonitorQMPCloseAction, optional) β the action to take when the character device backend is closed (default:none)- the members of
MonitorProperties
π Enum ObjectType (Since: 6.0)
the whole roster of object types, no cap π
Values
acpi-generic-initiatorβ Not documentedacpi-generic-portβ Not documentedauthz-listβ Not documentedauthz-listfileβ Not documentedauthz-pamβ Not documentedauthz-simpleβ Not documentedcan-busβ Not documentedcan-host-socketcanβ Not documentedcolo-compareβ Not documentedcryptodev-backendβ Not documentedcryptodev-backend-builtinβ Not documentedcryptodev-backend-lkcfβ Not documentedcryptodev-vhost-userβ Not documenteddbus-vmstateβ Not documentedfilter-bufferβ Not documentedfilter-dumpβ Not documentedfilter-mirrorβ Not documentedfilter-redirectorβ Not documentedfilter-replayβ Not documentedfilter-rewriterβ Not documentedigvm-cfgβ Not documentedinput-barrierβ Not documentedinput-linuxβ Not documentediommufdβ Not documentediothreadβ Not documentedmain-loopβ Not documentedmemory-backend-epcβ Not documentedmemory-backend-fileβ Not documentedmemory-backend-memfdβ Not documentedmemory-backend-ramβ Not documentedmemory-backend-shmβ Not documentedmonitor-hmpβ Not documentedmonitor-qmpβ Not documentedpef-guestβ Not documentedpr-manager-helperβ Not documentedqtestβ Not documentedrng-builtinβ Not documentedrng-egdβ Not documentedrng-randomβ Not documentedsecretβ Not documentedsecret_keyringβ Not documentedsev-guestβ Not documentedsev-snp-guestβ Not documentedthread-contextβ Not documenteds390-pv-guestβ Not documentedtdx-guestβ Not documentedthrottle-groupβ Not documentedtls-creds-anonβ Not documentedtls-creds-pskβ Not documentedtls-creds-x509β Not documentedtls-cipher-suitesβ Not documentedx-remote-objectβ Not documentedx-vfio-user-serverβ Not documented
Features
unstableβ the membersx-remote-objectandx-vfio-user-serverare experimental π¬
π§© Object ObjectOptions (Since: 6.0)
describes the options of a user creatable QOM object, iconic behavior honestly π
Members
qom-type(ObjectType) β the class name for the object to be createdid(string) β the name of the new object- when
qom-typeisacpi-generic-initiator: the members ofAcpiGenericInitiatorProperties. - when
qom-typeisacpi-generic-port: the members ofAcpiGenericPortProperties. - when
qom-typeisauthz-list: the members ofAuthZListProperties. - when
qom-typeisauthz-listfile: the members ofAuthZListFileProperties. - when
qom-typeisauthz-pam: the members ofAuthZPAMProperties. - when
qom-typeisauthz-simple: the members ofAuthZSimpleProperties. - when
qom-typeiscan-host-socketcan: the members ofCanHostSocketcanProperties. - when
qom-typeiscolo-compare: the members ofColoCompareProperties. - when
qom-typeiscryptodev-backend: the members ofCryptodevBackendProperties. - when
qom-typeiscryptodev-backend-builtin: the members ofCryptodevBackendProperties. - when
qom-typeiscryptodev-backend-lkcf: the members ofCryptodevBackendProperties. - when
qom-typeiscryptodev-vhost-userβ you get the members ofCryptodevVhostUserPropertiesπ«Ά - when
qom-typeisdbus-vmstateβ the members ofDBusVMStatePropertiesβ¨ - when
qom-typeisfilter-bufferβ the members ofFilterBufferPropertiesπ - when
qom-typeisfilter-dumpβ the members ofFilterDumpPropertiesπ - when
qom-typeisfilter-mirrorβ the members ofFilterMirrorPropertiesπ¦ - when
qom-typeisfilter-redirectorβ the members ofFilterRedirectorPropertiesπΈ - when
qom-typeisfilter-replayβ the members ofNetfilterPropertiesβ - when
qom-typeisfilter-rewriterβ the members ofFilterRewriterPropertiesπ - when
qom-typeisigvm-cfgβ the members ofIgvmCfgPropertiesπ - when
qom-typeisinput-barrierβ the members ofInputBarrierPropertiesπ - when
qom-typeisinput-linuxβ the members ofInputLinuxPropertiesπ₯ - when
qom-typeisiommufdβ the members ofIOMMUFDPropertiesπ - when
qom-typeisiothreadβ the members ofIothreadPropertiesπ - when
qom-typeismain-loopβ the members ofMainLoopPropertiesπ§ - when
qom-typeismemory-backend-epcβ the members ofMemoryBackendEpcPropertiesπ - when
qom-typeismemory-backend-fileβ the members ofMemoryBackendFilePropertiesπ - when
qom-typeismemory-backend-memfdβ the members ofMemoryBackendMemfdPropertiesπ - when
qom-typeismemory-backend-ramβ the members ofMemoryBackendPropertiesπΈ - when
qom-typeismemory-backend-shmβ the members ofMemoryBackendShmPropertiesβ¨ - when
qom-typeismonitor-hmpβ the members ofMonitorHMPPropertiesπ - when
qom-typeismonitor-qmpβ the members ofMonitorQMPPropertiesπ - when
qom-typeispr-manager-helperβ the members ofPrManagerHelperPropertiesπ¦ - when
qom-typeisqtestβ the members ofQtestPropertiesβ - when
qom-typeisrng-builtinβ the members ofRngPropertiesπ - when
qom-typeisrng-egdβ the members ofRngEgdPropertiesπ - when
qom-typeisrng-randomβ the members ofRngRandomPropertiesπ - when
qom-typeissecretβ the members ofSecretPropertiesπ₯ - when
qom-typeissecret_keyringβ the members ofSecretKeyringPropertiesπ - when
qom-typeissev-guestβ the members ofSevGuestPropertiesπ - when
qom-typeissev-snp-guestβ the members ofSevSnpGuestPropertiesπ§ - when
qom-typeistdx-guestβ the members ofTdxGuestPropertiesπ - when
qom-typeisthread-contextβ the members ofThreadContextPropertiesπ - when
qom-typeisthrottle-groupβ the members ofThrottleGroupPropertiesπ - when
qom-typeistls-creds-anonβ the members ofTlsCredsAnonPropertiesπΈ - when
qom-typeistls-creds-pskβ the members ofTlsCredsPskPropertiesβ¨ - when
qom-typeistls-creds-x509β the members ofTlsCredsX509Propertiesπ - when
qom-typeistls-cipher-suitesβ the members ofTlsCredsPropertiesπ - when
qom-typeisx-remote-objectβ the members ofRemoteObjectPropertiesπ¦ - when
qom-typeisx-vfio-user-serverβ the members ofVfioUserServerPropertiesβ
π Command object-add (Since: 2.0)
okay so this one is literally the "make me a new QOM object" button β¨ Create a QOM object, that's the whole vibe.
Arguments
- The members of
ObjectOptionsπ«Ά
Errors
- if
qom-typeisn't a valid class name, it's giving error energy π
Example, copy it exactly bestie:
-> { "execute": "object-add",
"arguments": { "qom-type": "rng-random", "id": "rng1",
"filename": "/dev/hwrng" } }
<- { "return": {} }
ποΈ Command object-del (Since: 2.0)
the opposite energy: remove a QOM object. bye bestie π
Arguments
id(string) β the name of the QOM object you wanna remove π
Errors
- if
idisn't a valid id for a QOM object, yeah that's a no π
Example:
-> { "execute": "object-del", "arguments": { "id": "rng1" } }
<- { "return": {} }
π Copyright
2026, The QEMU Project Developers π
and that's a wrap on the whole page, bestie!! π you made it to the end of QEMU-STORAGE-DAEMON-QMP-REF(7) β version 11.1.3, dated Oct 29, 2026, brought to you by the QEMU Project Developers. go forth and QMP responsibly β¨π
π
π¦ where this page comes from
- arch rolling: qemu-img 11.1.3-1 Β· BSD-2-Clause AND BSD-2-Clause-Patent AND BSD-3-Clause AND CC0-1.0 AND FSFAP AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Linux-syscall-note AND GPL-2.0-only WITH Linux-syscall-note OR BSD-2-Clause AND GPL-2.0-only WITH Linux-syscall-note OR BSD-3-Clause AND GPL-2.0-or-later AND GPL-2.0-or-later OR BSD-3-Clause AND GPL-2.0-or-later WITH Linux-syscall-note AND ISC AND LGPL-2.1-only OR BSD-3-Clause AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND LicenseRef-Public-Domain AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms