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 vm-clock-sec
30 # @icount: Current instruction count. Appears when execution record/replay
31 # is enabled. Used for "time-traveling" to match the moment
32 # in the recorded execution with the snapshots. This counter may
33 # be obtained through @query-replay command (since 5.2)
38 { 'struct': 'SnapshotInfo',
39 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
40 'date-sec': 'int', 'date-nsec': 'int',
41 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int',
45 # @ImageInfoSpecificQCow2EncryptionBase:
47 # @format: The encryption format
51 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
52 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
55 # @ImageInfoSpecificQCow2Encryption:
59 { 'union': 'ImageInfoSpecificQCow2Encryption',
60 'base': 'ImageInfoSpecificQCow2EncryptionBase',
61 'discriminator': 'format',
62 'data': { 'luks': 'QCryptoBlockInfoLUKS' } }
65 # @ImageInfoSpecificQCow2:
67 # @compat: compatibility level
69 # @data-file: the filename of the external data file that is stored in the
70 # image and used as a default for opening the image (since: 4.0)
72 # @data-file-raw: True if the external data file must stay valid as a
73 # standalone (read-only) raw image without looking at qcow2
74 # metadata (since: 4.0)
76 # @extended-l2: true if the image has extended L2 entries; only valid for
77 # compat >= 1.1 (since 5.2)
79 # @lazy-refcounts: on or off; only valid for compat >= 1.1
81 # @corrupt: true if the image has been marked corrupt; only valid for
82 # compat >= 1.1 (since 2.2)
84 # @refcount-bits: width of a refcount entry in bits (since 2.3)
86 # @encrypt: details about encryption parameters; only set if image
87 # is encrypted (since 2.10)
89 # @bitmaps: A list of qcow2 bitmap details (since 4.0)
91 # @compression-type: the image cluster compression method (since 5.1)
95 { 'struct': 'ImageInfoSpecificQCow2',
99 '*data-file-raw': 'bool',
100 '*extended-l2': 'bool',
101 '*lazy-refcounts': 'bool',
103 'refcount-bits': 'int',
104 '*encrypt': 'ImageInfoSpecificQCow2Encryption',
105 '*bitmaps': ['Qcow2BitmapInfo'],
106 'compression-type': 'Qcow2CompressionType'
110 # @ImageInfoSpecificVmdk:
112 # @create-type: The create type of VMDK image
114 # @cid: Content id of image
116 # @parent-cid: Parent VMDK image's cid
118 # @extents: List of extent files
122 { 'struct': 'ImageInfoSpecificVmdk',
124 'create-type': 'str',
127 'extents': ['VmdkExtentInfo']
133 # Information about a VMDK extent file
135 # @filename: Name of the extent file
137 # @format: Extent type (e.g. FLAT or SPARSE)
139 # @virtual-size: Number of bytes covered by this extent
141 # @cluster-size: Cluster size in bytes (for non-flat extents)
143 # @compressed: Whether this extent contains compressed data
147 { 'struct': 'VmdkExtentInfo',
151 'virtual-size': 'int',
152 '*cluster-size': 'int',
153 '*compressed': 'bool'
157 # @ImageInfoSpecificRbd:
159 # @encryption-format: Image encryption format
163 { 'struct': 'ImageInfoSpecificRbd',
165 '*encryption-format': 'RbdImageEncryptionFormat'
169 # @ImageInfoSpecificFile:
171 # @extent-size-hint: Extent size hint (if available)
175 { 'struct': 'ImageInfoSpecificFile',
177 '*extent-size-hint': 'size'
181 # @ImageInfoSpecificKind:
189 { 'enum': 'ImageInfoSpecificKind',
190 'data': [ 'qcow2', 'vmdk', 'luks', 'rbd', 'file' ] }
193 # @ImageInfoSpecificQCow2Wrapper:
197 { 'struct': 'ImageInfoSpecificQCow2Wrapper',
198 'data': { 'data': 'ImageInfoSpecificQCow2' } }
201 # @ImageInfoSpecificVmdkWrapper:
205 { 'struct': 'ImageInfoSpecificVmdkWrapper',
206 'data': { 'data': 'ImageInfoSpecificVmdk' } }
209 # @ImageInfoSpecificLUKSWrapper:
213 { 'struct': 'ImageInfoSpecificLUKSWrapper',
214 'data': { 'data': 'QCryptoBlockInfoLUKS' } }
215 # If we need to add block driver specific parameters for
216 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
217 # to define a ImageInfoSpecificLUKS
220 # @ImageInfoSpecificRbdWrapper:
224 { 'struct': 'ImageInfoSpecificRbdWrapper',
225 'data': { 'data': 'ImageInfoSpecificRbd' } }
228 # @ImageInfoSpecificFileWrapper:
232 { 'struct': 'ImageInfoSpecificFileWrapper',
233 'data': { 'data': 'ImageInfoSpecificFile' } }
236 # @ImageInfoSpecific:
238 # A discriminated record of image format specific information structures.
242 { 'union': 'ImageInfoSpecific',
243 'base': { 'type': 'ImageInfoSpecificKind' },
244 'discriminator': 'type',
246 'qcow2': 'ImageInfoSpecificQCow2Wrapper',
247 'vmdk': 'ImageInfoSpecificVmdkWrapper',
248 'luks': 'ImageInfoSpecificLUKSWrapper',
249 'rbd': 'ImageInfoSpecificRbdWrapper',
250 'file': 'ImageInfoSpecificFileWrapper'
256 # Information about a QEMU image file
258 # @filename: name of the image file
260 # @format: format of the image file
262 # @virtual-size: maximum capacity in bytes of the image
264 # @actual-size: actual size on disk in bytes of the image
266 # @dirty-flag: true if image is not cleanly closed
268 # @cluster-size: size of a cluster in bytes
270 # @encrypted: true if the image is encrypted
272 # @compressed: true if the image is compressed (Since 1.7)
274 # @backing-filename: name of the backing file
276 # @full-backing-filename: full path of the backing file
278 # @backing-filename-format: the format of the backing file
280 # @snapshots: list of VM snapshots
282 # @format-specific: structure supplying additional format-specific
283 # information (since 1.7)
287 { 'struct': 'BlockNodeInfo',
288 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
289 '*actual-size': 'int', 'virtual-size': 'int',
290 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
291 '*backing-filename': 'str', '*full-backing-filename': 'str',
292 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
293 '*format-specific': 'ImageInfoSpecific' } }
298 # Information about a QEMU image file, and potentially its backing image
300 # @backing-image: info of the backing image
304 { 'struct': 'ImageInfo',
305 'base': 'BlockNodeInfo',
307 '*backing-image': 'ImageInfo'
313 # Information about all nodes in the block graph starting at some node,
314 # annotated with information about that node in relation to its parent.
316 # @name: Child name of the root node in the BlockGraphInfo struct, in its role
317 # as the child of some undescribed parent node
319 # @info: Block graph information starting at this node
323 { 'struct': 'BlockChildInfo',
326 'info': 'BlockGraphInfo'
332 # Information about all nodes in a block (sub)graph in the form of BlockNodeInfo
334 # The base BlockNodeInfo struct contains the information for the (sub)graph's
337 # @children: Array of links to this node's child nodes' information
341 { 'struct': 'BlockGraphInfo',
342 'base': 'BlockNodeInfo',
343 'data': { 'children': ['BlockChildInfo'] } }
348 # Information about a QEMU image file check
350 # @filename: name of the image file checked
352 # @format: format of the image file checked
354 # @check-errors: number of unexpected errors occurred during check
356 # @image-end-offset: offset (in bytes) where the image ends, this
357 # field is present if the driver for the image format
360 # @corruptions: number of corruptions found during the check if any
362 # @leaks: number of leaks found during the check if any
364 # @corruptions-fixed: number of corruptions fixed during the check
367 # @leaks-fixed: number of leaks fixed during the check if any
369 # @total-clusters: total number of clusters, this field is present
370 # if the driver for the image format supports it
372 # @allocated-clusters: total number of allocated clusters, this
373 # field is present if the driver for the image format
376 # @fragmented-clusters: total number of fragmented clusters, this
377 # field is present if the driver for the image format
380 # @compressed-clusters: total number of compressed clusters, this
381 # field is present if the driver for the image format
386 { 'struct': 'ImageCheck',
387 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
388 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
389 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
390 '*total-clusters': 'int', '*allocated-clusters': 'int',
391 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
396 # Mapping information from a virtual block range to a host file range
398 # @start: virtual (guest) offset of the first byte described by this
401 # @length: the number of bytes of the mapped virtual range
403 # @data: reading the image will actually read data from a file (in
404 # particular, if @offset is present this means that the sectors
405 # are not simply preallocated, but contain actual data in raw
408 # @zero: whether the virtual blocks read as zeroes
410 # @depth: number of layers (0 = top image, 1 = top image's backing
411 # file, ..., n - 1 = bottom image (where n is the number of
412 # images in the chain)) before reaching one for which the
415 # @present: true if this layer provides the data, false if adding a backing
416 # layer could impact this region (since 6.1)
418 # @offset: if present, the image file stores the data for this range
419 # in raw format at the given (host) offset
421 # @filename: filename that is referred to by @offset
425 { 'struct': 'MapEntry',
426 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
427 'zero': 'bool', 'depth': 'int', 'present': 'bool',
428 '*offset': 'int', '*filename': 'str' } }
431 # @BlockdevCacheInfo:
433 # Cache mode information for a block device
435 # @writeback: true if writeback mode is enabled
436 # @direct: true if the host page cache is bypassed (O_DIRECT)
437 # @no-flush: true if flush requests are ignored for the device
441 { 'struct': 'BlockdevCacheInfo',
442 'data': { 'writeback': 'bool',
444 'no-flush': 'bool' } }
449 # Information about the backing device for a block device.
451 # @file: the filename of the backing device
453 # @node-name: the name of the block driver node (Since 2.0)
455 # @ro: true if the backing device was open read-only
457 # @drv: the name of the block format used to open the backing device. As of
458 # 0.14 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
459 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
460 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
461 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
462 # 2.2: 'archipelago' added, 'cow' dropped
463 # 2.3: 'host_floppy' deprecated
464 # 2.5: 'host_floppy' dropped
466 # 2.8: 'replication' added, 'tftp' dropped
467 # 2.9: 'archipelago' dropped
469 # @backing_file: the name of the backing file (for copy-on-write)
471 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
473 # @encrypted: true if the backing device is encrypted
475 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
477 # @bps: total throughput limit in bytes per second is specified
479 # @bps_rd: read throughput limit in bytes per second is specified
481 # @bps_wr: write throughput limit in bytes per second is specified
483 # @iops: total I/O operations per second is specified
485 # @iops_rd: read I/O operations per second is specified
487 # @iops_wr: write I/O operations per second is specified
489 # @image: the info of image used (since: 1.6)
491 # @bps_max: total throughput limit during bursts,
492 # in bytes (Since 1.7)
494 # @bps_rd_max: read throughput limit during bursts,
495 # in bytes (Since 1.7)
497 # @bps_wr_max: write throughput limit during bursts,
498 # in bytes (Since 1.7)
500 # @iops_max: total I/O operations per second during bursts,
501 # in bytes (Since 1.7)
503 # @iops_rd_max: read I/O operations per second during bursts,
504 # in bytes (Since 1.7)
506 # @iops_wr_max: write I/O operations per second during bursts,
507 # in bytes (Since 1.7)
509 # @bps_max_length: maximum length of the @bps_max burst
510 # period, in seconds. (Since 2.6)
512 # @bps_rd_max_length: maximum length of the @bps_rd_max
513 # burst period, in seconds. (Since 2.6)
515 # @bps_wr_max_length: maximum length of the @bps_wr_max
516 # burst period, in seconds. (Since 2.6)
518 # @iops_max_length: maximum length of the @iops burst
519 # period, in seconds. (Since 2.6)
521 # @iops_rd_max_length: maximum length of the @iops_rd_max
522 # burst period, in seconds. (Since 2.6)
524 # @iops_wr_max_length: maximum length of the @iops_wr_max
525 # burst period, in seconds. (Since 2.6)
527 # @iops_size: an I/O size in bytes (Since 1.7)
529 # @group: throttle group name (Since 2.4)
531 # @cache: the cache mode used for the block device (since: 2.3)
533 # @write_threshold: configured write threshold for the device.
534 # 0 if disabled. (Since 2.3)
536 # @dirty-bitmaps: dirty bitmaps information (only present if node
537 # has one or more dirty bitmaps) (Since 4.2)
541 { 'struct': 'BlockDeviceInfo',
542 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
543 '*backing_file': 'str', 'backing_file_depth': 'int',
545 'detect_zeroes': 'BlockdevDetectZeroesOptions',
546 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
547 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
548 'image': 'ImageInfo',
549 '*bps_max': 'int', '*bps_rd_max': 'int',
550 '*bps_wr_max': 'int', '*iops_max': 'int',
551 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
552 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
553 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
554 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
555 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
556 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
559 # @BlockDeviceIoStatus:
561 # An enumeration of block device I/O status.
563 # @ok: The last I/O operation has succeeded
565 # @failed: The last I/O operation has failed
567 # @nospace: The last I/O operation has failed due to a no-space condition
571 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
576 # Block dirty bitmap information.
578 # @name: the name of the dirty bitmap (Since 2.4)
580 # @count: number of dirty bytes according to the dirty bitmap
582 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
584 # @recording: true if the bitmap is recording new writes from the guest.
587 # @busy: true if the bitmap is in-use by some operation (NBD or jobs)
588 # and cannot be modified via QMP or used by another operation.
591 # @persistent: true if the bitmap was stored on disk, is scheduled to be stored
592 # on disk, or both. (since 4.0)
594 # @inconsistent: true if this is a persistent bitmap that was improperly
595 # stored. Implies @persistent to be true; @recording and
596 # @busy to be false. This bitmap cannot be used. To remove
597 # it, use @block-dirty-bitmap-remove. (Since 4.0)
601 { 'struct': 'BlockDirtyInfo',
602 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
603 'recording': 'bool', 'busy': 'bool',
604 'persistent': 'bool', '*inconsistent': 'bool' } }
607 # @Qcow2BitmapInfoFlags:
609 # An enumeration of flags that a bitmap can report to the user.
611 # @in-use: This flag is set by any process actively modifying the qcow2 file,
612 # and cleared when the updated bitmap is flushed to the qcow2 image.
613 # The presence of this flag in an offline image means that the bitmap
614 # was not saved correctly after its last usage, and may contain
617 # @auto: The bitmap must reflect all changes of the virtual disk by any
618 # application that would write to this qcow2 file.
622 { 'enum': 'Qcow2BitmapInfoFlags',
623 'data': ['in-use', 'auto'] }
628 # Qcow2 bitmap information.
630 # @name: the name of the bitmap
632 # @granularity: granularity of the bitmap in bytes
634 # @flags: flags of the bitmap
638 { 'struct': 'Qcow2BitmapInfo',
639 'data': {'name': 'str', 'granularity': 'uint32',
640 'flags': ['Qcow2BitmapInfoFlags'] } }
643 # @BlockLatencyHistogramInfo:
645 # Block latency histogram.
647 # @boundaries: list of interval boundary values in nanoseconds, all greater
648 # than zero and in ascending order.
649 # For example, the list [10, 50, 100] produces the following
650 # histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
652 # @bins: list of io request counts corresponding to histogram intervals.
653 # len(@bins) = len(@boundaries) + 1
654 # For the example above, @bins may be something like [3, 1, 5, 2],
655 # and corresponding histogram looks like:
664 # +------------------
669 { 'struct': 'BlockLatencyHistogramInfo',
670 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
675 # Block device information. This structure describes a virtual device and
676 # the backing device associated with it.
678 # @device: The device name associated with the virtual device.
680 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
681 # device. (since 2.10)
683 # @type: This field is returned only for compatibility reasons, it should
684 # not be used (always returns 'unknown')
686 # @removable: True if the device supports removable media.
688 # @locked: True if the guest has locked this device from having its media
691 # @tray_open: True if the device's tray is open
692 # (only present if it has a tray)
694 # @io-status: @BlockDeviceIoStatus. Only present if the device
695 # supports it and the VM is configured to stop on errors
696 # (supported device models: virtio-blk, IDE, SCSI except
699 # @inserted: @BlockDeviceInfo describing the device if media is
704 { 'struct': 'BlockInfo',
705 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
706 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
707 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus' } }
712 # Image file size calculation information. This structure describes the size
713 # requirements for creating a new image file.
715 # The size requirements depend on the new image file format. File size always
716 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
717 # Compact formats such as 'qcow2' represent unallocated and zero regions
718 # efficiently so file size may be smaller than virtual disk size.
720 # The values are upper bounds that are guaranteed to fit the new image file.
721 # Subsequent modification, such as internal snapshot or further bitmap
722 # creation, may require additional space and is not covered here.
724 # @required: Size required for a new image file, in bytes, when copying just
725 # allocated guest-visible contents.
727 # @fully-allocated: Image file size, in bytes, once data has been written
728 # to all sectors, when copying just guest-visible contents.
730 # @bitmaps: Additional size required if all the top-level bitmap metadata
731 # in the source image were to be copied to the destination,
732 # present only when source and destination both support
733 # persistent bitmaps. (since 5.1)
737 { 'struct': 'BlockMeasureInfo',
738 'data': {'required': 'int', 'fully-allocated': 'int', '*bitmaps': 'int'} }
743 # Get a list of BlockInfo for all virtual block devices.
745 # Returns: a list of @BlockInfo describing each virtual block device. Filter
746 # nodes that were created implicitly are skipped over.
752 # -> { "execute": "query-block" }
757 # "device":"ide0-hd0",
764 # "file":"disks/test.qcow2",
765 # "backing_file_depth":1,
772 # "bps_max": 8000000,
779 # "detect_zeroes": "on",
780 # "write_threshold": 0,
782 # "filename":"disks/test.qcow2",
784 # "virtual-size":2048000,
785 # "backing_file":"base.qcow2",
786 # "full-backing-filename":"disks/base.qcow2",
787 # "backing-filename-format":"qcow2",
791 # "name": "snapshot1",
792 # "vm-state-size": 0,
793 # "date-sec": 10000200,
795 # "vm-clock-sec": 206,
796 # "vm-clock-nsec": 30
800 # "filename":"disks/base.qcow2",
802 # "virtual-size":2048000
806 # "qdev": "ide_disk",
811 # "device":"ide1-cd0",
814 # "qdev": "/machine/unattached/device[23]",
815 # "tray_open": false,
819 # "device":"floppy0",
822 # "qdev": "/machine/unattached/device[20]",
835 { 'command': 'query-block', 'returns': ['BlockInfo'],
836 'allow-preconfig': true }
839 # @BlockDeviceTimedStats:
841 # Statistics of a block device during a given interval of time.
843 # @interval_length: Interval used for calculating the statistics,
846 # @min_rd_latency_ns: Minimum latency of read operations in the
847 # defined interval, in nanoseconds.
849 # @min_wr_latency_ns: Minimum latency of write operations in the
850 # defined interval, in nanoseconds.
852 # @min_flush_latency_ns: Minimum latency of flush operations in the
853 # defined interval, in nanoseconds.
855 # @max_rd_latency_ns: Maximum latency of read operations in the
856 # defined interval, in nanoseconds.
858 # @max_wr_latency_ns: Maximum latency of write operations in the
859 # defined interval, in nanoseconds.
861 # @max_flush_latency_ns: Maximum latency of flush operations in the
862 # defined interval, in nanoseconds.
864 # @avg_rd_latency_ns: Average latency of read operations in the
865 # defined interval, in nanoseconds.
867 # @avg_wr_latency_ns: Average latency of write operations in the
868 # defined interval, in nanoseconds.
870 # @avg_flush_latency_ns: Average latency of flush operations in the
871 # defined interval, in nanoseconds.
873 # @avg_rd_queue_depth: Average number of pending read operations
874 # in the defined interval.
876 # @avg_wr_queue_depth: Average number of pending write operations
877 # in the defined interval.
881 { 'struct': 'BlockDeviceTimedStats',
882 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
883 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
884 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
885 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
886 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
887 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
892 # Statistics of a virtual block device or a block backing device.
894 # @rd_bytes: The number of bytes read by the device.
896 # @wr_bytes: The number of bytes written by the device.
898 # @unmap_bytes: The number of bytes unmapped by the device (Since 4.2)
900 # @rd_operations: The number of read operations performed by the device.
902 # @wr_operations: The number of write operations performed by the device.
904 # @flush_operations: The number of cache flush operations performed by the
905 # device (since 0.15)
907 # @unmap_operations: The number of unmap operations performed by the device
910 # @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15).
912 # @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15).
914 # @flush_total_time_ns: Total time spent on cache flushes in nanoseconds
917 # @unmap_total_time_ns: Total time spent on unmap operations in nanoseconds
920 # @wr_highest_offset: The offset after the greatest byte written to the
921 # device. The intended use of this information is for
922 # growable sparse files (like qcow2) that are used on top
923 # of a physical device.
925 # @rd_merged: Number of read requests that have been merged into another
926 # request (Since 2.3).
928 # @wr_merged: Number of write requests that have been merged into another
929 # request (Since 2.3).
931 # @unmap_merged: Number of unmap requests that have been merged into another
932 # request (Since 4.2)
934 # @idle_time_ns: Time since the last I/O operation, in
935 # nanoseconds. If the field is absent it means that
936 # there haven't been any operations yet (Since 2.5).
938 # @failed_rd_operations: The number of failed read operations
939 # performed by the device (Since 2.5)
941 # @failed_wr_operations: The number of failed write operations
942 # performed by the device (Since 2.5)
944 # @failed_flush_operations: The number of failed flush operations
945 # performed by the device (Since 2.5)
947 # @failed_unmap_operations: The number of failed unmap operations performed
948 # by the device (Since 4.2)
950 # @invalid_rd_operations: The number of invalid read operations
951 # performed by the device (Since 2.5)
953 # @invalid_wr_operations: The number of invalid write operations
954 # performed by the device (Since 2.5)
956 # @invalid_flush_operations: The number of invalid flush operations
957 # performed by the device (Since 2.5)
959 # @invalid_unmap_operations: The number of invalid unmap operations performed
960 # by the device (Since 4.2)
962 # @account_invalid: Whether invalid operations are included in the
963 # last access statistics (Since 2.5)
965 # @account_failed: Whether failed operations are included in the
966 # latency and last access statistics (Since 2.5)
968 # @timed_stats: Statistics specific to the set of previously defined
969 # intervals of time (Since 2.5)
971 # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
973 # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
975 # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
979 { 'struct': 'BlockDeviceStats',
980 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int',
981 'rd_operations': 'int', 'wr_operations': 'int',
982 'flush_operations': 'int', 'unmap_operations': 'int',
983 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int',
984 'flush_total_time_ns': 'int', 'unmap_total_time_ns': 'int',
985 'wr_highest_offset': 'int',
986 'rd_merged': 'int', 'wr_merged': 'int', 'unmap_merged': 'int',
987 '*idle_time_ns': 'int',
988 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
989 'failed_flush_operations': 'int', 'failed_unmap_operations': 'int',
990 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int',
991 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int',
992 'account_invalid': 'bool', 'account_failed': 'bool',
993 'timed_stats': ['BlockDeviceTimedStats'],
994 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
995 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
996 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
999 # @BlockStatsSpecificFile:
1001 # File driver statistics
1003 # @discard-nb-ok: The number of successful discard operations performed by
1006 # @discard-nb-failed: The number of failed discard operations performed by
1009 # @discard-bytes-ok: The number of bytes discarded by the driver.
1013 { 'struct': 'BlockStatsSpecificFile',
1015 'discard-nb-ok': 'uint64',
1016 'discard-nb-failed': 'uint64',
1017 'discard-bytes-ok': 'uint64' } }
1020 # @BlockStatsSpecificNvme:
1022 # NVMe driver statistics
1024 # @completion-errors: The number of completion errors.
1026 # @aligned-accesses: The number of aligned accesses performed by
1029 # @unaligned-accesses: The number of unaligned accesses performed by
1034 { 'struct': 'BlockStatsSpecificNvme',
1036 'completion-errors': 'uint64',
1037 'aligned-accesses': 'uint64',
1038 'unaligned-accesses': 'uint64' } }
1041 # @BlockStatsSpecific:
1043 # Block driver specific statistics
1047 { 'union': 'BlockStatsSpecific',
1048 'base': { 'driver': 'BlockdevDriver' },
1049 'discriminator': 'driver',
1051 'file': 'BlockStatsSpecificFile',
1052 'host_device': { 'type': 'BlockStatsSpecificFile',
1053 'if': 'HAVE_HOST_BLOCK_DEVICE' },
1054 'nvme': 'BlockStatsSpecificNvme' } }
1059 # Statistics of a virtual block device or a block backing device.
1061 # @device: If the stats are for a virtual block device, the name
1062 # corresponding to the virtual block device.
1064 # @node-name: The node name of the device. (Since 2.3)
1066 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
1067 # device. (since 3.0)
1069 # @stats: A @BlockDeviceStats for the device.
1071 # @driver-specific: Optional driver-specific stats. (Since 4.2)
1073 # @parent: This describes the file block device if it has one.
1074 # Contains recursively the statistics of the underlying
1075 # protocol (e.g. the host file for a qcow2 image). If there is
1076 # no underlying protocol, this field is omitted
1078 # @backing: This describes the backing block device if it has one.
1083 { 'struct': 'BlockStats',
1084 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
1085 'stats': 'BlockDeviceStats',
1086 '*driver-specific': 'BlockStatsSpecific',
1087 '*parent': 'BlockStats',
1088 '*backing': 'BlockStats'} }
1091 # @query-blockstats:
1093 # Query the @BlockStats for all virtual block devices.
1095 # @query-nodes: If true, the command will query all the block nodes
1096 # that have a node name, in a list which will include "parent"
1097 # information, but not "backing".
1098 # If false or omitted, the behavior is as before - query all the
1099 # device backends, recursively including their "parent" and
1100 # "backing". Filter nodes that were created implicitly are
1101 # skipped over in this mode. (Since 2.3)
1103 # Returns: A list of @BlockStats for each virtual block devices.
1109 # -> { "execute": "query-blockstats" }
1113 # "device":"ide0-hd0",
1116 # "wr_highest_offset":3686448128,
1117 # "wr_bytes":9786368,
1118 # "wr_operations":751,
1119 # "rd_bytes":122567168,
1120 # "rd_operations":36772
1121 # "wr_total_times_ns":313253456
1122 # "rd_total_times_ns":3465673657
1123 # "flush_total_times_ns":49653
1124 # "flush_operations":61,
1127 # "idle_time_ns":2953431879,
1128 # "account_invalid":true,
1129 # "account_failed":false
1133 # "wr_highest_offset":2821110784,
1134 # "wr_bytes":9786368,
1135 # "wr_operations":692,
1136 # "rd_bytes":122739200,
1137 # "rd_operations":36604
1138 # "flush_operations":51,
1139 # "wr_total_times_ns":313253456
1140 # "rd_total_times_ns":3465673657
1141 # "flush_total_times_ns":49653,
1144 # "idle_time_ns":2953431879,
1145 # "account_invalid":true,
1146 # "account_failed":false
1148 # "qdev": "/machine/unattached/device[23]"
1151 # "device":"ide1-cd0",
1153 # "wr_highest_offset":0,
1155 # "wr_operations":0,
1158 # "flush_operations":0,
1159 # "wr_total_times_ns":0
1160 # "rd_total_times_ns":0
1161 # "flush_total_times_ns":0,
1164 # "account_invalid":false,
1165 # "account_failed":false
1167 # "qdev": "/machine/unattached/device[24]"
1170 # "device":"floppy0",
1172 # "wr_highest_offset":0,
1174 # "wr_operations":0,
1177 # "flush_operations":0,
1178 # "wr_total_times_ns":0
1179 # "rd_total_times_ns":0
1180 # "flush_total_times_ns":0,
1183 # "account_invalid":false,
1184 # "account_failed":false
1186 # "qdev": "/machine/unattached/device[16]"
1191 # "wr_highest_offset":0,
1193 # "wr_operations":0,
1196 # "flush_operations":0,
1197 # "wr_total_times_ns":0
1198 # "rd_total_times_ns":0
1199 # "flush_total_times_ns":0,
1202 # "account_invalid":false,
1203 # "account_failed":false
1210 { 'command': 'query-blockstats',
1211 'data': { '*query-nodes': 'bool' },
1212 'returns': ['BlockStats'],
1213 'allow-preconfig': true }
1218 # An enumeration of possible behaviors for errors on I/O operations.
1219 # The exact meaning depends on whether the I/O was initiated by a guest
1222 # @report: for guest operations, report the error to the guest;
1223 # for jobs, cancel the job
1225 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1226 # or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs retry
1227 # the failing request later and may still complete successfully. The
1228 # stream block job continues to stream and will complete with an
1231 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1233 # @stop: for guest operations, stop the virtual machine;
1234 # for jobs, pause the job
1236 # @auto: inherit the error handling policy of the backend (since: 2.7)
1240 { 'enum': 'BlockdevOnError',
1241 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1246 # An enumeration of possible behaviors for the initial synchronization
1247 # phase of storage mirroring.
1249 # @top: copies data in the topmost image to the destination
1251 # @full: copies data from all images to the destination
1253 # @none: only copy data written from now on
1255 # @incremental: only copy data described by the dirty bitmap. (since: 2.4)
1257 # @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
1258 # Behavior on completion is determined by the BitmapSyncMode.
1262 { 'enum': 'MirrorSyncMode',
1263 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1268 # An enumeration of possible behaviors for the synchronization of a bitmap
1269 # when used for data copy operations.
1271 # @on-success: The bitmap is only synced when the operation is successful.
1272 # This is the behavior always used for 'INCREMENTAL' backups.
1274 # @never: The bitmap is never synchronized with the operation, and is
1275 # treated solely as a read-only manifest of blocks to copy.
1277 # @always: The bitmap is always synchronized with the operation,
1278 # regardless of whether or not the operation was successful.
1282 { 'enum': 'BitmapSyncMode',
1283 'data': ['on-success', 'never', 'always'] }
1288 # An enumeration whose values tell the mirror block job when to
1289 # trigger writes to the target.
1291 # @background: copy data in background only.
1293 # @write-blocking: when data is written to the source, write it
1294 # (synchronously) to the target as well. In
1295 # addition, data is copied in background just like in
1300 { 'enum': 'MirrorCopyMode',
1301 'data': ['background', 'write-blocking'] }
1306 # Information about a long-running block device operation.
1308 # @type: the job type ('stream' for image streaming)
1310 # @device: The job identifier. Originally the device name but other
1311 # values are allowed since QEMU 2.7
1313 # @len: Estimated @offset value at the completion of the job. This value can
1314 # arbitrarily change while the job is running, in both directions.
1316 # @offset: Progress made until now. The unit is arbitrary and the value can
1317 # only meaningfully be used for the ratio of @offset to @len. The
1318 # value is monotonically increasing.
1320 # @busy: false if the job is known to be in a quiescent state, with
1321 # no pending I/O. Since 1.3.
1323 # @paused: whether the job is paused or, if @busy is true, will
1324 # pause itself as soon as possible. Since 1.3.
1326 # @speed: the rate limit, bytes per second
1328 # @io-status: the status of the job (since 1.3)
1330 # @ready: true if the job may be completed (since 2.2)
1332 # @status: Current job state/status (since 2.12)
1334 # @auto-finalize: Job will finalize itself when PENDING, moving to
1335 # the CONCLUDED state. (since 2.12)
1337 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1338 # state and disappearing from the query list. (since 2.12)
1340 # @error: Error information if the job did not complete successfully.
1341 # Not set if the job completed successfully. (since 2.12.1)
1345 { 'struct': 'BlockJobInfo',
1346 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1347 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1348 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1349 'status': 'JobStatus',
1350 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1354 # @query-block-jobs:
1356 # Return information about long-running block device operations.
1358 # Returns: a list of @BlockJobInfo for each active block job
1362 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'],
1363 'allow-preconfig': true }
1368 # Resize a block image while a guest is running.
1370 # Either @device or @node-name must be set but not both.
1372 # @device: the name of the device to get the image resized
1374 # @node-name: graph node name to get the image resized (Since 2.0)
1376 # @size: new image size in bytes
1378 # Returns: - nothing on success
1379 # - If @device is not a valid block device, DeviceNotFound
1385 # -> { "execute": "block_resize",
1386 # "arguments": { "device": "scratch", "size": 1073741824 } }
1387 # <- { "return": {} }
1390 { 'command': 'block_resize',
1391 'data': { '*device': 'str',
1392 '*node-name': 'str',
1395 'allow-preconfig': true }
1400 # An enumeration that tells QEMU how to set the backing file path in
1403 # @existing: QEMU should look for an existing image file.
1405 # @absolute-paths: QEMU should create a new image with absolute paths
1406 # for the backing file. If there is no backing file available, the new
1407 # image will not be backed either.
1411 { 'enum': 'NewImageMode',
1412 'data': [ 'existing', 'absolute-paths' ] }
1415 # @BlockdevSnapshotSync:
1417 # Either @device or @node-name must be set but not both.
1419 # @device: the name of the device to take a snapshot of.
1421 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1423 # @snapshot-file: the target of the new overlay image. If the file
1424 # exists, or if it is a device, the overlay will be created in the
1425 # existing file/device. Otherwise, a new file will be created.
1427 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1429 # @format: the format of the overlay image, default is 'qcow2'.
1431 # @mode: whether and how QEMU should create a new image, default is
1434 { 'struct': 'BlockdevSnapshotSync',
1435 'data': { '*device': 'str', '*node-name': 'str',
1436 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1437 '*format': 'str', '*mode': 'NewImageMode' } }
1440 # @BlockdevSnapshot:
1442 # @node: device or node name that will have a snapshot taken.
1444 # @overlay: reference to the existing block device that will become
1445 # the overlay of @node, as part of taking the snapshot.
1446 # It must not have a current backing file (this can be
1447 # achieved by passing "backing": null to blockdev-add).
1451 { 'struct': 'BlockdevSnapshot',
1452 'data': { 'node': 'str', 'overlay': 'str' } }
1457 # Optional parameters for backup. These parameters don't affect
1458 # functionality, but may significantly affect performance.
1460 # @use-copy-range: Use copy offloading. Default false.
1462 # @max-workers: Maximum number of parallel requests for the sustained background
1463 # copying process. Doesn't influence copy-before-write operations.
1466 # @max-chunk: Maximum request length for the sustained background copying
1467 # process. Doesn't influence copy-before-write operations.
1468 # 0 means unlimited. If max-chunk is non-zero then it should not be
1469 # less than job cluster size which is calculated as maximum of
1470 # target image cluster size and 64k. Default 0.
1474 { 'struct': 'BackupPerf',
1475 'data': { '*use-copy-range': 'bool',
1476 '*max-workers': 'int', '*max-chunk': 'int64' } }
1481 # @job-id: identifier for the newly-created block job. If
1482 # omitted, the device name will be used. (Since 2.7)
1484 # @device: the device name or node-name of a root node which should be copied.
1486 # @sync: what parts of the disk image should be copied to the destination
1487 # (all the disk, only the sectors allocated in the topmost image, from a
1488 # dirty bitmap, or only new I/O).
1490 # @speed: the maximum speed, in bytes per second. The default is 0,
1493 # @bitmap: The name of a dirty bitmap to use.
1494 # Must be present if sync is "bitmap" or "incremental".
1495 # Can be present if sync is "full" or "top".
1496 # Must not be present otherwise.
1497 # (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1499 # @bitmap-mode: Specifies the type of data the bitmap should contain after
1500 # the operation concludes.
1501 # Must be present if a bitmap was provided,
1502 # Must NOT be present otherwise. (Since 4.2)
1504 # @compress: true to compress data, if the target format supports it.
1505 # (default: false) (since 2.8)
1507 # @on-source-error: the action to take on an error on the source,
1508 # default 'report'. 'stop' and 'enospc' can only be used
1509 # if the block device supports io-status (see BlockInfo).
1511 # @on-target-error: the action to take on an error on the target,
1512 # default 'report' (no limitations, since this applies to
1513 # a different block device than @device).
1515 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1516 # finished its work, waiting for @block-job-finalize before
1517 # making any block graph changes.
1518 # When true, this job will automatically
1519 # perform its abort or commit actions.
1520 # Defaults to true. (Since 2.12)
1522 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1523 # has completely ceased all work, and awaits @block-job-dismiss.
1524 # When true, this job will automatically disappear from the query
1525 # list without user intervention.
1526 # Defaults to true. (Since 2.12)
1528 # @filter-node-name: the node name that should be assigned to the
1529 # filter driver that the backup job inserts into the graph
1530 # above node specified by @drive. If this option is not given,
1531 # a node name is autogenerated. (Since: 4.2)
1533 # @x-perf: Performance options. (Since 6.0)
1536 # @unstable: Member @x-perf is experimental.
1538 # Note: @on-source-error and @on-target-error only affect background
1539 # I/O. If an error occurs during a guest write request, the device's
1540 # rerror/werror actions will be used.
1544 { 'struct': 'BackupCommon',
1545 'data': { '*job-id': 'str', 'device': 'str',
1546 'sync': 'MirrorSyncMode', '*speed': 'int',
1547 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1548 '*compress': 'bool',
1549 '*on-source-error': 'BlockdevOnError',
1550 '*on-target-error': 'BlockdevOnError',
1551 '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
1552 '*filter-node-name': 'str',
1553 '*x-perf': { 'type': 'BackupPerf',
1554 'features': [ 'unstable' ] } } }
1559 # @target: the target of the new image. If the file exists, or if it
1560 # is a device, the existing file/device will be used as the new
1561 # destination. If it does not exist, a new file will be created.
1563 # @format: the format of the new destination, default is to
1564 # probe if @mode is 'existing', else the format of the source
1566 # @mode: whether and how QEMU should create a new image, default is
1571 { 'struct': 'DriveBackup',
1572 'base': 'BackupCommon',
1573 'data': { 'target': 'str',
1575 '*mode': 'NewImageMode' } }
1580 # @target: the device name or node-name of the backup target node.
1584 { 'struct': 'BlockdevBackup',
1585 'base': 'BackupCommon',
1586 'data': { 'target': 'str' } }
1589 # @blockdev-snapshot-sync:
1591 # Takes a synchronous snapshot of a block device.
1593 # For the arguments, see the documentation of BlockdevSnapshotSync.
1595 # Returns: - nothing on success
1596 # - If @device is not a valid block device, DeviceNotFound
1602 # -> { "execute": "blockdev-snapshot-sync",
1603 # "arguments": { "device": "ide-hd0",
1605 # "/some/place/my-image",
1606 # "format": "qcow2" } }
1607 # <- { "return": {} }
1610 { 'command': 'blockdev-snapshot-sync',
1611 'data': 'BlockdevSnapshotSync',
1612 'allow-preconfig': true }
1615 # @blockdev-snapshot:
1617 # Takes a snapshot of a block device.
1619 # Take a snapshot, by installing 'node' as the backing image of
1620 # 'overlay'. Additionally, if 'node' is associated with a block
1621 # device, the block device changes to using 'overlay' as its new active
1624 # For the arguments, see the documentation of BlockdevSnapshot.
1627 # @allow-write-only-overlay: If present, the check whether this operation is safe
1628 # was relaxed so that it can be used to change
1629 # backing file of a destination of a blockdev-mirror.
1636 # -> { "execute": "blockdev-add",
1637 # "arguments": { "driver": "qcow2",
1638 # "node-name": "node1534",
1639 # "file": { "driver": "file",
1640 # "filename": "hd1.qcow2" },
1641 # "backing": null } }
1643 # <- { "return": {} }
1645 # -> { "execute": "blockdev-snapshot",
1646 # "arguments": { "node": "ide-hd0",
1647 # "overlay": "node1534" } }
1648 # <- { "return": {} }
1651 { 'command': 'blockdev-snapshot',
1652 'data': 'BlockdevSnapshot',
1653 'features': [ 'allow-write-only-overlay' ],
1654 'allow-preconfig': true }
1657 # @change-backing-file:
1659 # Change the backing file in the image file metadata. This does not
1660 # cause QEMU to reopen the image file to reparse the backing filename
1661 # (it may, however, perform a reopen to change permissions from
1662 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1663 # into the image file metadata, and the QEMU internal strings are
1666 # @image-node-name: The name of the block driver state node of the
1667 # image to modify. The "device" argument is used
1668 # to verify "image-node-name" is in the chain
1669 # described by "device".
1671 # @device: The device name or node-name of the root node that owns
1674 # @backing-file: The string to write as the backing file. This
1675 # string is not validated, so care should be taken
1676 # when specifying the string or the image chain may
1677 # not be able to be reopened again.
1679 # Returns: - Nothing on success
1680 # - If "device" does not exist or cannot be determined, DeviceNotFound
1684 { 'command': 'change-backing-file',
1685 'data': { 'device': 'str', 'image-node-name': 'str',
1686 'backing-file': 'str' },
1687 'allow-preconfig': true }
1692 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1693 # writes data between 'top' and 'base' into 'base'.
1695 # If top == base, that is an error.
1696 # If top has no overlays on top of it, or if it is in use by a writer,
1697 # the job will not be completed by itself. The user needs to complete
1698 # the job with the block-job-complete command after getting the ready
1699 # event. (Since 2.0)
1701 # If the base image is smaller than top, then the base image will be
1702 # resized to be the same size as top. If top is smaller than the base
1703 # image, the base will not be truncated. If you want the base image
1704 # size to match the size of the smaller top, you can safely truncate
1705 # it yourself once the commit operation successfully completes.
1707 # @job-id: identifier for the newly-created block job. If
1708 # omitted, the device name will be used. (Since 2.7)
1710 # @device: the device name or node-name of a root node
1712 # @base-node: The node name of the backing image to write data into.
1713 # If not specified, this is the deepest backing image.
1716 # @base: Same as @base-node, except that it is a file name rather than a node
1717 # name. This must be the exact filename string that was used to open the
1718 # node; other strings, even if addressing the same file, are not
1721 # @top-node: The node name of the backing image within the image chain
1722 # which contains the topmost data to be committed down. If
1723 # not specified, this is the active layer. (since: 3.1)
1725 # @top: Same as @top-node, except that it is a file name rather than a node
1726 # name. This must be the exact filename string that was used to open the
1727 # node; other strings, even if addressing the same file, are not
1730 # @backing-file: The backing file string to write into the overlay
1731 # image of 'top'. If 'top' does not have an overlay
1732 # image, or if 'top' is in use by a writer, specifying
1733 # a backing file string is an error.
1735 # This filename is not validated. If a pathname string
1736 # is such that it cannot be resolved by QEMU, that
1737 # means that subsequent QMP or HMP commands must use
1738 # node-names for the image in question, as filename
1739 # lookup methods will fail.
1741 # If not specified, QEMU will automatically determine
1742 # the backing file string to use, or error out if
1743 # there is no obvious choice. Care should be taken
1744 # when specifying the string, to specify a valid
1745 # filename or protocol.
1748 # @speed: the maximum speed, in bytes per second
1750 # @on-error: the action to take on an error. 'ignore' means that the request
1751 # should be retried. (default: report; Since: 5.0)
1753 # @filter-node-name: the node name that should be assigned to the
1754 # filter driver that the commit job inserts into the graph
1755 # above @top. If this option is not given, a node name is
1756 # autogenerated. (Since: 2.9)
1758 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1759 # finished its work, waiting for @block-job-finalize before
1760 # making any block graph changes.
1761 # When true, this job will automatically
1762 # perform its abort or commit actions.
1763 # Defaults to true. (Since 3.1)
1765 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1766 # has completely ceased all work, and awaits @block-job-dismiss.
1767 # When true, this job will automatically disappear from the query
1768 # list without user intervention.
1769 # Defaults to true. (Since 3.1)
1772 # @deprecated: Members @base and @top are deprecated. Use @base-node
1773 # and @top-node instead.
1775 # Returns: - Nothing on success
1776 # - If @device does not exist, DeviceNotFound
1777 # - Any other error returns a GenericError.
1783 # -> { "execute": "block-commit",
1784 # "arguments": { "device": "virtio0",
1785 # "top": "/tmp/snap1.qcow2" } }
1786 # <- { "return": {} }
1789 { 'command': 'block-commit',
1790 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1791 '*base': { 'type': 'str', 'features': [ 'deprecated' ] },
1793 '*top': { 'type': 'str', 'features': [ 'deprecated' ] },
1794 '*backing-file': 'str', '*speed': 'int',
1795 '*on-error': 'BlockdevOnError',
1796 '*filter-node-name': 'str',
1797 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
1798 'allow-preconfig': true }
1803 # Start a point-in-time copy of a block device to a new destination. The
1804 # status of ongoing drive-backup operations can be checked with
1805 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1806 # The operation can be stopped before it has completed using the
1807 # block-job-cancel command.
1810 # @deprecated: This command is deprecated. Use @blockdev-backup instead.
1812 # Returns: - nothing on success
1813 # - If @device is not a valid block device, GenericError
1819 # -> { "execute": "drive-backup",
1820 # "arguments": { "device": "drive0",
1822 # "target": "backup.img" } }
1823 # <- { "return": {} }
1826 { 'command': 'drive-backup', 'boxed': true,
1827 'data': 'DriveBackup', 'features': ['deprecated'],
1828 'allow-preconfig': true }
1833 # Start a point-in-time copy of a block device to a new destination. The
1834 # status of ongoing blockdev-backup operations can be checked with
1835 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1836 # The operation can be stopped before it has completed using the
1837 # block-job-cancel command.
1839 # Returns: - nothing on success
1840 # - If @device is not a valid block device, DeviceNotFound
1846 # -> { "execute": "blockdev-backup",
1847 # "arguments": { "device": "src-id",
1849 # "target": "tgt-id" } }
1850 # <- { "return": {} }
1853 { 'command': 'blockdev-backup', 'boxed': true,
1854 'data': 'BlockdevBackup',
1855 'allow-preconfig': true }
1858 # @query-named-block-nodes:
1860 # Get the named block driver list
1862 # @flat: Omit the nested data about backing image ("backing-image" key) if true.
1863 # Default is false (Since 5.0)
1865 # Returns: the list of BlockDeviceInfo
1871 # -> { "execute": "query-named-block-nodes" }
1872 # <- { "return": [ { "ro":false,
1874 # "encrypted":false,
1875 # "file":"disks/test.qcow2",
1876 # "node-name": "my-node",
1877 # "backing_file_depth":1,
1878 # "detect_zeroes":"off",
1885 # "bps_max": 8000000,
1892 # "write_threshold": 0,
1894 # "filename":"disks/test.qcow2",
1896 # "virtual-size":2048000,
1897 # "backing_file":"base.qcow2",
1898 # "full-backing-filename":"disks/base.qcow2",
1899 # "backing-filename-format":"qcow2",
1903 # "name": "snapshot1",
1904 # "vm-state-size": 0,
1905 # "date-sec": 10000200,
1907 # "vm-clock-sec": 206,
1908 # "vm-clock-nsec": 30
1912 # "filename":"disks/base.qcow2",
1914 # "virtual-size":2048000
1919 { 'command': 'query-named-block-nodes',
1920 'returns': [ 'BlockDeviceInfo' ],
1921 'data': { '*flat': 'bool' },
1922 'allow-preconfig': true }
1925 # @XDbgBlockGraphNodeType:
1927 # @block-backend: corresponds to BlockBackend
1929 # @block-job: corresponds to BlockJob
1931 # @block-driver: corresponds to BlockDriverState
1935 { 'enum': 'XDbgBlockGraphNodeType',
1936 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1939 # @XDbgBlockGraphNode:
1941 # @id: Block graph node identifier. This @id is generated only for
1942 # x-debug-query-block-graph and does not relate to any other identifiers in
1945 # @type: Type of graph node. Can be one of block-backend, block-job or
1946 # block-driver-state.
1948 # @name: Human readable name of the node. Corresponds to node-name for
1949 # block-driver-state nodes; is not guaranteed to be unique in the whole
1950 # graph (with block-jobs and block-backends).
1954 { 'struct': 'XDbgBlockGraphNode',
1955 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1960 # Enum of base block permissions.
1962 # @consistent-read: A user that has the "permission" of consistent reads is
1963 # guaranteed that their view of the contents of the block
1964 # device is complete and self-consistent, representing the
1965 # contents of a disk at a specific point.
1966 # For most block devices (including their backing files) this
1967 # is true, but the property cannot be maintained in a few
1968 # situations like for intermediate nodes of a commit block
1971 # @write: This permission is required to change the visible disk contents.
1973 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1974 # both enough and required for writes to the block node when
1975 # the caller promises that the visible disk content doesn't
1977 # As the BLK_PERM_WRITE permission is strictly stronger,
1978 # either is sufficient to perform an unchanging write.
1980 # @resize: This permission is required to change the size of a block node.
1984 { 'enum': 'BlockPermission',
1985 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize' ] }
1988 # @XDbgBlockGraphEdge:
1990 # Block Graph edge description for x-debug-query-block-graph.
1992 # @parent: parent id
1996 # @name: name of the relation (examples are 'file' and 'backing')
1998 # @perm: granted permissions for the parent operating on the child
2000 # @shared-perm: permissions that can still be granted to other users of the
2001 # child while it is still attached to this parent
2005 { 'struct': 'XDbgBlockGraphEdge',
2006 'data': { 'parent': 'uint64', 'child': 'uint64',
2007 'name': 'str', 'perm': [ 'BlockPermission' ],
2008 'shared-perm': [ 'BlockPermission' ] } }
2013 # Block Graph - list of nodes and list of edges.
2017 { 'struct': 'XDbgBlockGraph',
2018 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
2021 # @x-debug-query-block-graph:
2023 # Get the block graph.
2026 # @unstable: This command is meant for debugging.
2030 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph',
2031 'features': [ 'unstable' ],
2032 'allow-preconfig': true }
2037 # Start mirroring a block device's writes to a new destination. target
2038 # specifies the target of the new image. If the file exists, or if it
2039 # is a device, it will be used as the new destination for writes. If
2040 # it does not exist, a new file will be created. format specifies the
2041 # format of the mirror image, default is to probe if mode='existing',
2042 # else the format of the source.
2044 # Returns: - nothing on success
2045 # - If @device is not a valid block device, GenericError
2051 # -> { "execute": "drive-mirror",
2052 # "arguments": { "device": "ide-hd0",
2053 # "target": "/some/place/my-image",
2055 # "format": "qcow2" } }
2056 # <- { "return": {} }
2059 { 'command': 'drive-mirror', 'boxed': true,
2060 'data': 'DriveMirror',
2061 'allow-preconfig': true }
2066 # A set of parameters describing drive mirror setup.
2068 # @job-id: identifier for the newly-created block job. If
2069 # omitted, the device name will be used. (Since 2.7)
2071 # @device: the device name or node-name of a root node whose writes should be
2074 # @target: the target of the new image. If the file exists, or if it
2075 # is a device, the existing file/device will be used as the new
2076 # destination. If it does not exist, a new file will be created.
2078 # @format: the format of the new destination, default is to
2079 # probe if @mode is 'existing', else the format of the source
2081 # @node-name: the new block driver state node name in the graph
2084 # @replaces: with sync=full graph node name to be replaced by the new
2085 # image when a whole image copy is done. This can be used to repair
2086 # broken Quorum files. By default, @device is replaced, although
2087 # implicitly created filters on it are kept. (Since 2.1)
2089 # @mode: whether and how QEMU should create a new image, default is
2092 # @speed: the maximum speed, in bytes per second
2094 # @sync: what parts of the disk image should be copied to the destination
2095 # (all the disk, only the sectors allocated in the topmost image, or
2098 # @granularity: granularity of the dirty bitmap, default is 64K
2099 # if the image format doesn't have clusters, 4K if the clusters
2100 # are smaller than that, else the cluster size. Must be a
2101 # power of 2 between 512 and 64M (since 1.4).
2103 # @buf-size: maximum amount of data in flight from source to
2104 # target (since 1.4).
2106 # @on-source-error: the action to take on an error on the source,
2107 # default 'report'. 'stop' and 'enospc' can only be used
2108 # if the block device supports io-status (see BlockInfo).
2110 # @on-target-error: the action to take on an error on the target,
2111 # default 'report' (no limitations, since this applies to
2112 # a different block device than @device).
2114 # @unmap: Whether to try to unmap target sectors where source has
2115 # only zero. If true, and target unallocated sectors will read as zero,
2116 # target image sectors will be unmapped; otherwise, zeroes will be
2117 # written. Both will result in identical contents.
2118 # Default is true. (Since 2.4)
2120 # @copy-mode: when to copy data to the destination; defaults to 'background'
2123 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2124 # finished its work, waiting for @block-job-finalize before
2125 # making any block graph changes.
2126 # When true, this job will automatically
2127 # perform its abort or commit actions.
2128 # Defaults to true. (Since 3.1)
2130 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2131 # has completely ceased all work, and awaits @block-job-dismiss.
2132 # When true, this job will automatically disappear from the query
2133 # list without user intervention.
2134 # Defaults to true. (Since 3.1)
2138 { 'struct': 'DriveMirror',
2139 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2140 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
2141 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2142 '*speed': 'int', '*granularity': 'uint32',
2143 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2144 '*on-target-error': 'BlockdevOnError',
2145 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
2146 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2149 # @BlockDirtyBitmap:
2151 # @node: name of device/node which the bitmap is tracking
2153 # @name: name of the dirty bitmap
2157 { 'struct': 'BlockDirtyBitmap',
2158 'data': { 'node': 'str', 'name': 'str' } }
2161 # @BlockDirtyBitmapAdd:
2163 # @node: name of device/node which the bitmap is tracking
2165 # @name: name of the dirty bitmap (must be less than 1024 bytes)
2167 # @granularity: the bitmap granularity, default is 64k for
2168 # block-dirty-bitmap-add
2170 # @persistent: the bitmap is persistent, i.e. it will be saved to the
2171 # corresponding block device image file on its close. For now only
2172 # Qcow2 disks support persistent bitmaps. Default is false for
2173 # block-dirty-bitmap-add. (Since: 2.10)
2175 # @disabled: the bitmap is created in the disabled state, which means that
2176 # it will not track drive changes. The bitmap may be enabled with
2177 # block-dirty-bitmap-enable. Default is false. (Since: 4.0)
2181 { 'struct': 'BlockDirtyBitmapAdd',
2182 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
2183 '*persistent': 'bool', '*disabled': 'bool' } }
2186 # @BlockDirtyBitmapOrStr:
2188 # @local: name of the bitmap, attached to the same node as target bitmap.
2190 # @external: bitmap with specified node
2194 { 'alternate': 'BlockDirtyBitmapOrStr',
2195 'data': { 'local': 'str',
2196 'external': 'BlockDirtyBitmap' } }
2199 # @BlockDirtyBitmapMerge:
2201 # @node: name of device/node which the @target bitmap is tracking
2203 # @target: name of the destination dirty bitmap
2205 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully
2206 # specified BlockDirtyBitmap elements. The latter are supported
2211 { 'struct': 'BlockDirtyBitmapMerge',
2212 'data': { 'node': 'str', 'target': 'str',
2213 'bitmaps': ['BlockDirtyBitmapOrStr'] } }
2216 # @block-dirty-bitmap-add:
2218 # Create a dirty bitmap with a name on the node, and start tracking the writes.
2220 # Returns: - nothing on success
2221 # - If @node is not a valid block device or node, DeviceNotFound
2222 # - If @name is already taken, GenericError with an explanation
2228 # -> { "execute": "block-dirty-bitmap-add",
2229 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2230 # <- { "return": {} }
2233 { 'command': 'block-dirty-bitmap-add',
2234 'data': 'BlockDirtyBitmapAdd',
2235 'allow-preconfig': true }
2238 # @block-dirty-bitmap-remove:
2240 # Stop write tracking and remove the dirty bitmap that was created
2241 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2244 # Returns: - nothing on success
2245 # - If @node is not a valid block device or node, DeviceNotFound
2246 # - If @name is not found, GenericError with an explanation
2247 # - if @name is frozen by an operation, GenericError
2253 # -> { "execute": "block-dirty-bitmap-remove",
2254 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2255 # <- { "return": {} }
2258 { 'command': 'block-dirty-bitmap-remove',
2259 'data': 'BlockDirtyBitmap',
2260 'allow-preconfig': true }
2263 # @block-dirty-bitmap-clear:
2265 # Clear (reset) a dirty bitmap on the device, so that an incremental
2266 # backup from this point in time forward will only backup clusters
2267 # modified after this clear operation.
2269 # Returns: - nothing on success
2270 # - If @node is not a valid block device, DeviceNotFound
2271 # - If @name is not found, GenericError with an explanation
2277 # -> { "execute": "block-dirty-bitmap-clear",
2278 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2279 # <- { "return": {} }
2282 { 'command': 'block-dirty-bitmap-clear',
2283 'data': 'BlockDirtyBitmap',
2284 'allow-preconfig': true }
2287 # @block-dirty-bitmap-enable:
2289 # Enables a dirty bitmap so that it will begin tracking disk changes.
2291 # Returns: - nothing on success
2292 # - If @node is not a valid block device, DeviceNotFound
2293 # - If @name is not found, GenericError with an explanation
2299 # -> { "execute": "block-dirty-bitmap-enable",
2300 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2301 # <- { "return": {} }
2304 { 'command': 'block-dirty-bitmap-enable',
2305 'data': 'BlockDirtyBitmap',
2306 'allow-preconfig': true }
2309 # @block-dirty-bitmap-disable:
2311 # Disables a dirty bitmap so that it will stop tracking disk changes.
2313 # Returns: - nothing on success
2314 # - If @node is not a valid block device, DeviceNotFound
2315 # - If @name is not found, GenericError with an explanation
2321 # -> { "execute": "block-dirty-bitmap-disable",
2322 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2323 # <- { "return": {} }
2326 { 'command': 'block-dirty-bitmap-disable',
2327 'data': 'BlockDirtyBitmap',
2328 'allow-preconfig': true }
2331 # @block-dirty-bitmap-merge:
2333 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2334 # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2335 # as the @target bitmap. Any bits already set in @target will still be
2336 # set after the merge, i.e., this operation does not clear the target.
2337 # On error, @target is unchanged.
2339 # The resulting bitmap will count as dirty any clusters that were dirty in any
2340 # of the source bitmaps. This can be used to achieve backup checkpoints, or in
2341 # simpler usages, to copy bitmaps.
2343 # Returns: - nothing on success
2344 # - If @node is not a valid block device, DeviceNotFound
2345 # - If any bitmap in @bitmaps or @target is not found, GenericError
2346 # - If any of the bitmaps have different sizes or granularities,
2353 # -> { "execute": "block-dirty-bitmap-merge",
2354 # "arguments": { "node": "drive0", "target": "bitmap0",
2355 # "bitmaps": ["bitmap1"] } }
2356 # <- { "return": {} }
2359 { 'command': 'block-dirty-bitmap-merge',
2360 'data': 'BlockDirtyBitmapMerge',
2361 'allow-preconfig': true }
2364 # @BlockDirtyBitmapSha256:
2366 # SHA256 hash of dirty bitmap data
2368 # @sha256: ASCII representation of SHA256 bitmap hash
2372 { 'struct': 'BlockDirtyBitmapSha256',
2373 'data': {'sha256': 'str'} }
2376 # @x-debug-block-dirty-bitmap-sha256:
2378 # Get bitmap SHA256.
2381 # @unstable: This command is meant for debugging.
2383 # Returns: - BlockDirtyBitmapSha256 on success
2384 # - If @node is not a valid block device, DeviceNotFound
2385 # - If @name is not found or if hashing has failed, GenericError with an
2390 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2391 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256',
2392 'features': [ 'unstable' ],
2393 'allow-preconfig': true }
2398 # Start mirroring a block device's writes to a new destination.
2400 # @job-id: identifier for the newly-created block job. If
2401 # omitted, the device name will be used. (Since 2.7)
2403 # @device: The device name or node-name of a root node whose writes should be
2406 # @target: the id or node-name of the block device to mirror to. This mustn't be
2407 # attached to guest.
2409 # @replaces: with sync=full graph node name to be replaced by the new
2410 # image when a whole image copy is done. This can be used to repair
2411 # broken Quorum files. By default, @device is replaced, although
2412 # implicitly created filters on it are kept.
2414 # @speed: the maximum speed, in bytes per second
2416 # @sync: what parts of the disk image should be copied to the destination
2417 # (all the disk, only the sectors allocated in the topmost image, or
2420 # @granularity: granularity of the dirty bitmap, default is 64K
2421 # if the image format doesn't have clusters, 4K if the clusters
2422 # are smaller than that, else the cluster size. Must be a
2423 # power of 2 between 512 and 64M
2425 # @buf-size: maximum amount of data in flight from source to
2428 # @on-source-error: the action to take on an error on the source,
2429 # default 'report'. 'stop' and 'enospc' can only be used
2430 # if the block device supports io-status (see BlockInfo).
2432 # @on-target-error: the action to take on an error on the target,
2433 # default 'report' (no limitations, since this applies to
2434 # a different block device than @device).
2436 # @filter-node-name: the node name that should be assigned to the
2437 # filter driver that the mirror job inserts into the graph
2438 # above @device. If this option is not given, a node name is
2439 # autogenerated. (Since: 2.9)
2441 # @copy-mode: when to copy data to the destination; defaults to 'background'
2444 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2445 # finished its work, waiting for @block-job-finalize before
2446 # making any block graph changes.
2447 # When true, this job will automatically
2448 # perform its abort or commit actions.
2449 # Defaults to true. (Since 3.1)
2451 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2452 # has completely ceased all work, and awaits @block-job-dismiss.
2453 # When true, this job will automatically disappear from the query
2454 # list without user intervention.
2455 # Defaults to true. (Since 3.1)
2457 # Returns: nothing on success.
2463 # -> { "execute": "blockdev-mirror",
2464 # "arguments": { "device": "ide-hd0",
2465 # "target": "target0",
2466 # "sync": "full" } }
2467 # <- { "return": {} }
2470 { 'command': 'blockdev-mirror',
2471 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2473 'sync': 'MirrorSyncMode',
2474 '*speed': 'int', '*granularity': 'uint32',
2475 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2476 '*on-target-error': 'BlockdevOnError',
2477 '*filter-node-name': 'str',
2478 '*copy-mode': 'MirrorCopyMode',
2479 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
2480 'allow-preconfig': true }
2485 # A set of parameters describing block throttling.
2487 # @device: Block device name
2489 # @id: The name or QOM path of the guest device (since: 2.8)
2491 # @bps: total throughput limit in bytes per second
2493 # @bps_rd: read throughput limit in bytes per second
2495 # @bps_wr: write throughput limit in bytes per second
2497 # @iops: total I/O operations per second
2499 # @iops_rd: read I/O operations per second
2501 # @iops_wr: write I/O operations per second
2503 # @bps_max: total throughput limit during bursts,
2504 # in bytes (Since 1.7)
2506 # @bps_rd_max: read throughput limit during bursts,
2507 # in bytes (Since 1.7)
2509 # @bps_wr_max: write throughput limit during bursts,
2510 # in bytes (Since 1.7)
2512 # @iops_max: total I/O operations per second during bursts,
2513 # in bytes (Since 1.7)
2515 # @iops_rd_max: read I/O operations per second during bursts,
2516 # in bytes (Since 1.7)
2518 # @iops_wr_max: write I/O operations per second during bursts,
2519 # in bytes (Since 1.7)
2521 # @bps_max_length: maximum length of the @bps_max burst
2522 # period, in seconds. It must only
2523 # be set if @bps_max is set as well.
2524 # Defaults to 1. (Since 2.6)
2526 # @bps_rd_max_length: maximum length of the @bps_rd_max
2527 # burst period, in seconds. It must only
2528 # be set if @bps_rd_max is set as well.
2529 # Defaults to 1. (Since 2.6)
2531 # @bps_wr_max_length: maximum length of the @bps_wr_max
2532 # burst period, in seconds. It must only
2533 # be set if @bps_wr_max is set as well.
2534 # Defaults to 1. (Since 2.6)
2536 # @iops_max_length: maximum length of the @iops burst
2537 # period, in seconds. It must only
2538 # be set if @iops_max is set as well.
2539 # Defaults to 1. (Since 2.6)
2541 # @iops_rd_max_length: maximum length of the @iops_rd_max
2542 # burst period, in seconds. It must only
2543 # be set if @iops_rd_max is set as well.
2544 # Defaults to 1. (Since 2.6)
2546 # @iops_wr_max_length: maximum length of the @iops_wr_max
2547 # burst period, in seconds. It must only
2548 # be set if @iops_wr_max is set as well.
2549 # Defaults to 1. (Since 2.6)
2551 # @iops_size: an I/O size in bytes (Since 1.7)
2553 # @group: throttle group name (Since 2.4)
2556 # @deprecated: Member @device is deprecated. Use @id instead.
2560 { 'struct': 'BlockIOThrottle',
2561 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
2562 '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2563 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2564 '*bps_max': 'int', '*bps_rd_max': 'int',
2565 '*bps_wr_max': 'int', '*iops_max': 'int',
2566 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2567 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2568 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2569 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2570 '*iops_size': 'int', '*group': 'str' } }
2575 # Limit parameters for throttling.
2576 # Since some limit combinations are illegal, limits should always be set in one
2577 # transaction. All fields are optional. When setting limits, if a field is
2578 # missing the current value is not changed.
2580 # @iops-total: limit total I/O operations per second
2581 # @iops-total-max: I/O operations burst
2582 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2583 # It must only be set if @iops-total-max is set as well.
2584 # @iops-read: limit read operations per second
2585 # @iops-read-max: I/O operations read burst
2586 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2587 # It must only be set if @iops-read-max is set as well.
2588 # @iops-write: limit write operations per second
2589 # @iops-write-max: I/O operations write burst
2590 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2591 # It must only be set if @iops-write-max is set as well.
2592 # @bps-total: limit total bytes per second
2593 # @bps-total-max: total bytes burst
2594 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2595 # It must only be set if @bps-total-max is set as well.
2596 # @bps-read: limit read bytes per second
2597 # @bps-read-max: total bytes read burst
2598 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2599 # It must only be set if @bps-read-max is set as well.
2600 # @bps-write: limit write bytes per second
2601 # @bps-write-max: total bytes write burst
2602 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2603 # It must only be set if @bps-write-max is set as well.
2604 # @iops-size: when limiting by iops max size of an I/O in bytes
2608 { 'struct': 'ThrottleLimits',
2609 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2610 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2611 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2612 '*iops-write' : 'int', '*iops-write-max' : 'int',
2613 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2614 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2615 '*bps-read' : 'int', '*bps-read-max' : 'int',
2616 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2617 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2618 '*iops-size' : 'int' } }
2621 # @ThrottleGroupProperties:
2623 # Properties for throttle-group objects.
2625 # @limits: limits to apply for this throttle group
2628 # @unstable: All members starting with x- are aliases for the same key
2629 # without x- in the @limits object. This is not a stable
2630 # interface and may be removed or changed incompatibly in
2631 # the future. Use @limits for a supported stable
2636 { 'struct': 'ThrottleGroupProperties',
2637 'data': { '*limits': 'ThrottleLimits',
2638 '*x-iops-total': { 'type': 'int',
2639 'features': [ 'unstable' ] },
2640 '*x-iops-total-max': { 'type': 'int',
2641 'features': [ 'unstable' ] },
2642 '*x-iops-total-max-length': { 'type': 'int',
2643 'features': [ 'unstable' ] },
2644 '*x-iops-read': { 'type': 'int',
2645 'features': [ 'unstable' ] },
2646 '*x-iops-read-max': { 'type': 'int',
2647 'features': [ 'unstable' ] },
2648 '*x-iops-read-max-length': { 'type': 'int',
2649 'features': [ 'unstable' ] },
2650 '*x-iops-write': { 'type': 'int',
2651 'features': [ 'unstable' ] },
2652 '*x-iops-write-max': { 'type': 'int',
2653 'features': [ 'unstable' ] },
2654 '*x-iops-write-max-length': { 'type': 'int',
2655 'features': [ 'unstable' ] },
2656 '*x-bps-total': { 'type': 'int',
2657 'features': [ 'unstable' ] },
2658 '*x-bps-total-max': { 'type': 'int',
2659 'features': [ 'unstable' ] },
2660 '*x-bps-total-max-length': { 'type': 'int',
2661 'features': [ 'unstable' ] },
2662 '*x-bps-read': { 'type': 'int',
2663 'features': [ 'unstable' ] },
2664 '*x-bps-read-max': { 'type': 'int',
2665 'features': [ 'unstable' ] },
2666 '*x-bps-read-max-length': { 'type': 'int',
2667 'features': [ 'unstable' ] },
2668 '*x-bps-write': { 'type': 'int',
2669 'features': [ 'unstable' ] },
2670 '*x-bps-write-max': { 'type': 'int',
2671 'features': [ 'unstable' ] },
2672 '*x-bps-write-max-length': { 'type': 'int',
2673 'features': [ 'unstable' ] },
2674 '*x-iops-size': { 'type': 'int',
2675 'features': [ 'unstable' ] } } }
2680 # Copy data from a backing file into a block device.
2682 # The block streaming operation is performed in the background until the entire
2683 # backing file has been copied. This command returns immediately once streaming
2684 # has started. The status of ongoing block streaming operations can be checked
2685 # with query-block-jobs. The operation can be stopped before it has completed
2686 # using the block-job-cancel command.
2688 # The node that receives the data is called the top image, can be located in
2689 # any part of the chain (but always above the base image; see below) and can be
2690 # specified using its device or node name. Earlier qemu versions only allowed
2691 # 'device' to name the top level node; presence of the 'base-node' parameter
2692 # during introspection can be used as a witness of the enhanced semantics
2695 # If a base file is specified then sectors are not copied from that base file and
2696 # its backing chain. This can be used to stream a subset of the backing file
2697 # chain instead of flattening the entire image.
2698 # When streaming completes the image file will have the base file as its backing
2699 # file, unless that node was changed while the job was running. In that case,
2700 # base's parent's backing (or filtered, whichever exists) child (i.e., base at
2701 # the beginning of the job) will be the new backing file.
2703 # On successful completion the image file is updated to drop the backing file
2704 # and the BLOCK_JOB_COMPLETED event is emitted.
2706 # In case @device is a filter node, block-stream modifies the first non-filter
2707 # overlay node below it to point to the new backing node instead of modifying
2710 # @job-id: identifier for the newly-created block job. If
2711 # omitted, the device name will be used. (Since 2.7)
2713 # @device: the device or node name of the top image
2715 # @base: the common backing file name.
2716 # It cannot be set if @base-node or @bottom is also set.
2718 # @base-node: the node name of the backing file.
2719 # It cannot be set if @base or @bottom is also set. (Since 2.8)
2721 # @bottom: the last node in the chain that should be streamed into
2722 # top. It cannot be set if @base or @base-node is also set.
2723 # It cannot be filter node. (Since 6.0)
2725 # @backing-file: The backing file string to write into the top
2726 # image. This filename is not validated.
2728 # If a pathname string is such that it cannot be
2729 # resolved by QEMU, that means that subsequent QMP or
2730 # HMP commands must use node-names for the image in
2731 # question, as filename lookup methods will fail.
2733 # If not specified, QEMU will automatically determine
2734 # the backing file string to use, or error out if there
2735 # is no obvious choice. Care should be taken when
2736 # specifying the string, to specify a valid filename or
2740 # @speed: the maximum speed, in bytes per second
2742 # @on-error: the action to take on an error (default report).
2743 # 'stop' and 'enospc' can only be used if the block device
2744 # supports io-status (see BlockInfo). Since 1.3.
2746 # @filter-node-name: the node name that should be assigned to the
2747 # filter driver that the stream job inserts into the graph
2748 # above @device. If this option is not given, a node name is
2749 # autogenerated. (Since: 6.0)
2751 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2752 # finished its work, waiting for @block-job-finalize before
2753 # making any block graph changes.
2754 # When true, this job will automatically
2755 # perform its abort or commit actions.
2756 # Defaults to true. (Since 3.1)
2758 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2759 # has completely ceased all work, and awaits @block-job-dismiss.
2760 # When true, this job will automatically disappear from the query
2761 # list without user intervention.
2762 # Defaults to true. (Since 3.1)
2764 # Returns: - Nothing on success.
2765 # - If @device does not exist, DeviceNotFound.
2771 # -> { "execute": "block-stream",
2772 # "arguments": { "device": "virtio0",
2773 # "base": "/tmp/master.qcow2" } }
2774 # <- { "return": {} }
2777 { 'command': 'block-stream',
2778 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2779 '*base-node': 'str', '*backing-file': 'str', '*bottom': 'str',
2780 '*speed': 'int', '*on-error': 'BlockdevOnError',
2781 '*filter-node-name': 'str',
2782 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
2783 'allow-preconfig': true }
2786 # @block-job-set-speed:
2788 # Set maximum speed for a background block operation.
2790 # This command can only be issued when there is an active block job.
2792 # Throttling can be disabled by setting the speed to 0.
2794 # @device: The job identifier. This used to be a device name (hence
2795 # the name of the parameter), but since QEMU 2.7 it can have
2798 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2801 # Returns: - Nothing on success
2802 # - If no background operation is active on this device, DeviceNotActive
2806 { 'command': 'block-job-set-speed',
2807 'data': { 'device': 'str', 'speed': 'int' },
2808 'allow-preconfig': true }
2811 # @block-job-cancel:
2813 # Stop an active background block operation.
2815 # This command returns immediately after marking the active background block
2816 # operation for cancellation. It is an error to call this command if no
2817 # operation is in progress.
2819 # The operation will cancel as soon as possible and then emit the
2820 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2821 # enumerated using query-block-jobs.
2823 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2824 # (via the event BLOCK_JOB_READY) that the source and destination are
2825 # synchronized, then the event triggered by this command changes to
2826 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2827 # destination now has a point-in-time copy tied to the time of the cancellation.
2829 # For streaming, the image file retains its backing file unless the streaming
2830 # operation happens to complete just as it is being cancelled. A new streaming
2831 # operation can be started at a later time to finish copying all data from the
2834 # @device: The job identifier. This used to be a device name (hence
2835 # the name of the parameter), but since QEMU 2.7 it can have
2838 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2839 # abandon the job immediately (even if it is paused) instead of waiting
2840 # for the destination to complete its final synchronization (since 1.3)
2842 # Returns: - Nothing on success
2843 # - If no background operation is active on this device, DeviceNotActive
2847 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' },
2848 'allow-preconfig': true }
2853 # Pause an active background block operation.
2855 # This command returns immediately after marking the active background block
2856 # operation for pausing. It is an error to call this command if no
2857 # operation is in progress or if the job is already paused.
2859 # The operation will pause as soon as possible. No event is emitted when
2860 # the operation is actually paused. Cancelling a paused job automatically
2863 # @device: The job identifier. This used to be a device name (hence
2864 # the name of the parameter), but since QEMU 2.7 it can have
2867 # Returns: - Nothing on success
2868 # - If no background operation is active on this device, DeviceNotActive
2872 { 'command': 'block-job-pause', 'data': { 'device': 'str' },
2873 'allow-preconfig': true }
2876 # @block-job-resume:
2878 # Resume an active background block operation.
2880 # This command returns immediately after resuming a paused background block
2881 # operation. It is an error to call this command if no operation is in
2882 # progress or if the job is not paused.
2884 # This command also clears the error status of the job.
2886 # @device: The job identifier. This used to be a device name (hence
2887 # the name of the parameter), but since QEMU 2.7 it can have
2890 # Returns: - Nothing on success
2891 # - If no background operation is active on this device, DeviceNotActive
2895 { 'command': 'block-job-resume', 'data': { 'device': 'str' },
2896 'allow-preconfig': true }
2899 # @block-job-complete:
2901 # Manually trigger completion of an active background block operation. This
2902 # is supported for drive mirroring, where it also switches the device to
2903 # write to the target path only. The ability to complete is signaled with
2904 # a BLOCK_JOB_READY event.
2906 # This command completes an active background block operation synchronously.
2907 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2908 # is not defined. Note that if an I/O error occurs during the processing of
2909 # this command: 1) the command itself will fail; 2) the error will be processed
2910 # according to the rerror/werror arguments that were specified when starting
2913 # A cancelled or paused job cannot be completed.
2915 # @device: The job identifier. This used to be a device name (hence
2916 # the name of the parameter), but since QEMU 2.7 it can have
2919 # Returns: - Nothing on success
2920 # - If no background operation is active on this device, DeviceNotActive
2924 { 'command': 'block-job-complete', 'data': { 'device': 'str' },
2925 'allow-preconfig': true }
2928 # @block-job-dismiss:
2930 # For jobs that have already concluded, remove them from the block-job-query
2931 # list. This command only needs to be run for jobs which were started with
2932 # QEMU 2.12+ job lifetime management semantics.
2934 # This command will refuse to operate on any job that has not yet reached
2935 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2936 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2937 # to be used as appropriate.
2939 # @id: The job identifier.
2941 # Returns: Nothing on success
2945 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' },
2946 'allow-preconfig': true }
2949 # @block-job-finalize:
2951 # Once a job that has manual=true reaches the pending state, it can be
2952 # instructed to finalize any graph changes and do any necessary cleanup
2954 # For jobs in a transaction, instructing one job to finalize will force
2955 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2956 # a single member job to finalize.
2958 # @id: The job identifier.
2960 # Returns: Nothing on success
2964 { 'command': 'block-job-finalize', 'data': { 'id': 'str' },
2965 'allow-preconfig': true }
2968 # @BlockdevDiscardOptions:
2970 # Determines how to handle discard requests.
2972 # @ignore: Ignore the request
2973 # @unmap: Forward as an unmap request
2977 { 'enum': 'BlockdevDiscardOptions',
2978 'data': [ 'ignore', 'unmap' ] }
2981 # @BlockdevDetectZeroesOptions:
2983 # Describes the operation mode for the automatic conversion of plain
2984 # zero writes by the OS to driver specific optimized zero write commands.
2986 # @off: Disabled (default)
2988 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2989 # also that @BlockdevDiscardOptions is set to unmap for this device.
2993 { 'enum': 'BlockdevDetectZeroesOptions',
2994 'data': [ 'off', 'on', 'unmap' ] }
2997 # @BlockdevAioOptions:
2999 # Selects the AIO backend to handle I/O requests
3001 # @threads: Use qemu's thread pool
3002 # @native: Use native AIO backend (only Linux and Windows)
3003 # @io_uring: Use linux io_uring (since 5.0)
3007 { 'enum': 'BlockdevAioOptions',
3008 'data': [ 'threads', 'native',
3009 { 'name': 'io_uring', 'if': 'CONFIG_LINUX_IO_URING' } ] }
3012 # @BlockdevCacheOptions:
3014 # Includes cache-related options for block devices
3016 # @direct: enables use of O_DIRECT (bypass the host page cache;
3018 # @no-flush: ignore any flush requests for the device (default:
3023 { 'struct': 'BlockdevCacheOptions',
3024 'data': { '*direct': 'bool',
3025 '*no-flush': 'bool' } }
3030 # Drivers that are supported in block device operations.
3032 # @throttle: Since 2.11
3034 # @copy-on-read: Since 3.0
3035 # @blklogwrites: Since 3.0
3036 # @blkreplay: Since 4.2
3037 # @compress: Since 5.0
3038 # @copy-before-write: Since 6.2
3039 # @snapshot-access: Since 7.0
3043 { 'enum': 'BlockdevDriver',
3044 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
3045 'cloop', 'compress', 'copy-before-write', 'copy-on-read', 'dmg',
3046 'file', 'snapshot-access', 'ftp', 'ftps', 'gluster',
3047 {'name': 'host_cdrom', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
3048 {'name': 'host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
3050 { 'name': 'io_uring', 'if': 'CONFIG_BLKIO' },
3052 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme',
3053 { 'name': 'nvme-io_uring', 'if': 'CONFIG_BLKIO' },
3054 'parallels', 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum',
3056 { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
3057 'ssh', 'throttle', 'vdi', 'vhdx',
3058 { 'name': 'virtio-blk-vfio-pci', 'if': 'CONFIG_BLKIO' },
3059 { 'name': 'virtio-blk-vhost-user', 'if': 'CONFIG_BLKIO' },
3060 { 'name': 'virtio-blk-vhost-vdpa', 'if': 'CONFIG_BLKIO' },
3061 'vmdk', 'vpc', 'vvfat' ] }
3064 # @BlockdevOptionsFile:
3066 # Driver specific block device options for the file backend.
3068 # @filename: path to the image file
3069 # @pr-manager: the id for the object that will handle persistent reservations
3070 # for this device (default: none, forward the commands via SG_IO;
3072 # @aio: AIO backend (default: threads) (since: 2.8)
3073 # @aio-max-batch: maximum number of requests to batch together into a single
3074 # submission in the AIO backend. The smallest value between
3075 # this and the aio-max-batch value of the IOThread object is
3077 # 0 means that the AIO backend will handle it automatically.
3078 # (default: 0, since 6.2)
3079 # @locking: whether to enable file locking. If set to 'auto', only enable
3080 # when Open File Descriptor (OFD) locking API is available
3081 # (default: auto, since 2.10)
3082 # @drop-cache: invalidate page cache during live migration. This prevents
3083 # stale data on the migration destination with cache.direct=off.
3084 # Currently only supported on Linux hosts.
3085 # (default: on, since: 4.0)
3086 # @x-check-cache-dropped: whether to check that page cache was dropped on live
3087 # migration. May cause noticeable delays if the image
3088 # file is large, do not use in production.
3089 # (default: off) (since: 3.0)
3092 # @dynamic-auto-read-only: If present, enabled auto-read-only means that the
3093 # driver will open the image read-only at first,
3094 # dynamically reopen the image file read-write when
3095 # the first writer is attached to the node and reopen
3096 # read-only when the last writer is detached. This
3097 # allows giving QEMU write permissions only on demand
3098 # when an operation actually needs write access.
3099 # @unstable: Member x-check-cache-dropped is meant for debugging.
3103 { 'struct': 'BlockdevOptionsFile',
3104 'data': { 'filename': 'str',
3105 '*pr-manager': 'str',
3106 '*locking': 'OnOffAuto',
3107 '*aio': 'BlockdevAioOptions',
3108 '*aio-max-batch': 'int',
3109 '*drop-cache': {'type': 'bool',
3110 'if': 'CONFIG_LINUX'},
3111 '*x-check-cache-dropped': { 'type': 'bool',
3112 'features': [ 'unstable' ] } },
3113 'features': [ { 'name': 'dynamic-auto-read-only',
3114 'if': 'CONFIG_POSIX' } ] }
3117 # @BlockdevOptionsNull:
3119 # Driver specific block device options for the null backend.
3121 # @size: size of the device in bytes.
3122 # @latency-ns: emulated latency (in nanoseconds) in processing
3123 # requests. Default to zero which completes requests immediately.
3125 # @read-zeroes: if true, reads from the device produce zeroes; if false, the
3126 # buffer is left unchanged. (default: false; since: 4.1)
3130 { 'struct': 'BlockdevOptionsNull',
3131 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
3134 # @BlockdevOptionsNVMe:
3136 # Driver specific block device options for the NVMe backend.
3138 # @device: PCI controller address of the NVMe device in
3139 # format hhhh:bb:ss.f (host:bus:slot.function)
3140 # @namespace: namespace number of the device, starting from 1.
3142 # Note that the PCI @device must have been unbound from any host
3143 # kernel driver before instructing QEMU to add the blockdev.
3147 { 'struct': 'BlockdevOptionsNVMe',
3148 'data': { 'device': 'str', 'namespace': 'int' } }
3151 # @BlockdevOptionsVVFAT:
3153 # Driver specific block device options for the vvfat protocol.
3155 # @dir: directory to be exported as FAT image
3156 # @fat-type: FAT type: 12, 16 or 32
3157 # @floppy: whether to export a floppy image (true) or
3158 # partitioned hard disk (false; default)
3159 # @label: set the volume label, limited to 11 bytes. FAT16 and
3160 # FAT32 traditionally have some restrictions on labels, which are
3161 # ignored by most operating systems. Defaults to "QEMU VVFAT".
3163 # @rw: whether to allow write operations (default: false)
3167 { 'struct': 'BlockdevOptionsVVFAT',
3168 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
3169 '*label': 'str', '*rw': 'bool' } }
3172 # @BlockdevOptionsGenericFormat:
3174 # Driver specific block device options for image format that have no option
3175 # besides their data source.
3177 # @file: reference to or definition of the data source block device
3181 { 'struct': 'BlockdevOptionsGenericFormat',
3182 'data': { 'file': 'BlockdevRef' } }
3185 # @BlockdevOptionsLUKS:
3187 # Driver specific block device options for LUKS.
3189 # @key-secret: the ID of a QCryptoSecret object providing
3190 # the decryption key (since 2.6). Mandatory except when
3191 # doing a metadata-only probe of the image.
3195 { 'struct': 'BlockdevOptionsLUKS',
3196 'base': 'BlockdevOptionsGenericFormat',
3197 'data': { '*key-secret': 'str' } }
3200 # @BlockdevOptionsGenericCOWFormat:
3202 # Driver specific block device options for image format that have no option
3203 # besides their data source and an optional backing file.
3205 # @backing: reference to or definition of the backing file block
3206 # device, null disables the backing file entirely.
3207 # Defaults to the backing file stored the image file.
3211 { 'struct': 'BlockdevOptionsGenericCOWFormat',
3212 'base': 'BlockdevOptionsGenericFormat',
3213 'data': { '*backing': 'BlockdevRefOrNull' } }
3216 # @Qcow2OverlapCheckMode:
3218 # General overlap check modes.
3220 # @none: Do not perform any checks
3222 # @constant: Perform only checks which can be done in constant time and
3223 # without reading anything from disk
3225 # @cached: Perform only checks which can be done without reading anything
3228 # @all: Perform all available overlap checks
3232 { 'enum': 'Qcow2OverlapCheckMode',
3233 'data': [ 'none', 'constant', 'cached', 'all' ] }
3236 # @Qcow2OverlapCheckFlags:
3238 # Structure of flags for each metadata structure. Setting a field to 'true'
3239 # makes qemu guard that structure against unintended overwriting. The default
3240 # value is chosen according to the template given.
3242 # @template: Specifies a template mode which can be adjusted using the other
3243 # flags, defaults to 'cached'
3245 # @bitmap-directory: since 3.0
3249 { 'struct': 'Qcow2OverlapCheckFlags',
3250 'data': { '*template': 'Qcow2OverlapCheckMode',
3251 '*main-header': 'bool',
3252 '*active-l1': 'bool',
3253 '*active-l2': 'bool',
3254 '*refcount-table': 'bool',
3255 '*refcount-block': 'bool',
3256 '*snapshot-table': 'bool',
3257 '*inactive-l1': 'bool',
3258 '*inactive-l2': 'bool',
3259 '*bitmap-directory': 'bool' } }
3262 # @Qcow2OverlapChecks:
3264 # Specifies which metadata structures should be guarded against unintended
3267 # @flags: set of flags for separate specification of each metadata structure
3270 # @mode: named mode which chooses a specific set of flags
3274 { 'alternate': 'Qcow2OverlapChecks',
3275 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3276 'mode': 'Qcow2OverlapCheckMode' } }
3279 # @BlockdevQcowEncryptionFormat:
3281 # @aes: AES-CBC with plain64 initialization vectors
3285 { 'enum': 'BlockdevQcowEncryptionFormat',
3289 # @BlockdevQcowEncryption:
3293 { 'union': 'BlockdevQcowEncryption',
3294 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3295 'discriminator': 'format',
3296 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3299 # @BlockdevOptionsQcow:
3301 # Driver specific block device options for qcow.
3303 # @encrypt: Image decryption options. Mandatory for
3304 # encrypted images, except when doing a metadata-only
3305 # probe of the image.
3309 { 'struct': 'BlockdevOptionsQcow',
3310 'base': 'BlockdevOptionsGenericCOWFormat',
3311 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3314 # @BlockdevQcow2EncryptionFormat:
3316 # @aes: AES-CBC with plain64 initialization vectors
3320 { 'enum': 'BlockdevQcow2EncryptionFormat',
3321 'data': [ 'aes', 'luks' ] }
3324 # @BlockdevQcow2Encryption:
3328 { 'union': 'BlockdevQcow2Encryption',
3329 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3330 'discriminator': 'format',
3331 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3332 'luks': 'QCryptoBlockOptionsLUKS'} }
3335 # @BlockdevOptionsPreallocate:
3337 # Filter driver intended to be inserted between format and protocol node
3338 # and do preallocation in protocol node on write.
3340 # @prealloc-align: on preallocation, align file length to this number,
3341 # default 1048576 (1M)
3343 # @prealloc-size: how much to preallocate, default 134217728 (128M)
3347 { 'struct': 'BlockdevOptionsPreallocate',
3348 'base': 'BlockdevOptionsGenericFormat',
3349 'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } }
3352 # @BlockdevOptionsQcow2:
3354 # Driver specific block device options for qcow2.
3356 # @lazy-refcounts: whether to enable the lazy refcounts
3357 # feature (default is taken from the image file)
3359 # @pass-discard-request: whether discard requests to the qcow2
3360 # device should be forwarded to the data source
3362 # @pass-discard-snapshot: whether discard requests for the data source
3363 # should be issued when a snapshot operation (e.g.
3364 # deleting a snapshot) frees clusters in the qcow2 file
3366 # @pass-discard-other: whether discard requests for the data source
3367 # should be issued on other occasions where a cluster
3370 # @overlap-check: which overlap checks to perform for writes
3371 # to the image, defaults to 'cached' (since 2.2)
3373 # @cache-size: the maximum total size of the L2 table and
3374 # refcount block caches in bytes (since 2.2)
3376 # @l2-cache-size: the maximum size of the L2 table cache in
3379 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3380 # bytes. It must be a power of two between 512
3381 # and the cluster size. The default value is
3382 # the cluster size (since 2.12)
3384 # @refcount-cache-size: the maximum size of the refcount block cache
3385 # in bytes (since 2.2)
3387 # @cache-clean-interval: clean unused entries in the L2 and refcount
3388 # caches. The interval is in seconds. The default value
3389 # is 600 on supporting platforms, and 0 on other
3390 # platforms. 0 disables this feature. (since 2.5)
3392 # @encrypt: Image decryption options. Mandatory for
3393 # encrypted images, except when doing a metadata-only
3394 # probe of the image. (since 2.10)
3396 # @data-file: reference to or definition of the external data file.
3397 # This may only be specified for images that require an
3398 # external data file. If it is not specified for such
3399 # an image, the data file name is loaded from the image
3404 { 'struct': 'BlockdevOptionsQcow2',
3405 'base': 'BlockdevOptionsGenericCOWFormat',
3406 'data': { '*lazy-refcounts': 'bool',
3407 '*pass-discard-request': 'bool',
3408 '*pass-discard-snapshot': 'bool',
3409 '*pass-discard-other': 'bool',
3410 '*overlap-check': 'Qcow2OverlapChecks',
3411 '*cache-size': 'int',
3412 '*l2-cache-size': 'int',
3413 '*l2-cache-entry-size': 'int',
3414 '*refcount-cache-size': 'int',
3415 '*cache-clean-interval': 'int',
3416 '*encrypt': 'BlockdevQcow2Encryption',
3417 '*data-file': 'BlockdevRef' } }
3420 # @SshHostKeyCheckMode:
3422 # @none: Don't check the host key at all
3423 # @hash: Compare the host key with a given hash
3424 # @known_hosts: Check the host key against the known_hosts file
3428 { 'enum': 'SshHostKeyCheckMode',
3429 'data': [ 'none', 'hash', 'known_hosts' ] }
3432 # @SshHostKeyCheckHashType:
3434 # @md5: The given hash is an md5 hash
3435 # @sha1: The given hash is an sha1 hash
3436 # @sha256: The given hash is an sha256 hash
3440 { 'enum': 'SshHostKeyCheckHashType',
3441 'data': [ 'md5', 'sha1', 'sha256' ] }
3446 # @type: The hash algorithm used for the hash
3447 # @hash: The expected hash value
3451 { 'struct': 'SshHostKeyHash',
3452 'data': { 'type': 'SshHostKeyCheckHashType',
3460 { 'union': 'SshHostKeyCheck',
3461 'base': { 'mode': 'SshHostKeyCheckMode' },
3462 'discriminator': 'mode',
3463 'data': { 'hash': 'SshHostKeyHash' } }
3466 # @BlockdevOptionsSsh:
3468 # @server: host address
3470 # @path: path to the image on the host
3472 # @user: user as which to connect, defaults to current local user name
3474 # @host-key-check: Defines how and what to check the host key against
3475 # (default: known_hosts)
3479 { 'struct': 'BlockdevOptionsSsh',
3480 'data': { 'server': 'InetSocketAddress',
3483 '*host-key-check': 'SshHostKeyCheck' } }
3488 # Trigger events supported by blkdebug.
3490 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3493 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3495 # @cor_write: a write due to copy-on-read (since 2.11)
3497 # @cluster_alloc_space: an allocation of file space for a cluster (since 4.1)
3499 # @none: triggers once at creation of the blkdebug node (since 4.1)
3503 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3504 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3505 'l1_grow_activate_table', 'l2_load', 'l2_update',
3506 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3507 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3508 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3509 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3510 'refblock_load', 'refblock_update', 'refblock_update_part',
3511 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3512 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3513 'refblock_alloc_switch_table', 'cluster_alloc',
3514 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3515 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3516 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3517 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3518 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3519 'cor_write', 'cluster_alloc_space', 'none'] }
3524 # Kinds of I/O that blkdebug can inject errors in.
3526 # @read: .bdrv_co_preadv()
3528 # @write: .bdrv_co_pwritev()
3530 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3532 # @discard: .bdrv_co_pdiscard()
3534 # @flush: .bdrv_co_flush_to_disk()
3536 # @block-status: .bdrv_co_block_status()
3540 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3541 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3545 # @BlkdebugInjectErrorOptions:
3547 # Describes a single error injection for blkdebug.
3549 # @event: trigger event
3551 # @state: the state identifier blkdebug needs to be in to
3552 # actually trigger the event; defaults to "any"
3554 # @iotype: the type of I/O operations on which this error should
3555 # be injected; defaults to "all read, write,
3556 # write-zeroes, discard, and flush operations"
3559 # @errno: error identifier (errno) to be returned; defaults to
3562 # @sector: specifies the sector index which has to be affected
3563 # in order to actually trigger the event; defaults to "any
3566 # @once: disables further events after this one has been
3567 # triggered; defaults to false
3569 # @immediately: fail immediately; defaults to false
3573 { 'struct': 'BlkdebugInjectErrorOptions',
3574 'data': { 'event': 'BlkdebugEvent',
3576 '*iotype': 'BlkdebugIOType',
3580 '*immediately': 'bool' } }
3583 # @BlkdebugSetStateOptions:
3585 # Describes a single state-change event for blkdebug.
3587 # @event: trigger event
3589 # @state: the current state identifier blkdebug needs to be in;
3592 # @new_state: the state identifier blkdebug is supposed to assume if
3593 # this event is triggered
3597 { 'struct': 'BlkdebugSetStateOptions',
3598 'data': { 'event': 'BlkdebugEvent',
3600 'new_state': 'int' } }
3603 # @BlockdevOptionsBlkdebug:
3605 # Driver specific block device options for blkdebug.
3607 # @image: underlying raw block device (or image file)
3609 # @config: filename of the configuration file
3611 # @align: required alignment for requests in bytes, must be
3612 # positive power of 2, or 0 for default
3614 # @max-transfer: maximum size for I/O transfers in bytes, must be
3615 # positive multiple of @align and of the underlying
3616 # file's request alignment (but need not be a power of
3617 # 2), or 0 for default (since 2.10)
3619 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3620 # must be positive multiple of @align and of the
3621 # underlying file's request alignment (but need not be a
3622 # power of 2), or 0 for default (since 2.10)
3624 # @max-write-zero: maximum size for write zero requests in bytes, must be
3625 # positive multiple of @align, of @opt-write-zero, and of
3626 # the underlying file's request alignment (but need not
3627 # be a power of 2), or 0 for default (since 2.10)
3629 # @opt-discard: preferred alignment for discard requests in bytes, must
3630 # be positive multiple of @align and of the underlying
3631 # file's request alignment (but need not be a power of
3632 # 2), or 0 for default (since 2.10)
3634 # @max-discard: maximum size for discard requests in bytes, must be
3635 # positive multiple of @align, of @opt-discard, and of
3636 # the underlying file's request alignment (but need not
3637 # be a power of 2), or 0 for default (since 2.10)
3639 # @inject-error: array of error injection descriptions
3641 # @set-state: array of state-change descriptions
3643 # @take-child-perms: Permissions to take on @image in addition to what
3644 # is necessary anyway (which depends on how the
3645 # blkdebug node is used). Defaults to none.
3648 # @unshare-child-perms: Permissions not to share on @image in addition
3649 # to what cannot be shared anyway (which depends
3650 # on how the blkdebug node is used). Defaults
3651 # to none. (since 5.0)
3655 { 'struct': 'BlockdevOptionsBlkdebug',
3656 'data': { 'image': 'BlockdevRef',
3658 '*align': 'int', '*max-transfer': 'int32',
3659 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3660 '*opt-discard': 'int32', '*max-discard': 'int32',
3661 '*inject-error': ['BlkdebugInjectErrorOptions'],
3662 '*set-state': ['BlkdebugSetStateOptions'],
3663 '*take-child-perms': ['BlockPermission'],
3664 '*unshare-child-perms': ['BlockPermission'] } }
3667 # @BlockdevOptionsBlklogwrites:
3669 # Driver specific block device options for blklogwrites.
3671 # @file: block device
3673 # @log: block device used to log writes to @file
3675 # @log-sector-size: sector size used in logging writes to @file, determines
3676 # granularity of offsets and sizes of writes (default: 512)
3678 # @log-append: append to an existing log (default: false)
3680 # @log-super-update-interval: interval of write requests after which the log
3681 # super block is updated to disk (default: 4096)
3685 { 'struct': 'BlockdevOptionsBlklogwrites',
3686 'data': { 'file': 'BlockdevRef',
3687 'log': 'BlockdevRef',
3688 '*log-sector-size': 'uint32',
3689 '*log-append': 'bool',
3690 '*log-super-update-interval': 'uint64' } }
3693 # @BlockdevOptionsBlkverify:
3695 # Driver specific block device options for blkverify.
3697 # @test: block device to be tested
3699 # @raw: raw image used for verification
3703 { 'struct': 'BlockdevOptionsBlkverify',
3704 'data': { 'test': 'BlockdevRef',
3705 'raw': 'BlockdevRef' } }
3708 # @BlockdevOptionsBlkreplay:
3710 # Driver specific block device options for blkreplay.
3712 # @image: disk image which should be controlled with blkreplay
3716 { 'struct': 'BlockdevOptionsBlkreplay',
3717 'data': { 'image': 'BlockdevRef' } }
3720 # @QuorumReadPattern:
3722 # An enumeration of quorum read patterns.
3724 # @quorum: read all the children and do a quorum vote on reads
3726 # @fifo: read only from the first child that has not failed
3730 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3733 # @BlockdevOptionsQuorum:
3735 # Driver specific block device options for Quorum
3737 # @blkverify: true if the driver must print content mismatch
3738 # set to false by default
3740 # @children: the children block devices to use
3742 # @vote-threshold: the vote limit under which a read will fail
3744 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3747 # @read-pattern: choose read pattern and set to quorum by default
3752 { 'struct': 'BlockdevOptionsQuorum',
3753 'data': { '*blkverify': 'bool',
3754 'children': [ 'BlockdevRef' ],
3755 'vote-threshold': 'int',
3756 '*rewrite-corrupted': 'bool',
3757 '*read-pattern': 'QuorumReadPattern' } }
3760 # @BlockdevOptionsGluster:
3762 # Driver specific block device options for Gluster
3764 # @volume: name of gluster volume where VM image resides
3766 # @path: absolute path to image file in gluster volume
3768 # @server: gluster servers description
3770 # @debug: libgfapi log level (default '4' which is Error)
3773 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3777 { 'struct': 'BlockdevOptionsGluster',
3778 'data': { 'volume': 'str',
3780 'server': ['SocketAddress'],
3782 '*logfile': 'str' } }
3785 # @BlockdevOptionsIoUring:
3787 # Driver specific block device options for the io_uring backend.
3789 # @filename: path to the image file
3793 { 'struct': 'BlockdevOptionsIoUring',
3794 'data': { 'filename': 'str' },
3795 'if': 'CONFIG_BLKIO' }
3798 # @BlockdevOptionsNvmeIoUring:
3800 # Driver specific block device options for the nvme-io_uring backend.
3802 # @path: path to the NVMe namespace's character device (e.g. /dev/ng0n1).
3806 { 'struct': 'BlockdevOptionsNvmeIoUring',
3807 'data': { 'path': 'str' },
3808 'if': 'CONFIG_BLKIO' }
3811 # @BlockdevOptionsVirtioBlkVfioPci:
3813 # Driver specific block device options for the virtio-blk-vfio-pci backend.
3815 # @path: path to the PCI device's sysfs directory (e.g.
3816 # /sys/bus/pci/devices/0000:00:01.0).
3820 { 'struct': 'BlockdevOptionsVirtioBlkVfioPci',
3821 'data': { 'path': 'str' },
3822 'if': 'CONFIG_BLKIO' }
3825 # @BlockdevOptionsVirtioBlkVhostUser:
3827 # Driver specific block device options for the virtio-blk-vhost-user backend.
3829 # @path: path to the vhost-user UNIX domain socket.
3833 { 'struct': 'BlockdevOptionsVirtioBlkVhostUser',
3834 'data': { 'path': 'str' },
3835 'if': 'CONFIG_BLKIO' }
3838 # @BlockdevOptionsVirtioBlkVhostVdpa:
3840 # Driver specific block device options for the virtio-blk-vhost-vdpa backend.
3842 # @path: path to the vhost-vdpa character device.
3846 { 'struct': 'BlockdevOptionsVirtioBlkVhostVdpa',
3847 'data': { 'path': 'str' },
3848 'if': 'CONFIG_BLKIO' }
3853 # An enumeration of libiscsi transport types
3857 { 'enum': 'IscsiTransport',
3858 'data': [ 'tcp', 'iser' ] }
3861 # @IscsiHeaderDigest:
3863 # An enumeration of header digests supported by libiscsi
3867 { 'enum': 'IscsiHeaderDigest',
3868 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3869 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3872 # @BlockdevOptionsIscsi:
3874 # @transport: The iscsi transport type
3876 # @portal: The address of the iscsi portal
3878 # @target: The target iqn name
3880 # @lun: LUN to connect to. Defaults to 0.
3882 # @user: User name to log in with. If omitted, no CHAP
3883 # authentication is performed.
3885 # @password-secret: The ID of a QCryptoSecret object providing
3886 # the password for the login. This option is required if
3887 # @user is specified.
3889 # @initiator-name: The iqn name we want to identify to the target
3890 # as. If this option is not specified, an initiator name is
3891 # generated automatically.
3893 # @header-digest: The desired header digest. Defaults to
3896 # @timeout: Timeout in seconds after which a request will
3897 # timeout. 0 means no timeout and is the default.
3899 # Driver specific block device options for iscsi
3903 { 'struct': 'BlockdevOptionsIscsi',
3904 'data': { 'transport': 'IscsiTransport',
3909 '*password-secret': 'str',
3910 '*initiator-name': 'str',
3911 '*header-digest': 'IscsiHeaderDigest',
3912 '*timeout': 'int' } }
3919 { 'enum': 'RbdAuthMode',
3920 'data': [ 'cephx', 'none' ] }
3923 # @RbdImageEncryptionFormat:
3925 # @luks-any: Used for opening either luks or luks2 (Since 8.0)
3929 { 'enum': 'RbdImageEncryptionFormat',
3930 'data': [ 'luks', 'luks2', 'luks-any' ] }
3933 # @RbdEncryptionOptionsLUKSBase:
3935 # @key-secret: ID of a QCryptoSecret object providing a passphrase
3936 # for unlocking the encryption
3940 { 'struct': 'RbdEncryptionOptionsLUKSBase',
3941 'data': { 'key-secret': 'str' } }
3944 # @RbdEncryptionCreateOptionsLUKSBase:
3946 # @cipher-alg: The encryption algorithm
3950 { 'struct': 'RbdEncryptionCreateOptionsLUKSBase',
3951 'base': 'RbdEncryptionOptionsLUKSBase',
3952 'data': { '*cipher-alg': 'QCryptoCipherAlgorithm' } }
3955 # @RbdEncryptionOptionsLUKS:
3959 { 'struct': 'RbdEncryptionOptionsLUKS',
3960 'base': 'RbdEncryptionOptionsLUKSBase',
3964 # @RbdEncryptionOptionsLUKS2:
3968 { 'struct': 'RbdEncryptionOptionsLUKS2',
3969 'base': 'RbdEncryptionOptionsLUKSBase',
3973 # @RbdEncryptionOptionsLUKSAny:
3977 { 'struct': 'RbdEncryptionOptionsLUKSAny',
3978 'base': 'RbdEncryptionOptionsLUKSBase',
3982 # @RbdEncryptionCreateOptionsLUKS:
3986 { 'struct': 'RbdEncryptionCreateOptionsLUKS',
3987 'base': 'RbdEncryptionCreateOptionsLUKSBase',
3991 # @RbdEncryptionCreateOptionsLUKS2:
3995 { 'struct': 'RbdEncryptionCreateOptionsLUKS2',
3996 'base': 'RbdEncryptionCreateOptionsLUKSBase',
4000 # @RbdEncryptionOptions:
4002 # @format: Encryption format.
4004 # @parent: Parent image encryption options (for cloned images).
4005 # Can be left unspecified if this cloned image is encrypted
4006 # using the same format and secret as its parent image (i.e.
4007 # not explicitly formatted) or if its parent image is not
4008 # encrypted. (Since 8.0)
4012 { 'union': 'RbdEncryptionOptions',
4013 'base': { 'format': 'RbdImageEncryptionFormat',
4014 '*parent': 'RbdEncryptionOptions' },
4015 'discriminator': 'format',
4016 'data': { 'luks': 'RbdEncryptionOptionsLUKS',
4017 'luks2': 'RbdEncryptionOptionsLUKS2',
4018 'luks-any': 'RbdEncryptionOptionsLUKSAny'} }
4021 # @RbdEncryptionCreateOptions:
4025 { 'union': 'RbdEncryptionCreateOptions',
4026 'base': { 'format': 'RbdImageEncryptionFormat' },
4027 'discriminator': 'format',
4028 'data': { 'luks': 'RbdEncryptionCreateOptionsLUKS',
4029 'luks2': 'RbdEncryptionCreateOptionsLUKS2' } }
4032 # @BlockdevOptionsRbd:
4034 # @pool: Ceph pool name.
4036 # @namespace: Rados namespace name in the Ceph pool. (Since 5.0)
4038 # @image: Image name in the Ceph pool.
4040 # @conf: path to Ceph configuration file. Values
4041 # in the configuration file will be overridden by
4042 # options specified via QAPI.
4044 # @snapshot: Ceph snapshot name.
4046 # @encrypt: Image encryption options. (Since 6.1)
4048 # @user: Ceph id name.
4050 # @auth-client-required: Acceptable authentication modes.
4051 # This maps to Ceph configuration option
4052 # "auth_client_required". (Since 3.0)
4054 # @key-secret: ID of a QCryptoSecret object providing a key
4055 # for cephx authentication.
4056 # This maps to Ceph configuration option
4057 # "key". (Since 3.0)
4059 # @server: Monitor host address and port. This maps
4060 # to the "mon_host" Ceph option.
4064 { 'struct': 'BlockdevOptionsRbd',
4065 'data': { 'pool': 'str',
4066 '*namespace': 'str',
4070 '*encrypt': 'RbdEncryptionOptions',
4072 '*auth-client-required': ['RbdAuthMode'],
4073 '*key-secret': 'str',
4074 '*server': ['InetSocketAddressBase'] } }
4079 # An enumeration of replication modes.
4081 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
4083 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
4087 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
4088 'if': 'CONFIG_REPLICATION' }
4091 # @BlockdevOptionsReplication:
4093 # Driver specific block device options for replication
4095 # @mode: the replication mode
4097 # @top-id: In secondary mode, node name or device ID of the root
4098 # node who owns the replication node chain. Must not be given in
4103 { 'struct': 'BlockdevOptionsReplication',
4104 'base': 'BlockdevOptionsGenericFormat',
4105 'data': { 'mode': 'ReplicationMode',
4107 'if': 'CONFIG_REPLICATION' }
4112 # An enumeration of NFS transport types
4114 # @inet: TCP transport
4118 { 'enum': 'NFSTransport',
4119 'data': [ 'inet' ] }
4124 # Captures the address of the socket
4126 # @type: transport type used for NFS (only TCP supported)
4128 # @host: host address for NFS server
4132 { 'struct': 'NFSServer',
4133 'data': { 'type': 'NFSTransport',
4137 # @BlockdevOptionsNfs:
4139 # Driver specific block device option for NFS
4141 # @server: host address
4143 # @path: path of the image on the host
4145 # @user: UID value to use when talking to the
4146 # server (defaults to 65534 on Windows and getuid()
4149 # @group: GID value to use when talking to the
4150 # server (defaults to 65534 on Windows and getgid()
4153 # @tcp-syn-count: number of SYNs during the session
4154 # establishment (defaults to libnfs default)
4156 # @readahead-size: set the readahead size in bytes (defaults
4157 # to libnfs default)
4159 # @page-cache-size: set the pagecache size in bytes (defaults
4160 # to libnfs default)
4162 # @debug: set the NFS debug level (max 2) (defaults
4163 # to libnfs default)
4167 { 'struct': 'BlockdevOptionsNfs',
4168 'data': { 'server': 'NFSServer',
4172 '*tcp-syn-count': 'int',
4173 '*readahead-size': 'int',
4174 '*page-cache-size': 'int',
4178 # @BlockdevOptionsCurlBase:
4180 # Driver specific block device options shared by all protocols supported by the
4183 # @url: URL of the image file
4185 # @readahead: Size of the read-ahead cache; must be a multiple of
4186 # 512 (defaults to 256 kB)
4188 # @timeout: Timeout for connections, in seconds (defaults to 5)
4190 # @username: Username for authentication (defaults to none)
4192 # @password-secret: ID of a QCryptoSecret object providing a password
4193 # for authentication (defaults to no password)
4195 # @proxy-username: Username for proxy authentication (defaults to none)
4197 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
4198 # for proxy authentication (defaults to no password)
4202 { 'struct': 'BlockdevOptionsCurlBase',
4203 'data': { 'url': 'str',
4204 '*readahead': 'int',
4207 '*password-secret': 'str',
4208 '*proxy-username': 'str',
4209 '*proxy-password-secret': 'str' } }
4212 # @BlockdevOptionsCurlHttp:
4214 # Driver specific block device options for HTTP connections over the curl
4215 # backend. URLs must start with "http://".
4217 # @cookie: List of cookies to set; format is
4218 # "name1=content1; name2=content2;" as explained by
4219 # CURLOPT_COOKIE(3). Defaults to no cookies.
4221 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
4222 # secure way. See @cookie for the format. (since 2.10)
4226 { 'struct': 'BlockdevOptionsCurlHttp',
4227 'base': 'BlockdevOptionsCurlBase',
4228 'data': { '*cookie': 'str',
4229 '*cookie-secret': 'str'} }
4232 # @BlockdevOptionsCurlHttps:
4234 # Driver specific block device options for HTTPS connections over the curl
4235 # backend. URLs must start with "https://".
4237 # @cookie: List of cookies to set; format is
4238 # "name1=content1; name2=content2;" as explained by
4239 # CURLOPT_COOKIE(3). Defaults to no cookies.
4241 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
4244 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
4245 # secure way. See @cookie for the format. (since 2.10)
4249 { 'struct': 'BlockdevOptionsCurlHttps',
4250 'base': 'BlockdevOptionsCurlBase',
4251 'data': { '*cookie': 'str',
4252 '*sslverify': 'bool',
4253 '*cookie-secret': 'str'} }
4256 # @BlockdevOptionsCurlFtp:
4258 # Driver specific block device options for FTP connections over the curl
4259 # backend. URLs must start with "ftp://".
4263 { 'struct': 'BlockdevOptionsCurlFtp',
4264 'base': 'BlockdevOptionsCurlBase',
4268 # @BlockdevOptionsCurlFtps:
4270 # Driver specific block device options for FTPS connections over the curl
4271 # backend. URLs must start with "ftps://".
4273 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
4278 { 'struct': 'BlockdevOptionsCurlFtps',
4279 'base': 'BlockdevOptionsCurlBase',
4280 'data': { '*sslverify': 'bool' } }
4283 # @BlockdevOptionsNbd:
4285 # Driver specific block device options for NBD.
4287 # @server: NBD server address
4289 # @export: export name
4291 # @tls-creds: TLS credentials ID
4293 # @tls-hostname: TLS hostname override for certificate validation (Since 7.0)
4295 # @x-dirty-bitmap: A metadata context name such as "qemu:dirty-bitmap:NAME"
4296 # or "qemu:allocation-depth" to query in place of the
4297 # traditional "base:allocation" block status (see
4298 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol; and
4299 # yes, naming this option x-context would have made
4300 # more sense) (since 3.0)
4302 # @reconnect-delay: On an unexpected disconnect, the nbd client tries to
4303 # connect again until succeeding or encountering a serious
4304 # error. During the first @reconnect-delay seconds, all
4305 # requests are paused and will be rerun on a successful
4306 # reconnect. After that time, any delayed requests and all
4307 # future requests before a successful reconnect will
4308 # immediately fail. Default 0 (Since 4.2)
4310 # @open-timeout: In seconds. If zero, the nbd driver tries the connection
4311 # only once, and fails to open if the connection fails.
4312 # If non-zero, the nbd driver will repeat connection attempts
4313 # until successful or until @open-timeout seconds have elapsed.
4314 # Default 0 (Since 7.0)
4317 # @unstable: Member @x-dirty-bitmap is experimental.
4321 { 'struct': 'BlockdevOptionsNbd',
4322 'data': { 'server': 'SocketAddress',
4324 '*tls-creds': 'str',
4325 '*tls-hostname': 'str',
4326 '*x-dirty-bitmap': { 'type': 'str', 'features': [ 'unstable' ] },
4327 '*reconnect-delay': 'uint32',
4328 '*open-timeout': 'uint32' } }
4331 # @BlockdevOptionsRaw:
4333 # Driver specific block device options for the raw driver.
4335 # @offset: position where the block device starts
4336 # @size: the assumed size of the device
4340 { 'struct': 'BlockdevOptionsRaw',
4341 'base': 'BlockdevOptionsGenericFormat',
4342 'data': { '*offset': 'int', '*size': 'int' } }
4345 # @BlockdevOptionsThrottle:
4347 # Driver specific block device options for the throttle driver
4349 # @throttle-group: the name of the throttle-group object to use. It
4350 # must already exist.
4351 # @file: reference to or definition of the data source block device
4355 { 'struct': 'BlockdevOptionsThrottle',
4356 'data': { 'throttle-group': 'str',
4357 'file' : 'BlockdevRef'
4361 # @BlockdevOptionsCor:
4363 # Driver specific block device options for the copy-on-read driver.
4365 # @bottom: The name of a non-filter node (allocation-bearing layer) that
4366 # limits the COR operations in the backing chain (inclusive), so
4367 # that no data below this node will be copied by this filter.
4368 # If option is absent, the limit is not applied, so that data
4369 # from all backing layers may be copied.
4373 { 'struct': 'BlockdevOptionsCor',
4374 'base': 'BlockdevOptionsGenericFormat',
4375 'data': { '*bottom': 'str' } }
4380 # An enumeration of possible behaviors for copy-before-write operation
4383 # @break-guest-write: report the error to the guest. This way, the guest
4384 # will not be able to overwrite areas that cannot be
4385 # backed up, so the backup process remains valid.
4387 # @break-snapshot: continue guest write. Doing so will make the provided
4388 # snapshot state invalid and any backup or export
4389 # process based on it will finally fail.
4393 { 'enum': 'OnCbwError',
4394 'data': [ 'break-guest-write', 'break-snapshot' ] }
4397 # @BlockdevOptionsCbw:
4399 # Driver specific block device options for the copy-before-write driver,
4400 # which does so called copy-before-write operations: when data is
4401 # written to the filter, the filter first reads corresponding blocks
4402 # from its file child and copies them to @target child. After successfully
4403 # copying, the write request is propagated to file child. If copying
4404 # fails, the original write request is failed too and no data is written
4407 # @target: The target for copy-before-write operations.
4409 # @bitmap: If specified, copy-before-write filter will do
4410 # copy-before-write operations only for dirty regions of the
4411 # bitmap. Bitmap size must be equal to length of file and
4412 # target child of the filter. Note also, that bitmap is used
4413 # only to initialize internal bitmap of the process, so further
4414 # modifications (or removing) of specified bitmap doesn't
4415 # influence the filter. (Since 7.0)
4417 # @on-cbw-error: Behavior on failure of copy-before-write operation.
4418 # Default is @break-guest-write. (Since 7.1)
4420 # @cbw-timeout: Zero means no limit. Non-zero sets the timeout in seconds
4421 # for copy-before-write operation. When a timeout occurs,
4422 # the respective copy-before-write operation will fail, and
4423 # the @on-cbw-error parameter will decide how this failure
4424 # is handled. Default 0. (Since 7.1)
4428 { 'struct': 'BlockdevOptionsCbw',
4429 'base': 'BlockdevOptionsGenericFormat',
4430 'data': { 'target': 'BlockdevRef', '*bitmap': 'BlockDirtyBitmap',
4431 '*on-cbw-error': 'OnCbwError', '*cbw-timeout': 'uint32' } }
4436 # Options for creating a block device. Many options are available for all
4437 # block devices, independent of the block driver:
4439 # @driver: block driver name
4440 # @node-name: the node name of the new node (Since 2.0).
4441 # This option is required on the top level of blockdev-add.
4442 # Valid node names start with an alphabetic character and may
4443 # contain only alphanumeric characters, '-', '.' and '_'. Their
4444 # maximum length is 31 characters.
4445 # @discard: discard-related options (default: ignore)
4446 # @cache: cache-related options
4447 # @read-only: whether the block device should be read-only (default: false).
4448 # Note that some block drivers support only read-only access,
4449 # either generally or in certain configurations. In this case,
4450 # the default value does not work and the option must be
4451 # specified explicitly.
4452 # @auto-read-only: if true and @read-only is false, QEMU may automatically
4453 # decide not to open the image read-write as requested, but
4454 # fall back to read-only instead (and switch between the modes
4455 # later), e.g. depending on whether the image file is writable
4456 # or whether a writing user is attached to the node
4457 # (default: false, since 3.1)
4458 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
4460 # @force-share: force share all permission on added nodes.
4461 # Requires read-only=true. (Since 2.10)
4463 # Remaining options are determined by the block driver.
4467 { 'union': 'BlockdevOptions',
4468 'base': { 'driver': 'BlockdevDriver',
4469 '*node-name': 'str',
4470 '*discard': 'BlockdevDiscardOptions',
4471 '*cache': 'BlockdevCacheOptions',
4472 '*read-only': 'bool',
4473 '*auto-read-only': 'bool',
4474 '*force-share': 'bool',
4475 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
4476 'discriminator': 'driver',
4478 'blkdebug': 'BlockdevOptionsBlkdebug',
4479 'blklogwrites':'BlockdevOptionsBlklogwrites',
4480 'blkverify': 'BlockdevOptionsBlkverify',
4481 'blkreplay': 'BlockdevOptionsBlkreplay',
4482 'bochs': 'BlockdevOptionsGenericFormat',
4483 'cloop': 'BlockdevOptionsGenericFormat',
4484 'compress': 'BlockdevOptionsGenericFormat',
4485 'copy-before-write':'BlockdevOptionsCbw',
4486 'copy-on-read':'BlockdevOptionsCor',
4487 'dmg': 'BlockdevOptionsGenericFormat',
4488 'file': 'BlockdevOptionsFile',
4489 'ftp': 'BlockdevOptionsCurlFtp',
4490 'ftps': 'BlockdevOptionsCurlFtps',
4491 'gluster': 'BlockdevOptionsGluster',
4492 'host_cdrom': { 'type': 'BlockdevOptionsFile',
4493 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4494 'host_device': { 'type': 'BlockdevOptionsFile',
4495 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4496 'http': 'BlockdevOptionsCurlHttp',
4497 'https': 'BlockdevOptionsCurlHttps',
4498 'io_uring': { 'type': 'BlockdevOptionsIoUring',
4499 'if': 'CONFIG_BLKIO' },
4500 'iscsi': 'BlockdevOptionsIscsi',
4501 'luks': 'BlockdevOptionsLUKS',
4502 'nbd': 'BlockdevOptionsNbd',
4503 'nfs': 'BlockdevOptionsNfs',
4504 'null-aio': 'BlockdevOptionsNull',
4505 'null-co': 'BlockdevOptionsNull',
4506 'nvme': 'BlockdevOptionsNVMe',
4507 'nvme-io_uring': { 'type': 'BlockdevOptionsNvmeIoUring',
4508 'if': 'CONFIG_BLKIO' },
4509 'parallels': 'BlockdevOptionsGenericFormat',
4510 'preallocate':'BlockdevOptionsPreallocate',
4511 'qcow2': 'BlockdevOptionsQcow2',
4512 'qcow': 'BlockdevOptionsQcow',
4513 'qed': 'BlockdevOptionsGenericCOWFormat',
4514 'quorum': 'BlockdevOptionsQuorum',
4515 'raw': 'BlockdevOptionsRaw',
4516 'rbd': 'BlockdevOptionsRbd',
4517 'replication': { 'type': 'BlockdevOptionsReplication',
4518 'if': 'CONFIG_REPLICATION' },
4519 'snapshot-access': 'BlockdevOptionsGenericFormat',
4520 'ssh': 'BlockdevOptionsSsh',
4521 'throttle': 'BlockdevOptionsThrottle',
4522 'vdi': 'BlockdevOptionsGenericFormat',
4523 'vhdx': 'BlockdevOptionsGenericFormat',
4524 'virtio-blk-vfio-pci':
4525 { 'type': 'BlockdevOptionsVirtioBlkVfioPci',
4526 'if': 'CONFIG_BLKIO' },
4527 'virtio-blk-vhost-user':
4528 { 'type': 'BlockdevOptionsVirtioBlkVhostUser',
4529 'if': 'CONFIG_BLKIO' },
4530 'virtio-blk-vhost-vdpa':
4531 { 'type': 'BlockdevOptionsVirtioBlkVhostVdpa',
4532 'if': 'CONFIG_BLKIO' },
4533 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4534 'vpc': 'BlockdevOptionsGenericFormat',
4535 'vvfat': 'BlockdevOptionsVVFAT'
4541 # Reference to a block device.
4543 # @definition: defines a new block device inline
4544 # @reference: references the ID of an existing block device
4548 { 'alternate': 'BlockdevRef',
4549 'data': { 'definition': 'BlockdevOptions',
4550 'reference': 'str' } }
4553 # @BlockdevRefOrNull:
4555 # Reference to a block device.
4557 # @definition: defines a new block device inline
4558 # @reference: references the ID of an existing block device.
4559 # An empty string means that no block device should
4560 # be referenced. Deprecated; use null instead.
4561 # @null: No block device should be referenced (since 2.10)
4565 { 'alternate': 'BlockdevRefOrNull',
4566 'data': { 'definition': 'BlockdevOptions',
4573 # Creates a new block device.
4579 # -> { "execute": "blockdev-add",
4581 # "driver": "qcow2",
4582 # "node-name": "test1",
4585 # "filename": "test.qcow2"
4589 # <- { "return": {} }
4591 # -> { "execute": "blockdev-add",
4593 # "driver": "qcow2",
4594 # "node-name": "node0",
4595 # "discard": "unmap",
4601 # "filename": "/tmp/test.qcow2"
4607 # "filename": "/dev/fdset/4"
4613 # <- { "return": {} }
4616 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true,
4617 'allow-preconfig': true }
4622 # Reopens one or more block devices using the given set of options.
4623 # Any option not specified will be reset to its default value regardless
4624 # of its previous status. If an option cannot be changed or a particular
4625 # driver does not support reopening then the command will return an
4626 # error. All devices in the list are reopened in one transaction, so
4627 # if one of them fails then the whole transaction is cancelled.
4629 # The command receives a list of block devices to reopen. For each one
4630 # of them, the top-level @node-name option (from BlockdevOptions) must be
4631 # specified and is used to select the block device to be reopened.
4632 # Other @node-name options must be either omitted or set to the
4633 # current name of the appropriate node. This command won't change any
4634 # node name and any attempt to do it will result in an error.
4636 # In the case of options that refer to child nodes, the behavior of
4637 # this command depends on the value:
4639 # 1) A set of options (BlockdevOptions): the child is reopened with
4640 # the specified set of options.
4642 # 2) A reference to the current child: the child is reopened using
4643 # its existing set of options.
4645 # 3) A reference to a different node: the current child is replaced
4646 # with the specified one.
4648 # 4) NULL: the current child (if any) is detached.
4650 # Options (1) and (2) are supported in all cases. Option (3) is
4651 # supported for @file and @backing, and option (4) for @backing only.
4653 # Unlike with blockdev-add, the @backing option must always be present
4654 # unless the node being reopened does not have a backing file and its
4655 # image does not have a default backing file name as part of its
4660 { 'command': 'blockdev-reopen',
4661 'data': { 'options': ['BlockdevOptions'] },
4662 'allow-preconfig': true }
4667 # Deletes a block device that has been added using blockdev-add.
4668 # The command will fail if the node is attached to a device or is
4669 # otherwise being used.
4671 # @node-name: Name of the graph node to delete.
4677 # -> { "execute": "blockdev-add",
4679 # "driver": "qcow2",
4680 # "node-name": "node0",
4683 # "filename": "test.qcow2"
4687 # <- { "return": {} }
4689 # -> { "execute": "blockdev-del",
4690 # "arguments": { "node-name": "node0" }
4692 # <- { "return": {} }
4695 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' },
4696 'allow-preconfig': true }
4699 # @BlockdevCreateOptionsFile:
4701 # Driver specific image creation options for file.
4703 # @filename: Filename for the new image file
4704 # @size: Size of the virtual disk in bytes
4705 # @preallocation: Preallocation mode for the new image (default: off;
4706 # allowed values: off,
4707 # falloc (if CONFIG_POSIX_FALLOCATE),
4708 # full (if CONFIG_POSIX))
4709 # @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
4710 # @extent-size-hint: Extent size hint to add to the image file; 0 for not
4711 # adding an extent size hint (default: 1 MB, since 5.1)
4715 { 'struct': 'BlockdevCreateOptionsFile',
4716 'data': { 'filename': 'str',
4718 '*preallocation': 'PreallocMode',
4720 '*extent-size-hint': 'size'} }
4723 # @BlockdevCreateOptionsGluster:
4725 # Driver specific image creation options for gluster.
4727 # @location: Where to store the new image file
4728 # @size: Size of the virtual disk in bytes
4729 # @preallocation: Preallocation mode for the new image (default: off;
4730 # allowed values: off,
4731 # falloc (if CONFIG_GLUSTERFS_FALLOCATE),
4732 # full (if CONFIG_GLUSTERFS_ZEROFILL))
4736 { 'struct': 'BlockdevCreateOptionsGluster',
4737 'data': { 'location': 'BlockdevOptionsGluster',
4739 '*preallocation': 'PreallocMode' } }
4742 # @BlockdevCreateOptionsLUKS:
4744 # Driver specific image creation options for LUKS.
4746 # @file: Node to create the image format on
4747 # @size: Size of the virtual disk in bytes
4748 # @preallocation: Preallocation mode for the new image
4750 # (default: off; allowed values: off, metadata, falloc, full)
4754 { 'struct': 'BlockdevCreateOptionsLUKS',
4755 'base': 'QCryptoBlockCreateOptionsLUKS',
4756 'data': { 'file': 'BlockdevRef',
4758 '*preallocation': 'PreallocMode' } }
4761 # @BlockdevCreateOptionsNfs:
4763 # Driver specific image creation options for NFS.
4765 # @location: Where to store the new image file
4766 # @size: Size of the virtual disk in bytes
4770 { 'struct': 'BlockdevCreateOptionsNfs',
4771 'data': { 'location': 'BlockdevOptionsNfs',
4775 # @BlockdevCreateOptionsParallels:
4777 # Driver specific image creation options for parallels.
4779 # @file: Node to create the image format on
4780 # @size: Size of the virtual disk in bytes
4781 # @cluster-size: Cluster size in bytes (default: 1 MB)
4785 { 'struct': 'BlockdevCreateOptionsParallels',
4786 'data': { 'file': 'BlockdevRef',
4788 '*cluster-size': 'size' } }
4791 # @BlockdevCreateOptionsQcow:
4793 # Driver specific image creation options for qcow.
4795 # @file: Node to create the image format on
4796 # @size: Size of the virtual disk in bytes
4797 # @backing-file: File name of the backing file if a backing file
4799 # @encrypt: Encryption options if the image should be encrypted
4803 { 'struct': 'BlockdevCreateOptionsQcow',
4804 'data': { 'file': 'BlockdevRef',
4806 '*backing-file': 'str',
4807 '*encrypt': 'QCryptoBlockCreateOptions' } }
4810 # @BlockdevQcow2Version:
4812 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4813 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4817 { 'enum': 'BlockdevQcow2Version',
4818 'data': [ 'v2', 'v3' ] }
4821 # @Qcow2CompressionType:
4823 # Compression type used in qcow2 image file
4825 # @zlib: zlib compression, see <http://zlib.net/>
4826 # @zstd: zstd compression, see <http://github.com/facebook/zstd>
4830 { 'enum': 'Qcow2CompressionType',
4831 'data': [ 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
4834 # @BlockdevCreateOptionsQcow2:
4836 # Driver specific image creation options for qcow2.
4838 # @file: Node to create the image format on
4839 # @data-file: Node to use as an external data file in which all guest
4840 # data is stored so that only metadata remains in the qcow2
4842 # @data-file-raw: True if the external data file must stay valid as a
4843 # standalone (read-only) raw image without looking at qcow2
4844 # metadata (default: false; since: 4.0)
4845 # @extended-l2: True to make the image have extended L2 entries
4846 # (default: false; since 5.2)
4847 # @size: Size of the virtual disk in bytes
4848 # @version: Compatibility level (default: v3)
4849 # @backing-file: File name of the backing file if a backing file
4851 # @backing-fmt: Name of the block driver to use for the backing file
4852 # @encrypt: Encryption options if the image should be encrypted
4853 # @cluster-size: qcow2 cluster size in bytes (default: 65536)
4854 # @preallocation: Preallocation mode for the new image (default: off;
4855 # allowed values: off, falloc, full, metadata)
4856 # @lazy-refcounts: True if refcounts may be updated lazily (default: off)
4857 # @refcount-bits: Width of reference counts in bits (default: 16)
4858 # @compression-type: The image cluster compression method
4859 # (default: zlib, since 5.1)
4863 { 'struct': 'BlockdevCreateOptionsQcow2',
4864 'data': { 'file': 'BlockdevRef',
4865 '*data-file': 'BlockdevRef',
4866 '*data-file-raw': 'bool',
4867 '*extended-l2': 'bool',
4869 '*version': 'BlockdevQcow2Version',
4870 '*backing-file': 'str',
4871 '*backing-fmt': 'BlockdevDriver',
4872 '*encrypt': 'QCryptoBlockCreateOptions',
4873 '*cluster-size': 'size',
4874 '*preallocation': 'PreallocMode',
4875 '*lazy-refcounts': 'bool',
4876 '*refcount-bits': 'int',
4877 '*compression-type':'Qcow2CompressionType' } }
4880 # @BlockdevCreateOptionsQed:
4882 # Driver specific image creation options for qed.
4884 # @file: Node to create the image format on
4885 # @size: Size of the virtual disk in bytes
4886 # @backing-file: File name of the backing file if a backing file
4888 # @backing-fmt: Name of the block driver to use for the backing file
4889 # @cluster-size: Cluster size in bytes (default: 65536)
4890 # @table-size: L1/L2 table size (in clusters)
4894 { 'struct': 'BlockdevCreateOptionsQed',
4895 'data': { 'file': 'BlockdevRef',
4897 '*backing-file': 'str',
4898 '*backing-fmt': 'BlockdevDriver',
4899 '*cluster-size': 'size',
4900 '*table-size': 'int' } }
4903 # @BlockdevCreateOptionsRbd:
4905 # Driver specific image creation options for rbd/Ceph.
4907 # @location: Where to store the new image file. This location cannot
4908 # point to a snapshot.
4909 # @size: Size of the virtual disk in bytes
4910 # @cluster-size: RBD object size
4911 # @encrypt: Image encryption options. (Since 6.1)
4915 { 'struct': 'BlockdevCreateOptionsRbd',
4916 'data': { 'location': 'BlockdevOptionsRbd',
4918 '*cluster-size' : 'size',
4919 '*encrypt' : 'RbdEncryptionCreateOptions' } }
4922 # @BlockdevVmdkSubformat:
4924 # Subformat options for VMDK images
4926 # @monolithicSparse: Single file image with sparse cluster allocation
4928 # @monolithicFlat: Single flat data image and a descriptor file
4930 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4931 # files, in addition to a descriptor file
4933 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4934 # files, in addition to a descriptor file
4936 # @streamOptimized: Single file image sparse cluster allocation, optimized
4937 # for streaming over network.
4941 { 'enum': 'BlockdevVmdkSubformat',
4942 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4943 'twoGbMaxExtentFlat', 'streamOptimized'] }
4946 # @BlockdevVmdkAdapterType:
4948 # Adapter type info for VMDK images
4952 { 'enum': 'BlockdevVmdkAdapterType',
4953 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4956 # @BlockdevCreateOptionsVmdk:
4958 # Driver specific image creation options for VMDK.
4960 # @file: Where to store the new image file. This refers to the image
4961 # file for monolithcSparse and streamOptimized format, or the
4962 # descriptor file for other formats.
4963 # @size: Size of the virtual disk in bytes
4964 # @extents: Where to store the data extents. Required for monolithcFlat,
4965 # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4966 # monolithicFlat, only one entry is required; for
4967 # twoGbMaxExtent* formats, the number of entries required is
4968 # calculated as extent_number = virtual_size / 2GB. Providing
4969 # more extents than will be used is an error.
4970 # @subformat: The subformat of the VMDK image. Default: "monolithicSparse".
4971 # @backing-file: The path of backing file. Default: no backing file is used.
4972 # @adapter-type: The adapter type used to fill in the descriptor. Default: ide.
4973 # @hwversion: Hardware version. The meaningful options are "4" or "6".
4975 # @toolsversion: VMware guest tools version.
4976 # Default: "2147483647" (Since 6.2)
4977 # @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats.
4982 { 'struct': 'BlockdevCreateOptionsVmdk',
4983 'data': { 'file': 'BlockdevRef',
4985 '*extents': ['BlockdevRef'],
4986 '*subformat': 'BlockdevVmdkSubformat',
4987 '*backing-file': 'str',
4988 '*adapter-type': 'BlockdevVmdkAdapterType',
4989 '*hwversion': 'str',
4990 '*toolsversion': 'str',
4991 '*zeroed-grain': 'bool' } }
4994 # @BlockdevCreateOptionsSsh:
4996 # Driver specific image creation options for SSH.
4998 # @location: Where to store the new image file
4999 # @size: Size of the virtual disk in bytes
5003 { 'struct': 'BlockdevCreateOptionsSsh',
5004 'data': { 'location': 'BlockdevOptionsSsh',
5008 # @BlockdevCreateOptionsVdi:
5010 # Driver specific image creation options for VDI.
5012 # @file: Node to create the image format on
5013 # @size: Size of the virtual disk in bytes
5014 # @preallocation: Preallocation mode for the new image (default: off;
5015 # allowed values: off, metadata)
5019 { 'struct': 'BlockdevCreateOptionsVdi',
5020 'data': { 'file': 'BlockdevRef',
5022 '*preallocation': 'PreallocMode' } }
5025 # @BlockdevVhdxSubformat:
5027 # @dynamic: Growing image file
5028 # @fixed: Preallocated fixed-size image file
5032 { 'enum': 'BlockdevVhdxSubformat',
5033 'data': [ 'dynamic', 'fixed' ] }
5036 # @BlockdevCreateOptionsVhdx:
5038 # Driver specific image creation options for vhdx.
5040 # @file: Node to create the image format on
5041 # @size: Size of the virtual disk in bytes
5042 # @log-size: Log size in bytes, must be a multiple of 1 MB
5044 # @block-size: Block size in bytes, must be a multiple of 1 MB and not
5045 # larger than 256 MB (default: automatically choose a block
5046 # size depending on the image size)
5047 # @subformat: vhdx subformat (default: dynamic)
5048 # @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard,
5049 # but default. Do not set to 'off' when using 'qemu-img
5050 # convert' with subformat=dynamic.
5054 { 'struct': 'BlockdevCreateOptionsVhdx',
5055 'data': { 'file': 'BlockdevRef',
5057 '*log-size': 'size',
5058 '*block-size': 'size',
5059 '*subformat': 'BlockdevVhdxSubformat',
5060 '*block-state-zero': 'bool' } }
5063 # @BlockdevVpcSubformat:
5065 # @dynamic: Growing image file
5066 # @fixed: Preallocated fixed-size image file
5070 { 'enum': 'BlockdevVpcSubformat',
5071 'data': [ 'dynamic', 'fixed' ] }
5074 # @BlockdevCreateOptionsVpc:
5076 # Driver specific image creation options for vpc (VHD).
5078 # @file: Node to create the image format on
5079 # @size: Size of the virtual disk in bytes
5080 # @subformat: vhdx subformat (default: dynamic)
5081 # @force-size: Force use of the exact byte size instead of rounding to the
5082 # next size that can be represented in CHS geometry
5087 { 'struct': 'BlockdevCreateOptionsVpc',
5088 'data': { 'file': 'BlockdevRef',
5090 '*subformat': 'BlockdevVpcSubformat',
5091 '*force-size': 'bool' } }
5094 # @BlockdevCreateOptions:
5096 # Options for creating an image format on a given node.
5098 # @driver: block driver to create the image format
5102 { 'union': 'BlockdevCreateOptions',
5104 'driver': 'BlockdevDriver' },
5105 'discriminator': 'driver',
5107 'file': 'BlockdevCreateOptionsFile',
5108 'gluster': 'BlockdevCreateOptionsGluster',
5109 'luks': 'BlockdevCreateOptionsLUKS',
5110 'nfs': 'BlockdevCreateOptionsNfs',
5111 'parallels': 'BlockdevCreateOptionsParallels',
5112 'qcow': 'BlockdevCreateOptionsQcow',
5113 'qcow2': 'BlockdevCreateOptionsQcow2',
5114 'qed': 'BlockdevCreateOptionsQed',
5115 'rbd': 'BlockdevCreateOptionsRbd',
5116 'ssh': 'BlockdevCreateOptionsSsh',
5117 'vdi': 'BlockdevCreateOptionsVdi',
5118 'vhdx': 'BlockdevCreateOptionsVhdx',
5119 'vmdk': 'BlockdevCreateOptionsVmdk',
5120 'vpc': 'BlockdevCreateOptionsVpc'
5126 # Starts a job to create an image format on a given node. The job is
5127 # automatically finalized, but a manual job-dismiss is required.
5129 # @job-id: Identifier for the newly created job.
5131 # @options: Options for the image creation.
5135 { 'command': 'blockdev-create',
5136 'data': { 'job-id': 'str',
5137 'options': 'BlockdevCreateOptions' },
5138 'allow-preconfig': true }
5141 # @BlockdevAmendOptionsLUKS:
5143 # Driver specific image amend options for LUKS.
5147 { 'struct': 'BlockdevAmendOptionsLUKS',
5148 'base': 'QCryptoBlockAmendOptionsLUKS',
5153 # @BlockdevAmendOptionsQcow2:
5155 # Driver specific image amend options for qcow2.
5156 # For now, only encryption options can be amended
5158 # @encrypt Encryption options to be amended
5162 { 'struct': 'BlockdevAmendOptionsQcow2',
5163 'data': { '*encrypt': 'QCryptoBlockAmendOptions' } }
5166 # @BlockdevAmendOptions:
5168 # Options for amending an image format
5170 # @driver: Block driver of the node to amend.
5174 { 'union': 'BlockdevAmendOptions',
5176 'driver': 'BlockdevDriver' },
5177 'discriminator': 'driver',
5179 'luks': 'BlockdevAmendOptionsLUKS',
5180 'qcow2': 'BlockdevAmendOptionsQcow2' } }
5183 # @x-blockdev-amend:
5185 # Starts a job to amend format specific options of an existing open block device
5186 # The job is automatically finalized, but a manual job-dismiss is required.
5188 # @job-id: Identifier for the newly created job.
5190 # @node-name: Name of the block node to work on
5192 # @options: Options (driver specific)
5194 # @force: Allow unsafe operations, format specific
5195 # For luks that allows erase of the last active keyslot
5196 # (permanent loss of data),
5197 # and replacement of an active keyslot
5198 # (possible loss of data if IO error happens)
5201 # @unstable: This command is experimental.
5205 { 'command': 'x-blockdev-amend',
5206 'data': { 'job-id': 'str',
5208 'options': 'BlockdevAmendOptions',
5210 'features': [ 'unstable' ],
5211 'allow-preconfig': true }
5214 # @BlockErrorAction:
5216 # An enumeration of action that has been taken when a DISK I/O occurs
5218 # @ignore: error has been ignored
5220 # @report: error has been reported to the device
5222 # @stop: error caused VM to be stopped
5226 { 'enum': 'BlockErrorAction',
5227 'data': [ 'ignore', 'report', 'stop' ] }
5230 # @BLOCK_IMAGE_CORRUPTED:
5232 # Emitted when a disk image is being marked corrupt. The image can be
5233 # identified by its device or node name. The 'device' field is always
5234 # present for compatibility reasons, but it can be empty ("") if the
5235 # image does not have a device name associated.
5237 # @device: device name. This is always present for compatibility
5238 # reasons, but it can be empty ("") if the image does not
5239 # have a device name associated.
5241 # @node-name: node name (Since: 2.4)
5243 # @msg: informative message for human consumption, such as the kind of
5244 # corruption being detected. It should not be parsed by machine as it is
5245 # not guaranteed to be stable
5247 # @offset: if the corruption resulted from an image access, this is
5248 # the host's access offset into the image
5250 # @size: if the corruption resulted from an image access, this is
5253 # @fatal: if set, the image is marked corrupt and therefore unusable after this
5254 # event and must be repaired (Since 2.2; before, every
5255 # BLOCK_IMAGE_CORRUPTED event was fatal)
5257 # Note: If action is "stop", a STOP event will eventually follow the
5258 # BLOCK_IO_ERROR event.
5262 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
5263 # "data": { "device": "", "node-name": "drive", "fatal": false,
5264 # "msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)" },
5265 # "timestamp": { "seconds": 1648243240, "microseconds": 906060 } }
5269 { 'event': 'BLOCK_IMAGE_CORRUPTED',
5270 'data': { 'device' : 'str',
5271 '*node-name' : 'str',
5275 'fatal' : 'bool' } }
5280 # Emitted when a disk I/O error occurs
5282 # @device: device name. This is always present for compatibility
5283 # reasons, but it can be empty ("") if the image does not
5284 # have a device name associated.
5286 # @node-name: node name. Note that errors may be reported for the root node
5287 # that is directly attached to a guest device rather than for the
5288 # node where the error occurred. The node name is not present if
5289 # the drive is empty. (Since: 2.8)
5291 # @operation: I/O operation
5293 # @action: action that has been taken
5295 # @nospace: true if I/O error was caused due to a no-space
5296 # condition. This key is only present if query-block's
5297 # io-status is present, please see query-block documentation
5298 # for more information (since: 2.2)
5300 # @reason: human readable string describing the error cause.
5301 # (This field is a debugging aid for humans, it should not
5302 # be parsed by applications) (since: 2.2)
5304 # Note: If action is "stop", a STOP event will eventually follow the
5305 # BLOCK_IO_ERROR event
5311 # <- { "event": "BLOCK_IO_ERROR",
5312 # "data": { "device": "ide0-hd1",
5313 # "node-name": "#block212",
5314 # "operation": "write",
5316 # "reason": "No space left on device" },
5317 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5320 { 'event': 'BLOCK_IO_ERROR',
5321 'data': { 'device': 'str', '*node-name': 'str',
5322 'operation': 'IoOperationType',
5323 'action': 'BlockErrorAction', '*nospace': 'bool',
5327 # @BLOCK_JOB_COMPLETED:
5329 # Emitted when a block job has completed
5333 # @device: The job identifier. Originally the device name but other
5334 # values are allowed since QEMU 2.7
5336 # @len: maximum progress value
5338 # @offset: current progress value. On success this is equal to len.
5339 # On failure this is less than len
5341 # @speed: rate limit, bytes per second
5343 # @error: error message. Only present on failure. This field
5344 # contains a human-readable error message. There are no semantics
5345 # other than that streaming has failed and clients should not try to
5346 # interpret the error string
5352 # <- { "event": "BLOCK_JOB_COMPLETED",
5353 # "data": { "type": "stream", "device": "virtio-disk0",
5354 # "len": 10737418240, "offset": 10737418240,
5356 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5359 { 'event': 'BLOCK_JOB_COMPLETED',
5360 'data': { 'type' : 'JobType',
5368 # @BLOCK_JOB_CANCELLED:
5370 # Emitted when a block job has been cancelled
5374 # @device: The job identifier. Originally the device name but other
5375 # values are allowed since QEMU 2.7
5377 # @len: maximum progress value
5379 # @offset: current progress value. On success this is equal to len.
5380 # On failure this is less than len
5382 # @speed: rate limit, bytes per second
5388 # <- { "event": "BLOCK_JOB_CANCELLED",
5389 # "data": { "type": "stream", "device": "virtio-disk0",
5390 # "len": 10737418240, "offset": 134217728,
5392 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5395 { 'event': 'BLOCK_JOB_CANCELLED',
5396 'data': { 'type' : 'JobType',
5405 # Emitted when a block job encounters an error
5407 # @device: The job identifier. Originally the device name but other
5408 # values are allowed since QEMU 2.7
5410 # @operation: I/O operation
5412 # @action: action that has been taken
5418 # <- { "event": "BLOCK_JOB_ERROR",
5419 # "data": { "device": "ide0-hd1",
5420 # "operation": "write",
5421 # "action": "stop" },
5422 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5425 { 'event': 'BLOCK_JOB_ERROR',
5426 'data': { 'device' : 'str',
5427 'operation': 'IoOperationType',
5428 'action' : 'BlockErrorAction' } }
5433 # Emitted when a block job is ready to complete
5437 # @device: The job identifier. Originally the device name but other
5438 # values are allowed since QEMU 2.7
5440 # @len: maximum progress value
5442 # @offset: current progress value. On success this is equal to len.
5443 # On failure this is less than len
5445 # @speed: rate limit, bytes per second
5447 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
5454 # <- { "event": "BLOCK_JOB_READY",
5455 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5456 # "len": 2097152, "offset": 2097152 },
5457 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5460 { 'event': 'BLOCK_JOB_READY',
5461 'data': { 'type' : 'JobType',
5468 # @BLOCK_JOB_PENDING:
5470 # Emitted when a block job is awaiting explicit authorization to finalize graph
5471 # changes via @block-job-finalize. If this job is part of a transaction, it will
5472 # not emit this event until the transaction has converged first.
5476 # @id: The job identifier.
5482 # <- { "event": "BLOCK_JOB_PENDING",
5483 # "data": { "type": "mirror", "id": "backup_1" },
5484 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5487 { 'event': 'BLOCK_JOB_PENDING',
5488 'data': { 'type' : 'JobType',
5494 # Preallocation mode of QEMU image file
5496 # @off: no preallocation
5497 # @metadata: preallocate only for metadata
5498 # @falloc: like @full preallocation but allocate disk space by
5499 # posix_fallocate() rather than writing data.
5500 # @full: preallocate all data by writing it to the device to ensure
5501 # disk space is really available. This data may or may not be
5502 # zero, depending on the image format and storage.
5503 # @full preallocation also sets up metadata correctly.
5507 { 'enum': 'PreallocMode',
5508 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5511 # @BLOCK_WRITE_THRESHOLD:
5513 # Emitted when writes on block device reaches or exceeds the
5514 # configured write threshold. For thin-provisioned devices, this
5515 # means the device should be extended to avoid pausing for
5517 # The event is one shot. Once triggered, it needs to be
5518 # re-registered with another block-set-write-threshold command.
5520 # @node-name: graph node name on which the threshold was exceeded.
5522 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5524 # @write-threshold: last configured threshold, in bytes.
5528 { 'event': 'BLOCK_WRITE_THRESHOLD',
5529 'data': { 'node-name': 'str',
5530 'amount-exceeded': 'uint64',
5531 'write-threshold': 'uint64' } }
5534 # @block-set-write-threshold:
5536 # Change the write threshold for a block drive. An event will be
5537 # delivered if a write to this block drive crosses the configured
5538 # threshold. The threshold is an offset, thus must be
5539 # non-negative. Default is no write threshold. Setting the threshold
5540 # to zero disables it.
5542 # This is useful to transparently resize thin-provisioned drives without
5543 # the guest OS noticing.
5545 # @node-name: graph node name on which the threshold must be set.
5547 # @write-threshold: configured threshold for the block device, bytes.
5548 # Use 0 to disable the threshold.
5554 # -> { "execute": "block-set-write-threshold",
5555 # "arguments": { "node-name": "mydev",
5556 # "write-threshold": 17179869184 } }
5557 # <- { "return": {} }
5560 { 'command': 'block-set-write-threshold',
5561 'data': { 'node-name': 'str', 'write-threshold': 'uint64' },
5562 'allow-preconfig': true }
5565 # @x-blockdev-change:
5567 # Dynamically reconfigure the block driver state graph. It can be used
5568 # to add, remove, insert or replace a graph node. Currently only the
5569 # Quorum driver implements this feature to add or remove its child. This
5570 # is useful to fix a broken quorum child.
5572 # If @node is specified, it will be inserted under @parent. @child
5573 # may not be specified in this case. If both @parent and @child are
5574 # specified but @node is not, @child will be detached from @parent.
5576 # @parent: the id or name of the parent node.
5578 # @child: the name of a child under the given parent node.
5580 # @node: the name of the node that will be added.
5583 # @unstable: This command is experimental, and its API is not stable. It
5584 # does not support all kinds of operations, all kinds of
5585 # children, nor all block drivers.
5587 # FIXME Removing children from a quorum node means introducing
5588 # gaps in the child indices. This cannot be represented in the
5589 # 'children' list of BlockdevOptionsQuorum, as returned by
5590 # .bdrv_refresh_filename().
5592 # Warning: The data in a new quorum child MUST be consistent
5593 # with that of the rest of the array.
5599 # 1. Add a new node to a quorum
5600 # -> { "execute": "blockdev-add",
5603 # "node-name": "new_node",
5604 # "file": { "driver": "file",
5605 # "filename": "test.raw" } } }
5606 # <- { "return": {} }
5607 # -> { "execute": "x-blockdev-change",
5608 # "arguments": { "parent": "disk1",
5609 # "node": "new_node" } }
5610 # <- { "return": {} }
5612 # 2. Delete a quorum's node
5613 # -> { "execute": "x-blockdev-change",
5614 # "arguments": { "parent": "disk1",
5615 # "child": "children.1" } }
5616 # <- { "return": {} }
5619 { 'command': 'x-blockdev-change',
5620 'data' : { 'parent': 'str',
5623 'features': [ 'unstable' ],
5624 'allow-preconfig': true }
5627 # @x-blockdev-set-iothread:
5629 # Move @node and its children into the @iothread. If @iothread is null then
5630 # move @node and its children into the main loop.
5632 # The node must not be attached to a BlockBackend.
5634 # @node-name: the name of the block driver node
5636 # @iothread: the name of the IOThread object or null for the main loop
5638 # @force: true if the node and its children should be moved when a BlockBackend
5639 # is already attached
5642 # @unstable: This command is experimental and intended for test cases that
5643 # need control over IOThreads only.
5649 # 1. Move a node into an IOThread
5650 # -> { "execute": "x-blockdev-set-iothread",
5651 # "arguments": { "node-name": "disk1",
5652 # "iothread": "iothread0" } }
5653 # <- { "return": {} }
5655 # 2. Move a node into the main loop
5656 # -> { "execute": "x-blockdev-set-iothread",
5657 # "arguments": { "node-name": "disk1",
5658 # "iothread": null } }
5659 # <- { "return": {} }
5662 { 'command': 'x-blockdev-set-iothread',
5663 'data' : { 'node-name': 'str',
5664 'iothread': 'StrOrNull',
5666 'features': [ 'unstable' ],
5667 'allow-preconfig': true }
5672 # An enumeration of the quorum operation types
5674 # @read: read operation
5676 # @write: write operation
5678 # @flush: flush operation
5682 { 'enum': 'QuorumOpType',
5683 'data': [ 'read', 'write', 'flush' ] }
5688 # Emitted by the Quorum block driver if it fails to establish a quorum
5690 # @reference: device name if defined else node name
5692 # @sector-num: number of the first sector of the failed read operation
5694 # @sectors-count: failed read operation sector count
5696 # Note: This event is rate-limited.
5702 # <- { "event": "QUORUM_FAILURE",
5703 # "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
5704 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5707 { 'event': 'QUORUM_FAILURE',
5708 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
5711 # @QUORUM_REPORT_BAD:
5713 # Emitted to report a corruption of a Quorum file
5715 # @type: quorum operation type (Since 2.6)
5717 # @error: error message. Only present on failure. This field
5718 # contains a human-readable error message. There are no semantics other
5719 # than that the block layer reported an error and clients should not
5720 # try to interpret the error string.
5722 # @node-name: the graph node name of the block driver state
5724 # @sector-num: number of the first sector of the failed read operation
5726 # @sectors-count: failed read operation sector count
5728 # Note: This event is rate-limited.
5736 # <- { "event": "QUORUM_REPORT_BAD",
5737 # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
5739 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5741 # 2. Flush operation
5743 # <- { "event": "QUORUM_REPORT_BAD",
5744 # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
5745 # "type": "flush", "error": "Broken pipe" },
5746 # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
5749 { 'event': 'QUORUM_REPORT_BAD',
5750 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
5751 'sector-num': 'int', 'sectors-count': 'int' } }
5754 # @BlockdevSnapshotInternal:
5756 # @device: the device name or node-name of a root node to generate the snapshot
5759 # @name: the name of the internal snapshot to be created
5761 # Notes: In transaction, if @name is empty, or any snapshot matching @name
5762 # exists, the operation will fail. Only some image formats support it,
5763 # for example, qcow2, and rbd.
5767 { 'struct': 'BlockdevSnapshotInternal',
5768 'data': { 'device': 'str', 'name': 'str' } }
5771 # @blockdev-snapshot-internal-sync:
5773 # Synchronously take an internal snapshot of a block device, when the
5774 # format of the image used supports it. If the name is an empty
5775 # string, or a snapshot with name already exists, the operation will
5778 # For the arguments, see the documentation of BlockdevSnapshotInternal.
5780 # Returns: - nothing on success
5781 # - If @device is not a valid block device, GenericError
5782 # - If any snapshot matching @name exists, or @name is empty,
5784 # - If the format of the image used does not support it,
5791 # -> { "execute": "blockdev-snapshot-internal-sync",
5792 # "arguments": { "device": "ide-hd0",
5793 # "name": "snapshot0" }
5795 # <- { "return": {} }
5798 { 'command': 'blockdev-snapshot-internal-sync',
5799 'data': 'BlockdevSnapshotInternal',
5800 'allow-preconfig': true }
5803 # @blockdev-snapshot-delete-internal-sync:
5805 # Synchronously delete an internal snapshot of a block device, when the format
5806 # of the image used support it. The snapshot is identified by name or id or
5807 # both. One of the name or id is required. Return SnapshotInfo for the
5808 # successfully deleted snapshot.
5810 # @device: the device name or node-name of a root node to delete the snapshot
5813 # @id: optional the snapshot's ID to be deleted
5815 # @name: optional the snapshot's name to be deleted
5817 # Returns: - SnapshotInfo on success
5818 # - If @device is not a valid block device, GenericError
5819 # - If snapshot not found, GenericError
5820 # - If the format of the image used does not support it,
5822 # - If @id and @name are both not specified, GenericError
5828 # -> { "execute": "blockdev-snapshot-delete-internal-sync",
5829 # "arguments": { "device": "ide-hd0",
5830 # "name": "snapshot0" }
5834 # "name": "snapshot0",
5835 # "vm-state-size": 0,
5836 # "date-sec": 1000012,
5838 # "vm-clock-sec": 100,
5839 # "vm-clock-nsec": 20,
5845 { 'command': 'blockdev-snapshot-delete-internal-sync',
5846 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
5847 'returns': 'SnapshotInfo',
5848 'allow-preconfig': true }
5851 # @DummyBlockCoreForceArrays:
5853 # Not used by QMP; hack to let us use BlockGraphInfoList internally
5857 { 'struct': 'DummyBlockCoreForceArrays',
5858 'data': { 'unused-block-graph-info': ['BlockGraphInfo'] } }