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)
363 # @dirty-bitmaps: dirty bitmaps information (only present if node
364 # has one or more dirty bitmaps) (Since 4.2)
369 { 'struct': 'BlockDeviceInfo',
370 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
371 '*backing_file': 'str', 'backing_file_depth': 'int',
372 'encrypted': 'bool', 'encryption_key_missing': 'bool',
373 'detect_zeroes': 'BlockdevDetectZeroesOptions',
374 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
375 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
376 'image': 'ImageInfo',
377 '*bps_max': 'int', '*bps_rd_max': 'int',
378 '*bps_wr_max': 'int', '*iops_max': 'int',
379 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
380 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
381 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
382 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
383 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
384 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
387 # @BlockDeviceIoStatus:
389 # An enumeration of block device I/O status.
391 # @ok: The last I/O operation has succeeded
393 # @failed: The last I/O operation has failed
395 # @nospace: The last I/O operation has failed due to a no-space condition
399 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
402 # @BlockDeviceMapEntry:
404 # Entry in the metadata map of the device (returned by "qemu-img map")
406 # @start: Offset in the image of the first byte described by this entry
409 # @length: Length of the range described by this entry (in bytes)
411 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
412 # before reaching one for which the range is allocated. The value is
413 # in the range 0 to the depth of the image chain - 1.
415 # @zero: the sectors in this range read as zeros
417 # @data: reading the image will actually read data from a file (in particular,
418 # if @offset is present this means that the sectors are not simply
419 # preallocated, but contain actual data in raw format)
421 # @offset: if present, the image file stores the data for this range in
422 # raw format at the given offset.
426 { 'struct': 'BlockDeviceMapEntry',
427 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
428 'data': 'bool', '*offset': 'int' } }
431 # @DirtyBitmapStatus:
433 # An enumeration of possible states that a dirty bitmap can report to the user.
435 # @frozen: The bitmap is currently in-use by some operation and is immutable.
436 # If the bitmap was @active prior to the operation, new writes by the
437 # guest are being recorded in a temporary buffer, and will not be lost.
438 # Generally, bitmaps are cleared on successful use in an operation and
439 # the temporary buffer is committed into the bitmap. On failure, the
440 # temporary buffer is merged back into the bitmap without first
442 # Please refer to the documentation for each bitmap-using operation,
443 # See also @blockdev-backup, @drive-backup.
445 # @disabled: The bitmap is not currently recording new writes by the guest.
446 # This is requested explicitly via @block-dirty-bitmap-disable.
447 # It can still be cleared, deleted, or used for backup operations.
449 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
450 # deleted, or used for backup operations.
452 # @locked: The bitmap is currently in-use by some operation and is immutable.
453 # If the bitmap was @active prior to the operation, it is still
454 # recording new writes. If the bitmap was @disabled, it is not
455 # recording new writes. (Since 2.12)
457 # @inconsistent: This is a persistent dirty bitmap that was marked in-use on
458 # disk, and is unusable by QEMU. It can only be deleted.
459 # Please rely on the inconsistent field in @BlockDirtyInfo
460 # instead, as the status field is deprecated. (Since 4.0)
464 { 'enum': 'DirtyBitmapStatus',
465 'data': ['active', 'disabled', 'frozen', 'locked', 'inconsistent'] }
470 # Block dirty bitmap information.
472 # @name: the name of the dirty bitmap (Since 2.4)
474 # @count: number of dirty bytes according to the dirty bitmap
476 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
478 # @status: Deprecated in favor of @recording and @locked. (since 2.4)
480 # @recording: true if the bitmap is recording new writes from the guest.
481 # Replaces `active` and `disabled` statuses. (since 4.0)
483 # @busy: true if the bitmap is in-use by some operation (NBD or jobs)
484 # and cannot be modified via QMP or used by another operation.
485 # Replaces `locked` and `frozen` statuses. (since 4.0)
487 # @persistent: true if the bitmap was stored on disk, is scheduled to be stored
488 # on disk, or both. (since 4.0)
490 # @inconsistent: true if this is a persistent bitmap that was improperly
491 # stored. Implies @persistent to be true; @recording and
492 # @busy to be false. This bitmap cannot be used. To remove
493 # it, use @block-dirty-bitmap-remove. (Since 4.0)
497 { 'struct': 'BlockDirtyInfo',
498 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
499 'recording': 'bool', 'busy': 'bool', 'status': 'DirtyBitmapStatus',
500 'persistent': 'bool', '*inconsistent': 'bool' } }
503 # @Qcow2BitmapInfoFlags:
505 # An enumeration of flags that a bitmap can report to the user.
507 # @in-use: This flag is set by any process actively modifying the qcow2 file,
508 # and cleared when the updated bitmap is flushed to the qcow2 image.
509 # The presence of this flag in an offline image means that the bitmap
510 # was not saved correctly after its last usage, and may contain
513 # @auto: The bitmap must reflect all changes of the virtual disk by any
514 # application that would write to this qcow2 file.
518 { 'enum': 'Qcow2BitmapInfoFlags',
519 'data': ['in-use', 'auto'] }
524 # Qcow2 bitmap information.
526 # @name: the name of the bitmap
528 # @granularity: granularity of the bitmap in bytes
530 # @flags: flags of the bitmap
534 { 'struct': 'Qcow2BitmapInfo',
535 'data': {'name': 'str', 'granularity': 'uint32',
536 'flags': ['Qcow2BitmapInfoFlags'] } }
539 # @BlockLatencyHistogramInfo:
541 # Block latency histogram.
543 # @boundaries: list of interval boundary values in nanoseconds, all greater
544 # than zero and in ascending order.
545 # For example, the list [10, 50, 100] produces the following
546 # histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
548 # @bins: list of io request counts corresponding to histogram intervals.
549 # len(@bins) = len(@boundaries) + 1
550 # For the example above, @bins may be something like [3, 1, 5, 2],
551 # and corresponding histogram looks like:
558 # | +------------------
563 { 'struct': 'BlockLatencyHistogramInfo',
564 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
567 # @block-latency-histogram-set:
569 # Manage read, write and flush latency histograms for the device.
571 # If only @id parameter is specified, remove all present latency histograms
572 # for the device. Otherwise, add/reset some of (or all) latency histograms.
574 # @id: The name or QOM path of the guest device.
576 # @boundaries: list of interval boundary values (see description in
577 # BlockLatencyHistogramInfo definition). If specified, all
578 # latency histograms are removed, and empty ones created for all
579 # io types with intervals corresponding to @boundaries (except for
580 # io types, for which specific boundaries are set through the
581 # following parameters).
583 # @boundaries-read: list of interval boundary values for read latency
584 # histogram. If specified, old read latency histogram is
585 # removed, and empty one created with intervals
586 # corresponding to @boundaries-read. The parameter has higher
587 # priority then @boundaries.
589 # @boundaries-write: list of interval boundary values for write latency
592 # @boundaries-flush: list of interval boundary values for flush latency
595 # Returns: error if device is not found or any boundary arrays are invalid.
599 # Example: set new histograms for all io types with intervals
600 # [0, 10), [10, 50), [50, 100), [100, +inf):
602 # -> { "execute": "block-latency-histogram-set",
603 # "arguments": { "id": "drive0",
604 # "boundaries": [10, 50, 100] } }
605 # <- { "return": {} }
607 # Example: set new histogram only for write, other histograms will remain
608 # not changed (or not created):
610 # -> { "execute": "block-latency-histogram-set",
611 # "arguments": { "id": "drive0",
612 # "boundaries-write": [10, 50, 100] } }
613 # <- { "return": {} }
615 # Example: set new histograms with the following intervals:
616 # read, flush: [0, 10), [10, 50), [50, 100), [100, +inf)
617 # write: [0, 1000), [1000, 5000), [5000, +inf)
619 # -> { "execute": "block-latency-histogram-set",
620 # "arguments": { "id": "drive0",
621 # "boundaries": [10, 50, 100],
622 # "boundaries-write": [1000, 5000] } }
623 # <- { "return": {} }
625 # Example: remove all latency histograms:
627 # -> { "execute": "block-latency-histogram-set",
628 # "arguments": { "id": "drive0" } }
629 # <- { "return": {} }
631 { 'command': 'block-latency-histogram-set',
632 'data': {'id': 'str',
633 '*boundaries': ['uint64'],
634 '*boundaries-read': ['uint64'],
635 '*boundaries-write': ['uint64'],
636 '*boundaries-flush': ['uint64'] } }
641 # Block device information. This structure describes a virtual device and
642 # the backing device associated with it.
644 # @device: The device name associated with the virtual device.
646 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
647 # device. (since 2.10)
649 # @type: This field is returned only for compatibility reasons, it should
650 # not be used (always returns 'unknown')
652 # @removable: True if the device supports removable media.
654 # @locked: True if the guest has locked this device from having its media
657 # @tray_open: True if the device's tray is open
658 # (only present if it has a tray)
660 # @dirty-bitmaps: dirty bitmaps information (only present if the
661 # driver has one or more dirty bitmaps) (Since 2.0)
662 # Deprecated in 4.2; see BlockDeviceInfo instead.
664 # @io-status: @BlockDeviceIoStatus. Only present if the device
665 # supports it and the VM is configured to stop on errors
666 # (supported device models: virtio-blk, IDE, SCSI except
669 # @inserted: @BlockDeviceInfo describing the device if media is
674 { 'struct': 'BlockInfo',
675 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
676 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
677 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
678 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
683 # Image file size calculation information. This structure describes the size
684 # requirements for creating a new image file.
686 # The size requirements depend on the new image file format. File size always
687 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
688 # Compact formats such as 'qcow2' represent unallocated and zero regions
689 # efficiently so file size may be smaller than virtual disk size.
691 # The values are upper bounds that are guaranteed to fit the new image file.
692 # Subsequent modification, such as internal snapshot or bitmap creation, may
693 # require additional space and is not covered here.
695 # @required: Size required for a new image file, in bytes.
697 # @fully-allocated: Image file size, in bytes, once data has been written
702 { 'struct': 'BlockMeasureInfo',
703 'data': {'required': 'int', 'fully-allocated': 'int'} }
708 # Get a list of BlockInfo for all virtual block devices.
710 # Returns: a list of @BlockInfo describing each virtual block device. Filter
711 # nodes that were created implicitly are skipped over.
717 # -> { "execute": "query-block" }
722 # "device":"ide0-hd0",
729 # "file":"disks/test.qcow2",
730 # "backing_file_depth":1,
737 # "bps_max": 8000000,
744 # "detect_zeroes": "on",
745 # "write_threshold": 0,
747 # "filename":"disks/test.qcow2",
749 # "virtual-size":2048000,
750 # "backing_file":"base.qcow2",
751 # "full-backing-filename":"disks/base.qcow2",
752 # "backing-filename-format":"qcow2",
756 # "name": "snapshot1",
757 # "vm-state-size": 0,
758 # "date-sec": 10000200,
760 # "vm-clock-sec": 206,
761 # "vm-clock-nsec": 30
765 # "filename":"disks/base.qcow2",
767 # "virtual-size":2048000
771 # "qdev": "ide_disk",
776 # "device":"ide1-cd0",
779 # "qdev": "/machine/unattached/device[23]",
780 # "tray_open": false,
784 # "device":"floppy0",
787 # "qdev": "/machine/unattached/device[20]",
800 { 'command': 'query-block', 'returns': ['BlockInfo'] }
804 # @BlockDeviceTimedStats:
806 # Statistics of a block device during a given interval of time.
808 # @interval_length: Interval used for calculating the statistics,
811 # @min_rd_latency_ns: Minimum latency of read operations in the
812 # defined interval, in nanoseconds.
814 # @min_wr_latency_ns: Minimum latency of write operations in the
815 # defined interval, in nanoseconds.
817 # @min_flush_latency_ns: Minimum latency of flush operations in the
818 # defined interval, in nanoseconds.
820 # @max_rd_latency_ns: Maximum latency of read operations in the
821 # defined interval, in nanoseconds.
823 # @max_wr_latency_ns: Maximum latency of write operations in the
824 # defined interval, in nanoseconds.
826 # @max_flush_latency_ns: Maximum latency of flush operations in the
827 # defined interval, in nanoseconds.
829 # @avg_rd_latency_ns: Average latency of read operations in the
830 # defined interval, in nanoseconds.
832 # @avg_wr_latency_ns: Average latency of write operations in the
833 # defined interval, in nanoseconds.
835 # @avg_flush_latency_ns: Average latency of flush operations in the
836 # defined interval, in nanoseconds.
838 # @avg_rd_queue_depth: Average number of pending read operations
839 # in the defined interval.
841 # @avg_wr_queue_depth: Average number of pending write operations
842 # in the defined interval.
846 { 'struct': 'BlockDeviceTimedStats',
847 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
848 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
849 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
850 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
851 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
852 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
857 # Statistics of a virtual block device or a block backing device.
859 # @rd_bytes: The number of bytes read by the device.
861 # @wr_bytes: The number of bytes written by the device.
863 # @unmap_bytes: The number of bytes unmapped by the device (Since 4.2)
865 # @rd_operations: The number of read operations performed by the device.
867 # @wr_operations: The number of write operations performed by the device.
869 # @flush_operations: The number of cache flush operations performed by the
870 # device (since 0.15.0)
872 # @unmap_operations: The number of unmap operations performed by the device
875 # @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15.0).
877 # @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15.0).
879 # @flush_total_time_ns: Total time spent on cache flushes in nanoseconds
882 # @unmap_total_time_ns: Total time spent on unmap operations in nanoseconds
885 # @wr_highest_offset: The offset after the greatest byte written to the
886 # device. The intended use of this information is for
887 # growable sparse files (like qcow2) that are used on top
888 # of a physical device.
890 # @rd_merged: Number of read requests that have been merged into another
891 # request (Since 2.3).
893 # @wr_merged: Number of write requests that have been merged into another
894 # request (Since 2.3).
896 # @unmap_merged: Number of unmap requests that have been merged into another
897 # request (Since 4.2)
899 # @idle_time_ns: Time since the last I/O operation, in
900 # nanoseconds. If the field is absent it means that
901 # there haven't been any operations yet (Since 2.5).
903 # @failed_rd_operations: The number of failed read operations
904 # performed by the device (Since 2.5)
906 # @failed_wr_operations: The number of failed write operations
907 # performed by the device (Since 2.5)
909 # @failed_flush_operations: The number of failed flush operations
910 # performed by the device (Since 2.5)
912 # @failed_unmap_operations: The number of failed unmap operations performed
913 # by the device (Since 4.2)
915 # @invalid_rd_operations: The number of invalid read operations
916 # performed by the device (Since 2.5)
918 # @invalid_wr_operations: The number of invalid write operations
919 # performed by the device (Since 2.5)
921 # @invalid_flush_operations: The number of invalid flush operations
922 # performed by the device (Since 2.5)
924 # @invalid_unmap_operations: The number of invalid unmap operations performed
925 # by the device (Since 4.2)
927 # @account_invalid: Whether invalid operations are included in the
928 # last access statistics (Since 2.5)
930 # @account_failed: Whether failed operations are included in the
931 # latency and last access statistics (Since 2.5)
933 # @timed_stats: Statistics specific to the set of previously defined
934 # intervals of time (Since 2.5)
936 # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
938 # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
940 # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
944 { 'struct': 'BlockDeviceStats',
945 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int',
946 'rd_operations': 'int', 'wr_operations': 'int',
947 'flush_operations': 'int', 'unmap_operations': 'int',
948 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int',
949 'flush_total_time_ns': 'int', 'unmap_total_time_ns': 'int',
950 'wr_highest_offset': 'int',
951 'rd_merged': 'int', 'wr_merged': 'int', 'unmap_merged': 'int',
952 '*idle_time_ns': 'int',
953 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
954 'failed_flush_operations': 'int', 'failed_unmap_operations': 'int',
955 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int',
956 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int',
957 'account_invalid': 'bool', 'account_failed': 'bool',
958 'timed_stats': ['BlockDeviceTimedStats'],
959 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
960 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
961 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
964 # @BlockStatsSpecificFile:
966 # File driver statistics
968 # @discard-nb-ok: The number of successful discard operations performed by
971 # @discard-nb-failed: The number of failed discard operations performed by
974 # @discard-bytes-ok: The number of bytes discarded by the driver.
978 { 'struct': 'BlockStatsSpecificFile',
980 'discard-nb-ok': 'uint64',
981 'discard-nb-failed': 'uint64',
982 'discard-bytes-ok': 'uint64' } }
985 # @BlockStatsSpecific:
987 # Block driver specific statistics
991 { 'union': 'BlockStatsSpecific',
992 'base': { 'driver': 'BlockdevDriver' },
993 'discriminator': 'driver',
995 'file': 'BlockStatsSpecificFile',
996 'host_device': 'BlockStatsSpecificFile' } }
1001 # Statistics of a virtual block device or a block backing device.
1003 # @device: If the stats are for a virtual block device, the name
1004 # corresponding to the virtual block device.
1006 # @node-name: The node name of the device. (Since 2.3)
1008 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
1009 # device. (since 3.0)
1011 # @stats: A @BlockDeviceStats for the device.
1013 # @driver-specific: Optional driver-specific stats. (Since 4.2)
1015 # @parent: This describes the file block device if it has one.
1016 # Contains recursively the statistics of the underlying
1017 # protocol (e.g. the host file for a qcow2 image). If there is
1018 # no underlying protocol, this field is omitted
1020 # @backing: This describes the backing block device if it has one.
1025 { 'struct': 'BlockStats',
1026 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
1027 'stats': 'BlockDeviceStats',
1028 '*driver-specific': 'BlockStatsSpecific',
1029 '*parent': 'BlockStats',
1030 '*backing': 'BlockStats'} }
1033 # @query-blockstats:
1035 # Query the @BlockStats for all virtual block devices.
1037 # @query-nodes: If true, the command will query all the block nodes
1038 # that have a node name, in a list which will include "parent"
1039 # information, but not "backing".
1040 # If false or omitted, the behavior is as before - query all the
1041 # device backends, recursively including their "parent" and
1042 # "backing". Filter nodes that were created implicitly are
1043 # skipped over in this mode. (Since 2.3)
1045 # Returns: A list of @BlockStats for each virtual block devices.
1051 # -> { "execute": "query-blockstats" }
1055 # "device":"ide0-hd0",
1058 # "wr_highest_offset":3686448128,
1059 # "wr_bytes":9786368,
1060 # "wr_operations":751,
1061 # "rd_bytes":122567168,
1062 # "rd_operations":36772
1063 # "wr_total_times_ns":313253456
1064 # "rd_total_times_ns":3465673657
1065 # "flush_total_times_ns":49653
1066 # "flush_operations":61,
1069 # "idle_time_ns":2953431879,
1070 # "account_invalid":true,
1071 # "account_failed":false
1075 # "wr_highest_offset":2821110784,
1076 # "wr_bytes":9786368,
1077 # "wr_operations":692,
1078 # "rd_bytes":122739200,
1079 # "rd_operations":36604
1080 # "flush_operations":51,
1081 # "wr_total_times_ns":313253456
1082 # "rd_total_times_ns":3465673657
1083 # "flush_total_times_ns":49653,
1086 # "idle_time_ns":2953431879,
1087 # "account_invalid":true,
1088 # "account_failed":false
1090 # "qdev": "/machine/unattached/device[23]"
1093 # "device":"ide1-cd0",
1095 # "wr_highest_offset":0,
1097 # "wr_operations":0,
1100 # "flush_operations":0,
1101 # "wr_total_times_ns":0
1102 # "rd_total_times_ns":0
1103 # "flush_total_times_ns":0,
1106 # "account_invalid":false,
1107 # "account_failed":false
1109 # "qdev": "/machine/unattached/device[24]"
1112 # "device":"floppy0",
1114 # "wr_highest_offset":0,
1116 # "wr_operations":0,
1119 # "flush_operations":0,
1120 # "wr_total_times_ns":0
1121 # "rd_total_times_ns":0
1122 # "flush_total_times_ns":0,
1125 # "account_invalid":false,
1126 # "account_failed":false
1128 # "qdev": "/machine/unattached/device[16]"
1133 # "wr_highest_offset":0,
1135 # "wr_operations":0,
1138 # "flush_operations":0,
1139 # "wr_total_times_ns":0
1140 # "rd_total_times_ns":0
1141 # "flush_total_times_ns":0,
1144 # "account_invalid":false,
1145 # "account_failed":false
1152 { 'command': 'query-blockstats',
1153 'data': { '*query-nodes': 'bool' },
1154 'returns': ['BlockStats'] }
1159 # An enumeration of possible behaviors for errors on I/O operations.
1160 # The exact meaning depends on whether the I/O was initiated by a guest
1163 # @report: for guest operations, report the error to the guest;
1164 # for jobs, cancel the job
1166 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1167 # or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs retry
1168 # the failing request later and may still complete successfully. The
1169 # stream block job continues to stream and will complete with an
1172 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1174 # @stop: for guest operations, stop the virtual machine;
1175 # for jobs, pause the job
1177 # @auto: inherit the error handling policy of the backend (since: 2.7)
1181 { 'enum': 'BlockdevOnError',
1182 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1187 # An enumeration of possible behaviors for the initial synchronization
1188 # phase of storage mirroring.
1190 # @top: copies data in the topmost image to the destination
1192 # @full: copies data from all images to the destination
1194 # @none: only copy data written from now on
1196 # @incremental: only copy data described by the dirty bitmap. (since: 2.4)
1198 # @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
1199 # Behavior on completion is determined by the BitmapSyncMode.
1203 { 'enum': 'MirrorSyncMode',
1204 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1209 # An enumeration of possible behaviors for the synchronization of a bitmap
1210 # when used for data copy operations.
1212 # @on-success: The bitmap is only synced when the operation is successful.
1213 # This is the behavior always used for 'INCREMENTAL' backups.
1215 # @never: The bitmap is never synchronized with the operation, and is
1216 # treated solely as a read-only manifest of blocks to copy.
1218 # @always: The bitmap is always synchronized with the operation,
1219 # regardless of whether or not the operation was successful.
1223 { 'enum': 'BitmapSyncMode',
1224 'data': ['on-success', 'never', 'always'] }
1229 # An enumeration whose values tell the mirror block job when to
1230 # trigger writes to the target.
1232 # @background: copy data in background only.
1234 # @write-blocking: when data is written to the source, write it
1235 # (synchronously) to the target as well. In
1236 # addition, data is copied in background just like in
1241 { 'enum': 'MirrorCopyMode',
1242 'data': ['background', 'write-blocking'] }
1247 # Information about a long-running block device operation.
1249 # @type: the job type ('stream' for image streaming)
1251 # @device: The job identifier. Originally the device name but other
1252 # values are allowed since QEMU 2.7
1254 # @len: Estimated @offset value at the completion of the job. This value can
1255 # arbitrarily change while the job is running, in both directions.
1257 # @offset: Progress made until now. The unit is arbitrary and the value can
1258 # only meaningfully be used for the ratio of @offset to @len. The
1259 # value is monotonically increasing.
1261 # @busy: false if the job is known to be in a quiescent state, with
1262 # no pending I/O. Since 1.3.
1264 # @paused: whether the job is paused or, if @busy is true, will
1265 # pause itself as soon as possible. Since 1.3.
1267 # @speed: the rate limit, bytes per second
1269 # @io-status: the status of the job (since 1.3)
1271 # @ready: true if the job may be completed (since 2.2)
1273 # @status: Current job state/status (since 2.12)
1275 # @auto-finalize: Job will finalize itself when PENDING, moving to
1276 # the CONCLUDED state. (since 2.12)
1278 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1279 # state and disappearing from the query list. (since 2.12)
1281 # @error: Error information if the job did not complete successfully.
1282 # Not set if the job completed successfully. (since 2.12.1)
1286 { 'struct': 'BlockJobInfo',
1287 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1288 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1289 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1290 'status': 'JobStatus',
1291 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1295 # @query-block-jobs:
1297 # Return information about long-running block device operations.
1299 # Returns: a list of @BlockJobInfo for each active block job
1303 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1308 # This command sets the password of a block device that has not been open
1309 # with a password and requires one.
1311 # This command is now obsolete and will always return an error since 2.10
1314 { 'command': 'block_passwd',
1315 'data': { '*device': 'str',
1316 '*node-name': 'str',
1317 'password': 'str' } }
1322 # Resize a block image while a guest is running.
1324 # Either @device or @node-name must be set but not both.
1326 # @device: the name of the device to get the image resized
1328 # @node-name: graph node name to get the image resized (Since 2.0)
1330 # @size: new image size in bytes
1332 # Returns: - nothing on success
1333 # - If @device is not a valid block device, DeviceNotFound
1339 # -> { "execute": "block_resize",
1340 # "arguments": { "device": "scratch", "size": 1073741824 } }
1341 # <- { "return": {} }
1344 { 'command': 'block_resize',
1345 'data': { '*device': 'str',
1346 '*node-name': 'str',
1352 # An enumeration that tells QEMU how to set the backing file path in
1355 # @existing: QEMU should look for an existing image file.
1357 # @absolute-paths: QEMU should create a new image with absolute paths
1358 # for the backing file. If there is no backing file available, the new
1359 # image will not be backed either.
1363 { 'enum': 'NewImageMode',
1364 'data': [ 'existing', 'absolute-paths' ] }
1367 # @BlockdevSnapshotSync:
1369 # Either @device or @node-name must be set but not both.
1371 # @device: the name of the device to take a snapshot of.
1373 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1375 # @snapshot-file: the target of the new overlay image. If the file
1376 # exists, or if it is a device, the overlay will be created in the
1377 # existing file/device. Otherwise, a new file will be created.
1379 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1381 # @format: the format of the overlay image, default is 'qcow2'.
1383 # @mode: whether and how QEMU should create a new image, default is
1386 { 'struct': 'BlockdevSnapshotSync',
1387 'data': { '*device': 'str', '*node-name': 'str',
1388 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1389 '*format': 'str', '*mode': 'NewImageMode' } }
1392 # @BlockdevSnapshot:
1394 # @node: device or node name that will have a snapshot taken.
1396 # @overlay: reference to the existing block device that will become
1397 # the overlay of @node, as part of taking the snapshot.
1398 # It must not have a current backing file (this can be
1399 # achieved by passing "backing": null to blockdev-add).
1403 { 'struct': 'BlockdevSnapshot',
1404 'data': { 'node': 'str', 'overlay': 'str' } }
1409 # @job-id: identifier for the newly-created block job. If
1410 # omitted, the device name will be used. (Since 2.7)
1412 # @device: the device name or node-name of a root node which should be copied.
1414 # @sync: what parts of the disk image should be copied to the destination
1415 # (all the disk, only the sectors allocated in the topmost image, from a
1416 # dirty bitmap, or only new I/O).
1418 # @speed: the maximum speed, in bytes per second. The default is 0,
1421 # @bitmap: The name of a dirty bitmap to use.
1422 # Must be present if sync is "bitmap" or "incremental".
1423 # Can be present if sync is "full" or "top".
1424 # Must not be present otherwise.
1425 # (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1427 # @bitmap-mode: Specifies the type of data the bitmap should contain after
1428 # the operation concludes.
1429 # Must be present if a bitmap was provided,
1430 # Must NOT be present otherwise. (Since 4.2)
1432 # @compress: true to compress data, if the target format supports it.
1433 # (default: false) (since 2.8)
1435 # @on-source-error: the action to take on an error on the source,
1436 # default 'report'. 'stop' and 'enospc' can only be used
1437 # if the block device supports io-status (see BlockInfo).
1439 # @on-target-error: the action to take on an error on the target,
1440 # default 'report' (no limitations, since this applies to
1441 # a different block device than @device).
1443 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1444 # finished its work, waiting for @block-job-finalize before
1445 # making any block graph changes.
1446 # When true, this job will automatically
1447 # perform its abort or commit actions.
1448 # Defaults to true. (Since 2.12)
1450 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1451 # has completely ceased all work, and awaits @block-job-dismiss.
1452 # When true, this job will automatically disappear from the query
1453 # list without user intervention.
1454 # Defaults to true. (Since 2.12)
1456 # @filter-node-name: the node name that should be assigned to the
1457 # filter driver that the backup job inserts into the graph
1458 # above node specified by @drive. If this option is not given,
1459 # a node name is autogenerated. (Since: 4.2)
1461 # Note: @on-source-error and @on-target-error only affect background
1462 # I/O. If an error occurs during a guest write request, the device's
1463 # rerror/werror actions will be used.
1467 { 'struct': 'BackupCommon',
1468 'data': { '*job-id': 'str', 'device': 'str',
1469 'sync': 'MirrorSyncMode', '*speed': 'int',
1470 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1471 '*compress': 'bool',
1472 '*on-source-error': 'BlockdevOnError',
1473 '*on-target-error': 'BlockdevOnError',
1474 '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
1475 '*filter-node-name': 'str' } }
1480 # @target: the target of the new image. If the file exists, or if it
1481 # is a device, the existing file/device will be used as the new
1482 # destination. If it does not exist, a new file will be created.
1484 # @format: the format of the new destination, default is to
1485 # probe if @mode is 'existing', else the format of the source
1487 # @mode: whether and how QEMU should create a new image, default is
1492 { 'struct': 'DriveBackup',
1493 'base': 'BackupCommon',
1494 'data': { 'target': 'str',
1496 '*mode': 'NewImageMode' } }
1501 # @target: the device name or node-name of the backup target node.
1505 { 'struct': 'BlockdevBackup',
1506 'base': 'BackupCommon',
1507 'data': { 'target': 'str' } }
1510 # @blockdev-snapshot-sync:
1512 # Takes a synchronous snapshot of a block device.
1514 # For the arguments, see the documentation of BlockdevSnapshotSync.
1516 # Returns: - nothing on success
1517 # - If @device is not a valid block device, DeviceNotFound
1523 # -> { "execute": "blockdev-snapshot-sync",
1524 # "arguments": { "device": "ide-hd0",
1526 # "/some/place/my-image",
1527 # "format": "qcow2" } }
1528 # <- { "return": {} }
1531 { 'command': 'blockdev-snapshot-sync',
1532 'data': 'BlockdevSnapshotSync' }
1536 # @blockdev-snapshot:
1538 # Takes a snapshot of a block device.
1540 # Take a snapshot, by installing 'node' as the backing image of
1541 # 'overlay'. Additionally, if 'node' is associated with a block
1542 # device, the block device changes to using 'overlay' as its new active
1545 # For the arguments, see the documentation of BlockdevSnapshot.
1551 # -> { "execute": "blockdev-add",
1552 # "arguments": { "driver": "qcow2",
1553 # "node-name": "node1534",
1554 # "file": { "driver": "file",
1555 # "filename": "hd1.qcow2" },
1556 # "backing": null } }
1558 # <- { "return": {} }
1560 # -> { "execute": "blockdev-snapshot",
1561 # "arguments": { "node": "ide-hd0",
1562 # "overlay": "node1534" } }
1563 # <- { "return": {} }
1566 { 'command': 'blockdev-snapshot',
1567 'data': 'BlockdevSnapshot' }
1570 # @change-backing-file:
1572 # Change the backing file in the image file metadata. This does not
1573 # cause QEMU to reopen the image file to reparse the backing filename
1574 # (it may, however, perform a reopen to change permissions from
1575 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1576 # into the image file metadata, and the QEMU internal strings are
1579 # @image-node-name: The name of the block driver state node of the
1580 # image to modify. The "device" argument is used
1581 # to verify "image-node-name" is in the chain
1582 # described by "device".
1584 # @device: The device name or node-name of the root node that owns
1587 # @backing-file: The string to write as the backing file. This
1588 # string is not validated, so care should be taken
1589 # when specifying the string or the image chain may
1590 # not be able to be reopened again.
1592 # Returns: - Nothing on success
1593 # - If "device" does not exist or cannot be determined, DeviceNotFound
1597 { 'command': 'change-backing-file',
1598 'data': { 'device': 'str', 'image-node-name': 'str',
1599 'backing-file': 'str' } }
1604 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1605 # writes data between 'top' and 'base' into 'base'.
1607 # @job-id: identifier for the newly-created block job. If
1608 # omitted, the device name will be used. (Since 2.7)
1610 # @device: the device name or node-name of a root node
1612 # @base-node: The node name of the backing image to write data into.
1613 # If not specified, this is the deepest backing image.
1616 # @base: Same as @base-node, except that it is a file name rather than a node
1617 # name. This must be the exact filename string that was used to open the
1618 # node; other strings, even if addressing the same file, are not
1619 # accepted (deprecated, use @base-node instead)
1621 # @top-node: The node name of the backing image within the image chain
1622 # which contains the topmost data to be committed down. If
1623 # not specified, this is the active layer. (since: 3.1)
1625 # @top: Same as @top-node, except that it is a file name rather than a node
1626 # name. This must be the exact filename string that was used to open the
1627 # node; other strings, even if addressing the same file, are not
1628 # accepted (deprecated, use @base-node instead)
1630 # @backing-file: The backing file string to write into the overlay
1631 # image of 'top'. If 'top' is the active layer,
1632 # specifying a backing file string is an error. This
1633 # filename is not validated.
1635 # If a pathname string is such that it cannot be
1636 # resolved by QEMU, that means that subsequent QMP or
1637 # HMP commands must use node-names for the image in
1638 # question, as filename lookup methods will fail.
1640 # If not specified, QEMU will automatically determine
1641 # the backing file string to use, or error out if
1642 # there is no obvious choice. Care should be taken
1643 # when specifying the string, to specify a valid
1644 # filename or protocol.
1647 # If top == base, that is an error.
1648 # If top == active, the job will not be completed by itself,
1649 # user needs to complete the job with the block-job-complete
1650 # command after getting the ready event. (Since 2.0)
1652 # If the base image is smaller than top, then the base image
1653 # will be resized to be the same size as top. If top is
1654 # smaller than the base image, the base will not be
1655 # truncated. If you want the base image size to match the
1656 # size of the smaller top, you can safely truncate it
1657 # yourself once the commit operation successfully completes.
1659 # @speed: the maximum speed, in bytes per second
1661 # @on-error: the action to take on an error. 'ignore' means that the request
1662 # should be retried. (default: report; Since: 5.0)
1664 # @filter-node-name: the node name that should be assigned to the
1665 # filter driver that the commit job inserts into the graph
1666 # above @top. If this option is not given, a node name is
1667 # autogenerated. (Since: 2.9)
1669 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1670 # finished its work, waiting for @block-job-finalize before
1671 # making any block graph changes.
1672 # When true, this job will automatically
1673 # perform its abort or commit actions.
1674 # Defaults to true. (Since 3.1)
1676 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1677 # has completely ceased all work, and awaits @block-job-dismiss.
1678 # When true, this job will automatically disappear from the query
1679 # list without user intervention.
1680 # Defaults to true. (Since 3.1)
1682 # Returns: - Nothing on success
1683 # - If @device does not exist, DeviceNotFound
1684 # - Any other error returns a GenericError.
1690 # -> { "execute": "block-commit",
1691 # "arguments": { "device": "virtio0",
1692 # "top": "/tmp/snap1.qcow2" } }
1693 # <- { "return": {} }
1696 { 'command': 'block-commit',
1697 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1698 '*base': 'str', '*top-node': 'str', '*top': 'str',
1699 '*backing-file': 'str', '*speed': 'int',
1700 '*on-error': 'BlockdevOnError',
1701 '*filter-node-name': 'str',
1702 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1707 # Start a point-in-time copy of a block device to a new destination. The
1708 # status of ongoing drive-backup operations can be checked with
1709 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1710 # The operation can be stopped before it has completed using the
1711 # block-job-cancel command.
1713 # Returns: - nothing on success
1714 # - If @device is not a valid block device, GenericError
1720 # -> { "execute": "drive-backup",
1721 # "arguments": { "device": "drive0",
1723 # "target": "backup.img" } }
1724 # <- { "return": {} }
1727 { 'command': 'drive-backup', 'boxed': true,
1728 'data': 'DriveBackup' }
1733 # Start a point-in-time copy of a block device to a new destination. The
1734 # status of ongoing blockdev-backup operations can be checked with
1735 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1736 # The operation can be stopped before it has completed using the
1737 # block-job-cancel command.
1739 # Returns: - nothing on success
1740 # - If @device is not a valid block device, DeviceNotFound
1745 # -> { "execute": "blockdev-backup",
1746 # "arguments": { "device": "src-id",
1748 # "target": "tgt-id" } }
1749 # <- { "return": {} }
1752 { 'command': 'blockdev-backup', 'boxed': true,
1753 'data': 'BlockdevBackup' }
1757 # @query-named-block-nodes:
1759 # Get the named block driver list
1761 # Returns: the list of BlockDeviceInfo
1767 # -> { "execute": "query-named-block-nodes" }
1768 # <- { "return": [ { "ro":false,
1770 # "encrypted":false,
1771 # "file":"disks/test.qcow2",
1772 # "node-name": "my-node",
1773 # "backing_file_depth":1,
1780 # "bps_max": 8000000,
1787 # "write_threshold": 0,
1789 # "filename":"disks/test.qcow2",
1791 # "virtual-size":2048000,
1792 # "backing_file":"base.qcow2",
1793 # "full-backing-filename":"disks/base.qcow2",
1794 # "backing-filename-format":"qcow2",
1798 # "name": "snapshot1",
1799 # "vm-state-size": 0,
1800 # "date-sec": 10000200,
1802 # "vm-clock-sec": 206,
1803 # "vm-clock-nsec": 30
1807 # "filename":"disks/base.qcow2",
1809 # "virtual-size":2048000
1814 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1817 # @XDbgBlockGraphNodeType:
1819 # @block-backend: corresponds to BlockBackend
1821 # @block-job: corresonds to BlockJob
1823 # @block-driver: corresponds to BlockDriverState
1827 { 'enum': 'XDbgBlockGraphNodeType',
1828 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1831 # @XDbgBlockGraphNode:
1833 # @id: Block graph node identifier. This @id is generated only for
1834 # x-debug-query-block-graph and does not relate to any other identifiers in
1837 # @type: Type of graph node. Can be one of block-backend, block-job or
1838 # block-driver-state.
1840 # @name: Human readable name of the node. Corresponds to node-name for
1841 # block-driver-state nodes; is not guaranteed to be unique in the whole
1842 # graph (with block-jobs and block-backends).
1846 { 'struct': 'XDbgBlockGraphNode',
1847 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1852 # Enum of base block permissions.
1854 # @consistent-read: A user that has the "permission" of consistent reads is
1855 # guaranteed that their view of the contents of the block
1856 # device is complete and self-consistent, representing the
1857 # contents of a disk at a specific point.
1858 # For most block devices (including their backing files) this
1859 # is true, but the property cannot be maintained in a few
1860 # situations like for intermediate nodes of a commit block
1863 # @write: This permission is required to change the visible disk contents.
1865 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1866 # both enough and required for writes to the block node when
1867 # the caller promises that the visible disk content doesn't
1869 # As the BLK_PERM_WRITE permission is strictly stronger,
1870 # either is sufficient to perform an unchanging write.
1872 # @resize: This permission is required to change the size of a block node.
1874 # @graph-mod: This permission is required to change the node that this
1875 # BdrvChild points to.
1879 { 'enum': 'BlockPermission',
1880 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
1883 # @XDbgBlockGraphEdge:
1885 # Block Graph edge description for x-debug-query-block-graph.
1887 # @parent: parent id
1891 # @name: name of the relation (examples are 'file' and 'backing')
1893 # @perm: granted permissions for the parent operating on the child
1895 # @shared-perm: permissions that can still be granted to other users of the
1896 # child while it is still attached to this parent
1900 { 'struct': 'XDbgBlockGraphEdge',
1901 'data': { 'parent': 'uint64', 'child': 'uint64',
1902 'name': 'str', 'perm': [ 'BlockPermission' ],
1903 'shared-perm': [ 'BlockPermission' ] } }
1908 # Block Graph - list of nodes and list of edges.
1912 { 'struct': 'XDbgBlockGraph',
1913 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1916 # @x-debug-query-block-graph:
1918 # Get the block graph.
1922 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph' }
1927 # Start mirroring a block device's writes to a new destination. target
1928 # specifies the target of the new image. If the file exists, or if it
1929 # is a device, it will be used as the new destination for writes. If
1930 # it does not exist, a new file will be created. format specifies the
1931 # format of the mirror image, default is to probe if mode='existing',
1932 # else the format of the source.
1934 # Returns: - nothing on success
1935 # - If @device is not a valid block device, GenericError
1941 # -> { "execute": "drive-mirror",
1942 # "arguments": { "device": "ide-hd0",
1943 # "target": "/some/place/my-image",
1945 # "format": "qcow2" } }
1946 # <- { "return": {} }
1949 { 'command': 'drive-mirror', 'boxed': true,
1950 'data': 'DriveMirror' }
1955 # A set of parameters describing drive mirror setup.
1957 # @job-id: identifier for the newly-created block job. If
1958 # omitted, the device name will be used. (Since 2.7)
1960 # @device: the device name or node-name of a root node whose writes should be
1963 # @target: the target of the new image. If the file exists, or if it
1964 # is a device, the existing file/device will be used as the new
1965 # destination. If it does not exist, a new file will be created.
1967 # @format: the format of the new destination, default is to
1968 # probe if @mode is 'existing', else the format of the source
1970 # @node-name: the new block driver state node name in the graph
1973 # @replaces: with sync=full graph node name to be replaced by the new
1974 # image when a whole image copy is done. This can be used to repair
1975 # broken Quorum files. (Since 2.1)
1977 # @mode: whether and how QEMU should create a new image, default is
1980 # @speed: the maximum speed, in bytes per second
1982 # @sync: what parts of the disk image should be copied to the destination
1983 # (all the disk, only the sectors allocated in the topmost image, or
1986 # @granularity: granularity of the dirty bitmap, default is 64K
1987 # if the image format doesn't have clusters, 4K if the clusters
1988 # are smaller than that, else the cluster size. Must be a
1989 # power of 2 between 512 and 64M (since 1.4).
1991 # @buf-size: maximum amount of data in flight from source to
1992 # target (since 1.4).
1994 # @on-source-error: the action to take on an error on the source,
1995 # default 'report'. 'stop' and 'enospc' can only be used
1996 # if the block device supports io-status (see BlockInfo).
1998 # @on-target-error: the action to take on an error on the target,
1999 # default 'report' (no limitations, since this applies to
2000 # a different block device than @device).
2001 # @unmap: Whether to try to unmap target sectors where source has
2002 # only zero. If true, and target unallocated sectors will read as zero,
2003 # target image sectors will be unmapped; otherwise, zeroes will be
2004 # written. Both will result in identical contents.
2005 # Default is true. (Since 2.4)
2007 # @copy-mode: when to copy data to the destination; defaults to 'background'
2010 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2011 # finished its work, waiting for @block-job-finalize before
2012 # making any block graph changes.
2013 # When true, this job will automatically
2014 # perform its abort or commit actions.
2015 # Defaults to true. (Since 3.1)
2017 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2018 # has completely ceased all work, and awaits @block-job-dismiss.
2019 # When true, this job will automatically disappear from the query
2020 # list without user intervention.
2021 # Defaults to true. (Since 3.1)
2024 { 'struct': 'DriveMirror',
2025 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2026 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
2027 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2028 '*speed': 'int', '*granularity': 'uint32',
2029 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2030 '*on-target-error': 'BlockdevOnError',
2031 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
2032 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2035 # @BlockDirtyBitmap:
2037 # @node: name of device/node which the bitmap is tracking
2039 # @name: name of the dirty bitmap
2043 { 'struct': 'BlockDirtyBitmap',
2044 'data': { 'node': 'str', 'name': 'str' } }
2047 # @BlockDirtyBitmapAdd:
2049 # @node: name of device/node which the bitmap is tracking
2051 # @name: name of the dirty bitmap (must be less than 1024 bytes)
2053 # @granularity: the bitmap granularity, default is 64k for
2054 # block-dirty-bitmap-add
2056 # @persistent: the bitmap is persistent, i.e. it will be saved to the
2057 # corresponding block device image file on its close. For now only
2058 # Qcow2 disks support persistent bitmaps. Default is false for
2059 # block-dirty-bitmap-add. (Since: 2.10)
2061 # @disabled: the bitmap is created in the disabled state, which means that
2062 # it will not track drive changes. The bitmap may be enabled with
2063 # block-dirty-bitmap-enable. Default is false. (Since: 4.0)
2067 { 'struct': 'BlockDirtyBitmapAdd',
2068 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
2069 '*persistent': 'bool', '*disabled': 'bool' } }
2072 # @BlockDirtyBitmapMergeSource:
2074 # @local: name of the bitmap, attached to the same node as target bitmap.
2076 # @external: bitmap with specified node
2080 { 'alternate': 'BlockDirtyBitmapMergeSource',
2081 'data': { 'local': 'str',
2082 'external': 'BlockDirtyBitmap' } }
2085 # @BlockDirtyBitmapMerge:
2087 # @node: name of device/node which the @target bitmap is tracking
2089 # @target: name of the destination dirty bitmap
2091 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully
2092 # specifed BlockDirtyBitmap elements. The latter are supported
2097 { 'struct': 'BlockDirtyBitmapMerge',
2098 'data': { 'node': 'str', 'target': 'str',
2099 'bitmaps': ['BlockDirtyBitmapMergeSource'] } }
2102 # @block-dirty-bitmap-add:
2104 # Create a dirty bitmap with a name on the node, and start tracking the writes.
2106 # Returns: - nothing on success
2107 # - If @node is not a valid block device or node, DeviceNotFound
2108 # - If @name is already taken, GenericError with an explanation
2114 # -> { "execute": "block-dirty-bitmap-add",
2115 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2116 # <- { "return": {} }
2119 { 'command': 'block-dirty-bitmap-add',
2120 'data': 'BlockDirtyBitmapAdd' }
2123 # @block-dirty-bitmap-remove:
2125 # Stop write tracking and remove the dirty bitmap that was created
2126 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2129 # Returns: - nothing on success
2130 # - If @node is not a valid block device or node, DeviceNotFound
2131 # - If @name is not found, GenericError with an explanation
2132 # - if @name is frozen by an operation, GenericError
2138 # -> { "execute": "block-dirty-bitmap-remove",
2139 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2140 # <- { "return": {} }
2143 { 'command': 'block-dirty-bitmap-remove',
2144 'data': 'BlockDirtyBitmap' }
2147 # @block-dirty-bitmap-clear:
2149 # Clear (reset) a dirty bitmap on the device, so that an incremental
2150 # backup from this point in time forward will only backup clusters
2151 # modified after this clear operation.
2153 # Returns: - nothing on success
2154 # - If @node is not a valid block device, DeviceNotFound
2155 # - If @name is not found, GenericError with an explanation
2161 # -> { "execute": "block-dirty-bitmap-clear",
2162 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2163 # <- { "return": {} }
2166 { 'command': 'block-dirty-bitmap-clear',
2167 'data': 'BlockDirtyBitmap' }
2170 # @block-dirty-bitmap-enable:
2172 # Enables a dirty bitmap so that it will begin tracking disk changes.
2174 # Returns: - nothing on success
2175 # - If @node is not a valid block device, DeviceNotFound
2176 # - If @name is not found, GenericError with an explanation
2182 # -> { "execute": "block-dirty-bitmap-enable",
2183 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2184 # <- { "return": {} }
2187 { 'command': 'block-dirty-bitmap-enable',
2188 'data': 'BlockDirtyBitmap' }
2191 # @block-dirty-bitmap-disable:
2193 # Disables a dirty bitmap so that it will stop tracking disk changes.
2195 # Returns: - nothing on success
2196 # - If @node is not a valid block device, DeviceNotFound
2197 # - If @name is not found, GenericError with an explanation
2203 # -> { "execute": "block-dirty-bitmap-disable",
2204 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2205 # <- { "return": {} }
2208 { 'command': 'block-dirty-bitmap-disable',
2209 'data': 'BlockDirtyBitmap' }
2212 # @block-dirty-bitmap-merge:
2214 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2215 # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2216 # as the @target bitmap. Any bits already set in @target will still be
2217 # set after the merge, i.e., this operation does not clear the target.
2218 # On error, @target is unchanged.
2220 # The resulting bitmap will count as dirty any clusters that were dirty in any
2221 # of the source bitmaps. This can be used to achieve backup checkpoints, or in
2222 # simpler usages, to copy bitmaps.
2224 # Returns: - nothing on success
2225 # - If @node is not a valid block device, DeviceNotFound
2226 # - If any bitmap in @bitmaps or @target is not found, GenericError
2227 # - If any of the bitmaps have different sizes or granularities,
2234 # -> { "execute": "block-dirty-bitmap-merge",
2235 # "arguments": { "node": "drive0", "target": "bitmap0",
2236 # "bitmaps": ["bitmap1"] } }
2237 # <- { "return": {} }
2240 { 'command': 'block-dirty-bitmap-merge',
2241 'data': 'BlockDirtyBitmapMerge' }
2244 # @BlockDirtyBitmapSha256:
2246 # SHA256 hash of dirty bitmap data
2248 # @sha256: ASCII representation of SHA256 bitmap hash
2252 { 'struct': 'BlockDirtyBitmapSha256',
2253 'data': {'sha256': 'str'} }
2256 # @x-debug-block-dirty-bitmap-sha256:
2258 # Get bitmap SHA256.
2260 # Returns: - BlockDirtyBitmapSha256 on success
2261 # - If @node is not a valid block device, DeviceNotFound
2262 # - If @name is not found or if hashing has failed, GenericError with an
2267 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2268 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
2273 # Start mirroring a block device's writes to a new destination.
2275 # @job-id: identifier for the newly-created block job. If
2276 # omitted, the device name will be used. (Since 2.7)
2278 # @device: The device name or node-name of a root node whose writes should be
2281 # @target: the id or node-name of the block device to mirror to. This mustn't be
2282 # attached to guest.
2284 # @replaces: with sync=full graph node name to be replaced by the new
2285 # image when a whole image copy is done. This can be used to repair
2286 # broken Quorum files.
2288 # @speed: the maximum speed, in bytes per second
2290 # @sync: what parts of the disk image should be copied to the destination
2291 # (all the disk, only the sectors allocated in the topmost image, or
2294 # @granularity: granularity of the dirty bitmap, default is 64K
2295 # if the image format doesn't have clusters, 4K if the clusters
2296 # are smaller than that, else the cluster size. Must be a
2297 # power of 2 between 512 and 64M
2299 # @buf-size: maximum amount of data in flight from source to
2302 # @on-source-error: the action to take on an error on the source,
2303 # default 'report'. 'stop' and 'enospc' can only be used
2304 # if the block device supports io-status (see BlockInfo).
2306 # @on-target-error: the action to take on an error on the target,
2307 # default 'report' (no limitations, since this applies to
2308 # a different block device than @device).
2310 # @filter-node-name: the node name that should be assigned to the
2311 # filter driver that the mirror job inserts into the graph
2312 # above @device. If this option is not given, a node name is
2313 # autogenerated. (Since: 2.9)
2315 # @copy-mode: when to copy data to the destination; defaults to 'background'
2318 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2319 # finished its work, waiting for @block-job-finalize before
2320 # making any block graph changes.
2321 # When true, this job will automatically
2322 # perform its abort or commit actions.
2323 # Defaults to true. (Since 3.1)
2325 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2326 # has completely ceased all work, and awaits @block-job-dismiss.
2327 # When true, this job will automatically disappear from the query
2328 # list without user intervention.
2329 # Defaults to true. (Since 3.1)
2330 # Returns: nothing on success.
2336 # -> { "execute": "blockdev-mirror",
2337 # "arguments": { "device": "ide-hd0",
2338 # "target": "target0",
2339 # "sync": "full" } }
2340 # <- { "return": {} }
2343 { 'command': 'blockdev-mirror',
2344 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2346 'sync': 'MirrorSyncMode',
2347 '*speed': 'int', '*granularity': 'uint32',
2348 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2349 '*on-target-error': 'BlockdevOnError',
2350 '*filter-node-name': 'str',
2351 '*copy-mode': 'MirrorCopyMode',
2352 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2355 # @block_set_io_throttle:
2357 # Change I/O throttle limits for a block drive.
2359 # Since QEMU 2.4, each device with I/O limits is member of a throttle
2362 # If two or more devices are members of the same group, the limits
2363 # will apply to the combined I/O of the whole group in a round-robin
2364 # fashion. Therefore, setting new I/O limits to a device will affect
2367 # The name of the group can be specified using the 'group' parameter.
2368 # If the parameter is unset, it is assumed to be the current group of
2369 # that device. If it's not in any group yet, the name of the device
2370 # will be used as the name for its group.
2372 # The 'group' parameter can also be used to move a device to a
2373 # different group. In this case the limits specified in the parameters
2374 # will be applied to the new group only.
2376 # I/O limits can be disabled by setting all of them to 0. In this case
2377 # the device will be removed from its group and the rest of its
2378 # members will not be affected. The 'group' parameter is ignored.
2380 # Returns: - Nothing on success
2381 # - If @device is not a valid block device, DeviceNotFound
2387 # -> { "execute": "block_set_io_throttle",
2388 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
2401 # "bps_max_length": 0,
2402 # "iops_size": 0 } }
2403 # <- { "return": {} }
2405 # -> { "execute": "block_set_io_throttle",
2406 # "arguments": { "id": "ide0-1-0",
2413 # "bps_max": 8000000,
2419 # "bps_max_length": 60,
2420 # "iops_size": 0 } }
2421 # <- { "return": {} }
2423 { 'command': 'block_set_io_throttle', 'boxed': true,
2424 'data': 'BlockIOThrottle' }
2429 # A set of parameters describing block throttling.
2431 # @device: Block device name (deprecated, use @id instead)
2433 # @id: The name or QOM path of the guest device (since: 2.8)
2435 # @bps: total throughput limit in bytes per second
2437 # @bps_rd: read throughput limit in bytes per second
2439 # @bps_wr: write throughput limit in bytes per second
2441 # @iops: total I/O operations per second
2443 # @iops_rd: read I/O operations per second
2445 # @iops_wr: write I/O operations per second
2447 # @bps_max: total throughput limit during bursts,
2448 # in bytes (Since 1.7)
2450 # @bps_rd_max: read throughput limit during bursts,
2451 # in bytes (Since 1.7)
2453 # @bps_wr_max: write throughput limit during bursts,
2454 # in bytes (Since 1.7)
2456 # @iops_max: total I/O operations per second during bursts,
2457 # in bytes (Since 1.7)
2459 # @iops_rd_max: read I/O operations per second during bursts,
2460 # in bytes (Since 1.7)
2462 # @iops_wr_max: write I/O operations per second during bursts,
2463 # in bytes (Since 1.7)
2465 # @bps_max_length: maximum length of the @bps_max burst
2466 # period, in seconds. It must only
2467 # be set if @bps_max is set as well.
2468 # Defaults to 1. (Since 2.6)
2470 # @bps_rd_max_length: maximum length of the @bps_rd_max
2471 # burst period, in seconds. It must only
2472 # be set if @bps_rd_max is set as well.
2473 # Defaults to 1. (Since 2.6)
2475 # @bps_wr_max_length: maximum length of the @bps_wr_max
2476 # burst period, in seconds. It must only
2477 # be set if @bps_wr_max is set as well.
2478 # Defaults to 1. (Since 2.6)
2480 # @iops_max_length: maximum length of the @iops burst
2481 # period, in seconds. It must only
2482 # be set if @iops_max is set as well.
2483 # Defaults to 1. (Since 2.6)
2485 # @iops_rd_max_length: maximum length of the @iops_rd_max
2486 # burst period, in seconds. It must only
2487 # be set if @iops_rd_max is set as well.
2488 # Defaults to 1. (Since 2.6)
2490 # @iops_wr_max_length: maximum length of the @iops_wr_max
2491 # burst period, in seconds. It must only
2492 # be set if @iops_wr_max is set as well.
2493 # Defaults to 1. (Since 2.6)
2495 # @iops_size: an I/O size in bytes (Since 1.7)
2497 # @group: throttle group name (Since 2.4)
2501 { 'struct': 'BlockIOThrottle',
2502 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2503 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2504 '*bps_max': 'int', '*bps_rd_max': 'int',
2505 '*bps_wr_max': 'int', '*iops_max': 'int',
2506 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2507 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2508 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2509 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2510 '*iops_size': 'int', '*group': 'str' } }
2515 # Limit parameters for throttling.
2516 # Since some limit combinations are illegal, limits should always be set in one
2517 # transaction. All fields are optional. When setting limits, if a field is
2518 # missing the current value is not changed.
2520 # @iops-total: limit total I/O operations per second
2521 # @iops-total-max: I/O operations burst
2522 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2523 # It must only be set if @iops-total-max is set as well.
2524 # @iops-read: limit read operations per second
2525 # @iops-read-max: I/O operations read burst
2526 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2527 # It must only be set if @iops-read-max is set as well.
2528 # @iops-write: limit write operations per second
2529 # @iops-write-max: I/O operations write burst
2530 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2531 # It must only be set if @iops-write-max is set as well.
2532 # @bps-total: limit total bytes per second
2533 # @bps-total-max: total bytes burst
2534 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2535 # It must only be set if @bps-total-max is set as well.
2536 # @bps-read: limit read bytes per second
2537 # @bps-read-max: total bytes read burst
2538 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2539 # It must only be set if @bps-read-max is set as well.
2540 # @bps-write: limit write bytes per second
2541 # @bps-write-max: total bytes write burst
2542 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2543 # It must only be set if @bps-write-max is set as well.
2544 # @iops-size: when limiting by iops max size of an I/O in bytes
2548 { 'struct': 'ThrottleLimits',
2549 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2550 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2551 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2552 '*iops-write' : 'int', '*iops-write-max' : 'int',
2553 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2554 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2555 '*bps-read' : 'int', '*bps-read-max' : 'int',
2556 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2557 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2558 '*iops-size' : 'int' } }
2563 # Copy data from a backing file into a block device.
2565 # The block streaming operation is performed in the background until the entire
2566 # backing file has been copied. This command returns immediately once streaming
2567 # has started. The status of ongoing block streaming operations can be checked
2568 # with query-block-jobs. The operation can be stopped before it has completed
2569 # using the block-job-cancel command.
2571 # The node that receives the data is called the top image, can be located in
2572 # any part of the chain (but always above the base image; see below) and can be
2573 # specified using its device or node name. Earlier qemu versions only allowed
2574 # 'device' to name the top level node; presence of the 'base-node' parameter
2575 # during introspection can be used as a witness of the enhanced semantics
2578 # If a base file is specified then sectors are not copied from that base file and
2579 # its backing chain. When streaming completes the image file will have the base
2580 # file as its backing file. This can be used to stream a subset of the backing
2581 # file chain instead of flattening the entire image.
2583 # On successful completion the image file is updated to drop the backing file
2584 # and the BLOCK_JOB_COMPLETED event is emitted.
2586 # @job-id: identifier for the newly-created block job. If
2587 # omitted, the device name will be used. (Since 2.7)
2589 # @device: the device or node name of the top image
2591 # @base: the common backing file name.
2592 # It cannot be set if @base-node is also set.
2594 # @base-node: the node name of the backing file.
2595 # It cannot be set if @base is also set. (Since 2.8)
2597 # @backing-file: The backing file string to write into the top
2598 # image. This filename is not validated.
2600 # If a pathname string is such that it cannot be
2601 # resolved by QEMU, that means that subsequent QMP or
2602 # HMP commands must use node-names for the image in
2603 # question, as filename lookup methods will fail.
2605 # If not specified, QEMU will automatically determine
2606 # the backing file string to use, or error out if there
2607 # is no obvious choice. Care should be taken when
2608 # specifying the string, to specify a valid filename or
2612 # @speed: the maximum speed, in bytes per second
2614 # @on-error: the action to take on an error (default report).
2615 # 'stop' and 'enospc' can only be used if the block device
2616 # supports io-status (see BlockInfo). Since 1.3.
2618 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2619 # finished its work, waiting for @block-job-finalize before
2620 # making any block graph changes.
2621 # When true, this job will automatically
2622 # perform its abort or commit actions.
2623 # Defaults to true. (Since 3.1)
2625 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2626 # has completely ceased all work, and awaits @block-job-dismiss.
2627 # When true, this job will automatically disappear from the query
2628 # list without user intervention.
2629 # Defaults to true. (Since 3.1)
2631 # Returns: - Nothing on success.
2632 # - If @device does not exist, DeviceNotFound.
2638 # -> { "execute": "block-stream",
2639 # "arguments": { "device": "virtio0",
2640 # "base": "/tmp/master.qcow2" } }
2641 # <- { "return": {} }
2644 { 'command': 'block-stream',
2645 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2646 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2647 '*on-error': 'BlockdevOnError',
2648 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2651 # @block-job-set-speed:
2653 # Set maximum speed for a background block operation.
2655 # This command can only be issued when there is an active block job.
2657 # Throttling can be disabled by setting the speed to 0.
2659 # @device: The job identifier. This used to be a device name (hence
2660 # the name of the parameter), but since QEMU 2.7 it can have
2663 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2666 # Returns: - Nothing on success
2667 # - If no background operation is active on this device, DeviceNotActive
2671 { 'command': 'block-job-set-speed',
2672 'data': { 'device': 'str', 'speed': 'int' } }
2675 # @block-job-cancel:
2677 # Stop an active background block operation.
2679 # This command returns immediately after marking the active background block
2680 # operation for cancellation. It is an error to call this command if no
2681 # operation is in progress.
2683 # The operation will cancel as soon as possible and then emit the
2684 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2685 # enumerated using query-block-jobs.
2687 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2688 # (via the event BLOCK_JOB_READY) that the source and destination are
2689 # synchronized, then the event triggered by this command changes to
2690 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2691 # destination now has a point-in-time copy tied to the time of the cancellation.
2693 # For streaming, the image file retains its backing file unless the streaming
2694 # operation happens to complete just as it is being cancelled. A new streaming
2695 # operation can be started at a later time to finish copying all data from the
2698 # @device: The job identifier. This used to be a device name (hence
2699 # the name of the parameter), but since QEMU 2.7 it can have
2702 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2703 # abandon the job immediately (even if it is paused) instead of waiting
2704 # for the destination to complete its final synchronization (since 1.3)
2706 # Returns: - Nothing on success
2707 # - If no background operation is active on this device, DeviceNotActive
2711 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2716 # Pause an active background block operation.
2718 # This command returns immediately after marking the active background block
2719 # operation for pausing. It is an error to call this command if no
2720 # operation is in progress or if the job is already paused.
2722 # The operation will pause as soon as possible. No event is emitted when
2723 # the operation is actually paused. Cancelling a paused job automatically
2726 # @device: The job identifier. This used to be a device name (hence
2727 # the name of the parameter), but since QEMU 2.7 it can have
2730 # Returns: - Nothing on success
2731 # - If no background operation is active on this device, DeviceNotActive
2735 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2738 # @block-job-resume:
2740 # Resume an active background block operation.
2742 # This command returns immediately after resuming a paused background block
2743 # operation. It is an error to call this command if no operation is in
2744 # progress or if the job is not paused.
2746 # This command also clears the error status of the job.
2748 # @device: The job identifier. This used to be a device name (hence
2749 # the name of the parameter), but since QEMU 2.7 it can have
2752 # Returns: - Nothing on success
2753 # - If no background operation is active on this device, DeviceNotActive
2757 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2760 # @block-job-complete:
2762 # Manually trigger completion of an active background block operation. This
2763 # is supported for drive mirroring, where it also switches the device to
2764 # write to the target path only. The ability to complete is signaled with
2765 # a BLOCK_JOB_READY event.
2767 # This command completes an active background block operation synchronously.
2768 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2769 # is not defined. Note that if an I/O error occurs during the processing of
2770 # this command: 1) the command itself will fail; 2) the error will be processed
2771 # according to the rerror/werror arguments that were specified when starting
2774 # A cancelled or paused job cannot be completed.
2776 # @device: The job identifier. This used to be a device name (hence
2777 # the name of the parameter), but since QEMU 2.7 it can have
2780 # Returns: - Nothing on success
2781 # - If no background operation is active on this device, DeviceNotActive
2785 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2788 # @block-job-dismiss:
2790 # For jobs that have already concluded, remove them from the block-job-query
2791 # list. This command only needs to be run for jobs which were started with
2792 # QEMU 2.12+ job lifetime management semantics.
2794 # This command will refuse to operate on any job that has not yet reached
2795 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2796 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2797 # to be used as appropriate.
2799 # @id: The job identifier.
2801 # Returns: Nothing on success
2805 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2808 # @block-job-finalize:
2810 # Once a job that has manual=true reaches the pending state, it can be
2811 # instructed to finalize any graph changes and do any necessary cleanup
2813 # For jobs in a transaction, instructing one job to finalize will force
2814 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2815 # a single member job to finalize.
2817 # @id: The job identifier.
2819 # Returns: Nothing on success
2823 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2826 # @BlockdevDiscardOptions:
2828 # Determines how to handle discard requests.
2830 # @ignore: Ignore the request
2831 # @unmap: Forward as an unmap request
2835 { 'enum': 'BlockdevDiscardOptions',
2836 'data': [ 'ignore', 'unmap' ] }
2839 # @BlockdevDetectZeroesOptions:
2841 # Describes the operation mode for the automatic conversion of plain
2842 # zero writes by the OS to driver specific optimized zero write commands.
2844 # @off: Disabled (default)
2846 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2847 # also that @BlockdevDiscardOptions is set to unmap for this device.
2851 { 'enum': 'BlockdevDetectZeroesOptions',
2852 'data': [ 'off', 'on', 'unmap' ] }
2855 # @BlockdevAioOptions:
2857 # Selects the AIO backend to handle I/O requests
2859 # @threads: Use qemu's thread pool
2860 # @native: Use native AIO backend (only Linux and Windows)
2861 # @io_uring: Use linux io_uring (since 5.0)
2865 { 'enum': 'BlockdevAioOptions',
2866 'data': [ 'threads', 'native',
2867 { 'name': 'io_uring', 'if': 'defined(CONFIG_LINUX_IO_URING)' } ] }
2870 # @BlockdevCacheOptions:
2872 # Includes cache-related options for block devices
2874 # @direct: enables use of O_DIRECT (bypass the host page cache;
2876 # @no-flush: ignore any flush requests for the device (default:
2881 { 'struct': 'BlockdevCacheOptions',
2882 'data': { '*direct': 'bool',
2883 '*no-flush': 'bool' } }
2888 # Drivers that are supported in block device operations.
2891 # @throttle: Since 2.11
2893 # @copy-on-read: Since 3.0
2894 # @blklogwrites: Since 3.0
2895 # @blkreplay: Since 4.2
2896 # @compress: Since 5.0
2900 { 'enum': 'BlockdevDriver',
2901 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
2902 'cloop', 'compress', 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps',
2903 'gluster', 'host_cdrom', 'host_device', 'http', 'https', 'iscsi',
2904 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
2905 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
2906 { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
2908 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2911 # @BlockdevOptionsFile:
2913 # Driver specific block device options for the file backend.
2915 # @filename: path to the image file
2916 # @pr-manager: the id for the object that will handle persistent reservations
2917 # for this device (default: none, forward the commands via SG_IO;
2919 # @aio: AIO backend (default: threads) (since: 2.8)
2920 # @locking: whether to enable file locking. If set to 'auto', only enable
2921 # when Open File Descriptor (OFD) locking API is available
2922 # (default: auto, since 2.10)
2923 # @drop-cache: invalidate page cache during live migration. This prevents
2924 # stale data on the migration destination with cache.direct=off.
2925 # Currently only supported on Linux hosts.
2926 # (default: on, since: 4.0)
2927 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2928 # migration. May cause noticeable delays if the image
2929 # file is large, do not use in production.
2930 # (default: off) (since: 3.0)
2933 # @dynamic-auto-read-only: If present, enabled auto-read-only means that the
2934 # driver will open the image read-only at first,
2935 # dynamically reopen the image file read-write when
2936 # the first writer is attached to the node and reopen
2937 # read-only when the last writer is detached. This
2938 # allows giving QEMU write permissions only on demand
2939 # when an operation actually needs write access.
2943 { 'struct': 'BlockdevOptionsFile',
2944 'data': { 'filename': 'str',
2945 '*pr-manager': 'str',
2946 '*locking': 'OnOffAuto',
2947 '*aio': 'BlockdevAioOptions',
2948 '*drop-cache': {'type': 'bool',
2949 'if': 'defined(CONFIG_LINUX)'},
2950 '*x-check-cache-dropped': 'bool' },
2951 'features': [ { 'name': 'dynamic-auto-read-only',
2952 'if': 'defined(CONFIG_POSIX)' } ] }
2955 # @BlockdevOptionsNull:
2957 # Driver specific block device options for the null backend.
2959 # @size: size of the device in bytes.
2960 # @latency-ns: emulated latency (in nanoseconds) in processing
2961 # requests. Default to zero which completes requests immediately.
2963 # @read-zeroes: if true, reads from the device produce zeroes; if false, the
2964 # buffer is left unchanged. (default: false; since: 4.1)
2968 { 'struct': 'BlockdevOptionsNull',
2969 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
2972 # @BlockdevOptionsNVMe:
2974 # Driver specific block device options for the NVMe backend.
2976 # @device: PCI controller address of the NVMe device in
2977 # format hhhh:bb:ss.f (host:bus:slot.function)
2978 # @namespace: namespace number of the device, starting from 1.
2980 # Note that the PCI @device must have been unbound from any host
2981 # kernel driver before instructing QEMU to add the blockdev.
2985 { 'struct': 'BlockdevOptionsNVMe',
2986 'data': { 'device': 'str', 'namespace': 'int' } }
2989 # @BlockdevOptionsVVFAT:
2991 # Driver specific block device options for the vvfat protocol.
2993 # @dir: directory to be exported as FAT image
2994 # @fat-type: FAT type: 12, 16 or 32
2995 # @floppy: whether to export a floppy image (true) or
2996 # partitioned hard disk (false; default)
2997 # @label: set the volume label, limited to 11 bytes. FAT16 and
2998 # FAT32 traditionally have some restrictions on labels, which are
2999 # ignored by most operating systems. Defaults to "QEMU VVFAT".
3001 # @rw: whether to allow write operations (default: false)
3005 { 'struct': 'BlockdevOptionsVVFAT',
3006 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
3007 '*label': 'str', '*rw': 'bool' } }
3010 # @BlockdevOptionsGenericFormat:
3012 # Driver specific block device options for image format that have no option
3013 # besides their data source.
3015 # @file: reference to or definition of the data source block device
3019 { 'struct': 'BlockdevOptionsGenericFormat',
3020 'data': { 'file': 'BlockdevRef' } }
3023 # @BlockdevOptionsLUKS:
3025 # Driver specific block device options for LUKS.
3027 # @key-secret: the ID of a QCryptoSecret object providing
3028 # the decryption key (since 2.6). Mandatory except when
3029 # doing a metadata-only probe of the image.
3033 { 'struct': 'BlockdevOptionsLUKS',
3034 'base': 'BlockdevOptionsGenericFormat',
3035 'data': { '*key-secret': 'str' } }
3039 # @BlockdevOptionsGenericCOWFormat:
3041 # Driver specific block device options for image format that have no option
3042 # besides their data source and an optional backing file.
3044 # @backing: reference to or definition of the backing file block
3045 # device, null disables the backing file entirely.
3046 # Defaults to the backing file stored the image file.
3050 { 'struct': 'BlockdevOptionsGenericCOWFormat',
3051 'base': 'BlockdevOptionsGenericFormat',
3052 'data': { '*backing': 'BlockdevRefOrNull' } }
3055 # @Qcow2OverlapCheckMode:
3057 # General overlap check modes.
3059 # @none: Do not perform any checks
3061 # @constant: Perform only checks which can be done in constant time and
3062 # without reading anything from disk
3064 # @cached: Perform only checks which can be done without reading anything
3067 # @all: Perform all available overlap checks
3071 { 'enum': 'Qcow2OverlapCheckMode',
3072 'data': [ 'none', 'constant', 'cached', 'all' ] }
3075 # @Qcow2OverlapCheckFlags:
3077 # Structure of flags for each metadata structure. Setting a field to 'true'
3078 # makes qemu guard that structure against unintended overwriting. The default
3079 # value is chosen according to the template given.
3081 # @template: Specifies a template mode which can be adjusted using the other
3082 # flags, defaults to 'cached'
3084 # @bitmap-directory: since 3.0
3088 { 'struct': 'Qcow2OverlapCheckFlags',
3089 'data': { '*template': 'Qcow2OverlapCheckMode',
3090 '*main-header': 'bool',
3091 '*active-l1': 'bool',
3092 '*active-l2': 'bool',
3093 '*refcount-table': 'bool',
3094 '*refcount-block': 'bool',
3095 '*snapshot-table': 'bool',
3096 '*inactive-l1': 'bool',
3097 '*inactive-l2': 'bool',
3098 '*bitmap-directory': 'bool' } }
3101 # @Qcow2OverlapChecks:
3103 # Specifies which metadata structures should be guarded against unintended
3106 # @flags: set of flags for separate specification of each metadata structure
3109 # @mode: named mode which chooses a specific set of flags
3113 { 'alternate': 'Qcow2OverlapChecks',
3114 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3115 'mode': 'Qcow2OverlapCheckMode' } }
3118 # @BlockdevQcowEncryptionFormat:
3120 # @aes: AES-CBC with plain64 initialization vectors
3124 { 'enum': 'BlockdevQcowEncryptionFormat',
3128 # @BlockdevQcowEncryption:
3132 { 'union': 'BlockdevQcowEncryption',
3133 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3134 'discriminator': 'format',
3135 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3138 # @BlockdevOptionsQcow:
3140 # Driver specific block device options for qcow.
3142 # @encrypt: Image decryption options. Mandatory for
3143 # encrypted images, except when doing a metadata-only
3144 # probe of the image.
3148 { 'struct': 'BlockdevOptionsQcow',
3149 'base': 'BlockdevOptionsGenericCOWFormat',
3150 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3155 # @BlockdevQcow2EncryptionFormat:
3156 # @aes: AES-CBC with plain64 initialization vectors
3160 { 'enum': 'BlockdevQcow2EncryptionFormat',
3161 'data': [ 'aes', 'luks' ] }
3164 # @BlockdevQcow2Encryption:
3168 { 'union': 'BlockdevQcow2Encryption',
3169 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3170 'discriminator': 'format',
3171 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3172 'luks': 'QCryptoBlockOptionsLUKS'} }
3175 # @BlockdevOptionsQcow2:
3177 # Driver specific block device options for qcow2.
3179 # @lazy-refcounts: whether to enable the lazy refcounts
3180 # feature (default is taken from the image file)
3182 # @pass-discard-request: whether discard requests to the qcow2
3183 # device should be forwarded to the data source
3185 # @pass-discard-snapshot: whether discard requests for the data source
3186 # should be issued when a snapshot operation (e.g.
3187 # deleting a snapshot) frees clusters in the qcow2 file
3189 # @pass-discard-other: whether discard requests for the data source
3190 # should be issued on other occasions where a cluster
3193 # @overlap-check: which overlap checks to perform for writes
3194 # to the image, defaults to 'cached' (since 2.2)
3196 # @cache-size: the maximum total size of the L2 table and
3197 # refcount block caches in bytes (since 2.2)
3199 # @l2-cache-size: the maximum size of the L2 table cache in
3202 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3203 # bytes. It must be a power of two between 512
3204 # and the cluster size. The default value is
3205 # the cluster size (since 2.12)
3207 # @refcount-cache-size: the maximum size of the refcount block cache
3208 # in bytes (since 2.2)
3210 # @cache-clean-interval: clean unused entries in the L2 and refcount
3211 # caches. The interval is in seconds. The default value
3212 # is 600 on supporting platforms, and 0 on other
3213 # platforms. 0 disables this feature. (since 2.5)
3215 # @encrypt: Image decryption options. Mandatory for
3216 # encrypted images, except when doing a metadata-only
3217 # probe of the image. (since 2.10)
3219 # @data-file: reference to or definition of the external data file.
3220 # This may only be specified for images that require an
3221 # external data file. If it is not specified for such
3222 # an image, the data file name is loaded from the image
3227 { 'struct': 'BlockdevOptionsQcow2',
3228 'base': 'BlockdevOptionsGenericCOWFormat',
3229 'data': { '*lazy-refcounts': 'bool',
3230 '*pass-discard-request': 'bool',
3231 '*pass-discard-snapshot': 'bool',
3232 '*pass-discard-other': 'bool',
3233 '*overlap-check': 'Qcow2OverlapChecks',
3234 '*cache-size': 'int',
3235 '*l2-cache-size': 'int',
3236 '*l2-cache-entry-size': 'int',
3237 '*refcount-cache-size': 'int',
3238 '*cache-clean-interval': 'int',
3239 '*encrypt': 'BlockdevQcow2Encryption',
3240 '*data-file': 'BlockdevRef' } }
3243 # @SshHostKeyCheckMode:
3245 # @none: Don't check the host key at all
3246 # @hash: Compare the host key with a given hash
3247 # @known_hosts: Check the host key against the known_hosts file
3251 { 'enum': 'SshHostKeyCheckMode',
3252 'data': [ 'none', 'hash', 'known_hosts' ] }
3255 # @SshHostKeyCheckHashType:
3257 # @md5: The given hash is an md5 hash
3258 # @sha1: The given hash is an sha1 hash
3262 { 'enum': 'SshHostKeyCheckHashType',
3263 'data': [ 'md5', 'sha1' ] }
3268 # @type: The hash algorithm used for the hash
3269 # @hash: The expected hash value
3273 { 'struct': 'SshHostKeyHash',
3274 'data': { 'type': 'SshHostKeyCheckHashType',
3282 { 'union': 'SshHostKeyCheck',
3283 'base': { 'mode': 'SshHostKeyCheckMode' },
3284 'discriminator': 'mode',
3285 'data': { 'hash': 'SshHostKeyHash' } }
3288 # @BlockdevOptionsSsh:
3290 # @server: host address
3292 # @path: path to the image on the host
3294 # @user: user as which to connect, defaults to current
3297 # @host-key-check: Defines how and what to check the host key against
3298 # (default: known_hosts)
3302 { 'struct': 'BlockdevOptionsSsh',
3303 'data': { 'server': 'InetSocketAddress',
3306 '*host-key-check': 'SshHostKeyCheck' } }
3312 # Trigger events supported by blkdebug.
3314 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3317 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3319 # @cor_write: a write due to copy-on-read (since 2.11)
3321 # @cluster_alloc_space: an allocation of file space for a cluster (since 4.1)
3323 # @none: triggers once at creation of the blkdebug node (since 4.1)
3327 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3328 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3329 'l1_grow_activate_table', 'l2_load', 'l2_update',
3330 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3331 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3332 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3333 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3334 'refblock_load', 'refblock_update', 'refblock_update_part',
3335 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3336 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3337 'refblock_alloc_switch_table', 'cluster_alloc',
3338 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3339 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3340 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3341 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3342 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3343 'cor_write', 'cluster_alloc_space', 'none'] }
3348 # Kinds of I/O that blkdebug can inject errors in.
3350 # @read: .bdrv_co_preadv()
3352 # @write: .bdrv_co_pwritev()
3354 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3356 # @discard: .bdrv_co_pdiscard()
3358 # @flush: .bdrv_co_flush_to_disk()
3360 # @block-status: .bdrv_co_block_status()
3364 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3365 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3369 # @BlkdebugInjectErrorOptions:
3371 # Describes a single error injection for blkdebug.
3373 # @event: trigger event
3375 # @state: the state identifier blkdebug needs to be in to
3376 # actually trigger the event; defaults to "any"
3378 # @iotype: the type of I/O operations on which this error should
3379 # be injected; defaults to "all read, write,
3380 # write-zeroes, discard, and flush operations"
3383 # @errno: error identifier (errno) to be returned; defaults to
3386 # @sector: specifies the sector index which has to be affected
3387 # in order to actually trigger the event; defaults to "any
3390 # @once: disables further events after this one has been
3391 # triggered; defaults to false
3393 # @immediately: fail immediately; defaults to false
3397 { 'struct': 'BlkdebugInjectErrorOptions',
3398 'data': { 'event': 'BlkdebugEvent',
3400 '*iotype': 'BlkdebugIOType',
3404 '*immediately': 'bool' } }
3407 # @BlkdebugSetStateOptions:
3409 # Describes a single state-change event for blkdebug.
3411 # @event: trigger event
3413 # @state: the current state identifier blkdebug needs to be in;
3416 # @new_state: the state identifier blkdebug is supposed to assume if
3417 # this event is triggered
3421 { 'struct': 'BlkdebugSetStateOptions',
3422 'data': { 'event': 'BlkdebugEvent',
3424 'new_state': 'int' } }
3427 # @BlockdevOptionsBlkdebug:
3429 # Driver specific block device options for blkdebug.
3431 # @image: underlying raw block device (or image file)
3433 # @config: filename of the configuration file
3435 # @align: required alignment for requests in bytes, must be
3436 # positive power of 2, or 0 for default
3438 # @max-transfer: maximum size for I/O transfers in bytes, must be
3439 # positive multiple of @align and of the underlying
3440 # file's request alignment (but need not be a power of
3441 # 2), or 0 for default (since 2.10)
3443 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3444 # must be positive multiple of @align and of the
3445 # underlying file's request alignment (but need not be a
3446 # power of 2), or 0 for default (since 2.10)
3448 # @max-write-zero: maximum size for write zero requests in bytes, must be
3449 # positive multiple of @align, of @opt-write-zero, and of
3450 # the underlying file's request alignment (but need not
3451 # be a power of 2), or 0 for default (since 2.10)
3453 # @opt-discard: preferred alignment for discard requests in bytes, must
3454 # be positive multiple of @align and of the underlying
3455 # file's request alignment (but need not be a power of
3456 # 2), or 0 for default (since 2.10)
3458 # @max-discard: maximum size for discard requests in bytes, must be
3459 # positive multiple of @align, of @opt-discard, and of
3460 # the underlying file's request alignment (but need not
3461 # be a power of 2), or 0 for default (since 2.10)
3463 # @inject-error: array of error injection descriptions
3465 # @set-state: array of state-change descriptions
3467 # @take-child-perms: Permissions to take on @image in addition to what
3468 # is necessary anyway (which depends on how the
3469 # blkdebug node is used). Defaults to none.
3472 # @unshare-child-perms: Permissions not to share on @image in addition
3473 # to what cannot be shared anyway (which depends
3474 # on how the blkdebug node is used). Defaults
3475 # to none. (since 5.0)
3479 { 'struct': 'BlockdevOptionsBlkdebug',
3480 'data': { 'image': 'BlockdevRef',
3482 '*align': 'int', '*max-transfer': 'int32',
3483 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3484 '*opt-discard': 'int32', '*max-discard': 'int32',
3485 '*inject-error': ['BlkdebugInjectErrorOptions'],
3486 '*set-state': ['BlkdebugSetStateOptions'],
3487 '*take-child-perms': ['BlockPermission'],
3488 '*unshare-child-perms': ['BlockPermission'] } }
3491 # @BlockdevOptionsBlklogwrites:
3493 # Driver specific block device options for blklogwrites.
3495 # @file: block device
3497 # @log: block device used to log writes to @file
3499 # @log-sector-size: sector size used in logging writes to @file, determines
3500 # granularity of offsets and sizes of writes (default: 512)
3502 # @log-append: append to an existing log (default: false)
3504 # @log-super-update-interval: interval of write requests after which the log
3505 # super block is updated to disk (default: 4096)
3509 { 'struct': 'BlockdevOptionsBlklogwrites',
3510 'data': { 'file': 'BlockdevRef',
3511 'log': 'BlockdevRef',
3512 '*log-sector-size': 'uint32',
3513 '*log-append': 'bool',
3514 '*log-super-update-interval': 'uint64' } }
3517 # @BlockdevOptionsBlkverify:
3519 # Driver specific block device options for blkverify.
3521 # @test: block device to be tested
3523 # @raw: raw image used for verification
3527 { 'struct': 'BlockdevOptionsBlkverify',
3528 'data': { 'test': 'BlockdevRef',
3529 'raw': 'BlockdevRef' } }
3532 # @BlockdevOptionsBlkreplay:
3534 # Driver specific block device options for blkreplay.
3536 # @image: disk image which should be controlled with blkreplay
3540 { 'struct': 'BlockdevOptionsBlkreplay',
3541 'data': { 'image': 'BlockdevRef' } }
3544 # @QuorumReadPattern:
3546 # An enumeration of quorum read patterns.
3548 # @quorum: read all the children and do a quorum vote on reads
3550 # @fifo: read only from the first child that has not failed
3554 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3557 # @BlockdevOptionsQuorum:
3559 # Driver specific block device options for Quorum
3561 # @blkverify: true if the driver must print content mismatch
3562 # set to false by default
3564 # @children: the children block devices to use
3566 # @vote-threshold: the vote limit under which a read will fail
3568 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3571 # @read-pattern: choose read pattern and set to quorum by default
3576 { 'struct': 'BlockdevOptionsQuorum',
3577 'data': { '*blkverify': 'bool',
3578 'children': [ 'BlockdevRef' ],
3579 'vote-threshold': 'int',
3580 '*rewrite-corrupted': 'bool',
3581 '*read-pattern': 'QuorumReadPattern' } }
3584 # @BlockdevOptionsGluster:
3586 # Driver specific block device options for Gluster
3588 # @volume: name of gluster volume where VM image resides
3590 # @path: absolute path to image file in gluster volume
3592 # @server: gluster servers description
3594 # @debug: libgfapi log level (default '4' which is Error)
3597 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3601 { 'struct': 'BlockdevOptionsGluster',
3602 'data': { 'volume': 'str',
3604 'server': ['SocketAddress'],
3606 '*logfile': 'str' } }
3611 # An enumeration of libiscsi transport types
3615 { 'enum': 'IscsiTransport',
3616 'data': [ 'tcp', 'iser' ] }
3619 # @IscsiHeaderDigest:
3621 # An enumeration of header digests supported by libiscsi
3625 { 'enum': 'IscsiHeaderDigest',
3626 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3627 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3630 # @BlockdevOptionsIscsi:
3632 # @transport: The iscsi transport type
3634 # @portal: The address of the iscsi portal
3636 # @target: The target iqn name
3638 # @lun: LUN to connect to. Defaults to 0.
3640 # @user: User name to log in with. If omitted, no CHAP
3641 # authentication is performed.
3643 # @password-secret: The ID of a QCryptoSecret object providing
3644 # the password for the login. This option is required if
3645 # @user is specified.
3647 # @initiator-name: The iqn name we want to identify to the target
3648 # as. If this option is not specified, an initiator name is
3649 # generated automatically.
3651 # @header-digest: The desired header digest. Defaults to
3654 # @timeout: Timeout in seconds after which a request will
3655 # timeout. 0 means no timeout and is the default.
3657 # Driver specific block device options for iscsi
3661 { 'struct': 'BlockdevOptionsIscsi',
3662 'data': { 'transport': 'IscsiTransport',
3667 '*password-secret': 'str',
3668 '*initiator-name': 'str',
3669 '*header-digest': 'IscsiHeaderDigest',
3670 '*timeout': 'int' } }
3678 { 'enum': 'RbdAuthMode',
3679 'data': [ 'cephx', 'none' ] }
3682 # @BlockdevOptionsRbd:
3684 # @pool: Ceph pool name.
3686 # @image: Image name in the Ceph pool.
3688 # @conf: path to Ceph configuration file. Values
3689 # in the configuration file will be overridden by
3690 # options specified via QAPI.
3692 # @snapshot: Ceph snapshot name.
3694 # @user: Ceph id name.
3696 # @auth-client-required: Acceptable authentication modes.
3697 # This maps to Ceph configuration option
3698 # "auth_client_required". (Since 3.0)
3700 # @key-secret: ID of a QCryptoSecret object providing a key
3701 # for cephx authentication.
3702 # This maps to Ceph configuration option
3703 # "key". (Since 3.0)
3705 # @server: Monitor host address and port. This maps
3706 # to the "mon_host" Ceph option.
3710 { 'struct': 'BlockdevOptionsRbd',
3711 'data': { 'pool': 'str',
3716 '*auth-client-required': ['RbdAuthMode'],
3717 '*key-secret': 'str',
3718 '*server': ['InetSocketAddressBase'] } }
3721 # @BlockdevOptionsSheepdog:
3723 # Driver specific block device options for sheepdog
3725 # @vdi: Virtual disk image name
3726 # @server: The Sheepdog server to connect to
3727 # @snap-id: Snapshot ID
3728 # @tag: Snapshot tag name
3730 # Only one of @snap-id and @tag may be present.
3734 { 'struct': 'BlockdevOptionsSheepdog',
3735 'data': { 'server': 'SocketAddress',
3737 '*snap-id': 'uint32',
3743 # An enumeration of replication modes.
3745 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3747 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3751 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3752 'if': 'defined(CONFIG_REPLICATION)' }
3755 # @BlockdevOptionsReplication:
3757 # Driver specific block device options for replication
3759 # @mode: the replication mode
3761 # @top-id: In secondary mode, node name or device ID of the root
3762 # node who owns the replication node chain. Must not be given in
3767 { 'struct': 'BlockdevOptionsReplication',
3768 'base': 'BlockdevOptionsGenericFormat',
3769 'data': { 'mode': 'ReplicationMode',
3771 'if': 'defined(CONFIG_REPLICATION)' }
3776 # An enumeration of NFS transport types
3778 # @inet: TCP transport
3782 { 'enum': 'NFSTransport',
3783 'data': [ 'inet' ] }
3788 # Captures the address of the socket
3790 # @type: transport type used for NFS (only TCP supported)
3792 # @host: host address for NFS server
3796 { 'struct': 'NFSServer',
3797 'data': { 'type': 'NFSTransport',
3801 # @BlockdevOptionsNfs:
3803 # Driver specific block device option for NFS
3805 # @server: host address
3807 # @path: path of the image on the host
3809 # @user: UID value to use when talking to the
3810 # server (defaults to 65534 on Windows and getuid()
3813 # @group: GID value to use when talking to the
3814 # server (defaults to 65534 on Windows and getgid()
3817 # @tcp-syn-count: number of SYNs during the session
3818 # establishment (defaults to libnfs default)
3820 # @readahead-size: set the readahead size in bytes (defaults
3821 # to libnfs default)
3823 # @page-cache-size: set the pagecache size in bytes (defaults
3824 # to libnfs default)
3826 # @debug: set the NFS debug level (max 2) (defaults
3827 # to libnfs default)
3831 { 'struct': 'BlockdevOptionsNfs',
3832 'data': { 'server': 'NFSServer',
3836 '*tcp-syn-count': 'int',
3837 '*readahead-size': 'int',
3838 '*page-cache-size': 'int',
3842 # @BlockdevOptionsCurlBase:
3844 # Driver specific block device options shared by all protocols supported by the
3847 # @url: URL of the image file
3849 # @readahead: Size of the read-ahead cache; must be a multiple of
3850 # 512 (defaults to 256 kB)
3852 # @timeout: Timeout for connections, in seconds (defaults to 5)
3854 # @username: Username for authentication (defaults to none)
3856 # @password-secret: ID of a QCryptoSecret object providing a password
3857 # for authentication (defaults to no password)
3859 # @proxy-username: Username for proxy authentication (defaults to none)
3861 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3862 # for proxy authentication (defaults to no password)
3866 { 'struct': 'BlockdevOptionsCurlBase',
3867 'data': { 'url': 'str',
3868 '*readahead': 'int',
3871 '*password-secret': 'str',
3872 '*proxy-username': 'str',
3873 '*proxy-password-secret': 'str' } }
3876 # @BlockdevOptionsCurlHttp:
3878 # Driver specific block device options for HTTP connections over the curl
3879 # backend. URLs must start with "http://".
3881 # @cookie: List of cookies to set; format is
3882 # "name1=content1; name2=content2;" as explained by
3883 # CURLOPT_COOKIE(3). Defaults to no cookies.
3885 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3886 # secure way. See @cookie for the format. (since 2.10)
3890 { 'struct': 'BlockdevOptionsCurlHttp',
3891 'base': 'BlockdevOptionsCurlBase',
3892 'data': { '*cookie': 'str',
3893 '*cookie-secret': 'str'} }
3896 # @BlockdevOptionsCurlHttps:
3898 # Driver specific block device options for HTTPS connections over the curl
3899 # backend. URLs must start with "https://".
3901 # @cookie: List of cookies to set; format is
3902 # "name1=content1; name2=content2;" as explained by
3903 # CURLOPT_COOKIE(3). Defaults to no cookies.
3905 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3908 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3909 # secure way. See @cookie for the format. (since 2.10)
3913 { 'struct': 'BlockdevOptionsCurlHttps',
3914 'base': 'BlockdevOptionsCurlBase',
3915 'data': { '*cookie': 'str',
3916 '*sslverify': 'bool',
3917 '*cookie-secret': 'str'} }
3920 # @BlockdevOptionsCurlFtp:
3922 # Driver specific block device options for FTP connections over the curl
3923 # backend. URLs must start with "ftp://".
3927 { 'struct': 'BlockdevOptionsCurlFtp',
3928 'base': 'BlockdevOptionsCurlBase',
3932 # @BlockdevOptionsCurlFtps:
3934 # Driver specific block device options for FTPS connections over the curl
3935 # backend. URLs must start with "ftps://".
3937 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3942 { 'struct': 'BlockdevOptionsCurlFtps',
3943 'base': 'BlockdevOptionsCurlBase',
3944 'data': { '*sslverify': 'bool' } }
3947 # @BlockdevOptionsNbd:
3949 # Driver specific block device options for NBD.
3951 # @server: NBD server address
3953 # @export: export name
3955 # @tls-creds: TLS credentials ID
3957 # @x-dirty-bitmap: A "qemu:dirty-bitmap:NAME" string to query in place of
3958 # traditional "base:allocation" block status (see
3959 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol) (since 3.0)
3961 # @reconnect-delay: On an unexpected disconnect, the nbd client tries to
3962 # connect again until succeeding or encountering a serious
3963 # error. During the first @reconnect-delay seconds, all
3964 # requests are paused and will be rerun on a successful
3965 # reconnect. After that time, any delayed requests and all
3966 # future requests before a successful reconnect will
3967 # immediately fail. Default 0 (Since 4.2)
3971 { 'struct': 'BlockdevOptionsNbd',
3972 'data': { 'server': 'SocketAddress',
3974 '*tls-creds': 'str',
3975 '*x-dirty-bitmap': 'str',
3976 '*reconnect-delay': 'uint32' } }
3979 # @BlockdevOptionsRaw:
3981 # Driver specific block device options for the raw driver.
3983 # @offset: position where the block device starts
3984 # @size: the assumed size of the device
3988 { 'struct': 'BlockdevOptionsRaw',
3989 'base': 'BlockdevOptionsGenericFormat',
3990 'data': { '*offset': 'int', '*size': 'int' } }
3993 # @BlockdevOptionsVxHS:
3995 # Driver specific block device options for VxHS
3997 # @vdisk-id: UUID of VxHS volume
3998 # @server: vxhs server IP, port
3999 # @tls-creds: TLS credentials ID
4003 { 'struct': 'BlockdevOptionsVxHS',
4004 'data': { 'vdisk-id': 'str',
4005 'server': 'InetSocketAddressBase',
4006 '*tls-creds': 'str' } }
4009 # @BlockdevOptionsThrottle:
4011 # Driver specific block device options for the throttle driver
4013 # @throttle-group: the name of the throttle-group object to use. It
4014 # must already exist.
4015 # @file: reference to or definition of the data source block device
4018 { 'struct': 'BlockdevOptionsThrottle',
4019 'data': { 'throttle-group': 'str',
4020 'file' : 'BlockdevRef'
4025 # Options for creating a block device. Many options are available for all
4026 # block devices, independent of the block driver:
4028 # @driver: block driver name
4029 # @node-name: the node name of the new node (Since 2.0).
4030 # This option is required on the top level of blockdev-add.
4031 # Valid node names start with an alphabetic character and may
4032 # contain only alphanumeric characters, '-', '.' and '_'. Their
4033 # maximum length is 31 characters.
4034 # @discard: discard-related options (default: ignore)
4035 # @cache: cache-related options
4036 # @read-only: whether the block device should be read-only (default: false).
4037 # Note that some block drivers support only read-only access,
4038 # either generally or in certain configurations. In this case,
4039 # the default value does not work and the option must be
4040 # specified explicitly.
4041 # @auto-read-only: if true and @read-only is false, QEMU may automatically
4042 # decide not to open the image read-write as requested, but
4043 # fall back to read-only instead (and switch between the modes
4044 # later), e.g. depending on whether the image file is writable
4045 # or whether a writing user is attached to the node
4046 # (default: false, since 3.1)
4047 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
4049 # @force-share: force share all permission on added nodes.
4050 # Requires read-only=true. (Since 2.10)
4052 # Remaining options are determined by the block driver.
4056 { 'union': 'BlockdevOptions',
4057 'base': { 'driver': 'BlockdevDriver',
4058 '*node-name': 'str',
4059 '*discard': 'BlockdevDiscardOptions',
4060 '*cache': 'BlockdevCacheOptions',
4061 '*read-only': 'bool',
4062 '*auto-read-only': 'bool',
4063 '*force-share': 'bool',
4064 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
4065 'discriminator': 'driver',
4067 'blkdebug': 'BlockdevOptionsBlkdebug',
4068 'blklogwrites':'BlockdevOptionsBlklogwrites',
4069 'blkverify': 'BlockdevOptionsBlkverify',
4070 'blkreplay': 'BlockdevOptionsBlkreplay',
4071 'bochs': 'BlockdevOptionsGenericFormat',
4072 'cloop': 'BlockdevOptionsGenericFormat',
4073 'compress': 'BlockdevOptionsGenericFormat',
4074 'copy-on-read':'BlockdevOptionsGenericFormat',
4075 'dmg': 'BlockdevOptionsGenericFormat',
4076 'file': 'BlockdevOptionsFile',
4077 'ftp': 'BlockdevOptionsCurlFtp',
4078 'ftps': 'BlockdevOptionsCurlFtps',
4079 'gluster': 'BlockdevOptionsGluster',
4080 'host_cdrom': 'BlockdevOptionsFile',
4081 'host_device':'BlockdevOptionsFile',
4082 'http': 'BlockdevOptionsCurlHttp',
4083 'https': 'BlockdevOptionsCurlHttps',
4084 'iscsi': 'BlockdevOptionsIscsi',
4085 'luks': 'BlockdevOptionsLUKS',
4086 'nbd': 'BlockdevOptionsNbd',
4087 'nfs': 'BlockdevOptionsNfs',
4088 'null-aio': 'BlockdevOptionsNull',
4089 'null-co': 'BlockdevOptionsNull',
4090 'nvme': 'BlockdevOptionsNVMe',
4091 'parallels': 'BlockdevOptionsGenericFormat',
4092 'qcow2': 'BlockdevOptionsQcow2',
4093 'qcow': 'BlockdevOptionsQcow',
4094 'qed': 'BlockdevOptionsGenericCOWFormat',
4095 'quorum': 'BlockdevOptionsQuorum',
4096 'raw': 'BlockdevOptionsRaw',
4097 'rbd': 'BlockdevOptionsRbd',
4098 'replication': { 'type': 'BlockdevOptionsReplication',
4099 'if': 'defined(CONFIG_REPLICATION)' },
4100 'sheepdog': 'BlockdevOptionsSheepdog',
4101 'ssh': 'BlockdevOptionsSsh',
4102 'throttle': 'BlockdevOptionsThrottle',
4103 'vdi': 'BlockdevOptionsGenericFormat',
4104 'vhdx': 'BlockdevOptionsGenericFormat',
4105 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4106 'vpc': 'BlockdevOptionsGenericFormat',
4107 'vvfat': 'BlockdevOptionsVVFAT',
4108 'vxhs': 'BlockdevOptionsVxHS'
4114 # Reference to a block device.
4116 # @definition: defines a new block device inline
4117 # @reference: references the ID of an existing block device
4121 { 'alternate': 'BlockdevRef',
4122 'data': { 'definition': 'BlockdevOptions',
4123 'reference': 'str' } }
4126 # @BlockdevRefOrNull:
4128 # Reference to a block device.
4130 # @definition: defines a new block device inline
4131 # @reference: references the ID of an existing block device.
4132 # An empty string means that no block device should
4133 # be referenced. Deprecated; use null instead.
4134 # @null: No block device should be referenced (since 2.10)
4138 { 'alternate': 'BlockdevRefOrNull',
4139 'data': { 'definition': 'BlockdevOptions',
4146 # Creates a new block device. If the @id option is given at the top level, a
4147 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
4148 # level and no BlockBackend will be created.
4155 # -> { "execute": "blockdev-add",
4157 # "driver": "qcow2",
4158 # "node-name": "test1",
4161 # "filename": "test.qcow2"
4165 # <- { "return": {} }
4168 # -> { "execute": "blockdev-add",
4170 # "driver": "qcow2",
4171 # "node-name": "node0",
4172 # "discard": "unmap",
4178 # "filename": "/tmp/test.qcow2"
4184 # "filename": "/dev/fdset/4"
4190 # <- { "return": {} }
4193 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
4196 # @x-blockdev-reopen:
4198 # Reopens a block device using the given set of options. Any option
4199 # not specified will be reset to its default value regardless of its
4200 # previous status. If an option cannot be changed or a particular
4201 # driver does not support reopening then the command will return an
4204 # The top-level @node-name option (from BlockdevOptions) must be
4205 # specified and is used to select the block device to be reopened.
4206 # Other @node-name options must be either omitted or set to the
4207 # current name of the appropriate node. This command won't change any
4208 # node name and any attempt to do it will result in an error.
4210 # In the case of options that refer to child nodes, the behavior of
4211 # this command depends on the value:
4213 # 1) A set of options (BlockdevOptions): the child is reopened with
4214 # the specified set of options.
4216 # 2) A reference to the current child: the child is reopened using
4217 # its existing set of options.
4219 # 3) A reference to a different node: the current child is replaced
4220 # with the specified one.
4222 # 4) NULL: the current child (if any) is detached.
4224 # Options (1) and (2) are supported in all cases, but at the moment
4225 # only @backing allows replacing or detaching an existing child.
4227 # Unlike with blockdev-add, the @backing option must always be present
4228 # unless the node being reopened does not have a backing file and its
4229 # image does not have a default backing file name as part of its
4234 { 'command': 'x-blockdev-reopen',
4235 'data': 'BlockdevOptions', 'boxed': true }
4240 # Deletes a block device that has been added using blockdev-add.
4241 # The command will fail if the node is attached to a device or is
4242 # otherwise being used.
4244 # @node-name: Name of the graph node to delete.
4250 # -> { "execute": "blockdev-add",
4252 # "driver": "qcow2",
4253 # "node-name": "node0",
4256 # "filename": "test.qcow2"
4260 # <- { "return": {} }
4262 # -> { "execute": "blockdev-del",
4263 # "arguments": { "node-name": "node0" }
4265 # <- { "return": {} }
4268 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
4271 # @BlockdevCreateOptionsFile:
4273 # Driver specific image creation options for file.
4275 # @filename: Filename for the new image file
4276 # @size: Size of the virtual disk in bytes
4277 # @preallocation: Preallocation mode for the new image (default: off;
4278 # allowed values: off,
4279 # falloc (if defined CONFIG_POSIX_FALLOCATE),
4280 # full (if defined CONFIG_POSIX))
4281 # @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
4285 { 'struct': 'BlockdevCreateOptionsFile',
4286 'data': { 'filename': 'str',
4288 '*preallocation': 'PreallocMode',
4289 '*nocow': 'bool' } }
4292 # @BlockdevCreateOptionsGluster:
4294 # Driver specific image creation options for gluster.
4296 # @location: Where to store the new image file
4297 # @size: Size of the virtual disk in bytes
4298 # @preallocation: Preallocation mode for the new image (default: off;
4299 # allowed values: off,
4300 # falloc (if defined CONFIG_GLUSTERFS_FALLOCATE),
4301 # full (if defined CONFIG_GLUSTERFS_ZEROFILL))
4305 { 'struct': 'BlockdevCreateOptionsGluster',
4306 'data': { 'location': 'BlockdevOptionsGluster',
4308 '*preallocation': 'PreallocMode' } }
4311 # @BlockdevCreateOptionsLUKS:
4313 # Driver specific image creation options for LUKS.
4315 # @file: Node to create the image format on
4316 # @size: Size of the virtual disk in bytes
4317 # @preallocation: Preallocation mode for the new image
4319 # (default: off; allowed values: off, metadata, falloc, full)
4323 { 'struct': 'BlockdevCreateOptionsLUKS',
4324 'base': 'QCryptoBlockCreateOptionsLUKS',
4325 'data': { 'file': 'BlockdevRef',
4327 '*preallocation': 'PreallocMode' } }
4330 # @BlockdevCreateOptionsNfs:
4332 # Driver specific image creation options for NFS.
4334 # @location: Where to store the new image file
4335 # @size: Size of the virtual disk in bytes
4339 { 'struct': 'BlockdevCreateOptionsNfs',
4340 'data': { 'location': 'BlockdevOptionsNfs',
4344 # @BlockdevCreateOptionsParallels:
4346 # Driver specific image creation options for parallels.
4348 # @file: Node to create the image format on
4349 # @size: Size of the virtual disk in bytes
4350 # @cluster-size: Cluster size in bytes (default: 1 MB)
4354 { 'struct': 'BlockdevCreateOptionsParallels',
4355 'data': { 'file': 'BlockdevRef',
4357 '*cluster-size': 'size' } }
4360 # @BlockdevCreateOptionsQcow:
4362 # Driver specific image creation options for qcow.
4364 # @file: Node to create the image format on
4365 # @size: Size of the virtual disk in bytes
4366 # @backing-file: File name of the backing file if a backing file
4368 # @encrypt: Encryption options if the image should be encrypted
4372 { 'struct': 'BlockdevCreateOptionsQcow',
4373 'data': { 'file': 'BlockdevRef',
4375 '*backing-file': 'str',
4376 '*encrypt': 'QCryptoBlockCreateOptions' } }
4379 # @BlockdevQcow2Version:
4381 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4382 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4386 { 'enum': 'BlockdevQcow2Version',
4387 'data': [ 'v2', 'v3' ] }
4391 # @BlockdevCreateOptionsQcow2:
4393 # Driver specific image creation options for qcow2.
4395 # @file: Node to create the image format on
4396 # @data-file: Node to use as an external data file in which all guest
4397 # data is stored so that only metadata remains in the qcow2
4399 # @data-file-raw: True if the external data file must stay valid as a
4400 # standalone (read-only) raw image without looking at qcow2
4401 # metadata (default: false; since: 4.0)
4402 # @size: Size of the virtual disk in bytes
4403 # @version: Compatibility level (default: v3)
4404 # @backing-file: File name of the backing file if a backing file
4406 # @backing-fmt: Name of the block driver to use for the backing file
4407 # @encrypt: Encryption options if the image should be encrypted
4408 # @cluster-size: qcow2 cluster size in bytes (default: 65536)
4409 # @preallocation: Preallocation mode for the new image (default: off;
4410 # allowed values: off, falloc, full, metadata)
4411 # @lazy-refcounts: True if refcounts may be updated lazily (default: off)
4412 # @refcount-bits: Width of reference counts in bits (default: 16)
4416 { 'struct': 'BlockdevCreateOptionsQcow2',
4417 'data': { 'file': 'BlockdevRef',
4418 '*data-file': 'BlockdevRef',
4419 '*data-file-raw': 'bool',
4421 '*version': 'BlockdevQcow2Version',
4422 '*backing-file': 'str',
4423 '*backing-fmt': 'BlockdevDriver',
4424 '*encrypt': 'QCryptoBlockCreateOptions',
4425 '*cluster-size': 'size',
4426 '*preallocation': 'PreallocMode',
4427 '*lazy-refcounts': 'bool',
4428 '*refcount-bits': 'int' } }
4431 # @BlockdevCreateOptionsQed:
4433 # Driver specific image creation options for qed.
4435 # @file: Node to create the image format on
4436 # @size: Size of the virtual disk in bytes
4437 # @backing-file: File name of the backing file if a backing file
4439 # @backing-fmt: Name of the block driver to use for the backing file
4440 # @cluster-size: Cluster size in bytes (default: 65536)
4441 # @table-size: L1/L2 table size (in clusters)
4445 { 'struct': 'BlockdevCreateOptionsQed',
4446 'data': { 'file': 'BlockdevRef',
4448 '*backing-file': 'str',
4449 '*backing-fmt': 'BlockdevDriver',
4450 '*cluster-size': 'size',
4451 '*table-size': 'int' } }
4454 # @BlockdevCreateOptionsRbd:
4456 # Driver specific image creation options for rbd/Ceph.
4458 # @location: Where to store the new image file. This location cannot
4459 # point to a snapshot.
4460 # @size: Size of the virtual disk in bytes
4461 # @cluster-size: RBD object size
4465 { 'struct': 'BlockdevCreateOptionsRbd',
4466 'data': { 'location': 'BlockdevOptionsRbd',
4468 '*cluster-size' : 'size' } }
4471 # @BlockdevVmdkSubformat:
4473 # Subformat options for VMDK images
4475 # @monolithicSparse: Single file image with sparse cluster allocation
4477 # @monolithicFlat: Single flat data image and a descriptor file
4479 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4480 # files, in addition to a descriptor file
4482 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4483 # files, in addition to a descriptor file
4485 # @streamOptimized: Single file image sparse cluster allocation, optimized
4486 # for streaming over network.
4490 { 'enum': 'BlockdevVmdkSubformat',
4491 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4492 'twoGbMaxExtentFlat', 'streamOptimized'] }
4495 # @BlockdevVmdkAdapterType:
4497 # Adapter type info for VMDK images
4501 { 'enum': 'BlockdevVmdkAdapterType',
4502 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4505 # @BlockdevCreateOptionsVmdk:
4507 # Driver specific image creation options for VMDK.
4509 # @file: Where to store the new image file. This refers to the image
4510 # file for monolithcSparse and streamOptimized format, or the
4511 # descriptor file for other formats.
4512 # @size: Size of the virtual disk in bytes
4513 # @extents: Where to store the data extents. Required for monolithcFlat,
4514 # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4515 # monolithicFlat, only one entry is required; for
4516 # twoGbMaxExtent* formats, the number of entries required is
4517 # calculated as extent_number = virtual_size / 2GB. Providing
4518 # more extents than will be used is an error.
4519 # @subformat: The subformat of the VMDK image. Default: "monolithicSparse".
4520 # @backing-file: The path of backing file. Default: no backing file is used.
4521 # @adapter-type: The adapter type used to fill in the descriptor. Default: ide.
4522 # @hwversion: Hardware version. The meaningful options are "4" or "6".
4524 # @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats.
4529 { 'struct': 'BlockdevCreateOptionsVmdk',
4530 'data': { 'file': 'BlockdevRef',
4532 '*extents': ['BlockdevRef'],
4533 '*subformat': 'BlockdevVmdkSubformat',
4534 '*backing-file': 'str',
4535 '*adapter-type': 'BlockdevVmdkAdapterType',
4536 '*hwversion': 'str',
4537 '*zeroed-grain': 'bool' } }
4541 # @SheepdogRedundancyType:
4543 # @full: Create a fully replicated vdi with x copies
4544 # @erasure-coded: Create an erasure coded vdi with x data strips and
4549 { 'enum': 'SheepdogRedundancyType',
4550 'data': [ 'full', 'erasure-coded' ] }
4553 # @SheepdogRedundancyFull:
4555 # @copies: Number of copies to use (between 1 and 31)
4559 { 'struct': 'SheepdogRedundancyFull',
4560 'data': { 'copies': 'int' }}
4563 # @SheepdogRedundancyErasureCoded:
4565 # @data-strips: Number of data strips to use (one of {2,4,8,16})
4566 # @parity-strips: Number of parity strips to use (between 1 and 15)
4570 { 'struct': 'SheepdogRedundancyErasureCoded',
4571 'data': { 'data-strips': 'int',
4572 'parity-strips': 'int' }}
4575 # @SheepdogRedundancy:
4579 { 'union': 'SheepdogRedundancy',
4580 'base': { 'type': 'SheepdogRedundancyType' },
4581 'discriminator': 'type',
4582 'data': { 'full': 'SheepdogRedundancyFull',
4583 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
4586 # @BlockdevCreateOptionsSheepdog:
4588 # Driver specific image creation options for Sheepdog.
4590 # @location: Where to store the new image file
4591 # @size: Size of the virtual disk in bytes
4592 # @backing-file: File name of a base image
4593 # @preallocation: Preallocation mode for the new image (default: off;
4594 # allowed values: off, full)
4595 # @redundancy: Redundancy of the image
4596 # @object-size: Object size of the image
4600 { 'struct': 'BlockdevCreateOptionsSheepdog',
4601 'data': { 'location': 'BlockdevOptionsSheepdog',
4603 '*backing-file': 'str',
4604 '*preallocation': 'PreallocMode',
4605 '*redundancy': 'SheepdogRedundancy',
4606 '*object-size': 'size' } }
4609 # @BlockdevCreateOptionsSsh:
4611 # Driver specific image creation options for SSH.
4613 # @location: Where to store the new image file
4614 # @size: Size of the virtual disk in bytes
4618 { 'struct': 'BlockdevCreateOptionsSsh',
4619 'data': { 'location': 'BlockdevOptionsSsh',
4623 # @BlockdevCreateOptionsVdi:
4625 # Driver specific image creation options for VDI.
4627 # @file: Node to create the image format on
4628 # @size: Size of the virtual disk in bytes
4629 # @preallocation: Preallocation mode for the new image (default: off;
4630 # allowed values: off, metadata)
4634 { 'struct': 'BlockdevCreateOptionsVdi',
4635 'data': { 'file': 'BlockdevRef',
4637 '*preallocation': 'PreallocMode' } }
4640 # @BlockdevVhdxSubformat:
4642 # @dynamic: Growing image file
4643 # @fixed: Preallocated fixed-size image file
4647 { 'enum': 'BlockdevVhdxSubformat',
4648 'data': [ 'dynamic', 'fixed' ] }
4651 # @BlockdevCreateOptionsVhdx:
4653 # Driver specific image creation options for vhdx.
4655 # @file: Node to create the image format on
4656 # @size: Size of the virtual disk in bytes
4657 # @log-size: Log size in bytes, must be a multiple of 1 MB
4659 # @block-size: Block size in bytes, must be a multiple of 1 MB and not
4660 # larger than 256 MB (default: automatically choose a block
4661 # size depending on the image size)
4662 # @subformat: vhdx subformat (default: dynamic)
4663 # @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard,
4664 # but default. Do not set to 'off' when using 'qemu-img
4665 # convert' with subformat=dynamic.
4669 { 'struct': 'BlockdevCreateOptionsVhdx',
4670 'data': { 'file': 'BlockdevRef',
4672 '*log-size': 'size',
4673 '*block-size': 'size',
4674 '*subformat': 'BlockdevVhdxSubformat',
4675 '*block-state-zero': 'bool' } }
4678 # @BlockdevVpcSubformat:
4680 # @dynamic: Growing image file
4681 # @fixed: Preallocated fixed-size image file
4685 { 'enum': 'BlockdevVpcSubformat',
4686 'data': [ 'dynamic', 'fixed' ] }
4689 # @BlockdevCreateOptionsVpc:
4691 # Driver specific image creation options for vpc (VHD).
4693 # @file: Node to create the image format on
4694 # @size: Size of the virtual disk in bytes
4695 # @subformat: vhdx subformat (default: dynamic)
4696 # @force-size: Force use of the exact byte size instead of rounding to the
4697 # next size that can be represented in CHS geometry
4702 { 'struct': 'BlockdevCreateOptionsVpc',
4703 'data': { 'file': 'BlockdevRef',
4705 '*subformat': 'BlockdevVpcSubformat',
4706 '*force-size': 'bool' } }
4709 # @BlockdevCreateOptions:
4711 # Options for creating an image format on a given node.
4713 # @driver: block driver to create the image format
4717 { 'union': 'BlockdevCreateOptions',
4719 'driver': 'BlockdevDriver' },
4720 'discriminator': 'driver',
4722 'file': 'BlockdevCreateOptionsFile',
4723 'gluster': 'BlockdevCreateOptionsGluster',
4724 'luks': 'BlockdevCreateOptionsLUKS',
4725 'nfs': 'BlockdevCreateOptionsNfs',
4726 'parallels': 'BlockdevCreateOptionsParallels',
4727 'qcow': 'BlockdevCreateOptionsQcow',
4728 'qcow2': 'BlockdevCreateOptionsQcow2',
4729 'qed': 'BlockdevCreateOptionsQed',
4730 'rbd': 'BlockdevCreateOptionsRbd',
4731 'sheepdog': 'BlockdevCreateOptionsSheepdog',
4732 'ssh': 'BlockdevCreateOptionsSsh',
4733 'vdi': 'BlockdevCreateOptionsVdi',
4734 'vhdx': 'BlockdevCreateOptionsVhdx',
4735 'vmdk': 'BlockdevCreateOptionsVmdk',
4736 'vpc': 'BlockdevCreateOptionsVpc'
4742 # Starts a job to create an image format on a given node. The job is
4743 # automatically finalized, but a manual job-dismiss is required.
4745 # @job-id: Identifier for the newly created job.
4747 # @options: Options for the image creation.
4751 { 'command': 'blockdev-create',
4752 'data': { 'job-id': 'str',
4753 'options': 'BlockdevCreateOptions' } }
4756 # @blockdev-open-tray:
4758 # Opens a block device's tray. If there is a block driver state tree inserted as
4759 # a medium, it will become inaccessible to the guest (but it will remain
4760 # associated to the block device, so closing the tray will make it accessible
4763 # If the tray was already open before, this will be a no-op.
4765 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4766 # which no such event will be generated, these include:
4768 # - if the guest has locked the tray, @force is false and the guest does not
4769 # respond to the eject request
4770 # - if the BlockBackend denoted by @device does not have a guest device attached
4772 # - if the guest device does not have an actual tray
4774 # @device: Block device name (deprecated, use @id instead)
4776 # @id: The name or QOM path of the guest device (since: 2.8)
4778 # @force: if false (the default), an eject request will be sent to
4779 # the guest if it has locked the tray (and the tray will not be opened
4780 # immediately); if true, the tray will be opened regardless of whether
4787 # -> { "execute": "blockdev-open-tray",
4788 # "arguments": { "id": "ide0-1-0" } }
4790 # <- { "timestamp": { "seconds": 1418751016,
4791 # "microseconds": 716996 },
4792 # "event": "DEVICE_TRAY_MOVED",
4793 # "data": { "device": "ide1-cd0",
4795 # "tray-open": true } }
4797 # <- { "return": {} }
4800 { 'command': 'blockdev-open-tray',
4801 'data': { '*device': 'str',
4803 '*force': 'bool' } }
4806 # @blockdev-close-tray:
4808 # Closes a block device's tray. If there is a block driver state tree associated
4809 # with the block device (which is currently ejected), that tree will be loaded
4812 # If the tray was already closed before, this will be a no-op.
4814 # @device: Block device name (deprecated, use @id instead)
4816 # @id: The name or QOM path of the guest device (since: 2.8)
4822 # -> { "execute": "blockdev-close-tray",
4823 # "arguments": { "id": "ide0-1-0" } }
4825 # <- { "timestamp": { "seconds": 1418751345,
4826 # "microseconds": 272147 },
4827 # "event": "DEVICE_TRAY_MOVED",
4828 # "data": { "device": "ide1-cd0",
4830 # "tray-open": false } }
4832 # <- { "return": {} }
4835 { 'command': 'blockdev-close-tray',
4836 'data': { '*device': 'str',
4840 # @blockdev-remove-medium:
4842 # Removes a medium (a block driver state tree) from a block device. That block
4843 # device's tray must currently be open (unless there is no attached guest
4846 # If the tray is open and there is no medium inserted, this will be a no-op.
4848 # @id: The name or QOM path of the guest device
4854 # -> { "execute": "blockdev-remove-medium",
4855 # "arguments": { "id": "ide0-1-0" } }
4857 # <- { "error": { "class": "GenericError",
4858 # "desc": "Tray of device 'ide0-1-0' is not open" } }
4860 # -> { "execute": "blockdev-open-tray",
4861 # "arguments": { "id": "ide0-1-0" } }
4863 # <- { "timestamp": { "seconds": 1418751627,
4864 # "microseconds": 549958 },
4865 # "event": "DEVICE_TRAY_MOVED",
4866 # "data": { "device": "ide1-cd0",
4868 # "tray-open": true } }
4870 # <- { "return": {} }
4872 # -> { "execute": "blockdev-remove-medium",
4873 # "arguments": { "id": "ide0-1-0" } }
4875 # <- { "return": {} }
4878 { 'command': 'blockdev-remove-medium',
4879 'data': { 'id': 'str' } }
4882 # @blockdev-insert-medium:
4884 # Inserts a medium (a block driver state tree) into a block device. That block
4885 # device's tray must currently be open (unless there is no attached guest
4886 # device) and there must be no medium inserted already.
4888 # @id: The name or QOM path of the guest device
4890 # @node-name: name of a node in the block driver state graph
4896 # -> { "execute": "blockdev-add",
4898 # "node-name": "node0",
4900 # "file": { "driver": "file",
4901 # "filename": "fedora.iso" } } }
4902 # <- { "return": {} }
4904 # -> { "execute": "blockdev-insert-medium",
4905 # "arguments": { "id": "ide0-1-0",
4906 # "node-name": "node0" } }
4908 # <- { "return": {} }
4911 { 'command': 'blockdev-insert-medium',
4912 'data': { 'id': 'str',
4913 'node-name': 'str'} }
4917 # @BlockdevChangeReadOnlyMode:
4919 # Specifies the new read-only mode of a block device subject to the
4920 # @blockdev-change-medium command.
4922 # @retain: Retains the current read-only mode
4924 # @read-only: Makes the device read-only
4926 # @read-write: Makes the device writable
4931 { 'enum': 'BlockdevChangeReadOnlyMode',
4932 'data': ['retain', 'read-only', 'read-write'] }
4936 # @blockdev-change-medium:
4938 # Changes the medium inserted into a block device by ejecting the current medium
4939 # and loading a new image file which is inserted as the new medium (this command
4940 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
4941 # and blockdev-close-tray).
4943 # @device: Block device name (deprecated, use @id instead)
4945 # @id: The name or QOM path of the guest device
4948 # @filename: filename of the new image to be loaded
4950 # @format: format to open the new image with (defaults to
4951 # the probed format)
4953 # @read-only-mode: change the read-only mode of the device; defaults
4960 # 1. Change a removable medium
4962 # -> { "execute": "blockdev-change-medium",
4963 # "arguments": { "id": "ide0-1-0",
4964 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4965 # "format": "raw" } }
4966 # <- { "return": {} }
4968 # 2. Load a read-only medium into a writable drive
4970 # -> { "execute": "blockdev-change-medium",
4971 # "arguments": { "id": "floppyA",
4972 # "filename": "/srv/images/ro.img",
4974 # "read-only-mode": "retain" } }
4977 # { "class": "GenericError",
4978 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4980 # -> { "execute": "blockdev-change-medium",
4981 # "arguments": { "id": "floppyA",
4982 # "filename": "/srv/images/ro.img",
4984 # "read-only-mode": "read-only" } }
4986 # <- { "return": {} }
4989 { 'command': 'blockdev-change-medium',
4990 'data': { '*device': 'str',
4994 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
4998 # @BlockErrorAction:
5000 # An enumeration of action that has been taken when a DISK I/O occurs
5002 # @ignore: error has been ignored
5004 # @report: error has been reported to the device
5006 # @stop: error caused VM to be stopped
5010 { 'enum': 'BlockErrorAction',
5011 'data': [ 'ignore', 'report', 'stop' ] }
5015 # @BLOCK_IMAGE_CORRUPTED:
5017 # Emitted when a disk image is being marked corrupt. The image can be
5018 # identified by its device or node name. The 'device' field is always
5019 # present for compatibility reasons, but it can be empty ("") if the
5020 # image does not have a device name associated.
5022 # @device: device name. This is always present for compatibility
5023 # reasons, but it can be empty ("") if the image does not
5024 # have a device name associated.
5026 # @node-name: node name (Since: 2.4)
5028 # @msg: informative message for human consumption, such as the kind of
5029 # corruption being detected. It should not be parsed by machine as it is
5030 # not guaranteed to be stable
5032 # @offset: if the corruption resulted from an image access, this is
5033 # the host's access offset into the image
5035 # @size: if the corruption resulted from an image access, this is
5038 # @fatal: if set, the image is marked corrupt and therefore unusable after this
5039 # event and must be repaired (Since 2.2; before, every
5040 # BLOCK_IMAGE_CORRUPTED event was fatal)
5042 # Note: If action is "stop", a STOP event will eventually follow the
5043 # BLOCK_IO_ERROR event.
5047 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
5048 # "data": { "device": "ide0-hd0", "node-name": "node0",
5049 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
5051 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
5055 { 'event': 'BLOCK_IMAGE_CORRUPTED',
5056 'data': { 'device' : 'str',
5057 '*node-name' : 'str',
5061 'fatal' : 'bool' } }
5066 # Emitted when a disk I/O error occurs
5068 # @device: device name. This is always present for compatibility
5069 # reasons, but it can be empty ("") if the image does not
5070 # have a device name associated.
5072 # @node-name: node name. Note that errors may be reported for the root node
5073 # that is directly attached to a guest device rather than for the
5074 # node where the error occurred. The node name is not present if
5075 # the drive is empty. (Since: 2.8)
5077 # @operation: I/O operation
5079 # @action: action that has been taken
5081 # @nospace: true if I/O error was caused due to a no-space
5082 # condition. This key is only present if query-block's
5083 # io-status is present, please see query-block documentation
5084 # for more information (since: 2.2)
5086 # @reason: human readable string describing the error cause.
5087 # (This field is a debugging aid for humans, it should not
5088 # be parsed by applications) (since: 2.2)
5090 # Note: If action is "stop", a STOP event will eventually follow the
5091 # BLOCK_IO_ERROR event
5097 # <- { "event": "BLOCK_IO_ERROR",
5098 # "data": { "device": "ide0-hd1",
5099 # "node-name": "#block212",
5100 # "operation": "write",
5101 # "action": "stop" },
5102 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5105 { 'event': 'BLOCK_IO_ERROR',
5106 'data': { 'device': 'str', '*node-name': 'str',
5107 'operation': 'IoOperationType',
5108 'action': 'BlockErrorAction', '*nospace': 'bool',
5112 # @BLOCK_JOB_COMPLETED:
5114 # Emitted when a block job has completed
5118 # @device: The job identifier. Originally the device name but other
5119 # values are allowed since QEMU 2.7
5121 # @len: maximum progress value
5123 # @offset: current progress value. On success this is equal to len.
5124 # On failure this is less than len
5126 # @speed: rate limit, bytes per second
5128 # @error: error message. Only present on failure. This field
5129 # contains a human-readable error message. There are no semantics
5130 # other than that streaming has failed and clients should not try to
5131 # interpret the error string
5137 # <- { "event": "BLOCK_JOB_COMPLETED",
5138 # "data": { "type": "stream", "device": "virtio-disk0",
5139 # "len": 10737418240, "offset": 10737418240,
5141 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5144 { 'event': 'BLOCK_JOB_COMPLETED',
5145 'data': { 'type' : 'JobType',
5153 # @BLOCK_JOB_CANCELLED:
5155 # Emitted when a block job has been cancelled
5159 # @device: The job identifier. Originally the device name but other
5160 # values are allowed since QEMU 2.7
5162 # @len: maximum progress value
5164 # @offset: current progress value. On success this is equal to len.
5165 # On failure this is less than len
5167 # @speed: rate limit, bytes per second
5173 # <- { "event": "BLOCK_JOB_CANCELLED",
5174 # "data": { "type": "stream", "device": "virtio-disk0",
5175 # "len": 10737418240, "offset": 134217728,
5177 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5180 { 'event': 'BLOCK_JOB_CANCELLED',
5181 'data': { 'type' : 'JobType',
5190 # Emitted when a block job encounters an error
5192 # @device: The job identifier. Originally the device name but other
5193 # values are allowed since QEMU 2.7
5195 # @operation: I/O operation
5197 # @action: action that has been taken
5203 # <- { "event": "BLOCK_JOB_ERROR",
5204 # "data": { "device": "ide0-hd1",
5205 # "operation": "write",
5206 # "action": "stop" },
5207 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5210 { 'event': 'BLOCK_JOB_ERROR',
5211 'data': { 'device' : 'str',
5212 'operation': 'IoOperationType',
5213 'action' : 'BlockErrorAction' } }
5218 # Emitted when a block job is ready to complete
5222 # @device: The job identifier. Originally the device name but other
5223 # values are allowed since QEMU 2.7
5225 # @len: maximum progress value
5227 # @offset: current progress value. On success this is equal to len.
5228 # On failure this is less than len
5230 # @speed: rate limit, bytes per second
5232 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
5239 # <- { "event": "BLOCK_JOB_READY",
5240 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5241 # "len": 2097152, "offset": 2097152 }
5242 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5245 { 'event': 'BLOCK_JOB_READY',
5246 'data': { 'type' : 'JobType',
5253 # @BLOCK_JOB_PENDING:
5255 # Emitted when a block job is awaiting explicit authorization to finalize graph
5256 # changes via @block-job-finalize. If this job is part of a transaction, it will
5257 # not emit this event until the transaction has converged first.
5261 # @id: The job identifier.
5267 # <- { "event": "BLOCK_JOB_WAITING",
5268 # "data": { "device": "drive0", "type": "mirror" },
5269 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5272 { 'event': 'BLOCK_JOB_PENDING',
5273 'data': { 'type' : 'JobType',
5279 # Preallocation mode of QEMU image file
5281 # @off: no preallocation
5282 # @metadata: preallocate only for metadata
5283 # @falloc: like @full preallocation but allocate disk space by
5284 # posix_fallocate() rather than writing data.
5285 # @full: preallocate all data by writing it to the device to ensure
5286 # disk space is really available. This data may or may not be
5287 # zero, depending on the image format and storage.
5288 # @full preallocation also sets up metadata correctly.
5292 { 'enum': 'PreallocMode',
5293 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5296 # @BLOCK_WRITE_THRESHOLD:
5298 # Emitted when writes on block device reaches or exceeds the
5299 # configured write threshold. For thin-provisioned devices, this
5300 # means the device should be extended to avoid pausing for
5302 # The event is one shot. Once triggered, it needs to be
5303 # re-registered with another block-set-write-threshold command.
5305 # @node-name: graph node name on which the threshold was exceeded.
5307 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5309 # @write-threshold: last configured threshold, in bytes.
5313 { 'event': 'BLOCK_WRITE_THRESHOLD',
5314 'data': { 'node-name': 'str',
5315 'amount-exceeded': 'uint64',
5316 'write-threshold': 'uint64' } }
5319 # @block-set-write-threshold:
5321 # Change the write threshold for a block drive. An event will be
5322 # delivered if a write to this block drive crosses the configured
5323 # threshold. The threshold is an offset, thus must be
5324 # non-negative. Default is no write threshold. Setting the threshold
5325 # to zero disables it.
5327 # This is useful to transparently resize thin-provisioned drives without
5328 # the guest OS noticing.
5330 # @node-name: graph node name on which the threshold must be set.
5332 # @write-threshold: configured threshold for the block device, bytes.
5333 # Use 0 to disable the threshold.
5339 # -> { "execute": "block-set-write-threshold",
5340 # "arguments": { "node-name": "mydev",
5341 # "write-threshold": 17179869184 } }
5342 # <- { "return": {} }
5345 { 'command': 'block-set-write-threshold',
5346 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
5349 # @x-blockdev-change:
5351 # Dynamically reconfigure the block driver state graph. It can be used
5352 # to add, remove, insert or replace a graph node. Currently only the
5353 # Quorum driver implements this feature to add or remove its child. This
5354 # is useful to fix a broken quorum child.
5356 # If @node is specified, it will be inserted under @parent. @child
5357 # may not be specified in this case. If both @parent and @child are
5358 # specified but @node is not, @child will be detached from @parent.
5360 # @parent: the id or name of the parent node.
5362 # @child: the name of a child under the given parent node.
5364 # @node: the name of the node that will be added.
5366 # Note: this command is experimental, and its API is not stable. It
5367 # does not support all kinds of operations, all kinds of children, nor
5368 # all block drivers.
5370 # FIXME Removing children from a quorum node means introducing gaps in the
5371 # child indices. This cannot be represented in the 'children' list of
5372 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
5374 # Warning: The data in a new quorum child MUST be consistent with that of
5375 # the rest of the array.
5381 # 1. Add a new node to a quorum
5382 # -> { "execute": "blockdev-add",
5385 # "node-name": "new_node",
5386 # "file": { "driver": "file",
5387 # "filename": "test.raw" } } }
5388 # <- { "return": {} }
5389 # -> { "execute": "x-blockdev-change",
5390 # "arguments": { "parent": "disk1",
5391 # "node": "new_node" } }
5392 # <- { "return": {} }
5394 # 2. Delete a quorum's node
5395 # -> { "execute": "x-blockdev-change",
5396 # "arguments": { "parent": "disk1",
5397 # "child": "children.1" } }
5398 # <- { "return": {} }
5401 { 'command': 'x-blockdev-change',
5402 'data' : { 'parent': 'str',
5407 # @x-blockdev-set-iothread:
5409 # Move @node and its children into the @iothread. If @iothread is null then
5410 # move @node and its children into the main loop.
5412 # The node must not be attached to a BlockBackend.
5414 # @node-name: the name of the block driver node
5416 # @iothread: the name of the IOThread object or null for the main loop
5418 # @force: true if the node and its children should be moved when a BlockBackend
5419 # is already attached
5421 # Note: this command is experimental and intended for test cases that need
5422 # control over IOThreads only.
5428 # 1. Move a node into an IOThread
5429 # -> { "execute": "x-blockdev-set-iothread",
5430 # "arguments": { "node-name": "disk1",
5431 # "iothread": "iothread0" } }
5432 # <- { "return": {} }
5434 # 2. Move a node into the main loop
5435 # -> { "execute": "x-blockdev-set-iothread",
5436 # "arguments": { "node-name": "disk1",
5437 # "iothread": null } }
5438 # <- { "return": {} }
5441 { 'command': 'x-blockdev-set-iothread',
5442 'data' : { 'node-name': 'str',
5443 'iothread': 'StrOrNull',
5444 '*force': 'bool' } }