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