s390x: upgrade status of KVM cores to "supported"
[qemu/ar7.git] / qapi / block-core.json
blobee1ab7a8a259434af6fefc3681363d4194e9a7d8
1 # -*- Mode: Python -*-
3 ##
4 # == Block core (VM unrelated)
5 ##
7 { 'include': 'common.json' }
8 { 'include': 'crypto.json' }
9 { 'include': 'job.json' }
10 { 'include': 'sockets.json' }
13 # @SnapshotInfo:
15 # @id: unique snapshot id
17 # @name: user chosen name
19 # @vm-state-size: size of the VM state
21 # @date-sec: UTC date of the snapshot in seconds
23 # @date-nsec: fractional part in nano seconds to be used with date-sec
25 # @vm-clock-sec: VM clock relative to boot in seconds
27 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
29 # Since: 1.3
32 { 'struct': 'SnapshotInfo',
33   'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
34             'date-sec': 'int', 'date-nsec': 'int',
35             'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
38 # @ImageInfoSpecificQCow2EncryptionBase:
40 # @format: The encryption format
42 # Since: 2.10
44 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
45   'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
48 # @ImageInfoSpecificQCow2Encryption:
50 # Since: 2.10
52 { 'union': 'ImageInfoSpecificQCow2Encryption',
53   'base': 'ImageInfoSpecificQCow2EncryptionBase',
54   'discriminator': 'format',
55   'data': { '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 # @bitmaps: A list of qcow2 bitmap details (since 4.0)
74 # Since: 1.7
76 { 'struct': 'ImageInfoSpecificQCow2',
77   'data': {
78       'compat': 'str',
79       '*lazy-refcounts': 'bool',
80       '*corrupt': 'bool',
81       'refcount-bits': 'int',
82       '*encrypt': 'ImageInfoSpecificQCow2Encryption',
83       '*bitmaps': ['Qcow2BitmapInfo']
84   } }
87 # @ImageInfoSpecificVmdk:
89 # @create-type: The create type of VMDK image
91 # @cid: Content id of image
93 # @parent-cid: Parent VMDK image's cid
95 # @extents: List of extent files
97 # Since: 1.7
99 { 'struct': 'ImageInfoSpecificVmdk',
100   'data': {
101       'create-type': 'str',
102       'cid': 'int',
103       'parent-cid': 'int',
104       'extents': ['ImageInfo']
105   } }
108 # @ImageInfoSpecific:
110 # A discriminated record of image format specific information structures.
112 # Since: 1.7
114 { 'union': 'ImageInfoSpecific',
115   'data': {
116       'qcow2': 'ImageInfoSpecificQCow2',
117       'vmdk': 'ImageInfoSpecificVmdk',
118       # If we need to add block driver specific parameters for
119       # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
120       # to define a ImageInfoSpecificLUKS
121       'luks': 'QCryptoBlockInfoLUKS'
122   } }
125 # @ImageInfo:
127 # Information about a QEMU image file
129 # @filename: name of the image file
131 # @format: format of the image file
133 # @virtual-size: maximum capacity in bytes of the image
135 # @actual-size: actual size on disk in bytes of the image
137 # @dirty-flag: true if image is not cleanly closed
139 # @cluster-size: size of a cluster in bytes
141 # @encrypted: true if the image is encrypted
143 # @compressed: true if the image is compressed (Since 1.7)
145 # @backing-filename: name of the backing file
147 # @full-backing-filename: full path of the backing file
149 # @backing-filename-format: the format of the backing file
151 # @snapshots: list of VM snapshots
153 # @backing-image: info of the backing image (since 1.6)
155 # @format-specific: structure supplying additional format-specific
156 # information (since 1.7)
158 # Since: 1.3
161 { 'struct': 'ImageInfo',
162   'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
163            '*actual-size': 'int', 'virtual-size': 'int',
164            '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
165            '*backing-filename': 'str', '*full-backing-filename': 'str',
166            '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
167            '*backing-image': 'ImageInfo',
168            '*format-specific': 'ImageInfoSpecific' } }
171 # @ImageCheck:
173 # Information about a QEMU image file check
175 # @filename: name of the image file checked
177 # @format: format of the image file checked
179 # @check-errors: number of unexpected errors occurred during check
181 # @image-end-offset: offset (in bytes) where the image ends, this
182 #                    field is present if the driver for the image format
183 #                    supports it
185 # @corruptions: number of corruptions found during the check if any
187 # @leaks: number of leaks found during the check if any
189 # @corruptions-fixed: number of corruptions fixed during the check
190 #                     if any
192 # @leaks-fixed: number of leaks fixed during the check if any
194 # @total-clusters: total number of clusters, this field is present
195 #                  if the driver for the image format supports it
197 # @allocated-clusters: total number of allocated clusters, this
198 #                      field is present if the driver for the image format
199 #                      supports it
201 # @fragmented-clusters: total number of fragmented clusters, this
202 #                       field is present if the driver for the image format
203 #                       supports it
205 # @compressed-clusters: total number of compressed clusters, this
206 #                       field is present if the driver for the image format
207 #                       supports it
209 # Since: 1.4
212 { 'struct': 'ImageCheck',
213   'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
214            '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
215            '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
216            '*total-clusters': 'int', '*allocated-clusters': 'int',
217            '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
220 # @MapEntry:
222 # Mapping information from a virtual block range to a host file range
224 # @start: the start byte of the mapped virtual range
226 # @length: the number of bytes of the mapped virtual range
228 # @data: whether the mapped range has data
230 # @zero: whether the virtual blocks are zeroed
232 # @depth: the depth of the mapping
234 # @offset: the offset in file that the virtual sectors are mapped to
236 # @filename: filename that is referred to by @offset
238 # Since: 2.6
241 { 'struct': 'MapEntry',
242   'data': {'start': 'int', 'length': 'int', 'data': 'bool',
243            'zero': 'bool', 'depth': 'int', '*offset': 'int',
244            '*filename': 'str' } }
247 # @BlockdevCacheInfo:
249 # Cache mode information for a block device
251 # @writeback:   true if writeback mode is enabled
252 # @direct:      true if the host page cache is bypassed (O_DIRECT)
253 # @no-flush:    true if flush requests are ignored for the device
255 # Since: 2.3
257 { 'struct': 'BlockdevCacheInfo',
258   'data': { 'writeback': 'bool',
259             'direct': 'bool',
260             'no-flush': 'bool' } }
263 # @BlockDeviceInfo:
265 # Information about the backing device for a block device.
267 # @file: the filename of the backing device
269 # @node-name: the name of the block driver node (Since 2.0)
271 # @ro: true if the backing device was open read-only
273 # @drv: the name of the block format used to open the backing device. As of
274 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
275 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
276 #       'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
277 #       'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
278 #       2.2: 'archipelago' added, 'cow' dropped
279 #       2.3: 'host_floppy' deprecated
280 #       2.5: 'host_floppy' dropped
281 #       2.6: 'luks' added
282 #       2.8: 'replication' added, 'tftp' dropped
283 #       2.9: 'archipelago' dropped
285 # @backing_file: the name of the backing file (for copy-on-write)
287 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
289 # @encrypted: true if the backing device is encrypted
291 # @encryption_key_missing: Deprecated; always false
293 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
295 # @bps: total throughput limit in bytes per second is specified
297 # @bps_rd: read throughput limit in bytes per second is specified
299 # @bps_wr: write throughput limit in bytes per second is specified
301 # @iops: total I/O operations per second is specified
303 # @iops_rd: read I/O operations per second is specified
305 # @iops_wr: write I/O operations per second is specified
307 # @image: the info of image used (since: 1.6)
309 # @bps_max: total throughput limit during bursts,
310 #                     in bytes (Since 1.7)
312 # @bps_rd_max: read throughput limit during bursts,
313 #                        in bytes (Since 1.7)
315 # @bps_wr_max: write throughput limit during bursts,
316 #                        in bytes (Since 1.7)
318 # @iops_max: total I/O operations per second during bursts,
319 #                      in bytes (Since 1.7)
321 # @iops_rd_max: read I/O operations per second during bursts,
322 #                         in bytes (Since 1.7)
324 # @iops_wr_max: write I/O operations per second during bursts,
325 #                         in bytes (Since 1.7)
327 # @bps_max_length: maximum length of the @bps_max burst
328 #                            period, in seconds. (Since 2.6)
330 # @bps_rd_max_length: maximum length of the @bps_rd_max
331 #                               burst period, in seconds. (Since 2.6)
333 # @bps_wr_max_length: maximum length of the @bps_wr_max
334 #                               burst period, in seconds. (Since 2.6)
336 # @iops_max_length: maximum length of the @iops burst
337 #                             period, in seconds. (Since 2.6)
339 # @iops_rd_max_length: maximum length of the @iops_rd_max
340 #                                burst period, in seconds. (Since 2.6)
342 # @iops_wr_max_length: maximum length of the @iops_wr_max
343 #                                burst period, in seconds. (Since 2.6)
345 # @iops_size: an I/O size in bytes (Since 1.7)
347 # @group: throttle group name (Since 2.4)
349 # @cache: the cache mode used for the block device (since: 2.3)
351 # @write_threshold: configured write threshold for the device.
352 #                   0 if disabled. (Since 2.3)
354 # Since: 0.14.0
357 { 'struct': 'BlockDeviceInfo',
358   'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
359             '*backing_file': 'str', 'backing_file_depth': 'int',
360             'encrypted': 'bool', 'encryption_key_missing': 'bool',
361             'detect_zeroes': 'BlockdevDetectZeroesOptions',
362             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
363             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
364             'image': 'ImageInfo',
365             '*bps_max': 'int', '*bps_rd_max': 'int',
366             '*bps_wr_max': 'int', '*iops_max': 'int',
367             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
368             '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
369             '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
370             '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
371             '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
372             'write_threshold': 'int' } }
375 # @BlockDeviceIoStatus:
377 # An enumeration of block device I/O status.
379 # @ok: The last I/O operation has succeeded
381 # @failed: The last I/O operation has failed
383 # @nospace: The last I/O operation has failed due to a no-space condition
385 # Since: 1.0
387 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
390 # @BlockDeviceMapEntry:
392 # Entry in the metadata map of the device (returned by "qemu-img map")
394 # @start: Offset in the image of the first byte described by this entry
395 #         (in bytes)
397 # @length: Length of the range described by this entry (in bytes)
399 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
400 #         before reaching one for which the range is allocated.  The value is
401 #         in the range 0 to the depth of the image chain - 1.
403 # @zero: the sectors in this range read as zeros
405 # @data: reading the image will actually read data from a file (in particular,
406 #        if @offset is present this means that the sectors are not simply
407 #        preallocated, but contain actual data in raw format)
409 # @offset: if present, the image file stores the data for this range in
410 #          raw format at the given offset.
412 # Since: 1.7
414 { 'struct': 'BlockDeviceMapEntry',
415   'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
416             'data': 'bool', '*offset': 'int' } }
419 # @DirtyBitmapStatus:
421 # An enumeration of possible states that a dirty bitmap can report to the user.
423 # @frozen: The bitmap is currently in-use by a backup operation or block job,
424 #          and is immutable.
426 # @disabled: The bitmap is currently in-use by an internal operation and is
427 #            read-only. It can still be deleted.
429 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
430 #          deleted, or used for backup operations.
432 # @locked: The bitmap is currently in-use by some operation and can not be
433 #          cleared, deleted, or used for backup operations. (Since 2.12)
435 # Since: 2.4
437 { 'enum': 'DirtyBitmapStatus',
438   'data': ['active', 'disabled', 'frozen', 'locked'] }
441 # @BlockDirtyInfo:
443 # Block dirty bitmap information.
445 # @name: the name of the dirty bitmap (Since 2.4)
447 # @count: number of dirty bytes according to the dirty bitmap
449 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
451 # @status: current status of the dirty bitmap (since 2.4)
453 # Since: 1.3
455 { 'struct': 'BlockDirtyInfo',
456   'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
457            'status': 'DirtyBitmapStatus'} }
460 # @Qcow2BitmapInfoFlags:
462 # An enumeration of flags that a bitmap can report to the user.
464 # @in-use: This flag is set by any process actively modifying the qcow2 file,
465 #          and cleared when the updated bitmap is flushed to the qcow2 image.
466 #          The presence of this flag in an offline image means that the bitmap
467 #          was not saved correctly after its last usage, and may contain
468 #          inconsistent data.
470 # @auto: The bitmap must reflect all changes of the virtual disk by any
471 #        application that would write to this qcow2 file.
473 # Since: 4.0
475 { 'enum': 'Qcow2BitmapInfoFlags',
476   'data': ['in-use', 'auto'] }
479 # @Qcow2BitmapInfo:
481 # Qcow2 bitmap information.
483 # @name: the name of the bitmap
485 # @granularity: granularity of the bitmap in bytes
487 # @flags: flags of the bitmap
489 # Since: 4.0
491 { 'struct': 'Qcow2BitmapInfo',
492   'data': {'name': 'str', 'granularity': 'uint32',
493            'flags': ['Qcow2BitmapInfoFlags'] } }
496 # @BlockLatencyHistogramInfo:
498 # Block latency histogram.
500 # @boundaries: list of interval boundary values in nanoseconds, all greater
501 #              than zero and in ascending order.
502 #              For example, the list [10, 50, 100] produces the following
503 #              histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
505 # @bins: list of io request counts corresponding to histogram intervals.
506 #        len(@bins) = len(@boundaries) + 1
507 #        For the example above, @bins may be something like [3, 1, 5, 2],
508 #        and corresponding histogram looks like:
510 #        5|           *
511 #        4|           *
512 #        3| *         *
513 #        2| *         *    *
514 #        1| *    *    *    *
515 #         +------------------
516 #             10   50   100
518 # Since: 2.12
520 { 'struct': 'BlockLatencyHistogramInfo',
521   'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
524 # @x-block-latency-histogram-set:
526 # Manage read, write and flush latency histograms for the device.
528 # If only @device parameter is specified, remove all present latency histograms
529 # for the device. Otherwise, add/reset some of (or all) latency histograms.
531 # @device: device name to set latency histogram for.
533 # @boundaries: list of interval boundary values (see description in
534 #              BlockLatencyHistogramInfo definition). If specified, all
535 #              latency histograms are removed, and empty ones created for all
536 #              io types with intervals corresponding to @boundaries (except for
537 #              io types, for which specific boundaries are set through the
538 #              following parameters).
540 # @boundaries-read: list of interval boundary values for read latency
541 #                   histogram. If specified, old read latency histogram is
542 #                   removed, and empty one created with intervals
543 #                   corresponding to @boundaries-read. The parameter has higher
544 #                   priority then @boundaries.
546 # @boundaries-write: list of interval boundary values for write latency
547 #                    histogram.
549 # @boundaries-flush: list of interval boundary values for flush latency
550 #                    histogram.
552 # Returns: error if device is not found or any boundary arrays are invalid.
554 # Since: 2.12
556 # Example: set new histograms for all io types with intervals
557 # [0, 10), [10, 50), [50, 100), [100, +inf):
559 # -> { "execute": "block-latency-histogram-set",
560 #      "arguments": { "device": "drive0",
561 #                     "boundaries": [10, 50, 100] } }
562 # <- { "return": {} }
564 # Example: set new histogram only for write, other histograms will remain
565 # not changed (or not created):
567 # -> { "execute": "block-latency-histogram-set",
568 #      "arguments": { "device": "drive0",
569 #                     "boundaries-write": [10, 50, 100] } }
570 # <- { "return": {} }
572 # Example: set new histograms with the following intervals:
573 #   read, flush: [0, 10), [10, 50), [50, 100), [100, +inf)
574 #   write: [0, 1000), [1000, 5000), [5000, +inf)
576 # -> { "execute": "block-latency-histogram-set",
577 #      "arguments": { "device": "drive0",
578 #                     "boundaries": [10, 50, 100],
579 #                     "boundaries-write": [1000, 5000] } }
580 # <- { "return": {} }
582 # Example: remove all latency histograms:
584 # -> { "execute": "block-latency-histogram-set",
585 #      "arguments": { "device": "drive0" } }
586 # <- { "return": {} }
588 { 'command': 'x-block-latency-histogram-set',
589   'data': {'device': 'str',
590            '*boundaries': ['uint64'],
591            '*boundaries-read': ['uint64'],
592            '*boundaries-write': ['uint64'],
593            '*boundaries-flush': ['uint64'] } }
596 # @BlockInfo:
598 # Block device information.  This structure describes a virtual device and
599 # the backing device associated with it.
601 # @device: The device name associated with the virtual device.
603 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
604 #        device. (since 2.10)
606 # @type: This field is returned only for compatibility reasons, it should
607 #        not be used (always returns 'unknown')
609 # @removable: True if the device supports removable media.
611 # @locked: True if the guest has locked this device from having its media
612 #          removed
614 # @tray_open: True if the device's tray is open
615 #             (only present if it has a tray)
617 # @dirty-bitmaps: dirty bitmaps information (only present if the
618 #                 driver has one or more dirty bitmaps) (Since 2.0)
620 # @io-status: @BlockDeviceIoStatus. Only present if the device
621 #             supports it and the VM is configured to stop on errors
622 #             (supported device models: virtio-blk, IDE, SCSI except
623 #             scsi-generic)
625 # @inserted: @BlockDeviceInfo describing the device if media is
626 #            present
628 # Since:  0.14.0
630 { 'struct': 'BlockInfo',
631   'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
632            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
633            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
634            '*dirty-bitmaps': ['BlockDirtyInfo'] } }
637 # @BlockMeasureInfo:
639 # Image file size calculation information.  This structure describes the size
640 # requirements for creating a new image file.
642 # The size requirements depend on the new image file format.  File size always
643 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
644 # Compact formats such as 'qcow2' represent unallocated and zero regions
645 # efficiently so file size may be smaller than virtual disk size.
647 # The values are upper bounds that are guaranteed to fit the new image file.
648 # Subsequent modification, such as internal snapshot or bitmap creation, may
649 # require additional space and is not covered here.
651 # @required: Size required for a new image file, in bytes.
653 # @fully-allocated: Image file size, in bytes, once data has been written
654 #                   to all sectors.
656 # Since: 2.10
658 { 'struct': 'BlockMeasureInfo',
659   'data': {'required': 'int', 'fully-allocated': 'int'} }
662 # @query-block:
664 # Get a list of BlockInfo for all virtual block devices.
666 # Returns: a list of @BlockInfo describing each virtual block device. Filter
667 # nodes that were created implicitly are skipped over.
669 # Since: 0.14.0
671 # Example:
673 # -> { "execute": "query-block" }
674 # <- {
675 #       "return":[
676 #          {
677 #             "io-status": "ok",
678 #             "device":"ide0-hd0",
679 #             "locked":false,
680 #             "removable":false,
681 #             "inserted":{
682 #                "ro":false,
683 #                "drv":"qcow2",
684 #                "encrypted":false,
685 #                "file":"disks/test.qcow2",
686 #                "backing_file_depth":1,
687 #                "bps":1000000,
688 #                "bps_rd":0,
689 #                "bps_wr":0,
690 #                "iops":1000000,
691 #                "iops_rd":0,
692 #                "iops_wr":0,
693 #                "bps_max": 8000000,
694 #                "bps_rd_max": 0,
695 #                "bps_wr_max": 0,
696 #                "iops_max": 0,
697 #                "iops_rd_max": 0,
698 #                "iops_wr_max": 0,
699 #                "iops_size": 0,
700 #                "detect_zeroes": "on",
701 #                "write_threshold": 0,
702 #                "image":{
703 #                   "filename":"disks/test.qcow2",
704 #                   "format":"qcow2",
705 #                   "virtual-size":2048000,
706 #                   "backing_file":"base.qcow2",
707 #                   "full-backing-filename":"disks/base.qcow2",
708 #                   "backing-filename-format":"qcow2",
709 #                   "snapshots":[
710 #                      {
711 #                         "id": "1",
712 #                         "name": "snapshot1",
713 #                         "vm-state-size": 0,
714 #                         "date-sec": 10000200,
715 #                         "date-nsec": 12,
716 #                         "vm-clock-sec": 206,
717 #                         "vm-clock-nsec": 30
718 #                      }
719 #                   ],
720 #                   "backing-image":{
721 #                       "filename":"disks/base.qcow2",
722 #                       "format":"qcow2",
723 #                       "virtual-size":2048000
724 #                   }
725 #                }
726 #             },
727 #             "qdev": "ide_disk",
728 #             "type":"unknown"
729 #          },
730 #          {
731 #             "io-status": "ok",
732 #             "device":"ide1-cd0",
733 #             "locked":false,
734 #             "removable":true,
735 #             "qdev": "/machine/unattached/device[23]",
736 #             "tray_open": false,
737 #             "type":"unknown"
738 #          },
739 #          {
740 #             "device":"floppy0",
741 #             "locked":false,
742 #             "removable":true,
743 #             "qdev": "/machine/unattached/device[20]",
744 #             "type":"unknown"
745 #          },
746 #          {
747 #             "device":"sd0",
748 #             "locked":false,
749 #             "removable":true,
750 #             "type":"unknown"
751 #          }
752 #       ]
753 #    }
756 { 'command': 'query-block', 'returns': ['BlockInfo'] }
760 # @BlockDeviceTimedStats:
762 # Statistics of a block device during a given interval of time.
764 # @interval_length: Interval used for calculating the statistics,
765 #                   in seconds.
767 # @min_rd_latency_ns: Minimum latency of read operations in the
768 #                     defined interval, in nanoseconds.
770 # @min_wr_latency_ns: Minimum latency of write operations in the
771 #                     defined interval, in nanoseconds.
773 # @min_flush_latency_ns: Minimum latency of flush operations in the
774 #                        defined interval, in nanoseconds.
776 # @max_rd_latency_ns: Maximum latency of read operations in the
777 #                     defined interval, in nanoseconds.
779 # @max_wr_latency_ns: Maximum latency of write operations in the
780 #                     defined interval, in nanoseconds.
782 # @max_flush_latency_ns: Maximum latency of flush operations in the
783 #                        defined interval, in nanoseconds.
785 # @avg_rd_latency_ns: Average latency of read operations in the
786 #                     defined interval, in nanoseconds.
788 # @avg_wr_latency_ns: Average latency of write operations in the
789 #                     defined interval, in nanoseconds.
791 # @avg_flush_latency_ns: Average latency of flush operations in the
792 #                        defined interval, in nanoseconds.
794 # @avg_rd_queue_depth: Average number of pending read operations
795 #                      in the defined interval.
797 # @avg_wr_queue_depth: Average number of pending write operations
798 #                      in the defined interval.
800 # Since: 2.5
802 { 'struct': 'BlockDeviceTimedStats',
803   'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
804             'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
805             'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
806             'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
807             'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
808             'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
811 # @BlockDeviceStats:
813 # Statistics of a virtual block device or a block backing device.
815 # @rd_bytes:      The number of bytes read by the device.
817 # @wr_bytes:      The number of bytes written by the device.
819 # @rd_operations: The number of read operations performed by the device.
821 # @wr_operations: The number of write operations performed by the device.
823 # @flush_operations: The number of cache flush operations performed by the
824 #                    device (since 0.15.0)
826 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
827 #                       (since 0.15.0).
829 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
831 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
833 # @wr_highest_offset: The offset after the greatest byte written to the
834 #                     device.  The intended use of this information is for
835 #                     growable sparse files (like qcow2) that are used on top
836 #                     of a physical device.
838 # @rd_merged: Number of read requests that have been merged into another
839 #             request (Since 2.3).
841 # @wr_merged: Number of write requests that have been merged into another
842 #             request (Since 2.3).
844 # @idle_time_ns: Time since the last I/O operation, in
845 #                nanoseconds. If the field is absent it means that
846 #                there haven't been any operations yet (Since 2.5).
848 # @failed_rd_operations: The number of failed read operations
849 #                        performed by the device (Since 2.5)
851 # @failed_wr_operations: The number of failed write operations
852 #                        performed by the device (Since 2.5)
854 # @failed_flush_operations: The number of failed flush operations
855 #                           performed by the device (Since 2.5)
857 # @invalid_rd_operations: The number of invalid read operations
858 #                          performed by the device (Since 2.5)
860 # @invalid_wr_operations: The number of invalid write operations
861 #                         performed by the device (Since 2.5)
863 # @invalid_flush_operations: The number of invalid flush operations
864 #                            performed by the device (Since 2.5)
866 # @account_invalid: Whether invalid operations are included in the
867 #                   last access statistics (Since 2.5)
869 # @account_failed: Whether failed operations are included in the
870 #                  latency and last access statistics (Since 2.5)
872 # @timed_stats: Statistics specific to the set of previously defined
873 #               intervals of time (Since 2.5)
875 # @x_rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 2.12)
877 # @x_wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 2.12)
879 # @x_flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 2.12)
881 # Since: 0.14.0
883 { 'struct': 'BlockDeviceStats',
884   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
885            'wr_operations': 'int', 'flush_operations': 'int',
886            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
887            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
888            'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
889            'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
890            'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
891            'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
892            'account_invalid': 'bool', 'account_failed': 'bool',
893            'timed_stats': ['BlockDeviceTimedStats'],
894            '*x_rd_latency_histogram': 'BlockLatencyHistogramInfo',
895            '*x_wr_latency_histogram': 'BlockLatencyHistogramInfo',
896            '*x_flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
899 # @BlockStats:
901 # Statistics of a virtual block device or a block backing device.
903 # @device: If the stats are for a virtual block device, the name
904 #          corresponding to the virtual block device.
906 # @node-name: The node name of the device. (Since 2.3)
908 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
909 #        device. (since 3.0)
911 # @stats:  A @BlockDeviceStats for the device.
913 # @parent: This describes the file block device if it has one.
914 #          Contains recursively the statistics of the underlying
915 #          protocol (e.g. the host file for a qcow2 image). If there is
916 #          no underlying protocol, this field is omitted
918 # @backing: This describes the backing block device if it has one.
919 #           (Since 2.0)
921 # Since: 0.14.0
923 { 'struct': 'BlockStats',
924   'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
925            'stats': 'BlockDeviceStats',
926            '*parent': 'BlockStats',
927            '*backing': 'BlockStats'} }
930 # @query-blockstats:
932 # Query the @BlockStats for all virtual block devices.
934 # @query-nodes: If true, the command will query all the block nodes
935 #               that have a node name, in a list which will include "parent"
936 #               information, but not "backing".
937 #               If false or omitted, the behavior is as before - query all the
938 #               device backends, recursively including their "parent" and
939 #               "backing". Filter nodes that were created implicitly are
940 #               skipped over in this mode. (Since 2.3)
942 # Returns: A list of @BlockStats for each virtual block devices.
944 # Since: 0.14.0
946 # Example:
948 # -> { "execute": "query-blockstats" }
949 # <- {
950 #       "return":[
951 #          {
952 #             "device":"ide0-hd0",
953 #             "parent":{
954 #                "stats":{
955 #                   "wr_highest_offset":3686448128,
956 #                   "wr_bytes":9786368,
957 #                   "wr_operations":751,
958 #                   "rd_bytes":122567168,
959 #                   "rd_operations":36772
960 #                   "wr_total_times_ns":313253456
961 #                   "rd_total_times_ns":3465673657
962 #                   "flush_total_times_ns":49653
963 #                   "flush_operations":61,
964 #                   "rd_merged":0,
965 #                   "wr_merged":0,
966 #                   "idle_time_ns":2953431879,
967 #                   "account_invalid":true,
968 #                   "account_failed":false
969 #                }
970 #             },
971 #             "stats":{
972 #                "wr_highest_offset":2821110784,
973 #                "wr_bytes":9786368,
974 #                "wr_operations":692,
975 #                "rd_bytes":122739200,
976 #                "rd_operations":36604
977 #                "flush_operations":51,
978 #                "wr_total_times_ns":313253456
979 #                "rd_total_times_ns":3465673657
980 #                "flush_total_times_ns":49653,
981 #                "rd_merged":0,
982 #                "wr_merged":0,
983 #                "idle_time_ns":2953431879,
984 #                "account_invalid":true,
985 #                "account_failed":false
986 #             },
987 #             "qdev": "/machine/unattached/device[23]"
988 #          },
989 #          {
990 #             "device":"ide1-cd0",
991 #             "stats":{
992 #                "wr_highest_offset":0,
993 #                "wr_bytes":0,
994 #                "wr_operations":0,
995 #                "rd_bytes":0,
996 #                "rd_operations":0
997 #                "flush_operations":0,
998 #                "wr_total_times_ns":0
999 #                "rd_total_times_ns":0
1000 #                "flush_total_times_ns":0,
1001 #                "rd_merged":0,
1002 #                "wr_merged":0,
1003 #                "account_invalid":false,
1004 #                "account_failed":false
1005 #             },
1006 #             "qdev": "/machine/unattached/device[24]"
1007 #          },
1008 #          {
1009 #             "device":"floppy0",
1010 #             "stats":{
1011 #                "wr_highest_offset":0,
1012 #                "wr_bytes":0,
1013 #                "wr_operations":0,
1014 #                "rd_bytes":0,
1015 #                "rd_operations":0
1016 #                "flush_operations":0,
1017 #                "wr_total_times_ns":0
1018 #                "rd_total_times_ns":0
1019 #                "flush_total_times_ns":0,
1020 #                "rd_merged":0,
1021 #                "wr_merged":0,
1022 #                "account_invalid":false,
1023 #                "account_failed":false
1024 #             },
1025 #             "qdev": "/machine/unattached/device[16]"
1026 #          },
1027 #          {
1028 #             "device":"sd0",
1029 #             "stats":{
1030 #                "wr_highest_offset":0,
1031 #                "wr_bytes":0,
1032 #                "wr_operations":0,
1033 #                "rd_bytes":0,
1034 #                "rd_operations":0
1035 #                "flush_operations":0,
1036 #                "wr_total_times_ns":0
1037 #                "rd_total_times_ns":0
1038 #                "flush_total_times_ns":0,
1039 #                "rd_merged":0,
1040 #                "wr_merged":0,
1041 #                "account_invalid":false,
1042 #                "account_failed":false
1043 #             }
1044 #          }
1045 #       ]
1046 #    }
1049 { 'command': 'query-blockstats',
1050   'data': { '*query-nodes': 'bool' },
1051   'returns': ['BlockStats'] }
1054 # @BlockdevOnError:
1056 # An enumeration of possible behaviors for errors on I/O operations.
1057 # The exact meaning depends on whether the I/O was initiated by a guest
1058 # or by a block job
1060 # @report: for guest operations, report the error to the guest;
1061 #          for jobs, cancel the job
1063 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1064 #          or BLOCK_JOB_ERROR)
1066 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1068 # @stop: for guest operations, stop the virtual machine;
1069 #        for jobs, pause the job
1071 # @auto: inherit the error handling policy of the backend (since: 2.7)
1073 # Since: 1.3
1075 { 'enum': 'BlockdevOnError',
1076   'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1079 # @MirrorSyncMode:
1081 # An enumeration of possible behaviors for the initial synchronization
1082 # phase of storage mirroring.
1084 # @top: copies data in the topmost image to the destination
1086 # @full: copies data from all images to the destination
1088 # @none: only copy data written from now on
1090 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
1092 # Since: 1.3
1094 { 'enum': 'MirrorSyncMode',
1095   'data': ['top', 'full', 'none', 'incremental'] }
1098 # @MirrorCopyMode:
1100 # An enumeration whose values tell the mirror block job when to
1101 # trigger writes to the target.
1103 # @background: copy data in background only.
1105 # @write-blocking: when data is written to the source, write it
1106 #                  (synchronously) to the target as well.  In
1107 #                  addition, data is copied in background just like in
1108 #                  @background mode.
1110 # Since: 3.0
1112 { 'enum': 'MirrorCopyMode',
1113   'data': ['background', 'write-blocking'] }
1116 # @BlockJobInfo:
1118 # Information about a long-running block device operation.
1120 # @type: the job type ('stream' for image streaming)
1122 # @device: The job identifier. Originally the device name but other
1123 #          values are allowed since QEMU 2.7
1125 # @len: Estimated @offset value at the completion of the job. This value can
1126 #       arbitrarily change while the job is running, in both directions.
1128 # @offset: Progress made until now. The unit is arbitrary and the value can
1129 #          only meaningfully be used for the ratio of @offset to @len. The
1130 #          value is monotonically increasing.
1132 # @busy: false if the job is known to be in a quiescent state, with
1133 #        no pending I/O.  Since 1.3.
1135 # @paused: whether the job is paused or, if @busy is true, will
1136 #          pause itself as soon as possible.  Since 1.3.
1138 # @speed: the rate limit, bytes per second
1140 # @io-status: the status of the job (since 1.3)
1142 # @ready: true if the job may be completed (since 2.2)
1144 # @status: Current job state/status (since 2.12)
1146 # @auto-finalize: Job will finalize itself when PENDING, moving to
1147 #                 the CONCLUDED state. (since 2.12)
1149 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1150 #                state and disappearing from the query list. (since 2.12)
1152 # @error: Error information if the job did not complete successfully.
1153 #         Not set if the job completed successfully. (since 2.12.1)
1155 # Since: 1.1
1157 { 'struct': 'BlockJobInfo',
1158   'data': {'type': 'str', 'device': 'str', 'len': 'int',
1159            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1160            'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1161            'status': 'JobStatus',
1162            'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1163            '*error': 'str' } }
1166 # @query-block-jobs:
1168 # Return information about long-running block device operations.
1170 # Returns: a list of @BlockJobInfo for each active block job
1172 # Since: 1.1
1174 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1177 # @block_passwd:
1179 # This command sets the password of a block device that has not been open
1180 # with a password and requires one.
1182 # This command is now obsolete and will always return an error since 2.10
1185 { 'command': 'block_passwd',
1186   'data': { '*device': 'str',
1187             '*node-name': 'str',
1188             'password': 'str' } }
1191 # @block_resize:
1193 # Resize a block image while a guest is running.
1195 # Either @device or @node-name must be set but not both.
1197 # @device: the name of the device to get the image resized
1199 # @node-name: graph node name to get the image resized (Since 2.0)
1201 # @size:  new image size in bytes
1203 # Returns: nothing on success
1204 #          If @device is not a valid block device, DeviceNotFound
1206 # Since: 0.14.0
1208 # Example:
1210 # -> { "execute": "block_resize",
1211 #      "arguments": { "device": "scratch", "size": 1073741824 } }
1212 # <- { "return": {} }
1215 { 'command': 'block_resize',
1216   'data': { '*device': 'str',
1217             '*node-name': 'str',
1218             'size': 'int' } }
1221 # @NewImageMode:
1223 # An enumeration that tells QEMU how to set the backing file path in
1224 # a new image file.
1226 # @existing: QEMU should look for an existing image file.
1228 # @absolute-paths: QEMU should create a new image with absolute paths
1229 # for the backing file. If there is no backing file available, the new
1230 # image will not be backed either.
1232 # Since: 1.1
1234 { 'enum': 'NewImageMode',
1235   'data': [ 'existing', 'absolute-paths' ] }
1238 # @BlockdevSnapshotSync:
1240 # Either @device or @node-name must be set but not both.
1242 # @device: the name of the device to generate the snapshot from.
1244 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1246 # @snapshot-file: the target of the new image. If the file exists, or
1247 # if it is a device, the snapshot will be created in the existing
1248 # file/device. Otherwise, a new file will be created.
1250 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1252 # @format: the format of the snapshot image, default is 'qcow2'.
1254 # @mode: whether and how QEMU should create a new image, default is
1255 #        'absolute-paths'.
1257 { 'struct': 'BlockdevSnapshotSync',
1258   'data': { '*device': 'str', '*node-name': 'str',
1259             'snapshot-file': 'str', '*snapshot-node-name': 'str',
1260             '*format': 'str', '*mode': 'NewImageMode' } }
1263 # @BlockdevSnapshot:
1265 # @node: device or node name that will have a snapshot created.
1267 # @overlay: reference to the existing block device that will become
1268 #           the overlay of @node, as part of creating the snapshot.
1269 #           It must not have a current backing file (this can be
1270 #           achieved by passing "backing": null to blockdev-add).
1272 # Since: 2.5
1274 { 'struct': 'BlockdevSnapshot',
1275   'data': { 'node': 'str', 'overlay': 'str' } }
1278 # @DriveBackup:
1280 # @job-id: identifier for the newly-created block job. If
1281 #          omitted, the device name will be used. (Since 2.7)
1283 # @device: the device name or node-name of a root node which should be copied.
1285 # @target: the target of the new image. If the file exists, or if it
1286 #          is a device, the existing file/device will be used as the new
1287 #          destination.  If it does not exist, a new file will be created.
1289 # @format: the format of the new destination, default is to
1290 #          probe if @mode is 'existing', else the format of the source
1292 # @sync: what parts of the disk image should be copied to the destination
1293 #        (all the disk, only the sectors allocated in the topmost image, from a
1294 #        dirty bitmap, or only new I/O).
1296 # @mode: whether and how QEMU should create a new image, default is
1297 #        'absolute-paths'.
1299 # @speed: the maximum speed, in bytes per second
1301 # @bitmap: the name of dirty bitmap if sync is "incremental".
1302 #          Must be present if sync is "incremental", must NOT be present
1303 #          otherwise. (Since 2.4)
1305 # @compress: true to compress data, if the target format supports it.
1306 #            (default: false) (since 2.8)
1308 # @on-source-error: the action to take on an error on the source,
1309 #                   default 'report'.  'stop' and 'enospc' can only be used
1310 #                   if the block device supports io-status (see BlockInfo).
1312 # @on-target-error: the action to take on an error on the target,
1313 #                   default 'report' (no limitations, since this applies to
1314 #                   a different block device than @device).
1316 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1317 #                 finished its work, waiting for @block-job-finalize before
1318 #                 making any block graph changes.
1319 #                 When true, this job will automatically
1320 #                 perform its abort or commit actions.
1321 #                 Defaults to true. (Since 2.12)
1323 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1324 #                has completely ceased all work, and awaits @block-job-dismiss.
1325 #                When true, this job will automatically disappear from the query
1326 #                list without user intervention.
1327 #                Defaults to true. (Since 2.12)
1329 # Note: @on-source-error and @on-target-error only affect background
1330 # I/O.  If an error occurs during a guest write request, the device's
1331 # rerror/werror actions will be used.
1333 # Since: 1.6
1335 { 'struct': 'DriveBackup',
1336   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1337             '*format': 'str', 'sync': 'MirrorSyncMode',
1338             '*mode': 'NewImageMode', '*speed': 'int',
1339             '*bitmap': 'str', '*compress': 'bool',
1340             '*on-source-error': 'BlockdevOnError',
1341             '*on-target-error': 'BlockdevOnError',
1342             '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1345 # @BlockdevBackup:
1347 # @job-id: identifier for the newly-created block job. If
1348 #          omitted, the device name will be used. (Since 2.7)
1350 # @device: the device name or node-name of a root node which should be copied.
1352 # @target: the device name or node-name of the backup target node.
1354 # @sync: what parts of the disk image should be copied to the destination
1355 #        (all the disk, only the sectors allocated in the topmost image, or
1356 #        only new I/O).
1358 # @speed: the maximum speed, in bytes per second. The default is 0,
1359 #         for unlimited.
1361 # @bitmap: the name of dirty bitmap if sync is "incremental".
1362 #          Must be present if sync is "incremental", must NOT be present
1363 #          otherwise. (Since 3.1)
1365 # @compress: true to compress data, if the target format supports it.
1366 #            (default: false) (since 2.8)
1368 # @on-source-error: the action to take on an error on the source,
1369 #                   default 'report'.  'stop' and 'enospc' can only be used
1370 #                   if the block device supports io-status (see BlockInfo).
1372 # @on-target-error: the action to take on an error on the target,
1373 #                   default 'report' (no limitations, since this applies to
1374 #                   a different block device than @device).
1376 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1377 #                 finished its work, waiting for @block-job-finalize before
1378 #                 making any block graph changes.
1379 #                 When true, this job will automatically
1380 #                 perform its abort or commit actions.
1381 #                 Defaults to true. (Since 2.12)
1383 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1384 #                has completely ceased all work, and awaits @block-job-dismiss.
1385 #                When true, this job will automatically disappear from the query
1386 #                list without user intervention.
1387 #                Defaults to true. (Since 2.12)
1389 # Note: @on-source-error and @on-target-error only affect background
1390 # I/O.  If an error occurs during a guest write request, the device's
1391 # rerror/werror actions will be used.
1393 # Since: 2.3
1395 { 'struct': 'BlockdevBackup',
1396   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1397             'sync': 'MirrorSyncMode', '*speed': 'int',
1398             '*bitmap': 'str', '*compress': 'bool',
1399             '*on-source-error': 'BlockdevOnError',
1400             '*on-target-error': 'BlockdevOnError',
1401             '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1404 # @blockdev-snapshot-sync:
1406 # Generates a synchronous snapshot of a block device.
1408 # For the arguments, see the documentation of BlockdevSnapshotSync.
1410 # Returns: nothing on success
1411 #          If @device is not a valid block device, DeviceNotFound
1413 # Since: 0.14.0
1415 # Example:
1417 # -> { "execute": "blockdev-snapshot-sync",
1418 #      "arguments": { "device": "ide-hd0",
1419 #                     "snapshot-file":
1420 #                     "/some/place/my-image",
1421 #                     "format": "qcow2" } }
1422 # <- { "return": {} }
1425 { 'command': 'blockdev-snapshot-sync',
1426   'data': 'BlockdevSnapshotSync' }
1430 # @blockdev-snapshot:
1432 # Generates a snapshot of a block device.
1434 # Create a snapshot, by installing 'node' as the backing image of
1435 # 'overlay'. Additionally, if 'node' is associated with a block
1436 # device, the block device changes to using 'overlay' as its new active
1437 # image.
1439 # For the arguments, see the documentation of BlockdevSnapshot.
1441 # Since: 2.5
1443 # Example:
1445 # -> { "execute": "blockdev-add",
1446 #      "arguments": { "driver": "qcow2",
1447 #                     "node-name": "node1534",
1448 #                     "file": { "driver": "file",
1449 #                               "filename": "hd1.qcow2" },
1450 #                     "backing": null } }
1452 # <- { "return": {} }
1454 # -> { "execute": "blockdev-snapshot",
1455 #      "arguments": { "node": "ide-hd0",
1456 #                     "overlay": "node1534" } }
1457 # <- { "return": {} }
1460 { 'command': 'blockdev-snapshot',
1461   'data': 'BlockdevSnapshot' }
1464 # @change-backing-file:
1466 # Change the backing file in the image file metadata.  This does not
1467 # cause QEMU to reopen the image file to reparse the backing filename
1468 # (it may, however, perform a reopen to change permissions from
1469 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1470 # into the image file metadata, and the QEMU internal strings are
1471 # updated.
1473 # @image-node-name: The name of the block driver state node of the
1474 #                   image to modify. The "device" argument is used
1475 #                   to verify "image-node-name" is in the chain
1476 #                   described by "device".
1478 # @device:          The device name or node-name of the root node that owns
1479 #                   image-node-name.
1481 # @backing-file:    The string to write as the backing file.  This
1482 #                   string is not validated, so care should be taken
1483 #                   when specifying the string or the image chain may
1484 #                   not be able to be reopened again.
1486 # Returns: Nothing on success
1488 #          If "device" does not exist or cannot be determined, DeviceNotFound
1490 # Since: 2.1
1492 { 'command': 'change-backing-file',
1493   'data': { 'device': 'str', 'image-node-name': 'str',
1494             'backing-file': 'str' } }
1497 # @block-commit:
1499 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1500 # writes data between 'top' and 'base' into 'base'.
1502 # @job-id: identifier for the newly-created block job. If
1503 #          omitted, the device name will be used. (Since 2.7)
1505 # @device:  the device name or node-name of a root node
1507 # @base-node: The node name of the backing image to write data into.
1508 #             If not specified, this is the deepest backing image.
1509 #             (since: 3.1)
1511 # @base: Same as @base-node, except that it is a file name rather than a node
1512 #        name. This must be the exact filename string that was used to open the
1513 #        node; other strings, even if addressing the same file, are not
1514 #        accepted (deprecated, use @base-node instead)
1516 # @top-node: The node name of the backing image within the image chain
1517 #            which contains the topmost data to be committed down. If
1518 #            not specified, this is the active layer. (since: 3.1)
1520 # @top: Same as @top-node, except that it is a file name rather than a node
1521 #       name. This must be the exact filename string that was used to open the
1522 #       node; other strings, even if addressing the same file, are not
1523 #       accepted (deprecated, use @base-node instead)
1525 # @backing-file:  The backing file string to write into the overlay
1526 #                           image of 'top'.  If 'top' is the active layer,
1527 #                           specifying a backing file string is an error. This
1528 #                           filename is not validated.
1530 #                           If a pathname string is such that it cannot be
1531 #                           resolved by QEMU, that means that subsequent QMP or
1532 #                           HMP commands must use node-names for the image in
1533 #                           question, as filename lookup methods will fail.
1535 #                           If not specified, QEMU will automatically determine
1536 #                           the backing file string to use, or error out if
1537 #                           there is no obvious choice. Care should be taken
1538 #                           when specifying the string, to specify a valid
1539 #                           filename or protocol.
1540 #                           (Since 2.1)
1542 #                    If top == base, that is an error.
1543 #                    If top == active, the job will not be completed by itself,
1544 #                    user needs to complete the job with the block-job-complete
1545 #                    command after getting the ready event. (Since 2.0)
1547 #                    If the base image is smaller than top, then the base image
1548 #                    will be resized to be the same size as top.  If top is
1549 #                    smaller than the base image, the base will not be
1550 #                    truncated.  If you want the base image size to match the
1551 #                    size of the smaller top, you can safely truncate it
1552 #                    yourself once the commit operation successfully completes.
1554 # @speed:  the maximum speed, in bytes per second
1556 # @filter-node-name: the node name that should be assigned to the
1557 #                    filter driver that the commit job inserts into the graph
1558 #                    above @top. If this option is not given, a node name is
1559 #                    autogenerated. (Since: 2.9)
1561 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1562 #                 finished its work, waiting for @block-job-finalize before
1563 #                 making any block graph changes.
1564 #                 When true, this job will automatically
1565 #                 perform its abort or commit actions.
1566 #                 Defaults to true. (Since 3.1)
1568 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1569 #                has completely ceased all work, and awaits @block-job-dismiss.
1570 #                When true, this job will automatically disappear from the query
1571 #                list without user intervention.
1572 #                Defaults to true. (Since 3.1)
1574 # Returns: Nothing on success
1575 #          If @device does not exist, DeviceNotFound
1576 #          Any other error returns a GenericError.
1578 # Since: 1.3
1580 # Example:
1582 # -> { "execute": "block-commit",
1583 #      "arguments": { "device": "virtio0",
1584 #                     "top": "/tmp/snap1.qcow2" } }
1585 # <- { "return": {} }
1588 { 'command': 'block-commit',
1589   'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1590             '*base': 'str', '*top-node': 'str', '*top': 'str',
1591             '*backing-file': 'str', '*speed': 'int',
1592             '*filter-node-name': 'str',
1593             '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1596 # @drive-backup:
1598 # Start a point-in-time copy of a block device to a new destination.  The
1599 # status of ongoing drive-backup operations can be checked with
1600 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1601 # The operation can be stopped before it has completed using the
1602 # block-job-cancel command.
1604 # Returns: nothing on success
1605 #          If @device is not a valid block device, GenericError
1607 # Since: 1.6
1609 # Example:
1611 # -> { "execute": "drive-backup",
1612 #      "arguments": { "device": "drive0",
1613 #                     "sync": "full",
1614 #                     "target": "backup.img" } }
1615 # <- { "return": {} }
1618 { 'command': 'drive-backup', 'boxed': true,
1619   'data': 'DriveBackup' }
1622 # @blockdev-backup:
1624 # Start a point-in-time copy of a block device to a new destination.  The
1625 # status of ongoing blockdev-backup operations can be checked with
1626 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1627 # The operation can be stopped before it has completed using the
1628 # block-job-cancel command.
1630 # Returns: nothing on success
1631 #          If @device is not a valid block device, DeviceNotFound
1633 # Since: 2.3
1635 # Example:
1636 # -> { "execute": "blockdev-backup",
1637 #      "arguments": { "device": "src-id",
1638 #                     "sync": "full",
1639 #                     "target": "tgt-id" } }
1640 # <- { "return": {} }
1643 { 'command': 'blockdev-backup', 'boxed': true,
1644   'data': 'BlockdevBackup' }
1648 # @query-named-block-nodes:
1650 # Get the named block driver list
1652 # Returns: the list of BlockDeviceInfo
1654 # Since: 2.0
1656 # Example:
1658 # -> { "execute": "query-named-block-nodes" }
1659 # <- { "return": [ { "ro":false,
1660 #                    "drv":"qcow2",
1661 #                    "encrypted":false,
1662 #                    "file":"disks/test.qcow2",
1663 #                    "node-name": "my-node",
1664 #                    "backing_file_depth":1,
1665 #                    "bps":1000000,
1666 #                    "bps_rd":0,
1667 #                    "bps_wr":0,
1668 #                    "iops":1000000,
1669 #                    "iops_rd":0,
1670 #                    "iops_wr":0,
1671 #                    "bps_max": 8000000,
1672 #                    "bps_rd_max": 0,
1673 #                    "bps_wr_max": 0,
1674 #                    "iops_max": 0,
1675 #                    "iops_rd_max": 0,
1676 #                    "iops_wr_max": 0,
1677 #                    "iops_size": 0,
1678 #                    "write_threshold": 0,
1679 #                    "image":{
1680 #                       "filename":"disks/test.qcow2",
1681 #                       "format":"qcow2",
1682 #                       "virtual-size":2048000,
1683 #                       "backing_file":"base.qcow2",
1684 #                       "full-backing-filename":"disks/base.qcow2",
1685 #                       "backing-filename-format":"qcow2",
1686 #                       "snapshots":[
1687 #                          {
1688 #                             "id": "1",
1689 #                             "name": "snapshot1",
1690 #                             "vm-state-size": 0,
1691 #                             "date-sec": 10000200,
1692 #                             "date-nsec": 12,
1693 #                             "vm-clock-sec": 206,
1694 #                             "vm-clock-nsec": 30
1695 #                          }
1696 #                       ],
1697 #                       "backing-image":{
1698 #                           "filename":"disks/base.qcow2",
1699 #                           "format":"qcow2",
1700 #                           "virtual-size":2048000
1701 #                       }
1702 #                    } } ] }
1705 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1708 # @XDbgBlockGraphNodeType:
1710 # @block-backend: corresponds to BlockBackend
1712 # @block-job: corresonds to BlockJob
1714 # @block-driver: corresponds to BlockDriverState
1716 # Since: 4.0
1718 { 'enum': 'XDbgBlockGraphNodeType',
1719   'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1722 # @XDbgBlockGraphNode:
1724 # @id: Block graph node identifier. This @id is generated only for
1725 #      x-debug-query-block-graph and does not relate to any other identifiers in
1726 #      Qemu.
1728 # @type: Type of graph node. Can be one of block-backend, block-job or
1729 #        block-driver-state.
1731 # @name: Human readable name of the node. Corresponds to node-name for
1732 #        block-driver-state nodes; is not guaranteed to be unique in the whole
1733 #        graph (with block-jobs and block-backends).
1735 # Since: 4.0
1737 { 'struct': 'XDbgBlockGraphNode',
1738   'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1741 # @BlockPermission:
1743 # Enum of base block permissions.
1745 # @consistent-read: A user that has the "permission" of consistent reads is
1746 #                   guaranteed that their view of the contents of the block
1747 #                   device is complete and self-consistent, representing the
1748 #                   contents of a disk at a specific point.
1749 #                   For most block devices (including their backing files) this
1750 #                   is true, but the property cannot be maintained in a few
1751 #                   situations like for intermediate nodes of a commit block
1752 #                   job.
1754 # @write: This permission is required to change the visible disk contents.
1756 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1757 #                   both enough and required for writes to the block node when
1758 #                   the caller promises that the visible disk content doesn't
1759 #                   change.
1760 #                   As the BLK_PERM_WRITE permission is strictly stronger,
1761 #                   either is sufficient to perform an unchanging write.
1763 # @resize: This permission is required to change the size of a block node.
1765 # @graph-mod: This permission is required to change the node that this
1766 #             BdrvChild points to.
1768 # Since: 4.0
1770   { 'enum': 'BlockPermission',
1771     'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
1772               'graph-mod' ] }
1774 # @XDbgBlockGraphEdge:
1776 # Block Graph edge description for x-debug-query-block-graph.
1778 # @parent: parent id
1780 # @child: child id
1782 # @name: name of the relation (examples are 'file' and 'backing')
1784 # @perm: granted permissions for the parent operating on the child
1786 # @shared-perm: permissions that can still be granted to other users of the
1787 #               child while it is still attached to this parent
1789 # Since: 4.0
1791 { 'struct': 'XDbgBlockGraphEdge',
1792   'data': { 'parent': 'uint64', 'child': 'uint64',
1793             'name': 'str', 'perm': [ 'BlockPermission' ],
1794             'shared-perm': [ 'BlockPermission' ] } }
1797 # @XDbgBlockGraph:
1799 # Block Graph - list of nodes and list of edges.
1801 # Since: 4.0
1803 { 'struct': 'XDbgBlockGraph',
1804   'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1807 # @x-debug-query-block-graph:
1809 # Get the block graph.
1811 # Since: 4.0
1813 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph' }
1816 # @drive-mirror:
1818 # Start mirroring a block device's writes to a new destination. target
1819 # specifies the target of the new image. If the file exists, or if it
1820 # is a device, it will be used as the new destination for writes. If
1821 # it does not exist, a new file will be created. format specifies the
1822 # format of the mirror image, default is to probe if mode='existing',
1823 # else the format of the source.
1825 # Returns: nothing on success
1826 #          If @device is not a valid block device, GenericError
1828 # Since: 1.3
1830 # Example:
1832 # -> { "execute": "drive-mirror",
1833 #      "arguments": { "device": "ide-hd0",
1834 #                     "target": "/some/place/my-image",
1835 #                     "sync": "full",
1836 #                     "format": "qcow2" } }
1837 # <- { "return": {} }
1840 { 'command': 'drive-mirror', 'boxed': true,
1841   'data': 'DriveMirror' }
1844 # @DriveMirror:
1846 # A set of parameters describing drive mirror setup.
1848 # @job-id: identifier for the newly-created block job. If
1849 #          omitted, the device name will be used. (Since 2.7)
1851 # @device:  the device name or node-name of a root node whose writes should be
1852 #           mirrored.
1854 # @target: the target of the new image. If the file exists, or if it
1855 #          is a device, the existing file/device will be used as the new
1856 #          destination.  If it does not exist, a new file will be created.
1858 # @format: the format of the new destination, default is to
1859 #          probe if @mode is 'existing', else the format of the source
1861 # @node-name: the new block driver state node name in the graph
1862 #             (Since 2.1)
1864 # @replaces: with sync=full graph node name to be replaced by the new
1865 #            image when a whole image copy is done. This can be used to repair
1866 #            broken Quorum files. (Since 2.1)
1868 # @mode: whether and how QEMU should create a new image, default is
1869 #        'absolute-paths'.
1871 # @speed:  the maximum speed, in bytes per second
1873 # @sync: what parts of the disk image should be copied to the destination
1874 #        (all the disk, only the sectors allocated in the topmost image, or
1875 #        only new I/O).
1877 # @granularity: granularity of the dirty bitmap, default is 64K
1878 #               if the image format doesn't have clusters, 4K if the clusters
1879 #               are smaller than that, else the cluster size.  Must be a
1880 #               power of 2 between 512 and 64M (since 1.4).
1882 # @buf-size: maximum amount of data in flight from source to
1883 #            target (since 1.4).
1885 # @on-source-error: the action to take on an error on the source,
1886 #                   default 'report'.  'stop' and 'enospc' can only be used
1887 #                   if the block device supports io-status (see BlockInfo).
1889 # @on-target-error: the action to take on an error on the target,
1890 #                   default 'report' (no limitations, since this applies to
1891 #                   a different block device than @device).
1892 # @unmap: Whether to try to unmap target sectors where source has
1893 #         only zero. If true, and target unallocated sectors will read as zero,
1894 #         target image sectors will be unmapped; otherwise, zeroes will be
1895 #         written. Both will result in identical contents.
1896 #         Default is true. (Since 2.4)
1898 # @copy-mode: when to copy data to the destination; defaults to 'background'
1899 #             (Since: 3.0)
1901 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1902 #                 finished its work, waiting for @block-job-finalize before
1903 #                 making any block graph changes.
1904 #                 When true, this job will automatically
1905 #                 perform its abort or commit actions.
1906 #                 Defaults to true. (Since 3.1)
1908 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1909 #                has completely ceased all work, and awaits @block-job-dismiss.
1910 #                When true, this job will automatically disappear from the query
1911 #                list without user intervention.
1912 #                Defaults to true. (Since 3.1)
1913 # Since: 1.3
1915 { 'struct': 'DriveMirror',
1916   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1917             '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1918             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1919             '*speed': 'int', '*granularity': 'uint32',
1920             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1921             '*on-target-error': 'BlockdevOnError',
1922             '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
1923             '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1926 # @BlockDirtyBitmap:
1928 # @node: name of device/node which the bitmap is tracking
1930 # @name: name of the dirty bitmap
1932 # Since: 2.4
1934 { 'struct': 'BlockDirtyBitmap',
1935   'data': { 'node': 'str', 'name': 'str' } }
1938 # @BlockDirtyBitmapAdd:
1940 # @node: name of device/node which the bitmap is tracking
1942 # @name: name of the dirty bitmap
1944 # @granularity: the bitmap granularity, default is 64k for
1945 #               block-dirty-bitmap-add
1947 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1948 #              corresponding block device image file on its close. For now only
1949 #              Qcow2 disks support persistent bitmaps. Default is false for
1950 #              block-dirty-bitmap-add. (Since: 2.10)
1952 # @autoload: ignored and deprecated since 2.12.
1953 #            Currently, all dirty tracking bitmaps are loaded from Qcow2 on
1954 #            open.
1956 # @disabled: the bitmap is created in the disabled state, which means that
1957 #            it will not track drive changes. The bitmap may be enabled with
1958 #            block-dirty-bitmap-enable. Default is false. (Since: 4.0)
1960 # Since: 2.4
1962 { 'struct': 'BlockDirtyBitmapAdd',
1963   'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1964             '*persistent': 'bool', '*autoload': 'bool', '*disabled': 'bool' } }
1967 # @BlockDirtyBitmapMerge:
1969 # @node: name of device/node which the bitmap is tracking
1971 # @target: name of the destination dirty bitmap
1973 # @bitmaps: name(s) of the source dirty bitmap(s)
1975 # Since: 4.0
1977 { 'struct': 'BlockDirtyBitmapMerge',
1978   'data': { 'node': 'str', 'target': 'str', 'bitmaps': ['str'] } }
1981 # @block-dirty-bitmap-add:
1983 # Create a dirty bitmap with a name on the node, and start tracking the writes.
1985 # Returns: nothing on success
1986 #          If @node is not a valid block device or node, DeviceNotFound
1987 #          If @name is already taken, GenericError with an explanation
1989 # Since: 2.4
1991 # Example:
1993 # -> { "execute": "block-dirty-bitmap-add",
1994 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
1995 # <- { "return": {} }
1998 { 'command': 'block-dirty-bitmap-add',
1999   'data': 'BlockDirtyBitmapAdd' }
2002 # @block-dirty-bitmap-remove:
2004 # Stop write tracking and remove the dirty bitmap that was created
2005 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2006 # storage too.
2008 # Returns: nothing on success
2009 #          If @node is not a valid block device or node, DeviceNotFound
2010 #          If @name is not found, GenericError with an explanation
2011 #          if @name is frozen by an operation, GenericError
2013 # Since: 2.4
2015 # Example:
2017 # -> { "execute": "block-dirty-bitmap-remove",
2018 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
2019 # <- { "return": {} }
2022 { 'command': 'block-dirty-bitmap-remove',
2023   'data': 'BlockDirtyBitmap' }
2026 # @block-dirty-bitmap-clear:
2028 # Clear (reset) a dirty bitmap on the device, so that an incremental
2029 # backup from this point in time forward will only backup clusters
2030 # modified after this clear operation.
2032 # Returns: nothing on success
2033 #          If @node is not a valid block device, DeviceNotFound
2034 #          If @name is not found, GenericError with an explanation
2036 # Since: 2.4
2038 # Example:
2040 # -> { "execute": "block-dirty-bitmap-clear",
2041 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
2042 # <- { "return": {} }
2045 { 'command': 'block-dirty-bitmap-clear',
2046   'data': 'BlockDirtyBitmap' }
2049 # @block-dirty-bitmap-enable:
2051 # Enables a dirty bitmap so that it will begin tracking disk changes.
2053 # Returns: nothing on success
2054 #          If @node is not a valid block device, DeviceNotFound
2055 #          If @name is not found, GenericError with an explanation
2057 # Since: 4.0
2059 # Example:
2061 # -> { "execute": "block-dirty-bitmap-enable",
2062 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
2063 # <- { "return": {} }
2066   { 'command': 'block-dirty-bitmap-enable',
2067     'data': 'BlockDirtyBitmap' }
2070 # @block-dirty-bitmap-disable:
2072 # Disables a dirty bitmap so that it will stop tracking disk changes.
2074 # Returns: nothing on success
2075 #          If @node is not a valid block device, DeviceNotFound
2076 #          If @name is not found, GenericError with an explanation
2078 # Since: 4.0
2080 # Example:
2082 # -> { "execute": "block-dirty-bitmap-disable",
2083 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
2084 # <- { "return": {} }
2087     { 'command': 'block-dirty-bitmap-disable',
2088       'data': 'BlockDirtyBitmap' }
2091 # @block-dirty-bitmap-merge:
2093 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2094 # The @bitmaps dirty bitmaps are unchanged.
2095 # On error, @target is unchanged.
2097 # Returns: nothing on success
2098 #          If @node is not a valid block device, DeviceNotFound
2099 #          If any bitmap in @bitmaps or @target is not found, GenericError
2100 #          If any of the bitmaps have different sizes or granularities,
2101 #              GenericError
2103 # Since: 4.0
2105 # Example:
2107 # -> { "execute": "block-dirty-bitmap-merge",
2108 #      "arguments": { "node": "drive0", "target": "bitmap0",
2109 #                     "bitmaps": ["bitmap1"] } }
2110 # <- { "return": {} }
2113       { 'command': 'block-dirty-bitmap-merge',
2114         'data': 'BlockDirtyBitmapMerge' }
2117 # @BlockDirtyBitmapSha256:
2119 # SHA256 hash of dirty bitmap data
2121 # @sha256: ASCII representation of SHA256 bitmap hash
2123 # Since: 2.10
2125   { 'struct': 'BlockDirtyBitmapSha256',
2126     'data': {'sha256': 'str'} }
2129 # @x-debug-block-dirty-bitmap-sha256:
2131 # Get bitmap SHA256
2133 # Returns: BlockDirtyBitmapSha256 on success
2134 #          If @node is not a valid block device, DeviceNotFound
2135 #          If @name is not found or if hashing has failed, GenericError with an
2136 #          explanation
2138 # Since: 2.10
2140   { 'command': 'x-debug-block-dirty-bitmap-sha256',
2141     'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
2144 # @blockdev-mirror:
2146 # Start mirroring a block device's writes to a new destination.
2148 # @job-id: identifier for the newly-created block job. If
2149 #          omitted, the device name will be used. (Since 2.7)
2151 # @device: The device name or node-name of a root node whose writes should be
2152 #          mirrored.
2154 # @target: the id or node-name of the block device to mirror to. This mustn't be
2155 #          attached to guest.
2157 # @replaces: with sync=full graph node name to be replaced by the new
2158 #            image when a whole image copy is done. This can be used to repair
2159 #            broken Quorum files.
2161 # @speed:  the maximum speed, in bytes per second
2163 # @sync: what parts of the disk image should be copied to the destination
2164 #        (all the disk, only the sectors allocated in the topmost image, or
2165 #        only new I/O).
2167 # @granularity: granularity of the dirty bitmap, default is 64K
2168 #               if the image format doesn't have clusters, 4K if the clusters
2169 #               are smaller than that, else the cluster size.  Must be a
2170 #               power of 2 between 512 and 64M
2172 # @buf-size: maximum amount of data in flight from source to
2173 #            target
2175 # @on-source-error: the action to take on an error on the source,
2176 #                   default 'report'.  'stop' and 'enospc' can only be used
2177 #                   if the block device supports io-status (see BlockInfo).
2179 # @on-target-error: the action to take on an error on the target,
2180 #                   default 'report' (no limitations, since this applies to
2181 #                   a different block device than @device).
2183 # @filter-node-name: the node name that should be assigned to the
2184 #                    filter driver that the mirror job inserts into the graph
2185 #                    above @device. If this option is not given, a node name is
2186 #                    autogenerated. (Since: 2.9)
2188 # @copy-mode: when to copy data to the destination; defaults to 'background'
2189 #             (Since: 3.0)
2191 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2192 #                 finished its work, waiting for @block-job-finalize before
2193 #                 making any block graph changes.
2194 #                 When true, this job will automatically
2195 #                 perform its abort or commit actions.
2196 #                 Defaults to true. (Since 3.1)
2198 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2199 #                has completely ceased all work, and awaits @block-job-dismiss.
2200 #                When true, this job will automatically disappear from the query
2201 #                list without user intervention.
2202 #                Defaults to true. (Since 3.1)
2203 # Returns: nothing on success.
2205 # Since: 2.6
2207 # Example:
2209 # -> { "execute": "blockdev-mirror",
2210 #      "arguments": { "device": "ide-hd0",
2211 #                     "target": "target0",
2212 #                     "sync": "full" } }
2213 # <- { "return": {} }
2216 { 'command': 'blockdev-mirror',
2217   'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2218             '*replaces': 'str',
2219             'sync': 'MirrorSyncMode',
2220             '*speed': 'int', '*granularity': 'uint32',
2221             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2222             '*on-target-error': 'BlockdevOnError',
2223             '*filter-node-name': 'str',
2224             '*copy-mode': 'MirrorCopyMode',
2225             '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2228 # @block_set_io_throttle:
2230 # Change I/O throttle limits for a block drive.
2232 # Since QEMU 2.4, each device with I/O limits is member of a throttle
2233 # group.
2235 # If two or more devices are members of the same group, the limits
2236 # will apply to the combined I/O of the whole group in a round-robin
2237 # fashion. Therefore, setting new I/O limits to a device will affect
2238 # the whole group.
2240 # The name of the group can be specified using the 'group' parameter.
2241 # If the parameter is unset, it is assumed to be the current group of
2242 # that device. If it's not in any group yet, the name of the device
2243 # will be used as the name for its group.
2245 # The 'group' parameter can also be used to move a device to a
2246 # different group. In this case the limits specified in the parameters
2247 # will be applied to the new group only.
2249 # I/O limits can be disabled by setting all of them to 0. In this case
2250 # the device will be removed from its group and the rest of its
2251 # members will not be affected. The 'group' parameter is ignored.
2253 # Returns: Nothing on success
2254 #          If @device is not a valid block device, DeviceNotFound
2256 # Since: 1.1
2258 # Example:
2260 # -> { "execute": "block_set_io_throttle",
2261 #      "arguments": { "id": "virtio-blk-pci0/virtio-backend",
2262 #                     "bps": 0,
2263 #                     "bps_rd": 0,
2264 #                     "bps_wr": 0,
2265 #                     "iops": 512,
2266 #                     "iops_rd": 0,
2267 #                     "iops_wr": 0,
2268 #                     "bps_max": 0,
2269 #                     "bps_rd_max": 0,
2270 #                     "bps_wr_max": 0,
2271 #                     "iops_max": 0,
2272 #                     "iops_rd_max": 0,
2273 #                     "iops_wr_max": 0,
2274 #                     "bps_max_length": 0,
2275 #                     "iops_size": 0 } }
2276 # <- { "return": {} }
2278 # -> { "execute": "block_set_io_throttle",
2279 #      "arguments": { "id": "ide0-1-0",
2280 #                     "bps": 1000000,
2281 #                     "bps_rd": 0,
2282 #                     "bps_wr": 0,
2283 #                     "iops": 0,
2284 #                     "iops_rd": 0,
2285 #                     "iops_wr": 0,
2286 #                     "bps_max": 8000000,
2287 #                     "bps_rd_max": 0,
2288 #                     "bps_wr_max": 0,
2289 #                     "iops_max": 0,
2290 #                     "iops_rd_max": 0,
2291 #                     "iops_wr_max": 0,
2292 #                     "bps_max_length": 60,
2293 #                     "iops_size": 0 } }
2294 # <- { "return": {} }
2296 { 'command': 'block_set_io_throttle', 'boxed': true,
2297   'data': 'BlockIOThrottle' }
2300 # @BlockIOThrottle:
2302 # A set of parameters describing block throttling.
2304 # @device: Block device name (deprecated, use @id instead)
2306 # @id: The name or QOM path of the guest device (since: 2.8)
2308 # @bps: total throughput limit in bytes per second
2310 # @bps_rd: read throughput limit in bytes per second
2312 # @bps_wr: write throughput limit in bytes per second
2314 # @iops: total I/O operations per second
2316 # @iops_rd: read I/O operations per second
2318 # @iops_wr: write I/O operations per second
2320 # @bps_max: total throughput limit during bursts,
2321 #                     in bytes (Since 1.7)
2323 # @bps_rd_max: read throughput limit during bursts,
2324 #                        in bytes (Since 1.7)
2326 # @bps_wr_max: write throughput limit during bursts,
2327 #                        in bytes (Since 1.7)
2329 # @iops_max: total I/O operations per second during bursts,
2330 #                      in bytes (Since 1.7)
2332 # @iops_rd_max: read I/O operations per second during bursts,
2333 #                         in bytes (Since 1.7)
2335 # @iops_wr_max: write I/O operations per second during bursts,
2336 #                         in bytes (Since 1.7)
2338 # @bps_max_length: maximum length of the @bps_max burst
2339 #                            period, in seconds. It must only
2340 #                            be set if @bps_max is set as well.
2341 #                            Defaults to 1. (Since 2.6)
2343 # @bps_rd_max_length: maximum length of the @bps_rd_max
2344 #                               burst period, in seconds. It must only
2345 #                               be set if @bps_rd_max is set as well.
2346 #                               Defaults to 1. (Since 2.6)
2348 # @bps_wr_max_length: maximum length of the @bps_wr_max
2349 #                               burst period, in seconds. It must only
2350 #                               be set if @bps_wr_max is set as well.
2351 #                               Defaults to 1. (Since 2.6)
2353 # @iops_max_length: maximum length of the @iops burst
2354 #                             period, in seconds. It must only
2355 #                             be set if @iops_max is set as well.
2356 #                             Defaults to 1. (Since 2.6)
2358 # @iops_rd_max_length: maximum length of the @iops_rd_max
2359 #                                burst period, in seconds. It must only
2360 #                                be set if @iops_rd_max is set as well.
2361 #                                Defaults to 1. (Since 2.6)
2363 # @iops_wr_max_length: maximum length of the @iops_wr_max
2364 #                                burst period, in seconds. It must only
2365 #                                be set if @iops_wr_max is set as well.
2366 #                                Defaults to 1. (Since 2.6)
2368 # @iops_size: an I/O size in bytes (Since 1.7)
2370 # @group: throttle group name (Since 2.4)
2372 # Since: 1.1
2374 { 'struct': 'BlockIOThrottle',
2375   'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2376             'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2377             '*bps_max': 'int', '*bps_rd_max': 'int',
2378             '*bps_wr_max': 'int', '*iops_max': 'int',
2379             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2380             '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2381             '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2382             '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2383             '*iops_size': 'int', '*group': 'str' } }
2386 # @ThrottleLimits:
2388 # Limit parameters for throttling.
2389 # Since some limit combinations are illegal, limits should always be set in one
2390 # transaction. All fields are optional. When setting limits, if a field is
2391 # missing the current value is not changed.
2393 # @iops-total:             limit total I/O operations per second
2394 # @iops-total-max:         I/O operations burst
2395 # @iops-total-max-length:  length of the iops-total-max burst period, in seconds
2396 #                          It must only be set if @iops-total-max is set as well.
2397 # @iops-read:              limit read operations per second
2398 # @iops-read-max:          I/O operations read burst
2399 # @iops-read-max-length:   length of the iops-read-max burst period, in seconds
2400 #                          It must only be set if @iops-read-max is set as well.
2401 # @iops-write:             limit write operations per second
2402 # @iops-write-max:         I/O operations write burst
2403 # @iops-write-max-length:  length of the iops-write-max burst period, in seconds
2404 #                          It must only be set if @iops-write-max is set as well.
2405 # @bps-total:              limit total bytes per second
2406 # @bps-total-max:          total bytes burst
2407 # @bps-total-max-length:   length of the bps-total-max burst period, in seconds.
2408 #                          It must only be set if @bps-total-max is set as well.
2409 # @bps-read:               limit read bytes per second
2410 # @bps-read-max:           total bytes read burst
2411 # @bps-read-max-length:    length of the bps-read-max burst period, in seconds
2412 #                          It must only be set if @bps-read-max is set as well.
2413 # @bps-write:              limit write bytes per second
2414 # @bps-write-max:          total bytes write burst
2415 # @bps-write-max-length:   length of the bps-write-max burst period, in seconds
2416 #                          It must only be set if @bps-write-max is set as well.
2417 # @iops-size:              when limiting by iops max size of an I/O in bytes
2419 # Since: 2.11
2421 { 'struct': 'ThrottleLimits',
2422   'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2423             '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2424             '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2425             '*iops-write' : 'int', '*iops-write-max' : 'int',
2426             '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2427             '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2428             '*bps-read' : 'int', '*bps-read-max' : 'int',
2429             '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2430             '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2431             '*iops-size' : 'int' } }
2434 # @block-stream:
2436 # Copy data from a backing file into a block device.
2438 # The block streaming operation is performed in the background until the entire
2439 # backing file has been copied.  This command returns immediately once streaming
2440 # has started.  The status of ongoing block streaming operations can be checked
2441 # with query-block-jobs.  The operation can be stopped before it has completed
2442 # using the block-job-cancel command.
2444 # The node that receives the data is called the top image, can be located in
2445 # any part of the chain (but always above the base image; see below) and can be
2446 # specified using its device or node name. Earlier qemu versions only allowed
2447 # 'device' to name the top level node; presence of the 'base-node' parameter
2448 # during introspection can be used as a witness of the enhanced semantics
2449 # of 'device'.
2451 # If a base file is specified then sectors are not copied from that base file and
2452 # its backing chain.  When streaming completes the image file will have the base
2453 # file as its backing file.  This can be used to stream a subset of the backing
2454 # file chain instead of flattening the entire image.
2456 # On successful completion the image file is updated to drop the backing file
2457 # and the BLOCK_JOB_COMPLETED event is emitted.
2459 # @job-id: identifier for the newly-created block job. If
2460 #          omitted, the device name will be used. (Since 2.7)
2462 # @device: the device or node name of the top image
2464 # @base:   the common backing file name.
2465 #                    It cannot be set if @base-node is also set.
2467 # @base-node: the node name of the backing file.
2468 #                       It cannot be set if @base is also set. (Since 2.8)
2470 # @backing-file: The backing file string to write into the top
2471 #                          image. This filename is not validated.
2473 #                          If a pathname string is such that it cannot be
2474 #                          resolved by QEMU, that means that subsequent QMP or
2475 #                          HMP commands must use node-names for the image in
2476 #                          question, as filename lookup methods will fail.
2478 #                          If not specified, QEMU will automatically determine
2479 #                          the backing file string to use, or error out if there
2480 #                          is no obvious choice.  Care should be taken when
2481 #                          specifying the string, to specify a valid filename or
2482 #                          protocol.
2483 #                          (Since 2.1)
2485 # @speed:  the maximum speed, in bytes per second
2487 # @on-error: the action to take on an error (default report).
2488 #            'stop' and 'enospc' can only be used if the block device
2489 #            supports io-status (see BlockInfo).  Since 1.3.
2491 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2492 #                 finished its work, waiting for @block-job-finalize before
2493 #                 making any block graph changes.
2494 #                 When true, this job will automatically
2495 #                 perform its abort or commit actions.
2496 #                 Defaults to true. (Since 3.1)
2498 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2499 #                has completely ceased all work, and awaits @block-job-dismiss.
2500 #                When true, this job will automatically disappear from the query
2501 #                list without user intervention.
2502 #                Defaults to true. (Since 3.1)
2504 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
2506 # Since: 1.1
2508 # Example:
2510 # -> { "execute": "block-stream",
2511 #      "arguments": { "device": "virtio0",
2512 #                     "base": "/tmp/master.qcow2" } }
2513 # <- { "return": {} }
2516 { 'command': 'block-stream',
2517   'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2518             '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2519             '*on-error': 'BlockdevOnError',
2520             '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2523 # @block-job-set-speed:
2525 # Set maximum speed for a background block operation.
2527 # This command can only be issued when there is an active block job.
2529 # Throttling can be disabled by setting the speed to 0.
2531 # @device: The job identifier. This used to be a device name (hence
2532 #          the name of the parameter), but since QEMU 2.7 it can have
2533 #          other values.
2535 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
2536 #          Defaults to 0.
2538 # Returns: Nothing on success
2539 #          If no background operation is active on this device, DeviceNotActive
2541 # Since: 1.1
2543 { 'command': 'block-job-set-speed',
2544   'data': { 'device': 'str', 'speed': 'int' } }
2547 # @block-job-cancel:
2549 # Stop an active background block operation.
2551 # This command returns immediately after marking the active background block
2552 # operation for cancellation.  It is an error to call this command if no
2553 # operation is in progress.
2555 # The operation will cancel as soon as possible and then emit the
2556 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2557 # enumerated using query-block-jobs.
2559 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2560 # (via the event BLOCK_JOB_READY) that the source and destination are
2561 # synchronized, then the event triggered by this command changes to
2562 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2563 # destination now has a point-in-time copy tied to the time of the cancellation.
2565 # For streaming, the image file retains its backing file unless the streaming
2566 # operation happens to complete just as it is being cancelled.  A new streaming
2567 # operation can be started at a later time to finish copying all data from the
2568 # backing file.
2570 # @device: The job identifier. This used to be a device name (hence
2571 #          the name of the parameter), but since QEMU 2.7 it can have
2572 #          other values.
2574 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2575 #         abandon the job immediately (even if it is paused) instead of waiting
2576 #         for the destination to complete its final synchronization (since 1.3)
2578 # Returns: Nothing on success
2579 #          If no background operation is active on this device, DeviceNotActive
2581 # Since: 1.1
2583 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2586 # @block-job-pause:
2588 # Pause an active background block operation.
2590 # This command returns immediately after marking the active background block
2591 # operation for pausing.  It is an error to call this command if no
2592 # operation is in progress or if the job is already paused.
2594 # The operation will pause as soon as possible.  No event is emitted when
2595 # the operation is actually paused.  Cancelling a paused job automatically
2596 # resumes it.
2598 # @device: The job identifier. This used to be a device name (hence
2599 #          the name of the parameter), but since QEMU 2.7 it can have
2600 #          other values.
2602 # Returns: Nothing on success
2603 #          If no background operation is active on this device, DeviceNotActive
2605 # Since: 1.3
2607 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2610 # @block-job-resume:
2612 # Resume an active background block operation.
2614 # This command returns immediately after resuming a paused background block
2615 # operation.  It is an error to call this command if no operation is in
2616 # progress or if the job is not paused.
2618 # This command also clears the error status of the job.
2620 # @device: The job identifier. This used to be a device name (hence
2621 #          the name of the parameter), but since QEMU 2.7 it can have
2622 #          other values.
2624 # Returns: Nothing on success
2625 #          If no background operation is active on this device, DeviceNotActive
2627 # Since: 1.3
2629 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2632 # @block-job-complete:
2634 # Manually trigger completion of an active background block operation.  This
2635 # is supported for drive mirroring, where it also switches the device to
2636 # write to the target path only.  The ability to complete is signaled with
2637 # a BLOCK_JOB_READY event.
2639 # This command completes an active background block operation synchronously.
2640 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2641 # is not defined.  Note that if an I/O error occurs during the processing of
2642 # this command: 1) the command itself will fail; 2) the error will be processed
2643 # according to the rerror/werror arguments that were specified when starting
2644 # the operation.
2646 # A cancelled or paused job cannot be completed.
2648 # @device: The job identifier. This used to be a device name (hence
2649 #          the name of the parameter), but since QEMU 2.7 it can have
2650 #          other values.
2652 # Returns: Nothing on success
2653 #          If no background operation is active on this device, DeviceNotActive
2655 # Since: 1.3
2657 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2660 # @block-job-dismiss:
2662 # For jobs that have already concluded, remove them from the block-job-query
2663 # list. This command only needs to be run for jobs which were started with
2664 # QEMU 2.12+ job lifetime management semantics.
2666 # This command will refuse to operate on any job that has not yet reached
2667 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2668 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2669 # to be used as appropriate.
2671 # @id: The job identifier.
2673 # Returns: Nothing on success
2675 # Since: 2.12
2677 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2680 # @block-job-finalize:
2682 # Once a job that has manual=true reaches the pending state, it can be
2683 # instructed to finalize any graph changes and do any necessary cleanup
2684 # via this command.
2685 # For jobs in a transaction, instructing one job to finalize will force
2686 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2687 # a single member job to finalize.
2689 # @id: The job identifier.
2691 # Returns: Nothing on success
2693 # Since: 2.12
2695 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2698 # @BlockdevDiscardOptions:
2700 # Determines how to handle discard requests.
2702 # @ignore:      Ignore the request
2703 # @unmap:       Forward as an unmap request
2705 # Since: 2.9
2707 { 'enum': 'BlockdevDiscardOptions',
2708   'data': [ 'ignore', 'unmap' ] }
2711 # @BlockdevDetectZeroesOptions:
2713 # Describes the operation mode for the automatic conversion of plain
2714 # zero writes by the OS to driver specific optimized zero write commands.
2716 # @off:      Disabled (default)
2717 # @on:       Enabled
2718 # @unmap:    Enabled and even try to unmap blocks if possible. This requires
2719 #            also that @BlockdevDiscardOptions is set to unmap for this device.
2721 # Since: 2.1
2723 { 'enum': 'BlockdevDetectZeroesOptions',
2724   'data': [ 'off', 'on', 'unmap' ] }
2727 # @BlockdevAioOptions:
2729 # Selects the AIO backend to handle I/O requests
2731 # @threads:     Use qemu's thread pool
2732 # @native:      Use native AIO backend (only Linux and Windows)
2734 # Since: 2.9
2736 { 'enum': 'BlockdevAioOptions',
2737   'data': [ 'threads', 'native' ] }
2740 # @BlockdevCacheOptions:
2742 # Includes cache-related options for block devices
2744 # @direct:      enables use of O_DIRECT (bypass the host page cache;
2745 #               default: false)
2746 # @no-flush:    ignore any flush requests for the device (default:
2747 #               false)
2749 # Since: 2.9
2751 { 'struct': 'BlockdevCacheOptions',
2752   'data': { '*direct': 'bool',
2753             '*no-flush': 'bool' } }
2756 # @BlockdevDriver:
2758 # Drivers that are supported in block device operations.
2760 # @vxhs: Since 2.10
2761 # @throttle: Since 2.11
2762 # @nvme: Since 2.12
2763 # @copy-on-read: Since 3.0
2764 # @blklogwrites: Since 3.0
2766 # Since: 2.9
2768 { 'enum': 'BlockdevDriver',
2769   'data': [ 'blkdebug', 'blklogwrites', 'blkverify', 'bochs', 'cloop',
2770             'copy-on-read', 'dmg', 'file', 'ftp', 'ftps', 'gluster',
2771             'host_cdrom', 'host_device', 'http', 'https', 'iscsi', 'luks',
2772             'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels', 'qcow',
2773             'qcow2', 'qed', 'quorum', 'raw', 'rbd',
2774             { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
2775             'sheepdog',
2776             'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2779 # @BlockdevOptionsFile:
2781 # Driver specific block device options for the file backend.
2783 # @filename:    path to the image file
2784 # @pr-manager:  the id for the object that will handle persistent reservations
2785 #               for this device (default: none, forward the commands via SG_IO;
2786 #               since 2.11)
2787 # @aio:         AIO backend (default: threads) (since: 2.8)
2788 # @locking:     whether to enable file locking. If set to 'auto', only enable
2789 #               when Open File Descriptor (OFD) locking API is available
2790 #               (default: auto, since 2.10)
2791 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2792 #                         migration.  May cause noticeable delays if the image
2793 #                         file is large, do not use in production.
2794 #                         (default: off) (since: 3.0)
2796 # Since: 2.9
2798 { 'struct': 'BlockdevOptionsFile',
2799   'data': { 'filename': 'str',
2800             '*pr-manager': 'str',
2801             '*locking': 'OnOffAuto',
2802             '*aio': 'BlockdevAioOptions',
2803             '*x-check-cache-dropped': 'bool' } }
2806 # @BlockdevOptionsNull:
2808 # Driver specific block device options for the null backend.
2810 # @size:    size of the device in bytes.
2811 # @latency-ns: emulated latency (in nanoseconds) in processing
2812 #              requests. Default to zero which completes requests immediately.
2813 #              (Since 2.4)
2815 # Since: 2.9
2817 { 'struct': 'BlockdevOptionsNull',
2818   'data': { '*size': 'int', '*latency-ns': 'uint64' } }
2821 # @BlockdevOptionsNVMe:
2823 # Driver specific block device options for the NVMe backend.
2825 # @device:    controller address of the NVMe device.
2826 # @namespace: namespace number of the device, starting from 1.
2828 # Since: 2.12
2830 { 'struct': 'BlockdevOptionsNVMe',
2831   'data': { 'device': 'str', 'namespace': 'int' } }
2834 # @BlockdevOptionsVVFAT:
2836 # Driver specific block device options for the vvfat protocol.
2838 # @dir:         directory to be exported as FAT image
2839 # @fat-type:    FAT type: 12, 16 or 32
2840 # @floppy:      whether to export a floppy image (true) or
2841 #               partitioned hard disk (false; default)
2842 # @label:       set the volume label, limited to 11 bytes. FAT16 and
2843 #               FAT32 traditionally have some restrictions on labels, which are
2844 #               ignored by most operating systems. Defaults to "QEMU VVFAT".
2845 #               (since 2.4)
2846 # @rw:          whether to allow write operations (default: false)
2848 # Since: 2.9
2850 { 'struct': 'BlockdevOptionsVVFAT',
2851   'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2852             '*label': 'str', '*rw': 'bool' } }
2855 # @BlockdevOptionsGenericFormat:
2857 # Driver specific block device options for image format that have no option
2858 # besides their data source.
2860 # @file:        reference to or definition of the data source block device
2862 # Since: 2.9
2864 { 'struct': 'BlockdevOptionsGenericFormat',
2865   'data': { 'file': 'BlockdevRef' } }
2868 # @BlockdevOptionsLUKS:
2870 # Driver specific block device options for LUKS.
2872 # @key-secret: the ID of a QCryptoSecret object providing
2873 #              the decryption key (since 2.6). Mandatory except when
2874 #              doing a metadata-only probe of the image.
2876 # Since: 2.9
2878 { 'struct': 'BlockdevOptionsLUKS',
2879   'base': 'BlockdevOptionsGenericFormat',
2880   'data': { '*key-secret': 'str' } }
2884 # @BlockdevOptionsGenericCOWFormat:
2886 # Driver specific block device options for image format that have no option
2887 # besides their data source and an optional backing file.
2889 # @backing:     reference to or definition of the backing file block
2890 #               device, null disables the backing file entirely.
2891 #               Defaults to the backing file stored the image file.
2893 # Since: 2.9
2895 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2896   'base': 'BlockdevOptionsGenericFormat',
2897   'data': { '*backing': 'BlockdevRefOrNull' } }
2900 # @Qcow2OverlapCheckMode:
2902 # General overlap check modes.
2904 # @none:        Do not perform any checks
2906 # @constant:    Perform only checks which can be done in constant time and
2907 #               without reading anything from disk
2909 # @cached:      Perform only checks which can be done without reading anything
2910 #               from disk
2912 # @all:         Perform all available overlap checks
2914 # Since: 2.9
2916 { 'enum': 'Qcow2OverlapCheckMode',
2917   'data': [ 'none', 'constant', 'cached', 'all' ] }
2920 # @Qcow2OverlapCheckFlags:
2922 # Structure of flags for each metadata structure. Setting a field to 'true'
2923 # makes qemu guard that structure against unintended overwriting. The default
2924 # value is chosen according to the template given.
2926 # @template: Specifies a template mode which can be adjusted using the other
2927 #            flags, defaults to 'cached'
2929 # @bitmap-directory: since 3.0
2931 # Since: 2.9
2933 { 'struct': 'Qcow2OverlapCheckFlags',
2934   'data': { '*template':         'Qcow2OverlapCheckMode',
2935             '*main-header':      'bool',
2936             '*active-l1':        'bool',
2937             '*active-l2':        'bool',
2938             '*refcount-table':   'bool',
2939             '*refcount-block':   'bool',
2940             '*snapshot-table':   'bool',
2941             '*inactive-l1':      'bool',
2942             '*inactive-l2':      'bool',
2943             '*bitmap-directory': 'bool' } }
2946 # @Qcow2OverlapChecks:
2948 # Specifies which metadata structures should be guarded against unintended
2949 # overwriting.
2951 # @flags:   set of flags for separate specification of each metadata structure
2952 #           type
2954 # @mode:    named mode which chooses a specific set of flags
2956 # Since: 2.9
2958 { 'alternate': 'Qcow2OverlapChecks',
2959   'data': { 'flags': 'Qcow2OverlapCheckFlags',
2960             'mode':  'Qcow2OverlapCheckMode' } }
2963 # @BlockdevQcowEncryptionFormat:
2965 # @aes: AES-CBC with plain64 initialization vectors
2967 # Since: 2.10
2969 { 'enum': 'BlockdevQcowEncryptionFormat',
2970   'data': [ 'aes' ] }
2973 # @BlockdevQcowEncryption:
2975 # Since: 2.10
2977 { 'union': 'BlockdevQcowEncryption',
2978   'base': { 'format': 'BlockdevQcowEncryptionFormat' },
2979   'discriminator': 'format',
2980   'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
2983 # @BlockdevOptionsQcow:
2985 # Driver specific block device options for qcow.
2987 # @encrypt:               Image decryption options. Mandatory for
2988 #                         encrypted images, except when doing a metadata-only
2989 #                         probe of the image.
2991 # Since: 2.10
2993 { 'struct': 'BlockdevOptionsQcow',
2994   'base': 'BlockdevOptionsGenericCOWFormat',
2995   'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3000 # @BlockdevQcow2EncryptionFormat:
3001 # @aes: AES-CBC with plain64 initialization vectors
3003 # Since: 2.10
3005 { 'enum': 'BlockdevQcow2EncryptionFormat',
3006   'data': [ 'aes', 'luks' ] }
3009 # @BlockdevQcow2Encryption:
3011 # Since: 2.10
3013 { 'union': 'BlockdevQcow2Encryption',
3014   'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3015   'discriminator': 'format',
3016   'data': { 'aes': 'QCryptoBlockOptionsQCow',
3017             'luks': 'QCryptoBlockOptionsLUKS'} }
3020 # @BlockdevOptionsQcow2:
3022 # Driver specific block device options for qcow2.
3024 # @lazy-refcounts:        whether to enable the lazy refcounts
3025 #                         feature (default is taken from the image file)
3027 # @pass-discard-request:  whether discard requests to the qcow2
3028 #                         device should be forwarded to the data source
3030 # @pass-discard-snapshot: whether discard requests for the data source
3031 #                         should be issued when a snapshot operation (e.g.
3032 #                         deleting a snapshot) frees clusters in the qcow2 file
3034 # @pass-discard-other:    whether discard requests for the data source
3035 #                         should be issued on other occasions where a cluster
3036 #                         gets freed
3038 # @overlap-check:         which overlap checks to perform for writes
3039 #                         to the image, defaults to 'cached' (since 2.2)
3041 # @cache-size:            the maximum total size of the L2 table and
3042 #                         refcount block caches in bytes (since 2.2)
3044 # @l2-cache-size:         the maximum size of the L2 table cache in
3045 #                         bytes (since 2.2)
3047 # @l2-cache-entry-size:   the size of each entry in the L2 cache in
3048 #                         bytes. It must be a power of two between 512
3049 #                         and the cluster size. The default value is
3050 #                         the cluster size (since 2.12)
3052 # @refcount-cache-size:   the maximum size of the refcount block cache
3053 #                         in bytes (since 2.2)
3055 # @cache-clean-interval:  clean unused entries in the L2 and refcount
3056 #                         caches. The interval is in seconds. The default value
3057 #                         is 600 on supporting platforms, and 0 on other
3058 #                         platforms. 0 disables this feature. (since 2.5)
3060 # @encrypt:               Image decryption options. Mandatory for
3061 #                         encrypted images, except when doing a metadata-only
3062 #                         probe of the image. (since 2.10)
3064 # Since: 2.9
3066 { 'struct': 'BlockdevOptionsQcow2',
3067   'base': 'BlockdevOptionsGenericCOWFormat',
3068   'data': { '*lazy-refcounts': 'bool',
3069             '*pass-discard-request': 'bool',
3070             '*pass-discard-snapshot': 'bool',
3071             '*pass-discard-other': 'bool',
3072             '*overlap-check': 'Qcow2OverlapChecks',
3073             '*cache-size': 'int',
3074             '*l2-cache-size': 'int',
3075             '*l2-cache-entry-size': 'int',
3076             '*refcount-cache-size': 'int',
3077             '*cache-clean-interval': 'int',
3078             '*encrypt': 'BlockdevQcow2Encryption' } }
3081 # @SshHostKeyCheckMode:
3083 # @none             Don't check the host key at all
3084 # @hash             Compare the host key with a given hash
3085 # @known_hosts      Check the host key against the known_hosts file
3087 # Since: 2.12
3089 { 'enum': 'SshHostKeyCheckMode',
3090   'data': [ 'none', 'hash', 'known_hosts' ] }
3093 # @SshHostKeyCheckHashType:
3095 # @md5              The given hash is an md5 hash
3096 # @sha1             The given hash is an sha1 hash
3098 # Since: 2.12
3100 { 'enum': 'SshHostKeyCheckHashType',
3101   'data': [ 'md5', 'sha1' ] }
3104 # @SshHostKeyHash:
3106 # @type             The hash algorithm used for the hash
3107 # @hash             The expected hash value
3109 # Since: 2.12
3111 { 'struct': 'SshHostKeyHash',
3112   'data': { 'type': 'SshHostKeyCheckHashType',
3113             'hash': 'str' }}
3116 # @SshHostKeyCheck:
3118 # Since: 2.12
3120 { 'union': 'SshHostKeyCheck',
3121   'base': { 'mode': 'SshHostKeyCheckMode' },
3122   'discriminator': 'mode',
3123   'data': { 'hash': 'SshHostKeyHash' } }
3126 # @BlockdevOptionsSsh:
3128 # @server:              host address
3130 # @path:                path to the image on the host
3132 # @user:                user as which to connect, defaults to current
3133 #                       local user name
3135 # @host-key-check:      Defines how and what to check the host key against
3136 #                       (default: known_hosts)
3138 # Since: 2.9
3140 { 'struct': 'BlockdevOptionsSsh',
3141   'data': { 'server': 'InetSocketAddress',
3142             'path': 'str',
3143             '*user': 'str',
3144             '*host-key-check': 'SshHostKeyCheck' } }
3148 # @BlkdebugEvent:
3150 # Trigger events supported by blkdebug.
3152 # @l1_shrink_write_table:      write zeros to the l1 table to shrink image.
3153 #                              (since 2.11)
3155 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3157 # @cor_write: a write due to copy-on-read (since 2.11)
3159 # Since: 2.9
3161 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3162   'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3163             'l1_grow_activate_table', 'l2_load', 'l2_update',
3164             'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3165             'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3166             'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3167             'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3168             'refblock_load', 'refblock_update', 'refblock_update_part',
3169             'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3170             'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3171             'refblock_alloc_switch_table', 'cluster_alloc',
3172             'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3173             'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3174             'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3175             'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3176             'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3177             'cor_write'] }
3180 # @BlkdebugInjectErrorOptions:
3182 # Describes a single error injection for blkdebug.
3184 # @event:       trigger event
3186 # @state:       the state identifier blkdebug needs to be in to
3187 #               actually trigger the event; defaults to "any"
3189 # @errno:       error identifier (errno) to be returned; defaults to
3190 #               EIO
3192 # @sector:      specifies the sector index which has to be affected
3193 #               in order to actually trigger the event; defaults to "any
3194 #               sector"
3196 # @once:        disables further events after this one has been
3197 #               triggered; defaults to false
3199 # @immediately: fail immediately; defaults to false
3201 # Since: 2.9
3203 { 'struct': 'BlkdebugInjectErrorOptions',
3204   'data': { 'event': 'BlkdebugEvent',
3205             '*state': 'int',
3206             '*errno': 'int',
3207             '*sector': 'int',
3208             '*once': 'bool',
3209             '*immediately': 'bool' } }
3212 # @BlkdebugSetStateOptions:
3214 # Describes a single state-change event for blkdebug.
3216 # @event:       trigger event
3218 # @state:       the current state identifier blkdebug needs to be in;
3219 #               defaults to "any"
3221 # @new_state:   the state identifier blkdebug is supposed to assume if
3222 #               this event is triggered
3224 # Since: 2.9
3226 { 'struct': 'BlkdebugSetStateOptions',
3227   'data': { 'event': 'BlkdebugEvent',
3228             '*state': 'int',
3229             'new_state': 'int' } }
3232 # @BlockdevOptionsBlkdebug:
3234 # Driver specific block device options for blkdebug.
3236 # @image:           underlying raw block device (or image file)
3238 # @config:          filename of the configuration file
3240 # @align:           required alignment for requests in bytes, must be
3241 #                   positive power of 2, or 0 for default
3243 # @max-transfer:    maximum size for I/O transfers in bytes, must be
3244 #                   positive multiple of @align and of the underlying
3245 #                   file's request alignment (but need not be a power of
3246 #                   2), or 0 for default (since 2.10)
3248 # @opt-write-zero:  preferred alignment for write zero requests in bytes,
3249 #                   must be positive multiple of @align and of the
3250 #                   underlying file's request alignment (but need not be a
3251 #                   power of 2), or 0 for default (since 2.10)
3253 # @max-write-zero:  maximum size for write zero requests in bytes, must be
3254 #                   positive multiple of @align, of @opt-write-zero, and of
3255 #                   the underlying file's request alignment (but need not
3256 #                   be a power of 2), or 0 for default (since 2.10)
3258 # @opt-discard:     preferred alignment for discard requests in bytes, must
3259 #                   be positive multiple of @align and of the underlying
3260 #                   file's request alignment (but need not be a power of
3261 #                   2), or 0 for default (since 2.10)
3263 # @max-discard:     maximum size for discard requests in bytes, must be
3264 #                   positive multiple of @align, of @opt-discard, and of
3265 #                   the underlying file's request alignment (but need not
3266 #                   be a power of 2), or 0 for default (since 2.10)
3268 # @inject-error:    array of error injection descriptions
3270 # @set-state:       array of state-change descriptions
3272 # Since: 2.9
3274 { 'struct': 'BlockdevOptionsBlkdebug',
3275   'data': { 'image': 'BlockdevRef',
3276             '*config': 'str',
3277             '*align': 'int', '*max-transfer': 'int32',
3278             '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3279             '*opt-discard': 'int32', '*max-discard': 'int32',
3280             '*inject-error': ['BlkdebugInjectErrorOptions'],
3281             '*set-state': ['BlkdebugSetStateOptions'] } }
3284 # @BlockdevOptionsBlklogwrites:
3286 # Driver specific block device options for blklogwrites.
3288 # @file:            block device
3290 # @log:             block device used to log writes to @file
3292 # @log-sector-size: sector size used in logging writes to @file, determines
3293 #                   granularity of offsets and sizes of writes (default: 512)
3295 # @log-append:      append to an existing log (default: false)
3297 # @log-super-update-interval: interval of write requests after which the log
3298 #                             super block is updated to disk (default: 4096)
3300 # Since: 3.0
3302 { 'struct': 'BlockdevOptionsBlklogwrites',
3303   'data': { 'file': 'BlockdevRef',
3304             'log': 'BlockdevRef',
3305             '*log-sector-size': 'uint32',
3306             '*log-append': 'bool',
3307             '*log-super-update-interval': 'uint64' } }
3310 # @BlockdevOptionsBlkverify:
3312 # Driver specific block device options for blkverify.
3314 # @test:    block device to be tested
3316 # @raw:     raw image used for verification
3318 # Since: 2.9
3320 { 'struct': 'BlockdevOptionsBlkverify',
3321   'data': { 'test': 'BlockdevRef',
3322             'raw': 'BlockdevRef' } }
3325 # @QuorumReadPattern:
3327 # An enumeration of quorum read patterns.
3329 # @quorum: read all the children and do a quorum vote on reads
3331 # @fifo: read only from the first child that has not failed
3333 # Since: 2.9
3335 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3338 # @BlockdevOptionsQuorum:
3340 # Driver specific block device options for Quorum
3342 # @blkverify:      true if the driver must print content mismatch
3343 #                  set to false by default
3345 # @children:       the children block devices to use
3347 # @vote-threshold: the vote limit under which a read will fail
3349 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3350 #                     (Since 2.1)
3352 # @read-pattern: choose read pattern and set to quorum by default
3353 #                (Since 2.2)
3355 # Since: 2.9
3357 { 'struct': 'BlockdevOptionsQuorum',
3358   'data': { '*blkverify': 'bool',
3359             'children': [ 'BlockdevRef' ],
3360             'vote-threshold': 'int',
3361             '*rewrite-corrupted': 'bool',
3362             '*read-pattern': 'QuorumReadPattern' } }
3365 # @BlockdevOptionsGluster:
3367 # Driver specific block device options for Gluster
3369 # @volume:      name of gluster volume where VM image resides
3371 # @path:        absolute path to image file in gluster volume
3373 # @server:      gluster servers description
3375 # @debug:       libgfapi log level (default '4' which is Error)
3376 #               (Since 2.8)
3378 # @logfile:     libgfapi log file (default /dev/stderr) (Since 2.8)
3380 # Since: 2.9
3382 { 'struct': 'BlockdevOptionsGluster',
3383   'data': { 'volume': 'str',
3384             'path': 'str',
3385             'server': ['SocketAddress'],
3386             '*debug': 'int',
3387             '*logfile': 'str' } }
3390 # @IscsiTransport:
3392 # An enumeration of libiscsi transport types
3394 # Since: 2.9
3396 { 'enum': 'IscsiTransport',
3397   'data': [ 'tcp', 'iser' ] }
3400 # @IscsiHeaderDigest:
3402 # An enumeration of header digests supported by libiscsi
3404 # Since: 2.9
3406 { 'enum': 'IscsiHeaderDigest',
3407   'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3408   'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3411 # @BlockdevOptionsIscsi:
3413 # @transport:       The iscsi transport type
3415 # @portal:          The address of the iscsi portal
3417 # @target:          The target iqn name
3419 # @lun:             LUN to connect to. Defaults to 0.
3421 # @user:            User name to log in with. If omitted, no CHAP
3422 #                   authentication is performed.
3424 # @password-secret: The ID of a QCryptoSecret object providing
3425 #                   the password for the login. This option is required if
3426 #                   @user is specified.
3428 # @initiator-name:  The iqn name we want to identify to the target
3429 #                   as. If this option is not specified, an initiator name is
3430 #                   generated automatically.
3432 # @header-digest:   The desired header digest. Defaults to
3433 #                   none-crc32c.
3435 # @timeout:         Timeout in seconds after which a request will
3436 #                   timeout. 0 means no timeout and is the default.
3438 # Driver specific block device options for iscsi
3440 # Since: 2.9
3442 { 'struct': 'BlockdevOptionsIscsi',
3443   'data': { 'transport': 'IscsiTransport',
3444             'portal': 'str',
3445             'target': 'str',
3446             '*lun': 'int',
3447             '*user': 'str',
3448             '*password-secret': 'str',
3449             '*initiator-name': 'str',
3450             '*header-digest': 'IscsiHeaderDigest',
3451             '*timeout': 'int' } }
3455 # @RbdAuthMode:
3457 # Since: 3.0
3459 { 'enum': 'RbdAuthMode',
3460   'data': [ 'cephx', 'none' ] }
3463 # @BlockdevOptionsRbd:
3465 # @pool:               Ceph pool name.
3467 # @image:              Image name in the Ceph pool.
3469 # @conf:               path to Ceph configuration file.  Values
3470 #                      in the configuration file will be overridden by
3471 #                      options specified via QAPI.
3473 # @snapshot:           Ceph snapshot name.
3475 # @user:               Ceph id name.
3477 # @auth-client-required: Acceptable authentication modes.
3478 #                      This maps to Ceph configuration option
3479 #                      "auth_client_required".  (Since 3.0)
3481 # @key-secret:         ID of a QCryptoSecret object providing a key
3482 #                      for cephx authentication.
3483 #                      This maps to Ceph configuration option
3484 #                      "key".  (Since 3.0)
3486 # @server:             Monitor host address and port.  This maps
3487 #                      to the "mon_host" Ceph option.
3489 # Since: 2.9
3491 { 'struct': 'BlockdevOptionsRbd',
3492   'data': { 'pool': 'str',
3493             'image': 'str',
3494             '*conf': 'str',
3495             '*snapshot': 'str',
3496             '*user': 'str',
3497             '*auth-client-required': ['RbdAuthMode'],
3498             '*key-secret': 'str',
3499             '*server': ['InetSocketAddressBase'] } }
3502 # @BlockdevOptionsSheepdog:
3504 # Driver specific block device options for sheepdog
3506 # @vdi:         Virtual disk image name
3507 # @server:      The Sheepdog server to connect to
3508 # @snap-id:     Snapshot ID
3509 # @tag:         Snapshot tag name
3511 # Only one of @snap-id and @tag may be present.
3513 # Since: 2.9
3515 { 'struct': 'BlockdevOptionsSheepdog',
3516   'data': { 'server': 'SocketAddress',
3517             'vdi': 'str',
3518             '*snap-id': 'uint32',
3519             '*tag': 'str' } }
3522 # @ReplicationMode:
3524 # An enumeration of replication modes.
3526 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3528 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3530 # Since: 2.9
3532 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3533   'if': 'defined(CONFIG_REPLICATION)' }
3536 # @BlockdevOptionsReplication:
3538 # Driver specific block device options for replication
3540 # @mode: the replication mode
3542 # @top-id: In secondary mode, node name or device ID of the root
3543 #          node who owns the replication node chain. Must not be given in
3544 #          primary mode.
3546 # Since: 2.9
3548 { 'struct': 'BlockdevOptionsReplication',
3549   'base': 'BlockdevOptionsGenericFormat',
3550   'data': { 'mode': 'ReplicationMode',
3551             '*top-id': 'str' },
3552   'if': 'defined(CONFIG_REPLICATION)' }
3555 # @NFSTransport:
3557 # An enumeration of NFS transport types
3559 # @inet:        TCP transport
3561 # Since: 2.9
3563 { 'enum': 'NFSTransport',
3564   'data': [ 'inet' ] }
3567 # @NFSServer:
3569 # Captures the address of the socket
3571 # @type:        transport type used for NFS (only TCP supported)
3573 # @host:        host address for NFS server
3575 # Since: 2.9
3577 { 'struct': 'NFSServer',
3578   'data': { 'type': 'NFSTransport',
3579             'host': 'str' } }
3582 # @BlockdevOptionsNfs:
3584 # Driver specific block device option for NFS
3586 # @server:                  host address
3588 # @path:                    path of the image on the host
3590 # @user:                    UID value to use when talking to the
3591 #                           server (defaults to 65534 on Windows and getuid()
3592 #                           on unix)
3594 # @group:                   GID value to use when talking to the
3595 #                           server (defaults to 65534 on Windows and getgid()
3596 #                           in unix)
3598 # @tcp-syn-count:           number of SYNs during the session
3599 #                           establishment (defaults to libnfs default)
3601 # @readahead-size:          set the readahead size in bytes (defaults
3602 #                           to libnfs default)
3604 # @page-cache-size:         set the pagecache size in bytes (defaults
3605 #                           to libnfs default)
3607 # @debug:                   set the NFS debug level (max 2) (defaults
3608 #                           to libnfs default)
3610 # Since: 2.9
3612 { 'struct': 'BlockdevOptionsNfs',
3613   'data': { 'server': 'NFSServer',
3614             'path': 'str',
3615             '*user': 'int',
3616             '*group': 'int',
3617             '*tcp-syn-count': 'int',
3618             '*readahead-size': 'int',
3619             '*page-cache-size': 'int',
3620             '*debug': 'int' } }
3623 # @BlockdevOptionsCurlBase:
3625 # Driver specific block device options shared by all protocols supported by the
3626 # curl backend.
3628 # @url:                     URL of the image file
3630 # @readahead:               Size of the read-ahead cache; must be a multiple of
3631 #                           512 (defaults to 256 kB)
3633 # @timeout:                 Timeout for connections, in seconds (defaults to 5)
3635 # @username:                Username for authentication (defaults to none)
3637 # @password-secret:         ID of a QCryptoSecret object providing a password
3638 #                           for authentication (defaults to no password)
3640 # @proxy-username:          Username for proxy authentication (defaults to none)
3642 # @proxy-password-secret:   ID of a QCryptoSecret object providing a password
3643 #                           for proxy authentication (defaults to no password)
3645 # Since: 2.9
3647 { 'struct': 'BlockdevOptionsCurlBase',
3648   'data': { 'url': 'str',
3649             '*readahead': 'int',
3650             '*timeout': 'int',
3651             '*username': 'str',
3652             '*password-secret': 'str',
3653             '*proxy-username': 'str',
3654             '*proxy-password-secret': 'str' } }
3657 # @BlockdevOptionsCurlHttp:
3659 # Driver specific block device options for HTTP connections over the curl
3660 # backend.  URLs must start with "http://".
3662 # @cookie:      List of cookies to set; format is
3663 #               "name1=content1; name2=content2;" as explained by
3664 #               CURLOPT_COOKIE(3). Defaults to no cookies.
3666 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3667 #                 secure way. See @cookie for the format. (since 2.10)
3669 # Since: 2.9
3671 { 'struct': 'BlockdevOptionsCurlHttp',
3672   'base': 'BlockdevOptionsCurlBase',
3673   'data': { '*cookie': 'str',
3674             '*cookie-secret': 'str'} }
3677 # @BlockdevOptionsCurlHttps:
3679 # Driver specific block device options for HTTPS connections over the curl
3680 # backend.  URLs must start with "https://".
3682 # @cookie:      List of cookies to set; format is
3683 #               "name1=content1; name2=content2;" as explained by
3684 #               CURLOPT_COOKIE(3). Defaults to no cookies.
3686 # @sslverify:   Whether to verify the SSL certificate's validity (defaults to
3687 #               true)
3689 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3690 #                 secure way. See @cookie for the format. (since 2.10)
3692 # Since: 2.9
3694 { 'struct': 'BlockdevOptionsCurlHttps',
3695   'base': 'BlockdevOptionsCurlBase',
3696   'data': { '*cookie': 'str',
3697             '*sslverify': 'bool',
3698             '*cookie-secret': 'str'} }
3701 # @BlockdevOptionsCurlFtp:
3703 # Driver specific block device options for FTP connections over the curl
3704 # backend.  URLs must start with "ftp://".
3706 # Since: 2.9
3708 { 'struct': 'BlockdevOptionsCurlFtp',
3709   'base': 'BlockdevOptionsCurlBase',
3710   'data': { } }
3713 # @BlockdevOptionsCurlFtps:
3715 # Driver specific block device options for FTPS connections over the curl
3716 # backend.  URLs must start with "ftps://".
3718 # @sslverify:   Whether to verify the SSL certificate's validity (defaults to
3719 #               true)
3721 # Since: 2.9
3723 { 'struct': 'BlockdevOptionsCurlFtps',
3724   'base': 'BlockdevOptionsCurlBase',
3725   'data': { '*sslverify': 'bool' } }
3728 # @BlockdevOptionsNbd:
3730 # Driver specific block device options for NBD.
3732 # @server:      NBD server address
3734 # @export:      export name
3736 # @tls-creds:   TLS credentials ID
3738 # @x-dirty-bitmap: A "qemu:dirty-bitmap:NAME" string to query in place of
3739 #                  traditional "base:allocation" block status (see
3740 #                  NBD_OPT_LIST_META_CONTEXT in the NBD protocol) (since 3.0)
3742 # Since: 2.9
3744 { 'struct': 'BlockdevOptionsNbd',
3745   'data': { 'server': 'SocketAddress',
3746             '*export': 'str',
3747             '*tls-creds': 'str',
3748             '*x-dirty-bitmap': 'str' } }
3751 # @BlockdevOptionsRaw:
3753 # Driver specific block device options for the raw driver.
3755 # @offset:      position where the block device starts
3756 # @size:        the assumed size of the device
3758 # Since: 2.9
3760 { 'struct': 'BlockdevOptionsRaw',
3761   'base': 'BlockdevOptionsGenericFormat',
3762   'data': { '*offset': 'int', '*size': 'int' } }
3765 # @BlockdevOptionsVxHS:
3767 # Driver specific block device options for VxHS
3769 # @vdisk-id:    UUID of VxHS volume
3770 # @server:      vxhs server IP, port
3771 # @tls-creds:   TLS credentials ID
3773 # Since: 2.10
3775 { 'struct': 'BlockdevOptionsVxHS',
3776   'data': { 'vdisk-id': 'str',
3777             'server': 'InetSocketAddressBase',
3778             '*tls-creds': 'str' } }
3781 # @BlockdevOptionsThrottle:
3783 # Driver specific block device options for the throttle driver
3785 # @throttle-group:   the name of the throttle-group object to use. It
3786 #                    must already exist.
3787 # @file:             reference to or definition of the data source block device
3788 # Since: 2.11
3790 { 'struct': 'BlockdevOptionsThrottle',
3791   'data': { 'throttle-group': 'str',
3792             'file' : 'BlockdevRef'
3793              } }
3795 # @BlockdevOptions:
3797 # Options for creating a block device.  Many options are available for all
3798 # block devices, independent of the block driver:
3800 # @driver:        block driver name
3801 # @node-name:     the node name of the new node (Since 2.0).
3802 #                 This option is required on the top level of blockdev-add.
3803 #                 Valid node names start with an alphabetic character and may
3804 #                 contain only alphanumeric characters, '-', '.' and '_'. Their
3805 #                 maximum length is 31 characters.
3806 # @discard:       discard-related options (default: ignore)
3807 # @cache:         cache-related options
3808 # @read-only:     whether the block device should be read-only (default: false).
3809 #                 Note that some block drivers support only read-only access,
3810 #                 either generally or in certain configurations. In this case,
3811 #                 the default value does not work and the option must be
3812 #                 specified explicitly.
3813 # @auto-read-only: if true and @read-only is false, QEMU may automatically
3814 #                  decide not to open the image read-write as requested, but
3815 #                  fall back to read-only instead (and switch between the modes
3816 #                  later), e.g. depending on whether the image file is writable
3817 #                  or whether a writing user is attached to the node
3818 #                  (default: false, since 3.1)
3819 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3820 #                 (default: off)
3821 # @force-share:   force share all permission on added nodes.
3822 #                 Requires read-only=true. (Since 2.10)
3824 # Remaining options are determined by the block driver.
3826 # Since: 2.9
3828 { 'union': 'BlockdevOptions',
3829   'base': { 'driver': 'BlockdevDriver',
3830             '*node-name': 'str',
3831             '*discard': 'BlockdevDiscardOptions',
3832             '*cache': 'BlockdevCacheOptions',
3833             '*read-only': 'bool',
3834             '*auto-read-only': 'bool',
3835             '*force-share': 'bool',
3836             '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3837   'discriminator': 'driver',
3838   'data': {
3839       'blkdebug':   'BlockdevOptionsBlkdebug',
3840       'blklogwrites':'BlockdevOptionsBlklogwrites',
3841       'blkverify':  'BlockdevOptionsBlkverify',
3842       'bochs':      'BlockdevOptionsGenericFormat',
3843       'cloop':      'BlockdevOptionsGenericFormat',
3844       'copy-on-read':'BlockdevOptionsGenericFormat',
3845       'dmg':        'BlockdevOptionsGenericFormat',
3846       'file':       'BlockdevOptionsFile',
3847       'ftp':        'BlockdevOptionsCurlFtp',
3848       'ftps':       'BlockdevOptionsCurlFtps',
3849       'gluster':    'BlockdevOptionsGluster',
3850       'host_cdrom': 'BlockdevOptionsFile',
3851       'host_device':'BlockdevOptionsFile',
3852       'http':       'BlockdevOptionsCurlHttp',
3853       'https':      'BlockdevOptionsCurlHttps',
3854       'iscsi':      'BlockdevOptionsIscsi',
3855       'luks':       'BlockdevOptionsLUKS',
3856       'nbd':        'BlockdevOptionsNbd',
3857       'nfs':        'BlockdevOptionsNfs',
3858       'null-aio':   'BlockdevOptionsNull',
3859       'null-co':    'BlockdevOptionsNull',
3860       'nvme':       'BlockdevOptionsNVMe',
3861       'parallels':  'BlockdevOptionsGenericFormat',
3862       'qcow2':      'BlockdevOptionsQcow2',
3863       'qcow':       'BlockdevOptionsQcow',
3864       'qed':        'BlockdevOptionsGenericCOWFormat',
3865       'quorum':     'BlockdevOptionsQuorum',
3866       'raw':        'BlockdevOptionsRaw',
3867       'rbd':        'BlockdevOptionsRbd',
3868       'replication': { 'type': 'BlockdevOptionsReplication',
3869                        'if': 'defined(CONFIG_REPLICATION)' },
3870       'sheepdog':   'BlockdevOptionsSheepdog',
3871       'ssh':        'BlockdevOptionsSsh',
3872       'throttle':   'BlockdevOptionsThrottle',
3873       'vdi':        'BlockdevOptionsGenericFormat',
3874       'vhdx':       'BlockdevOptionsGenericFormat',
3875       'vmdk':       'BlockdevOptionsGenericCOWFormat',
3876       'vpc':        'BlockdevOptionsGenericFormat',
3877       'vvfat':      'BlockdevOptionsVVFAT',
3878       'vxhs':       'BlockdevOptionsVxHS'
3879   } }
3882 # @BlockdevRef:
3884 # Reference to a block device.
3886 # @definition:      defines a new block device inline
3887 # @reference:       references the ID of an existing block device
3889 # Since: 2.9
3891 { 'alternate': 'BlockdevRef',
3892   'data': { 'definition': 'BlockdevOptions',
3893             'reference': 'str' } }
3896 # @BlockdevRefOrNull:
3898 # Reference to a block device.
3900 # @definition:      defines a new block device inline
3901 # @reference:       references the ID of an existing block device.
3902 #                   An empty string means that no block device should
3903 #                   be referenced.  Deprecated; use null instead.
3904 # @null:            No block device should be referenced (since 2.10)
3906 # Since: 2.9
3908 { 'alternate': 'BlockdevRefOrNull',
3909   'data': { 'definition': 'BlockdevOptions',
3910             'reference': 'str',
3911             'null': 'null' } }
3914 # @blockdev-add:
3916 # Creates a new block device. If the @id option is given at the top level, a
3917 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
3918 # level and no BlockBackend will be created.
3920 # Since: 2.9
3922 # Example:
3924 # 1.
3925 # -> { "execute": "blockdev-add",
3926 #      "arguments": {
3927 #           "driver": "qcow2",
3928 #           "node-name": "test1",
3929 #           "file": {
3930 #               "driver": "file",
3931 #               "filename": "test.qcow2"
3932 #            }
3933 #       }
3934 #     }
3935 # <- { "return": {} }
3937 # 2.
3938 # -> { "execute": "blockdev-add",
3939 #      "arguments": {
3940 #           "driver": "qcow2",
3941 #           "node-name": "node0",
3942 #           "discard": "unmap",
3943 #           "cache": {
3944 #              "direct": true
3945 #            },
3946 #            "file": {
3947 #              "driver": "file",
3948 #              "filename": "/tmp/test.qcow2"
3949 #            },
3950 #            "backing": {
3951 #               "driver": "raw",
3952 #               "file": {
3953 #                  "driver": "file",
3954 #                  "filename": "/dev/fdset/4"
3955 #                }
3956 #            }
3957 #        }
3958 #      }
3960 # <- { "return": {} }
3963 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
3966 # @blockdev-del:
3968 # Deletes a block device that has been added using blockdev-add.
3969 # The command will fail if the node is attached to a device or is
3970 # otherwise being used.
3972 # @node-name: Name of the graph node to delete.
3974 # Since: 2.9
3976 # Example:
3978 # -> { "execute": "blockdev-add",
3979 #      "arguments": {
3980 #           "driver": "qcow2",
3981 #           "node-name": "node0",
3982 #           "file": {
3983 #               "driver": "file",
3984 #               "filename": "test.qcow2"
3985 #           }
3986 #      }
3987 #    }
3988 # <- { "return": {} }
3990 # -> { "execute": "blockdev-del",
3991 #      "arguments": { "node-name": "node0" }
3992 #    }
3993 # <- { "return": {} }
3996 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
3999 # @BlockdevCreateOptionsFile:
4001 # Driver specific image creation options for file.
4003 # @filename         Filename for the new image file
4004 # @size             Size of the virtual disk in bytes
4005 # @preallocation    Preallocation mode for the new image (default: off)
4006 # @nocow            Turn off copy-on-write (valid only on btrfs; default: off)
4008 # Since: 2.12
4010 { 'struct': 'BlockdevCreateOptionsFile',
4011   'data': { 'filename':         'str',
4012             'size':             'size',
4013             '*preallocation':   'PreallocMode',
4014             '*nocow':           'bool' } }
4017 # @BlockdevCreateOptionsGluster:
4019 # Driver specific image creation options for gluster.
4021 # @location         Where to store the new image file
4022 # @size             Size of the virtual disk in bytes
4023 # @preallocation    Preallocation mode for the new image (default: off)
4025 # Since: 2.12
4027 { 'struct': 'BlockdevCreateOptionsGluster',
4028   'data': { 'location':         'BlockdevOptionsGluster',
4029             'size':             'size',
4030             '*preallocation':   'PreallocMode' } }
4033 # @BlockdevCreateOptionsLUKS:
4035 # Driver specific image creation options for LUKS.
4037 # @file             Node to create the image format on
4038 # @size             Size of the virtual disk in bytes
4040 # Since: 2.12
4042 { 'struct': 'BlockdevCreateOptionsLUKS',
4043   'base': 'QCryptoBlockCreateOptionsLUKS',
4044   'data': { 'file':             'BlockdevRef',
4045             'size':             'size' } }
4048 # @BlockdevCreateOptionsNfs:
4050 # Driver specific image creation options for NFS.
4052 # @location         Where to store the new image file
4053 # @size             Size of the virtual disk in bytes
4055 # Since: 2.12
4057 { 'struct': 'BlockdevCreateOptionsNfs',
4058   'data': { 'location':         'BlockdevOptionsNfs',
4059             'size':             'size' } }
4062 # @BlockdevCreateOptionsParallels:
4064 # Driver specific image creation options for parallels.
4066 # @file             Node to create the image format on
4067 # @size             Size of the virtual disk in bytes
4068 # @cluster-size     Cluster size in bytes (default: 1 MB)
4070 # Since: 2.12
4072 { 'struct': 'BlockdevCreateOptionsParallels',
4073   'data': { 'file':             'BlockdevRef',
4074             'size':             'size',
4075             '*cluster-size':    'size' } }
4078 # @BlockdevCreateOptionsQcow:
4080 # Driver specific image creation options for qcow.
4082 # @file             Node to create the image format on
4083 # @size             Size of the virtual disk in bytes
4084 # @backing-file     File name of the backing file if a backing file
4085 #                   should be used
4086 # @encrypt          Encryption options if the image should be encrypted
4088 # Since: 2.12
4090 { 'struct': 'BlockdevCreateOptionsQcow',
4091   'data': { 'file':             'BlockdevRef',
4092             'size':             'size',
4093             '*backing-file':    'str',
4094             '*encrypt':         'QCryptoBlockCreateOptions' } }
4097 # @BlockdevQcow2Version:
4099 # @v2:  The original QCOW2 format as introduced in qemu 0.10 (version 2)
4100 # @v3:  The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4102 # Since: 2.12
4104 { 'enum': 'BlockdevQcow2Version',
4105   'data': [ 'v2', 'v3' ] }
4109 # @BlockdevCreateOptionsQcow2:
4111 # Driver specific image creation options for qcow2.
4113 # @file             Node to create the image format on
4114 # @size             Size of the virtual disk in bytes
4115 # @version          Compatibility level (default: v3)
4116 # @backing-file     File name of the backing file if a backing file
4117 #                   should be used
4118 # @backing-fmt      Name of the block driver to use for the backing file
4119 # @encrypt          Encryption options if the image should be encrypted
4120 # @cluster-size     qcow2 cluster size in bytes (default: 65536)
4121 # @preallocation    Preallocation mode for the new image (default: off)
4122 # @lazy-refcounts   True if refcounts may be updated lazily (default: off)
4123 # @refcount-bits    Width of reference counts in bits (default: 16)
4125 # Since: 2.12
4127 { 'struct': 'BlockdevCreateOptionsQcow2',
4128   'data': { 'file':             'BlockdevRef',
4129             'size':             'size',
4130             '*version':         'BlockdevQcow2Version',
4131             '*backing-file':    'str',
4132             '*backing-fmt':     'BlockdevDriver',
4133             '*encrypt':         'QCryptoBlockCreateOptions',
4134             '*cluster-size':    'size',
4135             '*preallocation':   'PreallocMode',
4136             '*lazy-refcounts':  'bool',
4137             '*refcount-bits':   'int' } }
4140 # @BlockdevCreateOptionsQed:
4142 # Driver specific image creation options for qed.
4144 # @file             Node to create the image format on
4145 # @size             Size of the virtual disk in bytes
4146 # @backing-file     File name of the backing file if a backing file
4147 #                   should be used
4148 # @backing-fmt      Name of the block driver to use for the backing file
4149 # @cluster-size     Cluster size in bytes (default: 65536)
4150 # @table-size       L1/L2 table size (in clusters)
4152 # Since: 2.12
4154 { 'struct': 'BlockdevCreateOptionsQed',
4155   'data': { 'file':             'BlockdevRef',
4156             'size':             'size',
4157             '*backing-file':    'str',
4158             '*backing-fmt':     'BlockdevDriver',
4159             '*cluster-size':    'size',
4160             '*table-size':      'int' } }
4163 # @BlockdevCreateOptionsRbd:
4165 # Driver specific image creation options for rbd/Ceph.
4167 # @location         Where to store the new image file. This location cannot
4168 #                   point to a snapshot.
4169 # @size             Size of the virtual disk in bytes
4170 # @cluster-size     RBD object size
4172 # Since: 2.12
4174 { 'struct': 'BlockdevCreateOptionsRbd',
4175   'data': { 'location':         'BlockdevOptionsRbd',
4176             'size':             'size',
4177             '*cluster-size' :   'size' } }
4180 # @BlockdevVmdkSubformat:
4182 # Subformat options for VMDK images
4184 # @monolithicSparse:     Single file image with sparse cluster allocation
4186 # @monolithicFlat:       Single flat data image and a descriptor file
4188 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4189 #                        files, in addition to a descriptor file
4191 # @twoGbMaxExtentFlat:   Data is split into 2GB (per virtual LBA) flat extent
4192 #                        files, in addition to a descriptor file
4194 # @streamOptimized:      Single file image sparse cluster allocation, optimized
4195 #                        for streaming over network.
4197 # Since: 4.0
4199 { 'enum': 'BlockdevVmdkSubformat',
4200   'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4201             'twoGbMaxExtentFlat', 'streamOptimized'] }
4204 # @BlockdevVmdkAdapterType:
4206 # Adapter type info for VMDK images
4208 # Since: 4.0
4210 { 'enum': 'BlockdevVmdkAdapterType',
4211   'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4214 # @BlockdevCreateOptionsVmdk:
4216 # Driver specific image creation options for VMDK.
4218 # @file         Where to store the new image file. This refers to the image
4219 #               file for monolithcSparse and streamOptimized format, or the
4220 #               descriptor file for other formats.
4221 # @size         Size of the virtual disk in bytes
4222 # @extents      Where to store the data extents. Required for monolithcFlat,
4223 #               twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4224 #               monolithicFlat, only one entry is required; for
4225 #               twoGbMaxExtent* formats, the number of entries required is
4226 #               calculated as extent_number = virtual_size / 2GB. Providing
4227 #               more extents than will be used is an error.
4228 # @subformat    The subformat of the VMDK image. Default: "monolithicSparse".
4229 # @backing-file The path of backing file. Default: no backing file is used.
4230 # @adapter-type The adapter type used to fill in the descriptor. Default: ide.
4231 # @hwversion    Hardware version. The meaningful options are "4" or "6".
4232 #               Default: "4".
4233 # @zeroed-grain Whether to enable zeroed-grain feature for sparse subformats.
4234 #               Default: false.
4236 # Since: 4.0
4238 { 'struct': 'BlockdevCreateOptionsVmdk',
4239   'data': { 'file':             'BlockdevRef',
4240             'size':             'size',
4241             '*extents':          ['BlockdevRef'],
4242             '*subformat':       'BlockdevVmdkSubformat',
4243             '*backing-file':    'str',
4244             '*adapter-type':    'BlockdevVmdkAdapterType',
4245             '*hwversion':       'str',
4246             '*zeroed-grain':    'bool' } }
4250 # @SheepdogRedundancyType:
4252 # @full             Create a fully replicated vdi with x copies
4253 # @erasure-coded    Create an erasure coded vdi with x data strips and
4254 #                   y parity strips
4256 # Since: 2.12
4258 { 'enum': 'SheepdogRedundancyType',
4259   'data': [ 'full', 'erasure-coded' ] }
4262 # @SheepdogRedundancyFull:
4264 # @copies           Number of copies to use (between 1 and 31)
4266 # Since: 2.12
4268 { 'struct': 'SheepdogRedundancyFull',
4269   'data': { 'copies': 'int' }}
4272 # @SheepdogRedundancyErasureCoded:
4274 # @data-strips      Number of data strips to use (one of {2,4,8,16})
4275 # @parity-strips    Number of parity strips to use (between 1 and 15)
4277 # Since: 2.12
4279 { 'struct': 'SheepdogRedundancyErasureCoded',
4280   'data': { 'data-strips': 'int',
4281             'parity-strips': 'int' }}
4284 # @SheepdogRedundancy:
4286 # Since: 2.12
4288 { 'union': 'SheepdogRedundancy',
4289   'base': { 'type': 'SheepdogRedundancyType' },
4290   'discriminator': 'type',
4291   'data': { 'full': 'SheepdogRedundancyFull',
4292             'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
4295 # @BlockdevCreateOptionsSheepdog:
4297 # Driver specific image creation options for Sheepdog.
4299 # @location         Where to store the new image file
4300 # @size             Size of the virtual disk in bytes
4301 # @backing-file     File name of a base image
4302 # @preallocation    Preallocation mode (allowed values: off, full)
4303 # @redundancy       Redundancy of the image
4304 # @object-size      Object size of the image
4306 # Since: 2.12
4308 { 'struct': 'BlockdevCreateOptionsSheepdog',
4309   'data': { 'location':         'BlockdevOptionsSheepdog',
4310             'size':             'size',
4311             '*backing-file':    'str',
4312             '*preallocation':   'PreallocMode',
4313             '*redundancy':      'SheepdogRedundancy',
4314             '*object-size':     'size' } }
4317 # @BlockdevCreateOptionsSsh:
4319 # Driver specific image creation options for SSH.
4321 # @location         Where to store the new image file
4322 # @size             Size of the virtual disk in bytes
4324 # Since: 2.12
4326 { 'struct': 'BlockdevCreateOptionsSsh',
4327   'data': { 'location':         'BlockdevOptionsSsh',
4328             'size':             'size' } }
4331 # @BlockdevCreateOptionsVdi:
4333 # Driver specific image creation options for VDI.
4335 # @file             Node to create the image format on
4336 # @size             Size of the virtual disk in bytes
4337 # @preallocation    Preallocation mode for the new image (allowed values: off,
4338 #                   metadata; default: off)
4340 # Since: 2.12
4342 { 'struct': 'BlockdevCreateOptionsVdi',
4343   'data': { 'file':             'BlockdevRef',
4344             'size':             'size',
4345             '*preallocation':   'PreallocMode' } }
4348 # @BlockdevVhdxSubformat:
4350 # @dynamic: Growing image file
4351 # @fixed:   Preallocated fixed-size image file
4353 # Since: 2.12
4355 { 'enum': 'BlockdevVhdxSubformat',
4356   'data': [ 'dynamic', 'fixed' ] }
4359 # @BlockdevCreateOptionsVhdx:
4361 # Driver specific image creation options for vhdx.
4363 # @file             Node to create the image format on
4364 # @size             Size of the virtual disk in bytes
4365 # @log-size         Log size in bytes, must be a multiple of 1 MB
4366 #                   (default: 1 MB)
4367 # @block-size       Block size in bytes, must be a multiple of 1 MB and not
4368 #                   larger than 256 MB (default: automatically choose a block
4369 #                   size depending on the image size)
4370 # @subformat        vhdx subformat (default: dynamic)
4371 # @block-state-zero Force use of payload blocks of type 'ZERO'. Non-standard,
4372 #                   but default.  Do not set to 'off' when using 'qemu-img
4373 #                   convert' with subformat=dynamic.
4375 # Since: 2.12
4377 { 'struct': 'BlockdevCreateOptionsVhdx',
4378   'data': { 'file':                 'BlockdevRef',
4379             'size':                 'size',
4380             '*log-size':            'size',
4381             '*block-size':          'size',
4382             '*subformat':           'BlockdevVhdxSubformat',
4383             '*block-state-zero':    'bool' } }
4386 # @BlockdevVpcSubformat:
4388 # @dynamic: Growing image file
4389 # @fixed:   Preallocated fixed-size image file
4391 # Since: 2.12
4393 { 'enum': 'BlockdevVpcSubformat',
4394   'data': [ 'dynamic', 'fixed' ] }
4397 # @BlockdevCreateOptionsVpc:
4399 # Driver specific image creation options for vpc (VHD).
4401 # @file             Node to create the image format on
4402 # @size             Size of the virtual disk in bytes
4403 # @subformat        vhdx subformat (default: dynamic)
4404 # @force-size       Force use of the exact byte size instead of rounding to the
4405 #                   next size that can be represented in CHS geometry
4406 #                   (default: false)
4408 # Since: 2.12
4410 { 'struct': 'BlockdevCreateOptionsVpc',
4411   'data': { 'file':                 'BlockdevRef',
4412             'size':                 'size',
4413             '*subformat':           'BlockdevVpcSubformat',
4414             '*force-size':          'bool' } }
4417 # @BlockdevCreateOptions:
4419 # Options for creating an image format on a given node.
4421 # @driver           block driver to create the image format
4423 # Since: 2.12
4425 { 'union': 'BlockdevCreateOptions',
4426   'base': {
4427       'driver':         'BlockdevDriver' },
4428   'discriminator': 'driver',
4429   'data': {
4430       'file':           'BlockdevCreateOptionsFile',
4431       'gluster':        'BlockdevCreateOptionsGluster',
4432       'luks':           'BlockdevCreateOptionsLUKS',
4433       'nfs':            'BlockdevCreateOptionsNfs',
4434       'parallels':      'BlockdevCreateOptionsParallels',
4435       'qcow':           'BlockdevCreateOptionsQcow',
4436       'qcow2':          'BlockdevCreateOptionsQcow2',
4437       'qed':            'BlockdevCreateOptionsQed',
4438       'rbd':            'BlockdevCreateOptionsRbd',
4439       'sheepdog':       'BlockdevCreateOptionsSheepdog',
4440       'ssh':            'BlockdevCreateOptionsSsh',
4441       'vdi':            'BlockdevCreateOptionsVdi',
4442       'vhdx':           'BlockdevCreateOptionsVhdx',
4443       'vmdk':           'BlockdevCreateOptionsVmdk',
4444       'vpc':            'BlockdevCreateOptionsVpc'
4445   } }
4448 # @blockdev-create:
4450 # Starts a job to create an image format on a given node. The job is
4451 # automatically finalized, but a manual job-dismiss is required.
4453 # @job-id:          Identifier for the newly created job.
4455 # @options:         Options for the image creation.
4457 # Since: 3.0
4459 { 'command': 'blockdev-create',
4460   'data': { 'job-id': 'str',
4461             'options': 'BlockdevCreateOptions' } }
4464 # @blockdev-open-tray:
4466 # Opens a block device's tray. If there is a block driver state tree inserted as
4467 # a medium, it will become inaccessible to the guest (but it will remain
4468 # associated to the block device, so closing the tray will make it accessible
4469 # again).
4471 # If the tray was already open before, this will be a no-op.
4473 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4474 # which no such event will be generated, these include:
4475 # - if the guest has locked the tray, @force is false and the guest does not
4476 #   respond to the eject request
4477 # - if the BlockBackend denoted by @device does not have a guest device attached
4478 #   to it
4479 # - if the guest device does not have an actual tray
4481 # @device: Block device name (deprecated, use @id instead)
4483 # @id:     The name or QOM path of the guest device (since: 2.8)
4485 # @force:  if false (the default), an eject request will be sent to
4486 #          the guest if it has locked the tray (and the tray will not be opened
4487 #          immediately); if true, the tray will be opened regardless of whether
4488 #          it is locked
4490 # Since: 2.5
4492 # Example:
4494 # -> { "execute": "blockdev-open-tray",
4495 #      "arguments": { "id": "ide0-1-0" } }
4497 # <- { "timestamp": { "seconds": 1418751016,
4498 #                     "microseconds": 716996 },
4499 #      "event": "DEVICE_TRAY_MOVED",
4500 #      "data": { "device": "ide1-cd0",
4501 #                "id": "ide0-1-0",
4502 #                "tray-open": true } }
4504 # <- { "return": {} }
4507 { 'command': 'blockdev-open-tray',
4508   'data': { '*device': 'str',
4509             '*id': 'str',
4510             '*force': 'bool' } }
4513 # @blockdev-close-tray:
4515 # Closes a block device's tray. If there is a block driver state tree associated
4516 # with the block device (which is currently ejected), that tree will be loaded
4517 # as the medium.
4519 # If the tray was already closed before, this will be a no-op.
4521 # @device:  Block device name (deprecated, use @id instead)
4523 # @id:      The name or QOM path of the guest device (since: 2.8)
4525 # Since: 2.5
4527 # Example:
4529 # -> { "execute": "blockdev-close-tray",
4530 #      "arguments": { "id": "ide0-1-0" } }
4532 # <- { "timestamp": { "seconds": 1418751345,
4533 #                     "microseconds": 272147 },
4534 #      "event": "DEVICE_TRAY_MOVED",
4535 #      "data": { "device": "ide1-cd0",
4536 #                "id": "ide0-1-0",
4537 #                "tray-open": false } }
4539 # <- { "return": {} }
4542 { 'command': 'blockdev-close-tray',
4543   'data': { '*device': 'str',
4544             '*id': 'str' } }
4547 # @blockdev-remove-medium:
4549 # Removes a medium (a block driver state tree) from a block device. That block
4550 # device's tray must currently be open (unless there is no attached guest
4551 # device).
4553 # If the tray is open and there is no medium inserted, this will be a no-op.
4555 # @id:     The name or QOM path of the guest device
4557 # Since: 2.12
4559 # Example:
4561 # -> { "execute": "blockdev-remove-medium",
4562 #      "arguments": { "id": "ide0-1-0" } }
4564 # <- { "error": { "class": "GenericError",
4565 #                 "desc": "Tray of device 'ide0-1-0' is not open" } }
4567 # -> { "execute": "blockdev-open-tray",
4568 #      "arguments": { "id": "ide0-1-0" } }
4570 # <- { "timestamp": { "seconds": 1418751627,
4571 #                     "microseconds": 549958 },
4572 #      "event": "DEVICE_TRAY_MOVED",
4573 #      "data": { "device": "ide1-cd0",
4574 #                "id": "ide0-1-0",
4575 #                "tray-open": true } }
4577 # <- { "return": {} }
4579 # -> { "execute": "blockdev-remove-medium",
4580 #      "arguments": { "id": "ide0-1-0" } }
4582 # <- { "return": {} }
4585 { 'command': 'blockdev-remove-medium',
4586   'data': { 'id': 'str' } }
4589 # @blockdev-insert-medium:
4591 # Inserts a medium (a block driver state tree) into a block device. That block
4592 # device's tray must currently be open (unless there is no attached guest
4593 # device) and there must be no medium inserted already.
4595 # @id:        The name or QOM path of the guest device
4597 # @node-name: name of a node in the block driver state graph
4599 # Since: 2.12
4601 # Example:
4603 # -> { "execute": "blockdev-add",
4604 #      "arguments": {
4605 #          "node-name": "node0",
4606 #          "driver": "raw",
4607 #          "file": { "driver": "file",
4608 #                    "filename": "fedora.iso" } } }
4609 # <- { "return": {} }
4611 # -> { "execute": "blockdev-insert-medium",
4612 #      "arguments": { "id": "ide0-1-0",
4613 #                     "node-name": "node0" } }
4615 # <- { "return": {} }
4618 { 'command': 'blockdev-insert-medium',
4619   'data': { 'id': 'str',
4620             'node-name': 'str'} }
4624 # @BlockdevChangeReadOnlyMode:
4626 # Specifies the new read-only mode of a block device subject to the
4627 # @blockdev-change-medium command.
4629 # @retain:      Retains the current read-only mode
4631 # @read-only:   Makes the device read-only
4633 # @read-write:  Makes the device writable
4635 # Since: 2.3
4638 { 'enum': 'BlockdevChangeReadOnlyMode',
4639   'data': ['retain', 'read-only', 'read-write'] }
4643 # @blockdev-change-medium:
4645 # Changes the medium inserted into a block device by ejecting the current medium
4646 # and loading a new image file which is inserted as the new medium (this command
4647 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
4648 # and blockdev-close-tray).
4650 # @device:          Block device name (deprecated, use @id instead)
4652 # @id:              The name or QOM path of the guest device
4653 #                   (since: 2.8)
4655 # @filename:        filename of the new image to be loaded
4657 # @format:          format to open the new image with (defaults to
4658 #                   the probed format)
4660 # @read-only-mode:  change the read-only mode of the device; defaults
4661 #                   to 'retain'
4663 # Since: 2.5
4665 # Examples:
4667 # 1. Change a removable medium
4669 # -> { "execute": "blockdev-change-medium",
4670 #      "arguments": { "id": "ide0-1-0",
4671 #                     "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4672 #                     "format": "raw" } }
4673 # <- { "return": {} }
4675 # 2. Load a read-only medium into a writable drive
4677 # -> { "execute": "blockdev-change-medium",
4678 #      "arguments": { "id": "floppyA",
4679 #                     "filename": "/srv/images/ro.img",
4680 #                     "format": "raw",
4681 #                     "read-only-mode": "retain" } }
4683 # <- { "error":
4684 #      { "class": "GenericError",
4685 #        "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4687 # -> { "execute": "blockdev-change-medium",
4688 #      "arguments": { "id": "floppyA",
4689 #                     "filename": "/srv/images/ro.img",
4690 #                     "format": "raw",
4691 #                     "read-only-mode": "read-only" } }
4693 # <- { "return": {} }
4696 { 'command': 'blockdev-change-medium',
4697   'data': { '*device': 'str',
4698             '*id': 'str',
4699             'filename': 'str',
4700             '*format': 'str',
4701             '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
4705 # @BlockErrorAction:
4707 # An enumeration of action that has been taken when a DISK I/O occurs
4709 # @ignore: error has been ignored
4711 # @report: error has been reported to the device
4713 # @stop: error caused VM to be stopped
4715 # Since: 2.1
4717 { 'enum': 'BlockErrorAction',
4718   'data': [ 'ignore', 'report', 'stop' ] }
4722 # @BLOCK_IMAGE_CORRUPTED:
4724 # Emitted when a disk image is being marked corrupt. The image can be
4725 # identified by its device or node name. The 'device' field is always
4726 # present for compatibility reasons, but it can be empty ("") if the
4727 # image does not have a device name associated.
4729 # @device: device name. This is always present for compatibility
4730 #          reasons, but it can be empty ("") if the image does not
4731 #          have a device name associated.
4733 # @node-name: node name (Since: 2.4)
4735 # @msg: informative message for human consumption, such as the kind of
4736 #       corruption being detected. It should not be parsed by machine as it is
4737 #       not guaranteed to be stable
4739 # @offset: if the corruption resulted from an image access, this is
4740 #          the host's access offset into the image
4742 # @size: if the corruption resulted from an image access, this is
4743 #        the access size
4745 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4746 #        event and must be repaired (Since 2.2; before, every
4747 #        BLOCK_IMAGE_CORRUPTED event was fatal)
4749 # Note: If action is "stop", a STOP event will eventually follow the
4750 #       BLOCK_IO_ERROR event.
4752 # Example:
4754 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4755 #      "data": { "device": "ide0-hd0", "node-name": "node0",
4756 #                "msg": "Prevented active L1 table overwrite", "offset": 196608,
4757 #                "size": 65536 },
4758 #      "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4760 # Since: 1.7
4762 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4763   'data': { 'device'     : 'str',
4764             '*node-name' : 'str',
4765             'msg'        : 'str',
4766             '*offset'    : 'int',
4767             '*size'      : 'int',
4768             'fatal'      : 'bool' } }
4771 # @BLOCK_IO_ERROR:
4773 # Emitted when a disk I/O error occurs
4775 # @device: device name. This is always present for compatibility
4776 #          reasons, but it can be empty ("") if the image does not
4777 #          have a device name associated.
4779 # @node-name: node name. Note that errors may be reported for the root node
4780 #             that is directly attached to a guest device rather than for the
4781 #             node where the error occurred. The node name is not present if
4782 #             the drive is empty. (Since: 2.8)
4784 # @operation: I/O operation
4786 # @action: action that has been taken
4788 # @nospace: true if I/O error was caused due to a no-space
4789 #           condition. This key is only present if query-block's
4790 #           io-status is present, please see query-block documentation
4791 #           for more information (since: 2.2)
4793 # @reason: human readable string describing the error cause.
4794 #          (This field is a debugging aid for humans, it should not
4795 #           be parsed by applications) (since: 2.2)
4797 # Note: If action is "stop", a STOP event will eventually follow the
4798 # BLOCK_IO_ERROR event
4800 # Since: 0.13.0
4802 # Example:
4804 # <- { "event": "BLOCK_IO_ERROR",
4805 #      "data": { "device": "ide0-hd1",
4806 #                "node-name": "#block212",
4807 #                "operation": "write",
4808 #                "action": "stop" },
4809 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4812 { 'event': 'BLOCK_IO_ERROR',
4813   'data': { 'device': 'str', '*node-name': 'str',
4814             'operation': 'IoOperationType',
4815             'action': 'BlockErrorAction', '*nospace': 'bool',
4816             'reason': 'str' } }
4819 # @BLOCK_JOB_COMPLETED:
4821 # Emitted when a block job has completed
4823 # @type: job type
4825 # @device: The job identifier. Originally the device name but other
4826 #          values are allowed since QEMU 2.7
4828 # @len: maximum progress value
4830 # @offset: current progress value. On success this is equal to len.
4831 #          On failure this is less than len
4833 # @speed: rate limit, bytes per second
4835 # @error: error message. Only present on failure. This field
4836 #         contains a human-readable error message. There are no semantics
4837 #         other than that streaming has failed and clients should not try to
4838 #         interpret the error string
4840 # Since: 1.1
4842 # Example:
4844 # <- { "event": "BLOCK_JOB_COMPLETED",
4845 #      "data": { "type": "stream", "device": "virtio-disk0",
4846 #                "len": 10737418240, "offset": 10737418240,
4847 #                "speed": 0 },
4848 #      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4851 { 'event': 'BLOCK_JOB_COMPLETED',
4852   'data': { 'type'  : 'JobType',
4853             'device': 'str',
4854             'len'   : 'int',
4855             'offset': 'int',
4856             'speed' : 'int',
4857             '*error': 'str' } }
4860 # @BLOCK_JOB_CANCELLED:
4862 # Emitted when a block job has been cancelled
4864 # @type: job type
4866 # @device: The job identifier. Originally the device name but other
4867 #          values are allowed since QEMU 2.7
4869 # @len: maximum progress value
4871 # @offset: current progress value. On success this is equal to len.
4872 #          On failure this is less than len
4874 # @speed: rate limit, bytes per second
4876 # Since: 1.1
4878 # Example:
4880 # <- { "event": "BLOCK_JOB_CANCELLED",
4881 #      "data": { "type": "stream", "device": "virtio-disk0",
4882 #                "len": 10737418240, "offset": 134217728,
4883 #                "speed": 0 },
4884 #      "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4887 { 'event': 'BLOCK_JOB_CANCELLED',
4888   'data': { 'type'  : 'JobType',
4889             'device': 'str',
4890             'len'   : 'int',
4891             'offset': 'int',
4892             'speed' : 'int' } }
4895 # @BLOCK_JOB_ERROR:
4897 # Emitted when a block job encounters an error
4899 # @device: The job identifier. Originally the device name but other
4900 #          values are allowed since QEMU 2.7
4902 # @operation: I/O operation
4904 # @action: action that has been taken
4906 # Since: 1.3
4908 # Example:
4910 # <- { "event": "BLOCK_JOB_ERROR",
4911 #      "data": { "device": "ide0-hd1",
4912 #                "operation": "write",
4913 #                "action": "stop" },
4914 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4917 { 'event': 'BLOCK_JOB_ERROR',
4918   'data': { 'device'   : 'str',
4919             'operation': 'IoOperationType',
4920             'action'   : 'BlockErrorAction' } }
4923 # @BLOCK_JOB_READY:
4925 # Emitted when a block job is ready to complete
4927 # @type: job type
4929 # @device: The job identifier. Originally the device name but other
4930 #          values are allowed since QEMU 2.7
4932 # @len: maximum progress value
4934 # @offset: current progress value. On success this is equal to len.
4935 #          On failure this is less than len
4937 # @speed: rate limit, bytes per second
4939 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
4940 # event
4942 # Since: 1.3
4944 # Example:
4946 # <- { "event": "BLOCK_JOB_READY",
4947 #      "data": { "device": "drive0", "type": "mirror", "speed": 0,
4948 #                "len": 2097152, "offset": 2097152 }
4949 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4952 { 'event': 'BLOCK_JOB_READY',
4953   'data': { 'type'  : 'JobType',
4954             'device': 'str',
4955             'len'   : 'int',
4956             'offset': 'int',
4957             'speed' : 'int' } }
4960 # @BLOCK_JOB_PENDING:
4962 # Emitted when a block job is awaiting explicit authorization to finalize graph
4963 # changes via @block-job-finalize. If this job is part of a transaction, it will
4964 # not emit this event until the transaction has converged first.
4966 # @type: job type
4968 # @id: The job identifier.
4970 # Since: 2.12
4972 # Example:
4974 # <- { "event": "BLOCK_JOB_WAITING",
4975 #      "data": { "device": "drive0", "type": "mirror" },
4976 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4979 { 'event': 'BLOCK_JOB_PENDING',
4980   'data': { 'type'  : 'JobType',
4981             'id'    : 'str' } }
4984 # @PreallocMode:
4986 # Preallocation mode of QEMU image file
4988 # @off: no preallocation
4989 # @metadata: preallocate only for metadata
4990 # @falloc: like @full preallocation but allocate disk space by
4991 #          posix_fallocate() rather than writing zeros.
4992 # @full: preallocate all data by writing zeros to device to ensure disk
4993 #        space is really available. @full preallocation also sets up
4994 #        metadata correctly.
4996 # Since: 2.2
4998 { 'enum': 'PreallocMode',
4999   'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5002 # @BLOCK_WRITE_THRESHOLD:
5004 # Emitted when writes on block device reaches or exceeds the
5005 # configured write threshold. For thin-provisioned devices, this
5006 # means the device should be extended to avoid pausing for
5007 # disk exhaustion.
5008 # The event is one shot. Once triggered, it needs to be
5009 # re-registered with another block-set-write-threshold command.
5011 # @node-name: graph node name on which the threshold was exceeded.
5013 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5015 # @write-threshold: last configured threshold, in bytes.
5017 # Since: 2.3
5019 { 'event': 'BLOCK_WRITE_THRESHOLD',
5020   'data': { 'node-name': 'str',
5021             'amount-exceeded': 'uint64',
5022             'write-threshold': 'uint64' } }
5025 # @block-set-write-threshold:
5027 # Change the write threshold for a block drive. An event will be
5028 # delivered if a write to this block drive crosses the configured
5029 # threshold.  The threshold is an offset, thus must be
5030 # non-negative. Default is no write threshold. Setting the threshold
5031 # to zero disables it.
5033 # This is useful to transparently resize thin-provisioned drives without
5034 # the guest OS noticing.
5036 # @node-name: graph node name on which the threshold must be set.
5038 # @write-threshold: configured threshold for the block device, bytes.
5039 #                   Use 0 to disable the threshold.
5041 # Since: 2.3
5043 # Example:
5045 # -> { "execute": "block-set-write-threshold",
5046 #      "arguments": { "node-name": "mydev",
5047 #                     "write-threshold": 17179869184 } }
5048 # <- { "return": {} }
5051 { 'command': 'block-set-write-threshold',
5052   'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
5055 # @x-blockdev-change:
5057 # Dynamically reconfigure the block driver state graph. It can be used
5058 # to add, remove, insert or replace a graph node. Currently only the
5059 # Quorum driver implements this feature to add or remove its child. This
5060 # is useful to fix a broken quorum child.
5062 # If @node is specified, it will be inserted under @parent. @child
5063 # may not be specified in this case. If both @parent and @child are
5064 # specified but @node is not, @child will be detached from @parent.
5066 # @parent: the id or name of the parent node.
5068 # @child: the name of a child under the given parent node.
5070 # @node: the name of the node that will be added.
5072 # Note: this command is experimental, and its API is not stable. It
5073 # does not support all kinds of operations, all kinds of children, nor
5074 # all block drivers.
5076 # FIXME Removing children from a quorum node means introducing gaps in the
5077 # child indices. This cannot be represented in the 'children' list of
5078 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
5080 # Warning: The data in a new quorum child MUST be consistent with that of
5081 # the rest of the array.
5083 # Since: 2.7
5085 # Example:
5087 # 1. Add a new node to a quorum
5088 # -> { "execute": "blockdev-add",
5089 #      "arguments": {
5090 #          "driver": "raw",
5091 #          "node-name": "new_node",
5092 #          "file": { "driver": "file",
5093 #                    "filename": "test.raw" } } }
5094 # <- { "return": {} }
5095 # -> { "execute": "x-blockdev-change",
5096 #      "arguments": { "parent": "disk1",
5097 #                     "node": "new_node" } }
5098 # <- { "return": {} }
5100 # 2. Delete a quorum's node
5101 # -> { "execute": "x-blockdev-change",
5102 #      "arguments": { "parent": "disk1",
5103 #                     "child": "children.1" } }
5104 # <- { "return": {} }
5107 { 'command': 'x-blockdev-change',
5108   'data' : { 'parent': 'str',
5109              '*child': 'str',
5110              '*node': 'str' } }
5113 # @x-blockdev-set-iothread:
5115 # Move @node and its children into the @iothread.  If @iothread is null then
5116 # move @node and its children into the main loop.
5118 # The node must not be attached to a BlockBackend.
5120 # @node-name: the name of the block driver node
5122 # @iothread: the name of the IOThread object or null for the main loop
5124 # @force: true if the node and its children should be moved when a BlockBackend
5125 #         is already attached
5127 # Note: this command is experimental and intended for test cases that need
5128 # control over IOThreads only.
5130 # Since: 2.12
5132 # Example:
5134 # 1. Move a node into an IOThread
5135 # -> { "execute": "x-blockdev-set-iothread",
5136 #      "arguments": { "node-name": "disk1",
5137 #                     "iothread": "iothread0" } }
5138 # <- { "return": {} }
5140 # 2. Move a node into the main loop
5141 # -> { "execute": "x-blockdev-set-iothread",
5142 #      "arguments": { "node-name": "disk1",
5143 #                     "iothread": null } }
5144 # <- { "return": {} }
5147 { 'command': 'x-blockdev-set-iothread',
5148   'data' : { 'node-name': 'str',
5149              'iothread': 'StrOrNull',
5150              '*force': 'bool' } }