4 # == Block core (VM unrelated)
7 { 'include': 'common.json' }
8 { 'include': 'crypto.json' }
9 { 'include': 'sockets.json' }
14 # @id: unique snapshot id
16 # @name: user chosen name
18 # @vm-state-size: size of the VM state
20 # @date-sec: UTC date of the snapshot in seconds
22 # @date-nsec: fractional part in nano seconds to be used with date-sec
24 # @vm-clock-sec: VM clock relative to boot in seconds
26 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
31 { 'struct': 'SnapshotInfo',
32 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
33 'date-sec': 'int', 'date-nsec': 'int',
34 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
37 # @ImageInfoSpecificQCow2EncryptionBase:
39 # @format: The encryption format
43 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
44 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
47 # @ImageInfoSpecificQCow2Encryption:
51 { 'union': 'ImageInfoSpecificQCow2Encryption',
52 'base': 'ImageInfoSpecificQCow2EncryptionBase',
53 'discriminator': 'format',
54 'data': { 'aes': 'QCryptoBlockInfoQCow',
55 'luks': 'QCryptoBlockInfoLUKS' } }
58 # @ImageInfoSpecificQCow2:
60 # @compat: compatibility level
62 # @lazy-refcounts: on or off; only valid for compat >= 1.1
64 # @corrupt: true if the image has been marked corrupt; only valid for
65 # compat >= 1.1 (since 2.2)
67 # @refcount-bits: width of a refcount entry in bits (since 2.3)
69 # @encrypt: details about encryption parameters; only set if image
70 # is encrypted (since 2.10)
74 { 'struct': 'ImageInfoSpecificQCow2',
77 '*lazy-refcounts': 'bool',
79 'refcount-bits': 'int',
80 '*encrypt': 'ImageInfoSpecificQCow2Encryption'
84 # @ImageInfoSpecificVmdk:
86 # @create-type: The create type of VMDK image
88 # @cid: Content id of image
90 # @parent-cid: Parent VMDK image's cid
92 # @extents: List of extent files
96 { 'struct': 'ImageInfoSpecificVmdk',
101 'extents': ['ImageInfo']
105 # @ImageInfoSpecific:
107 # A discriminated record of image format specific information structures.
111 { 'union': 'ImageInfoSpecific',
113 'qcow2': 'ImageInfoSpecificQCow2',
114 'vmdk': 'ImageInfoSpecificVmdk',
115 # If we need to add block driver specific parameters for
116 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
117 # to define a ImageInfoSpecificLUKS
118 'luks': 'QCryptoBlockInfoLUKS'
124 # Information about a QEMU image file
126 # @filename: name of the image file
128 # @format: format of the image file
130 # @virtual-size: maximum capacity in bytes of the image
132 # @actual-size: actual size on disk in bytes of the image
134 # @dirty-flag: true if image is not cleanly closed
136 # @cluster-size: size of a cluster in bytes
138 # @encrypted: true if the image is encrypted
140 # @compressed: true if the image is compressed (Since 1.7)
142 # @backing-filename: name of the backing file
144 # @full-backing-filename: full path of the backing file
146 # @backing-filename-format: the format of the backing file
148 # @snapshots: list of VM snapshots
150 # @backing-image: info of the backing image (since 1.6)
152 # @format-specific: structure supplying additional format-specific
153 # information (since 1.7)
158 { 'struct': 'ImageInfo',
159 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
160 '*actual-size': 'int', 'virtual-size': 'int',
161 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
162 '*backing-filename': 'str', '*full-backing-filename': 'str',
163 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
164 '*backing-image': 'ImageInfo',
165 '*format-specific': 'ImageInfoSpecific' } }
170 # Information about a QEMU image file check
172 # @filename: name of the image file checked
174 # @format: format of the image file checked
176 # @check-errors: number of unexpected errors occurred during check
178 # @image-end-offset: offset (in bytes) where the image ends, this
179 # field is present if the driver for the image format
182 # @corruptions: number of corruptions found during the check if any
184 # @leaks: number of leaks found during the check if any
186 # @corruptions-fixed: number of corruptions fixed during the check
189 # @leaks-fixed: number of leaks fixed during the check if any
191 # @total-clusters: total number of clusters, this field is present
192 # if the driver for the image format supports it
194 # @allocated-clusters: total number of allocated clusters, this
195 # field is present if the driver for the image format
198 # @fragmented-clusters: total number of fragmented clusters, this
199 # field is present if the driver for the image format
202 # @compressed-clusters: total number of compressed clusters, this
203 # field is present if the driver for the image format
209 { 'struct': 'ImageCheck',
210 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
211 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
212 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
213 '*total-clusters': 'int', '*allocated-clusters': 'int',
214 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
219 # Mapping information from a virtual block range to a host file range
221 # @start: the start byte of the mapped virtual range
223 # @length: the number of bytes of the mapped virtual range
225 # @data: whether the mapped range has data
227 # @zero: whether the virtual blocks are zeroed
229 # @depth: the depth of the mapping
231 # @offset: the offset in file that the virtual sectors are mapped to
233 # @filename: filename that is referred to by @offset
238 { 'struct': 'MapEntry',
239 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
240 'zero': 'bool', 'depth': 'int', '*offset': 'int',
241 '*filename': 'str' } }
244 # @BlockdevCacheInfo:
246 # Cache mode information for a block device
248 # @writeback: true if writeback mode is enabled
249 # @direct: true if the host page cache is bypassed (O_DIRECT)
250 # @no-flush: true if flush requests are ignored for the device
254 { 'struct': 'BlockdevCacheInfo',
255 'data': { 'writeback': 'bool',
257 'no-flush': 'bool' } }
262 # Information about the backing device for a block device.
264 # @file: the filename of the backing device
266 # @node-name: the name of the block driver node (Since 2.0)
268 # @ro: true if the backing device was open read-only
270 # @drv: the name of the block format used to open the backing device. As of
271 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
272 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
273 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
274 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
275 # 2.2: 'archipelago' added, 'cow' dropped
276 # 2.3: 'host_floppy' deprecated
277 # 2.5: 'host_floppy' dropped
279 # 2.8: 'replication' added, 'tftp' dropped
280 # 2.9: 'archipelago' dropped
282 # @backing_file: the name of the backing file (for copy-on-write)
284 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
286 # @encrypted: true if the backing device is encrypted
288 # @encryption_key_missing: Deprecated; always false
290 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
292 # @bps: total throughput limit in bytes per second is specified
294 # @bps_rd: read throughput limit in bytes per second is specified
296 # @bps_wr: write throughput limit in bytes per second is specified
298 # @iops: total I/O operations per second is specified
300 # @iops_rd: read I/O operations per second is specified
302 # @iops_wr: write I/O operations per second is specified
304 # @image: the info of image used (since: 1.6)
306 # @bps_max: total throughput limit during bursts,
307 # in bytes (Since 1.7)
309 # @bps_rd_max: read throughput limit during bursts,
310 # in bytes (Since 1.7)
312 # @bps_wr_max: write throughput limit during bursts,
313 # in bytes (Since 1.7)
315 # @iops_max: total I/O operations per second during bursts,
316 # in bytes (Since 1.7)
318 # @iops_rd_max: read I/O operations per second during bursts,
319 # in bytes (Since 1.7)
321 # @iops_wr_max: write I/O operations per second during bursts,
322 # in bytes (Since 1.7)
324 # @bps_max_length: maximum length of the @bps_max burst
325 # period, in seconds. (Since 2.6)
327 # @bps_rd_max_length: maximum length of the @bps_rd_max
328 # burst period, in seconds. (Since 2.6)
330 # @bps_wr_max_length: maximum length of the @bps_wr_max
331 # burst period, in seconds. (Since 2.6)
333 # @iops_max_length: maximum length of the @iops burst
334 # period, in seconds. (Since 2.6)
336 # @iops_rd_max_length: maximum length of the @iops_rd_max
337 # burst period, in seconds. (Since 2.6)
339 # @iops_wr_max_length: maximum length of the @iops_wr_max
340 # burst period, in seconds. (Since 2.6)
342 # @iops_size: an I/O size in bytes (Since 1.7)
344 # @group: throttle group name (Since 2.4)
346 # @cache: the cache mode used for the block device (since: 2.3)
348 # @write_threshold: configured write threshold for the device.
349 # 0 if disabled. (Since 2.3)
354 { 'struct': 'BlockDeviceInfo',
355 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
356 '*backing_file': 'str', 'backing_file_depth': 'int',
357 'encrypted': 'bool', 'encryption_key_missing': 'bool',
358 'detect_zeroes': 'BlockdevDetectZeroesOptions',
359 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
360 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
361 'image': 'ImageInfo',
362 '*bps_max': 'int', '*bps_rd_max': 'int',
363 '*bps_wr_max': 'int', '*iops_max': 'int',
364 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
365 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
366 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
367 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
368 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
369 'write_threshold': 'int' } }
372 # @BlockDeviceIoStatus:
374 # An enumeration of block device I/O status.
376 # @ok: The last I/O operation has succeeded
378 # @failed: The last I/O operation has failed
380 # @nospace: The last I/O operation has failed due to a no-space condition
384 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
387 # @BlockDeviceMapEntry:
389 # Entry in the metadata map of the device (returned by "qemu-img map")
391 # @start: Offset in the image of the first byte described by this entry
394 # @length: Length of the range described by this entry (in bytes)
396 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
397 # before reaching one for which the range is allocated. The value is
398 # in the range 0 to the depth of the image chain - 1.
400 # @zero: the sectors in this range read as zeros
402 # @data: reading the image will actually read data from a file (in particular,
403 # if @offset is present this means that the sectors are not simply
404 # preallocated, but contain actual data in raw format)
406 # @offset: if present, the image file stores the data for this range in
407 # raw format at the given offset.
411 { 'struct': 'BlockDeviceMapEntry',
412 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
413 'data': 'bool', '*offset': 'int' } }
416 # @DirtyBitmapStatus:
418 # An enumeration of possible states that a dirty bitmap can report to the user.
420 # @frozen: The bitmap is currently in-use by a backup operation or block job,
423 # @disabled: The bitmap is currently in-use by an internal operation and is
424 # read-only. It can still be deleted.
426 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
427 # deleted, or used for backup operations.
429 # @locked: The bitmap is currently in-use by some operation and can not be
430 # cleared, deleted, or used for backup operations. (Since 2.12)
434 { 'enum': 'DirtyBitmapStatus',
435 'data': ['active', 'disabled', 'frozen', 'locked'] }
440 # Block dirty bitmap information.
442 # @name: the name of the dirty bitmap (Since 2.4)
444 # @count: number of dirty bytes according to the dirty bitmap
446 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
448 # @status: current status of the dirty bitmap (since 2.4)
452 { 'struct': 'BlockDirtyInfo',
453 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
454 'status': 'DirtyBitmapStatus'} }
459 # Block device information. This structure describes a virtual device and
460 # the backing device associated with it.
462 # @device: The device name associated with the virtual device.
464 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
465 # device. (since 2.10)
467 # @type: This field is returned only for compatibility reasons, it should
468 # not be used (always returns 'unknown')
470 # @removable: True if the device supports removable media.
472 # @locked: True if the guest has locked this device from having its media
475 # @tray_open: True if the device's tray is open
476 # (only present if it has a tray)
478 # @dirty-bitmaps: dirty bitmaps information (only present if the
479 # driver has one or more dirty bitmaps) (Since 2.0)
481 # @io-status: @BlockDeviceIoStatus. Only present if the device
482 # supports it and the VM is configured to stop on errors
483 # (supported device models: virtio-blk, IDE, SCSI except
486 # @inserted: @BlockDeviceInfo describing the device if media is
491 { 'struct': 'BlockInfo',
492 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
493 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
494 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
495 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
500 # Image file size calculation information. This structure describes the size
501 # requirements for creating a new image file.
503 # The size requirements depend on the new image file format. File size always
504 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
505 # Compact formats such as 'qcow2' represent unallocated and zero regions
506 # efficiently so file size may be smaller than virtual disk size.
508 # The values are upper bounds that are guaranteed to fit the new image file.
509 # Subsequent modification, such as internal snapshot or bitmap creation, may
510 # require additional space and is not covered here.
512 # @required: Size required for a new image file, in bytes.
514 # @fully-allocated: Image file size, in bytes, once data has been written
519 { 'struct': 'BlockMeasureInfo',
520 'data': {'required': 'int', 'fully-allocated': 'int'} }
525 # Get a list of BlockInfo for all virtual block devices.
527 # Returns: a list of @BlockInfo describing each virtual block device. Filter
528 # nodes that were created implicitly are skipped over.
534 # -> { "execute": "query-block" }
539 # "device":"ide0-hd0",
546 # "file":"disks/test.qcow2",
547 # "backing_file_depth":1,
554 # "bps_max": 8000000,
561 # "detect_zeroes": "on",
562 # "write_threshold": 0,
564 # "filename":"disks/test.qcow2",
566 # "virtual-size":2048000,
567 # "backing_file":"base.qcow2",
568 # "full-backing-filename":"disks/base.qcow2",
569 # "backing-filename-format":"qcow2",
573 # "name": "snapshot1",
574 # "vm-state-size": 0,
575 # "date-sec": 10000200,
577 # "vm-clock-sec": 206,
578 # "vm-clock-nsec": 30
582 # "filename":"disks/base.qcow2",
584 # "virtual-size":2048000
588 # "qdev": "ide_disk",
593 # "device":"ide1-cd0",
596 # "qdev": "/machine/unattached/device[23]",
597 # "tray_open": false,
601 # "device":"floppy0",
604 # "qdev": "/machine/unattached/device[20]",
617 { 'command': 'query-block', 'returns': ['BlockInfo'] }
621 # @BlockDeviceTimedStats:
623 # Statistics of a block device during a given interval of time.
625 # @interval_length: Interval used for calculating the statistics,
628 # @min_rd_latency_ns: Minimum latency of read operations in the
629 # defined interval, in nanoseconds.
631 # @min_wr_latency_ns: Minimum latency of write operations in the
632 # defined interval, in nanoseconds.
634 # @min_flush_latency_ns: Minimum latency of flush operations in the
635 # defined interval, in nanoseconds.
637 # @max_rd_latency_ns: Maximum latency of read operations in the
638 # defined interval, in nanoseconds.
640 # @max_wr_latency_ns: Maximum latency of write operations in the
641 # defined interval, in nanoseconds.
643 # @max_flush_latency_ns: Maximum latency of flush operations in the
644 # defined interval, in nanoseconds.
646 # @avg_rd_latency_ns: Average latency of read operations in the
647 # defined interval, in nanoseconds.
649 # @avg_wr_latency_ns: Average latency of write operations in the
650 # defined interval, in nanoseconds.
652 # @avg_flush_latency_ns: Average latency of flush operations in the
653 # defined interval, in nanoseconds.
655 # @avg_rd_queue_depth: Average number of pending read operations
656 # in the defined interval.
658 # @avg_wr_queue_depth: Average number of pending write operations
659 # in the defined interval.
663 { 'struct': 'BlockDeviceTimedStats',
664 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
665 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
666 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
667 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
668 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
669 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
674 # Statistics of a virtual block device or a block backing device.
676 # @rd_bytes: The number of bytes read by the device.
678 # @wr_bytes: The number of bytes written by the device.
680 # @rd_operations: The number of read operations performed by the device.
682 # @wr_operations: The number of write operations performed by the device.
684 # @flush_operations: The number of cache flush operations performed by the
685 # device (since 0.15.0)
687 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
690 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
692 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
694 # @wr_highest_offset: The offset after the greatest byte written to the
695 # device. The intended use of this information is for
696 # growable sparse files (like qcow2) that are used on top
697 # of a physical device.
699 # @rd_merged: Number of read requests that have been merged into another
700 # request (Since 2.3).
702 # @wr_merged: Number of write requests that have been merged into another
703 # request (Since 2.3).
705 # @idle_time_ns: Time since the last I/O operation, in
706 # nanoseconds. If the field is absent it means that
707 # there haven't been any operations yet (Since 2.5).
709 # @failed_rd_operations: The number of failed read operations
710 # performed by the device (Since 2.5)
712 # @failed_wr_operations: The number of failed write operations
713 # performed by the device (Since 2.5)
715 # @failed_flush_operations: The number of failed flush operations
716 # performed by the device (Since 2.5)
718 # @invalid_rd_operations: The number of invalid read operations
719 # performed by the device (Since 2.5)
721 # @invalid_wr_operations: The number of invalid write operations
722 # performed by the device (Since 2.5)
724 # @invalid_flush_operations: The number of invalid flush operations
725 # performed by the device (Since 2.5)
727 # @account_invalid: Whether invalid operations are included in the
728 # last access statistics (Since 2.5)
730 # @account_failed: Whether failed operations are included in the
731 # latency and last access statistics (Since 2.5)
733 # @timed_stats: Statistics specific to the set of previously defined
734 # intervals of time (Since 2.5)
738 { 'struct': 'BlockDeviceStats',
739 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
740 'wr_operations': 'int', 'flush_operations': 'int',
741 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
742 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
743 'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
744 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
745 'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
746 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
747 'account_invalid': 'bool', 'account_failed': 'bool',
748 'timed_stats': ['BlockDeviceTimedStats'] } }
753 # Statistics of a virtual block device or a block backing device.
755 # @device: If the stats are for a virtual block device, the name
756 # corresponding to the virtual block device.
758 # @node-name: The node name of the device. (Since 2.3)
760 # @stats: A @BlockDeviceStats for the device.
762 # @parent: This describes the file block device if it has one.
763 # Contains recursively the statistics of the underlying
764 # protocol (e.g. the host file for a qcow2 image). If there is
765 # no underlying protocol, this field is omitted
767 # @backing: This describes the backing block device if it has one.
772 { 'struct': 'BlockStats',
773 'data': {'*device': 'str', '*node-name': 'str',
774 'stats': 'BlockDeviceStats',
775 '*parent': 'BlockStats',
776 '*backing': 'BlockStats'} }
781 # Query the @BlockStats for all virtual block devices.
783 # @query-nodes: If true, the command will query all the block nodes
784 # that have a node name, in a list which will include "parent"
785 # information, but not "backing".
786 # If false or omitted, the behavior is as before - query all the
787 # device backends, recursively including their "parent" and
788 # "backing". Filter nodes that were created implicitly are
789 # skipped over in this mode. (Since 2.3)
791 # Returns: A list of @BlockStats for each virtual block devices.
797 # -> { "execute": "query-blockstats" }
801 # "device":"ide0-hd0",
804 # "wr_highest_offset":3686448128,
805 # "wr_bytes":9786368,
806 # "wr_operations":751,
807 # "rd_bytes":122567168,
808 # "rd_operations":36772
809 # "wr_total_times_ns":313253456
810 # "rd_total_times_ns":3465673657
811 # "flush_total_times_ns":49653
812 # "flush_operations":61,
815 # "idle_time_ns":2953431879,
816 # "account_invalid":true,
817 # "account_failed":false
821 # "wr_highest_offset":2821110784,
822 # "wr_bytes":9786368,
823 # "wr_operations":692,
824 # "rd_bytes":122739200,
825 # "rd_operations":36604
826 # "flush_operations":51,
827 # "wr_total_times_ns":313253456
828 # "rd_total_times_ns":3465673657
829 # "flush_total_times_ns":49653,
832 # "idle_time_ns":2953431879,
833 # "account_invalid":true,
834 # "account_failed":false
838 # "device":"ide1-cd0",
840 # "wr_highest_offset":0,
845 # "flush_operations":0,
846 # "wr_total_times_ns":0
847 # "rd_total_times_ns":0
848 # "flush_total_times_ns":0,
851 # "account_invalid":false,
852 # "account_failed":false
856 # "device":"floppy0",
858 # "wr_highest_offset":0,
863 # "flush_operations":0,
864 # "wr_total_times_ns":0
865 # "rd_total_times_ns":0
866 # "flush_total_times_ns":0,
869 # "account_invalid":false,
870 # "account_failed":false
876 # "wr_highest_offset":0,
881 # "flush_operations":0,
882 # "wr_total_times_ns":0
883 # "rd_total_times_ns":0
884 # "flush_total_times_ns":0,
887 # "account_invalid":false,
888 # "account_failed":false
895 { 'command': 'query-blockstats',
896 'data': { '*query-nodes': 'bool' },
897 'returns': ['BlockStats'] }
902 # An enumeration of possible behaviors for errors on I/O operations.
903 # The exact meaning depends on whether the I/O was initiated by a guest
906 # @report: for guest operations, report the error to the guest;
907 # for jobs, cancel the job
909 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
910 # or BLOCK_JOB_ERROR)
912 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
914 # @stop: for guest operations, stop the virtual machine;
915 # for jobs, pause the job
917 # @auto: inherit the error handling policy of the backend (since: 2.7)
921 { 'enum': 'BlockdevOnError',
922 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
927 # An enumeration of possible behaviors for the initial synchronization
928 # phase of storage mirroring.
930 # @top: copies data in the topmost image to the destination
932 # @full: copies data from all images to the destination
934 # @none: only copy data written from now on
936 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
940 { 'enum': 'MirrorSyncMode',
941 'data': ['top', 'full', 'none', 'incremental'] }
946 # Type of a block job.
948 # @commit: block commit job type, see "block-commit"
950 # @stream: block stream job type, see "block-stream"
952 # @mirror: drive mirror job type, see "drive-mirror"
954 # @backup: drive backup job type, see "drive-backup"
958 { 'enum': 'BlockJobType',
959 'data': ['commit', 'stream', 'mirror', 'backup'] }
964 # Represents command verbs that can be applied to a blockjob.
966 # @cancel: see @block-job-cancel
968 # @pause: see @block-job-pause
970 # @resume: see @block-job-resume
972 # @set-speed: see @block-job-set-speed
974 # @complete: see @block-job-complete
976 # @dismiss: see @block-job-dismiss
980 { 'enum': 'BlockJobVerb',
981 'data': ['cancel', 'pause', 'resume', 'set-speed', 'complete', 'dismiss' ] }
986 # Indicates the present state of a given blockjob in its lifetime.
988 # @undefined: Erroneous, default state. Should not ever be visible.
990 # @created: The job has been created, but not yet started.
992 # @running: The job is currently running.
994 # @paused: The job is running, but paused. The pause may be requested by
995 # either the QMP user or by internal processes.
997 # @ready: The job is running, but is ready for the user to signal completion.
998 # This is used for long-running jobs like mirror that are designed to
1001 # @standby: The job is ready, but paused. This is nearly identical to @paused.
1002 # The job may return to @ready or otherwise be canceled.
1004 # @waiting: The job is waiting for other jobs in the transaction to converge
1005 # to the waiting state. This status will likely not be visible for
1006 # the last job in a transaction.
1008 # @pending: The job has finished its work, but has finalization steps that it
1009 # needs to make prior to completing. These changes may require
1010 # manual intervention by the management process if manual was set
1011 # to true. These changes may still fail.
1013 # @aborting: The job is in the process of being aborted, and will finish with
1014 # an error. The job will afterwards report that it is @concluded.
1015 # This status may not be visible to the management process.
1017 # @concluded: The job has finished all work. If manual was set to true, the job
1018 # will remain in the query list until it is dismissed.
1020 # @null: The job is in the process of being dismantled. This state should not
1021 # ever be visible externally.
1025 { 'enum': 'BlockJobStatus',
1026 'data': ['undefined', 'created', 'running', 'paused', 'ready', 'standby',
1027 'waiting', 'pending', 'aborting', 'concluded', 'null' ] }
1032 # Information about a long-running block device operation.
1034 # @type: the job type ('stream' for image streaming)
1036 # @device: The job identifier. Originally the device name but other
1037 # values are allowed since QEMU 2.7
1039 # @len: the maximum progress value
1041 # @busy: false if the job is known to be in a quiescent state, with
1042 # no pending I/O. Since 1.3.
1044 # @paused: whether the job is paused or, if @busy is true, will
1045 # pause itself as soon as possible. Since 1.3.
1047 # @offset: the current progress value
1049 # @speed: the rate limit, bytes per second
1051 # @io-status: the status of the job (since 1.3)
1053 # @ready: true if the job may be completed (since 2.2)
1055 # @status: Current job state/status (since 2.12)
1059 { 'struct': 'BlockJobInfo',
1060 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1061 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1062 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1063 'status': 'BlockJobStatus' } }
1066 # @query-block-jobs:
1068 # Return information about long-running block device operations.
1070 # Returns: a list of @BlockJobInfo for each active block job
1074 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1079 # This command sets the password of a block device that has not been open
1080 # with a password and requires one.
1082 # This command is now obsolete and will always return an error since 2.10
1085 { 'command': 'block_passwd', 'data': {'*device': 'str',
1086 '*node-name': 'str', 'password': 'str'} }
1091 # Resize a block image while a guest is running.
1093 # Either @device or @node-name must be set but not both.
1095 # @device: the name of the device to get the image resized
1097 # @node-name: graph node name to get the image resized (Since 2.0)
1099 # @size: new image size in bytes
1101 # Returns: nothing on success
1102 # If @device is not a valid block device, DeviceNotFound
1108 # -> { "execute": "block_resize",
1109 # "arguments": { "device": "scratch", "size": 1073741824 } }
1110 # <- { "return": {} }
1113 { 'command': 'block_resize', 'data': { '*device': 'str',
1114 '*node-name': 'str',
1120 # An enumeration that tells QEMU how to set the backing file path in
1123 # @existing: QEMU should look for an existing image file.
1125 # @absolute-paths: QEMU should create a new image with absolute paths
1126 # for the backing file. If there is no backing file available, the new
1127 # image will not be backed either.
1131 { 'enum': 'NewImageMode',
1132 'data': [ 'existing', 'absolute-paths' ] }
1135 # @BlockdevSnapshotSync:
1137 # Either @device or @node-name must be set but not both.
1139 # @device: the name of the device to generate the snapshot from.
1141 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1143 # @snapshot-file: the target of the new image. If the file exists, or
1144 # if it is a device, the snapshot will be created in the existing
1145 # file/device. Otherwise, a new file will be created.
1147 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1149 # @format: the format of the snapshot image, default is 'qcow2'.
1151 # @mode: whether and how QEMU should create a new image, default is
1154 { 'struct': 'BlockdevSnapshotSync',
1155 'data': { '*device': 'str', '*node-name': 'str',
1156 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1157 '*format': 'str', '*mode': 'NewImageMode' } }
1160 # @BlockdevSnapshot:
1162 # @node: device or node name that will have a snapshot created.
1164 # @overlay: reference to the existing block device that will become
1165 # the overlay of @node, as part of creating the snapshot.
1166 # It must not have a current backing file (this can be
1167 # achieved by passing "backing": "" to blockdev-add).
1171 { 'struct': 'BlockdevSnapshot',
1172 'data': { 'node': 'str', 'overlay': 'str' } }
1177 # @job-id: identifier for the newly-created block job. If
1178 # omitted, the device name will be used. (Since 2.7)
1180 # @device: the device name or node-name of a root node which should be copied.
1182 # @target: the target of the new image. If the file exists, or if it
1183 # is a device, the existing file/device will be used as the new
1184 # destination. If it does not exist, a new file will be created.
1186 # @format: the format of the new destination, default is to
1187 # probe if @mode is 'existing', else the format of the source
1189 # @sync: what parts of the disk image should be copied to the destination
1190 # (all the disk, only the sectors allocated in the topmost image, from a
1191 # dirty bitmap, or only new I/O).
1193 # @mode: whether and how QEMU should create a new image, default is
1196 # @speed: the maximum speed, in bytes per second
1198 # @bitmap: the name of dirty bitmap if sync is "incremental".
1199 # Must be present if sync is "incremental", must NOT be present
1200 # otherwise. (Since 2.4)
1202 # @compress: true to compress data, if the target format supports it.
1203 # (default: false) (since 2.8)
1205 # @on-source-error: the action to take on an error on the source,
1206 # default 'report'. 'stop' and 'enospc' can only be used
1207 # if the block device supports io-status (see BlockInfo).
1209 # @on-target-error: the action to take on an error on the target,
1210 # default 'report' (no limitations, since this applies to
1211 # a different block device than @device).
1213 # Note: @on-source-error and @on-target-error only affect background
1214 # I/O. If an error occurs during a guest write request, the device's
1215 # rerror/werror actions will be used.
1219 { 'struct': 'DriveBackup',
1220 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1221 '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1222 '*speed': 'int', '*bitmap': 'str', '*compress': 'bool',
1223 '*on-source-error': 'BlockdevOnError',
1224 '*on-target-error': 'BlockdevOnError' } }
1229 # @job-id: identifier for the newly-created block job. If
1230 # omitted, the device name will be used. (Since 2.7)
1232 # @device: the device name or node-name of a root node which should be copied.
1234 # @target: the device name or node-name of the backup target node.
1236 # @sync: what parts of the disk image should be copied to the destination
1237 # (all the disk, only the sectors allocated in the topmost image, or
1240 # @speed: the maximum speed, in bytes per second. The default is 0,
1243 # @compress: true to compress data, if the target format supports it.
1244 # (default: false) (since 2.8)
1246 # @on-source-error: the action to take on an error on the source,
1247 # default 'report'. 'stop' and 'enospc' can only be used
1248 # if the block device supports io-status (see BlockInfo).
1250 # @on-target-error: the action to take on an error on the target,
1251 # default 'report' (no limitations, since this applies to
1252 # a different block device than @device).
1254 # Note: @on-source-error and @on-target-error only affect background
1255 # I/O. If an error occurs during a guest write request, the device's
1256 # rerror/werror actions will be used.
1260 { 'struct': 'BlockdevBackup',
1261 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1262 'sync': 'MirrorSyncMode',
1264 '*compress': 'bool',
1265 '*on-source-error': 'BlockdevOnError',
1266 '*on-target-error': 'BlockdevOnError' } }
1269 # @blockdev-snapshot-sync:
1271 # Generates a synchronous snapshot of a block device.
1273 # For the arguments, see the documentation of BlockdevSnapshotSync.
1275 # Returns: nothing on success
1276 # If @device is not a valid block device, DeviceNotFound
1282 # -> { "execute": "blockdev-snapshot-sync",
1283 # "arguments": { "device": "ide-hd0",
1285 # "/some/place/my-image",
1286 # "format": "qcow2" } }
1287 # <- { "return": {} }
1290 { 'command': 'blockdev-snapshot-sync',
1291 'data': 'BlockdevSnapshotSync' }
1295 # @blockdev-snapshot:
1297 # Generates a snapshot of a block device.
1299 # Create a snapshot, by installing 'node' as the backing image of
1300 # 'overlay'. Additionally, if 'node' is associated with a block
1301 # device, the block device changes to using 'overlay' as its new active
1304 # For the arguments, see the documentation of BlockdevSnapshot.
1310 # -> { "execute": "blockdev-add",
1311 # "arguments": { "driver": "qcow2",
1312 # "node-name": "node1534",
1313 # "file": { "driver": "file",
1314 # "filename": "hd1.qcow2" },
1317 # <- { "return": {} }
1319 # -> { "execute": "blockdev-snapshot",
1320 # "arguments": { "node": "ide-hd0",
1321 # "overlay": "node1534" } }
1322 # <- { "return": {} }
1325 { 'command': 'blockdev-snapshot',
1326 'data': 'BlockdevSnapshot' }
1329 # @change-backing-file:
1331 # Change the backing file in the image file metadata. This does not
1332 # cause QEMU to reopen the image file to reparse the backing filename
1333 # (it may, however, perform a reopen to change permissions from
1334 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1335 # into the image file metadata, and the QEMU internal strings are
1338 # @image-node-name: The name of the block driver state node of the
1339 # image to modify. The "device" argument is used
1340 # to verify "image-node-name" is in the chain
1341 # described by "device".
1343 # @device: The device name or node-name of the root node that owns
1346 # @backing-file: The string to write as the backing file. This
1347 # string is not validated, so care should be taken
1348 # when specifying the string or the image chain may
1349 # not be able to be reopened again.
1351 # Returns: Nothing on success
1353 # If "device" does not exist or cannot be determined, DeviceNotFound
1357 { 'command': 'change-backing-file',
1358 'data': { 'device': 'str', 'image-node-name': 'str',
1359 'backing-file': 'str' } }
1364 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1365 # writes data between 'top' and 'base' into 'base'.
1367 # @job-id: identifier for the newly-created block job. If
1368 # omitted, the device name will be used. (Since 2.7)
1370 # @device: the device name or node-name of a root node
1372 # @base: The file name of the backing image to write data into.
1373 # If not specified, this is the deepest backing image.
1375 # @top: The file name of the backing image within the image chain,
1376 # which contains the topmost data to be committed down. If
1377 # not specified, this is the active layer.
1379 # @backing-file: The backing file string to write into the overlay
1380 # image of 'top'. If 'top' is the active layer,
1381 # specifying a backing file string is an error. This
1382 # filename is not validated.
1384 # If a pathname string is such that it cannot be
1385 # resolved by QEMU, that means that subsequent QMP or
1386 # HMP commands must use node-names for the image in
1387 # question, as filename lookup methods will fail.
1389 # If not specified, QEMU will automatically determine
1390 # the backing file string to use, or error out if
1391 # there is no obvious choice. Care should be taken
1392 # when specifying the string, to specify a valid
1393 # filename or protocol.
1396 # If top == base, that is an error.
1397 # If top == active, the job will not be completed by itself,
1398 # user needs to complete the job with the block-job-complete
1399 # command after getting the ready event. (Since 2.0)
1401 # If the base image is smaller than top, then the base image
1402 # will be resized to be the same size as top. If top is
1403 # smaller than the base image, the base will not be
1404 # truncated. If you want the base image size to match the
1405 # size of the smaller top, you can safely truncate it
1406 # yourself once the commit operation successfully completes.
1408 # @speed: the maximum speed, in bytes per second
1410 # @filter-node-name: the node name that should be assigned to the
1411 # filter driver that the commit job inserts into the graph
1412 # above @top. If this option is not given, a node name is
1413 # autogenerated. (Since: 2.9)
1415 # Returns: Nothing on success
1416 # If commit or stream is already active on this device, DeviceInUse
1417 # If @device does not exist, DeviceNotFound
1418 # If image commit is not supported by this device, NotSupported
1419 # If @base or @top is invalid, a generic error is returned
1420 # If @speed is invalid, InvalidParameter
1426 # -> { "execute": "block-commit",
1427 # "arguments": { "device": "virtio0",
1428 # "top": "/tmp/snap1.qcow2" } }
1429 # <- { "return": {} }
1432 { 'command': 'block-commit',
1433 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
1434 '*backing-file': 'str', '*speed': 'int',
1435 '*filter-node-name': 'str' } }
1440 # Start a point-in-time copy of a block device to a new destination. The
1441 # status of ongoing drive-backup operations can be checked with
1442 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1443 # The operation can be stopped before it has completed using the
1444 # block-job-cancel command.
1446 # Returns: nothing on success
1447 # If @device is not a valid block device, GenericError
1453 # -> { "execute": "drive-backup",
1454 # "arguments": { "device": "drive0",
1456 # "target": "backup.img" } }
1457 # <- { "return": {} }
1460 { 'command': 'drive-backup', 'boxed': true,
1461 'data': 'DriveBackup' }
1466 # Start a point-in-time copy of a block device to a new destination. The
1467 # status of ongoing blockdev-backup operations can be checked with
1468 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1469 # The operation can be stopped before it has completed using the
1470 # block-job-cancel command.
1472 # Returns: nothing on success
1473 # If @device is not a valid block device, DeviceNotFound
1478 # -> { "execute": "blockdev-backup",
1479 # "arguments": { "device": "src-id",
1481 # "target": "tgt-id" } }
1482 # <- { "return": {} }
1485 { 'command': 'blockdev-backup', 'boxed': true,
1486 'data': 'BlockdevBackup' }
1490 # @query-named-block-nodes:
1492 # Get the named block driver list
1494 # Returns: the list of BlockDeviceInfo
1500 # -> { "execute": "query-named-block-nodes" }
1501 # <- { "return": [ { "ro":false,
1503 # "encrypted":false,
1504 # "file":"disks/test.qcow2",
1505 # "node-name": "my-node",
1506 # "backing_file_depth":1,
1513 # "bps_max": 8000000,
1520 # "write_threshold": 0,
1522 # "filename":"disks/test.qcow2",
1524 # "virtual-size":2048000,
1525 # "backing_file":"base.qcow2",
1526 # "full-backing-filename":"disks/base.qcow2",
1527 # "backing-filename-format":"qcow2",
1531 # "name": "snapshot1",
1532 # "vm-state-size": 0,
1533 # "date-sec": 10000200,
1535 # "vm-clock-sec": 206,
1536 # "vm-clock-nsec": 30
1540 # "filename":"disks/base.qcow2",
1542 # "virtual-size":2048000
1547 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1552 # Start mirroring a block device's writes to a new destination. target
1553 # specifies the target of the new image. If the file exists, or if it
1554 # is a device, it will be used as the new destination for writes. If
1555 # it does not exist, a new file will be created. format specifies the
1556 # format of the mirror image, default is to probe if mode='existing',
1557 # else the format of the source.
1559 # Returns: nothing on success
1560 # If @device is not a valid block device, GenericError
1566 # -> { "execute": "drive-mirror",
1567 # "arguments": { "device": "ide-hd0",
1568 # "target": "/some/place/my-image",
1570 # "format": "qcow2" } }
1571 # <- { "return": {} }
1574 { 'command': 'drive-mirror', 'boxed': true,
1575 'data': 'DriveMirror' }
1580 # A set of parameters describing drive mirror setup.
1582 # @job-id: identifier for the newly-created block job. If
1583 # omitted, the device name will be used. (Since 2.7)
1585 # @device: the device name or node-name of a root node whose writes should be
1588 # @target: the target of the new image. If the file exists, or if it
1589 # is a device, the existing file/device will be used as the new
1590 # destination. If it does not exist, a new file will be created.
1592 # @format: the format of the new destination, default is to
1593 # probe if @mode is 'existing', else the format of the source
1595 # @node-name: the new block driver state node name in the graph
1598 # @replaces: with sync=full graph node name to be replaced by the new
1599 # image when a whole image copy is done. This can be used to repair
1600 # broken Quorum files. (Since 2.1)
1602 # @mode: whether and how QEMU should create a new image, default is
1605 # @speed: the maximum speed, in bytes per second
1607 # @sync: what parts of the disk image should be copied to the destination
1608 # (all the disk, only the sectors allocated in the topmost image, or
1611 # @granularity: granularity of the dirty bitmap, default is 64K
1612 # if the image format doesn't have clusters, 4K if the clusters
1613 # are smaller than that, else the cluster size. Must be a
1614 # power of 2 between 512 and 64M (since 1.4).
1616 # @buf-size: maximum amount of data in flight from source to
1617 # target (since 1.4).
1619 # @on-source-error: the action to take on an error on the source,
1620 # default 'report'. 'stop' and 'enospc' can only be used
1621 # if the block device supports io-status (see BlockInfo).
1623 # @on-target-error: the action to take on an error on the target,
1624 # default 'report' (no limitations, since this applies to
1625 # a different block device than @device).
1626 # @unmap: Whether to try to unmap target sectors where source has
1627 # only zero. If true, and target unallocated sectors will read as zero,
1628 # target image sectors will be unmapped; otherwise, zeroes will be
1629 # written. Both will result in identical contents.
1630 # Default is true. (Since 2.4)
1634 { 'struct': 'DriveMirror',
1635 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1636 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1637 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1638 '*speed': 'int', '*granularity': 'uint32',
1639 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1640 '*on-target-error': 'BlockdevOnError',
1641 '*unmap': 'bool' } }
1644 # @BlockDirtyBitmap:
1646 # @node: name of device/node which the bitmap is tracking
1648 # @name: name of the dirty bitmap
1652 { 'struct': 'BlockDirtyBitmap',
1653 'data': { 'node': 'str', 'name': 'str' } }
1656 # @BlockDirtyBitmapAdd:
1658 # @node: name of device/node which the bitmap is tracking
1660 # @name: name of the dirty bitmap
1662 # @granularity: the bitmap granularity, default is 64k for
1663 # block-dirty-bitmap-add
1665 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1666 # corresponding block device image file on its close. For now only
1667 # Qcow2 disks support persistent bitmaps. Default is false for
1668 # block-dirty-bitmap-add. (Since: 2.10)
1670 # @autoload: ignored and deprecated since 2.12.
1671 # Currently, all dirty tracking bitmaps are loaded from Qcow2 on
1676 { 'struct': 'BlockDirtyBitmapAdd',
1677 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1678 '*persistent': 'bool', '*autoload': 'bool' } }
1681 # @block-dirty-bitmap-add:
1683 # Create a dirty bitmap with a name on the node, and start tracking the writes.
1685 # Returns: nothing on success
1686 # If @node is not a valid block device or node, DeviceNotFound
1687 # If @name is already taken, GenericError with an explanation
1693 # -> { "execute": "block-dirty-bitmap-add",
1694 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1695 # <- { "return": {} }
1698 { 'command': 'block-dirty-bitmap-add',
1699 'data': 'BlockDirtyBitmapAdd' }
1702 # @block-dirty-bitmap-remove:
1704 # Stop write tracking and remove the dirty bitmap that was created
1705 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
1708 # Returns: nothing on success
1709 # If @node is not a valid block device or node, DeviceNotFound
1710 # If @name is not found, GenericError with an explanation
1711 # if @name is frozen by an operation, GenericError
1717 # -> { "execute": "block-dirty-bitmap-remove",
1718 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1719 # <- { "return": {} }
1722 { 'command': 'block-dirty-bitmap-remove',
1723 'data': 'BlockDirtyBitmap' }
1726 # @block-dirty-bitmap-clear:
1728 # Clear (reset) a dirty bitmap on the device, so that an incremental
1729 # backup from this point in time forward will only backup clusters
1730 # modified after this clear operation.
1732 # Returns: nothing on success
1733 # If @node is not a valid block device, DeviceNotFound
1734 # If @name is not found, GenericError with an explanation
1740 # -> { "execute": "block-dirty-bitmap-clear",
1741 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1742 # <- { "return": {} }
1745 { 'command': 'block-dirty-bitmap-clear',
1746 'data': 'BlockDirtyBitmap' }
1749 # @BlockDirtyBitmapSha256:
1751 # SHA256 hash of dirty bitmap data
1753 # @sha256: ASCII representation of SHA256 bitmap hash
1757 { 'struct': 'BlockDirtyBitmapSha256',
1758 'data': {'sha256': 'str'} }
1761 # @x-debug-block-dirty-bitmap-sha256:
1765 # Returns: BlockDirtyBitmapSha256 on success
1766 # If @node is not a valid block device, DeviceNotFound
1767 # If @name is not found or if hashing has failed, GenericError with an
1772 { 'command': 'x-debug-block-dirty-bitmap-sha256',
1773 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
1778 # Start mirroring a block device's writes to a new destination.
1780 # @job-id: identifier for the newly-created block job. If
1781 # omitted, the device name will be used. (Since 2.7)
1783 # @device: The device name or node-name of a root node whose writes should be
1786 # @target: the id or node-name of the block device to mirror to. This mustn't be
1787 # attached to guest.
1789 # @replaces: with sync=full graph node name to be replaced by the new
1790 # image when a whole image copy is done. This can be used to repair
1791 # broken Quorum files.
1793 # @speed: the maximum speed, in bytes per second
1795 # @sync: what parts of the disk image should be copied to the destination
1796 # (all the disk, only the sectors allocated in the topmost image, or
1799 # @granularity: granularity of the dirty bitmap, default is 64K
1800 # if the image format doesn't have clusters, 4K if the clusters
1801 # are smaller than that, else the cluster size. Must be a
1802 # power of 2 between 512 and 64M
1804 # @buf-size: maximum amount of data in flight from source to
1807 # @on-source-error: the action to take on an error on the source,
1808 # default 'report'. 'stop' and 'enospc' can only be used
1809 # if the block device supports io-status (see BlockInfo).
1811 # @on-target-error: the action to take on an error on the target,
1812 # default 'report' (no limitations, since this applies to
1813 # a different block device than @device).
1815 # @filter-node-name: the node name that should be assigned to the
1816 # filter driver that the mirror job inserts into the graph
1817 # above @device. If this option is not given, a node name is
1818 # autogenerated. (Since: 2.9)
1820 # Returns: nothing on success.
1826 # -> { "execute": "blockdev-mirror",
1827 # "arguments": { "device": "ide-hd0",
1828 # "target": "target0",
1829 # "sync": "full" } }
1830 # <- { "return": {} }
1833 { 'command': 'blockdev-mirror',
1834 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1836 'sync': 'MirrorSyncMode',
1837 '*speed': 'int', '*granularity': 'uint32',
1838 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1839 '*on-target-error': 'BlockdevOnError',
1840 '*filter-node-name': 'str' } }
1843 # @block_set_io_throttle:
1845 # Change I/O throttle limits for a block drive.
1847 # Since QEMU 2.4, each device with I/O limits is member of a throttle
1850 # If two or more devices are members of the same group, the limits
1851 # will apply to the combined I/O of the whole group in a round-robin
1852 # fashion. Therefore, setting new I/O limits to a device will affect
1855 # The name of the group can be specified using the 'group' parameter.
1856 # If the parameter is unset, it is assumed to be the current group of
1857 # that device. If it's not in any group yet, the name of the device
1858 # will be used as the name for its group.
1860 # The 'group' parameter can also be used to move a device to a
1861 # different group. In this case the limits specified in the parameters
1862 # will be applied to the new group only.
1864 # I/O limits can be disabled by setting all of them to 0. In this case
1865 # the device will be removed from its group and the rest of its
1866 # members will not be affected. The 'group' parameter is ignored.
1868 # Returns: Nothing on success
1869 # If @device is not a valid block device, DeviceNotFound
1875 # -> { "execute": "block_set_io_throttle",
1876 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
1889 # "bps_max_length": 0,
1890 # "iops_size": 0 } }
1891 # <- { "return": {} }
1893 # -> { "execute": "block_set_io_throttle",
1894 # "arguments": { "id": "ide0-1-0",
1901 # "bps_max": 8000000,
1907 # "bps_max_length": 60,
1908 # "iops_size": 0 } }
1909 # <- { "return": {} }
1911 { 'command': 'block_set_io_throttle', 'boxed': true,
1912 'data': 'BlockIOThrottle' }
1917 # A set of parameters describing block throttling.
1919 # @device: Block device name (deprecated, use @id instead)
1921 # @id: The name or QOM path of the guest device (since: 2.8)
1923 # @bps: total throughput limit in bytes per second
1925 # @bps_rd: read throughput limit in bytes per second
1927 # @bps_wr: write throughput limit in bytes per second
1929 # @iops: total I/O operations per second
1931 # @iops_rd: read I/O operations per second
1933 # @iops_wr: write I/O operations per second
1935 # @bps_max: total throughput limit during bursts,
1936 # in bytes (Since 1.7)
1938 # @bps_rd_max: read throughput limit during bursts,
1939 # in bytes (Since 1.7)
1941 # @bps_wr_max: write throughput limit during bursts,
1942 # in bytes (Since 1.7)
1944 # @iops_max: total I/O operations per second during bursts,
1945 # in bytes (Since 1.7)
1947 # @iops_rd_max: read I/O operations per second during bursts,
1948 # in bytes (Since 1.7)
1950 # @iops_wr_max: write I/O operations per second during bursts,
1951 # in bytes (Since 1.7)
1953 # @bps_max_length: maximum length of the @bps_max burst
1954 # period, in seconds. It must only
1955 # be set if @bps_max is set as well.
1956 # Defaults to 1. (Since 2.6)
1958 # @bps_rd_max_length: maximum length of the @bps_rd_max
1959 # burst period, in seconds. It must only
1960 # be set if @bps_rd_max is set as well.
1961 # Defaults to 1. (Since 2.6)
1963 # @bps_wr_max_length: maximum length of the @bps_wr_max
1964 # burst period, in seconds. It must only
1965 # be set if @bps_wr_max is set as well.
1966 # Defaults to 1. (Since 2.6)
1968 # @iops_max_length: maximum length of the @iops burst
1969 # period, in seconds. It must only
1970 # be set if @iops_max is set as well.
1971 # Defaults to 1. (Since 2.6)
1973 # @iops_rd_max_length: maximum length of the @iops_rd_max
1974 # burst period, in seconds. It must only
1975 # be set if @iops_rd_max is set as well.
1976 # Defaults to 1. (Since 2.6)
1978 # @iops_wr_max_length: maximum length of the @iops_wr_max
1979 # burst period, in seconds. It must only
1980 # be set if @iops_wr_max is set as well.
1981 # Defaults to 1. (Since 2.6)
1983 # @iops_size: an I/O size in bytes (Since 1.7)
1985 # @group: throttle group name (Since 2.4)
1989 { 'struct': 'BlockIOThrottle',
1990 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
1991 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
1992 '*bps_max': 'int', '*bps_rd_max': 'int',
1993 '*bps_wr_max': 'int', '*iops_max': 'int',
1994 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
1995 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
1996 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
1997 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
1998 '*iops_size': 'int', '*group': 'str' } }
2003 # Limit parameters for throttling.
2004 # Since some limit combinations are illegal, limits should always be set in one
2005 # transaction. All fields are optional. When setting limits, if a field is
2006 # missing the current value is not changed.
2008 # @iops-total: limit total I/O operations per second
2009 # @iops-total-max: I/O operations burst
2010 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2011 # It must only be set if @iops-total-max is set as well.
2012 # @iops-read: limit read operations per second
2013 # @iops-read-max: I/O operations read burst
2014 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2015 # It must only be set if @iops-read-max is set as well.
2016 # @iops-write: limit write operations per second
2017 # @iops-write-max: I/O operations write burst
2018 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2019 # It must only be set if @iops-write-max is set as well.
2020 # @bps-total: limit total bytes per second
2021 # @bps-total-max: total bytes burst
2022 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2023 # It must only be set if @bps-total-max is set as well.
2024 # @bps-read: limit read bytes per second
2025 # @bps-read-max: total bytes read burst
2026 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2027 # It must only be set if @bps-read-max is set as well.
2028 # @bps-write: limit write bytes per second
2029 # @bps-write-max: total bytes write burst
2030 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2031 # It must only be set if @bps-write-max is set as well.
2032 # @iops-size: when limiting by iops max size of an I/O in bytes
2036 { 'struct': 'ThrottleLimits',
2037 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2038 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2039 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2040 '*iops-write' : 'int', '*iops-write-max' : 'int',
2041 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2042 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2043 '*bps-read' : 'int', '*bps-read-max' : 'int',
2044 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2045 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2046 '*iops-size' : 'int' } }
2051 # Copy data from a backing file into a block device.
2053 # The block streaming operation is performed in the background until the entire
2054 # backing file has been copied. This command returns immediately once streaming
2055 # has started. The status of ongoing block streaming operations can be checked
2056 # with query-block-jobs. The operation can be stopped before it has completed
2057 # using the block-job-cancel command.
2059 # The node that receives the data is called the top image, can be located in
2060 # any part of the chain (but always above the base image; see below) and can be
2061 # specified using its device or node name. Earlier qemu versions only allowed
2062 # 'device' to name the top level node; presence of the 'base-node' parameter
2063 # during introspection can be used as a witness of the enhanced semantics
2066 # If a base file is specified then sectors are not copied from that base file and
2067 # its backing chain. When streaming completes the image file will have the base
2068 # file as its backing file. This can be used to stream a subset of the backing
2069 # file chain instead of flattening the entire image.
2071 # On successful completion the image file is updated to drop the backing file
2072 # and the BLOCK_JOB_COMPLETED event is emitted.
2074 # @job-id: identifier for the newly-created block job. If
2075 # omitted, the device name will be used. (Since 2.7)
2077 # @device: the device or node name of the top image
2079 # @base: the common backing file name.
2080 # It cannot be set if @base-node is also set.
2082 # @base-node: the node name of the backing file.
2083 # It cannot be set if @base is also set. (Since 2.8)
2085 # @backing-file: The backing file string to write into the top
2086 # image. This filename is not validated.
2088 # If a pathname string is such that it cannot be
2089 # resolved by QEMU, that means that subsequent QMP or
2090 # HMP commands must use node-names for the image in
2091 # question, as filename lookup methods will fail.
2093 # If not specified, QEMU will automatically determine
2094 # the backing file string to use, or error out if there
2095 # is no obvious choice. Care should be taken when
2096 # specifying the string, to specify a valid filename or
2100 # @speed: the maximum speed, in bytes per second
2102 # @on-error: the action to take on an error (default report).
2103 # 'stop' and 'enospc' can only be used if the block device
2104 # supports io-status (see BlockInfo). Since 1.3.
2106 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
2112 # -> { "execute": "block-stream",
2113 # "arguments": { "device": "virtio0",
2114 # "base": "/tmp/master.qcow2" } }
2115 # <- { "return": {} }
2118 { 'command': 'block-stream',
2119 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2120 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2121 '*on-error': 'BlockdevOnError' } }
2124 # @block-job-set-speed:
2126 # Set maximum speed for a background block operation.
2128 # This command can only be issued when there is an active block job.
2130 # Throttling can be disabled by setting the speed to 0.
2132 # @device: The job identifier. This used to be a device name (hence
2133 # the name of the parameter), but since QEMU 2.7 it can have
2136 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2139 # Returns: Nothing on success
2140 # If no background operation is active on this device, DeviceNotActive
2144 { 'command': 'block-job-set-speed',
2145 'data': { 'device': 'str', 'speed': 'int' } }
2148 # @block-job-cancel:
2150 # Stop an active background block operation.
2152 # This command returns immediately after marking the active background block
2153 # operation for cancellation. It is an error to call this command if no
2154 # operation is in progress.
2156 # The operation will cancel as soon as possible and then emit the
2157 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2158 # enumerated using query-block-jobs.
2160 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2161 # (via the event BLOCK_JOB_READY) that the source and destination are
2162 # synchronized, then the event triggered by this command changes to
2163 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2164 # destination now has a point-in-time copy tied to the time of the cancellation.
2166 # For streaming, the image file retains its backing file unless the streaming
2167 # operation happens to complete just as it is being cancelled. A new streaming
2168 # operation can be started at a later time to finish copying all data from the
2171 # @device: The job identifier. This used to be a device name (hence
2172 # the name of the parameter), but since QEMU 2.7 it can have
2175 # @force: whether to allow cancellation of a paused job (default
2176 # false). Since 1.3.
2178 # Returns: Nothing on success
2179 # If no background operation is active on this device, DeviceNotActive
2183 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2188 # Pause an active background block operation.
2190 # This command returns immediately after marking the active background block
2191 # operation for pausing. It is an error to call this command if no
2192 # operation is in progress. Pausing an already paused job has no cumulative
2193 # effect; a single block-job-resume command will resume the job.
2195 # The operation will pause as soon as possible. No event is emitted when
2196 # the operation is actually paused. Cancelling a paused job automatically
2199 # @device: The job identifier. This used to be a device name (hence
2200 # the name of the parameter), but since QEMU 2.7 it can have
2203 # Returns: Nothing on success
2204 # If no background operation is active on this device, DeviceNotActive
2208 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2211 # @block-job-resume:
2213 # Resume an active background block operation.
2215 # This command returns immediately after resuming a paused background block
2216 # operation. It is an error to call this command if no operation is in
2217 # progress. Resuming an already running job is not an error.
2219 # This command also clears the error status of the job.
2221 # @device: The job identifier. This used to be a device name (hence
2222 # the name of the parameter), but since QEMU 2.7 it can have
2225 # Returns: Nothing on success
2226 # If no background operation is active on this device, DeviceNotActive
2230 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2233 # @block-job-complete:
2235 # Manually trigger completion of an active background block operation. This
2236 # is supported for drive mirroring, where it also switches the device to
2237 # write to the target path only. The ability to complete is signaled with
2238 # a BLOCK_JOB_READY event.
2240 # This command completes an active background block operation synchronously.
2241 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2242 # is not defined. Note that if an I/O error occurs during the processing of
2243 # this command: 1) the command itself will fail; 2) the error will be processed
2244 # according to the rerror/werror arguments that were specified when starting
2247 # A cancelled or paused job cannot be completed.
2249 # @device: The job identifier. This used to be a device name (hence
2250 # the name of the parameter), but since QEMU 2.7 it can have
2253 # Returns: Nothing on success
2254 # If no background operation is active on this device, DeviceNotActive
2258 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2261 # @block-job-dismiss:
2263 # For jobs that have already concluded, remove them from the block-job-query
2264 # list. This command only needs to be run for jobs which were started with
2265 # QEMU 2.12+ job lifetime management semantics.
2267 # This command will refuse to operate on any job that has not yet reached
2268 # its terminal state, BLOCK_JOB_STATUS_CONCLUDED. For jobs that make use of
2269 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2270 # to be used as appropriate.
2272 # @id: The job identifier.
2274 # Returns: Nothing on success
2278 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2281 # @BlockdevDiscardOptions:
2283 # Determines how to handle discard requests.
2285 # @ignore: Ignore the request
2286 # @unmap: Forward as an unmap request
2290 { 'enum': 'BlockdevDiscardOptions',
2291 'data': [ 'ignore', 'unmap' ] }
2294 # @BlockdevDetectZeroesOptions:
2296 # Describes the operation mode for the automatic conversion of plain
2297 # zero writes by the OS to driver specific optimized zero write commands.
2299 # @off: Disabled (default)
2301 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2302 # also that @BlockdevDiscardOptions is set to unmap for this device.
2306 { 'enum': 'BlockdevDetectZeroesOptions',
2307 'data': [ 'off', 'on', 'unmap' ] }
2310 # @BlockdevAioOptions:
2312 # Selects the AIO backend to handle I/O requests
2314 # @threads: Use qemu's thread pool
2315 # @native: Use native AIO backend (only Linux and Windows)
2319 { 'enum': 'BlockdevAioOptions',
2320 'data': [ 'threads', 'native' ] }
2323 # @BlockdevCacheOptions:
2325 # Includes cache-related options for block devices
2327 # @direct: enables use of O_DIRECT (bypass the host page cache;
2329 # @no-flush: ignore any flush requests for the device (default:
2334 { 'struct': 'BlockdevCacheOptions',
2335 'data': { '*direct': 'bool',
2336 '*no-flush': 'bool' } }
2341 # Drivers that are supported in block device operations.
2344 # @throttle: Since 2.11
2349 { 'enum': 'BlockdevDriver',
2350 'data': [ 'blkdebug', 'blkverify', 'bochs', 'cloop',
2351 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
2352 'host_device', 'http', 'https', 'iscsi', 'luks', 'nbd', 'nfs',
2353 'null-aio', 'null-co', 'nvme', 'parallels', 'qcow', 'qcow2', 'qed',
2354 'quorum', 'raw', 'rbd', 'replication', 'sheepdog', 'ssh',
2355 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2358 # @BlockdevOptionsFile:
2360 # Driver specific block device options for the file backend.
2362 # @filename: path to the image file
2363 # @pr-manager: the id for the object that will handle persistent reservations
2364 # for this device (default: none, forward the commands via SG_IO;
2366 # @aio: AIO backend (default: threads) (since: 2.8)
2367 # @locking: whether to enable file locking. If set to 'auto', only enable
2368 # when Open File Descriptor (OFD) locking API is available
2369 # (default: auto, since 2.10)
2373 { 'struct': 'BlockdevOptionsFile',
2374 'data': { 'filename': 'str',
2375 '*pr-manager': 'str',
2376 '*locking': 'OnOffAuto',
2377 '*aio': 'BlockdevAioOptions' } }
2380 # @BlockdevOptionsNull:
2382 # Driver specific block device options for the null backend.
2384 # @size: size of the device in bytes.
2385 # @latency-ns: emulated latency (in nanoseconds) in processing
2386 # requests. Default to zero which completes requests immediately.
2391 { 'struct': 'BlockdevOptionsNull',
2392 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
2395 # @BlockdevOptionsNVMe:
2397 # Driver specific block device options for the NVMe backend.
2399 # @device: controller address of the NVMe device.
2400 # @namespace: namespace number of the device, starting from 1.
2404 { 'struct': 'BlockdevOptionsNVMe',
2405 'data': { 'device': 'str', 'namespace': 'int' } }
2408 # @BlockdevOptionsVVFAT:
2410 # Driver specific block device options for the vvfat protocol.
2412 # @dir: directory to be exported as FAT image
2413 # @fat-type: FAT type: 12, 16 or 32
2414 # @floppy: whether to export a floppy image (true) or
2415 # partitioned hard disk (false; default)
2416 # @label: set the volume label, limited to 11 bytes. FAT16 and
2417 # FAT32 traditionally have some restrictions on labels, which are
2418 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2420 # @rw: whether to allow write operations (default: false)
2424 { 'struct': 'BlockdevOptionsVVFAT',
2425 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2426 '*label': 'str', '*rw': 'bool' } }
2429 # @BlockdevOptionsGenericFormat:
2431 # Driver specific block device options for image format that have no option
2432 # besides their data source.
2434 # @file: reference to or definition of the data source block device
2438 { 'struct': 'BlockdevOptionsGenericFormat',
2439 'data': { 'file': 'BlockdevRef' } }
2442 # @BlockdevOptionsLUKS:
2444 # Driver specific block device options for LUKS.
2446 # @key-secret: the ID of a QCryptoSecret object providing
2447 # the decryption key (since 2.6). Mandatory except when
2448 # doing a metadata-only probe of the image.
2452 { 'struct': 'BlockdevOptionsLUKS',
2453 'base': 'BlockdevOptionsGenericFormat',
2454 'data': { '*key-secret': 'str' } }
2458 # @BlockdevOptionsGenericCOWFormat:
2460 # Driver specific block device options for image format that have no option
2461 # besides their data source and an optional backing file.
2463 # @backing: reference to or definition of the backing file block
2464 # device, null disables the backing file entirely.
2465 # Defaults to the backing file stored the image file.
2469 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2470 'base': 'BlockdevOptionsGenericFormat',
2471 'data': { '*backing': 'BlockdevRefOrNull' } }
2474 # @Qcow2OverlapCheckMode:
2476 # General overlap check modes.
2478 # @none: Do not perform any checks
2480 # @constant: Perform only checks which can be done in constant time and
2481 # without reading anything from disk
2483 # @cached: Perform only checks which can be done without reading anything
2486 # @all: Perform all available overlap checks
2490 { 'enum': 'Qcow2OverlapCheckMode',
2491 'data': [ 'none', 'constant', 'cached', 'all' ] }
2494 # @Qcow2OverlapCheckFlags:
2496 # Structure of flags for each metadata structure. Setting a field to 'true'
2497 # makes qemu guard that structure against unintended overwriting. The default
2498 # value is chosen according to the template given.
2500 # @template: Specifies a template mode which can be adjusted using the other
2501 # flags, defaults to 'cached'
2505 { 'struct': 'Qcow2OverlapCheckFlags',
2506 'data': { '*template': 'Qcow2OverlapCheckMode',
2507 '*main-header': 'bool',
2508 '*active-l1': 'bool',
2509 '*active-l2': 'bool',
2510 '*refcount-table': 'bool',
2511 '*refcount-block': 'bool',
2512 '*snapshot-table': 'bool',
2513 '*inactive-l1': 'bool',
2514 '*inactive-l2': 'bool' } }
2517 # @Qcow2OverlapChecks:
2519 # Specifies which metadata structures should be guarded against unintended
2522 # @flags: set of flags for separate specification of each metadata structure
2525 # @mode: named mode which chooses a specific set of flags
2529 { 'alternate': 'Qcow2OverlapChecks',
2530 'data': { 'flags': 'Qcow2OverlapCheckFlags',
2531 'mode': 'Qcow2OverlapCheckMode' } }
2534 # @BlockdevQcowEncryptionFormat:
2536 # @aes: AES-CBC with plain64 initialization vectors
2540 { 'enum': 'BlockdevQcowEncryptionFormat',
2544 # @BlockdevQcowEncryption:
2548 { 'union': 'BlockdevQcowEncryption',
2549 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
2550 'discriminator': 'format',
2551 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
2554 # @BlockdevOptionsQcow:
2556 # Driver specific block device options for qcow.
2558 # @encrypt: Image decryption options. Mandatory for
2559 # encrypted images, except when doing a metadata-only
2560 # probe of the image.
2564 { 'struct': 'BlockdevOptionsQcow',
2565 'base': 'BlockdevOptionsGenericCOWFormat',
2566 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
2571 # @BlockdevQcow2EncryptionFormat:
2572 # @aes: AES-CBC with plain64 initialization venctors
2576 { 'enum': 'BlockdevQcow2EncryptionFormat',
2577 'data': [ 'aes', 'luks' ] }
2580 # @BlockdevQcow2Encryption:
2584 { 'union': 'BlockdevQcow2Encryption',
2585 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
2586 'discriminator': 'format',
2587 'data': { 'aes': 'QCryptoBlockOptionsQCow',
2588 'luks': 'QCryptoBlockOptionsLUKS'} }
2591 # @BlockdevOptionsQcow2:
2593 # Driver specific block device options for qcow2.
2595 # @lazy-refcounts: whether to enable the lazy refcounts
2596 # feature (default is taken from the image file)
2598 # @pass-discard-request: whether discard requests to the qcow2
2599 # device should be forwarded to the data source
2601 # @pass-discard-snapshot: whether discard requests for the data source
2602 # should be issued when a snapshot operation (e.g.
2603 # deleting a snapshot) frees clusters in the qcow2 file
2605 # @pass-discard-other: whether discard requests for the data source
2606 # should be issued on other occasions where a cluster
2609 # @overlap-check: which overlap checks to perform for writes
2610 # to the image, defaults to 'cached' (since 2.2)
2612 # @cache-size: the maximum total size of the L2 table and
2613 # refcount block caches in bytes (since 2.2)
2615 # @l2-cache-size: the maximum size of the L2 table cache in
2618 # @l2-cache-entry-size: the size of each entry in the L2 cache in
2619 # bytes. It must be a power of two between 512
2620 # and the cluster size. The default value is
2621 # the cluster size (since 2.12)
2623 # @refcount-cache-size: the maximum size of the refcount block cache
2624 # in bytes (since 2.2)
2626 # @cache-clean-interval: clean unused entries in the L2 and refcount
2627 # caches. The interval is in seconds. The default value
2628 # is 0 and it disables this feature (since 2.5)
2629 # @encrypt: Image decryption options. Mandatory for
2630 # encrypted images, except when doing a metadata-only
2631 # probe of the image. (since 2.10)
2635 { 'struct': 'BlockdevOptionsQcow2',
2636 'base': 'BlockdevOptionsGenericCOWFormat',
2637 'data': { '*lazy-refcounts': 'bool',
2638 '*pass-discard-request': 'bool',
2639 '*pass-discard-snapshot': 'bool',
2640 '*pass-discard-other': 'bool',
2641 '*overlap-check': 'Qcow2OverlapChecks',
2642 '*cache-size': 'int',
2643 '*l2-cache-size': 'int',
2644 '*l2-cache-entry-size': 'int',
2645 '*refcount-cache-size': 'int',
2646 '*cache-clean-interval': 'int',
2647 '*encrypt': 'BlockdevQcow2Encryption' } }
2650 # @SshHostKeyCheckMode:
2652 # @none Don't check the host key at all
2653 # @hash Compare the host key with a given hash
2654 # @known_hosts Check the host key against the known_hosts file
2658 { 'enum': 'SshHostKeyCheckMode',
2659 'data': [ 'none', 'hash', 'known_hosts' ] }
2662 # @SshHostKeyCheckHashType:
2664 # @md5 The given hash is an md5 hash
2665 # @sha1 The given hash is an sha1 hash
2669 { 'enum': 'SshHostKeyCheckHashType',
2670 'data': [ 'md5', 'sha1' ] }
2675 # @type The hash algorithm used for the hash
2676 # @hash The expected hash value
2680 { 'struct': 'SshHostKeyHash',
2681 'data': { 'type': 'SshHostKeyCheckHashType',
2687 # For those union branches that don't need additional fields.
2691 { 'struct': 'SshHostKeyDummy',
2699 { 'union': 'SshHostKeyCheck',
2700 'base': { 'mode': 'SshHostKeyCheckMode' },
2701 'discriminator': 'mode',
2702 'data': { 'none': 'SshHostKeyDummy',
2703 'hash': 'SshHostKeyHash',
2704 'known_hosts': 'SshHostKeyDummy' } }
2707 # @BlockdevOptionsSsh:
2709 # @server: host address
2711 # @path: path to the image on the host
2713 # @user: user as which to connect, defaults to current
2716 # @host-key-check: Defines how and what to check the host key against
2717 # (default: known_hosts)
2721 { 'struct': 'BlockdevOptionsSsh',
2722 'data': { 'server': 'InetSocketAddress',
2725 '*host-key-check': 'SshHostKeyCheck' } }
2731 # Trigger events supported by blkdebug.
2733 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
2736 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
2738 # @cor_write: a write due to copy-on-read (since 2.11)
2742 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
2743 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
2744 'l1_grow_activate_table', 'l2_load', 'l2_update',
2745 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
2746 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
2747 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
2748 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
2749 'refblock_load', 'refblock_update', 'refblock_update_part',
2750 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
2751 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
2752 'refblock_alloc_switch_table', 'cluster_alloc',
2753 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
2754 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
2755 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
2756 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
2757 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
2761 # @BlkdebugInjectErrorOptions:
2763 # Describes a single error injection for blkdebug.
2765 # @event: trigger event
2767 # @state: the state identifier blkdebug needs to be in to
2768 # actually trigger the event; defaults to "any"
2770 # @errno: error identifier (errno) to be returned; defaults to
2773 # @sector: specifies the sector index which has to be affected
2774 # in order to actually trigger the event; defaults to "any
2777 # @once: disables further events after this one has been
2778 # triggered; defaults to false
2780 # @immediately: fail immediately; defaults to false
2784 { 'struct': 'BlkdebugInjectErrorOptions',
2785 'data': { 'event': 'BlkdebugEvent',
2790 '*immediately': 'bool' } }
2793 # @BlkdebugSetStateOptions:
2795 # Describes a single state-change event for blkdebug.
2797 # @event: trigger event
2799 # @state: the current state identifier blkdebug needs to be in;
2802 # @new_state: the state identifier blkdebug is supposed to assume if
2803 # this event is triggered
2807 { 'struct': 'BlkdebugSetStateOptions',
2808 'data': { 'event': 'BlkdebugEvent',
2810 'new_state': 'int' } }
2813 # @BlockdevOptionsBlkdebug:
2815 # Driver specific block device options for blkdebug.
2817 # @image: underlying raw block device (or image file)
2819 # @config: filename of the configuration file
2821 # @align: required alignment for requests in bytes, must be
2822 # positive power of 2, or 0 for default
2824 # @max-transfer: maximum size for I/O transfers in bytes, must be
2825 # positive multiple of @align and of the underlying
2826 # file's request alignment (but need not be a power of
2827 # 2), or 0 for default (since 2.10)
2829 # @opt-write-zero: preferred alignment for write zero requests in bytes,
2830 # must be positive multiple of @align and of the
2831 # underlying file's request alignment (but need not be a
2832 # power of 2), or 0 for default (since 2.10)
2834 # @max-write-zero: maximum size for write zero requests in bytes, must be
2835 # positive multiple of @align, of @opt-write-zero, and of
2836 # the underlying file's request alignment (but need not
2837 # be a power of 2), or 0 for default (since 2.10)
2839 # @opt-discard: preferred alignment for discard requests in bytes, must
2840 # be positive multiple of @align and of the underlying
2841 # file's request alignment (but need not be a power of
2842 # 2), or 0 for default (since 2.10)
2844 # @max-discard: maximum size for discard requests in bytes, must be
2845 # positive multiple of @align, of @opt-discard, and of
2846 # the underlying file's request alignment (but need not
2847 # be a power of 2), or 0 for default (since 2.10)
2849 # @inject-error: array of error injection descriptions
2851 # @set-state: array of state-change descriptions
2855 { 'struct': 'BlockdevOptionsBlkdebug',
2856 'data': { 'image': 'BlockdevRef',
2858 '*align': 'int', '*max-transfer': 'int32',
2859 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
2860 '*opt-discard': 'int32', '*max-discard': 'int32',
2861 '*inject-error': ['BlkdebugInjectErrorOptions'],
2862 '*set-state': ['BlkdebugSetStateOptions'] } }
2865 # @BlockdevOptionsBlkverify:
2867 # Driver specific block device options for blkverify.
2869 # @test: block device to be tested
2871 # @raw: raw image used for verification
2875 { 'struct': 'BlockdevOptionsBlkverify',
2876 'data': { 'test': 'BlockdevRef',
2877 'raw': 'BlockdevRef' } }
2880 # @QuorumReadPattern:
2882 # An enumeration of quorum read patterns.
2884 # @quorum: read all the children and do a quorum vote on reads
2886 # @fifo: read only from the first child that has not failed
2890 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
2893 # @BlockdevOptionsQuorum:
2895 # Driver specific block device options for Quorum
2897 # @blkverify: true if the driver must print content mismatch
2898 # set to false by default
2900 # @children: the children block devices to use
2902 # @vote-threshold: the vote limit under which a read will fail
2904 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
2907 # @read-pattern: choose read pattern and set to quorum by default
2912 { 'struct': 'BlockdevOptionsQuorum',
2913 'data': { '*blkverify': 'bool',
2914 'children': [ 'BlockdevRef' ],
2915 'vote-threshold': 'int',
2916 '*rewrite-corrupted': 'bool',
2917 '*read-pattern': 'QuorumReadPattern' } }
2920 # @BlockdevOptionsGluster:
2922 # Driver specific block device options for Gluster
2924 # @volume: name of gluster volume where VM image resides
2926 # @path: absolute path to image file in gluster volume
2928 # @server: gluster servers description
2930 # @debug: libgfapi log level (default '4' which is Error)
2933 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
2937 { 'struct': 'BlockdevOptionsGluster',
2938 'data': { 'volume': 'str',
2940 'server': ['SocketAddress'],
2942 '*logfile': 'str' } }
2947 # An enumeration of libiscsi transport types
2951 { 'enum': 'IscsiTransport',
2952 'data': [ 'tcp', 'iser' ] }
2955 # @IscsiHeaderDigest:
2957 # An enumeration of header digests supported by libiscsi
2961 { 'enum': 'IscsiHeaderDigest',
2962 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
2963 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
2966 # @BlockdevOptionsIscsi:
2968 # @transport: The iscsi transport type
2970 # @portal: The address of the iscsi portal
2972 # @target: The target iqn name
2974 # @lun: LUN to connect to. Defaults to 0.
2976 # @user: User name to log in with. If omitted, no CHAP
2977 # authentication is performed.
2979 # @password-secret: The ID of a QCryptoSecret object providing
2980 # the password for the login. This option is required if
2981 # @user is specified.
2983 # @initiator-name: The iqn name we want to identify to the target
2984 # as. If this option is not specified, an initiator name is
2985 # generated automatically.
2987 # @header-digest: The desired header digest. Defaults to
2990 # @timeout: Timeout in seconds after which a request will
2991 # timeout. 0 means no timeout and is the default.
2993 # Driver specific block device options for iscsi
2997 { 'struct': 'BlockdevOptionsIscsi',
2998 'data': { 'transport': 'IscsiTransport',
3003 '*password-secret': 'str',
3004 '*initiator-name': 'str',
3005 '*header-digest': 'IscsiHeaderDigest',
3006 '*timeout': 'int' } }
3010 # @BlockdevOptionsRbd:
3012 # @pool: Ceph pool name.
3014 # @image: Image name in the Ceph pool.
3016 # @conf: path to Ceph configuration file. Values
3017 # in the configuration file will be overridden by
3018 # options specified via QAPI.
3020 # @snapshot: Ceph snapshot name.
3022 # @user: Ceph id name.
3024 # @server: Monitor host address and port. This maps
3025 # to the "mon_host" Ceph option.
3029 { 'struct': 'BlockdevOptionsRbd',
3030 'data': { 'pool': 'str',
3035 '*server': ['InetSocketAddressBase'] } }
3038 # @BlockdevOptionsSheepdog:
3040 # Driver specific block device options for sheepdog
3042 # @vdi: Virtual disk image name
3043 # @server: The Sheepdog server to connect to
3044 # @snap-id: Snapshot ID
3045 # @tag: Snapshot tag name
3047 # Only one of @snap-id and @tag may be present.
3051 { 'struct': 'BlockdevOptionsSheepdog',
3052 'data': { 'server': 'SocketAddress',
3054 '*snap-id': 'uint32',
3060 # An enumeration of replication modes.
3062 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3064 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3068 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
3071 # @BlockdevOptionsReplication:
3073 # Driver specific block device options for replication
3075 # @mode: the replication mode
3077 # @top-id: In secondary mode, node name or device ID of the root
3078 # node who owns the replication node chain. Must not be given in
3083 { 'struct': 'BlockdevOptionsReplication',
3084 'base': 'BlockdevOptionsGenericFormat',
3085 'data': { 'mode': 'ReplicationMode',
3086 '*top-id': 'str' } }
3091 # An enumeration of NFS transport types
3093 # @inet: TCP transport
3097 { 'enum': 'NFSTransport',
3098 'data': [ 'inet' ] }
3103 # Captures the address of the socket
3105 # @type: transport type used for NFS (only TCP supported)
3107 # @host: host address for NFS server
3111 { 'struct': 'NFSServer',
3112 'data': { 'type': 'NFSTransport',
3116 # @BlockdevOptionsNfs:
3118 # Driver specific block device option for NFS
3120 # @server: host address
3122 # @path: path of the image on the host
3124 # @user: UID value to use when talking to the
3125 # server (defaults to 65534 on Windows and getuid()
3128 # @group: GID value to use when talking to the
3129 # server (defaults to 65534 on Windows and getgid()
3132 # @tcp-syn-count: number of SYNs during the session
3133 # establishment (defaults to libnfs default)
3135 # @readahead-size: set the readahead size in bytes (defaults
3136 # to libnfs default)
3138 # @page-cache-size: set the pagecache size in bytes (defaults
3139 # to libnfs default)
3141 # @debug: set the NFS debug level (max 2) (defaults
3142 # to libnfs default)
3146 { 'struct': 'BlockdevOptionsNfs',
3147 'data': { 'server': 'NFSServer',
3151 '*tcp-syn-count': 'int',
3152 '*readahead-size': 'int',
3153 '*page-cache-size': 'int',
3157 # @BlockdevOptionsCurlBase:
3159 # Driver specific block device options shared by all protocols supported by the
3162 # @url: URL of the image file
3164 # @readahead: Size of the read-ahead cache; must be a multiple of
3165 # 512 (defaults to 256 kB)
3167 # @timeout: Timeout for connections, in seconds (defaults to 5)
3169 # @username: Username for authentication (defaults to none)
3171 # @password-secret: ID of a QCryptoSecret object providing a password
3172 # for authentication (defaults to no password)
3174 # @proxy-username: Username for proxy authentication (defaults to none)
3176 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3177 # for proxy authentication (defaults to no password)
3181 { 'struct': 'BlockdevOptionsCurlBase',
3182 'data': { 'url': 'str',
3183 '*readahead': 'int',
3186 '*password-secret': 'str',
3187 '*proxy-username': 'str',
3188 '*proxy-password-secret': 'str' } }
3191 # @BlockdevOptionsCurlHttp:
3193 # Driver specific block device options for HTTP connections over the curl
3194 # backend. URLs must start with "http://".
3196 # @cookie: List of cookies to set; format is
3197 # "name1=content1; name2=content2;" as explained by
3198 # CURLOPT_COOKIE(3). Defaults to no cookies.
3200 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3201 # secure way. See @cookie for the format. (since 2.10)
3205 { 'struct': 'BlockdevOptionsCurlHttp',
3206 'base': 'BlockdevOptionsCurlBase',
3207 'data': { '*cookie': 'str',
3208 '*cookie-secret': 'str'} }
3211 # @BlockdevOptionsCurlHttps:
3213 # Driver specific block device options for HTTPS connections over the curl
3214 # backend. URLs must start with "https://".
3216 # @cookie: List of cookies to set; format is
3217 # "name1=content1; name2=content2;" as explained by
3218 # CURLOPT_COOKIE(3). Defaults to no cookies.
3220 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3223 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3224 # secure way. See @cookie for the format. (since 2.10)
3228 { 'struct': 'BlockdevOptionsCurlHttps',
3229 'base': 'BlockdevOptionsCurlBase',
3230 'data': { '*cookie': 'str',
3231 '*sslverify': 'bool',
3232 '*cookie-secret': 'str'} }
3235 # @BlockdevOptionsCurlFtp:
3237 # Driver specific block device options for FTP connections over the curl
3238 # backend. URLs must start with "ftp://".
3242 { 'struct': 'BlockdevOptionsCurlFtp',
3243 'base': 'BlockdevOptionsCurlBase',
3247 # @BlockdevOptionsCurlFtps:
3249 # Driver specific block device options for FTPS connections over the curl
3250 # backend. URLs must start with "ftps://".
3252 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3257 { 'struct': 'BlockdevOptionsCurlFtps',
3258 'base': 'BlockdevOptionsCurlBase',
3259 'data': { '*sslverify': 'bool' } }
3262 # @BlockdevOptionsNbd:
3264 # Driver specific block device options for NBD.
3266 # @server: NBD server address
3268 # @export: export name
3270 # @tls-creds: TLS credentials ID
3274 { 'struct': 'BlockdevOptionsNbd',
3275 'data': { 'server': 'SocketAddress',
3277 '*tls-creds': 'str' } }
3280 # @BlockdevOptionsRaw:
3282 # Driver specific block device options for the raw driver.
3284 # @offset: position where the block device starts
3285 # @size: the assumed size of the device
3289 { 'struct': 'BlockdevOptionsRaw',
3290 'base': 'BlockdevOptionsGenericFormat',
3291 'data': { '*offset': 'int', '*size': 'int' } }
3294 # @BlockdevOptionsVxHS:
3296 # Driver specific block device options for VxHS
3298 # @vdisk-id: UUID of VxHS volume
3299 # @server: vxhs server IP, port
3300 # @tls-creds: TLS credentials ID
3304 { 'struct': 'BlockdevOptionsVxHS',
3305 'data': { 'vdisk-id': 'str',
3306 'server': 'InetSocketAddressBase',
3307 '*tls-creds': 'str' } }
3310 # @BlockdevOptionsThrottle:
3312 # Driver specific block device options for the throttle driver
3314 # @throttle-group: the name of the throttle-group object to use. It
3315 # must already exist.
3316 # @file: reference to or definition of the data source block device
3319 { 'struct': 'BlockdevOptionsThrottle',
3320 'data': { 'throttle-group': 'str',
3321 'file' : 'BlockdevRef'
3326 # Options for creating a block device. Many options are available for all
3327 # block devices, independent of the block driver:
3329 # @driver: block driver name
3330 # @node-name: the node name of the new node (Since 2.0).
3331 # This option is required on the top level of blockdev-add.
3332 # @discard: discard-related options (default: ignore)
3333 # @cache: cache-related options
3334 # @read-only: whether the block device should be read-only (default: false).
3335 # Note that some block drivers support only read-only access,
3336 # either generally or in certain configurations. In this case,
3337 # the default value does not work and the option must be
3338 # specified explicitly.
3339 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3341 # @force-share: force share all permission on added nodes.
3342 # Requires read-only=true. (Since 2.10)
3344 # Remaining options are determined by the block driver.
3348 { 'union': 'BlockdevOptions',
3349 'base': { 'driver': 'BlockdevDriver',
3350 '*node-name': 'str',
3351 '*discard': 'BlockdevDiscardOptions',
3352 '*cache': 'BlockdevCacheOptions',
3353 '*read-only': 'bool',
3354 '*force-share': 'bool',
3355 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3356 'discriminator': 'driver',
3358 'blkdebug': 'BlockdevOptionsBlkdebug',
3359 'blkverify': 'BlockdevOptionsBlkverify',
3360 'bochs': 'BlockdevOptionsGenericFormat',
3361 'cloop': 'BlockdevOptionsGenericFormat',
3362 'dmg': 'BlockdevOptionsGenericFormat',
3363 'file': 'BlockdevOptionsFile',
3364 'ftp': 'BlockdevOptionsCurlFtp',
3365 'ftps': 'BlockdevOptionsCurlFtps',
3366 'gluster': 'BlockdevOptionsGluster',
3367 'host_cdrom': 'BlockdevOptionsFile',
3368 'host_device':'BlockdevOptionsFile',
3369 'http': 'BlockdevOptionsCurlHttp',
3370 'https': 'BlockdevOptionsCurlHttps',
3371 'iscsi': 'BlockdevOptionsIscsi',
3372 'luks': 'BlockdevOptionsLUKS',
3373 'nbd': 'BlockdevOptionsNbd',
3374 'nfs': 'BlockdevOptionsNfs',
3375 'null-aio': 'BlockdevOptionsNull',
3376 'null-co': 'BlockdevOptionsNull',
3377 'nvme': 'BlockdevOptionsNVMe',
3378 'parallels': 'BlockdevOptionsGenericFormat',
3379 'qcow2': 'BlockdevOptionsQcow2',
3380 'qcow': 'BlockdevOptionsQcow',
3381 'qed': 'BlockdevOptionsGenericCOWFormat',
3382 'quorum': 'BlockdevOptionsQuorum',
3383 'raw': 'BlockdevOptionsRaw',
3384 'rbd': 'BlockdevOptionsRbd',
3385 'replication':'BlockdevOptionsReplication',
3386 'sheepdog': 'BlockdevOptionsSheepdog',
3387 'ssh': 'BlockdevOptionsSsh',
3388 'throttle': 'BlockdevOptionsThrottle',
3389 'vdi': 'BlockdevOptionsGenericFormat',
3390 'vhdx': 'BlockdevOptionsGenericFormat',
3391 'vmdk': 'BlockdevOptionsGenericCOWFormat',
3392 'vpc': 'BlockdevOptionsGenericFormat',
3393 'vvfat': 'BlockdevOptionsVVFAT',
3394 'vxhs': 'BlockdevOptionsVxHS'
3400 # Reference to a block device.
3402 # @definition: defines a new block device inline
3403 # @reference: references the ID of an existing block device
3407 { 'alternate': 'BlockdevRef',
3408 'data': { 'definition': 'BlockdevOptions',
3409 'reference': 'str' } }
3412 # @BlockdevRefOrNull:
3414 # Reference to a block device.
3416 # @definition: defines a new block device inline
3417 # @reference: references the ID of an existing block device.
3418 # An empty string means that no block device should
3419 # be referenced. Deprecated; use null instead.
3420 # @null: No block device should be referenced (since 2.10)
3424 { 'alternate': 'BlockdevRefOrNull',
3425 'data': { 'definition': 'BlockdevOptions',
3432 # Creates a new block device. If the @id option is given at the top level, a
3433 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
3434 # level and no BlockBackend will be created.
3441 # -> { "execute": "blockdev-add",
3443 # "driver": "qcow2",
3444 # "node-name": "test1",
3447 # "filename": "test.qcow2"
3451 # <- { "return": {} }
3454 # -> { "execute": "blockdev-add",
3456 # "driver": "qcow2",
3457 # "node-name": "node0",
3458 # "discard": "unmap",
3464 # "filename": "/tmp/test.qcow2"
3470 # "filename": "/dev/fdset/4"
3476 # <- { "return": {} }
3479 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
3484 # Deletes a block device that has been added using blockdev-add.
3485 # The command will fail if the node is attached to a device or is
3486 # otherwise being used.
3488 # @node-name: Name of the graph node to delete.
3494 # -> { "execute": "blockdev-add",
3496 # "driver": "qcow2",
3497 # "node-name": "node0",
3500 # "filename": "test.qcow2"
3504 # <- { "return": {} }
3506 # -> { "execute": "blockdev-del",
3507 # "arguments": { "node-name": "node0" }
3509 # <- { "return": {} }
3512 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
3515 # @BlockdevCreateOptionsFile:
3517 # Driver specific image creation options for file.
3519 # @filename Filename for the new image file
3520 # @size Size of the virtual disk in bytes
3521 # @preallocation Preallocation mode for the new image (default: off)
3522 # @nocow Turn off copy-on-write (valid only on btrfs; default: off)
3526 { 'struct': 'BlockdevCreateOptionsFile',
3527 'data': { 'filename': 'str',
3529 '*preallocation': 'PreallocMode',
3530 '*nocow': 'bool' } }
3533 # @BlockdevCreateOptionsGluster:
3535 # Driver specific image creation options for gluster.
3537 # @location Where to store the new image file
3538 # @size Size of the virtual disk in bytes
3539 # @preallocation Preallocation mode for the new image (default: off)
3543 { 'struct': 'BlockdevCreateOptionsGluster',
3544 'data': { 'location': 'BlockdevOptionsGluster',
3546 '*preallocation': 'PreallocMode' } }
3549 # @BlockdevCreateOptionsNfs:
3551 # Driver specific image creation options for NFS.
3553 # @location Where to store the new image file
3554 # @size Size of the virtual disk in bytes
3558 { 'struct': 'BlockdevCreateOptionsNfs',
3559 'data': { 'location': 'BlockdevOptionsNfs',
3563 # @BlockdevQcow2Version:
3565 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
3566 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
3570 { 'enum': 'BlockdevQcow2Version',
3571 'data': [ 'v2', 'v3' ] }
3575 # @BlockdevCreateOptionsQcow2:
3577 # Driver specific image creation options for qcow2.
3579 # @file Node to create the image format on
3580 # @size Size of the virtual disk in bytes
3581 # @version Compatibility level (default: v3)
3582 # @backing-file File name of the backing file if a backing file
3584 # @backing-fmt Name of the block driver to use for the backing file
3585 # @encrypt Encryption options if the image should be encrypted
3586 # @cluster-size qcow2 cluster size in bytes (default: 65536)
3587 # @preallocation Preallocation mode for the new image (default: off)
3588 # @lazy-refcounts True if refcounts may be updated lazily (default: off)
3589 # @refcount-bits Width of reference counts in bits (default: 16)
3593 { 'struct': 'BlockdevCreateOptionsQcow2',
3594 'data': { 'file': 'BlockdevRef',
3596 '*version': 'BlockdevQcow2Version',
3597 '*backing-file': 'str',
3598 '*backing-fmt': 'BlockdevDriver',
3599 '*encrypt': 'QCryptoBlockCreateOptions',
3600 '*cluster-size': 'size',
3601 '*preallocation': 'PreallocMode',
3602 '*lazy-refcounts': 'bool',
3603 '*refcount-bits': 'int' } }
3606 # @BlockdevCreateOptionsRbd:
3608 # Driver specific image creation options for rbd/Ceph.
3610 # @location Where to store the new image file. This location cannot
3611 # point to a snapshot.
3612 # @size Size of the virtual disk in bytes
3613 # @cluster-size RBD object size
3617 { 'struct': 'BlockdevCreateOptionsRbd',
3618 'data': { 'location': 'BlockdevOptionsRbd',
3620 '*cluster-size' : 'size' } }
3623 # @SheepdogRedundancyType:
3625 # @full Create a fully replicated vdi with x copies
3626 # @erasure-coded Create an erasure coded vdi with x data strips and
3631 { 'enum': 'SheepdogRedundancyType',
3632 'data': [ 'full', 'erasure-coded' ] }
3635 # @SheepdogRedundancyFull:
3637 # @copies Number of copies to use (between 1 and 31)
3641 { 'struct': 'SheepdogRedundancyFull',
3642 'data': { 'copies': 'int' }}
3645 # @SheepdogRedundancyErasureCoded:
3647 # @data-strips Number of data strips to use (one of {2,4,8,16})
3648 # @parity-strips Number of parity strips to use (between 1 and 15)
3652 { 'struct': 'SheepdogRedundancyErasureCoded',
3653 'data': { 'data-strips': 'int',
3654 'parity-strips': 'int' }}
3657 # @SheepdogRedundancy:
3661 { 'union': 'SheepdogRedundancy',
3662 'base': { 'type': 'SheepdogRedundancyType' },
3663 'discriminator': 'type',
3664 'data': { 'full': 'SheepdogRedundancyFull',
3665 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
3668 # @BlockdevCreateOptionsSheepdog:
3670 # Driver specific image creation options for Sheepdog.
3672 # @location Where to store the new image file
3673 # @size Size of the virtual disk in bytes
3674 # @backing-file File name of a base image
3675 # @preallocation Preallocation mode (allowed values: off, full)
3676 # @redundancy Redundancy of the image
3677 # @object-size Object size of the image
3681 { 'struct': 'BlockdevCreateOptionsSheepdog',
3682 'data': { 'location': 'BlockdevOptionsSheepdog',
3684 '*backing-file': 'str',
3685 '*preallocation': 'PreallocMode',
3686 '*redundancy': 'SheepdogRedundancy',
3687 '*object-size': 'size' } }
3690 # @BlockdevCreateOptionsSsh:
3692 # Driver specific image creation options for SSH.
3694 # @location Where to store the new image file
3695 # @size Size of the virtual disk in bytes
3699 { 'struct': 'BlockdevCreateOptionsSsh',
3700 'data': { 'location': 'BlockdevOptionsSsh',
3704 # @BlockdevCreateNotSupported:
3706 # This is used for all drivers that don't support creating images.
3710 { 'struct': 'BlockdevCreateNotSupported', 'data': {}}
3713 # @BlockdevCreateOptions:
3715 # Options for creating an image format on a given node.
3717 # @driver block driver to create the image format
3721 { 'union': 'BlockdevCreateOptions',
3723 'driver': 'BlockdevDriver' },
3724 'discriminator': 'driver',
3726 'blkdebug': 'BlockdevCreateNotSupported',
3727 'blkverify': 'BlockdevCreateNotSupported',
3728 'bochs': 'BlockdevCreateNotSupported',
3729 'cloop': 'BlockdevCreateNotSupported',
3730 'dmg': 'BlockdevCreateNotSupported',
3731 'file': 'BlockdevCreateOptionsFile',
3732 'ftp': 'BlockdevCreateNotSupported',
3733 'ftps': 'BlockdevCreateNotSupported',
3734 'gluster': 'BlockdevCreateOptionsGluster',
3735 'host_cdrom': 'BlockdevCreateNotSupported',
3736 'host_device': 'BlockdevCreateNotSupported',
3737 'http': 'BlockdevCreateNotSupported',
3738 'https': 'BlockdevCreateNotSupported',
3739 'iscsi': 'BlockdevCreateNotSupported',
3740 'luks': 'BlockdevCreateNotSupported',
3741 'nbd': 'BlockdevCreateNotSupported',
3742 'nfs': 'BlockdevCreateOptionsNfs',
3743 'null-aio': 'BlockdevCreateNotSupported',
3744 'null-co': 'BlockdevCreateNotSupported',
3745 'nvme': 'BlockdevCreateNotSupported',
3746 'parallels': 'BlockdevCreateNotSupported',
3747 'qcow2': 'BlockdevCreateOptionsQcow2',
3748 'qcow': 'BlockdevCreateNotSupported',
3749 'qed': 'BlockdevCreateNotSupported',
3750 'quorum': 'BlockdevCreateNotSupported',
3751 'raw': 'BlockdevCreateNotSupported',
3752 'rbd': 'BlockdevCreateOptionsRbd',
3753 'replication': 'BlockdevCreateNotSupported',
3754 'sheepdog': 'BlockdevCreateOptionsSheepdog',
3755 'ssh': 'BlockdevCreateOptionsSsh',
3756 'throttle': 'BlockdevCreateNotSupported',
3757 'vdi': 'BlockdevCreateNotSupported',
3758 'vhdx': 'BlockdevCreateNotSupported',
3759 'vmdk': 'BlockdevCreateNotSupported',
3760 'vpc': 'BlockdevCreateNotSupported',
3761 'vvfat': 'BlockdevCreateNotSupported',
3762 'vxhs': 'BlockdevCreateNotSupported'
3766 # @x-blockdev-create:
3768 # Create an image format on a given node.
3769 # TODO Replace with something asynchronous (block job?)
3773 { 'command': 'x-blockdev-create',
3774 'data': 'BlockdevCreateOptions',
3778 # @blockdev-open-tray:
3780 # Opens a block device's tray. If there is a block driver state tree inserted as
3781 # a medium, it will become inaccessible to the guest (but it will remain
3782 # associated to the block device, so closing the tray will make it accessible
3785 # If the tray was already open before, this will be a no-op.
3787 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
3788 # which no such event will be generated, these include:
3789 # - if the guest has locked the tray, @force is false and the guest does not
3790 # respond to the eject request
3791 # - if the BlockBackend denoted by @device does not have a guest device attached
3793 # - if the guest device does not have an actual tray
3795 # @device: Block device name (deprecated, use @id instead)
3797 # @id: The name or QOM path of the guest device (since: 2.8)
3799 # @force: if false (the default), an eject request will be sent to
3800 # the guest if it has locked the tray (and the tray will not be opened
3801 # immediately); if true, the tray will be opened regardless of whether
3808 # -> { "execute": "blockdev-open-tray",
3809 # "arguments": { "id": "ide0-1-0" } }
3811 # <- { "timestamp": { "seconds": 1418751016,
3812 # "microseconds": 716996 },
3813 # "event": "DEVICE_TRAY_MOVED",
3814 # "data": { "device": "ide1-cd0",
3816 # "tray-open": true } }
3818 # <- { "return": {} }
3821 { 'command': 'blockdev-open-tray',
3822 'data': { '*device': 'str',
3824 '*force': 'bool' } }
3827 # @blockdev-close-tray:
3829 # Closes a block device's tray. If there is a block driver state tree associated
3830 # with the block device (which is currently ejected), that tree will be loaded
3833 # If the tray was already closed before, this will be a no-op.
3835 # @device: Block device name (deprecated, use @id instead)
3837 # @id: The name or QOM path of the guest device (since: 2.8)
3843 # -> { "execute": "blockdev-close-tray",
3844 # "arguments": { "id": "ide0-1-0" } }
3846 # <- { "timestamp": { "seconds": 1418751345,
3847 # "microseconds": 272147 },
3848 # "event": "DEVICE_TRAY_MOVED",
3849 # "data": { "device": "ide1-cd0",
3851 # "tray-open": false } }
3853 # <- { "return": {} }
3856 { 'command': 'blockdev-close-tray',
3857 'data': { '*device': 'str',
3861 # @blockdev-remove-medium:
3863 # Removes a medium (a block driver state tree) from a block device. That block
3864 # device's tray must currently be open (unless there is no attached guest
3867 # If the tray is open and there is no medium inserted, this will be a no-op.
3869 # @id: The name or QOM path of the guest device
3875 # -> { "execute": "blockdev-remove-medium",
3876 # "arguments": { "id": "ide0-1-0" } }
3878 # <- { "error": { "class": "GenericError",
3879 # "desc": "Tray of device 'ide0-1-0' is not open" } }
3881 # -> { "execute": "blockdev-open-tray",
3882 # "arguments": { "id": "ide0-1-0" } }
3884 # <- { "timestamp": { "seconds": 1418751627,
3885 # "microseconds": 549958 },
3886 # "event": "DEVICE_TRAY_MOVED",
3887 # "data": { "device": "ide1-cd0",
3889 # "tray-open": true } }
3891 # <- { "return": {} }
3893 # -> { "execute": "blockdev-remove-medium",
3894 # "arguments": { "id": "ide0-1-0" } }
3896 # <- { "return": {} }
3899 { 'command': 'blockdev-remove-medium',
3900 'data': { 'id': 'str' } }
3903 # @blockdev-insert-medium:
3905 # Inserts a medium (a block driver state tree) into a block device. That block
3906 # device's tray must currently be open (unless there is no attached guest
3907 # device) and there must be no medium inserted already.
3909 # @id: The name or QOM path of the guest device
3911 # @node-name: name of a node in the block driver state graph
3917 # -> { "execute": "blockdev-add",
3919 # "node-name": "node0",
3921 # "file": { "driver": "file",
3922 # "filename": "fedora.iso" } } }
3923 # <- { "return": {} }
3925 # -> { "execute": "blockdev-insert-medium",
3926 # "arguments": { "id": "ide0-1-0",
3927 # "node-name": "node0" } }
3929 # <- { "return": {} }
3932 { 'command': 'blockdev-insert-medium',
3933 'data': { 'id': 'str',
3934 'node-name': 'str'} }
3938 # @BlockdevChangeReadOnlyMode:
3940 # Specifies the new read-only mode of a block device subject to the
3941 # @blockdev-change-medium command.
3943 # @retain: Retains the current read-only mode
3945 # @read-only: Makes the device read-only
3947 # @read-write: Makes the device writable
3952 { 'enum': 'BlockdevChangeReadOnlyMode',
3953 'data': ['retain', 'read-only', 'read-write'] }
3957 # @blockdev-change-medium:
3959 # Changes the medium inserted into a block device by ejecting the current medium
3960 # and loading a new image file which is inserted as the new medium (this command
3961 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
3962 # and blockdev-close-tray).
3964 # @device: Block device name (deprecated, use @id instead)
3966 # @id: The name or QOM path of the guest device
3969 # @filename: filename of the new image to be loaded
3971 # @format: format to open the new image with (defaults to
3972 # the probed format)
3974 # @read-only-mode: change the read-only mode of the device; defaults
3981 # 1. Change a removable medium
3983 # -> { "execute": "blockdev-change-medium",
3984 # "arguments": { "id": "ide0-1-0",
3985 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
3986 # "format": "raw" } }
3987 # <- { "return": {} }
3989 # 2. Load a read-only medium into a writable drive
3991 # -> { "execute": "blockdev-change-medium",
3992 # "arguments": { "id": "floppyA",
3993 # "filename": "/srv/images/ro.img",
3995 # "read-only-mode": "retain" } }
3998 # { "class": "GenericError",
3999 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4001 # -> { "execute": "blockdev-change-medium",
4002 # "arguments": { "id": "floppyA",
4003 # "filename": "/srv/images/ro.img",
4005 # "read-only-mode": "read-only" } }
4007 # <- { "return": {} }
4010 { 'command': 'blockdev-change-medium',
4011 'data': { '*device': 'str',
4015 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
4019 # @BlockErrorAction:
4021 # An enumeration of action that has been taken when a DISK I/O occurs
4023 # @ignore: error has been ignored
4025 # @report: error has been reported to the device
4027 # @stop: error caused VM to be stopped
4031 { 'enum': 'BlockErrorAction',
4032 'data': [ 'ignore', 'report', 'stop' ] }
4036 # @BLOCK_IMAGE_CORRUPTED:
4038 # Emitted when a disk image is being marked corrupt. The image can be
4039 # identified by its device or node name. The 'device' field is always
4040 # present for compatibility reasons, but it can be empty ("") if the
4041 # image does not have a device name associated.
4043 # @device: device name. This is always present for compatibility
4044 # reasons, but it can be empty ("") if the image does not
4045 # have a device name associated.
4047 # @node-name: node name (Since: 2.4)
4049 # @msg: informative message for human consumption, such as the kind of
4050 # corruption being detected. It should not be parsed by machine as it is
4051 # not guaranteed to be stable
4053 # @offset: if the corruption resulted from an image access, this is
4054 # the host's access offset into the image
4056 # @size: if the corruption resulted from an image access, this is
4059 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4060 # event and must be repaired (Since 2.2; before, every
4061 # BLOCK_IMAGE_CORRUPTED event was fatal)
4063 # Note: If action is "stop", a STOP event will eventually follow the
4064 # BLOCK_IO_ERROR event.
4068 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4069 # "data": { "device": "ide0-hd0", "node-name": "node0",
4070 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4072 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4076 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4077 'data': { 'device' : 'str',
4078 '*node-name' : 'str',
4082 'fatal' : 'bool' } }
4087 # Emitted when a disk I/O error occurs
4089 # @device: device name. This is always present for compatibility
4090 # reasons, but it can be empty ("") if the image does not
4091 # have a device name associated.
4093 # @node-name: node name. Note that errors may be reported for the root node
4094 # that is directly attached to a guest device rather than for the
4095 # node where the error occurred. The node name is not present if
4096 # the drive is empty. (Since: 2.8)
4098 # @operation: I/O operation
4100 # @action: action that has been taken
4102 # @nospace: true if I/O error was caused due to a no-space
4103 # condition. This key is only present if query-block's
4104 # io-status is present, please see query-block documentation
4105 # for more information (since: 2.2)
4107 # @reason: human readable string describing the error cause.
4108 # (This field is a debugging aid for humans, it should not
4109 # be parsed by applications) (since: 2.2)
4111 # Note: If action is "stop", a STOP event will eventually follow the
4112 # BLOCK_IO_ERROR event
4118 # <- { "event": "BLOCK_IO_ERROR",
4119 # "data": { "device": "ide0-hd1",
4120 # "node-name": "#block212",
4121 # "operation": "write",
4122 # "action": "stop" },
4123 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4126 { 'event': 'BLOCK_IO_ERROR',
4127 'data': { 'device': 'str', '*node-name': 'str',
4128 'operation': 'IoOperationType',
4129 'action': 'BlockErrorAction', '*nospace': 'bool',
4133 # @BLOCK_JOB_COMPLETED:
4135 # Emitted when a block job has completed
4139 # @device: The job identifier. Originally the device name but other
4140 # values are allowed since QEMU 2.7
4142 # @len: maximum progress value
4144 # @offset: current progress value. On success this is equal to len.
4145 # On failure this is less than len
4147 # @speed: rate limit, bytes per second
4149 # @error: error message. Only present on failure. This field
4150 # contains a human-readable error message. There are no semantics
4151 # other than that streaming has failed and clients should not try to
4152 # interpret the error string
4158 # <- { "event": "BLOCK_JOB_COMPLETED",
4159 # "data": { "type": "stream", "device": "virtio-disk0",
4160 # "len": 10737418240, "offset": 10737418240,
4162 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4165 { 'event': 'BLOCK_JOB_COMPLETED',
4166 'data': { 'type' : 'BlockJobType',
4174 # @BLOCK_JOB_CANCELLED:
4176 # Emitted when a block job has been cancelled
4180 # @device: The job identifier. Originally the device name but other
4181 # values are allowed since QEMU 2.7
4183 # @len: maximum progress value
4185 # @offset: current progress value. On success this is equal to len.
4186 # On failure this is less than len
4188 # @speed: rate limit, bytes per second
4194 # <- { "event": "BLOCK_JOB_CANCELLED",
4195 # "data": { "type": "stream", "device": "virtio-disk0",
4196 # "len": 10737418240, "offset": 134217728,
4198 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4201 { 'event': 'BLOCK_JOB_CANCELLED',
4202 'data': { 'type' : 'BlockJobType',
4211 # Emitted when a block job encounters an error
4213 # @device: The job identifier. Originally the device name but other
4214 # values are allowed since QEMU 2.7
4216 # @operation: I/O operation
4218 # @action: action that has been taken
4224 # <- { "event": "BLOCK_JOB_ERROR",
4225 # "data": { "device": "ide0-hd1",
4226 # "operation": "write",
4227 # "action": "stop" },
4228 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4231 { 'event': 'BLOCK_JOB_ERROR',
4232 'data': { 'device' : 'str',
4233 'operation': 'IoOperationType',
4234 'action' : 'BlockErrorAction' } }
4239 # Emitted when a block job is ready to complete
4243 # @device: The job identifier. Originally the device name but other
4244 # values are allowed since QEMU 2.7
4246 # @len: maximum progress value
4248 # @offset: current progress value. On success this is equal to len.
4249 # On failure this is less than len
4251 # @speed: rate limit, bytes per second
4253 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
4260 # <- { "event": "BLOCK_JOB_READY",
4261 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
4262 # "len": 2097152, "offset": 2097152 }
4263 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4266 { 'event': 'BLOCK_JOB_READY',
4267 'data': { 'type' : 'BlockJobType',
4274 # @BLOCK_JOB_PENDING:
4276 # Emitted when a block job is awaiting explicit authorization to finalize graph
4277 # changes via @block-job-finalize. If this job is part of a transaction, it will
4278 # not emit this event until the transaction has converged first.
4282 # @id: The job identifier.
4288 # <- { "event": "BLOCK_JOB_WAITING",
4289 # "data": { "device": "drive0", "type": "mirror" },
4290 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4293 { 'event': 'BLOCK_JOB_PENDING',
4294 'data': { 'type' : 'BlockJobType',
4300 # Preallocation mode of QEMU image file
4302 # @off: no preallocation
4303 # @metadata: preallocate only for metadata
4304 # @falloc: like @full preallocation but allocate disk space by
4305 # posix_fallocate() rather than writing zeros.
4306 # @full: preallocate all data by writing zeros to device to ensure disk
4307 # space is really available. @full preallocation also sets up
4308 # metadata correctly.
4312 { 'enum': 'PreallocMode',
4313 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
4316 # @BLOCK_WRITE_THRESHOLD:
4318 # Emitted when writes on block device reaches or exceeds the
4319 # configured write threshold. For thin-provisioned devices, this
4320 # means the device should be extended to avoid pausing for
4322 # The event is one shot. Once triggered, it needs to be
4323 # re-registered with another block-set-write-threshold command.
4325 # @node-name: graph node name on which the threshold was exceeded.
4327 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
4329 # @write-threshold: last configured threshold, in bytes.
4333 { 'event': 'BLOCK_WRITE_THRESHOLD',
4334 'data': { 'node-name': 'str',
4335 'amount-exceeded': 'uint64',
4336 'write-threshold': 'uint64' } }
4339 # @block-set-write-threshold:
4341 # Change the write threshold for a block drive. An event will be
4342 # delivered if a write to this block drive crosses the configured
4343 # threshold. The threshold is an offset, thus must be
4344 # non-negative. Default is no write threshold. Setting the threshold
4345 # to zero disables it.
4347 # This is useful to transparently resize thin-provisioned drives without
4348 # the guest OS noticing.
4350 # @node-name: graph node name on which the threshold must be set.
4352 # @write-threshold: configured threshold for the block device, bytes.
4353 # Use 0 to disable the threshold.
4359 # -> { "execute": "block-set-write-threshold",
4360 # "arguments": { "node-name": "mydev",
4361 # "write-threshold": 17179869184 } }
4362 # <- { "return": {} }
4365 { 'command': 'block-set-write-threshold',
4366 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
4369 # @x-blockdev-change:
4371 # Dynamically reconfigure the block driver state graph. It can be used
4372 # to add, remove, insert or replace a graph node. Currently only the
4373 # Quorum driver implements this feature to add or remove its child. This
4374 # is useful to fix a broken quorum child.
4376 # If @node is specified, it will be inserted under @parent. @child
4377 # may not be specified in this case. If both @parent and @child are
4378 # specified but @node is not, @child will be detached from @parent.
4380 # @parent: the id or name of the parent node.
4382 # @child: the name of a child under the given parent node.
4384 # @node: the name of the node that will be added.
4386 # Note: this command is experimental, and its API is not stable. It
4387 # does not support all kinds of operations, all kinds of children, nor
4388 # all block drivers.
4390 # FIXME Removing children from a quorum node means introducing gaps in the
4391 # child indices. This cannot be represented in the 'children' list of
4392 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
4394 # Warning: The data in a new quorum child MUST be consistent with that of
4395 # the rest of the array.
4401 # 1. Add a new node to a quorum
4402 # -> { "execute": "blockdev-add",
4405 # "node-name": "new_node",
4406 # "file": { "driver": "file",
4407 # "filename": "test.raw" } } }
4408 # <- { "return": {} }
4409 # -> { "execute": "x-blockdev-change",
4410 # "arguments": { "parent": "disk1",
4411 # "node": "new_node" } }
4412 # <- { "return": {} }
4414 # 2. Delete a quorum's node
4415 # -> { "execute": "x-blockdev-change",
4416 # "arguments": { "parent": "disk1",
4417 # "child": "children.1" } }
4418 # <- { "return": {} }
4421 { 'command': 'x-blockdev-change',
4422 'data' : { 'parent': 'str',
4427 # @x-blockdev-set-iothread:
4429 # Move @node and its children into the @iothread. If @iothread is null then
4430 # move @node and its children into the main loop.
4432 # The node must not be attached to a BlockBackend.
4434 # @node-name: the name of the block driver node
4436 # @iothread: the name of the IOThread object or null for the main loop
4438 # @force: true if the node and its children should be moved when a BlockBackend
4439 # is already attached
4441 # Note: this command is experimental and intended for test cases that need
4442 # control over IOThreads only.
4448 # 1. Move a node into an IOThread
4449 # -> { "execute": "x-blockdev-set-iothread",
4450 # "arguments": { "node-name": "disk1",
4451 # "iothread": "iothread0" } }
4452 # <- { "return": {} }
4454 # 2. Move a node into the main loop
4455 # -> { "execute": "x-blockdev-set-iothread",
4456 # "arguments": { "node-name": "disk1",
4457 # "iothread": null } }
4458 # <- { "return": {} }
4461 { 'command': 'x-blockdev-set-iothread',
4462 'data' : { 'node-name': 'str',
4463 'iothread': 'StrOrNull',
4464 '*force': 'bool' } }