4 # == Block core (VM unrelated)
7 { 'include': 'common.json' }
8 { 'include': 'crypto.json' }
9 { 'include': 'job.json' }
10 { 'include': 'sockets.json' }
15 # @id: unique snapshot id
17 # @name: user chosen name
19 # @vm-state-size: size of the VM state
21 # @date-sec: UTC date of the snapshot in seconds
23 # @date-nsec: fractional part in nano seconds to be used with date-sec
25 # @vm-clock-sec: VM clock relative to boot in seconds
27 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
32 { 'struct': 'SnapshotInfo',
33 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
34 'date-sec': 'int', 'date-nsec': 'int',
35 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
38 # @ImageInfoSpecificQCow2EncryptionBase:
40 # @format: The encryption format
44 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
45 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
48 # @ImageInfoSpecificQCow2Encryption:
52 { 'union': 'ImageInfoSpecificQCow2Encryption',
53 'base': 'ImageInfoSpecificQCow2EncryptionBase',
54 'discriminator': 'format',
55 'data': { 'luks': 'QCryptoBlockInfoLUKS' } }
58 # @ImageInfoSpecificQCow2:
60 # @compat: compatibility level
62 # @data-file: the filename of the external data file that is stored in the
63 # image and used as a default for opening the image (since: 4.0)
65 # @data-file-raw: True if the external data file must stay valid as a
66 # standalone (read-only) raw image without looking at qcow2
67 # metadata (since: 4.0)
69 # @lazy-refcounts: on or off; only valid for compat >= 1.1
71 # @corrupt: true if the image has been marked corrupt; only valid for
72 # compat >= 1.1 (since 2.2)
74 # @refcount-bits: width of a refcount entry in bits (since 2.3)
76 # @encrypt: details about encryption parameters; only set if image
77 # is encrypted (since 2.10)
79 # @bitmaps: A list of qcow2 bitmap details (since 4.0)
83 { 'struct': 'ImageInfoSpecificQCow2',
87 '*data-file-raw': 'bool',
88 '*lazy-refcounts': 'bool',
90 'refcount-bits': 'int',
91 '*encrypt': 'ImageInfoSpecificQCow2Encryption',
92 '*bitmaps': ['Qcow2BitmapInfo']
96 # @ImageInfoSpecificVmdk:
98 # @create-type: The create type of VMDK image
100 # @cid: Content id of image
102 # @parent-cid: Parent VMDK image's cid
104 # @extents: List of extent files
108 { 'struct': 'ImageInfoSpecificVmdk',
110 'create-type': 'str',
113 'extents': ['ImageInfo']
117 # @ImageInfoSpecific:
119 # A discriminated record of image format specific information structures.
123 { 'union': 'ImageInfoSpecific',
125 'qcow2': 'ImageInfoSpecificQCow2',
126 'vmdk': 'ImageInfoSpecificVmdk',
127 # If we need to add block driver specific parameters for
128 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
129 # to define a ImageInfoSpecificLUKS
130 'luks': 'QCryptoBlockInfoLUKS'
136 # Information about a QEMU image file
138 # @filename: name of the image file
140 # @format: format of the image file
142 # @virtual-size: maximum capacity in bytes of the image
144 # @actual-size: actual size on disk in bytes of the image
146 # @dirty-flag: true if image is not cleanly closed
148 # @cluster-size: size of a cluster in bytes
150 # @encrypted: true if the image is encrypted
152 # @compressed: true if the image is compressed (Since 1.7)
154 # @backing-filename: name of the backing file
156 # @full-backing-filename: full path of the backing file
158 # @backing-filename-format: the format of the backing file
160 # @snapshots: list of VM snapshots
162 # @backing-image: info of the backing image (since 1.6)
164 # @format-specific: structure supplying additional format-specific
165 # information (since 1.7)
170 { 'struct': 'ImageInfo',
171 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
172 '*actual-size': 'int', 'virtual-size': 'int',
173 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
174 '*backing-filename': 'str', '*full-backing-filename': 'str',
175 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
176 '*backing-image': 'ImageInfo',
177 '*format-specific': 'ImageInfoSpecific' } }
182 # Information about a QEMU image file check
184 # @filename: name of the image file checked
186 # @format: format of the image file checked
188 # @check-errors: number of unexpected errors occurred during check
190 # @image-end-offset: offset (in bytes) where the image ends, this
191 # field is present if the driver for the image format
194 # @corruptions: number of corruptions found during the check if any
196 # @leaks: number of leaks found during the check if any
198 # @corruptions-fixed: number of corruptions fixed during the check
201 # @leaks-fixed: number of leaks fixed during the check if any
203 # @total-clusters: total number of clusters, this field is present
204 # if the driver for the image format supports it
206 # @allocated-clusters: total number of allocated clusters, this
207 # field is present if the driver for the image format
210 # @fragmented-clusters: total number of fragmented clusters, this
211 # field is present if the driver for the image format
214 # @compressed-clusters: total number of compressed clusters, this
215 # field is present if the driver for the image format
221 { 'struct': 'ImageCheck',
222 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
223 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
224 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
225 '*total-clusters': 'int', '*allocated-clusters': 'int',
226 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
231 # Mapping information from a virtual block range to a host file range
233 # @start: the start byte of the mapped virtual range
235 # @length: the number of bytes of the mapped virtual range
237 # @data: whether the mapped range has data
239 # @zero: whether the virtual blocks are zeroed
241 # @depth: the depth of the mapping
243 # @offset: the offset in file that the virtual sectors are mapped to
245 # @filename: filename that is referred to by @offset
250 { 'struct': 'MapEntry',
251 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
252 'zero': 'bool', 'depth': 'int', '*offset': 'int',
253 '*filename': 'str' } }
256 # @BlockdevCacheInfo:
258 # Cache mode information for a block device
260 # @writeback: true if writeback mode is enabled
261 # @direct: true if the host page cache is bypassed (O_DIRECT)
262 # @no-flush: true if flush requests are ignored for the device
266 { 'struct': 'BlockdevCacheInfo',
267 'data': { 'writeback': 'bool',
269 'no-flush': 'bool' } }
274 # Information about the backing device for a block device.
276 # @file: the filename of the backing device
278 # @node-name: the name of the block driver node (Since 2.0)
280 # @ro: true if the backing device was open read-only
282 # @drv: the name of the block format used to open the backing device. As of
283 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
284 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
285 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
286 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
287 # 2.2: 'archipelago' added, 'cow' dropped
288 # 2.3: 'host_floppy' deprecated
289 # 2.5: 'host_floppy' dropped
291 # 2.8: 'replication' added, 'tftp' dropped
292 # 2.9: 'archipelago' dropped
294 # @backing_file: the name of the backing file (for copy-on-write)
296 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
298 # @encrypted: true if the backing device is encrypted
300 # @encryption_key_missing: Deprecated; always false
302 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
304 # @bps: total throughput limit in bytes per second is specified
306 # @bps_rd: read throughput limit in bytes per second is specified
308 # @bps_wr: write throughput limit in bytes per second is specified
310 # @iops: total I/O operations per second is specified
312 # @iops_rd: read I/O operations per second is specified
314 # @iops_wr: write I/O operations per second is specified
316 # @image: the info of image used (since: 1.6)
318 # @bps_max: total throughput limit during bursts,
319 # in bytes (Since 1.7)
321 # @bps_rd_max: read throughput limit during bursts,
322 # in bytes (Since 1.7)
324 # @bps_wr_max: write throughput limit during bursts,
325 # in bytes (Since 1.7)
327 # @iops_max: total I/O operations per second during bursts,
328 # in bytes (Since 1.7)
330 # @iops_rd_max: read I/O operations per second during bursts,
331 # in bytes (Since 1.7)
333 # @iops_wr_max: write I/O operations per second during bursts,
334 # in bytes (Since 1.7)
336 # @bps_max_length: maximum length of the @bps_max burst
337 # period, in seconds. (Since 2.6)
339 # @bps_rd_max_length: maximum length of the @bps_rd_max
340 # burst period, in seconds. (Since 2.6)
342 # @bps_wr_max_length: maximum length of the @bps_wr_max
343 # burst period, in seconds. (Since 2.6)
345 # @iops_max_length: maximum length of the @iops burst
346 # period, in seconds. (Since 2.6)
348 # @iops_rd_max_length: maximum length of the @iops_rd_max
349 # burst period, in seconds. (Since 2.6)
351 # @iops_wr_max_length: maximum length of the @iops_wr_max
352 # burst period, in seconds. (Since 2.6)
354 # @iops_size: an I/O size in bytes (Since 1.7)
356 # @group: throttle group name (Since 2.4)
358 # @cache: the cache mode used for the block device (since: 2.3)
360 # @write_threshold: configured write threshold for the device.
361 # 0 if disabled. (Since 2.3)
366 { 'struct': 'BlockDeviceInfo',
367 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
368 '*backing_file': 'str', 'backing_file_depth': 'int',
369 'encrypted': 'bool', 'encryption_key_missing': 'bool',
370 'detect_zeroes': 'BlockdevDetectZeroesOptions',
371 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
372 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
373 'image': 'ImageInfo',
374 '*bps_max': 'int', '*bps_rd_max': 'int',
375 '*bps_wr_max': 'int', '*iops_max': 'int',
376 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
377 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
378 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
379 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
380 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
381 'write_threshold': 'int' } }
384 # @BlockDeviceIoStatus:
386 # An enumeration of block device I/O status.
388 # @ok: The last I/O operation has succeeded
390 # @failed: The last I/O operation has failed
392 # @nospace: The last I/O operation has failed due to a no-space condition
396 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
399 # @BlockDeviceMapEntry:
401 # Entry in the metadata map of the device (returned by "qemu-img map")
403 # @start: Offset in the image of the first byte described by this entry
406 # @length: Length of the range described by this entry (in bytes)
408 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
409 # before reaching one for which the range is allocated. The value is
410 # in the range 0 to the depth of the image chain - 1.
412 # @zero: the sectors in this range read as zeros
414 # @data: reading the image will actually read data from a file (in particular,
415 # if @offset is present this means that the sectors are not simply
416 # preallocated, but contain actual data in raw format)
418 # @offset: if present, the image file stores the data for this range in
419 # raw format at the given offset.
423 { 'struct': 'BlockDeviceMapEntry',
424 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
425 'data': 'bool', '*offset': 'int' } }
428 # @DirtyBitmapStatus:
430 # An enumeration of possible states that a dirty bitmap can report to the user.
432 # @frozen: The bitmap is currently in-use by some operation and is immutable.
433 # If the bitmap was @active prior to the operation, new writes by the
434 # guest are being recorded in a temporary buffer, and will not be lost.
435 # Generally, bitmaps are cleared on successful use in an operation and
436 # the temporary buffer is committed into the bitmap. On failure, the
437 # temporary buffer is merged back into the bitmap without first
439 # Please refer to the documentation for each bitmap-using operation,
440 # See also @blockdev-backup, @drive-backup.
442 # @disabled: The bitmap is not currently recording new writes by the guest.
443 # This is requested explicitly via @block-dirty-bitmap-disable.
444 # It can still be cleared, deleted, or used for backup operations.
446 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
447 # deleted, or used for backup operations.
449 # @locked: The bitmap is currently in-use by some operation and is immutable.
450 # If the bitmap was @active prior to the operation, it is still
451 # recording new writes. If the bitmap was @disabled, it is not
452 # recording new writes. (Since 2.12)
456 { 'enum': 'DirtyBitmapStatus',
457 'data': ['active', 'disabled', 'frozen', 'locked'] }
462 # Block dirty bitmap information.
464 # @name: the name of the dirty bitmap (Since 2.4)
466 # @count: number of dirty bytes according to the dirty bitmap
468 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
470 # @status: current status of the dirty bitmap (since 2.4)
472 # @persistent: true if the bitmap will eventually be flushed to persistent
473 # storage (since 4.0)
477 { 'struct': 'BlockDirtyInfo',
478 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
479 'status': 'DirtyBitmapStatus', 'persistent': 'bool' } }
482 # @Qcow2BitmapInfoFlags:
484 # An enumeration of flags that a bitmap can report to the user.
486 # @in-use: This flag is set by any process actively modifying the qcow2 file,
487 # and cleared when the updated bitmap is flushed to the qcow2 image.
488 # The presence of this flag in an offline image means that the bitmap
489 # was not saved correctly after its last usage, and may contain
492 # @auto: The bitmap must reflect all changes of the virtual disk by any
493 # application that would write to this qcow2 file.
497 { 'enum': 'Qcow2BitmapInfoFlags',
498 'data': ['in-use', 'auto'] }
503 # Qcow2 bitmap information.
505 # @name: the name of the bitmap
507 # @granularity: granularity of the bitmap in bytes
509 # @flags: flags of the bitmap
513 { 'struct': 'Qcow2BitmapInfo',
514 'data': {'name': 'str', 'granularity': 'uint32',
515 'flags': ['Qcow2BitmapInfoFlags'] } }
518 # @BlockLatencyHistogramInfo:
520 # Block latency histogram.
522 # @boundaries: list of interval boundary values in nanoseconds, all greater
523 # than zero and in ascending order.
524 # For example, the list [10, 50, 100] produces the following
525 # histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
527 # @bins: list of io request counts corresponding to histogram intervals.
528 # len(@bins) = len(@boundaries) + 1
529 # For the example above, @bins may be something like [3, 1, 5, 2],
530 # and corresponding histogram looks like:
537 # +------------------
542 { 'struct': 'BlockLatencyHistogramInfo',
543 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
546 # @block-latency-histogram-set:
548 # Manage read, write and flush latency histograms for the device.
550 # If only @device parameter is specified, remove all present latency histograms
551 # for the device. Otherwise, add/reset some of (or all) latency histograms.
553 # @id: The name or QOM path of the guest device.
555 # @boundaries: list of interval boundary values (see description in
556 # BlockLatencyHistogramInfo definition). If specified, all
557 # latency histograms are removed, and empty ones created for all
558 # io types with intervals corresponding to @boundaries (except for
559 # io types, for which specific boundaries are set through the
560 # following parameters).
562 # @boundaries-read: list of interval boundary values for read latency
563 # histogram. If specified, old read latency histogram is
564 # removed, and empty one created with intervals
565 # corresponding to @boundaries-read. The parameter has higher
566 # priority then @boundaries.
568 # @boundaries-write: list of interval boundary values for write latency
571 # @boundaries-flush: list of interval boundary values for flush latency
574 # Returns: error if device is not found or any boundary arrays are invalid.
578 # Example: set new histograms for all io types with intervals
579 # [0, 10), [10, 50), [50, 100), [100, +inf):
581 # -> { "execute": "block-latency-histogram-set",
582 # "arguments": { "device": "drive0",
583 # "boundaries": [10, 50, 100] } }
584 # <- { "return": {} }
586 # Example: set new histogram only for write, other histograms will remain
587 # not changed (or not created):
589 # -> { "execute": "block-latency-histogram-set",
590 # "arguments": { "device": "drive0",
591 # "boundaries-write": [10, 50, 100] } }
592 # <- { "return": {} }
594 # Example: set new histograms with the following intervals:
595 # read, flush: [0, 10), [10, 50), [50, 100), [100, +inf)
596 # write: [0, 1000), [1000, 5000), [5000, +inf)
598 # -> { "execute": "block-latency-histogram-set",
599 # "arguments": { "device": "drive0",
600 # "boundaries": [10, 50, 100],
601 # "boundaries-write": [1000, 5000] } }
602 # <- { "return": {} }
604 # Example: remove all latency histograms:
606 # -> { "execute": "block-latency-histogram-set",
607 # "arguments": { "device": "drive0" } }
608 # <- { "return": {} }
610 { 'command': 'block-latency-histogram-set',
611 'data': {'id': 'str',
612 '*boundaries': ['uint64'],
613 '*boundaries-read': ['uint64'],
614 '*boundaries-write': ['uint64'],
615 '*boundaries-flush': ['uint64'] } }
620 # Block device information. This structure describes a virtual device and
621 # the backing device associated with it.
623 # @device: The device name associated with the virtual device.
625 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
626 # device. (since 2.10)
628 # @type: This field is returned only for compatibility reasons, it should
629 # not be used (always returns 'unknown')
631 # @removable: True if the device supports removable media.
633 # @locked: True if the guest has locked this device from having its media
636 # @tray_open: True if the device's tray is open
637 # (only present if it has a tray)
639 # @dirty-bitmaps: dirty bitmaps information (only present if the
640 # driver has one or more dirty bitmaps) (Since 2.0)
642 # @io-status: @BlockDeviceIoStatus. Only present if the device
643 # supports it and the VM is configured to stop on errors
644 # (supported device models: virtio-blk, IDE, SCSI except
647 # @inserted: @BlockDeviceInfo describing the device if media is
652 { 'struct': 'BlockInfo',
653 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
654 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
655 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
656 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
661 # Image file size calculation information. This structure describes the size
662 # requirements for creating a new image file.
664 # The size requirements depend on the new image file format. File size always
665 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
666 # Compact formats such as 'qcow2' represent unallocated and zero regions
667 # efficiently so file size may be smaller than virtual disk size.
669 # The values are upper bounds that are guaranteed to fit the new image file.
670 # Subsequent modification, such as internal snapshot or bitmap creation, may
671 # require additional space and is not covered here.
673 # @required: Size required for a new image file, in bytes.
675 # @fully-allocated: Image file size, in bytes, once data has been written
680 { 'struct': 'BlockMeasureInfo',
681 'data': {'required': 'int', 'fully-allocated': 'int'} }
686 # Get a list of BlockInfo for all virtual block devices.
688 # Returns: a list of @BlockInfo describing each virtual block device. Filter
689 # nodes that were created implicitly are skipped over.
695 # -> { "execute": "query-block" }
700 # "device":"ide0-hd0",
707 # "file":"disks/test.qcow2",
708 # "backing_file_depth":1,
715 # "bps_max": 8000000,
722 # "detect_zeroes": "on",
723 # "write_threshold": 0,
725 # "filename":"disks/test.qcow2",
727 # "virtual-size":2048000,
728 # "backing_file":"base.qcow2",
729 # "full-backing-filename":"disks/base.qcow2",
730 # "backing-filename-format":"qcow2",
734 # "name": "snapshot1",
735 # "vm-state-size": 0,
736 # "date-sec": 10000200,
738 # "vm-clock-sec": 206,
739 # "vm-clock-nsec": 30
743 # "filename":"disks/base.qcow2",
745 # "virtual-size":2048000
749 # "qdev": "ide_disk",
754 # "device":"ide1-cd0",
757 # "qdev": "/machine/unattached/device[23]",
758 # "tray_open": false,
762 # "device":"floppy0",
765 # "qdev": "/machine/unattached/device[20]",
778 { 'command': 'query-block', 'returns': ['BlockInfo'] }
782 # @BlockDeviceTimedStats:
784 # Statistics of a block device during a given interval of time.
786 # @interval_length: Interval used for calculating the statistics,
789 # @min_rd_latency_ns: Minimum latency of read operations in the
790 # defined interval, in nanoseconds.
792 # @min_wr_latency_ns: Minimum latency of write operations in the
793 # defined interval, in nanoseconds.
795 # @min_flush_latency_ns: Minimum latency of flush operations in the
796 # defined interval, in nanoseconds.
798 # @max_rd_latency_ns: Maximum latency of read operations in the
799 # defined interval, in nanoseconds.
801 # @max_wr_latency_ns: Maximum latency of write operations in the
802 # defined interval, in nanoseconds.
804 # @max_flush_latency_ns: Maximum latency of flush operations in the
805 # defined interval, in nanoseconds.
807 # @avg_rd_latency_ns: Average latency of read operations in the
808 # defined interval, in nanoseconds.
810 # @avg_wr_latency_ns: Average latency of write operations in the
811 # defined interval, in nanoseconds.
813 # @avg_flush_latency_ns: Average latency of flush operations in the
814 # defined interval, in nanoseconds.
816 # @avg_rd_queue_depth: Average number of pending read operations
817 # in the defined interval.
819 # @avg_wr_queue_depth: Average number of pending write operations
820 # in the defined interval.
824 { 'struct': 'BlockDeviceTimedStats',
825 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
826 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
827 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
828 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
829 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
830 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
835 # Statistics of a virtual block device or a block backing device.
837 # @rd_bytes: The number of bytes read by the device.
839 # @wr_bytes: The number of bytes written by the device.
841 # @rd_operations: The number of read operations performed by the device.
843 # @wr_operations: The number of write operations performed by the device.
845 # @flush_operations: The number of cache flush operations performed by the
846 # device (since 0.15.0)
848 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
851 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
853 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
855 # @wr_highest_offset: The offset after the greatest byte written to the
856 # device. The intended use of this information is for
857 # growable sparse files (like qcow2) that are used on top
858 # of a physical device.
860 # @rd_merged: Number of read requests that have been merged into another
861 # request (Since 2.3).
863 # @wr_merged: Number of write requests that have been merged into another
864 # request (Since 2.3).
866 # @idle_time_ns: Time since the last I/O operation, in
867 # nanoseconds. If the field is absent it means that
868 # there haven't been any operations yet (Since 2.5).
870 # @failed_rd_operations: The number of failed read operations
871 # performed by the device (Since 2.5)
873 # @failed_wr_operations: The number of failed write operations
874 # performed by the device (Since 2.5)
876 # @failed_flush_operations: The number of failed flush operations
877 # performed by the device (Since 2.5)
879 # @invalid_rd_operations: The number of invalid read operations
880 # performed by the device (Since 2.5)
882 # @invalid_wr_operations: The number of invalid write operations
883 # performed by the device (Since 2.5)
885 # @invalid_flush_operations: The number of invalid flush operations
886 # performed by the device (Since 2.5)
888 # @account_invalid: Whether invalid operations are included in the
889 # last access statistics (Since 2.5)
891 # @account_failed: Whether failed operations are included in the
892 # latency and last access statistics (Since 2.5)
894 # @timed_stats: Statistics specific to the set of previously defined
895 # intervals of time (Since 2.5)
897 # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
899 # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
901 # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
905 { 'struct': 'BlockDeviceStats',
906 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
907 'wr_operations': 'int', 'flush_operations': 'int',
908 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
909 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
910 'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
911 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
912 'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
913 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
914 'account_invalid': 'bool', 'account_failed': 'bool',
915 'timed_stats': ['BlockDeviceTimedStats'],
916 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
917 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
918 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
923 # Statistics of a virtual block device or a block backing device.
925 # @device: If the stats are for a virtual block device, the name
926 # corresponding to the virtual block device.
928 # @node-name: The node name of the device. (Since 2.3)
930 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
931 # device. (since 3.0)
933 # @stats: A @BlockDeviceStats for the device.
935 # @parent: This describes the file block device if it has one.
936 # Contains recursively the statistics of the underlying
937 # protocol (e.g. the host file for a qcow2 image). If there is
938 # no underlying protocol, this field is omitted
940 # @backing: This describes the backing block device if it has one.
945 { 'struct': 'BlockStats',
946 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
947 'stats': 'BlockDeviceStats',
948 '*parent': 'BlockStats',
949 '*backing': 'BlockStats'} }
954 # Query the @BlockStats for all virtual block devices.
956 # @query-nodes: If true, the command will query all the block nodes
957 # that have a node name, in a list which will include "parent"
958 # information, but not "backing".
959 # If false or omitted, the behavior is as before - query all the
960 # device backends, recursively including their "parent" and
961 # "backing". Filter nodes that were created implicitly are
962 # skipped over in this mode. (Since 2.3)
964 # Returns: A list of @BlockStats for each virtual block devices.
970 # -> { "execute": "query-blockstats" }
974 # "device":"ide0-hd0",
977 # "wr_highest_offset":3686448128,
978 # "wr_bytes":9786368,
979 # "wr_operations":751,
980 # "rd_bytes":122567168,
981 # "rd_operations":36772
982 # "wr_total_times_ns":313253456
983 # "rd_total_times_ns":3465673657
984 # "flush_total_times_ns":49653
985 # "flush_operations":61,
988 # "idle_time_ns":2953431879,
989 # "account_invalid":true,
990 # "account_failed":false
994 # "wr_highest_offset":2821110784,
995 # "wr_bytes":9786368,
996 # "wr_operations":692,
997 # "rd_bytes":122739200,
998 # "rd_operations":36604
999 # "flush_operations":51,
1000 # "wr_total_times_ns":313253456
1001 # "rd_total_times_ns":3465673657
1002 # "flush_total_times_ns":49653,
1005 # "idle_time_ns":2953431879,
1006 # "account_invalid":true,
1007 # "account_failed":false
1009 # "qdev": "/machine/unattached/device[23]"
1012 # "device":"ide1-cd0",
1014 # "wr_highest_offset":0,
1016 # "wr_operations":0,
1019 # "flush_operations":0,
1020 # "wr_total_times_ns":0
1021 # "rd_total_times_ns":0
1022 # "flush_total_times_ns":0,
1025 # "account_invalid":false,
1026 # "account_failed":false
1028 # "qdev": "/machine/unattached/device[24]"
1031 # "device":"floppy0",
1033 # "wr_highest_offset":0,
1035 # "wr_operations":0,
1038 # "flush_operations":0,
1039 # "wr_total_times_ns":0
1040 # "rd_total_times_ns":0
1041 # "flush_total_times_ns":0,
1044 # "account_invalid":false,
1045 # "account_failed":false
1047 # "qdev": "/machine/unattached/device[16]"
1052 # "wr_highest_offset":0,
1054 # "wr_operations":0,
1057 # "flush_operations":0,
1058 # "wr_total_times_ns":0
1059 # "rd_total_times_ns":0
1060 # "flush_total_times_ns":0,
1063 # "account_invalid":false,
1064 # "account_failed":false
1071 { 'command': 'query-blockstats',
1072 'data': { '*query-nodes': 'bool' },
1073 'returns': ['BlockStats'] }
1078 # An enumeration of possible behaviors for errors on I/O operations.
1079 # The exact meaning depends on whether the I/O was initiated by a guest
1082 # @report: for guest operations, report the error to the guest;
1083 # for jobs, cancel the job
1085 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1086 # or BLOCK_JOB_ERROR)
1088 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1090 # @stop: for guest operations, stop the virtual machine;
1091 # for jobs, pause the job
1093 # @auto: inherit the error handling policy of the backend (since: 2.7)
1097 { 'enum': 'BlockdevOnError',
1098 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1103 # An enumeration of possible behaviors for the initial synchronization
1104 # phase of storage mirroring.
1106 # @top: copies data in the topmost image to the destination
1108 # @full: copies data from all images to the destination
1110 # @none: only copy data written from now on
1112 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
1116 { 'enum': 'MirrorSyncMode',
1117 'data': ['top', 'full', 'none', 'incremental'] }
1122 # An enumeration whose values tell the mirror block job when to
1123 # trigger writes to the target.
1125 # @background: copy data in background only.
1127 # @write-blocking: when data is written to the source, write it
1128 # (synchronously) to the target as well. In
1129 # addition, data is copied in background just like in
1134 { 'enum': 'MirrorCopyMode',
1135 'data': ['background', 'write-blocking'] }
1140 # Information about a long-running block device operation.
1142 # @type: the job type ('stream' for image streaming)
1144 # @device: The job identifier. Originally the device name but other
1145 # values are allowed since QEMU 2.7
1147 # @len: Estimated @offset value at the completion of the job. This value can
1148 # arbitrarily change while the job is running, in both directions.
1150 # @offset: Progress made until now. The unit is arbitrary and the value can
1151 # only meaningfully be used for the ratio of @offset to @len. The
1152 # value is monotonically increasing.
1154 # @busy: false if the job is known to be in a quiescent state, with
1155 # no pending I/O. Since 1.3.
1157 # @paused: whether the job is paused or, if @busy is true, will
1158 # pause itself as soon as possible. Since 1.3.
1160 # @speed: the rate limit, bytes per second
1162 # @io-status: the status of the job (since 1.3)
1164 # @ready: true if the job may be completed (since 2.2)
1166 # @status: Current job state/status (since 2.12)
1168 # @auto-finalize: Job will finalize itself when PENDING, moving to
1169 # the CONCLUDED state. (since 2.12)
1171 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1172 # state and disappearing from the query list. (since 2.12)
1174 # @error: Error information if the job did not complete successfully.
1175 # Not set if the job completed successfully. (since 2.12.1)
1179 { 'struct': 'BlockJobInfo',
1180 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1181 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1182 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1183 'status': 'JobStatus',
1184 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1188 # @query-block-jobs:
1190 # Return information about long-running block device operations.
1192 # Returns: a list of @BlockJobInfo for each active block job
1196 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1201 # This command sets the password of a block device that has not been open
1202 # with a password and requires one.
1204 # This command is now obsolete and will always return an error since 2.10
1207 { 'command': 'block_passwd',
1208 'data': { '*device': 'str',
1209 '*node-name': 'str',
1210 'password': 'str' } }
1215 # Resize a block image while a guest is running.
1217 # Either @device or @node-name must be set but not both.
1219 # @device: the name of the device to get the image resized
1221 # @node-name: graph node name to get the image resized (Since 2.0)
1223 # @size: new image size in bytes
1225 # Returns: nothing on success
1226 # If @device is not a valid block device, DeviceNotFound
1232 # -> { "execute": "block_resize",
1233 # "arguments": { "device": "scratch", "size": 1073741824 } }
1234 # <- { "return": {} }
1237 { 'command': 'block_resize',
1238 'data': { '*device': 'str',
1239 '*node-name': 'str',
1245 # An enumeration that tells QEMU how to set the backing file path in
1248 # @existing: QEMU should look for an existing image file.
1250 # @absolute-paths: QEMU should create a new image with absolute paths
1251 # for the backing file. If there is no backing file available, the new
1252 # image will not be backed either.
1256 { 'enum': 'NewImageMode',
1257 'data': [ 'existing', 'absolute-paths' ] }
1260 # @BlockdevSnapshotSync:
1262 # Either @device or @node-name must be set but not both.
1264 # @device: the name of the device to generate the snapshot from.
1266 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1268 # @snapshot-file: the target of the new image. If the file exists, or
1269 # if it is a device, the snapshot will be created in the existing
1270 # file/device. Otherwise, a new file will be created.
1272 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1274 # @format: the format of the snapshot image, default is 'qcow2'.
1276 # @mode: whether and how QEMU should create a new image, default is
1279 { 'struct': 'BlockdevSnapshotSync',
1280 'data': { '*device': 'str', '*node-name': 'str',
1281 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1282 '*format': 'str', '*mode': 'NewImageMode' } }
1285 # @BlockdevSnapshot:
1287 # @node: device or node name that will have a snapshot created.
1289 # @overlay: reference to the existing block device that will become
1290 # the overlay of @node, as part of creating the snapshot.
1291 # It must not have a current backing file (this can be
1292 # achieved by passing "backing": null to blockdev-add).
1296 { 'struct': 'BlockdevSnapshot',
1297 'data': { 'node': 'str', 'overlay': 'str' } }
1302 # @job-id: identifier for the newly-created block job. If
1303 # omitted, the device name will be used. (Since 2.7)
1305 # @device: the device name or node-name of a root node which should be copied.
1307 # @target: the target of the new image. If the file exists, or if it
1308 # is a device, the existing file/device will be used as the new
1309 # destination. If it does not exist, a new file will be created.
1311 # @format: the format of the new destination, default is to
1312 # probe if @mode is 'existing', else the format of the source
1314 # @sync: what parts of the disk image should be copied to the destination
1315 # (all the disk, only the sectors allocated in the topmost image, from a
1316 # dirty bitmap, or only new I/O).
1318 # @mode: whether and how QEMU should create a new image, default is
1321 # @speed: the maximum speed, in bytes per second
1323 # @bitmap: the name of dirty bitmap if sync is "incremental".
1324 # Must be present if sync is "incremental", must NOT be present
1325 # otherwise. (Since 2.4)
1327 # @compress: true to compress data, if the target format supports it.
1328 # (default: false) (since 2.8)
1330 # @on-source-error: the action to take on an error on the source,
1331 # default 'report'. 'stop' and 'enospc' can only be used
1332 # if the block device supports io-status (see BlockInfo).
1334 # @on-target-error: the action to take on an error on the target,
1335 # default 'report' (no limitations, since this applies to
1336 # a different block device than @device).
1338 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1339 # finished its work, waiting for @block-job-finalize before
1340 # making any block graph changes.
1341 # When true, this job will automatically
1342 # perform its abort or commit actions.
1343 # Defaults to true. (Since 2.12)
1345 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1346 # has completely ceased all work, and awaits @block-job-dismiss.
1347 # When true, this job will automatically disappear from the query
1348 # list without user intervention.
1349 # Defaults to true. (Since 2.12)
1351 # Note: @on-source-error and @on-target-error only affect background
1352 # I/O. If an error occurs during a guest write request, the device's
1353 # rerror/werror actions will be used.
1357 { 'struct': 'DriveBackup',
1358 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1359 '*format': 'str', 'sync': 'MirrorSyncMode',
1360 '*mode': 'NewImageMode', '*speed': 'int',
1361 '*bitmap': 'str', '*compress': 'bool',
1362 '*on-source-error': 'BlockdevOnError',
1363 '*on-target-error': 'BlockdevOnError',
1364 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1369 # @job-id: identifier for the newly-created block job. If
1370 # omitted, the device name will be used. (Since 2.7)
1372 # @device: the device name or node-name of a root node which should be copied.
1374 # @target: the device name or node-name of the backup target node.
1376 # @sync: what parts of the disk image should be copied to the destination
1377 # (all the disk, only the sectors allocated in the topmost image, or
1380 # @speed: the maximum speed, in bytes per second. The default is 0,
1383 # @bitmap: the name of dirty bitmap if sync is "incremental".
1384 # Must be present if sync is "incremental", must NOT be present
1385 # otherwise. (Since 3.1)
1387 # @compress: true to compress data, if the target format supports it.
1388 # (default: false) (since 2.8)
1390 # @on-source-error: the action to take on an error on the source,
1391 # default 'report'. 'stop' and 'enospc' can only be used
1392 # if the block device supports io-status (see BlockInfo).
1394 # @on-target-error: the action to take on an error on the target,
1395 # default 'report' (no limitations, since this applies to
1396 # a different block device than @device).
1398 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1399 # finished its work, waiting for @block-job-finalize before
1400 # making any block graph changes.
1401 # When true, this job will automatically
1402 # perform its abort or commit actions.
1403 # Defaults to true. (Since 2.12)
1405 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1406 # has completely ceased all work, and awaits @block-job-dismiss.
1407 # When true, this job will automatically disappear from the query
1408 # list without user intervention.
1409 # Defaults to true. (Since 2.12)
1411 # Note: @on-source-error and @on-target-error only affect background
1412 # I/O. If an error occurs during a guest write request, the device's
1413 # rerror/werror actions will be used.
1417 { 'struct': 'BlockdevBackup',
1418 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1419 'sync': 'MirrorSyncMode', '*speed': 'int',
1420 '*bitmap': 'str', '*compress': 'bool',
1421 '*on-source-error': 'BlockdevOnError',
1422 '*on-target-error': 'BlockdevOnError',
1423 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1426 # @blockdev-snapshot-sync:
1428 # Generates a synchronous snapshot of a block device.
1430 # For the arguments, see the documentation of BlockdevSnapshotSync.
1432 # Returns: nothing on success
1433 # If @device is not a valid block device, DeviceNotFound
1439 # -> { "execute": "blockdev-snapshot-sync",
1440 # "arguments": { "device": "ide-hd0",
1442 # "/some/place/my-image",
1443 # "format": "qcow2" } }
1444 # <- { "return": {} }
1447 { 'command': 'blockdev-snapshot-sync',
1448 'data': 'BlockdevSnapshotSync' }
1452 # @blockdev-snapshot:
1454 # Generates a snapshot of a block device.
1456 # Create a snapshot, by installing 'node' as the backing image of
1457 # 'overlay'. Additionally, if 'node' is associated with a block
1458 # device, the block device changes to using 'overlay' as its new active
1461 # For the arguments, see the documentation of BlockdevSnapshot.
1467 # -> { "execute": "blockdev-add",
1468 # "arguments": { "driver": "qcow2",
1469 # "node-name": "node1534",
1470 # "file": { "driver": "file",
1471 # "filename": "hd1.qcow2" },
1472 # "backing": null } }
1474 # <- { "return": {} }
1476 # -> { "execute": "blockdev-snapshot",
1477 # "arguments": { "node": "ide-hd0",
1478 # "overlay": "node1534" } }
1479 # <- { "return": {} }
1482 { 'command': 'blockdev-snapshot',
1483 'data': 'BlockdevSnapshot' }
1486 # @change-backing-file:
1488 # Change the backing file in the image file metadata. This does not
1489 # cause QEMU to reopen the image file to reparse the backing filename
1490 # (it may, however, perform a reopen to change permissions from
1491 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1492 # into the image file metadata, and the QEMU internal strings are
1495 # @image-node-name: The name of the block driver state node of the
1496 # image to modify. The "device" argument is used
1497 # to verify "image-node-name" is in the chain
1498 # described by "device".
1500 # @device: The device name or node-name of the root node that owns
1503 # @backing-file: The string to write as the backing file. This
1504 # string is not validated, so care should be taken
1505 # when specifying the string or the image chain may
1506 # not be able to be reopened again.
1508 # Returns: Nothing on success
1510 # If "device" does not exist or cannot be determined, DeviceNotFound
1514 { 'command': 'change-backing-file',
1515 'data': { 'device': 'str', 'image-node-name': 'str',
1516 'backing-file': 'str' } }
1521 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1522 # writes data between 'top' and 'base' into 'base'.
1524 # @job-id: identifier for the newly-created block job. If
1525 # omitted, the device name will be used. (Since 2.7)
1527 # @device: the device name or node-name of a root node
1529 # @base-node: The node name of the backing image to write data into.
1530 # If not specified, this is the deepest backing image.
1533 # @base: Same as @base-node, except that it is a file name rather than a node
1534 # name. This must be the exact filename string that was used to open the
1535 # node; other strings, even if addressing the same file, are not
1536 # accepted (deprecated, use @base-node instead)
1538 # @top-node: The node name of the backing image within the image chain
1539 # which contains the topmost data to be committed down. If
1540 # not specified, this is the active layer. (since: 3.1)
1542 # @top: Same as @top-node, except that it is a file name rather than a node
1543 # name. This must be the exact filename string that was used to open the
1544 # node; other strings, even if addressing the same file, are not
1545 # accepted (deprecated, use @base-node instead)
1547 # @backing-file: The backing file string to write into the overlay
1548 # image of 'top'. If 'top' is the active layer,
1549 # specifying a backing file string is an error. This
1550 # filename is not validated.
1552 # If a pathname string is such that it cannot be
1553 # resolved by QEMU, that means that subsequent QMP or
1554 # HMP commands must use node-names for the image in
1555 # question, as filename lookup methods will fail.
1557 # If not specified, QEMU will automatically determine
1558 # the backing file string to use, or error out if
1559 # there is no obvious choice. Care should be taken
1560 # when specifying the string, to specify a valid
1561 # filename or protocol.
1564 # If top == base, that is an error.
1565 # If top == active, the job will not be completed by itself,
1566 # user needs to complete the job with the block-job-complete
1567 # command after getting the ready event. (Since 2.0)
1569 # If the base image is smaller than top, then the base image
1570 # will be resized to be the same size as top. If top is
1571 # smaller than the base image, the base will not be
1572 # truncated. If you want the base image size to match the
1573 # size of the smaller top, you can safely truncate it
1574 # yourself once the commit operation successfully completes.
1576 # @speed: the maximum speed, in bytes per second
1578 # @filter-node-name: the node name that should be assigned to the
1579 # filter driver that the commit job inserts into the graph
1580 # above @top. If this option is not given, a node name is
1581 # autogenerated. (Since: 2.9)
1583 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1584 # finished its work, waiting for @block-job-finalize before
1585 # making any block graph changes.
1586 # When true, this job will automatically
1587 # perform its abort or commit actions.
1588 # Defaults to true. (Since 3.1)
1590 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1591 # has completely ceased all work, and awaits @block-job-dismiss.
1592 # When true, this job will automatically disappear from the query
1593 # list without user intervention.
1594 # Defaults to true. (Since 3.1)
1596 # Returns: Nothing on success
1597 # If @device does not exist, DeviceNotFound
1598 # Any other error returns a GenericError.
1604 # -> { "execute": "block-commit",
1605 # "arguments": { "device": "virtio0",
1606 # "top": "/tmp/snap1.qcow2" } }
1607 # <- { "return": {} }
1610 { 'command': 'block-commit',
1611 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1612 '*base': 'str', '*top-node': 'str', '*top': 'str',
1613 '*backing-file': 'str', '*speed': 'int',
1614 '*filter-node-name': 'str',
1615 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1620 # Start a point-in-time copy of a block device to a new destination. The
1621 # status of ongoing drive-backup operations can be checked with
1622 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1623 # The operation can be stopped before it has completed using the
1624 # block-job-cancel command.
1626 # Returns: nothing on success
1627 # If @device is not a valid block device, GenericError
1633 # -> { "execute": "drive-backup",
1634 # "arguments": { "device": "drive0",
1636 # "target": "backup.img" } }
1637 # <- { "return": {} }
1640 { 'command': 'drive-backup', 'boxed': true,
1641 'data': 'DriveBackup' }
1646 # Start a point-in-time copy of a block device to a new destination. The
1647 # status of ongoing blockdev-backup operations can be checked with
1648 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1649 # The operation can be stopped before it has completed using the
1650 # block-job-cancel command.
1652 # Returns: nothing on success
1653 # If @device is not a valid block device, DeviceNotFound
1658 # -> { "execute": "blockdev-backup",
1659 # "arguments": { "device": "src-id",
1661 # "target": "tgt-id" } }
1662 # <- { "return": {} }
1665 { 'command': 'blockdev-backup', 'boxed': true,
1666 'data': 'BlockdevBackup' }
1670 # @query-named-block-nodes:
1672 # Get the named block driver list
1674 # Returns: the list of BlockDeviceInfo
1680 # -> { "execute": "query-named-block-nodes" }
1681 # <- { "return": [ { "ro":false,
1683 # "encrypted":false,
1684 # "file":"disks/test.qcow2",
1685 # "node-name": "my-node",
1686 # "backing_file_depth":1,
1693 # "bps_max": 8000000,
1700 # "write_threshold": 0,
1702 # "filename":"disks/test.qcow2",
1704 # "virtual-size":2048000,
1705 # "backing_file":"base.qcow2",
1706 # "full-backing-filename":"disks/base.qcow2",
1707 # "backing-filename-format":"qcow2",
1711 # "name": "snapshot1",
1712 # "vm-state-size": 0,
1713 # "date-sec": 10000200,
1715 # "vm-clock-sec": 206,
1716 # "vm-clock-nsec": 30
1720 # "filename":"disks/base.qcow2",
1722 # "virtual-size":2048000
1727 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1730 # @XDbgBlockGraphNodeType:
1732 # @block-backend: corresponds to BlockBackend
1734 # @block-job: corresonds to BlockJob
1736 # @block-driver: corresponds to BlockDriverState
1740 { 'enum': 'XDbgBlockGraphNodeType',
1741 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1744 # @XDbgBlockGraphNode:
1746 # @id: Block graph node identifier. This @id is generated only for
1747 # x-debug-query-block-graph and does not relate to any other identifiers in
1750 # @type: Type of graph node. Can be one of block-backend, block-job or
1751 # block-driver-state.
1753 # @name: Human readable name of the node. Corresponds to node-name for
1754 # block-driver-state nodes; is not guaranteed to be unique in the whole
1755 # graph (with block-jobs and block-backends).
1759 { 'struct': 'XDbgBlockGraphNode',
1760 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1765 # Enum of base block permissions.
1767 # @consistent-read: A user that has the "permission" of consistent reads is
1768 # guaranteed that their view of the contents of the block
1769 # device is complete and self-consistent, representing the
1770 # contents of a disk at a specific point.
1771 # For most block devices (including their backing files) this
1772 # is true, but the property cannot be maintained in a few
1773 # situations like for intermediate nodes of a commit block
1776 # @write: This permission is required to change the visible disk contents.
1778 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1779 # both enough and required for writes to the block node when
1780 # the caller promises that the visible disk content doesn't
1782 # As the BLK_PERM_WRITE permission is strictly stronger,
1783 # either is sufficient to perform an unchanging write.
1785 # @resize: This permission is required to change the size of a block node.
1787 # @graph-mod: This permission is required to change the node that this
1788 # BdrvChild points to.
1792 { 'enum': 'BlockPermission',
1793 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
1796 # @XDbgBlockGraphEdge:
1798 # Block Graph edge description for x-debug-query-block-graph.
1800 # @parent: parent id
1804 # @name: name of the relation (examples are 'file' and 'backing')
1806 # @perm: granted permissions for the parent operating on the child
1808 # @shared-perm: permissions that can still be granted to other users of the
1809 # child while it is still attached to this parent
1813 { 'struct': 'XDbgBlockGraphEdge',
1814 'data': { 'parent': 'uint64', 'child': 'uint64',
1815 'name': 'str', 'perm': [ 'BlockPermission' ],
1816 'shared-perm': [ 'BlockPermission' ] } }
1821 # Block Graph - list of nodes and list of edges.
1825 { 'struct': 'XDbgBlockGraph',
1826 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1829 # @x-debug-query-block-graph:
1831 # Get the block graph.
1835 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph' }
1840 # Start mirroring a block device's writes to a new destination. target
1841 # specifies the target of the new image. If the file exists, or if it
1842 # is a device, it will be used as the new destination for writes. If
1843 # it does not exist, a new file will be created. format specifies the
1844 # format of the mirror image, default is to probe if mode='existing',
1845 # else the format of the source.
1847 # Returns: nothing on success
1848 # If @device is not a valid block device, GenericError
1854 # -> { "execute": "drive-mirror",
1855 # "arguments": { "device": "ide-hd0",
1856 # "target": "/some/place/my-image",
1858 # "format": "qcow2" } }
1859 # <- { "return": {} }
1862 { 'command': 'drive-mirror', 'boxed': true,
1863 'data': 'DriveMirror' }
1868 # A set of parameters describing drive mirror setup.
1870 # @job-id: identifier for the newly-created block job. If
1871 # omitted, the device name will be used. (Since 2.7)
1873 # @device: the device name or node-name of a root node whose writes should be
1876 # @target: the target of the new image. If the file exists, or if it
1877 # is a device, the existing file/device will be used as the new
1878 # destination. If it does not exist, a new file will be created.
1880 # @format: the format of the new destination, default is to
1881 # probe if @mode is 'existing', else the format of the source
1883 # @node-name: the new block driver state node name in the graph
1886 # @replaces: with sync=full graph node name to be replaced by the new
1887 # image when a whole image copy is done. This can be used to repair
1888 # broken Quorum files. (Since 2.1)
1890 # @mode: whether and how QEMU should create a new image, default is
1893 # @speed: the maximum speed, in bytes per second
1895 # @sync: what parts of the disk image should be copied to the destination
1896 # (all the disk, only the sectors allocated in the topmost image, or
1899 # @granularity: granularity of the dirty bitmap, default is 64K
1900 # if the image format doesn't have clusters, 4K if the clusters
1901 # are smaller than that, else the cluster size. Must be a
1902 # power of 2 between 512 and 64M (since 1.4).
1904 # @buf-size: maximum amount of data in flight from source to
1905 # target (since 1.4).
1907 # @on-source-error: the action to take on an error on the source,
1908 # default 'report'. 'stop' and 'enospc' can only be used
1909 # if the block device supports io-status (see BlockInfo).
1911 # @on-target-error: the action to take on an error on the target,
1912 # default 'report' (no limitations, since this applies to
1913 # a different block device than @device).
1914 # @unmap: Whether to try to unmap target sectors where source has
1915 # only zero. If true, and target unallocated sectors will read as zero,
1916 # target image sectors will be unmapped; otherwise, zeroes will be
1917 # written. Both will result in identical contents.
1918 # Default is true. (Since 2.4)
1920 # @copy-mode: when to copy data to the destination; defaults to 'background'
1923 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1924 # finished its work, waiting for @block-job-finalize before
1925 # making any block graph changes.
1926 # When true, this job will automatically
1927 # perform its abort or commit actions.
1928 # Defaults to true. (Since 3.1)
1930 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1931 # has completely ceased all work, and awaits @block-job-dismiss.
1932 # When true, this job will automatically disappear from the query
1933 # list without user intervention.
1934 # Defaults to true. (Since 3.1)
1937 { 'struct': 'DriveMirror',
1938 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1939 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1940 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1941 '*speed': 'int', '*granularity': 'uint32',
1942 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1943 '*on-target-error': 'BlockdevOnError',
1944 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
1945 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1948 # @BlockDirtyBitmap:
1950 # @node: name of device/node which the bitmap is tracking
1952 # @name: name of the dirty bitmap
1956 { 'struct': 'BlockDirtyBitmap',
1957 'data': { 'node': 'str', 'name': 'str' } }
1960 # @BlockDirtyBitmapAdd:
1962 # @node: name of device/node which the bitmap is tracking
1964 # @name: name of the dirty bitmap
1966 # @granularity: the bitmap granularity, default is 64k for
1967 # block-dirty-bitmap-add
1969 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1970 # corresponding block device image file on its close. For now only
1971 # Qcow2 disks support persistent bitmaps. Default is false for
1972 # block-dirty-bitmap-add. (Since: 2.10)
1974 # @autoload: ignored and deprecated since 2.12.
1975 # Currently, all dirty tracking bitmaps are loaded from Qcow2 on
1978 # @disabled: the bitmap is created in the disabled state, which means that
1979 # it will not track drive changes. The bitmap may be enabled with
1980 # block-dirty-bitmap-enable. Default is false. (Since: 4.0)
1984 { 'struct': 'BlockDirtyBitmapAdd',
1985 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1986 '*persistent': 'bool', '*autoload': 'bool', '*disabled': 'bool' } }
1989 # @BlockDirtyBitmapMerge:
1991 # @node: name of device/node which the bitmap is tracking
1993 # @target: name of the destination dirty bitmap
1995 # @bitmaps: name(s) of the source dirty bitmap(s)
1999 { 'struct': 'BlockDirtyBitmapMerge',
2000 'data': { 'node': 'str', 'target': 'str', 'bitmaps': ['str'] } }
2003 # @block-dirty-bitmap-add:
2005 # Create a dirty bitmap with a name on the node, and start tracking the writes.
2007 # Returns: nothing on success
2008 # If @node is not a valid block device or node, DeviceNotFound
2009 # If @name is already taken, GenericError with an explanation
2015 # -> { "execute": "block-dirty-bitmap-add",
2016 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2017 # <- { "return": {} }
2020 { 'command': 'block-dirty-bitmap-add',
2021 'data': 'BlockDirtyBitmapAdd' }
2024 # @block-dirty-bitmap-remove:
2026 # Stop write tracking and remove the dirty bitmap that was created
2027 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2030 # Returns: nothing on success
2031 # If @node is not a valid block device or node, DeviceNotFound
2032 # If @name is not found, GenericError with an explanation
2033 # if @name is frozen by an operation, GenericError
2039 # -> { "execute": "block-dirty-bitmap-remove",
2040 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2041 # <- { "return": {} }
2044 { 'command': 'block-dirty-bitmap-remove',
2045 'data': 'BlockDirtyBitmap' }
2048 # @block-dirty-bitmap-clear:
2050 # Clear (reset) a dirty bitmap on the device, so that an incremental
2051 # backup from this point in time forward will only backup clusters
2052 # modified after this clear operation.
2054 # Returns: nothing on success
2055 # If @node is not a valid block device, DeviceNotFound
2056 # If @name is not found, GenericError with an explanation
2062 # -> { "execute": "block-dirty-bitmap-clear",
2063 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2064 # <- { "return": {} }
2067 { 'command': 'block-dirty-bitmap-clear',
2068 'data': 'BlockDirtyBitmap' }
2071 # @block-dirty-bitmap-enable:
2073 # Enables a dirty bitmap so that it will begin tracking disk changes.
2075 # Returns: nothing on success
2076 # If @node is not a valid block device, DeviceNotFound
2077 # If @name is not found, GenericError with an explanation
2083 # -> { "execute": "block-dirty-bitmap-enable",
2084 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2085 # <- { "return": {} }
2088 { 'command': 'block-dirty-bitmap-enable',
2089 'data': 'BlockDirtyBitmap' }
2092 # @block-dirty-bitmap-disable:
2094 # Disables a dirty bitmap so that it will stop tracking disk changes.
2096 # Returns: nothing on success
2097 # If @node is not a valid block device, DeviceNotFound
2098 # If @name is not found, GenericError with an explanation
2104 # -> { "execute": "block-dirty-bitmap-disable",
2105 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2106 # <- { "return": {} }
2109 { 'command': 'block-dirty-bitmap-disable',
2110 'data': 'BlockDirtyBitmap' }
2113 # @block-dirty-bitmap-merge:
2115 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2116 # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2117 # as the @target bitmap. Any bits already set in @target will still be
2118 # set after the merge, i.e., this operation does not clear the target.
2119 # On error, @target is unchanged.
2121 # The resulting bitmap will count as dirty any clusters that were dirty in any
2122 # of the source bitmaps. This can be used to achieve backup checkpoints, or in
2123 # simpler usages, to copy bitmaps.
2125 # Returns: nothing on success
2126 # If @node is not a valid block device, DeviceNotFound
2127 # If any bitmap in @bitmaps or @target is not found, GenericError
2128 # If any of the bitmaps have different sizes or granularities,
2135 # -> { "execute": "block-dirty-bitmap-merge",
2136 # "arguments": { "node": "drive0", "target": "bitmap0",
2137 # "bitmaps": ["bitmap1"] } }
2138 # <- { "return": {} }
2141 { 'command': 'block-dirty-bitmap-merge',
2142 'data': 'BlockDirtyBitmapMerge' }
2145 # @BlockDirtyBitmapSha256:
2147 # SHA256 hash of dirty bitmap data
2149 # @sha256: ASCII representation of SHA256 bitmap hash
2153 { 'struct': 'BlockDirtyBitmapSha256',
2154 'data': {'sha256': 'str'} }
2157 # @x-debug-block-dirty-bitmap-sha256:
2159 # Get bitmap SHA256.
2161 # Returns: BlockDirtyBitmapSha256 on success
2162 # If @node is not a valid block device, DeviceNotFound
2163 # If @name is not found or if hashing has failed, GenericError with an
2168 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2169 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
2174 # Start mirroring a block device's writes to a new destination.
2176 # @job-id: identifier for the newly-created block job. If
2177 # omitted, the device name will be used. (Since 2.7)
2179 # @device: The device name or node-name of a root node whose writes should be
2182 # @target: the id or node-name of the block device to mirror to. This mustn't be
2183 # attached to guest.
2185 # @replaces: with sync=full graph node name to be replaced by the new
2186 # image when a whole image copy is done. This can be used to repair
2187 # broken Quorum files.
2189 # @speed: the maximum speed, in bytes per second
2191 # @sync: what parts of the disk image should be copied to the destination
2192 # (all the disk, only the sectors allocated in the topmost image, or
2195 # @granularity: granularity of the dirty bitmap, default is 64K
2196 # if the image format doesn't have clusters, 4K if the clusters
2197 # are smaller than that, else the cluster size. Must be a
2198 # power of 2 between 512 and 64M
2200 # @buf-size: maximum amount of data in flight from source to
2203 # @on-source-error: the action to take on an error on the source,
2204 # default 'report'. 'stop' and 'enospc' can only be used
2205 # if the block device supports io-status (see BlockInfo).
2207 # @on-target-error: the action to take on an error on the target,
2208 # default 'report' (no limitations, since this applies to
2209 # a different block device than @device).
2211 # @filter-node-name: the node name that should be assigned to the
2212 # filter driver that the mirror job inserts into the graph
2213 # above @device. If this option is not given, a node name is
2214 # autogenerated. (Since: 2.9)
2216 # @copy-mode: when to copy data to the destination; defaults to 'background'
2219 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2220 # finished its work, waiting for @block-job-finalize before
2221 # making any block graph changes.
2222 # When true, this job will automatically
2223 # perform its abort or commit actions.
2224 # Defaults to true. (Since 3.1)
2226 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2227 # has completely ceased all work, and awaits @block-job-dismiss.
2228 # When true, this job will automatically disappear from the query
2229 # list without user intervention.
2230 # Defaults to true. (Since 3.1)
2231 # Returns: nothing on success.
2237 # -> { "execute": "blockdev-mirror",
2238 # "arguments": { "device": "ide-hd0",
2239 # "target": "target0",
2240 # "sync": "full" } }
2241 # <- { "return": {} }
2244 { 'command': 'blockdev-mirror',
2245 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2247 'sync': 'MirrorSyncMode',
2248 '*speed': 'int', '*granularity': 'uint32',
2249 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2250 '*on-target-error': 'BlockdevOnError',
2251 '*filter-node-name': 'str',
2252 '*copy-mode': 'MirrorCopyMode',
2253 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2256 # @block_set_io_throttle:
2258 # Change I/O throttle limits for a block drive.
2260 # Since QEMU 2.4, each device with I/O limits is member of a throttle
2263 # If two or more devices are members of the same group, the limits
2264 # will apply to the combined I/O of the whole group in a round-robin
2265 # fashion. Therefore, setting new I/O limits to a device will affect
2268 # The name of the group can be specified using the 'group' parameter.
2269 # If the parameter is unset, it is assumed to be the current group of
2270 # that device. If it's not in any group yet, the name of the device
2271 # will be used as the name for its group.
2273 # The 'group' parameter can also be used to move a device to a
2274 # different group. In this case the limits specified in the parameters
2275 # will be applied to the new group only.
2277 # I/O limits can be disabled by setting all of them to 0. In this case
2278 # the device will be removed from its group and the rest of its
2279 # members will not be affected. The 'group' parameter is ignored.
2281 # Returns: Nothing on success
2282 # If @device is not a valid block device, DeviceNotFound
2288 # -> { "execute": "block_set_io_throttle",
2289 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
2302 # "bps_max_length": 0,
2303 # "iops_size": 0 } }
2304 # <- { "return": {} }
2306 # -> { "execute": "block_set_io_throttle",
2307 # "arguments": { "id": "ide0-1-0",
2314 # "bps_max": 8000000,
2320 # "bps_max_length": 60,
2321 # "iops_size": 0 } }
2322 # <- { "return": {} }
2324 { 'command': 'block_set_io_throttle', 'boxed': true,
2325 'data': 'BlockIOThrottle' }
2330 # A set of parameters describing block throttling.
2332 # @device: Block device name (deprecated, use @id instead)
2334 # @id: The name or QOM path of the guest device (since: 2.8)
2336 # @bps: total throughput limit in bytes per second
2338 # @bps_rd: read throughput limit in bytes per second
2340 # @bps_wr: write throughput limit in bytes per second
2342 # @iops: total I/O operations per second
2344 # @iops_rd: read I/O operations per second
2346 # @iops_wr: write I/O operations per second
2348 # @bps_max: total throughput limit during bursts,
2349 # in bytes (Since 1.7)
2351 # @bps_rd_max: read throughput limit during bursts,
2352 # in bytes (Since 1.7)
2354 # @bps_wr_max: write throughput limit during bursts,
2355 # in bytes (Since 1.7)
2357 # @iops_max: total I/O operations per second during bursts,
2358 # in bytes (Since 1.7)
2360 # @iops_rd_max: read I/O operations per second during bursts,
2361 # in bytes (Since 1.7)
2363 # @iops_wr_max: write I/O operations per second during bursts,
2364 # in bytes (Since 1.7)
2366 # @bps_max_length: maximum length of the @bps_max burst
2367 # period, in seconds. It must only
2368 # be set if @bps_max is set as well.
2369 # Defaults to 1. (Since 2.6)
2371 # @bps_rd_max_length: maximum length of the @bps_rd_max
2372 # burst period, in seconds. It must only
2373 # be set if @bps_rd_max is set as well.
2374 # Defaults to 1. (Since 2.6)
2376 # @bps_wr_max_length: maximum length of the @bps_wr_max
2377 # burst period, in seconds. It must only
2378 # be set if @bps_wr_max is set as well.
2379 # Defaults to 1. (Since 2.6)
2381 # @iops_max_length: maximum length of the @iops burst
2382 # period, in seconds. It must only
2383 # be set if @iops_max is set as well.
2384 # Defaults to 1. (Since 2.6)
2386 # @iops_rd_max_length: maximum length of the @iops_rd_max
2387 # burst period, in seconds. It must only
2388 # be set if @iops_rd_max is set as well.
2389 # Defaults to 1. (Since 2.6)
2391 # @iops_wr_max_length: maximum length of the @iops_wr_max
2392 # burst period, in seconds. It must only
2393 # be set if @iops_wr_max is set as well.
2394 # Defaults to 1. (Since 2.6)
2396 # @iops_size: an I/O size in bytes (Since 1.7)
2398 # @group: throttle group name (Since 2.4)
2402 { 'struct': 'BlockIOThrottle',
2403 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2404 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2405 '*bps_max': 'int', '*bps_rd_max': 'int',
2406 '*bps_wr_max': 'int', '*iops_max': 'int',
2407 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2408 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2409 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2410 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2411 '*iops_size': 'int', '*group': 'str' } }
2416 # Limit parameters for throttling.
2417 # Since some limit combinations are illegal, limits should always be set in one
2418 # transaction. All fields are optional. When setting limits, if a field is
2419 # missing the current value is not changed.
2421 # @iops-total: limit total I/O operations per second
2422 # @iops-total-max: I/O operations burst
2423 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2424 # It must only be set if @iops-total-max is set as well.
2425 # @iops-read: limit read operations per second
2426 # @iops-read-max: I/O operations read burst
2427 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2428 # It must only be set if @iops-read-max is set as well.
2429 # @iops-write: limit write operations per second
2430 # @iops-write-max: I/O operations write burst
2431 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2432 # It must only be set if @iops-write-max is set as well.
2433 # @bps-total: limit total bytes per second
2434 # @bps-total-max: total bytes burst
2435 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2436 # It must only be set if @bps-total-max is set as well.
2437 # @bps-read: limit read bytes per second
2438 # @bps-read-max: total bytes read burst
2439 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2440 # It must only be set if @bps-read-max is set as well.
2441 # @bps-write: limit write bytes per second
2442 # @bps-write-max: total bytes write burst
2443 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2444 # It must only be set if @bps-write-max is set as well.
2445 # @iops-size: when limiting by iops max size of an I/O in bytes
2449 { 'struct': 'ThrottleLimits',
2450 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2451 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2452 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2453 '*iops-write' : 'int', '*iops-write-max' : 'int',
2454 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2455 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2456 '*bps-read' : 'int', '*bps-read-max' : 'int',
2457 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2458 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2459 '*iops-size' : 'int' } }
2464 # Copy data from a backing file into a block device.
2466 # The block streaming operation is performed in the background until the entire
2467 # backing file has been copied. This command returns immediately once streaming
2468 # has started. The status of ongoing block streaming operations can be checked
2469 # with query-block-jobs. The operation can be stopped before it has completed
2470 # using the block-job-cancel command.
2472 # The node that receives the data is called the top image, can be located in
2473 # any part of the chain (but always above the base image; see below) and can be
2474 # specified using its device or node name. Earlier qemu versions only allowed
2475 # 'device' to name the top level node; presence of the 'base-node' parameter
2476 # during introspection can be used as a witness of the enhanced semantics
2479 # If a base file is specified then sectors are not copied from that base file and
2480 # its backing chain. When streaming completes the image file will have the base
2481 # file as its backing file. This can be used to stream a subset of the backing
2482 # file chain instead of flattening the entire image.
2484 # On successful completion the image file is updated to drop the backing file
2485 # and the BLOCK_JOB_COMPLETED event is emitted.
2487 # @job-id: identifier for the newly-created block job. If
2488 # omitted, the device name will be used. (Since 2.7)
2490 # @device: the device or node name of the top image
2492 # @base: the common backing file name.
2493 # It cannot be set if @base-node is also set.
2495 # @base-node: the node name of the backing file.
2496 # It cannot be set if @base is also set. (Since 2.8)
2498 # @backing-file: The backing file string to write into the top
2499 # image. This filename is not validated.
2501 # If a pathname string is such that it cannot be
2502 # resolved by QEMU, that means that subsequent QMP or
2503 # HMP commands must use node-names for the image in
2504 # question, as filename lookup methods will fail.
2506 # If not specified, QEMU will automatically determine
2507 # the backing file string to use, or error out if there
2508 # is no obvious choice. Care should be taken when
2509 # specifying the string, to specify a valid filename or
2513 # @speed: the maximum speed, in bytes per second
2515 # @on-error: the action to take on an error (default report).
2516 # 'stop' and 'enospc' can only be used if the block device
2517 # supports io-status (see BlockInfo). Since 1.3.
2519 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2520 # finished its work, waiting for @block-job-finalize before
2521 # making any block graph changes.
2522 # When true, this job will automatically
2523 # perform its abort or commit actions.
2524 # Defaults to true. (Since 3.1)
2526 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2527 # has completely ceased all work, and awaits @block-job-dismiss.
2528 # When true, this job will automatically disappear from the query
2529 # list without user intervention.
2530 # Defaults to true. (Since 3.1)
2532 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
2538 # -> { "execute": "block-stream",
2539 # "arguments": { "device": "virtio0",
2540 # "base": "/tmp/master.qcow2" } }
2541 # <- { "return": {} }
2544 { 'command': 'block-stream',
2545 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2546 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2547 '*on-error': 'BlockdevOnError',
2548 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2551 # @block-job-set-speed:
2553 # Set maximum speed for a background block operation.
2555 # This command can only be issued when there is an active block job.
2557 # Throttling can be disabled by setting the speed to 0.
2559 # @device: The job identifier. This used to be a device name (hence
2560 # the name of the parameter), but since QEMU 2.7 it can have
2563 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2566 # Returns: Nothing on success
2567 # If no background operation is active on this device, DeviceNotActive
2571 { 'command': 'block-job-set-speed',
2572 'data': { 'device': 'str', 'speed': 'int' } }
2575 # @block-job-cancel:
2577 # Stop an active background block operation.
2579 # This command returns immediately after marking the active background block
2580 # operation for cancellation. It is an error to call this command if no
2581 # operation is in progress.
2583 # The operation will cancel as soon as possible and then emit the
2584 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2585 # enumerated using query-block-jobs.
2587 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2588 # (via the event BLOCK_JOB_READY) that the source and destination are
2589 # synchronized, then the event triggered by this command changes to
2590 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2591 # destination now has a point-in-time copy tied to the time of the cancellation.
2593 # For streaming, the image file retains its backing file unless the streaming
2594 # operation happens to complete just as it is being cancelled. A new streaming
2595 # operation can be started at a later time to finish copying all data from the
2598 # @device: The job identifier. This used to be a device name (hence
2599 # the name of the parameter), but since QEMU 2.7 it can have
2602 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2603 # abandon the job immediately (even if it is paused) instead of waiting
2604 # for the destination to complete its final synchronization (since 1.3)
2606 # Returns: Nothing on success
2607 # If no background operation is active on this device, DeviceNotActive
2611 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2616 # Pause an active background block operation.
2618 # This command returns immediately after marking the active background block
2619 # operation for pausing. It is an error to call this command if no
2620 # operation is in progress or if the job is already paused.
2622 # The operation will pause as soon as possible. No event is emitted when
2623 # the operation is actually paused. Cancelling a paused job automatically
2626 # @device: The job identifier. This used to be a device name (hence
2627 # the name of the parameter), but since QEMU 2.7 it can have
2630 # Returns: Nothing on success
2631 # If no background operation is active on this device, DeviceNotActive
2635 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2638 # @block-job-resume:
2640 # Resume an active background block operation.
2642 # This command returns immediately after resuming a paused background block
2643 # operation. It is an error to call this command if no operation is in
2644 # progress or if the job is not paused.
2646 # This command also clears the error status of the job.
2648 # @device: The job identifier. This used to be a device name (hence
2649 # the name of the parameter), but since QEMU 2.7 it can have
2652 # Returns: Nothing on success
2653 # If no background operation is active on this device, DeviceNotActive
2657 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2660 # @block-job-complete:
2662 # Manually trigger completion of an active background block operation. This
2663 # is supported for drive mirroring, where it also switches the device to
2664 # write to the target path only. The ability to complete is signaled with
2665 # a BLOCK_JOB_READY event.
2667 # This command completes an active background block operation synchronously.
2668 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2669 # is not defined. Note that if an I/O error occurs during the processing of
2670 # this command: 1) the command itself will fail; 2) the error will be processed
2671 # according to the rerror/werror arguments that were specified when starting
2674 # A cancelled or paused job cannot be completed.
2676 # @device: The job identifier. This used to be a device name (hence
2677 # the name of the parameter), but since QEMU 2.7 it can have
2680 # Returns: Nothing on success
2681 # If no background operation is active on this device, DeviceNotActive
2685 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2688 # @block-job-dismiss:
2690 # For jobs that have already concluded, remove them from the block-job-query
2691 # list. This command only needs to be run for jobs which were started with
2692 # QEMU 2.12+ job lifetime management semantics.
2694 # This command will refuse to operate on any job that has not yet reached
2695 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2696 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2697 # to be used as appropriate.
2699 # @id: The job identifier.
2701 # Returns: Nothing on success
2705 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2708 # @block-job-finalize:
2710 # Once a job that has manual=true reaches the pending state, it can be
2711 # instructed to finalize any graph changes and do any necessary cleanup
2713 # For jobs in a transaction, instructing one job to finalize will force
2714 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2715 # a single member job to finalize.
2717 # @id: The job identifier.
2719 # Returns: Nothing on success
2723 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2726 # @BlockdevDiscardOptions:
2728 # Determines how to handle discard requests.
2730 # @ignore: Ignore the request
2731 # @unmap: Forward as an unmap request
2735 { 'enum': 'BlockdevDiscardOptions',
2736 'data': [ 'ignore', 'unmap' ] }
2739 # @BlockdevDetectZeroesOptions:
2741 # Describes the operation mode for the automatic conversion of plain
2742 # zero writes by the OS to driver specific optimized zero write commands.
2744 # @off: Disabled (default)
2746 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2747 # also that @BlockdevDiscardOptions is set to unmap for this device.
2751 { 'enum': 'BlockdevDetectZeroesOptions',
2752 'data': [ 'off', 'on', 'unmap' ] }
2755 # @BlockdevAioOptions:
2757 # Selects the AIO backend to handle I/O requests
2759 # @threads: Use qemu's thread pool
2760 # @native: Use native AIO backend (only Linux and Windows)
2764 { 'enum': 'BlockdevAioOptions',
2765 'data': [ 'threads', 'native' ] }
2768 # @BlockdevCacheOptions:
2770 # Includes cache-related options for block devices
2772 # @direct: enables use of O_DIRECT (bypass the host page cache;
2774 # @no-flush: ignore any flush requests for the device (default:
2779 { 'struct': 'BlockdevCacheOptions',
2780 'data': { '*direct': 'bool',
2781 '*no-flush': 'bool' } }
2786 # Drivers that are supported in block device operations.
2789 # @throttle: Since 2.11
2791 # @copy-on-read: Since 3.0
2792 # @blklogwrites: Since 3.0
2796 { 'enum': 'BlockdevDriver',
2797 'data': [ 'blkdebug', 'blklogwrites', 'blkverify', 'bochs', 'cloop',
2798 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps', 'gluster',
2799 'host_cdrom', 'host_device', 'http', 'https', 'iscsi', 'luks',
2800 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels', 'qcow',
2801 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
2802 { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
2804 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2807 # @BlockdevOptionsFile:
2809 # Driver specific block device options for the file backend.
2811 # @filename: path to the image file
2812 # @pr-manager: the id for the object that will handle persistent reservations
2813 # for this device (default: none, forward the commands via SG_IO;
2815 # @aio: AIO backend (default: threads) (since: 2.8)
2816 # @locking: whether to enable file locking. If set to 'auto', only enable
2817 # when Open File Descriptor (OFD) locking API is available
2818 # (default: auto, since 2.10)
2819 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2820 # migration. May cause noticeable delays if the image
2821 # file is large, do not use in production.
2822 # (default: off) (since: 3.0)
2826 { 'struct': 'BlockdevOptionsFile',
2827 'data': { 'filename': 'str',
2828 '*pr-manager': 'str',
2829 '*locking': 'OnOffAuto',
2830 '*aio': 'BlockdevAioOptions',
2831 '*x-check-cache-dropped': 'bool' } }
2834 # @BlockdevOptionsNull:
2836 # Driver specific block device options for the null backend.
2838 # @size: size of the device in bytes.
2839 # @latency-ns: emulated latency (in nanoseconds) in processing
2840 # requests. Default to zero which completes requests immediately.
2845 { 'struct': 'BlockdevOptionsNull',
2846 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
2849 # @BlockdevOptionsNVMe:
2851 # Driver specific block device options for the NVMe backend.
2853 # @device: controller address of the NVMe device.
2854 # @namespace: namespace number of the device, starting from 1.
2858 { 'struct': 'BlockdevOptionsNVMe',
2859 'data': { 'device': 'str', 'namespace': 'int' } }
2862 # @BlockdevOptionsVVFAT:
2864 # Driver specific block device options for the vvfat protocol.
2866 # @dir: directory to be exported as FAT image
2867 # @fat-type: FAT type: 12, 16 or 32
2868 # @floppy: whether to export a floppy image (true) or
2869 # partitioned hard disk (false; default)
2870 # @label: set the volume label, limited to 11 bytes. FAT16 and
2871 # FAT32 traditionally have some restrictions on labels, which are
2872 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2874 # @rw: whether to allow write operations (default: false)
2878 { 'struct': 'BlockdevOptionsVVFAT',
2879 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2880 '*label': 'str', '*rw': 'bool' } }
2883 # @BlockdevOptionsGenericFormat:
2885 # Driver specific block device options for image format that have no option
2886 # besides their data source.
2888 # @file: reference to or definition of the data source block device
2892 { 'struct': 'BlockdevOptionsGenericFormat',
2893 'data': { 'file': 'BlockdevRef' } }
2896 # @BlockdevOptionsLUKS:
2898 # Driver specific block device options for LUKS.
2900 # @key-secret: the ID of a QCryptoSecret object providing
2901 # the decryption key (since 2.6). Mandatory except when
2902 # doing a metadata-only probe of the image.
2906 { 'struct': 'BlockdevOptionsLUKS',
2907 'base': 'BlockdevOptionsGenericFormat',
2908 'data': { '*key-secret': 'str' } }
2912 # @BlockdevOptionsGenericCOWFormat:
2914 # Driver specific block device options for image format that have no option
2915 # besides their data source and an optional backing file.
2917 # @backing: reference to or definition of the backing file block
2918 # device, null disables the backing file entirely.
2919 # Defaults to the backing file stored the image file.
2923 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2924 'base': 'BlockdevOptionsGenericFormat',
2925 'data': { '*backing': 'BlockdevRefOrNull' } }
2928 # @Qcow2OverlapCheckMode:
2930 # General overlap check modes.
2932 # @none: Do not perform any checks
2934 # @constant: Perform only checks which can be done in constant time and
2935 # without reading anything from disk
2937 # @cached: Perform only checks which can be done without reading anything
2940 # @all: Perform all available overlap checks
2944 { 'enum': 'Qcow2OverlapCheckMode',
2945 'data': [ 'none', 'constant', 'cached', 'all' ] }
2948 # @Qcow2OverlapCheckFlags:
2950 # Structure of flags for each metadata structure. Setting a field to 'true'
2951 # makes qemu guard that structure against unintended overwriting. The default
2952 # value is chosen according to the template given.
2954 # @template: Specifies a template mode which can be adjusted using the other
2955 # flags, defaults to 'cached'
2957 # @bitmap-directory: since 3.0
2961 { 'struct': 'Qcow2OverlapCheckFlags',
2962 'data': { '*template': 'Qcow2OverlapCheckMode',
2963 '*main-header': 'bool',
2964 '*active-l1': 'bool',
2965 '*active-l2': 'bool',
2966 '*refcount-table': 'bool',
2967 '*refcount-block': 'bool',
2968 '*snapshot-table': 'bool',
2969 '*inactive-l1': 'bool',
2970 '*inactive-l2': 'bool',
2971 '*bitmap-directory': 'bool' } }
2974 # @Qcow2OverlapChecks:
2976 # Specifies which metadata structures should be guarded against unintended
2979 # @flags: set of flags for separate specification of each metadata structure
2982 # @mode: named mode which chooses a specific set of flags
2986 { 'alternate': 'Qcow2OverlapChecks',
2987 'data': { 'flags': 'Qcow2OverlapCheckFlags',
2988 'mode': 'Qcow2OverlapCheckMode' } }
2991 # @BlockdevQcowEncryptionFormat:
2993 # @aes: AES-CBC with plain64 initialization vectors
2997 { 'enum': 'BlockdevQcowEncryptionFormat',
3001 # @BlockdevQcowEncryption:
3005 { 'union': 'BlockdevQcowEncryption',
3006 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3007 'discriminator': 'format',
3008 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3011 # @BlockdevOptionsQcow:
3013 # Driver specific block device options for qcow.
3015 # @encrypt: Image decryption options. Mandatory for
3016 # encrypted images, except when doing a metadata-only
3017 # probe of the image.
3021 { 'struct': 'BlockdevOptionsQcow',
3022 'base': 'BlockdevOptionsGenericCOWFormat',
3023 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3028 # @BlockdevQcow2EncryptionFormat:
3029 # @aes: AES-CBC with plain64 initialization vectors
3033 { 'enum': 'BlockdevQcow2EncryptionFormat',
3034 'data': [ 'aes', 'luks' ] }
3037 # @BlockdevQcow2Encryption:
3041 { 'union': 'BlockdevQcow2Encryption',
3042 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3043 'discriminator': 'format',
3044 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3045 'luks': 'QCryptoBlockOptionsLUKS'} }
3048 # @BlockdevOptionsQcow2:
3050 # Driver specific block device options for qcow2.
3052 # @lazy-refcounts: whether to enable the lazy refcounts
3053 # feature (default is taken from the image file)
3055 # @pass-discard-request: whether discard requests to the qcow2
3056 # device should be forwarded to the data source
3058 # @pass-discard-snapshot: whether discard requests for the data source
3059 # should be issued when a snapshot operation (e.g.
3060 # deleting a snapshot) frees clusters in the qcow2 file
3062 # @pass-discard-other: whether discard requests for the data source
3063 # should be issued on other occasions where a cluster
3066 # @overlap-check: which overlap checks to perform for writes
3067 # to the image, defaults to 'cached' (since 2.2)
3069 # @cache-size: the maximum total size of the L2 table and
3070 # refcount block caches in bytes (since 2.2)
3072 # @l2-cache-size: the maximum size of the L2 table cache in
3075 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3076 # bytes. It must be a power of two between 512
3077 # and the cluster size. The default value is
3078 # the cluster size (since 2.12)
3080 # @refcount-cache-size: the maximum size of the refcount block cache
3081 # in bytes (since 2.2)
3083 # @cache-clean-interval: clean unused entries in the L2 and refcount
3084 # caches. The interval is in seconds. The default value
3085 # is 600 on supporting platforms, and 0 on other
3086 # platforms. 0 disables this feature. (since 2.5)
3088 # @encrypt: Image decryption options. Mandatory for
3089 # encrypted images, except when doing a metadata-only
3090 # probe of the image. (since 2.10)
3092 # @data-file: reference to or definition of the external data file.
3093 # This may only be specified for images that require an
3094 # external data file. If it is not specified for such
3095 # an image, the data file name is loaded from the image
3100 { 'struct': 'BlockdevOptionsQcow2',
3101 'base': 'BlockdevOptionsGenericCOWFormat',
3102 'data': { '*lazy-refcounts': 'bool',
3103 '*pass-discard-request': 'bool',
3104 '*pass-discard-snapshot': 'bool',
3105 '*pass-discard-other': 'bool',
3106 '*overlap-check': 'Qcow2OverlapChecks',
3107 '*cache-size': 'int',
3108 '*l2-cache-size': 'int',
3109 '*l2-cache-entry-size': 'int',
3110 '*refcount-cache-size': 'int',
3111 '*cache-clean-interval': 'int',
3112 '*encrypt': 'BlockdevQcow2Encryption',
3113 '*data-file': 'BlockdevRef' } }
3116 # @SshHostKeyCheckMode:
3118 # @none Don't check the host key at all
3119 # @hash Compare the host key with a given hash
3120 # @known_hosts Check the host key against the known_hosts file
3124 { 'enum': 'SshHostKeyCheckMode',
3125 'data': [ 'none', 'hash', 'known_hosts' ] }
3128 # @SshHostKeyCheckHashType:
3130 # @md5 The given hash is an md5 hash
3131 # @sha1 The given hash is an sha1 hash
3135 { 'enum': 'SshHostKeyCheckHashType',
3136 'data': [ 'md5', 'sha1' ] }
3141 # @type The hash algorithm used for the hash
3142 # @hash The expected hash value
3146 { 'struct': 'SshHostKeyHash',
3147 'data': { 'type': 'SshHostKeyCheckHashType',
3155 { 'union': 'SshHostKeyCheck',
3156 'base': { 'mode': 'SshHostKeyCheckMode' },
3157 'discriminator': 'mode',
3158 'data': { 'hash': 'SshHostKeyHash' } }
3161 # @BlockdevOptionsSsh:
3163 # @server: host address
3165 # @path: path to the image on the host
3167 # @user: user as which to connect, defaults to current
3170 # @host-key-check: Defines how and what to check the host key against
3171 # (default: known_hosts)
3175 { 'struct': 'BlockdevOptionsSsh',
3176 'data': { 'server': 'InetSocketAddress',
3179 '*host-key-check': 'SshHostKeyCheck' } }
3185 # Trigger events supported by blkdebug.
3187 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3190 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3192 # @cor_write: a write due to copy-on-read (since 2.11)
3196 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3197 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3198 'l1_grow_activate_table', 'l2_load', 'l2_update',
3199 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3200 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3201 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3202 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3203 'refblock_load', 'refblock_update', 'refblock_update_part',
3204 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3205 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3206 'refblock_alloc_switch_table', 'cluster_alloc',
3207 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3208 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3209 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3210 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3211 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3215 # @BlkdebugInjectErrorOptions:
3217 # Describes a single error injection for blkdebug.
3219 # @event: trigger event
3221 # @state: the state identifier blkdebug needs to be in to
3222 # actually trigger the event; defaults to "any"
3224 # @errno: error identifier (errno) to be returned; defaults to
3227 # @sector: specifies the sector index which has to be affected
3228 # in order to actually trigger the event; defaults to "any
3231 # @once: disables further events after this one has been
3232 # triggered; defaults to false
3234 # @immediately: fail immediately; defaults to false
3238 { 'struct': 'BlkdebugInjectErrorOptions',
3239 'data': { 'event': 'BlkdebugEvent',
3244 '*immediately': 'bool' } }
3247 # @BlkdebugSetStateOptions:
3249 # Describes a single state-change event for blkdebug.
3251 # @event: trigger event
3253 # @state: the current state identifier blkdebug needs to be in;
3256 # @new_state: the state identifier blkdebug is supposed to assume if
3257 # this event is triggered
3261 { 'struct': 'BlkdebugSetStateOptions',
3262 'data': { 'event': 'BlkdebugEvent',
3264 'new_state': 'int' } }
3267 # @BlockdevOptionsBlkdebug:
3269 # Driver specific block device options for blkdebug.
3271 # @image: underlying raw block device (or image file)
3273 # @config: filename of the configuration file
3275 # @align: required alignment for requests in bytes, must be
3276 # positive power of 2, or 0 for default
3278 # @max-transfer: maximum size for I/O transfers in bytes, must be
3279 # positive multiple of @align and of the underlying
3280 # file's request alignment (but need not be a power of
3281 # 2), or 0 for default (since 2.10)
3283 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3284 # must be positive multiple of @align and of the
3285 # underlying file's request alignment (but need not be a
3286 # power of 2), or 0 for default (since 2.10)
3288 # @max-write-zero: maximum size for write zero requests in bytes, must be
3289 # positive multiple of @align, of @opt-write-zero, and of
3290 # the underlying file's request alignment (but need not
3291 # be a power of 2), or 0 for default (since 2.10)
3293 # @opt-discard: preferred alignment for discard requests in bytes, must
3294 # be positive multiple of @align and of the underlying
3295 # file's request alignment (but need not be a power of
3296 # 2), or 0 for default (since 2.10)
3298 # @max-discard: maximum size for discard requests in bytes, must be
3299 # positive multiple of @align, of @opt-discard, and of
3300 # the underlying file's request alignment (but need not
3301 # be a power of 2), or 0 for default (since 2.10)
3303 # @inject-error: array of error injection descriptions
3305 # @set-state: array of state-change descriptions
3309 { 'struct': 'BlockdevOptionsBlkdebug',
3310 'data': { 'image': 'BlockdevRef',
3312 '*align': 'int', '*max-transfer': 'int32',
3313 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3314 '*opt-discard': 'int32', '*max-discard': 'int32',
3315 '*inject-error': ['BlkdebugInjectErrorOptions'],
3316 '*set-state': ['BlkdebugSetStateOptions'] } }
3319 # @BlockdevOptionsBlklogwrites:
3321 # Driver specific block device options for blklogwrites.
3323 # @file: block device
3325 # @log: block device used to log writes to @file
3327 # @log-sector-size: sector size used in logging writes to @file, determines
3328 # granularity of offsets and sizes of writes (default: 512)
3330 # @log-append: append to an existing log (default: false)
3332 # @log-super-update-interval: interval of write requests after which the log
3333 # super block is updated to disk (default: 4096)
3337 { 'struct': 'BlockdevOptionsBlklogwrites',
3338 'data': { 'file': 'BlockdevRef',
3339 'log': 'BlockdevRef',
3340 '*log-sector-size': 'uint32',
3341 '*log-append': 'bool',
3342 '*log-super-update-interval': 'uint64' } }
3345 # @BlockdevOptionsBlkverify:
3347 # Driver specific block device options for blkverify.
3349 # @test: block device to be tested
3351 # @raw: raw image used for verification
3355 { 'struct': 'BlockdevOptionsBlkverify',
3356 'data': { 'test': 'BlockdevRef',
3357 'raw': 'BlockdevRef' } }
3360 # @QuorumReadPattern:
3362 # An enumeration of quorum read patterns.
3364 # @quorum: read all the children and do a quorum vote on reads
3366 # @fifo: read only from the first child that has not failed
3370 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3373 # @BlockdevOptionsQuorum:
3375 # Driver specific block device options for Quorum
3377 # @blkverify: true if the driver must print content mismatch
3378 # set to false by default
3380 # @children: the children block devices to use
3382 # @vote-threshold: the vote limit under which a read will fail
3384 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3387 # @read-pattern: choose read pattern and set to quorum by default
3392 { 'struct': 'BlockdevOptionsQuorum',
3393 'data': { '*blkverify': 'bool',
3394 'children': [ 'BlockdevRef' ],
3395 'vote-threshold': 'int',
3396 '*rewrite-corrupted': 'bool',
3397 '*read-pattern': 'QuorumReadPattern' } }
3400 # @BlockdevOptionsGluster:
3402 # Driver specific block device options for Gluster
3404 # @volume: name of gluster volume where VM image resides
3406 # @path: absolute path to image file in gluster volume
3408 # @server: gluster servers description
3410 # @debug: libgfapi log level (default '4' which is Error)
3413 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3417 { 'struct': 'BlockdevOptionsGluster',
3418 'data': { 'volume': 'str',
3420 'server': ['SocketAddress'],
3422 '*logfile': 'str' } }
3427 # An enumeration of libiscsi transport types
3431 { 'enum': 'IscsiTransport',
3432 'data': [ 'tcp', 'iser' ] }
3435 # @IscsiHeaderDigest:
3437 # An enumeration of header digests supported by libiscsi
3441 { 'enum': 'IscsiHeaderDigest',
3442 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3443 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3446 # @BlockdevOptionsIscsi:
3448 # @transport: The iscsi transport type
3450 # @portal: The address of the iscsi portal
3452 # @target: The target iqn name
3454 # @lun: LUN to connect to. Defaults to 0.
3456 # @user: User name to log in with. If omitted, no CHAP
3457 # authentication is performed.
3459 # @password-secret: The ID of a QCryptoSecret object providing
3460 # the password for the login. This option is required if
3461 # @user is specified.
3463 # @initiator-name: The iqn name we want to identify to the target
3464 # as. If this option is not specified, an initiator name is
3465 # generated automatically.
3467 # @header-digest: The desired header digest. Defaults to
3470 # @timeout: Timeout in seconds after which a request will
3471 # timeout. 0 means no timeout and is the default.
3473 # Driver specific block device options for iscsi
3477 { 'struct': 'BlockdevOptionsIscsi',
3478 'data': { 'transport': 'IscsiTransport',
3483 '*password-secret': 'str',
3484 '*initiator-name': 'str',
3485 '*header-digest': 'IscsiHeaderDigest',
3486 '*timeout': 'int' } }
3494 { 'enum': 'RbdAuthMode',
3495 'data': [ 'cephx', 'none' ] }
3498 # @BlockdevOptionsRbd:
3500 # @pool: Ceph pool name.
3502 # @image: Image name in the Ceph pool.
3504 # @conf: path to Ceph configuration file. Values
3505 # in the configuration file will be overridden by
3506 # options specified via QAPI.
3508 # @snapshot: Ceph snapshot name.
3510 # @user: Ceph id name.
3512 # @auth-client-required: Acceptable authentication modes.
3513 # This maps to Ceph configuration option
3514 # "auth_client_required". (Since 3.0)
3516 # @key-secret: ID of a QCryptoSecret object providing a key
3517 # for cephx authentication.
3518 # This maps to Ceph configuration option
3519 # "key". (Since 3.0)
3521 # @server: Monitor host address and port. This maps
3522 # to the "mon_host" Ceph option.
3526 { 'struct': 'BlockdevOptionsRbd',
3527 'data': { 'pool': 'str',
3532 '*auth-client-required': ['RbdAuthMode'],
3533 '*key-secret': 'str',
3534 '*server': ['InetSocketAddressBase'] } }
3537 # @BlockdevOptionsSheepdog:
3539 # Driver specific block device options for sheepdog
3541 # @vdi: Virtual disk image name
3542 # @server: The Sheepdog server to connect to
3543 # @snap-id: Snapshot ID
3544 # @tag: Snapshot tag name
3546 # Only one of @snap-id and @tag may be present.
3550 { 'struct': 'BlockdevOptionsSheepdog',
3551 'data': { 'server': 'SocketAddress',
3553 '*snap-id': 'uint32',
3559 # An enumeration of replication modes.
3561 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3563 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3567 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3568 'if': 'defined(CONFIG_REPLICATION)' }
3571 # @BlockdevOptionsReplication:
3573 # Driver specific block device options for replication
3575 # @mode: the replication mode
3577 # @top-id: In secondary mode, node name or device ID of the root
3578 # node who owns the replication node chain. Must not be given in
3583 { 'struct': 'BlockdevOptionsReplication',
3584 'base': 'BlockdevOptionsGenericFormat',
3585 'data': { 'mode': 'ReplicationMode',
3587 'if': 'defined(CONFIG_REPLICATION)' }
3592 # An enumeration of NFS transport types
3594 # @inet: TCP transport
3598 { 'enum': 'NFSTransport',
3599 'data': [ 'inet' ] }
3604 # Captures the address of the socket
3606 # @type: transport type used for NFS (only TCP supported)
3608 # @host: host address for NFS server
3612 { 'struct': 'NFSServer',
3613 'data': { 'type': 'NFSTransport',
3617 # @BlockdevOptionsNfs:
3619 # Driver specific block device option for NFS
3621 # @server: host address
3623 # @path: path of the image on the host
3625 # @user: UID value to use when talking to the
3626 # server (defaults to 65534 on Windows and getuid()
3629 # @group: GID value to use when talking to the
3630 # server (defaults to 65534 on Windows and getgid()
3633 # @tcp-syn-count: number of SYNs during the session
3634 # establishment (defaults to libnfs default)
3636 # @readahead-size: set the readahead size in bytes (defaults
3637 # to libnfs default)
3639 # @page-cache-size: set the pagecache size in bytes (defaults
3640 # to libnfs default)
3642 # @debug: set the NFS debug level (max 2) (defaults
3643 # to libnfs default)
3647 { 'struct': 'BlockdevOptionsNfs',
3648 'data': { 'server': 'NFSServer',
3652 '*tcp-syn-count': 'int',
3653 '*readahead-size': 'int',
3654 '*page-cache-size': 'int',
3658 # @BlockdevOptionsCurlBase:
3660 # Driver specific block device options shared by all protocols supported by the
3663 # @url: URL of the image file
3665 # @readahead: Size of the read-ahead cache; must be a multiple of
3666 # 512 (defaults to 256 kB)
3668 # @timeout: Timeout for connections, in seconds (defaults to 5)
3670 # @username: Username for authentication (defaults to none)
3672 # @password-secret: ID of a QCryptoSecret object providing a password
3673 # for authentication (defaults to no password)
3675 # @proxy-username: Username for proxy authentication (defaults to none)
3677 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3678 # for proxy authentication (defaults to no password)
3682 { 'struct': 'BlockdevOptionsCurlBase',
3683 'data': { 'url': 'str',
3684 '*readahead': 'int',
3687 '*password-secret': 'str',
3688 '*proxy-username': 'str',
3689 '*proxy-password-secret': 'str' } }
3692 # @BlockdevOptionsCurlHttp:
3694 # Driver specific block device options for HTTP connections over the curl
3695 # backend. URLs must start with "http://".
3697 # @cookie: List of cookies to set; format is
3698 # "name1=content1; name2=content2;" as explained by
3699 # CURLOPT_COOKIE(3). Defaults to no cookies.
3701 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3702 # secure way. See @cookie for the format. (since 2.10)
3706 { 'struct': 'BlockdevOptionsCurlHttp',
3707 'base': 'BlockdevOptionsCurlBase',
3708 'data': { '*cookie': 'str',
3709 '*cookie-secret': 'str'} }
3712 # @BlockdevOptionsCurlHttps:
3714 # Driver specific block device options for HTTPS connections over the curl
3715 # backend. URLs must start with "https://".
3717 # @cookie: List of cookies to set; format is
3718 # "name1=content1; name2=content2;" as explained by
3719 # CURLOPT_COOKIE(3). Defaults to no cookies.
3721 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3724 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3725 # secure way. See @cookie for the format. (since 2.10)
3729 { 'struct': 'BlockdevOptionsCurlHttps',
3730 'base': 'BlockdevOptionsCurlBase',
3731 'data': { '*cookie': 'str',
3732 '*sslverify': 'bool',
3733 '*cookie-secret': 'str'} }
3736 # @BlockdevOptionsCurlFtp:
3738 # Driver specific block device options for FTP connections over the curl
3739 # backend. URLs must start with "ftp://".
3743 { 'struct': 'BlockdevOptionsCurlFtp',
3744 'base': 'BlockdevOptionsCurlBase',
3748 # @BlockdevOptionsCurlFtps:
3750 # Driver specific block device options for FTPS connections over the curl
3751 # backend. URLs must start with "ftps://".
3753 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3758 { 'struct': 'BlockdevOptionsCurlFtps',
3759 'base': 'BlockdevOptionsCurlBase',
3760 'data': { '*sslverify': 'bool' } }
3763 # @BlockdevOptionsNbd:
3765 # Driver specific block device options for NBD.
3767 # @server: NBD server address
3769 # @export: export name
3771 # @tls-creds: TLS credentials ID
3773 # @x-dirty-bitmap: A "qemu:dirty-bitmap:NAME" string to query in place of
3774 # traditional "base:allocation" block status (see
3775 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol) (since 3.0)
3779 { 'struct': 'BlockdevOptionsNbd',
3780 'data': { 'server': 'SocketAddress',
3782 '*tls-creds': 'str',
3783 '*x-dirty-bitmap': 'str' } }
3786 # @BlockdevOptionsRaw:
3788 # Driver specific block device options for the raw driver.
3790 # @offset: position where the block device starts
3791 # @size: the assumed size of the device
3795 { 'struct': 'BlockdevOptionsRaw',
3796 'base': 'BlockdevOptionsGenericFormat',
3797 'data': { '*offset': 'int', '*size': 'int' } }
3800 # @BlockdevOptionsVxHS:
3802 # Driver specific block device options for VxHS
3804 # @vdisk-id: UUID of VxHS volume
3805 # @server: vxhs server IP, port
3806 # @tls-creds: TLS credentials ID
3810 { 'struct': 'BlockdevOptionsVxHS',
3811 'data': { 'vdisk-id': 'str',
3812 'server': 'InetSocketAddressBase',
3813 '*tls-creds': 'str' } }
3816 # @BlockdevOptionsThrottle:
3818 # Driver specific block device options for the throttle driver
3820 # @throttle-group: the name of the throttle-group object to use. It
3821 # must already exist.
3822 # @file: reference to or definition of the data source block device
3825 { 'struct': 'BlockdevOptionsThrottle',
3826 'data': { 'throttle-group': 'str',
3827 'file' : 'BlockdevRef'
3832 # Options for creating a block device. Many options are available for all
3833 # block devices, independent of the block driver:
3835 # @driver: block driver name
3836 # @node-name: the node name of the new node (Since 2.0).
3837 # This option is required on the top level of blockdev-add.
3838 # Valid node names start with an alphabetic character and may
3839 # contain only alphanumeric characters, '-', '.' and '_'. Their
3840 # maximum length is 31 characters.
3841 # @discard: discard-related options (default: ignore)
3842 # @cache: cache-related options
3843 # @read-only: whether the block device should be read-only (default: false).
3844 # Note that some block drivers support only read-only access,
3845 # either generally or in certain configurations. In this case,
3846 # the default value does not work and the option must be
3847 # specified explicitly.
3848 # @auto-read-only: if true and @read-only is false, QEMU may automatically
3849 # decide not to open the image read-write as requested, but
3850 # fall back to read-only instead (and switch between the modes
3851 # later), e.g. depending on whether the image file is writable
3852 # or whether a writing user is attached to the node
3853 # (default: false, since 3.1)
3854 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3856 # @force-share: force share all permission on added nodes.
3857 # Requires read-only=true. (Since 2.10)
3859 # Remaining options are determined by the block driver.
3863 { 'union': 'BlockdevOptions',
3864 'base': { 'driver': 'BlockdevDriver',
3865 '*node-name': 'str',
3866 '*discard': 'BlockdevDiscardOptions',
3867 '*cache': 'BlockdevCacheOptions',
3868 '*read-only': 'bool',
3869 '*auto-read-only': 'bool',
3870 '*force-share': 'bool',
3871 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3872 'discriminator': 'driver',
3874 'blkdebug': 'BlockdevOptionsBlkdebug',
3875 'blklogwrites':'BlockdevOptionsBlklogwrites',
3876 'blkverify': 'BlockdevOptionsBlkverify',
3877 'bochs': 'BlockdevOptionsGenericFormat',
3878 'cloop': 'BlockdevOptionsGenericFormat',
3879 'copy-on-read':'BlockdevOptionsGenericFormat',
3880 'dmg': 'BlockdevOptionsGenericFormat',
3881 'file': 'BlockdevOptionsFile',
3882 'ftp': 'BlockdevOptionsCurlFtp',
3883 'ftps': 'BlockdevOptionsCurlFtps',
3884 'gluster': 'BlockdevOptionsGluster',
3885 'host_cdrom': 'BlockdevOptionsFile',
3886 'host_device':'BlockdevOptionsFile',
3887 'http': 'BlockdevOptionsCurlHttp',
3888 'https': 'BlockdevOptionsCurlHttps',
3889 'iscsi': 'BlockdevOptionsIscsi',
3890 'luks': 'BlockdevOptionsLUKS',
3891 'nbd': 'BlockdevOptionsNbd',
3892 'nfs': 'BlockdevOptionsNfs',
3893 'null-aio': 'BlockdevOptionsNull',
3894 'null-co': 'BlockdevOptionsNull',
3895 'nvme': 'BlockdevOptionsNVMe',
3896 'parallels': 'BlockdevOptionsGenericFormat',
3897 'qcow2': 'BlockdevOptionsQcow2',
3898 'qcow': 'BlockdevOptionsQcow',
3899 'qed': 'BlockdevOptionsGenericCOWFormat',
3900 'quorum': 'BlockdevOptionsQuorum',
3901 'raw': 'BlockdevOptionsRaw',
3902 'rbd': 'BlockdevOptionsRbd',
3903 'replication': { 'type': 'BlockdevOptionsReplication',
3904 'if': 'defined(CONFIG_REPLICATION)' },
3905 'sheepdog': 'BlockdevOptionsSheepdog',
3906 'ssh': 'BlockdevOptionsSsh',
3907 'throttle': 'BlockdevOptionsThrottle',
3908 'vdi': 'BlockdevOptionsGenericFormat',
3909 'vhdx': 'BlockdevOptionsGenericFormat',
3910 'vmdk': 'BlockdevOptionsGenericCOWFormat',
3911 'vpc': 'BlockdevOptionsGenericFormat',
3912 'vvfat': 'BlockdevOptionsVVFAT',
3913 'vxhs': 'BlockdevOptionsVxHS'
3919 # Reference to a block device.
3921 # @definition: defines a new block device inline
3922 # @reference: references the ID of an existing block device
3926 { 'alternate': 'BlockdevRef',
3927 'data': { 'definition': 'BlockdevOptions',
3928 'reference': 'str' } }
3931 # @BlockdevRefOrNull:
3933 # Reference to a block device.
3935 # @definition: defines a new block device inline
3936 # @reference: references the ID of an existing block device.
3937 # An empty string means that no block device should
3938 # be referenced. Deprecated; use null instead.
3939 # @null: No block device should be referenced (since 2.10)
3943 { 'alternate': 'BlockdevRefOrNull',
3944 'data': { 'definition': 'BlockdevOptions',
3951 # Creates a new block device. If the @id option is given at the top level, a
3952 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
3953 # level and no BlockBackend will be created.
3960 # -> { "execute": "blockdev-add",
3962 # "driver": "qcow2",
3963 # "node-name": "test1",
3966 # "filename": "test.qcow2"
3970 # <- { "return": {} }
3973 # -> { "execute": "blockdev-add",
3975 # "driver": "qcow2",
3976 # "node-name": "node0",
3977 # "discard": "unmap",
3983 # "filename": "/tmp/test.qcow2"
3989 # "filename": "/dev/fdset/4"
3995 # <- { "return": {} }
3998 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
4001 # @x-blockdev-reopen:
4003 # Reopens a block device using the given set of options. Any option
4004 # not specified will be reset to its default value regardless of its
4005 # previous status. If an option cannot be changed or a particular
4006 # driver does not support reopening then the command will return an
4009 # The top-level @node-name option (from BlockdevOptions) must be
4010 # specified and is used to select the block device to be reopened.
4011 # Other @node-name options must be either omitted or set to the
4012 # current name of the appropriate node. This command won't change any
4013 # node name and any attempt to do it will result in an error.
4015 # In the case of options that refer to child nodes, the behavior of
4016 # this command depends on the value:
4018 # 1) A set of options (BlockdevOptions): the child is reopened with
4019 # the specified set of options.
4021 # 2) A reference to the current child: the child is reopened using
4022 # its existing set of options.
4024 # 3) A reference to a different node: the current child is replaced
4025 # with the specified one.
4027 # 4) NULL: the current child (if any) is detached.
4029 # Options (1) and (2) are supported in all cases, but at the moment
4030 # only @backing allows replacing or detaching an existing child.
4032 # Unlike with blockdev-add, the @backing option must always be present
4033 # unless the node being reopened does not have a backing file and its
4034 # image does not have a default backing file name as part of its
4039 { 'command': 'x-blockdev-reopen',
4040 'data': 'BlockdevOptions', 'boxed': true }
4045 # Deletes a block device that has been added using blockdev-add.
4046 # The command will fail if the node is attached to a device or is
4047 # otherwise being used.
4049 # @node-name: Name of the graph node to delete.
4055 # -> { "execute": "blockdev-add",
4057 # "driver": "qcow2",
4058 # "node-name": "node0",
4061 # "filename": "test.qcow2"
4065 # <- { "return": {} }
4067 # -> { "execute": "blockdev-del",
4068 # "arguments": { "node-name": "node0" }
4070 # <- { "return": {} }
4073 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
4076 # @BlockdevCreateOptionsFile:
4078 # Driver specific image creation options for file.
4080 # @filename Filename for the new image file
4081 # @size Size of the virtual disk in bytes
4082 # @preallocation Preallocation mode for the new image (default: off)
4083 # @nocow Turn off copy-on-write (valid only on btrfs; default: off)
4087 { 'struct': 'BlockdevCreateOptionsFile',
4088 'data': { 'filename': 'str',
4090 '*preallocation': 'PreallocMode',
4091 '*nocow': 'bool' } }
4094 # @BlockdevCreateOptionsGluster:
4096 # Driver specific image creation options for gluster.
4098 # @location Where to store the new image file
4099 # @size Size of the virtual disk in bytes
4100 # @preallocation Preallocation mode for the new image (default: off)
4104 { 'struct': 'BlockdevCreateOptionsGluster',
4105 'data': { 'location': 'BlockdevOptionsGluster',
4107 '*preallocation': 'PreallocMode' } }
4110 # @BlockdevCreateOptionsLUKS:
4112 # Driver specific image creation options for LUKS.
4114 # @file Node to create the image format on
4115 # @size Size of the virtual disk in bytes
4119 { 'struct': 'BlockdevCreateOptionsLUKS',
4120 'base': 'QCryptoBlockCreateOptionsLUKS',
4121 'data': { 'file': 'BlockdevRef',
4125 # @BlockdevCreateOptionsNfs:
4127 # Driver specific image creation options for NFS.
4129 # @location Where to store the new image file
4130 # @size Size of the virtual disk in bytes
4134 { 'struct': 'BlockdevCreateOptionsNfs',
4135 'data': { 'location': 'BlockdevOptionsNfs',
4139 # @BlockdevCreateOptionsParallels:
4141 # Driver specific image creation options for parallels.
4143 # @file Node to create the image format on
4144 # @size Size of the virtual disk in bytes
4145 # @cluster-size Cluster size in bytes (default: 1 MB)
4149 { 'struct': 'BlockdevCreateOptionsParallels',
4150 'data': { 'file': 'BlockdevRef',
4152 '*cluster-size': 'size' } }
4155 # @BlockdevCreateOptionsQcow:
4157 # Driver specific image creation options for qcow.
4159 # @file Node to create the image format on
4160 # @size Size of the virtual disk in bytes
4161 # @backing-file File name of the backing file if a backing file
4163 # @encrypt Encryption options if the image should be encrypted
4167 { 'struct': 'BlockdevCreateOptionsQcow',
4168 'data': { 'file': 'BlockdevRef',
4170 '*backing-file': 'str',
4171 '*encrypt': 'QCryptoBlockCreateOptions' } }
4174 # @BlockdevQcow2Version:
4176 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4177 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4181 { 'enum': 'BlockdevQcow2Version',
4182 'data': [ 'v2', 'v3' ] }
4186 # @BlockdevCreateOptionsQcow2:
4188 # Driver specific image creation options for qcow2.
4190 # @file Node to create the image format on
4191 # @data-file Node to use as an external data file in which all guest
4192 # data is stored so that only metadata remains in the qcow2
4194 # @data-file-raw True if the external data file must stay valid as a
4195 # standalone (read-only) raw image without looking at qcow2
4196 # metadata (default: false; since: 4.0)
4197 # @size Size of the virtual disk in bytes
4198 # @version Compatibility level (default: v3)
4199 # @backing-file File name of the backing file if a backing file
4201 # @backing-fmt Name of the block driver to use for the backing file
4202 # @encrypt Encryption options if the image should be encrypted
4203 # @cluster-size qcow2 cluster size in bytes (default: 65536)
4204 # @preallocation Preallocation mode for the new image (default: off)
4205 # @lazy-refcounts True if refcounts may be updated lazily (default: off)
4206 # @refcount-bits Width of reference counts in bits (default: 16)
4210 { 'struct': 'BlockdevCreateOptionsQcow2',
4211 'data': { 'file': 'BlockdevRef',
4212 '*data-file': 'BlockdevRef',
4213 '*data-file-raw': 'bool',
4215 '*version': 'BlockdevQcow2Version',
4216 '*backing-file': 'str',
4217 '*backing-fmt': 'BlockdevDriver',
4218 '*encrypt': 'QCryptoBlockCreateOptions',
4219 '*cluster-size': 'size',
4220 '*preallocation': 'PreallocMode',
4221 '*lazy-refcounts': 'bool',
4222 '*refcount-bits': 'int' } }
4225 # @BlockdevCreateOptionsQed:
4227 # Driver specific image creation options for qed.
4229 # @file Node to create the image format on
4230 # @size Size of the virtual disk in bytes
4231 # @backing-file File name of the backing file if a backing file
4233 # @backing-fmt Name of the block driver to use for the backing file
4234 # @cluster-size Cluster size in bytes (default: 65536)
4235 # @table-size L1/L2 table size (in clusters)
4239 { 'struct': 'BlockdevCreateOptionsQed',
4240 'data': { 'file': 'BlockdevRef',
4242 '*backing-file': 'str',
4243 '*backing-fmt': 'BlockdevDriver',
4244 '*cluster-size': 'size',
4245 '*table-size': 'int' } }
4248 # @BlockdevCreateOptionsRbd:
4250 # Driver specific image creation options for rbd/Ceph.
4252 # @location Where to store the new image file. This location cannot
4253 # point to a snapshot.
4254 # @size Size of the virtual disk in bytes
4255 # @cluster-size RBD object size
4259 { 'struct': 'BlockdevCreateOptionsRbd',
4260 'data': { 'location': 'BlockdevOptionsRbd',
4262 '*cluster-size' : 'size' } }
4265 # @BlockdevVmdkSubformat:
4267 # Subformat options for VMDK images
4269 # @monolithicSparse: Single file image with sparse cluster allocation
4271 # @monolithicFlat: Single flat data image and a descriptor file
4273 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4274 # files, in addition to a descriptor file
4276 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4277 # files, in addition to a descriptor file
4279 # @streamOptimized: Single file image sparse cluster allocation, optimized
4280 # for streaming over network.
4284 { 'enum': 'BlockdevVmdkSubformat',
4285 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4286 'twoGbMaxExtentFlat', 'streamOptimized'] }
4289 # @BlockdevVmdkAdapterType:
4291 # Adapter type info for VMDK images
4295 { 'enum': 'BlockdevVmdkAdapterType',
4296 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4299 # @BlockdevCreateOptionsVmdk:
4301 # Driver specific image creation options for VMDK.
4303 # @file Where to store the new image file. This refers to the image
4304 # file for monolithcSparse and streamOptimized format, or the
4305 # descriptor file for other formats.
4306 # @size Size of the virtual disk in bytes
4307 # @extents Where to store the data extents. Required for monolithcFlat,
4308 # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4309 # monolithicFlat, only one entry is required; for
4310 # twoGbMaxExtent* formats, the number of entries required is
4311 # calculated as extent_number = virtual_size / 2GB. Providing
4312 # more extents than will be used is an error.
4313 # @subformat The subformat of the VMDK image. Default: "monolithicSparse".
4314 # @backing-file The path of backing file. Default: no backing file is used.
4315 # @adapter-type The adapter type used to fill in the descriptor. Default: ide.
4316 # @hwversion Hardware version. The meaningful options are "4" or "6".
4318 # @zeroed-grain Whether to enable zeroed-grain feature for sparse subformats.
4323 { 'struct': 'BlockdevCreateOptionsVmdk',
4324 'data': { 'file': 'BlockdevRef',
4326 '*extents': ['BlockdevRef'],
4327 '*subformat': 'BlockdevVmdkSubformat',
4328 '*backing-file': 'str',
4329 '*adapter-type': 'BlockdevVmdkAdapterType',
4330 '*hwversion': 'str',
4331 '*zeroed-grain': 'bool' } }
4335 # @SheepdogRedundancyType:
4337 # @full Create a fully replicated vdi with x copies
4338 # @erasure-coded Create an erasure coded vdi with x data strips and
4343 { 'enum': 'SheepdogRedundancyType',
4344 'data': [ 'full', 'erasure-coded' ] }
4347 # @SheepdogRedundancyFull:
4349 # @copies Number of copies to use (between 1 and 31)
4353 { 'struct': 'SheepdogRedundancyFull',
4354 'data': { 'copies': 'int' }}
4357 # @SheepdogRedundancyErasureCoded:
4359 # @data-strips Number of data strips to use (one of {2,4,8,16})
4360 # @parity-strips Number of parity strips to use (between 1 and 15)
4364 { 'struct': 'SheepdogRedundancyErasureCoded',
4365 'data': { 'data-strips': 'int',
4366 'parity-strips': 'int' }}
4369 # @SheepdogRedundancy:
4373 { 'union': 'SheepdogRedundancy',
4374 'base': { 'type': 'SheepdogRedundancyType' },
4375 'discriminator': 'type',
4376 'data': { 'full': 'SheepdogRedundancyFull',
4377 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
4380 # @BlockdevCreateOptionsSheepdog:
4382 # Driver specific image creation options for Sheepdog.
4384 # @location Where to store the new image file
4385 # @size Size of the virtual disk in bytes
4386 # @backing-file File name of a base image
4387 # @preallocation Preallocation mode (allowed values: off, full)
4388 # @redundancy Redundancy of the image
4389 # @object-size Object size of the image
4393 { 'struct': 'BlockdevCreateOptionsSheepdog',
4394 'data': { 'location': 'BlockdevOptionsSheepdog',
4396 '*backing-file': 'str',
4397 '*preallocation': 'PreallocMode',
4398 '*redundancy': 'SheepdogRedundancy',
4399 '*object-size': 'size' } }
4402 # @BlockdevCreateOptionsSsh:
4404 # Driver specific image creation options for SSH.
4406 # @location Where to store the new image file
4407 # @size Size of the virtual disk in bytes
4411 { 'struct': 'BlockdevCreateOptionsSsh',
4412 'data': { 'location': 'BlockdevOptionsSsh',
4416 # @BlockdevCreateOptionsVdi:
4418 # Driver specific image creation options for VDI.
4420 # @file Node to create the image format on
4421 # @size Size of the virtual disk in bytes
4422 # @preallocation Preallocation mode for the new image (allowed values: off,
4423 # metadata; default: off)
4427 { 'struct': 'BlockdevCreateOptionsVdi',
4428 'data': { 'file': 'BlockdevRef',
4430 '*preallocation': 'PreallocMode' } }
4433 # @BlockdevVhdxSubformat:
4435 # @dynamic: Growing image file
4436 # @fixed: Preallocated fixed-size image file
4440 { 'enum': 'BlockdevVhdxSubformat',
4441 'data': [ 'dynamic', 'fixed' ] }
4444 # @BlockdevCreateOptionsVhdx:
4446 # Driver specific image creation options for vhdx.
4448 # @file Node to create the image format on
4449 # @size Size of the virtual disk in bytes
4450 # @log-size Log size in bytes, must be a multiple of 1 MB
4452 # @block-size Block size in bytes, must be a multiple of 1 MB and not
4453 # larger than 256 MB (default: automatically choose a block
4454 # size depending on the image size)
4455 # @subformat vhdx subformat (default: dynamic)
4456 # @block-state-zero Force use of payload blocks of type 'ZERO'. Non-standard,
4457 # but default. Do not set to 'off' when using 'qemu-img
4458 # convert' with subformat=dynamic.
4462 { 'struct': 'BlockdevCreateOptionsVhdx',
4463 'data': { 'file': 'BlockdevRef',
4465 '*log-size': 'size',
4466 '*block-size': 'size',
4467 '*subformat': 'BlockdevVhdxSubformat',
4468 '*block-state-zero': 'bool' } }
4471 # @BlockdevVpcSubformat:
4473 # @dynamic: Growing image file
4474 # @fixed: Preallocated fixed-size image file
4478 { 'enum': 'BlockdevVpcSubformat',
4479 'data': [ 'dynamic', 'fixed' ] }
4482 # @BlockdevCreateOptionsVpc:
4484 # Driver specific image creation options for vpc (VHD).
4486 # @file Node to create the image format on
4487 # @size Size of the virtual disk in bytes
4488 # @subformat vhdx subformat (default: dynamic)
4489 # @force-size Force use of the exact byte size instead of rounding to the
4490 # next size that can be represented in CHS geometry
4495 { 'struct': 'BlockdevCreateOptionsVpc',
4496 'data': { 'file': 'BlockdevRef',
4498 '*subformat': 'BlockdevVpcSubformat',
4499 '*force-size': 'bool' } }
4502 # @BlockdevCreateOptions:
4504 # Options for creating an image format on a given node.
4506 # @driver block driver to create the image format
4510 { 'union': 'BlockdevCreateOptions',
4512 'driver': 'BlockdevDriver' },
4513 'discriminator': 'driver',
4515 'file': 'BlockdevCreateOptionsFile',
4516 'gluster': 'BlockdevCreateOptionsGluster',
4517 'luks': 'BlockdevCreateOptionsLUKS',
4518 'nfs': 'BlockdevCreateOptionsNfs',
4519 'parallels': 'BlockdevCreateOptionsParallels',
4520 'qcow': 'BlockdevCreateOptionsQcow',
4521 'qcow2': 'BlockdevCreateOptionsQcow2',
4522 'qed': 'BlockdevCreateOptionsQed',
4523 'rbd': 'BlockdevCreateOptionsRbd',
4524 'sheepdog': 'BlockdevCreateOptionsSheepdog',
4525 'ssh': 'BlockdevCreateOptionsSsh',
4526 'vdi': 'BlockdevCreateOptionsVdi',
4527 'vhdx': 'BlockdevCreateOptionsVhdx',
4528 'vmdk': 'BlockdevCreateOptionsVmdk',
4529 'vpc': 'BlockdevCreateOptionsVpc'
4535 # Starts a job to create an image format on a given node. The job is
4536 # automatically finalized, but a manual job-dismiss is required.
4538 # @job-id: Identifier for the newly created job.
4540 # @options: Options for the image creation.
4544 { 'command': 'blockdev-create',
4545 'data': { 'job-id': 'str',
4546 'options': 'BlockdevCreateOptions' } }
4549 # @blockdev-open-tray:
4551 # Opens a block device's tray. If there is a block driver state tree inserted as
4552 # a medium, it will become inaccessible to the guest (but it will remain
4553 # associated to the block device, so closing the tray will make it accessible
4556 # If the tray was already open before, this will be a no-op.
4558 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4559 # which no such event will be generated, these include:
4560 # - if the guest has locked the tray, @force is false and the guest does not
4561 # respond to the eject request
4562 # - if the BlockBackend denoted by @device does not have a guest device attached
4564 # - if the guest device does not have an actual tray
4566 # @device: Block device name (deprecated, use @id instead)
4568 # @id: The name or QOM path of the guest device (since: 2.8)
4570 # @force: if false (the default), an eject request will be sent to
4571 # the guest if it has locked the tray (and the tray will not be opened
4572 # immediately); if true, the tray will be opened regardless of whether
4579 # -> { "execute": "blockdev-open-tray",
4580 # "arguments": { "id": "ide0-1-0" } }
4582 # <- { "timestamp": { "seconds": 1418751016,
4583 # "microseconds": 716996 },
4584 # "event": "DEVICE_TRAY_MOVED",
4585 # "data": { "device": "ide1-cd0",
4587 # "tray-open": true } }
4589 # <- { "return": {} }
4592 { 'command': 'blockdev-open-tray',
4593 'data': { '*device': 'str',
4595 '*force': 'bool' } }
4598 # @blockdev-close-tray:
4600 # Closes a block device's tray. If there is a block driver state tree associated
4601 # with the block device (which is currently ejected), that tree will be loaded
4604 # If the tray was already closed before, this will be a no-op.
4606 # @device: Block device name (deprecated, use @id instead)
4608 # @id: The name or QOM path of the guest device (since: 2.8)
4614 # -> { "execute": "blockdev-close-tray",
4615 # "arguments": { "id": "ide0-1-0" } }
4617 # <- { "timestamp": { "seconds": 1418751345,
4618 # "microseconds": 272147 },
4619 # "event": "DEVICE_TRAY_MOVED",
4620 # "data": { "device": "ide1-cd0",
4622 # "tray-open": false } }
4624 # <- { "return": {} }
4627 { 'command': 'blockdev-close-tray',
4628 'data': { '*device': 'str',
4632 # @blockdev-remove-medium:
4634 # Removes a medium (a block driver state tree) from a block device. That block
4635 # device's tray must currently be open (unless there is no attached guest
4638 # If the tray is open and there is no medium inserted, this will be a no-op.
4640 # @id: The name or QOM path of the guest device
4646 # -> { "execute": "blockdev-remove-medium",
4647 # "arguments": { "id": "ide0-1-0" } }
4649 # <- { "error": { "class": "GenericError",
4650 # "desc": "Tray of device 'ide0-1-0' is not open" } }
4652 # -> { "execute": "blockdev-open-tray",
4653 # "arguments": { "id": "ide0-1-0" } }
4655 # <- { "timestamp": { "seconds": 1418751627,
4656 # "microseconds": 549958 },
4657 # "event": "DEVICE_TRAY_MOVED",
4658 # "data": { "device": "ide1-cd0",
4660 # "tray-open": true } }
4662 # <- { "return": {} }
4664 # -> { "execute": "blockdev-remove-medium",
4665 # "arguments": { "id": "ide0-1-0" } }
4667 # <- { "return": {} }
4670 { 'command': 'blockdev-remove-medium',
4671 'data': { 'id': 'str' } }
4674 # @blockdev-insert-medium:
4676 # Inserts a medium (a block driver state tree) into a block device. That block
4677 # device's tray must currently be open (unless there is no attached guest
4678 # device) and there must be no medium inserted already.
4680 # @id: The name or QOM path of the guest device
4682 # @node-name: name of a node in the block driver state graph
4688 # -> { "execute": "blockdev-add",
4690 # "node-name": "node0",
4692 # "file": { "driver": "file",
4693 # "filename": "fedora.iso" } } }
4694 # <- { "return": {} }
4696 # -> { "execute": "blockdev-insert-medium",
4697 # "arguments": { "id": "ide0-1-0",
4698 # "node-name": "node0" } }
4700 # <- { "return": {} }
4703 { 'command': 'blockdev-insert-medium',
4704 'data': { 'id': 'str',
4705 'node-name': 'str'} }
4709 # @BlockdevChangeReadOnlyMode:
4711 # Specifies the new read-only mode of a block device subject to the
4712 # @blockdev-change-medium command.
4714 # @retain: Retains the current read-only mode
4716 # @read-only: Makes the device read-only
4718 # @read-write: Makes the device writable
4723 { 'enum': 'BlockdevChangeReadOnlyMode',
4724 'data': ['retain', 'read-only', 'read-write'] }
4728 # @blockdev-change-medium:
4730 # Changes the medium inserted into a block device by ejecting the current medium
4731 # and loading a new image file which is inserted as the new medium (this command
4732 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
4733 # and blockdev-close-tray).
4735 # @device: Block device name (deprecated, use @id instead)
4737 # @id: The name or QOM path of the guest device
4740 # @filename: filename of the new image to be loaded
4742 # @format: format to open the new image with (defaults to
4743 # the probed format)
4745 # @read-only-mode: change the read-only mode of the device; defaults
4752 # 1. Change a removable medium
4754 # -> { "execute": "blockdev-change-medium",
4755 # "arguments": { "id": "ide0-1-0",
4756 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4757 # "format": "raw" } }
4758 # <- { "return": {} }
4760 # 2. Load a read-only medium into a writable drive
4762 # -> { "execute": "blockdev-change-medium",
4763 # "arguments": { "id": "floppyA",
4764 # "filename": "/srv/images/ro.img",
4766 # "read-only-mode": "retain" } }
4769 # { "class": "GenericError",
4770 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4772 # -> { "execute": "blockdev-change-medium",
4773 # "arguments": { "id": "floppyA",
4774 # "filename": "/srv/images/ro.img",
4776 # "read-only-mode": "read-only" } }
4778 # <- { "return": {} }
4781 { 'command': 'blockdev-change-medium',
4782 'data': { '*device': 'str',
4786 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
4790 # @BlockErrorAction:
4792 # An enumeration of action that has been taken when a DISK I/O occurs
4794 # @ignore: error has been ignored
4796 # @report: error has been reported to the device
4798 # @stop: error caused VM to be stopped
4802 { 'enum': 'BlockErrorAction',
4803 'data': [ 'ignore', 'report', 'stop' ] }
4807 # @BLOCK_IMAGE_CORRUPTED:
4809 # Emitted when a disk image is being marked corrupt. The image can be
4810 # identified by its device or node name. The 'device' field is always
4811 # present for compatibility reasons, but it can be empty ("") if the
4812 # image does not have a device name associated.
4814 # @device: device name. This is always present for compatibility
4815 # reasons, but it can be empty ("") if the image does not
4816 # have a device name associated.
4818 # @node-name: node name (Since: 2.4)
4820 # @msg: informative message for human consumption, such as the kind of
4821 # corruption being detected. It should not be parsed by machine as it is
4822 # not guaranteed to be stable
4824 # @offset: if the corruption resulted from an image access, this is
4825 # the host's access offset into the image
4827 # @size: if the corruption resulted from an image access, this is
4830 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4831 # event and must be repaired (Since 2.2; before, every
4832 # BLOCK_IMAGE_CORRUPTED event was fatal)
4834 # Note: If action is "stop", a STOP event will eventually follow the
4835 # BLOCK_IO_ERROR event.
4839 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4840 # "data": { "device": "ide0-hd0", "node-name": "node0",
4841 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4843 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4847 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4848 'data': { 'device' : 'str',
4849 '*node-name' : 'str',
4853 'fatal' : 'bool' } }
4858 # Emitted when a disk I/O error occurs
4860 # @device: device name. This is always present for compatibility
4861 # reasons, but it can be empty ("") if the image does not
4862 # have a device name associated.
4864 # @node-name: node name. Note that errors may be reported for the root node
4865 # that is directly attached to a guest device rather than for the
4866 # node where the error occurred. The node name is not present if
4867 # the drive is empty. (Since: 2.8)
4869 # @operation: I/O operation
4871 # @action: action that has been taken
4873 # @nospace: true if I/O error was caused due to a no-space
4874 # condition. This key is only present if query-block's
4875 # io-status is present, please see query-block documentation
4876 # for more information (since: 2.2)
4878 # @reason: human readable string describing the error cause.
4879 # (This field is a debugging aid for humans, it should not
4880 # be parsed by applications) (since: 2.2)
4882 # Note: If action is "stop", a STOP event will eventually follow the
4883 # BLOCK_IO_ERROR event
4889 # <- { "event": "BLOCK_IO_ERROR",
4890 # "data": { "device": "ide0-hd1",
4891 # "node-name": "#block212",
4892 # "operation": "write",
4893 # "action": "stop" },
4894 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4897 { 'event': 'BLOCK_IO_ERROR',
4898 'data': { 'device': 'str', '*node-name': 'str',
4899 'operation': 'IoOperationType',
4900 'action': 'BlockErrorAction', '*nospace': 'bool',
4904 # @BLOCK_JOB_COMPLETED:
4906 # Emitted when a block job has completed
4910 # @device: The job identifier. Originally the device name but other
4911 # values are allowed since QEMU 2.7
4913 # @len: maximum progress value
4915 # @offset: current progress value. On success this is equal to len.
4916 # On failure this is less than len
4918 # @speed: rate limit, bytes per second
4920 # @error: error message. Only present on failure. This field
4921 # contains a human-readable error message. There are no semantics
4922 # other than that streaming has failed and clients should not try to
4923 # interpret the error string
4929 # <- { "event": "BLOCK_JOB_COMPLETED",
4930 # "data": { "type": "stream", "device": "virtio-disk0",
4931 # "len": 10737418240, "offset": 10737418240,
4933 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4936 { 'event': 'BLOCK_JOB_COMPLETED',
4937 'data': { 'type' : 'JobType',
4945 # @BLOCK_JOB_CANCELLED:
4947 # Emitted when a block job has been cancelled
4951 # @device: The job identifier. Originally the device name but other
4952 # values are allowed since QEMU 2.7
4954 # @len: maximum progress value
4956 # @offset: current progress value. On success this is equal to len.
4957 # On failure this is less than len
4959 # @speed: rate limit, bytes per second
4965 # <- { "event": "BLOCK_JOB_CANCELLED",
4966 # "data": { "type": "stream", "device": "virtio-disk0",
4967 # "len": 10737418240, "offset": 134217728,
4969 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4972 { 'event': 'BLOCK_JOB_CANCELLED',
4973 'data': { 'type' : 'JobType',
4982 # Emitted when a block job encounters an error
4984 # @device: The job identifier. Originally the device name but other
4985 # values are allowed since QEMU 2.7
4987 # @operation: I/O operation
4989 # @action: action that has been taken
4995 # <- { "event": "BLOCK_JOB_ERROR",
4996 # "data": { "device": "ide0-hd1",
4997 # "operation": "write",
4998 # "action": "stop" },
4999 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5002 { 'event': 'BLOCK_JOB_ERROR',
5003 'data': { 'device' : 'str',
5004 'operation': 'IoOperationType',
5005 'action' : 'BlockErrorAction' } }
5010 # Emitted when a block job is ready to complete
5014 # @device: The job identifier. Originally the device name but other
5015 # values are allowed since QEMU 2.7
5017 # @len: maximum progress value
5019 # @offset: current progress value. On success this is equal to len.
5020 # On failure this is less than len
5022 # @speed: rate limit, bytes per second
5024 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
5031 # <- { "event": "BLOCK_JOB_READY",
5032 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5033 # "len": 2097152, "offset": 2097152 }
5034 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5037 { 'event': 'BLOCK_JOB_READY',
5038 'data': { 'type' : 'JobType',
5045 # @BLOCK_JOB_PENDING:
5047 # Emitted when a block job is awaiting explicit authorization to finalize graph
5048 # changes via @block-job-finalize. If this job is part of a transaction, it will
5049 # not emit this event until the transaction has converged first.
5053 # @id: The job identifier.
5059 # <- { "event": "BLOCK_JOB_WAITING",
5060 # "data": { "device": "drive0", "type": "mirror" },
5061 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5064 { 'event': 'BLOCK_JOB_PENDING',
5065 'data': { 'type' : 'JobType',
5071 # Preallocation mode of QEMU image file
5073 # @off: no preallocation
5074 # @metadata: preallocate only for metadata
5075 # @falloc: like @full preallocation but allocate disk space by
5076 # posix_fallocate() rather than writing zeros.
5077 # @full: preallocate all data by writing zeros to device to ensure disk
5078 # space is really available. @full preallocation also sets up
5079 # metadata correctly.
5083 { 'enum': 'PreallocMode',
5084 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5087 # @BLOCK_WRITE_THRESHOLD:
5089 # Emitted when writes on block device reaches or exceeds the
5090 # configured write threshold. For thin-provisioned devices, this
5091 # means the device should be extended to avoid pausing for
5093 # The event is one shot. Once triggered, it needs to be
5094 # re-registered with another block-set-write-threshold command.
5096 # @node-name: graph node name on which the threshold was exceeded.
5098 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5100 # @write-threshold: last configured threshold, in bytes.
5104 { 'event': 'BLOCK_WRITE_THRESHOLD',
5105 'data': { 'node-name': 'str',
5106 'amount-exceeded': 'uint64',
5107 'write-threshold': 'uint64' } }
5110 # @block-set-write-threshold:
5112 # Change the write threshold for a block drive. An event will be
5113 # delivered if a write to this block drive crosses the configured
5114 # threshold. The threshold is an offset, thus must be
5115 # non-negative. Default is no write threshold. Setting the threshold
5116 # to zero disables it.
5118 # This is useful to transparently resize thin-provisioned drives without
5119 # the guest OS noticing.
5121 # @node-name: graph node name on which the threshold must be set.
5123 # @write-threshold: configured threshold for the block device, bytes.
5124 # Use 0 to disable the threshold.
5130 # -> { "execute": "block-set-write-threshold",
5131 # "arguments": { "node-name": "mydev",
5132 # "write-threshold": 17179869184 } }
5133 # <- { "return": {} }
5136 { 'command': 'block-set-write-threshold',
5137 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
5140 # @x-blockdev-change:
5142 # Dynamically reconfigure the block driver state graph. It can be used
5143 # to add, remove, insert or replace a graph node. Currently only the
5144 # Quorum driver implements this feature to add or remove its child. This
5145 # is useful to fix a broken quorum child.
5147 # If @node is specified, it will be inserted under @parent. @child
5148 # may not be specified in this case. If both @parent and @child are
5149 # specified but @node is not, @child will be detached from @parent.
5151 # @parent: the id or name of the parent node.
5153 # @child: the name of a child under the given parent node.
5155 # @node: the name of the node that will be added.
5157 # Note: this command is experimental, and its API is not stable. It
5158 # does not support all kinds of operations, all kinds of children, nor
5159 # all block drivers.
5161 # FIXME Removing children from a quorum node means introducing gaps in the
5162 # child indices. This cannot be represented in the 'children' list of
5163 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
5165 # Warning: The data in a new quorum child MUST be consistent with that of
5166 # the rest of the array.
5172 # 1. Add a new node to a quorum
5173 # -> { "execute": "blockdev-add",
5176 # "node-name": "new_node",
5177 # "file": { "driver": "file",
5178 # "filename": "test.raw" } } }
5179 # <- { "return": {} }
5180 # -> { "execute": "x-blockdev-change",
5181 # "arguments": { "parent": "disk1",
5182 # "node": "new_node" } }
5183 # <- { "return": {} }
5185 # 2. Delete a quorum's node
5186 # -> { "execute": "x-blockdev-change",
5187 # "arguments": { "parent": "disk1",
5188 # "child": "children.1" } }
5189 # <- { "return": {} }
5192 { 'command': 'x-blockdev-change',
5193 'data' : { 'parent': 'str',
5198 # @x-blockdev-set-iothread:
5200 # Move @node and its children into the @iothread. If @iothread is null then
5201 # move @node and its children into the main loop.
5203 # The node must not be attached to a BlockBackend.
5205 # @node-name: the name of the block driver node
5207 # @iothread: the name of the IOThread object or null for the main loop
5209 # @force: true if the node and its children should be moved when a BlockBackend
5210 # is already attached
5212 # Note: this command is experimental and intended for test cases that need
5213 # control over IOThreads only.
5219 # 1. Move a node into an IOThread
5220 # -> { "execute": "x-blockdev-set-iothread",
5221 # "arguments": { "node-name": "disk1",
5222 # "iothread": "iothread0" } }
5223 # <- { "return": {} }
5225 # 2. Move a node into the main loop
5226 # -> { "execute": "x-blockdev-set-iothread",
5227 # "arguments": { "node-name": "disk1",
5228 # "iothread": null } }
5229 # <- { "return": {} }
5232 { 'command': 'x-blockdev-set-iothread',
5233 'data' : { 'node-name': 'str',
5234 'iothread': 'StrOrNull',
5235 '*force': 'bool' } }