qmp-commands: move 'block_passwd' doc to schema
[qemu/kevin.git] / qapi / block-core.json
blob439463dec5f96a40033fd9159d6b4d7cb499439a
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 # @ImageInfoSpecificQCow2:
38 # @compat: compatibility level
40 # @lazy-refcounts: #optional on or off; only valid for compat >= 1.1
42 # @corrupt: #optional true if the image has been marked corrupt; only valid for
43 #           compat >= 1.1 (since 2.2)
45 # @refcount-bits: width of a refcount entry in bits (since 2.3)
47 # Since: 1.7
49 { 'struct': 'ImageInfoSpecificQCow2',
50   'data': {
51       'compat': 'str',
52       '*lazy-refcounts': 'bool',
53       '*corrupt': 'bool',
54       'refcount-bits': 'int'
55   } }
58 # @ImageInfoSpecificVmdk:
60 # @create-type: The create type of VMDK image
62 # @cid: Content id of image
64 # @parent-cid: Parent VMDK image's cid
66 # @extents: List of extent files
68 # Since: 1.7
70 { 'struct': 'ImageInfoSpecificVmdk',
71   'data': {
72       'create-type': 'str',
73       'cid': 'int',
74       'parent-cid': 'int',
75       'extents': ['ImageInfo']
76   } }
79 # @ImageInfoSpecific:
81 # A discriminated record of image format specific information structures.
83 # Since: 1.7
85 { 'union': 'ImageInfoSpecific',
86   'data': {
87       'qcow2': 'ImageInfoSpecificQCow2',
88       'vmdk': 'ImageInfoSpecificVmdk',
89       # If we need to add block driver specific parameters for
90       # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
91       # to define a ImageInfoSpecificLUKS
92       'luks': 'QCryptoBlockInfoLUKS'
93   } }
96 # @ImageInfo:
98 # Information about a QEMU image file
100 # @filename: name of the image file
102 # @format: format of the image file
104 # @virtual-size: maximum capacity in bytes of the image
106 # @actual-size: #optional actual size on disk in bytes of the image
108 # @dirty-flag: #optional true if image is not cleanly closed
110 # @cluster-size: #optional size of a cluster in bytes
112 # @encrypted: #optional true if the image is encrypted
114 # @compressed: #optional true if the image is compressed (Since 1.7)
116 # @backing-filename: #optional name of the backing file
118 # @full-backing-filename: #optional full path of the backing file
120 # @backing-filename-format: #optional the format of the backing file
122 # @snapshots: #optional list of VM snapshots
124 # @backing-image: #optional info of the backing image (since 1.6)
126 # @format-specific: #optional structure supplying additional format-specific
127 # information (since 1.7)
129 # Since: 1.3
132 { 'struct': 'ImageInfo',
133   'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
134            '*actual-size': 'int', 'virtual-size': 'int',
135            '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
136            '*backing-filename': 'str', '*full-backing-filename': 'str',
137            '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
138            '*backing-image': 'ImageInfo',
139            '*format-specific': 'ImageInfoSpecific' } }
142 # @ImageCheck:
144 # Information about a QEMU image file check
146 # @filename: name of the image file checked
148 # @format: format of the image file checked
150 # @check-errors: number of unexpected errors occurred during check
152 # @image-end-offset: #optional offset (in bytes) where the image ends, this
153 #                    field is present if the driver for the image format
154 #                    supports it
156 # @corruptions: #optional number of corruptions found during the check if any
158 # @leaks: #optional number of leaks found during the check if any
160 # @corruptions-fixed: #optional number of corruptions fixed during the check
161 #                     if any
163 # @leaks-fixed: #optional number of leaks fixed during the check if any
165 # @total-clusters: #optional total number of clusters, this field is present
166 #                  if the driver for the image format supports it
168 # @allocated-clusters: #optional total number of allocated clusters, this
169 #                      field is present if the driver for the image format
170 #                      supports it
172 # @fragmented-clusters: #optional total number of fragmented clusters, this
173 #                       field is present if the driver for the image format
174 #                       supports it
176 # @compressed-clusters: #optional total number of compressed clusters, this
177 #                       field is present if the driver for the image format
178 #                       supports it
180 # Since: 1.4
183 { 'struct': 'ImageCheck',
184   'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
185            '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
186            '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
187            '*total-clusters': 'int', '*allocated-clusters': 'int',
188            '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
191 # @MapEntry:
193 # Mapping information from a virtual block range to a host file range
195 # @start: the start byte of the mapped virtual range
197 # @length: the number of bytes of the mapped virtual range
199 # @data: whether the mapped range has data
201 # @zero: whether the virtual blocks are zeroed
203 # @depth: the depth of the mapping
205 # @offset: #optional the offset in file that the virtual sectors are mapped to
207 # @filename: #optional filename that is referred to by @offset
209 # Since: 2.6
212 { 'struct': 'MapEntry',
213   'data': {'start': 'int', 'length': 'int', 'data': 'bool',
214            'zero': 'bool', 'depth': 'int', '*offset': 'int',
215            '*filename': 'str' } }
218 # @BlockdevCacheInfo:
220 # Cache mode information for a block device
222 # @writeback:   true if writeback mode is enabled
223 # @direct:      true if the host page cache is bypassed (O_DIRECT)
224 # @no-flush:    true if flush requests are ignored for the device
226 # Since: 2.3
228 { 'struct': 'BlockdevCacheInfo',
229   'data': { 'writeback': 'bool',
230             'direct': 'bool',
231             'no-flush': 'bool' } }
234 # @BlockDeviceInfo:
236 # Information about the backing device for a block device.
238 # @file: the filename of the backing device
240 # @node-name: #optional the name of the block driver node (Since 2.0)
242 # @ro: true if the backing device was open read-only
244 # @drv: the name of the block format used to open the backing device. As of
245 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
246 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
247 #       'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
248 #       'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
249 #       2.2: 'archipelago' added, 'cow' dropped
250 #       2.3: 'host_floppy' deprecated
251 #       2.5: 'host_floppy' dropped
252 #       2.6: 'luks' added
253 #       2.8: 'replication' added, 'tftp' dropped
255 # @backing_file: #optional the name of the backing file (for copy-on-write)
257 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
259 # @encrypted: true if the backing device is encrypted
261 # @encryption_key_missing: true if the backing device is encrypted but an
262 #                          valid encryption key is missing
264 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
266 # @bps: total throughput limit in bytes per second is specified
268 # @bps_rd: read throughput limit in bytes per second is specified
270 # @bps_wr: write throughput limit in bytes per second is specified
272 # @iops: total I/O operations per second is specified
274 # @iops_rd: read I/O operations per second is specified
276 # @iops_wr: write I/O operations per second is specified
278 # @image: the info of image used (since: 1.6)
280 # @bps_max: #optional total throughput limit during bursts,
281 #                     in bytes (Since 1.7)
283 # @bps_rd_max: #optional read throughput limit during bursts,
284 #                        in bytes (Since 1.7)
286 # @bps_wr_max: #optional write throughput limit during bursts,
287 #                        in bytes (Since 1.7)
289 # @iops_max: #optional total I/O operations per second during bursts,
290 #                      in bytes (Since 1.7)
292 # @iops_rd_max: #optional read I/O operations per second during bursts,
293 #                         in bytes (Since 1.7)
295 # @iops_wr_max: #optional write I/O operations per second during bursts,
296 #                         in bytes (Since 1.7)
298 # @bps_max_length: #optional maximum length of the @bps_max burst
299 #                            period, in seconds. (Since 2.6)
301 # @bps_rd_max_length: #optional maximum length of the @bps_rd_max
302 #                               burst period, in seconds. (Since 2.6)
304 # @bps_wr_max_length: #optional maximum length of the @bps_wr_max
305 #                               burst period, in seconds. (Since 2.6)
307 # @iops_max_length: #optional maximum length of the @iops burst
308 #                             period, in seconds. (Since 2.6)
310 # @iops_rd_max_length: #optional maximum length of the @iops_rd_max
311 #                                burst period, in seconds. (Since 2.6)
313 # @iops_wr_max_length: #optional maximum length of the @iops_wr_max
314 #                                burst period, in seconds. (Since 2.6)
316 # @iops_size: #optional an I/O size in bytes (Since 1.7)
318 # @group: #optional throttle group name (Since 2.4)
320 # @cache: the cache mode used for the block device (since: 2.3)
322 # @write_threshold: configured write threshold for the device.
323 #                   0 if disabled. (Since 2.3)
325 # Since: 0.14.0
328 { 'struct': 'BlockDeviceInfo',
329   'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
330             '*backing_file': 'str', 'backing_file_depth': 'int',
331             'encrypted': 'bool', 'encryption_key_missing': 'bool',
332             'detect_zeroes': 'BlockdevDetectZeroesOptions',
333             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
334             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
335             'image': 'ImageInfo',
336             '*bps_max': 'int', '*bps_rd_max': 'int',
337             '*bps_wr_max': 'int', '*iops_max': 'int',
338             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
339             '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
340             '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
341             '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
342             '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
343             'write_threshold': 'int' } }
346 # @BlockDeviceIoStatus:
348 # An enumeration of block device I/O status.
350 # @ok: The last I/O operation has succeeded
352 # @failed: The last I/O operation has failed
354 # @nospace: The last I/O operation has failed due to a no-space condition
356 # Since: 1.0
358 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
361 # @BlockDeviceMapEntry:
363 # Entry in the metadata map of the device (returned by "qemu-img map")
365 # @start: Offset in the image of the first byte described by this entry
366 #         (in bytes)
368 # @length: Length of the range described by this entry (in bytes)
370 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
371 #         before reaching one for which the range is allocated.  The value is
372 #         in the range 0 to the depth of the image chain - 1.
374 # @zero: the sectors in this range read as zeros
376 # @data: reading the image will actually read data from a file (in particular,
377 #        if @offset is present this means that the sectors are not simply
378 #        preallocated, but contain actual data in raw format)
380 # @offset: if present, the image file stores the data for this range in
381 #          raw format at the given offset.
383 # Since: 1.7
385 { 'struct': 'BlockDeviceMapEntry',
386   'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
387             'data': 'bool', '*offset': 'int' } }
390 # @DirtyBitmapStatus:
392 # An enumeration of possible states that a dirty bitmap can report to the user.
394 # @frozen: The bitmap is currently in-use by a backup operation or block job,
395 #          and is immutable.
397 # @disabled: The bitmap is currently in-use by an internal operation and is
398 #            read-only. It can still be deleted.
400 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
401 #          deleted, or used for backup operations.
403 # Since: 2.4
405 { 'enum': 'DirtyBitmapStatus',
406   'data': ['active', 'disabled', 'frozen'] }
409 # @BlockDirtyInfo:
411 # Block dirty bitmap information.
413 # @name: #optional the name of the dirty bitmap (Since 2.4)
415 # @count: number of dirty bytes according to the dirty bitmap
417 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
419 # @status: current status of the dirty bitmap (since 2.4)
421 # Since: 1.3
423 { 'struct': 'BlockDirtyInfo',
424   'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
425            'status': 'DirtyBitmapStatus'} }
428 # @BlockInfo:
430 # Block device information.  This structure describes a virtual device and
431 # the backing device associated with it.
433 # @device: The device name associated with the virtual device.
435 # @type: This field is returned only for compatibility reasons, it should
436 #        not be used (always returns 'unknown')
438 # @removable: True if the device supports removable media.
440 # @locked: True if the guest has locked this device from having its media
441 #          removed
443 # @tray_open: #optional True if the device's tray is open
444 #             (only present if it has a tray)
446 # @dirty-bitmaps: #optional dirty bitmaps information (only present if the
447 #                 driver has one or more dirty bitmaps) (Since 2.0)
449 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
450 #             supports it and the VM is configured to stop on errors
451 #             (supported device models: virtio-blk, ide, scsi-disk)
453 # @inserted: #optional @BlockDeviceInfo describing the device if media is
454 #            present
456 # Since:  0.14.0
458 { 'struct': 'BlockInfo',
459   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
460            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
461            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
462            '*dirty-bitmaps': ['BlockDirtyInfo'] } }
465 # @query-block:
467 # Get a list of BlockInfo for all virtual block devices.
469 # Returns: a list of @BlockInfo describing each virtual block device
471 # Since: 0.14.0
473 # Example:
475 # -> { "execute": "query-block" }
476 # <- {
477 #       "return":[
478 #          {
479 #             "io-status": "ok",
480 #             "device":"ide0-hd0",
481 #             "locked":false,
482 #             "removable":false,
483 #             "inserted":{
484 #                "ro":false,
485 #                "drv":"qcow2",
486 #                "encrypted":false,
487 #                "file":"disks/test.qcow2",
488 #                "backing_file_depth":1,
489 #                "bps":1000000,
490 #                "bps_rd":0,
491 #                "bps_wr":0,
492 #                "iops":1000000,
493 #                "iops_rd":0,
494 #                "iops_wr":0,
495 #                "bps_max": 8000000,
496 #                "bps_rd_max": 0,
497 #                "bps_wr_max": 0,
498 #                "iops_max": 0,
499 #                "iops_rd_max": 0,
500 #                "iops_wr_max": 0,
501 #                "iops_size": 0,
502 #                "detect_zeroes": "on",
503 #                "write_threshold": 0,
504 #                "image":{
505 #                   "filename":"disks/test.qcow2",
506 #                   "format":"qcow2",
507 #                   "virtual-size":2048000,
508 #                   "backing_file":"base.qcow2",
509 #                   "full-backing-filename":"disks/base.qcow2",
510 #                   "backing-filename-format":"qcow2",
511 #                   "snapshots":[
512 #                      {
513 #                         "id": "1",
514 #                         "name": "snapshot1",
515 #                         "vm-state-size": 0,
516 #                         "date-sec": 10000200,
517 #                         "date-nsec": 12,
518 #                         "vm-clock-sec": 206,
519 #                         "vm-clock-nsec": 30
520 #                      }
521 #                   ],
522 #                   "backing-image":{
523 #                       "filename":"disks/base.qcow2",
524 #                       "format":"qcow2",
525 #                       "virtual-size":2048000
526 #                   }
527 #                }
528 #             },
529 #             "type":"unknown"
530 #          },
531 #          {
532 #             "io-status": "ok",
533 #             "device":"ide1-cd0",
534 #             "locked":false,
535 #             "removable":true,
536 #             "type":"unknown"
537 #          },
538 #          {
539 #             "device":"floppy0",
540 #             "locked":false,
541 #             "removable":true,
542 #             "type":"unknown"
543 #          },
544 #          {
545 #             "device":"sd0",
546 #             "locked":false,
547 #             "removable":true,
548 #             "type":"unknown"
549 #          }
550 #       ]
551 #    }
554 { 'command': 'query-block', 'returns': ['BlockInfo'] }
558 # @BlockDeviceTimedStats:
560 # Statistics of a block device during a given interval of time.
562 # @interval_length: Interval used for calculating the statistics,
563 #                   in seconds.
565 # @min_rd_latency_ns: Minimum latency of read operations in the
566 #                     defined interval, in nanoseconds.
568 # @min_wr_latency_ns: Minimum latency of write operations in the
569 #                     defined interval, in nanoseconds.
571 # @min_flush_latency_ns: Minimum latency of flush operations in the
572 #                        defined interval, in nanoseconds.
574 # @max_rd_latency_ns: Maximum latency of read operations in the
575 #                     defined interval, in nanoseconds.
577 # @max_wr_latency_ns: Maximum latency of write operations in the
578 #                     defined interval, in nanoseconds.
580 # @max_flush_latency_ns: Maximum latency of flush operations in the
581 #                        defined interval, in nanoseconds.
583 # @avg_rd_latency_ns: Average latency of read operations in the
584 #                     defined interval, in nanoseconds.
586 # @avg_wr_latency_ns: Average latency of write operations in the
587 #                     defined interval, in nanoseconds.
589 # @avg_flush_latency_ns: Average latency of flush operations in the
590 #                        defined interval, in nanoseconds.
592 # @avg_rd_queue_depth: Average number of pending read operations
593 #                      in the defined interval.
595 # @avg_wr_queue_depth: Average number of pending write operations
596 #                      in the defined interval.
598 # Since: 2.5
600 { 'struct': 'BlockDeviceTimedStats',
601   'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
602             'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
603             'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
604             'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
605             'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
606             'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
609 # @BlockDeviceStats:
611 # Statistics of a virtual block device or a block backing device.
613 # @rd_bytes:      The number of bytes read by the device.
615 # @wr_bytes:      The number of bytes written by the device.
617 # @rd_operations: The number of read operations performed by the device.
619 # @wr_operations: The number of write operations performed by the device.
621 # @flush_operations: The number of cache flush operations performed by the
622 #                    device (since 0.15.0)
624 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
625 #                       (since 0.15.0).
627 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
629 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
631 # @wr_highest_offset: The offset after the greatest byte written to the
632 #                     device.  The intended use of this information is for
633 #                     growable sparse files (like qcow2) that are used on top
634 #                     of a physical device.
636 # @rd_merged: Number of read requests that have been merged into another
637 #             request (Since 2.3).
639 # @wr_merged: Number of write requests that have been merged into another
640 #             request (Since 2.3).
642 # @idle_time_ns: #optional Time since the last I/O operation, in
643 #                nanoseconds. If the field is absent it means that
644 #                there haven't been any operations yet (Since 2.5).
646 # @failed_rd_operations: The number of failed read operations
647 #                        performed by the device (Since 2.5)
649 # @failed_wr_operations: The number of failed write operations
650 #                        performed by the device (Since 2.5)
652 # @failed_flush_operations: The number of failed flush operations
653 #                           performed by the device (Since 2.5)
655 # @invalid_rd_operations: The number of invalid read operations
656 #                          performed by the device (Since 2.5)
658 # @invalid_wr_operations: The number of invalid write operations
659 #                         performed by the device (Since 2.5)
661 # @invalid_flush_operations: The number of invalid flush operations
662 #                            performed by the device (Since 2.5)
664 # @account_invalid: Whether invalid operations are included in the
665 #                   last access statistics (Since 2.5)
667 # @account_failed: Whether failed operations are included in the
668 #                  latency and last access statistics (Since 2.5)
670 # @timed_stats: Statistics specific to the set of previously defined
671 #               intervals of time (Since 2.5)
673 # Since: 0.14.0
675 { 'struct': 'BlockDeviceStats',
676   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
677            'wr_operations': 'int', 'flush_operations': 'int',
678            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
679            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
680            'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
681            'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
682            'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
683            'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
684            'account_invalid': 'bool', 'account_failed': 'bool',
685            'timed_stats': ['BlockDeviceTimedStats'] } }
688 # @BlockStats:
690 # Statistics of a virtual block device or a block backing device.
692 # @device: #optional If the stats are for a virtual block device, the name
693 #          corresponding to the virtual block device.
695 # @node-name: #optional The node name of the device. (Since 2.3)
697 # @stats:  A @BlockDeviceStats for the device.
699 # @parent: #optional This describes the file block device if it has one.
700 #          Contains recursively the statistics of the underlying
701 #          protocol (e.g. the host file for a qcow2 image). If there is
702 #          no underlying protocol, this field is omitted
704 # @backing: #optional This describes the backing block device if it has one.
705 #           (Since 2.0)
707 # Since: 0.14.0
709 { 'struct': 'BlockStats',
710   'data': {'*device': 'str', '*node-name': 'str',
711            'stats': 'BlockDeviceStats',
712            '*parent': 'BlockStats',
713            '*backing': 'BlockStats'} }
716 # @query-blockstats:
718 # Query the @BlockStats for all virtual block devices.
720 # @query-nodes: #optional If true, the command will query all the block nodes
721 #               that have a node name, in a list which will include "parent"
722 #               information, but not "backing".
723 #               If false or omitted, the behavior is as before - query all the
724 #               device backends, recursively including their "parent" and
725 #               "backing". (Since 2.3)
727 # Returns: A list of @BlockStats for each virtual block devices.
729 # Since: 0.14.0
731 # Example:
733 # -> { "execute": "query-blockstats" }
734 # <- {
735 #       "return":[
736 #          {
737 #             "device":"ide0-hd0",
738 #             "parent":{
739 #                "stats":{
740 #                   "wr_highest_offset":3686448128,
741 #                   "wr_bytes":9786368,
742 #                   "wr_operations":751,
743 #                   "rd_bytes":122567168,
744 #                   "rd_operations":36772
745 #                   "wr_total_times_ns":313253456
746 #                   "rd_total_times_ns":3465673657
747 #                   "flush_total_times_ns":49653
748 #                   "flush_operations":61,
749 #                   "rd_merged":0,
750 #                   "wr_merged":0,
751 #                   "idle_time_ns":2953431879,
752 #                   "account_invalid":true,
753 #                   "account_failed":false
754 #                }
755 #             },
756 #             "stats":{
757 #                "wr_highest_offset":2821110784,
758 #                "wr_bytes":9786368,
759 #                "wr_operations":692,
760 #                "rd_bytes":122739200,
761 #                "rd_operations":36604
762 #                "flush_operations":51,
763 #                "wr_total_times_ns":313253456
764 #                "rd_total_times_ns":3465673657
765 #                "flush_total_times_ns":49653,
766 #                "rd_merged":0,
767 #                "wr_merged":0,
768 #                "idle_time_ns":2953431879,
769 #                "account_invalid":true,
770 #                "account_failed":false
771 #             }
772 #          },
773 #          {
774 #             "device":"ide1-cd0",
775 #             "stats":{
776 #                "wr_highest_offset":0,
777 #                "wr_bytes":0,
778 #                "wr_operations":0,
779 #                "rd_bytes":0,
780 #                "rd_operations":0
781 #                "flush_operations":0,
782 #                "wr_total_times_ns":0
783 #                "rd_total_times_ns":0
784 #                "flush_total_times_ns":0,
785 #                "rd_merged":0,
786 #                "wr_merged":0,
787 #                "account_invalid":false,
788 #                "account_failed":false
789 #             }
790 #          },
791 #          {
792 #             "device":"floppy0",
793 #             "stats":{
794 #                "wr_highest_offset":0,
795 #                "wr_bytes":0,
796 #                "wr_operations":0,
797 #                "rd_bytes":0,
798 #                "rd_operations":0
799 #                "flush_operations":0,
800 #                "wr_total_times_ns":0
801 #                "rd_total_times_ns":0
802 #                "flush_total_times_ns":0,
803 #                "rd_merged":0,
804 #                "wr_merged":0,
805 #                "account_invalid":false,
806 #                "account_failed":false
807 #             }
808 #          },
809 #          {
810 #             "device":"sd0",
811 #             "stats":{
812 #                "wr_highest_offset":0,
813 #                "wr_bytes":0,
814 #                "wr_operations":0,
815 #                "rd_bytes":0,
816 #                "rd_operations":0
817 #                "flush_operations":0,
818 #                "wr_total_times_ns":0
819 #                "rd_total_times_ns":0
820 #                "flush_total_times_ns":0,
821 #                "rd_merged":0,
822 #                "wr_merged":0,
823 #                "account_invalid":false,
824 #                "account_failed":false
825 #             }
826 #          }
827 #       ]
828 #    }
831 { 'command': 'query-blockstats',
832   'data': { '*query-nodes': 'bool' },
833   'returns': ['BlockStats'] }
836 # @BlockdevOnError:
838 # An enumeration of possible behaviors for errors on I/O operations.
839 # The exact meaning depends on whether the I/O was initiated by a guest
840 # or by a block job
842 # @report: for guest operations, report the error to the guest;
843 #          for jobs, cancel the job
845 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
846 #          or BLOCK_JOB_ERROR)
848 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
850 # @stop: for guest operations, stop the virtual machine;
851 #        for jobs, pause the job
853 # @auto: inherit the error handling policy of the backend (since: 2.7)
855 # Since: 1.3
857 { 'enum': 'BlockdevOnError',
858   'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
861 # @MirrorSyncMode:
863 # An enumeration of possible behaviors for the initial synchronization
864 # phase of storage mirroring.
866 # @top: copies data in the topmost image to the destination
868 # @full: copies data from all images to the destination
870 # @none: only copy data written from now on
872 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
874 # Since: 1.3
876 { 'enum': 'MirrorSyncMode',
877   'data': ['top', 'full', 'none', 'incremental'] }
880 # @BlockJobType:
882 # Type of a block job.
884 # @commit: block commit job type, see "block-commit"
886 # @stream: block stream job type, see "block-stream"
888 # @mirror: drive mirror job type, see "drive-mirror"
890 # @backup: drive backup job type, see "drive-backup"
892 # Since: 1.7
894 { 'enum': 'BlockJobType',
895   'data': ['commit', 'stream', 'mirror', 'backup'] }
898 # @BlockJobInfo:
900 # Information about a long-running block device operation.
902 # @type: the job type ('stream' for image streaming)
904 # @device: The job identifier. Originally the device name but other
905 #          values are allowed since QEMU 2.7
907 # @len: the maximum progress value
909 # @busy: false if the job is known to be in a quiescent state, with
910 #        no pending I/O.  Since 1.3.
912 # @paused: whether the job is paused or, if @busy is true, will
913 #          pause itself as soon as possible.  Since 1.3.
915 # @offset: the current progress value
917 # @speed: the rate limit, bytes per second
919 # @io-status: the status of the job (since 1.3)
921 # @ready: true if the job may be completed (since 2.2)
923 # Since: 1.1
925 { 'struct': 'BlockJobInfo',
926   'data': {'type': 'str', 'device': 'str', 'len': 'int',
927            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
928            'io-status': 'BlockDeviceIoStatus', 'ready': 'bool'} }
931 # @query-block-jobs:
933 # Return information about long-running block device operations.
935 # Returns: a list of @BlockJobInfo for each active block job
937 # Since: 1.1
939 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
942 # @block_passwd:
944 # This command sets the password of a block device that has not been open
945 # with a password and requires one.
947 # The two cases where this can happen are a block device is created through
948 # QEMU's initial command line or a block device is changed through the legacy
949 # @change interface.
951 # In the event that the block device is created through the initial command
952 # line, the VM will start in the stopped state regardless of whether '-S' is
953 # used.  The intention is for a management tool to query the block devices to
954 # determine which ones are encrypted, set the passwords with this command, and
955 # then start the guest with the @cont command.
957 # Either @device or @node-name must be set but not both.
959 # @device: #optional the name of the block backend device to set the password on
961 # @node-name: #optional graph node name to set the password on (Since 2.0)
963 # @password: the password to use for the device
965 # Returns: nothing on success
966 #          If @device is not a valid block device, DeviceNotFound
967 #          If @device is not encrypted, DeviceNotEncrypted
969 # Notes:  Not all block formats support encryption and some that do are not
970 #         able to validate that a password is correct.  Disk corruption may
971 #         occur if an invalid password is specified.
973 # Since: 0.14.0
975 # Example:
977 # -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
978 #                                                "password": "12345" } }
979 # <- { "return": {} }
982 { 'command': 'block_passwd', 'data': {'*device': 'str',
983                                       '*node-name': 'str', 'password': 'str'} }
986 # @block_resize:
988 # Resize a block image while a guest is running.
990 # Either @device or @node-name must be set but not both.
992 # @device: #optional the name of the device to get the image resized
994 # @node-name: #optional graph node name to get the image resized (Since 2.0)
996 # @size:  new image size in bytes
998 # Returns: nothing on success
999 #          If @device is not a valid block device, DeviceNotFound
1001 # Since: 0.14.0
1003 { 'command': 'block_resize', 'data': { '*device': 'str',
1004                                        '*node-name': 'str',
1005                                        'size': 'int' }}
1008 # @NewImageMode:
1010 # An enumeration that tells QEMU how to set the backing file path in
1011 # a new image file.
1013 # @existing: QEMU should look for an existing image file.
1015 # @absolute-paths: QEMU should create a new image with absolute paths
1016 # for the backing file. If there is no backing file available, the new
1017 # image will not be backed either.
1019 # Since: 1.1
1021 { 'enum': 'NewImageMode',
1022   'data': [ 'existing', 'absolute-paths' ] }
1025 # @BlockdevSnapshotSync:
1027 # Either @device or @node-name must be set but not both.
1029 # @device: #optional the name of the device to generate the snapshot from.
1031 # @node-name: #optional graph node name to generate the snapshot from (Since 2.0)
1033 # @snapshot-file: the target of the new image. A new file will be created.
1035 # @snapshot-node-name: #optional the graph node name of the new image (Since 2.0)
1037 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1039 # @mode: #optional whether and how QEMU should create a new image, default is
1040 #        'absolute-paths'.
1042 { 'struct': 'BlockdevSnapshotSync',
1043   'data': { '*device': 'str', '*node-name': 'str',
1044             'snapshot-file': 'str', '*snapshot-node-name': 'str',
1045             '*format': 'str', '*mode': 'NewImageMode' } }
1048 # @BlockdevSnapshot:
1050 # @node: device or node name that will have a snapshot created.
1052 # @overlay: reference to the existing block device that will become
1053 #           the overlay of @node, as part of creating the snapshot.
1054 #           It must not have a current backing file (this can be
1055 #           achieved by passing "backing": "" to blockdev-add).
1057 # Since: 2.5
1059 { 'struct': 'BlockdevSnapshot',
1060   'data': { 'node': 'str', 'overlay': 'str' } }
1063 # @DriveBackup:
1065 # @job-id: #optional identifier for the newly-created block job. If
1066 #          omitted, the device name will be used. (Since 2.7)
1068 # @device: the device name or node-name of a root node which should be copied.
1070 # @target: the target of the new image. If the file exists, or if it
1071 #          is a device, the existing file/device will be used as the new
1072 #          destination.  If it does not exist, a new file will be created.
1074 # @format: #optional the format of the new destination, default is to
1075 #          probe if @mode is 'existing', else the format of the source
1077 # @sync: what parts of the disk image should be copied to the destination
1078 #        (all the disk, only the sectors allocated in the topmost image, from a
1079 #        dirty bitmap, or only new I/O).
1081 # @mode: #optional whether and how QEMU should create a new image, default is
1082 #        'absolute-paths'.
1084 # @speed: #optional the maximum speed, in bytes per second
1086 # @bitmap: #optional the name of dirty bitmap if sync is "incremental".
1087 #          Must be present if sync is "incremental", must NOT be present
1088 #          otherwise. (Since 2.4)
1090 # @compress: #optional true to compress data, if the target format supports it.
1091 #            (default: false) (since 2.8)
1093 # @on-source-error: #optional the action to take on an error on the source,
1094 #                   default 'report'.  'stop' and 'enospc' can only be used
1095 #                   if the block device supports io-status (see BlockInfo).
1097 # @on-target-error: #optional the action to take on an error on the target,
1098 #                   default 'report' (no limitations, since this applies to
1099 #                   a different block device than @device).
1101 # Note: @on-source-error and @on-target-error only affect background
1102 # I/O.  If an error occurs during a guest write request, the device's
1103 # rerror/werror actions will be used.
1105 # Since: 1.6
1107 { 'struct': 'DriveBackup',
1108   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1109             '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1110             '*speed': 'int', '*bitmap': 'str', '*compress': 'bool',
1111             '*on-source-error': 'BlockdevOnError',
1112             '*on-target-error': 'BlockdevOnError' } }
1115 # @BlockdevBackup:
1117 # @job-id: #optional identifier for the newly-created block job. If
1118 #          omitted, the device name will be used. (Since 2.7)
1120 # @device: the device name or node-name of a root node which should be copied.
1122 # @target: the device name or node-name of the backup target node.
1124 # @sync: what parts of the disk image should be copied to the destination
1125 #        (all the disk, only the sectors allocated in the topmost image, or
1126 #        only new I/O).
1128 # @speed: #optional the maximum speed, in bytes per second. The default is 0,
1129 #         for unlimited.
1131 # @compress: #optional true to compress data, if the target format supports it.
1132 #            (default: false) (since 2.8)
1134 # @on-source-error: #optional the action to take on an error on the source,
1135 #                   default 'report'.  'stop' and 'enospc' can only be used
1136 #                   if the block device supports io-status (see BlockInfo).
1138 # @on-target-error: #optional the action to take on an error on the target,
1139 #                   default 'report' (no limitations, since this applies to
1140 #                   a different block device than @device).
1142 # Note: @on-source-error and @on-target-error only affect background
1143 # I/O.  If an error occurs during a guest write request, the device's
1144 # rerror/werror actions will be used.
1146 # Since: 2.3
1148 { 'struct': 'BlockdevBackup',
1149   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1150             'sync': 'MirrorSyncMode',
1151             '*speed': 'int',
1152             '*compress': 'bool',
1153             '*on-source-error': 'BlockdevOnError',
1154             '*on-target-error': 'BlockdevOnError' } }
1157 # @blockdev-snapshot-sync:
1159 # Generates a synchronous snapshot of a block device.
1161 # For the arguments, see the documentation of BlockdevSnapshotSync.
1163 # Returns: nothing on success
1164 #          If @device is not a valid block device, DeviceNotFound
1166 # Since: 0.14.0
1168 { 'command': 'blockdev-snapshot-sync',
1169   'data': 'BlockdevSnapshotSync' }
1173 # @blockdev-snapshot:
1175 # Generates a snapshot of a block device.
1177 # For the arguments, see the documentation of BlockdevSnapshot.
1179 # Since: 2.5
1181 { 'command': 'blockdev-snapshot',
1182   'data': 'BlockdevSnapshot' }
1185 # @change-backing-file:
1187 # Change the backing file in the image file metadata.  This does not
1188 # cause QEMU to reopen the image file to reparse the backing filename
1189 # (it may, however, perform a reopen to change permissions from
1190 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1191 # into the image file metadata, and the QEMU internal strings are
1192 # updated.
1194 # @image-node-name: The name of the block driver state node of the
1195 #                   image to modify.
1197 # @device:          The device name or node-name of the root node that owns
1198 #                   image-node-name.
1200 # @backing-file:    The string to write as the backing file.  This
1201 #                   string is not validated, so care should be taken
1202 #                   when specifying the string or the image chain may
1203 #                   not be able to be reopened again.
1205 # Since: 2.1
1207 { 'command': 'change-backing-file',
1208   'data': { 'device': 'str', 'image-node-name': 'str',
1209             'backing-file': 'str' } }
1212 # @block-commit:
1214 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1215 # writes data between 'top' and 'base' into 'base'.
1217 # @job-id: #optional identifier for the newly-created block job. If
1218 #          omitted, the device name will be used. (Since 2.7)
1220 # @device:  the device name or node-name of a root node
1222 # @base:   #optional The file name of the backing image to write data into.
1223 #                    If not specified, this is the deepest backing image
1225 # @top:    #optional The file name of the backing image within the image chain,
1226 #                    which contains the topmost data to be committed down. If
1227 #                    not specified, this is the active layer.
1229 # @backing-file:  #optional The backing file string to write into the overlay
1230 #                           image of 'top'.  If 'top' is the active layer,
1231 #                           specifying a backing file string is an error. This
1232 #                           filename is not validated.
1234 #                           If a pathname string is such that it cannot be
1235 #                           resolved by QEMU, that means that subsequent QMP or
1236 #                           HMP commands must use node-names for the image in
1237 #                           question, as filename lookup methods will fail.
1239 #                           If not specified, QEMU will automatically determine
1240 #                           the backing file string to use, or error out if
1241 #                           there is no obvious choice. Care should be taken
1242 #                           when specifying the string, to specify a valid
1243 #                           filename or protocol.
1244 #                           (Since 2.1)
1246 #                    If top == base, that is an error.
1247 #                    If top == active, the job will not be completed by itself,
1248 #                    user needs to complete the job with the block-job-complete
1249 #                    command after getting the ready event. (Since 2.0)
1251 #                    If the base image is smaller than top, then the base image
1252 #                    will be resized to be the same size as top.  If top is
1253 #                    smaller than the base image, the base will not be
1254 #                    truncated.  If you want the base image size to match the
1255 #                    size of the smaller top, you can safely truncate it
1256 #                    yourself once the commit operation successfully completes.
1258 # @speed:  #optional the maximum speed, in bytes per second
1260 # Returns: Nothing on success
1261 #          If commit or stream is already active on this device, DeviceInUse
1262 #          If @device does not exist, DeviceNotFound
1263 #          If image commit is not supported by this device, NotSupported
1264 #          If @base or @top is invalid, a generic error is returned
1265 #          If @speed is invalid, InvalidParameter
1267 # Since: 1.3
1270 { 'command': 'block-commit',
1271   'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
1272             '*backing-file': 'str', '*speed': 'int' } }
1275 # @drive-backup:
1277 # Start a point-in-time copy of a block device to a new destination.  The
1278 # status of ongoing drive-backup operations can be checked with
1279 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1280 # The operation can be stopped before it has completed using the
1281 # block-job-cancel command.
1283 # For the arguments, see the documentation of DriveBackup.
1285 # Returns: nothing on success
1286 #          If @device is not a valid block device, GenericError
1288 # Since: 1.6
1290 { 'command': 'drive-backup', 'boxed': true,
1291   'data': 'DriveBackup' }
1294 # @blockdev-backup:
1296 # Start a point-in-time copy of a block device to a new destination.  The
1297 # status of ongoing blockdev-backup operations can be checked with
1298 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1299 # The operation can be stopped before it has completed using the
1300 # block-job-cancel command.
1302 # For the arguments, see the documentation of BlockdevBackup.
1304 # Returns: nothing on success
1305 #          If @device is not a valid block device, DeviceNotFound
1307 # Since: 2.3
1309 { 'command': 'blockdev-backup', 'boxed': true,
1310   'data': 'BlockdevBackup' }
1314 # @query-named-block-nodes:
1316 # Get the named block driver list
1318 # Returns: the list of BlockDeviceInfo
1320 # Since: 2.0
1322 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1325 # @drive-mirror:
1327 # Start mirroring a block device's writes to a new destination.
1329 # See DriveMirror for parameter descriptions
1331 # Returns: nothing on success
1332 #          If @device is not a valid block device, GenericError
1334 # Since: 1.3
1336 { 'command': 'drive-mirror', 'boxed': true,
1337   'data': 'DriveMirror' }
1340 # @DriveMirror:
1342 # A set of parameters describing drive mirror setup.
1344 # @job-id: #optional identifier for the newly-created block job. If
1345 #          omitted, the device name will be used. (Since 2.7)
1347 # @device:  the device name or node-name of a root node whose writes should be
1348 #           mirrored.
1350 # @target: the target of the new image. If the file exists, or if it
1351 #          is a device, the existing file/device will be used as the new
1352 #          destination.  If it does not exist, a new file will be created.
1354 # @format: #optional the format of the new destination, default is to
1355 #          probe if @mode is 'existing', else the format of the source
1357 # @node-name: #optional the new block driver state node name in the graph
1358 #             (Since 2.1)
1360 # @replaces: #optional with sync=full graph node name to be replaced by the new
1361 #            image when a whole image copy is done. This can be used to repair
1362 #            broken Quorum files. (Since 2.1)
1364 # @mode: #optional whether and how QEMU should create a new image, default is
1365 #        'absolute-paths'.
1367 # @speed:  #optional the maximum speed, in bytes per second
1369 # @sync: what parts of the disk image should be copied to the destination
1370 #        (all the disk, only the sectors allocated in the topmost image, or
1371 #        only new I/O).
1373 # @granularity: #optional granularity of the dirty bitmap, default is 64K
1374 #               if the image format doesn't have clusters, 4K if the clusters
1375 #               are smaller than that, else the cluster size.  Must be a
1376 #               power of 2 between 512 and 64M (since 1.4).
1378 # @buf-size: #optional maximum amount of data in flight from source to
1379 #            target (since 1.4).
1381 # @on-source-error: #optional the action to take on an error on the source,
1382 #                   default 'report'.  'stop' and 'enospc' can only be used
1383 #                   if the block device supports io-status (see BlockInfo).
1385 # @on-target-error: #optional the action to take on an error on the target,
1386 #                   default 'report' (no limitations, since this applies to
1387 #                   a different block device than @device).
1388 # @unmap: #optional Whether to try to unmap target sectors where source has
1389 #         only zero. If true, and target unallocated sectors will read as zero,
1390 #         target image sectors will be unmapped; otherwise, zeroes will be
1391 #         written. Both will result in identical contents.
1392 #         Default is true. (Since 2.4)
1394 # Since: 1.3
1396 { 'struct': 'DriveMirror',
1397   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1398             '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1399             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1400             '*speed': 'int', '*granularity': 'uint32',
1401             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1402             '*on-target-error': 'BlockdevOnError',
1403             '*unmap': 'bool' } }
1406 # @BlockDirtyBitmap:
1408 # @node: name of device/node which the bitmap is tracking
1410 # @name: name of the dirty bitmap
1412 # Since: 2.4
1414 { 'struct': 'BlockDirtyBitmap',
1415   'data': { 'node': 'str', 'name': 'str' } }
1418 # @BlockDirtyBitmapAdd:
1420 # @node: name of device/node which the bitmap is tracking
1422 # @name: name of the dirty bitmap
1424 # @granularity: #optional the bitmap granularity, default is 64k for
1425 #               block-dirty-bitmap-add
1427 # Since: 2.4
1429 { 'struct': 'BlockDirtyBitmapAdd',
1430   'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32' } }
1433 # @block-dirty-bitmap-add:
1435 # Create a dirty bitmap with a name on the node
1437 # Returns: nothing on success
1438 #          If @node is not a valid block device or node, DeviceNotFound
1439 #          If @name is already taken, GenericError with an explanation
1441 # Since: 2.4
1443 { 'command': 'block-dirty-bitmap-add',
1444   'data': 'BlockDirtyBitmapAdd' }
1447 # @block-dirty-bitmap-remove:
1449 # Remove a dirty bitmap on the node
1451 # Returns: nothing on success
1452 #          If @node is not a valid block device or node, DeviceNotFound
1453 #          If @name is not found, GenericError with an explanation
1454 #          if @name is frozen by an operation, GenericError
1456 # Since: 2.4
1458 { 'command': 'block-dirty-bitmap-remove',
1459   'data': 'BlockDirtyBitmap' }
1462 # @block-dirty-bitmap-clear:
1464 # Clear (reset) a dirty bitmap on the device
1466 # Returns: nothing on success
1467 #          If @node is not a valid block device, DeviceNotFound
1468 #          If @name is not found, GenericError with an explanation
1470 # Since: 2.4
1472 { 'command': 'block-dirty-bitmap-clear',
1473   'data': 'BlockDirtyBitmap' }
1476 # @blockdev-mirror:
1478 # Start mirroring a block device's writes to a new destination.
1480 # @job-id: #optional identifier for the newly-created block job. If
1481 #          omitted, the device name will be used. (Since 2.7)
1483 # @device: The device name or node-name of a root node whose writes should be
1484 #          mirrored.
1486 # @target: the id or node-name of the block device to mirror to. This mustn't be
1487 #          attached to guest.
1489 # @replaces: #optional 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.
1493 # @speed:  #optional the maximum speed, in bytes per second
1495 # @sync: what parts of the disk image should be copied to the destination
1496 #        (all the disk, only the sectors allocated in the topmost image, or
1497 #        only new I/O).
1499 # @granularity: #optional granularity of the dirty bitmap, default is 64K
1500 #               if the image format doesn't have clusters, 4K if the clusters
1501 #               are smaller than that, else the cluster size.  Must be a
1502 #               power of 2 between 512 and 64M
1504 # @buf-size: #optional maximum amount of data in flight from source to
1505 #            target
1507 # @on-source-error: #optional the action to take on an error on the source,
1508 #                   default 'report'.  'stop' and 'enospc' can only be used
1509 #                   if the block device supports io-status (see BlockInfo).
1511 # @on-target-error: #optional the action to take on an error on the target,
1512 #                   default 'report' (no limitations, since this applies to
1513 #                   a different block device than @device).
1515 # Returns: nothing on success.
1517 # Since: 2.6
1519 { 'command': 'blockdev-mirror',
1520   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1521             '*replaces': 'str',
1522             'sync': 'MirrorSyncMode',
1523             '*speed': 'int', '*granularity': 'uint32',
1524             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1525             '*on-target-error': 'BlockdevOnError' } }
1528 # @block_set_io_throttle:
1530 # Change I/O throttle limits for a block drive.
1532 # Since QEMU 2.4, each device with I/O limits is member of a throttle
1533 # group.
1535 # If two or more devices are members of the same group, the limits
1536 # will apply to the combined I/O of the whole group in a round-robin
1537 # fashion. Therefore, setting new I/O limits to a device will affect
1538 # the whole group.
1540 # The name of the group can be specified using the 'group' parameter.
1541 # If the parameter is unset, it is assumed to be the current group of
1542 # that device. If it's not in any group yet, the name of the device
1543 # will be used as the name for its group.
1545 # The 'group' parameter can also be used to move a device to a
1546 # different group. In this case the limits specified in the parameters
1547 # will be applied to the new group only.
1549 # I/O limits can be disabled by setting all of them to 0. In this case
1550 # the device will be removed from its group and the rest of its
1551 # members will not be affected. The 'group' parameter is ignored.
1553 # See BlockIOThrottle for parameter descriptions.
1555 # Returns: Nothing on success
1556 #          If @device is not a valid block device, DeviceNotFound
1558 # Since: 1.1
1560 { 'command': 'block_set_io_throttle', 'boxed': true,
1561   'data': 'BlockIOThrottle' }
1564 # @BlockIOThrottle:
1566 # A set of parameters describing block throttling.
1568 # @device: #optional Block device name (deprecated, use @id instead)
1570 # @id: #optional The name or QOM path of the guest device (since: 2.8)
1572 # @bps: total throughput limit in bytes per second
1574 # @bps_rd: read throughput limit in bytes per second
1576 # @bps_wr: write throughput limit in bytes per second
1578 # @iops: total I/O operations per second
1580 # @iops_rd: read I/O operations per second
1582 # @iops_wr: write I/O operations per second
1584 # @bps_max: #optional total throughput limit during bursts,
1585 #                     in bytes (Since 1.7)
1587 # @bps_rd_max: #optional read throughput limit during bursts,
1588 #                        in bytes (Since 1.7)
1590 # @bps_wr_max: #optional write throughput limit during bursts,
1591 #                        in bytes (Since 1.7)
1593 # @iops_max: #optional total I/O operations per second during bursts,
1594 #                      in bytes (Since 1.7)
1596 # @iops_rd_max: #optional read I/O operations per second during bursts,
1597 #                         in bytes (Since 1.7)
1599 # @iops_wr_max: #optional write I/O operations per second during bursts,
1600 #                         in bytes (Since 1.7)
1602 # @bps_max_length: #optional maximum length of the @bps_max burst
1603 #                            period, in seconds. It must only
1604 #                            be set if @bps_max is set as well.
1605 #                            Defaults to 1. (Since 2.6)
1607 # @bps_rd_max_length: #optional maximum length of the @bps_rd_max
1608 #                               burst period, in seconds. It must only
1609 #                               be set if @bps_rd_max is set as well.
1610 #                               Defaults to 1. (Since 2.6)
1612 # @bps_wr_max_length: #optional maximum length of the @bps_wr_max
1613 #                               burst period, in seconds. It must only
1614 #                               be set if @bps_wr_max is set as well.
1615 #                               Defaults to 1. (Since 2.6)
1617 # @iops_max_length: #optional maximum length of the @iops burst
1618 #                             period, in seconds. It must only
1619 #                             be set if @iops_max is set as well.
1620 #                             Defaults to 1. (Since 2.6)
1622 # @iops_rd_max_length: #optional maximum length of the @iops_rd_max
1623 #                                burst period, in seconds. It must only
1624 #                                be set if @iops_rd_max is set as well.
1625 #                                Defaults to 1. (Since 2.6)
1627 # @iops_wr_max_length: #optional maximum length of the @iops_wr_max
1628 #                                burst period, in seconds. It must only
1629 #                                be set if @iops_wr_max is set as well.
1630 #                                Defaults to 1. (Since 2.6)
1632 # @iops_size: #optional an I/O size in bytes (Since 1.7)
1634 # @group: #optional throttle group name (Since 2.4)
1636 # Since: 1.1
1638 { 'struct': 'BlockIOThrottle',
1639   'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
1640             'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
1641             '*bps_max': 'int', '*bps_rd_max': 'int',
1642             '*bps_wr_max': 'int', '*iops_max': 'int',
1643             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
1644             '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
1645             '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
1646             '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
1647             '*iops_size': 'int', '*group': 'str' } }
1650 # @block-stream:
1652 # Copy data from a backing file into a block device.
1654 # The block streaming operation is performed in the background until the entire
1655 # backing file has been copied.  This command returns immediately once streaming
1656 # has started.  The status of ongoing block streaming operations can be checked
1657 # with query-block-jobs.  The operation can be stopped before it has completed
1658 # using the block-job-cancel command.
1660 # The node that receives the data is called the top image, can be located in
1661 # any part of the chain (but always above the base image; see below) and can be
1662 # specified using its device or node name. Earlier qemu versions only allowed
1663 # 'device' to name the top level node; presence of the 'base-node' parameter
1664 # during introspection can be used as a witness of the enhanced semantics
1665 # of 'device'.
1667 # If a base file is specified then sectors are not copied from that base file and
1668 # its backing chain.  When streaming completes the image file will have the base
1669 # file as its backing file.  This can be used to stream a subset of the backing
1670 # file chain instead of flattening the entire image.
1672 # On successful completion the image file is updated to drop the backing file
1673 # and the BLOCK_JOB_COMPLETED event is emitted.
1675 # @job-id: #optional identifier for the newly-created block job. If
1676 #          omitted, the device name will be used. (Since 2.7)
1678 # @device: the device or node name of the top image
1680 # @base:   #optional the common backing file name.
1681 #                    It cannot be set if @base-node is also set.
1683 # @base-node: #optional the node name of the backing file.
1684 #                       It cannot be set if @base is also set. (Since 2.8)
1686 # @backing-file: #optional The backing file string to write into the top
1687 #                          image. This filename is not validated.
1689 #                          If a pathname string is such that it cannot be
1690 #                          resolved by QEMU, that means that subsequent QMP or
1691 #                          HMP commands must use node-names for the image in
1692 #                          question, as filename lookup methods will fail.
1694 #                          If not specified, QEMU will automatically determine
1695 #                          the backing file string to use, or error out if there
1696 #                          is no obvious choice.  Care should be taken when
1697 #                          specifying the string, to specify a valid filename or
1698 #                          protocol.
1699 #                          (Since 2.1)
1701 # @speed:  #optional the maximum speed, in bytes per second
1703 # @on-error: #optional the action to take on an error (default report).
1704 #            'stop' and 'enospc' can only be used if the block device
1705 #            supports io-status (see BlockInfo).  Since 1.3.
1707 # Since: 1.1
1709 { 'command': 'block-stream',
1710   'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
1711             '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
1712             '*on-error': 'BlockdevOnError' } }
1715 # @block-job-set-speed:
1717 # Set maximum speed for a background block operation.
1719 # This command can only be issued when there is an active block job.
1721 # Throttling can be disabled by setting the speed to 0.
1723 # @device: The job identifier. This used to be a device name (hence
1724 #          the name of the parameter), but since QEMU 2.7 it can have
1725 #          other values.
1727 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
1728 #          Defaults to 0.
1730 # Returns: Nothing on success
1731 #          If no background operation is active on this device, DeviceNotActive
1733 # Since: 1.1
1735 { 'command': 'block-job-set-speed',
1736   'data': { 'device': 'str', 'speed': 'int' } }
1739 # @block-job-cancel:
1741 # Stop an active background block operation.
1743 # This command returns immediately after marking the active background block
1744 # operation for cancellation.  It is an error to call this command if no
1745 # operation is in progress.
1747 # The operation will cancel as soon as possible and then emit the
1748 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
1749 # enumerated using query-block-jobs.
1751 # For streaming, the image file retains its backing file unless the streaming
1752 # operation happens to complete just as it is being cancelled.  A new streaming
1753 # operation can be started at a later time to finish copying all data from the
1754 # backing file.
1756 # @device: The job identifier. This used to be a device name (hence
1757 #          the name of the parameter), but since QEMU 2.7 it can have
1758 #          other values.
1760 # @force: #optional whether to allow cancellation of a paused job (default
1761 #         false).  Since 1.3.
1763 # Returns: Nothing on success
1764 #          If no background operation is active on this device, DeviceNotActive
1766 # Since: 1.1
1768 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
1771 # @block-job-pause:
1773 # Pause an active background block operation.
1775 # This command returns immediately after marking the active background block
1776 # operation for pausing.  It is an error to call this command if no
1777 # operation is in progress.  Pausing an already paused job has no cumulative
1778 # effect; a single block-job-resume command will resume the job.
1780 # The operation will pause as soon as possible.  No event is emitted when
1781 # the operation is actually paused.  Cancelling a paused job automatically
1782 # resumes it.
1784 # @device: The job identifier. This used to be a device name (hence
1785 #          the name of the parameter), but since QEMU 2.7 it can have
1786 #          other values.
1788 # Returns: Nothing on success
1789 #          If no background operation is active on this device, DeviceNotActive
1791 # Since: 1.3
1793 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
1796 # @block-job-resume:
1798 # Resume an active background block operation.
1800 # This command returns immediately after resuming a paused background block
1801 # operation.  It is an error to call this command if no operation is in
1802 # progress.  Resuming an already running job is not an error.
1804 # This command also clears the error status of the job.
1806 # @device: The job identifier. This used to be a device name (hence
1807 #          the name of the parameter), but since QEMU 2.7 it can have
1808 #          other values.
1810 # Returns: Nothing on success
1811 #          If no background operation is active on this device, DeviceNotActive
1813 # Since: 1.3
1815 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
1818 # @block-job-complete:
1820 # Manually trigger completion of an active background block operation.  This
1821 # is supported for drive mirroring, where it also switches the device to
1822 # write to the target path only.  The ability to complete is signaled with
1823 # a BLOCK_JOB_READY event.
1825 # This command completes an active background block operation synchronously.
1826 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
1827 # is not defined.  Note that if an I/O error occurs during the processing of
1828 # this command: 1) the command itself will fail; 2) the error will be processed
1829 # according to the rerror/werror arguments that were specified when starting
1830 # the operation.
1832 # A cancelled or paused job cannot be completed.
1834 # @device: The job identifier. This used to be a device name (hence
1835 #          the name of the parameter), but since QEMU 2.7 it can have
1836 #          other values.
1838 # Returns: Nothing on success
1839 #          If no background operation is active on this device, DeviceNotActive
1841 # Since: 1.3
1843 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
1846 # @BlockdevDiscardOptions:
1848 # Determines how to handle discard requests.
1850 # @ignore:      Ignore the request
1851 # @unmap:       Forward as an unmap request
1853 # Since: 1.7
1855 { 'enum': 'BlockdevDiscardOptions',
1856   'data': [ 'ignore', 'unmap' ] }
1859 # @BlockdevDetectZeroesOptions:
1861 # Describes the operation mode for the automatic conversion of plain
1862 # zero writes by the OS to driver specific optimized zero write commands.
1864 # @off:      Disabled (default)
1865 # @on:       Enabled
1866 # @unmap:    Enabled and even try to unmap blocks if possible. This requires
1867 #            also that @BlockdevDiscardOptions is set to unmap for this device.
1869 # Since: 2.1
1871 { 'enum': 'BlockdevDetectZeroesOptions',
1872   'data': [ 'off', 'on', 'unmap' ] }
1875 # @BlockdevAioOptions:
1877 # Selects the AIO backend to handle I/O requests
1879 # @threads:     Use qemu's thread pool
1880 # @native:      Use native AIO backend (only Linux and Windows)
1882 # Since: 1.7
1884 { 'enum': 'BlockdevAioOptions',
1885   'data': [ 'threads', 'native' ] }
1888 # @BlockdevCacheOptions:
1890 # Includes cache-related options for block devices
1892 # @direct:      #optional enables use of O_DIRECT (bypass the host page cache;
1893 #               default: false)
1894 # @no-flush:    #optional ignore any flush requests for the device (default:
1895 #               false)
1897 # Since: 1.7
1899 { 'struct': 'BlockdevCacheOptions',
1900   'data': { '*direct': 'bool',
1901             '*no-flush': 'bool' } }
1904 # @BlockdevDriver:
1906 # Drivers that are supported in block device operations.
1908 # @host_device: Since 2.1
1909 # @host_cdrom: Since 2.1
1910 # @gluster: Since 2.7
1911 # @nbd: Since 2.8
1912 # @nfs: Since 2.8
1913 # @replication: Since 2.8
1914 # @ssh: Since 2.8
1916 # Since: 2.0
1918 { 'enum': 'BlockdevDriver',
1919   'data': [ 'archipelago', 'blkdebug', 'blkverify', 'bochs', 'cloop',
1920             'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
1921             'host_device', 'http', 'https', 'luks', 'nbd', 'nfs', 'null-aio',
1922             'null-co', 'parallels', 'qcow', 'qcow2', 'qed', 'quorum', 'raw',
1923             'replication', 'ssh', 'vdi', 'vhdx', 'vmdk', 'vpc',
1924             'vvfat' ] }
1927 # @BlockdevOptionsFile:
1929 # Driver specific block device options for the file backend.
1931 # @filename:    path to the image file
1932 # @aio:         #optional AIO backend (default: threads) (since: 2.8)
1934 # Since: 1.7
1936 { 'struct': 'BlockdevOptionsFile',
1937   'data': { 'filename': 'str',
1938             '*aio': 'BlockdevAioOptions' } }
1941 # @BlockdevOptionsNull:
1943 # Driver specific block device options for the null backend.
1945 # @size:    #optional size of the device in bytes.
1946 # @latency-ns: #optional emulated latency (in nanoseconds) in processing
1947 #              requests. Default to zero which completes requests immediately.
1948 #              (Since 2.4)
1950 # Since: 2.2
1952 { 'struct': 'BlockdevOptionsNull',
1953   'data': { '*size': 'int', '*latency-ns': 'uint64' } }
1956 # @BlockdevOptionsVVFAT:
1958 # Driver specific block device options for the vvfat protocol.
1960 # @dir:         directory to be exported as FAT image
1961 # @fat-type:    #optional FAT type: 12, 16 or 32
1962 # @floppy:      #optional whether to export a floppy image (true) or
1963 #               partitioned hard disk (false; default)
1964 # @label:       #optional set the volume label, limited to 11 bytes. FAT16 and
1965 #               FAT32 traditionally have some restrictions on labels, which are
1966 #               ignored by most operating systems. Defaults to "QEMU VVFAT".
1967 #               (since 2.4)
1968 # @rw:          #optional whether to allow write operations (default: false)
1970 # Since: 1.7
1972 { 'struct': 'BlockdevOptionsVVFAT',
1973   'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
1974             '*label': 'str', '*rw': 'bool' } }
1977 # @BlockdevOptionsGenericFormat:
1979 # Driver specific block device options for image format that have no option
1980 # besides their data source.
1982 # @file:        reference to or definition of the data source block device
1984 # Since: 1.7
1986 { 'struct': 'BlockdevOptionsGenericFormat',
1987   'data': { 'file': 'BlockdevRef' } }
1990 # @BlockdevOptionsLUKS:
1992 # Driver specific block device options for LUKS.
1994 # @key-secret: #optional the ID of a QCryptoSecret object providing
1995 #              the decryption key (since 2.6). Mandatory except when
1996 #              doing a metadata-only probe of the image.
1998 # Since: 2.6
2000 { 'struct': 'BlockdevOptionsLUKS',
2001   'base': 'BlockdevOptionsGenericFormat',
2002   'data': { '*key-secret': 'str' } }
2006 # @BlockdevOptionsGenericCOWFormat:
2008 # Driver specific block device options for image format that have no option
2009 # besides their data source and an optional backing file.
2011 # @backing:     #optional reference to or definition of the backing file block
2012 #               device (if missing, taken from the image file content). It is
2013 #               allowed to pass an empty string here in order to disable the
2014 #               default backing file.
2016 # Since: 1.7
2018 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2019   'base': 'BlockdevOptionsGenericFormat',
2020   'data': { '*backing': 'BlockdevRef' } }
2023 # @Qcow2OverlapCheckMode:
2025 # General overlap check modes.
2027 # @none:        Do not perform any checks
2029 # @constant:    Perform only checks which can be done in constant time and
2030 #               without reading anything from disk
2032 # @cached:      Perform only checks which can be done without reading anything
2033 #               from disk
2035 # @all:         Perform all available overlap checks
2037 # Since: 2.2
2039 { 'enum': 'Qcow2OverlapCheckMode',
2040   'data': [ 'none', 'constant', 'cached', 'all' ] }
2043 # @Qcow2OverlapCheckFlags:
2045 # Structure of flags for each metadata structure. Setting a field to 'true'
2046 # makes qemu guard that structure against unintended overwriting. The default
2047 # value is chosen according to the template given.
2049 # @template: Specifies a template mode which can be adjusted using the other
2050 #            flags, defaults to 'cached'
2052 # Since: 2.2
2054 { 'struct': 'Qcow2OverlapCheckFlags',
2055   'data': { '*template':       'Qcow2OverlapCheckMode',
2056             '*main-header':    'bool',
2057             '*active-l1':      'bool',
2058             '*active-l2':      'bool',
2059             '*refcount-table': 'bool',
2060             '*refcount-block': 'bool',
2061             '*snapshot-table': 'bool',
2062             '*inactive-l1':    'bool',
2063             '*inactive-l2':    'bool' } }
2066 # @Qcow2OverlapChecks:
2068 # Specifies which metadata structures should be guarded against unintended
2069 # overwriting.
2071 # @flags:   set of flags for separate specification of each metadata structure
2072 #           type
2074 # @mode:    named mode which chooses a specific set of flags
2076 # Since: 2.2
2078 { 'alternate': 'Qcow2OverlapChecks',
2079   'data': { 'flags': 'Qcow2OverlapCheckFlags',
2080             'mode':  'Qcow2OverlapCheckMode' } }
2083 # @BlockdevOptionsQcow2:
2085 # Driver specific block device options for qcow2.
2087 # @lazy-refcounts:        #optional whether to enable the lazy refcounts
2088 #                         feature (default is taken from the image file)
2090 # @pass-discard-request:  #optional whether discard requests to the qcow2
2091 #                         device should be forwarded to the data source
2093 # @pass-discard-snapshot: #optional whether discard requests for the data source
2094 #                         should be issued when a snapshot operation (e.g.
2095 #                         deleting a snapshot) frees clusters in the qcow2 file
2097 # @pass-discard-other:    #optional whether discard requests for the data source
2098 #                         should be issued on other occasions where a cluster
2099 #                         gets freed
2101 # @overlap-check:         #optional which overlap checks to perform for writes
2102 #                         to the image, defaults to 'cached' (since 2.2)
2104 # @cache-size:            #optional the maximum total size of the L2 table and
2105 #                         refcount block caches in bytes (since 2.2)
2107 # @l2-cache-size:         #optional the maximum size of the L2 table cache in
2108 #                         bytes (since 2.2)
2110 # @refcount-cache-size:   #optional the maximum size of the refcount block cache
2111 #                         in bytes (since 2.2)
2113 # @cache-clean-interval:  #optional clean unused entries in the L2 and refcount
2114 #                         caches. The interval is in seconds. The default value
2115 #                         is 0 and it disables this feature (since 2.5)
2117 # Since: 1.7
2119 { 'struct': 'BlockdevOptionsQcow2',
2120   'base': 'BlockdevOptionsGenericCOWFormat',
2121   'data': { '*lazy-refcounts': 'bool',
2122             '*pass-discard-request': 'bool',
2123             '*pass-discard-snapshot': 'bool',
2124             '*pass-discard-other': 'bool',
2125             '*overlap-check': 'Qcow2OverlapChecks',
2126             '*cache-size': 'int',
2127             '*l2-cache-size': 'int',
2128             '*refcount-cache-size': 'int',
2129             '*cache-clean-interval': 'int' } }
2133 # @BlockdevOptionsArchipelago:
2135 # Driver specific block device options for Archipelago.
2137 # @volume:              Name of the Archipelago volume image
2139 # @mport:               #optional The port number on which mapperd is
2140 #                       listening. This is optional
2141 #                       and if not specified, QEMU will make Archipelago
2142 #                       use the default port (1001).
2144 # @vport:               #optional The port number on which vlmcd is
2145 #                       listening. This is optional
2146 #                       and if not specified, QEMU will make Archipelago
2147 #                       use the default port (501).
2149 # @segment:             #optional The name of the shared memory segment
2150 #                       Archipelago stack is using. This is optional
2151 #                       and if not specified, QEMU will make Archipelago
2152 #                       use the default value, 'archipelago'.
2153 # Since: 2.2
2155 { 'struct': 'BlockdevOptionsArchipelago',
2156   'data': { 'volume': 'str',
2157             '*mport': 'int',
2158             '*vport': 'int',
2159             '*segment': 'str' } }
2162 # @BlockdevOptionsSsh:
2164 # @server:              host address
2166 # @path:                path to the image on the host
2168 # @user:                #optional user as which to connect, defaults to current
2169 #                       local user name
2171 # TODO: Expose the host_key_check option in QMP
2173 # Since: 2.8
2175 { 'struct': 'BlockdevOptionsSsh',
2176   'data': { 'server': 'InetSocketAddress',
2177             'path': 'str',
2178             '*user': 'str' } }
2182 # @BlkdebugEvent:
2184 # Trigger events supported by blkdebug.
2186 # Since: 2.0
2188 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
2189   'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
2190             'l1_grow_activate_table', 'l2_load', 'l2_update',
2191             'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
2192             'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
2193             'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
2194             'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
2195             'refblock_load', 'refblock_update', 'refblock_update_part',
2196             'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
2197             'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
2198             'refblock_alloc_switch_table', 'cluster_alloc',
2199             'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
2200             'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
2201             'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
2202             'pwritev_zero', 'pwritev_done', 'empty_image_prepare' ] }
2205 # @BlkdebugInjectErrorOptions:
2207 # Describes a single error injection for blkdebug.
2209 # @event:       trigger event
2211 # @state:       #optional the state identifier blkdebug needs to be in to
2212 #               actually trigger the event; defaults to "any"
2214 # @errno:       #optional error identifier (errno) to be returned; defaults to
2215 #               EIO
2217 # @sector:      #optional specifies the sector index which has to be affected
2218 #               in order to actually trigger the event; defaults to "any
2219 #               sector"
2221 # @once:        #optional disables further events after this one has been
2222 #               triggered; defaults to false
2224 # @immediately: #optional fail immediately; defaults to false
2226 # Since: 2.0
2228 { 'struct': 'BlkdebugInjectErrorOptions',
2229   'data': { 'event': 'BlkdebugEvent',
2230             '*state': 'int',
2231             '*errno': 'int',
2232             '*sector': 'int',
2233             '*once': 'bool',
2234             '*immediately': 'bool' } }
2237 # @BlkdebugSetStateOptions:
2239 # Describes a single state-change event for blkdebug.
2241 # @event:       trigger event
2243 # @state:       #optional the current state identifier blkdebug needs to be in;
2244 #               defaults to "any"
2246 # @new_state:   the state identifier blkdebug is supposed to assume if
2247 #               this event is triggered
2249 # Since: 2.0
2251 { 'struct': 'BlkdebugSetStateOptions',
2252   'data': { 'event': 'BlkdebugEvent',
2253             '*state': 'int',
2254             'new_state': 'int' } }
2257 # @BlockdevOptionsBlkdebug:
2259 # Driver specific block device options for blkdebug.
2261 # @image:           underlying raw block device (or image file)
2263 # @config:          #optional filename of the configuration file
2265 # @align:           #optional required alignment for requests in bytes,
2266 #                   must be power of 2, or 0 for default
2268 # @inject-error:    #optional array of error injection descriptions
2270 # @set-state:       #optional array of state-change descriptions
2272 # Since: 2.0
2274 { 'struct': 'BlockdevOptionsBlkdebug',
2275   'data': { 'image': 'BlockdevRef',
2276             '*config': 'str',
2277             '*align': 'int',
2278             '*inject-error': ['BlkdebugInjectErrorOptions'],
2279             '*set-state': ['BlkdebugSetStateOptions'] } }
2282 # @BlockdevOptionsBlkverify:
2284 # Driver specific block device options for blkverify.
2286 # @test:    block device to be tested
2288 # @raw:     raw image used for verification
2290 # Since: 2.0
2292 { 'struct': 'BlockdevOptionsBlkverify',
2293   'data': { 'test': 'BlockdevRef',
2294             'raw': 'BlockdevRef' } }
2297 # @QuorumReadPattern:
2299 # An enumeration of quorum read patterns.
2301 # @quorum: read all the children and do a quorum vote on reads
2303 # @fifo: read only from the first child that has not failed
2305 # Since: 2.2
2307 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
2310 # @BlockdevOptionsQuorum:
2312 # Driver specific block device options for Quorum
2314 # @blkverify:      #optional true if the driver must print content mismatch
2315 #                  set to false by default
2317 # @children:       the children block devices to use
2319 # @vote-threshold: the vote limit under which a read will fail
2321 # @rewrite-corrupted: #optional rewrite corrupted data when quorum is reached
2322 #                     (Since 2.1)
2324 # @read-pattern: #optional choose read pattern and set to quorum by default
2325 #                (Since 2.2)
2327 # Since: 2.0
2329 { 'struct': 'BlockdevOptionsQuorum',
2330   'data': { '*blkverify': 'bool',
2331             'children': [ 'BlockdevRef' ],
2332             'vote-threshold': 'int',
2333             '*rewrite-corrupted': 'bool',
2334             '*read-pattern': 'QuorumReadPattern' } }
2337 # @GlusterTransport:
2339 # An enumeration of Gluster transport types
2341 # @tcp:   TCP   - Transmission Control Protocol
2343 # @unix:  UNIX  - Unix domain socket
2345 # Since: 2.7
2347 { 'enum': 'GlusterTransport',
2348   'data': [ 'unix', 'tcp' ] }
2352 # @GlusterServer:
2354 # Captures the address of a socket
2356 # Details for connecting to a gluster server
2358 # @type:       Transport type used for gluster connection
2360 # This is similar to SocketAddress, only distinction:
2362 # 1. GlusterServer is a flat union, SocketAddress is a simple union.
2363 #    A flat union is nicer than simple because it avoids nesting
2364 #    (i.e. more {}) on the wire.
2366 # 2. GlusterServer lacks case 'fd', since gluster doesn't let you
2367 #    pass in a file descriptor.
2369 # GlusterServer is actually not Gluster-specific, its a
2370 # compatibility evolved into an alternate for SocketAddress.
2372 # Since: 2.7
2374 { 'union': 'GlusterServer',
2375   'base': { 'type': 'GlusterTransport' },
2376   'discriminator': 'type',
2377   'data': { 'unix': 'UnixSocketAddress',
2378             'tcp': 'InetSocketAddress' } }
2381 # @BlockdevOptionsGluster:
2383 # Driver specific block device options for Gluster
2385 # @volume:      name of gluster volume where VM image resides
2387 # @path:        absolute path to image file in gluster volume
2389 # @server:      gluster servers description
2391 # @debug:       #optional libgfapi log level (default '4' which is Error)
2392 #               (Since 2.8)
2394 # @logfile:     #optional libgfapi log file (default /dev/stderr) (Since 2.8)
2396 # Since: 2.7
2398 { 'struct': 'BlockdevOptionsGluster',
2399   'data': { 'volume': 'str',
2400             'path': 'str',
2401             'server': ['GlusterServer'],
2402             '*debug': 'int',
2403             '*logfile': 'str' } }
2406 # @ReplicationMode:
2408 # An enumeration of replication modes.
2410 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
2412 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
2414 # Since: 2.8
2416 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
2419 # @BlockdevOptionsReplication:
2421 # Driver specific block device options for replication
2423 # @mode: the replication mode
2425 # @top-id: #optional In secondary mode, node name or device ID of the root
2426 #          node who owns the replication node chain. Must not be given in
2427 #          primary mode.
2429 # Since: 2.8
2431 { 'struct': 'BlockdevOptionsReplication',
2432   'base': 'BlockdevOptionsGenericFormat',
2433   'data': { 'mode': 'ReplicationMode',
2434             '*top-id': 'str' } }
2437 # @NFSTransport:
2439 # An enumeration of NFS transport types
2441 # @inet:        TCP transport
2443 # Since: 2.8
2445 { 'enum': 'NFSTransport',
2446   'data': [ 'inet' ] }
2449 # @NFSServer:
2451 # Captures the address of the socket
2453 # @type:        transport type used for NFS (only TCP supported)
2455 # @host:        host address for NFS server
2457 # Since: 2.8
2459 { 'struct': 'NFSServer',
2460   'data': { 'type': 'NFSTransport',
2461             'host': 'str' } }
2464 # @BlockdevOptionsNfs:
2466 # Driver specific block device option for NFS
2468 # @server:                  host address
2470 # @path:                    path of the image on the host
2472 # @user:                    #optional UID value to use when talking to the
2473 #                           server (defaults to 65534 on Windows and getuid()
2474 #                           on unix)
2476 # @group:                   #optional GID value to use when talking to the
2477 #                           server (defaults to 65534 on Windows and getgid()
2478 #                           in unix)
2480 # @tcp-syn-count:           #optional number of SYNs during the session
2481 #                           establishment (defaults to libnfs default)
2483 # @readahead-size:          #optional set the readahead size in bytes (defaults
2484 #                           to libnfs default)
2486 # @page-cache-size:         #optional set the pagecache size in bytes (defaults
2487 #                           to libnfs default)
2489 # @debug:                   #optional set the NFS debug level (max 2) (defaults
2490 #                           to libnfs default)
2492 # Since: 2.8
2494 { 'struct': 'BlockdevOptionsNfs',
2495   'data': { 'server': 'NFSServer',
2496             'path': 'str',
2497             '*user': 'int',
2498             '*group': 'int',
2499             '*tcp-syn-count': 'int',
2500             '*readahead-size': 'int',
2501             '*page-cache-size': 'int',
2502             '*debug': 'int' } }
2505 # @BlockdevOptionsCurl:
2507 # Driver specific block device options for the curl backend.
2509 # @filename:    path to the image file
2511 # Since: 1.7
2513 { 'struct': 'BlockdevOptionsCurl',
2514   'data': { 'filename': 'str' } }
2517 # @BlockdevOptionsNbd:
2519 # Driver specific block device options for NBD.
2521 # @server:      NBD server address
2523 # @export:      #optional export name
2525 # @tls-creds:   #optional TLS credentials ID
2527 # Since: 2.8
2529 { 'struct': 'BlockdevOptionsNbd',
2530   'data': { 'server': 'SocketAddress',
2531             '*export': 'str',
2532             '*tls-creds': 'str' } }
2535 # @BlockdevOptionsRaw:
2537 # Driver specific block device options for the raw driver.
2539 # @offset:      #optional position where the block device starts
2540 # @size:        #optional the assumed size of the device
2542 # Since: 2.8
2544 { 'struct': 'BlockdevOptionsRaw',
2545   'base': 'BlockdevOptionsGenericFormat',
2546   'data': { '*offset': 'int', '*size': 'int' } }
2549 # @BlockdevOptions:
2551 # Options for creating a block device.  Many options are available for all
2552 # block devices, independent of the block driver:
2554 # @driver:        block driver name
2555 # @node-name:     #optional the node name of the new node (Since 2.0).
2556 #                 This option is required on the top level of blockdev-add.
2557 # @discard:       #optional discard-related options (default: ignore)
2558 # @cache:         #optional cache-related options
2559 # @read-only:     #optional whether the block device should be read-only
2560 #                 (default: false)
2561 # @detect-zeroes: #optional detect and optimize zero writes (Since 2.1)
2562 #                 (default: off)
2564 # Remaining options are determined by the block driver.
2566 # Since: 1.7
2568 { 'union': 'BlockdevOptions',
2569   'base': { 'driver': 'BlockdevDriver',
2570             '*node-name': 'str',
2571             '*discard': 'BlockdevDiscardOptions',
2572             '*cache': 'BlockdevCacheOptions',
2573             '*read-only': 'bool',
2574             '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
2575   'discriminator': 'driver',
2576   'data': {
2577       'archipelago':'BlockdevOptionsArchipelago',
2578       'blkdebug':   'BlockdevOptionsBlkdebug',
2579       'blkverify':  'BlockdevOptionsBlkverify',
2580       'bochs':      'BlockdevOptionsGenericFormat',
2581       'cloop':      'BlockdevOptionsGenericFormat',
2582       'dmg':        'BlockdevOptionsGenericFormat',
2583       'file':       'BlockdevOptionsFile',
2584       'ftp':        'BlockdevOptionsCurl',
2585       'ftps':       'BlockdevOptionsCurl',
2586       'gluster':    'BlockdevOptionsGluster',
2587       'host_cdrom': 'BlockdevOptionsFile',
2588       'host_device':'BlockdevOptionsFile',
2589       'http':       'BlockdevOptionsCurl',
2590       'https':      'BlockdevOptionsCurl',
2591 # TODO iscsi: Wait for structured options
2592       'luks':       'BlockdevOptionsLUKS',
2593       'nbd':        'BlockdevOptionsNbd',
2594       'nfs':        'BlockdevOptionsNfs',
2595       'null-aio':   'BlockdevOptionsNull',
2596       'null-co':    'BlockdevOptionsNull',
2597       'parallels':  'BlockdevOptionsGenericFormat',
2598       'qcow2':      'BlockdevOptionsQcow2',
2599       'qcow':       'BlockdevOptionsGenericCOWFormat',
2600       'qed':        'BlockdevOptionsGenericCOWFormat',
2601       'quorum':     'BlockdevOptionsQuorum',
2602       'raw':        'BlockdevOptionsRaw',
2603 # TODO rbd: Wait for structured options
2604       'replication':'BlockdevOptionsReplication',
2605 # TODO sheepdog: Wait for structured options
2606       'ssh':        'BlockdevOptionsSsh',
2607       'vdi':        'BlockdevOptionsGenericFormat',
2608       'vhdx':       'BlockdevOptionsGenericFormat',
2609       'vmdk':       'BlockdevOptionsGenericCOWFormat',
2610       'vpc':        'BlockdevOptionsGenericFormat',
2611       'vvfat':      'BlockdevOptionsVVFAT'
2612   } }
2615 # @BlockdevRef:
2617 # Reference to a block device.
2619 # @definition:      defines a new block device inline
2620 # @reference:       references the ID of an existing block device. An
2621 #                   empty string means that no block device should be
2622 #                   referenced.
2624 # Since: 1.7
2626 { 'alternate': 'BlockdevRef',
2627   'data': { 'definition': 'BlockdevOptions',
2628             'reference': 'str' } }
2631 # @blockdev-add:
2633 # Creates a new block device. If the @id option is given at the top level, a
2634 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
2635 # level and no BlockBackend will be created.
2637 # For the arguments, see the documentation of BlockdevOptions.
2639 # Note: This command is still a work in progress.  It doesn't support all
2640 # block drivers among other things.  Stay away from it unless you want
2641 # to help with its development.
2643 # Since: 1.7
2645 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
2648 # @x-blockdev-del:
2650 # Deletes a block device that has been added using blockdev-add.
2651 # The command will fail if the node is attached to a device or is
2652 # otherwise being used.
2654 # @node-name: Name of the graph node to delete.
2656 # Note: This command is still a work in progress and is considered
2657 # experimental. Stay away from it unless you want to help with its
2658 # development.
2660 # Since: 2.5
2662 { 'command': 'x-blockdev-del', 'data': { 'node-name': 'str' } }
2665 # @blockdev-open-tray:
2667 # Opens a block device's tray. If there is a block driver state tree inserted as
2668 # a medium, it will become inaccessible to the guest (but it will remain
2669 # associated to the block device, so closing the tray will make it accessible
2670 # again).
2672 # If the tray was already open before, this will be a no-op.
2674 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
2675 # which no such event will be generated, these include:
2676 # - if the guest has locked the tray, @force is false and the guest does not
2677 #   respond to the eject request
2678 # - if the BlockBackend denoted by @device does not have a guest device attached
2679 #   to it
2680 # - if the guest device does not have an actual tray
2682 # @device: #optional Block device name (deprecated, use @id instead)
2684 # @id:     #optional The name or QOM path of the guest device (since: 2.8)
2686 # @force:  #optional if false (the default), an eject request will be sent to
2687 #          the guest if it has locked the tray (and the tray will not be opened
2688 #          immediately); if true, the tray will be opened regardless of whether
2689 #          it is locked
2691 # Since: 2.5
2693 { 'command': 'blockdev-open-tray',
2694   'data': { '*device': 'str',
2695             '*id': 'str',
2696             '*force': 'bool' } }
2699 # @blockdev-close-tray:
2701 # Closes a block device's tray. If there is a block driver state tree associated
2702 # with the block device (which is currently ejected), that tree will be loaded
2703 # as the medium.
2705 # If the tray was already closed before, this will be a no-op.
2707 # @device:  #optional Block device name (deprecated, use @id instead)
2709 # @id:      #optional The name or QOM path of the guest device (since: 2.8)
2711 # Since: 2.5
2713 { 'command': 'blockdev-close-tray',
2714   'data': { '*device': 'str',
2715             '*id': 'str' } }
2718 # @x-blockdev-remove-medium:
2720 # Removes a medium (a block driver state tree) from a block device. That block
2721 # device's tray must currently be open (unless there is no attached guest
2722 # device).
2724 # If the tray is open and there is no medium inserted, this will be a no-op.
2726 # @device: #optional Block device name (deprecated, use @id instead)
2728 # @id:     #optional The name or QOM path of the guest device (since: 2.8)
2730 # Note: This command is still a work in progress and is considered experimental.
2731 # Stay away from it unless you want to help with its development.
2733 # Since: 2.5
2735 { 'command': 'x-blockdev-remove-medium',
2736   'data': { '*device': 'str',
2737             '*id': 'str' } }
2740 # @x-blockdev-insert-medium:
2742 # Inserts a medium (a block driver state tree) into a block device. That block
2743 # device's tray must currently be open (unless there is no attached guest
2744 # device) and there must be no medium inserted already.
2746 # @device:    #optional Block device name (deprecated, use @id instead)
2748 # @id:        #optional The name or QOM path of the guest device (since: 2.8)
2750 # @node-name: name of a node in the block driver state graph
2752 # Note: This command is still a work in progress and is considered experimental.
2753 # Stay away from it unless you want to help with its development.
2755 # Since: 2.5
2757 { 'command': 'x-blockdev-insert-medium',
2758   'data': { '*device': 'str',
2759             '*id': 'str',
2760             'node-name': 'str'} }
2764 # @BlockdevChangeReadOnlyMode:
2766 # Specifies the new read-only mode of a block device subject to the
2767 # @blockdev-change-medium command.
2769 # @retain:      Retains the current read-only mode
2771 # @read-only:   Makes the device read-only
2773 # @read-write:  Makes the device writable
2775 # Since: 2.3
2777 { 'enum': 'BlockdevChangeReadOnlyMode',
2778   'data': ['retain', 'read-only', 'read-write'] }
2782 # @blockdev-change-medium:
2784 # Changes the medium inserted into a block device by ejecting the current medium
2785 # and loading a new image file which is inserted as the new medium (this command
2786 # combines blockdev-open-tray, x-blockdev-remove-medium,
2787 # x-blockdev-insert-medium and blockdev-close-tray).
2789 # @device:          #optional Block device name (deprecated, use @id instead)
2791 # @id:              #optional The name or QOM path of the guest device
2792 #                   (since: 2.8)
2794 # @filename:        filename of the new image to be loaded
2796 # @format:          #optional, format to open the new image with (defaults to
2797 #                   the probed format)
2799 # @read-only-mode:  #optional, change the read-only mode of the device; defaults
2800 #                   to 'retain'
2802 # Since: 2.5
2804 { 'command': 'blockdev-change-medium',
2805   'data': { '*device': 'str',
2806             '*id': 'str',
2807             'filename': 'str',
2808             '*format': 'str',
2809             '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
2813 # @BlockErrorAction:
2815 # An enumeration of action that has been taken when a DISK I/O occurs
2817 # @ignore: error has been ignored
2819 # @report: error has been reported to the device
2821 # @stop: error caused VM to be stopped
2823 # Since: 2.1
2825 { 'enum': 'BlockErrorAction',
2826   'data': [ 'ignore', 'report', 'stop' ] }
2830 # @BLOCK_IMAGE_CORRUPTED:
2832 # Emitted when a corruption has been detected in a disk image
2834 # @device: device name. This is always present for compatibility
2835 #          reasons, but it can be empty ("") if the image does not
2836 #          have a device name associated.
2838 # @node-name: #optional node name (Since: 2.4)
2840 # @msg: informative message for human consumption, such as the kind of
2841 #       corruption being detected. It should not be parsed by machine as it is
2842 #       not guaranteed to be stable
2844 # @offset: #optional, if the corruption resulted from an image access, this is
2845 #          the host's access offset into the image
2847 # @size: #optional, if the corruption resulted from an image access, this is
2848 #        the access size
2850 # fatal: if set, the image is marked corrupt and therefore unusable after this
2851 #        event and must be repaired (Since 2.2; before, every
2852 #        BLOCK_IMAGE_CORRUPTED event was fatal)
2854 # Since: 1.7
2856 { 'event': 'BLOCK_IMAGE_CORRUPTED',
2857   'data': { 'device'     : 'str',
2858             '*node-name' : 'str',
2859             'msg'        : 'str',
2860             '*offset'    : 'int',
2861             '*size'      : 'int',
2862             'fatal'      : 'bool' } }
2865 # @BLOCK_IO_ERROR:
2867 # Emitted when a disk I/O error occurs
2869 # @device: device name. This is always present for compatibility
2870 #          reasons, but it can be empty ("") if the image does not
2871 #          have a device name associated.
2873 # @node-name: node name. Note that errors may be reported for the root node
2874 #             that is directly attached to a guest device rather than for the
2875 #             node where the error occurred. (Since: 2.8)
2877 # @operation: I/O operation
2879 # @action: action that has been taken
2881 # @nospace: #optional true if I/O error was caused due to a no-space
2882 #           condition. This key is only present if query-block's
2883 #           io-status is present, please see query-block documentation
2884 #           for more information (since: 2.2)
2886 # @reason: human readable string describing the error cause.
2887 #          (This field is a debugging aid for humans, it should not
2888 #           be parsed by applications) (since: 2.2)
2890 # Note: If action is "stop", a STOP event will eventually follow the
2891 # BLOCK_IO_ERROR event
2893 # Since: 0.13.0
2895 { 'event': 'BLOCK_IO_ERROR',
2896   'data': { 'device': 'str', 'node-name': 'str', 'operation': 'IoOperationType',
2897             'action': 'BlockErrorAction', '*nospace': 'bool',
2898             'reason': 'str' } }
2901 # @BLOCK_JOB_COMPLETED:
2903 # Emitted when a block job has completed
2905 # @type: job type
2907 # @device: The job identifier. Originally the device name but other
2908 #          values are allowed since QEMU 2.7
2910 # @len: maximum progress value
2912 # @offset: current progress value. On success this is equal to len.
2913 #          On failure this is less than len
2915 # @speed: rate limit, bytes per second
2917 # @error: #optional, error message. Only present on failure. This field
2918 #         contains a human-readable error message. There are no semantics
2919 #         other than that streaming has failed and clients should not try to
2920 #         interpret the error string
2922 # Since: 1.1
2924 { 'event': 'BLOCK_JOB_COMPLETED',
2925   'data': { 'type'  : 'BlockJobType',
2926             'device': 'str',
2927             'len'   : 'int',
2928             'offset': 'int',
2929             'speed' : 'int',
2930             '*error': 'str' } }
2933 # @BLOCK_JOB_CANCELLED:
2935 # Emitted when a block job has been cancelled
2937 # @type: job type
2939 # @device: The job identifier. Originally the device name but other
2940 #          values are allowed since QEMU 2.7
2942 # @len: maximum progress value
2944 # @offset: current progress value. On success this is equal to len.
2945 #          On failure this is less than len
2947 # @speed: rate limit, bytes per second
2949 # Since: 1.1
2951 { 'event': 'BLOCK_JOB_CANCELLED',
2952   'data': { 'type'  : 'BlockJobType',
2953             'device': 'str',
2954             'len'   : 'int',
2955             'offset': 'int',
2956             'speed' : 'int' } }
2959 # @BLOCK_JOB_ERROR:
2961 # Emitted when a block job encounters an error
2963 # @device: The job identifier. Originally the device name but other
2964 #          values are allowed since QEMU 2.7
2966 # @operation: I/O operation
2968 # @action: action that has been taken
2970 # Since: 1.3
2972 { 'event': 'BLOCK_JOB_ERROR',
2973   'data': { 'device'   : 'str',
2974             'operation': 'IoOperationType',
2975             'action'   : 'BlockErrorAction' } }
2978 # @BLOCK_JOB_READY:
2980 # Emitted when a block job is ready to complete
2982 # @type: job type
2984 # @device: The job identifier. Originally the device name but other
2985 #          values are allowed since QEMU 2.7
2987 # @len: maximum progress value
2989 # @offset: current progress value. On success this is equal to len.
2990 #          On failure this is less than len
2992 # @speed: rate limit, bytes per second
2994 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
2995 # event
2997 # Since: 1.3
2999 { 'event': 'BLOCK_JOB_READY',
3000   'data': { 'type'  : 'BlockJobType',
3001             'device': 'str',
3002             'len'   : 'int',
3003             'offset': 'int',
3004             'speed' : 'int' } }
3007 # @PreallocMode:
3009 # Preallocation mode of QEMU image file
3011 # @off: no preallocation
3012 # @metadata: preallocate only for metadata
3013 # @falloc: like @full preallocation but allocate disk space by
3014 #          posix_fallocate() rather than writing zeros.
3015 # @full: preallocate all data by writing zeros to device to ensure disk
3016 #        space is really available. @full preallocation also sets up
3017 #        metadata correctly.
3019 # Since: 2.2
3021 { 'enum': 'PreallocMode',
3022   'data': [ 'off', 'metadata', 'falloc', 'full' ] }
3025 # @BLOCK_WRITE_THRESHOLD:
3027 # Emitted when writes on block device reaches or exceeds the
3028 # configured write threshold. For thin-provisioned devices, this
3029 # means the device should be extended to avoid pausing for
3030 # disk exhaustion.
3031 # The event is one shot. Once triggered, it needs to be
3032 # re-registered with another block-set-threshold command.
3034 # @node-name: graph node name on which the threshold was exceeded.
3036 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
3038 # @write-threshold: last configured threshold, in bytes.
3040 # Since: 2.3
3042 { 'event': 'BLOCK_WRITE_THRESHOLD',
3043   'data': { 'node-name': 'str',
3044             'amount-exceeded': 'uint64',
3045             'write-threshold': 'uint64' } }
3048 # @block-set-write-threshold:
3050 # Change the write threshold for a block drive. An event will be delivered
3051 # if a write to this block drive crosses the configured threshold.
3052 # This is useful to transparently resize thin-provisioned drives without
3053 # the guest OS noticing.
3055 # @node-name: graph node name on which the threshold must be set.
3057 # @write-threshold: configured threshold for the block device, bytes.
3058 #                   Use 0 to disable the threshold.
3060 # Since: 2.3
3062 { 'command': 'block-set-write-threshold',
3063   'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
3066 # @x-blockdev-change:
3068 # Dynamically reconfigure the block driver state graph. It can be used
3069 # to add, remove, insert or replace a graph node. Currently only the
3070 # Quorum driver implements this feature to add or remove its child. This
3071 # is useful to fix a broken quorum child.
3073 # If @node is specified, it will be inserted under @parent. @child
3074 # may not be specified in this case. If both @parent and @child are
3075 # specified but @node is not, @child will be detached from @parent.
3077 # @parent: the id or name of the parent node.
3079 # @child: #optional the name of a child under the given parent node.
3081 # @node: #optional the name of the node that will be added.
3083 # Note: this command is experimental, and its API is not stable. It
3084 # does not support all kinds of operations, all kinds of children, nor
3085 # all block drivers.
3087 # Warning: The data in a new quorum child MUST be consistent with that of
3088 # the rest of the array.
3090 # Since: 2.7
3092 { 'command': 'x-blockdev-change',
3093   'data' : { 'parent': 'str',
3094              '*child': 'str',
3095              '*node': 'str' } }