# @write_threshold: configured write threshold for the device.
# 0 if disabled. (Since 2.3)
#
+# @dirty-bitmaps: dirty bitmaps information (only present if node
+# has one or more dirty bitmaps) (Since 4.2)
+#
# Since: 0.14.0
#
##
'*bps_wr_max_length': 'int', '*iops_max_length': 'int',
'*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
'*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
- 'write_threshold': 'int' } }
+ 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
##
# @BlockDeviceIoStatus:
# recording new writes. If the bitmap was @disabled, it is not
# recording new writes. (Since 2.12)
#
+# @inconsistent: This is a persistent dirty bitmap that was marked in-use on
+# disk, and is unusable by QEMU. It can only be deleted.
+# Please rely on the inconsistent field in @BlockDirtyInfo
+# instead, as the status field is deprecated. (Since 4.0)
+#
# Since: 2.4
##
{ 'enum': 'DirtyBitmapStatus',
- 'data': ['active', 'disabled', 'frozen', 'locked'] }
+ 'data': ['active', 'disabled', 'frozen', 'locked', 'inconsistent'] }
##
# @BlockDirtyInfo:
#
# @granularity: granularity of the dirty bitmap in bytes (since 1.4)
#
-# @status: current status of the dirty bitmap (since 2.4)
+# @status: Deprecated in favor of @recording and @locked. (since 2.4)
+#
+# @recording: true if the bitmap is recording new writes from the guest.
+# Replaces `active` and `disabled` statuses. (since 4.0)
+#
+# @busy: true if the bitmap is in-use by some operation (NBD or jobs)
+# and cannot be modified via QMP or used by another operation.
+# Replaces `locked` and `frozen` statuses. (since 4.0)
#
-# @persistent: true if the bitmap will eventually be flushed to persistent
-# storage (since 4.0)
+# @persistent: true if the bitmap was stored on disk, is scheduled to be stored
+# on disk, or both. (since 4.0)
+#
+# @inconsistent: true if this is a persistent bitmap that was improperly
+# stored. Implies @persistent to be true; @recording and
+# @busy to be false. This bitmap cannot be used. To remove
+# it, use @block-dirty-bitmap-remove. (Since 4.0)
#
# Since: 1.3
##
{ 'struct': 'BlockDirtyInfo',
'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
- 'status': 'DirtyBitmapStatus', 'persistent': 'bool' } }
+ 'recording': 'bool', 'busy': 'bool', 'status': 'DirtyBitmapStatus',
+ 'persistent': 'bool', '*inconsistent': 'bool' } }
##
# @Qcow2BitmapInfoFlags:
#
# Manage read, write and flush latency histograms for the device.
#
-# If only @device parameter is specified, remove all present latency histograms
+# If only @id parameter is specified, remove all present latency histograms
# for the device. Otherwise, add/reset some of (or all) latency histograms.
#
# @id: The name or QOM path of the guest device.
# [0, 10), [10, 50), [50, 100), [100, +inf):
#
# -> { "execute": "block-latency-histogram-set",
-# "arguments": { "device": "drive0",
+# "arguments": { "id": "drive0",
# "boundaries": [10, 50, 100] } }
# <- { "return": {} }
#
# not changed (or not created):
#
# -> { "execute": "block-latency-histogram-set",
-# "arguments": { "device": "drive0",
+# "arguments": { "id": "drive0",
# "boundaries-write": [10, 50, 100] } }
# <- { "return": {} }
#
# write: [0, 1000), [1000, 5000), [5000, +inf)
#
# -> { "execute": "block-latency-histogram-set",
-# "arguments": { "device": "drive0",
+# "arguments": { "id": "drive0",
# "boundaries": [10, 50, 100],
# "boundaries-write": [1000, 5000] } }
# <- { "return": {} }
# Example: remove all latency histograms:
#
# -> { "execute": "block-latency-histogram-set",
-# "arguments": { "device": "drive0" } }
+# "arguments": { "id": "drive0" } }
# <- { "return": {} }
##
{ 'command': 'block-latency-histogram-set',
#
# @dirty-bitmaps: dirty bitmaps information (only present if the
# driver has one or more dirty bitmaps) (Since 2.0)
+# Deprecated in 4.2; see BlockDeviceInfo instead.
#
# @io-status: @BlockDeviceIoStatus. Only present if the device
# supports it and the VM is configured to stop on errors
#
# @none: only copy data written from now on
#
-# @incremental: only copy data described by the dirty bitmap. Since: 2.4
+# @incremental: only copy data described by the dirty bitmap. (since: 2.4)
+#
+# @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
+# Behavior on completion is determined by the BitmapSyncMode.
#
# Since: 1.3
##
{ 'enum': 'MirrorSyncMode',
- 'data': ['top', 'full', 'none', 'incremental'] }
+ 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
+
+##
+# @BitmapSyncMode:
+#
+# An enumeration of possible behaviors for the synchronization of a bitmap
+# when used for data copy operations.
+#
+# @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.
+#
+# Since: 4.2
+##
+{ 'enum': 'BitmapSyncMode',
+ 'data': ['on-success', 'never', 'always'] }
##
# @MirrorCopyMode:
#
# Either @device or @node-name must be set but not both.
#
-# @device: the name of the device to generate the snapshot from.
+# @device: the name of the device to take a snapshot of.
#
# @node-name: graph node name to generate the snapshot from (Since 2.0)
#
-# @snapshot-file: the target of the new image. If the file exists, or
-# if it is a device, the snapshot will be created in the existing
-# file/device. Otherwise, a new file will be created.
+# @snapshot-file: 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.
#
# @snapshot-node-name: the graph node name of the new image (Since 2.0)
#
-# @format: the format of the snapshot image, default is 'qcow2'.
+# @format: the format of the overlay image, default is 'qcow2'.
#
# @mode: whether and how QEMU should create a new image, default is
# 'absolute-paths'.
##
# @BlockdevSnapshot:
#
-# @node: device or node name that will have a snapshot created.
+# @node: device or node name that will have a snapshot taken.
#
# @overlay: reference to the existing block device that will become
-# the overlay of @node, as part of creating the snapshot.
+# the overlay of @node, as part of taking the snapshot.
# It must not have a current backing file (this can be
# achieved by passing "backing": null to blockdev-add).
#
'data': { 'node': 'str', 'overlay': 'str' } }
##
-# @DriveBackup:
+# @BackupCommon:
#
# @job-id: identifier for the newly-created block job. If
# omitted, the device name will be used. (Since 2.7)
#
# @device: the device name or node-name of a root node which should be copied.
#
-# @target: 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: the format of the new destination, default is to
-# probe if @mode is 'existing', else the format of the source
-#
# @sync: what parts of the disk image should be copied to the destination
# (all the disk, only the sectors allocated in the topmost image, from a
# dirty bitmap, or only new I/O).
#
-# @mode: whether and how QEMU should create a new image, default is
-# 'absolute-paths'.
+# @speed: the maximum speed, in bytes per second. The default is 0,
+# for unlimited.
#
-# @speed: the maximum speed, in bytes per second
+# @bitmap: The name of a dirty bitmap to use.
+# Must be present if sync is "bitmap" or "incremental".
+# Can be present if sync is "full" or "top".
+# Must not be present otherwise.
+# (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
#
-# @bitmap: the name of dirty bitmap if sync is "incremental".
-# Must be present if sync is "incremental", must NOT be present
-# otherwise. (Since 2.4)
+# @bitmap-mode: 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: true to compress data, if the target format supports it.
# (default: false) (since 2.8)
# I/O. If an error occurs during a guest write request, the device's
# rerror/werror actions will be used.
#
-# Since: 1.6
+# Since: 4.2
##
-{ 'struct': 'DriveBackup',
- 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
- '*format': 'str', 'sync': 'MirrorSyncMode',
- '*mode': 'NewImageMode', '*speed': 'int',
- '*bitmap': 'str', '*compress': 'bool',
+{ 'struct': 'BackupCommon',
+ 'data': { '*job-id': 'str', 'device': 'str',
+ 'sync': 'MirrorSyncMode', '*speed': 'int',
+ '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
+ '*compress': 'bool',
'*on-source-error': 'BlockdevOnError',
'*on-target-error': 'BlockdevOnError',
'*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
##
-# @BlockdevBackup:
-#
-# @job-id: identifier for the newly-created block job. If
-# omitted, the device name will be used. (Since 2.7)
-#
-# @device: the device name or node-name of a root node which should be copied.
-#
-# @target: the device name or node-name of the backup target node.
-#
-# @sync: 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).
-#
-# @speed: the maximum speed, in bytes per second. The default is 0,
-# for unlimited.
-#
-# @bitmap: the name of dirty bitmap if sync is "incremental".
-# Must be present if sync is "incremental", must NOT be present
-# otherwise. (Since 3.1)
-#
-# @compress: true to compress data, if the target format supports it.
-# (default: false) (since 2.8)
+# @DriveBackup:
#
-# @on-source-error: 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 (see BlockInfo).
+# @target: 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.
#
-# @on-target-error: the action to take on an error on the target,
-# default 'report' (no limitations, since this applies to
-# a different block device than @device).
+# @format: the format of the new destination, default is to
+# probe if @mode is 'existing', else the format of the source
#
-# @auto-finalize: When false, this job will wait in a PENDING state after it has
-# finished its work, waiting for @block-job-finalize before
-# making any block graph changes.
-# When true, this job will automatically
-# perform its abort or commit actions.
-# Defaults to true. (Since 2.12)
+# @mode: whether and how QEMU should create a new image, default is
+# 'absolute-paths'.
#
-# @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
-# has completely ceased all work, and awaits @block-job-dismiss.
-# When true, this job will automatically disappear from the query
-# list without user intervention.
-# Defaults to true. (Since 2.12)
+# Since: 1.6
+##
+{ 'struct': 'DriveBackup',
+ 'base': 'BackupCommon',
+ 'data': { 'target': 'str',
+ '*format': 'str',
+ '*mode': 'NewImageMode' } }
+
+##
+# @BlockdevBackup:
#
-# Note: @on-source-error and @on-target-error only affect background
-# I/O. If an error occurs during a guest write request, the device's
-# rerror/werror actions will be used.
+# @target: the device name or node-name of the backup target node.
#
# Since: 2.3
##
{ 'struct': 'BlockdevBackup',
- 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
- 'sync': 'MirrorSyncMode', '*speed': 'int',
- '*bitmap': 'str', '*compress': 'bool',
- '*on-source-error': 'BlockdevOnError',
- '*on-target-error': 'BlockdevOnError',
- '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
+ 'base': 'BackupCommon',
+ 'data': { 'target': 'str' } }
##
# @blockdev-snapshot-sync:
#
-# Generates a synchronous snapshot of a block device.
+# Takes a synchronous snapshot of a block device.
#
# For the arguments, see the documentation of BlockdevSnapshotSync.
#
##
# @blockdev-snapshot:
#
-# Generates a snapshot of a block device.
+# Takes a snapshot of a block device.
#
-# Create a snapshot, by installing 'node' as the backing image of
+# Take a snapshot, by installing 'node' as the backing image of
# 'overlay'. Additionally, if 'node' is associated with a block
# device, the block device changes to using 'overlay' as its new active
# image.
'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
'*persistent': 'bool', '*autoload': 'bool', '*disabled': 'bool' } }
+##
+# @BlockDirtyBitmapMergeSource:
+#
+# @local: name of the bitmap, attached to the same node as target bitmap.
+#
+# @external: bitmap with specified node
+#
+# Since: 4.1
+##
+{ 'alternate': 'BlockDirtyBitmapMergeSource',
+ 'data': { 'local': 'str',
+ 'external': 'BlockDirtyBitmap' } }
+
##
# @BlockDirtyBitmapMerge:
#
-# @node: name of device/node which the bitmap is tracking
+# @node: name of device/node which the @target bitmap is tracking
#
# @target: name of the destination dirty bitmap
#
-# @bitmaps: name(s) of the source dirty bitmap(s)
+# @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully
+# specifed BlockDirtyBitmap elements. The latter are supported
+# since 4.1.
#
# Since: 4.0
##
{ 'struct': 'BlockDirtyBitmapMerge',
- 'data': { 'node': 'str', 'target': 'str', 'bitmaps': ['str'] } }
+ 'data': { 'node': 'str', 'target': 'str',
+ 'bitmaps': ['BlockDirtyBitmapMergeSource'] } }
##
# @block-dirty-bitmap-add:
# @locking: 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: invalidate page cache during live migration. This prevents
+# stale data on the migration destination with cache.direct=off.
+# Currently only supported on Linux hosts.
+# (default: on, since: 4.0)
# @x-check-cache-dropped: 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, enabled auto-read-only means 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.
+#
# Since: 2.9
##
{ 'struct': 'BlockdevOptionsFile',
'*pr-manager': 'str',
'*locking': 'OnOffAuto',
'*aio': 'BlockdevAioOptions',
- '*x-check-cache-dropped': 'bool' } }
+ '*drop-cache': {'type': 'bool',
+ 'if': 'defined(CONFIG_LINUX)'},
+ '*x-check-cache-dropped': 'bool' },
+ 'features': [ { 'name': 'dynamic-auto-read-only',
+ 'if': 'defined(CONFIG_POSIX)' } ] }
##
# @BlockdevOptionsNull:
# @latency-ns: emulated latency (in nanoseconds) in processing
# requests. Default to zero which completes requests immediately.
# (Since 2.4)
+# @read-zeroes: if true, reads from the device produce zeroes; if false, the
+# buffer is left unchanged. (default: false; since: 4.1)
#
# Since: 2.9
##
{ 'struct': 'BlockdevOptionsNull',
- 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
+ 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
##
# @BlockdevOptionsNVMe:
#
# @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)
+#
# Since: 2.9
##
{ 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
- 'cor_write'] }
+ 'cor_write', 'cluster_alloc_space', 'none'] }
+
+##
+# @BlkdebugIOType:
+#
+# Kinds of I/O that blkdebug can inject errors in.
+#
+# @read: .bdrv_co_preadv()
+#
+# @write: .bdrv_co_pwritev()
+#
+# @write-zeroes: .bdrv_co_pwrite_zeroes()
+#
+# @discard: .bdrv_co_pdiscard()
+#
+# @flush: .bdrv_co_flush_to_disk()
+#
+# @block-status: .bdrv_co_block_status()
+#
+# Since: 4.1
+##
+{ 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
+ 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
+ 'block-status' ] }
##
# @BlkdebugInjectErrorOptions:
# @state: the state identifier blkdebug needs to be in to
# actually trigger the event; defaults to "any"
#
+# @iotype: the type of I/O operations on which this error should
+# be injected; defaults to "all read, write,
+# write-zeroes, discard, and flush operations"
+# (since: 4.1)
+#
# @errno: error identifier (errno) to be returned; defaults to
# EIO
#
{ 'struct': 'BlkdebugInjectErrorOptions',
'data': { 'event': 'BlkdebugEvent',
'*state': 'int',
+ '*iotype': 'BlkdebugIOType',
'*errno': 'int',
'*sector': 'int',
'*once': 'bool',
# traditional "base:allocation" block status (see
# NBD_OPT_LIST_META_CONTEXT in the NBD protocol) (since 3.0)
#
+# @reconnect-delay: On an unexpected disconnect, the nbd client tries to
+# connect again until succeeding or encountering a serious
+# error. During the first @reconnect-delay seconds, all
+# requests are paused and will be rerun on a successful
+# reconnect. After that time, any delayed requests and all
+# future requests before a successful reconnect will
+# immediately fail. Default 0 (Since 4.2)
+#
# Since: 2.9
##
{ 'struct': 'BlockdevOptionsNbd',
'data': { 'server': 'SocketAddress',
'*export': 'str',
'*tls-creds': 'str',
- '*x-dirty-bitmap': 'str' } }
+ '*x-dirty-bitmap': 'str',
+ '*reconnect-delay': 'uint32' } }
##
# @BlockdevOptionsRaw:
#
# @filename Filename for the new image file
# @size Size of the virtual disk in bytes
-# @preallocation Preallocation mode for the new image (default: off)
+# @preallocation Preallocation mode for the new image (default: off;
+# allowed values: off,
+# falloc (if defined CONFIG_POSIX_FALLOCATE),
+# full (if defined CONFIG_POSIX))
# @nocow Turn off copy-on-write (valid only on btrfs; default: off)
#
# Since: 2.12
#
# @location Where to store the new image file
# @size Size of the virtual disk in bytes
-# @preallocation Preallocation mode for the new image (default: off)
+# @preallocation Preallocation mode for the new image (default: off;
+# allowed values: off,
+# falloc (if defined CONFIG_GLUSTERFS_FALLOCATE),
+# full (if defined CONFIG_GLUSTERFS_ZEROFILL))
#
# Since: 2.12
##
#
# @file Node to create the image format on
# @size Size of the virtual disk in bytes
+# @preallocation Preallocation mode for the new image
+# (since: 4.2)
+# (default: off; allowed values: off, metadata, falloc, full)
#
# Since: 2.12
##
{ 'struct': 'BlockdevCreateOptionsLUKS',
'base': 'QCryptoBlockCreateOptionsLUKS',
'data': { 'file': 'BlockdevRef',
- 'size': 'size' } }
+ 'size': 'size',
+ '*preallocation': 'PreallocMode' } }
##
# @BlockdevCreateOptionsNfs:
# @backing-fmt Name of the block driver to use for the backing file
# @encrypt Encryption options if the image should be encrypted
# @cluster-size qcow2 cluster size in bytes (default: 65536)
-# @preallocation Preallocation mode for the new image (default: off)
+# @preallocation Preallocation mode for the new image (default: off;
+# allowed values: off, falloc, full, metadata)
# @lazy-refcounts True if refcounts may be updated lazily (default: off)
# @refcount-bits Width of reference counts in bits (default: 16)
#
# @location Where to store the new image file
# @size Size of the virtual disk in bytes
# @backing-file File name of a base image
-# @preallocation Preallocation mode (allowed values: off, full)
+# @preallocation Preallocation mode for the new image (default: off;
+# allowed values: off, full)
# @redundancy Redundancy of the image
# @object-size Object size of the image
#
#
# @file Node to create the image format on
# @size Size of the virtual disk in bytes
-# @preallocation Preallocation mode for the new image (allowed values: off,
-# metadata; default: off)
+# @preallocation Preallocation mode for the new image (default: off;
+# allowed values: off, metadata)
#
# Since: 2.12
##
# @off: no preallocation
# @metadata: preallocate only for metadata
# @falloc: like @full preallocation but allocate disk space by
-# posix_fallocate() rather than writing zeros.
-# @full: preallocate all data by writing zeros to device to ensure disk
-# space is really available. @full preallocation also sets up
-# metadata correctly.
+# posix_fallocate() rather than writing data.
+# @full: 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.
+# @full preallocation also sets up metadata correctly.
#
# Since: 2.2
##