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_flush_latency_ns: Minimum latency of flush operations in the
858 # defined interval, in nanoseconds.
860 # @max_rd_latency_ns: Maximum latency of read operations in the
861 # defined interval, in nanoseconds.
863 # @max_wr_latency_ns: Maximum latency of write operations in the
864 # defined interval, in nanoseconds.
866 # @max_flush_latency_ns: Maximum latency of flush operations in the
867 # defined interval, in nanoseconds.
869 # @avg_rd_latency_ns: Average latency of read operations in the
870 # defined interval, in nanoseconds.
872 # @avg_wr_latency_ns: Average latency of write operations in the
873 # defined interval, in nanoseconds.
875 # @avg_flush_latency_ns: Average latency of flush operations in the
876 # defined interval, in nanoseconds.
878 # @avg_rd_queue_depth: Average number of pending read operations in
879 # the defined interval.
881 # @avg_wr_queue_depth: Average number of pending write operations in
882 # the defined interval.
886 { 'struct': 'BlockDeviceTimedStats',
887 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
888 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
889 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
890 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
891 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
892 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
897 # Statistics of a virtual block device or a block backing device.
899 # @rd_bytes: The number of bytes read by the device.
901 # @wr_bytes: The number of bytes written by the device.
903 # @unmap_bytes: The number of bytes unmapped by the device (Since 4.2)
905 # @rd_operations: The number of read operations performed by the
908 # @wr_operations: The number of write operations performed by the
911 # @flush_operations: The number of cache flush operations performed by
912 # the device (since 0.15)
914 # @unmap_operations: The number of unmap operations performed by the
917 # @rd_total_time_ns: Total time spent on reads in nanoseconds (since
920 # @wr_total_time_ns: Total time spent on writes in nanoseconds (since
923 # @flush_total_time_ns: Total time spent on cache flushes in
924 # nanoseconds (since 0.15).
926 # @unmap_total_time_ns: Total time spent on unmap operations in
927 # nanoseconds (Since 4.2)
929 # @wr_highest_offset: The offset after the greatest byte written to
930 # the device. The intended use of this information is for
931 # growable sparse files (like qcow2) that are used on top of a
934 # @rd_merged: Number of read requests that have been merged into
935 # another request (Since 2.3).
937 # @wr_merged: Number of write requests that have been merged into
938 # another request (Since 2.3).
940 # @unmap_merged: Number of unmap requests that have been merged into
941 # another request (Since 4.2)
943 # @idle_time_ns: Time since the last I/O operation, in nanoseconds.
944 # If the field is absent it means that there haven't been any
945 # operations yet (Since 2.5).
947 # @failed_rd_operations: The number of failed read operations
948 # performed by the device (Since 2.5)
950 # @failed_wr_operations: The number of failed write operations
951 # performed by the device (Since 2.5)
953 # @failed_flush_operations: The number of failed flush operations
954 # performed by the device (Since 2.5)
956 # @failed_unmap_operations: The number of failed unmap operations
957 # performed by the device (Since 4.2)
959 # @invalid_rd_operations: The number of invalid read operations
960 # performed by the device (Since 2.5)
962 # @invalid_wr_operations: The number of invalid write operations
963 # performed by the device (Since 2.5)
965 # @invalid_flush_operations: The number of invalid flush operations
966 # performed by the device (Since 2.5)
968 # @invalid_unmap_operations: The number of invalid unmap operations
969 # performed by the device (Since 4.2)
971 # @account_invalid: Whether invalid operations are included in the
972 # last access statistics (Since 2.5)
974 # @account_failed: Whether failed operations are included in the
975 # latency and last access statistics (Since 2.5)
977 # @timed_stats: Statistics specific to the set of previously defined
978 # intervals of time (Since 2.5)
980 # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
982 # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
984 # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
988 { 'struct': 'BlockDeviceStats',
989 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int',
990 'rd_operations': 'int', 'wr_operations': 'int',
991 'flush_operations': 'int', 'unmap_operations': 'int',
992 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int',
993 'flush_total_time_ns': 'int', 'unmap_total_time_ns': 'int',
994 'wr_highest_offset': 'int',
995 'rd_merged': 'int', 'wr_merged': 'int', 'unmap_merged': 'int',
996 '*idle_time_ns': 'int',
997 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
998 'failed_flush_operations': 'int', 'failed_unmap_operations': 'int',
999 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int',
1000 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int',
1001 'account_invalid': 'bool', 'account_failed': 'bool',
1002 'timed_stats': ['BlockDeviceTimedStats'],
1003 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
1004 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
1005 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
1008 # @BlockStatsSpecificFile:
1010 # File driver statistics
1012 # @discard-nb-ok: The number of successful discard operations
1013 # performed by the driver.
1015 # @discard-nb-failed: The number of failed discard operations
1016 # performed by the driver.
1018 # @discard-bytes-ok: The number of bytes discarded by the driver.
1022 { 'struct': 'BlockStatsSpecificFile',
1024 'discard-nb-ok': 'uint64',
1025 'discard-nb-failed': 'uint64',
1026 'discard-bytes-ok': 'uint64' } }
1029 # @BlockStatsSpecificNvme:
1031 # NVMe driver statistics
1033 # @completion-errors: The number of completion errors.
1035 # @aligned-accesses: The number of aligned accesses performed by the
1038 # @unaligned-accesses: The number of unaligned accesses performed by
1043 { 'struct': 'BlockStatsSpecificNvme',
1045 'completion-errors': 'uint64',
1046 'aligned-accesses': 'uint64',
1047 'unaligned-accesses': 'uint64' } }
1050 # @BlockStatsSpecific:
1052 # Block driver specific statistics
1056 { 'union': 'BlockStatsSpecific',
1057 'base': { 'driver': 'BlockdevDriver' },
1058 'discriminator': 'driver',
1060 'file': 'BlockStatsSpecificFile',
1061 'host_device': { 'type': 'BlockStatsSpecificFile',
1062 'if': 'HAVE_HOST_BLOCK_DEVICE' },
1063 'nvme': 'BlockStatsSpecificNvme' } }
1068 # Statistics of a virtual block device or a block backing device.
1070 # @device: If the stats are for a virtual block device, the name
1071 # corresponding to the virtual block device.
1073 # @node-name: The node name of the device. (Since 2.3)
1075 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the
1076 # block device. (since 3.0)
1078 # @stats: A @BlockDeviceStats for the device.
1080 # @driver-specific: Optional driver-specific stats. (Since 4.2)
1082 # @parent: This describes the file block device if it has one.
1083 # Contains recursively the statistics of the underlying protocol
1084 # (e.g. the host file for a qcow2 image). If there is no
1085 # underlying protocol, this field is omitted
1087 # @backing: This describes the backing block device if it has one.
1092 { 'struct': 'BlockStats',
1093 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
1094 'stats': 'BlockDeviceStats',
1095 '*driver-specific': 'BlockStatsSpecific',
1096 '*parent': 'BlockStats',
1097 '*backing': 'BlockStats'} }
1100 # @query-blockstats:
1102 # Query the @BlockStats for all virtual block devices.
1104 # @query-nodes: If true, the command will query all the block nodes
1105 # that have a node name, in a list which will include "parent"
1106 # information, but not "backing". If false or omitted, the
1107 # behavior is as before - query all the device backends,
1108 # recursively including their "parent" and "backing". Filter nodes
1109 # that were created implicitly are skipped over in this mode.
1112 # Returns: A list of @BlockStats for each virtual block devices.
1118 # -> { "execute": "query-blockstats" }
1122 # "device":"ide0-hd0",
1125 # "wr_highest_offset":3686448128,
1126 # "wr_bytes":9786368,
1127 # "wr_operations":751,
1128 # "rd_bytes":122567168,
1129 # "rd_operations":36772
1130 # "wr_total_times_ns":313253456
1131 # "rd_total_times_ns":3465673657
1132 # "flush_total_times_ns":49653
1133 # "flush_operations":61,
1136 # "idle_time_ns":2953431879,
1137 # "account_invalid":true,
1138 # "account_failed":false
1142 # "wr_highest_offset":2821110784,
1143 # "wr_bytes":9786368,
1144 # "wr_operations":692,
1145 # "rd_bytes":122739200,
1146 # "rd_operations":36604
1147 # "flush_operations":51,
1148 # "wr_total_times_ns":313253456
1149 # "rd_total_times_ns":3465673657
1150 # "flush_total_times_ns":49653,
1153 # "idle_time_ns":2953431879,
1154 # "account_invalid":true,
1155 # "account_failed":false
1157 # "qdev": "/machine/unattached/device[23]"
1160 # "device":"ide1-cd0",
1162 # "wr_highest_offset":0,
1164 # "wr_operations":0,
1167 # "flush_operations":0,
1168 # "wr_total_times_ns":0
1169 # "rd_total_times_ns":0
1170 # "flush_total_times_ns":0,
1173 # "account_invalid":false,
1174 # "account_failed":false
1176 # "qdev": "/machine/unattached/device[24]"
1179 # "device":"floppy0",
1181 # "wr_highest_offset":0,
1183 # "wr_operations":0,
1186 # "flush_operations":0,
1187 # "wr_total_times_ns":0
1188 # "rd_total_times_ns":0
1189 # "flush_total_times_ns":0,
1192 # "account_invalid":false,
1193 # "account_failed":false
1195 # "qdev": "/machine/unattached/device[16]"
1200 # "wr_highest_offset":0,
1202 # "wr_operations":0,
1205 # "flush_operations":0,
1206 # "wr_total_times_ns":0
1207 # "rd_total_times_ns":0
1208 # "flush_total_times_ns":0,
1211 # "account_invalid":false,
1212 # "account_failed":false
1218 { 'command': 'query-blockstats',
1219 'data': { '*query-nodes': 'bool' },
1220 'returns': ['BlockStats'],
1221 'allow-preconfig': true }
1226 # An enumeration of possible behaviors for errors on I/O operations.
1227 # The exact meaning depends on whether the I/O was initiated by a
1228 # guest or by a block job
1230 # @report: for guest operations, report the error to the guest; for
1231 # jobs, cancel the job
1233 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1234 # or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs
1235 # retry the failing request later and may still complete
1236 # successfully. The stream block job continues to stream and will
1237 # complete with an error.
1239 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1241 # @stop: for guest operations, stop the virtual machine; for jobs,
1244 # @auto: inherit the error handling policy of the backend (since: 2.7)
1248 { 'enum': 'BlockdevOnError',
1249 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1254 # An enumeration of possible behaviors for the initial synchronization
1255 # phase of storage mirroring.
1257 # @top: copies data in the topmost image to the destination
1259 # @full: copies data from all images to the destination
1261 # @none: only copy data written from now on
1263 # @incremental: only copy data described by the dirty bitmap.
1266 # @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
1267 # Behavior on completion is determined by the BitmapSyncMode.
1271 { 'enum': 'MirrorSyncMode',
1272 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1277 # An enumeration of possible behaviors for the synchronization of a
1278 # bitmap when used for data copy operations.
1280 # @on-success: The bitmap is only synced when the operation is
1281 # successful. This is the behavior always used for 'INCREMENTAL'
1284 # @never: The bitmap is never synchronized with the operation, and is
1285 # treated solely as a read-only manifest of blocks to copy.
1287 # @always: The bitmap is always synchronized with the operation,
1288 # regardless of whether or not the operation was successful.
1292 { 'enum': 'BitmapSyncMode',
1293 'data': ['on-success', 'never', 'always'] }
1298 # An enumeration whose values tell the mirror block job when to
1299 # trigger writes to the target.
1301 # @background: copy data in background only.
1303 # @write-blocking: when data is written to the source, write it
1304 # (synchronously) to the target as well. In addition, data is
1305 # copied in background just like in @background mode.
1309 { 'enum': 'MirrorCopyMode',
1310 'data': ['background', 'write-blocking'] }
1315 # Information about a long-running block device operation.
1317 # @type: the job type ('stream' for image streaming)
1319 # @device: The job identifier. Originally the device name but other
1320 # values are allowed since QEMU 2.7
1322 # @len: Estimated @offset value at the completion of the job. This
1323 # value can arbitrarily change while the job is running, in both
1326 # @offset: Progress made until now. The unit is arbitrary and the
1327 # value can only meaningfully be used for the ratio of @offset to
1328 # @len. The value is monotonically increasing.
1330 # @busy: false if the job is known to be in a quiescent state, with no
1331 # pending I/O. (Since 1.3)
1333 # @paused: whether the job is paused or, if @busy is true, will pause
1334 # itself as soon as possible. (Since 1.3)
1336 # @speed: the rate limit, bytes per second
1338 # @io-status: the status of the job (since 1.3)
1340 # @ready: true if the job may be completed (since 2.2)
1342 # @status: Current job state/status (since 2.12)
1344 # @auto-finalize: Job will finalize itself when PENDING, moving to the
1345 # CONCLUDED state. (since 2.12)
1347 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the
1348 # NULL state and disappearing from the query list. (since 2.12)
1350 # @error: Error information if the job did not complete successfully.
1351 # Not set if the job completed successfully. (since 2.12.1)
1355 { 'struct': 'BlockJobInfo',
1356 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1357 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1358 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1359 'status': 'JobStatus',
1360 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1364 # @query-block-jobs:
1366 # Return information about long-running block device operations.
1368 # Returns: a list of @BlockJobInfo for each active block job
1372 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'],
1373 'allow-preconfig': true }
1378 # Resize a block image while a guest is running.
1380 # Either @device or @node-name must be set but not both.
1382 # @device: the name of the device to get the image resized
1384 # @node-name: graph node name to get the image resized (Since 2.0)
1386 # @size: new image size in bytes
1389 # - nothing on success
1390 # - If @device is not a valid block device, DeviceNotFound
1396 # -> { "execute": "block_resize",
1397 # "arguments": { "device": "scratch", "size": 1073741824 } }
1398 # <- { "return": {} }
1400 { 'command': 'block_resize',
1401 'data': { '*device': 'str',
1402 '*node-name': 'str',
1405 'allow-preconfig': true }
1410 # An enumeration that tells QEMU how to set the backing file path in a
1413 # @existing: QEMU should look for an existing image file.
1415 # @absolute-paths: QEMU should create a new image with absolute paths
1416 # for the backing file. If there is no backing file available,
1417 # the new image will not be backed either.
1421 { 'enum': 'NewImageMode',
1422 'data': [ 'existing', 'absolute-paths' ] }
1425 # @BlockdevSnapshotSync:
1427 # Either @device or @node-name must be set but not both.
1429 # @device: the name of the device to take a snapshot of.
1431 # @node-name: graph node name to generate the snapshot from (Since
1434 # @snapshot-file: the target of the new overlay image. If the file
1435 # exists, or if it is a device, the overlay will be created in the
1436 # existing file/device. Otherwise, a new file will be created.
1438 # @snapshot-node-name: the graph node name of the new image (Since
1441 # @format: the format of the overlay image, default is 'qcow2'.
1443 # @mode: whether and how QEMU should create a new image, default is
1446 { 'struct': 'BlockdevSnapshotSync',
1447 'data': { '*device': 'str', '*node-name': 'str',
1448 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1449 '*format': 'str', '*mode': 'NewImageMode' } }
1452 # @BlockdevSnapshot:
1454 # @node: device or node name that will have a snapshot taken.
1456 # @overlay: reference to the existing block device that will become
1457 # the overlay of @node, as part of taking the snapshot. It must
1458 # not have a current backing file (this can be achieved by passing
1459 # "backing": null to blockdev-add).
1463 { 'struct': 'BlockdevSnapshot',
1464 'data': { 'node': 'str', 'overlay': 'str' } }
1469 # Optional parameters for backup. These parameters don't affect
1470 # functionality, but may significantly affect performance.
1472 # @use-copy-range: Use copy offloading. Default false.
1474 # @max-workers: Maximum number of parallel requests for the sustained
1475 # background copying process. Doesn't influence copy-before-write
1476 # operations. Default 64.
1478 # @max-chunk: Maximum request length for the sustained background
1479 # copying process. Doesn't influence copy-before-write
1480 # operations. 0 means unlimited. If max-chunk is non-zero then
1481 # it should not be less than job cluster size which is calculated
1482 # as maximum of target image cluster size and 64k. Default 0.
1486 { 'struct': 'BackupPerf',
1487 'data': { '*use-copy-range': 'bool',
1488 '*max-workers': 'int', '*max-chunk': 'int64' } }
1493 # @job-id: identifier for the newly-created block job. If omitted,
1494 # the device name will be used. (Since 2.7)
1496 # @device: the device name or node-name of a root node which should be
1499 # @sync: what parts of the disk image should be copied to the
1500 # destination (all the disk, only the sectors allocated in the
1501 # topmost image, from a dirty bitmap, or only new I/O).
1503 # @speed: the maximum speed, in bytes per second. The default is 0,
1506 # @bitmap: The name of a dirty bitmap to use. Must be present if sync
1507 # is "bitmap" or "incremental". Can be present if sync is "full"
1508 # or "top". Must not be present otherwise.
1509 # (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1511 # @bitmap-mode: Specifies the type of data the bitmap should contain
1512 # after the operation concludes. Must be present if a bitmap was
1513 # provided, Must NOT be present otherwise. (Since 4.2)
1515 # @compress: true to compress data, if the target format supports it.
1516 # (default: false) (since 2.8)
1518 # @on-source-error: the action to take on an error on the source,
1519 # default 'report'. 'stop' and 'enospc' can only be used if the
1520 # block device supports io-status (see BlockInfo).
1522 # @on-target-error: the action to take on an error on the target,
1523 # default 'report' (no limitations, since this applies to a
1524 # different block device than @device).
1526 # @auto-finalize: When false, this job will wait in a PENDING state
1527 # after it has finished its work, waiting for @block-job-finalize
1528 # before making any block graph changes. When true, this job will
1529 # automatically perform its abort or commit actions. Defaults to
1530 # true. (Since 2.12)
1532 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
1533 # after it has completely ceased all work, and awaits
1534 # @block-job-dismiss. When true, this job will automatically
1535 # disappear from the query list without user intervention.
1536 # Defaults to true. (Since 2.12)
1538 # @filter-node-name: the node name that should be assigned to the
1539 # filter driver that the backup job inserts into the graph above
1540 # node specified by @drive. If this option is not given, a node
1541 # name is autogenerated. (Since: 4.2)
1543 # @x-perf: Performance options. (Since 6.0)
1547 # @unstable: Member @x-perf is experimental.
1549 # Note: @on-source-error and @on-target-error only affect background
1550 # I/O. If an error occurs during a guest write request, the
1551 # device's rerror/werror actions will be used.
1555 { 'struct': 'BackupCommon',
1556 'data': { '*job-id': 'str', 'device': 'str',
1557 'sync': 'MirrorSyncMode', '*speed': 'int',
1558 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1559 '*compress': 'bool',
1560 '*on-source-error': 'BlockdevOnError',
1561 '*on-target-error': 'BlockdevOnError',
1562 '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
1563 '*filter-node-name': 'str',
1564 '*x-perf': { 'type': 'BackupPerf',
1565 'features': [ 'unstable' ] } } }
1570 # @target: the target of the new image. If the file exists, or if it
1571 # is a device, the existing file/device will be used as the new
1572 # destination. If it does not exist, a new file will be created.
1574 # @format: the format of the new destination, default is to probe if
1575 # @mode is 'existing', else the format of the source
1577 # @mode: whether and how QEMU should create a new image, default is
1582 { 'struct': 'DriveBackup',
1583 'base': 'BackupCommon',
1584 'data': { 'target': 'str',
1586 '*mode': 'NewImageMode' } }
1591 # @target: the device name or node-name of the backup target node.
1595 { 'struct': 'BlockdevBackup',
1596 'base': 'BackupCommon',
1597 'data': { 'target': 'str' } }
1600 # @blockdev-snapshot-sync:
1602 # Takes a synchronous snapshot of a block device.
1604 # For the arguments, see the documentation of BlockdevSnapshotSync.
1607 # - nothing on success
1608 # - If @device is not a valid block device, DeviceNotFound
1614 # -> { "execute": "blockdev-snapshot-sync",
1615 # "arguments": { "device": "ide-hd0",
1617 # "/some/place/my-image",
1618 # "format": "qcow2" } }
1619 # <- { "return": {} }
1621 { 'command': 'blockdev-snapshot-sync',
1622 'data': 'BlockdevSnapshotSync',
1623 'allow-preconfig': true }
1626 # @blockdev-snapshot:
1628 # Takes a snapshot of a block device.
1630 # Take a snapshot, by installing 'node' as the backing image of
1631 # 'overlay'. Additionally, if 'node' is associated with a block
1632 # device, the block device changes to using 'overlay' as its new
1635 # For the arguments, see the documentation of BlockdevSnapshot.
1639 # @allow-write-only-overlay: If present, the check whether this
1640 # operation is safe was relaxed so that it can be used to change
1641 # backing file of a destination of a blockdev-mirror. (since 5.0)
1647 # -> { "execute": "blockdev-add",
1648 # "arguments": { "driver": "qcow2",
1649 # "node-name": "node1534",
1650 # "file": { "driver": "file",
1651 # "filename": "hd1.qcow2" },
1652 # "backing": null } }
1654 # <- { "return": {} }
1656 # -> { "execute": "blockdev-snapshot",
1657 # "arguments": { "node": "ide-hd0",
1658 # "overlay": "node1534" } }
1659 # <- { "return": {} }
1661 { 'command': 'blockdev-snapshot',
1662 'data': 'BlockdevSnapshot',
1663 'features': [ 'allow-write-only-overlay' ],
1664 'allow-preconfig': true }
1667 # @change-backing-file:
1669 # Change the backing file in the image file metadata. This does not
1670 # cause QEMU to reopen the image file to reparse the backing filename
1671 # (it may, however, perform a reopen to change permissions from r/o ->
1672 # r/w -> r/o, if needed). The new backing file string is written into
1673 # the image file metadata, and the QEMU internal strings are updated.
1675 # @image-node-name: The name of the block driver state node of the
1676 # image to modify. The "device" argument is used to verify
1677 # "image-node-name" is in the chain described by "device".
1679 # @device: The device name or node-name of the root node that owns
1682 # @backing-file: The string to write as the backing file. This string
1683 # is not validated, so care should be taken when specifying the
1684 # string or the image chain may not be able to be reopened again.
1687 # - Nothing on success
1688 # - If "device" does not exist or cannot be determined,
1693 { 'command': 'change-backing-file',
1694 'data': { 'device': 'str', 'image-node-name': 'str',
1695 'backing-file': 'str' },
1696 'allow-preconfig': true }
1701 # Live commit of data from overlay image nodes into backing nodes -
1702 # i.e., writes data between 'top' and 'base' into 'base'.
1704 # If top == base, that is an error. If top has no overlays on top of
1705 # it, or if it is in use by a writer, the job will not be completed by
1706 # itself. The user needs to complete the job with the
1707 # block-job-complete command after getting the ready event. (Since
1710 # If the base image is smaller than top, then the base image will be
1711 # resized to be the same size as top. If top is smaller than the base
1712 # image, the base will not be truncated. If you want the base image
1713 # size to match the size of the smaller top, you can safely truncate
1714 # it yourself once the commit operation successfully completes.
1716 # @job-id: identifier for the newly-created block job. If omitted,
1717 # the device name will be used. (Since 2.7)
1719 # @device: the device name or node-name of a root node
1721 # @base-node: The node name of the backing image to write data into.
1722 # If not specified, this is the deepest backing image.
1725 # @base: Same as @base-node, except that it is a file name rather than
1726 # a node name. This must be the exact filename string that was
1727 # used to open the node; other strings, even if addressing the
1728 # same file, are not accepted
1730 # @top-node: The node name of the backing image within the image chain
1731 # which contains the topmost data to be committed down. If not
1732 # specified, this is the active layer. (since: 3.1)
1734 # @top: Same as @top-node, except that it is a file name rather than a
1735 # node name. This must be the exact filename string that was used
1736 # to open the node; other strings, even if addressing the same
1737 # file, are not accepted
1739 # @backing-file: The backing file string to write into the overlay
1740 # image of 'top'. If 'top' does not have an overlay image, or if
1741 # 'top' is in use by a writer, specifying a backing file string is
1744 # This filename is not validated. If a pathname string is such
1745 # that it cannot be resolved by QEMU, that means that subsequent
1746 # QMP or HMP commands must use node-names for the image in
1747 # question, as filename lookup methods will fail.
1749 # If not specified, QEMU will automatically determine the backing
1750 # file string to use, or error out if there is no obvious choice.
1751 # Care should be taken when specifying the string, to specify a
1752 # valid filename or protocol. (Since 2.1)
1754 # @speed: the maximum speed, in bytes per second
1756 # @on-error: the action to take on an error. 'ignore' means that the
1757 # request should be retried. (default: report; Since: 5.0)
1759 # @filter-node-name: the node name that should be assigned to the
1760 # filter driver that the commit job inserts into the graph above
1761 # @top. If this option is not given, a node name is
1762 # autogenerated. (Since: 2.9)
1764 # @auto-finalize: When false, this job will wait in a PENDING state
1765 # after it has finished its work, waiting for @block-job-finalize
1766 # before making any block graph changes. When true, this job will
1767 # automatically perform its abort or commit actions. Defaults to
1770 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
1771 # after it has completely ceased all work, and awaits
1772 # @block-job-dismiss. When true, this job will automatically
1773 # disappear from the query list without user intervention.
1774 # Defaults to true. (Since 3.1)
1778 # @deprecated: Members @base and @top are deprecated. Use @base-node
1779 # and @top-node instead.
1782 # - Nothing on success
1783 # - If @device does not exist, DeviceNotFound
1784 # - Any other error returns a GenericError.
1790 # -> { "execute": "block-commit",
1791 # "arguments": { "device": "virtio0",
1792 # "top": "/tmp/snap1.qcow2" } }
1793 # <- { "return": {} }
1795 { 'command': 'block-commit',
1796 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1797 '*base': { 'type': 'str', 'features': [ 'deprecated' ] },
1799 '*top': { 'type': 'str', 'features': [ 'deprecated' ] },
1800 '*backing-file': 'str', '*speed': 'int',
1801 '*on-error': 'BlockdevOnError',
1802 '*filter-node-name': 'str',
1803 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
1804 'allow-preconfig': true }
1809 # Start a point-in-time copy of a block device to a new destination.
1810 # The status of ongoing drive-backup operations can be checked with
1811 # query-block-jobs where the BlockJobInfo.type field has the value
1812 # 'backup'. The operation can be stopped before it has completed using
1813 # the block-job-cancel command.
1817 # @deprecated: This command is deprecated. Use @blockdev-backup
1821 # - nothing on success
1822 # - If @device is not a valid block device, GenericError
1828 # -> { "execute": "drive-backup",
1829 # "arguments": { "device": "drive0",
1831 # "target": "backup.img" } }
1832 # <- { "return": {} }
1834 { 'command': 'drive-backup', 'boxed': true,
1835 'data': 'DriveBackup', 'features': ['deprecated'],
1836 'allow-preconfig': true }
1841 # Start a point-in-time copy of a block device to a new destination.
1842 # The status of ongoing blockdev-backup operations can be checked with
1843 # query-block-jobs where the BlockJobInfo.type field has the value
1844 # 'backup'. The operation can be stopped before it has completed using
1845 # the block-job-cancel command.
1848 # - nothing on success
1849 # - If @device is not a valid block device, DeviceNotFound
1855 # -> { "execute": "blockdev-backup",
1856 # "arguments": { "device": "src-id",
1858 # "target": "tgt-id" } }
1859 # <- { "return": {} }
1861 { 'command': 'blockdev-backup', 'boxed': true,
1862 'data': 'BlockdevBackup',
1863 'allow-preconfig': true }
1866 # @query-named-block-nodes:
1868 # Get the named block driver list
1870 # @flat: Omit the nested data about backing image ("backing-image"
1871 # key) if true. Default is false (Since 5.0)
1873 # Returns: the list of BlockDeviceInfo
1879 # -> { "execute": "query-named-block-nodes" }
1880 # <- { "return": [ { "ro":false,
1882 # "encrypted":false,
1883 # "file":"disks/test.qcow2",
1884 # "node-name": "my-node",
1885 # "backing_file_depth":1,
1886 # "detect_zeroes":"off",
1893 # "bps_max": 8000000,
1900 # "write_threshold": 0,
1902 # "filename":"disks/test.qcow2",
1904 # "virtual-size":2048000,
1905 # "backing_file":"base.qcow2",
1906 # "full-backing-filename":"disks/base.qcow2",
1907 # "backing-filename-format":"qcow2",
1911 # "name": "snapshot1",
1912 # "vm-state-size": 0,
1913 # "date-sec": 10000200,
1915 # "vm-clock-sec": 206,
1916 # "vm-clock-nsec": 30
1920 # "filename":"disks/base.qcow2",
1922 # "virtual-size":2048000
1926 { 'command': 'query-named-block-nodes',
1927 'returns': [ 'BlockDeviceInfo' ],
1928 'data': { '*flat': 'bool' },
1929 'allow-preconfig': true }
1932 # @XDbgBlockGraphNodeType:
1934 # @block-backend: corresponds to BlockBackend
1936 # @block-job: corresponds to BlockJob
1938 # @block-driver: corresponds to BlockDriverState
1942 { 'enum': 'XDbgBlockGraphNodeType',
1943 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1946 # @XDbgBlockGraphNode:
1948 # @id: Block graph node identifier. This @id is generated only for
1949 # x-debug-query-block-graph and does not relate to any other
1950 # identifiers in Qemu.
1952 # @type: Type of graph node. Can be one of block-backend, block-job
1953 # or block-driver-state.
1955 # @name: Human readable name of the node. Corresponds to node-name
1956 # for block-driver-state nodes; is not guaranteed to be unique in
1957 # the whole graph (with block-jobs and block-backends).
1961 { 'struct': 'XDbgBlockGraphNode',
1962 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1967 # Enum of base block permissions.
1969 # @consistent-read: A user that has the "permission" of consistent
1970 # reads is guaranteed that their view of the contents of the block
1971 # device is complete and self-consistent, representing the
1972 # contents of a disk at a specific point. For most block devices
1973 # (including their backing files) this is true, but the property
1974 # cannot be maintained in a few situations like for intermediate
1975 # nodes of a commit block job.
1977 # @write: This permission is required to change the visible disk
1980 # @write-unchanged: This permission (which is weaker than
1981 # BLK_PERM_WRITE) is both enough and required for writes to the
1982 # block node when the caller promises that the visible disk
1983 # content doesn't change. As the BLK_PERM_WRITE permission is
1984 # strictly stronger, either is sufficient to perform an unchanging
1987 # @resize: This permission is required to change the size of a block
1992 { 'enum': 'BlockPermission',
1993 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize' ] }
1996 # @XDbgBlockGraphEdge:
1998 # Block Graph edge description for x-debug-query-block-graph.
2000 # @parent: parent id
2004 # @name: name of the relation (examples are 'file' and 'backing')
2006 # @perm: granted permissions for the parent operating on the child
2008 # @shared-perm: permissions that can still be granted to other users
2009 # of the child while it is still attached to this parent
2013 { 'struct': 'XDbgBlockGraphEdge',
2014 'data': { 'parent': 'uint64', 'child': 'uint64',
2015 'name': 'str', 'perm': [ 'BlockPermission' ],
2016 'shared-perm': [ 'BlockPermission' ] } }
2021 # Block Graph - list of nodes and list of edges.
2025 { 'struct': 'XDbgBlockGraph',
2026 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
2029 # @x-debug-query-block-graph:
2031 # Get the block graph.
2035 # @unstable: This command is meant for debugging.
2039 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph',
2040 'features': [ 'unstable' ],
2041 'allow-preconfig': true }
2046 # Start mirroring a block device's writes to a new destination.
2047 # target specifies the target of the new image. If the file exists,
2048 # or if it is a device, it will be used as the new destination for
2049 # writes. If it does not exist, a new file will be created. format
2050 # specifies the format of the mirror image, default is to probe if
2051 # mode='existing', else the format of the source.
2054 # - nothing on success
2055 # - If @device is not a valid block device, GenericError
2061 # -> { "execute": "drive-mirror",
2062 # "arguments": { "device": "ide-hd0",
2063 # "target": "/some/place/my-image",
2065 # "format": "qcow2" } }
2066 # <- { "return": {} }
2068 { 'command': 'drive-mirror', 'boxed': true,
2069 'data': 'DriveMirror',
2070 'allow-preconfig': true }
2075 # A set of parameters describing drive mirror setup.
2077 # @job-id: identifier for the newly-created block job. If omitted,
2078 # the device name will be used. (Since 2.7)
2080 # @device: the device name or node-name of a root node whose writes
2081 # should be mirrored.
2083 # @target: the target of the new image. If the file exists, or if it
2084 # is a device, the existing file/device will be used as the new
2085 # destination. If it does not exist, a new file will be created.
2087 # @format: the format of the new destination, default is to probe if
2088 # @mode is 'existing', else the format of the source
2090 # @node-name: the new block driver state node name in the graph (Since
2093 # @replaces: with sync=full graph node name to be replaced by the new
2094 # image when a whole image copy is done. This can be used to
2095 # repair broken Quorum files. By default, @device is replaced,
2096 # although implicitly created filters on it are kept. (Since 2.1)
2098 # @mode: whether and how QEMU should create a new image, default is
2101 # @speed: the maximum speed, in bytes per second
2103 # @sync: what parts of the disk image should be copied to the
2104 # destination (all the disk, only the sectors allocated in the
2105 # topmost image, or only new I/O).
2107 # @granularity: granularity of the dirty bitmap, default is 64K if the
2108 # image format doesn't have clusters, 4K if the clusters are
2109 # smaller than that, else the cluster size. Must be a power of 2
2110 # between 512 and 64M (since 1.4).
2112 # @buf-size: maximum amount of data in flight from source to target
2115 # @on-source-error: the action to take on an error on the source,
2116 # default 'report'. 'stop' and 'enospc' can only be used if the
2117 # block device supports io-status (see BlockInfo).
2119 # @on-target-error: the action to take on an error on the target,
2120 # default 'report' (no limitations, since this applies to a
2121 # different block device than @device).
2123 # @unmap: Whether to try to unmap target sectors where source has only
2124 # zero. If true, and target unallocated sectors will read as
2125 # zero, target image sectors will be unmapped; otherwise, zeroes
2126 # will be written. Both will result in identical contents.
2127 # Default is true. (Since 2.4)
2129 # @copy-mode: when to copy data to the destination; defaults to
2130 # 'background' (Since: 3.0)
2132 # @auto-finalize: When false, this job will wait in a PENDING state
2133 # after it has finished its work, waiting for @block-job-finalize
2134 # before making any block graph changes. When true, this job will
2135 # automatically perform its abort or commit actions. Defaults to
2138 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
2139 # after it has completely ceased all work, and awaits
2140 # @block-job-dismiss. When true, this job will automatically
2141 # disappear from the query list without user intervention.
2142 # Defaults to true. (Since 3.1)
2146 { 'struct': 'DriveMirror',
2147 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2148 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
2149 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2150 '*speed': 'int', '*granularity': 'uint32',
2151 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2152 '*on-target-error': 'BlockdevOnError',
2153 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
2154 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2157 # @BlockDirtyBitmap:
2159 # @node: name of device/node which the bitmap is tracking
2161 # @name: name of the dirty bitmap
2165 { 'struct': 'BlockDirtyBitmap',
2166 'data': { 'node': 'str', 'name': 'str' } }
2169 # @BlockDirtyBitmapAdd:
2171 # @node: name of device/node which the bitmap is tracking
2173 # @name: name of the dirty bitmap (must be less than 1024 bytes)
2175 # @granularity: the bitmap granularity, default is 64k for
2176 # block-dirty-bitmap-add
2178 # @persistent: the bitmap is persistent, i.e. it will be saved to the
2179 # corresponding block device image file on its close. For now
2180 # only Qcow2 disks support persistent bitmaps. Default is false
2181 # for block-dirty-bitmap-add. (Since: 2.10)
2183 # @disabled: the bitmap is created in the disabled state, which means
2184 # that it will not track drive changes. The bitmap may be enabled
2185 # with block-dirty-bitmap-enable. Default is false. (Since: 4.0)
2189 { 'struct': 'BlockDirtyBitmapAdd',
2190 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
2191 '*persistent': 'bool', '*disabled': 'bool' } }
2194 # @BlockDirtyBitmapOrStr:
2196 # @local: name of the bitmap, attached to the same node as target
2199 # @external: bitmap with specified node
2203 { 'alternate': 'BlockDirtyBitmapOrStr',
2204 'data': { 'local': 'str',
2205 'external': 'BlockDirtyBitmap' } }
2208 # @BlockDirtyBitmapMerge:
2210 # @node: name of device/node which the @target bitmap is tracking
2212 # @target: name of the destination dirty bitmap
2214 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or
2215 # fully specified BlockDirtyBitmap elements. The latter are
2216 # supported since 4.1.
2220 { 'struct': 'BlockDirtyBitmapMerge',
2221 'data': { 'node': 'str', 'target': 'str',
2222 'bitmaps': ['BlockDirtyBitmapOrStr'] } }
2225 # @block-dirty-bitmap-add:
2227 # Create a dirty bitmap with a name on the node, and start tracking
2231 # - nothing on success
2232 # - If @node is not a valid block device or node, DeviceNotFound
2233 # - If @name is already taken, GenericError with an explanation
2239 # -> { "execute": "block-dirty-bitmap-add",
2240 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2241 # <- { "return": {} }
2243 { 'command': 'block-dirty-bitmap-add',
2244 'data': 'BlockDirtyBitmapAdd',
2245 'allow-preconfig': true }
2248 # @block-dirty-bitmap-remove:
2250 # Stop write tracking and remove the dirty bitmap that was created
2251 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it
2252 # from its storage too.
2255 # - nothing on success
2256 # - If @node is not a valid block device or node, DeviceNotFound
2257 # - If @name is not found, GenericError with an explanation
2258 # - if @name is frozen by an operation, GenericError
2264 # -> { "execute": "block-dirty-bitmap-remove",
2265 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2266 # <- { "return": {} }
2268 { 'command': 'block-dirty-bitmap-remove',
2269 'data': 'BlockDirtyBitmap',
2270 'allow-preconfig': true }
2273 # @block-dirty-bitmap-clear:
2275 # Clear (reset) a dirty bitmap on the device, so that an incremental
2276 # backup from this point in time forward will only backup clusters
2277 # modified after this clear operation.
2280 # - nothing on success
2281 # - If @node is not a valid block device, DeviceNotFound
2282 # - If @name is not found, GenericError with an explanation
2288 # -> { "execute": "block-dirty-bitmap-clear",
2289 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2290 # <- { "return": {} }
2292 { 'command': 'block-dirty-bitmap-clear',
2293 'data': 'BlockDirtyBitmap',
2294 'allow-preconfig': true }
2297 # @block-dirty-bitmap-enable:
2299 # Enables a dirty bitmap so that it will begin tracking disk changes.
2302 # - nothing on success
2303 # - If @node is not a valid block device, DeviceNotFound
2304 # - If @name is not found, GenericError with an explanation
2310 # -> { "execute": "block-dirty-bitmap-enable",
2311 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2312 # <- { "return": {} }
2314 { 'command': 'block-dirty-bitmap-enable',
2315 'data': 'BlockDirtyBitmap',
2316 'allow-preconfig': true }
2319 # @block-dirty-bitmap-disable:
2321 # Disables a dirty bitmap so that it will stop tracking disk changes.
2324 # - nothing on success
2325 # - If @node is not a valid block device, DeviceNotFound
2326 # - If @name is not found, GenericError with an explanation
2332 # -> { "execute": "block-dirty-bitmap-disable",
2333 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2334 # <- { "return": {} }
2336 { 'command': 'block-dirty-bitmap-disable',
2337 'data': 'BlockDirtyBitmap',
2338 'allow-preconfig': true }
2341 # @block-dirty-bitmap-merge:
2343 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2344 # Dirty bitmaps in @bitmaps will be unchanged, except if it also
2345 # appears as the @target bitmap. Any bits already set in @target will
2346 # still be set after the merge, i.e., this operation does not clear
2347 # the target. On error, @target is unchanged.
2349 # The resulting bitmap will count as dirty any clusters that were
2350 # dirty in any of the source bitmaps. This can be used to achieve
2351 # backup checkpoints, or in simpler usages, to copy bitmaps.
2354 # - nothing on success
2355 # - If @node is not a valid block device, DeviceNotFound
2356 # - If any bitmap in @bitmaps or @target is not found,
2358 # - If any of the bitmaps have different sizes or granularities,
2365 # -> { "execute": "block-dirty-bitmap-merge",
2366 # "arguments": { "node": "drive0", "target": "bitmap0",
2367 # "bitmaps": ["bitmap1"] } }
2368 # <- { "return": {} }
2370 { 'command': 'block-dirty-bitmap-merge',
2371 'data': 'BlockDirtyBitmapMerge',
2372 'allow-preconfig': true }
2375 # @BlockDirtyBitmapSha256:
2377 # SHA256 hash of dirty bitmap data
2379 # @sha256: ASCII representation of SHA256 bitmap hash
2383 { 'struct': 'BlockDirtyBitmapSha256',
2384 'data': {'sha256': 'str'} }
2387 # @x-debug-block-dirty-bitmap-sha256:
2389 # Get bitmap SHA256.
2393 # @unstable: This command is meant for debugging.
2396 # - BlockDirtyBitmapSha256 on success
2397 # - If @node is not a valid block device, DeviceNotFound
2398 # - If @name is not found or if hashing has failed, GenericError
2399 # with an explanation
2403 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2404 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256',
2405 'features': [ 'unstable' ],
2406 'allow-preconfig': true }
2411 # Start mirroring a block device's writes to a new destination.
2413 # @job-id: identifier for the newly-created block job. If omitted,
2414 # the device name will be used. (Since 2.7)
2416 # @device: The device name or node-name of a root node whose writes
2417 # should be mirrored.
2419 # @target: the id or node-name of the block device to mirror to. This
2420 # mustn't be attached to guest.
2422 # @replaces: with sync=full graph node name to be replaced by the new
2423 # image when a whole image copy is done. This can be used to
2424 # repair broken Quorum files. By default, @device is replaced,
2425 # although implicitly created filters on it are kept.
2427 # @speed: the maximum speed, in bytes per second
2429 # @sync: what parts of the disk image should be copied to the
2430 # destination (all the disk, only the sectors allocated in the
2431 # topmost image, or only new I/O).
2433 # @granularity: granularity of the dirty bitmap, default is 64K if the
2434 # image format doesn't have clusters, 4K if the clusters are
2435 # smaller than that, else the cluster size. Must be a power of 2
2436 # between 512 and 64M
2438 # @buf-size: maximum amount of data in flight from source to target
2440 # @on-source-error: the action to take on an error on the source,
2441 # default 'report'. 'stop' and 'enospc' can only be used if the
2442 # block device supports io-status (see BlockInfo).
2444 # @on-target-error: the action to take on an error on the target,
2445 # default 'report' (no limitations, since this applies to a
2446 # different block device than @device).
2448 # @filter-node-name: the node name that should be assigned to the
2449 # filter driver that the mirror job inserts into the graph above
2450 # @device. If this option is not given, a node name is
2451 # autogenerated. (Since: 2.9)
2453 # @copy-mode: when to copy data to the destination; defaults to
2454 # 'background' (Since: 3.0)
2456 # @auto-finalize: When false, this job will wait in a PENDING state
2457 # after it has finished its work, waiting for @block-job-finalize
2458 # before making any block graph changes. When true, this job will
2459 # automatically perform its abort or commit actions. Defaults to
2462 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
2463 # after it has completely ceased all work, and awaits
2464 # @block-job-dismiss. When true, this job will automatically
2465 # disappear from the query list without user intervention.
2466 # Defaults to true. (Since 3.1)
2468 # Returns: nothing on success.
2474 # -> { "execute": "blockdev-mirror",
2475 # "arguments": { "device": "ide-hd0",
2476 # "target": "target0",
2477 # "sync": "full" } }
2478 # <- { "return": {} }
2480 { 'command': 'blockdev-mirror',
2481 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2483 'sync': 'MirrorSyncMode',
2484 '*speed': 'int', '*granularity': 'uint32',
2485 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2486 '*on-target-error': 'BlockdevOnError',
2487 '*filter-node-name': 'str',
2488 '*copy-mode': 'MirrorCopyMode',
2489 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
2490 'allow-preconfig': true }
2495 # A set of parameters describing block throttling.
2497 # @device: Block device name
2499 # @id: The name or QOM path of the guest device (since: 2.8)
2501 # @bps: total throughput limit in bytes per second
2503 # @bps_rd: read throughput limit in bytes per second
2505 # @bps_wr: write throughput limit in bytes per second
2507 # @iops: total I/O operations per second
2509 # @iops_rd: read I/O operations per second
2511 # @iops_wr: write I/O operations per second
2513 # @bps_max: total throughput limit during bursts, in bytes (Since 1.7)
2515 # @bps_rd_max: read throughput limit during bursts, in bytes (Since
2518 # @bps_wr_max: write throughput limit during bursts, in bytes (Since
2521 # @iops_max: total I/O operations per second during bursts, in bytes
2524 # @iops_rd_max: read I/O operations per second during bursts, in bytes
2527 # @iops_wr_max: write I/O operations per second during bursts, in
2530 # @bps_max_length: maximum length of the @bps_max burst period, in
2531 # seconds. It must only be set if @bps_max is set as well.
2532 # Defaults to 1. (Since 2.6)
2534 # @bps_rd_max_length: maximum length of the @bps_rd_max burst period,
2535 # in seconds. It must only be set if @bps_rd_max is set as well.
2536 # Defaults to 1. (Since 2.6)
2538 # @bps_wr_max_length: maximum length of the @bps_wr_max burst period,
2539 # in seconds. It must only be set if @bps_wr_max is set as well.
2540 # Defaults to 1. (Since 2.6)
2542 # @iops_max_length: maximum length of the @iops burst period, in
2543 # seconds. It must only be set if @iops_max is set as well.
2544 # Defaults to 1. (Since 2.6)
2546 # @iops_rd_max_length: maximum length of the @iops_rd_max burst
2547 # period, in seconds. It must only be set if @iops_rd_max is set
2548 # as well. Defaults to 1. (Since 2.6)
2550 # @iops_wr_max_length: maximum length of the @iops_wr_max burst
2551 # period, in seconds. It must only be set if @iops_wr_max is set
2552 # as well. Defaults to 1. (Since 2.6)
2554 # @iops_size: an I/O size in bytes (Since 1.7)
2556 # @group: throttle group name (Since 2.4)
2560 # @deprecated: Member @device is deprecated. Use @id instead.
2564 { 'struct': 'BlockIOThrottle',
2565 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
2566 '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2567 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2568 '*bps_max': 'int', '*bps_rd_max': 'int',
2569 '*bps_wr_max': 'int', '*iops_max': 'int',
2570 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2571 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2572 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2573 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2574 '*iops_size': 'int', '*group': 'str' } }
2579 # Limit parameters for throttling. Since some limit combinations are
2580 # illegal, limits should always be set in one transaction. All fields
2581 # are optional. When setting limits, if a field is missing the
2582 # current value is not changed.
2584 # @iops-total: limit total I/O operations per second
2586 # @iops-total-max: I/O operations burst
2588 # @iops-total-max-length: length of the iops-total-max burst period,
2589 # in seconds It must only be set if @iops-total-max is set as
2592 # @iops-read: limit read operations per second
2594 # @iops-read-max: I/O operations read burst
2596 # @iops-read-max-length: length of the iops-read-max burst period, in
2597 # seconds It must only be set if @iops-read-max is set as well.
2599 # @iops-write: limit write operations per second
2601 # @iops-write-max: I/O operations write burst
2603 # @iops-write-max-length: length of the iops-write-max burst period,
2604 # in seconds It must only be set if @iops-write-max is set as
2607 # @bps-total: limit total bytes per second
2609 # @bps-total-max: total bytes burst
2611 # @bps-total-max-length: length of the bps-total-max burst period, in
2612 # seconds. It must only be set if @bps-total-max is set as well.
2614 # @bps-read: limit read bytes per second
2616 # @bps-read-max: total bytes read burst
2618 # @bps-read-max-length: length of the bps-read-max burst period, in
2619 # seconds It must only be set if @bps-read-max is set as well.
2621 # @bps-write: limit write bytes per second
2623 # @bps-write-max: total bytes write burst
2625 # @bps-write-max-length: length of the bps-write-max burst period, in
2626 # seconds It must only be set if @bps-write-max is set as well.
2628 # @iops-size: when limiting by iops max size of an I/O in bytes
2632 { 'struct': 'ThrottleLimits',
2633 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2634 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2635 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2636 '*iops-write' : 'int', '*iops-write-max' : 'int',
2637 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2638 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2639 '*bps-read' : 'int', '*bps-read-max' : 'int',
2640 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2641 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2642 '*iops-size' : 'int' } }
2645 # @ThrottleGroupProperties:
2647 # Properties for throttle-group objects.
2649 # @limits: limits to apply for this throttle group
2653 # @unstable: All members starting with x- are aliases for the same key
2654 # without x- in the @limits object. This is not a stable
2655 # interface and may be removed or changed incompatibly in the
2656 # future. Use @limits for a supported stable interface.
2660 { 'struct': 'ThrottleGroupProperties',
2661 'data': { '*limits': 'ThrottleLimits',
2662 '*x-iops-total': { 'type': 'int',
2663 'features': [ 'unstable' ] },
2664 '*x-iops-total-max': { 'type': 'int',
2665 'features': [ 'unstable' ] },
2666 '*x-iops-total-max-length': { 'type': 'int',
2667 'features': [ 'unstable' ] },
2668 '*x-iops-read': { 'type': 'int',
2669 'features': [ 'unstable' ] },
2670 '*x-iops-read-max': { 'type': 'int',
2671 'features': [ 'unstable' ] },
2672 '*x-iops-read-max-length': { 'type': 'int',
2673 'features': [ 'unstable' ] },
2674 '*x-iops-write': { 'type': 'int',
2675 'features': [ 'unstable' ] },
2676 '*x-iops-write-max': { 'type': 'int',
2677 'features': [ 'unstable' ] },
2678 '*x-iops-write-max-length': { 'type': 'int',
2679 'features': [ 'unstable' ] },
2680 '*x-bps-total': { 'type': 'int',
2681 'features': [ 'unstable' ] },
2682 '*x-bps-total-max': { 'type': 'int',
2683 'features': [ 'unstable' ] },
2684 '*x-bps-total-max-length': { 'type': 'int',
2685 'features': [ 'unstable' ] },
2686 '*x-bps-read': { 'type': 'int',
2687 'features': [ 'unstable' ] },
2688 '*x-bps-read-max': { 'type': 'int',
2689 'features': [ 'unstable' ] },
2690 '*x-bps-read-max-length': { 'type': 'int',
2691 'features': [ 'unstable' ] },
2692 '*x-bps-write': { 'type': 'int',
2693 'features': [ 'unstable' ] },
2694 '*x-bps-write-max': { 'type': 'int',
2695 'features': [ 'unstable' ] },
2696 '*x-bps-write-max-length': { 'type': 'int',
2697 'features': [ 'unstable' ] },
2698 '*x-iops-size': { 'type': 'int',
2699 'features': [ 'unstable' ] } } }
2704 # Copy data from a backing file into a block device.
2706 # The block streaming operation is performed in the background until
2707 # the entire backing file has been copied. This command returns
2708 # immediately once streaming has started. The status of ongoing block
2709 # streaming operations can be checked with query-block-jobs. The
2710 # operation can be stopped before it has completed using the
2711 # block-job-cancel command.
2713 # The node that receives the data is called the top image, can be
2714 # located in any part of the chain (but always above the base image;
2715 # see below) and can be specified using its device or node name.
2716 # Earlier qemu versions only allowed 'device' to name the top level
2717 # node; presence of the 'base-node' parameter during introspection can
2718 # be used as a witness of the enhanced semantics of 'device'.
2720 # If a base file is specified then sectors are not copied from that
2721 # base file and its backing chain. This can be used to stream a
2722 # subset of the backing file chain instead of flattening the entire
2723 # image. When streaming completes the image file will have the base
2724 # file as its backing file, unless that node was changed while the job
2725 # was running. In that case, base's parent's backing (or filtered,
2726 # whichever exists) child (i.e., base at the beginning of the job)
2727 # will be the new backing file.
2729 # On successful completion the image file is updated to drop the
2730 # backing file and the BLOCK_JOB_COMPLETED event is emitted.
2732 # In case @device is a filter node, block-stream modifies the first
2733 # non-filter overlay node below it to point to the new backing node
2734 # instead of modifying @device itself.
2736 # @job-id: identifier for the newly-created block job. If omitted,
2737 # the device name will be used. (Since 2.7)
2739 # @device: the device or node name of the top image
2741 # @base: the common backing file name. It cannot be set if @base-node
2742 # or @bottom is also set.
2744 # @base-node: the node name of the backing file. It cannot be set if
2745 # @base or @bottom is also set. (Since 2.8)
2747 # @bottom: the last node in the chain that should be streamed into
2748 # top. It cannot be set if @base or @base-node is also set. It
2749 # cannot be filter node. (Since 6.0)
2751 # @backing-file: The backing file string to write into the top image.
2752 # This filename is not validated.
2754 # If a pathname string is such that it cannot be resolved by QEMU,
2755 # that means that subsequent QMP or HMP commands must use
2756 # node-names for the image in question, as filename lookup methods
2759 # If not specified, QEMU will automatically determine the backing
2760 # file string to use, or error out if there is no obvious choice.
2761 # Care should be taken when specifying the string, to specify a
2762 # valid filename or protocol. (Since 2.1)
2764 # @speed: the maximum speed, in bytes per second
2766 # @on-error: the action to take on an error (default report). 'stop'
2767 # and 'enospc' can only be used if the block device supports
2768 # io-status (see BlockInfo). (Since 1.3)
2770 # @filter-node-name: the node name that should be assigned to the
2771 # filter driver that the stream job inserts into the graph above
2772 # @device. If this option is not given, a node name is
2773 # autogenerated. (Since: 6.0)
2775 # @auto-finalize: When false, this job will wait in a PENDING state
2776 # after it has finished its work, waiting for @block-job-finalize
2777 # before making any block graph changes. When true, this job will
2778 # automatically perform its abort or commit actions. Defaults to
2781 # @auto-dismiss: When false, this job will wait in a CONCLUDED state
2782 # after it has completely ceased all work, and awaits
2783 # @block-job-dismiss. When true, this job will automatically
2784 # disappear from the query list without user intervention.
2785 # Defaults to true. (Since 3.1)
2788 # - Nothing on success.
2789 # - If @device does not exist, DeviceNotFound.
2795 # -> { "execute": "block-stream",
2796 # "arguments": { "device": "virtio0",
2797 # "base": "/tmp/master.qcow2" } }
2798 # <- { "return": {} }
2800 { 'command': 'block-stream',
2801 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2802 '*base-node': 'str', '*backing-file': 'str', '*bottom': 'str',
2803 '*speed': 'int', '*on-error': 'BlockdevOnError',
2804 '*filter-node-name': 'str',
2805 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
2806 'allow-preconfig': true }
2809 # @block-job-set-speed:
2811 # Set maximum speed for a background block operation.
2813 # This command can only be issued when there is an active block job.
2815 # Throttling can be disabled by setting the speed to 0.
2817 # @device: The job identifier. This used to be a device name (hence
2818 # the name of the parameter), but since QEMU 2.7 it can have other
2821 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2825 # - Nothing on success
2826 # - If no background operation is active on this device,
2831 { 'command': 'block-job-set-speed',
2832 'data': { 'device': 'str', 'speed': 'int' },
2833 'allow-preconfig': true }
2836 # @block-job-cancel:
2838 # Stop an active background block operation.
2840 # This command returns immediately after marking the active background
2841 # block operation for cancellation. It is an error to call this
2842 # command if no operation is in progress.
2844 # The operation will cancel as soon as possible and then emit the
2845 # BLOCK_JOB_CANCELLED event. Before that happens the job is still
2846 # visible when enumerated using query-block-jobs.
2848 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has
2849 # indicated (via the event BLOCK_JOB_READY) that the source and
2850 # destination are synchronized, then the event triggered by this
2851 # command changes to BLOCK_JOB_COMPLETED, to indicate that the
2852 # mirroring has ended and the destination now has a point-in-time copy
2853 # tied to the time of the cancellation.
2855 # For streaming, the image file retains its backing file unless the
2856 # streaming operation happens to complete just as it is being
2857 # cancelled. A new streaming operation can be started at a later time
2858 # to finish copying all data from the backing file.
2860 # @device: The job identifier. This used to be a device name (hence
2861 # the name of the parameter), but since QEMU 2.7 it can have other
2864 # @force: If true, and the job has already emitted the event
2865 # BLOCK_JOB_READY, abandon the job immediately (even if it is
2866 # paused) instead of waiting for the destination to complete its
2867 # final synchronization (since 1.3)
2870 # - Nothing on success
2871 # - If no background operation is active on this device,
2876 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' },
2877 'allow-preconfig': true }
2882 # Pause an active background block operation.
2884 # This command returns immediately after marking the active background
2885 # block operation for pausing. It is an error to call this command if
2886 # no operation is in progress or if the job is already paused.
2888 # The operation will pause as soon as possible. No event is emitted
2889 # when the operation is actually paused. Cancelling a paused job
2890 # automatically resumes it.
2892 # @device: The job identifier. This used to be a device name (hence
2893 # the name of the parameter), but since QEMU 2.7 it can have other
2897 # - Nothing on success
2898 # - If no background operation is active on this device,
2903 { 'command': 'block-job-pause', 'data': { 'device': 'str' },
2904 'allow-preconfig': true }
2907 # @block-job-resume:
2909 # Resume an active background block operation.
2911 # This command returns immediately after resuming a paused background
2912 # block operation. It is an error to call this command if no
2913 # operation is in progress or if the job is not paused.
2915 # This command also clears the error status of the job.
2917 # @device: The job identifier. This used to be a device name (hence
2918 # the name of the parameter), but since QEMU 2.7 it can have other
2922 # - Nothing on success
2923 # - If no background operation is active on this device,
2928 { 'command': 'block-job-resume', 'data': { 'device': 'str' },
2929 'allow-preconfig': true }
2932 # @block-job-complete:
2934 # Manually trigger completion of an active background block operation.
2935 # This is supported for drive mirroring, where it also switches the
2936 # device to write to the target path only. The ability to complete is
2937 # signaled with a BLOCK_JOB_READY event.
2939 # This command completes an active background block operation
2940 # synchronously. The ordering of this command's return with the
2941 # BLOCK_JOB_COMPLETED event is not defined. Note that if an I/O error
2942 # occurs during the processing of this command: 1) the command itself
2943 # will fail; 2) the error will be processed according to the
2944 # rerror/werror arguments that were specified when starting the
2947 # A cancelled or paused job cannot be completed.
2949 # @device: The job identifier. This used to be a device name (hence
2950 # the name of the parameter), but since QEMU 2.7 it can have other
2954 # - Nothing on success
2955 # - If no background operation is active on this device,
2960 { 'command': 'block-job-complete', 'data': { 'device': 'str' },
2961 'allow-preconfig': true }
2964 # @block-job-dismiss:
2966 # For jobs that have already concluded, remove them from the
2967 # block-job-query list. This command only needs to be run for jobs
2968 # which were started with QEMU 2.12+ job lifetime management
2971 # This command will refuse to operate on any job that has not yet
2972 # reached its terminal state, JOB_STATUS_CONCLUDED. For jobs that make
2973 # use of the BLOCK_JOB_READY event, block-job-cancel or
2974 # block-job-complete will still need to be used as appropriate.
2976 # @id: The job identifier.
2978 # Returns: Nothing on success
2982 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' },
2983 'allow-preconfig': true }
2986 # @block-job-finalize:
2988 # Once a job that has manual=true reaches the pending state, it can be
2989 # instructed to finalize any graph changes and do any necessary
2990 # cleanup via this command. For jobs in a transaction, instructing
2991 # one job to finalize will force ALL jobs in the transaction to
2992 # finalize, so it is only necessary to instruct a single member job to
2995 # @id: The job identifier.
2997 # Returns: Nothing on success
3001 { 'command': 'block-job-finalize', 'data': { 'id': 'str' },
3002 'allow-preconfig': true }
3005 # @BlockdevDiscardOptions:
3007 # Determines how to handle discard requests.
3009 # @ignore: Ignore the request
3011 # @unmap: Forward as an unmap request
3015 { 'enum': 'BlockdevDiscardOptions',
3016 'data': [ 'ignore', 'unmap' ] }
3019 # @BlockdevDetectZeroesOptions:
3021 # Describes the operation mode for the automatic conversion of plain
3022 # zero writes by the OS to driver specific optimized zero write
3025 # @off: Disabled (default)
3029 # @unmap: Enabled and even try to unmap blocks if possible. This
3030 # requires also that @BlockdevDiscardOptions is set to unmap for
3035 { 'enum': 'BlockdevDetectZeroesOptions',
3036 'data': [ 'off', 'on', 'unmap' ] }
3039 # @BlockdevAioOptions:
3041 # Selects the AIO backend to handle I/O requests
3043 # @threads: Use qemu's thread pool
3045 # @native: Use native AIO backend (only Linux and Windows)
3047 # @io_uring: Use linux io_uring (since 5.0)
3051 { 'enum': 'BlockdevAioOptions',
3052 'data': [ 'threads', 'native',
3053 { 'name': 'io_uring', 'if': 'CONFIG_LINUX_IO_URING' } ] }
3056 # @BlockdevCacheOptions:
3058 # Includes cache-related options for block devices
3060 # @direct: enables use of O_DIRECT (bypass the host page cache;
3063 # @no-flush: ignore any flush requests for the device (default: false)
3067 { 'struct': 'BlockdevCacheOptions',
3068 'data': { '*direct': 'bool',
3069 '*no-flush': 'bool' } }
3074 # Drivers that are supported in block device operations.
3076 # @throttle: Since 2.11
3080 # @copy-on-read: Since 3.0
3082 # @blklogwrites: Since 3.0
3084 # @blkreplay: Since 4.2
3086 # @compress: Since 5.0
3088 # @copy-before-write: Since 6.2
3090 # @snapshot-access: Since 7.0
3094 { 'enum': 'BlockdevDriver',
3095 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
3096 'cloop', 'compress', 'copy-before-write', 'copy-on-read', 'dmg',
3097 'file', 'snapshot-access', 'ftp', 'ftps', 'gluster',
3098 {'name': 'host_cdrom', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
3099 {'name': 'host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
3101 { 'name': 'io_uring', 'if': 'CONFIG_BLKIO' },
3103 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme',
3104 { 'name': 'nvme-io_uring', 'if': 'CONFIG_BLKIO' },
3105 'parallels', 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum',
3107 { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
3108 'ssh', 'throttle', 'vdi', 'vhdx',
3109 { 'name': 'virtio-blk-vfio-pci', 'if': 'CONFIG_BLKIO' },
3110 { 'name': 'virtio-blk-vhost-user', 'if': 'CONFIG_BLKIO' },
3111 { 'name': 'virtio-blk-vhost-vdpa', 'if': 'CONFIG_BLKIO' },
3112 'vmdk', 'vpc', 'vvfat' ] }
3115 # @BlockdevOptionsFile:
3117 # Driver specific block device options for the file backend.
3119 # @filename: path to the image file
3121 # @pr-manager: the id for the object that will handle persistent
3122 # reservations for this device (default: none, forward the
3123 # commands via SG_IO; since 2.11)
3125 # @aio: AIO backend (default: threads) (since: 2.8)
3127 # @aio-max-batch: maximum number of requests to batch together into a
3128 # single submission in the AIO backend. The smallest value
3129 # between this and the aio-max-batch value of the IOThread object
3130 # is chosen. 0 means that the AIO backend will handle it
3131 # automatically. (default: 0, since 6.2)
3133 # @locking: whether to enable file locking. If set to 'auto', only
3134 # enable when Open File Descriptor (OFD) locking API is available
3135 # (default: auto, since 2.10)
3137 # @drop-cache: invalidate page cache during live migration. This
3138 # prevents stale data on the migration destination with
3139 # cache.direct=off. Currently only supported on Linux hosts.
3140 # (default: on, since: 4.0)
3142 # @x-check-cache-dropped: whether to check that page cache was dropped
3143 # on live migration. May cause noticeable delays if the image
3144 # file is large, do not use in production. (default: off)
3149 # @dynamic-auto-read-only: If present, enabled auto-read-only means
3150 # that the driver will open the image read-only at first,
3151 # dynamically reopen the image file read-write when the first
3152 # writer is attached to the node and reopen read-only when the
3153 # last writer is detached. This allows giving QEMU write
3154 # permissions only on demand when an operation actually needs
3157 # @unstable: Member x-check-cache-dropped is meant for debugging.
3161 { 'struct': 'BlockdevOptionsFile',
3162 'data': { 'filename': 'str',
3163 '*pr-manager': 'str',
3164 '*locking': 'OnOffAuto',
3165 '*aio': 'BlockdevAioOptions',
3166 '*aio-max-batch': 'int',
3167 '*drop-cache': {'type': 'bool',
3168 'if': 'CONFIG_LINUX'},
3169 '*x-check-cache-dropped': { 'type': 'bool',
3170 'features': [ 'unstable' ] } },
3171 'features': [ { 'name': 'dynamic-auto-read-only',
3172 'if': 'CONFIG_POSIX' } ] }
3175 # @BlockdevOptionsNull:
3177 # Driver specific block device options for the null backend.
3179 # @size: size of the device in bytes.
3181 # @latency-ns: emulated latency (in nanoseconds) in processing
3182 # requests. Default to zero which completes requests immediately.
3185 # @read-zeroes: if true, reads from the device produce zeroes; if
3186 # false, the buffer is left unchanged.
3187 # (default: false; since: 4.1)
3191 { 'struct': 'BlockdevOptionsNull',
3192 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
3195 # @BlockdevOptionsNVMe:
3197 # Driver specific block device options for the NVMe backend.
3199 # @device: PCI controller address of the NVMe device in format
3200 # hhhh:bb:ss.f (host:bus:slot.function)
3202 # @namespace: namespace number of the device, starting from 1.
3204 # Note that the PCI @device must have been unbound from any host
3205 # kernel driver before instructing QEMU to add the blockdev.
3209 { 'struct': 'BlockdevOptionsNVMe',
3210 'data': { 'device': 'str', 'namespace': 'int' } }
3213 # @BlockdevOptionsVVFAT:
3215 # Driver specific block device options for the vvfat protocol.
3217 # @dir: directory to be exported as FAT image
3219 # @fat-type: FAT type: 12, 16 or 32
3221 # @floppy: whether to export a floppy image (true) or partitioned hard
3222 # disk (false; default)
3224 # @label: set the volume label, limited to 11 bytes. FAT16 and FAT32
3225 # traditionally have some restrictions on labels, which are
3226 # ignored by most operating systems. Defaults to "QEMU VVFAT".
3229 # @rw: whether to allow write operations (default: false)
3233 { 'struct': 'BlockdevOptionsVVFAT',
3234 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
3235 '*label': 'str', '*rw': 'bool' } }
3238 # @BlockdevOptionsGenericFormat:
3240 # Driver specific block device options for image format that have no
3241 # option besides their data source.
3243 # @file: reference to or definition of the data source block device
3247 { 'struct': 'BlockdevOptionsGenericFormat',
3248 'data': { 'file': 'BlockdevRef' } }
3251 # @BlockdevOptionsLUKS:
3253 # Driver specific block device options for LUKS.
3255 # @key-secret: the ID of a QCryptoSecret object providing the
3256 # decryption key (since 2.6). Mandatory except when doing a
3257 # metadata-only probe of the image.
3261 { 'struct': 'BlockdevOptionsLUKS',
3262 'base': 'BlockdevOptionsGenericFormat',
3263 'data': { '*key-secret': 'str' } }
3266 # @BlockdevOptionsGenericCOWFormat:
3268 # Driver specific block device options for image format that have no
3269 # option besides their data source and an optional backing file.
3271 # @backing: reference to or definition of the backing file block
3272 # device, null disables the backing file entirely. Defaults to
3273 # the backing file stored the image file.
3277 { 'struct': 'BlockdevOptionsGenericCOWFormat',
3278 'base': 'BlockdevOptionsGenericFormat',
3279 'data': { '*backing': 'BlockdevRefOrNull' } }
3282 # @Qcow2OverlapCheckMode:
3284 # General overlap check modes.
3286 # @none: Do not perform any checks
3288 # @constant: Perform only checks which can be done in constant time
3289 # and without reading anything from disk
3291 # @cached: Perform only checks which can be done without reading
3292 # anything from disk
3294 # @all: Perform all available overlap checks
3298 { 'enum': 'Qcow2OverlapCheckMode',
3299 'data': [ 'none', 'constant', 'cached', 'all' ] }
3302 # @Qcow2OverlapCheckFlags:
3304 # Structure of flags for each metadata structure. Setting a field to
3305 # 'true' makes qemu guard that structure against unintended
3306 # overwriting. The default value is chosen according to the template
3309 # @template: Specifies a template mode which can be adjusted using the
3310 # other flags, defaults to 'cached'
3312 # @bitmap-directory: since 3.0
3316 { 'struct': 'Qcow2OverlapCheckFlags',
3317 'data': { '*template': 'Qcow2OverlapCheckMode',
3318 '*main-header': 'bool',
3319 '*active-l1': 'bool',
3320 '*active-l2': 'bool',
3321 '*refcount-table': 'bool',
3322 '*refcount-block': 'bool',
3323 '*snapshot-table': 'bool',
3324 '*inactive-l1': 'bool',
3325 '*inactive-l2': 'bool',
3326 '*bitmap-directory': 'bool' } }
3329 # @Qcow2OverlapChecks:
3331 # Specifies which metadata structures should be guarded against
3332 # unintended overwriting.
3334 # @flags: set of flags for separate specification of each metadata
3337 # @mode: named mode which chooses a specific set of flags
3341 { 'alternate': 'Qcow2OverlapChecks',
3342 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3343 'mode': 'Qcow2OverlapCheckMode' } }
3346 # @BlockdevQcowEncryptionFormat:
3348 # @aes: AES-CBC with plain64 initialization vectors
3352 { 'enum': 'BlockdevQcowEncryptionFormat',
3356 # @BlockdevQcowEncryption:
3360 { 'union': 'BlockdevQcowEncryption',
3361 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3362 'discriminator': 'format',
3363 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3366 # @BlockdevOptionsQcow:
3368 # Driver specific block device options for qcow.
3370 # @encrypt: Image decryption options. Mandatory for encrypted images,
3371 # except when doing a metadata-only probe of the image.
3375 { 'struct': 'BlockdevOptionsQcow',
3376 'base': 'BlockdevOptionsGenericCOWFormat',
3377 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3380 # @BlockdevQcow2EncryptionFormat:
3382 # @aes: AES-CBC with plain64 initialization vectors
3386 { 'enum': 'BlockdevQcow2EncryptionFormat',
3387 'data': [ 'aes', 'luks' ] }
3390 # @BlockdevQcow2Encryption:
3394 { 'union': 'BlockdevQcow2Encryption',
3395 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3396 'discriminator': 'format',
3397 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3398 'luks': 'QCryptoBlockOptionsLUKS'} }
3401 # @BlockdevOptionsPreallocate:
3403 # Filter driver intended to be inserted between format and protocol
3404 # node and do preallocation in protocol node on write.
3406 # @prealloc-align: on preallocation, align file length to this number,
3407 # default 1048576 (1M)
3409 # @prealloc-size: how much to preallocate, default 134217728 (128M)
3413 { 'struct': 'BlockdevOptionsPreallocate',
3414 'base': 'BlockdevOptionsGenericFormat',
3415 'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } }
3418 # @BlockdevOptionsQcow2:
3420 # Driver specific block device options for qcow2.
3422 # @lazy-refcounts: whether to enable the lazy refcounts feature
3423 # (default is taken from the image file)
3425 # @pass-discard-request: whether discard requests to the qcow2 device
3426 # should be forwarded to the data source
3428 # @pass-discard-snapshot: whether discard requests for the data source
3429 # should be issued when a snapshot operation (e.g. deleting a
3430 # snapshot) frees clusters in the qcow2 file
3432 # @pass-discard-other: whether discard requests for the data source
3433 # should be issued on other occasions where a cluster gets freed
3435 # @overlap-check: which overlap checks to perform for writes to the
3436 # image, defaults to 'cached' (since 2.2)
3438 # @cache-size: the maximum total size of the L2 table and refcount
3439 # block caches in bytes (since 2.2)
3441 # @l2-cache-size: the maximum size of the L2 table cache in bytes
3444 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3445 # bytes. It must be a power of two between 512 and the cluster
3446 # size. The default value is the cluster size (since 2.12)
3448 # @refcount-cache-size: the maximum size of the refcount block cache
3449 # in bytes (since 2.2)
3451 # @cache-clean-interval: clean unused entries in the L2 and refcount
3452 # caches. The interval is in seconds. The default value is 600
3453 # on supporting platforms, and 0 on other platforms. 0 disables
3454 # this feature. (since 2.5)
3456 # @encrypt: Image decryption options. Mandatory for encrypted images,
3457 # except when doing a metadata-only probe of the image. (since
3460 # @data-file: reference to or definition of the external data file.
3461 # This may only be specified for images that require an external
3462 # data file. If it is not specified for such an image, the data
3463 # file name is loaded from the image file. (since 4.0)
3467 { 'struct': 'BlockdevOptionsQcow2',
3468 'base': 'BlockdevOptionsGenericCOWFormat',
3469 'data': { '*lazy-refcounts': 'bool',
3470 '*pass-discard-request': 'bool',
3471 '*pass-discard-snapshot': 'bool',
3472 '*pass-discard-other': 'bool',
3473 '*overlap-check': 'Qcow2OverlapChecks',
3474 '*cache-size': 'int',
3475 '*l2-cache-size': 'int',
3476 '*l2-cache-entry-size': 'int',
3477 '*refcount-cache-size': 'int',
3478 '*cache-clean-interval': 'int',
3479 '*encrypt': 'BlockdevQcow2Encryption',
3480 '*data-file': 'BlockdevRef' } }
3483 # @SshHostKeyCheckMode:
3485 # @none: Don't check the host key at all
3487 # @hash: Compare the host key with a given hash
3489 # @known_hosts: Check the host key against the known_hosts file
3493 { 'enum': 'SshHostKeyCheckMode',
3494 'data': [ 'none', 'hash', 'known_hosts' ] }
3497 # @SshHostKeyCheckHashType:
3499 # @md5: The given hash is an md5 hash
3501 # @sha1: The given hash is an sha1 hash
3503 # @sha256: The given hash is an sha256 hash
3507 { 'enum': 'SshHostKeyCheckHashType',
3508 'data': [ 'md5', 'sha1', 'sha256' ] }
3513 # @type: The hash algorithm used for the hash
3515 # @hash: The expected hash value
3519 { 'struct': 'SshHostKeyHash',
3520 'data': { 'type': 'SshHostKeyCheckHashType',
3528 { 'union': 'SshHostKeyCheck',
3529 'base': { 'mode': 'SshHostKeyCheckMode' },
3530 'discriminator': 'mode',
3531 'data': { 'hash': 'SshHostKeyHash' } }
3534 # @BlockdevOptionsSsh:
3536 # @server: host address
3538 # @path: path to the image on the host
3540 # @user: user as which to connect, defaults to current local user name
3542 # @host-key-check: Defines how and what to check the host key against
3543 # (default: known_hosts)
3547 { 'struct': 'BlockdevOptionsSsh',
3548 'data': { 'server': 'InetSocketAddress',
3551 '*host-key-check': 'SshHostKeyCheck' } }
3556 # Trigger events supported by blkdebug.
3558 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3561 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3563 # @cor_write: a write due to copy-on-read (since 2.11)
3565 # @cluster_alloc_space: an allocation of file space for a cluster
3568 # @none: triggers once at creation of the blkdebug node (since 4.1)
3572 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3573 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3574 'l1_grow_activate_table', 'l2_load', 'l2_update',
3575 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3576 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3577 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3578 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3579 'refblock_load', 'refblock_update', 'refblock_update_part',
3580 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3581 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3582 'refblock_alloc_switch_table', 'cluster_alloc',
3583 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3584 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3585 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3586 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3587 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3588 'cor_write', 'cluster_alloc_space', 'none'] }
3593 # Kinds of I/O that blkdebug can inject errors in.
3595 # @read: .bdrv_co_preadv()
3597 # @write: .bdrv_co_pwritev()
3599 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3601 # @discard: .bdrv_co_pdiscard()
3603 # @flush: .bdrv_co_flush_to_disk()
3605 # @block-status: .bdrv_co_block_status()
3609 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3610 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3614 # @BlkdebugInjectErrorOptions:
3616 # Describes a single error injection for blkdebug.
3618 # @event: trigger event
3620 # @state: the state identifier blkdebug needs to be in to actually
3621 # trigger the event; defaults to "any"
3623 # @iotype: the type of I/O operations on which this error should be
3624 # injected; defaults to "all read, write, write-zeroes, discard,
3625 # and flush operations" (since: 4.1)
3627 # @errno: error identifier (errno) to be returned; defaults to EIO
3629 # @sector: specifies the sector index which has to be affected in
3630 # order to actually trigger the event; defaults to "any sector"
3632 # @once: disables further events after this one has been triggered;
3635 # @immediately: fail immediately; defaults to false
3639 { 'struct': 'BlkdebugInjectErrorOptions',
3640 'data': { 'event': 'BlkdebugEvent',
3642 '*iotype': 'BlkdebugIOType',
3646 '*immediately': 'bool' } }
3649 # @BlkdebugSetStateOptions:
3651 # Describes a single state-change event for blkdebug.
3653 # @event: trigger event
3655 # @state: the current state identifier blkdebug needs to be in;
3658 # @new_state: the state identifier blkdebug is supposed to assume if
3659 # this event is triggered
3663 { 'struct': 'BlkdebugSetStateOptions',
3664 'data': { 'event': 'BlkdebugEvent',
3666 'new_state': 'int' } }
3669 # @BlockdevOptionsBlkdebug:
3671 # Driver specific block device options for blkdebug.
3673 # @image: underlying raw block device (or image file)
3675 # @config: filename of the configuration file
3677 # @align: required alignment for requests in bytes, must be positive
3678 # power of 2, or 0 for default
3680 # @max-transfer: maximum size for I/O transfers in bytes, must be
3681 # positive multiple of @align and of the underlying file's request
3682 # alignment (but need not be a power of 2), or 0 for default
3685 # @opt-write-zero: preferred alignment for write zero requests in
3686 # bytes, must be positive multiple of @align and of the underlying
3687 # file's request alignment (but need not be a power of 2), or 0
3688 # for default (since 2.10)
3690 # @max-write-zero: maximum size for write zero requests in bytes, must
3691 # be positive multiple of @align, of @opt-write-zero, and of the
3692 # underlying file's request alignment (but need not be a power of
3693 # 2), or 0 for default (since 2.10)
3695 # @opt-discard: preferred alignment for discard requests in bytes,
3696 # must be positive multiple of @align and of the underlying file's
3697 # request alignment (but need not be a power of 2), or 0 for
3698 # default (since 2.10)
3700 # @max-discard: maximum size for discard requests in bytes, must be
3701 # positive multiple of @align, of @opt-discard, and of the
3702 # underlying file's request alignment (but need not be a power of
3703 # 2), or 0 for default (since 2.10)
3705 # @inject-error: array of error injection descriptions
3707 # @set-state: array of state-change descriptions
3709 # @take-child-perms: Permissions to take on @image in addition to what
3710 # is necessary anyway (which depends on how the blkdebug node is
3711 # used). Defaults to none. (since 5.0)
3713 # @unshare-child-perms: Permissions not to share on @image in addition
3714 # to what cannot be shared anyway (which depends on how the
3715 # blkdebug node is used). Defaults to none. (since 5.0)
3719 { 'struct': 'BlockdevOptionsBlkdebug',
3720 'data': { 'image': 'BlockdevRef',
3722 '*align': 'int', '*max-transfer': 'int32',
3723 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3724 '*opt-discard': 'int32', '*max-discard': 'int32',
3725 '*inject-error': ['BlkdebugInjectErrorOptions'],
3726 '*set-state': ['BlkdebugSetStateOptions'],
3727 '*take-child-perms': ['BlockPermission'],
3728 '*unshare-child-perms': ['BlockPermission'] } }
3731 # @BlockdevOptionsBlklogwrites:
3733 # Driver specific block device options for blklogwrites.
3735 # @file: block device
3737 # @log: block device used to log writes to @file
3739 # @log-sector-size: sector size used in logging writes to @file,
3740 # determines granularity of offsets and sizes of writes
3743 # @log-append: append to an existing log (default: false)
3745 # @log-super-update-interval: interval of write requests after which
3746 # the log super block is updated to disk (default: 4096)
3750 { 'struct': 'BlockdevOptionsBlklogwrites',
3751 'data': { 'file': 'BlockdevRef',
3752 'log': 'BlockdevRef',
3753 '*log-sector-size': 'uint32',
3754 '*log-append': 'bool',
3755 '*log-super-update-interval': 'uint64' } }
3758 # @BlockdevOptionsBlkverify:
3760 # Driver specific block device options for blkverify.
3762 # @test: block device to be tested
3764 # @raw: raw image used for verification
3768 { 'struct': 'BlockdevOptionsBlkverify',
3769 'data': { 'test': 'BlockdevRef',
3770 'raw': 'BlockdevRef' } }
3773 # @BlockdevOptionsBlkreplay:
3775 # Driver specific block device options for blkreplay.
3777 # @image: disk image which should be controlled with blkreplay
3781 { 'struct': 'BlockdevOptionsBlkreplay',
3782 'data': { 'image': 'BlockdevRef' } }
3785 # @QuorumReadPattern:
3787 # An enumeration of quorum read patterns.
3789 # @quorum: read all the children and do a quorum vote on reads
3791 # @fifo: read only from the first child that has not failed
3795 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3798 # @BlockdevOptionsQuorum:
3800 # Driver specific block device options for Quorum
3802 # @blkverify: true if the driver must print content mismatch set to
3805 # @children: the children block devices to use
3807 # @vote-threshold: the vote limit under which a read will fail
3809 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3812 # @read-pattern: choose read pattern and set to quorum by default
3817 { 'struct': 'BlockdevOptionsQuorum',
3818 'data': { '*blkverify': 'bool',
3819 'children': [ 'BlockdevRef' ],
3820 'vote-threshold': 'int',
3821 '*rewrite-corrupted': 'bool',
3822 '*read-pattern': 'QuorumReadPattern' } }
3825 # @BlockdevOptionsGluster:
3827 # Driver specific block device options for Gluster
3829 # @volume: name of gluster volume where VM image resides
3831 # @path: absolute path to image file in gluster volume
3833 # @server: gluster servers description
3835 # @debug: libgfapi log level (default '4' which is Error) (Since 2.8)
3837 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3841 { 'struct': 'BlockdevOptionsGluster',
3842 'data': { 'volume': 'str',
3844 'server': ['SocketAddress'],
3846 '*logfile': 'str' } }
3849 # @BlockdevOptionsIoUring:
3851 # Driver specific block device options for the io_uring backend.
3853 # @filename: path to the image file
3857 { 'struct': 'BlockdevOptionsIoUring',
3858 'data': { 'filename': 'str' },
3859 'if': 'CONFIG_BLKIO' }
3862 # @BlockdevOptionsNvmeIoUring:
3864 # Driver specific block device options for the nvme-io_uring backend.
3866 # @path: path to the NVMe namespace's character device (e.g.
3871 { 'struct': 'BlockdevOptionsNvmeIoUring',
3872 'data': { 'path': 'str' },
3873 'if': 'CONFIG_BLKIO' }
3876 # @BlockdevOptionsVirtioBlkVfioPci:
3878 # Driver specific block device options for the virtio-blk-vfio-pci
3881 # @path: path to the PCI device's sysfs directory (e.g.
3882 # /sys/bus/pci/devices/0000:00:01.0).
3886 { 'struct': 'BlockdevOptionsVirtioBlkVfioPci',
3887 'data': { 'path': 'str' },
3888 'if': 'CONFIG_BLKIO' }
3891 # @BlockdevOptionsVirtioBlkVhostUser:
3893 # Driver specific block device options for the virtio-blk-vhost-user
3896 # @path: path to the vhost-user UNIX domain socket.
3900 { 'struct': 'BlockdevOptionsVirtioBlkVhostUser',
3901 'data': { 'path': 'str' },
3902 'if': 'CONFIG_BLKIO' }
3905 # @BlockdevOptionsVirtioBlkVhostVdpa:
3907 # Driver specific block device options for the virtio-blk-vhost-vdpa
3910 # @path: path to the vhost-vdpa character device.
3914 { 'struct': 'BlockdevOptionsVirtioBlkVhostVdpa',
3915 'data': { 'path': 'str' },
3916 'if': 'CONFIG_BLKIO' }
3921 # An enumeration of libiscsi transport types
3925 { 'enum': 'IscsiTransport',
3926 'data': [ 'tcp', 'iser' ] }
3929 # @IscsiHeaderDigest:
3931 # An enumeration of header digests supported by libiscsi
3935 { 'enum': 'IscsiHeaderDigest',
3936 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3937 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3940 # @BlockdevOptionsIscsi:
3942 # @transport: The iscsi transport type
3944 # @portal: The address of the iscsi portal
3946 # @target: The target iqn name
3948 # @lun: LUN to connect to. Defaults to 0.
3950 # @user: User name to log in with. If omitted, no CHAP authentication
3953 # @password-secret: The ID of a QCryptoSecret object providing the
3954 # password for the login. This option is required if @user is
3957 # @initiator-name: The iqn name we want to identify to the target as.
3958 # If this option is not specified, an initiator name is generated
3961 # @header-digest: The desired header digest. Defaults to none-crc32c.
3963 # @timeout: Timeout in seconds after which a request will timeout. 0
3964 # means no timeout and is the default.
3966 # Driver specific block device options for iscsi
3970 { 'struct': 'BlockdevOptionsIscsi',
3971 'data': { 'transport': 'IscsiTransport',
3976 '*password-secret': 'str',
3977 '*initiator-name': 'str',
3978 '*header-digest': 'IscsiHeaderDigest',
3979 '*timeout': 'int' } }
3986 { 'enum': 'RbdAuthMode',
3987 'data': [ 'cephx', 'none' ] }
3990 # @RbdImageEncryptionFormat:
3992 # @luks-any: Used for opening either luks or luks2 (Since 8.0)
3996 { 'enum': 'RbdImageEncryptionFormat',
3997 'data': [ 'luks', 'luks2', 'luks-any' ] }
4000 # @RbdEncryptionOptionsLUKSBase:
4002 # @key-secret: ID of a QCryptoSecret object providing a passphrase for
4003 # unlocking the encryption
4007 { 'struct': 'RbdEncryptionOptionsLUKSBase',
4008 'data': { 'key-secret': 'str' } }
4011 # @RbdEncryptionCreateOptionsLUKSBase:
4013 # @cipher-alg: The encryption algorithm
4017 { 'struct': 'RbdEncryptionCreateOptionsLUKSBase',
4018 'base': 'RbdEncryptionOptionsLUKSBase',
4019 'data': { '*cipher-alg': 'QCryptoCipherAlgorithm' } }
4022 # @RbdEncryptionOptionsLUKS:
4026 { 'struct': 'RbdEncryptionOptionsLUKS',
4027 'base': 'RbdEncryptionOptionsLUKSBase',
4031 # @RbdEncryptionOptionsLUKS2:
4035 { 'struct': 'RbdEncryptionOptionsLUKS2',
4036 'base': 'RbdEncryptionOptionsLUKSBase',
4040 # @RbdEncryptionOptionsLUKSAny:
4044 { 'struct': 'RbdEncryptionOptionsLUKSAny',
4045 'base': 'RbdEncryptionOptionsLUKSBase',
4049 # @RbdEncryptionCreateOptionsLUKS:
4053 { 'struct': 'RbdEncryptionCreateOptionsLUKS',
4054 'base': 'RbdEncryptionCreateOptionsLUKSBase',
4058 # @RbdEncryptionCreateOptionsLUKS2:
4062 { 'struct': 'RbdEncryptionCreateOptionsLUKS2',
4063 'base': 'RbdEncryptionCreateOptionsLUKSBase',
4067 # @RbdEncryptionOptions:
4069 # @format: Encryption format.
4071 # @parent: Parent image encryption options (for cloned images). Can
4072 # be left unspecified if this cloned image is encrypted using the
4073 # same format and secret as its parent image (i.e. not explicitly
4074 # formatted) or if its parent image is not encrypted. (Since 8.0)
4078 { 'union': 'RbdEncryptionOptions',
4079 'base': { 'format': 'RbdImageEncryptionFormat',
4080 '*parent': 'RbdEncryptionOptions' },
4081 'discriminator': 'format',
4082 'data': { 'luks': 'RbdEncryptionOptionsLUKS',
4083 'luks2': 'RbdEncryptionOptionsLUKS2',
4084 'luks-any': 'RbdEncryptionOptionsLUKSAny'} }
4087 # @RbdEncryptionCreateOptions:
4091 { 'union': 'RbdEncryptionCreateOptions',
4092 'base': { 'format': 'RbdImageEncryptionFormat' },
4093 'discriminator': 'format',
4094 'data': { 'luks': 'RbdEncryptionCreateOptionsLUKS',
4095 'luks2': 'RbdEncryptionCreateOptionsLUKS2' } }
4098 # @BlockdevOptionsRbd:
4100 # @pool: Ceph pool name.
4102 # @namespace: Rados namespace name in the Ceph pool. (Since 5.0)
4104 # @image: Image name in the Ceph pool.
4106 # @conf: path to Ceph configuration file. Values in the configuration
4107 # file will be overridden by options specified via QAPI.
4109 # @snapshot: Ceph snapshot name.
4111 # @encrypt: Image encryption options. (Since 6.1)
4113 # @user: Ceph id name.
4115 # @auth-client-required: Acceptable authentication modes. This maps
4116 # to Ceph configuration option "auth_client_required". (Since
4119 # @key-secret: ID of a QCryptoSecret object providing a key for cephx
4120 # authentication. This maps to Ceph configuration option "key".
4123 # @server: Monitor host address and port. This maps to the "mon_host"
4128 { 'struct': 'BlockdevOptionsRbd',
4129 'data': { 'pool': 'str',
4130 '*namespace': 'str',
4134 '*encrypt': 'RbdEncryptionOptions',
4136 '*auth-client-required': ['RbdAuthMode'],
4137 '*key-secret': 'str',
4138 '*server': ['InetSocketAddressBase'] } }
4143 # An enumeration of replication modes.
4145 # @primary: Primary mode, the vm's state will be sent to secondary
4148 # @secondary: Secondary mode, receive the vm's state from primary
4153 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
4154 'if': 'CONFIG_REPLICATION' }
4157 # @BlockdevOptionsReplication:
4159 # Driver specific block device options for replication
4161 # @mode: the replication mode
4163 # @top-id: In secondary mode, node name or device ID of the root node
4164 # who owns the replication node chain. Must not be given in
4169 { 'struct': 'BlockdevOptionsReplication',
4170 'base': 'BlockdevOptionsGenericFormat',
4171 'data': { 'mode': 'ReplicationMode',
4173 'if': 'CONFIG_REPLICATION' }
4178 # An enumeration of NFS transport types
4180 # @inet: TCP transport
4184 { 'enum': 'NFSTransport',
4185 'data': [ 'inet' ] }
4190 # Captures the address of the socket
4192 # @type: transport type used for NFS (only TCP supported)
4194 # @host: host address for NFS server
4198 { 'struct': 'NFSServer',
4199 'data': { 'type': 'NFSTransport',
4203 # @BlockdevOptionsNfs:
4205 # Driver specific block device option for NFS
4207 # @server: host address
4209 # @path: path of the image on the host
4211 # @user: UID value to use when talking to the server (defaults to
4212 # 65534 on Windows and getuid() on unix)
4214 # @group: GID value to use when talking to the server (defaults to
4215 # 65534 on Windows and getgid() in unix)
4217 # @tcp-syn-count: number of SYNs during the session establishment
4218 # (defaults to libnfs default)
4220 # @readahead-size: set the readahead size in bytes (defaults to libnfs
4223 # @page-cache-size: set the pagecache size in bytes (defaults to
4226 # @debug: set the NFS debug level (max 2) (defaults to libnfs default)
4230 { 'struct': 'BlockdevOptionsNfs',
4231 'data': { 'server': 'NFSServer',
4235 '*tcp-syn-count': 'int',
4236 '*readahead-size': 'int',
4237 '*page-cache-size': 'int',
4241 # @BlockdevOptionsCurlBase:
4243 # Driver specific block device options shared by all protocols
4244 # supported by the curl backend.
4246 # @url: URL of the image file
4248 # @readahead: Size of the read-ahead cache; must be a multiple of 512
4249 # (defaults to 256 kB)
4251 # @timeout: Timeout for connections, in seconds (defaults to 5)
4253 # @username: Username for authentication (defaults to none)
4255 # @password-secret: ID of a QCryptoSecret object providing a password
4256 # for authentication (defaults to no password)
4258 # @proxy-username: Username for proxy authentication (defaults to
4261 # @proxy-password-secret: ID of a QCryptoSecret object providing a
4262 # password for proxy authentication (defaults to no password)
4266 { 'struct': 'BlockdevOptionsCurlBase',
4267 'data': { 'url': 'str',
4268 '*readahead': 'int',
4271 '*password-secret': 'str',
4272 '*proxy-username': 'str',
4273 '*proxy-password-secret': 'str' } }
4276 # @BlockdevOptionsCurlHttp:
4278 # Driver specific block device options for HTTP connections over the
4279 # curl backend. URLs must start with "http://".
4281 # @cookie: List of cookies to set; format is "name1=content1;
4282 # name2=content2;" as explained by CURLOPT_COOKIE(3). Defaults to
4285 # @cookie-secret: ID of a QCryptoSecret object providing the cookie
4286 # data in a secure way. See @cookie for the format. (since 2.10)
4290 { 'struct': 'BlockdevOptionsCurlHttp',
4291 'base': 'BlockdevOptionsCurlBase',
4292 'data': { '*cookie': 'str',
4293 '*cookie-secret': 'str'} }
4296 # @BlockdevOptionsCurlHttps:
4298 # Driver specific block device options for HTTPS connections over the
4299 # curl backend. URLs must start with "https://".
4301 # @cookie: List of cookies to set; format is "name1=content1;
4302 # name2=content2;" as explained by CURLOPT_COOKIE(3). Defaults to
4305 # @sslverify: Whether to verify the SSL certificate's validity
4306 # (defaults to true)
4308 # @cookie-secret: ID of a QCryptoSecret object providing the cookie
4309 # data in a secure way. See @cookie for the format. (since 2.10)
4313 { 'struct': 'BlockdevOptionsCurlHttps',
4314 'base': 'BlockdevOptionsCurlBase',
4315 'data': { '*cookie': 'str',
4316 '*sslverify': 'bool',
4317 '*cookie-secret': 'str'} }
4320 # @BlockdevOptionsCurlFtp:
4322 # Driver specific block device options for FTP connections over the
4323 # curl backend. URLs must start with "ftp://".
4327 { 'struct': 'BlockdevOptionsCurlFtp',
4328 'base': 'BlockdevOptionsCurlBase',
4332 # @BlockdevOptionsCurlFtps:
4334 # Driver specific block device options for FTPS connections over the
4335 # curl backend. URLs must start with "ftps://".
4337 # @sslverify: Whether to verify the SSL certificate's validity
4338 # (defaults to true)
4342 { 'struct': 'BlockdevOptionsCurlFtps',
4343 'base': 'BlockdevOptionsCurlBase',
4344 'data': { '*sslverify': 'bool' } }
4347 # @BlockdevOptionsNbd:
4349 # Driver specific block device options for NBD.
4351 # @server: NBD server address
4353 # @export: export name
4355 # @tls-creds: TLS credentials ID
4357 # @tls-hostname: TLS hostname override for certificate validation
4360 # @x-dirty-bitmap: A metadata context name such as
4361 # "qemu:dirty-bitmap:NAME" or "qemu:allocation-depth" to query in
4362 # place of the traditional "base:allocation" block status (see
4363 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol; and yes, naming
4364 # this option x-context would have made more sense) (since 3.0)
4366 # @reconnect-delay: On an unexpected disconnect, the nbd client tries
4367 # to connect again until succeeding or encountering a serious
4368 # error. During the first @reconnect-delay seconds, all requests
4369 # are paused and will be rerun on a successful reconnect. After
4370 # that time, any delayed requests and all future requests before a
4371 # successful reconnect will immediately fail. Default 0 (Since
4374 # @open-timeout: In seconds. If zero, the nbd driver tries the
4375 # connection only once, and fails to open if the connection fails.
4376 # If non-zero, the nbd driver will repeat connection attempts
4377 # until successful or until @open-timeout seconds have elapsed.
4378 # Default 0 (Since 7.0)
4382 # @unstable: Member @x-dirty-bitmap is experimental.
4386 { 'struct': 'BlockdevOptionsNbd',
4387 'data': { 'server': 'SocketAddress',
4389 '*tls-creds': 'str',
4390 '*tls-hostname': 'str',
4391 '*x-dirty-bitmap': { 'type': 'str', 'features': [ 'unstable' ] },
4392 '*reconnect-delay': 'uint32',
4393 '*open-timeout': 'uint32' } }
4396 # @BlockdevOptionsRaw:
4398 # Driver specific block device options for the raw driver.
4400 # @offset: position where the block device starts
4402 # @size: the assumed size of the device
4406 { 'struct': 'BlockdevOptionsRaw',
4407 'base': 'BlockdevOptionsGenericFormat',
4408 'data': { '*offset': 'int', '*size': 'int' } }
4411 # @BlockdevOptionsThrottle:
4413 # Driver specific block device options for the throttle driver
4415 # @throttle-group: the name of the throttle-group object to use. It
4416 # must already exist.
4418 # @file: reference to or definition of the data source block device
4422 { 'struct': 'BlockdevOptionsThrottle',
4423 'data': { 'throttle-group': 'str',
4424 'file' : 'BlockdevRef'
4428 # @BlockdevOptionsCor:
4430 # Driver specific block device options for the copy-on-read driver.
4432 # @bottom: The name of a non-filter node (allocation-bearing layer)
4433 # that limits the COR operations in the backing chain (inclusive),
4434 # so that no data below this node will be copied by this filter.
4435 # If option is absent, the limit is not applied, so that data from
4436 # all backing layers may be copied.
4440 { 'struct': 'BlockdevOptionsCor',
4441 'base': 'BlockdevOptionsGenericFormat',
4442 'data': { '*bottom': 'str' } }
4447 # An enumeration of possible behaviors for copy-before-write operation
4450 # @break-guest-write: report the error to the guest. This way, the
4451 # guest will not be able to overwrite areas that cannot be backed
4452 # up, so the backup process remains valid.
4454 # @break-snapshot: continue guest write. Doing so will make the
4455 # provided snapshot state invalid and any backup or export process
4456 # based on it will finally fail.
4460 { 'enum': 'OnCbwError',
4461 'data': [ 'break-guest-write', 'break-snapshot' ] }
4464 # @BlockdevOptionsCbw:
4466 # Driver specific block device options for the copy-before-write
4467 # driver, which does so called copy-before-write operations: when data
4468 # is written to the filter, the filter first reads corresponding
4469 # blocks from its file child and copies them to @target child. After
4470 # successfully copying, the write request is propagated to file child.
4471 # If copying fails, the original write request is failed too and no
4472 # data is written to file child.
4474 # @target: The target for copy-before-write operations.
4476 # @bitmap: If specified, copy-before-write filter will do
4477 # copy-before-write operations only for dirty regions of the
4478 # bitmap. Bitmap size must be equal to length of file and target
4479 # child of the filter. Note also, that bitmap is used only to
4480 # initialize internal bitmap of the process, so further
4481 # modifications (or removing) of specified bitmap doesn't
4482 # influence the filter. (Since 7.0)
4484 # @on-cbw-error: Behavior on failure of copy-before-write operation.
4485 # Default is @break-guest-write. (Since 7.1)
4487 # @cbw-timeout: Zero means no limit. Non-zero sets the timeout in
4488 # seconds for copy-before-write operation. When a timeout occurs,
4489 # the respective copy-before-write operation will fail, and the
4490 # @on-cbw-error parameter will decide how this failure is handled.
4491 # Default 0. (Since 7.1)
4495 { 'struct': 'BlockdevOptionsCbw',
4496 'base': 'BlockdevOptionsGenericFormat',
4497 'data': { 'target': 'BlockdevRef', '*bitmap': 'BlockDirtyBitmap',
4498 '*on-cbw-error': 'OnCbwError', '*cbw-timeout': 'uint32' } }
4503 # Options for creating a block device. Many options are available for
4504 # all block devices, independent of the block driver:
4506 # @driver: block driver name
4508 # @node-name: the node name of the new node (Since 2.0). This option
4509 # is required on the top level of blockdev-add. Valid node names
4510 # start with an alphabetic character and may contain only
4511 # alphanumeric characters, '-', '.' and '_'. Their maximum length
4514 # @discard: discard-related options (default: ignore)
4516 # @cache: cache-related options
4518 # @read-only: whether the block device should be read-only (default:
4519 # false). Note that some block drivers support only read-only
4520 # access, either generally or in certain configurations. In this
4521 # case, the default value does not work and the option must be
4522 # specified explicitly.
4524 # @auto-read-only: if true and @read-only is false, QEMU may
4525 # automatically decide not to open the image read-write as
4526 # requested, but fall back to read-only instead (and switch
4527 # between the modes later), e.g. depending on whether the image
4528 # file is writable or whether a writing user is attached to the
4529 # node (default: false, since 3.1)
4531 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
4534 # @force-share: force share all permission on added nodes. Requires
4535 # read-only=true. (Since 2.10)
4537 # Remaining options are determined by the block driver.
4541 { 'union': 'BlockdevOptions',
4542 'base': { 'driver': 'BlockdevDriver',
4543 '*node-name': 'str',
4544 '*discard': 'BlockdevDiscardOptions',
4545 '*cache': 'BlockdevCacheOptions',
4546 '*read-only': 'bool',
4547 '*auto-read-only': 'bool',
4548 '*force-share': 'bool',
4549 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
4550 'discriminator': 'driver',
4552 'blkdebug': 'BlockdevOptionsBlkdebug',
4553 'blklogwrites':'BlockdevOptionsBlklogwrites',
4554 'blkverify': 'BlockdevOptionsBlkverify',
4555 'blkreplay': 'BlockdevOptionsBlkreplay',
4556 'bochs': 'BlockdevOptionsGenericFormat',
4557 'cloop': 'BlockdevOptionsGenericFormat',
4558 'compress': 'BlockdevOptionsGenericFormat',
4559 'copy-before-write':'BlockdevOptionsCbw',
4560 'copy-on-read':'BlockdevOptionsCor',
4561 'dmg': 'BlockdevOptionsGenericFormat',
4562 'file': 'BlockdevOptionsFile',
4563 'ftp': 'BlockdevOptionsCurlFtp',
4564 'ftps': 'BlockdevOptionsCurlFtps',
4565 'gluster': 'BlockdevOptionsGluster',
4566 'host_cdrom': { 'type': 'BlockdevOptionsFile',
4567 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4568 'host_device': { 'type': 'BlockdevOptionsFile',
4569 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4570 'http': 'BlockdevOptionsCurlHttp',
4571 'https': 'BlockdevOptionsCurlHttps',
4572 'io_uring': { 'type': 'BlockdevOptionsIoUring',
4573 'if': 'CONFIG_BLKIO' },
4574 'iscsi': 'BlockdevOptionsIscsi',
4575 'luks': 'BlockdevOptionsLUKS',
4576 'nbd': 'BlockdevOptionsNbd',
4577 'nfs': 'BlockdevOptionsNfs',
4578 'null-aio': 'BlockdevOptionsNull',
4579 'null-co': 'BlockdevOptionsNull',
4580 'nvme': 'BlockdevOptionsNVMe',
4581 'nvme-io_uring': { 'type': 'BlockdevOptionsNvmeIoUring',
4582 'if': 'CONFIG_BLKIO' },
4583 'parallels': 'BlockdevOptionsGenericFormat',
4584 'preallocate':'BlockdevOptionsPreallocate',
4585 'qcow2': 'BlockdevOptionsQcow2',
4586 'qcow': 'BlockdevOptionsQcow',
4587 'qed': 'BlockdevOptionsGenericCOWFormat',
4588 'quorum': 'BlockdevOptionsQuorum',
4589 'raw': 'BlockdevOptionsRaw',
4590 'rbd': 'BlockdevOptionsRbd',
4591 'replication': { 'type': 'BlockdevOptionsReplication',
4592 'if': 'CONFIG_REPLICATION' },
4593 'snapshot-access': 'BlockdevOptionsGenericFormat',
4594 'ssh': 'BlockdevOptionsSsh',
4595 'throttle': 'BlockdevOptionsThrottle',
4596 'vdi': 'BlockdevOptionsGenericFormat',
4597 'vhdx': 'BlockdevOptionsGenericFormat',
4598 'virtio-blk-vfio-pci':
4599 { 'type': 'BlockdevOptionsVirtioBlkVfioPci',
4600 'if': 'CONFIG_BLKIO' },
4601 'virtio-blk-vhost-user':
4602 { 'type': 'BlockdevOptionsVirtioBlkVhostUser',
4603 'if': 'CONFIG_BLKIO' },
4604 'virtio-blk-vhost-vdpa':
4605 { 'type': 'BlockdevOptionsVirtioBlkVhostVdpa',
4606 'if': 'CONFIG_BLKIO' },
4607 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4608 'vpc': 'BlockdevOptionsGenericFormat',
4609 'vvfat': 'BlockdevOptionsVVFAT'
4615 # Reference to a block device.
4617 # @definition: defines a new block device inline
4619 # @reference: references the ID of an existing block device
4623 { 'alternate': 'BlockdevRef',
4624 'data': { 'definition': 'BlockdevOptions',
4625 'reference': 'str' } }
4628 # @BlockdevRefOrNull:
4630 # Reference to a block device.
4632 # @definition: defines a new block device inline
4634 # @reference: references the ID of an existing block device. An empty
4635 # string means that no block device should be referenced.
4636 # Deprecated; use null instead.
4638 # @null: No block device should be referenced (since 2.10)
4642 { 'alternate': 'BlockdevRefOrNull',
4643 'data': { 'definition': 'BlockdevOptions',
4650 # Creates a new block device.
4656 # -> { "execute": "blockdev-add",
4658 # "driver": "qcow2",
4659 # "node-name": "test1",
4662 # "filename": "test.qcow2"
4666 # <- { "return": {} }
4668 # -> { "execute": "blockdev-add",
4670 # "driver": "qcow2",
4671 # "node-name": "node0",
4672 # "discard": "unmap",
4678 # "filename": "/tmp/test.qcow2"
4684 # "filename": "/dev/fdset/4"
4690 # <- { "return": {} }
4692 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true,
4693 'allow-preconfig': true }
4698 # Reopens one or more block devices using the given set of options.
4699 # Any option not specified will be reset to its default value
4700 # regardless of its previous status. If an option cannot be changed
4701 # or a particular driver does not support reopening then the command
4702 # will return an error. All devices in the list are reopened in one
4703 # transaction, so if one of them fails then the whole transaction is
4706 # The command receives a list of block devices to reopen. For each
4707 # one of them, the top-level @node-name option (from BlockdevOptions)
4708 # must be specified and is used to select the block device to be
4709 # reopened. Other @node-name options must be either omitted or set to
4710 # the current name of the appropriate node. This command won't change
4711 # any node name and any attempt to do it will result in an error.
4713 # In the case of options that refer to child nodes, the behavior of
4714 # this command depends on the value:
4716 # 1) A set of options (BlockdevOptions): the child is reopened with
4717 # the specified set of options.
4719 # 2) A reference to the current child: the child is reopened using
4720 # its existing set of options.
4722 # 3) A reference to a different node: the current child is replaced
4723 # with the specified one.
4725 # 4) NULL: the current child (if any) is detached.
4727 # Options (1) and (2) are supported in all cases. Option (3) is
4728 # supported for @file and @backing, and option (4) for @backing only.
4730 # Unlike with blockdev-add, the @backing option must always be present
4731 # unless the node being reopened does not have a backing file and its
4732 # image does not have a default backing file name as part of its
4737 { 'command': 'blockdev-reopen',
4738 'data': { 'options': ['BlockdevOptions'] },
4739 'allow-preconfig': true }
4744 # Deletes a block device that has been added using blockdev-add. The
4745 # command will fail if the node is attached to a device or is
4746 # otherwise being used.
4748 # @node-name: Name of the graph node to delete.
4754 # -> { "execute": "blockdev-add",
4756 # "driver": "qcow2",
4757 # "node-name": "node0",
4760 # "filename": "test.qcow2"
4764 # <- { "return": {} }
4766 # -> { "execute": "blockdev-del",
4767 # "arguments": { "node-name": "node0" }
4769 # <- { "return": {} }
4771 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' },
4772 'allow-preconfig': true }
4775 # @BlockdevCreateOptionsFile:
4777 # Driver specific image creation options for file.
4779 # @filename: Filename for the new image file
4781 # @size: Size of the virtual disk in bytes
4783 # @preallocation: Preallocation mode for the new image (default: off;
4784 # allowed values: off, falloc (if CONFIG_POSIX_FALLOCATE), full
4785 # (if CONFIG_POSIX))
4787 # @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
4789 # @extent-size-hint: Extent size hint to add to the image file; 0 for
4790 # not adding an extent size hint (default: 1 MB, since 5.1)
4794 { 'struct': 'BlockdevCreateOptionsFile',
4795 'data': { 'filename': 'str',
4797 '*preallocation': 'PreallocMode',
4799 '*extent-size-hint': 'size'} }
4802 # @BlockdevCreateOptionsGluster:
4804 # Driver specific image creation options for gluster.
4806 # @location: Where to store the new image file
4808 # @size: Size of the virtual disk in bytes
4810 # @preallocation: Preallocation mode for the new image (default: off;
4811 # allowed values: off, falloc (if CONFIG_GLUSTERFS_FALLOCATE),
4812 # full (if CONFIG_GLUSTERFS_ZEROFILL))
4816 { 'struct': 'BlockdevCreateOptionsGluster',
4817 'data': { 'location': 'BlockdevOptionsGluster',
4819 '*preallocation': 'PreallocMode' } }
4822 # @BlockdevCreateOptionsLUKS:
4824 # Driver specific image creation options for LUKS.
4826 # @file: Node to create the image format on
4828 # @size: Size of the virtual disk in bytes
4830 # @preallocation: Preallocation mode for the new image (since: 4.2)
4831 # (default: off; allowed values: off, metadata, falloc, full)
4835 { 'struct': 'BlockdevCreateOptionsLUKS',
4836 'base': 'QCryptoBlockCreateOptionsLUKS',
4837 'data': { 'file': 'BlockdevRef',
4839 '*preallocation': 'PreallocMode' } }
4842 # @BlockdevCreateOptionsNfs:
4844 # Driver specific image creation options for NFS.
4846 # @location: Where to store the new image file
4848 # @size: Size of the virtual disk in bytes
4852 { 'struct': 'BlockdevCreateOptionsNfs',
4853 'data': { 'location': 'BlockdevOptionsNfs',
4857 # @BlockdevCreateOptionsParallels:
4859 # Driver specific image creation options for parallels.
4861 # @file: Node to create the image format on
4863 # @size: Size of the virtual disk in bytes
4865 # @cluster-size: Cluster size in bytes (default: 1 MB)
4869 { 'struct': 'BlockdevCreateOptionsParallels',
4870 'data': { 'file': 'BlockdevRef',
4872 '*cluster-size': 'size' } }
4875 # @BlockdevCreateOptionsQcow:
4877 # Driver specific image creation options for qcow.
4879 # @file: Node to create the image format on
4881 # @size: Size of the virtual disk in bytes
4883 # @backing-file: File name of the backing file if a backing file
4886 # @encrypt: Encryption options if the image should be encrypted
4890 { 'struct': 'BlockdevCreateOptionsQcow',
4891 'data': { 'file': 'BlockdevRef',
4893 '*backing-file': 'str',
4894 '*encrypt': 'QCryptoBlockCreateOptions' } }
4897 # @BlockdevQcow2Version:
4899 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version
4902 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4906 { 'enum': 'BlockdevQcow2Version',
4907 'data': [ 'v2', 'v3' ] }
4910 # @Qcow2CompressionType:
4912 # Compression type used in qcow2 image file
4914 # @zlib: zlib compression, see <http://zlib.net/>
4916 # @zstd: zstd compression, see <http://github.com/facebook/zstd>
4920 { 'enum': 'Qcow2CompressionType',
4921 'data': [ 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
4924 # @BlockdevCreateOptionsQcow2:
4926 # Driver specific image creation options for qcow2.
4928 # @file: Node to create the image format on
4930 # @data-file: Node to use as an external data file in which all guest
4931 # data is stored so that only metadata remains in the qcow2 file
4934 # @data-file-raw: True if the external data file must stay valid as a
4935 # standalone (read-only) raw image without looking at qcow2
4936 # metadata (default: false; since: 4.0)
4938 # @extended-l2: True to make the image have extended L2 entries
4939 # (default: false; since 5.2)
4941 # @size: Size of the virtual disk in bytes
4943 # @version: Compatibility level (default: v3)
4945 # @backing-file: File name of the backing file if a backing file
4948 # @backing-fmt: Name of the block driver to use for the backing file
4950 # @encrypt: Encryption options if the image should be encrypted
4952 # @cluster-size: qcow2 cluster size in bytes (default: 65536)
4954 # @preallocation: Preallocation mode for the new image (default: off;
4955 # allowed values: off, falloc, full, metadata)
4957 # @lazy-refcounts: True if refcounts may be updated lazily
4960 # @refcount-bits: Width of reference counts in bits (default: 16)
4962 # @compression-type: The image cluster compression method
4963 # (default: zlib, since 5.1)
4967 { 'struct': 'BlockdevCreateOptionsQcow2',
4968 'data': { 'file': 'BlockdevRef',
4969 '*data-file': 'BlockdevRef',
4970 '*data-file-raw': 'bool',
4971 '*extended-l2': 'bool',
4973 '*version': 'BlockdevQcow2Version',
4974 '*backing-file': 'str',
4975 '*backing-fmt': 'BlockdevDriver',
4976 '*encrypt': 'QCryptoBlockCreateOptions',
4977 '*cluster-size': 'size',
4978 '*preallocation': 'PreallocMode',
4979 '*lazy-refcounts': 'bool',
4980 '*refcount-bits': 'int',
4981 '*compression-type':'Qcow2CompressionType' } }
4984 # @BlockdevCreateOptionsQed:
4986 # Driver specific image creation options for qed.
4988 # @file: Node to create the image format on
4990 # @size: Size of the virtual disk in bytes
4992 # @backing-file: File name of the backing file if a backing file
4995 # @backing-fmt: Name of the block driver to use for the backing file
4997 # @cluster-size: Cluster size in bytes (default: 65536)
4999 # @table-size: L1/L2 table size (in clusters)
5003 { 'struct': 'BlockdevCreateOptionsQed',
5004 'data': { 'file': 'BlockdevRef',
5006 '*backing-file': 'str',
5007 '*backing-fmt': 'BlockdevDriver',
5008 '*cluster-size': 'size',
5009 '*table-size': 'int' } }
5012 # @BlockdevCreateOptionsRbd:
5014 # Driver specific image creation options for rbd/Ceph.
5016 # @location: Where to store the new image file. This location cannot
5017 # point to a snapshot.
5019 # @size: Size of the virtual disk in bytes
5021 # @cluster-size: RBD object size
5023 # @encrypt: Image encryption options. (Since 6.1)
5027 { 'struct': 'BlockdevCreateOptionsRbd',
5028 'data': { 'location': 'BlockdevOptionsRbd',
5030 '*cluster-size' : 'size',
5031 '*encrypt' : 'RbdEncryptionCreateOptions' } }
5034 # @BlockdevVmdkSubformat:
5036 # Subformat options for VMDK images
5038 # @monolithicSparse: Single file image with sparse cluster allocation
5040 # @monolithicFlat: Single flat data image and a descriptor file
5042 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA)
5043 # sparse extent files, in addition to a descriptor file
5045 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat
5046 # extent files, in addition to a descriptor file
5048 # @streamOptimized: Single file image sparse cluster allocation,
5049 # optimized for streaming over network.
5053 { 'enum': 'BlockdevVmdkSubformat',
5054 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
5055 'twoGbMaxExtentFlat', 'streamOptimized'] }
5058 # @BlockdevVmdkAdapterType:
5060 # Adapter type info for VMDK images
5064 { 'enum': 'BlockdevVmdkAdapterType',
5065 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
5068 # @BlockdevCreateOptionsVmdk:
5070 # Driver specific image creation options for VMDK.
5072 # @file: Where to store the new image file. This refers to the image
5073 # file for monolithcSparse and streamOptimized format, or the
5074 # descriptor file for other formats.
5076 # @size: Size of the virtual disk in bytes
5078 # @extents: Where to store the data extents. Required for
5079 # monolithcFlat, twoGbMaxExtentSparse and twoGbMaxExtentFlat
5080 # formats. For monolithicFlat, only one entry is required; for
5081 # twoGbMaxExtent* formats, the number of entries required is
5082 # calculated as extent_number = virtual_size / 2GB. Providing more
5083 # extents than will be used is an error.
5085 # @subformat: The subformat of the VMDK image. Default:
5086 # "monolithicSparse".
5088 # @backing-file: The path of backing file. Default: no backing file
5091 # @adapter-type: The adapter type used to fill in the descriptor.
5094 # @hwversion: Hardware version. The meaningful options are "4" or
5095 # "6". Default: "4".
5097 # @toolsversion: VMware guest tools version. Default: "2147483647"
5100 # @zeroed-grain: Whether to enable zeroed-grain feature for sparse
5101 # subformats. Default: false.
5105 { 'struct': 'BlockdevCreateOptionsVmdk',
5106 'data': { 'file': 'BlockdevRef',
5108 '*extents': ['BlockdevRef'],
5109 '*subformat': 'BlockdevVmdkSubformat',
5110 '*backing-file': 'str',
5111 '*adapter-type': 'BlockdevVmdkAdapterType',
5112 '*hwversion': 'str',
5113 '*toolsversion': 'str',
5114 '*zeroed-grain': 'bool' } }
5117 # @BlockdevCreateOptionsSsh:
5119 # Driver specific image creation options for SSH.
5121 # @location: Where to store the new image file
5123 # @size: Size of the virtual disk in bytes
5127 { 'struct': 'BlockdevCreateOptionsSsh',
5128 'data': { 'location': 'BlockdevOptionsSsh',
5132 # @BlockdevCreateOptionsVdi:
5134 # Driver specific image creation options for VDI.
5136 # @file: Node to create the image format on
5138 # @size: Size of the virtual disk in bytes
5140 # @preallocation: Preallocation mode for the new image (default: off;
5141 # allowed values: off, metadata)
5145 { 'struct': 'BlockdevCreateOptionsVdi',
5146 'data': { 'file': 'BlockdevRef',
5148 '*preallocation': 'PreallocMode' } }
5151 # @BlockdevVhdxSubformat:
5153 # @dynamic: Growing image file
5155 # @fixed: Preallocated fixed-size image file
5159 { 'enum': 'BlockdevVhdxSubformat',
5160 'data': [ 'dynamic', 'fixed' ] }
5163 # @BlockdevCreateOptionsVhdx:
5165 # Driver specific image creation options for vhdx.
5167 # @file: Node to create the image format on
5169 # @size: Size of the virtual disk in bytes
5171 # @log-size: Log size in bytes, must be a multiple of 1 MB (default: 1
5174 # @block-size: Block size in bytes, must be a multiple of 1 MB and not
5175 # larger than 256 MB (default: automatically choose a block size
5176 # depending on the image size)
5178 # @subformat: vhdx subformat (default: dynamic)
5180 # @block-state-zero: Force use of payload blocks of type
5181 # 'ZERO'. Non-standard, but default. Do not set to 'off' when
5182 # using 'qemu-img convert' with subformat=dynamic.
5186 { 'struct': 'BlockdevCreateOptionsVhdx',
5187 'data': { 'file': 'BlockdevRef',
5189 '*log-size': 'size',
5190 '*block-size': 'size',
5191 '*subformat': 'BlockdevVhdxSubformat',
5192 '*block-state-zero': 'bool' } }
5195 # @BlockdevVpcSubformat:
5197 # @dynamic: Growing image file
5199 # @fixed: Preallocated fixed-size image file
5203 { 'enum': 'BlockdevVpcSubformat',
5204 'data': [ 'dynamic', 'fixed' ] }
5207 # @BlockdevCreateOptionsVpc:
5209 # Driver specific image creation options for vpc (VHD).
5211 # @file: Node to create the image format on
5213 # @size: Size of the virtual disk in bytes
5215 # @subformat: vhdx subformat (default: dynamic)
5217 # @force-size: Force use of the exact byte size instead of rounding to
5218 # the next size that can be represented in CHS geometry
5223 { 'struct': 'BlockdevCreateOptionsVpc',
5224 'data': { 'file': 'BlockdevRef',
5226 '*subformat': 'BlockdevVpcSubformat',
5227 '*force-size': 'bool' } }
5230 # @BlockdevCreateOptions:
5232 # Options for creating an image format on a given node.
5234 # @driver: block driver to create the image format
5238 { 'union': 'BlockdevCreateOptions',
5240 'driver': 'BlockdevDriver' },
5241 'discriminator': 'driver',
5243 'file': 'BlockdevCreateOptionsFile',
5244 'gluster': 'BlockdevCreateOptionsGluster',
5245 'luks': 'BlockdevCreateOptionsLUKS',
5246 'nfs': 'BlockdevCreateOptionsNfs',
5247 'parallels': 'BlockdevCreateOptionsParallels',
5248 'qcow': 'BlockdevCreateOptionsQcow',
5249 'qcow2': 'BlockdevCreateOptionsQcow2',
5250 'qed': 'BlockdevCreateOptionsQed',
5251 'rbd': 'BlockdevCreateOptionsRbd',
5252 'ssh': 'BlockdevCreateOptionsSsh',
5253 'vdi': 'BlockdevCreateOptionsVdi',
5254 'vhdx': 'BlockdevCreateOptionsVhdx',
5255 'vmdk': 'BlockdevCreateOptionsVmdk',
5256 'vpc': 'BlockdevCreateOptionsVpc'
5262 # Starts a job to create an image format on a given node. The job is
5263 # automatically finalized, but a manual job-dismiss is required.
5265 # @job-id: Identifier for the newly created job.
5267 # @options: Options for the image creation.
5271 { 'command': 'blockdev-create',
5272 'data': { 'job-id': 'str',
5273 'options': 'BlockdevCreateOptions' },
5274 'allow-preconfig': true }
5277 # @BlockdevAmendOptionsLUKS:
5279 # Driver specific image amend options for LUKS.
5283 { 'struct': 'BlockdevAmendOptionsLUKS',
5284 'base': 'QCryptoBlockAmendOptionsLUKS',
5289 # @BlockdevAmendOptionsQcow2:
5291 # Driver specific image amend options for qcow2. For now, only
5292 # encryption options can be amended
5294 # @encrypt: Encryption options to be amended
5298 { 'struct': 'BlockdevAmendOptionsQcow2',
5299 'data': { '*encrypt': 'QCryptoBlockAmendOptions' } }
5302 # @BlockdevAmendOptions:
5304 # Options for amending an image format
5306 # @driver: Block driver of the node to amend.
5310 { 'union': 'BlockdevAmendOptions',
5312 'driver': 'BlockdevDriver' },
5313 'discriminator': 'driver',
5315 'luks': 'BlockdevAmendOptionsLUKS',
5316 'qcow2': 'BlockdevAmendOptionsQcow2' } }
5319 # @x-blockdev-amend:
5321 # Starts a job to amend format specific options of an existing open
5322 # block device The job is automatically finalized, but a manual
5323 # job-dismiss is required.
5325 # @job-id: Identifier for the newly created job.
5327 # @node-name: Name of the block node to work on
5329 # @options: Options (driver specific)
5331 # @force: Allow unsafe operations, format specific For luks that
5332 # allows erase of the last active keyslot (permanent loss of
5333 # data), and replacement of an active keyslot (possible loss of
5334 # data if IO error happens)
5338 # @unstable: This command is experimental.
5342 { 'command': 'x-blockdev-amend',
5343 'data': { 'job-id': 'str',
5345 'options': 'BlockdevAmendOptions',
5347 'features': [ 'unstable' ],
5348 'allow-preconfig': true }
5351 # @BlockErrorAction:
5353 # An enumeration of action that has been taken when a DISK I/O occurs
5355 # @ignore: error has been ignored
5357 # @report: error has been reported to the device
5359 # @stop: error caused VM to be stopped
5363 { 'enum': 'BlockErrorAction',
5364 'data': [ 'ignore', 'report', 'stop' ] }
5367 # @BLOCK_IMAGE_CORRUPTED:
5369 # Emitted when a disk image is being marked corrupt. The image can be
5370 # identified by its device or node name. The 'device' field is always
5371 # present for compatibility reasons, but it can be empty ("") if the
5372 # image does not have a device name associated.
5374 # @device: device name. This is always present for compatibility
5375 # reasons, but it can be empty ("") if the image does not have a
5376 # device name associated.
5378 # @node-name: node name (Since: 2.4)
5380 # @msg: informative message for human consumption, such as the kind of
5381 # corruption being detected. It should not be parsed by machine
5382 # as it is not guaranteed to be stable
5384 # @offset: if the corruption resulted from an image access, this is
5385 # the host's access offset into the image
5387 # @size: if the corruption resulted from an image access, this is the
5390 # @fatal: if set, the image is marked corrupt and therefore unusable
5391 # after this event and must be repaired (Since 2.2; before, every
5392 # BLOCK_IMAGE_CORRUPTED event was fatal)
5394 # Note: If action is "stop", a STOP event will eventually follow the
5395 # BLOCK_IO_ERROR event.
5399 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
5400 # "data": { "device": "", "node-name": "drive", "fatal": false,
5401 # "msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)" },
5402 # "timestamp": { "seconds": 1648243240, "microseconds": 906060 } }
5406 { 'event': 'BLOCK_IMAGE_CORRUPTED',
5407 'data': { 'device' : 'str',
5408 '*node-name' : 'str',
5412 'fatal' : 'bool' } }
5417 # Emitted when a disk I/O error occurs
5419 # @device: device name. This is always present for compatibility
5420 # reasons, but it can be empty ("") if the image does not have a
5421 # device name associated.
5423 # @node-name: node name. Note that errors may be reported for the
5424 # root node that is directly attached to a guest device rather
5425 # than for the node where the error occurred. The node name is
5426 # not present if the drive is empty. (Since: 2.8)
5428 # @operation: I/O operation
5430 # @action: action that has been taken
5432 # @nospace: true if I/O error was caused due to a no-space condition.
5433 # This key is only present if query-block's io-status is present,
5434 # please see query-block documentation for more information
5437 # @reason: human readable string describing the error cause. (This
5438 # field is a debugging aid for humans, it should not be parsed by
5439 # applications) (since: 2.2)
5441 # Note: If action is "stop", a STOP event will eventually follow the
5442 # BLOCK_IO_ERROR event
5448 # <- { "event": "BLOCK_IO_ERROR",
5449 # "data": { "device": "ide0-hd1",
5450 # "node-name": "#block212",
5451 # "operation": "write",
5453 # "reason": "No space left on device" },
5454 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5456 { 'event': 'BLOCK_IO_ERROR',
5457 'data': { 'device': 'str', '*node-name': 'str',
5458 'operation': 'IoOperationType',
5459 'action': 'BlockErrorAction', '*nospace': 'bool',
5463 # @BLOCK_JOB_COMPLETED:
5465 # Emitted when a block job has completed
5469 # @device: The job identifier. Originally the device name but other
5470 # values are allowed since QEMU 2.7
5472 # @len: maximum progress value
5474 # @offset: current progress value. On success this is equal to len.
5475 # On failure this is less than len
5477 # @speed: rate limit, bytes per second
5479 # @error: error message. Only present on failure. This field
5480 # contains a human-readable error message. There are no semantics
5481 # other than that streaming has failed and clients should not try
5482 # to interpret the error string
5488 # <- { "event": "BLOCK_JOB_COMPLETED",
5489 # "data": { "type": "stream", "device": "virtio-disk0",
5490 # "len": 10737418240, "offset": 10737418240,
5492 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5494 { 'event': 'BLOCK_JOB_COMPLETED',
5495 'data': { 'type' : 'JobType',
5503 # @BLOCK_JOB_CANCELLED:
5505 # Emitted when a block job has been cancelled
5509 # @device: The job identifier. Originally the device name but other
5510 # values are allowed since QEMU 2.7
5512 # @len: maximum progress value
5514 # @offset: current progress value. On success this is equal to len.
5515 # On failure this is less than len
5517 # @speed: rate limit, bytes per second
5523 # <- { "event": "BLOCK_JOB_CANCELLED",
5524 # "data": { "type": "stream", "device": "virtio-disk0",
5525 # "len": 10737418240, "offset": 134217728,
5527 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5529 { 'event': 'BLOCK_JOB_CANCELLED',
5530 'data': { 'type' : 'JobType',
5539 # Emitted when a block job encounters an error
5541 # @device: The job identifier. Originally the device name but other
5542 # values are allowed since QEMU 2.7
5544 # @operation: I/O operation
5546 # @action: action that has been taken
5552 # <- { "event": "BLOCK_JOB_ERROR",
5553 # "data": { "device": "ide0-hd1",
5554 # "operation": "write",
5555 # "action": "stop" },
5556 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5558 { 'event': 'BLOCK_JOB_ERROR',
5559 'data': { 'device' : 'str',
5560 'operation': 'IoOperationType',
5561 'action' : 'BlockErrorAction' } }
5566 # Emitted when a block job is ready to complete
5570 # @device: The job identifier. Originally the device name but other
5571 # values are allowed since QEMU 2.7
5573 # @len: maximum progress value
5575 # @offset: current progress value. On success this is equal to len.
5576 # On failure this is less than len
5578 # @speed: rate limit, bytes per second
5580 # Note: The "ready to complete" status is always reset by a
5581 # @BLOCK_JOB_ERROR event
5587 # <- { "event": "BLOCK_JOB_READY",
5588 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5589 # "len": 2097152, "offset": 2097152 },
5590 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5592 { 'event': 'BLOCK_JOB_READY',
5593 'data': { 'type' : 'JobType',
5600 # @BLOCK_JOB_PENDING:
5602 # Emitted when a block job is awaiting explicit authorization to
5603 # finalize graph changes via @block-job-finalize. If this job is part
5604 # of a transaction, it will not emit this event until the transaction
5605 # has converged first.
5609 # @id: The job identifier.
5615 # <- { "event": "BLOCK_JOB_PENDING",
5616 # "data": { "type": "mirror", "id": "backup_1" },
5617 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5619 { 'event': 'BLOCK_JOB_PENDING',
5620 'data': { 'type' : 'JobType',
5626 # Preallocation mode of QEMU image file
5628 # @off: no preallocation
5630 # @metadata: preallocate only for metadata
5632 # @falloc: like @full preallocation but allocate disk space by
5633 # posix_fallocate() rather than writing data.
5635 # @full: preallocate all data by writing it to the device to ensure
5636 # disk space is really available. This data may or may not be
5637 # zero, depending on the image format and storage. @full
5638 # preallocation also sets up metadata correctly.
5642 { 'enum': 'PreallocMode',
5643 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5646 # @BLOCK_WRITE_THRESHOLD:
5648 # Emitted when writes on block device reaches or exceeds the
5649 # configured write threshold. For thin-provisioned devices, this
5650 # means the device should be extended to avoid pausing for disk
5651 # exhaustion. The event is one shot. Once triggered, it needs to be
5652 # re-registered with another block-set-write-threshold command.
5654 # @node-name: graph node name on which the threshold was exceeded.
5656 # @amount-exceeded: amount of data which exceeded the threshold, in
5659 # @write-threshold: last configured threshold, in bytes.
5663 { 'event': 'BLOCK_WRITE_THRESHOLD',
5664 'data': { 'node-name': 'str',
5665 'amount-exceeded': 'uint64',
5666 'write-threshold': 'uint64' } }
5669 # @block-set-write-threshold:
5671 # Change the write threshold for a block drive. An event will be
5672 # delivered if a write to this block drive crosses the configured
5673 # threshold. The threshold is an offset, thus must be non-negative.
5674 # Default is no write threshold. Setting the threshold to zero
5677 # This is useful to transparently resize thin-provisioned drives
5678 # without the guest OS noticing.
5680 # @node-name: graph node name on which the threshold must be set.
5682 # @write-threshold: configured threshold for the block device, bytes.
5683 # Use 0 to disable the threshold.
5689 # -> { "execute": "block-set-write-threshold",
5690 # "arguments": { "node-name": "mydev",
5691 # "write-threshold": 17179869184 } }
5692 # <- { "return": {} }
5694 { 'command': 'block-set-write-threshold',
5695 'data': { 'node-name': 'str', 'write-threshold': 'uint64' },
5696 'allow-preconfig': true }
5699 # @x-blockdev-change:
5701 # Dynamically reconfigure the block driver state graph. It can be
5702 # used to add, remove, insert or replace a graph node. Currently only
5703 # the Quorum driver implements this feature to add or remove its
5704 # child. This is useful to fix a broken quorum child.
5706 # If @node is specified, it will be inserted under @parent. @child
5707 # may not be specified in this case. If both @parent and @child are
5708 # specified but @node is not, @child will be detached from @parent.
5710 # @parent: the id or name of the parent node.
5712 # @child: the name of a child under the given parent node.
5714 # @node: the name of the node that will be added.
5718 # @unstable: This command is experimental, and its API is not stable.
5719 # It does not support all kinds of operations, all kinds of
5720 # children, nor all block drivers.
5722 # FIXME Removing children from a quorum node means introducing
5723 # gaps in the child indices. This cannot be represented in the
5724 # 'children' list of BlockdevOptionsQuorum, as returned by
5725 # .bdrv_refresh_filename().
5727 # Warning: The data in a new quorum child MUST be consistent with
5728 # that of the rest of the array.
5734 # 1. Add a new node to a quorum
5736 # -> { "execute": "blockdev-add",
5739 # "node-name": "new_node",
5740 # "file": { "driver": "file",
5741 # "filename": "test.raw" } } }
5742 # <- { "return": {} }
5743 # -> { "execute": "x-blockdev-change",
5744 # "arguments": { "parent": "disk1",
5745 # "node": "new_node" } }
5746 # <- { "return": {} }
5748 # 2. Delete a quorum's node
5750 # -> { "execute": "x-blockdev-change",
5751 # "arguments": { "parent": "disk1",
5752 # "child": "children.1" } }
5753 # <- { "return": {} }
5755 { 'command': 'x-blockdev-change',
5756 'data' : { 'parent': 'str',
5759 'features': [ 'unstable' ],
5760 'allow-preconfig': true }
5763 # @x-blockdev-set-iothread:
5765 # Move @node and its children into the @iothread. If @iothread is
5766 # null then move @node and its children into the main loop.
5768 # The node must not be attached to a BlockBackend.
5770 # @node-name: the name of the block driver node
5772 # @iothread: the name of the IOThread object or null for the main loop
5774 # @force: true if the node and its children should be moved when a
5775 # BlockBackend is already attached
5779 # @unstable: This command is experimental and intended for test cases
5780 # that need control over IOThreads only.
5786 # 1. Move a node into an IOThread
5788 # -> { "execute": "x-blockdev-set-iothread",
5789 # "arguments": { "node-name": "disk1",
5790 # "iothread": "iothread0" } }
5791 # <- { "return": {} }
5793 # 2. Move a node into the main loop
5795 # -> { "execute": "x-blockdev-set-iothread",
5796 # "arguments": { "node-name": "disk1",
5797 # "iothread": null } }
5798 # <- { "return": {} }
5800 { 'command': 'x-blockdev-set-iothread',
5801 'data' : { 'node-name': 'str',
5802 'iothread': 'StrOrNull',
5804 'features': [ 'unstable' ],
5805 'allow-preconfig': true }
5810 # An enumeration of the quorum operation types
5812 # @read: read operation
5814 # @write: write operation
5816 # @flush: flush operation
5820 { 'enum': 'QuorumOpType',
5821 'data': [ 'read', 'write', 'flush' ] }
5826 # Emitted by the Quorum block driver if it fails to establish a quorum
5828 # @reference: device name if defined else node name
5830 # @sector-num: number of the first sector of the failed read operation
5832 # @sectors-count: failed read operation sector count
5834 # Note: This event is rate-limited.
5840 # <- { "event": "QUORUM_FAILURE",
5841 # "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
5842 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5844 { 'event': 'QUORUM_FAILURE',
5845 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
5848 # @QUORUM_REPORT_BAD:
5850 # Emitted to report a corruption of a Quorum file
5852 # @type: quorum operation type (Since 2.6)
5854 # @error: error message. Only present on failure. This field
5855 # contains a human-readable error message. There are no semantics
5856 # other than that the block layer reported an error and clients
5857 # should not try to interpret the error string.
5859 # @node-name: the graph node name of the block driver state
5861 # @sector-num: number of the first sector of the failed read operation
5863 # @sectors-count: failed read operation sector count
5865 # Note: This event is rate-limited.
5873 # <- { "event": "QUORUM_REPORT_BAD",
5874 # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
5876 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5878 # 2. Flush operation
5880 # <- { "event": "QUORUM_REPORT_BAD",
5881 # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
5882 # "type": "flush", "error": "Broken pipe" },
5883 # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
5885 { 'event': 'QUORUM_REPORT_BAD',
5886 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
5887 'sector-num': 'int', 'sectors-count': 'int' } }
5890 # @BlockdevSnapshotInternal:
5892 # @device: the device name or node-name of a root node to generate the
5895 # @name: the name of the internal snapshot to be created
5897 # Notes: In transaction, if @name is empty, or any snapshot matching
5898 # @name exists, the operation will fail. Only some image formats
5899 # support it, for example, qcow2, and rbd.
5903 { 'struct': 'BlockdevSnapshotInternal',
5904 'data': { 'device': 'str', 'name': 'str' } }
5907 # @blockdev-snapshot-internal-sync:
5909 # Synchronously take an internal snapshot of a block device, when the
5910 # format of the image used supports it. If the name is an empty
5911 # string, or a snapshot with name already exists, the operation will
5914 # For the arguments, see the documentation of
5915 # BlockdevSnapshotInternal.
5918 # - nothing on success
5919 # - If @device is not a valid block device, GenericError
5920 # - If any snapshot matching @name exists, or @name is empty,
5922 # - If the format of the image used does not support it,
5929 # -> { "execute": "blockdev-snapshot-internal-sync",
5930 # "arguments": { "device": "ide-hd0",
5931 # "name": "snapshot0" }
5933 # <- { "return": {} }
5935 { 'command': 'blockdev-snapshot-internal-sync',
5936 'data': 'BlockdevSnapshotInternal',
5937 'allow-preconfig': true }
5940 # @blockdev-snapshot-delete-internal-sync:
5942 # Synchronously delete an internal snapshot of a block device, when
5943 # the format of the image used support it. The snapshot is identified
5944 # by name or id or both. One of the name or id is required. Return
5945 # SnapshotInfo for the successfully deleted snapshot.
5947 # @device: the device name or node-name of a root node to delete the
5950 # @id: optional the snapshot's ID to be deleted
5952 # @name: optional the snapshot's name to be deleted
5955 # - SnapshotInfo on success
5956 # - If @device is not a valid block device, GenericError
5957 # - If snapshot not found, GenericError
5958 # - If the format of the image used does not support it,
5960 # - If @id and @name are both not specified, GenericError
5966 # -> { "execute": "blockdev-snapshot-delete-internal-sync",
5967 # "arguments": { "device": "ide-hd0",
5968 # "name": "snapshot0" }
5972 # "name": "snapshot0",
5973 # "vm-state-size": 0,
5974 # "date-sec": 1000012,
5976 # "vm-clock-sec": 100,
5977 # "vm-clock-nsec": 20,
5982 { 'command': 'blockdev-snapshot-delete-internal-sync',
5983 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
5984 'returns': 'SnapshotInfo',
5985 'allow-preconfig': true }
5988 # @DummyBlockCoreForceArrays:
5990 # Not used by QMP; hack to let us use BlockGraphInfoList internally
5994 { 'struct': 'DummyBlockCoreForceArrays',
5995 'data': { 'unused-block-graph-info': ['BlockGraphInfo'] } }