4 # == Block core (VM unrelated)
7 { 'include': 'common.json' }
8 { 'include': 'crypto.json' }
9 { 'include': 'job.json' }
10 { 'include': 'sockets.json' }
15 # @id: unique snapshot id
17 # @name: user chosen name
19 # @vm-state-size: size of the VM state
21 # @date-sec: UTC date of the snapshot in seconds
23 # @date-nsec: fractional part in nano seconds to be used with date-sec
25 # @vm-clock-sec: VM clock relative to boot in seconds
27 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
32 { 'struct': 'SnapshotInfo',
33 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
34 'date-sec': 'int', 'date-nsec': 'int',
35 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
38 # @ImageInfoSpecificQCow2EncryptionBase:
40 # @format: The encryption format
44 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
45 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
48 # @ImageInfoSpecificQCow2Encryption:
52 { 'union': 'ImageInfoSpecificQCow2Encryption',
53 'base': 'ImageInfoSpecificQCow2EncryptionBase',
54 'discriminator': 'format',
55 'data': { 'luks': 'QCryptoBlockInfoLUKS' } }
58 # @ImageInfoSpecificQCow2:
60 # @compat: compatibility level
62 # @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 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
870 # device. (since 3.0)
872 # @stats: A @BlockDeviceStats for the device.
874 # @parent: This describes the file block device if it has one.
875 # Contains recursively the statistics of the underlying
876 # protocol (e.g. the host file for a qcow2 image). If there is
877 # no underlying protocol, this field is omitted
879 # @backing: This describes the backing block device if it has one.
884 { 'struct': 'BlockStats',
885 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
886 'stats': 'BlockDeviceStats',
887 '*parent': 'BlockStats',
888 '*backing': 'BlockStats'} }
893 # Query the @BlockStats for all virtual block devices.
895 # @query-nodes: If true, the command will query all the block nodes
896 # that have a node name, in a list which will include "parent"
897 # information, but not "backing".
898 # If false or omitted, the behavior is as before - query all the
899 # device backends, recursively including their "parent" and
900 # "backing". Filter nodes that were created implicitly are
901 # skipped over in this mode. (Since 2.3)
903 # Returns: A list of @BlockStats for each virtual block devices.
909 # -> { "execute": "query-blockstats" }
913 # "device":"ide0-hd0",
916 # "wr_highest_offset":3686448128,
917 # "wr_bytes":9786368,
918 # "wr_operations":751,
919 # "rd_bytes":122567168,
920 # "rd_operations":36772
921 # "wr_total_times_ns":313253456
922 # "rd_total_times_ns":3465673657
923 # "flush_total_times_ns":49653
924 # "flush_operations":61,
927 # "idle_time_ns":2953431879,
928 # "account_invalid":true,
929 # "account_failed":false
933 # "wr_highest_offset":2821110784,
934 # "wr_bytes":9786368,
935 # "wr_operations":692,
936 # "rd_bytes":122739200,
937 # "rd_operations":36604
938 # "flush_operations":51,
939 # "wr_total_times_ns":313253456
940 # "rd_total_times_ns":3465673657
941 # "flush_total_times_ns":49653,
944 # "idle_time_ns":2953431879,
945 # "account_invalid":true,
946 # "account_failed":false
948 # "qdev": "/machine/unattached/device[23]"
951 # "device":"ide1-cd0",
953 # "wr_highest_offset":0,
958 # "flush_operations":0,
959 # "wr_total_times_ns":0
960 # "rd_total_times_ns":0
961 # "flush_total_times_ns":0,
964 # "account_invalid":false,
965 # "account_failed":false
967 # "qdev": "/machine/unattached/device[24]"
970 # "device":"floppy0",
972 # "wr_highest_offset":0,
977 # "flush_operations":0,
978 # "wr_total_times_ns":0
979 # "rd_total_times_ns":0
980 # "flush_total_times_ns":0,
983 # "account_invalid":false,
984 # "account_failed":false
986 # "qdev": "/machine/unattached/device[16]"
991 # "wr_highest_offset":0,
996 # "flush_operations":0,
997 # "wr_total_times_ns":0
998 # "rd_total_times_ns":0
999 # "flush_total_times_ns":0,
1002 # "account_invalid":false,
1003 # "account_failed":false
1010 { 'command': 'query-blockstats',
1011 'data': { '*query-nodes': 'bool' },
1012 'returns': ['BlockStats'] }
1017 # An enumeration of possible behaviors for errors on I/O operations.
1018 # The exact meaning depends on whether the I/O was initiated by a guest
1021 # @report: for guest operations, report the error to the guest;
1022 # for jobs, cancel the job
1024 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1025 # or BLOCK_JOB_ERROR)
1027 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1029 # @stop: for guest operations, stop the virtual machine;
1030 # for jobs, pause the job
1032 # @auto: inherit the error handling policy of the backend (since: 2.7)
1036 { 'enum': 'BlockdevOnError',
1037 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1042 # An enumeration of possible behaviors for the initial synchronization
1043 # phase of storage mirroring.
1045 # @top: copies data in the topmost image to the destination
1047 # @full: copies data from all images to the destination
1049 # @none: only copy data written from now on
1051 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
1055 { 'enum': 'MirrorSyncMode',
1056 'data': ['top', 'full', 'none', 'incremental'] }
1061 # An enumeration whose values tell the mirror block job when to
1062 # trigger writes to the target.
1064 # @background: copy data in background only.
1066 # @write-blocking: when data is written to the source, write it
1067 # (synchronously) to the target as well. In
1068 # addition, data is copied in background just like in
1073 { 'enum': 'MirrorCopyMode',
1074 'data': ['background', 'write-blocking'] }
1079 # Information about a long-running block device operation.
1081 # @type: the job type ('stream' for image streaming)
1083 # @device: The job identifier. Originally the device name but other
1084 # values are allowed since QEMU 2.7
1086 # @len: Estimated @offset value at the completion of the job. This value can
1087 # arbitrarily change while the job is running, in both directions.
1089 # @offset: Progress made until now. The unit is arbitrary and the value can
1090 # only meaningfully be used for the ratio of @offset to @len. The
1091 # value is monotonically increasing.
1093 # @busy: false if the job is known to be in a quiescent state, with
1094 # no pending I/O. Since 1.3.
1096 # @paused: whether the job is paused or, if @busy is true, will
1097 # pause itself as soon as possible. Since 1.3.
1099 # @speed: the rate limit, bytes per second
1101 # @io-status: the status of the job (since 1.3)
1103 # @ready: true if the job may be completed (since 2.2)
1105 # @status: Current job state/status (since 2.12)
1107 # @auto-finalize: Job will finalize itself when PENDING, moving to
1108 # the CONCLUDED state. (since 2.12)
1110 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1111 # state and disappearing from the query list. (since 2.12)
1113 # @error: Error information if the job did not complete successfully.
1114 # Not set if the job completed successfully. (since 2.12.1)
1118 { 'struct': 'BlockJobInfo',
1119 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1120 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1121 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1122 'status': 'JobStatus',
1123 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1127 # @query-block-jobs:
1129 # Return information about long-running block device operations.
1131 # Returns: a list of @BlockJobInfo for each active block job
1135 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1140 # This command sets the password of a block device that has not been open
1141 # with a password and requires one.
1143 # This command is now obsolete and will always return an error since 2.10
1146 { 'command': 'block_passwd', 'data': {'*device': 'str',
1147 '*node-name': 'str', 'password': 'str'} }
1152 # Resize a block image while a guest is running.
1154 # Either @device or @node-name must be set but not both.
1156 # @device: the name of the device to get the image resized
1158 # @node-name: graph node name to get the image resized (Since 2.0)
1160 # @size: new image size in bytes
1162 # Returns: nothing on success
1163 # If @device is not a valid block device, DeviceNotFound
1169 # -> { "execute": "block_resize",
1170 # "arguments": { "device": "scratch", "size": 1073741824 } }
1171 # <- { "return": {} }
1174 { 'command': 'block_resize', 'data': { '*device': 'str',
1175 '*node-name': 'str',
1181 # An enumeration that tells QEMU how to set the backing file path in
1184 # @existing: QEMU should look for an existing image file.
1186 # @absolute-paths: QEMU should create a new image with absolute paths
1187 # for the backing file. If there is no backing file available, the new
1188 # image will not be backed either.
1192 { 'enum': 'NewImageMode',
1193 'data': [ 'existing', 'absolute-paths' ] }
1196 # @BlockdevSnapshotSync:
1198 # Either @device or @node-name must be set but not both.
1200 # @device: the name of the device to generate the snapshot from.
1202 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1204 # @snapshot-file: the target of the new image. If the file exists, or
1205 # if it is a device, the snapshot will be created in the existing
1206 # file/device. Otherwise, a new file will be created.
1208 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1210 # @format: the format of the snapshot image, default is 'qcow2'.
1212 # @mode: whether and how QEMU should create a new image, default is
1215 { 'struct': 'BlockdevSnapshotSync',
1216 'data': { '*device': 'str', '*node-name': 'str',
1217 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1218 '*format': 'str', '*mode': 'NewImageMode' } }
1221 # @BlockdevSnapshot:
1223 # @node: device or node name that will have a snapshot created.
1225 # @overlay: reference to the existing block device that will become
1226 # the overlay of @node, as part of creating the snapshot.
1227 # It must not have a current backing file (this can be
1228 # achieved by passing "backing": null to blockdev-add).
1232 { 'struct': 'BlockdevSnapshot',
1233 'data': { 'node': 'str', 'overlay': 'str' } }
1238 # @job-id: identifier for the newly-created block job. If
1239 # omitted, the device name will be used. (Since 2.7)
1241 # @device: the device name or node-name of a root node which should be copied.
1243 # @target: the target of the new image. If the file exists, or if it
1244 # is a device, the existing file/device will be used as the new
1245 # destination. If it does not exist, a new file will be created.
1247 # @format: the format of the new destination, default is to
1248 # probe if @mode is 'existing', else the format of the source
1250 # @sync: what parts of the disk image should be copied to the destination
1251 # (all the disk, only the sectors allocated in the topmost image, from a
1252 # dirty bitmap, or only new I/O).
1254 # @mode: whether and how QEMU should create a new image, default is
1257 # @speed: the maximum speed, in bytes per second
1259 # @bitmap: the name of dirty bitmap if sync is "incremental".
1260 # Must be present if sync is "incremental", must NOT be present
1261 # otherwise. (Since 2.4)
1263 # @compress: true to compress data, if the target format supports it.
1264 # (default: false) (since 2.8)
1266 # @on-source-error: the action to take on an error on the source,
1267 # default 'report'. 'stop' and 'enospc' can only be used
1268 # if the block device supports io-status (see BlockInfo).
1270 # @on-target-error: the action to take on an error on the target,
1271 # default 'report' (no limitations, since this applies to
1272 # a different block device than @device).
1274 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1275 # finished its work, waiting for @block-job-finalize.
1276 # When true, this job will automatically perform its abort or
1278 # Defaults to true. (Since 2.12)
1280 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1281 # has completed ceased all work, and wait for @block-job-dismiss.
1282 # When true, this job will automatically disappear from the query
1283 # list without user intervention.
1284 # Defaults to true. (Since 2.12)
1286 # Note: @on-source-error and @on-target-error only affect background
1287 # I/O. If an error occurs during a guest write request, the device's
1288 # rerror/werror actions will be used.
1292 { 'struct': 'DriveBackup',
1293 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1294 '*format': 'str', 'sync': 'MirrorSyncMode',
1295 '*mode': 'NewImageMode', '*speed': 'int',
1296 '*bitmap': 'str', '*compress': 'bool',
1297 '*on-source-error': 'BlockdevOnError',
1298 '*on-target-error': 'BlockdevOnError',
1299 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1304 # @job-id: identifier for the newly-created block job. If
1305 # omitted, the device name will be used. (Since 2.7)
1307 # @device: the device name or node-name of a root node which should be copied.
1309 # @target: the device name or node-name of the backup target node.
1311 # @sync: what parts of the disk image should be copied to the destination
1312 # (all the disk, only the sectors allocated in the topmost image, or
1315 # @speed: the maximum speed, in bytes per second. The default is 0,
1318 # @compress: true to compress data, if the target format supports it.
1319 # (default: false) (since 2.8)
1321 # @on-source-error: the action to take on an error on the source,
1322 # default 'report'. 'stop' and 'enospc' can only be used
1323 # if the block device supports io-status (see BlockInfo).
1325 # @on-target-error: the action to take on an error on the target,
1326 # default 'report' (no limitations, since this applies to
1327 # a different block device than @device).
1329 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1330 # finished its work, waiting for @block-job-finalize.
1331 # When true, this job will automatically perform its abort or
1333 # Defaults to true. (Since 2.12)
1335 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1336 # has completed ceased all work, and wait for @block-job-dismiss.
1337 # When true, this job will automatically disappear from the query
1338 # list without user intervention.
1339 # Defaults to true. (Since 2.12)
1341 # Note: @on-source-error and @on-target-error only affect background
1342 # I/O. If an error occurs during a guest write request, the device's
1343 # rerror/werror actions will be used.
1347 { 'struct': 'BlockdevBackup',
1348 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1349 'sync': 'MirrorSyncMode', '*speed': 'int', '*compress': 'bool',
1350 '*on-source-error': 'BlockdevOnError',
1351 '*on-target-error': 'BlockdevOnError',
1352 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1355 # @blockdev-snapshot-sync:
1357 # Generates a synchronous snapshot of a block device.
1359 # For the arguments, see the documentation of BlockdevSnapshotSync.
1361 # Returns: nothing on success
1362 # If @device is not a valid block device, DeviceNotFound
1368 # -> { "execute": "blockdev-snapshot-sync",
1369 # "arguments": { "device": "ide-hd0",
1371 # "/some/place/my-image",
1372 # "format": "qcow2" } }
1373 # <- { "return": {} }
1376 { 'command': 'blockdev-snapshot-sync',
1377 'data': 'BlockdevSnapshotSync' }
1381 # @blockdev-snapshot:
1383 # Generates a snapshot of a block device.
1385 # Create a snapshot, by installing 'node' as the backing image of
1386 # 'overlay'. Additionally, if 'node' is associated with a block
1387 # device, the block device changes to using 'overlay' as its new active
1390 # For the arguments, see the documentation of BlockdevSnapshot.
1396 # -> { "execute": "blockdev-add",
1397 # "arguments": { "driver": "qcow2",
1398 # "node-name": "node1534",
1399 # "file": { "driver": "file",
1400 # "filename": "hd1.qcow2" },
1401 # "backing": null } }
1403 # <- { "return": {} }
1405 # -> { "execute": "blockdev-snapshot",
1406 # "arguments": { "node": "ide-hd0",
1407 # "overlay": "node1534" } }
1408 # <- { "return": {} }
1411 { 'command': 'blockdev-snapshot',
1412 'data': 'BlockdevSnapshot' }
1415 # @change-backing-file:
1417 # Change the backing file in the image file metadata. This does not
1418 # cause QEMU to reopen the image file to reparse the backing filename
1419 # (it may, however, perform a reopen to change permissions from
1420 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1421 # into the image file metadata, and the QEMU internal strings are
1424 # @image-node-name: The name of the block driver state node of the
1425 # image to modify. The "device" argument is used
1426 # to verify "image-node-name" is in the chain
1427 # described by "device".
1429 # @device: The device name or node-name of the root node that owns
1432 # @backing-file: The string to write as the backing file. This
1433 # string is not validated, so care should be taken
1434 # when specifying the string or the image chain may
1435 # not be able to be reopened again.
1437 # Returns: Nothing on success
1439 # If "device" does not exist or cannot be determined, DeviceNotFound
1443 { 'command': 'change-backing-file',
1444 'data': { 'device': 'str', 'image-node-name': 'str',
1445 'backing-file': 'str' } }
1450 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1451 # writes data between 'top' and 'base' into 'base'.
1453 # @job-id: identifier for the newly-created block job. If
1454 # omitted, the device name will be used. (Since 2.7)
1456 # @device: the device name or node-name of a root node
1458 # @base: The file name of the backing image to write data into.
1459 # If not specified, this is the deepest backing image.
1461 # @top: The file name of the backing image within the image chain,
1462 # which contains the topmost data to be committed down. If
1463 # not specified, this is the active layer.
1465 # @backing-file: The backing file string to write into the overlay
1466 # image of 'top'. If 'top' is the active layer,
1467 # specifying a backing file string is an error. This
1468 # filename is not validated.
1470 # If a pathname string is such that it cannot be
1471 # resolved by QEMU, that means that subsequent QMP or
1472 # HMP commands must use node-names for the image in
1473 # question, as filename lookup methods will fail.
1475 # If not specified, QEMU will automatically determine
1476 # the backing file string to use, or error out if
1477 # there is no obvious choice. Care should be taken
1478 # when specifying the string, to specify a valid
1479 # filename or protocol.
1482 # If top == base, that is an error.
1483 # If top == active, the job will not be completed by itself,
1484 # user needs to complete the job with the block-job-complete
1485 # command after getting the ready event. (Since 2.0)
1487 # If the base image is smaller than top, then the base image
1488 # will be resized to be the same size as top. If top is
1489 # smaller than the base image, the base will not be
1490 # truncated. If you want the base image size to match the
1491 # size of the smaller top, you can safely truncate it
1492 # yourself once the commit operation successfully completes.
1494 # @speed: the maximum speed, in bytes per second
1496 # @filter-node-name: the node name that should be assigned to the
1497 # filter driver that the commit job inserts into the graph
1498 # above @top. If this option is not given, a node name is
1499 # autogenerated. (Since: 2.9)
1501 # Returns: Nothing on success
1502 # If commit or stream is already active on this device, DeviceInUse
1503 # If @device does not exist, DeviceNotFound
1504 # If image commit is not supported by this device, NotSupported
1505 # If @base or @top is invalid, a generic error is returned
1506 # If @speed is invalid, InvalidParameter
1512 # -> { "execute": "block-commit",
1513 # "arguments": { "device": "virtio0",
1514 # "top": "/tmp/snap1.qcow2" } }
1515 # <- { "return": {} }
1518 { 'command': 'block-commit',
1519 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
1520 '*backing-file': 'str', '*speed': 'int',
1521 '*filter-node-name': 'str' } }
1526 # Start a point-in-time copy of a block device to a new destination. The
1527 # status of ongoing drive-backup operations can be checked with
1528 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1529 # The operation can be stopped before it has completed using the
1530 # block-job-cancel command.
1532 # Returns: nothing on success
1533 # If @device is not a valid block device, GenericError
1539 # -> { "execute": "drive-backup",
1540 # "arguments": { "device": "drive0",
1542 # "target": "backup.img" } }
1543 # <- { "return": {} }
1546 { 'command': 'drive-backup', 'boxed': true,
1547 'data': 'DriveBackup' }
1552 # Start a point-in-time copy of a block device to a new destination. The
1553 # status of ongoing blockdev-backup operations can be checked with
1554 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1555 # The operation can be stopped before it has completed using the
1556 # block-job-cancel command.
1558 # Returns: nothing on success
1559 # If @device is not a valid block device, DeviceNotFound
1564 # -> { "execute": "blockdev-backup",
1565 # "arguments": { "device": "src-id",
1567 # "target": "tgt-id" } }
1568 # <- { "return": {} }
1571 { 'command': 'blockdev-backup', 'boxed': true,
1572 'data': 'BlockdevBackup' }
1576 # @query-named-block-nodes:
1578 # Get the named block driver list
1580 # Returns: the list of BlockDeviceInfo
1586 # -> { "execute": "query-named-block-nodes" }
1587 # <- { "return": [ { "ro":false,
1589 # "encrypted":false,
1590 # "file":"disks/test.qcow2",
1591 # "node-name": "my-node",
1592 # "backing_file_depth":1,
1599 # "bps_max": 8000000,
1606 # "write_threshold": 0,
1608 # "filename":"disks/test.qcow2",
1610 # "virtual-size":2048000,
1611 # "backing_file":"base.qcow2",
1612 # "full-backing-filename":"disks/base.qcow2",
1613 # "backing-filename-format":"qcow2",
1617 # "name": "snapshot1",
1618 # "vm-state-size": 0,
1619 # "date-sec": 10000200,
1621 # "vm-clock-sec": 206,
1622 # "vm-clock-nsec": 30
1626 # "filename":"disks/base.qcow2",
1628 # "virtual-size":2048000
1633 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1638 # Start mirroring a block device's writes to a new destination. target
1639 # specifies the target of the new image. If the file exists, or if it
1640 # is a device, it will be used as the new destination for writes. If
1641 # it does not exist, a new file will be created. format specifies the
1642 # format of the mirror image, default is to probe if mode='existing',
1643 # else the format of the source.
1645 # Returns: nothing on success
1646 # If @device is not a valid block device, GenericError
1652 # -> { "execute": "drive-mirror",
1653 # "arguments": { "device": "ide-hd0",
1654 # "target": "/some/place/my-image",
1656 # "format": "qcow2" } }
1657 # <- { "return": {} }
1660 { 'command': 'drive-mirror', 'boxed': true,
1661 'data': 'DriveMirror' }
1666 # A set of parameters describing drive mirror setup.
1668 # @job-id: identifier for the newly-created block job. If
1669 # omitted, the device name will be used. (Since 2.7)
1671 # @device: the device name or node-name of a root node whose writes should be
1674 # @target: the target of the new image. If the file exists, or if it
1675 # is a device, the existing file/device will be used as the new
1676 # destination. If it does not exist, a new file will be created.
1678 # @format: the format of the new destination, default is to
1679 # probe if @mode is 'existing', else the format of the source
1681 # @node-name: the new block driver state node name in the graph
1684 # @replaces: with sync=full graph node name to be replaced by the new
1685 # image when a whole image copy is done. This can be used to repair
1686 # broken Quorum files. (Since 2.1)
1688 # @mode: whether and how QEMU should create a new image, default is
1691 # @speed: the maximum speed, in bytes per second
1693 # @sync: what parts of the disk image should be copied to the destination
1694 # (all the disk, only the sectors allocated in the topmost image, or
1697 # @granularity: granularity of the dirty bitmap, default is 64K
1698 # if the image format doesn't have clusters, 4K if the clusters
1699 # are smaller than that, else the cluster size. Must be a
1700 # power of 2 between 512 and 64M (since 1.4).
1702 # @buf-size: maximum amount of data in flight from source to
1703 # target (since 1.4).
1705 # @on-source-error: the action to take on an error on the source,
1706 # default 'report'. 'stop' and 'enospc' can only be used
1707 # if the block device supports io-status (see BlockInfo).
1709 # @on-target-error: the action to take on an error on the target,
1710 # default 'report' (no limitations, since this applies to
1711 # a different block device than @device).
1712 # @unmap: Whether to try to unmap target sectors where source has
1713 # only zero. If true, and target unallocated sectors will read as zero,
1714 # target image sectors will be unmapped; otherwise, zeroes will be
1715 # written. Both will result in identical contents.
1716 # Default is true. (Since 2.4)
1718 # @copy-mode: when to copy data to the destination; defaults to 'background'
1723 { 'struct': 'DriveMirror',
1724 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1725 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1726 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1727 '*speed': 'int', '*granularity': 'uint32',
1728 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1729 '*on-target-error': 'BlockdevOnError',
1730 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode' } }
1733 # @BlockDirtyBitmap:
1735 # @node: name of device/node which the bitmap is tracking
1737 # @name: name of the dirty bitmap
1741 { 'struct': 'BlockDirtyBitmap',
1742 'data': { 'node': 'str', 'name': 'str' } }
1745 # @BlockDirtyBitmapAdd:
1747 # @node: name of device/node which the bitmap is tracking
1749 # @name: name of the dirty bitmap
1751 # @granularity: the bitmap granularity, default is 64k for
1752 # block-dirty-bitmap-add
1754 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1755 # corresponding block device image file on its close. For now only
1756 # Qcow2 disks support persistent bitmaps. Default is false for
1757 # block-dirty-bitmap-add. (Since: 2.10)
1759 # @autoload: ignored and deprecated since 2.12.
1760 # Currently, all dirty tracking bitmaps are loaded from Qcow2 on
1763 # @x-disabled: the bitmap is created in the disabled state, which means that
1764 # it will not track drive changes. The bitmap may be enabled with
1765 # x-block-dirty-bitmap-enable. Default is false. (Since: 3.0)
1769 { 'struct': 'BlockDirtyBitmapAdd',
1770 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1771 '*persistent': 'bool', '*autoload': 'bool', '*x-disabled': 'bool' } }
1774 # @BlockDirtyBitmapMerge:
1776 # @node: name of device/node which the bitmap is tracking
1778 # @dst_name: name of the destination dirty bitmap
1780 # @src_name: name of the source dirty bitmap
1784 { 'struct': 'BlockDirtyBitmapMerge',
1785 'data': { 'node': 'str', 'dst_name': 'str', 'src_name': 'str' } }
1788 # @block-dirty-bitmap-add:
1790 # Create a dirty bitmap with a name on the node, and start tracking the writes.
1792 # Returns: nothing on success
1793 # If @node is not a valid block device or node, DeviceNotFound
1794 # If @name is already taken, GenericError with an explanation
1800 # -> { "execute": "block-dirty-bitmap-add",
1801 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1802 # <- { "return": {} }
1805 { 'command': 'block-dirty-bitmap-add',
1806 'data': 'BlockDirtyBitmapAdd' }
1809 # @block-dirty-bitmap-remove:
1811 # Stop write tracking and remove the dirty bitmap that was created
1812 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
1815 # Returns: nothing on success
1816 # If @node is not a valid block device or node, DeviceNotFound
1817 # If @name is not found, GenericError with an explanation
1818 # if @name is frozen by an operation, GenericError
1824 # -> { "execute": "block-dirty-bitmap-remove",
1825 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1826 # <- { "return": {} }
1829 { 'command': 'block-dirty-bitmap-remove',
1830 'data': 'BlockDirtyBitmap' }
1833 # @block-dirty-bitmap-clear:
1835 # Clear (reset) a dirty bitmap on the device, so that an incremental
1836 # backup from this point in time forward will only backup clusters
1837 # modified after this clear operation.
1839 # Returns: nothing on success
1840 # If @node is not a valid block device, DeviceNotFound
1841 # If @name is not found, GenericError with an explanation
1847 # -> { "execute": "block-dirty-bitmap-clear",
1848 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1849 # <- { "return": {} }
1852 { 'command': 'block-dirty-bitmap-clear',
1853 'data': 'BlockDirtyBitmap' }
1856 # @x-block-dirty-bitmap-enable:
1858 # Enables a dirty bitmap so that it will begin tracking disk changes.
1860 # Returns: nothing on success
1861 # If @node is not a valid block device, DeviceNotFound
1862 # If @name is not found, GenericError with an explanation
1868 # -> { "execute": "x-block-dirty-bitmap-enable",
1869 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1870 # <- { "return": {} }
1873 { 'command': 'x-block-dirty-bitmap-enable',
1874 'data': 'BlockDirtyBitmap' }
1877 # @x-block-dirty-bitmap-disable:
1879 # Disables a dirty bitmap so that it will stop tracking disk changes.
1881 # Returns: nothing on success
1882 # If @node is not a valid block device, DeviceNotFound
1883 # If @name is not found, GenericError with an explanation
1889 # -> { "execute": "x-block-dirty-bitmap-disable",
1890 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1891 # <- { "return": {} }
1894 { 'command': 'x-block-dirty-bitmap-disable',
1895 'data': 'BlockDirtyBitmap' }
1898 # @x-block-dirty-bitmap-merge:
1900 # Merge @src_name dirty bitmap to @dst_name dirty bitmap. @src_name dirty
1901 # bitmap is unchanged. On error, @dst_name is unchanged.
1903 # Returns: nothing on success
1904 # If @node is not a valid block device, DeviceNotFound
1905 # If @dst_name or @src_name is not found, GenericError
1906 # If bitmaps has different sizes or granularities, GenericError
1912 # -> { "execute": "x-block-dirty-bitmap-merge",
1913 # "arguments": { "node": "drive0", "dst_name": "bitmap0",
1914 # "src_name": "bitmap1" } }
1915 # <- { "return": {} }
1918 { 'command': 'x-block-dirty-bitmap-merge',
1919 'data': 'BlockDirtyBitmapMerge' }
1922 # @BlockDirtyBitmapSha256:
1924 # SHA256 hash of dirty bitmap data
1926 # @sha256: ASCII representation of SHA256 bitmap hash
1930 { 'struct': 'BlockDirtyBitmapSha256',
1931 'data': {'sha256': 'str'} }
1934 # @x-debug-block-dirty-bitmap-sha256:
1938 # Returns: BlockDirtyBitmapSha256 on success
1939 # If @node is not a valid block device, DeviceNotFound
1940 # If @name is not found or if hashing has failed, GenericError with an
1945 { 'command': 'x-debug-block-dirty-bitmap-sha256',
1946 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
1951 # Start mirroring a block device's writes to a new destination.
1953 # @job-id: identifier for the newly-created block job. If
1954 # omitted, the device name will be used. (Since 2.7)
1956 # @device: The device name or node-name of a root node whose writes should be
1959 # @target: the id or node-name of the block device to mirror to. This mustn't be
1960 # attached to guest.
1962 # @replaces: with sync=full graph node name to be replaced by the new
1963 # image when a whole image copy is done. This can be used to repair
1964 # broken Quorum files.
1966 # @speed: the maximum speed, in bytes per second
1968 # @sync: what parts of the disk image should be copied to the destination
1969 # (all the disk, only the sectors allocated in the topmost image, or
1972 # @granularity: granularity of the dirty bitmap, default is 64K
1973 # if the image format doesn't have clusters, 4K if the clusters
1974 # are smaller than that, else the cluster size. Must be a
1975 # power of 2 between 512 and 64M
1977 # @buf-size: maximum amount of data in flight from source to
1980 # @on-source-error: the action to take on an error on the source,
1981 # default 'report'. 'stop' and 'enospc' can only be used
1982 # if the block device supports io-status (see BlockInfo).
1984 # @on-target-error: the action to take on an error on the target,
1985 # default 'report' (no limitations, since this applies to
1986 # a different block device than @device).
1988 # @filter-node-name: the node name that should be assigned to the
1989 # filter driver that the mirror job inserts into the graph
1990 # above @device. If this option is not given, a node name is
1991 # autogenerated. (Since: 2.9)
1993 # @copy-mode: when to copy data to the destination; defaults to 'background'
1996 # Returns: nothing on success.
2002 # -> { "execute": "blockdev-mirror",
2003 # "arguments": { "device": "ide-hd0",
2004 # "target": "target0",
2005 # "sync": "full" } }
2006 # <- { "return": {} }
2009 { 'command': 'blockdev-mirror',
2010 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2012 'sync': 'MirrorSyncMode',
2013 '*speed': 'int', '*granularity': 'uint32',
2014 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2015 '*on-target-error': 'BlockdevOnError',
2016 '*filter-node-name': 'str',
2017 '*copy-mode': 'MirrorCopyMode' } }
2020 # @block_set_io_throttle:
2022 # Change I/O throttle limits for a block drive.
2024 # Since QEMU 2.4, each device with I/O limits is member of a throttle
2027 # If two or more devices are members of the same group, the limits
2028 # will apply to the combined I/O of the whole group in a round-robin
2029 # fashion. Therefore, setting new I/O limits to a device will affect
2032 # The name of the group can be specified using the 'group' parameter.
2033 # If the parameter is unset, it is assumed to be the current group of
2034 # that device. If it's not in any group yet, the name of the device
2035 # will be used as the name for its group.
2037 # The 'group' parameter can also be used to move a device to a
2038 # different group. In this case the limits specified in the parameters
2039 # will be applied to the new group only.
2041 # I/O limits can be disabled by setting all of them to 0. In this case
2042 # the device will be removed from its group and the rest of its
2043 # members will not be affected. The 'group' parameter is ignored.
2045 # Returns: Nothing on success
2046 # If @device is not a valid block device, DeviceNotFound
2052 # -> { "execute": "block_set_io_throttle",
2053 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
2066 # "bps_max_length": 0,
2067 # "iops_size": 0 } }
2068 # <- { "return": {} }
2070 # -> { "execute": "block_set_io_throttle",
2071 # "arguments": { "id": "ide0-1-0",
2078 # "bps_max": 8000000,
2084 # "bps_max_length": 60,
2085 # "iops_size": 0 } }
2086 # <- { "return": {} }
2088 { 'command': 'block_set_io_throttle', 'boxed': true,
2089 'data': 'BlockIOThrottle' }
2094 # A set of parameters describing block throttling.
2096 # @device: Block device name (deprecated, use @id instead)
2098 # @id: The name or QOM path of the guest device (since: 2.8)
2100 # @bps: total throughput limit in bytes per second
2102 # @bps_rd: read throughput limit in bytes per second
2104 # @bps_wr: write throughput limit in bytes per second
2106 # @iops: total I/O operations per second
2108 # @iops_rd: read I/O operations per second
2110 # @iops_wr: write I/O operations per second
2112 # @bps_max: total throughput limit during bursts,
2113 # in bytes (Since 1.7)
2115 # @bps_rd_max: read throughput limit during bursts,
2116 # in bytes (Since 1.7)
2118 # @bps_wr_max: write throughput limit during bursts,
2119 # in bytes (Since 1.7)
2121 # @iops_max: total I/O operations per second during bursts,
2122 # in bytes (Since 1.7)
2124 # @iops_rd_max: read I/O operations per second during bursts,
2125 # in bytes (Since 1.7)
2127 # @iops_wr_max: write I/O operations per second during bursts,
2128 # in bytes (Since 1.7)
2130 # @bps_max_length: maximum length of the @bps_max burst
2131 # period, in seconds. It must only
2132 # be set if @bps_max is set as well.
2133 # Defaults to 1. (Since 2.6)
2135 # @bps_rd_max_length: maximum length of the @bps_rd_max
2136 # burst period, in seconds. It must only
2137 # be set if @bps_rd_max is set as well.
2138 # Defaults to 1. (Since 2.6)
2140 # @bps_wr_max_length: maximum length of the @bps_wr_max
2141 # burst period, in seconds. It must only
2142 # be set if @bps_wr_max is set as well.
2143 # Defaults to 1. (Since 2.6)
2145 # @iops_max_length: maximum length of the @iops burst
2146 # period, in seconds. It must only
2147 # be set if @iops_max is set as well.
2148 # Defaults to 1. (Since 2.6)
2150 # @iops_rd_max_length: maximum length of the @iops_rd_max
2151 # burst period, in seconds. It must only
2152 # be set if @iops_rd_max is set as well.
2153 # Defaults to 1. (Since 2.6)
2155 # @iops_wr_max_length: maximum length of the @iops_wr_max
2156 # burst period, in seconds. It must only
2157 # be set if @iops_wr_max is set as well.
2158 # Defaults to 1. (Since 2.6)
2160 # @iops_size: an I/O size in bytes (Since 1.7)
2162 # @group: throttle group name (Since 2.4)
2166 { 'struct': 'BlockIOThrottle',
2167 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2168 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2169 '*bps_max': 'int', '*bps_rd_max': 'int',
2170 '*bps_wr_max': 'int', '*iops_max': 'int',
2171 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2172 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2173 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2174 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2175 '*iops_size': 'int', '*group': 'str' } }
2180 # Limit parameters for throttling.
2181 # Since some limit combinations are illegal, limits should always be set in one
2182 # transaction. All fields are optional. When setting limits, if a field is
2183 # missing the current value is not changed.
2185 # @iops-total: limit total I/O operations per second
2186 # @iops-total-max: I/O operations burst
2187 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2188 # It must only be set if @iops-total-max is set as well.
2189 # @iops-read: limit read operations per second
2190 # @iops-read-max: I/O operations read burst
2191 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2192 # It must only be set if @iops-read-max is set as well.
2193 # @iops-write: limit write operations per second
2194 # @iops-write-max: I/O operations write burst
2195 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2196 # It must only be set if @iops-write-max is set as well.
2197 # @bps-total: limit total bytes per second
2198 # @bps-total-max: total bytes burst
2199 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2200 # It must only be set if @bps-total-max is set as well.
2201 # @bps-read: limit read bytes per second
2202 # @bps-read-max: total bytes read burst
2203 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2204 # It must only be set if @bps-read-max is set as well.
2205 # @bps-write: limit write bytes per second
2206 # @bps-write-max: total bytes write burst
2207 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2208 # It must only be set if @bps-write-max is set as well.
2209 # @iops-size: when limiting by iops max size of an I/O in bytes
2213 { 'struct': 'ThrottleLimits',
2214 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2215 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2216 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2217 '*iops-write' : 'int', '*iops-write-max' : 'int',
2218 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2219 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2220 '*bps-read' : 'int', '*bps-read-max' : 'int',
2221 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2222 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2223 '*iops-size' : 'int' } }
2228 # Copy data from a backing file into a block device.
2230 # The block streaming operation is performed in the background until the entire
2231 # backing file has been copied. This command returns immediately once streaming
2232 # has started. The status of ongoing block streaming operations can be checked
2233 # with query-block-jobs. The operation can be stopped before it has completed
2234 # using the block-job-cancel command.
2236 # The node that receives the data is called the top image, can be located in
2237 # any part of the chain (but always above the base image; see below) and can be
2238 # specified using its device or node name. Earlier qemu versions only allowed
2239 # 'device' to name the top level node; presence of the 'base-node' parameter
2240 # during introspection can be used as a witness of the enhanced semantics
2243 # If a base file is specified then sectors are not copied from that base file and
2244 # its backing chain. When streaming completes the image file will have the base
2245 # file as its backing file. This can be used to stream a subset of the backing
2246 # file chain instead of flattening the entire image.
2248 # On successful completion the image file is updated to drop the backing file
2249 # and the BLOCK_JOB_COMPLETED event is emitted.
2251 # @job-id: identifier for the newly-created block job. If
2252 # omitted, the device name will be used. (Since 2.7)
2254 # @device: the device or node name of the top image
2256 # @base: the common backing file name.
2257 # It cannot be set if @base-node is also set.
2259 # @base-node: the node name of the backing file.
2260 # It cannot be set if @base is also set. (Since 2.8)
2262 # @backing-file: The backing file string to write into the top
2263 # image. This filename is not validated.
2265 # If a pathname string is such that it cannot be
2266 # resolved by QEMU, that means that subsequent QMP or
2267 # HMP commands must use node-names for the image in
2268 # question, as filename lookup methods will fail.
2270 # If not specified, QEMU will automatically determine
2271 # the backing file string to use, or error out if there
2272 # is no obvious choice. Care should be taken when
2273 # specifying the string, to specify a valid filename or
2277 # @speed: the maximum speed, in bytes per second
2279 # @on-error: the action to take on an error (default report).
2280 # 'stop' and 'enospc' can only be used if the block device
2281 # supports io-status (see BlockInfo). Since 1.3.
2283 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
2289 # -> { "execute": "block-stream",
2290 # "arguments": { "device": "virtio0",
2291 # "base": "/tmp/master.qcow2" } }
2292 # <- { "return": {} }
2295 { 'command': 'block-stream',
2296 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2297 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2298 '*on-error': 'BlockdevOnError' } }
2301 # @block-job-set-speed:
2303 # Set maximum speed for a background block operation.
2305 # This command can only be issued when there is an active block job.
2307 # Throttling can be disabled by setting the speed to 0.
2309 # @device: The job identifier. This used to be a device name (hence
2310 # the name of the parameter), but since QEMU 2.7 it can have
2313 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2316 # Returns: Nothing on success
2317 # If no background operation is active on this device, DeviceNotActive
2321 { 'command': 'block-job-set-speed',
2322 'data': { 'device': 'str', 'speed': 'int' } }
2325 # @block-job-cancel:
2327 # Stop an active background block operation.
2329 # This command returns immediately after marking the active background block
2330 # operation for cancellation. It is an error to call this command if no
2331 # operation is in progress.
2333 # The operation will cancel as soon as possible and then emit the
2334 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2335 # enumerated using query-block-jobs.
2337 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2338 # (via the event BLOCK_JOB_READY) that the source and destination are
2339 # synchronized, then the event triggered by this command changes to
2340 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2341 # destination now has a point-in-time copy tied to the time of the cancellation.
2343 # For streaming, the image file retains its backing file unless the streaming
2344 # operation happens to complete just as it is being cancelled. A new streaming
2345 # operation can be started at a later time to finish copying all data from the
2348 # @device: The job identifier. This used to be a device name (hence
2349 # the name of the parameter), but since QEMU 2.7 it can have
2352 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2353 # abandon the job immediately (even if it is paused) instead of waiting
2354 # for the destination to complete its final synchronization (since 1.3)
2356 # Returns: Nothing on success
2357 # If no background operation is active on this device, DeviceNotActive
2361 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2366 # Pause an active background block operation.
2368 # This command returns immediately after marking the active background block
2369 # operation for pausing. It is an error to call this command if no
2370 # operation is in progress or if the job is already paused.
2372 # The operation will pause as soon as possible. No event is emitted when
2373 # the operation is actually paused. Cancelling a paused job automatically
2376 # @device: The job identifier. This used to be a device name (hence
2377 # the name of the parameter), but since QEMU 2.7 it can have
2380 # Returns: Nothing on success
2381 # If no background operation is active on this device, DeviceNotActive
2385 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2388 # @block-job-resume:
2390 # Resume an active background block operation.
2392 # This command returns immediately after resuming a paused background block
2393 # operation. It is an error to call this command if no operation is in
2394 # progress or if the job is not paused.
2396 # This command also clears the error status of the job.
2398 # @device: The job identifier. This used to be a device name (hence
2399 # the name of the parameter), but since QEMU 2.7 it can have
2402 # Returns: Nothing on success
2403 # If no background operation is active on this device, DeviceNotActive
2407 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2410 # @block-job-complete:
2412 # Manually trigger completion of an active background block operation. This
2413 # is supported for drive mirroring, where it also switches the device to
2414 # write to the target path only. The ability to complete is signaled with
2415 # a BLOCK_JOB_READY event.
2417 # This command completes an active background block operation synchronously.
2418 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2419 # is not defined. Note that if an I/O error occurs during the processing of
2420 # this command: 1) the command itself will fail; 2) the error will be processed
2421 # according to the rerror/werror arguments that were specified when starting
2424 # A cancelled or paused job cannot be completed.
2426 # @device: The job identifier. This used to be a device name (hence
2427 # the name of the parameter), but since QEMU 2.7 it can have
2430 # Returns: Nothing on success
2431 # If no background operation is active on this device, DeviceNotActive
2435 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2438 # @block-job-dismiss:
2440 # For jobs that have already concluded, remove them from the block-job-query
2441 # list. This command only needs to be run for jobs which were started with
2442 # QEMU 2.12+ job lifetime management semantics.
2444 # This command will refuse to operate on any job that has not yet reached
2445 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2446 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2447 # to be used as appropriate.
2449 # @id: The job identifier.
2451 # Returns: Nothing on success
2455 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2458 # @block-job-finalize:
2460 # Once a job that has manual=true reaches the pending state, it can be
2461 # instructed to finalize any graph changes and do any necessary cleanup
2463 # For jobs in a transaction, instructing one job to finalize will force
2464 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2465 # a single member job to finalize.
2467 # @id: The job identifier.
2469 # Returns: Nothing on success
2473 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2476 # @BlockdevDiscardOptions:
2478 # Determines how to handle discard requests.
2480 # @ignore: Ignore the request
2481 # @unmap: Forward as an unmap request
2485 { 'enum': 'BlockdevDiscardOptions',
2486 'data': [ 'ignore', 'unmap' ] }
2489 # @BlockdevDetectZeroesOptions:
2491 # Describes the operation mode for the automatic conversion of plain
2492 # zero writes by the OS to driver specific optimized zero write commands.
2494 # @off: Disabled (default)
2496 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2497 # also that @BlockdevDiscardOptions is set to unmap for this device.
2501 { 'enum': 'BlockdevDetectZeroesOptions',
2502 'data': [ 'off', 'on', 'unmap' ] }
2505 # @BlockdevAioOptions:
2507 # Selects the AIO backend to handle I/O requests
2509 # @threads: Use qemu's thread pool
2510 # @native: Use native AIO backend (only Linux and Windows)
2514 { 'enum': 'BlockdevAioOptions',
2515 'data': [ 'threads', 'native' ] }
2518 # @BlockdevCacheOptions:
2520 # Includes cache-related options for block devices
2522 # @direct: enables use of O_DIRECT (bypass the host page cache;
2524 # @no-flush: ignore any flush requests for the device (default:
2529 { 'struct': 'BlockdevCacheOptions',
2530 'data': { '*direct': 'bool',
2531 '*no-flush': 'bool' } }
2536 # Drivers that are supported in block device operations.
2539 # @throttle: Since 2.11
2541 # @copy-on-read: Since 3.0
2542 # @blklogwrites: Since 3.0
2546 { 'enum': 'BlockdevDriver',
2547 'data': [ 'blkdebug', 'blklogwrites', 'blkverify', 'bochs', 'cloop',
2548 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps', 'gluster',
2549 'host_cdrom', 'host_device', 'http', 'https', 'iscsi', 'luks',
2550 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels', 'qcow',
2551 'qcow2', 'qed', 'quorum', 'raw', 'rbd', 'replication', 'sheepdog',
2552 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2555 # @BlockdevOptionsFile:
2557 # Driver specific block device options for the file backend.
2559 # @filename: path to the image file
2560 # @pr-manager: the id for the object that will handle persistent reservations
2561 # for this device (default: none, forward the commands via SG_IO;
2563 # @aio: AIO backend (default: threads) (since: 2.8)
2564 # @locking: whether to enable file locking. If set to 'auto', only enable
2565 # when Open File Descriptor (OFD) locking API is available
2566 # (default: auto, since 2.10)
2567 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2568 # migration. May cause noticeable delays if the image
2569 # file is large, do not use in production.
2570 # (default: off) (since: 3.0)
2574 { 'struct': 'BlockdevOptionsFile',
2575 'data': { 'filename': 'str',
2576 '*pr-manager': 'str',
2577 '*locking': 'OnOffAuto',
2578 '*aio': 'BlockdevAioOptions',
2579 '*x-check-cache-dropped': 'bool' } }
2582 # @BlockdevOptionsNull:
2584 # Driver specific block device options for the null backend.
2586 # @size: size of the device in bytes.
2587 # @latency-ns: emulated latency (in nanoseconds) in processing
2588 # requests. Default to zero which completes requests immediately.
2593 { 'struct': 'BlockdevOptionsNull',
2594 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
2597 # @BlockdevOptionsNVMe:
2599 # Driver specific block device options for the NVMe backend.
2601 # @device: controller address of the NVMe device.
2602 # @namespace: namespace number of the device, starting from 1.
2606 { 'struct': 'BlockdevOptionsNVMe',
2607 'data': { 'device': 'str', 'namespace': 'int' } }
2610 # @BlockdevOptionsVVFAT:
2612 # Driver specific block device options for the vvfat protocol.
2614 # @dir: directory to be exported as FAT image
2615 # @fat-type: FAT type: 12, 16 or 32
2616 # @floppy: whether to export a floppy image (true) or
2617 # partitioned hard disk (false; default)
2618 # @label: set the volume label, limited to 11 bytes. FAT16 and
2619 # FAT32 traditionally have some restrictions on labels, which are
2620 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2622 # @rw: whether to allow write operations (default: false)
2626 { 'struct': 'BlockdevOptionsVVFAT',
2627 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2628 '*label': 'str', '*rw': 'bool' } }
2631 # @BlockdevOptionsGenericFormat:
2633 # Driver specific block device options for image format that have no option
2634 # besides their data source.
2636 # @file: reference to or definition of the data source block device
2640 { 'struct': 'BlockdevOptionsGenericFormat',
2641 'data': { 'file': 'BlockdevRef' } }
2644 # @BlockdevOptionsLUKS:
2646 # Driver specific block device options for LUKS.
2648 # @key-secret: the ID of a QCryptoSecret object providing
2649 # the decryption key (since 2.6). Mandatory except when
2650 # doing a metadata-only probe of the image.
2654 { 'struct': 'BlockdevOptionsLUKS',
2655 'base': 'BlockdevOptionsGenericFormat',
2656 'data': { '*key-secret': 'str' } }
2660 # @BlockdevOptionsGenericCOWFormat:
2662 # Driver specific block device options for image format that have no option
2663 # besides their data source and an optional backing file.
2665 # @backing: reference to or definition of the backing file block
2666 # device, null disables the backing file entirely.
2667 # Defaults to the backing file stored the image file.
2671 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2672 'base': 'BlockdevOptionsGenericFormat',
2673 'data': { '*backing': 'BlockdevRefOrNull' } }
2676 # @Qcow2OverlapCheckMode:
2678 # General overlap check modes.
2680 # @none: Do not perform any checks
2682 # @constant: Perform only checks which can be done in constant time and
2683 # without reading anything from disk
2685 # @cached: Perform only checks which can be done without reading anything
2688 # @all: Perform all available overlap checks
2692 { 'enum': 'Qcow2OverlapCheckMode',
2693 'data': [ 'none', 'constant', 'cached', 'all' ] }
2696 # @Qcow2OverlapCheckFlags:
2698 # Structure of flags for each metadata structure. Setting a field to 'true'
2699 # makes qemu guard that structure against unintended overwriting. The default
2700 # value is chosen according to the template given.
2702 # @template: Specifies a template mode which can be adjusted using the other
2703 # flags, defaults to 'cached'
2705 # @bitmap-directory: since 3.0
2709 { 'struct': 'Qcow2OverlapCheckFlags',
2710 'data': { '*template': 'Qcow2OverlapCheckMode',
2711 '*main-header': 'bool',
2712 '*active-l1': 'bool',
2713 '*active-l2': 'bool',
2714 '*refcount-table': 'bool',
2715 '*refcount-block': 'bool',
2716 '*snapshot-table': 'bool',
2717 '*inactive-l1': 'bool',
2718 '*inactive-l2': 'bool',
2719 '*bitmap-directory': 'bool' } }
2722 # @Qcow2OverlapChecks:
2724 # Specifies which metadata structures should be guarded against unintended
2727 # @flags: set of flags for separate specification of each metadata structure
2730 # @mode: named mode which chooses a specific set of flags
2734 { 'alternate': 'Qcow2OverlapChecks',
2735 'data': { 'flags': 'Qcow2OverlapCheckFlags',
2736 'mode': 'Qcow2OverlapCheckMode' } }
2739 # @BlockdevQcowEncryptionFormat:
2741 # @aes: AES-CBC with plain64 initialization vectors
2745 { 'enum': 'BlockdevQcowEncryptionFormat',
2749 # @BlockdevQcowEncryption:
2753 { 'union': 'BlockdevQcowEncryption',
2754 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
2755 'discriminator': 'format',
2756 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
2759 # @BlockdevOptionsQcow:
2761 # Driver specific block device options for qcow.
2763 # @encrypt: Image decryption options. Mandatory for
2764 # encrypted images, except when doing a metadata-only
2765 # probe of the image.
2769 { 'struct': 'BlockdevOptionsQcow',
2770 'base': 'BlockdevOptionsGenericCOWFormat',
2771 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
2776 # @BlockdevQcow2EncryptionFormat:
2777 # @aes: AES-CBC with plain64 initialization venctors
2781 { 'enum': 'BlockdevQcow2EncryptionFormat',
2782 'data': [ 'aes', 'luks' ] }
2785 # @BlockdevQcow2Encryption:
2789 { 'union': 'BlockdevQcow2Encryption',
2790 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
2791 'discriminator': 'format',
2792 'data': { 'aes': 'QCryptoBlockOptionsQCow',
2793 'luks': 'QCryptoBlockOptionsLUKS'} }
2796 # @BlockdevOptionsQcow2:
2798 # Driver specific block device options for qcow2.
2800 # @lazy-refcounts: whether to enable the lazy refcounts
2801 # feature (default is taken from the image file)
2803 # @pass-discard-request: whether discard requests to the qcow2
2804 # device should be forwarded to the data source
2806 # @pass-discard-snapshot: whether discard requests for the data source
2807 # should be issued when a snapshot operation (e.g.
2808 # deleting a snapshot) frees clusters in the qcow2 file
2810 # @pass-discard-other: whether discard requests for the data source
2811 # should be issued on other occasions where a cluster
2814 # @overlap-check: which overlap checks to perform for writes
2815 # to the image, defaults to 'cached' (since 2.2)
2817 # @cache-size: the maximum total size of the L2 table and
2818 # refcount block caches in bytes (since 2.2)
2820 # @l2-cache-size: the maximum size of the L2 table cache in
2823 # @l2-cache-entry-size: the size of each entry in the L2 cache in
2824 # bytes. It must be a power of two between 512
2825 # and the cluster size. The default value is
2826 # the cluster size (since 2.12)
2828 # @refcount-cache-size: the maximum size of the refcount block cache
2829 # in bytes (since 2.2)
2831 # @cache-clean-interval: clean unused entries in the L2 and refcount
2832 # caches. The interval is in seconds. The default value
2833 # is 0 and it disables this feature (since 2.5)
2834 # @encrypt: Image decryption options. Mandatory for
2835 # encrypted images, except when doing a metadata-only
2836 # probe of the image. (since 2.10)
2840 { 'struct': 'BlockdevOptionsQcow2',
2841 'base': 'BlockdevOptionsGenericCOWFormat',
2842 'data': { '*lazy-refcounts': 'bool',
2843 '*pass-discard-request': 'bool',
2844 '*pass-discard-snapshot': 'bool',
2845 '*pass-discard-other': 'bool',
2846 '*overlap-check': 'Qcow2OverlapChecks',
2847 '*cache-size': 'int',
2848 '*l2-cache-size': 'int',
2849 '*l2-cache-entry-size': 'int',
2850 '*refcount-cache-size': 'int',
2851 '*cache-clean-interval': 'int',
2852 '*encrypt': 'BlockdevQcow2Encryption' } }
2855 # @SshHostKeyCheckMode:
2857 # @none Don't check the host key at all
2858 # @hash Compare the host key with a given hash
2859 # @known_hosts Check the host key against the known_hosts file
2863 { 'enum': 'SshHostKeyCheckMode',
2864 'data': [ 'none', 'hash', 'known_hosts' ] }
2867 # @SshHostKeyCheckHashType:
2869 # @md5 The given hash is an md5 hash
2870 # @sha1 The given hash is an sha1 hash
2874 { 'enum': 'SshHostKeyCheckHashType',
2875 'data': [ 'md5', 'sha1' ] }
2880 # @type The hash algorithm used for the hash
2881 # @hash The expected hash value
2885 { 'struct': 'SshHostKeyHash',
2886 'data': { 'type': 'SshHostKeyCheckHashType',
2894 { 'union': 'SshHostKeyCheck',
2895 'base': { 'mode': 'SshHostKeyCheckMode' },
2896 'discriminator': 'mode',
2897 'data': { 'hash': 'SshHostKeyHash' } }
2900 # @BlockdevOptionsSsh:
2902 # @server: host address
2904 # @path: path to the image on the host
2906 # @user: user as which to connect, defaults to current
2909 # @host-key-check: Defines how and what to check the host key against
2910 # (default: known_hosts)
2914 { 'struct': 'BlockdevOptionsSsh',
2915 'data': { 'server': 'InetSocketAddress',
2918 '*host-key-check': 'SshHostKeyCheck' } }
2924 # Trigger events supported by blkdebug.
2926 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
2929 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
2931 # @cor_write: a write due to copy-on-read (since 2.11)
2935 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
2936 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
2937 'l1_grow_activate_table', 'l2_load', 'l2_update',
2938 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
2939 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
2940 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
2941 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
2942 'refblock_load', 'refblock_update', 'refblock_update_part',
2943 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
2944 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
2945 'refblock_alloc_switch_table', 'cluster_alloc',
2946 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
2947 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
2948 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
2949 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
2950 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
2954 # @BlkdebugInjectErrorOptions:
2956 # Describes a single error injection for blkdebug.
2958 # @event: trigger event
2960 # @state: the state identifier blkdebug needs to be in to
2961 # actually trigger the event; defaults to "any"
2963 # @errno: error identifier (errno) to be returned; defaults to
2966 # @sector: specifies the sector index which has to be affected
2967 # in order to actually trigger the event; defaults to "any
2970 # @once: disables further events after this one has been
2971 # triggered; defaults to false
2973 # @immediately: fail immediately; defaults to false
2977 { 'struct': 'BlkdebugInjectErrorOptions',
2978 'data': { 'event': 'BlkdebugEvent',
2983 '*immediately': 'bool' } }
2986 # @BlkdebugSetStateOptions:
2988 # Describes a single state-change event for blkdebug.
2990 # @event: trigger event
2992 # @state: the current state identifier blkdebug needs to be in;
2995 # @new_state: the state identifier blkdebug is supposed to assume if
2996 # this event is triggered
3000 { 'struct': 'BlkdebugSetStateOptions',
3001 'data': { 'event': 'BlkdebugEvent',
3003 'new_state': 'int' } }
3006 # @BlockdevOptionsBlkdebug:
3008 # Driver specific block device options for blkdebug.
3010 # @image: underlying raw block device (or image file)
3012 # @config: filename of the configuration file
3014 # @align: required alignment for requests in bytes, must be
3015 # positive power of 2, or 0 for default
3017 # @max-transfer: maximum size for I/O transfers in bytes, must be
3018 # positive multiple of @align and of the underlying
3019 # file's request alignment (but need not be a power of
3020 # 2), or 0 for default (since 2.10)
3022 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3023 # must be positive multiple of @align and of the
3024 # underlying file's request alignment (but need not be a
3025 # power of 2), or 0 for default (since 2.10)
3027 # @max-write-zero: maximum size for write zero requests in bytes, must be
3028 # positive multiple of @align, of @opt-write-zero, and of
3029 # the underlying file's request alignment (but need not
3030 # be a power of 2), or 0 for default (since 2.10)
3032 # @opt-discard: preferred alignment for discard requests in bytes, must
3033 # be positive multiple of @align and of the underlying
3034 # file's request alignment (but need not be a power of
3035 # 2), or 0 for default (since 2.10)
3037 # @max-discard: maximum size for discard requests in bytes, must be
3038 # positive multiple of @align, of @opt-discard, and of
3039 # the underlying file's request alignment (but need not
3040 # be a power of 2), or 0 for default (since 2.10)
3042 # @inject-error: array of error injection descriptions
3044 # @set-state: array of state-change descriptions
3048 { 'struct': 'BlockdevOptionsBlkdebug',
3049 'data': { 'image': 'BlockdevRef',
3051 '*align': 'int', '*max-transfer': 'int32',
3052 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3053 '*opt-discard': 'int32', '*max-discard': 'int32',
3054 '*inject-error': ['BlkdebugInjectErrorOptions'],
3055 '*set-state': ['BlkdebugSetStateOptions'] } }
3058 # @BlockdevOptionsBlklogwrites:
3060 # Driver specific block device options for blklogwrites.
3062 # @file: block device
3064 # @log: block device used to log writes to @file
3066 # @log-sector-size: sector size used in logging writes to @file, determines
3067 # granularity of offsets and sizes of writes (default: 512)
3069 # @log-append: append to an existing log (default: false)
3071 # @log-super-update-interval: interval of write requests after which the log
3072 # super block is updated to disk (default: 4096)
3076 { 'struct': 'BlockdevOptionsBlklogwrites',
3077 'data': { 'file': 'BlockdevRef',
3078 'log': 'BlockdevRef',
3079 '*log-sector-size': 'uint32',
3080 '*log-append': 'bool',
3081 '*log-super-update-interval': 'uint64' } }
3084 # @BlockdevOptionsBlkverify:
3086 # Driver specific block device options for blkverify.
3088 # @test: block device to be tested
3090 # @raw: raw image used for verification
3094 { 'struct': 'BlockdevOptionsBlkverify',
3095 'data': { 'test': 'BlockdevRef',
3096 'raw': 'BlockdevRef' } }
3099 # @QuorumReadPattern:
3101 # An enumeration of quorum read patterns.
3103 # @quorum: read all the children and do a quorum vote on reads
3105 # @fifo: read only from the first child that has not failed
3109 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3112 # @BlockdevOptionsQuorum:
3114 # Driver specific block device options for Quorum
3116 # @blkverify: true if the driver must print content mismatch
3117 # set to false by default
3119 # @children: the children block devices to use
3121 # @vote-threshold: the vote limit under which a read will fail
3123 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3126 # @read-pattern: choose read pattern and set to quorum by default
3131 { 'struct': 'BlockdevOptionsQuorum',
3132 'data': { '*blkverify': 'bool',
3133 'children': [ 'BlockdevRef' ],
3134 'vote-threshold': 'int',
3135 '*rewrite-corrupted': 'bool',
3136 '*read-pattern': 'QuorumReadPattern' } }
3139 # @BlockdevOptionsGluster:
3141 # Driver specific block device options for Gluster
3143 # @volume: name of gluster volume where VM image resides
3145 # @path: absolute path to image file in gluster volume
3147 # @server: gluster servers description
3149 # @debug: libgfapi log level (default '4' which is Error)
3152 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3156 { 'struct': 'BlockdevOptionsGluster',
3157 'data': { 'volume': 'str',
3159 'server': ['SocketAddress'],
3161 '*logfile': 'str' } }
3166 # An enumeration of libiscsi transport types
3170 { 'enum': 'IscsiTransport',
3171 'data': [ 'tcp', 'iser' ] }
3174 # @IscsiHeaderDigest:
3176 # An enumeration of header digests supported by libiscsi
3180 { 'enum': 'IscsiHeaderDigest',
3181 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3182 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3185 # @BlockdevOptionsIscsi:
3187 # @transport: The iscsi transport type
3189 # @portal: The address of the iscsi portal
3191 # @target: The target iqn name
3193 # @lun: LUN to connect to. Defaults to 0.
3195 # @user: User name to log in with. If omitted, no CHAP
3196 # authentication is performed.
3198 # @password-secret: The ID of a QCryptoSecret object providing
3199 # the password for the login. This option is required if
3200 # @user is specified.
3202 # @initiator-name: The iqn name we want to identify to the target
3203 # as. If this option is not specified, an initiator name is
3204 # generated automatically.
3206 # @header-digest: The desired header digest. Defaults to
3209 # @timeout: Timeout in seconds after which a request will
3210 # timeout. 0 means no timeout and is the default.
3212 # Driver specific block device options for iscsi
3216 { 'struct': 'BlockdevOptionsIscsi',
3217 'data': { 'transport': 'IscsiTransport',
3222 '*password-secret': 'str',
3223 '*initiator-name': 'str',
3224 '*header-digest': 'IscsiHeaderDigest',
3225 '*timeout': 'int' } }
3233 { 'enum': 'RbdAuthMode',
3234 'data': [ 'cephx', 'none' ] }
3237 # @BlockdevOptionsRbd:
3239 # @pool: Ceph pool name.
3241 # @image: Image name in the Ceph pool.
3243 # @conf: path to Ceph configuration file. Values
3244 # in the configuration file will be overridden by
3245 # options specified via QAPI.
3247 # @snapshot: Ceph snapshot name.
3249 # @user: Ceph id name.
3251 # @auth-client-required: Acceptable authentication modes.
3252 # This maps to Ceph configuration option
3253 # "auth_client_required". (Since 3.0)
3255 # @key-secret: ID of a QCryptoSecret object providing a key
3256 # for cephx authentication.
3257 # This maps to Ceph configuration option
3258 # "key". (Since 3.0)
3260 # @server: Monitor host address and port. This maps
3261 # to the "mon_host" Ceph option.
3265 { 'struct': 'BlockdevOptionsRbd',
3266 'data': { 'pool': 'str',
3271 '*auth-client-required': ['RbdAuthMode'],
3272 '*key-secret': 'str',
3273 '*server': ['InetSocketAddressBase'] } }
3276 # @BlockdevOptionsSheepdog:
3278 # Driver specific block device options for sheepdog
3280 # @vdi: Virtual disk image name
3281 # @server: The Sheepdog server to connect to
3282 # @snap-id: Snapshot ID
3283 # @tag: Snapshot tag name
3285 # Only one of @snap-id and @tag may be present.
3289 { 'struct': 'BlockdevOptionsSheepdog',
3290 'data': { 'server': 'SocketAddress',
3292 '*snap-id': 'uint32',
3298 # An enumeration of replication modes.
3300 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3302 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3306 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
3309 # @BlockdevOptionsReplication:
3311 # Driver specific block device options for replication
3313 # @mode: the replication mode
3315 # @top-id: In secondary mode, node name or device ID of the root
3316 # node who owns the replication node chain. Must not be given in
3321 { 'struct': 'BlockdevOptionsReplication',
3322 'base': 'BlockdevOptionsGenericFormat',
3323 'data': { 'mode': 'ReplicationMode',
3324 '*top-id': 'str' } }
3329 # An enumeration of NFS transport types
3331 # @inet: TCP transport
3335 { 'enum': 'NFSTransport',
3336 'data': [ 'inet' ] }
3341 # Captures the address of the socket
3343 # @type: transport type used for NFS (only TCP supported)
3345 # @host: host address for NFS server
3349 { 'struct': 'NFSServer',
3350 'data': { 'type': 'NFSTransport',
3354 # @BlockdevOptionsNfs:
3356 # Driver specific block device option for NFS
3358 # @server: host address
3360 # @path: path of the image on the host
3362 # @user: UID value to use when talking to the
3363 # server (defaults to 65534 on Windows and getuid()
3366 # @group: GID value to use when talking to the
3367 # server (defaults to 65534 on Windows and getgid()
3370 # @tcp-syn-count: number of SYNs during the session
3371 # establishment (defaults to libnfs default)
3373 # @readahead-size: set the readahead size in bytes (defaults
3374 # to libnfs default)
3376 # @page-cache-size: set the pagecache size in bytes (defaults
3377 # to libnfs default)
3379 # @debug: set the NFS debug level (max 2) (defaults
3380 # to libnfs default)
3384 { 'struct': 'BlockdevOptionsNfs',
3385 'data': { 'server': 'NFSServer',
3389 '*tcp-syn-count': 'int',
3390 '*readahead-size': 'int',
3391 '*page-cache-size': 'int',
3395 # @BlockdevOptionsCurlBase:
3397 # Driver specific block device options shared by all protocols supported by the
3400 # @url: URL of the image file
3402 # @readahead: Size of the read-ahead cache; must be a multiple of
3403 # 512 (defaults to 256 kB)
3405 # @timeout: Timeout for connections, in seconds (defaults to 5)
3407 # @username: Username for authentication (defaults to none)
3409 # @password-secret: ID of a QCryptoSecret object providing a password
3410 # for authentication (defaults to no password)
3412 # @proxy-username: Username for proxy authentication (defaults to none)
3414 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3415 # for proxy authentication (defaults to no password)
3419 { 'struct': 'BlockdevOptionsCurlBase',
3420 'data': { 'url': 'str',
3421 '*readahead': 'int',
3424 '*password-secret': 'str',
3425 '*proxy-username': 'str',
3426 '*proxy-password-secret': 'str' } }
3429 # @BlockdevOptionsCurlHttp:
3431 # Driver specific block device options for HTTP connections over the curl
3432 # backend. URLs must start with "http://".
3434 # @cookie: List of cookies to set; format is
3435 # "name1=content1; name2=content2;" as explained by
3436 # CURLOPT_COOKIE(3). Defaults to no cookies.
3438 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3439 # secure way. See @cookie for the format. (since 2.10)
3443 { 'struct': 'BlockdevOptionsCurlHttp',
3444 'base': 'BlockdevOptionsCurlBase',
3445 'data': { '*cookie': 'str',
3446 '*cookie-secret': 'str'} }
3449 # @BlockdevOptionsCurlHttps:
3451 # Driver specific block device options for HTTPS connections over the curl
3452 # backend. URLs must start with "https://".
3454 # @cookie: List of cookies to set; format is
3455 # "name1=content1; name2=content2;" as explained by
3456 # CURLOPT_COOKIE(3). Defaults to no cookies.
3458 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3461 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3462 # secure way. See @cookie for the format. (since 2.10)
3466 { 'struct': 'BlockdevOptionsCurlHttps',
3467 'base': 'BlockdevOptionsCurlBase',
3468 'data': { '*cookie': 'str',
3469 '*sslverify': 'bool',
3470 '*cookie-secret': 'str'} }
3473 # @BlockdevOptionsCurlFtp:
3475 # Driver specific block device options for FTP connections over the curl
3476 # backend. URLs must start with "ftp://".
3480 { 'struct': 'BlockdevOptionsCurlFtp',
3481 'base': 'BlockdevOptionsCurlBase',
3485 # @BlockdevOptionsCurlFtps:
3487 # Driver specific block device options for FTPS connections over the curl
3488 # backend. URLs must start with "ftps://".
3490 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3495 { 'struct': 'BlockdevOptionsCurlFtps',
3496 'base': 'BlockdevOptionsCurlBase',
3497 'data': { '*sslverify': 'bool' } }
3500 # @BlockdevOptionsNbd:
3502 # Driver specific block device options for NBD.
3504 # @server: NBD server address
3506 # @export: export name
3508 # @tls-creds: TLS credentials ID
3510 # @x-dirty-bitmap: A "qemu:dirty-bitmap:NAME" string to query in place of
3511 # traditional "base:allocation" block status (see
3512 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol) (since 3.0)
3516 { 'struct': 'BlockdevOptionsNbd',
3517 'data': { 'server': 'SocketAddress',
3519 '*tls-creds': 'str',
3520 '*x-dirty-bitmap': 'str' } }
3523 # @BlockdevOptionsRaw:
3525 # Driver specific block device options for the raw driver.
3527 # @offset: position where the block device starts
3528 # @size: the assumed size of the device
3532 { 'struct': 'BlockdevOptionsRaw',
3533 'base': 'BlockdevOptionsGenericFormat',
3534 'data': { '*offset': 'int', '*size': 'int' } }
3537 # @BlockdevOptionsVxHS:
3539 # Driver specific block device options for VxHS
3541 # @vdisk-id: UUID of VxHS volume
3542 # @server: vxhs server IP, port
3543 # @tls-creds: TLS credentials ID
3547 { 'struct': 'BlockdevOptionsVxHS',
3548 'data': { 'vdisk-id': 'str',
3549 'server': 'InetSocketAddressBase',
3550 '*tls-creds': 'str' } }
3553 # @BlockdevOptionsThrottle:
3555 # Driver specific block device options for the throttle driver
3557 # @throttle-group: the name of the throttle-group object to use. It
3558 # must already exist.
3559 # @file: reference to or definition of the data source block device
3562 { 'struct': 'BlockdevOptionsThrottle',
3563 'data': { 'throttle-group': 'str',
3564 'file' : 'BlockdevRef'
3569 # Options for creating a block device. Many options are available for all
3570 # block devices, independent of the block driver:
3572 # @driver: block driver name
3573 # @node-name: the node name of the new node (Since 2.0).
3574 # This option is required on the top level of blockdev-add.
3575 # @discard: discard-related options (default: ignore)
3576 # @cache: cache-related options
3577 # @read-only: whether the block device should be read-only (default: false).
3578 # Note that some block drivers support only read-only access,
3579 # either generally or in certain configurations. In this case,
3580 # the default value does not work and the option must be
3581 # specified explicitly.
3582 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3584 # @force-share: force share all permission on added nodes.
3585 # Requires read-only=true. (Since 2.10)
3587 # Remaining options are determined by the block driver.
3591 { 'union': 'BlockdevOptions',
3592 'base': { 'driver': 'BlockdevDriver',
3593 '*node-name': 'str',
3594 '*discard': 'BlockdevDiscardOptions',
3595 '*cache': 'BlockdevCacheOptions',
3596 '*read-only': 'bool',
3597 '*force-share': 'bool',
3598 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3599 'discriminator': 'driver',
3601 'blkdebug': 'BlockdevOptionsBlkdebug',
3602 'blklogwrites':'BlockdevOptionsBlklogwrites',
3603 'blkverify': 'BlockdevOptionsBlkverify',
3604 'bochs': 'BlockdevOptionsGenericFormat',
3605 'cloop': 'BlockdevOptionsGenericFormat',
3606 'copy-on-read':'BlockdevOptionsGenericFormat',
3607 'dmg': 'BlockdevOptionsGenericFormat',
3608 'file': 'BlockdevOptionsFile',
3609 'ftp': 'BlockdevOptionsCurlFtp',
3610 'ftps': 'BlockdevOptionsCurlFtps',
3611 'gluster': 'BlockdevOptionsGluster',
3612 'host_cdrom': 'BlockdevOptionsFile',
3613 'host_device':'BlockdevOptionsFile',
3614 'http': 'BlockdevOptionsCurlHttp',
3615 'https': 'BlockdevOptionsCurlHttps',
3616 'iscsi': 'BlockdevOptionsIscsi',
3617 'luks': 'BlockdevOptionsLUKS',
3618 'nbd': 'BlockdevOptionsNbd',
3619 'nfs': 'BlockdevOptionsNfs',
3620 'null-aio': 'BlockdevOptionsNull',
3621 'null-co': 'BlockdevOptionsNull',
3622 'nvme': 'BlockdevOptionsNVMe',
3623 'parallels': 'BlockdevOptionsGenericFormat',
3624 'qcow2': 'BlockdevOptionsQcow2',
3625 'qcow': 'BlockdevOptionsQcow',
3626 'qed': 'BlockdevOptionsGenericCOWFormat',
3627 'quorum': 'BlockdevOptionsQuorum',
3628 'raw': 'BlockdevOptionsRaw',
3629 'rbd': 'BlockdevOptionsRbd',
3630 'replication':'BlockdevOptionsReplication',
3631 'sheepdog': 'BlockdevOptionsSheepdog',
3632 'ssh': 'BlockdevOptionsSsh',
3633 'throttle': 'BlockdevOptionsThrottle',
3634 'vdi': 'BlockdevOptionsGenericFormat',
3635 'vhdx': 'BlockdevOptionsGenericFormat',
3636 'vmdk': 'BlockdevOptionsGenericCOWFormat',
3637 'vpc': 'BlockdevOptionsGenericFormat',
3638 'vvfat': 'BlockdevOptionsVVFAT',
3639 'vxhs': 'BlockdevOptionsVxHS'
3645 # Reference to a block device.
3647 # @definition: defines a new block device inline
3648 # @reference: references the ID of an existing block device
3652 { 'alternate': 'BlockdevRef',
3653 'data': { 'definition': 'BlockdevOptions',
3654 'reference': 'str' } }
3657 # @BlockdevRefOrNull:
3659 # Reference to a block device.
3661 # @definition: defines a new block device inline
3662 # @reference: references the ID of an existing block device.
3663 # An empty string means that no block device should
3664 # be referenced. Deprecated; use null instead.
3665 # @null: No block device should be referenced (since 2.10)
3669 { 'alternate': 'BlockdevRefOrNull',
3670 'data': { 'definition': 'BlockdevOptions',
3677 # Creates a new block device. If the @id option is given at the top level, a
3678 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
3679 # level and no BlockBackend will be created.
3686 # -> { "execute": "blockdev-add",
3688 # "driver": "qcow2",
3689 # "node-name": "test1",
3692 # "filename": "test.qcow2"
3696 # <- { "return": {} }
3699 # -> { "execute": "blockdev-add",
3701 # "driver": "qcow2",
3702 # "node-name": "node0",
3703 # "discard": "unmap",
3709 # "filename": "/tmp/test.qcow2"
3715 # "filename": "/dev/fdset/4"
3721 # <- { "return": {} }
3724 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
3729 # Deletes a block device that has been added using blockdev-add.
3730 # The command will fail if the node is attached to a device or is
3731 # otherwise being used.
3733 # @node-name: Name of the graph node to delete.
3739 # -> { "execute": "blockdev-add",
3741 # "driver": "qcow2",
3742 # "node-name": "node0",
3745 # "filename": "test.qcow2"
3749 # <- { "return": {} }
3751 # -> { "execute": "blockdev-del",
3752 # "arguments": { "node-name": "node0" }
3754 # <- { "return": {} }
3757 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
3760 # @BlockdevCreateOptionsFile:
3762 # Driver specific image creation options for file.
3764 # @filename Filename for the new image file
3765 # @size Size of the virtual disk in bytes
3766 # @preallocation Preallocation mode for the new image (default: off)
3767 # @nocow Turn off copy-on-write (valid only on btrfs; default: off)
3771 { 'struct': 'BlockdevCreateOptionsFile',
3772 'data': { 'filename': 'str',
3774 '*preallocation': 'PreallocMode',
3775 '*nocow': 'bool' } }
3778 # @BlockdevCreateOptionsGluster:
3780 # Driver specific image creation options for gluster.
3782 # @location Where to store the new image file
3783 # @size Size of the virtual disk in bytes
3784 # @preallocation Preallocation mode for the new image (default: off)
3788 { 'struct': 'BlockdevCreateOptionsGluster',
3789 'data': { 'location': 'BlockdevOptionsGluster',
3791 '*preallocation': 'PreallocMode' } }
3794 # @BlockdevCreateOptionsLUKS:
3796 # Driver specific image creation options for LUKS.
3798 # @file Node to create the image format on
3799 # @size Size of the virtual disk in bytes
3803 { 'struct': 'BlockdevCreateOptionsLUKS',
3804 'base': 'QCryptoBlockCreateOptionsLUKS',
3805 'data': { 'file': 'BlockdevRef',
3809 # @BlockdevCreateOptionsNfs:
3811 # Driver specific image creation options for NFS.
3813 # @location Where to store the new image file
3814 # @size Size of the virtual disk in bytes
3818 { 'struct': 'BlockdevCreateOptionsNfs',
3819 'data': { 'location': 'BlockdevOptionsNfs',
3823 # @BlockdevCreateOptionsParallels:
3825 # Driver specific image creation options for parallels.
3827 # @file Node to create the image format on
3828 # @size Size of the virtual disk in bytes
3829 # @cluster-size Cluster size in bytes (default: 1 MB)
3833 { 'struct': 'BlockdevCreateOptionsParallels',
3834 'data': { 'file': 'BlockdevRef',
3836 '*cluster-size': 'size' } }
3839 # @BlockdevCreateOptionsQcow:
3841 # Driver specific image creation options for qcow.
3843 # @file Node to create the image format on
3844 # @size Size of the virtual disk in bytes
3845 # @backing-file File name of the backing file if a backing file
3847 # @encrypt Encryption options if the image should be encrypted
3851 { 'struct': 'BlockdevCreateOptionsQcow',
3852 'data': { 'file': 'BlockdevRef',
3854 '*backing-file': 'str',
3855 '*encrypt': 'QCryptoBlockCreateOptions' } }
3858 # @BlockdevQcow2Version:
3860 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
3861 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
3865 { 'enum': 'BlockdevQcow2Version',
3866 'data': [ 'v2', 'v3' ] }
3870 # @BlockdevCreateOptionsQcow2:
3872 # Driver specific image creation options for qcow2.
3874 # @file Node to create the image format on
3875 # @size Size of the virtual disk in bytes
3876 # @version Compatibility level (default: v3)
3877 # @backing-file File name of the backing file if a backing file
3879 # @backing-fmt Name of the block driver to use for the backing file
3880 # @encrypt Encryption options if the image should be encrypted
3881 # @cluster-size qcow2 cluster size in bytes (default: 65536)
3882 # @preallocation Preallocation mode for the new image (default: off)
3883 # @lazy-refcounts True if refcounts may be updated lazily (default: off)
3884 # @refcount-bits Width of reference counts in bits (default: 16)
3888 { 'struct': 'BlockdevCreateOptionsQcow2',
3889 'data': { 'file': 'BlockdevRef',
3891 '*version': 'BlockdevQcow2Version',
3892 '*backing-file': 'str',
3893 '*backing-fmt': 'BlockdevDriver',
3894 '*encrypt': 'QCryptoBlockCreateOptions',
3895 '*cluster-size': 'size',
3896 '*preallocation': 'PreallocMode',
3897 '*lazy-refcounts': 'bool',
3898 '*refcount-bits': 'int' } }
3901 # @BlockdevCreateOptionsQed:
3903 # Driver specific image creation options for qed.
3905 # @file Node to create the image format on
3906 # @size Size of the virtual disk in bytes
3907 # @backing-file File name of the backing file if a backing file
3909 # @backing-fmt Name of the block driver to use for the backing file
3910 # @cluster-size Cluster size in bytes (default: 65536)
3911 # @table-size L1/L2 table size (in clusters)
3915 { 'struct': 'BlockdevCreateOptionsQed',
3916 'data': { 'file': 'BlockdevRef',
3918 '*backing-file': 'str',
3919 '*backing-fmt': 'BlockdevDriver',
3920 '*cluster-size': 'size',
3921 '*table-size': 'int' } }
3924 # @BlockdevCreateOptionsRbd:
3926 # Driver specific image creation options for rbd/Ceph.
3928 # @location Where to store the new image file. This location cannot
3929 # point to a snapshot.
3930 # @size Size of the virtual disk in bytes
3931 # @cluster-size RBD object size
3935 { 'struct': 'BlockdevCreateOptionsRbd',
3936 'data': { 'location': 'BlockdevOptionsRbd',
3938 '*cluster-size' : 'size' } }
3941 # @SheepdogRedundancyType:
3943 # @full Create a fully replicated vdi with x copies
3944 # @erasure-coded Create an erasure coded vdi with x data strips and
3949 { 'enum': 'SheepdogRedundancyType',
3950 'data': [ 'full', 'erasure-coded' ] }
3953 # @SheepdogRedundancyFull:
3955 # @copies Number of copies to use (between 1 and 31)
3959 { 'struct': 'SheepdogRedundancyFull',
3960 'data': { 'copies': 'int' }}
3963 # @SheepdogRedundancyErasureCoded:
3965 # @data-strips Number of data strips to use (one of {2,4,8,16})
3966 # @parity-strips Number of parity strips to use (between 1 and 15)
3970 { 'struct': 'SheepdogRedundancyErasureCoded',
3971 'data': { 'data-strips': 'int',
3972 'parity-strips': 'int' }}
3975 # @SheepdogRedundancy:
3979 { 'union': 'SheepdogRedundancy',
3980 'base': { 'type': 'SheepdogRedundancyType' },
3981 'discriminator': 'type',
3982 'data': { 'full': 'SheepdogRedundancyFull',
3983 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
3986 # @BlockdevCreateOptionsSheepdog:
3988 # Driver specific image creation options for Sheepdog.
3990 # @location Where to store the new image file
3991 # @size Size of the virtual disk in bytes
3992 # @backing-file File name of a base image
3993 # @preallocation Preallocation mode (allowed values: off, full)
3994 # @redundancy Redundancy of the image
3995 # @object-size Object size of the image
3999 { 'struct': 'BlockdevCreateOptionsSheepdog',
4000 'data': { 'location': 'BlockdevOptionsSheepdog',
4002 '*backing-file': 'str',
4003 '*preallocation': 'PreallocMode',
4004 '*redundancy': 'SheepdogRedundancy',
4005 '*object-size': 'size' } }
4008 # @BlockdevCreateOptionsSsh:
4010 # Driver specific image creation options for SSH.
4012 # @location Where to store the new image file
4013 # @size Size of the virtual disk in bytes
4017 { 'struct': 'BlockdevCreateOptionsSsh',
4018 'data': { 'location': 'BlockdevOptionsSsh',
4022 # @BlockdevCreateOptionsVdi:
4024 # Driver specific image creation options for VDI.
4026 # @file Node to create the image format on
4027 # @size Size of the virtual disk in bytes
4028 # @preallocation Preallocation mode for the new image (allowed values: off,
4029 # metadata; default: off)
4033 { 'struct': 'BlockdevCreateOptionsVdi',
4034 'data': { 'file': 'BlockdevRef',
4036 '*preallocation': 'PreallocMode' } }
4039 # @BlockdevVhdxSubformat:
4041 # @dynamic: Growing image file
4042 # @fixed: Preallocated fixed-size image file
4046 { 'enum': 'BlockdevVhdxSubformat',
4047 'data': [ 'dynamic', 'fixed' ] }
4050 # @BlockdevCreateOptionsVhdx:
4052 # Driver specific image creation options for vhdx.
4054 # @file Node to create the image format on
4055 # @size Size of the virtual disk in bytes
4056 # @log-size Log size in bytes, must be a multiple of 1 MB
4058 # @block-size Block size in bytes, must be a multiple of 1 MB and not
4059 # larger than 256 MB (default: automatically choose a block
4060 # size depending on the image size)
4061 # @subformat vhdx subformat (default: dynamic)
4062 # @block-state-zero Force use of payload blocks of type 'ZERO'. Non-standard,
4063 # but default. Do not set to 'off' when using 'qemu-img
4064 # convert' with subformat=dynamic.
4068 { 'struct': 'BlockdevCreateOptionsVhdx',
4069 'data': { 'file': 'BlockdevRef',
4071 '*log-size': 'size',
4072 '*block-size': 'size',
4073 '*subformat': 'BlockdevVhdxSubformat',
4074 '*block-state-zero': 'bool' } }
4077 # @BlockdevVpcSubformat:
4079 # @dynamic: Growing image file
4080 # @fixed: Preallocated fixed-size image file
4084 { 'enum': 'BlockdevVpcSubformat',
4085 'data': [ 'dynamic', 'fixed' ] }
4088 # @BlockdevCreateOptionsVpc:
4090 # Driver specific image creation options for vpc (VHD).
4092 # @file Node to create the image format on
4093 # @size Size of the virtual disk in bytes
4094 # @subformat vhdx subformat (default: dynamic)
4095 # @force-size Force use of the exact byte size instead of rounding to the
4096 # next size that can be represented in CHS geometry
4101 { 'struct': 'BlockdevCreateOptionsVpc',
4102 'data': { 'file': 'BlockdevRef',
4104 '*subformat': 'BlockdevVpcSubformat',
4105 '*force-size': 'bool' } }
4108 # @BlockdevCreateOptions:
4110 # Options for creating an image format on a given node.
4112 # @driver block driver to create the image format
4116 { 'union': 'BlockdevCreateOptions',
4118 'driver': 'BlockdevDriver' },
4119 'discriminator': 'driver',
4121 'file': 'BlockdevCreateOptionsFile',
4122 'gluster': 'BlockdevCreateOptionsGluster',
4123 'luks': 'BlockdevCreateOptionsLUKS',
4124 'nfs': 'BlockdevCreateOptionsNfs',
4125 'parallels': 'BlockdevCreateOptionsParallels',
4126 'qcow': 'BlockdevCreateOptionsQcow',
4127 'qcow2': 'BlockdevCreateOptionsQcow2',
4128 'qed': 'BlockdevCreateOptionsQed',
4129 'rbd': 'BlockdevCreateOptionsRbd',
4130 'sheepdog': 'BlockdevCreateOptionsSheepdog',
4131 'ssh': 'BlockdevCreateOptionsSsh',
4132 'vdi': 'BlockdevCreateOptionsVdi',
4133 'vhdx': 'BlockdevCreateOptionsVhdx',
4134 'vpc': 'BlockdevCreateOptionsVpc'
4140 # Starts a job to create an image format on a given node. The job is
4141 # automatically finalized, but a manual job-dismiss is required.
4143 # @job-id: Identifier for the newly created job.
4145 # @options: Options for the image creation.
4149 { 'command': 'blockdev-create',
4150 'data': { 'job-id': 'str',
4151 'options': 'BlockdevCreateOptions' } }
4154 # @blockdev-open-tray:
4156 # Opens a block device's tray. If there is a block driver state tree inserted as
4157 # a medium, it will become inaccessible to the guest (but it will remain
4158 # associated to the block device, so closing the tray will make it accessible
4161 # If the tray was already open before, this will be a no-op.
4163 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4164 # which no such event will be generated, these include:
4165 # - if the guest has locked the tray, @force is false and the guest does not
4166 # respond to the eject request
4167 # - if the BlockBackend denoted by @device does not have a guest device attached
4169 # - if the guest device does not have an actual tray
4171 # @device: Block device name (deprecated, use @id instead)
4173 # @id: The name or QOM path of the guest device (since: 2.8)
4175 # @force: if false (the default), an eject request will be sent to
4176 # the guest if it has locked the tray (and the tray will not be opened
4177 # immediately); if true, the tray will be opened regardless of whether
4184 # -> { "execute": "blockdev-open-tray",
4185 # "arguments": { "id": "ide0-1-0" } }
4187 # <- { "timestamp": { "seconds": 1418751016,
4188 # "microseconds": 716996 },
4189 # "event": "DEVICE_TRAY_MOVED",
4190 # "data": { "device": "ide1-cd0",
4192 # "tray-open": true } }
4194 # <- { "return": {} }
4197 { 'command': 'blockdev-open-tray',
4198 'data': { '*device': 'str',
4200 '*force': 'bool' } }
4203 # @blockdev-close-tray:
4205 # Closes a block device's tray. If there is a block driver state tree associated
4206 # with the block device (which is currently ejected), that tree will be loaded
4209 # If the tray was already closed before, this will be a no-op.
4211 # @device: Block device name (deprecated, use @id instead)
4213 # @id: The name or QOM path of the guest device (since: 2.8)
4219 # -> { "execute": "blockdev-close-tray",
4220 # "arguments": { "id": "ide0-1-0" } }
4222 # <- { "timestamp": { "seconds": 1418751345,
4223 # "microseconds": 272147 },
4224 # "event": "DEVICE_TRAY_MOVED",
4225 # "data": { "device": "ide1-cd0",
4227 # "tray-open": false } }
4229 # <- { "return": {} }
4232 { 'command': 'blockdev-close-tray',
4233 'data': { '*device': 'str',
4237 # @blockdev-remove-medium:
4239 # Removes a medium (a block driver state tree) from a block device. That block
4240 # device's tray must currently be open (unless there is no attached guest
4243 # If the tray is open and there is no medium inserted, this will be a no-op.
4245 # @id: The name or QOM path of the guest device
4251 # -> { "execute": "blockdev-remove-medium",
4252 # "arguments": { "id": "ide0-1-0" } }
4254 # <- { "error": { "class": "GenericError",
4255 # "desc": "Tray of device 'ide0-1-0' is not open" } }
4257 # -> { "execute": "blockdev-open-tray",
4258 # "arguments": { "id": "ide0-1-0" } }
4260 # <- { "timestamp": { "seconds": 1418751627,
4261 # "microseconds": 549958 },
4262 # "event": "DEVICE_TRAY_MOVED",
4263 # "data": { "device": "ide1-cd0",
4265 # "tray-open": true } }
4267 # <- { "return": {} }
4269 # -> { "execute": "blockdev-remove-medium",
4270 # "arguments": { "id": "ide0-1-0" } }
4272 # <- { "return": {} }
4275 { 'command': 'blockdev-remove-medium',
4276 'data': { 'id': 'str' } }
4279 # @blockdev-insert-medium:
4281 # Inserts a medium (a block driver state tree) into a block device. That block
4282 # device's tray must currently be open (unless there is no attached guest
4283 # device) and there must be no medium inserted already.
4285 # @id: The name or QOM path of the guest device
4287 # @node-name: name of a node in the block driver state graph
4293 # -> { "execute": "blockdev-add",
4295 # "node-name": "node0",
4297 # "file": { "driver": "file",
4298 # "filename": "fedora.iso" } } }
4299 # <- { "return": {} }
4301 # -> { "execute": "blockdev-insert-medium",
4302 # "arguments": { "id": "ide0-1-0",
4303 # "node-name": "node0" } }
4305 # <- { "return": {} }
4308 { 'command': 'blockdev-insert-medium',
4309 'data': { 'id': 'str',
4310 'node-name': 'str'} }
4314 # @BlockdevChangeReadOnlyMode:
4316 # Specifies the new read-only mode of a block device subject to the
4317 # @blockdev-change-medium command.
4319 # @retain: Retains the current read-only mode
4321 # @read-only: Makes the device read-only
4323 # @read-write: Makes the device writable
4328 { 'enum': 'BlockdevChangeReadOnlyMode',
4329 'data': ['retain', 'read-only', 'read-write'] }
4333 # @blockdev-change-medium:
4335 # Changes the medium inserted into a block device by ejecting the current medium
4336 # and loading a new image file which is inserted as the new medium (this command
4337 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
4338 # and blockdev-close-tray).
4340 # @device: Block device name (deprecated, use @id instead)
4342 # @id: The name or QOM path of the guest device
4345 # @filename: filename of the new image to be loaded
4347 # @format: format to open the new image with (defaults to
4348 # the probed format)
4350 # @read-only-mode: change the read-only mode of the device; defaults
4357 # 1. Change a removable medium
4359 # -> { "execute": "blockdev-change-medium",
4360 # "arguments": { "id": "ide0-1-0",
4361 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4362 # "format": "raw" } }
4363 # <- { "return": {} }
4365 # 2. Load a read-only medium into a writable drive
4367 # -> { "execute": "blockdev-change-medium",
4368 # "arguments": { "id": "floppyA",
4369 # "filename": "/srv/images/ro.img",
4371 # "read-only-mode": "retain" } }
4374 # { "class": "GenericError",
4375 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4377 # -> { "execute": "blockdev-change-medium",
4378 # "arguments": { "id": "floppyA",
4379 # "filename": "/srv/images/ro.img",
4381 # "read-only-mode": "read-only" } }
4383 # <- { "return": {} }
4386 { 'command': 'blockdev-change-medium',
4387 'data': { '*device': 'str',
4391 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
4395 # @BlockErrorAction:
4397 # An enumeration of action that has been taken when a DISK I/O occurs
4399 # @ignore: error has been ignored
4401 # @report: error has been reported to the device
4403 # @stop: error caused VM to be stopped
4407 { 'enum': 'BlockErrorAction',
4408 'data': [ 'ignore', 'report', 'stop' ] }
4412 # @BLOCK_IMAGE_CORRUPTED:
4414 # Emitted when a disk image is being marked corrupt. The image can be
4415 # identified by its device or node name. The 'device' field is always
4416 # present for compatibility reasons, but it can be empty ("") if the
4417 # image does not have a device name associated.
4419 # @device: device name. This is always present for compatibility
4420 # reasons, but it can be empty ("") if the image does not
4421 # have a device name associated.
4423 # @node-name: node name (Since: 2.4)
4425 # @msg: informative message for human consumption, such as the kind of
4426 # corruption being detected. It should not be parsed by machine as it is
4427 # not guaranteed to be stable
4429 # @offset: if the corruption resulted from an image access, this is
4430 # the host's access offset into the image
4432 # @size: if the corruption resulted from an image access, this is
4435 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4436 # event and must be repaired (Since 2.2; before, every
4437 # BLOCK_IMAGE_CORRUPTED event was fatal)
4439 # Note: If action is "stop", a STOP event will eventually follow the
4440 # BLOCK_IO_ERROR event.
4444 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4445 # "data": { "device": "ide0-hd0", "node-name": "node0",
4446 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4448 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4452 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4453 'data': { 'device' : 'str',
4454 '*node-name' : 'str',
4458 'fatal' : 'bool' } }
4463 # Emitted when a disk I/O error occurs
4465 # @device: device name. This is always present for compatibility
4466 # reasons, but it can be empty ("") if the image does not
4467 # have a device name associated.
4469 # @node-name: node name. Note that errors may be reported for the root node
4470 # that is directly attached to a guest device rather than for the
4471 # node where the error occurred. The node name is not present if
4472 # the drive is empty. (Since: 2.8)
4474 # @operation: I/O operation
4476 # @action: action that has been taken
4478 # @nospace: true if I/O error was caused due to a no-space
4479 # condition. This key is only present if query-block's
4480 # io-status is present, please see query-block documentation
4481 # for more information (since: 2.2)
4483 # @reason: human readable string describing the error cause.
4484 # (This field is a debugging aid for humans, it should not
4485 # be parsed by applications) (since: 2.2)
4487 # Note: If action is "stop", a STOP event will eventually follow the
4488 # BLOCK_IO_ERROR event
4494 # <- { "event": "BLOCK_IO_ERROR",
4495 # "data": { "device": "ide0-hd1",
4496 # "node-name": "#block212",
4497 # "operation": "write",
4498 # "action": "stop" },
4499 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4502 { 'event': 'BLOCK_IO_ERROR',
4503 'data': { 'device': 'str', '*node-name': 'str',
4504 'operation': 'IoOperationType',
4505 'action': 'BlockErrorAction', '*nospace': 'bool',
4509 # @BLOCK_JOB_COMPLETED:
4511 # Emitted when a block job has completed
4515 # @device: The job identifier. Originally the device name but other
4516 # values are allowed since QEMU 2.7
4518 # @len: maximum progress value
4520 # @offset: current progress value. On success this is equal to len.
4521 # On failure this is less than len
4523 # @speed: rate limit, bytes per second
4525 # @error: error message. Only present on failure. This field
4526 # contains a human-readable error message. There are no semantics
4527 # other than that streaming has failed and clients should not try to
4528 # interpret the error string
4534 # <- { "event": "BLOCK_JOB_COMPLETED",
4535 # "data": { "type": "stream", "device": "virtio-disk0",
4536 # "len": 10737418240, "offset": 10737418240,
4538 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4541 { 'event': 'BLOCK_JOB_COMPLETED',
4542 'data': { 'type' : 'JobType',
4550 # @BLOCK_JOB_CANCELLED:
4552 # Emitted when a block job has been cancelled
4556 # @device: The job identifier. Originally the device name but other
4557 # values are allowed since QEMU 2.7
4559 # @len: maximum progress value
4561 # @offset: current progress value. On success this is equal to len.
4562 # On failure this is less than len
4564 # @speed: rate limit, bytes per second
4570 # <- { "event": "BLOCK_JOB_CANCELLED",
4571 # "data": { "type": "stream", "device": "virtio-disk0",
4572 # "len": 10737418240, "offset": 134217728,
4574 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4577 { 'event': 'BLOCK_JOB_CANCELLED',
4578 'data': { 'type' : 'JobType',
4587 # Emitted when a block job encounters an error
4589 # @device: The job identifier. Originally the device name but other
4590 # values are allowed since QEMU 2.7
4592 # @operation: I/O operation
4594 # @action: action that has been taken
4600 # <- { "event": "BLOCK_JOB_ERROR",
4601 # "data": { "device": "ide0-hd1",
4602 # "operation": "write",
4603 # "action": "stop" },
4604 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4607 { 'event': 'BLOCK_JOB_ERROR',
4608 'data': { 'device' : 'str',
4609 'operation': 'IoOperationType',
4610 'action' : 'BlockErrorAction' } }
4615 # Emitted when a block job is ready to complete
4619 # @device: The job identifier. Originally the device name but other
4620 # values are allowed since QEMU 2.7
4622 # @len: maximum progress value
4624 # @offset: current progress value. On success this is equal to len.
4625 # On failure this is less than len
4627 # @speed: rate limit, bytes per second
4629 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
4636 # <- { "event": "BLOCK_JOB_READY",
4637 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
4638 # "len": 2097152, "offset": 2097152 }
4639 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4642 { 'event': 'BLOCK_JOB_READY',
4643 'data': { 'type' : 'JobType',
4650 # @BLOCK_JOB_PENDING:
4652 # Emitted when a block job is awaiting explicit authorization to finalize graph
4653 # changes via @block-job-finalize. If this job is part of a transaction, it will
4654 # not emit this event until the transaction has converged first.
4658 # @id: The job identifier.
4664 # <- { "event": "BLOCK_JOB_WAITING",
4665 # "data": { "device": "drive0", "type": "mirror" },
4666 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4669 { 'event': 'BLOCK_JOB_PENDING',
4670 'data': { 'type' : 'JobType',
4676 # Preallocation mode of QEMU image file
4678 # @off: no preallocation
4679 # @metadata: preallocate only for metadata
4680 # @falloc: like @full preallocation but allocate disk space by
4681 # posix_fallocate() rather than writing zeros.
4682 # @full: preallocate all data by writing zeros to device to ensure disk
4683 # space is really available. @full preallocation also sets up
4684 # metadata correctly.
4688 { 'enum': 'PreallocMode',
4689 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
4692 # @BLOCK_WRITE_THRESHOLD:
4694 # Emitted when writes on block device reaches or exceeds the
4695 # configured write threshold. For thin-provisioned devices, this
4696 # means the device should be extended to avoid pausing for
4698 # The event is one shot. Once triggered, it needs to be
4699 # re-registered with another block-set-write-threshold command.
4701 # @node-name: graph node name on which the threshold was exceeded.
4703 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
4705 # @write-threshold: last configured threshold, in bytes.
4709 { 'event': 'BLOCK_WRITE_THRESHOLD',
4710 'data': { 'node-name': 'str',
4711 'amount-exceeded': 'uint64',
4712 'write-threshold': 'uint64' } }
4715 # @block-set-write-threshold:
4717 # Change the write threshold for a block drive. An event will be
4718 # delivered if a write to this block drive crosses the configured
4719 # threshold. The threshold is an offset, thus must be
4720 # non-negative. Default is no write threshold. Setting the threshold
4721 # to zero disables it.
4723 # This is useful to transparently resize thin-provisioned drives without
4724 # the guest OS noticing.
4726 # @node-name: graph node name on which the threshold must be set.
4728 # @write-threshold: configured threshold for the block device, bytes.
4729 # Use 0 to disable the threshold.
4735 # -> { "execute": "block-set-write-threshold",
4736 # "arguments": { "node-name": "mydev",
4737 # "write-threshold": 17179869184 } }
4738 # <- { "return": {} }
4741 { 'command': 'block-set-write-threshold',
4742 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
4745 # @x-blockdev-change:
4747 # Dynamically reconfigure the block driver state graph. It can be used
4748 # to add, remove, insert or replace a graph node. Currently only the
4749 # Quorum driver implements this feature to add or remove its child. This
4750 # is useful to fix a broken quorum child.
4752 # If @node is specified, it will be inserted under @parent. @child
4753 # may not be specified in this case. If both @parent and @child are
4754 # specified but @node is not, @child will be detached from @parent.
4756 # @parent: the id or name of the parent node.
4758 # @child: the name of a child under the given parent node.
4760 # @node: the name of the node that will be added.
4762 # Note: this command is experimental, and its API is not stable. It
4763 # does not support all kinds of operations, all kinds of children, nor
4764 # all block drivers.
4766 # FIXME Removing children from a quorum node means introducing gaps in the
4767 # child indices. This cannot be represented in the 'children' list of
4768 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
4770 # Warning: The data in a new quorum child MUST be consistent with that of
4771 # the rest of the array.
4777 # 1. Add a new node to a quorum
4778 # -> { "execute": "blockdev-add",
4781 # "node-name": "new_node",
4782 # "file": { "driver": "file",
4783 # "filename": "test.raw" } } }
4784 # <- { "return": {} }
4785 # -> { "execute": "x-blockdev-change",
4786 # "arguments": { "parent": "disk1",
4787 # "node": "new_node" } }
4788 # <- { "return": {} }
4790 # 2. Delete a quorum's node
4791 # -> { "execute": "x-blockdev-change",
4792 # "arguments": { "parent": "disk1",
4793 # "child": "children.1" } }
4794 # <- { "return": {} }
4797 { 'command': 'x-blockdev-change',
4798 'data' : { 'parent': 'str',
4803 # @x-blockdev-set-iothread:
4805 # Move @node and its children into the @iothread. If @iothread is null then
4806 # move @node and its children into the main loop.
4808 # The node must not be attached to a BlockBackend.
4810 # @node-name: the name of the block driver node
4812 # @iothread: the name of the IOThread object or null for the main loop
4814 # @force: true if the node and its children should be moved when a BlockBackend
4815 # is already attached
4817 # Note: this command is experimental and intended for test cases that need
4818 # control over IOThreads only.
4824 # 1. Move a node into an IOThread
4825 # -> { "execute": "x-blockdev-set-iothread",
4826 # "arguments": { "node-name": "disk1",
4827 # "iothread": "iothread0" } }
4828 # <- { "return": {} }
4830 # 2. Move a node into the main loop
4831 # -> { "execute": "x-blockdev-set-iothread",
4832 # "arguments": { "node-name": "disk1",
4833 # "iothread": null } }
4834 # <- { "return": {} }
4837 { 'command': 'x-blockdev-set-iothread',
4838 'data' : { 'node-name': 'str',
4839 'iothread': 'StrOrNull',
4840 '*force': 'bool' } }