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: Deprecated in favor of @recording and @locked. (since 2.4)
472 # @recording: true if the bitmap is recording new writes from the guest.
473 # Replaces `active` and `disabled` statuses. (since 4.0)
475 # @busy: true if the bitmap is in-use by some operation (NBD or jobs)
476 # and cannot be modified via QMP or used by another operation.
477 # Replaces `locked` and `frozen` statuses. (since 4.0)
479 # @persistent: true if the bitmap was stored on disk, is scheduled to be stored
480 # on disk, or both. (since 4.0)
482 # @inconsistent: true if this is a persistent bitmap that was improperly
483 # stored. Implies @persistent to be true; @recording and
484 # @busy to be false. This bitmap cannot be used. To remove
485 # it, use @block-dirty-bitmap-remove. (Since 4.0)
489 { 'struct': 'BlockDirtyInfo',
490 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
491 'recording': 'bool', 'busy': 'bool', 'status': 'DirtyBitmapStatus',
492 'persistent': 'bool', '*inconsistent': 'bool' } }
495 # @Qcow2BitmapInfoFlags:
497 # An enumeration of flags that a bitmap can report to the user.
499 # @in-use: This flag is set by any process actively modifying the qcow2 file,
500 # and cleared when the updated bitmap is flushed to the qcow2 image.
501 # The presence of this flag in an offline image means that the bitmap
502 # was not saved correctly after its last usage, and may contain
505 # @auto: The bitmap must reflect all changes of the virtual disk by any
506 # application that would write to this qcow2 file.
510 { 'enum': 'Qcow2BitmapInfoFlags',
511 'data': ['in-use', 'auto'] }
516 # Qcow2 bitmap information.
518 # @name: the name of the bitmap
520 # @granularity: granularity of the bitmap in bytes
522 # @flags: flags of the bitmap
526 { 'struct': 'Qcow2BitmapInfo',
527 'data': {'name': 'str', 'granularity': 'uint32',
528 'flags': ['Qcow2BitmapInfoFlags'] } }
531 # @BlockLatencyHistogramInfo:
533 # Block latency histogram.
535 # @boundaries: list of interval boundary values in nanoseconds, all greater
536 # than zero and in ascending order.
537 # For example, the list [10, 50, 100] produces the following
538 # histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
540 # @bins: list of io request counts corresponding to histogram intervals.
541 # len(@bins) = len(@boundaries) + 1
542 # For the example above, @bins may be something like [3, 1, 5, 2],
543 # and corresponding histogram looks like:
550 # +------------------
555 { 'struct': 'BlockLatencyHistogramInfo',
556 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
559 # @x-block-latency-histogram-set:
561 # Manage read, write and flush latency histograms for the device.
563 # If only @device parameter is specified, remove all present latency histograms
564 # for the device. Otherwise, add/reset some of (or all) latency histograms.
566 # @device: device name to set latency histogram for.
568 # @boundaries: list of interval boundary values (see description in
569 # BlockLatencyHistogramInfo definition). If specified, all
570 # latency histograms are removed, and empty ones created for all
571 # io types with intervals corresponding to @boundaries (except for
572 # io types, for which specific boundaries are set through the
573 # following parameters).
575 # @boundaries-read: list of interval boundary values for read latency
576 # histogram. If specified, old read latency histogram is
577 # removed, and empty one created with intervals
578 # corresponding to @boundaries-read. The parameter has higher
579 # priority then @boundaries.
581 # @boundaries-write: list of interval boundary values for write latency
584 # @boundaries-flush: list of interval boundary values for flush latency
587 # Returns: error if device is not found or any boundary arrays are invalid.
591 # Example: set new histograms for all io types with intervals
592 # [0, 10), [10, 50), [50, 100), [100, +inf):
594 # -> { "execute": "block-latency-histogram-set",
595 # "arguments": { "device": "drive0",
596 # "boundaries": [10, 50, 100] } }
597 # <- { "return": {} }
599 # Example: set new histogram only for write, other histograms will remain
600 # not changed (or not created):
602 # -> { "execute": "block-latency-histogram-set",
603 # "arguments": { "device": "drive0",
604 # "boundaries-write": [10, 50, 100] } }
605 # <- { "return": {} }
607 # Example: set new histograms with the following intervals:
608 # read, flush: [0, 10), [10, 50), [50, 100), [100, +inf)
609 # write: [0, 1000), [1000, 5000), [5000, +inf)
611 # -> { "execute": "block-latency-histogram-set",
612 # "arguments": { "device": "drive0",
613 # "boundaries": [10, 50, 100],
614 # "boundaries-write": [1000, 5000] } }
615 # <- { "return": {} }
617 # Example: remove all latency histograms:
619 # -> { "execute": "block-latency-histogram-set",
620 # "arguments": { "device": "drive0" } }
621 # <- { "return": {} }
623 { 'command': 'x-block-latency-histogram-set',
624 'data': {'device': 'str',
625 '*boundaries': ['uint64'],
626 '*boundaries-read': ['uint64'],
627 '*boundaries-write': ['uint64'],
628 '*boundaries-flush': ['uint64'] } }
633 # Block device information. This structure describes a virtual device and
634 # the backing device associated with it.
636 # @device: The device name associated with the virtual device.
638 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
639 # device. (since 2.10)
641 # @type: This field is returned only for compatibility reasons, it should
642 # not be used (always returns 'unknown')
644 # @removable: True if the device supports removable media.
646 # @locked: True if the guest has locked this device from having its media
649 # @tray_open: True if the device's tray is open
650 # (only present if it has a tray)
652 # @dirty-bitmaps: dirty bitmaps information (only present if the
653 # driver has one or more dirty bitmaps) (Since 2.0)
655 # @io-status: @BlockDeviceIoStatus. Only present if the device
656 # supports it and the VM is configured to stop on errors
657 # (supported device models: virtio-blk, IDE, SCSI except
660 # @inserted: @BlockDeviceInfo describing the device if media is
665 { 'struct': 'BlockInfo',
666 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
667 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
668 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
669 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
674 # Image file size calculation information. This structure describes the size
675 # requirements for creating a new image file.
677 # The size requirements depend on the new image file format. File size always
678 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
679 # Compact formats such as 'qcow2' represent unallocated and zero regions
680 # efficiently so file size may be smaller than virtual disk size.
682 # The values are upper bounds that are guaranteed to fit the new image file.
683 # Subsequent modification, such as internal snapshot or bitmap creation, may
684 # require additional space and is not covered here.
686 # @required: Size required for a new image file, in bytes.
688 # @fully-allocated: Image file size, in bytes, once data has been written
693 { 'struct': 'BlockMeasureInfo',
694 'data': {'required': 'int', 'fully-allocated': 'int'} }
699 # Get a list of BlockInfo for all virtual block devices.
701 # Returns: a list of @BlockInfo describing each virtual block device. Filter
702 # nodes that were created implicitly are skipped over.
708 # -> { "execute": "query-block" }
713 # "device":"ide0-hd0",
720 # "file":"disks/test.qcow2",
721 # "backing_file_depth":1,
728 # "bps_max": 8000000,
735 # "detect_zeroes": "on",
736 # "write_threshold": 0,
738 # "filename":"disks/test.qcow2",
740 # "virtual-size":2048000,
741 # "backing_file":"base.qcow2",
742 # "full-backing-filename":"disks/base.qcow2",
743 # "backing-filename-format":"qcow2",
747 # "name": "snapshot1",
748 # "vm-state-size": 0,
749 # "date-sec": 10000200,
751 # "vm-clock-sec": 206,
752 # "vm-clock-nsec": 30
756 # "filename":"disks/base.qcow2",
758 # "virtual-size":2048000
762 # "qdev": "ide_disk",
767 # "device":"ide1-cd0",
770 # "qdev": "/machine/unattached/device[23]",
771 # "tray_open": false,
775 # "device":"floppy0",
778 # "qdev": "/machine/unattached/device[20]",
791 { 'command': 'query-block', 'returns': ['BlockInfo'] }
795 # @BlockDeviceTimedStats:
797 # Statistics of a block device during a given interval of time.
799 # @interval_length: Interval used for calculating the statistics,
802 # @min_rd_latency_ns: Minimum latency of read operations in the
803 # defined interval, in nanoseconds.
805 # @min_wr_latency_ns: Minimum latency of write operations in the
806 # defined interval, in nanoseconds.
808 # @min_flush_latency_ns: Minimum latency of flush operations in the
809 # defined interval, in nanoseconds.
811 # @max_rd_latency_ns: Maximum latency of read operations in the
812 # defined interval, in nanoseconds.
814 # @max_wr_latency_ns: Maximum latency of write operations in the
815 # defined interval, in nanoseconds.
817 # @max_flush_latency_ns: Maximum latency of flush operations in the
818 # defined interval, in nanoseconds.
820 # @avg_rd_latency_ns: Average latency of read operations in the
821 # defined interval, in nanoseconds.
823 # @avg_wr_latency_ns: Average latency of write operations in the
824 # defined interval, in nanoseconds.
826 # @avg_flush_latency_ns: Average latency of flush operations in the
827 # defined interval, in nanoseconds.
829 # @avg_rd_queue_depth: Average number of pending read operations
830 # in the defined interval.
832 # @avg_wr_queue_depth: Average number of pending write operations
833 # in the defined interval.
837 { 'struct': 'BlockDeviceTimedStats',
838 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
839 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
840 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
841 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
842 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
843 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
848 # Statistics of a virtual block device or a block backing device.
850 # @rd_bytes: The number of bytes read by the device.
852 # @wr_bytes: The number of bytes written by the device.
854 # @rd_operations: The number of read operations performed by the device.
856 # @wr_operations: The number of write operations performed by the device.
858 # @flush_operations: The number of cache flush operations performed by the
859 # device (since 0.15.0)
861 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
864 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
866 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
868 # @wr_highest_offset: The offset after the greatest byte written to the
869 # device. The intended use of this information is for
870 # growable sparse files (like qcow2) that are used on top
871 # of a physical device.
873 # @rd_merged: Number of read requests that have been merged into another
874 # request (Since 2.3).
876 # @wr_merged: Number of write requests that have been merged into another
877 # request (Since 2.3).
879 # @idle_time_ns: Time since the last I/O operation, in
880 # nanoseconds. If the field is absent it means that
881 # there haven't been any operations yet (Since 2.5).
883 # @failed_rd_operations: The number of failed read operations
884 # performed by the device (Since 2.5)
886 # @failed_wr_operations: The number of failed write operations
887 # performed by the device (Since 2.5)
889 # @failed_flush_operations: The number of failed flush operations
890 # performed by the device (Since 2.5)
892 # @invalid_rd_operations: The number of invalid read operations
893 # performed by the device (Since 2.5)
895 # @invalid_wr_operations: The number of invalid write operations
896 # performed by the device (Since 2.5)
898 # @invalid_flush_operations: The number of invalid flush operations
899 # performed by the device (Since 2.5)
901 # @account_invalid: Whether invalid operations are included in the
902 # last access statistics (Since 2.5)
904 # @account_failed: Whether failed operations are included in the
905 # latency and last access statistics (Since 2.5)
907 # @timed_stats: Statistics specific to the set of previously defined
908 # intervals of time (Since 2.5)
910 # @x_rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 2.12)
912 # @x_wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 2.12)
914 # @x_flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 2.12)
918 { 'struct': 'BlockDeviceStats',
919 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
920 'wr_operations': 'int', 'flush_operations': 'int',
921 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
922 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
923 'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
924 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
925 'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
926 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
927 'account_invalid': 'bool', 'account_failed': 'bool',
928 'timed_stats': ['BlockDeviceTimedStats'],
929 '*x_rd_latency_histogram': 'BlockLatencyHistogramInfo',
930 '*x_wr_latency_histogram': 'BlockLatencyHistogramInfo',
931 '*x_flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
936 # Statistics of a virtual block device or a block backing device.
938 # @device: If the stats are for a virtual block device, the name
939 # corresponding to the virtual block device.
941 # @node-name: The node name of the device. (Since 2.3)
943 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
944 # device. (since 3.0)
946 # @stats: A @BlockDeviceStats for the device.
948 # @parent: This describes the file block device if it has one.
949 # Contains recursively the statistics of the underlying
950 # protocol (e.g. the host file for a qcow2 image). If there is
951 # no underlying protocol, this field is omitted
953 # @backing: This describes the backing block device if it has one.
958 { 'struct': 'BlockStats',
959 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
960 'stats': 'BlockDeviceStats',
961 '*parent': 'BlockStats',
962 '*backing': 'BlockStats'} }
967 # Query the @BlockStats for all virtual block devices.
969 # @query-nodes: If true, the command will query all the block nodes
970 # that have a node name, in a list which will include "parent"
971 # information, but not "backing".
972 # If false or omitted, the behavior is as before - query all the
973 # device backends, recursively including their "parent" and
974 # "backing". Filter nodes that were created implicitly are
975 # skipped over in this mode. (Since 2.3)
977 # Returns: A list of @BlockStats for each virtual block devices.
983 # -> { "execute": "query-blockstats" }
987 # "device":"ide0-hd0",
990 # "wr_highest_offset":3686448128,
991 # "wr_bytes":9786368,
992 # "wr_operations":751,
993 # "rd_bytes":122567168,
994 # "rd_operations":36772
995 # "wr_total_times_ns":313253456
996 # "rd_total_times_ns":3465673657
997 # "flush_total_times_ns":49653
998 # "flush_operations":61,
1001 # "idle_time_ns":2953431879,
1002 # "account_invalid":true,
1003 # "account_failed":false
1007 # "wr_highest_offset":2821110784,
1008 # "wr_bytes":9786368,
1009 # "wr_operations":692,
1010 # "rd_bytes":122739200,
1011 # "rd_operations":36604
1012 # "flush_operations":51,
1013 # "wr_total_times_ns":313253456
1014 # "rd_total_times_ns":3465673657
1015 # "flush_total_times_ns":49653,
1018 # "idle_time_ns":2953431879,
1019 # "account_invalid":true,
1020 # "account_failed":false
1022 # "qdev": "/machine/unattached/device[23]"
1025 # "device":"ide1-cd0",
1027 # "wr_highest_offset":0,
1029 # "wr_operations":0,
1032 # "flush_operations":0,
1033 # "wr_total_times_ns":0
1034 # "rd_total_times_ns":0
1035 # "flush_total_times_ns":0,
1038 # "account_invalid":false,
1039 # "account_failed":false
1041 # "qdev": "/machine/unattached/device[24]"
1044 # "device":"floppy0",
1046 # "wr_highest_offset":0,
1048 # "wr_operations":0,
1051 # "flush_operations":0,
1052 # "wr_total_times_ns":0
1053 # "rd_total_times_ns":0
1054 # "flush_total_times_ns":0,
1057 # "account_invalid":false,
1058 # "account_failed":false
1060 # "qdev": "/machine/unattached/device[16]"
1065 # "wr_highest_offset":0,
1067 # "wr_operations":0,
1070 # "flush_operations":0,
1071 # "wr_total_times_ns":0
1072 # "rd_total_times_ns":0
1073 # "flush_total_times_ns":0,
1076 # "account_invalid":false,
1077 # "account_failed":false
1084 { 'command': 'query-blockstats',
1085 'data': { '*query-nodes': 'bool' },
1086 'returns': ['BlockStats'] }
1091 # An enumeration of possible behaviors for errors on I/O operations.
1092 # The exact meaning depends on whether the I/O was initiated by a guest
1095 # @report: for guest operations, report the error to the guest;
1096 # for jobs, cancel the job
1098 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1099 # or BLOCK_JOB_ERROR)
1101 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1103 # @stop: for guest operations, stop the virtual machine;
1104 # for jobs, pause the job
1106 # @auto: inherit the error handling policy of the backend (since: 2.7)
1110 { 'enum': 'BlockdevOnError',
1111 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1116 # An enumeration of possible behaviors for the initial synchronization
1117 # phase of storage mirroring.
1119 # @top: copies data in the topmost image to the destination
1121 # @full: copies data from all images to the destination
1123 # @none: only copy data written from now on
1125 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
1129 { 'enum': 'MirrorSyncMode',
1130 'data': ['top', 'full', 'none', 'incremental'] }
1135 # An enumeration whose values tell the mirror block job when to
1136 # trigger writes to the target.
1138 # @background: copy data in background only.
1140 # @write-blocking: when data is written to the source, write it
1141 # (synchronously) to the target as well. In
1142 # addition, data is copied in background just like in
1147 { 'enum': 'MirrorCopyMode',
1148 'data': ['background', 'write-blocking'] }
1153 # Information about a long-running block device operation.
1155 # @type: the job type ('stream' for image streaming)
1157 # @device: The job identifier. Originally the device name but other
1158 # values are allowed since QEMU 2.7
1160 # @len: Estimated @offset value at the completion of the job. This value can
1161 # arbitrarily change while the job is running, in both directions.
1163 # @offset: Progress made until now. The unit is arbitrary and the value can
1164 # only meaningfully be used for the ratio of @offset to @len. The
1165 # value is monotonically increasing.
1167 # @busy: false if the job is known to be in a quiescent state, with
1168 # no pending I/O. Since 1.3.
1170 # @paused: whether the job is paused or, if @busy is true, will
1171 # pause itself as soon as possible. Since 1.3.
1173 # @speed: the rate limit, bytes per second
1175 # @io-status: the status of the job (since 1.3)
1177 # @ready: true if the job may be completed (since 2.2)
1179 # @status: Current job state/status (since 2.12)
1181 # @auto-finalize: Job will finalize itself when PENDING, moving to
1182 # the CONCLUDED state. (since 2.12)
1184 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1185 # state and disappearing from the query list. (since 2.12)
1187 # @error: Error information if the job did not complete successfully.
1188 # Not set if the job completed successfully. (since 2.12.1)
1192 { 'struct': 'BlockJobInfo',
1193 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1194 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1195 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1196 'status': 'JobStatus',
1197 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1201 # @query-block-jobs:
1203 # Return information about long-running block device operations.
1205 # Returns: a list of @BlockJobInfo for each active block job
1209 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1214 # This command sets the password of a block device that has not been open
1215 # with a password and requires one.
1217 # This command is now obsolete and will always return an error since 2.10
1220 { 'command': 'block_passwd',
1221 'data': { '*device': 'str',
1222 '*node-name': 'str',
1223 'password': 'str' } }
1228 # Resize a block image while a guest is running.
1230 # Either @device or @node-name must be set but not both.
1232 # @device: the name of the device to get the image resized
1234 # @node-name: graph node name to get the image resized (Since 2.0)
1236 # @size: new image size in bytes
1238 # Returns: nothing on success
1239 # If @device is not a valid block device, DeviceNotFound
1245 # -> { "execute": "block_resize",
1246 # "arguments": { "device": "scratch", "size": 1073741824 } }
1247 # <- { "return": {} }
1250 { 'command': 'block_resize',
1251 'data': { '*device': 'str',
1252 '*node-name': 'str',
1258 # An enumeration that tells QEMU how to set the backing file path in
1261 # @existing: QEMU should look for an existing image file.
1263 # @absolute-paths: QEMU should create a new image with absolute paths
1264 # for the backing file. If there is no backing file available, the new
1265 # image will not be backed either.
1269 { 'enum': 'NewImageMode',
1270 'data': [ 'existing', 'absolute-paths' ] }
1273 # @BlockdevSnapshotSync:
1275 # Either @device or @node-name must be set but not both.
1277 # @device: the name of the device to generate the snapshot from.
1279 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1281 # @snapshot-file: the target of the new image. If the file exists, or
1282 # if it is a device, the snapshot will be created in the existing
1283 # file/device. Otherwise, a new file will be created.
1285 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1287 # @format: the format of the snapshot image, default is 'qcow2'.
1289 # @mode: whether and how QEMU should create a new image, default is
1292 { 'struct': 'BlockdevSnapshotSync',
1293 'data': { '*device': 'str', '*node-name': 'str',
1294 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1295 '*format': 'str', '*mode': 'NewImageMode' } }
1298 # @BlockdevSnapshot:
1300 # @node: device or node name that will have a snapshot created.
1302 # @overlay: reference to the existing block device that will become
1303 # the overlay of @node, as part of creating the snapshot.
1304 # It must not have a current backing file (this can be
1305 # achieved by passing "backing": null to blockdev-add).
1309 { 'struct': 'BlockdevSnapshot',
1310 'data': { 'node': 'str', 'overlay': 'str' } }
1315 # @job-id: identifier for the newly-created block job. If
1316 # omitted, the device name will be used. (Since 2.7)
1318 # @device: the device name or node-name of a root node which should be copied.
1320 # @target: the target of the new image. If the file exists, or if it
1321 # is a device, the existing file/device will be used as the new
1322 # destination. If it does not exist, a new file will be created.
1324 # @format: the format of the new destination, default is to
1325 # probe if @mode is 'existing', else the format of the source
1327 # @sync: what parts of the disk image should be copied to the destination
1328 # (all the disk, only the sectors allocated in the topmost image, from a
1329 # dirty bitmap, or only new I/O).
1331 # @mode: whether and how QEMU should create a new image, default is
1334 # @speed: the maximum speed, in bytes per second
1336 # @bitmap: the name of dirty bitmap if sync is "incremental".
1337 # Must be present if sync is "incremental", must NOT be present
1338 # otherwise. (Since 2.4)
1340 # @compress: true to compress data, if the target format supports it.
1341 # (default: false) (since 2.8)
1343 # @on-source-error: the action to take on an error on the source,
1344 # default 'report'. 'stop' and 'enospc' can only be used
1345 # if the block device supports io-status (see BlockInfo).
1347 # @on-target-error: the action to take on an error on the target,
1348 # default 'report' (no limitations, since this applies to
1349 # a different block device than @device).
1351 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1352 # finished its work, waiting for @block-job-finalize before
1353 # making any block graph changes.
1354 # When true, this job will automatically
1355 # perform its abort or commit actions.
1356 # Defaults to true. (Since 2.12)
1358 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1359 # has completely ceased all work, and awaits @block-job-dismiss.
1360 # When true, this job will automatically disappear from the query
1361 # list without user intervention.
1362 # Defaults to true. (Since 2.12)
1364 # Note: @on-source-error and @on-target-error only affect background
1365 # I/O. If an error occurs during a guest write request, the device's
1366 # rerror/werror actions will be used.
1370 { 'struct': 'DriveBackup',
1371 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1372 '*format': 'str', 'sync': 'MirrorSyncMode',
1373 '*mode': 'NewImageMode', '*speed': 'int',
1374 '*bitmap': 'str', '*compress': 'bool',
1375 '*on-source-error': 'BlockdevOnError',
1376 '*on-target-error': 'BlockdevOnError',
1377 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1382 # @job-id: identifier for the newly-created block job. If
1383 # omitted, the device name will be used. (Since 2.7)
1385 # @device: the device name or node-name of a root node which should be copied.
1387 # @target: the device name or node-name of the backup target node.
1389 # @sync: what parts of the disk image should be copied to the destination
1390 # (all the disk, only the sectors allocated in the topmost image, or
1393 # @speed: the maximum speed, in bytes per second. The default is 0,
1396 # @bitmap: the name of dirty bitmap if sync is "incremental".
1397 # Must be present if sync is "incremental", must NOT be present
1398 # otherwise. (Since 3.1)
1400 # @compress: true to compress data, if the target format supports it.
1401 # (default: false) (since 2.8)
1403 # @on-source-error: the action to take on an error on the source,
1404 # default 'report'. 'stop' and 'enospc' can only be used
1405 # if the block device supports io-status (see BlockInfo).
1407 # @on-target-error: the action to take on an error on the target,
1408 # default 'report' (no limitations, since this applies to
1409 # a different block device than @device).
1411 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1412 # finished its work, waiting for @block-job-finalize before
1413 # making any block graph changes.
1414 # When true, this job will automatically
1415 # perform its abort or commit actions.
1416 # Defaults to true. (Since 2.12)
1418 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1419 # has completely ceased all work, and awaits @block-job-dismiss.
1420 # When true, this job will automatically disappear from the query
1421 # list without user intervention.
1422 # Defaults to true. (Since 2.12)
1424 # Note: @on-source-error and @on-target-error only affect background
1425 # I/O. If an error occurs during a guest write request, the device's
1426 # rerror/werror actions will be used.
1430 { 'struct': 'BlockdevBackup',
1431 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1432 'sync': 'MirrorSyncMode', '*speed': 'int',
1433 '*bitmap': 'str', '*compress': 'bool',
1434 '*on-source-error': 'BlockdevOnError',
1435 '*on-target-error': 'BlockdevOnError',
1436 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1439 # @blockdev-snapshot-sync:
1441 # Generates a synchronous snapshot of a block device.
1443 # For the arguments, see the documentation of BlockdevSnapshotSync.
1445 # Returns: nothing on success
1446 # If @device is not a valid block device, DeviceNotFound
1452 # -> { "execute": "blockdev-snapshot-sync",
1453 # "arguments": { "device": "ide-hd0",
1455 # "/some/place/my-image",
1456 # "format": "qcow2" } }
1457 # <- { "return": {} }
1460 { 'command': 'blockdev-snapshot-sync',
1461 'data': 'BlockdevSnapshotSync' }
1465 # @blockdev-snapshot:
1467 # Generates a snapshot of a block device.
1469 # Create a snapshot, by installing 'node' as the backing image of
1470 # 'overlay'. Additionally, if 'node' is associated with a block
1471 # device, the block device changes to using 'overlay' as its new active
1474 # For the arguments, see the documentation of BlockdevSnapshot.
1480 # -> { "execute": "blockdev-add",
1481 # "arguments": { "driver": "qcow2",
1482 # "node-name": "node1534",
1483 # "file": { "driver": "file",
1484 # "filename": "hd1.qcow2" },
1485 # "backing": null } }
1487 # <- { "return": {} }
1489 # -> { "execute": "blockdev-snapshot",
1490 # "arguments": { "node": "ide-hd0",
1491 # "overlay": "node1534" } }
1492 # <- { "return": {} }
1495 { 'command': 'blockdev-snapshot',
1496 'data': 'BlockdevSnapshot' }
1499 # @change-backing-file:
1501 # Change the backing file in the image file metadata. This does not
1502 # cause QEMU to reopen the image file to reparse the backing filename
1503 # (it may, however, perform a reopen to change permissions from
1504 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1505 # into the image file metadata, and the QEMU internal strings are
1508 # @image-node-name: The name of the block driver state node of the
1509 # image to modify. The "device" argument is used
1510 # to verify "image-node-name" is in the chain
1511 # described by "device".
1513 # @device: The device name or node-name of the root node that owns
1516 # @backing-file: The string to write as the backing file. This
1517 # string is not validated, so care should be taken
1518 # when specifying the string or the image chain may
1519 # not be able to be reopened again.
1521 # Returns: Nothing on success
1523 # If "device" does not exist or cannot be determined, DeviceNotFound
1527 { 'command': 'change-backing-file',
1528 'data': { 'device': 'str', 'image-node-name': 'str',
1529 'backing-file': 'str' } }
1534 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1535 # writes data between 'top' and 'base' into 'base'.
1537 # @job-id: identifier for the newly-created block job. If
1538 # omitted, the device name will be used. (Since 2.7)
1540 # @device: the device name or node-name of a root node
1542 # @base-node: The node name of the backing image to write data into.
1543 # If not specified, this is the deepest backing image.
1546 # @base: Same as @base-node, except that it is a file name rather than a node
1547 # name. This must be the exact filename string that was used to open the
1548 # node; other strings, even if addressing the same file, are not
1549 # accepted (deprecated, use @base-node instead)
1551 # @top-node: The node name of the backing image within the image chain
1552 # which contains the topmost data to be committed down. If
1553 # not specified, this is the active layer. (since: 3.1)
1555 # @top: Same as @top-node, except that it is a file name rather than a node
1556 # name. This must be the exact filename string that was used to open the
1557 # node; other strings, even if addressing the same file, are not
1558 # accepted (deprecated, use @base-node instead)
1560 # @backing-file: The backing file string to write into the overlay
1561 # image of 'top'. If 'top' is the active layer,
1562 # specifying a backing file string is an error. This
1563 # filename is not validated.
1565 # If a pathname string is such that it cannot be
1566 # resolved by QEMU, that means that subsequent QMP or
1567 # HMP commands must use node-names for the image in
1568 # question, as filename lookup methods will fail.
1570 # If not specified, QEMU will automatically determine
1571 # the backing file string to use, or error out if
1572 # there is no obvious choice. Care should be taken
1573 # when specifying the string, to specify a valid
1574 # filename or protocol.
1577 # If top == base, that is an error.
1578 # If top == active, the job will not be completed by itself,
1579 # user needs to complete the job with the block-job-complete
1580 # command after getting the ready event. (Since 2.0)
1582 # If the base image is smaller than top, then the base image
1583 # will be resized to be the same size as top. If top is
1584 # smaller than the base image, the base will not be
1585 # truncated. If you want the base image size to match the
1586 # size of the smaller top, you can safely truncate it
1587 # yourself once the commit operation successfully completes.
1589 # @speed: the maximum speed, in bytes per second
1591 # @filter-node-name: the node name that should be assigned to the
1592 # filter driver that the commit job inserts into the graph
1593 # above @top. If this option is not given, a node name is
1594 # autogenerated. (Since: 2.9)
1596 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1597 # finished its work, waiting for @block-job-finalize before
1598 # making any block graph changes.
1599 # When true, this job will automatically
1600 # perform its abort or commit actions.
1601 # Defaults to true. (Since 3.1)
1603 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1604 # has completely ceased all work, and awaits @block-job-dismiss.
1605 # When true, this job will automatically disappear from the query
1606 # list without user intervention.
1607 # Defaults to true. (Since 3.1)
1609 # Returns: Nothing on success
1610 # If @device does not exist, DeviceNotFound
1611 # Any other error returns a GenericError.
1617 # -> { "execute": "block-commit",
1618 # "arguments": { "device": "virtio0",
1619 # "top": "/tmp/snap1.qcow2" } }
1620 # <- { "return": {} }
1623 { 'command': 'block-commit',
1624 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1625 '*base': 'str', '*top-node': 'str', '*top': 'str',
1626 '*backing-file': 'str', '*speed': 'int',
1627 '*filter-node-name': 'str',
1628 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1633 # Start a point-in-time copy of a block device to a new destination. The
1634 # status of ongoing drive-backup operations can be checked with
1635 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1636 # The operation can be stopped before it has completed using the
1637 # block-job-cancel command.
1639 # Returns: nothing on success
1640 # If @device is not a valid block device, GenericError
1646 # -> { "execute": "drive-backup",
1647 # "arguments": { "device": "drive0",
1649 # "target": "backup.img" } }
1650 # <- { "return": {} }
1653 { 'command': 'drive-backup', 'boxed': true,
1654 'data': 'DriveBackup' }
1659 # Start a point-in-time copy of a block device to a new destination. The
1660 # status of ongoing blockdev-backup operations can be checked with
1661 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1662 # The operation can be stopped before it has completed using the
1663 # block-job-cancel command.
1665 # Returns: nothing on success
1666 # If @device is not a valid block device, DeviceNotFound
1671 # -> { "execute": "blockdev-backup",
1672 # "arguments": { "device": "src-id",
1674 # "target": "tgt-id" } }
1675 # <- { "return": {} }
1678 { 'command': 'blockdev-backup', 'boxed': true,
1679 'data': 'BlockdevBackup' }
1683 # @query-named-block-nodes:
1685 # Get the named block driver list
1687 # Returns: the list of BlockDeviceInfo
1693 # -> { "execute": "query-named-block-nodes" }
1694 # <- { "return": [ { "ro":false,
1696 # "encrypted":false,
1697 # "file":"disks/test.qcow2",
1698 # "node-name": "my-node",
1699 # "backing_file_depth":1,
1706 # "bps_max": 8000000,
1713 # "write_threshold": 0,
1715 # "filename":"disks/test.qcow2",
1717 # "virtual-size":2048000,
1718 # "backing_file":"base.qcow2",
1719 # "full-backing-filename":"disks/base.qcow2",
1720 # "backing-filename-format":"qcow2",
1724 # "name": "snapshot1",
1725 # "vm-state-size": 0,
1726 # "date-sec": 10000200,
1728 # "vm-clock-sec": 206,
1729 # "vm-clock-nsec": 30
1733 # "filename":"disks/base.qcow2",
1735 # "virtual-size":2048000
1740 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1743 # @XDbgBlockGraphNodeType:
1745 # @block-backend: corresponds to BlockBackend
1747 # @block-job: corresonds to BlockJob
1749 # @block-driver: corresponds to BlockDriverState
1753 { 'enum': 'XDbgBlockGraphNodeType',
1754 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1757 # @XDbgBlockGraphNode:
1759 # @id: Block graph node identifier. This @id is generated only for
1760 # x-debug-query-block-graph and does not relate to any other identifiers in
1763 # @type: Type of graph node. Can be one of block-backend, block-job or
1764 # block-driver-state.
1766 # @name: Human readable name of the node. Corresponds to node-name for
1767 # block-driver-state nodes; is not guaranteed to be unique in the whole
1768 # graph (with block-jobs and block-backends).
1772 { 'struct': 'XDbgBlockGraphNode',
1773 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1778 # Enum of base block permissions.
1780 # @consistent-read: A user that has the "permission" of consistent reads is
1781 # guaranteed that their view of the contents of the block
1782 # device is complete and self-consistent, representing the
1783 # contents of a disk at a specific point.
1784 # For most block devices (including their backing files) this
1785 # is true, but the property cannot be maintained in a few
1786 # situations like for intermediate nodes of a commit block
1789 # @write: This permission is required to change the visible disk contents.
1791 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1792 # both enough and required for writes to the block node when
1793 # the caller promises that the visible disk content doesn't
1795 # As the BLK_PERM_WRITE permission is strictly stronger,
1796 # either is sufficient to perform an unchanging write.
1798 # @resize: This permission is required to change the size of a block node.
1800 # @graph-mod: This permission is required to change the node that this
1801 # BdrvChild points to.
1805 { 'enum': 'BlockPermission',
1806 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
1809 # @XDbgBlockGraphEdge:
1811 # Block Graph edge description for x-debug-query-block-graph.
1813 # @parent: parent id
1817 # @name: name of the relation (examples are 'file' and 'backing')
1819 # @perm: granted permissions for the parent operating on the child
1821 # @shared-perm: permissions that can still be granted to other users of the
1822 # child while it is still attached to this parent
1826 { 'struct': 'XDbgBlockGraphEdge',
1827 'data': { 'parent': 'uint64', 'child': 'uint64',
1828 'name': 'str', 'perm': [ 'BlockPermission' ],
1829 'shared-perm': [ 'BlockPermission' ] } }
1834 # Block Graph - list of nodes and list of edges.
1838 { 'struct': 'XDbgBlockGraph',
1839 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1842 # @x-debug-query-block-graph:
1844 # Get the block graph.
1848 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph' }
1853 # Start mirroring a block device's writes to a new destination. target
1854 # specifies the target of the new image. If the file exists, or if it
1855 # is a device, it will be used as the new destination for writes. If
1856 # it does not exist, a new file will be created. format specifies the
1857 # format of the mirror image, default is to probe if mode='existing',
1858 # else the format of the source.
1860 # Returns: nothing on success
1861 # If @device is not a valid block device, GenericError
1867 # -> { "execute": "drive-mirror",
1868 # "arguments": { "device": "ide-hd0",
1869 # "target": "/some/place/my-image",
1871 # "format": "qcow2" } }
1872 # <- { "return": {} }
1875 { 'command': 'drive-mirror', 'boxed': true,
1876 'data': 'DriveMirror' }
1881 # A set of parameters describing drive mirror setup.
1883 # @job-id: identifier for the newly-created block job. If
1884 # omitted, the device name will be used. (Since 2.7)
1886 # @device: the device name or node-name of a root node whose writes should be
1889 # @target: the target of the new image. If the file exists, or if it
1890 # is a device, the existing file/device will be used as the new
1891 # destination. If it does not exist, a new file will be created.
1893 # @format: the format of the new destination, default is to
1894 # probe if @mode is 'existing', else the format of the source
1896 # @node-name: the new block driver state node name in the graph
1899 # @replaces: with sync=full graph node name to be replaced by the new
1900 # image when a whole image copy is done. This can be used to repair
1901 # broken Quorum files. (Since 2.1)
1903 # @mode: whether and how QEMU should create a new image, default is
1906 # @speed: the maximum speed, in bytes per second
1908 # @sync: what parts of the disk image should be copied to the destination
1909 # (all the disk, only the sectors allocated in the topmost image, or
1912 # @granularity: granularity of the dirty bitmap, default is 64K
1913 # if the image format doesn't have clusters, 4K if the clusters
1914 # are smaller than that, else the cluster size. Must be a
1915 # power of 2 between 512 and 64M (since 1.4).
1917 # @buf-size: maximum amount of data in flight from source to
1918 # target (since 1.4).
1920 # @on-source-error: the action to take on an error on the source,
1921 # default 'report'. 'stop' and 'enospc' can only be used
1922 # if the block device supports io-status (see BlockInfo).
1924 # @on-target-error: the action to take on an error on the target,
1925 # default 'report' (no limitations, since this applies to
1926 # a different block device than @device).
1927 # @unmap: Whether to try to unmap target sectors where source has
1928 # only zero. If true, and target unallocated sectors will read as zero,
1929 # target image sectors will be unmapped; otherwise, zeroes will be
1930 # written. Both will result in identical contents.
1931 # Default is true. (Since 2.4)
1933 # @copy-mode: when to copy data to the destination; defaults to 'background'
1936 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1937 # finished its work, waiting for @block-job-finalize before
1938 # making any block graph changes.
1939 # When true, this job will automatically
1940 # perform its abort or commit actions.
1941 # Defaults to true. (Since 3.1)
1943 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1944 # has completely ceased all work, and awaits @block-job-dismiss.
1945 # When true, this job will automatically disappear from the query
1946 # list without user intervention.
1947 # Defaults to true. (Since 3.1)
1950 { 'struct': 'DriveMirror',
1951 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1952 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1953 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1954 '*speed': 'int', '*granularity': 'uint32',
1955 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1956 '*on-target-error': 'BlockdevOnError',
1957 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
1958 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1961 # @BlockDirtyBitmap:
1963 # @node: name of device/node which the bitmap is tracking
1965 # @name: name of the dirty bitmap
1969 { 'struct': 'BlockDirtyBitmap',
1970 'data': { 'node': 'str', 'name': 'str' } }
1973 # @BlockDirtyBitmapAdd:
1975 # @node: name of device/node which the bitmap is tracking
1977 # @name: name of the dirty bitmap
1979 # @granularity: the bitmap granularity, default is 64k for
1980 # block-dirty-bitmap-add
1982 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1983 # corresponding block device image file on its close. For now only
1984 # Qcow2 disks support persistent bitmaps. Default is false for
1985 # block-dirty-bitmap-add. (Since: 2.10)
1987 # @autoload: ignored and deprecated since 2.12.
1988 # Currently, all dirty tracking bitmaps are loaded from Qcow2 on
1991 # @disabled: the bitmap is created in the disabled state, which means that
1992 # it will not track drive changes. The bitmap may be enabled with
1993 # block-dirty-bitmap-enable. Default is false. (Since: 4.0)
1997 { 'struct': 'BlockDirtyBitmapAdd',
1998 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1999 '*persistent': 'bool', '*autoload': 'bool', '*disabled': 'bool' } }
2002 # @BlockDirtyBitmapMerge:
2004 # @node: name of device/node which the bitmap is tracking
2006 # @target: name of the destination dirty bitmap
2008 # @bitmaps: name(s) of the source dirty bitmap(s)
2012 { 'struct': 'BlockDirtyBitmapMerge',
2013 'data': { 'node': 'str', 'target': 'str', 'bitmaps': ['str'] } }
2016 # @block-dirty-bitmap-add:
2018 # Create a dirty bitmap with a name on the node, and start tracking the writes.
2020 # Returns: nothing on success
2021 # If @node is not a valid block device or node, DeviceNotFound
2022 # If @name is already taken, GenericError with an explanation
2028 # -> { "execute": "block-dirty-bitmap-add",
2029 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2030 # <- { "return": {} }
2033 { 'command': 'block-dirty-bitmap-add',
2034 'data': 'BlockDirtyBitmapAdd' }
2037 # @block-dirty-bitmap-remove:
2039 # Stop write tracking and remove the dirty bitmap that was created
2040 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2043 # Returns: nothing on success
2044 # If @node is not a valid block device or node, DeviceNotFound
2045 # If @name is not found, GenericError with an explanation
2046 # if @name is frozen by an operation, GenericError
2052 # -> { "execute": "block-dirty-bitmap-remove",
2053 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2054 # <- { "return": {} }
2057 { 'command': 'block-dirty-bitmap-remove',
2058 'data': 'BlockDirtyBitmap' }
2061 # @block-dirty-bitmap-clear:
2063 # Clear (reset) a dirty bitmap on the device, so that an incremental
2064 # backup from this point in time forward will only backup clusters
2065 # modified after this clear operation.
2067 # Returns: nothing on success
2068 # If @node is not a valid block device, DeviceNotFound
2069 # If @name is not found, GenericError with an explanation
2075 # -> { "execute": "block-dirty-bitmap-clear",
2076 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2077 # <- { "return": {} }
2080 { 'command': 'block-dirty-bitmap-clear',
2081 'data': 'BlockDirtyBitmap' }
2084 # @block-dirty-bitmap-enable:
2086 # Enables a dirty bitmap so that it will begin tracking disk changes.
2088 # Returns: nothing on success
2089 # If @node is not a valid block device, DeviceNotFound
2090 # If @name is not found, GenericError with an explanation
2096 # -> { "execute": "block-dirty-bitmap-enable",
2097 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2098 # <- { "return": {} }
2101 { 'command': 'block-dirty-bitmap-enable',
2102 'data': 'BlockDirtyBitmap' }
2105 # @block-dirty-bitmap-disable:
2107 # Disables a dirty bitmap so that it will stop tracking disk changes.
2109 # Returns: nothing on success
2110 # If @node is not a valid block device, DeviceNotFound
2111 # If @name is not found, GenericError with an explanation
2117 # -> { "execute": "block-dirty-bitmap-disable",
2118 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2119 # <- { "return": {} }
2122 { 'command': 'block-dirty-bitmap-disable',
2123 'data': 'BlockDirtyBitmap' }
2126 # @block-dirty-bitmap-merge:
2128 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2129 # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2130 # as the @target bitmap. Any bits already set in @target will still be
2131 # set after the merge, i.e., this operation does not clear the target.
2132 # On error, @target is unchanged.
2134 # The resulting bitmap will count as dirty any clusters that were dirty in any
2135 # of the source bitmaps. This can be used to achieve backup checkpoints, or in
2136 # simpler usages, to copy bitmaps.
2138 # Returns: nothing on success
2139 # If @node is not a valid block device, DeviceNotFound
2140 # If any bitmap in @bitmaps or @target is not found, GenericError
2141 # If any of the bitmaps have different sizes or granularities,
2148 # -> { "execute": "block-dirty-bitmap-merge",
2149 # "arguments": { "node": "drive0", "target": "bitmap0",
2150 # "bitmaps": ["bitmap1"] } }
2151 # <- { "return": {} }
2154 { 'command': 'block-dirty-bitmap-merge',
2155 'data': 'BlockDirtyBitmapMerge' }
2158 # @BlockDirtyBitmapSha256:
2160 # SHA256 hash of dirty bitmap data
2162 # @sha256: ASCII representation of SHA256 bitmap hash
2166 { 'struct': 'BlockDirtyBitmapSha256',
2167 'data': {'sha256': 'str'} }
2170 # @x-debug-block-dirty-bitmap-sha256:
2172 # Get bitmap SHA256.
2174 # Returns: BlockDirtyBitmapSha256 on success
2175 # If @node is not a valid block device, DeviceNotFound
2176 # If @name is not found or if hashing has failed, GenericError with an
2181 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2182 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
2187 # Start mirroring a block device's writes to a new destination.
2189 # @job-id: identifier for the newly-created block job. If
2190 # omitted, the device name will be used. (Since 2.7)
2192 # @device: The device name or node-name of a root node whose writes should be
2195 # @target: the id or node-name of the block device to mirror to. This mustn't be
2196 # attached to guest.
2198 # @replaces: with sync=full graph node name to be replaced by the new
2199 # image when a whole image copy is done. This can be used to repair
2200 # broken Quorum files.
2202 # @speed: the maximum speed, in bytes per second
2204 # @sync: what parts of the disk image should be copied to the destination
2205 # (all the disk, only the sectors allocated in the topmost image, or
2208 # @granularity: granularity of the dirty bitmap, default is 64K
2209 # if the image format doesn't have clusters, 4K if the clusters
2210 # are smaller than that, else the cluster size. Must be a
2211 # power of 2 between 512 and 64M
2213 # @buf-size: maximum amount of data in flight from source to
2216 # @on-source-error: the action to take on an error on the source,
2217 # default 'report'. 'stop' and 'enospc' can only be used
2218 # if the block device supports io-status (see BlockInfo).
2220 # @on-target-error: the action to take on an error on the target,
2221 # default 'report' (no limitations, since this applies to
2222 # a different block device than @device).
2224 # @filter-node-name: the node name that should be assigned to the
2225 # filter driver that the mirror job inserts into the graph
2226 # above @device. If this option is not given, a node name is
2227 # autogenerated. (Since: 2.9)
2229 # @copy-mode: when to copy data to the destination; defaults to 'background'
2232 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2233 # finished its work, waiting for @block-job-finalize before
2234 # making any block graph changes.
2235 # When true, this job will automatically
2236 # perform its abort or commit actions.
2237 # Defaults to true. (Since 3.1)
2239 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2240 # has completely ceased all work, and awaits @block-job-dismiss.
2241 # When true, this job will automatically disappear from the query
2242 # list without user intervention.
2243 # Defaults to true. (Since 3.1)
2244 # Returns: nothing on success.
2250 # -> { "execute": "blockdev-mirror",
2251 # "arguments": { "device": "ide-hd0",
2252 # "target": "target0",
2253 # "sync": "full" } }
2254 # <- { "return": {} }
2257 { 'command': 'blockdev-mirror',
2258 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2260 'sync': 'MirrorSyncMode',
2261 '*speed': 'int', '*granularity': 'uint32',
2262 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2263 '*on-target-error': 'BlockdevOnError',
2264 '*filter-node-name': 'str',
2265 '*copy-mode': 'MirrorCopyMode',
2266 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2269 # @block_set_io_throttle:
2271 # Change I/O throttle limits for a block drive.
2273 # Since QEMU 2.4, each device with I/O limits is member of a throttle
2276 # If two or more devices are members of the same group, the limits
2277 # will apply to the combined I/O of the whole group in a round-robin
2278 # fashion. Therefore, setting new I/O limits to a device will affect
2281 # The name of the group can be specified using the 'group' parameter.
2282 # If the parameter is unset, it is assumed to be the current group of
2283 # that device. If it's not in any group yet, the name of the device
2284 # will be used as the name for its group.
2286 # The 'group' parameter can also be used to move a device to a
2287 # different group. In this case the limits specified in the parameters
2288 # will be applied to the new group only.
2290 # I/O limits can be disabled by setting all of them to 0. In this case
2291 # the device will be removed from its group and the rest of its
2292 # members will not be affected. The 'group' parameter is ignored.
2294 # Returns: Nothing on success
2295 # If @device is not a valid block device, DeviceNotFound
2301 # -> { "execute": "block_set_io_throttle",
2302 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
2315 # "bps_max_length": 0,
2316 # "iops_size": 0 } }
2317 # <- { "return": {} }
2319 # -> { "execute": "block_set_io_throttle",
2320 # "arguments": { "id": "ide0-1-0",
2327 # "bps_max": 8000000,
2333 # "bps_max_length": 60,
2334 # "iops_size": 0 } }
2335 # <- { "return": {} }
2337 { 'command': 'block_set_io_throttle', 'boxed': true,
2338 'data': 'BlockIOThrottle' }
2343 # A set of parameters describing block throttling.
2345 # @device: Block device name (deprecated, use @id instead)
2347 # @id: The name or QOM path of the guest device (since: 2.8)
2349 # @bps: total throughput limit in bytes per second
2351 # @bps_rd: read throughput limit in bytes per second
2353 # @bps_wr: write throughput limit in bytes per second
2355 # @iops: total I/O operations per second
2357 # @iops_rd: read I/O operations per second
2359 # @iops_wr: write I/O operations per second
2361 # @bps_max: total throughput limit during bursts,
2362 # in bytes (Since 1.7)
2364 # @bps_rd_max: read throughput limit during bursts,
2365 # in bytes (Since 1.7)
2367 # @bps_wr_max: write throughput limit during bursts,
2368 # in bytes (Since 1.7)
2370 # @iops_max: total I/O operations per second during bursts,
2371 # in bytes (Since 1.7)
2373 # @iops_rd_max: read I/O operations per second during bursts,
2374 # in bytes (Since 1.7)
2376 # @iops_wr_max: write I/O operations per second during bursts,
2377 # in bytes (Since 1.7)
2379 # @bps_max_length: maximum length of the @bps_max burst
2380 # period, in seconds. It must only
2381 # be set if @bps_max is set as well.
2382 # Defaults to 1. (Since 2.6)
2384 # @bps_rd_max_length: maximum length of the @bps_rd_max
2385 # burst period, in seconds. It must only
2386 # be set if @bps_rd_max is set as well.
2387 # Defaults to 1. (Since 2.6)
2389 # @bps_wr_max_length: maximum length of the @bps_wr_max
2390 # burst period, in seconds. It must only
2391 # be set if @bps_wr_max is set as well.
2392 # Defaults to 1. (Since 2.6)
2394 # @iops_max_length: maximum length of the @iops burst
2395 # period, in seconds. It must only
2396 # be set if @iops_max is set as well.
2397 # Defaults to 1. (Since 2.6)
2399 # @iops_rd_max_length: maximum length of the @iops_rd_max
2400 # burst period, in seconds. It must only
2401 # be set if @iops_rd_max is set as well.
2402 # Defaults to 1. (Since 2.6)
2404 # @iops_wr_max_length: maximum length of the @iops_wr_max
2405 # burst period, in seconds. It must only
2406 # be set if @iops_wr_max is set as well.
2407 # Defaults to 1. (Since 2.6)
2409 # @iops_size: an I/O size in bytes (Since 1.7)
2411 # @group: throttle group name (Since 2.4)
2415 { 'struct': 'BlockIOThrottle',
2416 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2417 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2418 '*bps_max': 'int', '*bps_rd_max': 'int',
2419 '*bps_wr_max': 'int', '*iops_max': 'int',
2420 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2421 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2422 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2423 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2424 '*iops_size': 'int', '*group': 'str' } }
2429 # Limit parameters for throttling.
2430 # Since some limit combinations are illegal, limits should always be set in one
2431 # transaction. All fields are optional. When setting limits, if a field is
2432 # missing the current value is not changed.
2434 # @iops-total: limit total I/O operations per second
2435 # @iops-total-max: I/O operations burst
2436 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2437 # It must only be set if @iops-total-max is set as well.
2438 # @iops-read: limit read operations per second
2439 # @iops-read-max: I/O operations read burst
2440 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2441 # It must only be set if @iops-read-max is set as well.
2442 # @iops-write: limit write operations per second
2443 # @iops-write-max: I/O operations write burst
2444 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2445 # It must only be set if @iops-write-max is set as well.
2446 # @bps-total: limit total bytes per second
2447 # @bps-total-max: total bytes burst
2448 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2449 # It must only be set if @bps-total-max is set as well.
2450 # @bps-read: limit read bytes per second
2451 # @bps-read-max: total bytes read burst
2452 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2453 # It must only be set if @bps-read-max is set as well.
2454 # @bps-write: limit write bytes per second
2455 # @bps-write-max: total bytes write burst
2456 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2457 # It must only be set if @bps-write-max is set as well.
2458 # @iops-size: when limiting by iops max size of an I/O in bytes
2462 { 'struct': 'ThrottleLimits',
2463 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2464 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2465 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2466 '*iops-write' : 'int', '*iops-write-max' : 'int',
2467 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2468 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2469 '*bps-read' : 'int', '*bps-read-max' : 'int',
2470 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2471 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2472 '*iops-size' : 'int' } }
2477 # Copy data from a backing file into a block device.
2479 # The block streaming operation is performed in the background until the entire
2480 # backing file has been copied. This command returns immediately once streaming
2481 # has started. The status of ongoing block streaming operations can be checked
2482 # with query-block-jobs. The operation can be stopped before it has completed
2483 # using the block-job-cancel command.
2485 # The node that receives the data is called the top image, can be located in
2486 # any part of the chain (but always above the base image; see below) and can be
2487 # specified using its device or node name. Earlier qemu versions only allowed
2488 # 'device' to name the top level node; presence of the 'base-node' parameter
2489 # during introspection can be used as a witness of the enhanced semantics
2492 # If a base file is specified then sectors are not copied from that base file and
2493 # its backing chain. When streaming completes the image file will have the base
2494 # file as its backing file. This can be used to stream a subset of the backing
2495 # file chain instead of flattening the entire image.
2497 # On successful completion the image file is updated to drop the backing file
2498 # and the BLOCK_JOB_COMPLETED event is emitted.
2500 # @job-id: identifier for the newly-created block job. If
2501 # omitted, the device name will be used. (Since 2.7)
2503 # @device: the device or node name of the top image
2505 # @base: the common backing file name.
2506 # It cannot be set if @base-node is also set.
2508 # @base-node: the node name of the backing file.
2509 # It cannot be set if @base is also set. (Since 2.8)
2511 # @backing-file: The backing file string to write into the top
2512 # image. This filename is not validated.
2514 # If a pathname string is such that it cannot be
2515 # resolved by QEMU, that means that subsequent QMP or
2516 # HMP commands must use node-names for the image in
2517 # question, as filename lookup methods will fail.
2519 # If not specified, QEMU will automatically determine
2520 # the backing file string to use, or error out if there
2521 # is no obvious choice. Care should be taken when
2522 # specifying the string, to specify a valid filename or
2526 # @speed: the maximum speed, in bytes per second
2528 # @on-error: the action to take on an error (default report).
2529 # 'stop' and 'enospc' can only be used if the block device
2530 # supports io-status (see BlockInfo). Since 1.3.
2532 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2533 # finished its work, waiting for @block-job-finalize before
2534 # making any block graph changes.
2535 # When true, this job will automatically
2536 # perform its abort or commit actions.
2537 # Defaults to true. (Since 3.1)
2539 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2540 # has completely ceased all work, and awaits @block-job-dismiss.
2541 # When true, this job will automatically disappear from the query
2542 # list without user intervention.
2543 # Defaults to true. (Since 3.1)
2545 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
2551 # -> { "execute": "block-stream",
2552 # "arguments": { "device": "virtio0",
2553 # "base": "/tmp/master.qcow2" } }
2554 # <- { "return": {} }
2557 { 'command': 'block-stream',
2558 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2559 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2560 '*on-error': 'BlockdevOnError',
2561 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2564 # @block-job-set-speed:
2566 # Set maximum speed for a background block operation.
2568 # This command can only be issued when there is an active block job.
2570 # Throttling can be disabled by setting the speed to 0.
2572 # @device: The job identifier. This used to be a device name (hence
2573 # the name of the parameter), but since QEMU 2.7 it can have
2576 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2579 # Returns: Nothing on success
2580 # If no background operation is active on this device, DeviceNotActive
2584 { 'command': 'block-job-set-speed',
2585 'data': { 'device': 'str', 'speed': 'int' } }
2588 # @block-job-cancel:
2590 # Stop an active background block operation.
2592 # This command returns immediately after marking the active background block
2593 # operation for cancellation. It is an error to call this command if no
2594 # operation is in progress.
2596 # The operation will cancel as soon as possible and then emit the
2597 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2598 # enumerated using query-block-jobs.
2600 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2601 # (via the event BLOCK_JOB_READY) that the source and destination are
2602 # synchronized, then the event triggered by this command changes to
2603 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2604 # destination now has a point-in-time copy tied to the time of the cancellation.
2606 # For streaming, the image file retains its backing file unless the streaming
2607 # operation happens to complete just as it is being cancelled. A new streaming
2608 # operation can be started at a later time to finish copying all data from the
2611 # @device: The job identifier. This used to be a device name (hence
2612 # the name of the parameter), but since QEMU 2.7 it can have
2615 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2616 # abandon the job immediately (even if it is paused) instead of waiting
2617 # for the destination to complete its final synchronization (since 1.3)
2619 # Returns: Nothing on success
2620 # If no background operation is active on this device, DeviceNotActive
2624 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2629 # Pause an active background block operation.
2631 # This command returns immediately after marking the active background block
2632 # operation for pausing. It is an error to call this command if no
2633 # operation is in progress or if the job is already paused.
2635 # The operation will pause as soon as possible. No event is emitted when
2636 # the operation is actually paused. Cancelling a paused job automatically
2639 # @device: The job identifier. This used to be a device name (hence
2640 # the name of the parameter), but since QEMU 2.7 it can have
2643 # Returns: Nothing on success
2644 # If no background operation is active on this device, DeviceNotActive
2648 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2651 # @block-job-resume:
2653 # Resume an active background block operation.
2655 # This command returns immediately after resuming a paused background block
2656 # operation. It is an error to call this command if no operation is in
2657 # progress or if the job is not paused.
2659 # This command also clears the error status of the job.
2661 # @device: The job identifier. This used to be a device name (hence
2662 # the name of the parameter), but since QEMU 2.7 it can have
2665 # Returns: Nothing on success
2666 # If no background operation is active on this device, DeviceNotActive
2670 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2673 # @block-job-complete:
2675 # Manually trigger completion of an active background block operation. This
2676 # is supported for drive mirroring, where it also switches the device to
2677 # write to the target path only. The ability to complete is signaled with
2678 # a BLOCK_JOB_READY event.
2680 # This command completes an active background block operation synchronously.
2681 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2682 # is not defined. Note that if an I/O error occurs during the processing of
2683 # this command: 1) the command itself will fail; 2) the error will be processed
2684 # according to the rerror/werror arguments that were specified when starting
2687 # A cancelled or paused job cannot be completed.
2689 # @device: The job identifier. This used to be a device name (hence
2690 # the name of the parameter), but since QEMU 2.7 it can have
2693 # Returns: Nothing on success
2694 # If no background operation is active on this device, DeviceNotActive
2698 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2701 # @block-job-dismiss:
2703 # For jobs that have already concluded, remove them from the block-job-query
2704 # list. This command only needs to be run for jobs which were started with
2705 # QEMU 2.12+ job lifetime management semantics.
2707 # This command will refuse to operate on any job that has not yet reached
2708 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2709 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2710 # to be used as appropriate.
2712 # @id: The job identifier.
2714 # Returns: Nothing on success
2718 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2721 # @block-job-finalize:
2723 # Once a job that has manual=true reaches the pending state, it can be
2724 # instructed to finalize any graph changes and do any necessary cleanup
2726 # For jobs in a transaction, instructing one job to finalize will force
2727 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2728 # a single member job to finalize.
2730 # @id: The job identifier.
2732 # Returns: Nothing on success
2736 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2739 # @BlockdevDiscardOptions:
2741 # Determines how to handle discard requests.
2743 # @ignore: Ignore the request
2744 # @unmap: Forward as an unmap request
2748 { 'enum': 'BlockdevDiscardOptions',
2749 'data': [ 'ignore', 'unmap' ] }
2752 # @BlockdevDetectZeroesOptions:
2754 # Describes the operation mode for the automatic conversion of plain
2755 # zero writes by the OS to driver specific optimized zero write commands.
2757 # @off: Disabled (default)
2759 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2760 # also that @BlockdevDiscardOptions is set to unmap for this device.
2764 { 'enum': 'BlockdevDetectZeroesOptions',
2765 'data': [ 'off', 'on', 'unmap' ] }
2768 # @BlockdevAioOptions:
2770 # Selects the AIO backend to handle I/O requests
2772 # @threads: Use qemu's thread pool
2773 # @native: Use native AIO backend (only Linux and Windows)
2777 { 'enum': 'BlockdevAioOptions',
2778 'data': [ 'threads', 'native' ] }
2781 # @BlockdevCacheOptions:
2783 # Includes cache-related options for block devices
2785 # @direct: enables use of O_DIRECT (bypass the host page cache;
2787 # @no-flush: ignore any flush requests for the device (default:
2792 { 'struct': 'BlockdevCacheOptions',
2793 'data': { '*direct': 'bool',
2794 '*no-flush': 'bool' } }
2799 # Drivers that are supported in block device operations.
2802 # @throttle: Since 2.11
2804 # @copy-on-read: Since 3.0
2805 # @blklogwrites: Since 3.0
2809 { 'enum': 'BlockdevDriver',
2810 'data': [ 'blkdebug', 'blklogwrites', 'blkverify', 'bochs', 'cloop',
2811 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps', 'gluster',
2812 'host_cdrom', 'host_device', 'http', 'https', 'iscsi', 'luks',
2813 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels', 'qcow',
2814 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
2815 { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
2817 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2820 # @BlockdevOptionsFile:
2822 # Driver specific block device options for the file backend.
2824 # @filename: path to the image file
2825 # @pr-manager: the id for the object that will handle persistent reservations
2826 # for this device (default: none, forward the commands via SG_IO;
2828 # @aio: AIO backend (default: threads) (since: 2.8)
2829 # @locking: whether to enable file locking. If set to 'auto', only enable
2830 # when Open File Descriptor (OFD) locking API is available
2831 # (default: auto, since 2.10)
2832 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2833 # migration. May cause noticeable delays if the image
2834 # file is large, do not use in production.
2835 # (default: off) (since: 3.0)
2839 { 'struct': 'BlockdevOptionsFile',
2840 'data': { 'filename': 'str',
2841 '*pr-manager': 'str',
2842 '*locking': 'OnOffAuto',
2843 '*aio': 'BlockdevAioOptions',
2844 '*x-check-cache-dropped': 'bool' } }
2847 # @BlockdevOptionsNull:
2849 # Driver specific block device options for the null backend.
2851 # @size: size of the device in bytes.
2852 # @latency-ns: emulated latency (in nanoseconds) in processing
2853 # requests. Default to zero which completes requests immediately.
2858 { 'struct': 'BlockdevOptionsNull',
2859 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
2862 # @BlockdevOptionsNVMe:
2864 # Driver specific block device options for the NVMe backend.
2866 # @device: controller address of the NVMe device.
2867 # @namespace: namespace number of the device, starting from 1.
2871 { 'struct': 'BlockdevOptionsNVMe',
2872 'data': { 'device': 'str', 'namespace': 'int' } }
2875 # @BlockdevOptionsVVFAT:
2877 # Driver specific block device options for the vvfat protocol.
2879 # @dir: directory to be exported as FAT image
2880 # @fat-type: FAT type: 12, 16 or 32
2881 # @floppy: whether to export a floppy image (true) or
2882 # partitioned hard disk (false; default)
2883 # @label: set the volume label, limited to 11 bytes. FAT16 and
2884 # FAT32 traditionally have some restrictions on labels, which are
2885 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2887 # @rw: whether to allow write operations (default: false)
2891 { 'struct': 'BlockdevOptionsVVFAT',
2892 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2893 '*label': 'str', '*rw': 'bool' } }
2896 # @BlockdevOptionsGenericFormat:
2898 # Driver specific block device options for image format that have no option
2899 # besides their data source.
2901 # @file: reference to or definition of the data source block device
2905 { 'struct': 'BlockdevOptionsGenericFormat',
2906 'data': { 'file': 'BlockdevRef' } }
2909 # @BlockdevOptionsLUKS:
2911 # Driver specific block device options for LUKS.
2913 # @key-secret: the ID of a QCryptoSecret object providing
2914 # the decryption key (since 2.6). Mandatory except when
2915 # doing a metadata-only probe of the image.
2919 { 'struct': 'BlockdevOptionsLUKS',
2920 'base': 'BlockdevOptionsGenericFormat',
2921 'data': { '*key-secret': 'str' } }
2925 # @BlockdevOptionsGenericCOWFormat:
2927 # Driver specific block device options for image format that have no option
2928 # besides their data source and an optional backing file.
2930 # @backing: reference to or definition of the backing file block
2931 # device, null disables the backing file entirely.
2932 # Defaults to the backing file stored the image file.
2936 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2937 'base': 'BlockdevOptionsGenericFormat',
2938 'data': { '*backing': 'BlockdevRefOrNull' } }
2941 # @Qcow2OverlapCheckMode:
2943 # General overlap check modes.
2945 # @none: Do not perform any checks
2947 # @constant: Perform only checks which can be done in constant time and
2948 # without reading anything from disk
2950 # @cached: Perform only checks which can be done without reading anything
2953 # @all: Perform all available overlap checks
2957 { 'enum': 'Qcow2OverlapCheckMode',
2958 'data': [ 'none', 'constant', 'cached', 'all' ] }
2961 # @Qcow2OverlapCheckFlags:
2963 # Structure of flags for each metadata structure. Setting a field to 'true'
2964 # makes qemu guard that structure against unintended overwriting. The default
2965 # value is chosen according to the template given.
2967 # @template: Specifies a template mode which can be adjusted using the other
2968 # flags, defaults to 'cached'
2970 # @bitmap-directory: since 3.0
2974 { 'struct': 'Qcow2OverlapCheckFlags',
2975 'data': { '*template': 'Qcow2OverlapCheckMode',
2976 '*main-header': 'bool',
2977 '*active-l1': 'bool',
2978 '*active-l2': 'bool',
2979 '*refcount-table': 'bool',
2980 '*refcount-block': 'bool',
2981 '*snapshot-table': 'bool',
2982 '*inactive-l1': 'bool',
2983 '*inactive-l2': 'bool',
2984 '*bitmap-directory': 'bool' } }
2987 # @Qcow2OverlapChecks:
2989 # Specifies which metadata structures should be guarded against unintended
2992 # @flags: set of flags for separate specification of each metadata structure
2995 # @mode: named mode which chooses a specific set of flags
2999 { 'alternate': 'Qcow2OverlapChecks',
3000 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3001 'mode': 'Qcow2OverlapCheckMode' } }
3004 # @BlockdevQcowEncryptionFormat:
3006 # @aes: AES-CBC with plain64 initialization vectors
3010 { 'enum': 'BlockdevQcowEncryptionFormat',
3014 # @BlockdevQcowEncryption:
3018 { 'union': 'BlockdevQcowEncryption',
3019 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3020 'discriminator': 'format',
3021 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3024 # @BlockdevOptionsQcow:
3026 # Driver specific block device options for qcow.
3028 # @encrypt: Image decryption options. Mandatory for
3029 # encrypted images, except when doing a metadata-only
3030 # probe of the image.
3034 { 'struct': 'BlockdevOptionsQcow',
3035 'base': 'BlockdevOptionsGenericCOWFormat',
3036 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3041 # @BlockdevQcow2EncryptionFormat:
3042 # @aes: AES-CBC with plain64 initialization vectors
3046 { 'enum': 'BlockdevQcow2EncryptionFormat',
3047 'data': [ 'aes', 'luks' ] }
3050 # @BlockdevQcow2Encryption:
3054 { 'union': 'BlockdevQcow2Encryption',
3055 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3056 'discriminator': 'format',
3057 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3058 'luks': 'QCryptoBlockOptionsLUKS'} }
3061 # @BlockdevOptionsQcow2:
3063 # Driver specific block device options for qcow2.
3065 # @lazy-refcounts: whether to enable the lazy refcounts
3066 # feature (default is taken from the image file)
3068 # @pass-discard-request: whether discard requests to the qcow2
3069 # device should be forwarded to the data source
3071 # @pass-discard-snapshot: whether discard requests for the data source
3072 # should be issued when a snapshot operation (e.g.
3073 # deleting a snapshot) frees clusters in the qcow2 file
3075 # @pass-discard-other: whether discard requests for the data source
3076 # should be issued on other occasions where a cluster
3079 # @overlap-check: which overlap checks to perform for writes
3080 # to the image, defaults to 'cached' (since 2.2)
3082 # @cache-size: the maximum total size of the L2 table and
3083 # refcount block caches in bytes (since 2.2)
3085 # @l2-cache-size: the maximum size of the L2 table cache in
3088 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3089 # bytes. It must be a power of two between 512
3090 # and the cluster size. The default value is
3091 # the cluster size (since 2.12)
3093 # @refcount-cache-size: the maximum size of the refcount block cache
3094 # in bytes (since 2.2)
3096 # @cache-clean-interval: clean unused entries in the L2 and refcount
3097 # caches. The interval is in seconds. The default value
3098 # is 600 on supporting platforms, and 0 on other
3099 # platforms. 0 disables this feature. (since 2.5)
3101 # @encrypt: Image decryption options. Mandatory for
3102 # encrypted images, except when doing a metadata-only
3103 # probe of the image. (since 2.10)
3105 # @data-file: reference to or definition of the external data file.
3106 # This may only be specified for images that require an
3107 # external data file. If it is not specified for such
3108 # an image, the data file name is loaded from the image
3113 { 'struct': 'BlockdevOptionsQcow2',
3114 'base': 'BlockdevOptionsGenericCOWFormat',
3115 'data': { '*lazy-refcounts': 'bool',
3116 '*pass-discard-request': 'bool',
3117 '*pass-discard-snapshot': 'bool',
3118 '*pass-discard-other': 'bool',
3119 '*overlap-check': 'Qcow2OverlapChecks',
3120 '*cache-size': 'int',
3121 '*l2-cache-size': 'int',
3122 '*l2-cache-entry-size': 'int',
3123 '*refcount-cache-size': 'int',
3124 '*cache-clean-interval': 'int',
3125 '*encrypt': 'BlockdevQcow2Encryption',
3126 '*data-file': 'BlockdevRef' } }
3129 # @SshHostKeyCheckMode:
3131 # @none Don't check the host key at all
3132 # @hash Compare the host key with a given hash
3133 # @known_hosts Check the host key against the known_hosts file
3137 { 'enum': 'SshHostKeyCheckMode',
3138 'data': [ 'none', 'hash', 'known_hosts' ] }
3141 # @SshHostKeyCheckHashType:
3143 # @md5 The given hash is an md5 hash
3144 # @sha1 The given hash is an sha1 hash
3148 { 'enum': 'SshHostKeyCheckHashType',
3149 'data': [ 'md5', 'sha1' ] }
3154 # @type The hash algorithm used for the hash
3155 # @hash The expected hash value
3159 { 'struct': 'SshHostKeyHash',
3160 'data': { 'type': 'SshHostKeyCheckHashType',
3168 { 'union': 'SshHostKeyCheck',
3169 'base': { 'mode': 'SshHostKeyCheckMode' },
3170 'discriminator': 'mode',
3171 'data': { 'hash': 'SshHostKeyHash' } }
3174 # @BlockdevOptionsSsh:
3176 # @server: host address
3178 # @path: path to the image on the host
3180 # @user: user as which to connect, defaults to current
3183 # @host-key-check: Defines how and what to check the host key against
3184 # (default: known_hosts)
3188 { 'struct': 'BlockdevOptionsSsh',
3189 'data': { 'server': 'InetSocketAddress',
3192 '*host-key-check': 'SshHostKeyCheck' } }
3198 # Trigger events supported by blkdebug.
3200 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3203 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3205 # @cor_write: a write due to copy-on-read (since 2.11)
3209 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3210 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3211 'l1_grow_activate_table', 'l2_load', 'l2_update',
3212 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3213 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3214 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3215 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3216 'refblock_load', 'refblock_update', 'refblock_update_part',
3217 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3218 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3219 'refblock_alloc_switch_table', 'cluster_alloc',
3220 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3221 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3222 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3223 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3224 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3228 # @BlkdebugInjectErrorOptions:
3230 # Describes a single error injection for blkdebug.
3232 # @event: trigger event
3234 # @state: the state identifier blkdebug needs to be in to
3235 # actually trigger the event; defaults to "any"
3237 # @errno: error identifier (errno) to be returned; defaults to
3240 # @sector: specifies the sector index which has to be affected
3241 # in order to actually trigger the event; defaults to "any
3244 # @once: disables further events after this one has been
3245 # triggered; defaults to false
3247 # @immediately: fail immediately; defaults to false
3251 { 'struct': 'BlkdebugInjectErrorOptions',
3252 'data': { 'event': 'BlkdebugEvent',
3257 '*immediately': 'bool' } }
3260 # @BlkdebugSetStateOptions:
3262 # Describes a single state-change event for blkdebug.
3264 # @event: trigger event
3266 # @state: the current state identifier blkdebug needs to be in;
3269 # @new_state: the state identifier blkdebug is supposed to assume if
3270 # this event is triggered
3274 { 'struct': 'BlkdebugSetStateOptions',
3275 'data': { 'event': 'BlkdebugEvent',
3277 'new_state': 'int' } }
3280 # @BlockdevOptionsBlkdebug:
3282 # Driver specific block device options for blkdebug.
3284 # @image: underlying raw block device (or image file)
3286 # @config: filename of the configuration file
3288 # @align: required alignment for requests in bytes, must be
3289 # positive power of 2, or 0 for default
3291 # @max-transfer: maximum size for I/O transfers in bytes, must be
3292 # positive multiple of @align and of the underlying
3293 # file's request alignment (but need not be a power of
3294 # 2), or 0 for default (since 2.10)
3296 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3297 # must be positive multiple of @align and of the
3298 # underlying file's request alignment (but need not be a
3299 # power of 2), or 0 for default (since 2.10)
3301 # @max-write-zero: maximum size for write zero requests in bytes, must be
3302 # positive multiple of @align, of @opt-write-zero, and of
3303 # the underlying file's request alignment (but need not
3304 # be a power of 2), or 0 for default (since 2.10)
3306 # @opt-discard: preferred alignment for discard requests in bytes, must
3307 # be positive multiple of @align and of the underlying
3308 # file's request alignment (but need not be a power of
3309 # 2), or 0 for default (since 2.10)
3311 # @max-discard: maximum size for discard requests in bytes, must be
3312 # positive multiple of @align, of @opt-discard, and of
3313 # the underlying file's request alignment (but need not
3314 # be a power of 2), or 0 for default (since 2.10)
3316 # @inject-error: array of error injection descriptions
3318 # @set-state: array of state-change descriptions
3322 { 'struct': 'BlockdevOptionsBlkdebug',
3323 'data': { 'image': 'BlockdevRef',
3325 '*align': 'int', '*max-transfer': 'int32',
3326 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3327 '*opt-discard': 'int32', '*max-discard': 'int32',
3328 '*inject-error': ['BlkdebugInjectErrorOptions'],
3329 '*set-state': ['BlkdebugSetStateOptions'] } }
3332 # @BlockdevOptionsBlklogwrites:
3334 # Driver specific block device options for blklogwrites.
3336 # @file: block device
3338 # @log: block device used to log writes to @file
3340 # @log-sector-size: sector size used in logging writes to @file, determines
3341 # granularity of offsets and sizes of writes (default: 512)
3343 # @log-append: append to an existing log (default: false)
3345 # @log-super-update-interval: interval of write requests after which the log
3346 # super block is updated to disk (default: 4096)
3350 { 'struct': 'BlockdevOptionsBlklogwrites',
3351 'data': { 'file': 'BlockdevRef',
3352 'log': 'BlockdevRef',
3353 '*log-sector-size': 'uint32',
3354 '*log-append': 'bool',
3355 '*log-super-update-interval': 'uint64' } }
3358 # @BlockdevOptionsBlkverify:
3360 # Driver specific block device options for blkverify.
3362 # @test: block device to be tested
3364 # @raw: raw image used for verification
3368 { 'struct': 'BlockdevOptionsBlkverify',
3369 'data': { 'test': 'BlockdevRef',
3370 'raw': 'BlockdevRef' } }
3373 # @QuorumReadPattern:
3375 # An enumeration of quorum read patterns.
3377 # @quorum: read all the children and do a quorum vote on reads
3379 # @fifo: read only from the first child that has not failed
3383 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3386 # @BlockdevOptionsQuorum:
3388 # Driver specific block device options for Quorum
3390 # @blkverify: true if the driver must print content mismatch
3391 # set to false by default
3393 # @children: the children block devices to use
3395 # @vote-threshold: the vote limit under which a read will fail
3397 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3400 # @read-pattern: choose read pattern and set to quorum by default
3405 { 'struct': 'BlockdevOptionsQuorum',
3406 'data': { '*blkverify': 'bool',
3407 'children': [ 'BlockdevRef' ],
3408 'vote-threshold': 'int',
3409 '*rewrite-corrupted': 'bool',
3410 '*read-pattern': 'QuorumReadPattern' } }
3413 # @BlockdevOptionsGluster:
3415 # Driver specific block device options for Gluster
3417 # @volume: name of gluster volume where VM image resides
3419 # @path: absolute path to image file in gluster volume
3421 # @server: gluster servers description
3423 # @debug: libgfapi log level (default '4' which is Error)
3426 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3430 { 'struct': 'BlockdevOptionsGluster',
3431 'data': { 'volume': 'str',
3433 'server': ['SocketAddress'],
3435 '*logfile': 'str' } }
3440 # An enumeration of libiscsi transport types
3444 { 'enum': 'IscsiTransport',
3445 'data': [ 'tcp', 'iser' ] }
3448 # @IscsiHeaderDigest:
3450 # An enumeration of header digests supported by libiscsi
3454 { 'enum': 'IscsiHeaderDigest',
3455 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3456 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3459 # @BlockdevOptionsIscsi:
3461 # @transport: The iscsi transport type
3463 # @portal: The address of the iscsi portal
3465 # @target: The target iqn name
3467 # @lun: LUN to connect to. Defaults to 0.
3469 # @user: User name to log in with. If omitted, no CHAP
3470 # authentication is performed.
3472 # @password-secret: The ID of a QCryptoSecret object providing
3473 # the password for the login. This option is required if
3474 # @user is specified.
3476 # @initiator-name: The iqn name we want to identify to the target
3477 # as. If this option is not specified, an initiator name is
3478 # generated automatically.
3480 # @header-digest: The desired header digest. Defaults to
3483 # @timeout: Timeout in seconds after which a request will
3484 # timeout. 0 means no timeout and is the default.
3486 # Driver specific block device options for iscsi
3490 { 'struct': 'BlockdevOptionsIscsi',
3491 'data': { 'transport': 'IscsiTransport',
3496 '*password-secret': 'str',
3497 '*initiator-name': 'str',
3498 '*header-digest': 'IscsiHeaderDigest',
3499 '*timeout': 'int' } }
3507 { 'enum': 'RbdAuthMode',
3508 'data': [ 'cephx', 'none' ] }
3511 # @BlockdevOptionsRbd:
3513 # @pool: Ceph pool name.
3515 # @image: Image name in the Ceph pool.
3517 # @conf: path to Ceph configuration file. Values
3518 # in the configuration file will be overridden by
3519 # options specified via QAPI.
3521 # @snapshot: Ceph snapshot name.
3523 # @user: Ceph id name.
3525 # @auth-client-required: Acceptable authentication modes.
3526 # This maps to Ceph configuration option
3527 # "auth_client_required". (Since 3.0)
3529 # @key-secret: ID of a QCryptoSecret object providing a key
3530 # for cephx authentication.
3531 # This maps to Ceph configuration option
3532 # "key". (Since 3.0)
3534 # @server: Monitor host address and port. This maps
3535 # to the "mon_host" Ceph option.
3539 { 'struct': 'BlockdevOptionsRbd',
3540 'data': { 'pool': 'str',
3545 '*auth-client-required': ['RbdAuthMode'],
3546 '*key-secret': 'str',
3547 '*server': ['InetSocketAddressBase'] } }
3550 # @BlockdevOptionsSheepdog:
3552 # Driver specific block device options for sheepdog
3554 # @vdi: Virtual disk image name
3555 # @server: The Sheepdog server to connect to
3556 # @snap-id: Snapshot ID
3557 # @tag: Snapshot tag name
3559 # Only one of @snap-id and @tag may be present.
3563 { 'struct': 'BlockdevOptionsSheepdog',
3564 'data': { 'server': 'SocketAddress',
3566 '*snap-id': 'uint32',
3572 # An enumeration of replication modes.
3574 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3576 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3580 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3581 'if': 'defined(CONFIG_REPLICATION)' }
3584 # @BlockdevOptionsReplication:
3586 # Driver specific block device options for replication
3588 # @mode: the replication mode
3590 # @top-id: In secondary mode, node name or device ID of the root
3591 # node who owns the replication node chain. Must not be given in
3596 { 'struct': 'BlockdevOptionsReplication',
3597 'base': 'BlockdevOptionsGenericFormat',
3598 'data': { 'mode': 'ReplicationMode',
3600 'if': 'defined(CONFIG_REPLICATION)' }
3605 # An enumeration of NFS transport types
3607 # @inet: TCP transport
3611 { 'enum': 'NFSTransport',
3612 'data': [ 'inet' ] }
3617 # Captures the address of the socket
3619 # @type: transport type used for NFS (only TCP supported)
3621 # @host: host address for NFS server
3625 { 'struct': 'NFSServer',
3626 'data': { 'type': 'NFSTransport',
3630 # @BlockdevOptionsNfs:
3632 # Driver specific block device option for NFS
3634 # @server: host address
3636 # @path: path of the image on the host
3638 # @user: UID value to use when talking to the
3639 # server (defaults to 65534 on Windows and getuid()
3642 # @group: GID value to use when talking to the
3643 # server (defaults to 65534 on Windows and getgid()
3646 # @tcp-syn-count: number of SYNs during the session
3647 # establishment (defaults to libnfs default)
3649 # @readahead-size: set the readahead size in bytes (defaults
3650 # to libnfs default)
3652 # @page-cache-size: set the pagecache size in bytes (defaults
3653 # to libnfs default)
3655 # @debug: set the NFS debug level (max 2) (defaults
3656 # to libnfs default)
3660 { 'struct': 'BlockdevOptionsNfs',
3661 'data': { 'server': 'NFSServer',
3665 '*tcp-syn-count': 'int',
3666 '*readahead-size': 'int',
3667 '*page-cache-size': 'int',
3671 # @BlockdevOptionsCurlBase:
3673 # Driver specific block device options shared by all protocols supported by the
3676 # @url: URL of the image file
3678 # @readahead: Size of the read-ahead cache; must be a multiple of
3679 # 512 (defaults to 256 kB)
3681 # @timeout: Timeout for connections, in seconds (defaults to 5)
3683 # @username: Username for authentication (defaults to none)
3685 # @password-secret: ID of a QCryptoSecret object providing a password
3686 # for authentication (defaults to no password)
3688 # @proxy-username: Username for proxy authentication (defaults to none)
3690 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3691 # for proxy authentication (defaults to no password)
3695 { 'struct': 'BlockdevOptionsCurlBase',
3696 'data': { 'url': 'str',
3697 '*readahead': 'int',
3700 '*password-secret': 'str',
3701 '*proxy-username': 'str',
3702 '*proxy-password-secret': 'str' } }
3705 # @BlockdevOptionsCurlHttp:
3707 # Driver specific block device options for HTTP connections over the curl
3708 # backend. URLs must start with "http://".
3710 # @cookie: List of cookies to set; format is
3711 # "name1=content1; name2=content2;" as explained by
3712 # CURLOPT_COOKIE(3). Defaults to no cookies.
3714 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3715 # secure way. See @cookie for the format. (since 2.10)
3719 { 'struct': 'BlockdevOptionsCurlHttp',
3720 'base': 'BlockdevOptionsCurlBase',
3721 'data': { '*cookie': 'str',
3722 '*cookie-secret': 'str'} }
3725 # @BlockdevOptionsCurlHttps:
3727 # Driver specific block device options for HTTPS connections over the curl
3728 # backend. URLs must start with "https://".
3730 # @cookie: List of cookies to set; format is
3731 # "name1=content1; name2=content2;" as explained by
3732 # CURLOPT_COOKIE(3). Defaults to no cookies.
3734 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3737 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3738 # secure way. See @cookie for the format. (since 2.10)
3742 { 'struct': 'BlockdevOptionsCurlHttps',
3743 'base': 'BlockdevOptionsCurlBase',
3744 'data': { '*cookie': 'str',
3745 '*sslverify': 'bool',
3746 '*cookie-secret': 'str'} }
3749 # @BlockdevOptionsCurlFtp:
3751 # Driver specific block device options for FTP connections over the curl
3752 # backend. URLs must start with "ftp://".
3756 { 'struct': 'BlockdevOptionsCurlFtp',
3757 'base': 'BlockdevOptionsCurlBase',
3761 # @BlockdevOptionsCurlFtps:
3763 # Driver specific block device options for FTPS connections over the curl
3764 # backend. URLs must start with "ftps://".
3766 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3771 { 'struct': 'BlockdevOptionsCurlFtps',
3772 'base': 'BlockdevOptionsCurlBase',
3773 'data': { '*sslverify': 'bool' } }
3776 # @BlockdevOptionsNbd:
3778 # Driver specific block device options for NBD.
3780 # @server: NBD server address
3782 # @export: export name
3784 # @tls-creds: TLS credentials ID
3786 # @x-dirty-bitmap: A "qemu:dirty-bitmap:NAME" string to query in place of
3787 # traditional "base:allocation" block status (see
3788 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol) (since 3.0)
3792 { 'struct': 'BlockdevOptionsNbd',
3793 'data': { 'server': 'SocketAddress',
3795 '*tls-creds': 'str',
3796 '*x-dirty-bitmap': 'str' } }
3799 # @BlockdevOptionsRaw:
3801 # Driver specific block device options for the raw driver.
3803 # @offset: position where the block device starts
3804 # @size: the assumed size of the device
3808 { 'struct': 'BlockdevOptionsRaw',
3809 'base': 'BlockdevOptionsGenericFormat',
3810 'data': { '*offset': 'int', '*size': 'int' } }
3813 # @BlockdevOptionsVxHS:
3815 # Driver specific block device options for VxHS
3817 # @vdisk-id: UUID of VxHS volume
3818 # @server: vxhs server IP, port
3819 # @tls-creds: TLS credentials ID
3823 { 'struct': 'BlockdevOptionsVxHS',
3824 'data': { 'vdisk-id': 'str',
3825 'server': 'InetSocketAddressBase',
3826 '*tls-creds': 'str' } }
3829 # @BlockdevOptionsThrottle:
3831 # Driver specific block device options for the throttle driver
3833 # @throttle-group: the name of the throttle-group object to use. It
3834 # must already exist.
3835 # @file: reference to or definition of the data source block device
3838 { 'struct': 'BlockdevOptionsThrottle',
3839 'data': { 'throttle-group': 'str',
3840 'file' : 'BlockdevRef'
3845 # Options for creating a block device. Many options are available for all
3846 # block devices, independent of the block driver:
3848 # @driver: block driver name
3849 # @node-name: the node name of the new node (Since 2.0).
3850 # This option is required on the top level of blockdev-add.
3851 # Valid node names start with an alphabetic character and may
3852 # contain only alphanumeric characters, '-', '.' and '_'. Their
3853 # maximum length is 31 characters.
3854 # @discard: discard-related options (default: ignore)
3855 # @cache: cache-related options
3856 # @read-only: whether the block device should be read-only (default: false).
3857 # Note that some block drivers support only read-only access,
3858 # either generally or in certain configurations. In this case,
3859 # the default value does not work and the option must be
3860 # specified explicitly.
3861 # @auto-read-only: if true and @read-only is false, QEMU may automatically
3862 # decide not to open the image read-write as requested, but
3863 # fall back to read-only instead (and switch between the modes
3864 # later), e.g. depending on whether the image file is writable
3865 # or whether a writing user is attached to the node
3866 # (default: false, since 3.1)
3867 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3869 # @force-share: force share all permission on added nodes.
3870 # Requires read-only=true. (Since 2.10)
3872 # Remaining options are determined by the block driver.
3876 { 'union': 'BlockdevOptions',
3877 'base': { 'driver': 'BlockdevDriver',
3878 '*node-name': 'str',
3879 '*discard': 'BlockdevDiscardOptions',
3880 '*cache': 'BlockdevCacheOptions',
3881 '*read-only': 'bool',
3882 '*auto-read-only': 'bool',
3883 '*force-share': 'bool',
3884 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3885 'discriminator': 'driver',
3887 'blkdebug': 'BlockdevOptionsBlkdebug',
3888 'blklogwrites':'BlockdevOptionsBlklogwrites',
3889 'blkverify': 'BlockdevOptionsBlkverify',
3890 'bochs': 'BlockdevOptionsGenericFormat',
3891 'cloop': 'BlockdevOptionsGenericFormat',
3892 'copy-on-read':'BlockdevOptionsGenericFormat',
3893 'dmg': 'BlockdevOptionsGenericFormat',
3894 'file': 'BlockdevOptionsFile',
3895 'ftp': 'BlockdevOptionsCurlFtp',
3896 'ftps': 'BlockdevOptionsCurlFtps',
3897 'gluster': 'BlockdevOptionsGluster',
3898 'host_cdrom': 'BlockdevOptionsFile',
3899 'host_device':'BlockdevOptionsFile',
3900 'http': 'BlockdevOptionsCurlHttp',
3901 'https': 'BlockdevOptionsCurlHttps',
3902 'iscsi': 'BlockdevOptionsIscsi',
3903 'luks': 'BlockdevOptionsLUKS',
3904 'nbd': 'BlockdevOptionsNbd',
3905 'nfs': 'BlockdevOptionsNfs',
3906 'null-aio': 'BlockdevOptionsNull',
3907 'null-co': 'BlockdevOptionsNull',
3908 'nvme': 'BlockdevOptionsNVMe',
3909 'parallels': 'BlockdevOptionsGenericFormat',
3910 'qcow2': 'BlockdevOptionsQcow2',
3911 'qcow': 'BlockdevOptionsQcow',
3912 'qed': 'BlockdevOptionsGenericCOWFormat',
3913 'quorum': 'BlockdevOptionsQuorum',
3914 'raw': 'BlockdevOptionsRaw',
3915 'rbd': 'BlockdevOptionsRbd',
3916 'replication': { 'type': 'BlockdevOptionsReplication',
3917 'if': 'defined(CONFIG_REPLICATION)' },
3918 'sheepdog': 'BlockdevOptionsSheepdog',
3919 'ssh': 'BlockdevOptionsSsh',
3920 'throttle': 'BlockdevOptionsThrottle',
3921 'vdi': 'BlockdevOptionsGenericFormat',
3922 'vhdx': 'BlockdevOptionsGenericFormat',
3923 'vmdk': 'BlockdevOptionsGenericCOWFormat',
3924 'vpc': 'BlockdevOptionsGenericFormat',
3925 'vvfat': 'BlockdevOptionsVVFAT',
3926 'vxhs': 'BlockdevOptionsVxHS'
3932 # Reference to a block device.
3934 # @definition: defines a new block device inline
3935 # @reference: references the ID of an existing block device
3939 { 'alternate': 'BlockdevRef',
3940 'data': { 'definition': 'BlockdevOptions',
3941 'reference': 'str' } }
3944 # @BlockdevRefOrNull:
3946 # Reference to a block device.
3948 # @definition: defines a new block device inline
3949 # @reference: references the ID of an existing block device.
3950 # An empty string means that no block device should
3951 # be referenced. Deprecated; use null instead.
3952 # @null: No block device should be referenced (since 2.10)
3956 { 'alternate': 'BlockdevRefOrNull',
3957 'data': { 'definition': 'BlockdevOptions',
3964 # Creates a new block device. If the @id option is given at the top level, a
3965 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
3966 # level and no BlockBackend will be created.
3973 # -> { "execute": "blockdev-add",
3975 # "driver": "qcow2",
3976 # "node-name": "test1",
3979 # "filename": "test.qcow2"
3983 # <- { "return": {} }
3986 # -> { "execute": "blockdev-add",
3988 # "driver": "qcow2",
3989 # "node-name": "node0",
3990 # "discard": "unmap",
3996 # "filename": "/tmp/test.qcow2"
4002 # "filename": "/dev/fdset/4"
4008 # <- { "return": {} }
4011 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
4016 # Deletes a block device that has been added using blockdev-add.
4017 # The command will fail if the node is attached to a device or is
4018 # otherwise being used.
4020 # @node-name: Name of the graph node to delete.
4026 # -> { "execute": "blockdev-add",
4028 # "driver": "qcow2",
4029 # "node-name": "node0",
4032 # "filename": "test.qcow2"
4036 # <- { "return": {} }
4038 # -> { "execute": "blockdev-del",
4039 # "arguments": { "node-name": "node0" }
4041 # <- { "return": {} }
4044 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
4047 # @BlockdevCreateOptionsFile:
4049 # Driver specific image creation options for file.
4051 # @filename Filename for the new image file
4052 # @size Size of the virtual disk in bytes
4053 # @preallocation Preallocation mode for the new image (default: off)
4054 # @nocow Turn off copy-on-write (valid only on btrfs; default: off)
4058 { 'struct': 'BlockdevCreateOptionsFile',
4059 'data': { 'filename': 'str',
4061 '*preallocation': 'PreallocMode',
4062 '*nocow': 'bool' } }
4065 # @BlockdevCreateOptionsGluster:
4067 # Driver specific image creation options for gluster.
4069 # @location Where to store the new image file
4070 # @size Size of the virtual disk in bytes
4071 # @preallocation Preallocation mode for the new image (default: off)
4075 { 'struct': 'BlockdevCreateOptionsGluster',
4076 'data': { 'location': 'BlockdevOptionsGluster',
4078 '*preallocation': 'PreallocMode' } }
4081 # @BlockdevCreateOptionsLUKS:
4083 # Driver specific image creation options for LUKS.
4085 # @file Node to create the image format on
4086 # @size Size of the virtual disk in bytes
4090 { 'struct': 'BlockdevCreateOptionsLUKS',
4091 'base': 'QCryptoBlockCreateOptionsLUKS',
4092 'data': { 'file': 'BlockdevRef',
4096 # @BlockdevCreateOptionsNfs:
4098 # Driver specific image creation options for NFS.
4100 # @location Where to store the new image file
4101 # @size Size of the virtual disk in bytes
4105 { 'struct': 'BlockdevCreateOptionsNfs',
4106 'data': { 'location': 'BlockdevOptionsNfs',
4110 # @BlockdevCreateOptionsParallels:
4112 # Driver specific image creation options for parallels.
4114 # @file Node to create the image format on
4115 # @size Size of the virtual disk in bytes
4116 # @cluster-size Cluster size in bytes (default: 1 MB)
4120 { 'struct': 'BlockdevCreateOptionsParallels',
4121 'data': { 'file': 'BlockdevRef',
4123 '*cluster-size': 'size' } }
4126 # @BlockdevCreateOptionsQcow:
4128 # Driver specific image creation options for qcow.
4130 # @file Node to create the image format on
4131 # @size Size of the virtual disk in bytes
4132 # @backing-file File name of the backing file if a backing file
4134 # @encrypt Encryption options if the image should be encrypted
4138 { 'struct': 'BlockdevCreateOptionsQcow',
4139 'data': { 'file': 'BlockdevRef',
4141 '*backing-file': 'str',
4142 '*encrypt': 'QCryptoBlockCreateOptions' } }
4145 # @BlockdevQcow2Version:
4147 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4148 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4152 { 'enum': 'BlockdevQcow2Version',
4153 'data': [ 'v2', 'v3' ] }
4157 # @BlockdevCreateOptionsQcow2:
4159 # Driver specific image creation options for qcow2.
4161 # @file Node to create the image format on
4162 # @data-file Node to use as an external data file in which all guest
4163 # data is stored so that only metadata remains in the qcow2
4165 # @data-file-raw True if the external data file must stay valid as a
4166 # standalone (read-only) raw image without looking at qcow2
4167 # metadata (default: false; since: 4.0)
4168 # @size Size of the virtual disk in bytes
4169 # @version Compatibility level (default: v3)
4170 # @backing-file File name of the backing file if a backing file
4172 # @backing-fmt Name of the block driver to use for the backing file
4173 # @encrypt Encryption options if the image should be encrypted
4174 # @cluster-size qcow2 cluster size in bytes (default: 65536)
4175 # @preallocation Preallocation mode for the new image (default: off)
4176 # @lazy-refcounts True if refcounts may be updated lazily (default: off)
4177 # @refcount-bits Width of reference counts in bits (default: 16)
4181 { 'struct': 'BlockdevCreateOptionsQcow2',
4182 'data': { 'file': 'BlockdevRef',
4183 '*data-file': 'BlockdevRef',
4184 '*data-file-raw': 'bool',
4186 '*version': 'BlockdevQcow2Version',
4187 '*backing-file': 'str',
4188 '*backing-fmt': 'BlockdevDriver',
4189 '*encrypt': 'QCryptoBlockCreateOptions',
4190 '*cluster-size': 'size',
4191 '*preallocation': 'PreallocMode',
4192 '*lazy-refcounts': 'bool',
4193 '*refcount-bits': 'int' } }
4196 # @BlockdevCreateOptionsQed:
4198 # Driver specific image creation options for qed.
4200 # @file Node to create the image format on
4201 # @size Size of the virtual disk in bytes
4202 # @backing-file File name of the backing file if a backing file
4204 # @backing-fmt Name of the block driver to use for the backing file
4205 # @cluster-size Cluster size in bytes (default: 65536)
4206 # @table-size L1/L2 table size (in clusters)
4210 { 'struct': 'BlockdevCreateOptionsQed',
4211 'data': { 'file': 'BlockdevRef',
4213 '*backing-file': 'str',
4214 '*backing-fmt': 'BlockdevDriver',
4215 '*cluster-size': 'size',
4216 '*table-size': 'int' } }
4219 # @BlockdevCreateOptionsRbd:
4221 # Driver specific image creation options for rbd/Ceph.
4223 # @location Where to store the new image file. This location cannot
4224 # point to a snapshot.
4225 # @size Size of the virtual disk in bytes
4226 # @cluster-size RBD object size
4230 { 'struct': 'BlockdevCreateOptionsRbd',
4231 'data': { 'location': 'BlockdevOptionsRbd',
4233 '*cluster-size' : 'size' } }
4236 # @BlockdevVmdkSubformat:
4238 # Subformat options for VMDK images
4240 # @monolithicSparse: Single file image with sparse cluster allocation
4242 # @monolithicFlat: Single flat data image and a descriptor file
4244 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4245 # files, in addition to a descriptor file
4247 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4248 # files, in addition to a descriptor file
4250 # @streamOptimized: Single file image sparse cluster allocation, optimized
4251 # for streaming over network.
4255 { 'enum': 'BlockdevVmdkSubformat',
4256 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4257 'twoGbMaxExtentFlat', 'streamOptimized'] }
4260 # @BlockdevVmdkAdapterType:
4262 # Adapter type info for VMDK images
4266 { 'enum': 'BlockdevVmdkAdapterType',
4267 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4270 # @BlockdevCreateOptionsVmdk:
4272 # Driver specific image creation options for VMDK.
4274 # @file Where to store the new image file. This refers to the image
4275 # file for monolithcSparse and streamOptimized format, or the
4276 # descriptor file for other formats.
4277 # @size Size of the virtual disk in bytes
4278 # @extents Where to store the data extents. Required for monolithcFlat,
4279 # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4280 # monolithicFlat, only one entry is required; for
4281 # twoGbMaxExtent* formats, the number of entries required is
4282 # calculated as extent_number = virtual_size / 2GB. Providing
4283 # more extents than will be used is an error.
4284 # @subformat The subformat of the VMDK image. Default: "monolithicSparse".
4285 # @backing-file The path of backing file. Default: no backing file is used.
4286 # @adapter-type The adapter type used to fill in the descriptor. Default: ide.
4287 # @hwversion Hardware version. The meaningful options are "4" or "6".
4289 # @zeroed-grain Whether to enable zeroed-grain feature for sparse subformats.
4294 { 'struct': 'BlockdevCreateOptionsVmdk',
4295 'data': { 'file': 'BlockdevRef',
4297 '*extents': ['BlockdevRef'],
4298 '*subformat': 'BlockdevVmdkSubformat',
4299 '*backing-file': 'str',
4300 '*adapter-type': 'BlockdevVmdkAdapterType',
4301 '*hwversion': 'str',
4302 '*zeroed-grain': 'bool' } }
4306 # @SheepdogRedundancyType:
4308 # @full Create a fully replicated vdi with x copies
4309 # @erasure-coded Create an erasure coded vdi with x data strips and
4314 { 'enum': 'SheepdogRedundancyType',
4315 'data': [ 'full', 'erasure-coded' ] }
4318 # @SheepdogRedundancyFull:
4320 # @copies Number of copies to use (between 1 and 31)
4324 { 'struct': 'SheepdogRedundancyFull',
4325 'data': { 'copies': 'int' }}
4328 # @SheepdogRedundancyErasureCoded:
4330 # @data-strips Number of data strips to use (one of {2,4,8,16})
4331 # @parity-strips Number of parity strips to use (between 1 and 15)
4335 { 'struct': 'SheepdogRedundancyErasureCoded',
4336 'data': { 'data-strips': 'int',
4337 'parity-strips': 'int' }}
4340 # @SheepdogRedundancy:
4344 { 'union': 'SheepdogRedundancy',
4345 'base': { 'type': 'SheepdogRedundancyType' },
4346 'discriminator': 'type',
4347 'data': { 'full': 'SheepdogRedundancyFull',
4348 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
4351 # @BlockdevCreateOptionsSheepdog:
4353 # Driver specific image creation options for Sheepdog.
4355 # @location Where to store the new image file
4356 # @size Size of the virtual disk in bytes
4357 # @backing-file File name of a base image
4358 # @preallocation Preallocation mode (allowed values: off, full)
4359 # @redundancy Redundancy of the image
4360 # @object-size Object size of the image
4364 { 'struct': 'BlockdevCreateOptionsSheepdog',
4365 'data': { 'location': 'BlockdevOptionsSheepdog',
4367 '*backing-file': 'str',
4368 '*preallocation': 'PreallocMode',
4369 '*redundancy': 'SheepdogRedundancy',
4370 '*object-size': 'size' } }
4373 # @BlockdevCreateOptionsSsh:
4375 # Driver specific image creation options for SSH.
4377 # @location Where to store the new image file
4378 # @size Size of the virtual disk in bytes
4382 { 'struct': 'BlockdevCreateOptionsSsh',
4383 'data': { 'location': 'BlockdevOptionsSsh',
4387 # @BlockdevCreateOptionsVdi:
4389 # Driver specific image creation options for VDI.
4391 # @file Node to create the image format on
4392 # @size Size of the virtual disk in bytes
4393 # @preallocation Preallocation mode for the new image (allowed values: off,
4394 # metadata; default: off)
4398 { 'struct': 'BlockdevCreateOptionsVdi',
4399 'data': { 'file': 'BlockdevRef',
4401 '*preallocation': 'PreallocMode' } }
4404 # @BlockdevVhdxSubformat:
4406 # @dynamic: Growing image file
4407 # @fixed: Preallocated fixed-size image file
4411 { 'enum': 'BlockdevVhdxSubformat',
4412 'data': [ 'dynamic', 'fixed' ] }
4415 # @BlockdevCreateOptionsVhdx:
4417 # Driver specific image creation options for vhdx.
4419 # @file Node to create the image format on
4420 # @size Size of the virtual disk in bytes
4421 # @log-size Log size in bytes, must be a multiple of 1 MB
4423 # @block-size Block size in bytes, must be a multiple of 1 MB and not
4424 # larger than 256 MB (default: automatically choose a block
4425 # size depending on the image size)
4426 # @subformat vhdx subformat (default: dynamic)
4427 # @block-state-zero Force use of payload blocks of type 'ZERO'. Non-standard,
4428 # but default. Do not set to 'off' when using 'qemu-img
4429 # convert' with subformat=dynamic.
4433 { 'struct': 'BlockdevCreateOptionsVhdx',
4434 'data': { 'file': 'BlockdevRef',
4436 '*log-size': 'size',
4437 '*block-size': 'size',
4438 '*subformat': 'BlockdevVhdxSubformat',
4439 '*block-state-zero': 'bool' } }
4442 # @BlockdevVpcSubformat:
4444 # @dynamic: Growing image file
4445 # @fixed: Preallocated fixed-size image file
4449 { 'enum': 'BlockdevVpcSubformat',
4450 'data': [ 'dynamic', 'fixed' ] }
4453 # @BlockdevCreateOptionsVpc:
4455 # Driver specific image creation options for vpc (VHD).
4457 # @file Node to create the image format on
4458 # @size Size of the virtual disk in bytes
4459 # @subformat vhdx subformat (default: dynamic)
4460 # @force-size Force use of the exact byte size instead of rounding to the
4461 # next size that can be represented in CHS geometry
4466 { 'struct': 'BlockdevCreateOptionsVpc',
4467 'data': { 'file': 'BlockdevRef',
4469 '*subformat': 'BlockdevVpcSubformat',
4470 '*force-size': 'bool' } }
4473 # @BlockdevCreateOptions:
4475 # Options for creating an image format on a given node.
4477 # @driver block driver to create the image format
4481 { 'union': 'BlockdevCreateOptions',
4483 'driver': 'BlockdevDriver' },
4484 'discriminator': 'driver',
4486 'file': 'BlockdevCreateOptionsFile',
4487 'gluster': 'BlockdevCreateOptionsGluster',
4488 'luks': 'BlockdevCreateOptionsLUKS',
4489 'nfs': 'BlockdevCreateOptionsNfs',
4490 'parallels': 'BlockdevCreateOptionsParallels',
4491 'qcow': 'BlockdevCreateOptionsQcow',
4492 'qcow2': 'BlockdevCreateOptionsQcow2',
4493 'qed': 'BlockdevCreateOptionsQed',
4494 'rbd': 'BlockdevCreateOptionsRbd',
4495 'sheepdog': 'BlockdevCreateOptionsSheepdog',
4496 'ssh': 'BlockdevCreateOptionsSsh',
4497 'vdi': 'BlockdevCreateOptionsVdi',
4498 'vhdx': 'BlockdevCreateOptionsVhdx',
4499 'vmdk': 'BlockdevCreateOptionsVmdk',
4500 'vpc': 'BlockdevCreateOptionsVpc'
4506 # Starts a job to create an image format on a given node. The job is
4507 # automatically finalized, but a manual job-dismiss is required.
4509 # @job-id: Identifier for the newly created job.
4511 # @options: Options for the image creation.
4515 { 'command': 'blockdev-create',
4516 'data': { 'job-id': 'str',
4517 'options': 'BlockdevCreateOptions' } }
4520 # @blockdev-open-tray:
4522 # Opens a block device's tray. If there is a block driver state tree inserted as
4523 # a medium, it will become inaccessible to the guest (but it will remain
4524 # associated to the block device, so closing the tray will make it accessible
4527 # If the tray was already open before, this will be a no-op.
4529 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4530 # which no such event will be generated, these include:
4531 # - if the guest has locked the tray, @force is false and the guest does not
4532 # respond to the eject request
4533 # - if the BlockBackend denoted by @device does not have a guest device attached
4535 # - if the guest device does not have an actual tray
4537 # @device: Block device name (deprecated, use @id instead)
4539 # @id: The name or QOM path of the guest device (since: 2.8)
4541 # @force: if false (the default), an eject request will be sent to
4542 # the guest if it has locked the tray (and the tray will not be opened
4543 # immediately); if true, the tray will be opened regardless of whether
4550 # -> { "execute": "blockdev-open-tray",
4551 # "arguments": { "id": "ide0-1-0" } }
4553 # <- { "timestamp": { "seconds": 1418751016,
4554 # "microseconds": 716996 },
4555 # "event": "DEVICE_TRAY_MOVED",
4556 # "data": { "device": "ide1-cd0",
4558 # "tray-open": true } }
4560 # <- { "return": {} }
4563 { 'command': 'blockdev-open-tray',
4564 'data': { '*device': 'str',
4566 '*force': 'bool' } }
4569 # @blockdev-close-tray:
4571 # Closes a block device's tray. If there is a block driver state tree associated
4572 # with the block device (which is currently ejected), that tree will be loaded
4575 # If the tray was already closed before, this will be a no-op.
4577 # @device: Block device name (deprecated, use @id instead)
4579 # @id: The name or QOM path of the guest device (since: 2.8)
4585 # -> { "execute": "blockdev-close-tray",
4586 # "arguments": { "id": "ide0-1-0" } }
4588 # <- { "timestamp": { "seconds": 1418751345,
4589 # "microseconds": 272147 },
4590 # "event": "DEVICE_TRAY_MOVED",
4591 # "data": { "device": "ide1-cd0",
4593 # "tray-open": false } }
4595 # <- { "return": {} }
4598 { 'command': 'blockdev-close-tray',
4599 'data': { '*device': 'str',
4603 # @blockdev-remove-medium:
4605 # Removes a medium (a block driver state tree) from a block device. That block
4606 # device's tray must currently be open (unless there is no attached guest
4609 # If the tray is open and there is no medium inserted, this will be a no-op.
4611 # @id: The name or QOM path of the guest device
4617 # -> { "execute": "blockdev-remove-medium",
4618 # "arguments": { "id": "ide0-1-0" } }
4620 # <- { "error": { "class": "GenericError",
4621 # "desc": "Tray of device 'ide0-1-0' is not open" } }
4623 # -> { "execute": "blockdev-open-tray",
4624 # "arguments": { "id": "ide0-1-0" } }
4626 # <- { "timestamp": { "seconds": 1418751627,
4627 # "microseconds": 549958 },
4628 # "event": "DEVICE_TRAY_MOVED",
4629 # "data": { "device": "ide1-cd0",
4631 # "tray-open": true } }
4633 # <- { "return": {} }
4635 # -> { "execute": "blockdev-remove-medium",
4636 # "arguments": { "id": "ide0-1-0" } }
4638 # <- { "return": {} }
4641 { 'command': 'blockdev-remove-medium',
4642 'data': { 'id': 'str' } }
4645 # @blockdev-insert-medium:
4647 # Inserts a medium (a block driver state tree) into a block device. That block
4648 # device's tray must currently be open (unless there is no attached guest
4649 # device) and there must be no medium inserted already.
4651 # @id: The name or QOM path of the guest device
4653 # @node-name: name of a node in the block driver state graph
4659 # -> { "execute": "blockdev-add",
4661 # "node-name": "node0",
4663 # "file": { "driver": "file",
4664 # "filename": "fedora.iso" } } }
4665 # <- { "return": {} }
4667 # -> { "execute": "blockdev-insert-medium",
4668 # "arguments": { "id": "ide0-1-0",
4669 # "node-name": "node0" } }
4671 # <- { "return": {} }
4674 { 'command': 'blockdev-insert-medium',
4675 'data': { 'id': 'str',
4676 'node-name': 'str'} }
4680 # @BlockdevChangeReadOnlyMode:
4682 # Specifies the new read-only mode of a block device subject to the
4683 # @blockdev-change-medium command.
4685 # @retain: Retains the current read-only mode
4687 # @read-only: Makes the device read-only
4689 # @read-write: Makes the device writable
4694 { 'enum': 'BlockdevChangeReadOnlyMode',
4695 'data': ['retain', 'read-only', 'read-write'] }
4699 # @blockdev-change-medium:
4701 # Changes the medium inserted into a block device by ejecting the current medium
4702 # and loading a new image file which is inserted as the new medium (this command
4703 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
4704 # and blockdev-close-tray).
4706 # @device: Block device name (deprecated, use @id instead)
4708 # @id: The name or QOM path of the guest device
4711 # @filename: filename of the new image to be loaded
4713 # @format: format to open the new image with (defaults to
4714 # the probed format)
4716 # @read-only-mode: change the read-only mode of the device; defaults
4723 # 1. Change a removable medium
4725 # -> { "execute": "blockdev-change-medium",
4726 # "arguments": { "id": "ide0-1-0",
4727 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4728 # "format": "raw" } }
4729 # <- { "return": {} }
4731 # 2. Load a read-only medium into a writable drive
4733 # -> { "execute": "blockdev-change-medium",
4734 # "arguments": { "id": "floppyA",
4735 # "filename": "/srv/images/ro.img",
4737 # "read-only-mode": "retain" } }
4740 # { "class": "GenericError",
4741 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4743 # -> { "execute": "blockdev-change-medium",
4744 # "arguments": { "id": "floppyA",
4745 # "filename": "/srv/images/ro.img",
4747 # "read-only-mode": "read-only" } }
4749 # <- { "return": {} }
4752 { 'command': 'blockdev-change-medium',
4753 'data': { '*device': 'str',
4757 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
4761 # @BlockErrorAction:
4763 # An enumeration of action that has been taken when a DISK I/O occurs
4765 # @ignore: error has been ignored
4767 # @report: error has been reported to the device
4769 # @stop: error caused VM to be stopped
4773 { 'enum': 'BlockErrorAction',
4774 'data': [ 'ignore', 'report', 'stop' ] }
4778 # @BLOCK_IMAGE_CORRUPTED:
4780 # Emitted when a disk image is being marked corrupt. The image can be
4781 # identified by its device or node name. The 'device' field is always
4782 # present for compatibility reasons, but it can be empty ("") if the
4783 # image does not have a device name associated.
4785 # @device: device name. This is always present for compatibility
4786 # reasons, but it can be empty ("") if the image does not
4787 # have a device name associated.
4789 # @node-name: node name (Since: 2.4)
4791 # @msg: informative message for human consumption, such as the kind of
4792 # corruption being detected. It should not be parsed by machine as it is
4793 # not guaranteed to be stable
4795 # @offset: if the corruption resulted from an image access, this is
4796 # the host's access offset into the image
4798 # @size: if the corruption resulted from an image access, this is
4801 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4802 # event and must be repaired (Since 2.2; before, every
4803 # BLOCK_IMAGE_CORRUPTED event was fatal)
4805 # Note: If action is "stop", a STOP event will eventually follow the
4806 # BLOCK_IO_ERROR event.
4810 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4811 # "data": { "device": "ide0-hd0", "node-name": "node0",
4812 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4814 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4818 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4819 'data': { 'device' : 'str',
4820 '*node-name' : 'str',
4824 'fatal' : 'bool' } }
4829 # Emitted when a disk I/O error occurs
4831 # @device: device name. This is always present for compatibility
4832 # reasons, but it can be empty ("") if the image does not
4833 # have a device name associated.
4835 # @node-name: node name. Note that errors may be reported for the root node
4836 # that is directly attached to a guest device rather than for the
4837 # node where the error occurred. The node name is not present if
4838 # the drive is empty. (Since: 2.8)
4840 # @operation: I/O operation
4842 # @action: action that has been taken
4844 # @nospace: true if I/O error was caused due to a no-space
4845 # condition. This key is only present if query-block's
4846 # io-status is present, please see query-block documentation
4847 # for more information (since: 2.2)
4849 # @reason: human readable string describing the error cause.
4850 # (This field is a debugging aid for humans, it should not
4851 # be parsed by applications) (since: 2.2)
4853 # Note: If action is "stop", a STOP event will eventually follow the
4854 # BLOCK_IO_ERROR event
4860 # <- { "event": "BLOCK_IO_ERROR",
4861 # "data": { "device": "ide0-hd1",
4862 # "node-name": "#block212",
4863 # "operation": "write",
4864 # "action": "stop" },
4865 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4868 { 'event': 'BLOCK_IO_ERROR',
4869 'data': { 'device': 'str', '*node-name': 'str',
4870 'operation': 'IoOperationType',
4871 'action': 'BlockErrorAction', '*nospace': 'bool',
4875 # @BLOCK_JOB_COMPLETED:
4877 # Emitted when a block job has completed
4881 # @device: The job identifier. Originally the device name but other
4882 # values are allowed since QEMU 2.7
4884 # @len: maximum progress value
4886 # @offset: current progress value. On success this is equal to len.
4887 # On failure this is less than len
4889 # @speed: rate limit, bytes per second
4891 # @error: error message. Only present on failure. This field
4892 # contains a human-readable error message. There are no semantics
4893 # other than that streaming has failed and clients should not try to
4894 # interpret the error string
4900 # <- { "event": "BLOCK_JOB_COMPLETED",
4901 # "data": { "type": "stream", "device": "virtio-disk0",
4902 # "len": 10737418240, "offset": 10737418240,
4904 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4907 { 'event': 'BLOCK_JOB_COMPLETED',
4908 'data': { 'type' : 'JobType',
4916 # @BLOCK_JOB_CANCELLED:
4918 # Emitted when a block job has been cancelled
4922 # @device: The job identifier. Originally the device name but other
4923 # values are allowed since QEMU 2.7
4925 # @len: maximum progress value
4927 # @offset: current progress value. On success this is equal to len.
4928 # On failure this is less than len
4930 # @speed: rate limit, bytes per second
4936 # <- { "event": "BLOCK_JOB_CANCELLED",
4937 # "data": { "type": "stream", "device": "virtio-disk0",
4938 # "len": 10737418240, "offset": 134217728,
4940 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4943 { 'event': 'BLOCK_JOB_CANCELLED',
4944 'data': { 'type' : 'JobType',
4953 # Emitted when a block job encounters an error
4955 # @device: The job identifier. Originally the device name but other
4956 # values are allowed since QEMU 2.7
4958 # @operation: I/O operation
4960 # @action: action that has been taken
4966 # <- { "event": "BLOCK_JOB_ERROR",
4967 # "data": { "device": "ide0-hd1",
4968 # "operation": "write",
4969 # "action": "stop" },
4970 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4973 { 'event': 'BLOCK_JOB_ERROR',
4974 'data': { 'device' : 'str',
4975 'operation': 'IoOperationType',
4976 'action' : 'BlockErrorAction' } }
4981 # Emitted when a block job is ready to complete
4985 # @device: The job identifier. Originally the device name but other
4986 # values are allowed since QEMU 2.7
4988 # @len: maximum progress value
4990 # @offset: current progress value. On success this is equal to len.
4991 # On failure this is less than len
4993 # @speed: rate limit, bytes per second
4995 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
5002 # <- { "event": "BLOCK_JOB_READY",
5003 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5004 # "len": 2097152, "offset": 2097152 }
5005 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5008 { 'event': 'BLOCK_JOB_READY',
5009 'data': { 'type' : 'JobType',
5016 # @BLOCK_JOB_PENDING:
5018 # Emitted when a block job is awaiting explicit authorization to finalize graph
5019 # changes via @block-job-finalize. If this job is part of a transaction, it will
5020 # not emit this event until the transaction has converged first.
5024 # @id: The job identifier.
5030 # <- { "event": "BLOCK_JOB_WAITING",
5031 # "data": { "device": "drive0", "type": "mirror" },
5032 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5035 { 'event': 'BLOCK_JOB_PENDING',
5036 'data': { 'type' : 'JobType',
5042 # Preallocation mode of QEMU image file
5044 # @off: no preallocation
5045 # @metadata: preallocate only for metadata
5046 # @falloc: like @full preallocation but allocate disk space by
5047 # posix_fallocate() rather than writing zeros.
5048 # @full: preallocate all data by writing zeros to device to ensure disk
5049 # space is really available. @full preallocation also sets up
5050 # metadata correctly.
5054 { 'enum': 'PreallocMode',
5055 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5058 # @BLOCK_WRITE_THRESHOLD:
5060 # Emitted when writes on block device reaches or exceeds the
5061 # configured write threshold. For thin-provisioned devices, this
5062 # means the device should be extended to avoid pausing for
5064 # The event is one shot. Once triggered, it needs to be
5065 # re-registered with another block-set-write-threshold command.
5067 # @node-name: graph node name on which the threshold was exceeded.
5069 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5071 # @write-threshold: last configured threshold, in bytes.
5075 { 'event': 'BLOCK_WRITE_THRESHOLD',
5076 'data': { 'node-name': 'str',
5077 'amount-exceeded': 'uint64',
5078 'write-threshold': 'uint64' } }
5081 # @block-set-write-threshold:
5083 # Change the write threshold for a block drive. An event will be
5084 # delivered if a write to this block drive crosses the configured
5085 # threshold. The threshold is an offset, thus must be
5086 # non-negative. Default is no write threshold. Setting the threshold
5087 # to zero disables it.
5089 # This is useful to transparently resize thin-provisioned drives without
5090 # the guest OS noticing.
5092 # @node-name: graph node name on which the threshold must be set.
5094 # @write-threshold: configured threshold for the block device, bytes.
5095 # Use 0 to disable the threshold.
5101 # -> { "execute": "block-set-write-threshold",
5102 # "arguments": { "node-name": "mydev",
5103 # "write-threshold": 17179869184 } }
5104 # <- { "return": {} }
5107 { 'command': 'block-set-write-threshold',
5108 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
5111 # @x-blockdev-change:
5113 # Dynamically reconfigure the block driver state graph. It can be used
5114 # to add, remove, insert or replace a graph node. Currently only the
5115 # Quorum driver implements this feature to add or remove its child. This
5116 # is useful to fix a broken quorum child.
5118 # If @node is specified, it will be inserted under @parent. @child
5119 # may not be specified in this case. If both @parent and @child are
5120 # specified but @node is not, @child will be detached from @parent.
5122 # @parent: the id or name of the parent node.
5124 # @child: the name of a child under the given parent node.
5126 # @node: the name of the node that will be added.
5128 # Note: this command is experimental, and its API is not stable. It
5129 # does not support all kinds of operations, all kinds of children, nor
5130 # all block drivers.
5132 # FIXME Removing children from a quorum node means introducing gaps in the
5133 # child indices. This cannot be represented in the 'children' list of
5134 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
5136 # Warning: The data in a new quorum child MUST be consistent with that of
5137 # the rest of the array.
5143 # 1. Add a new node to a quorum
5144 # -> { "execute": "blockdev-add",
5147 # "node-name": "new_node",
5148 # "file": { "driver": "file",
5149 # "filename": "test.raw" } } }
5150 # <- { "return": {} }
5151 # -> { "execute": "x-blockdev-change",
5152 # "arguments": { "parent": "disk1",
5153 # "node": "new_node" } }
5154 # <- { "return": {} }
5156 # 2. Delete a quorum's node
5157 # -> { "execute": "x-blockdev-change",
5158 # "arguments": { "parent": "disk1",
5159 # "child": "children.1" } }
5160 # <- { "return": {} }
5163 { 'command': 'x-blockdev-change',
5164 'data' : { 'parent': 'str',
5169 # @x-blockdev-set-iothread:
5171 # Move @node and its children into the @iothread. If @iothread is null then
5172 # move @node and its children into the main loop.
5174 # The node must not be attached to a BlockBackend.
5176 # @node-name: the name of the block driver node
5178 # @iothread: the name of the IOThread object or null for the main loop
5180 # @force: true if the node and its children should be moved when a BlockBackend
5181 # is already attached
5183 # Note: this command is experimental and intended for test cases that need
5184 # control over IOThreads only.
5190 # 1. Move a node into an IOThread
5191 # -> { "execute": "x-blockdev-set-iothread",
5192 # "arguments": { "node-name": "disk1",
5193 # "iothread": "iothread0" } }
5194 # <- { "return": {} }
5196 # 2. Move a node into the main loop
5197 # -> { "execute": "x-blockdev-set-iothread",
5198 # "arguments": { "node-name": "disk1",
5199 # "iothread": null } }
5200 # <- { "return": {} }
5203 { 'command': 'x-blockdev-set-iothread',
5204 'data' : { 'node-name': 'str',
5205 'iothread': 'StrOrNull',
5206 '*force': 'bool' } }