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