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': ['ImageInfo']
131 # @ImageInfoSpecific:
133 # A discriminated record of image format specific information structures.
137 { 'union': 'ImageInfoSpecific',
139 'qcow2': 'ImageInfoSpecificQCow2',
140 'vmdk': 'ImageInfoSpecificVmdk',
141 # If we need to add block driver specific parameters for
142 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
143 # to define a ImageInfoSpecificLUKS
144 'luks': 'QCryptoBlockInfoLUKS'
150 # Information about a QEMU image file
152 # @filename: name of the image file
154 # @format: format of the image file
156 # @virtual-size: maximum capacity in bytes of the image
158 # @actual-size: actual size on disk in bytes of the image
160 # @dirty-flag: true if image is not cleanly closed
162 # @cluster-size: size of a cluster in bytes
164 # @encrypted: true if the image is encrypted
166 # @compressed: true if the image is compressed (Since 1.7)
168 # @backing-filename: name of the backing file
170 # @full-backing-filename: full path of the backing file
172 # @backing-filename-format: the format of the backing file
174 # @snapshots: list of VM snapshots
176 # @backing-image: info of the backing image (since 1.6)
178 # @format-specific: structure supplying additional format-specific
179 # information (since 1.7)
184 { 'struct': 'ImageInfo',
185 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
186 '*actual-size': 'int', 'virtual-size': 'int',
187 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
188 '*backing-filename': 'str', '*full-backing-filename': 'str',
189 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
190 '*backing-image': 'ImageInfo',
191 '*format-specific': 'ImageInfoSpecific' } }
196 # Information about a QEMU image file check
198 # @filename: name of the image file checked
200 # @format: format of the image file checked
202 # @check-errors: number of unexpected errors occurred during check
204 # @image-end-offset: offset (in bytes) where the image ends, this
205 # field is present if the driver for the image format
208 # @corruptions: number of corruptions found during the check if any
210 # @leaks: number of leaks found during the check if any
212 # @corruptions-fixed: number of corruptions fixed during the check
215 # @leaks-fixed: number of leaks fixed during the check if any
217 # @total-clusters: total number of clusters, this field is present
218 # if the driver for the image format supports it
220 # @allocated-clusters: total number of allocated clusters, this
221 # field is present if the driver for the image format
224 # @fragmented-clusters: total number of fragmented clusters, this
225 # field is present if the driver for the image format
228 # @compressed-clusters: total number of compressed clusters, this
229 # field is present if the driver for the image format
235 { 'struct': 'ImageCheck',
236 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
237 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
238 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
239 '*total-clusters': 'int', '*allocated-clusters': 'int',
240 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
245 # Mapping information from a virtual block range to a host file range
247 # @start: the start byte of the mapped virtual range
249 # @length: the number of bytes of the mapped virtual range
251 # @data: whether the mapped range has data
253 # @zero: whether the virtual blocks are zeroed
255 # @depth: the depth of the mapping
257 # @offset: the offset in file that the virtual sectors are mapped to
259 # @filename: filename that is referred to by @offset
264 { 'struct': 'MapEntry',
265 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
266 'zero': 'bool', 'depth': 'int', '*offset': 'int',
267 '*filename': 'str' } }
270 # @BlockdevCacheInfo:
272 # Cache mode information for a block device
274 # @writeback: true if writeback mode is enabled
275 # @direct: true if the host page cache is bypassed (O_DIRECT)
276 # @no-flush: true if flush requests are ignored for the device
280 { 'struct': 'BlockdevCacheInfo',
281 'data': { 'writeback': 'bool',
283 'no-flush': 'bool' } }
288 # Information about the backing device for a block device.
290 # @file: the filename of the backing device
292 # @node-name: the name of the block driver node (Since 2.0)
294 # @ro: true if the backing device was open read-only
296 # @drv: the name of the block format used to open the backing device. As of
297 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
298 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
299 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
300 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
301 # 2.2: 'archipelago' added, 'cow' dropped
302 # 2.3: 'host_floppy' deprecated
303 # 2.5: 'host_floppy' dropped
305 # 2.8: 'replication' added, 'tftp' dropped
306 # 2.9: 'archipelago' dropped
308 # @backing_file: the name of the backing file (for copy-on-write)
310 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
312 # @encrypted: true if the backing device is encrypted
314 # @encryption_key_missing: always false
316 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
318 # @bps: total throughput limit in bytes per second is specified
320 # @bps_rd: read throughput limit in bytes per second is specified
322 # @bps_wr: write throughput limit in bytes per second is specified
324 # @iops: total I/O operations per second is specified
326 # @iops_rd: read I/O operations per second is specified
328 # @iops_wr: write I/O operations per second is specified
330 # @image: the info of image used (since: 1.6)
332 # @bps_max: total throughput limit during bursts,
333 # in bytes (Since 1.7)
335 # @bps_rd_max: read throughput limit during bursts,
336 # in bytes (Since 1.7)
338 # @bps_wr_max: write throughput limit during bursts,
339 # in bytes (Since 1.7)
341 # @iops_max: total I/O operations per second during bursts,
342 # in bytes (Since 1.7)
344 # @iops_rd_max: read I/O operations per second during bursts,
345 # in bytes (Since 1.7)
347 # @iops_wr_max: write I/O operations per second during bursts,
348 # in bytes (Since 1.7)
350 # @bps_max_length: maximum length of the @bps_max burst
351 # period, in seconds. (Since 2.6)
353 # @bps_rd_max_length: maximum length of the @bps_rd_max
354 # burst period, in seconds. (Since 2.6)
356 # @bps_wr_max_length: maximum length of the @bps_wr_max
357 # burst period, in seconds. (Since 2.6)
359 # @iops_max_length: maximum length of the @iops burst
360 # period, in seconds. (Since 2.6)
362 # @iops_rd_max_length: maximum length of the @iops_rd_max
363 # burst period, in seconds. (Since 2.6)
365 # @iops_wr_max_length: maximum length of the @iops_wr_max
366 # burst period, in seconds. (Since 2.6)
368 # @iops_size: an I/O size in bytes (Since 1.7)
370 # @group: throttle group name (Since 2.4)
372 # @cache: the cache mode used for the block device (since: 2.3)
374 # @write_threshold: configured write threshold for the device.
375 # 0 if disabled. (Since 2.3)
377 # @dirty-bitmaps: dirty bitmaps information (only present if node
378 # has one or more dirty bitmaps) (Since 4.2)
381 # @deprecated: Member @encryption_key_missing is deprecated. It is
387 { 'struct': 'BlockDeviceInfo',
388 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
389 '*backing_file': 'str', 'backing_file_depth': 'int',
391 'encryption_key_missing': { 'type': 'bool',
392 'features': [ 'deprecated' ] },
393 'detect_zeroes': 'BlockdevDetectZeroesOptions',
394 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
395 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
396 'image': 'ImageInfo',
397 '*bps_max': 'int', '*bps_rd_max': 'int',
398 '*bps_wr_max': 'int', '*iops_max': 'int',
399 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
400 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
401 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
402 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
403 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
404 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
407 # @BlockDeviceIoStatus:
409 # An enumeration of block device I/O status.
411 # @ok: The last I/O operation has succeeded
413 # @failed: The last I/O operation has failed
415 # @nospace: The last I/O operation has failed due to a no-space condition
419 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
422 # @BlockDeviceMapEntry:
424 # Entry in the metadata map of the device (returned by "qemu-img map")
426 # @start: Offset in the image of the first byte described by this entry
429 # @length: Length of the range described by this entry (in bytes)
431 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
432 # before reaching one for which the range is allocated. The value is
433 # in the range 0 to the depth of the image chain - 1.
435 # @zero: the sectors in this range read as zeros
437 # @data: reading the image will actually read data from a file (in particular,
438 # if @offset is present this means that the sectors are not simply
439 # preallocated, but contain actual data in raw format)
441 # @offset: if present, the image file stores the data for this range in
442 # raw format at the given offset.
446 { 'struct': 'BlockDeviceMapEntry',
447 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
448 'data': 'bool', '*offset': 'int' } }
451 # @DirtyBitmapStatus:
453 # An enumeration of possible states that a dirty bitmap can report to the user.
455 # @frozen: The bitmap is currently in-use by some operation and is immutable.
456 # If the bitmap was @active prior to the operation, new writes by the
457 # guest are being recorded in a temporary buffer, and will not be lost.
458 # Generally, bitmaps are cleared on successful use in an operation and
459 # the temporary buffer is committed into the bitmap. On failure, the
460 # temporary buffer is merged back into the bitmap without first
462 # Please refer to the documentation for each bitmap-using operation,
463 # See also @blockdev-backup, @drive-backup.
465 # @disabled: The bitmap is not currently recording new writes by the guest.
466 # This is requested explicitly via @block-dirty-bitmap-disable.
467 # It can still be cleared, deleted, or used for backup operations.
469 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
470 # deleted, or used for backup operations.
472 # @locked: The bitmap is currently in-use by some operation and is immutable.
473 # If the bitmap was @active prior to the operation, it is still
474 # recording new writes. If the bitmap was @disabled, it is not
475 # recording new writes. (Since 2.12)
477 # @inconsistent: This is a persistent dirty bitmap that was marked in-use on
478 # disk, and is unusable by QEMU. It can only be deleted.
479 # Please rely on the inconsistent field in @BlockDirtyInfo
480 # instead, as the status field is deprecated. (Since 4.0)
484 { 'enum': 'DirtyBitmapStatus',
485 'data': ['active', 'disabled', 'frozen', 'locked', 'inconsistent'] }
490 # Block dirty bitmap information.
492 # @name: the name of the dirty bitmap (Since 2.4)
494 # @count: number of dirty bytes according to the dirty bitmap
496 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
498 # @status: current status of the dirty bitmap (since 2.4)
500 # @recording: true if the bitmap is recording new writes from the guest.
501 # Replaces `active` and `disabled` statuses. (since 4.0)
503 # @busy: true if the bitmap is in-use by some operation (NBD or jobs)
504 # and cannot be modified via QMP or used by another operation.
505 # Replaces `locked` and `frozen` statuses. (since 4.0)
507 # @persistent: true if the bitmap was stored on disk, is scheduled to be stored
508 # on disk, or both. (since 4.0)
510 # @inconsistent: true if this is a persistent bitmap that was improperly
511 # stored. Implies @persistent to be true; @recording and
512 # @busy to be false. This bitmap cannot be used. To remove
513 # it, use @block-dirty-bitmap-remove. (Since 4.0)
516 # @deprecated: Member @status is deprecated. Use @recording and
521 { 'struct': 'BlockDirtyInfo',
522 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
523 'recording': 'bool', 'busy': 'bool',
524 'status': { 'type': 'DirtyBitmapStatus',
525 'features': [ 'deprecated' ] },
526 'persistent': 'bool', '*inconsistent': 'bool' } }
529 # @Qcow2BitmapInfoFlags:
531 # An enumeration of flags that a bitmap can report to the user.
533 # @in-use: This flag is set by any process actively modifying the qcow2 file,
534 # and cleared when the updated bitmap is flushed to the qcow2 image.
535 # The presence of this flag in an offline image means that the bitmap
536 # was not saved correctly after its last usage, and may contain
539 # @auto: The bitmap must reflect all changes of the virtual disk by any
540 # application that would write to this qcow2 file.
544 { 'enum': 'Qcow2BitmapInfoFlags',
545 'data': ['in-use', 'auto'] }
550 # Qcow2 bitmap information.
552 # @name: the name of the bitmap
554 # @granularity: granularity of the bitmap in bytes
556 # @flags: flags of the bitmap
560 { 'struct': 'Qcow2BitmapInfo',
561 'data': {'name': 'str', 'granularity': 'uint32',
562 'flags': ['Qcow2BitmapInfoFlags'] } }
565 # @BlockLatencyHistogramInfo:
567 # Block latency histogram.
569 # @boundaries: list of interval boundary values in nanoseconds, all greater
570 # than zero and in ascending order.
571 # For example, the list [10, 50, 100] produces the following
572 # histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
574 # @bins: list of io request counts corresponding to histogram intervals.
575 # len(@bins) = len(@boundaries) + 1
576 # For the example above, @bins may be something like [3, 1, 5, 2],
577 # and corresponding histogram looks like:
586 # +------------------
591 { 'struct': 'BlockLatencyHistogramInfo',
592 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
597 # Block device information. This structure describes a virtual device and
598 # the backing device associated with it.
600 # @device: The device name associated with the virtual device.
602 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
603 # device. (since 2.10)
605 # @type: This field is returned only for compatibility reasons, it should
606 # not be used (always returns 'unknown')
608 # @removable: True if the device supports removable media.
610 # @locked: True if the guest has locked this device from having its media
613 # @tray_open: True if the device's tray is open
614 # (only present if it has a tray)
616 # @dirty-bitmaps: dirty bitmaps information (only present if the
617 # driver has one or more dirty bitmaps) (Since 2.0)
619 # @io-status: @BlockDeviceIoStatus. Only present if the device
620 # supports it and the VM is configured to stop on errors
621 # (supported device models: virtio-blk, IDE, SCSI except
624 # @inserted: @BlockDeviceInfo describing the device if media is
628 # @deprecated: Member @dirty-bitmaps is deprecated. Use @inserted
629 # member @dirty-bitmaps instead.
633 { 'struct': 'BlockInfo',
634 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
635 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
636 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
637 '*dirty-bitmaps': { 'type': ['BlockDirtyInfo'],
638 'features': [ 'deprecated' ] } } }
643 # Image file size calculation information. This structure describes the size
644 # requirements for creating a new image file.
646 # The size requirements depend on the new image file format. File size always
647 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
648 # Compact formats such as 'qcow2' represent unallocated and zero regions
649 # efficiently so file size may be smaller than virtual disk size.
651 # The values are upper bounds that are guaranteed to fit the new image file.
652 # Subsequent modification, such as internal snapshot or further bitmap
653 # creation, may require additional space and is not covered here.
655 # @required: Size required for a new image file, in bytes, when copying just
656 # allocated guest-visible contents.
658 # @fully-allocated: Image file size, in bytes, once data has been written
659 # to all sectors, when copying just guest-visible contents.
661 # @bitmaps: Additional size required if all the top-level bitmap metadata
662 # in the source image were to be copied to the destination,
663 # present only when source and destination both support
664 # persistent bitmaps. (since 5.1)
668 { 'struct': 'BlockMeasureInfo',
669 'data': {'required': 'int', 'fully-allocated': 'int', '*bitmaps': 'int'} }
674 # Get a list of BlockInfo for all virtual block devices.
676 # Returns: a list of @BlockInfo describing each virtual block device. Filter
677 # nodes that were created implicitly are skipped over.
683 # -> { "execute": "query-block" }
688 # "device":"ide0-hd0",
695 # "file":"disks/test.qcow2",
696 # "backing_file_depth":1,
703 # "bps_max": 8000000,
710 # "detect_zeroes": "on",
711 # "write_threshold": 0,
713 # "filename":"disks/test.qcow2",
715 # "virtual-size":2048000,
716 # "backing_file":"base.qcow2",
717 # "full-backing-filename":"disks/base.qcow2",
718 # "backing-filename-format":"qcow2",
722 # "name": "snapshot1",
723 # "vm-state-size": 0,
724 # "date-sec": 10000200,
726 # "vm-clock-sec": 206,
727 # "vm-clock-nsec": 30
731 # "filename":"disks/base.qcow2",
733 # "virtual-size":2048000
737 # "qdev": "ide_disk",
742 # "device":"ide1-cd0",
745 # "qdev": "/machine/unattached/device[23]",
746 # "tray_open": false,
750 # "device":"floppy0",
753 # "qdev": "/machine/unattached/device[20]",
766 { 'command': 'query-block', 'returns': ['BlockInfo'] }
770 # @BlockDeviceTimedStats:
772 # Statistics of a block device during a given interval of time.
774 # @interval_length: Interval used for calculating the statistics,
777 # @min_rd_latency_ns: Minimum latency of read operations in the
778 # defined interval, in nanoseconds.
780 # @min_wr_latency_ns: Minimum latency of write operations in the
781 # defined interval, in nanoseconds.
783 # @min_flush_latency_ns: Minimum latency of flush operations in the
784 # defined interval, in nanoseconds.
786 # @max_rd_latency_ns: Maximum latency of read operations in the
787 # defined interval, in nanoseconds.
789 # @max_wr_latency_ns: Maximum latency of write operations in the
790 # defined interval, in nanoseconds.
792 # @max_flush_latency_ns: Maximum latency of flush operations in the
793 # defined interval, in nanoseconds.
795 # @avg_rd_latency_ns: Average latency of read operations in the
796 # defined interval, in nanoseconds.
798 # @avg_wr_latency_ns: Average latency of write operations in the
799 # defined interval, in nanoseconds.
801 # @avg_flush_latency_ns: Average latency of flush operations in the
802 # defined interval, in nanoseconds.
804 # @avg_rd_queue_depth: Average number of pending read operations
805 # in the defined interval.
807 # @avg_wr_queue_depth: Average number of pending write operations
808 # in the defined interval.
812 { 'struct': 'BlockDeviceTimedStats',
813 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
814 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
815 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
816 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
817 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
818 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
823 # Statistics of a virtual block device or a block backing device.
825 # @rd_bytes: The number of bytes read by the device.
827 # @wr_bytes: The number of bytes written by the device.
829 # @unmap_bytes: The number of bytes unmapped by the device (Since 4.2)
831 # @rd_operations: The number of read operations performed by the device.
833 # @wr_operations: The number of write operations performed by the device.
835 # @flush_operations: The number of cache flush operations performed by the
836 # device (since 0.15.0)
838 # @unmap_operations: The number of unmap operations performed by the device
841 # @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15.0).
843 # @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15.0).
845 # @flush_total_time_ns: Total time spent on cache flushes in nanoseconds
848 # @unmap_total_time_ns: Total time spent on unmap operations in nanoseconds
851 # @wr_highest_offset: The offset after the greatest byte written to the
852 # device. The intended use of this information is for
853 # growable sparse files (like qcow2) that are used on top
854 # of a physical device.
856 # @rd_merged: Number of read requests that have been merged into another
857 # request (Since 2.3).
859 # @wr_merged: Number of write requests that have been merged into another
860 # request (Since 2.3).
862 # @unmap_merged: Number of unmap requests that have been merged into another
863 # request (Since 4.2)
865 # @idle_time_ns: Time since the last I/O operation, in
866 # nanoseconds. If the field is absent it means that
867 # there haven't been any operations yet (Since 2.5).
869 # @failed_rd_operations: The number of failed read operations
870 # performed by the device (Since 2.5)
872 # @failed_wr_operations: The number of failed write operations
873 # performed by the device (Since 2.5)
875 # @failed_flush_operations: The number of failed flush operations
876 # performed by the device (Since 2.5)
878 # @failed_unmap_operations: The number of failed unmap operations performed
879 # by the device (Since 4.2)
881 # @invalid_rd_operations: The number of invalid read operations
882 # performed by the device (Since 2.5)
884 # @invalid_wr_operations: The number of invalid write operations
885 # performed by the device (Since 2.5)
887 # @invalid_flush_operations: The number of invalid flush operations
888 # performed by the device (Since 2.5)
890 # @invalid_unmap_operations: The number of invalid unmap operations performed
891 # by the device (Since 4.2)
893 # @account_invalid: Whether invalid operations are included in the
894 # last access statistics (Since 2.5)
896 # @account_failed: Whether failed operations are included in the
897 # latency and last access statistics (Since 2.5)
899 # @timed_stats: Statistics specific to the set of previously defined
900 # intervals of time (Since 2.5)
902 # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
904 # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
906 # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
910 { 'struct': 'BlockDeviceStats',
911 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int',
912 'rd_operations': 'int', 'wr_operations': 'int',
913 'flush_operations': 'int', 'unmap_operations': 'int',
914 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int',
915 'flush_total_time_ns': 'int', 'unmap_total_time_ns': 'int',
916 'wr_highest_offset': 'int',
917 'rd_merged': 'int', 'wr_merged': 'int', 'unmap_merged': 'int',
918 '*idle_time_ns': 'int',
919 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
920 'failed_flush_operations': 'int', 'failed_unmap_operations': 'int',
921 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int',
922 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int',
923 'account_invalid': 'bool', 'account_failed': 'bool',
924 'timed_stats': ['BlockDeviceTimedStats'],
925 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
926 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
927 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
930 # @BlockStatsSpecificFile:
932 # File driver statistics
934 # @discard-nb-ok: The number of successful discard operations performed by
937 # @discard-nb-failed: The number of failed discard operations performed by
940 # @discard-bytes-ok: The number of bytes discarded by the driver.
944 { 'struct': 'BlockStatsSpecificFile',
946 'discard-nb-ok': 'uint64',
947 'discard-nb-failed': 'uint64',
948 'discard-bytes-ok': 'uint64' } }
951 # @BlockStatsSpecificNvme:
953 # NVMe driver statistics
955 # @completion-errors: The number of completion errors.
957 # @aligned-accesses: The number of aligned accesses performed by
960 # @unaligned-accesses: The number of unaligned accesses performed by
965 { 'struct': 'BlockStatsSpecificNvme',
967 'completion-errors': 'uint64',
968 'aligned-accesses': 'uint64',
969 'unaligned-accesses': 'uint64' } }
972 # @BlockStatsSpecific:
974 # Block driver specific statistics
978 { 'union': 'BlockStatsSpecific',
979 'base': { 'driver': 'BlockdevDriver' },
980 'discriminator': 'driver',
982 'file': 'BlockStatsSpecificFile',
983 'host_device': 'BlockStatsSpecificFile',
984 'nvme': 'BlockStatsSpecificNvme' } }
989 # Statistics of a virtual block device or a block backing device.
991 # @device: If the stats are for a virtual block device, the name
992 # corresponding to the virtual block device.
994 # @node-name: The node name of the device. (Since 2.3)
996 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
997 # device. (since 3.0)
999 # @stats: A @BlockDeviceStats for the device.
1001 # @driver-specific: Optional driver-specific stats. (Since 4.2)
1003 # @parent: This describes the file block device if it has one.
1004 # Contains recursively the statistics of the underlying
1005 # protocol (e.g. the host file for a qcow2 image). If there is
1006 # no underlying protocol, this field is omitted
1008 # @backing: This describes the backing block device if it has one.
1013 { 'struct': 'BlockStats',
1014 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
1015 'stats': 'BlockDeviceStats',
1016 '*driver-specific': 'BlockStatsSpecific',
1017 '*parent': 'BlockStats',
1018 '*backing': 'BlockStats'} }
1021 # @query-blockstats:
1023 # Query the @BlockStats for all virtual block devices.
1025 # @query-nodes: If true, the command will query all the block nodes
1026 # that have a node name, in a list which will include "parent"
1027 # information, but not "backing".
1028 # If false or omitted, the behavior is as before - query all the
1029 # device backends, recursively including their "parent" and
1030 # "backing". Filter nodes that were created implicitly are
1031 # skipped over in this mode. (Since 2.3)
1033 # Returns: A list of @BlockStats for each virtual block devices.
1039 # -> { "execute": "query-blockstats" }
1043 # "device":"ide0-hd0",
1046 # "wr_highest_offset":3686448128,
1047 # "wr_bytes":9786368,
1048 # "wr_operations":751,
1049 # "rd_bytes":122567168,
1050 # "rd_operations":36772
1051 # "wr_total_times_ns":313253456
1052 # "rd_total_times_ns":3465673657
1053 # "flush_total_times_ns":49653
1054 # "flush_operations":61,
1057 # "idle_time_ns":2953431879,
1058 # "account_invalid":true,
1059 # "account_failed":false
1063 # "wr_highest_offset":2821110784,
1064 # "wr_bytes":9786368,
1065 # "wr_operations":692,
1066 # "rd_bytes":122739200,
1067 # "rd_operations":36604
1068 # "flush_operations":51,
1069 # "wr_total_times_ns":313253456
1070 # "rd_total_times_ns":3465673657
1071 # "flush_total_times_ns":49653,
1074 # "idle_time_ns":2953431879,
1075 # "account_invalid":true,
1076 # "account_failed":false
1078 # "qdev": "/machine/unattached/device[23]"
1081 # "device":"ide1-cd0",
1083 # "wr_highest_offset":0,
1085 # "wr_operations":0,
1088 # "flush_operations":0,
1089 # "wr_total_times_ns":0
1090 # "rd_total_times_ns":0
1091 # "flush_total_times_ns":0,
1094 # "account_invalid":false,
1095 # "account_failed":false
1097 # "qdev": "/machine/unattached/device[24]"
1100 # "device":"floppy0",
1102 # "wr_highest_offset":0,
1104 # "wr_operations":0,
1107 # "flush_operations":0,
1108 # "wr_total_times_ns":0
1109 # "rd_total_times_ns":0
1110 # "flush_total_times_ns":0,
1113 # "account_invalid":false,
1114 # "account_failed":false
1116 # "qdev": "/machine/unattached/device[16]"
1121 # "wr_highest_offset":0,
1123 # "wr_operations":0,
1126 # "flush_operations":0,
1127 # "wr_total_times_ns":0
1128 # "rd_total_times_ns":0
1129 # "flush_total_times_ns":0,
1132 # "account_invalid":false,
1133 # "account_failed":false
1140 { 'command': 'query-blockstats',
1141 'data': { '*query-nodes': 'bool' },
1142 'returns': ['BlockStats'] }
1147 # An enumeration of possible behaviors for errors on I/O operations.
1148 # The exact meaning depends on whether the I/O was initiated by a guest
1151 # @report: for guest operations, report the error to the guest;
1152 # for jobs, cancel the job
1154 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1155 # or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs retry
1156 # the failing request later and may still complete successfully. The
1157 # stream block job continues to stream and will complete with an
1160 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1162 # @stop: for guest operations, stop the virtual machine;
1163 # for jobs, pause the job
1165 # @auto: inherit the error handling policy of the backend (since: 2.7)
1169 { 'enum': 'BlockdevOnError',
1170 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1175 # An enumeration of possible behaviors for the initial synchronization
1176 # phase of storage mirroring.
1178 # @top: copies data in the topmost image to the destination
1180 # @full: copies data from all images to the destination
1182 # @none: only copy data written from now on
1184 # @incremental: only copy data described by the dirty bitmap. (since: 2.4)
1186 # @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
1187 # Behavior on completion is determined by the BitmapSyncMode.
1191 { 'enum': 'MirrorSyncMode',
1192 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1197 # An enumeration of possible behaviors for the synchronization of a bitmap
1198 # when used for data copy operations.
1200 # @on-success: The bitmap is only synced when the operation is successful.
1201 # This is the behavior always used for 'INCREMENTAL' backups.
1203 # @never: The bitmap is never synchronized with the operation, and is
1204 # treated solely as a read-only manifest of blocks to copy.
1206 # @always: The bitmap is always synchronized with the operation,
1207 # regardless of whether or not the operation was successful.
1211 { 'enum': 'BitmapSyncMode',
1212 'data': ['on-success', 'never', 'always'] }
1217 # An enumeration whose values tell the mirror block job when to
1218 # trigger writes to the target.
1220 # @background: copy data in background only.
1222 # @write-blocking: when data is written to the source, write it
1223 # (synchronously) to the target as well. In
1224 # addition, data is copied in background just like in
1229 { 'enum': 'MirrorCopyMode',
1230 'data': ['background', 'write-blocking'] }
1235 # Information about a long-running block device operation.
1237 # @type: the job type ('stream' for image streaming)
1239 # @device: The job identifier. Originally the device name but other
1240 # values are allowed since QEMU 2.7
1242 # @len: Estimated @offset value at the completion of the job. This value can
1243 # arbitrarily change while the job is running, in both directions.
1245 # @offset: Progress made until now. The unit is arbitrary and the value can
1246 # only meaningfully be used for the ratio of @offset to @len. The
1247 # value is monotonically increasing.
1249 # @busy: false if the job is known to be in a quiescent state, with
1250 # no pending I/O. Since 1.3.
1252 # @paused: whether the job is paused or, if @busy is true, will
1253 # pause itself as soon as possible. Since 1.3.
1255 # @speed: the rate limit, bytes per second
1257 # @io-status: the status of the job (since 1.3)
1259 # @ready: true if the job may be completed (since 2.2)
1261 # @status: Current job state/status (since 2.12)
1263 # @auto-finalize: Job will finalize itself when PENDING, moving to
1264 # the CONCLUDED state. (since 2.12)
1266 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1267 # state and disappearing from the query list. (since 2.12)
1269 # @error: Error information if the job did not complete successfully.
1270 # Not set if the job completed successfully. (since 2.12.1)
1274 { 'struct': 'BlockJobInfo',
1275 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1276 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1277 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1278 'status': 'JobStatus',
1279 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1283 # @query-block-jobs:
1285 # Return information about long-running block device operations.
1287 # Returns: a list of @BlockJobInfo for each active block job
1291 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1296 # This command sets the password of a block device that has not been open
1297 # with a password and requires one.
1299 # This command is now obsolete and will always return an error since 2.10
1302 { 'command': 'block_passwd',
1303 'data': { '*device': 'str',
1304 '*node-name': 'str',
1305 'password': 'str' } }
1310 # Resize a block image while a guest is running.
1312 # Either @device or @node-name must be set but not both.
1314 # @device: the name of the device to get the image resized
1316 # @node-name: graph node name to get the image resized (Since 2.0)
1318 # @size: new image size in bytes
1320 # Returns: - nothing on success
1321 # - If @device is not a valid block device, DeviceNotFound
1327 # -> { "execute": "block_resize",
1328 # "arguments": { "device": "scratch", "size": 1073741824 } }
1329 # <- { "return": {} }
1332 { 'command': 'block_resize',
1333 'data': { '*device': 'str',
1334 '*node-name': 'str',
1341 # An enumeration that tells QEMU how to set the backing file path in
1344 # @existing: QEMU should look for an existing image file.
1346 # @absolute-paths: QEMU should create a new image with absolute paths
1347 # for the backing file. If there is no backing file available, the new
1348 # image will not be backed either.
1352 { 'enum': 'NewImageMode',
1353 'data': [ 'existing', 'absolute-paths' ] }
1356 # @BlockdevSnapshotSync:
1358 # Either @device or @node-name must be set but not both.
1360 # @device: the name of the device to take a snapshot of.
1362 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1364 # @snapshot-file: the target of the new overlay image. If the file
1365 # exists, or if it is a device, the overlay will be created in the
1366 # existing file/device. Otherwise, a new file will be created.
1368 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1370 # @format: the format of the overlay image, default is 'qcow2'.
1372 # @mode: whether and how QEMU should create a new image, default is
1375 { 'struct': 'BlockdevSnapshotSync',
1376 'data': { '*device': 'str', '*node-name': 'str',
1377 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1378 '*format': 'str', '*mode': 'NewImageMode' } }
1381 # @BlockdevSnapshot:
1383 # @node: device or node name that will have a snapshot taken.
1385 # @overlay: reference to the existing block device that will become
1386 # the overlay of @node, as part of taking the snapshot.
1387 # It must not have a current backing file (this can be
1388 # achieved by passing "backing": null to blockdev-add).
1392 { 'struct': 'BlockdevSnapshot',
1393 'data': { 'node': 'str', 'overlay': 'str' } }
1398 # @job-id: identifier for the newly-created block job. If
1399 # omitted, the device name will be used. (Since 2.7)
1401 # @device: the device name or node-name of a root node which should be copied.
1403 # @sync: what parts of the disk image should be copied to the destination
1404 # (all the disk, only the sectors allocated in the topmost image, from a
1405 # dirty bitmap, or only new I/O).
1407 # @speed: the maximum speed, in bytes per second. The default is 0,
1410 # @bitmap: The name of a dirty bitmap to use.
1411 # Must be present if sync is "bitmap" or "incremental".
1412 # Can be present if sync is "full" or "top".
1413 # Must not be present otherwise.
1414 # (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1416 # @bitmap-mode: Specifies the type of data the bitmap should contain after
1417 # the operation concludes.
1418 # Must be present if a bitmap was provided,
1419 # Must NOT be present otherwise. (Since 4.2)
1421 # @compress: true to compress data, if the target format supports it.
1422 # (default: false) (since 2.8)
1424 # @on-source-error: the action to take on an error on the source,
1425 # default 'report'. 'stop' and 'enospc' can only be used
1426 # if the block device supports io-status (see BlockInfo).
1428 # @on-target-error: the action to take on an error on the target,
1429 # default 'report' (no limitations, since this applies to
1430 # a different block device than @device).
1432 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1433 # finished its work, waiting for @block-job-finalize before
1434 # making any block graph changes.
1435 # When true, this job will automatically
1436 # perform its abort or commit actions.
1437 # Defaults to true. (Since 2.12)
1439 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1440 # has completely ceased all work, and awaits @block-job-dismiss.
1441 # When true, this job will automatically disappear from the query
1442 # list without user intervention.
1443 # Defaults to true. (Since 2.12)
1445 # @filter-node-name: the node name that should be assigned to the
1446 # filter driver that the backup job inserts into the graph
1447 # above node specified by @drive. If this option is not given,
1448 # a node name is autogenerated. (Since: 4.2)
1450 # Note: @on-source-error and @on-target-error only affect background
1451 # I/O. If an error occurs during a guest write request, the device's
1452 # rerror/werror actions will be used.
1456 { 'struct': 'BackupCommon',
1457 'data': { '*job-id': 'str', 'device': 'str',
1458 'sync': 'MirrorSyncMode', '*speed': 'int',
1459 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1460 '*compress': 'bool',
1461 '*on-source-error': 'BlockdevOnError',
1462 '*on-target-error': 'BlockdevOnError',
1463 '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
1464 '*filter-node-name': 'str' } }
1469 # @target: the target of the new image. If the file exists, or if it
1470 # is a device, the existing file/device will be used as the new
1471 # destination. If it does not exist, a new file will be created.
1473 # @format: the format of the new destination, default is to
1474 # probe if @mode is 'existing', else the format of the source
1476 # @mode: whether and how QEMU should create a new image, default is
1481 { 'struct': 'DriveBackup',
1482 'base': 'BackupCommon',
1483 'data': { 'target': 'str',
1485 '*mode': 'NewImageMode' } }
1490 # @target: the device name or node-name of the backup target node.
1494 { 'struct': 'BlockdevBackup',
1495 'base': 'BackupCommon',
1496 'data': { 'target': 'str' } }
1499 # @blockdev-snapshot-sync:
1501 # Takes a synchronous snapshot of a block device.
1503 # For the arguments, see the documentation of BlockdevSnapshotSync.
1505 # Returns: - nothing on success
1506 # - If @device is not a valid block device, DeviceNotFound
1512 # -> { "execute": "blockdev-snapshot-sync",
1513 # "arguments": { "device": "ide-hd0",
1515 # "/some/place/my-image",
1516 # "format": "qcow2" } }
1517 # <- { "return": {} }
1520 { 'command': 'blockdev-snapshot-sync',
1521 'data': 'BlockdevSnapshotSync' }
1525 # @blockdev-snapshot:
1527 # Takes a snapshot of a block device.
1529 # Take a snapshot, by installing 'node' as the backing image of
1530 # 'overlay'. Additionally, if 'node' is associated with a block
1531 # device, the block device changes to using 'overlay' as its new active
1534 # For the arguments, see the documentation of BlockdevSnapshot.
1537 # @allow-write-only-overlay: If present, the check whether this operation is safe
1538 # was relaxed so that it can be used to change
1539 # backing file of a destination of a blockdev-mirror.
1546 # -> { "execute": "blockdev-add",
1547 # "arguments": { "driver": "qcow2",
1548 # "node-name": "node1534",
1549 # "file": { "driver": "file",
1550 # "filename": "hd1.qcow2" },
1551 # "backing": null } }
1553 # <- { "return": {} }
1555 # -> { "execute": "blockdev-snapshot",
1556 # "arguments": { "node": "ide-hd0",
1557 # "overlay": "node1534" } }
1558 # <- { "return": {} }
1561 { 'command': 'blockdev-snapshot',
1562 'data': 'BlockdevSnapshot',
1563 'features': [ 'allow-write-only-overlay' ] }
1566 # @change-backing-file:
1568 # Change the backing file in the image file metadata. This does not
1569 # cause QEMU to reopen the image file to reparse the backing filename
1570 # (it may, however, perform a reopen to change permissions from
1571 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1572 # into the image file metadata, and the QEMU internal strings are
1575 # @image-node-name: The name of the block driver state node of the
1576 # image to modify. The "device" argument is used
1577 # to verify "image-node-name" is in the chain
1578 # described by "device".
1580 # @device: The device name or node-name of the root node that owns
1583 # @backing-file: The string to write as the backing file. This
1584 # string is not validated, so care should be taken
1585 # when specifying the string or the image chain may
1586 # not be able to be reopened again.
1588 # Returns: - Nothing on success
1589 # - If "device" does not exist or cannot be determined, DeviceNotFound
1593 { 'command': 'change-backing-file',
1594 'data': { 'device': 'str', 'image-node-name': 'str',
1595 'backing-file': 'str' } }
1600 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1601 # writes data between 'top' and 'base' into 'base'.
1603 # If top == base, that is an error.
1604 # If top has no overlays on top of it, or if it is in use by a writer,
1605 # the job will not be completed by itself. The user needs to complete
1606 # the job with the block-job-complete command after getting the ready
1607 # event. (Since 2.0)
1609 # If the base image is smaller than top, then the base image will be
1610 # resized to be the same size as top. If top is smaller than the base
1611 # image, the base will not be truncated. If you want the base image
1612 # size to match the size of the smaller top, you can safely truncate
1613 # it yourself once the commit operation successfully completes.
1615 # @job-id: identifier for the newly-created block job. If
1616 # omitted, the device name will be used. (Since 2.7)
1618 # @device: the device name or node-name of a root node
1620 # @base-node: The node name of the backing image to write data into.
1621 # If not specified, this is the deepest backing image.
1624 # @base: Same as @base-node, except that it is a file name rather than a node
1625 # name. This must be the exact filename string that was used to open the
1626 # node; other strings, even if addressing the same file, are not
1629 # @top-node: The node name of the backing image within the image chain
1630 # which contains the topmost data to be committed down. If
1631 # not specified, this is the active layer. (since: 3.1)
1633 # @top: Same as @top-node, except that it is a file name rather than a node
1634 # name. This must be the exact filename string that was used to open the
1635 # node; other strings, even if addressing the same file, are not
1638 # @backing-file: The backing file string to write into the overlay
1639 # image of 'top'. If 'top' does not have an overlay
1640 # image, or if 'top' is in use by a writer, specifying
1641 # a backing file string is an error.
1643 # This filename is not validated. If a pathname string
1644 # is such that it cannot be resolved by QEMU, that
1645 # means that subsequent QMP or HMP commands must use
1646 # node-names for the image in question, as filename
1647 # lookup methods will fail.
1649 # If not specified, QEMU will automatically determine
1650 # the backing file string to use, or error out if
1651 # there is no obvious choice. Care should be taken
1652 # when specifying the string, to specify a valid
1653 # filename or protocol.
1656 # @speed: the maximum speed, in bytes per second
1658 # @on-error: the action to take on an error. 'ignore' means that the request
1659 # should be retried. (default: report; Since: 5.0)
1661 # @filter-node-name: the node name that should be assigned to the
1662 # filter driver that the commit job inserts into the graph
1663 # above @top. If this option is not given, a node name is
1664 # autogenerated. (Since: 2.9)
1666 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1667 # finished its work, waiting for @block-job-finalize before
1668 # making any block graph changes.
1669 # When true, this job will automatically
1670 # perform its abort or commit actions.
1671 # Defaults to true. (Since 3.1)
1673 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1674 # has completely ceased all work, and awaits @block-job-dismiss.
1675 # When true, this job will automatically disappear from the query
1676 # list without user intervention.
1677 # Defaults to true. (Since 3.1)
1680 # @deprecated: Members @base and @top are deprecated. Use @base-node
1681 # and @top-node instead.
1683 # Returns: - Nothing on success
1684 # - If @device does not exist, DeviceNotFound
1685 # - Any other error returns a GenericError.
1691 # -> { "execute": "block-commit",
1692 # "arguments": { "device": "virtio0",
1693 # "top": "/tmp/snap1.qcow2" } }
1694 # <- { "return": {} }
1697 { 'command': 'block-commit',
1698 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1699 '*base': { 'type': 'str', 'features': [ 'deprecated' ] },
1701 '*top': { 'type': 'str', 'features': [ 'deprecated' ] },
1702 '*backing-file': 'str', '*speed': 'int',
1703 '*on-error': 'BlockdevOnError',
1704 '*filter-node-name': 'str',
1705 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1710 # Start a point-in-time copy of a block device to a new destination. The
1711 # status of ongoing drive-backup operations can be checked with
1712 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1713 # The operation can be stopped before it has completed using the
1714 # block-job-cancel command.
1716 # Returns: - nothing on success
1717 # - If @device is not a valid block device, GenericError
1723 # -> { "execute": "drive-backup",
1724 # "arguments": { "device": "drive0",
1726 # "target": "backup.img" } }
1727 # <- { "return": {} }
1730 { 'command': 'drive-backup', 'boxed': true,
1731 'data': 'DriveBackup' }
1736 # Start a point-in-time copy of a block device to a new destination. The
1737 # status of ongoing blockdev-backup operations can be checked with
1738 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1739 # The operation can be stopped before it has completed using the
1740 # block-job-cancel command.
1742 # Returns: - nothing on success
1743 # - If @device is not a valid block device, DeviceNotFound
1748 # -> { "execute": "blockdev-backup",
1749 # "arguments": { "device": "src-id",
1751 # "target": "tgt-id" } }
1752 # <- { "return": {} }
1755 { 'command': 'blockdev-backup', 'boxed': true,
1756 'data': 'BlockdevBackup' }
1760 # @query-named-block-nodes:
1762 # Get the named block driver list
1764 # @flat: Omit the nested data about backing image ("backing-image" key) if true.
1765 # Default is false (Since 5.0)
1767 # Returns: the list of BlockDeviceInfo
1773 # -> { "execute": "query-named-block-nodes" }
1774 # <- { "return": [ { "ro":false,
1776 # "encrypted":false,
1777 # "file":"disks/test.qcow2",
1778 # "node-name": "my-node",
1779 # "backing_file_depth":1,
1786 # "bps_max": 8000000,
1793 # "write_threshold": 0,
1795 # "filename":"disks/test.qcow2",
1797 # "virtual-size":2048000,
1798 # "backing_file":"base.qcow2",
1799 # "full-backing-filename":"disks/base.qcow2",
1800 # "backing-filename-format":"qcow2",
1804 # "name": "snapshot1",
1805 # "vm-state-size": 0,
1806 # "date-sec": 10000200,
1808 # "vm-clock-sec": 206,
1809 # "vm-clock-nsec": 30
1813 # "filename":"disks/base.qcow2",
1815 # "virtual-size":2048000
1820 { 'command': 'query-named-block-nodes',
1821 'returns': [ 'BlockDeviceInfo' ],
1822 'data': { '*flat': 'bool' } }
1825 # @XDbgBlockGraphNodeType:
1827 # @block-backend: corresponds to BlockBackend
1829 # @block-job: corresponds to BlockJob
1831 # @block-driver: corresponds to BlockDriverState
1835 { 'enum': 'XDbgBlockGraphNodeType',
1836 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1839 # @XDbgBlockGraphNode:
1841 # @id: Block graph node identifier. This @id is generated only for
1842 # x-debug-query-block-graph and does not relate to any other identifiers in
1845 # @type: Type of graph node. Can be one of block-backend, block-job or
1846 # block-driver-state.
1848 # @name: Human readable name of the node. Corresponds to node-name for
1849 # block-driver-state nodes; is not guaranteed to be unique in the whole
1850 # graph (with block-jobs and block-backends).
1854 { 'struct': 'XDbgBlockGraphNode',
1855 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1860 # Enum of base block permissions.
1862 # @consistent-read: A user that has the "permission" of consistent reads is
1863 # guaranteed that their view of the contents of the block
1864 # device is complete and self-consistent, representing the
1865 # contents of a disk at a specific point.
1866 # For most block devices (including their backing files) this
1867 # is true, but the property cannot be maintained in a few
1868 # situations like for intermediate nodes of a commit block
1871 # @write: This permission is required to change the visible disk contents.
1873 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1874 # both enough and required for writes to the block node when
1875 # the caller promises that the visible disk content doesn't
1877 # As the BLK_PERM_WRITE permission is strictly stronger,
1878 # either is sufficient to perform an unchanging write.
1880 # @resize: This permission is required to change the size of a block node.
1882 # @graph-mod: This permission is required to change the node that this
1883 # BdrvChild points to.
1887 { 'enum': 'BlockPermission',
1888 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
1891 # @XDbgBlockGraphEdge:
1893 # Block Graph edge description for x-debug-query-block-graph.
1895 # @parent: parent id
1899 # @name: name of the relation (examples are 'file' and 'backing')
1901 # @perm: granted permissions for the parent operating on the child
1903 # @shared-perm: permissions that can still be granted to other users of the
1904 # child while it is still attached to this parent
1908 { 'struct': 'XDbgBlockGraphEdge',
1909 'data': { 'parent': 'uint64', 'child': 'uint64',
1910 'name': 'str', 'perm': [ 'BlockPermission' ],
1911 'shared-perm': [ 'BlockPermission' ] } }
1916 # Block Graph - list of nodes and list of edges.
1920 { 'struct': 'XDbgBlockGraph',
1921 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1924 # @x-debug-query-block-graph:
1926 # Get the block graph.
1930 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph' }
1935 # Start mirroring a block device's writes to a new destination. target
1936 # specifies the target of the new image. If the file exists, or if it
1937 # is a device, it will be used as the new destination for writes. If
1938 # it does not exist, a new file will be created. format specifies the
1939 # format of the mirror image, default is to probe if mode='existing',
1940 # else the format of the source.
1942 # Returns: - nothing on success
1943 # - If @device is not a valid block device, GenericError
1949 # -> { "execute": "drive-mirror",
1950 # "arguments": { "device": "ide-hd0",
1951 # "target": "/some/place/my-image",
1953 # "format": "qcow2" } }
1954 # <- { "return": {} }
1957 { 'command': 'drive-mirror', 'boxed': true,
1958 'data': 'DriveMirror' }
1963 # A set of parameters describing drive mirror setup.
1965 # @job-id: identifier for the newly-created block job. If
1966 # omitted, the device name will be used. (Since 2.7)
1968 # @device: the device name or node-name of a root node whose writes should be
1971 # @target: the target of the new image. If the file exists, or if it
1972 # is a device, the existing file/device will be used as the new
1973 # destination. If it does not exist, a new file will be created.
1975 # @format: the format of the new destination, default is to
1976 # probe if @mode is 'existing', else the format of the source
1978 # @node-name: the new block driver state node name in the graph
1981 # @replaces: with sync=full graph node name to be replaced by the new
1982 # image when a whole image copy is done. This can be used to repair
1983 # broken Quorum files. By default, @device is replaced, although
1984 # implicitly created filters on it are kept. (Since 2.1)
1986 # @mode: whether and how QEMU should create a new image, default is
1989 # @speed: the maximum speed, in bytes per second
1991 # @sync: what parts of the disk image should be copied to the destination
1992 # (all the disk, only the sectors allocated in the topmost image, or
1995 # @granularity: granularity of the dirty bitmap, default is 64K
1996 # if the image format doesn't have clusters, 4K if the clusters
1997 # are smaller than that, else the cluster size. Must be a
1998 # power of 2 between 512 and 64M (since 1.4).
2000 # @buf-size: maximum amount of data in flight from source to
2001 # target (since 1.4).
2003 # @on-source-error: the action to take on an error on the source,
2004 # default 'report'. 'stop' and 'enospc' can only be used
2005 # if the block device supports io-status (see BlockInfo).
2007 # @on-target-error: the action to take on an error on the target,
2008 # default 'report' (no limitations, since this applies to
2009 # a different block device than @device).
2010 # @unmap: Whether to try to unmap target sectors where source has
2011 # only zero. If true, and target unallocated sectors will read as zero,
2012 # target image sectors will be unmapped; otherwise, zeroes will be
2013 # written. Both will result in identical contents.
2014 # Default is true. (Since 2.4)
2016 # @copy-mode: when to copy data to the destination; defaults to 'background'
2019 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2020 # finished its work, waiting for @block-job-finalize before
2021 # making any block graph changes.
2022 # When true, this job will automatically
2023 # perform its abort or commit actions.
2024 # Defaults to true. (Since 3.1)
2026 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2027 # has completely ceased all work, and awaits @block-job-dismiss.
2028 # When true, this job will automatically disappear from the query
2029 # list without user intervention.
2030 # Defaults to true. (Since 3.1)
2033 { 'struct': 'DriveMirror',
2034 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2035 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
2036 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2037 '*speed': 'int', '*granularity': 'uint32',
2038 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2039 '*on-target-error': 'BlockdevOnError',
2040 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
2041 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2044 # @BlockDirtyBitmap:
2046 # @node: name of device/node which the bitmap is tracking
2048 # @name: name of the dirty bitmap
2052 { 'struct': 'BlockDirtyBitmap',
2053 'data': { 'node': 'str', 'name': 'str' } }
2056 # @BlockDirtyBitmapAdd:
2058 # @node: name of device/node which the bitmap is tracking
2060 # @name: name of the dirty bitmap (must be less than 1024 bytes)
2062 # @granularity: the bitmap granularity, default is 64k for
2063 # block-dirty-bitmap-add
2065 # @persistent: the bitmap is persistent, i.e. it will be saved to the
2066 # corresponding block device image file on its close. For now only
2067 # Qcow2 disks support persistent bitmaps. Default is false for
2068 # block-dirty-bitmap-add. (Since: 2.10)
2070 # @disabled: the bitmap is created in the disabled state, which means that
2071 # it will not track drive changes. The bitmap may be enabled with
2072 # block-dirty-bitmap-enable. Default is false. (Since: 4.0)
2076 { 'struct': 'BlockDirtyBitmapAdd',
2077 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
2078 '*persistent': 'bool', '*disabled': 'bool' } }
2081 # @BlockDirtyBitmapMergeSource:
2083 # @local: name of the bitmap, attached to the same node as target bitmap.
2085 # @external: bitmap with specified node
2089 { 'alternate': 'BlockDirtyBitmapMergeSource',
2090 'data': { 'local': 'str',
2091 'external': 'BlockDirtyBitmap' } }
2094 # @BlockDirtyBitmapMerge:
2096 # @node: name of device/node which the @target bitmap is tracking
2098 # @target: name of the destination dirty bitmap
2100 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully
2101 # specified BlockDirtyBitmap elements. The latter are supported
2106 { 'struct': 'BlockDirtyBitmapMerge',
2107 'data': { 'node': 'str', 'target': 'str',
2108 'bitmaps': ['BlockDirtyBitmapMergeSource'] } }
2111 # @block-dirty-bitmap-add:
2113 # Create a dirty bitmap with a name on the node, and start tracking the writes.
2115 # Returns: - nothing on success
2116 # - If @node is not a valid block device or node, DeviceNotFound
2117 # - If @name is already taken, GenericError with an explanation
2123 # -> { "execute": "block-dirty-bitmap-add",
2124 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2125 # <- { "return": {} }
2128 { 'command': 'block-dirty-bitmap-add',
2129 'data': 'BlockDirtyBitmapAdd' }
2132 # @block-dirty-bitmap-remove:
2134 # Stop write tracking and remove the dirty bitmap that was created
2135 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2138 # Returns: - nothing on success
2139 # - If @node is not a valid block device or node, DeviceNotFound
2140 # - If @name is not found, GenericError with an explanation
2141 # - if @name is frozen by an operation, GenericError
2147 # -> { "execute": "block-dirty-bitmap-remove",
2148 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2149 # <- { "return": {} }
2152 { 'command': 'block-dirty-bitmap-remove',
2153 'data': 'BlockDirtyBitmap' }
2156 # @block-dirty-bitmap-clear:
2158 # Clear (reset) a dirty bitmap on the device, so that an incremental
2159 # backup from this point in time forward will only backup clusters
2160 # modified after this clear operation.
2162 # Returns: - nothing on success
2163 # - If @node is not a valid block device, DeviceNotFound
2164 # - If @name is not found, GenericError with an explanation
2170 # -> { "execute": "block-dirty-bitmap-clear",
2171 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2172 # <- { "return": {} }
2175 { 'command': 'block-dirty-bitmap-clear',
2176 'data': 'BlockDirtyBitmap' }
2179 # @block-dirty-bitmap-enable:
2181 # Enables a dirty bitmap so that it will begin tracking disk changes.
2183 # Returns: - nothing on success
2184 # - If @node is not a valid block device, DeviceNotFound
2185 # - If @name is not found, GenericError with an explanation
2191 # -> { "execute": "block-dirty-bitmap-enable",
2192 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2193 # <- { "return": {} }
2196 { 'command': 'block-dirty-bitmap-enable',
2197 'data': 'BlockDirtyBitmap' }
2200 # @block-dirty-bitmap-disable:
2202 # Disables a dirty bitmap so that it will stop tracking disk changes.
2204 # Returns: - nothing on success
2205 # - If @node is not a valid block device, DeviceNotFound
2206 # - If @name is not found, GenericError with an explanation
2212 # -> { "execute": "block-dirty-bitmap-disable",
2213 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2214 # <- { "return": {} }
2217 { 'command': 'block-dirty-bitmap-disable',
2218 'data': 'BlockDirtyBitmap' }
2221 # @block-dirty-bitmap-merge:
2223 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2224 # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2225 # as the @target bitmap. Any bits already set in @target will still be
2226 # set after the merge, i.e., this operation does not clear the target.
2227 # On error, @target is unchanged.
2229 # The resulting bitmap will count as dirty any clusters that were dirty in any
2230 # of the source bitmaps. This can be used to achieve backup checkpoints, or in
2231 # simpler usages, to copy bitmaps.
2233 # Returns: - nothing on success
2234 # - If @node is not a valid block device, DeviceNotFound
2235 # - If any bitmap in @bitmaps or @target is not found, GenericError
2236 # - If any of the bitmaps have different sizes or granularities,
2243 # -> { "execute": "block-dirty-bitmap-merge",
2244 # "arguments": { "node": "drive0", "target": "bitmap0",
2245 # "bitmaps": ["bitmap1"] } }
2246 # <- { "return": {} }
2249 { 'command': 'block-dirty-bitmap-merge',
2250 'data': 'BlockDirtyBitmapMerge' }
2253 # @BlockDirtyBitmapSha256:
2255 # SHA256 hash of dirty bitmap data
2257 # @sha256: ASCII representation of SHA256 bitmap hash
2261 { 'struct': 'BlockDirtyBitmapSha256',
2262 'data': {'sha256': 'str'} }
2265 # @x-debug-block-dirty-bitmap-sha256:
2267 # Get bitmap SHA256.
2269 # Returns: - BlockDirtyBitmapSha256 on success
2270 # - If @node is not a valid block device, DeviceNotFound
2271 # - If @name is not found or if hashing has failed, GenericError with an
2276 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2277 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
2282 # Start mirroring a block device's writes to a new destination.
2284 # @job-id: identifier for the newly-created block job. If
2285 # omitted, the device name will be used. (Since 2.7)
2287 # @device: The device name or node-name of a root node whose writes should be
2290 # @target: the id or node-name of the block device to mirror to. This mustn't be
2291 # attached to guest.
2293 # @replaces: with sync=full graph node name to be replaced by the new
2294 # image when a whole image copy is done. This can be used to repair
2295 # broken Quorum files. By default, @device is replaced, although
2296 # implicitly created filters on it are kept.
2298 # @speed: the maximum speed, in bytes per second
2300 # @sync: what parts of the disk image should be copied to the destination
2301 # (all the disk, only the sectors allocated in the topmost image, or
2304 # @granularity: granularity of the dirty bitmap, default is 64K
2305 # if the image format doesn't have clusters, 4K if the clusters
2306 # are smaller than that, else the cluster size. Must be a
2307 # power of 2 between 512 and 64M
2309 # @buf-size: maximum amount of data in flight from source to
2312 # @on-source-error: the action to take on an error on the source,
2313 # default 'report'. 'stop' and 'enospc' can only be used
2314 # if the block device supports io-status (see BlockInfo).
2316 # @on-target-error: the action to take on an error on the target,
2317 # default 'report' (no limitations, since this applies to
2318 # a different block device than @device).
2320 # @filter-node-name: the node name that should be assigned to the
2321 # filter driver that the mirror job inserts into the graph
2322 # above @device. If this option is not given, a node name is
2323 # autogenerated. (Since: 2.9)
2325 # @copy-mode: when to copy data to the destination; defaults to 'background'
2328 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2329 # finished its work, waiting for @block-job-finalize before
2330 # making any block graph changes.
2331 # When true, this job will automatically
2332 # perform its abort or commit actions.
2333 # Defaults to true. (Since 3.1)
2335 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2336 # has completely ceased all work, and awaits @block-job-dismiss.
2337 # When true, this job will automatically disappear from the query
2338 # list without user intervention.
2339 # Defaults to true. (Since 3.1)
2340 # Returns: nothing on success.
2346 # -> { "execute": "blockdev-mirror",
2347 # "arguments": { "device": "ide-hd0",
2348 # "target": "target0",
2349 # "sync": "full" } }
2350 # <- { "return": {} }
2353 { 'command': 'blockdev-mirror',
2354 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2356 'sync': 'MirrorSyncMode',
2357 '*speed': 'int', '*granularity': 'uint32',
2358 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2359 '*on-target-error': 'BlockdevOnError',
2360 '*filter-node-name': 'str',
2361 '*copy-mode': 'MirrorCopyMode',
2362 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2367 # A set of parameters describing block throttling.
2369 # @device: Block device name
2371 # @id: The name or QOM path of the guest device (since: 2.8)
2373 # @bps: total throughput limit in bytes per second
2375 # @bps_rd: read throughput limit in bytes per second
2377 # @bps_wr: write throughput limit in bytes per second
2379 # @iops: total I/O operations per second
2381 # @iops_rd: read I/O operations per second
2383 # @iops_wr: write I/O operations per second
2385 # @bps_max: total throughput limit during bursts,
2386 # in bytes (Since 1.7)
2388 # @bps_rd_max: read throughput limit during bursts,
2389 # in bytes (Since 1.7)
2391 # @bps_wr_max: write throughput limit during bursts,
2392 # in bytes (Since 1.7)
2394 # @iops_max: total I/O operations per second during bursts,
2395 # in bytes (Since 1.7)
2397 # @iops_rd_max: read I/O operations per second during bursts,
2398 # in bytes (Since 1.7)
2400 # @iops_wr_max: write I/O operations per second during bursts,
2401 # in bytes (Since 1.7)
2403 # @bps_max_length: maximum length of the @bps_max burst
2404 # period, in seconds. It must only
2405 # be set if @bps_max is set as well.
2406 # Defaults to 1. (Since 2.6)
2408 # @bps_rd_max_length: maximum length of the @bps_rd_max
2409 # burst period, in seconds. It must only
2410 # be set if @bps_rd_max is set as well.
2411 # Defaults to 1. (Since 2.6)
2413 # @bps_wr_max_length: maximum length of the @bps_wr_max
2414 # burst period, in seconds. It must only
2415 # be set if @bps_wr_max is set as well.
2416 # Defaults to 1. (Since 2.6)
2418 # @iops_max_length: maximum length of the @iops burst
2419 # period, in seconds. It must only
2420 # be set if @iops_max is set as well.
2421 # Defaults to 1. (Since 2.6)
2423 # @iops_rd_max_length: maximum length of the @iops_rd_max
2424 # burst period, in seconds. It must only
2425 # be set if @iops_rd_max is set as well.
2426 # Defaults to 1. (Since 2.6)
2428 # @iops_wr_max_length: maximum length of the @iops_wr_max
2429 # burst period, in seconds. It must only
2430 # be set if @iops_wr_max is set as well.
2431 # Defaults to 1. (Since 2.6)
2433 # @iops_size: an I/O size in bytes (Since 1.7)
2435 # @group: throttle group name (Since 2.4)
2438 # @deprecated: Member @device is deprecated. Use @id instead.
2442 { 'struct': 'BlockIOThrottle',
2443 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
2444 '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2445 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2446 '*bps_max': 'int', '*bps_rd_max': 'int',
2447 '*bps_wr_max': 'int', '*iops_max': 'int',
2448 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2449 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2450 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2451 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2452 '*iops_size': 'int', '*group': 'str' } }
2457 # Limit parameters for throttling.
2458 # Since some limit combinations are illegal, limits should always be set in one
2459 # transaction. All fields are optional. When setting limits, if a field is
2460 # missing the current value is not changed.
2462 # @iops-total: limit total I/O operations per second
2463 # @iops-total-max: I/O operations burst
2464 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2465 # It must only be set if @iops-total-max is set as well.
2466 # @iops-read: limit read operations per second
2467 # @iops-read-max: I/O operations read burst
2468 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2469 # It must only be set if @iops-read-max is set as well.
2470 # @iops-write: limit write operations per second
2471 # @iops-write-max: I/O operations write burst
2472 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2473 # It must only be set if @iops-write-max is set as well.
2474 # @bps-total: limit total bytes per second
2475 # @bps-total-max: total bytes burst
2476 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2477 # It must only be set if @bps-total-max is set as well.
2478 # @bps-read: limit read bytes per second
2479 # @bps-read-max: total bytes read burst
2480 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2481 # It must only be set if @bps-read-max is set as well.
2482 # @bps-write: limit write bytes per second
2483 # @bps-write-max: total bytes write burst
2484 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2485 # It must only be set if @bps-write-max is set as well.
2486 # @iops-size: when limiting by iops max size of an I/O in bytes
2490 { 'struct': 'ThrottleLimits',
2491 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2492 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2493 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2494 '*iops-write' : 'int', '*iops-write-max' : 'int',
2495 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2496 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2497 '*bps-read' : 'int', '*bps-read-max' : 'int',
2498 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2499 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2500 '*iops-size' : 'int' } }
2505 # Copy data from a backing file into a block device.
2507 # The block streaming operation is performed in the background until the entire
2508 # backing file has been copied. This command returns immediately once streaming
2509 # has started. The status of ongoing block streaming operations can be checked
2510 # with query-block-jobs. The operation can be stopped before it has completed
2511 # using the block-job-cancel command.
2513 # The node that receives the data is called the top image, can be located in
2514 # any part of the chain (but always above the base image; see below) and can be
2515 # specified using its device or node name. Earlier qemu versions only allowed
2516 # 'device' to name the top level node; presence of the 'base-node' parameter
2517 # during introspection can be used as a witness of the enhanced semantics
2520 # If a base file is specified then sectors are not copied from that base file and
2521 # its backing chain. This can be used to stream a subset of the backing file
2522 # chain instead of flattening the entire image.
2523 # When streaming completes the image file will have the base file as its backing
2524 # file, unless that node was changed while the job was running. In that case,
2525 # base's parent's backing (or filtered, whichever exists) child (i.e., base at
2526 # the beginning of the job) will be the new backing file.
2528 # On successful completion the image file is updated to drop the backing file
2529 # and the BLOCK_JOB_COMPLETED event is emitted.
2531 # In case @device is a filter node, block-stream modifies the first non-filter
2532 # overlay node below it to point to the new backing node instead of modifying
2535 # @job-id: identifier for the newly-created block job. If
2536 # omitted, the device name will be used. (Since 2.7)
2538 # @device: the device or node name of the top image
2540 # @base: the common backing file name.
2541 # It cannot be set if @base-node is also set.
2543 # @base-node: the node name of the backing file.
2544 # It cannot be set if @base is also set. (Since 2.8)
2546 # @backing-file: The backing file string to write into the top
2547 # image. This filename is not validated.
2549 # If a pathname string is such that it cannot be
2550 # resolved by QEMU, that means that subsequent QMP or
2551 # HMP commands must use node-names for the image in
2552 # question, as filename lookup methods will fail.
2554 # If not specified, QEMU will automatically determine
2555 # the backing file string to use, or error out if there
2556 # is no obvious choice. Care should be taken when
2557 # specifying the string, to specify a valid filename or
2561 # @speed: the maximum speed, in bytes per second
2563 # @on-error: the action to take on an error (default report).
2564 # 'stop' and 'enospc' can only be used if the block device
2565 # supports io-status (see BlockInfo). Since 1.3.
2567 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2568 # finished its work, waiting for @block-job-finalize before
2569 # making any block graph changes.
2570 # When true, this job will automatically
2571 # perform its abort or commit actions.
2572 # Defaults to true. (Since 3.1)
2574 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2575 # has completely ceased all work, and awaits @block-job-dismiss.
2576 # When true, this job will automatically disappear from the query
2577 # list without user intervention.
2578 # Defaults to true. (Since 3.1)
2580 # Returns: - Nothing on success.
2581 # - If @device does not exist, DeviceNotFound.
2587 # -> { "execute": "block-stream",
2588 # "arguments": { "device": "virtio0",
2589 # "base": "/tmp/master.qcow2" } }
2590 # <- { "return": {} }
2593 { 'command': 'block-stream',
2594 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2595 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2596 '*on-error': 'BlockdevOnError',
2597 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2600 # @block-job-set-speed:
2602 # Set maximum speed for a background block operation.
2604 # This command can only be issued when there is an active block job.
2606 # Throttling can be disabled by setting the speed to 0.
2608 # @device: The job identifier. This used to be a device name (hence
2609 # the name of the parameter), but since QEMU 2.7 it can have
2612 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2615 # Returns: - Nothing on success
2616 # - If no background operation is active on this device, DeviceNotActive
2620 { 'command': 'block-job-set-speed',
2621 'data': { 'device': 'str', 'speed': 'int' } }
2624 # @block-job-cancel:
2626 # Stop an active background block operation.
2628 # This command returns immediately after marking the active background block
2629 # operation for cancellation. It is an error to call this command if no
2630 # operation is in progress.
2632 # The operation will cancel as soon as possible and then emit the
2633 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2634 # enumerated using query-block-jobs.
2636 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2637 # (via the event BLOCK_JOB_READY) that the source and destination are
2638 # synchronized, then the event triggered by this command changes to
2639 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2640 # destination now has a point-in-time copy tied to the time of the cancellation.
2642 # For streaming, the image file retains its backing file unless the streaming
2643 # operation happens to complete just as it is being cancelled. A new streaming
2644 # operation can be started at a later time to finish copying all data from the
2647 # @device: The job identifier. This used to be a device name (hence
2648 # the name of the parameter), but since QEMU 2.7 it can have
2651 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2652 # abandon the job immediately (even if it is paused) instead of waiting
2653 # for the destination to complete its final synchronization (since 1.3)
2655 # Returns: - Nothing on success
2656 # - If no background operation is active on this device, DeviceNotActive
2660 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2665 # Pause an active background block operation.
2667 # This command returns immediately after marking the active background block
2668 # operation for pausing. It is an error to call this command if no
2669 # operation is in progress or if the job is already paused.
2671 # The operation will pause as soon as possible. No event is emitted when
2672 # the operation is actually paused. Cancelling a paused job automatically
2675 # @device: The job identifier. This used to be a device name (hence
2676 # the name of the parameter), but since QEMU 2.7 it can have
2679 # Returns: - Nothing on success
2680 # - If no background operation is active on this device, DeviceNotActive
2684 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2687 # @block-job-resume:
2689 # Resume an active background block operation.
2691 # This command returns immediately after resuming a paused background block
2692 # operation. It is an error to call this command if no operation is in
2693 # progress or if the job is not paused.
2695 # This command also clears the error status of the job.
2697 # @device: The job identifier. This used to be a device name (hence
2698 # the name of the parameter), but since QEMU 2.7 it can have
2701 # Returns: - Nothing on success
2702 # - If no background operation is active on this device, DeviceNotActive
2706 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2709 # @block-job-complete:
2711 # Manually trigger completion of an active background block operation. This
2712 # is supported for drive mirroring, where it also switches the device to
2713 # write to the target path only. The ability to complete is signaled with
2714 # a BLOCK_JOB_READY event.
2716 # This command completes an active background block operation synchronously.
2717 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2718 # is not defined. Note that if an I/O error occurs during the processing of
2719 # this command: 1) the command itself will fail; 2) the error will be processed
2720 # according to the rerror/werror arguments that were specified when starting
2723 # A cancelled or paused job cannot be completed.
2725 # @device: The job identifier. This used to be a device name (hence
2726 # the name of the parameter), but since QEMU 2.7 it can have
2729 # Returns: - Nothing on success
2730 # - If no background operation is active on this device, DeviceNotActive
2734 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2737 # @block-job-dismiss:
2739 # For jobs that have already concluded, remove them from the block-job-query
2740 # list. This command only needs to be run for jobs which were started with
2741 # QEMU 2.12+ job lifetime management semantics.
2743 # This command will refuse to operate on any job that has not yet reached
2744 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2745 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2746 # to be used as appropriate.
2748 # @id: The job identifier.
2750 # Returns: Nothing on success
2754 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2757 # @block-job-finalize:
2759 # Once a job that has manual=true reaches the pending state, it can be
2760 # instructed to finalize any graph changes and do any necessary cleanup
2762 # For jobs in a transaction, instructing one job to finalize will force
2763 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2764 # a single member job to finalize.
2766 # @id: The job identifier.
2768 # Returns: Nothing on success
2772 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2775 # @BlockdevDiscardOptions:
2777 # Determines how to handle discard requests.
2779 # @ignore: Ignore the request
2780 # @unmap: Forward as an unmap request
2784 { 'enum': 'BlockdevDiscardOptions',
2785 'data': [ 'ignore', 'unmap' ] }
2788 # @BlockdevDetectZeroesOptions:
2790 # Describes the operation mode for the automatic conversion of plain
2791 # zero writes by the OS to driver specific optimized zero write commands.
2793 # @off: Disabled (default)
2795 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2796 # also that @BlockdevDiscardOptions is set to unmap for this device.
2800 { 'enum': 'BlockdevDetectZeroesOptions',
2801 'data': [ 'off', 'on', 'unmap' ] }
2804 # @BlockdevAioOptions:
2806 # Selects the AIO backend to handle I/O requests
2808 # @threads: Use qemu's thread pool
2809 # @native: Use native AIO backend (only Linux and Windows)
2810 # @io_uring: Use linux io_uring (since 5.0)
2814 { 'enum': 'BlockdevAioOptions',
2815 'data': [ 'threads', 'native',
2816 { 'name': 'io_uring', 'if': 'defined(CONFIG_LINUX_IO_URING)' } ] }
2819 # @BlockdevCacheOptions:
2821 # Includes cache-related options for block devices
2823 # @direct: enables use of O_DIRECT (bypass the host page cache;
2825 # @no-flush: ignore any flush requests for the device (default:
2830 { 'struct': 'BlockdevCacheOptions',
2831 'data': { '*direct': 'bool',
2832 '*no-flush': 'bool' } }
2837 # Drivers that are supported in block device operations.
2839 # @throttle: Since 2.11
2841 # @copy-on-read: Since 3.0
2842 # @blklogwrites: Since 3.0
2843 # @blkreplay: Since 4.2
2844 # @compress: Since 5.0
2848 { 'enum': 'BlockdevDriver',
2849 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
2850 'cloop', 'compress', 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps',
2851 'gluster', 'host_cdrom', 'host_device', 'http', 'https', 'iscsi',
2852 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
2853 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
2854 { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
2856 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
2859 # @BlockdevOptionsFile:
2861 # Driver specific block device options for the file backend.
2863 # @filename: path to the image file
2864 # @pr-manager: the id for the object that will handle persistent reservations
2865 # for this device (default: none, forward the commands via SG_IO;
2867 # @aio: AIO backend (default: threads) (since: 2.8)
2868 # @locking: whether to enable file locking. If set to 'auto', only enable
2869 # when Open File Descriptor (OFD) locking API is available
2870 # (default: auto, since 2.10)
2871 # @drop-cache: invalidate page cache during live migration. This prevents
2872 # stale data on the migration destination with cache.direct=off.
2873 # Currently only supported on Linux hosts.
2874 # (default: on, since: 4.0)
2875 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2876 # migration. May cause noticeable delays if the image
2877 # file is large, do not use in production.
2878 # (default: off) (since: 3.0)
2881 # @dynamic-auto-read-only: If present, enabled auto-read-only means that the
2882 # driver will open the image read-only at first,
2883 # dynamically reopen the image file read-write when
2884 # the first writer is attached to the node and reopen
2885 # read-only when the last writer is detached. This
2886 # allows giving QEMU write permissions only on demand
2887 # when an operation actually needs write access.
2891 { 'struct': 'BlockdevOptionsFile',
2892 'data': { 'filename': 'str',
2893 '*pr-manager': 'str',
2894 '*locking': 'OnOffAuto',
2895 '*aio': 'BlockdevAioOptions',
2896 '*drop-cache': {'type': 'bool',
2897 'if': 'defined(CONFIG_LINUX)'},
2898 '*x-check-cache-dropped': 'bool' },
2899 'features': [ { 'name': 'dynamic-auto-read-only',
2900 'if': 'defined(CONFIG_POSIX)' } ] }
2903 # @BlockdevOptionsNull:
2905 # Driver specific block device options for the null backend.
2907 # @size: size of the device in bytes.
2908 # @latency-ns: emulated latency (in nanoseconds) in processing
2909 # requests. Default to zero which completes requests immediately.
2911 # @read-zeroes: if true, reads from the device produce zeroes; if false, the
2912 # buffer is left unchanged. (default: false; since: 4.1)
2916 { 'struct': 'BlockdevOptionsNull',
2917 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
2920 # @BlockdevOptionsNVMe:
2922 # Driver specific block device options for the NVMe backend.
2924 # @device: PCI controller address of the NVMe device in
2925 # format hhhh:bb:ss.f (host:bus:slot.function)
2926 # @namespace: namespace number of the device, starting from 1.
2928 # Note that the PCI @device must have been unbound from any host
2929 # kernel driver before instructing QEMU to add the blockdev.
2933 { 'struct': 'BlockdevOptionsNVMe',
2934 'data': { 'device': 'str', 'namespace': 'int' } }
2937 # @BlockdevOptionsVVFAT:
2939 # Driver specific block device options for the vvfat protocol.
2941 # @dir: directory to be exported as FAT image
2942 # @fat-type: FAT type: 12, 16 or 32
2943 # @floppy: whether to export a floppy image (true) or
2944 # partitioned hard disk (false; default)
2945 # @label: set the volume label, limited to 11 bytes. FAT16 and
2946 # FAT32 traditionally have some restrictions on labels, which are
2947 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2949 # @rw: whether to allow write operations (default: false)
2953 { 'struct': 'BlockdevOptionsVVFAT',
2954 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2955 '*label': 'str', '*rw': 'bool' } }
2958 # @BlockdevOptionsGenericFormat:
2960 # Driver specific block device options for image format that have no option
2961 # besides their data source.
2963 # @file: reference to or definition of the data source block device
2967 { 'struct': 'BlockdevOptionsGenericFormat',
2968 'data': { 'file': 'BlockdevRef' } }
2971 # @BlockdevOptionsLUKS:
2973 # Driver specific block device options for LUKS.
2975 # @key-secret: the ID of a QCryptoSecret object providing
2976 # the decryption key (since 2.6). Mandatory except when
2977 # doing a metadata-only probe of the image.
2981 { 'struct': 'BlockdevOptionsLUKS',
2982 'base': 'BlockdevOptionsGenericFormat',
2983 'data': { '*key-secret': 'str' } }
2987 # @BlockdevOptionsGenericCOWFormat:
2989 # Driver specific block device options for image format that have no option
2990 # besides their data source and an optional backing file.
2992 # @backing: reference to or definition of the backing file block
2993 # device, null disables the backing file entirely.
2994 # Defaults to the backing file stored the image file.
2998 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2999 'base': 'BlockdevOptionsGenericFormat',
3000 'data': { '*backing': 'BlockdevRefOrNull' } }
3003 # @Qcow2OverlapCheckMode:
3005 # General overlap check modes.
3007 # @none: Do not perform any checks
3009 # @constant: Perform only checks which can be done in constant time and
3010 # without reading anything from disk
3012 # @cached: Perform only checks which can be done without reading anything
3015 # @all: Perform all available overlap checks
3019 { 'enum': 'Qcow2OverlapCheckMode',
3020 'data': [ 'none', 'constant', 'cached', 'all' ] }
3023 # @Qcow2OverlapCheckFlags:
3025 # Structure of flags for each metadata structure. Setting a field to 'true'
3026 # makes qemu guard that structure against unintended overwriting. The default
3027 # value is chosen according to the template given.
3029 # @template: Specifies a template mode which can be adjusted using the other
3030 # flags, defaults to 'cached'
3032 # @bitmap-directory: since 3.0
3036 { 'struct': 'Qcow2OverlapCheckFlags',
3037 'data': { '*template': 'Qcow2OverlapCheckMode',
3038 '*main-header': 'bool',
3039 '*active-l1': 'bool',
3040 '*active-l2': 'bool',
3041 '*refcount-table': 'bool',
3042 '*refcount-block': 'bool',
3043 '*snapshot-table': 'bool',
3044 '*inactive-l1': 'bool',
3045 '*inactive-l2': 'bool',
3046 '*bitmap-directory': 'bool' } }
3049 # @Qcow2OverlapChecks:
3051 # Specifies which metadata structures should be guarded against unintended
3054 # @flags: set of flags for separate specification of each metadata structure
3057 # @mode: named mode which chooses a specific set of flags
3061 { 'alternate': 'Qcow2OverlapChecks',
3062 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3063 'mode': 'Qcow2OverlapCheckMode' } }
3066 # @BlockdevQcowEncryptionFormat:
3068 # @aes: AES-CBC with plain64 initialization vectors
3072 { 'enum': 'BlockdevQcowEncryptionFormat',
3076 # @BlockdevQcowEncryption:
3080 { 'union': 'BlockdevQcowEncryption',
3081 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3082 'discriminator': 'format',
3083 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3086 # @BlockdevOptionsQcow:
3088 # Driver specific block device options for qcow.
3090 # @encrypt: Image decryption options. Mandatory for
3091 # encrypted images, except when doing a metadata-only
3092 # probe of the image.
3096 { 'struct': 'BlockdevOptionsQcow',
3097 'base': 'BlockdevOptionsGenericCOWFormat',
3098 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3103 # @BlockdevQcow2EncryptionFormat:
3104 # @aes: AES-CBC with plain64 initialization vectors
3108 { 'enum': 'BlockdevQcow2EncryptionFormat',
3109 'data': [ 'aes', 'luks' ] }
3112 # @BlockdevQcow2Encryption:
3116 { 'union': 'BlockdevQcow2Encryption',
3117 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3118 'discriminator': 'format',
3119 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3120 'luks': 'QCryptoBlockOptionsLUKS'} }
3123 # @BlockdevOptionsQcow2:
3125 # Driver specific block device options for qcow2.
3127 # @lazy-refcounts: whether to enable the lazy refcounts
3128 # feature (default is taken from the image file)
3130 # @pass-discard-request: whether discard requests to the qcow2
3131 # device should be forwarded to the data source
3133 # @pass-discard-snapshot: whether discard requests for the data source
3134 # should be issued when a snapshot operation (e.g.
3135 # deleting a snapshot) frees clusters in the qcow2 file
3137 # @pass-discard-other: whether discard requests for the data source
3138 # should be issued on other occasions where a cluster
3141 # @overlap-check: which overlap checks to perform for writes
3142 # to the image, defaults to 'cached' (since 2.2)
3144 # @cache-size: the maximum total size of the L2 table and
3145 # refcount block caches in bytes (since 2.2)
3147 # @l2-cache-size: the maximum size of the L2 table cache in
3150 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3151 # bytes. It must be a power of two between 512
3152 # and the cluster size. The default value is
3153 # the cluster size (since 2.12)
3155 # @refcount-cache-size: the maximum size of the refcount block cache
3156 # in bytes (since 2.2)
3158 # @cache-clean-interval: clean unused entries in the L2 and refcount
3159 # caches. The interval is in seconds. The default value
3160 # is 600 on supporting platforms, and 0 on other
3161 # platforms. 0 disables this feature. (since 2.5)
3163 # @encrypt: Image decryption options. Mandatory for
3164 # encrypted images, except when doing a metadata-only
3165 # probe of the image. (since 2.10)
3167 # @data-file: reference to or definition of the external data file.
3168 # This may only be specified for images that require an
3169 # external data file. If it is not specified for such
3170 # an image, the data file name is loaded from the image
3175 { 'struct': 'BlockdevOptionsQcow2',
3176 'base': 'BlockdevOptionsGenericCOWFormat',
3177 'data': { '*lazy-refcounts': 'bool',
3178 '*pass-discard-request': 'bool',
3179 '*pass-discard-snapshot': 'bool',
3180 '*pass-discard-other': 'bool',
3181 '*overlap-check': 'Qcow2OverlapChecks',
3182 '*cache-size': 'int',
3183 '*l2-cache-size': 'int',
3184 '*l2-cache-entry-size': 'int',
3185 '*refcount-cache-size': 'int',
3186 '*cache-clean-interval': 'int',
3187 '*encrypt': 'BlockdevQcow2Encryption',
3188 '*data-file': 'BlockdevRef' } }
3191 # @SshHostKeyCheckMode:
3193 # @none: Don't check the host key at all
3194 # @hash: Compare the host key with a given hash
3195 # @known_hosts: Check the host key against the known_hosts file
3199 { 'enum': 'SshHostKeyCheckMode',
3200 'data': [ 'none', 'hash', 'known_hosts' ] }
3203 # @SshHostKeyCheckHashType:
3205 # @md5: The given hash is an md5 hash
3206 # @sha1: The given hash is an sha1 hash
3210 { 'enum': 'SshHostKeyCheckHashType',
3211 'data': [ 'md5', 'sha1' ] }
3216 # @type: The hash algorithm used for the hash
3217 # @hash: The expected hash value
3221 { 'struct': 'SshHostKeyHash',
3222 'data': { 'type': 'SshHostKeyCheckHashType',
3230 { 'union': 'SshHostKeyCheck',
3231 'base': { 'mode': 'SshHostKeyCheckMode' },
3232 'discriminator': 'mode',
3233 'data': { 'hash': 'SshHostKeyHash' } }
3236 # @BlockdevOptionsSsh:
3238 # @server: host address
3240 # @path: path to the image on the host
3242 # @user: user as which to connect, defaults to current
3245 # @host-key-check: Defines how and what to check the host key against
3246 # (default: known_hosts)
3250 { 'struct': 'BlockdevOptionsSsh',
3251 'data': { 'server': 'InetSocketAddress',
3254 '*host-key-check': 'SshHostKeyCheck' } }
3260 # Trigger events supported by blkdebug.
3262 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3265 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3267 # @cor_write: a write due to copy-on-read (since 2.11)
3269 # @cluster_alloc_space: an allocation of file space for a cluster (since 4.1)
3271 # @none: triggers once at creation of the blkdebug node (since 4.1)
3275 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3276 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3277 'l1_grow_activate_table', 'l2_load', 'l2_update',
3278 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3279 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3280 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3281 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3282 'refblock_load', 'refblock_update', 'refblock_update_part',
3283 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3284 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3285 'refblock_alloc_switch_table', 'cluster_alloc',
3286 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3287 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3288 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3289 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3290 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3291 'cor_write', 'cluster_alloc_space', 'none'] }
3296 # Kinds of I/O that blkdebug can inject errors in.
3298 # @read: .bdrv_co_preadv()
3300 # @write: .bdrv_co_pwritev()
3302 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3304 # @discard: .bdrv_co_pdiscard()
3306 # @flush: .bdrv_co_flush_to_disk()
3308 # @block-status: .bdrv_co_block_status()
3312 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3313 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3317 # @BlkdebugInjectErrorOptions:
3319 # Describes a single error injection for blkdebug.
3321 # @event: trigger event
3323 # @state: the state identifier blkdebug needs to be in to
3324 # actually trigger the event; defaults to "any"
3326 # @iotype: the type of I/O operations on which this error should
3327 # be injected; defaults to "all read, write,
3328 # write-zeroes, discard, and flush operations"
3331 # @errno: error identifier (errno) to be returned; defaults to
3334 # @sector: specifies the sector index which has to be affected
3335 # in order to actually trigger the event; defaults to "any
3338 # @once: disables further events after this one has been
3339 # triggered; defaults to false
3341 # @immediately: fail immediately; defaults to false
3345 { 'struct': 'BlkdebugInjectErrorOptions',
3346 'data': { 'event': 'BlkdebugEvent',
3348 '*iotype': 'BlkdebugIOType',
3352 '*immediately': 'bool' } }
3355 # @BlkdebugSetStateOptions:
3357 # Describes a single state-change event for blkdebug.
3359 # @event: trigger event
3361 # @state: the current state identifier blkdebug needs to be in;
3364 # @new_state: the state identifier blkdebug is supposed to assume if
3365 # this event is triggered
3369 { 'struct': 'BlkdebugSetStateOptions',
3370 'data': { 'event': 'BlkdebugEvent',
3372 'new_state': 'int' } }
3375 # @BlockdevOptionsBlkdebug:
3377 # Driver specific block device options for blkdebug.
3379 # @image: underlying raw block device (or image file)
3381 # @config: filename of the configuration file
3383 # @align: required alignment for requests in bytes, must be
3384 # positive power of 2, or 0 for default
3386 # @max-transfer: maximum size for I/O transfers in bytes, must be
3387 # positive multiple of @align and of the underlying
3388 # file's request alignment (but need not be a power of
3389 # 2), or 0 for default (since 2.10)
3391 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3392 # must be positive multiple of @align and of the
3393 # underlying file's request alignment (but need not be a
3394 # power of 2), or 0 for default (since 2.10)
3396 # @max-write-zero: maximum size for write zero requests in bytes, must be
3397 # positive multiple of @align, of @opt-write-zero, and of
3398 # the underlying file's request alignment (but need not
3399 # be a power of 2), or 0 for default (since 2.10)
3401 # @opt-discard: preferred alignment for discard requests in bytes, must
3402 # be positive multiple of @align and of the underlying
3403 # file's request alignment (but need not be a power of
3404 # 2), or 0 for default (since 2.10)
3406 # @max-discard: maximum size for discard requests in bytes, must be
3407 # positive multiple of @align, of @opt-discard, and of
3408 # the underlying file's request alignment (but need not
3409 # be a power of 2), or 0 for default (since 2.10)
3411 # @inject-error: array of error injection descriptions
3413 # @set-state: array of state-change descriptions
3415 # @take-child-perms: Permissions to take on @image in addition to what
3416 # is necessary anyway (which depends on how the
3417 # blkdebug node is used). Defaults to none.
3420 # @unshare-child-perms: Permissions not to share on @image in addition
3421 # to what cannot be shared anyway (which depends
3422 # on how the blkdebug node is used). Defaults
3423 # to none. (since 5.0)
3427 { 'struct': 'BlockdevOptionsBlkdebug',
3428 'data': { 'image': 'BlockdevRef',
3430 '*align': 'int', '*max-transfer': 'int32',
3431 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3432 '*opt-discard': 'int32', '*max-discard': 'int32',
3433 '*inject-error': ['BlkdebugInjectErrorOptions'],
3434 '*set-state': ['BlkdebugSetStateOptions'],
3435 '*take-child-perms': ['BlockPermission'],
3436 '*unshare-child-perms': ['BlockPermission'] } }
3439 # @BlockdevOptionsBlklogwrites:
3441 # Driver specific block device options for blklogwrites.
3443 # @file: block device
3445 # @log: block device used to log writes to @file
3447 # @log-sector-size: sector size used in logging writes to @file, determines
3448 # granularity of offsets and sizes of writes (default: 512)
3450 # @log-append: append to an existing log (default: false)
3452 # @log-super-update-interval: interval of write requests after which the log
3453 # super block is updated to disk (default: 4096)
3457 { 'struct': 'BlockdevOptionsBlklogwrites',
3458 'data': { 'file': 'BlockdevRef',
3459 'log': 'BlockdevRef',
3460 '*log-sector-size': 'uint32',
3461 '*log-append': 'bool',
3462 '*log-super-update-interval': 'uint64' } }
3465 # @BlockdevOptionsBlkverify:
3467 # Driver specific block device options for blkverify.
3469 # @test: block device to be tested
3471 # @raw: raw image used for verification
3475 { 'struct': 'BlockdevOptionsBlkverify',
3476 'data': { 'test': 'BlockdevRef',
3477 'raw': 'BlockdevRef' } }
3480 # @BlockdevOptionsBlkreplay:
3482 # Driver specific block device options for blkreplay.
3484 # @image: disk image which should be controlled with blkreplay
3488 { 'struct': 'BlockdevOptionsBlkreplay',
3489 'data': { 'image': 'BlockdevRef' } }
3492 # @QuorumReadPattern:
3494 # An enumeration of quorum read patterns.
3496 # @quorum: read all the children and do a quorum vote on reads
3498 # @fifo: read only from the first child that has not failed
3502 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3505 # @BlockdevOptionsQuorum:
3507 # Driver specific block device options for Quorum
3509 # @blkverify: true if the driver must print content mismatch
3510 # set to false by default
3512 # @children: the children block devices to use
3514 # @vote-threshold: the vote limit under which a read will fail
3516 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3519 # @read-pattern: choose read pattern and set to quorum by default
3524 { 'struct': 'BlockdevOptionsQuorum',
3525 'data': { '*blkverify': 'bool',
3526 'children': [ 'BlockdevRef' ],
3527 'vote-threshold': 'int',
3528 '*rewrite-corrupted': 'bool',
3529 '*read-pattern': 'QuorumReadPattern' } }
3532 # @BlockdevOptionsGluster:
3534 # Driver specific block device options for Gluster
3536 # @volume: name of gluster volume where VM image resides
3538 # @path: absolute path to image file in gluster volume
3540 # @server: gluster servers description
3542 # @debug: libgfapi log level (default '4' which is Error)
3545 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3549 { 'struct': 'BlockdevOptionsGluster',
3550 'data': { 'volume': 'str',
3552 'server': ['SocketAddress'],
3554 '*logfile': 'str' } }
3559 # An enumeration of libiscsi transport types
3563 { 'enum': 'IscsiTransport',
3564 'data': [ 'tcp', 'iser' ] }
3567 # @IscsiHeaderDigest:
3569 # An enumeration of header digests supported by libiscsi
3573 { 'enum': 'IscsiHeaderDigest',
3574 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3575 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3578 # @BlockdevOptionsIscsi:
3580 # @transport: The iscsi transport type
3582 # @portal: The address of the iscsi portal
3584 # @target: The target iqn name
3586 # @lun: LUN to connect to. Defaults to 0.
3588 # @user: User name to log in with. If omitted, no CHAP
3589 # authentication is performed.
3591 # @password-secret: The ID of a QCryptoSecret object providing
3592 # the password for the login. This option is required if
3593 # @user is specified.
3595 # @initiator-name: The iqn name we want to identify to the target
3596 # as. If this option is not specified, an initiator name is
3597 # generated automatically.
3599 # @header-digest: The desired header digest. Defaults to
3602 # @timeout: Timeout in seconds after which a request will
3603 # timeout. 0 means no timeout and is the default.
3605 # Driver specific block device options for iscsi
3609 { 'struct': 'BlockdevOptionsIscsi',
3610 'data': { 'transport': 'IscsiTransport',
3615 '*password-secret': 'str',
3616 '*initiator-name': 'str',
3617 '*header-digest': 'IscsiHeaderDigest',
3618 '*timeout': 'int' } }
3626 { 'enum': 'RbdAuthMode',
3627 'data': [ 'cephx', 'none' ] }
3630 # @BlockdevOptionsRbd:
3632 # @pool: Ceph pool name.
3634 # @namespace: Rados namespace name in the Ceph pool. (Since 5.0)
3636 # @image: Image name in the Ceph pool.
3638 # @conf: path to Ceph configuration file. Values
3639 # in the configuration file will be overridden by
3640 # options specified via QAPI.
3642 # @snapshot: Ceph snapshot name.
3644 # @user: Ceph id name.
3646 # @auth-client-required: Acceptable authentication modes.
3647 # This maps to Ceph configuration option
3648 # "auth_client_required". (Since 3.0)
3650 # @key-secret: ID of a QCryptoSecret object providing a key
3651 # for cephx authentication.
3652 # This maps to Ceph configuration option
3653 # "key". (Since 3.0)
3655 # @server: Monitor host address and port. This maps
3656 # to the "mon_host" Ceph option.
3660 { 'struct': 'BlockdevOptionsRbd',
3661 'data': { 'pool': 'str',
3662 '*namespace': 'str',
3667 '*auth-client-required': ['RbdAuthMode'],
3668 '*key-secret': 'str',
3669 '*server': ['InetSocketAddressBase'] } }
3672 # @BlockdevOptionsSheepdog:
3674 # Driver specific block device options for sheepdog
3676 # @vdi: Virtual disk image name
3677 # @server: The Sheepdog server to connect to
3678 # @snap-id: Snapshot ID
3679 # @tag: Snapshot tag name
3681 # Only one of @snap-id and @tag may be present.
3685 { 'struct': 'BlockdevOptionsSheepdog',
3686 'data': { 'server': 'SocketAddress',
3688 '*snap-id': 'uint32',
3694 # An enumeration of replication modes.
3696 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3698 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3702 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3703 'if': 'defined(CONFIG_REPLICATION)' }
3706 # @BlockdevOptionsReplication:
3708 # Driver specific block device options for replication
3710 # @mode: the replication mode
3712 # @top-id: In secondary mode, node name or device ID of the root
3713 # node who owns the replication node chain. Must not be given in
3718 { 'struct': 'BlockdevOptionsReplication',
3719 'base': 'BlockdevOptionsGenericFormat',
3720 'data': { 'mode': 'ReplicationMode',
3722 'if': 'defined(CONFIG_REPLICATION)' }
3727 # An enumeration of NFS transport types
3729 # @inet: TCP transport
3733 { 'enum': 'NFSTransport',
3734 'data': [ 'inet' ] }
3739 # Captures the address of the socket
3741 # @type: transport type used for NFS (only TCP supported)
3743 # @host: host address for NFS server
3747 { 'struct': 'NFSServer',
3748 'data': { 'type': 'NFSTransport',
3752 # @BlockdevOptionsNfs:
3754 # Driver specific block device option for NFS
3756 # @server: host address
3758 # @path: path of the image on the host
3760 # @user: UID value to use when talking to the
3761 # server (defaults to 65534 on Windows and getuid()
3764 # @group: GID value to use when talking to the
3765 # server (defaults to 65534 on Windows and getgid()
3768 # @tcp-syn-count: number of SYNs during the session
3769 # establishment (defaults to libnfs default)
3771 # @readahead-size: set the readahead size in bytes (defaults
3772 # to libnfs default)
3774 # @page-cache-size: set the pagecache size in bytes (defaults
3775 # to libnfs default)
3777 # @debug: set the NFS debug level (max 2) (defaults
3778 # to libnfs default)
3782 { 'struct': 'BlockdevOptionsNfs',
3783 'data': { 'server': 'NFSServer',
3787 '*tcp-syn-count': 'int',
3788 '*readahead-size': 'int',
3789 '*page-cache-size': 'int',
3793 # @BlockdevOptionsCurlBase:
3795 # Driver specific block device options shared by all protocols supported by the
3798 # @url: URL of the image file
3800 # @readahead: Size of the read-ahead cache; must be a multiple of
3801 # 512 (defaults to 256 kB)
3803 # @timeout: Timeout for connections, in seconds (defaults to 5)
3805 # @username: Username for authentication (defaults to none)
3807 # @password-secret: ID of a QCryptoSecret object providing a password
3808 # for authentication (defaults to no password)
3810 # @proxy-username: Username for proxy authentication (defaults to none)
3812 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3813 # for proxy authentication (defaults to no password)
3817 { 'struct': 'BlockdevOptionsCurlBase',
3818 'data': { 'url': 'str',
3819 '*readahead': 'int',
3822 '*password-secret': 'str',
3823 '*proxy-username': 'str',
3824 '*proxy-password-secret': 'str' } }
3827 # @BlockdevOptionsCurlHttp:
3829 # Driver specific block device options for HTTP connections over the curl
3830 # backend. URLs must start with "http://".
3832 # @cookie: List of cookies to set; format is
3833 # "name1=content1; name2=content2;" as explained by
3834 # CURLOPT_COOKIE(3). Defaults to no cookies.
3836 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3837 # secure way. See @cookie for the format. (since 2.10)
3841 { 'struct': 'BlockdevOptionsCurlHttp',
3842 'base': 'BlockdevOptionsCurlBase',
3843 'data': { '*cookie': 'str',
3844 '*cookie-secret': 'str'} }
3847 # @BlockdevOptionsCurlHttps:
3849 # Driver specific block device options for HTTPS connections over the curl
3850 # backend. URLs must start with "https://".
3852 # @cookie: List of cookies to set; format is
3853 # "name1=content1; name2=content2;" as explained by
3854 # CURLOPT_COOKIE(3). Defaults to no cookies.
3856 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3859 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3860 # secure way. See @cookie for the format. (since 2.10)
3864 { 'struct': 'BlockdevOptionsCurlHttps',
3865 'base': 'BlockdevOptionsCurlBase',
3866 'data': { '*cookie': 'str',
3867 '*sslverify': 'bool',
3868 '*cookie-secret': 'str'} }
3871 # @BlockdevOptionsCurlFtp:
3873 # Driver specific block device options for FTP connections over the curl
3874 # backend. URLs must start with "ftp://".
3878 { 'struct': 'BlockdevOptionsCurlFtp',
3879 'base': 'BlockdevOptionsCurlBase',
3883 # @BlockdevOptionsCurlFtps:
3885 # Driver specific block device options for FTPS connections over the curl
3886 # backend. URLs must start with "ftps://".
3888 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3893 { 'struct': 'BlockdevOptionsCurlFtps',
3894 'base': 'BlockdevOptionsCurlBase',
3895 'data': { '*sslverify': 'bool' } }
3898 # @BlockdevOptionsNbd:
3900 # Driver specific block device options for NBD.
3902 # @server: NBD server address
3904 # @export: export name
3906 # @tls-creds: TLS credentials ID
3908 # @x-dirty-bitmap: A metadata context name such as "qemu:dirty-bitmap:NAME"
3909 # or "qemu:allocation-depth" to query in place of the
3910 # traditional "base:allocation" block status (see
3911 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol; and
3912 # yes, naming this option x-context would have made
3913 # more sense) (since 3.0)
3915 # @reconnect-delay: On an unexpected disconnect, the nbd client tries to
3916 # connect again until succeeding or encountering a serious
3917 # error. During the first @reconnect-delay seconds, all
3918 # requests are paused and will be rerun on a successful
3919 # reconnect. After that time, any delayed requests and all
3920 # future requests before a successful reconnect will
3921 # immediately fail. Default 0 (Since 4.2)
3925 { 'struct': 'BlockdevOptionsNbd',
3926 'data': { 'server': 'SocketAddress',
3928 '*tls-creds': 'str',
3929 '*x-dirty-bitmap': 'str',
3930 '*reconnect-delay': 'uint32' } }
3933 # @BlockdevOptionsRaw:
3935 # Driver specific block device options for the raw driver.
3937 # @offset: position where the block device starts
3938 # @size: the assumed size of the device
3942 { 'struct': 'BlockdevOptionsRaw',
3943 'base': 'BlockdevOptionsGenericFormat',
3944 'data': { '*offset': 'int', '*size': 'int' } }
3947 # @BlockdevOptionsThrottle:
3949 # Driver specific block device options for the throttle driver
3951 # @throttle-group: the name of the throttle-group object to use. It
3952 # must already exist.
3953 # @file: reference to or definition of the data source block device
3956 { 'struct': 'BlockdevOptionsThrottle',
3957 'data': { 'throttle-group': 'str',
3958 'file' : 'BlockdevRef'
3963 # Options for creating a block device. Many options are available for all
3964 # block devices, independent of the block driver:
3966 # @driver: block driver name
3967 # @node-name: the node name of the new node (Since 2.0).
3968 # This option is required on the top level of blockdev-add.
3969 # Valid node names start with an alphabetic character and may
3970 # contain only alphanumeric characters, '-', '.' and '_'. Their
3971 # maximum length is 31 characters.
3972 # @discard: discard-related options (default: ignore)
3973 # @cache: cache-related options
3974 # @read-only: whether the block device should be read-only (default: false).
3975 # Note that some block drivers support only read-only access,
3976 # either generally or in certain configurations. In this case,
3977 # the default value does not work and the option must be
3978 # specified explicitly.
3979 # @auto-read-only: if true and @read-only is false, QEMU may automatically
3980 # decide not to open the image read-write as requested, but
3981 # fall back to read-only instead (and switch between the modes
3982 # later), e.g. depending on whether the image file is writable
3983 # or whether a writing user is attached to the node
3984 # (default: false, since 3.1)
3985 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3987 # @force-share: force share all permission on added nodes.
3988 # Requires read-only=true. (Since 2.10)
3990 # Remaining options are determined by the block driver.
3994 { 'union': 'BlockdevOptions',
3995 'base': { 'driver': 'BlockdevDriver',
3996 '*node-name': 'str',
3997 '*discard': 'BlockdevDiscardOptions',
3998 '*cache': 'BlockdevCacheOptions',
3999 '*read-only': 'bool',
4000 '*auto-read-only': 'bool',
4001 '*force-share': 'bool',
4002 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
4003 'discriminator': 'driver',
4005 'blkdebug': 'BlockdevOptionsBlkdebug',
4006 'blklogwrites':'BlockdevOptionsBlklogwrites',
4007 'blkverify': 'BlockdevOptionsBlkverify',
4008 'blkreplay': 'BlockdevOptionsBlkreplay',
4009 'bochs': 'BlockdevOptionsGenericFormat',
4010 'cloop': 'BlockdevOptionsGenericFormat',
4011 'compress': 'BlockdevOptionsGenericFormat',
4012 'copy-on-read':'BlockdevOptionsGenericFormat',
4013 'dmg': 'BlockdevOptionsGenericFormat',
4014 'file': 'BlockdevOptionsFile',
4015 'ftp': 'BlockdevOptionsCurlFtp',
4016 'ftps': 'BlockdevOptionsCurlFtps',
4017 'gluster': 'BlockdevOptionsGluster',
4018 'host_cdrom': 'BlockdevOptionsFile',
4019 'host_device':'BlockdevOptionsFile',
4020 'http': 'BlockdevOptionsCurlHttp',
4021 'https': 'BlockdevOptionsCurlHttps',
4022 'iscsi': 'BlockdevOptionsIscsi',
4023 'luks': 'BlockdevOptionsLUKS',
4024 'nbd': 'BlockdevOptionsNbd',
4025 'nfs': 'BlockdevOptionsNfs',
4026 'null-aio': 'BlockdevOptionsNull',
4027 'null-co': 'BlockdevOptionsNull',
4028 'nvme': 'BlockdevOptionsNVMe',
4029 'parallels': 'BlockdevOptionsGenericFormat',
4030 'qcow2': 'BlockdevOptionsQcow2',
4031 'qcow': 'BlockdevOptionsQcow',
4032 'qed': 'BlockdevOptionsGenericCOWFormat',
4033 'quorum': 'BlockdevOptionsQuorum',
4034 'raw': 'BlockdevOptionsRaw',
4035 'rbd': 'BlockdevOptionsRbd',
4036 'replication': { 'type': 'BlockdevOptionsReplication',
4037 'if': 'defined(CONFIG_REPLICATION)' },
4038 'sheepdog': 'BlockdevOptionsSheepdog',
4039 'ssh': 'BlockdevOptionsSsh',
4040 'throttle': 'BlockdevOptionsThrottle',
4041 'vdi': 'BlockdevOptionsGenericFormat',
4042 'vhdx': 'BlockdevOptionsGenericFormat',
4043 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4044 'vpc': 'BlockdevOptionsGenericFormat',
4045 'vvfat': 'BlockdevOptionsVVFAT'
4051 # Reference to a block device.
4053 # @definition: defines a new block device inline
4054 # @reference: references the ID of an existing block device
4058 { 'alternate': 'BlockdevRef',
4059 'data': { 'definition': 'BlockdevOptions',
4060 'reference': 'str' } }
4063 # @BlockdevRefOrNull:
4065 # Reference to a block device.
4067 # @definition: defines a new block device inline
4068 # @reference: references the ID of an existing block device.
4069 # An empty string means that no block device should
4070 # be referenced. Deprecated; use null instead.
4071 # @null: No block device should be referenced (since 2.10)
4075 { 'alternate': 'BlockdevRefOrNull',
4076 'data': { 'definition': 'BlockdevOptions',
4083 # Creates a new block device.
4090 # -> { "execute": "blockdev-add",
4092 # "driver": "qcow2",
4093 # "node-name": "test1",
4096 # "filename": "test.qcow2"
4100 # <- { "return": {} }
4103 # -> { "execute": "blockdev-add",
4105 # "driver": "qcow2",
4106 # "node-name": "node0",
4107 # "discard": "unmap",
4113 # "filename": "/tmp/test.qcow2"
4119 # "filename": "/dev/fdset/4"
4125 # <- { "return": {} }
4128 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
4131 # @x-blockdev-reopen:
4133 # Reopens a block device using the given set of options. Any option
4134 # not specified will be reset to its default value regardless of its
4135 # previous status. If an option cannot be changed or a particular
4136 # driver does not support reopening then the command will return an
4139 # The top-level @node-name option (from BlockdevOptions) must be
4140 # specified and is used to select the block device to be reopened.
4141 # Other @node-name options must be either omitted or set to the
4142 # current name of the appropriate node. This command won't change any
4143 # node name and any attempt to do it will result in an error.
4145 # In the case of options that refer to child nodes, the behavior of
4146 # this command depends on the value:
4148 # 1) A set of options (BlockdevOptions): the child is reopened with
4149 # the specified set of options.
4151 # 2) A reference to the current child: the child is reopened using
4152 # its existing set of options.
4154 # 3) A reference to a different node: the current child is replaced
4155 # with the specified one.
4157 # 4) NULL: the current child (if any) is detached.
4159 # Options (1) and (2) are supported in all cases, but at the moment
4160 # only @backing allows replacing or detaching an existing child.
4162 # Unlike with blockdev-add, the @backing option must always be present
4163 # unless the node being reopened does not have a backing file and its
4164 # image does not have a default backing file name as part of its
4169 { 'command': 'x-blockdev-reopen',
4170 'data': 'BlockdevOptions', 'boxed': true }
4175 # Deletes a block device that has been added using blockdev-add.
4176 # The command will fail if the node is attached to a device or is
4177 # otherwise being used.
4179 # @node-name: Name of the graph node to delete.
4185 # -> { "execute": "blockdev-add",
4187 # "driver": "qcow2",
4188 # "node-name": "node0",
4191 # "filename": "test.qcow2"
4195 # <- { "return": {} }
4197 # -> { "execute": "blockdev-del",
4198 # "arguments": { "node-name": "node0" }
4200 # <- { "return": {} }
4203 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
4206 # @BlockdevCreateOptionsFile:
4208 # Driver specific image creation options for file.
4210 # @filename: Filename for the new image file
4211 # @size: Size of the virtual disk in bytes
4212 # @preallocation: Preallocation mode for the new image (default: off;
4213 # allowed values: off,
4214 # falloc (if defined CONFIG_POSIX_FALLOCATE),
4215 # full (if defined CONFIG_POSIX))
4216 # @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
4217 # @extent-size-hint: Extent size hint to add to the image file; 0 for not
4218 # adding an extent size hint (default: 1 MB, since 5.1)
4222 { 'struct': 'BlockdevCreateOptionsFile',
4223 'data': { 'filename': 'str',
4225 '*preallocation': 'PreallocMode',
4227 '*extent-size-hint': 'size'} }
4230 # @BlockdevCreateOptionsGluster:
4232 # Driver specific image creation options for gluster.
4234 # @location: Where to store the new image file
4235 # @size: Size of the virtual disk in bytes
4236 # @preallocation: Preallocation mode for the new image (default: off;
4237 # allowed values: off,
4238 # falloc (if defined CONFIG_GLUSTERFS_FALLOCATE),
4239 # full (if defined CONFIG_GLUSTERFS_ZEROFILL))
4243 { 'struct': 'BlockdevCreateOptionsGluster',
4244 'data': { 'location': 'BlockdevOptionsGluster',
4246 '*preallocation': 'PreallocMode' } }
4249 # @BlockdevCreateOptionsLUKS:
4251 # Driver specific image creation options for LUKS.
4253 # @file: Node to create the image format on
4254 # @size: Size of the virtual disk in bytes
4255 # @preallocation: Preallocation mode for the new image
4257 # (default: off; allowed values: off, metadata, falloc, full)
4261 { 'struct': 'BlockdevCreateOptionsLUKS',
4262 'base': 'QCryptoBlockCreateOptionsLUKS',
4263 'data': { 'file': 'BlockdevRef',
4265 '*preallocation': 'PreallocMode' } }
4268 # @BlockdevCreateOptionsNfs:
4270 # Driver specific image creation options for NFS.
4272 # @location: Where to store the new image file
4273 # @size: Size of the virtual disk in bytes
4277 { 'struct': 'BlockdevCreateOptionsNfs',
4278 'data': { 'location': 'BlockdevOptionsNfs',
4282 # @BlockdevCreateOptionsParallels:
4284 # Driver specific image creation options for parallels.
4286 # @file: Node to create the image format on
4287 # @size: Size of the virtual disk in bytes
4288 # @cluster-size: Cluster size in bytes (default: 1 MB)
4292 { 'struct': 'BlockdevCreateOptionsParallels',
4293 'data': { 'file': 'BlockdevRef',
4295 '*cluster-size': 'size' } }
4298 # @BlockdevCreateOptionsQcow:
4300 # Driver specific image creation options for qcow.
4302 # @file: Node to create the image format on
4303 # @size: Size of the virtual disk in bytes
4304 # @backing-file: File name of the backing file if a backing file
4306 # @encrypt: Encryption options if the image should be encrypted
4310 { 'struct': 'BlockdevCreateOptionsQcow',
4311 'data': { 'file': 'BlockdevRef',
4313 '*backing-file': 'str',
4314 '*encrypt': 'QCryptoBlockCreateOptions' } }
4317 # @BlockdevQcow2Version:
4319 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4320 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4324 { 'enum': 'BlockdevQcow2Version',
4325 'data': [ 'v2', 'v3' ] }
4329 # @Qcow2CompressionType:
4331 # Compression type used in qcow2 image file
4333 # @zlib: zlib compression, see <http://zlib.net/>
4334 # @zstd: zstd compression, see <http://github.com/facebook/zstd>
4338 { 'enum': 'Qcow2CompressionType',
4339 'data': [ 'zlib', { 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] }
4342 # @BlockdevCreateOptionsQcow2:
4344 # Driver specific image creation options for qcow2.
4346 # @file: Node to create the image format on
4347 # @data-file: Node to use as an external data file in which all guest
4348 # data is stored so that only metadata remains in the qcow2
4350 # @data-file-raw: True if the external data file must stay valid as a
4351 # standalone (read-only) raw image without looking at qcow2
4352 # metadata (default: false; since: 4.0)
4353 # @extended-l2: True to make the image have extended L2 entries
4354 # (default: false; since 5.2)
4355 # @size: Size of the virtual disk in bytes
4356 # @version: Compatibility level (default: v3)
4357 # @backing-file: File name of the backing file if a backing file
4359 # @backing-fmt: Name of the block driver to use for the backing file
4360 # @encrypt: Encryption options if the image should be encrypted
4361 # @cluster-size: qcow2 cluster size in bytes (default: 65536)
4362 # @preallocation: Preallocation mode for the new image (default: off;
4363 # allowed values: off, falloc, full, metadata)
4364 # @lazy-refcounts: True if refcounts may be updated lazily (default: off)
4365 # @refcount-bits: Width of reference counts in bits (default: 16)
4366 # @compression-type: The image cluster compression method
4367 # (default: zlib, since 5.1)
4371 { 'struct': 'BlockdevCreateOptionsQcow2',
4372 'data': { 'file': 'BlockdevRef',
4373 '*data-file': 'BlockdevRef',
4374 '*data-file-raw': 'bool',
4375 '*extended-l2': 'bool',
4377 '*version': 'BlockdevQcow2Version',
4378 '*backing-file': 'str',
4379 '*backing-fmt': 'BlockdevDriver',
4380 '*encrypt': 'QCryptoBlockCreateOptions',
4381 '*cluster-size': 'size',
4382 '*preallocation': 'PreallocMode',
4383 '*lazy-refcounts': 'bool',
4384 '*refcount-bits': 'int',
4385 '*compression-type':'Qcow2CompressionType' } }
4388 # @BlockdevCreateOptionsQed:
4390 # Driver specific image creation options for qed.
4392 # @file: Node to create the image format on
4393 # @size: Size of the virtual disk in bytes
4394 # @backing-file: File name of the backing file if a backing file
4396 # @backing-fmt: Name of the block driver to use for the backing file
4397 # @cluster-size: Cluster size in bytes (default: 65536)
4398 # @table-size: L1/L2 table size (in clusters)
4402 { 'struct': 'BlockdevCreateOptionsQed',
4403 'data': { 'file': 'BlockdevRef',
4405 '*backing-file': 'str',
4406 '*backing-fmt': 'BlockdevDriver',
4407 '*cluster-size': 'size',
4408 '*table-size': 'int' } }
4411 # @BlockdevCreateOptionsRbd:
4413 # Driver specific image creation options for rbd/Ceph.
4415 # @location: Where to store the new image file. This location cannot
4416 # point to a snapshot.
4417 # @size: Size of the virtual disk in bytes
4418 # @cluster-size: RBD object size
4422 { 'struct': 'BlockdevCreateOptionsRbd',
4423 'data': { 'location': 'BlockdevOptionsRbd',
4425 '*cluster-size' : 'size' } }
4428 # @BlockdevVmdkSubformat:
4430 # Subformat options for VMDK images
4432 # @monolithicSparse: Single file image with sparse cluster allocation
4434 # @monolithicFlat: Single flat data image and a descriptor file
4436 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4437 # files, in addition to a descriptor file
4439 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4440 # files, in addition to a descriptor file
4442 # @streamOptimized: Single file image sparse cluster allocation, optimized
4443 # for streaming over network.
4447 { 'enum': 'BlockdevVmdkSubformat',
4448 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4449 'twoGbMaxExtentFlat', 'streamOptimized'] }
4452 # @BlockdevVmdkAdapterType:
4454 # Adapter type info for VMDK images
4458 { 'enum': 'BlockdevVmdkAdapterType',
4459 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4462 # @BlockdevCreateOptionsVmdk:
4464 # Driver specific image creation options for VMDK.
4466 # @file: Where to store the new image file. This refers to the image
4467 # file for monolithcSparse and streamOptimized format, or the
4468 # descriptor file for other formats.
4469 # @size: Size of the virtual disk in bytes
4470 # @extents: Where to store the data extents. Required for monolithcFlat,
4471 # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4472 # monolithicFlat, only one entry is required; for
4473 # twoGbMaxExtent* formats, the number of entries required is
4474 # calculated as extent_number = virtual_size / 2GB. Providing
4475 # more extents than will be used is an error.
4476 # @subformat: The subformat of the VMDK image. Default: "monolithicSparse".
4477 # @backing-file: The path of backing file. Default: no backing file is used.
4478 # @adapter-type: The adapter type used to fill in the descriptor. Default: ide.
4479 # @hwversion: Hardware version. The meaningful options are "4" or "6".
4481 # @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats.
4486 { 'struct': 'BlockdevCreateOptionsVmdk',
4487 'data': { 'file': 'BlockdevRef',
4489 '*extents': ['BlockdevRef'],
4490 '*subformat': 'BlockdevVmdkSubformat',
4491 '*backing-file': 'str',
4492 '*adapter-type': 'BlockdevVmdkAdapterType',
4493 '*hwversion': 'str',
4494 '*zeroed-grain': 'bool' } }
4498 # @SheepdogRedundancyType:
4500 # @full: Create a fully replicated vdi with x copies
4501 # @erasure-coded: Create an erasure coded vdi with x data strips and
4506 { 'enum': 'SheepdogRedundancyType',
4507 'data': [ 'full', 'erasure-coded' ] }
4510 # @SheepdogRedundancyFull:
4512 # @copies: Number of copies to use (between 1 and 31)
4516 { 'struct': 'SheepdogRedundancyFull',
4517 'data': { 'copies': 'int' }}
4520 # @SheepdogRedundancyErasureCoded:
4522 # @data-strips: Number of data strips to use (one of {2,4,8,16})
4523 # @parity-strips: Number of parity strips to use (between 1 and 15)
4527 { 'struct': 'SheepdogRedundancyErasureCoded',
4528 'data': { 'data-strips': 'int',
4529 'parity-strips': 'int' }}
4532 # @SheepdogRedundancy:
4536 { 'union': 'SheepdogRedundancy',
4537 'base': { 'type': 'SheepdogRedundancyType' },
4538 'discriminator': 'type',
4539 'data': { 'full': 'SheepdogRedundancyFull',
4540 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
4543 # @BlockdevCreateOptionsSheepdog:
4545 # Driver specific image creation options for Sheepdog.
4547 # @location: Where to store the new image file
4548 # @size: Size of the virtual disk in bytes
4549 # @backing-file: File name of a base image
4550 # @preallocation: Preallocation mode for the new image (default: off;
4551 # allowed values: off, full)
4552 # @redundancy: Redundancy of the image
4553 # @object-size: Object size of the image
4557 { 'struct': 'BlockdevCreateOptionsSheepdog',
4558 'data': { 'location': 'BlockdevOptionsSheepdog',
4560 '*backing-file': 'str',
4561 '*preallocation': 'PreallocMode',
4562 '*redundancy': 'SheepdogRedundancy',
4563 '*object-size': 'size' } }
4566 # @BlockdevCreateOptionsSsh:
4568 # Driver specific image creation options for SSH.
4570 # @location: Where to store the new image file
4571 # @size: Size of the virtual disk in bytes
4575 { 'struct': 'BlockdevCreateOptionsSsh',
4576 'data': { 'location': 'BlockdevOptionsSsh',
4580 # @BlockdevCreateOptionsVdi:
4582 # Driver specific image creation options for VDI.
4584 # @file: Node to create the image format on
4585 # @size: Size of the virtual disk in bytes
4586 # @preallocation: Preallocation mode for the new image (default: off;
4587 # allowed values: off, metadata)
4591 { 'struct': 'BlockdevCreateOptionsVdi',
4592 'data': { 'file': 'BlockdevRef',
4594 '*preallocation': 'PreallocMode' } }
4597 # @BlockdevVhdxSubformat:
4599 # @dynamic: Growing image file
4600 # @fixed: Preallocated fixed-size image file
4604 { 'enum': 'BlockdevVhdxSubformat',
4605 'data': [ 'dynamic', 'fixed' ] }
4608 # @BlockdevCreateOptionsVhdx:
4610 # Driver specific image creation options for vhdx.
4612 # @file: Node to create the image format on
4613 # @size: Size of the virtual disk in bytes
4614 # @log-size: Log size in bytes, must be a multiple of 1 MB
4616 # @block-size: Block size in bytes, must be a multiple of 1 MB and not
4617 # larger than 256 MB (default: automatically choose a block
4618 # size depending on the image size)
4619 # @subformat: vhdx subformat (default: dynamic)
4620 # @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard,
4621 # but default. Do not set to 'off' when using 'qemu-img
4622 # convert' with subformat=dynamic.
4626 { 'struct': 'BlockdevCreateOptionsVhdx',
4627 'data': { 'file': 'BlockdevRef',
4629 '*log-size': 'size',
4630 '*block-size': 'size',
4631 '*subformat': 'BlockdevVhdxSubformat',
4632 '*block-state-zero': 'bool' } }
4635 # @BlockdevVpcSubformat:
4637 # @dynamic: Growing image file
4638 # @fixed: Preallocated fixed-size image file
4642 { 'enum': 'BlockdevVpcSubformat',
4643 'data': [ 'dynamic', 'fixed' ] }
4646 # @BlockdevCreateOptionsVpc:
4648 # Driver specific image creation options for vpc (VHD).
4650 # @file: Node to create the image format on
4651 # @size: Size of the virtual disk in bytes
4652 # @subformat: vhdx subformat (default: dynamic)
4653 # @force-size: Force use of the exact byte size instead of rounding to the
4654 # next size that can be represented in CHS geometry
4659 { 'struct': 'BlockdevCreateOptionsVpc',
4660 'data': { 'file': 'BlockdevRef',
4662 '*subformat': 'BlockdevVpcSubformat',
4663 '*force-size': 'bool' } }
4666 # @BlockdevCreateOptions:
4668 # Options for creating an image format on a given node.
4670 # @driver: block driver to create the image format
4674 { 'union': 'BlockdevCreateOptions',
4676 'driver': 'BlockdevDriver' },
4677 'discriminator': 'driver',
4679 'file': 'BlockdevCreateOptionsFile',
4680 'gluster': 'BlockdevCreateOptionsGluster',
4681 'luks': 'BlockdevCreateOptionsLUKS',
4682 'nfs': 'BlockdevCreateOptionsNfs',
4683 'parallels': 'BlockdevCreateOptionsParallels',
4684 'qcow': 'BlockdevCreateOptionsQcow',
4685 'qcow2': 'BlockdevCreateOptionsQcow2',
4686 'qed': 'BlockdevCreateOptionsQed',
4687 'rbd': 'BlockdevCreateOptionsRbd',
4688 'sheepdog': 'BlockdevCreateOptionsSheepdog',
4689 'ssh': 'BlockdevCreateOptionsSsh',
4690 'vdi': 'BlockdevCreateOptionsVdi',
4691 'vhdx': 'BlockdevCreateOptionsVhdx',
4692 'vmdk': 'BlockdevCreateOptionsVmdk',
4693 'vpc': 'BlockdevCreateOptionsVpc'
4699 # Starts a job to create an image format on a given node. The job is
4700 # automatically finalized, but a manual job-dismiss is required.
4702 # @job-id: Identifier for the newly created job.
4704 # @options: Options for the image creation.
4708 { 'command': 'blockdev-create',
4709 'data': { 'job-id': 'str',
4710 'options': 'BlockdevCreateOptions' } }
4713 # @BlockdevAmendOptionsLUKS:
4715 # Driver specific image amend options for LUKS.
4719 { 'struct': 'BlockdevAmendOptionsLUKS',
4720 'base': 'QCryptoBlockAmendOptionsLUKS',
4725 # @BlockdevAmendOptionsQcow2:
4727 # Driver specific image amend options for qcow2.
4728 # For now, only encryption options can be amended
4730 # @encrypt Encryption options to be amended
4734 { 'struct': 'BlockdevAmendOptionsQcow2',
4735 'data': { '*encrypt': 'QCryptoBlockAmendOptions' } }
4738 # @BlockdevAmendOptions:
4740 # Options for amending an image format
4742 # @driver: Block driver of the node to amend.
4746 { 'union': 'BlockdevAmendOptions',
4748 'driver': 'BlockdevDriver' },
4749 'discriminator': 'driver',
4751 'luks': 'BlockdevAmendOptionsLUKS',
4752 'qcow2': 'BlockdevAmendOptionsQcow2' } }
4755 # @x-blockdev-amend:
4757 # Starts a job to amend format specific options of an existing open block device
4758 # The job is automatically finalized, but a manual job-dismiss is required.
4760 # @job-id: Identifier for the newly created job.
4762 # @node-name: Name of the block node to work on
4764 # @options: Options (driver specific)
4766 # @force: Allow unsafe operations, format specific
4767 # For luks that allows erase of the last active keyslot
4768 # (permanent loss of data),
4769 # and replacement of an active keyslot
4770 # (possible loss of data if IO error happens)
4774 { 'command': 'x-blockdev-amend',
4775 'data': { 'job-id': 'str',
4777 'options': 'BlockdevAmendOptions',
4778 '*force': 'bool' } }
4781 # @BlockErrorAction:
4783 # An enumeration of action that has been taken when a DISK I/O occurs
4785 # @ignore: error has been ignored
4787 # @report: error has been reported to the device
4789 # @stop: error caused VM to be stopped
4793 { 'enum': 'BlockErrorAction',
4794 'data': [ 'ignore', 'report', 'stop' ] }
4798 # @BLOCK_IMAGE_CORRUPTED:
4800 # Emitted when a disk image is being marked corrupt. The image can be
4801 # identified by its device or node name. The 'device' field is always
4802 # present for compatibility reasons, but it can be empty ("") if the
4803 # image does not have a device name associated.
4805 # @device: device name. This is always present for compatibility
4806 # reasons, but it can be empty ("") if the image does not
4807 # have a device name associated.
4809 # @node-name: node name (Since: 2.4)
4811 # @msg: informative message for human consumption, such as the kind of
4812 # corruption being detected. It should not be parsed by machine as it is
4813 # not guaranteed to be stable
4815 # @offset: if the corruption resulted from an image access, this is
4816 # the host's access offset into the image
4818 # @size: if the corruption resulted from an image access, this is
4821 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4822 # event and must be repaired (Since 2.2; before, every
4823 # BLOCK_IMAGE_CORRUPTED event was fatal)
4825 # Note: If action is "stop", a STOP event will eventually follow the
4826 # BLOCK_IO_ERROR event.
4830 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4831 # "data": { "device": "ide0-hd0", "node-name": "node0",
4832 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4834 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4838 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4839 'data': { 'device' : 'str',
4840 '*node-name' : 'str',
4844 'fatal' : 'bool' } }
4849 # Emitted when a disk I/O error occurs
4851 # @device: device name. This is always present for compatibility
4852 # reasons, but it can be empty ("") if the image does not
4853 # have a device name associated.
4855 # @node-name: node name. Note that errors may be reported for the root node
4856 # that is directly attached to a guest device rather than for the
4857 # node where the error occurred. The node name is not present if
4858 # the drive is empty. (Since: 2.8)
4860 # @operation: I/O operation
4862 # @action: action that has been taken
4864 # @nospace: true if I/O error was caused due to a no-space
4865 # condition. This key is only present if query-block's
4866 # io-status is present, please see query-block documentation
4867 # for more information (since: 2.2)
4869 # @reason: human readable string describing the error cause.
4870 # (This field is a debugging aid for humans, it should not
4871 # be parsed by applications) (since: 2.2)
4873 # Note: If action is "stop", a STOP event will eventually follow the
4874 # BLOCK_IO_ERROR event
4880 # <- { "event": "BLOCK_IO_ERROR",
4881 # "data": { "device": "ide0-hd1",
4882 # "node-name": "#block212",
4883 # "operation": "write",
4884 # "action": "stop" },
4885 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4888 { 'event': 'BLOCK_IO_ERROR',
4889 'data': { 'device': 'str', '*node-name': 'str',
4890 'operation': 'IoOperationType',
4891 'action': 'BlockErrorAction', '*nospace': 'bool',
4895 # @BLOCK_JOB_COMPLETED:
4897 # Emitted when a block job has completed
4901 # @device: The job identifier. Originally the device name but other
4902 # values are allowed since QEMU 2.7
4904 # @len: maximum progress value
4906 # @offset: current progress value. On success this is equal to len.
4907 # On failure this is less than len
4909 # @speed: rate limit, bytes per second
4911 # @error: error message. Only present on failure. This field
4912 # contains a human-readable error message. There are no semantics
4913 # other than that streaming has failed and clients should not try to
4914 # interpret the error string
4920 # <- { "event": "BLOCK_JOB_COMPLETED",
4921 # "data": { "type": "stream", "device": "virtio-disk0",
4922 # "len": 10737418240, "offset": 10737418240,
4924 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4927 { 'event': 'BLOCK_JOB_COMPLETED',
4928 'data': { 'type' : 'JobType',
4936 # @BLOCK_JOB_CANCELLED:
4938 # Emitted when a block job has been cancelled
4942 # @device: The job identifier. Originally the device name but other
4943 # values are allowed since QEMU 2.7
4945 # @len: maximum progress value
4947 # @offset: current progress value. On success this is equal to len.
4948 # On failure this is less than len
4950 # @speed: rate limit, bytes per second
4956 # <- { "event": "BLOCK_JOB_CANCELLED",
4957 # "data": { "type": "stream", "device": "virtio-disk0",
4958 # "len": 10737418240, "offset": 134217728,
4960 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4963 { 'event': 'BLOCK_JOB_CANCELLED',
4964 'data': { 'type' : 'JobType',
4973 # Emitted when a block job encounters an error
4975 # @device: The job identifier. Originally the device name but other
4976 # values are allowed since QEMU 2.7
4978 # @operation: I/O operation
4980 # @action: action that has been taken
4986 # <- { "event": "BLOCK_JOB_ERROR",
4987 # "data": { "device": "ide0-hd1",
4988 # "operation": "write",
4989 # "action": "stop" },
4990 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4993 { 'event': 'BLOCK_JOB_ERROR',
4994 'data': { 'device' : 'str',
4995 'operation': 'IoOperationType',
4996 'action' : 'BlockErrorAction' } }
5001 # Emitted when a block job is ready to complete
5005 # @device: The job identifier. Originally the device name but other
5006 # values are allowed since QEMU 2.7
5008 # @len: maximum progress value
5010 # @offset: current progress value. On success this is equal to len.
5011 # On failure this is less than len
5013 # @speed: rate limit, bytes per second
5015 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
5022 # <- { "event": "BLOCK_JOB_READY",
5023 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5024 # "len": 2097152, "offset": 2097152 }
5025 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5028 { 'event': 'BLOCK_JOB_READY',
5029 'data': { 'type' : 'JobType',
5036 # @BLOCK_JOB_PENDING:
5038 # Emitted when a block job is awaiting explicit authorization to finalize graph
5039 # changes via @block-job-finalize. If this job is part of a transaction, it will
5040 # not emit this event until the transaction has converged first.
5044 # @id: The job identifier.
5050 # <- { "event": "BLOCK_JOB_WAITING",
5051 # "data": { "device": "drive0", "type": "mirror" },
5052 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5055 { 'event': 'BLOCK_JOB_PENDING',
5056 'data': { 'type' : 'JobType',
5062 # Preallocation mode of QEMU image file
5064 # @off: no preallocation
5065 # @metadata: preallocate only for metadata
5066 # @falloc: like @full preallocation but allocate disk space by
5067 # posix_fallocate() rather than writing data.
5068 # @full: preallocate all data by writing it to the device to ensure
5069 # disk space is really available. This data may or may not be
5070 # zero, depending on the image format and storage.
5071 # @full preallocation also sets up metadata correctly.
5075 { 'enum': 'PreallocMode',
5076 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5079 # @BLOCK_WRITE_THRESHOLD:
5081 # Emitted when writes on block device reaches or exceeds the
5082 # configured write threshold. For thin-provisioned devices, this
5083 # means the device should be extended to avoid pausing for
5085 # The event is one shot. Once triggered, it needs to be
5086 # re-registered with another block-set-write-threshold command.
5088 # @node-name: graph node name on which the threshold was exceeded.
5090 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5092 # @write-threshold: last configured threshold, in bytes.
5096 { 'event': 'BLOCK_WRITE_THRESHOLD',
5097 'data': { 'node-name': 'str',
5098 'amount-exceeded': 'uint64',
5099 'write-threshold': 'uint64' } }
5102 # @block-set-write-threshold:
5104 # Change the write threshold for a block drive. An event will be
5105 # delivered if a write to this block drive crosses the configured
5106 # threshold. The threshold is an offset, thus must be
5107 # non-negative. Default is no write threshold. Setting the threshold
5108 # to zero disables it.
5110 # This is useful to transparently resize thin-provisioned drives without
5111 # the guest OS noticing.
5113 # @node-name: graph node name on which the threshold must be set.
5115 # @write-threshold: configured threshold for the block device, bytes.
5116 # Use 0 to disable the threshold.
5122 # -> { "execute": "block-set-write-threshold",
5123 # "arguments": { "node-name": "mydev",
5124 # "write-threshold": 17179869184 } }
5125 # <- { "return": {} }
5128 { 'command': 'block-set-write-threshold',
5129 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
5132 # @x-blockdev-change:
5134 # Dynamically reconfigure the block driver state graph. It can be used
5135 # to add, remove, insert or replace a graph node. Currently only the
5136 # Quorum driver implements this feature to add or remove its child. This
5137 # is useful to fix a broken quorum child.
5139 # If @node is specified, it will be inserted under @parent. @child
5140 # may not be specified in this case. If both @parent and @child are
5141 # specified but @node is not, @child will be detached from @parent.
5143 # @parent: the id or name of the parent node.
5145 # @child: the name of a child under the given parent node.
5147 # @node: the name of the node that will be added.
5149 # Note: this command is experimental, and its API is not stable. It
5150 # does not support all kinds of operations, all kinds of children, nor
5151 # all block drivers.
5153 # FIXME Removing children from a quorum node means introducing gaps in the
5154 # child indices. This cannot be represented in the 'children' list of
5155 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
5157 # Warning: The data in a new quorum child MUST be consistent with that of
5158 # the rest of the array.
5164 # 1. Add a new node to a quorum
5165 # -> { "execute": "blockdev-add",
5168 # "node-name": "new_node",
5169 # "file": { "driver": "file",
5170 # "filename": "test.raw" } } }
5171 # <- { "return": {} }
5172 # -> { "execute": "x-blockdev-change",
5173 # "arguments": { "parent": "disk1",
5174 # "node": "new_node" } }
5175 # <- { "return": {} }
5177 # 2. Delete a quorum's node
5178 # -> { "execute": "x-blockdev-change",
5179 # "arguments": { "parent": "disk1",
5180 # "child": "children.1" } }
5181 # <- { "return": {} }
5184 { 'command': 'x-blockdev-change',
5185 'data' : { 'parent': 'str',
5190 # @x-blockdev-set-iothread:
5192 # Move @node and its children into the @iothread. If @iothread is null then
5193 # move @node and its children into the main loop.
5195 # The node must not be attached to a BlockBackend.
5197 # @node-name: the name of the block driver node
5199 # @iothread: the name of the IOThread object or null for the main loop
5201 # @force: true if the node and its children should be moved when a BlockBackend
5202 # is already attached
5204 # Note: this command is experimental and intended for test cases that need
5205 # control over IOThreads only.
5211 # 1. Move a node into an IOThread
5212 # -> { "execute": "x-blockdev-set-iothread",
5213 # "arguments": { "node-name": "disk1",
5214 # "iothread": "iothread0" } }
5215 # <- { "return": {} }
5217 # 2. Move a node into the main loop
5218 # -> { "execute": "x-blockdev-set-iothread",
5219 # "arguments": { "node-name": "disk1",
5220 # "iothread": null } }
5221 # <- { "return": {} }
5224 { 'command': 'x-blockdev-set-iothread',
5225 'data' : { 'node-name': 'str',
5226 'iothread': 'StrOrNull',
5227 '*force': 'bool' } }
5232 # An enumeration of the quorum operation types
5234 # @read: read operation
5236 # @write: write operation
5238 # @flush: flush operation
5242 { 'enum': 'QuorumOpType',
5243 'data': [ 'read', 'write', 'flush' ] }
5248 # Emitted by the Quorum block driver if it fails to establish a quorum
5250 # @reference: device name if defined else node name
5252 # @sector-num: number of the first sector of the failed read operation
5254 # @sectors-count: failed read operation sector count
5256 # Note: This event is rate-limited.
5262 # <- { "event": "QUORUM_FAILURE",
5263 # "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
5264 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5267 { 'event': 'QUORUM_FAILURE',
5268 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
5271 # @QUORUM_REPORT_BAD:
5273 # Emitted to report a corruption of a Quorum file
5275 # @type: quorum operation type (Since 2.6)
5277 # @error: error message. Only present on failure. This field
5278 # contains a human-readable error message. There are no semantics other
5279 # than that the block layer reported an error and clients should not
5280 # try to interpret the error string.
5282 # @node-name: the graph node name of the block driver state
5284 # @sector-num: number of the first sector of the failed read operation
5286 # @sectors-count: failed read operation sector count
5288 # Note: This event is rate-limited.
5296 # { "event": "QUORUM_REPORT_BAD",
5297 # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
5299 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5301 # 2. Flush operation
5303 # { "event": "QUORUM_REPORT_BAD",
5304 # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
5305 # "type": "flush", "error": "Broken pipe" },
5306 # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
5309 { 'event': 'QUORUM_REPORT_BAD',
5310 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
5311 'sector-num': 'int', 'sectors-count': 'int' } }
5314 # @BlockdevSnapshotInternal:
5316 # @device: the device name or node-name of a root node to generate the snapshot
5319 # @name: the name of the internal snapshot to be created
5321 # Notes: In transaction, if @name is empty, or any snapshot matching @name
5322 # exists, the operation will fail. Only some image formats support it,
5323 # for example, qcow2, rbd, and sheepdog.
5327 { 'struct': 'BlockdevSnapshotInternal',
5328 'data': { 'device': 'str', 'name': 'str' } }
5331 # @blockdev-snapshot-internal-sync:
5333 # Synchronously take an internal snapshot of a block device, when the
5334 # format of the image used supports it. If the name is an empty
5335 # string, or a snapshot with name already exists, the operation will
5338 # For the arguments, see the documentation of BlockdevSnapshotInternal.
5340 # Returns: - nothing on success
5341 # - If @device is not a valid block device, GenericError
5342 # - If any snapshot matching @name exists, or @name is empty,
5344 # - If the format of the image used does not support it,
5345 # BlockFormatFeatureNotSupported
5351 # -> { "execute": "blockdev-snapshot-internal-sync",
5352 # "arguments": { "device": "ide-hd0",
5353 # "name": "snapshot0" }
5355 # <- { "return": {} }
5358 { 'command': 'blockdev-snapshot-internal-sync',
5359 'data': 'BlockdevSnapshotInternal' }
5362 # @blockdev-snapshot-delete-internal-sync:
5364 # Synchronously delete an internal snapshot of a block device, when the format
5365 # of the image used support it. The snapshot is identified by name or id or
5366 # both. One of the name or id is required. Return SnapshotInfo for the
5367 # successfully deleted snapshot.
5369 # @device: the device name or node-name of a root node to delete the snapshot
5372 # @id: optional the snapshot's ID to be deleted
5374 # @name: optional the snapshot's name to be deleted
5376 # Returns: - SnapshotInfo on success
5377 # - If @device is not a valid block device, GenericError
5378 # - If snapshot not found, GenericError
5379 # - If the format of the image used does not support it,
5380 # BlockFormatFeatureNotSupported
5381 # - If @id and @name are both not specified, GenericError
5387 # -> { "execute": "blockdev-snapshot-delete-internal-sync",
5388 # "arguments": { "device": "ide-hd0",
5389 # "name": "snapshot0" }
5393 # "name": "snapshot0",
5394 # "vm-state-size": 0,
5395 # "date-sec": 1000012,
5397 # "vm-clock-sec": 100,
5398 # "vm-clock-nsec": 20,
5404 { 'command': 'blockdev-snapshot-delete-internal-sync',
5405 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
5406 'returns': 'SnapshotInfo' }