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