5 # == Block core (VM unrelated)
8 { 'include': 'common.json' }
9 { 'include': 'crypto.json' }
10 { 'include': 'job.json' }
11 { 'include': 'sockets.json' }
16 # @id: unique snapshot id
18 # @name: user chosen name
20 # @vm-state-size: size of the VM state
22 # @date-sec: UTC date of the snapshot in seconds
24 # @date-nsec: fractional part in nano seconds to be used with date-sec
26 # @vm-clock-sec: VM clock relative to boot in seconds
28 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
30 # @icount: Current instruction count. Appears when execution record/replay
31 # is enabled. Used for "time-traveling" to match the moment
32 # in the recorded execution with the snapshots. This counter may
33 # be obtained through @query-replay command (since 5.2)
38 { 'struct': 'SnapshotInfo',
39 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
40 'date-sec': 'int', 'date-nsec': 'int',
41 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int',
45 # @ImageInfoSpecificQCow2EncryptionBase:
47 # @format: The encryption format
51 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
52 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
55 # @ImageInfoSpecificQCow2Encryption:
59 { 'union': 'ImageInfoSpecificQCow2Encryption',
60 'base': 'ImageInfoSpecificQCow2EncryptionBase',
61 'discriminator': 'format',
62 'data': { 'luks': 'QCryptoBlockInfoLUKS' } }
65 # @ImageInfoSpecificQCow2:
67 # @compat: compatibility level
69 # @data-file: the filename of the external data file that is stored in the
70 # image and used as a default for opening the image (since: 4.0)
72 # @data-file-raw: True if the external data file must stay valid as a
73 # standalone (read-only) raw image without looking at qcow2
74 # metadata (since: 4.0)
76 # @extended-l2: true if the image has extended L2 entries; only valid for
77 # compat >= 1.1 (since 5.2)
79 # @lazy-refcounts: on or off; only valid for compat >= 1.1
81 # @corrupt: true if the image has been marked corrupt; only valid for
82 # compat >= 1.1 (since 2.2)
84 # @refcount-bits: width of a refcount entry in bits (since 2.3)
86 # @encrypt: details about encryption parameters; only set if image
87 # is encrypted (since 2.10)
89 # @bitmaps: A list of qcow2 bitmap details (since 4.0)
91 # @compression-type: the image cluster compression method (since 5.1)
95 { 'struct': 'ImageInfoSpecificQCow2',
99 '*data-file-raw': 'bool',
100 '*extended-l2': 'bool',
101 '*lazy-refcounts': 'bool',
103 'refcount-bits': 'int',
104 '*encrypt': 'ImageInfoSpecificQCow2Encryption',
105 '*bitmaps': ['Qcow2BitmapInfo'],
106 'compression-type': 'Qcow2CompressionType'
110 # @ImageInfoSpecificVmdk:
112 # @create-type: The create type of VMDK image
114 # @cid: Content id of image
116 # @parent-cid: Parent VMDK image's cid
118 # @extents: List of extent files
122 { 'struct': 'ImageInfoSpecificVmdk',
124 'create-type': 'str',
127 'extents': ['ImageInfo']
131 # @ImageInfoSpecificRbd:
133 # @encryption-format: Image encryption format
137 { 'struct': 'ImageInfoSpecificRbd',
139 '*encryption-format': 'RbdImageEncryptionFormat'
143 # @ImageInfoSpecificKind:
150 { 'enum': 'ImageInfoSpecificKind',
151 'data': [ 'qcow2', 'vmdk', 'luks', 'rbd' ] }
154 # @ImageInfoSpecificQCow2Wrapper:
158 { 'struct': 'ImageInfoSpecificQCow2Wrapper',
159 'data': { 'data': 'ImageInfoSpecificQCow2' } }
162 # @ImageInfoSpecificVmdkWrapper:
166 { 'struct': 'ImageInfoSpecificVmdkWrapper',
167 'data': { 'data': 'ImageInfoSpecificVmdk' } }
170 # @ImageInfoSpecificLUKSWrapper:
174 { 'struct': 'ImageInfoSpecificLUKSWrapper',
175 'data': { 'data': 'QCryptoBlockInfoLUKS' } }
176 # If we need to add block driver specific parameters for
177 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
178 # to define a ImageInfoSpecificLUKS
181 # @ImageInfoSpecificRbdWrapper:
185 { 'struct': 'ImageInfoSpecificRbdWrapper',
186 'data': { 'data': 'ImageInfoSpecificRbd' } }
189 # @ImageInfoSpecific:
191 # A discriminated record of image format specific information structures.
195 { 'union': 'ImageInfoSpecific',
196 'base': { 'type': 'ImageInfoSpecificKind' },
197 'discriminator': 'type',
199 'qcow2': 'ImageInfoSpecificQCow2Wrapper',
200 'vmdk': 'ImageInfoSpecificVmdkWrapper',
201 'luks': 'ImageInfoSpecificLUKSWrapper',
202 'rbd': 'ImageInfoSpecificRbdWrapper'
208 # Information about a QEMU image file
210 # @filename: name of the image file
212 # @format: format of the image file
214 # @virtual-size: maximum capacity in bytes of the image
216 # @actual-size: actual size on disk in bytes of the image
218 # @dirty-flag: true if image is not cleanly closed
220 # @cluster-size: size of a cluster in bytes
222 # @encrypted: true if the image is encrypted
224 # @compressed: true if the image is compressed (Since 1.7)
226 # @backing-filename: name of the backing file
228 # @full-backing-filename: full path of the backing file
230 # @backing-filename-format: the format of the backing file
232 # @snapshots: list of VM snapshots
234 # @backing-image: info of the backing image (since 1.6)
236 # @format-specific: structure supplying additional format-specific
237 # information (since 1.7)
241 { 'struct': 'ImageInfo',
242 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
243 '*actual-size': 'int', 'virtual-size': 'int',
244 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
245 '*backing-filename': 'str', '*full-backing-filename': 'str',
246 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
247 '*backing-image': 'ImageInfo',
248 '*format-specific': 'ImageInfoSpecific' } }
253 # Information about a QEMU image file check
255 # @filename: name of the image file checked
257 # @format: format of the image file checked
259 # @check-errors: number of unexpected errors occurred during check
261 # @image-end-offset: offset (in bytes) where the image ends, this
262 # field is present if the driver for the image format
265 # @corruptions: number of corruptions found during the check if any
267 # @leaks: number of leaks found during the check if any
269 # @corruptions-fixed: number of corruptions fixed during the check
272 # @leaks-fixed: number of leaks fixed during the check if any
274 # @total-clusters: total number of clusters, this field is present
275 # if the driver for the image format supports it
277 # @allocated-clusters: total number of allocated clusters, this
278 # field is present if the driver for the image format
281 # @fragmented-clusters: total number of fragmented clusters, this
282 # field is present if the driver for the image format
285 # @compressed-clusters: total number of compressed clusters, this
286 # field is present if the driver for the image format
291 { 'struct': 'ImageCheck',
292 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
293 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
294 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
295 '*total-clusters': 'int', '*allocated-clusters': 'int',
296 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
301 # Mapping information from a virtual block range to a host file range
303 # @start: virtual (guest) offset of the first byte described by this
306 # @length: the number of bytes of the mapped virtual range
308 # @data: reading the image will actually read data from a file (in
309 # particular, if @offset is present this means that the sectors
310 # are not simply preallocated, but contain actual data in raw
313 # @zero: whether the virtual blocks read as zeroes
315 # @depth: number of layers (0 = top image, 1 = top image's backing
316 # file, ..., n - 1 = bottom image (where n is the number of
317 # images in the chain)) before reaching one for which the
320 # @present: true if this layer provides the data, false if adding a backing
321 # layer could impact this region (since 6.1)
323 # @offset: if present, the image file stores the data for this range
324 # in raw format at the given (host) offset
326 # @filename: filename that is referred to by @offset
330 { 'struct': 'MapEntry',
331 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
332 'zero': 'bool', 'depth': 'int', 'present': 'bool',
333 '*offset': 'int', '*filename': 'str' } }
336 # @BlockdevCacheInfo:
338 # Cache mode information for a block device
340 # @writeback: true if writeback mode is enabled
341 # @direct: true if the host page cache is bypassed (O_DIRECT)
342 # @no-flush: true if flush requests are ignored for the device
346 { 'struct': 'BlockdevCacheInfo',
347 'data': { 'writeback': 'bool',
349 'no-flush': 'bool' } }
354 # Information about the backing device for a block device.
356 # @file: the filename of the backing device
358 # @node-name: the name of the block driver node (Since 2.0)
360 # @ro: true if the backing device was open read-only
362 # @drv: the name of the block format used to open the backing device. As of
363 # 0.14 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
364 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
365 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
366 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
367 # 2.2: 'archipelago' added, 'cow' dropped
368 # 2.3: 'host_floppy' deprecated
369 # 2.5: 'host_floppy' dropped
371 # 2.8: 'replication' added, 'tftp' dropped
372 # 2.9: 'archipelago' dropped
374 # @backing_file: the name of the backing file (for copy-on-write)
376 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
378 # @encrypted: true if the backing device is encrypted
380 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
382 # @bps: total throughput limit in bytes per second is specified
384 # @bps_rd: read throughput limit in bytes per second is specified
386 # @bps_wr: write throughput limit in bytes per second is specified
388 # @iops: total I/O operations per second is specified
390 # @iops_rd: read I/O operations per second is specified
392 # @iops_wr: write I/O operations per second is specified
394 # @image: the info of image used (since: 1.6)
396 # @bps_max: total throughput limit during bursts,
397 # in bytes (Since 1.7)
399 # @bps_rd_max: read throughput limit during bursts,
400 # in bytes (Since 1.7)
402 # @bps_wr_max: write throughput limit during bursts,
403 # in bytes (Since 1.7)
405 # @iops_max: total I/O operations per second during bursts,
406 # in bytes (Since 1.7)
408 # @iops_rd_max: read I/O operations per second during bursts,
409 # in bytes (Since 1.7)
411 # @iops_wr_max: write I/O operations per second during bursts,
412 # in bytes (Since 1.7)
414 # @bps_max_length: maximum length of the @bps_max burst
415 # period, in seconds. (Since 2.6)
417 # @bps_rd_max_length: maximum length of the @bps_rd_max
418 # burst period, in seconds. (Since 2.6)
420 # @bps_wr_max_length: maximum length of the @bps_wr_max
421 # burst period, in seconds. (Since 2.6)
423 # @iops_max_length: maximum length of the @iops burst
424 # period, in seconds. (Since 2.6)
426 # @iops_rd_max_length: maximum length of the @iops_rd_max
427 # burst period, in seconds. (Since 2.6)
429 # @iops_wr_max_length: maximum length of the @iops_wr_max
430 # burst period, in seconds. (Since 2.6)
432 # @iops_size: an I/O size in bytes (Since 1.7)
434 # @group: throttle group name (Since 2.4)
436 # @cache: the cache mode used for the block device (since: 2.3)
438 # @write_threshold: configured write threshold for the device.
439 # 0 if disabled. (Since 2.3)
441 # @dirty-bitmaps: dirty bitmaps information (only present if node
442 # has one or more dirty bitmaps) (Since 4.2)
446 { 'struct': 'BlockDeviceInfo',
447 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
448 '*backing_file': 'str', 'backing_file_depth': 'int',
450 'detect_zeroes': 'BlockdevDetectZeroesOptions',
451 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
452 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
453 'image': 'ImageInfo',
454 '*bps_max': 'int', '*bps_rd_max': 'int',
455 '*bps_wr_max': 'int', '*iops_max': 'int',
456 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
457 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
458 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
459 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
460 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
461 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
464 # @BlockDeviceIoStatus:
466 # An enumeration of block device I/O status.
468 # @ok: The last I/O operation has succeeded
470 # @failed: The last I/O operation has failed
472 # @nospace: The last I/O operation has failed due to a no-space condition
476 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
481 # Block dirty bitmap information.
483 # @name: the name of the dirty bitmap (Since 2.4)
485 # @count: number of dirty bytes according to the dirty bitmap
487 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
489 # @recording: true if the bitmap is recording new writes from the guest.
490 # Replaces ``active`` and ``disabled`` statuses. (since 4.0)
492 # @busy: true if the bitmap is in-use by some operation (NBD or jobs)
493 # and cannot be modified via QMP or used by another operation.
494 # Replaces ``locked`` and ``frozen`` statuses. (since 4.0)
496 # @persistent: true if the bitmap was stored on disk, is scheduled to be stored
497 # on disk, or both. (since 4.0)
499 # @inconsistent: true if this is a persistent bitmap that was improperly
500 # stored. Implies @persistent to be true; @recording and
501 # @busy to be false. This bitmap cannot be used. To remove
502 # it, use @block-dirty-bitmap-remove. (Since 4.0)
506 { 'struct': 'BlockDirtyInfo',
507 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
508 'recording': 'bool', 'busy': 'bool',
509 'persistent': 'bool', '*inconsistent': 'bool' } }
512 # @Qcow2BitmapInfoFlags:
514 # An enumeration of flags that a bitmap can report to the user.
516 # @in-use: This flag is set by any process actively modifying the qcow2 file,
517 # and cleared when the updated bitmap is flushed to the qcow2 image.
518 # The presence of this flag in an offline image means that the bitmap
519 # was not saved correctly after its last usage, and may contain
522 # @auto: The bitmap must reflect all changes of the virtual disk by any
523 # application that would write to this qcow2 file.
527 { 'enum': 'Qcow2BitmapInfoFlags',
528 'data': ['in-use', 'auto'] }
533 # Qcow2 bitmap information.
535 # @name: the name of the bitmap
537 # @granularity: granularity of the bitmap in bytes
539 # @flags: flags of the bitmap
543 { 'struct': 'Qcow2BitmapInfo',
544 'data': {'name': 'str', 'granularity': 'uint32',
545 'flags': ['Qcow2BitmapInfoFlags'] } }
548 # @BlockLatencyHistogramInfo:
550 # Block latency histogram.
552 # @boundaries: list of interval boundary values in nanoseconds, all greater
553 # than zero and in ascending order.
554 # For example, the list [10, 50, 100] produces the following
555 # histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
557 # @bins: list of io request counts corresponding to histogram intervals.
558 # len(@bins) = len(@boundaries) + 1
559 # For the example above, @bins may be something like [3, 1, 5, 2],
560 # and corresponding histogram looks like:
569 # +------------------
574 { 'struct': 'BlockLatencyHistogramInfo',
575 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
580 # Block device information. This structure describes a virtual device and
581 # the backing device associated with it.
583 # @device: The device name associated with the virtual device.
585 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
586 # device. (since 2.10)
588 # @type: This field is returned only for compatibility reasons, it should
589 # not be used (always returns 'unknown')
591 # @removable: True if the device supports removable media.
593 # @locked: True if the guest has locked this device from having its media
596 # @tray_open: True if the device's tray is open
597 # (only present if it has a tray)
599 # @io-status: @BlockDeviceIoStatus. Only present if the device
600 # supports it and the VM is configured to stop on errors
601 # (supported device models: virtio-blk, IDE, SCSI except
604 # @inserted: @BlockDeviceInfo describing the device if media is
609 { 'struct': 'BlockInfo',
610 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
611 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
612 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus' } }
617 # Image file size calculation information. This structure describes the size
618 # requirements for creating a new image file.
620 # The size requirements depend on the new image file format. File size always
621 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
622 # Compact formats such as 'qcow2' represent unallocated and zero regions
623 # efficiently so file size may be smaller than virtual disk size.
625 # The values are upper bounds that are guaranteed to fit the new image file.
626 # Subsequent modification, such as internal snapshot or further bitmap
627 # creation, may require additional space and is not covered here.
629 # @required: Size required for a new image file, in bytes, when copying just
630 # allocated guest-visible contents.
632 # @fully-allocated: Image file size, in bytes, once data has been written
633 # to all sectors, when copying just guest-visible contents.
635 # @bitmaps: Additional size required if all the top-level bitmap metadata
636 # in the source image were to be copied to the destination,
637 # present only when source and destination both support
638 # persistent bitmaps. (since 5.1)
642 { 'struct': 'BlockMeasureInfo',
643 'data': {'required': 'int', 'fully-allocated': 'int', '*bitmaps': 'int'} }
648 # Get a list of BlockInfo for all virtual block devices.
650 # Returns: a list of @BlockInfo describing each virtual block device. Filter
651 # nodes that were created implicitly are skipped over.
657 # -> { "execute": "query-block" }
662 # "device":"ide0-hd0",
669 # "file":"disks/test.qcow2",
670 # "backing_file_depth":1,
677 # "bps_max": 8000000,
684 # "detect_zeroes": "on",
685 # "write_threshold": 0,
687 # "filename":"disks/test.qcow2",
689 # "virtual-size":2048000,
690 # "backing_file":"base.qcow2",
691 # "full-backing-filename":"disks/base.qcow2",
692 # "backing-filename-format":"qcow2",
696 # "name": "snapshot1",
697 # "vm-state-size": 0,
698 # "date-sec": 10000200,
700 # "vm-clock-sec": 206,
701 # "vm-clock-nsec": 30
705 # "filename":"disks/base.qcow2",
707 # "virtual-size":2048000
711 # "qdev": "ide_disk",
716 # "device":"ide1-cd0",
719 # "qdev": "/machine/unattached/device[23]",
720 # "tray_open": false,
724 # "device":"floppy0",
727 # "qdev": "/machine/unattached/device[20]",
740 { 'command': 'query-block', 'returns': ['BlockInfo'] }
743 # @BlockDeviceTimedStats:
745 # Statistics of a block device during a given interval of time.
747 # @interval_length: Interval used for calculating the statistics,
750 # @min_rd_latency_ns: Minimum latency of read operations in the
751 # defined interval, in nanoseconds.
753 # @min_wr_latency_ns: Minimum latency of write operations in the
754 # defined interval, in nanoseconds.
756 # @min_flush_latency_ns: Minimum latency of flush operations in the
757 # defined interval, in nanoseconds.
759 # @max_rd_latency_ns: Maximum latency of read operations in the
760 # defined interval, in nanoseconds.
762 # @max_wr_latency_ns: Maximum latency of write operations in the
763 # defined interval, in nanoseconds.
765 # @max_flush_latency_ns: Maximum latency of flush operations in the
766 # defined interval, in nanoseconds.
768 # @avg_rd_latency_ns: Average latency of read operations in the
769 # defined interval, in nanoseconds.
771 # @avg_wr_latency_ns: Average latency of write operations in the
772 # defined interval, in nanoseconds.
774 # @avg_flush_latency_ns: Average latency of flush operations in the
775 # defined interval, in nanoseconds.
777 # @avg_rd_queue_depth: Average number of pending read operations
778 # in the defined interval.
780 # @avg_wr_queue_depth: Average number of pending write operations
781 # in the defined interval.
785 { 'struct': 'BlockDeviceTimedStats',
786 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
787 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
788 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
789 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
790 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
791 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
796 # Statistics of a virtual block device or a block backing device.
798 # @rd_bytes: The number of bytes read by the device.
800 # @wr_bytes: The number of bytes written by the device.
802 # @unmap_bytes: The number of bytes unmapped by the device (Since 4.2)
804 # @rd_operations: The number of read operations performed by the device.
806 # @wr_operations: The number of write operations performed by the device.
808 # @flush_operations: The number of cache flush operations performed by the
809 # device (since 0.15)
811 # @unmap_operations: The number of unmap operations performed by the device
814 # @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15).
816 # @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15).
818 # @flush_total_time_ns: Total time spent on cache flushes in nanoseconds
821 # @unmap_total_time_ns: Total time spent on unmap operations in nanoseconds
824 # @wr_highest_offset: The offset after the greatest byte written to the
825 # device. The intended use of this information is for
826 # growable sparse files (like qcow2) that are used on top
827 # of a physical device.
829 # @rd_merged: Number of read requests that have been merged into another
830 # request (Since 2.3).
832 # @wr_merged: Number of write requests that have been merged into another
833 # request (Since 2.3).
835 # @unmap_merged: Number of unmap requests that have been merged into another
836 # request (Since 4.2)
838 # @idle_time_ns: Time since the last I/O operation, in
839 # nanoseconds. If the field is absent it means that
840 # there haven't been any operations yet (Since 2.5).
842 # @failed_rd_operations: The number of failed read operations
843 # performed by the device (Since 2.5)
845 # @failed_wr_operations: The number of failed write operations
846 # performed by the device (Since 2.5)
848 # @failed_flush_operations: The number of failed flush operations
849 # performed by the device (Since 2.5)
851 # @failed_unmap_operations: The number of failed unmap operations performed
852 # by the device (Since 4.2)
854 # @invalid_rd_operations: The number of invalid read operations
855 # performed by the device (Since 2.5)
857 # @invalid_wr_operations: The number of invalid write operations
858 # performed by the device (Since 2.5)
860 # @invalid_flush_operations: The number of invalid flush operations
861 # performed by the device (Since 2.5)
863 # @invalid_unmap_operations: The number of invalid unmap operations performed
864 # by the device (Since 4.2)
866 # @account_invalid: Whether invalid operations are included in the
867 # last access statistics (Since 2.5)
869 # @account_failed: Whether failed operations are included in the
870 # latency and last access statistics (Since 2.5)
872 # @timed_stats: Statistics specific to the set of previously defined
873 # intervals of time (Since 2.5)
875 # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
877 # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
879 # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
883 { 'struct': 'BlockDeviceStats',
884 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int',
885 'rd_operations': 'int', 'wr_operations': 'int',
886 'flush_operations': 'int', 'unmap_operations': 'int',
887 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int',
888 'flush_total_time_ns': 'int', 'unmap_total_time_ns': 'int',
889 'wr_highest_offset': 'int',
890 'rd_merged': 'int', 'wr_merged': 'int', 'unmap_merged': 'int',
891 '*idle_time_ns': 'int',
892 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
893 'failed_flush_operations': 'int', 'failed_unmap_operations': 'int',
894 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int',
895 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int',
896 'account_invalid': 'bool', 'account_failed': 'bool',
897 'timed_stats': ['BlockDeviceTimedStats'],
898 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
899 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
900 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
903 # @BlockStatsSpecificFile:
905 # File driver statistics
907 # @discard-nb-ok: The number of successful discard operations performed by
910 # @discard-nb-failed: The number of failed discard operations performed by
913 # @discard-bytes-ok: The number of bytes discarded by the driver.
917 { 'struct': 'BlockStatsSpecificFile',
919 'discard-nb-ok': 'uint64',
920 'discard-nb-failed': 'uint64',
921 'discard-bytes-ok': 'uint64' } }
924 # @BlockStatsSpecificNvme:
926 # NVMe driver statistics
928 # @completion-errors: The number of completion errors.
930 # @aligned-accesses: The number of aligned accesses performed by
933 # @unaligned-accesses: The number of unaligned accesses performed by
938 { 'struct': 'BlockStatsSpecificNvme',
940 'completion-errors': 'uint64',
941 'aligned-accesses': 'uint64',
942 'unaligned-accesses': 'uint64' } }
945 # @BlockStatsSpecific:
947 # Block driver specific statistics
951 { 'union': 'BlockStatsSpecific',
952 'base': { 'driver': 'BlockdevDriver' },
953 'discriminator': 'driver',
955 'file': 'BlockStatsSpecificFile',
956 'host_device': { 'type': 'BlockStatsSpecificFile',
957 'if': 'HAVE_HOST_BLOCK_DEVICE' },
958 'nvme': 'BlockStatsSpecificNvme' } }
963 # Statistics of a virtual block device or a block backing device.
965 # @device: If the stats are for a virtual block device, the name
966 # corresponding to the virtual block device.
968 # @node-name: The node name of the device. (Since 2.3)
970 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
971 # device. (since 3.0)
973 # @stats: A @BlockDeviceStats for the device.
975 # @driver-specific: Optional driver-specific stats. (Since 4.2)
977 # @parent: This describes the file block device if it has one.
978 # Contains recursively the statistics of the underlying
979 # protocol (e.g. the host file for a qcow2 image). If there is
980 # no underlying protocol, this field is omitted
982 # @backing: This describes the backing block device if it has one.
987 { 'struct': 'BlockStats',
988 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
989 'stats': 'BlockDeviceStats',
990 '*driver-specific': 'BlockStatsSpecific',
991 '*parent': 'BlockStats',
992 '*backing': 'BlockStats'} }
997 # Query the @BlockStats for all virtual block devices.
999 # @query-nodes: If true, the command will query all the block nodes
1000 # that have a node name, in a list which will include "parent"
1001 # information, but not "backing".
1002 # If false or omitted, the behavior is as before - query all the
1003 # device backends, recursively including their "parent" and
1004 # "backing". Filter nodes that were created implicitly are
1005 # skipped over in this mode. (Since 2.3)
1007 # Returns: A list of @BlockStats for each virtual block devices.
1013 # -> { "execute": "query-blockstats" }
1017 # "device":"ide0-hd0",
1020 # "wr_highest_offset":3686448128,
1021 # "wr_bytes":9786368,
1022 # "wr_operations":751,
1023 # "rd_bytes":122567168,
1024 # "rd_operations":36772
1025 # "wr_total_times_ns":313253456
1026 # "rd_total_times_ns":3465673657
1027 # "flush_total_times_ns":49653
1028 # "flush_operations":61,
1031 # "idle_time_ns":2953431879,
1032 # "account_invalid":true,
1033 # "account_failed":false
1037 # "wr_highest_offset":2821110784,
1038 # "wr_bytes":9786368,
1039 # "wr_operations":692,
1040 # "rd_bytes":122739200,
1041 # "rd_operations":36604
1042 # "flush_operations":51,
1043 # "wr_total_times_ns":313253456
1044 # "rd_total_times_ns":3465673657
1045 # "flush_total_times_ns":49653,
1048 # "idle_time_ns":2953431879,
1049 # "account_invalid":true,
1050 # "account_failed":false
1052 # "qdev": "/machine/unattached/device[23]"
1055 # "device":"ide1-cd0",
1057 # "wr_highest_offset":0,
1059 # "wr_operations":0,
1062 # "flush_operations":0,
1063 # "wr_total_times_ns":0
1064 # "rd_total_times_ns":0
1065 # "flush_total_times_ns":0,
1068 # "account_invalid":false,
1069 # "account_failed":false
1071 # "qdev": "/machine/unattached/device[24]"
1074 # "device":"floppy0",
1076 # "wr_highest_offset":0,
1078 # "wr_operations":0,
1081 # "flush_operations":0,
1082 # "wr_total_times_ns":0
1083 # "rd_total_times_ns":0
1084 # "flush_total_times_ns":0,
1087 # "account_invalid":false,
1088 # "account_failed":false
1090 # "qdev": "/machine/unattached/device[16]"
1095 # "wr_highest_offset":0,
1097 # "wr_operations":0,
1100 # "flush_operations":0,
1101 # "wr_total_times_ns":0
1102 # "rd_total_times_ns":0
1103 # "flush_total_times_ns":0,
1106 # "account_invalid":false,
1107 # "account_failed":false
1114 { 'command': 'query-blockstats',
1115 'data': { '*query-nodes': 'bool' },
1116 'returns': ['BlockStats'] }
1121 # An enumeration of possible behaviors for errors on I/O operations.
1122 # The exact meaning depends on whether the I/O was initiated by a guest
1125 # @report: for guest operations, report the error to the guest;
1126 # for jobs, cancel the job
1128 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1129 # or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs retry
1130 # the failing request later and may still complete successfully. The
1131 # stream block job continues to stream and will complete with an
1134 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1136 # @stop: for guest operations, stop the virtual machine;
1137 # for jobs, pause the job
1139 # @auto: inherit the error handling policy of the backend (since: 2.7)
1143 { 'enum': 'BlockdevOnError',
1144 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1149 # An enumeration of possible behaviors for the initial synchronization
1150 # phase of storage mirroring.
1152 # @top: copies data in the topmost image to the destination
1154 # @full: copies data from all images to the destination
1156 # @none: only copy data written from now on
1158 # @incremental: only copy data described by the dirty bitmap. (since: 2.4)
1160 # @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
1161 # Behavior on completion is determined by the BitmapSyncMode.
1165 { 'enum': 'MirrorSyncMode',
1166 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1171 # An enumeration of possible behaviors for the synchronization of a bitmap
1172 # when used for data copy operations.
1174 # @on-success: The bitmap is only synced when the operation is successful.
1175 # This is the behavior always used for 'INCREMENTAL' backups.
1177 # @never: The bitmap is never synchronized with the operation, and is
1178 # treated solely as a read-only manifest of blocks to copy.
1180 # @always: The bitmap is always synchronized with the operation,
1181 # regardless of whether or not the operation was successful.
1185 { 'enum': 'BitmapSyncMode',
1186 'data': ['on-success', 'never', 'always'] }
1191 # An enumeration whose values tell the mirror block job when to
1192 # trigger writes to the target.
1194 # @background: copy data in background only.
1196 # @write-blocking: when data is written to the source, write it
1197 # (synchronously) to the target as well. In
1198 # addition, data is copied in background just like in
1203 { 'enum': 'MirrorCopyMode',
1204 'data': ['background', 'write-blocking'] }
1209 # Information about a long-running block device operation.
1211 # @type: the job type ('stream' for image streaming)
1213 # @device: The job identifier. Originally the device name but other
1214 # values are allowed since QEMU 2.7
1216 # @len: Estimated @offset value at the completion of the job. This value can
1217 # arbitrarily change while the job is running, in both directions.
1219 # @offset: Progress made until now. The unit is arbitrary and the value can
1220 # only meaningfully be used for the ratio of @offset to @len. The
1221 # value is monotonically increasing.
1223 # @busy: false if the job is known to be in a quiescent state, with
1224 # no pending I/O. Since 1.3.
1226 # @paused: whether the job is paused or, if @busy is true, will
1227 # pause itself as soon as possible. Since 1.3.
1229 # @speed: the rate limit, bytes per second
1231 # @io-status: the status of the job (since 1.3)
1233 # @ready: true if the job may be completed (since 2.2)
1235 # @status: Current job state/status (since 2.12)
1237 # @auto-finalize: Job will finalize itself when PENDING, moving to
1238 # the CONCLUDED state. (since 2.12)
1240 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1241 # state and disappearing from the query list. (since 2.12)
1243 # @error: Error information if the job did not complete successfully.
1244 # Not set if the job completed successfully. (since 2.12.1)
1248 { 'struct': 'BlockJobInfo',
1249 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1250 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1251 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1252 'status': 'JobStatus',
1253 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1257 # @query-block-jobs:
1259 # Return information about long-running block device operations.
1261 # Returns: a list of @BlockJobInfo for each active block job
1265 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1270 # Resize a block image while a guest is running.
1272 # Either @device or @node-name must be set but not both.
1274 # @device: the name of the device to get the image resized
1276 # @node-name: graph node name to get the image resized (Since 2.0)
1278 # @size: new image size in bytes
1280 # Returns: - nothing on success
1281 # - If @device is not a valid block device, DeviceNotFound
1287 # -> { "execute": "block_resize",
1288 # "arguments": { "device": "scratch", "size": 1073741824 } }
1289 # <- { "return": {} }
1292 { 'command': 'block_resize',
1293 'data': { '*device': 'str',
1294 '*node-name': 'str',
1301 # An enumeration that tells QEMU how to set the backing file path in
1304 # @existing: QEMU should look for an existing image file.
1306 # @absolute-paths: QEMU should create a new image with absolute paths
1307 # for the backing file. If there is no backing file available, the new
1308 # image will not be backed either.
1312 { 'enum': 'NewImageMode',
1313 'data': [ 'existing', 'absolute-paths' ] }
1316 # @BlockdevSnapshotSync:
1318 # Either @device or @node-name must be set but not both.
1320 # @device: the name of the device to take a snapshot of.
1322 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1324 # @snapshot-file: the target of the new overlay image. If the file
1325 # exists, or if it is a device, the overlay will be created in the
1326 # existing file/device. Otherwise, a new file will be created.
1328 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1330 # @format: the format of the overlay image, default is 'qcow2'.
1332 # @mode: whether and how QEMU should create a new image, default is
1335 { 'struct': 'BlockdevSnapshotSync',
1336 'data': { '*device': 'str', '*node-name': 'str',
1337 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1338 '*format': 'str', '*mode': 'NewImageMode' } }
1341 # @BlockdevSnapshot:
1343 # @node: device or node name that will have a snapshot taken.
1345 # @overlay: reference to the existing block device that will become
1346 # the overlay of @node, as part of taking the snapshot.
1347 # It must not have a current backing file (this can be
1348 # achieved by passing "backing": null to blockdev-add).
1352 { 'struct': 'BlockdevSnapshot',
1353 'data': { 'node': 'str', 'overlay': 'str' } }
1358 # Optional parameters for backup. These parameters don't affect
1359 # functionality, but may significantly affect performance.
1361 # @use-copy-range: Use copy offloading. Default false.
1363 # @max-workers: Maximum number of parallel requests for the sustained background
1364 # copying process. Doesn't influence copy-before-write operations.
1367 # @max-chunk: Maximum request length for the sustained background copying
1368 # process. Doesn't influence copy-before-write operations.
1369 # 0 means unlimited. If max-chunk is non-zero then it should not be
1370 # less than job cluster size which is calculated as maximum of
1371 # target image cluster size and 64k. Default 0.
1375 { 'struct': 'BackupPerf',
1376 'data': { '*use-copy-range': 'bool',
1377 '*max-workers': 'int', '*max-chunk': 'int64' } }
1382 # @job-id: identifier for the newly-created block job. If
1383 # omitted, the device name will be used. (Since 2.7)
1385 # @device: the device name or node-name of a root node which should be copied.
1387 # @sync: what parts of the disk image should be copied to the destination
1388 # (all the disk, only the sectors allocated in the topmost image, from a
1389 # dirty bitmap, or only new I/O).
1391 # @speed: the maximum speed, in bytes per second. The default is 0,
1394 # @bitmap: The name of a dirty bitmap to use.
1395 # Must be present if sync is "bitmap" or "incremental".
1396 # Can be present if sync is "full" or "top".
1397 # Must not be present otherwise.
1398 # (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1400 # @bitmap-mode: Specifies the type of data the bitmap should contain after
1401 # the operation concludes.
1402 # Must be present if a bitmap was provided,
1403 # Must NOT be present otherwise. (Since 4.2)
1405 # @compress: true to compress data, if the target format supports it.
1406 # (default: false) (since 2.8)
1408 # @on-source-error: the action to take on an error on the source,
1409 # default 'report'. 'stop' and 'enospc' can only be used
1410 # if the block device supports io-status (see BlockInfo).
1412 # @on-target-error: the action to take on an error on the target,
1413 # default 'report' (no limitations, since this applies to
1414 # a different block device than @device).
1416 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1417 # finished its work, waiting for @block-job-finalize before
1418 # making any block graph changes.
1419 # When true, this job will automatically
1420 # perform its abort or commit actions.
1421 # Defaults to true. (Since 2.12)
1423 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1424 # has completely ceased all work, and awaits @block-job-dismiss.
1425 # When true, this job will automatically disappear from the query
1426 # list without user intervention.
1427 # Defaults to true. (Since 2.12)
1429 # @filter-node-name: the node name that should be assigned to the
1430 # filter driver that the backup job inserts into the graph
1431 # above node specified by @drive. If this option is not given,
1432 # a node name is autogenerated. (Since: 4.2)
1434 # @x-perf: Performance options. (Since 6.0)
1437 # @unstable: Member @x-perf is experimental.
1439 # Note: @on-source-error and @on-target-error only affect background
1440 # I/O. If an error occurs during a guest write request, the device's
1441 # rerror/werror actions will be used.
1445 { 'struct': 'BackupCommon',
1446 'data': { '*job-id': 'str', 'device': 'str',
1447 'sync': 'MirrorSyncMode', '*speed': 'int',
1448 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1449 '*compress': 'bool',
1450 '*on-source-error': 'BlockdevOnError',
1451 '*on-target-error': 'BlockdevOnError',
1452 '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
1453 '*filter-node-name': 'str',
1454 '*x-perf': { 'type': 'BackupPerf',
1455 'features': [ 'unstable' ] } } }
1460 # @target: the target of the new image. If the file exists, or if it
1461 # is a device, the existing file/device will be used as the new
1462 # destination. If it does not exist, a new file will be created.
1464 # @format: the format of the new destination, default is to
1465 # probe if @mode is 'existing', else the format of the source
1467 # @mode: whether and how QEMU should create a new image, default is
1472 { 'struct': 'DriveBackup',
1473 'base': 'BackupCommon',
1474 'data': { 'target': 'str',
1476 '*mode': 'NewImageMode' } }
1481 # @target: the device name or node-name of the backup target node.
1485 { 'struct': 'BlockdevBackup',
1486 'base': 'BackupCommon',
1487 'data': { 'target': 'str' } }
1490 # @blockdev-snapshot-sync:
1492 # Takes a synchronous snapshot of a block device.
1494 # For the arguments, see the documentation of BlockdevSnapshotSync.
1496 # Returns: - nothing on success
1497 # - If @device is not a valid block device, DeviceNotFound
1503 # -> { "execute": "blockdev-snapshot-sync",
1504 # "arguments": { "device": "ide-hd0",
1506 # "/some/place/my-image",
1507 # "format": "qcow2" } }
1508 # <- { "return": {} }
1511 { 'command': 'blockdev-snapshot-sync',
1512 'data': 'BlockdevSnapshotSync' }
1515 # @blockdev-snapshot:
1517 # Takes a snapshot of a block device.
1519 # Take a snapshot, by installing 'node' as the backing image of
1520 # 'overlay'. Additionally, if 'node' is associated with a block
1521 # device, the block device changes to using 'overlay' as its new active
1524 # For the arguments, see the documentation of BlockdevSnapshot.
1527 # @allow-write-only-overlay: If present, the check whether this operation is safe
1528 # was relaxed so that it can be used to change
1529 # backing file of a destination of a blockdev-mirror.
1536 # -> { "execute": "blockdev-add",
1537 # "arguments": { "driver": "qcow2",
1538 # "node-name": "node1534",
1539 # "file": { "driver": "file",
1540 # "filename": "hd1.qcow2" },
1541 # "backing": null } }
1543 # <- { "return": {} }
1545 # -> { "execute": "blockdev-snapshot",
1546 # "arguments": { "node": "ide-hd0",
1547 # "overlay": "node1534" } }
1548 # <- { "return": {} }
1551 { 'command': 'blockdev-snapshot',
1552 'data': 'BlockdevSnapshot',
1553 'features': [ 'allow-write-only-overlay' ] }
1556 # @change-backing-file:
1558 # Change the backing file in the image file metadata. This does not
1559 # cause QEMU to reopen the image file to reparse the backing filename
1560 # (it may, however, perform a reopen to change permissions from
1561 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1562 # into the image file metadata, and the QEMU internal strings are
1565 # @image-node-name: The name of the block driver state node of the
1566 # image to modify. The "device" argument is used
1567 # to verify "image-node-name" is in the chain
1568 # described by "device".
1570 # @device: The device name or node-name of the root node that owns
1573 # @backing-file: The string to write as the backing file. This
1574 # string is not validated, so care should be taken
1575 # when specifying the string or the image chain may
1576 # not be able to be reopened again.
1578 # Returns: - Nothing on success
1579 # - If "device" does not exist or cannot be determined, DeviceNotFound
1583 { 'command': 'change-backing-file',
1584 'data': { 'device': 'str', 'image-node-name': 'str',
1585 'backing-file': 'str' } }
1590 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1591 # writes data between 'top' and 'base' into 'base'.
1593 # If top == base, that is an error.
1594 # If top has no overlays on top of it, or if it is in use by a writer,
1595 # the job will not be completed by itself. The user needs to complete
1596 # the job with the block-job-complete command after getting the ready
1597 # event. (Since 2.0)
1599 # If the base image is smaller than top, then the base image will be
1600 # resized to be the same size as top. If top is smaller than the base
1601 # image, the base will not be truncated. If you want the base image
1602 # size to match the size of the smaller top, you can safely truncate
1603 # it yourself once the commit operation successfully completes.
1605 # @job-id: identifier for the newly-created block job. If
1606 # omitted, the device name will be used. (Since 2.7)
1608 # @device: the device name or node-name of a root node
1610 # @base-node: The node name of the backing image to write data into.
1611 # If not specified, this is the deepest backing image.
1614 # @base: Same as @base-node, except that it is a file name rather than a node
1615 # name. This must be the exact filename string that was used to open the
1616 # node; other strings, even if addressing the same file, are not
1619 # @top-node: The node name of the backing image within the image chain
1620 # which contains the topmost data to be committed down. If
1621 # not specified, this is the active layer. (since: 3.1)
1623 # @top: Same as @top-node, except that it is a file name rather than a node
1624 # name. This must be the exact filename string that was used to open the
1625 # node; other strings, even if addressing the same file, are not
1628 # @backing-file: The backing file string to write into the overlay
1629 # image of 'top'. If 'top' does not have an overlay
1630 # image, or if 'top' is in use by a writer, specifying
1631 # a backing file string is an error.
1633 # This filename is not validated. If a pathname string
1634 # is such that it cannot be resolved by QEMU, that
1635 # means that subsequent QMP or HMP commands must use
1636 # node-names for the image in question, as filename
1637 # lookup methods will fail.
1639 # If not specified, QEMU will automatically determine
1640 # the backing file string to use, or error out if
1641 # there is no obvious choice. Care should be taken
1642 # when specifying the string, to specify a valid
1643 # filename or protocol.
1646 # @speed: the maximum speed, in bytes per second
1648 # @on-error: the action to take on an error. 'ignore' means that the request
1649 # should be retried. (default: report; Since: 5.0)
1651 # @filter-node-name: the node name that should be assigned to the
1652 # filter driver that the commit job inserts into the graph
1653 # above @top. If this option is not given, a node name is
1654 # autogenerated. (Since: 2.9)
1656 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1657 # finished its work, waiting for @block-job-finalize before
1658 # making any block graph changes.
1659 # When true, this job will automatically
1660 # perform its abort or commit actions.
1661 # Defaults to true. (Since 3.1)
1663 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1664 # has completely ceased all work, and awaits @block-job-dismiss.
1665 # When true, this job will automatically disappear from the query
1666 # list without user intervention.
1667 # Defaults to true. (Since 3.1)
1670 # @deprecated: Members @base and @top are deprecated. Use @base-node
1671 # and @top-node instead.
1673 # Returns: - Nothing on success
1674 # - If @device does not exist, DeviceNotFound
1675 # - Any other error returns a GenericError.
1681 # -> { "execute": "block-commit",
1682 # "arguments": { "device": "virtio0",
1683 # "top": "/tmp/snap1.qcow2" } }
1684 # <- { "return": {} }
1687 { 'command': 'block-commit',
1688 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1689 '*base': { 'type': 'str', 'features': [ 'deprecated' ] },
1691 '*top': { 'type': 'str', 'features': [ 'deprecated' ] },
1692 '*backing-file': 'str', '*speed': 'int',
1693 '*on-error': 'BlockdevOnError',
1694 '*filter-node-name': 'str',
1695 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1700 # Start a point-in-time copy of a block device to a new destination. The
1701 # status of ongoing drive-backup operations can be checked with
1702 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1703 # The operation can be stopped before it has completed using the
1704 # block-job-cancel command.
1707 # @deprecated: This command is deprecated. Use @blockdev-backup instead.
1709 # Returns: - nothing on success
1710 # - If @device is not a valid block device, GenericError
1716 # -> { "execute": "drive-backup",
1717 # "arguments": { "device": "drive0",
1719 # "target": "backup.img" } }
1720 # <- { "return": {} }
1723 { 'command': 'drive-backup', 'boxed': true,
1724 'data': 'DriveBackup', 'features': ['deprecated'] }
1729 # Start a point-in-time copy of a block device to a new destination. The
1730 # status of ongoing blockdev-backup operations can be checked with
1731 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1732 # The operation can be stopped before it has completed using the
1733 # block-job-cancel command.
1735 # Returns: - nothing on success
1736 # - If @device is not a valid block device, DeviceNotFound
1742 # -> { "execute": "blockdev-backup",
1743 # "arguments": { "device": "src-id",
1745 # "target": "tgt-id" } }
1746 # <- { "return": {} }
1749 { 'command': 'blockdev-backup', 'boxed': true,
1750 'data': 'BlockdevBackup' }
1753 # @query-named-block-nodes:
1755 # Get the named block driver list
1757 # @flat: Omit the nested data about backing image ("backing-image" key) if true.
1758 # Default is false (Since 5.0)
1760 # Returns: the list of BlockDeviceInfo
1766 # -> { "execute": "query-named-block-nodes" }
1767 # <- { "return": [ { "ro":false,
1769 # "encrypted":false,
1770 # "file":"disks/test.qcow2",
1771 # "node-name": "my-node",
1772 # "backing_file_depth":1,
1773 # "detect_zeroes":"off",
1780 # "bps_max": 8000000,
1787 # "write_threshold": 0,
1789 # "filename":"disks/test.qcow2",
1791 # "virtual-size":2048000,
1792 # "backing_file":"base.qcow2",
1793 # "full-backing-filename":"disks/base.qcow2",
1794 # "backing-filename-format":"qcow2",
1798 # "name": "snapshot1",
1799 # "vm-state-size": 0,
1800 # "date-sec": 10000200,
1802 # "vm-clock-sec": 206,
1803 # "vm-clock-nsec": 30
1807 # "filename":"disks/base.qcow2",
1809 # "virtual-size":2048000
1814 { 'command': 'query-named-block-nodes',
1815 'returns': [ 'BlockDeviceInfo' ],
1816 'data': { '*flat': 'bool' } }
1819 # @XDbgBlockGraphNodeType:
1821 # @block-backend: corresponds to BlockBackend
1823 # @block-job: corresponds to BlockJob
1825 # @block-driver: corresponds to BlockDriverState
1829 { 'enum': 'XDbgBlockGraphNodeType',
1830 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1833 # @XDbgBlockGraphNode:
1835 # @id: Block graph node identifier. This @id is generated only for
1836 # x-debug-query-block-graph and does not relate to any other identifiers in
1839 # @type: Type of graph node. Can be one of block-backend, block-job or
1840 # block-driver-state.
1842 # @name: Human readable name of the node. Corresponds to node-name for
1843 # block-driver-state nodes; is not guaranteed to be unique in the whole
1844 # graph (with block-jobs and block-backends).
1848 { 'struct': 'XDbgBlockGraphNode',
1849 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1854 # Enum of base block permissions.
1856 # @consistent-read: A user that has the "permission" of consistent reads is
1857 # guaranteed that their view of the contents of the block
1858 # device is complete and self-consistent, representing the
1859 # contents of a disk at a specific point.
1860 # For most block devices (including their backing files) this
1861 # is true, but the property cannot be maintained in a few
1862 # situations like for intermediate nodes of a commit block
1865 # @write: This permission is required to change the visible disk contents.
1867 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1868 # both enough and required for writes to the block node when
1869 # the caller promises that the visible disk content doesn't
1871 # As the BLK_PERM_WRITE permission is strictly stronger,
1872 # either is sufficient to perform an unchanging write.
1874 # @resize: This permission is required to change the size of a block node.
1878 { 'enum': 'BlockPermission',
1879 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize' ] }
1882 # @XDbgBlockGraphEdge:
1884 # Block Graph edge description for x-debug-query-block-graph.
1886 # @parent: parent id
1890 # @name: name of the relation (examples are 'file' and 'backing')
1892 # @perm: granted permissions for the parent operating on the child
1894 # @shared-perm: permissions that can still be granted to other users of the
1895 # child while it is still attached to this parent
1899 { 'struct': 'XDbgBlockGraphEdge',
1900 'data': { 'parent': 'uint64', 'child': 'uint64',
1901 'name': 'str', 'perm': [ 'BlockPermission' ],
1902 'shared-perm': [ 'BlockPermission' ] } }
1907 # Block Graph - list of nodes and list of edges.
1911 { 'struct': 'XDbgBlockGraph',
1912 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1915 # @x-debug-query-block-graph:
1917 # Get the block graph.
1920 # @unstable: This command is meant for debugging.
1924 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph',
1925 'features': [ 'unstable' ] }
1930 # Start mirroring a block device's writes to a new destination. target
1931 # specifies the target of the new image. If the file exists, or if it
1932 # is a device, it will be used as the new destination for writes. If
1933 # it does not exist, a new file will be created. format specifies the
1934 # format of the mirror image, default is to probe if mode='existing',
1935 # else the format of the source.
1937 # Returns: - nothing on success
1938 # - If @device is not a valid block device, GenericError
1944 # -> { "execute": "drive-mirror",
1945 # "arguments": { "device": "ide-hd0",
1946 # "target": "/some/place/my-image",
1948 # "format": "qcow2" } }
1949 # <- { "return": {} }
1952 { 'command': 'drive-mirror', 'boxed': true,
1953 'data': 'DriveMirror' }
1958 # A set of parameters describing drive mirror setup.
1960 # @job-id: identifier for the newly-created block job. If
1961 # omitted, the device name will be used. (Since 2.7)
1963 # @device: the device name or node-name of a root node whose writes should be
1966 # @target: the target of the new image. If the file exists, or if it
1967 # is a device, the existing file/device will be used as the new
1968 # destination. If it does not exist, a new file will be created.
1970 # @format: the format of the new destination, default is to
1971 # probe if @mode is 'existing', else the format of the source
1973 # @node-name: the new block driver state node name in the graph
1976 # @replaces: with sync=full graph node name to be replaced by the new
1977 # image when a whole image copy is done. This can be used to repair
1978 # broken Quorum files. By default, @device is replaced, although
1979 # implicitly created filters on it are kept. (Since 2.1)
1981 # @mode: whether and how QEMU should create a new image, default is
1984 # @speed: the maximum speed, in bytes per second
1986 # @sync: what parts of the disk image should be copied to the destination
1987 # (all the disk, only the sectors allocated in the topmost image, or
1990 # @granularity: granularity of the dirty bitmap, default is 64K
1991 # if the image format doesn't have clusters, 4K if the clusters
1992 # are smaller than that, else the cluster size. Must be a
1993 # power of 2 between 512 and 64M (since 1.4).
1995 # @buf-size: maximum amount of data in flight from source to
1996 # target (since 1.4).
1998 # @on-source-error: the action to take on an error on the source,
1999 # default 'report'. 'stop' and 'enospc' can only be used
2000 # if the block device supports io-status (see BlockInfo).
2002 # @on-target-error: the action to take on an error on the target,
2003 # default 'report' (no limitations, since this applies to
2004 # a different block device than @device).
2006 # @unmap: Whether to try to unmap target sectors where source has
2007 # only zero. If true, and target unallocated sectors will read as zero,
2008 # target image sectors will be unmapped; otherwise, zeroes will be
2009 # written. Both will result in identical contents.
2010 # Default is true. (Since 2.4)
2012 # @copy-mode: when to copy data to the destination; defaults to 'background'
2015 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2016 # finished its work, waiting for @block-job-finalize before
2017 # making any block graph changes.
2018 # When true, this job will automatically
2019 # perform its abort or commit actions.
2020 # Defaults to true. (Since 3.1)
2022 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2023 # has completely ceased all work, and awaits @block-job-dismiss.
2024 # When true, this job will automatically disappear from the query
2025 # list without user intervention.
2026 # Defaults to true. (Since 3.1)
2030 { 'struct': 'DriveMirror',
2031 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2032 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
2033 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2034 '*speed': 'int', '*granularity': 'uint32',
2035 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2036 '*on-target-error': 'BlockdevOnError',
2037 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
2038 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2041 # @BlockDirtyBitmap:
2043 # @node: name of device/node which the bitmap is tracking
2045 # @name: name of the dirty bitmap
2049 { 'struct': 'BlockDirtyBitmap',
2050 'data': { 'node': 'str', 'name': 'str' } }
2053 # @BlockDirtyBitmapAdd:
2055 # @node: name of device/node which the bitmap is tracking
2057 # @name: name of the dirty bitmap (must be less than 1024 bytes)
2059 # @granularity: the bitmap granularity, default is 64k for
2060 # block-dirty-bitmap-add
2062 # @persistent: the bitmap is persistent, i.e. it will be saved to the
2063 # corresponding block device image file on its close. For now only
2064 # Qcow2 disks support persistent bitmaps. Default is false for
2065 # block-dirty-bitmap-add. (Since: 2.10)
2067 # @disabled: the bitmap is created in the disabled state, which means that
2068 # it will not track drive changes. The bitmap may be enabled with
2069 # block-dirty-bitmap-enable. Default is false. (Since: 4.0)
2073 { 'struct': 'BlockDirtyBitmapAdd',
2074 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
2075 '*persistent': 'bool', '*disabled': 'bool' } }
2078 # @BlockDirtyBitmapOrStr:
2080 # @local: name of the bitmap, attached to the same node as target bitmap.
2082 # @external: bitmap with specified node
2086 { 'alternate': 'BlockDirtyBitmapOrStr',
2087 'data': { 'local': 'str',
2088 'external': 'BlockDirtyBitmap' } }
2091 # @BlockDirtyBitmapMerge:
2093 # @node: name of device/node which the @target bitmap is tracking
2095 # @target: name of the destination dirty bitmap
2097 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully
2098 # specified BlockDirtyBitmap elements. The latter are supported
2103 { 'struct': 'BlockDirtyBitmapMerge',
2104 'data': { 'node': 'str', 'target': 'str',
2105 'bitmaps': ['BlockDirtyBitmapOrStr'] } }
2108 # @block-dirty-bitmap-add:
2110 # Create a dirty bitmap with a name on the node, and start tracking the writes.
2112 # Returns: - nothing on success
2113 # - If @node is not a valid block device or node, DeviceNotFound
2114 # - If @name is already taken, GenericError with an explanation
2120 # -> { "execute": "block-dirty-bitmap-add",
2121 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2122 # <- { "return": {} }
2125 { 'command': 'block-dirty-bitmap-add',
2126 'data': 'BlockDirtyBitmapAdd' }
2129 # @block-dirty-bitmap-remove:
2131 # Stop write tracking and remove the dirty bitmap that was created
2132 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2135 # Returns: - nothing on success
2136 # - If @node is not a valid block device or node, DeviceNotFound
2137 # - If @name is not found, GenericError with an explanation
2138 # - if @name is frozen by an operation, GenericError
2144 # -> { "execute": "block-dirty-bitmap-remove",
2145 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2146 # <- { "return": {} }
2149 { 'command': 'block-dirty-bitmap-remove',
2150 'data': 'BlockDirtyBitmap' }
2153 # @block-dirty-bitmap-clear:
2155 # Clear (reset) a dirty bitmap on the device, so that an incremental
2156 # backup from this point in time forward will only backup clusters
2157 # modified after this clear operation.
2159 # Returns: - nothing on success
2160 # - If @node is not a valid block device, DeviceNotFound
2161 # - If @name is not found, GenericError with an explanation
2167 # -> { "execute": "block-dirty-bitmap-clear",
2168 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2169 # <- { "return": {} }
2172 { 'command': 'block-dirty-bitmap-clear',
2173 'data': 'BlockDirtyBitmap' }
2176 # @block-dirty-bitmap-enable:
2178 # Enables a dirty bitmap so that it will begin tracking disk changes.
2180 # Returns: - nothing on success
2181 # - If @node is not a valid block device, DeviceNotFound
2182 # - If @name is not found, GenericError with an explanation
2188 # -> { "execute": "block-dirty-bitmap-enable",
2189 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2190 # <- { "return": {} }
2193 { 'command': 'block-dirty-bitmap-enable',
2194 'data': 'BlockDirtyBitmap' }
2197 # @block-dirty-bitmap-disable:
2199 # Disables a dirty bitmap so that it will stop tracking disk changes.
2201 # Returns: - nothing on success
2202 # - If @node is not a valid block device, DeviceNotFound
2203 # - If @name is not found, GenericError with an explanation
2209 # -> { "execute": "block-dirty-bitmap-disable",
2210 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2211 # <- { "return": {} }
2214 { 'command': 'block-dirty-bitmap-disable',
2215 'data': 'BlockDirtyBitmap' }
2218 # @block-dirty-bitmap-merge:
2220 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2221 # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2222 # as the @target bitmap. Any bits already set in @target will still be
2223 # set after the merge, i.e., this operation does not clear the target.
2224 # On error, @target is unchanged.
2226 # The resulting bitmap will count as dirty any clusters that were dirty in any
2227 # of the source bitmaps. This can be used to achieve backup checkpoints, or in
2228 # simpler usages, to copy bitmaps.
2230 # Returns: - nothing on success
2231 # - If @node is not a valid block device, DeviceNotFound
2232 # - If any bitmap in @bitmaps or @target is not found, GenericError
2233 # - If any of the bitmaps have different sizes or granularities,
2240 # -> { "execute": "block-dirty-bitmap-merge",
2241 # "arguments": { "node": "drive0", "target": "bitmap0",
2242 # "bitmaps": ["bitmap1"] } }
2243 # <- { "return": {} }
2246 { 'command': 'block-dirty-bitmap-merge',
2247 'data': 'BlockDirtyBitmapMerge' }
2250 # @BlockDirtyBitmapSha256:
2252 # SHA256 hash of dirty bitmap data
2254 # @sha256: ASCII representation of SHA256 bitmap hash
2258 { 'struct': 'BlockDirtyBitmapSha256',
2259 'data': {'sha256': 'str'} }
2262 # @x-debug-block-dirty-bitmap-sha256:
2264 # Get bitmap SHA256.
2267 # @unstable: This command is meant for debugging.
2269 # Returns: - BlockDirtyBitmapSha256 on success
2270 # - If @node is not a valid block device, DeviceNotFound
2271 # - If @name is not found or if hashing has failed, GenericError with an
2276 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2277 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256',
2278 'features': [ 'unstable' ] }
2283 # Start mirroring a block device's writes to a new destination.
2285 # @job-id: identifier for the newly-created block job. If
2286 # omitted, the device name will be used. (Since 2.7)
2288 # @device: The device name or node-name of a root node whose writes should be
2291 # @target: the id or node-name of the block device to mirror to. This mustn't be
2292 # attached to guest.
2294 # @replaces: with sync=full graph node name to be replaced by the new
2295 # image when a whole image copy is done. This can be used to repair
2296 # broken Quorum files. By default, @device is replaced, although
2297 # implicitly created filters on it are kept.
2299 # @speed: the maximum speed, in bytes per second
2301 # @sync: what parts of the disk image should be copied to the destination
2302 # (all the disk, only the sectors allocated in the topmost image, or
2305 # @granularity: granularity of the dirty bitmap, default is 64K
2306 # if the image format doesn't have clusters, 4K if the clusters
2307 # are smaller than that, else the cluster size. Must be a
2308 # power of 2 between 512 and 64M
2310 # @buf-size: maximum amount of data in flight from source to
2313 # @on-source-error: the action to take on an error on the source,
2314 # default 'report'. 'stop' and 'enospc' can only be used
2315 # if the block device supports io-status (see BlockInfo).
2317 # @on-target-error: the action to take on an error on the target,
2318 # default 'report' (no limitations, since this applies to
2319 # a different block device than @device).
2321 # @filter-node-name: the node name that should be assigned to the
2322 # filter driver that the mirror job inserts into the graph
2323 # above @device. If this option is not given, a node name is
2324 # autogenerated. (Since: 2.9)
2326 # @copy-mode: when to copy data to the destination; defaults to 'background'
2329 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2330 # finished its work, waiting for @block-job-finalize before
2331 # making any block graph changes.
2332 # When true, this job will automatically
2333 # perform its abort or commit actions.
2334 # Defaults to true. (Since 3.1)
2336 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2337 # has completely ceased all work, and awaits @block-job-dismiss.
2338 # When true, this job will automatically disappear from the query
2339 # list without user intervention.
2340 # Defaults to true. (Since 3.1)
2342 # Returns: nothing on success.
2348 # -> { "execute": "blockdev-mirror",
2349 # "arguments": { "device": "ide-hd0",
2350 # "target": "target0",
2351 # "sync": "full" } }
2352 # <- { "return": {} }
2355 { 'command': 'blockdev-mirror',
2356 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2358 'sync': 'MirrorSyncMode',
2359 '*speed': 'int', '*granularity': 'uint32',
2360 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2361 '*on-target-error': 'BlockdevOnError',
2362 '*filter-node-name': 'str',
2363 '*copy-mode': 'MirrorCopyMode',
2364 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2369 # A set of parameters describing block throttling.
2371 # @device: Block device name
2373 # @id: The name or QOM path of the guest device (since: 2.8)
2375 # @bps: total throughput limit in bytes per second
2377 # @bps_rd: read throughput limit in bytes per second
2379 # @bps_wr: write throughput limit in bytes per second
2381 # @iops: total I/O operations per second
2383 # @iops_rd: read I/O operations per second
2385 # @iops_wr: write I/O operations per second
2387 # @bps_max: total throughput limit during bursts,
2388 # in bytes (Since 1.7)
2390 # @bps_rd_max: read throughput limit during bursts,
2391 # in bytes (Since 1.7)
2393 # @bps_wr_max: write throughput limit during bursts,
2394 # in bytes (Since 1.7)
2396 # @iops_max: total I/O operations per second during bursts,
2397 # in bytes (Since 1.7)
2399 # @iops_rd_max: read I/O operations per second during bursts,
2400 # in bytes (Since 1.7)
2402 # @iops_wr_max: write I/O operations per second during bursts,
2403 # in bytes (Since 1.7)
2405 # @bps_max_length: maximum length of the @bps_max burst
2406 # period, in seconds. It must only
2407 # be set if @bps_max is set as well.
2408 # Defaults to 1. (Since 2.6)
2410 # @bps_rd_max_length: maximum length of the @bps_rd_max
2411 # burst period, in seconds. It must only
2412 # be set if @bps_rd_max is set as well.
2413 # Defaults to 1. (Since 2.6)
2415 # @bps_wr_max_length: maximum length of the @bps_wr_max
2416 # burst period, in seconds. It must only
2417 # be set if @bps_wr_max is set as well.
2418 # Defaults to 1. (Since 2.6)
2420 # @iops_max_length: maximum length of the @iops burst
2421 # period, in seconds. It must only
2422 # be set if @iops_max is set as well.
2423 # Defaults to 1. (Since 2.6)
2425 # @iops_rd_max_length: maximum length of the @iops_rd_max
2426 # burst period, in seconds. It must only
2427 # be set if @iops_rd_max is set as well.
2428 # Defaults to 1. (Since 2.6)
2430 # @iops_wr_max_length: maximum length of the @iops_wr_max
2431 # burst period, in seconds. It must only
2432 # be set if @iops_wr_max is set as well.
2433 # Defaults to 1. (Since 2.6)
2435 # @iops_size: an I/O size in bytes (Since 1.7)
2437 # @group: throttle group name (Since 2.4)
2440 # @deprecated: Member @device is deprecated. Use @id instead.
2444 { 'struct': 'BlockIOThrottle',
2445 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
2446 '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2447 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2448 '*bps_max': 'int', '*bps_rd_max': 'int',
2449 '*bps_wr_max': 'int', '*iops_max': 'int',
2450 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2451 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2452 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2453 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2454 '*iops_size': 'int', '*group': 'str' } }
2459 # Limit parameters for throttling.
2460 # Since some limit combinations are illegal, limits should always be set in one
2461 # transaction. All fields are optional. When setting limits, if a field is
2462 # missing the current value is not changed.
2464 # @iops-total: limit total I/O operations per second
2465 # @iops-total-max: I/O operations burst
2466 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2467 # It must only be set if @iops-total-max is set as well.
2468 # @iops-read: limit read operations per second
2469 # @iops-read-max: I/O operations read burst
2470 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2471 # It must only be set if @iops-read-max is set as well.
2472 # @iops-write: limit write operations per second
2473 # @iops-write-max: I/O operations write burst
2474 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2475 # It must only be set if @iops-write-max is set as well.
2476 # @bps-total: limit total bytes per second
2477 # @bps-total-max: total bytes burst
2478 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2479 # It must only be set if @bps-total-max is set as well.
2480 # @bps-read: limit read bytes per second
2481 # @bps-read-max: total bytes read burst
2482 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2483 # It must only be set if @bps-read-max is set as well.
2484 # @bps-write: limit write bytes per second
2485 # @bps-write-max: total bytes write burst
2486 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2487 # It must only be set if @bps-write-max is set as well.
2488 # @iops-size: when limiting by iops max size of an I/O in bytes
2492 { 'struct': 'ThrottleLimits',
2493 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2494 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2495 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2496 '*iops-write' : 'int', '*iops-write-max' : 'int',
2497 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2498 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2499 '*bps-read' : 'int', '*bps-read-max' : 'int',
2500 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2501 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2502 '*iops-size' : 'int' } }
2505 # @ThrottleGroupProperties:
2507 # Properties for throttle-group objects.
2509 # @limits: limits to apply for this throttle group
2512 # @unstable: All members starting with x- are aliases for the same key
2513 # without x- in the @limits object. This is not a stable
2514 # interface and may be removed or changed incompatibly in
2515 # the future. Use @limits for a supported stable
2520 { 'struct': 'ThrottleGroupProperties',
2521 'data': { '*limits': 'ThrottleLimits',
2522 '*x-iops-total': { 'type': 'int',
2523 'features': [ 'unstable' ] },
2524 '*x-iops-total-max': { 'type': 'int',
2525 'features': [ 'unstable' ] },
2526 '*x-iops-total-max-length': { 'type': 'int',
2527 'features': [ 'unstable' ] },
2528 '*x-iops-read': { 'type': 'int',
2529 'features': [ 'unstable' ] },
2530 '*x-iops-read-max': { 'type': 'int',
2531 'features': [ 'unstable' ] },
2532 '*x-iops-read-max-length': { 'type': 'int',
2533 'features': [ 'unstable' ] },
2534 '*x-iops-write': { 'type': 'int',
2535 'features': [ 'unstable' ] },
2536 '*x-iops-write-max': { 'type': 'int',
2537 'features': [ 'unstable' ] },
2538 '*x-iops-write-max-length': { 'type': 'int',
2539 'features': [ 'unstable' ] },
2540 '*x-bps-total': { 'type': 'int',
2541 'features': [ 'unstable' ] },
2542 '*x-bps-total-max': { 'type': 'int',
2543 'features': [ 'unstable' ] },
2544 '*x-bps-total-max-length': { 'type': 'int',
2545 'features': [ 'unstable' ] },
2546 '*x-bps-read': { 'type': 'int',
2547 'features': [ 'unstable' ] },
2548 '*x-bps-read-max': { 'type': 'int',
2549 'features': [ 'unstable' ] },
2550 '*x-bps-read-max-length': { 'type': 'int',
2551 'features': [ 'unstable' ] },
2552 '*x-bps-write': { 'type': 'int',
2553 'features': [ 'unstable' ] },
2554 '*x-bps-write-max': { 'type': 'int',
2555 'features': [ 'unstable' ] },
2556 '*x-bps-write-max-length': { 'type': 'int',
2557 'features': [ 'unstable' ] },
2558 '*x-iops-size': { 'type': 'int',
2559 'features': [ 'unstable' ] } } }
2564 # Copy data from a backing file into a block device.
2566 # The block streaming operation is performed in the background until the entire
2567 # backing file has been copied. This command returns immediately once streaming
2568 # has started. The status of ongoing block streaming operations can be checked
2569 # with query-block-jobs. The operation can be stopped before it has completed
2570 # using the block-job-cancel command.
2572 # The node that receives the data is called the top image, can be located in
2573 # any part of the chain (but always above the base image; see below) and can be
2574 # specified using its device or node name. Earlier qemu versions only allowed
2575 # 'device' to name the top level node; presence of the 'base-node' parameter
2576 # during introspection can be used as a witness of the enhanced semantics
2579 # If a base file is specified then sectors are not copied from that base file and
2580 # its backing chain. This can be used to stream a subset of the backing file
2581 # chain instead of flattening the entire image.
2582 # When streaming completes the image file will have the base file as its backing
2583 # file, unless that node was changed while the job was running. In that case,
2584 # base's parent's backing (or filtered, whichever exists) child (i.e., base at
2585 # the beginning of the job) will be the new backing file.
2587 # On successful completion the image file is updated to drop the backing file
2588 # and the BLOCK_JOB_COMPLETED event is emitted.
2590 # In case @device is a filter node, block-stream modifies the first non-filter
2591 # overlay node below it to point to the new backing node instead of modifying
2594 # @job-id: identifier for the newly-created block job. If
2595 # omitted, the device name will be used. (Since 2.7)
2597 # @device: the device or node name of the top image
2599 # @base: the common backing file name.
2600 # It cannot be set if @base-node or @bottom is also set.
2602 # @base-node: the node name of the backing file.
2603 # It cannot be set if @base or @bottom is also set. (Since 2.8)
2605 # @bottom: the last node in the chain that should be streamed into
2606 # top. It cannot be set if @base or @base-node is also set.
2607 # It cannot be filter node. (Since 6.0)
2609 # @backing-file: The backing file string to write into the top
2610 # image. This filename is not validated.
2612 # If a pathname string is such that it cannot be
2613 # resolved by QEMU, that means that subsequent QMP or
2614 # HMP commands must use node-names for the image in
2615 # question, as filename lookup methods will fail.
2617 # If not specified, QEMU will automatically determine
2618 # the backing file string to use, or error out if there
2619 # is no obvious choice. Care should be taken when
2620 # specifying the string, to specify a valid filename or
2624 # @speed: the maximum speed, in bytes per second
2626 # @on-error: the action to take on an error (default report).
2627 # 'stop' and 'enospc' can only be used if the block device
2628 # supports io-status (see BlockInfo). Since 1.3.
2630 # @filter-node-name: the node name that should be assigned to the
2631 # filter driver that the stream job inserts into the graph
2632 # above @device. If this option is not given, a node name is
2633 # autogenerated. (Since: 6.0)
2635 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2636 # finished its work, waiting for @block-job-finalize before
2637 # making any block graph changes.
2638 # When true, this job will automatically
2639 # perform its abort or commit actions.
2640 # Defaults to true. (Since 3.1)
2642 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2643 # has completely ceased all work, and awaits @block-job-dismiss.
2644 # When true, this job will automatically disappear from the query
2645 # list without user intervention.
2646 # Defaults to true. (Since 3.1)
2648 # Returns: - Nothing on success.
2649 # - If @device does not exist, DeviceNotFound.
2655 # -> { "execute": "block-stream",
2656 # "arguments": { "device": "virtio0",
2657 # "base": "/tmp/master.qcow2" } }
2658 # <- { "return": {} }
2661 { 'command': 'block-stream',
2662 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2663 '*base-node': 'str', '*backing-file': 'str', '*bottom': 'str',
2664 '*speed': 'int', '*on-error': 'BlockdevOnError',
2665 '*filter-node-name': 'str',
2666 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2669 # @block-job-set-speed:
2671 # Set maximum speed for a background block operation.
2673 # This command can only be issued when there is an active block job.
2675 # Throttling can be disabled by setting the speed to 0.
2677 # @device: The job identifier. This used to be a device name (hence
2678 # the name of the parameter), but since QEMU 2.7 it can have
2681 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2684 # Returns: - Nothing on success
2685 # - If no background operation is active on this device, DeviceNotActive
2689 { 'command': 'block-job-set-speed',
2690 'data': { 'device': 'str', 'speed': 'int' } }
2693 # @block-job-cancel:
2695 # Stop an active background block operation.
2697 # This command returns immediately after marking the active background block
2698 # operation for cancellation. It is an error to call this command if no
2699 # operation is in progress.
2701 # The operation will cancel as soon as possible and then emit the
2702 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2703 # enumerated using query-block-jobs.
2705 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2706 # (via the event BLOCK_JOB_READY) that the source and destination are
2707 # synchronized, then the event triggered by this command changes to
2708 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2709 # destination now has a point-in-time copy tied to the time of the cancellation.
2711 # For streaming, the image file retains its backing file unless the streaming
2712 # operation happens to complete just as it is being cancelled. A new streaming
2713 # operation can be started at a later time to finish copying all data from the
2716 # @device: The job identifier. This used to be a device name (hence
2717 # the name of the parameter), but since QEMU 2.7 it can have
2720 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2721 # abandon the job immediately (even if it is paused) instead of waiting
2722 # for the destination to complete its final synchronization (since 1.3)
2724 # Returns: - Nothing on success
2725 # - If no background operation is active on this device, DeviceNotActive
2729 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2734 # Pause an active background block operation.
2736 # This command returns immediately after marking the active background block
2737 # operation for pausing. It is an error to call this command if no
2738 # operation is in progress or if the job is already paused.
2740 # The operation will pause as soon as possible. No event is emitted when
2741 # the operation is actually paused. Cancelling a paused job automatically
2744 # @device: The job identifier. This used to be a device name (hence
2745 # the name of the parameter), but since QEMU 2.7 it can have
2748 # Returns: - Nothing on success
2749 # - If no background operation is active on this device, DeviceNotActive
2753 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2756 # @block-job-resume:
2758 # Resume an active background block operation.
2760 # This command returns immediately after resuming a paused background block
2761 # operation. It is an error to call this command if no operation is in
2762 # progress or if the job is not paused.
2764 # This command also clears the error status of the job.
2766 # @device: The job identifier. This used to be a device name (hence
2767 # the name of the parameter), but since QEMU 2.7 it can have
2770 # Returns: - Nothing on success
2771 # - If no background operation is active on this device, DeviceNotActive
2775 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2778 # @block-job-complete:
2780 # Manually trigger completion of an active background block operation. This
2781 # is supported for drive mirroring, where it also switches the device to
2782 # write to the target path only. The ability to complete is signaled with
2783 # a BLOCK_JOB_READY event.
2785 # This command completes an active background block operation synchronously.
2786 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2787 # is not defined. Note that if an I/O error occurs during the processing of
2788 # this command: 1) the command itself will fail; 2) the error will be processed
2789 # according to the rerror/werror arguments that were specified when starting
2792 # A cancelled or paused job cannot be completed.
2794 # @device: The job identifier. This used to be a device name (hence
2795 # the name of the parameter), but since QEMU 2.7 it can have
2798 # Returns: - Nothing on success
2799 # - If no background operation is active on this device, DeviceNotActive
2803 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2806 # @block-job-dismiss:
2808 # For jobs that have already concluded, remove them from the block-job-query
2809 # list. This command only needs to be run for jobs which were started with
2810 # QEMU 2.12+ job lifetime management semantics.
2812 # This command will refuse to operate on any job that has not yet reached
2813 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2814 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2815 # to be used as appropriate.
2817 # @id: The job identifier.
2819 # Returns: Nothing on success
2823 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2826 # @block-job-finalize:
2828 # Once a job that has manual=true reaches the pending state, it can be
2829 # instructed to finalize any graph changes and do any necessary cleanup
2831 # For jobs in a transaction, instructing one job to finalize will force
2832 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2833 # a single member job to finalize.
2835 # @id: The job identifier.
2837 # Returns: Nothing on success
2841 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2844 # @BlockdevDiscardOptions:
2846 # Determines how to handle discard requests.
2848 # @ignore: Ignore the request
2849 # @unmap: Forward as an unmap request
2853 { 'enum': 'BlockdevDiscardOptions',
2854 'data': [ 'ignore', 'unmap' ] }
2857 # @BlockdevDetectZeroesOptions:
2859 # Describes the operation mode for the automatic conversion of plain
2860 # zero writes by the OS to driver specific optimized zero write commands.
2862 # @off: Disabled (default)
2864 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2865 # also that @BlockdevDiscardOptions is set to unmap for this device.
2869 { 'enum': 'BlockdevDetectZeroesOptions',
2870 'data': [ 'off', 'on', 'unmap' ] }
2873 # @BlockdevAioOptions:
2875 # Selects the AIO backend to handle I/O requests
2877 # @threads: Use qemu's thread pool
2878 # @native: Use native AIO backend (only Linux and Windows)
2879 # @io_uring: Use linux io_uring (since 5.0)
2883 { 'enum': 'BlockdevAioOptions',
2884 'data': [ 'threads', 'native',
2885 { 'name': 'io_uring', 'if': 'CONFIG_LINUX_IO_URING' } ] }
2888 # @BlockdevCacheOptions:
2890 # Includes cache-related options for block devices
2892 # @direct: enables use of O_DIRECT (bypass the host page cache;
2894 # @no-flush: ignore any flush requests for the device (default:
2899 { 'struct': 'BlockdevCacheOptions',
2900 'data': { '*direct': 'bool',
2901 '*no-flush': 'bool' } }
2906 # Drivers that are supported in block device operations.
2908 # @throttle: Since 2.11
2910 # @copy-on-read: Since 3.0
2911 # @blklogwrites: Since 3.0
2912 # @blkreplay: Since 4.2
2913 # @compress: Since 5.0
2914 # @copy-before-write: Since 6.2
2915 # @snapshot-access: Since 7.0
2919 { 'enum': 'BlockdevDriver',
2920 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
2921 'cloop', 'compress', 'copy-before-write', 'copy-on-read', 'dmg',
2922 'file', 'snapshot-access', 'ftp', 'ftps', 'gluster',
2923 {'name': 'host_cdrom', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
2924 {'name': 'host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
2925 'http', 'https', 'iscsi',
2926 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
2927 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
2928 { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
2929 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
2932 # @BlockdevOptionsFile:
2934 # Driver specific block device options for the file backend.
2936 # @filename: path to the image file
2937 # @pr-manager: the id for the object that will handle persistent reservations
2938 # for this device (default: none, forward the commands via SG_IO;
2940 # @aio: AIO backend (default: threads) (since: 2.8)
2941 # @aio-max-batch: maximum number of requests to batch together into a single
2942 # submission in the AIO backend. The smallest value between
2943 # this and the aio-max-batch value of the IOThread object is
2945 # 0 means that the AIO backend will handle it automatically.
2946 # (default: 0, since 6.2)
2947 # @locking: whether to enable file locking. If set to 'auto', only enable
2948 # when Open File Descriptor (OFD) locking API is available
2949 # (default: auto, since 2.10)
2950 # @drop-cache: invalidate page cache during live migration. This prevents
2951 # stale data on the migration destination with cache.direct=off.
2952 # Currently only supported on Linux hosts.
2953 # (default: on, since: 4.0)
2954 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2955 # migration. May cause noticeable delays if the image
2956 # file is large, do not use in production.
2957 # (default: off) (since: 3.0)
2960 # @dynamic-auto-read-only: If present, enabled auto-read-only means that the
2961 # driver will open the image read-only at first,
2962 # dynamically reopen the image file read-write when
2963 # the first writer is attached to the node and reopen
2964 # read-only when the last writer is detached. This
2965 # allows giving QEMU write permissions only on demand
2966 # when an operation actually needs write access.
2967 # @unstable: Member x-check-cache-dropped is meant for debugging.
2971 { 'struct': 'BlockdevOptionsFile',
2972 'data': { 'filename': 'str',
2973 '*pr-manager': 'str',
2974 '*locking': 'OnOffAuto',
2975 '*aio': 'BlockdevAioOptions',
2976 '*aio-max-batch': 'int',
2977 '*drop-cache': {'type': 'bool',
2978 'if': 'CONFIG_LINUX'},
2979 '*x-check-cache-dropped': { 'type': 'bool',
2980 'features': [ 'unstable' ] } },
2981 'features': [ { 'name': 'dynamic-auto-read-only',
2982 'if': 'CONFIG_POSIX' } ] }
2985 # @BlockdevOptionsNull:
2987 # Driver specific block device options for the null backend.
2989 # @size: size of the device in bytes.
2990 # @latency-ns: emulated latency (in nanoseconds) in processing
2991 # requests. Default to zero which completes requests immediately.
2993 # @read-zeroes: if true, reads from the device produce zeroes; if false, the
2994 # buffer is left unchanged. (default: false; since: 4.1)
2998 { 'struct': 'BlockdevOptionsNull',
2999 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
3002 # @BlockdevOptionsNVMe:
3004 # Driver specific block device options for the NVMe backend.
3006 # @device: PCI controller address of the NVMe device in
3007 # format hhhh:bb:ss.f (host:bus:slot.function)
3008 # @namespace: namespace number of the device, starting from 1.
3010 # Note that the PCI @device must have been unbound from any host
3011 # kernel driver before instructing QEMU to add the blockdev.
3015 { 'struct': 'BlockdevOptionsNVMe',
3016 'data': { 'device': 'str', 'namespace': 'int' } }
3019 # @BlockdevOptionsVVFAT:
3021 # Driver specific block device options for the vvfat protocol.
3023 # @dir: directory to be exported as FAT image
3024 # @fat-type: FAT type: 12, 16 or 32
3025 # @floppy: whether to export a floppy image (true) or
3026 # partitioned hard disk (false; default)
3027 # @label: set the volume label, limited to 11 bytes. FAT16 and
3028 # FAT32 traditionally have some restrictions on labels, which are
3029 # ignored by most operating systems. Defaults to "QEMU VVFAT".
3031 # @rw: whether to allow write operations (default: false)
3035 { 'struct': 'BlockdevOptionsVVFAT',
3036 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
3037 '*label': 'str', '*rw': 'bool' } }
3040 # @BlockdevOptionsGenericFormat:
3042 # Driver specific block device options for image format that have no option
3043 # besides their data source.
3045 # @file: reference to or definition of the data source block device
3049 { 'struct': 'BlockdevOptionsGenericFormat',
3050 'data': { 'file': 'BlockdevRef' } }
3053 # @BlockdevOptionsLUKS:
3055 # Driver specific block device options for LUKS.
3057 # @key-secret: the ID of a QCryptoSecret object providing
3058 # the decryption key (since 2.6). Mandatory except when
3059 # doing a metadata-only probe of the image.
3063 { 'struct': 'BlockdevOptionsLUKS',
3064 'base': 'BlockdevOptionsGenericFormat',
3065 'data': { '*key-secret': 'str' } }
3068 # @BlockdevOptionsGenericCOWFormat:
3070 # Driver specific block device options for image format that have no option
3071 # besides their data source and an optional backing file.
3073 # @backing: reference to or definition of the backing file block
3074 # device, null disables the backing file entirely.
3075 # Defaults to the backing file stored the image file.
3079 { 'struct': 'BlockdevOptionsGenericCOWFormat',
3080 'base': 'BlockdevOptionsGenericFormat',
3081 'data': { '*backing': 'BlockdevRefOrNull' } }
3084 # @Qcow2OverlapCheckMode:
3086 # General overlap check modes.
3088 # @none: Do not perform any checks
3090 # @constant: Perform only checks which can be done in constant time and
3091 # without reading anything from disk
3093 # @cached: Perform only checks which can be done without reading anything
3096 # @all: Perform all available overlap checks
3100 { 'enum': 'Qcow2OverlapCheckMode',
3101 'data': [ 'none', 'constant', 'cached', 'all' ] }
3104 # @Qcow2OverlapCheckFlags:
3106 # Structure of flags for each metadata structure. Setting a field to 'true'
3107 # makes qemu guard that structure against unintended overwriting. The default
3108 # value is chosen according to the template given.
3110 # @template: Specifies a template mode which can be adjusted using the other
3111 # flags, defaults to 'cached'
3113 # @bitmap-directory: since 3.0
3117 { 'struct': 'Qcow2OverlapCheckFlags',
3118 'data': { '*template': 'Qcow2OverlapCheckMode',
3119 '*main-header': 'bool',
3120 '*active-l1': 'bool',
3121 '*active-l2': 'bool',
3122 '*refcount-table': 'bool',
3123 '*refcount-block': 'bool',
3124 '*snapshot-table': 'bool',
3125 '*inactive-l1': 'bool',
3126 '*inactive-l2': 'bool',
3127 '*bitmap-directory': 'bool' } }
3130 # @Qcow2OverlapChecks:
3132 # Specifies which metadata structures should be guarded against unintended
3135 # @flags: set of flags for separate specification of each metadata structure
3138 # @mode: named mode which chooses a specific set of flags
3142 { 'alternate': 'Qcow2OverlapChecks',
3143 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3144 'mode': 'Qcow2OverlapCheckMode' } }
3147 # @BlockdevQcowEncryptionFormat:
3149 # @aes: AES-CBC with plain64 initialization vectors
3153 { 'enum': 'BlockdevQcowEncryptionFormat',
3157 # @BlockdevQcowEncryption:
3161 { 'union': 'BlockdevQcowEncryption',
3162 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3163 'discriminator': 'format',
3164 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3167 # @BlockdevOptionsQcow:
3169 # Driver specific block device options for qcow.
3171 # @encrypt: Image decryption options. Mandatory for
3172 # encrypted images, except when doing a metadata-only
3173 # probe of the image.
3177 { 'struct': 'BlockdevOptionsQcow',
3178 'base': 'BlockdevOptionsGenericCOWFormat',
3179 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3182 # @BlockdevQcow2EncryptionFormat:
3184 # @aes: AES-CBC with plain64 initialization vectors
3188 { 'enum': 'BlockdevQcow2EncryptionFormat',
3189 'data': [ 'aes', 'luks' ] }
3192 # @BlockdevQcow2Encryption:
3196 { 'union': 'BlockdevQcow2Encryption',
3197 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3198 'discriminator': 'format',
3199 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3200 'luks': 'QCryptoBlockOptionsLUKS'} }
3203 # @BlockdevOptionsPreallocate:
3205 # Filter driver intended to be inserted between format and protocol node
3206 # and do preallocation in protocol node on write.
3208 # @prealloc-align: on preallocation, align file length to this number,
3209 # default 1048576 (1M)
3211 # @prealloc-size: how much to preallocate, default 134217728 (128M)
3215 { 'struct': 'BlockdevOptionsPreallocate',
3216 'base': 'BlockdevOptionsGenericFormat',
3217 'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } }
3220 # @BlockdevOptionsQcow2:
3222 # Driver specific block device options for qcow2.
3224 # @lazy-refcounts: whether to enable the lazy refcounts
3225 # feature (default is taken from the image file)
3227 # @pass-discard-request: whether discard requests to the qcow2
3228 # device should be forwarded to the data source
3230 # @pass-discard-snapshot: whether discard requests for the data source
3231 # should be issued when a snapshot operation (e.g.
3232 # deleting a snapshot) frees clusters in the qcow2 file
3234 # @pass-discard-other: whether discard requests for the data source
3235 # should be issued on other occasions where a cluster
3238 # @overlap-check: which overlap checks to perform for writes
3239 # to the image, defaults to 'cached' (since 2.2)
3241 # @cache-size: the maximum total size of the L2 table and
3242 # refcount block caches in bytes (since 2.2)
3244 # @l2-cache-size: the maximum size of the L2 table cache in
3247 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3248 # bytes. It must be a power of two between 512
3249 # and the cluster size. The default value is
3250 # the cluster size (since 2.12)
3252 # @refcount-cache-size: the maximum size of the refcount block cache
3253 # in bytes (since 2.2)
3255 # @cache-clean-interval: clean unused entries in the L2 and refcount
3256 # caches. The interval is in seconds. The default value
3257 # is 600 on supporting platforms, and 0 on other
3258 # platforms. 0 disables this feature. (since 2.5)
3260 # @encrypt: Image decryption options. Mandatory for
3261 # encrypted images, except when doing a metadata-only
3262 # probe of the image. (since 2.10)
3264 # @data-file: reference to or definition of the external data file.
3265 # This may only be specified for images that require an
3266 # external data file. If it is not specified for such
3267 # an image, the data file name is loaded from the image
3272 { 'struct': 'BlockdevOptionsQcow2',
3273 'base': 'BlockdevOptionsGenericCOWFormat',
3274 'data': { '*lazy-refcounts': 'bool',
3275 '*pass-discard-request': 'bool',
3276 '*pass-discard-snapshot': 'bool',
3277 '*pass-discard-other': 'bool',
3278 '*overlap-check': 'Qcow2OverlapChecks',
3279 '*cache-size': 'int',
3280 '*l2-cache-size': 'int',
3281 '*l2-cache-entry-size': 'int',
3282 '*refcount-cache-size': 'int',
3283 '*cache-clean-interval': 'int',
3284 '*encrypt': 'BlockdevQcow2Encryption',
3285 '*data-file': 'BlockdevRef' } }
3288 # @SshHostKeyCheckMode:
3290 # @none: Don't check the host key at all
3291 # @hash: Compare the host key with a given hash
3292 # @known_hosts: Check the host key against the known_hosts file
3296 { 'enum': 'SshHostKeyCheckMode',
3297 'data': [ 'none', 'hash', 'known_hosts' ] }
3300 # @SshHostKeyCheckHashType:
3302 # @md5: The given hash is an md5 hash
3303 # @sha1: The given hash is an sha1 hash
3304 # @sha256: The given hash is an sha256 hash
3308 { 'enum': 'SshHostKeyCheckHashType',
3309 'data': [ 'md5', 'sha1', 'sha256' ] }
3314 # @type: The hash algorithm used for the hash
3315 # @hash: The expected hash value
3319 { 'struct': 'SshHostKeyHash',
3320 'data': { 'type': 'SshHostKeyCheckHashType',
3328 { 'union': 'SshHostKeyCheck',
3329 'base': { 'mode': 'SshHostKeyCheckMode' },
3330 'discriminator': 'mode',
3331 'data': { 'hash': 'SshHostKeyHash' } }
3334 # @BlockdevOptionsSsh:
3336 # @server: host address
3338 # @path: path to the image on the host
3340 # @user: user as which to connect, defaults to current local user name
3342 # @host-key-check: Defines how and what to check the host key against
3343 # (default: known_hosts)
3347 { 'struct': 'BlockdevOptionsSsh',
3348 'data': { 'server': 'InetSocketAddress',
3351 '*host-key-check': 'SshHostKeyCheck' } }
3356 # Trigger events supported by blkdebug.
3358 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3361 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3363 # @cor_write: a write due to copy-on-read (since 2.11)
3365 # @cluster_alloc_space: an allocation of file space for a cluster (since 4.1)
3367 # @none: triggers once at creation of the blkdebug node (since 4.1)
3371 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3372 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3373 'l1_grow_activate_table', 'l2_load', 'l2_update',
3374 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3375 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3376 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3377 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3378 'refblock_load', 'refblock_update', 'refblock_update_part',
3379 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3380 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3381 'refblock_alloc_switch_table', 'cluster_alloc',
3382 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3383 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3384 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3385 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3386 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3387 'cor_write', 'cluster_alloc_space', 'none'] }
3392 # Kinds of I/O that blkdebug can inject errors in.
3394 # @read: .bdrv_co_preadv()
3396 # @write: .bdrv_co_pwritev()
3398 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3400 # @discard: .bdrv_co_pdiscard()
3402 # @flush: .bdrv_co_flush_to_disk()
3404 # @block-status: .bdrv_co_block_status()
3408 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3409 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3413 # @BlkdebugInjectErrorOptions:
3415 # Describes a single error injection for blkdebug.
3417 # @event: trigger event
3419 # @state: the state identifier blkdebug needs to be in to
3420 # actually trigger the event; defaults to "any"
3422 # @iotype: the type of I/O operations on which this error should
3423 # be injected; defaults to "all read, write,
3424 # write-zeroes, discard, and flush operations"
3427 # @errno: error identifier (errno) to be returned; defaults to
3430 # @sector: specifies the sector index which has to be affected
3431 # in order to actually trigger the event; defaults to "any
3434 # @once: disables further events after this one has been
3435 # triggered; defaults to false
3437 # @immediately: fail immediately; defaults to false
3441 { 'struct': 'BlkdebugInjectErrorOptions',
3442 'data': { 'event': 'BlkdebugEvent',
3444 '*iotype': 'BlkdebugIOType',
3448 '*immediately': 'bool' } }
3451 # @BlkdebugSetStateOptions:
3453 # Describes a single state-change event for blkdebug.
3455 # @event: trigger event
3457 # @state: the current state identifier blkdebug needs to be in;
3460 # @new_state: the state identifier blkdebug is supposed to assume if
3461 # this event is triggered
3465 { 'struct': 'BlkdebugSetStateOptions',
3466 'data': { 'event': 'BlkdebugEvent',
3468 'new_state': 'int' } }
3471 # @BlockdevOptionsBlkdebug:
3473 # Driver specific block device options for blkdebug.
3475 # @image: underlying raw block device (or image file)
3477 # @config: filename of the configuration file
3479 # @align: required alignment for requests in bytes, must be
3480 # positive power of 2, or 0 for default
3482 # @max-transfer: maximum size for I/O transfers in bytes, must be
3483 # positive multiple of @align and of the underlying
3484 # file's request alignment (but need not be a power of
3485 # 2), or 0 for default (since 2.10)
3487 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3488 # must be positive multiple of @align and of the
3489 # underlying file's request alignment (but need not be a
3490 # power of 2), or 0 for default (since 2.10)
3492 # @max-write-zero: maximum size for write zero requests in bytes, must be
3493 # positive multiple of @align, of @opt-write-zero, and of
3494 # the underlying file's request alignment (but need not
3495 # be a power of 2), or 0 for default (since 2.10)
3497 # @opt-discard: preferred alignment for discard requests in bytes, must
3498 # be positive multiple of @align and of the underlying
3499 # file's request alignment (but need not be a power of
3500 # 2), or 0 for default (since 2.10)
3502 # @max-discard: maximum size for discard requests in bytes, must be
3503 # positive multiple of @align, of @opt-discard, and of
3504 # the underlying file's request alignment (but need not
3505 # be a power of 2), or 0 for default (since 2.10)
3507 # @inject-error: array of error injection descriptions
3509 # @set-state: array of state-change descriptions
3511 # @take-child-perms: Permissions to take on @image in addition to what
3512 # is necessary anyway (which depends on how the
3513 # blkdebug node is used). Defaults to none.
3516 # @unshare-child-perms: Permissions not to share on @image in addition
3517 # to what cannot be shared anyway (which depends
3518 # on how the blkdebug node is used). Defaults
3519 # to none. (since 5.0)
3523 { 'struct': 'BlockdevOptionsBlkdebug',
3524 'data': { 'image': 'BlockdevRef',
3526 '*align': 'int', '*max-transfer': 'int32',
3527 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3528 '*opt-discard': 'int32', '*max-discard': 'int32',
3529 '*inject-error': ['BlkdebugInjectErrorOptions'],
3530 '*set-state': ['BlkdebugSetStateOptions'],
3531 '*take-child-perms': ['BlockPermission'],
3532 '*unshare-child-perms': ['BlockPermission'] } }
3535 # @BlockdevOptionsBlklogwrites:
3537 # Driver specific block device options for blklogwrites.
3539 # @file: block device
3541 # @log: block device used to log writes to @file
3543 # @log-sector-size: sector size used in logging writes to @file, determines
3544 # granularity of offsets and sizes of writes (default: 512)
3546 # @log-append: append to an existing log (default: false)
3548 # @log-super-update-interval: interval of write requests after which the log
3549 # super block is updated to disk (default: 4096)
3553 { 'struct': 'BlockdevOptionsBlklogwrites',
3554 'data': { 'file': 'BlockdevRef',
3555 'log': 'BlockdevRef',
3556 '*log-sector-size': 'uint32',
3557 '*log-append': 'bool',
3558 '*log-super-update-interval': 'uint64' } }
3561 # @BlockdevOptionsBlkverify:
3563 # Driver specific block device options for blkverify.
3565 # @test: block device to be tested
3567 # @raw: raw image used for verification
3571 { 'struct': 'BlockdevOptionsBlkverify',
3572 'data': { 'test': 'BlockdevRef',
3573 'raw': 'BlockdevRef' } }
3576 # @BlockdevOptionsBlkreplay:
3578 # Driver specific block device options for blkreplay.
3580 # @image: disk image which should be controlled with blkreplay
3584 { 'struct': 'BlockdevOptionsBlkreplay',
3585 'data': { 'image': 'BlockdevRef' } }
3588 # @QuorumReadPattern:
3590 # An enumeration of quorum read patterns.
3592 # @quorum: read all the children and do a quorum vote on reads
3594 # @fifo: read only from the first child that has not failed
3598 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3601 # @BlockdevOptionsQuorum:
3603 # Driver specific block device options for Quorum
3605 # @blkverify: true if the driver must print content mismatch
3606 # set to false by default
3608 # @children: the children block devices to use
3610 # @vote-threshold: the vote limit under which a read will fail
3612 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3615 # @read-pattern: choose read pattern and set to quorum by default
3620 { 'struct': 'BlockdevOptionsQuorum',
3621 'data': { '*blkverify': 'bool',
3622 'children': [ 'BlockdevRef' ],
3623 'vote-threshold': 'int',
3624 '*rewrite-corrupted': 'bool',
3625 '*read-pattern': 'QuorumReadPattern' } }
3628 # @BlockdevOptionsGluster:
3630 # Driver specific block device options for Gluster
3632 # @volume: name of gluster volume where VM image resides
3634 # @path: absolute path to image file in gluster volume
3636 # @server: gluster servers description
3638 # @debug: libgfapi log level (default '4' which is Error)
3641 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3645 { 'struct': 'BlockdevOptionsGluster',
3646 'data': { 'volume': 'str',
3648 'server': ['SocketAddress'],
3650 '*logfile': 'str' } }
3655 # An enumeration of libiscsi transport types
3659 { 'enum': 'IscsiTransport',
3660 'data': [ 'tcp', 'iser' ] }
3663 # @IscsiHeaderDigest:
3665 # An enumeration of header digests supported by libiscsi
3669 { 'enum': 'IscsiHeaderDigest',
3670 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3671 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3674 # @BlockdevOptionsIscsi:
3676 # @transport: The iscsi transport type
3678 # @portal: The address of the iscsi portal
3680 # @target: The target iqn name
3682 # @lun: LUN to connect to. Defaults to 0.
3684 # @user: User name to log in with. If omitted, no CHAP
3685 # authentication is performed.
3687 # @password-secret: The ID of a QCryptoSecret object providing
3688 # the password for the login. This option is required if
3689 # @user is specified.
3691 # @initiator-name: The iqn name we want to identify to the target
3692 # as. If this option is not specified, an initiator name is
3693 # generated automatically.
3695 # @header-digest: The desired header digest. Defaults to
3698 # @timeout: Timeout in seconds after which a request will
3699 # timeout. 0 means no timeout and is the default.
3701 # Driver specific block device options for iscsi
3705 { 'struct': 'BlockdevOptionsIscsi',
3706 'data': { 'transport': 'IscsiTransport',
3711 '*password-secret': 'str',
3712 '*initiator-name': 'str',
3713 '*header-digest': 'IscsiHeaderDigest',
3714 '*timeout': 'int' } }
3721 { 'enum': 'RbdAuthMode',
3722 'data': [ 'cephx', 'none' ] }
3725 # @RbdImageEncryptionFormat:
3729 { 'enum': 'RbdImageEncryptionFormat',
3730 'data': [ 'luks', 'luks2' ] }
3733 # @RbdEncryptionOptionsLUKSBase:
3735 # @key-secret: ID of a QCryptoSecret object providing a passphrase
3736 # for unlocking the encryption
3740 { 'struct': 'RbdEncryptionOptionsLUKSBase',
3741 'data': { 'key-secret': 'str' } }
3744 # @RbdEncryptionCreateOptionsLUKSBase:
3746 # @cipher-alg: The encryption algorithm
3750 { 'struct': 'RbdEncryptionCreateOptionsLUKSBase',
3751 'base': 'RbdEncryptionOptionsLUKSBase',
3752 'data': { '*cipher-alg': 'QCryptoCipherAlgorithm' } }
3755 # @RbdEncryptionOptionsLUKS:
3759 { 'struct': 'RbdEncryptionOptionsLUKS',
3760 'base': 'RbdEncryptionOptionsLUKSBase',
3764 # @RbdEncryptionOptionsLUKS2:
3768 { 'struct': 'RbdEncryptionOptionsLUKS2',
3769 'base': 'RbdEncryptionOptionsLUKSBase',
3773 # @RbdEncryptionCreateOptionsLUKS:
3777 { 'struct': 'RbdEncryptionCreateOptionsLUKS',
3778 'base': 'RbdEncryptionCreateOptionsLUKSBase',
3782 # @RbdEncryptionCreateOptionsLUKS2:
3786 { 'struct': 'RbdEncryptionCreateOptionsLUKS2',
3787 'base': 'RbdEncryptionCreateOptionsLUKSBase',
3791 # @RbdEncryptionOptions:
3795 { 'union': 'RbdEncryptionOptions',
3796 'base': { 'format': 'RbdImageEncryptionFormat' },
3797 'discriminator': 'format',
3798 'data': { 'luks': 'RbdEncryptionOptionsLUKS',
3799 'luks2': 'RbdEncryptionOptionsLUKS2' } }
3802 # @RbdEncryptionCreateOptions:
3806 { 'union': 'RbdEncryptionCreateOptions',
3807 'base': { 'format': 'RbdImageEncryptionFormat' },
3808 'discriminator': 'format',
3809 'data': { 'luks': 'RbdEncryptionCreateOptionsLUKS',
3810 'luks2': 'RbdEncryptionCreateOptionsLUKS2' } }
3813 # @BlockdevOptionsRbd:
3815 # @pool: Ceph pool name.
3817 # @namespace: Rados namespace name in the Ceph pool. (Since 5.0)
3819 # @image: Image name in the Ceph pool.
3821 # @conf: path to Ceph configuration file. Values
3822 # in the configuration file will be overridden by
3823 # options specified via QAPI.
3825 # @snapshot: Ceph snapshot name.
3827 # @encrypt: Image encryption options. (Since 6.1)
3829 # @user: Ceph id name.
3831 # @auth-client-required: Acceptable authentication modes.
3832 # This maps to Ceph configuration option
3833 # "auth_client_required". (Since 3.0)
3835 # @key-secret: ID of a QCryptoSecret object providing a key
3836 # for cephx authentication.
3837 # This maps to Ceph configuration option
3838 # "key". (Since 3.0)
3840 # @server: Monitor host address and port. This maps
3841 # to the "mon_host" Ceph option.
3845 { 'struct': 'BlockdevOptionsRbd',
3846 'data': { 'pool': 'str',
3847 '*namespace': 'str',
3851 '*encrypt': 'RbdEncryptionOptions',
3853 '*auth-client-required': ['RbdAuthMode'],
3854 '*key-secret': 'str',
3855 '*server': ['InetSocketAddressBase'] } }
3860 # An enumeration of replication modes.
3862 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3864 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3868 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3869 'if': 'CONFIG_REPLICATION' }
3872 # @BlockdevOptionsReplication:
3874 # Driver specific block device options for replication
3876 # @mode: the replication mode
3878 # @top-id: In secondary mode, node name or device ID of the root
3879 # node who owns the replication node chain. Must not be given in
3884 { 'struct': 'BlockdevOptionsReplication',
3885 'base': 'BlockdevOptionsGenericFormat',
3886 'data': { 'mode': 'ReplicationMode',
3888 'if': 'CONFIG_REPLICATION' }
3893 # An enumeration of NFS transport types
3895 # @inet: TCP transport
3899 { 'enum': 'NFSTransport',
3900 'data': [ 'inet' ] }
3905 # Captures the address of the socket
3907 # @type: transport type used for NFS (only TCP supported)
3909 # @host: host address for NFS server
3913 { 'struct': 'NFSServer',
3914 'data': { 'type': 'NFSTransport',
3918 # @BlockdevOptionsNfs:
3920 # Driver specific block device option for NFS
3922 # @server: host address
3924 # @path: path of the image on the host
3926 # @user: UID value to use when talking to the
3927 # server (defaults to 65534 on Windows and getuid()
3930 # @group: GID value to use when talking to the
3931 # server (defaults to 65534 on Windows and getgid()
3934 # @tcp-syn-count: number of SYNs during the session
3935 # establishment (defaults to libnfs default)
3937 # @readahead-size: set the readahead size in bytes (defaults
3938 # to libnfs default)
3940 # @page-cache-size: set the pagecache size in bytes (defaults
3941 # to libnfs default)
3943 # @debug: set the NFS debug level (max 2) (defaults
3944 # to libnfs default)
3948 { 'struct': 'BlockdevOptionsNfs',
3949 'data': { 'server': 'NFSServer',
3953 '*tcp-syn-count': 'int',
3954 '*readahead-size': 'int',
3955 '*page-cache-size': 'int',
3959 # @BlockdevOptionsCurlBase:
3961 # Driver specific block device options shared by all protocols supported by the
3964 # @url: URL of the image file
3966 # @readahead: Size of the read-ahead cache; must be a multiple of
3967 # 512 (defaults to 256 kB)
3969 # @timeout: Timeout for connections, in seconds (defaults to 5)
3971 # @username: Username for authentication (defaults to none)
3973 # @password-secret: ID of a QCryptoSecret object providing a password
3974 # for authentication (defaults to no password)
3976 # @proxy-username: Username for proxy authentication (defaults to none)
3978 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3979 # for proxy authentication (defaults to no password)
3983 { 'struct': 'BlockdevOptionsCurlBase',
3984 'data': { 'url': 'str',
3985 '*readahead': 'int',
3988 '*password-secret': 'str',
3989 '*proxy-username': 'str',
3990 '*proxy-password-secret': 'str' } }
3993 # @BlockdevOptionsCurlHttp:
3995 # Driver specific block device options for HTTP connections over the curl
3996 # backend. URLs must start with "http://".
3998 # @cookie: List of cookies to set; format is
3999 # "name1=content1; name2=content2;" as explained by
4000 # CURLOPT_COOKIE(3). Defaults to no cookies.
4002 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
4003 # secure way. See @cookie for the format. (since 2.10)
4007 { 'struct': 'BlockdevOptionsCurlHttp',
4008 'base': 'BlockdevOptionsCurlBase',
4009 'data': { '*cookie': 'str',
4010 '*cookie-secret': 'str'} }
4013 # @BlockdevOptionsCurlHttps:
4015 # Driver specific block device options for HTTPS connections over the curl
4016 # backend. URLs must start with "https://".
4018 # @cookie: List of cookies to set; format is
4019 # "name1=content1; name2=content2;" as explained by
4020 # CURLOPT_COOKIE(3). Defaults to no cookies.
4022 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
4025 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
4026 # secure way. See @cookie for the format. (since 2.10)
4030 { 'struct': 'BlockdevOptionsCurlHttps',
4031 'base': 'BlockdevOptionsCurlBase',
4032 'data': { '*cookie': 'str',
4033 '*sslverify': 'bool',
4034 '*cookie-secret': 'str'} }
4037 # @BlockdevOptionsCurlFtp:
4039 # Driver specific block device options for FTP connections over the curl
4040 # backend. URLs must start with "ftp://".
4044 { 'struct': 'BlockdevOptionsCurlFtp',
4045 'base': 'BlockdevOptionsCurlBase',
4049 # @BlockdevOptionsCurlFtps:
4051 # Driver specific block device options for FTPS connections over the curl
4052 # backend. URLs must start with "ftps://".
4054 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
4059 { 'struct': 'BlockdevOptionsCurlFtps',
4060 'base': 'BlockdevOptionsCurlBase',
4061 'data': { '*sslverify': 'bool' } }
4064 # @BlockdevOptionsNbd:
4066 # Driver specific block device options for NBD.
4068 # @server: NBD server address
4070 # @export: export name
4072 # @tls-creds: TLS credentials ID
4074 # @tls-hostname: TLS hostname override for certificate validation (Since 7.0)
4076 # @x-dirty-bitmap: A metadata context name such as "qemu:dirty-bitmap:NAME"
4077 # or "qemu:allocation-depth" to query in place of the
4078 # traditional "base:allocation" block status (see
4079 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol; and
4080 # yes, naming this option x-context would have made
4081 # more sense) (since 3.0)
4083 # @reconnect-delay: On an unexpected disconnect, the nbd client tries to
4084 # connect again until succeeding or encountering a serious
4085 # error. During the first @reconnect-delay seconds, all
4086 # requests are paused and will be rerun on a successful
4087 # reconnect. After that time, any delayed requests and all
4088 # future requests before a successful reconnect will
4089 # immediately fail. Default 0 (Since 4.2)
4091 # @open-timeout: In seconds. If zero, the nbd driver tries the connection
4092 # only once, and fails to open if the connection fails.
4093 # If non-zero, the nbd driver will repeat connection attempts
4094 # until successful or until @open-timeout seconds have elapsed.
4095 # Default 0 (Since 7.0)
4098 # @unstable: Member @x-dirty-bitmap is experimental.
4102 { 'struct': 'BlockdevOptionsNbd',
4103 'data': { 'server': 'SocketAddress',
4105 '*tls-creds': 'str',
4106 '*tls-hostname': 'str',
4107 '*x-dirty-bitmap': { 'type': 'str', 'features': [ 'unstable' ] },
4108 '*reconnect-delay': 'uint32',
4109 '*open-timeout': 'uint32' } }
4112 # @BlockdevOptionsRaw:
4114 # Driver specific block device options for the raw driver.
4116 # @offset: position where the block device starts
4117 # @size: the assumed size of the device
4121 { 'struct': 'BlockdevOptionsRaw',
4122 'base': 'BlockdevOptionsGenericFormat',
4123 'data': { '*offset': 'int', '*size': 'int' } }
4126 # @BlockdevOptionsThrottle:
4128 # Driver specific block device options for the throttle driver
4130 # @throttle-group: the name of the throttle-group object to use. It
4131 # must already exist.
4132 # @file: reference to or definition of the data source block device
4136 { 'struct': 'BlockdevOptionsThrottle',
4137 'data': { 'throttle-group': 'str',
4138 'file' : 'BlockdevRef'
4142 # @BlockdevOptionsCor:
4144 # Driver specific block device options for the copy-on-read driver.
4146 # @bottom: The name of a non-filter node (allocation-bearing layer) that
4147 # limits the COR operations in the backing chain (inclusive), so
4148 # that no data below this node will be copied by this filter.
4149 # If option is absent, the limit is not applied, so that data
4150 # from all backing layers may be copied.
4154 { 'struct': 'BlockdevOptionsCor',
4155 'base': 'BlockdevOptionsGenericFormat',
4156 'data': { '*bottom': 'str' } }
4159 # @BlockdevOptionsCbw:
4161 # Driver specific block device options for the copy-before-write driver,
4162 # which does so called copy-before-write operations: when data is
4163 # written to the filter, the filter first reads corresponding blocks
4164 # from its file child and copies them to @target child. After successfully
4165 # copying, the write request is propagated to file child. If copying
4166 # fails, the original write request is failed too and no data is written
4169 # @target: The target for copy-before-write operations.
4171 # @bitmap: If specified, copy-before-write filter will do
4172 # copy-before-write operations only for dirty regions of the
4173 # bitmap. Bitmap size must be equal to length of file and
4174 # target child of the filter. Note also, that bitmap is used
4175 # only to initialize internal bitmap of the process, so further
4176 # modifications (or removing) of specified bitmap doesn't
4177 # influence the filter. (Since 7.0)
4181 { 'struct': 'BlockdevOptionsCbw',
4182 'base': 'BlockdevOptionsGenericFormat',
4183 'data': { 'target': 'BlockdevRef', '*bitmap': 'BlockDirtyBitmap' } }
4188 # Options for creating a block device. Many options are available for all
4189 # block devices, independent of the block driver:
4191 # @driver: block driver name
4192 # @node-name: the node name of the new node (Since 2.0).
4193 # This option is required on the top level of blockdev-add.
4194 # Valid node names start with an alphabetic character and may
4195 # contain only alphanumeric characters, '-', '.' and '_'. Their
4196 # maximum length is 31 characters.
4197 # @discard: discard-related options (default: ignore)
4198 # @cache: cache-related options
4199 # @read-only: whether the block device should be read-only (default: false).
4200 # Note that some block drivers support only read-only access,
4201 # either generally or in certain configurations. In this case,
4202 # the default value does not work and the option must be
4203 # specified explicitly.
4204 # @auto-read-only: if true and @read-only is false, QEMU may automatically
4205 # decide not to open the image read-write as requested, but
4206 # fall back to read-only instead (and switch between the modes
4207 # later), e.g. depending on whether the image file is writable
4208 # or whether a writing user is attached to the node
4209 # (default: false, since 3.1)
4210 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
4212 # @force-share: force share all permission on added nodes.
4213 # Requires read-only=true. (Since 2.10)
4215 # Remaining options are determined by the block driver.
4219 { 'union': 'BlockdevOptions',
4220 'base': { 'driver': 'BlockdevDriver',
4221 '*node-name': 'str',
4222 '*discard': 'BlockdevDiscardOptions',
4223 '*cache': 'BlockdevCacheOptions',
4224 '*read-only': 'bool',
4225 '*auto-read-only': 'bool',
4226 '*force-share': 'bool',
4227 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
4228 'discriminator': 'driver',
4230 'blkdebug': 'BlockdevOptionsBlkdebug',
4231 'blklogwrites':'BlockdevOptionsBlklogwrites',
4232 'blkverify': 'BlockdevOptionsBlkverify',
4233 'blkreplay': 'BlockdevOptionsBlkreplay',
4234 'bochs': 'BlockdevOptionsGenericFormat',
4235 'cloop': 'BlockdevOptionsGenericFormat',
4236 'compress': 'BlockdevOptionsGenericFormat',
4237 'copy-before-write':'BlockdevOptionsCbw',
4238 'copy-on-read':'BlockdevOptionsCor',
4239 'dmg': 'BlockdevOptionsGenericFormat',
4240 'file': 'BlockdevOptionsFile',
4241 'ftp': 'BlockdevOptionsCurlFtp',
4242 'ftps': 'BlockdevOptionsCurlFtps',
4243 'gluster': 'BlockdevOptionsGluster',
4244 'host_cdrom': { 'type': 'BlockdevOptionsFile',
4245 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4246 'host_device': { 'type': 'BlockdevOptionsFile',
4247 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4248 'http': 'BlockdevOptionsCurlHttp',
4249 'https': 'BlockdevOptionsCurlHttps',
4250 'iscsi': 'BlockdevOptionsIscsi',
4251 'luks': 'BlockdevOptionsLUKS',
4252 'nbd': 'BlockdevOptionsNbd',
4253 'nfs': 'BlockdevOptionsNfs',
4254 'null-aio': 'BlockdevOptionsNull',
4255 'null-co': 'BlockdevOptionsNull',
4256 'nvme': 'BlockdevOptionsNVMe',
4257 'parallels': 'BlockdevOptionsGenericFormat',
4258 'preallocate':'BlockdevOptionsPreallocate',
4259 'qcow2': 'BlockdevOptionsQcow2',
4260 'qcow': 'BlockdevOptionsQcow',
4261 'qed': 'BlockdevOptionsGenericCOWFormat',
4262 'quorum': 'BlockdevOptionsQuorum',
4263 'raw': 'BlockdevOptionsRaw',
4264 'rbd': 'BlockdevOptionsRbd',
4265 'replication': { 'type': 'BlockdevOptionsReplication',
4266 'if': 'CONFIG_REPLICATION' },
4267 'snapshot-access': 'BlockdevOptionsGenericFormat',
4268 'ssh': 'BlockdevOptionsSsh',
4269 'throttle': 'BlockdevOptionsThrottle',
4270 'vdi': 'BlockdevOptionsGenericFormat',
4271 'vhdx': 'BlockdevOptionsGenericFormat',
4272 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4273 'vpc': 'BlockdevOptionsGenericFormat',
4274 'vvfat': 'BlockdevOptionsVVFAT'
4280 # Reference to a block device.
4282 # @definition: defines a new block device inline
4283 # @reference: references the ID of an existing block device
4287 { 'alternate': 'BlockdevRef',
4288 'data': { 'definition': 'BlockdevOptions',
4289 'reference': 'str' } }
4292 # @BlockdevRefOrNull:
4294 # Reference to a block device.
4296 # @definition: defines a new block device inline
4297 # @reference: references the ID of an existing block device.
4298 # An empty string means that no block device should
4299 # be referenced. Deprecated; use null instead.
4300 # @null: No block device should be referenced (since 2.10)
4304 { 'alternate': 'BlockdevRefOrNull',
4305 'data': { 'definition': 'BlockdevOptions',
4312 # Creates a new block device.
4319 # -> { "execute": "blockdev-add",
4321 # "driver": "qcow2",
4322 # "node-name": "test1",
4325 # "filename": "test.qcow2"
4329 # <- { "return": {} }
4332 # -> { "execute": "blockdev-add",
4334 # "driver": "qcow2",
4335 # "node-name": "node0",
4336 # "discard": "unmap",
4342 # "filename": "/tmp/test.qcow2"
4348 # "filename": "/dev/fdset/4"
4354 # <- { "return": {} }
4357 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
4362 # Reopens one or more block devices using the given set of options.
4363 # Any option not specified will be reset to its default value regardless
4364 # of its previous status. If an option cannot be changed or a particular
4365 # driver does not support reopening then the command will return an
4366 # error. All devices in the list are reopened in one transaction, so
4367 # if one of them fails then the whole transaction is cancelled.
4369 # The command receives a list of block devices to reopen. For each one
4370 # of them, the top-level @node-name option (from BlockdevOptions) must be
4371 # specified and is used to select the block device to be reopened.
4372 # Other @node-name options must be either omitted or set to the
4373 # current name of the appropriate node. This command won't change any
4374 # node name and any attempt to do it will result in an error.
4376 # In the case of options that refer to child nodes, the behavior of
4377 # this command depends on the value:
4379 # 1) A set of options (BlockdevOptions): the child is reopened with
4380 # the specified set of options.
4382 # 2) A reference to the current child: the child is reopened using
4383 # its existing set of options.
4385 # 3) A reference to a different node: the current child is replaced
4386 # with the specified one.
4388 # 4) NULL: the current child (if any) is detached.
4390 # Options (1) and (2) are supported in all cases. Option (3) is
4391 # supported for @file and @backing, and option (4) for @backing only.
4393 # Unlike with blockdev-add, the @backing option must always be present
4394 # unless the node being reopened does not have a backing file and its
4395 # image does not have a default backing file name as part of its
4400 { 'command': 'blockdev-reopen',
4401 'data': { 'options': ['BlockdevOptions'] } }
4406 # Deletes a block device that has been added using blockdev-add.
4407 # The command will fail if the node is attached to a device or is
4408 # otherwise being used.
4410 # @node-name: Name of the graph node to delete.
4416 # -> { "execute": "blockdev-add",
4418 # "driver": "qcow2",
4419 # "node-name": "node0",
4422 # "filename": "test.qcow2"
4426 # <- { "return": {} }
4428 # -> { "execute": "blockdev-del",
4429 # "arguments": { "node-name": "node0" }
4431 # <- { "return": {} }
4434 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
4437 # @BlockdevCreateOptionsFile:
4439 # Driver specific image creation options for file.
4441 # @filename: Filename for the new image file
4442 # @size: Size of the virtual disk in bytes
4443 # @preallocation: Preallocation mode for the new image (default: off;
4444 # allowed values: off,
4445 # falloc (if CONFIG_POSIX_FALLOCATE),
4446 # full (if CONFIG_POSIX))
4447 # @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
4448 # @extent-size-hint: Extent size hint to add to the image file; 0 for not
4449 # adding an extent size hint (default: 1 MB, since 5.1)
4453 { 'struct': 'BlockdevCreateOptionsFile',
4454 'data': { 'filename': 'str',
4456 '*preallocation': 'PreallocMode',
4458 '*extent-size-hint': 'size'} }
4461 # @BlockdevCreateOptionsGluster:
4463 # Driver specific image creation options for gluster.
4465 # @location: Where to store the new image file
4466 # @size: Size of the virtual disk in bytes
4467 # @preallocation: Preallocation mode for the new image (default: off;
4468 # allowed values: off,
4469 # falloc (if CONFIG_GLUSTERFS_FALLOCATE),
4470 # full (if CONFIG_GLUSTERFS_ZEROFILL))
4474 { 'struct': 'BlockdevCreateOptionsGluster',
4475 'data': { 'location': 'BlockdevOptionsGluster',
4477 '*preallocation': 'PreallocMode' } }
4480 # @BlockdevCreateOptionsLUKS:
4482 # Driver specific image creation options for LUKS.
4484 # @file: Node to create the image format on
4485 # @size: Size of the virtual disk in bytes
4486 # @preallocation: Preallocation mode for the new image
4488 # (default: off; allowed values: off, metadata, falloc, full)
4492 { 'struct': 'BlockdevCreateOptionsLUKS',
4493 'base': 'QCryptoBlockCreateOptionsLUKS',
4494 'data': { 'file': 'BlockdevRef',
4496 '*preallocation': 'PreallocMode' } }
4499 # @BlockdevCreateOptionsNfs:
4501 # Driver specific image creation options for NFS.
4503 # @location: Where to store the new image file
4504 # @size: Size of the virtual disk in bytes
4508 { 'struct': 'BlockdevCreateOptionsNfs',
4509 'data': { 'location': 'BlockdevOptionsNfs',
4513 # @BlockdevCreateOptionsParallels:
4515 # Driver specific image creation options for parallels.
4517 # @file: Node to create the image format on
4518 # @size: Size of the virtual disk in bytes
4519 # @cluster-size: Cluster size in bytes (default: 1 MB)
4523 { 'struct': 'BlockdevCreateOptionsParallels',
4524 'data': { 'file': 'BlockdevRef',
4526 '*cluster-size': 'size' } }
4529 # @BlockdevCreateOptionsQcow:
4531 # Driver specific image creation options for qcow.
4533 # @file: Node to create the image format on
4534 # @size: Size of the virtual disk in bytes
4535 # @backing-file: File name of the backing file if a backing file
4537 # @encrypt: Encryption options if the image should be encrypted
4541 { 'struct': 'BlockdevCreateOptionsQcow',
4542 'data': { 'file': 'BlockdevRef',
4544 '*backing-file': 'str',
4545 '*encrypt': 'QCryptoBlockCreateOptions' } }
4548 # @BlockdevQcow2Version:
4550 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4551 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4555 { 'enum': 'BlockdevQcow2Version',
4556 'data': [ 'v2', 'v3' ] }
4559 # @Qcow2CompressionType:
4561 # Compression type used in qcow2 image file
4563 # @zlib: zlib compression, see <http://zlib.net/>
4564 # @zstd: zstd compression, see <http://github.com/facebook/zstd>
4568 { 'enum': 'Qcow2CompressionType',
4569 'data': [ 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
4572 # @BlockdevCreateOptionsQcow2:
4574 # Driver specific image creation options for qcow2.
4576 # @file: Node to create the image format on
4577 # @data-file: Node to use as an external data file in which all guest
4578 # data is stored so that only metadata remains in the qcow2
4580 # @data-file-raw: True if the external data file must stay valid as a
4581 # standalone (read-only) raw image without looking at qcow2
4582 # metadata (default: false; since: 4.0)
4583 # @extended-l2: True to make the image have extended L2 entries
4584 # (default: false; since 5.2)
4585 # @size: Size of the virtual disk in bytes
4586 # @version: Compatibility level (default: v3)
4587 # @backing-file: File name of the backing file if a backing file
4589 # @backing-fmt: Name of the block driver to use for the backing file
4590 # @encrypt: Encryption options if the image should be encrypted
4591 # @cluster-size: qcow2 cluster size in bytes (default: 65536)
4592 # @preallocation: Preallocation mode for the new image (default: off;
4593 # allowed values: off, falloc, full, metadata)
4594 # @lazy-refcounts: True if refcounts may be updated lazily (default: off)
4595 # @refcount-bits: Width of reference counts in bits (default: 16)
4596 # @compression-type: The image cluster compression method
4597 # (default: zlib, since 5.1)
4601 { 'struct': 'BlockdevCreateOptionsQcow2',
4602 'data': { 'file': 'BlockdevRef',
4603 '*data-file': 'BlockdevRef',
4604 '*data-file-raw': 'bool',
4605 '*extended-l2': 'bool',
4607 '*version': 'BlockdevQcow2Version',
4608 '*backing-file': 'str',
4609 '*backing-fmt': 'BlockdevDriver',
4610 '*encrypt': 'QCryptoBlockCreateOptions',
4611 '*cluster-size': 'size',
4612 '*preallocation': 'PreallocMode',
4613 '*lazy-refcounts': 'bool',
4614 '*refcount-bits': 'int',
4615 '*compression-type':'Qcow2CompressionType' } }
4618 # @BlockdevCreateOptionsQed:
4620 # Driver specific image creation options for qed.
4622 # @file: Node to create the image format on
4623 # @size: Size of the virtual disk in bytes
4624 # @backing-file: File name of the backing file if a backing file
4626 # @backing-fmt: Name of the block driver to use for the backing file
4627 # @cluster-size: Cluster size in bytes (default: 65536)
4628 # @table-size: L1/L2 table size (in clusters)
4632 { 'struct': 'BlockdevCreateOptionsQed',
4633 'data': { 'file': 'BlockdevRef',
4635 '*backing-file': 'str',
4636 '*backing-fmt': 'BlockdevDriver',
4637 '*cluster-size': 'size',
4638 '*table-size': 'int' } }
4641 # @BlockdevCreateOptionsRbd:
4643 # Driver specific image creation options for rbd/Ceph.
4645 # @location: Where to store the new image file. This location cannot
4646 # point to a snapshot.
4647 # @size: Size of the virtual disk in bytes
4648 # @cluster-size: RBD object size
4649 # @encrypt: Image encryption options. (Since 6.1)
4653 { 'struct': 'BlockdevCreateOptionsRbd',
4654 'data': { 'location': 'BlockdevOptionsRbd',
4656 '*cluster-size' : 'size',
4657 '*encrypt' : 'RbdEncryptionCreateOptions' } }
4660 # @BlockdevVmdkSubformat:
4662 # Subformat options for VMDK images
4664 # @monolithicSparse: Single file image with sparse cluster allocation
4666 # @monolithicFlat: Single flat data image and a descriptor file
4668 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4669 # files, in addition to a descriptor file
4671 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4672 # files, in addition to a descriptor file
4674 # @streamOptimized: Single file image sparse cluster allocation, optimized
4675 # for streaming over network.
4679 { 'enum': 'BlockdevVmdkSubformat',
4680 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4681 'twoGbMaxExtentFlat', 'streamOptimized'] }
4684 # @BlockdevVmdkAdapterType:
4686 # Adapter type info for VMDK images
4690 { 'enum': 'BlockdevVmdkAdapterType',
4691 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4694 # @BlockdevCreateOptionsVmdk:
4696 # Driver specific image creation options for VMDK.
4698 # @file: Where to store the new image file. This refers to the image
4699 # file for monolithcSparse and streamOptimized format, or the
4700 # descriptor file for other formats.
4701 # @size: Size of the virtual disk in bytes
4702 # @extents: Where to store the data extents. Required for monolithcFlat,
4703 # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4704 # monolithicFlat, only one entry is required; for
4705 # twoGbMaxExtent* formats, the number of entries required is
4706 # calculated as extent_number = virtual_size / 2GB. Providing
4707 # more extents than will be used is an error.
4708 # @subformat: The subformat of the VMDK image. Default: "monolithicSparse".
4709 # @backing-file: The path of backing file. Default: no backing file is used.
4710 # @adapter-type: The adapter type used to fill in the descriptor. Default: ide.
4711 # @hwversion: Hardware version. The meaningful options are "4" or "6".
4713 # @toolsversion: VMware guest tools version.
4714 # Default: "2147483647" (Since 6.2)
4715 # @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats.
4720 { 'struct': 'BlockdevCreateOptionsVmdk',
4721 'data': { 'file': 'BlockdevRef',
4723 '*extents': ['BlockdevRef'],
4724 '*subformat': 'BlockdevVmdkSubformat',
4725 '*backing-file': 'str',
4726 '*adapter-type': 'BlockdevVmdkAdapterType',
4727 '*hwversion': 'str',
4728 '*toolsversion': 'str',
4729 '*zeroed-grain': 'bool' } }
4732 # @BlockdevCreateOptionsSsh:
4734 # Driver specific image creation options for SSH.
4736 # @location: Where to store the new image file
4737 # @size: Size of the virtual disk in bytes
4741 { 'struct': 'BlockdevCreateOptionsSsh',
4742 'data': { 'location': 'BlockdevOptionsSsh',
4746 # @BlockdevCreateOptionsVdi:
4748 # Driver specific image creation options for VDI.
4750 # @file: Node to create the image format on
4751 # @size: Size of the virtual disk in bytes
4752 # @preallocation: Preallocation mode for the new image (default: off;
4753 # allowed values: off, metadata)
4757 { 'struct': 'BlockdevCreateOptionsVdi',
4758 'data': { 'file': 'BlockdevRef',
4760 '*preallocation': 'PreallocMode' } }
4763 # @BlockdevVhdxSubformat:
4765 # @dynamic: Growing image file
4766 # @fixed: Preallocated fixed-size image file
4770 { 'enum': 'BlockdevVhdxSubformat',
4771 'data': [ 'dynamic', 'fixed' ] }
4774 # @BlockdevCreateOptionsVhdx:
4776 # Driver specific image creation options for vhdx.
4778 # @file: Node to create the image format on
4779 # @size: Size of the virtual disk in bytes
4780 # @log-size: Log size in bytes, must be a multiple of 1 MB
4782 # @block-size: Block size in bytes, must be a multiple of 1 MB and not
4783 # larger than 256 MB (default: automatically choose a block
4784 # size depending on the image size)
4785 # @subformat: vhdx subformat (default: dynamic)
4786 # @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard,
4787 # but default. Do not set to 'off' when using 'qemu-img
4788 # convert' with subformat=dynamic.
4792 { 'struct': 'BlockdevCreateOptionsVhdx',
4793 'data': { 'file': 'BlockdevRef',
4795 '*log-size': 'size',
4796 '*block-size': 'size',
4797 '*subformat': 'BlockdevVhdxSubformat',
4798 '*block-state-zero': 'bool' } }
4801 # @BlockdevVpcSubformat:
4803 # @dynamic: Growing image file
4804 # @fixed: Preallocated fixed-size image file
4808 { 'enum': 'BlockdevVpcSubformat',
4809 'data': [ 'dynamic', 'fixed' ] }
4812 # @BlockdevCreateOptionsVpc:
4814 # Driver specific image creation options for vpc (VHD).
4816 # @file: Node to create the image format on
4817 # @size: Size of the virtual disk in bytes
4818 # @subformat: vhdx subformat (default: dynamic)
4819 # @force-size: Force use of the exact byte size instead of rounding to the
4820 # next size that can be represented in CHS geometry
4825 { 'struct': 'BlockdevCreateOptionsVpc',
4826 'data': { 'file': 'BlockdevRef',
4828 '*subformat': 'BlockdevVpcSubformat',
4829 '*force-size': 'bool' } }
4832 # @BlockdevCreateOptions:
4834 # Options for creating an image format on a given node.
4836 # @driver: block driver to create the image format
4840 { 'union': 'BlockdevCreateOptions',
4842 'driver': 'BlockdevDriver' },
4843 'discriminator': 'driver',
4845 'file': 'BlockdevCreateOptionsFile',
4846 'gluster': 'BlockdevCreateOptionsGluster',
4847 'luks': 'BlockdevCreateOptionsLUKS',
4848 'nfs': 'BlockdevCreateOptionsNfs',
4849 'parallels': 'BlockdevCreateOptionsParallels',
4850 'qcow': 'BlockdevCreateOptionsQcow',
4851 'qcow2': 'BlockdevCreateOptionsQcow2',
4852 'qed': 'BlockdevCreateOptionsQed',
4853 'rbd': 'BlockdevCreateOptionsRbd',
4854 'ssh': 'BlockdevCreateOptionsSsh',
4855 'vdi': 'BlockdevCreateOptionsVdi',
4856 'vhdx': 'BlockdevCreateOptionsVhdx',
4857 'vmdk': 'BlockdevCreateOptionsVmdk',
4858 'vpc': 'BlockdevCreateOptionsVpc'
4864 # Starts a job to create an image format on a given node. The job is
4865 # automatically finalized, but a manual job-dismiss is required.
4867 # @job-id: Identifier for the newly created job.
4869 # @options: Options for the image creation.
4873 { 'command': 'blockdev-create',
4874 'data': { 'job-id': 'str',
4875 'options': 'BlockdevCreateOptions' } }
4878 # @BlockdevAmendOptionsLUKS:
4880 # Driver specific image amend options for LUKS.
4884 { 'struct': 'BlockdevAmendOptionsLUKS',
4885 'base': 'QCryptoBlockAmendOptionsLUKS',
4890 # @BlockdevAmendOptionsQcow2:
4892 # Driver specific image amend options for qcow2.
4893 # For now, only encryption options can be amended
4895 # @encrypt Encryption options to be amended
4899 { 'struct': 'BlockdevAmendOptionsQcow2',
4900 'data': { '*encrypt': 'QCryptoBlockAmendOptions' } }
4903 # @BlockdevAmendOptions:
4905 # Options for amending an image format
4907 # @driver: Block driver of the node to amend.
4911 { 'union': 'BlockdevAmendOptions',
4913 'driver': 'BlockdevDriver' },
4914 'discriminator': 'driver',
4916 'luks': 'BlockdevAmendOptionsLUKS',
4917 'qcow2': 'BlockdevAmendOptionsQcow2' } }
4920 # @x-blockdev-amend:
4922 # Starts a job to amend format specific options of an existing open block device
4923 # The job is automatically finalized, but a manual job-dismiss is required.
4925 # @job-id: Identifier for the newly created job.
4927 # @node-name: Name of the block node to work on
4929 # @options: Options (driver specific)
4931 # @force: Allow unsafe operations, format specific
4932 # For luks that allows erase of the last active keyslot
4933 # (permanent loss of data),
4934 # and replacement of an active keyslot
4935 # (possible loss of data if IO error happens)
4938 # @unstable: This command is experimental.
4942 { 'command': 'x-blockdev-amend',
4943 'data': { 'job-id': 'str',
4945 'options': 'BlockdevAmendOptions',
4947 'features': [ 'unstable' ] }
4950 # @BlockErrorAction:
4952 # An enumeration of action that has been taken when a DISK I/O occurs
4954 # @ignore: error has been ignored
4956 # @report: error has been reported to the device
4958 # @stop: error caused VM to be stopped
4962 { 'enum': 'BlockErrorAction',
4963 'data': [ 'ignore', 'report', 'stop' ] }
4966 # @BLOCK_IMAGE_CORRUPTED:
4968 # Emitted when a disk image is being marked corrupt. The image can be
4969 # identified by its device or node name. The 'device' field is always
4970 # present for compatibility reasons, but it can be empty ("") if the
4971 # image does not have a device name associated.
4973 # @device: device name. This is always present for compatibility
4974 # reasons, but it can be empty ("") if the image does not
4975 # have a device name associated.
4977 # @node-name: node name (Since: 2.4)
4979 # @msg: informative message for human consumption, such as the kind of
4980 # corruption being detected. It should not be parsed by machine as it is
4981 # not guaranteed to be stable
4983 # @offset: if the corruption resulted from an image access, this is
4984 # the host's access offset into the image
4986 # @size: if the corruption resulted from an image access, this is
4989 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4990 # event and must be repaired (Since 2.2; before, every
4991 # BLOCK_IMAGE_CORRUPTED event was fatal)
4993 # Note: If action is "stop", a STOP event will eventually follow the
4994 # BLOCK_IO_ERROR event.
4998 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4999 # "data": { "device": "", "node-name": "drive", "fatal": false,
5000 # "msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)" },
5001 # "timestamp": { "seconds": 1648243240, "microseconds": 906060 } }
5005 { 'event': 'BLOCK_IMAGE_CORRUPTED',
5006 'data': { 'device' : 'str',
5007 '*node-name' : 'str',
5011 'fatal' : 'bool' } }
5016 # Emitted when a disk I/O error occurs
5018 # @device: device name. This is always present for compatibility
5019 # reasons, but it can be empty ("") if the image does not
5020 # have a device name associated.
5022 # @node-name: node name. Note that errors may be reported for the root node
5023 # that is directly attached to a guest device rather than for the
5024 # node where the error occurred. The node name is not present if
5025 # the drive is empty. (Since: 2.8)
5027 # @operation: I/O operation
5029 # @action: action that has been taken
5031 # @nospace: true if I/O error was caused due to a no-space
5032 # condition. This key is only present if query-block's
5033 # io-status is present, please see query-block documentation
5034 # for more information (since: 2.2)
5036 # @reason: human readable string describing the error cause.
5037 # (This field is a debugging aid for humans, it should not
5038 # be parsed by applications) (since: 2.2)
5040 # Note: If action is "stop", a STOP event will eventually follow the
5041 # BLOCK_IO_ERROR event
5047 # <- { "event": "BLOCK_IO_ERROR",
5048 # "data": { "device": "ide0-hd1",
5049 # "node-name": "#block212",
5050 # "operation": "write",
5052 # "reason": "No space left on device" },
5053 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5056 { 'event': 'BLOCK_IO_ERROR',
5057 'data': { 'device': 'str', '*node-name': 'str',
5058 'operation': 'IoOperationType',
5059 'action': 'BlockErrorAction', '*nospace': 'bool',
5063 # @BLOCK_JOB_COMPLETED:
5065 # Emitted when a block job has completed
5069 # @device: The job identifier. Originally the device name but other
5070 # values are allowed since QEMU 2.7
5072 # @len: maximum progress value
5074 # @offset: current progress value. On success this is equal to len.
5075 # On failure this is less than len
5077 # @speed: rate limit, bytes per second
5079 # @error: error message. Only present on failure. This field
5080 # contains a human-readable error message. There are no semantics
5081 # other than that streaming has failed and clients should not try to
5082 # interpret the error string
5088 # <- { "event": "BLOCK_JOB_COMPLETED",
5089 # "data": { "type": "stream", "device": "virtio-disk0",
5090 # "len": 10737418240, "offset": 10737418240,
5092 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5095 { 'event': 'BLOCK_JOB_COMPLETED',
5096 'data': { 'type' : 'JobType',
5104 # @BLOCK_JOB_CANCELLED:
5106 # Emitted when a block job has been cancelled
5110 # @device: The job identifier. Originally the device name but other
5111 # values are allowed since QEMU 2.7
5113 # @len: maximum progress value
5115 # @offset: current progress value. On success this is equal to len.
5116 # On failure this is less than len
5118 # @speed: rate limit, bytes per second
5124 # <- { "event": "BLOCK_JOB_CANCELLED",
5125 # "data": { "type": "stream", "device": "virtio-disk0",
5126 # "len": 10737418240, "offset": 134217728,
5128 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5131 { 'event': 'BLOCK_JOB_CANCELLED',
5132 'data': { 'type' : 'JobType',
5141 # Emitted when a block job encounters an error
5143 # @device: The job identifier. Originally the device name but other
5144 # values are allowed since QEMU 2.7
5146 # @operation: I/O operation
5148 # @action: action that has been taken
5154 # <- { "event": "BLOCK_JOB_ERROR",
5155 # "data": { "device": "ide0-hd1",
5156 # "operation": "write",
5157 # "action": "stop" },
5158 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5161 { 'event': 'BLOCK_JOB_ERROR',
5162 'data': { 'device' : 'str',
5163 'operation': 'IoOperationType',
5164 'action' : 'BlockErrorAction' } }
5169 # Emitted when a block job is ready to complete
5173 # @device: The job identifier. Originally the device name but other
5174 # values are allowed since QEMU 2.7
5176 # @len: maximum progress value
5178 # @offset: current progress value. On success this is equal to len.
5179 # On failure this is less than len
5181 # @speed: rate limit, bytes per second
5183 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
5190 # <- { "event": "BLOCK_JOB_READY",
5191 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5192 # "len": 2097152, "offset": 2097152 }
5193 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5196 { 'event': 'BLOCK_JOB_READY',
5197 'data': { 'type' : 'JobType',
5204 # @BLOCK_JOB_PENDING:
5206 # Emitted when a block job is awaiting explicit authorization to finalize graph
5207 # changes via @block-job-finalize. If this job is part of a transaction, it will
5208 # not emit this event until the transaction has converged first.
5212 # @id: The job identifier.
5218 # <- { "event": "BLOCK_JOB_PENDING",
5219 # "data": { "type": "mirror", "id": "backup_1" },
5220 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5223 { 'event': 'BLOCK_JOB_PENDING',
5224 'data': { 'type' : 'JobType',
5230 # Preallocation mode of QEMU image file
5232 # @off: no preallocation
5233 # @metadata: preallocate only for metadata
5234 # @falloc: like @full preallocation but allocate disk space by
5235 # posix_fallocate() rather than writing data.
5236 # @full: preallocate all data by writing it to the device to ensure
5237 # disk space is really available. This data may or may not be
5238 # zero, depending on the image format and storage.
5239 # @full preallocation also sets up metadata correctly.
5243 { 'enum': 'PreallocMode',
5244 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5247 # @BLOCK_WRITE_THRESHOLD:
5249 # Emitted when writes on block device reaches or exceeds the
5250 # configured write threshold. For thin-provisioned devices, this
5251 # means the device should be extended to avoid pausing for
5253 # The event is one shot. Once triggered, it needs to be
5254 # re-registered with another block-set-write-threshold command.
5256 # @node-name: graph node name on which the threshold was exceeded.
5258 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5260 # @write-threshold: last configured threshold, in bytes.
5264 { 'event': 'BLOCK_WRITE_THRESHOLD',
5265 'data': { 'node-name': 'str',
5266 'amount-exceeded': 'uint64',
5267 'write-threshold': 'uint64' } }
5270 # @block-set-write-threshold:
5272 # Change the write threshold for a block drive. An event will be
5273 # delivered if a write to this block drive crosses the configured
5274 # threshold. The threshold is an offset, thus must be
5275 # non-negative. Default is no write threshold. Setting the threshold
5276 # to zero disables it.
5278 # This is useful to transparently resize thin-provisioned drives without
5279 # the guest OS noticing.
5281 # @node-name: graph node name on which the threshold must be set.
5283 # @write-threshold: configured threshold for the block device, bytes.
5284 # Use 0 to disable the threshold.
5290 # -> { "execute": "block-set-write-threshold",
5291 # "arguments": { "node-name": "mydev",
5292 # "write-threshold": 17179869184 } }
5293 # <- { "return": {} }
5296 { 'command': 'block-set-write-threshold',
5297 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
5300 # @x-blockdev-change:
5302 # Dynamically reconfigure the block driver state graph. It can be used
5303 # to add, remove, insert or replace a graph node. Currently only the
5304 # Quorum driver implements this feature to add or remove its child. This
5305 # is useful to fix a broken quorum child.
5307 # If @node is specified, it will be inserted under @parent. @child
5308 # may not be specified in this case. If both @parent and @child are
5309 # specified but @node is not, @child will be detached from @parent.
5311 # @parent: the id or name of the parent node.
5313 # @child: the name of a child under the given parent node.
5315 # @node: the name of the node that will be added.
5318 # @unstable: This command is experimental, and its API is not stable. It
5319 # does not support all kinds of operations, all kinds of
5320 # children, nor all block drivers.
5322 # FIXME Removing children from a quorum node means introducing
5323 # gaps in the child indices. This cannot be represented in the
5324 # 'children' list of BlockdevOptionsQuorum, as returned by
5325 # .bdrv_refresh_filename().
5327 # Warning: The data in a new quorum child MUST be consistent
5328 # with that of the rest of the array.
5334 # 1. Add a new node to a quorum
5335 # -> { "execute": "blockdev-add",
5338 # "node-name": "new_node",
5339 # "file": { "driver": "file",
5340 # "filename": "test.raw" } } }
5341 # <- { "return": {} }
5342 # -> { "execute": "x-blockdev-change",
5343 # "arguments": { "parent": "disk1",
5344 # "node": "new_node" } }
5345 # <- { "return": {} }
5347 # 2. Delete a quorum's node
5348 # -> { "execute": "x-blockdev-change",
5349 # "arguments": { "parent": "disk1",
5350 # "child": "children.1" } }
5351 # <- { "return": {} }
5354 { 'command': 'x-blockdev-change',
5355 'data' : { 'parent': 'str',
5358 'features': [ 'unstable' ] }
5361 # @x-blockdev-set-iothread:
5363 # Move @node and its children into the @iothread. If @iothread is null then
5364 # move @node and its children into the main loop.
5366 # The node must not be attached to a BlockBackend.
5368 # @node-name: the name of the block driver node
5370 # @iothread: the name of the IOThread object or null for the main loop
5372 # @force: true if the node and its children should be moved when a BlockBackend
5373 # is already attached
5376 # @unstable: This command is experimental and intended for test cases that
5377 # need control over IOThreads only.
5383 # 1. Move a node into an IOThread
5384 # -> { "execute": "x-blockdev-set-iothread",
5385 # "arguments": { "node-name": "disk1",
5386 # "iothread": "iothread0" } }
5387 # <- { "return": {} }
5389 # 2. Move a node into the main loop
5390 # -> { "execute": "x-blockdev-set-iothread",
5391 # "arguments": { "node-name": "disk1",
5392 # "iothread": null } }
5393 # <- { "return": {} }
5396 { 'command': 'x-blockdev-set-iothread',
5397 'data' : { 'node-name': 'str',
5398 'iothread': 'StrOrNull',
5400 'features': [ 'unstable' ] }
5405 # An enumeration of the quorum operation types
5407 # @read: read operation
5409 # @write: write operation
5411 # @flush: flush operation
5415 { 'enum': 'QuorumOpType',
5416 'data': [ 'read', 'write', 'flush' ] }
5421 # Emitted by the Quorum block driver if it fails to establish a quorum
5423 # @reference: device name if defined else node name
5425 # @sector-num: number of the first sector of the failed read operation
5427 # @sectors-count: failed read operation sector count
5429 # Note: This event is rate-limited.
5435 # <- { "event": "QUORUM_FAILURE",
5436 # "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
5437 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5440 { 'event': 'QUORUM_FAILURE',
5441 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
5444 # @QUORUM_REPORT_BAD:
5446 # Emitted to report a corruption of a Quorum file
5448 # @type: quorum operation type (Since 2.6)
5450 # @error: error message. Only present on failure. This field
5451 # contains a human-readable error message. There are no semantics other
5452 # than that the block layer reported an error and clients should not
5453 # try to interpret the error string.
5455 # @node-name: the graph node name of the block driver state
5457 # @sector-num: number of the first sector of the failed read operation
5459 # @sectors-count: failed read operation sector count
5461 # Note: This event is rate-limited.
5469 # { "event": "QUORUM_REPORT_BAD",
5470 # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
5472 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5474 # 2. Flush operation
5476 # { "event": "QUORUM_REPORT_BAD",
5477 # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
5478 # "type": "flush", "error": "Broken pipe" },
5479 # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
5482 { 'event': 'QUORUM_REPORT_BAD',
5483 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
5484 'sector-num': 'int', 'sectors-count': 'int' } }
5487 # @BlockdevSnapshotInternal:
5489 # @device: the device name or node-name of a root node to generate the snapshot
5492 # @name: the name of the internal snapshot to be created
5494 # Notes: In transaction, if @name is empty, or any snapshot matching @name
5495 # exists, the operation will fail. Only some image formats support it,
5496 # for example, qcow2, and rbd.
5500 { 'struct': 'BlockdevSnapshotInternal',
5501 'data': { 'device': 'str', 'name': 'str' } }
5504 # @blockdev-snapshot-internal-sync:
5506 # Synchronously take an internal snapshot of a block device, when the
5507 # format of the image used supports it. If the name is an empty
5508 # string, or a snapshot with name already exists, the operation will
5511 # For the arguments, see the documentation of BlockdevSnapshotInternal.
5513 # Returns: - nothing on success
5514 # - If @device is not a valid block device, GenericError
5515 # - If any snapshot matching @name exists, or @name is empty,
5517 # - If the format of the image used does not support it,
5518 # BlockFormatFeatureNotSupported
5524 # -> { "execute": "blockdev-snapshot-internal-sync",
5525 # "arguments": { "device": "ide-hd0",
5526 # "name": "snapshot0" }
5528 # <- { "return": {} }
5531 { 'command': 'blockdev-snapshot-internal-sync',
5532 'data': 'BlockdevSnapshotInternal' }
5535 # @blockdev-snapshot-delete-internal-sync:
5537 # Synchronously delete an internal snapshot of a block device, when the format
5538 # of the image used support it. The snapshot is identified by name or id or
5539 # both. One of the name or id is required. Return SnapshotInfo for the
5540 # successfully deleted snapshot.
5542 # @device: the device name or node-name of a root node to delete the snapshot
5545 # @id: optional the snapshot's ID to be deleted
5547 # @name: optional the snapshot's name to be deleted
5549 # Returns: - SnapshotInfo on success
5550 # - If @device is not a valid block device, GenericError
5551 # - If snapshot not found, GenericError
5552 # - If the format of the image used does not support it,
5553 # BlockFormatFeatureNotSupported
5554 # - If @id and @name are both not specified, GenericError
5560 # -> { "execute": "blockdev-snapshot-delete-internal-sync",
5561 # "arguments": { "device": "ide-hd0",
5562 # "name": "snapshot0" }
5566 # "name": "snapshot0",
5567 # "vm-state-size": 0,
5568 # "date-sec": 1000012,
5570 # "vm-clock-sec": 100,
5571 # "vm-clock-nsec": 20,
5577 { 'command': 'blockdev-snapshot-delete-internal-sync',
5578 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
5579 'returns': 'SnapshotInfo' }