4 # == Block core (VM unrelated)
7 { 'include': 'common.json' }
8 { 'include': 'crypto.json' }
9 { 'include': 'sockets.json' }
14 # @id: unique snapshot id
16 # @name: user chosen name
18 # @vm-state-size: size of the VM state
20 # @date-sec: UTC date of the snapshot in seconds
22 # @date-nsec: fractional part in nano seconds to be used with date-sec
24 # @vm-clock-sec: VM clock relative to boot in seconds
26 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
31 { 'struct': 'SnapshotInfo',
32 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
33 'date-sec': 'int', 'date-nsec': 'int',
34 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
37 # @ImageInfoSpecificQCow2EncryptionBase:
39 # @format: The encryption format
43 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
44 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
47 # @ImageInfoSpecificQCow2Encryption:
51 { 'union': 'ImageInfoSpecificQCow2Encryption',
52 'base': 'ImageInfoSpecificQCow2EncryptionBase',
53 'discriminator': 'format',
54 'data': { 'aes': 'QCryptoBlockInfoQCow',
55 'luks': 'QCryptoBlockInfoLUKS' } }
58 # @ImageInfoSpecificQCow2:
60 # @compat: compatibility level
62 # @lazy-refcounts: on or off; only valid for compat >= 1.1
64 # @corrupt: true if the image has been marked corrupt; only valid for
65 # compat >= 1.1 (since 2.2)
67 # @refcount-bits: width of a refcount entry in bits (since 2.3)
69 # @encrypt: details about encryption parameters; only set if image
70 # is encrypted (since 2.10)
74 { 'struct': 'ImageInfoSpecificQCow2',
77 '*lazy-refcounts': 'bool',
79 'refcount-bits': 'int',
80 '*encrypt': 'ImageInfoSpecificQCow2Encryption'
84 # @ImageInfoSpecificVmdk:
86 # @create-type: The create type of VMDK image
88 # @cid: Content id of image
90 # @parent-cid: Parent VMDK image's cid
92 # @extents: List of extent files
96 { 'struct': 'ImageInfoSpecificVmdk',
101 'extents': ['ImageInfo']
105 # @ImageInfoSpecific:
107 # A discriminated record of image format specific information structures.
111 { 'union': 'ImageInfoSpecific',
113 'qcow2': 'ImageInfoSpecificQCow2',
114 'vmdk': 'ImageInfoSpecificVmdk',
115 # If we need to add block driver specific parameters for
116 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
117 # to define a ImageInfoSpecificLUKS
118 'luks': 'QCryptoBlockInfoLUKS'
124 # Information about a QEMU image file
126 # @filename: name of the image file
128 # @format: format of the image file
130 # @virtual-size: maximum capacity in bytes of the image
132 # @actual-size: actual size on disk in bytes of the image
134 # @dirty-flag: true if image is not cleanly closed
136 # @cluster-size: size of a cluster in bytes
138 # @encrypted: true if the image is encrypted
140 # @compressed: true if the image is compressed (Since 1.7)
142 # @backing-filename: name of the backing file
144 # @full-backing-filename: full path of the backing file
146 # @backing-filename-format: the format of the backing file
148 # @snapshots: list of VM snapshots
150 # @backing-image: info of the backing image (since 1.6)
152 # @format-specific: structure supplying additional format-specific
153 # information (since 1.7)
158 { 'struct': 'ImageInfo',
159 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
160 '*actual-size': 'int', 'virtual-size': 'int',
161 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
162 '*backing-filename': 'str', '*full-backing-filename': 'str',
163 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
164 '*backing-image': 'ImageInfo',
165 '*format-specific': 'ImageInfoSpecific' } }
170 # Information about a QEMU image file check
172 # @filename: name of the image file checked
174 # @format: format of the image file checked
176 # @check-errors: number of unexpected errors occurred during check
178 # @image-end-offset: offset (in bytes) where the image ends, this
179 # field is present if the driver for the image format
182 # @corruptions: number of corruptions found during the check if any
184 # @leaks: number of leaks found during the check if any
186 # @corruptions-fixed: number of corruptions fixed during the check
189 # @leaks-fixed: number of leaks fixed during the check if any
191 # @total-clusters: total number of clusters, this field is present
192 # if the driver for the image format supports it
194 # @allocated-clusters: total number of allocated clusters, this
195 # field is present if the driver for the image format
198 # @fragmented-clusters: total number of fragmented clusters, this
199 # field is present if the driver for the image format
202 # @compressed-clusters: total number of compressed clusters, this
203 # field is present if the driver for the image format
209 { 'struct': 'ImageCheck',
210 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
211 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
212 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
213 '*total-clusters': 'int', '*allocated-clusters': 'int',
214 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
219 # Mapping information from a virtual block range to a host file range
221 # @start: the start byte of the mapped virtual range
223 # @length: the number of bytes of the mapped virtual range
225 # @data: whether the mapped range has data
227 # @zero: whether the virtual blocks are zeroed
229 # @depth: the depth of the mapping
231 # @offset: the offset in file that the virtual sectors are mapped to
233 # @filename: filename that is referred to by @offset
238 { 'struct': 'MapEntry',
239 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
240 'zero': 'bool', 'depth': 'int', '*offset': 'int',
241 '*filename': 'str' } }
244 # @BlockdevCacheInfo:
246 # Cache mode information for a block device
248 # @writeback: true if writeback mode is enabled
249 # @direct: true if the host page cache is bypassed (O_DIRECT)
250 # @no-flush: true if flush requests are ignored for the device
254 { 'struct': 'BlockdevCacheInfo',
255 'data': { 'writeback': 'bool',
257 'no-flush': 'bool' } }
262 # Information about the backing device for a block device.
264 # @file: the filename of the backing device
266 # @node-name: the name of the block driver node (Since 2.0)
268 # @ro: true if the backing device was open read-only
270 # @drv: the name of the block format used to open the backing device. As of
271 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
272 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
273 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
274 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
275 # 2.2: 'archipelago' added, 'cow' dropped
276 # 2.3: 'host_floppy' deprecated
277 # 2.5: 'host_floppy' dropped
279 # 2.8: 'replication' added, 'tftp' dropped
280 # 2.9: 'archipelago' dropped
282 # @backing_file: the name of the backing file (for copy-on-write)
284 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
286 # @encrypted: true if the backing device is encrypted
288 # @encryption_key_missing: Deprecated; always false
290 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
292 # @bps: total throughput limit in bytes per second is specified
294 # @bps_rd: read throughput limit in bytes per second is specified
296 # @bps_wr: write throughput limit in bytes per second is specified
298 # @iops: total I/O operations per second is specified
300 # @iops_rd: read I/O operations per second is specified
302 # @iops_wr: write I/O operations per second is specified
304 # @image: the info of image used (since: 1.6)
306 # @bps_max: total throughput limit during bursts,
307 # in bytes (Since 1.7)
309 # @bps_rd_max: read throughput limit during bursts,
310 # in bytes (Since 1.7)
312 # @bps_wr_max: write throughput limit during bursts,
313 # in bytes (Since 1.7)
315 # @iops_max: total I/O operations per second during bursts,
316 # in bytes (Since 1.7)
318 # @iops_rd_max: read I/O operations per second during bursts,
319 # in bytes (Since 1.7)
321 # @iops_wr_max: write I/O operations per second during bursts,
322 # in bytes (Since 1.7)
324 # @bps_max_length: maximum length of the @bps_max burst
325 # period, in seconds. (Since 2.6)
327 # @bps_rd_max_length: maximum length of the @bps_rd_max
328 # burst period, in seconds. (Since 2.6)
330 # @bps_wr_max_length: maximum length of the @bps_wr_max
331 # burst period, in seconds. (Since 2.6)
333 # @iops_max_length: maximum length of the @iops burst
334 # period, in seconds. (Since 2.6)
336 # @iops_rd_max_length: maximum length of the @iops_rd_max
337 # burst period, in seconds. (Since 2.6)
339 # @iops_wr_max_length: maximum length of the @iops_wr_max
340 # burst period, in seconds. (Since 2.6)
342 # @iops_size: an I/O size in bytes (Since 1.7)
344 # @group: throttle group name (Since 2.4)
346 # @cache: the cache mode used for the block device (since: 2.3)
348 # @write_threshold: configured write threshold for the device.
349 # 0 if disabled. (Since 2.3)
354 { 'struct': 'BlockDeviceInfo',
355 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
356 '*backing_file': 'str', 'backing_file_depth': 'int',
357 'encrypted': 'bool', 'encryption_key_missing': 'bool',
358 'detect_zeroes': 'BlockdevDetectZeroesOptions',
359 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
360 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
361 'image': 'ImageInfo',
362 '*bps_max': 'int', '*bps_rd_max': 'int',
363 '*bps_wr_max': 'int', '*iops_max': 'int',
364 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
365 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
366 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
367 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
368 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
369 'write_threshold': 'int' } }
372 # @BlockDeviceIoStatus:
374 # An enumeration of block device I/O status.
376 # @ok: The last I/O operation has succeeded
378 # @failed: The last I/O operation has failed
380 # @nospace: The last I/O operation has failed due to a no-space condition
384 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
387 # @BlockDeviceMapEntry:
389 # Entry in the metadata map of the device (returned by "qemu-img map")
391 # @start: Offset in the image of the first byte described by this entry
394 # @length: Length of the range described by this entry (in bytes)
396 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
397 # before reaching one for which the range is allocated. The value is
398 # in the range 0 to the depth of the image chain - 1.
400 # @zero: the sectors in this range read as zeros
402 # @data: reading the image will actually read data from a file (in particular,
403 # if @offset is present this means that the sectors are not simply
404 # preallocated, but contain actual data in raw format)
406 # @offset: if present, the image file stores the data for this range in
407 # raw format at the given offset.
411 { 'struct': 'BlockDeviceMapEntry',
412 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
413 'data': 'bool', '*offset': 'int' } }
416 # @DirtyBitmapStatus:
418 # An enumeration of possible states that a dirty bitmap can report to the user.
420 # @frozen: The bitmap is currently in-use by a backup operation or block job,
423 # @disabled: The bitmap is currently in-use by an internal operation and is
424 # read-only. It can still be deleted.
426 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
427 # deleted, or used for backup operations.
429 # @locked: The bitmap is currently in-use by some operation and can not be
430 # cleared, deleted, or used for backup operations. (Since 2.12)
434 { 'enum': 'DirtyBitmapStatus',
435 'data': ['active', 'disabled', 'frozen', 'locked'] }
440 # Block dirty bitmap information.
442 # @name: the name of the dirty bitmap (Since 2.4)
444 # @count: number of dirty bytes according to the dirty bitmap
446 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
448 # @status: current status of the dirty bitmap (since 2.4)
452 { 'struct': 'BlockDirtyInfo',
453 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
454 'status': 'DirtyBitmapStatus'} }
459 # Block device information. This structure describes a virtual device and
460 # the backing device associated with it.
462 # @device: The device name associated with the virtual device.
464 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
465 # device. (since 2.10)
467 # @type: This field is returned only for compatibility reasons, it should
468 # not be used (always returns 'unknown')
470 # @removable: True if the device supports removable media.
472 # @locked: True if the guest has locked this device from having its media
475 # @tray_open: True if the device's tray is open
476 # (only present if it has a tray)
478 # @dirty-bitmaps: dirty bitmaps information (only present if the
479 # driver has one or more dirty bitmaps) (Since 2.0)
481 # @io-status: @BlockDeviceIoStatus. Only present if the device
482 # supports it and the VM is configured to stop on errors
483 # (supported device models: virtio-blk, IDE, SCSI except
486 # @inserted: @BlockDeviceInfo describing the device if media is
491 { 'struct': 'BlockInfo',
492 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
493 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
494 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
495 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
500 # Image file size calculation information. This structure describes the size
501 # requirements for creating a new image file.
503 # The size requirements depend on the new image file format. File size always
504 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
505 # Compact formats such as 'qcow2' represent unallocated and zero regions
506 # efficiently so file size may be smaller than virtual disk size.
508 # The values are upper bounds that are guaranteed to fit the new image file.
509 # Subsequent modification, such as internal snapshot or bitmap creation, may
510 # require additional space and is not covered here.
512 # @required: Size required for a new image file, in bytes.
514 # @fully-allocated: Image file size, in bytes, once data has been written
519 { 'struct': 'BlockMeasureInfo',
520 'data': {'required': 'int', 'fully-allocated': 'int'} }
525 # Get a list of BlockInfo for all virtual block devices.
527 # Returns: a list of @BlockInfo describing each virtual block device. Filter
528 # nodes that were created implicitly are skipped over.
534 # -> { "execute": "query-block" }
539 # "device":"ide0-hd0",
546 # "file":"disks/test.qcow2",
547 # "backing_file_depth":1,
554 # "bps_max": 8000000,
561 # "detect_zeroes": "on",
562 # "write_threshold": 0,
564 # "filename":"disks/test.qcow2",
566 # "virtual-size":2048000,
567 # "backing_file":"base.qcow2",
568 # "full-backing-filename":"disks/base.qcow2",
569 # "backing-filename-format":"qcow2",
573 # "name": "snapshot1",
574 # "vm-state-size": 0,
575 # "date-sec": 10000200,
577 # "vm-clock-sec": 206,
578 # "vm-clock-nsec": 30
582 # "filename":"disks/base.qcow2",
584 # "virtual-size":2048000
588 # "qdev": "ide_disk",
593 # "device":"ide1-cd0",
596 # "qdev": "/machine/unattached/device[23]",
597 # "tray_open": false,
601 # "device":"floppy0",
604 # "qdev": "/machine/unattached/device[20]",
617 { 'command': 'query-block', 'returns': ['BlockInfo'] }
621 # @BlockDeviceTimedStats:
623 # Statistics of a block device during a given interval of time.
625 # @interval_length: Interval used for calculating the statistics,
628 # @min_rd_latency_ns: Minimum latency of read operations in the
629 # defined interval, in nanoseconds.
631 # @min_wr_latency_ns: Minimum latency of write operations in the
632 # defined interval, in nanoseconds.
634 # @min_flush_latency_ns: Minimum latency of flush operations in the
635 # defined interval, in nanoseconds.
637 # @max_rd_latency_ns: Maximum latency of read operations in the
638 # defined interval, in nanoseconds.
640 # @max_wr_latency_ns: Maximum latency of write operations in the
641 # defined interval, in nanoseconds.
643 # @max_flush_latency_ns: Maximum latency of flush operations in the
644 # defined interval, in nanoseconds.
646 # @avg_rd_latency_ns: Average latency of read operations in the
647 # defined interval, in nanoseconds.
649 # @avg_wr_latency_ns: Average latency of write operations in the
650 # defined interval, in nanoseconds.
652 # @avg_flush_latency_ns: Average latency of flush operations in the
653 # defined interval, in nanoseconds.
655 # @avg_rd_queue_depth: Average number of pending read operations
656 # in the defined interval.
658 # @avg_wr_queue_depth: Average number of pending write operations
659 # in the defined interval.
663 { 'struct': 'BlockDeviceTimedStats',
664 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
665 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
666 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
667 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
668 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
669 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
674 # Statistics of a virtual block device or a block backing device.
676 # @rd_bytes: The number of bytes read by the device.
678 # @wr_bytes: The number of bytes written by the device.
680 # @rd_operations: The number of read operations performed by the device.
682 # @wr_operations: The number of write operations performed by the device.
684 # @flush_operations: The number of cache flush operations performed by the
685 # device (since 0.15.0)
687 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
690 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
692 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
694 # @wr_highest_offset: The offset after the greatest byte written to the
695 # device. The intended use of this information is for
696 # growable sparse files (like qcow2) that are used on top
697 # of a physical device.
699 # @rd_merged: Number of read requests that have been merged into another
700 # request (Since 2.3).
702 # @wr_merged: Number of write requests that have been merged into another
703 # request (Since 2.3).
705 # @idle_time_ns: Time since the last I/O operation, in
706 # nanoseconds. If the field is absent it means that
707 # there haven't been any operations yet (Since 2.5).
709 # @failed_rd_operations: The number of failed read operations
710 # performed by the device (Since 2.5)
712 # @failed_wr_operations: The number of failed write operations
713 # performed by the device (Since 2.5)
715 # @failed_flush_operations: The number of failed flush operations
716 # performed by the device (Since 2.5)
718 # @invalid_rd_operations: The number of invalid read operations
719 # performed by the device (Since 2.5)
721 # @invalid_wr_operations: The number of invalid write operations
722 # performed by the device (Since 2.5)
724 # @invalid_flush_operations: The number of invalid flush operations
725 # performed by the device (Since 2.5)
727 # @account_invalid: Whether invalid operations are included in the
728 # last access statistics (Since 2.5)
730 # @account_failed: Whether failed operations are included in the
731 # latency and last access statistics (Since 2.5)
733 # @timed_stats: Statistics specific to the set of previously defined
734 # intervals of time (Since 2.5)
738 { 'struct': 'BlockDeviceStats',
739 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
740 'wr_operations': 'int', 'flush_operations': 'int',
741 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
742 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
743 'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
744 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
745 'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
746 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
747 'account_invalid': 'bool', 'account_failed': 'bool',
748 'timed_stats': ['BlockDeviceTimedStats'] } }
753 # Statistics of a virtual block device or a block backing device.
755 # @device: If the stats are for a virtual block device, the name
756 # corresponding to the virtual block device.
758 # @node-name: The node name of the device. (Since 2.3)
760 # @stats: A @BlockDeviceStats for the device.
762 # @parent: This describes the file block device if it has one.
763 # Contains recursively the statistics of the underlying
764 # protocol (e.g. the host file for a qcow2 image). If there is
765 # no underlying protocol, this field is omitted
767 # @backing: This describes the backing block device if it has one.
772 { 'struct': 'BlockStats',
773 'data': {'*device': 'str', '*node-name': 'str',
774 'stats': 'BlockDeviceStats',
775 '*parent': 'BlockStats',
776 '*backing': 'BlockStats'} }
781 # Query the @BlockStats for all virtual block devices.
783 # @query-nodes: If true, the command will query all the block nodes
784 # that have a node name, in a list which will include "parent"
785 # information, but not "backing".
786 # If false or omitted, the behavior is as before - query all the
787 # device backends, recursively including their "parent" and
788 # "backing". Filter nodes that were created implicitly are
789 # skipped over in this mode. (Since 2.3)
791 # Returns: A list of @BlockStats for each virtual block devices.
797 # -> { "execute": "query-blockstats" }
801 # "device":"ide0-hd0",
804 # "wr_highest_offset":3686448128,
805 # "wr_bytes":9786368,
806 # "wr_operations":751,
807 # "rd_bytes":122567168,
808 # "rd_operations":36772
809 # "wr_total_times_ns":313253456
810 # "rd_total_times_ns":3465673657
811 # "flush_total_times_ns":49653
812 # "flush_operations":61,
815 # "idle_time_ns":2953431879,
816 # "account_invalid":true,
817 # "account_failed":false
821 # "wr_highest_offset":2821110784,
822 # "wr_bytes":9786368,
823 # "wr_operations":692,
824 # "rd_bytes":122739200,
825 # "rd_operations":36604
826 # "flush_operations":51,
827 # "wr_total_times_ns":313253456
828 # "rd_total_times_ns":3465673657
829 # "flush_total_times_ns":49653,
832 # "idle_time_ns":2953431879,
833 # "account_invalid":true,
834 # "account_failed":false
838 # "device":"ide1-cd0",
840 # "wr_highest_offset":0,
845 # "flush_operations":0,
846 # "wr_total_times_ns":0
847 # "rd_total_times_ns":0
848 # "flush_total_times_ns":0,
851 # "account_invalid":false,
852 # "account_failed":false
856 # "device":"floppy0",
858 # "wr_highest_offset":0,
863 # "flush_operations":0,
864 # "wr_total_times_ns":0
865 # "rd_total_times_ns":0
866 # "flush_total_times_ns":0,
869 # "account_invalid":false,
870 # "account_failed":false
876 # "wr_highest_offset":0,
881 # "flush_operations":0,
882 # "wr_total_times_ns":0
883 # "rd_total_times_ns":0
884 # "flush_total_times_ns":0,
887 # "account_invalid":false,
888 # "account_failed":false
895 { 'command': 'query-blockstats',
896 'data': { '*query-nodes': 'bool' },
897 'returns': ['BlockStats'] }
902 # An enumeration of possible behaviors for errors on I/O operations.
903 # The exact meaning depends on whether the I/O was initiated by a guest
906 # @report: for guest operations, report the error to the guest;
907 # for jobs, cancel the job
909 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
910 # or BLOCK_JOB_ERROR)
912 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
914 # @stop: for guest operations, stop the virtual machine;
915 # for jobs, pause the job
917 # @auto: inherit the error handling policy of the backend (since: 2.7)
921 { 'enum': 'BlockdevOnError',
922 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
927 # An enumeration of possible behaviors for the initial synchronization
928 # phase of storage mirroring.
930 # @top: copies data in the topmost image to the destination
932 # @full: copies data from all images to the destination
934 # @none: only copy data written from now on
936 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
940 { 'enum': 'MirrorSyncMode',
941 'data': ['top', 'full', 'none', 'incremental'] }
946 # Type of a block job.
948 # @commit: block commit job type, see "block-commit"
950 # @stream: block stream job type, see "block-stream"
952 # @mirror: drive mirror job type, see "drive-mirror"
954 # @backup: drive backup job type, see "drive-backup"
958 { 'enum': 'BlockJobType',
959 'data': ['commit', 'stream', 'mirror', 'backup'] }
964 # Represents command verbs that can be applied to a blockjob.
966 # @cancel: see @block-job-cancel
968 # @pause: see @block-job-pause
970 # @resume: see @block-job-resume
972 # @set-speed: see @block-job-set-speed
974 # @complete: see @block-job-complete
976 # @dismiss: see @block-job-dismiss
978 # @finalize: see @block-job-finalize
982 { 'enum': 'BlockJobVerb',
983 'data': ['cancel', 'pause', 'resume', 'set-speed', 'complete', 'dismiss',
989 # Indicates the present state of a given blockjob in its lifetime.
991 # @undefined: Erroneous, default state. Should not ever be visible.
993 # @created: The job has been created, but not yet started.
995 # @running: The job is currently running.
997 # @paused: The job is running, but paused. The pause may be requested by
998 # either the QMP user or by internal processes.
1000 # @ready: The job is running, but is ready for the user to signal completion.
1001 # This is used for long-running jobs like mirror that are designed to
1004 # @standby: The job is ready, but paused. This is nearly identical to @paused.
1005 # The job may return to @ready or otherwise be canceled.
1007 # @waiting: The job is waiting for other jobs in the transaction to converge
1008 # to the waiting state. This status will likely not be visible for
1009 # the last job in a transaction.
1011 # @pending: The job has finished its work, but has finalization steps that it
1012 # needs to make prior to completing. These changes may require
1013 # manual intervention by the management process if manual was set
1014 # to true. These changes may still fail.
1016 # @aborting: The job is in the process of being aborted, and will finish with
1017 # an error. The job will afterwards report that it is @concluded.
1018 # This status may not be visible to the management process.
1020 # @concluded: The job has finished all work. If manual was set to true, the job
1021 # will remain in the query list until it is dismissed.
1023 # @null: The job is in the process of being dismantled. This state should not
1024 # ever be visible externally.
1028 { 'enum': 'BlockJobStatus',
1029 'data': ['undefined', 'created', 'running', 'paused', 'ready', 'standby',
1030 'waiting', 'pending', 'aborting', 'concluded', 'null' ] }
1035 # Information about a long-running block device operation.
1037 # @type: the job type ('stream' for image streaming)
1039 # @device: The job identifier. Originally the device name but other
1040 # values are allowed since QEMU 2.7
1042 # @len: the maximum progress value
1044 # @busy: false if the job is known to be in a quiescent state, with
1045 # no pending I/O. Since 1.3.
1047 # @paused: whether the job is paused or, if @busy is true, will
1048 # pause itself as soon as possible. Since 1.3.
1050 # @offset: the current progress value
1052 # @speed: the rate limit, bytes per second
1054 # @io-status: the status of the job (since 1.3)
1056 # @ready: true if the job may be completed (since 2.2)
1058 # @status: Current job state/status (since 2.12)
1060 # @auto-finalize: Job will finalize itself when PENDING, moving to
1061 # the CONCLUDED state. (since 2.12)
1063 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1064 # state and disappearing from the query list. (since 2.12)
1068 { 'struct': 'BlockJobInfo',
1069 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1070 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1071 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1072 'status': 'BlockJobStatus',
1073 'auto-finalize': 'bool', 'auto-dismiss': 'bool' } }
1076 # @query-block-jobs:
1078 # Return information about long-running block device operations.
1080 # Returns: a list of @BlockJobInfo for each active block job
1084 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1089 # This command sets the password of a block device that has not been open
1090 # with a password and requires one.
1092 # This command is now obsolete and will always return an error since 2.10
1095 { 'command': 'block_passwd', 'data': {'*device': 'str',
1096 '*node-name': 'str', 'password': 'str'} }
1101 # Resize a block image while a guest is running.
1103 # Either @device or @node-name must be set but not both.
1105 # @device: the name of the device to get the image resized
1107 # @node-name: graph node name to get the image resized (Since 2.0)
1109 # @size: new image size in bytes
1111 # Returns: nothing on success
1112 # If @device is not a valid block device, DeviceNotFound
1118 # -> { "execute": "block_resize",
1119 # "arguments": { "device": "scratch", "size": 1073741824 } }
1120 # <- { "return": {} }
1123 { 'command': 'block_resize', 'data': { '*device': 'str',
1124 '*node-name': 'str',
1130 # An enumeration that tells QEMU how to set the backing file path in
1133 # @existing: QEMU should look for an existing image file.
1135 # @absolute-paths: QEMU should create a new image with absolute paths
1136 # for the backing file. If there is no backing file available, the new
1137 # image will not be backed either.
1141 { 'enum': 'NewImageMode',
1142 'data': [ 'existing', 'absolute-paths' ] }
1145 # @BlockdevSnapshotSync:
1147 # Either @device or @node-name must be set but not both.
1149 # @device: the name of the device to generate the snapshot from.
1151 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1153 # @snapshot-file: the target of the new image. If the file exists, or
1154 # if it is a device, the snapshot will be created in the existing
1155 # file/device. Otherwise, a new file will be created.
1157 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1159 # @format: the format of the snapshot image, default is 'qcow2'.
1161 # @mode: whether and how QEMU should create a new image, default is
1164 { 'struct': 'BlockdevSnapshotSync',
1165 'data': { '*device': 'str', '*node-name': 'str',
1166 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1167 '*format': 'str', '*mode': 'NewImageMode' } }
1170 # @BlockdevSnapshot:
1172 # @node: device or node name that will have a snapshot created.
1174 # @overlay: reference to the existing block device that will become
1175 # the overlay of @node, as part of creating the snapshot.
1176 # It must not have a current backing file (this can be
1177 # achieved by passing "backing": "" to blockdev-add).
1181 { 'struct': 'BlockdevSnapshot',
1182 'data': { 'node': 'str', 'overlay': 'str' } }
1187 # @job-id: identifier for the newly-created block job. If
1188 # omitted, the device name will be used. (Since 2.7)
1190 # @device: the device name or node-name of a root node which should be copied.
1192 # @target: the target of the new image. If the file exists, or if it
1193 # is a device, the existing file/device will be used as the new
1194 # destination. If it does not exist, a new file will be created.
1196 # @format: the format of the new destination, default is to
1197 # probe if @mode is 'existing', else the format of the source
1199 # @sync: what parts of the disk image should be copied to the destination
1200 # (all the disk, only the sectors allocated in the topmost image, from a
1201 # dirty bitmap, or only new I/O).
1203 # @mode: whether and how QEMU should create a new image, default is
1206 # @speed: the maximum speed, in bytes per second
1208 # @bitmap: the name of dirty bitmap if sync is "incremental".
1209 # Must be present if sync is "incremental", must NOT be present
1210 # otherwise. (Since 2.4)
1212 # @compress: true to compress data, if the target format supports it.
1213 # (default: false) (since 2.8)
1215 # @on-source-error: the action to take on an error on the source,
1216 # default 'report'. 'stop' and 'enospc' can only be used
1217 # if the block device supports io-status (see BlockInfo).
1219 # @on-target-error: the action to take on an error on the target,
1220 # default 'report' (no limitations, since this applies to
1221 # a different block device than @device).
1223 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1224 # finished its work, waiting for @block-job-finalize.
1225 # When true, this job will automatically perform its abort or
1227 # Defaults to true. (Since 2.12)
1229 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1230 # has completed ceased all work, and wait for @block-job-dismiss.
1231 # When true, this job will automatically disappear from the query
1232 # list without user intervention.
1233 # Defaults to true. (Since 2.12)
1235 # Note: @on-source-error and @on-target-error only affect background
1236 # I/O. If an error occurs during a guest write request, the device's
1237 # rerror/werror actions will be used.
1241 { 'struct': 'DriveBackup',
1242 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1243 '*format': 'str', 'sync': 'MirrorSyncMode',
1244 '*mode': 'NewImageMode', '*speed': 'int',
1245 '*bitmap': 'str', '*compress': 'bool',
1246 '*on-source-error': 'BlockdevOnError',
1247 '*on-target-error': 'BlockdevOnError',
1248 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1253 # @job-id: identifier for the newly-created block job. If
1254 # omitted, the device name will be used. (Since 2.7)
1256 # @device: the device name or node-name of a root node which should be copied.
1258 # @target: the device name or node-name of the backup target node.
1260 # @sync: what parts of the disk image should be copied to the destination
1261 # (all the disk, only the sectors allocated in the topmost image, or
1264 # @speed: the maximum speed, in bytes per second. The default is 0,
1267 # @compress: true to compress data, if the target format supports it.
1268 # (default: false) (since 2.8)
1270 # @on-source-error: the action to take on an error on the source,
1271 # default 'report'. 'stop' and 'enospc' can only be used
1272 # if the block device supports io-status (see BlockInfo).
1274 # @on-target-error: the action to take on an error on the target,
1275 # default 'report' (no limitations, since this applies to
1276 # a different block device than @device).
1278 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1279 # finished its work, waiting for @block-job-finalize.
1280 # When true, this job will automatically perform its abort or
1282 # Defaults to true. (Since 2.12)
1284 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1285 # has completed ceased all work, and wait for @block-job-dismiss.
1286 # When true, this job will automatically disappear from the query
1287 # list without user intervention.
1288 # Defaults to true. (Since 2.12)
1290 # Note: @on-source-error and @on-target-error only affect background
1291 # I/O. If an error occurs during a guest write request, the device's
1292 # rerror/werror actions will be used.
1296 { 'struct': 'BlockdevBackup',
1297 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1298 'sync': 'MirrorSyncMode', '*speed': 'int', '*compress': 'bool',
1299 '*on-source-error': 'BlockdevOnError',
1300 '*on-target-error': 'BlockdevOnError',
1301 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1304 # @blockdev-snapshot-sync:
1306 # Generates a synchronous snapshot of a block device.
1308 # For the arguments, see the documentation of BlockdevSnapshotSync.
1310 # Returns: nothing on success
1311 # If @device is not a valid block device, DeviceNotFound
1317 # -> { "execute": "blockdev-snapshot-sync",
1318 # "arguments": { "device": "ide-hd0",
1320 # "/some/place/my-image",
1321 # "format": "qcow2" } }
1322 # <- { "return": {} }
1325 { 'command': 'blockdev-snapshot-sync',
1326 'data': 'BlockdevSnapshotSync' }
1330 # @blockdev-snapshot:
1332 # Generates a snapshot of a block device.
1334 # Create a snapshot, by installing 'node' as the backing image of
1335 # 'overlay'. Additionally, if 'node' is associated with a block
1336 # device, the block device changes to using 'overlay' as its new active
1339 # For the arguments, see the documentation of BlockdevSnapshot.
1345 # -> { "execute": "blockdev-add",
1346 # "arguments": { "driver": "qcow2",
1347 # "node-name": "node1534",
1348 # "file": { "driver": "file",
1349 # "filename": "hd1.qcow2" },
1352 # <- { "return": {} }
1354 # -> { "execute": "blockdev-snapshot",
1355 # "arguments": { "node": "ide-hd0",
1356 # "overlay": "node1534" } }
1357 # <- { "return": {} }
1360 { 'command': 'blockdev-snapshot',
1361 'data': 'BlockdevSnapshot' }
1364 # @change-backing-file:
1366 # Change the backing file in the image file metadata. This does not
1367 # cause QEMU to reopen the image file to reparse the backing filename
1368 # (it may, however, perform a reopen to change permissions from
1369 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1370 # into the image file metadata, and the QEMU internal strings are
1373 # @image-node-name: The name of the block driver state node of the
1374 # image to modify. The "device" argument is used
1375 # to verify "image-node-name" is in the chain
1376 # described by "device".
1378 # @device: The device name or node-name of the root node that owns
1381 # @backing-file: The string to write as the backing file. This
1382 # string is not validated, so care should be taken
1383 # when specifying the string or the image chain may
1384 # not be able to be reopened again.
1386 # Returns: Nothing on success
1388 # If "device" does not exist or cannot be determined, DeviceNotFound
1392 { 'command': 'change-backing-file',
1393 'data': { 'device': 'str', 'image-node-name': 'str',
1394 'backing-file': 'str' } }
1399 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1400 # writes data between 'top' and 'base' into 'base'.
1402 # @job-id: identifier for the newly-created block job. If
1403 # omitted, the device name will be used. (Since 2.7)
1405 # @device: the device name or node-name of a root node
1407 # @base: The file name of the backing image to write data into.
1408 # If not specified, this is the deepest backing image.
1410 # @top: The file name of the backing image within the image chain,
1411 # which contains the topmost data to be committed down. If
1412 # not specified, this is the active layer.
1414 # @backing-file: The backing file string to write into the overlay
1415 # image of 'top'. If 'top' is the active layer,
1416 # specifying a backing file string is an error. This
1417 # filename is not validated.
1419 # If a pathname string is such that it cannot be
1420 # resolved by QEMU, that means that subsequent QMP or
1421 # HMP commands must use node-names for the image in
1422 # question, as filename lookup methods will fail.
1424 # If not specified, QEMU will automatically determine
1425 # the backing file string to use, or error out if
1426 # there is no obvious choice. Care should be taken
1427 # when specifying the string, to specify a valid
1428 # filename or protocol.
1431 # If top == base, that is an error.
1432 # If top == active, the job will not be completed by itself,
1433 # user needs to complete the job with the block-job-complete
1434 # command after getting the ready event. (Since 2.0)
1436 # If the base image is smaller than top, then the base image
1437 # will be resized to be the same size as top. If top is
1438 # smaller than the base image, the base will not be
1439 # truncated. If you want the base image size to match the
1440 # size of the smaller top, you can safely truncate it
1441 # yourself once the commit operation successfully completes.
1443 # @speed: the maximum speed, in bytes per second
1445 # @filter-node-name: the node name that should be assigned to the
1446 # filter driver that the commit job inserts into the graph
1447 # above @top. If this option is not given, a node name is
1448 # autogenerated. (Since: 2.9)
1450 # Returns: Nothing on success
1451 # If commit or stream is already active on this device, DeviceInUse
1452 # If @device does not exist, DeviceNotFound
1453 # If image commit is not supported by this device, NotSupported
1454 # If @base or @top is invalid, a generic error is returned
1455 # If @speed is invalid, InvalidParameter
1461 # -> { "execute": "block-commit",
1462 # "arguments": { "device": "virtio0",
1463 # "top": "/tmp/snap1.qcow2" } }
1464 # <- { "return": {} }
1467 { 'command': 'block-commit',
1468 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
1469 '*backing-file': 'str', '*speed': 'int',
1470 '*filter-node-name': 'str' } }
1475 # Start a point-in-time copy of a block device to a new destination. The
1476 # status of ongoing drive-backup operations can be checked with
1477 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1478 # The operation can be stopped before it has completed using the
1479 # block-job-cancel command.
1481 # Returns: nothing on success
1482 # If @device is not a valid block device, GenericError
1488 # -> { "execute": "drive-backup",
1489 # "arguments": { "device": "drive0",
1491 # "target": "backup.img" } }
1492 # <- { "return": {} }
1495 { 'command': 'drive-backup', 'boxed': true,
1496 'data': 'DriveBackup' }
1501 # Start a point-in-time copy of a block device to a new destination. The
1502 # status of ongoing blockdev-backup operations can be checked with
1503 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1504 # The operation can be stopped before it has completed using the
1505 # block-job-cancel command.
1507 # Returns: nothing on success
1508 # If @device is not a valid block device, DeviceNotFound
1513 # -> { "execute": "blockdev-backup",
1514 # "arguments": { "device": "src-id",
1516 # "target": "tgt-id" } }
1517 # <- { "return": {} }
1520 { 'command': 'blockdev-backup', 'boxed': true,
1521 'data': 'BlockdevBackup' }
1525 # @query-named-block-nodes:
1527 # Get the named block driver list
1529 # Returns: the list of BlockDeviceInfo
1535 # -> { "execute": "query-named-block-nodes" }
1536 # <- { "return": [ { "ro":false,
1538 # "encrypted":false,
1539 # "file":"disks/test.qcow2",
1540 # "node-name": "my-node",
1541 # "backing_file_depth":1,
1548 # "bps_max": 8000000,
1555 # "write_threshold": 0,
1557 # "filename":"disks/test.qcow2",
1559 # "virtual-size":2048000,
1560 # "backing_file":"base.qcow2",
1561 # "full-backing-filename":"disks/base.qcow2",
1562 # "backing-filename-format":"qcow2",
1566 # "name": "snapshot1",
1567 # "vm-state-size": 0,
1568 # "date-sec": 10000200,
1570 # "vm-clock-sec": 206,
1571 # "vm-clock-nsec": 30
1575 # "filename":"disks/base.qcow2",
1577 # "virtual-size":2048000
1582 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1587 # Start mirroring a block device's writes to a new destination. target
1588 # specifies the target of the new image. If the file exists, or if it
1589 # is a device, it will be used as the new destination for writes. If
1590 # it does not exist, a new file will be created. format specifies the
1591 # format of the mirror image, default is to probe if mode='existing',
1592 # else the format of the source.
1594 # Returns: nothing on success
1595 # If @device is not a valid block device, GenericError
1601 # -> { "execute": "drive-mirror",
1602 # "arguments": { "device": "ide-hd0",
1603 # "target": "/some/place/my-image",
1605 # "format": "qcow2" } }
1606 # <- { "return": {} }
1609 { 'command': 'drive-mirror', 'boxed': true,
1610 'data': 'DriveMirror' }
1615 # A set of parameters describing drive mirror setup.
1617 # @job-id: identifier for the newly-created block job. If
1618 # omitted, the device name will be used. (Since 2.7)
1620 # @device: the device name or node-name of a root node whose writes should be
1623 # @target: the target of the new image. If the file exists, or if it
1624 # is a device, the existing file/device will be used as the new
1625 # destination. If it does not exist, a new file will be created.
1627 # @format: the format of the new destination, default is to
1628 # probe if @mode is 'existing', else the format of the source
1630 # @node-name: the new block driver state node name in the graph
1633 # @replaces: with sync=full graph node name to be replaced by the new
1634 # image when a whole image copy is done. This can be used to repair
1635 # broken Quorum files. (Since 2.1)
1637 # @mode: whether and how QEMU should create a new image, default is
1640 # @speed: the maximum speed, in bytes per second
1642 # @sync: what parts of the disk image should be copied to the destination
1643 # (all the disk, only the sectors allocated in the topmost image, or
1646 # @granularity: granularity of the dirty bitmap, default is 64K
1647 # if the image format doesn't have clusters, 4K if the clusters
1648 # are smaller than that, else the cluster size. Must be a
1649 # power of 2 between 512 and 64M (since 1.4).
1651 # @buf-size: maximum amount of data in flight from source to
1652 # target (since 1.4).
1654 # @on-source-error: the action to take on an error on the source,
1655 # default 'report'. 'stop' and 'enospc' can only be used
1656 # if the block device supports io-status (see BlockInfo).
1658 # @on-target-error: the action to take on an error on the target,
1659 # default 'report' (no limitations, since this applies to
1660 # a different block device than @device).
1661 # @unmap: Whether to try to unmap target sectors where source has
1662 # only zero. If true, and target unallocated sectors will read as zero,
1663 # target image sectors will be unmapped; otherwise, zeroes will be
1664 # written. Both will result in identical contents.
1665 # Default is true. (Since 2.4)
1669 { 'struct': 'DriveMirror',
1670 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1671 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1672 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1673 '*speed': 'int', '*granularity': 'uint32',
1674 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1675 '*on-target-error': 'BlockdevOnError',
1676 '*unmap': 'bool' } }
1679 # @BlockDirtyBitmap:
1681 # @node: name of device/node which the bitmap is tracking
1683 # @name: name of the dirty bitmap
1687 { 'struct': 'BlockDirtyBitmap',
1688 'data': { 'node': 'str', 'name': 'str' } }
1691 # @BlockDirtyBitmapAdd:
1693 # @node: name of device/node which the bitmap is tracking
1695 # @name: name of the dirty bitmap
1697 # @granularity: the bitmap granularity, default is 64k for
1698 # block-dirty-bitmap-add
1700 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1701 # corresponding block device image file on its close. For now only
1702 # Qcow2 disks support persistent bitmaps. Default is false for
1703 # block-dirty-bitmap-add. (Since: 2.10)
1705 # @autoload: ignored and deprecated since 2.12.
1706 # Currently, all dirty tracking bitmaps are loaded from Qcow2 on
1711 { 'struct': 'BlockDirtyBitmapAdd',
1712 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1713 '*persistent': 'bool', '*autoload': 'bool' } }
1716 # @block-dirty-bitmap-add:
1718 # Create a dirty bitmap with a name on the node, and start tracking the writes.
1720 # Returns: nothing on success
1721 # If @node is not a valid block device or node, DeviceNotFound
1722 # If @name is already taken, GenericError with an explanation
1728 # -> { "execute": "block-dirty-bitmap-add",
1729 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1730 # <- { "return": {} }
1733 { 'command': 'block-dirty-bitmap-add',
1734 'data': 'BlockDirtyBitmapAdd' }
1737 # @block-dirty-bitmap-remove:
1739 # Stop write tracking and remove the dirty bitmap that was created
1740 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
1743 # Returns: nothing on success
1744 # If @node is not a valid block device or node, DeviceNotFound
1745 # If @name is not found, GenericError with an explanation
1746 # if @name is frozen by an operation, GenericError
1752 # -> { "execute": "block-dirty-bitmap-remove",
1753 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1754 # <- { "return": {} }
1757 { 'command': 'block-dirty-bitmap-remove',
1758 'data': 'BlockDirtyBitmap' }
1761 # @block-dirty-bitmap-clear:
1763 # Clear (reset) a dirty bitmap on the device, so that an incremental
1764 # backup from this point in time forward will only backup clusters
1765 # modified after this clear operation.
1767 # Returns: nothing on success
1768 # If @node is not a valid block device, DeviceNotFound
1769 # If @name is not found, GenericError with an explanation
1775 # -> { "execute": "block-dirty-bitmap-clear",
1776 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1777 # <- { "return": {} }
1780 { 'command': 'block-dirty-bitmap-clear',
1781 'data': 'BlockDirtyBitmap' }
1784 # @BlockDirtyBitmapSha256:
1786 # SHA256 hash of dirty bitmap data
1788 # @sha256: ASCII representation of SHA256 bitmap hash
1792 { 'struct': 'BlockDirtyBitmapSha256',
1793 'data': {'sha256': 'str'} }
1796 # @x-debug-block-dirty-bitmap-sha256:
1800 # Returns: BlockDirtyBitmapSha256 on success
1801 # If @node is not a valid block device, DeviceNotFound
1802 # If @name is not found or if hashing has failed, GenericError with an
1807 { 'command': 'x-debug-block-dirty-bitmap-sha256',
1808 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
1813 # Start mirroring a block device's writes to a new destination.
1815 # @job-id: identifier for the newly-created block job. If
1816 # omitted, the device name will be used. (Since 2.7)
1818 # @device: The device name or node-name of a root node whose writes should be
1821 # @target: the id or node-name of the block device to mirror to. This mustn't be
1822 # attached to guest.
1824 # @replaces: with sync=full graph node name to be replaced by the new
1825 # image when a whole image copy is done. This can be used to repair
1826 # broken Quorum files.
1828 # @speed: the maximum speed, in bytes per second
1830 # @sync: what parts of the disk image should be copied to the destination
1831 # (all the disk, only the sectors allocated in the topmost image, or
1834 # @granularity: granularity of the dirty bitmap, default is 64K
1835 # if the image format doesn't have clusters, 4K if the clusters
1836 # are smaller than that, else the cluster size. Must be a
1837 # power of 2 between 512 and 64M
1839 # @buf-size: maximum amount of data in flight from source to
1842 # @on-source-error: the action to take on an error on the source,
1843 # default 'report'. 'stop' and 'enospc' can only be used
1844 # if the block device supports io-status (see BlockInfo).
1846 # @on-target-error: the action to take on an error on the target,
1847 # default 'report' (no limitations, since this applies to
1848 # a different block device than @device).
1850 # @filter-node-name: the node name that should be assigned to the
1851 # filter driver that the mirror job inserts into the graph
1852 # above @device. If this option is not given, a node name is
1853 # autogenerated. (Since: 2.9)
1855 # Returns: nothing on success.
1861 # -> { "execute": "blockdev-mirror",
1862 # "arguments": { "device": "ide-hd0",
1863 # "target": "target0",
1864 # "sync": "full" } }
1865 # <- { "return": {} }
1868 { 'command': 'blockdev-mirror',
1869 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1871 'sync': 'MirrorSyncMode',
1872 '*speed': 'int', '*granularity': 'uint32',
1873 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1874 '*on-target-error': 'BlockdevOnError',
1875 '*filter-node-name': 'str' } }
1878 # @block_set_io_throttle:
1880 # Change I/O throttle limits for a block drive.
1882 # Since QEMU 2.4, each device with I/O limits is member of a throttle
1885 # If two or more devices are members of the same group, the limits
1886 # will apply to the combined I/O of the whole group in a round-robin
1887 # fashion. Therefore, setting new I/O limits to a device will affect
1890 # The name of the group can be specified using the 'group' parameter.
1891 # If the parameter is unset, it is assumed to be the current group of
1892 # that device. If it's not in any group yet, the name of the device
1893 # will be used as the name for its group.
1895 # The 'group' parameter can also be used to move a device to a
1896 # different group. In this case the limits specified in the parameters
1897 # will be applied to the new group only.
1899 # I/O limits can be disabled by setting all of them to 0. In this case
1900 # the device will be removed from its group and the rest of its
1901 # members will not be affected. The 'group' parameter is ignored.
1903 # Returns: Nothing on success
1904 # If @device is not a valid block device, DeviceNotFound
1910 # -> { "execute": "block_set_io_throttle",
1911 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
1924 # "bps_max_length": 0,
1925 # "iops_size": 0 } }
1926 # <- { "return": {} }
1928 # -> { "execute": "block_set_io_throttle",
1929 # "arguments": { "id": "ide0-1-0",
1936 # "bps_max": 8000000,
1942 # "bps_max_length": 60,
1943 # "iops_size": 0 } }
1944 # <- { "return": {} }
1946 { 'command': 'block_set_io_throttle', 'boxed': true,
1947 'data': 'BlockIOThrottle' }
1952 # A set of parameters describing block throttling.
1954 # @device: Block device name (deprecated, use @id instead)
1956 # @id: The name or QOM path of the guest device (since: 2.8)
1958 # @bps: total throughput limit in bytes per second
1960 # @bps_rd: read throughput limit in bytes per second
1962 # @bps_wr: write throughput limit in bytes per second
1964 # @iops: total I/O operations per second
1966 # @iops_rd: read I/O operations per second
1968 # @iops_wr: write I/O operations per second
1970 # @bps_max: total throughput limit during bursts,
1971 # in bytes (Since 1.7)
1973 # @bps_rd_max: read throughput limit during bursts,
1974 # in bytes (Since 1.7)
1976 # @bps_wr_max: write throughput limit during bursts,
1977 # in bytes (Since 1.7)
1979 # @iops_max: total I/O operations per second during bursts,
1980 # in bytes (Since 1.7)
1982 # @iops_rd_max: read I/O operations per second during bursts,
1983 # in bytes (Since 1.7)
1985 # @iops_wr_max: write I/O operations per second during bursts,
1986 # in bytes (Since 1.7)
1988 # @bps_max_length: maximum length of the @bps_max burst
1989 # period, in seconds. It must only
1990 # be set if @bps_max is set as well.
1991 # Defaults to 1. (Since 2.6)
1993 # @bps_rd_max_length: maximum length of the @bps_rd_max
1994 # burst period, in seconds. It must only
1995 # be set if @bps_rd_max is set as well.
1996 # Defaults to 1. (Since 2.6)
1998 # @bps_wr_max_length: maximum length of the @bps_wr_max
1999 # burst period, in seconds. It must only
2000 # be set if @bps_wr_max is set as well.
2001 # Defaults to 1. (Since 2.6)
2003 # @iops_max_length: maximum length of the @iops burst
2004 # period, in seconds. It must only
2005 # be set if @iops_max is set as well.
2006 # Defaults to 1. (Since 2.6)
2008 # @iops_rd_max_length: maximum length of the @iops_rd_max
2009 # burst period, in seconds. It must only
2010 # be set if @iops_rd_max is set as well.
2011 # Defaults to 1. (Since 2.6)
2013 # @iops_wr_max_length: maximum length of the @iops_wr_max
2014 # burst period, in seconds. It must only
2015 # be set if @iops_wr_max is set as well.
2016 # Defaults to 1. (Since 2.6)
2018 # @iops_size: an I/O size in bytes (Since 1.7)
2020 # @group: throttle group name (Since 2.4)
2024 { 'struct': 'BlockIOThrottle',
2025 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2026 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2027 '*bps_max': 'int', '*bps_rd_max': 'int',
2028 '*bps_wr_max': 'int', '*iops_max': 'int',
2029 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2030 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2031 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2032 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2033 '*iops_size': 'int', '*group': 'str' } }
2038 # Limit parameters for throttling.
2039 # Since some limit combinations are illegal, limits should always be set in one
2040 # transaction. All fields are optional. When setting limits, if a field is
2041 # missing the current value is not changed.
2043 # @iops-total: limit total I/O operations per second
2044 # @iops-total-max: I/O operations burst
2045 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2046 # It must only be set if @iops-total-max is set as well.
2047 # @iops-read: limit read operations per second
2048 # @iops-read-max: I/O operations read burst
2049 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2050 # It must only be set if @iops-read-max is set as well.
2051 # @iops-write: limit write operations per second
2052 # @iops-write-max: I/O operations write burst
2053 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2054 # It must only be set if @iops-write-max is set as well.
2055 # @bps-total: limit total bytes per second
2056 # @bps-total-max: total bytes burst
2057 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2058 # It must only be set if @bps-total-max is set as well.
2059 # @bps-read: limit read bytes per second
2060 # @bps-read-max: total bytes read burst
2061 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2062 # It must only be set if @bps-read-max is set as well.
2063 # @bps-write: limit write bytes per second
2064 # @bps-write-max: total bytes write burst
2065 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2066 # It must only be set if @bps-write-max is set as well.
2067 # @iops-size: when limiting by iops max size of an I/O in bytes
2071 { 'struct': 'ThrottleLimits',
2072 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2073 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2074 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2075 '*iops-write' : 'int', '*iops-write-max' : 'int',
2076 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2077 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2078 '*bps-read' : 'int', '*bps-read-max' : 'int',
2079 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2080 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2081 '*iops-size' : 'int' } }
2086 # Copy data from a backing file into a block device.
2088 # The block streaming operation is performed in the background until the entire
2089 # backing file has been copied. This command returns immediately once streaming
2090 # has started. The status of ongoing block streaming operations can be checked
2091 # with query-block-jobs. The operation can be stopped before it has completed
2092 # using the block-job-cancel command.
2094 # The node that receives the data is called the top image, can be located in
2095 # any part of the chain (but always above the base image; see below) and can be
2096 # specified using its device or node name. Earlier qemu versions only allowed
2097 # 'device' to name the top level node; presence of the 'base-node' parameter
2098 # during introspection can be used as a witness of the enhanced semantics
2101 # If a base file is specified then sectors are not copied from that base file and
2102 # its backing chain. When streaming completes the image file will have the base
2103 # file as its backing file. This can be used to stream a subset of the backing
2104 # file chain instead of flattening the entire image.
2106 # On successful completion the image file is updated to drop the backing file
2107 # and the BLOCK_JOB_COMPLETED event is emitted.
2109 # @job-id: identifier for the newly-created block job. If
2110 # omitted, the device name will be used. (Since 2.7)
2112 # @device: the device or node name of the top image
2114 # @base: the common backing file name.
2115 # It cannot be set if @base-node is also set.
2117 # @base-node: the node name of the backing file.
2118 # It cannot be set if @base is also set. (Since 2.8)
2120 # @backing-file: The backing file string to write into the top
2121 # image. This filename is not validated.
2123 # If a pathname string is such that it cannot be
2124 # resolved by QEMU, that means that subsequent QMP or
2125 # HMP commands must use node-names for the image in
2126 # question, as filename lookup methods will fail.
2128 # If not specified, QEMU will automatically determine
2129 # the backing file string to use, or error out if there
2130 # is no obvious choice. Care should be taken when
2131 # specifying the string, to specify a valid filename or
2135 # @speed: the maximum speed, in bytes per second
2137 # @on-error: the action to take on an error (default report).
2138 # 'stop' and 'enospc' can only be used if the block device
2139 # supports io-status (see BlockInfo). Since 1.3.
2141 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
2147 # -> { "execute": "block-stream",
2148 # "arguments": { "device": "virtio0",
2149 # "base": "/tmp/master.qcow2" } }
2150 # <- { "return": {} }
2153 { 'command': 'block-stream',
2154 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2155 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2156 '*on-error': 'BlockdevOnError' } }
2159 # @block-job-set-speed:
2161 # Set maximum speed for a background block operation.
2163 # This command can only be issued when there is an active block job.
2165 # Throttling can be disabled by setting the speed to 0.
2167 # @device: The job identifier. This used to be a device name (hence
2168 # the name of the parameter), but since QEMU 2.7 it can have
2171 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2174 # Returns: Nothing on success
2175 # If no background operation is active on this device, DeviceNotActive
2179 { 'command': 'block-job-set-speed',
2180 'data': { 'device': 'str', 'speed': 'int' } }
2183 # @block-job-cancel:
2185 # Stop an active background block operation.
2187 # This command returns immediately after marking the active background block
2188 # operation for cancellation. It is an error to call this command if no
2189 # operation is in progress.
2191 # The operation will cancel as soon as possible and then emit the
2192 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2193 # enumerated using query-block-jobs.
2195 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2196 # (via the event BLOCK_JOB_READY) that the source and destination are
2197 # synchronized, then the event triggered by this command changes to
2198 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2199 # destination now has a point-in-time copy tied to the time of the cancellation.
2201 # For streaming, the image file retains its backing file unless the streaming
2202 # operation happens to complete just as it is being cancelled. A new streaming
2203 # operation can be started at a later time to finish copying all data from the
2206 # @device: The job identifier. This used to be a device name (hence
2207 # the name of the parameter), but since QEMU 2.7 it can have
2210 # @force: whether to allow cancellation of a paused job (default
2211 # false). Since 1.3.
2213 # Returns: Nothing on success
2214 # If no background operation is active on this device, DeviceNotActive
2218 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2223 # Pause an active background block operation.
2225 # This command returns immediately after marking the active background block
2226 # operation for pausing. It is an error to call this command if no
2227 # operation is in progress. Pausing an already paused job has no cumulative
2228 # effect; a single block-job-resume command will resume the job.
2230 # The operation will pause as soon as possible. No event is emitted when
2231 # the operation is actually paused. Cancelling a paused job automatically
2234 # @device: The job identifier. This used to be a device name (hence
2235 # the name of the parameter), but since QEMU 2.7 it can have
2238 # Returns: Nothing on success
2239 # If no background operation is active on this device, DeviceNotActive
2243 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2246 # @block-job-resume:
2248 # Resume an active background block operation.
2250 # This command returns immediately after resuming a paused background block
2251 # operation. It is an error to call this command if no operation is in
2252 # progress. Resuming an already running job is not an error.
2254 # This command also clears the error status of the job.
2256 # @device: The job identifier. This used to be a device name (hence
2257 # the name of the parameter), but since QEMU 2.7 it can have
2260 # Returns: Nothing on success
2261 # If no background operation is active on this device, DeviceNotActive
2265 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2268 # @block-job-complete:
2270 # Manually trigger completion of an active background block operation. This
2271 # is supported for drive mirroring, where it also switches the device to
2272 # write to the target path only. The ability to complete is signaled with
2273 # a BLOCK_JOB_READY event.
2275 # This command completes an active background block operation synchronously.
2276 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2277 # is not defined. Note that if an I/O error occurs during the processing of
2278 # this command: 1) the command itself will fail; 2) the error will be processed
2279 # according to the rerror/werror arguments that were specified when starting
2282 # A cancelled or paused job cannot be completed.
2284 # @device: The job identifier. This used to be a device name (hence
2285 # the name of the parameter), but since QEMU 2.7 it can have
2288 # Returns: Nothing on success
2289 # If no background operation is active on this device, DeviceNotActive
2293 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2296 # @block-job-dismiss:
2298 # For jobs that have already concluded, remove them from the block-job-query
2299 # list. This command only needs to be run for jobs which were started with
2300 # QEMU 2.12+ job lifetime management semantics.
2302 # This command will refuse to operate on any job that has not yet reached
2303 # its terminal state, BLOCK_JOB_STATUS_CONCLUDED. For jobs that make use of
2304 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2305 # to be used as appropriate.
2307 # @id: The job identifier.
2309 # Returns: Nothing on success
2313 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2316 # @block-job-finalize:
2318 # Once a job that has manual=true reaches the pending state, it can be
2319 # instructed to finalize any graph changes and do any necessary cleanup
2321 # For jobs in a transaction, instructing one job to finalize will force
2322 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2323 # a single member job to finalize.
2325 # @id: The job identifier.
2327 # Returns: Nothing on success
2331 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2334 # @BlockdevDiscardOptions:
2336 # Determines how to handle discard requests.
2338 # @ignore: Ignore the request
2339 # @unmap: Forward as an unmap request
2343 { 'enum': 'BlockdevDiscardOptions',
2344 'data': [ 'ignore', 'unmap' ] }
2347 # @BlockdevDetectZeroesOptions:
2349 # Describes the operation mode for the automatic conversion of plain
2350 # zero writes by the OS to driver specific optimized zero write commands.
2352 # @off: Disabled (default)
2354 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2355 # also that @BlockdevDiscardOptions is set to unmap for this device.
2359 { 'enum': 'BlockdevDetectZeroesOptions',
2360 'data': [ 'off', 'on', 'unmap' ] }
2363 # @BlockdevAioOptions:
2365 # Selects the AIO backend to handle I/O requests
2367 # @threads: Use qemu's thread pool
2368 # @native: Use native AIO backend (only Linux and Windows)
2372 { 'enum': 'BlockdevAioOptions',
2373 'data': [ 'threads', 'native' ] }
2376 # @BlockdevCacheOptions:
2378 # Includes cache-related options for block devices
2380 # @direct: enables use of O_DIRECT (bypass the host page cache;
2382 # @no-flush: ignore any flush requests for the device (default:
2387 { 'struct': 'BlockdevCacheOptions',
2388 'data': { '*direct': 'bool',
2389 '*no-flush': 'bool' } }
2394 # Drivers that are supported in block device operations.
2397 # @throttle: Since 2.11
2402 { 'enum': 'BlockdevDriver',
2403 'data': [ 'blkdebug', 'blkverify', 'bochs', 'cloop',
2404 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
2405 'host_device', 'http', 'https', 'iscsi', 'luks', 'nbd', 'nfs',
2406 'null-aio', 'null-co', 'nvme', 'parallels', 'qcow', 'qcow2', 'qed',
2407 'quorum', 'raw', 'rbd', 'replication', 'sheepdog', 'ssh',
2408 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2411 # @BlockdevOptionsFile:
2413 # Driver specific block device options for the file backend.
2415 # @filename: path to the image file
2416 # @pr-manager: the id for the object that will handle persistent reservations
2417 # for this device (default: none, forward the commands via SG_IO;
2419 # @aio: AIO backend (default: threads) (since: 2.8)
2420 # @locking: whether to enable file locking. If set to 'auto', only enable
2421 # when Open File Descriptor (OFD) locking API is available
2422 # (default: auto, since 2.10)
2426 { 'struct': 'BlockdevOptionsFile',
2427 'data': { 'filename': 'str',
2428 '*pr-manager': 'str',
2429 '*locking': 'OnOffAuto',
2430 '*aio': 'BlockdevAioOptions' } }
2433 # @BlockdevOptionsNull:
2435 # Driver specific block device options for the null backend.
2437 # @size: size of the device in bytes.
2438 # @latency-ns: emulated latency (in nanoseconds) in processing
2439 # requests. Default to zero which completes requests immediately.
2444 { 'struct': 'BlockdevOptionsNull',
2445 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
2448 # @BlockdevOptionsNVMe:
2450 # Driver specific block device options for the NVMe backend.
2452 # @device: controller address of the NVMe device.
2453 # @namespace: namespace number of the device, starting from 1.
2457 { 'struct': 'BlockdevOptionsNVMe',
2458 'data': { 'device': 'str', 'namespace': 'int' } }
2461 # @BlockdevOptionsVVFAT:
2463 # Driver specific block device options for the vvfat protocol.
2465 # @dir: directory to be exported as FAT image
2466 # @fat-type: FAT type: 12, 16 or 32
2467 # @floppy: whether to export a floppy image (true) or
2468 # partitioned hard disk (false; default)
2469 # @label: set the volume label, limited to 11 bytes. FAT16 and
2470 # FAT32 traditionally have some restrictions on labels, which are
2471 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2473 # @rw: whether to allow write operations (default: false)
2477 { 'struct': 'BlockdevOptionsVVFAT',
2478 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2479 '*label': 'str', '*rw': 'bool' } }
2482 # @BlockdevOptionsGenericFormat:
2484 # Driver specific block device options for image format that have no option
2485 # besides their data source.
2487 # @file: reference to or definition of the data source block device
2491 { 'struct': 'BlockdevOptionsGenericFormat',
2492 'data': { 'file': 'BlockdevRef' } }
2495 # @BlockdevOptionsLUKS:
2497 # Driver specific block device options for LUKS.
2499 # @key-secret: the ID of a QCryptoSecret object providing
2500 # the decryption key (since 2.6). Mandatory except when
2501 # doing a metadata-only probe of the image.
2505 { 'struct': 'BlockdevOptionsLUKS',
2506 'base': 'BlockdevOptionsGenericFormat',
2507 'data': { '*key-secret': 'str' } }
2511 # @BlockdevOptionsGenericCOWFormat:
2513 # Driver specific block device options for image format that have no option
2514 # besides their data source and an optional backing file.
2516 # @backing: reference to or definition of the backing file block
2517 # device, null disables the backing file entirely.
2518 # Defaults to the backing file stored the image file.
2522 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2523 'base': 'BlockdevOptionsGenericFormat',
2524 'data': { '*backing': 'BlockdevRefOrNull' } }
2527 # @Qcow2OverlapCheckMode:
2529 # General overlap check modes.
2531 # @none: Do not perform any checks
2533 # @constant: Perform only checks which can be done in constant time and
2534 # without reading anything from disk
2536 # @cached: Perform only checks which can be done without reading anything
2539 # @all: Perform all available overlap checks
2543 { 'enum': 'Qcow2OverlapCheckMode',
2544 'data': [ 'none', 'constant', 'cached', 'all' ] }
2547 # @Qcow2OverlapCheckFlags:
2549 # Structure of flags for each metadata structure. Setting a field to 'true'
2550 # makes qemu guard that structure against unintended overwriting. The default
2551 # value is chosen according to the template given.
2553 # @template: Specifies a template mode which can be adjusted using the other
2554 # flags, defaults to 'cached'
2558 { 'struct': 'Qcow2OverlapCheckFlags',
2559 'data': { '*template': 'Qcow2OverlapCheckMode',
2560 '*main-header': 'bool',
2561 '*active-l1': 'bool',
2562 '*active-l2': 'bool',
2563 '*refcount-table': 'bool',
2564 '*refcount-block': 'bool',
2565 '*snapshot-table': 'bool',
2566 '*inactive-l1': 'bool',
2567 '*inactive-l2': 'bool' } }
2570 # @Qcow2OverlapChecks:
2572 # Specifies which metadata structures should be guarded against unintended
2575 # @flags: set of flags for separate specification of each metadata structure
2578 # @mode: named mode which chooses a specific set of flags
2582 { 'alternate': 'Qcow2OverlapChecks',
2583 'data': { 'flags': 'Qcow2OverlapCheckFlags',
2584 'mode': 'Qcow2OverlapCheckMode' } }
2587 # @BlockdevQcowEncryptionFormat:
2589 # @aes: AES-CBC with plain64 initialization vectors
2593 { 'enum': 'BlockdevQcowEncryptionFormat',
2597 # @BlockdevQcowEncryption:
2601 { 'union': 'BlockdevQcowEncryption',
2602 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
2603 'discriminator': 'format',
2604 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
2607 # @BlockdevOptionsQcow:
2609 # Driver specific block device options for qcow.
2611 # @encrypt: Image decryption options. Mandatory for
2612 # encrypted images, except when doing a metadata-only
2613 # probe of the image.
2617 { 'struct': 'BlockdevOptionsQcow',
2618 'base': 'BlockdevOptionsGenericCOWFormat',
2619 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
2624 # @BlockdevQcow2EncryptionFormat:
2625 # @aes: AES-CBC with plain64 initialization venctors
2629 { 'enum': 'BlockdevQcow2EncryptionFormat',
2630 'data': [ 'aes', 'luks' ] }
2633 # @BlockdevQcow2Encryption:
2637 { 'union': 'BlockdevQcow2Encryption',
2638 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
2639 'discriminator': 'format',
2640 'data': { 'aes': 'QCryptoBlockOptionsQCow',
2641 'luks': 'QCryptoBlockOptionsLUKS'} }
2644 # @BlockdevOptionsQcow2:
2646 # Driver specific block device options for qcow2.
2648 # @lazy-refcounts: whether to enable the lazy refcounts
2649 # feature (default is taken from the image file)
2651 # @pass-discard-request: whether discard requests to the qcow2
2652 # device should be forwarded to the data source
2654 # @pass-discard-snapshot: whether discard requests for the data source
2655 # should be issued when a snapshot operation (e.g.
2656 # deleting a snapshot) frees clusters in the qcow2 file
2658 # @pass-discard-other: whether discard requests for the data source
2659 # should be issued on other occasions where a cluster
2662 # @overlap-check: which overlap checks to perform for writes
2663 # to the image, defaults to 'cached' (since 2.2)
2665 # @cache-size: the maximum total size of the L2 table and
2666 # refcount block caches in bytes (since 2.2)
2668 # @l2-cache-size: the maximum size of the L2 table cache in
2671 # @l2-cache-entry-size: the size of each entry in the L2 cache in
2672 # bytes. It must be a power of two between 512
2673 # and the cluster size. The default value is
2674 # the cluster size (since 2.12)
2676 # @refcount-cache-size: the maximum size of the refcount block cache
2677 # in bytes (since 2.2)
2679 # @cache-clean-interval: clean unused entries in the L2 and refcount
2680 # caches. The interval is in seconds. The default value
2681 # is 0 and it disables this feature (since 2.5)
2682 # @encrypt: Image decryption options. Mandatory for
2683 # encrypted images, except when doing a metadata-only
2684 # probe of the image. (since 2.10)
2688 { 'struct': 'BlockdevOptionsQcow2',
2689 'base': 'BlockdevOptionsGenericCOWFormat',
2690 'data': { '*lazy-refcounts': 'bool',
2691 '*pass-discard-request': 'bool',
2692 '*pass-discard-snapshot': 'bool',
2693 '*pass-discard-other': 'bool',
2694 '*overlap-check': 'Qcow2OverlapChecks',
2695 '*cache-size': 'int',
2696 '*l2-cache-size': 'int',
2697 '*l2-cache-entry-size': 'int',
2698 '*refcount-cache-size': 'int',
2699 '*cache-clean-interval': 'int',
2700 '*encrypt': 'BlockdevQcow2Encryption' } }
2703 # @SshHostKeyCheckMode:
2705 # @none Don't check the host key at all
2706 # @hash Compare the host key with a given hash
2707 # @known_hosts Check the host key against the known_hosts file
2711 { 'enum': 'SshHostKeyCheckMode',
2712 'data': [ 'none', 'hash', 'known_hosts' ] }
2715 # @SshHostKeyCheckHashType:
2717 # @md5 The given hash is an md5 hash
2718 # @sha1 The given hash is an sha1 hash
2722 { 'enum': 'SshHostKeyCheckHashType',
2723 'data': [ 'md5', 'sha1' ] }
2728 # @type The hash algorithm used for the hash
2729 # @hash The expected hash value
2733 { 'struct': 'SshHostKeyHash',
2734 'data': { 'type': 'SshHostKeyCheckHashType',
2740 # For those union branches that don't need additional fields.
2744 { 'struct': 'SshHostKeyDummy',
2752 { 'union': 'SshHostKeyCheck',
2753 'base': { 'mode': 'SshHostKeyCheckMode' },
2754 'discriminator': 'mode',
2755 'data': { 'none': 'SshHostKeyDummy',
2756 'hash': 'SshHostKeyHash',
2757 'known_hosts': 'SshHostKeyDummy' } }
2760 # @BlockdevOptionsSsh:
2762 # @server: host address
2764 # @path: path to the image on the host
2766 # @user: user as which to connect, defaults to current
2769 # @host-key-check: Defines how and what to check the host key against
2770 # (default: known_hosts)
2774 { 'struct': 'BlockdevOptionsSsh',
2775 'data': { 'server': 'InetSocketAddress',
2778 '*host-key-check': 'SshHostKeyCheck' } }
2784 # Trigger events supported by blkdebug.
2786 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
2789 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
2791 # @cor_write: a write due to copy-on-read (since 2.11)
2795 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
2796 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
2797 'l1_grow_activate_table', 'l2_load', 'l2_update',
2798 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
2799 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
2800 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
2801 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
2802 'refblock_load', 'refblock_update', 'refblock_update_part',
2803 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
2804 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
2805 'refblock_alloc_switch_table', 'cluster_alloc',
2806 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
2807 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
2808 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
2809 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
2810 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
2814 # @BlkdebugInjectErrorOptions:
2816 # Describes a single error injection for blkdebug.
2818 # @event: trigger event
2820 # @state: the state identifier blkdebug needs to be in to
2821 # actually trigger the event; defaults to "any"
2823 # @errno: error identifier (errno) to be returned; defaults to
2826 # @sector: specifies the sector index which has to be affected
2827 # in order to actually trigger the event; defaults to "any
2830 # @once: disables further events after this one has been
2831 # triggered; defaults to false
2833 # @immediately: fail immediately; defaults to false
2837 { 'struct': 'BlkdebugInjectErrorOptions',
2838 'data': { 'event': 'BlkdebugEvent',
2843 '*immediately': 'bool' } }
2846 # @BlkdebugSetStateOptions:
2848 # Describes a single state-change event for blkdebug.
2850 # @event: trigger event
2852 # @state: the current state identifier blkdebug needs to be in;
2855 # @new_state: the state identifier blkdebug is supposed to assume if
2856 # this event is triggered
2860 { 'struct': 'BlkdebugSetStateOptions',
2861 'data': { 'event': 'BlkdebugEvent',
2863 'new_state': 'int' } }
2866 # @BlockdevOptionsBlkdebug:
2868 # Driver specific block device options for blkdebug.
2870 # @image: underlying raw block device (or image file)
2872 # @config: filename of the configuration file
2874 # @align: required alignment for requests in bytes, must be
2875 # positive power of 2, or 0 for default
2877 # @max-transfer: maximum size for I/O transfers in bytes, must be
2878 # positive multiple of @align and of the underlying
2879 # file's request alignment (but need not be a power of
2880 # 2), or 0 for default (since 2.10)
2882 # @opt-write-zero: preferred alignment for write zero requests in bytes,
2883 # must be positive multiple of @align and of the
2884 # underlying file's request alignment (but need not be a
2885 # power of 2), or 0 for default (since 2.10)
2887 # @max-write-zero: maximum size for write zero requests in bytes, must be
2888 # positive multiple of @align, of @opt-write-zero, and of
2889 # the underlying file's request alignment (but need not
2890 # be a power of 2), or 0 for default (since 2.10)
2892 # @opt-discard: preferred alignment for discard requests in bytes, must
2893 # be positive multiple of @align and of the underlying
2894 # file's request alignment (but need not be a power of
2895 # 2), or 0 for default (since 2.10)
2897 # @max-discard: maximum size for discard requests in bytes, must be
2898 # positive multiple of @align, of @opt-discard, and of
2899 # the underlying file's request alignment (but need not
2900 # be a power of 2), or 0 for default (since 2.10)
2902 # @inject-error: array of error injection descriptions
2904 # @set-state: array of state-change descriptions
2908 { 'struct': 'BlockdevOptionsBlkdebug',
2909 'data': { 'image': 'BlockdevRef',
2911 '*align': 'int', '*max-transfer': 'int32',
2912 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
2913 '*opt-discard': 'int32', '*max-discard': 'int32',
2914 '*inject-error': ['BlkdebugInjectErrorOptions'],
2915 '*set-state': ['BlkdebugSetStateOptions'] } }
2918 # @BlockdevOptionsBlkverify:
2920 # Driver specific block device options for blkverify.
2922 # @test: block device to be tested
2924 # @raw: raw image used for verification
2928 { 'struct': 'BlockdevOptionsBlkverify',
2929 'data': { 'test': 'BlockdevRef',
2930 'raw': 'BlockdevRef' } }
2933 # @QuorumReadPattern:
2935 # An enumeration of quorum read patterns.
2937 # @quorum: read all the children and do a quorum vote on reads
2939 # @fifo: read only from the first child that has not failed
2943 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
2946 # @BlockdevOptionsQuorum:
2948 # Driver specific block device options for Quorum
2950 # @blkverify: true if the driver must print content mismatch
2951 # set to false by default
2953 # @children: the children block devices to use
2955 # @vote-threshold: the vote limit under which a read will fail
2957 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
2960 # @read-pattern: choose read pattern and set to quorum by default
2965 { 'struct': 'BlockdevOptionsQuorum',
2966 'data': { '*blkverify': 'bool',
2967 'children': [ 'BlockdevRef' ],
2968 'vote-threshold': 'int',
2969 '*rewrite-corrupted': 'bool',
2970 '*read-pattern': 'QuorumReadPattern' } }
2973 # @BlockdevOptionsGluster:
2975 # Driver specific block device options for Gluster
2977 # @volume: name of gluster volume where VM image resides
2979 # @path: absolute path to image file in gluster volume
2981 # @server: gluster servers description
2983 # @debug: libgfapi log level (default '4' which is Error)
2986 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
2990 { 'struct': 'BlockdevOptionsGluster',
2991 'data': { 'volume': 'str',
2993 'server': ['SocketAddress'],
2995 '*logfile': 'str' } }
3000 # An enumeration of libiscsi transport types
3004 { 'enum': 'IscsiTransport',
3005 'data': [ 'tcp', 'iser' ] }
3008 # @IscsiHeaderDigest:
3010 # An enumeration of header digests supported by libiscsi
3014 { 'enum': 'IscsiHeaderDigest',
3015 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3016 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3019 # @BlockdevOptionsIscsi:
3021 # @transport: The iscsi transport type
3023 # @portal: The address of the iscsi portal
3025 # @target: The target iqn name
3027 # @lun: LUN to connect to. Defaults to 0.
3029 # @user: User name to log in with. If omitted, no CHAP
3030 # authentication is performed.
3032 # @password-secret: The ID of a QCryptoSecret object providing
3033 # the password for the login. This option is required if
3034 # @user is specified.
3036 # @initiator-name: The iqn name we want to identify to the target
3037 # as. If this option is not specified, an initiator name is
3038 # generated automatically.
3040 # @header-digest: The desired header digest. Defaults to
3043 # @timeout: Timeout in seconds after which a request will
3044 # timeout. 0 means no timeout and is the default.
3046 # Driver specific block device options for iscsi
3050 { 'struct': 'BlockdevOptionsIscsi',
3051 'data': { 'transport': 'IscsiTransport',
3056 '*password-secret': 'str',
3057 '*initiator-name': 'str',
3058 '*header-digest': 'IscsiHeaderDigest',
3059 '*timeout': 'int' } }
3063 # @BlockdevOptionsRbd:
3065 # @pool: Ceph pool name.
3067 # @image: Image name in the Ceph pool.
3069 # @conf: path to Ceph configuration file. Values
3070 # in the configuration file will be overridden by
3071 # options specified via QAPI.
3073 # @snapshot: Ceph snapshot name.
3075 # @user: Ceph id name.
3077 # @server: Monitor host address and port. This maps
3078 # to the "mon_host" Ceph option.
3082 { 'struct': 'BlockdevOptionsRbd',
3083 'data': { 'pool': 'str',
3088 '*server': ['InetSocketAddressBase'] } }
3091 # @BlockdevOptionsSheepdog:
3093 # Driver specific block device options for sheepdog
3095 # @vdi: Virtual disk image name
3096 # @server: The Sheepdog server to connect to
3097 # @snap-id: Snapshot ID
3098 # @tag: Snapshot tag name
3100 # Only one of @snap-id and @tag may be present.
3104 { 'struct': 'BlockdevOptionsSheepdog',
3105 'data': { 'server': 'SocketAddress',
3107 '*snap-id': 'uint32',
3113 # An enumeration of replication modes.
3115 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3117 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3121 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
3124 # @BlockdevOptionsReplication:
3126 # Driver specific block device options for replication
3128 # @mode: the replication mode
3130 # @top-id: In secondary mode, node name or device ID of the root
3131 # node who owns the replication node chain. Must not be given in
3136 { 'struct': 'BlockdevOptionsReplication',
3137 'base': 'BlockdevOptionsGenericFormat',
3138 'data': { 'mode': 'ReplicationMode',
3139 '*top-id': 'str' } }
3144 # An enumeration of NFS transport types
3146 # @inet: TCP transport
3150 { 'enum': 'NFSTransport',
3151 'data': [ 'inet' ] }
3156 # Captures the address of the socket
3158 # @type: transport type used for NFS (only TCP supported)
3160 # @host: host address for NFS server
3164 { 'struct': 'NFSServer',
3165 'data': { 'type': 'NFSTransport',
3169 # @BlockdevOptionsNfs:
3171 # Driver specific block device option for NFS
3173 # @server: host address
3175 # @path: path of the image on the host
3177 # @user: UID value to use when talking to the
3178 # server (defaults to 65534 on Windows and getuid()
3181 # @group: GID value to use when talking to the
3182 # server (defaults to 65534 on Windows and getgid()
3185 # @tcp-syn-count: number of SYNs during the session
3186 # establishment (defaults to libnfs default)
3188 # @readahead-size: set the readahead size in bytes (defaults
3189 # to libnfs default)
3191 # @page-cache-size: set the pagecache size in bytes (defaults
3192 # to libnfs default)
3194 # @debug: set the NFS debug level (max 2) (defaults
3195 # to libnfs default)
3199 { 'struct': 'BlockdevOptionsNfs',
3200 'data': { 'server': 'NFSServer',
3204 '*tcp-syn-count': 'int',
3205 '*readahead-size': 'int',
3206 '*page-cache-size': 'int',
3210 # @BlockdevOptionsCurlBase:
3212 # Driver specific block device options shared by all protocols supported by the
3215 # @url: URL of the image file
3217 # @readahead: Size of the read-ahead cache; must be a multiple of
3218 # 512 (defaults to 256 kB)
3220 # @timeout: Timeout for connections, in seconds (defaults to 5)
3222 # @username: Username for authentication (defaults to none)
3224 # @password-secret: ID of a QCryptoSecret object providing a password
3225 # for authentication (defaults to no password)
3227 # @proxy-username: Username for proxy authentication (defaults to none)
3229 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3230 # for proxy authentication (defaults to no password)
3234 { 'struct': 'BlockdevOptionsCurlBase',
3235 'data': { 'url': 'str',
3236 '*readahead': 'int',
3239 '*password-secret': 'str',
3240 '*proxy-username': 'str',
3241 '*proxy-password-secret': 'str' } }
3244 # @BlockdevOptionsCurlHttp:
3246 # Driver specific block device options for HTTP connections over the curl
3247 # backend. URLs must start with "http://".
3249 # @cookie: List of cookies to set; format is
3250 # "name1=content1; name2=content2;" as explained by
3251 # CURLOPT_COOKIE(3). Defaults to no cookies.
3253 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3254 # secure way. See @cookie for the format. (since 2.10)
3258 { 'struct': 'BlockdevOptionsCurlHttp',
3259 'base': 'BlockdevOptionsCurlBase',
3260 'data': { '*cookie': 'str',
3261 '*cookie-secret': 'str'} }
3264 # @BlockdevOptionsCurlHttps:
3266 # Driver specific block device options for HTTPS connections over the curl
3267 # backend. URLs must start with "https://".
3269 # @cookie: List of cookies to set; format is
3270 # "name1=content1; name2=content2;" as explained by
3271 # CURLOPT_COOKIE(3). Defaults to no cookies.
3273 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3276 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3277 # secure way. See @cookie for the format. (since 2.10)
3281 { 'struct': 'BlockdevOptionsCurlHttps',
3282 'base': 'BlockdevOptionsCurlBase',
3283 'data': { '*cookie': 'str',
3284 '*sslverify': 'bool',
3285 '*cookie-secret': 'str'} }
3288 # @BlockdevOptionsCurlFtp:
3290 # Driver specific block device options for FTP connections over the curl
3291 # backend. URLs must start with "ftp://".
3295 { 'struct': 'BlockdevOptionsCurlFtp',
3296 'base': 'BlockdevOptionsCurlBase',
3300 # @BlockdevOptionsCurlFtps:
3302 # Driver specific block device options for FTPS connections over the curl
3303 # backend. URLs must start with "ftps://".
3305 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3310 { 'struct': 'BlockdevOptionsCurlFtps',
3311 'base': 'BlockdevOptionsCurlBase',
3312 'data': { '*sslverify': 'bool' } }
3315 # @BlockdevOptionsNbd:
3317 # Driver specific block device options for NBD.
3319 # @server: NBD server address
3321 # @export: export name
3323 # @tls-creds: TLS credentials ID
3327 { 'struct': 'BlockdevOptionsNbd',
3328 'data': { 'server': 'SocketAddress',
3330 '*tls-creds': 'str' } }
3333 # @BlockdevOptionsRaw:
3335 # Driver specific block device options for the raw driver.
3337 # @offset: position where the block device starts
3338 # @size: the assumed size of the device
3342 { 'struct': 'BlockdevOptionsRaw',
3343 'base': 'BlockdevOptionsGenericFormat',
3344 'data': { '*offset': 'int', '*size': 'int' } }
3347 # @BlockdevOptionsVxHS:
3349 # Driver specific block device options for VxHS
3351 # @vdisk-id: UUID of VxHS volume
3352 # @server: vxhs server IP, port
3353 # @tls-creds: TLS credentials ID
3357 { 'struct': 'BlockdevOptionsVxHS',
3358 'data': { 'vdisk-id': 'str',
3359 'server': 'InetSocketAddressBase',
3360 '*tls-creds': 'str' } }
3363 # @BlockdevOptionsThrottle:
3365 # Driver specific block device options for the throttle driver
3367 # @throttle-group: the name of the throttle-group object to use. It
3368 # must already exist.
3369 # @file: reference to or definition of the data source block device
3372 { 'struct': 'BlockdevOptionsThrottle',
3373 'data': { 'throttle-group': 'str',
3374 'file' : 'BlockdevRef'
3379 # Options for creating a block device. Many options are available for all
3380 # block devices, independent of the block driver:
3382 # @driver: block driver name
3383 # @node-name: the node name of the new node (Since 2.0).
3384 # This option is required on the top level of blockdev-add.
3385 # @discard: discard-related options (default: ignore)
3386 # @cache: cache-related options
3387 # @read-only: whether the block device should be read-only (default: false).
3388 # Note that some block drivers support only read-only access,
3389 # either generally or in certain configurations. In this case,
3390 # the default value does not work and the option must be
3391 # specified explicitly.
3392 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3394 # @force-share: force share all permission on added nodes.
3395 # Requires read-only=true. (Since 2.10)
3397 # Remaining options are determined by the block driver.
3401 { 'union': 'BlockdevOptions',
3402 'base': { 'driver': 'BlockdevDriver',
3403 '*node-name': 'str',
3404 '*discard': 'BlockdevDiscardOptions',
3405 '*cache': 'BlockdevCacheOptions',
3406 '*read-only': 'bool',
3407 '*force-share': 'bool',
3408 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3409 'discriminator': 'driver',
3411 'blkdebug': 'BlockdevOptionsBlkdebug',
3412 'blkverify': 'BlockdevOptionsBlkverify',
3413 'bochs': 'BlockdevOptionsGenericFormat',
3414 'cloop': 'BlockdevOptionsGenericFormat',
3415 'dmg': 'BlockdevOptionsGenericFormat',
3416 'file': 'BlockdevOptionsFile',
3417 'ftp': 'BlockdevOptionsCurlFtp',
3418 'ftps': 'BlockdevOptionsCurlFtps',
3419 'gluster': 'BlockdevOptionsGluster',
3420 'host_cdrom': 'BlockdevOptionsFile',
3421 'host_device':'BlockdevOptionsFile',
3422 'http': 'BlockdevOptionsCurlHttp',
3423 'https': 'BlockdevOptionsCurlHttps',
3424 'iscsi': 'BlockdevOptionsIscsi',
3425 'luks': 'BlockdevOptionsLUKS',
3426 'nbd': 'BlockdevOptionsNbd',
3427 'nfs': 'BlockdevOptionsNfs',
3428 'null-aio': 'BlockdevOptionsNull',
3429 'null-co': 'BlockdevOptionsNull',
3430 'nvme': 'BlockdevOptionsNVMe',
3431 'parallels': 'BlockdevOptionsGenericFormat',
3432 'qcow2': 'BlockdevOptionsQcow2',
3433 'qcow': 'BlockdevOptionsQcow',
3434 'qed': 'BlockdevOptionsGenericCOWFormat',
3435 'quorum': 'BlockdevOptionsQuorum',
3436 'raw': 'BlockdevOptionsRaw',
3437 'rbd': 'BlockdevOptionsRbd',
3438 'replication':'BlockdevOptionsReplication',
3439 'sheepdog': 'BlockdevOptionsSheepdog',
3440 'ssh': 'BlockdevOptionsSsh',
3441 'throttle': 'BlockdevOptionsThrottle',
3442 'vdi': 'BlockdevOptionsGenericFormat',
3443 'vhdx': 'BlockdevOptionsGenericFormat',
3444 'vmdk': 'BlockdevOptionsGenericCOWFormat',
3445 'vpc': 'BlockdevOptionsGenericFormat',
3446 'vvfat': 'BlockdevOptionsVVFAT',
3447 'vxhs': 'BlockdevOptionsVxHS'
3453 # Reference to a block device.
3455 # @definition: defines a new block device inline
3456 # @reference: references the ID of an existing block device
3460 { 'alternate': 'BlockdevRef',
3461 'data': { 'definition': 'BlockdevOptions',
3462 'reference': 'str' } }
3465 # @BlockdevRefOrNull:
3467 # Reference to a block device.
3469 # @definition: defines a new block device inline
3470 # @reference: references the ID of an existing block device.
3471 # An empty string means that no block device should
3472 # be referenced. Deprecated; use null instead.
3473 # @null: No block device should be referenced (since 2.10)
3477 { 'alternate': 'BlockdevRefOrNull',
3478 'data': { 'definition': 'BlockdevOptions',
3485 # Creates a new block device. If the @id option is given at the top level, a
3486 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
3487 # level and no BlockBackend will be created.
3494 # -> { "execute": "blockdev-add",
3496 # "driver": "qcow2",
3497 # "node-name": "test1",
3500 # "filename": "test.qcow2"
3504 # <- { "return": {} }
3507 # -> { "execute": "blockdev-add",
3509 # "driver": "qcow2",
3510 # "node-name": "node0",
3511 # "discard": "unmap",
3517 # "filename": "/tmp/test.qcow2"
3523 # "filename": "/dev/fdset/4"
3529 # <- { "return": {} }
3532 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
3537 # Deletes a block device that has been added using blockdev-add.
3538 # The command will fail if the node is attached to a device or is
3539 # otherwise being used.
3541 # @node-name: Name of the graph node to delete.
3547 # -> { "execute": "blockdev-add",
3549 # "driver": "qcow2",
3550 # "node-name": "node0",
3553 # "filename": "test.qcow2"
3557 # <- { "return": {} }
3559 # -> { "execute": "blockdev-del",
3560 # "arguments": { "node-name": "node0" }
3562 # <- { "return": {} }
3565 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
3568 # @BlockdevCreateOptionsFile:
3570 # Driver specific image creation options for file.
3572 # @filename Filename for the new image file
3573 # @size Size of the virtual disk in bytes
3574 # @preallocation Preallocation mode for the new image (default: off)
3575 # @nocow Turn off copy-on-write (valid only on btrfs; default: off)
3579 { 'struct': 'BlockdevCreateOptionsFile',
3580 'data': { 'filename': 'str',
3582 '*preallocation': 'PreallocMode',
3583 '*nocow': 'bool' } }
3586 # @BlockdevCreateOptionsGluster:
3588 # Driver specific image creation options for gluster.
3590 # @location Where to store the new image file
3591 # @size Size of the virtual disk in bytes
3592 # @preallocation Preallocation mode for the new image (default: off)
3596 { 'struct': 'BlockdevCreateOptionsGluster',
3597 'data': { 'location': 'BlockdevOptionsGluster',
3599 '*preallocation': 'PreallocMode' } }
3602 # @BlockdevCreateOptionsLUKS:
3604 # Driver specific image creation options for LUKS.
3606 # @file Node to create the image format on
3607 # @size Size of the virtual disk in bytes
3611 { 'struct': 'BlockdevCreateOptionsLUKS',
3612 'base': 'QCryptoBlockCreateOptionsLUKS',
3613 'data': { 'file': 'BlockdevRef',
3617 # @BlockdevCreateOptionsNfs:
3619 # Driver specific image creation options for NFS.
3621 # @location Where to store the new image file
3622 # @size Size of the virtual disk in bytes
3626 { 'struct': 'BlockdevCreateOptionsNfs',
3627 'data': { 'location': 'BlockdevOptionsNfs',
3631 # @BlockdevQcow2Version:
3633 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
3634 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
3638 { 'enum': 'BlockdevQcow2Version',
3639 'data': [ 'v2', 'v3' ] }
3643 # @BlockdevCreateOptionsQcow2:
3645 # Driver specific image creation options for qcow2.
3647 # @file Node to create the image format on
3648 # @size Size of the virtual disk in bytes
3649 # @version Compatibility level (default: v3)
3650 # @backing-file File name of the backing file if a backing file
3652 # @backing-fmt Name of the block driver to use for the backing file
3653 # @encrypt Encryption options if the image should be encrypted
3654 # @cluster-size qcow2 cluster size in bytes (default: 65536)
3655 # @preallocation Preallocation mode for the new image (default: off)
3656 # @lazy-refcounts True if refcounts may be updated lazily (default: off)
3657 # @refcount-bits Width of reference counts in bits (default: 16)
3661 { 'struct': 'BlockdevCreateOptionsQcow2',
3662 'data': { 'file': 'BlockdevRef',
3664 '*version': 'BlockdevQcow2Version',
3665 '*backing-file': 'str',
3666 '*backing-fmt': 'BlockdevDriver',
3667 '*encrypt': 'QCryptoBlockCreateOptions',
3668 '*cluster-size': 'size',
3669 '*preallocation': 'PreallocMode',
3670 '*lazy-refcounts': 'bool',
3671 '*refcount-bits': 'int' } }
3674 # @BlockdevCreateOptionsRbd:
3676 # Driver specific image creation options for rbd/Ceph.
3678 # @location Where to store the new image file. This location cannot
3679 # point to a snapshot.
3680 # @size Size of the virtual disk in bytes
3681 # @cluster-size RBD object size
3685 { 'struct': 'BlockdevCreateOptionsRbd',
3686 'data': { 'location': 'BlockdevOptionsRbd',
3688 '*cluster-size' : 'size' } }
3691 # @SheepdogRedundancyType:
3693 # @full Create a fully replicated vdi with x copies
3694 # @erasure-coded Create an erasure coded vdi with x data strips and
3699 { 'enum': 'SheepdogRedundancyType',
3700 'data': [ 'full', 'erasure-coded' ] }
3703 # @SheepdogRedundancyFull:
3705 # @copies Number of copies to use (between 1 and 31)
3709 { 'struct': 'SheepdogRedundancyFull',
3710 'data': { 'copies': 'int' }}
3713 # @SheepdogRedundancyErasureCoded:
3715 # @data-strips Number of data strips to use (one of {2,4,8,16})
3716 # @parity-strips Number of parity strips to use (between 1 and 15)
3720 { 'struct': 'SheepdogRedundancyErasureCoded',
3721 'data': { 'data-strips': 'int',
3722 'parity-strips': 'int' }}
3725 # @SheepdogRedundancy:
3729 { 'union': 'SheepdogRedundancy',
3730 'base': { 'type': 'SheepdogRedundancyType' },
3731 'discriminator': 'type',
3732 'data': { 'full': 'SheepdogRedundancyFull',
3733 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
3736 # @BlockdevCreateOptionsSheepdog:
3738 # Driver specific image creation options for Sheepdog.
3740 # @location Where to store the new image file
3741 # @size Size of the virtual disk in bytes
3742 # @backing-file File name of a base image
3743 # @preallocation Preallocation mode (allowed values: off, full)
3744 # @redundancy Redundancy of the image
3745 # @object-size Object size of the image
3749 { 'struct': 'BlockdevCreateOptionsSheepdog',
3750 'data': { 'location': 'BlockdevOptionsSheepdog',
3752 '*backing-file': 'str',
3753 '*preallocation': 'PreallocMode',
3754 '*redundancy': 'SheepdogRedundancy',
3755 '*object-size': 'size' } }
3758 # @BlockdevCreateOptionsSsh:
3760 # Driver specific image creation options for SSH.
3762 # @location Where to store the new image file
3763 # @size Size of the virtual disk in bytes
3767 { 'struct': 'BlockdevCreateOptionsSsh',
3768 'data': { 'location': 'BlockdevOptionsSsh',
3772 # @BlockdevCreateOptionsVdi:
3774 # Driver specific image creation options for VDI.
3776 # @file Node to create the image format on
3777 # @size Size of the virtual disk in bytes
3778 # @static Whether to create a statically (true) or
3779 # dynamically (false) allocated image
3780 # (default: false, i.e. dynamic)
3784 { 'struct': 'BlockdevCreateOptionsVdi',
3785 'data': { 'file': 'BlockdevRef',
3787 '*static': 'bool' } }
3790 # @BlockdevCreateNotSupported:
3792 # This is used for all drivers that don't support creating images.
3796 { 'struct': 'BlockdevCreateNotSupported', 'data': {}}
3799 # @BlockdevCreateOptions:
3801 # Options for creating an image format on a given node.
3803 # @driver block driver to create the image format
3807 { 'union': 'BlockdevCreateOptions',
3809 'driver': 'BlockdevDriver' },
3810 'discriminator': 'driver',
3812 'blkdebug': 'BlockdevCreateNotSupported',
3813 'blkverify': 'BlockdevCreateNotSupported',
3814 'bochs': 'BlockdevCreateNotSupported',
3815 'cloop': 'BlockdevCreateNotSupported',
3816 'dmg': 'BlockdevCreateNotSupported',
3817 'file': 'BlockdevCreateOptionsFile',
3818 'ftp': 'BlockdevCreateNotSupported',
3819 'ftps': 'BlockdevCreateNotSupported',
3820 'gluster': 'BlockdevCreateOptionsGluster',
3821 'host_cdrom': 'BlockdevCreateNotSupported',
3822 'host_device': 'BlockdevCreateNotSupported',
3823 'http': 'BlockdevCreateNotSupported',
3824 'https': 'BlockdevCreateNotSupported',
3825 'iscsi': 'BlockdevCreateNotSupported',
3826 'luks': 'BlockdevCreateOptionsLUKS',
3827 'nbd': 'BlockdevCreateNotSupported',
3828 'nfs': 'BlockdevCreateOptionsNfs',
3829 'null-aio': 'BlockdevCreateNotSupported',
3830 'null-co': 'BlockdevCreateNotSupported',
3831 'nvme': 'BlockdevCreateNotSupported',
3832 'parallels': 'BlockdevCreateNotSupported',
3833 'qcow2': 'BlockdevCreateOptionsQcow2',
3834 'qcow': 'BlockdevCreateNotSupported',
3835 'qed': 'BlockdevCreateNotSupported',
3836 'quorum': 'BlockdevCreateNotSupported',
3837 'raw': 'BlockdevCreateNotSupported',
3838 'rbd': 'BlockdevCreateOptionsRbd',
3839 'replication': 'BlockdevCreateNotSupported',
3840 'sheepdog': 'BlockdevCreateOptionsSheepdog',
3841 'ssh': 'BlockdevCreateOptionsSsh',
3842 'throttle': 'BlockdevCreateNotSupported',
3843 'vdi': 'BlockdevCreateOptionsVdi',
3844 'vhdx': 'BlockdevCreateNotSupported',
3845 'vmdk': 'BlockdevCreateNotSupported',
3846 'vpc': 'BlockdevCreateNotSupported',
3847 'vvfat': 'BlockdevCreateNotSupported',
3848 'vxhs': 'BlockdevCreateNotSupported'
3852 # @x-blockdev-create:
3854 # Create an image format on a given node.
3855 # TODO Replace with something asynchronous (block job?)
3859 { 'command': 'x-blockdev-create',
3860 'data': 'BlockdevCreateOptions',
3864 # @blockdev-open-tray:
3866 # Opens a block device's tray. If there is a block driver state tree inserted as
3867 # a medium, it will become inaccessible to the guest (but it will remain
3868 # associated to the block device, so closing the tray will make it accessible
3871 # If the tray was already open before, this will be a no-op.
3873 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
3874 # which no such event will be generated, these include:
3875 # - if the guest has locked the tray, @force is false and the guest does not
3876 # respond to the eject request
3877 # - if the BlockBackend denoted by @device does not have a guest device attached
3879 # - if the guest device does not have an actual tray
3881 # @device: Block device name (deprecated, use @id instead)
3883 # @id: The name or QOM path of the guest device (since: 2.8)
3885 # @force: if false (the default), an eject request will be sent to
3886 # the guest if it has locked the tray (and the tray will not be opened
3887 # immediately); if true, the tray will be opened regardless of whether
3894 # -> { "execute": "blockdev-open-tray",
3895 # "arguments": { "id": "ide0-1-0" } }
3897 # <- { "timestamp": { "seconds": 1418751016,
3898 # "microseconds": 716996 },
3899 # "event": "DEVICE_TRAY_MOVED",
3900 # "data": { "device": "ide1-cd0",
3902 # "tray-open": true } }
3904 # <- { "return": {} }
3907 { 'command': 'blockdev-open-tray',
3908 'data': { '*device': 'str',
3910 '*force': 'bool' } }
3913 # @blockdev-close-tray:
3915 # Closes a block device's tray. If there is a block driver state tree associated
3916 # with the block device (which is currently ejected), that tree will be loaded
3919 # If the tray was already closed before, this will be a no-op.
3921 # @device: Block device name (deprecated, use @id instead)
3923 # @id: The name or QOM path of the guest device (since: 2.8)
3929 # -> { "execute": "blockdev-close-tray",
3930 # "arguments": { "id": "ide0-1-0" } }
3932 # <- { "timestamp": { "seconds": 1418751345,
3933 # "microseconds": 272147 },
3934 # "event": "DEVICE_TRAY_MOVED",
3935 # "data": { "device": "ide1-cd0",
3937 # "tray-open": false } }
3939 # <- { "return": {} }
3942 { 'command': 'blockdev-close-tray',
3943 'data': { '*device': 'str',
3947 # @blockdev-remove-medium:
3949 # Removes a medium (a block driver state tree) from a block device. That block
3950 # device's tray must currently be open (unless there is no attached guest
3953 # If the tray is open and there is no medium inserted, this will be a no-op.
3955 # @id: The name or QOM path of the guest device
3961 # -> { "execute": "blockdev-remove-medium",
3962 # "arguments": { "id": "ide0-1-0" } }
3964 # <- { "error": { "class": "GenericError",
3965 # "desc": "Tray of device 'ide0-1-0' is not open" } }
3967 # -> { "execute": "blockdev-open-tray",
3968 # "arguments": { "id": "ide0-1-0" } }
3970 # <- { "timestamp": { "seconds": 1418751627,
3971 # "microseconds": 549958 },
3972 # "event": "DEVICE_TRAY_MOVED",
3973 # "data": { "device": "ide1-cd0",
3975 # "tray-open": true } }
3977 # <- { "return": {} }
3979 # -> { "execute": "blockdev-remove-medium",
3980 # "arguments": { "id": "ide0-1-0" } }
3982 # <- { "return": {} }
3985 { 'command': 'blockdev-remove-medium',
3986 'data': { 'id': 'str' } }
3989 # @blockdev-insert-medium:
3991 # Inserts a medium (a block driver state tree) into a block device. That block
3992 # device's tray must currently be open (unless there is no attached guest
3993 # device) and there must be no medium inserted already.
3995 # @id: The name or QOM path of the guest device
3997 # @node-name: name of a node in the block driver state graph
4003 # -> { "execute": "blockdev-add",
4005 # "node-name": "node0",
4007 # "file": { "driver": "file",
4008 # "filename": "fedora.iso" } } }
4009 # <- { "return": {} }
4011 # -> { "execute": "blockdev-insert-medium",
4012 # "arguments": { "id": "ide0-1-0",
4013 # "node-name": "node0" } }
4015 # <- { "return": {} }
4018 { 'command': 'blockdev-insert-medium',
4019 'data': { 'id': 'str',
4020 'node-name': 'str'} }
4024 # @BlockdevChangeReadOnlyMode:
4026 # Specifies the new read-only mode of a block device subject to the
4027 # @blockdev-change-medium command.
4029 # @retain: Retains the current read-only mode
4031 # @read-only: Makes the device read-only
4033 # @read-write: Makes the device writable
4038 { 'enum': 'BlockdevChangeReadOnlyMode',
4039 'data': ['retain', 'read-only', 'read-write'] }
4043 # @blockdev-change-medium:
4045 # Changes the medium inserted into a block device by ejecting the current medium
4046 # and loading a new image file which is inserted as the new medium (this command
4047 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
4048 # and blockdev-close-tray).
4050 # @device: Block device name (deprecated, use @id instead)
4052 # @id: The name or QOM path of the guest device
4055 # @filename: filename of the new image to be loaded
4057 # @format: format to open the new image with (defaults to
4058 # the probed format)
4060 # @read-only-mode: change the read-only mode of the device; defaults
4067 # 1. Change a removable medium
4069 # -> { "execute": "blockdev-change-medium",
4070 # "arguments": { "id": "ide0-1-0",
4071 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4072 # "format": "raw" } }
4073 # <- { "return": {} }
4075 # 2. Load a read-only medium into a writable drive
4077 # -> { "execute": "blockdev-change-medium",
4078 # "arguments": { "id": "floppyA",
4079 # "filename": "/srv/images/ro.img",
4081 # "read-only-mode": "retain" } }
4084 # { "class": "GenericError",
4085 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4087 # -> { "execute": "blockdev-change-medium",
4088 # "arguments": { "id": "floppyA",
4089 # "filename": "/srv/images/ro.img",
4091 # "read-only-mode": "read-only" } }
4093 # <- { "return": {} }
4096 { 'command': 'blockdev-change-medium',
4097 'data': { '*device': 'str',
4101 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
4105 # @BlockErrorAction:
4107 # An enumeration of action that has been taken when a DISK I/O occurs
4109 # @ignore: error has been ignored
4111 # @report: error has been reported to the device
4113 # @stop: error caused VM to be stopped
4117 { 'enum': 'BlockErrorAction',
4118 'data': [ 'ignore', 'report', 'stop' ] }
4122 # @BLOCK_IMAGE_CORRUPTED:
4124 # Emitted when a disk image is being marked corrupt. The image can be
4125 # identified by its device or node name. The 'device' field is always
4126 # present for compatibility reasons, but it can be empty ("") if the
4127 # image does not have a device name associated.
4129 # @device: device name. This is always present for compatibility
4130 # reasons, but it can be empty ("") if the image does not
4131 # have a device name associated.
4133 # @node-name: node name (Since: 2.4)
4135 # @msg: informative message for human consumption, such as the kind of
4136 # corruption being detected. It should not be parsed by machine as it is
4137 # not guaranteed to be stable
4139 # @offset: if the corruption resulted from an image access, this is
4140 # the host's access offset into the image
4142 # @size: if the corruption resulted from an image access, this is
4145 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4146 # event and must be repaired (Since 2.2; before, every
4147 # BLOCK_IMAGE_CORRUPTED event was fatal)
4149 # Note: If action is "stop", a STOP event will eventually follow the
4150 # BLOCK_IO_ERROR event.
4154 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4155 # "data": { "device": "ide0-hd0", "node-name": "node0",
4156 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4158 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4162 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4163 'data': { 'device' : 'str',
4164 '*node-name' : 'str',
4168 'fatal' : 'bool' } }
4173 # Emitted when a disk I/O error occurs
4175 # @device: device name. This is always present for compatibility
4176 # reasons, but it can be empty ("") if the image does not
4177 # have a device name associated.
4179 # @node-name: node name. Note that errors may be reported for the root node
4180 # that is directly attached to a guest device rather than for the
4181 # node where the error occurred. The node name is not present if
4182 # the drive is empty. (Since: 2.8)
4184 # @operation: I/O operation
4186 # @action: action that has been taken
4188 # @nospace: true if I/O error was caused due to a no-space
4189 # condition. This key is only present if query-block's
4190 # io-status is present, please see query-block documentation
4191 # for more information (since: 2.2)
4193 # @reason: human readable string describing the error cause.
4194 # (This field is a debugging aid for humans, it should not
4195 # be parsed by applications) (since: 2.2)
4197 # Note: If action is "stop", a STOP event will eventually follow the
4198 # BLOCK_IO_ERROR event
4204 # <- { "event": "BLOCK_IO_ERROR",
4205 # "data": { "device": "ide0-hd1",
4206 # "node-name": "#block212",
4207 # "operation": "write",
4208 # "action": "stop" },
4209 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4212 { 'event': 'BLOCK_IO_ERROR',
4213 'data': { 'device': 'str', '*node-name': 'str',
4214 'operation': 'IoOperationType',
4215 'action': 'BlockErrorAction', '*nospace': 'bool',
4219 # @BLOCK_JOB_COMPLETED:
4221 # Emitted when a block job has completed
4225 # @device: The job identifier. Originally the device name but other
4226 # values are allowed since QEMU 2.7
4228 # @len: maximum progress value
4230 # @offset: current progress value. On success this is equal to len.
4231 # On failure this is less than len
4233 # @speed: rate limit, bytes per second
4235 # @error: error message. Only present on failure. This field
4236 # contains a human-readable error message. There are no semantics
4237 # other than that streaming has failed and clients should not try to
4238 # interpret the error string
4244 # <- { "event": "BLOCK_JOB_COMPLETED",
4245 # "data": { "type": "stream", "device": "virtio-disk0",
4246 # "len": 10737418240, "offset": 10737418240,
4248 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4251 { 'event': 'BLOCK_JOB_COMPLETED',
4252 'data': { 'type' : 'BlockJobType',
4260 # @BLOCK_JOB_CANCELLED:
4262 # Emitted when a block job has been cancelled
4266 # @device: The job identifier. Originally the device name but other
4267 # values are allowed since QEMU 2.7
4269 # @len: maximum progress value
4271 # @offset: current progress value. On success this is equal to len.
4272 # On failure this is less than len
4274 # @speed: rate limit, bytes per second
4280 # <- { "event": "BLOCK_JOB_CANCELLED",
4281 # "data": { "type": "stream", "device": "virtio-disk0",
4282 # "len": 10737418240, "offset": 134217728,
4284 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4287 { 'event': 'BLOCK_JOB_CANCELLED',
4288 'data': { 'type' : 'BlockJobType',
4297 # Emitted when a block job encounters an error
4299 # @device: The job identifier. Originally the device name but other
4300 # values are allowed since QEMU 2.7
4302 # @operation: I/O operation
4304 # @action: action that has been taken
4310 # <- { "event": "BLOCK_JOB_ERROR",
4311 # "data": { "device": "ide0-hd1",
4312 # "operation": "write",
4313 # "action": "stop" },
4314 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4317 { 'event': 'BLOCK_JOB_ERROR',
4318 'data': { 'device' : 'str',
4319 'operation': 'IoOperationType',
4320 'action' : 'BlockErrorAction' } }
4325 # Emitted when a block job is ready to complete
4329 # @device: The job identifier. Originally the device name but other
4330 # values are allowed since QEMU 2.7
4332 # @len: maximum progress value
4334 # @offset: current progress value. On success this is equal to len.
4335 # On failure this is less than len
4337 # @speed: rate limit, bytes per second
4339 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
4346 # <- { "event": "BLOCK_JOB_READY",
4347 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
4348 # "len": 2097152, "offset": 2097152 }
4349 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4352 { 'event': 'BLOCK_JOB_READY',
4353 'data': { 'type' : 'BlockJobType',
4360 # @BLOCK_JOB_PENDING:
4362 # Emitted when a block job is awaiting explicit authorization to finalize graph
4363 # changes via @block-job-finalize. If this job is part of a transaction, it will
4364 # not emit this event until the transaction has converged first.
4368 # @id: The job identifier.
4374 # <- { "event": "BLOCK_JOB_WAITING",
4375 # "data": { "device": "drive0", "type": "mirror" },
4376 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4379 { 'event': 'BLOCK_JOB_PENDING',
4380 'data': { 'type' : 'BlockJobType',
4386 # Preallocation mode of QEMU image file
4388 # @off: no preallocation
4389 # @metadata: preallocate only for metadata
4390 # @falloc: like @full preallocation but allocate disk space by
4391 # posix_fallocate() rather than writing zeros.
4392 # @full: preallocate all data by writing zeros to device to ensure disk
4393 # space is really available. @full preallocation also sets up
4394 # metadata correctly.
4398 { 'enum': 'PreallocMode',
4399 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
4402 # @BLOCK_WRITE_THRESHOLD:
4404 # Emitted when writes on block device reaches or exceeds the
4405 # configured write threshold. For thin-provisioned devices, this
4406 # means the device should be extended to avoid pausing for
4408 # The event is one shot. Once triggered, it needs to be
4409 # re-registered with another block-set-write-threshold command.
4411 # @node-name: graph node name on which the threshold was exceeded.
4413 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
4415 # @write-threshold: last configured threshold, in bytes.
4419 { 'event': 'BLOCK_WRITE_THRESHOLD',
4420 'data': { 'node-name': 'str',
4421 'amount-exceeded': 'uint64',
4422 'write-threshold': 'uint64' } }
4425 # @block-set-write-threshold:
4427 # Change the write threshold for a block drive. An event will be
4428 # delivered if a write to this block drive crosses the configured
4429 # threshold. The threshold is an offset, thus must be
4430 # non-negative. Default is no write threshold. Setting the threshold
4431 # to zero disables it.
4433 # This is useful to transparently resize thin-provisioned drives without
4434 # the guest OS noticing.
4436 # @node-name: graph node name on which the threshold must be set.
4438 # @write-threshold: configured threshold for the block device, bytes.
4439 # Use 0 to disable the threshold.
4445 # -> { "execute": "block-set-write-threshold",
4446 # "arguments": { "node-name": "mydev",
4447 # "write-threshold": 17179869184 } }
4448 # <- { "return": {} }
4451 { 'command': 'block-set-write-threshold',
4452 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
4455 # @x-blockdev-change:
4457 # Dynamically reconfigure the block driver state graph. It can be used
4458 # to add, remove, insert or replace a graph node. Currently only the
4459 # Quorum driver implements this feature to add or remove its child. This
4460 # is useful to fix a broken quorum child.
4462 # If @node is specified, it will be inserted under @parent. @child
4463 # may not be specified in this case. If both @parent and @child are
4464 # specified but @node is not, @child will be detached from @parent.
4466 # @parent: the id or name of the parent node.
4468 # @child: the name of a child under the given parent node.
4470 # @node: the name of the node that will be added.
4472 # Note: this command is experimental, and its API is not stable. It
4473 # does not support all kinds of operations, all kinds of children, nor
4474 # all block drivers.
4476 # FIXME Removing children from a quorum node means introducing gaps in the
4477 # child indices. This cannot be represented in the 'children' list of
4478 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
4480 # Warning: The data in a new quorum child MUST be consistent with that of
4481 # the rest of the array.
4487 # 1. Add a new node to a quorum
4488 # -> { "execute": "blockdev-add",
4491 # "node-name": "new_node",
4492 # "file": { "driver": "file",
4493 # "filename": "test.raw" } } }
4494 # <- { "return": {} }
4495 # -> { "execute": "x-blockdev-change",
4496 # "arguments": { "parent": "disk1",
4497 # "node": "new_node" } }
4498 # <- { "return": {} }
4500 # 2. Delete a quorum's node
4501 # -> { "execute": "x-blockdev-change",
4502 # "arguments": { "parent": "disk1",
4503 # "child": "children.1" } }
4504 # <- { "return": {} }
4507 { 'command': 'x-blockdev-change',
4508 'data' : { 'parent': 'str',
4513 # @x-blockdev-set-iothread:
4515 # Move @node and its children into the @iothread. If @iothread is null then
4516 # move @node and its children into the main loop.
4518 # The node must not be attached to a BlockBackend.
4520 # @node-name: the name of the block driver node
4522 # @iothread: the name of the IOThread object or null for the main loop
4524 # @force: true if the node and its children should be moved when a BlockBackend
4525 # is already attached
4527 # Note: this command is experimental and intended for test cases that need
4528 # control over IOThreads only.
4534 # 1. Move a node into an IOThread
4535 # -> { "execute": "x-blockdev-set-iothread",
4536 # "arguments": { "node-name": "disk1",
4537 # "iothread": "iothread0" } }
4538 # <- { "return": {} }
4540 # 2. Move a node into the main loop
4541 # -> { "execute": "x-blockdev-set-iothread",
4542 # "arguments": { "node-name": "disk1",
4543 # "iothread": null } }
4544 # <- { "return": {} }
4547 { 'command': 'x-blockdev-set-iothread',
4548 'data' : { 'node-name': 'str',
4549 'iothread': 'StrOrNull',
4550 '*force': 'bool' } }