]> git.ipfire.org Git - thirdparty/qemu.git/blame - qapi/block-core.json
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
[thirdparty/qemu.git] / qapi / block-core.json
CommitLineData
5db15096 1# -*- Mode: Python -*-
d3a48372
MAL
2
3##
f5cf31c5 4# == Block core (VM unrelated)
d3a48372 5##
5db15096 6
5db15096 7{ 'include': 'common.json' }
2031c133 8{ 'include': 'crypto.json' }
bf42508f 9{ 'include': 'job.json' }
a2ff5a48 10{ 'include': 'sockets.json' }
1ad166b6
BC
11
12##
5072f7b3 13# @SnapshotInfo:
1ad166b6
BC
14#
15# @id: unique snapshot id
16#
17# @name: user chosen name
18#
19# @vm-state-size: size of the VM state
20#
21# @date-sec: UTC date of the snapshot in seconds
22#
23# @date-nsec: fractional part in nano seconds to be used with date-sec
24#
25# @vm-clock-sec: VM clock relative to boot in seconds
26#
27# @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
28#
29# Since: 1.3
30#
31##
895a2a80 32{ 'struct': 'SnapshotInfo',
1ad166b6
BC
33 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
34 'date-sec': 'int', 'date-nsec': 'int',
35 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
36
0a12f6f8
DB
37##
38# @ImageInfoSpecificQCow2EncryptionBase:
39#
40# @format: The encryption format
41#
42# Since: 2.10
43##
44{ 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
45 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
46
47##
48# @ImageInfoSpecificQCow2Encryption:
49#
50# Since: 2.10
51##
52{ 'union': 'ImageInfoSpecificQCow2Encryption',
53 'base': 'ImageInfoSpecificQCow2EncryptionBase',
54 'discriminator': 'format',
29cd0403 55 'data': { 'luks': 'QCryptoBlockInfoLUKS' } }
0a12f6f8 56
1ad166b6
BC
57##
58# @ImageInfoSpecificQCow2:
59#
60# @compat: compatibility level
61#
9b890bdc
KW
62# @data-file: the filename of the external data file that is stored in the
63# image and used as a default for opening the image (since: 4.0)
64#
6c3944dc
KW
65# @data-file-raw: True if the external data file must stay valid as a
66# standalone (read-only) raw image without looking at qcow2
67# metadata (since: 4.0)
68#
1d8bda12 69# @lazy-refcounts: on or off; only valid for compat >= 1.1
1ad166b6 70#
1d8bda12 71# @corrupt: true if the image has been marked corrupt; only valid for
9009b196
HR
72# compat >= 1.1 (since 2.2)
73#
0709c5a1
HR
74# @refcount-bits: width of a refcount entry in bits (since 2.3)
75#
0a12f6f8
DB
76# @encrypt: details about encryption parameters; only set if image
77# is encrypted (since 2.10)
78#
b8968c87
AS
79# @bitmaps: A list of qcow2 bitmap details (since 4.0)
80#
1ad166b6
BC
81# Since: 1.7
82##
895a2a80 83{ 'struct': 'ImageInfoSpecificQCow2',
1ad166b6
BC
84 'data': {
85 'compat': 'str',
9b890bdc 86 '*data-file': 'str',
6c3944dc 87 '*data-file-raw': 'bool',
9009b196 88 '*lazy-refcounts': 'bool',
0709c5a1 89 '*corrupt': 'bool',
0a12f6f8 90 'refcount-bits': 'int',
b8968c87
AS
91 '*encrypt': 'ImageInfoSpecificQCow2Encryption',
92 '*bitmaps': ['Qcow2BitmapInfo']
1ad166b6
BC
93 } }
94
95##
96# @ImageInfoSpecificVmdk:
97#
98# @create-type: The create type of VMDK image
99#
100# @cid: Content id of image
101#
102# @parent-cid: Parent VMDK image's cid
103#
104# @extents: List of extent files
105#
106# Since: 1.7
107##
895a2a80 108{ 'struct': 'ImageInfoSpecificVmdk',
1ad166b6
BC
109 'data': {
110 'create-type': 'str',
111 'cid': 'int',
112 'parent-cid': 'int',
113 'extents': ['ImageInfo']
114 } }
115
116##
117# @ImageInfoSpecific:
118#
119# A discriminated record of image format specific information structures.
120#
121# Since: 1.7
122##
1ad166b6
BC
123{ 'union': 'ImageInfoSpecific',
124 'data': {
125 'qcow2': 'ImageInfoSpecificQCow2',
c7c4cf49
DB
126 'vmdk': 'ImageInfoSpecificVmdk',
127 # If we need to add block driver specific parameters for
128 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
129 # to define a ImageInfoSpecificLUKS
130 'luks': 'QCryptoBlockInfoLUKS'
1ad166b6
BC
131 } }
132
133##
134# @ImageInfo:
135#
136# Information about a QEMU image file
137#
138# @filename: name of the image file
139#
140# @format: format of the image file
141#
142# @virtual-size: maximum capacity in bytes of the image
143#
1d8bda12 144# @actual-size: actual size on disk in bytes of the image
1ad166b6 145#
1d8bda12 146# @dirty-flag: true if image is not cleanly closed
1ad166b6 147#
1d8bda12 148# @cluster-size: size of a cluster in bytes
1ad166b6 149#
1d8bda12 150# @encrypted: true if the image is encrypted
1ad166b6 151#
1d8bda12 152# @compressed: true if the image is compressed (Since 1.7)
1ad166b6 153#
1d8bda12 154# @backing-filename: name of the backing file
1ad166b6 155#
1d8bda12 156# @full-backing-filename: full path of the backing file
1ad166b6 157#
1d8bda12 158# @backing-filename-format: the format of the backing file
1ad166b6 159#
1d8bda12 160# @snapshots: list of VM snapshots
1ad166b6 161#
1d8bda12 162# @backing-image: info of the backing image (since 1.6)
1ad166b6 163#
1d8bda12 164# @format-specific: structure supplying additional format-specific
26ec4e53 165# information (since 1.7)
1ad166b6
BC
166#
167# Since: 1.3
168#
169##
895a2a80 170{ 'struct': 'ImageInfo',
1ad166b6
BC
171 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
172 '*actual-size': 'int', 'virtual-size': 'int',
173 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
174 '*backing-filename': 'str', '*full-backing-filename': 'str',
175 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
176 '*backing-image': 'ImageInfo',
24bf10da 177 '*format-specific': 'ImageInfoSpecific' } }
1ad166b6
BC
178
179##
180# @ImageCheck:
181#
182# Information about a QEMU image file check
183#
184# @filename: name of the image file checked
185#
186# @format: format of the image file checked
187#
188# @check-errors: number of unexpected errors occurred during check
189#
1d8bda12 190# @image-end-offset: offset (in bytes) where the image ends, this
1ad166b6
BC
191# field is present if the driver for the image format
192# supports it
193#
1d8bda12 194# @corruptions: number of corruptions found during the check if any
1ad166b6 195#
1d8bda12 196# @leaks: number of leaks found during the check if any
1ad166b6 197#
1d8bda12 198# @corruptions-fixed: number of corruptions fixed during the check
1ad166b6
BC
199# if any
200#
1d8bda12 201# @leaks-fixed: number of leaks fixed during the check if any
1ad166b6 202#
1d8bda12 203# @total-clusters: total number of clusters, this field is present
1ad166b6
BC
204# if the driver for the image format supports it
205#
1d8bda12 206# @allocated-clusters: total number of allocated clusters, this
1ad166b6
BC
207# field is present if the driver for the image format
208# supports it
209#
1d8bda12 210# @fragmented-clusters: total number of fragmented clusters, this
1ad166b6
BC
211# field is present if the driver for the image format
212# supports it
213#
1d8bda12 214# @compressed-clusters: total number of compressed clusters, this
1ad166b6
BC
215# field is present if the driver for the image format
216# supports it
217#
218# Since: 1.4
219#
220##
895a2a80 221{ 'struct': 'ImageCheck',
1ad166b6
BC
222 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
223 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
224 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
225 '*total-clusters': 'int', '*allocated-clusters': 'int',
226 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
227
16b0d555
FZ
228##
229# @MapEntry:
230#
231# Mapping information from a virtual block range to a host file range
232#
233# @start: the start byte of the mapped virtual range
234#
235# @length: the number of bytes of the mapped virtual range
236#
237# @data: whether the mapped range has data
238#
239# @zero: whether the virtual blocks are zeroed
240#
241# @depth: the depth of the mapping
242#
1d8bda12 243# @offset: the offset in file that the virtual sectors are mapped to
16b0d555 244#
1d8bda12 245# @filename: filename that is referred to by @offset
16b0d555
FZ
246#
247# Since: 2.6
248#
249##
250{ 'struct': 'MapEntry',
251 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
252 'zero': 'bool', 'depth': 'int', '*offset': 'int',
253 '*filename': 'str' } }
254
9e193c5a 255##
5072f7b3 256# @BlockdevCacheInfo:
9e193c5a
KW
257#
258# Cache mode information for a block device
259#
260# @writeback: true if writeback mode is enabled
261# @direct: true if the host page cache is bypassed (O_DIRECT)
262# @no-flush: true if flush requests are ignored for the device
263#
264# Since: 2.3
265##
895a2a80 266{ 'struct': 'BlockdevCacheInfo',
9e193c5a
KW
267 'data': { 'writeback': 'bool',
268 'direct': 'bool',
269 'no-flush': 'bool' } }
270
1ad166b6
BC
271##
272# @BlockDeviceInfo:
273#
274# Information about the backing device for a block device.
275#
276# @file: the filename of the backing device
277#
1d8bda12 278# @node-name: the name of the block driver node (Since 2.0)
1ad166b6
BC
279#
280# @ro: true if the backing device was open read-only
281#
282# @drv: the name of the block format used to open the backing device. As of
283# 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
284# 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
78368575 285# 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
23dce387 286# 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
550830f9 287# 2.2: 'archipelago' added, 'cow' dropped
92a539d2 288# 2.3: 'host_floppy' deprecated
f709623b 289# 2.5: 'host_floppy' dropped
78368575 290# 2.6: 'luks' added
23dce387 291# 2.8: 'replication' added, 'tftp' dropped
e32ccbc6 292# 2.9: 'archipelago' dropped
1ad166b6 293#
1d8bda12 294# @backing_file: the name of the backing file (for copy-on-write)
1ad166b6
BC
295#
296# @backing_file_depth: number of files in the backing file chain (since: 1.2)
297#
298# @encrypted: true if the backing device is encrypted
299#
c01c214b 300# @encryption_key_missing: Deprecated; always false
1ad166b6
BC
301#
302# @detect_zeroes: detect and optimize zero writes (Since 2.1)
303#
304# @bps: total throughput limit in bytes per second is specified
305#
306# @bps_rd: read throughput limit in bytes per second is specified
307#
308# @bps_wr: write throughput limit in bytes per second is specified
309#
310# @iops: total I/O operations per second is specified
311#
312# @iops_rd: read I/O operations per second is specified
313#
314# @iops_wr: write I/O operations per second is specified
315#
316# @image: the info of image used (since: 1.6)
317#
1d8bda12 318# @bps_max: total throughput limit during bursts,
398befdf 319# in bytes (Since 1.7)
1ad166b6 320#
1d8bda12 321# @bps_rd_max: read throughput limit during bursts,
398befdf 322# in bytes (Since 1.7)
1ad166b6 323#
1d8bda12 324# @bps_wr_max: write throughput limit during bursts,
398befdf 325# in bytes (Since 1.7)
1ad166b6 326#
1d8bda12 327# @iops_max: total I/O operations per second during bursts,
398befdf 328# in bytes (Since 1.7)
1ad166b6 329#
1d8bda12 330# @iops_rd_max: read I/O operations per second during bursts,
398befdf 331# in bytes (Since 1.7)
1ad166b6 332#
1d8bda12 333# @iops_wr_max: write I/O operations per second during bursts,
398befdf
AG
334# in bytes (Since 1.7)
335#
1d8bda12 336# @bps_max_length: maximum length of the @bps_max burst
398befdf
AG
337# period, in seconds. (Since 2.6)
338#
1d8bda12 339# @bps_rd_max_length: maximum length of the @bps_rd_max
398befdf
AG
340# burst period, in seconds. (Since 2.6)
341#
1d8bda12 342# @bps_wr_max_length: maximum length of the @bps_wr_max
398befdf
AG
343# burst period, in seconds. (Since 2.6)
344#
1d8bda12 345# @iops_max_length: maximum length of the @iops burst
398befdf
AG
346# period, in seconds. (Since 2.6)
347#
1d8bda12 348# @iops_rd_max_length: maximum length of the @iops_rd_max
398befdf
AG
349# burst period, in seconds. (Since 2.6)
350#
1d8bda12 351# @iops_wr_max_length: maximum length of the @iops_wr_max
398befdf 352# burst period, in seconds. (Since 2.6)
1ad166b6 353#
1d8bda12 354# @iops_size: an I/O size in bytes (Since 1.7)
1ad166b6 355#
1d8bda12 356# @group: throttle group name (Since 2.4)
b8fe1694 357#
9e193c5a
KW
358# @cache: the cache mode used for the block device (since: 2.3)
359#
e2462113
FR
360# @write_threshold: configured write threshold for the device.
361# 0 if disabled. (Since 2.3)
362#
590a63d5
VSO
363# @dirty-bitmaps: dirty bitmaps information (only present if node
364# has one or more dirty bitmaps) (Since 4.2)
365#
1ad166b6
BC
366# Since: 0.14.0
367#
368##
895a2a80 369{ 'struct': 'BlockDeviceInfo',
1ad166b6
BC
370 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
371 '*backing_file': 'str', 'backing_file_depth': 'int',
372 'encrypted': 'bool', 'encryption_key_missing': 'bool',
373 'detect_zeroes': 'BlockdevDetectZeroesOptions',
374 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
375 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
376 'image': 'ImageInfo',
377 '*bps_max': 'int', '*bps_rd_max': 'int',
378 '*bps_wr_max': 'int', '*iops_max': 'int',
379 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
398befdf
AG
380 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
381 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
382 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
b8fe1694 383 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
590a63d5 384 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
1ad166b6
BC
385
386##
387# @BlockDeviceIoStatus:
388#
389# An enumeration of block device I/O status.
390#
391# @ok: The last I/O operation has succeeded
392#
393# @failed: The last I/O operation has failed
394#
395# @nospace: The last I/O operation has failed due to a no-space condition
396#
397# Since: 1.0
398##
399{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
400
401##
402# @BlockDeviceMapEntry:
403#
404# Entry in the metadata map of the device (returned by "qemu-img map")
405#
406# @start: Offset in the image of the first byte described by this entry
407# (in bytes)
408#
409# @length: Length of the range described by this entry (in bytes)
410#
411# @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
412# before reaching one for which the range is allocated. The value is
413# in the range 0 to the depth of the image chain - 1.
414#
415# @zero: the sectors in this range read as zeros
416#
417# @data: reading the image will actually read data from a file (in particular,
418# if @offset is present this means that the sectors are not simply
419# preallocated, but contain actual data in raw format)
420#
421# @offset: if present, the image file stores the data for this range in
422# raw format at the given offset.
423#
5072f7b3 424# Since: 1.7
1ad166b6 425##
895a2a80 426{ 'struct': 'BlockDeviceMapEntry',
1ad166b6
BC
427 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
428 'data': 'bool', '*offset': 'int' } }
429
9abe3bdc
JS
430##
431# @DirtyBitmapStatus:
432#
433# An enumeration of possible states that a dirty bitmap can report to the user.
434#
73ab5d60
JS
435# @frozen: The bitmap is currently in-use by some operation and is immutable.
436# If the bitmap was @active prior to the operation, new writes by the
437# guest are being recorded in a temporary buffer, and will not be lost.
438# Generally, bitmaps are cleared on successful use in an operation and
439# the temporary buffer is committed into the bitmap. On failure, the
440# temporary buffer is merged back into the bitmap without first
441# clearing it.
442# Please refer to the documentation for each bitmap-using operation,
443# See also @blockdev-backup, @drive-backup.
444#
445# @disabled: The bitmap is not currently recording new writes by the guest.
446# This is requested explicitly via @block-dirty-bitmap-disable.
447# It can still be cleared, deleted, or used for backup operations.
9abe3bdc
JS
448#
449# @active: The bitmap is actively monitoring for new writes, and can be cleared,
450# deleted, or used for backup operations.
451#
73ab5d60
JS
452# @locked: The bitmap is currently in-use by some operation and is immutable.
453# If the bitmap was @active prior to the operation, it is still
454# recording new writes. If the bitmap was @disabled, it is not
455# recording new writes. (Since 2.12)
4f43e953 456#
0064cfef
JS
457# @inconsistent: This is a persistent dirty bitmap that was marked in-use on
458# disk, and is unusable by QEMU. It can only be deleted.
459# Please rely on the inconsistent field in @BlockDirtyInfo
460# instead, as the status field is deprecated. (Since 4.0)
461#
9abe3bdc
JS
462# Since: 2.4
463##
464{ 'enum': 'DirtyBitmapStatus',
0064cfef 465 'data': ['active', 'disabled', 'frozen', 'locked', 'inconsistent'] }
9abe3bdc 466
1ad166b6
BC
467##
468# @BlockDirtyInfo:
469#
470# Block dirty bitmap information.
471#
1d8bda12 472# @name: the name of the dirty bitmap (Since 2.4)
0db6e54a 473#
1ad166b6
BC
474# @count: number of dirty bytes according to the dirty bitmap
475#
476# @granularity: granularity of the dirty bitmap in bytes (since 1.4)
477#
4db6ceb0
JS
478# @status: Deprecated in favor of @recording and @locked. (since 2.4)
479#
480# @recording: true if the bitmap is recording new writes from the guest.
481# Replaces `active` and `disabled` statuses. (since 4.0)
482#
483# @busy: true if the bitmap is in-use by some operation (NBD or jobs)
484# and cannot be modified via QMP or used by another operation.
485# Replaces `locked` and `frozen` statuses. (since 4.0)
a113534f 486#
b0f45559
JS
487# @persistent: true if the bitmap was stored on disk, is scheduled to be stored
488# on disk, or both. (since 4.0)
a113534f 489#
b0f45559
JS
490# @inconsistent: true if this is a persistent bitmap that was improperly
491# stored. Implies @persistent to be true; @recording and
492# @busy to be false. This bitmap cannot be used. To remove
493# it, use @block-dirty-bitmap-remove. (Since 4.0)
f67cf661 494#
1ad166b6
BC
495# Since: 1.3
496##
895a2a80 497{ 'struct': 'BlockDirtyInfo',
a113534f 498 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
b0f45559
JS
499 'recording': 'bool', 'busy': 'bool', 'status': 'DirtyBitmapStatus',
500 'persistent': 'bool', '*inconsistent': 'bool' } }
1ad166b6 501
b8968c87
AS
502##
503# @Qcow2BitmapInfoFlags:
504#
505# An enumeration of flags that a bitmap can report to the user.
506#
507# @in-use: This flag is set by any process actively modifying the qcow2 file,
508# and cleared when the updated bitmap is flushed to the qcow2 image.
509# The presence of this flag in an offline image means that the bitmap
510# was not saved correctly after its last usage, and may contain
511# inconsistent data.
512#
513# @auto: The bitmap must reflect all changes of the virtual disk by any
514# application that would write to this qcow2 file.
515#
516# Since: 4.0
517##
518{ 'enum': 'Qcow2BitmapInfoFlags',
519 'data': ['in-use', 'auto'] }
520
521##
522# @Qcow2BitmapInfo:
523#
524# Qcow2 bitmap information.
525#
526# @name: the name of the bitmap
527#
528# @granularity: granularity of the bitmap in bytes
529#
530# @flags: flags of the bitmap
531#
532# Since: 4.0
533##
534{ 'struct': 'Qcow2BitmapInfo',
535 'data': {'name': 'str', 'granularity': 'uint32',
536 'flags': ['Qcow2BitmapInfoFlags'] } }
537
7e5c776d
VSO
538##
539# @BlockLatencyHistogramInfo:
540#
541# Block latency histogram.
542#
543# @boundaries: list of interval boundary values in nanoseconds, all greater
544# than zero and in ascending order.
545# For example, the list [10, 50, 100] produces the following
546# histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
547#
548# @bins: list of io request counts corresponding to histogram intervals.
549# len(@bins) = len(@boundaries) + 1
550# For the example above, @bins may be something like [3, 1, 5, 2],
551# and corresponding histogram looks like:
552#
0a940d66
PM
553# | 5| *
554# | 4| *
555# | 3| * *
556# | 2| * * *
557# | 1| * * * *
558# | +------------------
559# | 10 50 100
7e5c776d 560#
cb8aac37 561# Since: 4.0
7e5c776d
VSO
562##
563{ 'struct': 'BlockLatencyHistogramInfo',
564 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
565
1ad166b6
BC
566##
567# @BlockInfo:
568#
569# Block device information. This structure describes a virtual device and
570# the backing device associated with it.
571#
572# @device: The device name associated with the virtual device.
573#
46eade7b
KW
574# @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
575# device. (since 2.10)
576#
1ad166b6
BC
577# @type: This field is returned only for compatibility reasons, it should
578# not be used (always returns 'unknown')
579#
580# @removable: True if the device supports removable media.
581#
582# @locked: True if the guest has locked this device from having its media
583# removed
584#
1d8bda12 585# @tray_open: True if the device's tray is open
327032ce 586# (only present if it has a tray)
1ad166b6 587#
1d8bda12 588# @dirty-bitmaps: dirty bitmaps information (only present if the
1ad166b6 589# driver has one or more dirty bitmaps) (Since 2.0)
590a63d5 590# Deprecated in 4.2; see BlockDeviceInfo instead.
1ad166b6 591#
1d8bda12 592# @io-status: @BlockDeviceIoStatus. Only present if the device
1ad166b6 593# supports it and the VM is configured to stop on errors
f6f55aff
MA
594# (supported device models: virtio-blk, IDE, SCSI except
595# scsi-generic)
1ad166b6 596#
1d8bda12 597# @inserted: @BlockDeviceInfo describing the device if media is
1ad166b6
BC
598# present
599#
600# Since: 0.14.0
601##
895a2a80 602{ 'struct': 'BlockInfo',
46eade7b 603 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
1ad166b6
BC
604 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
605 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
606 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
607
90880ff1
SH
608##
609# @BlockMeasureInfo:
610#
611# Image file size calculation information. This structure describes the size
612# requirements for creating a new image file.
613#
614# The size requirements depend on the new image file format. File size always
615# equals virtual disk size for the 'raw' format, even for sparse POSIX files.
616# Compact formats such as 'qcow2' represent unallocated and zero regions
617# efficiently so file size may be smaller than virtual disk size.
618#
619# The values are upper bounds that are guaranteed to fit the new image file.
620# Subsequent modification, such as internal snapshot or bitmap creation, may
621# require additional space and is not covered here.
622#
623# @required: Size required for a new image file, in bytes.
624#
625# @fully-allocated: Image file size, in bytes, once data has been written
626# to all sectors.
627#
628# Since: 2.10
629##
630{ 'struct': 'BlockMeasureInfo',
631 'data': {'required': 'int', 'fully-allocated': 'int'} }
632
1ad166b6
BC
633##
634# @query-block:
635#
636# Get a list of BlockInfo for all virtual block devices.
637#
d3c8c674 638# Returns: a list of @BlockInfo describing each virtual block device. Filter
26ec4e53 639# nodes that were created implicitly are skipped over.
1ad166b6
BC
640#
641# Since: 0.14.0
978cceab
MAL
642#
643# Example:
644#
645# -> { "execute": "query-block" }
646# <- {
647# "return":[
648# {
649# "io-status": "ok",
650# "device":"ide0-hd0",
651# "locked":false,
652# "removable":false,
653# "inserted":{
654# "ro":false,
655# "drv":"qcow2",
656# "encrypted":false,
657# "file":"disks/test.qcow2",
658# "backing_file_depth":1,
659# "bps":1000000,
660# "bps_rd":0,
661# "bps_wr":0,
662# "iops":1000000,
663# "iops_rd":0,
664# "iops_wr":0,
665# "bps_max": 8000000,
666# "bps_rd_max": 0,
667# "bps_wr_max": 0,
668# "iops_max": 0,
669# "iops_rd_max": 0,
670# "iops_wr_max": 0,
671# "iops_size": 0,
672# "detect_zeroes": "on",
673# "write_threshold": 0,
674# "image":{
675# "filename":"disks/test.qcow2",
676# "format":"qcow2",
677# "virtual-size":2048000,
678# "backing_file":"base.qcow2",
679# "full-backing-filename":"disks/base.qcow2",
680# "backing-filename-format":"qcow2",
681# "snapshots":[
682# {
683# "id": "1",
684# "name": "snapshot1",
685# "vm-state-size": 0,
686# "date-sec": 10000200,
687# "date-nsec": 12,
688# "vm-clock-sec": 206,
689# "vm-clock-nsec": 30
690# }
691# ],
692# "backing-image":{
693# "filename":"disks/base.qcow2",
694# "format":"qcow2",
695# "virtual-size":2048000
696# }
697# }
698# },
46eade7b 699# "qdev": "ide_disk",
978cceab
MAL
700# "type":"unknown"
701# },
702# {
703# "io-status": "ok",
704# "device":"ide1-cd0",
705# "locked":false,
706# "removable":true,
46eade7b
KW
707# "qdev": "/machine/unattached/device[23]",
708# "tray_open": false,
978cceab
MAL
709# "type":"unknown"
710# },
711# {
712# "device":"floppy0",
713# "locked":false,
714# "removable":true,
46eade7b 715# "qdev": "/machine/unattached/device[20]",
978cceab
MAL
716# "type":"unknown"
717# },
718# {
719# "device":"sd0",
720# "locked":false,
721# "removable":true,
722# "type":"unknown"
723# }
724# ]
725# }
726#
1ad166b6
BC
727##
728{ 'command': 'query-block', 'returns': ['BlockInfo'] }
729
979e9b03
AG
730
731##
732# @BlockDeviceTimedStats:
733#
734# Statistics of a block device during a given interval of time.
735#
736# @interval_length: Interval used for calculating the statistics,
737# in seconds.
738#
739# @min_rd_latency_ns: Minimum latency of read operations in the
740# defined interval, in nanoseconds.
741#
742# @min_wr_latency_ns: Minimum latency of write operations in the
743# defined interval, in nanoseconds.
744#
745# @min_flush_latency_ns: Minimum latency of flush operations in the
746# defined interval, in nanoseconds.
747#
748# @max_rd_latency_ns: Maximum latency of read operations in the
749# defined interval, in nanoseconds.
750#
751# @max_wr_latency_ns: Maximum latency of write operations in the
752# defined interval, in nanoseconds.
753#
754# @max_flush_latency_ns: Maximum latency of flush operations in the
755# defined interval, in nanoseconds.
756#
757# @avg_rd_latency_ns: Average latency of read operations in the
758# defined interval, in nanoseconds.
759#
760# @avg_wr_latency_ns: Average latency of write operations in the
761# defined interval, in nanoseconds.
762#
763# @avg_flush_latency_ns: Average latency of flush operations in the
764# defined interval, in nanoseconds.
765#
96e4deda
AG
766# @avg_rd_queue_depth: Average number of pending read operations
767# in the defined interval.
768#
769# @avg_wr_queue_depth: Average number of pending write operations
770# in the defined interval.
771#
979e9b03
AG
772# Since: 2.5
773##
979e9b03
AG
774{ 'struct': 'BlockDeviceTimedStats',
775 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
776 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
777 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
778 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
96e4deda
AG
779 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
780 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
979e9b03 781
1ad166b6
BC
782##
783# @BlockDeviceStats:
784#
785# Statistics of a virtual block device or a block backing device.
786#
787# @rd_bytes: The number of bytes read by the device.
788#
789# @wr_bytes: The number of bytes written by the device.
790#
159f85dd
AN
791# @unmap_bytes: The number of bytes unmapped by the device (Since 4.2)
792#
1ad166b6
BC
793# @rd_operations: The number of read operations performed by the device.
794#
795# @wr_operations: The number of write operations performed by the device.
796#
797# @flush_operations: The number of cache flush operations performed by the
798# device (since 0.15.0)
799#
159f85dd
AN
800# @unmap_operations: The number of unmap operations performed by the device
801# (Since 4.2)
802#
329d27e3 803# @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15.0).
1ad166b6 804#
329d27e3 805# @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15.0).
1ad166b6 806#
329d27e3
AN
807# @flush_total_time_ns: Total time spent on cache flushes in nanoseconds
808# (since 0.15.0).
1ad166b6 809#
159f85dd
AN
810# @unmap_total_time_ns: Total time spent on unmap operations in nanoseconds
811# (Since 4.2)
812#
1ad166b6
BC
813# @wr_highest_offset: The offset after the greatest byte written to the
814# device. The intended use of this information is for
815# growable sparse files (like qcow2) that are used on top
816# of a physical device.
817#
f4564d53
PL
818# @rd_merged: Number of read requests that have been merged into another
819# request (Since 2.3).
820#
821# @wr_merged: Number of write requests that have been merged into another
822# request (Since 2.3).
823#
159f85dd
AN
824# @unmap_merged: Number of unmap requests that have been merged into another
825# request (Since 4.2)
826#
1d8bda12 827# @idle_time_ns: Time since the last I/O operation, in
cb38fffb
AG
828# nanoseconds. If the field is absent it means that
829# there haven't been any operations yet (Since 2.5).
830#
7ee12daf
AG
831# @failed_rd_operations: The number of failed read operations
832# performed by the device (Since 2.5)
833#
834# @failed_wr_operations: The number of failed write operations
835# performed by the device (Since 2.5)
836#
837# @failed_flush_operations: The number of failed flush operations
838# performed by the device (Since 2.5)
839#
159f85dd
AN
840# @failed_unmap_operations: The number of failed unmap operations performed
841# by the device (Since 4.2)
842#
7ee12daf
AG
843# @invalid_rd_operations: The number of invalid read operations
844# performed by the device (Since 2.5)
845#
846# @invalid_wr_operations: The number of invalid write operations
847# performed by the device (Since 2.5)
848#
849# @invalid_flush_operations: The number of invalid flush operations
850# performed by the device (Since 2.5)
851#
159f85dd
AN
852# @invalid_unmap_operations: The number of invalid unmap operations performed
853# by the device (Since 4.2)
854#
362e9299
AG
855# @account_invalid: Whether invalid operations are included in the
856# last access statistics (Since 2.5)
857#
858# @account_failed: Whether failed operations are included in the
859# latency and last access statistics (Since 2.5)
860#
979e9b03
AG
861# @timed_stats: Statistics specific to the set of previously defined
862# intervals of time (Since 2.5)
863#
cb8aac37 864# @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
7e5c776d 865#
cb8aac37 866# @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
7e5c776d 867#
cb8aac37 868# @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
7e5c776d 869#
1ad166b6
BC
870# Since: 0.14.0
871##
895a2a80 872{ 'struct': 'BlockDeviceStats',
159f85dd 873 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int',
329d27e3 874 'rd_operations': 'int', 'wr_operations': 'int',
159f85dd 875 'flush_operations': 'int', 'unmap_operations': 'int',
329d27e3 876 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int',
159f85dd 877 'flush_total_time_ns': 'int', 'unmap_total_time_ns': 'int',
329d27e3 878 'wr_highest_offset': 'int',
159f85dd 879 'rd_merged': 'int', 'wr_merged': 'int', 'unmap_merged': 'int',
329d27e3 880 '*idle_time_ns': 'int',
7ee12daf 881 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
159f85dd 882 'failed_flush_operations': 'int', 'failed_unmap_operations': 'int',
329d27e3 883 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int',
159f85dd 884 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int',
979e9b03 885 'account_invalid': 'bool', 'account_failed': 'bool',
7e5c776d 886 'timed_stats': ['BlockDeviceTimedStats'],
cb8aac37
VSO
887 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
888 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
889 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
1ad166b6 890
d9245599
AN
891##
892# @BlockStatsSpecificFile:
893#
894# File driver statistics
895#
896# @discard-nb-ok: The number of successful discard operations performed by
897# the driver.
898#
899# @discard-nb-failed: The number of failed discard operations performed by
900# the driver.
901#
902# @discard-bytes-ok: The number of bytes discarded by the driver.
903#
904# Since: 4.2
905##
906{ 'struct': 'BlockStatsSpecificFile',
907 'data': {
908 'discard-nb-ok': 'uint64',
909 'discard-nb-failed': 'uint64',
910 'discard-bytes-ok': 'uint64' } }
911
912##
913# @BlockStatsSpecific:
914#
915# Block driver specific statistics
916#
917# Since: 4.2
918##
919{ 'union': 'BlockStatsSpecific',
920 'base': { 'driver': 'BlockdevDriver' },
921 'discriminator': 'driver',
922 'data': {
923 'file': 'BlockStatsSpecificFile',
924 'host_device': 'BlockStatsSpecificFile' } }
925
1ad166b6
BC
926##
927# @BlockStats:
928#
929# Statistics of a virtual block device or a block backing device.
930#
1d8bda12 931# @device: If the stats are for a virtual block device, the name
1ad166b6
BC
932# corresponding to the virtual block device.
933#
1d8bda12 934# @node-name: The node name of the device. (Since 2.3)
4875a779 935#
5a9cb5a9
KW
936# @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
937# device. (since 3.0)
938#
1ad166b6
BC
939# @stats: A @BlockDeviceStats for the device.
940#
d9245599
AN
941# @driver-specific: Optional driver-specific stats. (Since 4.2)
942#
1d8bda12 943# @parent: This describes the file block device if it has one.
f2eaea18
MAL
944# Contains recursively the statistics of the underlying
945# protocol (e.g. the host file for a qcow2 image). If there is
946# no underlying protocol, this field is omitted
1ad166b6 947#
1d8bda12 948# @backing: This describes the backing block device if it has one.
1ad166b6
BC
949# (Since 2.0)
950#
951# Since: 0.14.0
952##
895a2a80 953{ 'struct': 'BlockStats',
5a9cb5a9 954 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
4875a779 955 'stats': 'BlockDeviceStats',
d9245599 956 '*driver-specific': 'BlockStatsSpecific',
1ad166b6
BC
957 '*parent': 'BlockStats',
958 '*backing': 'BlockStats'} }
959
960##
961# @query-blockstats:
962#
963# Query the @BlockStats for all virtual block devices.
964#
1d8bda12 965# @query-nodes: If true, the command will query all the block nodes
f71eaa74
FZ
966# that have a node name, in a list which will include "parent"
967# information, but not "backing".
968# If false or omitted, the behavior is as before - query all the
969# device backends, recursively including their "parent" and
d3c8c674
KW
970# "backing". Filter nodes that were created implicitly are
971# skipped over in this mode. (Since 2.3)
f71eaa74 972#
1ad166b6
BC
973# Returns: A list of @BlockStats for each virtual block devices.
974#
975# Since: 0.14.0
f2eaea18
MAL
976#
977# Example:
978#
979# -> { "execute": "query-blockstats" }
980# <- {
981# "return":[
982# {
983# "device":"ide0-hd0",
984# "parent":{
985# "stats":{
986# "wr_highest_offset":3686448128,
987# "wr_bytes":9786368,
988# "wr_operations":751,
989# "rd_bytes":122567168,
990# "rd_operations":36772
991# "wr_total_times_ns":313253456
992# "rd_total_times_ns":3465673657
993# "flush_total_times_ns":49653
994# "flush_operations":61,
995# "rd_merged":0,
996# "wr_merged":0,
997# "idle_time_ns":2953431879,
998# "account_invalid":true,
999# "account_failed":false
1000# }
1001# },
1002# "stats":{
1003# "wr_highest_offset":2821110784,
1004# "wr_bytes":9786368,
1005# "wr_operations":692,
1006# "rd_bytes":122739200,
1007# "rd_operations":36604
1008# "flush_operations":51,
1009# "wr_total_times_ns":313253456
1010# "rd_total_times_ns":3465673657
1011# "flush_total_times_ns":49653,
1012# "rd_merged":0,
1013# "wr_merged":0,
1014# "idle_time_ns":2953431879,
1015# "account_invalid":true,
1016# "account_failed":false
5a9cb5a9
KW
1017# },
1018# "qdev": "/machine/unattached/device[23]"
f2eaea18
MAL
1019# },
1020# {
1021# "device":"ide1-cd0",
1022# "stats":{
1023# "wr_highest_offset":0,
1024# "wr_bytes":0,
1025# "wr_operations":0,
1026# "rd_bytes":0,
1027# "rd_operations":0
1028# "flush_operations":0,
1029# "wr_total_times_ns":0
1030# "rd_total_times_ns":0
1031# "flush_total_times_ns":0,
1032# "rd_merged":0,
1033# "wr_merged":0,
1034# "account_invalid":false,
1035# "account_failed":false
5a9cb5a9
KW
1036# },
1037# "qdev": "/machine/unattached/device[24]"
f2eaea18
MAL
1038# },
1039# {
1040# "device":"floppy0",
1041# "stats":{
1042# "wr_highest_offset":0,
1043# "wr_bytes":0,
1044# "wr_operations":0,
1045# "rd_bytes":0,
1046# "rd_operations":0
1047# "flush_operations":0,
1048# "wr_total_times_ns":0
1049# "rd_total_times_ns":0
1050# "flush_total_times_ns":0,
1051# "rd_merged":0,
1052# "wr_merged":0,
1053# "account_invalid":false,
1054# "account_failed":false
5a9cb5a9
KW
1055# },
1056# "qdev": "/machine/unattached/device[16]"
f2eaea18
MAL
1057# },
1058# {
1059# "device":"sd0",
1060# "stats":{
1061# "wr_highest_offset":0,
1062# "wr_bytes":0,
1063# "wr_operations":0,
1064# "rd_bytes":0,
1065# "rd_operations":0
1066# "flush_operations":0,
1067# "wr_total_times_ns":0
1068# "rd_total_times_ns":0
1069# "flush_total_times_ns":0,
1070# "rd_merged":0,
1071# "wr_merged":0,
1072# "account_invalid":false,
1073# "account_failed":false
1074# }
1075# }
1076# ]
1077# }
1078#
1ad166b6 1079##
f71eaa74
FZ
1080{ 'command': 'query-blockstats',
1081 'data': { '*query-nodes': 'bool' },
1082 'returns': ['BlockStats'] }
1ad166b6
BC
1083
1084##
1085# @BlockdevOnError:
1086#
1087# An enumeration of possible behaviors for errors on I/O operations.
1088# The exact meaning depends on whether the I/O was initiated by a guest
1089# or by a block job
1090#
1091# @report: for guest operations, report the error to the guest;
1092# for jobs, cancel the job
1093#
1094# @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
248e3ffb
KW
1095# or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs retry
1096# the failing request later and may still complete successfully. The
1097# stream block job continues to stream and will complete with an
1098# error.
1ad166b6
BC
1099#
1100# @enospc: same as @stop on ENOSPC, same as @report otherwise.
1101#
1102# @stop: for guest operations, stop the virtual machine;
1103# for jobs, pause the job
1104#
8c398252
KW
1105# @auto: inherit the error handling policy of the backend (since: 2.7)
1106#
1ad166b6
BC
1107# Since: 1.3
1108##
1109{ 'enum': 'BlockdevOnError',
8c398252 1110 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1ad166b6
BC
1111
1112##
1113# @MirrorSyncMode:
1114#
1115# An enumeration of possible behaviors for the initial synchronization
1116# phase of storage mirroring.
1117#
1118# @top: copies data in the topmost image to the destination
1119#
1120# @full: copies data from all images to the destination
1121#
1122# @none: only copy data written from now on
1123#
c8b56501
JS
1124# @incremental: only copy data described by the dirty bitmap. (since: 2.4)
1125#
1126# @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
1127# Behavior on completion is determined by the BitmapSyncMode.
d58d8453 1128#
1ad166b6
BC
1129# Since: 1.3
1130##
1131{ 'enum': 'MirrorSyncMode',
c8b56501 1132 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1ad166b6 1133
00a463b1
JS
1134##
1135# @BitmapSyncMode:
1136#
1137# An enumeration of possible behaviors for the synchronization of a bitmap
1138# when used for data copy operations.
1139#
1140# @on-success: The bitmap is only synced when the operation is successful.
1141# This is the behavior always used for 'INCREMENTAL' backups.
1142#
cf0cd293
JS
1143# @never: The bitmap is never synchronized with the operation, and is
1144# treated solely as a read-only manifest of blocks to copy.
1145#
c23909e5
JS
1146# @always: The bitmap is always synchronized with the operation,
1147# regardless of whether or not the operation was successful.
1148#
00a463b1
JS
1149# Since: 4.2
1150##
1151{ 'enum': 'BitmapSyncMode',
c23909e5 1152 'data': ['on-success', 'never', 'always'] }
00a463b1 1153
d06107ad
HR
1154##
1155# @MirrorCopyMode:
1156#
1157# An enumeration whose values tell the mirror block job when to
1158# trigger writes to the target.
1159#
1160# @background: copy data in background only.
1161#
1162# @write-blocking: when data is written to the source, write it
1163# (synchronously) to the target as well. In
1164# addition, data is copied in background just like in
1165# @background mode.
1166#
1167# Since: 3.0
1168##
1169{ 'enum': 'MirrorCopyMode',
1170 'data': ['background', 'write-blocking'] }
1171
1ad166b6
BC
1172##
1173# @BlockJobInfo:
1174#
1175# Information about a long-running block device operation.
1176#
1177# @type: the job type ('stream' for image streaming)
1178#
6aae5be6
AG
1179# @device: The job identifier. Originally the device name but other
1180# values are allowed since QEMU 2.7
1ad166b6 1181#
a81e0a82
KW
1182# @len: Estimated @offset value at the completion of the job. This value can
1183# arbitrarily change while the job is running, in both directions.
1184#
1185# @offset: Progress made until now. The unit is arbitrary and the value can
1186# only meaningfully be used for the ratio of @offset to @len. The
1187# value is monotonically increasing.
1ad166b6
BC
1188#
1189# @busy: false if the job is known to be in a quiescent state, with
1190# no pending I/O. Since 1.3.
1191#
1192# @paused: whether the job is paused or, if @busy is true, will
1193# pause itself as soon as possible. Since 1.3.
1194#
1ad166b6
BC
1195# @speed: the rate limit, bytes per second
1196#
1197# @io-status: the status of the job (since 1.3)
1198#
ef6dbf1e
HR
1199# @ready: true if the job may be completed (since 2.2)
1200#
58b295ba
JS
1201# @status: Current job state/status (since 2.12)
1202#
b40dacdc
JS
1203# @auto-finalize: Job will finalize itself when PENDING, moving to
1204# the CONCLUDED state. (since 2.12)
1205#
1206# @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1207# state and disappearing from the query list. (since 2.12)
1208#
ab9ba614
JS
1209# @error: Error information if the job did not complete successfully.
1210# Not set if the job completed successfully. (since 2.12.1)
1211#
1ad166b6
BC
1212# Since: 1.1
1213##
895a2a80 1214{ 'struct': 'BlockJobInfo',
1ad166b6
BC
1215 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1216 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
58b295ba 1217 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
a50c2ab8 1218 'status': 'JobStatus',
ab9ba614
JS
1219 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1220 '*error': 'str' } }
1ad166b6
BC
1221
1222##
1223# @query-block-jobs:
1224#
1225# Return information about long-running block device operations.
1226#
1227# Returns: a list of @BlockJobInfo for each active block job
1228#
1229# Since: 1.1
1230##
1231{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1232
1233##
1234# @block_passwd:
1235#
1236# This command sets the password of a block device that has not been open
1237# with a password and requires one.
1238#
c01c214b 1239# This command is now obsolete and will always return an error since 2.10
91f96b64 1240#
1ad166b6 1241##
b0ddeba2
MAL
1242{ 'command': 'block_passwd',
1243 'data': { '*device': 'str',
1244 '*node-name': 'str',
1245 'password': 'str' } }
1ad166b6
BC
1246
1247##
5072f7b3 1248# @block_resize:
1ad166b6
BC
1249#
1250# Resize a block image while a guest is running.
1251#
1252# Either @device or @node-name must be set but not both.
1253#
1d8bda12 1254# @device: the name of the device to get the image resized
1ad166b6 1255#
1d8bda12 1256# @node-name: graph node name to get the image resized (Since 2.0)
1ad166b6
BC
1257#
1258# @size: new image size in bytes
1259#
e050e426
PM
1260# Returns: - nothing on success
1261# - If @device is not a valid block device, DeviceNotFound
1ad166b6
BC
1262#
1263# Since: 0.14.0
0dc869cf
MAL
1264#
1265# Example:
1266#
1267# -> { "execute": "block_resize",
1268# "arguments": { "device": "scratch", "size": 1073741824 } }
1269# <- { "return": {} }
1270#
1ad166b6 1271##
b0ddeba2
MAL
1272{ 'command': 'block_resize',
1273 'data': { '*device': 'str',
1274 '*node-name': 'str',
1275 'size': 'int' } }
1ad166b6
BC
1276
1277##
5072f7b3 1278# @NewImageMode:
1ad166b6
BC
1279#
1280# An enumeration that tells QEMU how to set the backing file path in
1281# a new image file.
1282#
1283# @existing: QEMU should look for an existing image file.
1284#
1285# @absolute-paths: QEMU should create a new image with absolute paths
26ec4e53
PM
1286# for the backing file. If there is no backing file available, the new
1287# image will not be backed either.
1ad166b6
BC
1288#
1289# Since: 1.1
1290##
1291{ 'enum': 'NewImageMode',
1292 'data': [ 'existing', 'absolute-paths' ] }
1293
1294##
5072f7b3 1295# @BlockdevSnapshotSync:
1ad166b6
BC
1296#
1297# Either @device or @node-name must be set but not both.
1298#
681b86ac 1299# @device: the name of the device to take a snapshot of.
1ad166b6 1300#
1d8bda12 1301# @node-name: graph node name to generate the snapshot from (Since 2.0)
1ad166b6 1302#
681b86ac 1303# @snapshot-file: the target of the new overlay image. If the file
26ec4e53
PM
1304# exists, or if it is a device, the overlay will be created in the
1305# existing file/device. Otherwise, a new file will be created.
1ad166b6 1306#
1d8bda12 1307# @snapshot-node-name: the graph node name of the new image (Since 2.0)
1ad166b6 1308#
681b86ac 1309# @format: the format of the overlay image, default is 'qcow2'.
1ad166b6 1310#
1d8bda12 1311# @mode: whether and how QEMU should create a new image, default is
1ad166b6
BC
1312# 'absolute-paths'.
1313##
a911e6ae 1314{ 'struct': 'BlockdevSnapshotSync',
1ad166b6
BC
1315 'data': { '*device': 'str', '*node-name': 'str',
1316 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1317 '*format': 'str', '*mode': 'NewImageMode' } }
1318
43de7e2d 1319##
5072f7b3 1320# @BlockdevSnapshot:
43de7e2d 1321#
681b86ac 1322# @node: device or node name that will have a snapshot taken.
43de7e2d
AG
1323#
1324# @overlay: reference to the existing block device that will become
681b86ac 1325# the overlay of @node, as part of taking the snapshot.
43de7e2d 1326# It must not have a current backing file (this can be
4f7be280 1327# achieved by passing "backing": null to blockdev-add).
43de7e2d 1328#
5072f7b3 1329# Since: 2.5
43de7e2d
AG
1330##
1331{ 'struct': 'BlockdevSnapshot',
1332 'data': { 'node': 'str', 'overlay': 'str' } }
1333
1ad166b6 1334##
3c95037a 1335# @BackupCommon:
1ad166b6 1336#
1d8bda12 1337# @job-id: identifier for the newly-created block job. If
70559d49
AG
1338# omitted, the device name will be used. (Since 2.7)
1339#
b7e4fa22 1340# @device: the device name or node-name of a root node which should be copied.
1ad166b6 1341#
1ad166b6 1342# @sync: what parts of the disk image should be copied to the destination
d58d8453
JS
1343# (all the disk, only the sectors allocated in the topmost image, from a
1344# dirty bitmap, or only new I/O).
1ad166b6 1345#
3c95037a
JS
1346# @speed: the maximum speed, in bytes per second. The default is 0,
1347# for unlimited.
1ad166b6 1348#
1a2b8b40 1349# @bitmap: The name of a dirty bitmap to use.
c8b56501 1350# Must be present if sync is "bitmap" or "incremental".
1a2b8b40 1351# Can be present if sync is "full" or "top".
c8b56501
JS
1352# Must not be present otherwise.
1353# (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1354#
1355# @bitmap-mode: Specifies the type of data the bitmap should contain after
1a2b8b40
JS
1356# the operation concludes.
1357# Must be present if a bitmap was provided,
c8b56501 1358# Must NOT be present otherwise. (Since 4.2)
d58d8453 1359#
1d8bda12 1360# @compress: true to compress data, if the target format supports it.
6bed0280 1361# (default: false) (since 2.8)
13b9414b 1362#
1d8bda12 1363# @on-source-error: the action to take on an error on the source,
1ad166b6
BC
1364# default 'report'. 'stop' and 'enospc' can only be used
1365# if the block device supports io-status (see BlockInfo).
1366#
1d8bda12 1367# @on-target-error: the action to take on an error on the target,
1ad166b6
BC
1368# default 'report' (no limitations, since this applies to
1369# a different block device than @device).
1370#
b40dacdc 1371# @auto-finalize: When false, this job will wait in a PENDING state after it has
dfaff2c3
JS
1372# finished its work, waiting for @block-job-finalize before
1373# making any block graph changes.
1374# When true, this job will automatically
1375# perform its abort or commit actions.
b40dacdc
JS
1376# Defaults to true. (Since 2.12)
1377#
1378# @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
dfaff2c3 1379# has completely ceased all work, and awaits @block-job-dismiss.
b40dacdc
JS
1380# When true, this job will automatically disappear from the query
1381# list without user intervention.
1382# Defaults to true. (Since 2.12)
1383#
00e30f05
VSO
1384# @filter-node-name: the node name that should be assigned to the
1385# filter driver that the backup job inserts into the graph
1386# above node specified by @drive. If this option is not given,
1387# a node name is autogenerated. (Since: 4.2)
1388#
5072f7b3 1389# Note: @on-source-error and @on-target-error only affect background
26ec4e53
PM
1390# I/O. If an error occurs during a guest write request, the device's
1391# rerror/werror actions will be used.
1ad166b6 1392#
3c95037a 1393# Since: 4.2
1ad166b6 1394##
3c95037a
JS
1395{ 'struct': 'BackupCommon',
1396 'data': { '*job-id': 'str', 'device': 'str',
1397 'sync': 'MirrorSyncMode', '*speed': 'int',
c8b56501
JS
1398 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1399 '*compress': 'bool',
1ad166b6 1400 '*on-source-error': 'BlockdevOnError',
b40dacdc 1401 '*on-target-error': 'BlockdevOnError',
00e30f05
VSO
1402 '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
1403 '*filter-node-name': 'str' } }
1ad166b6 1404
c29c1dd3 1405##
3c95037a 1406# @DriveBackup:
3b7b1236 1407#
3c95037a
JS
1408# @target: the target of the new image. If the file exists, or if it
1409# is a device, the existing file/device will be used as the new
1410# destination. If it does not exist, a new file will be created.
c29c1dd3 1411#
3c95037a
JS
1412# @format: the format of the new destination, default is to
1413# probe if @mode is 'existing', else the format of the source
c29c1dd3 1414#
3c95037a
JS
1415# @mode: whether and how QEMU should create a new image, default is
1416# 'absolute-paths'.
b40dacdc 1417#
3c95037a
JS
1418# Since: 1.6
1419##
1420{ 'struct': 'DriveBackup',
1421 'base': 'BackupCommon',
1422 'data': { 'target': 'str',
1423 '*format': 'str',
1424 '*mode': 'NewImageMode' } }
1425
1426##
1427# @BlockdevBackup:
b40dacdc 1428#
3c95037a 1429# @target: the device name or node-name of the backup target node.
c29c1dd3
FZ
1430#
1431# Since: 2.3
1432##
895a2a80 1433{ 'struct': 'BlockdevBackup',
3c95037a
JS
1434 'base': 'BackupCommon',
1435 'data': { 'target': 'str' } }
c29c1dd3 1436
1ad166b6 1437##
5072f7b3 1438# @blockdev-snapshot-sync:
1ad166b6 1439#
681b86ac 1440# Takes a synchronous snapshot of a block device.
1ad166b6 1441#
a911e6ae 1442# For the arguments, see the documentation of BlockdevSnapshotSync.
1ad166b6 1443#
e050e426
PM
1444# Returns: - nothing on success
1445# - If @device is not a valid block device, DeviceNotFound
1ad166b6 1446#
5072f7b3 1447# Since: 0.14.0
b4039d8d
MAL
1448#
1449# Example:
1450#
1451# -> { "execute": "blockdev-snapshot-sync",
1452# "arguments": { "device": "ide-hd0",
1453# "snapshot-file":
1454# "/some/place/my-image",
1455# "format": "qcow2" } }
1456# <- { "return": {} }
1457#
1ad166b6
BC
1458##
1459{ 'command': 'blockdev-snapshot-sync',
a911e6ae 1460 'data': 'BlockdevSnapshotSync' }
1ad166b6 1461
43de7e2d
AG
1462
1463##
5072f7b3 1464# @blockdev-snapshot:
43de7e2d 1465#
681b86ac 1466# Takes a snapshot of a block device.
43de7e2d 1467#
681b86ac 1468# Take a snapshot, by installing 'node' as the backing image of
3282eca4
MAL
1469# 'overlay'. Additionally, if 'node' is associated with a block
1470# device, the block device changes to using 'overlay' as its new active
1471# image.
1472#
43de7e2d
AG
1473# For the arguments, see the documentation of BlockdevSnapshot.
1474#
5072f7b3 1475# Since: 2.5
3282eca4
MAL
1476#
1477# Example:
1478#
1479# -> { "execute": "blockdev-add",
244d04db
EB
1480# "arguments": { "driver": "qcow2",
1481# "node-name": "node1534",
1482# "file": { "driver": "file",
1483# "filename": "hd1.qcow2" },
4f7be280 1484# "backing": null } }
3282eca4
MAL
1485#
1486# <- { "return": {} }
1487#
1488# -> { "execute": "blockdev-snapshot",
1489# "arguments": { "node": "ide-hd0",
1490# "overlay": "node1534" } }
1491# <- { "return": {} }
1492#
43de7e2d
AG
1493##
1494{ 'command': 'blockdev-snapshot',
1495 'data': 'BlockdevSnapshot' }
1496
fa40e656 1497##
5072f7b3 1498# @change-backing-file:
fa40e656
JC
1499#
1500# Change the backing file in the image file metadata. This does not
1501# cause QEMU to reopen the image file to reparse the backing filename
1502# (it may, however, perform a reopen to change permissions from
1503# r/o -> r/w -> r/o, if needed). The new backing file string is written
1504# into the image file metadata, and the QEMU internal strings are
1505# updated.
1506#
1507# @image-node-name: The name of the block driver state node of the
280c4b3c
MAL
1508# image to modify. The "device" argument is used
1509# to verify "image-node-name" is in the chain
1510# described by "device".
fa40e656 1511#
26ec4e53
PM
1512# @device: The device name or node-name of the root node that owns
1513# image-node-name.
fa40e656 1514#
26ec4e53
PM
1515# @backing-file: The string to write as the backing file. This
1516# string is not validated, so care should be taken
1517# when specifying the string or the image chain may
1518# not be able to be reopened again.
fa40e656 1519#
e050e426
PM
1520# Returns: - Nothing on success
1521# - If "device" does not exist or cannot be determined, DeviceNotFound
280c4b3c 1522#
fa40e656
JC
1523# Since: 2.1
1524##
1525{ 'command': 'change-backing-file',
1526 'data': { 'device': 'str', 'image-node-name': 'str',
1527 'backing-file': 'str' } }
1528
1ad166b6 1529##
5072f7b3 1530# @block-commit:
1ad166b6
BC
1531#
1532# Live commit of data from overlay image nodes into backing nodes - i.e.,
1533# writes data between 'top' and 'base' into 'base'.
1534#
1d8bda12 1535# @job-id: identifier for the newly-created block job. If
fd62c609
AG
1536# omitted, the device name will be used. (Since 2.7)
1537#
26ec4e53 1538# @device: the device name or node-name of a root node
1ad166b6 1539#
3c605f40
KW
1540# @base-node: The node name of the backing image to write data into.
1541# If not specified, this is the deepest backing image.
1542# (since: 3.1)
1ad166b6 1543#
3c605f40
KW
1544# @base: Same as @base-node, except that it is a file name rather than a node
1545# name. This must be the exact filename string that was used to open the
1546# node; other strings, even if addressing the same file, are not
1547# accepted (deprecated, use @base-node instead)
1548#
1549# @top-node: The node name of the backing image within the image chain
1550# which contains the topmost data to be committed down. If
1551# not specified, this is the active layer. (since: 3.1)
1552#
1553# @top: Same as @top-node, except that it is a file name rather than a node
1554# name. This must be the exact filename string that was used to open the
1555# node; other strings, even if addressing the same file, are not
1556# accepted (deprecated, use @base-node instead)
1ad166b6 1557#
26ec4e53
PM
1558# @backing-file: The backing file string to write into the overlay
1559# image of 'top'. If 'top' is the active layer,
1560# specifying a backing file string is an error. This
1561# filename is not validated.
1562#
1563# If a pathname string is such that it cannot be
1564# resolved by QEMU, that means that subsequent QMP or
1565# HMP commands must use node-names for the image in
1566# question, as filename lookup methods will fail.
1567#
1568# If not specified, QEMU will automatically determine
1569# the backing file string to use, or error out if
1570# there is no obvious choice. Care should be taken
1571# when specifying the string, to specify a valid
1572# filename or protocol.
1573# (Since 2.1)
1574#
1575# If top == base, that is an error.
1576# If top == active, the job will not be completed by itself,
1577# user needs to complete the job with the block-job-complete
1578# command after getting the ready event. (Since 2.0)
1579#
1580# If the base image is smaller than top, then the base image
1581# will be resized to be the same size as top. If top is
1582# smaller than the base image, the base will not be
1583# truncated. If you want the base image size to match the
1584# size of the smaller top, you can safely truncate it
1585# yourself once the commit operation successfully completes.
1586#
1587# @speed: the maximum speed, in bytes per second
1ad166b6 1588#
8faad1c7
KW
1589# @on-error: the action to take on an error. 'ignore' means that the request
1590# should be retried. (default: report; Since: 5.0)
1591#
1d8bda12 1592# @filter-node-name: the node name that should be assigned to the
0db832f4
KW
1593# filter driver that the commit job inserts into the graph
1594# above @top. If this option is not given, a node name is
1595# autogenerated. (Since: 2.9)
1596#
96fbf534
JS
1597# @auto-finalize: When false, this job will wait in a PENDING state after it has
1598# finished its work, waiting for @block-job-finalize before
1599# making any block graph changes.
1600# When true, this job will automatically
1601# perform its abort or commit actions.
1602# Defaults to true. (Since 3.1)
1603#
1604# @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1605# has completely ceased all work, and awaits @block-job-dismiss.
1606# When true, this job will automatically disappear from the query
1607# list without user intervention.
1608# Defaults to true. (Since 3.1)
1609#
e050e426
PM
1610# Returns: - Nothing on success
1611# - If @device does not exist, DeviceNotFound
1612# - Any other error returns a GenericError.
1ad166b6
BC
1613#
1614# Since: 1.3
1615#
f44fb58f
MAL
1616# Example:
1617#
1618# -> { "execute": "block-commit",
1619# "arguments": { "device": "virtio0",
1620# "top": "/tmp/snap1.qcow2" } }
1621# <- { "return": {} }
1622#
1ad166b6
BC
1623##
1624{ 'command': 'block-commit',
3c605f40
KW
1625 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1626 '*base': 'str', '*top-node': 'str', '*top': 'str',
0db832f4 1627 '*backing-file': 'str', '*speed': 'int',
8faad1c7 1628 '*on-error': 'BlockdevOnError',
96fbf534
JS
1629 '*filter-node-name': 'str',
1630 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1ad166b6
BC
1631
1632##
5072f7b3 1633# @drive-backup:
1ad166b6
BC
1634#
1635# Start a point-in-time copy of a block device to a new destination. The
1636# status of ongoing drive-backup operations can be checked with
1637# query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1638# The operation can be stopped before it has completed using the
1639# block-job-cancel command.
1640#
e050e426
PM
1641# Returns: - nothing on success
1642# - If @device is not a valid block device, GenericError
1ad166b6 1643#
5072f7b3 1644# Since: 1.6
b0336412
MAL
1645#
1646# Example:
1647#
1648# -> { "execute": "drive-backup",
1649# "arguments": { "device": "drive0",
1650# "sync": "full",
1651# "target": "backup.img" } }
1652# <- { "return": {} }
1653#
1ad166b6 1654##
81206a89
PB
1655{ 'command': 'drive-backup', 'boxed': true,
1656 'data': 'DriveBackup' }
1ad166b6 1657
c29c1dd3 1658##
5072f7b3 1659# @blockdev-backup:
c29c1dd3
FZ
1660#
1661# Start a point-in-time copy of a block device to a new destination. The
1662# status of ongoing blockdev-backup operations can be checked with
1663# query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1664# The operation can be stopped before it has completed using the
1665# block-job-cancel command.
1666#
e050e426
PM
1667# Returns: - nothing on success
1668# - If @device is not a valid block device, DeviceNotFound
dc7a4a9e 1669#
5072f7b3 1670# Since: 2.3
1cf75113
MAL
1671#
1672# Example:
1673# -> { "execute": "blockdev-backup",
1674# "arguments": { "device": "src-id",
1675# "sync": "full",
1676# "target": "tgt-id" } }
1677# <- { "return": {} }
1678#
c29c1dd3 1679##
dc7a4a9e
PB
1680{ 'command': 'blockdev-backup', 'boxed': true,
1681 'data': 'BlockdevBackup' }
c29c1dd3
FZ
1682
1683
1ad166b6 1684##
5072f7b3 1685# @query-named-block-nodes:
1ad166b6
BC
1686#
1687# Get the named block driver list
1688#
facda544
PK
1689# @flat: Omit the nested data about backing image ("backing-image" key) if true.
1690# Default is false (Since 5.0)
1691#
1ad166b6
BC
1692# Returns: the list of BlockDeviceInfo
1693#
5072f7b3 1694# Since: 2.0
e1f34cb2
MAL
1695#
1696# Example:
1697#
1698# -> { "execute": "query-named-block-nodes" }
1699# <- { "return": [ { "ro":false,
1700# "drv":"qcow2",
1701# "encrypted":false,
1702# "file":"disks/test.qcow2",
1703# "node-name": "my-node",
1704# "backing_file_depth":1,
1705# "bps":1000000,
1706# "bps_rd":0,
1707# "bps_wr":0,
1708# "iops":1000000,
1709# "iops_rd":0,
1710# "iops_wr":0,
1711# "bps_max": 8000000,
1712# "bps_rd_max": 0,
1713# "bps_wr_max": 0,
1714# "iops_max": 0,
1715# "iops_rd_max": 0,
1716# "iops_wr_max": 0,
1717# "iops_size": 0,
1718# "write_threshold": 0,
1719# "image":{
1720# "filename":"disks/test.qcow2",
1721# "format":"qcow2",
1722# "virtual-size":2048000,
1723# "backing_file":"base.qcow2",
1724# "full-backing-filename":"disks/base.qcow2",
1725# "backing-filename-format":"qcow2",
1726# "snapshots":[
1727# {
1728# "id": "1",
1729# "name": "snapshot1",
1730# "vm-state-size": 0,
1731# "date-sec": 10000200,
1732# "date-nsec": 12,
1733# "vm-clock-sec": 206,
1734# "vm-clock-nsec": 30
1735# }
1736# ],
1737# "backing-image":{
1738# "filename":"disks/base.qcow2",
1739# "format":"qcow2",
1740# "virtual-size":2048000
1741# }
1742# } } ] }
1743#
1ad166b6 1744##
facda544
PK
1745{ 'command': 'query-named-block-nodes',
1746 'returns': [ 'BlockDeviceInfo' ],
1747 'data': { '*flat': 'bool' } }
1ad166b6 1748
5d3b4e99
VSO
1749##
1750# @XDbgBlockGraphNodeType:
1751#
1752# @block-backend: corresponds to BlockBackend
1753#
1754# @block-job: corresonds to BlockJob
1755#
1756# @block-driver: corresponds to BlockDriverState
1757#
1758# Since: 4.0
1759##
1760{ 'enum': 'XDbgBlockGraphNodeType',
1761 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1762
1763##
1764# @XDbgBlockGraphNode:
1765#
1766# @id: Block graph node identifier. This @id is generated only for
1767# x-debug-query-block-graph and does not relate to any other identifiers in
1768# Qemu.
1769#
1770# @type: Type of graph node. Can be one of block-backend, block-job or
1771# block-driver-state.
1772#
1773# @name: Human readable name of the node. Corresponds to node-name for
1774# block-driver-state nodes; is not guaranteed to be unique in the whole
1775# graph (with block-jobs and block-backends).
1776#
1777# Since: 4.0
1778##
1779{ 'struct': 'XDbgBlockGraphNode',
1780 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1781
1782##
1783# @BlockPermission:
1784#
1785# Enum of base block permissions.
1786#
1787# @consistent-read: A user that has the "permission" of consistent reads is
1788# guaranteed that their view of the contents of the block
1789# device is complete and self-consistent, representing the
1790# contents of a disk at a specific point.
1791# For most block devices (including their backing files) this
1792# is true, but the property cannot be maintained in a few
1793# situations like for intermediate nodes of a commit block
1794# job.
1795#
1796# @write: This permission is required to change the visible disk contents.
1797#
1798# @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1799# both enough and required for writes to the block node when
1800# the caller promises that the visible disk content doesn't
1801# change.
1802# As the BLK_PERM_WRITE permission is strictly stronger,
1803# either is sufficient to perform an unchanging write.
1804#
1805# @resize: This permission is required to change the size of a block node.
1806#
1807# @graph-mod: This permission is required to change the node that this
1808# BdrvChild points to.
1809#
1810# Since: 4.0
1811##
1812 { 'enum': 'BlockPermission',
1813 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
1814 'graph-mod' ] }
1815##
1816# @XDbgBlockGraphEdge:
1817#
1818# Block Graph edge description for x-debug-query-block-graph.
1819#
1820# @parent: parent id
1821#
1822# @child: child id
1823#
1824# @name: name of the relation (examples are 'file' and 'backing')
1825#
1826# @perm: granted permissions for the parent operating on the child
1827#
1828# @shared-perm: permissions that can still be granted to other users of the
1829# child while it is still attached to this parent
1830#
1831# Since: 4.0
1832##
1833{ 'struct': 'XDbgBlockGraphEdge',
1834 'data': { 'parent': 'uint64', 'child': 'uint64',
1835 'name': 'str', 'perm': [ 'BlockPermission' ],
1836 'shared-perm': [ 'BlockPermission' ] } }
1837
1838##
1839# @XDbgBlockGraph:
1840#
1841# Block Graph - list of nodes and list of edges.
1842#
1843# Since: 4.0
1844##
1845{ 'struct': 'XDbgBlockGraph',
1846 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1847
1848##
1849# @x-debug-query-block-graph:
1850#
1851# Get the block graph.
1852#
1853# Since: 4.0
1854##
1855{ 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph' }
1856
1ad166b6 1857##
5072f7b3 1858# @drive-mirror:
1ad166b6 1859#
12a21b73
MAL
1860# Start mirroring a block device's writes to a new destination. target
1861# specifies the target of the new image. If the file exists, or if it
1862# is a device, it will be used as the new destination for writes. If
1863# it does not exist, a new file will be created. format specifies the
1864# format of the mirror image, default is to probe if mode='existing',
1865# else the format of the source.
1ad166b6 1866#
e050e426
PM
1867# Returns: - nothing on success
1868# - If @device is not a valid block device, GenericError
faecd40a 1869#
5072f7b3 1870# Since: 1.3
12a21b73
MAL
1871#
1872# Example:
1873#
1874# -> { "execute": "drive-mirror",
1875# "arguments": { "device": "ide-hd0",
1876# "target": "/some/place/my-image",
1877# "sync": "full",
1878# "format": "qcow2" } }
1879# <- { "return": {} }
1880#
faecd40a
EB
1881##
1882{ 'command': 'drive-mirror', 'boxed': true,
1883 'data': 'DriveMirror' }
1884
1885##
5072f7b3 1886# @DriveMirror:
faecd40a
EB
1887#
1888# A set of parameters describing drive mirror setup.
1889#
1d8bda12 1890# @job-id: identifier for the newly-created block job. If
71aa9867
AG
1891# omitted, the device name will be used. (Since 2.7)
1892#
0524e93a
KW
1893# @device: the device name or node-name of a root node whose writes should be
1894# mirrored.
1ad166b6
BC
1895#
1896# @target: the target of the new image. If the file exists, or if it
1897# is a device, the existing file/device will be used as the new
1898# destination. If it does not exist, a new file will be created.
1899#
1d8bda12 1900# @format: the format of the new destination, default is to
1ad166b6
BC
1901# probe if @mode is 'existing', else the format of the source
1902#
1d8bda12 1903# @node-name: the new block driver state node name in the graph
4c828dc6
BC
1904# (Since 2.1)
1905#
1d8bda12 1906# @replaces: with sync=full graph node name to be replaced by the new
09158f00
BC
1907# image when a whole image copy is done. This can be used to repair
1908# broken Quorum files. (Since 2.1)
1909#
1d8bda12 1910# @mode: whether and how QEMU should create a new image, default is
1ad166b6
BC
1911# 'absolute-paths'.
1912#
1d8bda12 1913# @speed: the maximum speed, in bytes per second
1ad166b6
BC
1914#
1915# @sync: what parts of the disk image should be copied to the destination
1916# (all the disk, only the sectors allocated in the topmost image, or
1917# only new I/O).
1918#
1d8bda12 1919# @granularity: granularity of the dirty bitmap, default is 64K
1ad166b6
BC
1920# if the image format doesn't have clusters, 4K if the clusters
1921# are smaller than that, else the cluster size. Must be a
1922# power of 2 between 512 and 64M (since 1.4).
1923#
1d8bda12 1924# @buf-size: maximum amount of data in flight from source to
1ad166b6
BC
1925# target (since 1.4).
1926#
1d8bda12 1927# @on-source-error: the action to take on an error on the source,
1ad166b6
BC
1928# default 'report'. 'stop' and 'enospc' can only be used
1929# if the block device supports io-status (see BlockInfo).
1930#
1d8bda12 1931# @on-target-error: the action to take on an error on the target,
1ad166b6
BC
1932# default 'report' (no limitations, since this applies to
1933# a different block device than @device).
1d8bda12 1934# @unmap: Whether to try to unmap target sectors where source has
0fc9f8ea
FZ
1935# only zero. If true, and target unallocated sectors will read as zero,
1936# target image sectors will be unmapped; otherwise, zeroes will be
1937# written. Both will result in identical contents.
1938# Default is true. (Since 2.4)
1ad166b6 1939#
481debaa
HR
1940# @copy-mode: when to copy data to the destination; defaults to 'background'
1941# (Since: 3.0)
1942#
a6b58ade
JS
1943# @auto-finalize: When false, this job will wait in a PENDING state after it has
1944# finished its work, waiting for @block-job-finalize before
1945# making any block graph changes.
1946# When true, this job will automatically
1947# perform its abort or commit actions.
1948# Defaults to true. (Since 3.1)
1949#
1950# @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1951# has completely ceased all work, and awaits @block-job-dismiss.
1952# When true, this job will automatically disappear from the query
1953# list without user intervention.
1954# Defaults to true. (Since 3.1)
5072f7b3 1955# Since: 1.3
1ad166b6 1956##
faecd40a 1957{ 'struct': 'DriveMirror',
71aa9867
AG
1958 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1959 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1ad166b6
BC
1960 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1961 '*speed': 'int', '*granularity': 'uint32',
1962 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
0fc9f8ea 1963 '*on-target-error': 'BlockdevOnError',
a6b58ade
JS
1964 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
1965 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1ad166b6 1966
341ebc2f 1967##
5072f7b3 1968# @BlockDirtyBitmap:
341ebc2f
JS
1969#
1970# @node: name of device/node which the bitmap is tracking
1971#
1972# @name: name of the dirty bitmap
1973#
5072f7b3 1974# Since: 2.4
341ebc2f 1975##
895a2a80 1976{ 'struct': 'BlockDirtyBitmap',
341ebc2f
JS
1977 'data': { 'node': 'str', 'name': 'str' } }
1978
1979##
5072f7b3 1980# @BlockDirtyBitmapAdd:
341ebc2f
JS
1981#
1982# @node: name of device/node which the bitmap is tracking
1983#
cf7c49cf 1984# @name: name of the dirty bitmap (must be less than 1024 bytes)
341ebc2f 1985#
1d8bda12 1986# @granularity: the bitmap granularity, default is 64k for
341ebc2f
JS
1987# block-dirty-bitmap-add
1988#
fd5ae4cc
VSO
1989# @persistent: the bitmap is persistent, i.e. it will be saved to the
1990# corresponding block device image file on its close. For now only
1991# Qcow2 disks support persistent bitmaps. Default is false for
1992# block-dirty-bitmap-add. (Since: 2.10)
1993#
0e2b7f09
JS
1994# @disabled: the bitmap is created in the disabled state, which means that
1995# it will not track drive changes. The bitmap may be enabled with
1996# block-dirty-bitmap-enable. Default is false. (Since: 4.0)
a6e2ca5f 1997#
5072f7b3 1998# Since: 2.4
341ebc2f 1999##
895a2a80 2000{ 'struct': 'BlockDirtyBitmapAdd',
fd5ae4cc 2001 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
3264ffce 2002 '*persistent': 'bool', '*disabled': 'bool' } }
341ebc2f 2003
eff0829b
VSO
2004##
2005# @BlockDirtyBitmapMergeSource:
2006#
2007# @local: name of the bitmap, attached to the same node as target bitmap.
2008#
2009# @external: bitmap with specified node
2010#
2011# Since: 4.1
2012##
2013{ 'alternate': 'BlockDirtyBitmapMergeSource',
2014 'data': { 'local': 'str',
2015 'external': 'BlockDirtyBitmap' } }
2016
b598e531
VSO
2017##
2018# @BlockDirtyBitmapMerge:
2019#
eff0829b 2020# @node: name of device/node which the @target bitmap is tracking
b598e531 2021#
360d4e4e 2022# @target: name of the destination dirty bitmap
b598e531 2023#
eff0829b
VSO
2024# @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully
2025# specifed BlockDirtyBitmap elements. The latter are supported
2026# since 4.1.
b598e531 2027#
0e2b7f09 2028# Since: 4.0
b598e531
VSO
2029##
2030{ 'struct': 'BlockDirtyBitmapMerge',
eff0829b
VSO
2031 'data': { 'node': 'str', 'target': 'str',
2032 'bitmaps': ['BlockDirtyBitmapMergeSource'] } }
b598e531 2033
341ebc2f 2034##
5072f7b3 2035# @block-dirty-bitmap-add:
341ebc2f 2036#
2258a5db 2037# Create a dirty bitmap with a name on the node, and start tracking the writes.
341ebc2f 2038#
e050e426
PM
2039# Returns: - nothing on success
2040# - If @node is not a valid block device or node, DeviceNotFound
2041# - If @name is already taken, GenericError with an explanation
341ebc2f 2042#
5072f7b3 2043# Since: 2.4
2258a5db
MAL
2044#
2045# Example:
2046#
2047# -> { "execute": "block-dirty-bitmap-add",
2048# "arguments": { "node": "drive0", "name": "bitmap0" } }
2049# <- { "return": {} }
2050#
341ebc2f
JS
2051##
2052{ 'command': 'block-dirty-bitmap-add',
2053 'data': 'BlockDirtyBitmapAdd' }
2054
2055##
5072f7b3 2056# @block-dirty-bitmap-remove:
341ebc2f 2057#
4bbca422 2058# Stop write tracking and remove the dirty bitmap that was created
5c36c1af
VSO
2059# with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2060# storage too.
341ebc2f 2061#
e050e426
PM
2062# Returns: - nothing on success
2063# - If @node is not a valid block device or node, DeviceNotFound
2064# - If @name is not found, GenericError with an explanation
2065# - if @name is frozen by an operation, GenericError
341ebc2f 2066#
5072f7b3 2067# Since: 2.4
4bbca422
MAL
2068#
2069# Example:
2070#
2071# -> { "execute": "block-dirty-bitmap-remove",
2072# "arguments": { "node": "drive0", "name": "bitmap0" } }
2073# <- { "return": {} }
2074#
341ebc2f
JS
2075##
2076{ 'command': 'block-dirty-bitmap-remove',
2077 'data': 'BlockDirtyBitmap' }
2078
e74e6b78 2079##
5072f7b3 2080# @block-dirty-bitmap-clear:
e74e6b78 2081#
73dffdc8
MAL
2082# Clear (reset) a dirty bitmap on the device, so that an incremental
2083# backup from this point in time forward will only backup clusters
2084# modified after this clear operation.
e74e6b78 2085#
e050e426
PM
2086# Returns: - nothing on success
2087# - If @node is not a valid block device, DeviceNotFound
2088# - If @name is not found, GenericError with an explanation
e74e6b78 2089#
5072f7b3 2090# Since: 2.4
73dffdc8
MAL
2091#
2092# Example:
2093#
2094# -> { "execute": "block-dirty-bitmap-clear",
2095# "arguments": { "node": "drive0", "name": "bitmap0" } }
2096# <- { "return": {} }
2097#
e74e6b78
JS
2098##
2099{ 'command': 'block-dirty-bitmap-clear',
2100 'data': 'BlockDirtyBitmap' }
2101
5c5d2e50 2102##
0e2b7f09 2103# @block-dirty-bitmap-enable:
5c5d2e50
VSO
2104#
2105# Enables a dirty bitmap so that it will begin tracking disk changes.
2106#
e050e426
PM
2107# Returns: - nothing on success
2108# - If @node is not a valid block device, DeviceNotFound
2109# - If @name is not found, GenericError with an explanation
5c5d2e50 2110#
0e2b7f09 2111# Since: 4.0
5c5d2e50
VSO
2112#
2113# Example:
2114#
0e2b7f09 2115# -> { "execute": "block-dirty-bitmap-enable",
5c5d2e50
VSO
2116# "arguments": { "node": "drive0", "name": "bitmap0" } }
2117# <- { "return": {} }
2118#
2119##
0e2b7f09 2120 { 'command': 'block-dirty-bitmap-enable',
5c5d2e50
VSO
2121 'data': 'BlockDirtyBitmap' }
2122
2123##
0e2b7f09 2124# @block-dirty-bitmap-disable:
5c5d2e50
VSO
2125#
2126# Disables a dirty bitmap so that it will stop tracking disk changes.
2127#
e050e426
PM
2128# Returns: - nothing on success
2129# - If @node is not a valid block device, DeviceNotFound
2130# - If @name is not found, GenericError with an explanation
5c5d2e50 2131#
0e2b7f09 2132# Since: 4.0
5c5d2e50
VSO
2133#
2134# Example:
2135#
0e2b7f09 2136# -> { "execute": "block-dirty-bitmap-disable",
5c5d2e50
VSO
2137# "arguments": { "node": "drive0", "name": "bitmap0" } }
2138# <- { "return": {} }
2139#
2140##
0e2b7f09 2141 { 'command': 'block-dirty-bitmap-disable',
5c5d2e50
VSO
2142 'data': 'BlockDirtyBitmap' }
2143
b598e531 2144##
0e2b7f09 2145# @block-dirty-bitmap-merge:
b598e531 2146#
360d4e4e 2147# Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
73ab5d60
JS
2148# Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2149# as the @target bitmap. Any bits already set in @target will still be
2150# set after the merge, i.e., this operation does not clear the target.
360d4e4e 2151# On error, @target is unchanged.
b598e531 2152#
73ab5d60
JS
2153# The resulting bitmap will count as dirty any clusters that were dirty in any
2154# of the source bitmaps. This can be used to achieve backup checkpoints, or in
2155# simpler usages, to copy bitmaps.
2156#
e050e426
PM
2157# Returns: - nothing on success
2158# - If @node is not a valid block device, DeviceNotFound
2159# - If any bitmap in @bitmaps or @target is not found, GenericError
2160# - If any of the bitmaps have different sizes or granularities,
2161# GenericError
b598e531 2162#
0e2b7f09 2163# Since: 4.0
b598e531
VSO
2164#
2165# Example:
2166#
0e2b7f09 2167# -> { "execute": "block-dirty-bitmap-merge",
360d4e4e
JS
2168# "arguments": { "node": "drive0", "target": "bitmap0",
2169# "bitmaps": ["bitmap1"] } }
b598e531
VSO
2170# <- { "return": {} }
2171#
2172##
0e2b7f09 2173 { 'command': 'block-dirty-bitmap-merge',
b598e531
VSO
2174 'data': 'BlockDirtyBitmapMerge' }
2175
a3b52535
VSO
2176##
2177# @BlockDirtyBitmapSha256:
2178#
2179# SHA256 hash of dirty bitmap data
2180#
2181# @sha256: ASCII representation of SHA256 bitmap hash
2182#
2183# Since: 2.10
2184##
2185 { 'struct': 'BlockDirtyBitmapSha256',
2186 'data': {'sha256': 'str'} }
2187
2188##
2189# @x-debug-block-dirty-bitmap-sha256:
2190#
73ab5d60 2191# Get bitmap SHA256.
a3b52535 2192#
e050e426
PM
2193# Returns: - BlockDirtyBitmapSha256 on success
2194# - If @node is not a valid block device, DeviceNotFound
2195# - If @name is not found or if hashing has failed, GenericError with an
2196# explanation
a3b52535
VSO
2197#
2198# Since: 2.10
2199##
2200 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2201 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
2202
df92562e 2203##
5072f7b3 2204# @blockdev-mirror:
df92562e
FZ
2205#
2206# Start mirroring a block device's writes to a new destination.
2207#
1d8bda12 2208# @job-id: identifier for the newly-created block job. If
71aa9867
AG
2209# omitted, the device name will be used. (Since 2.7)
2210#
07eec652
KW
2211# @device: The device name or node-name of a root node whose writes should be
2212# mirrored.
df92562e
FZ
2213#
2214# @target: the id or node-name of the block device to mirror to. This mustn't be
2215# attached to guest.
2216#
1d8bda12 2217# @replaces: with sync=full graph node name to be replaced by the new
df92562e
FZ
2218# image when a whole image copy is done. This can be used to repair
2219# broken Quorum files.
2220#
1d8bda12 2221# @speed: the maximum speed, in bytes per second
df92562e
FZ
2222#
2223# @sync: what parts of the disk image should be copied to the destination
2224# (all the disk, only the sectors allocated in the topmost image, or
2225# only new I/O).
2226#
1d8bda12 2227# @granularity: granularity of the dirty bitmap, default is 64K
df92562e
FZ
2228# if the image format doesn't have clusters, 4K if the clusters
2229# are smaller than that, else the cluster size. Must be a
2230# power of 2 between 512 and 64M
2231#
1d8bda12 2232# @buf-size: maximum amount of data in flight from source to
df92562e
FZ
2233# target
2234#
1d8bda12 2235# @on-source-error: the action to take on an error on the source,
df92562e
FZ
2236# default 'report'. 'stop' and 'enospc' can only be used
2237# if the block device supports io-status (see BlockInfo).
2238#
1d8bda12 2239# @on-target-error: the action to take on an error on the target,
df92562e
FZ
2240# default 'report' (no limitations, since this applies to
2241# a different block device than @device).
2242#
1d8bda12 2243# @filter-node-name: the node name that should be assigned to the
6cdbceb1
KW
2244# filter driver that the mirror job inserts into the graph
2245# above @device. If this option is not given, a node name is
2246# autogenerated. (Since: 2.9)
2247#
481debaa
HR
2248# @copy-mode: when to copy data to the destination; defaults to 'background'
2249# (Since: 3.0)
2250#
a6b58ade
JS
2251# @auto-finalize: When false, this job will wait in a PENDING state after it has
2252# finished its work, waiting for @block-job-finalize before
2253# making any block graph changes.
2254# When true, this job will automatically
2255# perform its abort or commit actions.
2256# Defaults to true. (Since 3.1)
2257#
2258# @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2259# has completely ceased all work, and awaits @block-job-dismiss.
2260# When true, this job will automatically disappear from the query
2261# list without user intervention.
2262# Defaults to true. (Since 3.1)
df92562e
FZ
2263# Returns: nothing on success.
2264#
5072f7b3 2265# Since: 2.6
f6235a25
MAL
2266#
2267# Example:
2268#
2269# -> { "execute": "blockdev-mirror",
2270# "arguments": { "device": "ide-hd0",
2271# "target": "target0",
2272# "sync": "full" } }
2273# <- { "return": {} }
2274#
df92562e
FZ
2275##
2276{ 'command': 'blockdev-mirror',
71aa9867 2277 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
df92562e
FZ
2278 '*replaces': 'str',
2279 'sync': 'MirrorSyncMode',
2280 '*speed': 'int', '*granularity': 'uint32',
2281 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
6cdbceb1 2282 '*on-target-error': 'BlockdevOnError',
481debaa 2283 '*filter-node-name': 'str',
a6b58ade
JS
2284 '*copy-mode': 'MirrorCopyMode',
2285 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
df92562e 2286
4dc9397b 2287##
5072f7b3 2288# @BlockIOThrottle:
4dc9397b
EB
2289#
2290# A set of parameters describing block throttling.
2291#
1d8bda12 2292# @device: Block device name (deprecated, use @id instead)
7a9877a0 2293#
1d8bda12 2294# @id: The name or QOM path of the guest device (since: 2.8)
1ad166b6
BC
2295#
2296# @bps: total throughput limit in bytes per second
2297#
2298# @bps_rd: read throughput limit in bytes per second
2299#
2300# @bps_wr: write throughput limit in bytes per second
2301#
2302# @iops: total I/O operations per second
2303#
f5a845fd 2304# @iops_rd: read I/O operations per second
1ad166b6
BC
2305#
2306# @iops_wr: write I/O operations per second
2307#
1d8bda12 2308# @bps_max: total throughput limit during bursts,
26ec4e53 2309# in bytes (Since 1.7)
1ad166b6 2310#
1d8bda12 2311# @bps_rd_max: read throughput limit during bursts,
26ec4e53 2312# in bytes (Since 1.7)
1ad166b6 2313#
1d8bda12 2314# @bps_wr_max: write throughput limit during bursts,
26ec4e53 2315# in bytes (Since 1.7)
1ad166b6 2316#
1d8bda12 2317# @iops_max: total I/O operations per second during bursts,
26ec4e53 2318# in bytes (Since 1.7)
1ad166b6 2319#
1d8bda12 2320# @iops_rd_max: read I/O operations per second during bursts,
26ec4e53 2321# in bytes (Since 1.7)
1ad166b6 2322#
1d8bda12 2323# @iops_wr_max: write I/O operations per second during bursts,
26ec4e53 2324# in bytes (Since 1.7)
dce13204 2325#
1d8bda12 2326# @bps_max_length: maximum length of the @bps_max burst
26ec4e53
PM
2327# period, in seconds. It must only
2328# be set if @bps_max is set as well.
2329# Defaults to 1. (Since 2.6)
dce13204 2330#
1d8bda12 2331# @bps_rd_max_length: maximum length of the @bps_rd_max
26ec4e53
PM
2332# burst period, in seconds. It must only
2333# be set if @bps_rd_max is set as well.
2334# Defaults to 1. (Since 2.6)
dce13204 2335#
1d8bda12 2336# @bps_wr_max_length: maximum length of the @bps_wr_max
26ec4e53
PM
2337# burst period, in seconds. It must only
2338# be set if @bps_wr_max is set as well.
2339# Defaults to 1. (Since 2.6)
dce13204 2340#
1d8bda12 2341# @iops_max_length: maximum length of the @iops burst
26ec4e53
PM
2342# period, in seconds. It must only
2343# be set if @iops_max is set as well.
2344# Defaults to 1. (Since 2.6)
dce13204 2345#
1d8bda12 2346# @iops_rd_max_length: maximum length of the @iops_rd_max
26ec4e53
PM
2347# burst period, in seconds. It must only
2348# be set if @iops_rd_max is set as well.
2349# Defaults to 1. (Since 2.6)
dce13204 2350#
1d8bda12 2351# @iops_wr_max_length: maximum length of the @iops_wr_max
26ec4e53
PM
2352# burst period, in seconds. It must only
2353# be set if @iops_wr_max is set as well.
2354# Defaults to 1. (Since 2.6)
1ad166b6 2355#
1d8bda12 2356# @iops_size: an I/O size in bytes (Since 1.7)
1ad166b6 2357#
1d8bda12 2358# @group: throttle group name (Since 2.4)
76f4afb4 2359#
1ad166b6
BC
2360# Since: 1.1
2361##
4dc9397b 2362{ 'struct': 'BlockIOThrottle',
7a9877a0
KW
2363 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2364 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
1ad166b6
BC
2365 '*bps_max': 'int', '*bps_rd_max': 'int',
2366 '*bps_wr_max': 'int', '*iops_max': 'int',
2367 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
dce13204
AG
2368 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2369 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2370 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
76f4afb4 2371 '*iops_size': 'int', '*group': 'str' } }
1ad166b6 2372
432d889e
MP
2373##
2374# @ThrottleLimits:
2375#
2376# Limit parameters for throttling.
2377# Since some limit combinations are illegal, limits should always be set in one
2378# transaction. All fields are optional. When setting limits, if a field is
2379# missing the current value is not changed.
2380#
26ec4e53
PM
2381# @iops-total: limit total I/O operations per second
2382# @iops-total-max: I/O operations burst
2383# @iops-total-max-length: length of the iops-total-max burst period, in seconds
2384# It must only be set if @iops-total-max is set as well.
2385# @iops-read: limit read operations per second
2386# @iops-read-max: I/O operations read burst
2387# @iops-read-max-length: length of the iops-read-max burst period, in seconds
2388# It must only be set if @iops-read-max is set as well.
2389# @iops-write: limit write operations per second
2390# @iops-write-max: I/O operations write burst
2391# @iops-write-max-length: length of the iops-write-max burst period, in seconds
2392# It must only be set if @iops-write-max is set as well.
2393# @bps-total: limit total bytes per second
2394# @bps-total-max: total bytes burst
2395# @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2396# It must only be set if @bps-total-max is set as well.
2397# @bps-read: limit read bytes per second
2398# @bps-read-max: total bytes read burst
2399# @bps-read-max-length: length of the bps-read-max burst period, in seconds
2400# It must only be set if @bps-read-max is set as well.
2401# @bps-write: limit write bytes per second
2402# @bps-write-max: total bytes write burst
2403# @bps-write-max-length: length of the bps-write-max burst period, in seconds
2404# It must only be set if @bps-write-max is set as well.
2405# @iops-size: when limiting by iops max size of an I/O in bytes
432d889e
MP
2406#
2407# Since: 2.11
2408##
2409{ 'struct': 'ThrottleLimits',
2410 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2411 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2412 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2413 '*iops-write' : 'int', '*iops-write-max' : 'int',
2414 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2415 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2416 '*bps-read' : 'int', '*bps-read-max' : 'int',
2417 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2418 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2419 '*iops-size' : 'int' } }
2420
1ad166b6
BC
2421##
2422# @block-stream:
2423#
2424# Copy data from a backing file into a block device.
2425#
2426# The block streaming operation is performed in the background until the entire
2427# backing file has been copied. This command returns immediately once streaming
2428# has started. The status of ongoing block streaming operations can be checked
2429# with query-block-jobs. The operation can be stopped before it has completed
2430# using the block-job-cancel command.
2431#
554b6147
AG
2432# The node that receives the data is called the top image, can be located in
2433# any part of the chain (but always above the base image; see below) and can be
2434# specified using its device or node name. Earlier qemu versions only allowed
2435# 'device' to name the top level node; presence of the 'base-node' parameter
2436# during introspection can be used as a witness of the enhanced semantics
2437# of 'device'.
2438#
1ad166b6
BC
2439# If a base file is specified then sectors are not copied from that base file and
2440# its backing chain. When streaming completes the image file will have the base
2441# file as its backing file. This can be used to stream a subset of the backing
2442# file chain instead of flattening the entire image.
2443#
2444# On successful completion the image file is updated to drop the backing file
2445# and the BLOCK_JOB_COMPLETED event is emitted.
2446#
1d8bda12 2447# @job-id: identifier for the newly-created block job. If
2323322e
AG
2448# omitted, the device name will be used. (Since 2.7)
2449#
554b6147 2450# @device: the device or node name of the top image
1ad166b6 2451#
26ec4e53
PM
2452# @base: the common backing file name.
2453# It cannot be set if @base-node is also set.
312fe09c 2454#
1d8bda12 2455# @base-node: the node name of the backing file.
26ec4e53 2456# It cannot be set if @base is also set. (Since 2.8)
1ad166b6 2457#
1d8bda12 2458# @backing-file: The backing file string to write into the top
26ec4e53 2459# image. This filename is not validated.
13d8cc51 2460#
26ec4e53
PM
2461# If a pathname string is such that it cannot be
2462# resolved by QEMU, that means that subsequent QMP or
2463# HMP commands must use node-names for the image in
2464# question, as filename lookup methods will fail.
13d8cc51 2465#
26ec4e53
PM
2466# If not specified, QEMU will automatically determine
2467# the backing file string to use, or error out if there
2468# is no obvious choice. Care should be taken when
2469# specifying the string, to specify a valid filename or
2470# protocol.
2471# (Since 2.1)
13d8cc51 2472#
26ec4e53 2473# @speed: the maximum speed, in bytes per second
1ad166b6 2474#
1d8bda12 2475# @on-error: the action to take on an error (default report).
1ad166b6
BC
2476# 'stop' and 'enospc' can only be used if the block device
2477# supports io-status (see BlockInfo). Since 1.3.
2478#
241ca1ab
JS
2479# @auto-finalize: When false, this job will wait in a PENDING state after it has
2480# finished its work, waiting for @block-job-finalize before
2481# making any block graph changes.
2482# When true, this job will automatically
2483# perform its abort or commit actions.
2484# Defaults to true. (Since 3.1)
2485#
2486# @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2487# has completely ceased all work, and awaits @block-job-dismiss.
2488# When true, this job will automatically disappear from the query
2489# list without user intervention.
2490# Defaults to true. (Since 3.1)
2491#
e050e426
PM
2492# Returns: - Nothing on success.
2493# - If @device does not exist, DeviceNotFound.
49b37c23 2494#
1ad166b6 2495# Since: 1.1
49b37c23
MAL
2496#
2497# Example:
2498#
2499# -> { "execute": "block-stream",
2500# "arguments": { "device": "virtio0",
2501# "base": "/tmp/master.qcow2" } }
2502# <- { "return": {} }
2503#
1ad166b6
BC
2504##
2505{ 'command': 'block-stream',
2323322e 2506 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
312fe09c 2507 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
241ca1ab
JS
2508 '*on-error': 'BlockdevOnError',
2509 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1ad166b6
BC
2510
2511##
2512# @block-job-set-speed:
2513#
2514# Set maximum speed for a background block operation.
2515#
2516# This command can only be issued when there is an active block job.
2517#
2518# Throttling can be disabled by setting the speed to 0.
2519#
6aae5be6
AG
2520# @device: The job identifier. This used to be a device name (hence
2521# the name of the parameter), but since QEMU 2.7 it can have
2522# other values.
1ad166b6 2523#
26ec4e53
PM
2524# @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2525# Defaults to 0.
1ad166b6 2526#
e050e426
PM
2527# Returns: - Nothing on success
2528# - If no background operation is active on this device, DeviceNotActive
1ad166b6
BC
2529#
2530# Since: 1.1
2531##
2532{ 'command': 'block-job-set-speed',
2533 'data': { 'device': 'str', 'speed': 'int' } }
2534
2535##
2536# @block-job-cancel:
2537#
2538# Stop an active background block operation.
2539#
2540# This command returns immediately after marking the active background block
2541# operation for cancellation. It is an error to call this command if no
2542# operation is in progress.
2543#
2544# The operation will cancel as soon as possible and then emit the
2545# BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2546# enumerated using query-block-jobs.
2547#
c117bb14
KC
2548# Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2549# (via the event BLOCK_JOB_READY) that the source and destination are
2550# synchronized, then the event triggered by this command changes to
2551# BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2552# destination now has a point-in-time copy tied to the time of the cancellation.
2553#
1ad166b6
BC
2554# For streaming, the image file retains its backing file unless the streaming
2555# operation happens to complete just as it is being cancelled. A new streaming
2556# operation can be started at a later time to finish copying all data from the
2557# backing file.
2558#
6aae5be6
AG
2559# @device: The job identifier. This used to be a device name (hence
2560# the name of the parameter), but since QEMU 2.7 it can have
2561# other values.
1ad166b6 2562#
b76e4458
LL
2563# @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2564# abandon the job immediately (even if it is paused) instead of waiting
2565# for the destination to complete its final synchronization (since 1.3)
1ad166b6 2566#
e050e426
PM
2567# Returns: - Nothing on success
2568# - If no background operation is active on this device, DeviceNotActive
1ad166b6
BC
2569#
2570# Since: 1.1
2571##
2572{ 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2573
2574##
2575# @block-job-pause:
2576#
2577# Pause an active background block operation.
2578#
2579# This command returns immediately after marking the active background block
2580# operation for pausing. It is an error to call this command if no
cd44d96b 2581# operation is in progress or if the job is already paused.
1ad166b6
BC
2582#
2583# The operation will pause as soon as possible. No event is emitted when
2584# the operation is actually paused. Cancelling a paused job automatically
2585# resumes it.
2586#
6aae5be6
AG
2587# @device: The job identifier. This used to be a device name (hence
2588# the name of the parameter), but since QEMU 2.7 it can have
2589# other values.
1ad166b6 2590#
e050e426
PM
2591# Returns: - Nothing on success
2592# - If no background operation is active on this device, DeviceNotActive
1ad166b6
BC
2593#
2594# Since: 1.3
2595##
2596{ 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2597
2598##
2599# @block-job-resume:
2600#
2601# Resume an active background block operation.
2602#
2603# This command returns immediately after resuming a paused background block
2604# operation. It is an error to call this command if no operation is in
cd44d96b 2605# progress or if the job is not paused.
1ad166b6
BC
2606#
2607# This command also clears the error status of the job.
2608#
6aae5be6
AG
2609# @device: The job identifier. This used to be a device name (hence
2610# the name of the parameter), but since QEMU 2.7 it can have
2611# other values.
1ad166b6 2612#
e050e426
PM
2613# Returns: - Nothing on success
2614# - If no background operation is active on this device, DeviceNotActive
1ad166b6
BC
2615#
2616# Since: 1.3
2617##
2618{ 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2619
2620##
2621# @block-job-complete:
2622#
2623# Manually trigger completion of an active background block operation. This
2624# is supported for drive mirroring, where it also switches the device to
2625# write to the target path only. The ability to complete is signaled with
2626# a BLOCK_JOB_READY event.
2627#
2628# This command completes an active background block operation synchronously.
2629# The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2630# is not defined. Note that if an I/O error occurs during the processing of
2631# this command: 1) the command itself will fail; 2) the error will be processed
2632# according to the rerror/werror arguments that were specified when starting
2633# the operation.
2634#
2635# A cancelled or paused job cannot be completed.
2636#
6aae5be6
AG
2637# @device: The job identifier. This used to be a device name (hence
2638# the name of the parameter), but since QEMU 2.7 it can have
2639# other values.
1ad166b6 2640#
e050e426
PM
2641# Returns: - Nothing on success
2642# - If no background operation is active on this device, DeviceNotActive
1ad166b6
BC
2643#
2644# Since: 1.3
2645##
2646{ 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2647
75f71059
JS
2648##
2649# @block-job-dismiss:
2650#
2651# For jobs that have already concluded, remove them from the block-job-query
2652# list. This command only needs to be run for jobs which were started with
2653# QEMU 2.12+ job lifetime management semantics.
2654#
2655# This command will refuse to operate on any job that has not yet reached
a50c2ab8 2656# its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
75f71059
JS
2657# BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2658# to be used as appropriate.
2659#
2660# @id: The job identifier.
2661#
2662# Returns: Nothing on success
2663#
2664# Since: 2.12
2665##
2666{ 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2667
11b61fbc
JS
2668##
2669# @block-job-finalize:
2670#
2671# Once a job that has manual=true reaches the pending state, it can be
2672# instructed to finalize any graph changes and do any necessary cleanup
2673# via this command.
2674# For jobs in a transaction, instructing one job to finalize will force
2675# ALL jobs in the transaction to finalize, so it is only necessary to instruct
2676# a single member job to finalize.
2677#
2678# @id: The job identifier.
2679#
2680# Returns: Nothing on success
2681#
2682# Since: 2.12
2683##
2684{ 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2685
1ad166b6 2686##
5072f7b3 2687# @BlockdevDiscardOptions:
1ad166b6
BC
2688#
2689# Determines how to handle discard requests.
2690#
26ec4e53
PM
2691# @ignore: Ignore the request
2692# @unmap: Forward as an unmap request
1ad166b6 2693#
79b7a77e 2694# Since: 2.9
1ad166b6
BC
2695##
2696{ 'enum': 'BlockdevDiscardOptions',
2697 'data': [ 'ignore', 'unmap' ] }
2698
2699##
5072f7b3 2700# @BlockdevDetectZeroesOptions:
1ad166b6
BC
2701#
2702# Describes the operation mode for the automatic conversion of plain
2703# zero writes by the OS to driver specific optimized zero write commands.
2704#
26ec4e53
PM
2705# @off: Disabled (default)
2706# @on: Enabled
2707# @unmap: Enabled and even try to unmap blocks if possible. This requires
2708# also that @BlockdevDiscardOptions is set to unmap for this device.
1ad166b6
BC
2709#
2710# Since: 2.1
2711##
2712{ 'enum': 'BlockdevDetectZeroesOptions',
2713 'data': [ 'off', 'on', 'unmap' ] }
2714
2715##
5072f7b3 2716# @BlockdevAioOptions:
1ad166b6
BC
2717#
2718# Selects the AIO backend to handle I/O requests
2719#
26ec4e53
PM
2720# @threads: Use qemu's thread pool
2721# @native: Use native AIO backend (only Linux and Windows)
2722# @io_uring: Use linux io_uring (since 5.0)
1ad166b6 2723#
79b7a77e 2724# Since: 2.9
1ad166b6
BC
2725##
2726{ 'enum': 'BlockdevAioOptions',
f14beaec
AM
2727 'data': [ 'threads', 'native',
2728 { 'name': 'io_uring', 'if': 'defined(CONFIG_LINUX_IO_URING)' } ] }
1ad166b6
BC
2729
2730##
5072f7b3 2731# @BlockdevCacheOptions:
1ad166b6
BC
2732#
2733# Includes cache-related options for block devices
2734#
26ec4e53
PM
2735# @direct: enables use of O_DIRECT (bypass the host page cache;
2736# default: false)
2737# @no-flush: ignore any flush requests for the device (default:
2738# false)
1ad166b6 2739#
79b7a77e 2740# Since: 2.9
1ad166b6 2741##
895a2a80 2742{ 'struct': 'BlockdevCacheOptions',
aaa436f9 2743 'data': { '*direct': 'bool',
1ad166b6
BC
2744 '*no-flush': 'bool' } }
2745
2746##
5072f7b3 2747# @BlockdevDriver:
1ad166b6
BC
2748#
2749# Drivers that are supported in block device operations.
2750#
da92c3ff 2751# @vxhs: Since 2.10
d8e7d87e 2752# @throttle: Since 2.11
d87ee3d7 2753# @nvme: Since 2.12
51f63ec7 2754# @copy-on-read: Since 3.0
bfcc224e 2755# @blklogwrites: Since 3.0
35e32d9e 2756# @blkreplay: Since 4.2
f41388e0 2757# @compress: Since 5.0
da92c3ff 2758#
79b7a77e 2759# Since: 2.9
1ad166b6
BC
2760##
2761{ 'enum': 'BlockdevDriver',
35e32d9e 2762 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
f41388e0
AS
2763 'cloop', 'compress', 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps',
2764 'gluster', 'host_cdrom', 'host_device', 'http', 'https', 'iscsi',
2765 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
2766 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
335d10cd
MAL
2767 { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
2768 'sheepdog',
bfcc224e 2769 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
1ad166b6 2770
1ad166b6 2771##
5072f7b3 2772# @BlockdevOptionsFile:
1ad166b6 2773#
68555285 2774# Driver specific block device options for the file backend.
1ad166b6 2775#
26ec4e53
PM
2776# @filename: path to the image file
2777# @pr-manager: the id for the object that will handle persistent reservations
2778# for this device (default: none, forward the commands via SG_IO;
2779# since 2.11)
2780# @aio: AIO backend (default: threads) (since: 2.8)
2781# @locking: whether to enable file locking. If set to 'auto', only enable
2782# when Open File Descriptor (OFD) locking API is available
2783# (default: auto, since 2.10)
2784# @drop-cache: invalidate page cache during live migration. This prevents
2785# stale data on the migration destination with cache.direct=off.
2786# Currently only supported on Linux hosts.
2787# (default: on, since: 4.0)
31be8a2a
SH
2788# @x-check-cache-dropped: whether to check that page cache was dropped on live
2789# migration. May cause noticeable delays if the image
2790# file is large, do not use in production.
51f63ec7 2791# (default: off) (since: 3.0)
1ad166b6 2792#
c9d40709
KW
2793# Features:
2794# @dynamic-auto-read-only: If present, enabled auto-read-only means that the
2795# driver will open the image read-only at first,
2796# dynamically reopen the image file read-write when
2797# the first writer is attached to the node and reopen
2798# read-only when the last writer is detached. This
2799# allows giving QEMU write permissions only on demand
2800# when an operation actually needs write access.
2801#
79b7a77e 2802# Since: 2.9
1ad166b6 2803##
895a2a80 2804{ 'struct': 'BlockdevOptionsFile',
0a4279d9 2805 'data': { 'filename': 'str',
7c9e5276 2806 '*pr-manager': 'str',
16b48d5d 2807 '*locking': 'OnOffAuto',
31be8a2a 2808 '*aio': 'BlockdevAioOptions',
dbb28bc8
PM
2809 '*drop-cache': {'type': 'bool',
2810 'if': 'defined(CONFIG_LINUX)'},
c9d40709
KW
2811 '*x-check-cache-dropped': 'bool' },
2812 'features': [ { 'name': 'dynamic-auto-read-only',
2813 'if': 'defined(CONFIG_POSIX)' } ] }
1ad166b6 2814
e819ab22 2815##
5072f7b3 2816# @BlockdevOptionsNull:
e819ab22
FZ
2817#
2818# Driver specific block device options for the null backend.
2819#
26ec4e53 2820# @size: size of the device in bytes.
1d8bda12 2821# @latency-ns: emulated latency (in nanoseconds) in processing
e5e51dd3
FZ
2822# requests. Default to zero which completes requests immediately.
2823# (Since 2.4)
128b05f7
KW
2824# @read-zeroes: if true, reads from the device produce zeroes; if false, the
2825# buffer is left unchanged. (default: false; since: 4.1)
e819ab22 2826#
79b7a77e 2827# Since: 2.9
e819ab22 2828##
895a2a80 2829{ 'struct': 'BlockdevOptionsNull',
128b05f7 2830 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
e819ab22 2831
d87ee3d7
FZ
2832##
2833# @BlockdevOptionsNVMe:
2834#
2835# Driver specific block device options for the NVMe backend.
2836#
26ec4e53
PM
2837# @device: PCI controller address of the NVMe device in
2838# format hhhh:bb:ss.f (host:bus:slot.function)
d87ee3d7
FZ
2839# @namespace: namespace number of the device, starting from 1.
2840#
ecaf647f
DB
2841# Note that the PCI @device must have been unbound from any host
2842# kernel driver before instructing QEMU to add the blockdev.
2843#
d87ee3d7
FZ
2844# Since: 2.12
2845##
2846{ 'struct': 'BlockdevOptionsNVMe',
2847 'data': { 'device': 'str', 'namespace': 'int' } }
2848
1ad166b6 2849##
5072f7b3 2850# @BlockdevOptionsVVFAT:
1ad166b6
BC
2851#
2852# Driver specific block device options for the vvfat protocol.
2853#
26ec4e53
PM
2854# @dir: directory to be exported as FAT image
2855# @fat-type: FAT type: 12, 16 or 32
2856# @floppy: whether to export a floppy image (true) or
2857# partitioned hard disk (false; default)
2858# @label: set the volume label, limited to 11 bytes. FAT16 and
2859# FAT32 traditionally have some restrictions on labels, which are
2860# ignored by most operating systems. Defaults to "QEMU VVFAT".
2861# (since 2.4)
2862# @rw: whether to allow write operations (default: false)
1ad166b6 2863#
79b7a77e 2864# Since: 2.9
1ad166b6 2865##
895a2a80 2866{ 'struct': 'BlockdevOptionsVVFAT',
1ad166b6 2867 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
d5941dda 2868 '*label': 'str', '*rw': 'bool' } }
1ad166b6
BC
2869
2870##
5072f7b3 2871# @BlockdevOptionsGenericFormat:
1ad166b6
BC
2872#
2873# Driver specific block device options for image format that have no option
2874# besides their data source.
2875#
26ec4e53 2876# @file: reference to or definition of the data source block device
1ad166b6 2877#
79b7a77e 2878# Since: 2.9
1ad166b6 2879##
895a2a80 2880{ 'struct': 'BlockdevOptionsGenericFormat',
1ad166b6
BC
2881 'data': { 'file': 'BlockdevRef' } }
2882
78368575 2883##
5072f7b3 2884# @BlockdevOptionsLUKS:
78368575
DB
2885#
2886# Driver specific block device options for LUKS.
2887#
1d8bda12 2888# @key-secret: the ID of a QCryptoSecret object providing
78368575
DB
2889# the decryption key (since 2.6). Mandatory except when
2890# doing a metadata-only probe of the image.
2891#
79b7a77e 2892# Since: 2.9
78368575
DB
2893##
2894{ 'struct': 'BlockdevOptionsLUKS',
2895 'base': 'BlockdevOptionsGenericFormat',
2896 'data': { '*key-secret': 'str' } }
2897
2898
1ad166b6 2899##
5072f7b3 2900# @BlockdevOptionsGenericCOWFormat:
1ad166b6
BC
2901#
2902# Driver specific block device options for image format that have no option
2903# besides their data source and an optional backing file.
2904#
26ec4e53
PM
2905# @backing: reference to or definition of the backing file block
2906# device, null disables the backing file entirely.
2907# Defaults to the backing file stored the image file.
1ad166b6 2908#
79b7a77e 2909# Since: 2.9
1ad166b6 2910##
895a2a80 2911{ 'struct': 'BlockdevOptionsGenericCOWFormat',
1ad166b6 2912 'base': 'BlockdevOptionsGenericFormat',
c42e8742 2913 'data': { '*backing': 'BlockdevRefOrNull' } }
1ad166b6 2914
f6585811 2915##
5072f7b3 2916# @Qcow2OverlapCheckMode:
f6585811
HR
2917#
2918# General overlap check modes.
2919#
26ec4e53 2920# @none: Do not perform any checks
f6585811 2921#
26ec4e53
PM
2922# @constant: Perform only checks which can be done in constant time and
2923# without reading anything from disk
f6585811 2924#
26ec4e53
PM
2925# @cached: Perform only checks which can be done without reading anything
2926# from disk
f6585811 2927#
26ec4e53 2928# @all: Perform all available overlap checks
f6585811 2929#
79b7a77e 2930# Since: 2.9
f6585811
HR
2931##
2932{ 'enum': 'Qcow2OverlapCheckMode',
2933 'data': [ 'none', 'constant', 'cached', 'all' ] }
2934
2935##
5072f7b3 2936# @Qcow2OverlapCheckFlags:
f6585811
HR
2937#
2938# Structure of flags for each metadata structure. Setting a field to 'true'
2939# makes qemu guard that structure against unintended overwriting. The default
2940# value is chosen according to the template given.
2941#
2942# @template: Specifies a template mode which can be adjusted using the other
2943# flags, defaults to 'cached'
2944#
0e4e4318
VSO
2945# @bitmap-directory: since 3.0
2946#
79b7a77e 2947# Since: 2.9
f6585811 2948##
895a2a80 2949{ 'struct': 'Qcow2OverlapCheckFlags',
0e4e4318
VSO
2950 'data': { '*template': 'Qcow2OverlapCheckMode',
2951 '*main-header': 'bool',
2952 '*active-l1': 'bool',
2953 '*active-l2': 'bool',
2954 '*refcount-table': 'bool',
2955 '*refcount-block': 'bool',
2956 '*snapshot-table': 'bool',
2957 '*inactive-l1': 'bool',
2958 '*inactive-l2': 'bool',
2959 '*bitmap-directory': 'bool' } }
f6585811
HR
2960
2961##
5072f7b3 2962# @Qcow2OverlapChecks:
f6585811
HR
2963#
2964# Specifies which metadata structures should be guarded against unintended
2965# overwriting.
2966#
26ec4e53
PM
2967# @flags: set of flags for separate specification of each metadata structure
2968# type
f6585811 2969#
26ec4e53 2970# @mode: named mode which chooses a specific set of flags
f6585811 2971#
79b7a77e 2972# Since: 2.9
f6585811 2973##
ab916fad 2974{ 'alternate': 'Qcow2OverlapChecks',
f6585811
HR
2975 'data': { 'flags': 'Qcow2OverlapCheckFlags',
2976 'mode': 'Qcow2OverlapCheckMode' } }
2977
d85f4222
DB
2978##
2979# @BlockdevQcowEncryptionFormat:
2980#
2981# @aes: AES-CBC with plain64 initialization vectors
2982#
2983# Since: 2.10
2984##
2985{ 'enum': 'BlockdevQcowEncryptionFormat',
2986 'data': [ 'aes' ] }
2987
2988##
2989# @BlockdevQcowEncryption:
2990#
2991# Since: 2.10
2992##
2993{ 'union': 'BlockdevQcowEncryption',
2994 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
2995 'discriminator': 'format',
2996 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
2997
2998##
2999# @BlockdevOptionsQcow:
3000#
3001# Driver specific block device options for qcow.
3002#
26ec4e53
PM
3003# @encrypt: Image decryption options. Mandatory for
3004# encrypted images, except when doing a metadata-only
3005# probe of the image.
d85f4222
DB
3006#
3007# Since: 2.10
3008##
3009{ 'struct': 'BlockdevOptionsQcow',
3010 'base': 'BlockdevOptionsGenericCOWFormat',
3011 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3012
3013
b25b387f
DB
3014
3015##
3016# @BlockdevQcow2EncryptionFormat:
58823a0b 3017# @aes: AES-CBC with plain64 initialization vectors
b25b387f
DB
3018#
3019# Since: 2.10
3020##
3021{ 'enum': 'BlockdevQcow2EncryptionFormat',
4652b8f3 3022 'data': [ 'aes', 'luks' ] }
b25b387f
DB
3023
3024##
3025# @BlockdevQcow2Encryption:
3026#
3027# Since: 2.10
3028##
3029{ 'union': 'BlockdevQcow2Encryption',
3030 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3031 'discriminator': 'format',
4652b8f3
DB
3032 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3033 'luks': 'QCryptoBlockOptionsLUKS'} }
b25b387f 3034
1ad166b6 3035##
5072f7b3 3036# @BlockdevOptionsQcow2:
1ad166b6
BC
3037#
3038# Driver specific block device options for qcow2.
3039#
26ec4e53
PM
3040# @lazy-refcounts: whether to enable the lazy refcounts
3041# feature (default is taken from the image file)
1ad166b6 3042#
26ec4e53
PM
3043# @pass-discard-request: whether discard requests to the qcow2
3044# device should be forwarded to the data source
1ad166b6 3045#
1d8bda12 3046# @pass-discard-snapshot: whether discard requests for the data source
1ad166b6
BC
3047# should be issued when a snapshot operation (e.g.
3048# deleting a snapshot) frees clusters in the qcow2 file
3049#
26ec4e53
PM
3050# @pass-discard-other: whether discard requests for the data source
3051# should be issued on other occasions where a cluster
3052# gets freed
1ad166b6 3053#
26ec4e53
PM
3054# @overlap-check: which overlap checks to perform for writes
3055# to the image, defaults to 'cached' (since 2.2)
f6585811 3056#
26ec4e53
PM
3057# @cache-size: the maximum total size of the L2 table and
3058# refcount block caches in bytes (since 2.2)
f6585811 3059#
26ec4e53
PM
3060# @l2-cache-size: the maximum size of the L2 table cache in
3061# bytes (since 2.2)
f6585811 3062#
26ec4e53
PM
3063# @l2-cache-entry-size: the size of each entry in the L2 cache in
3064# bytes. It must be a power of two between 512
3065# and the cluster size. The default value is
3066# the cluster size (since 2.12)
1221fe6f 3067#
26ec4e53
PM
3068# @refcount-cache-size: the maximum size of the refcount block cache
3069# in bytes (since 2.2)
f6585811 3070#
26ec4e53
PM
3071# @cache-clean-interval: clean unused entries in the L2 and refcount
3072# caches. The interval is in seconds. The default value
3073# is 600 on supporting platforms, and 0 on other
3074# platforms. 0 disables this feature. (since 2.5)
e957b50b 3075#
26ec4e53
PM
3076# @encrypt: Image decryption options. Mandatory for
3077# encrypted images, except when doing a metadata-only
3078# probe of the image. (since 2.10)
279621c0 3079#
26ec4e53
PM
3080# @data-file: reference to or definition of the external data file.
3081# This may only be specified for images that require an
3082# external data file. If it is not specified for such
3083# an image, the data file name is loaded from the image
3084# file. (since 4.0)
0e8c08be 3085#
79b7a77e 3086# Since: 2.9
1ad166b6 3087##
895a2a80 3088{ 'struct': 'BlockdevOptionsQcow2',
1ad166b6
BC
3089 'base': 'BlockdevOptionsGenericCOWFormat',
3090 'data': { '*lazy-refcounts': 'bool',
3091 '*pass-discard-request': 'bool',
3092 '*pass-discard-snapshot': 'bool',
f6585811
HR
3093 '*pass-discard-other': 'bool',
3094 '*overlap-check': 'Qcow2OverlapChecks',
3095 '*cache-size': 'int',
3096 '*l2-cache-size': 'int',
1221fe6f 3097 '*l2-cache-entry-size': 'int',
279621c0 3098 '*refcount-cache-size': 'int',
b25b387f 3099 '*cache-clean-interval': 'int',
0e8c08be
KW
3100 '*encrypt': 'BlockdevQcow2Encryption',
3101 '*data-file': 'BlockdevRef' } }
b1de5f43 3102
ec2f5418
KW
3103##
3104# @SshHostKeyCheckMode:
3105#
f5627506
PM
3106# @none: Don't check the host key at all
3107# @hash: Compare the host key with a given hash
3108# @known_hosts: Check the host key against the known_hosts file
ec2f5418
KW
3109#
3110# Since: 2.12
3111##
3112{ 'enum': 'SshHostKeyCheckMode',
3113 'data': [ 'none', 'hash', 'known_hosts' ] }
3114
3115##
3116# @SshHostKeyCheckHashType:
3117#
f5627506
PM
3118# @md5: The given hash is an md5 hash
3119# @sha1: The given hash is an sha1 hash
ec2f5418
KW
3120#
3121# Since: 2.12
3122##
3123{ 'enum': 'SshHostKeyCheckHashType',
3124 'data': [ 'md5', 'sha1' ] }
3125
3126##
3127# @SshHostKeyHash:
3128#
f5627506
PM
3129# @type: The hash algorithm used for the hash
3130# @hash: The expected hash value
ec2f5418
KW
3131#
3132# Since: 2.12
3133##
3134{ 'struct': 'SshHostKeyHash',
3135 'data': { 'type': 'SshHostKeyCheckHashType',
3136 'hash': 'str' }}
3137
ec2f5418
KW
3138##
3139# @SshHostKeyCheck:
3140#
3141# Since: 2.12
3142##
3143{ 'union': 'SshHostKeyCheck',
3144 'base': { 'mode': 'SshHostKeyCheckMode' },
3145 'discriminator': 'mode',
29cd0403 3146 'data': { 'hash': 'SshHostKeyHash' } }
ec2f5418 3147
ad0e90a6 3148##
5072f7b3 3149# @BlockdevOptionsSsh:
ad0e90a6
AA
3150#
3151# @server: host address
3152#
3153# @path: path to the image on the host
3154#
1d8bda12 3155# @user: user as which to connect, defaults to current
ad0e90a6
AA
3156# local user name
3157#
ec2f5418
KW
3158# @host-key-check: Defines how and what to check the host key against
3159# (default: known_hosts)
ad0e90a6 3160#
79b7a77e 3161# Since: 2.9
ad0e90a6
AA
3162##
3163{ 'struct': 'BlockdevOptionsSsh',
3164 'data': { 'server': 'InetSocketAddress',
3165 'path': 'str',
ec2f5418
KW
3166 '*user': 'str',
3167 '*host-key-check': 'SshHostKeyCheck' } }
ad0e90a6 3168
b1de5f43 3169
1ad166b6 3170##
5072f7b3 3171# @BlkdebugEvent:
1ad166b6
BC
3172#
3173# Trigger events supported by blkdebug.
a31939e6 3174#
26ec4e53
PM
3175# @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3176# (since 2.11)
46b732cd
PB
3177#
3178# @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3179#
d855ebcd
EB
3180# @cor_write: a write due to copy-on-read (since 2.11)
3181#
c8bb23cb
AN
3182# @cluster_alloc_space: an allocation of file space for a cluster (since 4.1)
3183#
f8cec157
HR
3184# @none: triggers once at creation of the blkdebug node (since 4.1)
3185#
79b7a77e 3186# Since: 2.9
1ad166b6 3187##
a31939e6 3188{ 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
5be5b776
EB
3189 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3190 'l1_grow_activate_table', 'l2_load', 'l2_update',
3191 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
1ad166b6
BC
3192 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3193 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3194 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3195 'refblock_load', 'refblock_update', 'refblock_update_part',
5be5b776
EB
3196 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3197 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3198 'refblock_alloc_switch_table', 'cluster_alloc',
1ad166b6 3199 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
5be5b776
EB
3200 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3201 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
46b732cd 3202 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
d855ebcd 3203 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
f8cec157 3204 'cor_write', 'cluster_alloc_space', 'none'] }
1ad166b6 3205
16789db3
HR
3206##
3207# @BlkdebugIOType:
3208#
3209# Kinds of I/O that blkdebug can inject errors in.
3210#
3211# @read: .bdrv_co_preadv()
3212#
3213# @write: .bdrv_co_pwritev()
3214#
3215# @write-zeroes: .bdrv_co_pwrite_zeroes()
3216#
3217# @discard: .bdrv_co_pdiscard()
3218#
3219# @flush: .bdrv_co_flush_to_disk()
3220#
1adb0b5e
HR
3221# @block-status: .bdrv_co_block_status()
3222#
16789db3
HR
3223# Since: 4.1
3224##
3225{ 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
1adb0b5e
HR
3226 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3227 'block-status' ] }
16789db3 3228
1ad166b6 3229##
5072f7b3 3230# @BlkdebugInjectErrorOptions:
1ad166b6
BC
3231#
3232# Describes a single error injection for blkdebug.
3233#
26ec4e53 3234# @event: trigger event
1ad166b6 3235#
26ec4e53
PM
3236# @state: the state identifier blkdebug needs to be in to
3237# actually trigger the event; defaults to "any"
1ad166b6 3238#
26ec4e53
PM
3239# @iotype: the type of I/O operations on which this error should
3240# be injected; defaults to "all read, write,
3241# write-zeroes, discard, and flush operations"
3242# (since: 4.1)
16789db3 3243#
26ec4e53
PM
3244# @errno: error identifier (errno) to be returned; defaults to
3245# EIO
1ad166b6 3246#
26ec4e53
PM
3247# @sector: specifies the sector index which has to be affected
3248# in order to actually trigger the event; defaults to "any
3249# sector"
1ad166b6 3250#
26ec4e53
PM
3251# @once: disables further events after this one has been
3252# triggered; defaults to false
1ad166b6 3253#
1d8bda12 3254# @immediately: fail immediately; defaults to false
1ad166b6 3255#
79b7a77e 3256# Since: 2.9
1ad166b6 3257##
895a2a80 3258{ 'struct': 'BlkdebugInjectErrorOptions',
1ad166b6
BC
3259 'data': { 'event': 'BlkdebugEvent',
3260 '*state': 'int',
16789db3 3261 '*iotype': 'BlkdebugIOType',
1ad166b6
BC
3262 '*errno': 'int',
3263 '*sector': 'int',
3264 '*once': 'bool',
3265 '*immediately': 'bool' } }
3266
3267##
5072f7b3 3268# @BlkdebugSetStateOptions:
1ad166b6
BC
3269#
3270# Describes a single state-change event for blkdebug.
3271#
26ec4e53 3272# @event: trigger event
1ad166b6 3273#
26ec4e53
PM
3274# @state: the current state identifier blkdebug needs to be in;
3275# defaults to "any"
1ad166b6 3276#
26ec4e53
PM
3277# @new_state: the state identifier blkdebug is supposed to assume if
3278# this event is triggered
1ad166b6 3279#
79b7a77e 3280# Since: 2.9
1ad166b6 3281##
895a2a80 3282{ 'struct': 'BlkdebugSetStateOptions',
1ad166b6
BC
3283 'data': { 'event': 'BlkdebugEvent',
3284 '*state': 'int',
3285 'new_state': 'int' } }
3286
3287##
5072f7b3 3288# @BlockdevOptionsBlkdebug:
1ad166b6
BC
3289#
3290# Driver specific block device options for blkdebug.
3291#
26ec4e53 3292# @image: underlying raw block device (or image file)
1ad166b6 3293#
26ec4e53 3294# @config: filename of the configuration file
1ad166b6 3295#
26ec4e53
PM
3296# @align: required alignment for requests in bytes, must be
3297# positive power of 2, or 0 for default
430b26a8 3298#
26ec4e53
PM
3299# @max-transfer: maximum size for I/O transfers in bytes, must be
3300# positive multiple of @align and of the underlying
3301# file's request alignment (but need not be a power of
3302# 2), or 0 for default (since 2.10)
430b26a8 3303#
26ec4e53
PM
3304# @opt-write-zero: preferred alignment for write zero requests in bytes,
3305# must be positive multiple of @align and of the
3306# underlying file's request alignment (but need not be a
3307# power of 2), or 0 for default (since 2.10)
430b26a8 3308#
26ec4e53
PM
3309# @max-write-zero: maximum size for write zero requests in bytes, must be
3310# positive multiple of @align, of @opt-write-zero, and of
3311# the underlying file's request alignment (but need not
3312# be a power of 2), or 0 for default (since 2.10)
430b26a8 3313#
26ec4e53
PM
3314# @opt-discard: preferred alignment for discard requests in bytes, must
3315# be positive multiple of @align and of the underlying
3316# file's request alignment (but need not be a power of
3317# 2), or 0 for default (since 2.10)
430b26a8 3318#
26ec4e53
PM
3319# @max-discard: maximum size for discard requests in bytes, must be
3320# positive multiple of @align, of @opt-discard, and of
3321# the underlying file's request alignment (but need not
3322# be a power of 2), or 0 for default (since 2.10)
1ad166b6 3323#
26ec4e53 3324# @inject-error: array of error injection descriptions
1ad166b6 3325#
26ec4e53 3326# @set-state: array of state-change descriptions
1ad166b6 3327#
69c6449f
HR
3328# @take-child-perms: Permissions to take on @image in addition to what
3329# is necessary anyway (which depends on how the
3330# blkdebug node is used). Defaults to none.
3331# (since 5.0)
3332#
3333# @unshare-child-perms: Permissions not to share on @image in addition
3334# to what cannot be shared anyway (which depends
3335# on how the blkdebug node is used). Defaults
3336# to none. (since 5.0)
3337#
79b7a77e 3338# Since: 2.9
1ad166b6 3339##
895a2a80 3340{ 'struct': 'BlockdevOptionsBlkdebug',
1ad166b6
BC
3341 'data': { 'image': 'BlockdevRef',
3342 '*config': 'str',
430b26a8
EB
3343 '*align': 'int', '*max-transfer': 'int32',
3344 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3345 '*opt-discard': 'int32', '*max-discard': 'int32',
1ad166b6 3346 '*inject-error': ['BlkdebugInjectErrorOptions'],
69c6449f
HR
3347 '*set-state': ['BlkdebugSetStateOptions'],
3348 '*take-child-perms': ['BlockPermission'],
3349 '*unshare-child-perms': ['BlockPermission'] } }
1ad166b6 3350
bfcc224e
AV
3351##
3352# @BlockdevOptionsBlklogwrites:
3353#
3354# Driver specific block device options for blklogwrites.
3355#
26ec4e53 3356# @file: block device
bfcc224e 3357#
26ec4e53 3358# @log: block device used to log writes to @file
bfcc224e
AV
3359#
3360# @log-sector-size: sector size used in logging writes to @file, determines
3361# granularity of offsets and sizes of writes (default: 512)
3362#
26ec4e53 3363# @log-append: append to an existing log (default: false)
7769eaa5 3364#
1dce698e
AS
3365# @log-super-update-interval: interval of write requests after which the log
3366# super block is updated to disk (default: 4096)
3367#
bfcc224e
AV
3368# Since: 3.0
3369##
3370{ 'struct': 'BlockdevOptionsBlklogwrites',
3371 'data': { 'file': 'BlockdevRef',
3372 'log': 'BlockdevRef',
0878b3c1 3373 '*log-sector-size': 'uint32',
1dce698e
AS
3374 '*log-append': 'bool',
3375 '*log-super-update-interval': 'uint64' } }
bfcc224e 3376
1ad166b6 3377##
5072f7b3 3378# @BlockdevOptionsBlkverify:
1ad166b6
BC
3379#
3380# Driver specific block device options for blkverify.
3381#
26ec4e53 3382# @test: block device to be tested
1ad166b6 3383#
26ec4e53 3384# @raw: raw image used for verification
1ad166b6 3385#
79b7a77e 3386# Since: 2.9
1ad166b6 3387##
895a2a80 3388{ 'struct': 'BlockdevOptionsBlkverify',
1ad166b6
BC
3389 'data': { 'test': 'BlockdevRef',
3390 'raw': 'BlockdevRef' } }
3391
35e32d9e
PD
3392##
3393# @BlockdevOptionsBlkreplay:
3394#
3395# Driver specific block device options for blkreplay.
3396#
26ec4e53 3397# @image: disk image which should be controlled with blkreplay
35e32d9e
PD
3398#
3399# Since: 4.2
3400##
3401{ 'struct': 'BlockdevOptionsBlkreplay',
3402 'data': { 'image': 'BlockdevRef' } }
3403
62c6031f 3404##
5072f7b3 3405# @QuorumReadPattern:
62c6031f
LY
3406#
3407# An enumeration of quorum read patterns.
3408#
3409# @quorum: read all the children and do a quorum vote on reads
3410#
3411# @fifo: read only from the first child that has not failed
3412#
79b7a77e 3413# Since: 2.9
62c6031f
LY
3414##
3415{ 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3416
1ad166b6 3417##
5072f7b3 3418# @BlockdevOptionsQuorum:
1ad166b6
BC
3419#
3420# Driver specific block device options for Quorum
3421#
26ec4e53 3422# @blkverify: true if the driver must print content mismatch
1ad166b6
BC
3423# set to false by default
3424#
26ec4e53 3425# @children: the children block devices to use
1ad166b6
BC
3426#
3427# @vote-threshold: the vote limit under which a read will fail
3428#
1d8bda12 3429# @rewrite-corrupted: rewrite corrupted data when quorum is reached
cf29a570
BC
3430# (Since 2.1)
3431#
1d8bda12 3432# @read-pattern: choose read pattern and set to quorum by default
62c6031f
LY
3433# (Since 2.2)
3434#
79b7a77e 3435# Since: 2.9
1ad166b6 3436##
895a2a80 3437{ 'struct': 'BlockdevOptionsQuorum',
1ad166b6
BC
3438 'data': { '*blkverify': 'bool',
3439 'children': [ 'BlockdevRef' ],
62c6031f
LY
3440 'vote-threshold': 'int',
3441 '*rewrite-corrupted': 'bool',
3442 '*read-pattern': 'QuorumReadPattern' } }
1ad166b6 3443
7edac2dd 3444##
5072f7b3 3445# @BlockdevOptionsGluster:
7edac2dd
PKK
3446#
3447# Driver specific block device options for Gluster
3448#
26ec4e53 3449# @volume: name of gluster volume where VM image resides
7edac2dd 3450#
26ec4e53 3451# @path: absolute path to image file in gluster volume
7edac2dd 3452#
26ec4e53 3453# @server: gluster servers description
7edac2dd 3454#
26ec4e53
PM
3455# @debug: libgfapi log level (default '4' which is Error)
3456# (Since 2.8)
7edac2dd 3457#
26ec4e53 3458# @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
e9db8ff3 3459#
79b7a77e 3460# Since: 2.9
7edac2dd
PKK
3461##
3462{ 'struct': 'BlockdevOptionsGluster',
3463 'data': { 'volume': 'str',
3464 'path': 'str',
62cf396b 3465 'server': ['SocketAddress'],
1a417e46 3466 '*debug': 'int',
e9db8ff3 3467 '*logfile': 'str' } }
7edac2dd 3468
31eb1202
KW
3469##
3470# @IscsiTransport:
3471#
3472# An enumeration of libiscsi transport types
3473#
3474# Since: 2.9
3475##
3476{ 'enum': 'IscsiTransport',
3477 'data': [ 'tcp', 'iser' ] }
3478
3479##
3480# @IscsiHeaderDigest:
3481#
3482# An enumeration of header digests supported by libiscsi
3483#
3484# Since: 2.9
3485##
3486{ 'enum': 'IscsiHeaderDigest',
3487 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3488 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3489
3490##
3491# @BlockdevOptionsIscsi:
3492#
26ec4e53 3493# @transport: The iscsi transport type
31eb1202 3494#
26ec4e53 3495# @portal: The address of the iscsi portal
31eb1202 3496#
26ec4e53 3497# @target: The target iqn name
31eb1202 3498#
26ec4e53 3499# @lun: LUN to connect to. Defaults to 0.
31eb1202 3500#
26ec4e53
PM
3501# @user: User name to log in with. If omitted, no CHAP
3502# authentication is performed.
31eb1202 3503#
1d8bda12 3504# @password-secret: The ID of a QCryptoSecret object providing
31eb1202
KW
3505# the password for the login. This option is required if
3506# @user is specified.
3507#
26ec4e53
PM
3508# @initiator-name: The iqn name we want to identify to the target
3509# as. If this option is not specified, an initiator name is
3510# generated automatically.
31eb1202 3511#
26ec4e53
PM
3512# @header-digest: The desired header digest. Defaults to
3513# none-crc32c.
31eb1202 3514#
26ec4e53
PM
3515# @timeout: Timeout in seconds after which a request will
3516# timeout. 0 means no timeout and is the default.
31eb1202
KW
3517#
3518# Driver specific block device options for iscsi
3519#
3520# Since: 2.9
3521##
3522{ 'struct': 'BlockdevOptionsIscsi',
3523 'data': { 'transport': 'IscsiTransport',
3524 'portal': 'str',
3525 'target': 'str',
3526 '*lun': 'int',
3527 '*user': 'str',
3528 '*password-secret': 'str',
3529 '*initiator-name': 'str',
3530 '*header-digest': 'IscsiHeaderDigest',
3531 '*timeout': 'int' } }
3532
0a55679b 3533
a3699de4
MA
3534##
3535# @RbdAuthMode:
3536#
3537# Since: 3.0
3538##
3539{ 'enum': 'RbdAuthMode',
3540 'data': [ 'cephx', 'none' ] }
3541
8a47e8eb
JC
3542##
3543# @BlockdevOptionsRbd:
3544#
26ec4e53 3545# @pool: Ceph pool name.
8a47e8eb 3546#
19ae9ae0
FF
3547# @namespace: Rados namespace name in the Ceph pool. (Since 5.0)
3548#
26ec4e53 3549# @image: Image name in the Ceph pool.
8a47e8eb 3550#
26ec4e53
PM
3551# @conf: path to Ceph configuration file. Values
3552# in the configuration file will be overridden by
3553# options specified via QAPI.
8a47e8eb 3554#
26ec4e53 3555# @snapshot: Ceph snapshot name.
8a47e8eb 3556#
26ec4e53 3557# @user: Ceph id name.
8a47e8eb 3558#
a3699de4 3559# @auth-client-required: Acceptable authentication modes.
26ec4e53
PM
3560# This maps to Ceph configuration option
3561# "auth_client_required". (Since 3.0)
a3699de4 3562#
26ec4e53
PM
3563# @key-secret: ID of a QCryptoSecret object providing a key
3564# for cephx authentication.
3565# This maps to Ceph configuration option
3566# "key". (Since 3.0)
d083f954 3567#
26ec4e53
PM
3568# @server: Monitor host address and port. This maps
3569# to the "mon_host" Ceph option.
0a55679b 3570#
8a47e8eb
JC
3571# Since: 2.9
3572##
3573{ 'struct': 'BlockdevOptionsRbd',
3574 'data': { 'pool': 'str',
19ae9ae0 3575 '*namespace': 'str',
8a47e8eb
JC
3576 'image': 'str',
3577 '*conf': 'str',
3578 '*snapshot': 'str',
3579 '*user': 'str',
a3699de4 3580 '*auth-client-required': ['RbdAuthMode'],
d083f954 3581 '*key-secret': 'str',
577d8c9a 3582 '*server': ['InetSocketAddressBase'] } }
8a47e8eb 3583
d282f34e
MA
3584##
3585# @BlockdevOptionsSheepdog:
3586#
3587# Driver specific block device options for sheepdog
3588#
26ec4e53
PM
3589# @vdi: Virtual disk image name
3590# @server: The Sheepdog server to connect to
3591# @snap-id: Snapshot ID
3592# @tag: Snapshot tag name
d282f34e
MA
3593#
3594# Only one of @snap-id and @tag may be present.
3595#
3596# Since: 2.9
3597##
3598{ 'struct': 'BlockdevOptionsSheepdog',
62cf396b 3599 'data': { 'server': 'SocketAddress',
d282f34e
MA
3600 'vdi': 'str',
3601 '*snap-id': 'uint32',
3602 '*tag': 'str' } }
3603
190b9a8b 3604##
5072f7b3 3605# @ReplicationMode:
190b9a8b
CX
3606#
3607# An enumeration of replication modes.
3608#
3609# @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3610#
3611# @secondary: Secondary mode, receive the vm's state from primary QEMU.
3612#
79b7a77e 3613# Since: 2.9
190b9a8b 3614##
335d10cd
MAL
3615{ 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3616 'if': 'defined(CONFIG_REPLICATION)' }
190b9a8b 3617
82ac5543 3618##
5072f7b3 3619# @BlockdevOptionsReplication:
82ac5543
WC
3620#
3621# Driver specific block device options for replication
3622#
3623# @mode: the replication mode
3624#
1d8bda12 3625# @top-id: In secondary mode, node name or device ID of the root
f4f2539b
CX
3626# node who owns the replication node chain. Must not be given in
3627# primary mode.
82ac5543 3628#
79b7a77e 3629# Since: 2.9
82ac5543
WC
3630##
3631{ 'struct': 'BlockdevOptionsReplication',
3632 'base': 'BlockdevOptionsGenericFormat',
3633 'data': { 'mode': 'ReplicationMode',
335d10cd
MAL
3634 '*top-id': 'str' },
3635 'if': 'defined(CONFIG_REPLICATION)' }
82ac5543 3636
aa2623d8 3637##
5072f7b3 3638# @NFSTransport:
aa2623d8
AA
3639#
3640# An enumeration of NFS transport types
3641#
26ec4e53 3642# @inet: TCP transport
aa2623d8 3643#
79b7a77e 3644# Since: 2.9
aa2623d8
AA
3645##
3646{ 'enum': 'NFSTransport',
3647 'data': [ 'inet' ] }
3648
3649##
5072f7b3 3650# @NFSServer:
aa2623d8
AA
3651#
3652# Captures the address of the socket
3653#
26ec4e53 3654# @type: transport type used for NFS (only TCP supported)
aa2623d8 3655#
26ec4e53 3656# @host: host address for NFS server
aa2623d8 3657#
79b7a77e 3658# Since: 2.9
aa2623d8
AA
3659##
3660{ 'struct': 'NFSServer',
3661 'data': { 'type': 'NFSTransport',
3662 'host': 'str' } }
3663
3664##
5072f7b3 3665# @BlockdevOptionsNfs:
aa2623d8
AA
3666#
3667# Driver specific block device option for NFS
3668#
26ec4e53 3669# @server: host address
aa2623d8 3670#
26ec4e53 3671# @path: path of the image on the host
aa2623d8 3672#
26ec4e53
PM
3673# @user: UID value to use when talking to the
3674# server (defaults to 65534 on Windows and getuid()
3675# on unix)
aa2623d8 3676#
26ec4e53
PM
3677# @group: GID value to use when talking to the
3678# server (defaults to 65534 on Windows and getgid()
3679# in unix)
aa2623d8 3680#
26ec4e53
PM
3681# @tcp-syn-count: number of SYNs during the session
3682# establishment (defaults to libnfs default)
aa2623d8 3683#
26ec4e53
PM
3684# @readahead-size: set the readahead size in bytes (defaults
3685# to libnfs default)
aa2623d8 3686#
26ec4e53
PM
3687# @page-cache-size: set the pagecache size in bytes (defaults
3688# to libnfs default)
aa2623d8 3689#
26ec4e53
PM
3690# @debug: set the NFS debug level (max 2) (defaults
3691# to libnfs default)
aa2623d8 3692#
79b7a77e 3693# Since: 2.9
aa2623d8
AA
3694##
3695{ 'struct': 'BlockdevOptionsNfs',
3696 'data': { 'server': 'NFSServer',
3697 'path': 'str',
3698 '*user': 'int',
3699 '*group': 'int',
3700 '*tcp-syn-count': 'int',
3701 '*readahead-size': 'int',
3702 '*page-cache-size': 'int',
7103d916 3703 '*debug': 'int' } }
aa2623d8 3704
68555285 3705##
6b9d62db 3706# @BlockdevOptionsCurlBase:
68555285 3707#
6b9d62db
HR
3708# Driver specific block device options shared by all protocols supported by the
3709# curl backend.
68555285 3710#
26ec4e53 3711# @url: URL of the image file
6b9d62db 3712#
26ec4e53
PM
3713# @readahead: Size of the read-ahead cache; must be a multiple of
3714# 512 (defaults to 256 kB)
6b9d62db 3715#
26ec4e53 3716# @timeout: Timeout for connections, in seconds (defaults to 5)
6b9d62db 3717#
26ec4e53 3718# @username: Username for authentication (defaults to none)
6b9d62db 3719#
26ec4e53
PM
3720# @password-secret: ID of a QCryptoSecret object providing a password
3721# for authentication (defaults to no password)
6b9d62db 3722#
26ec4e53 3723# @proxy-username: Username for proxy authentication (defaults to none)
6b9d62db 3724#
26ec4e53
PM
3725# @proxy-password-secret: ID of a QCryptoSecret object providing a password
3726# for proxy authentication (defaults to no password)
6b9d62db
HR
3727#
3728# Since: 2.9
3729##
3730{ 'struct': 'BlockdevOptionsCurlBase',
3731 'data': { 'url': 'str',
3732 '*readahead': 'int',
3733 '*timeout': 'int',
3734 '*username': 'str',
3735 '*password-secret': 'str',
3736 '*proxy-username': 'str',
3737 '*proxy-password-secret': 'str' } }
3738
3739##
3740# @BlockdevOptionsCurlHttp:
3741#
3742# Driver specific block device options for HTTP connections over the curl
3743# backend. URLs must start with "http://".
3744#
26ec4e53
PM
3745# @cookie: List of cookies to set; format is
3746# "name1=content1; name2=content2;" as explained by
3747# CURLOPT_COOKIE(3). Defaults to no cookies.
6b9d62db 3748#
327c8ebd
PK
3749# @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3750# secure way. See @cookie for the format. (since 2.10)
3751#
6b9d62db
HR
3752# Since: 2.9
3753##
3754{ 'struct': 'BlockdevOptionsCurlHttp',
3755 'base': 'BlockdevOptionsCurlBase',
327c8ebd
PK
3756 'data': { '*cookie': 'str',
3757 '*cookie-secret': 'str'} }
6b9d62db
HR
3758
3759##
3760# @BlockdevOptionsCurlHttps:
3761#
3762# Driver specific block device options for HTTPS connections over the curl
3763# backend. URLs must start with "https://".
3764#
26ec4e53
PM
3765# @cookie: List of cookies to set; format is
3766# "name1=content1; name2=content2;" as explained by
3767# CURLOPT_COOKIE(3). Defaults to no cookies.
6b9d62db 3768#
26ec4e53
PM
3769# @sslverify: Whether to verify the SSL certificate's validity (defaults to
3770# true)
6b9d62db 3771#
327c8ebd
PK
3772# @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3773# secure way. See @cookie for the format. (since 2.10)
3774#
6b9d62db
HR
3775# Since: 2.9
3776##
3777{ 'struct': 'BlockdevOptionsCurlHttps',
3778 'base': 'BlockdevOptionsCurlBase',
3779 'data': { '*cookie': 'str',
327c8ebd
PK
3780 '*sslverify': 'bool',
3781 '*cookie-secret': 'str'} }
6b9d62db
HR
3782
3783##
3784# @BlockdevOptionsCurlFtp:
3785#
3786# Driver specific block device options for FTP connections over the curl
3787# backend. URLs must start with "ftp://".
3788#
3789# Since: 2.9
3790##
3791{ 'struct': 'BlockdevOptionsCurlFtp',
3792 'base': 'BlockdevOptionsCurlBase',
3793 'data': { } }
3794
3795##
3796# @BlockdevOptionsCurlFtps:
3797#
3798# Driver specific block device options for FTPS connections over the curl
3799# backend. URLs must start with "ftps://".
3800#
26ec4e53
PM
3801# @sslverify: Whether to verify the SSL certificate's validity (defaults to
3802# true)
68555285 3803#
79b7a77e 3804# Since: 2.9
68555285 3805##
6b9d62db
HR
3806{ 'struct': 'BlockdevOptionsCurlFtps',
3807 'base': 'BlockdevOptionsCurlBase',
3808 'data': { '*sslverify': 'bool' } }
68555285 3809
6b02b1f0 3810##
5072f7b3 3811# @BlockdevOptionsNbd:
6b02b1f0
HR
3812#
3813# Driver specific block device options for NBD.
3814#
26ec4e53 3815# @server: NBD server address
6b02b1f0 3816#
26ec4e53 3817# @export: export name
6b02b1f0 3818#
26ec4e53 3819# @tls-creds: TLS credentials ID
6b02b1f0 3820#
216ee365
EB
3821# @x-dirty-bitmap: A "qemu:dirty-bitmap:NAME" string to query in place of
3822# traditional "base:allocation" block status (see
3823# NBD_OPT_LIST_META_CONTEXT in the NBD protocol) (since 3.0)
3824#
b172ae2e
VSO
3825# @reconnect-delay: On an unexpected disconnect, the nbd client tries to
3826# connect again until succeeding or encountering a serious
3827# error. During the first @reconnect-delay seconds, all
3828# requests are paused and will be rerun on a successful
3829# reconnect. After that time, any delayed requests and all
3830# future requests before a successful reconnect will
3831# immediately fail. Default 0 (Since 4.2)
3832#
79b7a77e 3833# Since: 2.9
6b02b1f0
HR
3834##
3835{ 'struct': 'BlockdevOptionsNbd',
62cf396b 3836 'data': { 'server': 'SocketAddress',
6b02b1f0 3837 '*export': 'str',
216ee365 3838 '*tls-creds': 'str',
b172ae2e
VSO
3839 '*x-dirty-bitmap': 'str',
3840 '*reconnect-delay': 'uint32' } }
6b02b1f0 3841
2fdc7045 3842##
5072f7b3 3843# @BlockdevOptionsRaw:
2fdc7045
TG
3844#
3845# Driver specific block device options for the raw driver.
3846#
26ec4e53
PM
3847# @offset: position where the block device starts
3848# @size: the assumed size of the device
2fdc7045 3849#
79b7a77e 3850# Since: 2.9
2fdc7045
TG
3851##
3852{ 'struct': 'BlockdevOptionsRaw',
3853 'base': 'BlockdevOptionsGenericFormat',
3854 'data': { '*offset': 'int', '*size': 'int' } }
3855
da92c3ff
AM
3856##
3857# @BlockdevOptionsVxHS:
3858#
3859# Driver specific block device options for VxHS
3860#
26ec4e53
PM
3861# @vdisk-id: UUID of VxHS volume
3862# @server: vxhs server IP, port
3863# @tls-creds: TLS credentials ID
da92c3ff
AM
3864#
3865# Since: 2.10
3866##
3867{ 'struct': 'BlockdevOptionsVxHS',
3868 'data': { 'vdisk-id': 'str',
3869 'server': 'InetSocketAddressBase',
3870 '*tls-creds': 'str' } }
3871
1ad166b6 3872##
d8e7d87e
MP
3873# @BlockdevOptionsThrottle:
3874#
3875# Driver specific block device options for the throttle driver
3876#
26ec4e53
PM
3877# @throttle-group: the name of the throttle-group object to use. It
3878# must already exist.
3879# @file: reference to or definition of the data source block device
d8e7d87e
MP
3880# Since: 2.11
3881##
3882{ 'struct': 'BlockdevOptionsThrottle',
3883 'data': { 'throttle-group': 'str',
3884 'file' : 'BlockdevRef'
3885 } }
3886##
5072f7b3 3887# @BlockdevOptions:
1ad166b6 3888#
3666a97f
EB
3889# Options for creating a block device. Many options are available for all
3890# block devices, independent of the block driver:
3891#
26ec4e53
PM
3892# @driver: block driver name
3893# @node-name: the node name of the new node (Since 2.0).
3894# This option is required on the top level of blockdev-add.
3895# Valid node names start with an alphabetic character and may
3896# contain only alphanumeric characters, '-', '.' and '_'. Their
3897# maximum length is 31 characters.
3898# @discard: discard-related options (default: ignore)
3899# @cache: cache-related options
3900# @read-only: whether the block device should be read-only (default: false).
3901# Note that some block drivers support only read-only access,
3902# either generally or in certain configurations. In this case,
3903# the default value does not work and the option must be
3904# specified explicitly.
e35bdc12
KW
3905# @auto-read-only: if true and @read-only is false, QEMU may automatically
3906# decide not to open the image read-write as requested, but
3907# fall back to read-only instead (and switch between the modes
3908# later), e.g. depending on whether the image file is writable
3909# or whether a writing user is attached to the node
3910# (default: false, since 3.1)
1d8bda12 3911# @detect-zeroes: detect and optimize zero writes (Since 2.1)
3666a97f 3912# (default: off)
26ec4e53
PM
3913# @force-share: force share all permission on added nodes.
3914# Requires read-only=true. (Since 2.10)
3666a97f
EB
3915#
3916# Remaining options are determined by the block driver.
1ad166b6 3917#
79b7a77e 3918# Since: 2.9
1ad166b6
BC
3919##
3920{ 'union': 'BlockdevOptions',
3666a97f 3921 'base': { 'driver': 'BlockdevDriver',
3666a97f
EB
3922 '*node-name': 'str',
3923 '*discard': 'BlockdevDiscardOptions',
3924 '*cache': 'BlockdevCacheOptions',
3666a97f 3925 '*read-only': 'bool',
e35bdc12 3926 '*auto-read-only': 'bool',
5a9347c6 3927 '*force-share': 'bool',
3666a97f 3928 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
1ad166b6
BC
3929 'discriminator': 'driver',
3930 'data': {
db866be9 3931 'blkdebug': 'BlockdevOptionsBlkdebug',
bfcc224e 3932 'blklogwrites':'BlockdevOptionsBlklogwrites',
db866be9 3933 'blkverify': 'BlockdevOptionsBlkverify',
35e32d9e 3934 'blkreplay': 'BlockdevOptionsBlkreplay',
db866be9
FZ
3935 'bochs': 'BlockdevOptionsGenericFormat',
3936 'cloop': 'BlockdevOptionsGenericFormat',
f41388e0 3937 'compress': 'BlockdevOptionsGenericFormat',
6c6f24fd 3938 'copy-on-read':'BlockdevOptionsGenericFormat',
db866be9 3939 'dmg': 'BlockdevOptionsGenericFormat',
1ad166b6 3940 'file': 'BlockdevOptionsFile',
6b9d62db
HR
3941 'ftp': 'BlockdevOptionsCurlFtp',
3942 'ftps': 'BlockdevOptionsCurlFtps',
7edac2dd 3943 'gluster': 'BlockdevOptionsGluster',
1ad166b6 3944 'host_cdrom': 'BlockdevOptionsFile',
db866be9 3945 'host_device':'BlockdevOptionsFile',
6b9d62db
HR
3946 'http': 'BlockdevOptionsCurlHttp',
3947 'https': 'BlockdevOptionsCurlHttps',
31eb1202 3948 'iscsi': 'BlockdevOptionsIscsi',
78368575 3949 'luks': 'BlockdevOptionsLUKS',
6b02b1f0 3950 'nbd': 'BlockdevOptionsNbd',
aa2623d8 3951 'nfs': 'BlockdevOptionsNfs',
db866be9
FZ
3952 'null-aio': 'BlockdevOptionsNull',
3953 'null-co': 'BlockdevOptionsNull',
d87ee3d7 3954 'nvme': 'BlockdevOptionsNVMe',
1ad166b6 3955 'parallels': 'BlockdevOptionsGenericFormat',
1ad166b6 3956 'qcow2': 'BlockdevOptionsQcow2',
d85f4222 3957 'qcow': 'BlockdevOptionsQcow',
1ad166b6 3958 'qed': 'BlockdevOptionsGenericCOWFormat',
db866be9 3959 'quorum': 'BlockdevOptionsQuorum',
2fdc7045 3960 'raw': 'BlockdevOptionsRaw',
8a47e8eb 3961 'rbd': 'BlockdevOptionsRbd',
335d10cd
MAL
3962 'replication': { 'type': 'BlockdevOptionsReplication',
3963 'if': 'defined(CONFIG_REPLICATION)' },
d282f34e 3964 'sheepdog': 'BlockdevOptionsSheepdog',
ad0e90a6 3965 'ssh': 'BlockdevOptionsSsh',
d8e7d87e 3966 'throttle': 'BlockdevOptionsThrottle',
1ad166b6
BC
3967 'vdi': 'BlockdevOptionsGenericFormat',
3968 'vhdx': 'BlockdevOptionsGenericFormat',
3969 'vmdk': 'BlockdevOptionsGenericCOWFormat',
3970 'vpc': 'BlockdevOptionsGenericFormat',
da92c3ff
AM
3971 'vvfat': 'BlockdevOptionsVVFAT',
3972 'vxhs': 'BlockdevOptionsVxHS'
1ad166b6
BC
3973 } }
3974
3975##
5072f7b3 3976# @BlockdevRef:
1ad166b6
BC
3977#
3978# Reference to a block device.
3979#
26ec4e53
PM
3980# @definition: defines a new block device inline
3981# @reference: references the ID of an existing block device
1ad166b6 3982#
79b7a77e 3983# Since: 2.9
1ad166b6 3984##
ab916fad 3985{ 'alternate': 'BlockdevRef',
1ad166b6
BC
3986 'data': { 'definition': 'BlockdevOptions',
3987 'reference': 'str' } }
3988
c42e8742
MA
3989##
3990# @BlockdevRefOrNull:
3991#
3992# Reference to a block device.
3993#
26ec4e53
PM
3994# @definition: defines a new block device inline
3995# @reference: references the ID of an existing block device.
3996# An empty string means that no block device should
3997# be referenced. Deprecated; use null instead.
3998# @null: No block device should be referenced (since 2.10)
c42e8742
MA
3999#
4000# Since: 2.9
4001##
4002{ 'alternate': 'BlockdevRefOrNull',
4003 'data': { 'definition': 'BlockdevOptions',
4004 'reference': 'str',
4005 'null': 'null' } }
4006
1ad166b6
BC
4007##
4008# @blockdev-add:
4009#
be4b67bc
HR
4010# Creates a new block device. If the @id option is given at the top level, a
4011# BlockBackend will be created; otherwise, @node-name is mandatory at the top
4012# level and no BlockBackend will be created.
1ad166b6 4013#
79b7a77e 4014# Since: 2.9
b4749948
MAL
4015#
4016# Example:
4017#
4018# 1.
4019# -> { "execute": "blockdev-add",
4020# "arguments": {
b1660997
JC
4021# "driver": "qcow2",
4022# "node-name": "test1",
4023# "file": {
4024# "driver": "file",
4025# "filename": "test.qcow2"
4026# }
4027# }
4028# }
b4749948
MAL
4029# <- { "return": {} }
4030#
4031# 2.
4032# -> { "execute": "blockdev-add",
4033# "arguments": {
b1660997
JC
4034# "driver": "qcow2",
4035# "node-name": "node0",
4036# "discard": "unmap",
4037# "cache": {
4038# "direct": true
b4749948
MAL
4039# },
4040# "file": {
b1660997
JC
4041# "driver": "file",
4042# "filename": "/tmp/test.qcow2"
b4749948
MAL
4043# },
4044# "backing": {
b1660997
JC
4045# "driver": "raw",
4046# "file": {
4047# "driver": "file",
4048# "filename": "/dev/fdset/4"
b4749948
MAL
4049# }
4050# }
b4749948
MAL
4051# }
4052# }
4053#
4054# <- { "return": {} }
4055#
1ad166b6 4056##
0153d2f5 4057{ 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
1ad166b6 4058
1479c730
AG
4059##
4060# @x-blockdev-reopen:
4061#
4062# Reopens a block device using the given set of options. Any option
4063# not specified will be reset to its default value regardless of its
4064# previous status. If an option cannot be changed or a particular
4065# driver does not support reopening then the command will return an
4066# error.
4067#
4068# The top-level @node-name option (from BlockdevOptions) must be
4069# specified and is used to select the block device to be reopened.
4070# Other @node-name options must be either omitted or set to the
4071# current name of the appropriate node. This command won't change any
4072# node name and any attempt to do it will result in an error.
4073#
4074# In the case of options that refer to child nodes, the behavior of
4075# this command depends on the value:
4076#
4077# 1) A set of options (BlockdevOptions): the child is reopened with
4078# the specified set of options.
4079#
4080# 2) A reference to the current child: the child is reopened using
4081# its existing set of options.
4082#
4083# 3) A reference to a different node: the current child is replaced
4084# with the specified one.
4085#
4086# 4) NULL: the current child (if any) is detached.
4087#
4088# Options (1) and (2) are supported in all cases, but at the moment
4089# only @backing allows replacing or detaching an existing child.
4090#
4091# Unlike with blockdev-add, the @backing option must always be present
4092# unless the node being reopened does not have a backing file and its
4093# image does not have a default backing file name as part of its
4094# metadata.
4095#
4096# Since: 4.0
4097##
4098{ 'command': 'x-blockdev-reopen',
4099 'data': 'BlockdevOptions', 'boxed': true }
4100
81b936ae 4101##
79b7a77e 4102# @blockdev-del:
81b936ae
AG
4103#
4104# Deletes a block device that has been added using blockdev-add.
9ec8873e
KW
4105# The command will fail if the node is attached to a device or is
4106# otherwise being used.
81b936ae 4107#
7a305384
MAL
4108# @node-name: Name of the graph node to delete.
4109#
79b7a77e 4110# Since: 2.9
915a213f
MAL
4111#
4112# Example:
4113#
4114# -> { "execute": "blockdev-add",
4115# "arguments": {
b1660997
JC
4116# "driver": "qcow2",
4117# "node-name": "node0",
4118# "file": {
4119# "driver": "file",
4120# "filename": "test.qcow2"
4121# }
915a213f
MAL
4122# }
4123# }
4124# <- { "return": {} }
4125#
79b7a77e 4126# -> { "execute": "blockdev-del",
915a213f
MAL
4127# "arguments": { "node-name": "node0" }
4128# }
4129# <- { "return": {} }
4130#
81b936ae 4131##
79b7a77e 4132{ 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
81b936ae 4133
927f11e1
KW
4134##
4135# @BlockdevCreateOptionsFile:
4136#
4137# Driver specific image creation options for file.
4138#
f5627506
PM
4139# @filename: Filename for the new image file
4140# @size: Size of the virtual disk in bytes
4141# @preallocation: Preallocation mode for the new image (default: off;
4142# allowed values: off,
4143# falloc (if defined CONFIG_POSIX_FALLOCATE),
4144# full (if defined CONFIG_POSIX))
4145# @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
927f11e1
KW
4146#
4147# Since: 2.12
4148##
4149{ 'struct': 'BlockdevCreateOptionsFile',
4150 'data': { 'filename': 'str',
4151 'size': 'size',
4152 '*preallocation': 'PreallocMode',
4153 '*nocow': 'bool' } }
4154
ab8bda76
KW
4155##
4156# @BlockdevCreateOptionsGluster:
4157#
4158# Driver specific image creation options for gluster.
4159#
f5627506
PM
4160# @location: Where to store the new image file
4161# @size: Size of the virtual disk in bytes
4162# @preallocation: Preallocation mode for the new image (default: off;
4163# allowed values: off,
4164# falloc (if defined CONFIG_GLUSTERFS_FALLOCATE),
4165# full (if defined CONFIG_GLUSTERFS_ZEROFILL))
ab8bda76
KW
4166#
4167# Since: 2.12
4168##
4169{ 'struct': 'BlockdevCreateOptionsGluster',
4170 'data': { 'location': 'BlockdevOptionsGluster',
4171 'size': 'size',
4172 '*preallocation': 'PreallocMode' } }
4173
1bedcaf1
KW
4174##
4175# @BlockdevCreateOptionsLUKS:
4176#
4177# Driver specific image creation options for LUKS.
4178#
f5627506
PM
4179# @file: Node to create the image format on
4180# @size: Size of the virtual disk in bytes
4181# @preallocation: Preallocation mode for the new image
4182# (since: 4.2)
4183# (default: off; allowed values: off, metadata, falloc, full)
1bedcaf1
KW
4184#
4185# Since: 2.12
4186##
4187{ 'struct': 'BlockdevCreateOptionsLUKS',
4188 'base': 'QCryptoBlockCreateOptionsLUKS',
4189 'data': { 'file': 'BlockdevRef',
672de729
ML
4190 'size': 'size',
4191 '*preallocation': 'PreallocMode' } }
1bedcaf1 4192
a1a42af4
KW
4193##
4194# @BlockdevCreateOptionsNfs:
4195#
4196# Driver specific image creation options for NFS.
4197#
f5627506
PM
4198# @location: Where to store the new image file
4199# @size: Size of the virtual disk in bytes
a1a42af4
KW
4200#
4201# Since: 2.12
4202##
4203{ 'struct': 'BlockdevCreateOptionsNfs',
4204 'data': { 'location': 'BlockdevOptionsNfs',
4205 'size': 'size' } }
4206
1511b490
KW
4207##
4208# @BlockdevCreateOptionsParallels:
4209#
4210# Driver specific image creation options for parallels.
4211#
f5627506
PM
4212# @file: Node to create the image format on
4213# @size: Size of the virtual disk in bytes
4214# @cluster-size: Cluster size in bytes (default: 1 MB)
1511b490
KW
4215#
4216# Since: 2.12
4217##
4218{ 'struct': 'BlockdevCreateOptionsParallels',
4219 'data': { 'file': 'BlockdevRef',
4220 'size': 'size',
4221 '*cluster-size': 'size' } }
4222
42a3e1ab
KW
4223##
4224# @BlockdevCreateOptionsQcow:
4225#
4226# Driver specific image creation options for qcow.
4227#
f5627506
PM
4228# @file: Node to create the image format on
4229# @size: Size of the virtual disk in bytes
4230# @backing-file: File name of the backing file if a backing file
4231# should be used
4232# @encrypt: Encryption options if the image should be encrypted
42a3e1ab
KW
4233#
4234# Since: 2.12
4235##
4236{ 'struct': 'BlockdevCreateOptionsQcow',
4237 'data': { 'file': 'BlockdevRef',
4238 'size': 'size',
4239 '*backing-file': 'str',
4240 '*encrypt': 'QCryptoBlockCreateOptions' } }
4241
c2808aba
KW
4242##
4243# @BlockdevQcow2Version:
4244#
4245# @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4246# @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4247#
4248# Since: 2.12
4249##
4250{ 'enum': 'BlockdevQcow2Version',
4251 'data': [ 'v2', 'v3' ] }
4252
4253
4254##
4255# @BlockdevCreateOptionsQcow2:
4256#
4257# Driver specific image creation options for qcow2.
4258#
f5627506
PM
4259# @file: Node to create the image format on
4260# @data-file: Node to use as an external data file in which all guest
4261# data is stored so that only metadata remains in the qcow2
4262# file (since: 4.0)
4263# @data-file-raw: True if the external data file must stay valid as a
4264# standalone (read-only) raw image without looking at qcow2
4265# metadata (default: false; since: 4.0)
4266# @size: Size of the virtual disk in bytes
4267# @version: Compatibility level (default: v3)
4268# @backing-file: File name of the backing file if a backing file
4269# should be used
4270# @backing-fmt: Name of the block driver to use for the backing file
4271# @encrypt: Encryption options if the image should be encrypted
4272# @cluster-size: qcow2 cluster size in bytes (default: 65536)
4273# @preallocation: Preallocation mode for the new image (default: off;
4274# allowed values: off, falloc, full, metadata)
4275# @lazy-refcounts: True if refcounts may be updated lazily (default: off)
4276# @refcount-bits: Width of reference counts in bits (default: 16)
c2808aba
KW
4277#
4278# Since: 2.12
4279##
4280{ 'struct': 'BlockdevCreateOptionsQcow2',
4281 'data': { 'file': 'BlockdevRef',
dcc98687 4282 '*data-file': 'BlockdevRef',
6c3944dc 4283 '*data-file-raw': 'bool',
c2808aba
KW
4284 'size': 'size',
4285 '*version': 'BlockdevQcow2Version',
4286 '*backing-file': 'str',
4287 '*backing-fmt': 'BlockdevDriver',
4288 '*encrypt': 'QCryptoBlockCreateOptions',
4289 '*cluster-size': 'size',
4290 '*preallocation': 'PreallocMode',
4291 '*lazy-refcounts': 'bool',
4292 '*refcount-bits': 'int' } }
4293
959355a4
KW
4294##
4295# @BlockdevCreateOptionsQed:
4296#
4297# Driver specific image creation options for qed.
4298#
f5627506
PM
4299# @file: Node to create the image format on
4300# @size: Size of the virtual disk in bytes
4301# @backing-file: File name of the backing file if a backing file
4302# should be used
4303# @backing-fmt: Name of the block driver to use for the backing file
4304# @cluster-size: Cluster size in bytes (default: 65536)
4305# @table-size: L1/L2 table size (in clusters)
959355a4
KW
4306#
4307# Since: 2.12
4308##
4309{ 'struct': 'BlockdevCreateOptionsQed',
4310 'data': { 'file': 'BlockdevRef',
4311 'size': 'size',
4312 '*backing-file': 'str',
4313 '*backing-fmt': 'BlockdevDriver',
4314 '*cluster-size': 'size',
4315 '*table-size': 'int' } }
4316
1bebea37
KW
4317##
4318# @BlockdevCreateOptionsRbd:
4319#
4320# Driver specific image creation options for rbd/Ceph.
4321#
f5627506
PM
4322# @location: Where to store the new image file. This location cannot
4323# point to a snapshot.
4324# @size: Size of the virtual disk in bytes
4325# @cluster-size: RBD object size
1bebea37
KW
4326#
4327# Since: 2.12
4328##
4329{ 'struct': 'BlockdevCreateOptionsRbd',
4330 'data': { 'location': 'BlockdevOptionsRbd',
4331 'size': 'size',
4332 '*cluster-size' : 'size' } }
4333
3015372d
FZ
4334##
4335# @BlockdevVmdkSubformat:
4336#
4337# Subformat options for VMDK images
4338#
4339# @monolithicSparse: Single file image with sparse cluster allocation
4340#
4341# @monolithicFlat: Single flat data image and a descriptor file
4342#
4343# @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4344# files, in addition to a descriptor file
4345#
4346# @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4347# files, in addition to a descriptor file
4348#
4349# @streamOptimized: Single file image sparse cluster allocation, optimized
4350# for streaming over network.
4351#
4352# Since: 4.0
4353##
4354{ 'enum': 'BlockdevVmdkSubformat',
4355 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4356 'twoGbMaxExtentFlat', 'streamOptimized'] }
4357
4358##
4359# @BlockdevVmdkAdapterType:
4360#
4361# Adapter type info for VMDK images
4362#
4363# Since: 4.0
4364##
4365{ 'enum': 'BlockdevVmdkAdapterType',
4366 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4367
4368##
4369# @BlockdevCreateOptionsVmdk:
4370#
4371# Driver specific image creation options for VMDK.
4372#
f5627506
PM
4373# @file: Where to store the new image file. This refers to the image
4374# file for monolithcSparse and streamOptimized format, or the
4375# descriptor file for other formats.
4376# @size: Size of the virtual disk in bytes
4377# @extents: Where to store the data extents. Required for monolithcFlat,
4378# twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4379# monolithicFlat, only one entry is required; for
4380# twoGbMaxExtent* formats, the number of entries required is
4381# calculated as extent_number = virtual_size / 2GB. Providing
4382# more extents than will be used is an error.
4383# @subformat: The subformat of the VMDK image. Default: "monolithicSparse".
4384# @backing-file: The path of backing file. Default: no backing file is used.
4385# @adapter-type: The adapter type used to fill in the descriptor. Default: ide.
4386# @hwversion: Hardware version. The meaningful options are "4" or "6".
4387# Default: "4".
4388# @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats.
4389# Default: false.
3015372d
FZ
4390#
4391# Since: 4.0
4392##
4393{ 'struct': 'BlockdevCreateOptionsVmdk',
4394 'data': { 'file': 'BlockdevRef',
4395 'size': 'size',
4396 '*extents': ['BlockdevRef'],
4397 '*subformat': 'BlockdevVmdkSubformat',
4398 '*backing-file': 'str',
4399 '*adapter-type': 'BlockdevVmdkAdapterType',
4400 '*hwversion': 'str',
4401 '*zeroed-grain': 'bool' } }
4402
4403
a595e4bc
KW
4404##
4405# @SheepdogRedundancyType:
4406#
f5627506
PM
4407# @full: Create a fully replicated vdi with x copies
4408# @erasure-coded: Create an erasure coded vdi with x data strips and
4409# y parity strips
a595e4bc
KW
4410#
4411# Since: 2.12
4412##
4413{ 'enum': 'SheepdogRedundancyType',
4414 'data': [ 'full', 'erasure-coded' ] }
4415
4416##
4417# @SheepdogRedundancyFull:
4418#
f5627506 4419# @copies: Number of copies to use (between 1 and 31)
a595e4bc
KW
4420#
4421# Since: 2.12
4422##
4423{ 'struct': 'SheepdogRedundancyFull',
4424 'data': { 'copies': 'int' }}
4425
4426##
4427# @SheepdogRedundancyErasureCoded:
4428#
f5627506
PM
4429# @data-strips: Number of data strips to use (one of {2,4,8,16})
4430# @parity-strips: Number of parity strips to use (between 1 and 15)
a595e4bc
KW
4431#
4432# Since: 2.12
4433##
4434{ 'struct': 'SheepdogRedundancyErasureCoded',
4435 'data': { 'data-strips': 'int',
4436 'parity-strips': 'int' }}
4437
4438##
4439# @SheepdogRedundancy:
4440#
4441# Since: 2.12
4442##
4443{ 'union': 'SheepdogRedundancy',
4444 'base': { 'type': 'SheepdogRedundancyType' },
4445 'discriminator': 'type',
4446 'data': { 'full': 'SheepdogRedundancyFull',
4447 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
4448
63fd65a0
KW
4449##
4450# @BlockdevCreateOptionsSheepdog:
4451#
4452# Driver specific image creation options for Sheepdog.
4453#
f5627506
PM
4454# @location: Where to store the new image file
4455# @size: Size of the virtual disk in bytes
4456# @backing-file: File name of a base image
4457# @preallocation: Preallocation mode for the new image (default: off;
4458# allowed values: off, full)
4459# @redundancy: Redundancy of the image
4460# @object-size: Object size of the image
63fd65a0
KW
4461#
4462# Since: 2.12
4463##
4464{ 'struct': 'BlockdevCreateOptionsSheepdog',
4465 'data': { 'location': 'BlockdevOptionsSheepdog',
4466 'size': 'size',
4467 '*backing-file': 'str',
4468 '*preallocation': 'PreallocMode',
4469 '*redundancy': 'SheepdogRedundancy',
4470 '*object-size': 'size' } }
4471
4906da7e
KW
4472##
4473# @BlockdevCreateOptionsSsh:
4474#
4475# Driver specific image creation options for SSH.
4476#
f5627506
PM
4477# @location: Where to store the new image file
4478# @size: Size of the virtual disk in bytes
4906da7e
KW
4479#
4480# Since: 2.12
4481##
4482{ 'struct': 'BlockdevCreateOptionsSsh',
4483 'data': { 'location': 'BlockdevOptionsSsh',
4484 'size': 'size' } }
4485
49858b50
HR
4486##
4487# @BlockdevCreateOptionsVdi:
4488#
4489# Driver specific image creation options for VDI.
4490#
f5627506
PM
4491# @file: Node to create the image format on
4492# @size: Size of the virtual disk in bytes
4493# @preallocation: Preallocation mode for the new image (default: off;
4494# allowed values: off, metadata)
49858b50
HR
4495#
4496# Since: 2.12
4497##
4498{ 'struct': 'BlockdevCreateOptionsVdi',
4499 'data': { 'file': 'BlockdevRef',
4500 'size': 'size',
61fa6487 4501 '*preallocation': 'PreallocMode' } }
49858b50 4502
09b68dab
KW
4503##
4504# @BlockdevVhdxSubformat:
4505#
4506# @dynamic: Growing image file
4507# @fixed: Preallocated fixed-size image file
4508#
4509# Since: 2.12
4510##
4511{ 'enum': 'BlockdevVhdxSubformat',
4512 'data': [ 'dynamic', 'fixed' ] }
4513
4514##
4515# @BlockdevCreateOptionsVhdx:
4516#
4517# Driver specific image creation options for vhdx.
4518#
f5627506
PM
4519# @file: Node to create the image format on
4520# @size: Size of the virtual disk in bytes
4521# @log-size: Log size in bytes, must be a multiple of 1 MB
4522# (default: 1 MB)
4523# @block-size: Block size in bytes, must be a multiple of 1 MB and not
4524# larger than 256 MB (default: automatically choose a block
4525# size depending on the image size)
4526# @subformat: vhdx subformat (default: dynamic)
4527# @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard,
4528# but default. Do not set to 'off' when using 'qemu-img
4529# convert' with subformat=dynamic.
09b68dab
KW
4530#
4531# Since: 2.12
4532##
4533{ 'struct': 'BlockdevCreateOptionsVhdx',
4534 'data': { 'file': 'BlockdevRef',
4535 'size': 'size',
4536 '*log-size': 'size',
4537 '*block-size': 'size',
4538 '*subformat': 'BlockdevVhdxSubformat',
4539 '*block-state-zero': 'bool' } }
4540
182c8835
KW
4541##
4542# @BlockdevVpcSubformat:
4543#
4544# @dynamic: Growing image file
4545# @fixed: Preallocated fixed-size image file
4546#
4547# Since: 2.12
4548##
4549{ 'enum': 'BlockdevVpcSubformat',
4550 'data': [ 'dynamic', 'fixed' ] }
4551
4552##
4553# @BlockdevCreateOptionsVpc:
4554#
4555# Driver specific image creation options for vpc (VHD).
4556#
f5627506
PM
4557# @file: Node to create the image format on
4558# @size: Size of the virtual disk in bytes
4559# @subformat: vhdx subformat (default: dynamic)
4560# @force-size: Force use of the exact byte size instead of rounding to the
4561# next size that can be represented in CHS geometry
4562# (default: false)
182c8835
KW
4563#
4564# Since: 2.12
4565##
4566{ 'struct': 'BlockdevCreateOptionsVpc',
4567 'data': { 'file': 'BlockdevRef',
4568 'size': 'size',
4569 '*subformat': 'BlockdevVpcSubformat',
4570 '*force-size': 'bool' } }
4571
53614689
KW
4572##
4573# @BlockdevCreateOptions:
4574#
4575# Options for creating an image format on a given node.
4576#
f5627506 4577# @driver: block driver to create the image format
53614689
KW
4578#
4579# Since: 2.12
4580##
4581{ 'union': 'BlockdevCreateOptions',
4582 'base': {
4583 'driver': 'BlockdevDriver' },
4584 'discriminator': 'driver',
4585 'data': {
927f11e1 4586 'file': 'BlockdevCreateOptionsFile',
ab8bda76 4587 'gluster': 'BlockdevCreateOptionsGluster',
1bedcaf1 4588 'luks': 'BlockdevCreateOptionsLUKS',
a1a42af4 4589 'nfs': 'BlockdevCreateOptionsNfs',
1511b490 4590 'parallels': 'BlockdevCreateOptionsParallels',
42a3e1ab 4591 'qcow': 'BlockdevCreateOptionsQcow',
c2808aba 4592 'qcow2': 'BlockdevCreateOptionsQcow2',
959355a4 4593 'qed': 'BlockdevCreateOptionsQed',
1bebea37 4594 'rbd': 'BlockdevCreateOptionsRbd',
63fd65a0 4595 'sheepdog': 'BlockdevCreateOptionsSheepdog',
4906da7e 4596 'ssh': 'BlockdevCreateOptionsSsh',
e3810574 4597 'vdi': 'BlockdevCreateOptionsVdi',
09b68dab 4598 'vhdx': 'BlockdevCreateOptionsVhdx',
3015372d 4599 'vmdk': 'BlockdevCreateOptionsVmdk',
29cd0403 4600 'vpc': 'BlockdevCreateOptionsVpc'
53614689
KW
4601 } }
4602
b0292b85 4603##
3fb588a0 4604# @blockdev-create:
b0292b85 4605#
e5ab4347
KW
4606# Starts a job to create an image format on a given node. The job is
4607# automatically finalized, but a manual job-dismiss is required.
b0292b85 4608#
e5ab4347
KW
4609# @job-id: Identifier for the newly created job.
4610#
4611# @options: Options for the image creation.
4612#
4613# Since: 3.0
b0292b85 4614##
3fb588a0 4615{ 'command': 'blockdev-create',
e5ab4347
KW
4616 'data': { 'job-id': 'str',
4617 'options': 'BlockdevCreateOptions' } }
b0292b85 4618
a589569f 4619##
5072f7b3 4620# @BlockErrorAction:
a589569f
WX
4621#
4622# An enumeration of action that has been taken when a DISK I/O occurs
4623#
4624# @ignore: error has been ignored
4625#
4626# @report: error has been reported to the device
4627#
4628# @stop: error caused VM to be stopped
4629#
4630# Since: 2.1
4631##
4632{ 'enum': 'BlockErrorAction',
4633 'data': [ 'ignore', 'report', 'stop' ] }
5a2d2cbd
WX
4634
4635
c120f0fa 4636##
5072f7b3 4637# @BLOCK_IMAGE_CORRUPTED:
c120f0fa 4638#
370d4eba
MAL
4639# Emitted when a disk image is being marked corrupt. The image can be
4640# identified by its device or node name. The 'device' field is always
4641# present for compatibility reasons, but it can be empty ("") if the
4642# image does not have a device name associated.
c120f0fa 4643#
dc881b44
AG
4644# @device: device name. This is always present for compatibility
4645# reasons, but it can be empty ("") if the image does not
4646# have a device name associated.
4647#
1d8bda12 4648# @node-name: node name (Since: 2.4)
c120f0fa
WX
4649#
4650# @msg: informative message for human consumption, such as the kind of
2f44a08b
WX
4651# corruption being detected. It should not be parsed by machine as it is
4652# not guaranteed to be stable
c120f0fa 4653#
1d8bda12 4654# @offset: if the corruption resulted from an image access, this is
0caef8f6 4655# the host's access offset into the image
c120f0fa 4656#
1d8bda12 4657# @size: if the corruption resulted from an image access, this is
c120f0fa
WX
4658# the access size
4659#
370d4eba 4660# @fatal: if set, the image is marked corrupt and therefore unusable after this
26ec4e53
PM
4661# event and must be repaired (Since 2.2; before, every
4662# BLOCK_IMAGE_CORRUPTED event was fatal)
9bf040b9 4663#
07c9f583
MAL
4664# Note: If action is "stop", a STOP event will eventually follow the
4665# BLOCK_IO_ERROR event.
4666#
370d4eba
MAL
4667# Example:
4668#
4669# <- { "event": "BLOCK_IMAGE_CORRUPTED",
4670# "data": { "device": "ide0-hd0", "node-name": "node0",
4671# "msg": "Prevented active L1 table overwrite", "offset": 196608,
4672# "size": 65536 },
4673# "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4674#
c120f0fa
WX
4675# Since: 1.7
4676##
4677{ 'event': 'BLOCK_IMAGE_CORRUPTED',
dc881b44
AG
4678 'data': { 'device' : 'str',
4679 '*node-name' : 'str',
4680 'msg' : 'str',
4681 '*offset' : 'int',
4682 '*size' : 'int',
4683 'fatal' : 'bool' } }
c120f0fa 4684
5a2d2cbd 4685##
5072f7b3 4686# @BLOCK_IO_ERROR:
5a2d2cbd
WX
4687#
4688# Emitted when a disk I/O error occurs
4689#
2bf7e10f
KW
4690# @device: device name. This is always present for compatibility
4691# reasons, but it can be empty ("") if the image does not
4692# have a device name associated.
4693#
4694# @node-name: node name. Note that errors may be reported for the root node
4695# that is directly attached to a guest device rather than for the
bfe1a14c
KW
4696# node where the error occurred. The node name is not present if
4697# the drive is empty. (Since: 2.8)
5a2d2cbd
WX
4698#
4699# @operation: I/O operation
4700#
4701# @action: action that has been taken
4702#
1d8bda12 4703# @nospace: true if I/O error was caused due to a no-space
c7c2ff0c
LC
4704# condition. This key is only present if query-block's
4705# io-status is present, please see query-block documentation
4706# for more information (since: 2.2)
4707#
624ff573
LC
4708# @reason: human readable string describing the error cause.
4709# (This field is a debugging aid for humans, it should not
26ec4e53 4710# be parsed by applications) (since: 2.2)
624ff573 4711#
5a2d2cbd 4712# Note: If action is "stop", a STOP event will eventually follow the
26ec4e53 4713# BLOCK_IO_ERROR event
5a2d2cbd
WX
4714#
4715# Since: 0.13.0
07c9f583
MAL
4716#
4717# Example:
4718#
4719# <- { "event": "BLOCK_IO_ERROR",
4720# "data": { "device": "ide0-hd1",
4721# "node-name": "#block212",
4722# "operation": "write",
4723# "action": "stop" },
4724# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4725#
5a2d2cbd
WX
4726##
4727{ 'event': 'BLOCK_IO_ERROR',
bfe1a14c
KW
4728 'data': { 'device': 'str', '*node-name': 'str',
4729 'operation': 'IoOperationType',
624ff573
LC
4730 'action': 'BlockErrorAction', '*nospace': 'bool',
4731 'reason': 'str' } }
5a2d2cbd 4732
bcada37b 4733##
5072f7b3 4734# @BLOCK_JOB_COMPLETED:
bcada37b
WX
4735#
4736# Emitted when a block job has completed
4737#
4738# @type: job type
4739#
6aae5be6
AG
4740# @device: The job identifier. Originally the device name but other
4741# values are allowed since QEMU 2.7
bcada37b
WX
4742#
4743# @len: maximum progress value
4744#
4745# @offset: current progress value. On success this is equal to len.
4746# On failure this is less than len
4747#
4748# @speed: rate limit, bytes per second
4749#
1d8bda12 4750# @error: error message. Only present on failure. This field
bcada37b
WX
4751# contains a human-readable error message. There are no semantics
4752# other than that streaming has failed and clients should not try to
4753# interpret the error string
4754#
4755# Since: 1.1
e21e65b2
MAL
4756#
4757# Example:
4758#
4759# <- { "event": "BLOCK_JOB_COMPLETED",
4760# "data": { "type": "stream", "device": "virtio-disk0",
4761# "len": 10737418240, "offset": 10737418240,
4762# "speed": 0 },
4763# "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4764#
bcada37b
WX
4765##
4766{ 'event': 'BLOCK_JOB_COMPLETED',
8e4c8700 4767 'data': { 'type' : 'JobType',
bcada37b
WX
4768 'device': 'str',
4769 'len' : 'int',
4770 'offset': 'int',
4771 'speed' : 'int',
4772 '*error': 'str' } }
4773
4774##
5072f7b3 4775# @BLOCK_JOB_CANCELLED:
bcada37b
WX
4776#
4777# Emitted when a block job has been cancelled
4778#
4779# @type: job type
4780#
6aae5be6
AG
4781# @device: The job identifier. Originally the device name but other
4782# values are allowed since QEMU 2.7
bcada37b
WX
4783#
4784# @len: maximum progress value
4785#
4786# @offset: current progress value. On success this is equal to len.
4787# On failure this is less than len
4788#
4789# @speed: rate limit, bytes per second
4790#
4791# Since: 1.1
e161df39
MAL
4792#
4793# Example:
4794#
4795# <- { "event": "BLOCK_JOB_CANCELLED",
4796# "data": { "type": "stream", "device": "virtio-disk0",
4797# "len": 10737418240, "offset": 134217728,
4798# "speed": 0 },
4799# "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4800#
bcada37b
WX
4801##
4802{ 'event': 'BLOCK_JOB_CANCELLED',
8e4c8700 4803 'data': { 'type' : 'JobType',
bcada37b
WX
4804 'device': 'str',
4805 'len' : 'int',
4806 'offset': 'int',
4807 'speed' : 'int' } }
4808
5a2d2cbd 4809##
5072f7b3 4810# @BLOCK_JOB_ERROR:
5a2d2cbd
WX
4811#
4812# Emitted when a block job encounters an error
4813#
6aae5be6
AG
4814# @device: The job identifier. Originally the device name but other
4815# values are allowed since QEMU 2.7
5a2d2cbd
WX
4816#
4817# @operation: I/O operation
4818#
4819# @action: action that has been taken
4820#
4821# Since: 1.3
af0e0910
MAL
4822#
4823# Example:
4824#
4825# <- { "event": "BLOCK_JOB_ERROR",
4826# "data": { "device": "ide0-hd1",
4827# "operation": "write",
4828# "action": "stop" },
4829# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4830#
5a2d2cbd
WX
4831##
4832{ 'event': 'BLOCK_JOB_ERROR',
4833 'data': { 'device' : 'str',
4834 'operation': 'IoOperationType',
823c6863 4835 'action' : 'BlockErrorAction' } }
bcada37b
WX
4836
4837##
5072f7b3 4838# @BLOCK_JOB_READY:
bcada37b
WX
4839#
4840# Emitted when a block job is ready to complete
4841#
518848a2
MA
4842# @type: job type
4843#
6aae5be6
AG
4844# @device: The job identifier. Originally the device name but other
4845# values are allowed since QEMU 2.7
bcada37b 4846#
518848a2
MA
4847# @len: maximum progress value
4848#
4849# @offset: current progress value. On success this is equal to len.
4850# On failure this is less than len
4851#
4852# @speed: rate limit, bytes per second
4853#
bcada37b 4854# Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
26ec4e53 4855# event
bcada37b
WX
4856#
4857# Since: 1.3
11a3dee1
MAL
4858#
4859# Example:
4860#
4861# <- { "event": "BLOCK_JOB_READY",
4862# "data": { "device": "drive0", "type": "mirror", "speed": 0,
4863# "len": 2097152, "offset": 2097152 }
4864# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4865#
bcada37b
WX
4866##
4867{ 'event': 'BLOCK_JOB_READY',
8e4c8700 4868 'data': { 'type' : 'JobType',
518848a2
MA
4869 'device': 'str',
4870 'len' : 'int',
4871 'offset': 'int',
4872 'speed' : 'int' } }
ffeaac9b 4873
5f241594
JS
4874##
4875# @BLOCK_JOB_PENDING:
4876#
4877# Emitted when a block job is awaiting explicit authorization to finalize graph
4878# changes via @block-job-finalize. If this job is part of a transaction, it will
4879# not emit this event until the transaction has converged first.
4880#
4881# @type: job type
4882#
4883# @id: The job identifier.
4884#
4885# Since: 2.12
4886#
4887# Example:
4888#
4889# <- { "event": "BLOCK_JOB_WAITING",
4890# "data": { "device": "drive0", "type": "mirror" },
4891# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4892#
4893##
4894{ 'event': 'BLOCK_JOB_PENDING',
8e4c8700 4895 'data': { 'type' : 'JobType',
5f241594
JS
4896 'id' : 'str' } }
4897
49687ace 4898##
5072f7b3 4899# @PreallocMode:
ffeaac9b
HT
4900#
4901# Preallocation mode of QEMU image file
4902#
4903# @off: no preallocation
4904# @metadata: preallocate only for metadata
4905# @falloc: like @full preallocation but allocate disk space by
fa27c478
HR
4906# posix_fallocate() rather than writing data.
4907# @full: preallocate all data by writing it to the device to ensure
4908# disk space is really available. This data may or may not be
4909# zero, depending on the image format and storage.
4910# @full preallocation also sets up metadata correctly.
ffeaac9b 4911#
5072f7b3 4912# Since: 2.2
ffeaac9b
HT
4913##
4914{ 'enum': 'PreallocMode',
4915 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
e2462113
FR
4916
4917##
5072f7b3 4918# @BLOCK_WRITE_THRESHOLD:
e2462113
FR
4919#
4920# Emitted when writes on block device reaches or exceeds the
4921# configured write threshold. For thin-provisioned devices, this
4922# means the device should be extended to avoid pausing for
4923# disk exhaustion.
4924# The event is one shot. Once triggered, it needs to be
f85d66f4 4925# re-registered with another block-set-write-threshold command.
e2462113
FR
4926#
4927# @node-name: graph node name on which the threshold was exceeded.
4928#
4929# @amount-exceeded: amount of data which exceeded the threshold, in bytes.
4930#
4931# @write-threshold: last configured threshold, in bytes.
4932#
4933# Since: 2.3
4934##
4935{ 'event': 'BLOCK_WRITE_THRESHOLD',
4936 'data': { 'node-name': 'str',
4937 'amount-exceeded': 'uint64',
4938 'write-threshold': 'uint64' } }
4939
4940##
5072f7b3 4941# @block-set-write-threshold:
e2462113 4942#
e817862b
MAL
4943# Change the write threshold for a block drive. An event will be
4944# delivered if a write to this block drive crosses the configured
4945# threshold. The threshold is an offset, thus must be
4946# non-negative. Default is no write threshold. Setting the threshold
4947# to zero disables it.
4948#
e2462113
FR
4949# This is useful to transparently resize thin-provisioned drives without
4950# the guest OS noticing.
4951#
4952# @node-name: graph node name on which the threshold must be set.
4953#
4954# @write-threshold: configured threshold for the block device, bytes.
4955# Use 0 to disable the threshold.
4956#
e2462113 4957# Since: 2.3
e817862b
MAL
4958#
4959# Example:
4960#
4961# -> { "execute": "block-set-write-threshold",
4962# "arguments": { "node-name": "mydev",
4963# "write-threshold": 17179869184 } }
4964# <- { "return": {} }
4965#
e2462113
FR
4966##
4967{ 'command': 'block-set-write-threshold',
4968 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
7f821597
WC
4969
4970##
5072f7b3 4971# @x-blockdev-change:
7f821597
WC
4972#
4973# Dynamically reconfigure the block driver state graph. It can be used
4974# to add, remove, insert or replace a graph node. Currently only the
4975# Quorum driver implements this feature to add or remove its child. This
4976# is useful to fix a broken quorum child.
4977#
4978# If @node is specified, it will be inserted under @parent. @child
4979# may not be specified in this case. If both @parent and @child are
4980# specified but @node is not, @child will be detached from @parent.
4981#
4982# @parent: the id or name of the parent node.
4983#
1d8bda12 4984# @child: the name of a child under the given parent node.
7f821597 4985#
1d8bda12 4986# @node: the name of the node that will be added.
7f821597
WC
4987#
4988# Note: this command is experimental, and its API is not stable. It
26ec4e53
PM
4989# does not support all kinds of operations, all kinds of children, nor
4990# all block drivers.
7f821597 4991#
26ec4e53
PM
4992# FIXME Removing children from a quorum node means introducing gaps in the
4993# child indices. This cannot be represented in the 'children' list of
4994# BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
6b4738ce 4995#
26ec4e53
PM
4996# Warning: The data in a new quorum child MUST be consistent with that of
4997# the rest of the array.
7f821597
WC
4998#
4999# Since: 2.7
bd77ea2e
MAL
5000#
5001# Example:
5002#
5003# 1. Add a new node to a quorum
5004# -> { "execute": "blockdev-add",
5005# "arguments": {
244d04db
EB
5006# "driver": "raw",
5007# "node-name": "new_node",
5008# "file": { "driver": "file",
5009# "filename": "test.raw" } } }
bd77ea2e
MAL
5010# <- { "return": {} }
5011# -> { "execute": "x-blockdev-change",
5012# "arguments": { "parent": "disk1",
5013# "node": "new_node" } }
5014# <- { "return": {} }
5015#
5016# 2. Delete a quorum's node
5017# -> { "execute": "x-blockdev-change",
5018# "arguments": { "parent": "disk1",
5019# "child": "children.1" } }
5020# <- { "return": {} }
5021#
7f821597
WC
5022##
5023{ 'command': 'x-blockdev-change',
5024 'data' : { 'parent': 'str',
5025 '*child': 'str',
5026 '*node': 'str' } }
ca00bbb1
SH
5027
5028##
5029# @x-blockdev-set-iothread:
5030#
5031# Move @node and its children into the @iothread. If @iothread is null then
5032# move @node and its children into the main loop.
5033#
5034# The node must not be attached to a BlockBackend.
5035#
5036# @node-name: the name of the block driver node
5037#
5038# @iothread: the name of the IOThread object or null for the main loop
5039#
882e9b89
SH
5040# @force: true if the node and its children should be moved when a BlockBackend
5041# is already attached
5042#
ca00bbb1 5043# Note: this command is experimental and intended for test cases that need
26ec4e53 5044# control over IOThreads only.
ca00bbb1
SH
5045#
5046# Since: 2.12
5047#
5048# Example:
5049#
5050# 1. Move a node into an IOThread
5051# -> { "execute": "x-blockdev-set-iothread",
5052# "arguments": { "node-name": "disk1",
5053# "iothread": "iothread0" } }
5054# <- { "return": {} }
5055#
5056# 2. Move a node into the main loop
5057# -> { "execute": "x-blockdev-set-iothread",
5058# "arguments": { "node-name": "disk1",
5059# "iothread": null } }
5060# <- { "return": {} }
5061#
5062##
5063{ 'command': 'x-blockdev-set-iothread',
5064 'data' : { 'node-name': 'str',
882e9b89
SH
5065 'iothread': 'StrOrNull',
5066 '*force': 'bool' } }
b3cf1ec0 5067
eed8b691
KW
5068##
5069# @NbdServerOptions:
5070#
5071# @addr: Address on which to listen.
5072# @tls-creds: ID of the TLS credentials object (since 2.6).
5073# @tls-authz: ID of the QAuthZ authorization object used to validate
5074# the client's x509 distinguished name. This object is
5075# is only resolved at time of use, so can be deleted and
5076# recreated on the fly while the NBD server is active.
5077# If missing, it will default to denying access (since 4.0).
5078#
5079# Keep this type consistent with the nbd-server-start arguments. The only
5080# intended difference is using SocketAddress instead of SocketAddressLegacy.
5081#
5082# Since: 4.2
5083##
5084{ 'struct': 'NbdServerOptions',
5085 'data': { 'addr': 'SocketAddress',
5086 '*tls-creds': 'str',
5087 '*tls-authz': 'str'} }
5088
b3cf1ec0
KW
5089##
5090# @nbd-server-start:
5091#
5092# Start an NBD server listening on the given host and port. Block
5093# devices can then be exported using @nbd-server-add. The NBD
5094# server will present them as named exports; for example, another
5095# QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
5096#
5097# @addr: Address on which to listen.
5098# @tls-creds: ID of the TLS credentials object (since 2.6).
5099# @tls-authz: ID of the QAuthZ authorization object used to validate
5100# the client's x509 distinguished name. This object is
5101# is only resolved at time of use, so can be deleted and
5102# recreated on the fly while the NBD server is active.
5103# If missing, it will default to denying access (since 4.0).
5104#
5105# Returns: error if the server is already running.
5106#
eed8b691
KW
5107# Keep this type consistent with the NbdServerOptions type. The only intended
5108# difference is using SocketAddressLegacy instead of SocketAddress.
5109#
b3cf1ec0
KW
5110# Since: 1.3.0
5111##
5112{ 'command': 'nbd-server-start',
5113 'data': { 'addr': 'SocketAddressLegacy',
5114 '*tls-creds': 'str',
5115 '*tls-authz': 'str'} }
5116
5117##
c62d24e9 5118# @BlockExportNbd:
b3cf1ec0 5119#
c62d24e9 5120# An NBD block export.
b3cf1ec0
KW
5121#
5122# @device: The device name or node name of the node to be exported
5123#
5124# @name: Export name. If unspecified, the @device parameter is used as the
5125# export name. (Since 2.12)
5126#
5127# @description: Free-form description of the export, up to 4096 bytes.
5128# (Since 5.0)
5129#
5130# @writable: Whether clients should be able to write to the device via the
5131# NBD connection (default false).
5132#
5133# @bitmap: Also export the dirty bitmap reachable from @device, so the
5134# NBD client can use NBD_OPT_SET_META_CONTEXT with
5135# "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)
5136#
c62d24e9
KW
5137# Since: 5.0
5138##
5139{ 'struct': 'BlockExportNbd',
5140 'data': {'device': 'str', '*name': 'str', '*description': 'str',
5141 '*writable': 'bool', '*bitmap': 'str' } }
5142
5143##
5144# @nbd-server-add:
5145#
5146# Export a block node to QEMU's embedded NBD server.
5147#
b3cf1ec0
KW
5148# Returns: error if the server is not running, or export with the same name
5149# already exists.
5150#
5151# Since: 1.3.0
5152##
5153{ 'command': 'nbd-server-add',
c62d24e9 5154 'data': 'BlockExportNbd', 'boxed': true }
b3cf1ec0
KW
5155
5156##
5157# @NbdServerRemoveMode:
5158#
5159# Mode for removing an NBD export.
5160#
5161# @safe: Remove export if there are no existing connections, fail otherwise.
5162#
5163# @hard: Drop all connections immediately and remove export.
5164#
5165# Potential additional modes to be added in the future:
5166#
5167# hide: Just hide export from new clients, leave existing connections as is.
5168# Remove export after all clients are disconnected.
5169#
5170# soft: Hide export from new clients, answer with ESHUTDOWN for all further
5171# requests from existing clients.
5172#
5173# Since: 2.12
5174##
5175{'enum': 'NbdServerRemoveMode', 'data': ['safe', 'hard']}
5176
5177##
5178# @nbd-server-remove:
5179#
5180# Remove NBD export by name.
5181#
5182# @name: Export name.
5183#
5184# @mode: Mode of command operation. See @NbdServerRemoveMode description.
5185# Default is 'safe'.
5186#
5187# Returns: error if
5188# - the server is not running
5189# - export is not found
5190# - mode is 'safe' and there are existing connections
5191#
5192# Since: 2.12
5193##
5194{ 'command': 'nbd-server-remove',
5195 'data': {'name': 'str', '*mode': 'NbdServerRemoveMode'} }
5196
5197##
5198# @nbd-server-stop:
5199#
5200# Stop QEMU's embedded NBD server, and unregister all devices previously
5201# added via @nbd-server-add.
5202#
5203# Since: 1.3.0
5204##
5205{ 'command': 'nbd-server-stop' }
5206
39411120
KW
5207##
5208# @BlockExportType:
5209#
5210# An enumeration of block export types
5211#
5212# @nbd: NBD export
5213#
5214# Since: 4.2
5215##
5216{ 'enum': 'BlockExportType',
5217 'data': [ 'nbd' ] }
5218
5219##
5220# @BlockExport:
5221#
5222# Describes a block export, i.e. how single node should be exported on an
5223# external interface.
5224#
5225# Since: 4.2
5226##
5227{ 'union': 'BlockExport',
5228 'base': { 'type': 'BlockExportType' },
5229 'discriminator': 'type',
5230 'data': {
5231 'nbd': 'BlockExportNbd'
5232 } }
5233
b3cf1ec0
KW
5234##
5235# @QuorumOpType:
5236#
5237# An enumeration of the quorum operation types
5238#
5239# @read: read operation
5240#
5241# @write: write operation
5242#
5243# @flush: flush operation
5244#
5245# Since: 2.6
5246##
5247{ 'enum': 'QuorumOpType',
5248 'data': [ 'read', 'write', 'flush' ] }
5249
5250##
5251# @QUORUM_FAILURE:
5252#
5253# Emitted by the Quorum block driver if it fails to establish a quorum
5254#
5255# @reference: device name if defined else node name
5256#
5257# @sector-num: number of the first sector of the failed read operation
5258#
5259# @sectors-count: failed read operation sector count
5260#
5261# Note: This event is rate-limited.
5262#
5263# Since: 2.0
5264#
5265# Example:
5266#
5267# <- { "event": "QUORUM_FAILURE",
5268# "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
5269# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5270#
5271##
5272{ 'event': 'QUORUM_FAILURE',
5273 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
5274
5275##
5276# @QUORUM_REPORT_BAD:
5277#
5278# Emitted to report a corruption of a Quorum file
5279#
5280# @type: quorum operation type (Since 2.6)
5281#
5282# @error: error message. Only present on failure. This field
5283# contains a human-readable error message. There are no semantics other
5284# than that the block layer reported an error and clients should not
5285# try to interpret the error string.
5286#
5287# @node-name: the graph node name of the block driver state
5288#
5289# @sector-num: number of the first sector of the failed read operation
5290#
5291# @sectors-count: failed read operation sector count
5292#
5293# Note: This event is rate-limited.
5294#
5295# Since: 2.0
5296#
5297# Example:
5298#
5299# 1. Read operation
5300#
5301# { "event": "QUORUM_REPORT_BAD",
5302# "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
5303# "type": "read" },
5304# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5305#
5306# 2. Flush operation
5307#
5308# { "event": "QUORUM_REPORT_BAD",
5309# "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
5310# "type": "flush", "error": "Broken pipe" },
5311# "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
5312#
5313##
5314{ 'event': 'QUORUM_REPORT_BAD',
5315 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
5316 'sector-num': 'int', 'sectors-count': 'int' } }
5317
5318##
5319# @BlockdevSnapshotInternal:
5320#
5321# @device: the device name or node-name of a root node to generate the snapshot
5322# from
5323#
5324# @name: the name of the internal snapshot to be created
5325#
5326# Notes: In transaction, if @name is empty, or any snapshot matching @name
5327# exists, the operation will fail. Only some image formats support it,
5328# for example, qcow2, rbd, and sheepdog.
5329#
5330# Since: 1.7
5331##
5332{ 'struct': 'BlockdevSnapshotInternal',
5333 'data': { 'device': 'str', 'name': 'str' } }
5334
5335##
5336# @blockdev-snapshot-internal-sync:
5337#
5338# Synchronously take an internal snapshot of a block device, when the
5339# format of the image used supports it. If the name is an empty
5340# string, or a snapshot with name already exists, the operation will
5341# fail.
5342#
5343# For the arguments, see the documentation of BlockdevSnapshotInternal.
5344#
5345# Returns: - nothing on success
5346# - If @device is not a valid block device, GenericError
5347# - If any snapshot matching @name exists, or @name is empty,
5348# GenericError
5349# - If the format of the image used does not support it,
5350# BlockFormatFeatureNotSupported
5351#
5352# Since: 1.7
5353#
5354# Example:
5355#
5356# -> { "execute": "blockdev-snapshot-internal-sync",
5357# "arguments": { "device": "ide-hd0",
5358# "name": "snapshot0" }
5359# }
5360# <- { "return": {} }
5361#
5362##
5363{ 'command': 'blockdev-snapshot-internal-sync',
5364 'data': 'BlockdevSnapshotInternal' }
5365
5366##
5367# @blockdev-snapshot-delete-internal-sync:
5368#
5369# Synchronously delete an internal snapshot of a block device, when the format
5370# of the image used support it. The snapshot is identified by name or id or
5371# both. One of the name or id is required. Return SnapshotInfo for the
5372# successfully deleted snapshot.
5373#
5374# @device: the device name or node-name of a root node to delete the snapshot
5375# from
5376#
5377# @id: optional the snapshot's ID to be deleted
5378#
5379# @name: optional the snapshot's name to be deleted
5380#
5381# Returns: - SnapshotInfo on success
5382# - If @device is not a valid block device, GenericError
5383# - If snapshot not found, GenericError
5384# - If the format of the image used does not support it,
5385# BlockFormatFeatureNotSupported
5386# - If @id and @name are both not specified, GenericError
5387#
5388# Since: 1.7
5389#
5390# Example:
5391#
5392# -> { "execute": "blockdev-snapshot-delete-internal-sync",
5393# "arguments": { "device": "ide-hd0",
5394# "name": "snapshot0" }
5395# }
5396# <- { "return": {
5397# "id": "1",
5398# "name": "snapshot0",
5399# "vm-state-size": 0,
5400# "date-sec": 1000012,
5401# "date-nsec": 10,
5402# "vm-clock-sec": 100,
5403# "vm-clock-nsec": 20
5404# }
5405# }
5406#
5407##
5408{ 'command': 'blockdev-snapshot-delete-internal-sync',
5409 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
5410 'returns': 'SnapshotInfo' }