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