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: virtual (guest) offset of the first byte described by this
250 # @length: the number of bytes of the mapped virtual range
252 # @data: reading the image will actually read data from a file (in
253 # particular, if @offset is present this means that the sectors
254 # are not simply preallocated, but contain actual data in raw
257 # @zero: whether the virtual blocks read as zeroes
259 # @depth: number of layers (0 = top image, 1 = top image's backing
260 # file, ..., n - 1 = bottom image (where n is the number of
261 # images in the chain)) before reaching one for which the
264 # @offset: if present, the image file stores the data for this range
265 # in raw format at the given (host) offset
267 # @filename: filename that is referred to by @offset
272 { 'struct': 'MapEntry',
273 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
274 'zero': 'bool', 'depth': 'int', '*offset': 'int',
275 '*filename': 'str' } }
278 # @BlockdevCacheInfo:
280 # Cache mode information for a block device
282 # @writeback: true if writeback mode is enabled
283 # @direct: true if the host page cache is bypassed (O_DIRECT)
284 # @no-flush: true if flush requests are ignored for the device
288 { 'struct': 'BlockdevCacheInfo',
289 'data': { 'writeback': 'bool',
291 'no-flush': 'bool' } }
296 # Information about the backing device for a block device.
298 # @file: the filename of the backing device
300 # @node-name: the name of the block driver node (Since 2.0)
302 # @ro: true if the backing device was open read-only
304 # @drv: the name of the block format used to open the backing device. As of
305 # 0.14 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
306 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
307 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
308 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
309 # 2.2: 'archipelago' added, 'cow' dropped
310 # 2.3: 'host_floppy' deprecated
311 # 2.5: 'host_floppy' dropped
313 # 2.8: 'replication' added, 'tftp' dropped
314 # 2.9: 'archipelago' dropped
316 # @backing_file: the name of the backing file (for copy-on-write)
318 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
320 # @encrypted: true if the backing device is encrypted
322 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
324 # @bps: total throughput limit in bytes per second is specified
326 # @bps_rd: read throughput limit in bytes per second is specified
328 # @bps_wr: write throughput limit in bytes per second is specified
330 # @iops: total I/O operations per second is specified
332 # @iops_rd: read I/O operations per second is specified
334 # @iops_wr: write I/O operations per second is specified
336 # @image: the info of image used (since: 1.6)
338 # @bps_max: total throughput limit during bursts,
339 # in bytes (Since 1.7)
341 # @bps_rd_max: read throughput limit during bursts,
342 # in bytes (Since 1.7)
344 # @bps_wr_max: write throughput limit during bursts,
345 # in bytes (Since 1.7)
347 # @iops_max: total I/O operations per second during bursts,
348 # in bytes (Since 1.7)
350 # @iops_rd_max: read I/O operations per second during bursts,
351 # in bytes (Since 1.7)
353 # @iops_wr_max: write I/O operations per second during bursts,
354 # in bytes (Since 1.7)
356 # @bps_max_length: maximum length of the @bps_max burst
357 # period, in seconds. (Since 2.6)
359 # @bps_rd_max_length: maximum length of the @bps_rd_max
360 # burst period, in seconds. (Since 2.6)
362 # @bps_wr_max_length: maximum length of the @bps_wr_max
363 # burst period, in seconds. (Since 2.6)
365 # @iops_max_length: maximum length of the @iops burst
366 # period, in seconds. (Since 2.6)
368 # @iops_rd_max_length: maximum length of the @iops_rd_max
369 # burst period, in seconds. (Since 2.6)
371 # @iops_wr_max_length: maximum length of the @iops_wr_max
372 # burst period, in seconds. (Since 2.6)
374 # @iops_size: an I/O size in bytes (Since 1.7)
376 # @group: throttle group name (Since 2.4)
378 # @cache: the cache mode used for the block device (since: 2.3)
380 # @write_threshold: configured write threshold for the device.
381 # 0 if disabled. (Since 2.3)
383 # @dirty-bitmaps: dirty bitmaps information (only present if node
384 # has one or more dirty bitmaps) (Since 4.2)
389 { 'struct': 'BlockDeviceInfo',
390 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
391 '*backing_file': 'str', 'backing_file_depth': 'int',
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 # @DirtyBitmapStatus:
424 # An enumeration of possible states that a dirty bitmap can report to the user.
426 # @frozen: The bitmap is currently in-use by some operation and is immutable.
427 # If the bitmap was @active prior to the operation, new writes by the
428 # guest are being recorded in a temporary buffer, and will not be lost.
429 # Generally, bitmaps are cleared on successful use in an operation and
430 # the temporary buffer is committed into the bitmap. On failure, the
431 # temporary buffer is merged back into the bitmap without first
433 # Please refer to the documentation for each bitmap-using operation,
434 # See also @blockdev-backup, @drive-backup.
436 # @disabled: The bitmap is not currently recording new writes by the guest.
437 # This is requested explicitly via @block-dirty-bitmap-disable.
438 # It can still be cleared, deleted, or used for backup operations.
440 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
441 # deleted, or used for backup operations.
443 # @locked: The bitmap is currently in-use by some operation and is immutable.
444 # If the bitmap was @active prior to the operation, it is still
445 # recording new writes. If the bitmap was @disabled, it is not
446 # recording new writes. (Since 2.12)
448 # @inconsistent: This is a persistent dirty bitmap that was marked in-use on
449 # disk, and is unusable by QEMU. It can only be deleted.
450 # Please rely on the inconsistent field in @BlockDirtyInfo
451 # instead, as the status field is deprecated. (Since 4.0)
455 { 'enum': 'DirtyBitmapStatus',
456 'data': ['active', 'disabled', 'frozen', 'locked', 'inconsistent'] }
461 # Block dirty bitmap information.
463 # @name: the name of the dirty bitmap (Since 2.4)
465 # @count: number of dirty bytes according to the dirty bitmap
467 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
469 # @status: current status of the dirty bitmap (since 2.4)
471 # @recording: true if the bitmap is recording new writes from the guest.
472 # Replaces `active` and `disabled` statuses. (since 4.0)
474 # @busy: true if the bitmap is in-use by some operation (NBD or jobs)
475 # and cannot be modified via QMP or used by another operation.
476 # Replaces `locked` and `frozen` statuses. (since 4.0)
478 # @persistent: true if the bitmap was stored on disk, is scheduled to be stored
479 # on disk, or both. (since 4.0)
481 # @inconsistent: true if this is a persistent bitmap that was improperly
482 # stored. Implies @persistent to be true; @recording and
483 # @busy to be false. This bitmap cannot be used. To remove
484 # it, use @block-dirty-bitmap-remove. (Since 4.0)
487 # @deprecated: Member @status is deprecated. Use @recording and
492 { 'struct': 'BlockDirtyInfo',
493 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
494 'recording': 'bool', 'busy': 'bool',
495 'status': { 'type': 'DirtyBitmapStatus',
496 'features': [ 'deprecated' ] },
497 'persistent': 'bool', '*inconsistent': 'bool' } }
500 # @Qcow2BitmapInfoFlags:
502 # An enumeration of flags that a bitmap can report to the user.
504 # @in-use: This flag is set by any process actively modifying the qcow2 file,
505 # and cleared when the updated bitmap is flushed to the qcow2 image.
506 # The presence of this flag in an offline image means that the bitmap
507 # was not saved correctly after its last usage, and may contain
510 # @auto: The bitmap must reflect all changes of the virtual disk by any
511 # application that would write to this qcow2 file.
515 { 'enum': 'Qcow2BitmapInfoFlags',
516 'data': ['in-use', 'auto'] }
521 # Qcow2 bitmap information.
523 # @name: the name of the bitmap
525 # @granularity: granularity of the bitmap in bytes
527 # @flags: flags of the bitmap
531 { 'struct': 'Qcow2BitmapInfo',
532 'data': {'name': 'str', 'granularity': 'uint32',
533 'flags': ['Qcow2BitmapInfoFlags'] } }
536 # @BlockLatencyHistogramInfo:
538 # Block latency histogram.
540 # @boundaries: list of interval boundary values in nanoseconds, all greater
541 # than zero and in ascending order.
542 # For example, the list [10, 50, 100] produces the following
543 # histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
545 # @bins: list of io request counts corresponding to histogram intervals.
546 # len(@bins) = len(@boundaries) + 1
547 # For the example above, @bins may be something like [3, 1, 5, 2],
548 # and corresponding histogram looks like:
557 # +------------------
562 { 'struct': 'BlockLatencyHistogramInfo',
563 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
568 # Block device information. This structure describes a virtual device and
569 # the backing device associated with it.
571 # @device: The device name associated with the virtual device.
573 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
574 # device. (since 2.10)
576 # @type: This field is returned only for compatibility reasons, it should
577 # not be used (always returns 'unknown')
579 # @removable: True if the device supports removable media.
581 # @locked: True if the guest has locked this device from having its media
584 # @tray_open: True if the device's tray is open
585 # (only present if it has a tray)
587 # @dirty-bitmaps: dirty bitmaps information (only present if the
588 # driver has one or more dirty bitmaps) (Since 2.0)
590 # @io-status: @BlockDeviceIoStatus. Only present if the device
591 # supports it and the VM is configured to stop on errors
592 # (supported device models: virtio-blk, IDE, SCSI except
595 # @inserted: @BlockDeviceInfo describing the device if media is
599 # @deprecated: Member @dirty-bitmaps is deprecated. Use @inserted
600 # member @dirty-bitmaps instead.
604 { 'struct': 'BlockInfo',
605 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
606 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
607 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
608 '*dirty-bitmaps': { 'type': ['BlockDirtyInfo'],
609 'features': [ 'deprecated' ] } } }
614 # Image file size calculation information. This structure describes the size
615 # requirements for creating a new image file.
617 # The size requirements depend on the new image file format. File size always
618 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
619 # Compact formats such as 'qcow2' represent unallocated and zero regions
620 # efficiently so file size may be smaller than virtual disk size.
622 # The values are upper bounds that are guaranteed to fit the new image file.
623 # Subsequent modification, such as internal snapshot or further bitmap
624 # creation, may require additional space and is not covered here.
626 # @required: Size required for a new image file, in bytes, when copying just
627 # allocated guest-visible contents.
629 # @fully-allocated: Image file size, in bytes, once data has been written
630 # to all sectors, when copying just guest-visible contents.
632 # @bitmaps: Additional size required if all the top-level bitmap metadata
633 # in the source image were to be copied to the destination,
634 # present only when source and destination both support
635 # persistent bitmaps. (since 5.1)
639 { 'struct': 'BlockMeasureInfo',
640 'data': {'required': 'int', 'fully-allocated': 'int', '*bitmaps': 'int'} }
645 # Get a list of BlockInfo for all virtual block devices.
647 # Returns: a list of @BlockInfo describing each virtual block device. Filter
648 # nodes that were created implicitly are skipped over.
654 # -> { "execute": "query-block" }
659 # "device":"ide0-hd0",
666 # "file":"disks/test.qcow2",
667 # "backing_file_depth":1,
674 # "bps_max": 8000000,
681 # "detect_zeroes": "on",
682 # "write_threshold": 0,
684 # "filename":"disks/test.qcow2",
686 # "virtual-size":2048000,
687 # "backing_file":"base.qcow2",
688 # "full-backing-filename":"disks/base.qcow2",
689 # "backing-filename-format":"qcow2",
693 # "name": "snapshot1",
694 # "vm-state-size": 0,
695 # "date-sec": 10000200,
697 # "vm-clock-sec": 206,
698 # "vm-clock-nsec": 30
702 # "filename":"disks/base.qcow2",
704 # "virtual-size":2048000
708 # "qdev": "ide_disk",
713 # "device":"ide1-cd0",
716 # "qdev": "/machine/unattached/device[23]",
717 # "tray_open": false,
721 # "device":"floppy0",
724 # "qdev": "/machine/unattached/device[20]",
737 { 'command': 'query-block', 'returns': ['BlockInfo'] }
741 # @BlockDeviceTimedStats:
743 # Statistics of a block device during a given interval of time.
745 # @interval_length: Interval used for calculating the statistics,
748 # @min_rd_latency_ns: Minimum latency of read operations in the
749 # defined interval, in nanoseconds.
751 # @min_wr_latency_ns: Minimum latency of write operations in the
752 # defined interval, in nanoseconds.
754 # @min_flush_latency_ns: Minimum latency of flush operations in the
755 # defined interval, in nanoseconds.
757 # @max_rd_latency_ns: Maximum latency of read operations in the
758 # defined interval, in nanoseconds.
760 # @max_wr_latency_ns: Maximum latency of write operations in the
761 # defined interval, in nanoseconds.
763 # @max_flush_latency_ns: Maximum latency of flush operations in the
764 # defined interval, in nanoseconds.
766 # @avg_rd_latency_ns: Average latency of read operations in the
767 # defined interval, in nanoseconds.
769 # @avg_wr_latency_ns: Average latency of write operations in the
770 # defined interval, in nanoseconds.
772 # @avg_flush_latency_ns: Average latency of flush operations in the
773 # defined interval, in nanoseconds.
775 # @avg_rd_queue_depth: Average number of pending read operations
776 # in the defined interval.
778 # @avg_wr_queue_depth: Average number of pending write operations
779 # in the defined interval.
783 { 'struct': 'BlockDeviceTimedStats',
784 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
785 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
786 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
787 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
788 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
789 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
794 # Statistics of a virtual block device or a block backing device.
796 # @rd_bytes: The number of bytes read by the device.
798 # @wr_bytes: The number of bytes written by the device.
800 # @unmap_bytes: The number of bytes unmapped by the device (Since 4.2)
802 # @rd_operations: The number of read operations performed by the device.
804 # @wr_operations: The number of write operations performed by the device.
806 # @flush_operations: The number of cache flush operations performed by the
807 # device (since 0.15)
809 # @unmap_operations: The number of unmap operations performed by the device
812 # @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15).
814 # @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15).
816 # @flush_total_time_ns: Total time spent on cache flushes in nanoseconds
819 # @unmap_total_time_ns: Total time spent on unmap operations in nanoseconds
822 # @wr_highest_offset: The offset after the greatest byte written to the
823 # device. The intended use of this information is for
824 # growable sparse files (like qcow2) that are used on top
825 # of a physical device.
827 # @rd_merged: Number of read requests that have been merged into another
828 # request (Since 2.3).
830 # @wr_merged: Number of write requests that have been merged into another
831 # request (Since 2.3).
833 # @unmap_merged: Number of unmap requests that have been merged into another
834 # request (Since 4.2)
836 # @idle_time_ns: Time since the last I/O operation, in
837 # nanoseconds. If the field is absent it means that
838 # there haven't been any operations yet (Since 2.5).
840 # @failed_rd_operations: The number of failed read operations
841 # performed by the device (Since 2.5)
843 # @failed_wr_operations: The number of failed write operations
844 # performed by the device (Since 2.5)
846 # @failed_flush_operations: The number of failed flush operations
847 # performed by the device (Since 2.5)
849 # @failed_unmap_operations: The number of failed unmap operations performed
850 # by the device (Since 4.2)
852 # @invalid_rd_operations: The number of invalid read operations
853 # performed by the device (Since 2.5)
855 # @invalid_wr_operations: The number of invalid write operations
856 # performed by the device (Since 2.5)
858 # @invalid_flush_operations: The number of invalid flush operations
859 # performed by the device (Since 2.5)
861 # @invalid_unmap_operations: The number of invalid unmap operations performed
862 # by the device (Since 4.2)
864 # @account_invalid: Whether invalid operations are included in the
865 # last access statistics (Since 2.5)
867 # @account_failed: Whether failed operations are included in the
868 # latency and last access statistics (Since 2.5)
870 # @timed_stats: Statistics specific to the set of previously defined
871 # intervals of time (Since 2.5)
873 # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
875 # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
877 # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
881 { 'struct': 'BlockDeviceStats',
882 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int',
883 'rd_operations': 'int', 'wr_operations': 'int',
884 'flush_operations': 'int', 'unmap_operations': 'int',
885 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int',
886 'flush_total_time_ns': 'int', 'unmap_total_time_ns': 'int',
887 'wr_highest_offset': 'int',
888 'rd_merged': 'int', 'wr_merged': 'int', 'unmap_merged': 'int',
889 '*idle_time_ns': 'int',
890 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
891 'failed_flush_operations': 'int', 'failed_unmap_operations': 'int',
892 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int',
893 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int',
894 'account_invalid': 'bool', 'account_failed': 'bool',
895 'timed_stats': ['BlockDeviceTimedStats'],
896 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
897 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
898 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
901 # @BlockStatsSpecificFile:
903 # File driver statistics
905 # @discard-nb-ok: The number of successful discard operations performed by
908 # @discard-nb-failed: The number of failed discard operations performed by
911 # @discard-bytes-ok: The number of bytes discarded by the driver.
915 { 'struct': 'BlockStatsSpecificFile',
917 'discard-nb-ok': 'uint64',
918 'discard-nb-failed': 'uint64',
919 'discard-bytes-ok': 'uint64' } }
922 # @BlockStatsSpecificNvme:
924 # NVMe driver statistics
926 # @completion-errors: The number of completion errors.
928 # @aligned-accesses: The number of aligned accesses performed by
931 # @unaligned-accesses: The number of unaligned accesses performed by
936 { 'struct': 'BlockStatsSpecificNvme',
938 'completion-errors': 'uint64',
939 'aligned-accesses': 'uint64',
940 'unaligned-accesses': 'uint64' } }
943 # @BlockStatsSpecific:
945 # Block driver specific statistics
949 { 'union': 'BlockStatsSpecific',
950 'base': { 'driver': 'BlockdevDriver' },
951 'discriminator': 'driver',
953 'file': 'BlockStatsSpecificFile',
954 'host_device': 'BlockStatsSpecificFile',
955 'nvme': 'BlockStatsSpecificNvme' } }
960 # Statistics of a virtual block device or a block backing device.
962 # @device: If the stats are for a virtual block device, the name
963 # corresponding to the virtual block device.
965 # @node-name: The node name of the device. (Since 2.3)
967 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
968 # device. (since 3.0)
970 # @stats: A @BlockDeviceStats for the device.
972 # @driver-specific: Optional driver-specific stats. (Since 4.2)
974 # @parent: This describes the file block device if it has one.
975 # Contains recursively the statistics of the underlying
976 # protocol (e.g. the host file for a qcow2 image). If there is
977 # no underlying protocol, this field is omitted
979 # @backing: This describes the backing block device if it has one.
984 { 'struct': 'BlockStats',
985 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
986 'stats': 'BlockDeviceStats',
987 '*driver-specific': 'BlockStatsSpecific',
988 '*parent': 'BlockStats',
989 '*backing': 'BlockStats'} }
994 # Query the @BlockStats for all virtual block devices.
996 # @query-nodes: If true, the command will query all the block nodes
997 # that have a node name, in a list which will include "parent"
998 # information, but not "backing".
999 # If false or omitted, the behavior is as before - query all the
1000 # device backends, recursively including their "parent" and
1001 # "backing". Filter nodes that were created implicitly are
1002 # skipped over in this mode. (Since 2.3)
1004 # Returns: A list of @BlockStats for each virtual block devices.
1010 # -> { "execute": "query-blockstats" }
1014 # "device":"ide0-hd0",
1017 # "wr_highest_offset":3686448128,
1018 # "wr_bytes":9786368,
1019 # "wr_operations":751,
1020 # "rd_bytes":122567168,
1021 # "rd_operations":36772
1022 # "wr_total_times_ns":313253456
1023 # "rd_total_times_ns":3465673657
1024 # "flush_total_times_ns":49653
1025 # "flush_operations":61,
1028 # "idle_time_ns":2953431879,
1029 # "account_invalid":true,
1030 # "account_failed":false
1034 # "wr_highest_offset":2821110784,
1035 # "wr_bytes":9786368,
1036 # "wr_operations":692,
1037 # "rd_bytes":122739200,
1038 # "rd_operations":36604
1039 # "flush_operations":51,
1040 # "wr_total_times_ns":313253456
1041 # "rd_total_times_ns":3465673657
1042 # "flush_total_times_ns":49653,
1045 # "idle_time_ns":2953431879,
1046 # "account_invalid":true,
1047 # "account_failed":false
1049 # "qdev": "/machine/unattached/device[23]"
1052 # "device":"ide1-cd0",
1054 # "wr_highest_offset":0,
1056 # "wr_operations":0,
1059 # "flush_operations":0,
1060 # "wr_total_times_ns":0
1061 # "rd_total_times_ns":0
1062 # "flush_total_times_ns":0,
1065 # "account_invalid":false,
1066 # "account_failed":false
1068 # "qdev": "/machine/unattached/device[24]"
1071 # "device":"floppy0",
1073 # "wr_highest_offset":0,
1075 # "wr_operations":0,
1078 # "flush_operations":0,
1079 # "wr_total_times_ns":0
1080 # "rd_total_times_ns":0
1081 # "flush_total_times_ns":0,
1084 # "account_invalid":false,
1085 # "account_failed":false
1087 # "qdev": "/machine/unattached/device[16]"
1092 # "wr_highest_offset":0,
1094 # "wr_operations":0,
1097 # "flush_operations":0,
1098 # "wr_total_times_ns":0
1099 # "rd_total_times_ns":0
1100 # "flush_total_times_ns":0,
1103 # "account_invalid":false,
1104 # "account_failed":false
1111 { 'command': 'query-blockstats',
1112 'data': { '*query-nodes': 'bool' },
1113 'returns': ['BlockStats'] }
1118 # An enumeration of possible behaviors for errors on I/O operations.
1119 # The exact meaning depends on whether the I/O was initiated by a guest
1122 # @report: for guest operations, report the error to the guest;
1123 # for jobs, cancel the job
1125 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1126 # or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs retry
1127 # the failing request later and may still complete successfully. The
1128 # stream block job continues to stream and will complete with an
1131 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1133 # @stop: for guest operations, stop the virtual machine;
1134 # for jobs, pause the job
1136 # @auto: inherit the error handling policy of the backend (since: 2.7)
1140 { 'enum': 'BlockdevOnError',
1141 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1146 # An enumeration of possible behaviors for the initial synchronization
1147 # phase of storage mirroring.
1149 # @top: copies data in the topmost image to the destination
1151 # @full: copies data from all images to the destination
1153 # @none: only copy data written from now on
1155 # @incremental: only copy data described by the dirty bitmap. (since: 2.4)
1157 # @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
1158 # Behavior on completion is determined by the BitmapSyncMode.
1162 { 'enum': 'MirrorSyncMode',
1163 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1168 # An enumeration of possible behaviors for the synchronization of a bitmap
1169 # when used for data copy operations.
1171 # @on-success: The bitmap is only synced when the operation is successful.
1172 # This is the behavior always used for 'INCREMENTAL' backups.
1174 # @never: The bitmap is never synchronized with the operation, and is
1175 # treated solely as a read-only manifest of blocks to copy.
1177 # @always: The bitmap is always synchronized with the operation,
1178 # regardless of whether or not the operation was successful.
1182 { 'enum': 'BitmapSyncMode',
1183 'data': ['on-success', 'never', 'always'] }
1188 # An enumeration whose values tell the mirror block job when to
1189 # trigger writes to the target.
1191 # @background: copy data in background only.
1193 # @write-blocking: when data is written to the source, write it
1194 # (synchronously) to the target as well. In
1195 # addition, data is copied in background just like in
1200 { 'enum': 'MirrorCopyMode',
1201 'data': ['background', 'write-blocking'] }
1206 # Information about a long-running block device operation.
1208 # @type: the job type ('stream' for image streaming)
1210 # @device: The job identifier. Originally the device name but other
1211 # values are allowed since QEMU 2.7
1213 # @len: Estimated @offset value at the completion of the job. This value can
1214 # arbitrarily change while the job is running, in both directions.
1216 # @offset: Progress made until now. The unit is arbitrary and the value can
1217 # only meaningfully be used for the ratio of @offset to @len. The
1218 # value is monotonically increasing.
1220 # @busy: false if the job is known to be in a quiescent state, with
1221 # no pending I/O. Since 1.3.
1223 # @paused: whether the job is paused or, if @busy is true, will
1224 # pause itself as soon as possible. Since 1.3.
1226 # @speed: the rate limit, bytes per second
1228 # @io-status: the status of the job (since 1.3)
1230 # @ready: true if the job may be completed (since 2.2)
1232 # @status: Current job state/status (since 2.12)
1234 # @auto-finalize: Job will finalize itself when PENDING, moving to
1235 # the CONCLUDED state. (since 2.12)
1237 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1238 # state and disappearing from the query list. (since 2.12)
1240 # @error: Error information if the job did not complete successfully.
1241 # Not set if the job completed successfully. (since 2.12.1)
1245 { 'struct': 'BlockJobInfo',
1246 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1247 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1248 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1249 'status': 'JobStatus',
1250 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1254 # @query-block-jobs:
1256 # Return information about long-running block device operations.
1258 # Returns: a list of @BlockJobInfo for each active block job
1262 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1267 # This command sets the password of a block device that has not been open
1268 # with a password and requires one.
1270 # This command is now obsolete and will always return an error since 2.10
1273 { 'command': 'block_passwd',
1274 'data': { '*device': 'str',
1275 '*node-name': 'str',
1276 'password': 'str' } }
1281 # Resize a block image while a guest is running.
1283 # Either @device or @node-name must be set but not both.
1285 # @device: the name of the device to get the image resized
1287 # @node-name: graph node name to get the image resized (Since 2.0)
1289 # @size: new image size in bytes
1291 # Returns: - nothing on success
1292 # - If @device is not a valid block device, DeviceNotFound
1298 # -> { "execute": "block_resize",
1299 # "arguments": { "device": "scratch", "size": 1073741824 } }
1300 # <- { "return": {} }
1303 { 'command': 'block_resize',
1304 'data': { '*device': 'str',
1305 '*node-name': 'str',
1312 # An enumeration that tells QEMU how to set the backing file path in
1315 # @existing: QEMU should look for an existing image file.
1317 # @absolute-paths: QEMU should create a new image with absolute paths
1318 # for the backing file. If there is no backing file available, the new
1319 # image will not be backed either.
1323 { 'enum': 'NewImageMode',
1324 'data': [ 'existing', 'absolute-paths' ] }
1327 # @BlockdevSnapshotSync:
1329 # Either @device or @node-name must be set but not both.
1331 # @device: the name of the device to take a snapshot of.
1333 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1335 # @snapshot-file: the target of the new overlay image. If the file
1336 # exists, or if it is a device, the overlay will be created in the
1337 # existing file/device. Otherwise, a new file will be created.
1339 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1341 # @format: the format of the overlay image, default is 'qcow2'.
1343 # @mode: whether and how QEMU should create a new image, default is
1346 { 'struct': 'BlockdevSnapshotSync',
1347 'data': { '*device': 'str', '*node-name': 'str',
1348 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1349 '*format': 'str', '*mode': 'NewImageMode' } }
1352 # @BlockdevSnapshot:
1354 # @node: device or node name that will have a snapshot taken.
1356 # @overlay: reference to the existing block device that will become
1357 # the overlay of @node, as part of taking the snapshot.
1358 # It must not have a current backing file (this can be
1359 # achieved by passing "backing": null to blockdev-add).
1363 { 'struct': 'BlockdevSnapshot',
1364 'data': { 'node': 'str', 'overlay': 'str' } }
1369 # Optional parameters for backup. These parameters don't affect
1370 # functionality, but may significantly affect performance.
1372 # @use-copy-range: Use copy offloading. Default false.
1374 # @max-workers: Maximum number of parallel requests for the sustained background
1375 # copying process. Doesn't influence copy-before-write operations.
1378 # @max-chunk: Maximum request length for the sustained background copying
1379 # process. Doesn't influence copy-before-write operations.
1380 # 0 means unlimited. If max-chunk is non-zero then it should not be
1381 # less than job cluster size which is calculated as maximum of
1382 # target image cluster size and 64k. Default 0.
1386 { 'struct': 'BackupPerf',
1387 'data': { '*use-copy-range': 'bool',
1388 '*max-workers': 'int', '*max-chunk': 'int64' } }
1393 # @job-id: identifier for the newly-created block job. If
1394 # omitted, the device name will be used. (Since 2.7)
1396 # @device: the device name or node-name of a root node which should be copied.
1398 # @sync: what parts of the disk image should be copied to the destination
1399 # (all the disk, only the sectors allocated in the topmost image, from a
1400 # dirty bitmap, or only new I/O).
1402 # @speed: the maximum speed, in bytes per second. The default is 0,
1405 # @bitmap: The name of a dirty bitmap to use.
1406 # Must be present if sync is "bitmap" or "incremental".
1407 # Can be present if sync is "full" or "top".
1408 # Must not be present otherwise.
1409 # (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1411 # @bitmap-mode: Specifies the type of data the bitmap should contain after
1412 # the operation concludes.
1413 # Must be present if a bitmap was provided,
1414 # Must NOT be present otherwise. (Since 4.2)
1416 # @compress: true to compress data, if the target format supports it.
1417 # (default: false) (since 2.8)
1419 # @on-source-error: the action to take on an error on the source,
1420 # default 'report'. 'stop' and 'enospc' can only be used
1421 # if the block device supports io-status (see BlockInfo).
1423 # @on-target-error: the action to take on an error on the target,
1424 # default 'report' (no limitations, since this applies to
1425 # a different block device than @device).
1427 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1428 # finished its work, waiting for @block-job-finalize before
1429 # making any block graph changes.
1430 # When true, this job will automatically
1431 # perform its abort or commit actions.
1432 # Defaults to true. (Since 2.12)
1434 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1435 # has completely ceased all work, and awaits @block-job-dismiss.
1436 # When true, this job will automatically disappear from the query
1437 # list without user intervention.
1438 # Defaults to true. (Since 2.12)
1440 # @filter-node-name: the node name that should be assigned to the
1441 # filter driver that the backup job inserts into the graph
1442 # above node specified by @drive. If this option is not given,
1443 # a node name is autogenerated. (Since: 4.2)
1445 # @x-perf: Performance options. (Since 6.0)
1447 # Note: @on-source-error and @on-target-error only affect background
1448 # I/O. If an error occurs during a guest write request, the device's
1449 # rerror/werror actions will be used.
1453 { 'struct': 'BackupCommon',
1454 'data': { '*job-id': 'str', 'device': 'str',
1455 'sync': 'MirrorSyncMode', '*speed': 'int',
1456 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1457 '*compress': 'bool',
1458 '*on-source-error': 'BlockdevOnError',
1459 '*on-target-error': 'BlockdevOnError',
1460 '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
1461 '*filter-node-name': 'str', '*x-perf': 'BackupPerf' } }
1466 # @target: the target of the new image. If the file exists, or if it
1467 # is a device, the existing file/device will be used as the new
1468 # destination. If it does not exist, a new file will be created.
1470 # @format: the format of the new destination, default is to
1471 # probe if @mode is 'existing', else the format of the source
1473 # @mode: whether and how QEMU should create a new image, default is
1478 { 'struct': 'DriveBackup',
1479 'base': 'BackupCommon',
1480 'data': { 'target': 'str',
1482 '*mode': 'NewImageMode' } }
1487 # @target: the device name or node-name of the backup target node.
1491 { 'struct': 'BlockdevBackup',
1492 'base': 'BackupCommon',
1493 'data': { 'target': 'str' } }
1496 # @blockdev-snapshot-sync:
1498 # Takes a synchronous snapshot of a block device.
1500 # For the arguments, see the documentation of BlockdevSnapshotSync.
1502 # Returns: - nothing on success
1503 # - If @device is not a valid block device, DeviceNotFound
1509 # -> { "execute": "blockdev-snapshot-sync",
1510 # "arguments": { "device": "ide-hd0",
1512 # "/some/place/my-image",
1513 # "format": "qcow2" } }
1514 # <- { "return": {} }
1517 { 'command': 'blockdev-snapshot-sync',
1518 'data': 'BlockdevSnapshotSync' }
1522 # @blockdev-snapshot:
1524 # Takes a snapshot of a block device.
1526 # Take a snapshot, by installing 'node' as the backing image of
1527 # 'overlay'. Additionally, if 'node' is associated with a block
1528 # device, the block device changes to using 'overlay' as its new active
1531 # For the arguments, see the documentation of BlockdevSnapshot.
1534 # @allow-write-only-overlay: If present, the check whether this operation is safe
1535 # was relaxed so that it can be used to change
1536 # backing file of a destination of a blockdev-mirror.
1543 # -> { "execute": "blockdev-add",
1544 # "arguments": { "driver": "qcow2",
1545 # "node-name": "node1534",
1546 # "file": { "driver": "file",
1547 # "filename": "hd1.qcow2" },
1548 # "backing": null } }
1550 # <- { "return": {} }
1552 # -> { "execute": "blockdev-snapshot",
1553 # "arguments": { "node": "ide-hd0",
1554 # "overlay": "node1534" } }
1555 # <- { "return": {} }
1558 { 'command': 'blockdev-snapshot',
1559 'data': 'BlockdevSnapshot',
1560 'features': [ 'allow-write-only-overlay' ] }
1563 # @change-backing-file:
1565 # Change the backing file in the image file metadata. This does not
1566 # cause QEMU to reopen the image file to reparse the backing filename
1567 # (it may, however, perform a reopen to change permissions from
1568 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1569 # into the image file metadata, and the QEMU internal strings are
1572 # @image-node-name: The name of the block driver state node of the
1573 # image to modify. The "device" argument is used
1574 # to verify "image-node-name" is in the chain
1575 # described by "device".
1577 # @device: The device name or node-name of the root node that owns
1580 # @backing-file: The string to write as the backing file. This
1581 # string is not validated, so care should be taken
1582 # when specifying the string or the image chain may
1583 # not be able to be reopened again.
1585 # Returns: - Nothing on success
1586 # - If "device" does not exist or cannot be determined, DeviceNotFound
1590 { 'command': 'change-backing-file',
1591 'data': { 'device': 'str', 'image-node-name': 'str',
1592 'backing-file': 'str' } }
1597 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1598 # writes data between 'top' and 'base' into 'base'.
1600 # If top == base, that is an error.
1601 # If top has no overlays on top of it, or if it is in use by a writer,
1602 # the job will not be completed by itself. The user needs to complete
1603 # the job with the block-job-complete command after getting the ready
1604 # event. (Since 2.0)
1606 # If the base image is smaller than top, then the base image will be
1607 # resized to be the same size as top. If top is smaller than the base
1608 # image, the base will not be truncated. If you want the base image
1609 # size to match the size of the smaller top, you can safely truncate
1610 # it yourself once the commit operation successfully completes.
1612 # @job-id: identifier for the newly-created block job. If
1613 # omitted, the device name will be used. (Since 2.7)
1615 # @device: the device name or node-name of a root node
1617 # @base-node: The node name of the backing image to write data into.
1618 # If not specified, this is the deepest backing image.
1621 # @base: Same as @base-node, except that it is a file name rather than a node
1622 # name. This must be the exact filename string that was used to open the
1623 # node; other strings, even if addressing the same file, are not
1626 # @top-node: The node name of the backing image within the image chain
1627 # which contains the topmost data to be committed down. If
1628 # not specified, this is the active layer. (since: 3.1)
1630 # @top: Same as @top-node, except that it is a file name rather than a node
1631 # name. This must be the exact filename string that was used to open the
1632 # node; other strings, even if addressing the same file, are not
1635 # @backing-file: The backing file string to write into the overlay
1636 # image of 'top'. If 'top' does not have an overlay
1637 # image, or if 'top' is in use by a writer, specifying
1638 # a backing file string is an error.
1640 # This filename is not validated. If a pathname string
1641 # is such that it cannot be resolved by QEMU, that
1642 # means that subsequent QMP or HMP commands must use
1643 # node-names for the image in question, as filename
1644 # lookup methods will fail.
1646 # If not specified, QEMU will automatically determine
1647 # the backing file string to use, or error out if
1648 # there is no obvious choice. Care should be taken
1649 # when specifying the string, to specify a valid
1650 # filename or protocol.
1653 # @speed: the maximum speed, in bytes per second
1655 # @on-error: the action to take on an error. 'ignore' means that the request
1656 # should be retried. (default: report; Since: 5.0)
1658 # @filter-node-name: the node name that should be assigned to the
1659 # filter driver that the commit job inserts into the graph
1660 # above @top. If this option is not given, a node name is
1661 # autogenerated. (Since: 2.9)
1663 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1664 # finished its work, waiting for @block-job-finalize before
1665 # making any block graph changes.
1666 # When true, this job will automatically
1667 # perform its abort or commit actions.
1668 # Defaults to true. (Since 3.1)
1670 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1671 # has completely ceased all work, and awaits @block-job-dismiss.
1672 # When true, this job will automatically disappear from the query
1673 # list without user intervention.
1674 # Defaults to true. (Since 3.1)
1677 # @deprecated: Members @base and @top are deprecated. Use @base-node
1678 # and @top-node instead.
1680 # Returns: - Nothing on success
1681 # - If @device does not exist, DeviceNotFound
1682 # - Any other error returns a GenericError.
1688 # -> { "execute": "block-commit",
1689 # "arguments": { "device": "virtio0",
1690 # "top": "/tmp/snap1.qcow2" } }
1691 # <- { "return": {} }
1694 { 'command': 'block-commit',
1695 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1696 '*base': { 'type': 'str', 'features': [ 'deprecated' ] },
1698 '*top': { 'type': 'str', 'features': [ 'deprecated' ] },
1699 '*backing-file': 'str', '*speed': 'int',
1700 '*on-error': 'BlockdevOnError',
1701 '*filter-node-name': 'str',
1702 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1707 # Start a point-in-time copy of a block device to a new destination. The
1708 # status of ongoing drive-backup operations can be checked with
1709 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1710 # The operation can be stopped before it has completed using the
1711 # block-job-cancel command.
1713 # Returns: - nothing on success
1714 # - If @device is not a valid block device, GenericError
1720 # -> { "execute": "drive-backup",
1721 # "arguments": { "device": "drive0",
1723 # "target": "backup.img" } }
1724 # <- { "return": {} }
1727 { 'command': 'drive-backup', 'boxed': true,
1728 'data': 'DriveBackup' }
1733 # Start a point-in-time copy of a block device to a new destination. The
1734 # status of ongoing blockdev-backup operations can be checked with
1735 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1736 # The operation can be stopped before it has completed using the
1737 # block-job-cancel command.
1739 # Returns: - nothing on success
1740 # - If @device is not a valid block device, DeviceNotFound
1745 # -> { "execute": "blockdev-backup",
1746 # "arguments": { "device": "src-id",
1748 # "target": "tgt-id" } }
1749 # <- { "return": {} }
1752 { 'command': 'blockdev-backup', 'boxed': true,
1753 'data': 'BlockdevBackup' }
1757 # @query-named-block-nodes:
1759 # Get the named block driver list
1761 # @flat: Omit the nested data about backing image ("backing-image" key) if true.
1762 # Default is false (Since 5.0)
1764 # Returns: the list of BlockDeviceInfo
1770 # -> { "execute": "query-named-block-nodes" }
1771 # <- { "return": [ { "ro":false,
1773 # "encrypted":false,
1774 # "file":"disks/test.qcow2",
1775 # "node-name": "my-node",
1776 # "backing_file_depth":1,
1783 # "bps_max": 8000000,
1790 # "write_threshold": 0,
1792 # "filename":"disks/test.qcow2",
1794 # "virtual-size":2048000,
1795 # "backing_file":"base.qcow2",
1796 # "full-backing-filename":"disks/base.qcow2",
1797 # "backing-filename-format":"qcow2",
1801 # "name": "snapshot1",
1802 # "vm-state-size": 0,
1803 # "date-sec": 10000200,
1805 # "vm-clock-sec": 206,
1806 # "vm-clock-nsec": 30
1810 # "filename":"disks/base.qcow2",
1812 # "virtual-size":2048000
1817 { 'command': 'query-named-block-nodes',
1818 'returns': [ 'BlockDeviceInfo' ],
1819 'data': { '*flat': 'bool' } }
1822 # @XDbgBlockGraphNodeType:
1824 # @block-backend: corresponds to BlockBackend
1826 # @block-job: corresponds to BlockJob
1828 # @block-driver: corresponds to BlockDriverState
1832 { 'enum': 'XDbgBlockGraphNodeType',
1833 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1836 # @XDbgBlockGraphNode:
1838 # @id: Block graph node identifier. This @id is generated only for
1839 # x-debug-query-block-graph and does not relate to any other identifiers in
1842 # @type: Type of graph node. Can be one of block-backend, block-job or
1843 # block-driver-state.
1845 # @name: Human readable name of the node. Corresponds to node-name for
1846 # block-driver-state nodes; is not guaranteed to be unique in the whole
1847 # graph (with block-jobs and block-backends).
1851 { 'struct': 'XDbgBlockGraphNode',
1852 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1857 # Enum of base block permissions.
1859 # @consistent-read: A user that has the "permission" of consistent reads is
1860 # guaranteed that their view of the contents of the block
1861 # device is complete and self-consistent, representing the
1862 # contents of a disk at a specific point.
1863 # For most block devices (including their backing files) this
1864 # is true, but the property cannot be maintained in a few
1865 # situations like for intermediate nodes of a commit block
1868 # @write: This permission is required to change the visible disk contents.
1870 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1871 # both enough and required for writes to the block node when
1872 # the caller promises that the visible disk content doesn't
1874 # As the BLK_PERM_WRITE permission is strictly stronger,
1875 # either is sufficient to perform an unchanging write.
1877 # @resize: This permission is required to change the size of a block node.
1879 # @graph-mod: This permission is required to change the node that this
1880 # BdrvChild points to.
1884 { 'enum': 'BlockPermission',
1885 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
1888 # @XDbgBlockGraphEdge:
1890 # Block Graph edge description for x-debug-query-block-graph.
1892 # @parent: parent id
1896 # @name: name of the relation (examples are 'file' and 'backing')
1898 # @perm: granted permissions for the parent operating on the child
1900 # @shared-perm: permissions that can still be granted to other users of the
1901 # child while it is still attached to this parent
1905 { 'struct': 'XDbgBlockGraphEdge',
1906 'data': { 'parent': 'uint64', 'child': 'uint64',
1907 'name': 'str', 'perm': [ 'BlockPermission' ],
1908 'shared-perm': [ 'BlockPermission' ] } }
1913 # Block Graph - list of nodes and list of edges.
1917 { 'struct': 'XDbgBlockGraph',
1918 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1921 # @x-debug-query-block-graph:
1923 # Get the block graph.
1927 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph' }
1932 # Start mirroring a block device's writes to a new destination. target
1933 # specifies the target of the new image. If the file exists, or if it
1934 # is a device, it will be used as the new destination for writes. If
1935 # it does not exist, a new file will be created. format specifies the
1936 # format of the mirror image, default is to probe if mode='existing',
1937 # else the format of the source.
1939 # Returns: - nothing on success
1940 # - If @device is not a valid block device, GenericError
1946 # -> { "execute": "drive-mirror",
1947 # "arguments": { "device": "ide-hd0",
1948 # "target": "/some/place/my-image",
1950 # "format": "qcow2" } }
1951 # <- { "return": {} }
1954 { 'command': 'drive-mirror', 'boxed': true,
1955 'data': 'DriveMirror' }
1960 # A set of parameters describing drive mirror setup.
1962 # @job-id: identifier for the newly-created block job. If
1963 # omitted, the device name will be used. (Since 2.7)
1965 # @device: the device name or node-name of a root node whose writes should be
1968 # @target: the target of the new image. If the file exists, or if it
1969 # is a device, the existing file/device will be used as the new
1970 # destination. If it does not exist, a new file will be created.
1972 # @format: the format of the new destination, default is to
1973 # probe if @mode is 'existing', else the format of the source
1975 # @node-name: the new block driver state node name in the graph
1978 # @replaces: with sync=full graph node name to be replaced by the new
1979 # image when a whole image copy is done. This can be used to repair
1980 # broken Quorum files. By default, @device is replaced, although
1981 # implicitly created filters on it are kept. (Since 2.1)
1983 # @mode: whether and how QEMU should create a new image, default is
1986 # @speed: the maximum speed, in bytes per second
1988 # @sync: what parts of the disk image should be copied to the destination
1989 # (all the disk, only the sectors allocated in the topmost image, or
1992 # @granularity: granularity of the dirty bitmap, default is 64K
1993 # if the image format doesn't have clusters, 4K if the clusters
1994 # are smaller than that, else the cluster size. Must be a
1995 # power of 2 between 512 and 64M (since 1.4).
1997 # @buf-size: maximum amount of data in flight from source to
1998 # target (since 1.4).
2000 # @on-source-error: the action to take on an error on the source,
2001 # default 'report'. 'stop' and 'enospc' can only be used
2002 # if the block device supports io-status (see BlockInfo).
2004 # @on-target-error: the action to take on an error on the target,
2005 # default 'report' (no limitations, since this applies to
2006 # a different block device than @device).
2007 # @unmap: Whether to try to unmap target sectors where source has
2008 # only zero. If true, and target unallocated sectors will read as zero,
2009 # target image sectors will be unmapped; otherwise, zeroes will be
2010 # written. Both will result in identical contents.
2011 # Default is true. (Since 2.4)
2013 # @copy-mode: when to copy data to the destination; defaults to 'background'
2016 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2017 # finished its work, waiting for @block-job-finalize before
2018 # making any block graph changes.
2019 # When true, this job will automatically
2020 # perform its abort or commit actions.
2021 # Defaults to true. (Since 3.1)
2023 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2024 # has completely ceased all work, and awaits @block-job-dismiss.
2025 # When true, this job will automatically disappear from the query
2026 # list without user intervention.
2027 # Defaults to true. (Since 3.1)
2030 { 'struct': 'DriveMirror',
2031 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2032 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
2033 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2034 '*speed': 'int', '*granularity': 'uint32',
2035 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2036 '*on-target-error': 'BlockdevOnError',
2037 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
2038 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2041 # @BlockDirtyBitmap:
2043 # @node: name of device/node which the bitmap is tracking
2045 # @name: name of the dirty bitmap
2049 { 'struct': 'BlockDirtyBitmap',
2050 'data': { 'node': 'str', 'name': 'str' } }
2053 # @BlockDirtyBitmapAdd:
2055 # @node: name of device/node which the bitmap is tracking
2057 # @name: name of the dirty bitmap (must be less than 1024 bytes)
2059 # @granularity: the bitmap granularity, default is 64k for
2060 # block-dirty-bitmap-add
2062 # @persistent: the bitmap is persistent, i.e. it will be saved to the
2063 # corresponding block device image file on its close. For now only
2064 # Qcow2 disks support persistent bitmaps. Default is false for
2065 # block-dirty-bitmap-add. (Since: 2.10)
2067 # @disabled: the bitmap is created in the disabled state, which means that
2068 # it will not track drive changes. The bitmap may be enabled with
2069 # block-dirty-bitmap-enable. Default is false. (Since: 4.0)
2073 { 'struct': 'BlockDirtyBitmapAdd',
2074 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
2075 '*persistent': 'bool', '*disabled': 'bool' } }
2078 # @BlockDirtyBitmapMergeSource:
2080 # @local: name of the bitmap, attached to the same node as target bitmap.
2082 # @external: bitmap with specified node
2086 { 'alternate': 'BlockDirtyBitmapMergeSource',
2087 'data': { 'local': 'str',
2088 'external': 'BlockDirtyBitmap' } }
2091 # @BlockDirtyBitmapMerge:
2093 # @node: name of device/node which the @target bitmap is tracking
2095 # @target: name of the destination dirty bitmap
2097 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully
2098 # specified BlockDirtyBitmap elements. The latter are supported
2103 { 'struct': 'BlockDirtyBitmapMerge',
2104 'data': { 'node': 'str', 'target': 'str',
2105 'bitmaps': ['BlockDirtyBitmapMergeSource'] } }
2108 # @block-dirty-bitmap-add:
2110 # Create a dirty bitmap with a name on the node, and start tracking the writes.
2112 # Returns: - nothing on success
2113 # - If @node is not a valid block device or node, DeviceNotFound
2114 # - If @name is already taken, GenericError with an explanation
2120 # -> { "execute": "block-dirty-bitmap-add",
2121 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2122 # <- { "return": {} }
2125 { 'command': 'block-dirty-bitmap-add',
2126 'data': 'BlockDirtyBitmapAdd' }
2129 # @block-dirty-bitmap-remove:
2131 # Stop write tracking and remove the dirty bitmap that was created
2132 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2135 # Returns: - nothing on success
2136 # - If @node is not a valid block device or node, DeviceNotFound
2137 # - If @name is not found, GenericError with an explanation
2138 # - if @name is frozen by an operation, GenericError
2144 # -> { "execute": "block-dirty-bitmap-remove",
2145 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2146 # <- { "return": {} }
2149 { 'command': 'block-dirty-bitmap-remove',
2150 'data': 'BlockDirtyBitmap' }
2153 # @block-dirty-bitmap-clear:
2155 # Clear (reset) a dirty bitmap on the device, so that an incremental
2156 # backup from this point in time forward will only backup clusters
2157 # modified after this clear operation.
2159 # Returns: - nothing on success
2160 # - If @node is not a valid block device, DeviceNotFound
2161 # - If @name is not found, GenericError with an explanation
2167 # -> { "execute": "block-dirty-bitmap-clear",
2168 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2169 # <- { "return": {} }
2172 { 'command': 'block-dirty-bitmap-clear',
2173 'data': 'BlockDirtyBitmap' }
2176 # @block-dirty-bitmap-enable:
2178 # Enables a dirty bitmap so that it will begin tracking disk changes.
2180 # Returns: - nothing on success
2181 # - If @node is not a valid block device, DeviceNotFound
2182 # - If @name is not found, GenericError with an explanation
2188 # -> { "execute": "block-dirty-bitmap-enable",
2189 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2190 # <- { "return": {} }
2193 { 'command': 'block-dirty-bitmap-enable',
2194 'data': 'BlockDirtyBitmap' }
2197 # @block-dirty-bitmap-disable:
2199 # Disables a dirty bitmap so that it will stop tracking disk changes.
2201 # Returns: - nothing on success
2202 # - If @node is not a valid block device, DeviceNotFound
2203 # - If @name is not found, GenericError with an explanation
2209 # -> { "execute": "block-dirty-bitmap-disable",
2210 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2211 # <- { "return": {} }
2214 { 'command': 'block-dirty-bitmap-disable',
2215 'data': 'BlockDirtyBitmap' }
2218 # @block-dirty-bitmap-merge:
2220 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2221 # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2222 # as the @target bitmap. Any bits already set in @target will still be
2223 # set after the merge, i.e., this operation does not clear the target.
2224 # On error, @target is unchanged.
2226 # The resulting bitmap will count as dirty any clusters that were dirty in any
2227 # of the source bitmaps. This can be used to achieve backup checkpoints, or in
2228 # simpler usages, to copy bitmaps.
2230 # Returns: - nothing on success
2231 # - If @node is not a valid block device, DeviceNotFound
2232 # - If any bitmap in @bitmaps or @target is not found, GenericError
2233 # - If any of the bitmaps have different sizes or granularities,
2240 # -> { "execute": "block-dirty-bitmap-merge",
2241 # "arguments": { "node": "drive0", "target": "bitmap0",
2242 # "bitmaps": ["bitmap1"] } }
2243 # <- { "return": {} }
2246 { 'command': 'block-dirty-bitmap-merge',
2247 'data': 'BlockDirtyBitmapMerge' }
2250 # @BlockDirtyBitmapSha256:
2252 # SHA256 hash of dirty bitmap data
2254 # @sha256: ASCII representation of SHA256 bitmap hash
2258 { 'struct': 'BlockDirtyBitmapSha256',
2259 'data': {'sha256': 'str'} }
2262 # @x-debug-block-dirty-bitmap-sha256:
2264 # Get bitmap SHA256.
2266 # Returns: - BlockDirtyBitmapSha256 on success
2267 # - If @node is not a valid block device, DeviceNotFound
2268 # - If @name is not found or if hashing has failed, GenericError with an
2273 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2274 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
2279 # Start mirroring a block device's writes to a new destination.
2281 # @job-id: identifier for the newly-created block job. If
2282 # omitted, the device name will be used. (Since 2.7)
2284 # @device: The device name or node-name of a root node whose writes should be
2287 # @target: the id or node-name of the block device to mirror to. This mustn't be
2288 # attached to guest.
2290 # @replaces: with sync=full graph node name to be replaced by the new
2291 # image when a whole image copy is done. This can be used to repair
2292 # broken Quorum files. By default, @device is replaced, although
2293 # implicitly created filters on it are kept.
2295 # @speed: the maximum speed, in bytes per second
2297 # @sync: what parts of the disk image should be copied to the destination
2298 # (all the disk, only the sectors allocated in the topmost image, or
2301 # @granularity: granularity of the dirty bitmap, default is 64K
2302 # if the image format doesn't have clusters, 4K if the clusters
2303 # are smaller than that, else the cluster size. Must be a
2304 # power of 2 between 512 and 64M
2306 # @buf-size: maximum amount of data in flight from source to
2309 # @on-source-error: the action to take on an error on the source,
2310 # default 'report'. 'stop' and 'enospc' can only be used
2311 # if the block device supports io-status (see BlockInfo).
2313 # @on-target-error: the action to take on an error on the target,
2314 # default 'report' (no limitations, since this applies to
2315 # a different block device than @device).
2317 # @filter-node-name: the node name that should be assigned to the
2318 # filter driver that the mirror job inserts into the graph
2319 # above @device. If this option is not given, a node name is
2320 # autogenerated. (Since: 2.9)
2322 # @copy-mode: when to copy data to the destination; defaults to 'background'
2325 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2326 # finished its work, waiting for @block-job-finalize before
2327 # making any block graph changes.
2328 # When true, this job will automatically
2329 # perform its abort or commit actions.
2330 # Defaults to true. (Since 3.1)
2332 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2333 # has completely ceased all work, and awaits @block-job-dismiss.
2334 # When true, this job will automatically disappear from the query
2335 # list without user intervention.
2336 # Defaults to true. (Since 3.1)
2337 # Returns: nothing on success.
2343 # -> { "execute": "blockdev-mirror",
2344 # "arguments": { "device": "ide-hd0",
2345 # "target": "target0",
2346 # "sync": "full" } }
2347 # <- { "return": {} }
2350 { 'command': 'blockdev-mirror',
2351 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2353 'sync': 'MirrorSyncMode',
2354 '*speed': 'int', '*granularity': 'uint32',
2355 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2356 '*on-target-error': 'BlockdevOnError',
2357 '*filter-node-name': 'str',
2358 '*copy-mode': 'MirrorCopyMode',
2359 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2364 # A set of parameters describing block throttling.
2366 # @device: Block device name
2368 # @id: The name or QOM path of the guest device (since: 2.8)
2370 # @bps: total throughput limit in bytes per second
2372 # @bps_rd: read throughput limit in bytes per second
2374 # @bps_wr: write throughput limit in bytes per second
2376 # @iops: total I/O operations per second
2378 # @iops_rd: read I/O operations per second
2380 # @iops_wr: write I/O operations per second
2382 # @bps_max: total throughput limit during bursts,
2383 # in bytes (Since 1.7)
2385 # @bps_rd_max: read throughput limit during bursts,
2386 # in bytes (Since 1.7)
2388 # @bps_wr_max: write throughput limit during bursts,
2389 # in bytes (Since 1.7)
2391 # @iops_max: total I/O operations per second during bursts,
2392 # in bytes (Since 1.7)
2394 # @iops_rd_max: read I/O operations per second during bursts,
2395 # in bytes (Since 1.7)
2397 # @iops_wr_max: write I/O operations per second during bursts,
2398 # in bytes (Since 1.7)
2400 # @bps_max_length: maximum length of the @bps_max burst
2401 # period, in seconds. It must only
2402 # be set if @bps_max is set as well.
2403 # Defaults to 1. (Since 2.6)
2405 # @bps_rd_max_length: maximum length of the @bps_rd_max
2406 # burst period, in seconds. It must only
2407 # be set if @bps_rd_max is set as well.
2408 # Defaults to 1. (Since 2.6)
2410 # @bps_wr_max_length: maximum length of the @bps_wr_max
2411 # burst period, in seconds. It must only
2412 # be set if @bps_wr_max is set as well.
2413 # Defaults to 1. (Since 2.6)
2415 # @iops_max_length: maximum length of the @iops burst
2416 # period, in seconds. It must only
2417 # be set if @iops_max is set as well.
2418 # Defaults to 1. (Since 2.6)
2420 # @iops_rd_max_length: maximum length of the @iops_rd_max
2421 # burst period, in seconds. It must only
2422 # be set if @iops_rd_max is set as well.
2423 # Defaults to 1. (Since 2.6)
2425 # @iops_wr_max_length: maximum length of the @iops_wr_max
2426 # burst period, in seconds. It must only
2427 # be set if @iops_wr_max is set as well.
2428 # Defaults to 1. (Since 2.6)
2430 # @iops_size: an I/O size in bytes (Since 1.7)
2432 # @group: throttle group name (Since 2.4)
2435 # @deprecated: Member @device is deprecated. Use @id instead.
2439 { 'struct': 'BlockIOThrottle',
2440 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
2441 '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2442 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2443 '*bps_max': 'int', '*bps_rd_max': 'int',
2444 '*bps_wr_max': 'int', '*iops_max': 'int',
2445 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2446 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2447 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2448 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2449 '*iops_size': 'int', '*group': 'str' } }
2454 # Limit parameters for throttling.
2455 # Since some limit combinations are illegal, limits should always be set in one
2456 # transaction. All fields are optional. When setting limits, if a field is
2457 # missing the current value is not changed.
2459 # @iops-total: limit total I/O operations per second
2460 # @iops-total-max: I/O operations burst
2461 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2462 # It must only be set if @iops-total-max is set as well.
2463 # @iops-read: limit read operations per second
2464 # @iops-read-max: I/O operations read burst
2465 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2466 # It must only be set if @iops-read-max is set as well.
2467 # @iops-write: limit write operations per second
2468 # @iops-write-max: I/O operations write burst
2469 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2470 # It must only be set if @iops-write-max is set as well.
2471 # @bps-total: limit total bytes per second
2472 # @bps-total-max: total bytes burst
2473 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2474 # It must only be set if @bps-total-max is set as well.
2475 # @bps-read: limit read bytes per second
2476 # @bps-read-max: total bytes read burst
2477 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2478 # It must only be set if @bps-read-max is set as well.
2479 # @bps-write: limit write bytes per second
2480 # @bps-write-max: total bytes write burst
2481 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2482 # It must only be set if @bps-write-max is set as well.
2483 # @iops-size: when limiting by iops max size of an I/O in bytes
2487 { 'struct': 'ThrottleLimits',
2488 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2489 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2490 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2491 '*iops-write' : 'int', '*iops-write-max' : 'int',
2492 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2493 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2494 '*bps-read' : 'int', '*bps-read-max' : 'int',
2495 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2496 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2497 '*iops-size' : 'int' } }
2502 # Copy data from a backing file into a block device.
2504 # The block streaming operation is performed in the background until the entire
2505 # backing file has been copied. This command returns immediately once streaming
2506 # has started. The status of ongoing block streaming operations can be checked
2507 # with query-block-jobs. The operation can be stopped before it has completed
2508 # using the block-job-cancel command.
2510 # The node that receives the data is called the top image, can be located in
2511 # any part of the chain (but always above the base image; see below) and can be
2512 # specified using its device or node name. Earlier qemu versions only allowed
2513 # 'device' to name the top level node; presence of the 'base-node' parameter
2514 # during introspection can be used as a witness of the enhanced semantics
2517 # If a base file is specified then sectors are not copied from that base file and
2518 # its backing chain. This can be used to stream a subset of the backing file
2519 # chain instead of flattening the entire image.
2520 # When streaming completes the image file will have the base file as its backing
2521 # file, unless that node was changed while the job was running. In that case,
2522 # base's parent's backing (or filtered, whichever exists) child (i.e., base at
2523 # the beginning of the job) will be the new backing file.
2525 # On successful completion the image file is updated to drop the backing file
2526 # and the BLOCK_JOB_COMPLETED event is emitted.
2528 # In case @device is a filter node, block-stream modifies the first non-filter
2529 # overlay node below it to point to the new backing node instead of modifying
2532 # @job-id: identifier for the newly-created block job. If
2533 # omitted, the device name will be used. (Since 2.7)
2535 # @device: the device or node name of the top image
2537 # @base: the common backing file name.
2538 # It cannot be set if @base-node or @bottom is also set.
2540 # @base-node: the node name of the backing file.
2541 # It cannot be set if @base or @bottom is also set. (Since 2.8)
2543 # @bottom: the last node in the chain that should be streamed into
2544 # top. It cannot be set if @base or @base-node is also set.
2545 # It cannot be filter node. (Since 6.0)
2547 # @backing-file: The backing file string to write into the top
2548 # image. This filename is not validated.
2550 # If a pathname string is such that it cannot be
2551 # resolved by QEMU, that means that subsequent QMP or
2552 # HMP commands must use node-names for the image in
2553 # question, as filename lookup methods will fail.
2555 # If not specified, QEMU will automatically determine
2556 # the backing file string to use, or error out if there
2557 # is no obvious choice. Care should be taken when
2558 # specifying the string, to specify a valid filename or
2562 # @speed: the maximum speed, in bytes per second
2564 # @on-error: the action to take on an error (default report).
2565 # 'stop' and 'enospc' can only be used if the block device
2566 # supports io-status (see BlockInfo). Since 1.3.
2568 # @filter-node-name: the node name that should be assigned to the
2569 # filter driver that the stream job inserts into the graph
2570 # above @device. If this option is not given, a node name is
2571 # autogenerated. (Since: 6.0)
2573 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2574 # finished its work, waiting for @block-job-finalize before
2575 # making any block graph changes.
2576 # When true, this job will automatically
2577 # perform its abort or commit actions.
2578 # Defaults to true. (Since 3.1)
2580 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2581 # has completely ceased all work, and awaits @block-job-dismiss.
2582 # When true, this job will automatically disappear from the query
2583 # list without user intervention.
2584 # Defaults to true. (Since 3.1)
2586 # Returns: - Nothing on success.
2587 # - If @device does not exist, DeviceNotFound.
2593 # -> { "execute": "block-stream",
2594 # "arguments": { "device": "virtio0",
2595 # "base": "/tmp/master.qcow2" } }
2596 # <- { "return": {} }
2599 { 'command': 'block-stream',
2600 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2601 '*base-node': 'str', '*backing-file': 'str', '*bottom': 'str',
2602 '*speed': 'int', '*on-error': 'BlockdevOnError',
2603 '*filter-node-name': 'str',
2604 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2607 # @block-job-set-speed:
2609 # Set maximum speed for a background block operation.
2611 # This command can only be issued when there is an active block job.
2613 # Throttling can be disabled by setting the speed to 0.
2615 # @device: The job identifier. This used to be a device name (hence
2616 # the name of the parameter), but since QEMU 2.7 it can have
2619 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2622 # Returns: - Nothing on success
2623 # - If no background operation is active on this device, DeviceNotActive
2627 { 'command': 'block-job-set-speed',
2628 'data': { 'device': 'str', 'speed': 'int' } }
2631 # @block-job-cancel:
2633 # Stop an active background block operation.
2635 # This command returns immediately after marking the active background block
2636 # operation for cancellation. It is an error to call this command if no
2637 # operation is in progress.
2639 # The operation will cancel as soon as possible and then emit the
2640 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2641 # enumerated using query-block-jobs.
2643 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2644 # (via the event BLOCK_JOB_READY) that the source and destination are
2645 # synchronized, then the event triggered by this command changes to
2646 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2647 # destination now has a point-in-time copy tied to the time of the cancellation.
2649 # For streaming, the image file retains its backing file unless the streaming
2650 # operation happens to complete just as it is being cancelled. A new streaming
2651 # operation can be started at a later time to finish copying all data from the
2654 # @device: The job identifier. This used to be a device name (hence
2655 # the name of the parameter), but since QEMU 2.7 it can have
2658 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2659 # abandon the job immediately (even if it is paused) instead of waiting
2660 # for the destination to complete its final synchronization (since 1.3)
2662 # Returns: - Nothing on success
2663 # - If no background operation is active on this device, DeviceNotActive
2667 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2672 # Pause an active background block operation.
2674 # This command returns immediately after marking the active background block
2675 # operation for pausing. It is an error to call this command if no
2676 # operation is in progress or if the job is already paused.
2678 # The operation will pause as soon as possible. No event is emitted when
2679 # the operation is actually paused. Cancelling a paused job automatically
2682 # @device: The job identifier. This used to be a device name (hence
2683 # the name of the parameter), but since QEMU 2.7 it can have
2686 # Returns: - Nothing on success
2687 # - If no background operation is active on this device, DeviceNotActive
2691 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2694 # @block-job-resume:
2696 # Resume an active background block operation.
2698 # This command returns immediately after resuming a paused background block
2699 # operation. It is an error to call this command if no operation is in
2700 # progress or if the job is not paused.
2702 # This command also clears the error status of the job.
2704 # @device: The job identifier. This used to be a device name (hence
2705 # the name of the parameter), but since QEMU 2.7 it can have
2708 # Returns: - Nothing on success
2709 # - If no background operation is active on this device, DeviceNotActive
2713 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2716 # @block-job-complete:
2718 # Manually trigger completion of an active background block operation. This
2719 # is supported for drive mirroring, where it also switches the device to
2720 # write to the target path only. The ability to complete is signaled with
2721 # a BLOCK_JOB_READY event.
2723 # This command completes an active background block operation synchronously.
2724 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2725 # is not defined. Note that if an I/O error occurs during the processing of
2726 # this command: 1) the command itself will fail; 2) the error will be processed
2727 # according to the rerror/werror arguments that were specified when starting
2730 # A cancelled or paused job cannot be completed.
2732 # @device: The job identifier. This used to be a device name (hence
2733 # the name of the parameter), but since QEMU 2.7 it can have
2736 # Returns: - Nothing on success
2737 # - If no background operation is active on this device, DeviceNotActive
2741 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2744 # @block-job-dismiss:
2746 # For jobs that have already concluded, remove them from the block-job-query
2747 # list. This command only needs to be run for jobs which were started with
2748 # QEMU 2.12+ job lifetime management semantics.
2750 # This command will refuse to operate on any job that has not yet reached
2751 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2752 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2753 # to be used as appropriate.
2755 # @id: The job identifier.
2757 # Returns: Nothing on success
2761 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2764 # @block-job-finalize:
2766 # Once a job that has manual=true reaches the pending state, it can be
2767 # instructed to finalize any graph changes and do any necessary cleanup
2769 # For jobs in a transaction, instructing one job to finalize will force
2770 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2771 # a single member job to finalize.
2773 # @id: The job identifier.
2775 # Returns: Nothing on success
2779 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2782 # @BlockdevDiscardOptions:
2784 # Determines how to handle discard requests.
2786 # @ignore: Ignore the request
2787 # @unmap: Forward as an unmap request
2791 { 'enum': 'BlockdevDiscardOptions',
2792 'data': [ 'ignore', 'unmap' ] }
2795 # @BlockdevDetectZeroesOptions:
2797 # Describes the operation mode for the automatic conversion of plain
2798 # zero writes by the OS to driver specific optimized zero write commands.
2800 # @off: Disabled (default)
2802 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2803 # also that @BlockdevDiscardOptions is set to unmap for this device.
2807 { 'enum': 'BlockdevDetectZeroesOptions',
2808 'data': [ 'off', 'on', 'unmap' ] }
2811 # @BlockdevAioOptions:
2813 # Selects the AIO backend to handle I/O requests
2815 # @threads: Use qemu's thread pool
2816 # @native: Use native AIO backend (only Linux and Windows)
2817 # @io_uring: Use linux io_uring (since 5.0)
2821 { 'enum': 'BlockdevAioOptions',
2822 'data': [ 'threads', 'native',
2823 { 'name': 'io_uring', 'if': 'defined(CONFIG_LINUX_IO_URING)' } ] }
2826 # @BlockdevCacheOptions:
2828 # Includes cache-related options for block devices
2830 # @direct: enables use of O_DIRECT (bypass the host page cache;
2832 # @no-flush: ignore any flush requests for the device (default:
2837 { 'struct': 'BlockdevCacheOptions',
2838 'data': { '*direct': 'bool',
2839 '*no-flush': 'bool' } }
2844 # Drivers that are supported in block device operations.
2846 # @throttle: Since 2.11
2848 # @copy-on-read: Since 3.0
2849 # @blklogwrites: Since 3.0
2850 # @blkreplay: Since 4.2
2851 # @compress: Since 5.0
2855 { 'enum': 'BlockdevDriver',
2856 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
2857 'cloop', 'compress', 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps',
2858 'gluster', 'host_cdrom', 'host_device', 'http', 'https', 'iscsi',
2859 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
2860 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
2861 { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
2863 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
2866 # @BlockdevOptionsFile:
2868 # Driver specific block device options for the file backend.
2870 # @filename: path to the image file
2871 # @pr-manager: the id for the object that will handle persistent reservations
2872 # for this device (default: none, forward the commands via SG_IO;
2874 # @aio: AIO backend (default: threads) (since: 2.8)
2875 # @locking: whether to enable file locking. If set to 'auto', only enable
2876 # when Open File Descriptor (OFD) locking API is available
2877 # (default: auto, since 2.10)
2878 # @drop-cache: invalidate page cache during live migration. This prevents
2879 # stale data on the migration destination with cache.direct=off.
2880 # Currently only supported on Linux hosts.
2881 # (default: on, since: 4.0)
2882 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2883 # migration. May cause noticeable delays if the image
2884 # file is large, do not use in production.
2885 # (default: off) (since: 3.0)
2888 # @dynamic-auto-read-only: If present, enabled auto-read-only means that the
2889 # driver will open the image read-only at first,
2890 # dynamically reopen the image file read-write when
2891 # the first writer is attached to the node and reopen
2892 # read-only when the last writer is detached. This
2893 # allows giving QEMU write permissions only on demand
2894 # when an operation actually needs write access.
2898 { 'struct': 'BlockdevOptionsFile',
2899 'data': { 'filename': 'str',
2900 '*pr-manager': 'str',
2901 '*locking': 'OnOffAuto',
2902 '*aio': 'BlockdevAioOptions',
2903 '*drop-cache': {'type': 'bool',
2904 'if': 'defined(CONFIG_LINUX)'},
2905 '*x-check-cache-dropped': 'bool' },
2906 'features': [ { 'name': 'dynamic-auto-read-only',
2907 'if': 'defined(CONFIG_POSIX)' } ] }
2910 # @BlockdevOptionsNull:
2912 # Driver specific block device options for the null backend.
2914 # @size: size of the device in bytes.
2915 # @latency-ns: emulated latency (in nanoseconds) in processing
2916 # requests. Default to zero which completes requests immediately.
2918 # @read-zeroes: if true, reads from the device produce zeroes; if false, the
2919 # buffer is left unchanged. (default: false; since: 4.1)
2923 { 'struct': 'BlockdevOptionsNull',
2924 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
2927 # @BlockdevOptionsNVMe:
2929 # Driver specific block device options for the NVMe backend.
2931 # @device: PCI controller address of the NVMe device in
2932 # format hhhh:bb:ss.f (host:bus:slot.function)
2933 # @namespace: namespace number of the device, starting from 1.
2935 # Note that the PCI @device must have been unbound from any host
2936 # kernel driver before instructing QEMU to add the blockdev.
2940 { 'struct': 'BlockdevOptionsNVMe',
2941 'data': { 'device': 'str', 'namespace': 'int' } }
2944 # @BlockdevOptionsVVFAT:
2946 # Driver specific block device options for the vvfat protocol.
2948 # @dir: directory to be exported as FAT image
2949 # @fat-type: FAT type: 12, 16 or 32
2950 # @floppy: whether to export a floppy image (true) or
2951 # partitioned hard disk (false; default)
2952 # @label: set the volume label, limited to 11 bytes. FAT16 and
2953 # FAT32 traditionally have some restrictions on labels, which are
2954 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2956 # @rw: whether to allow write operations (default: false)
2960 { 'struct': 'BlockdevOptionsVVFAT',
2961 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2962 '*label': 'str', '*rw': 'bool' } }
2965 # @BlockdevOptionsGenericFormat:
2967 # Driver specific block device options for image format that have no option
2968 # besides their data source.
2970 # @file: reference to or definition of the data source block device
2974 { 'struct': 'BlockdevOptionsGenericFormat',
2975 'data': { 'file': 'BlockdevRef' } }
2978 # @BlockdevOptionsLUKS:
2980 # Driver specific block device options for LUKS.
2982 # @key-secret: the ID of a QCryptoSecret object providing
2983 # the decryption key (since 2.6). Mandatory except when
2984 # doing a metadata-only probe of the image.
2988 { 'struct': 'BlockdevOptionsLUKS',
2989 'base': 'BlockdevOptionsGenericFormat',
2990 'data': { '*key-secret': 'str' } }
2994 # @BlockdevOptionsGenericCOWFormat:
2996 # Driver specific block device options for image format that have no option
2997 # besides their data source and an optional backing file.
2999 # @backing: reference to or definition of the backing file block
3000 # device, null disables the backing file entirely.
3001 # Defaults to the backing file stored the image file.
3005 { 'struct': 'BlockdevOptionsGenericCOWFormat',
3006 'base': 'BlockdevOptionsGenericFormat',
3007 'data': { '*backing': 'BlockdevRefOrNull' } }
3010 # @Qcow2OverlapCheckMode:
3012 # General overlap check modes.
3014 # @none: Do not perform any checks
3016 # @constant: Perform only checks which can be done in constant time and
3017 # without reading anything from disk
3019 # @cached: Perform only checks which can be done without reading anything
3022 # @all: Perform all available overlap checks
3026 { 'enum': 'Qcow2OverlapCheckMode',
3027 'data': [ 'none', 'constant', 'cached', 'all' ] }
3030 # @Qcow2OverlapCheckFlags:
3032 # Structure of flags for each metadata structure. Setting a field to 'true'
3033 # makes qemu guard that structure against unintended overwriting. The default
3034 # value is chosen according to the template given.
3036 # @template: Specifies a template mode which can be adjusted using the other
3037 # flags, defaults to 'cached'
3039 # @bitmap-directory: since 3.0
3043 { 'struct': 'Qcow2OverlapCheckFlags',
3044 'data': { '*template': 'Qcow2OverlapCheckMode',
3045 '*main-header': 'bool',
3046 '*active-l1': 'bool',
3047 '*active-l2': 'bool',
3048 '*refcount-table': 'bool',
3049 '*refcount-block': 'bool',
3050 '*snapshot-table': 'bool',
3051 '*inactive-l1': 'bool',
3052 '*inactive-l2': 'bool',
3053 '*bitmap-directory': 'bool' } }
3056 # @Qcow2OverlapChecks:
3058 # Specifies which metadata structures should be guarded against unintended
3061 # @flags: set of flags for separate specification of each metadata structure
3064 # @mode: named mode which chooses a specific set of flags
3068 { 'alternate': 'Qcow2OverlapChecks',
3069 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3070 'mode': 'Qcow2OverlapCheckMode' } }
3073 # @BlockdevQcowEncryptionFormat:
3075 # @aes: AES-CBC with plain64 initialization vectors
3079 { 'enum': 'BlockdevQcowEncryptionFormat',
3083 # @BlockdevQcowEncryption:
3087 { 'union': 'BlockdevQcowEncryption',
3088 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3089 'discriminator': 'format',
3090 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3093 # @BlockdevOptionsQcow:
3095 # Driver specific block device options for qcow.
3097 # @encrypt: Image decryption options. Mandatory for
3098 # encrypted images, except when doing a metadata-only
3099 # probe of the image.
3103 { 'struct': 'BlockdevOptionsQcow',
3104 'base': 'BlockdevOptionsGenericCOWFormat',
3105 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3110 # @BlockdevQcow2EncryptionFormat:
3111 # @aes: AES-CBC with plain64 initialization vectors
3115 { 'enum': 'BlockdevQcow2EncryptionFormat',
3116 'data': [ 'aes', 'luks' ] }
3119 # @BlockdevQcow2Encryption:
3123 { 'union': 'BlockdevQcow2Encryption',
3124 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3125 'discriminator': 'format',
3126 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3127 'luks': 'QCryptoBlockOptionsLUKS'} }
3130 # @BlockdevOptionsPreallocate:
3132 # Filter driver intended to be inserted between format and protocol node
3133 # and do preallocation in protocol node on write.
3135 # @prealloc-align: on preallocation, align file length to this number,
3136 # default 1048576 (1M)
3138 # @prealloc-size: how much to preallocate, default 134217728 (128M)
3142 { 'struct': 'BlockdevOptionsPreallocate',
3143 'base': 'BlockdevOptionsGenericFormat',
3144 'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } }
3147 # @BlockdevOptionsQcow2:
3149 # Driver specific block device options for qcow2.
3151 # @lazy-refcounts: whether to enable the lazy refcounts
3152 # feature (default is taken from the image file)
3154 # @pass-discard-request: whether discard requests to the qcow2
3155 # device should be forwarded to the data source
3157 # @pass-discard-snapshot: whether discard requests for the data source
3158 # should be issued when a snapshot operation (e.g.
3159 # deleting a snapshot) frees clusters in the qcow2 file
3161 # @pass-discard-other: whether discard requests for the data source
3162 # should be issued on other occasions where a cluster
3165 # @overlap-check: which overlap checks to perform for writes
3166 # to the image, defaults to 'cached' (since 2.2)
3168 # @cache-size: the maximum total size of the L2 table and
3169 # refcount block caches in bytes (since 2.2)
3171 # @l2-cache-size: the maximum size of the L2 table cache in
3174 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3175 # bytes. It must be a power of two between 512
3176 # and the cluster size. The default value is
3177 # the cluster size (since 2.12)
3179 # @refcount-cache-size: the maximum size of the refcount block cache
3180 # in bytes (since 2.2)
3182 # @cache-clean-interval: clean unused entries in the L2 and refcount
3183 # caches. The interval is in seconds. The default value
3184 # is 600 on supporting platforms, and 0 on other
3185 # platforms. 0 disables this feature. (since 2.5)
3187 # @encrypt: Image decryption options. Mandatory for
3188 # encrypted images, except when doing a metadata-only
3189 # probe of the image. (since 2.10)
3191 # @data-file: reference to or definition of the external data file.
3192 # This may only be specified for images that require an
3193 # external data file. If it is not specified for such
3194 # an image, the data file name is loaded from the image
3199 { 'struct': 'BlockdevOptionsQcow2',
3200 'base': 'BlockdevOptionsGenericCOWFormat',
3201 'data': { '*lazy-refcounts': 'bool',
3202 '*pass-discard-request': 'bool',
3203 '*pass-discard-snapshot': 'bool',
3204 '*pass-discard-other': 'bool',
3205 '*overlap-check': 'Qcow2OverlapChecks',
3206 '*cache-size': 'int',
3207 '*l2-cache-size': 'int',
3208 '*l2-cache-entry-size': 'int',
3209 '*refcount-cache-size': 'int',
3210 '*cache-clean-interval': 'int',
3211 '*encrypt': 'BlockdevQcow2Encryption',
3212 '*data-file': 'BlockdevRef' } }
3215 # @SshHostKeyCheckMode:
3217 # @none: Don't check the host key at all
3218 # @hash: Compare the host key with a given hash
3219 # @known_hosts: Check the host key against the known_hosts file
3223 { 'enum': 'SshHostKeyCheckMode',
3224 'data': [ 'none', 'hash', 'known_hosts' ] }
3227 # @SshHostKeyCheckHashType:
3229 # @md5: The given hash is an md5 hash
3230 # @sha1: The given hash is an sha1 hash
3234 { 'enum': 'SshHostKeyCheckHashType',
3235 'data': [ 'md5', 'sha1' ] }
3240 # @type: The hash algorithm used for the hash
3241 # @hash: The expected hash value
3245 { 'struct': 'SshHostKeyHash',
3246 'data': { 'type': 'SshHostKeyCheckHashType',
3254 { 'union': 'SshHostKeyCheck',
3255 'base': { 'mode': 'SshHostKeyCheckMode' },
3256 'discriminator': 'mode',
3257 'data': { 'hash': 'SshHostKeyHash' } }
3260 # @BlockdevOptionsSsh:
3262 # @server: host address
3264 # @path: path to the image on the host
3266 # @user: user as which to connect, defaults to current
3269 # @host-key-check: Defines how and what to check the host key against
3270 # (default: known_hosts)
3274 { 'struct': 'BlockdevOptionsSsh',
3275 'data': { 'server': 'InetSocketAddress',
3278 '*host-key-check': 'SshHostKeyCheck' } }
3284 # Trigger events supported by blkdebug.
3286 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3289 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3291 # @cor_write: a write due to copy-on-read (since 2.11)
3293 # @cluster_alloc_space: an allocation of file space for a cluster (since 4.1)
3295 # @none: triggers once at creation of the blkdebug node (since 4.1)
3299 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3300 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3301 'l1_grow_activate_table', 'l2_load', 'l2_update',
3302 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3303 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3304 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3305 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3306 'refblock_load', 'refblock_update', 'refblock_update_part',
3307 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3308 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3309 'refblock_alloc_switch_table', 'cluster_alloc',
3310 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3311 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3312 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3313 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3314 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3315 'cor_write', 'cluster_alloc_space', 'none'] }
3320 # Kinds of I/O that blkdebug can inject errors in.
3322 # @read: .bdrv_co_preadv()
3324 # @write: .bdrv_co_pwritev()
3326 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3328 # @discard: .bdrv_co_pdiscard()
3330 # @flush: .bdrv_co_flush_to_disk()
3332 # @block-status: .bdrv_co_block_status()
3336 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3337 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3341 # @BlkdebugInjectErrorOptions:
3343 # Describes a single error injection for blkdebug.
3345 # @event: trigger event
3347 # @state: the state identifier blkdebug needs to be in to
3348 # actually trigger the event; defaults to "any"
3350 # @iotype: the type of I/O operations on which this error should
3351 # be injected; defaults to "all read, write,
3352 # write-zeroes, discard, and flush operations"
3355 # @errno: error identifier (errno) to be returned; defaults to
3358 # @sector: specifies the sector index which has to be affected
3359 # in order to actually trigger the event; defaults to "any
3362 # @once: disables further events after this one has been
3363 # triggered; defaults to false
3365 # @immediately: fail immediately; defaults to false
3369 { 'struct': 'BlkdebugInjectErrorOptions',
3370 'data': { 'event': 'BlkdebugEvent',
3372 '*iotype': 'BlkdebugIOType',
3376 '*immediately': 'bool' } }
3379 # @BlkdebugSetStateOptions:
3381 # Describes a single state-change event for blkdebug.
3383 # @event: trigger event
3385 # @state: the current state identifier blkdebug needs to be in;
3388 # @new_state: the state identifier blkdebug is supposed to assume if
3389 # this event is triggered
3393 { 'struct': 'BlkdebugSetStateOptions',
3394 'data': { 'event': 'BlkdebugEvent',
3396 'new_state': 'int' } }
3399 # @BlockdevOptionsBlkdebug:
3401 # Driver specific block device options for blkdebug.
3403 # @image: underlying raw block device (or image file)
3405 # @config: filename of the configuration file
3407 # @align: required alignment for requests in bytes, must be
3408 # positive power of 2, or 0 for default
3410 # @max-transfer: maximum size for I/O transfers in bytes, must be
3411 # positive multiple of @align and of the underlying
3412 # file's request alignment (but need not be a power of
3413 # 2), or 0 for default (since 2.10)
3415 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3416 # must be positive multiple of @align and of the
3417 # underlying file's request alignment (but need not be a
3418 # power of 2), or 0 for default (since 2.10)
3420 # @max-write-zero: maximum size for write zero requests in bytes, must be
3421 # positive multiple of @align, of @opt-write-zero, and of
3422 # the underlying file's request alignment (but need not
3423 # be a power of 2), or 0 for default (since 2.10)
3425 # @opt-discard: preferred alignment for discard requests in bytes, must
3426 # be positive multiple of @align and of the underlying
3427 # file's request alignment (but need not be a power of
3428 # 2), or 0 for default (since 2.10)
3430 # @max-discard: maximum size for discard requests in bytes, must be
3431 # positive multiple of @align, of @opt-discard, and of
3432 # the underlying file's request alignment (but need not
3433 # be a power of 2), or 0 for default (since 2.10)
3435 # @inject-error: array of error injection descriptions
3437 # @set-state: array of state-change descriptions
3439 # @take-child-perms: Permissions to take on @image in addition to what
3440 # is necessary anyway (which depends on how the
3441 # blkdebug node is used). Defaults to none.
3444 # @unshare-child-perms: Permissions not to share on @image in addition
3445 # to what cannot be shared anyway (which depends
3446 # on how the blkdebug node is used). Defaults
3447 # to none. (since 5.0)
3451 { 'struct': 'BlockdevOptionsBlkdebug',
3452 'data': { 'image': 'BlockdevRef',
3454 '*align': 'int', '*max-transfer': 'int32',
3455 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3456 '*opt-discard': 'int32', '*max-discard': 'int32',
3457 '*inject-error': ['BlkdebugInjectErrorOptions'],
3458 '*set-state': ['BlkdebugSetStateOptions'],
3459 '*take-child-perms': ['BlockPermission'],
3460 '*unshare-child-perms': ['BlockPermission'] } }
3463 # @BlockdevOptionsBlklogwrites:
3465 # Driver specific block device options for blklogwrites.
3467 # @file: block device
3469 # @log: block device used to log writes to @file
3471 # @log-sector-size: sector size used in logging writes to @file, determines
3472 # granularity of offsets and sizes of writes (default: 512)
3474 # @log-append: append to an existing log (default: false)
3476 # @log-super-update-interval: interval of write requests after which the log
3477 # super block is updated to disk (default: 4096)
3481 { 'struct': 'BlockdevOptionsBlklogwrites',
3482 'data': { 'file': 'BlockdevRef',
3483 'log': 'BlockdevRef',
3484 '*log-sector-size': 'uint32',
3485 '*log-append': 'bool',
3486 '*log-super-update-interval': 'uint64' } }
3489 # @BlockdevOptionsBlkverify:
3491 # Driver specific block device options for blkverify.
3493 # @test: block device to be tested
3495 # @raw: raw image used for verification
3499 { 'struct': 'BlockdevOptionsBlkverify',
3500 'data': { 'test': 'BlockdevRef',
3501 'raw': 'BlockdevRef' } }
3504 # @BlockdevOptionsBlkreplay:
3506 # Driver specific block device options for blkreplay.
3508 # @image: disk image which should be controlled with blkreplay
3512 { 'struct': 'BlockdevOptionsBlkreplay',
3513 'data': { 'image': 'BlockdevRef' } }
3516 # @QuorumReadPattern:
3518 # An enumeration of quorum read patterns.
3520 # @quorum: read all the children and do a quorum vote on reads
3522 # @fifo: read only from the first child that has not failed
3526 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3529 # @BlockdevOptionsQuorum:
3531 # Driver specific block device options for Quorum
3533 # @blkverify: true if the driver must print content mismatch
3534 # set to false by default
3536 # @children: the children block devices to use
3538 # @vote-threshold: the vote limit under which a read will fail
3540 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3543 # @read-pattern: choose read pattern and set to quorum by default
3548 { 'struct': 'BlockdevOptionsQuorum',
3549 'data': { '*blkverify': 'bool',
3550 'children': [ 'BlockdevRef' ],
3551 'vote-threshold': 'int',
3552 '*rewrite-corrupted': 'bool',
3553 '*read-pattern': 'QuorumReadPattern' } }
3556 # @BlockdevOptionsGluster:
3558 # Driver specific block device options for Gluster
3560 # @volume: name of gluster volume where VM image resides
3562 # @path: absolute path to image file in gluster volume
3564 # @server: gluster servers description
3566 # @debug: libgfapi log level (default '4' which is Error)
3569 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3573 { 'struct': 'BlockdevOptionsGluster',
3574 'data': { 'volume': 'str',
3576 'server': ['SocketAddress'],
3578 '*logfile': 'str' } }
3583 # An enumeration of libiscsi transport types
3587 { 'enum': 'IscsiTransport',
3588 'data': [ 'tcp', 'iser' ] }
3591 # @IscsiHeaderDigest:
3593 # An enumeration of header digests supported by libiscsi
3597 { 'enum': 'IscsiHeaderDigest',
3598 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3599 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3602 # @BlockdevOptionsIscsi:
3604 # @transport: The iscsi transport type
3606 # @portal: The address of the iscsi portal
3608 # @target: The target iqn name
3610 # @lun: LUN to connect to. Defaults to 0.
3612 # @user: User name to log in with. If omitted, no CHAP
3613 # authentication is performed.
3615 # @password-secret: The ID of a QCryptoSecret object providing
3616 # the password for the login. This option is required if
3617 # @user is specified.
3619 # @initiator-name: The iqn name we want to identify to the target
3620 # as. If this option is not specified, an initiator name is
3621 # generated automatically.
3623 # @header-digest: The desired header digest. Defaults to
3626 # @timeout: Timeout in seconds after which a request will
3627 # timeout. 0 means no timeout and is the default.
3629 # Driver specific block device options for iscsi
3633 { 'struct': 'BlockdevOptionsIscsi',
3634 'data': { 'transport': 'IscsiTransport',
3639 '*password-secret': 'str',
3640 '*initiator-name': 'str',
3641 '*header-digest': 'IscsiHeaderDigest',
3642 '*timeout': 'int' } }
3650 { 'enum': 'RbdAuthMode',
3651 'data': [ 'cephx', 'none' ] }
3654 # @BlockdevOptionsRbd:
3656 # @pool: Ceph pool name.
3658 # @namespace: Rados namespace name in the Ceph pool. (Since 5.0)
3660 # @image: Image name in the Ceph pool.
3662 # @conf: path to Ceph configuration file. Values
3663 # in the configuration file will be overridden by
3664 # options specified via QAPI.
3666 # @snapshot: Ceph snapshot name.
3668 # @user: Ceph id name.
3670 # @auth-client-required: Acceptable authentication modes.
3671 # This maps to Ceph configuration option
3672 # "auth_client_required". (Since 3.0)
3674 # @key-secret: ID of a QCryptoSecret object providing a key
3675 # for cephx authentication.
3676 # This maps to Ceph configuration option
3677 # "key". (Since 3.0)
3679 # @server: Monitor host address and port. This maps
3680 # to the "mon_host" Ceph option.
3684 { 'struct': 'BlockdevOptionsRbd',
3685 'data': { 'pool': 'str',
3686 '*namespace': 'str',
3691 '*auth-client-required': ['RbdAuthMode'],
3692 '*key-secret': 'str',
3693 '*server': ['InetSocketAddressBase'] } }
3696 # @BlockdevOptionsSheepdog:
3698 # Driver specific block device options for sheepdog
3700 # @vdi: Virtual disk image name
3701 # @server: The Sheepdog server to connect to
3702 # @snap-id: Snapshot ID
3703 # @tag: Snapshot tag name
3705 # Only one of @snap-id and @tag may be present.
3709 { 'struct': 'BlockdevOptionsSheepdog',
3710 'data': { 'server': 'SocketAddress',
3712 '*snap-id': 'uint32',
3718 # An enumeration of replication modes.
3720 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3722 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3726 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3727 'if': 'defined(CONFIG_REPLICATION)' }
3730 # @BlockdevOptionsReplication:
3732 # Driver specific block device options for replication
3734 # @mode: the replication mode
3736 # @top-id: In secondary mode, node name or device ID of the root
3737 # node who owns the replication node chain. Must not be given in
3742 { 'struct': 'BlockdevOptionsReplication',
3743 'base': 'BlockdevOptionsGenericFormat',
3744 'data': { 'mode': 'ReplicationMode',
3746 'if': 'defined(CONFIG_REPLICATION)' }
3751 # An enumeration of NFS transport types
3753 # @inet: TCP transport
3757 { 'enum': 'NFSTransport',
3758 'data': [ 'inet' ] }
3763 # Captures the address of the socket
3765 # @type: transport type used for NFS (only TCP supported)
3767 # @host: host address for NFS server
3771 { 'struct': 'NFSServer',
3772 'data': { 'type': 'NFSTransport',
3776 # @BlockdevOptionsNfs:
3778 # Driver specific block device option for NFS
3780 # @server: host address
3782 # @path: path of the image on the host
3784 # @user: UID value to use when talking to the
3785 # server (defaults to 65534 on Windows and getuid()
3788 # @group: GID value to use when talking to the
3789 # server (defaults to 65534 on Windows and getgid()
3792 # @tcp-syn-count: number of SYNs during the session
3793 # establishment (defaults to libnfs default)
3795 # @readahead-size: set the readahead size in bytes (defaults
3796 # to libnfs default)
3798 # @page-cache-size: set the pagecache size in bytes (defaults
3799 # to libnfs default)
3801 # @debug: set the NFS debug level (max 2) (defaults
3802 # to libnfs default)
3806 { 'struct': 'BlockdevOptionsNfs',
3807 'data': { 'server': 'NFSServer',
3811 '*tcp-syn-count': 'int',
3812 '*readahead-size': 'int',
3813 '*page-cache-size': 'int',
3817 # @BlockdevOptionsCurlBase:
3819 # Driver specific block device options shared by all protocols supported by the
3822 # @url: URL of the image file
3824 # @readahead: Size of the read-ahead cache; must be a multiple of
3825 # 512 (defaults to 256 kB)
3827 # @timeout: Timeout for connections, in seconds (defaults to 5)
3829 # @username: Username for authentication (defaults to none)
3831 # @password-secret: ID of a QCryptoSecret object providing a password
3832 # for authentication (defaults to no password)
3834 # @proxy-username: Username for proxy authentication (defaults to none)
3836 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3837 # for proxy authentication (defaults to no password)
3841 { 'struct': 'BlockdevOptionsCurlBase',
3842 'data': { 'url': 'str',
3843 '*readahead': 'int',
3846 '*password-secret': 'str',
3847 '*proxy-username': 'str',
3848 '*proxy-password-secret': 'str' } }
3851 # @BlockdevOptionsCurlHttp:
3853 # Driver specific block device options for HTTP connections over the curl
3854 # backend. URLs must start with "http://".
3856 # @cookie: List of cookies to set; format is
3857 # "name1=content1; name2=content2;" as explained by
3858 # CURLOPT_COOKIE(3). Defaults to no cookies.
3860 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3861 # secure way. See @cookie for the format. (since 2.10)
3865 { 'struct': 'BlockdevOptionsCurlHttp',
3866 'base': 'BlockdevOptionsCurlBase',
3867 'data': { '*cookie': 'str',
3868 '*cookie-secret': 'str'} }
3871 # @BlockdevOptionsCurlHttps:
3873 # Driver specific block device options for HTTPS connections over the curl
3874 # backend. URLs must start with "https://".
3876 # @cookie: List of cookies to set; format is
3877 # "name1=content1; name2=content2;" as explained by
3878 # CURLOPT_COOKIE(3). Defaults to no cookies.
3880 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3883 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3884 # secure way. See @cookie for the format. (since 2.10)
3888 { 'struct': 'BlockdevOptionsCurlHttps',
3889 'base': 'BlockdevOptionsCurlBase',
3890 'data': { '*cookie': 'str',
3891 '*sslverify': 'bool',
3892 '*cookie-secret': 'str'} }
3895 # @BlockdevOptionsCurlFtp:
3897 # Driver specific block device options for FTP connections over the curl
3898 # backend. URLs must start with "ftp://".
3902 { 'struct': 'BlockdevOptionsCurlFtp',
3903 'base': 'BlockdevOptionsCurlBase',
3907 # @BlockdevOptionsCurlFtps:
3909 # Driver specific block device options for FTPS connections over the curl
3910 # backend. URLs must start with "ftps://".
3912 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3917 { 'struct': 'BlockdevOptionsCurlFtps',
3918 'base': 'BlockdevOptionsCurlBase',
3919 'data': { '*sslverify': 'bool' } }
3922 # @BlockdevOptionsNbd:
3924 # Driver specific block device options for NBD.
3926 # @server: NBD server address
3928 # @export: export name
3930 # @tls-creds: TLS credentials ID
3932 # @x-dirty-bitmap: A metadata context name such as "qemu:dirty-bitmap:NAME"
3933 # or "qemu:allocation-depth" to query in place of the
3934 # traditional "base:allocation" block status (see
3935 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol; and
3936 # yes, naming this option x-context would have made
3937 # more sense) (since 3.0)
3939 # @reconnect-delay: On an unexpected disconnect, the nbd client tries to
3940 # connect again until succeeding or encountering a serious
3941 # error. During the first @reconnect-delay seconds, all
3942 # requests are paused and will be rerun on a successful
3943 # reconnect. After that time, any delayed requests and all
3944 # future requests before a successful reconnect will
3945 # immediately fail. Default 0 (Since 4.2)
3949 { 'struct': 'BlockdevOptionsNbd',
3950 'data': { 'server': 'SocketAddress',
3952 '*tls-creds': 'str',
3953 '*x-dirty-bitmap': 'str',
3954 '*reconnect-delay': 'uint32' } }
3957 # @BlockdevOptionsRaw:
3959 # Driver specific block device options for the raw driver.
3961 # @offset: position where the block device starts
3962 # @size: the assumed size of the device
3966 { 'struct': 'BlockdevOptionsRaw',
3967 'base': 'BlockdevOptionsGenericFormat',
3968 'data': { '*offset': 'int', '*size': 'int' } }
3971 # @BlockdevOptionsThrottle:
3973 # Driver specific block device options for the throttle driver
3975 # @throttle-group: the name of the throttle-group object to use. It
3976 # must already exist.
3977 # @file: reference to or definition of the data source block device
3980 { 'struct': 'BlockdevOptionsThrottle',
3981 'data': { 'throttle-group': 'str',
3982 'file' : 'BlockdevRef'
3986 # @BlockdevOptionsCor:
3988 # Driver specific block device options for the copy-on-read driver.
3990 # @bottom: The name of a non-filter node (allocation-bearing layer) that
3991 # limits the COR operations in the backing chain (inclusive), so
3992 # that no data below this node will be copied by this filter.
3993 # If option is absent, the limit is not applied, so that data
3994 # from all backing layers may be copied.
3998 { 'struct': 'BlockdevOptionsCor',
3999 'base': 'BlockdevOptionsGenericFormat',
4000 'data': { '*bottom': 'str' } }
4005 # Options for creating a block device. Many options are available for all
4006 # block devices, independent of the block driver:
4008 # @driver: block driver name
4009 # @node-name: the node name of the new node (Since 2.0).
4010 # This option is required on the top level of blockdev-add.
4011 # Valid node names start with an alphabetic character and may
4012 # contain only alphanumeric characters, '-', '.' and '_'. Their
4013 # maximum length is 31 characters.
4014 # @discard: discard-related options (default: ignore)
4015 # @cache: cache-related options
4016 # @read-only: whether the block device should be read-only (default: false).
4017 # Note that some block drivers support only read-only access,
4018 # either generally or in certain configurations. In this case,
4019 # the default value does not work and the option must be
4020 # specified explicitly.
4021 # @auto-read-only: if true and @read-only is false, QEMU may automatically
4022 # decide not to open the image read-write as requested, but
4023 # fall back to read-only instead (and switch between the modes
4024 # later), e.g. depending on whether the image file is writable
4025 # or whether a writing user is attached to the node
4026 # (default: false, since 3.1)
4027 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
4029 # @force-share: force share all permission on added nodes.
4030 # Requires read-only=true. (Since 2.10)
4032 # Remaining options are determined by the block driver.
4036 { 'union': 'BlockdevOptions',
4037 'base': { 'driver': 'BlockdevDriver',
4038 '*node-name': 'str',
4039 '*discard': 'BlockdevDiscardOptions',
4040 '*cache': 'BlockdevCacheOptions',
4041 '*read-only': 'bool',
4042 '*auto-read-only': 'bool',
4043 '*force-share': 'bool',
4044 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
4045 'discriminator': 'driver',
4047 'blkdebug': 'BlockdevOptionsBlkdebug',
4048 'blklogwrites':'BlockdevOptionsBlklogwrites',
4049 'blkverify': 'BlockdevOptionsBlkverify',
4050 'blkreplay': 'BlockdevOptionsBlkreplay',
4051 'bochs': 'BlockdevOptionsGenericFormat',
4052 'cloop': 'BlockdevOptionsGenericFormat',
4053 'compress': 'BlockdevOptionsGenericFormat',
4054 'copy-on-read':'BlockdevOptionsCor',
4055 'dmg': 'BlockdevOptionsGenericFormat',
4056 'file': 'BlockdevOptionsFile',
4057 'ftp': 'BlockdevOptionsCurlFtp',
4058 'ftps': 'BlockdevOptionsCurlFtps',
4059 'gluster': 'BlockdevOptionsGluster',
4060 'host_cdrom': 'BlockdevOptionsFile',
4061 'host_device':'BlockdevOptionsFile',
4062 'http': 'BlockdevOptionsCurlHttp',
4063 'https': 'BlockdevOptionsCurlHttps',
4064 'iscsi': 'BlockdevOptionsIscsi',
4065 'luks': 'BlockdevOptionsLUKS',
4066 'nbd': 'BlockdevOptionsNbd',
4067 'nfs': 'BlockdevOptionsNfs',
4068 'null-aio': 'BlockdevOptionsNull',
4069 'null-co': 'BlockdevOptionsNull',
4070 'nvme': 'BlockdevOptionsNVMe',
4071 'parallels': 'BlockdevOptionsGenericFormat',
4072 'preallocate':'BlockdevOptionsPreallocate',
4073 'qcow2': 'BlockdevOptionsQcow2',
4074 'qcow': 'BlockdevOptionsQcow',
4075 'qed': 'BlockdevOptionsGenericCOWFormat',
4076 'quorum': 'BlockdevOptionsQuorum',
4077 'raw': 'BlockdevOptionsRaw',
4078 'rbd': 'BlockdevOptionsRbd',
4079 'replication': { 'type': 'BlockdevOptionsReplication',
4080 'if': 'defined(CONFIG_REPLICATION)' },
4081 'sheepdog': 'BlockdevOptionsSheepdog',
4082 'ssh': 'BlockdevOptionsSsh',
4083 'throttle': 'BlockdevOptionsThrottle',
4084 'vdi': 'BlockdevOptionsGenericFormat',
4085 'vhdx': 'BlockdevOptionsGenericFormat',
4086 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4087 'vpc': 'BlockdevOptionsGenericFormat',
4088 'vvfat': 'BlockdevOptionsVVFAT'
4094 # Reference to a block device.
4096 # @definition: defines a new block device inline
4097 # @reference: references the ID of an existing block device
4101 { 'alternate': 'BlockdevRef',
4102 'data': { 'definition': 'BlockdevOptions',
4103 'reference': 'str' } }
4106 # @BlockdevRefOrNull:
4108 # Reference to a block device.
4110 # @definition: defines a new block device inline
4111 # @reference: references the ID of an existing block device.
4112 # An empty string means that no block device should
4113 # be referenced. Deprecated; use null instead.
4114 # @null: No block device should be referenced (since 2.10)
4118 { 'alternate': 'BlockdevRefOrNull',
4119 'data': { 'definition': 'BlockdevOptions',
4126 # Creates a new block device.
4133 # -> { "execute": "blockdev-add",
4135 # "driver": "qcow2",
4136 # "node-name": "test1",
4139 # "filename": "test.qcow2"
4143 # <- { "return": {} }
4146 # -> { "execute": "blockdev-add",
4148 # "driver": "qcow2",
4149 # "node-name": "node0",
4150 # "discard": "unmap",
4156 # "filename": "/tmp/test.qcow2"
4162 # "filename": "/dev/fdset/4"
4168 # <- { "return": {} }
4171 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
4174 # @x-blockdev-reopen:
4176 # Reopens a block device using the given set of options. Any option
4177 # not specified will be reset to its default value regardless of its
4178 # previous status. If an option cannot be changed or a particular
4179 # driver does not support reopening then the command will return an
4182 # The top-level @node-name option (from BlockdevOptions) must be
4183 # specified and is used to select the block device to be reopened.
4184 # Other @node-name options must be either omitted or set to the
4185 # current name of the appropriate node. This command won't change any
4186 # node name and any attempt to do it will result in an error.
4188 # In the case of options that refer to child nodes, the behavior of
4189 # this command depends on the value:
4191 # 1) A set of options (BlockdevOptions): the child is reopened with
4192 # the specified set of options.
4194 # 2) A reference to the current child: the child is reopened using
4195 # its existing set of options.
4197 # 3) A reference to a different node: the current child is replaced
4198 # with the specified one.
4200 # 4) NULL: the current child (if any) is detached.
4202 # Options (1) and (2) are supported in all cases, but at the moment
4203 # only @backing allows replacing or detaching an existing child.
4205 # Unlike with blockdev-add, the @backing option must always be present
4206 # unless the node being reopened does not have a backing file and its
4207 # image does not have a default backing file name as part of its
4212 { 'command': 'x-blockdev-reopen',
4213 'data': 'BlockdevOptions', 'boxed': true }
4218 # Deletes a block device that has been added using blockdev-add.
4219 # The command will fail if the node is attached to a device or is
4220 # otherwise being used.
4222 # @node-name: Name of the graph node to delete.
4228 # -> { "execute": "blockdev-add",
4230 # "driver": "qcow2",
4231 # "node-name": "node0",
4234 # "filename": "test.qcow2"
4238 # <- { "return": {} }
4240 # -> { "execute": "blockdev-del",
4241 # "arguments": { "node-name": "node0" }
4243 # <- { "return": {} }
4246 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
4249 # @BlockdevCreateOptionsFile:
4251 # Driver specific image creation options for file.
4253 # @filename: Filename for the new image file
4254 # @size: Size of the virtual disk in bytes
4255 # @preallocation: Preallocation mode for the new image (default: off;
4256 # allowed values: off,
4257 # falloc (if defined CONFIG_POSIX_FALLOCATE),
4258 # full (if defined CONFIG_POSIX))
4259 # @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
4260 # @extent-size-hint: Extent size hint to add to the image file; 0 for not
4261 # adding an extent size hint (default: 1 MB, since 5.1)
4265 { 'struct': 'BlockdevCreateOptionsFile',
4266 'data': { 'filename': 'str',
4268 '*preallocation': 'PreallocMode',
4270 '*extent-size-hint': 'size'} }
4273 # @BlockdevCreateOptionsGluster:
4275 # Driver specific image creation options for gluster.
4277 # @location: Where to store the new image file
4278 # @size: Size of the virtual disk in bytes
4279 # @preallocation: Preallocation mode for the new image (default: off;
4280 # allowed values: off,
4281 # falloc (if defined CONFIG_GLUSTERFS_FALLOCATE),
4282 # full (if defined CONFIG_GLUSTERFS_ZEROFILL))
4286 { 'struct': 'BlockdevCreateOptionsGluster',
4287 'data': { 'location': 'BlockdevOptionsGluster',
4289 '*preallocation': 'PreallocMode' } }
4292 # @BlockdevCreateOptionsLUKS:
4294 # Driver specific image creation options for LUKS.
4296 # @file: Node to create the image format on
4297 # @size: Size of the virtual disk in bytes
4298 # @preallocation: Preallocation mode for the new image
4300 # (default: off; allowed values: off, metadata, falloc, full)
4304 { 'struct': 'BlockdevCreateOptionsLUKS',
4305 'base': 'QCryptoBlockCreateOptionsLUKS',
4306 'data': { 'file': 'BlockdevRef',
4308 '*preallocation': 'PreallocMode' } }
4311 # @BlockdevCreateOptionsNfs:
4313 # Driver specific image creation options for NFS.
4315 # @location: Where to store the new image file
4316 # @size: Size of the virtual disk in bytes
4320 { 'struct': 'BlockdevCreateOptionsNfs',
4321 'data': { 'location': 'BlockdevOptionsNfs',
4325 # @BlockdevCreateOptionsParallels:
4327 # Driver specific image creation options for parallels.
4329 # @file: Node to create the image format on
4330 # @size: Size of the virtual disk in bytes
4331 # @cluster-size: Cluster size in bytes (default: 1 MB)
4335 { 'struct': 'BlockdevCreateOptionsParallels',
4336 'data': { 'file': 'BlockdevRef',
4338 '*cluster-size': 'size' } }
4341 # @BlockdevCreateOptionsQcow:
4343 # Driver specific image creation options for qcow.
4345 # @file: Node to create the image format on
4346 # @size: Size of the virtual disk in bytes
4347 # @backing-file: File name of the backing file if a backing file
4349 # @encrypt: Encryption options if the image should be encrypted
4353 { 'struct': 'BlockdevCreateOptionsQcow',
4354 'data': { 'file': 'BlockdevRef',
4356 '*backing-file': 'str',
4357 '*encrypt': 'QCryptoBlockCreateOptions' } }
4360 # @BlockdevQcow2Version:
4362 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4363 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4367 { 'enum': 'BlockdevQcow2Version',
4368 'data': [ 'v2', 'v3' ] }
4372 # @Qcow2CompressionType:
4374 # Compression type used in qcow2 image file
4376 # @zlib: zlib compression, see <http://zlib.net/>
4377 # @zstd: zstd compression, see <http://github.com/facebook/zstd>
4381 { 'enum': 'Qcow2CompressionType',
4382 'data': [ 'zlib', { 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] }
4385 # @BlockdevCreateOptionsQcow2:
4387 # Driver specific image creation options for qcow2.
4389 # @file: Node to create the image format on
4390 # @data-file: Node to use as an external data file in which all guest
4391 # data is stored so that only metadata remains in the qcow2
4393 # @data-file-raw: True if the external data file must stay valid as a
4394 # standalone (read-only) raw image without looking at qcow2
4395 # metadata (default: false; since: 4.0)
4396 # @extended-l2: True to make the image have extended L2 entries
4397 # (default: false; since 5.2)
4398 # @size: Size of the virtual disk in bytes
4399 # @version: Compatibility level (default: v3)
4400 # @backing-file: File name of the backing file if a backing file
4402 # @backing-fmt: Name of the block driver to use for the backing file
4403 # @encrypt: Encryption options if the image should be encrypted
4404 # @cluster-size: qcow2 cluster size in bytes (default: 65536)
4405 # @preallocation: Preallocation mode for the new image (default: off;
4406 # allowed values: off, falloc, full, metadata)
4407 # @lazy-refcounts: True if refcounts may be updated lazily (default: off)
4408 # @refcount-bits: Width of reference counts in bits (default: 16)
4409 # @compression-type: The image cluster compression method
4410 # (default: zlib, since 5.1)
4414 { 'struct': 'BlockdevCreateOptionsQcow2',
4415 'data': { 'file': 'BlockdevRef',
4416 '*data-file': 'BlockdevRef',
4417 '*data-file-raw': 'bool',
4418 '*extended-l2': 'bool',
4420 '*version': 'BlockdevQcow2Version',
4421 '*backing-file': 'str',
4422 '*backing-fmt': 'BlockdevDriver',
4423 '*encrypt': 'QCryptoBlockCreateOptions',
4424 '*cluster-size': 'size',
4425 '*preallocation': 'PreallocMode',
4426 '*lazy-refcounts': 'bool',
4427 '*refcount-bits': 'int',
4428 '*compression-type':'Qcow2CompressionType' } }
4431 # @BlockdevCreateOptionsQed:
4433 # Driver specific image creation options for qed.
4435 # @file: Node to create the image format on
4436 # @size: Size of the virtual disk in bytes
4437 # @backing-file: File name of the backing file if a backing file
4439 # @backing-fmt: Name of the block driver to use for the backing file
4440 # @cluster-size: Cluster size in bytes (default: 65536)
4441 # @table-size: L1/L2 table size (in clusters)
4445 { 'struct': 'BlockdevCreateOptionsQed',
4446 'data': { 'file': 'BlockdevRef',
4448 '*backing-file': 'str',
4449 '*backing-fmt': 'BlockdevDriver',
4450 '*cluster-size': 'size',
4451 '*table-size': 'int' } }
4454 # @BlockdevCreateOptionsRbd:
4456 # Driver specific image creation options for rbd/Ceph.
4458 # @location: Where to store the new image file. This location cannot
4459 # point to a snapshot.
4460 # @size: Size of the virtual disk in bytes
4461 # @cluster-size: RBD object size
4465 { 'struct': 'BlockdevCreateOptionsRbd',
4466 'data': { 'location': 'BlockdevOptionsRbd',
4468 '*cluster-size' : 'size' } }
4471 # @BlockdevVmdkSubformat:
4473 # Subformat options for VMDK images
4475 # @monolithicSparse: Single file image with sparse cluster allocation
4477 # @monolithicFlat: Single flat data image and a descriptor file
4479 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4480 # files, in addition to a descriptor file
4482 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4483 # files, in addition to a descriptor file
4485 # @streamOptimized: Single file image sparse cluster allocation, optimized
4486 # for streaming over network.
4490 { 'enum': 'BlockdevVmdkSubformat',
4491 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4492 'twoGbMaxExtentFlat', 'streamOptimized'] }
4495 # @BlockdevVmdkAdapterType:
4497 # Adapter type info for VMDK images
4501 { 'enum': 'BlockdevVmdkAdapterType',
4502 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4505 # @BlockdevCreateOptionsVmdk:
4507 # Driver specific image creation options for VMDK.
4509 # @file: Where to store the new image file. This refers to the image
4510 # file for monolithcSparse and streamOptimized format, or the
4511 # descriptor file for other formats.
4512 # @size: Size of the virtual disk in bytes
4513 # @extents: Where to store the data extents. Required for monolithcFlat,
4514 # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4515 # monolithicFlat, only one entry is required; for
4516 # twoGbMaxExtent* formats, the number of entries required is
4517 # calculated as extent_number = virtual_size / 2GB. Providing
4518 # more extents than will be used is an error.
4519 # @subformat: The subformat of the VMDK image. Default: "monolithicSparse".
4520 # @backing-file: The path of backing file. Default: no backing file is used.
4521 # @adapter-type: The adapter type used to fill in the descriptor. Default: ide.
4522 # @hwversion: Hardware version. The meaningful options are "4" or "6".
4524 # @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats.
4529 { 'struct': 'BlockdevCreateOptionsVmdk',
4530 'data': { 'file': 'BlockdevRef',
4532 '*extents': ['BlockdevRef'],
4533 '*subformat': 'BlockdevVmdkSubformat',
4534 '*backing-file': 'str',
4535 '*adapter-type': 'BlockdevVmdkAdapterType',
4536 '*hwversion': 'str',
4537 '*zeroed-grain': 'bool' } }
4541 # @SheepdogRedundancyType:
4543 # @full: Create a fully replicated vdi with x copies
4544 # @erasure-coded: Create an erasure coded vdi with x data strips and
4549 { 'enum': 'SheepdogRedundancyType',
4550 'data': [ 'full', 'erasure-coded' ] }
4553 # @SheepdogRedundancyFull:
4555 # @copies: Number of copies to use (between 1 and 31)
4559 { 'struct': 'SheepdogRedundancyFull',
4560 'data': { 'copies': 'int' }}
4563 # @SheepdogRedundancyErasureCoded:
4565 # @data-strips: Number of data strips to use (one of {2,4,8,16})
4566 # @parity-strips: Number of parity strips to use (between 1 and 15)
4570 { 'struct': 'SheepdogRedundancyErasureCoded',
4571 'data': { 'data-strips': 'int',
4572 'parity-strips': 'int' }}
4575 # @SheepdogRedundancy:
4579 { 'union': 'SheepdogRedundancy',
4580 'base': { 'type': 'SheepdogRedundancyType' },
4581 'discriminator': 'type',
4582 'data': { 'full': 'SheepdogRedundancyFull',
4583 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
4586 # @BlockdevCreateOptionsSheepdog:
4588 # Driver specific image creation options for Sheepdog.
4590 # @location: Where to store the new image file
4591 # @size: Size of the virtual disk in bytes
4592 # @backing-file: File name of a base image
4593 # @preallocation: Preallocation mode for the new image (default: off;
4594 # allowed values: off, full)
4595 # @redundancy: Redundancy of the image
4596 # @object-size: Object size of the image
4600 { 'struct': 'BlockdevCreateOptionsSheepdog',
4601 'data': { 'location': 'BlockdevOptionsSheepdog',
4603 '*backing-file': 'str',
4604 '*preallocation': 'PreallocMode',
4605 '*redundancy': 'SheepdogRedundancy',
4606 '*object-size': 'size' } }
4609 # @BlockdevCreateOptionsSsh:
4611 # Driver specific image creation options for SSH.
4613 # @location: Where to store the new image file
4614 # @size: Size of the virtual disk in bytes
4618 { 'struct': 'BlockdevCreateOptionsSsh',
4619 'data': { 'location': 'BlockdevOptionsSsh',
4623 # @BlockdevCreateOptionsVdi:
4625 # Driver specific image creation options for VDI.
4627 # @file: Node to create the image format on
4628 # @size: Size of the virtual disk in bytes
4629 # @preallocation: Preallocation mode for the new image (default: off;
4630 # allowed values: off, metadata)
4634 { 'struct': 'BlockdevCreateOptionsVdi',
4635 'data': { 'file': 'BlockdevRef',
4637 '*preallocation': 'PreallocMode' } }
4640 # @BlockdevVhdxSubformat:
4642 # @dynamic: Growing image file
4643 # @fixed: Preallocated fixed-size image file
4647 { 'enum': 'BlockdevVhdxSubformat',
4648 'data': [ 'dynamic', 'fixed' ] }
4651 # @BlockdevCreateOptionsVhdx:
4653 # Driver specific image creation options for vhdx.
4655 # @file: Node to create the image format on
4656 # @size: Size of the virtual disk in bytes
4657 # @log-size: Log size in bytes, must be a multiple of 1 MB
4659 # @block-size: Block size in bytes, must be a multiple of 1 MB and not
4660 # larger than 256 MB (default: automatically choose a block
4661 # size depending on the image size)
4662 # @subformat: vhdx subformat (default: dynamic)
4663 # @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard,
4664 # but default. Do not set to 'off' when using 'qemu-img
4665 # convert' with subformat=dynamic.
4669 { 'struct': 'BlockdevCreateOptionsVhdx',
4670 'data': { 'file': 'BlockdevRef',
4672 '*log-size': 'size',
4673 '*block-size': 'size',
4674 '*subformat': 'BlockdevVhdxSubformat',
4675 '*block-state-zero': 'bool' } }
4678 # @BlockdevVpcSubformat:
4680 # @dynamic: Growing image file
4681 # @fixed: Preallocated fixed-size image file
4685 { 'enum': 'BlockdevVpcSubformat',
4686 'data': [ 'dynamic', 'fixed' ] }
4689 # @BlockdevCreateOptionsVpc:
4691 # Driver specific image creation options for vpc (VHD).
4693 # @file: Node to create the image format on
4694 # @size: Size of the virtual disk in bytes
4695 # @subformat: vhdx subformat (default: dynamic)
4696 # @force-size: Force use of the exact byte size instead of rounding to the
4697 # next size that can be represented in CHS geometry
4702 { 'struct': 'BlockdevCreateOptionsVpc',
4703 'data': { 'file': 'BlockdevRef',
4705 '*subformat': 'BlockdevVpcSubformat',
4706 '*force-size': 'bool' } }
4709 # @BlockdevCreateOptions:
4711 # Options for creating an image format on a given node.
4713 # @driver: block driver to create the image format
4717 { 'union': 'BlockdevCreateOptions',
4719 'driver': 'BlockdevDriver' },
4720 'discriminator': 'driver',
4722 'file': 'BlockdevCreateOptionsFile',
4723 'gluster': 'BlockdevCreateOptionsGluster',
4724 'luks': 'BlockdevCreateOptionsLUKS',
4725 'nfs': 'BlockdevCreateOptionsNfs',
4726 'parallels': 'BlockdevCreateOptionsParallels',
4727 'qcow': 'BlockdevCreateOptionsQcow',
4728 'qcow2': 'BlockdevCreateOptionsQcow2',
4729 'qed': 'BlockdevCreateOptionsQed',
4730 'rbd': 'BlockdevCreateOptionsRbd',
4731 'sheepdog': 'BlockdevCreateOptionsSheepdog',
4732 'ssh': 'BlockdevCreateOptionsSsh',
4733 'vdi': 'BlockdevCreateOptionsVdi',
4734 'vhdx': 'BlockdevCreateOptionsVhdx',
4735 'vmdk': 'BlockdevCreateOptionsVmdk',
4736 'vpc': 'BlockdevCreateOptionsVpc'
4742 # Starts a job to create an image format on a given node. The job is
4743 # automatically finalized, but a manual job-dismiss is required.
4745 # @job-id: Identifier for the newly created job.
4747 # @options: Options for the image creation.
4751 { 'command': 'blockdev-create',
4752 'data': { 'job-id': 'str',
4753 'options': 'BlockdevCreateOptions' } }
4756 # @BlockdevAmendOptionsLUKS:
4758 # Driver specific image amend options for LUKS.
4762 { 'struct': 'BlockdevAmendOptionsLUKS',
4763 'base': 'QCryptoBlockAmendOptionsLUKS',
4768 # @BlockdevAmendOptionsQcow2:
4770 # Driver specific image amend options for qcow2.
4771 # For now, only encryption options can be amended
4773 # @encrypt Encryption options to be amended
4777 { 'struct': 'BlockdevAmendOptionsQcow2',
4778 'data': { '*encrypt': 'QCryptoBlockAmendOptions' } }
4781 # @BlockdevAmendOptions:
4783 # Options for amending an image format
4785 # @driver: Block driver of the node to amend.
4789 { 'union': 'BlockdevAmendOptions',
4791 'driver': 'BlockdevDriver' },
4792 'discriminator': 'driver',
4794 'luks': 'BlockdevAmendOptionsLUKS',
4795 'qcow2': 'BlockdevAmendOptionsQcow2' } }
4798 # @x-blockdev-amend:
4800 # Starts a job to amend format specific options of an existing open block device
4801 # The job is automatically finalized, but a manual job-dismiss is required.
4803 # @job-id: Identifier for the newly created job.
4805 # @node-name: Name of the block node to work on
4807 # @options: Options (driver specific)
4809 # @force: Allow unsafe operations, format specific
4810 # For luks that allows erase of the last active keyslot
4811 # (permanent loss of data),
4812 # and replacement of an active keyslot
4813 # (possible loss of data if IO error happens)
4817 { 'command': 'x-blockdev-amend',
4818 'data': { 'job-id': 'str',
4820 'options': 'BlockdevAmendOptions',
4821 '*force': 'bool' } }
4824 # @BlockErrorAction:
4826 # An enumeration of action that has been taken when a DISK I/O occurs
4828 # @ignore: error has been ignored
4830 # @report: error has been reported to the device
4832 # @stop: error caused VM to be stopped
4836 { 'enum': 'BlockErrorAction',
4837 'data': [ 'ignore', 'report', 'stop' ] }
4841 # @BLOCK_IMAGE_CORRUPTED:
4843 # Emitted when a disk image is being marked corrupt. The image can be
4844 # identified by its device or node name. The 'device' field is always
4845 # present for compatibility reasons, but it can be empty ("") if the
4846 # image does not have a device name associated.
4848 # @device: device name. This is always present for compatibility
4849 # reasons, but it can be empty ("") if the image does not
4850 # have a device name associated.
4852 # @node-name: node name (Since: 2.4)
4854 # @msg: informative message for human consumption, such as the kind of
4855 # corruption being detected. It should not be parsed by machine as it is
4856 # not guaranteed to be stable
4858 # @offset: if the corruption resulted from an image access, this is
4859 # the host's access offset into the image
4861 # @size: if the corruption resulted from an image access, this is
4864 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4865 # event and must be repaired (Since 2.2; before, every
4866 # BLOCK_IMAGE_CORRUPTED event was fatal)
4868 # Note: If action is "stop", a STOP event will eventually follow the
4869 # BLOCK_IO_ERROR event.
4873 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4874 # "data": { "device": "ide0-hd0", "node-name": "node0",
4875 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4877 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4881 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4882 'data': { 'device' : 'str',
4883 '*node-name' : 'str',
4887 'fatal' : 'bool' } }
4892 # Emitted when a disk I/O error occurs
4894 # @device: device name. This is always present for compatibility
4895 # reasons, but it can be empty ("") if the image does not
4896 # have a device name associated.
4898 # @node-name: node name. Note that errors may be reported for the root node
4899 # that is directly attached to a guest device rather than for the
4900 # node where the error occurred. The node name is not present if
4901 # the drive is empty. (Since: 2.8)
4903 # @operation: I/O operation
4905 # @action: action that has been taken
4907 # @nospace: true if I/O error was caused due to a no-space
4908 # condition. This key is only present if query-block's
4909 # io-status is present, please see query-block documentation
4910 # for more information (since: 2.2)
4912 # @reason: human readable string describing the error cause.
4913 # (This field is a debugging aid for humans, it should not
4914 # be parsed by applications) (since: 2.2)
4916 # Note: If action is "stop", a STOP event will eventually follow the
4917 # BLOCK_IO_ERROR event
4923 # <- { "event": "BLOCK_IO_ERROR",
4924 # "data": { "device": "ide0-hd1",
4925 # "node-name": "#block212",
4926 # "operation": "write",
4927 # "action": "stop" },
4928 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4931 { 'event': 'BLOCK_IO_ERROR',
4932 'data': { 'device': 'str', '*node-name': 'str',
4933 'operation': 'IoOperationType',
4934 'action': 'BlockErrorAction', '*nospace': 'bool',
4938 # @BLOCK_JOB_COMPLETED:
4940 # Emitted when a block job has completed
4944 # @device: The job identifier. Originally the device name but other
4945 # values are allowed since QEMU 2.7
4947 # @len: maximum progress value
4949 # @offset: current progress value. On success this is equal to len.
4950 # On failure this is less than len
4952 # @speed: rate limit, bytes per second
4954 # @error: error message. Only present on failure. This field
4955 # contains a human-readable error message. There are no semantics
4956 # other than that streaming has failed and clients should not try to
4957 # interpret the error string
4963 # <- { "event": "BLOCK_JOB_COMPLETED",
4964 # "data": { "type": "stream", "device": "virtio-disk0",
4965 # "len": 10737418240, "offset": 10737418240,
4967 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4970 { 'event': 'BLOCK_JOB_COMPLETED',
4971 'data': { 'type' : 'JobType',
4979 # @BLOCK_JOB_CANCELLED:
4981 # Emitted when a block job has been cancelled
4985 # @device: The job identifier. Originally the device name but other
4986 # values are allowed since QEMU 2.7
4988 # @len: maximum progress value
4990 # @offset: current progress value. On success this is equal to len.
4991 # On failure this is less than len
4993 # @speed: rate limit, bytes per second
4999 # <- { "event": "BLOCK_JOB_CANCELLED",
5000 # "data": { "type": "stream", "device": "virtio-disk0",
5001 # "len": 10737418240, "offset": 134217728,
5003 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5006 { 'event': 'BLOCK_JOB_CANCELLED',
5007 'data': { 'type' : 'JobType',
5016 # Emitted when a block job encounters an error
5018 # @device: The job identifier. Originally the device name but other
5019 # values are allowed since QEMU 2.7
5021 # @operation: I/O operation
5023 # @action: action that has been taken
5029 # <- { "event": "BLOCK_JOB_ERROR",
5030 # "data": { "device": "ide0-hd1",
5031 # "operation": "write",
5032 # "action": "stop" },
5033 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5036 { 'event': 'BLOCK_JOB_ERROR',
5037 'data': { 'device' : 'str',
5038 'operation': 'IoOperationType',
5039 'action' : 'BlockErrorAction' } }
5044 # Emitted when a block job is ready to complete
5048 # @device: The job identifier. Originally the device name but other
5049 # values are allowed since QEMU 2.7
5051 # @len: maximum progress value
5053 # @offset: current progress value. On success this is equal to len.
5054 # On failure this is less than len
5056 # @speed: rate limit, bytes per second
5058 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
5065 # <- { "event": "BLOCK_JOB_READY",
5066 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5067 # "len": 2097152, "offset": 2097152 }
5068 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5071 { 'event': 'BLOCK_JOB_READY',
5072 'data': { 'type' : 'JobType',
5079 # @BLOCK_JOB_PENDING:
5081 # Emitted when a block job is awaiting explicit authorization to finalize graph
5082 # changes via @block-job-finalize. If this job is part of a transaction, it will
5083 # not emit this event until the transaction has converged first.
5087 # @id: The job identifier.
5093 # <- { "event": "BLOCK_JOB_WAITING",
5094 # "data": { "device": "drive0", "type": "mirror" },
5095 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5098 { 'event': 'BLOCK_JOB_PENDING',
5099 'data': { 'type' : 'JobType',
5105 # Preallocation mode of QEMU image file
5107 # @off: no preallocation
5108 # @metadata: preallocate only for metadata
5109 # @falloc: like @full preallocation but allocate disk space by
5110 # posix_fallocate() rather than writing data.
5111 # @full: preallocate all data by writing it to the device to ensure
5112 # disk space is really available. This data may or may not be
5113 # zero, depending on the image format and storage.
5114 # @full preallocation also sets up metadata correctly.
5118 { 'enum': 'PreallocMode',
5119 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5122 # @BLOCK_WRITE_THRESHOLD:
5124 # Emitted when writes on block device reaches or exceeds the
5125 # configured write threshold. For thin-provisioned devices, this
5126 # means the device should be extended to avoid pausing for
5128 # The event is one shot. Once triggered, it needs to be
5129 # re-registered with another block-set-write-threshold command.
5131 # @node-name: graph node name on which the threshold was exceeded.
5133 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5135 # @write-threshold: last configured threshold, in bytes.
5139 { 'event': 'BLOCK_WRITE_THRESHOLD',
5140 'data': { 'node-name': 'str',
5141 'amount-exceeded': 'uint64',
5142 'write-threshold': 'uint64' } }
5145 # @block-set-write-threshold:
5147 # Change the write threshold for a block drive. An event will be
5148 # delivered if a write to this block drive crosses the configured
5149 # threshold. The threshold is an offset, thus must be
5150 # non-negative. Default is no write threshold. Setting the threshold
5151 # to zero disables it.
5153 # This is useful to transparently resize thin-provisioned drives without
5154 # the guest OS noticing.
5156 # @node-name: graph node name on which the threshold must be set.
5158 # @write-threshold: configured threshold for the block device, bytes.
5159 # Use 0 to disable the threshold.
5165 # -> { "execute": "block-set-write-threshold",
5166 # "arguments": { "node-name": "mydev",
5167 # "write-threshold": 17179869184 } }
5168 # <- { "return": {} }
5171 { 'command': 'block-set-write-threshold',
5172 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
5175 # @x-blockdev-change:
5177 # Dynamically reconfigure the block driver state graph. It can be used
5178 # to add, remove, insert or replace a graph node. Currently only the
5179 # Quorum driver implements this feature to add or remove its child. This
5180 # is useful to fix a broken quorum child.
5182 # If @node is specified, it will be inserted under @parent. @child
5183 # may not be specified in this case. If both @parent and @child are
5184 # specified but @node is not, @child will be detached from @parent.
5186 # @parent: the id or name of the parent node.
5188 # @child: the name of a child under the given parent node.
5190 # @node: the name of the node that will be added.
5192 # Note: this command is experimental, and its API is not stable. It
5193 # does not support all kinds of operations, all kinds of children, nor
5194 # all block drivers.
5196 # FIXME Removing children from a quorum node means introducing gaps in the
5197 # child indices. This cannot be represented in the 'children' list of
5198 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
5200 # Warning: The data in a new quorum child MUST be consistent with that of
5201 # the rest of the array.
5207 # 1. Add a new node to a quorum
5208 # -> { "execute": "blockdev-add",
5211 # "node-name": "new_node",
5212 # "file": { "driver": "file",
5213 # "filename": "test.raw" } } }
5214 # <- { "return": {} }
5215 # -> { "execute": "x-blockdev-change",
5216 # "arguments": { "parent": "disk1",
5217 # "node": "new_node" } }
5218 # <- { "return": {} }
5220 # 2. Delete a quorum's node
5221 # -> { "execute": "x-blockdev-change",
5222 # "arguments": { "parent": "disk1",
5223 # "child": "children.1" } }
5224 # <- { "return": {} }
5227 { 'command': 'x-blockdev-change',
5228 'data' : { 'parent': 'str',
5233 # @x-blockdev-set-iothread:
5235 # Move @node and its children into the @iothread. If @iothread is null then
5236 # move @node and its children into the main loop.
5238 # The node must not be attached to a BlockBackend.
5240 # @node-name: the name of the block driver node
5242 # @iothread: the name of the IOThread object or null for the main loop
5244 # @force: true if the node and its children should be moved when a BlockBackend
5245 # is already attached
5247 # Note: this command is experimental and intended for test cases that need
5248 # control over IOThreads only.
5254 # 1. Move a node into an IOThread
5255 # -> { "execute": "x-blockdev-set-iothread",
5256 # "arguments": { "node-name": "disk1",
5257 # "iothread": "iothread0" } }
5258 # <- { "return": {} }
5260 # 2. Move a node into the main loop
5261 # -> { "execute": "x-blockdev-set-iothread",
5262 # "arguments": { "node-name": "disk1",
5263 # "iothread": null } }
5264 # <- { "return": {} }
5267 { 'command': 'x-blockdev-set-iothread',
5268 'data' : { 'node-name': 'str',
5269 'iothread': 'StrOrNull',
5270 '*force': 'bool' } }
5275 # An enumeration of the quorum operation types
5277 # @read: read operation
5279 # @write: write operation
5281 # @flush: flush operation
5285 { 'enum': 'QuorumOpType',
5286 'data': [ 'read', 'write', 'flush' ] }
5291 # Emitted by the Quorum block driver if it fails to establish a quorum
5293 # @reference: device name if defined else node name
5295 # @sector-num: number of the first sector of the failed read operation
5297 # @sectors-count: failed read operation sector count
5299 # Note: This event is rate-limited.
5305 # <- { "event": "QUORUM_FAILURE",
5306 # "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
5307 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5310 { 'event': 'QUORUM_FAILURE',
5311 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
5314 # @QUORUM_REPORT_BAD:
5316 # Emitted to report a corruption of a Quorum file
5318 # @type: quorum operation type (Since 2.6)
5320 # @error: error message. Only present on failure. This field
5321 # contains a human-readable error message. There are no semantics other
5322 # than that the block layer reported an error and clients should not
5323 # try to interpret the error string.
5325 # @node-name: the graph node name of the block driver state
5327 # @sector-num: number of the first sector of the failed read operation
5329 # @sectors-count: failed read operation sector count
5331 # Note: This event is rate-limited.
5339 # { "event": "QUORUM_REPORT_BAD",
5340 # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
5342 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5344 # 2. Flush operation
5346 # { "event": "QUORUM_REPORT_BAD",
5347 # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
5348 # "type": "flush", "error": "Broken pipe" },
5349 # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
5352 { 'event': 'QUORUM_REPORT_BAD',
5353 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
5354 'sector-num': 'int', 'sectors-count': 'int' } }
5357 # @BlockdevSnapshotInternal:
5359 # @device: the device name or node-name of a root node to generate the snapshot
5362 # @name: the name of the internal snapshot to be created
5364 # Notes: In transaction, if @name is empty, or any snapshot matching @name
5365 # exists, the operation will fail. Only some image formats support it,
5366 # for example, qcow2, rbd, and sheepdog.
5370 { 'struct': 'BlockdevSnapshotInternal',
5371 'data': { 'device': 'str', 'name': 'str' } }
5374 # @blockdev-snapshot-internal-sync:
5376 # Synchronously take an internal snapshot of a block device, when the
5377 # format of the image used supports it. If the name is an empty
5378 # string, or a snapshot with name already exists, the operation will
5381 # For the arguments, see the documentation of BlockdevSnapshotInternal.
5383 # Returns: - nothing on success
5384 # - If @device is not a valid block device, GenericError
5385 # - If any snapshot matching @name exists, or @name is empty,
5387 # - If the format of the image used does not support it,
5388 # BlockFormatFeatureNotSupported
5394 # -> { "execute": "blockdev-snapshot-internal-sync",
5395 # "arguments": { "device": "ide-hd0",
5396 # "name": "snapshot0" }
5398 # <- { "return": {} }
5401 { 'command': 'blockdev-snapshot-internal-sync',
5402 'data': 'BlockdevSnapshotInternal' }
5405 # @blockdev-snapshot-delete-internal-sync:
5407 # Synchronously delete an internal snapshot of a block device, when the format
5408 # of the image used support it. The snapshot is identified by name or id or
5409 # both. One of the name or id is required. Return SnapshotInfo for the
5410 # successfully deleted snapshot.
5412 # @device: the device name or node-name of a root node to delete the snapshot
5415 # @id: optional the snapshot's ID to be deleted
5417 # @name: optional the snapshot's name to be deleted
5419 # Returns: - SnapshotInfo on success
5420 # - If @device is not a valid block device, GenericError
5421 # - If snapshot not found, GenericError
5422 # - If the format of the image used does not support it,
5423 # BlockFormatFeatureNotSupported
5424 # - If @id and @name are both not specified, GenericError
5430 # -> { "execute": "blockdev-snapshot-delete-internal-sync",
5431 # "arguments": { "device": "ide-hd0",
5432 # "name": "snapshot0" }
5436 # "name": "snapshot0",
5437 # "vm-state-size": 0,
5438 # "date-sec": 1000012,
5440 # "vm-clock-sec": 100,
5441 # "vm-clock-nsec": 20,
5447 { 'command': 'blockdev-snapshot-delete-internal-sync',
5448 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
5449 'returns': 'SnapshotInfo' }