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
978 { 'enum': 'BlockJobVerb',
979 'data': ['cancel', 'pause', 'resume', 'set-speed', 'complete' ] }
984 # Indicates the present state of a given blockjob in its lifetime.
986 # @undefined: Erroneous, default state. Should not ever be visible.
988 # @created: The job has been created, but not yet started.
990 # @running: The job is currently running.
992 # @paused: The job is running, but paused. The pause may be requested by
993 # either the QMP user or by internal processes.
995 # @ready: The job is running, but is ready for the user to signal completion.
996 # This is used for long-running jobs like mirror that are designed to
999 # @standby: The job is ready, but paused. This is nearly identical to @paused.
1000 # The job may return to @ready or otherwise be canceled.
1002 # @aborting: The job is in the process of being aborted, and will finish with
1004 # This status may not be visible to the management process.
1008 { 'enum': 'BlockJobStatus',
1009 'data': ['undefined', 'created', 'running', 'paused', 'ready', 'standby',
1015 # Information about a long-running block device operation.
1017 # @type: the job type ('stream' for image streaming)
1019 # @device: The job identifier. Originally the device name but other
1020 # values are allowed since QEMU 2.7
1022 # @len: the maximum progress value
1024 # @busy: false if the job is known to be in a quiescent state, with
1025 # no pending I/O. Since 1.3.
1027 # @paused: whether the job is paused or, if @busy is true, will
1028 # pause itself as soon as possible. Since 1.3.
1030 # @offset: the current progress value
1032 # @speed: the rate limit, bytes per second
1034 # @io-status: the status of the job (since 1.3)
1036 # @ready: true if the job may be completed (since 2.2)
1038 # @status: Current job state/status (since 2.12)
1042 { 'struct': 'BlockJobInfo',
1043 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1044 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1045 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1046 'status': 'BlockJobStatus' } }
1049 # @query-block-jobs:
1051 # Return information about long-running block device operations.
1053 # Returns: a list of @BlockJobInfo for each active block job
1057 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1062 # This command sets the password of a block device that has not been open
1063 # with a password and requires one.
1065 # This command is now obsolete and will always return an error since 2.10
1068 { 'command': 'block_passwd', 'data': {'*device': 'str',
1069 '*node-name': 'str', 'password': 'str'} }
1074 # Resize a block image while a guest is running.
1076 # Either @device or @node-name must be set but not both.
1078 # @device: the name of the device to get the image resized
1080 # @node-name: graph node name to get the image resized (Since 2.0)
1082 # @size: new image size in bytes
1084 # Returns: nothing on success
1085 # If @device is not a valid block device, DeviceNotFound
1091 # -> { "execute": "block_resize",
1092 # "arguments": { "device": "scratch", "size": 1073741824 } }
1093 # <- { "return": {} }
1096 { 'command': 'block_resize', 'data': { '*device': 'str',
1097 '*node-name': 'str',
1103 # An enumeration that tells QEMU how to set the backing file path in
1106 # @existing: QEMU should look for an existing image file.
1108 # @absolute-paths: QEMU should create a new image with absolute paths
1109 # for the backing file. If there is no backing file available, the new
1110 # image will not be backed either.
1114 { 'enum': 'NewImageMode',
1115 'data': [ 'existing', 'absolute-paths' ] }
1118 # @BlockdevSnapshotSync:
1120 # Either @device or @node-name must be set but not both.
1122 # @device: the name of the device to generate the snapshot from.
1124 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1126 # @snapshot-file: the target of the new image. If the file exists, or
1127 # if it is a device, the snapshot will be created in the existing
1128 # file/device. Otherwise, a new file will be created.
1130 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1132 # @format: the format of the snapshot image, default is 'qcow2'.
1134 # @mode: whether and how QEMU should create a new image, default is
1137 { 'struct': 'BlockdevSnapshotSync',
1138 'data': { '*device': 'str', '*node-name': 'str',
1139 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1140 '*format': 'str', '*mode': 'NewImageMode' } }
1143 # @BlockdevSnapshot:
1145 # @node: device or node name that will have a snapshot created.
1147 # @overlay: reference to the existing block device that will become
1148 # the overlay of @node, as part of creating the snapshot.
1149 # It must not have a current backing file (this can be
1150 # achieved by passing "backing": "" to blockdev-add).
1154 { 'struct': 'BlockdevSnapshot',
1155 'data': { 'node': 'str', 'overlay': 'str' } }
1160 # @job-id: identifier for the newly-created block job. If
1161 # omitted, the device name will be used. (Since 2.7)
1163 # @device: the device name or node-name of a root node which should be copied.
1165 # @target: the target of the new image. If the file exists, or if it
1166 # is a device, the existing file/device will be used as the new
1167 # destination. If it does not exist, a new file will be created.
1169 # @format: the format of the new destination, default is to
1170 # probe if @mode is 'existing', else the format of the source
1172 # @sync: what parts of the disk image should be copied to the destination
1173 # (all the disk, only the sectors allocated in the topmost image, from a
1174 # dirty bitmap, or only new I/O).
1176 # @mode: whether and how QEMU should create a new image, default is
1179 # @speed: the maximum speed, in bytes per second
1181 # @bitmap: the name of dirty bitmap if sync is "incremental".
1182 # Must be present if sync is "incremental", must NOT be present
1183 # otherwise. (Since 2.4)
1185 # @compress: true to compress data, if the target format supports it.
1186 # (default: false) (since 2.8)
1188 # @on-source-error: the action to take on an error on the source,
1189 # default 'report'. 'stop' and 'enospc' can only be used
1190 # if the block device supports io-status (see BlockInfo).
1192 # @on-target-error: the action to take on an error on the target,
1193 # default 'report' (no limitations, since this applies to
1194 # a different block device than @device).
1196 # Note: @on-source-error and @on-target-error only affect background
1197 # I/O. If an error occurs during a guest write request, the device's
1198 # rerror/werror actions will be used.
1202 { 'struct': 'DriveBackup',
1203 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1204 '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1205 '*speed': 'int', '*bitmap': 'str', '*compress': 'bool',
1206 '*on-source-error': 'BlockdevOnError',
1207 '*on-target-error': 'BlockdevOnError' } }
1212 # @job-id: identifier for the newly-created block job. If
1213 # omitted, the device name will be used. (Since 2.7)
1215 # @device: the device name or node-name of a root node which should be copied.
1217 # @target: the device name or node-name of the backup target node.
1219 # @sync: what parts of the disk image should be copied to the destination
1220 # (all the disk, only the sectors allocated in the topmost image, or
1223 # @speed: the maximum speed, in bytes per second. The default is 0,
1226 # @compress: true to compress data, if the target format supports it.
1227 # (default: false) (since 2.8)
1229 # @on-source-error: the action to take on an error on the source,
1230 # default 'report'. 'stop' and 'enospc' can only be used
1231 # if the block device supports io-status (see BlockInfo).
1233 # @on-target-error: the action to take on an error on the target,
1234 # default 'report' (no limitations, since this applies to
1235 # a different block device than @device).
1237 # Note: @on-source-error and @on-target-error only affect background
1238 # I/O. If an error occurs during a guest write request, the device's
1239 # rerror/werror actions will be used.
1243 { 'struct': 'BlockdevBackup',
1244 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1245 'sync': 'MirrorSyncMode',
1247 '*compress': 'bool',
1248 '*on-source-error': 'BlockdevOnError',
1249 '*on-target-error': 'BlockdevOnError' } }
1252 # @blockdev-snapshot-sync:
1254 # Generates a synchronous snapshot of a block device.
1256 # For the arguments, see the documentation of BlockdevSnapshotSync.
1258 # Returns: nothing on success
1259 # If @device is not a valid block device, DeviceNotFound
1265 # -> { "execute": "blockdev-snapshot-sync",
1266 # "arguments": { "device": "ide-hd0",
1268 # "/some/place/my-image",
1269 # "format": "qcow2" } }
1270 # <- { "return": {} }
1273 { 'command': 'blockdev-snapshot-sync',
1274 'data': 'BlockdevSnapshotSync' }
1278 # @blockdev-snapshot:
1280 # Generates a snapshot of a block device.
1282 # Create a snapshot, by installing 'node' as the backing image of
1283 # 'overlay'. Additionally, if 'node' is associated with a block
1284 # device, the block device changes to using 'overlay' as its new active
1287 # For the arguments, see the documentation of BlockdevSnapshot.
1293 # -> { "execute": "blockdev-add",
1294 # "arguments": { "driver": "qcow2",
1295 # "node-name": "node1534",
1296 # "file": { "driver": "file",
1297 # "filename": "hd1.qcow2" },
1300 # <- { "return": {} }
1302 # -> { "execute": "blockdev-snapshot",
1303 # "arguments": { "node": "ide-hd0",
1304 # "overlay": "node1534" } }
1305 # <- { "return": {} }
1308 { 'command': 'blockdev-snapshot',
1309 'data': 'BlockdevSnapshot' }
1312 # @change-backing-file:
1314 # Change the backing file in the image file metadata. This does not
1315 # cause QEMU to reopen the image file to reparse the backing filename
1316 # (it may, however, perform a reopen to change permissions from
1317 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1318 # into the image file metadata, and the QEMU internal strings are
1321 # @image-node-name: The name of the block driver state node of the
1322 # image to modify. The "device" argument is used
1323 # to verify "image-node-name" is in the chain
1324 # described by "device".
1326 # @device: The device name or node-name of the root node that owns
1329 # @backing-file: The string to write as the backing file. This
1330 # string is not validated, so care should be taken
1331 # when specifying the string or the image chain may
1332 # not be able to be reopened again.
1334 # Returns: Nothing on success
1336 # If "device" does not exist or cannot be determined, DeviceNotFound
1340 { 'command': 'change-backing-file',
1341 'data': { 'device': 'str', 'image-node-name': 'str',
1342 'backing-file': 'str' } }
1347 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1348 # writes data between 'top' and 'base' into 'base'.
1350 # @job-id: identifier for the newly-created block job. If
1351 # omitted, the device name will be used. (Since 2.7)
1353 # @device: the device name or node-name of a root node
1355 # @base: The file name of the backing image to write data into.
1356 # If not specified, this is the deepest backing image.
1358 # @top: The file name of the backing image within the image chain,
1359 # which contains the topmost data to be committed down. If
1360 # not specified, this is the active layer.
1362 # @backing-file: The backing file string to write into the overlay
1363 # image of 'top'. If 'top' is the active layer,
1364 # specifying a backing file string is an error. This
1365 # filename is not validated.
1367 # If a pathname string is such that it cannot be
1368 # resolved by QEMU, that means that subsequent QMP or
1369 # HMP commands must use node-names for the image in
1370 # question, as filename lookup methods will fail.
1372 # If not specified, QEMU will automatically determine
1373 # the backing file string to use, or error out if
1374 # there is no obvious choice. Care should be taken
1375 # when specifying the string, to specify a valid
1376 # filename or protocol.
1379 # If top == base, that is an error.
1380 # If top == active, the job will not be completed by itself,
1381 # user needs to complete the job with the block-job-complete
1382 # command after getting the ready event. (Since 2.0)
1384 # If the base image is smaller than top, then the base image
1385 # will be resized to be the same size as top. If top is
1386 # smaller than the base image, the base will not be
1387 # truncated. If you want the base image size to match the
1388 # size of the smaller top, you can safely truncate it
1389 # yourself once the commit operation successfully completes.
1391 # @speed: the maximum speed, in bytes per second
1393 # @filter-node-name: the node name that should be assigned to the
1394 # filter driver that the commit job inserts into the graph
1395 # above @top. If this option is not given, a node name is
1396 # autogenerated. (Since: 2.9)
1398 # Returns: Nothing on success
1399 # If commit or stream is already active on this device, DeviceInUse
1400 # If @device does not exist, DeviceNotFound
1401 # If image commit is not supported by this device, NotSupported
1402 # If @base or @top is invalid, a generic error is returned
1403 # If @speed is invalid, InvalidParameter
1409 # -> { "execute": "block-commit",
1410 # "arguments": { "device": "virtio0",
1411 # "top": "/tmp/snap1.qcow2" } }
1412 # <- { "return": {} }
1415 { 'command': 'block-commit',
1416 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
1417 '*backing-file': 'str', '*speed': 'int',
1418 '*filter-node-name': 'str' } }
1423 # Start a point-in-time copy of a block device to a new destination. The
1424 # status of ongoing drive-backup operations can be checked with
1425 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1426 # The operation can be stopped before it has completed using the
1427 # block-job-cancel command.
1429 # Returns: nothing on success
1430 # If @device is not a valid block device, GenericError
1436 # -> { "execute": "drive-backup",
1437 # "arguments": { "device": "drive0",
1439 # "target": "backup.img" } }
1440 # <- { "return": {} }
1443 { 'command': 'drive-backup', 'boxed': true,
1444 'data': 'DriveBackup' }
1449 # Start a point-in-time copy of a block device to a new destination. The
1450 # status of ongoing blockdev-backup operations can be checked with
1451 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1452 # The operation can be stopped before it has completed using the
1453 # block-job-cancel command.
1455 # Returns: nothing on success
1456 # If @device is not a valid block device, DeviceNotFound
1461 # -> { "execute": "blockdev-backup",
1462 # "arguments": { "device": "src-id",
1464 # "target": "tgt-id" } }
1465 # <- { "return": {} }
1468 { 'command': 'blockdev-backup', 'boxed': true,
1469 'data': 'BlockdevBackup' }
1473 # @query-named-block-nodes:
1475 # Get the named block driver list
1477 # Returns: the list of BlockDeviceInfo
1483 # -> { "execute": "query-named-block-nodes" }
1484 # <- { "return": [ { "ro":false,
1486 # "encrypted":false,
1487 # "file":"disks/test.qcow2",
1488 # "node-name": "my-node",
1489 # "backing_file_depth":1,
1496 # "bps_max": 8000000,
1503 # "write_threshold": 0,
1505 # "filename":"disks/test.qcow2",
1507 # "virtual-size":2048000,
1508 # "backing_file":"base.qcow2",
1509 # "full-backing-filename":"disks/base.qcow2",
1510 # "backing-filename-format":"qcow2",
1514 # "name": "snapshot1",
1515 # "vm-state-size": 0,
1516 # "date-sec": 10000200,
1518 # "vm-clock-sec": 206,
1519 # "vm-clock-nsec": 30
1523 # "filename":"disks/base.qcow2",
1525 # "virtual-size":2048000
1530 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1535 # Start mirroring a block device's writes to a new destination. target
1536 # specifies the target of the new image. If the file exists, or if it
1537 # is a device, it will be used as the new destination for writes. If
1538 # it does not exist, a new file will be created. format specifies the
1539 # format of the mirror image, default is to probe if mode='existing',
1540 # else the format of the source.
1542 # Returns: nothing on success
1543 # If @device is not a valid block device, GenericError
1549 # -> { "execute": "drive-mirror",
1550 # "arguments": { "device": "ide-hd0",
1551 # "target": "/some/place/my-image",
1553 # "format": "qcow2" } }
1554 # <- { "return": {} }
1557 { 'command': 'drive-mirror', 'boxed': true,
1558 'data': 'DriveMirror' }
1563 # A set of parameters describing drive mirror setup.
1565 # @job-id: identifier for the newly-created block job. If
1566 # omitted, the device name will be used. (Since 2.7)
1568 # @device: the device name or node-name of a root node whose writes should be
1571 # @target: the target of the new image. If the file exists, or if it
1572 # is a device, the existing file/device will be used as the new
1573 # destination. If it does not exist, a new file will be created.
1575 # @format: the format of the new destination, default is to
1576 # probe if @mode is 'existing', else the format of the source
1578 # @node-name: the new block driver state node name in the graph
1581 # @replaces: with sync=full graph node name to be replaced by the new
1582 # image when a whole image copy is done. This can be used to repair
1583 # broken Quorum files. (Since 2.1)
1585 # @mode: whether and how QEMU should create a new image, default is
1588 # @speed: the maximum speed, in bytes per second
1590 # @sync: what parts of the disk image should be copied to the destination
1591 # (all the disk, only the sectors allocated in the topmost image, or
1594 # @granularity: granularity of the dirty bitmap, default is 64K
1595 # if the image format doesn't have clusters, 4K if the clusters
1596 # are smaller than that, else the cluster size. Must be a
1597 # power of 2 between 512 and 64M (since 1.4).
1599 # @buf-size: maximum amount of data in flight from source to
1600 # target (since 1.4).
1602 # @on-source-error: the action to take on an error on the source,
1603 # default 'report'. 'stop' and 'enospc' can only be used
1604 # if the block device supports io-status (see BlockInfo).
1606 # @on-target-error: the action to take on an error on the target,
1607 # default 'report' (no limitations, since this applies to
1608 # a different block device than @device).
1609 # @unmap: Whether to try to unmap target sectors where source has
1610 # only zero. If true, and target unallocated sectors will read as zero,
1611 # target image sectors will be unmapped; otherwise, zeroes will be
1612 # written. Both will result in identical contents.
1613 # Default is true. (Since 2.4)
1617 { 'struct': 'DriveMirror',
1618 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1619 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1620 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1621 '*speed': 'int', '*granularity': 'uint32',
1622 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1623 '*on-target-error': 'BlockdevOnError',
1624 '*unmap': 'bool' } }
1627 # @BlockDirtyBitmap:
1629 # @node: name of device/node which the bitmap is tracking
1631 # @name: name of the dirty bitmap
1635 { 'struct': 'BlockDirtyBitmap',
1636 'data': { 'node': 'str', 'name': 'str' } }
1639 # @BlockDirtyBitmapAdd:
1641 # @node: name of device/node which the bitmap is tracking
1643 # @name: name of the dirty bitmap
1645 # @granularity: the bitmap granularity, default is 64k for
1646 # block-dirty-bitmap-add
1648 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1649 # corresponding block device image file on its close. For now only
1650 # Qcow2 disks support persistent bitmaps. Default is false for
1651 # block-dirty-bitmap-add. (Since: 2.10)
1653 # @autoload: ignored and deprecated since 2.12.
1654 # Currently, all dirty tracking bitmaps are loaded from Qcow2 on
1659 { 'struct': 'BlockDirtyBitmapAdd',
1660 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1661 '*persistent': 'bool', '*autoload': 'bool' } }
1664 # @block-dirty-bitmap-add:
1666 # Create a dirty bitmap with a name on the node, and start tracking the writes.
1668 # Returns: nothing on success
1669 # If @node is not a valid block device or node, DeviceNotFound
1670 # If @name is already taken, GenericError with an explanation
1676 # -> { "execute": "block-dirty-bitmap-add",
1677 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1678 # <- { "return": {} }
1681 { 'command': 'block-dirty-bitmap-add',
1682 'data': 'BlockDirtyBitmapAdd' }
1685 # @block-dirty-bitmap-remove:
1687 # Stop write tracking and remove the dirty bitmap that was created
1688 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
1691 # Returns: nothing on success
1692 # If @node is not a valid block device or node, DeviceNotFound
1693 # If @name is not found, GenericError with an explanation
1694 # if @name is frozen by an operation, GenericError
1700 # -> { "execute": "block-dirty-bitmap-remove",
1701 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1702 # <- { "return": {} }
1705 { 'command': 'block-dirty-bitmap-remove',
1706 'data': 'BlockDirtyBitmap' }
1709 # @block-dirty-bitmap-clear:
1711 # Clear (reset) a dirty bitmap on the device, so that an incremental
1712 # backup from this point in time forward will only backup clusters
1713 # modified after this clear operation.
1715 # Returns: nothing on success
1716 # If @node is not a valid block device, DeviceNotFound
1717 # If @name is not found, GenericError with an explanation
1723 # -> { "execute": "block-dirty-bitmap-clear",
1724 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1725 # <- { "return": {} }
1728 { 'command': 'block-dirty-bitmap-clear',
1729 'data': 'BlockDirtyBitmap' }
1732 # @BlockDirtyBitmapSha256:
1734 # SHA256 hash of dirty bitmap data
1736 # @sha256: ASCII representation of SHA256 bitmap hash
1740 { 'struct': 'BlockDirtyBitmapSha256',
1741 'data': {'sha256': 'str'} }
1744 # @x-debug-block-dirty-bitmap-sha256:
1748 # Returns: BlockDirtyBitmapSha256 on success
1749 # If @node is not a valid block device, DeviceNotFound
1750 # If @name is not found or if hashing has failed, GenericError with an
1755 { 'command': 'x-debug-block-dirty-bitmap-sha256',
1756 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
1761 # Start mirroring a block device's writes to a new destination.
1763 # @job-id: identifier for the newly-created block job. If
1764 # omitted, the device name will be used. (Since 2.7)
1766 # @device: The device name or node-name of a root node whose writes should be
1769 # @target: the id or node-name of the block device to mirror to. This mustn't be
1770 # attached to guest.
1772 # @replaces: with sync=full graph node name to be replaced by the new
1773 # image when a whole image copy is done. This can be used to repair
1774 # broken Quorum files.
1776 # @speed: the maximum speed, in bytes per second
1778 # @sync: what parts of the disk image should be copied to the destination
1779 # (all the disk, only the sectors allocated in the topmost image, or
1782 # @granularity: granularity of the dirty bitmap, default is 64K
1783 # if the image format doesn't have clusters, 4K if the clusters
1784 # are smaller than that, else the cluster size. Must be a
1785 # power of 2 between 512 and 64M
1787 # @buf-size: maximum amount of data in flight from source to
1790 # @on-source-error: the action to take on an error on the source,
1791 # default 'report'. 'stop' and 'enospc' can only be used
1792 # if the block device supports io-status (see BlockInfo).
1794 # @on-target-error: the action to take on an error on the target,
1795 # default 'report' (no limitations, since this applies to
1796 # a different block device than @device).
1798 # @filter-node-name: the node name that should be assigned to the
1799 # filter driver that the mirror job inserts into the graph
1800 # above @device. If this option is not given, a node name is
1801 # autogenerated. (Since: 2.9)
1803 # Returns: nothing on success.
1809 # -> { "execute": "blockdev-mirror",
1810 # "arguments": { "device": "ide-hd0",
1811 # "target": "target0",
1812 # "sync": "full" } }
1813 # <- { "return": {} }
1816 { 'command': 'blockdev-mirror',
1817 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1819 'sync': 'MirrorSyncMode',
1820 '*speed': 'int', '*granularity': 'uint32',
1821 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1822 '*on-target-error': 'BlockdevOnError',
1823 '*filter-node-name': 'str' } }
1826 # @block_set_io_throttle:
1828 # Change I/O throttle limits for a block drive.
1830 # Since QEMU 2.4, each device with I/O limits is member of a throttle
1833 # If two or more devices are members of the same group, the limits
1834 # will apply to the combined I/O of the whole group in a round-robin
1835 # fashion. Therefore, setting new I/O limits to a device will affect
1838 # The name of the group can be specified using the 'group' parameter.
1839 # If the parameter is unset, it is assumed to be the current group of
1840 # that device. If it's not in any group yet, the name of the device
1841 # will be used as the name for its group.
1843 # The 'group' parameter can also be used to move a device to a
1844 # different group. In this case the limits specified in the parameters
1845 # will be applied to the new group only.
1847 # I/O limits can be disabled by setting all of them to 0. In this case
1848 # the device will be removed from its group and the rest of its
1849 # members will not be affected. The 'group' parameter is ignored.
1851 # Returns: Nothing on success
1852 # If @device is not a valid block device, DeviceNotFound
1858 # -> { "execute": "block_set_io_throttle",
1859 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
1872 # "bps_max_length": 0,
1873 # "iops_size": 0 } }
1874 # <- { "return": {} }
1876 # -> { "execute": "block_set_io_throttle",
1877 # "arguments": { "id": "ide0-1-0",
1884 # "bps_max": 8000000,
1890 # "bps_max_length": 60,
1891 # "iops_size": 0 } }
1892 # <- { "return": {} }
1894 { 'command': 'block_set_io_throttle', 'boxed': true,
1895 'data': 'BlockIOThrottle' }
1900 # A set of parameters describing block throttling.
1902 # @device: Block device name (deprecated, use @id instead)
1904 # @id: The name or QOM path of the guest device (since: 2.8)
1906 # @bps: total throughput limit in bytes per second
1908 # @bps_rd: read throughput limit in bytes per second
1910 # @bps_wr: write throughput limit in bytes per second
1912 # @iops: total I/O operations per second
1914 # @iops_rd: read I/O operations per second
1916 # @iops_wr: write I/O operations per second
1918 # @bps_max: total throughput limit during bursts,
1919 # in bytes (Since 1.7)
1921 # @bps_rd_max: read throughput limit during bursts,
1922 # in bytes (Since 1.7)
1924 # @bps_wr_max: write throughput limit during bursts,
1925 # in bytes (Since 1.7)
1927 # @iops_max: total I/O operations per second during bursts,
1928 # in bytes (Since 1.7)
1930 # @iops_rd_max: read I/O operations per second during bursts,
1931 # in bytes (Since 1.7)
1933 # @iops_wr_max: write I/O operations per second during bursts,
1934 # in bytes (Since 1.7)
1936 # @bps_max_length: maximum length of the @bps_max burst
1937 # period, in seconds. It must only
1938 # be set if @bps_max is set as well.
1939 # Defaults to 1. (Since 2.6)
1941 # @bps_rd_max_length: maximum length of the @bps_rd_max
1942 # burst period, in seconds. It must only
1943 # be set if @bps_rd_max is set as well.
1944 # Defaults to 1. (Since 2.6)
1946 # @bps_wr_max_length: maximum length of the @bps_wr_max
1947 # burst period, in seconds. It must only
1948 # be set if @bps_wr_max is set as well.
1949 # Defaults to 1. (Since 2.6)
1951 # @iops_max_length: maximum length of the @iops burst
1952 # period, in seconds. It must only
1953 # be set if @iops_max is set as well.
1954 # Defaults to 1. (Since 2.6)
1956 # @iops_rd_max_length: maximum length of the @iops_rd_max
1957 # burst period, in seconds. It must only
1958 # be set if @iops_rd_max is set as well.
1959 # Defaults to 1. (Since 2.6)
1961 # @iops_wr_max_length: maximum length of the @iops_wr_max
1962 # burst period, in seconds. It must only
1963 # be set if @iops_wr_max is set as well.
1964 # Defaults to 1. (Since 2.6)
1966 # @iops_size: an I/O size in bytes (Since 1.7)
1968 # @group: throttle group name (Since 2.4)
1972 { 'struct': 'BlockIOThrottle',
1973 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
1974 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
1975 '*bps_max': 'int', '*bps_rd_max': 'int',
1976 '*bps_wr_max': 'int', '*iops_max': 'int',
1977 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
1978 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
1979 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
1980 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
1981 '*iops_size': 'int', '*group': 'str' } }
1986 # Limit parameters for throttling.
1987 # Since some limit combinations are illegal, limits should always be set in one
1988 # transaction. All fields are optional. When setting limits, if a field is
1989 # missing the current value is not changed.
1991 # @iops-total: limit total I/O operations per second
1992 # @iops-total-max: I/O operations burst
1993 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
1994 # It must only be set if @iops-total-max is set as well.
1995 # @iops-read: limit read operations per second
1996 # @iops-read-max: I/O operations read burst
1997 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
1998 # It must only be set if @iops-read-max is set as well.
1999 # @iops-write: limit write operations per second
2000 # @iops-write-max: I/O operations write burst
2001 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2002 # It must only be set if @iops-write-max is set as well.
2003 # @bps-total: limit total bytes per second
2004 # @bps-total-max: total bytes burst
2005 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2006 # It must only be set if @bps-total-max is set as well.
2007 # @bps-read: limit read bytes per second
2008 # @bps-read-max: total bytes read burst
2009 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2010 # It must only be set if @bps-read-max is set as well.
2011 # @bps-write: limit write bytes per second
2012 # @bps-write-max: total bytes write burst
2013 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2014 # It must only be set if @bps-write-max is set as well.
2015 # @iops-size: when limiting by iops max size of an I/O in bytes
2019 { 'struct': 'ThrottleLimits',
2020 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2021 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2022 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2023 '*iops-write' : 'int', '*iops-write-max' : 'int',
2024 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2025 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2026 '*bps-read' : 'int', '*bps-read-max' : 'int',
2027 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2028 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2029 '*iops-size' : 'int' } }
2034 # Copy data from a backing file into a block device.
2036 # The block streaming operation is performed in the background until the entire
2037 # backing file has been copied. This command returns immediately once streaming
2038 # has started. The status of ongoing block streaming operations can be checked
2039 # with query-block-jobs. The operation can be stopped before it has completed
2040 # using the block-job-cancel command.
2042 # The node that receives the data is called the top image, can be located in
2043 # any part of the chain (but always above the base image; see below) and can be
2044 # specified using its device or node name. Earlier qemu versions only allowed
2045 # 'device' to name the top level node; presence of the 'base-node' parameter
2046 # during introspection can be used as a witness of the enhanced semantics
2049 # If a base file is specified then sectors are not copied from that base file and
2050 # its backing chain. When streaming completes the image file will have the base
2051 # file as its backing file. This can be used to stream a subset of the backing
2052 # file chain instead of flattening the entire image.
2054 # On successful completion the image file is updated to drop the backing file
2055 # and the BLOCK_JOB_COMPLETED event is emitted.
2057 # @job-id: identifier for the newly-created block job. If
2058 # omitted, the device name will be used. (Since 2.7)
2060 # @device: the device or node name of the top image
2062 # @base: the common backing file name.
2063 # It cannot be set if @base-node is also set.
2065 # @base-node: the node name of the backing file.
2066 # It cannot be set if @base is also set. (Since 2.8)
2068 # @backing-file: The backing file string to write into the top
2069 # image. This filename is not validated.
2071 # If a pathname string is such that it cannot be
2072 # resolved by QEMU, that means that subsequent QMP or
2073 # HMP commands must use node-names for the image in
2074 # question, as filename lookup methods will fail.
2076 # If not specified, QEMU will automatically determine
2077 # the backing file string to use, or error out if there
2078 # is no obvious choice. Care should be taken when
2079 # specifying the string, to specify a valid filename or
2083 # @speed: the maximum speed, in bytes per second
2085 # @on-error: the action to take on an error (default report).
2086 # 'stop' and 'enospc' can only be used if the block device
2087 # supports io-status (see BlockInfo). Since 1.3.
2089 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
2095 # -> { "execute": "block-stream",
2096 # "arguments": { "device": "virtio0",
2097 # "base": "/tmp/master.qcow2" } }
2098 # <- { "return": {} }
2101 { 'command': 'block-stream',
2102 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2103 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2104 '*on-error': 'BlockdevOnError' } }
2107 # @block-job-set-speed:
2109 # Set maximum speed for a background block operation.
2111 # This command can only be issued when there is an active block job.
2113 # Throttling can be disabled by setting the speed to 0.
2115 # @device: The job identifier. This used to be a device name (hence
2116 # the name of the parameter), but since QEMU 2.7 it can have
2119 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2122 # Returns: Nothing on success
2123 # If no background operation is active on this device, DeviceNotActive
2127 { 'command': 'block-job-set-speed',
2128 'data': { 'device': 'str', 'speed': 'int' } }
2131 # @block-job-cancel:
2133 # Stop an active background block operation.
2135 # This command returns immediately after marking the active background block
2136 # operation for cancellation. It is an error to call this command if no
2137 # operation is in progress.
2139 # The operation will cancel as soon as possible and then emit the
2140 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2141 # enumerated using query-block-jobs.
2143 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2144 # (via the event BLOCK_JOB_READY) that the source and destination are
2145 # synchronized, then the event triggered by this command changes to
2146 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2147 # destination now has a point-in-time copy tied to the time of the cancellation.
2149 # For streaming, the image file retains its backing file unless the streaming
2150 # operation happens to complete just as it is being cancelled. A new streaming
2151 # operation can be started at a later time to finish copying all data from the
2154 # @device: The job identifier. This used to be a device name (hence
2155 # the name of the parameter), but since QEMU 2.7 it can have
2158 # @force: whether to allow cancellation of a paused job (default
2159 # false). Since 1.3.
2161 # Returns: Nothing on success
2162 # If no background operation is active on this device, DeviceNotActive
2166 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2171 # Pause an active background block operation.
2173 # This command returns immediately after marking the active background block
2174 # operation for pausing. It is an error to call this command if no
2175 # operation is in progress. Pausing an already paused job has no cumulative
2176 # effect; a single block-job-resume command will resume the job.
2178 # The operation will pause as soon as possible. No event is emitted when
2179 # the operation is actually paused. Cancelling a paused job automatically
2182 # @device: The job identifier. This used to be a device name (hence
2183 # the name of the parameter), but since QEMU 2.7 it can have
2186 # Returns: Nothing on success
2187 # If no background operation is active on this device, DeviceNotActive
2191 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2194 # @block-job-resume:
2196 # Resume an active background block operation.
2198 # This command returns immediately after resuming a paused background block
2199 # operation. It is an error to call this command if no operation is in
2200 # progress. Resuming an already running job is not an error.
2202 # This command also clears the error status of the job.
2204 # @device: The job identifier. This used to be a device name (hence
2205 # the name of the parameter), but since QEMU 2.7 it can have
2208 # Returns: Nothing on success
2209 # If no background operation is active on this device, DeviceNotActive
2213 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2216 # @block-job-complete:
2218 # Manually trigger completion of an active background block operation. This
2219 # is supported for drive mirroring, where it also switches the device to
2220 # write to the target path only. The ability to complete is signaled with
2221 # a BLOCK_JOB_READY event.
2223 # This command completes an active background block operation synchronously.
2224 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2225 # is not defined. Note that if an I/O error occurs during the processing of
2226 # this command: 1) the command itself will fail; 2) the error will be processed
2227 # according to the rerror/werror arguments that were specified when starting
2230 # A cancelled or paused job cannot be completed.
2232 # @device: The job identifier. This used to be a device name (hence
2233 # the name of the parameter), but since QEMU 2.7 it can have
2236 # Returns: Nothing on success
2237 # If no background operation is active on this device, DeviceNotActive
2241 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2244 # @BlockdevDiscardOptions:
2246 # Determines how to handle discard requests.
2248 # @ignore: Ignore the request
2249 # @unmap: Forward as an unmap request
2253 { 'enum': 'BlockdevDiscardOptions',
2254 'data': [ 'ignore', 'unmap' ] }
2257 # @BlockdevDetectZeroesOptions:
2259 # Describes the operation mode for the automatic conversion of plain
2260 # zero writes by the OS to driver specific optimized zero write commands.
2262 # @off: Disabled (default)
2264 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2265 # also that @BlockdevDiscardOptions is set to unmap for this device.
2269 { 'enum': 'BlockdevDetectZeroesOptions',
2270 'data': [ 'off', 'on', 'unmap' ] }
2273 # @BlockdevAioOptions:
2275 # Selects the AIO backend to handle I/O requests
2277 # @threads: Use qemu's thread pool
2278 # @native: Use native AIO backend (only Linux and Windows)
2282 { 'enum': 'BlockdevAioOptions',
2283 'data': [ 'threads', 'native' ] }
2286 # @BlockdevCacheOptions:
2288 # Includes cache-related options for block devices
2290 # @direct: enables use of O_DIRECT (bypass the host page cache;
2292 # @no-flush: ignore any flush requests for the device (default:
2297 { 'struct': 'BlockdevCacheOptions',
2298 'data': { '*direct': 'bool',
2299 '*no-flush': 'bool' } }
2304 # Drivers that are supported in block device operations.
2307 # @throttle: Since 2.11
2312 { 'enum': 'BlockdevDriver',
2313 'data': [ 'blkdebug', 'blkverify', 'bochs', 'cloop',
2314 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
2315 'host_device', 'http', 'https', 'iscsi', 'luks', 'nbd', 'nfs',
2316 'null-aio', 'null-co', 'nvme', 'parallels', 'qcow', 'qcow2', 'qed',
2317 'quorum', 'raw', 'rbd', 'replication', 'sheepdog', 'ssh',
2318 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2321 # @BlockdevOptionsFile:
2323 # Driver specific block device options for the file backend.
2325 # @filename: path to the image file
2326 # @pr-manager: the id for the object that will handle persistent reservations
2327 # for this device (default: none, forward the commands via SG_IO;
2329 # @aio: AIO backend (default: threads) (since: 2.8)
2330 # @locking: whether to enable file locking. If set to 'auto', only enable
2331 # when Open File Descriptor (OFD) locking API is available
2332 # (default: auto, since 2.10)
2336 { 'struct': 'BlockdevOptionsFile',
2337 'data': { 'filename': 'str',
2338 '*pr-manager': 'str',
2339 '*locking': 'OnOffAuto',
2340 '*aio': 'BlockdevAioOptions' } }
2343 # @BlockdevOptionsNull:
2345 # Driver specific block device options for the null backend.
2347 # @size: size of the device in bytes.
2348 # @latency-ns: emulated latency (in nanoseconds) in processing
2349 # requests. Default to zero which completes requests immediately.
2354 { 'struct': 'BlockdevOptionsNull',
2355 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
2358 # @BlockdevOptionsNVMe:
2360 # Driver specific block device options for the NVMe backend.
2362 # @device: controller address of the NVMe device.
2363 # @namespace: namespace number of the device, starting from 1.
2367 { 'struct': 'BlockdevOptionsNVMe',
2368 'data': { 'device': 'str', 'namespace': 'int' } }
2371 # @BlockdevOptionsVVFAT:
2373 # Driver specific block device options for the vvfat protocol.
2375 # @dir: directory to be exported as FAT image
2376 # @fat-type: FAT type: 12, 16 or 32
2377 # @floppy: whether to export a floppy image (true) or
2378 # partitioned hard disk (false; default)
2379 # @label: set the volume label, limited to 11 bytes. FAT16 and
2380 # FAT32 traditionally have some restrictions on labels, which are
2381 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2383 # @rw: whether to allow write operations (default: false)
2387 { 'struct': 'BlockdevOptionsVVFAT',
2388 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2389 '*label': 'str', '*rw': 'bool' } }
2392 # @BlockdevOptionsGenericFormat:
2394 # Driver specific block device options for image format that have no option
2395 # besides their data source.
2397 # @file: reference to or definition of the data source block device
2401 { 'struct': 'BlockdevOptionsGenericFormat',
2402 'data': { 'file': 'BlockdevRef' } }
2405 # @BlockdevOptionsLUKS:
2407 # Driver specific block device options for LUKS.
2409 # @key-secret: the ID of a QCryptoSecret object providing
2410 # the decryption key (since 2.6). Mandatory except when
2411 # doing a metadata-only probe of the image.
2415 { 'struct': 'BlockdevOptionsLUKS',
2416 'base': 'BlockdevOptionsGenericFormat',
2417 'data': { '*key-secret': 'str' } }
2421 # @BlockdevOptionsGenericCOWFormat:
2423 # Driver specific block device options for image format that have no option
2424 # besides their data source and an optional backing file.
2426 # @backing: reference to or definition of the backing file block
2427 # device, null disables the backing file entirely.
2428 # Defaults to the backing file stored the image file.
2432 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2433 'base': 'BlockdevOptionsGenericFormat',
2434 'data': { '*backing': 'BlockdevRefOrNull' } }
2437 # @Qcow2OverlapCheckMode:
2439 # General overlap check modes.
2441 # @none: Do not perform any checks
2443 # @constant: Perform only checks which can be done in constant time and
2444 # without reading anything from disk
2446 # @cached: Perform only checks which can be done without reading anything
2449 # @all: Perform all available overlap checks
2453 { 'enum': 'Qcow2OverlapCheckMode',
2454 'data': [ 'none', 'constant', 'cached', 'all' ] }
2457 # @Qcow2OverlapCheckFlags:
2459 # Structure of flags for each metadata structure. Setting a field to 'true'
2460 # makes qemu guard that structure against unintended overwriting. The default
2461 # value is chosen according to the template given.
2463 # @template: Specifies a template mode which can be adjusted using the other
2464 # flags, defaults to 'cached'
2468 { 'struct': 'Qcow2OverlapCheckFlags',
2469 'data': { '*template': 'Qcow2OverlapCheckMode',
2470 '*main-header': 'bool',
2471 '*active-l1': 'bool',
2472 '*active-l2': 'bool',
2473 '*refcount-table': 'bool',
2474 '*refcount-block': 'bool',
2475 '*snapshot-table': 'bool',
2476 '*inactive-l1': 'bool',
2477 '*inactive-l2': 'bool' } }
2480 # @Qcow2OverlapChecks:
2482 # Specifies which metadata structures should be guarded against unintended
2485 # @flags: set of flags for separate specification of each metadata structure
2488 # @mode: named mode which chooses a specific set of flags
2492 { 'alternate': 'Qcow2OverlapChecks',
2493 'data': { 'flags': 'Qcow2OverlapCheckFlags',
2494 'mode': 'Qcow2OverlapCheckMode' } }
2497 # @BlockdevQcowEncryptionFormat:
2499 # @aes: AES-CBC with plain64 initialization vectors
2503 { 'enum': 'BlockdevQcowEncryptionFormat',
2507 # @BlockdevQcowEncryption:
2511 { 'union': 'BlockdevQcowEncryption',
2512 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
2513 'discriminator': 'format',
2514 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
2517 # @BlockdevOptionsQcow:
2519 # Driver specific block device options for qcow.
2521 # @encrypt: Image decryption options. Mandatory for
2522 # encrypted images, except when doing a metadata-only
2523 # probe of the image.
2527 { 'struct': 'BlockdevOptionsQcow',
2528 'base': 'BlockdevOptionsGenericCOWFormat',
2529 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
2534 # @BlockdevQcow2EncryptionFormat:
2535 # @aes: AES-CBC with plain64 initialization venctors
2539 { 'enum': 'BlockdevQcow2EncryptionFormat',
2540 'data': [ 'aes', 'luks' ] }
2543 # @BlockdevQcow2Encryption:
2547 { 'union': 'BlockdevQcow2Encryption',
2548 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
2549 'discriminator': 'format',
2550 'data': { 'aes': 'QCryptoBlockOptionsQCow',
2551 'luks': 'QCryptoBlockOptionsLUKS'} }
2554 # @BlockdevOptionsQcow2:
2556 # Driver specific block device options for qcow2.
2558 # @lazy-refcounts: whether to enable the lazy refcounts
2559 # feature (default is taken from the image file)
2561 # @pass-discard-request: whether discard requests to the qcow2
2562 # device should be forwarded to the data source
2564 # @pass-discard-snapshot: whether discard requests for the data source
2565 # should be issued when a snapshot operation (e.g.
2566 # deleting a snapshot) frees clusters in the qcow2 file
2568 # @pass-discard-other: whether discard requests for the data source
2569 # should be issued on other occasions where a cluster
2572 # @overlap-check: which overlap checks to perform for writes
2573 # to the image, defaults to 'cached' (since 2.2)
2575 # @cache-size: the maximum total size of the L2 table and
2576 # refcount block caches in bytes (since 2.2)
2578 # @l2-cache-size: the maximum size of the L2 table cache in
2581 # @l2-cache-entry-size: the size of each entry in the L2 cache in
2582 # bytes. It must be a power of two between 512
2583 # and the cluster size. The default value is
2584 # the cluster size (since 2.12)
2586 # @refcount-cache-size: the maximum size of the refcount block cache
2587 # in bytes (since 2.2)
2589 # @cache-clean-interval: clean unused entries in the L2 and refcount
2590 # caches. The interval is in seconds. The default value
2591 # is 0 and it disables this feature (since 2.5)
2592 # @encrypt: Image decryption options. Mandatory for
2593 # encrypted images, except when doing a metadata-only
2594 # probe of the image. (since 2.10)
2598 { 'struct': 'BlockdevOptionsQcow2',
2599 'base': 'BlockdevOptionsGenericCOWFormat',
2600 'data': { '*lazy-refcounts': 'bool',
2601 '*pass-discard-request': 'bool',
2602 '*pass-discard-snapshot': 'bool',
2603 '*pass-discard-other': 'bool',
2604 '*overlap-check': 'Qcow2OverlapChecks',
2605 '*cache-size': 'int',
2606 '*l2-cache-size': 'int',
2607 '*l2-cache-entry-size': 'int',
2608 '*refcount-cache-size': 'int',
2609 '*cache-clean-interval': 'int',
2610 '*encrypt': 'BlockdevQcow2Encryption' } }
2613 # @SshHostKeyCheckMode:
2615 # @none Don't check the host key at all
2616 # @hash Compare the host key with a given hash
2617 # @known_hosts Check the host key against the known_hosts file
2621 { 'enum': 'SshHostKeyCheckMode',
2622 'data': [ 'none', 'hash', 'known_hosts' ] }
2625 # @SshHostKeyCheckHashType:
2627 # @md5 The given hash is an md5 hash
2628 # @sha1 The given hash is an sha1 hash
2632 { 'enum': 'SshHostKeyCheckHashType',
2633 'data': [ 'md5', 'sha1' ] }
2638 # @type The hash algorithm used for the hash
2639 # @hash The expected hash value
2643 { 'struct': 'SshHostKeyHash',
2644 'data': { 'type': 'SshHostKeyCheckHashType',
2650 # For those union branches that don't need additional fields.
2654 { 'struct': 'SshHostKeyDummy',
2662 { 'union': 'SshHostKeyCheck',
2663 'base': { 'mode': 'SshHostKeyCheckMode' },
2664 'discriminator': 'mode',
2665 'data': { 'none': 'SshHostKeyDummy',
2666 'hash': 'SshHostKeyHash',
2667 'known_hosts': 'SshHostKeyDummy' } }
2670 # @BlockdevOptionsSsh:
2672 # @server: host address
2674 # @path: path to the image on the host
2676 # @user: user as which to connect, defaults to current
2679 # @host-key-check: Defines how and what to check the host key against
2680 # (default: known_hosts)
2684 { 'struct': 'BlockdevOptionsSsh',
2685 'data': { 'server': 'InetSocketAddress',
2688 '*host-key-check': 'SshHostKeyCheck' } }
2694 # Trigger events supported by blkdebug.
2696 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
2699 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
2701 # @cor_write: a write due to copy-on-read (since 2.11)
2705 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
2706 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
2707 'l1_grow_activate_table', 'l2_load', 'l2_update',
2708 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
2709 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
2710 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
2711 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
2712 'refblock_load', 'refblock_update', 'refblock_update_part',
2713 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
2714 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
2715 'refblock_alloc_switch_table', 'cluster_alloc',
2716 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
2717 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
2718 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
2719 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
2720 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
2724 # @BlkdebugInjectErrorOptions:
2726 # Describes a single error injection for blkdebug.
2728 # @event: trigger event
2730 # @state: the state identifier blkdebug needs to be in to
2731 # actually trigger the event; defaults to "any"
2733 # @errno: error identifier (errno) to be returned; defaults to
2736 # @sector: specifies the sector index which has to be affected
2737 # in order to actually trigger the event; defaults to "any
2740 # @once: disables further events after this one has been
2741 # triggered; defaults to false
2743 # @immediately: fail immediately; defaults to false
2747 { 'struct': 'BlkdebugInjectErrorOptions',
2748 'data': { 'event': 'BlkdebugEvent',
2753 '*immediately': 'bool' } }
2756 # @BlkdebugSetStateOptions:
2758 # Describes a single state-change event for blkdebug.
2760 # @event: trigger event
2762 # @state: the current state identifier blkdebug needs to be in;
2765 # @new_state: the state identifier blkdebug is supposed to assume if
2766 # this event is triggered
2770 { 'struct': 'BlkdebugSetStateOptions',
2771 'data': { 'event': 'BlkdebugEvent',
2773 'new_state': 'int' } }
2776 # @BlockdevOptionsBlkdebug:
2778 # Driver specific block device options for blkdebug.
2780 # @image: underlying raw block device (or image file)
2782 # @config: filename of the configuration file
2784 # @align: required alignment for requests in bytes, must be
2785 # positive power of 2, or 0 for default
2787 # @max-transfer: maximum size for I/O transfers in bytes, must be
2788 # positive multiple of @align and of the underlying
2789 # file's request alignment (but need not be a power of
2790 # 2), or 0 for default (since 2.10)
2792 # @opt-write-zero: preferred alignment for write zero requests in bytes,
2793 # must be positive multiple of @align and of the
2794 # underlying file's request alignment (but need not be a
2795 # power of 2), or 0 for default (since 2.10)
2797 # @max-write-zero: maximum size for write zero requests in bytes, must be
2798 # positive multiple of @align, of @opt-write-zero, and of
2799 # the underlying file's request alignment (but need not
2800 # be a power of 2), or 0 for default (since 2.10)
2802 # @opt-discard: preferred alignment for discard requests in bytes, must
2803 # be positive multiple of @align and of the underlying
2804 # file's request alignment (but need not be a power of
2805 # 2), or 0 for default (since 2.10)
2807 # @max-discard: maximum size for discard requests in bytes, must be
2808 # positive multiple of @align, of @opt-discard, and of
2809 # the underlying file's request alignment (but need not
2810 # be a power of 2), or 0 for default (since 2.10)
2812 # @inject-error: array of error injection descriptions
2814 # @set-state: array of state-change descriptions
2818 { 'struct': 'BlockdevOptionsBlkdebug',
2819 'data': { 'image': 'BlockdevRef',
2821 '*align': 'int', '*max-transfer': 'int32',
2822 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
2823 '*opt-discard': 'int32', '*max-discard': 'int32',
2824 '*inject-error': ['BlkdebugInjectErrorOptions'],
2825 '*set-state': ['BlkdebugSetStateOptions'] } }
2828 # @BlockdevOptionsBlkverify:
2830 # Driver specific block device options for blkverify.
2832 # @test: block device to be tested
2834 # @raw: raw image used for verification
2838 { 'struct': 'BlockdevOptionsBlkverify',
2839 'data': { 'test': 'BlockdevRef',
2840 'raw': 'BlockdevRef' } }
2843 # @QuorumReadPattern:
2845 # An enumeration of quorum read patterns.
2847 # @quorum: read all the children and do a quorum vote on reads
2849 # @fifo: read only from the first child that has not failed
2853 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
2856 # @BlockdevOptionsQuorum:
2858 # Driver specific block device options for Quorum
2860 # @blkverify: true if the driver must print content mismatch
2861 # set to false by default
2863 # @children: the children block devices to use
2865 # @vote-threshold: the vote limit under which a read will fail
2867 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
2870 # @read-pattern: choose read pattern and set to quorum by default
2875 { 'struct': 'BlockdevOptionsQuorum',
2876 'data': { '*blkverify': 'bool',
2877 'children': [ 'BlockdevRef' ],
2878 'vote-threshold': 'int',
2879 '*rewrite-corrupted': 'bool',
2880 '*read-pattern': 'QuorumReadPattern' } }
2883 # @BlockdevOptionsGluster:
2885 # Driver specific block device options for Gluster
2887 # @volume: name of gluster volume where VM image resides
2889 # @path: absolute path to image file in gluster volume
2891 # @server: gluster servers description
2893 # @debug: libgfapi log level (default '4' which is Error)
2896 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
2900 { 'struct': 'BlockdevOptionsGluster',
2901 'data': { 'volume': 'str',
2903 'server': ['SocketAddress'],
2905 '*logfile': 'str' } }
2910 # An enumeration of libiscsi transport types
2914 { 'enum': 'IscsiTransport',
2915 'data': [ 'tcp', 'iser' ] }
2918 # @IscsiHeaderDigest:
2920 # An enumeration of header digests supported by libiscsi
2924 { 'enum': 'IscsiHeaderDigest',
2925 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
2926 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
2929 # @BlockdevOptionsIscsi:
2931 # @transport: The iscsi transport type
2933 # @portal: The address of the iscsi portal
2935 # @target: The target iqn name
2937 # @lun: LUN to connect to. Defaults to 0.
2939 # @user: User name to log in with. If omitted, no CHAP
2940 # authentication is performed.
2942 # @password-secret: The ID of a QCryptoSecret object providing
2943 # the password for the login. This option is required if
2944 # @user is specified.
2946 # @initiator-name: The iqn name we want to identify to the target
2947 # as. If this option is not specified, an initiator name is
2948 # generated automatically.
2950 # @header-digest: The desired header digest. Defaults to
2953 # @timeout: Timeout in seconds after which a request will
2954 # timeout. 0 means no timeout and is the default.
2956 # Driver specific block device options for iscsi
2960 { 'struct': 'BlockdevOptionsIscsi',
2961 'data': { 'transport': 'IscsiTransport',
2966 '*password-secret': 'str',
2967 '*initiator-name': 'str',
2968 '*header-digest': 'IscsiHeaderDigest',
2969 '*timeout': 'int' } }
2973 # @BlockdevOptionsRbd:
2975 # @pool: Ceph pool name.
2977 # @image: Image name in the Ceph pool.
2979 # @conf: path to Ceph configuration file. Values
2980 # in the configuration file will be overridden by
2981 # options specified via QAPI.
2983 # @snapshot: Ceph snapshot name.
2985 # @user: Ceph id name.
2987 # @server: Monitor host address and port. This maps
2988 # to the "mon_host" Ceph option.
2992 { 'struct': 'BlockdevOptionsRbd',
2993 'data': { 'pool': 'str',
2998 '*server': ['InetSocketAddressBase'] } }
3001 # @BlockdevOptionsSheepdog:
3003 # Driver specific block device options for sheepdog
3005 # @vdi: Virtual disk image name
3006 # @server: The Sheepdog server to connect to
3007 # @snap-id: Snapshot ID
3008 # @tag: Snapshot tag name
3010 # Only one of @snap-id and @tag may be present.
3014 { 'struct': 'BlockdevOptionsSheepdog',
3015 'data': { 'server': 'SocketAddress',
3017 '*snap-id': 'uint32',
3023 # An enumeration of replication modes.
3025 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3027 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3031 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
3034 # @BlockdevOptionsReplication:
3036 # Driver specific block device options for replication
3038 # @mode: the replication mode
3040 # @top-id: In secondary mode, node name or device ID of the root
3041 # node who owns the replication node chain. Must not be given in
3046 { 'struct': 'BlockdevOptionsReplication',
3047 'base': 'BlockdevOptionsGenericFormat',
3048 'data': { 'mode': 'ReplicationMode',
3049 '*top-id': 'str' } }
3054 # An enumeration of NFS transport types
3056 # @inet: TCP transport
3060 { 'enum': 'NFSTransport',
3061 'data': [ 'inet' ] }
3066 # Captures the address of the socket
3068 # @type: transport type used for NFS (only TCP supported)
3070 # @host: host address for NFS server
3074 { 'struct': 'NFSServer',
3075 'data': { 'type': 'NFSTransport',
3079 # @BlockdevOptionsNfs:
3081 # Driver specific block device option for NFS
3083 # @server: host address
3085 # @path: path of the image on the host
3087 # @user: UID value to use when talking to the
3088 # server (defaults to 65534 on Windows and getuid()
3091 # @group: GID value to use when talking to the
3092 # server (defaults to 65534 on Windows and getgid()
3095 # @tcp-syn-count: number of SYNs during the session
3096 # establishment (defaults to libnfs default)
3098 # @readahead-size: set the readahead size in bytes (defaults
3099 # to libnfs default)
3101 # @page-cache-size: set the pagecache size in bytes (defaults
3102 # to libnfs default)
3104 # @debug: set the NFS debug level (max 2) (defaults
3105 # to libnfs default)
3109 { 'struct': 'BlockdevOptionsNfs',
3110 'data': { 'server': 'NFSServer',
3114 '*tcp-syn-count': 'int',
3115 '*readahead-size': 'int',
3116 '*page-cache-size': 'int',
3120 # @BlockdevOptionsCurlBase:
3122 # Driver specific block device options shared by all protocols supported by the
3125 # @url: URL of the image file
3127 # @readahead: Size of the read-ahead cache; must be a multiple of
3128 # 512 (defaults to 256 kB)
3130 # @timeout: Timeout for connections, in seconds (defaults to 5)
3132 # @username: Username for authentication (defaults to none)
3134 # @password-secret: ID of a QCryptoSecret object providing a password
3135 # for authentication (defaults to no password)
3137 # @proxy-username: Username for proxy authentication (defaults to none)
3139 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3140 # for proxy authentication (defaults to no password)
3144 { 'struct': 'BlockdevOptionsCurlBase',
3145 'data': { 'url': 'str',
3146 '*readahead': 'int',
3149 '*password-secret': 'str',
3150 '*proxy-username': 'str',
3151 '*proxy-password-secret': 'str' } }
3154 # @BlockdevOptionsCurlHttp:
3156 # Driver specific block device options for HTTP connections over the curl
3157 # backend. URLs must start with "http://".
3159 # @cookie: List of cookies to set; format is
3160 # "name1=content1; name2=content2;" as explained by
3161 # CURLOPT_COOKIE(3). Defaults to no cookies.
3163 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3164 # secure way. See @cookie for the format. (since 2.10)
3168 { 'struct': 'BlockdevOptionsCurlHttp',
3169 'base': 'BlockdevOptionsCurlBase',
3170 'data': { '*cookie': 'str',
3171 '*cookie-secret': 'str'} }
3174 # @BlockdevOptionsCurlHttps:
3176 # Driver specific block device options for HTTPS connections over the curl
3177 # backend. URLs must start with "https://".
3179 # @cookie: List of cookies to set; format is
3180 # "name1=content1; name2=content2;" as explained by
3181 # CURLOPT_COOKIE(3). Defaults to no cookies.
3183 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3186 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3187 # secure way. See @cookie for the format. (since 2.10)
3191 { 'struct': 'BlockdevOptionsCurlHttps',
3192 'base': 'BlockdevOptionsCurlBase',
3193 'data': { '*cookie': 'str',
3194 '*sslverify': 'bool',
3195 '*cookie-secret': 'str'} }
3198 # @BlockdevOptionsCurlFtp:
3200 # Driver specific block device options for FTP connections over the curl
3201 # backend. URLs must start with "ftp://".
3205 { 'struct': 'BlockdevOptionsCurlFtp',
3206 'base': 'BlockdevOptionsCurlBase',
3210 # @BlockdevOptionsCurlFtps:
3212 # Driver specific block device options for FTPS connections over the curl
3213 # backend. URLs must start with "ftps://".
3215 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3220 { 'struct': 'BlockdevOptionsCurlFtps',
3221 'base': 'BlockdevOptionsCurlBase',
3222 'data': { '*sslverify': 'bool' } }
3225 # @BlockdevOptionsNbd:
3227 # Driver specific block device options for NBD.
3229 # @server: NBD server address
3231 # @export: export name
3233 # @tls-creds: TLS credentials ID
3237 { 'struct': 'BlockdevOptionsNbd',
3238 'data': { 'server': 'SocketAddress',
3240 '*tls-creds': 'str' } }
3243 # @BlockdevOptionsRaw:
3245 # Driver specific block device options for the raw driver.
3247 # @offset: position where the block device starts
3248 # @size: the assumed size of the device
3252 { 'struct': 'BlockdevOptionsRaw',
3253 'base': 'BlockdevOptionsGenericFormat',
3254 'data': { '*offset': 'int', '*size': 'int' } }
3257 # @BlockdevOptionsVxHS:
3259 # Driver specific block device options for VxHS
3261 # @vdisk-id: UUID of VxHS volume
3262 # @server: vxhs server IP, port
3263 # @tls-creds: TLS credentials ID
3267 { 'struct': 'BlockdevOptionsVxHS',
3268 'data': { 'vdisk-id': 'str',
3269 'server': 'InetSocketAddressBase',
3270 '*tls-creds': 'str' } }
3273 # @BlockdevOptionsThrottle:
3275 # Driver specific block device options for the throttle driver
3277 # @throttle-group: the name of the throttle-group object to use. It
3278 # must already exist.
3279 # @file: reference to or definition of the data source block device
3282 { 'struct': 'BlockdevOptionsThrottle',
3283 'data': { 'throttle-group': 'str',
3284 'file' : 'BlockdevRef'
3289 # Options for creating a block device. Many options are available for all
3290 # block devices, independent of the block driver:
3292 # @driver: block driver name
3293 # @node-name: the node name of the new node (Since 2.0).
3294 # This option is required on the top level of blockdev-add.
3295 # @discard: discard-related options (default: ignore)
3296 # @cache: cache-related options
3297 # @read-only: whether the block device should be read-only (default: false).
3298 # Note that some block drivers support only read-only access,
3299 # either generally or in certain configurations. In this case,
3300 # the default value does not work and the option must be
3301 # specified explicitly.
3302 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3304 # @force-share: force share all permission on added nodes.
3305 # Requires read-only=true. (Since 2.10)
3307 # Remaining options are determined by the block driver.
3311 { 'union': 'BlockdevOptions',
3312 'base': { 'driver': 'BlockdevDriver',
3313 '*node-name': 'str',
3314 '*discard': 'BlockdevDiscardOptions',
3315 '*cache': 'BlockdevCacheOptions',
3316 '*read-only': 'bool',
3317 '*force-share': 'bool',
3318 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3319 'discriminator': 'driver',
3321 'blkdebug': 'BlockdevOptionsBlkdebug',
3322 'blkverify': 'BlockdevOptionsBlkverify',
3323 'bochs': 'BlockdevOptionsGenericFormat',
3324 'cloop': 'BlockdevOptionsGenericFormat',
3325 'dmg': 'BlockdevOptionsGenericFormat',
3326 'file': 'BlockdevOptionsFile',
3327 'ftp': 'BlockdevOptionsCurlFtp',
3328 'ftps': 'BlockdevOptionsCurlFtps',
3329 'gluster': 'BlockdevOptionsGluster',
3330 'host_cdrom': 'BlockdevOptionsFile',
3331 'host_device':'BlockdevOptionsFile',
3332 'http': 'BlockdevOptionsCurlHttp',
3333 'https': 'BlockdevOptionsCurlHttps',
3334 'iscsi': 'BlockdevOptionsIscsi',
3335 'luks': 'BlockdevOptionsLUKS',
3336 'nbd': 'BlockdevOptionsNbd',
3337 'nfs': 'BlockdevOptionsNfs',
3338 'null-aio': 'BlockdevOptionsNull',
3339 'null-co': 'BlockdevOptionsNull',
3340 'nvme': 'BlockdevOptionsNVMe',
3341 'parallels': 'BlockdevOptionsGenericFormat',
3342 'qcow2': 'BlockdevOptionsQcow2',
3343 'qcow': 'BlockdevOptionsQcow',
3344 'qed': 'BlockdevOptionsGenericCOWFormat',
3345 'quorum': 'BlockdevOptionsQuorum',
3346 'raw': 'BlockdevOptionsRaw',
3347 'rbd': 'BlockdevOptionsRbd',
3348 'replication':'BlockdevOptionsReplication',
3349 'sheepdog': 'BlockdevOptionsSheepdog',
3350 'ssh': 'BlockdevOptionsSsh',
3351 'throttle': 'BlockdevOptionsThrottle',
3352 'vdi': 'BlockdevOptionsGenericFormat',
3353 'vhdx': 'BlockdevOptionsGenericFormat',
3354 'vmdk': 'BlockdevOptionsGenericCOWFormat',
3355 'vpc': 'BlockdevOptionsGenericFormat',
3356 'vvfat': 'BlockdevOptionsVVFAT',
3357 'vxhs': 'BlockdevOptionsVxHS'
3363 # Reference to a block device.
3365 # @definition: defines a new block device inline
3366 # @reference: references the ID of an existing block device
3370 { 'alternate': 'BlockdevRef',
3371 'data': { 'definition': 'BlockdevOptions',
3372 'reference': 'str' } }
3375 # @BlockdevRefOrNull:
3377 # Reference to a block device.
3379 # @definition: defines a new block device inline
3380 # @reference: references the ID of an existing block device.
3381 # An empty string means that no block device should
3382 # be referenced. Deprecated; use null instead.
3383 # @null: No block device should be referenced (since 2.10)
3387 { 'alternate': 'BlockdevRefOrNull',
3388 'data': { 'definition': 'BlockdevOptions',
3395 # Creates a new block device. If the @id option is given at the top level, a
3396 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
3397 # level and no BlockBackend will be created.
3404 # -> { "execute": "blockdev-add",
3406 # "driver": "qcow2",
3407 # "node-name": "test1",
3410 # "filename": "test.qcow2"
3414 # <- { "return": {} }
3417 # -> { "execute": "blockdev-add",
3419 # "driver": "qcow2",
3420 # "node-name": "node0",
3421 # "discard": "unmap",
3427 # "filename": "/tmp/test.qcow2"
3433 # "filename": "/dev/fdset/4"
3439 # <- { "return": {} }
3442 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
3447 # Deletes a block device that has been added using blockdev-add.
3448 # The command will fail if the node is attached to a device or is
3449 # otherwise being used.
3451 # @node-name: Name of the graph node to delete.
3457 # -> { "execute": "blockdev-add",
3459 # "driver": "qcow2",
3460 # "node-name": "node0",
3463 # "filename": "test.qcow2"
3467 # <- { "return": {} }
3469 # -> { "execute": "blockdev-del",
3470 # "arguments": { "node-name": "node0" }
3472 # <- { "return": {} }
3475 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
3478 # @BlockdevCreateOptionsFile:
3480 # Driver specific image creation options for file.
3482 # @filename Filename for the new image file
3483 # @size Size of the virtual disk in bytes
3484 # @preallocation Preallocation mode for the new image (default: off)
3485 # @nocow Turn off copy-on-write (valid only on btrfs; default: off)
3489 { 'struct': 'BlockdevCreateOptionsFile',
3490 'data': { 'filename': 'str',
3492 '*preallocation': 'PreallocMode',
3493 '*nocow': 'bool' } }
3496 # @BlockdevCreateOptionsGluster:
3498 # Driver specific image creation options for gluster.
3500 # @location Where to store the new image file
3501 # @size Size of the virtual disk in bytes
3502 # @preallocation Preallocation mode for the new image (default: off)
3506 { 'struct': 'BlockdevCreateOptionsGluster',
3507 'data': { 'location': 'BlockdevOptionsGluster',
3509 '*preallocation': 'PreallocMode' } }
3512 # @BlockdevCreateOptionsNfs:
3514 # Driver specific image creation options for NFS.
3516 # @location Where to store the new image file
3517 # @size Size of the virtual disk in bytes
3521 { 'struct': 'BlockdevCreateOptionsNfs',
3522 'data': { 'location': 'BlockdevOptionsNfs',
3526 # @BlockdevQcow2Version:
3528 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
3529 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
3533 { 'enum': 'BlockdevQcow2Version',
3534 'data': [ 'v2', 'v3' ] }
3538 # @BlockdevCreateOptionsQcow2:
3540 # Driver specific image creation options for qcow2.
3542 # @file Node to create the image format on
3543 # @size Size of the virtual disk in bytes
3544 # @version Compatibility level (default: v3)
3545 # @backing-file File name of the backing file if a backing file
3547 # @backing-fmt Name of the block driver to use for the backing file
3548 # @encrypt Encryption options if the image should be encrypted
3549 # @cluster-size qcow2 cluster size in bytes (default: 65536)
3550 # @preallocation Preallocation mode for the new image (default: off)
3551 # @lazy-refcounts True if refcounts may be updated lazily (default: off)
3552 # @refcount-bits Width of reference counts in bits (default: 16)
3556 { 'struct': 'BlockdevCreateOptionsQcow2',
3557 'data': { 'file': 'BlockdevRef',
3559 '*version': 'BlockdevQcow2Version',
3560 '*backing-file': 'str',
3561 '*backing-fmt': 'BlockdevDriver',
3562 '*encrypt': 'QCryptoBlockCreateOptions',
3563 '*cluster-size': 'size',
3564 '*preallocation': 'PreallocMode',
3565 '*lazy-refcounts': 'bool',
3566 '*refcount-bits': 'int' } }
3569 # @BlockdevCreateOptionsRbd:
3571 # Driver specific image creation options for rbd/Ceph.
3573 # @location Where to store the new image file. This location cannot
3574 # point to a snapshot.
3575 # @size Size of the virtual disk in bytes
3576 # @cluster-size RBD object size
3580 { 'struct': 'BlockdevCreateOptionsRbd',
3581 'data': { 'location': 'BlockdevOptionsRbd',
3583 '*cluster-size' : 'size' } }
3586 # @SheepdogRedundancyType:
3588 # @full Create a fully replicated vdi with x copies
3589 # @erasure-coded Create an erasure coded vdi with x data strips and
3594 { 'enum': 'SheepdogRedundancyType',
3595 'data': [ 'full', 'erasure-coded' ] }
3598 # @SheepdogRedundancyFull:
3600 # @copies Number of copies to use (between 1 and 31)
3604 { 'struct': 'SheepdogRedundancyFull',
3605 'data': { 'copies': 'int' }}
3608 # @SheepdogRedundancyErasureCoded:
3610 # @data-strips Number of data strips to use (one of {2,4,8,16})
3611 # @parity-strips Number of parity strips to use (between 1 and 15)
3615 { 'struct': 'SheepdogRedundancyErasureCoded',
3616 'data': { 'data-strips': 'int',
3617 'parity-strips': 'int' }}
3620 # @SheepdogRedundancy:
3624 { 'union': 'SheepdogRedundancy',
3625 'base': { 'type': 'SheepdogRedundancyType' },
3626 'discriminator': 'type',
3627 'data': { 'full': 'SheepdogRedundancyFull',
3628 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
3631 # @BlockdevCreateOptionsSheepdog:
3633 # Driver specific image creation options for Sheepdog.
3635 # @location Where to store the new image file
3636 # @size Size of the virtual disk in bytes
3637 # @backing-file File name of a base image
3638 # @preallocation Preallocation mode (allowed values: off, full)
3639 # @redundancy Redundancy of the image
3640 # @object-size Object size of the image
3644 { 'struct': 'BlockdevCreateOptionsSheepdog',
3645 'data': { 'location': 'BlockdevOptionsSheepdog',
3647 '*backing-file': 'str',
3648 '*preallocation': 'PreallocMode',
3649 '*redundancy': 'SheepdogRedundancy',
3650 '*object-size': 'size' } }
3653 # @BlockdevCreateOptionsSsh:
3655 # Driver specific image creation options for SSH.
3657 # @location Where to store the new image file
3658 # @size Size of the virtual disk in bytes
3662 { 'struct': 'BlockdevCreateOptionsSsh',
3663 'data': { 'location': 'BlockdevOptionsSsh',
3667 # @BlockdevCreateNotSupported:
3669 # This is used for all drivers that don't support creating images.
3673 { 'struct': 'BlockdevCreateNotSupported', 'data': {}}
3676 # @BlockdevCreateOptions:
3678 # Options for creating an image format on a given node.
3680 # @driver block driver to create the image format
3684 { 'union': 'BlockdevCreateOptions',
3686 'driver': 'BlockdevDriver' },
3687 'discriminator': 'driver',
3689 'blkdebug': 'BlockdevCreateNotSupported',
3690 'blkverify': 'BlockdevCreateNotSupported',
3691 'bochs': 'BlockdevCreateNotSupported',
3692 'cloop': 'BlockdevCreateNotSupported',
3693 'dmg': 'BlockdevCreateNotSupported',
3694 'file': 'BlockdevCreateOptionsFile',
3695 'ftp': 'BlockdevCreateNotSupported',
3696 'ftps': 'BlockdevCreateNotSupported',
3697 'gluster': 'BlockdevCreateOptionsGluster',
3698 'host_cdrom': 'BlockdevCreateNotSupported',
3699 'host_device': 'BlockdevCreateNotSupported',
3700 'http': 'BlockdevCreateNotSupported',
3701 'https': 'BlockdevCreateNotSupported',
3702 'iscsi': 'BlockdevCreateNotSupported',
3703 'luks': 'BlockdevCreateNotSupported',
3704 'nbd': 'BlockdevCreateNotSupported',
3705 'nfs': 'BlockdevCreateOptionsNfs',
3706 'null-aio': 'BlockdevCreateNotSupported',
3707 'null-co': 'BlockdevCreateNotSupported',
3708 'nvme': 'BlockdevCreateNotSupported',
3709 'parallels': 'BlockdevCreateNotSupported',
3710 'qcow2': 'BlockdevCreateOptionsQcow2',
3711 'qcow': 'BlockdevCreateNotSupported',
3712 'qed': 'BlockdevCreateNotSupported',
3713 'quorum': 'BlockdevCreateNotSupported',
3714 'raw': 'BlockdevCreateNotSupported',
3715 'rbd': 'BlockdevCreateOptionsRbd',
3716 'replication': 'BlockdevCreateNotSupported',
3717 'sheepdog': 'BlockdevCreateOptionsSheepdog',
3718 'ssh': 'BlockdevCreateOptionsSsh',
3719 'throttle': 'BlockdevCreateNotSupported',
3720 'vdi': 'BlockdevCreateNotSupported',
3721 'vhdx': 'BlockdevCreateNotSupported',
3722 'vmdk': 'BlockdevCreateNotSupported',
3723 'vpc': 'BlockdevCreateNotSupported',
3724 'vvfat': 'BlockdevCreateNotSupported',
3725 'vxhs': 'BlockdevCreateNotSupported'
3729 # @x-blockdev-create:
3731 # Create an image format on a given node.
3732 # TODO Replace with something asynchronous (block job?)
3736 { 'command': 'x-blockdev-create',
3737 'data': 'BlockdevCreateOptions',
3741 # @blockdev-open-tray:
3743 # Opens a block device's tray. If there is a block driver state tree inserted as
3744 # a medium, it will become inaccessible to the guest (but it will remain
3745 # associated to the block device, so closing the tray will make it accessible
3748 # If the tray was already open before, this will be a no-op.
3750 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
3751 # which no such event will be generated, these include:
3752 # - if the guest has locked the tray, @force is false and the guest does not
3753 # respond to the eject request
3754 # - if the BlockBackend denoted by @device does not have a guest device attached
3756 # - if the guest device does not have an actual tray
3758 # @device: Block device name (deprecated, use @id instead)
3760 # @id: The name or QOM path of the guest device (since: 2.8)
3762 # @force: if false (the default), an eject request will be sent to
3763 # the guest if it has locked the tray (and the tray will not be opened
3764 # immediately); if true, the tray will be opened regardless of whether
3771 # -> { "execute": "blockdev-open-tray",
3772 # "arguments": { "id": "ide0-1-0" } }
3774 # <- { "timestamp": { "seconds": 1418751016,
3775 # "microseconds": 716996 },
3776 # "event": "DEVICE_TRAY_MOVED",
3777 # "data": { "device": "ide1-cd0",
3779 # "tray-open": true } }
3781 # <- { "return": {} }
3784 { 'command': 'blockdev-open-tray',
3785 'data': { '*device': 'str',
3787 '*force': 'bool' } }
3790 # @blockdev-close-tray:
3792 # Closes a block device's tray. If there is a block driver state tree associated
3793 # with the block device (which is currently ejected), that tree will be loaded
3796 # If the tray was already closed before, this will be a no-op.
3798 # @device: Block device name (deprecated, use @id instead)
3800 # @id: The name or QOM path of the guest device (since: 2.8)
3806 # -> { "execute": "blockdev-close-tray",
3807 # "arguments": { "id": "ide0-1-0" } }
3809 # <- { "timestamp": { "seconds": 1418751345,
3810 # "microseconds": 272147 },
3811 # "event": "DEVICE_TRAY_MOVED",
3812 # "data": { "device": "ide1-cd0",
3814 # "tray-open": false } }
3816 # <- { "return": {} }
3819 { 'command': 'blockdev-close-tray',
3820 'data': { '*device': 'str',
3824 # @blockdev-remove-medium:
3826 # Removes a medium (a block driver state tree) from a block device. That block
3827 # device's tray must currently be open (unless there is no attached guest
3830 # If the tray is open and there is no medium inserted, this will be a no-op.
3832 # @id: The name or QOM path of the guest device
3838 # -> { "execute": "blockdev-remove-medium",
3839 # "arguments": { "id": "ide0-1-0" } }
3841 # <- { "error": { "class": "GenericError",
3842 # "desc": "Tray of device 'ide0-1-0' is not open" } }
3844 # -> { "execute": "blockdev-open-tray",
3845 # "arguments": { "id": "ide0-1-0" } }
3847 # <- { "timestamp": { "seconds": 1418751627,
3848 # "microseconds": 549958 },
3849 # "event": "DEVICE_TRAY_MOVED",
3850 # "data": { "device": "ide1-cd0",
3852 # "tray-open": true } }
3854 # <- { "return": {} }
3856 # -> { "execute": "blockdev-remove-medium",
3857 # "arguments": { "id": "ide0-1-0" } }
3859 # <- { "return": {} }
3862 { 'command': 'blockdev-remove-medium',
3863 'data': { 'id': 'str' } }
3866 # @blockdev-insert-medium:
3868 # Inserts a medium (a block driver state tree) into a block device. That block
3869 # device's tray must currently be open (unless there is no attached guest
3870 # device) and there must be no medium inserted already.
3872 # @id: The name or QOM path of the guest device
3874 # @node-name: name of a node in the block driver state graph
3880 # -> { "execute": "blockdev-add",
3882 # "node-name": "node0",
3884 # "file": { "driver": "file",
3885 # "filename": "fedora.iso" } } }
3886 # <- { "return": {} }
3888 # -> { "execute": "blockdev-insert-medium",
3889 # "arguments": { "id": "ide0-1-0",
3890 # "node-name": "node0" } }
3892 # <- { "return": {} }
3895 { 'command': 'blockdev-insert-medium',
3896 'data': { 'id': 'str',
3897 'node-name': 'str'} }
3901 # @BlockdevChangeReadOnlyMode:
3903 # Specifies the new read-only mode of a block device subject to the
3904 # @blockdev-change-medium command.
3906 # @retain: Retains the current read-only mode
3908 # @read-only: Makes the device read-only
3910 # @read-write: Makes the device writable
3915 { 'enum': 'BlockdevChangeReadOnlyMode',
3916 'data': ['retain', 'read-only', 'read-write'] }
3920 # @blockdev-change-medium:
3922 # Changes the medium inserted into a block device by ejecting the current medium
3923 # and loading a new image file which is inserted as the new medium (this command
3924 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
3925 # and blockdev-close-tray).
3927 # @device: Block device name (deprecated, use @id instead)
3929 # @id: The name or QOM path of the guest device
3932 # @filename: filename of the new image to be loaded
3934 # @format: format to open the new image with (defaults to
3935 # the probed format)
3937 # @read-only-mode: change the read-only mode of the device; defaults
3944 # 1. Change a removable medium
3946 # -> { "execute": "blockdev-change-medium",
3947 # "arguments": { "id": "ide0-1-0",
3948 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
3949 # "format": "raw" } }
3950 # <- { "return": {} }
3952 # 2. Load a read-only medium into a writable drive
3954 # -> { "execute": "blockdev-change-medium",
3955 # "arguments": { "id": "floppyA",
3956 # "filename": "/srv/images/ro.img",
3958 # "read-only-mode": "retain" } }
3961 # { "class": "GenericError",
3962 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
3964 # -> { "execute": "blockdev-change-medium",
3965 # "arguments": { "id": "floppyA",
3966 # "filename": "/srv/images/ro.img",
3968 # "read-only-mode": "read-only" } }
3970 # <- { "return": {} }
3973 { 'command': 'blockdev-change-medium',
3974 'data': { '*device': 'str',
3978 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
3982 # @BlockErrorAction:
3984 # An enumeration of action that has been taken when a DISK I/O occurs
3986 # @ignore: error has been ignored
3988 # @report: error has been reported to the device
3990 # @stop: error caused VM to be stopped
3994 { 'enum': 'BlockErrorAction',
3995 'data': [ 'ignore', 'report', 'stop' ] }
3999 # @BLOCK_IMAGE_CORRUPTED:
4001 # Emitted when a disk image is being marked corrupt. The image can be
4002 # identified by its device or node name. The 'device' field is always
4003 # present for compatibility reasons, but it can be empty ("") if the
4004 # image does not have a device name associated.
4006 # @device: device name. This is always present for compatibility
4007 # reasons, but it can be empty ("") if the image does not
4008 # have a device name associated.
4010 # @node-name: node name (Since: 2.4)
4012 # @msg: informative message for human consumption, such as the kind of
4013 # corruption being detected. It should not be parsed by machine as it is
4014 # not guaranteed to be stable
4016 # @offset: if the corruption resulted from an image access, this is
4017 # the host's access offset into the image
4019 # @size: if the corruption resulted from an image access, this is
4022 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4023 # event and must be repaired (Since 2.2; before, every
4024 # BLOCK_IMAGE_CORRUPTED event was fatal)
4026 # Note: If action is "stop", a STOP event will eventually follow the
4027 # BLOCK_IO_ERROR event.
4031 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4032 # "data": { "device": "ide0-hd0", "node-name": "node0",
4033 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4035 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4039 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4040 'data': { 'device' : 'str',
4041 '*node-name' : 'str',
4045 'fatal' : 'bool' } }
4050 # Emitted when a disk I/O error occurs
4052 # @device: device name. This is always present for compatibility
4053 # reasons, but it can be empty ("") if the image does not
4054 # have a device name associated.
4056 # @node-name: node name. Note that errors may be reported for the root node
4057 # that is directly attached to a guest device rather than for the
4058 # node where the error occurred. The node name is not present if
4059 # the drive is empty. (Since: 2.8)
4061 # @operation: I/O operation
4063 # @action: action that has been taken
4065 # @nospace: true if I/O error was caused due to a no-space
4066 # condition. This key is only present if query-block's
4067 # io-status is present, please see query-block documentation
4068 # for more information (since: 2.2)
4070 # @reason: human readable string describing the error cause.
4071 # (This field is a debugging aid for humans, it should not
4072 # be parsed by applications) (since: 2.2)
4074 # Note: If action is "stop", a STOP event will eventually follow the
4075 # BLOCK_IO_ERROR event
4081 # <- { "event": "BLOCK_IO_ERROR",
4082 # "data": { "device": "ide0-hd1",
4083 # "node-name": "#block212",
4084 # "operation": "write",
4085 # "action": "stop" },
4086 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4089 { 'event': 'BLOCK_IO_ERROR',
4090 'data': { 'device': 'str', '*node-name': 'str',
4091 'operation': 'IoOperationType',
4092 'action': 'BlockErrorAction', '*nospace': 'bool',
4096 # @BLOCK_JOB_COMPLETED:
4098 # Emitted when a block job has completed
4102 # @device: The job identifier. Originally the device name but other
4103 # values are allowed since QEMU 2.7
4105 # @len: maximum progress value
4107 # @offset: current progress value. On success this is equal to len.
4108 # On failure this is less than len
4110 # @speed: rate limit, bytes per second
4112 # @error: error message. Only present on failure. This field
4113 # contains a human-readable error message. There are no semantics
4114 # other than that streaming has failed and clients should not try to
4115 # interpret the error string
4121 # <- { "event": "BLOCK_JOB_COMPLETED",
4122 # "data": { "type": "stream", "device": "virtio-disk0",
4123 # "len": 10737418240, "offset": 10737418240,
4125 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4128 { 'event': 'BLOCK_JOB_COMPLETED',
4129 'data': { 'type' : 'BlockJobType',
4137 # @BLOCK_JOB_CANCELLED:
4139 # Emitted when a block job has been cancelled
4143 # @device: The job identifier. Originally the device name but other
4144 # values are allowed since QEMU 2.7
4146 # @len: maximum progress value
4148 # @offset: current progress value. On success this is equal to len.
4149 # On failure this is less than len
4151 # @speed: rate limit, bytes per second
4157 # <- { "event": "BLOCK_JOB_CANCELLED",
4158 # "data": { "type": "stream", "device": "virtio-disk0",
4159 # "len": 10737418240, "offset": 134217728,
4161 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
4164 { 'event': 'BLOCK_JOB_CANCELLED',
4165 'data': { 'type' : 'BlockJobType',
4174 # Emitted when a block job encounters an error
4176 # @device: The job identifier. Originally the device name but other
4177 # values are allowed since QEMU 2.7
4179 # @operation: I/O operation
4181 # @action: action that has been taken
4187 # <- { "event": "BLOCK_JOB_ERROR",
4188 # "data": { "device": "ide0-hd1",
4189 # "operation": "write",
4190 # "action": "stop" },
4191 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4194 { 'event': 'BLOCK_JOB_ERROR',
4195 'data': { 'device' : 'str',
4196 'operation': 'IoOperationType',
4197 'action' : 'BlockErrorAction' } }
4202 # Emitted when a block job is ready to complete
4206 # @device: The job identifier. Originally the device name but other
4207 # values are allowed since QEMU 2.7
4209 # @len: maximum progress value
4211 # @offset: current progress value. On success this is equal to len.
4212 # On failure this is less than len
4214 # @speed: rate limit, bytes per second
4216 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
4223 # <- { "event": "BLOCK_JOB_READY",
4224 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
4225 # "len": 2097152, "offset": 2097152 }
4226 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4229 { 'event': 'BLOCK_JOB_READY',
4230 'data': { 'type' : 'BlockJobType',
4239 # Preallocation mode of QEMU image file
4241 # @off: no preallocation
4242 # @metadata: preallocate only for metadata
4243 # @falloc: like @full preallocation but allocate disk space by
4244 # posix_fallocate() rather than writing zeros.
4245 # @full: preallocate all data by writing zeros to device to ensure disk
4246 # space is really available. @full preallocation also sets up
4247 # metadata correctly.
4251 { 'enum': 'PreallocMode',
4252 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
4255 # @BLOCK_WRITE_THRESHOLD:
4257 # Emitted when writes on block device reaches or exceeds the
4258 # configured write threshold. For thin-provisioned devices, this
4259 # means the device should be extended to avoid pausing for
4261 # The event is one shot. Once triggered, it needs to be
4262 # re-registered with another block-set-write-threshold command.
4264 # @node-name: graph node name on which the threshold was exceeded.
4266 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
4268 # @write-threshold: last configured threshold, in bytes.
4272 { 'event': 'BLOCK_WRITE_THRESHOLD',
4273 'data': { 'node-name': 'str',
4274 'amount-exceeded': 'uint64',
4275 'write-threshold': 'uint64' } }
4278 # @block-set-write-threshold:
4280 # Change the write threshold for a block drive. An event will be
4281 # delivered if a write to this block drive crosses the configured
4282 # threshold. The threshold is an offset, thus must be
4283 # non-negative. Default is no write threshold. Setting the threshold
4284 # to zero disables it.
4286 # This is useful to transparently resize thin-provisioned drives without
4287 # the guest OS noticing.
4289 # @node-name: graph node name on which the threshold must be set.
4291 # @write-threshold: configured threshold for the block device, bytes.
4292 # Use 0 to disable the threshold.
4298 # -> { "execute": "block-set-write-threshold",
4299 # "arguments": { "node-name": "mydev",
4300 # "write-threshold": 17179869184 } }
4301 # <- { "return": {} }
4304 { 'command': 'block-set-write-threshold',
4305 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
4308 # @x-blockdev-change:
4310 # Dynamically reconfigure the block driver state graph. It can be used
4311 # to add, remove, insert or replace a graph node. Currently only the
4312 # Quorum driver implements this feature to add or remove its child. This
4313 # is useful to fix a broken quorum child.
4315 # If @node is specified, it will be inserted under @parent. @child
4316 # may not be specified in this case. If both @parent and @child are
4317 # specified but @node is not, @child will be detached from @parent.
4319 # @parent: the id or name of the parent node.
4321 # @child: the name of a child under the given parent node.
4323 # @node: the name of the node that will be added.
4325 # Note: this command is experimental, and its API is not stable. It
4326 # does not support all kinds of operations, all kinds of children, nor
4327 # all block drivers.
4329 # FIXME Removing children from a quorum node means introducing gaps in the
4330 # child indices. This cannot be represented in the 'children' list of
4331 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
4333 # Warning: The data in a new quorum child MUST be consistent with that of
4334 # the rest of the array.
4340 # 1. Add a new node to a quorum
4341 # -> { "execute": "blockdev-add",
4344 # "node-name": "new_node",
4345 # "file": { "driver": "file",
4346 # "filename": "test.raw" } } }
4347 # <- { "return": {} }
4348 # -> { "execute": "x-blockdev-change",
4349 # "arguments": { "parent": "disk1",
4350 # "node": "new_node" } }
4351 # <- { "return": {} }
4353 # 2. Delete a quorum's node
4354 # -> { "execute": "x-blockdev-change",
4355 # "arguments": { "parent": "disk1",
4356 # "child": "children.1" } }
4357 # <- { "return": {} }
4360 { 'command': 'x-blockdev-change',
4361 'data' : { 'parent': 'str',
4366 # @x-blockdev-set-iothread:
4368 # Move @node and its children into the @iothread. If @iothread is null then
4369 # move @node and its children into the main loop.
4371 # The node must not be attached to a BlockBackend.
4373 # @node-name: the name of the block driver node
4375 # @iothread: the name of the IOThread object or null for the main loop
4377 # @force: true if the node and its children should be moved when a BlockBackend
4378 # is already attached
4380 # Note: this command is experimental and intended for test cases that need
4381 # control over IOThreads only.
4387 # 1. Move a node into an IOThread
4388 # -> { "execute": "x-blockdev-set-iothread",
4389 # "arguments": { "node-name": "disk1",
4390 # "iothread": "iothread0" } }
4391 # <- { "return": {} }
4393 # 2. Move a node into the main loop
4394 # -> { "execute": "x-blockdev-set-iothread",
4395 # "arguments": { "node-name": "disk1",
4396 # "iothread": null } }
4397 # <- { "return": {} }
4400 { 'command': 'x-blockdev-set-iothread',
4401 'data' : { 'node-name': 'str',
4402 'iothread': 'StrOrNull',
4403 '*force': 'bool' } }