4 # == Block core (VM unrelated)
7 { 'include': 'common.json' }
8 { 'include': 'crypto.json' }
9 { 'include': 'job.json' }
10 { 'include': 'sockets.json' }
15 # @id: unique snapshot id
17 # @name: user chosen name
19 # @vm-state-size: size of the VM state
21 # @date-sec: UTC date of the snapshot in seconds
23 # @date-nsec: fractional part in nano seconds to be used with date-sec
25 # @vm-clock-sec: VM clock relative to boot in seconds
27 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
32 { 'struct': 'SnapshotInfo',
33 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
34 'date-sec': 'int', 'date-nsec': 'int',
35 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
38 # @ImageInfoSpecificQCow2EncryptionBase:
40 # @format: The encryption format
44 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
45 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
48 # @ImageInfoSpecificQCow2Encryption:
52 { 'union': 'ImageInfoSpecificQCow2Encryption',
53 'base': 'ImageInfoSpecificQCow2EncryptionBase',
54 'discriminator': 'format',
55 'data': { 'luks': 'QCryptoBlockInfoLUKS' } }
58 # @ImageInfoSpecificQCow2:
60 # @compat: compatibility level
62 # @data-file: the filename of the external data file that is stored in the
63 # image and used as a default for opening the image (since: 4.0)
65 # @data-file-raw: True if the external data file must stay valid as a
66 # standalone (read-only) raw image without looking at qcow2
67 # metadata (since: 4.0)
69 # @lazy-refcounts: on or off; only valid for compat >= 1.1
71 # @corrupt: true if the image has been marked corrupt; only valid for
72 # compat >= 1.1 (since 2.2)
74 # @refcount-bits: width of a refcount entry in bits (since 2.3)
76 # @encrypt: details about encryption parameters; only set if image
77 # is encrypted (since 2.10)
79 # @bitmaps: A list of qcow2 bitmap details (since 4.0)
83 { 'struct': 'ImageInfoSpecificQCow2',
87 '*data-file-raw': 'bool',
88 '*lazy-refcounts': 'bool',
90 'refcount-bits': 'int',
91 '*encrypt': 'ImageInfoSpecificQCow2Encryption',
92 '*bitmaps': ['Qcow2BitmapInfo']
96 # @ImageInfoSpecificVmdk:
98 # @create-type: The create type of VMDK image
100 # @cid: Content id of image
102 # @parent-cid: Parent VMDK image's cid
104 # @extents: List of extent files
108 { 'struct': 'ImageInfoSpecificVmdk',
110 'create-type': 'str',
113 'extents': ['ImageInfo']
117 # @ImageInfoSpecific:
119 # A discriminated record of image format specific information structures.
123 { 'union': 'ImageInfoSpecific',
125 'qcow2': 'ImageInfoSpecificQCow2',
126 'vmdk': 'ImageInfoSpecificVmdk',
127 # If we need to add block driver specific parameters for
128 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
129 # to define a ImageInfoSpecificLUKS
130 'luks': 'QCryptoBlockInfoLUKS'
136 # Information about a QEMU image file
138 # @filename: name of the image file
140 # @format: format of the image file
142 # @virtual-size: maximum capacity in bytes of the image
144 # @actual-size: actual size on disk in bytes of the image
146 # @dirty-flag: true if image is not cleanly closed
148 # @cluster-size: size of a cluster in bytes
150 # @encrypted: true if the image is encrypted
152 # @compressed: true if the image is compressed (Since 1.7)
154 # @backing-filename: name of the backing file
156 # @full-backing-filename: full path of the backing file
158 # @backing-filename-format: the format of the backing file
160 # @snapshots: list of VM snapshots
162 # @backing-image: info of the backing image (since 1.6)
164 # @format-specific: structure supplying additional format-specific
165 # information (since 1.7)
170 { 'struct': 'ImageInfo',
171 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
172 '*actual-size': 'int', 'virtual-size': 'int',
173 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
174 '*backing-filename': 'str', '*full-backing-filename': 'str',
175 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
176 '*backing-image': 'ImageInfo',
177 '*format-specific': 'ImageInfoSpecific' } }
182 # Information about a QEMU image file check
184 # @filename: name of the image file checked
186 # @format: format of the image file checked
188 # @check-errors: number of unexpected errors occurred during check
190 # @image-end-offset: offset (in bytes) where the image ends, this
191 # field is present if the driver for the image format
194 # @corruptions: number of corruptions found during the check if any
196 # @leaks: number of leaks found during the check if any
198 # @corruptions-fixed: number of corruptions fixed during the check
201 # @leaks-fixed: number of leaks fixed during the check if any
203 # @total-clusters: total number of clusters, this field is present
204 # if the driver for the image format supports it
206 # @allocated-clusters: total number of allocated clusters, this
207 # field is present if the driver for the image format
210 # @fragmented-clusters: total number of fragmented clusters, this
211 # field is present if the driver for the image format
214 # @compressed-clusters: total number of compressed clusters, this
215 # field is present if the driver for the image format
221 { 'struct': 'ImageCheck',
222 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
223 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
224 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
225 '*total-clusters': 'int', '*allocated-clusters': 'int',
226 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
231 # Mapping information from a virtual block range to a host file range
233 # @start: the start byte of the mapped virtual range
235 # @length: the number of bytes of the mapped virtual range
237 # @data: whether the mapped range has data
239 # @zero: whether the virtual blocks are zeroed
241 # @depth: the depth of the mapping
243 # @offset: the offset in file that the virtual sectors are mapped to
245 # @filename: filename that is referred to by @offset
250 { 'struct': 'MapEntry',
251 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
252 'zero': 'bool', 'depth': 'int', '*offset': 'int',
253 '*filename': 'str' } }
256 # @BlockdevCacheInfo:
258 # Cache mode information for a block device
260 # @writeback: true if writeback mode is enabled
261 # @direct: true if the host page cache is bypassed (O_DIRECT)
262 # @no-flush: true if flush requests are ignored for the device
266 { 'struct': 'BlockdevCacheInfo',
267 'data': { 'writeback': 'bool',
269 'no-flush': 'bool' } }
274 # Information about the backing device for a block device.
276 # @file: the filename of the backing device
278 # @node-name: the name of the block driver node (Since 2.0)
280 # @ro: true if the backing device was open read-only
282 # @drv: the name of the block format used to open the backing device. As of
283 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
284 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
285 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
286 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
287 # 2.2: 'archipelago' added, 'cow' dropped
288 # 2.3: 'host_floppy' deprecated
289 # 2.5: 'host_floppy' dropped
291 # 2.8: 'replication' added, 'tftp' dropped
292 # 2.9: 'archipelago' dropped
294 # @backing_file: the name of the backing file (for copy-on-write)
296 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
298 # @encrypted: true if the backing device is encrypted
300 # @encryption_key_missing: Deprecated; always false
302 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
304 # @bps: total throughput limit in bytes per second is specified
306 # @bps_rd: read throughput limit in bytes per second is specified
308 # @bps_wr: write throughput limit in bytes per second is specified
310 # @iops: total I/O operations per second is specified
312 # @iops_rd: read I/O operations per second is specified
314 # @iops_wr: write I/O operations per second is specified
316 # @image: the info of image used (since: 1.6)
318 # @bps_max: total throughput limit during bursts,
319 # in bytes (Since 1.7)
321 # @bps_rd_max: read throughput limit during bursts,
322 # in bytes (Since 1.7)
324 # @bps_wr_max: write throughput limit during bursts,
325 # in bytes (Since 1.7)
327 # @iops_max: total I/O operations per second during bursts,
328 # in bytes (Since 1.7)
330 # @iops_rd_max: read I/O operations per second during bursts,
331 # in bytes (Since 1.7)
333 # @iops_wr_max: write I/O operations per second during bursts,
334 # in bytes (Since 1.7)
336 # @bps_max_length: maximum length of the @bps_max burst
337 # period, in seconds. (Since 2.6)
339 # @bps_rd_max_length: maximum length of the @bps_rd_max
340 # burst period, in seconds. (Since 2.6)
342 # @bps_wr_max_length: maximum length of the @bps_wr_max
343 # burst period, in seconds. (Since 2.6)
345 # @iops_max_length: maximum length of the @iops burst
346 # period, in seconds. (Since 2.6)
348 # @iops_rd_max_length: maximum length of the @iops_rd_max
349 # burst period, in seconds. (Since 2.6)
351 # @iops_wr_max_length: maximum length of the @iops_wr_max
352 # burst period, in seconds. (Since 2.6)
354 # @iops_size: an I/O size in bytes (Since 1.7)
356 # @group: throttle group name (Since 2.4)
358 # @cache: the cache mode used for the block device (since: 2.3)
360 # @write_threshold: configured write threshold for the device.
361 # 0 if disabled. (Since 2.3)
366 { 'struct': 'BlockDeviceInfo',
367 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
368 '*backing_file': 'str', 'backing_file_depth': 'int',
369 'encrypted': 'bool', 'encryption_key_missing': 'bool',
370 'detect_zeroes': 'BlockdevDetectZeroesOptions',
371 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
372 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
373 'image': 'ImageInfo',
374 '*bps_max': 'int', '*bps_rd_max': 'int',
375 '*bps_wr_max': 'int', '*iops_max': 'int',
376 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
377 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
378 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
379 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
380 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
381 'write_threshold': 'int' } }
384 # @BlockDeviceIoStatus:
386 # An enumeration of block device I/O status.
388 # @ok: The last I/O operation has succeeded
390 # @failed: The last I/O operation has failed
392 # @nospace: The last I/O operation has failed due to a no-space condition
396 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
399 # @BlockDeviceMapEntry:
401 # Entry in the metadata map of the device (returned by "qemu-img map")
403 # @start: Offset in the image of the first byte described by this entry
406 # @length: Length of the range described by this entry (in bytes)
408 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
409 # before reaching one for which the range is allocated. The value is
410 # in the range 0 to the depth of the image chain - 1.
412 # @zero: the sectors in this range read as zeros
414 # @data: reading the image will actually read data from a file (in particular,
415 # if @offset is present this means that the sectors are not simply
416 # preallocated, but contain actual data in raw format)
418 # @offset: if present, the image file stores the data for this range in
419 # raw format at the given offset.
423 { 'struct': 'BlockDeviceMapEntry',
424 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
425 'data': 'bool', '*offset': 'int' } }
428 # @DirtyBitmapStatus:
430 # An enumeration of possible states that a dirty bitmap can report to the user.
432 # @frozen: The bitmap is currently in-use by some operation and is immutable.
433 # If the bitmap was @active prior to the operation, new writes by the
434 # guest are being recorded in a temporary buffer, and will not be lost.
435 # Generally, bitmaps are cleared on successful use in an operation and
436 # the temporary buffer is committed into the bitmap. On failure, the
437 # temporary buffer is merged back into the bitmap without first
439 # Please refer to the documentation for each bitmap-using operation,
440 # See also @blockdev-backup, @drive-backup.
442 # @disabled: The bitmap is not currently recording new writes by the guest.
443 # This is requested explicitly via @block-dirty-bitmap-disable.
444 # It can still be cleared, deleted, or used for backup operations.
446 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
447 # deleted, or used for backup operations.
449 # @locked: The bitmap is currently in-use by some operation and is immutable.
450 # If the bitmap was @active prior to the operation, it is still
451 # recording new writes. If the bitmap was @disabled, it is not
452 # recording new writes. (Since 2.12)
454 # @inconsistent: This is a persistent dirty bitmap that was marked in-use on
455 # disk, and is unusable by QEMU. It can only be deleted.
456 # Please rely on the inconsistent field in @BlockDirtyInfo
457 # instead, as the status field is deprecated. (Since 4.0)
461 { 'enum': 'DirtyBitmapStatus',
462 'data': ['active', 'disabled', 'frozen', 'locked', 'inconsistent'] }
467 # Block dirty bitmap information.
469 # @name: the name of the dirty bitmap (Since 2.4)
471 # @count: number of dirty bytes according to the dirty bitmap
473 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
475 # @status: Deprecated in favor of @recording and @locked. (since 2.4)
477 # @recording: true if the bitmap is recording new writes from the guest.
478 # Replaces `active` and `disabled` statuses. (since 4.0)
480 # @busy: true if the bitmap is in-use by some operation (NBD or jobs)
481 # and cannot be modified via QMP or used by another operation.
482 # Replaces `locked` and `frozen` statuses. (since 4.0)
484 # @persistent: true if the bitmap was stored on disk, is scheduled to be stored
485 # on disk, or both. (since 4.0)
487 # @inconsistent: true if this is a persistent bitmap that was improperly
488 # stored. Implies @persistent to be true; @recording and
489 # @busy to be false. This bitmap cannot be used. To remove
490 # it, use @block-dirty-bitmap-remove. (Since 4.0)
494 { 'struct': 'BlockDirtyInfo',
495 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
496 'recording': 'bool', 'busy': 'bool', 'status': 'DirtyBitmapStatus',
497 'persistent': 'bool', '*inconsistent': 'bool' } }
500 # @Qcow2BitmapInfoFlags:
502 # An enumeration of flags that a bitmap can report to the user.
504 # @in-use: This flag is set by any process actively modifying the qcow2 file,
505 # and cleared when the updated bitmap is flushed to the qcow2 image.
506 # The presence of this flag in an offline image means that the bitmap
507 # was not saved correctly after its last usage, and may contain
510 # @auto: The bitmap must reflect all changes of the virtual disk by any
511 # application that would write to this qcow2 file.
515 { 'enum': 'Qcow2BitmapInfoFlags',
516 'data': ['in-use', 'auto'] }
521 # Qcow2 bitmap information.
523 # @name: the name of the bitmap
525 # @granularity: granularity of the bitmap in bytes
527 # @flags: flags of the bitmap
531 { 'struct': 'Qcow2BitmapInfo',
532 'data': {'name': 'str', 'granularity': 'uint32',
533 'flags': ['Qcow2BitmapInfoFlags'] } }
536 # @BlockLatencyHistogramInfo:
538 # Block latency histogram.
540 # @boundaries: list of interval boundary values in nanoseconds, all greater
541 # than zero and in ascending order.
542 # For example, the list [10, 50, 100] produces the following
543 # histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
545 # @bins: list of io request counts corresponding to histogram intervals.
546 # len(@bins) = len(@boundaries) + 1
547 # For the example above, @bins may be something like [3, 1, 5, 2],
548 # and corresponding histogram looks like:
555 # +------------------
560 { 'struct': 'BlockLatencyHistogramInfo',
561 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
564 # @block-latency-histogram-set:
566 # Manage read, write and flush latency histograms for the device.
568 # If only @id parameter is specified, remove all present latency histograms
569 # for the device. Otherwise, add/reset some of (or all) latency histograms.
571 # @id: The name or QOM path of the guest device.
573 # @boundaries: list of interval boundary values (see description in
574 # BlockLatencyHistogramInfo definition). If specified, all
575 # latency histograms are removed, and empty ones created for all
576 # io types with intervals corresponding to @boundaries (except for
577 # io types, for which specific boundaries are set through the
578 # following parameters).
580 # @boundaries-read: list of interval boundary values for read latency
581 # histogram. If specified, old read latency histogram is
582 # removed, and empty one created with intervals
583 # corresponding to @boundaries-read. The parameter has higher
584 # priority then @boundaries.
586 # @boundaries-write: list of interval boundary values for write latency
589 # @boundaries-flush: list of interval boundary values for flush latency
592 # Returns: error if device is not found or any boundary arrays are invalid.
596 # Example: set new histograms for all io types with intervals
597 # [0, 10), [10, 50), [50, 100), [100, +inf):
599 # -> { "execute": "block-latency-histogram-set",
600 # "arguments": { "id": "drive0",
601 # "boundaries": [10, 50, 100] } }
602 # <- { "return": {} }
604 # Example: set new histogram only for write, other histograms will remain
605 # not changed (or not created):
607 # -> { "execute": "block-latency-histogram-set",
608 # "arguments": { "id": "drive0",
609 # "boundaries-write": [10, 50, 100] } }
610 # <- { "return": {} }
612 # Example: set new histograms with the following intervals:
613 # read, flush: [0, 10), [10, 50), [50, 100), [100, +inf)
614 # write: [0, 1000), [1000, 5000), [5000, +inf)
616 # -> { "execute": "block-latency-histogram-set",
617 # "arguments": { "id": "drive0",
618 # "boundaries": [10, 50, 100],
619 # "boundaries-write": [1000, 5000] } }
620 # <- { "return": {} }
622 # Example: remove all latency histograms:
624 # -> { "execute": "block-latency-histogram-set",
625 # "arguments": { "id": "drive0" } }
626 # <- { "return": {} }
628 { 'command': 'block-latency-histogram-set',
629 'data': {'id': 'str',
630 '*boundaries': ['uint64'],
631 '*boundaries-read': ['uint64'],
632 '*boundaries-write': ['uint64'],
633 '*boundaries-flush': ['uint64'] } }
638 # Block device information. This structure describes a virtual device and
639 # the backing device associated with it.
641 # @device: The device name associated with the virtual device.
643 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
644 # device. (since 2.10)
646 # @type: This field is returned only for compatibility reasons, it should
647 # not be used (always returns 'unknown')
649 # @removable: True if the device supports removable media.
651 # @locked: True if the guest has locked this device from having its media
654 # @tray_open: True if the device's tray is open
655 # (only present if it has a tray)
657 # @dirty-bitmaps: dirty bitmaps information (only present if the
658 # driver has one or more dirty bitmaps) (Since 2.0)
660 # @io-status: @BlockDeviceIoStatus. Only present if the device
661 # supports it and the VM is configured to stop on errors
662 # (supported device models: virtio-blk, IDE, SCSI except
665 # @inserted: @BlockDeviceInfo describing the device if media is
670 { 'struct': 'BlockInfo',
671 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
672 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
673 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
674 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
679 # Image file size calculation information. This structure describes the size
680 # requirements for creating a new image file.
682 # The size requirements depend on the new image file format. File size always
683 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
684 # Compact formats such as 'qcow2' represent unallocated and zero regions
685 # efficiently so file size may be smaller than virtual disk size.
687 # The values are upper bounds that are guaranteed to fit the new image file.
688 # Subsequent modification, such as internal snapshot or bitmap creation, may
689 # require additional space and is not covered here.
691 # @required: Size required for a new image file, in bytes.
693 # @fully-allocated: Image file size, in bytes, once data has been written
698 { 'struct': 'BlockMeasureInfo',
699 'data': {'required': 'int', 'fully-allocated': 'int'} }
704 # Get a list of BlockInfo for all virtual block devices.
706 # Returns: a list of @BlockInfo describing each virtual block device. Filter
707 # nodes that were created implicitly are skipped over.
713 # -> { "execute": "query-block" }
718 # "device":"ide0-hd0",
725 # "file":"disks/test.qcow2",
726 # "backing_file_depth":1,
733 # "bps_max": 8000000,
740 # "detect_zeroes": "on",
741 # "write_threshold": 0,
743 # "filename":"disks/test.qcow2",
745 # "virtual-size":2048000,
746 # "backing_file":"base.qcow2",
747 # "full-backing-filename":"disks/base.qcow2",
748 # "backing-filename-format":"qcow2",
752 # "name": "snapshot1",
753 # "vm-state-size": 0,
754 # "date-sec": 10000200,
756 # "vm-clock-sec": 206,
757 # "vm-clock-nsec": 30
761 # "filename":"disks/base.qcow2",
763 # "virtual-size":2048000
767 # "qdev": "ide_disk",
772 # "device":"ide1-cd0",
775 # "qdev": "/machine/unattached/device[23]",
776 # "tray_open": false,
780 # "device":"floppy0",
783 # "qdev": "/machine/unattached/device[20]",
796 { 'command': 'query-block', 'returns': ['BlockInfo'] }
800 # @BlockDeviceTimedStats:
802 # Statistics of a block device during a given interval of time.
804 # @interval_length: Interval used for calculating the statistics,
807 # @min_rd_latency_ns: Minimum latency of read operations in the
808 # defined interval, in nanoseconds.
810 # @min_wr_latency_ns: Minimum latency of write operations in the
811 # defined interval, in nanoseconds.
813 # @min_flush_latency_ns: Minimum latency of flush operations in the
814 # defined interval, in nanoseconds.
816 # @max_rd_latency_ns: Maximum latency of read operations in the
817 # defined interval, in nanoseconds.
819 # @max_wr_latency_ns: Maximum latency of write operations in the
820 # defined interval, in nanoseconds.
822 # @max_flush_latency_ns: Maximum latency of flush operations in the
823 # defined interval, in nanoseconds.
825 # @avg_rd_latency_ns: Average latency of read operations in the
826 # defined interval, in nanoseconds.
828 # @avg_wr_latency_ns: Average latency of write operations in the
829 # defined interval, in nanoseconds.
831 # @avg_flush_latency_ns: Average latency of flush operations in the
832 # defined interval, in nanoseconds.
834 # @avg_rd_queue_depth: Average number of pending read operations
835 # in the defined interval.
837 # @avg_wr_queue_depth: Average number of pending write operations
838 # in the defined interval.
842 { 'struct': 'BlockDeviceTimedStats',
843 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
844 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
845 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
846 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
847 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
848 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
853 # Statistics of a virtual block device or a block backing device.
855 # @rd_bytes: The number of bytes read by the device.
857 # @wr_bytes: The number of bytes written by the device.
859 # @rd_operations: The number of read operations performed by the device.
861 # @wr_operations: The number of write operations performed by the device.
863 # @flush_operations: The number of cache flush operations performed by the
864 # device (since 0.15.0)
866 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
869 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
871 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
873 # @wr_highest_offset: The offset after the greatest byte written to the
874 # device. The intended use of this information is for
875 # growable sparse files (like qcow2) that are used on top
876 # of a physical device.
878 # @rd_merged: Number of read requests that have been merged into another
879 # request (Since 2.3).
881 # @wr_merged: Number of write requests that have been merged into another
882 # request (Since 2.3).
884 # @idle_time_ns: Time since the last I/O operation, in
885 # nanoseconds. If the field is absent it means that
886 # there haven't been any operations yet (Since 2.5).
888 # @failed_rd_operations: The number of failed read operations
889 # performed by the device (Since 2.5)
891 # @failed_wr_operations: The number of failed write operations
892 # performed by the device (Since 2.5)
894 # @failed_flush_operations: The number of failed flush operations
895 # performed by the device (Since 2.5)
897 # @invalid_rd_operations: The number of invalid read operations
898 # performed by the device (Since 2.5)
900 # @invalid_wr_operations: The number of invalid write operations
901 # performed by the device (Since 2.5)
903 # @invalid_flush_operations: The number of invalid flush operations
904 # performed by the device (Since 2.5)
906 # @account_invalid: Whether invalid operations are included in the
907 # last access statistics (Since 2.5)
909 # @account_failed: Whether failed operations are included in the
910 # latency and last access statistics (Since 2.5)
912 # @timed_stats: Statistics specific to the set of previously defined
913 # intervals of time (Since 2.5)
915 # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
917 # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
919 # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
923 { 'struct': 'BlockDeviceStats',
924 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
925 'wr_operations': 'int', 'flush_operations': 'int',
926 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
927 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
928 'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
929 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
930 'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
931 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
932 'account_invalid': 'bool', 'account_failed': 'bool',
933 'timed_stats': ['BlockDeviceTimedStats'],
934 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
935 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
936 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
941 # Statistics of a virtual block device or a block backing device.
943 # @device: If the stats are for a virtual block device, the name
944 # corresponding to the virtual block device.
946 # @node-name: The node name of the device. (Since 2.3)
948 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
949 # device. (since 3.0)
951 # @stats: A @BlockDeviceStats for the device.
953 # @parent: This describes the file block device if it has one.
954 # Contains recursively the statistics of the underlying
955 # protocol (e.g. the host file for a qcow2 image). If there is
956 # no underlying protocol, this field is omitted
958 # @backing: This describes the backing block device if it has one.
963 { 'struct': 'BlockStats',
964 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
965 'stats': 'BlockDeviceStats',
966 '*parent': 'BlockStats',
967 '*backing': 'BlockStats'} }
972 # Query the @BlockStats for all virtual block devices.
974 # @query-nodes: If true, the command will query all the block nodes
975 # that have a node name, in a list which will include "parent"
976 # information, but not "backing".
977 # If false or omitted, the behavior is as before - query all the
978 # device backends, recursively including their "parent" and
979 # "backing". Filter nodes that were created implicitly are
980 # skipped over in this mode. (Since 2.3)
982 # Returns: A list of @BlockStats for each virtual block devices.
988 # -> { "execute": "query-blockstats" }
992 # "device":"ide0-hd0",
995 # "wr_highest_offset":3686448128,
996 # "wr_bytes":9786368,
997 # "wr_operations":751,
998 # "rd_bytes":122567168,
999 # "rd_operations":36772
1000 # "wr_total_times_ns":313253456
1001 # "rd_total_times_ns":3465673657
1002 # "flush_total_times_ns":49653
1003 # "flush_operations":61,
1006 # "idle_time_ns":2953431879,
1007 # "account_invalid":true,
1008 # "account_failed":false
1012 # "wr_highest_offset":2821110784,
1013 # "wr_bytes":9786368,
1014 # "wr_operations":692,
1015 # "rd_bytes":122739200,
1016 # "rd_operations":36604
1017 # "flush_operations":51,
1018 # "wr_total_times_ns":313253456
1019 # "rd_total_times_ns":3465673657
1020 # "flush_total_times_ns":49653,
1023 # "idle_time_ns":2953431879,
1024 # "account_invalid":true,
1025 # "account_failed":false
1027 # "qdev": "/machine/unattached/device[23]"
1030 # "device":"ide1-cd0",
1032 # "wr_highest_offset":0,
1034 # "wr_operations":0,
1037 # "flush_operations":0,
1038 # "wr_total_times_ns":0
1039 # "rd_total_times_ns":0
1040 # "flush_total_times_ns":0,
1043 # "account_invalid":false,
1044 # "account_failed":false
1046 # "qdev": "/machine/unattached/device[24]"
1049 # "device":"floppy0",
1051 # "wr_highest_offset":0,
1053 # "wr_operations":0,
1056 # "flush_operations":0,
1057 # "wr_total_times_ns":0
1058 # "rd_total_times_ns":0
1059 # "flush_total_times_ns":0,
1062 # "account_invalid":false,
1063 # "account_failed":false
1065 # "qdev": "/machine/unattached/device[16]"
1070 # "wr_highest_offset":0,
1072 # "wr_operations":0,
1075 # "flush_operations":0,
1076 # "wr_total_times_ns":0
1077 # "rd_total_times_ns":0
1078 # "flush_total_times_ns":0,
1081 # "account_invalid":false,
1082 # "account_failed":false
1089 { 'command': 'query-blockstats',
1090 'data': { '*query-nodes': 'bool' },
1091 'returns': ['BlockStats'] }
1096 # An enumeration of possible behaviors for errors on I/O operations.
1097 # The exact meaning depends on whether the I/O was initiated by a guest
1100 # @report: for guest operations, report the error to the guest;
1101 # for jobs, cancel the job
1103 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1104 # or BLOCK_JOB_ERROR)
1106 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1108 # @stop: for guest operations, stop the virtual machine;
1109 # for jobs, pause the job
1111 # @auto: inherit the error handling policy of the backend (since: 2.7)
1115 { 'enum': 'BlockdevOnError',
1116 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1121 # An enumeration of possible behaviors for the initial synchronization
1122 # phase of storage mirroring.
1124 # @top: copies data in the topmost image to the destination
1126 # @full: copies data from all images to the destination
1128 # @none: only copy data written from now on
1130 # @incremental: only copy data described by the dirty bitmap. (since: 2.4)
1132 # @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
1133 # Behavior on completion is determined by the BitmapSyncMode.
1137 { 'enum': 'MirrorSyncMode',
1138 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1143 # An enumeration of possible behaviors for the synchronization of a bitmap
1144 # when used for data copy operations.
1146 # @on-success: The bitmap is only synced when the operation is successful.
1147 # This is the behavior always used for 'INCREMENTAL' backups.
1149 # @never: The bitmap is never synchronized with the operation, and is
1150 # treated solely as a read-only manifest of blocks to copy.
1154 { 'enum': 'BitmapSyncMode',
1155 'data': ['on-success', 'never'] }
1160 # An enumeration whose values tell the mirror block job when to
1161 # trigger writes to the target.
1163 # @background: copy data in background only.
1165 # @write-blocking: when data is written to the source, write it
1166 # (synchronously) to the target as well. In
1167 # addition, data is copied in background just like in
1172 { 'enum': 'MirrorCopyMode',
1173 'data': ['background', 'write-blocking'] }
1178 # Information about a long-running block device operation.
1180 # @type: the job type ('stream' for image streaming)
1182 # @device: The job identifier. Originally the device name but other
1183 # values are allowed since QEMU 2.7
1185 # @len: Estimated @offset value at the completion of the job. This value can
1186 # arbitrarily change while the job is running, in both directions.
1188 # @offset: Progress made until now. The unit is arbitrary and the value can
1189 # only meaningfully be used for the ratio of @offset to @len. The
1190 # value is monotonically increasing.
1192 # @busy: false if the job is known to be in a quiescent state, with
1193 # no pending I/O. Since 1.3.
1195 # @paused: whether the job is paused or, if @busy is true, will
1196 # pause itself as soon as possible. Since 1.3.
1198 # @speed: the rate limit, bytes per second
1200 # @io-status: the status of the job (since 1.3)
1202 # @ready: true if the job may be completed (since 2.2)
1204 # @status: Current job state/status (since 2.12)
1206 # @auto-finalize: Job will finalize itself when PENDING, moving to
1207 # the CONCLUDED state. (since 2.12)
1209 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1210 # state and disappearing from the query list. (since 2.12)
1212 # @error: Error information if the job did not complete successfully.
1213 # Not set if the job completed successfully. (since 2.12.1)
1217 { 'struct': 'BlockJobInfo',
1218 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1219 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1220 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1221 'status': 'JobStatus',
1222 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1226 # @query-block-jobs:
1228 # Return information about long-running block device operations.
1230 # Returns: a list of @BlockJobInfo for each active block job
1234 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1239 # This command sets the password of a block device that has not been open
1240 # with a password and requires one.
1242 # This command is now obsolete and will always return an error since 2.10
1245 { 'command': 'block_passwd',
1246 'data': { '*device': 'str',
1247 '*node-name': 'str',
1248 'password': 'str' } }
1253 # Resize a block image while a guest is running.
1255 # Either @device or @node-name must be set but not both.
1257 # @device: the name of the device to get the image resized
1259 # @node-name: graph node name to get the image resized (Since 2.0)
1261 # @size: new image size in bytes
1263 # Returns: nothing on success
1264 # If @device is not a valid block device, DeviceNotFound
1270 # -> { "execute": "block_resize",
1271 # "arguments": { "device": "scratch", "size": 1073741824 } }
1272 # <- { "return": {} }
1275 { 'command': 'block_resize',
1276 'data': { '*device': 'str',
1277 '*node-name': 'str',
1283 # An enumeration that tells QEMU how to set the backing file path in
1286 # @existing: QEMU should look for an existing image file.
1288 # @absolute-paths: QEMU should create a new image with absolute paths
1289 # for the backing file. If there is no backing file available, the new
1290 # image will not be backed either.
1294 { 'enum': 'NewImageMode',
1295 'data': [ 'existing', 'absolute-paths' ] }
1298 # @BlockdevSnapshotSync:
1300 # Either @device or @node-name must be set but not both.
1302 # @device: the name of the device to take a snapshot of.
1304 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1306 # @snapshot-file: the target of the new overlay image. If the file
1307 # exists, or if it is a device, the overlay will be created in the
1308 # existing file/device. Otherwise, a new file will be created.
1310 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1312 # @format: the format of the overlay image, default is 'qcow2'.
1314 # @mode: whether and how QEMU should create a new image, default is
1317 { 'struct': 'BlockdevSnapshotSync',
1318 'data': { '*device': 'str', '*node-name': 'str',
1319 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1320 '*format': 'str', '*mode': 'NewImageMode' } }
1323 # @BlockdevSnapshot:
1325 # @node: device or node name that will have a snapshot taken.
1327 # @overlay: reference to the existing block device that will become
1328 # the overlay of @node, as part of taking the snapshot.
1329 # It must not have a current backing file (this can be
1330 # achieved by passing "backing": null to blockdev-add).
1334 { 'struct': 'BlockdevSnapshot',
1335 'data': { 'node': 'str', 'overlay': 'str' } }
1340 # @job-id: identifier for the newly-created block job. If
1341 # omitted, the device name will be used. (Since 2.7)
1343 # @device: the device name or node-name of a root node which should be copied.
1345 # @sync: what parts of the disk image should be copied to the destination
1346 # (all the disk, only the sectors allocated in the topmost image, from a
1347 # dirty bitmap, or only new I/O).
1349 # @speed: the maximum speed, in bytes per second. The default is 0,
1352 # @bitmap: the name of a dirty bitmap if sync is "bitmap" or "incremental".
1353 # Must be present if sync is "bitmap" or "incremental".
1354 # Must not be present otherwise.
1355 # (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1357 # @bitmap-mode: Specifies the type of data the bitmap should contain after
1358 # the operation concludes. Must be present if sync is "bitmap".
1359 # Must NOT be present otherwise. (Since 4.2)
1361 # @compress: true to compress data, if the target format supports it.
1362 # (default: false) (since 2.8)
1364 # @on-source-error: the action to take on an error on the source,
1365 # default 'report'. 'stop' and 'enospc' can only be used
1366 # if the block device supports io-status (see BlockInfo).
1368 # @on-target-error: the action to take on an error on the target,
1369 # default 'report' (no limitations, since this applies to
1370 # a different block device than @device).
1372 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1373 # finished its work, waiting for @block-job-finalize before
1374 # making any block graph changes.
1375 # When true, this job will automatically
1376 # perform its abort or commit actions.
1377 # Defaults to true. (Since 2.12)
1379 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1380 # has completely ceased all work, and awaits @block-job-dismiss.
1381 # When true, this job will automatically disappear from the query
1382 # list without user intervention.
1383 # Defaults to true. (Since 2.12)
1385 # Note: @on-source-error and @on-target-error only affect background
1386 # I/O. If an error occurs during a guest write request, the device's
1387 # rerror/werror actions will be used.
1391 { 'struct': 'BackupCommon',
1392 'data': { '*job-id': 'str', 'device': 'str',
1393 'sync': 'MirrorSyncMode', '*speed': 'int',
1394 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1395 '*compress': 'bool',
1396 '*on-source-error': 'BlockdevOnError',
1397 '*on-target-error': 'BlockdevOnError',
1398 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1403 # @target: the target of the new image. If the file exists, or if it
1404 # is a device, the existing file/device will be used as the new
1405 # destination. If it does not exist, a new file will be created.
1407 # @format: the format of the new destination, default is to
1408 # probe if @mode is 'existing', else the format of the source
1410 # @mode: whether and how QEMU should create a new image, default is
1415 { 'struct': 'DriveBackup',
1416 'base': 'BackupCommon',
1417 'data': { 'target': 'str',
1419 '*mode': 'NewImageMode' } }
1424 # @target: the device name or node-name of the backup target node.
1428 { 'struct': 'BlockdevBackup',
1429 'base': 'BackupCommon',
1430 'data': { 'target': 'str' } }
1433 # @blockdev-snapshot-sync:
1435 # Takes a synchronous snapshot of a block device.
1437 # For the arguments, see the documentation of BlockdevSnapshotSync.
1439 # Returns: nothing on success
1440 # If @device is not a valid block device, DeviceNotFound
1446 # -> { "execute": "blockdev-snapshot-sync",
1447 # "arguments": { "device": "ide-hd0",
1449 # "/some/place/my-image",
1450 # "format": "qcow2" } }
1451 # <- { "return": {} }
1454 { 'command': 'blockdev-snapshot-sync',
1455 'data': 'BlockdevSnapshotSync' }
1459 # @blockdev-snapshot:
1461 # Takes a snapshot of a block device.
1463 # Take a snapshot, by installing 'node' as the backing image of
1464 # 'overlay'. Additionally, if 'node' is associated with a block
1465 # device, the block device changes to using 'overlay' as its new active
1468 # For the arguments, see the documentation of BlockdevSnapshot.
1474 # -> { "execute": "blockdev-add",
1475 # "arguments": { "driver": "qcow2",
1476 # "node-name": "node1534",
1477 # "file": { "driver": "file",
1478 # "filename": "hd1.qcow2" },
1479 # "backing": null } }
1481 # <- { "return": {} }
1483 # -> { "execute": "blockdev-snapshot",
1484 # "arguments": { "node": "ide-hd0",
1485 # "overlay": "node1534" } }
1486 # <- { "return": {} }
1489 { 'command': 'blockdev-snapshot',
1490 'data': 'BlockdevSnapshot' }
1493 # @change-backing-file:
1495 # Change the backing file in the image file metadata. This does not
1496 # cause QEMU to reopen the image file to reparse the backing filename
1497 # (it may, however, perform a reopen to change permissions from
1498 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1499 # into the image file metadata, and the QEMU internal strings are
1502 # @image-node-name: The name of the block driver state node of the
1503 # image to modify. The "device" argument is used
1504 # to verify "image-node-name" is in the chain
1505 # described by "device".
1507 # @device: The device name or node-name of the root node that owns
1510 # @backing-file: The string to write as the backing file. This
1511 # string is not validated, so care should be taken
1512 # when specifying the string or the image chain may
1513 # not be able to be reopened again.
1515 # Returns: Nothing on success
1517 # If "device" does not exist or cannot be determined, DeviceNotFound
1521 { 'command': 'change-backing-file',
1522 'data': { 'device': 'str', 'image-node-name': 'str',
1523 'backing-file': 'str' } }
1528 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1529 # writes data between 'top' and 'base' into 'base'.
1531 # @job-id: identifier for the newly-created block job. If
1532 # omitted, the device name will be used. (Since 2.7)
1534 # @device: the device name or node-name of a root node
1536 # @base-node: The node name of the backing image to write data into.
1537 # If not specified, this is the deepest backing image.
1540 # @base: Same as @base-node, except that it is a file name rather than a node
1541 # name. This must be the exact filename string that was used to open the
1542 # node; other strings, even if addressing the same file, are not
1543 # accepted (deprecated, use @base-node instead)
1545 # @top-node: The node name of the backing image within the image chain
1546 # which contains the topmost data to be committed down. If
1547 # not specified, this is the active layer. (since: 3.1)
1549 # @top: Same as @top-node, except that it is a file name rather than a node
1550 # name. This must be the exact filename string that was used to open the
1551 # node; other strings, even if addressing the same file, are not
1552 # accepted (deprecated, use @base-node instead)
1554 # @backing-file: The backing file string to write into the overlay
1555 # image of 'top'. If 'top' is the active layer,
1556 # specifying a backing file string is an error. This
1557 # filename is not validated.
1559 # If a pathname string is such that it cannot be
1560 # resolved by QEMU, that means that subsequent QMP or
1561 # HMP commands must use node-names for the image in
1562 # question, as filename lookup methods will fail.
1564 # If not specified, QEMU will automatically determine
1565 # the backing file string to use, or error out if
1566 # there is no obvious choice. Care should be taken
1567 # when specifying the string, to specify a valid
1568 # filename or protocol.
1571 # If top == base, that is an error.
1572 # If top == active, the job will not be completed by itself,
1573 # user needs to complete the job with the block-job-complete
1574 # command after getting the ready event. (Since 2.0)
1576 # If the base image is smaller than top, then the base image
1577 # will be resized to be the same size as top. If top is
1578 # smaller than the base image, the base will not be
1579 # truncated. If you want the base image size to match the
1580 # size of the smaller top, you can safely truncate it
1581 # yourself once the commit operation successfully completes.
1583 # @speed: the maximum speed, in bytes per second
1585 # @filter-node-name: the node name that should be assigned to the
1586 # filter driver that the commit job inserts into the graph
1587 # above @top. If this option is not given, a node name is
1588 # autogenerated. (Since: 2.9)
1590 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1591 # finished its work, waiting for @block-job-finalize before
1592 # making any block graph changes.
1593 # When true, this job will automatically
1594 # perform its abort or commit actions.
1595 # Defaults to true. (Since 3.1)
1597 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1598 # has completely ceased all work, and awaits @block-job-dismiss.
1599 # When true, this job will automatically disappear from the query
1600 # list without user intervention.
1601 # Defaults to true. (Since 3.1)
1603 # Returns: Nothing on success
1604 # If @device does not exist, DeviceNotFound
1605 # Any other error returns a GenericError.
1611 # -> { "execute": "block-commit",
1612 # "arguments": { "device": "virtio0",
1613 # "top": "/tmp/snap1.qcow2" } }
1614 # <- { "return": {} }
1617 { 'command': 'block-commit',
1618 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1619 '*base': 'str', '*top-node': 'str', '*top': 'str',
1620 '*backing-file': 'str', '*speed': 'int',
1621 '*filter-node-name': 'str',
1622 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1627 # Start a point-in-time copy of a block device to a new destination. The
1628 # status of ongoing drive-backup operations can be checked with
1629 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1630 # The operation can be stopped before it has completed using the
1631 # block-job-cancel command.
1633 # Returns: nothing on success
1634 # If @device is not a valid block device, GenericError
1640 # -> { "execute": "drive-backup",
1641 # "arguments": { "device": "drive0",
1643 # "target": "backup.img" } }
1644 # <- { "return": {} }
1647 { 'command': 'drive-backup', 'boxed': true,
1648 'data': 'DriveBackup' }
1653 # Start a point-in-time copy of a block device to a new destination. The
1654 # status of ongoing blockdev-backup operations can be checked with
1655 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1656 # The operation can be stopped before it has completed using the
1657 # block-job-cancel command.
1659 # Returns: nothing on success
1660 # If @device is not a valid block device, DeviceNotFound
1665 # -> { "execute": "blockdev-backup",
1666 # "arguments": { "device": "src-id",
1668 # "target": "tgt-id" } }
1669 # <- { "return": {} }
1672 { 'command': 'blockdev-backup', 'boxed': true,
1673 'data': 'BlockdevBackup' }
1677 # @query-named-block-nodes:
1679 # Get the named block driver list
1681 # Returns: the list of BlockDeviceInfo
1687 # -> { "execute": "query-named-block-nodes" }
1688 # <- { "return": [ { "ro":false,
1690 # "encrypted":false,
1691 # "file":"disks/test.qcow2",
1692 # "node-name": "my-node",
1693 # "backing_file_depth":1,
1700 # "bps_max": 8000000,
1707 # "write_threshold": 0,
1709 # "filename":"disks/test.qcow2",
1711 # "virtual-size":2048000,
1712 # "backing_file":"base.qcow2",
1713 # "full-backing-filename":"disks/base.qcow2",
1714 # "backing-filename-format":"qcow2",
1718 # "name": "snapshot1",
1719 # "vm-state-size": 0,
1720 # "date-sec": 10000200,
1722 # "vm-clock-sec": 206,
1723 # "vm-clock-nsec": 30
1727 # "filename":"disks/base.qcow2",
1729 # "virtual-size":2048000
1734 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1737 # @XDbgBlockGraphNodeType:
1739 # @block-backend: corresponds to BlockBackend
1741 # @block-job: corresonds to BlockJob
1743 # @block-driver: corresponds to BlockDriverState
1747 { 'enum': 'XDbgBlockGraphNodeType',
1748 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1751 # @XDbgBlockGraphNode:
1753 # @id: Block graph node identifier. This @id is generated only for
1754 # x-debug-query-block-graph and does not relate to any other identifiers in
1757 # @type: Type of graph node. Can be one of block-backend, block-job or
1758 # block-driver-state.
1760 # @name: Human readable name of the node. Corresponds to node-name for
1761 # block-driver-state nodes; is not guaranteed to be unique in the whole
1762 # graph (with block-jobs and block-backends).
1766 { 'struct': 'XDbgBlockGraphNode',
1767 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1772 # Enum of base block permissions.
1774 # @consistent-read: A user that has the "permission" of consistent reads is
1775 # guaranteed that their view of the contents of the block
1776 # device is complete and self-consistent, representing the
1777 # contents of a disk at a specific point.
1778 # For most block devices (including their backing files) this
1779 # is true, but the property cannot be maintained in a few
1780 # situations like for intermediate nodes of a commit block
1783 # @write: This permission is required to change the visible disk contents.
1785 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1786 # both enough and required for writes to the block node when
1787 # the caller promises that the visible disk content doesn't
1789 # As the BLK_PERM_WRITE permission is strictly stronger,
1790 # either is sufficient to perform an unchanging write.
1792 # @resize: This permission is required to change the size of a block node.
1794 # @graph-mod: This permission is required to change the node that this
1795 # BdrvChild points to.
1799 { 'enum': 'BlockPermission',
1800 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
1803 # @XDbgBlockGraphEdge:
1805 # Block Graph edge description for x-debug-query-block-graph.
1807 # @parent: parent id
1811 # @name: name of the relation (examples are 'file' and 'backing')
1813 # @perm: granted permissions for the parent operating on the child
1815 # @shared-perm: permissions that can still be granted to other users of the
1816 # child while it is still attached to this parent
1820 { 'struct': 'XDbgBlockGraphEdge',
1821 'data': { 'parent': 'uint64', 'child': 'uint64',
1822 'name': 'str', 'perm': [ 'BlockPermission' ],
1823 'shared-perm': [ 'BlockPermission' ] } }
1828 # Block Graph - list of nodes and list of edges.
1832 { 'struct': 'XDbgBlockGraph',
1833 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1836 # @x-debug-query-block-graph:
1838 # Get the block graph.
1842 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph' }
1847 # Start mirroring a block device's writes to a new destination. target
1848 # specifies the target of the new image. If the file exists, or if it
1849 # is a device, it will be used as the new destination for writes. If
1850 # it does not exist, a new file will be created. format specifies the
1851 # format of the mirror image, default is to probe if mode='existing',
1852 # else the format of the source.
1854 # Returns: nothing on success
1855 # If @device is not a valid block device, GenericError
1861 # -> { "execute": "drive-mirror",
1862 # "arguments": { "device": "ide-hd0",
1863 # "target": "/some/place/my-image",
1865 # "format": "qcow2" } }
1866 # <- { "return": {} }
1869 { 'command': 'drive-mirror', 'boxed': true,
1870 'data': 'DriveMirror' }
1875 # A set of parameters describing drive mirror setup.
1877 # @job-id: identifier for the newly-created block job. If
1878 # omitted, the device name will be used. (Since 2.7)
1880 # @device: the device name or node-name of a root node whose writes should be
1883 # @target: the target of the new image. If the file exists, or if it
1884 # is a device, the existing file/device will be used as the new
1885 # destination. If it does not exist, a new file will be created.
1887 # @format: the format of the new destination, default is to
1888 # probe if @mode is 'existing', else the format of the source
1890 # @node-name: the new block driver state node name in the graph
1893 # @replaces: with sync=full graph node name to be replaced by the new
1894 # image when a whole image copy is done. This can be used to repair
1895 # broken Quorum files. (Since 2.1)
1897 # @mode: whether and how QEMU should create a new image, default is
1900 # @speed: the maximum speed, in bytes per second
1902 # @sync: what parts of the disk image should be copied to the destination
1903 # (all the disk, only the sectors allocated in the topmost image, or
1906 # @granularity: granularity of the dirty bitmap, default is 64K
1907 # if the image format doesn't have clusters, 4K if the clusters
1908 # are smaller than that, else the cluster size. Must be a
1909 # power of 2 between 512 and 64M (since 1.4).
1911 # @buf-size: maximum amount of data in flight from source to
1912 # target (since 1.4).
1914 # @on-source-error: the action to take on an error on the source,
1915 # default 'report'. 'stop' and 'enospc' can only be used
1916 # if the block device supports io-status (see BlockInfo).
1918 # @on-target-error: the action to take on an error on the target,
1919 # default 'report' (no limitations, since this applies to
1920 # a different block device than @device).
1921 # @unmap: Whether to try to unmap target sectors where source has
1922 # only zero. If true, and target unallocated sectors will read as zero,
1923 # target image sectors will be unmapped; otherwise, zeroes will be
1924 # written. Both will result in identical contents.
1925 # Default is true. (Since 2.4)
1927 # @copy-mode: when to copy data to the destination; defaults to 'background'
1930 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1931 # finished its work, waiting for @block-job-finalize before
1932 # making any block graph changes.
1933 # When true, this job will automatically
1934 # perform its abort or commit actions.
1935 # Defaults to true. (Since 3.1)
1937 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1938 # has completely ceased all work, and awaits @block-job-dismiss.
1939 # When true, this job will automatically disappear from the query
1940 # list without user intervention.
1941 # Defaults to true. (Since 3.1)
1944 { 'struct': 'DriveMirror',
1945 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1946 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1947 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1948 '*speed': 'int', '*granularity': 'uint32',
1949 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1950 '*on-target-error': 'BlockdevOnError',
1951 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
1952 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1955 # @BlockDirtyBitmap:
1957 # @node: name of device/node which the bitmap is tracking
1959 # @name: name of the dirty bitmap
1963 { 'struct': 'BlockDirtyBitmap',
1964 'data': { 'node': 'str', 'name': 'str' } }
1967 # @BlockDirtyBitmapAdd:
1969 # @node: name of device/node which the bitmap is tracking
1971 # @name: name of the dirty bitmap
1973 # @granularity: the bitmap granularity, default is 64k for
1974 # block-dirty-bitmap-add
1976 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1977 # corresponding block device image file on its close. For now only
1978 # Qcow2 disks support persistent bitmaps. Default is false for
1979 # block-dirty-bitmap-add. (Since: 2.10)
1981 # @autoload: ignored and deprecated since 2.12.
1982 # Currently, all dirty tracking bitmaps are loaded from Qcow2 on
1985 # @disabled: the bitmap is created in the disabled state, which means that
1986 # it will not track drive changes. The bitmap may be enabled with
1987 # block-dirty-bitmap-enable. Default is false. (Since: 4.0)
1991 { 'struct': 'BlockDirtyBitmapAdd',
1992 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1993 '*persistent': 'bool', '*autoload': 'bool', '*disabled': 'bool' } }
1996 # @BlockDirtyBitmapMergeSource:
1998 # @local: name of the bitmap, attached to the same node as target bitmap.
2000 # @external: bitmap with specified node
2004 { 'alternate': 'BlockDirtyBitmapMergeSource',
2005 'data': { 'local': 'str',
2006 'external': 'BlockDirtyBitmap' } }
2009 # @BlockDirtyBitmapMerge:
2011 # @node: name of device/node which the @target bitmap is tracking
2013 # @target: name of the destination dirty bitmap
2015 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully
2016 # specifed BlockDirtyBitmap elements. The latter are supported
2021 { 'struct': 'BlockDirtyBitmapMerge',
2022 'data': { 'node': 'str', 'target': 'str',
2023 'bitmaps': ['BlockDirtyBitmapMergeSource'] } }
2026 # @block-dirty-bitmap-add:
2028 # Create a dirty bitmap with a name on the node, and start tracking the writes.
2030 # Returns: nothing on success
2031 # If @node is not a valid block device or node, DeviceNotFound
2032 # If @name is already taken, GenericError with an explanation
2038 # -> { "execute": "block-dirty-bitmap-add",
2039 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2040 # <- { "return": {} }
2043 { 'command': 'block-dirty-bitmap-add',
2044 'data': 'BlockDirtyBitmapAdd' }
2047 # @block-dirty-bitmap-remove:
2049 # Stop write tracking and remove the dirty bitmap that was created
2050 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2053 # Returns: nothing on success
2054 # If @node is not a valid block device or node, DeviceNotFound
2055 # If @name is not found, GenericError with an explanation
2056 # if @name is frozen by an operation, GenericError
2062 # -> { "execute": "block-dirty-bitmap-remove",
2063 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2064 # <- { "return": {} }
2067 { 'command': 'block-dirty-bitmap-remove',
2068 'data': 'BlockDirtyBitmap' }
2071 # @block-dirty-bitmap-clear:
2073 # Clear (reset) a dirty bitmap on the device, so that an incremental
2074 # backup from this point in time forward will only backup clusters
2075 # modified after this clear operation.
2077 # Returns: nothing on success
2078 # If @node is not a valid block device, DeviceNotFound
2079 # If @name is not found, GenericError with an explanation
2085 # -> { "execute": "block-dirty-bitmap-clear",
2086 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2087 # <- { "return": {} }
2090 { 'command': 'block-dirty-bitmap-clear',
2091 'data': 'BlockDirtyBitmap' }
2094 # @block-dirty-bitmap-enable:
2096 # Enables a dirty bitmap so that it will begin tracking disk changes.
2098 # Returns: nothing on success
2099 # If @node is not a valid block device, DeviceNotFound
2100 # If @name is not found, GenericError with an explanation
2106 # -> { "execute": "block-dirty-bitmap-enable",
2107 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2108 # <- { "return": {} }
2111 { 'command': 'block-dirty-bitmap-enable',
2112 'data': 'BlockDirtyBitmap' }
2115 # @block-dirty-bitmap-disable:
2117 # Disables a dirty bitmap so that it will stop tracking disk changes.
2119 # Returns: nothing on success
2120 # If @node is not a valid block device, DeviceNotFound
2121 # If @name is not found, GenericError with an explanation
2127 # -> { "execute": "block-dirty-bitmap-disable",
2128 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2129 # <- { "return": {} }
2132 { 'command': 'block-dirty-bitmap-disable',
2133 'data': 'BlockDirtyBitmap' }
2136 # @block-dirty-bitmap-merge:
2138 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2139 # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2140 # as the @target bitmap. Any bits already set in @target will still be
2141 # set after the merge, i.e., this operation does not clear the target.
2142 # On error, @target is unchanged.
2144 # The resulting bitmap will count as dirty any clusters that were dirty in any
2145 # of the source bitmaps. This can be used to achieve backup checkpoints, or in
2146 # simpler usages, to copy bitmaps.
2148 # Returns: nothing on success
2149 # If @node is not a valid block device, DeviceNotFound
2150 # If any bitmap in @bitmaps or @target is not found, GenericError
2151 # If any of the bitmaps have different sizes or granularities,
2158 # -> { "execute": "block-dirty-bitmap-merge",
2159 # "arguments": { "node": "drive0", "target": "bitmap0",
2160 # "bitmaps": ["bitmap1"] } }
2161 # <- { "return": {} }
2164 { 'command': 'block-dirty-bitmap-merge',
2165 'data': 'BlockDirtyBitmapMerge' }
2168 # @BlockDirtyBitmapSha256:
2170 # SHA256 hash of dirty bitmap data
2172 # @sha256: ASCII representation of SHA256 bitmap hash
2176 { 'struct': 'BlockDirtyBitmapSha256',
2177 'data': {'sha256': 'str'} }
2180 # @x-debug-block-dirty-bitmap-sha256:
2182 # Get bitmap SHA256.
2184 # Returns: BlockDirtyBitmapSha256 on success
2185 # If @node is not a valid block device, DeviceNotFound
2186 # If @name is not found or if hashing has failed, GenericError with an
2191 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2192 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
2197 # Start mirroring a block device's writes to a new destination.
2199 # @job-id: identifier for the newly-created block job. If
2200 # omitted, the device name will be used. (Since 2.7)
2202 # @device: The device name or node-name of a root node whose writes should be
2205 # @target: the id or node-name of the block device to mirror to. This mustn't be
2206 # attached to guest.
2208 # @replaces: with sync=full graph node name to be replaced by the new
2209 # image when a whole image copy is done. This can be used to repair
2210 # broken Quorum files.
2212 # @speed: the maximum speed, in bytes per second
2214 # @sync: what parts of the disk image should be copied to the destination
2215 # (all the disk, only the sectors allocated in the topmost image, or
2218 # @granularity: granularity of the dirty bitmap, default is 64K
2219 # if the image format doesn't have clusters, 4K if the clusters
2220 # are smaller than that, else the cluster size. Must be a
2221 # power of 2 between 512 and 64M
2223 # @buf-size: maximum amount of data in flight from source to
2226 # @on-source-error: the action to take on an error on the source,
2227 # default 'report'. 'stop' and 'enospc' can only be used
2228 # if the block device supports io-status (see BlockInfo).
2230 # @on-target-error: the action to take on an error on the target,
2231 # default 'report' (no limitations, since this applies to
2232 # a different block device than @device).
2234 # @filter-node-name: the node name that should be assigned to the
2235 # filter driver that the mirror job inserts into the graph
2236 # above @device. If this option is not given, a node name is
2237 # autogenerated. (Since: 2.9)
2239 # @copy-mode: when to copy data to the destination; defaults to 'background'
2242 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2243 # finished its work, waiting for @block-job-finalize before
2244 # making any block graph changes.
2245 # When true, this job will automatically
2246 # perform its abort or commit actions.
2247 # Defaults to true. (Since 3.1)
2249 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2250 # has completely ceased all work, and awaits @block-job-dismiss.
2251 # When true, this job will automatically disappear from the query
2252 # list without user intervention.
2253 # Defaults to true. (Since 3.1)
2254 # Returns: nothing on success.
2260 # -> { "execute": "blockdev-mirror",
2261 # "arguments": { "device": "ide-hd0",
2262 # "target": "target0",
2263 # "sync": "full" } }
2264 # <- { "return": {} }
2267 { 'command': 'blockdev-mirror',
2268 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2270 'sync': 'MirrorSyncMode',
2271 '*speed': 'int', '*granularity': 'uint32',
2272 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2273 '*on-target-error': 'BlockdevOnError',
2274 '*filter-node-name': 'str',
2275 '*copy-mode': 'MirrorCopyMode',
2276 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2279 # @block_set_io_throttle:
2281 # Change I/O throttle limits for a block drive.
2283 # Since QEMU 2.4, each device with I/O limits is member of a throttle
2286 # If two or more devices are members of the same group, the limits
2287 # will apply to the combined I/O of the whole group in a round-robin
2288 # fashion. Therefore, setting new I/O limits to a device will affect
2291 # The name of the group can be specified using the 'group' parameter.
2292 # If the parameter is unset, it is assumed to be the current group of
2293 # that device. If it's not in any group yet, the name of the device
2294 # will be used as the name for its group.
2296 # The 'group' parameter can also be used to move a device to a
2297 # different group. In this case the limits specified in the parameters
2298 # will be applied to the new group only.
2300 # I/O limits can be disabled by setting all of them to 0. In this case
2301 # the device will be removed from its group and the rest of its
2302 # members will not be affected. The 'group' parameter is ignored.
2304 # Returns: Nothing on success
2305 # If @device is not a valid block device, DeviceNotFound
2311 # -> { "execute": "block_set_io_throttle",
2312 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
2325 # "bps_max_length": 0,
2326 # "iops_size": 0 } }
2327 # <- { "return": {} }
2329 # -> { "execute": "block_set_io_throttle",
2330 # "arguments": { "id": "ide0-1-0",
2337 # "bps_max": 8000000,
2343 # "bps_max_length": 60,
2344 # "iops_size": 0 } }
2345 # <- { "return": {} }
2347 { 'command': 'block_set_io_throttle', 'boxed': true,
2348 'data': 'BlockIOThrottle' }
2353 # A set of parameters describing block throttling.
2355 # @device: Block device name (deprecated, use @id instead)
2357 # @id: The name or QOM path of the guest device (since: 2.8)
2359 # @bps: total throughput limit in bytes per second
2361 # @bps_rd: read throughput limit in bytes per second
2363 # @bps_wr: write throughput limit in bytes per second
2365 # @iops: total I/O operations per second
2367 # @iops_rd: read I/O operations per second
2369 # @iops_wr: write I/O operations per second
2371 # @bps_max: total throughput limit during bursts,
2372 # in bytes (Since 1.7)
2374 # @bps_rd_max: read throughput limit during bursts,
2375 # in bytes (Since 1.7)
2377 # @bps_wr_max: write throughput limit during bursts,
2378 # in bytes (Since 1.7)
2380 # @iops_max: total I/O operations per second during bursts,
2381 # in bytes (Since 1.7)
2383 # @iops_rd_max: read I/O operations per second during bursts,
2384 # in bytes (Since 1.7)
2386 # @iops_wr_max: write I/O operations per second during bursts,
2387 # in bytes (Since 1.7)
2389 # @bps_max_length: maximum length of the @bps_max burst
2390 # period, in seconds. It must only
2391 # be set if @bps_max is set as well.
2392 # Defaults to 1. (Since 2.6)
2394 # @bps_rd_max_length: maximum length of the @bps_rd_max
2395 # burst period, in seconds. It must only
2396 # be set if @bps_rd_max is set as well.
2397 # Defaults to 1. (Since 2.6)
2399 # @bps_wr_max_length: maximum length of the @bps_wr_max
2400 # burst period, in seconds. It must only
2401 # be set if @bps_wr_max is set as well.
2402 # Defaults to 1. (Since 2.6)
2404 # @iops_max_length: maximum length of the @iops burst
2405 # period, in seconds. It must only
2406 # be set if @iops_max is set as well.
2407 # Defaults to 1. (Since 2.6)
2409 # @iops_rd_max_length: maximum length of the @iops_rd_max
2410 # burst period, in seconds. It must only
2411 # be set if @iops_rd_max is set as well.
2412 # Defaults to 1. (Since 2.6)
2414 # @iops_wr_max_length: maximum length of the @iops_wr_max
2415 # burst period, in seconds. It must only
2416 # be set if @iops_wr_max is set as well.
2417 # Defaults to 1. (Since 2.6)
2419 # @iops_size: an I/O size in bytes (Since 1.7)
2421 # @group: throttle group name (Since 2.4)
2425 { 'struct': 'BlockIOThrottle',
2426 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2427 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2428 '*bps_max': 'int', '*bps_rd_max': 'int',
2429 '*bps_wr_max': 'int', '*iops_max': 'int',
2430 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2431 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2432 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2433 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2434 '*iops_size': 'int', '*group': 'str' } }
2439 # Limit parameters for throttling.
2440 # Since some limit combinations are illegal, limits should always be set in one
2441 # transaction. All fields are optional. When setting limits, if a field is
2442 # missing the current value is not changed.
2444 # @iops-total: limit total I/O operations per second
2445 # @iops-total-max: I/O operations burst
2446 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2447 # It must only be set if @iops-total-max is set as well.
2448 # @iops-read: limit read operations per second
2449 # @iops-read-max: I/O operations read burst
2450 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2451 # It must only be set if @iops-read-max is set as well.
2452 # @iops-write: limit write operations per second
2453 # @iops-write-max: I/O operations write burst
2454 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2455 # It must only be set if @iops-write-max is set as well.
2456 # @bps-total: limit total bytes per second
2457 # @bps-total-max: total bytes burst
2458 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2459 # It must only be set if @bps-total-max is set as well.
2460 # @bps-read: limit read bytes per second
2461 # @bps-read-max: total bytes read burst
2462 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2463 # It must only be set if @bps-read-max is set as well.
2464 # @bps-write: limit write bytes per second
2465 # @bps-write-max: total bytes write burst
2466 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2467 # It must only be set if @bps-write-max is set as well.
2468 # @iops-size: when limiting by iops max size of an I/O in bytes
2472 { 'struct': 'ThrottleLimits',
2473 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2474 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2475 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2476 '*iops-write' : 'int', '*iops-write-max' : 'int',
2477 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2478 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2479 '*bps-read' : 'int', '*bps-read-max' : 'int',
2480 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2481 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2482 '*iops-size' : 'int' } }
2487 # Copy data from a backing file into a block device.
2489 # The block streaming operation is performed in the background until the entire
2490 # backing file has been copied. This command returns immediately once streaming
2491 # has started. The status of ongoing block streaming operations can be checked
2492 # with query-block-jobs. The operation can be stopped before it has completed
2493 # using the block-job-cancel command.
2495 # The node that receives the data is called the top image, can be located in
2496 # any part of the chain (but always above the base image; see below) and can be
2497 # specified using its device or node name. Earlier qemu versions only allowed
2498 # 'device' to name the top level node; presence of the 'base-node' parameter
2499 # during introspection can be used as a witness of the enhanced semantics
2502 # If a base file is specified then sectors are not copied from that base file and
2503 # its backing chain. When streaming completes the image file will have the base
2504 # file as its backing file. This can be used to stream a subset of the backing
2505 # file chain instead of flattening the entire image.
2507 # On successful completion the image file is updated to drop the backing file
2508 # and the BLOCK_JOB_COMPLETED event is emitted.
2510 # @job-id: identifier for the newly-created block job. If
2511 # omitted, the device name will be used. (Since 2.7)
2513 # @device: the device or node name of the top image
2515 # @base: the common backing file name.
2516 # It cannot be set if @base-node is also set.
2518 # @base-node: the node name of the backing file.
2519 # It cannot be set if @base is also set. (Since 2.8)
2521 # @backing-file: The backing file string to write into the top
2522 # image. This filename is not validated.
2524 # If a pathname string is such that it cannot be
2525 # resolved by QEMU, that means that subsequent QMP or
2526 # HMP commands must use node-names for the image in
2527 # question, as filename lookup methods will fail.
2529 # If not specified, QEMU will automatically determine
2530 # the backing file string to use, or error out if there
2531 # is no obvious choice. Care should be taken when
2532 # specifying the string, to specify a valid filename or
2536 # @speed: the maximum speed, in bytes per second
2538 # @on-error: the action to take on an error (default report).
2539 # 'stop' and 'enospc' can only be used if the block device
2540 # supports io-status (see BlockInfo). Since 1.3.
2542 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2543 # finished its work, waiting for @block-job-finalize before
2544 # making any block graph changes.
2545 # When true, this job will automatically
2546 # perform its abort or commit actions.
2547 # Defaults to true. (Since 3.1)
2549 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2550 # has completely ceased all work, and awaits @block-job-dismiss.
2551 # When true, this job will automatically disappear from the query
2552 # list without user intervention.
2553 # Defaults to true. (Since 3.1)
2555 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
2561 # -> { "execute": "block-stream",
2562 # "arguments": { "device": "virtio0",
2563 # "base": "/tmp/master.qcow2" } }
2564 # <- { "return": {} }
2567 { 'command': 'block-stream',
2568 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2569 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2570 '*on-error': 'BlockdevOnError',
2571 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2574 # @block-job-set-speed:
2576 # Set maximum speed for a background block operation.
2578 # This command can only be issued when there is an active block job.
2580 # Throttling can be disabled by setting the speed to 0.
2582 # @device: The job identifier. This used to be a device name (hence
2583 # the name of the parameter), but since QEMU 2.7 it can have
2586 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2589 # Returns: Nothing on success
2590 # If no background operation is active on this device, DeviceNotActive
2594 { 'command': 'block-job-set-speed',
2595 'data': { 'device': 'str', 'speed': 'int' } }
2598 # @block-job-cancel:
2600 # Stop an active background block operation.
2602 # This command returns immediately after marking the active background block
2603 # operation for cancellation. It is an error to call this command if no
2604 # operation is in progress.
2606 # The operation will cancel as soon as possible and then emit the
2607 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2608 # enumerated using query-block-jobs.
2610 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2611 # (via the event BLOCK_JOB_READY) that the source and destination are
2612 # synchronized, then the event triggered by this command changes to
2613 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2614 # destination now has a point-in-time copy tied to the time of the cancellation.
2616 # For streaming, the image file retains its backing file unless the streaming
2617 # operation happens to complete just as it is being cancelled. A new streaming
2618 # operation can be started at a later time to finish copying all data from the
2621 # @device: The job identifier. This used to be a device name (hence
2622 # the name of the parameter), but since QEMU 2.7 it can have
2625 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2626 # abandon the job immediately (even if it is paused) instead of waiting
2627 # for the destination to complete its final synchronization (since 1.3)
2629 # Returns: Nothing on success
2630 # If no background operation is active on this device, DeviceNotActive
2634 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2639 # Pause an active background block operation.
2641 # This command returns immediately after marking the active background block
2642 # operation for pausing. It is an error to call this command if no
2643 # operation is in progress or if the job is already paused.
2645 # The operation will pause as soon as possible. No event is emitted when
2646 # the operation is actually paused. Cancelling a paused job automatically
2649 # @device: The job identifier. This used to be a device name (hence
2650 # the name of the parameter), but since QEMU 2.7 it can have
2653 # Returns: Nothing on success
2654 # If no background operation is active on this device, DeviceNotActive
2658 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2661 # @block-job-resume:
2663 # Resume an active background block operation.
2665 # This command returns immediately after resuming a paused background block
2666 # operation. It is an error to call this command if no operation is in
2667 # progress or if the job is not paused.
2669 # This command also clears the error status of the job.
2671 # @device: The job identifier. This used to be a device name (hence
2672 # the name of the parameter), but since QEMU 2.7 it can have
2675 # Returns: Nothing on success
2676 # If no background operation is active on this device, DeviceNotActive
2680 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2683 # @block-job-complete:
2685 # Manually trigger completion of an active background block operation. This
2686 # is supported for drive mirroring, where it also switches the device to
2687 # write to the target path only. The ability to complete is signaled with
2688 # a BLOCK_JOB_READY event.
2690 # This command completes an active background block operation synchronously.
2691 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2692 # is not defined. Note that if an I/O error occurs during the processing of
2693 # this command: 1) the command itself will fail; 2) the error will be processed
2694 # according to the rerror/werror arguments that were specified when starting
2697 # A cancelled or paused job cannot be completed.
2699 # @device: The job identifier. This used to be a device name (hence
2700 # the name of the parameter), but since QEMU 2.7 it can have
2703 # Returns: Nothing on success
2704 # If no background operation is active on this device, DeviceNotActive
2708 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2711 # @block-job-dismiss:
2713 # For jobs that have already concluded, remove them from the block-job-query
2714 # list. This command only needs to be run for jobs which were started with
2715 # QEMU 2.12+ job lifetime management semantics.
2717 # This command will refuse to operate on any job that has not yet reached
2718 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2719 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2720 # to be used as appropriate.
2722 # @id: The job identifier.
2724 # Returns: Nothing on success
2728 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2731 # @block-job-finalize:
2733 # Once a job that has manual=true reaches the pending state, it can be
2734 # instructed to finalize any graph changes and do any necessary cleanup
2736 # For jobs in a transaction, instructing one job to finalize will force
2737 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2738 # a single member job to finalize.
2740 # @id: The job identifier.
2742 # Returns: Nothing on success
2746 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2749 # @BlockdevDiscardOptions:
2751 # Determines how to handle discard requests.
2753 # @ignore: Ignore the request
2754 # @unmap: Forward as an unmap request
2758 { 'enum': 'BlockdevDiscardOptions',
2759 'data': [ 'ignore', 'unmap' ] }
2762 # @BlockdevDetectZeroesOptions:
2764 # Describes the operation mode for the automatic conversion of plain
2765 # zero writes by the OS to driver specific optimized zero write commands.
2767 # @off: Disabled (default)
2769 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2770 # also that @BlockdevDiscardOptions is set to unmap for this device.
2774 { 'enum': 'BlockdevDetectZeroesOptions',
2775 'data': [ 'off', 'on', 'unmap' ] }
2778 # @BlockdevAioOptions:
2780 # Selects the AIO backend to handle I/O requests
2782 # @threads: Use qemu's thread pool
2783 # @native: Use native AIO backend (only Linux and Windows)
2787 { 'enum': 'BlockdevAioOptions',
2788 'data': [ 'threads', 'native' ] }
2791 # @BlockdevCacheOptions:
2793 # Includes cache-related options for block devices
2795 # @direct: enables use of O_DIRECT (bypass the host page cache;
2797 # @no-flush: ignore any flush requests for the device (default:
2802 { 'struct': 'BlockdevCacheOptions',
2803 'data': { '*direct': 'bool',
2804 '*no-flush': 'bool' } }
2809 # Drivers that are supported in block device operations.
2812 # @throttle: Since 2.11
2814 # @copy-on-read: Since 3.0
2815 # @blklogwrites: Since 3.0
2819 { 'enum': 'BlockdevDriver',
2820 'data': [ 'blkdebug', 'blklogwrites', 'blkverify', 'bochs', 'cloop',
2821 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps', 'gluster',
2822 'host_cdrom', 'host_device', 'http', 'https', 'iscsi', 'luks',
2823 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels', 'qcow',
2824 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
2825 { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
2827 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2830 # @BlockdevOptionsFile:
2832 # Driver specific block device options for the file backend.
2834 # @filename: path to the image file
2835 # @pr-manager: the id for the object that will handle persistent reservations
2836 # for this device (default: none, forward the commands via SG_IO;
2838 # @aio: AIO backend (default: threads) (since: 2.8)
2839 # @locking: whether to enable file locking. If set to 'auto', only enable
2840 # when Open File Descriptor (OFD) locking API is available
2841 # (default: auto, since 2.10)
2842 # @drop-cache: invalidate page cache during live migration. This prevents
2843 # stale data on the migration destination with cache.direct=off.
2844 # Currently only supported on Linux hosts.
2845 # (default: on, since: 4.0)
2846 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2847 # migration. May cause noticeable delays if the image
2848 # file is large, do not use in production.
2849 # (default: off) (since: 3.0)
2852 # @dynamic-auto-read-only: If present, enabled auto-read-only means that the
2853 # driver will open the image read-only at first,
2854 # dynamically reopen the image file read-write when
2855 # the first writer is attached to the node and reopen
2856 # read-only when the last writer is detached. This
2857 # allows giving QEMU write permissions only on demand
2858 # when an operation actually needs write access.
2862 { 'struct': 'BlockdevOptionsFile',
2863 'data': { 'filename': 'str',
2864 '*pr-manager': 'str',
2865 '*locking': 'OnOffAuto',
2866 '*aio': 'BlockdevAioOptions',
2867 '*drop-cache': {'type': 'bool',
2868 'if': 'defined(CONFIG_LINUX)'},
2869 '*x-check-cache-dropped': 'bool' },
2870 'features': [ { 'name': 'dynamic-auto-read-only',
2871 'if': 'defined(CONFIG_POSIX)' } ] }
2874 # @BlockdevOptionsNull:
2876 # Driver specific block device options for the null backend.
2878 # @size: size of the device in bytes.
2879 # @latency-ns: emulated latency (in nanoseconds) in processing
2880 # requests. Default to zero which completes requests immediately.
2882 # @read-zeroes: if true, reads from the device produce zeroes; if false, the
2883 # buffer is left unchanged. (default: false; since: 4.1)
2887 { 'struct': 'BlockdevOptionsNull',
2888 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
2891 # @BlockdevOptionsNVMe:
2893 # Driver specific block device options for the NVMe backend.
2895 # @device: controller address of the NVMe device.
2896 # @namespace: namespace number of the device, starting from 1.
2900 { 'struct': 'BlockdevOptionsNVMe',
2901 'data': { 'device': 'str', 'namespace': 'int' } }
2904 # @BlockdevOptionsVVFAT:
2906 # Driver specific block device options for the vvfat protocol.
2908 # @dir: directory to be exported as FAT image
2909 # @fat-type: FAT type: 12, 16 or 32
2910 # @floppy: whether to export a floppy image (true) or
2911 # partitioned hard disk (false; default)
2912 # @label: set the volume label, limited to 11 bytes. FAT16 and
2913 # FAT32 traditionally have some restrictions on labels, which are
2914 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2916 # @rw: whether to allow write operations (default: false)
2920 { 'struct': 'BlockdevOptionsVVFAT',
2921 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2922 '*label': 'str', '*rw': 'bool' } }
2925 # @BlockdevOptionsGenericFormat:
2927 # Driver specific block device options for image format that have no option
2928 # besides their data source.
2930 # @file: reference to or definition of the data source block device
2934 { 'struct': 'BlockdevOptionsGenericFormat',
2935 'data': { 'file': 'BlockdevRef' } }
2938 # @BlockdevOptionsLUKS:
2940 # Driver specific block device options for LUKS.
2942 # @key-secret: the ID of a QCryptoSecret object providing
2943 # the decryption key (since 2.6). Mandatory except when
2944 # doing a metadata-only probe of the image.
2948 { 'struct': 'BlockdevOptionsLUKS',
2949 'base': 'BlockdevOptionsGenericFormat',
2950 'data': { '*key-secret': 'str' } }
2954 # @BlockdevOptionsGenericCOWFormat:
2956 # Driver specific block device options for image format that have no option
2957 # besides their data source and an optional backing file.
2959 # @backing: reference to or definition of the backing file block
2960 # device, null disables the backing file entirely.
2961 # Defaults to the backing file stored the image file.
2965 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2966 'base': 'BlockdevOptionsGenericFormat',
2967 'data': { '*backing': 'BlockdevRefOrNull' } }
2970 # @Qcow2OverlapCheckMode:
2972 # General overlap check modes.
2974 # @none: Do not perform any checks
2976 # @constant: Perform only checks which can be done in constant time and
2977 # without reading anything from disk
2979 # @cached: Perform only checks which can be done without reading anything
2982 # @all: Perform all available overlap checks
2986 { 'enum': 'Qcow2OverlapCheckMode',
2987 'data': [ 'none', 'constant', 'cached', 'all' ] }
2990 # @Qcow2OverlapCheckFlags:
2992 # Structure of flags for each metadata structure. Setting a field to 'true'
2993 # makes qemu guard that structure against unintended overwriting. The default
2994 # value is chosen according to the template given.
2996 # @template: Specifies a template mode which can be adjusted using the other
2997 # flags, defaults to 'cached'
2999 # @bitmap-directory: since 3.0
3003 { 'struct': 'Qcow2OverlapCheckFlags',
3004 'data': { '*template': 'Qcow2OverlapCheckMode',
3005 '*main-header': 'bool',
3006 '*active-l1': 'bool',
3007 '*active-l2': 'bool',
3008 '*refcount-table': 'bool',
3009 '*refcount-block': 'bool',
3010 '*snapshot-table': 'bool',
3011 '*inactive-l1': 'bool',
3012 '*inactive-l2': 'bool',
3013 '*bitmap-directory': 'bool' } }
3016 # @Qcow2OverlapChecks:
3018 # Specifies which metadata structures should be guarded against unintended
3021 # @flags: set of flags for separate specification of each metadata structure
3024 # @mode: named mode which chooses a specific set of flags
3028 { 'alternate': 'Qcow2OverlapChecks',
3029 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3030 'mode': 'Qcow2OverlapCheckMode' } }
3033 # @BlockdevQcowEncryptionFormat:
3035 # @aes: AES-CBC with plain64 initialization vectors
3039 { 'enum': 'BlockdevQcowEncryptionFormat',
3043 # @BlockdevQcowEncryption:
3047 { 'union': 'BlockdevQcowEncryption',
3048 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3049 'discriminator': 'format',
3050 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3053 # @BlockdevOptionsQcow:
3055 # Driver specific block device options for qcow.
3057 # @encrypt: Image decryption options. Mandatory for
3058 # encrypted images, except when doing a metadata-only
3059 # probe of the image.
3063 { 'struct': 'BlockdevOptionsQcow',
3064 'base': 'BlockdevOptionsGenericCOWFormat',
3065 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3070 # @BlockdevQcow2EncryptionFormat:
3071 # @aes: AES-CBC with plain64 initialization vectors
3075 { 'enum': 'BlockdevQcow2EncryptionFormat',
3076 'data': [ 'aes', 'luks' ] }
3079 # @BlockdevQcow2Encryption:
3083 { 'union': 'BlockdevQcow2Encryption',
3084 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3085 'discriminator': 'format',
3086 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3087 'luks': 'QCryptoBlockOptionsLUKS'} }
3090 # @BlockdevOptionsQcow2:
3092 # Driver specific block device options for qcow2.
3094 # @lazy-refcounts: whether to enable the lazy refcounts
3095 # feature (default is taken from the image file)
3097 # @pass-discard-request: whether discard requests to the qcow2
3098 # device should be forwarded to the data source
3100 # @pass-discard-snapshot: whether discard requests for the data source
3101 # should be issued when a snapshot operation (e.g.
3102 # deleting a snapshot) frees clusters in the qcow2 file
3104 # @pass-discard-other: whether discard requests for the data source
3105 # should be issued on other occasions where a cluster
3108 # @overlap-check: which overlap checks to perform for writes
3109 # to the image, defaults to 'cached' (since 2.2)
3111 # @cache-size: the maximum total size of the L2 table and
3112 # refcount block caches in bytes (since 2.2)
3114 # @l2-cache-size: the maximum size of the L2 table cache in
3117 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3118 # bytes. It must be a power of two between 512
3119 # and the cluster size. The default value is
3120 # the cluster size (since 2.12)
3122 # @refcount-cache-size: the maximum size of the refcount block cache
3123 # in bytes (since 2.2)
3125 # @cache-clean-interval: clean unused entries in the L2 and refcount
3126 # caches. The interval is in seconds. The default value
3127 # is 600 on supporting platforms, and 0 on other
3128 # platforms. 0 disables this feature. (since 2.5)
3130 # @encrypt: Image decryption options. Mandatory for
3131 # encrypted images, except when doing a metadata-only
3132 # probe of the image. (since 2.10)
3134 # @data-file: reference to or definition of the external data file.
3135 # This may only be specified for images that require an
3136 # external data file. If it is not specified for such
3137 # an image, the data file name is loaded from the image
3142 { 'struct': 'BlockdevOptionsQcow2',
3143 'base': 'BlockdevOptionsGenericCOWFormat',
3144 'data': { '*lazy-refcounts': 'bool',
3145 '*pass-discard-request': 'bool',
3146 '*pass-discard-snapshot': 'bool',
3147 '*pass-discard-other': 'bool',
3148 '*overlap-check': 'Qcow2OverlapChecks',
3149 '*cache-size': 'int',
3150 '*l2-cache-size': 'int',
3151 '*l2-cache-entry-size': 'int',
3152 '*refcount-cache-size': 'int',
3153 '*cache-clean-interval': 'int',
3154 '*encrypt': 'BlockdevQcow2Encryption',
3155 '*data-file': 'BlockdevRef' } }
3158 # @SshHostKeyCheckMode:
3160 # @none Don't check the host key at all
3161 # @hash Compare the host key with a given hash
3162 # @known_hosts Check the host key against the known_hosts file
3166 { 'enum': 'SshHostKeyCheckMode',
3167 'data': [ 'none', 'hash', 'known_hosts' ] }
3170 # @SshHostKeyCheckHashType:
3172 # @md5 The given hash is an md5 hash
3173 # @sha1 The given hash is an sha1 hash
3177 { 'enum': 'SshHostKeyCheckHashType',
3178 'data': [ 'md5', 'sha1' ] }
3183 # @type The hash algorithm used for the hash
3184 # @hash The expected hash value
3188 { 'struct': 'SshHostKeyHash',
3189 'data': { 'type': 'SshHostKeyCheckHashType',
3197 { 'union': 'SshHostKeyCheck',
3198 'base': { 'mode': 'SshHostKeyCheckMode' },
3199 'discriminator': 'mode',
3200 'data': { 'hash': 'SshHostKeyHash' } }
3203 # @BlockdevOptionsSsh:
3205 # @server: host address
3207 # @path: path to the image on the host
3209 # @user: user as which to connect, defaults to current
3212 # @host-key-check: Defines how and what to check the host key against
3213 # (default: known_hosts)
3217 { 'struct': 'BlockdevOptionsSsh',
3218 'data': { 'server': 'InetSocketAddress',
3221 '*host-key-check': 'SshHostKeyCheck' } }
3227 # Trigger events supported by blkdebug.
3229 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3232 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3234 # @cor_write: a write due to copy-on-read (since 2.11)
3236 # @cluster_alloc_space: an allocation of file space for a cluster (since 4.1)
3238 # @none: triggers once at creation of the blkdebug node (since 4.1)
3242 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3243 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3244 'l1_grow_activate_table', 'l2_load', 'l2_update',
3245 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3246 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3247 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3248 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3249 'refblock_load', 'refblock_update', 'refblock_update_part',
3250 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3251 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3252 'refblock_alloc_switch_table', 'cluster_alloc',
3253 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3254 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3255 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3256 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3257 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3258 'cor_write', 'cluster_alloc_space', 'none'] }
3263 # Kinds of I/O that blkdebug can inject errors in.
3265 # @read: .bdrv_co_preadv()
3267 # @write: .bdrv_co_pwritev()
3269 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3271 # @discard: .bdrv_co_pdiscard()
3273 # @flush: .bdrv_co_flush_to_disk()
3275 # @block-status: .bdrv_co_block_status()
3279 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3280 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3284 # @BlkdebugInjectErrorOptions:
3286 # Describes a single error injection for blkdebug.
3288 # @event: trigger event
3290 # @state: the state identifier blkdebug needs to be in to
3291 # actually trigger the event; defaults to "any"
3293 # @iotype: the type of I/O operations on which this error should
3294 # be injected; defaults to "all read, write,
3295 # write-zeroes, discard, and flush operations"
3298 # @errno: error identifier (errno) to be returned; defaults to
3301 # @sector: specifies the sector index which has to be affected
3302 # in order to actually trigger the event; defaults to "any
3305 # @once: disables further events after this one has been
3306 # triggered; defaults to false
3308 # @immediately: fail immediately; defaults to false
3312 { 'struct': 'BlkdebugInjectErrorOptions',
3313 'data': { 'event': 'BlkdebugEvent',
3315 '*iotype': 'BlkdebugIOType',
3319 '*immediately': 'bool' } }
3322 # @BlkdebugSetStateOptions:
3324 # Describes a single state-change event for blkdebug.
3326 # @event: trigger event
3328 # @state: the current state identifier blkdebug needs to be in;
3331 # @new_state: the state identifier blkdebug is supposed to assume if
3332 # this event is triggered
3336 { 'struct': 'BlkdebugSetStateOptions',
3337 'data': { 'event': 'BlkdebugEvent',
3339 'new_state': 'int' } }
3342 # @BlockdevOptionsBlkdebug:
3344 # Driver specific block device options for blkdebug.
3346 # @image: underlying raw block device (or image file)
3348 # @config: filename of the configuration file
3350 # @align: required alignment for requests in bytes, must be
3351 # positive power of 2, or 0 for default
3353 # @max-transfer: maximum size for I/O transfers in bytes, must be
3354 # positive multiple of @align and of the underlying
3355 # file's request alignment (but need not be a power of
3356 # 2), or 0 for default (since 2.10)
3358 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3359 # must be positive multiple of @align and of the
3360 # underlying file's request alignment (but need not be a
3361 # power of 2), or 0 for default (since 2.10)
3363 # @max-write-zero: maximum size for write zero requests in bytes, must be
3364 # positive multiple of @align, of @opt-write-zero, and of
3365 # the underlying file's request alignment (but need not
3366 # be a power of 2), or 0 for default (since 2.10)
3368 # @opt-discard: preferred alignment for discard requests in bytes, must
3369 # be positive multiple of @align and of the underlying
3370 # file's request alignment (but need not be a power of
3371 # 2), or 0 for default (since 2.10)
3373 # @max-discard: maximum size for discard requests in bytes, must be
3374 # positive multiple of @align, of @opt-discard, and of
3375 # the underlying file's request alignment (but need not
3376 # be a power of 2), or 0 for default (since 2.10)
3378 # @inject-error: array of error injection descriptions
3380 # @set-state: array of state-change descriptions
3384 { 'struct': 'BlockdevOptionsBlkdebug',
3385 'data': { 'image': 'BlockdevRef',
3387 '*align': 'int', '*max-transfer': 'int32',
3388 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3389 '*opt-discard': 'int32', '*max-discard': 'int32',
3390 '*inject-error': ['BlkdebugInjectErrorOptions'],
3391 '*set-state': ['BlkdebugSetStateOptions'] } }
3394 # @BlockdevOptionsBlklogwrites:
3396 # Driver specific block device options for blklogwrites.
3398 # @file: block device
3400 # @log: block device used to log writes to @file
3402 # @log-sector-size: sector size used in logging writes to @file, determines
3403 # granularity of offsets and sizes of writes (default: 512)
3405 # @log-append: append to an existing log (default: false)
3407 # @log-super-update-interval: interval of write requests after which the log
3408 # super block is updated to disk (default: 4096)
3412 { 'struct': 'BlockdevOptionsBlklogwrites',
3413 'data': { 'file': 'BlockdevRef',
3414 'log': 'BlockdevRef',
3415 '*log-sector-size': 'uint32',
3416 '*log-append': 'bool',
3417 '*log-super-update-interval': 'uint64' } }
3420 # @BlockdevOptionsBlkverify:
3422 # Driver specific block device options for blkverify.
3424 # @test: block device to be tested
3426 # @raw: raw image used for verification
3430 { 'struct': 'BlockdevOptionsBlkverify',
3431 'data': { 'test': 'BlockdevRef',
3432 'raw': 'BlockdevRef' } }
3435 # @QuorumReadPattern:
3437 # An enumeration of quorum read patterns.
3439 # @quorum: read all the children and do a quorum vote on reads
3441 # @fifo: read only from the first child that has not failed
3445 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3448 # @BlockdevOptionsQuorum:
3450 # Driver specific block device options for Quorum
3452 # @blkverify: true if the driver must print content mismatch
3453 # set to false by default
3455 # @children: the children block devices to use
3457 # @vote-threshold: the vote limit under which a read will fail
3459 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3462 # @read-pattern: choose read pattern and set to quorum by default
3467 { 'struct': 'BlockdevOptionsQuorum',
3468 'data': { '*blkverify': 'bool',
3469 'children': [ 'BlockdevRef' ],
3470 'vote-threshold': 'int',
3471 '*rewrite-corrupted': 'bool',
3472 '*read-pattern': 'QuorumReadPattern' } }
3475 # @BlockdevOptionsGluster:
3477 # Driver specific block device options for Gluster
3479 # @volume: name of gluster volume where VM image resides
3481 # @path: absolute path to image file in gluster volume
3483 # @server: gluster servers description
3485 # @debug: libgfapi log level (default '4' which is Error)
3488 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3492 { 'struct': 'BlockdevOptionsGluster',
3493 'data': { 'volume': 'str',
3495 'server': ['SocketAddress'],
3497 '*logfile': 'str' } }
3502 # An enumeration of libiscsi transport types
3506 { 'enum': 'IscsiTransport',
3507 'data': [ 'tcp', 'iser' ] }
3510 # @IscsiHeaderDigest:
3512 # An enumeration of header digests supported by libiscsi
3516 { 'enum': 'IscsiHeaderDigest',
3517 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3518 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3521 # @BlockdevOptionsIscsi:
3523 # @transport: The iscsi transport type
3525 # @portal: The address of the iscsi portal
3527 # @target: The target iqn name
3529 # @lun: LUN to connect to. Defaults to 0.
3531 # @user: User name to log in with. If omitted, no CHAP
3532 # authentication is performed.
3534 # @password-secret: The ID of a QCryptoSecret object providing
3535 # the password for the login. This option is required if
3536 # @user is specified.
3538 # @initiator-name: The iqn name we want to identify to the target
3539 # as. If this option is not specified, an initiator name is
3540 # generated automatically.
3542 # @header-digest: The desired header digest. Defaults to
3545 # @timeout: Timeout in seconds after which a request will
3546 # timeout. 0 means no timeout and is the default.
3548 # Driver specific block device options for iscsi
3552 { 'struct': 'BlockdevOptionsIscsi',
3553 'data': { 'transport': 'IscsiTransport',
3558 '*password-secret': 'str',
3559 '*initiator-name': 'str',
3560 '*header-digest': 'IscsiHeaderDigest',
3561 '*timeout': 'int' } }
3569 { 'enum': 'RbdAuthMode',
3570 'data': [ 'cephx', 'none' ] }
3573 # @BlockdevOptionsRbd:
3575 # @pool: Ceph pool name.
3577 # @image: Image name in the Ceph pool.
3579 # @conf: path to Ceph configuration file. Values
3580 # in the configuration file will be overridden by
3581 # options specified via QAPI.
3583 # @snapshot: Ceph snapshot name.
3585 # @user: Ceph id name.
3587 # @auth-client-required: Acceptable authentication modes.
3588 # This maps to Ceph configuration option
3589 # "auth_client_required". (Since 3.0)
3591 # @key-secret: ID of a QCryptoSecret object providing a key
3592 # for cephx authentication.
3593 # This maps to Ceph configuration option
3594 # "key". (Since 3.0)
3596 # @server: Monitor host address and port. This maps
3597 # to the "mon_host" Ceph option.
3601 { 'struct': 'BlockdevOptionsRbd',
3602 'data': { 'pool': 'str',
3607 '*auth-client-required': ['RbdAuthMode'],
3608 '*key-secret': 'str',
3609 '*server': ['InetSocketAddressBase'] } }
3612 # @BlockdevOptionsSheepdog:
3614 # Driver specific block device options for sheepdog
3616 # @vdi: Virtual disk image name
3617 # @server: The Sheepdog server to connect to
3618 # @snap-id: Snapshot ID
3619 # @tag: Snapshot tag name
3621 # Only one of @snap-id and @tag may be present.
3625 { 'struct': 'BlockdevOptionsSheepdog',
3626 'data': { 'server': 'SocketAddress',
3628 '*snap-id': 'uint32',
3634 # An enumeration of replication modes.
3636 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3638 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3642 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3643 'if': 'defined(CONFIG_REPLICATION)' }
3646 # @BlockdevOptionsReplication:
3648 # Driver specific block device options for replication
3650 # @mode: the replication mode
3652 # @top-id: In secondary mode, node name or device ID of the root
3653 # node who owns the replication node chain. Must not be given in
3658 { 'struct': 'BlockdevOptionsReplication',
3659 'base': 'BlockdevOptionsGenericFormat',
3660 'data': { 'mode': 'ReplicationMode',
3662 'if': 'defined(CONFIG_REPLICATION)' }
3667 # An enumeration of NFS transport types
3669 # @inet: TCP transport
3673 { 'enum': 'NFSTransport',
3674 'data': [ 'inet' ] }
3679 # Captures the address of the socket
3681 # @type: transport type used for NFS (only TCP supported)
3683 # @host: host address for NFS server
3687 { 'struct': 'NFSServer',
3688 'data': { 'type': 'NFSTransport',
3692 # @BlockdevOptionsNfs:
3694 # Driver specific block device option for NFS
3696 # @server: host address
3698 # @path: path of the image on the host
3700 # @user: UID value to use when talking to the
3701 # server (defaults to 65534 on Windows and getuid()
3704 # @group: GID value to use when talking to the
3705 # server (defaults to 65534 on Windows and getgid()
3708 # @tcp-syn-count: number of SYNs during the session
3709 # establishment (defaults to libnfs default)
3711 # @readahead-size: set the readahead size in bytes (defaults
3712 # to libnfs default)
3714 # @page-cache-size: set the pagecache size in bytes (defaults
3715 # to libnfs default)
3717 # @debug: set the NFS debug level (max 2) (defaults
3718 # to libnfs default)
3722 { 'struct': 'BlockdevOptionsNfs',
3723 'data': { 'server': 'NFSServer',
3727 '*tcp-syn-count': 'int',
3728 '*readahead-size': 'int',
3729 '*page-cache-size': 'int',
3733 # @BlockdevOptionsCurlBase:
3735 # Driver specific block device options shared by all protocols supported by the
3738 # @url: URL of the image file
3740 # @readahead: Size of the read-ahead cache; must be a multiple of
3741 # 512 (defaults to 256 kB)
3743 # @timeout: Timeout for connections, in seconds (defaults to 5)
3745 # @username: Username for authentication (defaults to none)
3747 # @password-secret: ID of a QCryptoSecret object providing a password
3748 # for authentication (defaults to no password)
3750 # @proxy-username: Username for proxy authentication (defaults to none)
3752 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3753 # for proxy authentication (defaults to no password)
3757 { 'struct': 'BlockdevOptionsCurlBase',
3758 'data': { 'url': 'str',
3759 '*readahead': 'int',
3762 '*password-secret': 'str',
3763 '*proxy-username': 'str',
3764 '*proxy-password-secret': 'str' } }
3767 # @BlockdevOptionsCurlHttp:
3769 # Driver specific block device options for HTTP connections over the curl
3770 # backend. URLs must start with "http://".
3772 # @cookie: List of cookies to set; format is
3773 # "name1=content1; name2=content2;" as explained by
3774 # CURLOPT_COOKIE(3). Defaults to no cookies.
3776 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3777 # secure way. See @cookie for the format. (since 2.10)
3781 { 'struct': 'BlockdevOptionsCurlHttp',
3782 'base': 'BlockdevOptionsCurlBase',
3783 'data': { '*cookie': 'str',
3784 '*cookie-secret': 'str'} }
3787 # @BlockdevOptionsCurlHttps:
3789 # Driver specific block device options for HTTPS connections over the curl
3790 # backend. URLs must start with "https://".
3792 # @cookie: List of cookies to set; format is
3793 # "name1=content1; name2=content2;" as explained by
3794 # CURLOPT_COOKIE(3). Defaults to no cookies.
3796 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3799 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3800 # secure way. See @cookie for the format. (since 2.10)
3804 { 'struct': 'BlockdevOptionsCurlHttps',
3805 'base': 'BlockdevOptionsCurlBase',
3806 'data': { '*cookie': 'str',
3807 '*sslverify': 'bool',
3808 '*cookie-secret': 'str'} }
3811 # @BlockdevOptionsCurlFtp:
3813 # Driver specific block device options for FTP connections over the curl
3814 # backend. URLs must start with "ftp://".
3818 { 'struct': 'BlockdevOptionsCurlFtp',
3819 'base': 'BlockdevOptionsCurlBase',
3823 # @BlockdevOptionsCurlFtps:
3825 # Driver specific block device options for FTPS connections over the curl
3826 # backend. URLs must start with "ftps://".
3828 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3833 { 'struct': 'BlockdevOptionsCurlFtps',
3834 'base': 'BlockdevOptionsCurlBase',
3835 'data': { '*sslverify': 'bool' } }
3838 # @BlockdevOptionsNbd:
3840 # Driver specific block device options for NBD.
3842 # @server: NBD server address
3844 # @export: export name
3846 # @tls-creds: TLS credentials ID
3848 # @x-dirty-bitmap: A "qemu:dirty-bitmap:NAME" string to query in place of
3849 # traditional "base:allocation" block status (see
3850 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol) (since 3.0)
3852 # @reconnect-delay: On an unexpected disconnect, the nbd client tries to
3853 # connect again until succeeding or encountering a serious
3854 # error. During the first @reconnect-delay seconds, all
3855 # requests are paused and will be rerun on a successful
3856 # reconnect. After that time, any delayed requests and all
3857 # future requests before a successful reconnect will
3858 # immediately fail. Default 0 (Since 4.2)
3862 { 'struct': 'BlockdevOptionsNbd',
3863 'data': { 'server': 'SocketAddress',
3865 '*tls-creds': 'str',
3866 '*x-dirty-bitmap': 'str',
3867 '*reconnect-delay': 'uint32' } }
3870 # @BlockdevOptionsRaw:
3872 # Driver specific block device options for the raw driver.
3874 # @offset: position where the block device starts
3875 # @size: the assumed size of the device
3879 { 'struct': 'BlockdevOptionsRaw',
3880 'base': 'BlockdevOptionsGenericFormat',
3881 'data': { '*offset': 'int', '*size': 'int' } }
3884 # @BlockdevOptionsVxHS:
3886 # Driver specific block device options for VxHS
3888 # @vdisk-id: UUID of VxHS volume
3889 # @server: vxhs server IP, port
3890 # @tls-creds: TLS credentials ID
3894 { 'struct': 'BlockdevOptionsVxHS',
3895 'data': { 'vdisk-id': 'str',
3896 'server': 'InetSocketAddressBase',
3897 '*tls-creds': 'str' } }
3900 # @BlockdevOptionsThrottle:
3902 # Driver specific block device options for the throttle driver
3904 # @throttle-group: the name of the throttle-group object to use. It
3905 # must already exist.
3906 # @file: reference to or definition of the data source block device
3909 { 'struct': 'BlockdevOptionsThrottle',
3910 'data': { 'throttle-group': 'str',
3911 'file' : 'BlockdevRef'
3916 # Options for creating a block device. Many options are available for all
3917 # block devices, independent of the block driver:
3919 # @driver: block driver name
3920 # @node-name: the node name of the new node (Since 2.0).
3921 # This option is required on the top level of blockdev-add.
3922 # Valid node names start with an alphabetic character and may
3923 # contain only alphanumeric characters, '-', '.' and '_'. Their
3924 # maximum length is 31 characters.
3925 # @discard: discard-related options (default: ignore)
3926 # @cache: cache-related options
3927 # @read-only: whether the block device should be read-only (default: false).
3928 # Note that some block drivers support only read-only access,
3929 # either generally or in certain configurations. In this case,
3930 # the default value does not work and the option must be
3931 # specified explicitly.
3932 # @auto-read-only: if true and @read-only is false, QEMU may automatically
3933 # decide not to open the image read-write as requested, but
3934 # fall back to read-only instead (and switch between the modes
3935 # later), e.g. depending on whether the image file is writable
3936 # or whether a writing user is attached to the node
3937 # (default: false, since 3.1)
3938 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3940 # @force-share: force share all permission on added nodes.
3941 # Requires read-only=true. (Since 2.10)
3943 # Remaining options are determined by the block driver.
3947 { 'union': 'BlockdevOptions',
3948 'base': { 'driver': 'BlockdevDriver',
3949 '*node-name': 'str',
3950 '*discard': 'BlockdevDiscardOptions',
3951 '*cache': 'BlockdevCacheOptions',
3952 '*read-only': 'bool',
3953 '*auto-read-only': 'bool',
3954 '*force-share': 'bool',
3955 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3956 'discriminator': 'driver',
3958 'blkdebug': 'BlockdevOptionsBlkdebug',
3959 'blklogwrites':'BlockdevOptionsBlklogwrites',
3960 'blkverify': 'BlockdevOptionsBlkverify',
3961 'bochs': 'BlockdevOptionsGenericFormat',
3962 'cloop': 'BlockdevOptionsGenericFormat',
3963 'copy-on-read':'BlockdevOptionsGenericFormat',
3964 'dmg': 'BlockdevOptionsGenericFormat',
3965 'file': 'BlockdevOptionsFile',
3966 'ftp': 'BlockdevOptionsCurlFtp',
3967 'ftps': 'BlockdevOptionsCurlFtps',
3968 'gluster': 'BlockdevOptionsGluster',
3969 'host_cdrom': 'BlockdevOptionsFile',
3970 'host_device':'BlockdevOptionsFile',
3971 'http': 'BlockdevOptionsCurlHttp',
3972 'https': 'BlockdevOptionsCurlHttps',
3973 'iscsi': 'BlockdevOptionsIscsi',
3974 'luks': 'BlockdevOptionsLUKS',
3975 'nbd': 'BlockdevOptionsNbd',
3976 'nfs': 'BlockdevOptionsNfs',
3977 'null-aio': 'BlockdevOptionsNull',
3978 'null-co': 'BlockdevOptionsNull',
3979 'nvme': 'BlockdevOptionsNVMe',
3980 'parallels': 'BlockdevOptionsGenericFormat',
3981 'qcow2': 'BlockdevOptionsQcow2',
3982 'qcow': 'BlockdevOptionsQcow',
3983 'qed': 'BlockdevOptionsGenericCOWFormat',
3984 'quorum': 'BlockdevOptionsQuorum',
3985 'raw': 'BlockdevOptionsRaw',
3986 'rbd': 'BlockdevOptionsRbd',
3987 'replication': { 'type': 'BlockdevOptionsReplication',
3988 'if': 'defined(CONFIG_REPLICATION)' },
3989 'sheepdog': 'BlockdevOptionsSheepdog',
3990 'ssh': 'BlockdevOptionsSsh',
3991 'throttle': 'BlockdevOptionsThrottle',
3992 'vdi': 'BlockdevOptionsGenericFormat',
3993 'vhdx': 'BlockdevOptionsGenericFormat',
3994 'vmdk': 'BlockdevOptionsGenericCOWFormat',
3995 'vpc': 'BlockdevOptionsGenericFormat',
3996 'vvfat': 'BlockdevOptionsVVFAT',
3997 'vxhs': 'BlockdevOptionsVxHS'
4003 # Reference to a block device.
4005 # @definition: defines a new block device inline
4006 # @reference: references the ID of an existing block device
4010 { 'alternate': 'BlockdevRef',
4011 'data': { 'definition': 'BlockdevOptions',
4012 'reference': 'str' } }
4015 # @BlockdevRefOrNull:
4017 # Reference to a block device.
4019 # @definition: defines a new block device inline
4020 # @reference: references the ID of an existing block device.
4021 # An empty string means that no block device should
4022 # be referenced. Deprecated; use null instead.
4023 # @null: No block device should be referenced (since 2.10)
4027 { 'alternate': 'BlockdevRefOrNull',
4028 'data': { 'definition': 'BlockdevOptions',
4035 # Creates a new block device. If the @id option is given at the top level, a
4036 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
4037 # level and no BlockBackend will be created.
4044 # -> { "execute": "blockdev-add",
4046 # "driver": "qcow2",
4047 # "node-name": "test1",
4050 # "filename": "test.qcow2"
4054 # <- { "return": {} }
4057 # -> { "execute": "blockdev-add",
4059 # "driver": "qcow2",
4060 # "node-name": "node0",
4061 # "discard": "unmap",
4067 # "filename": "/tmp/test.qcow2"
4073 # "filename": "/dev/fdset/4"
4079 # <- { "return": {} }
4082 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
4085 # @x-blockdev-reopen:
4087 # Reopens a block device using the given set of options. Any option
4088 # not specified will be reset to its default value regardless of its
4089 # previous status. If an option cannot be changed or a particular
4090 # driver does not support reopening then the command will return an
4093 # The top-level @node-name option (from BlockdevOptions) must be
4094 # specified and is used to select the block device to be reopened.
4095 # Other @node-name options must be either omitted or set to the
4096 # current name of the appropriate node. This command won't change any
4097 # node name and any attempt to do it will result in an error.
4099 # In the case of options that refer to child nodes, the behavior of
4100 # this command depends on the value:
4102 # 1) A set of options (BlockdevOptions): the child is reopened with
4103 # the specified set of options.
4105 # 2) A reference to the current child: the child is reopened using
4106 # its existing set of options.
4108 # 3) A reference to a different node: the current child is replaced
4109 # with the specified one.
4111 # 4) NULL: the current child (if any) is detached.
4113 # Options (1) and (2) are supported in all cases, but at the moment
4114 # only @backing allows replacing or detaching an existing child.
4116 # Unlike with blockdev-add, the @backing option must always be present
4117 # unless the node being reopened does not have a backing file and its
4118 # image does not have a default backing file name as part of its
4123 { 'command': 'x-blockdev-reopen',
4124 'data': 'BlockdevOptions', 'boxed': true }
4129 # Deletes a block device that has been added using blockdev-add.
4130 # The command will fail if the node is attached to a device or is
4131 # otherwise being used.
4133 # @node-name: Name of the graph node to delete.
4139 # -> { "execute": "blockdev-add",
4141 # "driver": "qcow2",
4142 # "node-name": "node0",
4145 # "filename": "test.qcow2"
4149 # <- { "return": {} }
4151 # -> { "execute": "blockdev-del",
4152 # "arguments": { "node-name": "node0" }
4154 # <- { "return": {} }
4157 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
4160 # @BlockdevCreateOptionsFile:
4162 # Driver specific image creation options for file.
4164 # @filename Filename for the new image file
4165 # @size Size of the virtual disk in bytes
4166 # @preallocation Preallocation mode for the new image (default: off;
4167 # allowed values: off,
4168 # falloc (if defined CONFIG_POSIX_FALLOCATE),
4169 # full (if defined CONFIG_POSIX))
4170 # @nocow Turn off copy-on-write (valid only on btrfs; default: off)
4174 { 'struct': 'BlockdevCreateOptionsFile',
4175 'data': { 'filename': 'str',
4177 '*preallocation': 'PreallocMode',
4178 '*nocow': 'bool' } }
4181 # @BlockdevCreateOptionsGluster:
4183 # Driver specific image creation options for gluster.
4185 # @location Where to store the new image file
4186 # @size Size of the virtual disk in bytes
4187 # @preallocation Preallocation mode for the new image (default: off;
4188 # allowed values: off,
4189 # falloc (if defined CONFIG_GLUSTERFS_FALLOCATE),
4190 # full (if defined CONFIG_GLUSTERFS_ZEROFILL))
4194 { 'struct': 'BlockdevCreateOptionsGluster',
4195 'data': { 'location': 'BlockdevOptionsGluster',
4197 '*preallocation': 'PreallocMode' } }
4200 # @BlockdevCreateOptionsLUKS:
4202 # Driver specific image creation options for LUKS.
4204 # @file Node to create the image format on
4205 # @size Size of the virtual disk in bytes
4209 { 'struct': 'BlockdevCreateOptionsLUKS',
4210 'base': 'QCryptoBlockCreateOptionsLUKS',
4211 'data': { 'file': 'BlockdevRef',
4215 # @BlockdevCreateOptionsNfs:
4217 # Driver specific image creation options for NFS.
4219 # @location Where to store the new image file
4220 # @size Size of the virtual disk in bytes
4224 { 'struct': 'BlockdevCreateOptionsNfs',
4225 'data': { 'location': 'BlockdevOptionsNfs',
4229 # @BlockdevCreateOptionsParallels:
4231 # Driver specific image creation options for parallels.
4233 # @file Node to create the image format on
4234 # @size Size of the virtual disk in bytes
4235 # @cluster-size Cluster size in bytes (default: 1 MB)
4239 { 'struct': 'BlockdevCreateOptionsParallels',
4240 'data': { 'file': 'BlockdevRef',
4242 '*cluster-size': 'size' } }
4245 # @BlockdevCreateOptionsQcow:
4247 # Driver specific image creation options for qcow.
4249 # @file Node to create the image format on
4250 # @size Size of the virtual disk in bytes
4251 # @backing-file File name of the backing file if a backing file
4253 # @encrypt Encryption options if the image should be encrypted
4257 { 'struct': 'BlockdevCreateOptionsQcow',
4258 'data': { 'file': 'BlockdevRef',
4260 '*backing-file': 'str',
4261 '*encrypt': 'QCryptoBlockCreateOptions' } }
4264 # @BlockdevQcow2Version:
4266 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4267 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4271 { 'enum': 'BlockdevQcow2Version',
4272 'data': [ 'v2', 'v3' ] }
4276 # @BlockdevCreateOptionsQcow2:
4278 # Driver specific image creation options for qcow2.
4280 # @file Node to create the image format on
4281 # @data-file Node to use as an external data file in which all guest
4282 # data is stored so that only metadata remains in the qcow2
4284 # @data-file-raw True if the external data file must stay valid as a
4285 # standalone (read-only) raw image without looking at qcow2
4286 # metadata (default: false; since: 4.0)
4287 # @size Size of the virtual disk in bytes
4288 # @version Compatibility level (default: v3)
4289 # @backing-file File name of the backing file if a backing file
4291 # @backing-fmt Name of the block driver to use for the backing file
4292 # @encrypt Encryption options if the image should be encrypted
4293 # @cluster-size qcow2 cluster size in bytes (default: 65536)
4294 # @preallocation Preallocation mode for the new image (default: off;
4295 # allowed values: off, falloc, full, metadata)
4296 # @lazy-refcounts True if refcounts may be updated lazily (default: off)
4297 # @refcount-bits Width of reference counts in bits (default: 16)
4301 { 'struct': 'BlockdevCreateOptionsQcow2',
4302 'data': { 'file': 'BlockdevRef',
4303 '*data-file': 'BlockdevRef',
4304 '*data-file-raw': 'bool',
4306 '*version': 'BlockdevQcow2Version',
4307 '*backing-file': 'str',
4308 '*backing-fmt': 'BlockdevDriver',
4309 '*encrypt': 'QCryptoBlockCreateOptions',
4310 '*cluster-size': 'size',
4311 '*preallocation': 'PreallocMode',
4312 '*lazy-refcounts': 'bool',
4313 '*refcount-bits': 'int' } }
4316 # @BlockdevCreateOptionsQed:
4318 # Driver specific image creation options for qed.
4320 # @file Node to create the image format on
4321 # @size Size of the virtual disk in bytes
4322 # @backing-file File name of the backing file if a backing file
4324 # @backing-fmt Name of the block driver to use for the backing file
4325 # @cluster-size Cluster size in bytes (default: 65536)
4326 # @table-size L1/L2 table size (in clusters)
4330 { 'struct': 'BlockdevCreateOptionsQed',
4331 'data': { 'file': 'BlockdevRef',
4333 '*backing-file': 'str',
4334 '*backing-fmt': 'BlockdevDriver',
4335 '*cluster-size': 'size',
4336 '*table-size': 'int' } }
4339 # @BlockdevCreateOptionsRbd:
4341 # Driver specific image creation options for rbd/Ceph.
4343 # @location Where to store the new image file. This location cannot
4344 # point to a snapshot.
4345 # @size Size of the virtual disk in bytes
4346 # @cluster-size RBD object size
4350 { 'struct': 'BlockdevCreateOptionsRbd',
4351 'data': { 'location': 'BlockdevOptionsRbd',
4353 '*cluster-size' : 'size' } }
4356 # @BlockdevVmdkSubformat:
4358 # Subformat options for VMDK images
4360 # @monolithicSparse: Single file image with sparse cluster allocation
4362 # @monolithicFlat: Single flat data image and a descriptor file
4364 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4365 # files, in addition to a descriptor file
4367 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4368 # files, in addition to a descriptor file
4370 # @streamOptimized: Single file image sparse cluster allocation, optimized
4371 # for streaming over network.
4375 { 'enum': 'BlockdevVmdkSubformat',
4376 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4377 'twoGbMaxExtentFlat', 'streamOptimized'] }
4380 # @BlockdevVmdkAdapterType:
4382 # Adapter type info for VMDK images
4386 { 'enum': 'BlockdevVmdkAdapterType',
4387 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4390 # @BlockdevCreateOptionsVmdk:
4392 # Driver specific image creation options for VMDK.
4394 # @file Where to store the new image file. This refers to the image
4395 # file for monolithcSparse and streamOptimized format, or the
4396 # descriptor file for other formats.
4397 # @size Size of the virtual disk in bytes
4398 # @extents Where to store the data extents. Required for monolithcFlat,
4399 # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4400 # monolithicFlat, only one entry is required; for
4401 # twoGbMaxExtent* formats, the number of entries required is
4402 # calculated as extent_number = virtual_size / 2GB. Providing
4403 # more extents than will be used is an error.
4404 # @subformat The subformat of the VMDK image. Default: "monolithicSparse".
4405 # @backing-file The path of backing file. Default: no backing file is used.
4406 # @adapter-type The adapter type used to fill in the descriptor. Default: ide.
4407 # @hwversion Hardware version. The meaningful options are "4" or "6".
4409 # @zeroed-grain Whether to enable zeroed-grain feature for sparse subformats.
4414 { 'struct': 'BlockdevCreateOptionsVmdk',
4415 'data': { 'file': 'BlockdevRef',
4417 '*extents': ['BlockdevRef'],
4418 '*subformat': 'BlockdevVmdkSubformat',
4419 '*backing-file': 'str',
4420 '*adapter-type': 'BlockdevVmdkAdapterType',
4421 '*hwversion': 'str',
4422 '*zeroed-grain': 'bool' } }
4426 # @SheepdogRedundancyType:
4428 # @full Create a fully replicated vdi with x copies
4429 # @erasure-coded Create an erasure coded vdi with x data strips and
4434 { 'enum': 'SheepdogRedundancyType',
4435 'data': [ 'full', 'erasure-coded' ] }
4438 # @SheepdogRedundancyFull:
4440 # @copies Number of copies to use (between 1 and 31)
4444 { 'struct': 'SheepdogRedundancyFull',
4445 'data': { 'copies': 'int' }}
4448 # @SheepdogRedundancyErasureCoded:
4450 # @data-strips Number of data strips to use (one of {2,4,8,16})
4451 # @parity-strips Number of parity strips to use (between 1 and 15)
4455 { 'struct': 'SheepdogRedundancyErasureCoded',
4456 'data': { 'data-strips': 'int',
4457 'parity-strips': 'int' }}
4460 # @SheepdogRedundancy:
4464 { 'union': 'SheepdogRedundancy',
4465 'base': { 'type': 'SheepdogRedundancyType' },
4466 'discriminator': 'type',
4467 'data': { 'full': 'SheepdogRedundancyFull',
4468 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
4471 # @BlockdevCreateOptionsSheepdog:
4473 # Driver specific image creation options for Sheepdog.
4475 # @location Where to store the new image file
4476 # @size Size of the virtual disk in bytes
4477 # @backing-file File name of a base image
4478 # @preallocation Preallocation mode for the new image (default: off;
4479 # allowed values: off, full)
4480 # @redundancy Redundancy of the image
4481 # @object-size Object size of the image
4485 { 'struct': 'BlockdevCreateOptionsSheepdog',
4486 'data': { 'location': 'BlockdevOptionsSheepdog',
4488 '*backing-file': 'str',
4489 '*preallocation': 'PreallocMode',
4490 '*redundancy': 'SheepdogRedundancy',
4491 '*object-size': 'size' } }
4494 # @BlockdevCreateOptionsSsh:
4496 # Driver specific image creation options for SSH.
4498 # @location Where to store the new image file
4499 # @size Size of the virtual disk in bytes
4503 { 'struct': 'BlockdevCreateOptionsSsh',
4504 'data': { 'location': 'BlockdevOptionsSsh',
4508 # @BlockdevCreateOptionsVdi:
4510 # Driver specific image creation options for VDI.
4512 # @file Node to create the image format on
4513 # @size Size of the virtual disk in bytes
4514 # @preallocation Preallocation mode for the new image (default: off;
4515 # allowed values: off, metadata)
4519 { 'struct': 'BlockdevCreateOptionsVdi',
4520 'data': { 'file': 'BlockdevRef',
4522 '*preallocation': 'PreallocMode' } }
4525 # @BlockdevVhdxSubformat:
4527 # @dynamic: Growing image file
4528 # @fixed: Preallocated fixed-size image file
4532 { 'enum': 'BlockdevVhdxSubformat',
4533 'data': [ 'dynamic', 'fixed' ] }
4536 # @BlockdevCreateOptionsVhdx:
4538 # Driver specific image creation options for vhdx.
4540 # @file Node to create the image format on
4541 # @size Size of the virtual disk in bytes
4542 # @log-size Log size in bytes, must be a multiple of 1 MB
4544 # @block-size Block size in bytes, must be a multiple of 1 MB and not
4545 # larger than 256 MB (default: automatically choose a block
4546 # size depending on the image size)
4547 # @subformat vhdx subformat (default: dynamic)
4548 # @block-state-zero Force use of payload blocks of type 'ZERO'. Non-standard,
4549 # but default. Do not set to 'off' when using 'qemu-img
4550 # convert' with subformat=dynamic.
4554 { 'struct': 'BlockdevCreateOptionsVhdx',
4555 'data': { 'file': 'BlockdevRef',
4557 '*log-size': 'size',
4558 '*block-size': 'size',
4559 '*subformat': 'BlockdevVhdxSubformat',
4560 '*block-state-zero': 'bool' } }
4563 # @BlockdevVpcSubformat:
4565 # @dynamic: Growing image file
4566 # @fixed: Preallocated fixed-size image file
4570 { 'enum': 'BlockdevVpcSubformat',
4571 'data': [ 'dynamic', 'fixed' ] }
4574 # @BlockdevCreateOptionsVpc:
4576 # Driver specific image creation options for vpc (VHD).
4578 # @file Node to create the image format on
4579 # @size Size of the virtual disk in bytes
4580 # @subformat vhdx subformat (default: dynamic)
4581 # @force-size Force use of the exact byte size instead of rounding to the
4582 # next size that can be represented in CHS geometry
4587 { 'struct': 'BlockdevCreateOptionsVpc',
4588 'data': { 'file': 'BlockdevRef',
4590 '*subformat': 'BlockdevVpcSubformat',
4591 '*force-size': 'bool' } }
4594 # @BlockdevCreateOptions:
4596 # Options for creating an image format on a given node.
4598 # @driver block driver to create the image format
4602 { 'union': 'BlockdevCreateOptions',
4604 'driver': 'BlockdevDriver' },
4605 'discriminator': 'driver',
4607 'file': 'BlockdevCreateOptionsFile',
4608 'gluster': 'BlockdevCreateOptionsGluster',
4609 'luks': 'BlockdevCreateOptionsLUKS',
4610 'nfs': 'BlockdevCreateOptionsNfs',
4611 'parallels': 'BlockdevCreateOptionsParallels',
4612 'qcow': 'BlockdevCreateOptionsQcow',
4613 'qcow2': 'BlockdevCreateOptionsQcow2',
4614 'qed': 'BlockdevCreateOptionsQed',
4615 'rbd': 'BlockdevCreateOptionsRbd',
4616 'sheepdog': 'BlockdevCreateOptionsSheepdog',
4617 'ssh': 'BlockdevCreateOptionsSsh',
4618 'vdi': 'BlockdevCreateOptionsVdi',
4619 'vhdx': 'BlockdevCreateOptionsVhdx',
4620 'vmdk': 'BlockdevCreateOptionsVmdk',
4621 'vpc': 'BlockdevCreateOptionsVpc'
4627 # Starts a job to create an image format on a given node. The job is
4628 # automatically finalized, but a manual job-dismiss is required.
4630 # @job-id: Identifier for the newly created job.
4632 # @options: Options for the image creation.
4636 { 'command': 'blockdev-create',
4637 'data': { 'job-id': 'str',
4638 'options': 'BlockdevCreateOptions' } }
4641 # @blockdev-open-tray:
4643 # Opens a block device's tray. If there is a block driver state tree inserted as
4644 # a medium, it will become inaccessible to the guest (but it will remain
4645 # associated to the block device, so closing the tray will make it accessible
4648 # If the tray was already open before, this will be a no-op.
4650 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4651 # which no such event will be generated, these include:
4652 # - if the guest has locked the tray, @force is false and the guest does not
4653 # respond to the eject request
4654 # - if the BlockBackend denoted by @device does not have a guest device attached
4656 # - if the guest device does not have an actual tray
4658 # @device: Block device name (deprecated, use @id instead)
4660 # @id: The name or QOM path of the guest device (since: 2.8)
4662 # @force: if false (the default), an eject request will be sent to
4663 # the guest if it has locked the tray (and the tray will not be opened
4664 # immediately); if true, the tray will be opened regardless of whether
4671 # -> { "execute": "blockdev-open-tray",
4672 # "arguments": { "id": "ide0-1-0" } }
4674 # <- { "timestamp": { "seconds": 1418751016,
4675 # "microseconds": 716996 },
4676 # "event": "DEVICE_TRAY_MOVED",
4677 # "data": { "device": "ide1-cd0",
4679 # "tray-open": true } }
4681 # <- { "return": {} }
4684 { 'command': 'blockdev-open-tray',
4685 'data': { '*device': 'str',
4687 '*force': 'bool' } }
4690 # @blockdev-close-tray:
4692 # Closes a block device's tray. If there is a block driver state tree associated
4693 # with the block device (which is currently ejected), that tree will be loaded
4696 # If the tray was already closed before, this will be a no-op.
4698 # @device: Block device name (deprecated, use @id instead)
4700 # @id: The name or QOM path of the guest device (since: 2.8)
4706 # -> { "execute": "blockdev-close-tray",
4707 # "arguments": { "id": "ide0-1-0" } }
4709 # <- { "timestamp": { "seconds": 1418751345,
4710 # "microseconds": 272147 },
4711 # "event": "DEVICE_TRAY_MOVED",
4712 # "data": { "device": "ide1-cd0",
4714 # "tray-open": false } }
4716 # <- { "return": {} }
4719 { 'command': 'blockdev-close-tray',
4720 'data': { '*device': 'str',
4724 # @blockdev-remove-medium:
4726 # Removes a medium (a block driver state tree) from a block device. That block
4727 # device's tray must currently be open (unless there is no attached guest
4730 # If the tray is open and there is no medium inserted, this will be a no-op.
4732 # @id: The name or QOM path of the guest device
4738 # -> { "execute": "blockdev-remove-medium",
4739 # "arguments": { "id": "ide0-1-0" } }
4741 # <- { "error": { "class": "GenericError",
4742 # "desc": "Tray of device 'ide0-1-0' is not open" } }
4744 # -> { "execute": "blockdev-open-tray",
4745 # "arguments": { "id": "ide0-1-0" } }
4747 # <- { "timestamp": { "seconds": 1418751627,
4748 # "microseconds": 549958 },
4749 # "event": "DEVICE_TRAY_MOVED",
4750 # "data": { "device": "ide1-cd0",
4752 # "tray-open": true } }
4754 # <- { "return": {} }
4756 # -> { "execute": "blockdev-remove-medium",
4757 # "arguments": { "id": "ide0-1-0" } }
4759 # <- { "return": {} }
4762 { 'command': 'blockdev-remove-medium',
4763 'data': { 'id': 'str' } }
4766 # @blockdev-insert-medium:
4768 # Inserts a medium (a block driver state tree) into a block device. That block
4769 # device's tray must currently be open (unless there is no attached guest
4770 # device) and there must be no medium inserted already.
4772 # @id: The name or QOM path of the guest device
4774 # @node-name: name of a node in the block driver state graph
4780 # -> { "execute": "blockdev-add",
4782 # "node-name": "node0",
4784 # "file": { "driver": "file",
4785 # "filename": "fedora.iso" } } }
4786 # <- { "return": {} }
4788 # -> { "execute": "blockdev-insert-medium",
4789 # "arguments": { "id": "ide0-1-0",
4790 # "node-name": "node0" } }
4792 # <- { "return": {} }
4795 { 'command': 'blockdev-insert-medium',
4796 'data': { 'id': 'str',
4797 'node-name': 'str'} }
4801 # @BlockdevChangeReadOnlyMode:
4803 # Specifies the new read-only mode of a block device subject to the
4804 # @blockdev-change-medium command.
4806 # @retain: Retains the current read-only mode
4808 # @read-only: Makes the device read-only
4810 # @read-write: Makes the device writable
4815 { 'enum': 'BlockdevChangeReadOnlyMode',
4816 'data': ['retain', 'read-only', 'read-write'] }
4820 # @blockdev-change-medium:
4822 # Changes the medium inserted into a block device by ejecting the current medium
4823 # and loading a new image file which is inserted as the new medium (this command
4824 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
4825 # and blockdev-close-tray).
4827 # @device: Block device name (deprecated, use @id instead)
4829 # @id: The name or QOM path of the guest device
4832 # @filename: filename of the new image to be loaded
4834 # @format: format to open the new image with (defaults to
4835 # the probed format)
4837 # @read-only-mode: change the read-only mode of the device; defaults
4844 # 1. Change a removable medium
4846 # -> { "execute": "blockdev-change-medium",
4847 # "arguments": { "id": "ide0-1-0",
4848 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4849 # "format": "raw" } }
4850 # <- { "return": {} }
4852 # 2. Load a read-only medium into a writable drive
4854 # -> { "execute": "blockdev-change-medium",
4855 # "arguments": { "id": "floppyA",
4856 # "filename": "/srv/images/ro.img",
4858 # "read-only-mode": "retain" } }
4861 # { "class": "GenericError",
4862 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4864 # -> { "execute": "blockdev-change-medium",
4865 # "arguments": { "id": "floppyA",
4866 # "filename": "/srv/images/ro.img",
4868 # "read-only-mode": "read-only" } }
4870 # <- { "return": {} }
4873 { 'command': 'blockdev-change-medium',
4874 'data': { '*device': 'str',
4878 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
4882 # @BlockErrorAction:
4884 # An enumeration of action that has been taken when a DISK I/O occurs
4886 # @ignore: error has been ignored
4888 # @report: error has been reported to the device
4890 # @stop: error caused VM to be stopped
4894 { 'enum': 'BlockErrorAction',
4895 'data': [ 'ignore', 'report', 'stop' ] }
4899 # @BLOCK_IMAGE_CORRUPTED:
4901 # Emitted when a disk image is being marked corrupt. The image can be
4902 # identified by its device or node name. The 'device' field is always
4903 # present for compatibility reasons, but it can be empty ("") if the
4904 # image does not have a device name associated.
4906 # @device: device name. This is always present for compatibility
4907 # reasons, but it can be empty ("") if the image does not
4908 # have a device name associated.
4910 # @node-name: node name (Since: 2.4)
4912 # @msg: informative message for human consumption, such as the kind of
4913 # corruption being detected. It should not be parsed by machine as it is
4914 # not guaranteed to be stable
4916 # @offset: if the corruption resulted from an image access, this is
4917 # the host's access offset into the image
4919 # @size: if the corruption resulted from an image access, this is
4922 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4923 # event and must be repaired (Since 2.2; before, every
4924 # BLOCK_IMAGE_CORRUPTED event was fatal)
4926 # Note: If action is "stop", a STOP event will eventually follow the
4927 # BLOCK_IO_ERROR event.
4931 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4932 # "data": { "device": "ide0-hd0", "node-name": "node0",
4933 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4935 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4939 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4940 'data': { 'device' : 'str',
4941 '*node-name' : 'str',
4945 'fatal' : 'bool' } }
4950 # Emitted when a disk I/O error occurs
4952 # @device: device name. This is always present for compatibility
4953 # reasons, but it can be empty ("") if the image does not
4954 # have a device name associated.
4956 # @node-name: node name. Note that errors may be reported for the root node
4957 # that is directly attached to a guest device rather than for the
4958 # node where the error occurred. The node name is not present if
4959 # the drive is empty. (Since: 2.8)
4961 # @operation: I/O operation
4963 # @action: action that has been taken
4965 # @nospace: true if I/O error was caused due to a no-space
4966 # condition. This key is only present if query-block's
4967 # io-status is present, please see query-block documentation
4968 # for more information (since: 2.2)
4970 # @reason: human readable string describing the error cause.
4971 # (This field is a debugging aid for humans, it should not
4972 # be parsed by applications) (since: 2.2)
4974 # Note: If action is "stop", a STOP event will eventually follow the
4975 # BLOCK_IO_ERROR event
4981 # <- { "event": "BLOCK_IO_ERROR",
4982 # "data": { "device": "ide0-hd1",
4983 # "node-name": "#block212",
4984 # "operation": "write",
4985 # "action": "stop" },
4986 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4989 { 'event': 'BLOCK_IO_ERROR',
4990 'data': { 'device': 'str', '*node-name': 'str',
4991 'operation': 'IoOperationType',
4992 'action': 'BlockErrorAction', '*nospace': 'bool',
4996 # @BLOCK_JOB_COMPLETED:
4998 # Emitted when a block job has completed
5002 # @device: The job identifier. Originally the device name but other
5003 # values are allowed since QEMU 2.7
5005 # @len: maximum progress value
5007 # @offset: current progress value. On success this is equal to len.
5008 # On failure this is less than len
5010 # @speed: rate limit, bytes per second
5012 # @error: error message. Only present on failure. This field
5013 # contains a human-readable error message. There are no semantics
5014 # other than that streaming has failed and clients should not try to
5015 # interpret the error string
5021 # <- { "event": "BLOCK_JOB_COMPLETED",
5022 # "data": { "type": "stream", "device": "virtio-disk0",
5023 # "len": 10737418240, "offset": 10737418240,
5025 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5028 { 'event': 'BLOCK_JOB_COMPLETED',
5029 'data': { 'type' : 'JobType',
5037 # @BLOCK_JOB_CANCELLED:
5039 # Emitted when a block job has been cancelled
5043 # @device: The job identifier. Originally the device name but other
5044 # values are allowed since QEMU 2.7
5046 # @len: maximum progress value
5048 # @offset: current progress value. On success this is equal to len.
5049 # On failure this is less than len
5051 # @speed: rate limit, bytes per second
5057 # <- { "event": "BLOCK_JOB_CANCELLED",
5058 # "data": { "type": "stream", "device": "virtio-disk0",
5059 # "len": 10737418240, "offset": 134217728,
5061 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5064 { 'event': 'BLOCK_JOB_CANCELLED',
5065 'data': { 'type' : 'JobType',
5074 # Emitted when a block job encounters an error
5076 # @device: The job identifier. Originally the device name but other
5077 # values are allowed since QEMU 2.7
5079 # @operation: I/O operation
5081 # @action: action that has been taken
5087 # <- { "event": "BLOCK_JOB_ERROR",
5088 # "data": { "device": "ide0-hd1",
5089 # "operation": "write",
5090 # "action": "stop" },
5091 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5094 { 'event': 'BLOCK_JOB_ERROR',
5095 'data': { 'device' : 'str',
5096 'operation': 'IoOperationType',
5097 'action' : 'BlockErrorAction' } }
5102 # Emitted when a block job is ready to complete
5106 # @device: The job identifier. Originally the device name but other
5107 # values are allowed since QEMU 2.7
5109 # @len: maximum progress value
5111 # @offset: current progress value. On success this is equal to len.
5112 # On failure this is less than len
5114 # @speed: rate limit, bytes per second
5116 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
5123 # <- { "event": "BLOCK_JOB_READY",
5124 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5125 # "len": 2097152, "offset": 2097152 }
5126 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5129 { 'event': 'BLOCK_JOB_READY',
5130 'data': { 'type' : 'JobType',
5137 # @BLOCK_JOB_PENDING:
5139 # Emitted when a block job is awaiting explicit authorization to finalize graph
5140 # changes via @block-job-finalize. If this job is part of a transaction, it will
5141 # not emit this event until the transaction has converged first.
5145 # @id: The job identifier.
5151 # <- { "event": "BLOCK_JOB_WAITING",
5152 # "data": { "device": "drive0", "type": "mirror" },
5153 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5156 { 'event': 'BLOCK_JOB_PENDING',
5157 'data': { 'type' : 'JobType',
5163 # Preallocation mode of QEMU image file
5165 # @off: no preallocation
5166 # @metadata: preallocate only for metadata
5167 # @falloc: like @full preallocation but allocate disk space by
5168 # posix_fallocate() rather than writing zeros.
5169 # @full: preallocate all data by writing zeros to device to ensure disk
5170 # space is really available. @full preallocation also sets up
5171 # metadata correctly.
5175 { 'enum': 'PreallocMode',
5176 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5179 # @BLOCK_WRITE_THRESHOLD:
5181 # Emitted when writes on block device reaches or exceeds the
5182 # configured write threshold. For thin-provisioned devices, this
5183 # means the device should be extended to avoid pausing for
5185 # The event is one shot. Once triggered, it needs to be
5186 # re-registered with another block-set-write-threshold command.
5188 # @node-name: graph node name on which the threshold was exceeded.
5190 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5192 # @write-threshold: last configured threshold, in bytes.
5196 { 'event': 'BLOCK_WRITE_THRESHOLD',
5197 'data': { 'node-name': 'str',
5198 'amount-exceeded': 'uint64',
5199 'write-threshold': 'uint64' } }
5202 # @block-set-write-threshold:
5204 # Change the write threshold for a block drive. An event will be
5205 # delivered if a write to this block drive crosses the configured
5206 # threshold. The threshold is an offset, thus must be
5207 # non-negative. Default is no write threshold. Setting the threshold
5208 # to zero disables it.
5210 # This is useful to transparently resize thin-provisioned drives without
5211 # the guest OS noticing.
5213 # @node-name: graph node name on which the threshold must be set.
5215 # @write-threshold: configured threshold for the block device, bytes.
5216 # Use 0 to disable the threshold.
5222 # -> { "execute": "block-set-write-threshold",
5223 # "arguments": { "node-name": "mydev",
5224 # "write-threshold": 17179869184 } }
5225 # <- { "return": {} }
5228 { 'command': 'block-set-write-threshold',
5229 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
5232 # @x-blockdev-change:
5234 # Dynamically reconfigure the block driver state graph. It can be used
5235 # to add, remove, insert or replace a graph node. Currently only the
5236 # Quorum driver implements this feature to add or remove its child. This
5237 # is useful to fix a broken quorum child.
5239 # If @node is specified, it will be inserted under @parent. @child
5240 # may not be specified in this case. If both @parent and @child are
5241 # specified but @node is not, @child will be detached from @parent.
5243 # @parent: the id or name of the parent node.
5245 # @child: the name of a child under the given parent node.
5247 # @node: the name of the node that will be added.
5249 # Note: this command is experimental, and its API is not stable. It
5250 # does not support all kinds of operations, all kinds of children, nor
5251 # all block drivers.
5253 # FIXME Removing children from a quorum node means introducing gaps in the
5254 # child indices. This cannot be represented in the 'children' list of
5255 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
5257 # Warning: The data in a new quorum child MUST be consistent with that of
5258 # the rest of the array.
5264 # 1. Add a new node to a quorum
5265 # -> { "execute": "blockdev-add",
5268 # "node-name": "new_node",
5269 # "file": { "driver": "file",
5270 # "filename": "test.raw" } } }
5271 # <- { "return": {} }
5272 # -> { "execute": "x-blockdev-change",
5273 # "arguments": { "parent": "disk1",
5274 # "node": "new_node" } }
5275 # <- { "return": {} }
5277 # 2. Delete a quorum's node
5278 # -> { "execute": "x-blockdev-change",
5279 # "arguments": { "parent": "disk1",
5280 # "child": "children.1" } }
5281 # <- { "return": {} }
5284 { 'command': 'x-blockdev-change',
5285 'data' : { 'parent': 'str',
5290 # @x-blockdev-set-iothread:
5292 # Move @node and its children into the @iothread. If @iothread is null then
5293 # move @node and its children into the main loop.
5295 # The node must not be attached to a BlockBackend.
5297 # @node-name: the name of the block driver node
5299 # @iothread: the name of the IOThread object or null for the main loop
5301 # @force: true if the node and its children should be moved when a BlockBackend
5302 # is already attached
5304 # Note: this command is experimental and intended for test cases that need
5305 # control over IOThreads only.
5311 # 1. Move a node into an IOThread
5312 # -> { "execute": "x-blockdev-set-iothread",
5313 # "arguments": { "node-name": "disk1",
5314 # "iothread": "iothread0" } }
5315 # <- { "return": {} }
5317 # 2. Move a node into the main loop
5318 # -> { "execute": "x-blockdev-set-iothread",
5319 # "arguments": { "node-name": "disk1",
5320 # "iothread": null } }
5321 # <- { "return": {} }
5324 { 'command': 'x-blockdev-set-iothread',
5325 'data' : { 'node-name': 'str',
5326 'iothread': 'StrOrNull',
5327 '*force': 'bool' } }