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
1134 { 'enum': 'MirrorSyncMode',
1135 'data': ['top', 'full', 'none', 'incremental'] }
1140 # An enumeration of possible behaviors for the synchronization of a bitmap
1141 # when used for data copy operations.
1143 # @on-success: The bitmap is only synced when the operation is successful.
1144 # This is the behavior always used for 'INCREMENTAL' backups.
1148 { 'enum': 'BitmapSyncMode',
1149 'data': ['on-success'] }
1154 # An enumeration whose values tell the mirror block job when to
1155 # trigger writes to the target.
1157 # @background: copy data in background only.
1159 # @write-blocking: when data is written to the source, write it
1160 # (synchronously) to the target as well. In
1161 # addition, data is copied in background just like in
1166 { 'enum': 'MirrorCopyMode',
1167 'data': ['background', 'write-blocking'] }
1172 # Information about a long-running block device operation.
1174 # @type: the job type ('stream' for image streaming)
1176 # @device: The job identifier. Originally the device name but other
1177 # values are allowed since QEMU 2.7
1179 # @len: Estimated @offset value at the completion of the job. This value can
1180 # arbitrarily change while the job is running, in both directions.
1182 # @offset: Progress made until now. The unit is arbitrary and the value can
1183 # only meaningfully be used for the ratio of @offset to @len. The
1184 # value is monotonically increasing.
1186 # @busy: false if the job is known to be in a quiescent state, with
1187 # no pending I/O. Since 1.3.
1189 # @paused: whether the job is paused or, if @busy is true, will
1190 # pause itself as soon as possible. Since 1.3.
1192 # @speed: the rate limit, bytes per second
1194 # @io-status: the status of the job (since 1.3)
1196 # @ready: true if the job may be completed (since 2.2)
1198 # @status: Current job state/status (since 2.12)
1200 # @auto-finalize: Job will finalize itself when PENDING, moving to
1201 # the CONCLUDED state. (since 2.12)
1203 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1204 # state and disappearing from the query list. (since 2.12)
1206 # @error: Error information if the job did not complete successfully.
1207 # Not set if the job completed successfully. (since 2.12.1)
1211 { 'struct': 'BlockJobInfo',
1212 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1213 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1214 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1215 'status': 'JobStatus',
1216 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1220 # @query-block-jobs:
1222 # Return information about long-running block device operations.
1224 # Returns: a list of @BlockJobInfo for each active block job
1228 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1233 # This command sets the password of a block device that has not been open
1234 # with a password and requires one.
1236 # This command is now obsolete and will always return an error since 2.10
1239 { 'command': 'block_passwd',
1240 'data': { '*device': 'str',
1241 '*node-name': 'str',
1242 'password': 'str' } }
1247 # Resize a block image while a guest is running.
1249 # Either @device or @node-name must be set but not both.
1251 # @device: the name of the device to get the image resized
1253 # @node-name: graph node name to get the image resized (Since 2.0)
1255 # @size: new image size in bytes
1257 # Returns: nothing on success
1258 # If @device is not a valid block device, DeviceNotFound
1264 # -> { "execute": "block_resize",
1265 # "arguments": { "device": "scratch", "size": 1073741824 } }
1266 # <- { "return": {} }
1269 { 'command': 'block_resize',
1270 'data': { '*device': 'str',
1271 '*node-name': 'str',
1277 # An enumeration that tells QEMU how to set the backing file path in
1280 # @existing: QEMU should look for an existing image file.
1282 # @absolute-paths: QEMU should create a new image with absolute paths
1283 # for the backing file. If there is no backing file available, the new
1284 # image will not be backed either.
1288 { 'enum': 'NewImageMode',
1289 'data': [ 'existing', 'absolute-paths' ] }
1292 # @BlockdevSnapshotSync:
1294 # Either @device or @node-name must be set but not both.
1296 # @device: the name of the device to take a snapshot of.
1298 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1300 # @snapshot-file: the target of the new overlay image. If the file
1301 # exists, or if it is a device, the overlay will be created in the
1302 # existing file/device. Otherwise, a new file will be created.
1304 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1306 # @format: the format of the overlay image, default is 'qcow2'.
1308 # @mode: whether and how QEMU should create a new image, default is
1311 { 'struct': 'BlockdevSnapshotSync',
1312 'data': { '*device': 'str', '*node-name': 'str',
1313 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1314 '*format': 'str', '*mode': 'NewImageMode' } }
1317 # @BlockdevSnapshot:
1319 # @node: device or node name that will have a snapshot taken.
1321 # @overlay: reference to the existing block device that will become
1322 # the overlay of @node, as part of taking the snapshot.
1323 # It must not have a current backing file (this can be
1324 # achieved by passing "backing": null to blockdev-add).
1328 { 'struct': 'BlockdevSnapshot',
1329 'data': { 'node': 'str', 'overlay': 'str' } }
1334 # @job-id: identifier for the newly-created block job. If
1335 # omitted, the device name will be used. (Since 2.7)
1337 # @device: the device name or node-name of a root node which should be copied.
1339 # @sync: what parts of the disk image should be copied to the destination
1340 # (all the disk, only the sectors allocated in the topmost image, from a
1341 # dirty bitmap, or only new I/O).
1343 # @speed: the maximum speed, in bytes per second. The default is 0,
1346 # @bitmap: the name of dirty bitmap if sync is "incremental".
1347 # Must be present if sync is "incremental", must NOT be present
1348 # otherwise. (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1350 # @compress: true to compress data, if the target format supports it.
1351 # (default: false) (since 2.8)
1353 # @on-source-error: the action to take on an error on the source,
1354 # default 'report'. 'stop' and 'enospc' can only be used
1355 # if the block device supports io-status (see BlockInfo).
1357 # @on-target-error: the action to take on an error on the target,
1358 # default 'report' (no limitations, since this applies to
1359 # a different block device than @device).
1361 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1362 # finished its work, waiting for @block-job-finalize before
1363 # making any block graph changes.
1364 # When true, this job will automatically
1365 # perform its abort or commit actions.
1366 # Defaults to true. (Since 2.12)
1368 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1369 # has completely ceased all work, and awaits @block-job-dismiss.
1370 # When true, this job will automatically disappear from the query
1371 # list without user intervention.
1372 # Defaults to true. (Since 2.12)
1374 # Note: @on-source-error and @on-target-error only affect background
1375 # I/O. If an error occurs during a guest write request, the device's
1376 # rerror/werror actions will be used.
1380 { 'struct': 'BackupCommon',
1381 'data': { '*job-id': 'str', 'device': 'str',
1382 'sync': 'MirrorSyncMode', '*speed': 'int',
1383 '*bitmap': 'str', '*compress': 'bool',
1384 '*on-source-error': 'BlockdevOnError',
1385 '*on-target-error': 'BlockdevOnError',
1386 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1391 # @target: the target of the new image. If the file exists, or if it
1392 # is a device, the existing file/device will be used as the new
1393 # destination. If it does not exist, a new file will be created.
1395 # @format: the format of the new destination, default is to
1396 # probe if @mode is 'existing', else the format of the source
1398 # @mode: whether and how QEMU should create a new image, default is
1403 { 'struct': 'DriveBackup',
1404 'base': 'BackupCommon',
1405 'data': { 'target': 'str',
1407 '*mode': 'NewImageMode' } }
1412 # @target: the device name or node-name of the backup target node.
1416 { 'struct': 'BlockdevBackup',
1417 'base': 'BackupCommon',
1418 'data': { 'target': 'str' } }
1421 # @blockdev-snapshot-sync:
1423 # Takes a synchronous snapshot of a block device.
1425 # For the arguments, see the documentation of BlockdevSnapshotSync.
1427 # Returns: nothing on success
1428 # If @device is not a valid block device, DeviceNotFound
1434 # -> { "execute": "blockdev-snapshot-sync",
1435 # "arguments": { "device": "ide-hd0",
1437 # "/some/place/my-image",
1438 # "format": "qcow2" } }
1439 # <- { "return": {} }
1442 { 'command': 'blockdev-snapshot-sync',
1443 'data': 'BlockdevSnapshotSync' }
1447 # @blockdev-snapshot:
1449 # Takes a snapshot of a block device.
1451 # Take a snapshot, by installing 'node' as the backing image of
1452 # 'overlay'. Additionally, if 'node' is associated with a block
1453 # device, the block device changes to using 'overlay' as its new active
1456 # For the arguments, see the documentation of BlockdevSnapshot.
1462 # -> { "execute": "blockdev-add",
1463 # "arguments": { "driver": "qcow2",
1464 # "node-name": "node1534",
1465 # "file": { "driver": "file",
1466 # "filename": "hd1.qcow2" },
1467 # "backing": null } }
1469 # <- { "return": {} }
1471 # -> { "execute": "blockdev-snapshot",
1472 # "arguments": { "node": "ide-hd0",
1473 # "overlay": "node1534" } }
1474 # <- { "return": {} }
1477 { 'command': 'blockdev-snapshot',
1478 'data': 'BlockdevSnapshot' }
1481 # @change-backing-file:
1483 # Change the backing file in the image file metadata. This does not
1484 # cause QEMU to reopen the image file to reparse the backing filename
1485 # (it may, however, perform a reopen to change permissions from
1486 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1487 # into the image file metadata, and the QEMU internal strings are
1490 # @image-node-name: The name of the block driver state node of the
1491 # image to modify. The "device" argument is used
1492 # to verify "image-node-name" is in the chain
1493 # described by "device".
1495 # @device: The device name or node-name of the root node that owns
1498 # @backing-file: The string to write as the backing file. This
1499 # string is not validated, so care should be taken
1500 # when specifying the string or the image chain may
1501 # not be able to be reopened again.
1503 # Returns: Nothing on success
1505 # If "device" does not exist or cannot be determined, DeviceNotFound
1509 { 'command': 'change-backing-file',
1510 'data': { 'device': 'str', 'image-node-name': 'str',
1511 'backing-file': 'str' } }
1516 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1517 # writes data between 'top' and 'base' into 'base'.
1519 # @job-id: identifier for the newly-created block job. If
1520 # omitted, the device name will be used. (Since 2.7)
1522 # @device: the device name or node-name of a root node
1524 # @base-node: The node name of the backing image to write data into.
1525 # If not specified, this is the deepest backing image.
1528 # @base: Same as @base-node, except that it is a file name rather than a node
1529 # name. This must be the exact filename string that was used to open the
1530 # node; other strings, even if addressing the same file, are not
1531 # accepted (deprecated, use @base-node instead)
1533 # @top-node: The node name of the backing image within the image chain
1534 # which contains the topmost data to be committed down. If
1535 # not specified, this is the active layer. (since: 3.1)
1537 # @top: Same as @top-node, except that it is a file name rather than a node
1538 # name. This must be the exact filename string that was used to open the
1539 # node; other strings, even if addressing the same file, are not
1540 # accepted (deprecated, use @base-node instead)
1542 # @backing-file: The backing file string to write into the overlay
1543 # image of 'top'. If 'top' is the active layer,
1544 # specifying a backing file string is an error. This
1545 # filename is not validated.
1547 # If a pathname string is such that it cannot be
1548 # resolved by QEMU, that means that subsequent QMP or
1549 # HMP commands must use node-names for the image in
1550 # question, as filename lookup methods will fail.
1552 # If not specified, QEMU will automatically determine
1553 # the backing file string to use, or error out if
1554 # there is no obvious choice. Care should be taken
1555 # when specifying the string, to specify a valid
1556 # filename or protocol.
1559 # If top == base, that is an error.
1560 # If top == active, the job will not be completed by itself,
1561 # user needs to complete the job with the block-job-complete
1562 # command after getting the ready event. (Since 2.0)
1564 # If the base image is smaller than top, then the base image
1565 # will be resized to be the same size as top. If top is
1566 # smaller than the base image, the base will not be
1567 # truncated. If you want the base image size to match the
1568 # size of the smaller top, you can safely truncate it
1569 # yourself once the commit operation successfully completes.
1571 # @speed: the maximum speed, in bytes per second
1573 # @filter-node-name: the node name that should be assigned to the
1574 # filter driver that the commit job inserts into the graph
1575 # above @top. If this option is not given, a node name is
1576 # autogenerated. (Since: 2.9)
1578 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1579 # finished its work, waiting for @block-job-finalize before
1580 # making any block graph changes.
1581 # When true, this job will automatically
1582 # perform its abort or commit actions.
1583 # Defaults to true. (Since 3.1)
1585 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1586 # has completely ceased all work, and awaits @block-job-dismiss.
1587 # When true, this job will automatically disappear from the query
1588 # list without user intervention.
1589 # Defaults to true. (Since 3.1)
1591 # Returns: Nothing on success
1592 # If @device does not exist, DeviceNotFound
1593 # Any other error returns a GenericError.
1599 # -> { "execute": "block-commit",
1600 # "arguments": { "device": "virtio0",
1601 # "top": "/tmp/snap1.qcow2" } }
1602 # <- { "return": {} }
1605 { 'command': 'block-commit',
1606 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1607 '*base': 'str', '*top-node': 'str', '*top': 'str',
1608 '*backing-file': 'str', '*speed': 'int',
1609 '*filter-node-name': 'str',
1610 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1615 # Start a point-in-time copy of a block device to a new destination. The
1616 # status of ongoing drive-backup operations can be checked with
1617 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1618 # The operation can be stopped before it has completed using the
1619 # block-job-cancel command.
1621 # Returns: nothing on success
1622 # If @device is not a valid block device, GenericError
1628 # -> { "execute": "drive-backup",
1629 # "arguments": { "device": "drive0",
1631 # "target": "backup.img" } }
1632 # <- { "return": {} }
1635 { 'command': 'drive-backup', 'boxed': true,
1636 'data': 'DriveBackup' }
1641 # Start a point-in-time copy of a block device to a new destination. The
1642 # status of ongoing blockdev-backup operations can be checked with
1643 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1644 # The operation can be stopped before it has completed using the
1645 # block-job-cancel command.
1647 # Returns: nothing on success
1648 # If @device is not a valid block device, DeviceNotFound
1653 # -> { "execute": "blockdev-backup",
1654 # "arguments": { "device": "src-id",
1656 # "target": "tgt-id" } }
1657 # <- { "return": {} }
1660 { 'command': 'blockdev-backup', 'boxed': true,
1661 'data': 'BlockdevBackup' }
1665 # @query-named-block-nodes:
1667 # Get the named block driver list
1669 # Returns: the list of BlockDeviceInfo
1675 # -> { "execute": "query-named-block-nodes" }
1676 # <- { "return": [ { "ro":false,
1678 # "encrypted":false,
1679 # "file":"disks/test.qcow2",
1680 # "node-name": "my-node",
1681 # "backing_file_depth":1,
1688 # "bps_max": 8000000,
1695 # "write_threshold": 0,
1697 # "filename":"disks/test.qcow2",
1699 # "virtual-size":2048000,
1700 # "backing_file":"base.qcow2",
1701 # "full-backing-filename":"disks/base.qcow2",
1702 # "backing-filename-format":"qcow2",
1706 # "name": "snapshot1",
1707 # "vm-state-size": 0,
1708 # "date-sec": 10000200,
1710 # "vm-clock-sec": 206,
1711 # "vm-clock-nsec": 30
1715 # "filename":"disks/base.qcow2",
1717 # "virtual-size":2048000
1722 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1725 # @XDbgBlockGraphNodeType:
1727 # @block-backend: corresponds to BlockBackend
1729 # @block-job: corresonds to BlockJob
1731 # @block-driver: corresponds to BlockDriverState
1735 { 'enum': 'XDbgBlockGraphNodeType',
1736 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1739 # @XDbgBlockGraphNode:
1741 # @id: Block graph node identifier. This @id is generated only for
1742 # x-debug-query-block-graph and does not relate to any other identifiers in
1745 # @type: Type of graph node. Can be one of block-backend, block-job or
1746 # block-driver-state.
1748 # @name: Human readable name of the node. Corresponds to node-name for
1749 # block-driver-state nodes; is not guaranteed to be unique in the whole
1750 # graph (with block-jobs and block-backends).
1754 { 'struct': 'XDbgBlockGraphNode',
1755 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1760 # Enum of base block permissions.
1762 # @consistent-read: A user that has the "permission" of consistent reads is
1763 # guaranteed that their view of the contents of the block
1764 # device is complete and self-consistent, representing the
1765 # contents of a disk at a specific point.
1766 # For most block devices (including their backing files) this
1767 # is true, but the property cannot be maintained in a few
1768 # situations like for intermediate nodes of a commit block
1771 # @write: This permission is required to change the visible disk contents.
1773 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1774 # both enough and required for writes to the block node when
1775 # the caller promises that the visible disk content doesn't
1777 # As the BLK_PERM_WRITE permission is strictly stronger,
1778 # either is sufficient to perform an unchanging write.
1780 # @resize: This permission is required to change the size of a block node.
1782 # @graph-mod: This permission is required to change the node that this
1783 # BdrvChild points to.
1787 { 'enum': 'BlockPermission',
1788 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
1791 # @XDbgBlockGraphEdge:
1793 # Block Graph edge description for x-debug-query-block-graph.
1795 # @parent: parent id
1799 # @name: name of the relation (examples are 'file' and 'backing')
1801 # @perm: granted permissions for the parent operating on the child
1803 # @shared-perm: permissions that can still be granted to other users of the
1804 # child while it is still attached to this parent
1808 { 'struct': 'XDbgBlockGraphEdge',
1809 'data': { 'parent': 'uint64', 'child': 'uint64',
1810 'name': 'str', 'perm': [ 'BlockPermission' ],
1811 'shared-perm': [ 'BlockPermission' ] } }
1816 # Block Graph - list of nodes and list of edges.
1820 { 'struct': 'XDbgBlockGraph',
1821 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1824 # @x-debug-query-block-graph:
1826 # Get the block graph.
1830 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph' }
1835 # Start mirroring a block device's writes to a new destination. target
1836 # specifies the target of the new image. If the file exists, or if it
1837 # is a device, it will be used as the new destination for writes. If
1838 # it does not exist, a new file will be created. format specifies the
1839 # format of the mirror image, default is to probe if mode='existing',
1840 # else the format of the source.
1842 # Returns: nothing on success
1843 # If @device is not a valid block device, GenericError
1849 # -> { "execute": "drive-mirror",
1850 # "arguments": { "device": "ide-hd0",
1851 # "target": "/some/place/my-image",
1853 # "format": "qcow2" } }
1854 # <- { "return": {} }
1857 { 'command': 'drive-mirror', 'boxed': true,
1858 'data': 'DriveMirror' }
1863 # A set of parameters describing drive mirror setup.
1865 # @job-id: identifier for the newly-created block job. If
1866 # omitted, the device name will be used. (Since 2.7)
1868 # @device: the device name or node-name of a root node whose writes should be
1871 # @target: the target of the new image. If the file exists, or if it
1872 # is a device, the existing file/device will be used as the new
1873 # destination. If it does not exist, a new file will be created.
1875 # @format: the format of the new destination, default is to
1876 # probe if @mode is 'existing', else the format of the source
1878 # @node-name: the new block driver state node name in the graph
1881 # @replaces: with sync=full graph node name to be replaced by the new
1882 # image when a whole image copy is done. This can be used to repair
1883 # broken Quorum files. (Since 2.1)
1885 # @mode: whether and how QEMU should create a new image, default is
1888 # @speed: the maximum speed, in bytes per second
1890 # @sync: what parts of the disk image should be copied to the destination
1891 # (all the disk, only the sectors allocated in the topmost image, or
1894 # @granularity: granularity of the dirty bitmap, default is 64K
1895 # if the image format doesn't have clusters, 4K if the clusters
1896 # are smaller than that, else the cluster size. Must be a
1897 # power of 2 between 512 and 64M (since 1.4).
1899 # @buf-size: maximum amount of data in flight from source to
1900 # target (since 1.4).
1902 # @on-source-error: the action to take on an error on the source,
1903 # default 'report'. 'stop' and 'enospc' can only be used
1904 # if the block device supports io-status (see BlockInfo).
1906 # @on-target-error: the action to take on an error on the target,
1907 # default 'report' (no limitations, since this applies to
1908 # a different block device than @device).
1909 # @unmap: Whether to try to unmap target sectors where source has
1910 # only zero. If true, and target unallocated sectors will read as zero,
1911 # target image sectors will be unmapped; otherwise, zeroes will be
1912 # written. Both will result in identical contents.
1913 # Default is true. (Since 2.4)
1915 # @copy-mode: when to copy data to the destination; defaults to 'background'
1918 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1919 # finished its work, waiting for @block-job-finalize before
1920 # making any block graph changes.
1921 # When true, this job will automatically
1922 # perform its abort or commit actions.
1923 # Defaults to true. (Since 3.1)
1925 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1926 # has completely ceased all work, and awaits @block-job-dismiss.
1927 # When true, this job will automatically disappear from the query
1928 # list without user intervention.
1929 # Defaults to true. (Since 3.1)
1932 { 'struct': 'DriveMirror',
1933 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1934 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1935 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1936 '*speed': 'int', '*granularity': 'uint32',
1937 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1938 '*on-target-error': 'BlockdevOnError',
1939 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
1940 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1943 # @BlockDirtyBitmap:
1945 # @node: name of device/node which the bitmap is tracking
1947 # @name: name of the dirty bitmap
1951 { 'struct': 'BlockDirtyBitmap',
1952 'data': { 'node': 'str', 'name': 'str' } }
1955 # @BlockDirtyBitmapAdd:
1957 # @node: name of device/node which the bitmap is tracking
1959 # @name: name of the dirty bitmap
1961 # @granularity: the bitmap granularity, default is 64k for
1962 # block-dirty-bitmap-add
1964 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1965 # corresponding block device image file on its close. For now only
1966 # Qcow2 disks support persistent bitmaps. Default is false for
1967 # block-dirty-bitmap-add. (Since: 2.10)
1969 # @autoload: ignored and deprecated since 2.12.
1970 # Currently, all dirty tracking bitmaps are loaded from Qcow2 on
1973 # @disabled: the bitmap is created in the disabled state, which means that
1974 # it will not track drive changes. The bitmap may be enabled with
1975 # block-dirty-bitmap-enable. Default is false. (Since: 4.0)
1979 { 'struct': 'BlockDirtyBitmapAdd',
1980 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1981 '*persistent': 'bool', '*autoload': 'bool', '*disabled': 'bool' } }
1984 # @BlockDirtyBitmapMergeSource:
1986 # @local: name of the bitmap, attached to the same node as target bitmap.
1988 # @external: bitmap with specified node
1992 { 'alternate': 'BlockDirtyBitmapMergeSource',
1993 'data': { 'local': 'str',
1994 'external': 'BlockDirtyBitmap' } }
1997 # @BlockDirtyBitmapMerge:
1999 # @node: name of device/node which the @target bitmap is tracking
2001 # @target: name of the destination dirty bitmap
2003 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully
2004 # specifed BlockDirtyBitmap elements. The latter are supported
2009 { 'struct': 'BlockDirtyBitmapMerge',
2010 'data': { 'node': 'str', 'target': 'str',
2011 'bitmaps': ['BlockDirtyBitmapMergeSource'] } }
2014 # @block-dirty-bitmap-add:
2016 # Create a dirty bitmap with a name on the node, and start tracking the writes.
2018 # Returns: nothing on success
2019 # If @node is not a valid block device or node, DeviceNotFound
2020 # If @name is already taken, GenericError with an explanation
2026 # -> { "execute": "block-dirty-bitmap-add",
2027 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2028 # <- { "return": {} }
2031 { 'command': 'block-dirty-bitmap-add',
2032 'data': 'BlockDirtyBitmapAdd' }
2035 # @block-dirty-bitmap-remove:
2037 # Stop write tracking and remove the dirty bitmap that was created
2038 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2041 # Returns: nothing on success
2042 # If @node is not a valid block device or node, DeviceNotFound
2043 # If @name is not found, GenericError with an explanation
2044 # if @name is frozen by an operation, GenericError
2050 # -> { "execute": "block-dirty-bitmap-remove",
2051 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2052 # <- { "return": {} }
2055 { 'command': 'block-dirty-bitmap-remove',
2056 'data': 'BlockDirtyBitmap' }
2059 # @block-dirty-bitmap-clear:
2061 # Clear (reset) a dirty bitmap on the device, so that an incremental
2062 # backup from this point in time forward will only backup clusters
2063 # modified after this clear operation.
2065 # Returns: nothing on success
2066 # If @node is not a valid block device, DeviceNotFound
2067 # If @name is not found, GenericError with an explanation
2073 # -> { "execute": "block-dirty-bitmap-clear",
2074 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2075 # <- { "return": {} }
2078 { 'command': 'block-dirty-bitmap-clear',
2079 'data': 'BlockDirtyBitmap' }
2082 # @block-dirty-bitmap-enable:
2084 # Enables a dirty bitmap so that it will begin tracking disk changes.
2086 # Returns: nothing on success
2087 # If @node is not a valid block device, DeviceNotFound
2088 # If @name is not found, GenericError with an explanation
2094 # -> { "execute": "block-dirty-bitmap-enable",
2095 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2096 # <- { "return": {} }
2099 { 'command': 'block-dirty-bitmap-enable',
2100 'data': 'BlockDirtyBitmap' }
2103 # @block-dirty-bitmap-disable:
2105 # Disables a dirty bitmap so that it will stop tracking disk changes.
2107 # Returns: nothing on success
2108 # If @node is not a valid block device, DeviceNotFound
2109 # If @name is not found, GenericError with an explanation
2115 # -> { "execute": "block-dirty-bitmap-disable",
2116 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2117 # <- { "return": {} }
2120 { 'command': 'block-dirty-bitmap-disable',
2121 'data': 'BlockDirtyBitmap' }
2124 # @block-dirty-bitmap-merge:
2126 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2127 # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2128 # as the @target bitmap. Any bits already set in @target will still be
2129 # set after the merge, i.e., this operation does not clear the target.
2130 # On error, @target is unchanged.
2132 # The resulting bitmap will count as dirty any clusters that were dirty in any
2133 # of the source bitmaps. This can be used to achieve backup checkpoints, or in
2134 # simpler usages, to copy bitmaps.
2136 # Returns: nothing on success
2137 # If @node is not a valid block device, DeviceNotFound
2138 # If any bitmap in @bitmaps or @target is not found, GenericError
2139 # If any of the bitmaps have different sizes or granularities,
2146 # -> { "execute": "block-dirty-bitmap-merge",
2147 # "arguments": { "node": "drive0", "target": "bitmap0",
2148 # "bitmaps": ["bitmap1"] } }
2149 # <- { "return": {} }
2152 { 'command': 'block-dirty-bitmap-merge',
2153 'data': 'BlockDirtyBitmapMerge' }
2156 # @BlockDirtyBitmapSha256:
2158 # SHA256 hash of dirty bitmap data
2160 # @sha256: ASCII representation of SHA256 bitmap hash
2164 { 'struct': 'BlockDirtyBitmapSha256',
2165 'data': {'sha256': 'str'} }
2168 # @x-debug-block-dirty-bitmap-sha256:
2170 # Get bitmap SHA256.
2172 # Returns: BlockDirtyBitmapSha256 on success
2173 # If @node is not a valid block device, DeviceNotFound
2174 # If @name is not found or if hashing has failed, GenericError with an
2179 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2180 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
2185 # Start mirroring a block device's writes to a new destination.
2187 # @job-id: identifier for the newly-created block job. If
2188 # omitted, the device name will be used. (Since 2.7)
2190 # @device: The device name or node-name of a root node whose writes should be
2193 # @target: the id or node-name of the block device to mirror to. This mustn't be
2194 # attached to guest.
2196 # @replaces: with sync=full graph node name to be replaced by the new
2197 # image when a whole image copy is done. This can be used to repair
2198 # broken Quorum files.
2200 # @speed: the maximum speed, in bytes per second
2202 # @sync: what parts of the disk image should be copied to the destination
2203 # (all the disk, only the sectors allocated in the topmost image, or
2206 # @granularity: granularity of the dirty bitmap, default is 64K
2207 # if the image format doesn't have clusters, 4K if the clusters
2208 # are smaller than that, else the cluster size. Must be a
2209 # power of 2 between 512 and 64M
2211 # @buf-size: maximum amount of data in flight from source to
2214 # @on-source-error: the action to take on an error on the source,
2215 # default 'report'. 'stop' and 'enospc' can only be used
2216 # if the block device supports io-status (see BlockInfo).
2218 # @on-target-error: the action to take on an error on the target,
2219 # default 'report' (no limitations, since this applies to
2220 # a different block device than @device).
2222 # @filter-node-name: the node name that should be assigned to the
2223 # filter driver that the mirror job inserts into the graph
2224 # above @device. If this option is not given, a node name is
2225 # autogenerated. (Since: 2.9)
2227 # @copy-mode: when to copy data to the destination; defaults to 'background'
2230 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2231 # finished its work, waiting for @block-job-finalize before
2232 # making any block graph changes.
2233 # When true, this job will automatically
2234 # perform its abort or commit actions.
2235 # Defaults to true. (Since 3.1)
2237 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2238 # has completely ceased all work, and awaits @block-job-dismiss.
2239 # When true, this job will automatically disappear from the query
2240 # list without user intervention.
2241 # Defaults to true. (Since 3.1)
2242 # Returns: nothing on success.
2248 # -> { "execute": "blockdev-mirror",
2249 # "arguments": { "device": "ide-hd0",
2250 # "target": "target0",
2251 # "sync": "full" } }
2252 # <- { "return": {} }
2255 { 'command': 'blockdev-mirror',
2256 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2258 'sync': 'MirrorSyncMode',
2259 '*speed': 'int', '*granularity': 'uint32',
2260 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2261 '*on-target-error': 'BlockdevOnError',
2262 '*filter-node-name': 'str',
2263 '*copy-mode': 'MirrorCopyMode',
2264 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2267 # @block_set_io_throttle:
2269 # Change I/O throttle limits for a block drive.
2271 # Since QEMU 2.4, each device with I/O limits is member of a throttle
2274 # If two or more devices are members of the same group, the limits
2275 # will apply to the combined I/O of the whole group in a round-robin
2276 # fashion. Therefore, setting new I/O limits to a device will affect
2279 # The name of the group can be specified using the 'group' parameter.
2280 # If the parameter is unset, it is assumed to be the current group of
2281 # that device. If it's not in any group yet, the name of the device
2282 # will be used as the name for its group.
2284 # The 'group' parameter can also be used to move a device to a
2285 # different group. In this case the limits specified in the parameters
2286 # will be applied to the new group only.
2288 # I/O limits can be disabled by setting all of them to 0. In this case
2289 # the device will be removed from its group and the rest of its
2290 # members will not be affected. The 'group' parameter is ignored.
2292 # Returns: Nothing on success
2293 # If @device is not a valid block device, DeviceNotFound
2299 # -> { "execute": "block_set_io_throttle",
2300 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
2313 # "bps_max_length": 0,
2314 # "iops_size": 0 } }
2315 # <- { "return": {} }
2317 # -> { "execute": "block_set_io_throttle",
2318 # "arguments": { "id": "ide0-1-0",
2325 # "bps_max": 8000000,
2331 # "bps_max_length": 60,
2332 # "iops_size": 0 } }
2333 # <- { "return": {} }
2335 { 'command': 'block_set_io_throttle', 'boxed': true,
2336 'data': 'BlockIOThrottle' }
2341 # A set of parameters describing block throttling.
2343 # @device: Block device name (deprecated, use @id instead)
2345 # @id: The name or QOM path of the guest device (since: 2.8)
2347 # @bps: total throughput limit in bytes per second
2349 # @bps_rd: read throughput limit in bytes per second
2351 # @bps_wr: write throughput limit in bytes per second
2353 # @iops: total I/O operations per second
2355 # @iops_rd: read I/O operations per second
2357 # @iops_wr: write I/O operations per second
2359 # @bps_max: total throughput limit during bursts,
2360 # in bytes (Since 1.7)
2362 # @bps_rd_max: read throughput limit during bursts,
2363 # in bytes (Since 1.7)
2365 # @bps_wr_max: write throughput limit during bursts,
2366 # in bytes (Since 1.7)
2368 # @iops_max: total I/O operations per second during bursts,
2369 # in bytes (Since 1.7)
2371 # @iops_rd_max: read I/O operations per second during bursts,
2372 # in bytes (Since 1.7)
2374 # @iops_wr_max: write I/O operations per second during bursts,
2375 # in bytes (Since 1.7)
2377 # @bps_max_length: maximum length of the @bps_max burst
2378 # period, in seconds. It must only
2379 # be set if @bps_max is set as well.
2380 # Defaults to 1. (Since 2.6)
2382 # @bps_rd_max_length: maximum length of the @bps_rd_max
2383 # burst period, in seconds. It must only
2384 # be set if @bps_rd_max is set as well.
2385 # Defaults to 1. (Since 2.6)
2387 # @bps_wr_max_length: maximum length of the @bps_wr_max
2388 # burst period, in seconds. It must only
2389 # be set if @bps_wr_max is set as well.
2390 # Defaults to 1. (Since 2.6)
2392 # @iops_max_length: maximum length of the @iops burst
2393 # period, in seconds. It must only
2394 # be set if @iops_max is set as well.
2395 # Defaults to 1. (Since 2.6)
2397 # @iops_rd_max_length: maximum length of the @iops_rd_max
2398 # burst period, in seconds. It must only
2399 # be set if @iops_rd_max is set as well.
2400 # Defaults to 1. (Since 2.6)
2402 # @iops_wr_max_length: maximum length of the @iops_wr_max
2403 # burst period, in seconds. It must only
2404 # be set if @iops_wr_max is set as well.
2405 # Defaults to 1. (Since 2.6)
2407 # @iops_size: an I/O size in bytes (Since 1.7)
2409 # @group: throttle group name (Since 2.4)
2413 { 'struct': 'BlockIOThrottle',
2414 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2415 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2416 '*bps_max': 'int', '*bps_rd_max': 'int',
2417 '*bps_wr_max': 'int', '*iops_max': 'int',
2418 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2419 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2420 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2421 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2422 '*iops_size': 'int', '*group': 'str' } }
2427 # Limit parameters for throttling.
2428 # Since some limit combinations are illegal, limits should always be set in one
2429 # transaction. All fields are optional. When setting limits, if a field is
2430 # missing the current value is not changed.
2432 # @iops-total: limit total I/O operations per second
2433 # @iops-total-max: I/O operations burst
2434 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2435 # It must only be set if @iops-total-max is set as well.
2436 # @iops-read: limit read operations per second
2437 # @iops-read-max: I/O operations read burst
2438 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2439 # It must only be set if @iops-read-max is set as well.
2440 # @iops-write: limit write operations per second
2441 # @iops-write-max: I/O operations write burst
2442 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2443 # It must only be set if @iops-write-max is set as well.
2444 # @bps-total: limit total bytes per second
2445 # @bps-total-max: total bytes burst
2446 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2447 # It must only be set if @bps-total-max is set as well.
2448 # @bps-read: limit read bytes per second
2449 # @bps-read-max: total bytes read burst
2450 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2451 # It must only be set if @bps-read-max is set as well.
2452 # @bps-write: limit write bytes per second
2453 # @bps-write-max: total bytes write burst
2454 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2455 # It must only be set if @bps-write-max is set as well.
2456 # @iops-size: when limiting by iops max size of an I/O in bytes
2460 { 'struct': 'ThrottleLimits',
2461 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2462 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2463 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2464 '*iops-write' : 'int', '*iops-write-max' : 'int',
2465 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2466 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2467 '*bps-read' : 'int', '*bps-read-max' : 'int',
2468 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2469 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2470 '*iops-size' : 'int' } }
2475 # Copy data from a backing file into a block device.
2477 # The block streaming operation is performed in the background until the entire
2478 # backing file has been copied. This command returns immediately once streaming
2479 # has started. The status of ongoing block streaming operations can be checked
2480 # with query-block-jobs. The operation can be stopped before it has completed
2481 # using the block-job-cancel command.
2483 # The node that receives the data is called the top image, can be located in
2484 # any part of the chain (but always above the base image; see below) and can be
2485 # specified using its device or node name. Earlier qemu versions only allowed
2486 # 'device' to name the top level node; presence of the 'base-node' parameter
2487 # during introspection can be used as a witness of the enhanced semantics
2490 # If a base file is specified then sectors are not copied from that base file and
2491 # its backing chain. When streaming completes the image file will have the base
2492 # file as its backing file. This can be used to stream a subset of the backing
2493 # file chain instead of flattening the entire image.
2495 # On successful completion the image file is updated to drop the backing file
2496 # and the BLOCK_JOB_COMPLETED event is emitted.
2498 # @job-id: identifier for the newly-created block job. If
2499 # omitted, the device name will be used. (Since 2.7)
2501 # @device: the device or node name of the top image
2503 # @base: the common backing file name.
2504 # It cannot be set if @base-node is also set.
2506 # @base-node: the node name of the backing file.
2507 # It cannot be set if @base is also set. (Since 2.8)
2509 # @backing-file: The backing file string to write into the top
2510 # image. This filename is not validated.
2512 # If a pathname string is such that it cannot be
2513 # resolved by QEMU, that means that subsequent QMP or
2514 # HMP commands must use node-names for the image in
2515 # question, as filename lookup methods will fail.
2517 # If not specified, QEMU will automatically determine
2518 # the backing file string to use, or error out if there
2519 # is no obvious choice. Care should be taken when
2520 # specifying the string, to specify a valid filename or
2524 # @speed: the maximum speed, in bytes per second
2526 # @on-error: the action to take on an error (default report).
2527 # 'stop' and 'enospc' can only be used if the block device
2528 # supports io-status (see BlockInfo). Since 1.3.
2530 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2531 # finished its work, waiting for @block-job-finalize before
2532 # making any block graph changes.
2533 # When true, this job will automatically
2534 # perform its abort or commit actions.
2535 # Defaults to true. (Since 3.1)
2537 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2538 # has completely ceased all work, and awaits @block-job-dismiss.
2539 # When true, this job will automatically disappear from the query
2540 # list without user intervention.
2541 # Defaults to true. (Since 3.1)
2543 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
2549 # -> { "execute": "block-stream",
2550 # "arguments": { "device": "virtio0",
2551 # "base": "/tmp/master.qcow2" } }
2552 # <- { "return": {} }
2555 { 'command': 'block-stream',
2556 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2557 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2558 '*on-error': 'BlockdevOnError',
2559 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2562 # @block-job-set-speed:
2564 # Set maximum speed for a background block operation.
2566 # This command can only be issued when there is an active block job.
2568 # Throttling can be disabled by setting the speed to 0.
2570 # @device: The job identifier. This used to be a device name (hence
2571 # the name of the parameter), but since QEMU 2.7 it can have
2574 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2577 # Returns: Nothing on success
2578 # If no background operation is active on this device, DeviceNotActive
2582 { 'command': 'block-job-set-speed',
2583 'data': { 'device': 'str', 'speed': 'int' } }
2586 # @block-job-cancel:
2588 # Stop an active background block operation.
2590 # This command returns immediately after marking the active background block
2591 # operation for cancellation. It is an error to call this command if no
2592 # operation is in progress.
2594 # The operation will cancel as soon as possible and then emit the
2595 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2596 # enumerated using query-block-jobs.
2598 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2599 # (via the event BLOCK_JOB_READY) that the source and destination are
2600 # synchronized, then the event triggered by this command changes to
2601 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2602 # destination now has a point-in-time copy tied to the time of the cancellation.
2604 # For streaming, the image file retains its backing file unless the streaming
2605 # operation happens to complete just as it is being cancelled. A new streaming
2606 # operation can be started at a later time to finish copying all data from the
2609 # @device: The job identifier. This used to be a device name (hence
2610 # the name of the parameter), but since QEMU 2.7 it can have
2613 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2614 # abandon the job immediately (even if it is paused) instead of waiting
2615 # for the destination to complete its final synchronization (since 1.3)
2617 # Returns: Nothing on success
2618 # If no background operation is active on this device, DeviceNotActive
2622 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2627 # Pause an active background block operation.
2629 # This command returns immediately after marking the active background block
2630 # operation for pausing. It is an error to call this command if no
2631 # operation is in progress or if the job is already paused.
2633 # The operation will pause as soon as possible. No event is emitted when
2634 # the operation is actually paused. Cancelling a paused job automatically
2637 # @device: The job identifier. This used to be a device name (hence
2638 # the name of the parameter), but since QEMU 2.7 it can have
2641 # Returns: Nothing on success
2642 # If no background operation is active on this device, DeviceNotActive
2646 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2649 # @block-job-resume:
2651 # Resume an active background block operation.
2653 # This command returns immediately after resuming a paused background block
2654 # operation. It is an error to call this command if no operation is in
2655 # progress or if the job is not paused.
2657 # This command also clears the error status of the job.
2659 # @device: The job identifier. This used to be a device name (hence
2660 # the name of the parameter), but since QEMU 2.7 it can have
2663 # Returns: Nothing on success
2664 # If no background operation is active on this device, DeviceNotActive
2668 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2671 # @block-job-complete:
2673 # Manually trigger completion of an active background block operation. This
2674 # is supported for drive mirroring, where it also switches the device to
2675 # write to the target path only. The ability to complete is signaled with
2676 # a BLOCK_JOB_READY event.
2678 # This command completes an active background block operation synchronously.
2679 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2680 # is not defined. Note that if an I/O error occurs during the processing of
2681 # this command: 1) the command itself will fail; 2) the error will be processed
2682 # according to the rerror/werror arguments that were specified when starting
2685 # A cancelled or paused job cannot be completed.
2687 # @device: The job identifier. This used to be a device name (hence
2688 # the name of the parameter), but since QEMU 2.7 it can have
2691 # Returns: Nothing on success
2692 # If no background operation is active on this device, DeviceNotActive
2696 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2699 # @block-job-dismiss:
2701 # For jobs that have already concluded, remove them from the block-job-query
2702 # list. This command only needs to be run for jobs which were started with
2703 # QEMU 2.12+ job lifetime management semantics.
2705 # This command will refuse to operate on any job that has not yet reached
2706 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2707 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2708 # to be used as appropriate.
2710 # @id: The job identifier.
2712 # Returns: Nothing on success
2716 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2719 # @block-job-finalize:
2721 # Once a job that has manual=true reaches the pending state, it can be
2722 # instructed to finalize any graph changes and do any necessary cleanup
2724 # For jobs in a transaction, instructing one job to finalize will force
2725 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2726 # a single member job to finalize.
2728 # @id: The job identifier.
2730 # Returns: Nothing on success
2734 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2737 # @BlockdevDiscardOptions:
2739 # Determines how to handle discard requests.
2741 # @ignore: Ignore the request
2742 # @unmap: Forward as an unmap request
2746 { 'enum': 'BlockdevDiscardOptions',
2747 'data': [ 'ignore', 'unmap' ] }
2750 # @BlockdevDetectZeroesOptions:
2752 # Describes the operation mode for the automatic conversion of plain
2753 # zero writes by the OS to driver specific optimized zero write commands.
2755 # @off: Disabled (default)
2757 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2758 # also that @BlockdevDiscardOptions is set to unmap for this device.
2762 { 'enum': 'BlockdevDetectZeroesOptions',
2763 'data': [ 'off', 'on', 'unmap' ] }
2766 # @BlockdevAioOptions:
2768 # Selects the AIO backend to handle I/O requests
2770 # @threads: Use qemu's thread pool
2771 # @native: Use native AIO backend (only Linux and Windows)
2775 { 'enum': 'BlockdevAioOptions',
2776 'data': [ 'threads', 'native' ] }
2779 # @BlockdevCacheOptions:
2781 # Includes cache-related options for block devices
2783 # @direct: enables use of O_DIRECT (bypass the host page cache;
2785 # @no-flush: ignore any flush requests for the device (default:
2790 { 'struct': 'BlockdevCacheOptions',
2791 'data': { '*direct': 'bool',
2792 '*no-flush': 'bool' } }
2797 # Drivers that are supported in block device operations.
2800 # @throttle: Since 2.11
2802 # @copy-on-read: Since 3.0
2803 # @blklogwrites: Since 3.0
2807 { 'enum': 'BlockdevDriver',
2808 'data': [ 'blkdebug', 'blklogwrites', 'blkverify', 'bochs', 'cloop',
2809 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps', 'gluster',
2810 'host_cdrom', 'host_device', 'http', 'https', 'iscsi', 'luks',
2811 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels', 'qcow',
2812 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
2813 { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
2815 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2818 # @BlockdevOptionsFile:
2820 # Driver specific block device options for the file backend.
2822 # @filename: path to the image file
2823 # @pr-manager: the id for the object that will handle persistent reservations
2824 # for this device (default: none, forward the commands via SG_IO;
2826 # @aio: AIO backend (default: threads) (since: 2.8)
2827 # @locking: whether to enable file locking. If set to 'auto', only enable
2828 # when Open File Descriptor (OFD) locking API is available
2829 # (default: auto, since 2.10)
2830 # @drop-cache: invalidate page cache during live migration. This prevents
2831 # stale data on the migration destination with cache.direct=off.
2832 # Currently only supported on Linux hosts.
2833 # (default: on, since: 4.0)
2834 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2835 # migration. May cause noticeable delays if the image
2836 # file is large, do not use in production.
2837 # (default: off) (since: 3.0)
2840 # @dynamic-auto-read-only: If present, enabled auto-read-only means that the
2841 # driver will open the image read-only at first,
2842 # dynamically reopen the image file read-write when
2843 # the first writer is attached to the node and reopen
2844 # read-only when the last writer is detached. This
2845 # allows giving QEMU write permissions only on demand
2846 # when an operation actually needs write access.
2850 { 'struct': 'BlockdevOptionsFile',
2851 'data': { 'filename': 'str',
2852 '*pr-manager': 'str',
2853 '*locking': 'OnOffAuto',
2854 '*aio': 'BlockdevAioOptions',
2855 '*drop-cache': {'type': 'bool',
2856 'if': 'defined(CONFIG_LINUX)'},
2857 '*x-check-cache-dropped': 'bool' },
2858 'features': [ { 'name': 'dynamic-auto-read-only',
2859 'if': 'defined(CONFIG_POSIX)' } ] }
2862 # @BlockdevOptionsNull:
2864 # Driver specific block device options for the null backend.
2866 # @size: size of the device in bytes.
2867 # @latency-ns: emulated latency (in nanoseconds) in processing
2868 # requests. Default to zero which completes requests immediately.
2870 # @read-zeroes: if true, reads from the device produce zeroes; if false, the
2871 # buffer is left unchanged. (default: false; since: 4.1)
2875 { 'struct': 'BlockdevOptionsNull',
2876 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
2879 # @BlockdevOptionsNVMe:
2881 # Driver specific block device options for the NVMe backend.
2883 # @device: controller address of the NVMe device.
2884 # @namespace: namespace number of the device, starting from 1.
2888 { 'struct': 'BlockdevOptionsNVMe',
2889 'data': { 'device': 'str', 'namespace': 'int' } }
2892 # @BlockdevOptionsVVFAT:
2894 # Driver specific block device options for the vvfat protocol.
2896 # @dir: directory to be exported as FAT image
2897 # @fat-type: FAT type: 12, 16 or 32
2898 # @floppy: whether to export a floppy image (true) or
2899 # partitioned hard disk (false; default)
2900 # @label: set the volume label, limited to 11 bytes. FAT16 and
2901 # FAT32 traditionally have some restrictions on labels, which are
2902 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2904 # @rw: whether to allow write operations (default: false)
2908 { 'struct': 'BlockdevOptionsVVFAT',
2909 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2910 '*label': 'str', '*rw': 'bool' } }
2913 # @BlockdevOptionsGenericFormat:
2915 # Driver specific block device options for image format that have no option
2916 # besides their data source.
2918 # @file: reference to or definition of the data source block device
2922 { 'struct': 'BlockdevOptionsGenericFormat',
2923 'data': { 'file': 'BlockdevRef' } }
2926 # @BlockdevOptionsLUKS:
2928 # Driver specific block device options for LUKS.
2930 # @key-secret: the ID of a QCryptoSecret object providing
2931 # the decryption key (since 2.6). Mandatory except when
2932 # doing a metadata-only probe of the image.
2936 { 'struct': 'BlockdevOptionsLUKS',
2937 'base': 'BlockdevOptionsGenericFormat',
2938 'data': { '*key-secret': 'str' } }
2942 # @BlockdevOptionsGenericCOWFormat:
2944 # Driver specific block device options for image format that have no option
2945 # besides their data source and an optional backing file.
2947 # @backing: reference to or definition of the backing file block
2948 # device, null disables the backing file entirely.
2949 # Defaults to the backing file stored the image file.
2953 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2954 'base': 'BlockdevOptionsGenericFormat',
2955 'data': { '*backing': 'BlockdevRefOrNull' } }
2958 # @Qcow2OverlapCheckMode:
2960 # General overlap check modes.
2962 # @none: Do not perform any checks
2964 # @constant: Perform only checks which can be done in constant time and
2965 # without reading anything from disk
2967 # @cached: Perform only checks which can be done without reading anything
2970 # @all: Perform all available overlap checks
2974 { 'enum': 'Qcow2OverlapCheckMode',
2975 'data': [ 'none', 'constant', 'cached', 'all' ] }
2978 # @Qcow2OverlapCheckFlags:
2980 # Structure of flags for each metadata structure. Setting a field to 'true'
2981 # makes qemu guard that structure against unintended overwriting. The default
2982 # value is chosen according to the template given.
2984 # @template: Specifies a template mode which can be adjusted using the other
2985 # flags, defaults to 'cached'
2987 # @bitmap-directory: since 3.0
2991 { 'struct': 'Qcow2OverlapCheckFlags',
2992 'data': { '*template': 'Qcow2OverlapCheckMode',
2993 '*main-header': 'bool',
2994 '*active-l1': 'bool',
2995 '*active-l2': 'bool',
2996 '*refcount-table': 'bool',
2997 '*refcount-block': 'bool',
2998 '*snapshot-table': 'bool',
2999 '*inactive-l1': 'bool',
3000 '*inactive-l2': 'bool',
3001 '*bitmap-directory': 'bool' } }
3004 # @Qcow2OverlapChecks:
3006 # Specifies which metadata structures should be guarded against unintended
3009 # @flags: set of flags for separate specification of each metadata structure
3012 # @mode: named mode which chooses a specific set of flags
3016 { 'alternate': 'Qcow2OverlapChecks',
3017 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3018 'mode': 'Qcow2OverlapCheckMode' } }
3021 # @BlockdevQcowEncryptionFormat:
3023 # @aes: AES-CBC with plain64 initialization vectors
3027 { 'enum': 'BlockdevQcowEncryptionFormat',
3031 # @BlockdevQcowEncryption:
3035 { 'union': 'BlockdevQcowEncryption',
3036 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3037 'discriminator': 'format',
3038 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3041 # @BlockdevOptionsQcow:
3043 # Driver specific block device options for qcow.
3045 # @encrypt: Image decryption options. Mandatory for
3046 # encrypted images, except when doing a metadata-only
3047 # probe of the image.
3051 { 'struct': 'BlockdevOptionsQcow',
3052 'base': 'BlockdevOptionsGenericCOWFormat',
3053 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3058 # @BlockdevQcow2EncryptionFormat:
3059 # @aes: AES-CBC with plain64 initialization vectors
3063 { 'enum': 'BlockdevQcow2EncryptionFormat',
3064 'data': [ 'aes', 'luks' ] }
3067 # @BlockdevQcow2Encryption:
3071 { 'union': 'BlockdevQcow2Encryption',
3072 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3073 'discriminator': 'format',
3074 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3075 'luks': 'QCryptoBlockOptionsLUKS'} }
3078 # @BlockdevOptionsQcow2:
3080 # Driver specific block device options for qcow2.
3082 # @lazy-refcounts: whether to enable the lazy refcounts
3083 # feature (default is taken from the image file)
3085 # @pass-discard-request: whether discard requests to the qcow2
3086 # device should be forwarded to the data source
3088 # @pass-discard-snapshot: whether discard requests for the data source
3089 # should be issued when a snapshot operation (e.g.
3090 # deleting a snapshot) frees clusters in the qcow2 file
3092 # @pass-discard-other: whether discard requests for the data source
3093 # should be issued on other occasions where a cluster
3096 # @overlap-check: which overlap checks to perform for writes
3097 # to the image, defaults to 'cached' (since 2.2)
3099 # @cache-size: the maximum total size of the L2 table and
3100 # refcount block caches in bytes (since 2.2)
3102 # @l2-cache-size: the maximum size of the L2 table cache in
3105 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3106 # bytes. It must be a power of two between 512
3107 # and the cluster size. The default value is
3108 # the cluster size (since 2.12)
3110 # @refcount-cache-size: the maximum size of the refcount block cache
3111 # in bytes (since 2.2)
3113 # @cache-clean-interval: clean unused entries in the L2 and refcount
3114 # caches. The interval is in seconds. The default value
3115 # is 600 on supporting platforms, and 0 on other
3116 # platforms. 0 disables this feature. (since 2.5)
3118 # @encrypt: Image decryption options. Mandatory for
3119 # encrypted images, except when doing a metadata-only
3120 # probe of the image. (since 2.10)
3122 # @data-file: reference to or definition of the external data file.
3123 # This may only be specified for images that require an
3124 # external data file. If it is not specified for such
3125 # an image, the data file name is loaded from the image
3130 { 'struct': 'BlockdevOptionsQcow2',
3131 'base': 'BlockdevOptionsGenericCOWFormat',
3132 'data': { '*lazy-refcounts': 'bool',
3133 '*pass-discard-request': 'bool',
3134 '*pass-discard-snapshot': 'bool',
3135 '*pass-discard-other': 'bool',
3136 '*overlap-check': 'Qcow2OverlapChecks',
3137 '*cache-size': 'int',
3138 '*l2-cache-size': 'int',
3139 '*l2-cache-entry-size': 'int',
3140 '*refcount-cache-size': 'int',
3141 '*cache-clean-interval': 'int',
3142 '*encrypt': 'BlockdevQcow2Encryption',
3143 '*data-file': 'BlockdevRef' } }
3146 # @SshHostKeyCheckMode:
3148 # @none Don't check the host key at all
3149 # @hash Compare the host key with a given hash
3150 # @known_hosts Check the host key against the known_hosts file
3154 { 'enum': 'SshHostKeyCheckMode',
3155 'data': [ 'none', 'hash', 'known_hosts' ] }
3158 # @SshHostKeyCheckHashType:
3160 # @md5 The given hash is an md5 hash
3161 # @sha1 The given hash is an sha1 hash
3165 { 'enum': 'SshHostKeyCheckHashType',
3166 'data': [ 'md5', 'sha1' ] }
3171 # @type The hash algorithm used for the hash
3172 # @hash The expected hash value
3176 { 'struct': 'SshHostKeyHash',
3177 'data': { 'type': 'SshHostKeyCheckHashType',
3185 { 'union': 'SshHostKeyCheck',
3186 'base': { 'mode': 'SshHostKeyCheckMode' },
3187 'discriminator': 'mode',
3188 'data': { 'hash': 'SshHostKeyHash' } }
3191 # @BlockdevOptionsSsh:
3193 # @server: host address
3195 # @path: path to the image on the host
3197 # @user: user as which to connect, defaults to current
3200 # @host-key-check: Defines how and what to check the host key against
3201 # (default: known_hosts)
3205 { 'struct': 'BlockdevOptionsSsh',
3206 'data': { 'server': 'InetSocketAddress',
3209 '*host-key-check': 'SshHostKeyCheck' } }
3215 # Trigger events supported by blkdebug.
3217 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3220 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3222 # @cor_write: a write due to copy-on-read (since 2.11)
3224 # @cluster_alloc_space: an allocation of file space for a cluster (since 4.1)
3226 # @none: triggers once at creation of the blkdebug node (since 4.1)
3230 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3231 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3232 'l1_grow_activate_table', 'l2_load', 'l2_update',
3233 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3234 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3235 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3236 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3237 'refblock_load', 'refblock_update', 'refblock_update_part',
3238 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3239 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3240 'refblock_alloc_switch_table', 'cluster_alloc',
3241 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3242 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3243 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3244 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3245 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3246 'cor_write', 'cluster_alloc_space', 'none'] }
3251 # Kinds of I/O that blkdebug can inject errors in.
3253 # @read: .bdrv_co_preadv()
3255 # @write: .bdrv_co_pwritev()
3257 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3259 # @discard: .bdrv_co_pdiscard()
3261 # @flush: .bdrv_co_flush_to_disk()
3263 # @block-status: .bdrv_co_block_status()
3267 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3268 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3272 # @BlkdebugInjectErrorOptions:
3274 # Describes a single error injection for blkdebug.
3276 # @event: trigger event
3278 # @state: the state identifier blkdebug needs to be in to
3279 # actually trigger the event; defaults to "any"
3281 # @iotype: the type of I/O operations on which this error should
3282 # be injected; defaults to "all read, write,
3283 # write-zeroes, discard, and flush operations"
3286 # @errno: error identifier (errno) to be returned; defaults to
3289 # @sector: specifies the sector index which has to be affected
3290 # in order to actually trigger the event; defaults to "any
3293 # @once: disables further events after this one has been
3294 # triggered; defaults to false
3296 # @immediately: fail immediately; defaults to false
3300 { 'struct': 'BlkdebugInjectErrorOptions',
3301 'data': { 'event': 'BlkdebugEvent',
3303 '*iotype': 'BlkdebugIOType',
3307 '*immediately': 'bool' } }
3310 # @BlkdebugSetStateOptions:
3312 # Describes a single state-change event for blkdebug.
3314 # @event: trigger event
3316 # @state: the current state identifier blkdebug needs to be in;
3319 # @new_state: the state identifier blkdebug is supposed to assume if
3320 # this event is triggered
3324 { 'struct': 'BlkdebugSetStateOptions',
3325 'data': { 'event': 'BlkdebugEvent',
3327 'new_state': 'int' } }
3330 # @BlockdevOptionsBlkdebug:
3332 # Driver specific block device options for blkdebug.
3334 # @image: underlying raw block device (or image file)
3336 # @config: filename of the configuration file
3338 # @align: required alignment for requests in bytes, must be
3339 # positive power of 2, or 0 for default
3341 # @max-transfer: maximum size for I/O transfers in bytes, must be
3342 # positive multiple of @align and of the underlying
3343 # file's request alignment (but need not be a power of
3344 # 2), or 0 for default (since 2.10)
3346 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3347 # must be positive multiple of @align and of the
3348 # underlying file's request alignment (but need not be a
3349 # power of 2), or 0 for default (since 2.10)
3351 # @max-write-zero: maximum size for write zero requests in bytes, must be
3352 # positive multiple of @align, of @opt-write-zero, and of
3353 # the underlying file's request alignment (but need not
3354 # be a power of 2), or 0 for default (since 2.10)
3356 # @opt-discard: preferred alignment for discard requests in bytes, must
3357 # be positive multiple of @align and of the underlying
3358 # file's request alignment (but need not be a power of
3359 # 2), or 0 for default (since 2.10)
3361 # @max-discard: maximum size for discard requests in bytes, must be
3362 # positive multiple of @align, of @opt-discard, and of
3363 # the underlying file's request alignment (but need not
3364 # be a power of 2), or 0 for default (since 2.10)
3366 # @inject-error: array of error injection descriptions
3368 # @set-state: array of state-change descriptions
3372 { 'struct': 'BlockdevOptionsBlkdebug',
3373 'data': { 'image': 'BlockdevRef',
3375 '*align': 'int', '*max-transfer': 'int32',
3376 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3377 '*opt-discard': 'int32', '*max-discard': 'int32',
3378 '*inject-error': ['BlkdebugInjectErrorOptions'],
3379 '*set-state': ['BlkdebugSetStateOptions'] } }
3382 # @BlockdevOptionsBlklogwrites:
3384 # Driver specific block device options for blklogwrites.
3386 # @file: block device
3388 # @log: block device used to log writes to @file
3390 # @log-sector-size: sector size used in logging writes to @file, determines
3391 # granularity of offsets and sizes of writes (default: 512)
3393 # @log-append: append to an existing log (default: false)
3395 # @log-super-update-interval: interval of write requests after which the log
3396 # super block is updated to disk (default: 4096)
3400 { 'struct': 'BlockdevOptionsBlklogwrites',
3401 'data': { 'file': 'BlockdevRef',
3402 'log': 'BlockdevRef',
3403 '*log-sector-size': 'uint32',
3404 '*log-append': 'bool',
3405 '*log-super-update-interval': 'uint64' } }
3408 # @BlockdevOptionsBlkverify:
3410 # Driver specific block device options for blkverify.
3412 # @test: block device to be tested
3414 # @raw: raw image used for verification
3418 { 'struct': 'BlockdevOptionsBlkverify',
3419 'data': { 'test': 'BlockdevRef',
3420 'raw': 'BlockdevRef' } }
3423 # @QuorumReadPattern:
3425 # An enumeration of quorum read patterns.
3427 # @quorum: read all the children and do a quorum vote on reads
3429 # @fifo: read only from the first child that has not failed
3433 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3436 # @BlockdevOptionsQuorum:
3438 # Driver specific block device options for Quorum
3440 # @blkverify: true if the driver must print content mismatch
3441 # set to false by default
3443 # @children: the children block devices to use
3445 # @vote-threshold: the vote limit under which a read will fail
3447 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3450 # @read-pattern: choose read pattern and set to quorum by default
3455 { 'struct': 'BlockdevOptionsQuorum',
3456 'data': { '*blkverify': 'bool',
3457 'children': [ 'BlockdevRef' ],
3458 'vote-threshold': 'int',
3459 '*rewrite-corrupted': 'bool',
3460 '*read-pattern': 'QuorumReadPattern' } }
3463 # @BlockdevOptionsGluster:
3465 # Driver specific block device options for Gluster
3467 # @volume: name of gluster volume where VM image resides
3469 # @path: absolute path to image file in gluster volume
3471 # @server: gluster servers description
3473 # @debug: libgfapi log level (default '4' which is Error)
3476 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3480 { 'struct': 'BlockdevOptionsGluster',
3481 'data': { 'volume': 'str',
3483 'server': ['SocketAddress'],
3485 '*logfile': 'str' } }
3490 # An enumeration of libiscsi transport types
3494 { 'enum': 'IscsiTransport',
3495 'data': [ 'tcp', 'iser' ] }
3498 # @IscsiHeaderDigest:
3500 # An enumeration of header digests supported by libiscsi
3504 { 'enum': 'IscsiHeaderDigest',
3505 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3506 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3509 # @BlockdevOptionsIscsi:
3511 # @transport: The iscsi transport type
3513 # @portal: The address of the iscsi portal
3515 # @target: The target iqn name
3517 # @lun: LUN to connect to. Defaults to 0.
3519 # @user: User name to log in with. If omitted, no CHAP
3520 # authentication is performed.
3522 # @password-secret: The ID of a QCryptoSecret object providing
3523 # the password for the login. This option is required if
3524 # @user is specified.
3526 # @initiator-name: The iqn name we want to identify to the target
3527 # as. If this option is not specified, an initiator name is
3528 # generated automatically.
3530 # @header-digest: The desired header digest. Defaults to
3533 # @timeout: Timeout in seconds after which a request will
3534 # timeout. 0 means no timeout and is the default.
3536 # Driver specific block device options for iscsi
3540 { 'struct': 'BlockdevOptionsIscsi',
3541 'data': { 'transport': 'IscsiTransport',
3546 '*password-secret': 'str',
3547 '*initiator-name': 'str',
3548 '*header-digest': 'IscsiHeaderDigest',
3549 '*timeout': 'int' } }
3557 { 'enum': 'RbdAuthMode',
3558 'data': [ 'cephx', 'none' ] }
3561 # @BlockdevOptionsRbd:
3563 # @pool: Ceph pool name.
3565 # @image: Image name in the Ceph pool.
3567 # @conf: path to Ceph configuration file. Values
3568 # in the configuration file will be overridden by
3569 # options specified via QAPI.
3571 # @snapshot: Ceph snapshot name.
3573 # @user: Ceph id name.
3575 # @auth-client-required: Acceptable authentication modes.
3576 # This maps to Ceph configuration option
3577 # "auth_client_required". (Since 3.0)
3579 # @key-secret: ID of a QCryptoSecret object providing a key
3580 # for cephx authentication.
3581 # This maps to Ceph configuration option
3582 # "key". (Since 3.0)
3584 # @server: Monitor host address and port. This maps
3585 # to the "mon_host" Ceph option.
3589 { 'struct': 'BlockdevOptionsRbd',
3590 'data': { 'pool': 'str',
3595 '*auth-client-required': ['RbdAuthMode'],
3596 '*key-secret': 'str',
3597 '*server': ['InetSocketAddressBase'] } }
3600 # @BlockdevOptionsSheepdog:
3602 # Driver specific block device options for sheepdog
3604 # @vdi: Virtual disk image name
3605 # @server: The Sheepdog server to connect to
3606 # @snap-id: Snapshot ID
3607 # @tag: Snapshot tag name
3609 # Only one of @snap-id and @tag may be present.
3613 { 'struct': 'BlockdevOptionsSheepdog',
3614 'data': { 'server': 'SocketAddress',
3616 '*snap-id': 'uint32',
3622 # An enumeration of replication modes.
3624 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3626 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3630 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3631 'if': 'defined(CONFIG_REPLICATION)' }
3634 # @BlockdevOptionsReplication:
3636 # Driver specific block device options for replication
3638 # @mode: the replication mode
3640 # @top-id: In secondary mode, node name or device ID of the root
3641 # node who owns the replication node chain. Must not be given in
3646 { 'struct': 'BlockdevOptionsReplication',
3647 'base': 'BlockdevOptionsGenericFormat',
3648 'data': { 'mode': 'ReplicationMode',
3650 'if': 'defined(CONFIG_REPLICATION)' }
3655 # An enumeration of NFS transport types
3657 # @inet: TCP transport
3661 { 'enum': 'NFSTransport',
3662 'data': [ 'inet' ] }
3667 # Captures the address of the socket
3669 # @type: transport type used for NFS (only TCP supported)
3671 # @host: host address for NFS server
3675 { 'struct': 'NFSServer',
3676 'data': { 'type': 'NFSTransport',
3680 # @BlockdevOptionsNfs:
3682 # Driver specific block device option for NFS
3684 # @server: host address
3686 # @path: path of the image on the host
3688 # @user: UID value to use when talking to the
3689 # server (defaults to 65534 on Windows and getuid()
3692 # @group: GID value to use when talking to the
3693 # server (defaults to 65534 on Windows and getgid()
3696 # @tcp-syn-count: number of SYNs during the session
3697 # establishment (defaults to libnfs default)
3699 # @readahead-size: set the readahead size in bytes (defaults
3700 # to libnfs default)
3702 # @page-cache-size: set the pagecache size in bytes (defaults
3703 # to libnfs default)
3705 # @debug: set the NFS debug level (max 2) (defaults
3706 # to libnfs default)
3710 { 'struct': 'BlockdevOptionsNfs',
3711 'data': { 'server': 'NFSServer',
3715 '*tcp-syn-count': 'int',
3716 '*readahead-size': 'int',
3717 '*page-cache-size': 'int',
3721 # @BlockdevOptionsCurlBase:
3723 # Driver specific block device options shared by all protocols supported by the
3726 # @url: URL of the image file
3728 # @readahead: Size of the read-ahead cache; must be a multiple of
3729 # 512 (defaults to 256 kB)
3731 # @timeout: Timeout for connections, in seconds (defaults to 5)
3733 # @username: Username for authentication (defaults to none)
3735 # @password-secret: ID of a QCryptoSecret object providing a password
3736 # for authentication (defaults to no password)
3738 # @proxy-username: Username for proxy authentication (defaults to none)
3740 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3741 # for proxy authentication (defaults to no password)
3745 { 'struct': 'BlockdevOptionsCurlBase',
3746 'data': { 'url': 'str',
3747 '*readahead': 'int',
3750 '*password-secret': 'str',
3751 '*proxy-username': 'str',
3752 '*proxy-password-secret': 'str' } }
3755 # @BlockdevOptionsCurlHttp:
3757 # Driver specific block device options for HTTP connections over the curl
3758 # backend. URLs must start with "http://".
3760 # @cookie: List of cookies to set; format is
3761 # "name1=content1; name2=content2;" as explained by
3762 # CURLOPT_COOKIE(3). Defaults to no cookies.
3764 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3765 # secure way. See @cookie for the format. (since 2.10)
3769 { 'struct': 'BlockdevOptionsCurlHttp',
3770 'base': 'BlockdevOptionsCurlBase',
3771 'data': { '*cookie': 'str',
3772 '*cookie-secret': 'str'} }
3775 # @BlockdevOptionsCurlHttps:
3777 # Driver specific block device options for HTTPS connections over the curl
3778 # backend. URLs must start with "https://".
3780 # @cookie: List of cookies to set; format is
3781 # "name1=content1; name2=content2;" as explained by
3782 # CURLOPT_COOKIE(3). Defaults to no cookies.
3784 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3787 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3788 # secure way. See @cookie for the format. (since 2.10)
3792 { 'struct': 'BlockdevOptionsCurlHttps',
3793 'base': 'BlockdevOptionsCurlBase',
3794 'data': { '*cookie': 'str',
3795 '*sslverify': 'bool',
3796 '*cookie-secret': 'str'} }
3799 # @BlockdevOptionsCurlFtp:
3801 # Driver specific block device options for FTP connections over the curl
3802 # backend. URLs must start with "ftp://".
3806 { 'struct': 'BlockdevOptionsCurlFtp',
3807 'base': 'BlockdevOptionsCurlBase',
3811 # @BlockdevOptionsCurlFtps:
3813 # Driver specific block device options for FTPS connections over the curl
3814 # backend. URLs must start with "ftps://".
3816 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3821 { 'struct': 'BlockdevOptionsCurlFtps',
3822 'base': 'BlockdevOptionsCurlBase',
3823 'data': { '*sslverify': 'bool' } }
3826 # @BlockdevOptionsNbd:
3828 # Driver specific block device options for NBD.
3830 # @server: NBD server address
3832 # @export: export name
3834 # @tls-creds: TLS credentials ID
3836 # @x-dirty-bitmap: A "qemu:dirty-bitmap:NAME" string to query in place of
3837 # traditional "base:allocation" block status (see
3838 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol) (since 3.0)
3840 # @reconnect-delay: On an unexpected disconnect, the nbd client tries to
3841 # connect again until succeeding or encountering a serious
3842 # error. During the first @reconnect-delay seconds, all
3843 # requests are paused and will be rerun on a successful
3844 # reconnect. After that time, any delayed requests and all
3845 # future requests before a successful reconnect will
3846 # immediately fail. Default 0 (Since 4.2)
3850 { 'struct': 'BlockdevOptionsNbd',
3851 'data': { 'server': 'SocketAddress',
3853 '*tls-creds': 'str',
3854 '*x-dirty-bitmap': 'str',
3855 '*reconnect-delay': 'uint32' } }
3858 # @BlockdevOptionsRaw:
3860 # Driver specific block device options for the raw driver.
3862 # @offset: position where the block device starts
3863 # @size: the assumed size of the device
3867 { 'struct': 'BlockdevOptionsRaw',
3868 'base': 'BlockdevOptionsGenericFormat',
3869 'data': { '*offset': 'int', '*size': 'int' } }
3872 # @BlockdevOptionsVxHS:
3874 # Driver specific block device options for VxHS
3876 # @vdisk-id: UUID of VxHS volume
3877 # @server: vxhs server IP, port
3878 # @tls-creds: TLS credentials ID
3882 { 'struct': 'BlockdevOptionsVxHS',
3883 'data': { 'vdisk-id': 'str',
3884 'server': 'InetSocketAddressBase',
3885 '*tls-creds': 'str' } }
3888 # @BlockdevOptionsThrottle:
3890 # Driver specific block device options for the throttle driver
3892 # @throttle-group: the name of the throttle-group object to use. It
3893 # must already exist.
3894 # @file: reference to or definition of the data source block device
3897 { 'struct': 'BlockdevOptionsThrottle',
3898 'data': { 'throttle-group': 'str',
3899 'file' : 'BlockdevRef'
3904 # Options for creating a block device. Many options are available for all
3905 # block devices, independent of the block driver:
3907 # @driver: block driver name
3908 # @node-name: the node name of the new node (Since 2.0).
3909 # This option is required on the top level of blockdev-add.
3910 # Valid node names start with an alphabetic character and may
3911 # contain only alphanumeric characters, '-', '.' and '_'. Their
3912 # maximum length is 31 characters.
3913 # @discard: discard-related options (default: ignore)
3914 # @cache: cache-related options
3915 # @read-only: whether the block device should be read-only (default: false).
3916 # Note that some block drivers support only read-only access,
3917 # either generally or in certain configurations. In this case,
3918 # the default value does not work and the option must be
3919 # specified explicitly.
3920 # @auto-read-only: if true and @read-only is false, QEMU may automatically
3921 # decide not to open the image read-write as requested, but
3922 # fall back to read-only instead (and switch between the modes
3923 # later), e.g. depending on whether the image file is writable
3924 # or whether a writing user is attached to the node
3925 # (default: false, since 3.1)
3926 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3928 # @force-share: force share all permission on added nodes.
3929 # Requires read-only=true. (Since 2.10)
3931 # Remaining options are determined by the block driver.
3935 { 'union': 'BlockdevOptions',
3936 'base': { 'driver': 'BlockdevDriver',
3937 '*node-name': 'str',
3938 '*discard': 'BlockdevDiscardOptions',
3939 '*cache': 'BlockdevCacheOptions',
3940 '*read-only': 'bool',
3941 '*auto-read-only': 'bool',
3942 '*force-share': 'bool',
3943 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3944 'discriminator': 'driver',
3946 'blkdebug': 'BlockdevOptionsBlkdebug',
3947 'blklogwrites':'BlockdevOptionsBlklogwrites',
3948 'blkverify': 'BlockdevOptionsBlkverify',
3949 'bochs': 'BlockdevOptionsGenericFormat',
3950 'cloop': 'BlockdevOptionsGenericFormat',
3951 'copy-on-read':'BlockdevOptionsGenericFormat',
3952 'dmg': 'BlockdevOptionsGenericFormat',
3953 'file': 'BlockdevOptionsFile',
3954 'ftp': 'BlockdevOptionsCurlFtp',
3955 'ftps': 'BlockdevOptionsCurlFtps',
3956 'gluster': 'BlockdevOptionsGluster',
3957 'host_cdrom': 'BlockdevOptionsFile',
3958 'host_device':'BlockdevOptionsFile',
3959 'http': 'BlockdevOptionsCurlHttp',
3960 'https': 'BlockdevOptionsCurlHttps',
3961 'iscsi': 'BlockdevOptionsIscsi',
3962 'luks': 'BlockdevOptionsLUKS',
3963 'nbd': 'BlockdevOptionsNbd',
3964 'nfs': 'BlockdevOptionsNfs',
3965 'null-aio': 'BlockdevOptionsNull',
3966 'null-co': 'BlockdevOptionsNull',
3967 'nvme': 'BlockdevOptionsNVMe',
3968 'parallels': 'BlockdevOptionsGenericFormat',
3969 'qcow2': 'BlockdevOptionsQcow2',
3970 'qcow': 'BlockdevOptionsQcow',
3971 'qed': 'BlockdevOptionsGenericCOWFormat',
3972 'quorum': 'BlockdevOptionsQuorum',
3973 'raw': 'BlockdevOptionsRaw',
3974 'rbd': 'BlockdevOptionsRbd',
3975 'replication': { 'type': 'BlockdevOptionsReplication',
3976 'if': 'defined(CONFIG_REPLICATION)' },
3977 'sheepdog': 'BlockdevOptionsSheepdog',
3978 'ssh': 'BlockdevOptionsSsh',
3979 'throttle': 'BlockdevOptionsThrottle',
3980 'vdi': 'BlockdevOptionsGenericFormat',
3981 'vhdx': 'BlockdevOptionsGenericFormat',
3982 'vmdk': 'BlockdevOptionsGenericCOWFormat',
3983 'vpc': 'BlockdevOptionsGenericFormat',
3984 'vvfat': 'BlockdevOptionsVVFAT',
3985 'vxhs': 'BlockdevOptionsVxHS'
3991 # Reference to a block device.
3993 # @definition: defines a new block device inline
3994 # @reference: references the ID of an existing block device
3998 { 'alternate': 'BlockdevRef',
3999 'data': { 'definition': 'BlockdevOptions',
4000 'reference': 'str' } }
4003 # @BlockdevRefOrNull:
4005 # Reference to a block device.
4007 # @definition: defines a new block device inline
4008 # @reference: references the ID of an existing block device.
4009 # An empty string means that no block device should
4010 # be referenced. Deprecated; use null instead.
4011 # @null: No block device should be referenced (since 2.10)
4015 { 'alternate': 'BlockdevRefOrNull',
4016 'data': { 'definition': 'BlockdevOptions',
4023 # Creates a new block device. If the @id option is given at the top level, a
4024 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
4025 # level and no BlockBackend will be created.
4032 # -> { "execute": "blockdev-add",
4034 # "driver": "qcow2",
4035 # "node-name": "test1",
4038 # "filename": "test.qcow2"
4042 # <- { "return": {} }
4045 # -> { "execute": "blockdev-add",
4047 # "driver": "qcow2",
4048 # "node-name": "node0",
4049 # "discard": "unmap",
4055 # "filename": "/tmp/test.qcow2"
4061 # "filename": "/dev/fdset/4"
4067 # <- { "return": {} }
4070 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
4073 # @x-blockdev-reopen:
4075 # Reopens a block device using the given set of options. Any option
4076 # not specified will be reset to its default value regardless of its
4077 # previous status. If an option cannot be changed or a particular
4078 # driver does not support reopening then the command will return an
4081 # The top-level @node-name option (from BlockdevOptions) must be
4082 # specified and is used to select the block device to be reopened.
4083 # Other @node-name options must be either omitted or set to the
4084 # current name of the appropriate node. This command won't change any
4085 # node name and any attempt to do it will result in an error.
4087 # In the case of options that refer to child nodes, the behavior of
4088 # this command depends on the value:
4090 # 1) A set of options (BlockdevOptions): the child is reopened with
4091 # the specified set of options.
4093 # 2) A reference to the current child: the child is reopened using
4094 # its existing set of options.
4096 # 3) A reference to a different node: the current child is replaced
4097 # with the specified one.
4099 # 4) NULL: the current child (if any) is detached.
4101 # Options (1) and (2) are supported in all cases, but at the moment
4102 # only @backing allows replacing or detaching an existing child.
4104 # Unlike with blockdev-add, the @backing option must always be present
4105 # unless the node being reopened does not have a backing file and its
4106 # image does not have a default backing file name as part of its
4111 { 'command': 'x-blockdev-reopen',
4112 'data': 'BlockdevOptions', 'boxed': true }
4117 # Deletes a block device that has been added using blockdev-add.
4118 # The command will fail if the node is attached to a device or is
4119 # otherwise being used.
4121 # @node-name: Name of the graph node to delete.
4127 # -> { "execute": "blockdev-add",
4129 # "driver": "qcow2",
4130 # "node-name": "node0",
4133 # "filename": "test.qcow2"
4137 # <- { "return": {} }
4139 # -> { "execute": "blockdev-del",
4140 # "arguments": { "node-name": "node0" }
4142 # <- { "return": {} }
4145 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
4148 # @BlockdevCreateOptionsFile:
4150 # Driver specific image creation options for file.
4152 # @filename Filename for the new image file
4153 # @size Size of the virtual disk in bytes
4154 # @preallocation Preallocation mode for the new image (default: off;
4155 # allowed values: off,
4156 # falloc (if defined CONFIG_POSIX_FALLOCATE),
4157 # full (if defined CONFIG_POSIX))
4158 # @nocow Turn off copy-on-write (valid only on btrfs; default: off)
4162 { 'struct': 'BlockdevCreateOptionsFile',
4163 'data': { 'filename': 'str',
4165 '*preallocation': 'PreallocMode',
4166 '*nocow': 'bool' } }
4169 # @BlockdevCreateOptionsGluster:
4171 # Driver specific image creation options for gluster.
4173 # @location Where to store the new image file
4174 # @size Size of the virtual disk in bytes
4175 # @preallocation Preallocation mode for the new image (default: off;
4176 # allowed values: off,
4177 # falloc (if defined CONFIG_GLUSTERFS_FALLOCATE),
4178 # full (if defined CONFIG_GLUSTERFS_ZEROFILL))
4182 { 'struct': 'BlockdevCreateOptionsGluster',
4183 'data': { 'location': 'BlockdevOptionsGluster',
4185 '*preallocation': 'PreallocMode' } }
4188 # @BlockdevCreateOptionsLUKS:
4190 # Driver specific image creation options for LUKS.
4192 # @file Node to create the image format on
4193 # @size Size of the virtual disk in bytes
4197 { 'struct': 'BlockdevCreateOptionsLUKS',
4198 'base': 'QCryptoBlockCreateOptionsLUKS',
4199 'data': { 'file': 'BlockdevRef',
4203 # @BlockdevCreateOptionsNfs:
4205 # Driver specific image creation options for NFS.
4207 # @location Where to store the new image file
4208 # @size Size of the virtual disk in bytes
4212 { 'struct': 'BlockdevCreateOptionsNfs',
4213 'data': { 'location': 'BlockdevOptionsNfs',
4217 # @BlockdevCreateOptionsParallels:
4219 # Driver specific image creation options for parallels.
4221 # @file Node to create the image format on
4222 # @size Size of the virtual disk in bytes
4223 # @cluster-size Cluster size in bytes (default: 1 MB)
4227 { 'struct': 'BlockdevCreateOptionsParallels',
4228 'data': { 'file': 'BlockdevRef',
4230 '*cluster-size': 'size' } }
4233 # @BlockdevCreateOptionsQcow:
4235 # Driver specific image creation options for qcow.
4237 # @file Node to create the image format on
4238 # @size Size of the virtual disk in bytes
4239 # @backing-file File name of the backing file if a backing file
4241 # @encrypt Encryption options if the image should be encrypted
4245 { 'struct': 'BlockdevCreateOptionsQcow',
4246 'data': { 'file': 'BlockdevRef',
4248 '*backing-file': 'str',
4249 '*encrypt': 'QCryptoBlockCreateOptions' } }
4252 # @BlockdevQcow2Version:
4254 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4255 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4259 { 'enum': 'BlockdevQcow2Version',
4260 'data': [ 'v2', 'v3' ] }
4264 # @BlockdevCreateOptionsQcow2:
4266 # Driver specific image creation options for qcow2.
4268 # @file Node to create the image format on
4269 # @data-file Node to use as an external data file in which all guest
4270 # data is stored so that only metadata remains in the qcow2
4272 # @data-file-raw True if the external data file must stay valid as a
4273 # standalone (read-only) raw image without looking at qcow2
4274 # metadata (default: false; since: 4.0)
4275 # @size Size of the virtual disk in bytes
4276 # @version Compatibility level (default: v3)
4277 # @backing-file File name of the backing file if a backing file
4279 # @backing-fmt Name of the block driver to use for the backing file
4280 # @encrypt Encryption options if the image should be encrypted
4281 # @cluster-size qcow2 cluster size in bytes (default: 65536)
4282 # @preallocation Preallocation mode for the new image (default: off;
4283 # allowed values: off, falloc, full, metadata)
4284 # @lazy-refcounts True if refcounts may be updated lazily (default: off)
4285 # @refcount-bits Width of reference counts in bits (default: 16)
4289 { 'struct': 'BlockdevCreateOptionsQcow2',
4290 'data': { 'file': 'BlockdevRef',
4291 '*data-file': 'BlockdevRef',
4292 '*data-file-raw': 'bool',
4294 '*version': 'BlockdevQcow2Version',
4295 '*backing-file': 'str',
4296 '*backing-fmt': 'BlockdevDriver',
4297 '*encrypt': 'QCryptoBlockCreateOptions',
4298 '*cluster-size': 'size',
4299 '*preallocation': 'PreallocMode',
4300 '*lazy-refcounts': 'bool',
4301 '*refcount-bits': 'int' } }
4304 # @BlockdevCreateOptionsQed:
4306 # Driver specific image creation options for qed.
4308 # @file Node to create the image format on
4309 # @size Size of the virtual disk in bytes
4310 # @backing-file File name of the backing file if a backing file
4312 # @backing-fmt Name of the block driver to use for the backing file
4313 # @cluster-size Cluster size in bytes (default: 65536)
4314 # @table-size L1/L2 table size (in clusters)
4318 { 'struct': 'BlockdevCreateOptionsQed',
4319 'data': { 'file': 'BlockdevRef',
4321 '*backing-file': 'str',
4322 '*backing-fmt': 'BlockdevDriver',
4323 '*cluster-size': 'size',
4324 '*table-size': 'int' } }
4327 # @BlockdevCreateOptionsRbd:
4329 # Driver specific image creation options for rbd/Ceph.
4331 # @location Where to store the new image file. This location cannot
4332 # point to a snapshot.
4333 # @size Size of the virtual disk in bytes
4334 # @cluster-size RBD object size
4338 { 'struct': 'BlockdevCreateOptionsRbd',
4339 'data': { 'location': 'BlockdevOptionsRbd',
4341 '*cluster-size' : 'size' } }
4344 # @BlockdevVmdkSubformat:
4346 # Subformat options for VMDK images
4348 # @monolithicSparse: Single file image with sparse cluster allocation
4350 # @monolithicFlat: Single flat data image and a descriptor file
4352 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4353 # files, in addition to a descriptor file
4355 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4356 # files, in addition to a descriptor file
4358 # @streamOptimized: Single file image sparse cluster allocation, optimized
4359 # for streaming over network.
4363 { 'enum': 'BlockdevVmdkSubformat',
4364 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4365 'twoGbMaxExtentFlat', 'streamOptimized'] }
4368 # @BlockdevVmdkAdapterType:
4370 # Adapter type info for VMDK images
4374 { 'enum': 'BlockdevVmdkAdapterType',
4375 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4378 # @BlockdevCreateOptionsVmdk:
4380 # Driver specific image creation options for VMDK.
4382 # @file Where to store the new image file. This refers to the image
4383 # file for monolithcSparse and streamOptimized format, or the
4384 # descriptor file for other formats.
4385 # @size Size of the virtual disk in bytes
4386 # @extents Where to store the data extents. Required for monolithcFlat,
4387 # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4388 # monolithicFlat, only one entry is required; for
4389 # twoGbMaxExtent* formats, the number of entries required is
4390 # calculated as extent_number = virtual_size / 2GB. Providing
4391 # more extents than will be used is an error.
4392 # @subformat The subformat of the VMDK image. Default: "monolithicSparse".
4393 # @backing-file The path of backing file. Default: no backing file is used.
4394 # @adapter-type The adapter type used to fill in the descriptor. Default: ide.
4395 # @hwversion Hardware version. The meaningful options are "4" or "6".
4397 # @zeroed-grain Whether to enable zeroed-grain feature for sparse subformats.
4402 { 'struct': 'BlockdevCreateOptionsVmdk',
4403 'data': { 'file': 'BlockdevRef',
4405 '*extents': ['BlockdevRef'],
4406 '*subformat': 'BlockdevVmdkSubformat',
4407 '*backing-file': 'str',
4408 '*adapter-type': 'BlockdevVmdkAdapterType',
4409 '*hwversion': 'str',
4410 '*zeroed-grain': 'bool' } }
4414 # @SheepdogRedundancyType:
4416 # @full Create a fully replicated vdi with x copies
4417 # @erasure-coded Create an erasure coded vdi with x data strips and
4422 { 'enum': 'SheepdogRedundancyType',
4423 'data': [ 'full', 'erasure-coded' ] }
4426 # @SheepdogRedundancyFull:
4428 # @copies Number of copies to use (between 1 and 31)
4432 { 'struct': 'SheepdogRedundancyFull',
4433 'data': { 'copies': 'int' }}
4436 # @SheepdogRedundancyErasureCoded:
4438 # @data-strips Number of data strips to use (one of {2,4,8,16})
4439 # @parity-strips Number of parity strips to use (between 1 and 15)
4443 { 'struct': 'SheepdogRedundancyErasureCoded',
4444 'data': { 'data-strips': 'int',
4445 'parity-strips': 'int' }}
4448 # @SheepdogRedundancy:
4452 { 'union': 'SheepdogRedundancy',
4453 'base': { 'type': 'SheepdogRedundancyType' },
4454 'discriminator': 'type',
4455 'data': { 'full': 'SheepdogRedundancyFull',
4456 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
4459 # @BlockdevCreateOptionsSheepdog:
4461 # Driver specific image creation options for Sheepdog.
4463 # @location Where to store the new image file
4464 # @size Size of the virtual disk in bytes
4465 # @backing-file File name of a base image
4466 # @preallocation Preallocation mode for the new image (default: off;
4467 # allowed values: off, full)
4468 # @redundancy Redundancy of the image
4469 # @object-size Object size of the image
4473 { 'struct': 'BlockdevCreateOptionsSheepdog',
4474 'data': { 'location': 'BlockdevOptionsSheepdog',
4476 '*backing-file': 'str',
4477 '*preallocation': 'PreallocMode',
4478 '*redundancy': 'SheepdogRedundancy',
4479 '*object-size': 'size' } }
4482 # @BlockdevCreateOptionsSsh:
4484 # Driver specific image creation options for SSH.
4486 # @location Where to store the new image file
4487 # @size Size of the virtual disk in bytes
4491 { 'struct': 'BlockdevCreateOptionsSsh',
4492 'data': { 'location': 'BlockdevOptionsSsh',
4496 # @BlockdevCreateOptionsVdi:
4498 # Driver specific image creation options for VDI.
4500 # @file Node to create the image format on
4501 # @size Size of the virtual disk in bytes
4502 # @preallocation Preallocation mode for the new image (default: off;
4503 # allowed values: off, metadata)
4507 { 'struct': 'BlockdevCreateOptionsVdi',
4508 'data': { 'file': 'BlockdevRef',
4510 '*preallocation': 'PreallocMode' } }
4513 # @BlockdevVhdxSubformat:
4515 # @dynamic: Growing image file
4516 # @fixed: Preallocated fixed-size image file
4520 { 'enum': 'BlockdevVhdxSubformat',
4521 'data': [ 'dynamic', 'fixed' ] }
4524 # @BlockdevCreateOptionsVhdx:
4526 # Driver specific image creation options for vhdx.
4528 # @file Node to create the image format on
4529 # @size Size of the virtual disk in bytes
4530 # @log-size Log size in bytes, must be a multiple of 1 MB
4532 # @block-size Block size in bytes, must be a multiple of 1 MB and not
4533 # larger than 256 MB (default: automatically choose a block
4534 # size depending on the image size)
4535 # @subformat vhdx subformat (default: dynamic)
4536 # @block-state-zero Force use of payload blocks of type 'ZERO'. Non-standard,
4537 # but default. Do not set to 'off' when using 'qemu-img
4538 # convert' with subformat=dynamic.
4542 { 'struct': 'BlockdevCreateOptionsVhdx',
4543 'data': { 'file': 'BlockdevRef',
4545 '*log-size': 'size',
4546 '*block-size': 'size',
4547 '*subformat': 'BlockdevVhdxSubformat',
4548 '*block-state-zero': 'bool' } }
4551 # @BlockdevVpcSubformat:
4553 # @dynamic: Growing image file
4554 # @fixed: Preallocated fixed-size image file
4558 { 'enum': 'BlockdevVpcSubformat',
4559 'data': [ 'dynamic', 'fixed' ] }
4562 # @BlockdevCreateOptionsVpc:
4564 # Driver specific image creation options for vpc (VHD).
4566 # @file Node to create the image format on
4567 # @size Size of the virtual disk in bytes
4568 # @subformat vhdx subformat (default: dynamic)
4569 # @force-size Force use of the exact byte size instead of rounding to the
4570 # next size that can be represented in CHS geometry
4575 { 'struct': 'BlockdevCreateOptionsVpc',
4576 'data': { 'file': 'BlockdevRef',
4578 '*subformat': 'BlockdevVpcSubformat',
4579 '*force-size': 'bool' } }
4582 # @BlockdevCreateOptions:
4584 # Options for creating an image format on a given node.
4586 # @driver block driver to create the image format
4590 { 'union': 'BlockdevCreateOptions',
4592 'driver': 'BlockdevDriver' },
4593 'discriminator': 'driver',
4595 'file': 'BlockdevCreateOptionsFile',
4596 'gluster': 'BlockdevCreateOptionsGluster',
4597 'luks': 'BlockdevCreateOptionsLUKS',
4598 'nfs': 'BlockdevCreateOptionsNfs',
4599 'parallels': 'BlockdevCreateOptionsParallels',
4600 'qcow': 'BlockdevCreateOptionsQcow',
4601 'qcow2': 'BlockdevCreateOptionsQcow2',
4602 'qed': 'BlockdevCreateOptionsQed',
4603 'rbd': 'BlockdevCreateOptionsRbd',
4604 'sheepdog': 'BlockdevCreateOptionsSheepdog',
4605 'ssh': 'BlockdevCreateOptionsSsh',
4606 'vdi': 'BlockdevCreateOptionsVdi',
4607 'vhdx': 'BlockdevCreateOptionsVhdx',
4608 'vmdk': 'BlockdevCreateOptionsVmdk',
4609 'vpc': 'BlockdevCreateOptionsVpc'
4615 # Starts a job to create an image format on a given node. The job is
4616 # automatically finalized, but a manual job-dismiss is required.
4618 # @job-id: Identifier for the newly created job.
4620 # @options: Options for the image creation.
4624 { 'command': 'blockdev-create',
4625 'data': { 'job-id': 'str',
4626 'options': 'BlockdevCreateOptions' } }
4629 # @blockdev-open-tray:
4631 # Opens a block device's tray. If there is a block driver state tree inserted as
4632 # a medium, it will become inaccessible to the guest (but it will remain
4633 # associated to the block device, so closing the tray will make it accessible
4636 # If the tray was already open before, this will be a no-op.
4638 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4639 # which no such event will be generated, these include:
4640 # - if the guest has locked the tray, @force is false and the guest does not
4641 # respond to the eject request
4642 # - if the BlockBackend denoted by @device does not have a guest device attached
4644 # - if the guest device does not have an actual tray
4646 # @device: Block device name (deprecated, use @id instead)
4648 # @id: The name or QOM path of the guest device (since: 2.8)
4650 # @force: if false (the default), an eject request will be sent to
4651 # the guest if it has locked the tray (and the tray will not be opened
4652 # immediately); if true, the tray will be opened regardless of whether
4659 # -> { "execute": "blockdev-open-tray",
4660 # "arguments": { "id": "ide0-1-0" } }
4662 # <- { "timestamp": { "seconds": 1418751016,
4663 # "microseconds": 716996 },
4664 # "event": "DEVICE_TRAY_MOVED",
4665 # "data": { "device": "ide1-cd0",
4667 # "tray-open": true } }
4669 # <- { "return": {} }
4672 { 'command': 'blockdev-open-tray',
4673 'data': { '*device': 'str',
4675 '*force': 'bool' } }
4678 # @blockdev-close-tray:
4680 # Closes a block device's tray. If there is a block driver state tree associated
4681 # with the block device (which is currently ejected), that tree will be loaded
4684 # If the tray was already closed before, this will be a no-op.
4686 # @device: Block device name (deprecated, use @id instead)
4688 # @id: The name or QOM path of the guest device (since: 2.8)
4694 # -> { "execute": "blockdev-close-tray",
4695 # "arguments": { "id": "ide0-1-0" } }
4697 # <- { "timestamp": { "seconds": 1418751345,
4698 # "microseconds": 272147 },
4699 # "event": "DEVICE_TRAY_MOVED",
4700 # "data": { "device": "ide1-cd0",
4702 # "tray-open": false } }
4704 # <- { "return": {} }
4707 { 'command': 'blockdev-close-tray',
4708 'data': { '*device': 'str',
4712 # @blockdev-remove-medium:
4714 # Removes a medium (a block driver state tree) from a block device. That block
4715 # device's tray must currently be open (unless there is no attached guest
4718 # If the tray is open and there is no medium inserted, this will be a no-op.
4720 # @id: The name or QOM path of the guest device
4726 # -> { "execute": "blockdev-remove-medium",
4727 # "arguments": { "id": "ide0-1-0" } }
4729 # <- { "error": { "class": "GenericError",
4730 # "desc": "Tray of device 'ide0-1-0' is not open" } }
4732 # -> { "execute": "blockdev-open-tray",
4733 # "arguments": { "id": "ide0-1-0" } }
4735 # <- { "timestamp": { "seconds": 1418751627,
4736 # "microseconds": 549958 },
4737 # "event": "DEVICE_TRAY_MOVED",
4738 # "data": { "device": "ide1-cd0",
4740 # "tray-open": true } }
4742 # <- { "return": {} }
4744 # -> { "execute": "blockdev-remove-medium",
4745 # "arguments": { "id": "ide0-1-0" } }
4747 # <- { "return": {} }
4750 { 'command': 'blockdev-remove-medium',
4751 'data': { 'id': 'str' } }
4754 # @blockdev-insert-medium:
4756 # Inserts a medium (a block driver state tree) into a block device. That block
4757 # device's tray must currently be open (unless there is no attached guest
4758 # device) and there must be no medium inserted already.
4760 # @id: The name or QOM path of the guest device
4762 # @node-name: name of a node in the block driver state graph
4768 # -> { "execute": "blockdev-add",
4770 # "node-name": "node0",
4772 # "file": { "driver": "file",
4773 # "filename": "fedora.iso" } } }
4774 # <- { "return": {} }
4776 # -> { "execute": "blockdev-insert-medium",
4777 # "arguments": { "id": "ide0-1-0",
4778 # "node-name": "node0" } }
4780 # <- { "return": {} }
4783 { 'command': 'blockdev-insert-medium',
4784 'data': { 'id': 'str',
4785 'node-name': 'str'} }
4789 # @BlockdevChangeReadOnlyMode:
4791 # Specifies the new read-only mode of a block device subject to the
4792 # @blockdev-change-medium command.
4794 # @retain: Retains the current read-only mode
4796 # @read-only: Makes the device read-only
4798 # @read-write: Makes the device writable
4803 { 'enum': 'BlockdevChangeReadOnlyMode',
4804 'data': ['retain', 'read-only', 'read-write'] }
4808 # @blockdev-change-medium:
4810 # Changes the medium inserted into a block device by ejecting the current medium
4811 # and loading a new image file which is inserted as the new medium (this command
4812 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
4813 # and blockdev-close-tray).
4815 # @device: Block device name (deprecated, use @id instead)
4817 # @id: The name or QOM path of the guest device
4820 # @filename: filename of the new image to be loaded
4822 # @format: format to open the new image with (defaults to
4823 # the probed format)
4825 # @read-only-mode: change the read-only mode of the device; defaults
4832 # 1. Change a removable medium
4834 # -> { "execute": "blockdev-change-medium",
4835 # "arguments": { "id": "ide0-1-0",
4836 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4837 # "format": "raw" } }
4838 # <- { "return": {} }
4840 # 2. Load a read-only medium into a writable drive
4842 # -> { "execute": "blockdev-change-medium",
4843 # "arguments": { "id": "floppyA",
4844 # "filename": "/srv/images/ro.img",
4846 # "read-only-mode": "retain" } }
4849 # { "class": "GenericError",
4850 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4852 # -> { "execute": "blockdev-change-medium",
4853 # "arguments": { "id": "floppyA",
4854 # "filename": "/srv/images/ro.img",
4856 # "read-only-mode": "read-only" } }
4858 # <- { "return": {} }
4861 { 'command': 'blockdev-change-medium',
4862 'data': { '*device': 'str',
4866 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
4870 # @BlockErrorAction:
4872 # An enumeration of action that has been taken when a DISK I/O occurs
4874 # @ignore: error has been ignored
4876 # @report: error has been reported to the device
4878 # @stop: error caused VM to be stopped
4882 { 'enum': 'BlockErrorAction',
4883 'data': [ 'ignore', 'report', 'stop' ] }
4887 # @BLOCK_IMAGE_CORRUPTED:
4889 # Emitted when a disk image is being marked corrupt. The image can be
4890 # identified by its device or node name. The 'device' field is always
4891 # present for compatibility reasons, but it can be empty ("") if the
4892 # image does not have a device name associated.
4894 # @device: device name. This is always present for compatibility
4895 # reasons, but it can be empty ("") if the image does not
4896 # have a device name associated.
4898 # @node-name: node name (Since: 2.4)
4900 # @msg: informative message for human consumption, such as the kind of
4901 # corruption being detected. It should not be parsed by machine as it is
4902 # not guaranteed to be stable
4904 # @offset: if the corruption resulted from an image access, this is
4905 # the host's access offset into the image
4907 # @size: if the corruption resulted from an image access, this is
4910 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4911 # event and must be repaired (Since 2.2; before, every
4912 # BLOCK_IMAGE_CORRUPTED event was fatal)
4914 # Note: If action is "stop", a STOP event will eventually follow the
4915 # BLOCK_IO_ERROR event.
4919 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4920 # "data": { "device": "ide0-hd0", "node-name": "node0",
4921 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4923 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4927 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4928 'data': { 'device' : 'str',
4929 '*node-name' : 'str',
4933 'fatal' : 'bool' } }
4938 # Emitted when a disk I/O error occurs
4940 # @device: device name. This is always present for compatibility
4941 # reasons, but it can be empty ("") if the image does not
4942 # have a device name associated.
4944 # @node-name: node name. Note that errors may be reported for the root node
4945 # that is directly attached to a guest device rather than for the
4946 # node where the error occurred. The node name is not present if
4947 # the drive is empty. (Since: 2.8)
4949 # @operation: I/O operation
4951 # @action: action that has been taken
4953 # @nospace: true if I/O error was caused due to a no-space
4954 # condition. This key is only present if query-block's
4955 # io-status is present, please see query-block documentation
4956 # for more information (since: 2.2)
4958 # @reason: human readable string describing the error cause.
4959 # (This field is a debugging aid for humans, it should not
4960 # be parsed by applications) (since: 2.2)
4962 # Note: If action is "stop", a STOP event will eventually follow the
4963 # BLOCK_IO_ERROR event
4969 # <- { "event": "BLOCK_IO_ERROR",
4970 # "data": { "device": "ide0-hd1",
4971 # "node-name": "#block212",
4972 # "operation": "write",
4973 # "action": "stop" },
4974 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4977 { 'event': 'BLOCK_IO_ERROR',
4978 'data': { 'device': 'str', '*node-name': 'str',
4979 'operation': 'IoOperationType',
4980 'action': 'BlockErrorAction', '*nospace': 'bool',
4984 # @BLOCK_JOB_COMPLETED:
4986 # Emitted when a block job has completed
4990 # @device: The job identifier. Originally the device name but other
4991 # values are allowed since QEMU 2.7
4993 # @len: maximum progress value
4995 # @offset: current progress value. On success this is equal to len.
4996 # On failure this is less than len
4998 # @speed: rate limit, bytes per second
5000 # @error: error message. Only present on failure. This field
5001 # contains a human-readable error message. There are no semantics
5002 # other than that streaming has failed and clients should not try to
5003 # interpret the error string
5009 # <- { "event": "BLOCK_JOB_COMPLETED",
5010 # "data": { "type": "stream", "device": "virtio-disk0",
5011 # "len": 10737418240, "offset": 10737418240,
5013 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5016 { 'event': 'BLOCK_JOB_COMPLETED',
5017 'data': { 'type' : 'JobType',
5025 # @BLOCK_JOB_CANCELLED:
5027 # Emitted when a block job has been cancelled
5031 # @device: The job identifier. Originally the device name but other
5032 # values are allowed since QEMU 2.7
5034 # @len: maximum progress value
5036 # @offset: current progress value. On success this is equal to len.
5037 # On failure this is less than len
5039 # @speed: rate limit, bytes per second
5045 # <- { "event": "BLOCK_JOB_CANCELLED",
5046 # "data": { "type": "stream", "device": "virtio-disk0",
5047 # "len": 10737418240, "offset": 134217728,
5049 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5052 { 'event': 'BLOCK_JOB_CANCELLED',
5053 'data': { 'type' : 'JobType',
5062 # Emitted when a block job encounters an error
5064 # @device: The job identifier. Originally the device name but other
5065 # values are allowed since QEMU 2.7
5067 # @operation: I/O operation
5069 # @action: action that has been taken
5075 # <- { "event": "BLOCK_JOB_ERROR",
5076 # "data": { "device": "ide0-hd1",
5077 # "operation": "write",
5078 # "action": "stop" },
5079 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5082 { 'event': 'BLOCK_JOB_ERROR',
5083 'data': { 'device' : 'str',
5084 'operation': 'IoOperationType',
5085 'action' : 'BlockErrorAction' } }
5090 # Emitted when a block job is ready to complete
5094 # @device: The job identifier. Originally the device name but other
5095 # values are allowed since QEMU 2.7
5097 # @len: maximum progress value
5099 # @offset: current progress value. On success this is equal to len.
5100 # On failure this is less than len
5102 # @speed: rate limit, bytes per second
5104 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
5111 # <- { "event": "BLOCK_JOB_READY",
5112 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5113 # "len": 2097152, "offset": 2097152 }
5114 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5117 { 'event': 'BLOCK_JOB_READY',
5118 'data': { 'type' : 'JobType',
5125 # @BLOCK_JOB_PENDING:
5127 # Emitted when a block job is awaiting explicit authorization to finalize graph
5128 # changes via @block-job-finalize. If this job is part of a transaction, it will
5129 # not emit this event until the transaction has converged first.
5133 # @id: The job identifier.
5139 # <- { "event": "BLOCK_JOB_WAITING",
5140 # "data": { "device": "drive0", "type": "mirror" },
5141 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5144 { 'event': 'BLOCK_JOB_PENDING',
5145 'data': { 'type' : 'JobType',
5151 # Preallocation mode of QEMU image file
5153 # @off: no preallocation
5154 # @metadata: preallocate only for metadata
5155 # @falloc: like @full preallocation but allocate disk space by
5156 # posix_fallocate() rather than writing zeros.
5157 # @full: preallocate all data by writing zeros to device to ensure disk
5158 # space is really available. @full preallocation also sets up
5159 # metadata correctly.
5163 { 'enum': 'PreallocMode',
5164 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5167 # @BLOCK_WRITE_THRESHOLD:
5169 # Emitted when writes on block device reaches or exceeds the
5170 # configured write threshold. For thin-provisioned devices, this
5171 # means the device should be extended to avoid pausing for
5173 # The event is one shot. Once triggered, it needs to be
5174 # re-registered with another block-set-write-threshold command.
5176 # @node-name: graph node name on which the threshold was exceeded.
5178 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5180 # @write-threshold: last configured threshold, in bytes.
5184 { 'event': 'BLOCK_WRITE_THRESHOLD',
5185 'data': { 'node-name': 'str',
5186 'amount-exceeded': 'uint64',
5187 'write-threshold': 'uint64' } }
5190 # @block-set-write-threshold:
5192 # Change the write threshold for a block drive. An event will be
5193 # delivered if a write to this block drive crosses the configured
5194 # threshold. The threshold is an offset, thus must be
5195 # non-negative. Default is no write threshold. Setting the threshold
5196 # to zero disables it.
5198 # This is useful to transparently resize thin-provisioned drives without
5199 # the guest OS noticing.
5201 # @node-name: graph node name on which the threshold must be set.
5203 # @write-threshold: configured threshold for the block device, bytes.
5204 # Use 0 to disable the threshold.
5210 # -> { "execute": "block-set-write-threshold",
5211 # "arguments": { "node-name": "mydev",
5212 # "write-threshold": 17179869184 } }
5213 # <- { "return": {} }
5216 { 'command': 'block-set-write-threshold',
5217 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
5220 # @x-blockdev-change:
5222 # Dynamically reconfigure the block driver state graph. It can be used
5223 # to add, remove, insert or replace a graph node. Currently only the
5224 # Quorum driver implements this feature to add or remove its child. This
5225 # is useful to fix a broken quorum child.
5227 # If @node is specified, it will be inserted under @parent. @child
5228 # may not be specified in this case. If both @parent and @child are
5229 # specified but @node is not, @child will be detached from @parent.
5231 # @parent: the id or name of the parent node.
5233 # @child: the name of a child under the given parent node.
5235 # @node: the name of the node that will be added.
5237 # Note: this command is experimental, and its API is not stable. It
5238 # does not support all kinds of operations, all kinds of children, nor
5239 # all block drivers.
5241 # FIXME Removing children from a quorum node means introducing gaps in the
5242 # child indices. This cannot be represented in the 'children' list of
5243 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
5245 # Warning: The data in a new quorum child MUST be consistent with that of
5246 # the rest of the array.
5252 # 1. Add a new node to a quorum
5253 # -> { "execute": "blockdev-add",
5256 # "node-name": "new_node",
5257 # "file": { "driver": "file",
5258 # "filename": "test.raw" } } }
5259 # <- { "return": {} }
5260 # -> { "execute": "x-blockdev-change",
5261 # "arguments": { "parent": "disk1",
5262 # "node": "new_node" } }
5263 # <- { "return": {} }
5265 # 2. Delete a quorum's node
5266 # -> { "execute": "x-blockdev-change",
5267 # "arguments": { "parent": "disk1",
5268 # "child": "children.1" } }
5269 # <- { "return": {} }
5272 { 'command': 'x-blockdev-change',
5273 'data' : { 'parent': 'str',
5278 # @x-blockdev-set-iothread:
5280 # Move @node and its children into the @iothread. If @iothread is null then
5281 # move @node and its children into the main loop.
5283 # The node must not be attached to a BlockBackend.
5285 # @node-name: the name of the block driver node
5287 # @iothread: the name of the IOThread object or null for the main loop
5289 # @force: true if the node and its children should be moved when a BlockBackend
5290 # is already attached
5292 # Note: this command is experimental and intended for test cases that need
5293 # control over IOThreads only.
5299 # 1. Move a node into an IOThread
5300 # -> { "execute": "x-blockdev-set-iothread",
5301 # "arguments": { "node-name": "disk1",
5302 # "iothread": "iothread0" } }
5303 # <- { "return": {} }
5305 # 2. Move a node into the main loop
5306 # -> { "execute": "x-blockdev-set-iothread",
5307 # "arguments": { "node-name": "disk1",
5308 # "iothread": null } }
5309 # <- { "return": {} }
5312 { 'command': 'x-blockdev-set-iothread',
5313 'data' : { 'node-name': 'str',
5314 'iothread': 'StrOrNull',
5315 '*force': 'bool' } }