3 # QAPI block core definitions (vm unrelated)
5 # QAPI common definitions
6 { 'include': 'common.json' }
11 # @id: unique snapshot id
13 # @name: user chosen name
15 # @vm-state-size: size of the VM state
17 # @date-sec: UTC date of the snapshot in seconds
19 # @date-nsec: fractional part in nano seconds to be used with date-sec
21 # @vm-clock-sec: VM clock relative to boot in seconds
23 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
29 { 'type': 'SnapshotInfo',
30 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
31 'date-sec': 'int', 'date-nsec': 'int',
32 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
35 # @ImageInfoSpecificQCow2:
37 # @compat: compatibility level
39 # @lazy-refcounts: #optional on or off; only valid for compat >= 1.1
41 # @corrupt: #optional true if the image has been marked corrupt; only valid for
42 # compat >= 1.1 (since 2.2)
46 { 'type': 'ImageInfoSpecificQCow2',
49 '*lazy-refcounts': 'bool',
54 # @ImageInfoSpecificVmdk:
56 # @create-type: The create type of VMDK image
58 # @cid: Content id of image
60 # @parent-cid: Parent VMDK image's cid
62 # @extents: List of extent files
66 { 'type': 'ImageInfoSpecificVmdk',
71 'extents': ['ImageInfo']
77 # A discriminated record of image format specific information structures.
82 { 'union': 'ImageInfoSpecific',
84 'qcow2': 'ImageInfoSpecificQCow2',
85 'vmdk': 'ImageInfoSpecificVmdk'
91 # Information about a QEMU image file
93 # @filename: name of the image file
95 # @format: format of the image file
97 # @virtual-size: maximum capacity in bytes of the image
99 # @actual-size: #optional actual size on disk in bytes of the image
101 # @dirty-flag: #optional true if image is not cleanly closed
103 # @cluster-size: #optional size of a cluster in bytes
105 # @encrypted: #optional true if the image is encrypted
107 # @compressed: #optional true if the image is compressed (Since 1.7)
109 # @backing-filename: #optional name of the backing file
111 # @full-backing-filename: #optional full path of the backing file
113 # @backing-filename-format: #optional the format of the backing file
115 # @snapshots: #optional list of VM snapshots
117 # @backing-image: #optional info of the backing image (since 1.6)
119 # @format-specific: #optional structure supplying additional format-specific
120 # information (since 1.7)
122 # @nocow: #optional info of whether NOCOW flag is set or not. (since 2.2)
128 { 'type': 'ImageInfo',
129 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
130 '*actual-size': 'int', 'virtual-size': 'int',
131 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
132 '*backing-filename': 'str', '*full-backing-filename': 'str',
133 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
134 '*backing-image': 'ImageInfo',
135 '*format-specific': 'ImageInfoSpecific',
141 # Information about a QEMU image file check
143 # @filename: name of the image file checked
145 # @format: format of the image file checked
147 # @check-errors: number of unexpected errors occurred during check
149 # @image-end-offset: #optional offset (in bytes) where the image ends, this
150 # field is present if the driver for the image format
153 # @corruptions: #optional number of corruptions found during the check if any
155 # @leaks: #optional number of leaks found during the check if any
157 # @corruptions-fixed: #optional number of corruptions fixed during the check
160 # @leaks-fixed: #optional number of leaks fixed during the check if any
162 # @total-clusters: #optional total number of clusters, this field is present
163 # if the driver for the image format supports it
165 # @allocated-clusters: #optional total number of allocated clusters, this
166 # field is present if the driver for the image format
169 # @fragmented-clusters: #optional total number of fragmented clusters, this
170 # field is present if the driver for the image format
173 # @compressed-clusters: #optional total number of compressed clusters, this
174 # field is present if the driver for the image format
181 { 'type': 'ImageCheck',
182 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
183 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
184 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
185 '*total-clusters': 'int', '*allocated-clusters': 'int',
186 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
191 # Information about the backing device for a block device.
193 # @file: the filename of the backing device
195 # @node-name: #optional the name of the block driver node (Since 2.0)
197 # @ro: true if the backing device was open read-only
199 # @drv: the name of the block format used to open the backing device. As of
200 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
201 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
202 # 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
203 # 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
204 # 2.2: 'archipelago' added, 'cow' dropped
206 # @backing_file: #optional the name of the backing file (for copy-on-write)
208 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
210 # @encrypted: true if the backing device is encrypted
212 # @encryption_key_missing: true if the backing device is encrypted but an
213 # valid encryption key is missing
215 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
217 # @bps: total throughput limit in bytes per second is specified
219 # @bps_rd: read throughput limit in bytes per second is specified
221 # @bps_wr: write throughput limit in bytes per second is specified
223 # @iops: total I/O operations per second is specified
225 # @iops_rd: read I/O operations per second is specified
227 # @iops_wr: write I/O operations per second is specified
229 # @image: the info of image used (since: 1.6)
231 # @bps_max: #optional total max in bytes (Since 1.7)
233 # @bps_rd_max: #optional read max in bytes (Since 1.7)
235 # @bps_wr_max: #optional write max in bytes (Since 1.7)
237 # @iops_max: #optional total I/O operations max (Since 1.7)
239 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
241 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
243 # @iops_size: #optional an I/O size in bytes (Since 1.7)
248 { 'type': 'BlockDeviceInfo',
249 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
250 '*backing_file': 'str', 'backing_file_depth': 'int',
251 'encrypted': 'bool', 'encryption_key_missing': 'bool',
252 'detect_zeroes': 'BlockdevDetectZeroesOptions',
253 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
254 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
255 'image': 'ImageInfo',
256 '*bps_max': 'int', '*bps_rd_max': 'int',
257 '*bps_wr_max': 'int', '*iops_max': 'int',
258 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
259 '*iops_size': 'int' } }
262 # @BlockDeviceIoStatus:
264 # An enumeration of block device I/O status.
266 # @ok: The last I/O operation has succeeded
268 # @failed: The last I/O operation has failed
270 # @nospace: The last I/O operation has failed due to a no-space condition
274 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
277 # @BlockDeviceMapEntry:
279 # Entry in the metadata map of the device (returned by "qemu-img map")
281 # @start: Offset in the image of the first byte described by this entry
284 # @length: Length of the range described by this entry (in bytes)
286 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
287 # before reaching one for which the range is allocated. The value is
288 # in the range 0 to the depth of the image chain - 1.
290 # @zero: the sectors in this range read as zeros
292 # @data: reading the image will actually read data from a file (in particular,
293 # if @offset is present this means that the sectors are not simply
294 # preallocated, but contain actual data in raw format)
296 # @offset: if present, the image file stores the data for this range in
297 # raw format at the given offset.
301 { 'type': 'BlockDeviceMapEntry',
302 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
303 'data': 'bool', '*offset': 'int' } }
308 # Block dirty bitmap information.
310 # @count: number of dirty bytes according to the dirty bitmap
312 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
316 { 'type': 'BlockDirtyInfo',
317 'data': {'count': 'int', 'granularity': 'int'} }
322 # Block device information. This structure describes a virtual device and
323 # the backing device associated with it.
325 # @device: The device name associated with the virtual device.
327 # @type: This field is returned only for compatibility reasons, it should
328 # not be used (always returns 'unknown')
330 # @removable: True if the device supports removable media.
332 # @locked: True if the guest has locked this device from having its media
335 # @tray_open: #optional True if the device has a tray and it is open
336 # (only present if removable is true)
338 # @dirty-bitmaps: #optional dirty bitmaps information (only present if the
339 # driver has one or more dirty bitmaps) (Since 2.0)
341 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
342 # supports it and the VM is configured to stop on errors
343 # (supported device models: virtio-blk, ide, scsi-disk)
345 # @inserted: #optional @BlockDeviceInfo describing the device if media is
350 { 'type': 'BlockInfo',
351 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
352 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
353 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
354 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
359 # Get a list of BlockInfo for all virtual block devices.
361 # Returns: a list of @BlockInfo describing each virtual block device
365 { 'command': 'query-block', 'returns': ['BlockInfo'] }
370 # Statistics of a virtual block device or a block backing device.
372 # @rd_bytes: The number of bytes read by the device.
374 # @wr_bytes: The number of bytes written by the device.
376 # @rd_operations: The number of read operations performed by the device.
378 # @wr_operations: The number of write operations performed by the device.
380 # @flush_operations: The number of cache flush operations performed by the
381 # device (since 0.15.0)
383 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
386 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
388 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
390 # @wr_highest_offset: The offset after the greatest byte written to the
391 # device. The intended use of this information is for
392 # growable sparse files (like qcow2) that are used on top
393 # of a physical device.
397 { 'type': 'BlockDeviceStats',
398 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
399 'wr_operations': 'int', 'flush_operations': 'int',
400 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
401 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
406 # Statistics of a virtual block device or a block backing device.
408 # @device: #optional If the stats are for a virtual block device, the name
409 # corresponding to the virtual block device.
411 # @stats: A @BlockDeviceStats for the device.
413 # @parent: #optional This describes the file block device if it has one.
415 # @backing: #optional This describes the backing block device if it has one.
420 { 'type': 'BlockStats',
421 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
422 '*parent': 'BlockStats',
423 '*backing': 'BlockStats'} }
428 # Query the @BlockStats for all virtual block devices.
430 # Returns: A list of @BlockStats for each virtual block devices.
434 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
439 # An enumeration of possible behaviors for errors on I/O operations.
440 # The exact meaning depends on whether the I/O was initiated by a guest
443 # @report: for guest operations, report the error to the guest;
444 # for jobs, cancel the job
446 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
447 # or BLOCK_JOB_ERROR)
449 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
451 # @stop: for guest operations, stop the virtual machine;
452 # for jobs, pause the job
456 { 'enum': 'BlockdevOnError',
457 'data': ['report', 'ignore', 'enospc', 'stop'] }
462 # An enumeration of possible behaviors for the initial synchronization
463 # phase of storage mirroring.
465 # @top: copies data in the topmost image to the destination
467 # @full: copies data from all images to the destination
469 # @none: only copy data written from now on
473 { 'enum': 'MirrorSyncMode',
474 'data': ['top', 'full', 'none'] }
479 # Type of a block job.
481 # @commit: block commit job type, see "block-commit"
483 # @stream: block stream job type, see "block-stream"
485 # @mirror: drive mirror job type, see "drive-mirror"
487 # @backup: drive backup job type, see "drive-backup"
491 { 'enum': 'BlockJobType',
492 'data': ['commit', 'stream', 'mirror', 'backup'] }
497 # Information about a long-running block device operation.
499 # @type: the job type ('stream' for image streaming)
501 # @device: the block device name
503 # @len: the maximum progress value
505 # @busy: false if the job is known to be in a quiescent state, with
506 # no pending I/O. Since 1.3.
508 # @paused: whether the job is paused or, if @busy is true, will
509 # pause itself as soon as possible. Since 1.3.
511 # @offset: the current progress value
513 # @speed: the rate limit, bytes per second
515 # @io-status: the status of the job (since 1.3)
517 # @ready: true if the job may be completed (since 2.2)
521 { 'type': 'BlockJobInfo',
522 'data': {'type': 'str', 'device': 'str', 'len': 'int',
523 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
524 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool'} }
529 # Return information about long-running block device operations.
531 # Returns: a list of @BlockJobInfo for each active block job
535 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
540 # This command sets the password of a block device that has not been open
541 # with a password and requires one.
543 # The two cases where this can happen are a block device is created through
544 # QEMU's initial command line or a block device is changed through the legacy
547 # In the event that the block device is created through the initial command
548 # line, the VM will start in the stopped state regardless of whether '-S' is
549 # used. The intention is for a management tool to query the block devices to
550 # determine which ones are encrypted, set the passwords with this command, and
551 # then start the guest with the @cont command.
553 # Either @device or @node-name must be set but not both.
555 # @device: #optional the name of the block backend device to set the password on
557 # @node-name: #optional graph node name to set the password on (Since 2.0)
559 # @password: the password to use for the device
561 # Returns: nothing on success
562 # If @device is not a valid block device, DeviceNotFound
563 # If @device is not encrypted, DeviceNotEncrypted
565 # Notes: Not all block formats support encryption and some that do are not
566 # able to validate that a password is correct. Disk corruption may
567 # occur if an invalid password is specified.
571 { 'command': 'block_passwd', 'data': {'*device': 'str',
572 '*node-name': 'str', 'password': 'str'} }
577 # Resize a block image while a guest is running.
579 # Either @device or @node-name must be set but not both.
581 # @device: #optional the name of the device to get the image resized
583 # @node-name: #optional graph node name to get the image resized (Since 2.0)
585 # @size: new image size in bytes
587 # Returns: nothing on success
588 # If @device is not a valid block device, DeviceNotFound
592 { 'command': 'block_resize', 'data': { '*device': 'str',
599 # An enumeration that tells QEMU how to set the backing file path in
602 # @existing: QEMU should look for an existing image file.
604 # @absolute-paths: QEMU should create a new image with absolute paths
605 # for the backing file. If there is no backing file available, the new
606 # image will not be backed either.
610 { 'enum': 'NewImageMode',
611 'data': [ 'existing', 'absolute-paths' ] }
616 # Either @device or @node-name must be set but not both.
618 # @device: #optional the name of the device to generate the snapshot from.
620 # @node-name: #optional graph node name to generate the snapshot from (Since 2.0)
622 # @snapshot-file: the target of the new image. A new file will be created.
624 # @snapshot-node-name: #optional the graph node name of the new image (Since 2.0)
626 # @format: #optional the format of the snapshot image, default is 'qcow2'.
628 # @mode: #optional whether and how QEMU should create a new image, default is
631 { 'type': 'BlockdevSnapshot',
632 'data': { '*device': 'str', '*node-name': 'str',
633 'snapshot-file': 'str', '*snapshot-node-name': 'str',
634 '*format': 'str', '*mode': 'NewImageMode' } }
639 # @device: the name of the device which should be copied.
641 # @target: the target of the new image. If the file exists, or if it
642 # is a device, the existing file/device will be used as the new
643 # destination. If it does not exist, a new file will be created.
645 # @format: #optional the format of the new destination, default is to
646 # probe if @mode is 'existing', else the format of the source
648 # @sync: what parts of the disk image should be copied to the destination
649 # (all the disk, only the sectors allocated in the topmost image, or
652 # @mode: #optional whether and how QEMU should create a new image, default is
655 # @speed: #optional the maximum speed, in bytes per second
657 # @on-source-error: #optional the action to take on an error on the source,
658 # default 'report'. 'stop' and 'enospc' can only be used
659 # if the block device supports io-status (see BlockInfo).
661 # @on-target-error: #optional the action to take on an error on the target,
662 # default 'report' (no limitations, since this applies to
663 # a different block device than @device).
665 # Note that @on-source-error and @on-target-error only affect background I/O.
666 # If an error occurs during a guest write request, the device's rerror/werror
667 # actions will be used.
671 { 'type': 'DriveBackup',
672 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
673 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
675 '*on-source-error': 'BlockdevOnError',
676 '*on-target-error': 'BlockdevOnError' } }
679 # @blockdev-snapshot-sync
681 # Generates a synchronous snapshot of a block device.
683 # For the arguments, see the documentation of BlockdevSnapshot.
685 # Returns: nothing on success
686 # If @device is not a valid block device, DeviceNotFound
690 { 'command': 'blockdev-snapshot-sync',
691 'data': 'BlockdevSnapshot' }
694 # @change-backing-file
696 # Change the backing file in the image file metadata. This does not
697 # cause QEMU to reopen the image file to reparse the backing filename
698 # (it may, however, perform a reopen to change permissions from
699 # r/o -> r/w -> r/o, if needed). The new backing file string is written
700 # into the image file metadata, and the QEMU internal strings are
703 # @image-node-name: The name of the block driver state node of the
706 # @device: The name of the device that owns image-node-name.
708 # @backing-file: The string to write as the backing file. This
709 # string is not validated, so care should be taken
710 # when specifying the string or the image chain may
711 # not be able to be reopened again.
715 { 'command': 'change-backing-file',
716 'data': { 'device': 'str', 'image-node-name': 'str',
717 'backing-file': 'str' } }
722 # Live commit of data from overlay image nodes into backing nodes - i.e.,
723 # writes data between 'top' and 'base' into 'base'.
725 # @device: the name of the device
727 # @base: #optional The file name of the backing image to write data into.
728 # If not specified, this is the deepest backing image
730 # @top: #optional The file name of the backing image within the image chain,
731 # which contains the topmost data to be committed down. If
732 # not specified, this is the active layer.
734 # @backing-file: #optional The backing file string to write into the overlay
735 # image of 'top'. If 'top' is the active layer,
736 # specifying a backing file string is an error. This
737 # filename is not validated.
739 # If a pathname string is such that it cannot be
740 # resolved by QEMU, that means that subsequent QMP or
741 # HMP commands must use node-names for the image in
742 # question, as filename lookup methods will fail.
744 # If not specified, QEMU will automatically determine
745 # the backing file string to use, or error out if
746 # there is no obvious choice. Care should be taken
747 # when specifying the string, to specify a valid
748 # filename or protocol.
751 # If top == base, that is an error.
752 # If top == active, the job will not be completed by itself,
753 # user needs to complete the job with the block-job-complete
754 # command after getting the ready event. (Since 2.0)
756 # If the base image is smaller than top, then the base image
757 # will be resized to be the same size as top. If top is
758 # smaller than the base image, the base will not be
759 # truncated. If you want the base image size to match the
760 # size of the smaller top, you can safely truncate it
761 # yourself once the commit operation successfully completes.
763 # @speed: #optional the maximum speed, in bytes per second
765 # Returns: Nothing on success
766 # If commit or stream is already active on this device, DeviceInUse
767 # If @device does not exist, DeviceNotFound
768 # If image commit is not supported by this device, NotSupported
769 # If @base or @top is invalid, a generic error is returned
770 # If @speed is invalid, InvalidParameter
775 { 'command': 'block-commit',
776 'data': { 'device': 'str', '*base': 'str', '*top': 'str',
777 '*backing-file': 'str', '*speed': 'int' } }
782 # Start a point-in-time copy of a block device to a new destination. The
783 # status of ongoing drive-backup operations can be checked with
784 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
785 # The operation can be stopped before it has completed using the
786 # block-job-cancel command.
788 # For the arguments, see the documentation of DriveBackup.
790 # Returns: nothing on success
791 # If @device is not a valid block device, DeviceNotFound
795 { 'command': 'drive-backup', 'data': 'DriveBackup' }
798 # @query-named-block-nodes
800 # Get the named block driver list
802 # Returns: the list of BlockDeviceInfo
806 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
811 # Start mirroring a block device's writes to a new destination.
813 # @device: the name of the device whose writes should be mirrored.
815 # @target: the target of the new image. If the file exists, or if it
816 # is a device, the existing file/device will be used as the new
817 # destination. If it does not exist, a new file will be created.
819 # @format: #optional the format of the new destination, default is to
820 # probe if @mode is 'existing', else the format of the source
822 # @node-name: #optional the new block driver state node name in the graph
825 # @replaces: #optional with sync=full graph node name to be replaced by the new
826 # image when a whole image copy is done. This can be used to repair
827 # broken Quorum files. (Since 2.1)
829 # @mode: #optional whether and how QEMU should create a new image, default is
832 # @speed: #optional the maximum speed, in bytes per second
834 # @sync: what parts of the disk image should be copied to the destination
835 # (all the disk, only the sectors allocated in the topmost image, or
838 # @granularity: #optional granularity of the dirty bitmap, default is 64K
839 # if the image format doesn't have clusters, 4K if the clusters
840 # are smaller than that, else the cluster size. Must be a
841 # power of 2 between 512 and 64M (since 1.4).
843 # @buf-size: #optional maximum amount of data in flight from source to
844 # target (since 1.4).
846 # @on-source-error: #optional the action to take on an error on the source,
847 # default 'report'. 'stop' and 'enospc' can only be used
848 # if the block device supports io-status (see BlockInfo).
850 # @on-target-error: #optional the action to take on an error on the target,
851 # default 'report' (no limitations, since this applies to
852 # a different block device than @device).
854 # Returns: nothing on success
855 # If @device is not a valid block device, DeviceNotFound
859 { 'command': 'drive-mirror',
860 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
861 '*node-name': 'str', '*replaces': 'str',
862 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
863 '*speed': 'int', '*granularity': 'uint32',
864 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
865 '*on-target-error': 'BlockdevOnError' } }
868 # @block_set_io_throttle:
870 # Change I/O throttle limits for a block drive.
872 # @device: The name of the device
874 # @bps: total throughput limit in bytes per second
876 # @bps_rd: read throughput limit in bytes per second
878 # @bps_wr: write throughput limit in bytes per second
880 # @iops: total I/O operations per second
882 # @ops_rd: read I/O operations per second
884 # @iops_wr: write I/O operations per second
886 # @bps_max: #optional total max in bytes (Since 1.7)
888 # @bps_rd_max: #optional read max in bytes (Since 1.7)
890 # @bps_wr_max: #optional write max in bytes (Since 1.7)
892 # @iops_max: #optional total I/O operations max (Since 1.7)
894 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
896 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
898 # @iops_size: #optional an I/O size in bytes (Since 1.7)
900 # Returns: Nothing on success
901 # If @device is not a valid block device, DeviceNotFound
905 { 'command': 'block_set_io_throttle',
906 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
907 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
908 '*bps_max': 'int', '*bps_rd_max': 'int',
909 '*bps_wr_max': 'int', '*iops_max': 'int',
910 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
911 '*iops_size': 'int' } }
916 # Copy data from a backing file into a block device.
918 # The block streaming operation is performed in the background until the entire
919 # backing file has been copied. This command returns immediately once streaming
920 # has started. The status of ongoing block streaming operations can be checked
921 # with query-block-jobs. The operation can be stopped before it has completed
922 # using the block-job-cancel command.
924 # If a base file is specified then sectors are not copied from that base file and
925 # its backing chain. When streaming completes the image file will have the base
926 # file as its backing file. This can be used to stream a subset of the backing
927 # file chain instead of flattening the entire image.
929 # On successful completion the image file is updated to drop the backing file
930 # and the BLOCK_JOB_COMPLETED event is emitted.
932 # @device: the device name
934 # @base: #optional the common backing file name
936 # @backing-file: #optional The backing file string to write into the active
937 # layer. This filename is not validated.
939 # If a pathname string is such that it cannot be
940 # resolved by QEMU, that means that subsequent QMP or
941 # HMP commands must use node-names for the image in
942 # question, as filename lookup methods will fail.
944 # If not specified, QEMU will automatically determine
945 # the backing file string to use, or error out if there
946 # is no obvious choice. Care should be taken when
947 # specifying the string, to specify a valid filename or
951 # @speed: #optional the maximum speed, in bytes per second
953 # @on-error: #optional the action to take on an error (default report).
954 # 'stop' and 'enospc' can only be used if the block device
955 # supports io-status (see BlockInfo). Since 1.3.
957 # Returns: Nothing on success
958 # If @device does not exist, DeviceNotFound
962 { 'command': 'block-stream',
963 'data': { 'device': 'str', '*base': 'str', '*backing-file': 'str',
964 '*speed': 'int', '*on-error': 'BlockdevOnError' } }
967 # @block-job-set-speed:
969 # Set maximum speed for a background block operation.
971 # This command can only be issued when there is an active block job.
973 # Throttling can be disabled by setting the speed to 0.
975 # @device: the device name
977 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
980 # Returns: Nothing on success
981 # If no background operation is active on this device, DeviceNotActive
985 { 'command': 'block-job-set-speed',
986 'data': { 'device': 'str', 'speed': 'int' } }
991 # Stop an active background block operation.
993 # This command returns immediately after marking the active background block
994 # operation for cancellation. It is an error to call this command if no
995 # operation is in progress.
997 # The operation will cancel as soon as possible and then emit the
998 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
999 # enumerated using query-block-jobs.
1001 # For streaming, the image file retains its backing file unless the streaming
1002 # operation happens to complete just as it is being cancelled. A new streaming
1003 # operation can be started at a later time to finish copying all data from the
1006 # @device: the device name
1008 # @force: #optional whether to allow cancellation of a paused job (default
1009 # false). Since 1.3.
1011 # Returns: Nothing on success
1012 # If no background operation is active on this device, DeviceNotActive
1016 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
1021 # Pause an active background block operation.
1023 # This command returns immediately after marking the active background block
1024 # operation for pausing. It is an error to call this command if no
1025 # operation is in progress. Pausing an already paused job has no cumulative
1026 # effect; a single block-job-resume command will resume the job.
1028 # The operation will pause as soon as possible. No event is emitted when
1029 # the operation is actually paused. Cancelling a paused job automatically
1032 # @device: the device name
1034 # Returns: Nothing on success
1035 # If no background operation is active on this device, DeviceNotActive
1039 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
1042 # @block-job-resume:
1044 # Resume an active background block operation.
1046 # This command returns immediately after resuming a paused background block
1047 # operation. It is an error to call this command if no operation is in
1048 # progress. Resuming an already running job is not an error.
1050 # This command also clears the error status of the job.
1052 # @device: the device name
1054 # Returns: Nothing on success
1055 # If no background operation is active on this device, DeviceNotActive
1059 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
1062 # @block-job-complete:
1064 # Manually trigger completion of an active background block operation. This
1065 # is supported for drive mirroring, where it also switches the device to
1066 # write to the target path only. The ability to complete is signaled with
1067 # a BLOCK_JOB_READY event.
1069 # This command completes an active background block operation synchronously.
1070 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
1071 # is not defined. Note that if an I/O error occurs during the processing of
1072 # this command: 1) the command itself will fail; 2) the error will be processed
1073 # according to the rerror/werror arguments that were specified when starting
1076 # A cancelled or paused job cannot be completed.
1078 # @device: the device name
1080 # Returns: Nothing on success
1081 # If no background operation is active on this device, DeviceNotActive
1085 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
1088 # @BlockdevDiscardOptions
1090 # Determines how to handle discard requests.
1092 # @ignore: Ignore the request
1093 # @unmap: Forward as an unmap request
1097 { 'enum': 'BlockdevDiscardOptions',
1098 'data': [ 'ignore', 'unmap' ] }
1101 # @BlockdevDetectZeroesOptions
1103 # Describes the operation mode for the automatic conversion of plain
1104 # zero writes by the OS to driver specific optimized zero write commands.
1106 # @off: Disabled (default)
1108 # @unmap: Enabled and even try to unmap blocks if possible. This requires
1109 # also that @BlockdevDiscardOptions is set to unmap for this device.
1113 { 'enum': 'BlockdevDetectZeroesOptions',
1114 'data': [ 'off', 'on', 'unmap' ] }
1117 # @BlockdevAioOptions
1119 # Selects the AIO backend to handle I/O requests
1121 # @threads: Use qemu's thread pool
1122 # @native: Use native AIO backend (only Linux and Windows)
1126 { 'enum': 'BlockdevAioOptions',
1127 'data': [ 'threads', 'native' ] }
1130 # @BlockdevCacheOptions
1132 # Includes cache-related options for block devices
1134 # @writeback: #optional enables writeback mode for any caches (default: true)
1135 # @direct: #optional enables use of O_DIRECT (bypass the host page cache;
1137 # @no-flush: #optional ignore any flush requests for the device (default:
1142 { 'type': 'BlockdevCacheOptions',
1143 'data': { '*writeback': 'bool',
1145 '*no-flush': 'bool' } }
1150 # Drivers that are supported in block device operations.
1152 # @host_device, @host_cdrom, @host_floppy: Since 2.1
1156 { 'enum': 'BlockdevDriver',
1157 'data': [ 'archipelago', 'blkdebug', 'blkverify', 'bochs', 'cloop',
1158 'dmg', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
1159 'host_floppy', 'http', 'https', 'null-aio', 'null-co', 'parallels',
1160 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'tftp', 'vdi', 'vhdx',
1161 'vmdk', 'vpc', 'vvfat' ] }
1164 # @BlockdevOptionsBase
1166 # Options that are available for all block devices, independent of the block
1169 # @driver: block driver name
1170 # @id: #optional id by which the new block device can be referred to.
1171 # This is a required option on the top level of blockdev-add, and
1172 # currently not allowed on any other level.
1173 # @node-name: #optional the name of a block driver state node (Since 2.0)
1174 # @discard: #optional discard-related options (default: ignore)
1175 # @cache: #optional cache-related options
1176 # @aio: #optional AIO backend (default: threads)
1177 # @rerror: #optional how to handle read errors on the device
1179 # @werror: #optional how to handle write errors on the device
1181 # @read-only: #optional whether the block device should be read-only
1183 # @detect-zeroes: #optional detect and optimize zero writes (Since 2.1)
1188 { 'type': 'BlockdevOptionsBase',
1189 'data': { 'driver': 'BlockdevDriver',
1191 '*node-name': 'str',
1192 '*discard': 'BlockdevDiscardOptions',
1193 '*cache': 'BlockdevCacheOptions',
1194 '*aio': 'BlockdevAioOptions',
1195 '*rerror': 'BlockdevOnError',
1196 '*werror': 'BlockdevOnError',
1197 '*read-only': 'bool',
1198 '*detect-zeroes': 'BlockdevDetectZeroesOptions' } }
1201 # @BlockdevOptionsFile
1203 # Driver specific block device options for the file backend and similar
1206 # @filename: path to the image file
1210 { 'type': 'BlockdevOptionsFile',
1211 'data': { 'filename': 'str' } }
1214 # @BlockdevOptionsNull
1216 # Driver specific block device options for the null backend.
1218 # @size: #optional size of the device in bytes.
1222 { 'type': 'BlockdevOptionsNull',
1223 'data': { '*size': 'int' } }
1226 # @BlockdevOptionsVVFAT
1228 # Driver specific block device options for the vvfat protocol.
1230 # @dir: directory to be exported as FAT image
1231 # @fat-type: #optional FAT type: 12, 16 or 32
1232 # @floppy: #optional whether to export a floppy image (true) or
1233 # partitioned hard disk (false; default)
1234 # @rw: #optional whether to allow write operations (default: false)
1238 { 'type': 'BlockdevOptionsVVFAT',
1239 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
1243 # @BlockdevOptionsGenericFormat
1245 # Driver specific block device options for image format that have no option
1246 # besides their data source.
1248 # @file: reference to or definition of the data source block device
1252 { 'type': 'BlockdevOptionsGenericFormat',
1253 'data': { 'file': 'BlockdevRef' } }
1256 # @BlockdevOptionsGenericCOWFormat
1258 # Driver specific block device options for image format that have no option
1259 # besides their data source and an optional backing file.
1261 # @backing: #optional reference to or definition of the backing file block
1262 # device (if missing, taken from the image file content). It is
1263 # allowed to pass an empty string here in order to disable the
1264 # default backing file.
1268 { 'type': 'BlockdevOptionsGenericCOWFormat',
1269 'base': 'BlockdevOptionsGenericFormat',
1270 'data': { '*backing': 'BlockdevRef' } }
1273 # @Qcow2OverlapCheckMode
1275 # General overlap check modes.
1277 # @none: Do not perform any checks
1279 # @constant: Perform only checks which can be done in constant time and
1280 # without reading anything from disk
1282 # @cached: Perform only checks which can be done without reading anything
1285 # @all: Perform all available overlap checks
1289 { 'enum': 'Qcow2OverlapCheckMode',
1290 'data': [ 'none', 'constant', 'cached', 'all' ] }
1293 # @Qcow2OverlapCheckFlags
1295 # Structure of flags for each metadata structure. Setting a field to 'true'
1296 # makes qemu guard that structure against unintended overwriting. The default
1297 # value is chosen according to the template given.
1299 # @template: Specifies a template mode which can be adjusted using the other
1300 # flags, defaults to 'cached'
1304 { 'type': 'Qcow2OverlapCheckFlags',
1305 'data': { '*template': 'Qcow2OverlapCheckMode',
1306 '*main-header': 'bool',
1307 '*active-l1': 'bool',
1308 '*active-l2': 'bool',
1309 '*refcount-table': 'bool',
1310 '*refcount-block': 'bool',
1311 '*snapshot-table': 'bool',
1312 '*inactive-l1': 'bool',
1313 '*inactive-l2': 'bool' } }
1316 # @Qcow2OverlapChecks
1318 # Specifies which metadata structures should be guarded against unintended
1321 # @flags: set of flags for separate specification of each metadata structure
1324 # @mode: named mode which chooses a specific set of flags
1328 { 'union': 'Qcow2OverlapChecks',
1329 'discriminator': {},
1330 'data': { 'flags': 'Qcow2OverlapCheckFlags',
1331 'mode': 'Qcow2OverlapCheckMode' } }
1334 # @BlockdevOptionsQcow2
1336 # Driver specific block device options for qcow2.
1338 # @lazy-refcounts: #optional whether to enable the lazy refcounts
1339 # feature (default is taken from the image file)
1341 # @pass-discard-request: #optional whether discard requests to the qcow2
1342 # device should be forwarded to the data source
1344 # @pass-discard-snapshot: #optional whether discard requests for the data source
1345 # should be issued when a snapshot operation (e.g.
1346 # deleting a snapshot) frees clusters in the qcow2 file
1348 # @pass-discard-other: #optional whether discard requests for the data source
1349 # should be issued on other occasions where a cluster
1352 # @overlap-check: #optional which overlap checks to perform for writes
1353 # to the image, defaults to 'cached' (since 2.2)
1355 # @cache-size: #optional the maximum total size of the L2 table and
1356 # refcount block caches in bytes (since 2.2)
1358 # @l2-cache-size: #optional the maximum size of the L2 table cache in
1361 # @refcount-cache-size: #optional the maximum size of the refcount block cache
1362 # in bytes (since 2.2)
1366 { 'type': 'BlockdevOptionsQcow2',
1367 'base': 'BlockdevOptionsGenericCOWFormat',
1368 'data': { '*lazy-refcounts': 'bool',
1369 '*pass-discard-request': 'bool',
1370 '*pass-discard-snapshot': 'bool',
1371 '*pass-discard-other': 'bool',
1372 '*overlap-check': 'Qcow2OverlapChecks',
1373 '*cache-size': 'int',
1374 '*l2-cache-size': 'int',
1375 '*refcount-cache-size': 'int' } }
1379 # @BlockdevOptionsArchipelago
1381 # Driver specific block device options for Archipelago.
1383 # @volume: Name of the Archipelago volume image
1385 # @mport: #optional The port number on which mapperd is
1386 # listening. This is optional
1387 # and if not specified, QEMU will make Archipelago
1388 # use the default port (1001).
1390 # @vport: #optional The port number on which vlmcd is
1391 # listening. This is optional
1392 # and if not specified, QEMU will make Archipelago
1393 # use the default port (501).
1395 # @segment: #optional The name of the shared memory segment
1396 # Archipelago stack is using. This is optional
1397 # and if not specified, QEMU will make Archipelago
1398 # use the default value, 'archipelago'.
1401 { 'type': 'BlockdevOptionsArchipelago',
1402 'data': { 'volume': 'str',
1405 '*segment': 'str' } }
1411 # Trigger events supported by blkdebug.
1413 { 'enum': 'BlkdebugEvent',
1414 'data': [ 'l1_update', 'l1_grow.alloc_table', 'l1_grow.write_table',
1415 'l1_grow.activate_table', 'l2_load', 'l2_update',
1416 'l2_update_compressed', 'l2_alloc.cow_read', 'l2_alloc.write',
1417 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
1418 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
1419 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
1420 'refblock_load', 'refblock_update', 'refblock_update_part',
1421 'refblock_alloc', 'refblock_alloc.hookup', 'refblock_alloc.write',
1422 'refblock_alloc.write_blocks', 'refblock_alloc.write_table',
1423 'refblock_alloc.switch_table', 'cluster_alloc',
1424 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
1425 'flush_to_disk', 'pwritev_rmw.head', 'pwritev_rmw.after_head',
1426 'pwritev_rmw.tail', 'pwritev_rmw.after_tail', 'pwritev',
1427 'pwritev_zero', 'pwritev_done', 'empty_image_prepare' ] }
1430 # @BlkdebugInjectErrorOptions
1432 # Describes a single error injection for blkdebug.
1434 # @event: trigger event
1436 # @state: #optional the state identifier blkdebug needs to be in to
1437 # actually trigger the event; defaults to "any"
1439 # @errno: #optional error identifier (errno) to be returned; defaults to
1442 # @sector: #optional specifies the sector index which has to be affected
1443 # in order to actually trigger the event; defaults to "any
1446 # @once: #optional disables further events after this one has been
1447 # triggered; defaults to false
1449 # @immediately: #optional fail immediately; defaults to false
1453 { 'type': 'BlkdebugInjectErrorOptions',
1454 'data': { 'event': 'BlkdebugEvent',
1459 '*immediately': 'bool' } }
1462 # @BlkdebugSetStateOptions
1464 # Describes a single state-change event for blkdebug.
1466 # @event: trigger event
1468 # @state: #optional the current state identifier blkdebug needs to be in;
1471 # @new_state: the state identifier blkdebug is supposed to assume if
1472 # this event is triggered
1476 { 'type': 'BlkdebugSetStateOptions',
1477 'data': { 'event': 'BlkdebugEvent',
1479 'new_state': 'int' } }
1482 # @BlockdevOptionsBlkdebug
1484 # Driver specific block device options for blkdebug.
1486 # @image: underlying raw block device (or image file)
1488 # @config: #optional filename of the configuration file
1490 # @align: #optional required alignment for requests in bytes
1492 # @inject-error: #optional array of error injection descriptions
1494 # @set-state: #optional array of state-change descriptions
1498 { 'type': 'BlockdevOptionsBlkdebug',
1499 'data': { 'image': 'BlockdevRef',
1502 '*inject-error': ['BlkdebugInjectErrorOptions'],
1503 '*set-state': ['BlkdebugSetStateOptions'] } }
1506 # @BlockdevOptionsBlkverify
1508 # Driver specific block device options for blkverify.
1510 # @test: block device to be tested
1512 # @raw: raw image used for verification
1516 { 'type': 'BlockdevOptionsBlkverify',
1517 'data': { 'test': 'BlockdevRef',
1518 'raw': 'BlockdevRef' } }
1521 # @QuorumReadPattern
1523 # An enumeration of quorum read patterns.
1525 # @quorum: read all the children and do a quorum vote on reads
1527 # @fifo: read only from the first child that has not failed
1531 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
1534 # @BlockdevOptionsQuorum
1536 # Driver specific block device options for Quorum
1538 # @blkverify: #optional true if the driver must print content mismatch
1539 # set to false by default
1541 # @children: the children block devices to use
1543 # @vote-threshold: the vote limit under which a read will fail
1545 # @rewrite-corrupted: #optional rewrite corrupted data when quorum is reached
1548 # @read-pattern: #optional choose read pattern and set to quorum by default
1553 { 'type': 'BlockdevOptionsQuorum',
1554 'data': { '*blkverify': 'bool',
1555 'children': [ 'BlockdevRef' ],
1556 'vote-threshold': 'int',
1557 '*rewrite-corrupted': 'bool',
1558 '*read-pattern': 'QuorumReadPattern' } }
1563 # Options for creating a block device.
1567 { 'union': 'BlockdevOptions',
1568 'base': 'BlockdevOptionsBase',
1569 'discriminator': 'driver',
1571 'archipelago':'BlockdevOptionsArchipelago',
1572 'blkdebug': 'BlockdevOptionsBlkdebug',
1573 'blkverify': 'BlockdevOptionsBlkverify',
1574 'bochs': 'BlockdevOptionsGenericFormat',
1575 'cloop': 'BlockdevOptionsGenericFormat',
1576 'dmg': 'BlockdevOptionsGenericFormat',
1577 'file': 'BlockdevOptionsFile',
1578 'ftp': 'BlockdevOptionsFile',
1579 'ftps': 'BlockdevOptionsFile',
1580 # TODO gluster: Wait for structured options
1581 'host_cdrom': 'BlockdevOptionsFile',
1582 'host_device':'BlockdevOptionsFile',
1583 'host_floppy':'BlockdevOptionsFile',
1584 'http': 'BlockdevOptionsFile',
1585 'https': 'BlockdevOptionsFile',
1586 # TODO iscsi: Wait for structured options
1587 # TODO nbd: Should take InetSocketAddress for 'host'?
1588 # TODO nfs: Wait for structured options
1589 'null-aio': 'BlockdevOptionsNull',
1590 'null-co': 'BlockdevOptionsNull',
1591 'parallels': 'BlockdevOptionsGenericFormat',
1592 'qcow2': 'BlockdevOptionsQcow2',
1593 'qcow': 'BlockdevOptionsGenericCOWFormat',
1594 'qed': 'BlockdevOptionsGenericCOWFormat',
1595 'quorum': 'BlockdevOptionsQuorum',
1596 'raw': 'BlockdevOptionsGenericFormat',
1597 # TODO rbd: Wait for structured options
1598 # TODO sheepdog: Wait for structured options
1599 # TODO ssh: Should take InetSocketAddress for 'host'?
1600 'tftp': 'BlockdevOptionsFile',
1601 'vdi': 'BlockdevOptionsGenericFormat',
1602 'vhdx': 'BlockdevOptionsGenericFormat',
1603 'vmdk': 'BlockdevOptionsGenericCOWFormat',
1604 'vpc': 'BlockdevOptionsGenericFormat',
1605 'vvfat': 'BlockdevOptionsVVFAT'
1611 # Reference to a block device.
1613 # @definition: defines a new block device inline
1614 # @reference: references the ID of an existing block device. An
1615 # empty string means that no block device should be
1620 { 'union': 'BlockdevRef',
1621 'discriminator': {},
1622 'data': { 'definition': 'BlockdevOptions',
1623 'reference': 'str' } }
1628 # Creates a new block device.
1630 # @options: block device options for the new device
1634 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }
1640 # An enumeration of action that has been taken when a DISK I/O occurs
1642 # @ignore: error has been ignored
1644 # @report: error has been reported to the device
1646 # @stop: error caused VM to be stopped
1650 { 'enum': 'BlockErrorAction',
1651 'data': [ 'ignore', 'report', 'stop' ] }
1655 # @BLOCK_IMAGE_CORRUPTED
1657 # Emitted when a corruption has been detected in a disk image
1659 # @device: device name
1661 # @msg: informative message for human consumption, such as the kind of
1662 # corruption being detected. It should not be parsed by machine as it is
1663 # not guaranteed to be stable
1665 # @offset: #optional, if the corruption resulted from an image access, this is
1666 # the access offset into the image
1668 # @size: #optional, if the corruption resulted from an image access, this is
1671 # fatal: if set, the image is marked corrupt and therefore unusable after this
1672 # event and must be repaired (Since 2.2; before, every
1673 # BLOCK_IMAGE_CORRUPTED event was fatal)
1677 { 'event': 'BLOCK_IMAGE_CORRUPTED',
1678 'data': { 'device' : 'str',
1682 'fatal' : 'bool' } }
1687 # Emitted when a disk I/O error occurs
1689 # @device: device name
1691 # @operation: I/O operation
1693 # @action: action that has been taken
1695 # @nospace: #optional true if I/O error was caused due to a no-space
1696 # condition. This key is only present if query-block's
1697 # io-status is present, please see query-block documentation
1698 # for more information (since: 2.2)
1700 # @reason: human readable string describing the error cause.
1701 # (This field is a debugging aid for humans, it should not
1702 # be parsed by applications) (since: 2.2)
1704 # Note: If action is "stop", a STOP event will eventually follow the
1705 # BLOCK_IO_ERROR event
1709 { 'event': 'BLOCK_IO_ERROR',
1710 'data': { 'device': 'str', 'operation': 'IoOperationType',
1711 'action': 'BlockErrorAction', '*nospace': 'bool',
1715 # @BLOCK_JOB_COMPLETED
1717 # Emitted when a block job has completed
1721 # @device: device name
1723 # @len: maximum progress value
1725 # @offset: current progress value. On success this is equal to len.
1726 # On failure this is less than len
1728 # @speed: rate limit, bytes per second
1730 # @error: #optional, error message. Only present on failure. This field
1731 # contains a human-readable error message. There are no semantics
1732 # other than that streaming has failed and clients should not try to
1733 # interpret the error string
1737 { 'event': 'BLOCK_JOB_COMPLETED',
1738 'data': { 'type' : 'BlockJobType',
1746 # @BLOCK_JOB_CANCELLED
1748 # Emitted when a block job has been cancelled
1752 # @device: device name
1754 # @len: maximum progress value
1756 # @offset: current progress value. On success this is equal to len.
1757 # On failure this is less than len
1759 # @speed: rate limit, bytes per second
1763 { 'event': 'BLOCK_JOB_CANCELLED',
1764 'data': { 'type' : 'BlockJobType',
1773 # Emitted when a block job encounters an error
1775 # @device: device name
1777 # @operation: I/O operation
1779 # @action: action that has been taken
1783 { 'event': 'BLOCK_JOB_ERROR',
1784 'data': { 'device' : 'str',
1785 'operation': 'IoOperationType',
1786 'action' : 'BlockErrorAction' } }
1791 # Emitted when a block job is ready to complete
1795 # @device: device name
1797 # @len: maximum progress value
1799 # @offset: current progress value. On success this is equal to len.
1800 # On failure this is less than len
1802 # @speed: rate limit, bytes per second
1804 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
1809 { 'event': 'BLOCK_JOB_READY',
1810 'data': { 'type' : 'BlockJobType',
1818 # Preallocation mode of QEMU image file
1820 # @off: no preallocation
1821 # @metadata: preallocate only for metadata
1822 # @falloc: like @full preallocation but allocate disk space by
1823 # posix_fallocate() rather than writing zeros.
1824 # @full: preallocate all data by writing zeros to device to ensure disk
1825 # space is really available. @full preallocation also sets up
1826 # metadata correctly.
1830 { 'enum': 'PreallocMode',
1831 'data': [ 'off', 'metadata', 'falloc', 'full' ] }