4 # == Block core (VM unrelated)
7 { 'include': 'common.json' }
8 { 'include': 'crypto.json' }
9 { 'include': 'sockets.json' }
14 # @id: unique snapshot id
16 # @name: user chosen name
18 # @vm-state-size: size of the VM state
20 # @date-sec: UTC date of the snapshot in seconds
22 # @date-nsec: fractional part in nano seconds to be used with date-sec
24 # @vm-clock-sec: VM clock relative to boot in seconds
26 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
31 { 'struct': 'SnapshotInfo',
32 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
33 'date-sec': 'int', 'date-nsec': 'int',
34 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
37 # @ImageInfoSpecificQCow2EncryptionBase:
39 # @format: The encryption format
43 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
44 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
47 # @ImageInfoSpecificQCow2Encryption:
51 { 'union': 'ImageInfoSpecificQCow2Encryption',
52 'base': 'ImageInfoSpecificQCow2EncryptionBase',
53 'discriminator': 'format',
54 'data': { 'aes': 'QCryptoBlockInfoQCow',
55 'luks': 'QCryptoBlockInfoLUKS' } }
58 # @ImageInfoSpecificQCow2:
60 # @compat: compatibility level
62 # @lazy-refcounts: on or off; only valid for compat >= 1.1
64 # @corrupt: true if the image has been marked corrupt; only valid for
65 # compat >= 1.1 (since 2.2)
67 # @refcount-bits: width of a refcount entry in bits (since 2.3)
69 # @encrypt: details about encryption parameters; only set if image
70 # is encrypted (since 2.10)
74 { 'struct': 'ImageInfoSpecificQCow2',
77 '*lazy-refcounts': 'bool',
79 'refcount-bits': 'int',
80 '*encrypt': 'ImageInfoSpecificQCow2Encryption'
84 # @ImageInfoSpecificVmdk:
86 # @create-type: The create type of VMDK image
88 # @cid: Content id of image
90 # @parent-cid: Parent VMDK image's cid
92 # @extents: List of extent files
96 { 'struct': 'ImageInfoSpecificVmdk',
101 'extents': ['ImageInfo']
105 # @ImageInfoSpecific:
107 # A discriminated record of image format specific information structures.
111 { 'union': 'ImageInfoSpecific',
113 'qcow2': 'ImageInfoSpecificQCow2',
114 'vmdk': 'ImageInfoSpecificVmdk',
115 # If we need to add block driver specific parameters for
116 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
117 # to define a ImageInfoSpecificLUKS
118 'luks': 'QCryptoBlockInfoLUKS'
124 # Information about a QEMU image file
126 # @filename: name of the image file
128 # @format: format of the image file
130 # @virtual-size: maximum capacity in bytes of the image
132 # @actual-size: actual size on disk in bytes of the image
134 # @dirty-flag: true if image is not cleanly closed
136 # @cluster-size: size of a cluster in bytes
138 # @encrypted: true if the image is encrypted
140 # @compressed: true if the image is compressed (Since 1.7)
142 # @backing-filename: name of the backing file
144 # @full-backing-filename: full path of the backing file
146 # @backing-filename-format: the format of the backing file
148 # @snapshots: list of VM snapshots
150 # @backing-image: info of the backing image (since 1.6)
152 # @format-specific: structure supplying additional format-specific
153 # information (since 1.7)
158 { 'struct': 'ImageInfo',
159 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
160 '*actual-size': 'int', 'virtual-size': 'int',
161 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
162 '*backing-filename': 'str', '*full-backing-filename': 'str',
163 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
164 '*backing-image': 'ImageInfo',
165 '*format-specific': 'ImageInfoSpecific' } }
170 # Information about a QEMU image file check
172 # @filename: name of the image file checked
174 # @format: format of the image file checked
176 # @check-errors: number of unexpected errors occurred during check
178 # @image-end-offset: offset (in bytes) where the image ends, this
179 # field is present if the driver for the image format
182 # @corruptions: number of corruptions found during the check if any
184 # @leaks: number of leaks found during the check if any
186 # @corruptions-fixed: number of corruptions fixed during the check
189 # @leaks-fixed: number of leaks fixed during the check if any
191 # @total-clusters: total number of clusters, this field is present
192 # if the driver for the image format supports it
194 # @allocated-clusters: total number of allocated clusters, this
195 # field is present if the driver for the image format
198 # @fragmented-clusters: total number of fragmented clusters, this
199 # field is present if the driver for the image format
202 # @compressed-clusters: total number of compressed clusters, this
203 # field is present if the driver for the image format
209 { 'struct': 'ImageCheck',
210 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
211 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
212 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
213 '*total-clusters': 'int', '*allocated-clusters': 'int',
214 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
219 # Mapping information from a virtual block range to a host file range
221 # @start: the start byte of the mapped virtual range
223 # @length: the number of bytes of the mapped virtual range
225 # @data: whether the mapped range has data
227 # @zero: whether the virtual blocks are zeroed
229 # @depth: the depth of the mapping
231 # @offset: the offset in file that the virtual sectors are mapped to
233 # @filename: filename that is referred to by @offset
238 { 'struct': 'MapEntry',
239 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
240 'zero': 'bool', 'depth': 'int', '*offset': 'int',
241 '*filename': 'str' } }
244 # @BlockdevCacheInfo:
246 # Cache mode information for a block device
248 # @writeback: true if writeback mode is enabled
249 # @direct: true if the host page cache is bypassed (O_DIRECT)
250 # @no-flush: true if flush requests are ignored for the device
254 { 'struct': 'BlockdevCacheInfo',
255 'data': { 'writeback': 'bool',
257 'no-flush': 'bool' } }
262 # Information about the backing device for a block device.
264 # @file: the filename of the backing device
266 # @node-name: the name of the block driver node (Since 2.0)
268 # @ro: true if the backing device was open read-only
270 # @drv: the name of the block format used to open the backing device. As of
271 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
272 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
273 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
274 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
275 # 2.2: 'archipelago' added, 'cow' dropped
276 # 2.3: 'host_floppy' deprecated
277 # 2.5: 'host_floppy' dropped
279 # 2.8: 'replication' added, 'tftp' dropped
280 # 2.9: 'archipelago' dropped
282 # @backing_file: the name of the backing file (for copy-on-write)
284 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
286 # @encrypted: true if the backing device is encrypted
288 # @encryption_key_missing: Deprecated; always false
290 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
292 # @bps: total throughput limit in bytes per second is specified
294 # @bps_rd: read throughput limit in bytes per second is specified
296 # @bps_wr: write throughput limit in bytes per second is specified
298 # @iops: total I/O operations per second is specified
300 # @iops_rd: read I/O operations per second is specified
302 # @iops_wr: write I/O operations per second is specified
304 # @image: the info of image used (since: 1.6)
306 # @bps_max: total throughput limit during bursts,
307 # in bytes (Since 1.7)
309 # @bps_rd_max: read throughput limit during bursts,
310 # in bytes (Since 1.7)
312 # @bps_wr_max: write throughput limit during bursts,
313 # in bytes (Since 1.7)
315 # @iops_max: total I/O operations per second during bursts,
316 # in bytes (Since 1.7)
318 # @iops_rd_max: read I/O operations per second during bursts,
319 # in bytes (Since 1.7)
321 # @iops_wr_max: write I/O operations per second during bursts,
322 # in bytes (Since 1.7)
324 # @bps_max_length: maximum length of the @bps_max burst
325 # period, in seconds. (Since 2.6)
327 # @bps_rd_max_length: maximum length of the @bps_rd_max
328 # burst period, in seconds. (Since 2.6)
330 # @bps_wr_max_length: maximum length of the @bps_wr_max
331 # burst period, in seconds. (Since 2.6)
333 # @iops_max_length: maximum length of the @iops burst
334 # period, in seconds. (Since 2.6)
336 # @iops_rd_max_length: maximum length of the @iops_rd_max
337 # burst period, in seconds. (Since 2.6)
339 # @iops_wr_max_length: maximum length of the @iops_wr_max
340 # burst period, in seconds. (Since 2.6)
342 # @iops_size: an I/O size in bytes (Since 1.7)
344 # @group: throttle group name (Since 2.4)
346 # @cache: the cache mode used for the block device (since: 2.3)
348 # @write_threshold: configured write threshold for the device.
349 # 0 if disabled. (Since 2.3)
354 { 'struct': 'BlockDeviceInfo',
355 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
356 '*backing_file': 'str', 'backing_file_depth': 'int',
357 'encrypted': 'bool', 'encryption_key_missing': 'bool',
358 'detect_zeroes': 'BlockdevDetectZeroesOptions',
359 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
360 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
361 'image': 'ImageInfo',
362 '*bps_max': 'int', '*bps_rd_max': 'int',
363 '*bps_wr_max': 'int', '*iops_max': 'int',
364 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
365 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
366 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
367 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
368 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
369 'write_threshold': 'int' } }
372 # @BlockDeviceIoStatus:
374 # An enumeration of block device I/O status.
376 # @ok: The last I/O operation has succeeded
378 # @failed: The last I/O operation has failed
380 # @nospace: The last I/O operation has failed due to a no-space condition
384 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
387 # @BlockDeviceMapEntry:
389 # Entry in the metadata map of the device (returned by "qemu-img map")
391 # @start: Offset in the image of the first byte described by this entry
394 # @length: Length of the range described by this entry (in bytes)
396 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
397 # before reaching one for which the range is allocated. The value is
398 # in the range 0 to the depth of the image chain - 1.
400 # @zero: the sectors in this range read as zeros
402 # @data: reading the image will actually read data from a file (in particular,
403 # if @offset is present this means that the sectors are not simply
404 # preallocated, but contain actual data in raw format)
406 # @offset: if present, the image file stores the data for this range in
407 # raw format at the given offset.
411 { 'struct': 'BlockDeviceMapEntry',
412 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
413 'data': 'bool', '*offset': 'int' } }
416 # @DirtyBitmapStatus:
418 # An enumeration of possible states that a dirty bitmap can report to the user.
420 # @frozen: The bitmap is currently in-use by a backup operation or block job,
423 # @disabled: The bitmap is currently in-use by an internal operation and is
424 # read-only. It can still be deleted.
426 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
427 # deleted, or used for backup operations.
429 # @locked: The bitmap is currently in-use by some operation and can not be
430 # cleared, deleted, or used for backup operations. (Since 2.12)
434 { 'enum': 'DirtyBitmapStatus',
435 'data': ['active', 'disabled', 'frozen', 'locked'] }
440 # Block dirty bitmap information.
442 # @name: the name of the dirty bitmap (Since 2.4)
444 # @count: number of dirty bytes according to the dirty bitmap
446 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
448 # @status: current status of the dirty bitmap (since 2.4)
452 { 'struct': 'BlockDirtyInfo',
453 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
454 'status': 'DirtyBitmapStatus'} }
457 # @BlockLatencyHistogramInfo:
459 # Block latency histogram.
461 # @boundaries: list of interval boundary values in nanoseconds, all greater
462 # than zero and in ascending order.
463 # For example, the list [10, 50, 100] produces the following
464 # histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
466 # @bins: list of io request counts corresponding to histogram intervals.
467 # len(@bins) = len(@boundaries) + 1
468 # For the example above, @bins may be something like [3, 1, 5, 2],
469 # and corresponding histogram looks like:
476 # +------------------
481 { 'struct': 'BlockLatencyHistogramInfo',
482 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
485 # @x-block-latency-histogram-set:
487 # Manage read, write and flush latency histograms for the device.
489 # If only @device parameter is specified, remove all present latency histograms
490 # for the device. Otherwise, add/reset some of (or all) latency histograms.
492 # @device: device name to set latency histogram for.
494 # @boundaries: list of interval boundary values (see description in
495 # BlockLatencyHistogramInfo definition). If specified, all
496 # latency histograms are removed, and empty ones created for all
497 # io types with intervals corresponding to @boundaries (except for
498 # io types, for which specific boundaries are set through the
499 # following parameters).
501 # @boundaries-read: list of interval boundary values for read latency
502 # histogram. If specified, old read latency histogram is
503 # removed, and empty one created with intervals
504 # corresponding to @boundaries-read. The parameter has higher
505 # priority then @boundaries.
507 # @boundaries-write: list of interval boundary values for write latency
510 # @boundaries-flush: list of interval boundary values for flush latency
513 # Returns: error if device is not found or any boundary arrays are invalid.
517 # Example: set new histograms for all io types with intervals
518 # [0, 10), [10, 50), [50, 100), [100, +inf):
520 # -> { "execute": "block-latency-histogram-set",
521 # "arguments": { "device": "drive0",
522 # "boundaries": [10, 50, 100] } }
523 # <- { "return": {} }
525 # Example: set new histogram only for write, other histograms will remain
526 # not changed (or not created):
528 # -> { "execute": "block-latency-histogram-set",
529 # "arguments": { "device": "drive0",
530 # "boundaries-write": [10, 50, 100] } }
531 # <- { "return": {} }
533 # Example: set new histograms with the following intervals:
534 # read, flush: [0, 10), [10, 50), [50, 100), [100, +inf)
535 # write: [0, 1000), [1000, 5000), [5000, +inf)
537 # -> { "execute": "block-latency-histogram-set",
538 # "arguments": { "device": "drive0",
539 # "boundaries": [10, 50, 100],
540 # "boundaries-write": [1000, 5000] } }
541 # <- { "return": {} }
543 # Example: remove all latency histograms:
545 # -> { "execute": "block-latency-histogram-set",
546 # "arguments": { "device": "drive0" } }
547 # <- { "return": {} }
549 { 'command': 'x-block-latency-histogram-set',
550 'data': {'device': 'str',
551 '*boundaries': ['uint64'],
552 '*boundaries-read': ['uint64'],
553 '*boundaries-write': ['uint64'],
554 '*boundaries-flush': ['uint64'] } }
559 # Block device information. This structure describes a virtual device and
560 # the backing device associated with it.
562 # @device: The device name associated with the virtual device.
564 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
565 # device. (since 2.10)
567 # @type: This field is returned only for compatibility reasons, it should
568 # not be used (always returns 'unknown')
570 # @removable: True if the device supports removable media.
572 # @locked: True if the guest has locked this device from having its media
575 # @tray_open: True if the device's tray is open
576 # (only present if it has a tray)
578 # @dirty-bitmaps: dirty bitmaps information (only present if the
579 # driver has one or more dirty bitmaps) (Since 2.0)
581 # @io-status: @BlockDeviceIoStatus. Only present if the device
582 # supports it and the VM is configured to stop on errors
583 # (supported device models: virtio-blk, IDE, SCSI except
586 # @inserted: @BlockDeviceInfo describing the device if media is
591 { 'struct': 'BlockInfo',
592 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
593 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
594 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
595 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
600 # Image file size calculation information. This structure describes the size
601 # requirements for creating a new image file.
603 # The size requirements depend on the new image file format. File size always
604 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
605 # Compact formats such as 'qcow2' represent unallocated and zero regions
606 # efficiently so file size may be smaller than virtual disk size.
608 # The values are upper bounds that are guaranteed to fit the new image file.
609 # Subsequent modification, such as internal snapshot or bitmap creation, may
610 # require additional space and is not covered here.
612 # @required: Size required for a new image file, in bytes.
614 # @fully-allocated: Image file size, in bytes, once data has been written
619 { 'struct': 'BlockMeasureInfo',
620 'data': {'required': 'int', 'fully-allocated': 'int'} }
625 # Get a list of BlockInfo for all virtual block devices.
627 # Returns: a list of @BlockInfo describing each virtual block device. Filter
628 # nodes that were created implicitly are skipped over.
634 # -> { "execute": "query-block" }
639 # "device":"ide0-hd0",
646 # "file":"disks/test.qcow2",
647 # "backing_file_depth":1,
654 # "bps_max": 8000000,
661 # "detect_zeroes": "on",
662 # "write_threshold": 0,
664 # "filename":"disks/test.qcow2",
666 # "virtual-size":2048000,
667 # "backing_file":"base.qcow2",
668 # "full-backing-filename":"disks/base.qcow2",
669 # "backing-filename-format":"qcow2",
673 # "name": "snapshot1",
674 # "vm-state-size": 0,
675 # "date-sec": 10000200,
677 # "vm-clock-sec": 206,
678 # "vm-clock-nsec": 30
682 # "filename":"disks/base.qcow2",
684 # "virtual-size":2048000
688 # "qdev": "ide_disk",
693 # "device":"ide1-cd0",
696 # "qdev": "/machine/unattached/device[23]",
697 # "tray_open": false,
701 # "device":"floppy0",
704 # "qdev": "/machine/unattached/device[20]",
717 { 'command': 'query-block', 'returns': ['BlockInfo'] }
721 # @BlockDeviceTimedStats:
723 # Statistics of a block device during a given interval of time.
725 # @interval_length: Interval used for calculating the statistics,
728 # @min_rd_latency_ns: Minimum latency of read operations in the
729 # defined interval, in nanoseconds.
731 # @min_wr_latency_ns: Minimum latency of write operations in the
732 # defined interval, in nanoseconds.
734 # @min_flush_latency_ns: Minimum latency of flush operations in the
735 # defined interval, in nanoseconds.
737 # @max_rd_latency_ns: Maximum latency of read operations in the
738 # defined interval, in nanoseconds.
740 # @max_wr_latency_ns: Maximum latency of write operations in the
741 # defined interval, in nanoseconds.
743 # @max_flush_latency_ns: Maximum latency of flush operations in the
744 # defined interval, in nanoseconds.
746 # @avg_rd_latency_ns: Average latency of read operations in the
747 # defined interval, in nanoseconds.
749 # @avg_wr_latency_ns: Average latency of write operations in the
750 # defined interval, in nanoseconds.
752 # @avg_flush_latency_ns: Average latency of flush operations in the
753 # defined interval, in nanoseconds.
755 # @avg_rd_queue_depth: Average number of pending read operations
756 # in the defined interval.
758 # @avg_wr_queue_depth: Average number of pending write operations
759 # in the defined interval.
763 { 'struct': 'BlockDeviceTimedStats',
764 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
765 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
766 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
767 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
768 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
769 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
774 # Statistics of a virtual block device or a block backing device.
776 # @rd_bytes: The number of bytes read by the device.
778 # @wr_bytes: The number of bytes written by the device.
780 # @rd_operations: The number of read operations performed by the device.
782 # @wr_operations: The number of write operations performed by the device.
784 # @flush_operations: The number of cache flush operations performed by the
785 # device (since 0.15.0)
787 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
790 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
792 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
794 # @wr_highest_offset: The offset after the greatest byte written to the
795 # device. The intended use of this information is for
796 # growable sparse files (like qcow2) that are used on top
797 # of a physical device.
799 # @rd_merged: Number of read requests that have been merged into another
800 # request (Since 2.3).
802 # @wr_merged: Number of write requests that have been merged into another
803 # request (Since 2.3).
805 # @idle_time_ns: Time since the last I/O operation, in
806 # nanoseconds. If the field is absent it means that
807 # there haven't been any operations yet (Since 2.5).
809 # @failed_rd_operations: The number of failed read operations
810 # performed by the device (Since 2.5)
812 # @failed_wr_operations: The number of failed write operations
813 # performed by the device (Since 2.5)
815 # @failed_flush_operations: The number of failed flush operations
816 # performed by the device (Since 2.5)
818 # @invalid_rd_operations: The number of invalid read operations
819 # performed by the device (Since 2.5)
821 # @invalid_wr_operations: The number of invalid write operations
822 # performed by the device (Since 2.5)
824 # @invalid_flush_operations: The number of invalid flush operations
825 # performed by the device (Since 2.5)
827 # @account_invalid: Whether invalid operations are included in the
828 # last access statistics (Since 2.5)
830 # @account_failed: Whether failed operations are included in the
831 # latency and last access statistics (Since 2.5)
833 # @timed_stats: Statistics specific to the set of previously defined
834 # intervals of time (Since 2.5)
836 # @x_rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 2.12)
838 # @x_wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 2.12)
840 # @x_flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 2.12)
844 { 'struct': 'BlockDeviceStats',
845 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
846 'wr_operations': 'int', 'flush_operations': 'int',
847 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
848 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
849 'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
850 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
851 'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
852 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
853 'account_invalid': 'bool', 'account_failed': 'bool',
854 'timed_stats': ['BlockDeviceTimedStats'],
855 '*x_rd_latency_histogram': 'BlockLatencyHistogramInfo',
856 '*x_wr_latency_histogram': 'BlockLatencyHistogramInfo',
857 '*x_flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
862 # Statistics of a virtual block device or a block backing device.
864 # @device: If the stats are for a virtual block device, the name
865 # corresponding to the virtual block device.
867 # @node-name: The node name of the device. (Since 2.3)
869 # @stats: A @BlockDeviceStats for the device.
871 # @parent: This describes the file block device if it has one.
872 # Contains recursively the statistics of the underlying
873 # protocol (e.g. the host file for a qcow2 image). If there is
874 # no underlying protocol, this field is omitted
876 # @backing: This describes the backing block device if it has one.
881 { 'struct': 'BlockStats',
882 'data': {'*device': 'str', '*node-name': 'str',
883 'stats': 'BlockDeviceStats',
884 '*parent': 'BlockStats',
885 '*backing': 'BlockStats'} }
890 # Query the @BlockStats for all virtual block devices.
892 # @query-nodes: If true, the command will query all the block nodes
893 # that have a node name, in a list which will include "parent"
894 # information, but not "backing".
895 # If false or omitted, the behavior is as before - query all the
896 # device backends, recursively including their "parent" and
897 # "backing". Filter nodes that were created implicitly are
898 # skipped over in this mode. (Since 2.3)
900 # Returns: A list of @BlockStats for each virtual block devices.
906 # -> { "execute": "query-blockstats" }
910 # "device":"ide0-hd0",
913 # "wr_highest_offset":3686448128,
914 # "wr_bytes":9786368,
915 # "wr_operations":751,
916 # "rd_bytes":122567168,
917 # "rd_operations":36772
918 # "wr_total_times_ns":313253456
919 # "rd_total_times_ns":3465673657
920 # "flush_total_times_ns":49653
921 # "flush_operations":61,
924 # "idle_time_ns":2953431879,
925 # "account_invalid":true,
926 # "account_failed":false
930 # "wr_highest_offset":2821110784,
931 # "wr_bytes":9786368,
932 # "wr_operations":692,
933 # "rd_bytes":122739200,
934 # "rd_operations":36604
935 # "flush_operations":51,
936 # "wr_total_times_ns":313253456
937 # "rd_total_times_ns":3465673657
938 # "flush_total_times_ns":49653,
941 # "idle_time_ns":2953431879,
942 # "account_invalid":true,
943 # "account_failed":false
947 # "device":"ide1-cd0",
949 # "wr_highest_offset":0,
954 # "flush_operations":0,
955 # "wr_total_times_ns":0
956 # "rd_total_times_ns":0
957 # "flush_total_times_ns":0,
960 # "account_invalid":false,
961 # "account_failed":false
965 # "device":"floppy0",
967 # "wr_highest_offset":0,
972 # "flush_operations":0,
973 # "wr_total_times_ns":0
974 # "rd_total_times_ns":0
975 # "flush_total_times_ns":0,
978 # "account_invalid":false,
979 # "account_failed":false
985 # "wr_highest_offset":0,
990 # "flush_operations":0,
991 # "wr_total_times_ns":0
992 # "rd_total_times_ns":0
993 # "flush_total_times_ns":0,
996 # "account_invalid":false,
997 # "account_failed":false
1004 { 'command': 'query-blockstats',
1005 'data': { '*query-nodes': 'bool' },
1006 'returns': ['BlockStats'] }
1011 # An enumeration of possible behaviors for errors on I/O operations.
1012 # The exact meaning depends on whether the I/O was initiated by a guest
1015 # @report: for guest operations, report the error to the guest;
1016 # for jobs, cancel the job
1018 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1019 # or BLOCK_JOB_ERROR)
1021 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1023 # @stop: for guest operations, stop the virtual machine;
1024 # for jobs, pause the job
1026 # @auto: inherit the error handling policy of the backend (since: 2.7)
1030 { 'enum': 'BlockdevOnError',
1031 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1036 # An enumeration of possible behaviors for the initial synchronization
1037 # phase of storage mirroring.
1039 # @top: copies data in the topmost image to the destination
1041 # @full: copies data from all images to the destination
1043 # @none: only copy data written from now on
1045 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
1049 { 'enum': 'MirrorSyncMode',
1050 'data': ['top', 'full', 'none', 'incremental'] }
1055 # Type of a block job.
1057 # @commit: block commit job type, see "block-commit"
1059 # @stream: block stream job type, see "block-stream"
1061 # @mirror: drive mirror job type, see "drive-mirror"
1063 # @backup: drive backup job type, see "drive-backup"
1067 { 'enum': 'BlockJobType',
1068 'data': ['commit', 'stream', 'mirror', 'backup'] }
1073 # Represents command verbs that can be applied to a blockjob.
1075 # @cancel: see @block-job-cancel
1077 # @pause: see @block-job-pause
1079 # @resume: see @block-job-resume
1081 # @set-speed: see @block-job-set-speed
1083 # @complete: see @block-job-complete
1085 # @dismiss: see @block-job-dismiss
1087 # @finalize: see @block-job-finalize
1091 { 'enum': 'BlockJobVerb',
1092 'data': ['cancel', 'pause', 'resume', 'set-speed', 'complete', 'dismiss',
1098 # Indicates the present state of a given blockjob in its lifetime.
1100 # @undefined: Erroneous, default state. Should not ever be visible.
1102 # @created: The job has been created, but not yet started.
1104 # @running: The job is currently running.
1106 # @paused: The job is running, but paused. The pause may be requested by
1107 # either the QMP user or by internal processes.
1109 # @ready: The job is running, but is ready for the user to signal completion.
1110 # This is used for long-running jobs like mirror that are designed to
1113 # @standby: The job is ready, but paused. This is nearly identical to @paused.
1114 # The job may return to @ready or otherwise be canceled.
1116 # @waiting: The job is waiting for other jobs in the transaction to converge
1117 # to the waiting state. This status will likely not be visible for
1118 # the last job in a transaction.
1120 # @pending: The job has finished its work, but has finalization steps that it
1121 # needs to make prior to completing. These changes may require
1122 # manual intervention by the management process if manual was set
1123 # to true. These changes may still fail.
1125 # @aborting: The job is in the process of being aborted, and will finish with
1126 # an error. The job will afterwards report that it is @concluded.
1127 # This status may not be visible to the management process.
1129 # @concluded: The job has finished all work. If manual was set to true, the job
1130 # will remain in the query list until it is dismissed.
1132 # @null: The job is in the process of being dismantled. This state should not
1133 # ever be visible externally.
1137 { 'enum': 'BlockJobStatus',
1138 'data': ['undefined', 'created', 'running', 'paused', 'ready', 'standby',
1139 'waiting', 'pending', 'aborting', 'concluded', 'null' ] }
1144 # Information about a long-running block device operation.
1146 # @type: the job type ('stream' for image streaming)
1148 # @device: The job identifier. Originally the device name but other
1149 # values are allowed since QEMU 2.7
1151 # @len: the maximum progress value
1153 # @busy: false if the job is known to be in a quiescent state, with
1154 # no pending I/O. Since 1.3.
1156 # @paused: whether the job is paused or, if @busy is true, will
1157 # pause itself as soon as possible. Since 1.3.
1159 # @offset: the current progress value
1161 # @speed: the rate limit, bytes per second
1163 # @io-status: the status of the job (since 1.3)
1165 # @ready: true if the job may be completed (since 2.2)
1167 # @status: Current job state/status (since 2.12)
1169 # @auto-finalize: Job will finalize itself when PENDING, moving to
1170 # the CONCLUDED state. (since 2.12)
1172 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1173 # state and disappearing from the query list. (since 2.12)
1177 { 'struct': 'BlockJobInfo',
1178 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1179 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1180 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1181 'status': 'BlockJobStatus',
1182 'auto-finalize': 'bool', 'auto-dismiss': 'bool' } }
1185 # @query-block-jobs:
1187 # Return information about long-running block device operations.
1189 # Returns: a list of @BlockJobInfo for each active block job
1193 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1198 # This command sets the password of a block device that has not been open
1199 # with a password and requires one.
1201 # This command is now obsolete and will always return an error since 2.10
1204 { 'command': 'block_passwd', 'data': {'*device': 'str',
1205 '*node-name': 'str', 'password': 'str'} }
1210 # Resize a block image while a guest is running.
1212 # Either @device or @node-name must be set but not both.
1214 # @device: the name of the device to get the image resized
1216 # @node-name: graph node name to get the image resized (Since 2.0)
1218 # @size: new image size in bytes
1220 # Returns: nothing on success
1221 # If @device is not a valid block device, DeviceNotFound
1227 # -> { "execute": "block_resize",
1228 # "arguments": { "device": "scratch", "size": 1073741824 } }
1229 # <- { "return": {} }
1232 { 'command': 'block_resize', 'data': { '*device': 'str',
1233 '*node-name': 'str',
1239 # An enumeration that tells QEMU how to set the backing file path in
1242 # @existing: QEMU should look for an existing image file.
1244 # @absolute-paths: QEMU should create a new image with absolute paths
1245 # for the backing file. If there is no backing file available, the new
1246 # image will not be backed either.
1250 { 'enum': 'NewImageMode',
1251 'data': [ 'existing', 'absolute-paths' ] }
1254 # @BlockdevSnapshotSync:
1256 # Either @device or @node-name must be set but not both.
1258 # @device: the name of the device to generate the snapshot from.
1260 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1262 # @snapshot-file: the target of the new image. If the file exists, or
1263 # if it is a device, the snapshot will be created in the existing
1264 # file/device. Otherwise, a new file will be created.
1266 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1268 # @format: the format of the snapshot image, default is 'qcow2'.
1270 # @mode: whether and how QEMU should create a new image, default is
1273 { 'struct': 'BlockdevSnapshotSync',
1274 'data': { '*device': 'str', '*node-name': 'str',
1275 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1276 '*format': 'str', '*mode': 'NewImageMode' } }
1279 # @BlockdevSnapshot:
1281 # @node: device or node name that will have a snapshot created.
1283 # @overlay: reference to the existing block device that will become
1284 # the overlay of @node, as part of creating the snapshot.
1285 # It must not have a current backing file (this can be
1286 # achieved by passing "backing": null to blockdev-add).
1290 { 'struct': 'BlockdevSnapshot',
1291 'data': { 'node': 'str', 'overlay': 'str' } }
1296 # @job-id: identifier for the newly-created block job. If
1297 # omitted, the device name will be used. (Since 2.7)
1299 # @device: the device name or node-name of a root node which should be copied.
1301 # @target: the target of the new image. If the file exists, or if it
1302 # is a device, the existing file/device will be used as the new
1303 # destination. If it does not exist, a new file will be created.
1305 # @format: the format of the new destination, default is to
1306 # probe if @mode is 'existing', else the format of the source
1308 # @sync: what parts of the disk image should be copied to the destination
1309 # (all the disk, only the sectors allocated in the topmost image, from a
1310 # dirty bitmap, or only new I/O).
1312 # @mode: whether and how QEMU should create a new image, default is
1315 # @speed: the maximum speed, in bytes per second
1317 # @bitmap: the name of dirty bitmap if sync is "incremental".
1318 # Must be present if sync is "incremental", must NOT be present
1319 # otherwise. (Since 2.4)
1321 # @compress: true to compress data, if the target format supports it.
1322 # (default: false) (since 2.8)
1324 # @on-source-error: the action to take on an error on the source,
1325 # default 'report'. 'stop' and 'enospc' can only be used
1326 # if the block device supports io-status (see BlockInfo).
1328 # @on-target-error: the action to take on an error on the target,
1329 # default 'report' (no limitations, since this applies to
1330 # a different block device than @device).
1332 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1333 # finished its work, waiting for @block-job-finalize.
1334 # When true, this job will automatically perform its abort or
1336 # Defaults to true. (Since 2.12)
1338 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1339 # has completed ceased all work, and wait for @block-job-dismiss.
1340 # When true, this job will automatically disappear from the query
1341 # list without user intervention.
1342 # Defaults to true. (Since 2.12)
1344 # Note: @on-source-error and @on-target-error only affect background
1345 # I/O. If an error occurs during a guest write request, the device's
1346 # rerror/werror actions will be used.
1350 { 'struct': 'DriveBackup',
1351 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1352 '*format': 'str', 'sync': 'MirrorSyncMode',
1353 '*mode': 'NewImageMode', '*speed': 'int',
1354 '*bitmap': 'str', '*compress': 'bool',
1355 '*on-source-error': 'BlockdevOnError',
1356 '*on-target-error': 'BlockdevOnError',
1357 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1362 # @job-id: identifier for the newly-created block job. If
1363 # omitted, the device name will be used. (Since 2.7)
1365 # @device: the device name or node-name of a root node which should be copied.
1367 # @target: the device name or node-name of the backup target node.
1369 # @sync: what parts of the disk image should be copied to the destination
1370 # (all the disk, only the sectors allocated in the topmost image, or
1373 # @speed: the maximum speed, in bytes per second. The default is 0,
1376 # @compress: true to compress data, if the target format supports it.
1377 # (default: false) (since 2.8)
1379 # @on-source-error: the action to take on an error on the source,
1380 # default 'report'. 'stop' and 'enospc' can only be used
1381 # if the block device supports io-status (see BlockInfo).
1383 # @on-target-error: the action to take on an error on the target,
1384 # default 'report' (no limitations, since this applies to
1385 # a different block device than @device).
1387 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1388 # finished its work, waiting for @block-job-finalize.
1389 # When true, this job will automatically perform its abort or
1391 # Defaults to true. (Since 2.12)
1393 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1394 # has completed ceased all work, and wait for @block-job-dismiss.
1395 # When true, this job will automatically disappear from the query
1396 # list without user intervention.
1397 # Defaults to true. (Since 2.12)
1399 # Note: @on-source-error and @on-target-error only affect background
1400 # I/O. If an error occurs during a guest write request, the device's
1401 # rerror/werror actions will be used.
1405 { 'struct': 'BlockdevBackup',
1406 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1407 'sync': 'MirrorSyncMode', '*speed': 'int', '*compress': 'bool',
1408 '*on-source-error': 'BlockdevOnError',
1409 '*on-target-error': 'BlockdevOnError',
1410 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1413 # @blockdev-snapshot-sync:
1415 # Generates a synchronous snapshot of a block device.
1417 # For the arguments, see the documentation of BlockdevSnapshotSync.
1419 # Returns: nothing on success
1420 # If @device is not a valid block device, DeviceNotFound
1426 # -> { "execute": "blockdev-snapshot-sync",
1427 # "arguments": { "device": "ide-hd0",
1429 # "/some/place/my-image",
1430 # "format": "qcow2" } }
1431 # <- { "return": {} }
1434 { 'command': 'blockdev-snapshot-sync',
1435 'data': 'BlockdevSnapshotSync' }
1439 # @blockdev-snapshot:
1441 # Generates a snapshot of a block device.
1443 # Create a snapshot, by installing 'node' as the backing image of
1444 # 'overlay'. Additionally, if 'node' is associated with a block
1445 # device, the block device changes to using 'overlay' as its new active
1448 # For the arguments, see the documentation of BlockdevSnapshot.
1454 # -> { "execute": "blockdev-add",
1455 # "arguments": { "driver": "qcow2",
1456 # "node-name": "node1534",
1457 # "file": { "driver": "file",
1458 # "filename": "hd1.qcow2" },
1459 # "backing": null } }
1461 # <- { "return": {} }
1463 # -> { "execute": "blockdev-snapshot",
1464 # "arguments": { "node": "ide-hd0",
1465 # "overlay": "node1534" } }
1466 # <- { "return": {} }
1469 { 'command': 'blockdev-snapshot',
1470 'data': 'BlockdevSnapshot' }
1473 # @change-backing-file:
1475 # Change the backing file in the image file metadata. This does not
1476 # cause QEMU to reopen the image file to reparse the backing filename
1477 # (it may, however, perform a reopen to change permissions from
1478 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1479 # into the image file metadata, and the QEMU internal strings are
1482 # @image-node-name: The name of the block driver state node of the
1483 # image to modify. The "device" argument is used
1484 # to verify "image-node-name" is in the chain
1485 # described by "device".
1487 # @device: The device name or node-name of the root node that owns
1490 # @backing-file: The string to write as the backing file. This
1491 # string is not validated, so care should be taken
1492 # when specifying the string or the image chain may
1493 # not be able to be reopened again.
1495 # Returns: Nothing on success
1497 # If "device" does not exist or cannot be determined, DeviceNotFound
1501 { 'command': 'change-backing-file',
1502 'data': { 'device': 'str', 'image-node-name': 'str',
1503 'backing-file': 'str' } }
1508 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1509 # writes data between 'top' and 'base' into 'base'.
1511 # @job-id: identifier for the newly-created block job. If
1512 # omitted, the device name will be used. (Since 2.7)
1514 # @device: the device name or node-name of a root node
1516 # @base: The file name of the backing image to write data into.
1517 # If not specified, this is the deepest backing image.
1519 # @top: The file name of the backing image within the image chain,
1520 # which contains the topmost data to be committed down. If
1521 # not specified, this is the active layer.
1523 # @backing-file: The backing file string to write into the overlay
1524 # image of 'top'. If 'top' is the active layer,
1525 # specifying a backing file string is an error. This
1526 # filename is not validated.
1528 # If a pathname string is such that it cannot be
1529 # resolved by QEMU, that means that subsequent QMP or
1530 # HMP commands must use node-names for the image in
1531 # question, as filename lookup methods will fail.
1533 # If not specified, QEMU will automatically determine
1534 # the backing file string to use, or error out if
1535 # there is no obvious choice. Care should be taken
1536 # when specifying the string, to specify a valid
1537 # filename or protocol.
1540 # If top == base, that is an error.
1541 # If top == active, the job will not be completed by itself,
1542 # user needs to complete the job with the block-job-complete
1543 # command after getting the ready event. (Since 2.0)
1545 # If the base image is smaller than top, then the base image
1546 # will be resized to be the same size as top. If top is
1547 # smaller than the base image, the base will not be
1548 # truncated. If you want the base image size to match the
1549 # size of the smaller top, you can safely truncate it
1550 # yourself once the commit operation successfully completes.
1552 # @speed: the maximum speed, in bytes per second
1554 # @filter-node-name: the node name that should be assigned to the
1555 # filter driver that the commit job inserts into the graph
1556 # above @top. If this option is not given, a node name is
1557 # autogenerated. (Since: 2.9)
1559 # Returns: Nothing on success
1560 # If commit or stream is already active on this device, DeviceInUse
1561 # If @device does not exist, DeviceNotFound
1562 # If image commit is not supported by this device, NotSupported
1563 # If @base or @top is invalid, a generic error is returned
1564 # If @speed is invalid, InvalidParameter
1570 # -> { "execute": "block-commit",
1571 # "arguments": { "device": "virtio0",
1572 # "top": "/tmp/snap1.qcow2" } }
1573 # <- { "return": {} }
1576 { 'command': 'block-commit',
1577 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
1578 '*backing-file': 'str', '*speed': 'int',
1579 '*filter-node-name': 'str' } }
1584 # Start a point-in-time copy of a block device to a new destination. The
1585 # status of ongoing drive-backup operations can be checked with
1586 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1587 # The operation can be stopped before it has completed using the
1588 # block-job-cancel command.
1590 # Returns: nothing on success
1591 # If @device is not a valid block device, GenericError
1597 # -> { "execute": "drive-backup",
1598 # "arguments": { "device": "drive0",
1600 # "target": "backup.img" } }
1601 # <- { "return": {} }
1604 { 'command': 'drive-backup', 'boxed': true,
1605 'data': 'DriveBackup' }
1610 # Start a point-in-time copy of a block device to a new destination. The
1611 # status of ongoing blockdev-backup operations can be checked with
1612 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1613 # The operation can be stopped before it has completed using the
1614 # block-job-cancel command.
1616 # Returns: nothing on success
1617 # If @device is not a valid block device, DeviceNotFound
1622 # -> { "execute": "blockdev-backup",
1623 # "arguments": { "device": "src-id",
1625 # "target": "tgt-id" } }
1626 # <- { "return": {} }
1629 { 'command': 'blockdev-backup', 'boxed': true,
1630 'data': 'BlockdevBackup' }
1634 # @query-named-block-nodes:
1636 # Get the named block driver list
1638 # Returns: the list of BlockDeviceInfo
1644 # -> { "execute": "query-named-block-nodes" }
1645 # <- { "return": [ { "ro":false,
1647 # "encrypted":false,
1648 # "file":"disks/test.qcow2",
1649 # "node-name": "my-node",
1650 # "backing_file_depth":1,
1657 # "bps_max": 8000000,
1664 # "write_threshold": 0,
1666 # "filename":"disks/test.qcow2",
1668 # "virtual-size":2048000,
1669 # "backing_file":"base.qcow2",
1670 # "full-backing-filename":"disks/base.qcow2",
1671 # "backing-filename-format":"qcow2",
1675 # "name": "snapshot1",
1676 # "vm-state-size": 0,
1677 # "date-sec": 10000200,
1679 # "vm-clock-sec": 206,
1680 # "vm-clock-nsec": 30
1684 # "filename":"disks/base.qcow2",
1686 # "virtual-size":2048000
1691 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1696 # Start mirroring a block device's writes to a new destination. target
1697 # specifies the target of the new image. If the file exists, or if it
1698 # is a device, it will be used as the new destination for writes. If
1699 # it does not exist, a new file will be created. format specifies the
1700 # format of the mirror image, default is to probe if mode='existing',
1701 # else the format of the source.
1703 # Returns: nothing on success
1704 # If @device is not a valid block device, GenericError
1710 # -> { "execute": "drive-mirror",
1711 # "arguments": { "device": "ide-hd0",
1712 # "target": "/some/place/my-image",
1714 # "format": "qcow2" } }
1715 # <- { "return": {} }
1718 { 'command': 'drive-mirror', 'boxed': true,
1719 'data': 'DriveMirror' }
1724 # A set of parameters describing drive mirror setup.
1726 # @job-id: identifier for the newly-created block job. If
1727 # omitted, the device name will be used. (Since 2.7)
1729 # @device: the device name or node-name of a root node whose writes should be
1732 # @target: the target of the new image. If the file exists, or if it
1733 # is a device, the existing file/device will be used as the new
1734 # destination. If it does not exist, a new file will be created.
1736 # @format: the format of the new destination, default is to
1737 # probe if @mode is 'existing', else the format of the source
1739 # @node-name: the new block driver state node name in the graph
1742 # @replaces: with sync=full graph node name to be replaced by the new
1743 # image when a whole image copy is done. This can be used to repair
1744 # broken Quorum files. (Since 2.1)
1746 # @mode: whether and how QEMU should create a new image, default is
1749 # @speed: the maximum speed, in bytes per second
1751 # @sync: what parts of the disk image should be copied to the destination
1752 # (all the disk, only the sectors allocated in the topmost image, or
1755 # @granularity: granularity of the dirty bitmap, default is 64K
1756 # if the image format doesn't have clusters, 4K if the clusters
1757 # are smaller than that, else the cluster size. Must be a
1758 # power of 2 between 512 and 64M (since 1.4).
1760 # @buf-size: maximum amount of data in flight from source to
1761 # target (since 1.4).
1763 # @on-source-error: the action to take on an error on the source,
1764 # default 'report'. 'stop' and 'enospc' can only be used
1765 # if the block device supports io-status (see BlockInfo).
1767 # @on-target-error: the action to take on an error on the target,
1768 # default 'report' (no limitations, since this applies to
1769 # a different block device than @device).
1770 # @unmap: Whether to try to unmap target sectors where source has
1771 # only zero. If true, and target unallocated sectors will read as zero,
1772 # target image sectors will be unmapped; otherwise, zeroes will be
1773 # written. Both will result in identical contents.
1774 # Default is true. (Since 2.4)
1778 { 'struct': 'DriveMirror',
1779 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1780 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1781 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1782 '*speed': 'int', '*granularity': 'uint32',
1783 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1784 '*on-target-error': 'BlockdevOnError',
1785 '*unmap': 'bool' } }
1788 # @BlockDirtyBitmap:
1790 # @node: name of device/node which the bitmap is tracking
1792 # @name: name of the dirty bitmap
1796 { 'struct': 'BlockDirtyBitmap',
1797 'data': { 'node': 'str', 'name': 'str' } }
1800 # @BlockDirtyBitmapAdd:
1802 # @node: name of device/node which the bitmap is tracking
1804 # @name: name of the dirty bitmap
1806 # @granularity: the bitmap granularity, default is 64k for
1807 # block-dirty-bitmap-add
1809 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1810 # corresponding block device image file on its close. For now only
1811 # Qcow2 disks support persistent bitmaps. Default is false for
1812 # block-dirty-bitmap-add. (Since: 2.10)
1814 # @autoload: ignored and deprecated since 2.12.
1815 # Currently, all dirty tracking bitmaps are loaded from Qcow2 on
1820 { 'struct': 'BlockDirtyBitmapAdd',
1821 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1822 '*persistent': 'bool', '*autoload': 'bool' } }
1825 # @block-dirty-bitmap-add:
1827 # Create a dirty bitmap with a name on the node, and start tracking the writes.
1829 # Returns: nothing on success
1830 # If @node is not a valid block device or node, DeviceNotFound
1831 # If @name is already taken, GenericError with an explanation
1837 # -> { "execute": "block-dirty-bitmap-add",
1838 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1839 # <- { "return": {} }
1842 { 'command': 'block-dirty-bitmap-add',
1843 'data': 'BlockDirtyBitmapAdd' }
1846 # @block-dirty-bitmap-remove:
1848 # Stop write tracking and remove the dirty bitmap that was created
1849 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
1852 # Returns: nothing on success
1853 # If @node is not a valid block device or node, DeviceNotFound
1854 # If @name is not found, GenericError with an explanation
1855 # if @name is frozen by an operation, GenericError
1861 # -> { "execute": "block-dirty-bitmap-remove",
1862 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1863 # <- { "return": {} }
1866 { 'command': 'block-dirty-bitmap-remove',
1867 'data': 'BlockDirtyBitmap' }
1870 # @block-dirty-bitmap-clear:
1872 # Clear (reset) a dirty bitmap on the device, so that an incremental
1873 # backup from this point in time forward will only backup clusters
1874 # modified after this clear operation.
1876 # Returns: nothing on success
1877 # If @node is not a valid block device, DeviceNotFound
1878 # If @name is not found, GenericError with an explanation
1884 # -> { "execute": "block-dirty-bitmap-clear",
1885 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1886 # <- { "return": {} }
1889 { 'command': 'block-dirty-bitmap-clear',
1890 'data': 'BlockDirtyBitmap' }
1893 # @BlockDirtyBitmapSha256:
1895 # SHA256 hash of dirty bitmap data
1897 # @sha256: ASCII representation of SHA256 bitmap hash
1901 { 'struct': 'BlockDirtyBitmapSha256',
1902 'data': {'sha256': 'str'} }
1905 # @x-debug-block-dirty-bitmap-sha256:
1909 # Returns: BlockDirtyBitmapSha256 on success
1910 # If @node is not a valid block device, DeviceNotFound
1911 # If @name is not found or if hashing has failed, GenericError with an
1916 { 'command': 'x-debug-block-dirty-bitmap-sha256',
1917 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
1922 # Start mirroring a block device's writes to a new destination.
1924 # @job-id: identifier for the newly-created block job. If
1925 # omitted, the device name will be used. (Since 2.7)
1927 # @device: The device name or node-name of a root node whose writes should be
1930 # @target: the id or node-name of the block device to mirror to. This mustn't be
1931 # attached to guest.
1933 # @replaces: with sync=full graph node name to be replaced by the new
1934 # image when a whole image copy is done. This can be used to repair
1935 # broken Quorum files.
1937 # @speed: the maximum speed, in bytes per second
1939 # @sync: what parts of the disk image should be copied to the destination
1940 # (all the disk, only the sectors allocated in the topmost image, or
1943 # @granularity: granularity of the dirty bitmap, default is 64K
1944 # if the image format doesn't have clusters, 4K if the clusters
1945 # are smaller than that, else the cluster size. Must be a
1946 # power of 2 between 512 and 64M
1948 # @buf-size: maximum amount of data in flight from source to
1951 # @on-source-error: the action to take on an error on the source,
1952 # default 'report'. 'stop' and 'enospc' can only be used
1953 # if the block device supports io-status (see BlockInfo).
1955 # @on-target-error: the action to take on an error on the target,
1956 # default 'report' (no limitations, since this applies to
1957 # a different block device than @device).
1959 # @filter-node-name: the node name that should be assigned to the
1960 # filter driver that the mirror job inserts into the graph
1961 # above @device. If this option is not given, a node name is
1962 # autogenerated. (Since: 2.9)
1964 # Returns: nothing on success.
1970 # -> { "execute": "blockdev-mirror",
1971 # "arguments": { "device": "ide-hd0",
1972 # "target": "target0",
1973 # "sync": "full" } }
1974 # <- { "return": {} }
1977 { 'command': 'blockdev-mirror',
1978 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1980 'sync': 'MirrorSyncMode',
1981 '*speed': 'int', '*granularity': 'uint32',
1982 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1983 '*on-target-error': 'BlockdevOnError',
1984 '*filter-node-name': 'str' } }
1987 # @block_set_io_throttle:
1989 # Change I/O throttle limits for a block drive.
1991 # Since QEMU 2.4, each device with I/O limits is member of a throttle
1994 # If two or more devices are members of the same group, the limits
1995 # will apply to the combined I/O of the whole group in a round-robin
1996 # fashion. Therefore, setting new I/O limits to a device will affect
1999 # The name of the group can be specified using the 'group' parameter.
2000 # If the parameter is unset, it is assumed to be the current group of
2001 # that device. If it's not in any group yet, the name of the device
2002 # will be used as the name for its group.
2004 # The 'group' parameter can also be used to move a device to a
2005 # different group. In this case the limits specified in the parameters
2006 # will be applied to the new group only.
2008 # I/O limits can be disabled by setting all of them to 0. In this case
2009 # the device will be removed from its group and the rest of its
2010 # members will not be affected. The 'group' parameter is ignored.
2012 # Returns: Nothing on success
2013 # If @device is not a valid block device, DeviceNotFound
2019 # -> { "execute": "block_set_io_throttle",
2020 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
2033 # "bps_max_length": 0,
2034 # "iops_size": 0 } }
2035 # <- { "return": {} }
2037 # -> { "execute": "block_set_io_throttle",
2038 # "arguments": { "id": "ide0-1-0",
2045 # "bps_max": 8000000,
2051 # "bps_max_length": 60,
2052 # "iops_size": 0 } }
2053 # <- { "return": {} }
2055 { 'command': 'block_set_io_throttle', 'boxed': true,
2056 'data': 'BlockIOThrottle' }
2061 # A set of parameters describing block throttling.
2063 # @device: Block device name (deprecated, use @id instead)
2065 # @id: The name or QOM path of the guest device (since: 2.8)
2067 # @bps: total throughput limit in bytes per second
2069 # @bps_rd: read throughput limit in bytes per second
2071 # @bps_wr: write throughput limit in bytes per second
2073 # @iops: total I/O operations per second
2075 # @iops_rd: read I/O operations per second
2077 # @iops_wr: write I/O operations per second
2079 # @bps_max: total throughput limit during bursts,
2080 # in bytes (Since 1.7)
2082 # @bps_rd_max: read throughput limit during bursts,
2083 # in bytes (Since 1.7)
2085 # @bps_wr_max: write throughput limit during bursts,
2086 # in bytes (Since 1.7)
2088 # @iops_max: total I/O operations per second during bursts,
2089 # in bytes (Since 1.7)
2091 # @iops_rd_max: read I/O operations per second during bursts,
2092 # in bytes (Since 1.7)
2094 # @iops_wr_max: write I/O operations per second during bursts,
2095 # in bytes (Since 1.7)
2097 # @bps_max_length: maximum length of the @bps_max burst
2098 # period, in seconds. It must only
2099 # be set if @bps_max is set as well.
2100 # Defaults to 1. (Since 2.6)
2102 # @bps_rd_max_length: maximum length of the @bps_rd_max
2103 # burst period, in seconds. It must only
2104 # be set if @bps_rd_max is set as well.
2105 # Defaults to 1. (Since 2.6)
2107 # @bps_wr_max_length: maximum length of the @bps_wr_max
2108 # burst period, in seconds. It must only
2109 # be set if @bps_wr_max is set as well.
2110 # Defaults to 1. (Since 2.6)
2112 # @iops_max_length: maximum length of the @iops burst
2113 # period, in seconds. It must only
2114 # be set if @iops_max is set as well.
2115 # Defaults to 1. (Since 2.6)
2117 # @iops_rd_max_length: maximum length of the @iops_rd_max
2118 # burst period, in seconds. It must only
2119 # be set if @iops_rd_max is set as well.
2120 # Defaults to 1. (Since 2.6)
2122 # @iops_wr_max_length: maximum length of the @iops_wr_max
2123 # burst period, in seconds. It must only
2124 # be set if @iops_wr_max is set as well.
2125 # Defaults to 1. (Since 2.6)
2127 # @iops_size: an I/O size in bytes (Since 1.7)
2129 # @group: throttle group name (Since 2.4)
2133 { 'struct': 'BlockIOThrottle',
2134 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2135 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2136 '*bps_max': 'int', '*bps_rd_max': 'int',
2137 '*bps_wr_max': 'int', '*iops_max': 'int',
2138 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2139 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2140 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2141 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2142 '*iops_size': 'int', '*group': 'str' } }
2147 # Limit parameters for throttling.
2148 # Since some limit combinations are illegal, limits should always be set in one
2149 # transaction. All fields are optional. When setting limits, if a field is
2150 # missing the current value is not changed.
2152 # @iops-total: limit total I/O operations per second
2153 # @iops-total-max: I/O operations burst
2154 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2155 # It must only be set if @iops-total-max is set as well.
2156 # @iops-read: limit read operations per second
2157 # @iops-read-max: I/O operations read burst
2158 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2159 # It must only be set if @iops-read-max is set as well.
2160 # @iops-write: limit write operations per second
2161 # @iops-write-max: I/O operations write burst
2162 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2163 # It must only be set if @iops-write-max is set as well.
2164 # @bps-total: limit total bytes per second
2165 # @bps-total-max: total bytes burst
2166 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2167 # It must only be set if @bps-total-max is set as well.
2168 # @bps-read: limit read bytes per second
2169 # @bps-read-max: total bytes read burst
2170 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2171 # It must only be set if @bps-read-max is set as well.
2172 # @bps-write: limit write bytes per second
2173 # @bps-write-max: total bytes write burst
2174 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2175 # It must only be set if @bps-write-max is set as well.
2176 # @iops-size: when limiting by iops max size of an I/O in bytes
2180 { 'struct': 'ThrottleLimits',
2181 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2182 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2183 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2184 '*iops-write' : 'int', '*iops-write-max' : 'int',
2185 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2186 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2187 '*bps-read' : 'int', '*bps-read-max' : 'int',
2188 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2189 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2190 '*iops-size' : 'int' } }
2195 # Copy data from a backing file into a block device.
2197 # The block streaming operation is performed in the background until the entire
2198 # backing file has been copied. This command returns immediately once streaming
2199 # has started. The status of ongoing block streaming operations can be checked
2200 # with query-block-jobs. The operation can be stopped before it has completed
2201 # using the block-job-cancel command.
2203 # The node that receives the data is called the top image, can be located in
2204 # any part of the chain (but always above the base image; see below) and can be
2205 # specified using its device or node name. Earlier qemu versions only allowed
2206 # 'device' to name the top level node; presence of the 'base-node' parameter
2207 # during introspection can be used as a witness of the enhanced semantics
2210 # If a base file is specified then sectors are not copied from that base file and
2211 # its backing chain. When streaming completes the image file will have the base
2212 # file as its backing file. This can be used to stream a subset of the backing
2213 # file chain instead of flattening the entire image.
2215 # On successful completion the image file is updated to drop the backing file
2216 # and the BLOCK_JOB_COMPLETED event is emitted.
2218 # @job-id: identifier for the newly-created block job. If
2219 # omitted, the device name will be used. (Since 2.7)
2221 # @device: the device or node name of the top image
2223 # @base: the common backing file name.
2224 # It cannot be set if @base-node is also set.
2226 # @base-node: the node name of the backing file.
2227 # It cannot be set if @base is also set. (Since 2.8)
2229 # @backing-file: The backing file string to write into the top
2230 # image. This filename is not validated.
2232 # If a pathname string is such that it cannot be
2233 # resolved by QEMU, that means that subsequent QMP or
2234 # HMP commands must use node-names for the image in
2235 # question, as filename lookup methods will fail.
2237 # If not specified, QEMU will automatically determine
2238 # the backing file string to use, or error out if there
2239 # is no obvious choice. Care should be taken when
2240 # specifying the string, to specify a valid filename or
2244 # @speed: the maximum speed, in bytes per second
2246 # @on-error: the action to take on an error (default report).
2247 # 'stop' and 'enospc' can only be used if the block device
2248 # supports io-status (see BlockInfo). Since 1.3.
2250 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
2256 # -> { "execute": "block-stream",
2257 # "arguments": { "device": "virtio0",
2258 # "base": "/tmp/master.qcow2" } }
2259 # <- { "return": {} }
2262 { 'command': 'block-stream',
2263 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2264 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2265 '*on-error': 'BlockdevOnError' } }
2268 # @block-job-set-speed:
2270 # Set maximum speed for a background block operation.
2272 # This command can only be issued when there is an active block job.
2274 # Throttling can be disabled by setting the speed to 0.
2276 # @device: The job identifier. This used to be a device name (hence
2277 # the name of the parameter), but since QEMU 2.7 it can have
2280 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2283 # Returns: Nothing on success
2284 # If no background operation is active on this device, DeviceNotActive
2288 { 'command': 'block-job-set-speed',
2289 'data': { 'device': 'str', 'speed': 'int' } }
2292 # @block-job-cancel:
2294 # Stop an active background block operation.
2296 # This command returns immediately after marking the active background block
2297 # operation for cancellation. It is an error to call this command if no
2298 # operation is in progress.
2300 # The operation will cancel as soon as possible and then emit the
2301 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2302 # enumerated using query-block-jobs.
2304 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2305 # (via the event BLOCK_JOB_READY) that the source and destination are
2306 # synchronized, then the event triggered by this command changes to
2307 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2308 # destination now has a point-in-time copy tied to the time of the cancellation.
2310 # For streaming, the image file retains its backing file unless the streaming
2311 # operation happens to complete just as it is being cancelled. A new streaming
2312 # operation can be started at a later time to finish copying all data from the
2315 # @device: The job identifier. This used to be a device name (hence
2316 # the name of the parameter), but since QEMU 2.7 it can have
2319 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2320 # abandon the job immediately (even if it is paused) instead of waiting
2321 # for the destination to complete its final synchronization (since 1.3)
2323 # Returns: Nothing on success
2324 # If no background operation is active on this device, DeviceNotActive
2328 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2333 # Pause an active background block operation.
2335 # This command returns immediately after marking the active background block
2336 # operation for pausing. It is an error to call this command if no
2337 # operation is in progress. Pausing an already paused job has no cumulative
2338 # effect; a single block-job-resume command will resume the job.
2340 # The operation will pause as soon as possible. No event is emitted when
2341 # the operation is actually paused. Cancelling a paused job automatically
2344 # @device: The job identifier. This used to be a device name (hence
2345 # the name of the parameter), but since QEMU 2.7 it can have
2348 # Returns: Nothing on success
2349 # If no background operation is active on this device, DeviceNotActive
2353 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2356 # @block-job-resume:
2358 # Resume an active background block operation.
2360 # This command returns immediately after resuming a paused background block
2361 # operation. It is an error to call this command if no operation is in
2362 # progress. Resuming an already running job is not an error.
2364 # This command also clears the error status of the job.
2366 # @device: The job identifier. This used to be a device name (hence
2367 # the name of the parameter), but since QEMU 2.7 it can have
2370 # Returns: Nothing on success
2371 # If no background operation is active on this device, DeviceNotActive
2375 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2378 # @block-job-complete:
2380 # Manually trigger completion of an active background block operation. This
2381 # is supported for drive mirroring, where it also switches the device to
2382 # write to the target path only. The ability to complete is signaled with
2383 # a BLOCK_JOB_READY event.
2385 # This command completes an active background block operation synchronously.
2386 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2387 # is not defined. Note that if an I/O error occurs during the processing of
2388 # this command: 1) the command itself will fail; 2) the error will be processed
2389 # according to the rerror/werror arguments that were specified when starting
2392 # A cancelled or paused job cannot be completed.
2394 # @device: The job identifier. This used to be a device name (hence
2395 # the name of the parameter), but since QEMU 2.7 it can have
2398 # Returns: Nothing on success
2399 # If no background operation is active on this device, DeviceNotActive
2403 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2406 # @block-job-dismiss:
2408 # For jobs that have already concluded, remove them from the block-job-query
2409 # list. This command only needs to be run for jobs which were started with
2410 # QEMU 2.12+ job lifetime management semantics.
2412 # This command will refuse to operate on any job that has not yet reached
2413 # its terminal state, BLOCK_JOB_STATUS_CONCLUDED. For jobs that make use of
2414 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2415 # to be used as appropriate.
2417 # @id: The job identifier.
2419 # Returns: Nothing on success
2423 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2426 # @block-job-finalize:
2428 # Once a job that has manual=true reaches the pending state, it can be
2429 # instructed to finalize any graph changes and do any necessary cleanup
2431 # For jobs in a transaction, instructing one job to finalize will force
2432 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2433 # a single member job to finalize.
2435 # @id: The job identifier.
2437 # Returns: Nothing on success
2441 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2444 # @BlockdevDiscardOptions:
2446 # Determines how to handle discard requests.
2448 # @ignore: Ignore the request
2449 # @unmap: Forward as an unmap request
2453 { 'enum': 'BlockdevDiscardOptions',
2454 'data': [ 'ignore', 'unmap' ] }
2457 # @BlockdevDetectZeroesOptions:
2459 # Describes the operation mode for the automatic conversion of plain
2460 # zero writes by the OS to driver specific optimized zero write commands.
2462 # @off: Disabled (default)
2464 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2465 # also that @BlockdevDiscardOptions is set to unmap for this device.
2469 { 'enum': 'BlockdevDetectZeroesOptions',
2470 'data': [ 'off', 'on', 'unmap' ] }
2473 # @BlockdevAioOptions:
2475 # Selects the AIO backend to handle I/O requests
2477 # @threads: Use qemu's thread pool
2478 # @native: Use native AIO backend (only Linux and Windows)
2482 { 'enum': 'BlockdevAioOptions',
2483 'data': [ 'threads', 'native' ] }
2486 # @BlockdevCacheOptions:
2488 # Includes cache-related options for block devices
2490 # @direct: enables use of O_DIRECT (bypass the host page cache;
2492 # @no-flush: ignore any flush requests for the device (default:
2497 { 'struct': 'BlockdevCacheOptions',
2498 'data': { '*direct': 'bool',
2499 '*no-flush': 'bool' } }
2504 # Drivers that are supported in block device operations.
2507 # @throttle: Since 2.11
2512 { 'enum': 'BlockdevDriver',
2513 'data': [ 'blkdebug', 'blkverify', 'bochs', 'cloop',
2514 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
2515 'host_device', 'http', 'https', 'iscsi', 'luks', 'nbd', 'nfs',
2516 'null-aio', 'null-co', 'nvme', 'parallels', 'qcow', 'qcow2', 'qed',
2517 'quorum', 'raw', 'rbd', 'replication', 'sheepdog', 'ssh',
2518 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2521 # @BlockdevOptionsFile:
2523 # Driver specific block device options for the file backend.
2525 # @filename: path to the image file
2526 # @pr-manager: the id for the object that will handle persistent reservations
2527 # for this device (default: none, forward the commands via SG_IO;
2529 # @aio: AIO backend (default: threads) (since: 2.8)
2530 # @locking: whether to enable file locking. If set to 'auto', only enable
2531 # when Open File Descriptor (OFD) locking API is available
2532 # (default: auto, since 2.10)
2533 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2534 # migration. May cause noticeable delays if the image
2535 # file is large, do not use in production.
2536 # (default: off) (since: 2.13)
2540 { 'struct': 'BlockdevOptionsFile',
2541 'data': { 'filename': 'str',
2542 '*pr-manager': 'str',
2543 '*locking': 'OnOffAuto',
2544 '*aio': 'BlockdevAioOptions',
2545 '*x-check-cache-dropped': 'bool' } }
2548 # @BlockdevOptionsNull:
2550 # Driver specific block device options for the null backend.
2552 # @size: size of the device in bytes.
2553 # @latency-ns: emulated latency (in nanoseconds) in processing
2554 # requests. Default to zero which completes requests immediately.
2559 { 'struct': 'BlockdevOptionsNull',
2560 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
2563 # @BlockdevOptionsNVMe:
2565 # Driver specific block device options for the NVMe backend.
2567 # @device: controller address of the NVMe device.
2568 # @namespace: namespace number of the device, starting from 1.
2572 { 'struct': 'BlockdevOptionsNVMe',
2573 'data': { 'device': 'str', 'namespace': 'int' } }
2576 # @BlockdevOptionsVVFAT:
2578 # Driver specific block device options for the vvfat protocol.
2580 # @dir: directory to be exported as FAT image
2581 # @fat-type: FAT type: 12, 16 or 32
2582 # @floppy: whether to export a floppy image (true) or
2583 # partitioned hard disk (false; default)
2584 # @label: set the volume label, limited to 11 bytes. FAT16 and
2585 # FAT32 traditionally have some restrictions on labels, which are
2586 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2588 # @rw: whether to allow write operations (default: false)
2592 { 'struct': 'BlockdevOptionsVVFAT',
2593 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2594 '*label': 'str', '*rw': 'bool' } }
2597 # @BlockdevOptionsGenericFormat:
2599 # Driver specific block device options for image format that have no option
2600 # besides their data source.
2602 # @file: reference to or definition of the data source block device
2606 { 'struct': 'BlockdevOptionsGenericFormat',
2607 'data': { 'file': 'BlockdevRef' } }
2610 # @BlockdevOptionsLUKS:
2612 # Driver specific block device options for LUKS.
2614 # @key-secret: the ID of a QCryptoSecret object providing
2615 # the decryption key (since 2.6). Mandatory except when
2616 # doing a metadata-only probe of the image.
2620 { 'struct': 'BlockdevOptionsLUKS',
2621 'base': 'BlockdevOptionsGenericFormat',
2622 'data': { '*key-secret': 'str' } }
2626 # @BlockdevOptionsGenericCOWFormat:
2628 # Driver specific block device options for image format that have no option
2629 # besides their data source and an optional backing file.
2631 # @backing: reference to or definition of the backing file block
2632 # device, null disables the backing file entirely.
2633 # Defaults to the backing file stored the image file.
2637 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2638 'base': 'BlockdevOptionsGenericFormat',
2639 'data': { '*backing': 'BlockdevRefOrNull' } }
2642 # @Qcow2OverlapCheckMode:
2644 # General overlap check modes.
2646 # @none: Do not perform any checks
2648 # @constant: Perform only checks which can be done in constant time and
2649 # without reading anything from disk
2651 # @cached: Perform only checks which can be done without reading anything
2654 # @all: Perform all available overlap checks
2658 { 'enum': 'Qcow2OverlapCheckMode',
2659 'data': [ 'none', 'constant', 'cached', 'all' ] }
2662 # @Qcow2OverlapCheckFlags:
2664 # Structure of flags for each metadata structure. Setting a field to 'true'
2665 # makes qemu guard that structure against unintended overwriting. The default
2666 # value is chosen according to the template given.
2668 # @template: Specifies a template mode which can be adjusted using the other
2669 # flags, defaults to 'cached'
2673 { 'struct': 'Qcow2OverlapCheckFlags',
2674 'data': { '*template': 'Qcow2OverlapCheckMode',
2675 '*main-header': 'bool',
2676 '*active-l1': 'bool',
2677 '*active-l2': 'bool',
2678 '*refcount-table': 'bool',
2679 '*refcount-block': 'bool',
2680 '*snapshot-table': 'bool',
2681 '*inactive-l1': 'bool',
2682 '*inactive-l2': 'bool' } }
2685 # @Qcow2OverlapChecks:
2687 # Specifies which metadata structures should be guarded against unintended
2690 # @flags: set of flags for separate specification of each metadata structure
2693 # @mode: named mode which chooses a specific set of flags
2697 { 'alternate': 'Qcow2OverlapChecks',
2698 'data': { 'flags': 'Qcow2OverlapCheckFlags',
2699 'mode': 'Qcow2OverlapCheckMode' } }
2702 # @BlockdevQcowEncryptionFormat:
2704 # @aes: AES-CBC with plain64 initialization vectors
2708 { 'enum': 'BlockdevQcowEncryptionFormat',
2712 # @BlockdevQcowEncryption:
2716 { 'union': 'BlockdevQcowEncryption',
2717 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
2718 'discriminator': 'format',
2719 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
2722 # @BlockdevOptionsQcow:
2724 # Driver specific block device options for qcow.
2726 # @encrypt: Image decryption options. Mandatory for
2727 # encrypted images, except when doing a metadata-only
2728 # probe of the image.
2732 { 'struct': 'BlockdevOptionsQcow',
2733 'base': 'BlockdevOptionsGenericCOWFormat',
2734 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
2739 # @BlockdevQcow2EncryptionFormat:
2740 # @aes: AES-CBC with plain64 initialization venctors
2744 { 'enum': 'BlockdevQcow2EncryptionFormat',
2745 'data': [ 'aes', 'luks' ] }
2748 # @BlockdevQcow2Encryption:
2752 { 'union': 'BlockdevQcow2Encryption',
2753 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
2754 'discriminator': 'format',
2755 'data': { 'aes': 'QCryptoBlockOptionsQCow',
2756 'luks': 'QCryptoBlockOptionsLUKS'} }
2759 # @BlockdevOptionsQcow2:
2761 # Driver specific block device options for qcow2.
2763 # @lazy-refcounts: whether to enable the lazy refcounts
2764 # feature (default is taken from the image file)
2766 # @pass-discard-request: whether discard requests to the qcow2
2767 # device should be forwarded to the data source
2769 # @pass-discard-snapshot: whether discard requests for the data source
2770 # should be issued when a snapshot operation (e.g.
2771 # deleting a snapshot) frees clusters in the qcow2 file
2773 # @pass-discard-other: whether discard requests for the data source
2774 # should be issued on other occasions where a cluster
2777 # @overlap-check: which overlap checks to perform for writes
2778 # to the image, defaults to 'cached' (since 2.2)
2780 # @cache-size: the maximum total size of the L2 table and
2781 # refcount block caches in bytes (since 2.2)
2783 # @l2-cache-size: the maximum size of the L2 table cache in
2786 # @l2-cache-entry-size: the size of each entry in the L2 cache in
2787 # bytes. It must be a power of two between 512
2788 # and the cluster size. The default value is
2789 # the cluster size (since 2.12)
2791 # @refcount-cache-size: the maximum size of the refcount block cache
2792 # in bytes (since 2.2)
2794 # @cache-clean-interval: clean unused entries in the L2 and refcount
2795 # caches. The interval is in seconds. The default value
2796 # is 0 and it disables this feature (since 2.5)
2797 # @encrypt: Image decryption options. Mandatory for
2798 # encrypted images, except when doing a metadata-only
2799 # probe of the image. (since 2.10)
2803 { 'struct': 'BlockdevOptionsQcow2',
2804 'base': 'BlockdevOptionsGenericCOWFormat',
2805 'data': { '*lazy-refcounts': 'bool',
2806 '*pass-discard-request': 'bool',
2807 '*pass-discard-snapshot': 'bool',
2808 '*pass-discard-other': 'bool',
2809 '*overlap-check': 'Qcow2OverlapChecks',
2810 '*cache-size': 'int',
2811 '*l2-cache-size': 'int',
2812 '*l2-cache-entry-size': 'int',
2813 '*refcount-cache-size': 'int',
2814 '*cache-clean-interval': 'int',
2815 '*encrypt': 'BlockdevQcow2Encryption' } }
2818 # @SshHostKeyCheckMode:
2820 # @none Don't check the host key at all
2821 # @hash Compare the host key with a given hash
2822 # @known_hosts Check the host key against the known_hosts file
2826 { 'enum': 'SshHostKeyCheckMode',
2827 'data': [ 'none', 'hash', 'known_hosts' ] }
2830 # @SshHostKeyCheckHashType:
2832 # @md5 The given hash is an md5 hash
2833 # @sha1 The given hash is an sha1 hash
2837 { 'enum': 'SshHostKeyCheckHashType',
2838 'data': [ 'md5', 'sha1' ] }
2843 # @type The hash algorithm used for the hash
2844 # @hash The expected hash value
2848 { 'struct': 'SshHostKeyHash',
2849 'data': { 'type': 'SshHostKeyCheckHashType',
2855 # For those union branches that don't need additional fields.
2859 { 'struct': 'SshHostKeyDummy',
2867 { 'union': 'SshHostKeyCheck',
2868 'base': { 'mode': 'SshHostKeyCheckMode' },
2869 'discriminator': 'mode',
2870 'data': { 'none': 'SshHostKeyDummy',
2871 'hash': 'SshHostKeyHash',
2872 'known_hosts': 'SshHostKeyDummy' } }
2875 # @BlockdevOptionsSsh:
2877 # @server: host address
2879 # @path: path to the image on the host
2881 # @user: user as which to connect, defaults to current
2884 # @host-key-check: Defines how and what to check the host key against
2885 # (default: known_hosts)
2889 { 'struct': 'BlockdevOptionsSsh',
2890 'data': { 'server': 'InetSocketAddress',
2893 '*host-key-check': 'SshHostKeyCheck' } }
2899 # Trigger events supported by blkdebug.
2901 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
2904 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
2906 # @cor_write: a write due to copy-on-read (since 2.11)
2910 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
2911 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
2912 'l1_grow_activate_table', 'l2_load', 'l2_update',
2913 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
2914 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
2915 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
2916 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
2917 'refblock_load', 'refblock_update', 'refblock_update_part',
2918 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
2919 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
2920 'refblock_alloc_switch_table', 'cluster_alloc',
2921 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
2922 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
2923 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
2924 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
2925 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
2929 # @BlkdebugInjectErrorOptions:
2931 # Describes a single error injection for blkdebug.
2933 # @event: trigger event
2935 # @state: the state identifier blkdebug needs to be in to
2936 # actually trigger the event; defaults to "any"
2938 # @errno: error identifier (errno) to be returned; defaults to
2941 # @sector: specifies the sector index which has to be affected
2942 # in order to actually trigger the event; defaults to "any
2945 # @once: disables further events after this one has been
2946 # triggered; defaults to false
2948 # @immediately: fail immediately; defaults to false
2952 { 'struct': 'BlkdebugInjectErrorOptions',
2953 'data': { 'event': 'BlkdebugEvent',
2958 '*immediately': 'bool' } }
2961 # @BlkdebugSetStateOptions:
2963 # Describes a single state-change event for blkdebug.
2965 # @event: trigger event
2967 # @state: the current state identifier blkdebug needs to be in;
2970 # @new_state: the state identifier blkdebug is supposed to assume if
2971 # this event is triggered
2975 { 'struct': 'BlkdebugSetStateOptions',
2976 'data': { 'event': 'BlkdebugEvent',
2978 'new_state': 'int' } }
2981 # @BlockdevOptionsBlkdebug:
2983 # Driver specific block device options for blkdebug.
2985 # @image: underlying raw block device (or image file)
2987 # @config: filename of the configuration file
2989 # @align: required alignment for requests in bytes, must be
2990 # positive power of 2, or 0 for default
2992 # @max-transfer: maximum size for I/O transfers in bytes, must be
2993 # positive multiple of @align and of the underlying
2994 # file's request alignment (but need not be a power of
2995 # 2), or 0 for default (since 2.10)
2997 # @opt-write-zero: preferred alignment for write zero requests in bytes,
2998 # must be positive multiple of @align and of the
2999 # underlying file's request alignment (but need not be a
3000 # power of 2), or 0 for default (since 2.10)
3002 # @max-write-zero: maximum size for write zero requests in bytes, must be
3003 # positive multiple of @align, of @opt-write-zero, and of
3004 # the underlying file's request alignment (but need not
3005 # be a power of 2), or 0 for default (since 2.10)
3007 # @opt-discard: preferred alignment for discard requests in bytes, must
3008 # be positive multiple of @align and of the underlying
3009 # file's request alignment (but need not be a power of
3010 # 2), or 0 for default (since 2.10)
3012 # @max-discard: maximum size for discard requests in bytes, must be
3013 # positive multiple of @align, of @opt-discard, and of
3014 # the underlying file's request alignment (but need not
3015 # be a power of 2), or 0 for default (since 2.10)
3017 # @inject-error: array of error injection descriptions
3019 # @set-state: array of state-change descriptions
3023 { 'struct': 'BlockdevOptionsBlkdebug',
3024 'data': { 'image': 'BlockdevRef',
3026 '*align': 'int', '*max-transfer': 'int32',
3027 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3028 '*opt-discard': 'int32', '*max-discard': 'int32',
3029 '*inject-error': ['BlkdebugInjectErrorOptions'],
3030 '*set-state': ['BlkdebugSetStateOptions'] } }
3033 # @BlockdevOptionsBlkverify:
3035 # Driver specific block device options for blkverify.
3037 # @test: block device to be tested
3039 # @raw: raw image used for verification
3043 { 'struct': 'BlockdevOptionsBlkverify',
3044 'data': { 'test': 'BlockdevRef',
3045 'raw': 'BlockdevRef' } }
3048 # @QuorumReadPattern:
3050 # An enumeration of quorum read patterns.
3052 # @quorum: read all the children and do a quorum vote on reads
3054 # @fifo: read only from the first child that has not failed
3058 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3061 # @BlockdevOptionsQuorum:
3063 # Driver specific block device options for Quorum
3065 # @blkverify: true if the driver must print content mismatch
3066 # set to false by default
3068 # @children: the children block devices to use
3070 # @vote-threshold: the vote limit under which a read will fail
3072 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3075 # @read-pattern: choose read pattern and set to quorum by default
3080 { 'struct': 'BlockdevOptionsQuorum',
3081 'data': { '*blkverify': 'bool',
3082 'children': [ 'BlockdevRef' ],
3083 'vote-threshold': 'int',
3084 '*rewrite-corrupted': 'bool',
3085 '*read-pattern': 'QuorumReadPattern' } }
3088 # @BlockdevOptionsGluster:
3090 # Driver specific block device options for Gluster
3092 # @volume: name of gluster volume where VM image resides
3094 # @path: absolute path to image file in gluster volume
3096 # @server: gluster servers description
3098 # @debug: libgfapi log level (default '4' which is Error)
3101 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3105 { 'struct': 'BlockdevOptionsGluster',
3106 'data': { 'volume': 'str',
3108 'server': ['SocketAddress'],
3110 '*logfile': 'str' } }
3115 # An enumeration of libiscsi transport types
3119 { 'enum': 'IscsiTransport',
3120 'data': [ 'tcp', 'iser' ] }
3123 # @IscsiHeaderDigest:
3125 # An enumeration of header digests supported by libiscsi
3129 { 'enum': 'IscsiHeaderDigest',
3130 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3131 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3134 # @BlockdevOptionsIscsi:
3136 # @transport: The iscsi transport type
3138 # @portal: The address of the iscsi portal
3140 # @target: The target iqn name
3142 # @lun: LUN to connect to. Defaults to 0.
3144 # @user: User name to log in with. If omitted, no CHAP
3145 # authentication is performed.
3147 # @password-secret: The ID of a QCryptoSecret object providing
3148 # the password for the login. This option is required if
3149 # @user is specified.
3151 # @initiator-name: The iqn name we want to identify to the target
3152 # as. If this option is not specified, an initiator name is
3153 # generated automatically.
3155 # @header-digest: The desired header digest. Defaults to
3158 # @timeout: Timeout in seconds after which a request will
3159 # timeout. 0 means no timeout and is the default.
3161 # Driver specific block device options for iscsi
3165 { 'struct': 'BlockdevOptionsIscsi',
3166 'data': { 'transport': 'IscsiTransport',
3171 '*password-secret': 'str',
3172 '*initiator-name': 'str',
3173 '*header-digest': 'IscsiHeaderDigest',
3174 '*timeout': 'int' } }
3178 # @BlockdevOptionsRbd:
3180 # @pool: Ceph pool name.
3182 # @image: Image name in the Ceph pool.
3184 # @conf: path to Ceph configuration file. Values
3185 # in the configuration file will be overridden by
3186 # options specified via QAPI.
3188 # @snapshot: Ceph snapshot name.
3190 # @user: Ceph id name.
3192 # @server: Monitor host address and port. This maps
3193 # to the "mon_host" Ceph option.
3197 { 'struct': 'BlockdevOptionsRbd',
3198 'data': { 'pool': 'str',
3203 '*server': ['InetSocketAddressBase'] } }
3206 # @BlockdevOptionsSheepdog:
3208 # Driver specific block device options for sheepdog
3210 # @vdi: Virtual disk image name
3211 # @server: The Sheepdog server to connect to
3212 # @snap-id: Snapshot ID
3213 # @tag: Snapshot tag name
3215 # Only one of @snap-id and @tag may be present.
3219 { 'struct': 'BlockdevOptionsSheepdog',
3220 'data': { 'server': 'SocketAddress',
3222 '*snap-id': 'uint32',
3228 # An enumeration of replication modes.
3230 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3232 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3236 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
3239 # @BlockdevOptionsReplication:
3241 # Driver specific block device options for replication
3243 # @mode: the replication mode
3245 # @top-id: In secondary mode, node name or device ID of the root
3246 # node who owns the replication node chain. Must not be given in
3251 { 'struct': 'BlockdevOptionsReplication',
3252 'base': 'BlockdevOptionsGenericFormat',
3253 'data': { 'mode': 'ReplicationMode',
3254 '*top-id': 'str' } }
3259 # An enumeration of NFS transport types
3261 # @inet: TCP transport
3265 { 'enum': 'NFSTransport',
3266 'data': [ 'inet' ] }
3271 # Captures the address of the socket
3273 # @type: transport type used for NFS (only TCP supported)
3275 # @host: host address for NFS server
3279 { 'struct': 'NFSServer',
3280 'data': { 'type': 'NFSTransport',
3284 # @BlockdevOptionsNfs:
3286 # Driver specific block device option for NFS
3288 # @server: host address
3290 # @path: path of the image on the host
3292 # @user: UID value to use when talking to the
3293 # server (defaults to 65534 on Windows and getuid()
3296 # @group: GID value to use when talking to the
3297 # server (defaults to 65534 on Windows and getgid()
3300 # @tcp-syn-count: number of SYNs during the session
3301 # establishment (defaults to libnfs default)
3303 # @readahead-size: set the readahead size in bytes (defaults
3304 # to libnfs default)
3306 # @page-cache-size: set the pagecache size in bytes (defaults
3307 # to libnfs default)
3309 # @debug: set the NFS debug level (max 2) (defaults
3310 # to libnfs default)
3314 { 'struct': 'BlockdevOptionsNfs',
3315 'data': { 'server': 'NFSServer',
3319 '*tcp-syn-count': 'int',
3320 '*readahead-size': 'int',
3321 '*page-cache-size': 'int',
3325 # @BlockdevOptionsCurlBase:
3327 # Driver specific block device options shared by all protocols supported by the
3330 # @url: URL of the image file
3332 # @readahead: Size of the read-ahead cache; must be a multiple of
3333 # 512 (defaults to 256 kB)
3335 # @timeout: Timeout for connections, in seconds (defaults to 5)
3337 # @username: Username for authentication (defaults to none)
3339 # @password-secret: ID of a QCryptoSecret object providing a password
3340 # for authentication (defaults to no password)
3342 # @proxy-username: Username for proxy authentication (defaults to none)
3344 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3345 # for proxy authentication (defaults to no password)
3349 { 'struct': 'BlockdevOptionsCurlBase',
3350 'data': { 'url': 'str',
3351 '*readahead': 'int',
3354 '*password-secret': 'str',
3355 '*proxy-username': 'str',
3356 '*proxy-password-secret': 'str' } }
3359 # @BlockdevOptionsCurlHttp:
3361 # Driver specific block device options for HTTP connections over the curl
3362 # backend. URLs must start with "http://".
3364 # @cookie: List of cookies to set; format is
3365 # "name1=content1; name2=content2;" as explained by
3366 # CURLOPT_COOKIE(3). Defaults to no cookies.
3368 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3369 # secure way. See @cookie for the format. (since 2.10)
3373 { 'struct': 'BlockdevOptionsCurlHttp',
3374 'base': 'BlockdevOptionsCurlBase',
3375 'data': { '*cookie': 'str',
3376 '*cookie-secret': 'str'} }
3379 # @BlockdevOptionsCurlHttps:
3381 # Driver specific block device options for HTTPS connections over the curl
3382 # backend. URLs must start with "https://".
3384 # @cookie: List of cookies to set; format is
3385 # "name1=content1; name2=content2;" as explained by
3386 # CURLOPT_COOKIE(3). Defaults to no cookies.
3388 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3391 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3392 # secure way. See @cookie for the format. (since 2.10)
3396 { 'struct': 'BlockdevOptionsCurlHttps',
3397 'base': 'BlockdevOptionsCurlBase',
3398 'data': { '*cookie': 'str',
3399 '*sslverify': 'bool',
3400 '*cookie-secret': 'str'} }
3403 # @BlockdevOptionsCurlFtp:
3405 # Driver specific block device options for FTP connections over the curl
3406 # backend. URLs must start with "ftp://".
3410 { 'struct': 'BlockdevOptionsCurlFtp',
3411 'base': 'BlockdevOptionsCurlBase',
3415 # @BlockdevOptionsCurlFtps:
3417 # Driver specific block device options for FTPS connections over the curl
3418 # backend. URLs must start with "ftps://".
3420 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3425 { 'struct': 'BlockdevOptionsCurlFtps',
3426 'base': 'BlockdevOptionsCurlBase',
3427 'data': { '*sslverify': 'bool' } }
3430 # @BlockdevOptionsNbd:
3432 # Driver specific block device options for NBD.
3434 # @server: NBD server address
3436 # @export: export name
3438 # @tls-creds: TLS credentials ID
3442 { 'struct': 'BlockdevOptionsNbd',
3443 'data': { 'server': 'SocketAddress',
3445 '*tls-creds': 'str' } }
3448 # @BlockdevOptionsRaw:
3450 # Driver specific block device options for the raw driver.
3452 # @offset: position where the block device starts
3453 # @size: the assumed size of the device
3457 { 'struct': 'BlockdevOptionsRaw',
3458 'base': 'BlockdevOptionsGenericFormat',
3459 'data': { '*offset': 'int', '*size': 'int' } }
3462 # @BlockdevOptionsVxHS:
3464 # Driver specific block device options for VxHS
3466 # @vdisk-id: UUID of VxHS volume
3467 # @server: vxhs server IP, port
3468 # @tls-creds: TLS credentials ID
3472 { 'struct': 'BlockdevOptionsVxHS',
3473 'data': { 'vdisk-id': 'str',
3474 'server': 'InetSocketAddressBase',
3475 '*tls-creds': 'str' } }
3478 # @BlockdevOptionsThrottle:
3480 # Driver specific block device options for the throttle driver
3482 # @throttle-group: the name of the throttle-group object to use. It
3483 # must already exist.
3484 # @file: reference to or definition of the data source block device
3487 { 'struct': 'BlockdevOptionsThrottle',
3488 'data': { 'throttle-group': 'str',
3489 'file' : 'BlockdevRef'
3494 # Options for creating a block device. Many options are available for all
3495 # block devices, independent of the block driver:
3497 # @driver: block driver name
3498 # @node-name: the node name of the new node (Since 2.0).
3499 # This option is required on the top level of blockdev-add.
3500 # @discard: discard-related options (default: ignore)
3501 # @cache: cache-related options
3502 # @read-only: whether the block device should be read-only (default: false).
3503 # Note that some block drivers support only read-only access,
3504 # either generally or in certain configurations. In this case,
3505 # the default value does not work and the option must be
3506 # specified explicitly.
3507 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3509 # @force-share: force share all permission on added nodes.
3510 # Requires read-only=true. (Since 2.10)
3512 # Remaining options are determined by the block driver.
3516 { 'union': 'BlockdevOptions',
3517 'base': { 'driver': 'BlockdevDriver',
3518 '*node-name': 'str',
3519 '*discard': 'BlockdevDiscardOptions',
3520 '*cache': 'BlockdevCacheOptions',
3521 '*read-only': 'bool',
3522 '*force-share': 'bool',
3523 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3524 'discriminator': 'driver',
3526 'blkdebug': 'BlockdevOptionsBlkdebug',
3527 'blkverify': 'BlockdevOptionsBlkverify',
3528 'bochs': 'BlockdevOptionsGenericFormat',
3529 'cloop': 'BlockdevOptionsGenericFormat',
3530 'dmg': 'BlockdevOptionsGenericFormat',
3531 'file': 'BlockdevOptionsFile',
3532 'ftp': 'BlockdevOptionsCurlFtp',
3533 'ftps': 'BlockdevOptionsCurlFtps',
3534 'gluster': 'BlockdevOptionsGluster',
3535 'host_cdrom': 'BlockdevOptionsFile',
3536 'host_device':'BlockdevOptionsFile',
3537 'http': 'BlockdevOptionsCurlHttp',
3538 'https': 'BlockdevOptionsCurlHttps',
3539 'iscsi': 'BlockdevOptionsIscsi',
3540 'luks': 'BlockdevOptionsLUKS',
3541 'nbd': 'BlockdevOptionsNbd',
3542 'nfs': 'BlockdevOptionsNfs',
3543 'null-aio': 'BlockdevOptionsNull',
3544 'null-co': 'BlockdevOptionsNull',
3545 'nvme': 'BlockdevOptionsNVMe',
3546 'parallels': 'BlockdevOptionsGenericFormat',
3547 'qcow2': 'BlockdevOptionsQcow2',
3548 'qcow': 'BlockdevOptionsQcow',
3549 'qed': 'BlockdevOptionsGenericCOWFormat',
3550 'quorum': 'BlockdevOptionsQuorum',
3551 'raw': 'BlockdevOptionsRaw',
3552 'rbd': 'BlockdevOptionsRbd',
3553 'replication':'BlockdevOptionsReplication',
3554 'sheepdog': 'BlockdevOptionsSheepdog',
3555 'ssh': 'BlockdevOptionsSsh',
3556 'throttle': 'BlockdevOptionsThrottle',
3557 'vdi': 'BlockdevOptionsGenericFormat',
3558 'vhdx': 'BlockdevOptionsGenericFormat',
3559 'vmdk': 'BlockdevOptionsGenericCOWFormat',
3560 'vpc': 'BlockdevOptionsGenericFormat',
3561 'vvfat': 'BlockdevOptionsVVFAT',
3562 'vxhs': 'BlockdevOptionsVxHS'
3568 # Reference to a block device.
3570 # @definition: defines a new block device inline
3571 # @reference: references the ID of an existing block device
3575 { 'alternate': 'BlockdevRef',
3576 'data': { 'definition': 'BlockdevOptions',
3577 'reference': 'str' } }
3580 # @BlockdevRefOrNull:
3582 # Reference to a block device.
3584 # @definition: defines a new block device inline
3585 # @reference: references the ID of an existing block device.
3586 # An empty string means that no block device should
3587 # be referenced. Deprecated; use null instead.
3588 # @null: No block device should be referenced (since 2.10)
3592 { 'alternate': 'BlockdevRefOrNull',
3593 'data': { 'definition': 'BlockdevOptions',
3600 # Creates a new block device. If the @id option is given at the top level, a
3601 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
3602 # level and no BlockBackend will be created.
3609 # -> { "execute": "blockdev-add",
3611 # "driver": "qcow2",
3612 # "node-name": "test1",
3615 # "filename": "test.qcow2"
3619 # <- { "return": {} }
3622 # -> { "execute": "blockdev-add",
3624 # "driver": "qcow2",
3625 # "node-name": "node0",
3626 # "discard": "unmap",
3632 # "filename": "/tmp/test.qcow2"
3638 # "filename": "/dev/fdset/4"
3644 # <- { "return": {} }
3647 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
3652 # Deletes a block device that has been added using blockdev-add.
3653 # The command will fail if the node is attached to a device or is
3654 # otherwise being used.
3656 # @node-name: Name of the graph node to delete.
3662 # -> { "execute": "blockdev-add",
3664 # "driver": "qcow2",
3665 # "node-name": "node0",
3668 # "filename": "test.qcow2"
3672 # <- { "return": {} }
3674 # -> { "execute": "blockdev-del",
3675 # "arguments": { "node-name": "node0" }
3677 # <- { "return": {} }
3680 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
3683 # @BlockdevCreateOptionsFile:
3685 # Driver specific image creation options for file.
3687 # @filename Filename for the new image file
3688 # @size Size of the virtual disk in bytes
3689 # @preallocation Preallocation mode for the new image (default: off)
3690 # @nocow Turn off copy-on-write (valid only on btrfs; default: off)
3694 { 'struct': 'BlockdevCreateOptionsFile',
3695 'data': { 'filename': 'str',
3697 '*preallocation': 'PreallocMode',
3698 '*nocow': 'bool' } }
3701 # @BlockdevCreateOptionsGluster:
3703 # Driver specific image creation options for gluster.
3705 # @location Where to store the new image file
3706 # @size Size of the virtual disk in bytes
3707 # @preallocation Preallocation mode for the new image (default: off)
3711 { 'struct': 'BlockdevCreateOptionsGluster',
3712 'data': { 'location': 'BlockdevOptionsGluster',
3714 '*preallocation': 'PreallocMode' } }
3717 # @BlockdevCreateOptionsLUKS:
3719 # Driver specific image creation options for LUKS.
3721 # @file Node to create the image format on
3722 # @size Size of the virtual disk in bytes
3726 { 'struct': 'BlockdevCreateOptionsLUKS',
3727 'base': 'QCryptoBlockCreateOptionsLUKS',
3728 'data': { 'file': 'BlockdevRef',
3732 # @BlockdevCreateOptionsNfs:
3734 # Driver specific image creation options for NFS.
3736 # @location Where to store the new image file
3737 # @size Size of the virtual disk in bytes
3741 { 'struct': 'BlockdevCreateOptionsNfs',
3742 'data': { 'location': 'BlockdevOptionsNfs',
3746 # @BlockdevCreateOptionsParallels:
3748 # Driver specific image creation options for parallels.
3750 # @file Node to create the image format on
3751 # @size Size of the virtual disk in bytes
3752 # @cluster-size Cluster size in bytes (default: 1 MB)
3756 { 'struct': 'BlockdevCreateOptionsParallels',
3757 'data': { 'file': 'BlockdevRef',
3759 '*cluster-size': 'size' } }
3762 # @BlockdevCreateOptionsQcow:
3764 # Driver specific image creation options for qcow.
3766 # @file Node to create the image format on
3767 # @size Size of the virtual disk in bytes
3768 # @backing-file File name of the backing file if a backing file
3770 # @encrypt Encryption options if the image should be encrypted
3774 { 'struct': 'BlockdevCreateOptionsQcow',
3775 'data': { 'file': 'BlockdevRef',
3777 '*backing-file': 'str',
3778 '*encrypt': 'QCryptoBlockCreateOptions' } }
3781 # @BlockdevQcow2Version:
3783 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
3784 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
3788 { 'enum': 'BlockdevQcow2Version',
3789 'data': [ 'v2', 'v3' ] }
3793 # @BlockdevCreateOptionsQcow2:
3795 # Driver specific image creation options for qcow2.
3797 # @file Node to create the image format on
3798 # @size Size of the virtual disk in bytes
3799 # @version Compatibility level (default: v3)
3800 # @backing-file File name of the backing file if a backing file
3802 # @backing-fmt Name of the block driver to use for the backing file
3803 # @encrypt Encryption options if the image should be encrypted
3804 # @cluster-size qcow2 cluster size in bytes (default: 65536)
3805 # @preallocation Preallocation mode for the new image (default: off)
3806 # @lazy-refcounts True if refcounts may be updated lazily (default: off)
3807 # @refcount-bits Width of reference counts in bits (default: 16)
3811 { 'struct': 'BlockdevCreateOptionsQcow2',
3812 'data': { 'file': 'BlockdevRef',
3814 '*version': 'BlockdevQcow2Version',
3815 '*backing-file': 'str',
3816 '*backing-fmt': 'BlockdevDriver',
3817 '*encrypt': 'QCryptoBlockCreateOptions',
3818 '*cluster-size': 'size',
3819 '*preallocation': 'PreallocMode',
3820 '*lazy-refcounts': 'bool',
3821 '*refcount-bits': 'int' } }
3824 # @BlockdevCreateOptionsQed:
3826 # Driver specific image creation options for qed.
3828 # @file Node to create the image format on
3829 # @size Size of the virtual disk in bytes
3830 # @backing-file File name of the backing file if a backing file
3832 # @backing-fmt Name of the block driver to use for the backing file
3833 # @cluster-size Cluster size in bytes (default: 65536)
3834 # @table-size L1/L2 table size (in clusters)
3838 { 'struct': 'BlockdevCreateOptionsQed',
3839 'data': { 'file': 'BlockdevRef',
3841 '*backing-file': 'str',
3842 '*backing-fmt': 'BlockdevDriver',
3843 '*cluster-size': 'size',
3844 '*table-size': 'int' } }
3847 # @BlockdevCreateOptionsRbd:
3849 # Driver specific image creation options for rbd/Ceph.
3851 # @location Where to store the new image file. This location cannot
3852 # point to a snapshot.
3853 # @size Size of the virtual disk in bytes
3854 # @cluster-size RBD object size
3858 { 'struct': 'BlockdevCreateOptionsRbd',
3859 'data': { 'location': 'BlockdevOptionsRbd',
3861 '*cluster-size' : 'size' } }
3864 # @SheepdogRedundancyType:
3866 # @full Create a fully replicated vdi with x copies
3867 # @erasure-coded Create an erasure coded vdi with x data strips and
3872 { 'enum': 'SheepdogRedundancyType',
3873 'data': [ 'full', 'erasure-coded' ] }
3876 # @SheepdogRedundancyFull:
3878 # @copies Number of copies to use (between 1 and 31)
3882 { 'struct': 'SheepdogRedundancyFull',
3883 'data': { 'copies': 'int' }}
3886 # @SheepdogRedundancyErasureCoded:
3888 # @data-strips Number of data strips to use (one of {2,4,8,16})
3889 # @parity-strips Number of parity strips to use (between 1 and 15)
3893 { 'struct': 'SheepdogRedundancyErasureCoded',
3894 'data': { 'data-strips': 'int',
3895 'parity-strips': 'int' }}
3898 # @SheepdogRedundancy:
3902 { 'union': 'SheepdogRedundancy',
3903 'base': { 'type': 'SheepdogRedundancyType' },
3904 'discriminator': 'type',
3905 'data': { 'full': 'SheepdogRedundancyFull',
3906 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
3909 # @BlockdevCreateOptionsSheepdog:
3911 # Driver specific image creation options for Sheepdog.
3913 # @location Where to store the new image file
3914 # @size Size of the virtual disk in bytes
3915 # @backing-file File name of a base image
3916 # @preallocation Preallocation mode (allowed values: off, full)
3917 # @redundancy Redundancy of the image
3918 # @object-size Object size of the image
3922 { 'struct': 'BlockdevCreateOptionsSheepdog',
3923 'data': { 'location': 'BlockdevOptionsSheepdog',
3925 '*backing-file': 'str',
3926 '*preallocation': 'PreallocMode',
3927 '*redundancy': 'SheepdogRedundancy',
3928 '*object-size': 'size' } }
3931 # @BlockdevCreateOptionsSsh:
3933 # Driver specific image creation options for SSH.
3935 # @location Where to store the new image file
3936 # @size Size of the virtual disk in bytes
3940 { 'struct': 'BlockdevCreateOptionsSsh',
3941 'data': { 'location': 'BlockdevOptionsSsh',
3945 # @BlockdevCreateOptionsVdi:
3947 # Driver specific image creation options for VDI.
3949 # @file Node to create the image format on
3950 # @size Size of the virtual disk in bytes
3951 # @preallocation Preallocation mode for the new image (allowed values: off,
3952 # metadata; default: off)
3956 { 'struct': 'BlockdevCreateOptionsVdi',
3957 'data': { 'file': 'BlockdevRef',
3959 '*preallocation': 'PreallocMode' } }
3962 # @BlockdevVhdxSubformat:
3964 # @dynamic: Growing image file
3965 # @fixed: Preallocated fixed-size image file
3969 { 'enum': 'BlockdevVhdxSubformat',
3970 'data': [ 'dynamic', 'fixed' ] }
3973 # @BlockdevCreateOptionsVhdx:
3975 # Driver specific image creation options for vhdx.
3977 # @file Node to create the image format on
3978 # @size Size of the virtual disk in bytes
3979 # @log-size Log size in bytes, must be a multiple of 1 MB
3981 # @block-size Block size in bytes, must be a multiple of 1 MB and not
3982 # larger than 256 MB (default: automatically choose a block
3983 # size depending on the image size)
3984 # @subformat vhdx subformat (default: dynamic)
3985 # @block-state-zero Force use of payload blocks of type 'ZERO'. Non-standard,
3986 # but default. Do not set to 'off' when using 'qemu-img
3987 # convert' with subformat=dynamic.
3991 { 'struct': 'BlockdevCreateOptionsVhdx',
3992 'data': { 'file': 'BlockdevRef',
3994 '*log-size': 'size',
3995 '*block-size': 'size',
3996 '*subformat': 'BlockdevVhdxSubformat',
3997 '*block-state-zero': 'bool' } }
4000 # @BlockdevVpcSubformat:
4002 # @dynamic: Growing image file
4003 # @fixed: Preallocated fixed-size image file
4007 { 'enum': 'BlockdevVpcSubformat',
4008 'data': [ 'dynamic', 'fixed' ] }
4011 # @BlockdevCreateOptionsVpc:
4013 # Driver specific image creation options for vpc (VHD).
4015 # @file Node to create the image format on
4016 # @size Size of the virtual disk in bytes
4017 # @subformat vhdx subformat (default: dynamic)
4018 # @force-size Force use of the exact byte size instead of rounding to the
4019 # next size that can be represented in CHS geometry
4024 { 'struct': 'BlockdevCreateOptionsVpc',
4025 'data': { 'file': 'BlockdevRef',
4027 '*subformat': 'BlockdevVpcSubformat',
4028 '*force-size': 'bool' } }
4031 # @BlockdevCreateNotSupported:
4033 # This is used for all drivers that don't support creating images.
4037 { 'struct': 'BlockdevCreateNotSupported', 'data': {}}
4040 # @BlockdevCreateOptions:
4042 # Options for creating an image format on a given node.
4044 # @driver block driver to create the image format
4048 { 'union': 'BlockdevCreateOptions',
4050 'driver': 'BlockdevDriver' },
4051 'discriminator': 'driver',
4053 'blkdebug': 'BlockdevCreateNotSupported',
4054 'blkverify': 'BlockdevCreateNotSupported',
4055 'bochs': 'BlockdevCreateNotSupported',
4056 'cloop': 'BlockdevCreateNotSupported',
4057 'dmg': 'BlockdevCreateNotSupported',
4058 'file': 'BlockdevCreateOptionsFile',
4059 'ftp': 'BlockdevCreateNotSupported',
4060 'ftps': 'BlockdevCreateNotSupported',
4061 'gluster': 'BlockdevCreateOptionsGluster',
4062 'host_cdrom': 'BlockdevCreateNotSupported',
4063 'host_device': 'BlockdevCreateNotSupported',
4064 'http': 'BlockdevCreateNotSupported',
4065 'https': 'BlockdevCreateNotSupported',
4066 'iscsi': 'BlockdevCreateNotSupported',
4067 'luks': 'BlockdevCreateOptionsLUKS',
4068 'nbd': 'BlockdevCreateNotSupported',
4069 'nfs': 'BlockdevCreateOptionsNfs',
4070 'null-aio': 'BlockdevCreateNotSupported',
4071 'null-co': 'BlockdevCreateNotSupported',
4072 'nvme': 'BlockdevCreateNotSupported',
4073 'parallels': 'BlockdevCreateOptionsParallels',
4074 'qcow': 'BlockdevCreateOptionsQcow',
4075 'qcow2': 'BlockdevCreateOptionsQcow2',
4076 'qed': 'BlockdevCreateOptionsQed',
4077 'quorum': 'BlockdevCreateNotSupported',
4078 'raw': 'BlockdevCreateNotSupported',
4079 'rbd': 'BlockdevCreateOptionsRbd',
4080 'replication': 'BlockdevCreateNotSupported',
4081 'sheepdog': 'BlockdevCreateOptionsSheepdog',
4082 'ssh': 'BlockdevCreateOptionsSsh',
4083 'throttle': 'BlockdevCreateNotSupported',
4084 'vdi': 'BlockdevCreateOptionsVdi',
4085 'vhdx': 'BlockdevCreateOptionsVhdx',
4086 'vmdk': 'BlockdevCreateNotSupported',
4087 'vpc': 'BlockdevCreateOptionsVpc',
4088 'vvfat': 'BlockdevCreateNotSupported',
4089 'vxhs': 'BlockdevCreateNotSupported'
4093 # @x-blockdev-create:
4095 # Create an image format on a given node.
4096 # TODO Replace with something asynchronous (block job?)
4100 { 'command': 'x-blockdev-create',
4101 'data': 'BlockdevCreateOptions',
4105 # @blockdev-open-tray:
4107 # Opens a block device's tray. If there is a block driver state tree inserted as
4108 # a medium, it will become inaccessible to the guest (but it will remain
4109 # associated to the block device, so closing the tray will make it accessible
4112 # If the tray was already open before, this will be a no-op.
4114 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4115 # which no such event will be generated, these include:
4116 # - if the guest has locked the tray, @force is false and the guest does not
4117 # respond to the eject request
4118 # - if the BlockBackend denoted by @device does not have a guest device attached
4120 # - if the guest device does not have an actual tray
4122 # @device: Block device name (deprecated, use @id instead)
4124 # @id: The name or QOM path of the guest device (since: 2.8)
4126 # @force: if false (the default), an eject request will be sent to
4127 # the guest if it has locked the tray (and the tray will not be opened
4128 # immediately); if true, the tray will be opened regardless of whether
4135 # -> { "execute": "blockdev-open-tray",
4136 # "arguments": { "id": "ide0-1-0" } }
4138 # <- { "timestamp": { "seconds": 1418751016,
4139 # "microseconds": 716996 },
4140 # "event": "DEVICE_TRAY_MOVED",
4141 # "data": { "device": "ide1-cd0",
4143 # "tray-open": true } }
4145 # <- { "return": {} }
4148 { 'command': 'blockdev-open-tray',
4149 'data': { '*device': 'str',
4151 '*force': 'bool' } }
4154 # @blockdev-close-tray:
4156 # Closes a block device's tray. If there is a block driver state tree associated
4157 # with the block device (which is currently ejected), that tree will be loaded
4160 # If the tray was already closed before, this will be a no-op.
4162 # @device: Block device name (deprecated, use @id instead)
4164 # @id: The name or QOM path of the guest device (since: 2.8)
4170 # -> { "execute": "blockdev-close-tray",
4171 # "arguments": { "id": "ide0-1-0" } }
4173 # <- { "timestamp": { "seconds": 1418751345,
4174 # "microseconds": 272147 },
4175 # "event": "DEVICE_TRAY_MOVED",
4176 # "data": { "device": "ide1-cd0",
4178 # "tray-open": false } }
4180 # <- { "return": {} }
4183 { 'command': 'blockdev-close-tray',
4184 'data': { '*device': 'str',
4188 # @blockdev-remove-medium:
4190 # Removes a medium (a block driver state tree) from a block device. That block
4191 # device's tray must currently be open (unless there is no attached guest
4194 # If the tray is open and there is no medium inserted, this will be a no-op.
4196 # @id: The name or QOM path of the guest device
4202 # -> { "execute": "blockdev-remove-medium",
4203 # "arguments": { "id": "ide0-1-0" } }
4205 # <- { "error": { "class": "GenericError",
4206 # "desc": "Tray of device 'ide0-1-0' is not open" } }
4208 # -> { "execute": "blockdev-open-tray",
4209 # "arguments": { "id": "ide0-1-0" } }
4211 # <- { "timestamp": { "seconds": 1418751627,
4212 # "microseconds": 549958 },
4213 # "event": "DEVICE_TRAY_MOVED",
4214 # "data": { "device": "ide1-cd0",
4216 # "tray-open": true } }
4218 # <- { "return": {} }
4220 # -> { "execute": "blockdev-remove-medium",
4221 # "arguments": { "id": "ide0-1-0" } }
4223 # <- { "return": {} }
4226 { 'command': 'blockdev-remove-medium',
4227 'data': { 'id': 'str' } }
4230 # @blockdev-insert-medium:
4232 # Inserts a medium (a block driver state tree) into a block device. That block
4233 # device's tray must currently be open (unless there is no attached guest
4234 # device) and there must be no medium inserted already.
4236 # @id: The name or QOM path of the guest device
4238 # @node-name: name of a node in the block driver state graph
4244 # -> { "execute": "blockdev-add",
4246 # "node-name": "node0",
4248 # "file": { "driver": "file",
4249 # "filename": "fedora.iso" } } }
4250 # <- { "return": {} }
4252 # -> { "execute": "blockdev-insert-medium",
4253 # "arguments": { "id": "ide0-1-0",
4254 # "node-name": "node0" } }
4256 # <- { "return": {} }
4259 { 'command': 'blockdev-insert-medium',
4260 'data': { 'id': 'str',
4261 'node-name': 'str'} }
4265 # @BlockdevChangeReadOnlyMode:
4267 # Specifies the new read-only mode of a block device subject to the
4268 # @blockdev-change-medium command.
4270 # @retain: Retains the current read-only mode
4272 # @read-only: Makes the device read-only
4274 # @read-write: Makes the device writable
4279 { 'enum': 'BlockdevChangeReadOnlyMode',
4280 'data': ['retain', 'read-only', 'read-write'] }
4284 # @blockdev-change-medium:
4286 # Changes the medium inserted into a block device by ejecting the current medium
4287 # and loading a new image file which is inserted as the new medium (this command
4288 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
4289 # and blockdev-close-tray).
4291 # @device: Block device name (deprecated, use @id instead)
4293 # @id: The name or QOM path of the guest device
4296 # @filename: filename of the new image to be loaded
4298 # @format: format to open the new image with (defaults to
4299 # the probed format)
4301 # @read-only-mode: change the read-only mode of the device; defaults
4308 # 1. Change a removable medium
4310 # -> { "execute": "blockdev-change-medium",
4311 # "arguments": { "id": "ide0-1-0",
4312 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4313 # "format": "raw" } }
4314 # <- { "return": {} }
4316 # 2. Load a read-only medium into a writable drive
4318 # -> { "execute": "blockdev-change-medium",
4319 # "arguments": { "id": "floppyA",
4320 # "filename": "/srv/images/ro.img",
4322 # "read-only-mode": "retain" } }
4325 # { "class": "GenericError",
4326 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4328 # -> { "execute": "blockdev-change-medium",
4329 # "arguments": { "id": "floppyA",
4330 # "filename": "/srv/images/ro.img",
4332 # "read-only-mode": "read-only" } }
4334 # <- { "return": {} }
4337 { 'command': 'blockdev-change-medium',
4338 'data': { '*device': 'str',
4342 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
4346 # @BlockErrorAction:
4348 # An enumeration of action that has been taken when a DISK I/O occurs
4350 # @ignore: error has been ignored
4352 # @report: error has been reported to the device
4354 # @stop: error caused VM to be stopped
4358 { 'enum': 'BlockErrorAction',
4359 'data': [ 'ignore', 'report', 'stop' ] }
4363 # @BLOCK_IMAGE_CORRUPTED:
4365 # Emitted when a disk image is being marked corrupt. The image can be
4366 # identified by its device or node name. The 'device' field is always
4367 # present for compatibility reasons, but it can be empty ("") if the
4368 # image does not have a device name associated.
4370 # @device: device name. This is always present for compatibility
4371 # reasons, but it can be empty ("") if the image does not
4372 # have a device name associated.
4374 # @node-name: node name (Since: 2.4)
4376 # @msg: informative message for human consumption, such as the kind of
4377 # corruption being detected. It should not be parsed by machine as it is
4378 # not guaranteed to be stable
4380 # @offset: if the corruption resulted from an image access, this is
4381 # the host's access offset into the image
4383 # @size: if the corruption resulted from an image access, this is
4386 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4387 # event and must be repaired (Since 2.2; before, every
4388 # BLOCK_IMAGE_CORRUPTED event was fatal)
4390 # Note: If action is "stop", a STOP event will eventually follow the
4391 # BLOCK_IO_ERROR event.
4395 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4396 # "data": { "device": "ide0-hd0", "node-name": "node0",
4397 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4399 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4403 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4404 'data': { 'device' : 'str',
4405 '*node-name' : 'str',
4409 'fatal' : 'bool' } }
4414 # Emitted when a disk I/O error occurs
4416 # @device: device name. This is always present for compatibility
4417 # reasons, but it can be empty ("") if the image does not
4418 # have a device name associated.
4420 # @node-name: node name. Note that errors may be reported for the root node
4421 # that is directly attached to a guest device rather than for the
4422 # node where the error occurred. The node name is not present if
4423 # the drive is empty. (Since: 2.8)
4425 # @operation: I/O operation
4427 # @action: action that has been taken
4429 # @nospace: true if I/O error was caused due to a no-space
4430 # condition. This key is only present if query-block's
4431 # io-status is present, please see query-block documentation
4432 # for more information (since: 2.2)
4434 # @reason: human readable string describing the error cause.
4435 # (This field is a debugging aid for humans, it should not
4436 # be parsed by applications) (since: 2.2)
4438 # Note: If action is "stop", a STOP event will eventually follow the
4439 # BLOCK_IO_ERROR event
4445 # <- { "event": "BLOCK_IO_ERROR",
4446 # "data": { "device": "ide0-hd1",
4447 # "node-name": "#block212",
4448 # "operation": "write",
4449 # "action": "stop" },
4450 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4453 { 'event': 'BLOCK_IO_ERROR',
4454 'data': { 'device': 'str', '*node-name': 'str',
4455 'operation': 'IoOperationType',
4456 'action': 'BlockErrorAction', '*nospace': 'bool',
4460 # @BLOCK_JOB_COMPLETED:
4462 # Emitted when a block job has completed
4466 # @device: The job identifier. Originally the device name but other
4467 # values are allowed since QEMU 2.7
4469 # @len: maximum progress value
4471 # @offset: current progress value. On success this is equal to len.
4472 # On failure this is less than len
4474 # @speed: rate limit, bytes per second
4476 # @error: error message. Only present on failure. This field
4477 # contains a human-readable error message. There are no semantics
4478 # other than that streaming has failed and clients should not try to
4479 # interpret the error string
4485 # <- { "event": "BLOCK_JOB_COMPLETED",
4486 # "data": { "type": "stream", "device": "virtio-disk0",
4487 # "len": 10737418240, "offset": 10737418240,
4489 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4492 { 'event': 'BLOCK_JOB_COMPLETED',
4493 'data': { 'type' : 'BlockJobType',
4501 # @BLOCK_JOB_CANCELLED:
4503 # Emitted when a block job has been cancelled
4507 # @device: The job identifier. Originally the device name but other
4508 # values are allowed since QEMU 2.7
4510 # @len: maximum progress value
4512 # @offset: current progress value. On success this is equal to len.
4513 # On failure this is less than len
4515 # @speed: rate limit, bytes per second
4521 # <- { "event": "BLOCK_JOB_CANCELLED",
4522 # "data": { "type": "stream", "device": "virtio-disk0",
4523 # "len": 10737418240, "offset": 134217728,
4525 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4528 { 'event': 'BLOCK_JOB_CANCELLED',
4529 'data': { 'type' : 'BlockJobType',
4538 # Emitted when a block job encounters an error
4540 # @device: The job identifier. Originally the device name but other
4541 # values are allowed since QEMU 2.7
4543 # @operation: I/O operation
4545 # @action: action that has been taken
4551 # <- { "event": "BLOCK_JOB_ERROR",
4552 # "data": { "device": "ide0-hd1",
4553 # "operation": "write",
4554 # "action": "stop" },
4555 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4558 { 'event': 'BLOCK_JOB_ERROR',
4559 'data': { 'device' : 'str',
4560 'operation': 'IoOperationType',
4561 'action' : 'BlockErrorAction' } }
4566 # Emitted when a block job is ready to complete
4570 # @device: The job identifier. Originally the device name but other
4571 # values are allowed since QEMU 2.7
4573 # @len: maximum progress value
4575 # @offset: current progress value. On success this is equal to len.
4576 # On failure this is less than len
4578 # @speed: rate limit, bytes per second
4580 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
4587 # <- { "event": "BLOCK_JOB_READY",
4588 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
4589 # "len": 2097152, "offset": 2097152 }
4590 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4593 { 'event': 'BLOCK_JOB_READY',
4594 'data': { 'type' : 'BlockJobType',
4601 # @BLOCK_JOB_PENDING:
4603 # Emitted when a block job is awaiting explicit authorization to finalize graph
4604 # changes via @block-job-finalize. If this job is part of a transaction, it will
4605 # not emit this event until the transaction has converged first.
4609 # @id: The job identifier.
4615 # <- { "event": "BLOCK_JOB_WAITING",
4616 # "data": { "device": "drive0", "type": "mirror" },
4617 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4620 { 'event': 'BLOCK_JOB_PENDING',
4621 'data': { 'type' : 'BlockJobType',
4627 # Preallocation mode of QEMU image file
4629 # @off: no preallocation
4630 # @metadata: preallocate only for metadata
4631 # @falloc: like @full preallocation but allocate disk space by
4632 # posix_fallocate() rather than writing zeros.
4633 # @full: preallocate all data by writing zeros to device to ensure disk
4634 # space is really available. @full preallocation also sets up
4635 # metadata correctly.
4639 { 'enum': 'PreallocMode',
4640 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
4643 # @BLOCK_WRITE_THRESHOLD:
4645 # Emitted when writes on block device reaches or exceeds the
4646 # configured write threshold. For thin-provisioned devices, this
4647 # means the device should be extended to avoid pausing for
4649 # The event is one shot. Once triggered, it needs to be
4650 # re-registered with another block-set-write-threshold command.
4652 # @node-name: graph node name on which the threshold was exceeded.
4654 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
4656 # @write-threshold: last configured threshold, in bytes.
4660 { 'event': 'BLOCK_WRITE_THRESHOLD',
4661 'data': { 'node-name': 'str',
4662 'amount-exceeded': 'uint64',
4663 'write-threshold': 'uint64' } }
4666 # @block-set-write-threshold:
4668 # Change the write threshold for a block drive. An event will be
4669 # delivered if a write to this block drive crosses the configured
4670 # threshold. The threshold is an offset, thus must be
4671 # non-negative. Default is no write threshold. Setting the threshold
4672 # to zero disables it.
4674 # This is useful to transparently resize thin-provisioned drives without
4675 # the guest OS noticing.
4677 # @node-name: graph node name on which the threshold must be set.
4679 # @write-threshold: configured threshold for the block device, bytes.
4680 # Use 0 to disable the threshold.
4686 # -> { "execute": "block-set-write-threshold",
4687 # "arguments": { "node-name": "mydev",
4688 # "write-threshold": 17179869184 } }
4689 # <- { "return": {} }
4692 { 'command': 'block-set-write-threshold',
4693 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
4696 # @x-blockdev-change:
4698 # Dynamically reconfigure the block driver state graph. It can be used
4699 # to add, remove, insert or replace a graph node. Currently only the
4700 # Quorum driver implements this feature to add or remove its child. This
4701 # is useful to fix a broken quorum child.
4703 # If @node is specified, it will be inserted under @parent. @child
4704 # may not be specified in this case. If both @parent and @child are
4705 # specified but @node is not, @child will be detached from @parent.
4707 # @parent: the id or name of the parent node.
4709 # @child: the name of a child under the given parent node.
4711 # @node: the name of the node that will be added.
4713 # Note: this command is experimental, and its API is not stable. It
4714 # does not support all kinds of operations, all kinds of children, nor
4715 # all block drivers.
4717 # FIXME Removing children from a quorum node means introducing gaps in the
4718 # child indices. This cannot be represented in the 'children' list of
4719 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
4721 # Warning: The data in a new quorum child MUST be consistent with that of
4722 # the rest of the array.
4728 # 1. Add a new node to a quorum
4729 # -> { "execute": "blockdev-add",
4732 # "node-name": "new_node",
4733 # "file": { "driver": "file",
4734 # "filename": "test.raw" } } }
4735 # <- { "return": {} }
4736 # -> { "execute": "x-blockdev-change",
4737 # "arguments": { "parent": "disk1",
4738 # "node": "new_node" } }
4739 # <- { "return": {} }
4741 # 2. Delete a quorum's node
4742 # -> { "execute": "x-blockdev-change",
4743 # "arguments": { "parent": "disk1",
4744 # "child": "children.1" } }
4745 # <- { "return": {} }
4748 { 'command': 'x-blockdev-change',
4749 'data' : { 'parent': 'str',
4754 # @x-blockdev-set-iothread:
4756 # Move @node and its children into the @iothread. If @iothread is null then
4757 # move @node and its children into the main loop.
4759 # The node must not be attached to a BlockBackend.
4761 # @node-name: the name of the block driver node
4763 # @iothread: the name of the IOThread object or null for the main loop
4765 # @force: true if the node and its children should be moved when a BlockBackend
4766 # is already attached
4768 # Note: this command is experimental and intended for test cases that need
4769 # control over IOThreads only.
4775 # 1. Move a node into an IOThread
4776 # -> { "execute": "x-blockdev-set-iothread",
4777 # "arguments": { "node-name": "disk1",
4778 # "iothread": "iothread0" } }
4779 # <- { "return": {} }
4781 # 2. Move a node into the main loop
4782 # -> { "execute": "x-blockdev-set-iothread",
4783 # "arguments": { "node-name": "disk1",
4784 # "iothread": null } }
4785 # <- { "return": {} }
4788 { 'command': 'x-blockdev-set-iothread',
4789 'data' : { 'node-name': 'str',
4790 'iothread': 'StrOrNull',
4791 '*force': 'bool' } }