iotests: add more LUKS hash combination tests
[qemu/kevin.git] / qapi / block-core.json
blob4bf11e8b8b732e035a68f2a8ea90b47b5b286983
1 # -*- Mode: Python -*-
3 ##
4 # == QAPI block core definitions (vm unrelated)
5 ##
7 # QAPI common definitions
8 { 'include': 'common.json' }
11 # @SnapshotInfo:
13 # @id: unique snapshot id
15 # @name: user chosen name
17 # @vm-state-size: size of the VM state
19 # @date-sec: UTC date of the snapshot in seconds
21 # @date-nsec: fractional part in nano seconds to be used with date-sec
23 # @vm-clock-sec: VM clock relative to boot in seconds
25 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
27 # Since: 1.3
30 { 'struct': 'SnapshotInfo',
31   'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
32             'date-sec': 'int', 'date-nsec': 'int',
33             'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
36 # @ImageInfoSpecificQCow2EncryptionBase:
38 # @format: The encryption format
40 # Since: 2.10
42 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
43   'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
46 # @ImageInfoSpecificQCow2Encryption:
48 # Since: 2.10
50 { 'union': 'ImageInfoSpecificQCow2Encryption',
51   'base': 'ImageInfoSpecificQCow2EncryptionBase',
52   'discriminator': 'format',
53   'data': { 'aes': 'QCryptoBlockInfoQCow',
54             'luks': 'QCryptoBlockInfoLUKS' } }
57 # @ImageInfoSpecificQCow2:
59 # @compat: compatibility level
61 # @lazy-refcounts: on or off; only valid for compat >= 1.1
63 # @corrupt: true if the image has been marked corrupt; only valid for
64 #           compat >= 1.1 (since 2.2)
66 # @refcount-bits: width of a refcount entry in bits (since 2.3)
68 # @encrypt: details about encryption parameters; only set if image
69 #           is encrypted (since 2.10)
71 # Since: 1.7
73 { 'struct': 'ImageInfoSpecificQCow2',
74   'data': {
75       'compat': 'str',
76       '*lazy-refcounts': 'bool',
77       '*corrupt': 'bool',
78       'refcount-bits': 'int',
79       '*encrypt': 'ImageInfoSpecificQCow2Encryption'
80   } }
83 # @ImageInfoSpecificVmdk:
85 # @create-type: The create type of VMDK image
87 # @cid: Content id of image
89 # @parent-cid: Parent VMDK image's cid
91 # @extents: List of extent files
93 # Since: 1.7
95 { 'struct': 'ImageInfoSpecificVmdk',
96   'data': {
97       'create-type': 'str',
98       'cid': 'int',
99       'parent-cid': 'int',
100       'extents': ['ImageInfo']
101   } }
104 # @ImageInfoSpecific:
106 # A discriminated record of image format specific information structures.
108 # Since: 1.7
110 { 'union': 'ImageInfoSpecific',
111   'data': {
112       'qcow2': 'ImageInfoSpecificQCow2',
113       'vmdk': 'ImageInfoSpecificVmdk',
114       # If we need to add block driver specific parameters for
115       # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
116       # to define a ImageInfoSpecificLUKS
117       'luks': 'QCryptoBlockInfoLUKS'
118   } }
121 # @ImageInfo:
123 # Information about a QEMU image file
125 # @filename: name of the image file
127 # @format: format of the image file
129 # @virtual-size: maximum capacity in bytes of the image
131 # @actual-size: actual size on disk in bytes of the image
133 # @dirty-flag: true if image is not cleanly closed
135 # @cluster-size: size of a cluster in bytes
137 # @encrypted: true if the image is encrypted
139 # @compressed: true if the image is compressed (Since 1.7)
141 # @backing-filename: name of the backing file
143 # @full-backing-filename: full path of the backing file
145 # @backing-filename-format: the format of the backing file
147 # @snapshots: list of VM snapshots
149 # @backing-image: info of the backing image (since 1.6)
151 # @format-specific: structure supplying additional format-specific
152 # information (since 1.7)
154 # Since: 1.3
157 { 'struct': 'ImageInfo',
158   'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
159            '*actual-size': 'int', 'virtual-size': 'int',
160            '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
161            '*backing-filename': 'str', '*full-backing-filename': 'str',
162            '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
163            '*backing-image': 'ImageInfo',
164            '*format-specific': 'ImageInfoSpecific' } }
167 # @ImageCheck:
169 # Information about a QEMU image file check
171 # @filename: name of the image file checked
173 # @format: format of the image file checked
175 # @check-errors: number of unexpected errors occurred during check
177 # @image-end-offset: offset (in bytes) where the image ends, this
178 #                    field is present if the driver for the image format
179 #                    supports it
181 # @corruptions: number of corruptions found during the check if any
183 # @leaks: number of leaks found during the check if any
185 # @corruptions-fixed: number of corruptions fixed during the check
186 #                     if any
188 # @leaks-fixed: number of leaks fixed during the check if any
190 # @total-clusters: total number of clusters, this field is present
191 #                  if the driver for the image format supports it
193 # @allocated-clusters: total number of allocated clusters, this
194 #                      field is present if the driver for the image format
195 #                      supports it
197 # @fragmented-clusters: total number of fragmented clusters, this
198 #                       field is present if the driver for the image format
199 #                       supports it
201 # @compressed-clusters: total number of compressed clusters, this
202 #                       field is present if the driver for the image format
203 #                       supports it
205 # Since: 1.4
208 { 'struct': 'ImageCheck',
209   'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
210            '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
211            '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
212            '*total-clusters': 'int', '*allocated-clusters': 'int',
213            '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
216 # @MapEntry:
218 # Mapping information from a virtual block range to a host file range
220 # @start: the start byte of the mapped virtual range
222 # @length: the number of bytes of the mapped virtual range
224 # @data: whether the mapped range has data
226 # @zero: whether the virtual blocks are zeroed
228 # @depth: the depth of the mapping
230 # @offset: the offset in file that the virtual sectors are mapped to
232 # @filename: filename that is referred to by @offset
234 # Since: 2.6
237 { 'struct': 'MapEntry',
238   'data': {'start': 'int', 'length': 'int', 'data': 'bool',
239            'zero': 'bool', 'depth': 'int', '*offset': 'int',
240            '*filename': 'str' } }
243 # @BlockdevCacheInfo:
245 # Cache mode information for a block device
247 # @writeback:   true if writeback mode is enabled
248 # @direct:      true if the host page cache is bypassed (O_DIRECT)
249 # @no-flush:    true if flush requests are ignored for the device
251 # Since: 2.3
253 { 'struct': 'BlockdevCacheInfo',
254   'data': { 'writeback': 'bool',
255             'direct': 'bool',
256             'no-flush': 'bool' } }
259 # @BlockDeviceInfo:
261 # Information about the backing device for a block device.
263 # @file: the filename of the backing device
265 # @node-name: the name of the block driver node (Since 2.0)
267 # @ro: true if the backing device was open read-only
269 # @drv: the name of the block format used to open the backing device. As of
270 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
271 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
272 #       'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
273 #       'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
274 #       2.2: 'archipelago' added, 'cow' dropped
275 #       2.3: 'host_floppy' deprecated
276 #       2.5: 'host_floppy' dropped
277 #       2.6: 'luks' added
278 #       2.8: 'replication' added, 'tftp' dropped
279 #       2.9: 'archipelago' dropped
281 # @backing_file: the name of the backing file (for copy-on-write)
283 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
285 # @encrypted: true if the backing device is encrypted
287 # @encryption_key_missing: Deprecated; always false
289 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
291 # @bps: total throughput limit in bytes per second is specified
293 # @bps_rd: read throughput limit in bytes per second is specified
295 # @bps_wr: write throughput limit in bytes per second is specified
297 # @iops: total I/O operations per second is specified
299 # @iops_rd: read I/O operations per second is specified
301 # @iops_wr: write I/O operations per second is specified
303 # @image: the info of image used (since: 1.6)
305 # @bps_max: total throughput limit during bursts,
306 #                     in bytes (Since 1.7)
308 # @bps_rd_max: read throughput limit during bursts,
309 #                        in bytes (Since 1.7)
311 # @bps_wr_max: write throughput limit during bursts,
312 #                        in bytes (Since 1.7)
314 # @iops_max: total I/O operations per second during bursts,
315 #                      in bytes (Since 1.7)
317 # @iops_rd_max: read I/O operations per second during bursts,
318 #                         in bytes (Since 1.7)
320 # @iops_wr_max: write I/O operations per second during bursts,
321 #                         in bytes (Since 1.7)
323 # @bps_max_length: maximum length of the @bps_max burst
324 #                            period, in seconds. (Since 2.6)
326 # @bps_rd_max_length: maximum length of the @bps_rd_max
327 #                               burst period, in seconds. (Since 2.6)
329 # @bps_wr_max_length: maximum length of the @bps_wr_max
330 #                               burst period, in seconds. (Since 2.6)
332 # @iops_max_length: maximum length of the @iops burst
333 #                             period, in seconds. (Since 2.6)
335 # @iops_rd_max_length: maximum length of the @iops_rd_max
336 #                                burst period, in seconds. (Since 2.6)
338 # @iops_wr_max_length: maximum length of the @iops_wr_max
339 #                                burst period, in seconds. (Since 2.6)
341 # @iops_size: an I/O size in bytes (Since 1.7)
343 # @group: throttle group name (Since 2.4)
345 # @cache: the cache mode used for the block device (since: 2.3)
347 # @write_threshold: configured write threshold for the device.
348 #                   0 if disabled. (Since 2.3)
350 # Since: 0.14.0
353 { 'struct': 'BlockDeviceInfo',
354   'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
355             '*backing_file': 'str', 'backing_file_depth': 'int',
356             'encrypted': 'bool', 'encryption_key_missing': 'bool',
357             'detect_zeroes': 'BlockdevDetectZeroesOptions',
358             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
359             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
360             'image': 'ImageInfo',
361             '*bps_max': 'int', '*bps_rd_max': 'int',
362             '*bps_wr_max': 'int', '*iops_max': 'int',
363             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
364             '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
365             '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
366             '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
367             '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
368             'write_threshold': 'int' } }
371 # @BlockDeviceIoStatus:
373 # An enumeration of block device I/O status.
375 # @ok: The last I/O operation has succeeded
377 # @failed: The last I/O operation has failed
379 # @nospace: The last I/O operation has failed due to a no-space condition
381 # Since: 1.0
383 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
386 # @BlockDeviceMapEntry:
388 # Entry in the metadata map of the device (returned by "qemu-img map")
390 # @start: Offset in the image of the first byte described by this entry
391 #         (in bytes)
393 # @length: Length of the range described by this entry (in bytes)
395 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
396 #         before reaching one for which the range is allocated.  The value is
397 #         in the range 0 to the depth of the image chain - 1.
399 # @zero: the sectors in this range read as zeros
401 # @data: reading the image will actually read data from a file (in particular,
402 #        if @offset is present this means that the sectors are not simply
403 #        preallocated, but contain actual data in raw format)
405 # @offset: if present, the image file stores the data for this range in
406 #          raw format at the given offset.
408 # Since: 1.7
410 { 'struct': 'BlockDeviceMapEntry',
411   'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
412             'data': 'bool', '*offset': 'int' } }
415 # @DirtyBitmapStatus:
417 # An enumeration of possible states that a dirty bitmap can report to the user.
419 # @frozen: The bitmap is currently in-use by a backup operation or block job,
420 #          and is immutable.
422 # @disabled: The bitmap is currently in-use by an internal operation and is
423 #            read-only. It can still be deleted.
425 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
426 #          deleted, or used for backup operations.
428 # Since: 2.4
430 { 'enum': 'DirtyBitmapStatus',
431   'data': ['active', 'disabled', 'frozen'] }
434 # @BlockDirtyInfo:
436 # Block dirty bitmap information.
438 # @name: the name of the dirty bitmap (Since 2.4)
440 # @count: number of dirty bytes according to the dirty bitmap
442 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
444 # @status: current status of the dirty bitmap (since 2.4)
446 # Since: 1.3
448 { 'struct': 'BlockDirtyInfo',
449   'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
450            'status': 'DirtyBitmapStatus'} }
453 # @BlockInfo:
455 # Block device information.  This structure describes a virtual device and
456 # the backing device associated with it.
458 # @device: The device name associated with the virtual device.
460 # @type: This field is returned only for compatibility reasons, it should
461 #        not be used (always returns 'unknown')
463 # @removable: True if the device supports removable media.
465 # @locked: True if the guest has locked this device from having its media
466 #          removed
468 # @tray_open: True if the device's tray is open
469 #             (only present if it has a tray)
471 # @dirty-bitmaps: dirty bitmaps information (only present if the
472 #                 driver has one or more dirty bitmaps) (Since 2.0)
474 # @io-status: @BlockDeviceIoStatus. Only present if the device
475 #             supports it and the VM is configured to stop on errors
476 #             (supported device models: virtio-blk, IDE, SCSI except
477 #             scsi-generic)
479 # @inserted: @BlockDeviceInfo describing the device if media is
480 #            present
482 # Since:  0.14.0
484 { 'struct': 'BlockInfo',
485   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
486            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
487            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
488            '*dirty-bitmaps': ['BlockDirtyInfo'] } }
491 # @query-block:
493 # Get a list of BlockInfo for all virtual block devices.
495 # Returns: a list of @BlockInfo describing each virtual block device
497 # Since: 0.14.0
499 # Example:
501 # -> { "execute": "query-block" }
502 # <- {
503 #       "return":[
504 #          {
505 #             "io-status": "ok",
506 #             "device":"ide0-hd0",
507 #             "locked":false,
508 #             "removable":false,
509 #             "inserted":{
510 #                "ro":false,
511 #                "drv":"qcow2",
512 #                "encrypted":false,
513 #                "file":"disks/test.qcow2",
514 #                "backing_file_depth":1,
515 #                "bps":1000000,
516 #                "bps_rd":0,
517 #                "bps_wr":0,
518 #                "iops":1000000,
519 #                "iops_rd":0,
520 #                "iops_wr":0,
521 #                "bps_max": 8000000,
522 #                "bps_rd_max": 0,
523 #                "bps_wr_max": 0,
524 #                "iops_max": 0,
525 #                "iops_rd_max": 0,
526 #                "iops_wr_max": 0,
527 #                "iops_size": 0,
528 #                "detect_zeroes": "on",
529 #                "write_threshold": 0,
530 #                "image":{
531 #                   "filename":"disks/test.qcow2",
532 #                   "format":"qcow2",
533 #                   "virtual-size":2048000,
534 #                   "backing_file":"base.qcow2",
535 #                   "full-backing-filename":"disks/base.qcow2",
536 #                   "backing-filename-format":"qcow2",
537 #                   "snapshots":[
538 #                      {
539 #                         "id": "1",
540 #                         "name": "snapshot1",
541 #                         "vm-state-size": 0,
542 #                         "date-sec": 10000200,
543 #                         "date-nsec": 12,
544 #                         "vm-clock-sec": 206,
545 #                         "vm-clock-nsec": 30
546 #                      }
547 #                   ],
548 #                   "backing-image":{
549 #                       "filename":"disks/base.qcow2",
550 #                       "format":"qcow2",
551 #                       "virtual-size":2048000
552 #                   }
553 #                }
554 #             },
555 #             "type":"unknown"
556 #          },
557 #          {
558 #             "io-status": "ok",
559 #             "device":"ide1-cd0",
560 #             "locked":false,
561 #             "removable":true,
562 #             "type":"unknown"
563 #          },
564 #          {
565 #             "device":"floppy0",
566 #             "locked":false,
567 #             "removable":true,
568 #             "type":"unknown"
569 #          },
570 #          {
571 #             "device":"sd0",
572 #             "locked":false,
573 #             "removable":true,
574 #             "type":"unknown"
575 #          }
576 #       ]
577 #    }
580 { 'command': 'query-block', 'returns': ['BlockInfo'] }
584 # @BlockDeviceTimedStats:
586 # Statistics of a block device during a given interval of time.
588 # @interval_length: Interval used for calculating the statistics,
589 #                   in seconds.
591 # @min_rd_latency_ns: Minimum latency of read operations in the
592 #                     defined interval, in nanoseconds.
594 # @min_wr_latency_ns: Minimum latency of write operations in the
595 #                     defined interval, in nanoseconds.
597 # @min_flush_latency_ns: Minimum latency of flush operations in the
598 #                        defined interval, in nanoseconds.
600 # @max_rd_latency_ns: Maximum latency of read operations in the
601 #                     defined interval, in nanoseconds.
603 # @max_wr_latency_ns: Maximum latency of write operations in the
604 #                     defined interval, in nanoseconds.
606 # @max_flush_latency_ns: Maximum latency of flush operations in the
607 #                        defined interval, in nanoseconds.
609 # @avg_rd_latency_ns: Average latency of read operations in the
610 #                     defined interval, in nanoseconds.
612 # @avg_wr_latency_ns: Average latency of write operations in the
613 #                     defined interval, in nanoseconds.
615 # @avg_flush_latency_ns: Average latency of flush operations in the
616 #                        defined interval, in nanoseconds.
618 # @avg_rd_queue_depth: Average number of pending read operations
619 #                      in the defined interval.
621 # @avg_wr_queue_depth: Average number of pending write operations
622 #                      in the defined interval.
624 # Since: 2.5
626 { 'struct': 'BlockDeviceTimedStats',
627   'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
628             'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
629             'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
630             'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
631             'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
632             'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
635 # @BlockDeviceStats:
637 # Statistics of a virtual block device or a block backing device.
639 # @rd_bytes:      The number of bytes read by the device.
641 # @wr_bytes:      The number of bytes written by the device.
643 # @rd_operations: The number of read operations performed by the device.
645 # @wr_operations: The number of write operations performed by the device.
647 # @flush_operations: The number of cache flush operations performed by the
648 #                    device (since 0.15.0)
650 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
651 #                       (since 0.15.0).
653 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
655 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
657 # @wr_highest_offset: The offset after the greatest byte written to the
658 #                     device.  The intended use of this information is for
659 #                     growable sparse files (like qcow2) that are used on top
660 #                     of a physical device.
662 # @rd_merged: Number of read requests that have been merged into another
663 #             request (Since 2.3).
665 # @wr_merged: Number of write requests that have been merged into another
666 #             request (Since 2.3).
668 # @idle_time_ns: Time since the last I/O operation, in
669 #                nanoseconds. If the field is absent it means that
670 #                there haven't been any operations yet (Since 2.5).
672 # @failed_rd_operations: The number of failed read operations
673 #                        performed by the device (Since 2.5)
675 # @failed_wr_operations: The number of failed write operations
676 #                        performed by the device (Since 2.5)
678 # @failed_flush_operations: The number of failed flush operations
679 #                           performed by the device (Since 2.5)
681 # @invalid_rd_operations: The number of invalid read operations
682 #                          performed by the device (Since 2.5)
684 # @invalid_wr_operations: The number of invalid write operations
685 #                         performed by the device (Since 2.5)
687 # @invalid_flush_operations: The number of invalid flush operations
688 #                            performed by the device (Since 2.5)
690 # @account_invalid: Whether invalid operations are included in the
691 #                   last access statistics (Since 2.5)
693 # @account_failed: Whether failed operations are included in the
694 #                  latency and last access statistics (Since 2.5)
696 # @timed_stats: Statistics specific to the set of previously defined
697 #               intervals of time (Since 2.5)
699 # Since: 0.14.0
701 { 'struct': 'BlockDeviceStats',
702   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
703            'wr_operations': 'int', 'flush_operations': 'int',
704            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
705            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
706            'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
707            'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
708            'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
709            'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
710            'account_invalid': 'bool', 'account_failed': 'bool',
711            'timed_stats': ['BlockDeviceTimedStats'] } }
714 # @BlockStats:
716 # Statistics of a virtual block device or a block backing device.
718 # @device: If the stats are for a virtual block device, the name
719 #          corresponding to the virtual block device.
721 # @node-name: The node name of the device. (Since 2.3)
723 # @stats:  A @BlockDeviceStats for the device.
725 # @parent: This describes the file block device if it has one.
726 #          Contains recursively the statistics of the underlying
727 #          protocol (e.g. the host file for a qcow2 image). If there is
728 #          no underlying protocol, this field is omitted
730 # @backing: This describes the backing block device if it has one.
731 #           (Since 2.0)
733 # Since: 0.14.0
735 { 'struct': 'BlockStats',
736   'data': {'*device': 'str', '*node-name': 'str',
737            'stats': 'BlockDeviceStats',
738            '*parent': 'BlockStats',
739            '*backing': 'BlockStats'} }
742 # @query-blockstats:
744 # Query the @BlockStats for all virtual block devices.
746 # @query-nodes: If true, the command will query all the block nodes
747 #               that have a node name, in a list which will include "parent"
748 #               information, but not "backing".
749 #               If false or omitted, the behavior is as before - query all the
750 #               device backends, recursively including their "parent" and
751 #               "backing". (Since 2.3)
753 # Returns: A list of @BlockStats for each virtual block devices.
755 # Since: 0.14.0
757 # Example:
759 # -> { "execute": "query-blockstats" }
760 # <- {
761 #       "return":[
762 #          {
763 #             "device":"ide0-hd0",
764 #             "parent":{
765 #                "stats":{
766 #                   "wr_highest_offset":3686448128,
767 #                   "wr_bytes":9786368,
768 #                   "wr_operations":751,
769 #                   "rd_bytes":122567168,
770 #                   "rd_operations":36772
771 #                   "wr_total_times_ns":313253456
772 #                   "rd_total_times_ns":3465673657
773 #                   "flush_total_times_ns":49653
774 #                   "flush_operations":61,
775 #                   "rd_merged":0,
776 #                   "wr_merged":0,
777 #                   "idle_time_ns":2953431879,
778 #                   "account_invalid":true,
779 #                   "account_failed":false
780 #                }
781 #             },
782 #             "stats":{
783 #                "wr_highest_offset":2821110784,
784 #                "wr_bytes":9786368,
785 #                "wr_operations":692,
786 #                "rd_bytes":122739200,
787 #                "rd_operations":36604
788 #                "flush_operations":51,
789 #                "wr_total_times_ns":313253456
790 #                "rd_total_times_ns":3465673657
791 #                "flush_total_times_ns":49653,
792 #                "rd_merged":0,
793 #                "wr_merged":0,
794 #                "idle_time_ns":2953431879,
795 #                "account_invalid":true,
796 #                "account_failed":false
797 #             }
798 #          },
799 #          {
800 #             "device":"ide1-cd0",
801 #             "stats":{
802 #                "wr_highest_offset":0,
803 #                "wr_bytes":0,
804 #                "wr_operations":0,
805 #                "rd_bytes":0,
806 #                "rd_operations":0
807 #                "flush_operations":0,
808 #                "wr_total_times_ns":0
809 #                "rd_total_times_ns":0
810 #                "flush_total_times_ns":0,
811 #                "rd_merged":0,
812 #                "wr_merged":0,
813 #                "account_invalid":false,
814 #                "account_failed":false
815 #             }
816 #          },
817 #          {
818 #             "device":"floppy0",
819 #             "stats":{
820 #                "wr_highest_offset":0,
821 #                "wr_bytes":0,
822 #                "wr_operations":0,
823 #                "rd_bytes":0,
824 #                "rd_operations":0
825 #                "flush_operations":0,
826 #                "wr_total_times_ns":0
827 #                "rd_total_times_ns":0
828 #                "flush_total_times_ns":0,
829 #                "rd_merged":0,
830 #                "wr_merged":0,
831 #                "account_invalid":false,
832 #                "account_failed":false
833 #             }
834 #          },
835 #          {
836 #             "device":"sd0",
837 #             "stats":{
838 #                "wr_highest_offset":0,
839 #                "wr_bytes":0,
840 #                "wr_operations":0,
841 #                "rd_bytes":0,
842 #                "rd_operations":0
843 #                "flush_operations":0,
844 #                "wr_total_times_ns":0
845 #                "rd_total_times_ns":0
846 #                "flush_total_times_ns":0,
847 #                "rd_merged":0,
848 #                "wr_merged":0,
849 #                "account_invalid":false,
850 #                "account_failed":false
851 #             }
852 #          }
853 #       ]
854 #    }
857 { 'command': 'query-blockstats',
858   'data': { '*query-nodes': 'bool' },
859   'returns': ['BlockStats'] }
862 # @BlockdevOnError:
864 # An enumeration of possible behaviors for errors on I/O operations.
865 # The exact meaning depends on whether the I/O was initiated by a guest
866 # or by a block job
868 # @report: for guest operations, report the error to the guest;
869 #          for jobs, cancel the job
871 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
872 #          or BLOCK_JOB_ERROR)
874 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
876 # @stop: for guest operations, stop the virtual machine;
877 #        for jobs, pause the job
879 # @auto: inherit the error handling policy of the backend (since: 2.7)
881 # Since: 1.3
883 { 'enum': 'BlockdevOnError',
884   'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
887 # @MirrorSyncMode:
889 # An enumeration of possible behaviors for the initial synchronization
890 # phase of storage mirroring.
892 # @top: copies data in the topmost image to the destination
894 # @full: copies data from all images to the destination
896 # @none: only copy data written from now on
898 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
900 # Since: 1.3
902 { 'enum': 'MirrorSyncMode',
903   'data': ['top', 'full', 'none', 'incremental'] }
906 # @BlockJobType:
908 # Type of a block job.
910 # @commit: block commit job type, see "block-commit"
912 # @stream: block stream job type, see "block-stream"
914 # @mirror: drive mirror job type, see "drive-mirror"
916 # @backup: drive backup job type, see "drive-backup"
918 # Since: 1.7
920 { 'enum': 'BlockJobType',
921   'data': ['commit', 'stream', 'mirror', 'backup'] }
924 # @BlockJobInfo:
926 # Information about a long-running block device operation.
928 # @type: the job type ('stream' for image streaming)
930 # @device: The job identifier. Originally the device name but other
931 #          values are allowed since QEMU 2.7
933 # @len: the maximum progress value
935 # @busy: false if the job is known to be in a quiescent state, with
936 #        no pending I/O.  Since 1.3.
938 # @paused: whether the job is paused or, if @busy is true, will
939 #          pause itself as soon as possible.  Since 1.3.
941 # @offset: the current progress value
943 # @speed: the rate limit, bytes per second
945 # @io-status: the status of the job (since 1.3)
947 # @ready: true if the job may be completed (since 2.2)
949 # Since: 1.1
951 { 'struct': 'BlockJobInfo',
952   'data': {'type': 'str', 'device': 'str', 'len': 'int',
953            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
954            'io-status': 'BlockDeviceIoStatus', 'ready': 'bool'} }
957 # @query-block-jobs:
959 # Return information about long-running block device operations.
961 # Returns: a list of @BlockJobInfo for each active block job
963 # Since: 1.1
965 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
968 # @block_passwd:
970 # This command sets the password of a block device that has not been open
971 # with a password and requires one.
973 # This command is now obsolete and will always return an error since 2.10
976 { 'command': 'block_passwd', 'data': {'*device': 'str',
977                                       '*node-name': 'str', 'password': 'str'} }
980 # @block_resize:
982 # Resize a block image while a guest is running.
984 # Either @device or @node-name must be set but not both.
986 # @device: the name of the device to get the image resized
988 # @node-name: graph node name to get the image resized (Since 2.0)
990 # @size:  new image size in bytes
992 # Returns: nothing on success
993 #          If @device is not a valid block device, DeviceNotFound
995 # Since: 0.14.0
997 # Example:
999 # -> { "execute": "block_resize",
1000 #      "arguments": { "device": "scratch", "size": 1073741824 } }
1001 # <- { "return": {} }
1004 { 'command': 'block_resize', 'data': { '*device': 'str',
1005                                        '*node-name': 'str',
1006                                        'size': 'int' }}
1009 # @NewImageMode:
1011 # An enumeration that tells QEMU how to set the backing file path in
1012 # a new image file.
1014 # @existing: QEMU should look for an existing image file.
1016 # @absolute-paths: QEMU should create a new image with absolute paths
1017 # for the backing file. If there is no backing file available, the new
1018 # image will not be backed either.
1020 # Since: 1.1
1022 { 'enum': 'NewImageMode',
1023   'data': [ 'existing', 'absolute-paths' ] }
1026 # @BlockdevSnapshotSync:
1028 # Either @device or @node-name must be set but not both.
1030 # @device: the name of the device to generate the snapshot from.
1032 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1034 # @snapshot-file: the target of the new image. If the file exists, or
1035 # if it is a device, the snapshot will be created in the existing
1036 # file/device. Otherwise, a new file will be created.
1038 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1040 # @format: the format of the snapshot image, default is 'qcow2'.
1042 # @mode: whether and how QEMU should create a new image, default is
1043 #        'absolute-paths'.
1045 { 'struct': 'BlockdevSnapshotSync',
1046   'data': { '*device': 'str', '*node-name': 'str',
1047             'snapshot-file': 'str', '*snapshot-node-name': 'str',
1048             '*format': 'str', '*mode': 'NewImageMode' } }
1051 # @BlockdevSnapshot:
1053 # @node: device or node name that will have a snapshot created.
1055 # @overlay: reference to the existing block device that will become
1056 #           the overlay of @node, as part of creating the snapshot.
1057 #           It must not have a current backing file (this can be
1058 #           achieved by passing "backing": "" to blockdev-add).
1060 # Since: 2.5
1062 { 'struct': 'BlockdevSnapshot',
1063   'data': { 'node': 'str', 'overlay': 'str' } }
1066 # @DriveBackup:
1068 # @job-id: identifier for the newly-created block job. If
1069 #          omitted, the device name will be used. (Since 2.7)
1071 # @device: the device name or node-name of a root node which should be copied.
1073 # @target: the target of the new image. If the file exists, or if it
1074 #          is a device, the existing file/device will be used as the new
1075 #          destination.  If it does not exist, a new file will be created.
1077 # @format: the format of the new destination, default is to
1078 #          probe if @mode is 'existing', else the format of the source
1080 # @sync: what parts of the disk image should be copied to the destination
1081 #        (all the disk, only the sectors allocated in the topmost image, from a
1082 #        dirty bitmap, or only new I/O).
1084 # @mode: whether and how QEMU should create a new image, default is
1085 #        'absolute-paths'.
1087 # @speed: the maximum speed, in bytes per second
1089 # @bitmap: the name of dirty bitmap if sync is "incremental".
1090 #          Must be present if sync is "incremental", must NOT be present
1091 #          otherwise. (Since 2.4)
1093 # @compress: true to compress data, if the target format supports it.
1094 #            (default: false) (since 2.8)
1096 # @on-source-error: the action to take on an error on the source,
1097 #                   default 'report'.  'stop' and 'enospc' can only be used
1098 #                   if the block device supports io-status (see BlockInfo).
1100 # @on-target-error: the action to take on an error on the target,
1101 #                   default 'report' (no limitations, since this applies to
1102 #                   a different block device than @device).
1104 # Note: @on-source-error and @on-target-error only affect background
1105 # I/O.  If an error occurs during a guest write request, the device's
1106 # rerror/werror actions will be used.
1108 # Since: 1.6
1110 { 'struct': 'DriveBackup',
1111   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1112             '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1113             '*speed': 'int', '*bitmap': 'str', '*compress': 'bool',
1114             '*on-source-error': 'BlockdevOnError',
1115             '*on-target-error': 'BlockdevOnError' } }
1118 # @BlockdevBackup:
1120 # @job-id: identifier for the newly-created block job. If
1121 #          omitted, the device name will be used. (Since 2.7)
1123 # @device: the device name or node-name of a root node which should be copied.
1125 # @target: the device name or node-name of the backup target node.
1127 # @sync: what parts of the disk image should be copied to the destination
1128 #        (all the disk, only the sectors allocated in the topmost image, or
1129 #        only new I/O).
1131 # @speed: the maximum speed, in bytes per second. The default is 0,
1132 #         for unlimited.
1134 # @compress: true to compress data, if the target format supports it.
1135 #            (default: false) (since 2.8)
1137 # @on-source-error: the action to take on an error on the source,
1138 #                   default 'report'.  'stop' and 'enospc' can only be used
1139 #                   if the block device supports io-status (see BlockInfo).
1141 # @on-target-error: the action to take on an error on the target,
1142 #                   default 'report' (no limitations, since this applies to
1143 #                   a different block device than @device).
1145 # Note: @on-source-error and @on-target-error only affect background
1146 # I/O.  If an error occurs during a guest write request, the device's
1147 # rerror/werror actions will be used.
1149 # Since: 2.3
1151 { 'struct': 'BlockdevBackup',
1152   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1153             'sync': 'MirrorSyncMode',
1154             '*speed': 'int',
1155             '*compress': 'bool',
1156             '*on-source-error': 'BlockdevOnError',
1157             '*on-target-error': 'BlockdevOnError' } }
1160 # @blockdev-snapshot-sync:
1162 # Generates a synchronous snapshot of a block device.
1164 # For the arguments, see the documentation of BlockdevSnapshotSync.
1166 # Returns: nothing on success
1167 #          If @device is not a valid block device, DeviceNotFound
1169 # Since: 0.14.0
1171 # Example:
1173 # -> { "execute": "blockdev-snapshot-sync",
1174 #      "arguments": { "device": "ide-hd0",
1175 #                     "snapshot-file":
1176 #                     "/some/place/my-image",
1177 #                     "format": "qcow2" } }
1178 # <- { "return": {} }
1181 { 'command': 'blockdev-snapshot-sync',
1182   'data': 'BlockdevSnapshotSync' }
1186 # @blockdev-snapshot:
1188 # Generates a snapshot of a block device.
1190 # Create a snapshot, by installing 'node' as the backing image of
1191 # 'overlay'. Additionally, if 'node' is associated with a block
1192 # device, the block device changes to using 'overlay' as its new active
1193 # image.
1195 # For the arguments, see the documentation of BlockdevSnapshot.
1197 # Since: 2.5
1199 # Example:
1201 # -> { "execute": "blockdev-add",
1202 #      "arguments": { "driver": "qcow2",
1203 #                     "node-name": "node1534",
1204 #                     "file": { "driver": "file",
1205 #                               "filename": "hd1.qcow2" },
1206 #                     "backing": "" } }
1208 # <- { "return": {} }
1210 # -> { "execute": "blockdev-snapshot",
1211 #      "arguments": { "node": "ide-hd0",
1212 #                     "overlay": "node1534" } }
1213 # <- { "return": {} }
1216 { 'command': 'blockdev-snapshot',
1217   'data': 'BlockdevSnapshot' }
1220 # @change-backing-file:
1222 # Change the backing file in the image file metadata.  This does not
1223 # cause QEMU to reopen the image file to reparse the backing filename
1224 # (it may, however, perform a reopen to change permissions from
1225 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1226 # into the image file metadata, and the QEMU internal strings are
1227 # updated.
1229 # @image-node-name: The name of the block driver state node of the
1230 #                   image to modify. The "device" argument is used
1231 #                   to verify "image-node-name" is in the chain
1232 #                   described by "device".
1234 # @device:          The device name or node-name of the root node that owns
1235 #                   image-node-name.
1237 # @backing-file:    The string to write as the backing file.  This
1238 #                   string is not validated, so care should be taken
1239 #                   when specifying the string or the image chain may
1240 #                   not be able to be reopened again.
1242 # Returns: Nothing on success
1244 #          If "device" does not exist or cannot be determined, DeviceNotFound
1246 # Since: 2.1
1248 { 'command': 'change-backing-file',
1249   'data': { 'device': 'str', 'image-node-name': 'str',
1250             'backing-file': 'str' } }
1253 # @block-commit:
1255 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1256 # writes data between 'top' and 'base' into 'base'.
1258 # @job-id: identifier for the newly-created block job. If
1259 #          omitted, the device name will be used. (Since 2.7)
1261 # @device:  the device name or node-name of a root node
1263 # @base:   The file name of the backing image to write data into.
1264 #                    If not specified, this is the deepest backing image.
1266 # @top:    The file name of the backing image within the image chain,
1267 #                    which contains the topmost data to be committed down. If
1268 #                    not specified, this is the active layer.
1270 # @backing-file:  The backing file string to write into the overlay
1271 #                           image of 'top'.  If 'top' is the active layer,
1272 #                           specifying a backing file string is an error. This
1273 #                           filename is not validated.
1275 #                           If a pathname string is such that it cannot be
1276 #                           resolved by QEMU, that means that subsequent QMP or
1277 #                           HMP commands must use node-names for the image in
1278 #                           question, as filename lookup methods will fail.
1280 #                           If not specified, QEMU will automatically determine
1281 #                           the backing file string to use, or error out if
1282 #                           there is no obvious choice. Care should be taken
1283 #                           when specifying the string, to specify a valid
1284 #                           filename or protocol.
1285 #                           (Since 2.1)
1287 #                    If top == base, that is an error.
1288 #                    If top == active, the job will not be completed by itself,
1289 #                    user needs to complete the job with the block-job-complete
1290 #                    command after getting the ready event. (Since 2.0)
1292 #                    If the base image is smaller than top, then the base image
1293 #                    will be resized to be the same size as top.  If top is
1294 #                    smaller than the base image, the base will not be
1295 #                    truncated.  If you want the base image size to match the
1296 #                    size of the smaller top, you can safely truncate it
1297 #                    yourself once the commit operation successfully completes.
1299 # @speed:  the maximum speed, in bytes per second
1301 # @filter-node-name: the node name that should be assigned to the
1302 #                    filter driver that the commit job inserts into the graph
1303 #                    above @top. If this option is not given, a node name is
1304 #                    autogenerated. (Since: 2.9)
1306 # Returns: Nothing on success
1307 #          If commit or stream is already active on this device, DeviceInUse
1308 #          If @device does not exist, DeviceNotFound
1309 #          If image commit is not supported by this device, NotSupported
1310 #          If @base or @top is invalid, a generic error is returned
1311 #          If @speed is invalid, InvalidParameter
1313 # Since: 1.3
1315 # Example:
1317 # -> { "execute": "block-commit",
1318 #      "arguments": { "device": "virtio0",
1319 #                     "top": "/tmp/snap1.qcow2" } }
1320 # <- { "return": {} }
1323 { 'command': 'block-commit',
1324   'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
1325             '*backing-file': 'str', '*speed': 'int',
1326             '*filter-node-name': 'str' } }
1329 # @drive-backup:
1331 # Start a point-in-time copy of a block device to a new destination.  The
1332 # status of ongoing drive-backup operations can be checked with
1333 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1334 # The operation can be stopped before it has completed using the
1335 # block-job-cancel command.
1337 # Returns: nothing on success
1338 #          If @device is not a valid block device, GenericError
1340 # Since: 1.6
1342 # Example:
1344 # -> { "execute": "drive-backup",
1345 #      "arguments": { "device": "drive0",
1346 #                     "sync": "full",
1347 #                     "target": "backup.img" } }
1348 # <- { "return": {} }
1351 { 'command': 'drive-backup', 'boxed': true,
1352   'data': 'DriveBackup' }
1355 # @blockdev-backup:
1357 # Start a point-in-time copy of a block device to a new destination.  The
1358 # status of ongoing blockdev-backup operations can be checked with
1359 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1360 # The operation can be stopped before it has completed using the
1361 # block-job-cancel command.
1363 # Returns: nothing on success
1364 #          If @device is not a valid block device, DeviceNotFound
1366 # Since: 2.3
1368 # Example:
1369 # -> { "execute": "blockdev-backup",
1370 #      "arguments": { "device": "src-id",
1371 #                     "sync": "full",
1372 #                     "target": "tgt-id" } }
1373 # <- { "return": {} }
1376 { 'command': 'blockdev-backup', 'boxed': true,
1377   'data': 'BlockdevBackup' }
1381 # @query-named-block-nodes:
1383 # Get the named block driver list
1385 # Returns: the list of BlockDeviceInfo
1387 # Since: 2.0
1389 # Example:
1391 # -> { "execute": "query-named-block-nodes" }
1392 # <- { "return": [ { "ro":false,
1393 #                    "drv":"qcow2",
1394 #                    "encrypted":false,
1395 #                    "file":"disks/test.qcow2",
1396 #                    "node-name": "my-node",
1397 #                    "backing_file_depth":1,
1398 #                    "bps":1000000,
1399 #                    "bps_rd":0,
1400 #                    "bps_wr":0,
1401 #                    "iops":1000000,
1402 #                    "iops_rd":0,
1403 #                    "iops_wr":0,
1404 #                    "bps_max": 8000000,
1405 #                    "bps_rd_max": 0,
1406 #                    "bps_wr_max": 0,
1407 #                    "iops_max": 0,
1408 #                    "iops_rd_max": 0,
1409 #                    "iops_wr_max": 0,
1410 #                    "iops_size": 0,
1411 #                    "write_threshold": 0,
1412 #                    "image":{
1413 #                       "filename":"disks/test.qcow2",
1414 #                       "format":"qcow2",
1415 #                       "virtual-size":2048000,
1416 #                       "backing_file":"base.qcow2",
1417 #                       "full-backing-filename":"disks/base.qcow2",
1418 #                       "backing-filename-format":"qcow2",
1419 #                       "snapshots":[
1420 #                          {
1421 #                             "id": "1",
1422 #                             "name": "snapshot1",
1423 #                             "vm-state-size": 0,
1424 #                             "date-sec": 10000200,
1425 #                             "date-nsec": 12,
1426 #                             "vm-clock-sec": 206,
1427 #                             "vm-clock-nsec": 30
1428 #                          }
1429 #                       ],
1430 #                       "backing-image":{
1431 #                           "filename":"disks/base.qcow2",
1432 #                           "format":"qcow2",
1433 #                           "virtual-size":2048000
1434 #                       }
1435 #                    } } ] }
1438 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1441 # @drive-mirror:
1443 # Start mirroring a block device's writes to a new destination. target
1444 # specifies the target of the new image. If the file exists, or if it
1445 # is a device, it will be used as the new destination for writes. If
1446 # it does not exist, a new file will be created. format specifies the
1447 # format of the mirror image, default is to probe if mode='existing',
1448 # else the format of the source.
1450 # Returns: nothing on success
1451 #          If @device is not a valid block device, GenericError
1453 # Since: 1.3
1455 # Example:
1457 # -> { "execute": "drive-mirror",
1458 #      "arguments": { "device": "ide-hd0",
1459 #                     "target": "/some/place/my-image",
1460 #                     "sync": "full",
1461 #                     "format": "qcow2" } }
1462 # <- { "return": {} }
1465 { 'command': 'drive-mirror', 'boxed': true,
1466   'data': 'DriveMirror' }
1469 # @DriveMirror:
1471 # A set of parameters describing drive mirror setup.
1473 # @job-id: identifier for the newly-created block job. If
1474 #          omitted, the device name will be used. (Since 2.7)
1476 # @device:  the device name or node-name of a root node whose writes should be
1477 #           mirrored.
1479 # @target: the target of the new image. If the file exists, or if it
1480 #          is a device, the existing file/device will be used as the new
1481 #          destination.  If it does not exist, a new file will be created.
1483 # @format: the format of the new destination, default is to
1484 #          probe if @mode is 'existing', else the format of the source
1486 # @node-name: the new block driver state node name in the graph
1487 #             (Since 2.1)
1489 # @replaces: with sync=full graph node name to be replaced by the new
1490 #            image when a whole image copy is done. This can be used to repair
1491 #            broken Quorum files. (Since 2.1)
1493 # @mode: whether and how QEMU should create a new image, default is
1494 #        'absolute-paths'.
1496 # @speed:  the maximum speed, in bytes per second
1498 # @sync: what parts of the disk image should be copied to the destination
1499 #        (all the disk, only the sectors allocated in the topmost image, or
1500 #        only new I/O).
1502 # @granularity: granularity of the dirty bitmap, default is 64K
1503 #               if the image format doesn't have clusters, 4K if the clusters
1504 #               are smaller than that, else the cluster size.  Must be a
1505 #               power of 2 between 512 and 64M (since 1.4).
1507 # @buf-size: maximum amount of data in flight from source to
1508 #            target (since 1.4).
1510 # @on-source-error: the action to take on an error on the source,
1511 #                   default 'report'.  'stop' and 'enospc' can only be used
1512 #                   if the block device supports io-status (see BlockInfo).
1514 # @on-target-error: the action to take on an error on the target,
1515 #                   default 'report' (no limitations, since this applies to
1516 #                   a different block device than @device).
1517 # @unmap: Whether to try to unmap target sectors where source has
1518 #         only zero. If true, and target unallocated sectors will read as zero,
1519 #         target image sectors will be unmapped; otherwise, zeroes will be
1520 #         written. Both will result in identical contents.
1521 #         Default is true. (Since 2.4)
1523 # Since: 1.3
1525 { 'struct': 'DriveMirror',
1526   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1527             '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1528             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1529             '*speed': 'int', '*granularity': 'uint32',
1530             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1531             '*on-target-error': 'BlockdevOnError',
1532             '*unmap': 'bool' } }
1535 # @BlockDirtyBitmap:
1537 # @node: name of device/node which the bitmap is tracking
1539 # @name: name of the dirty bitmap
1541 # Since: 2.4
1543 { 'struct': 'BlockDirtyBitmap',
1544   'data': { 'node': 'str', 'name': 'str' } }
1547 # @BlockDirtyBitmapAdd:
1549 # @node: name of device/node which the bitmap is tracking
1551 # @name: name of the dirty bitmap
1553 # @granularity: the bitmap granularity, default is 64k for
1554 #               block-dirty-bitmap-add
1556 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1557 #              corresponding block device image file on its close. For now only
1558 #              Qcow2 disks support persistent bitmaps. Default is false for
1559 #              block-dirty-bitmap-add. (Since: 2.10)
1561 # @autoload: the bitmap will be automatically loaded when the image it is stored
1562 #            in is opened. This flag may only be specified for persistent
1563 #            bitmaps. Default is false for block-dirty-bitmap-add. (Since: 2.10)
1565 # Since: 2.4
1567 { 'struct': 'BlockDirtyBitmapAdd',
1568   'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1569             '*persistent': 'bool', '*autoload': 'bool' } }
1572 # @block-dirty-bitmap-add:
1574 # Create a dirty bitmap with a name on the node, and start tracking the writes.
1576 # Returns: nothing on success
1577 #          If @node is not a valid block device or node, DeviceNotFound
1578 #          If @name is already taken, GenericError with an explanation
1580 # Since: 2.4
1582 # Example:
1584 # -> { "execute": "block-dirty-bitmap-add",
1585 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
1586 # <- { "return": {} }
1589 { 'command': 'block-dirty-bitmap-add',
1590   'data': 'BlockDirtyBitmapAdd' }
1593 # @block-dirty-bitmap-remove:
1595 # Stop write tracking and remove the dirty bitmap that was created
1596 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
1597 # storage too.
1599 # Returns: nothing on success
1600 #          If @node is not a valid block device or node, DeviceNotFound
1601 #          If @name is not found, GenericError with an explanation
1602 #          if @name is frozen by an operation, GenericError
1604 # Since: 2.4
1606 # Example:
1608 # -> { "execute": "block-dirty-bitmap-remove",
1609 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
1610 # <- { "return": {} }
1613 { 'command': 'block-dirty-bitmap-remove',
1614   'data': 'BlockDirtyBitmap' }
1617 # @block-dirty-bitmap-clear:
1619 # Clear (reset) a dirty bitmap on the device, so that an incremental
1620 # backup from this point in time forward will only backup clusters
1621 # modified after this clear operation.
1623 # Returns: nothing on success
1624 #          If @node is not a valid block device, DeviceNotFound
1625 #          If @name is not found, GenericError with an explanation
1627 # Since: 2.4
1629 # Example:
1631 # -> { "execute": "block-dirty-bitmap-clear",
1632 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
1633 # <- { "return": {} }
1636 { 'command': 'block-dirty-bitmap-clear',
1637   'data': 'BlockDirtyBitmap' }
1640 # @BlockDirtyBitmapSha256:
1642 # SHA256 hash of dirty bitmap data
1644 # @sha256: ASCII representation of SHA256 bitmap hash
1646 # Since: 2.10
1648   { 'struct': 'BlockDirtyBitmapSha256',
1649     'data': {'sha256': 'str'} }
1652 # @x-debug-block-dirty-bitmap-sha256:
1654 # Get bitmap SHA256
1656 # Returns: BlockDirtyBitmapSha256 on success
1657 #          If @node is not a valid block device, DeviceNotFound
1658 #          If @name is not found or if hashing has failed, GenericError with an
1659 #          explanation
1661 # Since: 2.10
1663   { 'command': 'x-debug-block-dirty-bitmap-sha256',
1664     'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
1667 # @blockdev-mirror:
1669 # Start mirroring a block device's writes to a new destination.
1671 # @job-id: identifier for the newly-created block job. If
1672 #          omitted, the device name will be used. (Since 2.7)
1674 # @device: The device name or node-name of a root node whose writes should be
1675 #          mirrored.
1677 # @target: the id or node-name of the block device to mirror to. This mustn't be
1678 #          attached to guest.
1680 # @replaces: with sync=full graph node name to be replaced by the new
1681 #            image when a whole image copy is done. This can be used to repair
1682 #            broken Quorum files.
1684 # @speed:  the maximum speed, in bytes per second
1686 # @sync: what parts of the disk image should be copied to the destination
1687 #        (all the disk, only the sectors allocated in the topmost image, or
1688 #        only new I/O).
1690 # @granularity: granularity of the dirty bitmap, default is 64K
1691 #               if the image format doesn't have clusters, 4K if the clusters
1692 #               are smaller than that, else the cluster size.  Must be a
1693 #               power of 2 between 512 and 64M
1695 # @buf-size: maximum amount of data in flight from source to
1696 #            target
1698 # @on-source-error: the action to take on an error on the source,
1699 #                   default 'report'.  'stop' and 'enospc' can only be used
1700 #                   if the block device supports io-status (see BlockInfo).
1702 # @on-target-error: the action to take on an error on the target,
1703 #                   default 'report' (no limitations, since this applies to
1704 #                   a different block device than @device).
1706 # @filter-node-name: the node name that should be assigned to the
1707 #                    filter driver that the mirror job inserts into the graph
1708 #                    above @device. If this option is not given, a node name is
1709 #                    autogenerated. (Since: 2.9)
1711 # Returns: nothing on success.
1713 # Since: 2.6
1715 # Example:
1717 # -> { "execute": "blockdev-mirror",
1718 #      "arguments": { "device": "ide-hd0",
1719 #                     "target": "target0",
1720 #                     "sync": "full" } }
1721 # <- { "return": {} }
1724 { 'command': 'blockdev-mirror',
1725   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1726             '*replaces': 'str',
1727             'sync': 'MirrorSyncMode',
1728             '*speed': 'int', '*granularity': 'uint32',
1729             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1730             '*on-target-error': 'BlockdevOnError',
1731             '*filter-node-name': 'str' } }
1734 # @block_set_io_throttle:
1736 # Change I/O throttle limits for a block drive.
1738 # Since QEMU 2.4, each device with I/O limits is member of a throttle
1739 # group.
1741 # If two or more devices are members of the same group, the limits
1742 # will apply to the combined I/O of the whole group in a round-robin
1743 # fashion. Therefore, setting new I/O limits to a device will affect
1744 # the whole group.
1746 # The name of the group can be specified using the 'group' parameter.
1747 # If the parameter is unset, it is assumed to be the current group of
1748 # that device. If it's not in any group yet, the name of the device
1749 # will be used as the name for its group.
1751 # The 'group' parameter can also be used to move a device to a
1752 # different group. In this case the limits specified in the parameters
1753 # will be applied to the new group only.
1755 # I/O limits can be disabled by setting all of them to 0. In this case
1756 # the device will be removed from its group and the rest of its
1757 # members will not be affected. The 'group' parameter is ignored.
1759 # Returns: Nothing on success
1760 #          If @device is not a valid block device, DeviceNotFound
1762 # Since: 1.1
1764 # Example:
1766 # -> { "execute": "block_set_io_throttle",
1767 #      "arguments": { "id": "ide0-1-0",
1768 #                     "bps": 1000000,
1769 #                     "bps_rd": 0,
1770 #                     "bps_wr": 0,
1771 #                     "iops": 0,
1772 #                     "iops_rd": 0,
1773 #                     "iops_wr": 0,
1774 #                     "bps_max": 8000000,
1775 #                     "bps_rd_max": 0,
1776 #                     "bps_wr_max": 0,
1777 #                     "iops_max": 0,
1778 #                     "iops_rd_max": 0,
1779 #                     "iops_wr_max": 0,
1780 #                     "bps_max_length": 60,
1781 #                     "iops_size": 0 } }
1782 # <- { "return": {} }
1784 { 'command': 'block_set_io_throttle', 'boxed': true,
1785   'data': 'BlockIOThrottle' }
1788 # @BlockIOThrottle:
1790 # A set of parameters describing block throttling.
1792 # @device: Block device name (deprecated, use @id instead)
1794 # @id: The name or QOM path of the guest device (since: 2.8)
1796 # @bps: total throughput limit in bytes per second
1798 # @bps_rd: read throughput limit in bytes per second
1800 # @bps_wr: write throughput limit in bytes per second
1802 # @iops: total I/O operations per second
1804 # @iops_rd: read I/O operations per second
1806 # @iops_wr: write I/O operations per second
1808 # @bps_max: total throughput limit during bursts,
1809 #                     in bytes (Since 1.7)
1811 # @bps_rd_max: read throughput limit during bursts,
1812 #                        in bytes (Since 1.7)
1814 # @bps_wr_max: write throughput limit during bursts,
1815 #                        in bytes (Since 1.7)
1817 # @iops_max: total I/O operations per second during bursts,
1818 #                      in bytes (Since 1.7)
1820 # @iops_rd_max: read I/O operations per second during bursts,
1821 #                         in bytes (Since 1.7)
1823 # @iops_wr_max: write I/O operations per second during bursts,
1824 #                         in bytes (Since 1.7)
1826 # @bps_max_length: maximum length of the @bps_max burst
1827 #                            period, in seconds. It must only
1828 #                            be set if @bps_max is set as well.
1829 #                            Defaults to 1. (Since 2.6)
1831 # @bps_rd_max_length: maximum length of the @bps_rd_max
1832 #                               burst period, in seconds. It must only
1833 #                               be set if @bps_rd_max is set as well.
1834 #                               Defaults to 1. (Since 2.6)
1836 # @bps_wr_max_length: maximum length of the @bps_wr_max
1837 #                               burst period, in seconds. It must only
1838 #                               be set if @bps_wr_max is set as well.
1839 #                               Defaults to 1. (Since 2.6)
1841 # @iops_max_length: maximum length of the @iops burst
1842 #                             period, in seconds. It must only
1843 #                             be set if @iops_max is set as well.
1844 #                             Defaults to 1. (Since 2.6)
1846 # @iops_rd_max_length: maximum length of the @iops_rd_max
1847 #                                burst period, in seconds. It must only
1848 #                                be set if @iops_rd_max is set as well.
1849 #                                Defaults to 1. (Since 2.6)
1851 # @iops_wr_max_length: maximum length of the @iops_wr_max
1852 #                                burst period, in seconds. It must only
1853 #                                be set if @iops_wr_max is set as well.
1854 #                                Defaults to 1. (Since 2.6)
1856 # @iops_size: an I/O size in bytes (Since 1.7)
1858 # @group: throttle group name (Since 2.4)
1860 # Since: 1.1
1862 { 'struct': 'BlockIOThrottle',
1863   'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
1864             'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
1865             '*bps_max': 'int', '*bps_rd_max': 'int',
1866             '*bps_wr_max': 'int', '*iops_max': 'int',
1867             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
1868             '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
1869             '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
1870             '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
1871             '*iops_size': 'int', '*group': 'str' } }
1874 # @block-stream:
1876 # Copy data from a backing file into a block device.
1878 # The block streaming operation is performed in the background until the entire
1879 # backing file has been copied.  This command returns immediately once streaming
1880 # has started.  The status of ongoing block streaming operations can be checked
1881 # with query-block-jobs.  The operation can be stopped before it has completed
1882 # using the block-job-cancel command.
1884 # The node that receives the data is called the top image, can be located in
1885 # any part of the chain (but always above the base image; see below) and can be
1886 # specified using its device or node name. Earlier qemu versions only allowed
1887 # 'device' to name the top level node; presence of the 'base-node' parameter
1888 # during introspection can be used as a witness of the enhanced semantics
1889 # of 'device'.
1891 # If a base file is specified then sectors are not copied from that base file and
1892 # its backing chain.  When streaming completes the image file will have the base
1893 # file as its backing file.  This can be used to stream a subset of the backing
1894 # file chain instead of flattening the entire image.
1896 # On successful completion the image file is updated to drop the backing file
1897 # and the BLOCK_JOB_COMPLETED event is emitted.
1899 # @job-id: identifier for the newly-created block job. If
1900 #          omitted, the device name will be used. (Since 2.7)
1902 # @device: the device or node name of the top image
1904 # @base:   the common backing file name.
1905 #                    It cannot be set if @base-node is also set.
1907 # @base-node: the node name of the backing file.
1908 #                       It cannot be set if @base is also set. (Since 2.8)
1910 # @backing-file: The backing file string to write into the top
1911 #                          image. This filename is not validated.
1913 #                          If a pathname string is such that it cannot be
1914 #                          resolved by QEMU, that means that subsequent QMP or
1915 #                          HMP commands must use node-names for the image in
1916 #                          question, as filename lookup methods will fail.
1918 #                          If not specified, QEMU will automatically determine
1919 #                          the backing file string to use, or error out if there
1920 #                          is no obvious choice.  Care should be taken when
1921 #                          specifying the string, to specify a valid filename or
1922 #                          protocol.
1923 #                          (Since 2.1)
1925 # @speed:  the maximum speed, in bytes per second
1927 # @on-error: the action to take on an error (default report).
1928 #            'stop' and 'enospc' can only be used if the block device
1929 #            supports io-status (see BlockInfo).  Since 1.3.
1931 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
1933 # Since: 1.1
1935 # Example:
1937 # -> { "execute": "block-stream",
1938 #      "arguments": { "device": "virtio0",
1939 #                     "base": "/tmp/master.qcow2" } }
1940 # <- { "return": {} }
1943 { 'command': 'block-stream',
1944   'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
1945             '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
1946             '*on-error': 'BlockdevOnError' } }
1949 # @block-job-set-speed:
1951 # Set maximum speed for a background block operation.
1953 # This command can only be issued when there is an active block job.
1955 # Throttling can be disabled by setting the speed to 0.
1957 # @device: The job identifier. This used to be a device name (hence
1958 #          the name of the parameter), but since QEMU 2.7 it can have
1959 #          other values.
1961 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
1962 #          Defaults to 0.
1964 # Returns: Nothing on success
1965 #          If no background operation is active on this device, DeviceNotActive
1967 # Since: 1.1
1969 { 'command': 'block-job-set-speed',
1970   'data': { 'device': 'str', 'speed': 'int' } }
1973 # @block-job-cancel:
1975 # Stop an active background block operation.
1977 # This command returns immediately after marking the active background block
1978 # operation for cancellation.  It is an error to call this command if no
1979 # operation is in progress.
1981 # The operation will cancel as soon as possible and then emit the
1982 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
1983 # enumerated using query-block-jobs.
1985 # For streaming, the image file retains its backing file unless the streaming
1986 # operation happens to complete just as it is being cancelled.  A new streaming
1987 # operation can be started at a later time to finish copying all data from the
1988 # backing file.
1990 # @device: The job identifier. This used to be a device name (hence
1991 #          the name of the parameter), but since QEMU 2.7 it can have
1992 #          other values.
1994 # @force: whether to allow cancellation of a paused job (default
1995 #         false).  Since 1.3.
1997 # Returns: Nothing on success
1998 #          If no background operation is active on this device, DeviceNotActive
2000 # Since: 1.1
2002 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2005 # @block-job-pause:
2007 # Pause an active background block operation.
2009 # This command returns immediately after marking the active background block
2010 # operation for pausing.  It is an error to call this command if no
2011 # operation is in progress.  Pausing an already paused job has no cumulative
2012 # effect; a single block-job-resume command will resume the job.
2014 # The operation will pause as soon as possible.  No event is emitted when
2015 # the operation is actually paused.  Cancelling a paused job automatically
2016 # resumes it.
2018 # @device: The job identifier. This used to be a device name (hence
2019 #          the name of the parameter), but since QEMU 2.7 it can have
2020 #          other values.
2022 # Returns: Nothing on success
2023 #          If no background operation is active on this device, DeviceNotActive
2025 # Since: 1.3
2027 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2030 # @block-job-resume:
2032 # Resume an active background block operation.
2034 # This command returns immediately after resuming a paused background block
2035 # operation.  It is an error to call this command if no operation is in
2036 # progress.  Resuming an already running job is not an error.
2038 # This command also clears the error status of the job.
2040 # @device: The job identifier. This used to be a device name (hence
2041 #          the name of the parameter), but since QEMU 2.7 it can have
2042 #          other values.
2044 # Returns: Nothing on success
2045 #          If no background operation is active on this device, DeviceNotActive
2047 # Since: 1.3
2049 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2052 # @block-job-complete:
2054 # Manually trigger completion of an active background block operation.  This
2055 # is supported for drive mirroring, where it also switches the device to
2056 # write to the target path only.  The ability to complete is signaled with
2057 # a BLOCK_JOB_READY event.
2059 # This command completes an active background block operation synchronously.
2060 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2061 # is not defined.  Note that if an I/O error occurs during the processing of
2062 # this command: 1) the command itself will fail; 2) the error will be processed
2063 # according to the rerror/werror arguments that were specified when starting
2064 # the operation.
2066 # A cancelled or paused job cannot be completed.
2068 # @device: The job identifier. This used to be a device name (hence
2069 #          the name of the parameter), but since QEMU 2.7 it can have
2070 #          other values.
2072 # Returns: Nothing on success
2073 #          If no background operation is active on this device, DeviceNotActive
2075 # Since: 1.3
2077 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2080 # @BlockdevDiscardOptions:
2082 # Determines how to handle discard requests.
2084 # @ignore:      Ignore the request
2085 # @unmap:       Forward as an unmap request
2087 # Since: 2.9
2089 { 'enum': 'BlockdevDiscardOptions',
2090   'data': [ 'ignore', 'unmap' ] }
2093 # @BlockdevDetectZeroesOptions:
2095 # Describes the operation mode for the automatic conversion of plain
2096 # zero writes by the OS to driver specific optimized zero write commands.
2098 # @off:      Disabled (default)
2099 # @on:       Enabled
2100 # @unmap:    Enabled and even try to unmap blocks if possible. This requires
2101 #            also that @BlockdevDiscardOptions is set to unmap for this device.
2103 # Since: 2.1
2105 { 'enum': 'BlockdevDetectZeroesOptions',
2106   'data': [ 'off', 'on', 'unmap' ] }
2109 # @BlockdevAioOptions:
2111 # Selects the AIO backend to handle I/O requests
2113 # @threads:     Use qemu's thread pool
2114 # @native:      Use native AIO backend (only Linux and Windows)
2116 # Since: 2.9
2118 { 'enum': 'BlockdevAioOptions',
2119   'data': [ 'threads', 'native' ] }
2122 # @BlockdevCacheOptions:
2124 # Includes cache-related options for block devices
2126 # @direct:      enables use of O_DIRECT (bypass the host page cache;
2127 #               default: false)
2128 # @no-flush:    ignore any flush requests for the device (default:
2129 #               false)
2131 # Since: 2.9
2133 { 'struct': 'BlockdevCacheOptions',
2134   'data': { '*direct': 'bool',
2135             '*no-flush': 'bool' } }
2138 # @BlockdevDriver:
2140 # Drivers that are supported in block device operations.
2142 # @vxhs: Since 2.10
2144 # Since: 2.9
2146 { 'enum': 'BlockdevDriver',
2147   'data': [ 'blkdebug', 'blkverify', 'bochs', 'cloop',
2148             'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
2149             'host_device', 'http', 'https', 'iscsi', 'luks', 'nbd', 'nfs',
2150             'null-aio', 'null-co', 'parallels', 'qcow', 'qcow2', 'qed',
2151             'quorum', 'raw', 'rbd', 'replication', 'sheepdog', 'ssh',
2152             'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2155 # @BlockdevOptionsFile:
2157 # Driver specific block device options for the file backend.
2159 # @filename:    path to the image file
2160 # @aio:         AIO backend (default: threads) (since: 2.8)
2161 # @locking:     whether to enable file locking. If set to 'auto', only enable
2162 #               when Open File Descriptor (OFD) locking API is available
2163 #               (default: auto, since 2.10)
2165 # Since: 2.9
2167 { 'struct': 'BlockdevOptionsFile',
2168   'data': { 'filename': 'str',
2169             '*locking': 'OnOffAuto',
2170             '*aio': 'BlockdevAioOptions' } }
2173 # @BlockdevOptionsNull:
2175 # Driver specific block device options for the null backend.
2177 # @size:    size of the device in bytes.
2178 # @latency-ns: emulated latency (in nanoseconds) in processing
2179 #              requests. Default to zero which completes requests immediately.
2180 #              (Since 2.4)
2182 # Since: 2.9
2184 { 'struct': 'BlockdevOptionsNull',
2185   'data': { '*size': 'int', '*latency-ns': 'uint64' } }
2188 # @BlockdevOptionsVVFAT:
2190 # Driver specific block device options for the vvfat protocol.
2192 # @dir:         directory to be exported as FAT image
2193 # @fat-type:    FAT type: 12, 16 or 32
2194 # @floppy:      whether to export a floppy image (true) or
2195 #               partitioned hard disk (false; default)
2196 # @label:       set the volume label, limited to 11 bytes. FAT16 and
2197 #               FAT32 traditionally have some restrictions on labels, which are
2198 #               ignored by most operating systems. Defaults to "QEMU VVFAT".
2199 #               (since 2.4)
2200 # @rw:          whether to allow write operations (default: false)
2202 # Since: 2.9
2204 { 'struct': 'BlockdevOptionsVVFAT',
2205   'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2206             '*label': 'str', '*rw': 'bool' } }
2209 # @BlockdevOptionsGenericFormat:
2211 # Driver specific block device options for image format that have no option
2212 # besides their data source.
2214 # @file:        reference to or definition of the data source block device
2216 # Since: 2.9
2218 { 'struct': 'BlockdevOptionsGenericFormat',
2219   'data': { 'file': 'BlockdevRef' } }
2222 # @BlockdevOptionsLUKS:
2224 # Driver specific block device options for LUKS.
2226 # @key-secret: the ID of a QCryptoSecret object providing
2227 #              the decryption key (since 2.6). Mandatory except when
2228 #              doing a metadata-only probe of the image.
2230 # Since: 2.9
2232 { 'struct': 'BlockdevOptionsLUKS',
2233   'base': 'BlockdevOptionsGenericFormat',
2234   'data': { '*key-secret': 'str' } }
2238 # @BlockdevOptionsGenericCOWFormat:
2240 # Driver specific block device options for image format that have no option
2241 # besides their data source and an optional backing file.
2243 # @backing:     reference to or definition of the backing file block
2244 #               device (if missing, taken from the image file content). It is
2245 #               allowed to pass an empty string here in order to disable the
2246 #               default backing file.
2248 # Since: 2.9
2250 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2251   'base': 'BlockdevOptionsGenericFormat',
2252   'data': { '*backing': 'BlockdevRef' } }
2255 # @Qcow2OverlapCheckMode:
2257 # General overlap check modes.
2259 # @none:        Do not perform any checks
2261 # @constant:    Perform only checks which can be done in constant time and
2262 #               without reading anything from disk
2264 # @cached:      Perform only checks which can be done without reading anything
2265 #               from disk
2267 # @all:         Perform all available overlap checks
2269 # Since: 2.9
2271 { 'enum': 'Qcow2OverlapCheckMode',
2272   'data': [ 'none', 'constant', 'cached', 'all' ] }
2275 # @Qcow2OverlapCheckFlags:
2277 # Structure of flags for each metadata structure. Setting a field to 'true'
2278 # makes qemu guard that structure against unintended overwriting. The default
2279 # value is chosen according to the template given.
2281 # @template: Specifies a template mode which can be adjusted using the other
2282 #            flags, defaults to 'cached'
2284 # Since: 2.9
2286 { 'struct': 'Qcow2OverlapCheckFlags',
2287   'data': { '*template':       'Qcow2OverlapCheckMode',
2288             '*main-header':    'bool',
2289             '*active-l1':      'bool',
2290             '*active-l2':      'bool',
2291             '*refcount-table': 'bool',
2292             '*refcount-block': 'bool',
2293             '*snapshot-table': 'bool',
2294             '*inactive-l1':    'bool',
2295             '*inactive-l2':    'bool' } }
2298 # @Qcow2OverlapChecks:
2300 # Specifies which metadata structures should be guarded against unintended
2301 # overwriting.
2303 # @flags:   set of flags for separate specification of each metadata structure
2304 #           type
2306 # @mode:    named mode which chooses a specific set of flags
2308 # Since: 2.9
2310 { 'alternate': 'Qcow2OverlapChecks',
2311   'data': { 'flags': 'Qcow2OverlapCheckFlags',
2312             'mode':  'Qcow2OverlapCheckMode' } }
2315 # @BlockdevQcowEncryptionFormat:
2317 # @aes: AES-CBC with plain64 initialization vectors
2319 # Since: 2.10
2321 { 'enum': 'BlockdevQcowEncryptionFormat',
2322   'data': [ 'aes' ] }
2325 # @BlockdevQcowEncryption:
2327 # Since: 2.10
2329 { 'union': 'BlockdevQcowEncryption',
2330   'base': { 'format': 'BlockdevQcowEncryptionFormat' },
2331   'discriminator': 'format',
2332   'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
2335 # @BlockdevOptionsQcow:
2337 # Driver specific block device options for qcow.
2339 # @encrypt:               Image decryption options. Mandatory for
2340 #                         encrypted images, except when doing a metadata-only
2341 #                         probe of the image.
2343 # Since: 2.10
2345 { 'struct': 'BlockdevOptionsQcow',
2346   'base': 'BlockdevOptionsGenericCOWFormat',
2347   'data': { '*encrypt': 'BlockdevQcowEncryption' } }
2352 # @BlockdevQcow2EncryptionFormat:
2353 # @aes: AES-CBC with plain64 initialization venctors
2355 # Since: 2.10
2357 { 'enum': 'BlockdevQcow2EncryptionFormat',
2358   'data': [ 'aes', 'luks' ] }
2361 # @BlockdevQcow2Encryption:
2363 # Since: 2.10
2365 { 'union': 'BlockdevQcow2Encryption',
2366   'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
2367   'discriminator': 'format',
2368   'data': { 'aes': 'QCryptoBlockOptionsQCow',
2369             'luks': 'QCryptoBlockOptionsLUKS'} }
2372 # @BlockdevOptionsQcow2:
2374 # Driver specific block device options for qcow2.
2376 # @lazy-refcounts:        whether to enable the lazy refcounts
2377 #                         feature (default is taken from the image file)
2379 # @pass-discard-request:  whether discard requests to the qcow2
2380 #                         device should be forwarded to the data source
2382 # @pass-discard-snapshot: whether discard requests for the data source
2383 #                         should be issued when a snapshot operation (e.g.
2384 #                         deleting a snapshot) frees clusters in the qcow2 file
2386 # @pass-discard-other:    whether discard requests for the data source
2387 #                         should be issued on other occasions where a cluster
2388 #                         gets freed
2390 # @overlap-check:         which overlap checks to perform for writes
2391 #                         to the image, defaults to 'cached' (since 2.2)
2393 # @cache-size:            the maximum total size of the L2 table and
2394 #                         refcount block caches in bytes (since 2.2)
2396 # @l2-cache-size:         the maximum size of the L2 table cache in
2397 #                         bytes (since 2.2)
2399 # @refcount-cache-size:   the maximum size of the refcount block cache
2400 #                         in bytes (since 2.2)
2402 # @cache-clean-interval:  clean unused entries in the L2 and refcount
2403 #                         caches. The interval is in seconds. The default value
2404 #                         is 0 and it disables this feature (since 2.5)
2405 # @encrypt:               Image decryption options. Mandatory for
2406 #                         encrypted images, except when doing a metadata-only
2407 #                         probe of the image. (since 2.10)
2409 # Since: 2.9
2411 { 'struct': 'BlockdevOptionsQcow2',
2412   'base': 'BlockdevOptionsGenericCOWFormat',
2413   'data': { '*lazy-refcounts': 'bool',
2414             '*pass-discard-request': 'bool',
2415             '*pass-discard-snapshot': 'bool',
2416             '*pass-discard-other': 'bool',
2417             '*overlap-check': 'Qcow2OverlapChecks',
2418             '*cache-size': 'int',
2419             '*l2-cache-size': 'int',
2420             '*refcount-cache-size': 'int',
2421             '*cache-clean-interval': 'int',
2422             '*encrypt': 'BlockdevQcow2Encryption' } }
2425 # @BlockdevOptionsSsh:
2427 # @server:              host address
2429 # @path:                path to the image on the host
2431 # @user:                user as which to connect, defaults to current
2432 #                       local user name
2434 # TODO: Expose the host_key_check option in QMP
2436 # Since: 2.9
2438 { 'struct': 'BlockdevOptionsSsh',
2439   'data': { 'server': 'InetSocketAddress',
2440             'path': 'str',
2441             '*user': 'str' } }
2445 # @BlkdebugEvent:
2447 # Trigger events supported by blkdebug.
2449 # Since: 2.9
2451 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
2452   'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
2453             'l1_grow_activate_table', 'l2_load', 'l2_update',
2454             'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
2455             'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
2456             'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
2457             'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
2458             'refblock_load', 'refblock_update', 'refblock_update_part',
2459             'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
2460             'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
2461             'refblock_alloc_switch_table', 'cluster_alloc',
2462             'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
2463             'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
2464             'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
2465             'pwritev_zero', 'pwritev_done', 'empty_image_prepare' ] }
2468 # @BlkdebugInjectErrorOptions:
2470 # Describes a single error injection for blkdebug.
2472 # @event:       trigger event
2474 # @state:       the state identifier blkdebug needs to be in to
2475 #               actually trigger the event; defaults to "any"
2477 # @errno:       error identifier (errno) to be returned; defaults to
2478 #               EIO
2480 # @sector:      specifies the sector index which has to be affected
2481 #               in order to actually trigger the event; defaults to "any
2482 #               sector"
2484 # @once:        disables further events after this one has been
2485 #               triggered; defaults to false
2487 # @immediately: fail immediately; defaults to false
2489 # Since: 2.9
2491 { 'struct': 'BlkdebugInjectErrorOptions',
2492   'data': { 'event': 'BlkdebugEvent',
2493             '*state': 'int',
2494             '*errno': 'int',
2495             '*sector': 'int',
2496             '*once': 'bool',
2497             '*immediately': 'bool' } }
2500 # @BlkdebugSetStateOptions:
2502 # Describes a single state-change event for blkdebug.
2504 # @event:       trigger event
2506 # @state:       the current state identifier blkdebug needs to be in;
2507 #               defaults to "any"
2509 # @new_state:   the state identifier blkdebug is supposed to assume if
2510 #               this event is triggered
2512 # Since: 2.9
2514 { 'struct': 'BlkdebugSetStateOptions',
2515   'data': { 'event': 'BlkdebugEvent',
2516             '*state': 'int',
2517             'new_state': 'int' } }
2520 # @BlockdevOptionsBlkdebug:
2522 # Driver specific block device options for blkdebug.
2524 # @image:           underlying raw block device (or image file)
2526 # @config:          filename of the configuration file
2528 # @align:           required alignment for requests in bytes, must be
2529 #                   positive power of 2, or 0 for default
2531 # @max-transfer:    maximum size for I/O transfers in bytes, must be
2532 #                   positive multiple of @align and of the underlying
2533 #                   file's request alignment (but need not be a power of
2534 #                   2), or 0 for default (since 2.10)
2536 # @opt-write-zero:  preferred alignment for write zero requests in bytes,
2537 #                   must be positive multiple of @align and of the
2538 #                   underlying file's request alignment (but need not be a
2539 #                   power of 2), or 0 for default (since 2.10)
2541 # @max-write-zero:  maximum size for write zero requests in bytes, must be
2542 #                   positive multiple of @align, of @opt-write-zero, and of
2543 #                   the underlying file's request alignment (but need not
2544 #                   be a power of 2), or 0 for default (since 2.10)
2546 # @opt-discard:     preferred alignment for discard requests in bytes, must
2547 #                   be positive multiple of @align and of the underlying
2548 #                   file's request alignment (but need not be a power of
2549 #                   2), or 0 for default (since 2.10)
2551 # @max-discard:     maximum size for discard requests in bytes, must be
2552 #                   positive multiple of @align, of @opt-discard, and of
2553 #                   the underlying file's request alignment (but need not
2554 #                   be a power of 2), or 0 for default (since 2.10)
2556 # @inject-error:    array of error injection descriptions
2558 # @set-state:       array of state-change descriptions
2560 # Since: 2.9
2562 { 'struct': 'BlockdevOptionsBlkdebug',
2563   'data': { 'image': 'BlockdevRef',
2564             '*config': 'str',
2565             '*align': 'int', '*max-transfer': 'int32',
2566             '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
2567             '*opt-discard': 'int32', '*max-discard': 'int32',
2568             '*inject-error': ['BlkdebugInjectErrorOptions'],
2569             '*set-state': ['BlkdebugSetStateOptions'] } }
2572 # @BlockdevOptionsBlkverify:
2574 # Driver specific block device options for blkverify.
2576 # @test:    block device to be tested
2578 # @raw:     raw image used for verification
2580 # Since: 2.9
2582 { 'struct': 'BlockdevOptionsBlkverify',
2583   'data': { 'test': 'BlockdevRef',
2584             'raw': 'BlockdevRef' } }
2587 # @QuorumReadPattern:
2589 # An enumeration of quorum read patterns.
2591 # @quorum: read all the children and do a quorum vote on reads
2593 # @fifo: read only from the first child that has not failed
2595 # Since: 2.9
2597 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
2600 # @BlockdevOptionsQuorum:
2602 # Driver specific block device options for Quorum
2604 # @blkverify:      true if the driver must print content mismatch
2605 #                  set to false by default
2607 # @children:       the children block devices to use
2609 # @vote-threshold: the vote limit under which a read will fail
2611 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
2612 #                     (Since 2.1)
2614 # @read-pattern: choose read pattern and set to quorum by default
2615 #                (Since 2.2)
2617 # Since: 2.9
2619 { 'struct': 'BlockdevOptionsQuorum',
2620   'data': { '*blkverify': 'bool',
2621             'children': [ 'BlockdevRef' ],
2622             'vote-threshold': 'int',
2623             '*rewrite-corrupted': 'bool',
2624             '*read-pattern': 'QuorumReadPattern' } }
2627 # @BlockdevOptionsGluster:
2629 # Driver specific block device options for Gluster
2631 # @volume:      name of gluster volume where VM image resides
2633 # @path:        absolute path to image file in gluster volume
2635 # @server:      gluster servers description
2637 # @debug:       libgfapi log level (default '4' which is Error)
2638 #               (Since 2.8)
2640 # @logfile:     libgfapi log file (default /dev/stderr) (Since 2.8)
2642 # Since: 2.9
2644 { 'struct': 'BlockdevOptionsGluster',
2645   'data': { 'volume': 'str',
2646             'path': 'str',
2647             'server': ['SocketAddress'],
2648             '*debug': 'int',
2649             '*logfile': 'str' } }
2652 # @IscsiTransport:
2654 # An enumeration of libiscsi transport types
2656 # Since: 2.9
2658 { 'enum': 'IscsiTransport',
2659   'data': [ 'tcp', 'iser' ] }
2662 # @IscsiHeaderDigest:
2664 # An enumeration of header digests supported by libiscsi
2666 # Since: 2.9
2668 { 'enum': 'IscsiHeaderDigest',
2669   'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
2670   'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
2673 # @BlockdevOptionsIscsi:
2675 # @transport:       The iscsi transport type
2677 # @portal:          The address of the iscsi portal
2679 # @target:          The target iqn name
2681 # @lun:             LUN to connect to. Defaults to 0.
2683 # @user:            User name to log in with. If omitted, no CHAP
2684 #                   authentication is performed.
2686 # @password-secret: The ID of a QCryptoSecret object providing
2687 #                   the password for the login. This option is required if
2688 #                   @user is specified.
2690 # @initiator-name:  The iqn name we want to identify to the target
2691 #                   as. If this option is not specified, an initiator name is
2692 #                   generated automatically.
2694 # @header-digest:   The desired header digest. Defaults to
2695 #                   none-crc32c.
2697 # @timeout:         Timeout in seconds after which a request will
2698 #                   timeout. 0 means no timeout and is the default.
2700 # Driver specific block device options for iscsi
2702 # Since: 2.9
2704 { 'struct': 'BlockdevOptionsIscsi',
2705   'data': { 'transport': 'IscsiTransport',
2706             'portal': 'str',
2707             'target': 'str',
2708             '*lun': 'int',
2709             '*user': 'str',
2710             '*password-secret': 'str',
2711             '*initiator-name': 'str',
2712             '*header-digest': 'IscsiHeaderDigest',
2713             '*timeout': 'int' } }
2717 # @BlockdevOptionsRbd:
2719 # @pool:               Ceph pool name.
2721 # @image:              Image name in the Ceph pool.
2723 # @conf:               path to Ceph configuration file.  Values
2724 #                      in the configuration file will be overridden by
2725 #                      options specified via QAPI.
2727 # @snapshot:           Ceph snapshot name.
2729 # @user:               Ceph id name.
2731 # @server:             Monitor host address and port.  This maps
2732 #                      to the "mon_host" Ceph option.
2734 # Since: 2.9
2736 { 'struct': 'BlockdevOptionsRbd',
2737   'data': { 'pool': 'str',
2738             'image': 'str',
2739             '*conf': 'str',
2740             '*snapshot': 'str',
2741             '*user': 'str',
2742             '*server': ['InetSocketAddressBase'] } }
2745 # @BlockdevOptionsSheepdog:
2747 # Driver specific block device options for sheepdog
2749 # @vdi:         Virtual disk image name
2750 # @server:      The Sheepdog server to connect to
2751 # @snap-id:     Snapshot ID
2752 # @tag:         Snapshot tag name
2754 # Only one of @snap-id and @tag may be present.
2756 # Since: 2.9
2758 { 'struct': 'BlockdevOptionsSheepdog',
2759   'data': { 'server': 'SocketAddress',
2760             'vdi': 'str',
2761             '*snap-id': 'uint32',
2762             '*tag': 'str' } }
2765 # @ReplicationMode:
2767 # An enumeration of replication modes.
2769 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
2771 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
2773 # Since: 2.9
2775 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
2778 # @BlockdevOptionsReplication:
2780 # Driver specific block device options for replication
2782 # @mode: the replication mode
2784 # @top-id: In secondary mode, node name or device ID of the root
2785 #          node who owns the replication node chain. Must not be given in
2786 #          primary mode.
2788 # Since: 2.9
2790 { 'struct': 'BlockdevOptionsReplication',
2791   'base': 'BlockdevOptionsGenericFormat',
2792   'data': { 'mode': 'ReplicationMode',
2793             '*top-id': 'str' } }
2796 # @NFSTransport:
2798 # An enumeration of NFS transport types
2800 # @inet:        TCP transport
2802 # Since: 2.9
2804 { 'enum': 'NFSTransport',
2805   'data': [ 'inet' ] }
2808 # @NFSServer:
2810 # Captures the address of the socket
2812 # @type:        transport type used for NFS (only TCP supported)
2814 # @host:        host address for NFS server
2816 # Since: 2.9
2818 { 'struct': 'NFSServer',
2819   'data': { 'type': 'NFSTransport',
2820             'host': 'str' } }
2823 # @BlockdevOptionsNfs:
2825 # Driver specific block device option for NFS
2827 # @server:                  host address
2829 # @path:                    path of the image on the host
2831 # @user:                    UID value to use when talking to the
2832 #                           server (defaults to 65534 on Windows and getuid()
2833 #                           on unix)
2835 # @group:                   GID value to use when talking to the
2836 #                           server (defaults to 65534 on Windows and getgid()
2837 #                           in unix)
2839 # @tcp-syn-count:           number of SYNs during the session
2840 #                           establishment (defaults to libnfs default)
2842 # @readahead-size:          set the readahead size in bytes (defaults
2843 #                           to libnfs default)
2845 # @page-cache-size:         set the pagecache size in bytes (defaults
2846 #                           to libnfs default)
2848 # @debug:                   set the NFS debug level (max 2) (defaults
2849 #                           to libnfs default)
2851 # Since: 2.9
2853 { 'struct': 'BlockdevOptionsNfs',
2854   'data': { 'server': 'NFSServer',
2855             'path': 'str',
2856             '*user': 'int',
2857             '*group': 'int',
2858             '*tcp-syn-count': 'int',
2859             '*readahead-size': 'int',
2860             '*page-cache-size': 'int',
2861             '*debug': 'int' } }
2864 # @BlockdevOptionsCurlBase:
2866 # Driver specific block device options shared by all protocols supported by the
2867 # curl backend.
2869 # @url:                     URL of the image file
2871 # @readahead:               Size of the read-ahead cache; must be a multiple of
2872 #                           512 (defaults to 256 kB)
2874 # @timeout:                 Timeout for connections, in seconds (defaults to 5)
2876 # @username:                Username for authentication (defaults to none)
2878 # @password-secret:         ID of a QCryptoSecret object providing a password
2879 #                           for authentication (defaults to no password)
2881 # @proxy-username:          Username for proxy authentication (defaults to none)
2883 # @proxy-password-secret:   ID of a QCryptoSecret object providing a password
2884 #                           for proxy authentication (defaults to no password)
2886 # Since: 2.9
2888 { 'struct': 'BlockdevOptionsCurlBase',
2889   'data': { 'url': 'str',
2890             '*readahead': 'int',
2891             '*timeout': 'int',
2892             '*username': 'str',
2893             '*password-secret': 'str',
2894             '*proxy-username': 'str',
2895             '*proxy-password-secret': 'str' } }
2898 # @BlockdevOptionsCurlHttp:
2900 # Driver specific block device options for HTTP connections over the curl
2901 # backend.  URLs must start with "http://".
2903 # @cookie:      List of cookies to set; format is
2904 #               "name1=content1; name2=content2;" as explained by
2905 #               CURLOPT_COOKIE(3). Defaults to no cookies.
2907 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
2908 #                 secure way. See @cookie for the format. (since 2.10)
2910 # Since: 2.9
2912 { 'struct': 'BlockdevOptionsCurlHttp',
2913   'base': 'BlockdevOptionsCurlBase',
2914   'data': { '*cookie': 'str',
2915             '*cookie-secret': 'str'} }
2918 # @BlockdevOptionsCurlHttps:
2920 # Driver specific block device options for HTTPS connections over the curl
2921 # backend.  URLs must start with "https://".
2923 # @cookie:      List of cookies to set; format is
2924 #               "name1=content1; name2=content2;" as explained by
2925 #               CURLOPT_COOKIE(3). Defaults to no cookies.
2927 # @sslverify:   Whether to verify the SSL certificate's validity (defaults to
2928 #               true)
2930 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
2931 #                 secure way. See @cookie for the format. (since 2.10)
2933 # Since: 2.9
2935 { 'struct': 'BlockdevOptionsCurlHttps',
2936   'base': 'BlockdevOptionsCurlBase',
2937   'data': { '*cookie': 'str',
2938             '*sslverify': 'bool',
2939             '*cookie-secret': 'str'} }
2942 # @BlockdevOptionsCurlFtp:
2944 # Driver specific block device options for FTP connections over the curl
2945 # backend.  URLs must start with "ftp://".
2947 # Since: 2.9
2949 { 'struct': 'BlockdevOptionsCurlFtp',
2950   'base': 'BlockdevOptionsCurlBase',
2951   'data': { } }
2954 # @BlockdevOptionsCurlFtps:
2956 # Driver specific block device options for FTPS connections over the curl
2957 # backend.  URLs must start with "ftps://".
2959 # @sslverify:   Whether to verify the SSL certificate's validity (defaults to
2960 #               true)
2962 # Since: 2.9
2964 { 'struct': 'BlockdevOptionsCurlFtps',
2965   'base': 'BlockdevOptionsCurlBase',
2966   'data': { '*sslverify': 'bool' } }
2969 # @BlockdevOptionsNbd:
2971 # Driver specific block device options for NBD.
2973 # @server:      NBD server address
2975 # @export:      export name
2977 # @tls-creds:   TLS credentials ID
2979 # Since: 2.9
2981 { 'struct': 'BlockdevOptionsNbd',
2982   'data': { 'server': 'SocketAddress',
2983             '*export': 'str',
2984             '*tls-creds': 'str' } }
2987 # @BlockdevOptionsRaw:
2989 # Driver specific block device options for the raw driver.
2991 # @offset:      position where the block device starts
2992 # @size:        the assumed size of the device
2994 # Since: 2.9
2996 { 'struct': 'BlockdevOptionsRaw',
2997   'base': 'BlockdevOptionsGenericFormat',
2998   'data': { '*offset': 'int', '*size': 'int' } }
3001 # @BlockdevOptionsVxHS:
3003 # Driver specific block device options for VxHS
3005 # @vdisk-id:    UUID of VxHS volume
3006 # @server:      vxhs server IP, port
3007 # @tls-creds:   TLS credentials ID
3009 # Since: 2.10
3011 { 'struct': 'BlockdevOptionsVxHS',
3012   'data': { 'vdisk-id': 'str',
3013             'server': 'InetSocketAddressBase',
3014             '*tls-creds': 'str' } }
3017 # @BlockdevOptions:
3019 # Options for creating a block device.  Many options are available for all
3020 # block devices, independent of the block driver:
3022 # @driver:        block driver name
3023 # @node-name:     the node name of the new node (Since 2.0).
3024 #                 This option is required on the top level of blockdev-add.
3025 # @discard:       discard-related options (default: ignore)
3026 # @cache:         cache-related options
3027 # @read-only:     whether the block device should be read-only
3028 #                 (default: false)
3029 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3030 #                 (default: off)
3031 # @force-share:   force share all permission on added nodes.
3032 #                 Requires read-only=true. (Since 2.10)
3034 # Remaining options are determined by the block driver.
3036 # Since: 2.9
3038 { 'union': 'BlockdevOptions',
3039   'base': { 'driver': 'BlockdevDriver',
3040             '*node-name': 'str',
3041             '*discard': 'BlockdevDiscardOptions',
3042             '*cache': 'BlockdevCacheOptions',
3043             '*read-only': 'bool',
3044             '*force-share': 'bool',
3045             '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3046   'discriminator': 'driver',
3047   'data': {
3048       'blkdebug':   'BlockdevOptionsBlkdebug',
3049       'blkverify':  'BlockdevOptionsBlkverify',
3050       'bochs':      'BlockdevOptionsGenericFormat',
3051       'cloop':      'BlockdevOptionsGenericFormat',
3052       'dmg':        'BlockdevOptionsGenericFormat',
3053       'file':       'BlockdevOptionsFile',
3054       'ftp':        'BlockdevOptionsCurlFtp',
3055       'ftps':       'BlockdevOptionsCurlFtps',
3056       'gluster':    'BlockdevOptionsGluster',
3057       'host_cdrom': 'BlockdevOptionsFile',
3058       'host_device':'BlockdevOptionsFile',
3059       'http':       'BlockdevOptionsCurlHttp',
3060       'https':      'BlockdevOptionsCurlHttps',
3061       'iscsi':      'BlockdevOptionsIscsi',
3062       'luks':       'BlockdevOptionsLUKS',
3063       'nbd':        'BlockdevOptionsNbd',
3064       'nfs':        'BlockdevOptionsNfs',
3065       'null-aio':   'BlockdevOptionsNull',
3066       'null-co':    'BlockdevOptionsNull',
3067       'parallels':  'BlockdevOptionsGenericFormat',
3068       'qcow2':      'BlockdevOptionsQcow2',
3069       'qcow':       'BlockdevOptionsQcow',
3070       'qed':        'BlockdevOptionsGenericCOWFormat',
3071       'quorum':     'BlockdevOptionsQuorum',
3072       'raw':        'BlockdevOptionsRaw',
3073       'rbd':        'BlockdevOptionsRbd',
3074       'replication':'BlockdevOptionsReplication',
3075       'sheepdog':   'BlockdevOptionsSheepdog',
3076       'ssh':        'BlockdevOptionsSsh',
3077       'vdi':        'BlockdevOptionsGenericFormat',
3078       'vhdx':       'BlockdevOptionsGenericFormat',
3079       'vmdk':       'BlockdevOptionsGenericCOWFormat',
3080       'vpc':        'BlockdevOptionsGenericFormat',
3081       'vvfat':      'BlockdevOptionsVVFAT',
3082       'vxhs':       'BlockdevOptionsVxHS'
3083   } }
3086 # @BlockdevRef:
3088 # Reference to a block device.
3090 # @definition:      defines a new block device inline
3091 # @reference:       references the ID of an existing block device. An
3092 #                   empty string means that no block device should be
3093 #                   referenced.
3095 # Since: 2.9
3097 { 'alternate': 'BlockdevRef',
3098   'data': { 'definition': 'BlockdevOptions',
3099             'reference': 'str' } }
3102 # @blockdev-add:
3104 # Creates a new block device. If the @id option is given at the top level, a
3105 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
3106 # level and no BlockBackend will be created.
3108 # Since: 2.9
3110 # Example:
3112 # 1.
3113 # -> { "execute": "blockdev-add",
3114 #      "arguments": {
3115 #           "driver": "qcow2",
3116 #           "node-name": "test1",
3117 #           "file": {
3118 #               "driver": "file",
3119 #               "filename": "test.qcow2"
3120 #            }
3121 #       }
3122 #     }
3123 # <- { "return": {} }
3125 # 2.
3126 # -> { "execute": "blockdev-add",
3127 #      "arguments": {
3128 #           "driver": "qcow2",
3129 #           "node-name": "node0",
3130 #           "discard": "unmap",
3131 #           "cache": {
3132 #              "direct": true
3133 #            },
3134 #            "file": {
3135 #              "driver": "file",
3136 #              "filename": "/tmp/test.qcow2"
3137 #            },
3138 #            "backing": {
3139 #               "driver": "raw",
3140 #               "file": {
3141 #                  "driver": "file",
3142 #                  "filename": "/dev/fdset/4"
3143 #                }
3144 #            }
3145 #        }
3146 #      }
3148 # <- { "return": {} }
3151 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
3154 # @blockdev-del:
3156 # Deletes a block device that has been added using blockdev-add.
3157 # The command will fail if the node is attached to a device or is
3158 # otherwise being used.
3160 # @node-name: Name of the graph node to delete.
3162 # Since: 2.9
3164 # Example:
3166 # -> { "execute": "blockdev-add",
3167 #      "arguments": {
3168 #           "driver": "qcow2",
3169 #           "node-name": "node0",
3170 #           "file": {
3171 #               "driver": "file",
3172 #               "filename": "test.qcow2"
3173 #           }
3174 #      }
3175 #    }
3176 # <- { "return": {} }
3178 # -> { "execute": "blockdev-del",
3179 #      "arguments": { "node-name": "node0" }
3180 #    }
3181 # <- { "return": {} }
3184 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
3187 # @blockdev-open-tray:
3189 # Opens a block device's tray. If there is a block driver state tree inserted as
3190 # a medium, it will become inaccessible to the guest (but it will remain
3191 # associated to the block device, so closing the tray will make it accessible
3192 # again).
3194 # If the tray was already open before, this will be a no-op.
3196 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
3197 # which no such event will be generated, these include:
3198 # - if the guest has locked the tray, @force is false and the guest does not
3199 #   respond to the eject request
3200 # - if the BlockBackend denoted by @device does not have a guest device attached
3201 #   to it
3202 # - if the guest device does not have an actual tray
3204 # @device: Block device name (deprecated, use @id instead)
3206 # @id:     The name or QOM path of the guest device (since: 2.8)
3208 # @force:  if false (the default), an eject request will be sent to
3209 #          the guest if it has locked the tray (and the tray will not be opened
3210 #          immediately); if true, the tray will be opened regardless of whether
3211 #          it is locked
3213 # Since: 2.5
3215 # Example:
3217 # -> { "execute": "blockdev-open-tray",
3218 #      "arguments": { "id": "ide0-1-0" } }
3220 # <- { "timestamp": { "seconds": 1418751016,
3221 #                     "microseconds": 716996 },
3222 #      "event": "DEVICE_TRAY_MOVED",
3223 #      "data": { "device": "ide1-cd0",
3224 #                "id": "ide0-1-0",
3225 #                "tray-open": true } }
3227 # <- { "return": {} }
3230 { 'command': 'blockdev-open-tray',
3231   'data': { '*device': 'str',
3232             '*id': 'str',
3233             '*force': 'bool' } }
3236 # @blockdev-close-tray:
3238 # Closes a block device's tray. If there is a block driver state tree associated
3239 # with the block device (which is currently ejected), that tree will be loaded
3240 # as the medium.
3242 # If the tray was already closed before, this will be a no-op.
3244 # @device:  Block device name (deprecated, use @id instead)
3246 # @id:      The name or QOM path of the guest device (since: 2.8)
3248 # Since: 2.5
3250 # Example:
3252 # -> { "execute": "blockdev-close-tray",
3253 #      "arguments": { "id": "ide0-1-0" } }
3255 # <- { "timestamp": { "seconds": 1418751345,
3256 #                     "microseconds": 272147 },
3257 #      "event": "DEVICE_TRAY_MOVED",
3258 #      "data": { "device": "ide1-cd0",
3259 #                "id": "ide0-1-0",
3260 #                "tray-open": false } }
3262 # <- { "return": {} }
3265 { 'command': 'blockdev-close-tray',
3266   'data': { '*device': 'str',
3267             '*id': 'str' } }
3270 # @x-blockdev-remove-medium:
3272 # Removes a medium (a block driver state tree) from a block device. That block
3273 # device's tray must currently be open (unless there is no attached guest
3274 # device).
3276 # If the tray is open and there is no medium inserted, this will be a no-op.
3278 # @device: Block device name (deprecated, use @id instead)
3280 # @id:     The name or QOM path of the guest device (since: 2.8)
3282 # Note: This command is still a work in progress and is considered experimental.
3283 # Stay away from it unless you want to help with its development.
3285 # Since: 2.5
3287 # Example:
3289 # -> { "execute": "x-blockdev-remove-medium",
3290 #      "arguments": { "id": "ide0-1-0" } }
3292 # <- { "error": { "class": "GenericError",
3293 #                 "desc": "Tray of device 'ide0-1-0' is not open" } }
3295 # -> { "execute": "blockdev-open-tray",
3296 #      "arguments": { "id": "ide0-1-0" } }
3298 # <- { "timestamp": { "seconds": 1418751627,
3299 #                     "microseconds": 549958 },
3300 #      "event": "DEVICE_TRAY_MOVED",
3301 #      "data": { "device": "ide1-cd0",
3302 #                "id": "ide0-1-0",
3303 #                "tray-open": true } }
3305 # <- { "return": {} }
3307 # -> { "execute": "x-blockdev-remove-medium",
3308 #      "arguments": { "id": "ide0-1-0" } }
3310 # <- { "return": {} }
3313 { 'command': 'x-blockdev-remove-medium',
3314   'data': { '*device': 'str',
3315             '*id': 'str' } }
3318 # @x-blockdev-insert-medium:
3320 # Inserts a medium (a block driver state tree) into a block device. That block
3321 # device's tray must currently be open (unless there is no attached guest
3322 # device) and there must be no medium inserted already.
3324 # @device:    Block device name (deprecated, use @id instead)
3326 # @id:        The name or QOM path of the guest device (since: 2.8)
3328 # @node-name: name of a node in the block driver state graph
3330 # Note: This command is still a work in progress and is considered experimental.
3331 # Stay away from it unless you want to help with its development.
3333 # Since: 2.5
3335 # Example:
3337 # -> { "execute": "blockdev-add",
3338 #      "arguments": {
3339 #          "node-name": "node0",
3340 #          "driver": "raw",
3341 #          "file": { "driver": "file",
3342 #                    "filename": "fedora.iso" } } }
3343 # <- { "return": {} }
3345 # -> { "execute": "x-blockdev-insert-medium",
3346 #      "arguments": { "id": "ide0-1-0",
3347 #                     "node-name": "node0" } }
3349 # <- { "return": {} }
3352 { 'command': 'x-blockdev-insert-medium',
3353   'data': { '*device': 'str',
3354             '*id': 'str',
3355             'node-name': 'str'} }
3359 # @BlockdevChangeReadOnlyMode:
3361 # Specifies the new read-only mode of a block device subject to the
3362 # @blockdev-change-medium command.
3364 # @retain:      Retains the current read-only mode
3366 # @read-only:   Makes the device read-only
3368 # @read-write:  Makes the device writable
3370 # Since: 2.3
3373 { 'enum': 'BlockdevChangeReadOnlyMode',
3374   'data': ['retain', 'read-only', 'read-write'] }
3378 # @blockdev-change-medium:
3380 # Changes the medium inserted into a block device by ejecting the current medium
3381 # and loading a new image file which is inserted as the new medium (this command
3382 # combines blockdev-open-tray, x-blockdev-remove-medium,
3383 # x-blockdev-insert-medium and blockdev-close-tray).
3385 # @device:          Block device name (deprecated, use @id instead)
3387 # @id:              The name or QOM path of the guest device
3388 #                   (since: 2.8)
3390 # @filename:        filename of the new image to be loaded
3392 # @format:          format to open the new image with (defaults to
3393 #                   the probed format)
3395 # @read-only-mode:  change the read-only mode of the device; defaults
3396 #                   to 'retain'
3398 # Since: 2.5
3400 # Examples:
3402 # 1. Change a removable medium
3404 # -> { "execute": "blockdev-change-medium",
3405 #      "arguments": { "id": "ide0-1-0",
3406 #                     "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
3407 #                     "format": "raw" } }
3408 # <- { "return": {} }
3410 # 2. Load a read-only medium into a writable drive
3412 # -> { "execute": "blockdev-change-medium",
3413 #      "arguments": { "id": "floppyA",
3414 #                     "filename": "/srv/images/ro.img",
3415 #                     "format": "raw",
3416 #                     "read-only-mode": "retain" } }
3418 # <- { "error":
3419 #      { "class": "GenericError",
3420 #        "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
3422 # -> { "execute": "blockdev-change-medium",
3423 #      "arguments": { "id": "floppyA",
3424 #                     "filename": "/srv/images/ro.img",
3425 #                     "format": "raw",
3426 #                     "read-only-mode": "read-only" } }
3428 # <- { "return": {} }
3431 { 'command': 'blockdev-change-medium',
3432   'data': { '*device': 'str',
3433             '*id': 'str',
3434             'filename': 'str',
3435             '*format': 'str',
3436             '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
3440 # @BlockErrorAction:
3442 # An enumeration of action that has been taken when a DISK I/O occurs
3444 # @ignore: error has been ignored
3446 # @report: error has been reported to the device
3448 # @stop: error caused VM to be stopped
3450 # Since: 2.1
3452 { 'enum': 'BlockErrorAction',
3453   'data': [ 'ignore', 'report', 'stop' ] }
3457 # @BLOCK_IMAGE_CORRUPTED:
3459 # Emitted when a disk image is being marked corrupt. The image can be
3460 # identified by its device or node name. The 'device' field is always
3461 # present for compatibility reasons, but it can be empty ("") if the
3462 # image does not have a device name associated.
3464 # @device: device name. This is always present for compatibility
3465 #          reasons, but it can be empty ("") if the image does not
3466 #          have a device name associated.
3468 # @node-name: node name (Since: 2.4)
3470 # @msg: informative message for human consumption, such as the kind of
3471 #       corruption being detected. It should not be parsed by machine as it is
3472 #       not guaranteed to be stable
3474 # @offset: if the corruption resulted from an image access, this is
3475 #          the host's access offset into the image
3477 # @size: if the corruption resulted from an image access, this is
3478 #        the access size
3480 # @fatal: if set, the image is marked corrupt and therefore unusable after this
3481 #        event and must be repaired (Since 2.2; before, every
3482 #        BLOCK_IMAGE_CORRUPTED event was fatal)
3484 # Note: If action is "stop", a STOP event will eventually follow the
3485 #       BLOCK_IO_ERROR event.
3487 # Example:
3489 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
3490 #      "data": { "device": "ide0-hd0", "node-name": "node0",
3491 #                "msg": "Prevented active L1 table overwrite", "offset": 196608,
3492 #                "size": 65536 },
3493 #      "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
3495 # Since: 1.7
3497 { 'event': 'BLOCK_IMAGE_CORRUPTED',
3498   'data': { 'device'     : 'str',
3499             '*node-name' : 'str',
3500             'msg'        : 'str',
3501             '*offset'    : 'int',
3502             '*size'      : 'int',
3503             'fatal'      : 'bool' } }
3506 # @BLOCK_IO_ERROR:
3508 # Emitted when a disk I/O error occurs
3510 # @device: device name. This is always present for compatibility
3511 #          reasons, but it can be empty ("") if the image does not
3512 #          have a device name associated.
3514 # @node-name: node name. Note that errors may be reported for the root node
3515 #             that is directly attached to a guest device rather than for the
3516 #             node where the error occurred. (Since: 2.8)
3518 # @operation: I/O operation
3520 # @action: action that has been taken
3522 # @nospace: true if I/O error was caused due to a no-space
3523 #           condition. This key is only present if query-block's
3524 #           io-status is present, please see query-block documentation
3525 #           for more information (since: 2.2)
3527 # @reason: human readable string describing the error cause.
3528 #          (This field is a debugging aid for humans, it should not
3529 #           be parsed by applications) (since: 2.2)
3531 # Note: If action is "stop", a STOP event will eventually follow the
3532 # BLOCK_IO_ERROR event
3534 # Since: 0.13.0
3536 # Example:
3538 # <- { "event": "BLOCK_IO_ERROR",
3539 #      "data": { "device": "ide0-hd1",
3540 #                "node-name": "#block212",
3541 #                "operation": "write",
3542 #                "action": "stop" },
3543 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3546 { 'event': 'BLOCK_IO_ERROR',
3547   'data': { 'device': 'str', 'node-name': 'str', 'operation': 'IoOperationType',
3548             'action': 'BlockErrorAction', '*nospace': 'bool',
3549             'reason': 'str' } }
3552 # @BLOCK_JOB_COMPLETED:
3554 # Emitted when a block job has completed
3556 # @type: job type
3558 # @device: The job identifier. Originally the device name but other
3559 #          values are allowed since QEMU 2.7
3561 # @len: maximum progress value
3563 # @offset: current progress value. On success this is equal to len.
3564 #          On failure this is less than len
3566 # @speed: rate limit, bytes per second
3568 # @error: error message. Only present on failure. This field
3569 #         contains a human-readable error message. There are no semantics
3570 #         other than that streaming has failed and clients should not try to
3571 #         interpret the error string
3573 # Since: 1.1
3575 # Example:
3577 # <- { "event": "BLOCK_JOB_COMPLETED",
3578 #      "data": { "type": "stream", "device": "virtio-disk0",
3579 #                "len": 10737418240, "offset": 10737418240,
3580 #                "speed": 0 },
3581 #      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
3584 { 'event': 'BLOCK_JOB_COMPLETED',
3585   'data': { 'type'  : 'BlockJobType',
3586             'device': 'str',
3587             'len'   : 'int',
3588             'offset': 'int',
3589             'speed' : 'int',
3590             '*error': 'str' } }
3593 # @BLOCK_JOB_CANCELLED:
3595 # Emitted when a block job has been cancelled
3597 # @type: job type
3599 # @device: The job identifier. Originally the device name but other
3600 #          values are allowed since QEMU 2.7
3602 # @len: maximum progress value
3604 # @offset: current progress value. On success this is equal to len.
3605 #          On failure this is less than len
3607 # @speed: rate limit, bytes per second
3609 # Since: 1.1
3611 # Example:
3613 # <- { "event": "BLOCK_JOB_CANCELLED",
3614 #      "data": { "type": "stream", "device": "virtio-disk0",
3615 #                "len": 10737418240, "offset": 134217728,
3616 #                "speed": 0 },
3617 #      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
3620 { 'event': 'BLOCK_JOB_CANCELLED',
3621   'data': { 'type'  : 'BlockJobType',
3622             'device': 'str',
3623             'len'   : 'int',
3624             'offset': 'int',
3625             'speed' : 'int' } }
3628 # @BLOCK_JOB_ERROR:
3630 # Emitted when a block job encounters an error
3632 # @device: The job identifier. Originally the device name but other
3633 #          values are allowed since QEMU 2.7
3635 # @operation: I/O operation
3637 # @action: action that has been taken
3639 # Since: 1.3
3641 # Example:
3643 # <- { "event": "BLOCK_JOB_ERROR",
3644 #      "data": { "device": "ide0-hd1",
3645 #                "operation": "write",
3646 #                "action": "stop" },
3647 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3650 { 'event': 'BLOCK_JOB_ERROR',
3651   'data': { 'device'   : 'str',
3652             'operation': 'IoOperationType',
3653             'action'   : 'BlockErrorAction' } }
3656 # @BLOCK_JOB_READY:
3658 # Emitted when a block job is ready to complete
3660 # @type: job type
3662 # @device: The job identifier. Originally the device name but other
3663 #          values are allowed since QEMU 2.7
3665 # @len: maximum progress value
3667 # @offset: current progress value. On success this is equal to len.
3668 #          On failure this is less than len
3670 # @speed: rate limit, bytes per second
3672 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
3673 # event
3675 # Since: 1.3
3677 # Example:
3679 # <- { "event": "BLOCK_JOB_READY",
3680 #      "data": { "device": "drive0", "type": "mirror", "speed": 0,
3681 #                "len": 2097152, "offset": 2097152 }
3682 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3685 { 'event': 'BLOCK_JOB_READY',
3686   'data': { 'type'  : 'BlockJobType',
3687             'device': 'str',
3688             'len'   : 'int',
3689             'offset': 'int',
3690             'speed' : 'int' } }
3693 # @PreallocMode:
3695 # Preallocation mode of QEMU image file
3697 # @off: no preallocation
3698 # @metadata: preallocate only for metadata
3699 # @falloc: like @full preallocation but allocate disk space by
3700 #          posix_fallocate() rather than writing zeros.
3701 # @full: preallocate all data by writing zeros to device to ensure disk
3702 #        space is really available. @full preallocation also sets up
3703 #        metadata correctly.
3705 # Since: 2.2
3707 { 'enum': 'PreallocMode',
3708   'data': [ 'off', 'metadata', 'falloc', 'full' ] }
3711 # @BLOCK_WRITE_THRESHOLD:
3713 # Emitted when writes on block device reaches or exceeds the
3714 # configured write threshold. For thin-provisioned devices, this
3715 # means the device should be extended to avoid pausing for
3716 # disk exhaustion.
3717 # The event is one shot. Once triggered, it needs to be
3718 # re-registered with another block-set-write-threshold command.
3720 # @node-name: graph node name on which the threshold was exceeded.
3722 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
3724 # @write-threshold: last configured threshold, in bytes.
3726 # Since: 2.3
3728 { 'event': 'BLOCK_WRITE_THRESHOLD',
3729   'data': { 'node-name': 'str',
3730             'amount-exceeded': 'uint64',
3731             'write-threshold': 'uint64' } }
3734 # @block-set-write-threshold:
3736 # Change the write threshold for a block drive. An event will be
3737 # delivered if a write to this block drive crosses the configured
3738 # threshold.  The threshold is an offset, thus must be
3739 # non-negative. Default is no write threshold. Setting the threshold
3740 # to zero disables it.
3742 # This is useful to transparently resize thin-provisioned drives without
3743 # the guest OS noticing.
3745 # @node-name: graph node name on which the threshold must be set.
3747 # @write-threshold: configured threshold for the block device, bytes.
3748 #                   Use 0 to disable the threshold.
3750 # Since: 2.3
3752 # Example:
3754 # -> { "execute": "block-set-write-threshold",
3755 #      "arguments": { "node-name": "mydev",
3756 #                     "write-threshold": 17179869184 } }
3757 # <- { "return": {} }
3760 { 'command': 'block-set-write-threshold',
3761   'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
3764 # @x-blockdev-change:
3766 # Dynamically reconfigure the block driver state graph. It can be used
3767 # to add, remove, insert or replace a graph node. Currently only the
3768 # Quorum driver implements this feature to add or remove its child. This
3769 # is useful to fix a broken quorum child.
3771 # If @node is specified, it will be inserted under @parent. @child
3772 # may not be specified in this case. If both @parent and @child are
3773 # specified but @node is not, @child will be detached from @parent.
3775 # @parent: the id or name of the parent node.
3777 # @child: the name of a child under the given parent node.
3779 # @node: the name of the node that will be added.
3781 # Note: this command is experimental, and its API is not stable. It
3782 # does not support all kinds of operations, all kinds of children, nor
3783 # all block drivers.
3785 # Warning: The data in a new quorum child MUST be consistent with that of
3786 # the rest of the array.
3788 # Since: 2.7
3790 # Example:
3792 # 1. Add a new node to a quorum
3793 # -> { "execute": "blockdev-add",
3794 #      "arguments": {
3795 #          "driver": "raw",
3796 #          "node-name": "new_node",
3797 #          "file": { "driver": "file",
3798 #                    "filename": "test.raw" } } }
3799 # <- { "return": {} }
3800 # -> { "execute": "x-blockdev-change",
3801 #      "arguments": { "parent": "disk1",
3802 #                     "node": "new_node" } }
3803 # <- { "return": {} }
3805 # 2. Delete a quorum's node
3806 # -> { "execute": "x-blockdev-change",
3807 #      "arguments": { "parent": "disk1",
3808 #                     "child": "children.1" } }
3809 # <- { "return": {} }
3812 { 'command': 'x-blockdev-change',
3813   'data' : { 'parent': 'str',
3814              '*child': 'str',
3815              '*node': 'str' } }