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)
242 { 'struct': 'ImageInfo',
243 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
244 '*actual-size': 'int', 'virtual-size': 'int',
245 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
246 '*backing-filename': 'str', '*full-backing-filename': 'str',
247 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
248 '*backing-image': 'ImageInfo',
249 '*format-specific': 'ImageInfoSpecific' } }
254 # Information about a QEMU image file check
256 # @filename: name of the image file checked
258 # @format: format of the image file checked
260 # @check-errors: number of unexpected errors occurred during check
262 # @image-end-offset: offset (in bytes) where the image ends, this
263 # field is present if the driver for the image format
266 # @corruptions: number of corruptions found during the check if any
268 # @leaks: number of leaks found during the check if any
270 # @corruptions-fixed: number of corruptions fixed during the check
273 # @leaks-fixed: number of leaks fixed during the check if any
275 # @total-clusters: total number of clusters, this field is present
276 # if the driver for the image format supports it
278 # @allocated-clusters: total number of allocated clusters, this
279 # field is present if the driver for the image format
282 # @fragmented-clusters: total number of fragmented clusters, this
283 # field is present if the driver for the image format
286 # @compressed-clusters: total number of compressed clusters, this
287 # field is present if the driver for the image format
293 { 'struct': 'ImageCheck',
294 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
295 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
296 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
297 '*total-clusters': 'int', '*allocated-clusters': 'int',
298 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
303 # Mapping information from a virtual block range to a host file range
305 # @start: virtual (guest) offset of the first byte described by this
308 # @length: the number of bytes of the mapped virtual range
310 # @data: reading the image will actually read data from a file (in
311 # particular, if @offset is present this means that the sectors
312 # are not simply preallocated, but contain actual data in raw
315 # @zero: whether the virtual blocks read as zeroes
317 # @depth: number of layers (0 = top image, 1 = top image's backing
318 # file, ..., n - 1 = bottom image (where n is the number of
319 # images in the chain)) before reaching one for which the
322 # @present: true if this layer provides the data, false if adding a backing
323 # layer could impact this region (since 6.1)
325 # @offset: if present, the image file stores the data for this range
326 # in raw format at the given (host) offset
328 # @filename: filename that is referred to by @offset
333 { 'struct': 'MapEntry',
334 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
335 'zero': 'bool', 'depth': 'int', 'present': 'bool',
336 '*offset': 'int', '*filename': 'str' } }
339 # @BlockdevCacheInfo:
341 # Cache mode information for a block device
343 # @writeback: true if writeback mode is enabled
344 # @direct: true if the host page cache is bypassed (O_DIRECT)
345 # @no-flush: true if flush requests are ignored for the device
349 { 'struct': 'BlockdevCacheInfo',
350 'data': { 'writeback': 'bool',
352 'no-flush': 'bool' } }
357 # Information about the backing device for a block device.
359 # @file: the filename of the backing device
361 # @node-name: the name of the block driver node (Since 2.0)
363 # @ro: true if the backing device was open read-only
365 # @drv: the name of the block format used to open the backing device. As of
366 # 0.14 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
367 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
368 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
369 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
370 # 2.2: 'archipelago' added, 'cow' dropped
371 # 2.3: 'host_floppy' deprecated
372 # 2.5: 'host_floppy' dropped
374 # 2.8: 'replication' added, 'tftp' dropped
375 # 2.9: 'archipelago' dropped
377 # @backing_file: the name of the backing file (for copy-on-write)
379 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
381 # @encrypted: true if the backing device is encrypted
383 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
385 # @bps: total throughput limit in bytes per second is specified
387 # @bps_rd: read throughput limit in bytes per second is specified
389 # @bps_wr: write throughput limit in bytes per second is specified
391 # @iops: total I/O operations per second is specified
393 # @iops_rd: read I/O operations per second is specified
395 # @iops_wr: write I/O operations per second is specified
397 # @image: the info of image used (since: 1.6)
399 # @bps_max: total throughput limit during bursts,
400 # in bytes (Since 1.7)
402 # @bps_rd_max: read throughput limit during bursts,
403 # in bytes (Since 1.7)
405 # @bps_wr_max: write throughput limit during bursts,
406 # in bytes (Since 1.7)
408 # @iops_max: total I/O operations per second during bursts,
409 # in bytes (Since 1.7)
411 # @iops_rd_max: read I/O operations per second during bursts,
412 # in bytes (Since 1.7)
414 # @iops_wr_max: write I/O operations per second during bursts,
415 # in bytes (Since 1.7)
417 # @bps_max_length: maximum length of the @bps_max burst
418 # period, in seconds. (Since 2.6)
420 # @bps_rd_max_length: maximum length of the @bps_rd_max
421 # burst period, in seconds. (Since 2.6)
423 # @bps_wr_max_length: maximum length of the @bps_wr_max
424 # burst period, in seconds. (Since 2.6)
426 # @iops_max_length: maximum length of the @iops burst
427 # period, in seconds. (Since 2.6)
429 # @iops_rd_max_length: maximum length of the @iops_rd_max
430 # burst period, in seconds. (Since 2.6)
432 # @iops_wr_max_length: maximum length of the @iops_wr_max
433 # burst period, in seconds. (Since 2.6)
435 # @iops_size: an I/O size in bytes (Since 1.7)
437 # @group: throttle group name (Since 2.4)
439 # @cache: the cache mode used for the block device (since: 2.3)
441 # @write_threshold: configured write threshold for the device.
442 # 0 if disabled. (Since 2.3)
444 # @dirty-bitmaps: dirty bitmaps information (only present if node
445 # has one or more dirty bitmaps) (Since 4.2)
450 { 'struct': 'BlockDeviceInfo',
451 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
452 '*backing_file': 'str', 'backing_file_depth': 'int',
454 'detect_zeroes': 'BlockdevDetectZeroesOptions',
455 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
456 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
457 'image': 'ImageInfo',
458 '*bps_max': 'int', '*bps_rd_max': 'int',
459 '*bps_wr_max': 'int', '*iops_max': 'int',
460 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
461 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
462 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
463 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
464 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
465 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
468 # @BlockDeviceIoStatus:
470 # An enumeration of block device I/O status.
472 # @ok: The last I/O operation has succeeded
474 # @failed: The last I/O operation has failed
476 # @nospace: The last I/O operation has failed due to a no-space condition
480 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
485 # Block dirty bitmap information.
487 # @name: the name of the dirty bitmap (Since 2.4)
489 # @count: number of dirty bytes according to the dirty bitmap
491 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
493 # @recording: true if the bitmap is recording new writes from the guest.
494 # Replaces ``active`` and ``disabled`` statuses. (since 4.0)
496 # @busy: true if the bitmap is in-use by some operation (NBD or jobs)
497 # and cannot be modified via QMP or used by another operation.
498 # Replaces ``locked`` and ``frozen`` statuses. (since 4.0)
500 # @persistent: true if the bitmap was stored on disk, is scheduled to be stored
501 # on disk, or both. (since 4.0)
503 # @inconsistent: true if this is a persistent bitmap that was improperly
504 # stored. Implies @persistent to be true; @recording and
505 # @busy to be false. This bitmap cannot be used. To remove
506 # it, use @block-dirty-bitmap-remove. (Since 4.0)
510 { 'struct': 'BlockDirtyInfo',
511 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
512 'recording': 'bool', 'busy': 'bool',
513 'persistent': 'bool', '*inconsistent': 'bool' } }
516 # @Qcow2BitmapInfoFlags:
518 # An enumeration of flags that a bitmap can report to the user.
520 # @in-use: This flag is set by any process actively modifying the qcow2 file,
521 # and cleared when the updated bitmap is flushed to the qcow2 image.
522 # The presence of this flag in an offline image means that the bitmap
523 # was not saved correctly after its last usage, and may contain
526 # @auto: The bitmap must reflect all changes of the virtual disk by any
527 # application that would write to this qcow2 file.
531 { 'enum': 'Qcow2BitmapInfoFlags',
532 'data': ['in-use', 'auto'] }
537 # Qcow2 bitmap information.
539 # @name: the name of the bitmap
541 # @granularity: granularity of the bitmap in bytes
543 # @flags: flags of the bitmap
547 { 'struct': 'Qcow2BitmapInfo',
548 'data': {'name': 'str', 'granularity': 'uint32',
549 'flags': ['Qcow2BitmapInfoFlags'] } }
552 # @BlockLatencyHistogramInfo:
554 # Block latency histogram.
556 # @boundaries: list of interval boundary values in nanoseconds, all greater
557 # than zero and in ascending order.
558 # For example, the list [10, 50, 100] produces the following
559 # histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
561 # @bins: list of io request counts corresponding to histogram intervals.
562 # len(@bins) = len(@boundaries) + 1
563 # For the example above, @bins may be something like [3, 1, 5, 2],
564 # and corresponding histogram looks like:
573 # +------------------
578 { 'struct': 'BlockLatencyHistogramInfo',
579 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
584 # Block device information. This structure describes a virtual device and
585 # the backing device associated with it.
587 # @device: The device name associated with the virtual device.
589 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
590 # device. (since 2.10)
592 # @type: This field is returned only for compatibility reasons, it should
593 # not be used (always returns 'unknown')
595 # @removable: True if the device supports removable media.
597 # @locked: True if the guest has locked this device from having its media
600 # @tray_open: True if the device's tray is open
601 # (only present if it has a tray)
603 # @io-status: @BlockDeviceIoStatus. Only present if the device
604 # supports it and the VM is configured to stop on errors
605 # (supported device models: virtio-blk, IDE, SCSI except
608 # @inserted: @BlockDeviceInfo describing the device if media is
613 { 'struct': 'BlockInfo',
614 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
615 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
616 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus' } }
621 # Image file size calculation information. This structure describes the size
622 # requirements for creating a new image file.
624 # The size requirements depend on the new image file format. File size always
625 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
626 # Compact formats such as 'qcow2' represent unallocated and zero regions
627 # efficiently so file size may be smaller than virtual disk size.
629 # The values are upper bounds that are guaranteed to fit the new image file.
630 # Subsequent modification, such as internal snapshot or further bitmap
631 # creation, may require additional space and is not covered here.
633 # @required: Size required for a new image file, in bytes, when copying just
634 # allocated guest-visible contents.
636 # @fully-allocated: Image file size, in bytes, once data has been written
637 # to all sectors, when copying just guest-visible contents.
639 # @bitmaps: Additional size required if all the top-level bitmap metadata
640 # in the source image were to be copied to the destination,
641 # present only when source and destination both support
642 # persistent bitmaps. (since 5.1)
646 { 'struct': 'BlockMeasureInfo',
647 'data': {'required': 'int', 'fully-allocated': 'int', '*bitmaps': 'int'} }
652 # Get a list of BlockInfo for all virtual block devices.
654 # Returns: a list of @BlockInfo describing each virtual block device. Filter
655 # nodes that were created implicitly are skipped over.
661 # -> { "execute": "query-block" }
666 # "device":"ide0-hd0",
673 # "file":"disks/test.qcow2",
674 # "backing_file_depth":1,
681 # "bps_max": 8000000,
688 # "detect_zeroes": "on",
689 # "write_threshold": 0,
691 # "filename":"disks/test.qcow2",
693 # "virtual-size":2048000,
694 # "backing_file":"base.qcow2",
695 # "full-backing-filename":"disks/base.qcow2",
696 # "backing-filename-format":"qcow2",
700 # "name": "snapshot1",
701 # "vm-state-size": 0,
702 # "date-sec": 10000200,
704 # "vm-clock-sec": 206,
705 # "vm-clock-nsec": 30
709 # "filename":"disks/base.qcow2",
711 # "virtual-size":2048000
715 # "qdev": "ide_disk",
720 # "device":"ide1-cd0",
723 # "qdev": "/machine/unattached/device[23]",
724 # "tray_open": false,
728 # "device":"floppy0",
731 # "qdev": "/machine/unattached/device[20]",
744 { 'command': 'query-block', 'returns': ['BlockInfo'] }
748 # @BlockDeviceTimedStats:
750 # Statistics of a block device during a given interval of time.
752 # @interval_length: Interval used for calculating the statistics,
755 # @min_rd_latency_ns: Minimum latency of read operations in the
756 # defined interval, in nanoseconds.
758 # @min_wr_latency_ns: Minimum latency of write operations in the
759 # defined interval, in nanoseconds.
761 # @min_flush_latency_ns: Minimum latency of flush operations in the
762 # defined interval, in nanoseconds.
764 # @max_rd_latency_ns: Maximum latency of read operations in the
765 # defined interval, in nanoseconds.
767 # @max_wr_latency_ns: Maximum latency of write operations in the
768 # defined interval, in nanoseconds.
770 # @max_flush_latency_ns: Maximum latency of flush operations in the
771 # defined interval, in nanoseconds.
773 # @avg_rd_latency_ns: Average latency of read operations in the
774 # defined interval, in nanoseconds.
776 # @avg_wr_latency_ns: Average latency of write operations in the
777 # defined interval, in nanoseconds.
779 # @avg_flush_latency_ns: Average latency of flush operations in the
780 # defined interval, in nanoseconds.
782 # @avg_rd_queue_depth: Average number of pending read operations
783 # in the defined interval.
785 # @avg_wr_queue_depth: Average number of pending write operations
786 # in the defined interval.
790 { 'struct': 'BlockDeviceTimedStats',
791 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
792 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
793 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
794 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
795 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
796 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
801 # Statistics of a virtual block device or a block backing device.
803 # @rd_bytes: The number of bytes read by the device.
805 # @wr_bytes: The number of bytes written by the device.
807 # @unmap_bytes: The number of bytes unmapped by the device (Since 4.2)
809 # @rd_operations: The number of read operations performed by the device.
811 # @wr_operations: The number of write operations performed by the device.
813 # @flush_operations: The number of cache flush operations performed by the
814 # device (since 0.15)
816 # @unmap_operations: The number of unmap operations performed by the device
819 # @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15).
821 # @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15).
823 # @flush_total_time_ns: Total time spent on cache flushes in nanoseconds
826 # @unmap_total_time_ns: Total time spent on unmap operations in nanoseconds
829 # @wr_highest_offset: The offset after the greatest byte written to the
830 # device. The intended use of this information is for
831 # growable sparse files (like qcow2) that are used on top
832 # of a physical device.
834 # @rd_merged: Number of read requests that have been merged into another
835 # request (Since 2.3).
837 # @wr_merged: Number of write requests that have been merged into another
838 # request (Since 2.3).
840 # @unmap_merged: Number of unmap requests that have been merged into another
841 # request (Since 4.2)
843 # @idle_time_ns: Time since the last I/O operation, in
844 # nanoseconds. If the field is absent it means that
845 # there haven't been any operations yet (Since 2.5).
847 # @failed_rd_operations: The number of failed read operations
848 # performed by the device (Since 2.5)
850 # @failed_wr_operations: The number of failed write operations
851 # performed by the device (Since 2.5)
853 # @failed_flush_operations: The number of failed flush operations
854 # performed by the device (Since 2.5)
856 # @failed_unmap_operations: The number of failed unmap operations performed
857 # by the device (Since 4.2)
859 # @invalid_rd_operations: The number of invalid read operations
860 # performed by the device (Since 2.5)
862 # @invalid_wr_operations: The number of invalid write operations
863 # performed by the device (Since 2.5)
865 # @invalid_flush_operations: The number of invalid flush operations
866 # performed by the device (Since 2.5)
868 # @invalid_unmap_operations: The number of invalid unmap operations performed
869 # by the device (Since 4.2)
871 # @account_invalid: Whether invalid operations are included in the
872 # last access statistics (Since 2.5)
874 # @account_failed: Whether failed operations are included in the
875 # latency and last access statistics (Since 2.5)
877 # @timed_stats: Statistics specific to the set of previously defined
878 # intervals of time (Since 2.5)
880 # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
882 # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
884 # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
888 { 'struct': 'BlockDeviceStats',
889 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int',
890 'rd_operations': 'int', 'wr_operations': 'int',
891 'flush_operations': 'int', 'unmap_operations': 'int',
892 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int',
893 'flush_total_time_ns': 'int', 'unmap_total_time_ns': 'int',
894 'wr_highest_offset': 'int',
895 'rd_merged': 'int', 'wr_merged': 'int', 'unmap_merged': 'int',
896 '*idle_time_ns': 'int',
897 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
898 'failed_flush_operations': 'int', 'failed_unmap_operations': 'int',
899 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int',
900 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int',
901 'account_invalid': 'bool', 'account_failed': 'bool',
902 'timed_stats': ['BlockDeviceTimedStats'],
903 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
904 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
905 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
908 # @BlockStatsSpecificFile:
910 # File driver statistics
912 # @discard-nb-ok: The number of successful discard operations performed by
915 # @discard-nb-failed: The number of failed discard operations performed by
918 # @discard-bytes-ok: The number of bytes discarded by the driver.
922 { 'struct': 'BlockStatsSpecificFile',
924 'discard-nb-ok': 'uint64',
925 'discard-nb-failed': 'uint64',
926 'discard-bytes-ok': 'uint64' } }
929 # @BlockStatsSpecificNvme:
931 # NVMe driver statistics
933 # @completion-errors: The number of completion errors.
935 # @aligned-accesses: The number of aligned accesses performed by
938 # @unaligned-accesses: The number of unaligned accesses performed by
943 { 'struct': 'BlockStatsSpecificNvme',
945 'completion-errors': 'uint64',
946 'aligned-accesses': 'uint64',
947 'unaligned-accesses': 'uint64' } }
950 # @BlockStatsSpecific:
952 # Block driver specific statistics
956 { 'union': 'BlockStatsSpecific',
957 'base': { 'driver': 'BlockdevDriver' },
958 'discriminator': 'driver',
960 'file': 'BlockStatsSpecificFile',
961 'host_device': { 'type': 'BlockStatsSpecificFile',
962 'if': 'HAVE_HOST_BLOCK_DEVICE' },
963 'nvme': 'BlockStatsSpecificNvme' } }
968 # Statistics of a virtual block device or a block backing device.
970 # @device: If the stats are for a virtual block device, the name
971 # corresponding to the virtual block device.
973 # @node-name: The node name of the device. (Since 2.3)
975 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
976 # device. (since 3.0)
978 # @stats: A @BlockDeviceStats for the device.
980 # @driver-specific: Optional driver-specific stats. (Since 4.2)
982 # @parent: This describes the file block device if it has one.
983 # Contains recursively the statistics of the underlying
984 # protocol (e.g. the host file for a qcow2 image). If there is
985 # no underlying protocol, this field is omitted
987 # @backing: This describes the backing block device if it has one.
992 { 'struct': 'BlockStats',
993 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
994 'stats': 'BlockDeviceStats',
995 '*driver-specific': 'BlockStatsSpecific',
996 '*parent': 'BlockStats',
997 '*backing': 'BlockStats'} }
1000 # @query-blockstats:
1002 # Query the @BlockStats for all virtual block devices.
1004 # @query-nodes: If true, the command will query all the block nodes
1005 # that have a node name, in a list which will include "parent"
1006 # information, but not "backing".
1007 # If false or omitted, the behavior is as before - query all the
1008 # device backends, recursively including their "parent" and
1009 # "backing". Filter nodes that were created implicitly are
1010 # skipped over in this mode. (Since 2.3)
1012 # Returns: A list of @BlockStats for each virtual block devices.
1018 # -> { "execute": "query-blockstats" }
1022 # "device":"ide0-hd0",
1025 # "wr_highest_offset":3686448128,
1026 # "wr_bytes":9786368,
1027 # "wr_operations":751,
1028 # "rd_bytes":122567168,
1029 # "rd_operations":36772
1030 # "wr_total_times_ns":313253456
1031 # "rd_total_times_ns":3465673657
1032 # "flush_total_times_ns":49653
1033 # "flush_operations":61,
1036 # "idle_time_ns":2953431879,
1037 # "account_invalid":true,
1038 # "account_failed":false
1042 # "wr_highest_offset":2821110784,
1043 # "wr_bytes":9786368,
1044 # "wr_operations":692,
1045 # "rd_bytes":122739200,
1046 # "rd_operations":36604
1047 # "flush_operations":51,
1048 # "wr_total_times_ns":313253456
1049 # "rd_total_times_ns":3465673657
1050 # "flush_total_times_ns":49653,
1053 # "idle_time_ns":2953431879,
1054 # "account_invalid":true,
1055 # "account_failed":false
1057 # "qdev": "/machine/unattached/device[23]"
1060 # "device":"ide1-cd0",
1062 # "wr_highest_offset":0,
1064 # "wr_operations":0,
1067 # "flush_operations":0,
1068 # "wr_total_times_ns":0
1069 # "rd_total_times_ns":0
1070 # "flush_total_times_ns":0,
1073 # "account_invalid":false,
1074 # "account_failed":false
1076 # "qdev": "/machine/unattached/device[24]"
1079 # "device":"floppy0",
1081 # "wr_highest_offset":0,
1083 # "wr_operations":0,
1086 # "flush_operations":0,
1087 # "wr_total_times_ns":0
1088 # "rd_total_times_ns":0
1089 # "flush_total_times_ns":0,
1092 # "account_invalid":false,
1093 # "account_failed":false
1095 # "qdev": "/machine/unattached/device[16]"
1100 # "wr_highest_offset":0,
1102 # "wr_operations":0,
1105 # "flush_operations":0,
1106 # "wr_total_times_ns":0
1107 # "rd_total_times_ns":0
1108 # "flush_total_times_ns":0,
1111 # "account_invalid":false,
1112 # "account_failed":false
1119 { 'command': 'query-blockstats',
1120 'data': { '*query-nodes': 'bool' },
1121 'returns': ['BlockStats'] }
1126 # An enumeration of possible behaviors for errors on I/O operations.
1127 # The exact meaning depends on whether the I/O was initiated by a guest
1130 # @report: for guest operations, report the error to the guest;
1131 # for jobs, cancel the job
1133 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1134 # or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs retry
1135 # the failing request later and may still complete successfully. The
1136 # stream block job continues to stream and will complete with an
1139 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1141 # @stop: for guest operations, stop the virtual machine;
1142 # for jobs, pause the job
1144 # @auto: inherit the error handling policy of the backend (since: 2.7)
1148 { 'enum': 'BlockdevOnError',
1149 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1154 # An enumeration of possible behaviors for the initial synchronization
1155 # phase of storage mirroring.
1157 # @top: copies data in the topmost image to the destination
1159 # @full: copies data from all images to the destination
1161 # @none: only copy data written from now on
1163 # @incremental: only copy data described by the dirty bitmap. (since: 2.4)
1165 # @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
1166 # Behavior on completion is determined by the BitmapSyncMode.
1170 { 'enum': 'MirrorSyncMode',
1171 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1176 # An enumeration of possible behaviors for the synchronization of a bitmap
1177 # when used for data copy operations.
1179 # @on-success: The bitmap is only synced when the operation is successful.
1180 # This is the behavior always used for 'INCREMENTAL' backups.
1182 # @never: The bitmap is never synchronized with the operation, and is
1183 # treated solely as a read-only manifest of blocks to copy.
1185 # @always: The bitmap is always synchronized with the operation,
1186 # regardless of whether or not the operation was successful.
1190 { 'enum': 'BitmapSyncMode',
1191 'data': ['on-success', 'never', 'always'] }
1196 # An enumeration whose values tell the mirror block job when to
1197 # trigger writes to the target.
1199 # @background: copy data in background only.
1201 # @write-blocking: when data is written to the source, write it
1202 # (synchronously) to the target as well. In
1203 # addition, data is copied in background just like in
1208 { 'enum': 'MirrorCopyMode',
1209 'data': ['background', 'write-blocking'] }
1214 # Information about a long-running block device operation.
1216 # @type: the job type ('stream' for image streaming)
1218 # @device: The job identifier. Originally the device name but other
1219 # values are allowed since QEMU 2.7
1221 # @len: Estimated @offset value at the completion of the job. This value can
1222 # arbitrarily change while the job is running, in both directions.
1224 # @offset: Progress made until now. The unit is arbitrary and the value can
1225 # only meaningfully be used for the ratio of @offset to @len. The
1226 # value is monotonically increasing.
1228 # @busy: false if the job is known to be in a quiescent state, with
1229 # no pending I/O. Since 1.3.
1231 # @paused: whether the job is paused or, if @busy is true, will
1232 # pause itself as soon as possible. Since 1.3.
1234 # @speed: the rate limit, bytes per second
1236 # @io-status: the status of the job (since 1.3)
1238 # @ready: true if the job may be completed (since 2.2)
1240 # @status: Current job state/status (since 2.12)
1242 # @auto-finalize: Job will finalize itself when PENDING, moving to
1243 # the CONCLUDED state. (since 2.12)
1245 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1246 # state and disappearing from the query list. (since 2.12)
1248 # @error: Error information if the job did not complete successfully.
1249 # Not set if the job completed successfully. (since 2.12.1)
1253 { 'struct': 'BlockJobInfo',
1254 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1255 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1256 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1257 'status': 'JobStatus',
1258 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1262 # @query-block-jobs:
1264 # Return information about long-running block device operations.
1266 # Returns: a list of @BlockJobInfo for each active block job
1270 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1275 # Resize a block image while a guest is running.
1277 # Either @device or @node-name must be set but not both.
1279 # @device: the name of the device to get the image resized
1281 # @node-name: graph node name to get the image resized (Since 2.0)
1283 # @size: new image size in bytes
1285 # Returns: - nothing on success
1286 # - If @device is not a valid block device, DeviceNotFound
1292 # -> { "execute": "block_resize",
1293 # "arguments": { "device": "scratch", "size": 1073741824 } }
1294 # <- { "return": {} }
1297 { 'command': 'block_resize',
1298 'data': { '*device': 'str',
1299 '*node-name': 'str',
1306 # An enumeration that tells QEMU how to set the backing file path in
1309 # @existing: QEMU should look for an existing image file.
1311 # @absolute-paths: QEMU should create a new image with absolute paths
1312 # for the backing file. If there is no backing file available, the new
1313 # image will not be backed either.
1317 { 'enum': 'NewImageMode',
1318 'data': [ 'existing', 'absolute-paths' ] }
1321 # @BlockdevSnapshotSync:
1323 # Either @device or @node-name must be set but not both.
1325 # @device: the name of the device to take a snapshot of.
1327 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1329 # @snapshot-file: the target of the new overlay image. If the file
1330 # exists, or if it is a device, the overlay will be created in the
1331 # existing file/device. Otherwise, a new file will be created.
1333 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1335 # @format: the format of the overlay image, default is 'qcow2'.
1337 # @mode: whether and how QEMU should create a new image, default is
1340 { 'struct': 'BlockdevSnapshotSync',
1341 'data': { '*device': 'str', '*node-name': 'str',
1342 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1343 '*format': 'str', '*mode': 'NewImageMode' } }
1346 # @BlockdevSnapshot:
1348 # @node: device or node name that will have a snapshot taken.
1350 # @overlay: reference to the existing block device that will become
1351 # the overlay of @node, as part of taking the snapshot.
1352 # It must not have a current backing file (this can be
1353 # achieved by passing "backing": null to blockdev-add).
1357 { 'struct': 'BlockdevSnapshot',
1358 'data': { 'node': 'str', 'overlay': 'str' } }
1363 # Optional parameters for backup. These parameters don't affect
1364 # functionality, but may significantly affect performance.
1366 # @use-copy-range: Use copy offloading. Default false.
1368 # @max-workers: Maximum number of parallel requests for the sustained background
1369 # copying process. Doesn't influence copy-before-write operations.
1372 # @max-chunk: Maximum request length for the sustained background copying
1373 # process. Doesn't influence copy-before-write operations.
1374 # 0 means unlimited. If max-chunk is non-zero then it should not be
1375 # less than job cluster size which is calculated as maximum of
1376 # target image cluster size and 64k. Default 0.
1380 { 'struct': 'BackupPerf',
1381 'data': { '*use-copy-range': 'bool',
1382 '*max-workers': 'int', '*max-chunk': 'int64' } }
1387 # @job-id: identifier for the newly-created block job. If
1388 # omitted, the device name will be used. (Since 2.7)
1390 # @device: the device name or node-name of a root node which should be copied.
1392 # @sync: what parts of the disk image should be copied to the destination
1393 # (all the disk, only the sectors allocated in the topmost image, from a
1394 # dirty bitmap, or only new I/O).
1396 # @speed: the maximum speed, in bytes per second. The default is 0,
1399 # @bitmap: The name of a dirty bitmap to use.
1400 # Must be present if sync is "bitmap" or "incremental".
1401 # Can be present if sync is "full" or "top".
1402 # Must not be present otherwise.
1403 # (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1405 # @bitmap-mode: Specifies the type of data the bitmap should contain after
1406 # the operation concludes.
1407 # Must be present if a bitmap was provided,
1408 # Must NOT be present otherwise. (Since 4.2)
1410 # @compress: true to compress data, if the target format supports it.
1411 # (default: false) (since 2.8)
1413 # @on-source-error: the action to take on an error on the source,
1414 # default 'report'. 'stop' and 'enospc' can only be used
1415 # if the block device supports io-status (see BlockInfo).
1417 # @on-target-error: the action to take on an error on the target,
1418 # default 'report' (no limitations, since this applies to
1419 # a different block device than @device).
1421 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1422 # finished its work, waiting for @block-job-finalize before
1423 # making any block graph changes.
1424 # When true, this job will automatically
1425 # perform its abort or commit actions.
1426 # Defaults to true. (Since 2.12)
1428 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1429 # has completely ceased all work, and awaits @block-job-dismiss.
1430 # When true, this job will automatically disappear from the query
1431 # list without user intervention.
1432 # Defaults to true. (Since 2.12)
1434 # @filter-node-name: the node name that should be assigned to the
1435 # filter driver that the backup job inserts into the graph
1436 # above node specified by @drive. If this option is not given,
1437 # a node name is autogenerated. (Since: 4.2)
1439 # @x-perf: Performance options. (Since 6.0)
1442 # @unstable: Member @x-perf is experimental.
1444 # Note: @on-source-error and @on-target-error only affect background
1445 # I/O. If an error occurs during a guest write request, the device's
1446 # rerror/werror actions will be used.
1450 { 'struct': 'BackupCommon',
1451 'data': { '*job-id': 'str', 'device': 'str',
1452 'sync': 'MirrorSyncMode', '*speed': 'int',
1453 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1454 '*compress': 'bool',
1455 '*on-source-error': 'BlockdevOnError',
1456 '*on-target-error': 'BlockdevOnError',
1457 '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
1458 '*filter-node-name': 'str',
1459 '*x-perf': { 'type': 'BackupPerf',
1460 'features': [ 'unstable' ] } } }
1465 # @target: the target of the new image. If the file exists, or if it
1466 # is a device, the existing file/device will be used as the new
1467 # destination. If it does not exist, a new file will be created.
1469 # @format: the format of the new destination, default is to
1470 # probe if @mode is 'existing', else the format of the source
1472 # @mode: whether and how QEMU should create a new image, default is
1477 { 'struct': 'DriveBackup',
1478 'base': 'BackupCommon',
1479 'data': { 'target': 'str',
1481 '*mode': 'NewImageMode' } }
1486 # @target: the device name or node-name of the backup target node.
1490 { 'struct': 'BlockdevBackup',
1491 'base': 'BackupCommon',
1492 'data': { 'target': 'str' } }
1495 # @blockdev-snapshot-sync:
1497 # Takes a synchronous snapshot of a block device.
1499 # For the arguments, see the documentation of BlockdevSnapshotSync.
1501 # Returns: - nothing on success
1502 # - If @device is not a valid block device, DeviceNotFound
1508 # -> { "execute": "blockdev-snapshot-sync",
1509 # "arguments": { "device": "ide-hd0",
1511 # "/some/place/my-image",
1512 # "format": "qcow2" } }
1513 # <- { "return": {} }
1516 { 'command': 'blockdev-snapshot-sync',
1517 'data': 'BlockdevSnapshotSync' }
1521 # @blockdev-snapshot:
1523 # Takes a snapshot of a block device.
1525 # Take a snapshot, by installing 'node' as the backing image of
1526 # 'overlay'. Additionally, if 'node' is associated with a block
1527 # device, the block device changes to using 'overlay' as its new active
1530 # For the arguments, see the documentation of BlockdevSnapshot.
1533 # @allow-write-only-overlay: If present, the check whether this operation is safe
1534 # was relaxed so that it can be used to change
1535 # backing file of a destination of a blockdev-mirror.
1542 # -> { "execute": "blockdev-add",
1543 # "arguments": { "driver": "qcow2",
1544 # "node-name": "node1534",
1545 # "file": { "driver": "file",
1546 # "filename": "hd1.qcow2" },
1547 # "backing": null } }
1549 # <- { "return": {} }
1551 # -> { "execute": "blockdev-snapshot",
1552 # "arguments": { "node": "ide-hd0",
1553 # "overlay": "node1534" } }
1554 # <- { "return": {} }
1557 { 'command': 'blockdev-snapshot',
1558 'data': 'BlockdevSnapshot',
1559 'features': [ 'allow-write-only-overlay' ] }
1562 # @change-backing-file:
1564 # Change the backing file in the image file metadata. This does not
1565 # cause QEMU to reopen the image file to reparse the backing filename
1566 # (it may, however, perform a reopen to change permissions from
1567 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1568 # into the image file metadata, and the QEMU internal strings are
1571 # @image-node-name: The name of the block driver state node of the
1572 # image to modify. The "device" argument is used
1573 # to verify "image-node-name" is in the chain
1574 # described by "device".
1576 # @device: The device name or node-name of the root node that owns
1579 # @backing-file: The string to write as the backing file. This
1580 # string is not validated, so care should be taken
1581 # when specifying the string or the image chain may
1582 # not be able to be reopened again.
1584 # Returns: - Nothing on success
1585 # - If "device" does not exist or cannot be determined, DeviceNotFound
1589 { 'command': 'change-backing-file',
1590 'data': { 'device': 'str', 'image-node-name': 'str',
1591 'backing-file': 'str' } }
1596 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1597 # writes data between 'top' and 'base' into 'base'.
1599 # If top == base, that is an error.
1600 # If top has no overlays on top of it, or if it is in use by a writer,
1601 # the job will not be completed by itself. The user needs to complete
1602 # the job with the block-job-complete command after getting the ready
1603 # event. (Since 2.0)
1605 # If the base image is smaller than top, then the base image will be
1606 # resized to be the same size as top. If top is smaller than the base
1607 # image, the base will not be truncated. If you want the base image
1608 # size to match the size of the smaller top, you can safely truncate
1609 # it yourself once the commit operation successfully completes.
1611 # @job-id: identifier for the newly-created block job. If
1612 # omitted, the device name will be used. (Since 2.7)
1614 # @device: the device name or node-name of a root node
1616 # @base-node: The node name of the backing image to write data into.
1617 # If not specified, this is the deepest backing image.
1620 # @base: Same as @base-node, except that it is a file name rather than a node
1621 # name. This must be the exact filename string that was used to open the
1622 # node; other strings, even if addressing the same file, are not
1625 # @top-node: The node name of the backing image within the image chain
1626 # which contains the topmost data to be committed down. If
1627 # not specified, this is the active layer. (since: 3.1)
1629 # @top: Same as @top-node, except that it is a file name rather than a node
1630 # name. This must be the exact filename string that was used to open the
1631 # node; other strings, even if addressing the same file, are not
1634 # @backing-file: The backing file string to write into the overlay
1635 # image of 'top'. If 'top' does not have an overlay
1636 # image, or if 'top' is in use by a writer, specifying
1637 # a backing file string is an error.
1639 # This filename is not validated. If a pathname string
1640 # is such that it cannot be resolved by QEMU, that
1641 # means that subsequent QMP or HMP commands must use
1642 # node-names for the image in question, as filename
1643 # lookup methods will fail.
1645 # If not specified, QEMU will automatically determine
1646 # the backing file string to use, or error out if
1647 # there is no obvious choice. Care should be taken
1648 # when specifying the string, to specify a valid
1649 # filename or protocol.
1652 # @speed: the maximum speed, in bytes per second
1654 # @on-error: the action to take on an error. 'ignore' means that the request
1655 # should be retried. (default: report; Since: 5.0)
1657 # @filter-node-name: the node name that should be assigned to the
1658 # filter driver that the commit job inserts into the graph
1659 # above @top. If this option is not given, a node name is
1660 # autogenerated. (Since: 2.9)
1662 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1663 # finished its work, waiting for @block-job-finalize before
1664 # making any block graph changes.
1665 # When true, this job will automatically
1666 # perform its abort or commit actions.
1667 # Defaults to true. (Since 3.1)
1669 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1670 # has completely ceased all work, and awaits @block-job-dismiss.
1671 # When true, this job will automatically disappear from the query
1672 # list without user intervention.
1673 # Defaults to true. (Since 3.1)
1676 # @deprecated: Members @base and @top are deprecated. Use @base-node
1677 # and @top-node instead.
1679 # Returns: - Nothing on success
1680 # - If @device does not exist, DeviceNotFound
1681 # - Any other error returns a GenericError.
1687 # -> { "execute": "block-commit",
1688 # "arguments": { "device": "virtio0",
1689 # "top": "/tmp/snap1.qcow2" } }
1690 # <- { "return": {} }
1693 { 'command': 'block-commit',
1694 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1695 '*base': { 'type': 'str', 'features': [ 'deprecated' ] },
1697 '*top': { 'type': 'str', 'features': [ 'deprecated' ] },
1698 '*backing-file': 'str', '*speed': 'int',
1699 '*on-error': 'BlockdevOnError',
1700 '*filter-node-name': 'str',
1701 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1706 # Start a point-in-time copy of a block device to a new destination. The
1707 # status of ongoing drive-backup operations can be checked with
1708 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1709 # The operation can be stopped before it has completed using the
1710 # block-job-cancel command.
1713 # @deprecated: This command is deprecated. Use @blockdev-backup instead.
1715 # Returns: - nothing on success
1716 # - If @device is not a valid block device, GenericError
1722 # -> { "execute": "drive-backup",
1723 # "arguments": { "device": "drive0",
1725 # "target": "backup.img" } }
1726 # <- { "return": {} }
1729 { 'command': 'drive-backup', 'boxed': true,
1730 'data': 'DriveBackup', 'features': ['deprecated'] }
1735 # Start a point-in-time copy of a block device to a new destination. The
1736 # status of ongoing blockdev-backup operations can be checked with
1737 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1738 # The operation can be stopped before it has completed using the
1739 # block-job-cancel command.
1741 # Returns: - nothing on success
1742 # - If @device is not a valid block device, DeviceNotFound
1747 # -> { "execute": "blockdev-backup",
1748 # "arguments": { "device": "src-id",
1750 # "target": "tgt-id" } }
1751 # <- { "return": {} }
1754 { 'command': 'blockdev-backup', 'boxed': true,
1755 'data': 'BlockdevBackup' }
1759 # @query-named-block-nodes:
1761 # Get the named block driver list
1763 # @flat: Omit the nested data about backing image ("backing-image" key) if true.
1764 # Default is false (Since 5.0)
1766 # Returns: the list of BlockDeviceInfo
1772 # -> { "execute": "query-named-block-nodes" }
1773 # <- { "return": [ { "ro":false,
1775 # "encrypted":false,
1776 # "file":"disks/test.qcow2",
1777 # "node-name": "my-node",
1778 # "backing_file_depth":1,
1779 # "detect_zeroes":"off",
1786 # "bps_max": 8000000,
1793 # "write_threshold": 0,
1795 # "filename":"disks/test.qcow2",
1797 # "virtual-size":2048000,
1798 # "backing_file":"base.qcow2",
1799 # "full-backing-filename":"disks/base.qcow2",
1800 # "backing-filename-format":"qcow2",
1804 # "name": "snapshot1",
1805 # "vm-state-size": 0,
1806 # "date-sec": 10000200,
1808 # "vm-clock-sec": 206,
1809 # "vm-clock-nsec": 30
1813 # "filename":"disks/base.qcow2",
1815 # "virtual-size":2048000
1820 { 'command': 'query-named-block-nodes',
1821 'returns': [ 'BlockDeviceInfo' ],
1822 'data': { '*flat': 'bool' } }
1825 # @XDbgBlockGraphNodeType:
1827 # @block-backend: corresponds to BlockBackend
1829 # @block-job: corresponds to BlockJob
1831 # @block-driver: corresponds to BlockDriverState
1835 { 'enum': 'XDbgBlockGraphNodeType',
1836 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1839 # @XDbgBlockGraphNode:
1841 # @id: Block graph node identifier. This @id is generated only for
1842 # x-debug-query-block-graph and does not relate to any other identifiers in
1845 # @type: Type of graph node. Can be one of block-backend, block-job or
1846 # block-driver-state.
1848 # @name: Human readable name of the node. Corresponds to node-name for
1849 # block-driver-state nodes; is not guaranteed to be unique in the whole
1850 # graph (with block-jobs and block-backends).
1854 { 'struct': 'XDbgBlockGraphNode',
1855 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1860 # Enum of base block permissions.
1862 # @consistent-read: A user that has the "permission" of consistent reads is
1863 # guaranteed that their view of the contents of the block
1864 # device is complete and self-consistent, representing the
1865 # contents of a disk at a specific point.
1866 # For most block devices (including their backing files) this
1867 # is true, but the property cannot be maintained in a few
1868 # situations like for intermediate nodes of a commit block
1871 # @write: This permission is required to change the visible disk contents.
1873 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1874 # both enough and required for writes to the block node when
1875 # the caller promises that the visible disk content doesn't
1877 # As the BLK_PERM_WRITE permission is strictly stronger,
1878 # either is sufficient to perform an unchanging write.
1880 # @resize: This permission is required to change the size of a block node.
1884 { 'enum': 'BlockPermission',
1885 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize' ] }
1888 # @XDbgBlockGraphEdge:
1890 # Block Graph edge description for x-debug-query-block-graph.
1892 # @parent: parent id
1896 # @name: name of the relation (examples are 'file' and 'backing')
1898 # @perm: granted permissions for the parent operating on the child
1900 # @shared-perm: permissions that can still be granted to other users of the
1901 # child while it is still attached to this parent
1905 { 'struct': 'XDbgBlockGraphEdge',
1906 'data': { 'parent': 'uint64', 'child': 'uint64',
1907 'name': 'str', 'perm': [ 'BlockPermission' ],
1908 'shared-perm': [ 'BlockPermission' ] } }
1913 # Block Graph - list of nodes and list of edges.
1917 { 'struct': 'XDbgBlockGraph',
1918 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1921 # @x-debug-query-block-graph:
1923 # Get the block graph.
1926 # @unstable: This command is meant for debugging.
1930 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph',
1931 'features': [ 'unstable' ] }
1936 # Start mirroring a block device's writes to a new destination. target
1937 # specifies the target of the new image. If the file exists, or if it
1938 # is a device, it will be used as the new destination for writes. If
1939 # it does not exist, a new file will be created. format specifies the
1940 # format of the mirror image, default is to probe if mode='existing',
1941 # else the format of the source.
1943 # Returns: - nothing on success
1944 # - If @device is not a valid block device, GenericError
1950 # -> { "execute": "drive-mirror",
1951 # "arguments": { "device": "ide-hd0",
1952 # "target": "/some/place/my-image",
1954 # "format": "qcow2" } }
1955 # <- { "return": {} }
1958 { 'command': 'drive-mirror', 'boxed': true,
1959 'data': 'DriveMirror' }
1964 # A set of parameters describing drive mirror setup.
1966 # @job-id: identifier for the newly-created block job. If
1967 # omitted, the device name will be used. (Since 2.7)
1969 # @device: the device name or node-name of a root node whose writes should be
1972 # @target: the target of the new image. If the file exists, or if it
1973 # is a device, the existing file/device will be used as the new
1974 # destination. If it does not exist, a new file will be created.
1976 # @format: the format of the new destination, default is to
1977 # probe if @mode is 'existing', else the format of the source
1979 # @node-name: the new block driver state node name in the graph
1982 # @replaces: with sync=full graph node name to be replaced by the new
1983 # image when a whole image copy is done. This can be used to repair
1984 # broken Quorum files. By default, @device is replaced, although
1985 # implicitly created filters on it are kept. (Since 2.1)
1987 # @mode: whether and how QEMU should create a new image, default is
1990 # @speed: the maximum speed, in bytes per second
1992 # @sync: what parts of the disk image should be copied to the destination
1993 # (all the disk, only the sectors allocated in the topmost image, or
1996 # @granularity: granularity of the dirty bitmap, default is 64K
1997 # if the image format doesn't have clusters, 4K if the clusters
1998 # are smaller than that, else the cluster size. Must be a
1999 # power of 2 between 512 and 64M (since 1.4).
2001 # @buf-size: maximum amount of data in flight from source to
2002 # target (since 1.4).
2004 # @on-source-error: the action to take on an error on the source,
2005 # default 'report'. 'stop' and 'enospc' can only be used
2006 # if the block device supports io-status (see BlockInfo).
2008 # @on-target-error: the action to take on an error on the target,
2009 # default 'report' (no limitations, since this applies to
2010 # a different block device than @device).
2011 # @unmap: Whether to try to unmap target sectors where source has
2012 # only zero. If true, and target unallocated sectors will read as zero,
2013 # target image sectors will be unmapped; otherwise, zeroes will be
2014 # written. Both will result in identical contents.
2015 # Default is true. (Since 2.4)
2017 # @copy-mode: when to copy data to the destination; defaults to 'background'
2020 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2021 # finished its work, waiting for @block-job-finalize before
2022 # making any block graph changes.
2023 # When true, this job will automatically
2024 # perform its abort or commit actions.
2025 # Defaults to true. (Since 3.1)
2027 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2028 # has completely ceased all work, and awaits @block-job-dismiss.
2029 # When true, this job will automatically disappear from the query
2030 # list without user intervention.
2031 # Defaults to true. (Since 3.1)
2034 { 'struct': 'DriveMirror',
2035 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2036 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
2037 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2038 '*speed': 'int', '*granularity': 'uint32',
2039 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2040 '*on-target-error': 'BlockdevOnError',
2041 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
2042 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2045 # @BlockDirtyBitmap:
2047 # @node: name of device/node which the bitmap is tracking
2049 # @name: name of the dirty bitmap
2053 { 'struct': 'BlockDirtyBitmap',
2054 'data': { 'node': 'str', 'name': 'str' } }
2057 # @BlockDirtyBitmapAdd:
2059 # @node: name of device/node which the bitmap is tracking
2061 # @name: name of the dirty bitmap (must be less than 1024 bytes)
2063 # @granularity: the bitmap granularity, default is 64k for
2064 # block-dirty-bitmap-add
2066 # @persistent: the bitmap is persistent, i.e. it will be saved to the
2067 # corresponding block device image file on its close. For now only
2068 # Qcow2 disks support persistent bitmaps. Default is false for
2069 # block-dirty-bitmap-add. (Since: 2.10)
2071 # @disabled: the bitmap is created in the disabled state, which means that
2072 # it will not track drive changes. The bitmap may be enabled with
2073 # block-dirty-bitmap-enable. Default is false. (Since: 4.0)
2077 { 'struct': 'BlockDirtyBitmapAdd',
2078 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
2079 '*persistent': 'bool', '*disabled': 'bool' } }
2082 # @BlockDirtyBitmapMergeSource:
2084 # @local: name of the bitmap, attached to the same node as target bitmap.
2086 # @external: bitmap with specified node
2090 { 'alternate': 'BlockDirtyBitmapMergeSource',
2091 'data': { 'local': 'str',
2092 'external': 'BlockDirtyBitmap' } }
2095 # @BlockDirtyBitmapMerge:
2097 # @node: name of device/node which the @target bitmap is tracking
2099 # @target: name of the destination dirty bitmap
2101 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully
2102 # specified BlockDirtyBitmap elements. The latter are supported
2107 { 'struct': 'BlockDirtyBitmapMerge',
2108 'data': { 'node': 'str', 'target': 'str',
2109 'bitmaps': ['BlockDirtyBitmapMergeSource'] } }
2112 # @block-dirty-bitmap-add:
2114 # Create a dirty bitmap with a name on the node, and start tracking the writes.
2116 # Returns: - nothing on success
2117 # - If @node is not a valid block device or node, DeviceNotFound
2118 # - If @name is already taken, GenericError with an explanation
2124 # -> { "execute": "block-dirty-bitmap-add",
2125 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2126 # <- { "return": {} }
2129 { 'command': 'block-dirty-bitmap-add',
2130 'data': 'BlockDirtyBitmapAdd' }
2133 # @block-dirty-bitmap-remove:
2135 # Stop write tracking and remove the dirty bitmap that was created
2136 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2139 # Returns: - nothing on success
2140 # - If @node is not a valid block device or node, DeviceNotFound
2141 # - If @name is not found, GenericError with an explanation
2142 # - if @name is frozen by an operation, GenericError
2148 # -> { "execute": "block-dirty-bitmap-remove",
2149 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2150 # <- { "return": {} }
2153 { 'command': 'block-dirty-bitmap-remove',
2154 'data': 'BlockDirtyBitmap' }
2157 # @block-dirty-bitmap-clear:
2159 # Clear (reset) a dirty bitmap on the device, so that an incremental
2160 # backup from this point in time forward will only backup clusters
2161 # modified after this clear operation.
2163 # Returns: - nothing on success
2164 # - If @node is not a valid block device, DeviceNotFound
2165 # - If @name is not found, GenericError with an explanation
2171 # -> { "execute": "block-dirty-bitmap-clear",
2172 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2173 # <- { "return": {} }
2176 { 'command': 'block-dirty-bitmap-clear',
2177 'data': 'BlockDirtyBitmap' }
2180 # @block-dirty-bitmap-enable:
2182 # Enables a dirty bitmap so that it will begin tracking disk changes.
2184 # Returns: - nothing on success
2185 # - If @node is not a valid block device, DeviceNotFound
2186 # - If @name is not found, GenericError with an explanation
2192 # -> { "execute": "block-dirty-bitmap-enable",
2193 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2194 # <- { "return": {} }
2197 { 'command': 'block-dirty-bitmap-enable',
2198 'data': 'BlockDirtyBitmap' }
2201 # @block-dirty-bitmap-disable:
2203 # Disables a dirty bitmap so that it will stop tracking disk changes.
2205 # Returns: - nothing on success
2206 # - If @node is not a valid block device, DeviceNotFound
2207 # - If @name is not found, GenericError with an explanation
2213 # -> { "execute": "block-dirty-bitmap-disable",
2214 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2215 # <- { "return": {} }
2218 { 'command': 'block-dirty-bitmap-disable',
2219 'data': 'BlockDirtyBitmap' }
2222 # @block-dirty-bitmap-merge:
2224 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2225 # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2226 # as the @target bitmap. Any bits already set in @target will still be
2227 # set after the merge, i.e., this operation does not clear the target.
2228 # On error, @target is unchanged.
2230 # The resulting bitmap will count as dirty any clusters that were dirty in any
2231 # of the source bitmaps. This can be used to achieve backup checkpoints, or in
2232 # simpler usages, to copy bitmaps.
2234 # Returns: - nothing on success
2235 # - If @node is not a valid block device, DeviceNotFound
2236 # - If any bitmap in @bitmaps or @target is not found, GenericError
2237 # - If any of the bitmaps have different sizes or granularities,
2244 # -> { "execute": "block-dirty-bitmap-merge",
2245 # "arguments": { "node": "drive0", "target": "bitmap0",
2246 # "bitmaps": ["bitmap1"] } }
2247 # <- { "return": {} }
2250 { 'command': 'block-dirty-bitmap-merge',
2251 'data': 'BlockDirtyBitmapMerge' }
2254 # @BlockDirtyBitmapSha256:
2256 # SHA256 hash of dirty bitmap data
2258 # @sha256: ASCII representation of SHA256 bitmap hash
2262 { 'struct': 'BlockDirtyBitmapSha256',
2263 'data': {'sha256': 'str'} }
2266 # @x-debug-block-dirty-bitmap-sha256:
2268 # Get bitmap SHA256.
2271 # @unstable: This command is meant for debugging.
2273 # Returns: - BlockDirtyBitmapSha256 on success
2274 # - If @node is not a valid block device, DeviceNotFound
2275 # - If @name is not found or if hashing has failed, GenericError with an
2280 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2281 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256',
2282 'features': [ 'unstable' ] }
2287 # Start mirroring a block device's writes to a new destination.
2289 # @job-id: identifier for the newly-created block job. If
2290 # omitted, the device name will be used. (Since 2.7)
2292 # @device: The device name or node-name of a root node whose writes should be
2295 # @target: the id or node-name of the block device to mirror to. This mustn't be
2296 # attached to guest.
2298 # @replaces: with sync=full graph node name to be replaced by the new
2299 # image when a whole image copy is done. This can be used to repair
2300 # broken Quorum files. By default, @device is replaced, although
2301 # implicitly created filters on it are kept.
2303 # @speed: the maximum speed, in bytes per second
2305 # @sync: what parts of the disk image should be copied to the destination
2306 # (all the disk, only the sectors allocated in the topmost image, or
2309 # @granularity: granularity of the dirty bitmap, default is 64K
2310 # if the image format doesn't have clusters, 4K if the clusters
2311 # are smaller than that, else the cluster size. Must be a
2312 # power of 2 between 512 and 64M
2314 # @buf-size: maximum amount of data in flight from source to
2317 # @on-source-error: the action to take on an error on the source,
2318 # default 'report'. 'stop' and 'enospc' can only be used
2319 # if the block device supports io-status (see BlockInfo).
2321 # @on-target-error: the action to take on an error on the target,
2322 # default 'report' (no limitations, since this applies to
2323 # a different block device than @device).
2325 # @filter-node-name: the node name that should be assigned to the
2326 # filter driver that the mirror job inserts into the graph
2327 # above @device. If this option is not given, a node name is
2328 # autogenerated. (Since: 2.9)
2330 # @copy-mode: when to copy data to the destination; defaults to 'background'
2333 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2334 # finished its work, waiting for @block-job-finalize before
2335 # making any block graph changes.
2336 # When true, this job will automatically
2337 # perform its abort or commit actions.
2338 # Defaults to true. (Since 3.1)
2340 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2341 # has completely ceased all work, and awaits @block-job-dismiss.
2342 # When true, this job will automatically disappear from the query
2343 # list without user intervention.
2344 # Defaults to true. (Since 3.1)
2345 # Returns: nothing on success.
2351 # -> { "execute": "blockdev-mirror",
2352 # "arguments": { "device": "ide-hd0",
2353 # "target": "target0",
2354 # "sync": "full" } }
2355 # <- { "return": {} }
2358 { 'command': 'blockdev-mirror',
2359 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2361 'sync': 'MirrorSyncMode',
2362 '*speed': 'int', '*granularity': 'uint32',
2363 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2364 '*on-target-error': 'BlockdevOnError',
2365 '*filter-node-name': 'str',
2366 '*copy-mode': 'MirrorCopyMode',
2367 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2372 # A set of parameters describing block throttling.
2374 # @device: Block device name
2376 # @id: The name or QOM path of the guest device (since: 2.8)
2378 # @bps: total throughput limit in bytes per second
2380 # @bps_rd: read throughput limit in bytes per second
2382 # @bps_wr: write throughput limit in bytes per second
2384 # @iops: total I/O operations per second
2386 # @iops_rd: read I/O operations per second
2388 # @iops_wr: write I/O operations per second
2390 # @bps_max: total throughput limit during bursts,
2391 # in bytes (Since 1.7)
2393 # @bps_rd_max: read throughput limit during bursts,
2394 # in bytes (Since 1.7)
2396 # @bps_wr_max: write throughput limit during bursts,
2397 # in bytes (Since 1.7)
2399 # @iops_max: total I/O operations per second during bursts,
2400 # in bytes (Since 1.7)
2402 # @iops_rd_max: read I/O operations per second during bursts,
2403 # in bytes (Since 1.7)
2405 # @iops_wr_max: write I/O operations per second during bursts,
2406 # in bytes (Since 1.7)
2408 # @bps_max_length: maximum length of the @bps_max burst
2409 # period, in seconds. It must only
2410 # be set if @bps_max is set as well.
2411 # Defaults to 1. (Since 2.6)
2413 # @bps_rd_max_length: maximum length of the @bps_rd_max
2414 # burst period, in seconds. It must only
2415 # be set if @bps_rd_max is set as well.
2416 # Defaults to 1. (Since 2.6)
2418 # @bps_wr_max_length: maximum length of the @bps_wr_max
2419 # burst period, in seconds. It must only
2420 # be set if @bps_wr_max is set as well.
2421 # Defaults to 1. (Since 2.6)
2423 # @iops_max_length: maximum length of the @iops burst
2424 # period, in seconds. It must only
2425 # be set if @iops_max is set as well.
2426 # Defaults to 1. (Since 2.6)
2428 # @iops_rd_max_length: maximum length of the @iops_rd_max
2429 # burst period, in seconds. It must only
2430 # be set if @iops_rd_max is set as well.
2431 # Defaults to 1. (Since 2.6)
2433 # @iops_wr_max_length: maximum length of the @iops_wr_max
2434 # burst period, in seconds. It must only
2435 # be set if @iops_wr_max is set as well.
2436 # Defaults to 1. (Since 2.6)
2438 # @iops_size: an I/O size in bytes (Since 1.7)
2440 # @group: throttle group name (Since 2.4)
2443 # @deprecated: Member @device is deprecated. Use @id instead.
2447 { 'struct': 'BlockIOThrottle',
2448 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
2449 '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2450 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2451 '*bps_max': 'int', '*bps_rd_max': 'int',
2452 '*bps_wr_max': 'int', '*iops_max': 'int',
2453 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2454 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2455 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2456 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2457 '*iops_size': 'int', '*group': 'str' } }
2462 # Limit parameters for throttling.
2463 # Since some limit combinations are illegal, limits should always be set in one
2464 # transaction. All fields are optional. When setting limits, if a field is
2465 # missing the current value is not changed.
2467 # @iops-total: limit total I/O operations per second
2468 # @iops-total-max: I/O operations burst
2469 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2470 # It must only be set if @iops-total-max is set as well.
2471 # @iops-read: limit read operations per second
2472 # @iops-read-max: I/O operations read burst
2473 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2474 # It must only be set if @iops-read-max is set as well.
2475 # @iops-write: limit write operations per second
2476 # @iops-write-max: I/O operations write burst
2477 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2478 # It must only be set if @iops-write-max is set as well.
2479 # @bps-total: limit total bytes per second
2480 # @bps-total-max: total bytes burst
2481 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2482 # It must only be set if @bps-total-max is set as well.
2483 # @bps-read: limit read bytes per second
2484 # @bps-read-max: total bytes read burst
2485 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2486 # It must only be set if @bps-read-max is set as well.
2487 # @bps-write: limit write bytes per second
2488 # @bps-write-max: total bytes write burst
2489 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2490 # It must only be set if @bps-write-max is set as well.
2491 # @iops-size: when limiting by iops max size of an I/O in bytes
2495 { 'struct': 'ThrottleLimits',
2496 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2497 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2498 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2499 '*iops-write' : 'int', '*iops-write-max' : 'int',
2500 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2501 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2502 '*bps-read' : 'int', '*bps-read-max' : 'int',
2503 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2504 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2505 '*iops-size' : 'int' } }
2508 # @ThrottleGroupProperties:
2510 # Properties for throttle-group objects.
2512 # @limits: limits to apply for this throttle group
2515 # @unstable: All members starting with x- are aliases for the same key
2516 # without x- in the @limits object. This is not a stable
2517 # interface and may be removed or changed incompatibly in
2518 # the future. Use @limits for a supported stable
2523 { 'struct': 'ThrottleGroupProperties',
2524 'data': { '*limits': 'ThrottleLimits',
2525 '*x-iops-total': { 'type': 'int',
2526 'features': [ 'unstable' ] },
2527 '*x-iops-total-max': { 'type': 'int',
2528 'features': [ 'unstable' ] },
2529 '*x-iops-total-max-length': { 'type': 'int',
2530 'features': [ 'unstable' ] },
2531 '*x-iops-read': { 'type': 'int',
2532 'features': [ 'unstable' ] },
2533 '*x-iops-read-max': { 'type': 'int',
2534 'features': [ 'unstable' ] },
2535 '*x-iops-read-max-length': { 'type': 'int',
2536 'features': [ 'unstable' ] },
2537 '*x-iops-write': { 'type': 'int',
2538 'features': [ 'unstable' ] },
2539 '*x-iops-write-max': { 'type': 'int',
2540 'features': [ 'unstable' ] },
2541 '*x-iops-write-max-length': { 'type': 'int',
2542 'features': [ 'unstable' ] },
2543 '*x-bps-total': { 'type': 'int',
2544 'features': [ 'unstable' ] },
2545 '*x-bps-total-max': { 'type': 'int',
2546 'features': [ 'unstable' ] },
2547 '*x-bps-total-max-length': { 'type': 'int',
2548 'features': [ 'unstable' ] },
2549 '*x-bps-read': { 'type': 'int',
2550 'features': [ 'unstable' ] },
2551 '*x-bps-read-max': { 'type': 'int',
2552 'features': [ 'unstable' ] },
2553 '*x-bps-read-max-length': { 'type': 'int',
2554 'features': [ 'unstable' ] },
2555 '*x-bps-write': { 'type': 'int',
2556 'features': [ 'unstable' ] },
2557 '*x-bps-write-max': { 'type': 'int',
2558 'features': [ 'unstable' ] },
2559 '*x-bps-write-max-length': { 'type': 'int',
2560 'features': [ 'unstable' ] },
2561 '*x-iops-size': { 'type': 'int',
2562 'features': [ 'unstable' ] } } }
2567 # Copy data from a backing file into a block device.
2569 # The block streaming operation is performed in the background until the entire
2570 # backing file has been copied. This command returns immediately once streaming
2571 # has started. The status of ongoing block streaming operations can be checked
2572 # with query-block-jobs. The operation can be stopped before it has completed
2573 # using the block-job-cancel command.
2575 # The node that receives the data is called the top image, can be located in
2576 # any part of the chain (but always above the base image; see below) and can be
2577 # specified using its device or node name. Earlier qemu versions only allowed
2578 # 'device' to name the top level node; presence of the 'base-node' parameter
2579 # during introspection can be used as a witness of the enhanced semantics
2582 # If a base file is specified then sectors are not copied from that base file and
2583 # its backing chain. This can be used to stream a subset of the backing file
2584 # chain instead of flattening the entire image.
2585 # When streaming completes the image file will have the base file as its backing
2586 # file, unless that node was changed while the job was running. In that case,
2587 # base's parent's backing (or filtered, whichever exists) child (i.e., base at
2588 # the beginning of the job) will be the new backing file.
2590 # On successful completion the image file is updated to drop the backing file
2591 # and the BLOCK_JOB_COMPLETED event is emitted.
2593 # In case @device is a filter node, block-stream modifies the first non-filter
2594 # overlay node below it to point to the new backing node instead of modifying
2597 # @job-id: identifier for the newly-created block job. If
2598 # omitted, the device name will be used. (Since 2.7)
2600 # @device: the device or node name of the top image
2602 # @base: the common backing file name.
2603 # It cannot be set if @base-node or @bottom is also set.
2605 # @base-node: the node name of the backing file.
2606 # It cannot be set if @base or @bottom is also set. (Since 2.8)
2608 # @bottom: the last node in the chain that should be streamed into
2609 # top. It cannot be set if @base or @base-node is also set.
2610 # It cannot be filter node. (Since 6.0)
2612 # @backing-file: The backing file string to write into the top
2613 # image. This filename is not validated.
2615 # If a pathname string is such that it cannot be
2616 # resolved by QEMU, that means that subsequent QMP or
2617 # HMP commands must use node-names for the image in
2618 # question, as filename lookup methods will fail.
2620 # If not specified, QEMU will automatically determine
2621 # the backing file string to use, or error out if there
2622 # is no obvious choice. Care should be taken when
2623 # specifying the string, to specify a valid filename or
2627 # @speed: the maximum speed, in bytes per second
2629 # @on-error: the action to take on an error (default report).
2630 # 'stop' and 'enospc' can only be used if the block device
2631 # supports io-status (see BlockInfo). Since 1.3.
2633 # @filter-node-name: the node name that should be assigned to the
2634 # filter driver that the stream job inserts into the graph
2635 # above @device. If this option is not given, a node name is
2636 # autogenerated. (Since: 6.0)
2638 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2639 # finished its work, waiting for @block-job-finalize before
2640 # making any block graph changes.
2641 # When true, this job will automatically
2642 # perform its abort or commit actions.
2643 # Defaults to true. (Since 3.1)
2645 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2646 # has completely ceased all work, and awaits @block-job-dismiss.
2647 # When true, this job will automatically disappear from the query
2648 # list without user intervention.
2649 # Defaults to true. (Since 3.1)
2651 # Returns: - Nothing on success.
2652 # - If @device does not exist, DeviceNotFound.
2658 # -> { "execute": "block-stream",
2659 # "arguments": { "device": "virtio0",
2660 # "base": "/tmp/master.qcow2" } }
2661 # <- { "return": {} }
2664 { 'command': 'block-stream',
2665 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2666 '*base-node': 'str', '*backing-file': 'str', '*bottom': 'str',
2667 '*speed': 'int', '*on-error': 'BlockdevOnError',
2668 '*filter-node-name': 'str',
2669 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2672 # @block-job-set-speed:
2674 # Set maximum speed for a background block operation.
2676 # This command can only be issued when there is an active block job.
2678 # Throttling can be disabled by setting the speed to 0.
2680 # @device: The job identifier. This used to be a device name (hence
2681 # the name of the parameter), but since QEMU 2.7 it can have
2684 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2687 # Returns: - Nothing on success
2688 # - If no background operation is active on this device, DeviceNotActive
2692 { 'command': 'block-job-set-speed',
2693 'data': { 'device': 'str', 'speed': 'int' } }
2696 # @block-job-cancel:
2698 # Stop an active background block operation.
2700 # This command returns immediately after marking the active background block
2701 # operation for cancellation. It is an error to call this command if no
2702 # operation is in progress.
2704 # The operation will cancel as soon as possible and then emit the
2705 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2706 # enumerated using query-block-jobs.
2708 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2709 # (via the event BLOCK_JOB_READY) that the source and destination are
2710 # synchronized, then the event triggered by this command changes to
2711 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2712 # destination now has a point-in-time copy tied to the time of the cancellation.
2714 # For streaming, the image file retains its backing file unless the streaming
2715 # operation happens to complete just as it is being cancelled. A new streaming
2716 # operation can be started at a later time to finish copying all data from the
2719 # @device: The job identifier. This used to be a device name (hence
2720 # the name of the parameter), but since QEMU 2.7 it can have
2723 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2724 # abandon the job immediately (even if it is paused) instead of waiting
2725 # for the destination to complete its final synchronization (since 1.3)
2727 # Returns: - Nothing on success
2728 # - If no background operation is active on this device, DeviceNotActive
2732 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2737 # Pause an active background block operation.
2739 # This command returns immediately after marking the active background block
2740 # operation for pausing. It is an error to call this command if no
2741 # operation is in progress or if the job is already paused.
2743 # The operation will pause as soon as possible. No event is emitted when
2744 # the operation is actually paused. Cancelling a paused job automatically
2747 # @device: The job identifier. This used to be a device name (hence
2748 # the name of the parameter), but since QEMU 2.7 it can have
2751 # Returns: - Nothing on success
2752 # - If no background operation is active on this device, DeviceNotActive
2756 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2759 # @block-job-resume:
2761 # Resume an active background block operation.
2763 # This command returns immediately after resuming a paused background block
2764 # operation. It is an error to call this command if no operation is in
2765 # progress or if the job is not paused.
2767 # This command also clears the error status of the job.
2769 # @device: The job identifier. This used to be a device name (hence
2770 # the name of the parameter), but since QEMU 2.7 it can have
2773 # Returns: - Nothing on success
2774 # - If no background operation is active on this device, DeviceNotActive
2778 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2781 # @block-job-complete:
2783 # Manually trigger completion of an active background block operation. This
2784 # is supported for drive mirroring, where it also switches the device to
2785 # write to the target path only. The ability to complete is signaled with
2786 # a BLOCK_JOB_READY event.
2788 # This command completes an active background block operation synchronously.
2789 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2790 # is not defined. Note that if an I/O error occurs during the processing of
2791 # this command: 1) the command itself will fail; 2) the error will be processed
2792 # according to the rerror/werror arguments that were specified when starting
2795 # A cancelled or paused job cannot be completed.
2797 # @device: The job identifier. This used to be a device name (hence
2798 # the name of the parameter), but since QEMU 2.7 it can have
2801 # Returns: - Nothing on success
2802 # - If no background operation is active on this device, DeviceNotActive
2806 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2809 # @block-job-dismiss:
2811 # For jobs that have already concluded, remove them from the block-job-query
2812 # list. This command only needs to be run for jobs which were started with
2813 # QEMU 2.12+ job lifetime management semantics.
2815 # This command will refuse to operate on any job that has not yet reached
2816 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2817 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2818 # to be used as appropriate.
2820 # @id: The job identifier.
2822 # Returns: Nothing on success
2826 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2829 # @block-job-finalize:
2831 # Once a job that has manual=true reaches the pending state, it can be
2832 # instructed to finalize any graph changes and do any necessary cleanup
2834 # For jobs in a transaction, instructing one job to finalize will force
2835 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2836 # a single member job to finalize.
2838 # @id: The job identifier.
2840 # Returns: Nothing on success
2844 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2847 # @BlockdevDiscardOptions:
2849 # Determines how to handle discard requests.
2851 # @ignore: Ignore the request
2852 # @unmap: Forward as an unmap request
2856 { 'enum': 'BlockdevDiscardOptions',
2857 'data': [ 'ignore', 'unmap' ] }
2860 # @BlockdevDetectZeroesOptions:
2862 # Describes the operation mode for the automatic conversion of plain
2863 # zero writes by the OS to driver specific optimized zero write commands.
2865 # @off: Disabled (default)
2867 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2868 # also that @BlockdevDiscardOptions is set to unmap for this device.
2872 { 'enum': 'BlockdevDetectZeroesOptions',
2873 'data': [ 'off', 'on', 'unmap' ] }
2876 # @BlockdevAioOptions:
2878 # Selects the AIO backend to handle I/O requests
2880 # @threads: Use qemu's thread pool
2881 # @native: Use native AIO backend (only Linux and Windows)
2882 # @io_uring: Use linux io_uring (since 5.0)
2886 { 'enum': 'BlockdevAioOptions',
2887 'data': [ 'threads', 'native',
2888 { 'name': 'io_uring', 'if': 'CONFIG_LINUX_IO_URING' } ] }
2891 # @BlockdevCacheOptions:
2893 # Includes cache-related options for block devices
2895 # @direct: enables use of O_DIRECT (bypass the host page cache;
2897 # @no-flush: ignore any flush requests for the device (default:
2902 { 'struct': 'BlockdevCacheOptions',
2903 'data': { '*direct': 'bool',
2904 '*no-flush': 'bool' } }
2909 # Drivers that are supported in block device operations.
2911 # @throttle: Since 2.11
2913 # @copy-on-read: Since 3.0
2914 # @blklogwrites: Since 3.0
2915 # @blkreplay: Since 4.2
2916 # @compress: Since 5.0
2917 # @copy-before-write: Since 6.2
2918 # @snapshot-access: Since 7.0
2922 { 'enum': 'BlockdevDriver',
2923 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
2924 'cloop', 'compress', 'copy-before-write', 'copy-on-read', 'dmg',
2925 'file', 'snapshot-access', 'ftp', 'ftps', 'gluster',
2926 {'name': 'host_cdrom', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
2927 {'name': 'host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
2928 'http', 'https', 'iscsi',
2929 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
2930 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
2931 { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
2932 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
2935 # @BlockdevOptionsFile:
2937 # Driver specific block device options for the file backend.
2939 # @filename: path to the image file
2940 # @pr-manager: the id for the object that will handle persistent reservations
2941 # for this device (default: none, forward the commands via SG_IO;
2943 # @aio: AIO backend (default: threads) (since: 2.8)
2944 # @aio-max-batch: maximum number of requests to batch together into a single
2945 # submission in the AIO backend. The smallest value between
2946 # this and the aio-max-batch value of the IOThread object is
2948 # 0 means that the AIO backend will handle it automatically.
2949 # (default: 0, since 6.2)
2950 # @locking: whether to enable file locking. If set to 'auto', only enable
2951 # when Open File Descriptor (OFD) locking API is available
2952 # (default: auto, since 2.10)
2953 # @drop-cache: invalidate page cache during live migration. This prevents
2954 # stale data on the migration destination with cache.direct=off.
2955 # Currently only supported on Linux hosts.
2956 # (default: on, since: 4.0)
2957 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2958 # migration. May cause noticeable delays if the image
2959 # file is large, do not use in production.
2960 # (default: off) (since: 3.0)
2963 # @dynamic-auto-read-only: If present, enabled auto-read-only means that the
2964 # driver will open the image read-only at first,
2965 # dynamically reopen the image file read-write when
2966 # the first writer is attached to the node and reopen
2967 # read-only when the last writer is detached. This
2968 # allows giving QEMU write permissions only on demand
2969 # when an operation actually needs write access.
2970 # @unstable: Member x-check-cache-dropped is meant for debugging.
2974 { 'struct': 'BlockdevOptionsFile',
2975 'data': { 'filename': 'str',
2976 '*pr-manager': 'str',
2977 '*locking': 'OnOffAuto',
2978 '*aio': 'BlockdevAioOptions',
2979 '*aio-max-batch': 'int',
2980 '*drop-cache': {'type': 'bool',
2981 'if': 'CONFIG_LINUX'},
2982 '*x-check-cache-dropped': { 'type': 'bool',
2983 'features': [ 'unstable' ] } },
2984 'features': [ { 'name': 'dynamic-auto-read-only',
2985 'if': 'CONFIG_POSIX' } ] }
2988 # @BlockdevOptionsNull:
2990 # Driver specific block device options for the null backend.
2992 # @size: size of the device in bytes.
2993 # @latency-ns: emulated latency (in nanoseconds) in processing
2994 # requests. Default to zero which completes requests immediately.
2996 # @read-zeroes: if true, reads from the device produce zeroes; if false, the
2997 # buffer is left unchanged. (default: false; since: 4.1)
3001 { 'struct': 'BlockdevOptionsNull',
3002 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
3005 # @BlockdevOptionsNVMe:
3007 # Driver specific block device options for the NVMe backend.
3009 # @device: PCI controller address of the NVMe device in
3010 # format hhhh:bb:ss.f (host:bus:slot.function)
3011 # @namespace: namespace number of the device, starting from 1.
3013 # Note that the PCI @device must have been unbound from any host
3014 # kernel driver before instructing QEMU to add the blockdev.
3018 { 'struct': 'BlockdevOptionsNVMe',
3019 'data': { 'device': 'str', 'namespace': 'int' } }
3022 # @BlockdevOptionsVVFAT:
3024 # Driver specific block device options for the vvfat protocol.
3026 # @dir: directory to be exported as FAT image
3027 # @fat-type: FAT type: 12, 16 or 32
3028 # @floppy: whether to export a floppy image (true) or
3029 # partitioned hard disk (false; default)
3030 # @label: set the volume label, limited to 11 bytes. FAT16 and
3031 # FAT32 traditionally have some restrictions on labels, which are
3032 # ignored by most operating systems. Defaults to "QEMU VVFAT".
3034 # @rw: whether to allow write operations (default: false)
3038 { 'struct': 'BlockdevOptionsVVFAT',
3039 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
3040 '*label': 'str', '*rw': 'bool' } }
3043 # @BlockdevOptionsGenericFormat:
3045 # Driver specific block device options for image format that have no option
3046 # besides their data source.
3048 # @file: reference to or definition of the data source block device
3052 { 'struct': 'BlockdevOptionsGenericFormat',
3053 'data': { 'file': 'BlockdevRef' } }
3056 # @BlockdevOptionsLUKS:
3058 # Driver specific block device options for LUKS.
3060 # @key-secret: the ID of a QCryptoSecret object providing
3061 # the decryption key (since 2.6). Mandatory except when
3062 # doing a metadata-only probe of the image.
3066 { 'struct': 'BlockdevOptionsLUKS',
3067 'base': 'BlockdevOptionsGenericFormat',
3068 'data': { '*key-secret': 'str' } }
3072 # @BlockdevOptionsGenericCOWFormat:
3074 # Driver specific block device options for image format that have no option
3075 # besides their data source and an optional backing file.
3077 # @backing: reference to or definition of the backing file block
3078 # device, null disables the backing file entirely.
3079 # Defaults to the backing file stored the image file.
3083 { 'struct': 'BlockdevOptionsGenericCOWFormat',
3084 'base': 'BlockdevOptionsGenericFormat',
3085 'data': { '*backing': 'BlockdevRefOrNull' } }
3088 # @Qcow2OverlapCheckMode:
3090 # General overlap check modes.
3092 # @none: Do not perform any checks
3094 # @constant: Perform only checks which can be done in constant time and
3095 # without reading anything from disk
3097 # @cached: Perform only checks which can be done without reading anything
3100 # @all: Perform all available overlap checks
3104 { 'enum': 'Qcow2OverlapCheckMode',
3105 'data': [ 'none', 'constant', 'cached', 'all' ] }
3108 # @Qcow2OverlapCheckFlags:
3110 # Structure of flags for each metadata structure. Setting a field to 'true'
3111 # makes qemu guard that structure against unintended overwriting. The default
3112 # value is chosen according to the template given.
3114 # @template: Specifies a template mode which can be adjusted using the other
3115 # flags, defaults to 'cached'
3117 # @bitmap-directory: since 3.0
3121 { 'struct': 'Qcow2OverlapCheckFlags',
3122 'data': { '*template': 'Qcow2OverlapCheckMode',
3123 '*main-header': 'bool',
3124 '*active-l1': 'bool',
3125 '*active-l2': 'bool',
3126 '*refcount-table': 'bool',
3127 '*refcount-block': 'bool',
3128 '*snapshot-table': 'bool',
3129 '*inactive-l1': 'bool',
3130 '*inactive-l2': 'bool',
3131 '*bitmap-directory': 'bool' } }
3134 # @Qcow2OverlapChecks:
3136 # Specifies which metadata structures should be guarded against unintended
3139 # @flags: set of flags for separate specification of each metadata structure
3142 # @mode: named mode which chooses a specific set of flags
3146 { 'alternate': 'Qcow2OverlapChecks',
3147 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3148 'mode': 'Qcow2OverlapCheckMode' } }
3151 # @BlockdevQcowEncryptionFormat:
3153 # @aes: AES-CBC with plain64 initialization vectors
3157 { 'enum': 'BlockdevQcowEncryptionFormat',
3161 # @BlockdevQcowEncryption:
3165 { 'union': 'BlockdevQcowEncryption',
3166 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3167 'discriminator': 'format',
3168 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3171 # @BlockdevOptionsQcow:
3173 # Driver specific block device options for qcow.
3175 # @encrypt: Image decryption options. Mandatory for
3176 # encrypted images, except when doing a metadata-only
3177 # probe of the image.
3181 { 'struct': 'BlockdevOptionsQcow',
3182 'base': 'BlockdevOptionsGenericCOWFormat',
3183 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3188 # @BlockdevQcow2EncryptionFormat:
3190 # @aes: AES-CBC with plain64 initialization vectors
3194 { 'enum': 'BlockdevQcow2EncryptionFormat',
3195 'data': [ 'aes', 'luks' ] }
3198 # @BlockdevQcow2Encryption:
3202 { 'union': 'BlockdevQcow2Encryption',
3203 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3204 'discriminator': 'format',
3205 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3206 'luks': 'QCryptoBlockOptionsLUKS'} }
3209 # @BlockdevOptionsPreallocate:
3211 # Filter driver intended to be inserted between format and protocol node
3212 # and do preallocation in protocol node on write.
3214 # @prealloc-align: on preallocation, align file length to this number,
3215 # default 1048576 (1M)
3217 # @prealloc-size: how much to preallocate, default 134217728 (128M)
3221 { 'struct': 'BlockdevOptionsPreallocate',
3222 'base': 'BlockdevOptionsGenericFormat',
3223 'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } }
3226 # @BlockdevOptionsQcow2:
3228 # Driver specific block device options for qcow2.
3230 # @lazy-refcounts: whether to enable the lazy refcounts
3231 # feature (default is taken from the image file)
3233 # @pass-discard-request: whether discard requests to the qcow2
3234 # device should be forwarded to the data source
3236 # @pass-discard-snapshot: whether discard requests for the data source
3237 # should be issued when a snapshot operation (e.g.
3238 # deleting a snapshot) frees clusters in the qcow2 file
3240 # @pass-discard-other: whether discard requests for the data source
3241 # should be issued on other occasions where a cluster
3244 # @overlap-check: which overlap checks to perform for writes
3245 # to the image, defaults to 'cached' (since 2.2)
3247 # @cache-size: the maximum total size of the L2 table and
3248 # refcount block caches in bytes (since 2.2)
3250 # @l2-cache-size: the maximum size of the L2 table cache in
3253 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3254 # bytes. It must be a power of two between 512
3255 # and the cluster size. The default value is
3256 # the cluster size (since 2.12)
3258 # @refcount-cache-size: the maximum size of the refcount block cache
3259 # in bytes (since 2.2)
3261 # @cache-clean-interval: clean unused entries in the L2 and refcount
3262 # caches. The interval is in seconds. The default value
3263 # is 600 on supporting platforms, and 0 on other
3264 # platforms. 0 disables this feature. (since 2.5)
3266 # @encrypt: Image decryption options. Mandatory for
3267 # encrypted images, except when doing a metadata-only
3268 # probe of the image. (since 2.10)
3270 # @data-file: reference to or definition of the external data file.
3271 # This may only be specified for images that require an
3272 # external data file. If it is not specified for such
3273 # an image, the data file name is loaded from the image
3278 { 'struct': 'BlockdevOptionsQcow2',
3279 'base': 'BlockdevOptionsGenericCOWFormat',
3280 'data': { '*lazy-refcounts': 'bool',
3281 '*pass-discard-request': 'bool',
3282 '*pass-discard-snapshot': 'bool',
3283 '*pass-discard-other': 'bool',
3284 '*overlap-check': 'Qcow2OverlapChecks',
3285 '*cache-size': 'int',
3286 '*l2-cache-size': 'int',
3287 '*l2-cache-entry-size': 'int',
3288 '*refcount-cache-size': 'int',
3289 '*cache-clean-interval': 'int',
3290 '*encrypt': 'BlockdevQcow2Encryption',
3291 '*data-file': 'BlockdevRef' } }
3294 # @SshHostKeyCheckMode:
3296 # @none: Don't check the host key at all
3297 # @hash: Compare the host key with a given hash
3298 # @known_hosts: Check the host key against the known_hosts file
3302 { 'enum': 'SshHostKeyCheckMode',
3303 'data': [ 'none', 'hash', 'known_hosts' ] }
3306 # @SshHostKeyCheckHashType:
3308 # @md5: The given hash is an md5 hash
3309 # @sha1: The given hash is an sha1 hash
3310 # @sha256: The given hash is an sha256 hash
3314 { 'enum': 'SshHostKeyCheckHashType',
3315 'data': [ 'md5', 'sha1', 'sha256' ] }
3320 # @type: The hash algorithm used for the hash
3321 # @hash: The expected hash value
3325 { 'struct': 'SshHostKeyHash',
3326 'data': { 'type': 'SshHostKeyCheckHashType',
3334 { 'union': 'SshHostKeyCheck',
3335 'base': { 'mode': 'SshHostKeyCheckMode' },
3336 'discriminator': 'mode',
3337 'data': { 'hash': 'SshHostKeyHash' } }
3340 # @BlockdevOptionsSsh:
3342 # @server: host address
3344 # @path: path to the image on the host
3346 # @user: user as which to connect, defaults to current
3349 # @host-key-check: Defines how and what to check the host key against
3350 # (default: known_hosts)
3354 { 'struct': 'BlockdevOptionsSsh',
3355 'data': { 'server': 'InetSocketAddress',
3358 '*host-key-check': 'SshHostKeyCheck' } }
3364 # Trigger events supported by blkdebug.
3366 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3369 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3371 # @cor_write: a write due to copy-on-read (since 2.11)
3373 # @cluster_alloc_space: an allocation of file space for a cluster (since 4.1)
3375 # @none: triggers once at creation of the blkdebug node (since 4.1)
3379 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3380 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3381 'l1_grow_activate_table', 'l2_load', 'l2_update',
3382 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3383 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3384 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3385 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3386 'refblock_load', 'refblock_update', 'refblock_update_part',
3387 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3388 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3389 'refblock_alloc_switch_table', 'cluster_alloc',
3390 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3391 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3392 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3393 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3394 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3395 'cor_write', 'cluster_alloc_space', 'none'] }
3400 # Kinds of I/O that blkdebug can inject errors in.
3402 # @read: .bdrv_co_preadv()
3404 # @write: .bdrv_co_pwritev()
3406 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3408 # @discard: .bdrv_co_pdiscard()
3410 # @flush: .bdrv_co_flush_to_disk()
3412 # @block-status: .bdrv_co_block_status()
3416 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3417 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3421 # @BlkdebugInjectErrorOptions:
3423 # Describes a single error injection for blkdebug.
3425 # @event: trigger event
3427 # @state: the state identifier blkdebug needs to be in to
3428 # actually trigger the event; defaults to "any"
3430 # @iotype: the type of I/O operations on which this error should
3431 # be injected; defaults to "all read, write,
3432 # write-zeroes, discard, and flush operations"
3435 # @errno: error identifier (errno) to be returned; defaults to
3438 # @sector: specifies the sector index which has to be affected
3439 # in order to actually trigger the event; defaults to "any
3442 # @once: disables further events after this one has been
3443 # triggered; defaults to false
3445 # @immediately: fail immediately; defaults to false
3449 { 'struct': 'BlkdebugInjectErrorOptions',
3450 'data': { 'event': 'BlkdebugEvent',
3452 '*iotype': 'BlkdebugIOType',
3456 '*immediately': 'bool' } }
3459 # @BlkdebugSetStateOptions:
3461 # Describes a single state-change event for blkdebug.
3463 # @event: trigger event
3465 # @state: the current state identifier blkdebug needs to be in;
3468 # @new_state: the state identifier blkdebug is supposed to assume if
3469 # this event is triggered
3473 { 'struct': 'BlkdebugSetStateOptions',
3474 'data': { 'event': 'BlkdebugEvent',
3476 'new_state': 'int' } }
3479 # @BlockdevOptionsBlkdebug:
3481 # Driver specific block device options for blkdebug.
3483 # @image: underlying raw block device (or image file)
3485 # @config: filename of the configuration file
3487 # @align: required alignment for requests in bytes, must be
3488 # positive power of 2, or 0 for default
3490 # @max-transfer: maximum size for I/O transfers in bytes, must be
3491 # positive multiple of @align and of the underlying
3492 # file's request alignment (but need not be a power of
3493 # 2), or 0 for default (since 2.10)
3495 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3496 # must be positive multiple of @align and of the
3497 # underlying file's request alignment (but need not be a
3498 # power of 2), or 0 for default (since 2.10)
3500 # @max-write-zero: maximum size for write zero requests in bytes, must be
3501 # positive multiple of @align, of @opt-write-zero, and of
3502 # the underlying file's request alignment (but need not
3503 # be a power of 2), or 0 for default (since 2.10)
3505 # @opt-discard: preferred alignment for discard requests in bytes, must
3506 # be positive multiple of @align and of the underlying
3507 # file's request alignment (but need not be a power of
3508 # 2), or 0 for default (since 2.10)
3510 # @max-discard: maximum size for discard requests in bytes, must be
3511 # positive multiple of @align, of @opt-discard, and of
3512 # the underlying file's request alignment (but need not
3513 # be a power of 2), or 0 for default (since 2.10)
3515 # @inject-error: array of error injection descriptions
3517 # @set-state: array of state-change descriptions
3519 # @take-child-perms: Permissions to take on @image in addition to what
3520 # is necessary anyway (which depends on how the
3521 # blkdebug node is used). Defaults to none.
3524 # @unshare-child-perms: Permissions not to share on @image in addition
3525 # to what cannot be shared anyway (which depends
3526 # on how the blkdebug node is used). Defaults
3527 # to none. (since 5.0)
3531 { 'struct': 'BlockdevOptionsBlkdebug',
3532 'data': { 'image': 'BlockdevRef',
3534 '*align': 'int', '*max-transfer': 'int32',
3535 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3536 '*opt-discard': 'int32', '*max-discard': 'int32',
3537 '*inject-error': ['BlkdebugInjectErrorOptions'],
3538 '*set-state': ['BlkdebugSetStateOptions'],
3539 '*take-child-perms': ['BlockPermission'],
3540 '*unshare-child-perms': ['BlockPermission'] } }
3543 # @BlockdevOptionsBlklogwrites:
3545 # Driver specific block device options for blklogwrites.
3547 # @file: block device
3549 # @log: block device used to log writes to @file
3551 # @log-sector-size: sector size used in logging writes to @file, determines
3552 # granularity of offsets and sizes of writes (default: 512)
3554 # @log-append: append to an existing log (default: false)
3556 # @log-super-update-interval: interval of write requests after which the log
3557 # super block is updated to disk (default: 4096)
3561 { 'struct': 'BlockdevOptionsBlklogwrites',
3562 'data': { 'file': 'BlockdevRef',
3563 'log': 'BlockdevRef',
3564 '*log-sector-size': 'uint32',
3565 '*log-append': 'bool',
3566 '*log-super-update-interval': 'uint64' } }
3569 # @BlockdevOptionsBlkverify:
3571 # Driver specific block device options for blkverify.
3573 # @test: block device to be tested
3575 # @raw: raw image used for verification
3579 { 'struct': 'BlockdevOptionsBlkverify',
3580 'data': { 'test': 'BlockdevRef',
3581 'raw': 'BlockdevRef' } }
3584 # @BlockdevOptionsBlkreplay:
3586 # Driver specific block device options for blkreplay.
3588 # @image: disk image which should be controlled with blkreplay
3592 { 'struct': 'BlockdevOptionsBlkreplay',
3593 'data': { 'image': 'BlockdevRef' } }
3596 # @QuorumReadPattern:
3598 # An enumeration of quorum read patterns.
3600 # @quorum: read all the children and do a quorum vote on reads
3602 # @fifo: read only from the first child that has not failed
3606 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3609 # @BlockdevOptionsQuorum:
3611 # Driver specific block device options for Quorum
3613 # @blkverify: true if the driver must print content mismatch
3614 # set to false by default
3616 # @children: the children block devices to use
3618 # @vote-threshold: the vote limit under which a read will fail
3620 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3623 # @read-pattern: choose read pattern and set to quorum by default
3628 { 'struct': 'BlockdevOptionsQuorum',
3629 'data': { '*blkverify': 'bool',
3630 'children': [ 'BlockdevRef' ],
3631 'vote-threshold': 'int',
3632 '*rewrite-corrupted': 'bool',
3633 '*read-pattern': 'QuorumReadPattern' } }
3636 # @BlockdevOptionsGluster:
3638 # Driver specific block device options for Gluster
3640 # @volume: name of gluster volume where VM image resides
3642 # @path: absolute path to image file in gluster volume
3644 # @server: gluster servers description
3646 # @debug: libgfapi log level (default '4' which is Error)
3649 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3653 { 'struct': 'BlockdevOptionsGluster',
3654 'data': { 'volume': 'str',
3656 'server': ['SocketAddress'],
3658 '*logfile': 'str' } }
3663 # An enumeration of libiscsi transport types
3667 { 'enum': 'IscsiTransport',
3668 'data': [ 'tcp', 'iser' ] }
3671 # @IscsiHeaderDigest:
3673 # An enumeration of header digests supported by libiscsi
3677 { 'enum': 'IscsiHeaderDigest',
3678 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3679 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3682 # @BlockdevOptionsIscsi:
3684 # @transport: The iscsi transport type
3686 # @portal: The address of the iscsi portal
3688 # @target: The target iqn name
3690 # @lun: LUN to connect to. Defaults to 0.
3692 # @user: User name to log in with. If omitted, no CHAP
3693 # authentication is performed.
3695 # @password-secret: The ID of a QCryptoSecret object providing
3696 # the password for the login. This option is required if
3697 # @user is specified.
3699 # @initiator-name: The iqn name we want to identify to the target
3700 # as. If this option is not specified, an initiator name is
3701 # generated automatically.
3703 # @header-digest: The desired header digest. Defaults to
3706 # @timeout: Timeout in seconds after which a request will
3707 # timeout. 0 means no timeout and is the default.
3709 # Driver specific block device options for iscsi
3713 { 'struct': 'BlockdevOptionsIscsi',
3714 'data': { 'transport': 'IscsiTransport',
3719 '*password-secret': 'str',
3720 '*initiator-name': 'str',
3721 '*header-digest': 'IscsiHeaderDigest',
3722 '*timeout': 'int' } }
3730 { 'enum': 'RbdAuthMode',
3731 'data': [ 'cephx', 'none' ] }
3734 # @RbdImageEncryptionFormat:
3738 { 'enum': 'RbdImageEncryptionFormat',
3739 'data': [ 'luks', 'luks2' ] }
3742 # @RbdEncryptionOptionsLUKSBase:
3744 # @key-secret: ID of a QCryptoSecret object providing a passphrase
3745 # for unlocking the encryption
3749 { 'struct': 'RbdEncryptionOptionsLUKSBase',
3750 'data': { 'key-secret': 'str' } }
3753 # @RbdEncryptionCreateOptionsLUKSBase:
3755 # @cipher-alg: The encryption algorithm
3759 { 'struct': 'RbdEncryptionCreateOptionsLUKSBase',
3760 'base': 'RbdEncryptionOptionsLUKSBase',
3761 'data': { '*cipher-alg': 'QCryptoCipherAlgorithm' } }
3764 # @RbdEncryptionOptionsLUKS:
3768 { 'struct': 'RbdEncryptionOptionsLUKS',
3769 'base': 'RbdEncryptionOptionsLUKSBase',
3773 # @RbdEncryptionOptionsLUKS2:
3777 { 'struct': 'RbdEncryptionOptionsLUKS2',
3778 'base': 'RbdEncryptionOptionsLUKSBase',
3782 # @RbdEncryptionCreateOptionsLUKS:
3786 { 'struct': 'RbdEncryptionCreateOptionsLUKS',
3787 'base': 'RbdEncryptionCreateOptionsLUKSBase',
3791 # @RbdEncryptionCreateOptionsLUKS2:
3795 { 'struct': 'RbdEncryptionCreateOptionsLUKS2',
3796 'base': 'RbdEncryptionCreateOptionsLUKSBase',
3800 # @RbdEncryptionOptions:
3804 { 'union': 'RbdEncryptionOptions',
3805 'base': { 'format': 'RbdImageEncryptionFormat' },
3806 'discriminator': 'format',
3807 'data': { 'luks': 'RbdEncryptionOptionsLUKS',
3808 'luks2': 'RbdEncryptionOptionsLUKS2' } }
3811 # @RbdEncryptionCreateOptions:
3815 { 'union': 'RbdEncryptionCreateOptions',
3816 'base': { 'format': 'RbdImageEncryptionFormat' },
3817 'discriminator': 'format',
3818 'data': { 'luks': 'RbdEncryptionCreateOptionsLUKS',
3819 'luks2': 'RbdEncryptionCreateOptionsLUKS2' } }
3822 # @BlockdevOptionsRbd:
3824 # @pool: Ceph pool name.
3826 # @namespace: Rados namespace name in the Ceph pool. (Since 5.0)
3828 # @image: Image name in the Ceph pool.
3830 # @conf: path to Ceph configuration file. Values
3831 # in the configuration file will be overridden by
3832 # options specified via QAPI.
3834 # @snapshot: Ceph snapshot name.
3836 # @encrypt: Image encryption options. (Since 6.1)
3838 # @user: Ceph id name.
3840 # @auth-client-required: Acceptable authentication modes.
3841 # This maps to Ceph configuration option
3842 # "auth_client_required". (Since 3.0)
3844 # @key-secret: ID of a QCryptoSecret object providing a key
3845 # for cephx authentication.
3846 # This maps to Ceph configuration option
3847 # "key". (Since 3.0)
3849 # @server: Monitor host address and port. This maps
3850 # to the "mon_host" Ceph option.
3854 { 'struct': 'BlockdevOptionsRbd',
3855 'data': { 'pool': 'str',
3856 '*namespace': 'str',
3860 '*encrypt': 'RbdEncryptionOptions',
3862 '*auth-client-required': ['RbdAuthMode'],
3863 '*key-secret': 'str',
3864 '*server': ['InetSocketAddressBase'] } }
3869 # An enumeration of replication modes.
3871 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3873 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3877 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3878 'if': 'CONFIG_REPLICATION' }
3881 # @BlockdevOptionsReplication:
3883 # Driver specific block device options for replication
3885 # @mode: the replication mode
3887 # @top-id: In secondary mode, node name or device ID of the root
3888 # node who owns the replication node chain. Must not be given in
3893 { 'struct': 'BlockdevOptionsReplication',
3894 'base': 'BlockdevOptionsGenericFormat',
3895 'data': { 'mode': 'ReplicationMode',
3897 'if': 'CONFIG_REPLICATION' }
3902 # An enumeration of NFS transport types
3904 # @inet: TCP transport
3908 { 'enum': 'NFSTransport',
3909 'data': [ 'inet' ] }
3914 # Captures the address of the socket
3916 # @type: transport type used for NFS (only TCP supported)
3918 # @host: host address for NFS server
3922 { 'struct': 'NFSServer',
3923 'data': { 'type': 'NFSTransport',
3927 # @BlockdevOptionsNfs:
3929 # Driver specific block device option for NFS
3931 # @server: host address
3933 # @path: path of the image on the host
3935 # @user: UID value to use when talking to the
3936 # server (defaults to 65534 on Windows and getuid()
3939 # @group: GID value to use when talking to the
3940 # server (defaults to 65534 on Windows and getgid()
3943 # @tcp-syn-count: number of SYNs during the session
3944 # establishment (defaults to libnfs default)
3946 # @readahead-size: set the readahead size in bytes (defaults
3947 # to libnfs default)
3949 # @page-cache-size: set the pagecache size in bytes (defaults
3950 # to libnfs default)
3952 # @debug: set the NFS debug level (max 2) (defaults
3953 # to libnfs default)
3957 { 'struct': 'BlockdevOptionsNfs',
3958 'data': { 'server': 'NFSServer',
3962 '*tcp-syn-count': 'int',
3963 '*readahead-size': 'int',
3964 '*page-cache-size': 'int',
3968 # @BlockdevOptionsCurlBase:
3970 # Driver specific block device options shared by all protocols supported by the
3973 # @url: URL of the image file
3975 # @readahead: Size of the read-ahead cache; must be a multiple of
3976 # 512 (defaults to 256 kB)
3978 # @timeout: Timeout for connections, in seconds (defaults to 5)
3980 # @username: Username for authentication (defaults to none)
3982 # @password-secret: ID of a QCryptoSecret object providing a password
3983 # for authentication (defaults to no password)
3985 # @proxy-username: Username for proxy authentication (defaults to none)
3987 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3988 # for proxy authentication (defaults to no password)
3992 { 'struct': 'BlockdevOptionsCurlBase',
3993 'data': { 'url': 'str',
3994 '*readahead': 'int',
3997 '*password-secret': 'str',
3998 '*proxy-username': 'str',
3999 '*proxy-password-secret': 'str' } }
4002 # @BlockdevOptionsCurlHttp:
4004 # Driver specific block device options for HTTP connections over the curl
4005 # backend. URLs must start with "http://".
4007 # @cookie: List of cookies to set; format is
4008 # "name1=content1; name2=content2;" as explained by
4009 # CURLOPT_COOKIE(3). Defaults to no cookies.
4011 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
4012 # secure way. See @cookie for the format. (since 2.10)
4016 { 'struct': 'BlockdevOptionsCurlHttp',
4017 'base': 'BlockdevOptionsCurlBase',
4018 'data': { '*cookie': 'str',
4019 '*cookie-secret': 'str'} }
4022 # @BlockdevOptionsCurlHttps:
4024 # Driver specific block device options for HTTPS connections over the curl
4025 # backend. URLs must start with "https://".
4027 # @cookie: List of cookies to set; format is
4028 # "name1=content1; name2=content2;" as explained by
4029 # CURLOPT_COOKIE(3). Defaults to no cookies.
4031 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
4034 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
4035 # secure way. See @cookie for the format. (since 2.10)
4039 { 'struct': 'BlockdevOptionsCurlHttps',
4040 'base': 'BlockdevOptionsCurlBase',
4041 'data': { '*cookie': 'str',
4042 '*sslverify': 'bool',
4043 '*cookie-secret': 'str'} }
4046 # @BlockdevOptionsCurlFtp:
4048 # Driver specific block device options for FTP connections over the curl
4049 # backend. URLs must start with "ftp://".
4053 { 'struct': 'BlockdevOptionsCurlFtp',
4054 'base': 'BlockdevOptionsCurlBase',
4058 # @BlockdevOptionsCurlFtps:
4060 # Driver specific block device options for FTPS connections over the curl
4061 # backend. URLs must start with "ftps://".
4063 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
4068 { 'struct': 'BlockdevOptionsCurlFtps',
4069 'base': 'BlockdevOptionsCurlBase',
4070 'data': { '*sslverify': 'bool' } }
4073 # @BlockdevOptionsNbd:
4075 # Driver specific block device options for NBD.
4077 # @server: NBD server address
4079 # @export: export name
4081 # @tls-creds: TLS credentials ID
4083 # @tls-hostname: TLS hostname override for certificate validation (Since 7.0)
4085 # @x-dirty-bitmap: A metadata context name such as "qemu:dirty-bitmap:NAME"
4086 # or "qemu:allocation-depth" to query in place of the
4087 # traditional "base:allocation" block status (see
4088 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol; and
4089 # yes, naming this option x-context would have made
4090 # more sense) (since 3.0)
4092 # @reconnect-delay: On an unexpected disconnect, the nbd client tries to
4093 # connect again until succeeding or encountering a serious
4094 # error. During the first @reconnect-delay seconds, all
4095 # requests are paused and will be rerun on a successful
4096 # reconnect. After that time, any delayed requests and all
4097 # future requests before a successful reconnect will
4098 # immediately fail. Default 0 (Since 4.2)
4100 # @open-timeout: In seconds. If zero, the nbd driver tries the connection
4101 # only once, and fails to open if the connection fails.
4102 # If non-zero, the nbd driver will repeat connection attempts
4103 # until successful or until @open-timeout seconds have elapsed.
4104 # Default 0 (Since 7.0)
4107 # @unstable: Member @x-dirty-bitmap is experimental.
4111 { 'struct': 'BlockdevOptionsNbd',
4112 'data': { 'server': 'SocketAddress',
4114 '*tls-creds': 'str',
4115 '*tls-hostname': 'str',
4116 '*x-dirty-bitmap': { 'type': 'str', 'features': [ 'unstable' ] },
4117 '*reconnect-delay': 'uint32',
4118 '*open-timeout': 'uint32' } }
4121 # @BlockdevOptionsRaw:
4123 # Driver specific block device options for the raw driver.
4125 # @offset: position where the block device starts
4126 # @size: the assumed size of the device
4130 { 'struct': 'BlockdevOptionsRaw',
4131 'base': 'BlockdevOptionsGenericFormat',
4132 'data': { '*offset': 'int', '*size': 'int' } }
4135 # @BlockdevOptionsThrottle:
4137 # Driver specific block device options for the throttle driver
4139 # @throttle-group: the name of the throttle-group object to use. It
4140 # must already exist.
4141 # @file: reference to or definition of the data source block device
4144 { 'struct': 'BlockdevOptionsThrottle',
4145 'data': { 'throttle-group': 'str',
4146 'file' : 'BlockdevRef'
4150 # @BlockdevOptionsCor:
4152 # Driver specific block device options for the copy-on-read driver.
4154 # @bottom: The name of a non-filter node (allocation-bearing layer) that
4155 # limits the COR operations in the backing chain (inclusive), so
4156 # that no data below this node will be copied by this filter.
4157 # If option is absent, the limit is not applied, so that data
4158 # from all backing layers may be copied.
4162 { 'struct': 'BlockdevOptionsCor',
4163 'base': 'BlockdevOptionsGenericFormat',
4164 'data': { '*bottom': 'str' } }
4167 # @BlockdevOptionsCbw:
4169 # Driver specific block device options for the copy-before-write driver,
4170 # which does so called copy-before-write operations: when data is
4171 # written to the filter, the filter first reads corresponding blocks
4172 # from its file child and copies them to @target child. After successfully
4173 # copying, the write request is propagated to file child. If copying
4174 # fails, the original write request is failed too and no data is written
4177 # @target: The target for copy-before-write operations.
4179 # @bitmap: If specified, copy-before-write filter will do
4180 # copy-before-write operations only for dirty regions of the
4181 # bitmap. Bitmap size must be equal to length of file and
4182 # target child of the filter. Note also, that bitmap is used
4183 # only to initialize internal bitmap of the process, so further
4184 # modifications (or removing) of specified bitmap doesn't
4185 # influence the filter. (Since 7.0)
4189 { 'struct': 'BlockdevOptionsCbw',
4190 'base': 'BlockdevOptionsGenericFormat',
4191 'data': { 'target': 'BlockdevRef', '*bitmap': 'BlockDirtyBitmap' } }
4196 # Options for creating a block device. Many options are available for all
4197 # block devices, independent of the block driver:
4199 # @driver: block driver name
4200 # @node-name: the node name of the new node (Since 2.0).
4201 # This option is required on the top level of blockdev-add.
4202 # Valid node names start with an alphabetic character and may
4203 # contain only alphanumeric characters, '-', '.' and '_'. Their
4204 # maximum length is 31 characters.
4205 # @discard: discard-related options (default: ignore)
4206 # @cache: cache-related options
4207 # @read-only: whether the block device should be read-only (default: false).
4208 # Note that some block drivers support only read-only access,
4209 # either generally or in certain configurations. In this case,
4210 # the default value does not work and the option must be
4211 # specified explicitly.
4212 # @auto-read-only: if true and @read-only is false, QEMU may automatically
4213 # decide not to open the image read-write as requested, but
4214 # fall back to read-only instead (and switch between the modes
4215 # later), e.g. depending on whether the image file is writable
4216 # or whether a writing user is attached to the node
4217 # (default: false, since 3.1)
4218 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
4220 # @force-share: force share all permission on added nodes.
4221 # Requires read-only=true. (Since 2.10)
4223 # Remaining options are determined by the block driver.
4227 { 'union': 'BlockdevOptions',
4228 'base': { 'driver': 'BlockdevDriver',
4229 '*node-name': 'str',
4230 '*discard': 'BlockdevDiscardOptions',
4231 '*cache': 'BlockdevCacheOptions',
4232 '*read-only': 'bool',
4233 '*auto-read-only': 'bool',
4234 '*force-share': 'bool',
4235 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
4236 'discriminator': 'driver',
4238 'blkdebug': 'BlockdevOptionsBlkdebug',
4239 'blklogwrites':'BlockdevOptionsBlklogwrites',
4240 'blkverify': 'BlockdevOptionsBlkverify',
4241 'blkreplay': 'BlockdevOptionsBlkreplay',
4242 'bochs': 'BlockdevOptionsGenericFormat',
4243 'cloop': 'BlockdevOptionsGenericFormat',
4244 'compress': 'BlockdevOptionsGenericFormat',
4245 'copy-before-write':'BlockdevOptionsCbw',
4246 'copy-on-read':'BlockdevOptionsCor',
4247 'dmg': 'BlockdevOptionsGenericFormat',
4248 'file': 'BlockdevOptionsFile',
4249 'ftp': 'BlockdevOptionsCurlFtp',
4250 'ftps': 'BlockdevOptionsCurlFtps',
4251 'gluster': 'BlockdevOptionsGluster',
4252 'host_cdrom': { 'type': 'BlockdevOptionsFile',
4253 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4254 'host_device': { 'type': 'BlockdevOptionsFile',
4255 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4256 'http': 'BlockdevOptionsCurlHttp',
4257 'https': 'BlockdevOptionsCurlHttps',
4258 'iscsi': 'BlockdevOptionsIscsi',
4259 'luks': 'BlockdevOptionsLUKS',
4260 'nbd': 'BlockdevOptionsNbd',
4261 'nfs': 'BlockdevOptionsNfs',
4262 'null-aio': 'BlockdevOptionsNull',
4263 'null-co': 'BlockdevOptionsNull',
4264 'nvme': 'BlockdevOptionsNVMe',
4265 'parallels': 'BlockdevOptionsGenericFormat',
4266 'preallocate':'BlockdevOptionsPreallocate',
4267 'qcow2': 'BlockdevOptionsQcow2',
4268 'qcow': 'BlockdevOptionsQcow',
4269 'qed': 'BlockdevOptionsGenericCOWFormat',
4270 'quorum': 'BlockdevOptionsQuorum',
4271 'raw': 'BlockdevOptionsRaw',
4272 'rbd': 'BlockdevOptionsRbd',
4273 'replication': { 'type': 'BlockdevOptionsReplication',
4274 'if': 'CONFIG_REPLICATION' },
4275 'snapshot-access': 'BlockdevOptionsGenericFormat',
4276 'ssh': 'BlockdevOptionsSsh',
4277 'throttle': 'BlockdevOptionsThrottle',
4278 'vdi': 'BlockdevOptionsGenericFormat',
4279 'vhdx': 'BlockdevOptionsGenericFormat',
4280 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4281 'vpc': 'BlockdevOptionsGenericFormat',
4282 'vvfat': 'BlockdevOptionsVVFAT'
4288 # Reference to a block device.
4290 # @definition: defines a new block device inline
4291 # @reference: references the ID of an existing block device
4295 { 'alternate': 'BlockdevRef',
4296 'data': { 'definition': 'BlockdevOptions',
4297 'reference': 'str' } }
4300 # @BlockdevRefOrNull:
4302 # Reference to a block device.
4304 # @definition: defines a new block device inline
4305 # @reference: references the ID of an existing block device.
4306 # An empty string means that no block device should
4307 # be referenced. Deprecated; use null instead.
4308 # @null: No block device should be referenced (since 2.10)
4312 { 'alternate': 'BlockdevRefOrNull',
4313 'data': { 'definition': 'BlockdevOptions',
4320 # Creates a new block device.
4327 # -> { "execute": "blockdev-add",
4329 # "driver": "qcow2",
4330 # "node-name": "test1",
4333 # "filename": "test.qcow2"
4337 # <- { "return": {} }
4340 # -> { "execute": "blockdev-add",
4342 # "driver": "qcow2",
4343 # "node-name": "node0",
4344 # "discard": "unmap",
4350 # "filename": "/tmp/test.qcow2"
4356 # "filename": "/dev/fdset/4"
4362 # <- { "return": {} }
4365 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
4370 # Reopens one or more block devices using the given set of options.
4371 # Any option not specified will be reset to its default value regardless
4372 # of its previous status. If an option cannot be changed or a particular
4373 # driver does not support reopening then the command will return an
4374 # error. All devices in the list are reopened in one transaction, so
4375 # if one of them fails then the whole transaction is cancelled.
4377 # The command receives a list of block devices to reopen. For each one
4378 # of them, the top-level @node-name option (from BlockdevOptions) must be
4379 # specified and is used to select the block device to be reopened.
4380 # Other @node-name options must be either omitted or set to the
4381 # current name of the appropriate node. This command won't change any
4382 # node name and any attempt to do it will result in an error.
4384 # In the case of options that refer to child nodes, the behavior of
4385 # this command depends on the value:
4387 # 1) A set of options (BlockdevOptions): the child is reopened with
4388 # the specified set of options.
4390 # 2) A reference to the current child: the child is reopened using
4391 # its existing set of options.
4393 # 3) A reference to a different node: the current child is replaced
4394 # with the specified one.
4396 # 4) NULL: the current child (if any) is detached.
4398 # Options (1) and (2) are supported in all cases. Option (3) is
4399 # supported for @file and @backing, and option (4) for @backing only.
4401 # Unlike with blockdev-add, the @backing option must always be present
4402 # unless the node being reopened does not have a backing file and its
4403 # image does not have a default backing file name as part of its
4408 { 'command': 'blockdev-reopen',
4409 'data': { 'options': ['BlockdevOptions'] } }
4414 # Deletes a block device that has been added using blockdev-add.
4415 # The command will fail if the node is attached to a device or is
4416 # otherwise being used.
4418 # @node-name: Name of the graph node to delete.
4424 # -> { "execute": "blockdev-add",
4426 # "driver": "qcow2",
4427 # "node-name": "node0",
4430 # "filename": "test.qcow2"
4434 # <- { "return": {} }
4436 # -> { "execute": "blockdev-del",
4437 # "arguments": { "node-name": "node0" }
4439 # <- { "return": {} }
4442 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
4445 # @BlockdevCreateOptionsFile:
4447 # Driver specific image creation options for file.
4449 # @filename: Filename for the new image file
4450 # @size: Size of the virtual disk in bytes
4451 # @preallocation: Preallocation mode for the new image (default: off;
4452 # allowed values: off,
4453 # falloc (if CONFIG_POSIX_FALLOCATE),
4454 # full (if CONFIG_POSIX))
4455 # @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
4456 # @extent-size-hint: Extent size hint to add to the image file; 0 for not
4457 # adding an extent size hint (default: 1 MB, since 5.1)
4461 { 'struct': 'BlockdevCreateOptionsFile',
4462 'data': { 'filename': 'str',
4464 '*preallocation': 'PreallocMode',
4466 '*extent-size-hint': 'size'} }
4469 # @BlockdevCreateOptionsGluster:
4471 # Driver specific image creation options for gluster.
4473 # @location: Where to store the new image file
4474 # @size: Size of the virtual disk in bytes
4475 # @preallocation: Preallocation mode for the new image (default: off;
4476 # allowed values: off,
4477 # falloc (if CONFIG_GLUSTERFS_FALLOCATE),
4478 # full (if CONFIG_GLUSTERFS_ZEROFILL))
4482 { 'struct': 'BlockdevCreateOptionsGluster',
4483 'data': { 'location': 'BlockdevOptionsGluster',
4485 '*preallocation': 'PreallocMode' } }
4488 # @BlockdevCreateOptionsLUKS:
4490 # Driver specific image creation options for LUKS.
4492 # @file: Node to create the image format on
4493 # @size: Size of the virtual disk in bytes
4494 # @preallocation: Preallocation mode for the new image
4496 # (default: off; allowed values: off, metadata, falloc, full)
4500 { 'struct': 'BlockdevCreateOptionsLUKS',
4501 'base': 'QCryptoBlockCreateOptionsLUKS',
4502 'data': { 'file': 'BlockdevRef',
4504 '*preallocation': 'PreallocMode' } }
4507 # @BlockdevCreateOptionsNfs:
4509 # Driver specific image creation options for NFS.
4511 # @location: Where to store the new image file
4512 # @size: Size of the virtual disk in bytes
4516 { 'struct': 'BlockdevCreateOptionsNfs',
4517 'data': { 'location': 'BlockdevOptionsNfs',
4521 # @BlockdevCreateOptionsParallels:
4523 # Driver specific image creation options for parallels.
4525 # @file: Node to create the image format on
4526 # @size: Size of the virtual disk in bytes
4527 # @cluster-size: Cluster size in bytes (default: 1 MB)
4531 { 'struct': 'BlockdevCreateOptionsParallels',
4532 'data': { 'file': 'BlockdevRef',
4534 '*cluster-size': 'size' } }
4537 # @BlockdevCreateOptionsQcow:
4539 # Driver specific image creation options for qcow.
4541 # @file: Node to create the image format on
4542 # @size: Size of the virtual disk in bytes
4543 # @backing-file: File name of the backing file if a backing file
4545 # @encrypt: Encryption options if the image should be encrypted
4549 { 'struct': 'BlockdevCreateOptionsQcow',
4550 'data': { 'file': 'BlockdevRef',
4552 '*backing-file': 'str',
4553 '*encrypt': 'QCryptoBlockCreateOptions' } }
4556 # @BlockdevQcow2Version:
4558 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4559 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4563 { 'enum': 'BlockdevQcow2Version',
4564 'data': [ 'v2', 'v3' ] }
4568 # @Qcow2CompressionType:
4570 # Compression type used in qcow2 image file
4572 # @zlib: zlib compression, see <http://zlib.net/>
4573 # @zstd: zstd compression, see <http://github.com/facebook/zstd>
4577 { 'enum': 'Qcow2CompressionType',
4578 'data': [ 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
4581 # @BlockdevCreateOptionsQcow2:
4583 # Driver specific image creation options for qcow2.
4585 # @file: Node to create the image format on
4586 # @data-file: Node to use as an external data file in which all guest
4587 # data is stored so that only metadata remains in the qcow2
4589 # @data-file-raw: True if the external data file must stay valid as a
4590 # standalone (read-only) raw image without looking at qcow2
4591 # metadata (default: false; since: 4.0)
4592 # @extended-l2: True to make the image have extended L2 entries
4593 # (default: false; since 5.2)
4594 # @size: Size of the virtual disk in bytes
4595 # @version: Compatibility level (default: v3)
4596 # @backing-file: File name of the backing file if a backing file
4598 # @backing-fmt: Name of the block driver to use for the backing file
4599 # @encrypt: Encryption options if the image should be encrypted
4600 # @cluster-size: qcow2 cluster size in bytes (default: 65536)
4601 # @preallocation: Preallocation mode for the new image (default: off;
4602 # allowed values: off, falloc, full, metadata)
4603 # @lazy-refcounts: True if refcounts may be updated lazily (default: off)
4604 # @refcount-bits: Width of reference counts in bits (default: 16)
4605 # @compression-type: The image cluster compression method
4606 # (default: zlib, since 5.1)
4610 { 'struct': 'BlockdevCreateOptionsQcow2',
4611 'data': { 'file': 'BlockdevRef',
4612 '*data-file': 'BlockdevRef',
4613 '*data-file-raw': 'bool',
4614 '*extended-l2': 'bool',
4616 '*version': 'BlockdevQcow2Version',
4617 '*backing-file': 'str',
4618 '*backing-fmt': 'BlockdevDriver',
4619 '*encrypt': 'QCryptoBlockCreateOptions',
4620 '*cluster-size': 'size',
4621 '*preallocation': 'PreallocMode',
4622 '*lazy-refcounts': 'bool',
4623 '*refcount-bits': 'int',
4624 '*compression-type':'Qcow2CompressionType' } }
4627 # @BlockdevCreateOptionsQed:
4629 # Driver specific image creation options for qed.
4631 # @file: Node to create the image format on
4632 # @size: Size of the virtual disk in bytes
4633 # @backing-file: File name of the backing file if a backing file
4635 # @backing-fmt: Name of the block driver to use for the backing file
4636 # @cluster-size: Cluster size in bytes (default: 65536)
4637 # @table-size: L1/L2 table size (in clusters)
4641 { 'struct': 'BlockdevCreateOptionsQed',
4642 'data': { 'file': 'BlockdevRef',
4644 '*backing-file': 'str',
4645 '*backing-fmt': 'BlockdevDriver',
4646 '*cluster-size': 'size',
4647 '*table-size': 'int' } }
4650 # @BlockdevCreateOptionsRbd:
4652 # Driver specific image creation options for rbd/Ceph.
4654 # @location: Where to store the new image file. This location cannot
4655 # point to a snapshot.
4656 # @size: Size of the virtual disk in bytes
4657 # @cluster-size: RBD object size
4658 # @encrypt: Image encryption options. (Since 6.1)
4662 { 'struct': 'BlockdevCreateOptionsRbd',
4663 'data': { 'location': 'BlockdevOptionsRbd',
4665 '*cluster-size' : 'size',
4666 '*encrypt' : 'RbdEncryptionCreateOptions' } }
4669 # @BlockdevVmdkSubformat:
4671 # Subformat options for VMDK images
4673 # @monolithicSparse: Single file image with sparse cluster allocation
4675 # @monolithicFlat: Single flat data image and a descriptor file
4677 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4678 # files, in addition to a descriptor file
4680 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4681 # files, in addition to a descriptor file
4683 # @streamOptimized: Single file image sparse cluster allocation, optimized
4684 # for streaming over network.
4688 { 'enum': 'BlockdevVmdkSubformat',
4689 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4690 'twoGbMaxExtentFlat', 'streamOptimized'] }
4693 # @BlockdevVmdkAdapterType:
4695 # Adapter type info for VMDK images
4699 { 'enum': 'BlockdevVmdkAdapterType',
4700 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4703 # @BlockdevCreateOptionsVmdk:
4705 # Driver specific image creation options for VMDK.
4707 # @file: Where to store the new image file. This refers to the image
4708 # file for monolithcSparse and streamOptimized format, or the
4709 # descriptor file for other formats.
4710 # @size: Size of the virtual disk in bytes
4711 # @extents: Where to store the data extents. Required for monolithcFlat,
4712 # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4713 # monolithicFlat, only one entry is required; for
4714 # twoGbMaxExtent* formats, the number of entries required is
4715 # calculated as extent_number = virtual_size / 2GB. Providing
4716 # more extents than will be used is an error.
4717 # @subformat: The subformat of the VMDK image. Default: "monolithicSparse".
4718 # @backing-file: The path of backing file. Default: no backing file is used.
4719 # @adapter-type: The adapter type used to fill in the descriptor. Default: ide.
4720 # @hwversion: Hardware version. The meaningful options are "4" or "6".
4722 # @toolsversion: VMware guest tools version.
4723 # Default: "2147483647" (Since 6.2)
4724 # @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats.
4729 { 'struct': 'BlockdevCreateOptionsVmdk',
4730 'data': { 'file': 'BlockdevRef',
4732 '*extents': ['BlockdevRef'],
4733 '*subformat': 'BlockdevVmdkSubformat',
4734 '*backing-file': 'str',
4735 '*adapter-type': 'BlockdevVmdkAdapterType',
4736 '*hwversion': 'str',
4737 '*toolsversion': 'str',
4738 '*zeroed-grain': 'bool' } }
4742 # @BlockdevCreateOptionsSsh:
4744 # Driver specific image creation options for SSH.
4746 # @location: Where to store the new image file
4747 # @size: Size of the virtual disk in bytes
4751 { 'struct': 'BlockdevCreateOptionsSsh',
4752 'data': { 'location': 'BlockdevOptionsSsh',
4756 # @BlockdevCreateOptionsVdi:
4758 # Driver specific image creation options for VDI.
4760 # @file: Node to create the image format on
4761 # @size: Size of the virtual disk in bytes
4762 # @preallocation: Preallocation mode for the new image (default: off;
4763 # allowed values: off, metadata)
4767 { 'struct': 'BlockdevCreateOptionsVdi',
4768 'data': { 'file': 'BlockdevRef',
4770 '*preallocation': 'PreallocMode' } }
4773 # @BlockdevVhdxSubformat:
4775 # @dynamic: Growing image file
4776 # @fixed: Preallocated fixed-size image file
4780 { 'enum': 'BlockdevVhdxSubformat',
4781 'data': [ 'dynamic', 'fixed' ] }
4784 # @BlockdevCreateOptionsVhdx:
4786 # Driver specific image creation options for vhdx.
4788 # @file: Node to create the image format on
4789 # @size: Size of the virtual disk in bytes
4790 # @log-size: Log size in bytes, must be a multiple of 1 MB
4792 # @block-size: Block size in bytes, must be a multiple of 1 MB and not
4793 # larger than 256 MB (default: automatically choose a block
4794 # size depending on the image size)
4795 # @subformat: vhdx subformat (default: dynamic)
4796 # @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard,
4797 # but default. Do not set to 'off' when using 'qemu-img
4798 # convert' with subformat=dynamic.
4802 { 'struct': 'BlockdevCreateOptionsVhdx',
4803 'data': { 'file': 'BlockdevRef',
4805 '*log-size': 'size',
4806 '*block-size': 'size',
4807 '*subformat': 'BlockdevVhdxSubformat',
4808 '*block-state-zero': 'bool' } }
4811 # @BlockdevVpcSubformat:
4813 # @dynamic: Growing image file
4814 # @fixed: Preallocated fixed-size image file
4818 { 'enum': 'BlockdevVpcSubformat',
4819 'data': [ 'dynamic', 'fixed' ] }
4822 # @BlockdevCreateOptionsVpc:
4824 # Driver specific image creation options for vpc (VHD).
4826 # @file: Node to create the image format on
4827 # @size: Size of the virtual disk in bytes
4828 # @subformat: vhdx subformat (default: dynamic)
4829 # @force-size: Force use of the exact byte size instead of rounding to the
4830 # next size that can be represented in CHS geometry
4835 { 'struct': 'BlockdevCreateOptionsVpc',
4836 'data': { 'file': 'BlockdevRef',
4838 '*subformat': 'BlockdevVpcSubformat',
4839 '*force-size': 'bool' } }
4842 # @BlockdevCreateOptions:
4844 # Options for creating an image format on a given node.
4846 # @driver: block driver to create the image format
4850 { 'union': 'BlockdevCreateOptions',
4852 'driver': 'BlockdevDriver' },
4853 'discriminator': 'driver',
4855 'file': 'BlockdevCreateOptionsFile',
4856 'gluster': 'BlockdevCreateOptionsGluster',
4857 'luks': 'BlockdevCreateOptionsLUKS',
4858 'nfs': 'BlockdevCreateOptionsNfs',
4859 'parallels': 'BlockdevCreateOptionsParallels',
4860 'qcow': 'BlockdevCreateOptionsQcow',
4861 'qcow2': 'BlockdevCreateOptionsQcow2',
4862 'qed': 'BlockdevCreateOptionsQed',
4863 'rbd': 'BlockdevCreateOptionsRbd',
4864 'ssh': 'BlockdevCreateOptionsSsh',
4865 'vdi': 'BlockdevCreateOptionsVdi',
4866 'vhdx': 'BlockdevCreateOptionsVhdx',
4867 'vmdk': 'BlockdevCreateOptionsVmdk',
4868 'vpc': 'BlockdevCreateOptionsVpc'
4874 # Starts a job to create an image format on a given node. The job is
4875 # automatically finalized, but a manual job-dismiss is required.
4877 # @job-id: Identifier for the newly created job.
4879 # @options: Options for the image creation.
4883 { 'command': 'blockdev-create',
4884 'data': { 'job-id': 'str',
4885 'options': 'BlockdevCreateOptions' } }
4888 # @BlockdevAmendOptionsLUKS:
4890 # Driver specific image amend options for LUKS.
4894 { 'struct': 'BlockdevAmendOptionsLUKS',
4895 'base': 'QCryptoBlockAmendOptionsLUKS',
4900 # @BlockdevAmendOptionsQcow2:
4902 # Driver specific image amend options for qcow2.
4903 # For now, only encryption options can be amended
4905 # @encrypt Encryption options to be amended
4909 { 'struct': 'BlockdevAmendOptionsQcow2',
4910 'data': { '*encrypt': 'QCryptoBlockAmendOptions' } }
4913 # @BlockdevAmendOptions:
4915 # Options for amending an image format
4917 # @driver: Block driver of the node to amend.
4921 { 'union': 'BlockdevAmendOptions',
4923 'driver': 'BlockdevDriver' },
4924 'discriminator': 'driver',
4926 'luks': 'BlockdevAmendOptionsLUKS',
4927 'qcow2': 'BlockdevAmendOptionsQcow2' } }
4930 # @x-blockdev-amend:
4932 # Starts a job to amend format specific options of an existing open block device
4933 # The job is automatically finalized, but a manual job-dismiss is required.
4935 # @job-id: Identifier for the newly created job.
4937 # @node-name: Name of the block node to work on
4939 # @options: Options (driver specific)
4941 # @force: Allow unsafe operations, format specific
4942 # For luks that allows erase of the last active keyslot
4943 # (permanent loss of data),
4944 # and replacement of an active keyslot
4945 # (possible loss of data if IO error happens)
4948 # @unstable: This command is experimental.
4952 { 'command': 'x-blockdev-amend',
4953 'data': { 'job-id': 'str',
4955 'options': 'BlockdevAmendOptions',
4957 'features': [ 'unstable' ] }
4960 # @BlockErrorAction:
4962 # An enumeration of action that has been taken when a DISK I/O occurs
4964 # @ignore: error has been ignored
4966 # @report: error has been reported to the device
4968 # @stop: error caused VM to be stopped
4972 { 'enum': 'BlockErrorAction',
4973 'data': [ 'ignore', 'report', 'stop' ] }
4977 # @BLOCK_IMAGE_CORRUPTED:
4979 # Emitted when a disk image is being marked corrupt. The image can be
4980 # identified by its device or node name. The 'device' field is always
4981 # present for compatibility reasons, but it can be empty ("") if the
4982 # image does not have a device name associated.
4984 # @device: device name. This is always present for compatibility
4985 # reasons, but it can be empty ("") if the image does not
4986 # have a device name associated.
4988 # @node-name: node name (Since: 2.4)
4990 # @msg: informative message for human consumption, such as the kind of
4991 # corruption being detected. It should not be parsed by machine as it is
4992 # not guaranteed to be stable
4994 # @offset: if the corruption resulted from an image access, this is
4995 # the host's access offset into the image
4997 # @size: if the corruption resulted from an image access, this is
5000 # @fatal: if set, the image is marked corrupt and therefore unusable after this
5001 # event and must be repaired (Since 2.2; before, every
5002 # BLOCK_IMAGE_CORRUPTED event was fatal)
5004 # Note: If action is "stop", a STOP event will eventually follow the
5005 # BLOCK_IO_ERROR event.
5009 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
5010 # "data": { "device": "", "node-name": "drive", "fatal": false,
5011 # "msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)" },
5012 # "timestamp": { "seconds": 1648243240, "microseconds": 906060 } }
5016 { 'event': 'BLOCK_IMAGE_CORRUPTED',
5017 'data': { 'device' : 'str',
5018 '*node-name' : 'str',
5022 'fatal' : 'bool' } }
5027 # Emitted when a disk I/O error occurs
5029 # @device: device name. This is always present for compatibility
5030 # reasons, but it can be empty ("") if the image does not
5031 # have a device name associated.
5033 # @node-name: node name. Note that errors may be reported for the root node
5034 # that is directly attached to a guest device rather than for the
5035 # node where the error occurred. The node name is not present if
5036 # the drive is empty. (Since: 2.8)
5038 # @operation: I/O operation
5040 # @action: action that has been taken
5042 # @nospace: true if I/O error was caused due to a no-space
5043 # condition. This key is only present if query-block's
5044 # io-status is present, please see query-block documentation
5045 # for more information (since: 2.2)
5047 # @reason: human readable string describing the error cause.
5048 # (This field is a debugging aid for humans, it should not
5049 # be parsed by applications) (since: 2.2)
5051 # Note: If action is "stop", a STOP event will eventually follow the
5052 # BLOCK_IO_ERROR event
5058 # <- { "event": "BLOCK_IO_ERROR",
5059 # "data": { "device": "ide0-hd1",
5060 # "node-name": "#block212",
5061 # "operation": "write",
5063 # "reason": "No space left on device" },
5064 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5067 { 'event': 'BLOCK_IO_ERROR',
5068 'data': { 'device': 'str', '*node-name': 'str',
5069 'operation': 'IoOperationType',
5070 'action': 'BlockErrorAction', '*nospace': 'bool',
5074 # @BLOCK_JOB_COMPLETED:
5076 # Emitted when a block job has completed
5080 # @device: The job identifier. Originally the device name but other
5081 # values are allowed since QEMU 2.7
5083 # @len: maximum progress value
5085 # @offset: current progress value. On success this is equal to len.
5086 # On failure this is less than len
5088 # @speed: rate limit, bytes per second
5090 # @error: error message. Only present on failure. This field
5091 # contains a human-readable error message. There are no semantics
5092 # other than that streaming has failed and clients should not try to
5093 # interpret the error string
5099 # <- { "event": "BLOCK_JOB_COMPLETED",
5100 # "data": { "type": "stream", "device": "virtio-disk0",
5101 # "len": 10737418240, "offset": 10737418240,
5103 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5106 { 'event': 'BLOCK_JOB_COMPLETED',
5107 'data': { 'type' : 'JobType',
5115 # @BLOCK_JOB_CANCELLED:
5117 # Emitted when a block job has been cancelled
5121 # @device: The job identifier. Originally the device name but other
5122 # values are allowed since QEMU 2.7
5124 # @len: maximum progress value
5126 # @offset: current progress value. On success this is equal to len.
5127 # On failure this is less than len
5129 # @speed: rate limit, bytes per second
5135 # <- { "event": "BLOCK_JOB_CANCELLED",
5136 # "data": { "type": "stream", "device": "virtio-disk0",
5137 # "len": 10737418240, "offset": 134217728,
5139 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5142 { 'event': 'BLOCK_JOB_CANCELLED',
5143 'data': { 'type' : 'JobType',
5152 # Emitted when a block job encounters an error
5154 # @device: The job identifier. Originally the device name but other
5155 # values are allowed since QEMU 2.7
5157 # @operation: I/O operation
5159 # @action: action that has been taken
5165 # <- { "event": "BLOCK_JOB_ERROR",
5166 # "data": { "device": "ide0-hd1",
5167 # "operation": "write",
5168 # "action": "stop" },
5169 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5172 { 'event': 'BLOCK_JOB_ERROR',
5173 'data': { 'device' : 'str',
5174 'operation': 'IoOperationType',
5175 'action' : 'BlockErrorAction' } }
5180 # Emitted when a block job is ready to complete
5184 # @device: The job identifier. Originally the device name but other
5185 # values are allowed since QEMU 2.7
5187 # @len: maximum progress value
5189 # @offset: current progress value. On success this is equal to len.
5190 # On failure this is less than len
5192 # @speed: rate limit, bytes per second
5194 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
5201 # <- { "event": "BLOCK_JOB_READY",
5202 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5203 # "len": 2097152, "offset": 2097152 }
5204 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5207 { 'event': 'BLOCK_JOB_READY',
5208 'data': { 'type' : 'JobType',
5215 # @BLOCK_JOB_PENDING:
5217 # Emitted when a block job is awaiting explicit authorization to finalize graph
5218 # changes via @block-job-finalize. If this job is part of a transaction, it will
5219 # not emit this event until the transaction has converged first.
5223 # @id: The job identifier.
5229 # <- { "event": "BLOCK_JOB_PENDING",
5230 # "data": { "type": "mirror", "id": "backup_1" },
5231 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5234 { 'event': 'BLOCK_JOB_PENDING',
5235 'data': { 'type' : 'JobType',
5241 # Preallocation mode of QEMU image file
5243 # @off: no preallocation
5244 # @metadata: preallocate only for metadata
5245 # @falloc: like @full preallocation but allocate disk space by
5246 # posix_fallocate() rather than writing data.
5247 # @full: preallocate all data by writing it to the device to ensure
5248 # disk space is really available. This data may or may not be
5249 # zero, depending on the image format and storage.
5250 # @full preallocation also sets up metadata correctly.
5254 { 'enum': 'PreallocMode',
5255 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5258 # @BLOCK_WRITE_THRESHOLD:
5260 # Emitted when writes on block device reaches or exceeds the
5261 # configured write threshold. For thin-provisioned devices, this
5262 # means the device should be extended to avoid pausing for
5264 # The event is one shot. Once triggered, it needs to be
5265 # re-registered with another block-set-write-threshold command.
5267 # @node-name: graph node name on which the threshold was exceeded.
5269 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5271 # @write-threshold: last configured threshold, in bytes.
5275 { 'event': 'BLOCK_WRITE_THRESHOLD',
5276 'data': { 'node-name': 'str',
5277 'amount-exceeded': 'uint64',
5278 'write-threshold': 'uint64' } }
5281 # @block-set-write-threshold:
5283 # Change the write threshold for a block drive. An event will be
5284 # delivered if a write to this block drive crosses the configured
5285 # threshold. The threshold is an offset, thus must be
5286 # non-negative. Default is no write threshold. Setting the threshold
5287 # to zero disables it.
5289 # This is useful to transparently resize thin-provisioned drives without
5290 # the guest OS noticing.
5292 # @node-name: graph node name on which the threshold must be set.
5294 # @write-threshold: configured threshold for the block device, bytes.
5295 # Use 0 to disable the threshold.
5301 # -> { "execute": "block-set-write-threshold",
5302 # "arguments": { "node-name": "mydev",
5303 # "write-threshold": 17179869184 } }
5304 # <- { "return": {} }
5307 { 'command': 'block-set-write-threshold',
5308 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
5311 # @x-blockdev-change:
5313 # Dynamically reconfigure the block driver state graph. It can be used
5314 # to add, remove, insert or replace a graph node. Currently only the
5315 # Quorum driver implements this feature to add or remove its child. This
5316 # is useful to fix a broken quorum child.
5318 # If @node is specified, it will be inserted under @parent. @child
5319 # may not be specified in this case. If both @parent and @child are
5320 # specified but @node is not, @child will be detached from @parent.
5322 # @parent: the id or name of the parent node.
5324 # @child: the name of a child under the given parent node.
5326 # @node: the name of the node that will be added.
5329 # @unstable: This command is experimental, and its API is not stable. It
5330 # does not support all kinds of operations, all kinds of
5331 # children, nor all block drivers.
5333 # FIXME Removing children from a quorum node means introducing
5334 # gaps in the child indices. This cannot be represented in the
5335 # 'children' list of BlockdevOptionsQuorum, as returned by
5336 # .bdrv_refresh_filename().
5338 # Warning: The data in a new quorum child MUST be consistent
5339 # with that of the rest of the array.
5345 # 1. Add a new node to a quorum
5346 # -> { "execute": "blockdev-add",
5349 # "node-name": "new_node",
5350 # "file": { "driver": "file",
5351 # "filename": "test.raw" } } }
5352 # <- { "return": {} }
5353 # -> { "execute": "x-blockdev-change",
5354 # "arguments": { "parent": "disk1",
5355 # "node": "new_node" } }
5356 # <- { "return": {} }
5358 # 2. Delete a quorum's node
5359 # -> { "execute": "x-blockdev-change",
5360 # "arguments": { "parent": "disk1",
5361 # "child": "children.1" } }
5362 # <- { "return": {} }
5365 { 'command': 'x-blockdev-change',
5366 'data' : { 'parent': 'str',
5369 'features': [ 'unstable' ] }
5372 # @x-blockdev-set-iothread:
5374 # Move @node and its children into the @iothread. If @iothread is null then
5375 # move @node and its children into the main loop.
5377 # The node must not be attached to a BlockBackend.
5379 # @node-name: the name of the block driver node
5381 # @iothread: the name of the IOThread object or null for the main loop
5383 # @force: true if the node and its children should be moved when a BlockBackend
5384 # is already attached
5387 # @unstable: This command is experimental and intended for test cases that
5388 # need control over IOThreads only.
5394 # 1. Move a node into an IOThread
5395 # -> { "execute": "x-blockdev-set-iothread",
5396 # "arguments": { "node-name": "disk1",
5397 # "iothread": "iothread0" } }
5398 # <- { "return": {} }
5400 # 2. Move a node into the main loop
5401 # -> { "execute": "x-blockdev-set-iothread",
5402 # "arguments": { "node-name": "disk1",
5403 # "iothread": null } }
5404 # <- { "return": {} }
5407 { 'command': 'x-blockdev-set-iothread',
5408 'data' : { 'node-name': 'str',
5409 'iothread': 'StrOrNull',
5411 'features': [ 'unstable' ] }
5416 # An enumeration of the quorum operation types
5418 # @read: read operation
5420 # @write: write operation
5422 # @flush: flush operation
5426 { 'enum': 'QuorumOpType',
5427 'data': [ 'read', 'write', 'flush' ] }
5432 # Emitted by the Quorum block driver if it fails to establish a quorum
5434 # @reference: device name if defined else node name
5436 # @sector-num: number of the first sector of the failed read operation
5438 # @sectors-count: failed read operation sector count
5440 # Note: This event is rate-limited.
5446 # <- { "event": "QUORUM_FAILURE",
5447 # "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
5448 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5451 { 'event': 'QUORUM_FAILURE',
5452 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
5455 # @QUORUM_REPORT_BAD:
5457 # Emitted to report a corruption of a Quorum file
5459 # @type: quorum operation type (Since 2.6)
5461 # @error: error message. Only present on failure. This field
5462 # contains a human-readable error message. There are no semantics other
5463 # than that the block layer reported an error and clients should not
5464 # try to interpret the error string.
5466 # @node-name: the graph node name of the block driver state
5468 # @sector-num: number of the first sector of the failed read operation
5470 # @sectors-count: failed read operation sector count
5472 # Note: This event is rate-limited.
5480 # { "event": "QUORUM_REPORT_BAD",
5481 # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
5483 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5485 # 2. Flush operation
5487 # { "event": "QUORUM_REPORT_BAD",
5488 # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
5489 # "type": "flush", "error": "Broken pipe" },
5490 # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
5493 { 'event': 'QUORUM_REPORT_BAD',
5494 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
5495 'sector-num': 'int', 'sectors-count': 'int' } }
5498 # @BlockdevSnapshotInternal:
5500 # @device: the device name or node-name of a root node to generate the snapshot
5503 # @name: the name of the internal snapshot to be created
5505 # Notes: In transaction, if @name is empty, or any snapshot matching @name
5506 # exists, the operation will fail. Only some image formats support it,
5507 # for example, qcow2, and rbd.
5511 { 'struct': 'BlockdevSnapshotInternal',
5512 'data': { 'device': 'str', 'name': 'str' } }
5515 # @blockdev-snapshot-internal-sync:
5517 # Synchronously take an internal snapshot of a block device, when the
5518 # format of the image used supports it. If the name is an empty
5519 # string, or a snapshot with name already exists, the operation will
5522 # For the arguments, see the documentation of BlockdevSnapshotInternal.
5524 # Returns: - nothing on success
5525 # - If @device is not a valid block device, GenericError
5526 # - If any snapshot matching @name exists, or @name is empty,
5528 # - If the format of the image used does not support it,
5529 # BlockFormatFeatureNotSupported
5535 # -> { "execute": "blockdev-snapshot-internal-sync",
5536 # "arguments": { "device": "ide-hd0",
5537 # "name": "snapshot0" }
5539 # <- { "return": {} }
5542 { 'command': 'blockdev-snapshot-internal-sync',
5543 'data': 'BlockdevSnapshotInternal' }
5546 # @blockdev-snapshot-delete-internal-sync:
5548 # Synchronously delete an internal snapshot of a block device, when the format
5549 # of the image used support it. The snapshot is identified by name or id or
5550 # both. One of the name or id is required. Return SnapshotInfo for the
5551 # successfully deleted snapshot.
5553 # @device: the device name or node-name of a root node to delete the snapshot
5556 # @id: optional the snapshot's ID to be deleted
5558 # @name: optional the snapshot's name to be deleted
5560 # Returns: - SnapshotInfo on success
5561 # - If @device is not a valid block device, GenericError
5562 # - If snapshot not found, GenericError
5563 # - If the format of the image used does not support it,
5564 # BlockFormatFeatureNotSupported
5565 # - If @id and @name are both not specified, GenericError
5571 # -> { "execute": "blockdev-snapshot-delete-internal-sync",
5572 # "arguments": { "device": "ide-hd0",
5573 # "name": "snapshot0" }
5577 # "name": "snapshot0",
5578 # "vm-state-size": 0,
5579 # "date-sec": 1000012,
5581 # "vm-clock-sec": 100,
5582 # "vm-clock-nsec": 20,
5588 { 'command': 'blockdev-snapshot-delete-internal-sync',
5589 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
5590 'returns': 'SnapshotInfo' }