xref: /openbmc/qemu/qapi/block-core.json (revision cad9aa6fbdccd95e56e10cfa57c354a20a333717)
1# -*- Mode: Python -*-
2# vim: filetype=python
3
4##
5# Block core (VM unrelated)
6# =========================
7##
8
9{ 'include': 'common.json' }
10{ 'include': 'crypto.json' }
11{ 'include': 'job.json' }
12{ 'include': 'sockets.json' }
13
14##
15# @SnapshotInfo:
16#
17# @id: unique snapshot id
18#
19# @name: user chosen name
20#
21# @vm-state-size: size of the VM state
22#
23# @date-sec: UTC date of the snapshot in seconds
24#
25# @date-nsec: fractional part in nano seconds to be used with date-sec
26#
27# @vm-clock-sec: VM clock relative to boot in seconds
28#
29# @vm-clock-nsec: fractional part in nano seconds to be used with
30#     vm-clock-sec
31#
32# @icount: Current instruction count.  Appears when execution
33#     record/replay is enabled.  Used for "time-traveling" to match
34#     the moment in the recorded execution with the snapshots.  This
35#     counter may be obtained through `query-replay` command
36#     (since 5.2)
37#
38# Since: 1.3
39##
40{ 'struct': 'SnapshotInfo',
41  'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
42            'date-sec': 'int', 'date-nsec': 'int',
43            'vm-clock-sec': 'int', 'vm-clock-nsec': 'int',
44            '*icount': 'int' } }
45
46##
47# @ImageInfoSpecificQCow2EncryptionBase:
48#
49# @format: The encryption format
50#
51# Since: 2.10
52##
53{ 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
54  'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
55
56##
57# @ImageInfoSpecificQCow2Encryption:
58#
59# Since: 2.10
60##
61{ 'union': 'ImageInfoSpecificQCow2Encryption',
62  'base': 'ImageInfoSpecificQCow2EncryptionBase',
63  'discriminator': 'format',
64  'data': { 'luks': 'QCryptoBlockInfoLUKS' } }
65
66##
67# @ImageInfoSpecificQCow2:
68#
69# @compat: compatibility level
70#
71# @data-file: the filename of the external data file that is stored in
72#     the image and used as a default for opening the image
73#     (since: 4.0)
74#
75# @data-file-raw: True if the external data file must stay valid as a
76#     standalone (read-only) raw image without looking at qcow2
77#     metadata (since: 4.0)
78#
79# @extended-l2: true if the image has extended L2 entries; only valid
80#     for compat >= 1.1 (since 5.2)
81#
82# @lazy-refcounts: on or off; only valid for compat >= 1.1
83#
84# @corrupt: true if the image has been marked corrupt; only valid for
85#     compat >= 1.1 (since 2.2)
86#
87# @refcount-bits: width of a refcount entry in bits (since 2.3)
88#
89# @encrypt: details about encryption parameters; only set if image is
90#     encrypted (since 2.10)
91#
92# @bitmaps: A list of qcow2 bitmap details (since 4.0)
93#
94# @compression-type: the image cluster compression method (since 5.1)
95#
96# Since: 1.7
97##
98{ 'struct': 'ImageInfoSpecificQCow2',
99  'data': {
100      'compat': 'str',
101      '*data-file': 'str',
102      '*data-file-raw': 'bool',
103      '*extended-l2': 'bool',
104      '*lazy-refcounts': 'bool',
105      '*corrupt': 'bool',
106      'refcount-bits': 'int',
107      '*encrypt': 'ImageInfoSpecificQCow2Encryption',
108      '*bitmaps': ['Qcow2BitmapInfo'],
109      'compression-type': 'Qcow2CompressionType'
110  } }
111
112##
113# @ImageInfoSpecificVmdk:
114#
115# @create-type: The create type of VMDK image
116#
117# @cid: Content id of image
118#
119# @parent-cid: Parent VMDK image's cid
120#
121# @extents: List of extent files
122#
123# Since: 1.7
124##
125{ 'struct': 'ImageInfoSpecificVmdk',
126  'data': {
127      'create-type': 'str',
128      'cid': 'int',
129      'parent-cid': 'int',
130      'extents': ['VmdkExtentInfo']
131  } }
132
133##
134# @VmdkExtentInfo:
135#
136# Information about a VMDK extent file
137#
138# @filename: Name of the extent file
139#
140# @format: Extent type (e.g. FLAT or SPARSE)
141#
142# @virtual-size: Number of bytes covered by this extent
143#
144# @cluster-size: Cluster size in bytes (for non-flat extents)
145#
146# @compressed: Whether this extent contains compressed data
147#
148# Since: 8.0
149##
150{ 'struct': 'VmdkExtentInfo',
151  'data': {
152      'filename': 'str',
153      'format': 'str',
154      'virtual-size': 'int',
155      '*cluster-size': 'int',
156      '*compressed': 'bool'
157  } }
158
159##
160# @ImageInfoSpecificRbd:
161#
162# @encryption-format: Image encryption format
163#
164# Since: 6.1
165##
166{ 'struct': 'ImageInfoSpecificRbd',
167  'data': {
168      '*encryption-format': 'RbdImageEncryptionFormat'
169  } }
170
171##
172# @ImageInfoSpecificFile:
173#
174# @extent-size-hint: Extent size hint (if available)
175#
176# Since: 8.0
177##
178{ 'struct': 'ImageInfoSpecificFile',
179  'data': {
180      '*extent-size-hint': 'size'
181  } }
182
183##
184# @ImageInfoSpecificKind:
185#
186# @luks: Since 2.7
187#
188# @rbd: Since 6.1
189#
190# @file: Since 8.0
191#
192# Since: 1.7
193##
194{ 'enum': 'ImageInfoSpecificKind',
195  'data': [ 'qcow2', 'vmdk', 'luks', 'rbd', 'file' ] }
196
197##
198# @ImageInfoSpecificQCow2Wrapper:
199#
200# @data: image information specific to QCOW2
201#
202# Since: 1.7
203##
204{ 'struct': 'ImageInfoSpecificQCow2Wrapper',
205  'data': { 'data': 'ImageInfoSpecificQCow2' } }
206
207##
208# @ImageInfoSpecificVmdkWrapper:
209#
210# @data: image information specific to VMDK
211#
212# Since: 6.1
213##
214{ 'struct': 'ImageInfoSpecificVmdkWrapper',
215  'data': { 'data': 'ImageInfoSpecificVmdk' } }
216
217##
218# @ImageInfoSpecificLUKSWrapper:
219#
220# @data: image information specific to LUKS
221#
222# Since: 2.7
223##
224{ 'struct': 'ImageInfoSpecificLUKSWrapper',
225  'data': { 'data': 'QCryptoBlockInfoLUKS' } }
226# If we need to add block driver specific parameters for
227# LUKS in future, then we'll subclass `QCryptoBlockInfoLUKS`
228# to define a ImageInfoSpecificLUKS
229
230##
231# @ImageInfoSpecificRbdWrapper:
232#
233# @data: image information specific to RBD
234#
235# Since: 6.1
236##
237{ 'struct': 'ImageInfoSpecificRbdWrapper',
238  'data': { 'data': 'ImageInfoSpecificRbd' } }
239
240##
241# @ImageInfoSpecificFileWrapper:
242#
243# @data: image information specific to files
244#
245# Since: 8.0
246##
247{ 'struct': 'ImageInfoSpecificFileWrapper',
248  'data': { 'data': 'ImageInfoSpecificFile' } }
249
250##
251# @ImageInfoSpecific:
252#
253# A discriminated record of image format specific information
254# structures.
255#
256# @type: block driver name
257#
258# Since: 1.7
259##
260{ 'union': 'ImageInfoSpecific',
261  'base': { 'type': 'ImageInfoSpecificKind' },
262  'discriminator': 'type',
263  'data': {
264      'qcow2': 'ImageInfoSpecificQCow2Wrapper',
265      'vmdk': 'ImageInfoSpecificVmdkWrapper',
266      'luks': 'ImageInfoSpecificLUKSWrapper',
267      'rbd': 'ImageInfoSpecificRbdWrapper',
268      'file': 'ImageInfoSpecificFileWrapper'
269  } }
270
271##
272# @BlockNodeInfo:
273#
274# Information about a QEMU image file
275#
276# @filename: name of the image file
277#
278# @format: format of the image file
279#
280# @virtual-size: maximum capacity in bytes of the image
281#
282# @actual-size: actual size on disk in bytes of the image
283#
284# @dirty-flag: true if image is not cleanly closed
285#
286# @cluster-size: size of a cluster in bytes
287#
288# @encrypted: true if the image is encrypted
289#
290# @compressed: true if the image is compressed (Since 1.7)
291#
292# @backing-filename: name of the backing file
293#
294# @full-backing-filename: full path of the backing file
295#
296# @backing-filename-format: the format of the backing file
297#
298# @snapshots: list of VM snapshots
299#
300# @format-specific: structure supplying additional format-specific
301#     information (since 1.7)
302#
303# Since: 8.0
304##
305{ 'struct': 'BlockNodeInfo',
306  'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
307           '*actual-size': 'int', 'virtual-size': 'int',
308           '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
309           '*backing-filename': 'str', '*full-backing-filename': 'str',
310           '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
311           '*format-specific': 'ImageInfoSpecific' } }
312
313##
314# @ImageInfo:
315#
316# Information about a QEMU image file, and potentially its backing
317# image
318#
319# @backing-image: info of the backing image
320#
321# Since: 1.3
322##
323{ 'struct': 'ImageInfo',
324  'base': 'BlockNodeInfo',
325  'data': {
326      '*backing-image': 'ImageInfo'
327  } }
328
329##
330# @BlockChildInfo:
331#
332# Information about all nodes in the block graph starting at some
333# node, annotated with information about that node in relation to its
334# parent.
335#
336# @name: Child name of the root node in the `BlockGraphInfo` struct, in
337#     its role as the child of some undescribed parent node
338#
339# @info: Block graph information starting at this node
340#
341# Since: 8.0
342##
343{ 'struct': 'BlockChildInfo',
344  'data': {
345      'name': 'str',
346      'info': 'BlockGraphInfo'
347  } }
348
349##
350# @BlockGraphInfo:
351#
352# Information about all nodes in a block (sub)graph in the form of
353# `BlockNodeInfo` data.  The base `BlockNodeInfo` struct contains the
354# information for the (sub)graph's root node.
355#
356# @children: Array of links to this node's child nodes' information
357#
358# Since: 8.0
359##
360{ 'struct': 'BlockGraphInfo',
361  'base': 'BlockNodeInfo',
362  'data': { 'children': ['BlockChildInfo'] } }
363
364##
365# @ImageCheck:
366#
367# Information about a QEMU image file check
368#
369# @filename: name of the image file checked
370#
371# @format: format of the image file checked
372#
373# @check-errors: number of unexpected errors occurred during check
374#
375# @image-end-offset: offset (in bytes) where the image ends, this
376#     field is present if the driver for the image format supports it
377#
378# @corruptions: number of corruptions found during the check if any
379#
380# @leaks: number of leaks found during the check if any
381#
382# @corruptions-fixed: number of corruptions fixed during the check if
383#     any
384#
385# @leaks-fixed: number of leaks fixed during the check if any
386#
387# @total-clusters: total number of clusters, this field is present if
388#     the driver for the image format supports it
389#
390# @allocated-clusters: total number of allocated clusters, this field
391#     is present if the driver for the image format supports it
392#
393# @fragmented-clusters: total number of fragmented clusters, this
394#     field is present if the driver for the image format supports it
395#
396# @compressed-clusters: total number of compressed clusters, this
397#     field is present if the driver for the image format supports it
398#
399# Since: 1.4
400##
401{ 'struct': 'ImageCheck',
402  'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
403           '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
404           '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
405           '*total-clusters': 'int', '*allocated-clusters': 'int',
406           '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
407
408##
409# @MapEntry:
410#
411# Mapping information from a virtual block range to a host file range
412#
413# @start: virtual (guest) offset of the first byte described by this
414#     entry
415#
416# @length: the number of bytes of the mapped virtual range
417#
418# @data: reading the image will actually read data from a file (in
419#     particular, if @offset is present this means that the sectors
420#     are not simply preallocated, but contain actual data in raw
421#     format)
422#
423# @zero: whether the virtual blocks read as zeroes
424#
425# @compressed: true if the data is stored compressed (since 8.2)
426#
427# @depth: number of layers (0 = top image, 1 = top image's backing
428#     file, ..., n - 1 = bottom image (where n is the number of images
429#     in the chain)) before reaching one for which the range is
430#     allocated
431#
432# @present: true if this layer provides the data, false if adding a
433#     backing layer could impact this region (since 6.1)
434#
435# @offset: if present, the image file stores the data for this range
436#     in raw format at the given (host) offset
437#
438# @filename: filename that is referred to by @offset
439#
440# Since: 2.6
441##
442{ 'struct': 'MapEntry',
443  'data': {'start': 'int', 'length': 'int', 'data': 'bool',
444           'zero': 'bool', 'compressed': 'bool', 'depth': 'int',
445           'present': 'bool', '*offset': 'int', '*filename': 'str' } }
446
447##
448# @BlockdevCacheInfo:
449#
450# Cache mode information for a block device
451#
452# @writeback: true if writeback mode is enabled
453#
454# @direct: true if the host page cache is bypassed (O_DIRECT)
455#
456# @no-flush: true if flush requests are ignored for the device
457#
458# Since: 2.3
459##
460{ 'struct': 'BlockdevCacheInfo',
461  'data': { 'writeback': 'bool',
462            'direct': 'bool',
463            'no-flush': 'bool' } }
464
465##
466# @BlockdevChild:
467#
468# @child: The name of the child, for example 'file' or 'backing'.
469#
470# @node-name: The name of the child's block driver node.
471#
472# Since: 10.1
473##
474{ 'struct': 'BlockdevChild',
475  'data': { 'child': 'str',
476            'node-name': 'str' } }
477
478##
479# @BlockDeviceInfo:
480#
481# Information about the backing device for a block device.
482#
483# @file: the filename of the backing device
484#
485# @node-name: the name of the block driver node (Since 2.0)
486#
487# @ro: true if the backing device was open read-only
488#
489# @drv: the name of the block format used to open the backing device.
490#     As of 0.14 this can be: 'blkdebug', 'bochs', 'cloop', 'cow',
491#     'dmg', 'file', 'file', 'ftp', 'ftps', 'host_cdrom',
492#     'host_device', 'http', 'https', 'luks', 'nbd', 'parallels',
493#     'qcow', 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat' 2.2:
494#     'archipelago' added, 'cow' dropped 2.3: 'host_floppy' deprecated
495#     2.5: 'host_floppy' dropped 2.6: 'luks' added 2.8: 'replication'
496#     added, 'tftp' dropped 2.9: 'archipelago' dropped
497#
498# @backing_file: the name of the backing file (for copy-on-write)
499#
500# @backing_file_depth: number of files in the backing file chain
501#     (since: 1.2)
502#
503# @children: Information about child block nodes. (since: 10.1)
504#
505# @active: true if the backend is active; typical cases for inactive backends
506#     are on the migration source instance after migration completes and on the
507#     destination before it completes.  (since: 10.0)
508#
509# @encrypted: true if the backing device is encrypted
510#
511# @detect_zeroes: detect and optimize zero writes (Since 2.1)
512#
513# @bps: total throughput limit in bytes per second is specified
514#
515# @bps_rd: read throughput limit in bytes per second is specified
516#
517# @bps_wr: write throughput limit in bytes per second is specified
518#
519# @iops: total I/O operations per second is specified
520#
521# @iops_rd: read I/O operations per second is specified
522#
523# @iops_wr: write I/O operations per second is specified
524#
525# @image: the info of image used (since: 1.6)
526#
527# @bps_max: total throughput limit during bursts, in bytes (Since 1.7)
528#
529# @bps_rd_max: read throughput limit during bursts, in bytes
530#     (Since 1.7)
531#
532# @bps_wr_max: write throughput limit during bursts, in bytes
533#     (Since 1.7)
534#
535# @iops_max: total I/O operations per second during bursts, in bytes
536#     (Since 1.7)
537#
538# @iops_rd_max: read I/O operations per second during bursts, in bytes
539#     (Since 1.7)
540#
541# @iops_wr_max: write I/O operations per second during bursts, in
542#     bytes (Since 1.7)
543#
544# @bps_max_length: maximum length of the @bps_max burst period, in
545#     seconds.  (Since 2.6)
546#
547# @bps_rd_max_length: maximum length of the @bps_rd_max burst period,
548#     in seconds.  (Since 2.6)
549#
550# @bps_wr_max_length: maximum length of the @bps_wr_max burst period,
551#     in seconds.  (Since 2.6)
552#
553# @iops_max_length: maximum length of the @iops burst period, in
554#     seconds.  (Since 2.6)
555#
556# @iops_rd_max_length: maximum length of the @iops_rd_max burst
557#     period, in seconds.  (Since 2.6)
558#
559# @iops_wr_max_length: maximum length of the @iops_wr_max burst
560#     period, in seconds.  (Since 2.6)
561#
562# @iops_size: an I/O size in bytes (Since 1.7)
563#
564# @group: throttle group name (Since 2.4)
565#
566# @cache: the cache mode used for the block device (since: 2.3)
567#
568# @write_threshold: configured write threshold for the device.  0 if
569#     disabled.  (Since 2.3)
570#
571# @dirty-bitmaps: dirty bitmaps information (only present if node has
572#     one or more dirty bitmaps) (Since 4.2)
573#
574# Since: 0.14
575##
576{ 'struct': 'BlockDeviceInfo',
577  'data': { 'file': 'str', 'node-name': 'str', 'ro': 'bool', 'drv': 'str',
578            '*backing_file': 'str', 'backing_file_depth': 'int',
579            'children': ['BlockdevChild'],
580            'active': 'bool', 'encrypted': 'bool',
581            'detect_zeroes': 'BlockdevDetectZeroesOptions',
582            'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
583            'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
584            'image': 'ImageInfo',
585            '*bps_max': 'int', '*bps_rd_max': 'int',
586            '*bps_wr_max': 'int', '*iops_max': 'int',
587            '*iops_rd_max': 'int', '*iops_wr_max': 'int',
588            '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
589            '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
590            '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
591            '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
592            'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
593
594##
595# @BlockDeviceIoStatus:
596#
597# An enumeration of block device I/O status.
598#
599# @ok: The last I/O operation has succeeded
600#
601# @failed: The last I/O operation has failed
602#
603# @nospace: The last I/O operation has failed due to a no-space
604#     condition
605#
606# Since: 1.0
607##
608{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
609
610##
611# @BlockDirtyInfo:
612#
613# Block dirty bitmap information.
614#
615# @name: the name of the dirty bitmap (Since 2.4)
616#
617# @count: number of dirty bytes according to the dirty bitmap
618#
619# @granularity: granularity of the dirty bitmap in bytes (since 1.4)
620#
621# @recording: true if the bitmap is recording new writes from the
622#     guest.  (since 4.0)
623#
624# @busy: true if the bitmap is in-use by some operation (NBD or jobs)
625#     and cannot be modified via QMP or used by another operation.
626#     (since 4.0)
627#
628# @persistent: true if the bitmap was stored on disk, is scheduled to
629#     be stored on disk, or both.  (since 4.0)
630#
631# @inconsistent: true if this is a persistent bitmap that was
632#     improperly stored.  Implies @persistent to be true; @recording
633#     and @busy to be false.  This bitmap cannot be used.  To remove
634#     it, use `block-dirty-bitmap-remove`.  (Since 4.0)
635#
636# Since: 1.3
637##
638{ 'struct': 'BlockDirtyInfo',
639  'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
640           'recording': 'bool', 'busy': 'bool',
641           'persistent': 'bool', '*inconsistent': 'bool' } }
642
643##
644# @Qcow2BitmapInfoFlags:
645#
646# An enumeration of flags that a bitmap can report to the user.
647#
648# @in-use: This flag is set by any process actively modifying the
649#     qcow2 file, and cleared when the updated bitmap is flushed to
650#     the qcow2 image.  The presence of this flag in an offline image
651#     means that the bitmap was not saved correctly after its last
652#     usage, and may contain inconsistent data.
653#
654# @auto: The bitmap must reflect all changes of the virtual disk by
655#     any application that would write to this qcow2 file.
656#
657# Since: 4.0
658##
659{ 'enum': 'Qcow2BitmapInfoFlags',
660  'data': ['in-use', 'auto'] }
661
662##
663# @Qcow2BitmapInfo:
664#
665# Qcow2 bitmap information.
666#
667# @name: the name of the bitmap
668#
669# @granularity: granularity of the bitmap in bytes
670#
671# @flags: flags of the bitmap
672#
673# Since: 4.0
674##
675{ 'struct': 'Qcow2BitmapInfo',
676  'data': {'name': 'str', 'granularity': 'uint32',
677           'flags': ['Qcow2BitmapInfoFlags'] } }
678
679##
680# @BlockLatencyHistogramInfo:
681#
682# Block latency histogram.
683#
684# @boundaries: list of interval boundary values in nanoseconds, all
685#     greater than zero and in ascending order.  For example, the list
686#     [10, 50, 100] produces the following histogram intervals: [0,
687#     10), [10, 50), [50, 100), [100, +inf).
688#
689# @bins: list of io request counts corresponding to histogram
690#     intervals, one more element than @boundaries has.  For the
691#     example above, @bins may be something like [3, 1, 5, 2], and
692#     corresponding histogram looks like::
693#
694#        5|           *
695#        4|           *
696#        3| *         *
697#        2| *         *    *
698#        1| *    *    *    *
699#         +------------------
700#             10   50   100
701#
702# Since: 4.0
703##
704{ 'struct': 'BlockLatencyHistogramInfo',
705  'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
706
707##
708# @BlockInfo:
709#
710# Block device information.  This structure describes a virtual device
711# and the backing device associated with it.
712#
713# @device: The device name associated with the virtual device.
714#
715# @qdev: The qdev ID, or if no ID is assigned, the QOM path of the
716#     block device.  (since 2.10)
717#
718# @type: This field is returned only for compatibility reasons, it
719#     should not be used (always returns 'unknown')
720#
721# @removable: True if the device supports removable media.
722#
723# @locked: True if the guest has locked this device from having its
724#     media removed
725#
726# @tray_open: True if the device's tray is open (only present if it
727#     has a tray)
728#
729# @io-status: `BlockDeviceIoStatus`.  Only present if the device
730#     supports it and the VM is configured to stop on errors
731#     (supported device models: virtio-blk, IDE, SCSI except
732#     scsi-generic)
733#
734# @inserted: `BlockDeviceInfo` describing the device if media is
735#     present
736#
737# Since: 0.14
738##
739{ 'struct': 'BlockInfo',
740  'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
741           'locked': 'bool', '*inserted': 'BlockDeviceInfo',
742           '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus' } }
743
744##
745# @BlockMeasureInfo:
746#
747# Image file size calculation information.  This structure describes
748# the size requirements for creating a new image file.
749#
750# The size requirements depend on the new image file format.  File
751# size always equals virtual disk size for the 'raw' format, even for
752# sparse POSIX files.  Compact formats such as 'qcow2' represent
753# unallocated and zero regions efficiently so file size may be smaller
754# than virtual disk size.
755#
756# The values are upper bounds that are guaranteed to fit the new image
757# file.  Subsequent modification, such as internal snapshot or further
758# bitmap creation, may require additional space and is not covered
759# here.
760#
761# @required: Size required for a new image file, in bytes, when
762#     copying just allocated guest-visible contents.
763#
764# @fully-allocated: Image file size, in bytes, once data has been
765#     written to all sectors, when copying just guest-visible
766#     contents.
767#
768# @bitmaps: Additional size required if all the top-level bitmap
769#     metadata in the source image were to be copied to the
770#     destination, present only when source and destination both
771#     support persistent bitmaps.  (since 5.1)
772#
773# Since: 2.10
774##
775{ 'struct': 'BlockMeasureInfo',
776  'data': {'required': 'int', 'fully-allocated': 'int', '*bitmaps': 'int'} }
777
778##
779# @query-block:
780#
781# Get a list of `BlockInfo` for all virtual block devices.
782#
783# Returns: a list describing each virtual block device.
784#     Filter nodes that were created implicitly are skipped over.
785#
786# Since: 0.14
787#
788# .. qmp-example::
789#
790#     -> { "execute": "query-block" }
791#     <- {
792#           "return":[
793#              {
794#                 "io-status": "ok",
795#                 "device":"ide0-hd0",
796#                 "locked":false,
797#                 "removable":false,
798#                 "inserted":{
799#                    "ro":false,
800#                    "drv":"qcow2",
801#                    "encrypted":false,
802#                    "file":"disks/test.qcow2",
803#                    "backing_file_depth":1,
804#                    "bps":1000000,
805#                    "bps_rd":0,
806#                    "bps_wr":0,
807#                    "iops":1000000,
808#                    "iops_rd":0,
809#                    "iops_wr":0,
810#                    "bps_max": 8000000,
811#                    "bps_rd_max": 0,
812#                    "bps_wr_max": 0,
813#                    "iops_max": 0,
814#                    "iops_rd_max": 0,
815#                    "iops_wr_max": 0,
816#                    "iops_size": 0,
817#                    "detect_zeroes": "on",
818#                    "write_threshold": 0,
819#                    "image":{
820#                       "filename":"disks/test.qcow2",
821#                       "format":"qcow2",
822#                       "virtual-size":2048000,
823#                       "backing_file":"base.qcow2",
824#                       "full-backing-filename":"disks/base.qcow2",
825#                       "backing-filename-format":"qcow2",
826#                       "snapshots":[
827#                          {
828#                             "id": "1",
829#                             "name": "snapshot1",
830#                             "vm-state-size": 0,
831#                             "date-sec": 10000200,
832#                             "date-nsec": 12,
833#                             "vm-clock-sec": 206,
834#                             "vm-clock-nsec": 30
835#                          }
836#                       ],
837#                       "backing-image":{
838#                           "filename":"disks/base.qcow2",
839#                           "format":"qcow2",
840#                           "virtual-size":2048000
841#                       }
842#                    }
843#                 },
844#                 "qdev": "ide_disk",
845#                 "type":"unknown"
846#              },
847#              {
848#                 "io-status": "ok",
849#                 "device":"ide1-cd0",
850#                 "locked":false,
851#                 "removable":true,
852#                 "qdev": "/machine/unattached/device[23]",
853#                 "tray_open": false,
854#                 "type":"unknown"
855#              },
856#              {
857#                 "device":"floppy0",
858#                 "locked":false,
859#                 "removable":true,
860#                 "qdev": "/machine/unattached/device[20]",
861#                 "type":"unknown"
862#              },
863#              {
864#                 "device":"sd0",
865#                 "locked":false,
866#                 "removable":true,
867#                 "type":"unknown"
868#              }
869#           ]
870#        }
871##
872{ 'command': 'query-block', 'returns': ['BlockInfo'],
873  'allow-preconfig': true }
874
875##
876# @BlockDeviceTimedStats:
877#
878# Statistics of a block device during a given interval of time.
879#
880# @interval_length: Interval used for calculating the statistics, in
881#     seconds.
882#
883# @min_rd_latency_ns: Minimum latency of read operations in the
884#     defined interval, in nanoseconds.
885#
886# @min_wr_latency_ns: Minimum latency of write operations in the
887#     defined interval, in nanoseconds.
888#
889# @min_zone_append_latency_ns: Minimum latency of zone append
890#     operations in the defined interval, in nanoseconds (since 8.1)
891#
892# @min_flush_latency_ns: Minimum latency of flush operations in the
893#     defined interval, in nanoseconds.
894#
895# @max_rd_latency_ns: Maximum latency of read operations in the
896#     defined interval, in nanoseconds.
897#
898# @max_wr_latency_ns: Maximum latency of write operations in the
899#     defined interval, in nanoseconds.
900#
901# @max_zone_append_latency_ns: Maximum latency of zone append
902#     operations in the defined interval, in nanoseconds (since 8.1)
903#
904# @max_flush_latency_ns: Maximum latency of flush operations in the
905#     defined interval, in nanoseconds.
906#
907# @avg_rd_latency_ns: Average latency of read operations in the
908#     defined interval, in nanoseconds.
909#
910# @avg_wr_latency_ns: Average latency of write operations in the
911#     defined interval, in nanoseconds.
912#
913# @avg_zone_append_latency_ns: Average latency of zone append
914#     operations in the defined interval, in nanoseconds (since 8.1)
915#
916# @avg_flush_latency_ns: Average latency of flush operations in the
917#     defined interval, in nanoseconds.
918#
919# @avg_rd_queue_depth: Average number of pending read operations in
920#     the defined interval.
921#
922# @avg_wr_queue_depth: Average number of pending write operations in
923#     the defined interval.
924#
925# @avg_zone_append_queue_depth: Average number of pending zone append
926#     operations in the defined interval (since 8.1).
927#
928# Since: 2.5
929##
930{ 'struct': 'BlockDeviceTimedStats',
931  'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
932            'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
933            'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
934            'avg_wr_latency_ns': 'int', 'min_zone_append_latency_ns': 'int',
935            'max_zone_append_latency_ns': 'int',
936            'avg_zone_append_latency_ns': 'int',
937            'min_flush_latency_ns': 'int', 'max_flush_latency_ns': 'int',
938            'avg_flush_latency_ns': 'int', 'avg_rd_queue_depth': 'number',
939            'avg_wr_queue_depth': 'number',
940            'avg_zone_append_queue_depth': 'number'  } }
941
942##
943# @BlockDeviceStats:
944#
945# Statistics of a virtual block device or a block backing device.
946#
947# @rd_bytes: The number of bytes read by the device.
948#
949# @wr_bytes: The number of bytes written by the device.
950#
951# @zone_append_bytes: The number of bytes appended by the zoned
952#     devices (since 8.1)
953#
954# @unmap_bytes: The number of bytes unmapped by the device (Since 4.2)
955#
956# @rd_operations: The number of read operations performed by the
957#     device.
958#
959# @wr_operations: The number of write operations performed by the
960#     device.
961#
962# @zone_append_operations: The number of zone append operations
963#     performed by the zoned devices (since 8.1)
964#
965# @flush_operations: The number of cache flush operations performed by
966#     the device (since 0.15)
967#
968# @unmap_operations: The number of unmap operations performed by the
969#     device (Since 4.2)
970#
971# @rd_total_time_ns: Total time spent on reads in nanoseconds
972#     (since 0.15)
973#
974# @wr_total_time_ns: Total time spent on writes in nanoseconds
975#     (since 0.15)
976#
977# @zone_append_total_time_ns: Total time spent on zone append writes
978#     in nanoseconds (since 8.1)
979#
980# @flush_total_time_ns: Total time spent on cache flushes in
981#     nanoseconds (since 0.15).
982#
983# @unmap_total_time_ns: Total time spent on unmap operations in
984#     nanoseconds (Since 4.2)
985#
986# @wr_highest_offset: The offset after the greatest byte written to
987#     the device.  The intended use of this information is for
988#     growable sparse files (like qcow2) that are used on top of a
989#     physical device.
990#
991# @rd_merged: Number of read requests that have been merged into
992#     another request (Since 2.3).
993#
994# @wr_merged: Number of write requests that have been merged into
995#     another request (Since 2.3).
996#
997# @zone_append_merged: Number of zone append requests that have been
998#     merged into another request (since 8.1)
999#
1000# @unmap_merged: Number of unmap requests that have been merged into
1001#     another request (Since 4.2)
1002#
1003# @idle_time_ns: Time since the last I/O operation, in nanoseconds.
1004#     If the field is absent it means that there haven't been any
1005#     operations yet (Since 2.5).
1006#
1007# @failed_rd_operations: The number of failed read operations
1008#     performed by the device (Since 2.5)
1009#
1010# @failed_wr_operations: The number of failed write operations
1011#     performed by the device (Since 2.5)
1012#
1013# @failed_zone_append_operations: The number of failed zone append
1014#     write operations performed by the zoned devices (since 8.1)
1015#
1016# @failed_flush_operations: The number of failed flush operations
1017#     performed by the device (Since 2.5)
1018#
1019# @failed_unmap_operations: The number of failed unmap operations
1020#     performed by the device (Since 4.2)
1021#
1022# @invalid_rd_operations: The number of invalid read operations
1023#     performed by the device (Since 2.5)
1024#
1025# @invalid_wr_operations: The number of invalid write operations
1026#     performed by the device (Since 2.5)
1027#
1028# @invalid_zone_append_operations: The number of invalid zone append
1029#     operations performed by the zoned device (since 8.1)
1030#
1031# @invalid_flush_operations: The number of invalid flush operations
1032#     performed by the device (Since 2.5)
1033#
1034# @invalid_unmap_operations: The number of invalid unmap operations
1035#     performed by the device (Since 4.2)
1036#
1037# @account_invalid: Whether invalid operations are included in the
1038#     last access statistics (Since 2.5)
1039#
1040# @account_failed: Whether failed operations are included in the
1041#     latency and last access statistics (Since 2.5)
1042#
1043# @timed_stats: Statistics specific to the set of previously defined
1044#     intervals of time (Since 2.5)
1045#
1046# @rd_latency_histogram: `BlockLatencyHistogramInfo`.  (Since 4.0)
1047#
1048# @wr_latency_histogram: `BlockLatencyHistogramInfo`.  (Since 4.0)
1049#
1050# @zone_append_latency_histogram: `BlockLatencyHistogramInfo`.
1051#     (since 8.1)
1052#
1053# @flush_latency_histogram: `BlockLatencyHistogramInfo`.  (Since 4.0)
1054#
1055# Since: 0.14
1056##
1057{ 'struct': 'BlockDeviceStats',
1058  'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'zone_append_bytes': 'int',
1059           'unmap_bytes' : 'int', 'rd_operations': 'int',
1060           'wr_operations': 'int', 'zone_append_operations': 'int',
1061           'flush_operations': 'int', 'unmap_operations': 'int',
1062           'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int',
1063           'zone_append_total_time_ns': 'int', 'flush_total_time_ns': 'int',
1064           'unmap_total_time_ns': 'int', 'wr_highest_offset': 'int',
1065           'rd_merged': 'int', 'wr_merged': 'int', 'zone_append_merged': 'int',
1066           'unmap_merged': 'int', '*idle_time_ns': 'int',
1067           'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
1068           'failed_zone_append_operations': 'int',
1069           'failed_flush_operations': 'int',
1070           'failed_unmap_operations': 'int', 'invalid_rd_operations': 'int',
1071           'invalid_wr_operations': 'int',
1072           'invalid_zone_append_operations': 'int',
1073           'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int',
1074           'account_invalid': 'bool', 'account_failed': 'bool',
1075           'timed_stats': ['BlockDeviceTimedStats'],
1076           '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
1077           '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
1078           '*zone_append_latency_histogram': 'BlockLatencyHistogramInfo',
1079           '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
1080
1081##
1082# @BlockStatsSpecificFile:
1083#
1084# File driver statistics
1085#
1086# @discard-nb-ok: The number of successful discard operations
1087#     performed by the driver.
1088#
1089# @discard-nb-failed: The number of failed discard operations
1090#     performed by the driver.
1091#
1092# @discard-bytes-ok: The number of bytes discarded by the driver.
1093#
1094# Since: 4.2
1095##
1096{ 'struct': 'BlockStatsSpecificFile',
1097  'data': {
1098      'discard-nb-ok': 'uint64',
1099      'discard-nb-failed': 'uint64',
1100      'discard-bytes-ok': 'uint64' } }
1101
1102##
1103# @BlockStatsSpecificNvme:
1104#
1105# NVMe driver statistics
1106#
1107# @completion-errors: The number of completion errors.
1108#
1109# @aligned-accesses: The number of aligned accesses performed by the
1110#     driver.
1111#
1112# @unaligned-accesses: The number of unaligned accesses performed by
1113#     the driver.
1114#
1115# Since: 5.2
1116##
1117{ 'struct': 'BlockStatsSpecificNvme',
1118  'data': {
1119      'completion-errors': 'uint64',
1120      'aligned-accesses': 'uint64',
1121      'unaligned-accesses': 'uint64' } }
1122
1123##
1124# @BlockStatsSpecific:
1125#
1126# Block driver specific statistics
1127#
1128# @driver: block driver name
1129#
1130# Since: 4.2
1131##
1132{ 'union': 'BlockStatsSpecific',
1133  'base': { 'driver': 'BlockdevDriver' },
1134  'discriminator': 'driver',
1135  'data': {
1136      'file': 'BlockStatsSpecificFile',
1137      'host_device': { 'type': 'BlockStatsSpecificFile',
1138                       'if': 'HAVE_HOST_BLOCK_DEVICE' },
1139      'nvme': 'BlockStatsSpecificNvme' } }
1140
1141##
1142# @BlockStats:
1143#
1144# Statistics of a virtual block device or a block backing device.
1145#
1146# @device: If the stats are for a virtual block device, the name
1147#     corresponding to the virtual block device.
1148#
1149# @node-name: The node name of the device.  (Since 2.3)
1150#
1151# @qdev: The qdev ID, or if no ID is assigned, the QOM path of the
1152#     block device.  (since 3.0)
1153#
1154# @stats: A `BlockDeviceStats` for the device.
1155#
1156# @driver-specific: Optional driver-specific stats.  (Since 4.2)
1157#
1158# @parent: This describes the file block device if it has one.
1159#     Contains recursively the statistics of the underlying protocol
1160#     (e.g. the host file for a qcow2 image).  If there is no
1161#     underlying protocol, this field is omitted
1162#
1163# @backing: This describes the backing block device if it has one.
1164#     (Since 2.0)
1165#
1166# Since: 0.14
1167##
1168{ 'struct': 'BlockStats',
1169  'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
1170           'stats': 'BlockDeviceStats',
1171           '*driver-specific': 'BlockStatsSpecific',
1172           '*parent': 'BlockStats',
1173           '*backing': 'BlockStats'} }
1174
1175##
1176# @query-blockstats:
1177#
1178# Query the `BlockStats` for all virtual block devices.
1179#
1180# @query-nodes: If true, the command will query all the block nodes
1181#     that have a node name, in a list which will include "parent"
1182#     information, but not "backing".  If false or omitted, the
1183#     behavior is as before - query all the device backends,
1184#     recursively including their "parent" and "backing".  Filter
1185#     nodes that were created implicitly are skipped over in this
1186#     mode.  (Since 2.3)
1187#
1188# Returns: A list of statistics for each virtual block device.
1189#
1190# Since: 0.14
1191#
1192# .. qmp-example::
1193#
1194#     -> { "execute": "query-blockstats" }
1195#     <- {
1196#           "return":[
1197#              {
1198#                 "device":"ide0-hd0",
1199#                 "parent":{
1200#                    "stats":{
1201#                       "wr_highest_offset":3686448128,
1202#                       "wr_bytes":9786368,
1203#                       "wr_operations":751,
1204#                       "rd_bytes":122567168,
1205#                       "rd_operations":36772
1206#                       "wr_total_times_ns":313253456
1207#                       "rd_total_times_ns":3465673657
1208#                       "flush_total_times_ns":49653
1209#                       "flush_operations":61,
1210#                       "rd_merged":0,
1211#                       "wr_merged":0,
1212#                       "idle_time_ns":2953431879,
1213#                       "account_invalid":true,
1214#                       "account_failed":false
1215#                    }
1216#                 },
1217#                 "stats":{
1218#                    "wr_highest_offset":2821110784,
1219#                    "wr_bytes":9786368,
1220#                    "wr_operations":692,
1221#                    "rd_bytes":122739200,
1222#                    "rd_operations":36604
1223#                    "flush_operations":51,
1224#                    "wr_total_times_ns":313253456
1225#                    "rd_total_times_ns":3465673657
1226#                    "flush_total_times_ns":49653,
1227#                    "rd_merged":0,
1228#                    "wr_merged":0,
1229#                    "idle_time_ns":2953431879,
1230#                    "account_invalid":true,
1231#                    "account_failed":false
1232#                 },
1233#                 "qdev": "/machine/unattached/device[23]"
1234#              },
1235#              {
1236#                 "device":"ide1-cd0",
1237#                 "stats":{
1238#                    "wr_highest_offset":0,
1239#                    "wr_bytes":0,
1240#                    "wr_operations":0,
1241#                    "rd_bytes":0,
1242#                    "rd_operations":0
1243#                    "flush_operations":0,
1244#                    "wr_total_times_ns":0
1245#                    "rd_total_times_ns":0
1246#                    "flush_total_times_ns":0,
1247#                    "rd_merged":0,
1248#                    "wr_merged":0,
1249#                    "account_invalid":false,
1250#                    "account_failed":false
1251#                 },
1252#                 "qdev": "/machine/unattached/device[24]"
1253#              },
1254#              {
1255#                 "device":"floppy0",
1256#                 "stats":{
1257#                    "wr_highest_offset":0,
1258#                    "wr_bytes":0,
1259#                    "wr_operations":0,
1260#                    "rd_bytes":0,
1261#                    "rd_operations":0
1262#                    "flush_operations":0,
1263#                    "wr_total_times_ns":0
1264#                    "rd_total_times_ns":0
1265#                    "flush_total_times_ns":0,
1266#                    "rd_merged":0,
1267#                    "wr_merged":0,
1268#                    "account_invalid":false,
1269#                    "account_failed":false
1270#                 },
1271#                 "qdev": "/machine/unattached/device[16]"
1272#              },
1273#              {
1274#                 "device":"sd0",
1275#                 "stats":{
1276#                    "wr_highest_offset":0,
1277#                    "wr_bytes":0,
1278#                    "wr_operations":0,
1279#                    "rd_bytes":0,
1280#                    "rd_operations":0
1281#                    "flush_operations":0,
1282#                    "wr_total_times_ns":0
1283#                    "rd_total_times_ns":0
1284#                    "flush_total_times_ns":0,
1285#                    "rd_merged":0,
1286#                    "wr_merged":0,
1287#                    "account_invalid":false,
1288#                    "account_failed":false
1289#                 }
1290#              }
1291#           ]
1292#        }
1293##
1294{ 'command': 'query-blockstats',
1295  'data': { '*query-nodes': 'bool' },
1296  'returns': ['BlockStats'],
1297  'allow-preconfig': true }
1298
1299##
1300# @BlockdevOnError:
1301#
1302# An enumeration of possible behaviors for errors on I/O operations.
1303# The exact meaning depends on whether the I/O was initiated by a
1304# guest or by a block job
1305#
1306# @report: for guest operations, report the error to the guest; for
1307#     jobs, cancel the job
1308#
1309# @ignore: ignore the error, only report a QMP event (`BLOCK_IO_ERROR`
1310#     or `BLOCK_JOB_ERROR`).  The backup, mirror and commit block jobs
1311#     retry the failing request later and may still complete
1312#     successfully.  The stream block job continues to stream and will
1313#     complete with an error.
1314#
1315# @enospc: same as @stop on ENOSPC, same as @report otherwise.
1316#
1317# @stop: for guest operations, stop the virtual machine; for jobs,
1318#     pause the job
1319#
1320# @auto: inherit the error handling policy of the backend (since: 2.7)
1321#
1322# Since: 1.3
1323##
1324{ 'enum': 'BlockdevOnError',
1325  'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1326
1327##
1328# @MirrorSyncMode:
1329#
1330# An enumeration of possible behaviors for the initial synchronization
1331# phase of storage mirroring.
1332#
1333# @top: copies data in the topmost image to the destination
1334#
1335# @full: copies data from all images to the destination
1336#
1337# @none: only copy data written from now on
1338#
1339# @incremental: only copy data described by the dirty bitmap.
1340#     (since: 2.4)
1341#
1342# @bitmap: only copy data described by the dirty bitmap.  Behavior on
1343#     completion is determined by the `BitmapSyncMode`.  (since: 4.2)
1344#
1345# Since: 1.3
1346##
1347{ 'enum': 'MirrorSyncMode',
1348  'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1349
1350##
1351# @BitmapSyncMode:
1352#
1353# An enumeration of possible behaviors for the synchronization of a
1354# bitmap when used for data copy operations.
1355#
1356# @on-success: The bitmap is only synced when the operation is
1357#     successful.  This is the behavior always used for incremental
1358#     backups.
1359#
1360# @never: The bitmap is never synchronized with the operation, and is
1361#     treated solely as a read-only manifest of blocks to copy.
1362#
1363# @always: The bitmap is always synchronized with the operation,
1364#     regardless of whether or not the operation was successful.
1365#
1366# Since: 4.2
1367##
1368{ 'enum': 'BitmapSyncMode',
1369  'data': ['on-success', 'never', 'always'] }
1370
1371##
1372# @MirrorCopyMode:
1373#
1374# An enumeration whose values tell the mirror block job when to
1375# trigger writes to the target.
1376#
1377# @background: copy data in background only.
1378#
1379# @write-blocking: when data is written to the source, write it
1380#     (synchronously) to the target as well.  In addition, data is
1381#     copied in background just like in @background mode.
1382#
1383# Since: 3.0
1384##
1385{ 'enum': 'MirrorCopyMode',
1386  'data': ['background', 'write-blocking'] }
1387
1388##
1389# @BlockJobInfoMirror:
1390#
1391# Information specific to mirror block jobs.
1392#
1393# @actively-synced: Whether the source is actively synced to the
1394#     target, i.e. same data and new writes are done synchronously to
1395#     both.
1396#
1397# Since: 8.2
1398##
1399{ 'struct': 'BlockJobInfoMirror',
1400  'data': { 'actively-synced': 'bool' } }
1401
1402##
1403# @BlockJobInfo:
1404#
1405# Information about a long-running block device operation.
1406#
1407# @type: the job type ('stream' for image streaming)
1408#
1409# @device: The job identifier.  Originally the device name but other
1410#     values are allowed since QEMU 2.7
1411#
1412# @len: Estimated @offset value at the completion of the job.  This
1413#     value can arbitrarily change while the job is running, in both
1414#     directions.
1415#
1416# @offset: Progress made until now.  The unit is arbitrary and the
1417#     value can only meaningfully be used for the ratio of @offset to
1418#     @len.  The value is monotonically increasing.
1419#
1420# @busy: false if the job is known to be in a quiescent state, with no
1421#     pending I/O.  (Since 1.3)
1422#
1423# @paused: whether the job is paused or, if @busy is true, will pause
1424#     itself as soon as possible.  (Since 1.3)
1425#
1426# @speed: the rate limit, bytes per second
1427#
1428# @io-status: the status of the job (since 1.3)
1429#
1430# @ready: true if the job may be completed (since 2.2)
1431#
1432# @status: Current job state/status (since 2.12)
1433#
1434# @auto-finalize: Job will finalize itself when PENDING, moving to the
1435#     CONCLUDED state.  (since 2.12)
1436#
1437# @auto-dismiss: Job will dismiss itself when CONCLUDED, and
1438#     disappear.  (since 2.12)
1439#
1440# @error: Error information if the job did not complete successfully.
1441#     Not set if the job completed successfully.  (since 2.12.1)
1442#
1443# Since: 1.1
1444##
1445{ 'union': 'BlockJobInfo',
1446  'base': {'type': 'JobType', 'device': 'str', 'len': 'int',
1447           'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1448           'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1449           'status': 'JobStatus',
1450           'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1451           '*error': 'str' },
1452  'discriminator': 'type',
1453  'data': { 'mirror': 'BlockJobInfoMirror' } }
1454
1455##
1456# @query-block-jobs:
1457#
1458# Return information about long-running block device operations.
1459#
1460# Returns: a list of job info for each active block job
1461#
1462# Since: 1.1
1463##
1464{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'],
1465  'allow-preconfig': true }
1466
1467##
1468# @block_resize:
1469#
1470# Resize a block image while a guest is running.
1471#
1472# Either @device or @node-name must be set but not both.
1473#
1474# @device: the name of the device to get the image resized
1475#
1476# @node-name: graph node name to get the image resized (Since 2.0)
1477#
1478# @size: new image size in bytes
1479#
1480# Errors:
1481#     - If @device is not a valid block device, DeviceNotFound
1482#
1483# Since: 0.14
1484#
1485# .. qmp-example::
1486#
1487#     -> { "execute": "block_resize",
1488#          "arguments": { "device": "scratch", "size": 1073741824 } }
1489#     <- { "return": {} }
1490##
1491{ 'command': 'block_resize',
1492  'data': { '*device': 'str',
1493            '*node-name': 'str',
1494            'size': 'int' },
1495  'coroutine': true,
1496  'allow-preconfig': true }
1497
1498##
1499# @NewImageMode:
1500#
1501# An enumeration that tells QEMU how to set the backing file path in a
1502# new image file.
1503#
1504# @existing: QEMU should look for an existing image file.
1505#
1506# @absolute-paths: QEMU should create a new image with absolute paths
1507#     for the backing file.  If there is no backing file available,
1508#     the new image will not be backed either.
1509#
1510# Since: 1.1
1511##
1512{ 'enum': 'NewImageMode',
1513  'data': [ 'existing', 'absolute-paths' ] }
1514
1515##
1516# @BlockdevSnapshotSync:
1517#
1518# Either @device or @node-name must be set but not both.
1519#
1520# @device: the name of the device to take a snapshot of.
1521#
1522# @node-name: graph node name to generate the snapshot from
1523#     (Since 2.0)
1524#
1525# @snapshot-file: the target of the new overlay image.  If the file
1526#     exists, or if it is a device, the overlay will be created in the
1527#     existing file/device.  Otherwise, a new file will be created.
1528#
1529# @snapshot-node-name: the graph node name of the new image
1530#     (Since 2.0)
1531#
1532# @format: the format of the overlay image, default is 'qcow2'.
1533#
1534# @mode: whether and how QEMU should create a new image, default is
1535#     'absolute-paths'.
1536##
1537{ 'struct': 'BlockdevSnapshotSync',
1538  'data': { '*device': 'str', '*node-name': 'str',
1539            'snapshot-file': 'str', '*snapshot-node-name': 'str',
1540            '*format': 'str', '*mode': 'NewImageMode' } }
1541
1542##
1543# @BlockdevSnapshot:
1544#
1545# @node: device or node name that will have a snapshot taken.
1546#
1547# @overlay: reference to the existing block device that will become
1548#     the overlay of @node, as part of taking the snapshot.  It must
1549#     not have a current backing file (this can be achieved by passing
1550#     "backing": null to `blockdev-add`).
1551#
1552# Since: 2.5
1553##
1554{ 'struct': 'BlockdevSnapshot',
1555  'data': { 'node': 'str', 'overlay': 'str' } }
1556
1557##
1558# @BackupPerf:
1559#
1560# Optional parameters for backup.  These parameters don't affect
1561# functionality, but may significantly affect performance.
1562#
1563# @use-copy-range: Use copy offloading.  Default false.
1564#
1565# @max-workers: Maximum number of parallel requests for the sustained
1566#     background copying process.  Doesn't influence copy-before-write
1567#     operations.  Default 64.
1568#
1569# @max-chunk: Maximum request length for the sustained background
1570#     copying process.  Doesn't influence copy-before-write
1571#     operations.  0 means unlimited.  If max-chunk is non-zero then
1572#     it should not be less than job cluster size which is calculated
1573#     as maximum of target image cluster size and 64k.  Default 0.
1574#
1575# @min-cluster-size: Minimum size of blocks used by copy-before-write
1576#     and background copy operations.  Has to be a power of 2.  No
1577#     effect if smaller than the maximum of the target's cluster size
1578#     and 64 KiB.  Default 0.  (Since 9.2)
1579#
1580# Since: 6.0
1581##
1582{ 'struct': 'BackupPerf',
1583  'data': { '*use-copy-range': 'bool', '*max-workers': 'int',
1584            '*max-chunk': 'int64', '*min-cluster-size': 'size' } }
1585
1586##
1587# @BackupCommon:
1588#
1589# @job-id: identifier for the newly-created block job.  If omitted,
1590#     the device name will be used.  (Since 2.7)
1591#
1592# @device: the device name or node-name of a root node which should be
1593#     copied.
1594#
1595# @sync: what parts of the disk image should be copied to the
1596#     destination (all the disk, only the sectors allocated in the
1597#     topmost image, from a dirty bitmap, or only new I/O).
1598#
1599# @speed: the maximum speed, in bytes per second.  The default is 0,
1600#     for unlimited.
1601#
1602# @bitmap: The name of a dirty bitmap to use.  Must be present if sync
1603#     is "bitmap" or "incremental".  Can be present if sync is "full"
1604#     or "top".  Must not be present otherwise.
1605#     (Since 2.4 (`drive-backup`), 3.1 (`blockdev-backup`))
1606#
1607# @bitmap-mode: Specifies the type of data the bitmap should contain
1608#     after the operation concludes.  Must be present if a bitmap was
1609#     provided, must **not** be present otherwise.  (Since 4.2)
1610#
1611# @compress: true to compress data, if the target format supports it.
1612#     (default: false) (since 2.8)
1613#
1614# @on-source-error: the action to take on an error on the source,
1615#     default 'report'.  'stop' and 'enospc' can only be used if the
1616#     block device supports io-status (see `BlockInfo`).
1617#
1618# @on-target-error: the action to take on an error on the target,
1619#     default 'report' (no limitations, since this applies to a
1620#     different block device than @device).
1621#
1622# @on-cbw-error: policy defining behavior on I/O errors in
1623#     copy-before-write jobs; defaults to break-guest-write.  (Since 10.1)
1624#
1625# @auto-finalize: When false, this job will wait in a PENDING state
1626#     after it has finished its work, waiting for `job-finalize` before
1627#     making any block graph changes.  When true, this job will
1628#     automatically perform its abort or commit actions.  Defaults to
1629#     true.  (Since 2.12)
1630#
1631# @auto-dismiss: When false, this job will wait in a CONCLUDED state
1632#     after it has completely ceased all work, and awaits
1633#     `job-dismiss`.  When true, this job will automatically disappear
1634#     without user intervention.  Defaults to true.  (Since 2.12)
1635#
1636# @filter-node-name: the node name that should be assigned to the
1637#     filter driver that the backup job inserts into the graph above
1638#     node specified by @drive.  If this option is not given, a node
1639#     name is autogenerated.  (Since: 4.2)
1640#
1641# @discard-source: Discard blocks on source which have already been
1642#     copied to the target.  (Since 9.1)
1643#
1644# @x-perf: Performance options.  (Since 6.0)
1645#
1646# Features:
1647#
1648# @unstable: Member @x-perf is experimental.
1649#
1650# .. note:: @on-source-error and @on-target-error only affect
1651#    background I/O.  If an error occurs during a guest write request,
1652#    the device's rerror/werror actions will be used.
1653#
1654# Since: 4.2
1655##
1656{ 'struct': 'BackupCommon',
1657  'data': { '*job-id': 'str', 'device': 'str',
1658            'sync': 'MirrorSyncMode', '*speed': 'int',
1659            '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1660            '*compress': 'bool',
1661            '*on-source-error': 'BlockdevOnError',
1662            '*on-target-error': 'BlockdevOnError',
1663            '*on-cbw-error': 'OnCbwError',
1664            '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
1665            '*filter-node-name': 'str',
1666            '*discard-source': 'bool',
1667            '*x-perf': { 'type': 'BackupPerf',
1668                         'features': [ 'unstable' ] } } }
1669
1670##
1671# @DriveBackup:
1672#
1673# @target: the target of the new image.  If the file exists, or if it
1674#     is a device, the existing file/device will be used as the new
1675#     destination.  If it does not exist, a new file will be created.
1676#
1677# @format: the format of the new destination, default is to probe if
1678#     @mode is 'existing', else the format of the source
1679#
1680# @mode: whether and how QEMU should create a new image, default is
1681#     'absolute-paths'.
1682#
1683# Since: 1.6
1684##
1685{ 'struct': 'DriveBackup',
1686  'base': 'BackupCommon',
1687  'data': { 'target': 'str',
1688            '*format': 'str',
1689            '*mode': 'NewImageMode' } }
1690
1691##
1692# @BlockdevBackup:
1693#
1694# @target: the device name or node-name of the backup target node.
1695#
1696# Since: 2.3
1697##
1698{ 'struct': 'BlockdevBackup',
1699  'base': 'BackupCommon',
1700  'data': { 'target': 'str' } }
1701
1702##
1703# @blockdev-snapshot-sync:
1704#
1705# Takes a synchronous snapshot of a block device.
1706#
1707# Errors:
1708#     - If @device is not a valid block device, DeviceNotFound
1709#
1710# Since: 0.14
1711#
1712# .. qmp-example::
1713#
1714#     -> { "execute": "blockdev-snapshot-sync",
1715#          "arguments": { "device": "ide-hd0",
1716#                         "snapshot-file":
1717#                         "/some/place/my-image",
1718#                         "format": "qcow2" } }
1719#     <- { "return": {} }
1720##
1721{ 'command': 'blockdev-snapshot-sync',
1722  'data': 'BlockdevSnapshotSync',
1723  'allow-preconfig': true }
1724
1725##
1726# @blockdev-snapshot:
1727#
1728# Takes a snapshot of a block device.
1729#
1730# Take a snapshot, by installing 'node' as the backing image of
1731# 'overlay'.  Additionally, if 'node' is associated with a block
1732# device, the block device changes to using 'overlay' as its new
1733# active image.
1734#
1735# Features:
1736#
1737# @allow-write-only-overlay: If present, the check whether this
1738#     operation is safe was relaxed so that it can be used to change
1739#     backing file of a destination of a `blockdev-mirror`.  (since 5.0)
1740#
1741# Since: 2.5
1742#
1743# .. qmp-example::
1744#
1745#     -> { "execute": "blockdev-add",
1746#          "arguments": { "driver": "qcow2",
1747#                         "node-name": "node1534",
1748#                         "file": { "driver": "file",
1749#                                   "filename": "hd1.qcow2" },
1750#                         "backing": null } }
1751#
1752#     <- { "return": {} }
1753#
1754#     -> { "execute": "blockdev-snapshot",
1755#          "arguments": { "node": "ide-hd0",
1756#                         "overlay": "node1534" } }
1757#     <- { "return": {} }
1758##
1759{ 'command': 'blockdev-snapshot',
1760  'data': 'BlockdevSnapshot',
1761  'features': [ 'allow-write-only-overlay' ],
1762  'allow-preconfig': true }
1763
1764##
1765# @change-backing-file:
1766#
1767# Change the backing file in the image file metadata.  This does not
1768# cause QEMU to reopen the image file to reparse the backing filename
1769# (it may, however, perform a reopen to change permissions from r/o ->
1770# r/w -> r/o, if needed).  The new backing file string is written into
1771# the image file metadata, and the QEMU internal strings are updated.
1772#
1773# @image-node-name: The name of the block driver state node of the
1774#     image to modify.  The "device" argument is used to verify
1775#     "image-node-name" is in the chain described by "device".
1776#
1777# @device: The device name or node-name of the root node that owns
1778#     image-node-name.
1779#
1780# @backing-file: The string to write as the backing file.  This string
1781#     is not validated, so care should be taken when specifying the
1782#     string or the image chain may not be able to be reopened again.
1783#
1784# Errors:
1785#     - If "device" does not exist or cannot be determined,
1786#       DeviceNotFound
1787#
1788# Since: 2.1
1789##
1790{ 'command': 'change-backing-file',
1791  'data': { 'device': 'str', 'image-node-name': 'str',
1792            'backing-file': 'str' },
1793  'allow-preconfig': true }
1794
1795##
1796# @block-commit:
1797#
1798# Live commit of data from overlay image nodes into backing nodes -
1799# i.e., writes data between 'top' and 'base' into 'base'.
1800#
1801# If top == base, that is an error.  If top has no overlays on top of
1802# it, or if it is in use by a writer, the job will not be completed by
1803# itself.  The user needs to complete the job with the
1804# `job-complete` command after getting the ready event.  (Since 2.0)
1805#
1806# If the base image is smaller than top, then the base image will be
1807# resized to be the same size as top.  If top is smaller than the base
1808# image, the base will not be truncated.  If you want the base image
1809# size to match the size of the smaller top, you can safely truncate
1810# it yourself once the commit operation successfully completes.
1811#
1812# @job-id: identifier for the newly-created block job.  If omitted,
1813#     the device name will be used.  (Since 2.7)
1814#
1815# @device: the device name or node-name of a root node
1816#
1817# @base-node: The node name of the backing image to write data into.
1818#     If not specified, this is the deepest backing image.
1819#     (since: 3.1)
1820#
1821# @base: Same as @base-node, except that it is a file name rather than
1822#     a node name.  This must be the exact filename string that was
1823#     used to open the node; other strings, even if addressing the
1824#     same file, are not accepted
1825#
1826# @top-node: The node name of the backing image within the image chain
1827#     which contains the topmost data to be committed down.  If not
1828#     specified, this is the active layer.  (since: 3.1)
1829#
1830# @top: Same as @top-node, except that it is a file name rather than a
1831#     node name.  This must be the exact filename string that was used
1832#     to open the node; other strings, even if addressing the same
1833#     file, are not accepted
1834#
1835# @backing-file: The backing file string to write into the overlay
1836#     image of 'top'.  If 'top' does not have an overlay image, or if
1837#     'top' is in use by a writer, specifying a backing file string is
1838#     an error.
1839#
1840#     This filename is not validated.  If a pathname string is such
1841#     that it cannot be resolved by QEMU, that means that subsequent
1842#     QMP or HMP commands must use node-names for the image in
1843#     question, as filename lookup methods will fail.
1844#
1845#     If not specified, QEMU will automatically determine the backing
1846#     file string to use, or error out if there is no obvious choice.
1847#     Care should be taken when specifying the string, to specify a
1848#     valid filename or protocol.  (Since 2.1)
1849#
1850# @backing-mask-protocol: If true, replace any protocol mentioned in
1851#     the 'backing file format' with 'raw', rather than storing the
1852#     protocol name as the backing format.  Can be used even when no
1853#     image header will be updated (default false; since 9.0).
1854#
1855# @speed: the maximum speed, in bytes per second
1856#
1857# @on-error: the action to take on an error.  'ignore' means that the
1858#     request should be retried.  (default: report; since: 5.0)
1859#
1860# @filter-node-name: the node name that should be assigned to the
1861#     filter driver that the commit job inserts into the graph above
1862#     @top.  If this option is not given, a node name is
1863#     autogenerated.  (Since: 2.9)
1864#
1865# @auto-finalize: When false, this job will wait in a PENDING state
1866#     after it has finished its work, waiting for `job-finalize` before
1867#     making any block graph changes.  When true, this job will
1868#     automatically perform its abort or commit actions.  Defaults to
1869#     true.  (Since 3.1)
1870#
1871# @auto-dismiss: When false, this job will wait in a CONCLUDED state
1872#     after it has completely ceased all work, and awaits
1873#     `job-dismiss`.  When true, this job will automatically disappear
1874#     without user intervention.  Defaults to true.  (Since 3.1)
1875#
1876# Features:
1877#
1878# @deprecated: Members @base and @top are deprecated.  Use @base-node
1879#     and @top-node instead.
1880#
1881# Errors:
1882#     - If @device does not exist, DeviceNotFound
1883#
1884# Since: 1.3
1885#
1886# .. qmp-example::
1887#
1888#     -> { "execute": "block-commit",
1889#          "arguments": { "device": "virtio0",
1890#                         "top": "/tmp/snap1.qcow2" } }
1891#     <- { "return": {} }
1892##
1893{ 'command': 'block-commit',
1894  'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1895            '*base': { 'type': 'str', 'features': [ 'deprecated' ] },
1896            '*top-node': 'str',
1897            '*top': { 'type': 'str', 'features': [ 'deprecated' ] },
1898            '*backing-file': 'str', '*backing-mask-protocol': 'bool',
1899            '*speed': 'int',
1900            '*on-error': 'BlockdevOnError',
1901            '*filter-node-name': 'str',
1902            '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
1903  'allow-preconfig': true }
1904
1905##
1906# @drive-backup:
1907#
1908# Start a point-in-time copy of a block device to a new destination.
1909# The status of ongoing `drive-backup` operations can be checked with
1910# `query-block-jobs` where the `BlockJobInfo`.type field has the value
1911# 'backup'.  The operation can be stopped before it has completed
1912# using the `job-cancel` or `block-job-cancel` command.
1913#
1914# Features:
1915#
1916# @deprecated: This command is deprecated.  Use `blockdev-backup`
1917#     instead.
1918#
1919# Errors:
1920#     - If @device is not a valid block device, GenericError
1921#
1922# Since: 1.6
1923#
1924# .. qmp-example::
1925#
1926#     -> { "execute": "drive-backup",
1927#          "arguments": { "device": "drive0",
1928#                         "sync": "full",
1929#                         "target": "backup.img" } }
1930#     <- { "return": {} }
1931##
1932{ 'command': 'drive-backup', 'boxed': true,
1933  'data': 'DriveBackup', 'features': ['deprecated'],
1934  'allow-preconfig': true }
1935
1936##
1937# @blockdev-backup:
1938#
1939# Start a point-in-time copy of a block device to a new destination.
1940# The status of ongoing `blockdev-backup` operations can be checked with
1941# `query-block-jobs` where the `BlockJobInfo`.type field has the value
1942# 'backup'.  The operation can be stopped before it has completed
1943# using the `job-cancel` or `block-job-cancel` command.
1944#
1945# Errors:
1946#     - If @device is not a valid block device, DeviceNotFound
1947#
1948# Since: 2.3
1949#
1950# .. qmp-example::
1951#
1952#     -> { "execute": "blockdev-backup",
1953#          "arguments": { "device": "src-id",
1954#                         "sync": "full",
1955#                         "target": "tgt-id" } }
1956#     <- { "return": {} }
1957##
1958{ 'command': 'blockdev-backup', 'boxed': true,
1959  'data': 'BlockdevBackup',
1960  'allow-preconfig': true }
1961
1962##
1963# @query-named-block-nodes:
1964#
1965# Get the named block driver list
1966#
1967# @flat: Omit the nested data about backing image ("backing-image"
1968#     key) if true.  Default is false (Since 5.0)
1969#
1970# Since: 2.0
1971#
1972# .. qmp-example::
1973#
1974#     -> { "execute": "query-named-block-nodes" }
1975#     <- { "return": [ { "ro":false,
1976#                        "drv":"qcow2",
1977#                        "encrypted":false,
1978#                        "file":"disks/test.qcow2",
1979#                        "node-name": "my-node",
1980#                        "backing_file_depth":1,
1981#                        "detect_zeroes":"off",
1982#                        "bps":1000000,
1983#                        "bps_rd":0,
1984#                        "bps_wr":0,
1985#                        "iops":1000000,
1986#                        "iops_rd":0,
1987#                        "iops_wr":0,
1988#                        "bps_max": 8000000,
1989#                        "bps_rd_max": 0,
1990#                        "bps_wr_max": 0,
1991#                        "iops_max": 0,
1992#                        "iops_rd_max": 0,
1993#                        "iops_wr_max": 0,
1994#                        "iops_size": 0,
1995#                        "write_threshold": 0,
1996#                        "image":{
1997#                           "filename":"disks/test.qcow2",
1998#                           "format":"qcow2",
1999#                           "virtual-size":2048000,
2000#                           "backing_file":"base.qcow2",
2001#                           "full-backing-filename":"disks/base.qcow2",
2002#                           "backing-filename-format":"qcow2",
2003#                           "snapshots":[
2004#                              {
2005#                                 "id": "1",
2006#                                 "name": "snapshot1",
2007#                                 "vm-state-size": 0,
2008#                                 "date-sec": 10000200,
2009#                                 "date-nsec": 12,
2010#                                 "vm-clock-sec": 206,
2011#                                 "vm-clock-nsec": 30
2012#                              }
2013#                           ],
2014#                           "backing-image":{
2015#                               "filename":"disks/base.qcow2",
2016#                               "format":"qcow2",
2017#                               "virtual-size":2048000
2018#                           }
2019#                        } } ] }
2020##
2021{ 'command': 'query-named-block-nodes',
2022  'returns': [ 'BlockDeviceInfo' ],
2023  'data': { '*flat': 'bool' },
2024  'allow-preconfig': true }
2025
2026##
2027# @XDbgBlockGraphNodeType:
2028#
2029# @block-backend: corresponds to BlockBackend
2030#
2031# @block-job: corresponds to BlockJob
2032#
2033# @block-driver: corresponds to BlockDriverState
2034#
2035# Since: 4.0
2036##
2037{ 'enum': 'XDbgBlockGraphNodeType',
2038  'data': [ 'block-backend', 'block-job', 'block-driver' ] }
2039
2040##
2041# @XDbgBlockGraphNode:
2042#
2043# @id: Block graph node identifier.  This @id is generated only for
2044#     `x-debug-query-block-graph` and does not relate to any other
2045#     identifiers in QEMU.
2046#
2047# @type: Type of graph node.  Can be one of block-backend, block-job
2048#     or block-driver-state.
2049#
2050# @name: Human readable name of the node.  Corresponds to node-name
2051#     for block-driver-state nodes; is not guaranteed to be unique in
2052#     the whole graph (with block-jobs and block-backends).
2053#
2054# Since: 4.0
2055##
2056{ 'struct': 'XDbgBlockGraphNode',
2057  'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
2058
2059##
2060# @BlockPermission:
2061#
2062# Enum of base block permissions.
2063#
2064# @consistent-read: A user that has the "permission" of consistent
2065#     reads is guaranteed that their view of the contents of the block
2066#     device is complete and self-consistent, representing the
2067#     contents of a disk at a specific point.  For most block devices
2068#     (including their backing files) this is true, but the property
2069#     cannot be maintained in a few situations like for intermediate
2070#     nodes of a commit block job.
2071#
2072# @write: This permission is required to change the visible disk
2073#     contents.
2074#
2075# @write-unchanged: This permission (which is weaker than
2076#     BLK_PERM_WRITE) is both enough and required for writes to the
2077#     block node when the caller promises that the visible disk
2078#     content doesn't change.  As the BLK_PERM_WRITE permission is
2079#     strictly stronger, either is sufficient to perform an unchanging
2080#     write.
2081#
2082# @resize: This permission is required to change the size of a block
2083#     node.
2084#
2085# Since: 4.0
2086##
2087{ 'enum': 'BlockPermission',
2088  'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize' ] }
2089
2090##
2091# @XDbgBlockGraphEdge:
2092#
2093# Block Graph edge description for `x-debug-query-block-graph`.
2094#
2095# @parent: parent id
2096#
2097# @child: child id
2098#
2099# @name: name of the relation (examples are 'file' and 'backing')
2100#
2101# @perm: granted permissions for the parent operating on the child
2102#
2103# @shared-perm: permissions that can still be granted to other users
2104#     of the child while it is still attached to this parent
2105#
2106# Since: 4.0
2107##
2108{ 'struct': 'XDbgBlockGraphEdge',
2109  'data': { 'parent': 'uint64', 'child': 'uint64',
2110            'name': 'str', 'perm': [ 'BlockPermission' ],
2111            'shared-perm': [ 'BlockPermission' ] } }
2112
2113##
2114# @XDbgBlockGraph:
2115#
2116# Block Graph - list of nodes and list of edges.
2117#
2118# Since: 4.0
2119##
2120{ 'struct': 'XDbgBlockGraph',
2121  'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
2122
2123##
2124# @x-debug-query-block-graph:
2125#
2126# Get the block graph.
2127#
2128# Features:
2129#
2130# @unstable: This command is meant for debugging.
2131#
2132# Since: 4.0
2133##
2134{ 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph',
2135  'features': [ 'unstable' ],
2136  'allow-preconfig': true }
2137
2138##
2139# @drive-mirror:
2140#
2141# Start mirroring a block device's writes to a new destination.
2142# target specifies the target of the new image.  If the file exists,
2143# or if it is a device, it will be used as the new destination for
2144# writes.  If it does not exist, a new file will be created.  @format
2145# specifies the format of the mirror image, default is to probe if
2146# mode='existing', else the format of the source.
2147#
2148# Errors:
2149#     - If @device is not a valid block device, GenericError
2150#
2151# Since: 1.3
2152#
2153# .. qmp-example::
2154#
2155#     -> { "execute": "drive-mirror",
2156#          "arguments": { "device": "ide-hd0",
2157#                         "target": "/some/place/my-image",
2158#                         "sync": "full",
2159#                         "format": "qcow2" } }
2160#     <- { "return": {} }
2161##
2162{ 'command': 'drive-mirror', 'boxed': true,
2163  'data': 'DriveMirror',
2164  'allow-preconfig': true }
2165
2166##
2167# @DriveMirror:
2168#
2169# A set of parameters describing drive mirror setup.
2170#
2171# @job-id: identifier for the newly-created block job.  If omitted,
2172#     the device name will be used.  (Since 2.7)
2173#
2174# @device: the device name or node-name of a root node whose writes
2175#     should be mirrored.
2176#
2177# @target: the target of the new image.  If the file exists, or if it
2178#     is a device, the existing file/device will be used as the new
2179#     destination.  If it does not exist, a new file will be created.
2180#
2181# @format: the format of the new destination, default is to probe if
2182#     @mode is 'existing', else the format of the source
2183#
2184# @node-name: the new block driver state node name in the graph
2185#     (Since 2.1)
2186#
2187# @replaces: with sync=full graph node name to be replaced by the new
2188#     image when a whole image copy is done.  This can be used to
2189#     repair broken Quorum files.  By default, @device is replaced,
2190#     although implicitly created filters on it are kept.  (Since 2.1)
2191#
2192# @mode: whether and how QEMU should create a new image, default is
2193#     'absolute-paths'.
2194#
2195# @speed: the maximum speed, in bytes per second
2196#
2197# @sync: what parts of the disk image should be copied to the
2198#     destination (all the disk, only the sectors allocated in the
2199#     topmost image, or only new I/O).
2200#
2201# @granularity: granularity of the dirty bitmap, default is 64K if the
2202#     image format doesn't have clusters, 4K if the clusters are
2203#     smaller than that, else the cluster size.  Must be a power of 2
2204#     between 512 and 64M (since 1.4).
2205#
2206# @buf-size: maximum amount of data in flight from source to target
2207#     (since 1.4).
2208#
2209# @on-source-error: the action to take on an error on the source,
2210#     default 'report'.  'stop' and 'enospc' can only be used if the
2211#     block device supports io-status (see `BlockInfo`).
2212#
2213# @on-target-error: the action to take on an error on the target,
2214#     default 'report' (no limitations, since this applies to a
2215#     different block device than @device).
2216#
2217# @unmap: Whether to try to unmap target sectors where source has only
2218#     zero.  If true, and target unallocated sectors will read as
2219#     zero, target image sectors will be unmapped; otherwise, zeroes
2220#     will be written.  Both will result in identical contents.
2221#     Default is true.  (Since 2.4)
2222#
2223# @copy-mode: when to copy data to the destination; defaults to
2224#     'background' (Since: 3.0)
2225#
2226# @auto-finalize: When false, this job will wait in a PENDING state
2227#     after it has finished its work, waiting for `job-finalize` before
2228#     making any block graph changes.  When true, this job will
2229#     automatically perform its abort or commit actions.  Defaults to
2230#     true.  (Since 3.1)
2231#
2232# @auto-dismiss: When false, this job will wait in a CONCLUDED state
2233#     after it has completely ceased all work, and awaits
2234#     `job-dismiss`.  When true, this job will automatically disappear
2235#     without user intervention.  Defaults to true.  (Since 3.1)
2236#
2237# Since: 1.3
2238##
2239{ 'struct': 'DriveMirror',
2240  'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2241            '*format': 'str', '*node-name': 'str', '*replaces': 'str',
2242            'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2243            '*speed': 'int', '*granularity': 'uint32',
2244            '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2245            '*on-target-error': 'BlockdevOnError',
2246            '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
2247            '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2248
2249##
2250# @BlockDirtyBitmap:
2251#
2252# @node: name of device/node which the bitmap is tracking
2253#
2254# @name: name of the dirty bitmap
2255#
2256# Since: 2.4
2257##
2258{ 'struct': 'BlockDirtyBitmap',
2259  'data': { 'node': 'str', 'name': 'str' } }
2260
2261##
2262# @BlockDirtyBitmapAdd:
2263#
2264# @node: name of device/node which the bitmap is tracking
2265#
2266# @name: name of the dirty bitmap (must be less than 1024 bytes)
2267#
2268# @granularity: the bitmap granularity, default is 64k for
2269#     `block-dirty-bitmap-add`
2270#
2271# @persistent: the bitmap is persistent, i.e. it will be saved to the
2272#     corresponding block device image file on its close.  For now
2273#     only Qcow2 disks support persistent bitmaps.  Default is false
2274#     for `block-dirty-bitmap-add`.  (Since: 2.10)
2275#
2276# @disabled: the bitmap is created in the disabled state, which means
2277#     that it will not track drive changes.  The bitmap may be enabled
2278#     with `block-dirty-bitmap-enable`.  Default is false.  (Since: 4.0)
2279#
2280# Since: 2.4
2281##
2282{ 'struct': 'BlockDirtyBitmapAdd',
2283  'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
2284            '*persistent': 'bool', '*disabled': 'bool' } }
2285
2286##
2287# @BlockDirtyBitmapOrStr:
2288#
2289# @local: name of the bitmap, attached to the same node as target
2290#     bitmap.
2291#
2292# @external: bitmap with specified node
2293#
2294# Since: 4.1
2295##
2296{ 'alternate': 'BlockDirtyBitmapOrStr',
2297  'data': { 'local': 'str',
2298            'external': 'BlockDirtyBitmap' } }
2299
2300##
2301# @BlockDirtyBitmapMerge:
2302#
2303# @node: name of device/node which the @target bitmap is tracking
2304#
2305# @target: name of the destination dirty bitmap
2306#
2307# @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or
2308#     fully specified `BlockDirtyBitmap` elements.  The latter are
2309#     supported since 4.1.
2310#
2311# Since: 4.0
2312##
2313{ 'struct': 'BlockDirtyBitmapMerge',
2314  'data': { 'node': 'str', 'target': 'str',
2315            'bitmaps': ['BlockDirtyBitmapOrStr'] } }
2316
2317##
2318# @block-dirty-bitmap-add:
2319#
2320# Create a dirty bitmap with a name on the node, and start tracking
2321# the writes.
2322#
2323# Errors:
2324#     - If @node is not a valid block device or node, DeviceNotFound
2325#     - If @name is already taken, GenericError
2326#
2327# Since: 2.4
2328#
2329# .. qmp-example::
2330#
2331#     -> { "execute": "block-dirty-bitmap-add",
2332#          "arguments": { "node": "drive0", "name": "bitmap0" } }
2333#     <- { "return": {} }
2334##
2335{ 'command': 'block-dirty-bitmap-add',
2336  'data': 'BlockDirtyBitmapAdd',
2337  'allow-preconfig': true }
2338
2339##
2340# @block-dirty-bitmap-remove:
2341#
2342# Stop write tracking and remove the dirty bitmap that was created
2343# with `block-dirty-bitmap-add`.  If the bitmap is persistent, remove it
2344# from its storage too.
2345#
2346# Errors:
2347#     - If @node is not a valid block device or node, DeviceNotFound
2348#     - If @name is not found, GenericError
2349#     - if @name is frozen by an operation, GenericError
2350#
2351# Since: 2.4
2352#
2353# .. qmp-example::
2354#
2355#     -> { "execute": "block-dirty-bitmap-remove",
2356#          "arguments": { "node": "drive0", "name": "bitmap0" } }
2357#     <- { "return": {} }
2358##
2359{ 'command': 'block-dirty-bitmap-remove',
2360  'data': 'BlockDirtyBitmap',
2361  'allow-preconfig': true }
2362
2363##
2364# @block-dirty-bitmap-clear:
2365#
2366# Clear (reset) a dirty bitmap on the device, so that an incremental
2367# backup from this point in time forward will only backup clusters
2368# modified after this clear operation.
2369#
2370# Errors:
2371#     - If @node is not a valid block device, DeviceNotFound
2372#     - If @name is not found, GenericError
2373#
2374# Since: 2.4
2375#
2376# .. qmp-example::
2377#
2378#     -> { "execute": "block-dirty-bitmap-clear",
2379#          "arguments": { "node": "drive0", "name": "bitmap0" } }
2380#     <- { "return": {} }
2381##
2382{ 'command': 'block-dirty-bitmap-clear',
2383  'data': 'BlockDirtyBitmap',
2384  'allow-preconfig': true }
2385
2386##
2387# @block-dirty-bitmap-enable:
2388#
2389# Enables a dirty bitmap so that it will begin tracking disk changes.
2390#
2391# Errors:
2392#     - If @node is not a valid block device, DeviceNotFound
2393#     - If @name is not found, GenericError
2394#
2395# Since: 4.0
2396#
2397# .. qmp-example::
2398#
2399#     -> { "execute": "block-dirty-bitmap-enable",
2400#          "arguments": { "node": "drive0", "name": "bitmap0" } }
2401#     <- { "return": {} }
2402##
2403{ 'command': 'block-dirty-bitmap-enable',
2404  'data': 'BlockDirtyBitmap',
2405  'allow-preconfig': true }
2406
2407##
2408# @block-dirty-bitmap-disable:
2409#
2410# Disables a dirty bitmap so that it will stop tracking disk changes.
2411#
2412# Errors:
2413#     - If @node is not a valid block device, DeviceNotFound
2414#     - If @name is not found, GenericError
2415#
2416# Since: 4.0
2417#
2418# .. qmp-example::
2419#
2420#     -> { "execute": "block-dirty-bitmap-disable",
2421#          "arguments": { "node": "drive0", "name": "bitmap0" } }
2422#     <- { "return": {} }
2423##
2424{ 'command': 'block-dirty-bitmap-disable',
2425  'data': 'BlockDirtyBitmap',
2426  'allow-preconfig': true }
2427
2428##
2429# @block-dirty-bitmap-merge:
2430#
2431# Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2432# Dirty bitmaps in @bitmaps will be unchanged, except if it also
2433# appears as the @target bitmap.  Any bits already set in @target will
2434# still be set after the merge, i.e., this operation does not clear
2435# the target.  On error, @target is unchanged.
2436#
2437# The resulting bitmap will count as dirty any clusters that were
2438# dirty in any of the source bitmaps.  This can be used to achieve
2439# backup checkpoints, or in simpler usages, to copy bitmaps.
2440#
2441# Errors:
2442#     - If @node is not a valid block device, DeviceNotFound
2443#     - If any bitmap in @bitmaps or @target is not found,
2444#       GenericError
2445#     - If any of the bitmaps have different sizes or granularities,
2446#       GenericError
2447#
2448# Since: 4.0
2449#
2450# .. qmp-example::
2451#
2452#     -> { "execute": "block-dirty-bitmap-merge",
2453#          "arguments": { "node": "drive0", "target": "bitmap0",
2454#                         "bitmaps": ["bitmap1"] } }
2455#     <- { "return": {} }
2456##
2457{ 'command': 'block-dirty-bitmap-merge',
2458  'data': 'BlockDirtyBitmapMerge',
2459  'allow-preconfig': true }
2460
2461##
2462# @BlockDirtyBitmapSha256:
2463#
2464# SHA256 hash of dirty bitmap data
2465#
2466# @sha256: ASCII representation of SHA256 bitmap hash
2467#
2468# Since: 2.10
2469##
2470{ 'struct': 'BlockDirtyBitmapSha256',
2471  'data': {'sha256': 'str'} }
2472
2473##
2474# @x-debug-block-dirty-bitmap-sha256:
2475#
2476# Get bitmap SHA256.
2477#
2478# Features:
2479#
2480# @unstable: This command is meant for debugging.
2481#
2482# Errors:
2483#     - If @node is not a valid block device, DeviceNotFound
2484#     - If @name is not found or if hashing has failed, GenericError
2485#
2486# Since: 2.10
2487##
2488{ 'command': 'x-debug-block-dirty-bitmap-sha256',
2489  'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256',
2490  'features': [ 'unstable' ],
2491  'allow-preconfig': true }
2492
2493##
2494# @blockdev-mirror:
2495#
2496# Start mirroring a block device's writes to a new destination.
2497#
2498# @job-id: identifier for the newly-created block job.  If omitted,
2499#     the device name will be used.  (Since 2.7)
2500#
2501# @device: The device name or node-name of a root node whose writes
2502#     should be mirrored.
2503#
2504# @target: the id or node-name of the block device to mirror to.  This
2505#     mustn't be attached to guest.
2506#
2507# @replaces: with sync=full graph node name to be replaced by the new
2508#     image when a whole image copy is done.  This can be used to
2509#     repair broken Quorum files.  By default, @device is replaced,
2510#     although implicitly created filters on it are kept.
2511#
2512# @speed: the maximum speed, in bytes per second
2513#
2514# @sync: what parts of the disk image should be copied to the
2515#     destination (all the disk, only the sectors allocated in the
2516#     topmost image, or only new I/O).
2517#
2518# @granularity: granularity of the dirty bitmap, default is 64K if the
2519#     image format doesn't have clusters, 4K if the clusters are
2520#     smaller than that, else the cluster size.  Must be a power of 2
2521#     between 512 and 64M
2522#
2523# @buf-size: maximum amount of data in flight from source to target
2524#
2525# @on-source-error: the action to take on an error on the source,
2526#     default 'report'.  'stop' and 'enospc' can only be used if the
2527#     block device supports io-status (see `BlockInfo`).
2528#
2529# @on-target-error: the action to take on an error on the target,
2530#     default 'report' (no limitations, since this applies to a
2531#     different block device than @device).
2532#
2533# @filter-node-name: the node name that should be assigned to the
2534#     filter driver that the mirror job inserts into the graph above
2535#     @device.  If this option is not given, a node name is
2536#     autogenerated.  (Since: 2.9)
2537#
2538# @copy-mode: when to copy data to the destination; defaults to
2539#     'background' (Since: 3.0)
2540#
2541# @auto-finalize: When false, this job will wait in a PENDING state
2542#     after it has finished its work, waiting for `job-finalize` before
2543#     making any block graph changes.  When true, this job will
2544#     automatically perform its abort or commit actions.  Defaults to
2545#     true.  (Since 3.1)
2546#
2547# @auto-dismiss: When false, this job will wait in a CONCLUDED state
2548#     after it has completely ceased all work, and awaits
2549#     `job-dismiss`.  When true, this job will automatically disappear
2550#     without user intervention.  Defaults to true.  (Since 3.1)
2551#
2552# @target-is-zero: Assume the destination reads as all zeroes before
2553#     the mirror started.  Setting this to true can speed up the
2554#     mirror.  Setting this to true when the destination is not
2555#     actually all zero can corrupt the destination.  (Since 10.1)
2556#
2557# Since: 2.6
2558#
2559# .. qmp-example::
2560#
2561#     -> { "execute": "blockdev-mirror",
2562#          "arguments": { "device": "ide-hd0",
2563#                         "target": "target0",
2564#                         "sync": "full" } }
2565#     <- { "return": {} }
2566##
2567{ 'command': 'blockdev-mirror',
2568  'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2569            '*replaces': 'str',
2570            'sync': 'MirrorSyncMode',
2571            '*speed': 'int', '*granularity': 'uint32',
2572            '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2573            '*on-target-error': 'BlockdevOnError',
2574            '*filter-node-name': 'str',
2575            '*copy-mode': 'MirrorCopyMode',
2576            '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
2577            '*target-is-zero': 'bool'},
2578  'allow-preconfig': true }
2579
2580##
2581# @BlockIOThrottle:
2582#
2583# A set of parameters describing block throttling.
2584#
2585# @device: Block device name
2586#
2587# @id: The name or QOM path of the guest device (since: 2.8)
2588#
2589# @bps: total throughput limit in bytes per second
2590#
2591# @bps_rd: read throughput limit in bytes per second
2592#
2593# @bps_wr: write throughput limit in bytes per second
2594#
2595# @iops: total I/O operations per second
2596#
2597# @iops_rd: read I/O operations per second
2598#
2599# @iops_wr: write I/O operations per second
2600#
2601# @bps_max: total throughput limit during bursts, in bytes (Since 1.7)
2602#
2603# @bps_rd_max: read throughput limit during bursts, in bytes
2604#     (Since 1.7)
2605#
2606# @bps_wr_max: write throughput limit during bursts, in bytes
2607#     (Since 1.7)
2608#
2609# @iops_max: total I/O operations per second during bursts, in bytes
2610#     (Since 1.7)
2611#
2612# @iops_rd_max: read I/O operations per second during bursts, in bytes
2613#     (Since 1.7)
2614#
2615# @iops_wr_max: write I/O operations per second during bursts, in
2616#     bytes (Since 1.7)
2617#
2618# @bps_max_length: maximum length of the @bps_max burst period, in
2619#     seconds.  It must only be set if @bps_max is set as well.
2620#     Defaults to 1.  (Since 2.6)
2621#
2622# @bps_rd_max_length: maximum length of the @bps_rd_max burst period,
2623#     in seconds.  It must only be set if @bps_rd_max is set as well.
2624#     Defaults to 1.  (Since 2.6)
2625#
2626# @bps_wr_max_length: maximum length of the @bps_wr_max burst period,
2627#     in seconds.  It must only be set if @bps_wr_max is set as well.
2628#     Defaults to 1.  (Since 2.6)
2629#
2630# @iops_max_length: maximum length of the @iops burst period, in
2631#     seconds.  It must only be set if @iops_max is set as well.
2632#     Defaults to 1.  (Since 2.6)
2633#
2634# @iops_rd_max_length: maximum length of the @iops_rd_max burst
2635#     period, in seconds.  It must only be set if @iops_rd_max is set
2636#     as well.  Defaults to 1.  (Since 2.6)
2637#
2638# @iops_wr_max_length: maximum length of the @iops_wr_max burst
2639#     period, in seconds.  It must only be set if @iops_wr_max is set
2640#     as well.  Defaults to 1.  (Since 2.6)
2641#
2642# @iops_size: an I/O size in bytes (Since 1.7)
2643#
2644# @group: throttle group name (Since 2.4)
2645#
2646# Features:
2647#
2648# @deprecated: Member @device is deprecated.  Use @id instead.
2649#
2650# Since: 1.1
2651##
2652{ 'struct': 'BlockIOThrottle',
2653  'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
2654            '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2655            'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2656            '*bps_max': 'int', '*bps_rd_max': 'int',
2657            '*bps_wr_max': 'int', '*iops_max': 'int',
2658            '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2659            '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2660            '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2661            '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2662            '*iops_size': 'int', '*group': 'str' } }
2663
2664##
2665# @ThrottleLimits:
2666#
2667# Limit parameters for throttling.  Since some limit combinations are
2668# illegal, limits should always be set in one transaction.  All fields
2669# are optional.  When setting limits, if a field is missing the
2670# current value is not changed.
2671#
2672# @iops-total: limit total I/O operations per second
2673#
2674# @iops-total-max: I/O operations burst
2675#
2676# @iops-total-max-length: length of the iops-total-max burst period,
2677#     in seconds.  It must only be set if @iops-total-max is set as
2678#     well.
2679#
2680# @iops-read: limit read operations per second
2681#
2682# @iops-read-max: I/O operations read burst
2683#
2684# @iops-read-max-length: length of the iops-read-max burst period, in
2685#     seconds.  It must only be set if @iops-read-max is set as well.
2686#
2687# @iops-write: limit write operations per second
2688#
2689# @iops-write-max: I/O operations write burst
2690#
2691# @iops-write-max-length: length of the iops-write-max burst period,
2692#     in seconds.  It must only be set if @iops-write-max is set as
2693#     well.
2694#
2695# @bps-total: limit total bytes per second
2696#
2697# @bps-total-max: total bytes burst
2698#
2699# @bps-total-max-length: length of the bps-total-max burst period, in
2700#     seconds.  It must only be set if @bps-total-max is set as well.
2701#
2702# @bps-read: limit read bytes per second
2703#
2704# @bps-read-max: total bytes read burst
2705#
2706# @bps-read-max-length: length of the bps-read-max burst period, in
2707#     seconds.  It must only be set if @bps-read-max is set as well.
2708#
2709# @bps-write: limit write bytes per second
2710#
2711# @bps-write-max: total bytes write burst
2712#
2713# @bps-write-max-length: length of the bps-write-max burst period, in
2714#     seconds.  It must only be set if @bps-write-max is set as well.
2715#
2716# @iops-size: when limiting by iops max size of an I/O in bytes
2717#
2718# Since: 2.11
2719##
2720{ 'struct': 'ThrottleLimits',
2721  'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2722            '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2723            '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2724            '*iops-write' : 'int', '*iops-write-max' : 'int',
2725            '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2726            '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2727            '*bps-read' : 'int', '*bps-read-max' : 'int',
2728            '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2729            '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2730            '*iops-size' : 'int' } }
2731
2732##
2733# @ThrottleGroupProperties:
2734#
2735# Properties for throttle-group objects.
2736#
2737# @limits: limits to apply for this throttle group
2738#
2739# Features:
2740#
2741# @unstable: All members starting with x- are aliases for the same key
2742#     without x- in the @limits object.  This is not a stable
2743#     interface and may be removed or changed incompatibly in the
2744#     future.  Use @limits for a supported stable interface.
2745#
2746# Since: 2.11
2747##
2748{ 'struct': 'ThrottleGroupProperties',
2749  'data': { '*limits': 'ThrottleLimits',
2750            '*x-iops-total': { 'type': 'int',
2751                               'features': [ 'unstable' ] },
2752            '*x-iops-total-max': { 'type': 'int',
2753                                   'features': [ 'unstable' ] },
2754            '*x-iops-total-max-length': { 'type': 'int',
2755                                          'features': [ 'unstable' ] },
2756            '*x-iops-read': { 'type': 'int',
2757                              'features': [ 'unstable' ] },
2758            '*x-iops-read-max': { 'type': 'int',
2759                                  'features': [ 'unstable' ] },
2760            '*x-iops-read-max-length': { 'type': 'int',
2761                                         'features': [ 'unstable' ] },
2762            '*x-iops-write': { 'type': 'int',
2763                               'features': [ 'unstable' ] },
2764            '*x-iops-write-max': { 'type': 'int',
2765                                   'features': [ 'unstable' ] },
2766            '*x-iops-write-max-length': { 'type': 'int',
2767                                          'features': [ 'unstable' ] },
2768            '*x-bps-total': { 'type': 'int',
2769                              'features': [ 'unstable' ] },
2770            '*x-bps-total-max': { 'type': 'int',
2771                                  'features': [ 'unstable' ] },
2772            '*x-bps-total-max-length': { 'type': 'int',
2773                                         'features': [ 'unstable' ] },
2774            '*x-bps-read': { 'type': 'int',
2775                             'features': [ 'unstable' ] },
2776            '*x-bps-read-max': { 'type': 'int',
2777                                 'features': [ 'unstable' ] },
2778            '*x-bps-read-max-length': { 'type': 'int',
2779                                        'features': [ 'unstable' ] },
2780            '*x-bps-write': { 'type': 'int',
2781                              'features': [ 'unstable' ] },
2782            '*x-bps-write-max': { 'type': 'int',
2783                                  'features': [ 'unstable' ] },
2784            '*x-bps-write-max-length': { 'type': 'int',
2785                                         'features': [ 'unstable' ] },
2786            '*x-iops-size': { 'type': 'int',
2787                              'features': [ 'unstable' ] } } }
2788
2789##
2790# @block-stream:
2791#
2792# Copy data from a backing file into a block device.
2793#
2794# The block streaming operation is performed in the background until
2795# the entire backing file has been copied.  This command returns
2796# immediately once streaming has started.  The status of ongoing block
2797# streaming operations can be checked with `query-block-jobs`.  The
2798# operation can be stopped before it has completed using the
2799# `job-cancel` or `block-job-cancel` command.
2800#
2801# The node that receives the data is called the top image, can be
2802# located in any part of the chain (but always above the base image;
2803# see below) and can be specified using its device or node name.
2804# Earlier QEMU versions only allowed 'device' to name the top level
2805# node; presence of the 'base-node' parameter during introspection can
2806# be used as a witness of the enhanced semantics of 'device'.
2807#
2808# If a base file is specified then sectors are not copied from that
2809# base file and its backing chain.  This can be used to stream a
2810# subset of the backing file chain instead of flattening the entire
2811# image.  When streaming completes the image file will have the base
2812# file as its backing file, unless that node was changed while the job
2813# was running.  In that case, base's parent's backing (or filtered,
2814# whichever exists) child (i.e., base at the beginning of the job)
2815# will be the new backing file.
2816#
2817# On successful completion the image file is updated to drop the
2818# backing file and the `BLOCK_JOB_COMPLETED` event is emitted.
2819#
2820# In case @device is a filter node, `block-stream` modifies the first
2821# non-filter overlay node below it to point to the new backing node
2822# instead of modifying @device itself.
2823#
2824# @job-id: identifier for the newly-created block job.  If omitted,
2825#     the device name will be used.  (Since 2.7)
2826#
2827# @device: the device or node name of the top image
2828#
2829# @base: the common backing file name.  It cannot be set if @base-node
2830#     or @bottom is also set.
2831#
2832# @base-node: the node name of the backing file.  It cannot be set if
2833#     @base or @bottom is also set.  (Since 2.8)
2834#
2835# @bottom: the last node in the chain that should be streamed into
2836#     top.  It cannot be set if @base or @base-node is also set.  It
2837#     cannot be filter node.  (Since 6.0)
2838#
2839# @backing-file: The backing file string to write into the top image.
2840#     This filename is not validated.
2841#
2842#     If a pathname string is such that it cannot be resolved by QEMU,
2843#     that means that subsequent QMP or HMP commands must use
2844#     node-names for the image in question, as filename lookup methods
2845#     will fail.
2846#
2847#     If not specified, QEMU will automatically determine the backing
2848#     file string to use, or error out if there is no obvious choice.
2849#     Care should be taken when specifying the string, to specify a
2850#     valid filename or protocol.  (Since 2.1)
2851#
2852# @backing-mask-protocol: If true, replace any protocol mentioned in
2853#     the 'backing file format' with 'raw', rather than storing the
2854#     protocol name as the backing format.  Can be used even when no
2855#     image header will be updated (default false; since 9.0).
2856#
2857# @speed: the maximum speed, in bytes per second
2858#
2859# @on-error: the action to take on an error (default report).  'stop'
2860#     and 'enospc' can only be used if the block device supports
2861#     io-status (see `BlockInfo`).  (Since 1.3)
2862#
2863# @filter-node-name: the node name that should be assigned to the
2864#     filter driver that the stream job inserts into the graph above
2865#     @device.  If this option is not given, a node name is
2866#     autogenerated.  (Since: 6.0)
2867#
2868# @auto-finalize: When false, this job will wait in a PENDING state
2869#     after it has finished its work, waiting for `job-finalize` before
2870#     making any block graph changes.  When true, this job will
2871#     automatically perform its abort or commit actions.  Defaults to
2872#     true.  (Since 3.1)
2873#
2874# @auto-dismiss: When false, this job will wait in a CONCLUDED state
2875#     after it has completely ceased all work, and awaits
2876#     `job-dismiss`.  When true, this job will automatically disappear
2877#     without user intervention.  Defaults to true.  (Since 3.1)
2878#
2879# Errors:
2880#     - If @device does not exist, DeviceNotFound.
2881#
2882# Since: 1.1
2883#
2884# .. qmp-example::
2885#
2886#     -> { "execute": "block-stream",
2887#          "arguments": { "device": "virtio0",
2888#                         "base": "/tmp/master.qcow2" } }
2889#     <- { "return": {} }
2890##
2891{ 'command': 'block-stream',
2892  'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2893            '*base-node': 'str', '*backing-file': 'str',
2894            '*backing-mask-protocol': 'bool',
2895            '*bottom': 'str',
2896            '*speed': 'int', '*on-error': 'BlockdevOnError',
2897            '*filter-node-name': 'str',
2898            '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
2899  'allow-preconfig': true }
2900
2901##
2902# @block-job-set-speed:
2903#
2904# Set maximum speed for a background block operation.
2905#
2906# This command can only be issued when there is an active block job.
2907#
2908# Throttling can be disabled by setting the speed to 0.
2909#
2910# @device: The job identifier.  This used to be a device name (hence
2911#     the name of the parameter), but since QEMU 2.7 it can have other
2912#     values.
2913#
2914# @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2915#     Defaults to 0.
2916#
2917# Errors:
2918#     - If no background operation is active on this device,
2919#       DeviceNotActive
2920#
2921# Since: 1.1
2922##
2923{ 'command': 'block-job-set-speed',
2924  'data': { 'device': 'str', 'speed': 'int' },
2925  'allow-preconfig': true }
2926
2927##
2928# @block-job-cancel:
2929#
2930# Stop an active background block operation.
2931#
2932# This command returns immediately after marking the active background
2933# block operation for cancellation.  It is an error to call this
2934# command if no operation is in progress.
2935#
2936# The operation will cancel as soon as possible and then emit the
2937# `BLOCK_JOB_CANCELLED` event.  Before that happens the job is still
2938# visible when enumerated using `query-block-jobs`.
2939#
2940# Note that if you issue `block-job-cancel` after `drive-mirror` has
2941# indicated (via the event `BLOCK_JOB_READY`) that the source and
2942# destination are synchronized, then the event triggered by this
2943# command changes to `BLOCK_JOB_COMPLETED`, to indicate that the
2944# mirroring has ended and the destination now has a point-in-time copy
2945# tied to the time of the cancellation.
2946#
2947# For streaming, the image file retains its backing file unless the
2948# streaming operation happens to complete just as it is being
2949# cancelled.  A new streaming operation can be started at a later time
2950# to finish copying all data from the backing file.
2951#
2952# @device: The job identifier.  This used to be a device name (hence
2953#     the name of the parameter), but since QEMU 2.7 it can have other
2954#     values.
2955#
2956# @force: If true, and the job has already emitted the event
2957#     `BLOCK_JOB_READY`, abandon the job immediately (even if it is
2958#     paused) instead of waiting for the destination to complete its
2959#     final synchronization (since 1.3)
2960#
2961# Errors:
2962#     - If no background operation is active on this device,
2963#       DeviceNotActive
2964#
2965# Since: 1.1
2966##
2967{ 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' },
2968  'allow-preconfig': true }
2969
2970##
2971# @block-job-pause:
2972#
2973# Pause an active background block operation.
2974#
2975# This command returns immediately after marking the active job for
2976# pausing.  Pausing an already paused job is an error.
2977#
2978# The job will pause as soon as possible, which means transitioning
2979# into the PAUSED state if it was RUNNING, or into STANDBY if it was
2980# READY.  The corresponding `JOB_STATUS_CHANGE` event will be emitted.
2981#
2982# Cancelling a paused job automatically resumes it.
2983#
2984# @device: The job identifier.  This used to be a device name (hence
2985#     the name of the parameter), but since QEMU 2.7 it can have other
2986#     values.
2987#
2988# Features:
2989#
2990# @deprecated: This command is deprecated.  Use `job-pause`
2991#     instead.
2992#
2993# Errors:
2994#     - If no background operation is active on this device,
2995#       DeviceNotActive
2996#
2997# Since: 1.3
2998##
2999{ 'command': 'block-job-pause', 'data': { 'device': 'str' },
3000  'features': ['deprecated'],
3001  'allow-preconfig': true }
3002
3003##
3004# @block-job-resume:
3005#
3006# Resume an active background block operation.
3007#
3008# This command returns immediately after resuming a paused job.
3009# Resuming an already running job is an error.
3010#
3011# This command also clears the error status of the job.
3012#
3013# @device: The job identifier.  This used to be a device name (hence
3014#     the name of the parameter), but since QEMU 2.7 it can have other
3015#     values.
3016#
3017# Features:
3018#
3019# @deprecated: This command is deprecated.  Use `job-resume`
3020#     instead.
3021#
3022# Errors:
3023#     - If no background operation is active on this device,
3024#       DeviceNotActive
3025#
3026# Since: 1.3
3027##
3028{ 'command': 'block-job-resume', 'data': { 'device': 'str' },
3029  'features': ['deprecated'],
3030  'allow-preconfig': true }
3031
3032##
3033# @block-job-complete:
3034#
3035# Manually trigger completion of an active job in the READY or STANDBY
3036# state.  Completing the job in any other state is an error.
3037#
3038# This is supported only for drive mirroring, where it also switches
3039# the device to write to the target path only.  Note that drive
3040# mirroring includes `drive-mirror`, `blockdev-mirror` and `block-commit`
3041# job (only in case of "active commit", when the node being commited
3042# is used by the guest).  The ability to complete is signaled with a
3043# `BLOCK_JOB_READY` event.
3044#
3045# This command completes an active background block operation
3046# synchronously.  The ordering of this command's return with the
3047# `BLOCK_JOB_COMPLETED` event is not defined.  Note that if an I/O error
3048# occurs during the processing of this command: 1) the command itself
3049# will fail; 2) the error will be processed according to the
3050# rerror/werror arguments that were specified when starting the
3051# operation.
3052#
3053# @device: The job identifier.  This used to be a device name (hence
3054#     the name of the parameter), but since QEMU 2.7 it can have other
3055#     values.
3056#
3057# Features:
3058#
3059# @deprecated: This command is deprecated.  Use `job-complete`
3060#     instead.
3061#
3062# Errors:
3063#     - If no background operation is active on this device,
3064#       DeviceNotActive
3065#
3066# Since: 1.3
3067##
3068{ 'command': 'block-job-complete', 'data': { 'device': 'str' },
3069  'features': ['deprecated'],
3070  'allow-preconfig': true }
3071
3072##
3073# @block-job-dismiss:
3074#
3075# Deletes a job that is in the CONCLUDED state.  This command only
3076# needs to be run explicitly for jobs that don't have automatic
3077# dismiss enabled.  In turn, automatic dismiss may be enabled only
3078# for jobs that have @auto-dismiss option, which are `drive-backup`,
3079# `blockdev-backup`, `drive-mirror`, `blockdev-mirror`, `block-commit` and
3080# `block-stream`.  @auto-dismiss is enabled by default for these
3081# jobs.
3082#
3083# This command will refuse to operate on any job that has not yet
3084# reached its terminal state, CONCLUDED.  For jobs that make use of
3085# the `BLOCK_JOB_READY` event, `job-cancel`, `block-job-cancel` or
3086# `job-complete` will still need to be used as appropriate.
3087#
3088# @id: The job identifier.
3089#
3090# Features:
3091#
3092# @deprecated: This command is deprecated.  Use `job-dismiss`
3093#     instead.
3094#
3095# Since: 2.12
3096##
3097{ 'command': 'block-job-dismiss', 'data': { 'id': 'str' },
3098  'features': ['deprecated'],
3099  'allow-preconfig': true }
3100
3101##
3102# @block-job-finalize:
3103#
3104# Instructs all jobs in a transaction (or a single job if it is not
3105# part of any transaction) to finalize any graph changes and do any
3106# necessary cleanup.  This command requires that all involved jobs are
3107# in the PENDING state.
3108#
3109# For jobs in a transaction, instructing one job to finalize will
3110# force ALL jobs in the transaction to finalize, so it is only
3111# necessary to instruct a single member job to finalize.
3112#
3113# The command is applicable only to jobs which have @auto-finalize option
3114# and only when this option is set to false.
3115#
3116# @id: The job identifier.
3117#
3118# Features:
3119#
3120# @deprecated: This command is deprecated.  Use `job-finalize`
3121#     instead.
3122#
3123# Since: 2.12
3124##
3125{ 'command': 'block-job-finalize', 'data': { 'id': 'str' },
3126  'features': ['deprecated'],
3127  'allow-preconfig': true }
3128
3129##
3130# @BlockJobChangeOptionsMirror:
3131#
3132# @copy-mode: Switch to this copy mode.  Currently, only the switch
3133#     from 'background' to 'write-blocking' is implemented.
3134#
3135# Since: 8.2
3136##
3137{ 'struct': 'BlockJobChangeOptionsMirror',
3138  'data': { 'copy-mode' : 'MirrorCopyMode' } }
3139
3140##
3141# @BlockJobChangeOptions:
3142#
3143# Block job options that can be changed after job creation.
3144#
3145# @id: The job identifier
3146#
3147# @type: The job type
3148#
3149# Since: 8.2
3150##
3151{ 'union': 'BlockJobChangeOptions',
3152  'base': { 'id': 'str', 'type': 'JobType' },
3153  'discriminator': 'type',
3154  'data': { 'mirror': 'BlockJobChangeOptionsMirror' } }
3155
3156##
3157# @block-job-change:
3158#
3159# Change the block job's options.
3160#
3161# Since: 8.2
3162##
3163{ 'command': 'block-job-change',
3164  'data': 'BlockJobChangeOptions', 'boxed': true }
3165
3166##
3167# @BlockdevDiscardOptions:
3168#
3169# Determines how to handle discard requests.
3170#
3171# @ignore: Ignore the request
3172#
3173# @unmap: Forward as an unmap request
3174#
3175# Since: 2.9
3176##
3177{ 'enum': 'BlockdevDiscardOptions',
3178  'data': [ 'ignore', 'unmap' ] }
3179
3180##
3181# @BlockdevDetectZeroesOptions:
3182#
3183# Describes the operation mode for the automatic conversion of plain
3184# zero writes by the OS to driver specific optimized zero write
3185# commands.
3186#
3187# @off: Disabled (default)
3188#
3189# @on: Enabled
3190#
3191# @unmap: Enabled and even try to unmap blocks if possible.  This
3192#     requires also that `BlockdevDiscardOptions` is set to unmap for
3193#     this device.
3194#
3195# Since: 2.1
3196##
3197{ 'enum': 'BlockdevDetectZeroesOptions',
3198  'data': [ 'off', 'on', 'unmap' ] }
3199
3200##
3201# @BlockdevAioOptions:
3202#
3203# Selects the AIO backend to handle I/O requests
3204#
3205# @threads: Use QEMU's thread pool
3206#
3207# @native: Use native AIO backend (only Linux and Windows)
3208#
3209# @io_uring: Use linux io_uring (since 5.0)
3210#
3211# Since: 2.9
3212##
3213{ 'enum': 'BlockdevAioOptions',
3214  'data': [ 'threads', 'native',
3215            { 'name': 'io_uring', 'if': 'CONFIG_LINUX_IO_URING' } ] }
3216
3217##
3218# @BlockdevCacheOptions:
3219#
3220# Includes cache-related options for block devices
3221#
3222# @direct: enables use of O_DIRECT (bypass the host page cache;
3223#     default: false)
3224#
3225# @no-flush: ignore any flush requests for the device (default: false)
3226#
3227# Since: 2.9
3228##
3229{ 'struct': 'BlockdevCacheOptions',
3230  'data': { '*direct': 'bool',
3231            '*no-flush': 'bool' } }
3232
3233##
3234# @BlockdevDriver:
3235#
3236# Drivers that are supported in block device operations.
3237#
3238# @throttle: Since 2.11
3239#
3240# @nvme: Since 2.12
3241#
3242# @copy-on-read: Since 3.0
3243#
3244# @blklogwrites: Since 3.0
3245#
3246# @blkreplay: Since 4.2
3247#
3248# @compress: Since 5.0
3249#
3250# @copy-before-write: Since 6.2
3251#
3252# @snapshot-access: Since 7.0
3253#
3254# Features:
3255#
3256# @deprecated: Member @gluster is deprecated because GlusterFS
3257#     development ceased.
3258#
3259# Since: 2.9
3260##
3261{ 'enum': 'BlockdevDriver',
3262  'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
3263            'cloop', 'compress', 'copy-before-write', 'copy-on-read', 'dmg',
3264            'file', 'snapshot-access', 'ftp', 'ftps',
3265            {'name': 'gluster', 'features': [ 'deprecated' ] },
3266            {'name': 'host_cdrom', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
3267            {'name': 'host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
3268            'http', 'https',
3269            { 'name': 'io_uring', 'if': 'CONFIG_BLKIO' },
3270            'iscsi',
3271            'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme',
3272            { 'name': 'nvme-io_uring', 'if': 'CONFIG_BLKIO' },
3273            'parallels', 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum',
3274            'raw', 'rbd',
3275            { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
3276            'ssh', 'throttle', 'vdi', 'vhdx',
3277            { 'name': 'virtio-blk-vfio-pci', 'if': 'CONFIG_BLKIO' },
3278            { 'name': 'virtio-blk-vhost-user', 'if': 'CONFIG_BLKIO' },
3279            { 'name': 'virtio-blk-vhost-vdpa', 'if': 'CONFIG_BLKIO' },
3280            'vmdk', 'vpc', 'vvfat' ] }
3281
3282##
3283# @BlockdevOptionsFile:
3284#
3285# Driver specific block device options for the file backend.
3286#
3287# @filename: path to the image file
3288#
3289# @pr-manager: the id for the object that will handle persistent
3290#     reservations for this device (default: none, forward the
3291#     commands via SG_IO; since 2.11)
3292#
3293# @aio: AIO backend (default: threads) (since: 2.8)
3294#
3295# @aio-max-batch: maximum number of requests to batch together into a
3296#     single submission in the AIO backend.  The smallest value
3297#     between this and the aio-max-batch value of the IOThread object
3298#     is chosen.  0 means that the AIO backend will handle it
3299#     automatically.  (default: 0, since 6.2)
3300#
3301# @locking: whether to enable file locking.  If set to 'auto', only
3302#     enable when Open File Descriptor (OFD) locking API is available
3303#     (default: auto, since 2.10)
3304#
3305# @drop-cache: invalidate page cache during live migration.  This
3306#     prevents stale data on the migration destination with
3307#     cache.direct=off.  Currently only supported on Linux hosts.
3308#     (default: on, since: 4.0)
3309#
3310# @x-check-cache-dropped: whether to check that page cache was dropped
3311#     on live migration.  May cause noticeable delays if the image
3312#     file is large, do not use in production.  (default: off)
3313#     (since: 3.0)
3314#
3315# Features:
3316#
3317# @dynamic-auto-read-only: If present, enabled auto-read-only means
3318#     that the driver will open the image read-only at first,
3319#     dynamically reopen the image file read-write when the first
3320#     writer is attached to the node and reopen read-only when the
3321#     last writer is detached.  This allows giving QEMU write
3322#     permissions only on demand when an operation actually needs
3323#     write access.
3324#
3325# @unstable: Member x-check-cache-dropped is meant for debugging.
3326#
3327# Since: 2.9
3328##
3329{ 'struct': 'BlockdevOptionsFile',
3330  'data': { 'filename': 'str',
3331            '*pr-manager': 'str',
3332            '*locking': 'OnOffAuto',
3333            '*aio': 'BlockdevAioOptions',
3334            '*aio-max-batch': 'int',
3335            '*drop-cache': {'type': 'bool',
3336                            'if': 'CONFIG_LINUX'},
3337            '*x-check-cache-dropped': { 'type': 'bool',
3338                                        'features': [ 'unstable' ] } },
3339  'features': [ { 'name': 'dynamic-auto-read-only',
3340                  'if': 'CONFIG_POSIX' } ] }
3341
3342##
3343# @BlockdevOptionsNull:
3344#
3345# Driver specific block device options for the null backend.
3346#
3347# @size: size of the device in bytes.
3348#
3349# @latency-ns: emulated latency (in nanoseconds) in processing
3350#     requests.  Default to zero which completes requests immediately.
3351#     (Since 2.4)
3352#
3353# @read-zeroes: if true, reads from the device produce zeroes; if
3354#     false, the buffer is left unchanged.
3355#     (default: false; since: 4.1)
3356#
3357# Since: 2.9
3358##
3359{ 'struct': 'BlockdevOptionsNull',
3360  'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
3361
3362##
3363# @BlockdevOptionsNVMe:
3364#
3365# Driver specific block device options for the NVMe backend.
3366#
3367# @device: PCI controller address of the NVMe device in format
3368#     hhhh:bb:ss.f (host:bus:slot.function)
3369#
3370# @namespace: namespace number of the device, starting from 1.
3371#
3372# Note that the PCI @device must have been unbound from any host
3373# kernel driver before instructing QEMU to add the blockdev.
3374#
3375# Since: 2.12
3376##
3377{ 'struct': 'BlockdevOptionsNVMe',
3378  'data': { 'device': 'str', 'namespace': 'int' } }
3379
3380##
3381# @BlockdevOptionsVVFAT:
3382#
3383# Driver specific block device options for the vvfat protocol.
3384#
3385# @dir: directory to be exported as FAT image
3386#
3387# @fat-type: FAT type: 12, 16 or 32
3388#
3389# @floppy: whether to export a floppy image (true) or partitioned hard
3390#     disk (false; default)
3391#
3392# @label: set the volume label, limited to 11 bytes.  FAT16 and FAT32
3393#     traditionally have some restrictions on labels, which are
3394#     ignored by most operating systems.  Defaults to "QEMU VVFAT".
3395#     (since 2.4)
3396#
3397# @rw: whether to allow write operations (default: false)
3398#
3399# Since: 2.9
3400##
3401{ 'struct': 'BlockdevOptionsVVFAT',
3402  'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
3403            '*label': 'str', '*rw': 'bool' } }
3404
3405##
3406# @BlockdevOptionsGenericFormat:
3407#
3408# Driver specific block device options for image format that have no
3409# option besides their data source.
3410#
3411# @file: reference to or definition of the data source block device
3412#
3413# Since: 2.9
3414##
3415{ 'struct': 'BlockdevOptionsGenericFormat',
3416  'data': { 'file': 'BlockdevRef' } }
3417
3418##
3419# @BlockdevOptionsLUKS:
3420#
3421# Driver specific block device options for LUKS.
3422#
3423# @key-secret: the ID of a QCryptoSecret object providing the
3424#     decryption key.  Mandatory except when doing a metadata-only
3425#     probe of the image.  (since 2.6)
3426#
3427# @header: block device holding a detached LUKS header.  (since 9.0)
3428#
3429# Since: 2.9
3430##
3431{ 'struct': 'BlockdevOptionsLUKS',
3432  'base': 'BlockdevOptionsGenericFormat',
3433  'data': { '*key-secret': 'str',
3434            '*header': 'BlockdevRef'} }
3435
3436##
3437# @BlockdevOptionsGenericCOWFormat:
3438#
3439# Driver specific block device options for image format that have no
3440# option besides their data source and an optional backing file.
3441#
3442# @backing: reference to or definition of the backing file block
3443#     device, null disables the backing file entirely.  Defaults to
3444#     the backing file stored the image file.
3445#
3446# Since: 2.9
3447##
3448{ 'struct': 'BlockdevOptionsGenericCOWFormat',
3449  'base': 'BlockdevOptionsGenericFormat',
3450  'data': { '*backing': 'BlockdevRefOrNull' } }
3451
3452##
3453# @Qcow2OverlapCheckMode:
3454#
3455# General overlap check modes.
3456#
3457# @none: Do not perform any checks
3458#
3459# @constant: Perform only checks which can be done in constant time
3460#     and without reading anything from disk
3461#
3462# @cached: Perform only checks which can be done without reading
3463#     anything from disk
3464#
3465# @all: Perform all available overlap checks
3466#
3467# Since: 2.9
3468##
3469{ 'enum': 'Qcow2OverlapCheckMode',
3470  'data': [ 'none', 'constant', 'cached', 'all' ] }
3471
3472##
3473# @Qcow2OverlapCheckFlags:
3474#
3475# Structure of flags for each metadata structure.  Setting a field to
3476# 'true' makes QEMU guard that Qcow2 format structure against
3477# unintended overwriting.  See Qcow2 format specification for detailed
3478# information on these structures.  The default value is chosen
3479# according to the template given.
3480#
3481# @template: Specifies a template mode which can be adjusted using the
3482#     other flags, defaults to 'cached'
3483#
3484# @main-header: Qcow2 format header
3485#
3486# @active-l1: Qcow2 active L1 table
3487#
3488# @active-l2: Qcow2 active L2 table
3489#
3490# @refcount-table: Qcow2 refcount table
3491#
3492# @refcount-block: Qcow2 refcount blocks
3493#
3494# @snapshot-table: Qcow2 snapshot table
3495#
3496# @inactive-l1: Qcow2 inactive L1 tables
3497#
3498# @inactive-l2: Qcow2 inactive L2 tables
3499#
3500# @bitmap-directory: Qcow2 bitmap directory (since 3.0)
3501#
3502# Since: 2.9
3503##
3504{ 'struct': 'Qcow2OverlapCheckFlags',
3505  'data': { '*template':         'Qcow2OverlapCheckMode',
3506            '*main-header':      'bool',
3507            '*active-l1':        'bool',
3508            '*active-l2':        'bool',
3509            '*refcount-table':   'bool',
3510            '*refcount-block':   'bool',
3511            '*snapshot-table':   'bool',
3512            '*inactive-l1':      'bool',
3513            '*inactive-l2':      'bool',
3514            '*bitmap-directory': 'bool' } }
3515
3516##
3517# @Qcow2OverlapChecks:
3518#
3519# Specifies which metadata structures should be guarded against
3520# unintended overwriting.
3521#
3522# @flags: set of flags for separate specification of each metadata
3523#     structure type
3524#
3525# @mode: named mode which chooses a specific set of flags
3526#
3527# Since: 2.9
3528##
3529{ 'alternate': 'Qcow2OverlapChecks',
3530  'data': { 'flags': 'Qcow2OverlapCheckFlags',
3531            'mode':  'Qcow2OverlapCheckMode' } }
3532
3533##
3534# @BlockdevQcowEncryptionFormat:
3535#
3536# @aes: AES-CBC with plain64 initialization vectors
3537#
3538# Since: 2.10
3539##
3540{ 'enum': 'BlockdevQcowEncryptionFormat',
3541  'data': [ 'aes' ] }
3542
3543##
3544# @BlockdevQcowEncryption:
3545#
3546# @format: encryption format
3547#
3548# Since: 2.10
3549##
3550{ 'union': 'BlockdevQcowEncryption',
3551  'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3552  'discriminator': 'format',
3553  'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3554
3555##
3556# @BlockdevOptionsQcow:
3557#
3558# Driver specific block device options for qcow.
3559#
3560# @encrypt: Image decryption options.  Mandatory for encrypted images,
3561#     except when doing a metadata-only probe of the image.
3562#
3563# Since: 2.10
3564##
3565{ 'struct': 'BlockdevOptionsQcow',
3566  'base': 'BlockdevOptionsGenericCOWFormat',
3567  'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3568
3569##
3570# @BlockdevQcow2EncryptionFormat:
3571#
3572# @aes: AES-CBC with plain64 initialization vectors
3573#
3574# Since: 2.10
3575##
3576{ 'enum': 'BlockdevQcow2EncryptionFormat',
3577  'data': [ 'aes', 'luks' ] }
3578
3579##
3580# @BlockdevQcow2Encryption:
3581#
3582# @format: encryption format
3583#
3584# Since: 2.10
3585##
3586{ 'union': 'BlockdevQcow2Encryption',
3587  'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3588  'discriminator': 'format',
3589  'data': { 'aes': 'QCryptoBlockOptionsQCow',
3590            'luks': 'QCryptoBlockOptionsLUKS'} }
3591
3592##
3593# @BlockdevOptionsPreallocate:
3594#
3595# Filter driver intended to be inserted between format and protocol
3596# node and do preallocation in protocol node on write.
3597#
3598# @prealloc-align: on preallocation, align file length to this number,
3599#     default 1048576 (1M)
3600#
3601# @prealloc-size: how much to preallocate, default 134217728 (128M)
3602#
3603# Since: 6.0
3604##
3605{ 'struct': 'BlockdevOptionsPreallocate',
3606  'base': 'BlockdevOptionsGenericFormat',
3607  'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } }
3608
3609##
3610# @BlockdevOptionsQcow2:
3611#
3612# Driver specific block device options for qcow2.
3613#
3614# @lazy-refcounts: whether to enable the lazy refcounts feature
3615#     (default is taken from the image file)
3616#
3617# @pass-discard-request: whether discard requests to the qcow2 device
3618#     should be forwarded to the data source
3619#
3620# @pass-discard-snapshot: whether discard requests for the data source
3621#     should be issued when a snapshot operation (e.g. deleting a
3622#     snapshot) frees clusters in the qcow2 file
3623#
3624# @pass-discard-other: whether discard requests for the data source
3625#     should be issued on other occasions where a cluster gets freed
3626#
3627# @discard-no-unref: when enabled, data clusters will remain
3628#     preallocated when they are no longer used, e.g. because they are
3629#     discarded or converted to zero clusters.  As usual, whether the
3630#     old data is discarded or kept on the protocol level (i.e. in the
3631#     image file) depends on the setting of the pass-discard-request
3632#     option.  Keeping the clusters preallocated prevents qcow2
3633#     fragmentation that would otherwise be caused by freeing and
3634#     re-allocating them later.  Besides potential performance
3635#     degradation, such fragmentation can lead to increased allocation
3636#     of clusters past the end of the image file, resulting in image
3637#     files whose file length can grow much larger than their guest
3638#     disk size would suggest.  If image file length is of concern
3639#     (e.g. when storing qcow2 images directly on block devices), you
3640#     should consider enabling this option.  (since 8.1)
3641#
3642# @overlap-check: which overlap checks to perform for writes to the
3643#     image, defaults to 'cached' (since 2.2)
3644#
3645# @cache-size: the maximum total size of the L2 table and refcount
3646#     block caches in bytes (since 2.2)
3647#
3648# @l2-cache-size: the maximum size of the L2 table cache in bytes
3649#     (since 2.2)
3650#
3651# @l2-cache-entry-size: the size of each entry in the L2 cache in
3652#     bytes.  It must be a power of two between 512 and the cluster
3653#     size.  The default value is the cluster size (since 2.12)
3654#
3655# @refcount-cache-size: the maximum size of the refcount block cache
3656#     in bytes (since 2.2)
3657#
3658# @cache-clean-interval: clean unused entries in the L2 and refcount
3659#     caches.  The interval is in seconds.  The default value is 600
3660#     on supporting platforms, and 0 on other platforms.  0 disables
3661#     this feature.  (since 2.5)
3662#
3663# @encrypt: Image decryption options.  Mandatory for encrypted images,
3664#     except when doing a metadata-only probe of the image.
3665#     (since 2.10)
3666#
3667# @data-file: reference to or definition of the external data file.
3668#     This may only be specified for images that require an external
3669#     data file.  If it is not specified for such an image, the data
3670#     file name is loaded from the image file.  (since 4.0)
3671#
3672# Since: 2.9
3673##
3674{ 'struct': 'BlockdevOptionsQcow2',
3675  'base': 'BlockdevOptionsGenericCOWFormat',
3676  'data': { '*lazy-refcounts': 'bool',
3677            '*pass-discard-request': 'bool',
3678            '*pass-discard-snapshot': 'bool',
3679            '*pass-discard-other': 'bool',
3680            '*discard-no-unref': 'bool',
3681            '*overlap-check': 'Qcow2OverlapChecks',
3682            '*cache-size': 'int',
3683            '*l2-cache-size': 'int',
3684            '*l2-cache-entry-size': 'int',
3685            '*refcount-cache-size': 'int',
3686            '*cache-clean-interval': 'int',
3687            '*encrypt': 'BlockdevQcow2Encryption',
3688            '*data-file': 'BlockdevRef' } }
3689
3690##
3691# @SshHostKeyCheckMode:
3692#
3693# @none: Don't check the host key at all
3694#
3695# @hash: Compare the host key with a given hash
3696#
3697# @known_hosts: Check the host key against the known_hosts file
3698#
3699# Since: 2.12
3700##
3701{ 'enum': 'SshHostKeyCheckMode',
3702  'data': [ 'none', 'hash', 'known_hosts' ] }
3703
3704##
3705# @SshHostKeyCheckHashType:
3706#
3707# @md5: The given hash is an md5 hash
3708#
3709# @sha1: The given hash is an sha1 hash
3710#
3711# @sha256: The given hash is an sha256 hash
3712#
3713# Since: 2.12
3714##
3715{ 'enum': 'SshHostKeyCheckHashType',
3716  'data': [ 'md5', 'sha1', 'sha256' ] }
3717
3718##
3719# @SshHostKeyHash:
3720#
3721# @type: The hash algorithm used for the hash
3722#
3723# @hash: The expected hash value
3724#
3725# Since: 2.12
3726##
3727{ 'struct': 'SshHostKeyHash',
3728  'data': { 'type': 'SshHostKeyCheckHashType',
3729            'hash': 'str' }}
3730
3731##
3732# @SshHostKeyCheck:
3733#
3734# @mode: How to check the host key
3735#
3736# Since: 2.12
3737##
3738{ 'union': 'SshHostKeyCheck',
3739  'base': { 'mode': 'SshHostKeyCheckMode' },
3740  'discriminator': 'mode',
3741  'data': { 'hash': 'SshHostKeyHash' } }
3742
3743##
3744# @BlockdevOptionsSsh:
3745#
3746# @server: host address
3747#
3748# @path: path to the image on the host
3749#
3750# @user: user as which to connect, defaults to current local user name
3751#
3752# @host-key-check: Defines how and what to check the host key against
3753#     (default: known_hosts)
3754#
3755# Since: 2.9
3756##
3757{ 'struct': 'BlockdevOptionsSsh',
3758  'data': { 'server': 'InetSocketAddress',
3759            'path': 'str',
3760            '*user': 'str',
3761            '*host-key-check': 'SshHostKeyCheck' } }
3762
3763##
3764# @BlkdebugEvent:
3765#
3766# Trigger events supported by blkdebug.
3767#
3768# @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3769#     (since 2.11)
3770#
3771# @l1_shrink_free_l2_clusters: discard the l2 tables.  (since 2.11)
3772#
3773# @cor_write: a write due to copy-on-read (since 2.11)
3774#
3775# @cluster_alloc_space: an allocation of file space for a cluster
3776#     (since 4.1)
3777#
3778# @none: triggers once at creation of the blkdebug node (since 4.1)
3779#
3780# Since: 2.9
3781##
3782{ 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3783  'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3784            'l1_grow_activate_table', 'l2_load', 'l2_update',
3785            'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3786            'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3787            'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3788            'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3789            'refblock_load', 'refblock_update', 'refblock_update_part',
3790            'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3791            'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3792            'refblock_alloc_switch_table', 'cluster_alloc',
3793            'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3794            'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3795            'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3796            'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3797            'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3798            'cor_write', 'cluster_alloc_space', 'none'] }
3799
3800##
3801# @BlkdebugIOType:
3802#
3803# Kinds of I/O that blkdebug can inject errors in.
3804#
3805# @read: .bdrv_co_preadv()
3806#
3807# @write: .bdrv_co_pwritev()
3808#
3809# @write-zeroes: .bdrv_co_pwrite_zeroes()
3810#
3811# @discard: .bdrv_co_pdiscard()
3812#
3813# @flush: .bdrv_co_flush_to_disk()
3814#
3815# @block-status: .bdrv_co_block_status()
3816#
3817# Since: 4.1
3818##
3819{ 'enum': 'BlkdebugIOType',
3820  'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3821            'block-status' ] }
3822
3823##
3824# @BlkdebugInjectErrorOptions:
3825#
3826# Describes a single error injection for blkdebug.
3827#
3828# @event: trigger event
3829#
3830# @state: the state identifier blkdebug needs to be in to actually
3831#     trigger the event; defaults to "any"
3832#
3833# @iotype: the type of I/O operations on which this error should be
3834#     injected; defaults to "all read, write, write-zeroes, discard,
3835#     and flush operations" (since: 4.1)
3836#
3837# @errno: error identifier (errno) to be returned; defaults to EIO
3838#
3839# @sector: specifies the sector index which has to be affected in
3840#     order to actually trigger the event; defaults to "any sector"
3841#
3842# @once: disables further events after this one has been triggered;
3843#     defaults to false
3844#
3845# @immediately: fail immediately; defaults to false
3846#
3847# Since: 2.9
3848##
3849{ 'struct': 'BlkdebugInjectErrorOptions',
3850  'data': { 'event': 'BlkdebugEvent',
3851            '*state': 'int',
3852            '*iotype': 'BlkdebugIOType',
3853            '*errno': 'int',
3854            '*sector': 'int',
3855            '*once': 'bool',
3856            '*immediately': 'bool' } }
3857
3858##
3859# @BlkdebugSetStateOptions:
3860#
3861# Describes a single state-change event for blkdebug.
3862#
3863# @event: trigger event
3864#
3865# @state: the current state identifier blkdebug needs to be in;
3866#     defaults to "any"
3867#
3868# @new_state: the state identifier blkdebug is supposed to assume if
3869#     this event is triggered
3870#
3871# Since: 2.9
3872##
3873{ 'struct': 'BlkdebugSetStateOptions',
3874  'data': { 'event': 'BlkdebugEvent',
3875            '*state': 'int',
3876            'new_state': 'int' } }
3877
3878##
3879# @BlockdevOptionsBlkdebug:
3880#
3881# Driver specific block device options for blkdebug.
3882#
3883# @image: underlying raw block device (or image file)
3884#
3885# @config: filename of the configuration file
3886#
3887# @align: required alignment for requests in bytes, must be positive
3888#     power of 2, or 0 for default
3889#
3890# @max-transfer: maximum size for I/O transfers in bytes, must be
3891#     positive multiple of @align and of the underlying file's request
3892#     alignment (but need not be a power of 2), or 0 for default
3893#     (since 2.10)
3894#
3895# @opt-write-zero: preferred alignment for write zero requests in
3896#     bytes, must be positive multiple of @align and of the underlying
3897#     file's request alignment (but need not be a power of 2), or 0
3898#     for default (since 2.10)
3899#
3900# @max-write-zero: maximum size for write zero requests in bytes, must
3901#     be positive multiple of @align, of @opt-write-zero, and of the
3902#     underlying file's request alignment (but need not be a power of
3903#     2), or 0 for default (since 2.10)
3904#
3905# @opt-discard: preferred alignment for discard requests in bytes,
3906#     must be positive multiple of @align and of the underlying file's
3907#     request alignment (but need not be a power of 2), or 0 for
3908#     default (since 2.10)
3909#
3910# @max-discard: maximum size for discard requests in bytes, must be
3911#     positive multiple of @align, of @opt-discard, and of the
3912#     underlying file's request alignment (but need not be a power of
3913#     2), or 0 for default (since 2.10)
3914#
3915# @inject-error: array of error injection descriptions
3916#
3917# @set-state: array of state-change descriptions
3918#
3919# @take-child-perms: Permissions to take on @image in addition to what
3920#     is necessary anyway (which depends on how the blkdebug node is
3921#     used).  Defaults to none.  (since 5.0)
3922#
3923# @unshare-child-perms: Permissions not to share on @image in addition
3924#     to what cannot be shared anyway (which depends on how the
3925#     blkdebug node is used).  Defaults to none.  (since 5.0)
3926#
3927# Since: 2.9
3928##
3929{ 'struct': 'BlockdevOptionsBlkdebug',
3930  'data': { 'image': 'BlockdevRef',
3931            '*config': 'str',
3932            '*align': 'int', '*max-transfer': 'int32',
3933            '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3934            '*opt-discard': 'int32', '*max-discard': 'int32',
3935            '*inject-error': ['BlkdebugInjectErrorOptions'],
3936            '*set-state': ['BlkdebugSetStateOptions'],
3937            '*take-child-perms': ['BlockPermission'],
3938            '*unshare-child-perms': ['BlockPermission'] } }
3939
3940##
3941# @BlockdevOptionsBlklogwrites:
3942#
3943# Driver specific block device options for blklogwrites.
3944#
3945# @file: block device
3946#
3947# @log: block device used to log writes to @file
3948#
3949# @log-sector-size: sector size used in logging writes to @file,
3950#     determines granularity of offsets and sizes of writes
3951#     (default: 512)
3952#
3953# @log-append: append to an existing log (default: false)
3954#
3955# @log-super-update-interval: interval of write requests after which
3956#     the log super block is updated to disk (default: 4096)
3957#
3958# Since: 3.0
3959##
3960{ 'struct': 'BlockdevOptionsBlklogwrites',
3961  'data': { 'file': 'BlockdevRef',
3962            'log': 'BlockdevRef',
3963            '*log-sector-size': 'uint32',
3964            '*log-append': 'bool',
3965            '*log-super-update-interval': 'uint64' } }
3966
3967##
3968# @BlockdevOptionsBlkverify:
3969#
3970# Driver specific block device options for blkverify.
3971#
3972# @test: block device to be tested
3973#
3974# @raw: raw image used for verification
3975#
3976# Since: 2.9
3977##
3978{ 'struct': 'BlockdevOptionsBlkverify',
3979  'data': { 'test': 'BlockdevRef',
3980            'raw': 'BlockdevRef' } }
3981
3982##
3983# @BlockdevOptionsBlkreplay:
3984#
3985# Driver specific block device options for blkreplay.
3986#
3987# @image: disk image which should be controlled with blkreplay
3988#
3989# Since: 4.2
3990##
3991{ 'struct': 'BlockdevOptionsBlkreplay',
3992  'data': { 'image': 'BlockdevRef' } }
3993
3994##
3995# @QuorumReadPattern:
3996#
3997# An enumeration of quorum read patterns.
3998#
3999# @quorum: read all the children and do a quorum vote on reads
4000#
4001# @fifo: read only from the first child that has not failed
4002#
4003# Since: 2.9
4004##
4005{ 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
4006
4007##
4008# @BlockdevOptionsQuorum:
4009#
4010# Driver specific block device options for Quorum
4011#
4012# @blkverify: true if the driver must print content mismatch set to
4013#     false by default
4014#
4015# @children: the children block devices to use
4016#
4017# @vote-threshold: the vote limit under which a read will fail
4018#
4019# @rewrite-corrupted: rewrite corrupted data when quorum is reached
4020#     (Since 2.1)
4021#
4022# @read-pattern: choose read pattern and set to quorum by default
4023#     (Since 2.2)
4024#
4025# Since: 2.9
4026##
4027{ 'struct': 'BlockdevOptionsQuorum',
4028  'data': { '*blkverify': 'bool',
4029            'children': [ 'BlockdevRef' ],
4030            'vote-threshold': 'int',
4031            '*rewrite-corrupted': 'bool',
4032            '*read-pattern': 'QuorumReadPattern' } }
4033
4034##
4035# @BlockdevOptionsGluster:
4036#
4037# Driver specific block device options for Gluster
4038#
4039# @volume: name of gluster volume where VM image resides
4040#
4041# @path: absolute path to image file in gluster volume
4042#
4043# @server: gluster servers description
4044#
4045# @debug: libgfapi log level (default '4' which is Error) (Since 2.8)
4046#
4047# @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
4048#
4049# Since: 2.9
4050##
4051{ 'struct': 'BlockdevOptionsGluster',
4052  'data': { 'volume': 'str',
4053            'path': 'str',
4054            'server': ['SocketAddress'],
4055            '*debug': 'int',
4056            '*logfile': 'str' } }
4057
4058##
4059# @BlockdevOptionsIoUring:
4060#
4061# Driver specific block device options for the io_uring backend.
4062#
4063# @filename: path to the image file
4064#
4065# Since: 7.2
4066##
4067{ 'struct': 'BlockdevOptionsIoUring',
4068  'data': { 'filename': 'str' },
4069  'if': 'CONFIG_BLKIO' }
4070
4071##
4072# @BlockdevOptionsNvmeIoUring:
4073#
4074# Driver specific block device options for the nvme-io_uring backend.
4075#
4076# @path: path to the NVMe namespace's character device (e.g.
4077#     /dev/ng0n1).
4078#
4079# Since: 7.2
4080##
4081{ 'struct': 'BlockdevOptionsNvmeIoUring',
4082  'data': { 'path': 'str' },
4083  'if': 'CONFIG_BLKIO' }
4084
4085##
4086# @BlockdevOptionsVirtioBlkVfioPci:
4087#
4088# Driver specific block device options for the virtio-blk-vfio-pci
4089# backend.
4090#
4091# @path: path to the PCI device's sysfs directory (e.g.
4092#     /sys/bus/pci/devices/0000:00:01.0).
4093#
4094# Since: 7.2
4095##
4096{ 'struct': 'BlockdevOptionsVirtioBlkVfioPci',
4097  'data': { 'path': 'str' },
4098  'if': 'CONFIG_BLKIO' }
4099
4100##
4101# @BlockdevOptionsVirtioBlkVhostUser:
4102#
4103# Driver specific block device options for the virtio-blk-vhost-user
4104# backend.
4105#
4106# @path: path to the vhost-user UNIX domain socket.
4107#
4108# Since: 7.2
4109##
4110{ 'struct': 'BlockdevOptionsVirtioBlkVhostUser',
4111  'data': { 'path': 'str' },
4112  'if': 'CONFIG_BLKIO' }
4113
4114##
4115# @BlockdevOptionsVirtioBlkVhostVdpa:
4116#
4117# Driver specific block device options for the virtio-blk-vhost-vdpa
4118# backend.
4119#
4120# @path: path to the vhost-vdpa character device.
4121#
4122# Features:
4123#
4124# @fdset: Member @path supports the special "/dev/fdset/N" path
4125#     (since 8.1)
4126#
4127# Since: 7.2
4128##
4129{ 'struct': 'BlockdevOptionsVirtioBlkVhostVdpa',
4130  'data': { 'path': 'str' },
4131  'features': [ { 'name' :'fdset',
4132                  'if': 'CONFIG_BLKIO_VHOST_VDPA_FD' } ],
4133  'if': 'CONFIG_BLKIO' }
4134
4135##
4136# @IscsiTransport:
4137#
4138# An enumeration of libiscsi transport types
4139#
4140# Since: 2.9
4141##
4142{ 'enum': 'IscsiTransport',
4143  'data': [ 'tcp', 'iser' ] }
4144
4145##
4146# @IscsiHeaderDigest:
4147#
4148# An enumeration of header digests supported by libiscsi
4149#
4150# Since: 2.9
4151##
4152{ 'enum': 'IscsiHeaderDigest',
4153  'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
4154  'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
4155
4156##
4157# @BlockdevOptionsIscsi:
4158#
4159# Driver specific block device options for iscsi
4160#
4161# @transport: The iscsi transport type
4162#
4163# @portal: The address of the iscsi portal
4164#
4165# @target: The target iqn name
4166#
4167# @lun: LUN to connect to.  Defaults to 0.
4168#
4169# @user: User name to log in with.  If omitted, no CHAP authentication
4170#     is performed.
4171#
4172# @password-secret: The ID of a QCryptoSecret object providing the
4173#     password for the login.  This option is required if @user is
4174#     specified.
4175#
4176# @initiator-name: The iqn name we want to identify to the target as.
4177#     If this option is not specified, an initiator name is generated
4178#     automatically.
4179#
4180# @header-digest: The desired header digest.  Defaults to none-crc32c.
4181#
4182# @timeout: Timeout in seconds after which a request will timeout.  0
4183#     means no timeout and is the default.
4184#
4185# Since: 2.9
4186##
4187{ 'struct': 'BlockdevOptionsIscsi',
4188  'data': { 'transport': 'IscsiTransport',
4189            'portal': 'str',
4190            'target': 'str',
4191            '*lun': 'int',
4192            '*user': 'str',
4193            '*password-secret': 'str',
4194            '*initiator-name': 'str',
4195            '*header-digest': 'IscsiHeaderDigest',
4196            '*timeout': 'int' } }
4197
4198##
4199# @RbdAuthMode:
4200#
4201# Since: 3.0
4202##
4203{ 'enum': 'RbdAuthMode',
4204  'data': [ 'cephx', 'none' ] }
4205
4206##
4207# @RbdImageEncryptionFormat:
4208#
4209# @luks-any: Used for opening either luks or luks2 (Since 8.0)
4210#
4211# Since: 6.1
4212##
4213{ 'enum': 'RbdImageEncryptionFormat',
4214  'data': [ 'luks', 'luks2', 'luks-any' ] }
4215
4216##
4217# @RbdEncryptionOptionsLUKSBase:
4218#
4219# @key-secret: ID of a QCryptoSecret object providing a passphrase for
4220#     unlocking the encryption
4221#
4222# Since: 6.1
4223##
4224{ 'struct': 'RbdEncryptionOptionsLUKSBase',
4225  'data': { 'key-secret': 'str' } }
4226
4227##
4228# @RbdEncryptionCreateOptionsLUKSBase:
4229#
4230# @cipher-alg: The encryption algorithm
4231#
4232# Since: 6.1
4233##
4234{ 'struct': 'RbdEncryptionCreateOptionsLUKSBase',
4235  'base': 'RbdEncryptionOptionsLUKSBase',
4236  'data': { '*cipher-alg': 'QCryptoCipherAlgo' } }
4237
4238##
4239# @RbdEncryptionOptionsLUKS:
4240#
4241# Since: 6.1
4242##
4243{ 'struct': 'RbdEncryptionOptionsLUKS',
4244  'base': 'RbdEncryptionOptionsLUKSBase',
4245  'data': { } }
4246
4247##
4248# @RbdEncryptionOptionsLUKS2:
4249#
4250# Since: 6.1
4251##
4252{ 'struct': 'RbdEncryptionOptionsLUKS2',
4253  'base': 'RbdEncryptionOptionsLUKSBase',
4254  'data': { } }
4255
4256##
4257# @RbdEncryptionOptionsLUKSAny:
4258#
4259# Since: 8.0
4260##
4261{ 'struct': 'RbdEncryptionOptionsLUKSAny',
4262  'base': 'RbdEncryptionOptionsLUKSBase',
4263  'data': { } }
4264
4265##
4266# @RbdEncryptionCreateOptionsLUKS:
4267#
4268# Since: 6.1
4269##
4270{ 'struct': 'RbdEncryptionCreateOptionsLUKS',
4271  'base': 'RbdEncryptionCreateOptionsLUKSBase',
4272  'data': { } }
4273
4274##
4275# @RbdEncryptionCreateOptionsLUKS2:
4276#
4277# Since: 6.1
4278##
4279{ 'struct': 'RbdEncryptionCreateOptionsLUKS2',
4280  'base': 'RbdEncryptionCreateOptionsLUKSBase',
4281  'data': { } }
4282
4283##
4284# @RbdEncryptionOptions:
4285#
4286# @format: Encryption format.
4287#
4288# @parent: Parent image encryption options (for cloned images).  Can
4289#     be left unspecified if this cloned image is encrypted using the
4290#     same format and secret as its parent image (i.e. not explicitly
4291#     formatted) or if its parent image is not encrypted.  (Since 8.0)
4292#
4293# Since: 6.1
4294##
4295{ 'union': 'RbdEncryptionOptions',
4296  'base': { 'format': 'RbdImageEncryptionFormat',
4297            '*parent': 'RbdEncryptionOptions' },
4298  'discriminator': 'format',
4299  'data': { 'luks': 'RbdEncryptionOptionsLUKS',
4300            'luks2': 'RbdEncryptionOptionsLUKS2',
4301            'luks-any': 'RbdEncryptionOptionsLUKSAny'} }
4302
4303##
4304# @RbdEncryptionCreateOptions:
4305#
4306# @format: Encryption format.
4307#
4308# Since: 6.1
4309##
4310{ 'union': 'RbdEncryptionCreateOptions',
4311  'base': { 'format': 'RbdImageEncryptionFormat' },
4312  'discriminator': 'format',
4313  'data': { 'luks': 'RbdEncryptionCreateOptionsLUKS',
4314            'luks2': 'RbdEncryptionCreateOptionsLUKS2' } }
4315
4316##
4317# @BlockdevOptionsRbd:
4318#
4319# @pool: Ceph pool name.
4320#
4321# @namespace: Rados namespace name in the Ceph pool.  (Since 5.0)
4322#
4323# @image: Image name in the Ceph pool.
4324#
4325# @conf: path to Ceph configuration file.  Values in the configuration
4326#     file will be overridden by options specified via QAPI.
4327#
4328# @snapshot: Ceph snapshot name.
4329#
4330# @encrypt: Image encryption options.  (Since 6.1)
4331#
4332# @user: Ceph id name.
4333#
4334# @auth-client-required: Acceptable authentication modes.  This maps
4335#     to Ceph configuration option "auth_client_required".
4336#     (Since 3.0)
4337#
4338# @key-secret: ID of a QCryptoSecret object providing a key for cephx
4339#     authentication.  This maps to Ceph configuration option "key".
4340#     (Since 3.0)
4341#
4342# @server: Monitor host address and port.  This maps to the "mon_host"
4343#     Ceph option.
4344#
4345# Since: 2.9
4346##
4347{ 'struct': 'BlockdevOptionsRbd',
4348  'data': { 'pool': 'str',
4349            '*namespace': 'str',
4350            'image': 'str',
4351            '*conf': 'str',
4352            '*snapshot': 'str',
4353            '*encrypt': 'RbdEncryptionOptions',
4354            '*user': 'str',
4355            '*auth-client-required': ['RbdAuthMode'],
4356            '*key-secret': 'str',
4357            '*server': ['InetSocketAddressBase'] } }
4358
4359##
4360# @ReplicationMode:
4361#
4362# An enumeration of replication modes.
4363#
4364# @primary: Primary mode, the vm's state will be sent to secondary
4365#     QEMU.
4366#
4367# @secondary: Secondary mode, receive the vm's state from primary
4368#     QEMU.
4369#
4370# Since: 2.9
4371##
4372{ 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
4373  'if': 'CONFIG_REPLICATION' }
4374
4375##
4376# @BlockdevOptionsReplication:
4377#
4378# Driver specific block device options for replication
4379#
4380# @mode: the replication mode
4381#
4382# @top-id: In secondary mode, node name or device ID of the root node
4383#     who owns the replication node chain.  Must not be given in
4384#     primary mode.
4385#
4386# Since: 2.9
4387##
4388{ 'struct': 'BlockdevOptionsReplication',
4389  'base': 'BlockdevOptionsGenericFormat',
4390  'data': { 'mode': 'ReplicationMode',
4391            '*top-id': 'str' },
4392  'if': 'CONFIG_REPLICATION' }
4393
4394##
4395# @NFSTransport:
4396#
4397# An enumeration of NFS transport types
4398#
4399# @inet: TCP transport
4400#
4401# Since: 2.9
4402##
4403{ 'enum': 'NFSTransport',
4404  'data': [ 'inet' ] }
4405
4406##
4407# @NFSServer:
4408#
4409# Captures the address of the socket
4410#
4411# @type: transport type used for NFS (only TCP supported)
4412#
4413# @host: host address for NFS server
4414#
4415# Since: 2.9
4416##
4417{ 'struct': 'NFSServer',
4418  'data': { 'type': 'NFSTransport',
4419            'host': 'str' } }
4420
4421##
4422# @BlockdevOptionsNfs:
4423#
4424# Driver specific block device option for NFS
4425#
4426# @server: host address
4427#
4428# @path: path of the image on the host
4429#
4430# @user: UID value to use when talking to the server (defaults to
4431#     65534 on Windows and getuid() on unix)
4432#
4433# @group: GID value to use when talking to the server (defaults to
4434#     65534 on Windows and getgid() in unix)
4435#
4436# @tcp-syn-count: number of SYNs during the session establishment
4437#     (defaults to libnfs default)
4438#
4439# @readahead-size: set the readahead size in bytes (defaults to libnfs
4440#     default)
4441#
4442# @page-cache-size: set the pagecache size in bytes (defaults to
4443#     libnfs default)
4444#
4445# @debug: set the NFS debug level (max 2) (defaults to libnfs default)
4446#
4447# Since: 2.9
4448##
4449{ 'struct': 'BlockdevOptionsNfs',
4450  'data': { 'server': 'NFSServer',
4451            'path': 'str',
4452            '*user': 'int',
4453            '*group': 'int',
4454            '*tcp-syn-count': 'int',
4455            '*readahead-size': 'int',
4456            '*page-cache-size': 'int',
4457            '*debug': 'int' } }
4458
4459##
4460# @BlockdevOptionsCurlBase:
4461#
4462# Driver specific block device options shared by all protocols
4463# supported by the curl backend.
4464#
4465# @url: URL of the image file
4466#
4467# @readahead: Size of the read-ahead cache; must be a multiple of 512
4468#     (defaults to 256 kB)
4469#
4470# @timeout: Timeout for connections, in seconds (defaults to 5)
4471#
4472# @username: Username for authentication (defaults to none)
4473#
4474# @password-secret: ID of a QCryptoSecret object providing a password
4475#     for authentication (defaults to no password)
4476#
4477# @proxy-username: Username for proxy authentication (defaults to
4478#     none)
4479#
4480# @proxy-password-secret: ID of a QCryptoSecret object providing a
4481#     password for proxy authentication (defaults to no password)
4482#
4483# Since: 2.9
4484##
4485{ 'struct': 'BlockdevOptionsCurlBase',
4486  'data': { 'url': 'str',
4487            '*readahead': 'int',
4488            '*timeout': 'int',
4489            '*username': 'str',
4490            '*password-secret': 'str',
4491            '*proxy-username': 'str',
4492            '*proxy-password-secret': 'str' } }
4493
4494##
4495# @BlockdevOptionsCurlHttp:
4496#
4497# Driver specific block device options for HTTP connections over the
4498# curl backend.  URLs must start with "http://".
4499#
4500# @cookie: List of cookies to set; format is "name1=content1;
4501#     name2=content2;" as explained by CURLOPT_COOKIE(3).  Defaults to
4502#     no cookies.
4503#
4504# @cookie-secret: ID of a QCryptoSecret object providing the cookie
4505#     data in a secure way.  See @cookie for the format.  (since 2.10)
4506#
4507# Since: 2.9
4508##
4509{ 'struct': 'BlockdevOptionsCurlHttp',
4510  'base': 'BlockdevOptionsCurlBase',
4511  'data': { '*cookie': 'str',
4512            '*cookie-secret': 'str'} }
4513
4514##
4515# @BlockdevOptionsCurlHttps:
4516#
4517# Driver specific block device options for HTTPS connections over the
4518# curl backend.  URLs must start with "https://".
4519#
4520# @cookie: List of cookies to set; format is "name1=content1;
4521#     name2=content2;" as explained by CURLOPT_COOKIE(3).  Defaults to
4522#     no cookies.
4523#
4524# @sslverify: Whether to verify the SSL certificate's validity
4525#     (defaults to true)
4526#
4527# @cookie-secret: ID of a QCryptoSecret object providing the cookie
4528#     data in a secure way.  See @cookie for the format.  (since 2.10)
4529#
4530# Since: 2.9
4531##
4532{ 'struct': 'BlockdevOptionsCurlHttps',
4533  'base': 'BlockdevOptionsCurlBase',
4534  'data': { '*cookie': 'str',
4535            '*sslverify': 'bool',
4536            '*cookie-secret': 'str'} }
4537
4538##
4539# @BlockdevOptionsCurlFtp:
4540#
4541# Driver specific block device options for FTP connections over the
4542# curl backend.  URLs must start with "ftp://".
4543#
4544# Since: 2.9
4545##
4546{ 'struct': 'BlockdevOptionsCurlFtp',
4547  'base': 'BlockdevOptionsCurlBase',
4548  'data': { } }
4549
4550##
4551# @BlockdevOptionsCurlFtps:
4552#
4553# Driver specific block device options for FTPS connections over the
4554# curl backend.  URLs must start with "ftps://".
4555#
4556# @sslverify: Whether to verify the SSL certificate's validity
4557#     (defaults to true)
4558#
4559# Since: 2.9
4560##
4561{ 'struct': 'BlockdevOptionsCurlFtps',
4562  'base': 'BlockdevOptionsCurlBase',
4563  'data': { '*sslverify': 'bool' } }
4564
4565##
4566# @BlockdevOptionsNbd:
4567#
4568# Driver specific block device options for NBD.
4569#
4570# @server: NBD server address
4571#
4572# @export: export name
4573#
4574# @tls-creds: TLS credentials ID
4575#
4576# @tls-hostname: TLS hostname override for certificate validation
4577#     (Since 7.0)
4578#
4579# @x-dirty-bitmap: A metadata context name such as
4580#     "qemu:dirty-bitmap:NAME" or "qemu:allocation-depth" to query in
4581#     place of the traditional "base:allocation" block status (see
4582#     NBD_OPT_LIST_META_CONTEXT in the NBD protocol; and yes, naming
4583#     this option x-context would have made more sense) (since 3.0)
4584#
4585# @reconnect-delay: On an unexpected disconnect, the nbd client tries
4586#     to connect again until succeeding or encountering a serious
4587#     error.  During the first @reconnect-delay seconds, all requests
4588#     are paused and will be rerun on a successful reconnect.  After
4589#     that time, any delayed requests and all future requests before a
4590#     successful reconnect will immediately fail.  Default 0
4591#     (Since 4.2)
4592#
4593# @open-timeout: In seconds.  If zero, the nbd driver tries the
4594#     connection only once, and fails to open if the connection fails.
4595#     If non-zero, the nbd driver will repeat connection attempts
4596#     until successful or until @open-timeout seconds have elapsed.
4597#     Default 0 (Since 7.0)
4598#
4599# Features:
4600#
4601# @unstable: Member @x-dirty-bitmap is experimental.
4602#
4603# Since: 2.9
4604##
4605{ 'struct': 'BlockdevOptionsNbd',
4606  'data': { 'server': 'SocketAddress',
4607            '*export': 'str',
4608            '*tls-creds': 'str',
4609            '*tls-hostname': 'str',
4610            '*x-dirty-bitmap': { 'type': 'str', 'features': [ 'unstable' ] },
4611            '*reconnect-delay': 'uint32',
4612            '*open-timeout': 'uint32' } }
4613
4614##
4615# @BlockdevOptionsRaw:
4616#
4617# Driver specific block device options for the raw driver.
4618#
4619# @offset: position where the block device starts
4620#
4621# @size: the assumed size of the device
4622#
4623# Since: 2.9
4624##
4625{ 'struct': 'BlockdevOptionsRaw',
4626  'base': 'BlockdevOptionsGenericFormat',
4627  'data': { '*offset': 'int', '*size': 'int' } }
4628
4629##
4630# @BlockdevOptionsThrottle:
4631#
4632# Driver specific block device options for the throttle driver
4633#
4634# @throttle-group: the name of the throttle-group object to use.  It
4635#     must already exist.
4636#
4637# @file: reference to or definition of the data source block device
4638#
4639# Since: 2.11
4640##
4641{ 'struct': 'BlockdevOptionsThrottle',
4642  'data': { 'throttle-group': 'str',
4643            'file' : 'BlockdevRef'
4644             } }
4645
4646##
4647# @BlockdevOptionsCor:
4648#
4649# Driver specific block device options for the copy-on-read driver.
4650#
4651# @bottom: The name of a non-filter node (allocation-bearing layer)
4652#     that limits the COR operations in the backing chain (inclusive),
4653#     so that no data below this node will be copied by this filter.
4654#     If option is absent, the limit is not applied, so that data from
4655#     all backing layers may be copied.
4656#
4657# Since: 6.0
4658##
4659{ 'struct': 'BlockdevOptionsCor',
4660  'base': 'BlockdevOptionsGenericFormat',
4661  'data': { '*bottom': 'str' } }
4662
4663##
4664# @OnCbwError:
4665#
4666# An enumeration of possible behaviors for copy-before-write operation
4667# failures.
4668#
4669# @break-guest-write: report the error to the guest.  This way, the
4670#     guest will not be able to overwrite areas that cannot be backed
4671#     up, so the backup process remains valid.
4672#
4673# @break-snapshot: continue guest write.  Doing so will make the
4674#     provided snapshot state invalid and any backup or export process
4675#     based on it will finally fail.
4676#
4677# Since: 7.1
4678##
4679{ 'enum': 'OnCbwError',
4680  'data': [ 'break-guest-write', 'break-snapshot' ] }
4681
4682##
4683# @BlockdevOptionsCbw:
4684#
4685# Driver specific block device options for the copy-before-write
4686# driver, which does so called copy-before-write operations: when data
4687# is written to the filter, the filter first reads corresponding
4688# blocks from its file child and copies them to @target child.  After
4689# successfully copying, the write request is propagated to file child.
4690# If copying fails, the original write request is failed too and no
4691# data is written to file child.
4692#
4693# @target: The target for copy-before-write operations.
4694#
4695# @bitmap: If specified, copy-before-write filter will do
4696#     copy-before-write operations only for dirty regions of the
4697#     bitmap.  Bitmap size must be equal to length of file and target
4698#     child of the filter.  Note also, that bitmap is used only to
4699#     initialize internal bitmap of the process, so further
4700#     modifications (or removing) of specified bitmap doesn't
4701#     influence the filter.  (Since 7.0)
4702#
4703# @on-cbw-error: Behavior on failure of copy-before-write operation.
4704#     Default is @break-guest-write.  (Since 7.1)
4705#
4706# @cbw-timeout: Zero means no limit.  Non-zero sets the timeout in
4707#     seconds for copy-before-write operation.  When a timeout occurs,
4708#     the respective copy-before-write operation will fail, and the
4709#     @on-cbw-error parameter will decide how this failure is handled.
4710#     Default 0.  (Since 7.1)
4711#
4712# @min-cluster-size: Minimum size of blocks used by copy-before-write
4713#     operations.  Has to be a power of 2.  No effect if smaller than
4714#     the maximum of the target's cluster size and 64 KiB.  Default 0.
4715#     (Since 9.2)
4716#
4717# Since: 6.2
4718##
4719{ 'struct': 'BlockdevOptionsCbw',
4720  'base': 'BlockdevOptionsGenericFormat',
4721  'data': { 'target': 'BlockdevRef', '*bitmap': 'BlockDirtyBitmap',
4722            '*on-cbw-error': 'OnCbwError', '*cbw-timeout': 'uint32',
4723            '*min-cluster-size': 'size' } }
4724
4725##
4726# @BlockdevOptions:
4727#
4728# Options for creating a block device.  Many options are available for
4729# all block devices, independent of the block driver:
4730#
4731# @driver: block driver name
4732#
4733# @node-name: the node name of the new node.  This option is required
4734#     on the top level of `blockdev-add`.  Valid node names start with
4735#     an alphabetic character and may contain only alphanumeric
4736#     characters, '-', '.' and '_'.  Their maximum length is 31
4737#     characters.  (Since 2.0)
4738#
4739# @discard: discard-related options (default: ignore)
4740#
4741# @cache: cache-related options
4742#
4743# @active: whether the block node should be activated (default: true).
4744#     Having inactive block nodes is useful primarily for migration because it
4745#     allows opening an image on the destination while the source is still
4746#     holding locks for it.  (Since 10.0)
4747#
4748# @read-only: whether the block device should be read-only (default:
4749#     false).  Note that some block drivers support only read-only
4750#     access, either generally or in certain configurations.  In this
4751#     case, the default value does not work and the option must be
4752#     specified explicitly.
4753#
4754# @auto-read-only: if true and @read-only is false, QEMU may
4755#     automatically decide not to open the image read-write as
4756#     requested, but fall back to read-only instead (and switch
4757#     between the modes later), e.g. depending on whether the image
4758#     file is writable or whether a writing user is attached to the
4759#     node (default: false, since 3.1)
4760#
4761# @detect-zeroes: detect and optimize zero writes (Since 2.1)
4762#     (default: off)
4763#
4764# @force-share: force share all permission on added nodes.  Requires
4765#     read-only=true.  (Since 2.10)
4766#
4767# Since: 2.9
4768##
4769{ 'union': 'BlockdevOptions',
4770  'base': { 'driver': 'BlockdevDriver',
4771            '*node-name': 'str',
4772            '*discard': 'BlockdevDiscardOptions',
4773            '*cache': 'BlockdevCacheOptions',
4774            '*active': 'bool',
4775            '*read-only': 'bool',
4776            '*auto-read-only': 'bool',
4777            '*force-share': 'bool',
4778            '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
4779  'discriminator': 'driver',
4780  'data': {
4781      'blkdebug':   'BlockdevOptionsBlkdebug',
4782      'blklogwrites':'BlockdevOptionsBlklogwrites',
4783      'blkverify':  'BlockdevOptionsBlkverify',
4784      'blkreplay':  'BlockdevOptionsBlkreplay',
4785      'bochs':      'BlockdevOptionsGenericFormat',
4786      'cloop':      'BlockdevOptionsGenericFormat',
4787      'compress':   'BlockdevOptionsGenericFormat',
4788      'copy-before-write':'BlockdevOptionsCbw',
4789      'copy-on-read':'BlockdevOptionsCor',
4790      'dmg':        'BlockdevOptionsGenericFormat',
4791      'file':       'BlockdevOptionsFile',
4792      'ftp':        'BlockdevOptionsCurlFtp',
4793      'ftps':       'BlockdevOptionsCurlFtps',
4794      'gluster':    'BlockdevOptionsGluster',
4795      'host_cdrom':  { 'type': 'BlockdevOptionsFile',
4796                       'if': 'HAVE_HOST_BLOCK_DEVICE' },
4797      'host_device': { 'type': 'BlockdevOptionsFile',
4798                       'if': 'HAVE_HOST_BLOCK_DEVICE' },
4799      'http':       'BlockdevOptionsCurlHttp',
4800      'https':      'BlockdevOptionsCurlHttps',
4801      'io_uring':   { 'type': 'BlockdevOptionsIoUring',
4802                      'if': 'CONFIG_BLKIO' },
4803      'iscsi':      'BlockdevOptionsIscsi',
4804      'luks':       'BlockdevOptionsLUKS',
4805      'nbd':        'BlockdevOptionsNbd',
4806      'nfs':        'BlockdevOptionsNfs',
4807      'null-aio':   'BlockdevOptionsNull',
4808      'null-co':    'BlockdevOptionsNull',
4809      'nvme':       'BlockdevOptionsNVMe',
4810      'nvme-io_uring': { 'type': 'BlockdevOptionsNvmeIoUring',
4811                         'if': 'CONFIG_BLKIO' },
4812      'parallels':  'BlockdevOptionsGenericFormat',
4813      'preallocate':'BlockdevOptionsPreallocate',
4814      'qcow2':      'BlockdevOptionsQcow2',
4815      'qcow':       'BlockdevOptionsQcow',
4816      'qed':        'BlockdevOptionsGenericCOWFormat',
4817      'quorum':     'BlockdevOptionsQuorum',
4818      'raw':        'BlockdevOptionsRaw',
4819      'rbd':        'BlockdevOptionsRbd',
4820      'replication': { 'type': 'BlockdevOptionsReplication',
4821                       'if': 'CONFIG_REPLICATION' },
4822      'snapshot-access': 'BlockdevOptionsGenericFormat',
4823      'ssh':        'BlockdevOptionsSsh',
4824      'throttle':   'BlockdevOptionsThrottle',
4825      'vdi':        'BlockdevOptionsGenericFormat',
4826      'vhdx':       'BlockdevOptionsGenericFormat',
4827      'virtio-blk-vfio-pci':
4828                    { 'type': 'BlockdevOptionsVirtioBlkVfioPci',
4829                      'if': 'CONFIG_BLKIO' },
4830      'virtio-blk-vhost-user':
4831                    { 'type': 'BlockdevOptionsVirtioBlkVhostUser',
4832                      'if': 'CONFIG_BLKIO' },
4833      'virtio-blk-vhost-vdpa':
4834                    { 'type': 'BlockdevOptionsVirtioBlkVhostVdpa',
4835                      'if': 'CONFIG_BLKIO' },
4836      'vmdk':       'BlockdevOptionsGenericCOWFormat',
4837      'vpc':        'BlockdevOptionsGenericFormat',
4838      'vvfat':      'BlockdevOptionsVVFAT'
4839  } }
4840
4841##
4842# @BlockdevRef:
4843#
4844# Reference to a block device.
4845#
4846# @definition: defines a new block device inline
4847#
4848# @reference: references the ID of an existing block device
4849#
4850# Since: 2.9
4851##
4852{ 'alternate': 'BlockdevRef',
4853  'data': { 'definition': 'BlockdevOptions',
4854            'reference': 'str' } }
4855
4856##
4857# @BlockdevRefOrNull:
4858#
4859# Reference to a block device.
4860#
4861# @definition: defines a new block device inline
4862#
4863# @reference: references the ID of an existing block device.  An empty
4864#     string means that no block device should be referenced.
4865#     Deprecated; use null instead.
4866#
4867# @null: No block device should be referenced (since 2.10)
4868#
4869# Since: 2.9
4870##
4871{ 'alternate': 'BlockdevRefOrNull',
4872  'data': { 'definition': 'BlockdevOptions',
4873            'reference': 'str',
4874            'null': 'null' } }
4875
4876##
4877# @blockdev-add:
4878#
4879# Creates a new block device.
4880#
4881# Since: 2.9
4882#
4883# .. qmp-example::
4884#
4885#     -> { "execute": "blockdev-add",
4886#          "arguments": {
4887#               "driver": "qcow2",
4888#               "node-name": "test1",
4889#               "file": {
4890#                   "driver": "file",
4891#                   "filename": "test.qcow2"
4892#                }
4893#           }
4894#         }
4895#     <- { "return": {} }
4896#
4897# .. qmp-example::
4898#
4899#     -> { "execute": "blockdev-add",
4900#          "arguments": {
4901#               "driver": "qcow2",
4902#               "node-name": "node0",
4903#               "discard": "unmap",
4904#               "cache": {
4905#                  "direct": true
4906#                },
4907#                "file": {
4908#                  "driver": "file",
4909#                  "filename": "/tmp/test.qcow2"
4910#                },
4911#                "backing": {
4912#                   "driver": "raw",
4913#                   "file": {
4914#                      "driver": "file",
4915#                      "filename": "/dev/fdset/4"
4916#                    }
4917#                }
4918#            }
4919#          }
4920#
4921#     <- { "return": {} }
4922##
4923{ 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true,
4924  'allow-preconfig': true }
4925
4926##
4927# @blockdev-reopen:
4928#
4929# Reopens one or more block devices using the given set of options.
4930# Any option not specified will be reset to its default value
4931# regardless of its previous status.  If an option cannot be changed
4932# or a particular driver does not support reopening then the command
4933# will return an error.  All devices in the list are reopened in one
4934# transaction, so if one of them fails then the whole transaction is
4935# cancelled.
4936#
4937# The command receives a list of block devices to reopen.  For each
4938# one of them, the top-level @node-name option (from `BlockdevOptions`)
4939# must be specified and is used to select the block device to be
4940# reopened.  Other @node-name options must be either omitted or set to
4941# the current name of the appropriate node.  This command won't change
4942# any node name and any attempt to do it will result in an error.
4943#
4944# In the case of options that refer to child nodes, the behavior of
4945# this command depends on the value:
4946#
4947#  1) A set of options (`BlockdevOptions`): the child is reopened with
4948#     the specified set of options.
4949#
4950#  2) A reference to the current child: the child is reopened using
4951#     its existing set of options.
4952#
4953#  3) A reference to a different node: the current child is replaced
4954#     with the specified one.
4955#
4956#  4) null: the current child (if any) is detached.
4957#
4958# Options (1) and (2) are supported in all cases.  Option (3) is
4959# supported for @file and @backing, and option (4) for @backing only.
4960#
4961# Unlike with `blockdev-add`, the @backing option must always be present
4962# unless the node being reopened does not have a backing file and its
4963# image does not have a default backing file name as part of its
4964# metadata.
4965#
4966# Since: 6.1
4967##
4968{ 'command': 'blockdev-reopen',
4969  'data': { 'options': ['BlockdevOptions'] },
4970  'allow-preconfig': true }
4971
4972##
4973# @blockdev-del:
4974#
4975# Deletes a block device that has been added using `blockdev-add`.  The
4976# command will fail if the node is attached to a device or is
4977# otherwise being used.
4978#
4979# @node-name: Name of the graph node to delete.
4980#
4981# Since: 2.9
4982#
4983# .. qmp-example::
4984#
4985#     -> { "execute": "blockdev-add",
4986#          "arguments": {
4987#               "driver": "qcow2",
4988#               "node-name": "node0",
4989#               "file": {
4990#                   "driver": "file",
4991#                   "filename": "test.qcow2"
4992#               }
4993#          }
4994#        }
4995#     <- { "return": {} }
4996#
4997#     -> { "execute": "blockdev-del",
4998#          "arguments": { "node-name": "node0" }
4999#        }
5000#     <- { "return": {} }
5001##
5002{ 'command': 'blockdev-del', 'data': { 'node-name': 'str' },
5003  'allow-preconfig': true }
5004
5005##
5006# @blockdev-set-active:
5007#
5008# Activate or inactivate a block device.  Use this to manage the handover of
5009# block devices on migration with qemu-storage-daemon.
5010#
5011# Activating a node automatically activates all of its child nodes first.
5012# Inactivating a node automatically inactivates any of its child nodes that are
5013# not in use by a still active node.
5014#
5015# @node-name: Name of the graph node to activate or inactivate.  By default, all
5016#     nodes are affected by the operation.
5017#
5018# @active: true if the nodes should be active when the command returns success,
5019#     false if they should be inactive.
5020#
5021# Since: 10.0
5022#
5023# .. qmp-example::
5024#
5025#     -> { "execute": "blockdev-set-active",
5026#          "arguments": {
5027#               "node-name": "node0",
5028#               "active": false
5029#          }
5030#        }
5031#     <- { "return": {} }
5032##
5033{ 'command': 'blockdev-set-active',
5034  'data': { '*node-name': 'str', 'active': 'bool' },
5035  'allow-preconfig': true }
5036
5037##
5038# @BlockdevCreateOptionsFile:
5039#
5040# Driver specific image creation options for file.
5041#
5042# @filename: Filename for the new image file
5043#
5044# @size: Size of the virtual disk in bytes
5045#
5046# @preallocation: Preallocation mode for the new image (default: off;
5047#     allowed values: off, falloc (if CONFIG_POSIX_FALLOCATE), full
5048#     (if CONFIG_POSIX))
5049#
5050# @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
5051#
5052# @extent-size-hint: Extent size hint to add to the image file; 0 for
5053#     not adding an extent size hint (default: 1 MB, since 5.1)
5054#
5055# Since: 2.12
5056##
5057{ 'struct': 'BlockdevCreateOptionsFile',
5058  'data': { 'filename':             'str',
5059            'size':                 'size',
5060            '*preallocation':       'PreallocMode',
5061            '*nocow':               'bool',
5062            '*extent-size-hint':    'size'} }
5063
5064##
5065# @BlockdevCreateOptionsGluster:
5066#
5067# Driver specific image creation options for gluster.
5068#
5069# @location: Where to store the new image file
5070#
5071# @size: Size of the virtual disk in bytes
5072#
5073# @preallocation: Preallocation mode for the new image (default: off;
5074#     allowed values: off, falloc (if CONFIG_GLUSTERFS_FALLOCATE),
5075#     full (if CONFIG_GLUSTERFS_ZEROFILL))
5076#
5077# Since: 2.12
5078##
5079{ 'struct': 'BlockdevCreateOptionsGluster',
5080  'data': { 'location':         'BlockdevOptionsGluster',
5081            'size':             'size',
5082            '*preallocation':   'PreallocMode' } }
5083
5084##
5085# @BlockdevCreateOptionsLUKS:
5086#
5087# Driver specific image creation options for LUKS.
5088#
5089# @file: Node to create the image format on, mandatory except when
5090#     'preallocation' is not requested
5091#
5092# @header: Block device holding a detached LUKS header.  (since 9.0)
5093#
5094# @size: Size of the virtual disk in bytes
5095#
5096# @preallocation: Preallocation mode for the new image (since: 4.2)
5097#     (default: off; allowed values: off, metadata, falloc, full)
5098#
5099# Since: 2.12
5100##
5101{ 'struct': 'BlockdevCreateOptionsLUKS',
5102  'base': 'QCryptoBlockCreateOptionsLUKS',
5103  'data': { '*file':            'BlockdevRef',
5104            '*header':          'BlockdevRef',
5105            'size':             'size',
5106            '*preallocation':   'PreallocMode' } }
5107
5108##
5109# @BlockdevCreateOptionsNfs:
5110#
5111# Driver specific image creation options for NFS.
5112#
5113# @location: Where to store the new image file
5114#
5115# @size: Size of the virtual disk in bytes
5116#
5117# Since: 2.12
5118##
5119{ 'struct': 'BlockdevCreateOptionsNfs',
5120  'data': { 'location':         'BlockdevOptionsNfs',
5121            'size':             'size' } }
5122
5123##
5124# @BlockdevCreateOptionsParallels:
5125#
5126# Driver specific image creation options for parallels.
5127#
5128# @file: Node to create the image format on
5129#
5130# @size: Size of the virtual disk in bytes
5131#
5132# @cluster-size: Cluster size in bytes (default: 1 MB)
5133#
5134# Since: 2.12
5135##
5136{ 'struct': 'BlockdevCreateOptionsParallels',
5137  'data': { 'file':             'BlockdevRef',
5138            'size':             'size',
5139            '*cluster-size':    'size' } }
5140
5141##
5142# @BlockdevCreateOptionsQcow:
5143#
5144# Driver specific image creation options for qcow.
5145#
5146# @file: Node to create the image format on
5147#
5148# @size: Size of the virtual disk in bytes
5149#
5150# @backing-file: File name of the backing file if a backing file
5151#     should be used
5152#
5153# @encrypt: Encryption options if the image should be encrypted
5154#
5155# Since: 2.12
5156##
5157{ 'struct': 'BlockdevCreateOptionsQcow',
5158  'data': { 'file':             'BlockdevRef',
5159            'size':             'size',
5160            '*backing-file':    'str',
5161            '*encrypt':         'QCryptoBlockCreateOptions' } }
5162
5163##
5164# @BlockdevQcow2Version:
5165#
5166# @v2: The original QCOW2 format as introduced in QEMU 0.10 (version
5167#     2)
5168#
5169# @v3: The extended QCOW2 format as introduced in QEMU 1.1 (version 3)
5170#
5171# Since: 2.12
5172##
5173{ 'enum': 'BlockdevQcow2Version',
5174  'data': [ 'v2', 'v3' ] }
5175
5176##
5177# @Qcow2CompressionType:
5178#
5179# Compression type used in qcow2 image file
5180#
5181# @zlib: zlib compression, see <http://zlib.net/>
5182#
5183# @zstd: zstd compression, see <http://github.com/facebook/zstd>
5184#
5185# Since: 5.1
5186##
5187{ 'enum': 'Qcow2CompressionType',
5188  'data': [ 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
5189
5190##
5191# @BlockdevCreateOptionsQcow2:
5192#
5193# Driver specific image creation options for qcow2.
5194#
5195# @file: Node to create the image format on
5196#
5197# @data-file: Node to use as an external data file in which all guest
5198#     data is stored so that only metadata remains in the qcow2 file
5199#     (since: 4.0)
5200#
5201# @data-file-raw: True if the external data file must stay valid as a
5202#     standalone (read-only) raw image without looking at qcow2
5203#     metadata (default: false; since: 4.0)
5204#
5205# @extended-l2: True to make the image have extended L2 entries
5206#     (default: false; since 5.2)
5207#
5208# @size: Size of the virtual disk in bytes
5209#
5210# @version: Compatibility level (default: v3)
5211#
5212# @backing-file: File name of the backing file if a backing file
5213#     should be used
5214#
5215# @backing-fmt: Name of the block driver to use for the backing file
5216#
5217# @encrypt: Encryption options if the image should be encrypted
5218#
5219# @cluster-size: qcow2 cluster size in bytes (default: 65536)
5220#
5221# @preallocation: Preallocation mode for the new image (default: off;
5222#     allowed values: off, falloc, full, metadata)
5223#
5224# @lazy-refcounts: True if refcounts may be updated lazily
5225#     (default: off)
5226#
5227# @refcount-bits: Width of reference counts in bits (default: 16)
5228#
5229# @compression-type: The image cluster compression method
5230#     (default: zlib, since 5.1)
5231#
5232# Since: 2.12
5233##
5234{ 'struct': 'BlockdevCreateOptionsQcow2',
5235  'data': { 'file':             'BlockdevRef',
5236            '*data-file':       'BlockdevRef',
5237            '*data-file-raw':   'bool',
5238            '*extended-l2':     'bool',
5239            'size':             'size',
5240            '*version':         'BlockdevQcow2Version',
5241            '*backing-file':    'str',
5242            '*backing-fmt':     'BlockdevDriver',
5243            '*encrypt':         'QCryptoBlockCreateOptions',
5244            '*cluster-size':    'size',
5245            '*preallocation':   'PreallocMode',
5246            '*lazy-refcounts':  'bool',
5247            '*refcount-bits':   'int',
5248            '*compression-type':'Qcow2CompressionType' } }
5249
5250##
5251# @BlockdevCreateOptionsQed:
5252#
5253# Driver specific image creation options for qed.
5254#
5255# @file: Node to create the image format on
5256#
5257# @size: Size of the virtual disk in bytes
5258#
5259# @backing-file: File name of the backing file if a backing file
5260#     should be used
5261#
5262# @backing-fmt: Name of the block driver to use for the backing file
5263#
5264# @cluster-size: Cluster size in bytes (default: 65536)
5265#
5266# @table-size: L1/L2 table size (in clusters)
5267#
5268# Since: 2.12
5269##
5270{ 'struct': 'BlockdevCreateOptionsQed',
5271  'data': { 'file':             'BlockdevRef',
5272            'size':             'size',
5273            '*backing-file':    'str',
5274            '*backing-fmt':     'BlockdevDriver',
5275            '*cluster-size':    'size',
5276            '*table-size':      'int' } }
5277
5278##
5279# @BlockdevCreateOptionsRbd:
5280#
5281# Driver specific image creation options for rbd/Ceph.
5282#
5283# @location: Where to store the new image file.  This location cannot
5284#     point to a snapshot.
5285#
5286# @size: Size of the virtual disk in bytes
5287#
5288# @cluster-size: RBD object size
5289#
5290# @encrypt: Image encryption options.  (Since 6.1)
5291#
5292# Since: 2.12
5293##
5294{ 'struct': 'BlockdevCreateOptionsRbd',
5295  'data': { 'location':         'BlockdevOptionsRbd',
5296            'size':             'size',
5297            '*cluster-size' :   'size',
5298            '*encrypt' :        'RbdEncryptionCreateOptions' } }
5299
5300##
5301# @BlockdevVmdkSubformat:
5302#
5303# Subformat options for VMDK images
5304#
5305# @monolithicSparse: Single file image with sparse cluster allocation
5306#
5307# @monolithicFlat: Single flat data image and a descriptor file
5308#
5309# @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA)
5310#     sparse extent files, in addition to a descriptor file
5311#
5312# @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat
5313#     extent files, in addition to a descriptor file
5314#
5315# @streamOptimized: Single file image sparse cluster allocation,
5316#     optimized for streaming over network.
5317#
5318# Since: 4.0
5319##
5320{ 'enum': 'BlockdevVmdkSubformat',
5321  'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
5322            'twoGbMaxExtentFlat', 'streamOptimized'] }
5323
5324##
5325# @BlockdevVmdkAdapterType:
5326#
5327# Adapter type info for VMDK images
5328#
5329# Since: 4.0
5330##
5331{ 'enum': 'BlockdevVmdkAdapterType',
5332  'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
5333
5334##
5335# @BlockdevCreateOptionsVmdk:
5336#
5337# Driver specific image creation options for VMDK.
5338#
5339# @file: Where to store the new image file.  This refers to the image
5340#     file for monolithcSparse and streamOptimized format, or the
5341#     descriptor file for other formats.
5342#
5343# @size: Size of the virtual disk in bytes
5344#
5345# @extents: Where to store the data extents.  Required for
5346#     monolithcFlat, twoGbMaxExtentSparse and twoGbMaxExtentFlat
5347#     formats.  For monolithicFlat, only one entry is required; for
5348#     twoGbMaxExtent* formats, the number of entries required is
5349#     calculated as extent_number = virtual_size / 2GB.  Providing
5350#     more extents than will be used is an error.
5351#
5352# @subformat: The subformat of the VMDK image.  Default:
5353#     "monolithicSparse".
5354#
5355# @backing-file: The path of backing file.  Default: no backing file
5356#     is used.
5357#
5358# @adapter-type: The adapter type used to fill in the descriptor.
5359#     Default: ide.
5360#
5361# @hwversion: Hardware version.  The meaningful options are "4" or
5362#     "6".  Default: "4".
5363#
5364# @toolsversion: VMware guest tools version.  Default: "2147483647"
5365#     (Since 6.2)
5366#
5367# @zeroed-grain: Whether to enable zeroed-grain feature for sparse
5368#     subformats.  Default: false.
5369#
5370# Since: 4.0
5371##
5372{ 'struct': 'BlockdevCreateOptionsVmdk',
5373  'data': { 'file':             'BlockdevRef',
5374            'size':             'size',
5375            '*extents':          ['BlockdevRef'],
5376            '*subformat':       'BlockdevVmdkSubformat',
5377            '*backing-file':    'str',
5378            '*adapter-type':    'BlockdevVmdkAdapterType',
5379            '*hwversion':       'str',
5380            '*toolsversion':    'str',
5381            '*zeroed-grain':    'bool' } }
5382
5383##
5384# @BlockdevCreateOptionsSsh:
5385#
5386# Driver specific image creation options for SSH.
5387#
5388# @location: Where to store the new image file
5389#
5390# @size: Size of the virtual disk in bytes
5391#
5392# Since: 2.12
5393##
5394{ 'struct': 'BlockdevCreateOptionsSsh',
5395  'data': { 'location':         'BlockdevOptionsSsh',
5396            'size':             'size' } }
5397
5398##
5399# @BlockdevCreateOptionsVdi:
5400#
5401# Driver specific image creation options for VDI.
5402#
5403# @file: Node to create the image format on
5404#
5405# @size: Size of the virtual disk in bytes
5406#
5407# @preallocation: Preallocation mode for the new image (default: off;
5408#     allowed values: off, metadata)
5409#
5410# Since: 2.12
5411##
5412{ 'struct': 'BlockdevCreateOptionsVdi',
5413  'data': { 'file':             'BlockdevRef',
5414            'size':             'size',
5415            '*preallocation':   'PreallocMode' } }
5416
5417##
5418# @BlockdevVhdxSubformat:
5419#
5420# @dynamic: Growing image file
5421#
5422# @fixed: Preallocated fixed-size image file
5423#
5424# Since: 2.12
5425##
5426{ 'enum': 'BlockdevVhdxSubformat',
5427  'data': [ 'dynamic', 'fixed' ] }
5428
5429##
5430# @BlockdevCreateOptionsVhdx:
5431#
5432# Driver specific image creation options for vhdx.
5433#
5434# @file: Node to create the image format on
5435#
5436# @size: Size of the virtual disk in bytes
5437#
5438# @log-size: Log size in bytes, must be a multiple of 1 MB (default: 1
5439#     MB)
5440#
5441# @block-size: Block size in bytes, must be a multiple of 1 MB and not
5442#     larger than 256 MB (default: automatically choose a block size
5443#     depending on the image size)
5444#
5445# @subformat: vhdx subformat (default: dynamic)
5446#
5447# @block-state-zero: Force use of payload blocks of type 'ZERO'.
5448#     Non-standard, but default.  Do not set to 'off' when using
5449#     'qemu-img convert' with subformat=dynamic.
5450#
5451# Since: 2.12
5452##
5453{ 'struct': 'BlockdevCreateOptionsVhdx',
5454  'data': { 'file':                 'BlockdevRef',
5455            'size':                 'size',
5456            '*log-size':            'size',
5457            '*block-size':          'size',
5458            '*subformat':           'BlockdevVhdxSubformat',
5459            '*block-state-zero':    'bool' } }
5460
5461##
5462# @BlockdevVpcSubformat:
5463#
5464# @dynamic: Growing image file
5465#
5466# @fixed: Preallocated fixed-size image file
5467#
5468# Since: 2.12
5469##
5470{ 'enum': 'BlockdevVpcSubformat',
5471  'data': [ 'dynamic', 'fixed' ] }
5472
5473##
5474# @BlockdevCreateOptionsVpc:
5475#
5476# Driver specific image creation options for vpc (VHD).
5477#
5478# @file: Node to create the image format on
5479#
5480# @size: Size of the virtual disk in bytes
5481#
5482# @subformat: vhdx subformat (default: dynamic)
5483#
5484# @force-size: Force use of the exact byte size instead of rounding to
5485#     the next size that can be represented in CHS geometry
5486#     (default: false)
5487#
5488# Since: 2.12
5489##
5490{ 'struct': 'BlockdevCreateOptionsVpc',
5491  'data': { 'file':                 'BlockdevRef',
5492            'size':                 'size',
5493            '*subformat':           'BlockdevVpcSubformat',
5494            '*force-size':          'bool' } }
5495
5496##
5497# @BlockdevCreateOptions:
5498#
5499# Options for creating an image format on a given node.
5500#
5501# @driver: block driver to create the image format
5502#
5503# Since: 2.12
5504##
5505{ 'union': 'BlockdevCreateOptions',
5506  'base': {
5507      'driver':         'BlockdevDriver' },
5508  'discriminator': 'driver',
5509  'data': {
5510      'file':           'BlockdevCreateOptionsFile',
5511      'gluster':        'BlockdevCreateOptionsGluster',
5512      'luks':           'BlockdevCreateOptionsLUKS',
5513      'nfs':            'BlockdevCreateOptionsNfs',
5514      'parallels':      'BlockdevCreateOptionsParallels',
5515      'qcow':           'BlockdevCreateOptionsQcow',
5516      'qcow2':          'BlockdevCreateOptionsQcow2',
5517      'qed':            'BlockdevCreateOptionsQed',
5518      'rbd':            'BlockdevCreateOptionsRbd',
5519      'ssh':            'BlockdevCreateOptionsSsh',
5520      'vdi':            'BlockdevCreateOptionsVdi',
5521      'vhdx':           'BlockdevCreateOptionsVhdx',
5522      'vmdk':           'BlockdevCreateOptionsVmdk',
5523      'vpc':            'BlockdevCreateOptionsVpc'
5524  } }
5525
5526##
5527# @blockdev-create:
5528#
5529# Starts a job to create an image format on a given node.  The job is
5530# automatically finalized, but a manual `job-dismiss` is required.
5531#
5532# @job-id: Identifier for the newly created job.
5533#
5534# @options: Options for the image creation.
5535#
5536# Since: 3.0
5537##
5538{ 'command': 'blockdev-create',
5539  'data': { 'job-id': 'str',
5540            'options': 'BlockdevCreateOptions' },
5541  'allow-preconfig': true }
5542
5543##
5544# @BlockdevAmendOptionsLUKS:
5545#
5546# Driver specific image amend options for LUKS.
5547#
5548# Since: 5.1
5549##
5550{ 'struct': 'BlockdevAmendOptionsLUKS',
5551  'base': 'QCryptoBlockAmendOptionsLUKS',
5552  'data': { }
5553}
5554
5555##
5556# @BlockdevAmendOptionsQcow2:
5557#
5558# Driver specific image amend options for qcow2.  For now, only
5559# encryption options can be amended
5560#
5561# @encrypt: Encryption options to be amended
5562#
5563# Since: 5.1
5564##
5565{ 'struct': 'BlockdevAmendOptionsQcow2',
5566  'data': { '*encrypt':         'QCryptoBlockAmendOptions' } }
5567
5568##
5569# @BlockdevAmendOptions:
5570#
5571# Options for amending an image format
5572#
5573# @driver: Block driver of the node to amend.
5574#
5575# Since: 5.1
5576##
5577{ 'union': 'BlockdevAmendOptions',
5578  'base': {
5579      'driver':         'BlockdevDriver' },
5580  'discriminator': 'driver',
5581  'data': {
5582      'luks':           'BlockdevAmendOptionsLUKS',
5583      'qcow2':          'BlockdevAmendOptionsQcow2' } }
5584
5585##
5586# @x-blockdev-amend:
5587#
5588# Starts a job to amend format specific options of an existing open
5589# block device.  The job is automatically finalized, but a manual
5590# `job-dismiss` is required.
5591#
5592# @job-id: Identifier for the newly created job.
5593#
5594# @node-name: Name of the block node to work on
5595#
5596# @options: Options (driver specific)
5597#
5598# @force: Allow unsafe operations, format specific.  For luks that
5599#     allows erase of the last active keyslot (permanent loss of
5600#     data), and replacement of an active keyslot (possible loss of
5601#     data if IO error happens)
5602#
5603# Features:
5604#
5605# @unstable: This command is experimental.
5606#
5607# Since: 5.1
5608##
5609{ 'command': 'x-blockdev-amend',
5610  'data': { 'job-id': 'str',
5611            'node-name': 'str',
5612            'options': 'BlockdevAmendOptions',
5613            '*force': 'bool' },
5614  'features': [ 'unstable' ],
5615  'allow-preconfig': true }
5616
5617##
5618# @BlockErrorAction:
5619#
5620# An enumeration of action that has been taken when a DISK I/O occurs
5621#
5622# @ignore: error has been ignored
5623#
5624# @report: error has been reported to the device
5625#
5626# @stop: error caused VM to be stopped
5627#
5628# Since: 2.1
5629##
5630{ 'enum': 'BlockErrorAction',
5631  'data': [ 'ignore', 'report', 'stop' ] }
5632
5633##
5634# @BLOCK_IMAGE_CORRUPTED:
5635#
5636# Emitted when a disk image is being marked corrupt.  The image can be
5637# identified by its device or node name.  The 'device' field is always
5638# present for compatibility reasons, but it can be empty ("") if the
5639# image does not have a device name associated.
5640#
5641# @device: device name.  This is always present for compatibility
5642#     reasons, but it can be empty ("") if the image does not have a
5643#     device name associated.
5644#
5645# @node-name: node name (Since: 2.4)
5646#
5647# @msg: informative message for human consumption, such as the kind of
5648#     corruption being detected.  It should not be parsed by machine
5649#     as it is not guaranteed to be stable
5650#
5651# @offset: if the corruption resulted from an image access, this is
5652#     the host's access offset into the image
5653#
5654# @size: if the corruption resulted from an image access, this is the
5655#     access size
5656#
5657# @fatal: if set, the image is marked corrupt and therefore unusable
5658#     after this event and must be repaired (Since 2.2; before, every
5659#     `BLOCK_IMAGE_CORRUPTED` event was fatal)
5660#
5661# .. note:: If action is "stop", a `STOP` event will eventually follow
5662#    the `BLOCK_IO_ERROR` event.
5663#
5664# .. qmp-example::
5665#
5666#     <- { "event": "BLOCK_IMAGE_CORRUPTED",
5667#          "data": { "device": "", "node-name": "drive", "fatal": false,
5668#                    "msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)" },
5669#          "timestamp": { "seconds": 1648243240, "microseconds": 906060 } }
5670#
5671# Since: 1.7
5672##
5673{ 'event': 'BLOCK_IMAGE_CORRUPTED',
5674  'data': { 'device'     : 'str',
5675            '*node-name' : 'str',
5676            'msg'        : 'str',
5677            '*offset'    : 'int',
5678            '*size'      : 'int',
5679            'fatal'      : 'bool' } }
5680
5681##
5682# @BLOCK_IO_ERROR:
5683#
5684# Emitted when a disk I/O error occurs
5685#
5686# @qom-path: path to the device object in the QOM tree (since 9.2)
5687#
5688# @device: device name.  This is always present for compatibility
5689#     reasons, but it can be empty ("") if the image does not have a
5690#     device name associated.
5691#
5692# @node-name: node name.  Note that errors may be reported for the
5693#     root node that is directly attached to a guest device rather
5694#     than for the node where the error occurred.  The node name is
5695#     not present if the drive is empty.  (Since: 2.8)
5696#
5697# @operation: I/O operation
5698#
5699# @action: action that has been taken
5700#
5701# @nospace: true if I/O error was caused due to a no-space condition.
5702#     This key is only present if query-block's io-status is present,
5703#     please see `query-block` documentation for more information
5704#     (since: 2.2)
5705#
5706# @reason: human readable string describing the error cause.  (This
5707#     field is a debugging aid for humans, it should not be parsed by
5708#     applications) (since: 2.2)
5709#
5710# .. note:: If action is "stop", a `STOP` event will eventually follow
5711#    the `BLOCK_IO_ERROR` event.
5712#
5713# .. note:: This event is rate-limited.
5714#
5715# Since: 0.13
5716#
5717# .. qmp-example::
5718#
5719#     <- { "event": "BLOCK_IO_ERROR",
5720#          "data": { "qom-path": "/machine/unattached/device[0]",
5721#                    "device": "ide0-hd1",
5722#                    "node-name": "#block212",
5723#                    "operation": "write",
5724#                    "action": "stop",
5725#                    "reason": "No space left on device" },
5726#          "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5727##
5728{ 'event': 'BLOCK_IO_ERROR',
5729  'data': { 'qom-path': 'str', 'device': 'str', '*node-name': 'str',
5730            'operation': 'IoOperationType',
5731            'action': 'BlockErrorAction', '*nospace': 'bool',
5732            'reason': 'str' } }
5733
5734##
5735# @BLOCK_JOB_COMPLETED:
5736#
5737# Emitted when a block job has completed
5738#
5739# @type: job type
5740#
5741# @device: The job identifier.  Originally the device name but other
5742#     values are allowed since QEMU 2.7
5743#
5744# @len: maximum progress value
5745#
5746# @offset: current progress value.  On success this is equal to len.
5747#     On failure this is less than len
5748#
5749# @speed: rate limit, bytes per second
5750#
5751# @error: error message.  Only present on failure.  This field
5752#     contains a human-readable error message.  There are no semantics
5753#     other than that streaming has failed and clients should not try
5754#     to interpret the error string
5755#
5756# Since: 1.1
5757#
5758# .. qmp-example::
5759#
5760#     <- { "event": "BLOCK_JOB_COMPLETED",
5761#          "data": { "type": "stream", "device": "virtio-disk0",
5762#                    "len": 10737418240, "offset": 10737418240,
5763#                    "speed": 0 },
5764#          "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5765##
5766{ 'event': 'BLOCK_JOB_COMPLETED',
5767  'data': { 'type'  : 'JobType',
5768            'device': 'str',
5769            'len'   : 'int',
5770            'offset': 'int',
5771            'speed' : 'int',
5772            '*error': 'str' } }
5773
5774##
5775# @BLOCK_JOB_CANCELLED:
5776#
5777# Emitted when a block job has been cancelled
5778#
5779# @type: job type
5780#
5781# @device: The job identifier.  Originally the device name but other
5782#     values are allowed since QEMU 2.7
5783#
5784# @len: maximum progress value
5785#
5786# @offset: current progress value.  On success this is equal to len.
5787#     On failure this is less than len
5788#
5789# @speed: rate limit, bytes per second
5790#
5791# Since: 1.1
5792#
5793# .. qmp-example::
5794#
5795#     <- { "event": "BLOCK_JOB_CANCELLED",
5796#          "data": { "type": "stream", "device": "virtio-disk0",
5797#                    "len": 10737418240, "offset": 134217728,
5798#                    "speed": 0 },
5799#          "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5800##
5801{ 'event': 'BLOCK_JOB_CANCELLED',
5802  'data': { 'type'  : 'JobType',
5803            'device': 'str',
5804            'len'   : 'int',
5805            'offset': 'int',
5806            'speed' : 'int' } }
5807
5808##
5809# @BLOCK_JOB_ERROR:
5810#
5811# Emitted when a block job encounters an error
5812#
5813# @device: The job identifier.  Originally the device name but other
5814#     values are allowed since QEMU 2.7
5815#
5816# @operation: I/O operation
5817#
5818# @action: action that has been taken
5819#
5820# Since: 1.3
5821#
5822# .. qmp-example::
5823#
5824#     <- { "event": "BLOCK_JOB_ERROR",
5825#          "data": { "device": "ide0-hd1",
5826#                    "operation": "write",
5827#                    "action": "stop" },
5828#          "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5829##
5830{ 'event': 'BLOCK_JOB_ERROR',
5831  'data': { 'device'   : 'str',
5832            'operation': 'IoOperationType',
5833            'action'   : 'BlockErrorAction' } }
5834
5835##
5836# @BLOCK_JOB_READY:
5837#
5838# Emitted when a block job is ready to complete
5839#
5840# @type: job type
5841#
5842# @device: The job identifier.  Originally the device name but other
5843#     values are allowed since QEMU 2.7
5844#
5845# @len: maximum progress value
5846#
5847# @offset: current progress value.  On success this is equal to len.
5848#     On failure this is less than len
5849#
5850# @speed: rate limit, bytes per second
5851#
5852# .. note:: The "ready to complete" status is always reset by a
5853#    `BLOCK_JOB_ERROR` event.
5854#
5855# Since: 1.3
5856#
5857# .. qmp-example::
5858#
5859#     <- { "event": "BLOCK_JOB_READY",
5860#          "data": { "device": "drive0", "type": "mirror", "speed": 0,
5861#                    "len": 2097152, "offset": 2097152 },
5862#          "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5863##
5864{ 'event': 'BLOCK_JOB_READY',
5865  'data': { 'type'  : 'JobType',
5866            'device': 'str',
5867            'len'   : 'int',
5868            'offset': 'int',
5869            'speed' : 'int' } }
5870
5871##
5872# @BLOCK_JOB_PENDING:
5873#
5874# Emitted when a block job is awaiting explicit authorization to
5875# finalize graph changes via `job-finalize`.  If this job is part
5876# of a transaction, it will not emit this event until the transaction
5877# has converged first.
5878#
5879# @type: job type
5880#
5881# @id: The job identifier.
5882#
5883# Since: 2.12
5884#
5885# .. qmp-example::
5886#
5887#     <- { "event": "BLOCK_JOB_PENDING",
5888#          "data": { "type": "mirror", "id": "backup_1" },
5889#          "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5890##
5891{ 'event': 'BLOCK_JOB_PENDING',
5892  'data': { 'type'  : 'JobType',
5893            'id'    : 'str' } }
5894
5895##
5896# @PreallocMode:
5897#
5898# Preallocation mode of QEMU image file
5899#
5900# @off: no preallocation
5901#
5902# @metadata: preallocate only for metadata
5903#
5904# @falloc: like @full preallocation but allocate disk space by
5905#     posix_fallocate() rather than writing data.
5906#
5907# @full: preallocate all data by writing it to the device to ensure
5908#     disk space is really available.  This data may or may not be
5909#     zero, depending on the image format and storage.  @full
5910#     preallocation also sets up metadata correctly.
5911#
5912# Since: 2.2
5913##
5914{ 'enum': 'PreallocMode',
5915  'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5916
5917##
5918# @BLOCK_WRITE_THRESHOLD:
5919#
5920# Emitted when writes on block device reaches or exceeds the
5921# configured write threshold.  For thin-provisioned devices, this
5922# means the device should be extended to avoid pausing for disk
5923# exhaustion.  The event is one shot.  Once triggered, it needs to be
5924# re-registered with another `block-set-write-threshold` command.
5925#
5926# @node-name: graph node name on which the threshold was exceeded.
5927#
5928# @amount-exceeded: amount of data which exceeded the threshold, in
5929#     bytes.
5930#
5931# @write-threshold: last configured threshold, in bytes.
5932#
5933# Since: 2.3
5934##
5935{ 'event': 'BLOCK_WRITE_THRESHOLD',
5936  'data': { 'node-name': 'str',
5937            'amount-exceeded': 'uint64',
5938            'write-threshold': 'uint64' } }
5939
5940##
5941# @block-set-write-threshold:
5942#
5943# Change the write threshold for a block drive.  An event will be
5944# delivered if a write to this block drive crosses the configured
5945# threshold.  The threshold is an offset, thus must be non-negative.
5946# Default is no write threshold.  Setting the threshold to zero
5947# disables it.
5948#
5949# This is useful to transparently resize thin-provisioned drives
5950# without the guest OS noticing.
5951#
5952# @node-name: graph node name on which the threshold must be set.
5953#
5954# @write-threshold: configured threshold for the block device, bytes.
5955#     Use 0 to disable the threshold.
5956#
5957# Since: 2.3
5958#
5959# .. qmp-example::
5960#
5961#     -> { "execute": "block-set-write-threshold",
5962#          "arguments": { "node-name": "mydev",
5963#                         "write-threshold": 17179869184 } }
5964#     <- { "return": {} }
5965##
5966{ 'command': 'block-set-write-threshold',
5967  'data': { 'node-name': 'str', 'write-threshold': 'uint64' },
5968  'allow-preconfig': true }
5969
5970##
5971# @x-blockdev-change:
5972#
5973# Dynamically reconfigure the block driver state graph.
5974#
5975# Currently only supports adding and deleting quorum children.  A
5976# child will be added at the end of the list of children.  Its
5977# contents *must* be consistent with the other childrens' contents.
5978# Deleting a child that is not last in the list of children is
5979# problematic, because it "renumbers" the children following it.
5980#
5981# @parent: the id or name of the parent node.
5982#
5983# @child: the name of a child to be deleted.  Mutually exclusive with
5984#     @node.
5985#
5986# @node: the name of the node to be added.  Mutually exclusive with
5987#     @child.
5988#
5989# Features:
5990#
5991# @unstable: This command is experimental.
5992#
5993# TODO: Removing children from a quorum node means introducing
5994#     gaps in the child indices.  This cannot be represented in the
5995#     'children' list of `BlockdevOptionsQuorum`, as returned by
5996#     .bdrv_refresh_filename().
5997#
5998# Since: 2.7
5999#
6000# .. qmp-example::
6001#    :title: Add a new node to a quorum
6002#
6003#     -> { "execute": "blockdev-add",
6004#          "arguments": {
6005#              "driver": "raw",
6006#              "node-name": "new_node",
6007#              "file": { "driver": "file",
6008#                        "filename": "test.raw" } } }
6009#     <- { "return": {} }
6010#     -> { "execute": "x-blockdev-change",
6011#          "arguments": { "parent": "disk1",
6012#                         "node": "new_node" } }
6013#     <- { "return": {} }
6014#
6015# .. qmp-example::
6016#    :title: Delete a quorum's node
6017#
6018#     -> { "execute": "x-blockdev-change",
6019#          "arguments": { "parent": "disk1",
6020#                         "child": "children.1" } }
6021#     <- { "return": {} }
6022##
6023{ 'command': 'x-blockdev-change',
6024  'data' : { 'parent': 'str',
6025             '*child': 'str',
6026             '*node': 'str' },
6027  'features': [ 'unstable' ],
6028  'allow-preconfig': true }
6029
6030##
6031# @x-blockdev-set-iothread:
6032#
6033# Move @node and its children into the @iothread.  If @iothread is
6034# null then move @node and its children into the main loop.
6035#
6036# The node must not be attached to a BlockBackend.
6037#
6038# @node-name: the name of the block driver node
6039#
6040# @iothread: the name of the IOThread object or null for the main loop
6041#
6042# @force: true if the node and its children should be moved when a
6043#     BlockBackend is already attached
6044#
6045# Features:
6046#
6047# @unstable: This command is experimental and intended for test cases
6048#     that need control over IOThreads only.
6049#
6050# Since: 2.12
6051#
6052# .. qmp-example::
6053#    :title: Move a node into an IOThread
6054#
6055#     -> { "execute": "x-blockdev-set-iothread",
6056#          "arguments": { "node-name": "disk1",
6057#                         "iothread": "iothread0" } }
6058#     <- { "return": {} }
6059#
6060# .. qmp-example::
6061#    :title: Move a node into the main loop
6062#
6063#     -> { "execute": "x-blockdev-set-iothread",
6064#          "arguments": { "node-name": "disk1",
6065#                         "iothread": null } }
6066#     <- { "return": {} }
6067##
6068{ 'command': 'x-blockdev-set-iothread',
6069  'data' : { 'node-name': 'str',
6070             'iothread': 'StrOrNull',
6071             '*force': 'bool' },
6072  'features': [ 'unstable' ],
6073  'allow-preconfig': true }
6074
6075##
6076# @QuorumOpType:
6077#
6078# An enumeration of the quorum operation types
6079#
6080# @read: read operation
6081#
6082# @write: write operation
6083#
6084# @flush: flush operation
6085#
6086# Since: 2.6
6087##
6088{ 'enum': 'QuorumOpType',
6089  'data': [ 'read', 'write', 'flush' ] }
6090
6091##
6092# @QUORUM_FAILURE:
6093#
6094# Emitted by the Quorum block driver if it fails to establish a quorum
6095#
6096# @reference: device name if defined else node name
6097#
6098# @sector-num: number of the first sector of the failed read operation
6099#
6100# @sectors-count: failed read operation sector count
6101#
6102# .. note:: This event is rate-limited.
6103#
6104# Since: 2.0
6105#
6106# .. qmp-example::
6107#
6108#     <- { "event": "QUORUM_FAILURE",
6109#          "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
6110#          "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
6111##
6112{ 'event': 'QUORUM_FAILURE',
6113  'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
6114
6115##
6116# @QUORUM_REPORT_BAD:
6117#
6118# Emitted to report a corruption of a Quorum file
6119#
6120# @type: quorum operation type (Since 2.6)
6121#
6122# @error: error message.  Only present on failure.  This field
6123#     contains a human-readable error message.  There are no semantics
6124#     other than that the block layer reported an error and clients
6125#     should not try to interpret the error string.
6126#
6127# @node-name: the graph node name of the block driver state
6128#
6129# @sector-num: number of the first sector of the failed read operation
6130#
6131# @sectors-count: failed read operation sector count
6132#
6133# .. note:: This event is rate-limited.
6134#
6135# Since: 2.0
6136#
6137# .. qmp-example::
6138#    :title: Read operation
6139#
6140#     <- { "event": "QUORUM_REPORT_BAD",
6141#          "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
6142#                    "type": "read" },
6143#          "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
6144#
6145# .. qmp-example::
6146#    :title: Flush operation
6147#
6148#     <- { "event": "QUORUM_REPORT_BAD",
6149#          "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
6150#                    "type": "flush", "error": "Broken pipe" },
6151#          "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
6152##
6153{ 'event': 'QUORUM_REPORT_BAD',
6154  'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
6155            'sector-num': 'int', 'sectors-count': 'int' } }
6156
6157##
6158# @BlockdevSnapshotInternal:
6159#
6160# @device: the device name or node-name of a root node to generate the
6161#     snapshot from
6162#
6163# @name: the name of the internal snapshot to be created
6164#
6165# Since: 1.7
6166##
6167{ 'struct': 'BlockdevSnapshotInternal',
6168  'data': { 'device': 'str', 'name': 'str' } }
6169
6170##
6171# @blockdev-snapshot-internal-sync:
6172#
6173# Synchronously take an internal snapshot of a block device, when the
6174# format of the image used supports it.  If the name is an empty
6175# string, or a snapshot with name already exists, the operation will
6176# fail.
6177#
6178# Errors:
6179#     - If @device is not a valid block device, GenericError
6180#     - If any snapshot matching @name exists, or @name is empty,
6181#       GenericError
6182#     - If the format of the image used does not support it,
6183#       GenericError
6184#
6185# .. note:: Only some image formats such as qcow2 and rbd support
6186#    internal snapshots.
6187#
6188# Since: 1.7
6189#
6190# .. qmp-example::
6191#
6192#     -> { "execute": "blockdev-snapshot-internal-sync",
6193#          "arguments": { "device": "ide-hd0",
6194#                         "name": "snapshot0" }
6195#        }
6196#     <- { "return": {} }
6197##
6198{ 'command': 'blockdev-snapshot-internal-sync',
6199  'data': 'BlockdevSnapshotInternal',
6200  'allow-preconfig': true }
6201
6202##
6203# @blockdev-snapshot-delete-internal-sync:
6204#
6205# Synchronously delete an internal snapshot of a block device, when
6206# the format of the image used support it.  The snapshot is identified
6207# by name or id or both.  One of the name or id is required.  Return
6208# `SnapshotInfo` for the successfully deleted snapshot.
6209#
6210# @device: the device name or node-name of a root node to delete the
6211#     snapshot from
6212#
6213# @id: optional the snapshot's ID to be deleted
6214#
6215# @name: optional the snapshot's name to be deleted
6216#
6217# Errors:
6218#     - If @device is not a valid block device, GenericError
6219#     - If snapshot not found, GenericError
6220#     - If the format of the image used does not support it,
6221#       GenericError
6222#     - If @id and @name are both not specified, GenericError
6223#
6224# Since: 1.7
6225#
6226# .. qmp-example::
6227#
6228#     -> { "execute": "blockdev-snapshot-delete-internal-sync",
6229#          "arguments": { "device": "ide-hd0",
6230#                         "name": "snapshot0" }
6231#        }
6232#     <- { "return": {
6233#                        "id": "1",
6234#                        "name": "snapshot0",
6235#                        "vm-state-size": 0,
6236#                        "date-sec": 1000012,
6237#                        "date-nsec": 10,
6238#                        "vm-clock-sec": 100,
6239#                        "vm-clock-nsec": 20,
6240#                        "icount": 220414
6241#          }
6242#        }
6243##
6244{ 'command': 'blockdev-snapshot-delete-internal-sync',
6245  'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
6246  'returns': 'SnapshotInfo',
6247  'allow-preconfig': true }
6248
6249##
6250# @DummyBlockCoreForceArrays:
6251#
6252# Not used by QMP; hack to let us use BlockGraphInfoList internally
6253#
6254# Since: 8.0
6255##
6256{ 'struct': 'DummyBlockCoreForceArrays',
6257  'data': { 'unused-block-graph-info': ['BlockGraphInfo'] } }
6258