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 # @depth: number of layers (0 = top image, 1 = top image's backing
413 # file, ..., n - 1 = bottom image (where n is the number of images
414 # in the chain)) before reaching one for which the range is
417 # @present: true if this layer provides the data, false if adding a
418 # backing layer could impact this region (since 6.1)
420 # @offset: if present, the image file stores the data for this range
421 # in raw format at the given (host) offset
423 # @filename: filename that is referred to by @offset
427 { 'struct': 'MapEntry',
428 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
429 'zero': 'bool', 'depth': 'int', 'present': 'bool',
430 '*offset': 'int', '*filename': 'str' } }
433 # @BlockdevCacheInfo:
435 # Cache mode information for a block device
437 # @writeback: true if writeback mode is enabled
439 # @direct: true if the host page cache is bypassed (O_DIRECT)
441 # @no-flush: true if flush requests are ignored for the device
445 { 'struct': 'BlockdevCacheInfo',
446 'data': { 'writeback': 'bool',
448 'no-flush': 'bool' } }
453 # Information about the backing device for a block device.
455 # @file: the filename of the backing device
457 # @node-name: the name of the block driver node (Since 2.0)
459 # @ro: true if the backing device was open read-only
461 # @drv: the name of the block format used to open the backing device.
462 # As of 0.14 this can be: 'blkdebug', 'bochs', 'cloop', 'cow',
463 # 'dmg', 'file', 'file', 'ftp', 'ftps', 'host_cdrom',
464 # 'host_device', 'http', 'https', 'luks', 'nbd', 'parallels',
465 # 'qcow', 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat' 2.2:
466 # 'archipelago' added, 'cow' dropped 2.3: 'host_floppy' deprecated
467 # 2.5: 'host_floppy' dropped 2.6: 'luks' added 2.8: 'replication'
468 # added, 'tftp' dropped 2.9: 'archipelago' dropped
470 # @backing_file: the name of the backing file (for copy-on-write)
472 # @backing_file_depth: number of files in the backing file chain
475 # @encrypted: true if the backing device is encrypted
477 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
479 # @bps: total throughput limit in bytes per second is specified
481 # @bps_rd: read throughput limit in bytes per second is specified
483 # @bps_wr: write throughput limit in bytes per second is specified
485 # @iops: total I/O operations per second is specified
487 # @iops_rd: read I/O operations per second is specified
489 # @iops_wr: write I/O operations per second is specified
491 # @image: the info of image used (since: 1.6)
493 # @bps_max: total throughput limit during bursts, in bytes (Since 1.7)
495 # @bps_rd_max: read throughput limit during bursts, in bytes (Since
498 # @bps_wr_max: write throughput limit during bursts, in bytes (Since
501 # @iops_max: total I/O operations per second during bursts, in bytes
504 # @iops_rd_max: read I/O operations per second during bursts, in bytes
507 # @iops_wr_max: write I/O operations per second during bursts, in
510 # @bps_max_length: maximum length of the @bps_max burst period, in
511 # seconds. (Since 2.6)
513 # @bps_rd_max_length: maximum length of the @bps_rd_max burst period,
514 # in seconds. (Since 2.6)
516 # @bps_wr_max_length: maximum length of the @bps_wr_max burst period,
517 # in seconds. (Since 2.6)
519 # @iops_max_length: maximum length of the @iops burst period, in
520 # seconds. (Since 2.6)
522 # @iops_rd_max_length: maximum length of the @iops_rd_max burst
523 # period, in seconds. (Since 2.6)
525 # @iops_wr_max_length: maximum length of the @iops_wr_max burst
526 # period, in seconds. (Since 2.6)
528 # @iops_size: an I/O size in bytes (Since 1.7)
530 # @group: throttle group name (Since 2.4)
532 # @cache: the cache mode used for the block device (since: 2.3)
534 # @write_threshold: configured write threshold for the device. 0 if
535 # disabled. (Since 2.3)
537 # @dirty-bitmaps: dirty bitmaps information (only present if node has
538 # one or more dirty bitmaps) (Since 4.2)
542 { 'struct': 'BlockDeviceInfo',
543 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
544 '*backing_file': 'str', 'backing_file_depth': 'int',
546 'detect_zeroes': 'BlockdevDetectZeroesOptions',
547 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
548 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
549 'image': 'ImageInfo',
550 '*bps_max': 'int', '*bps_rd_max': 'int',
551 '*bps_wr_max': 'int', '*iops_max': 'int',
552 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
553 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
554 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
555 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
556 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
557 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
560 # @BlockDeviceIoStatus:
562 # An enumeration of block device I/O status.
564 # @ok: The last I/O operation has succeeded
566 # @failed: The last I/O operation has failed
568 # @nospace: The last I/O operation has failed due to a no-space
573 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
578 # Block dirty bitmap information.
580 # @name: the name of the dirty bitmap (Since 2.4)
582 # @count: number of dirty bytes according to the dirty bitmap
584 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
586 # @recording: true if the bitmap is recording new writes from the
589 # @busy: true if the bitmap is in-use by some operation (NBD or jobs)
590 # and cannot be modified via QMP or used by another operation.
593 # @persistent: true if the bitmap was stored on disk, is scheduled to
594 # be stored on disk, or both. (since 4.0)
596 # @inconsistent: true if this is a persistent bitmap that was
597 # improperly stored. Implies @persistent to be true; @recording
598 # and @busy to be false. This bitmap cannot be used. To remove
599 # it, use @block-dirty-bitmap-remove. (Since 4.0)
603 { 'struct': 'BlockDirtyInfo',
604 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
605 'recording': 'bool', 'busy': 'bool',
606 'persistent': 'bool', '*inconsistent': 'bool' } }
609 # @Qcow2BitmapInfoFlags:
611 # An enumeration of flags that a bitmap can report to the user.
613 # @in-use: This flag is set by any process actively modifying the
614 # qcow2 file, and cleared when the updated bitmap is flushed to
615 # the qcow2 image. The presence of this flag in an offline image
616 # means that the bitmap was not saved correctly after its last
617 # usage, and may contain inconsistent data.
619 # @auto: The bitmap must reflect all changes of the virtual disk by
620 # any application that would write to this qcow2 file.
624 { 'enum': 'Qcow2BitmapInfoFlags',
625 'data': ['in-use', 'auto'] }
630 # Qcow2 bitmap information.
632 # @name: the name of the bitmap
634 # @granularity: granularity of the bitmap in bytes
636 # @flags: flags of the bitmap
640 { 'struct': 'Qcow2BitmapInfo',
641 'data': {'name': 'str', 'granularity': 'uint32',
642 'flags': ['Qcow2BitmapInfoFlags'] } }
645 # @BlockLatencyHistogramInfo:
647 # Block latency histogram.
649 # @boundaries: list of interval boundary values in nanoseconds, all
650 # greater than zero and in ascending order. For example, the list
651 # [10, 50, 100] produces the following histogram intervals: [0,
652 # 10), [10, 50), [50, 100), [100, +inf).
654 # @bins: list of io request counts corresponding to histogram
656 # len(@bins) = len(@boundaries) + 1
657 # For the example above, @bins may be something like [3, 1, 5, 2],
658 # and corresponding histogram looks like:
667 # +------------------
672 { 'struct': 'BlockLatencyHistogramInfo',
673 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
678 # Block device information. This structure describes a virtual device
679 # and the backing device associated with it.
681 # @device: The device name associated with the virtual device.
683 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the
684 # block device. (since 2.10)
686 # @type: This field is returned only for compatibility reasons, it
687 # should not be used (always returns 'unknown')
689 # @removable: True if the device supports removable media.
691 # @locked: True if the guest has locked this device from having its
694 # @tray_open: True if the device's tray is open (only present if it
697 # @io-status: @BlockDeviceIoStatus. Only present if the device
698 # supports it and the VM is configured to stop on errors
699 # (supported device models: virtio-blk, IDE, SCSI except
702 # @inserted: @BlockDeviceInfo describing the device if media is
707 { 'struct': 'BlockInfo',
708 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
709 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
710 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus' } }
715 # Image file size calculation information. This structure describes
716 # the size requirements for creating a new image file.
718 # The size requirements depend on the new image file format. File
719 # size always equals virtual disk size for the 'raw' format, even for
720 # sparse POSIX files. Compact formats such as 'qcow2' represent
721 # unallocated and zero regions efficiently so file size may be smaller
722 # than virtual disk size.
724 # The values are upper bounds that are guaranteed to fit the new image
725 # file. Subsequent modification, such as internal snapshot or further
726 # bitmap creation, may require additional space and is not covered
729 # @required: Size required for a new image file, in bytes, when
730 # copying just allocated guest-visible contents.
732 # @fully-allocated: Image file size, in bytes, once data has been
733 # written to all sectors, when copying just guest-visible
736 # @bitmaps: Additional size required if all the top-level bitmap
737 # metadata in the source image were to be copied to the
738 # destination, present only when source and destination both
739 # support persistent bitmaps. (since 5.1)
743 { 'struct': 'BlockMeasureInfo',
744 'data': {'required': 'int', 'fully-allocated': 'int', '*bitmaps': 'int'} }
749 # Get a list of BlockInfo for all virtual block devices.
751 # Returns: a list of @BlockInfo describing each virtual block device.
752 # Filter nodes that were created implicitly are skipped over.
758 # -> { "execute": "query-block" }
763 # "device":"ide0-hd0",
770 # "file":"disks/test.qcow2",
771 # "backing_file_depth":1,
778 # "bps_max": 8000000,
785 # "detect_zeroes": "on",
786 # "write_threshold": 0,
788 # "filename":"disks/test.qcow2",
790 # "virtual-size":2048000,
791 # "backing_file":"base.qcow2",
792 # "full-backing-filename":"disks/base.qcow2",
793 # "backing-filename-format":"qcow2",
797 # "name": "snapshot1",
798 # "vm-state-size": 0,
799 # "date-sec": 10000200,
801 # "vm-clock-sec": 206,
802 # "vm-clock-nsec": 30
806 # "filename":"disks/base.qcow2",
808 # "virtual-size":2048000
812 # "qdev": "ide_disk",
817 # "device":"ide1-cd0",
820 # "qdev": "/machine/unattached/device[23]",
821 # "tray_open": false,
825 # "device":"floppy0",
828 # "qdev": "/machine/unattached/device[20]",
840 { 'command': 'query-block', 'returns': ['BlockInfo'],
841 'allow-preconfig': true }
844 # @BlockDeviceTimedStats:
846 # Statistics of a block device during a given interval of time.
848 # @interval_length: Interval used for calculating the statistics, in
851 # @min_rd_latency_ns: Minimum latency of read operations in the
852 # defined interval, in nanoseconds.
854 # @min_wr_latency_ns: Minimum latency of write operations in the
855 # defined interval, in nanoseconds.
857 # @min_zone_append_latency_ns: Minimum latency of zone append operations
858 # in the defined interval, in nanoseconds
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 operations
871 # in the defined interval, in nanoseconds
874 # @max_flush_latency_ns: Maximum latency of flush operations in the
875 # defined interval, in nanoseconds.
877 # @avg_rd_latency_ns: Average latency of read operations in the
878 # defined interval, in nanoseconds.
880 # @avg_wr_latency_ns: Average latency of write operations in the
881 # defined interval, in nanoseconds.
883 # @avg_zone_append_latency_ns: Average latency of zone append operations
884 # in the defined interval, in nanoseconds
887 # @avg_flush_latency_ns: Average latency of flush operations in the
888 # defined interval, in nanoseconds.
890 # @avg_rd_queue_depth: Average number of pending read operations in
891 # the defined interval.
893 # @avg_wr_queue_depth: Average number of pending write operations in
894 # the defined interval.
896 # @avg_zone_append_queue_depth: Average number of pending zone append
897 # operations in the defined interval
902 { 'struct': 'BlockDeviceTimedStats',
903 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
904 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
905 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
906 'avg_wr_latency_ns': 'int', 'min_zone_append_latency_ns': 'int',
907 'max_zone_append_latency_ns': 'int',
908 'avg_zone_append_latency_ns': 'int',
909 'min_flush_latency_ns': 'int', 'max_flush_latency_ns': 'int',
910 'avg_flush_latency_ns': 'int', 'avg_rd_queue_depth': 'number',
911 'avg_wr_queue_depth': 'number',
912 'avg_zone_append_queue_depth': 'number' } }
917 # Statistics of a virtual block device or a block backing device.
919 # @rd_bytes: The number of bytes read by the device.
921 # @wr_bytes: The number of bytes written by the device.
923 # @zone_append_bytes: The number of bytes appended by the zoned devices
926 # @unmap_bytes: The number of bytes unmapped by the device (Since 4.2)
928 # @rd_operations: The number of read operations performed by the
931 # @wr_operations: The number of write operations performed by the
934 # @zone_append_operations: The number of zone append operations performed
935 # by the zoned devices (since 8.1)
937 # @flush_operations: The number of cache flush operations performed by
938 # the device (since 0.15)
940 # @unmap_operations: The number of unmap operations performed by the
943 # @rd_total_time_ns: Total time spent on reads in nanoseconds (since
946 # @wr_total_time_ns: Total time spent on writes in nanoseconds (since
949 # @zone_append_total_time_ns: Total time spent on zone append writes
950 # in nanoseconds (since 8.1)
952 # @flush_total_time_ns: Total time spent on cache flushes in
953 # nanoseconds (since 0.15).
955 # @unmap_total_time_ns: Total time spent on unmap operations in
956 # nanoseconds (Since 4.2)
958 # @wr_highest_offset: The offset after the greatest byte written to
959 # the device. The intended use of this information is for
960 # growable sparse files (like qcow2) that are used on top of a
963 # @rd_merged: Number of read requests that have been merged into
964 # another request (Since 2.3).
966 # @wr_merged: Number of write requests that have been merged into
967 # another request (Since 2.3).
969 # @zone_append_merged: Number of zone append requests that have been merged
970 # into another request (since 8.1)
972 # @unmap_merged: Number of unmap requests that have been merged into
973 # another request (Since 4.2)
975 # @idle_time_ns: Time since the last I/O operation, in nanoseconds.
976 # If the field is absent it means that there haven't been any
977 # operations yet (Since 2.5).
979 # @failed_rd_operations: The number of failed read operations
980 # performed by the device (Since 2.5)
982 # @failed_wr_operations: The number of failed write operations
983 # performed by the device (Since 2.5)
985 # @failed_zone_append_operations: The number of failed zone append write
986 # operations performed by the zoned devices
989 # @failed_flush_operations: The number of failed flush operations
990 # performed by the device (Since 2.5)
992 # @failed_unmap_operations: The number of failed unmap operations
993 # performed by the device (Since 4.2)
995 # @invalid_rd_operations: The number of invalid read operations
996 # performed by the device (Since 2.5)
998 # @invalid_wr_operations: The number of invalid write operations
999 # performed by the device (Since 2.5)
1001 # @invalid_zone_append_operations: The number of invalid zone append operations
1002 # performed by the zoned device (since 8.1)
1004 # @invalid_flush_operations: The number of invalid flush operations
1005 # performed by the device (Since 2.5)
1007 # @invalid_unmap_operations: The number of invalid unmap operations
1008 # performed by the device (Since 4.2)
1010 # @account_invalid: Whether invalid operations are included in the
1011 # last access statistics (Since 2.5)
1013 # @account_failed: Whether failed operations are included in the
1014 # latency and last access statistics (Since 2.5)
1016 # @timed_stats: Statistics specific to the set of previously defined
1017 # intervals of time (Since 2.5)
1019 # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
1021 # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
1023 # @zone_append_latency_histogram: @BlockLatencyHistogramInfo. (since 8.1)
1025 # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
1029 { 'struct': 'BlockDeviceStats',
1030 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'zone_append_bytes': 'int',
1031 'unmap_bytes' : 'int', 'rd_operations': 'int',
1032 'wr_operations': 'int', 'zone_append_operations': 'int',
1033 'flush_operations': 'int', 'unmap_operations': 'int',
1034 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int',
1035 'zone_append_total_time_ns': 'int', 'flush_total_time_ns': 'int',
1036 'unmap_total_time_ns': 'int', 'wr_highest_offset': 'int',
1037 'rd_merged': 'int', 'wr_merged': 'int', 'zone_append_merged': 'int',
1038 'unmap_merged': 'int', '*idle_time_ns': 'int',
1039 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
1040 'failed_zone_append_operations': 'int',
1041 'failed_flush_operations': 'int',
1042 'failed_unmap_operations': 'int', 'invalid_rd_operations': 'int',
1043 'invalid_wr_operations': 'int',
1044 'invalid_zone_append_operations': 'int',
1045 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int',
1046 'account_invalid': 'bool', 'account_failed': 'bool',
1047 'timed_stats': ['BlockDeviceTimedStats'],
1048 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
1049 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
1050 '*zone_append_latency_histogram': 'BlockLatencyHistogramInfo',
1051 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
1054 # @BlockStatsSpecificFile:
1056 # File driver statistics
1058 # @discard-nb-ok: The number of successful discard operations
1059 # performed by the driver.
1061 # @discard-nb-failed: The number of failed discard operations
1062 # performed by the driver.
1064 # @discard-bytes-ok: The number of bytes discarded by the driver.
1068 { 'struct': 'BlockStatsSpecificFile',
1070 'discard-nb-ok': 'uint64',
1071 'discard-nb-failed': 'uint64',
1072 'discard-bytes-ok': 'uint64' } }
1075 # @BlockStatsSpecificNvme:
1077 # NVMe driver statistics
1079 # @completion-errors: The number of completion errors.
1081 # @aligned-accesses: The number of aligned accesses performed by the
1084 # @unaligned-accesses: The number of unaligned accesses performed by
1089 { 'struct': 'BlockStatsSpecificNvme',
1091 'completion-errors': 'uint64',
1092 'aligned-accesses': 'uint64',
1093 'unaligned-accesses': 'uint64' } }
1096 # @BlockStatsSpecific:
1098 # Block driver specific statistics
1102 { 'union': 'BlockStatsSpecific',
1103 'base': { 'driver': 'BlockdevDriver' },
1104 'discriminator': 'driver',
1106 'file': 'BlockStatsSpecificFile',
1107 'host_device': { 'type': 'BlockStatsSpecificFile',
1108 'if': 'HAVE_HOST_BLOCK_DEVICE' },
1109 'nvme': 'BlockStatsSpecificNvme' } }
1114 # Statistics of a virtual block device or a block backing device.
1116 # @device: If the stats are for a virtual block device, the name
1117 # corresponding to the virtual block device.
1119 # @node-name: The node name of the device. (Since 2.3)
1121 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the
1122 # block device. (since 3.0)
1124 # @stats: A @BlockDeviceStats for the device.
1126 # @driver-specific: Optional driver-specific stats. (Since 4.2)
1128 # @parent: This describes the file block device if it has one.
1129 # Contains recursively the statistics of the underlying protocol
1130 # (e.g. the host file for a qcow2 image). If there is no
1131 # underlying protocol, this field is omitted
1133 # @backing: This describes the backing block device if it has one.
1138 { 'struct': 'BlockStats',
1139 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
1140 'stats': 'BlockDeviceStats',
1141 '*driver-specific': 'BlockStatsSpecific',
1142 '*parent': 'BlockStats',
1143 '*backing': 'BlockStats'} }
1146 # @query-blockstats:
1148 # Query the @BlockStats for all virtual block devices.
1150 # @query-nodes: If true, the command will query all the block nodes
1151 # that have a node name, in a list which will include "parent"
1152 # information, but not "backing". If false or omitted, the
1153 # behavior is as before - query all the device backends,
1154 # recursively including their "parent" and "backing". Filter nodes
1155 # that were created implicitly are skipped over in this mode.
1158 # Returns: A list of @BlockStats for each virtual block devices.
1164 # -> { "execute": "query-blockstats" }
1168 # "device":"ide0-hd0",
1171 # "wr_highest_offset":3686448128,
1172 # "wr_bytes":9786368,
1173 # "wr_operations":751,
1174 # "rd_bytes":122567168,
1175 # "rd_operations":36772
1176 # "wr_total_times_ns":313253456
1177 # "rd_total_times_ns":3465673657
1178 # "flush_total_times_ns":49653
1179 # "flush_operations":61,
1182 # "idle_time_ns":2953431879,
1183 # "account_invalid":true,
1184 # "account_failed":false
1188 # "wr_highest_offset":2821110784,
1189 # "wr_bytes":9786368,
1190 # "wr_operations":692,
1191 # "rd_bytes":122739200,
1192 # "rd_operations":36604
1193 # "flush_operations":51,
1194 # "wr_total_times_ns":313253456
1195 # "rd_total_times_ns":3465673657
1196 # "flush_total_times_ns":49653,
1199 # "idle_time_ns":2953431879,
1200 # "account_invalid":true,
1201 # "account_failed":false
1203 # "qdev": "/machine/unattached/device[23]"
1206 # "device":"ide1-cd0",
1208 # "wr_highest_offset":0,
1210 # "wr_operations":0,
1213 # "flush_operations":0,
1214 # "wr_total_times_ns":0
1215 # "rd_total_times_ns":0
1216 # "flush_total_times_ns":0,
1219 # "account_invalid":false,
1220 # "account_failed":false
1222 # "qdev": "/machine/unattached/device[24]"
1225 # "device":"floppy0",
1227 # "wr_highest_offset":0,
1229 # "wr_operations":0,
1232 # "flush_operations":0,
1233 # "wr_total_times_ns":0
1234 # "rd_total_times_ns":0
1235 # "flush_total_times_ns":0,
1238 # "account_invalid":false,
1239 # "account_failed":false
1241 # "qdev": "/machine/unattached/device[16]"
1246 # "wr_highest_offset":0,
1248 # "wr_operations":0,
1251 # "flush_operations":0,
1252 # "wr_total_times_ns":0
1253 # "rd_total_times_ns":0
1254 # "flush_total_times_ns":0,
1257 # "account_invalid":false,
1258 # "account_failed":false
1264 { 'command': 'query-blockstats',
1265 'data': { '*query-nodes': 'bool' },
1266 'returns': ['BlockStats'],
1267 'allow-preconfig': true }
1272 # An enumeration of possible behaviors for errors on I/O operations.
1273 # The exact meaning depends on whether the I/O was initiated by a
1274 # guest or by a block job
1276 # @report: for guest operations, report the error to the guest; for
1277 # jobs, cancel the job
1279 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1280 # or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs
1281 # retry the failing request later and may still complete
1282 # successfully. The stream block job continues to stream and will
1283 # complete with an error.
1285 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1287 # @stop: for guest operations, stop the virtual machine; for jobs,
1290 # @auto: inherit the error handling policy of the backend (since: 2.7)
1294 { 'enum': 'BlockdevOnError',
1295 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1300 # An enumeration of possible behaviors for the initial synchronization
1301 # phase of storage mirroring.
1303 # @top: copies data in the topmost image to the destination
1305 # @full: copies data from all images to the destination
1307 # @none: only copy data written from now on
1309 # @incremental: only copy data described by the dirty bitmap.
1312 # @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
1313 # Behavior on completion is determined by the BitmapSyncMode.
1317 { 'enum': 'MirrorSyncMode',
1318 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1323 # An enumeration of possible behaviors for the synchronization of a
1324 # bitmap when used for data copy operations.
1326 # @on-success: The bitmap is only synced when the operation is
1327 # successful. This is the behavior always used for 'INCREMENTAL'
1330 # @never: The bitmap is never synchronized with the operation, and is
1331 # treated solely as a read-only manifest of blocks to copy.
1333 # @always: The bitmap is always synchronized with the operation,
1334 # regardless of whether or not the operation was successful.
1338 { 'enum': 'BitmapSyncMode',
1339 'data': ['on-success', 'never', 'always'] }
1344 # An enumeration whose values tell the mirror block job when to
1345 # trigger writes to the target.
1347 # @background: copy data in background only.
1349 # @write-blocking: when data is written to the source, write it
1350 # (synchronously) to the target as well. In addition, data is
1351 # copied in background just like in @background mode.
1355 { 'enum': 'MirrorCopyMode',
1356 'data': ['background', 'write-blocking'] }
1361 # Information about a long-running block device operation.
1363 # @type: the job type ('stream' for image streaming)
1365 # @device: The job identifier. Originally the device name but other
1366 # values are allowed since QEMU 2.7
1368 # @len: Estimated @offset value at the completion of the job. This
1369 # value can arbitrarily change while the job is running, in both
1372 # @offset: Progress made until now. The unit is arbitrary and the
1373 # value can only meaningfully be used for the ratio of @offset to
1374 # @len. The value is monotonically increasing.
1376 # @busy: false if the job is known to be in a quiescent state, with no
1377 # pending I/O. (Since 1.3)
1379 # @paused: whether the job is paused or, if @busy is true, will pause
1380 # itself as soon as possible. (Since 1.3)
1382 # @speed: the rate limit, bytes per second
1384 # @io-status: the status of the job (since 1.3)
1386 # @ready: true if the job may be completed (since 2.2)
1388 # @status: Current job state/status (since 2.12)
1390 # @auto-finalize: Job will finalize itself when PENDING, moving to the
1391 # CONCLUDED state. (since 2.12)
1393 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the
1394 # NULL state and disappearing from the query list. (since 2.12)
1396 # @error: Error information if the job did not complete successfully.
1397 # Not set if the job completed successfully. (since 2.12.1)
1401 { 'struct': 'BlockJobInfo',
1402 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1403 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1404 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1405 'status': 'JobStatus',
1406 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1410 # @query-block-jobs:
1412 # Return information about long-running block device operations.
1414 # Returns: a list of @BlockJobInfo for each active block job
1418 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'],
1419 'allow-preconfig': true }
1424 # Resize a block image while a guest is running.
1426 # Either @device or @node-name must be set but not both.
1428 # @device: the name of the device to get the image resized
1430 # @node-name: graph node name to get the image resized (Since 2.0)
1432 # @size: new image size in bytes
1435 # - nothing on success
1436 # - If @device is not a valid block device, DeviceNotFound
1442 # -> { "execute": "block_resize",
1443 # "arguments": { "device": "scratch", "size": 1073741824 } }
1444 # <- { "return": {} }
1446 { 'command': 'block_resize',
1447 'data': { '*device': 'str',
1448 '*node-name': 'str',
1451 'allow-preconfig': true }
1456 # An enumeration that tells QEMU how to set the backing file path in a
1459 # @existing: QEMU should look for an existing image file.
1461 # @absolute-paths: QEMU should create a new image with absolute paths
1462 # for the backing file. If there is no backing file available,
1463 # the new image will not be backed either.
1467 { 'enum': 'NewImageMode',
1468 'data': [ 'existing', 'absolute-paths' ] }
1471 # @BlockdevSnapshotSync:
1473 # Either @device or @node-name must be set but not both.
1475 # @device: the name of the device to take a snapshot of.
1477 # @node-name: graph node name to generate the snapshot from (Since
1480 # @snapshot-file: the target of the new overlay image. If the file
1481 # exists, or if it is a device, the overlay will be created in the
1482 # existing file/device. Otherwise, a new file will be created.
1484 # @snapshot-node-name: the graph node name of the new image (Since
1487 # @format: the format of the overlay image, default is 'qcow2'.
1489 # @mode: whether and how QEMU should create a new image, default is
1492 { 'struct': 'BlockdevSnapshotSync',
1493 'data': { '*device': 'str', '*node-name': 'str',
1494 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1495 '*format': 'str', '*mode': 'NewImageMode' } }
1498 # @BlockdevSnapshot:
1500 # @node: device or node name that will have a snapshot taken.
1502 # @overlay: reference to the existing block device that will become
1503 # the overlay of @node, as part of taking the snapshot. It must
1504 # not have a current backing file (this can be achieved by passing
1505 # "backing": null to blockdev-add).
1509 { 'struct': 'BlockdevSnapshot',
1510 'data': { 'node': 'str', 'overlay': 'str' } }
1515 # Optional parameters for backup. These parameters don't affect
1516 # functionality, but may significantly affect performance.
1518 # @use-copy-range: Use copy offloading. Default false.
1520 # @max-workers: Maximum number of parallel requests for the sustained
1521 # background copying process. Doesn't influence copy-before-write
1522 # operations. Default 64.
1524 # @max-chunk: Maximum request length for the sustained background
1525 # copying process. Doesn't influence copy-before-write
1526 # operations. 0 means unlimited. If max-chunk is non-zero then
1527 # it should not be less than job cluster size which is calculated
1528 # as maximum of target image cluster size and 64k. Default 0.
1532 { 'struct': 'BackupPerf',
1533 'data': { '*use-copy-range': 'bool',
1534 '*max-workers': 'int', '*max-chunk': 'int64' } }
1539 # @job-id: identifier for the newly-created block job. If omitted,
1540 # the device name will be used. (Since 2.7)
1542 # @device: the device name or node-name of a root node which should be
1545 # @sync: what parts of the disk image should be copied to the
1546 # destination (all the disk, only the sectors allocated in the
1547 # topmost image, from a dirty bitmap, or only new I/O).
1549 # @speed: the maximum speed, in bytes per second. The default is 0,
1552 # @bitmap: The name of a dirty bitmap to use. Must be present if sync
1553 # is "bitmap" or "incremental". Can be present if sync is "full"
1554 # or "top". Must not be present otherwise.
1555 # (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1557 # @bitmap-mode: Specifies the type of data the bitmap should contain
1558 # after the operation concludes. Must be present if a bitmap was
1559 # provided, Must NOT be present otherwise. (Since 4.2)
1561 # @compress: true to compress data, if the target format supports it.
1562 # (default: false) (since 2.8)
1564 # @on-source-error: the action to take on an error on the source,
1565 # default 'report'. 'stop' and 'enospc' can only be used if the
1566 # block device supports io-status (see BlockInfo).
1568 # @on-target-error: the action to take on an error on the target,
1569 # default 'report' (no limitations, since this applies to a
1570 # different block device than @device).
1572 # @auto-finalize: When false, this job will wait in a PENDING state
1573 # after it has finished its work, waiting for @block-job-finalize
1574 # before making any block graph changes. When true, this job will
1575 # automatically perform its abort or commit actions. Defaults to
1576 # true. (Since 2.12)
1578 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
1579 # after it has completely ceased all work, and awaits
1580 # @block-job-dismiss. When true, this job will automatically
1581 # disappear from the query list without user intervention.
1582 # Defaults to true. (Since 2.12)
1584 # @filter-node-name: the node name that should be assigned to the
1585 # filter driver that the backup job inserts into the graph above
1586 # node specified by @drive. If this option is not given, a node
1587 # name is autogenerated. (Since: 4.2)
1589 # @x-perf: Performance options. (Since 6.0)
1593 # @unstable: Member @x-perf is experimental.
1595 # Note: @on-source-error and @on-target-error only affect background
1596 # I/O. If an error occurs during a guest write request, the
1597 # device's rerror/werror actions will be used.
1601 { 'struct': 'BackupCommon',
1602 'data': { '*job-id': 'str', 'device': 'str',
1603 'sync': 'MirrorSyncMode', '*speed': 'int',
1604 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1605 '*compress': 'bool',
1606 '*on-source-error': 'BlockdevOnError',
1607 '*on-target-error': 'BlockdevOnError',
1608 '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
1609 '*filter-node-name': 'str',
1610 '*x-perf': { 'type': 'BackupPerf',
1611 'features': [ 'unstable' ] } } }
1616 # @target: the target of the new image. If the file exists, or if it
1617 # is a device, the existing file/device will be used as the new
1618 # destination. If it does not exist, a new file will be created.
1620 # @format: the format of the new destination, default is to probe if
1621 # @mode is 'existing', else the format of the source
1623 # @mode: whether and how QEMU should create a new image, default is
1628 { 'struct': 'DriveBackup',
1629 'base': 'BackupCommon',
1630 'data': { 'target': 'str',
1632 '*mode': 'NewImageMode' } }
1637 # @target: the device name or node-name of the backup target node.
1641 { 'struct': 'BlockdevBackup',
1642 'base': 'BackupCommon',
1643 'data': { 'target': 'str' } }
1646 # @blockdev-snapshot-sync:
1648 # Takes a synchronous snapshot of a block device.
1650 # For the arguments, see the documentation of BlockdevSnapshotSync.
1653 # - nothing on success
1654 # - If @device is not a valid block device, DeviceNotFound
1660 # -> { "execute": "blockdev-snapshot-sync",
1661 # "arguments": { "device": "ide-hd0",
1663 # "/some/place/my-image",
1664 # "format": "qcow2" } }
1665 # <- { "return": {} }
1667 { 'command': 'blockdev-snapshot-sync',
1668 'data': 'BlockdevSnapshotSync',
1669 'allow-preconfig': true }
1672 # @blockdev-snapshot:
1674 # Takes a snapshot of a block device.
1676 # Take a snapshot, by installing 'node' as the backing image of
1677 # 'overlay'. Additionally, if 'node' is associated with a block
1678 # device, the block device changes to using 'overlay' as its new
1681 # For the arguments, see the documentation of BlockdevSnapshot.
1685 # @allow-write-only-overlay: If present, the check whether this
1686 # operation is safe was relaxed so that it can be used to change
1687 # backing file of a destination of a blockdev-mirror. (since 5.0)
1693 # -> { "execute": "blockdev-add",
1694 # "arguments": { "driver": "qcow2",
1695 # "node-name": "node1534",
1696 # "file": { "driver": "file",
1697 # "filename": "hd1.qcow2" },
1698 # "backing": null } }
1700 # <- { "return": {} }
1702 # -> { "execute": "blockdev-snapshot",
1703 # "arguments": { "node": "ide-hd0",
1704 # "overlay": "node1534" } }
1705 # <- { "return": {} }
1707 { 'command': 'blockdev-snapshot',
1708 'data': 'BlockdevSnapshot',
1709 'features': [ 'allow-write-only-overlay' ],
1710 'allow-preconfig': true }
1713 # @change-backing-file:
1715 # Change the backing file in the image file metadata. This does not
1716 # cause QEMU to reopen the image file to reparse the backing filename
1717 # (it may, however, perform a reopen to change permissions from r/o ->
1718 # r/w -> r/o, if needed). The new backing file string is written into
1719 # the image file metadata, and the QEMU internal strings are updated.
1721 # @image-node-name: The name of the block driver state node of the
1722 # image to modify. The "device" argument is used to verify
1723 # "image-node-name" is in the chain described by "device".
1725 # @device: The device name or node-name of the root node that owns
1728 # @backing-file: The string to write as the backing file. This string
1729 # is not validated, so care should be taken when specifying the
1730 # string or the image chain may not be able to be reopened again.
1733 # - Nothing on success
1734 # - If "device" does not exist or cannot be determined,
1739 { 'command': 'change-backing-file',
1740 'data': { 'device': 'str', 'image-node-name': 'str',
1741 'backing-file': 'str' },
1742 'allow-preconfig': true }
1747 # Live commit of data from overlay image nodes into backing nodes -
1748 # i.e., writes data between 'top' and 'base' into 'base'.
1750 # If top == base, that is an error. If top has no overlays on top of
1751 # it, or if it is in use by a writer, the job will not be completed by
1752 # itself. The user needs to complete the job with the
1753 # block-job-complete command after getting the ready event. (Since
1756 # If the base image is smaller than top, then the base image will be
1757 # resized to be the same size as top. If top is smaller than the base
1758 # image, the base will not be truncated. If you want the base image
1759 # size to match the size of the smaller top, you can safely truncate
1760 # it yourself once the commit operation successfully completes.
1762 # @job-id: identifier for the newly-created block job. If omitted,
1763 # the device name will be used. (Since 2.7)
1765 # @device: the device name or node-name of a root node
1767 # @base-node: The node name of the backing image to write data into.
1768 # If not specified, this is the deepest backing image.
1771 # @base: Same as @base-node, except that it is a file name rather than
1772 # a node name. This must be the exact filename string that was
1773 # used to open the node; other strings, even if addressing the
1774 # same file, are not accepted
1776 # @top-node: The node name of the backing image within the image chain
1777 # which contains the topmost data to be committed down. If not
1778 # specified, this is the active layer. (since: 3.1)
1780 # @top: Same as @top-node, except that it is a file name rather than a
1781 # node name. This must be the exact filename string that was used
1782 # to open the node; other strings, even if addressing the same
1783 # file, are not accepted
1785 # @backing-file: The backing file string to write into the overlay
1786 # image of 'top'. If 'top' does not have an overlay image, or if
1787 # 'top' is in use by a writer, specifying a backing file string is
1790 # This filename is not validated. If a pathname string is such
1791 # that it cannot be resolved by QEMU, that means that subsequent
1792 # QMP or HMP commands must use node-names for the image in
1793 # question, as filename lookup methods will fail.
1795 # If not specified, QEMU will automatically determine the backing
1796 # file string to use, or error out if there is no obvious choice.
1797 # Care should be taken when specifying the string, to specify a
1798 # valid filename or protocol. (Since 2.1)
1800 # @speed: the maximum speed, in bytes per second
1802 # @on-error: the action to take on an error. 'ignore' means that the
1803 # request should be retried. (default: report; Since: 5.0)
1805 # @filter-node-name: the node name that should be assigned to the
1806 # filter driver that the commit job inserts into the graph above
1807 # @top. If this option is not given, a node name is
1808 # autogenerated. (Since: 2.9)
1810 # @auto-finalize: When false, this job will wait in a PENDING state
1811 # after it has finished its work, waiting for @block-job-finalize
1812 # before making any block graph changes. When true, this job will
1813 # automatically perform its abort or commit actions. Defaults to
1816 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
1817 # after it has completely ceased all work, and awaits
1818 # @block-job-dismiss. When true, this job will automatically
1819 # disappear from the query list without user intervention.
1820 # Defaults to true. (Since 3.1)
1824 # @deprecated: Members @base and @top are deprecated. Use @base-node
1825 # and @top-node instead.
1828 # - Nothing on success
1829 # - If @device does not exist, DeviceNotFound
1830 # - Any other error returns a GenericError.
1836 # -> { "execute": "block-commit",
1837 # "arguments": { "device": "virtio0",
1838 # "top": "/tmp/snap1.qcow2" } }
1839 # <- { "return": {} }
1841 { 'command': 'block-commit',
1842 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1843 '*base': { 'type': 'str', 'features': [ 'deprecated' ] },
1845 '*top': { 'type': 'str', 'features': [ 'deprecated' ] },
1846 '*backing-file': 'str', '*speed': 'int',
1847 '*on-error': 'BlockdevOnError',
1848 '*filter-node-name': 'str',
1849 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
1850 'allow-preconfig': true }
1855 # Start a point-in-time copy of a block device to a new destination.
1856 # The status of ongoing drive-backup operations can be checked with
1857 # query-block-jobs where the BlockJobInfo.type field has the value
1858 # 'backup'. The operation can be stopped before it has completed using
1859 # the block-job-cancel command.
1863 # @deprecated: This command is deprecated. Use @blockdev-backup
1867 # - nothing on success
1868 # - If @device is not a valid block device, GenericError
1874 # -> { "execute": "drive-backup",
1875 # "arguments": { "device": "drive0",
1877 # "target": "backup.img" } }
1878 # <- { "return": {} }
1880 { 'command': 'drive-backup', 'boxed': true,
1881 'data': 'DriveBackup', 'features': ['deprecated'],
1882 'allow-preconfig': true }
1887 # Start a point-in-time copy of a block device to a new destination.
1888 # The status of ongoing blockdev-backup operations can be checked with
1889 # query-block-jobs where the BlockJobInfo.type field has the value
1890 # 'backup'. The operation can be stopped before it has completed using
1891 # the block-job-cancel command.
1894 # - nothing on success
1895 # - If @device is not a valid block device, DeviceNotFound
1901 # -> { "execute": "blockdev-backup",
1902 # "arguments": { "device": "src-id",
1904 # "target": "tgt-id" } }
1905 # <- { "return": {} }
1907 { 'command': 'blockdev-backup', 'boxed': true,
1908 'data': 'BlockdevBackup',
1909 'allow-preconfig': true }
1912 # @query-named-block-nodes:
1914 # Get the named block driver list
1916 # @flat: Omit the nested data about backing image ("backing-image"
1917 # key) if true. Default is false (Since 5.0)
1919 # Returns: the list of BlockDeviceInfo
1925 # -> { "execute": "query-named-block-nodes" }
1926 # <- { "return": [ { "ro":false,
1928 # "encrypted":false,
1929 # "file":"disks/test.qcow2",
1930 # "node-name": "my-node",
1931 # "backing_file_depth":1,
1932 # "detect_zeroes":"off",
1939 # "bps_max": 8000000,
1946 # "write_threshold": 0,
1948 # "filename":"disks/test.qcow2",
1950 # "virtual-size":2048000,
1951 # "backing_file":"base.qcow2",
1952 # "full-backing-filename":"disks/base.qcow2",
1953 # "backing-filename-format":"qcow2",
1957 # "name": "snapshot1",
1958 # "vm-state-size": 0,
1959 # "date-sec": 10000200,
1961 # "vm-clock-sec": 206,
1962 # "vm-clock-nsec": 30
1966 # "filename":"disks/base.qcow2",
1968 # "virtual-size":2048000
1972 { 'command': 'query-named-block-nodes',
1973 'returns': [ 'BlockDeviceInfo' ],
1974 'data': { '*flat': 'bool' },
1975 'allow-preconfig': true }
1978 # @XDbgBlockGraphNodeType:
1980 # @block-backend: corresponds to BlockBackend
1982 # @block-job: corresponds to BlockJob
1984 # @block-driver: corresponds to BlockDriverState
1988 { 'enum': 'XDbgBlockGraphNodeType',
1989 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1992 # @XDbgBlockGraphNode:
1994 # @id: Block graph node identifier. This @id is generated only for
1995 # x-debug-query-block-graph and does not relate to any other
1996 # identifiers in Qemu.
1998 # @type: Type of graph node. Can be one of block-backend, block-job
1999 # or block-driver-state.
2001 # @name: Human readable name of the node. Corresponds to node-name
2002 # for block-driver-state nodes; is not guaranteed to be unique in
2003 # the whole graph (with block-jobs and block-backends).
2007 { 'struct': 'XDbgBlockGraphNode',
2008 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
2013 # Enum of base block permissions.
2015 # @consistent-read: A user that has the "permission" of consistent
2016 # reads is guaranteed that their view of the contents of the block
2017 # device is complete and self-consistent, representing the
2018 # contents of a disk at a specific point. For most block devices
2019 # (including their backing files) this is true, but the property
2020 # cannot be maintained in a few situations like for intermediate
2021 # nodes of a commit block job.
2023 # @write: This permission is required to change the visible disk
2026 # @write-unchanged: This permission (which is weaker than
2027 # BLK_PERM_WRITE) is both enough and required for writes to the
2028 # block node when the caller promises that the visible disk
2029 # content doesn't change. As the BLK_PERM_WRITE permission is
2030 # strictly stronger, either is sufficient to perform an unchanging
2033 # @resize: This permission is required to change the size of a block
2038 { 'enum': 'BlockPermission',
2039 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize' ] }
2042 # @XDbgBlockGraphEdge:
2044 # Block Graph edge description for x-debug-query-block-graph.
2046 # @parent: parent id
2050 # @name: name of the relation (examples are 'file' and 'backing')
2052 # @perm: granted permissions for the parent operating on the child
2054 # @shared-perm: permissions that can still be granted to other users
2055 # of the child while it is still attached to this parent
2059 { 'struct': 'XDbgBlockGraphEdge',
2060 'data': { 'parent': 'uint64', 'child': 'uint64',
2061 'name': 'str', 'perm': [ 'BlockPermission' ],
2062 'shared-perm': [ 'BlockPermission' ] } }
2067 # Block Graph - list of nodes and list of edges.
2071 { 'struct': 'XDbgBlockGraph',
2072 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
2075 # @x-debug-query-block-graph:
2077 # Get the block graph.
2081 # @unstable: This command is meant for debugging.
2085 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph',
2086 'features': [ 'unstable' ],
2087 'allow-preconfig': true }
2092 # Start mirroring a block device's writes to a new destination.
2093 # target specifies the target of the new image. If the file exists,
2094 # or if it is a device, it will be used as the new destination for
2095 # writes. If it does not exist, a new file will be created. format
2096 # specifies the format of the mirror image, default is to probe if
2097 # mode='existing', else the format of the source.
2100 # - nothing on success
2101 # - If @device is not a valid block device, GenericError
2107 # -> { "execute": "drive-mirror",
2108 # "arguments": { "device": "ide-hd0",
2109 # "target": "/some/place/my-image",
2111 # "format": "qcow2" } }
2112 # <- { "return": {} }
2114 { 'command': 'drive-mirror', 'boxed': true,
2115 'data': 'DriveMirror',
2116 'allow-preconfig': true }
2121 # A set of parameters describing drive mirror setup.
2123 # @job-id: identifier for the newly-created block job. If omitted,
2124 # the device name will be used. (Since 2.7)
2126 # @device: the device name or node-name of a root node whose writes
2127 # should be mirrored.
2129 # @target: the target of the new image. If the file exists, or if it
2130 # is a device, the existing file/device will be used as the new
2131 # destination. If it does not exist, a new file will be created.
2133 # @format: the format of the new destination, default is to probe if
2134 # @mode is 'existing', else the format of the source
2136 # @node-name: the new block driver state node name in the graph (Since
2139 # @replaces: with sync=full graph node name to be replaced by the new
2140 # image when a whole image copy is done. This can be used to
2141 # repair broken Quorum files. By default, @device is replaced,
2142 # although implicitly created filters on it are kept. (Since 2.1)
2144 # @mode: whether and how QEMU should create a new image, default is
2147 # @speed: the maximum speed, in bytes per second
2149 # @sync: what parts of the disk image should be copied to the
2150 # destination (all the disk, only the sectors allocated in the
2151 # topmost image, or only new I/O).
2153 # @granularity: granularity of the dirty bitmap, default is 64K if the
2154 # image format doesn't have clusters, 4K if the clusters are
2155 # smaller than that, else the cluster size. Must be a power of 2
2156 # between 512 and 64M (since 1.4).
2158 # @buf-size: maximum amount of data in flight from source to target
2161 # @on-source-error: the action to take on an error on the source,
2162 # default 'report'. 'stop' and 'enospc' can only be used if the
2163 # block device supports io-status (see BlockInfo).
2165 # @on-target-error: the action to take on an error on the target,
2166 # default 'report' (no limitations, since this applies to a
2167 # different block device than @device).
2169 # @unmap: Whether to try to unmap target sectors where source has only
2170 # zero. If true, and target unallocated sectors will read as
2171 # zero, target image sectors will be unmapped; otherwise, zeroes
2172 # will be written. Both will result in identical contents.
2173 # Default is true. (Since 2.4)
2175 # @copy-mode: when to copy data to the destination; defaults to
2176 # 'background' (Since: 3.0)
2178 # @auto-finalize: When false, this job will wait in a PENDING state
2179 # after it has finished its work, waiting for @block-job-finalize
2180 # before making any block graph changes. When true, this job will
2181 # automatically perform its abort or commit actions. Defaults to
2184 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
2185 # after it has completely ceased all work, and awaits
2186 # @block-job-dismiss. When true, this job will automatically
2187 # disappear from the query list without user intervention.
2188 # Defaults to true. (Since 3.1)
2192 { 'struct': 'DriveMirror',
2193 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2194 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
2195 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2196 '*speed': 'int', '*granularity': 'uint32',
2197 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2198 '*on-target-error': 'BlockdevOnError',
2199 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
2200 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2203 # @BlockDirtyBitmap:
2205 # @node: name of device/node which the bitmap is tracking
2207 # @name: name of the dirty bitmap
2211 { 'struct': 'BlockDirtyBitmap',
2212 'data': { 'node': 'str', 'name': 'str' } }
2215 # @BlockDirtyBitmapAdd:
2217 # @node: name of device/node which the bitmap is tracking
2219 # @name: name of the dirty bitmap (must be less than 1024 bytes)
2221 # @granularity: the bitmap granularity, default is 64k for
2222 # block-dirty-bitmap-add
2224 # @persistent: the bitmap is persistent, i.e. it will be saved to the
2225 # corresponding block device image file on its close. For now
2226 # only Qcow2 disks support persistent bitmaps. Default is false
2227 # for block-dirty-bitmap-add. (Since: 2.10)
2229 # @disabled: the bitmap is created in the disabled state, which means
2230 # that it will not track drive changes. The bitmap may be enabled
2231 # with block-dirty-bitmap-enable. Default is false. (Since: 4.0)
2235 { 'struct': 'BlockDirtyBitmapAdd',
2236 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
2237 '*persistent': 'bool', '*disabled': 'bool' } }
2240 # @BlockDirtyBitmapOrStr:
2242 # @local: name of the bitmap, attached to the same node as target
2245 # @external: bitmap with specified node
2249 { 'alternate': 'BlockDirtyBitmapOrStr',
2250 'data': { 'local': 'str',
2251 'external': 'BlockDirtyBitmap' } }
2254 # @BlockDirtyBitmapMerge:
2256 # @node: name of device/node which the @target bitmap is tracking
2258 # @target: name of the destination dirty bitmap
2260 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or
2261 # fully specified BlockDirtyBitmap elements. The latter are
2262 # supported since 4.1.
2266 { 'struct': 'BlockDirtyBitmapMerge',
2267 'data': { 'node': 'str', 'target': 'str',
2268 'bitmaps': ['BlockDirtyBitmapOrStr'] } }
2271 # @block-dirty-bitmap-add:
2273 # Create a dirty bitmap with a name on the node, and start tracking
2277 # - nothing on success
2278 # - If @node is not a valid block device or node, DeviceNotFound
2279 # - If @name is already taken, GenericError with an explanation
2285 # -> { "execute": "block-dirty-bitmap-add",
2286 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2287 # <- { "return": {} }
2289 { 'command': 'block-dirty-bitmap-add',
2290 'data': 'BlockDirtyBitmapAdd',
2291 'allow-preconfig': true }
2294 # @block-dirty-bitmap-remove:
2296 # Stop write tracking and remove the dirty bitmap that was created
2297 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it
2298 # from its storage too.
2301 # - nothing on success
2302 # - If @node is not a valid block device or node, DeviceNotFound
2303 # - If @name is not found, GenericError with an explanation
2304 # - if @name is frozen by an operation, GenericError
2310 # -> { "execute": "block-dirty-bitmap-remove",
2311 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2312 # <- { "return": {} }
2314 { 'command': 'block-dirty-bitmap-remove',
2315 'data': 'BlockDirtyBitmap',
2316 'allow-preconfig': true }
2319 # @block-dirty-bitmap-clear:
2321 # Clear (reset) a dirty bitmap on the device, so that an incremental
2322 # backup from this point in time forward will only backup clusters
2323 # modified after this clear operation.
2326 # - nothing on success
2327 # - If @node is not a valid block device, DeviceNotFound
2328 # - If @name is not found, GenericError with an explanation
2334 # -> { "execute": "block-dirty-bitmap-clear",
2335 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2336 # <- { "return": {} }
2338 { 'command': 'block-dirty-bitmap-clear',
2339 'data': 'BlockDirtyBitmap',
2340 'allow-preconfig': true }
2343 # @block-dirty-bitmap-enable:
2345 # Enables a dirty bitmap so that it will begin tracking disk changes.
2348 # - nothing on success
2349 # - If @node is not a valid block device, DeviceNotFound
2350 # - If @name is not found, GenericError with an explanation
2356 # -> { "execute": "block-dirty-bitmap-enable",
2357 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2358 # <- { "return": {} }
2360 { 'command': 'block-dirty-bitmap-enable',
2361 'data': 'BlockDirtyBitmap',
2362 'allow-preconfig': true }
2365 # @block-dirty-bitmap-disable:
2367 # Disables a dirty bitmap so that it will stop tracking disk changes.
2370 # - nothing on success
2371 # - If @node is not a valid block device, DeviceNotFound
2372 # - If @name is not found, GenericError with an explanation
2378 # -> { "execute": "block-dirty-bitmap-disable",
2379 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2380 # <- { "return": {} }
2382 { 'command': 'block-dirty-bitmap-disable',
2383 'data': 'BlockDirtyBitmap',
2384 'allow-preconfig': true }
2387 # @block-dirty-bitmap-merge:
2389 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2390 # Dirty bitmaps in @bitmaps will be unchanged, except if it also
2391 # appears as the @target bitmap. Any bits already set in @target will
2392 # still be set after the merge, i.e., this operation does not clear
2393 # the target. On error, @target is unchanged.
2395 # The resulting bitmap will count as dirty any clusters that were
2396 # dirty in any of the source bitmaps. This can be used to achieve
2397 # backup checkpoints, or in simpler usages, to copy bitmaps.
2400 # - nothing on success
2401 # - If @node is not a valid block device, DeviceNotFound
2402 # - If any bitmap in @bitmaps or @target is not found,
2404 # - If any of the bitmaps have different sizes or granularities,
2411 # -> { "execute": "block-dirty-bitmap-merge",
2412 # "arguments": { "node": "drive0", "target": "bitmap0",
2413 # "bitmaps": ["bitmap1"] } }
2414 # <- { "return": {} }
2416 { 'command': 'block-dirty-bitmap-merge',
2417 'data': 'BlockDirtyBitmapMerge',
2418 'allow-preconfig': true }
2421 # @BlockDirtyBitmapSha256:
2423 # SHA256 hash of dirty bitmap data
2425 # @sha256: ASCII representation of SHA256 bitmap hash
2429 { 'struct': 'BlockDirtyBitmapSha256',
2430 'data': {'sha256': 'str'} }
2433 # @x-debug-block-dirty-bitmap-sha256:
2435 # Get bitmap SHA256.
2439 # @unstable: This command is meant for debugging.
2442 # - BlockDirtyBitmapSha256 on success
2443 # - If @node is not a valid block device, DeviceNotFound
2444 # - If @name is not found or if hashing has failed, GenericError
2445 # with an explanation
2449 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2450 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256',
2451 'features': [ 'unstable' ],
2452 'allow-preconfig': true }
2457 # Start mirroring a block device's writes to a new destination.
2459 # @job-id: identifier for the newly-created block job. If omitted,
2460 # the device name will be used. (Since 2.7)
2462 # @device: The device name or node-name of a root node whose writes
2463 # should be mirrored.
2465 # @target: the id or node-name of the block device to mirror to. This
2466 # mustn't be attached to guest.
2468 # @replaces: with sync=full graph node name to be replaced by the new
2469 # image when a whole image copy is done. This can be used to
2470 # repair broken Quorum files. By default, @device is replaced,
2471 # although implicitly created filters on it are kept.
2473 # @speed: the maximum speed, in bytes per second
2475 # @sync: what parts of the disk image should be copied to the
2476 # destination (all the disk, only the sectors allocated in the
2477 # topmost image, or only new I/O).
2479 # @granularity: granularity of the dirty bitmap, default is 64K if the
2480 # image format doesn't have clusters, 4K if the clusters are
2481 # smaller than that, else the cluster size. Must be a power of 2
2482 # between 512 and 64M
2484 # @buf-size: maximum amount of data in flight from source to target
2486 # @on-source-error: the action to take on an error on the source,
2487 # default 'report'. 'stop' and 'enospc' can only be used if the
2488 # block device supports io-status (see BlockInfo).
2490 # @on-target-error: the action to take on an error on the target,
2491 # default 'report' (no limitations, since this applies to a
2492 # different block device than @device).
2494 # @filter-node-name: the node name that should be assigned to the
2495 # filter driver that the mirror job inserts into the graph above
2496 # @device. If this option is not given, a node name is
2497 # autogenerated. (Since: 2.9)
2499 # @copy-mode: when to copy data to the destination; defaults to
2500 # 'background' (Since: 3.0)
2502 # @auto-finalize: When false, this job will wait in a PENDING state
2503 # after it has finished its work, waiting for @block-job-finalize
2504 # before making any block graph changes. When true, this job will
2505 # automatically perform its abort or commit actions. Defaults to
2508 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
2509 # after it has completely ceased all work, and awaits
2510 # @block-job-dismiss. When true, this job will automatically
2511 # disappear from the query list without user intervention.
2512 # Defaults to true. (Since 3.1)
2514 # Returns: nothing on success.
2520 # -> { "execute": "blockdev-mirror",
2521 # "arguments": { "device": "ide-hd0",
2522 # "target": "target0",
2523 # "sync": "full" } }
2524 # <- { "return": {} }
2526 { 'command': 'blockdev-mirror',
2527 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2529 'sync': 'MirrorSyncMode',
2530 '*speed': 'int', '*granularity': 'uint32',
2531 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2532 '*on-target-error': 'BlockdevOnError',
2533 '*filter-node-name': 'str',
2534 '*copy-mode': 'MirrorCopyMode',
2535 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
2536 'allow-preconfig': true }
2541 # A set of parameters describing block throttling.
2543 # @device: Block device name
2545 # @id: The name or QOM path of the guest device (since: 2.8)
2547 # @bps: total throughput limit in bytes per second
2549 # @bps_rd: read throughput limit in bytes per second
2551 # @bps_wr: write throughput limit in bytes per second
2553 # @iops: total I/O operations per second
2555 # @iops_rd: read I/O operations per second
2557 # @iops_wr: write I/O operations per second
2559 # @bps_max: total throughput limit during bursts, in bytes (Since 1.7)
2561 # @bps_rd_max: read throughput limit during bursts, in bytes (Since
2564 # @bps_wr_max: write throughput limit during bursts, in bytes (Since
2567 # @iops_max: total I/O operations per second during bursts, in bytes
2570 # @iops_rd_max: read I/O operations per second during bursts, in bytes
2573 # @iops_wr_max: write I/O operations per second during bursts, in
2576 # @bps_max_length: maximum length of the @bps_max burst period, in
2577 # seconds. It must only be set if @bps_max is set as well.
2578 # Defaults to 1. (Since 2.6)
2580 # @bps_rd_max_length: maximum length of the @bps_rd_max burst period,
2581 # in seconds. It must only be set if @bps_rd_max is set as well.
2582 # Defaults to 1. (Since 2.6)
2584 # @bps_wr_max_length: maximum length of the @bps_wr_max burst period,
2585 # in seconds. It must only be set if @bps_wr_max is set as well.
2586 # Defaults to 1. (Since 2.6)
2588 # @iops_max_length: maximum length of the @iops burst period, in
2589 # seconds. It must only be set if @iops_max is set as well.
2590 # Defaults to 1. (Since 2.6)
2592 # @iops_rd_max_length: maximum length of the @iops_rd_max burst
2593 # period, in seconds. It must only be set if @iops_rd_max is set
2594 # as well. Defaults to 1. (Since 2.6)
2596 # @iops_wr_max_length: maximum length of the @iops_wr_max burst
2597 # period, in seconds. It must only be set if @iops_wr_max is set
2598 # as well. Defaults to 1. (Since 2.6)
2600 # @iops_size: an I/O size in bytes (Since 1.7)
2602 # @group: throttle group name (Since 2.4)
2606 # @deprecated: Member @device is deprecated. Use @id instead.
2610 { 'struct': 'BlockIOThrottle',
2611 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
2612 '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2613 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2614 '*bps_max': 'int', '*bps_rd_max': 'int',
2615 '*bps_wr_max': 'int', '*iops_max': 'int',
2616 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2617 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2618 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2619 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2620 '*iops_size': 'int', '*group': 'str' } }
2625 # Limit parameters for throttling. Since some limit combinations are
2626 # illegal, limits should always be set in one transaction. All fields
2627 # are optional. When setting limits, if a field is missing the
2628 # current value is not changed.
2630 # @iops-total: limit total I/O operations per second
2632 # @iops-total-max: I/O operations burst
2634 # @iops-total-max-length: length of the iops-total-max burst period,
2635 # in seconds It must only be set if @iops-total-max is set as
2638 # @iops-read: limit read operations per second
2640 # @iops-read-max: I/O operations read burst
2642 # @iops-read-max-length: length of the iops-read-max burst period, in
2643 # seconds It must only be set if @iops-read-max is set as well.
2645 # @iops-write: limit write operations per second
2647 # @iops-write-max: I/O operations write burst
2649 # @iops-write-max-length: length of the iops-write-max burst period,
2650 # in seconds It must only be set if @iops-write-max is set as
2653 # @bps-total: limit total bytes per second
2655 # @bps-total-max: total bytes burst
2657 # @bps-total-max-length: length of the bps-total-max burst period, in
2658 # seconds. It must only be set if @bps-total-max is set as well.
2660 # @bps-read: limit read bytes per second
2662 # @bps-read-max: total bytes read burst
2664 # @bps-read-max-length: length of the bps-read-max burst period, in
2665 # seconds It must only be set if @bps-read-max is set as well.
2667 # @bps-write: limit write bytes per second
2669 # @bps-write-max: total bytes write burst
2671 # @bps-write-max-length: length of the bps-write-max burst period, in
2672 # seconds It must only be set if @bps-write-max is set as well.
2674 # @iops-size: when limiting by iops max size of an I/O in bytes
2678 { 'struct': 'ThrottleLimits',
2679 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2680 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2681 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2682 '*iops-write' : 'int', '*iops-write-max' : 'int',
2683 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2684 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2685 '*bps-read' : 'int', '*bps-read-max' : 'int',
2686 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2687 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2688 '*iops-size' : 'int' } }
2691 # @ThrottleGroupProperties:
2693 # Properties for throttle-group objects.
2695 # @limits: limits to apply for this throttle group
2699 # @unstable: All members starting with x- are aliases for the same key
2700 # without x- in the @limits object. This is not a stable
2701 # interface and may be removed or changed incompatibly in the
2702 # future. Use @limits for a supported stable interface.
2706 { 'struct': 'ThrottleGroupProperties',
2707 'data': { '*limits': 'ThrottleLimits',
2708 '*x-iops-total': { 'type': 'int',
2709 'features': [ 'unstable' ] },
2710 '*x-iops-total-max': { 'type': 'int',
2711 'features': [ 'unstable' ] },
2712 '*x-iops-total-max-length': { 'type': 'int',
2713 'features': [ 'unstable' ] },
2714 '*x-iops-read': { 'type': 'int',
2715 'features': [ 'unstable' ] },
2716 '*x-iops-read-max': { 'type': 'int',
2717 'features': [ 'unstable' ] },
2718 '*x-iops-read-max-length': { 'type': 'int',
2719 'features': [ 'unstable' ] },
2720 '*x-iops-write': { 'type': 'int',
2721 'features': [ 'unstable' ] },
2722 '*x-iops-write-max': { 'type': 'int',
2723 'features': [ 'unstable' ] },
2724 '*x-iops-write-max-length': { 'type': 'int',
2725 'features': [ 'unstable' ] },
2726 '*x-bps-total': { 'type': 'int',
2727 'features': [ 'unstable' ] },
2728 '*x-bps-total-max': { 'type': 'int',
2729 'features': [ 'unstable' ] },
2730 '*x-bps-total-max-length': { 'type': 'int',
2731 'features': [ 'unstable' ] },
2732 '*x-bps-read': { 'type': 'int',
2733 'features': [ 'unstable' ] },
2734 '*x-bps-read-max': { 'type': 'int',
2735 'features': [ 'unstable' ] },
2736 '*x-bps-read-max-length': { 'type': 'int',
2737 'features': [ 'unstable' ] },
2738 '*x-bps-write': { 'type': 'int',
2739 'features': [ 'unstable' ] },
2740 '*x-bps-write-max': { 'type': 'int',
2741 'features': [ 'unstable' ] },
2742 '*x-bps-write-max-length': { 'type': 'int',
2743 'features': [ 'unstable' ] },
2744 '*x-iops-size': { 'type': 'int',
2745 'features': [ 'unstable' ] } } }
2750 # Copy data from a backing file into a block device.
2752 # The block streaming operation is performed in the background until
2753 # the entire backing file has been copied. This command returns
2754 # immediately once streaming has started. The status of ongoing block
2755 # streaming operations can be checked with query-block-jobs. The
2756 # operation can be stopped before it has completed using the
2757 # block-job-cancel command.
2759 # The node that receives the data is called the top image, can be
2760 # located in any part of the chain (but always above the base image;
2761 # see below) and can be specified using its device or node name.
2762 # Earlier qemu versions only allowed 'device' to name the top level
2763 # node; presence of the 'base-node' parameter during introspection can
2764 # be used as a witness of the enhanced semantics of 'device'.
2766 # If a base file is specified then sectors are not copied from that
2767 # base file and its backing chain. This can be used to stream a
2768 # subset of the backing file chain instead of flattening the entire
2769 # image. When streaming completes the image file will have the base
2770 # file as its backing file, unless that node was changed while the job
2771 # was running. In that case, base's parent's backing (or filtered,
2772 # whichever exists) child (i.e., base at the beginning of the job)
2773 # will be the new backing file.
2775 # On successful completion the image file is updated to drop the
2776 # backing file and the BLOCK_JOB_COMPLETED event is emitted.
2778 # In case @device is a filter node, block-stream modifies the first
2779 # non-filter overlay node below it to point to the new backing node
2780 # instead of modifying @device itself.
2782 # @job-id: identifier for the newly-created block job. If omitted,
2783 # the device name will be used. (Since 2.7)
2785 # @device: the device or node name of the top image
2787 # @base: the common backing file name. It cannot be set if @base-node
2788 # or @bottom is also set.
2790 # @base-node: the node name of the backing file. It cannot be set if
2791 # @base or @bottom is also set. (Since 2.8)
2793 # @bottom: the last node in the chain that should be streamed into
2794 # top. It cannot be set if @base or @base-node is also set. It
2795 # cannot be filter node. (Since 6.0)
2797 # @backing-file: The backing file string to write into the top image.
2798 # This filename is not validated.
2800 # If a pathname string is such that it cannot be resolved by QEMU,
2801 # that means that subsequent QMP or HMP commands must use
2802 # node-names for the image in question, as filename lookup methods
2805 # If not specified, QEMU will automatically determine the backing
2806 # file string to use, or error out if there is no obvious choice.
2807 # Care should be taken when specifying the string, to specify a
2808 # valid filename or protocol. (Since 2.1)
2810 # @speed: the maximum speed, in bytes per second
2812 # @on-error: the action to take on an error (default report). 'stop'
2813 # and 'enospc' can only be used if the block device supports
2814 # io-status (see BlockInfo). (Since 1.3)
2816 # @filter-node-name: the node name that should be assigned to the
2817 # filter driver that the stream job inserts into the graph above
2818 # @device. If this option is not given, a node name is
2819 # autogenerated. (Since: 6.0)
2821 # @auto-finalize: When false, this job will wait in a PENDING state
2822 # after it has finished its work, waiting for @block-job-finalize
2823 # before making any block graph changes. When true, this job will
2824 # automatically perform its abort or commit actions. Defaults to
2827 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
2828 # after it has completely ceased all work, and awaits
2829 # @block-job-dismiss. When true, this job will automatically
2830 # disappear from the query list without user intervention.
2831 # Defaults to true. (Since 3.1)
2834 # - Nothing on success.
2835 # - If @device does not exist, DeviceNotFound.
2841 # -> { "execute": "block-stream",
2842 # "arguments": { "device": "virtio0",
2843 # "base": "/tmp/master.qcow2" } }
2844 # <- { "return": {} }
2846 { 'command': 'block-stream',
2847 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2848 '*base-node': 'str', '*backing-file': 'str', '*bottom': 'str',
2849 '*speed': 'int', '*on-error': 'BlockdevOnError',
2850 '*filter-node-name': 'str',
2851 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
2852 'allow-preconfig': true }
2855 # @block-job-set-speed:
2857 # Set maximum speed for a background block operation.
2859 # This command can only be issued when there is an active block job.
2861 # Throttling can be disabled by setting the speed to 0.
2863 # @device: The job identifier. This used to be a device name (hence
2864 # the name of the parameter), but since QEMU 2.7 it can have other
2867 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2871 # - Nothing on success
2872 # - If no background operation is active on this device,
2877 { 'command': 'block-job-set-speed',
2878 'data': { 'device': 'str', 'speed': 'int' },
2879 'allow-preconfig': true }
2882 # @block-job-cancel:
2884 # Stop an active background block operation.
2886 # This command returns immediately after marking the active background
2887 # block operation for cancellation. It is an error to call this
2888 # command if no operation is in progress.
2890 # The operation will cancel as soon as possible and then emit the
2891 # BLOCK_JOB_CANCELLED event. Before that happens the job is still
2892 # visible when enumerated using query-block-jobs.
2894 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has
2895 # indicated (via the event BLOCK_JOB_READY) that the source and
2896 # destination are synchronized, then the event triggered by this
2897 # command changes to BLOCK_JOB_COMPLETED, to indicate that the
2898 # mirroring has ended and the destination now has a point-in-time copy
2899 # tied to the time of the cancellation.
2901 # For streaming, the image file retains its backing file unless the
2902 # streaming operation happens to complete just as it is being
2903 # cancelled. A new streaming operation can be started at a later time
2904 # to finish copying all data from the backing file.
2906 # @device: The job identifier. This used to be a device name (hence
2907 # the name of the parameter), but since QEMU 2.7 it can have other
2910 # @force: If true, and the job has already emitted the event
2911 # BLOCK_JOB_READY, abandon the job immediately (even if it is
2912 # paused) instead of waiting for the destination to complete its
2913 # final synchronization (since 1.3)
2916 # - Nothing on success
2917 # - If no background operation is active on this device,
2922 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' },
2923 'allow-preconfig': true }
2928 # Pause an active background block operation.
2930 # This command returns immediately after marking the active background
2931 # block operation for pausing. It is an error to call this command if
2932 # no operation is in progress or if the job is already paused.
2934 # The operation will pause as soon as possible. No event is emitted
2935 # when the operation is actually paused. Cancelling a paused job
2936 # automatically resumes it.
2938 # @device: The job identifier. This used to be a device name (hence
2939 # the name of the parameter), but since QEMU 2.7 it can have other
2943 # - Nothing on success
2944 # - If no background operation is active on this device,
2949 { 'command': 'block-job-pause', 'data': { 'device': 'str' },
2950 'allow-preconfig': true }
2953 # @block-job-resume:
2955 # Resume an active background block operation.
2957 # This command returns immediately after resuming a paused background
2958 # block operation. It is an error to call this command if no
2959 # operation is in progress or if the job is not paused.
2961 # This command also clears the error status of the job.
2963 # @device: The job identifier. This used to be a device name (hence
2964 # the name of the parameter), but since QEMU 2.7 it can have other
2968 # - Nothing on success
2969 # - If no background operation is active on this device,
2974 { 'command': 'block-job-resume', 'data': { 'device': 'str' },
2975 'allow-preconfig': true }
2978 # @block-job-complete:
2980 # Manually trigger completion of an active background block operation.
2981 # This is supported for drive mirroring, where it also switches the
2982 # device to write to the target path only. The ability to complete is
2983 # signaled with a BLOCK_JOB_READY event.
2985 # This command completes an active background block operation
2986 # synchronously. The ordering of this command's return with the
2987 # BLOCK_JOB_COMPLETED event is not defined. Note that if an I/O error
2988 # occurs during the processing of this command: 1) the command itself
2989 # will fail; 2) the error will be processed according to the
2990 # rerror/werror arguments that were specified when starting the
2993 # A cancelled or paused job cannot be completed.
2995 # @device: The job identifier. This used to be a device name (hence
2996 # the name of the parameter), but since QEMU 2.7 it can have other
3000 # - Nothing on success
3001 # - If no background operation is active on this device,
3006 { 'command': 'block-job-complete', 'data': { 'device': 'str' },
3007 'allow-preconfig': true }
3010 # @block-job-dismiss:
3012 # For jobs that have already concluded, remove them from the
3013 # block-job-query list. This command only needs to be run for jobs
3014 # which were started with QEMU 2.12+ job lifetime management
3017 # This command will refuse to operate on any job that has not yet
3018 # reached its terminal state, JOB_STATUS_CONCLUDED. For jobs that make
3019 # use of the BLOCK_JOB_READY event, block-job-cancel or
3020 # block-job-complete will still need to be used as appropriate.
3022 # @id: The job identifier.
3024 # Returns: Nothing on success
3028 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' },
3029 'allow-preconfig': true }
3032 # @block-job-finalize:
3034 # Once a job that has manual=true reaches the pending state, it can be
3035 # instructed to finalize any graph changes and do any necessary
3036 # cleanup via this command. For jobs in a transaction, instructing
3037 # one job to finalize will force ALL jobs in the transaction to
3038 # finalize, so it is only necessary to instruct a single member job to
3041 # @id: The job identifier.
3043 # Returns: Nothing on success
3047 { 'command': 'block-job-finalize', 'data': { 'id': 'str' },
3048 'allow-preconfig': true }
3051 # @BlockdevDiscardOptions:
3053 # Determines how to handle discard requests.
3055 # @ignore: Ignore the request
3057 # @unmap: Forward as an unmap request
3061 { 'enum': 'BlockdevDiscardOptions',
3062 'data': [ 'ignore', 'unmap' ] }
3065 # @BlockdevDetectZeroesOptions:
3067 # Describes the operation mode for the automatic conversion of plain
3068 # zero writes by the OS to driver specific optimized zero write
3071 # @off: Disabled (default)
3075 # @unmap: Enabled and even try to unmap blocks if possible. This
3076 # requires also that @BlockdevDiscardOptions is set to unmap for
3081 { 'enum': 'BlockdevDetectZeroesOptions',
3082 'data': [ 'off', 'on', 'unmap' ] }
3085 # @BlockdevAioOptions:
3087 # Selects the AIO backend to handle I/O requests
3089 # @threads: Use qemu's thread pool
3091 # @native: Use native AIO backend (only Linux and Windows)
3093 # @io_uring: Use linux io_uring (since 5.0)
3097 { 'enum': 'BlockdevAioOptions',
3098 'data': [ 'threads', 'native',
3099 { 'name': 'io_uring', 'if': 'CONFIG_LINUX_IO_URING' } ] }
3102 # @BlockdevCacheOptions:
3104 # Includes cache-related options for block devices
3106 # @direct: enables use of O_DIRECT (bypass the host page cache;
3109 # @no-flush: ignore any flush requests for the device (default: false)
3113 { 'struct': 'BlockdevCacheOptions',
3114 'data': { '*direct': 'bool',
3115 '*no-flush': 'bool' } }
3120 # Drivers that are supported in block device operations.
3122 # @throttle: Since 2.11
3126 # @copy-on-read: Since 3.0
3128 # @blklogwrites: Since 3.0
3130 # @blkreplay: Since 4.2
3132 # @compress: Since 5.0
3134 # @copy-before-write: Since 6.2
3136 # @snapshot-access: Since 7.0
3140 { 'enum': 'BlockdevDriver',
3141 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
3142 'cloop', 'compress', 'copy-before-write', 'copy-on-read', 'dmg',
3143 'file', 'snapshot-access', 'ftp', 'ftps', 'gluster',
3144 {'name': 'host_cdrom', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
3145 {'name': 'host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
3147 { 'name': 'io_uring', 'if': 'CONFIG_BLKIO' },
3149 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme',
3150 { 'name': 'nvme-io_uring', 'if': 'CONFIG_BLKIO' },
3151 'parallels', 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum',
3153 { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
3154 'ssh', 'throttle', 'vdi', 'vhdx',
3155 { 'name': 'virtio-blk-vfio-pci', 'if': 'CONFIG_BLKIO' },
3156 { 'name': 'virtio-blk-vhost-user', 'if': 'CONFIG_BLKIO' },
3157 { 'name': 'virtio-blk-vhost-vdpa', 'if': 'CONFIG_BLKIO' },
3158 'vmdk', 'vpc', 'vvfat' ] }
3161 # @BlockdevOptionsFile:
3163 # Driver specific block device options for the file backend.
3165 # @filename: path to the image file
3167 # @pr-manager: the id for the object that will handle persistent
3168 # reservations for this device (default: none, forward the
3169 # commands via SG_IO; since 2.11)
3171 # @aio: AIO backend (default: threads) (since: 2.8)
3173 # @aio-max-batch: maximum number of requests to batch together into a
3174 # single submission in the AIO backend. The smallest value
3175 # between this and the aio-max-batch value of the IOThread object
3176 # is chosen. 0 means that the AIO backend will handle it
3177 # automatically. (default: 0, since 6.2)
3179 # @locking: whether to enable file locking. If set to 'auto', only
3180 # enable when Open File Descriptor (OFD) locking API is available
3181 # (default: auto, since 2.10)
3183 # @drop-cache: invalidate page cache during live migration. This
3184 # prevents stale data on the migration destination with
3185 # cache.direct=off. Currently only supported on Linux hosts.
3186 # (default: on, since: 4.0)
3188 # @x-check-cache-dropped: whether to check that page cache was dropped
3189 # on live migration. May cause noticeable delays if the image
3190 # file is large, do not use in production. (default: off)
3195 # @dynamic-auto-read-only: If present, enabled auto-read-only means
3196 # that the driver will open the image read-only at first,
3197 # dynamically reopen the image file read-write when the first
3198 # writer is attached to the node and reopen read-only when the
3199 # last writer is detached. This allows giving QEMU write
3200 # permissions only on demand when an operation actually needs
3203 # @unstable: Member x-check-cache-dropped is meant for debugging.
3207 { 'struct': 'BlockdevOptionsFile',
3208 'data': { 'filename': 'str',
3209 '*pr-manager': 'str',
3210 '*locking': 'OnOffAuto',
3211 '*aio': 'BlockdevAioOptions',
3212 '*aio-max-batch': 'int',
3213 '*drop-cache': {'type': 'bool',
3214 'if': 'CONFIG_LINUX'},
3215 '*x-check-cache-dropped': { 'type': 'bool',
3216 'features': [ 'unstable' ] } },
3217 'features': [ { 'name': 'dynamic-auto-read-only',
3218 'if': 'CONFIG_POSIX' } ] }
3221 # @BlockdevOptionsNull:
3223 # Driver specific block device options for the null backend.
3225 # @size: size of the device in bytes.
3227 # @latency-ns: emulated latency (in nanoseconds) in processing
3228 # requests. Default to zero which completes requests immediately.
3231 # @read-zeroes: if true, reads from the device produce zeroes; if
3232 # false, the buffer is left unchanged.
3233 # (default: false; since: 4.1)
3237 { 'struct': 'BlockdevOptionsNull',
3238 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
3241 # @BlockdevOptionsNVMe:
3243 # Driver specific block device options for the NVMe backend.
3245 # @device: PCI controller address of the NVMe device in format
3246 # hhhh:bb:ss.f (host:bus:slot.function)
3248 # @namespace: namespace number of the device, starting from 1.
3250 # Note that the PCI @device must have been unbound from any host
3251 # kernel driver before instructing QEMU to add the blockdev.
3255 { 'struct': 'BlockdevOptionsNVMe',
3256 'data': { 'device': 'str', 'namespace': 'int' } }
3259 # @BlockdevOptionsVVFAT:
3261 # Driver specific block device options for the vvfat protocol.
3263 # @dir: directory to be exported as FAT image
3265 # @fat-type: FAT type: 12, 16 or 32
3267 # @floppy: whether to export a floppy image (true) or partitioned hard
3268 # disk (false; default)
3270 # @label: set the volume label, limited to 11 bytes. FAT16 and FAT32
3271 # traditionally have some restrictions on labels, which are
3272 # ignored by most operating systems. Defaults to "QEMU VVFAT".
3275 # @rw: whether to allow write operations (default: false)
3279 { 'struct': 'BlockdevOptionsVVFAT',
3280 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
3281 '*label': 'str', '*rw': 'bool' } }
3284 # @BlockdevOptionsGenericFormat:
3286 # Driver specific block device options for image format that have no
3287 # option besides their data source.
3289 # @file: reference to or definition of the data source block device
3293 { 'struct': 'BlockdevOptionsGenericFormat',
3294 'data': { 'file': 'BlockdevRef' } }
3297 # @BlockdevOptionsLUKS:
3299 # Driver specific block device options for LUKS.
3301 # @key-secret: the ID of a QCryptoSecret object providing the
3302 # decryption key (since 2.6). Mandatory except when doing a
3303 # metadata-only probe of the image.
3307 { 'struct': 'BlockdevOptionsLUKS',
3308 'base': 'BlockdevOptionsGenericFormat',
3309 'data': { '*key-secret': 'str' } }
3312 # @BlockdevOptionsGenericCOWFormat:
3314 # Driver specific block device options for image format that have no
3315 # option besides their data source and an optional backing file.
3317 # @backing: reference to or definition of the backing file block
3318 # device, null disables the backing file entirely. Defaults to
3319 # the backing file stored the image file.
3323 { 'struct': 'BlockdevOptionsGenericCOWFormat',
3324 'base': 'BlockdevOptionsGenericFormat',
3325 'data': { '*backing': 'BlockdevRefOrNull' } }
3328 # @Qcow2OverlapCheckMode:
3330 # General overlap check modes.
3332 # @none: Do not perform any checks
3334 # @constant: Perform only checks which can be done in constant time
3335 # and without reading anything from disk
3337 # @cached: Perform only checks which can be done without reading
3338 # anything from disk
3340 # @all: Perform all available overlap checks
3344 { 'enum': 'Qcow2OverlapCheckMode',
3345 'data': [ 'none', 'constant', 'cached', 'all' ] }
3348 # @Qcow2OverlapCheckFlags:
3350 # Structure of flags for each metadata structure. Setting a field to
3351 # 'true' makes qemu guard that structure against unintended
3352 # overwriting. The default value is chosen according to the template
3355 # @template: Specifies a template mode which can be adjusted using the
3356 # other flags, defaults to 'cached'
3358 # @bitmap-directory: since 3.0
3362 { 'struct': 'Qcow2OverlapCheckFlags',
3363 'data': { '*template': 'Qcow2OverlapCheckMode',
3364 '*main-header': 'bool',
3365 '*active-l1': 'bool',
3366 '*active-l2': 'bool',
3367 '*refcount-table': 'bool',
3368 '*refcount-block': 'bool',
3369 '*snapshot-table': 'bool',
3370 '*inactive-l1': 'bool',
3371 '*inactive-l2': 'bool',
3372 '*bitmap-directory': 'bool' } }
3375 # @Qcow2OverlapChecks:
3377 # Specifies which metadata structures should be guarded against
3378 # unintended overwriting.
3380 # @flags: set of flags for separate specification of each metadata
3383 # @mode: named mode which chooses a specific set of flags
3387 { 'alternate': 'Qcow2OverlapChecks',
3388 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3389 'mode': 'Qcow2OverlapCheckMode' } }
3392 # @BlockdevQcowEncryptionFormat:
3394 # @aes: AES-CBC with plain64 initialization vectors
3398 { 'enum': 'BlockdevQcowEncryptionFormat',
3402 # @BlockdevQcowEncryption:
3406 { 'union': 'BlockdevQcowEncryption',
3407 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3408 'discriminator': 'format',
3409 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3412 # @BlockdevOptionsQcow:
3414 # Driver specific block device options for qcow.
3416 # @encrypt: Image decryption options. Mandatory for encrypted images,
3417 # except when doing a metadata-only probe of the image.
3421 { 'struct': 'BlockdevOptionsQcow',
3422 'base': 'BlockdevOptionsGenericCOWFormat',
3423 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3426 # @BlockdevQcow2EncryptionFormat:
3428 # @aes: AES-CBC with plain64 initialization vectors
3432 { 'enum': 'BlockdevQcow2EncryptionFormat',
3433 'data': [ 'aes', 'luks' ] }
3436 # @BlockdevQcow2Encryption:
3440 { 'union': 'BlockdevQcow2Encryption',
3441 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3442 'discriminator': 'format',
3443 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3444 'luks': 'QCryptoBlockOptionsLUKS'} }
3447 # @BlockdevOptionsPreallocate:
3449 # Filter driver intended to be inserted between format and protocol
3450 # node and do preallocation in protocol node on write.
3452 # @prealloc-align: on preallocation, align file length to this number,
3453 # default 1048576 (1M)
3455 # @prealloc-size: how much to preallocate, default 134217728 (128M)
3459 { 'struct': 'BlockdevOptionsPreallocate',
3460 'base': 'BlockdevOptionsGenericFormat',
3461 'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } }
3464 # @BlockdevOptionsQcow2:
3466 # Driver specific block device options for qcow2.
3468 # @lazy-refcounts: whether to enable the lazy refcounts feature
3469 # (default is taken from the image file)
3471 # @pass-discard-request: whether discard requests to the qcow2 device
3472 # should be forwarded to the data source
3474 # @pass-discard-snapshot: whether discard requests for the data source
3475 # should be issued when a snapshot operation (e.g. deleting a
3476 # snapshot) frees clusters in the qcow2 file
3478 # @pass-discard-other: whether discard requests for the data source
3479 # should be issued on other occasions where a cluster gets freed
3481 # @overlap-check: which overlap checks to perform for writes to the
3482 # image, defaults to 'cached' (since 2.2)
3484 # @cache-size: the maximum total size of the L2 table and refcount
3485 # block caches in bytes (since 2.2)
3487 # @l2-cache-size: the maximum size of the L2 table cache in bytes
3490 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3491 # bytes. It must be a power of two between 512 and the cluster
3492 # size. The default value is the cluster size (since 2.12)
3494 # @refcount-cache-size: the maximum size of the refcount block cache
3495 # in bytes (since 2.2)
3497 # @cache-clean-interval: clean unused entries in the L2 and refcount
3498 # caches. The interval is in seconds. The default value is 600
3499 # on supporting platforms, and 0 on other platforms. 0 disables
3500 # this feature. (since 2.5)
3502 # @encrypt: Image decryption options. Mandatory for encrypted images,
3503 # except when doing a metadata-only probe of the image. (since
3506 # @data-file: reference to or definition of the external data file.
3507 # This may only be specified for images that require an external
3508 # data file. If it is not specified for such an image, the data
3509 # file name is loaded from the image file. (since 4.0)
3513 { 'struct': 'BlockdevOptionsQcow2',
3514 'base': 'BlockdevOptionsGenericCOWFormat',
3515 'data': { '*lazy-refcounts': 'bool',
3516 '*pass-discard-request': 'bool',
3517 '*pass-discard-snapshot': 'bool',
3518 '*pass-discard-other': 'bool',
3519 '*overlap-check': 'Qcow2OverlapChecks',
3520 '*cache-size': 'int',
3521 '*l2-cache-size': 'int',
3522 '*l2-cache-entry-size': 'int',
3523 '*refcount-cache-size': 'int',
3524 '*cache-clean-interval': 'int',
3525 '*encrypt': 'BlockdevQcow2Encryption',
3526 '*data-file': 'BlockdevRef' } }
3529 # @SshHostKeyCheckMode:
3531 # @none: Don't check the host key at all
3533 # @hash: Compare the host key with a given hash
3535 # @known_hosts: Check the host key against the known_hosts file
3539 { 'enum': 'SshHostKeyCheckMode',
3540 'data': [ 'none', 'hash', 'known_hosts' ] }
3543 # @SshHostKeyCheckHashType:
3545 # @md5: The given hash is an md5 hash
3547 # @sha1: The given hash is an sha1 hash
3549 # @sha256: The given hash is an sha256 hash
3553 { 'enum': 'SshHostKeyCheckHashType',
3554 'data': [ 'md5', 'sha1', 'sha256' ] }
3559 # @type: The hash algorithm used for the hash
3561 # @hash: The expected hash value
3565 { 'struct': 'SshHostKeyHash',
3566 'data': { 'type': 'SshHostKeyCheckHashType',
3574 { 'union': 'SshHostKeyCheck',
3575 'base': { 'mode': 'SshHostKeyCheckMode' },
3576 'discriminator': 'mode',
3577 'data': { 'hash': 'SshHostKeyHash' } }
3580 # @BlockdevOptionsSsh:
3582 # @server: host address
3584 # @path: path to the image on the host
3586 # @user: user as which to connect, defaults to current local user name
3588 # @host-key-check: Defines how and what to check the host key against
3589 # (default: known_hosts)
3593 { 'struct': 'BlockdevOptionsSsh',
3594 'data': { 'server': 'InetSocketAddress',
3597 '*host-key-check': 'SshHostKeyCheck' } }
3602 # Trigger events supported by blkdebug.
3604 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3607 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3609 # @cor_write: a write due to copy-on-read (since 2.11)
3611 # @cluster_alloc_space: an allocation of file space for a cluster
3614 # @none: triggers once at creation of the blkdebug node (since 4.1)
3618 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3619 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3620 'l1_grow_activate_table', 'l2_load', 'l2_update',
3621 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3622 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3623 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3624 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3625 'refblock_load', 'refblock_update', 'refblock_update_part',
3626 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3627 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3628 'refblock_alloc_switch_table', 'cluster_alloc',
3629 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3630 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3631 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3632 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3633 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3634 'cor_write', 'cluster_alloc_space', 'none'] }
3639 # Kinds of I/O that blkdebug can inject errors in.
3641 # @read: .bdrv_co_preadv()
3643 # @write: .bdrv_co_pwritev()
3645 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3647 # @discard: .bdrv_co_pdiscard()
3649 # @flush: .bdrv_co_flush_to_disk()
3651 # @block-status: .bdrv_co_block_status()
3655 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3656 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3660 # @BlkdebugInjectErrorOptions:
3662 # Describes a single error injection for blkdebug.
3664 # @event: trigger event
3666 # @state: the state identifier blkdebug needs to be in to actually
3667 # trigger the event; defaults to "any"
3669 # @iotype: the type of I/O operations on which this error should be
3670 # injected; defaults to "all read, write, write-zeroes, discard,
3671 # and flush operations" (since: 4.1)
3673 # @errno: error identifier (errno) to be returned; defaults to EIO
3675 # @sector: specifies the sector index which has to be affected in
3676 # order to actually trigger the event; defaults to "any sector"
3678 # @once: disables further events after this one has been triggered;
3681 # @immediately: fail immediately; defaults to false
3685 { 'struct': 'BlkdebugInjectErrorOptions',
3686 'data': { 'event': 'BlkdebugEvent',
3688 '*iotype': 'BlkdebugIOType',
3692 '*immediately': 'bool' } }
3695 # @BlkdebugSetStateOptions:
3697 # Describes a single state-change event for blkdebug.
3699 # @event: trigger event
3701 # @state: the current state identifier blkdebug needs to be in;
3704 # @new_state: the state identifier blkdebug is supposed to assume if
3705 # this event is triggered
3709 { 'struct': 'BlkdebugSetStateOptions',
3710 'data': { 'event': 'BlkdebugEvent',
3712 'new_state': 'int' } }
3715 # @BlockdevOptionsBlkdebug:
3717 # Driver specific block device options for blkdebug.
3719 # @image: underlying raw block device (or image file)
3721 # @config: filename of the configuration file
3723 # @align: required alignment for requests in bytes, must be positive
3724 # power of 2, or 0 for default
3726 # @max-transfer: maximum size for I/O transfers in bytes, must be
3727 # positive multiple of @align and of the underlying file's request
3728 # alignment (but need not be a power of 2), or 0 for default
3731 # @opt-write-zero: preferred alignment for write zero requests in
3732 # bytes, must be positive multiple of @align and of the underlying
3733 # file's request alignment (but need not be a power of 2), or 0
3734 # for default (since 2.10)
3736 # @max-write-zero: maximum size for write zero requests in bytes, must
3737 # be positive multiple of @align, of @opt-write-zero, and of the
3738 # underlying file's request alignment (but need not be a power of
3739 # 2), or 0 for default (since 2.10)
3741 # @opt-discard: preferred alignment for discard requests in bytes,
3742 # must be positive multiple of @align and of the underlying file's
3743 # request alignment (but need not be a power of 2), or 0 for
3744 # default (since 2.10)
3746 # @max-discard: maximum size for discard requests in bytes, must be
3747 # positive multiple of @align, of @opt-discard, and of the
3748 # underlying file's request alignment (but need not be a power of
3749 # 2), or 0 for default (since 2.10)
3751 # @inject-error: array of error injection descriptions
3753 # @set-state: array of state-change descriptions
3755 # @take-child-perms: Permissions to take on @image in addition to what
3756 # is necessary anyway (which depends on how the blkdebug node is
3757 # used). Defaults to none. (since 5.0)
3759 # @unshare-child-perms: Permissions not to share on @image in addition
3760 # to what cannot be shared anyway (which depends on how the
3761 # blkdebug node is used). Defaults to none. (since 5.0)
3765 { 'struct': 'BlockdevOptionsBlkdebug',
3766 'data': { 'image': 'BlockdevRef',
3768 '*align': 'int', '*max-transfer': 'int32',
3769 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3770 '*opt-discard': 'int32', '*max-discard': 'int32',
3771 '*inject-error': ['BlkdebugInjectErrorOptions'],
3772 '*set-state': ['BlkdebugSetStateOptions'],
3773 '*take-child-perms': ['BlockPermission'],
3774 '*unshare-child-perms': ['BlockPermission'] } }
3777 # @BlockdevOptionsBlklogwrites:
3779 # Driver specific block device options for blklogwrites.
3781 # @file: block device
3783 # @log: block device used to log writes to @file
3785 # @log-sector-size: sector size used in logging writes to @file,
3786 # determines granularity of offsets and sizes of writes
3789 # @log-append: append to an existing log (default: false)
3791 # @log-super-update-interval: interval of write requests after which
3792 # the log super block is updated to disk (default: 4096)
3796 { 'struct': 'BlockdevOptionsBlklogwrites',
3797 'data': { 'file': 'BlockdevRef',
3798 'log': 'BlockdevRef',
3799 '*log-sector-size': 'uint32',
3800 '*log-append': 'bool',
3801 '*log-super-update-interval': 'uint64' } }
3804 # @BlockdevOptionsBlkverify:
3806 # Driver specific block device options for blkverify.
3808 # @test: block device to be tested
3810 # @raw: raw image used for verification
3814 { 'struct': 'BlockdevOptionsBlkverify',
3815 'data': { 'test': 'BlockdevRef',
3816 'raw': 'BlockdevRef' } }
3819 # @BlockdevOptionsBlkreplay:
3821 # Driver specific block device options for blkreplay.
3823 # @image: disk image which should be controlled with blkreplay
3827 { 'struct': 'BlockdevOptionsBlkreplay',
3828 'data': { 'image': 'BlockdevRef' } }
3831 # @QuorumReadPattern:
3833 # An enumeration of quorum read patterns.
3835 # @quorum: read all the children and do a quorum vote on reads
3837 # @fifo: read only from the first child that has not failed
3841 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3844 # @BlockdevOptionsQuorum:
3846 # Driver specific block device options for Quorum
3848 # @blkverify: true if the driver must print content mismatch set to
3851 # @children: the children block devices to use
3853 # @vote-threshold: the vote limit under which a read will fail
3855 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3858 # @read-pattern: choose read pattern and set to quorum by default
3863 { 'struct': 'BlockdevOptionsQuorum',
3864 'data': { '*blkverify': 'bool',
3865 'children': [ 'BlockdevRef' ],
3866 'vote-threshold': 'int',
3867 '*rewrite-corrupted': 'bool',
3868 '*read-pattern': 'QuorumReadPattern' } }
3871 # @BlockdevOptionsGluster:
3873 # Driver specific block device options for Gluster
3875 # @volume: name of gluster volume where VM image resides
3877 # @path: absolute path to image file in gluster volume
3879 # @server: gluster servers description
3881 # @debug: libgfapi log level (default '4' which is Error) (Since 2.8)
3883 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3887 { 'struct': 'BlockdevOptionsGluster',
3888 'data': { 'volume': 'str',
3890 'server': ['SocketAddress'],
3892 '*logfile': 'str' } }
3895 # @BlockdevOptionsIoUring:
3897 # Driver specific block device options for the io_uring backend.
3899 # @filename: path to the image file
3903 { 'struct': 'BlockdevOptionsIoUring',
3904 'data': { 'filename': 'str' },
3905 'if': 'CONFIG_BLKIO' }
3908 # @BlockdevOptionsNvmeIoUring:
3910 # Driver specific block device options for the nvme-io_uring backend.
3912 # @path: path to the NVMe namespace's character device (e.g.
3917 { 'struct': 'BlockdevOptionsNvmeIoUring',
3918 'data': { 'path': 'str' },
3919 'if': 'CONFIG_BLKIO' }
3922 # @BlockdevOptionsVirtioBlkVfioPci:
3924 # Driver specific block device options for the virtio-blk-vfio-pci
3927 # @path: path to the PCI device's sysfs directory (e.g.
3928 # /sys/bus/pci/devices/0000:00:01.0).
3932 { 'struct': 'BlockdevOptionsVirtioBlkVfioPci',
3933 'data': { 'path': 'str' },
3934 'if': 'CONFIG_BLKIO' }
3937 # @BlockdevOptionsVirtioBlkVhostUser:
3939 # Driver specific block device options for the virtio-blk-vhost-user
3942 # @path: path to the vhost-user UNIX domain socket.
3946 { 'struct': 'BlockdevOptionsVirtioBlkVhostUser',
3947 'data': { 'path': 'str' },
3948 'if': 'CONFIG_BLKIO' }
3951 # @BlockdevOptionsVirtioBlkVhostVdpa:
3953 # Driver specific block device options for the virtio-blk-vhost-vdpa
3956 # @path: path to the vhost-vdpa character device.
3960 { 'struct': 'BlockdevOptionsVirtioBlkVhostVdpa',
3961 'data': { 'path': 'str' },
3962 'if': 'CONFIG_BLKIO' }
3967 # An enumeration of libiscsi transport types
3971 { 'enum': 'IscsiTransport',
3972 'data': [ 'tcp', 'iser' ] }
3975 # @IscsiHeaderDigest:
3977 # An enumeration of header digests supported by libiscsi
3981 { 'enum': 'IscsiHeaderDigest',
3982 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3983 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3986 # @BlockdevOptionsIscsi:
3988 # @transport: The iscsi transport type
3990 # @portal: The address of the iscsi portal
3992 # @target: The target iqn name
3994 # @lun: LUN to connect to. Defaults to 0.
3996 # @user: User name to log in with. If omitted, no CHAP authentication
3999 # @password-secret: The ID of a QCryptoSecret object providing the
4000 # password for the login. This option is required if @user is
4003 # @initiator-name: The iqn name we want to identify to the target as.
4004 # If this option is not specified, an initiator name is generated
4007 # @header-digest: The desired header digest. Defaults to none-crc32c.
4009 # @timeout: Timeout in seconds after which a request will timeout. 0
4010 # means no timeout and is the default.
4012 # Driver specific block device options for iscsi
4016 { 'struct': 'BlockdevOptionsIscsi',
4017 'data': { 'transport': 'IscsiTransport',
4022 '*password-secret': 'str',
4023 '*initiator-name': 'str',
4024 '*header-digest': 'IscsiHeaderDigest',
4025 '*timeout': 'int' } }
4032 { 'enum': 'RbdAuthMode',
4033 'data': [ 'cephx', 'none' ] }
4036 # @RbdImageEncryptionFormat:
4038 # @luks-any: Used for opening either luks or luks2 (Since 8.0)
4042 { 'enum': 'RbdImageEncryptionFormat',
4043 'data': [ 'luks', 'luks2', 'luks-any' ] }
4046 # @RbdEncryptionOptionsLUKSBase:
4048 # @key-secret: ID of a QCryptoSecret object providing a passphrase for
4049 # unlocking the encryption
4053 { 'struct': 'RbdEncryptionOptionsLUKSBase',
4054 'data': { 'key-secret': 'str' } }
4057 # @RbdEncryptionCreateOptionsLUKSBase:
4059 # @cipher-alg: The encryption algorithm
4063 { 'struct': 'RbdEncryptionCreateOptionsLUKSBase',
4064 'base': 'RbdEncryptionOptionsLUKSBase',
4065 'data': { '*cipher-alg': 'QCryptoCipherAlgorithm' } }
4068 # @RbdEncryptionOptionsLUKS:
4072 { 'struct': 'RbdEncryptionOptionsLUKS',
4073 'base': 'RbdEncryptionOptionsLUKSBase',
4077 # @RbdEncryptionOptionsLUKS2:
4081 { 'struct': 'RbdEncryptionOptionsLUKS2',
4082 'base': 'RbdEncryptionOptionsLUKSBase',
4086 # @RbdEncryptionOptionsLUKSAny:
4090 { 'struct': 'RbdEncryptionOptionsLUKSAny',
4091 'base': 'RbdEncryptionOptionsLUKSBase',
4095 # @RbdEncryptionCreateOptionsLUKS:
4099 { 'struct': 'RbdEncryptionCreateOptionsLUKS',
4100 'base': 'RbdEncryptionCreateOptionsLUKSBase',
4104 # @RbdEncryptionCreateOptionsLUKS2:
4108 { 'struct': 'RbdEncryptionCreateOptionsLUKS2',
4109 'base': 'RbdEncryptionCreateOptionsLUKSBase',
4113 # @RbdEncryptionOptions:
4115 # @format: Encryption format.
4117 # @parent: Parent image encryption options (for cloned images). Can
4118 # be left unspecified if this cloned image is encrypted using the
4119 # same format and secret as its parent image (i.e. not explicitly
4120 # formatted) or if its parent image is not encrypted. (Since 8.0)
4124 { 'union': 'RbdEncryptionOptions',
4125 'base': { 'format': 'RbdImageEncryptionFormat',
4126 '*parent': 'RbdEncryptionOptions' },
4127 'discriminator': 'format',
4128 'data': { 'luks': 'RbdEncryptionOptionsLUKS',
4129 'luks2': 'RbdEncryptionOptionsLUKS2',
4130 'luks-any': 'RbdEncryptionOptionsLUKSAny'} }
4133 # @RbdEncryptionCreateOptions:
4137 { 'union': 'RbdEncryptionCreateOptions',
4138 'base': { 'format': 'RbdImageEncryptionFormat' },
4139 'discriminator': 'format',
4140 'data': { 'luks': 'RbdEncryptionCreateOptionsLUKS',
4141 'luks2': 'RbdEncryptionCreateOptionsLUKS2' } }
4144 # @BlockdevOptionsRbd:
4146 # @pool: Ceph pool name.
4148 # @namespace: Rados namespace name in the Ceph pool. (Since 5.0)
4150 # @image: Image name in the Ceph pool.
4152 # @conf: path to Ceph configuration file. Values in the configuration
4153 # file will be overridden by options specified via QAPI.
4155 # @snapshot: Ceph snapshot name.
4157 # @encrypt: Image encryption options. (Since 6.1)
4159 # @user: Ceph id name.
4161 # @auth-client-required: Acceptable authentication modes. This maps
4162 # to Ceph configuration option "auth_client_required". (Since
4165 # @key-secret: ID of a QCryptoSecret object providing a key for cephx
4166 # authentication. This maps to Ceph configuration option "key".
4169 # @server: Monitor host address and port. This maps to the "mon_host"
4174 { 'struct': 'BlockdevOptionsRbd',
4175 'data': { 'pool': 'str',
4176 '*namespace': 'str',
4180 '*encrypt': 'RbdEncryptionOptions',
4182 '*auth-client-required': ['RbdAuthMode'],
4183 '*key-secret': 'str',
4184 '*server': ['InetSocketAddressBase'] } }
4189 # An enumeration of replication modes.
4191 # @primary: Primary mode, the vm's state will be sent to secondary
4194 # @secondary: Secondary mode, receive the vm's state from primary
4199 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
4200 'if': 'CONFIG_REPLICATION' }
4203 # @BlockdevOptionsReplication:
4205 # Driver specific block device options for replication
4207 # @mode: the replication mode
4209 # @top-id: In secondary mode, node name or device ID of the root node
4210 # who owns the replication node chain. Must not be given in
4215 { 'struct': 'BlockdevOptionsReplication',
4216 'base': 'BlockdevOptionsGenericFormat',
4217 'data': { 'mode': 'ReplicationMode',
4219 'if': 'CONFIG_REPLICATION' }
4224 # An enumeration of NFS transport types
4226 # @inet: TCP transport
4230 { 'enum': 'NFSTransport',
4231 'data': [ 'inet' ] }
4236 # Captures the address of the socket
4238 # @type: transport type used for NFS (only TCP supported)
4240 # @host: host address for NFS server
4244 { 'struct': 'NFSServer',
4245 'data': { 'type': 'NFSTransport',
4249 # @BlockdevOptionsNfs:
4251 # Driver specific block device option for NFS
4253 # @server: host address
4255 # @path: path of the image on the host
4257 # @user: UID value to use when talking to the server (defaults to
4258 # 65534 on Windows and getuid() on unix)
4260 # @group: GID value to use when talking to the server (defaults to
4261 # 65534 on Windows and getgid() in unix)
4263 # @tcp-syn-count: number of SYNs during the session establishment
4264 # (defaults to libnfs default)
4266 # @readahead-size: set the readahead size in bytes (defaults to libnfs
4269 # @page-cache-size: set the pagecache size in bytes (defaults to
4272 # @debug: set the NFS debug level (max 2) (defaults to libnfs default)
4276 { 'struct': 'BlockdevOptionsNfs',
4277 'data': { 'server': 'NFSServer',
4281 '*tcp-syn-count': 'int',
4282 '*readahead-size': 'int',
4283 '*page-cache-size': 'int',
4287 # @BlockdevOptionsCurlBase:
4289 # Driver specific block device options shared by all protocols
4290 # supported by the curl backend.
4292 # @url: URL of the image file
4294 # @readahead: Size of the read-ahead cache; must be a multiple of 512
4295 # (defaults to 256 kB)
4297 # @timeout: Timeout for connections, in seconds (defaults to 5)
4299 # @username: Username for authentication (defaults to none)
4301 # @password-secret: ID of a QCryptoSecret object providing a password
4302 # for authentication (defaults to no password)
4304 # @proxy-username: Username for proxy authentication (defaults to
4307 # @proxy-password-secret: ID of a QCryptoSecret object providing a
4308 # password for proxy authentication (defaults to no password)
4312 { 'struct': 'BlockdevOptionsCurlBase',
4313 'data': { 'url': 'str',
4314 '*readahead': 'int',
4317 '*password-secret': 'str',
4318 '*proxy-username': 'str',
4319 '*proxy-password-secret': 'str' } }
4322 # @BlockdevOptionsCurlHttp:
4324 # Driver specific block device options for HTTP connections over the
4325 # curl backend. URLs must start with "http://".
4327 # @cookie: List of cookies to set; format is "name1=content1;
4328 # name2=content2;" as explained by CURLOPT_COOKIE(3). Defaults to
4331 # @cookie-secret: ID of a QCryptoSecret object providing the cookie
4332 # data in a secure way. See @cookie for the format. (since 2.10)
4336 { 'struct': 'BlockdevOptionsCurlHttp',
4337 'base': 'BlockdevOptionsCurlBase',
4338 'data': { '*cookie': 'str',
4339 '*cookie-secret': 'str'} }
4342 # @BlockdevOptionsCurlHttps:
4344 # Driver specific block device options for HTTPS connections over the
4345 # curl backend. URLs must start with "https://".
4347 # @cookie: List of cookies to set; format is "name1=content1;
4348 # name2=content2;" as explained by CURLOPT_COOKIE(3). Defaults to
4351 # @sslverify: Whether to verify the SSL certificate's validity
4352 # (defaults to true)
4354 # @cookie-secret: ID of a QCryptoSecret object providing the cookie
4355 # data in a secure way. See @cookie for the format. (since 2.10)
4359 { 'struct': 'BlockdevOptionsCurlHttps',
4360 'base': 'BlockdevOptionsCurlBase',
4361 'data': { '*cookie': 'str',
4362 '*sslverify': 'bool',
4363 '*cookie-secret': 'str'} }
4366 # @BlockdevOptionsCurlFtp:
4368 # Driver specific block device options for FTP connections over the
4369 # curl backend. URLs must start with "ftp://".
4373 { 'struct': 'BlockdevOptionsCurlFtp',
4374 'base': 'BlockdevOptionsCurlBase',
4378 # @BlockdevOptionsCurlFtps:
4380 # Driver specific block device options for FTPS connections over the
4381 # curl backend. URLs must start with "ftps://".
4383 # @sslverify: Whether to verify the SSL certificate's validity
4384 # (defaults to true)
4388 { 'struct': 'BlockdevOptionsCurlFtps',
4389 'base': 'BlockdevOptionsCurlBase',
4390 'data': { '*sslverify': 'bool' } }
4393 # @BlockdevOptionsNbd:
4395 # Driver specific block device options for NBD.
4397 # @server: NBD server address
4399 # @export: export name
4401 # @tls-creds: TLS credentials ID
4403 # @tls-hostname: TLS hostname override for certificate validation
4406 # @x-dirty-bitmap: A metadata context name such as
4407 # "qemu:dirty-bitmap:NAME" or "qemu:allocation-depth" to query in
4408 # place of the traditional "base:allocation" block status (see
4409 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol; and yes, naming
4410 # this option x-context would have made more sense) (since 3.0)
4412 # @reconnect-delay: On an unexpected disconnect, the nbd client tries
4413 # to connect again until succeeding or encountering a serious
4414 # error. During the first @reconnect-delay seconds, all requests
4415 # are paused and will be rerun on a successful reconnect. After
4416 # that time, any delayed requests and all future requests before a
4417 # successful reconnect will immediately fail. Default 0 (Since
4420 # @open-timeout: In seconds. If zero, the nbd driver tries the
4421 # connection only once, and fails to open if the connection fails.
4422 # If non-zero, the nbd driver will repeat connection attempts
4423 # until successful or until @open-timeout seconds have elapsed.
4424 # Default 0 (Since 7.0)
4428 # @unstable: Member @x-dirty-bitmap is experimental.
4432 { 'struct': 'BlockdevOptionsNbd',
4433 'data': { 'server': 'SocketAddress',
4435 '*tls-creds': 'str',
4436 '*tls-hostname': 'str',
4437 '*x-dirty-bitmap': { 'type': 'str', 'features': [ 'unstable' ] },
4438 '*reconnect-delay': 'uint32',
4439 '*open-timeout': 'uint32' } }
4442 # @BlockdevOptionsRaw:
4444 # Driver specific block device options for the raw driver.
4446 # @offset: position where the block device starts
4448 # @size: the assumed size of the device
4452 { 'struct': 'BlockdevOptionsRaw',
4453 'base': 'BlockdevOptionsGenericFormat',
4454 'data': { '*offset': 'int', '*size': 'int' } }
4457 # @BlockdevOptionsThrottle:
4459 # Driver specific block device options for the throttle driver
4461 # @throttle-group: the name of the throttle-group object to use. It
4462 # must already exist.
4464 # @file: reference to or definition of the data source block device
4468 { 'struct': 'BlockdevOptionsThrottle',
4469 'data': { 'throttle-group': 'str',
4470 'file' : 'BlockdevRef'
4474 # @BlockdevOptionsCor:
4476 # Driver specific block device options for the copy-on-read driver.
4478 # @bottom: The name of a non-filter node (allocation-bearing layer)
4479 # that limits the COR operations in the backing chain (inclusive),
4480 # so that no data below this node will be copied by this filter.
4481 # If option is absent, the limit is not applied, so that data from
4482 # all backing layers may be copied.
4486 { 'struct': 'BlockdevOptionsCor',
4487 'base': 'BlockdevOptionsGenericFormat',
4488 'data': { '*bottom': 'str' } }
4493 # An enumeration of possible behaviors for copy-before-write operation
4496 # @break-guest-write: report the error to the guest. This way, the
4497 # guest will not be able to overwrite areas that cannot be backed
4498 # up, so the backup process remains valid.
4500 # @break-snapshot: continue guest write. Doing so will make the
4501 # provided snapshot state invalid and any backup or export process
4502 # based on it will finally fail.
4506 { 'enum': 'OnCbwError',
4507 'data': [ 'break-guest-write', 'break-snapshot' ] }
4510 # @BlockdevOptionsCbw:
4512 # Driver specific block device options for the copy-before-write
4513 # driver, which does so called copy-before-write operations: when data
4514 # is written to the filter, the filter first reads corresponding
4515 # blocks from its file child and copies them to @target child. After
4516 # successfully copying, the write request is propagated to file child.
4517 # If copying fails, the original write request is failed too and no
4518 # data is written to file child.
4520 # @target: The target for copy-before-write operations.
4522 # @bitmap: If specified, copy-before-write filter will do
4523 # copy-before-write operations only for dirty regions of the
4524 # bitmap. Bitmap size must be equal to length of file and target
4525 # child of the filter. Note also, that bitmap is used only to
4526 # initialize internal bitmap of the process, so further
4527 # modifications (or removing) of specified bitmap doesn't
4528 # influence the filter. (Since 7.0)
4530 # @on-cbw-error: Behavior on failure of copy-before-write operation.
4531 # Default is @break-guest-write. (Since 7.1)
4533 # @cbw-timeout: Zero means no limit. Non-zero sets the timeout in
4534 # seconds for copy-before-write operation. When a timeout occurs,
4535 # the respective copy-before-write operation will fail, and the
4536 # @on-cbw-error parameter will decide how this failure is handled.
4537 # Default 0. (Since 7.1)
4541 { 'struct': 'BlockdevOptionsCbw',
4542 'base': 'BlockdevOptionsGenericFormat',
4543 'data': { 'target': 'BlockdevRef', '*bitmap': 'BlockDirtyBitmap',
4544 '*on-cbw-error': 'OnCbwError', '*cbw-timeout': 'uint32' } }
4549 # Options for creating a block device. Many options are available for
4550 # all block devices, independent of the block driver:
4552 # @driver: block driver name
4554 # @node-name: the node name of the new node (Since 2.0). This option
4555 # is required on the top level of blockdev-add. Valid node names
4556 # start with an alphabetic character and may contain only
4557 # alphanumeric characters, '-', '.' and '_'. Their maximum length
4560 # @discard: discard-related options (default: ignore)
4562 # @cache: cache-related options
4564 # @read-only: whether the block device should be read-only (default:
4565 # false). Note that some block drivers support only read-only
4566 # access, either generally or in certain configurations. In this
4567 # case, the default value does not work and the option must be
4568 # specified explicitly.
4570 # @auto-read-only: if true and @read-only is false, QEMU may
4571 # automatically decide not to open the image read-write as
4572 # requested, but fall back to read-only instead (and switch
4573 # between the modes later), e.g. depending on whether the image
4574 # file is writable or whether a writing user is attached to the
4575 # node (default: false, since 3.1)
4577 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
4580 # @force-share: force share all permission on added nodes. Requires
4581 # read-only=true. (Since 2.10)
4583 # Remaining options are determined by the block driver.
4587 { 'union': 'BlockdevOptions',
4588 'base': { 'driver': 'BlockdevDriver',
4589 '*node-name': 'str',
4590 '*discard': 'BlockdevDiscardOptions',
4591 '*cache': 'BlockdevCacheOptions',
4592 '*read-only': 'bool',
4593 '*auto-read-only': 'bool',
4594 '*force-share': 'bool',
4595 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
4596 'discriminator': 'driver',
4598 'blkdebug': 'BlockdevOptionsBlkdebug',
4599 'blklogwrites':'BlockdevOptionsBlklogwrites',
4600 'blkverify': 'BlockdevOptionsBlkverify',
4601 'blkreplay': 'BlockdevOptionsBlkreplay',
4602 'bochs': 'BlockdevOptionsGenericFormat',
4603 'cloop': 'BlockdevOptionsGenericFormat',
4604 'compress': 'BlockdevOptionsGenericFormat',
4605 'copy-before-write':'BlockdevOptionsCbw',
4606 'copy-on-read':'BlockdevOptionsCor',
4607 'dmg': 'BlockdevOptionsGenericFormat',
4608 'file': 'BlockdevOptionsFile',
4609 'ftp': 'BlockdevOptionsCurlFtp',
4610 'ftps': 'BlockdevOptionsCurlFtps',
4611 'gluster': 'BlockdevOptionsGluster',
4612 'host_cdrom': { 'type': 'BlockdevOptionsFile',
4613 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4614 'host_device': { 'type': 'BlockdevOptionsFile',
4615 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4616 'http': 'BlockdevOptionsCurlHttp',
4617 'https': 'BlockdevOptionsCurlHttps',
4618 'io_uring': { 'type': 'BlockdevOptionsIoUring',
4619 'if': 'CONFIG_BLKIO' },
4620 'iscsi': 'BlockdevOptionsIscsi',
4621 'luks': 'BlockdevOptionsLUKS',
4622 'nbd': 'BlockdevOptionsNbd',
4623 'nfs': 'BlockdevOptionsNfs',
4624 'null-aio': 'BlockdevOptionsNull',
4625 'null-co': 'BlockdevOptionsNull',
4626 'nvme': 'BlockdevOptionsNVMe',
4627 'nvme-io_uring': { 'type': 'BlockdevOptionsNvmeIoUring',
4628 'if': 'CONFIG_BLKIO' },
4629 'parallels': 'BlockdevOptionsGenericFormat',
4630 'preallocate':'BlockdevOptionsPreallocate',
4631 'qcow2': 'BlockdevOptionsQcow2',
4632 'qcow': 'BlockdevOptionsQcow',
4633 'qed': 'BlockdevOptionsGenericCOWFormat',
4634 'quorum': 'BlockdevOptionsQuorum',
4635 'raw': 'BlockdevOptionsRaw',
4636 'rbd': 'BlockdevOptionsRbd',
4637 'replication': { 'type': 'BlockdevOptionsReplication',
4638 'if': 'CONFIG_REPLICATION' },
4639 'snapshot-access': 'BlockdevOptionsGenericFormat',
4640 'ssh': 'BlockdevOptionsSsh',
4641 'throttle': 'BlockdevOptionsThrottle',
4642 'vdi': 'BlockdevOptionsGenericFormat',
4643 'vhdx': 'BlockdevOptionsGenericFormat',
4644 'virtio-blk-vfio-pci':
4645 { 'type': 'BlockdevOptionsVirtioBlkVfioPci',
4646 'if': 'CONFIG_BLKIO' },
4647 'virtio-blk-vhost-user':
4648 { 'type': 'BlockdevOptionsVirtioBlkVhostUser',
4649 'if': 'CONFIG_BLKIO' },
4650 'virtio-blk-vhost-vdpa':
4651 { 'type': 'BlockdevOptionsVirtioBlkVhostVdpa',
4652 'if': 'CONFIG_BLKIO' },
4653 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4654 'vpc': 'BlockdevOptionsGenericFormat',
4655 'vvfat': 'BlockdevOptionsVVFAT'
4661 # Reference to a block device.
4663 # @definition: defines a new block device inline
4665 # @reference: references the ID of an existing block device
4669 { 'alternate': 'BlockdevRef',
4670 'data': { 'definition': 'BlockdevOptions',
4671 'reference': 'str' } }
4674 # @BlockdevRefOrNull:
4676 # Reference to a block device.
4678 # @definition: defines a new block device inline
4680 # @reference: references the ID of an existing block device. An empty
4681 # string means that no block device should be referenced.
4682 # Deprecated; use null instead.
4684 # @null: No block device should be referenced (since 2.10)
4688 { 'alternate': 'BlockdevRefOrNull',
4689 'data': { 'definition': 'BlockdevOptions',
4696 # Creates a new block device.
4702 # -> { "execute": "blockdev-add",
4704 # "driver": "qcow2",
4705 # "node-name": "test1",
4708 # "filename": "test.qcow2"
4712 # <- { "return": {} }
4714 # -> { "execute": "blockdev-add",
4716 # "driver": "qcow2",
4717 # "node-name": "node0",
4718 # "discard": "unmap",
4724 # "filename": "/tmp/test.qcow2"
4730 # "filename": "/dev/fdset/4"
4736 # <- { "return": {} }
4738 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true,
4739 'allow-preconfig': true }
4744 # Reopens one or more block devices using the given set of options.
4745 # Any option not specified will be reset to its default value
4746 # regardless of its previous status. If an option cannot be changed
4747 # or a particular driver does not support reopening then the command
4748 # will return an error. All devices in the list are reopened in one
4749 # transaction, so if one of them fails then the whole transaction is
4752 # The command receives a list of block devices to reopen. For each
4753 # one of them, the top-level @node-name option (from BlockdevOptions)
4754 # must be specified and is used to select the block device to be
4755 # reopened. Other @node-name options must be either omitted or set to
4756 # the current name of the appropriate node. This command won't change
4757 # any node name and any attempt to do it will result in an error.
4759 # In the case of options that refer to child nodes, the behavior of
4760 # this command depends on the value:
4762 # 1) A set of options (BlockdevOptions): the child is reopened with
4763 # the specified set of options.
4765 # 2) A reference to the current child: the child is reopened using
4766 # its existing set of options.
4768 # 3) A reference to a different node: the current child is replaced
4769 # with the specified one.
4771 # 4) NULL: the current child (if any) is detached.
4773 # Options (1) and (2) are supported in all cases. Option (3) is
4774 # supported for @file and @backing, and option (4) for @backing only.
4776 # Unlike with blockdev-add, the @backing option must always be present
4777 # unless the node being reopened does not have a backing file and its
4778 # image does not have a default backing file name as part of its
4783 { 'command': 'blockdev-reopen',
4784 'data': { 'options': ['BlockdevOptions'] },
4785 'allow-preconfig': true }
4790 # Deletes a block device that has been added using blockdev-add. The
4791 # command will fail if the node is attached to a device or is
4792 # otherwise being used.
4794 # @node-name: Name of the graph node to delete.
4800 # -> { "execute": "blockdev-add",
4802 # "driver": "qcow2",
4803 # "node-name": "node0",
4806 # "filename": "test.qcow2"
4810 # <- { "return": {} }
4812 # -> { "execute": "blockdev-del",
4813 # "arguments": { "node-name": "node0" }
4815 # <- { "return": {} }
4817 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' },
4818 'allow-preconfig': true }
4821 # @BlockdevCreateOptionsFile:
4823 # Driver specific image creation options for file.
4825 # @filename: Filename for the new image file
4827 # @size: Size of the virtual disk in bytes
4829 # @preallocation: Preallocation mode for the new image (default: off;
4830 # allowed values: off, falloc (if CONFIG_POSIX_FALLOCATE), full
4831 # (if CONFIG_POSIX))
4833 # @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
4835 # @extent-size-hint: Extent size hint to add to the image file; 0 for
4836 # not adding an extent size hint (default: 1 MB, since 5.1)
4840 { 'struct': 'BlockdevCreateOptionsFile',
4841 'data': { 'filename': 'str',
4843 '*preallocation': 'PreallocMode',
4845 '*extent-size-hint': 'size'} }
4848 # @BlockdevCreateOptionsGluster:
4850 # Driver specific image creation options for gluster.
4852 # @location: Where to store the new image file
4854 # @size: Size of the virtual disk in bytes
4856 # @preallocation: Preallocation mode for the new image (default: off;
4857 # allowed values: off, falloc (if CONFIG_GLUSTERFS_FALLOCATE),
4858 # full (if CONFIG_GLUSTERFS_ZEROFILL))
4862 { 'struct': 'BlockdevCreateOptionsGluster',
4863 'data': { 'location': 'BlockdevOptionsGluster',
4865 '*preallocation': 'PreallocMode' } }
4868 # @BlockdevCreateOptionsLUKS:
4870 # Driver specific image creation options for LUKS.
4872 # @file: Node to create the image format on
4874 # @size: Size of the virtual disk in bytes
4876 # @preallocation: Preallocation mode for the new image (since: 4.2)
4877 # (default: off; allowed values: off, metadata, falloc, full)
4881 { 'struct': 'BlockdevCreateOptionsLUKS',
4882 'base': 'QCryptoBlockCreateOptionsLUKS',
4883 'data': { 'file': 'BlockdevRef',
4885 '*preallocation': 'PreallocMode' } }
4888 # @BlockdevCreateOptionsNfs:
4890 # Driver specific image creation options for NFS.
4892 # @location: Where to store the new image file
4894 # @size: Size of the virtual disk in bytes
4898 { 'struct': 'BlockdevCreateOptionsNfs',
4899 'data': { 'location': 'BlockdevOptionsNfs',
4903 # @BlockdevCreateOptionsParallels:
4905 # Driver specific image creation options for parallels.
4907 # @file: Node to create the image format on
4909 # @size: Size of the virtual disk in bytes
4911 # @cluster-size: Cluster size in bytes (default: 1 MB)
4915 { 'struct': 'BlockdevCreateOptionsParallels',
4916 'data': { 'file': 'BlockdevRef',
4918 '*cluster-size': 'size' } }
4921 # @BlockdevCreateOptionsQcow:
4923 # Driver specific image creation options for qcow.
4925 # @file: Node to create the image format on
4927 # @size: Size of the virtual disk in bytes
4929 # @backing-file: File name of the backing file if a backing file
4932 # @encrypt: Encryption options if the image should be encrypted
4936 { 'struct': 'BlockdevCreateOptionsQcow',
4937 'data': { 'file': 'BlockdevRef',
4939 '*backing-file': 'str',
4940 '*encrypt': 'QCryptoBlockCreateOptions' } }
4943 # @BlockdevQcow2Version:
4945 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version
4948 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4952 { 'enum': 'BlockdevQcow2Version',
4953 'data': [ 'v2', 'v3' ] }
4956 # @Qcow2CompressionType:
4958 # Compression type used in qcow2 image file
4960 # @zlib: zlib compression, see <http://zlib.net/>
4962 # @zstd: zstd compression, see <http://github.com/facebook/zstd>
4966 { 'enum': 'Qcow2CompressionType',
4967 'data': [ 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
4970 # @BlockdevCreateOptionsQcow2:
4972 # Driver specific image creation options for qcow2.
4974 # @file: Node to create the image format on
4976 # @data-file: Node to use as an external data file in which all guest
4977 # data is stored so that only metadata remains in the qcow2 file
4980 # @data-file-raw: True if the external data file must stay valid as a
4981 # standalone (read-only) raw image without looking at qcow2
4982 # metadata (default: false; since: 4.0)
4984 # @extended-l2: True to make the image have extended L2 entries
4985 # (default: false; since 5.2)
4987 # @size: Size of the virtual disk in bytes
4989 # @version: Compatibility level (default: v3)
4991 # @backing-file: File name of the backing file if a backing file
4994 # @backing-fmt: Name of the block driver to use for the backing file
4996 # @encrypt: Encryption options if the image should be encrypted
4998 # @cluster-size: qcow2 cluster size in bytes (default: 65536)
5000 # @preallocation: Preallocation mode for the new image (default: off;
5001 # allowed values: off, falloc, full, metadata)
5003 # @lazy-refcounts: True if refcounts may be updated lazily
5006 # @refcount-bits: Width of reference counts in bits (default: 16)
5008 # @compression-type: The image cluster compression method
5009 # (default: zlib, since 5.1)
5013 { 'struct': 'BlockdevCreateOptionsQcow2',
5014 'data': { 'file': 'BlockdevRef',
5015 '*data-file': 'BlockdevRef',
5016 '*data-file-raw': 'bool',
5017 '*extended-l2': 'bool',
5019 '*version': 'BlockdevQcow2Version',
5020 '*backing-file': 'str',
5021 '*backing-fmt': 'BlockdevDriver',
5022 '*encrypt': 'QCryptoBlockCreateOptions',
5023 '*cluster-size': 'size',
5024 '*preallocation': 'PreallocMode',
5025 '*lazy-refcounts': 'bool',
5026 '*refcount-bits': 'int',
5027 '*compression-type':'Qcow2CompressionType' } }
5030 # @BlockdevCreateOptionsQed:
5032 # Driver specific image creation options for qed.
5034 # @file: Node to create the image format on
5036 # @size: Size of the virtual disk in bytes
5038 # @backing-file: File name of the backing file if a backing file
5041 # @backing-fmt: Name of the block driver to use for the backing file
5043 # @cluster-size: Cluster size in bytes (default: 65536)
5045 # @table-size: L1/L2 table size (in clusters)
5049 { 'struct': 'BlockdevCreateOptionsQed',
5050 'data': { 'file': 'BlockdevRef',
5052 '*backing-file': 'str',
5053 '*backing-fmt': 'BlockdevDriver',
5054 '*cluster-size': 'size',
5055 '*table-size': 'int' } }
5058 # @BlockdevCreateOptionsRbd:
5060 # Driver specific image creation options for rbd/Ceph.
5062 # @location: Where to store the new image file. This location cannot
5063 # point to a snapshot.
5065 # @size: Size of the virtual disk in bytes
5067 # @cluster-size: RBD object size
5069 # @encrypt: Image encryption options. (Since 6.1)
5073 { 'struct': 'BlockdevCreateOptionsRbd',
5074 'data': { 'location': 'BlockdevOptionsRbd',
5076 '*cluster-size' : 'size',
5077 '*encrypt' : 'RbdEncryptionCreateOptions' } }
5080 # @BlockdevVmdkSubformat:
5082 # Subformat options for VMDK images
5084 # @monolithicSparse: Single file image with sparse cluster allocation
5086 # @monolithicFlat: Single flat data image and a descriptor file
5088 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA)
5089 # sparse extent files, in addition to a descriptor file
5091 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat
5092 # extent files, in addition to a descriptor file
5094 # @streamOptimized: Single file image sparse cluster allocation,
5095 # optimized for streaming over network.
5099 { 'enum': 'BlockdevVmdkSubformat',
5100 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
5101 'twoGbMaxExtentFlat', 'streamOptimized'] }
5104 # @BlockdevVmdkAdapterType:
5106 # Adapter type info for VMDK images
5110 { 'enum': 'BlockdevVmdkAdapterType',
5111 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
5114 # @BlockdevCreateOptionsVmdk:
5116 # Driver specific image creation options for VMDK.
5118 # @file: Where to store the new image file. This refers to the image
5119 # file for monolithcSparse and streamOptimized format, or the
5120 # descriptor file for other formats.
5122 # @size: Size of the virtual disk in bytes
5124 # @extents: Where to store the data extents. Required for
5125 # monolithcFlat, twoGbMaxExtentSparse and twoGbMaxExtentFlat
5126 # formats. For monolithicFlat, only one entry is required; for
5127 # twoGbMaxExtent* formats, the number of entries required is
5128 # calculated as extent_number = virtual_size / 2GB. Providing more
5129 # extents than will be used is an error.
5131 # @subformat: The subformat of the VMDK image. Default:
5132 # "monolithicSparse".
5134 # @backing-file: The path of backing file. Default: no backing file
5137 # @adapter-type: The adapter type used to fill in the descriptor.
5140 # @hwversion: Hardware version. The meaningful options are "4" or
5141 # "6". Default: "4".
5143 # @toolsversion: VMware guest tools version. Default: "2147483647"
5146 # @zeroed-grain: Whether to enable zeroed-grain feature for sparse
5147 # subformats. Default: false.
5151 { 'struct': 'BlockdevCreateOptionsVmdk',
5152 'data': { 'file': 'BlockdevRef',
5154 '*extents': ['BlockdevRef'],
5155 '*subformat': 'BlockdevVmdkSubformat',
5156 '*backing-file': 'str',
5157 '*adapter-type': 'BlockdevVmdkAdapterType',
5158 '*hwversion': 'str',
5159 '*toolsversion': 'str',
5160 '*zeroed-grain': 'bool' } }
5163 # @BlockdevCreateOptionsSsh:
5165 # Driver specific image creation options for SSH.
5167 # @location: Where to store the new image file
5169 # @size: Size of the virtual disk in bytes
5173 { 'struct': 'BlockdevCreateOptionsSsh',
5174 'data': { 'location': 'BlockdevOptionsSsh',
5178 # @BlockdevCreateOptionsVdi:
5180 # Driver specific image creation options for VDI.
5182 # @file: Node to create the image format on
5184 # @size: Size of the virtual disk in bytes
5186 # @preallocation: Preallocation mode for the new image (default: off;
5187 # allowed values: off, metadata)
5191 { 'struct': 'BlockdevCreateOptionsVdi',
5192 'data': { 'file': 'BlockdevRef',
5194 '*preallocation': 'PreallocMode' } }
5197 # @BlockdevVhdxSubformat:
5199 # @dynamic: Growing image file
5201 # @fixed: Preallocated fixed-size image file
5205 { 'enum': 'BlockdevVhdxSubformat',
5206 'data': [ 'dynamic', 'fixed' ] }
5209 # @BlockdevCreateOptionsVhdx:
5211 # Driver specific image creation options for vhdx.
5213 # @file: Node to create the image format on
5215 # @size: Size of the virtual disk in bytes
5217 # @log-size: Log size in bytes, must be a multiple of 1 MB (default: 1
5220 # @block-size: Block size in bytes, must be a multiple of 1 MB and not
5221 # larger than 256 MB (default: automatically choose a block size
5222 # depending on the image size)
5224 # @subformat: vhdx subformat (default: dynamic)
5226 # @block-state-zero: Force use of payload blocks of type
5227 # 'ZERO'. Non-standard, but default. Do not set to 'off' when
5228 # using 'qemu-img convert' with subformat=dynamic.
5232 { 'struct': 'BlockdevCreateOptionsVhdx',
5233 'data': { 'file': 'BlockdevRef',
5235 '*log-size': 'size',
5236 '*block-size': 'size',
5237 '*subformat': 'BlockdevVhdxSubformat',
5238 '*block-state-zero': 'bool' } }
5241 # @BlockdevVpcSubformat:
5243 # @dynamic: Growing image file
5245 # @fixed: Preallocated fixed-size image file
5249 { 'enum': 'BlockdevVpcSubformat',
5250 'data': [ 'dynamic', 'fixed' ] }
5253 # @BlockdevCreateOptionsVpc:
5255 # Driver specific image creation options for vpc (VHD).
5257 # @file: Node to create the image format on
5259 # @size: Size of the virtual disk in bytes
5261 # @subformat: vhdx subformat (default: dynamic)
5263 # @force-size: Force use of the exact byte size instead of rounding to
5264 # the next size that can be represented in CHS geometry
5269 { 'struct': 'BlockdevCreateOptionsVpc',
5270 'data': { 'file': 'BlockdevRef',
5272 '*subformat': 'BlockdevVpcSubformat',
5273 '*force-size': 'bool' } }
5276 # @BlockdevCreateOptions:
5278 # Options for creating an image format on a given node.
5280 # @driver: block driver to create the image format
5284 { 'union': 'BlockdevCreateOptions',
5286 'driver': 'BlockdevDriver' },
5287 'discriminator': 'driver',
5289 'file': 'BlockdevCreateOptionsFile',
5290 'gluster': 'BlockdevCreateOptionsGluster',
5291 'luks': 'BlockdevCreateOptionsLUKS',
5292 'nfs': 'BlockdevCreateOptionsNfs',
5293 'parallels': 'BlockdevCreateOptionsParallels',
5294 'qcow': 'BlockdevCreateOptionsQcow',
5295 'qcow2': 'BlockdevCreateOptionsQcow2',
5296 'qed': 'BlockdevCreateOptionsQed',
5297 'rbd': 'BlockdevCreateOptionsRbd',
5298 'ssh': 'BlockdevCreateOptionsSsh',
5299 'vdi': 'BlockdevCreateOptionsVdi',
5300 'vhdx': 'BlockdevCreateOptionsVhdx',
5301 'vmdk': 'BlockdevCreateOptionsVmdk',
5302 'vpc': 'BlockdevCreateOptionsVpc'
5308 # Starts a job to create an image format on a given node. The job is
5309 # automatically finalized, but a manual job-dismiss is required.
5311 # @job-id: Identifier for the newly created job.
5313 # @options: Options for the image creation.
5317 { 'command': 'blockdev-create',
5318 'data': { 'job-id': 'str',
5319 'options': 'BlockdevCreateOptions' },
5320 'allow-preconfig': true }
5323 # @BlockdevAmendOptionsLUKS:
5325 # Driver specific image amend options for LUKS.
5329 { 'struct': 'BlockdevAmendOptionsLUKS',
5330 'base': 'QCryptoBlockAmendOptionsLUKS',
5335 # @BlockdevAmendOptionsQcow2:
5337 # Driver specific image amend options for qcow2. For now, only
5338 # encryption options can be amended
5340 # @encrypt: Encryption options to be amended
5344 { 'struct': 'BlockdevAmendOptionsQcow2',
5345 'data': { '*encrypt': 'QCryptoBlockAmendOptions' } }
5348 # @BlockdevAmendOptions:
5350 # Options for amending an image format
5352 # @driver: Block driver of the node to amend.
5356 { 'union': 'BlockdevAmendOptions',
5358 'driver': 'BlockdevDriver' },
5359 'discriminator': 'driver',
5361 'luks': 'BlockdevAmendOptionsLUKS',
5362 'qcow2': 'BlockdevAmendOptionsQcow2' } }
5365 # @x-blockdev-amend:
5367 # Starts a job to amend format specific options of an existing open
5368 # block device The job is automatically finalized, but a manual
5369 # job-dismiss is required.
5371 # @job-id: Identifier for the newly created job.
5373 # @node-name: Name of the block node to work on
5375 # @options: Options (driver specific)
5377 # @force: Allow unsafe operations, format specific For luks that
5378 # allows erase of the last active keyslot (permanent loss of
5379 # data), and replacement of an active keyslot (possible loss of
5380 # data if IO error happens)
5384 # @unstable: This command is experimental.
5388 { 'command': 'x-blockdev-amend',
5389 'data': { 'job-id': 'str',
5391 'options': 'BlockdevAmendOptions',
5393 'features': [ 'unstable' ],
5394 'allow-preconfig': true }
5397 # @BlockErrorAction:
5399 # An enumeration of action that has been taken when a DISK I/O occurs
5401 # @ignore: error has been ignored
5403 # @report: error has been reported to the device
5405 # @stop: error caused VM to be stopped
5409 { 'enum': 'BlockErrorAction',
5410 'data': [ 'ignore', 'report', 'stop' ] }
5413 # @BLOCK_IMAGE_CORRUPTED:
5415 # Emitted when a disk image is being marked corrupt. The image can be
5416 # identified by its device or node name. The 'device' field is always
5417 # present for compatibility reasons, but it can be empty ("") if the
5418 # image does not have a device name associated.
5420 # @device: device name. This is always present for compatibility
5421 # reasons, but it can be empty ("") if the image does not have a
5422 # device name associated.
5424 # @node-name: node name (Since: 2.4)
5426 # @msg: informative message for human consumption, such as the kind of
5427 # corruption being detected. It should not be parsed by machine
5428 # as it is not guaranteed to be stable
5430 # @offset: if the corruption resulted from an image access, this is
5431 # the host's access offset into the image
5433 # @size: if the corruption resulted from an image access, this is the
5436 # @fatal: if set, the image is marked corrupt and therefore unusable
5437 # after this event and must be repaired (Since 2.2; before, every
5438 # BLOCK_IMAGE_CORRUPTED event was fatal)
5440 # Note: If action is "stop", a STOP event will eventually follow the
5441 # BLOCK_IO_ERROR event.
5445 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
5446 # "data": { "device": "", "node-name": "drive", "fatal": false,
5447 # "msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)" },
5448 # "timestamp": { "seconds": 1648243240, "microseconds": 906060 } }
5452 { 'event': 'BLOCK_IMAGE_CORRUPTED',
5453 'data': { 'device' : 'str',
5454 '*node-name' : 'str',
5458 'fatal' : 'bool' } }
5463 # Emitted when a disk I/O error occurs
5465 # @device: device name. This is always present for compatibility
5466 # reasons, but it can be empty ("") if the image does not have a
5467 # device name associated.
5469 # @node-name: node name. Note that errors may be reported for the
5470 # root node that is directly attached to a guest device rather
5471 # than for the node where the error occurred. The node name is
5472 # not present if the drive is empty. (Since: 2.8)
5474 # @operation: I/O operation
5476 # @action: action that has been taken
5478 # @nospace: true if I/O error was caused due to a no-space condition.
5479 # This key is only present if query-block's io-status is present,
5480 # please see query-block documentation for more information
5483 # @reason: human readable string describing the error cause. (This
5484 # field is a debugging aid for humans, it should not be parsed by
5485 # applications) (since: 2.2)
5487 # Note: If action is "stop", a STOP event will eventually follow the
5488 # BLOCK_IO_ERROR event
5494 # <- { "event": "BLOCK_IO_ERROR",
5495 # "data": { "device": "ide0-hd1",
5496 # "node-name": "#block212",
5497 # "operation": "write",
5499 # "reason": "No space left on device" },
5500 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5502 { 'event': 'BLOCK_IO_ERROR',
5503 'data': { 'device': 'str', '*node-name': 'str',
5504 'operation': 'IoOperationType',
5505 'action': 'BlockErrorAction', '*nospace': 'bool',
5509 # @BLOCK_JOB_COMPLETED:
5511 # Emitted when a block job has completed
5515 # @device: The job identifier. Originally the device name but other
5516 # values are allowed since QEMU 2.7
5518 # @len: maximum progress value
5520 # @offset: current progress value. On success this is equal to len.
5521 # On failure this is less than len
5523 # @speed: rate limit, bytes per second
5525 # @error: error message. Only present on failure. This field
5526 # contains a human-readable error message. There are no semantics
5527 # other than that streaming has failed and clients should not try
5528 # to interpret the error string
5534 # <- { "event": "BLOCK_JOB_COMPLETED",
5535 # "data": { "type": "stream", "device": "virtio-disk0",
5536 # "len": 10737418240, "offset": 10737418240,
5538 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5540 { 'event': 'BLOCK_JOB_COMPLETED',
5541 'data': { 'type' : 'JobType',
5549 # @BLOCK_JOB_CANCELLED:
5551 # Emitted when a block job has been cancelled
5555 # @device: The job identifier. Originally the device name but other
5556 # values are allowed since QEMU 2.7
5558 # @len: maximum progress value
5560 # @offset: current progress value. On success this is equal to len.
5561 # On failure this is less than len
5563 # @speed: rate limit, bytes per second
5569 # <- { "event": "BLOCK_JOB_CANCELLED",
5570 # "data": { "type": "stream", "device": "virtio-disk0",
5571 # "len": 10737418240, "offset": 134217728,
5573 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5575 { 'event': 'BLOCK_JOB_CANCELLED',
5576 'data': { 'type' : 'JobType',
5585 # Emitted when a block job encounters an error
5587 # @device: The job identifier. Originally the device name but other
5588 # values are allowed since QEMU 2.7
5590 # @operation: I/O operation
5592 # @action: action that has been taken
5598 # <- { "event": "BLOCK_JOB_ERROR",
5599 # "data": { "device": "ide0-hd1",
5600 # "operation": "write",
5601 # "action": "stop" },
5602 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5604 { 'event': 'BLOCK_JOB_ERROR',
5605 'data': { 'device' : 'str',
5606 'operation': 'IoOperationType',
5607 'action' : 'BlockErrorAction' } }
5612 # Emitted when a block job is ready to complete
5616 # @device: The job identifier. Originally the device name but other
5617 # values are allowed since QEMU 2.7
5619 # @len: maximum progress value
5621 # @offset: current progress value. On success this is equal to len.
5622 # On failure this is less than len
5624 # @speed: rate limit, bytes per second
5626 # Note: The "ready to complete" status is always reset by a
5627 # @BLOCK_JOB_ERROR event
5633 # <- { "event": "BLOCK_JOB_READY",
5634 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5635 # "len": 2097152, "offset": 2097152 },
5636 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5638 { 'event': 'BLOCK_JOB_READY',
5639 'data': { 'type' : 'JobType',
5646 # @BLOCK_JOB_PENDING:
5648 # Emitted when a block job is awaiting explicit authorization to
5649 # finalize graph changes via @block-job-finalize. If this job is part
5650 # of a transaction, it will not emit this event until the transaction
5651 # has converged first.
5655 # @id: The job identifier.
5661 # <- { "event": "BLOCK_JOB_PENDING",
5662 # "data": { "type": "mirror", "id": "backup_1" },
5663 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5665 { 'event': 'BLOCK_JOB_PENDING',
5666 'data': { 'type' : 'JobType',
5672 # Preallocation mode of QEMU image file
5674 # @off: no preallocation
5676 # @metadata: preallocate only for metadata
5678 # @falloc: like @full preallocation but allocate disk space by
5679 # posix_fallocate() rather than writing data.
5681 # @full: preallocate all data by writing it to the device to ensure
5682 # disk space is really available. This data may or may not be
5683 # zero, depending on the image format and storage. @full
5684 # preallocation also sets up metadata correctly.
5688 { 'enum': 'PreallocMode',
5689 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5692 # @BLOCK_WRITE_THRESHOLD:
5694 # Emitted when writes on block device reaches or exceeds the
5695 # configured write threshold. For thin-provisioned devices, this
5696 # means the device should be extended to avoid pausing for disk
5697 # exhaustion. The event is one shot. Once triggered, it needs to be
5698 # re-registered with another block-set-write-threshold command.
5700 # @node-name: graph node name on which the threshold was exceeded.
5702 # @amount-exceeded: amount of data which exceeded the threshold, in
5705 # @write-threshold: last configured threshold, in bytes.
5709 { 'event': 'BLOCK_WRITE_THRESHOLD',
5710 'data': { 'node-name': 'str',
5711 'amount-exceeded': 'uint64',
5712 'write-threshold': 'uint64' } }
5715 # @block-set-write-threshold:
5717 # Change the write threshold for a block drive. An event will be
5718 # delivered if a write to this block drive crosses the configured
5719 # threshold. The threshold is an offset, thus must be non-negative.
5720 # Default is no write threshold. Setting the threshold to zero
5723 # This is useful to transparently resize thin-provisioned drives
5724 # without the guest OS noticing.
5726 # @node-name: graph node name on which the threshold must be set.
5728 # @write-threshold: configured threshold for the block device, bytes.
5729 # Use 0 to disable the threshold.
5735 # -> { "execute": "block-set-write-threshold",
5736 # "arguments": { "node-name": "mydev",
5737 # "write-threshold": 17179869184 } }
5738 # <- { "return": {} }
5740 { 'command': 'block-set-write-threshold',
5741 'data': { 'node-name': 'str', 'write-threshold': 'uint64' },
5742 'allow-preconfig': true }
5745 # @x-blockdev-change:
5747 # Dynamically reconfigure the block driver state graph. It can be
5748 # used to add, remove, insert or replace a graph node. Currently only
5749 # the Quorum driver implements this feature to add or remove its
5750 # child. This is useful to fix a broken quorum child.
5752 # If @node is specified, it will be inserted under @parent. @child
5753 # may not be specified in this case. If both @parent and @child are
5754 # specified but @node is not, @child will be detached from @parent.
5756 # @parent: the id or name of the parent node.
5758 # @child: the name of a child under the given parent node.
5760 # @node: the name of the node that will be added.
5764 # @unstable: This command is experimental, and its API is not stable.
5765 # It does not support all kinds of operations, all kinds of
5766 # children, nor all block drivers.
5768 # FIXME Removing children from a quorum node means introducing
5769 # gaps in the child indices. This cannot be represented in the
5770 # 'children' list of BlockdevOptionsQuorum, as returned by
5771 # .bdrv_refresh_filename().
5773 # Warning: The data in a new quorum child MUST be consistent with
5774 # that of the rest of the array.
5780 # 1. Add a new node to a quorum
5782 # -> { "execute": "blockdev-add",
5785 # "node-name": "new_node",
5786 # "file": { "driver": "file",
5787 # "filename": "test.raw" } } }
5788 # <- { "return": {} }
5789 # -> { "execute": "x-blockdev-change",
5790 # "arguments": { "parent": "disk1",
5791 # "node": "new_node" } }
5792 # <- { "return": {} }
5794 # 2. Delete a quorum's node
5796 # -> { "execute": "x-blockdev-change",
5797 # "arguments": { "parent": "disk1",
5798 # "child": "children.1" } }
5799 # <- { "return": {} }
5801 { 'command': 'x-blockdev-change',
5802 'data' : { 'parent': 'str',
5805 'features': [ 'unstable' ],
5806 'allow-preconfig': true }
5809 # @x-blockdev-set-iothread:
5811 # Move @node and its children into the @iothread. If @iothread is
5812 # null then move @node and its children into the main loop.
5814 # The node must not be attached to a BlockBackend.
5816 # @node-name: the name of the block driver node
5818 # @iothread: the name of the IOThread object or null for the main loop
5820 # @force: true if the node and its children should be moved when a
5821 # BlockBackend is already attached
5825 # @unstable: This command is experimental and intended for test cases
5826 # that need control over IOThreads only.
5832 # 1. Move a node into an IOThread
5834 # -> { "execute": "x-blockdev-set-iothread",
5835 # "arguments": { "node-name": "disk1",
5836 # "iothread": "iothread0" } }
5837 # <- { "return": {} }
5839 # 2. Move a node into the main loop
5841 # -> { "execute": "x-blockdev-set-iothread",
5842 # "arguments": { "node-name": "disk1",
5843 # "iothread": null } }
5844 # <- { "return": {} }
5846 { 'command': 'x-blockdev-set-iothread',
5847 'data' : { 'node-name': 'str',
5848 'iothread': 'StrOrNull',
5850 'features': [ 'unstable' ],
5851 'allow-preconfig': true }
5856 # An enumeration of the quorum operation types
5858 # @read: read operation
5860 # @write: write operation
5862 # @flush: flush operation
5866 { 'enum': 'QuorumOpType',
5867 'data': [ 'read', 'write', 'flush' ] }
5872 # Emitted by the Quorum block driver if it fails to establish a quorum
5874 # @reference: device name if defined else node name
5876 # @sector-num: number of the first sector of the failed read operation
5878 # @sectors-count: failed read operation sector count
5880 # Note: This event is rate-limited.
5886 # <- { "event": "QUORUM_FAILURE",
5887 # "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
5888 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5890 { 'event': 'QUORUM_FAILURE',
5891 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
5894 # @QUORUM_REPORT_BAD:
5896 # Emitted to report a corruption of a Quorum file
5898 # @type: quorum operation type (Since 2.6)
5900 # @error: error message. Only present on failure. This field
5901 # contains a human-readable error message. There are no semantics
5902 # other than that the block layer reported an error and clients
5903 # should not try to interpret the error string.
5905 # @node-name: the graph node name of the block driver state
5907 # @sector-num: number of the first sector of the failed read operation
5909 # @sectors-count: failed read operation sector count
5911 # Note: This event is rate-limited.
5919 # <- { "event": "QUORUM_REPORT_BAD",
5920 # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
5922 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5924 # 2. Flush operation
5926 # <- { "event": "QUORUM_REPORT_BAD",
5927 # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
5928 # "type": "flush", "error": "Broken pipe" },
5929 # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
5931 { 'event': 'QUORUM_REPORT_BAD',
5932 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
5933 'sector-num': 'int', 'sectors-count': 'int' } }
5936 # @BlockdevSnapshotInternal:
5938 # @device: the device name or node-name of a root node to generate the
5941 # @name: the name of the internal snapshot to be created
5943 # Notes: In transaction, if @name is empty, or any snapshot matching
5944 # @name exists, the operation will fail. Only some image formats
5945 # support it, for example, qcow2, and rbd.
5949 { 'struct': 'BlockdevSnapshotInternal',
5950 'data': { 'device': 'str', 'name': 'str' } }
5953 # @blockdev-snapshot-internal-sync:
5955 # Synchronously take an internal snapshot of a block device, when the
5956 # format of the image used supports it. If the name is an empty
5957 # string, or a snapshot with name already exists, the operation will
5960 # For the arguments, see the documentation of
5961 # BlockdevSnapshotInternal.
5964 # - nothing on success
5965 # - If @device is not a valid block device, GenericError
5966 # - If any snapshot matching @name exists, or @name is empty,
5968 # - If the format of the image used does not support it,
5975 # -> { "execute": "blockdev-snapshot-internal-sync",
5976 # "arguments": { "device": "ide-hd0",
5977 # "name": "snapshot0" }
5979 # <- { "return": {} }
5981 { 'command': 'blockdev-snapshot-internal-sync',
5982 'data': 'BlockdevSnapshotInternal',
5983 'allow-preconfig': true }
5986 # @blockdev-snapshot-delete-internal-sync:
5988 # Synchronously delete an internal snapshot of a block device, when
5989 # the format of the image used support it. The snapshot is identified
5990 # by name or id or both. One of the name or id is required. Return
5991 # SnapshotInfo for the successfully deleted snapshot.
5993 # @device: the device name or node-name of a root node to delete the
5996 # @id: optional the snapshot's ID to be deleted
5998 # @name: optional the snapshot's name to be deleted
6001 # - SnapshotInfo on success
6002 # - If @device is not a valid block device, GenericError
6003 # - If snapshot not found, GenericError
6004 # - If the format of the image used does not support it,
6006 # - If @id and @name are both not specified, GenericError
6012 # -> { "execute": "blockdev-snapshot-delete-internal-sync",
6013 # "arguments": { "device": "ide-hd0",
6014 # "name": "snapshot0" }
6018 # "name": "snapshot0",
6019 # "vm-state-size": 0,
6020 # "date-sec": 1000012,
6022 # "vm-clock-sec": 100,
6023 # "vm-clock-nsec": 20,
6028 { 'command': 'blockdev-snapshot-delete-internal-sync',
6029 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
6030 'returns': 'SnapshotInfo',
6031 'allow-preconfig': true }
6034 # @DummyBlockCoreForceArrays:
6036 # Not used by QMP; hack to let us use BlockGraphInfoList internally
6040 { 'struct': 'DummyBlockCoreForceArrays',
6041 'data': { 'unused-block-graph-info': ['BlockGraphInfo'] } }