target/arm/kvm: pmu: split init and set-irq stages
[qemu/ar7.git] / qapi / block-core.json
blob28abb9e6cf38720e99af1f93a2859de8c4d9f0e2
1 # -*- Mode: Python -*-
3 ##
4 # == Block core (VM unrelated)
5 ##
7 { 'include': 'common.json' }
8 { 'include': 'crypto.json' }
9 { 'include': 'sockets.json' }
12 # @SnapshotInfo:
14 # @id: unique snapshot id
16 # @name: user chosen name
18 # @vm-state-size: size of the VM state
20 # @date-sec: UTC date of the snapshot in seconds
22 # @date-nsec: fractional part in nano seconds to be used with date-sec
24 # @vm-clock-sec: VM clock relative to boot in seconds
26 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
28 # Since: 1.3
31 { 'struct': 'SnapshotInfo',
32   'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
33             'date-sec': 'int', 'date-nsec': 'int',
34             'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
37 # @ImageInfoSpecificQCow2EncryptionBase:
39 # @format: The encryption format
41 # Since: 2.10
43 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
44   'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
47 # @ImageInfoSpecificQCow2Encryption:
49 # Since: 2.10
51 { 'union': 'ImageInfoSpecificQCow2Encryption',
52   'base': 'ImageInfoSpecificQCow2EncryptionBase',
53   'discriminator': 'format',
54   'data': { 'aes': 'QCryptoBlockInfoQCow',
55             'luks': 'QCryptoBlockInfoLUKS' } }
58 # @ImageInfoSpecificQCow2:
60 # @compat: compatibility level
62 # @lazy-refcounts: on or off; only valid for compat >= 1.1
64 # @corrupt: true if the image has been marked corrupt; only valid for
65 #           compat >= 1.1 (since 2.2)
67 # @refcount-bits: width of a refcount entry in bits (since 2.3)
69 # @encrypt: details about encryption parameters; only set if image
70 #           is encrypted (since 2.10)
72 # Since: 1.7
74 { 'struct': 'ImageInfoSpecificQCow2',
75   'data': {
76       'compat': 'str',
77       '*lazy-refcounts': 'bool',
78       '*corrupt': 'bool',
79       'refcount-bits': 'int',
80       '*encrypt': 'ImageInfoSpecificQCow2Encryption'
81   } }
84 # @ImageInfoSpecificVmdk:
86 # @create-type: The create type of VMDK image
88 # @cid: Content id of image
90 # @parent-cid: Parent VMDK image's cid
92 # @extents: List of extent files
94 # Since: 1.7
96 { 'struct': 'ImageInfoSpecificVmdk',
97   'data': {
98       'create-type': 'str',
99       'cid': 'int',
100       'parent-cid': 'int',
101       'extents': ['ImageInfo']
102   } }
105 # @ImageInfoSpecific:
107 # A discriminated record of image format specific information structures.
109 # Since: 1.7
111 { 'union': 'ImageInfoSpecific',
112   'data': {
113       'qcow2': 'ImageInfoSpecificQCow2',
114       'vmdk': 'ImageInfoSpecificVmdk',
115       # If we need to add block driver specific parameters for
116       # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
117       # to define a ImageInfoSpecificLUKS
118       'luks': 'QCryptoBlockInfoLUKS'
119   } }
122 # @ImageInfo:
124 # Information about a QEMU image file
126 # @filename: name of the image file
128 # @format: format of the image file
130 # @virtual-size: maximum capacity in bytes of the image
132 # @actual-size: actual size on disk in bytes of the image
134 # @dirty-flag: true if image is not cleanly closed
136 # @cluster-size: size of a cluster in bytes
138 # @encrypted: true if the image is encrypted
140 # @compressed: true if the image is compressed (Since 1.7)
142 # @backing-filename: name of the backing file
144 # @full-backing-filename: full path of the backing file
146 # @backing-filename-format: the format of the backing file
148 # @snapshots: list of VM snapshots
150 # @backing-image: info of the backing image (since 1.6)
152 # @format-specific: structure supplying additional format-specific
153 # information (since 1.7)
155 # Since: 1.3
158 { 'struct': 'ImageInfo',
159   'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
160            '*actual-size': 'int', 'virtual-size': 'int',
161            '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
162            '*backing-filename': 'str', '*full-backing-filename': 'str',
163            '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
164            '*backing-image': 'ImageInfo',
165            '*format-specific': 'ImageInfoSpecific' } }
168 # @ImageCheck:
170 # Information about a QEMU image file check
172 # @filename: name of the image file checked
174 # @format: format of the image file checked
176 # @check-errors: number of unexpected errors occurred during check
178 # @image-end-offset: offset (in bytes) where the image ends, this
179 #                    field is present if the driver for the image format
180 #                    supports it
182 # @corruptions: number of corruptions found during the check if any
184 # @leaks: number of leaks found during the check if any
186 # @corruptions-fixed: number of corruptions fixed during the check
187 #                     if any
189 # @leaks-fixed: number of leaks fixed during the check if any
191 # @total-clusters: total number of clusters, this field is present
192 #                  if the driver for the image format supports it
194 # @allocated-clusters: total number of allocated clusters, this
195 #                      field is present if the driver for the image format
196 #                      supports it
198 # @fragmented-clusters: total number of fragmented clusters, this
199 #                       field is present if the driver for the image format
200 #                       supports it
202 # @compressed-clusters: total number of compressed clusters, this
203 #                       field is present if the driver for the image format
204 #                       supports it
206 # Since: 1.4
209 { 'struct': 'ImageCheck',
210   'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
211            '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
212            '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
213            '*total-clusters': 'int', '*allocated-clusters': 'int',
214            '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
217 # @MapEntry:
219 # Mapping information from a virtual block range to a host file range
221 # @start: the start byte of the mapped virtual range
223 # @length: the number of bytes of the mapped virtual range
225 # @data: whether the mapped range has data
227 # @zero: whether the virtual blocks are zeroed
229 # @depth: the depth of the mapping
231 # @offset: the offset in file that the virtual sectors are mapped to
233 # @filename: filename that is referred to by @offset
235 # Since: 2.6
238 { 'struct': 'MapEntry',
239   'data': {'start': 'int', 'length': 'int', 'data': 'bool',
240            'zero': 'bool', 'depth': 'int', '*offset': 'int',
241            '*filename': 'str' } }
244 # @BlockdevCacheInfo:
246 # Cache mode information for a block device
248 # @writeback:   true if writeback mode is enabled
249 # @direct:      true if the host page cache is bypassed (O_DIRECT)
250 # @no-flush:    true if flush requests are ignored for the device
252 # Since: 2.3
254 { 'struct': 'BlockdevCacheInfo',
255   'data': { 'writeback': 'bool',
256             'direct': 'bool',
257             'no-flush': 'bool' } }
260 # @BlockDeviceInfo:
262 # Information about the backing device for a block device.
264 # @file: the filename of the backing device
266 # @node-name: the name of the block driver node (Since 2.0)
268 # @ro: true if the backing device was open read-only
270 # @drv: the name of the block format used to open the backing device. As of
271 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
272 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
273 #       'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
274 #       'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
275 #       2.2: 'archipelago' added, 'cow' dropped
276 #       2.3: 'host_floppy' deprecated
277 #       2.5: 'host_floppy' dropped
278 #       2.6: 'luks' added
279 #       2.8: 'replication' added, 'tftp' dropped
280 #       2.9: 'archipelago' dropped
282 # @backing_file: the name of the backing file (for copy-on-write)
284 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
286 # @encrypted: true if the backing device is encrypted
288 # @encryption_key_missing: Deprecated; always false
290 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
292 # @bps: total throughput limit in bytes per second is specified
294 # @bps_rd: read throughput limit in bytes per second is specified
296 # @bps_wr: write throughput limit in bytes per second is specified
298 # @iops: total I/O operations per second is specified
300 # @iops_rd: read I/O operations per second is specified
302 # @iops_wr: write I/O operations per second is specified
304 # @image: the info of image used (since: 1.6)
306 # @bps_max: total throughput limit during bursts,
307 #                     in bytes (Since 1.7)
309 # @bps_rd_max: read throughput limit during bursts,
310 #                        in bytes (Since 1.7)
312 # @bps_wr_max: write throughput limit during bursts,
313 #                        in bytes (Since 1.7)
315 # @iops_max: total I/O operations per second during bursts,
316 #                      in bytes (Since 1.7)
318 # @iops_rd_max: read I/O operations per second during bursts,
319 #                         in bytes (Since 1.7)
321 # @iops_wr_max: write I/O operations per second during bursts,
322 #                         in bytes (Since 1.7)
324 # @bps_max_length: maximum length of the @bps_max burst
325 #                            period, in seconds. (Since 2.6)
327 # @bps_rd_max_length: maximum length of the @bps_rd_max
328 #                               burst period, in seconds. (Since 2.6)
330 # @bps_wr_max_length: maximum length of the @bps_wr_max
331 #                               burst period, in seconds. (Since 2.6)
333 # @iops_max_length: maximum length of the @iops burst
334 #                             period, in seconds. (Since 2.6)
336 # @iops_rd_max_length: maximum length of the @iops_rd_max
337 #                                burst period, in seconds. (Since 2.6)
339 # @iops_wr_max_length: maximum length of the @iops_wr_max
340 #                                burst period, in seconds. (Since 2.6)
342 # @iops_size: an I/O size in bytes (Since 1.7)
344 # @group: throttle group name (Since 2.4)
346 # @cache: the cache mode used for the block device (since: 2.3)
348 # @write_threshold: configured write threshold for the device.
349 #                   0 if disabled. (Since 2.3)
351 # Since: 0.14.0
354 { 'struct': 'BlockDeviceInfo',
355   'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
356             '*backing_file': 'str', 'backing_file_depth': 'int',
357             'encrypted': 'bool', 'encryption_key_missing': 'bool',
358             'detect_zeroes': 'BlockdevDetectZeroesOptions',
359             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
360             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
361             'image': 'ImageInfo',
362             '*bps_max': 'int', '*bps_rd_max': 'int',
363             '*bps_wr_max': 'int', '*iops_max': 'int',
364             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
365             '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
366             '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
367             '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
368             '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
369             'write_threshold': 'int' } }
372 # @BlockDeviceIoStatus:
374 # An enumeration of block device I/O status.
376 # @ok: The last I/O operation has succeeded
378 # @failed: The last I/O operation has failed
380 # @nospace: The last I/O operation has failed due to a no-space condition
382 # Since: 1.0
384 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
387 # @BlockDeviceMapEntry:
389 # Entry in the metadata map of the device (returned by "qemu-img map")
391 # @start: Offset in the image of the first byte described by this entry
392 #         (in bytes)
394 # @length: Length of the range described by this entry (in bytes)
396 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
397 #         before reaching one for which the range is allocated.  The value is
398 #         in the range 0 to the depth of the image chain - 1.
400 # @zero: the sectors in this range read as zeros
402 # @data: reading the image will actually read data from a file (in particular,
403 #        if @offset is present this means that the sectors are not simply
404 #        preallocated, but contain actual data in raw format)
406 # @offset: if present, the image file stores the data for this range in
407 #          raw format at the given offset.
409 # Since: 1.7
411 { 'struct': 'BlockDeviceMapEntry',
412   'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
413             'data': 'bool', '*offset': 'int' } }
416 # @DirtyBitmapStatus:
418 # An enumeration of possible states that a dirty bitmap can report to the user.
420 # @frozen: The bitmap is currently in-use by a backup operation or block job,
421 #          and is immutable.
423 # @disabled: The bitmap is currently in-use by an internal operation and is
424 #            read-only. It can still be deleted.
426 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
427 #          deleted, or used for backup operations.
429 # Since: 2.4
431 { 'enum': 'DirtyBitmapStatus',
432   'data': ['active', 'disabled', 'frozen'] }
435 # @BlockDirtyInfo:
437 # Block dirty bitmap information.
439 # @name: the name of the dirty bitmap (Since 2.4)
441 # @count: number of dirty bytes according to the dirty bitmap
443 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
445 # @status: current status of the dirty bitmap (since 2.4)
447 # Since: 1.3
449 { 'struct': 'BlockDirtyInfo',
450   'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
451            'status': 'DirtyBitmapStatus'} }
454 # @BlockInfo:
456 # Block device information.  This structure describes a virtual device and
457 # the backing device associated with it.
459 # @device: The device name associated with the virtual device.
461 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
462 #        device. (since 2.10)
464 # @type: This field is returned only for compatibility reasons, it should
465 #        not be used (always returns 'unknown')
467 # @removable: True if the device supports removable media.
469 # @locked: True if the guest has locked this device from having its media
470 #          removed
472 # @tray_open: True if the device's tray is open
473 #             (only present if it has a tray)
475 # @dirty-bitmaps: dirty bitmaps information (only present if the
476 #                 driver has one or more dirty bitmaps) (Since 2.0)
478 # @io-status: @BlockDeviceIoStatus. Only present if the device
479 #             supports it and the VM is configured to stop on errors
480 #             (supported device models: virtio-blk, IDE, SCSI except
481 #             scsi-generic)
483 # @inserted: @BlockDeviceInfo describing the device if media is
484 #            present
486 # Since:  0.14.0
488 { 'struct': 'BlockInfo',
489   'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
490            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
491            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
492            '*dirty-bitmaps': ['BlockDirtyInfo'] } }
495 # @BlockMeasureInfo:
497 # Image file size calculation information.  This structure describes the size
498 # requirements for creating a new image file.
500 # The size requirements depend on the new image file format.  File size always
501 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
502 # Compact formats such as 'qcow2' represent unallocated and zero regions
503 # efficiently so file size may be smaller than virtual disk size.
505 # The values are upper bounds that are guaranteed to fit the new image file.
506 # Subsequent modification, such as internal snapshot or bitmap creation, may
507 # require additional space and is not covered here.
509 # @required: Size required for a new image file, in bytes.
511 # @fully-allocated: Image file size, in bytes, once data has been written
512 #                   to all sectors.
514 # Since: 2.10
516 { 'struct': 'BlockMeasureInfo',
517   'data': {'required': 'int', 'fully-allocated': 'int'} }
520 # @query-block:
522 # Get a list of BlockInfo for all virtual block devices.
524 # Returns: a list of @BlockInfo describing each virtual block device. Filter
525 # nodes that were created implicitly are skipped over.
527 # Since: 0.14.0
529 # Example:
531 # -> { "execute": "query-block" }
532 # <- {
533 #       "return":[
534 #          {
535 #             "io-status": "ok",
536 #             "device":"ide0-hd0",
537 #             "locked":false,
538 #             "removable":false,
539 #             "inserted":{
540 #                "ro":false,
541 #                "drv":"qcow2",
542 #                "encrypted":false,
543 #                "file":"disks/test.qcow2",
544 #                "backing_file_depth":1,
545 #                "bps":1000000,
546 #                "bps_rd":0,
547 #                "bps_wr":0,
548 #                "iops":1000000,
549 #                "iops_rd":0,
550 #                "iops_wr":0,
551 #                "bps_max": 8000000,
552 #                "bps_rd_max": 0,
553 #                "bps_wr_max": 0,
554 #                "iops_max": 0,
555 #                "iops_rd_max": 0,
556 #                "iops_wr_max": 0,
557 #                "iops_size": 0,
558 #                "detect_zeroes": "on",
559 #                "write_threshold": 0,
560 #                "image":{
561 #                   "filename":"disks/test.qcow2",
562 #                   "format":"qcow2",
563 #                   "virtual-size":2048000,
564 #                   "backing_file":"base.qcow2",
565 #                   "full-backing-filename":"disks/base.qcow2",
566 #                   "backing-filename-format":"qcow2",
567 #                   "snapshots":[
568 #                      {
569 #                         "id": "1",
570 #                         "name": "snapshot1",
571 #                         "vm-state-size": 0,
572 #                         "date-sec": 10000200,
573 #                         "date-nsec": 12,
574 #                         "vm-clock-sec": 206,
575 #                         "vm-clock-nsec": 30
576 #                      }
577 #                   ],
578 #                   "backing-image":{
579 #                       "filename":"disks/base.qcow2",
580 #                       "format":"qcow2",
581 #                       "virtual-size":2048000
582 #                   }
583 #                }
584 #             },
585 #             "qdev": "ide_disk",
586 #             "type":"unknown"
587 #          },
588 #          {
589 #             "io-status": "ok",
590 #             "device":"ide1-cd0",
591 #             "locked":false,
592 #             "removable":true,
593 #             "qdev": "/machine/unattached/device[23]",
594 #             "tray_open": false,
595 #             "type":"unknown"
596 #          },
597 #          {
598 #             "device":"floppy0",
599 #             "locked":false,
600 #             "removable":true,
601 #             "qdev": "/machine/unattached/device[20]",
602 #             "type":"unknown"
603 #          },
604 #          {
605 #             "device":"sd0",
606 #             "locked":false,
607 #             "removable":true,
608 #             "type":"unknown"
609 #          }
610 #       ]
611 #    }
614 { 'command': 'query-block', 'returns': ['BlockInfo'] }
618 # @BlockDeviceTimedStats:
620 # Statistics of a block device during a given interval of time.
622 # @interval_length: Interval used for calculating the statistics,
623 #                   in seconds.
625 # @min_rd_latency_ns: Minimum latency of read operations in the
626 #                     defined interval, in nanoseconds.
628 # @min_wr_latency_ns: Minimum latency of write operations in the
629 #                     defined interval, in nanoseconds.
631 # @min_flush_latency_ns: Minimum latency of flush operations in the
632 #                        defined interval, in nanoseconds.
634 # @max_rd_latency_ns: Maximum latency of read operations in the
635 #                     defined interval, in nanoseconds.
637 # @max_wr_latency_ns: Maximum latency of write operations in the
638 #                     defined interval, in nanoseconds.
640 # @max_flush_latency_ns: Maximum latency of flush operations in the
641 #                        defined interval, in nanoseconds.
643 # @avg_rd_latency_ns: Average latency of read operations in the
644 #                     defined interval, in nanoseconds.
646 # @avg_wr_latency_ns: Average latency of write operations in the
647 #                     defined interval, in nanoseconds.
649 # @avg_flush_latency_ns: Average latency of flush operations in the
650 #                        defined interval, in nanoseconds.
652 # @avg_rd_queue_depth: Average number of pending read operations
653 #                      in the defined interval.
655 # @avg_wr_queue_depth: Average number of pending write operations
656 #                      in the defined interval.
658 # Since: 2.5
660 { 'struct': 'BlockDeviceTimedStats',
661   'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
662             'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
663             'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
664             'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
665             'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
666             'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
669 # @BlockDeviceStats:
671 # Statistics of a virtual block device or a block backing device.
673 # @rd_bytes:      The number of bytes read by the device.
675 # @wr_bytes:      The number of bytes written by the device.
677 # @rd_operations: The number of read operations performed by the device.
679 # @wr_operations: The number of write operations performed by the device.
681 # @flush_operations: The number of cache flush operations performed by the
682 #                    device (since 0.15.0)
684 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
685 #                       (since 0.15.0).
687 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
689 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
691 # @wr_highest_offset: The offset after the greatest byte written to the
692 #                     device.  The intended use of this information is for
693 #                     growable sparse files (like qcow2) that are used on top
694 #                     of a physical device.
696 # @rd_merged: Number of read requests that have been merged into another
697 #             request (Since 2.3).
699 # @wr_merged: Number of write requests that have been merged into another
700 #             request (Since 2.3).
702 # @idle_time_ns: Time since the last I/O operation, in
703 #                nanoseconds. If the field is absent it means that
704 #                there haven't been any operations yet (Since 2.5).
706 # @failed_rd_operations: The number of failed read operations
707 #                        performed by the device (Since 2.5)
709 # @failed_wr_operations: The number of failed write operations
710 #                        performed by the device (Since 2.5)
712 # @failed_flush_operations: The number of failed flush operations
713 #                           performed by the device (Since 2.5)
715 # @invalid_rd_operations: The number of invalid read operations
716 #                          performed by the device (Since 2.5)
718 # @invalid_wr_operations: The number of invalid write operations
719 #                         performed by the device (Since 2.5)
721 # @invalid_flush_operations: The number of invalid flush operations
722 #                            performed by the device (Since 2.5)
724 # @account_invalid: Whether invalid operations are included in the
725 #                   last access statistics (Since 2.5)
727 # @account_failed: Whether failed operations are included in the
728 #                  latency and last access statistics (Since 2.5)
730 # @timed_stats: Statistics specific to the set of previously defined
731 #               intervals of time (Since 2.5)
733 # Since: 0.14.0
735 { 'struct': 'BlockDeviceStats',
736   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
737            'wr_operations': 'int', 'flush_operations': 'int',
738            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
739            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
740            'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
741            'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
742            'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
743            'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
744            'account_invalid': 'bool', 'account_failed': 'bool',
745            'timed_stats': ['BlockDeviceTimedStats'] } }
748 # @BlockStats:
750 # Statistics of a virtual block device or a block backing device.
752 # @device: If the stats are for a virtual block device, the name
753 #          corresponding to the virtual block device.
755 # @node-name: The node name of the device. (Since 2.3)
757 # @stats:  A @BlockDeviceStats for the device.
759 # @parent: This describes the file block device if it has one.
760 #          Contains recursively the statistics of the underlying
761 #          protocol (e.g. the host file for a qcow2 image). If there is
762 #          no underlying protocol, this field is omitted
764 # @backing: This describes the backing block device if it has one.
765 #           (Since 2.0)
767 # Since: 0.14.0
769 { 'struct': 'BlockStats',
770   'data': {'*device': 'str', '*node-name': 'str',
771            'stats': 'BlockDeviceStats',
772            '*parent': 'BlockStats',
773            '*backing': 'BlockStats'} }
776 # @query-blockstats:
778 # Query the @BlockStats for all virtual block devices.
780 # @query-nodes: If true, the command will query all the block nodes
781 #               that have a node name, in a list which will include "parent"
782 #               information, but not "backing".
783 #               If false or omitted, the behavior is as before - query all the
784 #               device backends, recursively including their "parent" and
785 #               "backing". Filter nodes that were created implicitly are
786 #               skipped over in this mode. (Since 2.3)
788 # Returns: A list of @BlockStats for each virtual block devices.
790 # Since: 0.14.0
792 # Example:
794 # -> { "execute": "query-blockstats" }
795 # <- {
796 #       "return":[
797 #          {
798 #             "device":"ide0-hd0",
799 #             "parent":{
800 #                "stats":{
801 #                   "wr_highest_offset":3686448128,
802 #                   "wr_bytes":9786368,
803 #                   "wr_operations":751,
804 #                   "rd_bytes":122567168,
805 #                   "rd_operations":36772
806 #                   "wr_total_times_ns":313253456
807 #                   "rd_total_times_ns":3465673657
808 #                   "flush_total_times_ns":49653
809 #                   "flush_operations":61,
810 #                   "rd_merged":0,
811 #                   "wr_merged":0,
812 #                   "idle_time_ns":2953431879,
813 #                   "account_invalid":true,
814 #                   "account_failed":false
815 #                }
816 #             },
817 #             "stats":{
818 #                "wr_highest_offset":2821110784,
819 #                "wr_bytes":9786368,
820 #                "wr_operations":692,
821 #                "rd_bytes":122739200,
822 #                "rd_operations":36604
823 #                "flush_operations":51,
824 #                "wr_total_times_ns":313253456
825 #                "rd_total_times_ns":3465673657
826 #                "flush_total_times_ns":49653,
827 #                "rd_merged":0,
828 #                "wr_merged":0,
829 #                "idle_time_ns":2953431879,
830 #                "account_invalid":true,
831 #                "account_failed":false
832 #             }
833 #          },
834 #          {
835 #             "device":"ide1-cd0",
836 #             "stats":{
837 #                "wr_highest_offset":0,
838 #                "wr_bytes":0,
839 #                "wr_operations":0,
840 #                "rd_bytes":0,
841 #                "rd_operations":0
842 #                "flush_operations":0,
843 #                "wr_total_times_ns":0
844 #                "rd_total_times_ns":0
845 #                "flush_total_times_ns":0,
846 #                "rd_merged":0,
847 #                "wr_merged":0,
848 #                "account_invalid":false,
849 #                "account_failed":false
850 #             }
851 #          },
852 #          {
853 #             "device":"floppy0",
854 #             "stats":{
855 #                "wr_highest_offset":0,
856 #                "wr_bytes":0,
857 #                "wr_operations":0,
858 #                "rd_bytes":0,
859 #                "rd_operations":0
860 #                "flush_operations":0,
861 #                "wr_total_times_ns":0
862 #                "rd_total_times_ns":0
863 #                "flush_total_times_ns":0,
864 #                "rd_merged":0,
865 #                "wr_merged":0,
866 #                "account_invalid":false,
867 #                "account_failed":false
868 #             }
869 #          },
870 #          {
871 #             "device":"sd0",
872 #             "stats":{
873 #                "wr_highest_offset":0,
874 #                "wr_bytes":0,
875 #                "wr_operations":0,
876 #                "rd_bytes":0,
877 #                "rd_operations":0
878 #                "flush_operations":0,
879 #                "wr_total_times_ns":0
880 #                "rd_total_times_ns":0
881 #                "flush_total_times_ns":0,
882 #                "rd_merged":0,
883 #                "wr_merged":0,
884 #                "account_invalid":false,
885 #                "account_failed":false
886 #             }
887 #          }
888 #       ]
889 #    }
892 { 'command': 'query-blockstats',
893   'data': { '*query-nodes': 'bool' },
894   'returns': ['BlockStats'] }
897 # @BlockdevOnError:
899 # An enumeration of possible behaviors for errors on I/O operations.
900 # The exact meaning depends on whether the I/O was initiated by a guest
901 # or by a block job
903 # @report: for guest operations, report the error to the guest;
904 #          for jobs, cancel the job
906 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
907 #          or BLOCK_JOB_ERROR)
909 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
911 # @stop: for guest operations, stop the virtual machine;
912 #        for jobs, pause the job
914 # @auto: inherit the error handling policy of the backend (since: 2.7)
916 # Since: 1.3
918 { 'enum': 'BlockdevOnError',
919   'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
922 # @MirrorSyncMode:
924 # An enumeration of possible behaviors for the initial synchronization
925 # phase of storage mirroring.
927 # @top: copies data in the topmost image to the destination
929 # @full: copies data from all images to the destination
931 # @none: only copy data written from now on
933 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
935 # Since: 1.3
937 { 'enum': 'MirrorSyncMode',
938   'data': ['top', 'full', 'none', 'incremental'] }
941 # @BlockJobType:
943 # Type of a block job.
945 # @commit: block commit job type, see "block-commit"
947 # @stream: block stream job type, see "block-stream"
949 # @mirror: drive mirror job type, see "drive-mirror"
951 # @backup: drive backup job type, see "drive-backup"
953 # Since: 1.7
955 { 'enum': 'BlockJobType',
956   'data': ['commit', 'stream', 'mirror', 'backup'] }
959 # @BlockJobInfo:
961 # Information about a long-running block device operation.
963 # @type: the job type ('stream' for image streaming)
965 # @device: The job identifier. Originally the device name but other
966 #          values are allowed since QEMU 2.7
968 # @len: the maximum progress value
970 # @busy: false if the job is known to be in a quiescent state, with
971 #        no pending I/O.  Since 1.3.
973 # @paused: whether the job is paused or, if @busy is true, will
974 #          pause itself as soon as possible.  Since 1.3.
976 # @offset: the current progress value
978 # @speed: the rate limit, bytes per second
980 # @io-status: the status of the job (since 1.3)
982 # @ready: true if the job may be completed (since 2.2)
984 # Since: 1.1
986 { 'struct': 'BlockJobInfo',
987   'data': {'type': 'str', 'device': 'str', 'len': 'int',
988            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
989            'io-status': 'BlockDeviceIoStatus', 'ready': 'bool'} }
992 # @query-block-jobs:
994 # Return information about long-running block device operations.
996 # Returns: a list of @BlockJobInfo for each active block job
998 # Since: 1.1
1000 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1003 # @block_passwd:
1005 # This command sets the password of a block device that has not been open
1006 # with a password and requires one.
1008 # This command is now obsolete and will always return an error since 2.10
1011 { 'command': 'block_passwd', 'data': {'*device': 'str',
1012                                       '*node-name': 'str', 'password': 'str'} }
1015 # @block_resize:
1017 # Resize a block image while a guest is running.
1019 # Either @device or @node-name must be set but not both.
1021 # @device: the name of the device to get the image resized
1023 # @node-name: graph node name to get the image resized (Since 2.0)
1025 # @size:  new image size in bytes
1027 # Returns: nothing on success
1028 #          If @device is not a valid block device, DeviceNotFound
1030 # Since: 0.14.0
1032 # Example:
1034 # -> { "execute": "block_resize",
1035 #      "arguments": { "device": "scratch", "size": 1073741824 } }
1036 # <- { "return": {} }
1039 { 'command': 'block_resize', 'data': { '*device': 'str',
1040                                        '*node-name': 'str',
1041                                        'size': 'int' }}
1044 # @NewImageMode:
1046 # An enumeration that tells QEMU how to set the backing file path in
1047 # a new image file.
1049 # @existing: QEMU should look for an existing image file.
1051 # @absolute-paths: QEMU should create a new image with absolute paths
1052 # for the backing file. If there is no backing file available, the new
1053 # image will not be backed either.
1055 # Since: 1.1
1057 { 'enum': 'NewImageMode',
1058   'data': [ 'existing', 'absolute-paths' ] }
1061 # @BlockdevSnapshotSync:
1063 # Either @device or @node-name must be set but not both.
1065 # @device: the name of the device to generate the snapshot from.
1067 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1069 # @snapshot-file: the target of the new image. If the file exists, or
1070 # if it is a device, the snapshot will be created in the existing
1071 # file/device. Otherwise, a new file will be created.
1073 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1075 # @format: the format of the snapshot image, default is 'qcow2'.
1077 # @mode: whether and how QEMU should create a new image, default is
1078 #        'absolute-paths'.
1080 { 'struct': 'BlockdevSnapshotSync',
1081   'data': { '*device': 'str', '*node-name': 'str',
1082             'snapshot-file': 'str', '*snapshot-node-name': 'str',
1083             '*format': 'str', '*mode': 'NewImageMode' } }
1086 # @BlockdevSnapshot:
1088 # @node: device or node name that will have a snapshot created.
1090 # @overlay: reference to the existing block device that will become
1091 #           the overlay of @node, as part of creating the snapshot.
1092 #           It must not have a current backing file (this can be
1093 #           achieved by passing "backing": "" to blockdev-add).
1095 # Since: 2.5
1097 { 'struct': 'BlockdevSnapshot',
1098   'data': { 'node': 'str', 'overlay': 'str' } }
1101 # @DriveBackup:
1103 # @job-id: identifier for the newly-created block job. If
1104 #          omitted, the device name will be used. (Since 2.7)
1106 # @device: the device name or node-name of a root node which should be copied.
1108 # @target: the target of the new image. If the file exists, or if it
1109 #          is a device, the existing file/device will be used as the new
1110 #          destination.  If it does not exist, a new file will be created.
1112 # @format: the format of the new destination, default is to
1113 #          probe if @mode is 'existing', else the format of the source
1115 # @sync: what parts of the disk image should be copied to the destination
1116 #        (all the disk, only the sectors allocated in the topmost image, from a
1117 #        dirty bitmap, or only new I/O).
1119 # @mode: whether and how QEMU should create a new image, default is
1120 #        'absolute-paths'.
1122 # @speed: the maximum speed, in bytes per second
1124 # @bitmap: the name of dirty bitmap if sync is "incremental".
1125 #          Must be present if sync is "incremental", must NOT be present
1126 #          otherwise. (Since 2.4)
1128 # @compress: true to compress data, if the target format supports it.
1129 #            (default: false) (since 2.8)
1131 # @on-source-error: the action to take on an error on the source,
1132 #                   default 'report'.  'stop' and 'enospc' can only be used
1133 #                   if the block device supports io-status (see BlockInfo).
1135 # @on-target-error: the action to take on an error on the target,
1136 #                   default 'report' (no limitations, since this applies to
1137 #                   a different block device than @device).
1139 # Note: @on-source-error and @on-target-error only affect background
1140 # I/O.  If an error occurs during a guest write request, the device's
1141 # rerror/werror actions will be used.
1143 # Since: 1.6
1145 { 'struct': 'DriveBackup',
1146   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1147             '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1148             '*speed': 'int', '*bitmap': 'str', '*compress': 'bool',
1149             '*on-source-error': 'BlockdevOnError',
1150             '*on-target-error': 'BlockdevOnError' } }
1153 # @BlockdevBackup:
1155 # @job-id: identifier for the newly-created block job. If
1156 #          omitted, the device name will be used. (Since 2.7)
1158 # @device: the device name or node-name of a root node which should be copied.
1160 # @target: the device name or node-name of the backup target node.
1162 # @sync: what parts of the disk image should be copied to the destination
1163 #        (all the disk, only the sectors allocated in the topmost image, or
1164 #        only new I/O).
1166 # @speed: the maximum speed, in bytes per second. The default is 0,
1167 #         for unlimited.
1169 # @compress: true to compress data, if the target format supports it.
1170 #            (default: false) (since 2.8)
1172 # @on-source-error: the action to take on an error on the source,
1173 #                   default 'report'.  'stop' and 'enospc' can only be used
1174 #                   if the block device supports io-status (see BlockInfo).
1176 # @on-target-error: the action to take on an error on the target,
1177 #                   default 'report' (no limitations, since this applies to
1178 #                   a different block device than @device).
1180 # Note: @on-source-error and @on-target-error only affect background
1181 # I/O.  If an error occurs during a guest write request, the device's
1182 # rerror/werror actions will be used.
1184 # Since: 2.3
1186 { 'struct': 'BlockdevBackup',
1187   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1188             'sync': 'MirrorSyncMode',
1189             '*speed': 'int',
1190             '*compress': 'bool',
1191             '*on-source-error': 'BlockdevOnError',
1192             '*on-target-error': 'BlockdevOnError' } }
1195 # @blockdev-snapshot-sync:
1197 # Generates a synchronous snapshot of a block device.
1199 # For the arguments, see the documentation of BlockdevSnapshotSync.
1201 # Returns: nothing on success
1202 #          If @device is not a valid block device, DeviceNotFound
1204 # Since: 0.14.0
1206 # Example:
1208 # -> { "execute": "blockdev-snapshot-sync",
1209 #      "arguments": { "device": "ide-hd0",
1210 #                     "snapshot-file":
1211 #                     "/some/place/my-image",
1212 #                     "format": "qcow2" } }
1213 # <- { "return": {} }
1216 { 'command': 'blockdev-snapshot-sync',
1217   'data': 'BlockdevSnapshotSync' }
1221 # @blockdev-snapshot:
1223 # Generates a snapshot of a block device.
1225 # Create a snapshot, by installing 'node' as the backing image of
1226 # 'overlay'. Additionally, if 'node' is associated with a block
1227 # device, the block device changes to using 'overlay' as its new active
1228 # image.
1230 # For the arguments, see the documentation of BlockdevSnapshot.
1232 # Since: 2.5
1234 # Example:
1236 # -> { "execute": "blockdev-add",
1237 #      "arguments": { "driver": "qcow2",
1238 #                     "node-name": "node1534",
1239 #                     "file": { "driver": "file",
1240 #                               "filename": "hd1.qcow2" },
1241 #                     "backing": "" } }
1243 # <- { "return": {} }
1245 # -> { "execute": "blockdev-snapshot",
1246 #      "arguments": { "node": "ide-hd0",
1247 #                     "overlay": "node1534" } }
1248 # <- { "return": {} }
1251 { 'command': 'blockdev-snapshot',
1252   'data': 'BlockdevSnapshot' }
1255 # @change-backing-file:
1257 # Change the backing file in the image file metadata.  This does not
1258 # cause QEMU to reopen the image file to reparse the backing filename
1259 # (it may, however, perform a reopen to change permissions from
1260 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1261 # into the image file metadata, and the QEMU internal strings are
1262 # updated.
1264 # @image-node-name: The name of the block driver state node of the
1265 #                   image to modify. The "device" argument is used
1266 #                   to verify "image-node-name" is in the chain
1267 #                   described by "device".
1269 # @device:          The device name or node-name of the root node that owns
1270 #                   image-node-name.
1272 # @backing-file:    The string to write as the backing file.  This
1273 #                   string is not validated, so care should be taken
1274 #                   when specifying the string or the image chain may
1275 #                   not be able to be reopened again.
1277 # Returns: Nothing on success
1279 #          If "device" does not exist or cannot be determined, DeviceNotFound
1281 # Since: 2.1
1283 { 'command': 'change-backing-file',
1284   'data': { 'device': 'str', 'image-node-name': 'str',
1285             'backing-file': 'str' } }
1288 # @block-commit:
1290 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1291 # writes data between 'top' and 'base' into 'base'.
1293 # @job-id: identifier for the newly-created block job. If
1294 #          omitted, the device name will be used. (Since 2.7)
1296 # @device:  the device name or node-name of a root node
1298 # @base:   The file name of the backing image to write data into.
1299 #                    If not specified, this is the deepest backing image.
1301 # @top:    The file name of the backing image within the image chain,
1302 #                    which contains the topmost data to be committed down. If
1303 #                    not specified, this is the active layer.
1305 # @backing-file:  The backing file string to write into the overlay
1306 #                           image of 'top'.  If 'top' is the active layer,
1307 #                           specifying a backing file string is an error. This
1308 #                           filename is not validated.
1310 #                           If a pathname string is such that it cannot be
1311 #                           resolved by QEMU, that means that subsequent QMP or
1312 #                           HMP commands must use node-names for the image in
1313 #                           question, as filename lookup methods will fail.
1315 #                           If not specified, QEMU will automatically determine
1316 #                           the backing file string to use, or error out if
1317 #                           there is no obvious choice. Care should be taken
1318 #                           when specifying the string, to specify a valid
1319 #                           filename or protocol.
1320 #                           (Since 2.1)
1322 #                    If top == base, that is an error.
1323 #                    If top == active, the job will not be completed by itself,
1324 #                    user needs to complete the job with the block-job-complete
1325 #                    command after getting the ready event. (Since 2.0)
1327 #                    If the base image is smaller than top, then the base image
1328 #                    will be resized to be the same size as top.  If top is
1329 #                    smaller than the base image, the base will not be
1330 #                    truncated.  If you want the base image size to match the
1331 #                    size of the smaller top, you can safely truncate it
1332 #                    yourself once the commit operation successfully completes.
1334 # @speed:  the maximum speed, in bytes per second
1336 # @filter-node-name: the node name that should be assigned to the
1337 #                    filter driver that the commit job inserts into the graph
1338 #                    above @top. If this option is not given, a node name is
1339 #                    autogenerated. (Since: 2.9)
1341 # Returns: Nothing on success
1342 #          If commit or stream is already active on this device, DeviceInUse
1343 #          If @device does not exist, DeviceNotFound
1344 #          If image commit is not supported by this device, NotSupported
1345 #          If @base or @top is invalid, a generic error is returned
1346 #          If @speed is invalid, InvalidParameter
1348 # Since: 1.3
1350 # Example:
1352 # -> { "execute": "block-commit",
1353 #      "arguments": { "device": "virtio0",
1354 #                     "top": "/tmp/snap1.qcow2" } }
1355 # <- { "return": {} }
1358 { 'command': 'block-commit',
1359   'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
1360             '*backing-file': 'str', '*speed': 'int',
1361             '*filter-node-name': 'str' } }
1364 # @drive-backup:
1366 # Start a point-in-time copy of a block device to a new destination.  The
1367 # status of ongoing drive-backup operations can be checked with
1368 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1369 # The operation can be stopped before it has completed using the
1370 # block-job-cancel command.
1372 # Returns: nothing on success
1373 #          If @device is not a valid block device, GenericError
1375 # Since: 1.6
1377 # Example:
1379 # -> { "execute": "drive-backup",
1380 #      "arguments": { "device": "drive0",
1381 #                     "sync": "full",
1382 #                     "target": "backup.img" } }
1383 # <- { "return": {} }
1386 { 'command': 'drive-backup', 'boxed': true,
1387   'data': 'DriveBackup' }
1390 # @blockdev-backup:
1392 # Start a point-in-time copy of a block device to a new destination.  The
1393 # status of ongoing blockdev-backup operations can be checked with
1394 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1395 # The operation can be stopped before it has completed using the
1396 # block-job-cancel command.
1398 # Returns: nothing on success
1399 #          If @device is not a valid block device, DeviceNotFound
1401 # Since: 2.3
1403 # Example:
1404 # -> { "execute": "blockdev-backup",
1405 #      "arguments": { "device": "src-id",
1406 #                     "sync": "full",
1407 #                     "target": "tgt-id" } }
1408 # <- { "return": {} }
1411 { 'command': 'blockdev-backup', 'boxed': true,
1412   'data': 'BlockdevBackup' }
1416 # @query-named-block-nodes:
1418 # Get the named block driver list
1420 # Returns: the list of BlockDeviceInfo
1422 # Since: 2.0
1424 # Example:
1426 # -> { "execute": "query-named-block-nodes" }
1427 # <- { "return": [ { "ro":false,
1428 #                    "drv":"qcow2",
1429 #                    "encrypted":false,
1430 #                    "file":"disks/test.qcow2",
1431 #                    "node-name": "my-node",
1432 #                    "backing_file_depth":1,
1433 #                    "bps":1000000,
1434 #                    "bps_rd":0,
1435 #                    "bps_wr":0,
1436 #                    "iops":1000000,
1437 #                    "iops_rd":0,
1438 #                    "iops_wr":0,
1439 #                    "bps_max": 8000000,
1440 #                    "bps_rd_max": 0,
1441 #                    "bps_wr_max": 0,
1442 #                    "iops_max": 0,
1443 #                    "iops_rd_max": 0,
1444 #                    "iops_wr_max": 0,
1445 #                    "iops_size": 0,
1446 #                    "write_threshold": 0,
1447 #                    "image":{
1448 #                       "filename":"disks/test.qcow2",
1449 #                       "format":"qcow2",
1450 #                       "virtual-size":2048000,
1451 #                       "backing_file":"base.qcow2",
1452 #                       "full-backing-filename":"disks/base.qcow2",
1453 #                       "backing-filename-format":"qcow2",
1454 #                       "snapshots":[
1455 #                          {
1456 #                             "id": "1",
1457 #                             "name": "snapshot1",
1458 #                             "vm-state-size": 0,
1459 #                             "date-sec": 10000200,
1460 #                             "date-nsec": 12,
1461 #                             "vm-clock-sec": 206,
1462 #                             "vm-clock-nsec": 30
1463 #                          }
1464 #                       ],
1465 #                       "backing-image":{
1466 #                           "filename":"disks/base.qcow2",
1467 #                           "format":"qcow2",
1468 #                           "virtual-size":2048000
1469 #                       }
1470 #                    } } ] }
1473 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1476 # @drive-mirror:
1478 # Start mirroring a block device's writes to a new destination. target
1479 # specifies the target of the new image. If the file exists, or if it
1480 # is a device, it will be used as the new destination for writes. If
1481 # it does not exist, a new file will be created. format specifies the
1482 # format of the mirror image, default is to probe if mode='existing',
1483 # else the format of the source.
1485 # Returns: nothing on success
1486 #          If @device is not a valid block device, GenericError
1488 # Since: 1.3
1490 # Example:
1492 # -> { "execute": "drive-mirror",
1493 #      "arguments": { "device": "ide-hd0",
1494 #                     "target": "/some/place/my-image",
1495 #                     "sync": "full",
1496 #                     "format": "qcow2" } }
1497 # <- { "return": {} }
1500 { 'command': 'drive-mirror', 'boxed': true,
1501   'data': 'DriveMirror' }
1504 # @DriveMirror:
1506 # A set of parameters describing drive mirror setup.
1508 # @job-id: identifier for the newly-created block job. If
1509 #          omitted, the device name will be used. (Since 2.7)
1511 # @device:  the device name or node-name of a root node whose writes should be
1512 #           mirrored.
1514 # @target: the target of the new image. If the file exists, or if it
1515 #          is a device, the existing file/device will be used as the new
1516 #          destination.  If it does not exist, a new file will be created.
1518 # @format: the format of the new destination, default is to
1519 #          probe if @mode is 'existing', else the format of the source
1521 # @node-name: the new block driver state node name in the graph
1522 #             (Since 2.1)
1524 # @replaces: with sync=full graph node name to be replaced by the new
1525 #            image when a whole image copy is done. This can be used to repair
1526 #            broken Quorum files. (Since 2.1)
1528 # @mode: whether and how QEMU should create a new image, default is
1529 #        'absolute-paths'.
1531 # @speed:  the maximum speed, in bytes per second
1533 # @sync: what parts of the disk image should be copied to the destination
1534 #        (all the disk, only the sectors allocated in the topmost image, or
1535 #        only new I/O).
1537 # @granularity: granularity of the dirty bitmap, default is 64K
1538 #               if the image format doesn't have clusters, 4K if the clusters
1539 #               are smaller than that, else the cluster size.  Must be a
1540 #               power of 2 between 512 and 64M (since 1.4).
1542 # @buf-size: maximum amount of data in flight from source to
1543 #            target (since 1.4).
1545 # @on-source-error: the action to take on an error on the source,
1546 #                   default 'report'.  'stop' and 'enospc' can only be used
1547 #                   if the block device supports io-status (see BlockInfo).
1549 # @on-target-error: the action to take on an error on the target,
1550 #                   default 'report' (no limitations, since this applies to
1551 #                   a different block device than @device).
1552 # @unmap: Whether to try to unmap target sectors where source has
1553 #         only zero. If true, and target unallocated sectors will read as zero,
1554 #         target image sectors will be unmapped; otherwise, zeroes will be
1555 #         written. Both will result in identical contents.
1556 #         Default is true. (Since 2.4)
1558 # Since: 1.3
1560 { 'struct': 'DriveMirror',
1561   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1562             '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1563             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1564             '*speed': 'int', '*granularity': 'uint32',
1565             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1566             '*on-target-error': 'BlockdevOnError',
1567             '*unmap': 'bool' } }
1570 # @BlockDirtyBitmap:
1572 # @node: name of device/node which the bitmap is tracking
1574 # @name: name of the dirty bitmap
1576 # Since: 2.4
1578 { 'struct': 'BlockDirtyBitmap',
1579   'data': { 'node': 'str', 'name': 'str' } }
1582 # @BlockDirtyBitmapAdd:
1584 # @node: name of device/node which the bitmap is tracking
1586 # @name: name of the dirty bitmap
1588 # @granularity: the bitmap granularity, default is 64k for
1589 #               block-dirty-bitmap-add
1591 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1592 #              corresponding block device image file on its close. For now only
1593 #              Qcow2 disks support persistent bitmaps. Default is false for
1594 #              block-dirty-bitmap-add. (Since: 2.10)
1596 # @autoload: the bitmap will be automatically loaded when the image it is stored
1597 #            in is opened. This flag may only be specified for persistent
1598 #            bitmaps. Default is false for block-dirty-bitmap-add. (Since: 2.10)
1600 # Since: 2.4
1602 { 'struct': 'BlockDirtyBitmapAdd',
1603   'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1604             '*persistent': 'bool', '*autoload': 'bool' } }
1607 # @block-dirty-bitmap-add:
1609 # Create a dirty bitmap with a name on the node, and start tracking the writes.
1611 # Returns: nothing on success
1612 #          If @node is not a valid block device or node, DeviceNotFound
1613 #          If @name is already taken, GenericError with an explanation
1615 # Since: 2.4
1617 # Example:
1619 # -> { "execute": "block-dirty-bitmap-add",
1620 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
1621 # <- { "return": {} }
1624 { 'command': 'block-dirty-bitmap-add',
1625   'data': 'BlockDirtyBitmapAdd' }
1628 # @block-dirty-bitmap-remove:
1630 # Stop write tracking and remove the dirty bitmap that was created
1631 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
1632 # storage too.
1634 # Returns: nothing on success
1635 #          If @node is not a valid block device or node, DeviceNotFound
1636 #          If @name is not found, GenericError with an explanation
1637 #          if @name is frozen by an operation, GenericError
1639 # Since: 2.4
1641 # Example:
1643 # -> { "execute": "block-dirty-bitmap-remove",
1644 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
1645 # <- { "return": {} }
1648 { 'command': 'block-dirty-bitmap-remove',
1649   'data': 'BlockDirtyBitmap' }
1652 # @block-dirty-bitmap-clear:
1654 # Clear (reset) a dirty bitmap on the device, so that an incremental
1655 # backup from this point in time forward will only backup clusters
1656 # modified after this clear operation.
1658 # Returns: nothing on success
1659 #          If @node is not a valid block device, DeviceNotFound
1660 #          If @name is not found, GenericError with an explanation
1662 # Since: 2.4
1664 # Example:
1666 # -> { "execute": "block-dirty-bitmap-clear",
1667 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
1668 # <- { "return": {} }
1671 { 'command': 'block-dirty-bitmap-clear',
1672   'data': 'BlockDirtyBitmap' }
1675 # @BlockDirtyBitmapSha256:
1677 # SHA256 hash of dirty bitmap data
1679 # @sha256: ASCII representation of SHA256 bitmap hash
1681 # Since: 2.10
1683   { 'struct': 'BlockDirtyBitmapSha256',
1684     'data': {'sha256': 'str'} }
1687 # @x-debug-block-dirty-bitmap-sha256:
1689 # Get bitmap SHA256
1691 # Returns: BlockDirtyBitmapSha256 on success
1692 #          If @node is not a valid block device, DeviceNotFound
1693 #          If @name is not found or if hashing has failed, GenericError with an
1694 #          explanation
1696 # Since: 2.10
1698   { 'command': 'x-debug-block-dirty-bitmap-sha256',
1699     'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
1702 # @blockdev-mirror:
1704 # Start mirroring a block device's writes to a new destination.
1706 # @job-id: identifier for the newly-created block job. If
1707 #          omitted, the device name will be used. (Since 2.7)
1709 # @device: The device name or node-name of a root node whose writes should be
1710 #          mirrored.
1712 # @target: the id or node-name of the block device to mirror to. This mustn't be
1713 #          attached to guest.
1715 # @replaces: with sync=full graph node name to be replaced by the new
1716 #            image when a whole image copy is done. This can be used to repair
1717 #            broken Quorum files.
1719 # @speed:  the maximum speed, in bytes per second
1721 # @sync: what parts of the disk image should be copied to the destination
1722 #        (all the disk, only the sectors allocated in the topmost image, or
1723 #        only new I/O).
1725 # @granularity: granularity of the dirty bitmap, default is 64K
1726 #               if the image format doesn't have clusters, 4K if the clusters
1727 #               are smaller than that, else the cluster size.  Must be a
1728 #               power of 2 between 512 and 64M
1730 # @buf-size: maximum amount of data in flight from source to
1731 #            target
1733 # @on-source-error: the action to take on an error on the source,
1734 #                   default 'report'.  'stop' and 'enospc' can only be used
1735 #                   if the block device supports io-status (see BlockInfo).
1737 # @on-target-error: the action to take on an error on the target,
1738 #                   default 'report' (no limitations, since this applies to
1739 #                   a different block device than @device).
1741 # @filter-node-name: the node name that should be assigned to the
1742 #                    filter driver that the mirror job inserts into the graph
1743 #                    above @device. If this option is not given, a node name is
1744 #                    autogenerated. (Since: 2.9)
1746 # Returns: nothing on success.
1748 # Since: 2.6
1750 # Example:
1752 # -> { "execute": "blockdev-mirror",
1753 #      "arguments": { "device": "ide-hd0",
1754 #                     "target": "target0",
1755 #                     "sync": "full" } }
1756 # <- { "return": {} }
1759 { 'command': 'blockdev-mirror',
1760   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1761             '*replaces': 'str',
1762             'sync': 'MirrorSyncMode',
1763             '*speed': 'int', '*granularity': 'uint32',
1764             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1765             '*on-target-error': 'BlockdevOnError',
1766             '*filter-node-name': 'str' } }
1769 # @block_set_io_throttle:
1771 # Change I/O throttle limits for a block drive.
1773 # Since QEMU 2.4, each device with I/O limits is member of a throttle
1774 # group.
1776 # If two or more devices are members of the same group, the limits
1777 # will apply to the combined I/O of the whole group in a round-robin
1778 # fashion. Therefore, setting new I/O limits to a device will affect
1779 # the whole group.
1781 # The name of the group can be specified using the 'group' parameter.
1782 # If the parameter is unset, it is assumed to be the current group of
1783 # that device. If it's not in any group yet, the name of the device
1784 # will be used as the name for its group.
1786 # The 'group' parameter can also be used to move a device to a
1787 # different group. In this case the limits specified in the parameters
1788 # will be applied to the new group only.
1790 # I/O limits can be disabled by setting all of them to 0. In this case
1791 # the device will be removed from its group and the rest of its
1792 # members will not be affected. The 'group' parameter is ignored.
1794 # Returns: Nothing on success
1795 #          If @device is not a valid block device, DeviceNotFound
1797 # Since: 1.1
1799 # Example:
1801 # -> { "execute": "block_set_io_throttle",
1802 #      "arguments": { "id": "ide0-1-0",
1803 #                     "bps": 1000000,
1804 #                     "bps_rd": 0,
1805 #                     "bps_wr": 0,
1806 #                     "iops": 0,
1807 #                     "iops_rd": 0,
1808 #                     "iops_wr": 0,
1809 #                     "bps_max": 8000000,
1810 #                     "bps_rd_max": 0,
1811 #                     "bps_wr_max": 0,
1812 #                     "iops_max": 0,
1813 #                     "iops_rd_max": 0,
1814 #                     "iops_wr_max": 0,
1815 #                     "bps_max_length": 60,
1816 #                     "iops_size": 0 } }
1817 # <- { "return": {} }
1819 { 'command': 'block_set_io_throttle', 'boxed': true,
1820   'data': 'BlockIOThrottle' }
1823 # @BlockIOThrottle:
1825 # A set of parameters describing block throttling.
1827 # @device: Block device name (deprecated, use @id instead)
1829 # @id: The name or QOM path of the guest device (since: 2.8)
1831 # @bps: total throughput limit in bytes per second
1833 # @bps_rd: read throughput limit in bytes per second
1835 # @bps_wr: write throughput limit in bytes per second
1837 # @iops: total I/O operations per second
1839 # @iops_rd: read I/O operations per second
1841 # @iops_wr: write I/O operations per second
1843 # @bps_max: total throughput limit during bursts,
1844 #                     in bytes (Since 1.7)
1846 # @bps_rd_max: read throughput limit during bursts,
1847 #                        in bytes (Since 1.7)
1849 # @bps_wr_max: write throughput limit during bursts,
1850 #                        in bytes (Since 1.7)
1852 # @iops_max: total I/O operations per second during bursts,
1853 #                      in bytes (Since 1.7)
1855 # @iops_rd_max: read I/O operations per second during bursts,
1856 #                         in bytes (Since 1.7)
1858 # @iops_wr_max: write I/O operations per second during bursts,
1859 #                         in bytes (Since 1.7)
1861 # @bps_max_length: maximum length of the @bps_max burst
1862 #                            period, in seconds. It must only
1863 #                            be set if @bps_max is set as well.
1864 #                            Defaults to 1. (Since 2.6)
1866 # @bps_rd_max_length: maximum length of the @bps_rd_max
1867 #                               burst period, in seconds. It must only
1868 #                               be set if @bps_rd_max is set as well.
1869 #                               Defaults to 1. (Since 2.6)
1871 # @bps_wr_max_length: maximum length of the @bps_wr_max
1872 #                               burst period, in seconds. It must only
1873 #                               be set if @bps_wr_max is set as well.
1874 #                               Defaults to 1. (Since 2.6)
1876 # @iops_max_length: maximum length of the @iops burst
1877 #                             period, in seconds. It must only
1878 #                             be set if @iops_max is set as well.
1879 #                             Defaults to 1. (Since 2.6)
1881 # @iops_rd_max_length: maximum length of the @iops_rd_max
1882 #                                burst period, in seconds. It must only
1883 #                                be set if @iops_rd_max is set as well.
1884 #                                Defaults to 1. (Since 2.6)
1886 # @iops_wr_max_length: maximum length of the @iops_wr_max
1887 #                                burst period, in seconds. It must only
1888 #                                be set if @iops_wr_max is set as well.
1889 #                                Defaults to 1. (Since 2.6)
1891 # @iops_size: an I/O size in bytes (Since 1.7)
1893 # @group: throttle group name (Since 2.4)
1895 # Since: 1.1
1897 { 'struct': 'BlockIOThrottle',
1898   'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
1899             'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
1900             '*bps_max': 'int', '*bps_rd_max': 'int',
1901             '*bps_wr_max': 'int', '*iops_max': 'int',
1902             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
1903             '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
1904             '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
1905             '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
1906             '*iops_size': 'int', '*group': 'str' } }
1909 # @block-stream:
1911 # Copy data from a backing file into a block device.
1913 # The block streaming operation is performed in the background until the entire
1914 # backing file has been copied.  This command returns immediately once streaming
1915 # has started.  The status of ongoing block streaming operations can be checked
1916 # with query-block-jobs.  The operation can be stopped before it has completed
1917 # using the block-job-cancel command.
1919 # The node that receives the data is called the top image, can be located in
1920 # any part of the chain (but always above the base image; see below) and can be
1921 # specified using its device or node name. Earlier qemu versions only allowed
1922 # 'device' to name the top level node; presence of the 'base-node' parameter
1923 # during introspection can be used as a witness of the enhanced semantics
1924 # of 'device'.
1926 # If a base file is specified then sectors are not copied from that base file and
1927 # its backing chain.  When streaming completes the image file will have the base
1928 # file as its backing file.  This can be used to stream a subset of the backing
1929 # file chain instead of flattening the entire image.
1931 # On successful completion the image file is updated to drop the backing file
1932 # and the BLOCK_JOB_COMPLETED event is emitted.
1934 # @job-id: identifier for the newly-created block job. If
1935 #          omitted, the device name will be used. (Since 2.7)
1937 # @device: the device or node name of the top image
1939 # @base:   the common backing file name.
1940 #                    It cannot be set if @base-node is also set.
1942 # @base-node: the node name of the backing file.
1943 #                       It cannot be set if @base is also set. (Since 2.8)
1945 # @backing-file: The backing file string to write into the top
1946 #                          image. This filename is not validated.
1948 #                          If a pathname string is such that it cannot be
1949 #                          resolved by QEMU, that means that subsequent QMP or
1950 #                          HMP commands must use node-names for the image in
1951 #                          question, as filename lookup methods will fail.
1953 #                          If not specified, QEMU will automatically determine
1954 #                          the backing file string to use, or error out if there
1955 #                          is no obvious choice.  Care should be taken when
1956 #                          specifying the string, to specify a valid filename or
1957 #                          protocol.
1958 #                          (Since 2.1)
1960 # @speed:  the maximum speed, in bytes per second
1962 # @on-error: the action to take on an error (default report).
1963 #            'stop' and 'enospc' can only be used if the block device
1964 #            supports io-status (see BlockInfo).  Since 1.3.
1966 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
1968 # Since: 1.1
1970 # Example:
1972 # -> { "execute": "block-stream",
1973 #      "arguments": { "device": "virtio0",
1974 #                     "base": "/tmp/master.qcow2" } }
1975 # <- { "return": {} }
1978 { 'command': 'block-stream',
1979   'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
1980             '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
1981             '*on-error': 'BlockdevOnError' } }
1984 # @block-job-set-speed:
1986 # Set maximum speed for a background block operation.
1988 # This command can only be issued when there is an active block job.
1990 # Throttling can be disabled by setting the speed to 0.
1992 # @device: The job identifier. This used to be a device name (hence
1993 #          the name of the parameter), but since QEMU 2.7 it can have
1994 #          other values.
1996 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
1997 #          Defaults to 0.
1999 # Returns: Nothing on success
2000 #          If no background operation is active on this device, DeviceNotActive
2002 # Since: 1.1
2004 { 'command': 'block-job-set-speed',
2005   'data': { 'device': 'str', 'speed': 'int' } }
2008 # @block-job-cancel:
2010 # Stop an active background block operation.
2012 # This command returns immediately after marking the active background block
2013 # operation for cancellation.  It is an error to call this command if no
2014 # operation is in progress.
2016 # The operation will cancel as soon as possible and then emit the
2017 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2018 # enumerated using query-block-jobs.
2020 # For streaming, the image file retains its backing file unless the streaming
2021 # operation happens to complete just as it is being cancelled.  A new streaming
2022 # operation can be started at a later time to finish copying all data from the
2023 # backing file.
2025 # @device: The job identifier. This used to be a device name (hence
2026 #          the name of the parameter), but since QEMU 2.7 it can have
2027 #          other values.
2029 # @force: whether to allow cancellation of a paused job (default
2030 #         false).  Since 1.3.
2032 # Returns: Nothing on success
2033 #          If no background operation is active on this device, DeviceNotActive
2035 # Since: 1.1
2037 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2040 # @block-job-pause:
2042 # Pause an active background block operation.
2044 # This command returns immediately after marking the active background block
2045 # operation for pausing.  It is an error to call this command if no
2046 # operation is in progress.  Pausing an already paused job has no cumulative
2047 # effect; a single block-job-resume command will resume the job.
2049 # The operation will pause as soon as possible.  No event is emitted when
2050 # the operation is actually paused.  Cancelling a paused job automatically
2051 # resumes it.
2053 # @device: The job identifier. This used to be a device name (hence
2054 #          the name of the parameter), but since QEMU 2.7 it can have
2055 #          other values.
2057 # Returns: Nothing on success
2058 #          If no background operation is active on this device, DeviceNotActive
2060 # Since: 1.3
2062 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2065 # @block-job-resume:
2067 # Resume an active background block operation.
2069 # This command returns immediately after resuming a paused background block
2070 # operation.  It is an error to call this command if no operation is in
2071 # progress.  Resuming an already running job is not an error.
2073 # This command also clears the error status of the job.
2075 # @device: The job identifier. This used to be a device name (hence
2076 #          the name of the parameter), but since QEMU 2.7 it can have
2077 #          other values.
2079 # Returns: Nothing on success
2080 #          If no background operation is active on this device, DeviceNotActive
2082 # Since: 1.3
2084 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2087 # @block-job-complete:
2089 # Manually trigger completion of an active background block operation.  This
2090 # is supported for drive mirroring, where it also switches the device to
2091 # write to the target path only.  The ability to complete is signaled with
2092 # a BLOCK_JOB_READY event.
2094 # This command completes an active background block operation synchronously.
2095 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2096 # is not defined.  Note that if an I/O error occurs during the processing of
2097 # this command: 1) the command itself will fail; 2) the error will be processed
2098 # according to the rerror/werror arguments that were specified when starting
2099 # the operation.
2101 # A cancelled or paused job cannot be completed.
2103 # @device: The job identifier. This used to be a device name (hence
2104 #          the name of the parameter), but since QEMU 2.7 it can have
2105 #          other values.
2107 # Returns: Nothing on success
2108 #          If no background operation is active on this device, DeviceNotActive
2110 # Since: 1.3
2112 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2115 # @BlockdevDiscardOptions:
2117 # Determines how to handle discard requests.
2119 # @ignore:      Ignore the request
2120 # @unmap:       Forward as an unmap request
2122 # Since: 2.9
2124 { 'enum': 'BlockdevDiscardOptions',
2125   'data': [ 'ignore', 'unmap' ] }
2128 # @BlockdevDetectZeroesOptions:
2130 # Describes the operation mode for the automatic conversion of plain
2131 # zero writes by the OS to driver specific optimized zero write commands.
2133 # @off:      Disabled (default)
2134 # @on:       Enabled
2135 # @unmap:    Enabled and even try to unmap blocks if possible. This requires
2136 #            also that @BlockdevDiscardOptions is set to unmap for this device.
2138 # Since: 2.1
2140 { 'enum': 'BlockdevDetectZeroesOptions',
2141   'data': [ 'off', 'on', 'unmap' ] }
2144 # @BlockdevAioOptions:
2146 # Selects the AIO backend to handle I/O requests
2148 # @threads:     Use qemu's thread pool
2149 # @native:      Use native AIO backend (only Linux and Windows)
2151 # Since: 2.9
2153 { 'enum': 'BlockdevAioOptions',
2154   'data': [ 'threads', 'native' ] }
2157 # @BlockdevCacheOptions:
2159 # Includes cache-related options for block devices
2161 # @direct:      enables use of O_DIRECT (bypass the host page cache;
2162 #               default: false)
2163 # @no-flush:    ignore any flush requests for the device (default:
2164 #               false)
2166 # Since: 2.9
2168 { 'struct': 'BlockdevCacheOptions',
2169   'data': { '*direct': 'bool',
2170             '*no-flush': 'bool' } }
2173 # @BlockdevDriver:
2175 # Drivers that are supported in block device operations.
2177 # @vxhs: Since 2.10
2179 # Since: 2.9
2181 { 'enum': 'BlockdevDriver',
2182   'data': [ 'blkdebug', 'blkverify', 'bochs', 'cloop',
2183             'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
2184             'host_device', 'http', 'https', 'iscsi', 'luks', 'nbd', 'nfs',
2185             'null-aio', 'null-co', 'parallels', 'qcow', 'qcow2', 'qed',
2186             'quorum', 'raw', 'rbd', 'replication', 'sheepdog', 'ssh',
2187             'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2190 # @BlockdevOptionsFile:
2192 # Driver specific block device options for the file backend.
2194 # @filename:    path to the image file
2195 # @aio:         AIO backend (default: threads) (since: 2.8)
2196 # @locking:     whether to enable file locking. If set to 'auto', only enable
2197 #               when Open File Descriptor (OFD) locking API is available
2198 #               (default: auto, since 2.10)
2200 # Since: 2.9
2202 { 'struct': 'BlockdevOptionsFile',
2203   'data': { 'filename': 'str',
2204             '*locking': 'OnOffAuto',
2205             '*aio': 'BlockdevAioOptions' } }
2208 # @BlockdevOptionsNull:
2210 # Driver specific block device options for the null backend.
2212 # @size:    size of the device in bytes.
2213 # @latency-ns: emulated latency (in nanoseconds) in processing
2214 #              requests. Default to zero which completes requests immediately.
2215 #              (Since 2.4)
2217 # Since: 2.9
2219 { 'struct': 'BlockdevOptionsNull',
2220   'data': { '*size': 'int', '*latency-ns': 'uint64' } }
2223 # @BlockdevOptionsVVFAT:
2225 # Driver specific block device options for the vvfat protocol.
2227 # @dir:         directory to be exported as FAT image
2228 # @fat-type:    FAT type: 12, 16 or 32
2229 # @floppy:      whether to export a floppy image (true) or
2230 #               partitioned hard disk (false; default)
2231 # @label:       set the volume label, limited to 11 bytes. FAT16 and
2232 #               FAT32 traditionally have some restrictions on labels, which are
2233 #               ignored by most operating systems. Defaults to "QEMU VVFAT".
2234 #               (since 2.4)
2235 # @rw:          whether to allow write operations (default: false)
2237 # Since: 2.9
2239 { 'struct': 'BlockdevOptionsVVFAT',
2240   'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2241             '*label': 'str', '*rw': 'bool' } }
2244 # @BlockdevOptionsGenericFormat:
2246 # Driver specific block device options for image format that have no option
2247 # besides their data source.
2249 # @file:        reference to or definition of the data source block device
2251 # Since: 2.9
2253 { 'struct': 'BlockdevOptionsGenericFormat',
2254   'data': { 'file': 'BlockdevRef' } }
2257 # @BlockdevOptionsLUKS:
2259 # Driver specific block device options for LUKS.
2261 # @key-secret: the ID of a QCryptoSecret object providing
2262 #              the decryption key (since 2.6). Mandatory except when
2263 #              doing a metadata-only probe of the image.
2265 # Since: 2.9
2267 { 'struct': 'BlockdevOptionsLUKS',
2268   'base': 'BlockdevOptionsGenericFormat',
2269   'data': { '*key-secret': 'str' } }
2273 # @BlockdevOptionsGenericCOWFormat:
2275 # Driver specific block device options for image format that have no option
2276 # besides their data source and an optional backing file.
2278 # @backing:     reference to or definition of the backing file block
2279 #               device, null disables the backing file entirely.
2280 #               Defaults to the backing file stored the image file.
2282 # Since: 2.9
2284 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2285   'base': 'BlockdevOptionsGenericFormat',
2286   'data': { '*backing': 'BlockdevRefOrNull' } }
2289 # @Qcow2OverlapCheckMode:
2291 # General overlap check modes.
2293 # @none:        Do not perform any checks
2295 # @constant:    Perform only checks which can be done in constant time and
2296 #               without reading anything from disk
2298 # @cached:      Perform only checks which can be done without reading anything
2299 #               from disk
2301 # @all:         Perform all available overlap checks
2303 # Since: 2.9
2305 { 'enum': 'Qcow2OverlapCheckMode',
2306   'data': [ 'none', 'constant', 'cached', 'all' ] }
2309 # @Qcow2OverlapCheckFlags:
2311 # Structure of flags for each metadata structure. Setting a field to 'true'
2312 # makes qemu guard that structure against unintended overwriting. The default
2313 # value is chosen according to the template given.
2315 # @template: Specifies a template mode which can be adjusted using the other
2316 #            flags, defaults to 'cached'
2318 # Since: 2.9
2320 { 'struct': 'Qcow2OverlapCheckFlags',
2321   'data': { '*template':       'Qcow2OverlapCheckMode',
2322             '*main-header':    'bool',
2323             '*active-l1':      'bool',
2324             '*active-l2':      'bool',
2325             '*refcount-table': 'bool',
2326             '*refcount-block': 'bool',
2327             '*snapshot-table': 'bool',
2328             '*inactive-l1':    'bool',
2329             '*inactive-l2':    'bool' } }
2332 # @Qcow2OverlapChecks:
2334 # Specifies which metadata structures should be guarded against unintended
2335 # overwriting.
2337 # @flags:   set of flags for separate specification of each metadata structure
2338 #           type
2340 # @mode:    named mode which chooses a specific set of flags
2342 # Since: 2.9
2344 { 'alternate': 'Qcow2OverlapChecks',
2345   'data': { 'flags': 'Qcow2OverlapCheckFlags',
2346             'mode':  'Qcow2OverlapCheckMode' } }
2349 # @BlockdevQcowEncryptionFormat:
2351 # @aes: AES-CBC with plain64 initialization vectors
2353 # Since: 2.10
2355 { 'enum': 'BlockdevQcowEncryptionFormat',
2356   'data': [ 'aes' ] }
2359 # @BlockdevQcowEncryption:
2361 # Since: 2.10
2363 { 'union': 'BlockdevQcowEncryption',
2364   'base': { 'format': 'BlockdevQcowEncryptionFormat' },
2365   'discriminator': 'format',
2366   'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
2369 # @BlockdevOptionsQcow:
2371 # Driver specific block device options for qcow.
2373 # @encrypt:               Image decryption options. Mandatory for
2374 #                         encrypted images, except when doing a metadata-only
2375 #                         probe of the image.
2377 # Since: 2.10
2379 { 'struct': 'BlockdevOptionsQcow',
2380   'base': 'BlockdevOptionsGenericCOWFormat',
2381   'data': { '*encrypt': 'BlockdevQcowEncryption' } }
2386 # @BlockdevQcow2EncryptionFormat:
2387 # @aes: AES-CBC with plain64 initialization venctors
2389 # Since: 2.10
2391 { 'enum': 'BlockdevQcow2EncryptionFormat',
2392   'data': [ 'aes', 'luks' ] }
2395 # @BlockdevQcow2Encryption:
2397 # Since: 2.10
2399 { 'union': 'BlockdevQcow2Encryption',
2400   'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
2401   'discriminator': 'format',
2402   'data': { 'aes': 'QCryptoBlockOptionsQCow',
2403             'luks': 'QCryptoBlockOptionsLUKS'} }
2406 # @BlockdevOptionsQcow2:
2408 # Driver specific block device options for qcow2.
2410 # @lazy-refcounts:        whether to enable the lazy refcounts
2411 #                         feature (default is taken from the image file)
2413 # @pass-discard-request:  whether discard requests to the qcow2
2414 #                         device should be forwarded to the data source
2416 # @pass-discard-snapshot: whether discard requests for the data source
2417 #                         should be issued when a snapshot operation (e.g.
2418 #                         deleting a snapshot) frees clusters in the qcow2 file
2420 # @pass-discard-other:    whether discard requests for the data source
2421 #                         should be issued on other occasions where a cluster
2422 #                         gets freed
2424 # @overlap-check:         which overlap checks to perform for writes
2425 #                         to the image, defaults to 'cached' (since 2.2)
2427 # @cache-size:            the maximum total size of the L2 table and
2428 #                         refcount block caches in bytes (since 2.2)
2430 # @l2-cache-size:         the maximum size of the L2 table cache in
2431 #                         bytes (since 2.2)
2433 # @refcount-cache-size:   the maximum size of the refcount block cache
2434 #                         in bytes (since 2.2)
2436 # @cache-clean-interval:  clean unused entries in the L2 and refcount
2437 #                         caches. The interval is in seconds. The default value
2438 #                         is 0 and it disables this feature (since 2.5)
2439 # @encrypt:               Image decryption options. Mandatory for
2440 #                         encrypted images, except when doing a metadata-only
2441 #                         probe of the image. (since 2.10)
2443 # Since: 2.9
2445 { 'struct': 'BlockdevOptionsQcow2',
2446   'base': 'BlockdevOptionsGenericCOWFormat',
2447   'data': { '*lazy-refcounts': 'bool',
2448             '*pass-discard-request': 'bool',
2449             '*pass-discard-snapshot': 'bool',
2450             '*pass-discard-other': 'bool',
2451             '*overlap-check': 'Qcow2OverlapChecks',
2452             '*cache-size': 'int',
2453             '*l2-cache-size': 'int',
2454             '*refcount-cache-size': 'int',
2455             '*cache-clean-interval': 'int',
2456             '*encrypt': 'BlockdevQcow2Encryption' } }
2459 # @BlockdevOptionsSsh:
2461 # @server:              host address
2463 # @path:                path to the image on the host
2465 # @user:                user as which to connect, defaults to current
2466 #                       local user name
2468 # TODO: Expose the host_key_check option in QMP
2470 # Since: 2.9
2472 { 'struct': 'BlockdevOptionsSsh',
2473   'data': { 'server': 'InetSocketAddress',
2474             'path': 'str',
2475             '*user': 'str' } }
2479 # @BlkdebugEvent:
2481 # Trigger events supported by blkdebug.
2483 # Since: 2.9
2485 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
2486   'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
2487             'l1_grow_activate_table', 'l2_load', 'l2_update',
2488             'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
2489             'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
2490             'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
2491             'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
2492             'refblock_load', 'refblock_update', 'refblock_update_part',
2493             'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
2494             'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
2495             'refblock_alloc_switch_table', 'cluster_alloc',
2496             'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
2497             'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
2498             'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
2499             'pwritev_zero', 'pwritev_done', 'empty_image_prepare' ] }
2502 # @BlkdebugInjectErrorOptions:
2504 # Describes a single error injection for blkdebug.
2506 # @event:       trigger event
2508 # @state:       the state identifier blkdebug needs to be in to
2509 #               actually trigger the event; defaults to "any"
2511 # @errno:       error identifier (errno) to be returned; defaults to
2512 #               EIO
2514 # @sector:      specifies the sector index which has to be affected
2515 #               in order to actually trigger the event; defaults to "any
2516 #               sector"
2518 # @once:        disables further events after this one has been
2519 #               triggered; defaults to false
2521 # @immediately: fail immediately; defaults to false
2523 # Since: 2.9
2525 { 'struct': 'BlkdebugInjectErrorOptions',
2526   'data': { 'event': 'BlkdebugEvent',
2527             '*state': 'int',
2528             '*errno': 'int',
2529             '*sector': 'int',
2530             '*once': 'bool',
2531             '*immediately': 'bool' } }
2534 # @BlkdebugSetStateOptions:
2536 # Describes a single state-change event for blkdebug.
2538 # @event:       trigger event
2540 # @state:       the current state identifier blkdebug needs to be in;
2541 #               defaults to "any"
2543 # @new_state:   the state identifier blkdebug is supposed to assume if
2544 #               this event is triggered
2546 # Since: 2.9
2548 { 'struct': 'BlkdebugSetStateOptions',
2549   'data': { 'event': 'BlkdebugEvent',
2550             '*state': 'int',
2551             'new_state': 'int' } }
2554 # @BlockdevOptionsBlkdebug:
2556 # Driver specific block device options for blkdebug.
2558 # @image:           underlying raw block device (or image file)
2560 # @config:          filename of the configuration file
2562 # @align:           required alignment for requests in bytes, must be
2563 #                   positive power of 2, or 0 for default
2565 # @max-transfer:    maximum size for I/O transfers in bytes, must be
2566 #                   positive multiple of @align and of the underlying
2567 #                   file's request alignment (but need not be a power of
2568 #                   2), or 0 for default (since 2.10)
2570 # @opt-write-zero:  preferred alignment for write zero requests in bytes,
2571 #                   must be positive multiple of @align and of the
2572 #                   underlying file's request alignment (but need not be a
2573 #                   power of 2), or 0 for default (since 2.10)
2575 # @max-write-zero:  maximum size for write zero requests in bytes, must be
2576 #                   positive multiple of @align, of @opt-write-zero, and of
2577 #                   the underlying file's request alignment (but need not
2578 #                   be a power of 2), or 0 for default (since 2.10)
2580 # @opt-discard:     preferred alignment for discard requests in bytes, must
2581 #                   be positive multiple of @align and of the underlying
2582 #                   file's request alignment (but need not be a power of
2583 #                   2), or 0 for default (since 2.10)
2585 # @max-discard:     maximum size for discard requests in bytes, must be
2586 #                   positive multiple of @align, of @opt-discard, and of
2587 #                   the underlying file's request alignment (but need not
2588 #                   be a power of 2), or 0 for default (since 2.10)
2590 # @inject-error:    array of error injection descriptions
2592 # @set-state:       array of state-change descriptions
2594 # Since: 2.9
2596 { 'struct': 'BlockdevOptionsBlkdebug',
2597   'data': { 'image': 'BlockdevRef',
2598             '*config': 'str',
2599             '*align': 'int', '*max-transfer': 'int32',
2600             '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
2601             '*opt-discard': 'int32', '*max-discard': 'int32',
2602             '*inject-error': ['BlkdebugInjectErrorOptions'],
2603             '*set-state': ['BlkdebugSetStateOptions'] } }
2606 # @BlockdevOptionsBlkverify:
2608 # Driver specific block device options for blkverify.
2610 # @test:    block device to be tested
2612 # @raw:     raw image used for verification
2614 # Since: 2.9
2616 { 'struct': 'BlockdevOptionsBlkverify',
2617   'data': { 'test': 'BlockdevRef',
2618             'raw': 'BlockdevRef' } }
2621 # @QuorumReadPattern:
2623 # An enumeration of quorum read patterns.
2625 # @quorum: read all the children and do a quorum vote on reads
2627 # @fifo: read only from the first child that has not failed
2629 # Since: 2.9
2631 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
2634 # @BlockdevOptionsQuorum:
2636 # Driver specific block device options for Quorum
2638 # @blkverify:      true if the driver must print content mismatch
2639 #                  set to false by default
2641 # @children:       the children block devices to use
2643 # @vote-threshold: the vote limit under which a read will fail
2645 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
2646 #                     (Since 2.1)
2648 # @read-pattern: choose read pattern and set to quorum by default
2649 #                (Since 2.2)
2651 # Since: 2.9
2653 { 'struct': 'BlockdevOptionsQuorum',
2654   'data': { '*blkverify': 'bool',
2655             'children': [ 'BlockdevRef' ],
2656             'vote-threshold': 'int',
2657             '*rewrite-corrupted': 'bool',
2658             '*read-pattern': 'QuorumReadPattern' } }
2661 # @BlockdevOptionsGluster:
2663 # Driver specific block device options for Gluster
2665 # @volume:      name of gluster volume where VM image resides
2667 # @path:        absolute path to image file in gluster volume
2669 # @server:      gluster servers description
2671 # @debug:       libgfapi log level (default '4' which is Error)
2672 #               (Since 2.8)
2674 # @logfile:     libgfapi log file (default /dev/stderr) (Since 2.8)
2676 # Since: 2.9
2678 { 'struct': 'BlockdevOptionsGluster',
2679   'data': { 'volume': 'str',
2680             'path': 'str',
2681             'server': ['SocketAddress'],
2682             '*debug': 'int',
2683             '*logfile': 'str' } }
2686 # @IscsiTransport:
2688 # An enumeration of libiscsi transport types
2690 # Since: 2.9
2692 { 'enum': 'IscsiTransport',
2693   'data': [ 'tcp', 'iser' ] }
2696 # @IscsiHeaderDigest:
2698 # An enumeration of header digests supported by libiscsi
2700 # Since: 2.9
2702 { 'enum': 'IscsiHeaderDigest',
2703   'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
2704   'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
2707 # @BlockdevOptionsIscsi:
2709 # @transport:       The iscsi transport type
2711 # @portal:          The address of the iscsi portal
2713 # @target:          The target iqn name
2715 # @lun:             LUN to connect to. Defaults to 0.
2717 # @user:            User name to log in with. If omitted, no CHAP
2718 #                   authentication is performed.
2720 # @password-secret: The ID of a QCryptoSecret object providing
2721 #                   the password for the login. This option is required if
2722 #                   @user is specified.
2724 # @initiator-name:  The iqn name we want to identify to the target
2725 #                   as. If this option is not specified, an initiator name is
2726 #                   generated automatically.
2728 # @header-digest:   The desired header digest. Defaults to
2729 #                   none-crc32c.
2731 # @timeout:         Timeout in seconds after which a request will
2732 #                   timeout. 0 means no timeout and is the default.
2734 # Driver specific block device options for iscsi
2736 # Since: 2.9
2738 { 'struct': 'BlockdevOptionsIscsi',
2739   'data': { 'transport': 'IscsiTransport',
2740             'portal': 'str',
2741             'target': 'str',
2742             '*lun': 'int',
2743             '*user': 'str',
2744             '*password-secret': 'str',
2745             '*initiator-name': 'str',
2746             '*header-digest': 'IscsiHeaderDigest',
2747             '*timeout': 'int' } }
2751 # @BlockdevOptionsRbd:
2753 # @pool:               Ceph pool name.
2755 # @image:              Image name in the Ceph pool.
2757 # @conf:               path to Ceph configuration file.  Values
2758 #                      in the configuration file will be overridden by
2759 #                      options specified via QAPI.
2761 # @snapshot:           Ceph snapshot name.
2763 # @user:               Ceph id name.
2765 # @server:             Monitor host address and port.  This maps
2766 #                      to the "mon_host" Ceph option.
2768 # Since: 2.9
2770 { 'struct': 'BlockdevOptionsRbd',
2771   'data': { 'pool': 'str',
2772             'image': 'str',
2773             '*conf': 'str',
2774             '*snapshot': 'str',
2775             '*user': 'str',
2776             '*server': ['InetSocketAddressBase'] } }
2779 # @BlockdevOptionsSheepdog:
2781 # Driver specific block device options for sheepdog
2783 # @vdi:         Virtual disk image name
2784 # @server:      The Sheepdog server to connect to
2785 # @snap-id:     Snapshot ID
2786 # @tag:         Snapshot tag name
2788 # Only one of @snap-id and @tag may be present.
2790 # Since: 2.9
2792 { 'struct': 'BlockdevOptionsSheepdog',
2793   'data': { 'server': 'SocketAddress',
2794             'vdi': 'str',
2795             '*snap-id': 'uint32',
2796             '*tag': 'str' } }
2799 # @ReplicationMode:
2801 # An enumeration of replication modes.
2803 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
2805 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
2807 # Since: 2.9
2809 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
2812 # @BlockdevOptionsReplication:
2814 # Driver specific block device options for replication
2816 # @mode: the replication mode
2818 # @top-id: In secondary mode, node name or device ID of the root
2819 #          node who owns the replication node chain. Must not be given in
2820 #          primary mode.
2822 # Since: 2.9
2824 { 'struct': 'BlockdevOptionsReplication',
2825   'base': 'BlockdevOptionsGenericFormat',
2826   'data': { 'mode': 'ReplicationMode',
2827             '*top-id': 'str' } }
2830 # @NFSTransport:
2832 # An enumeration of NFS transport types
2834 # @inet:        TCP transport
2836 # Since: 2.9
2838 { 'enum': 'NFSTransport',
2839   'data': [ 'inet' ] }
2842 # @NFSServer:
2844 # Captures the address of the socket
2846 # @type:        transport type used for NFS (only TCP supported)
2848 # @host:        host address for NFS server
2850 # Since: 2.9
2852 { 'struct': 'NFSServer',
2853   'data': { 'type': 'NFSTransport',
2854             'host': 'str' } }
2857 # @BlockdevOptionsNfs:
2859 # Driver specific block device option for NFS
2861 # @server:                  host address
2863 # @path:                    path of the image on the host
2865 # @user:                    UID value to use when talking to the
2866 #                           server (defaults to 65534 on Windows and getuid()
2867 #                           on unix)
2869 # @group:                   GID value to use when talking to the
2870 #                           server (defaults to 65534 on Windows and getgid()
2871 #                           in unix)
2873 # @tcp-syn-count:           number of SYNs during the session
2874 #                           establishment (defaults to libnfs default)
2876 # @readahead-size:          set the readahead size in bytes (defaults
2877 #                           to libnfs default)
2879 # @page-cache-size:         set the pagecache size in bytes (defaults
2880 #                           to libnfs default)
2882 # @debug:                   set the NFS debug level (max 2) (defaults
2883 #                           to libnfs default)
2885 # Since: 2.9
2887 { 'struct': 'BlockdevOptionsNfs',
2888   'data': { 'server': 'NFSServer',
2889             'path': 'str',
2890             '*user': 'int',
2891             '*group': 'int',
2892             '*tcp-syn-count': 'int',
2893             '*readahead-size': 'int',
2894             '*page-cache-size': 'int',
2895             '*debug': 'int' } }
2898 # @BlockdevOptionsCurlBase:
2900 # Driver specific block device options shared by all protocols supported by the
2901 # curl backend.
2903 # @url:                     URL of the image file
2905 # @readahead:               Size of the read-ahead cache; must be a multiple of
2906 #                           512 (defaults to 256 kB)
2908 # @timeout:                 Timeout for connections, in seconds (defaults to 5)
2910 # @username:                Username for authentication (defaults to none)
2912 # @password-secret:         ID of a QCryptoSecret object providing a password
2913 #                           for authentication (defaults to no password)
2915 # @proxy-username:          Username for proxy authentication (defaults to none)
2917 # @proxy-password-secret:   ID of a QCryptoSecret object providing a password
2918 #                           for proxy authentication (defaults to no password)
2920 # Since: 2.9
2922 { 'struct': 'BlockdevOptionsCurlBase',
2923   'data': { 'url': 'str',
2924             '*readahead': 'int',
2925             '*timeout': 'int',
2926             '*username': 'str',
2927             '*password-secret': 'str',
2928             '*proxy-username': 'str',
2929             '*proxy-password-secret': 'str' } }
2932 # @BlockdevOptionsCurlHttp:
2934 # Driver specific block device options for HTTP connections over the curl
2935 # backend.  URLs must start with "http://".
2937 # @cookie:      List of cookies to set; format is
2938 #               "name1=content1; name2=content2;" as explained by
2939 #               CURLOPT_COOKIE(3). Defaults to no cookies.
2941 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
2942 #                 secure way. See @cookie for the format. (since 2.10)
2944 # Since: 2.9
2946 { 'struct': 'BlockdevOptionsCurlHttp',
2947   'base': 'BlockdevOptionsCurlBase',
2948   'data': { '*cookie': 'str',
2949             '*cookie-secret': 'str'} }
2952 # @BlockdevOptionsCurlHttps:
2954 # Driver specific block device options for HTTPS connections over the curl
2955 # backend.  URLs must start with "https://".
2957 # @cookie:      List of cookies to set; format is
2958 #               "name1=content1; name2=content2;" as explained by
2959 #               CURLOPT_COOKIE(3). Defaults to no cookies.
2961 # @sslverify:   Whether to verify the SSL certificate's validity (defaults to
2962 #               true)
2964 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
2965 #                 secure way. See @cookie for the format. (since 2.10)
2967 # Since: 2.9
2969 { 'struct': 'BlockdevOptionsCurlHttps',
2970   'base': 'BlockdevOptionsCurlBase',
2971   'data': { '*cookie': 'str',
2972             '*sslverify': 'bool',
2973             '*cookie-secret': 'str'} }
2976 # @BlockdevOptionsCurlFtp:
2978 # Driver specific block device options for FTP connections over the curl
2979 # backend.  URLs must start with "ftp://".
2981 # Since: 2.9
2983 { 'struct': 'BlockdevOptionsCurlFtp',
2984   'base': 'BlockdevOptionsCurlBase',
2985   'data': { } }
2988 # @BlockdevOptionsCurlFtps:
2990 # Driver specific block device options for FTPS connections over the curl
2991 # backend.  URLs must start with "ftps://".
2993 # @sslverify:   Whether to verify the SSL certificate's validity (defaults to
2994 #               true)
2996 # Since: 2.9
2998 { 'struct': 'BlockdevOptionsCurlFtps',
2999   'base': 'BlockdevOptionsCurlBase',
3000   'data': { '*sslverify': 'bool' } }
3003 # @BlockdevOptionsNbd:
3005 # Driver specific block device options for NBD.
3007 # @server:      NBD server address
3009 # @export:      export name
3011 # @tls-creds:   TLS credentials ID
3013 # Since: 2.9
3015 { 'struct': 'BlockdevOptionsNbd',
3016   'data': { 'server': 'SocketAddress',
3017             '*export': 'str',
3018             '*tls-creds': 'str' } }
3021 # @BlockdevOptionsRaw:
3023 # Driver specific block device options for the raw driver.
3025 # @offset:      position where the block device starts
3026 # @size:        the assumed size of the device
3028 # Since: 2.9
3030 { 'struct': 'BlockdevOptionsRaw',
3031   'base': 'BlockdevOptionsGenericFormat',
3032   'data': { '*offset': 'int', '*size': 'int' } }
3035 # @BlockdevOptionsVxHS:
3037 # Driver specific block device options for VxHS
3039 # @vdisk-id:    UUID of VxHS volume
3040 # @server:      vxhs server IP, port
3041 # @tls-creds:   TLS credentials ID
3043 # Since: 2.10
3045 { 'struct': 'BlockdevOptionsVxHS',
3046   'data': { 'vdisk-id': 'str',
3047             'server': 'InetSocketAddressBase',
3048             '*tls-creds': 'str' } }
3051 # @BlockdevOptions:
3053 # Options for creating a block device.  Many options are available for all
3054 # block devices, independent of the block driver:
3056 # @driver:        block driver name
3057 # @node-name:     the node name of the new node (Since 2.0).
3058 #                 This option is required on the top level of blockdev-add.
3059 # @discard:       discard-related options (default: ignore)
3060 # @cache:         cache-related options
3061 # @read-only:     whether the block device should be read-only
3062 #                 (default: false)
3063 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3064 #                 (default: off)
3065 # @force-share:   force share all permission on added nodes.
3066 #                 Requires read-only=true. (Since 2.10)
3068 # Remaining options are determined by the block driver.
3070 # Since: 2.9
3072 { 'union': 'BlockdevOptions',
3073   'base': { 'driver': 'BlockdevDriver',
3074             '*node-name': 'str',
3075             '*discard': 'BlockdevDiscardOptions',
3076             '*cache': 'BlockdevCacheOptions',
3077             '*read-only': 'bool',
3078             '*force-share': 'bool',
3079             '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3080   'discriminator': 'driver',
3081   'data': {
3082       'blkdebug':   'BlockdevOptionsBlkdebug',
3083       'blkverify':  'BlockdevOptionsBlkverify',
3084       'bochs':      'BlockdevOptionsGenericFormat',
3085       'cloop':      'BlockdevOptionsGenericFormat',
3086       'dmg':        'BlockdevOptionsGenericFormat',
3087       'file':       'BlockdevOptionsFile',
3088       'ftp':        'BlockdevOptionsCurlFtp',
3089       'ftps':       'BlockdevOptionsCurlFtps',
3090       'gluster':    'BlockdevOptionsGluster',
3091       'host_cdrom': 'BlockdevOptionsFile',
3092       'host_device':'BlockdevOptionsFile',
3093       'http':       'BlockdevOptionsCurlHttp',
3094       'https':      'BlockdevOptionsCurlHttps',
3095       'iscsi':      'BlockdevOptionsIscsi',
3096       'luks':       'BlockdevOptionsLUKS',
3097       'nbd':        'BlockdevOptionsNbd',
3098       'nfs':        'BlockdevOptionsNfs',
3099       'null-aio':   'BlockdevOptionsNull',
3100       'null-co':    'BlockdevOptionsNull',
3101       'parallels':  'BlockdevOptionsGenericFormat',
3102       'qcow2':      'BlockdevOptionsQcow2',
3103       'qcow':       'BlockdevOptionsQcow',
3104       'qed':        'BlockdevOptionsGenericCOWFormat',
3105       'quorum':     'BlockdevOptionsQuorum',
3106       'raw':        'BlockdevOptionsRaw',
3107       'rbd':        'BlockdevOptionsRbd',
3108       'replication':'BlockdevOptionsReplication',
3109       'sheepdog':   'BlockdevOptionsSheepdog',
3110       'ssh':        'BlockdevOptionsSsh',
3111       'vdi':        'BlockdevOptionsGenericFormat',
3112       'vhdx':       'BlockdevOptionsGenericFormat',
3113       'vmdk':       'BlockdevOptionsGenericCOWFormat',
3114       'vpc':        'BlockdevOptionsGenericFormat',
3115       'vvfat':      'BlockdevOptionsVVFAT',
3116       'vxhs':       'BlockdevOptionsVxHS'
3117   } }
3120 # @BlockdevRef:
3122 # Reference to a block device.
3124 # @definition:      defines a new block device inline
3125 # @reference:       references the ID of an existing block device
3127 # Since: 2.9
3129 { 'alternate': 'BlockdevRef',
3130   'data': { 'definition': 'BlockdevOptions',
3131             'reference': 'str' } }
3134 # @BlockdevRefOrNull:
3136 # Reference to a block device.
3138 # @definition:      defines a new block device inline
3139 # @reference:       references the ID of an existing block device.
3140 #                   An empty string means that no block device should
3141 #                   be referenced.  Deprecated; use null instead.
3142 # @null:            No block device should be referenced (since 2.10)
3144 # Since: 2.9
3146 { 'alternate': 'BlockdevRefOrNull',
3147   'data': { 'definition': 'BlockdevOptions',
3148             'reference': 'str',
3149             'null': 'null' } }
3152 # @blockdev-add:
3154 # Creates a new block device. If the @id option is given at the top level, a
3155 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
3156 # level and no BlockBackend will be created.
3158 # Since: 2.9
3160 # Example:
3162 # 1.
3163 # -> { "execute": "blockdev-add",
3164 #      "arguments": {
3165 #           "driver": "qcow2",
3166 #           "node-name": "test1",
3167 #           "file": {
3168 #               "driver": "file",
3169 #               "filename": "test.qcow2"
3170 #            }
3171 #       }
3172 #     }
3173 # <- { "return": {} }
3175 # 2.
3176 # -> { "execute": "blockdev-add",
3177 #      "arguments": {
3178 #           "driver": "qcow2",
3179 #           "node-name": "node0",
3180 #           "discard": "unmap",
3181 #           "cache": {
3182 #              "direct": true
3183 #            },
3184 #            "file": {
3185 #              "driver": "file",
3186 #              "filename": "/tmp/test.qcow2"
3187 #            },
3188 #            "backing": {
3189 #               "driver": "raw",
3190 #               "file": {
3191 #                  "driver": "file",
3192 #                  "filename": "/dev/fdset/4"
3193 #                }
3194 #            }
3195 #        }
3196 #      }
3198 # <- { "return": {} }
3201 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
3204 # @blockdev-del:
3206 # Deletes a block device that has been added using blockdev-add.
3207 # The command will fail if the node is attached to a device or is
3208 # otherwise being used.
3210 # @node-name: Name of the graph node to delete.
3212 # Since: 2.9
3214 # Example:
3216 # -> { "execute": "blockdev-add",
3217 #      "arguments": {
3218 #           "driver": "qcow2",
3219 #           "node-name": "node0",
3220 #           "file": {
3221 #               "driver": "file",
3222 #               "filename": "test.qcow2"
3223 #           }
3224 #      }
3225 #    }
3226 # <- { "return": {} }
3228 # -> { "execute": "blockdev-del",
3229 #      "arguments": { "node-name": "node0" }
3230 #    }
3231 # <- { "return": {} }
3234 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
3237 # @blockdev-open-tray:
3239 # Opens a block device's tray. If there is a block driver state tree inserted as
3240 # a medium, it will become inaccessible to the guest (but it will remain
3241 # associated to the block device, so closing the tray will make it accessible
3242 # again).
3244 # If the tray was already open before, this will be a no-op.
3246 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
3247 # which no such event will be generated, these include:
3248 # - if the guest has locked the tray, @force is false and the guest does not
3249 #   respond to the eject request
3250 # - if the BlockBackend denoted by @device does not have a guest device attached
3251 #   to it
3252 # - if the guest device does not have an actual tray
3254 # @device: Block device name (deprecated, use @id instead)
3256 # @id:     The name or QOM path of the guest device (since: 2.8)
3258 # @force:  if false (the default), an eject request will be sent to
3259 #          the guest if it has locked the tray (and the tray will not be opened
3260 #          immediately); if true, the tray will be opened regardless of whether
3261 #          it is locked
3263 # Since: 2.5
3265 # Example:
3267 # -> { "execute": "blockdev-open-tray",
3268 #      "arguments": { "id": "ide0-1-0" } }
3270 # <- { "timestamp": { "seconds": 1418751016,
3271 #                     "microseconds": 716996 },
3272 #      "event": "DEVICE_TRAY_MOVED",
3273 #      "data": { "device": "ide1-cd0",
3274 #                "id": "ide0-1-0",
3275 #                "tray-open": true } }
3277 # <- { "return": {} }
3280 { 'command': 'blockdev-open-tray',
3281   'data': { '*device': 'str',
3282             '*id': 'str',
3283             '*force': 'bool' } }
3286 # @blockdev-close-tray:
3288 # Closes a block device's tray. If there is a block driver state tree associated
3289 # with the block device (which is currently ejected), that tree will be loaded
3290 # as the medium.
3292 # If the tray was already closed before, this will be a no-op.
3294 # @device:  Block device name (deprecated, use @id instead)
3296 # @id:      The name or QOM path of the guest device (since: 2.8)
3298 # Since: 2.5
3300 # Example:
3302 # -> { "execute": "blockdev-close-tray",
3303 #      "arguments": { "id": "ide0-1-0" } }
3305 # <- { "timestamp": { "seconds": 1418751345,
3306 #                     "microseconds": 272147 },
3307 #      "event": "DEVICE_TRAY_MOVED",
3308 #      "data": { "device": "ide1-cd0",
3309 #                "id": "ide0-1-0",
3310 #                "tray-open": false } }
3312 # <- { "return": {} }
3315 { 'command': 'blockdev-close-tray',
3316   'data': { '*device': 'str',
3317             '*id': 'str' } }
3320 # @x-blockdev-remove-medium:
3322 # Removes a medium (a block driver state tree) from a block device. That block
3323 # device's tray must currently be open (unless there is no attached guest
3324 # device).
3326 # If the tray is open and there is no medium inserted, this will be a no-op.
3328 # @device: Block device name (deprecated, use @id instead)
3330 # @id:     The name or QOM path of the guest device (since: 2.8)
3332 # Note: This command is still a work in progress and is considered experimental.
3333 # Stay away from it unless you want to help with its development.
3335 # Since: 2.5
3337 # Example:
3339 # -> { "execute": "x-blockdev-remove-medium",
3340 #      "arguments": { "id": "ide0-1-0" } }
3342 # <- { "error": { "class": "GenericError",
3343 #                 "desc": "Tray of device 'ide0-1-0' is not open" } }
3345 # -> { "execute": "blockdev-open-tray",
3346 #      "arguments": { "id": "ide0-1-0" } }
3348 # <- { "timestamp": { "seconds": 1418751627,
3349 #                     "microseconds": 549958 },
3350 #      "event": "DEVICE_TRAY_MOVED",
3351 #      "data": { "device": "ide1-cd0",
3352 #                "id": "ide0-1-0",
3353 #                "tray-open": true } }
3355 # <- { "return": {} }
3357 # -> { "execute": "x-blockdev-remove-medium",
3358 #      "arguments": { "id": "ide0-1-0" } }
3360 # <- { "return": {} }
3363 { 'command': 'x-blockdev-remove-medium',
3364   'data': { '*device': 'str',
3365             '*id': 'str' } }
3368 # @x-blockdev-insert-medium:
3370 # Inserts a medium (a block driver state tree) into a block device. That block
3371 # device's tray must currently be open (unless there is no attached guest
3372 # device) and there must be no medium inserted already.
3374 # @device:    Block device name (deprecated, use @id instead)
3376 # @id:        The name or QOM path of the guest device (since: 2.8)
3378 # @node-name: name of a node in the block driver state graph
3380 # Note: This command is still a work in progress and is considered experimental.
3381 # Stay away from it unless you want to help with its development.
3383 # Since: 2.5
3385 # Example:
3387 # -> { "execute": "blockdev-add",
3388 #      "arguments": {
3389 #          "node-name": "node0",
3390 #          "driver": "raw",
3391 #          "file": { "driver": "file",
3392 #                    "filename": "fedora.iso" } } }
3393 # <- { "return": {} }
3395 # -> { "execute": "x-blockdev-insert-medium",
3396 #      "arguments": { "id": "ide0-1-0",
3397 #                     "node-name": "node0" } }
3399 # <- { "return": {} }
3402 { 'command': 'x-blockdev-insert-medium',
3403   'data': { '*device': 'str',
3404             '*id': 'str',
3405             'node-name': 'str'} }
3409 # @BlockdevChangeReadOnlyMode:
3411 # Specifies the new read-only mode of a block device subject to the
3412 # @blockdev-change-medium command.
3414 # @retain:      Retains the current read-only mode
3416 # @read-only:   Makes the device read-only
3418 # @read-write:  Makes the device writable
3420 # Since: 2.3
3423 { 'enum': 'BlockdevChangeReadOnlyMode',
3424   'data': ['retain', 'read-only', 'read-write'] }
3428 # @blockdev-change-medium:
3430 # Changes the medium inserted into a block device by ejecting the current medium
3431 # and loading a new image file which is inserted as the new medium (this command
3432 # combines blockdev-open-tray, x-blockdev-remove-medium,
3433 # x-blockdev-insert-medium and blockdev-close-tray).
3435 # @device:          Block device name (deprecated, use @id instead)
3437 # @id:              The name or QOM path of the guest device
3438 #                   (since: 2.8)
3440 # @filename:        filename of the new image to be loaded
3442 # @format:          format to open the new image with (defaults to
3443 #                   the probed format)
3445 # @read-only-mode:  change the read-only mode of the device; defaults
3446 #                   to 'retain'
3448 # Since: 2.5
3450 # Examples:
3452 # 1. Change a removable medium
3454 # -> { "execute": "blockdev-change-medium",
3455 #      "arguments": { "id": "ide0-1-0",
3456 #                     "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
3457 #                     "format": "raw" } }
3458 # <- { "return": {} }
3460 # 2. Load a read-only medium into a writable drive
3462 # -> { "execute": "blockdev-change-medium",
3463 #      "arguments": { "id": "floppyA",
3464 #                     "filename": "/srv/images/ro.img",
3465 #                     "format": "raw",
3466 #                     "read-only-mode": "retain" } }
3468 # <- { "error":
3469 #      { "class": "GenericError",
3470 #        "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
3472 # -> { "execute": "blockdev-change-medium",
3473 #      "arguments": { "id": "floppyA",
3474 #                     "filename": "/srv/images/ro.img",
3475 #                     "format": "raw",
3476 #                     "read-only-mode": "read-only" } }
3478 # <- { "return": {} }
3481 { 'command': 'blockdev-change-medium',
3482   'data': { '*device': 'str',
3483             '*id': 'str',
3484             'filename': 'str',
3485             '*format': 'str',
3486             '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
3490 # @BlockErrorAction:
3492 # An enumeration of action that has been taken when a DISK I/O occurs
3494 # @ignore: error has been ignored
3496 # @report: error has been reported to the device
3498 # @stop: error caused VM to be stopped
3500 # Since: 2.1
3502 { 'enum': 'BlockErrorAction',
3503   'data': [ 'ignore', 'report', 'stop' ] }
3507 # @BLOCK_IMAGE_CORRUPTED:
3509 # Emitted when a disk image is being marked corrupt. The image can be
3510 # identified by its device or node name. The 'device' field is always
3511 # present for compatibility reasons, but it can be empty ("") if the
3512 # image does not have a device name associated.
3514 # @device: device name. This is always present for compatibility
3515 #          reasons, but it can be empty ("") if the image does not
3516 #          have a device name associated.
3518 # @node-name: node name (Since: 2.4)
3520 # @msg: informative message for human consumption, such as the kind of
3521 #       corruption being detected. It should not be parsed by machine as it is
3522 #       not guaranteed to be stable
3524 # @offset: if the corruption resulted from an image access, this is
3525 #          the host's access offset into the image
3527 # @size: if the corruption resulted from an image access, this is
3528 #        the access size
3530 # @fatal: if set, the image is marked corrupt and therefore unusable after this
3531 #        event and must be repaired (Since 2.2; before, every
3532 #        BLOCK_IMAGE_CORRUPTED event was fatal)
3534 # Note: If action is "stop", a STOP event will eventually follow the
3535 #       BLOCK_IO_ERROR event.
3537 # Example:
3539 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
3540 #      "data": { "device": "ide0-hd0", "node-name": "node0",
3541 #                "msg": "Prevented active L1 table overwrite", "offset": 196608,
3542 #                "size": 65536 },
3543 #      "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
3545 # Since: 1.7
3547 { 'event': 'BLOCK_IMAGE_CORRUPTED',
3548   'data': { 'device'     : 'str',
3549             '*node-name' : 'str',
3550             'msg'        : 'str',
3551             '*offset'    : 'int',
3552             '*size'      : 'int',
3553             'fatal'      : 'bool' } }
3556 # @BLOCK_IO_ERROR:
3558 # Emitted when a disk I/O error occurs
3560 # @device: device name. This is always present for compatibility
3561 #          reasons, but it can be empty ("") if the image does not
3562 #          have a device name associated.
3564 # @node-name: node name. Note that errors may be reported for the root node
3565 #             that is directly attached to a guest device rather than for the
3566 #             node where the error occurred. (Since: 2.8)
3568 # @operation: I/O operation
3570 # @action: action that has been taken
3572 # @nospace: true if I/O error was caused due to a no-space
3573 #           condition. This key is only present if query-block's
3574 #           io-status is present, please see query-block documentation
3575 #           for more information (since: 2.2)
3577 # @reason: human readable string describing the error cause.
3578 #          (This field is a debugging aid for humans, it should not
3579 #           be parsed by applications) (since: 2.2)
3581 # Note: If action is "stop", a STOP event will eventually follow the
3582 # BLOCK_IO_ERROR event
3584 # Since: 0.13.0
3586 # Example:
3588 # <- { "event": "BLOCK_IO_ERROR",
3589 #      "data": { "device": "ide0-hd1",
3590 #                "node-name": "#block212",
3591 #                "operation": "write",
3592 #                "action": "stop" },
3593 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3596 { 'event': 'BLOCK_IO_ERROR',
3597   'data': { 'device': 'str', 'node-name': 'str', 'operation': 'IoOperationType',
3598             'action': 'BlockErrorAction', '*nospace': 'bool',
3599             'reason': 'str' } }
3602 # @BLOCK_JOB_COMPLETED:
3604 # Emitted when a block job has completed
3606 # @type: job type
3608 # @device: The job identifier. Originally the device name but other
3609 #          values are allowed since QEMU 2.7
3611 # @len: maximum progress value
3613 # @offset: current progress value. On success this is equal to len.
3614 #          On failure this is less than len
3616 # @speed: rate limit, bytes per second
3618 # @error: error message. Only present on failure. This field
3619 #         contains a human-readable error message. There are no semantics
3620 #         other than that streaming has failed and clients should not try to
3621 #         interpret the error string
3623 # Since: 1.1
3625 # Example:
3627 # <- { "event": "BLOCK_JOB_COMPLETED",
3628 #      "data": { "type": "stream", "device": "virtio-disk0",
3629 #                "len": 10737418240, "offset": 10737418240,
3630 #                "speed": 0 },
3631 #      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
3634 { 'event': 'BLOCK_JOB_COMPLETED',
3635   'data': { 'type'  : 'BlockJobType',
3636             'device': 'str',
3637             'len'   : 'int',
3638             'offset': 'int',
3639             'speed' : 'int',
3640             '*error': 'str' } }
3643 # @BLOCK_JOB_CANCELLED:
3645 # Emitted when a block job has been cancelled
3647 # @type: job type
3649 # @device: The job identifier. Originally the device name but other
3650 #          values are allowed since QEMU 2.7
3652 # @len: maximum progress value
3654 # @offset: current progress value. On success this is equal to len.
3655 #          On failure this is less than len
3657 # @speed: rate limit, bytes per second
3659 # Since: 1.1
3661 # Example:
3663 # <- { "event": "BLOCK_JOB_CANCELLED",
3664 #      "data": { "type": "stream", "device": "virtio-disk0",
3665 #                "len": 10737418240, "offset": 134217728,
3666 #                "speed": 0 },
3667 #      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
3670 { 'event': 'BLOCK_JOB_CANCELLED',
3671   'data': { 'type'  : 'BlockJobType',
3672             'device': 'str',
3673             'len'   : 'int',
3674             'offset': 'int',
3675             'speed' : 'int' } }
3678 # @BLOCK_JOB_ERROR:
3680 # Emitted when a block job encounters an error
3682 # @device: The job identifier. Originally the device name but other
3683 #          values are allowed since QEMU 2.7
3685 # @operation: I/O operation
3687 # @action: action that has been taken
3689 # Since: 1.3
3691 # Example:
3693 # <- { "event": "BLOCK_JOB_ERROR",
3694 #      "data": { "device": "ide0-hd1",
3695 #                "operation": "write",
3696 #                "action": "stop" },
3697 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3700 { 'event': 'BLOCK_JOB_ERROR',
3701   'data': { 'device'   : 'str',
3702             'operation': 'IoOperationType',
3703             'action'   : 'BlockErrorAction' } }
3706 # @BLOCK_JOB_READY:
3708 # Emitted when a block job is ready to complete
3710 # @type: job type
3712 # @device: The job identifier. Originally the device name but other
3713 #          values are allowed since QEMU 2.7
3715 # @len: maximum progress value
3717 # @offset: current progress value. On success this is equal to len.
3718 #          On failure this is less than len
3720 # @speed: rate limit, bytes per second
3722 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
3723 # event
3725 # Since: 1.3
3727 # Example:
3729 # <- { "event": "BLOCK_JOB_READY",
3730 #      "data": { "device": "drive0", "type": "mirror", "speed": 0,
3731 #                "len": 2097152, "offset": 2097152 }
3732 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3735 { 'event': 'BLOCK_JOB_READY',
3736   'data': { 'type'  : 'BlockJobType',
3737             'device': 'str',
3738             'len'   : 'int',
3739             'offset': 'int',
3740             'speed' : 'int' } }
3743 # @PreallocMode:
3745 # Preallocation mode of QEMU image file
3747 # @off: no preallocation
3748 # @metadata: preallocate only for metadata
3749 # @falloc: like @full preallocation but allocate disk space by
3750 #          posix_fallocate() rather than writing zeros.
3751 # @full: preallocate all data by writing zeros to device to ensure disk
3752 #        space is really available. @full preallocation also sets up
3753 #        metadata correctly.
3755 # Since: 2.2
3757 { 'enum': 'PreallocMode',
3758   'data': [ 'off', 'metadata', 'falloc', 'full' ] }
3761 # @BLOCK_WRITE_THRESHOLD:
3763 # Emitted when writes on block device reaches or exceeds the
3764 # configured write threshold. For thin-provisioned devices, this
3765 # means the device should be extended to avoid pausing for
3766 # disk exhaustion.
3767 # The event is one shot. Once triggered, it needs to be
3768 # re-registered with another block-set-write-threshold command.
3770 # @node-name: graph node name on which the threshold was exceeded.
3772 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
3774 # @write-threshold: last configured threshold, in bytes.
3776 # Since: 2.3
3778 { 'event': 'BLOCK_WRITE_THRESHOLD',
3779   'data': { 'node-name': 'str',
3780             'amount-exceeded': 'uint64',
3781             'write-threshold': 'uint64' } }
3784 # @block-set-write-threshold:
3786 # Change the write threshold for a block drive. An event will be
3787 # delivered if a write to this block drive crosses the configured
3788 # threshold.  The threshold is an offset, thus must be
3789 # non-negative. Default is no write threshold. Setting the threshold
3790 # to zero disables it.
3792 # This is useful to transparently resize thin-provisioned drives without
3793 # the guest OS noticing.
3795 # @node-name: graph node name on which the threshold must be set.
3797 # @write-threshold: configured threshold for the block device, bytes.
3798 #                   Use 0 to disable the threshold.
3800 # Since: 2.3
3802 # Example:
3804 # -> { "execute": "block-set-write-threshold",
3805 #      "arguments": { "node-name": "mydev",
3806 #                     "write-threshold": 17179869184 } }
3807 # <- { "return": {} }
3810 { 'command': 'block-set-write-threshold',
3811   'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
3814 # @x-blockdev-change:
3816 # Dynamically reconfigure the block driver state graph. It can be used
3817 # to add, remove, insert or replace a graph node. Currently only the
3818 # Quorum driver implements this feature to add or remove its child. This
3819 # is useful to fix a broken quorum child.
3821 # If @node is specified, it will be inserted under @parent. @child
3822 # may not be specified in this case. If both @parent and @child are
3823 # specified but @node is not, @child will be detached from @parent.
3825 # @parent: the id or name of the parent node.
3827 # @child: the name of a child under the given parent node.
3829 # @node: the name of the node that will be added.
3831 # Note: this command is experimental, and its API is not stable. It
3832 # does not support all kinds of operations, all kinds of children, nor
3833 # all block drivers.
3835 # Warning: The data in a new quorum child MUST be consistent with that of
3836 # the rest of the array.
3838 # Since: 2.7
3840 # Example:
3842 # 1. Add a new node to a quorum
3843 # -> { "execute": "blockdev-add",
3844 #      "arguments": {
3845 #          "driver": "raw",
3846 #          "node-name": "new_node",
3847 #          "file": { "driver": "file",
3848 #                    "filename": "test.raw" } } }
3849 # <- { "return": {} }
3850 # -> { "execute": "x-blockdev-change",
3851 #      "arguments": { "parent": "disk1",
3852 #                     "node": "new_node" } }
3853 # <- { "return": {} }
3855 # 2. Delete a quorum's node
3856 # -> { "execute": "x-blockdev-change",
3857 #      "arguments": { "parent": "disk1",
3858 #                     "child": "children.1" } }
3859 # <- { "return": {} }
3862 { 'command': 'x-blockdev-change',
3863   'data' : { 'parent': 'str',
3864              '*child': 'str',
3865              '*node': 'str' } }