5 # == Block core (VM unrelated)
8 { 'include': 'common.json' }
9 { 'include': 'crypto.json' }
10 { 'include': 'job.json' }
11 { 'include': 'sockets.json' }
16 # @id: unique snapshot id
18 # @name: user chosen name
20 # @vm-state-size: size of the VM state
22 # @date-sec: UTC date of the snapshot in seconds
24 # @date-nsec: fractional part in nano seconds to be used with date-sec
26 # @vm-clock-sec: VM clock relative to boot in seconds
28 # @vm-clock-nsec: fractional part in nano seconds to be used with
31 # @icount: Current instruction count. Appears when execution
32 # record/replay is enabled. Used for "time-traveling" to match
33 # the moment in the recorded execution with the snapshots. This
34 # counter may be obtained through @query-replay command (since
39 { 'struct': 'SnapshotInfo',
40 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
41 'date-sec': 'int', 'date-nsec': 'int',
42 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int',
46 # @ImageInfoSpecificQCow2EncryptionBase:
48 # @format: The encryption format
52 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
53 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
56 # @ImageInfoSpecificQCow2Encryption:
60 { 'union': 'ImageInfoSpecificQCow2Encryption',
61 'base': 'ImageInfoSpecificQCow2EncryptionBase',
62 'discriminator': 'format',
63 'data': { 'luks': 'QCryptoBlockInfoLUKS' } }
66 # @ImageInfoSpecificQCow2:
68 # @compat: compatibility level
70 # @data-file: the filename of the external data file that is stored in
71 # the image and used as a default for opening the image
74 # @data-file-raw: True if the external data file must stay valid as a
75 # standalone (read-only) raw image without looking at qcow2
76 # metadata (since: 4.0)
78 # @extended-l2: true if the image has extended L2 entries; only valid
79 # for compat >= 1.1 (since 5.2)
81 # @lazy-refcounts: on or off; only valid for compat >= 1.1
83 # @corrupt: true if the image has been marked corrupt; only valid for
84 # compat >= 1.1 (since 2.2)
86 # @refcount-bits: width of a refcount entry in bits (since 2.3)
88 # @encrypt: details about encryption parameters; only set if image is
89 # encrypted (since 2.10)
91 # @bitmaps: A list of qcow2 bitmap details (since 4.0)
93 # @compression-type: the image cluster compression method (since 5.1)
97 { 'struct': 'ImageInfoSpecificQCow2',
101 '*data-file-raw': 'bool',
102 '*extended-l2': 'bool',
103 '*lazy-refcounts': 'bool',
105 'refcount-bits': 'int',
106 '*encrypt': 'ImageInfoSpecificQCow2Encryption',
107 '*bitmaps': ['Qcow2BitmapInfo'],
108 'compression-type': 'Qcow2CompressionType'
112 # @ImageInfoSpecificVmdk:
114 # @create-type: The create type of VMDK image
116 # @cid: Content id of image
118 # @parent-cid: Parent VMDK image's cid
120 # @extents: List of extent files
124 { 'struct': 'ImageInfoSpecificVmdk',
126 'create-type': 'str',
129 'extents': ['VmdkExtentInfo']
135 # Information about a VMDK extent file
137 # @filename: Name of the extent file
139 # @format: Extent type (e.g. FLAT or SPARSE)
141 # @virtual-size: Number of bytes covered by this extent
143 # @cluster-size: Cluster size in bytes (for non-flat extents)
145 # @compressed: Whether this extent contains compressed data
149 { 'struct': 'VmdkExtentInfo',
153 'virtual-size': 'int',
154 '*cluster-size': 'int',
155 '*compressed': 'bool'
159 # @ImageInfoSpecificRbd:
161 # @encryption-format: Image encryption format
165 { 'struct': 'ImageInfoSpecificRbd',
167 '*encryption-format': 'RbdImageEncryptionFormat'
171 # @ImageInfoSpecificFile:
173 # @extent-size-hint: Extent size hint (if available)
177 { 'struct': 'ImageInfoSpecificFile',
179 '*extent-size-hint': 'size'
183 # @ImageInfoSpecificKind:
193 { 'enum': 'ImageInfoSpecificKind',
194 'data': [ 'qcow2', 'vmdk', 'luks', 'rbd', 'file' ] }
197 # @ImageInfoSpecificQCow2Wrapper:
201 { 'struct': 'ImageInfoSpecificQCow2Wrapper',
202 'data': { 'data': 'ImageInfoSpecificQCow2' } }
205 # @ImageInfoSpecificVmdkWrapper:
209 { 'struct': 'ImageInfoSpecificVmdkWrapper',
210 'data': { 'data': 'ImageInfoSpecificVmdk' } }
213 # @ImageInfoSpecificLUKSWrapper:
217 { 'struct': 'ImageInfoSpecificLUKSWrapper',
218 'data': { 'data': 'QCryptoBlockInfoLUKS' } }
219 # If we need to add block driver specific parameters for
220 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
221 # to define a ImageInfoSpecificLUKS
224 # @ImageInfoSpecificRbdWrapper:
228 { 'struct': 'ImageInfoSpecificRbdWrapper',
229 'data': { 'data': 'ImageInfoSpecificRbd' } }
232 # @ImageInfoSpecificFileWrapper:
236 { 'struct': 'ImageInfoSpecificFileWrapper',
237 'data': { 'data': 'ImageInfoSpecificFile' } }
240 # @ImageInfoSpecific:
242 # A discriminated record of image format specific information
247 { 'union': 'ImageInfoSpecific',
248 'base': { 'type': 'ImageInfoSpecificKind' },
249 'discriminator': 'type',
251 'qcow2': 'ImageInfoSpecificQCow2Wrapper',
252 'vmdk': 'ImageInfoSpecificVmdkWrapper',
253 'luks': 'ImageInfoSpecificLUKSWrapper',
254 'rbd': 'ImageInfoSpecificRbdWrapper',
255 'file': 'ImageInfoSpecificFileWrapper'
261 # Information about a QEMU image file
263 # @filename: name of the image file
265 # @format: format of the image file
267 # @virtual-size: maximum capacity in bytes of the image
269 # @actual-size: actual size on disk in bytes of the image
271 # @dirty-flag: true if image is not cleanly closed
273 # @cluster-size: size of a cluster in bytes
275 # @encrypted: true if the image is encrypted
277 # @compressed: true if the image is compressed (Since 1.7)
279 # @backing-filename: name of the backing file
281 # @full-backing-filename: full path of the backing file
283 # @backing-filename-format: the format of the backing file
285 # @snapshots: list of VM snapshots
287 # @format-specific: structure supplying additional format-specific
288 # information (since 1.7)
292 { 'struct': 'BlockNodeInfo',
293 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
294 '*actual-size': 'int', 'virtual-size': 'int',
295 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
296 '*backing-filename': 'str', '*full-backing-filename': 'str',
297 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
298 '*format-specific': 'ImageInfoSpecific' } }
303 # Information about a QEMU image file, and potentially its backing
306 # @backing-image: info of the backing image
310 { 'struct': 'ImageInfo',
311 'base': 'BlockNodeInfo',
313 '*backing-image': 'ImageInfo'
319 # Information about all nodes in the block graph starting at some
320 # node, annotated with information about that node in relation to its
323 # @name: Child name of the root node in the BlockGraphInfo struct, in
324 # its role as the child of some undescribed parent node
326 # @info: Block graph information starting at this node
330 { 'struct': 'BlockChildInfo',
333 'info': 'BlockGraphInfo'
339 # Information about all nodes in a block (sub)graph in the form of
340 # BlockNodeInfo data. The base BlockNodeInfo struct contains the
341 # information for the (sub)graph's root node.
343 # @children: Array of links to this node's child nodes' information
347 { 'struct': 'BlockGraphInfo',
348 'base': 'BlockNodeInfo',
349 'data': { 'children': ['BlockChildInfo'] } }
354 # Information about a QEMU image file check
356 # @filename: name of the image file checked
358 # @format: format of the image file checked
360 # @check-errors: number of unexpected errors occurred during check
362 # @image-end-offset: offset (in bytes) where the image ends, this
363 # field is present if the driver for the image format supports it
365 # @corruptions: number of corruptions found during the check if any
367 # @leaks: number of leaks found during the check if any
369 # @corruptions-fixed: number of corruptions fixed during the check if
372 # @leaks-fixed: number of leaks fixed during the check if any
374 # @total-clusters: total number of clusters, this field is present if
375 # the driver for the image format supports it
377 # @allocated-clusters: total number of allocated clusters, this field
378 # is present if the driver for the image format supports it
380 # @fragmented-clusters: total number of fragmented clusters, this
381 # field is present if the driver for the image format supports it
383 # @compressed-clusters: total number of compressed clusters, this
384 # field is present if the driver for the image format supports it
388 { 'struct': 'ImageCheck',
389 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
390 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
391 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
392 '*total-clusters': 'int', '*allocated-clusters': 'int',
393 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
398 # Mapping information from a virtual block range to a host file range
400 # @start: virtual (guest) offset of the first byte described by this
403 # @length: the number of bytes of the mapped virtual range
405 # @data: reading the image will actually read data from a file (in
406 # particular, if @offset is present this means that the sectors
407 # are not simply preallocated, but contain actual data in raw
410 # @zero: whether the virtual blocks read as zeroes
412 # @compressed: true if the data is stored compressed (since 8.2)
414 # @depth: number of layers (0 = top image, 1 = top image's backing
415 # file, ..., n - 1 = bottom image (where n is the number of images
416 # in the chain)) before reaching one for which the range is
419 # @present: true if this layer provides the data, false if adding a
420 # backing layer could impact this region (since 6.1)
422 # @offset: if present, the image file stores the data for this range
423 # in raw format at the given (host) offset
425 # @filename: filename that is referred to by @offset
429 { 'struct': 'MapEntry',
430 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
431 'zero': 'bool', 'compressed': 'bool', 'depth': 'int',
432 'present': 'bool', '*offset': 'int', '*filename': 'str' } }
435 # @BlockdevCacheInfo:
437 # Cache mode information for a block device
439 # @writeback: true if writeback mode is enabled
441 # @direct: true if the host page cache is bypassed (O_DIRECT)
443 # @no-flush: true if flush requests are ignored for the device
447 { 'struct': 'BlockdevCacheInfo',
448 'data': { 'writeback': 'bool',
450 'no-flush': 'bool' } }
455 # Information about the backing device for a block device.
457 # @file: the filename of the backing device
459 # @node-name: the name of the block driver node (Since 2.0)
461 # @ro: true if the backing device was open read-only
463 # @drv: the name of the block format used to open the backing device.
464 # As of 0.14 this can be: 'blkdebug', 'bochs', 'cloop', 'cow',
465 # 'dmg', 'file', 'file', 'ftp', 'ftps', 'host_cdrom',
466 # 'host_device', 'http', 'https', 'luks', 'nbd', 'parallels',
467 # 'qcow', 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat' 2.2:
468 # 'archipelago' added, 'cow' dropped 2.3: 'host_floppy' deprecated
469 # 2.5: 'host_floppy' dropped 2.6: 'luks' added 2.8: 'replication'
470 # added, 'tftp' dropped 2.9: 'archipelago' dropped
472 # @backing_file: the name of the backing file (for copy-on-write)
474 # @backing_file_depth: number of files in the backing file chain
477 # @encrypted: true if the backing device is encrypted
479 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
481 # @bps: total throughput limit in bytes per second is specified
483 # @bps_rd: read throughput limit in bytes per second is specified
485 # @bps_wr: write throughput limit in bytes per second is specified
487 # @iops: total I/O operations per second is specified
489 # @iops_rd: read I/O operations per second is specified
491 # @iops_wr: write I/O operations per second is specified
493 # @image: the info of image used (since: 1.6)
495 # @bps_max: total throughput limit during bursts, in bytes (Since 1.7)
497 # @bps_rd_max: read throughput limit during bursts, in bytes (Since
500 # @bps_wr_max: write throughput limit during bursts, in bytes (Since
503 # @iops_max: total I/O operations per second during bursts, in bytes
506 # @iops_rd_max: read I/O operations per second during bursts, in bytes
509 # @iops_wr_max: write I/O operations per second during bursts, in
512 # @bps_max_length: maximum length of the @bps_max burst period, in
513 # seconds. (Since 2.6)
515 # @bps_rd_max_length: maximum length of the @bps_rd_max burst period,
516 # in seconds. (Since 2.6)
518 # @bps_wr_max_length: maximum length of the @bps_wr_max burst period,
519 # in seconds. (Since 2.6)
521 # @iops_max_length: maximum length of the @iops burst period, in
522 # seconds. (Since 2.6)
524 # @iops_rd_max_length: maximum length of the @iops_rd_max burst
525 # period, in seconds. (Since 2.6)
527 # @iops_wr_max_length: maximum length of the @iops_wr_max burst
528 # period, in seconds. (Since 2.6)
530 # @iops_size: an I/O size in bytes (Since 1.7)
532 # @group: throttle group name (Since 2.4)
534 # @cache: the cache mode used for the block device (since: 2.3)
536 # @write_threshold: configured write threshold for the device. 0 if
537 # disabled. (Since 2.3)
539 # @dirty-bitmaps: dirty bitmaps information (only present if node has
540 # one or more dirty bitmaps) (Since 4.2)
544 { 'struct': 'BlockDeviceInfo',
545 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
546 '*backing_file': 'str', 'backing_file_depth': 'int',
548 'detect_zeroes': 'BlockdevDetectZeroesOptions',
549 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
550 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
551 'image': 'ImageInfo',
552 '*bps_max': 'int', '*bps_rd_max': 'int',
553 '*bps_wr_max': 'int', '*iops_max': 'int',
554 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
555 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
556 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
557 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
558 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
559 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
562 # @BlockDeviceIoStatus:
564 # An enumeration of block device I/O status.
566 # @ok: The last I/O operation has succeeded
568 # @failed: The last I/O operation has failed
570 # @nospace: The last I/O operation has failed due to a no-space
575 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
580 # Block dirty bitmap information.
582 # @name: the name of the dirty bitmap (Since 2.4)
584 # @count: number of dirty bytes according to the dirty bitmap
586 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
588 # @recording: true if the bitmap is recording new writes from the
591 # @busy: true if the bitmap is in-use by some operation (NBD or jobs)
592 # and cannot be modified via QMP or used by another operation.
595 # @persistent: true if the bitmap was stored on disk, is scheduled to
596 # be stored on disk, or both. (since 4.0)
598 # @inconsistent: true if this is a persistent bitmap that was
599 # improperly stored. Implies @persistent to be true; @recording
600 # and @busy to be false. This bitmap cannot be used. To remove
601 # it, use @block-dirty-bitmap-remove. (Since 4.0)
605 { 'struct': 'BlockDirtyInfo',
606 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
607 'recording': 'bool', 'busy': 'bool',
608 'persistent': 'bool', '*inconsistent': 'bool' } }
611 # @Qcow2BitmapInfoFlags:
613 # An enumeration of flags that a bitmap can report to the user.
615 # @in-use: This flag is set by any process actively modifying the
616 # qcow2 file, and cleared when the updated bitmap is flushed to
617 # the qcow2 image. The presence of this flag in an offline image
618 # means that the bitmap was not saved correctly after its last
619 # usage, and may contain inconsistent data.
621 # @auto: The bitmap must reflect all changes of the virtual disk by
622 # any application that would write to this qcow2 file.
626 { 'enum': 'Qcow2BitmapInfoFlags',
627 'data': ['in-use', 'auto'] }
632 # Qcow2 bitmap information.
634 # @name: the name of the bitmap
636 # @granularity: granularity of the bitmap in bytes
638 # @flags: flags of the bitmap
642 { 'struct': 'Qcow2BitmapInfo',
643 'data': {'name': 'str', 'granularity': 'uint32',
644 'flags': ['Qcow2BitmapInfoFlags'] } }
647 # @BlockLatencyHistogramInfo:
649 # Block latency histogram.
651 # @boundaries: list of interval boundary values in nanoseconds, all
652 # greater than zero and in ascending order. For example, the list
653 # [10, 50, 100] produces the following histogram intervals: [0,
654 # 10), [10, 50), [50, 100), [100, +inf).
656 # @bins: list of io request counts corresponding to histogram
657 # intervals, one more element than @boundaries has. For the
658 # example above, @bins may be something like [3, 1, 5, 2], and
659 # corresponding histogram looks like:
668 # +------------------
673 { 'struct': 'BlockLatencyHistogramInfo',
674 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
679 # Block device information. This structure describes a virtual device
680 # and the backing device associated with it.
682 # @device: The device name associated with the virtual device.
684 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the
685 # block device. (since 2.10)
687 # @type: This field is returned only for compatibility reasons, it
688 # should not be used (always returns 'unknown')
690 # @removable: True if the device supports removable media.
692 # @locked: True if the guest has locked this device from having its
695 # @tray_open: True if the device's tray is open (only present if it
698 # @io-status: @BlockDeviceIoStatus. Only present if the device
699 # supports it and the VM is configured to stop on errors
700 # (supported device models: virtio-blk, IDE, SCSI except
703 # @inserted: @BlockDeviceInfo describing the device if media is
708 { 'struct': 'BlockInfo',
709 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
710 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
711 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus' } }
716 # Image file size calculation information. This structure describes
717 # the size requirements for creating a new image file.
719 # The size requirements depend on the new image file format. File
720 # size always equals virtual disk size for the 'raw' format, even for
721 # sparse POSIX files. Compact formats such as 'qcow2' represent
722 # unallocated and zero regions efficiently so file size may be smaller
723 # than virtual disk size.
725 # The values are upper bounds that are guaranteed to fit the new image
726 # file. Subsequent modification, such as internal snapshot or further
727 # bitmap creation, may require additional space and is not covered
730 # @required: Size required for a new image file, in bytes, when
731 # copying just allocated guest-visible contents.
733 # @fully-allocated: Image file size, in bytes, once data has been
734 # written to all sectors, when copying just guest-visible
737 # @bitmaps: Additional size required if all the top-level bitmap
738 # metadata in the source image were to be copied to the
739 # destination, present only when source and destination both
740 # support persistent bitmaps. (since 5.1)
744 { 'struct': 'BlockMeasureInfo',
745 'data': {'required': 'int', 'fully-allocated': 'int', '*bitmaps': 'int'} }
750 # Get a list of BlockInfo for all virtual block devices.
752 # Returns: a list of @BlockInfo describing each virtual block device.
753 # Filter nodes that were created implicitly are skipped over.
759 # -> { "execute": "query-block" }
764 # "device":"ide0-hd0",
771 # "file":"disks/test.qcow2",
772 # "backing_file_depth":1,
779 # "bps_max": 8000000,
786 # "detect_zeroes": "on",
787 # "write_threshold": 0,
789 # "filename":"disks/test.qcow2",
791 # "virtual-size":2048000,
792 # "backing_file":"base.qcow2",
793 # "full-backing-filename":"disks/base.qcow2",
794 # "backing-filename-format":"qcow2",
798 # "name": "snapshot1",
799 # "vm-state-size": 0,
800 # "date-sec": 10000200,
802 # "vm-clock-sec": 206,
803 # "vm-clock-nsec": 30
807 # "filename":"disks/base.qcow2",
809 # "virtual-size":2048000
813 # "qdev": "ide_disk",
818 # "device":"ide1-cd0",
821 # "qdev": "/machine/unattached/device[23]",
822 # "tray_open": false,
826 # "device":"floppy0",
829 # "qdev": "/machine/unattached/device[20]",
841 { 'command': 'query-block', 'returns': ['BlockInfo'],
842 'allow-preconfig': true }
845 # @BlockDeviceTimedStats:
847 # Statistics of a block device during a given interval of time.
849 # @interval_length: Interval used for calculating the statistics, in
852 # @min_rd_latency_ns: Minimum latency of read operations in the
853 # defined interval, in nanoseconds.
855 # @min_wr_latency_ns: Minimum latency of write operations in the
856 # defined interval, in nanoseconds.
858 # @min_zone_append_latency_ns: Minimum latency of zone append
859 # operations in the defined interval, in nanoseconds (since 8.1)
861 # @min_flush_latency_ns: Minimum latency of flush operations in the
862 # defined interval, in nanoseconds.
864 # @max_rd_latency_ns: Maximum latency of read operations in the
865 # defined interval, in nanoseconds.
867 # @max_wr_latency_ns: Maximum latency of write operations in the
868 # defined interval, in nanoseconds.
870 # @max_zone_append_latency_ns: Maximum latency of zone append
871 # operations in the defined interval, in nanoseconds (since 8.1)
873 # @max_flush_latency_ns: Maximum latency of flush operations in the
874 # defined interval, in nanoseconds.
876 # @avg_rd_latency_ns: Average latency of read operations in the
877 # defined interval, in nanoseconds.
879 # @avg_wr_latency_ns: Average latency of write operations in the
880 # defined interval, in nanoseconds.
882 # @avg_zone_append_latency_ns: Average latency of zone append
883 # operations in the defined interval, in nanoseconds (since 8.1)
885 # @avg_flush_latency_ns: Average latency of flush operations in the
886 # defined interval, in nanoseconds.
888 # @avg_rd_queue_depth: Average number of pending read operations in
889 # the defined interval.
891 # @avg_wr_queue_depth: Average number of pending write operations in
892 # the defined interval.
894 # @avg_zone_append_queue_depth: Average number of pending zone append
895 # operations in the defined interval (since 8.1).
899 { 'struct': 'BlockDeviceTimedStats',
900 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
901 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
902 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
903 'avg_wr_latency_ns': 'int', 'min_zone_append_latency_ns': 'int',
904 'max_zone_append_latency_ns': 'int',
905 'avg_zone_append_latency_ns': 'int',
906 'min_flush_latency_ns': 'int', 'max_flush_latency_ns': 'int',
907 'avg_flush_latency_ns': 'int', 'avg_rd_queue_depth': 'number',
908 'avg_wr_queue_depth': 'number',
909 'avg_zone_append_queue_depth': 'number' } }
914 # Statistics of a virtual block device or a block backing device.
916 # @rd_bytes: The number of bytes read by the device.
918 # @wr_bytes: The number of bytes written by the device.
920 # @zone_append_bytes: The number of bytes appended by the zoned
921 # devices (since 8.1)
923 # @unmap_bytes: The number of bytes unmapped by the device (Since 4.2)
925 # @rd_operations: The number of read operations performed by the
928 # @wr_operations: The number of write operations performed by the
931 # @zone_append_operations: The number of zone append operations
932 # performed by the zoned devices (since 8.1)
934 # @flush_operations: The number of cache flush operations performed by
935 # the device (since 0.15)
937 # @unmap_operations: The number of unmap operations performed by the
940 # @rd_total_time_ns: Total time spent on reads in nanoseconds (since
943 # @wr_total_time_ns: Total time spent on writes in nanoseconds (since
946 # @zone_append_total_time_ns: Total time spent on zone append writes
947 # in nanoseconds (since 8.1)
949 # @flush_total_time_ns: Total time spent on cache flushes in
950 # nanoseconds (since 0.15).
952 # @unmap_total_time_ns: Total time spent on unmap operations in
953 # nanoseconds (Since 4.2)
955 # @wr_highest_offset: The offset after the greatest byte written to
956 # the device. The intended use of this information is for
957 # growable sparse files (like qcow2) that are used on top of a
960 # @rd_merged: Number of read requests that have been merged into
961 # another request (Since 2.3).
963 # @wr_merged: Number of write requests that have been merged into
964 # another request (Since 2.3).
966 # @zone_append_merged: Number of zone append requests that have been
967 # merged into another request (since 8.1)
969 # @unmap_merged: Number of unmap requests that have been merged into
970 # another request (Since 4.2)
972 # @idle_time_ns: Time since the last I/O operation, in nanoseconds.
973 # If the field is absent it means that there haven't been any
974 # operations yet (Since 2.5).
976 # @failed_rd_operations: The number of failed read operations
977 # performed by the device (Since 2.5)
979 # @failed_wr_operations: The number of failed write operations
980 # performed by the device (Since 2.5)
982 # @failed_zone_append_operations: The number of failed zone append
983 # write operations performed by the zoned devices (since 8.1)
985 # @failed_flush_operations: The number of failed flush operations
986 # performed by the device (Since 2.5)
988 # @failed_unmap_operations: The number of failed unmap operations
989 # performed by the device (Since 4.2)
991 # @invalid_rd_operations: The number of invalid read operations
992 # performed by the device (Since 2.5)
994 # @invalid_wr_operations: The number of invalid write operations
995 # performed by the device (Since 2.5)
997 # @invalid_zone_append_operations: The number of invalid zone append
998 # operations performed by the zoned device (since 8.1)
1000 # @invalid_flush_operations: The number of invalid flush operations
1001 # performed by the device (Since 2.5)
1003 # @invalid_unmap_operations: The number of invalid unmap operations
1004 # performed by the device (Since 4.2)
1006 # @account_invalid: Whether invalid operations are included in the
1007 # last access statistics (Since 2.5)
1009 # @account_failed: Whether failed operations are included in the
1010 # latency and last access statistics (Since 2.5)
1012 # @timed_stats: Statistics specific to the set of previously defined
1013 # intervals of time (Since 2.5)
1015 # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
1017 # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
1019 # @zone_append_latency_histogram: @BlockLatencyHistogramInfo.
1022 # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
1026 { 'struct': 'BlockDeviceStats',
1027 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'zone_append_bytes': 'int',
1028 'unmap_bytes' : 'int', 'rd_operations': 'int',
1029 'wr_operations': 'int', 'zone_append_operations': 'int',
1030 'flush_operations': 'int', 'unmap_operations': 'int',
1031 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int',
1032 'zone_append_total_time_ns': 'int', 'flush_total_time_ns': 'int',
1033 'unmap_total_time_ns': 'int', 'wr_highest_offset': 'int',
1034 'rd_merged': 'int', 'wr_merged': 'int', 'zone_append_merged': 'int',
1035 'unmap_merged': 'int', '*idle_time_ns': 'int',
1036 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
1037 'failed_zone_append_operations': 'int',
1038 'failed_flush_operations': 'int',
1039 'failed_unmap_operations': 'int', 'invalid_rd_operations': 'int',
1040 'invalid_wr_operations': 'int',
1041 'invalid_zone_append_operations': 'int',
1042 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int',
1043 'account_invalid': 'bool', 'account_failed': 'bool',
1044 'timed_stats': ['BlockDeviceTimedStats'],
1045 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
1046 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
1047 '*zone_append_latency_histogram': 'BlockLatencyHistogramInfo',
1048 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
1051 # @BlockStatsSpecificFile:
1053 # File driver statistics
1055 # @discard-nb-ok: The number of successful discard operations
1056 # performed by the driver.
1058 # @discard-nb-failed: The number of failed discard operations
1059 # performed by the driver.
1061 # @discard-bytes-ok: The number of bytes discarded by the driver.
1065 { 'struct': 'BlockStatsSpecificFile',
1067 'discard-nb-ok': 'uint64',
1068 'discard-nb-failed': 'uint64',
1069 'discard-bytes-ok': 'uint64' } }
1072 # @BlockStatsSpecificNvme:
1074 # NVMe driver statistics
1076 # @completion-errors: The number of completion errors.
1078 # @aligned-accesses: The number of aligned accesses performed by the
1081 # @unaligned-accesses: The number of unaligned accesses performed by
1086 { 'struct': 'BlockStatsSpecificNvme',
1088 'completion-errors': 'uint64',
1089 'aligned-accesses': 'uint64',
1090 'unaligned-accesses': 'uint64' } }
1093 # @BlockStatsSpecific:
1095 # Block driver specific statistics
1099 { 'union': 'BlockStatsSpecific',
1100 'base': { 'driver': 'BlockdevDriver' },
1101 'discriminator': 'driver',
1103 'file': 'BlockStatsSpecificFile',
1104 'host_device': { 'type': 'BlockStatsSpecificFile',
1105 'if': 'HAVE_HOST_BLOCK_DEVICE' },
1106 'nvme': 'BlockStatsSpecificNvme' } }
1111 # Statistics of a virtual block device or a block backing device.
1113 # @device: If the stats are for a virtual block device, the name
1114 # corresponding to the virtual block device.
1116 # @node-name: The node name of the device. (Since 2.3)
1118 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the
1119 # block device. (since 3.0)
1121 # @stats: A @BlockDeviceStats for the device.
1123 # @driver-specific: Optional driver-specific stats. (Since 4.2)
1125 # @parent: This describes the file block device if it has one.
1126 # Contains recursively the statistics of the underlying protocol
1127 # (e.g. the host file for a qcow2 image). If there is no
1128 # underlying protocol, this field is omitted
1130 # @backing: This describes the backing block device if it has one.
1135 { 'struct': 'BlockStats',
1136 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
1137 'stats': 'BlockDeviceStats',
1138 '*driver-specific': 'BlockStatsSpecific',
1139 '*parent': 'BlockStats',
1140 '*backing': 'BlockStats'} }
1143 # @query-blockstats:
1145 # Query the @BlockStats for all virtual block devices.
1147 # @query-nodes: If true, the command will query all the block nodes
1148 # that have a node name, in a list which will include "parent"
1149 # information, but not "backing". If false or omitted, the
1150 # behavior is as before - query all the device backends,
1151 # recursively including their "parent" and "backing". Filter nodes
1152 # that were created implicitly are skipped over in this mode.
1155 # Returns: A list of @BlockStats for each virtual block devices.
1161 # -> { "execute": "query-blockstats" }
1165 # "device":"ide0-hd0",
1168 # "wr_highest_offset":3686448128,
1169 # "wr_bytes":9786368,
1170 # "wr_operations":751,
1171 # "rd_bytes":122567168,
1172 # "rd_operations":36772
1173 # "wr_total_times_ns":313253456
1174 # "rd_total_times_ns":3465673657
1175 # "flush_total_times_ns":49653
1176 # "flush_operations":61,
1179 # "idle_time_ns":2953431879,
1180 # "account_invalid":true,
1181 # "account_failed":false
1185 # "wr_highest_offset":2821110784,
1186 # "wr_bytes":9786368,
1187 # "wr_operations":692,
1188 # "rd_bytes":122739200,
1189 # "rd_operations":36604
1190 # "flush_operations":51,
1191 # "wr_total_times_ns":313253456
1192 # "rd_total_times_ns":3465673657
1193 # "flush_total_times_ns":49653,
1196 # "idle_time_ns":2953431879,
1197 # "account_invalid":true,
1198 # "account_failed":false
1200 # "qdev": "/machine/unattached/device[23]"
1203 # "device":"ide1-cd0",
1205 # "wr_highest_offset":0,
1207 # "wr_operations":0,
1210 # "flush_operations":0,
1211 # "wr_total_times_ns":0
1212 # "rd_total_times_ns":0
1213 # "flush_total_times_ns":0,
1216 # "account_invalid":false,
1217 # "account_failed":false
1219 # "qdev": "/machine/unattached/device[24]"
1222 # "device":"floppy0",
1224 # "wr_highest_offset":0,
1226 # "wr_operations":0,
1229 # "flush_operations":0,
1230 # "wr_total_times_ns":0
1231 # "rd_total_times_ns":0
1232 # "flush_total_times_ns":0,
1235 # "account_invalid":false,
1236 # "account_failed":false
1238 # "qdev": "/machine/unattached/device[16]"
1243 # "wr_highest_offset":0,
1245 # "wr_operations":0,
1248 # "flush_operations":0,
1249 # "wr_total_times_ns":0
1250 # "rd_total_times_ns":0
1251 # "flush_total_times_ns":0,
1254 # "account_invalid":false,
1255 # "account_failed":false
1261 { 'command': 'query-blockstats',
1262 'data': { '*query-nodes': 'bool' },
1263 'returns': ['BlockStats'],
1264 'allow-preconfig': true }
1269 # An enumeration of possible behaviors for errors on I/O operations.
1270 # The exact meaning depends on whether the I/O was initiated by a
1271 # guest or by a block job
1273 # @report: for guest operations, report the error to the guest; for
1274 # jobs, cancel the job
1276 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1277 # or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs
1278 # retry the failing request later and may still complete
1279 # successfully. The stream block job continues to stream and will
1280 # complete with an error.
1282 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1284 # @stop: for guest operations, stop the virtual machine; for jobs,
1287 # @auto: inherit the error handling policy of the backend (since: 2.7)
1291 { 'enum': 'BlockdevOnError',
1292 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1297 # An enumeration of possible behaviors for the initial synchronization
1298 # phase of storage mirroring.
1300 # @top: copies data in the topmost image to the destination
1302 # @full: copies data from all images to the destination
1304 # @none: only copy data written from now on
1306 # @incremental: only copy data described by the dirty bitmap.
1309 # @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
1310 # Behavior on completion is determined by the BitmapSyncMode.
1314 { 'enum': 'MirrorSyncMode',
1315 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1320 # An enumeration of possible behaviors for the synchronization of a
1321 # bitmap when used for data copy operations.
1323 # @on-success: The bitmap is only synced when the operation is
1324 # successful. This is the behavior always used for 'INCREMENTAL'
1327 # @never: The bitmap is never synchronized with the operation, and is
1328 # treated solely as a read-only manifest of blocks to copy.
1330 # @always: The bitmap is always synchronized with the operation,
1331 # regardless of whether or not the operation was successful.
1335 { 'enum': 'BitmapSyncMode',
1336 'data': ['on-success', 'never', 'always'] }
1341 # An enumeration whose values tell the mirror block job when to
1342 # trigger writes to the target.
1344 # @background: copy data in background only.
1346 # @write-blocking: when data is written to the source, write it
1347 # (synchronously) to the target as well. In addition, data is
1348 # copied in background just like in @background mode.
1352 { 'enum': 'MirrorCopyMode',
1353 'data': ['background', 'write-blocking'] }
1356 # @BlockJobInfoMirror:
1358 # Information specific to mirror block jobs.
1360 # @actively-synced: Whether the source is actively synced to the
1361 # target, i.e. same data and new writes are done synchronously to
1366 { 'struct': 'BlockJobInfoMirror',
1367 'data': { 'actively-synced': 'bool' } }
1372 # Information about a long-running block device operation.
1374 # @type: the job type ('stream' for image streaming)
1376 # @device: The job identifier. Originally the device name but other
1377 # values are allowed since QEMU 2.7
1379 # @len: Estimated @offset value at the completion of the job. This
1380 # value can arbitrarily change while the job is running, in both
1383 # @offset: Progress made until now. The unit is arbitrary and the
1384 # value can only meaningfully be used for the ratio of @offset to
1385 # @len. The value is monotonically increasing.
1387 # @busy: false if the job is known to be in a quiescent state, with no
1388 # pending I/O. (Since 1.3)
1390 # @paused: whether the job is paused or, if @busy is true, will pause
1391 # itself as soon as possible. (Since 1.3)
1393 # @speed: the rate limit, bytes per second
1395 # @io-status: the status of the job (since 1.3)
1397 # @ready: true if the job may be completed (since 2.2)
1399 # @status: Current job state/status (since 2.12)
1401 # @auto-finalize: Job will finalize itself when PENDING, moving to the
1402 # CONCLUDED state. (since 2.12)
1404 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the
1405 # NULL state and disappearing from the query list. (since 2.12)
1407 # @error: Error information if the job did not complete successfully.
1408 # Not set if the job completed successfully. (since 2.12.1)
1412 { 'union': 'BlockJobInfo',
1413 'base': {'type': 'JobType', 'device': 'str', 'len': 'int',
1414 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1415 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1416 'status': 'JobStatus',
1417 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1419 'discriminator': 'type',
1420 'data': { 'mirror': 'BlockJobInfoMirror' } }
1423 # @query-block-jobs:
1425 # Return information about long-running block device operations.
1427 # Returns: a list of @BlockJobInfo for each active block job
1431 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'],
1432 'allow-preconfig': true }
1437 # Resize a block image while a guest is running.
1439 # Either @device or @node-name must be set but not both.
1441 # @device: the name of the device to get the image resized
1443 # @node-name: graph node name to get the image resized (Since 2.0)
1445 # @size: new image size in bytes
1448 # - nothing on success
1449 # - If @device is not a valid block device, DeviceNotFound
1455 # -> { "execute": "block_resize",
1456 # "arguments": { "device": "scratch", "size": 1073741824 } }
1457 # <- { "return": {} }
1459 { 'command': 'block_resize',
1460 'data': { '*device': 'str',
1461 '*node-name': 'str',
1464 'allow-preconfig': true }
1469 # An enumeration that tells QEMU how to set the backing file path in a
1472 # @existing: QEMU should look for an existing image file.
1474 # @absolute-paths: QEMU should create a new image with absolute paths
1475 # for the backing file. If there is no backing file available,
1476 # the new image will not be backed either.
1480 { 'enum': 'NewImageMode',
1481 'data': [ 'existing', 'absolute-paths' ] }
1484 # @BlockdevSnapshotSync:
1486 # Either @device or @node-name must be set but not both.
1488 # @device: the name of the device to take a snapshot of.
1490 # @node-name: graph node name to generate the snapshot from (Since
1493 # @snapshot-file: the target of the new overlay image. If the file
1494 # exists, or if it is a device, the overlay will be created in the
1495 # existing file/device. Otherwise, a new file will be created.
1497 # @snapshot-node-name: the graph node name of the new image (Since
1500 # @format: the format of the overlay image, default is 'qcow2'.
1502 # @mode: whether and how QEMU should create a new image, default is
1505 { 'struct': 'BlockdevSnapshotSync',
1506 'data': { '*device': 'str', '*node-name': 'str',
1507 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1508 '*format': 'str', '*mode': 'NewImageMode' } }
1511 # @BlockdevSnapshot:
1513 # @node: device or node name that will have a snapshot taken.
1515 # @overlay: reference to the existing block device that will become
1516 # the overlay of @node, as part of taking the snapshot. It must
1517 # not have a current backing file (this can be achieved by passing
1518 # "backing": null to blockdev-add).
1522 { 'struct': 'BlockdevSnapshot',
1523 'data': { 'node': 'str', 'overlay': 'str' } }
1528 # Optional parameters for backup. These parameters don't affect
1529 # functionality, but may significantly affect performance.
1531 # @use-copy-range: Use copy offloading. Default false.
1533 # @max-workers: Maximum number of parallel requests for the sustained
1534 # background copying process. Doesn't influence copy-before-write
1535 # operations. Default 64.
1537 # @max-chunk: Maximum request length for the sustained background
1538 # copying process. Doesn't influence copy-before-write
1539 # operations. 0 means unlimited. If max-chunk is non-zero then
1540 # it should not be less than job cluster size which is calculated
1541 # as maximum of target image cluster size and 64k. Default 0.
1545 { 'struct': 'BackupPerf',
1546 'data': { '*use-copy-range': 'bool',
1547 '*max-workers': 'int', '*max-chunk': 'int64' } }
1552 # @job-id: identifier for the newly-created block job. If omitted,
1553 # the device name will be used. (Since 2.7)
1555 # @device: the device name or node-name of a root node which should be
1558 # @sync: what parts of the disk image should be copied to the
1559 # destination (all the disk, only the sectors allocated in the
1560 # topmost image, from a dirty bitmap, or only new I/O).
1562 # @speed: the maximum speed, in bytes per second. The default is 0,
1565 # @bitmap: The name of a dirty bitmap to use. Must be present if sync
1566 # is "bitmap" or "incremental". Can be present if sync is "full"
1567 # or "top". Must not be present otherwise.
1568 # (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1570 # @bitmap-mode: Specifies the type of data the bitmap should contain
1571 # after the operation concludes. Must be present if a bitmap was
1572 # provided, Must NOT be present otherwise. (Since 4.2)
1574 # @compress: true to compress data, if the target format supports it.
1575 # (default: false) (since 2.8)
1577 # @on-source-error: the action to take on an error on the source,
1578 # default 'report'. 'stop' and 'enospc' can only be used if the
1579 # block device supports io-status (see BlockInfo).
1581 # @on-target-error: the action to take on an error on the target,
1582 # default 'report' (no limitations, since this applies to a
1583 # different block device than @device).
1585 # @auto-finalize: When false, this job will wait in a PENDING state
1586 # after it has finished its work, waiting for @block-job-finalize
1587 # before making any block graph changes. When true, this job will
1588 # automatically perform its abort or commit actions. Defaults to
1589 # true. (Since 2.12)
1591 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
1592 # after it has completely ceased all work, and awaits
1593 # @block-job-dismiss. When true, this job will automatically
1594 # disappear from the query list without user intervention.
1595 # Defaults to true. (Since 2.12)
1597 # @filter-node-name: the node name that should be assigned to the
1598 # filter driver that the backup job inserts into the graph above
1599 # node specified by @drive. If this option is not given, a node
1600 # name is autogenerated. (Since: 4.2)
1602 # @x-perf: Performance options. (Since 6.0)
1606 # @unstable: Member @x-perf is experimental.
1608 # Note: @on-source-error and @on-target-error only affect background
1609 # I/O. If an error occurs during a guest write request, the
1610 # device's rerror/werror actions will be used.
1614 { 'struct': 'BackupCommon',
1615 'data': { '*job-id': 'str', 'device': 'str',
1616 'sync': 'MirrorSyncMode', '*speed': 'int',
1617 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1618 '*compress': 'bool',
1619 '*on-source-error': 'BlockdevOnError',
1620 '*on-target-error': 'BlockdevOnError',
1621 '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
1622 '*filter-node-name': 'str',
1623 '*x-perf': { 'type': 'BackupPerf',
1624 'features': [ 'unstable' ] } } }
1629 # @target: the target of the new image. If the file exists, or if it
1630 # is a device, the existing file/device will be used as the new
1631 # destination. If it does not exist, a new file will be created.
1633 # @format: the format of the new destination, default is to probe if
1634 # @mode is 'existing', else the format of the source
1636 # @mode: whether and how QEMU should create a new image, default is
1641 { 'struct': 'DriveBackup',
1642 'base': 'BackupCommon',
1643 'data': { 'target': 'str',
1645 '*mode': 'NewImageMode' } }
1650 # @target: the device name or node-name of the backup target node.
1654 { 'struct': 'BlockdevBackup',
1655 'base': 'BackupCommon',
1656 'data': { 'target': 'str' } }
1659 # @blockdev-snapshot-sync:
1661 # Takes a synchronous snapshot of a block device.
1663 # For the arguments, see the documentation of BlockdevSnapshotSync.
1666 # - nothing on success
1667 # - If @device is not a valid block device, DeviceNotFound
1673 # -> { "execute": "blockdev-snapshot-sync",
1674 # "arguments": { "device": "ide-hd0",
1676 # "/some/place/my-image",
1677 # "format": "qcow2" } }
1678 # <- { "return": {} }
1680 { 'command': 'blockdev-snapshot-sync',
1681 'data': 'BlockdevSnapshotSync',
1682 'allow-preconfig': true }
1685 # @blockdev-snapshot:
1687 # Takes a snapshot of a block device.
1689 # Take a snapshot, by installing 'node' as the backing image of
1690 # 'overlay'. Additionally, if 'node' is associated with a block
1691 # device, the block device changes to using 'overlay' as its new
1694 # For the arguments, see the documentation of BlockdevSnapshot.
1698 # @allow-write-only-overlay: If present, the check whether this
1699 # operation is safe was relaxed so that it can be used to change
1700 # backing file of a destination of a blockdev-mirror. (since 5.0)
1706 # -> { "execute": "blockdev-add",
1707 # "arguments": { "driver": "qcow2",
1708 # "node-name": "node1534",
1709 # "file": { "driver": "file",
1710 # "filename": "hd1.qcow2" },
1711 # "backing": null } }
1713 # <- { "return": {} }
1715 # -> { "execute": "blockdev-snapshot",
1716 # "arguments": { "node": "ide-hd0",
1717 # "overlay": "node1534" } }
1718 # <- { "return": {} }
1720 { 'command': 'blockdev-snapshot',
1721 'data': 'BlockdevSnapshot',
1722 'features': [ 'allow-write-only-overlay' ],
1723 'allow-preconfig': true }
1726 # @change-backing-file:
1728 # Change the backing file in the image file metadata. This does not
1729 # cause QEMU to reopen the image file to reparse the backing filename
1730 # (it may, however, perform a reopen to change permissions from r/o ->
1731 # r/w -> r/o, if needed). The new backing file string is written into
1732 # the image file metadata, and the QEMU internal strings are updated.
1734 # @image-node-name: The name of the block driver state node of the
1735 # image to modify. The "device" argument is used to verify
1736 # "image-node-name" is in the chain described by "device".
1738 # @device: The device name or node-name of the root node that owns
1741 # @backing-file: The string to write as the backing file. This string
1742 # is not validated, so care should be taken when specifying the
1743 # string or the image chain may not be able to be reopened again.
1746 # - Nothing on success
1747 # - If "device" does not exist or cannot be determined,
1752 { 'command': 'change-backing-file',
1753 'data': { 'device': 'str', 'image-node-name': 'str',
1754 'backing-file': 'str' },
1755 'allow-preconfig': true }
1760 # Live commit of data from overlay image nodes into backing nodes -
1761 # i.e., writes data between 'top' and 'base' into 'base'.
1763 # If top == base, that is an error. If top has no overlays on top of
1764 # it, or if it is in use by a writer, the job will not be completed by
1765 # itself. The user needs to complete the job with the
1766 # block-job-complete command after getting the ready event. (Since
1769 # If the base image is smaller than top, then the base image will be
1770 # resized to be the same size as top. If top is smaller than the base
1771 # image, the base will not be truncated. If you want the base image
1772 # size to match the size of the smaller top, you can safely truncate
1773 # it yourself once the commit operation successfully completes.
1775 # @job-id: identifier for the newly-created block job. If omitted,
1776 # the device name will be used. (Since 2.7)
1778 # @device: the device name or node-name of a root node
1780 # @base-node: The node name of the backing image to write data into.
1781 # If not specified, this is the deepest backing image.
1784 # @base: Same as @base-node, except that it is a file name rather than
1785 # a node name. This must be the exact filename string that was
1786 # used to open the node; other strings, even if addressing the
1787 # same file, are not accepted
1789 # @top-node: The node name of the backing image within the image chain
1790 # which contains the topmost data to be committed down. If not
1791 # specified, this is the active layer. (since: 3.1)
1793 # @top: Same as @top-node, except that it is a file name rather than a
1794 # node name. This must be the exact filename string that was used
1795 # to open the node; other strings, even if addressing the same
1796 # file, are not accepted
1798 # @backing-file: The backing file string to write into the overlay
1799 # image of 'top'. If 'top' does not have an overlay image, or if
1800 # 'top' is in use by a writer, specifying a backing file string is
1803 # This filename is not validated. If a pathname string is such
1804 # that it cannot be resolved by QEMU, that means that subsequent
1805 # QMP or HMP commands must use node-names for the image in
1806 # question, as filename lookup methods will fail.
1808 # If not specified, QEMU will automatically determine the backing
1809 # file string to use, or error out if there is no obvious choice.
1810 # Care should be taken when specifying the string, to specify a
1811 # valid filename or protocol. (Since 2.1)
1813 # @backing-mask-protocol: If true, replace any protocol mentioned in the
1814 # 'backing file format' with 'raw', rather than storing the protocol
1815 # name as the backing format. Can be used even when no image header
1816 # will be updated (default false; since 9.0).
1818 # @speed: the maximum speed, in bytes per second
1820 # @on-error: the action to take on an error. 'ignore' means that the
1821 # request should be retried. (default: report; Since: 5.0)
1823 # @filter-node-name: the node name that should be assigned to the
1824 # filter driver that the commit job inserts into the graph above
1825 # @top. If this option is not given, a node name is
1826 # autogenerated. (Since: 2.9)
1828 # @auto-finalize: When false, this job will wait in a PENDING state
1829 # after it has finished its work, waiting for @block-job-finalize
1830 # before making any block graph changes. When true, this job will
1831 # automatically perform its abort or commit actions. Defaults to
1834 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
1835 # after it has completely ceased all work, and awaits
1836 # @block-job-dismiss. When true, this job will automatically
1837 # disappear from the query list without user intervention.
1838 # Defaults to true. (Since 3.1)
1842 # @deprecated: Members @base and @top are deprecated. Use @base-node
1843 # and @top-node instead.
1846 # - Nothing on success
1847 # - If @device does not exist, DeviceNotFound
1848 # - Any other error returns a GenericError.
1854 # -> { "execute": "block-commit",
1855 # "arguments": { "device": "virtio0",
1856 # "top": "/tmp/snap1.qcow2" } }
1857 # <- { "return": {} }
1859 { 'command': 'block-commit',
1860 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1861 '*base': { 'type': 'str', 'features': [ 'deprecated' ] },
1863 '*top': { 'type': 'str', 'features': [ 'deprecated' ] },
1864 '*backing-file': 'str', '*backing-mask-protocol': 'bool',
1866 '*on-error': 'BlockdevOnError',
1867 '*filter-node-name': 'str',
1868 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
1869 'allow-preconfig': true }
1874 # Start a point-in-time copy of a block device to a new destination.
1875 # The status of ongoing drive-backup operations can be checked with
1876 # query-block-jobs where the BlockJobInfo.type field has the value
1877 # 'backup'. The operation can be stopped before it has completed using
1878 # the block-job-cancel command.
1882 # @deprecated: This command is deprecated. Use @blockdev-backup
1886 # - nothing on success
1887 # - If @device is not a valid block device, GenericError
1893 # -> { "execute": "drive-backup",
1894 # "arguments": { "device": "drive0",
1896 # "target": "backup.img" } }
1897 # <- { "return": {} }
1899 { 'command': 'drive-backup', 'boxed': true,
1900 'data': 'DriveBackup', 'features': ['deprecated'],
1901 'allow-preconfig': true }
1906 # Start a point-in-time copy of a block device to a new destination.
1907 # The status of ongoing blockdev-backup operations can be checked with
1908 # query-block-jobs where the BlockJobInfo.type field has the value
1909 # 'backup'. The operation can be stopped before it has completed using
1910 # the block-job-cancel command.
1913 # - nothing on success
1914 # - If @device is not a valid block device, DeviceNotFound
1920 # -> { "execute": "blockdev-backup",
1921 # "arguments": { "device": "src-id",
1923 # "target": "tgt-id" } }
1924 # <- { "return": {} }
1926 { 'command': 'blockdev-backup', 'boxed': true,
1927 'data': 'BlockdevBackup',
1928 'allow-preconfig': true }
1931 # @query-named-block-nodes:
1933 # Get the named block driver list
1935 # @flat: Omit the nested data about backing image ("backing-image"
1936 # key) if true. Default is false (Since 5.0)
1938 # Returns: the list of BlockDeviceInfo
1944 # -> { "execute": "query-named-block-nodes" }
1945 # <- { "return": [ { "ro":false,
1947 # "encrypted":false,
1948 # "file":"disks/test.qcow2",
1949 # "node-name": "my-node",
1950 # "backing_file_depth":1,
1951 # "detect_zeroes":"off",
1958 # "bps_max": 8000000,
1965 # "write_threshold": 0,
1967 # "filename":"disks/test.qcow2",
1969 # "virtual-size":2048000,
1970 # "backing_file":"base.qcow2",
1971 # "full-backing-filename":"disks/base.qcow2",
1972 # "backing-filename-format":"qcow2",
1976 # "name": "snapshot1",
1977 # "vm-state-size": 0,
1978 # "date-sec": 10000200,
1980 # "vm-clock-sec": 206,
1981 # "vm-clock-nsec": 30
1985 # "filename":"disks/base.qcow2",
1987 # "virtual-size":2048000
1991 { 'command': 'query-named-block-nodes',
1992 'returns': [ 'BlockDeviceInfo' ],
1993 'data': { '*flat': 'bool' },
1994 'allow-preconfig': true }
1997 # @XDbgBlockGraphNodeType:
1999 # @block-backend: corresponds to BlockBackend
2001 # @block-job: corresponds to BlockJob
2003 # @block-driver: corresponds to BlockDriverState
2007 { 'enum': 'XDbgBlockGraphNodeType',
2008 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
2011 # @XDbgBlockGraphNode:
2013 # @id: Block graph node identifier. This @id is generated only for
2014 # x-debug-query-block-graph and does not relate to any other
2015 # identifiers in Qemu.
2017 # @type: Type of graph node. Can be one of block-backend, block-job
2018 # or block-driver-state.
2020 # @name: Human readable name of the node. Corresponds to node-name
2021 # for block-driver-state nodes; is not guaranteed to be unique in
2022 # the whole graph (with block-jobs and block-backends).
2026 { 'struct': 'XDbgBlockGraphNode',
2027 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
2032 # Enum of base block permissions.
2034 # @consistent-read: A user that has the "permission" of consistent
2035 # reads is guaranteed that their view of the contents of the block
2036 # device is complete and self-consistent, representing the
2037 # contents of a disk at a specific point. For most block devices
2038 # (including their backing files) this is true, but the property
2039 # cannot be maintained in a few situations like for intermediate
2040 # nodes of a commit block job.
2042 # @write: This permission is required to change the visible disk
2045 # @write-unchanged: This permission (which is weaker than
2046 # BLK_PERM_WRITE) is both enough and required for writes to the
2047 # block node when the caller promises that the visible disk
2048 # content doesn't change. As the BLK_PERM_WRITE permission is
2049 # strictly stronger, either is sufficient to perform an unchanging
2052 # @resize: This permission is required to change the size of a block
2057 { 'enum': 'BlockPermission',
2058 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize' ] }
2061 # @XDbgBlockGraphEdge:
2063 # Block Graph edge description for x-debug-query-block-graph.
2065 # @parent: parent id
2069 # @name: name of the relation (examples are 'file' and 'backing')
2071 # @perm: granted permissions for the parent operating on the child
2073 # @shared-perm: permissions that can still be granted to other users
2074 # of the child while it is still attached to this parent
2078 { 'struct': 'XDbgBlockGraphEdge',
2079 'data': { 'parent': 'uint64', 'child': 'uint64',
2080 'name': 'str', 'perm': [ 'BlockPermission' ],
2081 'shared-perm': [ 'BlockPermission' ] } }
2086 # Block Graph - list of nodes and list of edges.
2090 { 'struct': 'XDbgBlockGraph',
2091 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
2094 # @x-debug-query-block-graph:
2096 # Get the block graph.
2100 # @unstable: This command is meant for debugging.
2104 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph',
2105 'features': [ 'unstable' ],
2106 'allow-preconfig': true }
2111 # Start mirroring a block device's writes to a new destination.
2112 # target specifies the target of the new image. If the file exists,
2113 # or if it is a device, it will be used as the new destination for
2114 # writes. If it does not exist, a new file will be created. format
2115 # specifies the format of the mirror image, default is to probe if
2116 # mode='existing', else the format of the source.
2119 # - nothing on success
2120 # - If @device is not a valid block device, GenericError
2126 # -> { "execute": "drive-mirror",
2127 # "arguments": { "device": "ide-hd0",
2128 # "target": "/some/place/my-image",
2130 # "format": "qcow2" } }
2131 # <- { "return": {} }
2133 { 'command': 'drive-mirror', 'boxed': true,
2134 'data': 'DriveMirror',
2135 'allow-preconfig': true }
2140 # A set of parameters describing drive mirror setup.
2142 # @job-id: identifier for the newly-created block job. If omitted,
2143 # the device name will be used. (Since 2.7)
2145 # @device: the device name or node-name of a root node whose writes
2146 # should be mirrored.
2148 # @target: the target of the new image. If the file exists, or if it
2149 # is a device, the existing file/device will be used as the new
2150 # destination. If it does not exist, a new file will be created.
2152 # @format: the format of the new destination, default is to probe if
2153 # @mode is 'existing', else the format of the source
2155 # @node-name: the new block driver state node name in the graph (Since
2158 # @replaces: with sync=full graph node name to be replaced by the new
2159 # image when a whole image copy is done. This can be used to
2160 # repair broken Quorum files. By default, @device is replaced,
2161 # although implicitly created filters on it are kept. (Since 2.1)
2163 # @mode: whether and how QEMU should create a new image, default is
2166 # @speed: the maximum speed, in bytes per second
2168 # @sync: what parts of the disk image should be copied to the
2169 # destination (all the disk, only the sectors allocated in the
2170 # topmost image, or only new I/O).
2172 # @granularity: granularity of the dirty bitmap, default is 64K if the
2173 # image format doesn't have clusters, 4K if the clusters are
2174 # smaller than that, else the cluster size. Must be a power of 2
2175 # between 512 and 64M (since 1.4).
2177 # @buf-size: maximum amount of data in flight from source to target
2180 # @on-source-error: the action to take on an error on the source,
2181 # default 'report'. 'stop' and 'enospc' can only be used if the
2182 # block device supports io-status (see BlockInfo).
2184 # @on-target-error: the action to take on an error on the target,
2185 # default 'report' (no limitations, since this applies to a
2186 # different block device than @device).
2188 # @unmap: Whether to try to unmap target sectors where source has only
2189 # zero. If true, and target unallocated sectors will read as
2190 # zero, target image sectors will be unmapped; otherwise, zeroes
2191 # will be written. Both will result in identical contents.
2192 # Default is true. (Since 2.4)
2194 # @copy-mode: when to copy data to the destination; defaults to
2195 # 'background' (Since: 3.0)
2197 # @auto-finalize: When false, this job will wait in a PENDING state
2198 # after it has finished its work, waiting for @block-job-finalize
2199 # before making any block graph changes. When true, this job will
2200 # automatically perform its abort or commit actions. Defaults to
2203 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
2204 # after it has completely ceased all work, and awaits
2205 # @block-job-dismiss. When true, this job will automatically
2206 # disappear from the query list without user intervention.
2207 # Defaults to true. (Since 3.1)
2211 { 'struct': 'DriveMirror',
2212 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2213 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
2214 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2215 '*speed': 'int', '*granularity': 'uint32',
2216 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2217 '*on-target-error': 'BlockdevOnError',
2218 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
2219 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2222 # @BlockDirtyBitmap:
2224 # @node: name of device/node which the bitmap is tracking
2226 # @name: name of the dirty bitmap
2230 { 'struct': 'BlockDirtyBitmap',
2231 'data': { 'node': 'str', 'name': 'str' } }
2234 # @BlockDirtyBitmapAdd:
2236 # @node: name of device/node which the bitmap is tracking
2238 # @name: name of the dirty bitmap (must be less than 1024 bytes)
2240 # @granularity: the bitmap granularity, default is 64k for
2241 # block-dirty-bitmap-add
2243 # @persistent: the bitmap is persistent, i.e. it will be saved to the
2244 # corresponding block device image file on its close. For now
2245 # only Qcow2 disks support persistent bitmaps. Default is false
2246 # for block-dirty-bitmap-add. (Since: 2.10)
2248 # @disabled: the bitmap is created in the disabled state, which means
2249 # that it will not track drive changes. The bitmap may be enabled
2250 # with block-dirty-bitmap-enable. Default is false. (Since: 4.0)
2254 { 'struct': 'BlockDirtyBitmapAdd',
2255 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
2256 '*persistent': 'bool', '*disabled': 'bool' } }
2259 # @BlockDirtyBitmapOrStr:
2261 # @local: name of the bitmap, attached to the same node as target
2264 # @external: bitmap with specified node
2268 { 'alternate': 'BlockDirtyBitmapOrStr',
2269 'data': { 'local': 'str',
2270 'external': 'BlockDirtyBitmap' } }
2273 # @BlockDirtyBitmapMerge:
2275 # @node: name of device/node which the @target bitmap is tracking
2277 # @target: name of the destination dirty bitmap
2279 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or
2280 # fully specified BlockDirtyBitmap elements. The latter are
2281 # supported since 4.1.
2285 { 'struct': 'BlockDirtyBitmapMerge',
2286 'data': { 'node': 'str', 'target': 'str',
2287 'bitmaps': ['BlockDirtyBitmapOrStr'] } }
2290 # @block-dirty-bitmap-add:
2292 # Create a dirty bitmap with a name on the node, and start tracking
2296 # - nothing on success
2297 # - If @node is not a valid block device or node, DeviceNotFound
2298 # - If @name is already taken, GenericError with an explanation
2304 # -> { "execute": "block-dirty-bitmap-add",
2305 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2306 # <- { "return": {} }
2308 { 'command': 'block-dirty-bitmap-add',
2309 'data': 'BlockDirtyBitmapAdd',
2310 'allow-preconfig': true }
2313 # @block-dirty-bitmap-remove:
2315 # Stop write tracking and remove the dirty bitmap that was created
2316 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it
2317 # from its storage too.
2320 # - nothing on success
2321 # - If @node is not a valid block device or node, DeviceNotFound
2322 # - If @name is not found, GenericError with an explanation
2323 # - if @name is frozen by an operation, GenericError
2329 # -> { "execute": "block-dirty-bitmap-remove",
2330 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2331 # <- { "return": {} }
2333 { 'command': 'block-dirty-bitmap-remove',
2334 'data': 'BlockDirtyBitmap',
2335 'allow-preconfig': true }
2338 # @block-dirty-bitmap-clear:
2340 # Clear (reset) a dirty bitmap on the device, so that an incremental
2341 # backup from this point in time forward will only backup clusters
2342 # modified after this clear operation.
2345 # - nothing on success
2346 # - If @node is not a valid block device, DeviceNotFound
2347 # - If @name is not found, GenericError with an explanation
2353 # -> { "execute": "block-dirty-bitmap-clear",
2354 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2355 # <- { "return": {} }
2357 { 'command': 'block-dirty-bitmap-clear',
2358 'data': 'BlockDirtyBitmap',
2359 'allow-preconfig': true }
2362 # @block-dirty-bitmap-enable:
2364 # Enables a dirty bitmap so that it will begin tracking disk changes.
2367 # - nothing on success
2368 # - If @node is not a valid block device, DeviceNotFound
2369 # - If @name is not found, GenericError with an explanation
2375 # -> { "execute": "block-dirty-bitmap-enable",
2376 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2377 # <- { "return": {} }
2379 { 'command': 'block-dirty-bitmap-enable',
2380 'data': 'BlockDirtyBitmap',
2381 'allow-preconfig': true }
2384 # @block-dirty-bitmap-disable:
2386 # Disables a dirty bitmap so that it will stop tracking disk changes.
2389 # - nothing on success
2390 # - If @node is not a valid block device, DeviceNotFound
2391 # - If @name is not found, GenericError with an explanation
2397 # -> { "execute": "block-dirty-bitmap-disable",
2398 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2399 # <- { "return": {} }
2401 { 'command': 'block-dirty-bitmap-disable',
2402 'data': 'BlockDirtyBitmap',
2403 'allow-preconfig': true }
2406 # @block-dirty-bitmap-merge:
2408 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2409 # Dirty bitmaps in @bitmaps will be unchanged, except if it also
2410 # appears as the @target bitmap. Any bits already set in @target will
2411 # still be set after the merge, i.e., this operation does not clear
2412 # the target. On error, @target is unchanged.
2414 # The resulting bitmap will count as dirty any clusters that were
2415 # dirty in any of the source bitmaps. This can be used to achieve
2416 # backup checkpoints, or in simpler usages, to copy bitmaps.
2419 # - nothing on success
2420 # - If @node is not a valid block device, DeviceNotFound
2421 # - If any bitmap in @bitmaps or @target is not found,
2423 # - If any of the bitmaps have different sizes or granularities,
2430 # -> { "execute": "block-dirty-bitmap-merge",
2431 # "arguments": { "node": "drive0", "target": "bitmap0",
2432 # "bitmaps": ["bitmap1"] } }
2433 # <- { "return": {} }
2435 { 'command': 'block-dirty-bitmap-merge',
2436 'data': 'BlockDirtyBitmapMerge',
2437 'allow-preconfig': true }
2440 # @BlockDirtyBitmapSha256:
2442 # SHA256 hash of dirty bitmap data
2444 # @sha256: ASCII representation of SHA256 bitmap hash
2448 { 'struct': 'BlockDirtyBitmapSha256',
2449 'data': {'sha256': 'str'} }
2452 # @x-debug-block-dirty-bitmap-sha256:
2454 # Get bitmap SHA256.
2458 # @unstable: This command is meant for debugging.
2461 # - BlockDirtyBitmapSha256 on success
2462 # - If @node is not a valid block device, DeviceNotFound
2463 # - If @name is not found or if hashing has failed, GenericError
2464 # with an explanation
2468 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2469 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256',
2470 'features': [ 'unstable' ],
2471 'allow-preconfig': true }
2476 # Start mirroring a block device's writes to a new destination.
2478 # @job-id: identifier for the newly-created block job. If omitted,
2479 # the device name will be used. (Since 2.7)
2481 # @device: The device name or node-name of a root node whose writes
2482 # should be mirrored.
2484 # @target: the id or node-name of the block device to mirror to. This
2485 # mustn't be attached to guest.
2487 # @replaces: with sync=full graph node name to be replaced by the new
2488 # image when a whole image copy is done. This can be used to
2489 # repair broken Quorum files. By default, @device is replaced,
2490 # although implicitly created filters on it are kept.
2492 # @speed: the maximum speed, in bytes per second
2494 # @sync: what parts of the disk image should be copied to the
2495 # destination (all the disk, only the sectors allocated in the
2496 # topmost image, or only new I/O).
2498 # @granularity: granularity of the dirty bitmap, default is 64K if the
2499 # image format doesn't have clusters, 4K if the clusters are
2500 # smaller than that, else the cluster size. Must be a power of 2
2501 # between 512 and 64M
2503 # @buf-size: maximum amount of data in flight from source to target
2505 # @on-source-error: the action to take on an error on the source,
2506 # default 'report'. 'stop' and 'enospc' can only be used if the
2507 # block device supports io-status (see BlockInfo).
2509 # @on-target-error: the action to take on an error on the target,
2510 # default 'report' (no limitations, since this applies to a
2511 # different block device than @device).
2513 # @filter-node-name: the node name that should be assigned to the
2514 # filter driver that the mirror job inserts into the graph above
2515 # @device. If this option is not given, a node name is
2516 # autogenerated. (Since: 2.9)
2518 # @copy-mode: when to copy data to the destination; defaults to
2519 # 'background' (Since: 3.0)
2521 # @auto-finalize: When false, this job will wait in a PENDING state
2522 # after it has finished its work, waiting for @block-job-finalize
2523 # before making any block graph changes. When true, this job will
2524 # automatically perform its abort or commit actions. Defaults to
2527 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
2528 # after it has completely ceased all work, and awaits
2529 # @block-job-dismiss. When true, this job will automatically
2530 # disappear from the query list without user intervention.
2531 # Defaults to true. (Since 3.1)
2533 # Returns: nothing on success.
2539 # -> { "execute": "blockdev-mirror",
2540 # "arguments": { "device": "ide-hd0",
2541 # "target": "target0",
2542 # "sync": "full" } }
2543 # <- { "return": {} }
2545 { 'command': 'blockdev-mirror',
2546 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2548 'sync': 'MirrorSyncMode',
2549 '*speed': 'int', '*granularity': 'uint32',
2550 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2551 '*on-target-error': 'BlockdevOnError',
2552 '*filter-node-name': 'str',
2553 '*copy-mode': 'MirrorCopyMode',
2554 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
2555 'allow-preconfig': true }
2560 # A set of parameters describing block throttling.
2562 # @device: Block device name
2564 # @id: The name or QOM path of the guest device (since: 2.8)
2566 # @bps: total throughput limit in bytes per second
2568 # @bps_rd: read throughput limit in bytes per second
2570 # @bps_wr: write throughput limit in bytes per second
2572 # @iops: total I/O operations per second
2574 # @iops_rd: read I/O operations per second
2576 # @iops_wr: write I/O operations per second
2578 # @bps_max: total throughput limit during bursts, in bytes (Since 1.7)
2580 # @bps_rd_max: read throughput limit during bursts, in bytes (Since
2583 # @bps_wr_max: write throughput limit during bursts, in bytes (Since
2586 # @iops_max: total I/O operations per second during bursts, in bytes
2589 # @iops_rd_max: read I/O operations per second during bursts, in bytes
2592 # @iops_wr_max: write I/O operations per second during bursts, in
2595 # @bps_max_length: maximum length of the @bps_max burst period, in
2596 # seconds. It must only be set if @bps_max is set as well.
2597 # Defaults to 1. (Since 2.6)
2599 # @bps_rd_max_length: maximum length of the @bps_rd_max burst period,
2600 # in seconds. It must only be set if @bps_rd_max is set as well.
2601 # Defaults to 1. (Since 2.6)
2603 # @bps_wr_max_length: maximum length of the @bps_wr_max burst period,
2604 # in seconds. It must only be set if @bps_wr_max is set as well.
2605 # Defaults to 1. (Since 2.6)
2607 # @iops_max_length: maximum length of the @iops burst period, in
2608 # seconds. It must only be set if @iops_max is set as well.
2609 # Defaults to 1. (Since 2.6)
2611 # @iops_rd_max_length: maximum length of the @iops_rd_max burst
2612 # period, in seconds. It must only be set if @iops_rd_max is set
2613 # as well. Defaults to 1. (Since 2.6)
2615 # @iops_wr_max_length: maximum length of the @iops_wr_max burst
2616 # period, in seconds. It must only be set if @iops_wr_max is set
2617 # as well. Defaults to 1. (Since 2.6)
2619 # @iops_size: an I/O size in bytes (Since 1.7)
2621 # @group: throttle group name (Since 2.4)
2625 # @deprecated: Member @device is deprecated. Use @id instead.
2629 { 'struct': 'BlockIOThrottle',
2630 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
2631 '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2632 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2633 '*bps_max': 'int', '*bps_rd_max': 'int',
2634 '*bps_wr_max': 'int', '*iops_max': 'int',
2635 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2636 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2637 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2638 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2639 '*iops_size': 'int', '*group': 'str' } }
2644 # Limit parameters for throttling. Since some limit combinations are
2645 # illegal, limits should always be set in one transaction. All fields
2646 # are optional. When setting limits, if a field is missing the
2647 # current value is not changed.
2649 # @iops-total: limit total I/O operations per second
2651 # @iops-total-max: I/O operations burst
2653 # @iops-total-max-length: length of the iops-total-max burst period,
2654 # in seconds It must only be set if @iops-total-max is set as
2657 # @iops-read: limit read operations per second
2659 # @iops-read-max: I/O operations read burst
2661 # @iops-read-max-length: length of the iops-read-max burst period, in
2662 # seconds It must only be set if @iops-read-max is set as well.
2664 # @iops-write: limit write operations per second
2666 # @iops-write-max: I/O operations write burst
2668 # @iops-write-max-length: length of the iops-write-max burst period,
2669 # in seconds It must only be set if @iops-write-max is set as
2672 # @bps-total: limit total bytes per second
2674 # @bps-total-max: total bytes burst
2676 # @bps-total-max-length: length of the bps-total-max burst period, in
2677 # seconds. It must only be set if @bps-total-max is set as well.
2679 # @bps-read: limit read bytes per second
2681 # @bps-read-max: total bytes read burst
2683 # @bps-read-max-length: length of the bps-read-max burst period, in
2684 # seconds It must only be set if @bps-read-max is set as well.
2686 # @bps-write: limit write bytes per second
2688 # @bps-write-max: total bytes write burst
2690 # @bps-write-max-length: length of the bps-write-max burst period, in
2691 # seconds It must only be set if @bps-write-max is set as well.
2693 # @iops-size: when limiting by iops max size of an I/O in bytes
2697 { 'struct': 'ThrottleLimits',
2698 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2699 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2700 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2701 '*iops-write' : 'int', '*iops-write-max' : 'int',
2702 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2703 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2704 '*bps-read' : 'int', '*bps-read-max' : 'int',
2705 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2706 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2707 '*iops-size' : 'int' } }
2710 # @ThrottleGroupProperties:
2712 # Properties for throttle-group objects.
2714 # @limits: limits to apply for this throttle group
2718 # @unstable: All members starting with x- are aliases for the same key
2719 # without x- in the @limits object. This is not a stable
2720 # interface and may be removed or changed incompatibly in the
2721 # future. Use @limits for a supported stable interface.
2725 { 'struct': 'ThrottleGroupProperties',
2726 'data': { '*limits': 'ThrottleLimits',
2727 '*x-iops-total': { 'type': 'int',
2728 'features': [ 'unstable' ] },
2729 '*x-iops-total-max': { 'type': 'int',
2730 'features': [ 'unstable' ] },
2731 '*x-iops-total-max-length': { 'type': 'int',
2732 'features': [ 'unstable' ] },
2733 '*x-iops-read': { 'type': 'int',
2734 'features': [ 'unstable' ] },
2735 '*x-iops-read-max': { 'type': 'int',
2736 'features': [ 'unstable' ] },
2737 '*x-iops-read-max-length': { 'type': 'int',
2738 'features': [ 'unstable' ] },
2739 '*x-iops-write': { 'type': 'int',
2740 'features': [ 'unstable' ] },
2741 '*x-iops-write-max': { 'type': 'int',
2742 'features': [ 'unstable' ] },
2743 '*x-iops-write-max-length': { 'type': 'int',
2744 'features': [ 'unstable' ] },
2745 '*x-bps-total': { 'type': 'int',
2746 'features': [ 'unstable' ] },
2747 '*x-bps-total-max': { 'type': 'int',
2748 'features': [ 'unstable' ] },
2749 '*x-bps-total-max-length': { 'type': 'int',
2750 'features': [ 'unstable' ] },
2751 '*x-bps-read': { 'type': 'int',
2752 'features': [ 'unstable' ] },
2753 '*x-bps-read-max': { 'type': 'int',
2754 'features': [ 'unstable' ] },
2755 '*x-bps-read-max-length': { 'type': 'int',
2756 'features': [ 'unstable' ] },
2757 '*x-bps-write': { 'type': 'int',
2758 'features': [ 'unstable' ] },
2759 '*x-bps-write-max': { 'type': 'int',
2760 'features': [ 'unstable' ] },
2761 '*x-bps-write-max-length': { 'type': 'int',
2762 'features': [ 'unstable' ] },
2763 '*x-iops-size': { 'type': 'int',
2764 'features': [ 'unstable' ] } } }
2769 # Copy data from a backing file into a block device.
2771 # The block streaming operation is performed in the background until
2772 # the entire backing file has been copied. This command returns
2773 # immediately once streaming has started. The status of ongoing block
2774 # streaming operations can be checked with query-block-jobs. The
2775 # operation can be stopped before it has completed using the
2776 # block-job-cancel command.
2778 # The node that receives the data is called the top image, can be
2779 # located in any part of the chain (but always above the base image;
2780 # see below) and can be specified using its device or node name.
2781 # Earlier qemu versions only allowed 'device' to name the top level
2782 # node; presence of the 'base-node' parameter during introspection can
2783 # be used as a witness of the enhanced semantics of 'device'.
2785 # If a base file is specified then sectors are not copied from that
2786 # base file and its backing chain. This can be used to stream a
2787 # subset of the backing file chain instead of flattening the entire
2788 # image. When streaming completes the image file will have the base
2789 # file as its backing file, unless that node was changed while the job
2790 # was running. In that case, base's parent's backing (or filtered,
2791 # whichever exists) child (i.e., base at the beginning of the job)
2792 # will be the new backing file.
2794 # On successful completion the image file is updated to drop the
2795 # backing file and the BLOCK_JOB_COMPLETED event is emitted.
2797 # In case @device is a filter node, block-stream modifies the first
2798 # non-filter overlay node below it to point to the new backing node
2799 # instead of modifying @device itself.
2801 # @job-id: identifier for the newly-created block job. If omitted,
2802 # the device name will be used. (Since 2.7)
2804 # @device: the device or node name of the top image
2806 # @base: the common backing file name. It cannot be set if @base-node
2807 # or @bottom is also set.
2809 # @base-node: the node name of the backing file. It cannot be set if
2810 # @base or @bottom is also set. (Since 2.8)
2812 # @bottom: the last node in the chain that should be streamed into
2813 # top. It cannot be set if @base or @base-node is also set. It
2814 # cannot be filter node. (Since 6.0)
2816 # @backing-file: The backing file string to write into the top image.
2817 # This filename is not validated.
2819 # If a pathname string is such that it cannot be resolved by QEMU,
2820 # that means that subsequent QMP or HMP commands must use
2821 # node-names for the image in question, as filename lookup methods
2824 # If not specified, QEMU will automatically determine the backing
2825 # file string to use, or error out if there is no obvious choice.
2826 # Care should be taken when specifying the string, to specify a
2827 # valid filename or protocol. (Since 2.1)
2829 # @speed: the maximum speed, in bytes per second
2831 # @on-error: the action to take on an error (default report). 'stop'
2832 # and 'enospc' can only be used if the block device supports
2833 # io-status (see BlockInfo). (Since 1.3)
2835 # @filter-node-name: the node name that should be assigned to the
2836 # filter driver that the stream job inserts into the graph above
2837 # @device. If this option is not given, a node name is
2838 # autogenerated. (Since: 6.0)
2840 # @auto-finalize: When false, this job will wait in a PENDING state
2841 # after it has finished its work, waiting for @block-job-finalize
2842 # before making any block graph changes. When true, this job will
2843 # automatically perform its abort or commit actions. Defaults to
2846 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
2847 # after it has completely ceased all work, and awaits
2848 # @block-job-dismiss. When true, this job will automatically
2849 # disappear from the query list without user intervention.
2850 # Defaults to true. (Since 3.1)
2853 # - Nothing on success.
2854 # - If @device does not exist, DeviceNotFound.
2860 # -> { "execute": "block-stream",
2861 # "arguments": { "device": "virtio0",
2862 # "base": "/tmp/master.qcow2" } }
2863 # <- { "return": {} }
2865 { 'command': 'block-stream',
2866 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2867 '*base-node': 'str', '*backing-file': 'str', '*bottom': 'str',
2868 '*speed': 'int', '*on-error': 'BlockdevOnError',
2869 '*filter-node-name': 'str',
2870 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
2871 'allow-preconfig': true }
2874 # @block-job-set-speed:
2876 # Set maximum speed for a background block operation.
2878 # This command can only be issued when there is an active block job.
2880 # Throttling can be disabled by setting the speed to 0.
2882 # @device: The job identifier. This used to be a device name (hence
2883 # the name of the parameter), but since QEMU 2.7 it can have other
2886 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2890 # - Nothing on success
2891 # - If no background operation is active on this device,
2896 { 'command': 'block-job-set-speed',
2897 'data': { 'device': 'str', 'speed': 'int' },
2898 'allow-preconfig': true }
2901 # @block-job-cancel:
2903 # Stop an active background block operation.
2905 # This command returns immediately after marking the active background
2906 # block operation for cancellation. It is an error to call this
2907 # command if no operation is in progress.
2909 # The operation will cancel as soon as possible and then emit the
2910 # BLOCK_JOB_CANCELLED event. Before that happens the job is still
2911 # visible when enumerated using query-block-jobs.
2913 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has
2914 # indicated (via the event BLOCK_JOB_READY) that the source and
2915 # destination are synchronized, then the event triggered by this
2916 # command changes to BLOCK_JOB_COMPLETED, to indicate that the
2917 # mirroring has ended and the destination now has a point-in-time copy
2918 # tied to the time of the cancellation.
2920 # For streaming, the image file retains its backing file unless the
2921 # streaming operation happens to complete just as it is being
2922 # cancelled. A new streaming operation can be started at a later time
2923 # to finish copying all data from the backing file.
2925 # @device: The job identifier. This used to be a device name (hence
2926 # the name of the parameter), but since QEMU 2.7 it can have other
2929 # @force: If true, and the job has already emitted the event
2930 # BLOCK_JOB_READY, abandon the job immediately (even if it is
2931 # paused) instead of waiting for the destination to complete its
2932 # final synchronization (since 1.3)
2935 # - Nothing on success
2936 # - If no background operation is active on this device,
2941 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' },
2942 'allow-preconfig': true }
2947 # Pause an active background block operation.
2949 # This command returns immediately after marking the active background
2950 # block operation for pausing. It is an error to call this command if
2951 # no operation is in progress or if the job is already paused.
2953 # The operation will pause as soon as possible. No event is emitted
2954 # when the operation is actually paused. Cancelling a paused job
2955 # automatically resumes it.
2957 # @device: The job identifier. This used to be a device name (hence
2958 # the name of the parameter), but since QEMU 2.7 it can have other
2962 # - Nothing on success
2963 # - If no background operation is active on this device,
2968 { 'command': 'block-job-pause', 'data': { 'device': 'str' },
2969 'allow-preconfig': true }
2972 # @block-job-resume:
2974 # Resume an active background block operation.
2976 # This command returns immediately after resuming a paused background
2977 # block operation. It is an error to call this command if no
2978 # operation is in progress or if the job is not paused.
2980 # This command also clears the error status of the job.
2982 # @device: The job identifier. This used to be a device name (hence
2983 # the name of the parameter), but since QEMU 2.7 it can have other
2987 # - Nothing on success
2988 # - If no background operation is active on this device,
2993 { 'command': 'block-job-resume', 'data': { 'device': 'str' },
2994 'allow-preconfig': true }
2997 # @block-job-complete:
2999 # Manually trigger completion of an active background block operation.
3000 # This is supported for drive mirroring, where it also switches the
3001 # device to write to the target path only. The ability to complete is
3002 # signaled with a BLOCK_JOB_READY event.
3004 # This command completes an active background block operation
3005 # synchronously. The ordering of this command's return with the
3006 # BLOCK_JOB_COMPLETED event is not defined. Note that if an I/O error
3007 # occurs during the processing of this command: 1) the command itself
3008 # will fail; 2) the error will be processed according to the
3009 # rerror/werror arguments that were specified when starting the
3012 # A cancelled or paused job cannot be completed.
3014 # @device: The job identifier. This used to be a device name (hence
3015 # the name of the parameter), but since QEMU 2.7 it can have other
3019 # - Nothing on success
3020 # - If no background operation is active on this device,
3025 { 'command': 'block-job-complete', 'data': { 'device': 'str' },
3026 'allow-preconfig': true }
3029 # @block-job-dismiss:
3031 # For jobs that have already concluded, remove them from the
3032 # block-job-query list. This command only needs to be run for jobs
3033 # which were started with QEMU 2.12+ job lifetime management
3036 # This command will refuse to operate on any job that has not yet
3037 # reached its terminal state, JOB_STATUS_CONCLUDED. For jobs that make
3038 # use of the BLOCK_JOB_READY event, block-job-cancel or
3039 # block-job-complete will still need to be used as appropriate.
3041 # @id: The job identifier.
3043 # Returns: Nothing on success
3047 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' },
3048 'allow-preconfig': true }
3051 # @block-job-finalize:
3053 # Once a job that has manual=true reaches the pending state, it can be
3054 # instructed to finalize any graph changes and do any necessary
3055 # cleanup via this command. For jobs in a transaction, instructing
3056 # one job to finalize will force ALL jobs in the transaction to
3057 # finalize, so it is only necessary to instruct a single member job to
3060 # @id: The job identifier.
3062 # Returns: Nothing on success
3066 { 'command': 'block-job-finalize', 'data': { 'id': 'str' },
3067 'allow-preconfig': true }
3070 # @BlockJobChangeOptionsMirror:
3072 # @copy-mode: Switch to this copy mode. Currently, only the switch
3073 # from 'background' to 'write-blocking' is implemented.
3077 { 'struct': 'BlockJobChangeOptionsMirror',
3078 'data': { 'copy-mode' : 'MirrorCopyMode' } }
3081 # @BlockJobChangeOptions:
3083 # Block job options that can be changed after job creation.
3085 # @id: The job identifier
3087 # @type: The job type
3091 { 'union': 'BlockJobChangeOptions',
3092 'base': { 'id': 'str', 'type': 'JobType' },
3093 'discriminator': 'type',
3094 'data': { 'mirror': 'BlockJobChangeOptionsMirror' } }
3097 # @block-job-change:
3099 # Change the block job's options.
3103 { 'command': 'block-job-change',
3104 'data': 'BlockJobChangeOptions', 'boxed': true }
3107 # @BlockdevDiscardOptions:
3109 # Determines how to handle discard requests.
3111 # @ignore: Ignore the request
3113 # @unmap: Forward as an unmap request
3117 { 'enum': 'BlockdevDiscardOptions',
3118 'data': [ 'ignore', 'unmap' ] }
3121 # @BlockdevDetectZeroesOptions:
3123 # Describes the operation mode for the automatic conversion of plain
3124 # zero writes by the OS to driver specific optimized zero write
3127 # @off: Disabled (default)
3131 # @unmap: Enabled and even try to unmap blocks if possible. This
3132 # requires also that @BlockdevDiscardOptions is set to unmap for
3137 { 'enum': 'BlockdevDetectZeroesOptions',
3138 'data': [ 'off', 'on', 'unmap' ] }
3141 # @BlockdevAioOptions:
3143 # Selects the AIO backend to handle I/O requests
3145 # @threads: Use qemu's thread pool
3147 # @native: Use native AIO backend (only Linux and Windows)
3149 # @io_uring: Use linux io_uring (since 5.0)
3153 { 'enum': 'BlockdevAioOptions',
3154 'data': [ 'threads', 'native',
3155 { 'name': 'io_uring', 'if': 'CONFIG_LINUX_IO_URING' } ] }
3158 # @BlockdevCacheOptions:
3160 # Includes cache-related options for block devices
3162 # @direct: enables use of O_DIRECT (bypass the host page cache;
3165 # @no-flush: ignore any flush requests for the device (default: false)
3169 { 'struct': 'BlockdevCacheOptions',
3170 'data': { '*direct': 'bool',
3171 '*no-flush': 'bool' } }
3176 # Drivers that are supported in block device operations.
3178 # @throttle: Since 2.11
3182 # @copy-on-read: Since 3.0
3184 # @blklogwrites: Since 3.0
3186 # @blkreplay: Since 4.2
3188 # @compress: Since 5.0
3190 # @copy-before-write: Since 6.2
3192 # @snapshot-access: Since 7.0
3196 { 'enum': 'BlockdevDriver',
3197 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
3198 'cloop', 'compress', 'copy-before-write', 'copy-on-read', 'dmg',
3199 'file', 'snapshot-access', 'ftp', 'ftps', 'gluster',
3200 {'name': 'host_cdrom', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
3201 {'name': 'host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
3203 { 'name': 'io_uring', 'if': 'CONFIG_BLKIO' },
3205 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme',
3206 { 'name': 'nvme-io_uring', 'if': 'CONFIG_BLKIO' },
3207 'parallels', 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum',
3209 { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
3210 'ssh', 'throttle', 'vdi', 'vhdx',
3211 { 'name': 'virtio-blk-vfio-pci', 'if': 'CONFIG_BLKIO' },
3212 { 'name': 'virtio-blk-vhost-user', 'if': 'CONFIG_BLKIO' },
3213 { 'name': 'virtio-blk-vhost-vdpa', 'if': 'CONFIG_BLKIO' },
3214 'vmdk', 'vpc', 'vvfat' ] }
3217 # @BlockdevOptionsFile:
3219 # Driver specific block device options for the file backend.
3221 # @filename: path to the image file
3223 # @pr-manager: the id for the object that will handle persistent
3224 # reservations for this device (default: none, forward the
3225 # commands via SG_IO; since 2.11)
3227 # @aio: AIO backend (default: threads) (since: 2.8)
3229 # @aio-max-batch: maximum number of requests to batch together into a
3230 # single submission in the AIO backend. The smallest value
3231 # between this and the aio-max-batch value of the IOThread object
3232 # is chosen. 0 means that the AIO backend will handle it
3233 # automatically. (default: 0, since 6.2)
3235 # @locking: whether to enable file locking. If set to 'auto', only
3236 # enable when Open File Descriptor (OFD) locking API is available
3237 # (default: auto, since 2.10)
3239 # @drop-cache: invalidate page cache during live migration. This
3240 # prevents stale data on the migration destination with
3241 # cache.direct=off. Currently only supported on Linux hosts.
3242 # (default: on, since: 4.0)
3244 # @x-check-cache-dropped: whether to check that page cache was dropped
3245 # on live migration. May cause noticeable delays if the image
3246 # file is large, do not use in production. (default: off)
3251 # @dynamic-auto-read-only: If present, enabled auto-read-only means
3252 # that the driver will open the image read-only at first,
3253 # dynamically reopen the image file read-write when the first
3254 # writer is attached to the node and reopen read-only when the
3255 # last writer is detached. This allows giving QEMU write
3256 # permissions only on demand when an operation actually needs
3259 # @unstable: Member x-check-cache-dropped is meant for debugging.
3263 { 'struct': 'BlockdevOptionsFile',
3264 'data': { 'filename': 'str',
3265 '*pr-manager': 'str',
3266 '*locking': 'OnOffAuto',
3267 '*aio': 'BlockdevAioOptions',
3268 '*aio-max-batch': 'int',
3269 '*drop-cache': {'type': 'bool',
3270 'if': 'CONFIG_LINUX'},
3271 '*x-check-cache-dropped': { 'type': 'bool',
3272 'features': [ 'unstable' ] } },
3273 'features': [ { 'name': 'dynamic-auto-read-only',
3274 'if': 'CONFIG_POSIX' } ] }
3277 # @BlockdevOptionsNull:
3279 # Driver specific block device options for the null backend.
3281 # @size: size of the device in bytes.
3283 # @latency-ns: emulated latency (in nanoseconds) in processing
3284 # requests. Default to zero which completes requests immediately.
3287 # @read-zeroes: if true, reads from the device produce zeroes; if
3288 # false, the buffer is left unchanged.
3289 # (default: false; since: 4.1)
3293 { 'struct': 'BlockdevOptionsNull',
3294 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
3297 # @BlockdevOptionsNVMe:
3299 # Driver specific block device options for the NVMe backend.
3301 # @device: PCI controller address of the NVMe device in format
3302 # hhhh:bb:ss.f (host:bus:slot.function)
3304 # @namespace: namespace number of the device, starting from 1.
3306 # Note that the PCI @device must have been unbound from any host
3307 # kernel driver before instructing QEMU to add the blockdev.
3311 { 'struct': 'BlockdevOptionsNVMe',
3312 'data': { 'device': 'str', 'namespace': 'int' } }
3315 # @BlockdevOptionsVVFAT:
3317 # Driver specific block device options for the vvfat protocol.
3319 # @dir: directory to be exported as FAT image
3321 # @fat-type: FAT type: 12, 16 or 32
3323 # @floppy: whether to export a floppy image (true) or partitioned hard
3324 # disk (false; default)
3326 # @label: set the volume label, limited to 11 bytes. FAT16 and FAT32
3327 # traditionally have some restrictions on labels, which are
3328 # ignored by most operating systems. Defaults to "QEMU VVFAT".
3331 # @rw: whether to allow write operations (default: false)
3335 { 'struct': 'BlockdevOptionsVVFAT',
3336 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
3337 '*label': 'str', '*rw': 'bool' } }
3340 # @BlockdevOptionsGenericFormat:
3342 # Driver specific block device options for image format that have no
3343 # option besides their data source.
3345 # @file: reference to or definition of the data source block device
3349 { 'struct': 'BlockdevOptionsGenericFormat',
3350 'data': { 'file': 'BlockdevRef' } }
3353 # @BlockdevOptionsLUKS:
3355 # Driver specific block device options for LUKS.
3357 # @key-secret: the ID of a QCryptoSecret object providing the
3358 # decryption key (since 2.6). Mandatory except when doing a
3359 # metadata-only probe of the image.
3363 { 'struct': 'BlockdevOptionsLUKS',
3364 'base': 'BlockdevOptionsGenericFormat',
3365 'data': { '*key-secret': 'str' } }
3368 # @BlockdevOptionsGenericCOWFormat:
3370 # Driver specific block device options for image format that have no
3371 # option besides their data source and an optional backing file.
3373 # @backing: reference to or definition of the backing file block
3374 # device, null disables the backing file entirely. Defaults to
3375 # the backing file stored the image file.
3379 { 'struct': 'BlockdevOptionsGenericCOWFormat',
3380 'base': 'BlockdevOptionsGenericFormat',
3381 'data': { '*backing': 'BlockdevRefOrNull' } }
3384 # @Qcow2OverlapCheckMode:
3386 # General overlap check modes.
3388 # @none: Do not perform any checks
3390 # @constant: Perform only checks which can be done in constant time
3391 # and without reading anything from disk
3393 # @cached: Perform only checks which can be done without reading
3394 # anything from disk
3396 # @all: Perform all available overlap checks
3400 { 'enum': 'Qcow2OverlapCheckMode',
3401 'data': [ 'none', 'constant', 'cached', 'all' ] }
3404 # @Qcow2OverlapCheckFlags:
3406 # Structure of flags for each metadata structure. Setting a field to
3407 # 'true' makes qemu guard that structure against unintended
3408 # overwriting. The default value is chosen according to the template
3411 # @template: Specifies a template mode which can be adjusted using the
3412 # other flags, defaults to 'cached'
3414 # @bitmap-directory: since 3.0
3418 { 'struct': 'Qcow2OverlapCheckFlags',
3419 'data': { '*template': 'Qcow2OverlapCheckMode',
3420 '*main-header': 'bool',
3421 '*active-l1': 'bool',
3422 '*active-l2': 'bool',
3423 '*refcount-table': 'bool',
3424 '*refcount-block': 'bool',
3425 '*snapshot-table': 'bool',
3426 '*inactive-l1': 'bool',
3427 '*inactive-l2': 'bool',
3428 '*bitmap-directory': 'bool' } }
3431 # @Qcow2OverlapChecks:
3433 # Specifies which metadata structures should be guarded against
3434 # unintended overwriting.
3436 # @flags: set of flags for separate specification of each metadata
3439 # @mode: named mode which chooses a specific set of flags
3443 { 'alternate': 'Qcow2OverlapChecks',
3444 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3445 'mode': 'Qcow2OverlapCheckMode' } }
3448 # @BlockdevQcowEncryptionFormat:
3450 # @aes: AES-CBC with plain64 initialization vectors
3454 { 'enum': 'BlockdevQcowEncryptionFormat',
3458 # @BlockdevQcowEncryption:
3462 { 'union': 'BlockdevQcowEncryption',
3463 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3464 'discriminator': 'format',
3465 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3468 # @BlockdevOptionsQcow:
3470 # Driver specific block device options for qcow.
3472 # @encrypt: Image decryption options. Mandatory for encrypted images,
3473 # except when doing a metadata-only probe of the image.
3477 { 'struct': 'BlockdevOptionsQcow',
3478 'base': 'BlockdevOptionsGenericCOWFormat',
3479 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3482 # @BlockdevQcow2EncryptionFormat:
3484 # @aes: AES-CBC with plain64 initialization vectors
3488 { 'enum': 'BlockdevQcow2EncryptionFormat',
3489 'data': [ 'aes', 'luks' ] }
3492 # @BlockdevQcow2Encryption:
3496 { 'union': 'BlockdevQcow2Encryption',
3497 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3498 'discriminator': 'format',
3499 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3500 'luks': 'QCryptoBlockOptionsLUKS'} }
3503 # @BlockdevOptionsPreallocate:
3505 # Filter driver intended to be inserted between format and protocol
3506 # node and do preallocation in protocol node on write.
3508 # @prealloc-align: on preallocation, align file length to this number,
3509 # default 1048576 (1M)
3511 # @prealloc-size: how much to preallocate, default 134217728 (128M)
3515 { 'struct': 'BlockdevOptionsPreallocate',
3516 'base': 'BlockdevOptionsGenericFormat',
3517 'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } }
3520 # @BlockdevOptionsQcow2:
3522 # Driver specific block device options for qcow2.
3524 # @lazy-refcounts: whether to enable the lazy refcounts feature
3525 # (default is taken from the image file)
3527 # @pass-discard-request: whether discard requests to the qcow2 device
3528 # should be forwarded to the data source
3530 # @pass-discard-snapshot: whether discard requests for the data source
3531 # should be issued when a snapshot operation (e.g. deleting a
3532 # snapshot) frees clusters in the qcow2 file
3534 # @pass-discard-other: whether discard requests for the data source
3535 # should be issued on other occasions where a cluster gets freed
3537 # @discard-no-unref: when enabled, data clusters will remain
3538 # preallocated when they are no longer used, e.g. because they are
3539 # discarded or converted to zero clusters. As usual, whether the
3540 # old data is discarded or kept on the protocol level (i.e. in the
3541 # image file) depends on the setting of the pass-discard-request
3542 # option. Keeping the clusters preallocated prevents qcow2
3543 # fragmentation that would otherwise be caused by freeing and
3544 # re-allocating them later. Besides potential performance
3545 # degradation, such fragmentation can lead to increased allocation
3546 # of clusters past the end of the image file, resulting in image
3547 # files whose file length can grow much larger than their guest disk
3548 # size would suggest. If image file length is of concern (e.g. when
3549 # storing qcow2 images directly on block devices), you should
3550 # consider enabling this option. (since 8.1)
3552 # @overlap-check: which overlap checks to perform for writes to the
3553 # image, defaults to 'cached' (since 2.2)
3555 # @cache-size: the maximum total size of the L2 table and refcount
3556 # block caches in bytes (since 2.2)
3558 # @l2-cache-size: the maximum size of the L2 table cache in bytes
3561 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3562 # bytes. It must be a power of two between 512 and the cluster
3563 # size. The default value is the cluster size (since 2.12)
3565 # @refcount-cache-size: the maximum size of the refcount block cache
3566 # in bytes (since 2.2)
3568 # @cache-clean-interval: clean unused entries in the L2 and refcount
3569 # caches. The interval is in seconds. The default value is 600
3570 # on supporting platforms, and 0 on other platforms. 0 disables
3571 # this feature. (since 2.5)
3573 # @encrypt: Image decryption options. Mandatory for encrypted images,
3574 # except when doing a metadata-only probe of the image. (since
3577 # @data-file: reference to or definition of the external data file.
3578 # This may only be specified for images that require an external
3579 # data file. If it is not specified for such an image, the data
3580 # file name is loaded from the image file. (since 4.0)
3584 { 'struct': 'BlockdevOptionsQcow2',
3585 'base': 'BlockdevOptionsGenericCOWFormat',
3586 'data': { '*lazy-refcounts': 'bool',
3587 '*pass-discard-request': 'bool',
3588 '*pass-discard-snapshot': 'bool',
3589 '*pass-discard-other': 'bool',
3590 '*discard-no-unref': 'bool',
3591 '*overlap-check': 'Qcow2OverlapChecks',
3592 '*cache-size': 'int',
3593 '*l2-cache-size': 'int',
3594 '*l2-cache-entry-size': 'int',
3595 '*refcount-cache-size': 'int',
3596 '*cache-clean-interval': 'int',
3597 '*encrypt': 'BlockdevQcow2Encryption',
3598 '*data-file': 'BlockdevRef' } }
3601 # @SshHostKeyCheckMode:
3603 # @none: Don't check the host key at all
3605 # @hash: Compare the host key with a given hash
3607 # @known_hosts: Check the host key against the known_hosts file
3611 { 'enum': 'SshHostKeyCheckMode',
3612 'data': [ 'none', 'hash', 'known_hosts' ] }
3615 # @SshHostKeyCheckHashType:
3617 # @md5: The given hash is an md5 hash
3619 # @sha1: The given hash is an sha1 hash
3621 # @sha256: The given hash is an sha256 hash
3625 { 'enum': 'SshHostKeyCheckHashType',
3626 'data': [ 'md5', 'sha1', 'sha256' ] }
3631 # @type: The hash algorithm used for the hash
3633 # @hash: The expected hash value
3637 { 'struct': 'SshHostKeyHash',
3638 'data': { 'type': 'SshHostKeyCheckHashType',
3646 { 'union': 'SshHostKeyCheck',
3647 'base': { 'mode': 'SshHostKeyCheckMode' },
3648 'discriminator': 'mode',
3649 'data': { 'hash': 'SshHostKeyHash' } }
3652 # @BlockdevOptionsSsh:
3654 # @server: host address
3656 # @path: path to the image on the host
3658 # @user: user as which to connect, defaults to current local user name
3660 # @host-key-check: Defines how and what to check the host key against
3661 # (default: known_hosts)
3665 { 'struct': 'BlockdevOptionsSsh',
3666 'data': { 'server': 'InetSocketAddress',
3669 '*host-key-check': 'SshHostKeyCheck' } }
3674 # Trigger events supported by blkdebug.
3676 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3679 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3681 # @cor_write: a write due to copy-on-read (since 2.11)
3683 # @cluster_alloc_space: an allocation of file space for a cluster
3686 # @none: triggers once at creation of the blkdebug node (since 4.1)
3690 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3691 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3692 'l1_grow_activate_table', 'l2_load', 'l2_update',
3693 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3694 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3695 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3696 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3697 'refblock_load', 'refblock_update', 'refblock_update_part',
3698 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3699 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3700 'refblock_alloc_switch_table', 'cluster_alloc',
3701 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3702 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3703 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3704 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3705 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3706 'cor_write', 'cluster_alloc_space', 'none'] }
3711 # Kinds of I/O that blkdebug can inject errors in.
3713 # @read: .bdrv_co_preadv()
3715 # @write: .bdrv_co_pwritev()
3717 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3719 # @discard: .bdrv_co_pdiscard()
3721 # @flush: .bdrv_co_flush_to_disk()
3723 # @block-status: .bdrv_co_block_status()
3727 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3728 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3732 # @BlkdebugInjectErrorOptions:
3734 # Describes a single error injection for blkdebug.
3736 # @event: trigger event
3738 # @state: the state identifier blkdebug needs to be in to actually
3739 # trigger the event; defaults to "any"
3741 # @iotype: the type of I/O operations on which this error should be
3742 # injected; defaults to "all read, write, write-zeroes, discard,
3743 # and flush operations" (since: 4.1)
3745 # @errno: error identifier (errno) to be returned; defaults to EIO
3747 # @sector: specifies the sector index which has to be affected in
3748 # order to actually trigger the event; defaults to "any sector"
3750 # @once: disables further events after this one has been triggered;
3753 # @immediately: fail immediately; defaults to false
3757 { 'struct': 'BlkdebugInjectErrorOptions',
3758 'data': { 'event': 'BlkdebugEvent',
3760 '*iotype': 'BlkdebugIOType',
3764 '*immediately': 'bool' } }
3767 # @BlkdebugSetStateOptions:
3769 # Describes a single state-change event for blkdebug.
3771 # @event: trigger event
3773 # @state: the current state identifier blkdebug needs to be in;
3776 # @new_state: the state identifier blkdebug is supposed to assume if
3777 # this event is triggered
3781 { 'struct': 'BlkdebugSetStateOptions',
3782 'data': { 'event': 'BlkdebugEvent',
3784 'new_state': 'int' } }
3787 # @BlockdevOptionsBlkdebug:
3789 # Driver specific block device options for blkdebug.
3791 # @image: underlying raw block device (or image file)
3793 # @config: filename of the configuration file
3795 # @align: required alignment for requests in bytes, must be positive
3796 # power of 2, or 0 for default
3798 # @max-transfer: maximum size for I/O transfers in bytes, must be
3799 # positive multiple of @align and of the underlying file's request
3800 # alignment (but need not be a power of 2), or 0 for default
3803 # @opt-write-zero: preferred alignment for write zero requests in
3804 # bytes, must be positive multiple of @align and of the underlying
3805 # file's request alignment (but need not be a power of 2), or 0
3806 # for default (since 2.10)
3808 # @max-write-zero: maximum size for write zero requests in bytes, must
3809 # be positive multiple of @align, of @opt-write-zero, and of the
3810 # underlying file's request alignment (but need not be a power of
3811 # 2), or 0 for default (since 2.10)
3813 # @opt-discard: preferred alignment for discard requests in bytes,
3814 # must be positive multiple of @align and of the underlying file's
3815 # request alignment (but need not be a power of 2), or 0 for
3816 # default (since 2.10)
3818 # @max-discard: maximum size for discard requests in bytes, must be
3819 # positive multiple of @align, of @opt-discard, and of the
3820 # underlying file's request alignment (but need not be a power of
3821 # 2), or 0 for default (since 2.10)
3823 # @inject-error: array of error injection descriptions
3825 # @set-state: array of state-change descriptions
3827 # @take-child-perms: Permissions to take on @image in addition to what
3828 # is necessary anyway (which depends on how the blkdebug node is
3829 # used). Defaults to none. (since 5.0)
3831 # @unshare-child-perms: Permissions not to share on @image in addition
3832 # to what cannot be shared anyway (which depends on how the
3833 # blkdebug node is used). Defaults to none. (since 5.0)
3837 { 'struct': 'BlockdevOptionsBlkdebug',
3838 'data': { 'image': 'BlockdevRef',
3840 '*align': 'int', '*max-transfer': 'int32',
3841 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3842 '*opt-discard': 'int32', '*max-discard': 'int32',
3843 '*inject-error': ['BlkdebugInjectErrorOptions'],
3844 '*set-state': ['BlkdebugSetStateOptions'],
3845 '*take-child-perms': ['BlockPermission'],
3846 '*unshare-child-perms': ['BlockPermission'] } }
3849 # @BlockdevOptionsBlklogwrites:
3851 # Driver specific block device options for blklogwrites.
3853 # @file: block device
3855 # @log: block device used to log writes to @file
3857 # @log-sector-size: sector size used in logging writes to @file,
3858 # determines granularity of offsets and sizes of writes
3861 # @log-append: append to an existing log (default: false)
3863 # @log-super-update-interval: interval of write requests after which
3864 # the log super block is updated to disk (default: 4096)
3868 { 'struct': 'BlockdevOptionsBlklogwrites',
3869 'data': { 'file': 'BlockdevRef',
3870 'log': 'BlockdevRef',
3871 '*log-sector-size': 'uint32',
3872 '*log-append': 'bool',
3873 '*log-super-update-interval': 'uint64' } }
3876 # @BlockdevOptionsBlkverify:
3878 # Driver specific block device options for blkverify.
3880 # @test: block device to be tested
3882 # @raw: raw image used for verification
3886 { 'struct': 'BlockdevOptionsBlkverify',
3887 'data': { 'test': 'BlockdevRef',
3888 'raw': 'BlockdevRef' } }
3891 # @BlockdevOptionsBlkreplay:
3893 # Driver specific block device options for blkreplay.
3895 # @image: disk image which should be controlled with blkreplay
3899 { 'struct': 'BlockdevOptionsBlkreplay',
3900 'data': { 'image': 'BlockdevRef' } }
3903 # @QuorumReadPattern:
3905 # An enumeration of quorum read patterns.
3907 # @quorum: read all the children and do a quorum vote on reads
3909 # @fifo: read only from the first child that has not failed
3913 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3916 # @BlockdevOptionsQuorum:
3918 # Driver specific block device options for Quorum
3920 # @blkverify: true if the driver must print content mismatch set to
3923 # @children: the children block devices to use
3925 # @vote-threshold: the vote limit under which a read will fail
3927 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3930 # @read-pattern: choose read pattern and set to quorum by default
3935 { 'struct': 'BlockdevOptionsQuorum',
3936 'data': { '*blkverify': 'bool',
3937 'children': [ 'BlockdevRef' ],
3938 'vote-threshold': 'int',
3939 '*rewrite-corrupted': 'bool',
3940 '*read-pattern': 'QuorumReadPattern' } }
3943 # @BlockdevOptionsGluster:
3945 # Driver specific block device options for Gluster
3947 # @volume: name of gluster volume where VM image resides
3949 # @path: absolute path to image file in gluster volume
3951 # @server: gluster servers description
3953 # @debug: libgfapi log level (default '4' which is Error) (Since 2.8)
3955 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3959 { 'struct': 'BlockdevOptionsGluster',
3960 'data': { 'volume': 'str',
3962 'server': ['SocketAddress'],
3964 '*logfile': 'str' } }
3967 # @BlockdevOptionsIoUring:
3969 # Driver specific block device options for the io_uring backend.
3971 # @filename: path to the image file
3975 { 'struct': 'BlockdevOptionsIoUring',
3976 'data': { 'filename': 'str' },
3977 'if': 'CONFIG_BLKIO' }
3980 # @BlockdevOptionsNvmeIoUring:
3982 # Driver specific block device options for the nvme-io_uring backend.
3984 # @path: path to the NVMe namespace's character device (e.g.
3989 { 'struct': 'BlockdevOptionsNvmeIoUring',
3990 'data': { 'path': 'str' },
3991 'if': 'CONFIG_BLKIO' }
3994 # @BlockdevOptionsVirtioBlkVfioPci:
3996 # Driver specific block device options for the virtio-blk-vfio-pci
3999 # @path: path to the PCI device's sysfs directory (e.g.
4000 # /sys/bus/pci/devices/0000:00:01.0).
4004 { 'struct': 'BlockdevOptionsVirtioBlkVfioPci',
4005 'data': { 'path': 'str' },
4006 'if': 'CONFIG_BLKIO' }
4009 # @BlockdevOptionsVirtioBlkVhostUser:
4011 # Driver specific block device options for the virtio-blk-vhost-user
4014 # @path: path to the vhost-user UNIX domain socket.
4018 { 'struct': 'BlockdevOptionsVirtioBlkVhostUser',
4019 'data': { 'path': 'str' },
4020 'if': 'CONFIG_BLKIO' }
4023 # @BlockdevOptionsVirtioBlkVhostVdpa:
4025 # Driver specific block device options for the virtio-blk-vhost-vdpa
4028 # @path: path to the vhost-vdpa character device.
4031 # @fdset: Member @path supports the special "/dev/fdset/N" path
4036 { 'struct': 'BlockdevOptionsVirtioBlkVhostVdpa',
4037 'data': { 'path': 'str' },
4038 'features': [ { 'name' :'fdset',
4039 'if': 'CONFIG_BLKIO_VHOST_VDPA_FD' } ],
4040 'if': 'CONFIG_BLKIO' }
4045 # An enumeration of libiscsi transport types
4049 { 'enum': 'IscsiTransport',
4050 'data': [ 'tcp', 'iser' ] }
4053 # @IscsiHeaderDigest:
4055 # An enumeration of header digests supported by libiscsi
4059 { 'enum': 'IscsiHeaderDigest',
4060 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
4061 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
4064 # @BlockdevOptionsIscsi:
4066 # @transport: The iscsi transport type
4068 # @portal: The address of the iscsi portal
4070 # @target: The target iqn name
4072 # @lun: LUN to connect to. Defaults to 0.
4074 # @user: User name to log in with. If omitted, no CHAP authentication
4077 # @password-secret: The ID of a QCryptoSecret object providing the
4078 # password for the login. This option is required if @user is
4081 # @initiator-name: The iqn name we want to identify to the target as.
4082 # If this option is not specified, an initiator name is generated
4085 # @header-digest: The desired header digest. Defaults to none-crc32c.
4087 # @timeout: Timeout in seconds after which a request will timeout. 0
4088 # means no timeout and is the default.
4090 # Driver specific block device options for iscsi
4094 { 'struct': 'BlockdevOptionsIscsi',
4095 'data': { 'transport': 'IscsiTransport',
4100 '*password-secret': 'str',
4101 '*initiator-name': 'str',
4102 '*header-digest': 'IscsiHeaderDigest',
4103 '*timeout': 'int' } }
4110 { 'enum': 'RbdAuthMode',
4111 'data': [ 'cephx', 'none' ] }
4114 # @RbdImageEncryptionFormat:
4116 # @luks-any: Used for opening either luks or luks2 (Since 8.0)
4120 { 'enum': 'RbdImageEncryptionFormat',
4121 'data': [ 'luks', 'luks2', 'luks-any' ] }
4124 # @RbdEncryptionOptionsLUKSBase:
4126 # @key-secret: ID of a QCryptoSecret object providing a passphrase for
4127 # unlocking the encryption
4131 { 'struct': 'RbdEncryptionOptionsLUKSBase',
4132 'data': { 'key-secret': 'str' } }
4135 # @RbdEncryptionCreateOptionsLUKSBase:
4137 # @cipher-alg: The encryption algorithm
4141 { 'struct': 'RbdEncryptionCreateOptionsLUKSBase',
4142 'base': 'RbdEncryptionOptionsLUKSBase',
4143 'data': { '*cipher-alg': 'QCryptoCipherAlgorithm' } }
4146 # @RbdEncryptionOptionsLUKS:
4150 { 'struct': 'RbdEncryptionOptionsLUKS',
4151 'base': 'RbdEncryptionOptionsLUKSBase',
4155 # @RbdEncryptionOptionsLUKS2:
4159 { 'struct': 'RbdEncryptionOptionsLUKS2',
4160 'base': 'RbdEncryptionOptionsLUKSBase',
4164 # @RbdEncryptionOptionsLUKSAny:
4168 { 'struct': 'RbdEncryptionOptionsLUKSAny',
4169 'base': 'RbdEncryptionOptionsLUKSBase',
4173 # @RbdEncryptionCreateOptionsLUKS:
4177 { 'struct': 'RbdEncryptionCreateOptionsLUKS',
4178 'base': 'RbdEncryptionCreateOptionsLUKSBase',
4182 # @RbdEncryptionCreateOptionsLUKS2:
4186 { 'struct': 'RbdEncryptionCreateOptionsLUKS2',
4187 'base': 'RbdEncryptionCreateOptionsLUKSBase',
4191 # @RbdEncryptionOptions:
4193 # @format: Encryption format.
4195 # @parent: Parent image encryption options (for cloned images). Can
4196 # be left unspecified if this cloned image is encrypted using the
4197 # same format and secret as its parent image (i.e. not explicitly
4198 # formatted) or if its parent image is not encrypted. (Since 8.0)
4202 { 'union': 'RbdEncryptionOptions',
4203 'base': { 'format': 'RbdImageEncryptionFormat',
4204 '*parent': 'RbdEncryptionOptions' },
4205 'discriminator': 'format',
4206 'data': { 'luks': 'RbdEncryptionOptionsLUKS',
4207 'luks2': 'RbdEncryptionOptionsLUKS2',
4208 'luks-any': 'RbdEncryptionOptionsLUKSAny'} }
4211 # @RbdEncryptionCreateOptions:
4215 { 'union': 'RbdEncryptionCreateOptions',
4216 'base': { 'format': 'RbdImageEncryptionFormat' },
4217 'discriminator': 'format',
4218 'data': { 'luks': 'RbdEncryptionCreateOptionsLUKS',
4219 'luks2': 'RbdEncryptionCreateOptionsLUKS2' } }
4222 # @BlockdevOptionsRbd:
4224 # @pool: Ceph pool name.
4226 # @namespace: Rados namespace name in the Ceph pool. (Since 5.0)
4228 # @image: Image name in the Ceph pool.
4230 # @conf: path to Ceph configuration file. Values in the configuration
4231 # file will be overridden by options specified via QAPI.
4233 # @snapshot: Ceph snapshot name.
4235 # @encrypt: Image encryption options. (Since 6.1)
4237 # @user: Ceph id name.
4239 # @auth-client-required: Acceptable authentication modes. This maps
4240 # to Ceph configuration option "auth_client_required". (Since
4243 # @key-secret: ID of a QCryptoSecret object providing a key for cephx
4244 # authentication. This maps to Ceph configuration option "key".
4247 # @server: Monitor host address and port. This maps to the "mon_host"
4252 { 'struct': 'BlockdevOptionsRbd',
4253 'data': { 'pool': 'str',
4254 '*namespace': 'str',
4258 '*encrypt': 'RbdEncryptionOptions',
4260 '*auth-client-required': ['RbdAuthMode'],
4261 '*key-secret': 'str',
4262 '*server': ['InetSocketAddressBase'] } }
4267 # An enumeration of replication modes.
4269 # @primary: Primary mode, the vm's state will be sent to secondary
4272 # @secondary: Secondary mode, receive the vm's state from primary
4277 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
4278 'if': 'CONFIG_REPLICATION' }
4281 # @BlockdevOptionsReplication:
4283 # Driver specific block device options for replication
4285 # @mode: the replication mode
4287 # @top-id: In secondary mode, node name or device ID of the root node
4288 # who owns the replication node chain. Must not be given in
4293 { 'struct': 'BlockdevOptionsReplication',
4294 'base': 'BlockdevOptionsGenericFormat',
4295 'data': { 'mode': 'ReplicationMode',
4297 'if': 'CONFIG_REPLICATION' }
4302 # An enumeration of NFS transport types
4304 # @inet: TCP transport
4308 { 'enum': 'NFSTransport',
4309 'data': [ 'inet' ] }
4314 # Captures the address of the socket
4316 # @type: transport type used for NFS (only TCP supported)
4318 # @host: host address for NFS server
4322 { 'struct': 'NFSServer',
4323 'data': { 'type': 'NFSTransport',
4327 # @BlockdevOptionsNfs:
4329 # Driver specific block device option for NFS
4331 # @server: host address
4333 # @path: path of the image on the host
4335 # @user: UID value to use when talking to the server (defaults to
4336 # 65534 on Windows and getuid() on unix)
4338 # @group: GID value to use when talking to the server (defaults to
4339 # 65534 on Windows and getgid() in unix)
4341 # @tcp-syn-count: number of SYNs during the session establishment
4342 # (defaults to libnfs default)
4344 # @readahead-size: set the readahead size in bytes (defaults to libnfs
4347 # @page-cache-size: set the pagecache size in bytes (defaults to
4350 # @debug: set the NFS debug level (max 2) (defaults to libnfs default)
4354 { 'struct': 'BlockdevOptionsNfs',
4355 'data': { 'server': 'NFSServer',
4359 '*tcp-syn-count': 'int',
4360 '*readahead-size': 'int',
4361 '*page-cache-size': 'int',
4365 # @BlockdevOptionsCurlBase:
4367 # Driver specific block device options shared by all protocols
4368 # supported by the curl backend.
4370 # @url: URL of the image file
4372 # @readahead: Size of the read-ahead cache; must be a multiple of 512
4373 # (defaults to 256 kB)
4375 # @timeout: Timeout for connections, in seconds (defaults to 5)
4377 # @username: Username for authentication (defaults to none)
4379 # @password-secret: ID of a QCryptoSecret object providing a password
4380 # for authentication (defaults to no password)
4382 # @proxy-username: Username for proxy authentication (defaults to
4385 # @proxy-password-secret: ID of a QCryptoSecret object providing a
4386 # password for proxy authentication (defaults to no password)
4390 { 'struct': 'BlockdevOptionsCurlBase',
4391 'data': { 'url': 'str',
4392 '*readahead': 'int',
4395 '*password-secret': 'str',
4396 '*proxy-username': 'str',
4397 '*proxy-password-secret': 'str' } }
4400 # @BlockdevOptionsCurlHttp:
4402 # Driver specific block device options for HTTP connections over the
4403 # curl backend. URLs must start with "http://".
4405 # @cookie: List of cookies to set; format is "name1=content1;
4406 # name2=content2;" as explained by CURLOPT_COOKIE(3). Defaults to
4409 # @cookie-secret: ID of a QCryptoSecret object providing the cookie
4410 # data in a secure way. See @cookie for the format. (since 2.10)
4414 { 'struct': 'BlockdevOptionsCurlHttp',
4415 'base': 'BlockdevOptionsCurlBase',
4416 'data': { '*cookie': 'str',
4417 '*cookie-secret': 'str'} }
4420 # @BlockdevOptionsCurlHttps:
4422 # Driver specific block device options for HTTPS connections over the
4423 # curl backend. URLs must start with "https://".
4425 # @cookie: List of cookies to set; format is "name1=content1;
4426 # name2=content2;" as explained by CURLOPT_COOKIE(3). Defaults to
4429 # @sslverify: Whether to verify the SSL certificate's validity
4430 # (defaults to true)
4432 # @cookie-secret: ID of a QCryptoSecret object providing the cookie
4433 # data in a secure way. See @cookie for the format. (since 2.10)
4437 { 'struct': 'BlockdevOptionsCurlHttps',
4438 'base': 'BlockdevOptionsCurlBase',
4439 'data': { '*cookie': 'str',
4440 '*sslverify': 'bool',
4441 '*cookie-secret': 'str'} }
4444 # @BlockdevOptionsCurlFtp:
4446 # Driver specific block device options for FTP connections over the
4447 # curl backend. URLs must start with "ftp://".
4451 { 'struct': 'BlockdevOptionsCurlFtp',
4452 'base': 'BlockdevOptionsCurlBase',
4456 # @BlockdevOptionsCurlFtps:
4458 # Driver specific block device options for FTPS connections over the
4459 # curl backend. URLs must start with "ftps://".
4461 # @sslverify: Whether to verify the SSL certificate's validity
4462 # (defaults to true)
4466 { 'struct': 'BlockdevOptionsCurlFtps',
4467 'base': 'BlockdevOptionsCurlBase',
4468 'data': { '*sslverify': 'bool' } }
4471 # @BlockdevOptionsNbd:
4473 # Driver specific block device options for NBD.
4475 # @server: NBD server address
4477 # @export: export name
4479 # @tls-creds: TLS credentials ID
4481 # @tls-hostname: TLS hostname override for certificate validation
4484 # @x-dirty-bitmap: A metadata context name such as
4485 # "qemu:dirty-bitmap:NAME" or "qemu:allocation-depth" to query in
4486 # place of the traditional "base:allocation" block status (see
4487 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol; and yes, naming
4488 # this option x-context would have made more sense) (since 3.0)
4490 # @reconnect-delay: On an unexpected disconnect, the nbd client tries
4491 # to connect again until succeeding or encountering a serious
4492 # error. During the first @reconnect-delay seconds, all requests
4493 # are paused and will be rerun on a successful reconnect. After
4494 # that time, any delayed requests and all future requests before a
4495 # successful reconnect will immediately fail. Default 0 (Since
4498 # @open-timeout: In seconds. If zero, the nbd driver tries the
4499 # connection only once, and fails to open if the connection fails.
4500 # If non-zero, the nbd driver will repeat connection attempts
4501 # until successful or until @open-timeout seconds have elapsed.
4502 # Default 0 (Since 7.0)
4506 # @unstable: Member @x-dirty-bitmap is experimental.
4510 { 'struct': 'BlockdevOptionsNbd',
4511 'data': { 'server': 'SocketAddress',
4513 '*tls-creds': 'str',
4514 '*tls-hostname': 'str',
4515 '*x-dirty-bitmap': { 'type': 'str', 'features': [ 'unstable' ] },
4516 '*reconnect-delay': 'uint32',
4517 '*open-timeout': 'uint32' } }
4520 # @BlockdevOptionsRaw:
4522 # Driver specific block device options for the raw driver.
4524 # @offset: position where the block device starts
4526 # @size: the assumed size of the device
4530 { 'struct': 'BlockdevOptionsRaw',
4531 'base': 'BlockdevOptionsGenericFormat',
4532 'data': { '*offset': 'int', '*size': 'int' } }
4535 # @BlockdevOptionsThrottle:
4537 # Driver specific block device options for the throttle driver
4539 # @throttle-group: the name of the throttle-group object to use. It
4540 # must already exist.
4542 # @file: reference to or definition of the data source block device
4546 { 'struct': 'BlockdevOptionsThrottle',
4547 'data': { 'throttle-group': 'str',
4548 'file' : 'BlockdevRef'
4552 # @BlockdevOptionsCor:
4554 # Driver specific block device options for the copy-on-read driver.
4556 # @bottom: The name of a non-filter node (allocation-bearing layer)
4557 # that limits the COR operations in the backing chain (inclusive),
4558 # so that no data below this node will be copied by this filter.
4559 # If option is absent, the limit is not applied, so that data from
4560 # all backing layers may be copied.
4564 { 'struct': 'BlockdevOptionsCor',
4565 'base': 'BlockdevOptionsGenericFormat',
4566 'data': { '*bottom': 'str' } }
4571 # An enumeration of possible behaviors for copy-before-write operation
4574 # @break-guest-write: report the error to the guest. This way, the
4575 # guest will not be able to overwrite areas that cannot be backed
4576 # up, so the backup process remains valid.
4578 # @break-snapshot: continue guest write. Doing so will make the
4579 # provided snapshot state invalid and any backup or export process
4580 # based on it will finally fail.
4584 { 'enum': 'OnCbwError',
4585 'data': [ 'break-guest-write', 'break-snapshot' ] }
4588 # @BlockdevOptionsCbw:
4590 # Driver specific block device options for the copy-before-write
4591 # driver, which does so called copy-before-write operations: when data
4592 # is written to the filter, the filter first reads corresponding
4593 # blocks from its file child and copies them to @target child. After
4594 # successfully copying, the write request is propagated to file child.
4595 # If copying fails, the original write request is failed too and no
4596 # data is written to file child.
4598 # @target: The target for copy-before-write operations.
4600 # @bitmap: If specified, copy-before-write filter will do
4601 # copy-before-write operations only for dirty regions of the
4602 # bitmap. Bitmap size must be equal to length of file and target
4603 # child of the filter. Note also, that bitmap is used only to
4604 # initialize internal bitmap of the process, so further
4605 # modifications (or removing) of specified bitmap doesn't
4606 # influence the filter. (Since 7.0)
4608 # @on-cbw-error: Behavior on failure of copy-before-write operation.
4609 # Default is @break-guest-write. (Since 7.1)
4611 # @cbw-timeout: Zero means no limit. Non-zero sets the timeout in
4612 # seconds for copy-before-write operation. When a timeout occurs,
4613 # the respective copy-before-write operation will fail, and the
4614 # @on-cbw-error parameter will decide how this failure is handled.
4615 # Default 0. (Since 7.1)
4619 { 'struct': 'BlockdevOptionsCbw',
4620 'base': 'BlockdevOptionsGenericFormat',
4621 'data': { 'target': 'BlockdevRef', '*bitmap': 'BlockDirtyBitmap',
4622 '*on-cbw-error': 'OnCbwError', '*cbw-timeout': 'uint32' } }
4627 # Options for creating a block device. Many options are available for
4628 # all block devices, independent of the block driver:
4630 # @driver: block driver name
4632 # @node-name: the node name of the new node (Since 2.0). This option
4633 # is required on the top level of blockdev-add. Valid node names
4634 # start with an alphabetic character and may contain only
4635 # alphanumeric characters, '-', '.' and '_'. Their maximum length
4638 # @discard: discard-related options (default: ignore)
4640 # @cache: cache-related options
4642 # @read-only: whether the block device should be read-only (default:
4643 # false). Note that some block drivers support only read-only
4644 # access, either generally or in certain configurations. In this
4645 # case, the default value does not work and the option must be
4646 # specified explicitly.
4648 # @auto-read-only: if true and @read-only is false, QEMU may
4649 # automatically decide not to open the image read-write as
4650 # requested, but fall back to read-only instead (and switch
4651 # between the modes later), e.g. depending on whether the image
4652 # file is writable or whether a writing user is attached to the
4653 # node (default: false, since 3.1)
4655 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
4658 # @force-share: force share all permission on added nodes. Requires
4659 # read-only=true. (Since 2.10)
4661 # Remaining options are determined by the block driver.
4665 { 'union': 'BlockdevOptions',
4666 'base': { 'driver': 'BlockdevDriver',
4667 '*node-name': 'str',
4668 '*discard': 'BlockdevDiscardOptions',
4669 '*cache': 'BlockdevCacheOptions',
4670 '*read-only': 'bool',
4671 '*auto-read-only': 'bool',
4672 '*force-share': 'bool',
4673 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
4674 'discriminator': 'driver',
4676 'blkdebug': 'BlockdevOptionsBlkdebug',
4677 'blklogwrites':'BlockdevOptionsBlklogwrites',
4678 'blkverify': 'BlockdevOptionsBlkverify',
4679 'blkreplay': 'BlockdevOptionsBlkreplay',
4680 'bochs': 'BlockdevOptionsGenericFormat',
4681 'cloop': 'BlockdevOptionsGenericFormat',
4682 'compress': 'BlockdevOptionsGenericFormat',
4683 'copy-before-write':'BlockdevOptionsCbw',
4684 'copy-on-read':'BlockdevOptionsCor',
4685 'dmg': 'BlockdevOptionsGenericFormat',
4686 'file': 'BlockdevOptionsFile',
4687 'ftp': 'BlockdevOptionsCurlFtp',
4688 'ftps': 'BlockdevOptionsCurlFtps',
4689 'gluster': 'BlockdevOptionsGluster',
4690 'host_cdrom': { 'type': 'BlockdevOptionsFile',
4691 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4692 'host_device': { 'type': 'BlockdevOptionsFile',
4693 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4694 'http': 'BlockdevOptionsCurlHttp',
4695 'https': 'BlockdevOptionsCurlHttps',
4696 'io_uring': { 'type': 'BlockdevOptionsIoUring',
4697 'if': 'CONFIG_BLKIO' },
4698 'iscsi': 'BlockdevOptionsIscsi',
4699 'luks': 'BlockdevOptionsLUKS',
4700 'nbd': 'BlockdevOptionsNbd',
4701 'nfs': 'BlockdevOptionsNfs',
4702 'null-aio': 'BlockdevOptionsNull',
4703 'null-co': 'BlockdevOptionsNull',
4704 'nvme': 'BlockdevOptionsNVMe',
4705 'nvme-io_uring': { 'type': 'BlockdevOptionsNvmeIoUring',
4706 'if': 'CONFIG_BLKIO' },
4707 'parallels': 'BlockdevOptionsGenericFormat',
4708 'preallocate':'BlockdevOptionsPreallocate',
4709 'qcow2': 'BlockdevOptionsQcow2',
4710 'qcow': 'BlockdevOptionsQcow',
4711 'qed': 'BlockdevOptionsGenericCOWFormat',
4712 'quorum': 'BlockdevOptionsQuorum',
4713 'raw': 'BlockdevOptionsRaw',
4714 'rbd': 'BlockdevOptionsRbd',
4715 'replication': { 'type': 'BlockdevOptionsReplication',
4716 'if': 'CONFIG_REPLICATION' },
4717 'snapshot-access': 'BlockdevOptionsGenericFormat',
4718 'ssh': 'BlockdevOptionsSsh',
4719 'throttle': 'BlockdevOptionsThrottle',
4720 'vdi': 'BlockdevOptionsGenericFormat',
4721 'vhdx': 'BlockdevOptionsGenericFormat',
4722 'virtio-blk-vfio-pci':
4723 { 'type': 'BlockdevOptionsVirtioBlkVfioPci',
4724 'if': 'CONFIG_BLKIO' },
4725 'virtio-blk-vhost-user':
4726 { 'type': 'BlockdevOptionsVirtioBlkVhostUser',
4727 'if': 'CONFIG_BLKIO' },
4728 'virtio-blk-vhost-vdpa':
4729 { 'type': 'BlockdevOptionsVirtioBlkVhostVdpa',
4730 'if': 'CONFIG_BLKIO' },
4731 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4732 'vpc': 'BlockdevOptionsGenericFormat',
4733 'vvfat': 'BlockdevOptionsVVFAT'
4739 # Reference to a block device.
4741 # @definition: defines a new block device inline
4743 # @reference: references the ID of an existing block device
4747 { 'alternate': 'BlockdevRef',
4748 'data': { 'definition': 'BlockdevOptions',
4749 'reference': 'str' } }
4752 # @BlockdevRefOrNull:
4754 # Reference to a block device.
4756 # @definition: defines a new block device inline
4758 # @reference: references the ID of an existing block device. An empty
4759 # string means that no block device should be referenced.
4760 # Deprecated; use null instead.
4762 # @null: No block device should be referenced (since 2.10)
4766 { 'alternate': 'BlockdevRefOrNull',
4767 'data': { 'definition': 'BlockdevOptions',
4774 # Creates a new block device.
4780 # -> { "execute": "blockdev-add",
4782 # "driver": "qcow2",
4783 # "node-name": "test1",
4786 # "filename": "test.qcow2"
4790 # <- { "return": {} }
4792 # -> { "execute": "blockdev-add",
4794 # "driver": "qcow2",
4795 # "node-name": "node0",
4796 # "discard": "unmap",
4802 # "filename": "/tmp/test.qcow2"
4808 # "filename": "/dev/fdset/4"
4814 # <- { "return": {} }
4816 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true,
4817 'allow-preconfig': true }
4822 # Reopens one or more block devices using the given set of options.
4823 # Any option not specified will be reset to its default value
4824 # regardless of its previous status. If an option cannot be changed
4825 # or a particular driver does not support reopening then the command
4826 # will return an error. All devices in the list are reopened in one
4827 # transaction, so if one of them fails then the whole transaction is
4830 # The command receives a list of block devices to reopen. For each
4831 # one of them, the top-level @node-name option (from BlockdevOptions)
4832 # must be specified and is used to select the block device to be
4833 # reopened. Other @node-name options must be either omitted or set to
4834 # the current name of the appropriate node. This command won't change
4835 # any node name and any attempt to do it will result in an error.
4837 # In the case of options that refer to child nodes, the behavior of
4838 # this command depends on the value:
4840 # 1) A set of options (BlockdevOptions): the child is reopened with
4841 # the specified set of options.
4843 # 2) A reference to the current child: the child is reopened using
4844 # its existing set of options.
4846 # 3) A reference to a different node: the current child is replaced
4847 # with the specified one.
4849 # 4) NULL: the current child (if any) is detached.
4851 # Options (1) and (2) are supported in all cases. Option (3) is
4852 # supported for @file and @backing, and option (4) for @backing only.
4854 # Unlike with blockdev-add, the @backing option must always be present
4855 # unless the node being reopened does not have a backing file and its
4856 # image does not have a default backing file name as part of its
4861 { 'command': 'blockdev-reopen',
4862 'data': { 'options': ['BlockdevOptions'] },
4863 'allow-preconfig': true }
4868 # Deletes a block device that has been added using blockdev-add. The
4869 # command will fail if the node is attached to a device or is
4870 # otherwise being used.
4872 # @node-name: Name of the graph node to delete.
4878 # -> { "execute": "blockdev-add",
4880 # "driver": "qcow2",
4881 # "node-name": "node0",
4884 # "filename": "test.qcow2"
4888 # <- { "return": {} }
4890 # -> { "execute": "blockdev-del",
4891 # "arguments": { "node-name": "node0" }
4893 # <- { "return": {} }
4895 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' },
4896 'allow-preconfig': true }
4899 # @BlockdevCreateOptionsFile:
4901 # Driver specific image creation options for file.
4903 # @filename: Filename for the new image file
4905 # @size: Size of the virtual disk in bytes
4907 # @preallocation: Preallocation mode for the new image (default: off;
4908 # allowed values: off, falloc (if CONFIG_POSIX_FALLOCATE), full
4909 # (if CONFIG_POSIX))
4911 # @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
4913 # @extent-size-hint: Extent size hint to add to the image file; 0 for
4914 # not adding an extent size hint (default: 1 MB, since 5.1)
4918 { 'struct': 'BlockdevCreateOptionsFile',
4919 'data': { 'filename': 'str',
4921 '*preallocation': 'PreallocMode',
4923 '*extent-size-hint': 'size'} }
4926 # @BlockdevCreateOptionsGluster:
4928 # Driver specific image creation options for gluster.
4930 # @location: Where to store the new image file
4932 # @size: Size of the virtual disk in bytes
4934 # @preallocation: Preallocation mode for the new image (default: off;
4935 # allowed values: off, falloc (if CONFIG_GLUSTERFS_FALLOCATE),
4936 # full (if CONFIG_GLUSTERFS_ZEROFILL))
4940 { 'struct': 'BlockdevCreateOptionsGluster',
4941 'data': { 'location': 'BlockdevOptionsGluster',
4943 '*preallocation': 'PreallocMode' } }
4946 # @BlockdevCreateOptionsLUKS:
4948 # Driver specific image creation options for LUKS.
4950 # @file: Node to create the image format on
4952 # @size: Size of the virtual disk in bytes
4954 # @preallocation: Preallocation mode for the new image (since: 4.2)
4955 # (default: off; allowed values: off, metadata, falloc, full)
4959 { 'struct': 'BlockdevCreateOptionsLUKS',
4960 'base': 'QCryptoBlockCreateOptionsLUKS',
4961 'data': { 'file': 'BlockdevRef',
4963 '*preallocation': 'PreallocMode' } }
4966 # @BlockdevCreateOptionsNfs:
4968 # Driver specific image creation options for NFS.
4970 # @location: Where to store the new image file
4972 # @size: Size of the virtual disk in bytes
4976 { 'struct': 'BlockdevCreateOptionsNfs',
4977 'data': { 'location': 'BlockdevOptionsNfs',
4981 # @BlockdevCreateOptionsParallels:
4983 # Driver specific image creation options for parallels.
4985 # @file: Node to create the image format on
4987 # @size: Size of the virtual disk in bytes
4989 # @cluster-size: Cluster size in bytes (default: 1 MB)
4993 { 'struct': 'BlockdevCreateOptionsParallels',
4994 'data': { 'file': 'BlockdevRef',
4996 '*cluster-size': 'size' } }
4999 # @BlockdevCreateOptionsQcow:
5001 # Driver specific image creation options for qcow.
5003 # @file: Node to create the image format on
5005 # @size: Size of the virtual disk in bytes
5007 # @backing-file: File name of the backing file if a backing file
5010 # @encrypt: Encryption options if the image should be encrypted
5014 { 'struct': 'BlockdevCreateOptionsQcow',
5015 'data': { 'file': 'BlockdevRef',
5017 '*backing-file': 'str',
5018 '*encrypt': 'QCryptoBlockCreateOptions' } }
5021 # @BlockdevQcow2Version:
5023 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version
5026 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
5030 { 'enum': 'BlockdevQcow2Version',
5031 'data': [ 'v2', 'v3' ] }
5034 # @Qcow2CompressionType:
5036 # Compression type used in qcow2 image file
5038 # @zlib: zlib compression, see <http://zlib.net/>
5040 # @zstd: zstd compression, see <http://github.com/facebook/zstd>
5044 { 'enum': 'Qcow2CompressionType',
5045 'data': [ 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
5048 # @BlockdevCreateOptionsQcow2:
5050 # Driver specific image creation options for qcow2.
5052 # @file: Node to create the image format on
5054 # @data-file: Node to use as an external data file in which all guest
5055 # data is stored so that only metadata remains in the qcow2 file
5058 # @data-file-raw: True if the external data file must stay valid as a
5059 # standalone (read-only) raw image without looking at qcow2
5060 # metadata (default: false; since: 4.0)
5062 # @extended-l2: True to make the image have extended L2 entries
5063 # (default: false; since 5.2)
5065 # @size: Size of the virtual disk in bytes
5067 # @version: Compatibility level (default: v3)
5069 # @backing-file: File name of the backing file if a backing file
5072 # @backing-fmt: Name of the block driver to use for the backing file
5074 # @encrypt: Encryption options if the image should be encrypted
5076 # @cluster-size: qcow2 cluster size in bytes (default: 65536)
5078 # @preallocation: Preallocation mode for the new image (default: off;
5079 # allowed values: off, falloc, full, metadata)
5081 # @lazy-refcounts: True if refcounts may be updated lazily
5084 # @refcount-bits: Width of reference counts in bits (default: 16)
5086 # @compression-type: The image cluster compression method
5087 # (default: zlib, since 5.1)
5091 { 'struct': 'BlockdevCreateOptionsQcow2',
5092 'data': { 'file': 'BlockdevRef',
5093 '*data-file': 'BlockdevRef',
5094 '*data-file-raw': 'bool',
5095 '*extended-l2': 'bool',
5097 '*version': 'BlockdevQcow2Version',
5098 '*backing-file': 'str',
5099 '*backing-fmt': 'BlockdevDriver',
5100 '*encrypt': 'QCryptoBlockCreateOptions',
5101 '*cluster-size': 'size',
5102 '*preallocation': 'PreallocMode',
5103 '*lazy-refcounts': 'bool',
5104 '*refcount-bits': 'int',
5105 '*compression-type':'Qcow2CompressionType' } }
5108 # @BlockdevCreateOptionsQed:
5110 # Driver specific image creation options for qed.
5112 # @file: Node to create the image format on
5114 # @size: Size of the virtual disk in bytes
5116 # @backing-file: File name of the backing file if a backing file
5119 # @backing-fmt: Name of the block driver to use for the backing file
5121 # @cluster-size: Cluster size in bytes (default: 65536)
5123 # @table-size: L1/L2 table size (in clusters)
5127 { 'struct': 'BlockdevCreateOptionsQed',
5128 'data': { 'file': 'BlockdevRef',
5130 '*backing-file': 'str',
5131 '*backing-fmt': 'BlockdevDriver',
5132 '*cluster-size': 'size',
5133 '*table-size': 'int' } }
5136 # @BlockdevCreateOptionsRbd:
5138 # Driver specific image creation options for rbd/Ceph.
5140 # @location: Where to store the new image file. This location cannot
5141 # point to a snapshot.
5143 # @size: Size of the virtual disk in bytes
5145 # @cluster-size: RBD object size
5147 # @encrypt: Image encryption options. (Since 6.1)
5151 { 'struct': 'BlockdevCreateOptionsRbd',
5152 'data': { 'location': 'BlockdevOptionsRbd',
5154 '*cluster-size' : 'size',
5155 '*encrypt' : 'RbdEncryptionCreateOptions' } }
5158 # @BlockdevVmdkSubformat:
5160 # Subformat options for VMDK images
5162 # @monolithicSparse: Single file image with sparse cluster allocation
5164 # @monolithicFlat: Single flat data image and a descriptor file
5166 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA)
5167 # sparse extent files, in addition to a descriptor file
5169 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat
5170 # extent files, in addition to a descriptor file
5172 # @streamOptimized: Single file image sparse cluster allocation,
5173 # optimized for streaming over network.
5177 { 'enum': 'BlockdevVmdkSubformat',
5178 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
5179 'twoGbMaxExtentFlat', 'streamOptimized'] }
5182 # @BlockdevVmdkAdapterType:
5184 # Adapter type info for VMDK images
5188 { 'enum': 'BlockdevVmdkAdapterType',
5189 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
5192 # @BlockdevCreateOptionsVmdk:
5194 # Driver specific image creation options for VMDK.
5196 # @file: Where to store the new image file. This refers to the image
5197 # file for monolithcSparse and streamOptimized format, or the
5198 # descriptor file for other formats.
5200 # @size: Size of the virtual disk in bytes
5202 # @extents: Where to store the data extents. Required for
5203 # monolithcFlat, twoGbMaxExtentSparse and twoGbMaxExtentFlat
5204 # formats. For monolithicFlat, only one entry is required; for
5205 # twoGbMaxExtent* formats, the number of entries required is
5206 # calculated as extent_number = virtual_size / 2GB. Providing more
5207 # extents than will be used is an error.
5209 # @subformat: The subformat of the VMDK image. Default:
5210 # "monolithicSparse".
5212 # @backing-file: The path of backing file. Default: no backing file
5215 # @adapter-type: The adapter type used to fill in the descriptor.
5218 # @hwversion: Hardware version. The meaningful options are "4" or
5219 # "6". Default: "4".
5221 # @toolsversion: VMware guest tools version. Default: "2147483647"
5224 # @zeroed-grain: Whether to enable zeroed-grain feature for sparse
5225 # subformats. Default: false.
5229 { 'struct': 'BlockdevCreateOptionsVmdk',
5230 'data': { 'file': 'BlockdevRef',
5232 '*extents': ['BlockdevRef'],
5233 '*subformat': 'BlockdevVmdkSubformat',
5234 '*backing-file': 'str',
5235 '*adapter-type': 'BlockdevVmdkAdapterType',
5236 '*hwversion': 'str',
5237 '*toolsversion': 'str',
5238 '*zeroed-grain': 'bool' } }
5241 # @BlockdevCreateOptionsSsh:
5243 # Driver specific image creation options for SSH.
5245 # @location: Where to store the new image file
5247 # @size: Size of the virtual disk in bytes
5251 { 'struct': 'BlockdevCreateOptionsSsh',
5252 'data': { 'location': 'BlockdevOptionsSsh',
5256 # @BlockdevCreateOptionsVdi:
5258 # Driver specific image creation options for VDI.
5260 # @file: Node to create the image format on
5262 # @size: Size of the virtual disk in bytes
5264 # @preallocation: Preallocation mode for the new image (default: off;
5265 # allowed values: off, metadata)
5269 { 'struct': 'BlockdevCreateOptionsVdi',
5270 'data': { 'file': 'BlockdevRef',
5272 '*preallocation': 'PreallocMode' } }
5275 # @BlockdevVhdxSubformat:
5277 # @dynamic: Growing image file
5279 # @fixed: Preallocated fixed-size image file
5283 { 'enum': 'BlockdevVhdxSubformat',
5284 'data': [ 'dynamic', 'fixed' ] }
5287 # @BlockdevCreateOptionsVhdx:
5289 # Driver specific image creation options for vhdx.
5291 # @file: Node to create the image format on
5293 # @size: Size of the virtual disk in bytes
5295 # @log-size: Log size in bytes, must be a multiple of 1 MB (default: 1
5298 # @block-size: Block size in bytes, must be a multiple of 1 MB and not
5299 # larger than 256 MB (default: automatically choose a block size
5300 # depending on the image size)
5302 # @subformat: vhdx subformat (default: dynamic)
5304 # @block-state-zero: Force use of payload blocks of type 'ZERO'.
5305 # Non-standard, but default. Do not set to 'off' when using
5306 # 'qemu-img convert' with subformat=dynamic.
5310 { 'struct': 'BlockdevCreateOptionsVhdx',
5311 'data': { 'file': 'BlockdevRef',
5313 '*log-size': 'size',
5314 '*block-size': 'size',
5315 '*subformat': 'BlockdevVhdxSubformat',
5316 '*block-state-zero': 'bool' } }
5319 # @BlockdevVpcSubformat:
5321 # @dynamic: Growing image file
5323 # @fixed: Preallocated fixed-size image file
5327 { 'enum': 'BlockdevVpcSubformat',
5328 'data': [ 'dynamic', 'fixed' ] }
5331 # @BlockdevCreateOptionsVpc:
5333 # Driver specific image creation options for vpc (VHD).
5335 # @file: Node to create the image format on
5337 # @size: Size of the virtual disk in bytes
5339 # @subformat: vhdx subformat (default: dynamic)
5341 # @force-size: Force use of the exact byte size instead of rounding to
5342 # the next size that can be represented in CHS geometry
5347 { 'struct': 'BlockdevCreateOptionsVpc',
5348 'data': { 'file': 'BlockdevRef',
5350 '*subformat': 'BlockdevVpcSubformat',
5351 '*force-size': 'bool' } }
5354 # @BlockdevCreateOptions:
5356 # Options for creating an image format on a given node.
5358 # @driver: block driver to create the image format
5362 { 'union': 'BlockdevCreateOptions',
5364 'driver': 'BlockdevDriver' },
5365 'discriminator': 'driver',
5367 'file': 'BlockdevCreateOptionsFile',
5368 'gluster': 'BlockdevCreateOptionsGluster',
5369 'luks': 'BlockdevCreateOptionsLUKS',
5370 'nfs': 'BlockdevCreateOptionsNfs',
5371 'parallels': 'BlockdevCreateOptionsParallels',
5372 'qcow': 'BlockdevCreateOptionsQcow',
5373 'qcow2': 'BlockdevCreateOptionsQcow2',
5374 'qed': 'BlockdevCreateOptionsQed',
5375 'rbd': 'BlockdevCreateOptionsRbd',
5376 'ssh': 'BlockdevCreateOptionsSsh',
5377 'vdi': 'BlockdevCreateOptionsVdi',
5378 'vhdx': 'BlockdevCreateOptionsVhdx',
5379 'vmdk': 'BlockdevCreateOptionsVmdk',
5380 'vpc': 'BlockdevCreateOptionsVpc'
5386 # Starts a job to create an image format on a given node. The job is
5387 # automatically finalized, but a manual job-dismiss is required.
5389 # @job-id: Identifier for the newly created job.
5391 # @options: Options for the image creation.
5395 { 'command': 'blockdev-create',
5396 'data': { 'job-id': 'str',
5397 'options': 'BlockdevCreateOptions' },
5398 'allow-preconfig': true }
5401 # @BlockdevAmendOptionsLUKS:
5403 # Driver specific image amend options for LUKS.
5407 { 'struct': 'BlockdevAmendOptionsLUKS',
5408 'base': 'QCryptoBlockAmendOptionsLUKS',
5413 # @BlockdevAmendOptionsQcow2:
5415 # Driver specific image amend options for qcow2. For now, only
5416 # encryption options can be amended
5418 # @encrypt: Encryption options to be amended
5422 { 'struct': 'BlockdevAmendOptionsQcow2',
5423 'data': { '*encrypt': 'QCryptoBlockAmendOptions' } }
5426 # @BlockdevAmendOptions:
5428 # Options for amending an image format
5430 # @driver: Block driver of the node to amend.
5434 { 'union': 'BlockdevAmendOptions',
5436 'driver': 'BlockdevDriver' },
5437 'discriminator': 'driver',
5439 'luks': 'BlockdevAmendOptionsLUKS',
5440 'qcow2': 'BlockdevAmendOptionsQcow2' } }
5443 # @x-blockdev-amend:
5445 # Starts a job to amend format specific options of an existing open
5446 # block device The job is automatically finalized, but a manual
5447 # job-dismiss is required.
5449 # @job-id: Identifier for the newly created job.
5451 # @node-name: Name of the block node to work on
5453 # @options: Options (driver specific)
5455 # @force: Allow unsafe operations, format specific For luks that
5456 # allows erase of the last active keyslot (permanent loss of
5457 # data), and replacement of an active keyslot (possible loss of
5458 # data if IO error happens)
5462 # @unstable: This command is experimental.
5466 { 'command': 'x-blockdev-amend',
5467 'data': { 'job-id': 'str',
5469 'options': 'BlockdevAmendOptions',
5471 'features': [ 'unstable' ],
5472 'allow-preconfig': true }
5475 # @BlockErrorAction:
5477 # An enumeration of action that has been taken when a DISK I/O occurs
5479 # @ignore: error has been ignored
5481 # @report: error has been reported to the device
5483 # @stop: error caused VM to be stopped
5487 { 'enum': 'BlockErrorAction',
5488 'data': [ 'ignore', 'report', 'stop' ] }
5491 # @BLOCK_IMAGE_CORRUPTED:
5493 # Emitted when a disk image is being marked corrupt. The image can be
5494 # identified by its device or node name. The 'device' field is always
5495 # present for compatibility reasons, but it can be empty ("") if the
5496 # image does not have a device name associated.
5498 # @device: device name. This is always present for compatibility
5499 # reasons, but it can be empty ("") if the image does not have a
5500 # device name associated.
5502 # @node-name: node name (Since: 2.4)
5504 # @msg: informative message for human consumption, such as the kind of
5505 # corruption being detected. It should not be parsed by machine
5506 # as it is not guaranteed to be stable
5508 # @offset: if the corruption resulted from an image access, this is
5509 # the host's access offset into the image
5511 # @size: if the corruption resulted from an image access, this is the
5514 # @fatal: if set, the image is marked corrupt and therefore unusable
5515 # after this event and must be repaired (Since 2.2; before, every
5516 # BLOCK_IMAGE_CORRUPTED event was fatal)
5518 # Note: If action is "stop", a STOP event will eventually follow the
5519 # BLOCK_IO_ERROR event.
5523 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
5524 # "data": { "device": "", "node-name": "drive", "fatal": false,
5525 # "msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)" },
5526 # "timestamp": { "seconds": 1648243240, "microseconds": 906060 } }
5530 { 'event': 'BLOCK_IMAGE_CORRUPTED',
5531 'data': { 'device' : 'str',
5532 '*node-name' : 'str',
5536 'fatal' : 'bool' } }
5541 # Emitted when a disk I/O error occurs
5543 # @device: device name. This is always present for compatibility
5544 # reasons, but it can be empty ("") if the image does not have a
5545 # device name associated.
5547 # @node-name: node name. Note that errors may be reported for the
5548 # root node that is directly attached to a guest device rather
5549 # than for the node where the error occurred. The node name is
5550 # not present if the drive is empty. (Since: 2.8)
5552 # @operation: I/O operation
5554 # @action: action that has been taken
5556 # @nospace: true if I/O error was caused due to a no-space condition.
5557 # This key is only present if query-block's io-status is present,
5558 # please see query-block documentation for more information
5561 # @reason: human readable string describing the error cause. (This
5562 # field is a debugging aid for humans, it should not be parsed by
5563 # applications) (since: 2.2)
5565 # Note: If action is "stop", a STOP event will eventually follow the
5566 # BLOCK_IO_ERROR event
5572 # <- { "event": "BLOCK_IO_ERROR",
5573 # "data": { "device": "ide0-hd1",
5574 # "node-name": "#block212",
5575 # "operation": "write",
5577 # "reason": "No space left on device" },
5578 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5580 { 'event': 'BLOCK_IO_ERROR',
5581 'data': { 'device': 'str', '*node-name': 'str',
5582 'operation': 'IoOperationType',
5583 'action': 'BlockErrorAction', '*nospace': 'bool',
5587 # @BLOCK_JOB_COMPLETED:
5589 # Emitted when a block job has completed
5593 # @device: The job identifier. Originally the device name but other
5594 # values are allowed since QEMU 2.7
5596 # @len: maximum progress value
5598 # @offset: current progress value. On success this is equal to len.
5599 # On failure this is less than len
5601 # @speed: rate limit, bytes per second
5603 # @error: error message. Only present on failure. This field
5604 # contains a human-readable error message. There are no semantics
5605 # other than that streaming has failed and clients should not try
5606 # to interpret the error string
5612 # <- { "event": "BLOCK_JOB_COMPLETED",
5613 # "data": { "type": "stream", "device": "virtio-disk0",
5614 # "len": 10737418240, "offset": 10737418240,
5616 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5618 { 'event': 'BLOCK_JOB_COMPLETED',
5619 'data': { 'type' : 'JobType',
5627 # @BLOCK_JOB_CANCELLED:
5629 # Emitted when a block job has been cancelled
5633 # @device: The job identifier. Originally the device name but other
5634 # values are allowed since QEMU 2.7
5636 # @len: maximum progress value
5638 # @offset: current progress value. On success this is equal to len.
5639 # On failure this is less than len
5641 # @speed: rate limit, bytes per second
5647 # <- { "event": "BLOCK_JOB_CANCELLED",
5648 # "data": { "type": "stream", "device": "virtio-disk0",
5649 # "len": 10737418240, "offset": 134217728,
5651 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5653 { 'event': 'BLOCK_JOB_CANCELLED',
5654 'data': { 'type' : 'JobType',
5663 # Emitted when a block job encounters an error
5665 # @device: The job identifier. Originally the device name but other
5666 # values are allowed since QEMU 2.7
5668 # @operation: I/O operation
5670 # @action: action that has been taken
5676 # <- { "event": "BLOCK_JOB_ERROR",
5677 # "data": { "device": "ide0-hd1",
5678 # "operation": "write",
5679 # "action": "stop" },
5680 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5682 { 'event': 'BLOCK_JOB_ERROR',
5683 'data': { 'device' : 'str',
5684 'operation': 'IoOperationType',
5685 'action' : 'BlockErrorAction' } }
5690 # Emitted when a block job is ready to complete
5694 # @device: The job identifier. Originally the device name but other
5695 # values are allowed since QEMU 2.7
5697 # @len: maximum progress value
5699 # @offset: current progress value. On success this is equal to len.
5700 # On failure this is less than len
5702 # @speed: rate limit, bytes per second
5704 # Note: The "ready to complete" status is always reset by a
5705 # @BLOCK_JOB_ERROR event
5711 # <- { "event": "BLOCK_JOB_READY",
5712 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5713 # "len": 2097152, "offset": 2097152 },
5714 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5716 { 'event': 'BLOCK_JOB_READY',
5717 'data': { 'type' : 'JobType',
5724 # @BLOCK_JOB_PENDING:
5726 # Emitted when a block job is awaiting explicit authorization to
5727 # finalize graph changes via @block-job-finalize. If this job is part
5728 # of a transaction, it will not emit this event until the transaction
5729 # has converged first.
5733 # @id: The job identifier.
5739 # <- { "event": "BLOCK_JOB_PENDING",
5740 # "data": { "type": "mirror", "id": "backup_1" },
5741 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5743 { 'event': 'BLOCK_JOB_PENDING',
5744 'data': { 'type' : 'JobType',
5750 # Preallocation mode of QEMU image file
5752 # @off: no preallocation
5754 # @metadata: preallocate only for metadata
5756 # @falloc: like @full preallocation but allocate disk space by
5757 # posix_fallocate() rather than writing data.
5759 # @full: preallocate all data by writing it to the device to ensure
5760 # disk space is really available. This data may or may not be
5761 # zero, depending on the image format and storage. @full
5762 # preallocation also sets up metadata correctly.
5766 { 'enum': 'PreallocMode',
5767 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5770 # @BLOCK_WRITE_THRESHOLD:
5772 # Emitted when writes on block device reaches or exceeds the
5773 # configured write threshold. For thin-provisioned devices, this
5774 # means the device should be extended to avoid pausing for disk
5775 # exhaustion. The event is one shot. Once triggered, it needs to be
5776 # re-registered with another block-set-write-threshold command.
5778 # @node-name: graph node name on which the threshold was exceeded.
5780 # @amount-exceeded: amount of data which exceeded the threshold, in
5783 # @write-threshold: last configured threshold, in bytes.
5787 { 'event': 'BLOCK_WRITE_THRESHOLD',
5788 'data': { 'node-name': 'str',
5789 'amount-exceeded': 'uint64',
5790 'write-threshold': 'uint64' } }
5793 # @block-set-write-threshold:
5795 # Change the write threshold for a block drive. An event will be
5796 # delivered if a write to this block drive crosses the configured
5797 # threshold. The threshold is an offset, thus must be non-negative.
5798 # Default is no write threshold. Setting the threshold to zero
5801 # This is useful to transparently resize thin-provisioned drives
5802 # without the guest OS noticing.
5804 # @node-name: graph node name on which the threshold must be set.
5806 # @write-threshold: configured threshold for the block device, bytes.
5807 # Use 0 to disable the threshold.
5813 # -> { "execute": "block-set-write-threshold",
5814 # "arguments": { "node-name": "mydev",
5815 # "write-threshold": 17179869184 } }
5816 # <- { "return": {} }
5818 { 'command': 'block-set-write-threshold',
5819 'data': { 'node-name': 'str', 'write-threshold': 'uint64' },
5820 'allow-preconfig': true }
5823 # @x-blockdev-change:
5825 # Dynamically reconfigure the block driver state graph. It can be
5826 # used to add, remove, insert or replace a graph node. Currently only
5827 # the Quorum driver implements this feature to add or remove its
5828 # child. This is useful to fix a broken quorum child.
5830 # If @node is specified, it will be inserted under @parent. @child
5831 # may not be specified in this case. If both @parent and @child are
5832 # specified but @node is not, @child will be detached from @parent.
5834 # @parent: the id or name of the parent node.
5836 # @child: the name of a child under the given parent node.
5838 # @node: the name of the node that will be added.
5842 # @unstable: This command is experimental, and its API is not stable.
5843 # It does not support all kinds of operations, all kinds of
5844 # children, nor all block drivers.
5846 # FIXME Removing children from a quorum node means introducing
5847 # gaps in the child indices. This cannot be represented in the
5848 # 'children' list of BlockdevOptionsQuorum, as returned by
5849 # .bdrv_refresh_filename().
5851 # Warning: The data in a new quorum child MUST be consistent with
5852 # that of the rest of the array.
5858 # 1. Add a new node to a quorum
5860 # -> { "execute": "blockdev-add",
5863 # "node-name": "new_node",
5864 # "file": { "driver": "file",
5865 # "filename": "test.raw" } } }
5866 # <- { "return": {} }
5867 # -> { "execute": "x-blockdev-change",
5868 # "arguments": { "parent": "disk1",
5869 # "node": "new_node" } }
5870 # <- { "return": {} }
5872 # 2. Delete a quorum's node
5874 # -> { "execute": "x-blockdev-change",
5875 # "arguments": { "parent": "disk1",
5876 # "child": "children.1" } }
5877 # <- { "return": {} }
5879 { 'command': 'x-blockdev-change',
5880 'data' : { 'parent': 'str',
5883 'features': [ 'unstable' ],
5884 'allow-preconfig': true }
5887 # @x-blockdev-set-iothread:
5889 # Move @node and its children into the @iothread. If @iothread is
5890 # null then move @node and its children into the main loop.
5892 # The node must not be attached to a BlockBackend.
5894 # @node-name: the name of the block driver node
5896 # @iothread: the name of the IOThread object or null for the main loop
5898 # @force: true if the node and its children should be moved when a
5899 # BlockBackend is already attached
5903 # @unstable: This command is experimental and intended for test cases
5904 # that need control over IOThreads only.
5910 # 1. Move a node into an IOThread
5912 # -> { "execute": "x-blockdev-set-iothread",
5913 # "arguments": { "node-name": "disk1",
5914 # "iothread": "iothread0" } }
5915 # <- { "return": {} }
5917 # 2. Move a node into the main loop
5919 # -> { "execute": "x-blockdev-set-iothread",
5920 # "arguments": { "node-name": "disk1",
5921 # "iothread": null } }
5922 # <- { "return": {} }
5924 { 'command': 'x-blockdev-set-iothread',
5925 'data' : { 'node-name': 'str',
5926 'iothread': 'StrOrNull',
5928 'features': [ 'unstable' ],
5929 'allow-preconfig': true }
5934 # An enumeration of the quorum operation types
5936 # @read: read operation
5938 # @write: write operation
5940 # @flush: flush operation
5944 { 'enum': 'QuorumOpType',
5945 'data': [ 'read', 'write', 'flush' ] }
5950 # Emitted by the Quorum block driver if it fails to establish a quorum
5952 # @reference: device name if defined else node name
5954 # @sector-num: number of the first sector of the failed read operation
5956 # @sectors-count: failed read operation sector count
5958 # Note: This event is rate-limited.
5964 # <- { "event": "QUORUM_FAILURE",
5965 # "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
5966 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5968 { 'event': 'QUORUM_FAILURE',
5969 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
5972 # @QUORUM_REPORT_BAD:
5974 # Emitted to report a corruption of a Quorum file
5976 # @type: quorum operation type (Since 2.6)
5978 # @error: error message. Only present on failure. This field
5979 # contains a human-readable error message. There are no semantics
5980 # other than that the block layer reported an error and clients
5981 # should not try to interpret the error string.
5983 # @node-name: the graph node name of the block driver state
5985 # @sector-num: number of the first sector of the failed read operation
5987 # @sectors-count: failed read operation sector count
5989 # Note: This event is rate-limited.
5997 # <- { "event": "QUORUM_REPORT_BAD",
5998 # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
6000 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
6002 # 2. Flush operation
6004 # <- { "event": "QUORUM_REPORT_BAD",
6005 # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
6006 # "type": "flush", "error": "Broken pipe" },
6007 # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
6009 { 'event': 'QUORUM_REPORT_BAD',
6010 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
6011 'sector-num': 'int', 'sectors-count': 'int' } }
6014 # @BlockdevSnapshotInternal:
6016 # @device: the device name or node-name of a root node to generate the
6019 # @name: the name of the internal snapshot to be created
6021 # Notes: In transaction, if @name is empty, or any snapshot matching
6022 # @name exists, the operation will fail. Only some image formats
6023 # support it, for example, qcow2, and rbd.
6027 { 'struct': 'BlockdevSnapshotInternal',
6028 'data': { 'device': 'str', 'name': 'str' } }
6031 # @blockdev-snapshot-internal-sync:
6033 # Synchronously take an internal snapshot of a block device, when the
6034 # format of the image used supports it. If the name is an empty
6035 # string, or a snapshot with name already exists, the operation will
6038 # For the arguments, see the documentation of
6039 # BlockdevSnapshotInternal.
6042 # - nothing on success
6043 # - If @device is not a valid block device, GenericError
6044 # - If any snapshot matching @name exists, or @name is empty,
6046 # - If the format of the image used does not support it,
6053 # -> { "execute": "blockdev-snapshot-internal-sync",
6054 # "arguments": { "device": "ide-hd0",
6055 # "name": "snapshot0" }
6057 # <- { "return": {} }
6059 { 'command': 'blockdev-snapshot-internal-sync',
6060 'data': 'BlockdevSnapshotInternal',
6061 'allow-preconfig': true }
6064 # @blockdev-snapshot-delete-internal-sync:
6066 # Synchronously delete an internal snapshot of a block device, when
6067 # the format of the image used support it. The snapshot is identified
6068 # by name or id or both. One of the name or id is required. Return
6069 # SnapshotInfo for the successfully deleted snapshot.
6071 # @device: the device name or node-name of a root node to delete the
6074 # @id: optional the snapshot's ID to be deleted
6076 # @name: optional the snapshot's name to be deleted
6079 # - SnapshotInfo on success
6080 # - If @device is not a valid block device, GenericError
6081 # - If snapshot not found, GenericError
6082 # - If the format of the image used does not support it,
6084 # - If @id and @name are both not specified, GenericError
6090 # -> { "execute": "blockdev-snapshot-delete-internal-sync",
6091 # "arguments": { "device": "ide-hd0",
6092 # "name": "snapshot0" }
6096 # "name": "snapshot0",
6097 # "vm-state-size": 0,
6098 # "date-sec": 1000012,
6100 # "vm-clock-sec": 100,
6101 # "vm-clock-nsec": 20,
6106 { 'command': 'blockdev-snapshot-delete-internal-sync',
6107 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
6108 'returns': 'SnapshotInfo',
6109 'allow-preconfig': true }
6112 # @DummyBlockCoreForceArrays:
6114 # Not used by QMP; hack to let us use BlockGraphInfoList internally
6118 { 'struct': 'DummyBlockCoreForceArrays',
6119 'data': { 'unused-block-graph-info': ['BlockGraphInfo'] } }