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