4 # == QAPI block core definitions (vm unrelated)
7 # QAPI common definitions
8 { 'include': 'common.json' }
13 # @id: unique snapshot id
15 # @name: user chosen name
17 # @vm-state-size: size of the VM state
19 # @date-sec: UTC date of the snapshot in seconds
21 # @date-nsec: fractional part in nano seconds to be used with date-sec
23 # @vm-clock-sec: VM clock relative to boot in seconds
25 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
30 { 'struct': 'SnapshotInfo',
31 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
32 'date-sec': 'int', 'date-nsec': 'int',
33 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
36 # @ImageInfoSpecificQCow2:
38 # @compat: compatibility level
40 # @lazy-refcounts: on or off; only valid for compat >= 1.1
42 # @corrupt: true if the image has been marked corrupt; only valid for
43 # compat >= 1.1 (since 2.2)
45 # @refcount-bits: width of a refcount entry in bits (since 2.3)
49 { 'struct': 'ImageInfoSpecificQCow2',
52 '*lazy-refcounts': 'bool',
54 'refcount-bits': 'int'
58 # @ImageInfoSpecificVmdk:
60 # @create-type: The create type of VMDK image
62 # @cid: Content id of image
64 # @parent-cid: Parent VMDK image's cid
66 # @extents: List of extent files
70 { 'struct': 'ImageInfoSpecificVmdk',
75 'extents': ['ImageInfo']
81 # A discriminated record of image format specific information structures.
85 { 'union': 'ImageInfoSpecific',
87 'qcow2': 'ImageInfoSpecificQCow2',
88 'vmdk': 'ImageInfoSpecificVmdk',
89 # If we need to add block driver specific parameters for
90 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
91 # to define a ImageInfoSpecificLUKS
92 'luks': 'QCryptoBlockInfoLUKS'
98 # Information about a QEMU image file
100 # @filename: name of the image file
102 # @format: format of the image file
104 # @virtual-size: maximum capacity in bytes of the image
106 # @actual-size: actual size on disk in bytes of the image
108 # @dirty-flag: true if image is not cleanly closed
110 # @cluster-size: size of a cluster in bytes
112 # @encrypted: true if the image is encrypted
114 # @compressed: true if the image is compressed (Since 1.7)
116 # @backing-filename: name of the backing file
118 # @full-backing-filename: full path of the backing file
120 # @backing-filename-format: the format of the backing file
122 # @snapshots: list of VM snapshots
124 # @backing-image: info of the backing image (since 1.6)
126 # @format-specific: structure supplying additional format-specific
127 # information (since 1.7)
132 { 'struct': 'ImageInfo',
133 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
134 '*actual-size': 'int', 'virtual-size': 'int',
135 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
136 '*backing-filename': 'str', '*full-backing-filename': 'str',
137 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
138 '*backing-image': 'ImageInfo',
139 '*format-specific': 'ImageInfoSpecific' } }
144 # Information about a QEMU image file check
146 # @filename: name of the image file checked
148 # @format: format of the image file checked
150 # @check-errors: number of unexpected errors occurred during check
152 # @image-end-offset: offset (in bytes) where the image ends, this
153 # field is present if the driver for the image format
156 # @corruptions: number of corruptions found during the check if any
158 # @leaks: number of leaks found during the check if any
160 # @corruptions-fixed: number of corruptions fixed during the check
163 # @leaks-fixed: number of leaks fixed during the check if any
165 # @total-clusters: total number of clusters, this field is present
166 # if the driver for the image format supports it
168 # @allocated-clusters: total number of allocated clusters, this
169 # field is present if the driver for the image format
172 # @fragmented-clusters: total number of fragmented clusters, this
173 # field is present if the driver for the image format
176 # @compressed-clusters: total number of compressed clusters, this
177 # field is present if the driver for the image format
183 { 'struct': 'ImageCheck',
184 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
185 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
186 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
187 '*total-clusters': 'int', '*allocated-clusters': 'int',
188 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
193 # Mapping information from a virtual block range to a host file range
195 # @start: the start byte of the mapped virtual range
197 # @length: the number of bytes of the mapped virtual range
199 # @data: whether the mapped range has data
201 # @zero: whether the virtual blocks are zeroed
203 # @depth: the depth of the mapping
205 # @offset: the offset in file that the virtual sectors are mapped to
207 # @filename: filename that is referred to by @offset
212 { 'struct': 'MapEntry',
213 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
214 'zero': 'bool', 'depth': 'int', '*offset': 'int',
215 '*filename': 'str' } }
218 # @BlockdevCacheInfo:
220 # Cache mode information for a block device
222 # @writeback: true if writeback mode is enabled
223 # @direct: true if the host page cache is bypassed (O_DIRECT)
224 # @no-flush: true if flush requests are ignored for the device
228 { 'struct': 'BlockdevCacheInfo',
229 'data': { 'writeback': 'bool',
231 'no-flush': 'bool' } }
236 # Information about the backing device for a block device.
238 # @file: the filename of the backing device
240 # @node-name: the name of the block driver node (Since 2.0)
242 # @ro: true if the backing device was open read-only
244 # @drv: the name of the block format used to open the backing device. As of
245 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
246 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
247 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
248 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
249 # 2.2: 'archipelago' added, 'cow' dropped
250 # 2.3: 'host_floppy' deprecated
251 # 2.5: 'host_floppy' dropped
253 # 2.8: 'replication' added, 'tftp' dropped
254 # 2.9: 'archipelago' dropped
256 # @backing_file: the name of the backing file (for copy-on-write)
258 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
260 # @encrypted: true if the backing device is encrypted
262 # @encryption_key_missing: true if the backing device is encrypted but an
263 # valid encryption key is missing
265 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
267 # @bps: total throughput limit in bytes per second is specified
269 # @bps_rd: read throughput limit in bytes per second is specified
271 # @bps_wr: write throughput limit in bytes per second is specified
273 # @iops: total I/O operations per second is specified
275 # @iops_rd: read I/O operations per second is specified
277 # @iops_wr: write I/O operations per second is specified
279 # @image: the info of image used (since: 1.6)
281 # @bps_max: total throughput limit during bursts,
282 # in bytes (Since 1.7)
284 # @bps_rd_max: read throughput limit during bursts,
285 # in bytes (Since 1.7)
287 # @bps_wr_max: write throughput limit during bursts,
288 # in bytes (Since 1.7)
290 # @iops_max: total I/O operations per second during bursts,
291 # in bytes (Since 1.7)
293 # @iops_rd_max: read I/O operations per second during bursts,
294 # in bytes (Since 1.7)
296 # @iops_wr_max: write I/O operations per second during bursts,
297 # in bytes (Since 1.7)
299 # @bps_max_length: maximum length of the @bps_max burst
300 # period, in seconds. (Since 2.6)
302 # @bps_rd_max_length: maximum length of the @bps_rd_max
303 # burst period, in seconds. (Since 2.6)
305 # @bps_wr_max_length: maximum length of the @bps_wr_max
306 # burst period, in seconds. (Since 2.6)
308 # @iops_max_length: maximum length of the @iops burst
309 # period, in seconds. (Since 2.6)
311 # @iops_rd_max_length: maximum length of the @iops_rd_max
312 # burst period, in seconds. (Since 2.6)
314 # @iops_wr_max_length: maximum length of the @iops_wr_max
315 # burst period, in seconds. (Since 2.6)
317 # @iops_size: an I/O size in bytes (Since 1.7)
319 # @group: throttle group name (Since 2.4)
321 # @cache: the cache mode used for the block device (since: 2.3)
323 # @write_threshold: configured write threshold for the device.
324 # 0 if disabled. (Since 2.3)
329 { 'struct': 'BlockDeviceInfo',
330 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
331 '*backing_file': 'str', 'backing_file_depth': 'int',
332 'encrypted': 'bool', 'encryption_key_missing': 'bool',
333 'detect_zeroes': 'BlockdevDetectZeroesOptions',
334 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
335 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
336 'image': 'ImageInfo',
337 '*bps_max': 'int', '*bps_rd_max': 'int',
338 '*bps_wr_max': 'int', '*iops_max': 'int',
339 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
340 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
341 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
342 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
343 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
344 'write_threshold': 'int' } }
347 # @BlockDeviceIoStatus:
349 # An enumeration of block device I/O status.
351 # @ok: The last I/O operation has succeeded
353 # @failed: The last I/O operation has failed
355 # @nospace: The last I/O operation has failed due to a no-space condition
359 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
362 # @BlockDeviceMapEntry:
364 # Entry in the metadata map of the device (returned by "qemu-img map")
366 # @start: Offset in the image of the first byte described by this entry
369 # @length: Length of the range described by this entry (in bytes)
371 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
372 # before reaching one for which the range is allocated. The value is
373 # in the range 0 to the depth of the image chain - 1.
375 # @zero: the sectors in this range read as zeros
377 # @data: reading the image will actually read data from a file (in particular,
378 # if @offset is present this means that the sectors are not simply
379 # preallocated, but contain actual data in raw format)
381 # @offset: if present, the image file stores the data for this range in
382 # raw format at the given offset.
386 { 'struct': 'BlockDeviceMapEntry',
387 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
388 'data': 'bool', '*offset': 'int' } }
391 # @DirtyBitmapStatus:
393 # An enumeration of possible states that a dirty bitmap can report to the user.
395 # @frozen: The bitmap is currently in-use by a backup operation or block job,
398 # @disabled: The bitmap is currently in-use by an internal operation and is
399 # read-only. It can still be deleted.
401 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
402 # deleted, or used for backup operations.
406 { 'enum': 'DirtyBitmapStatus',
407 'data': ['active', 'disabled', 'frozen'] }
412 # Block dirty bitmap information.
414 # @name: the name of the dirty bitmap (Since 2.4)
416 # @count: number of dirty bytes according to the dirty bitmap
418 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
420 # @status: current status of the dirty bitmap (since 2.4)
424 { 'struct': 'BlockDirtyInfo',
425 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
426 'status': 'DirtyBitmapStatus'} }
431 # Block device information. This structure describes a virtual device and
432 # the backing device associated with it.
434 # @device: The device name associated with the virtual device.
436 # @type: This field is returned only for compatibility reasons, it should
437 # not be used (always returns 'unknown')
439 # @removable: True if the device supports removable media.
441 # @locked: True if the guest has locked this device from having its media
444 # @tray_open: True if the device's tray is open
445 # (only present if it has a tray)
447 # @dirty-bitmaps: dirty bitmaps information (only present if the
448 # driver has one or more dirty bitmaps) (Since 2.0)
450 # @io-status: @BlockDeviceIoStatus. Only present if the device
451 # supports it and the VM is configured to stop on errors
452 # (supported device models: virtio-blk, ide, scsi-disk)
454 # @inserted: @BlockDeviceInfo describing the device if media is
459 { 'struct': 'BlockInfo',
460 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
461 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
462 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
463 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
468 # Get a list of BlockInfo for all virtual block devices.
470 # Returns: a list of @BlockInfo describing each virtual block device
476 # -> { "execute": "query-block" }
481 # "device":"ide0-hd0",
488 # "file":"disks/test.qcow2",
489 # "backing_file_depth":1,
496 # "bps_max": 8000000,
503 # "detect_zeroes": "on",
504 # "write_threshold": 0,
506 # "filename":"disks/test.qcow2",
508 # "virtual-size":2048000,
509 # "backing_file":"base.qcow2",
510 # "full-backing-filename":"disks/base.qcow2",
511 # "backing-filename-format":"qcow2",
515 # "name": "snapshot1",
516 # "vm-state-size": 0,
517 # "date-sec": 10000200,
519 # "vm-clock-sec": 206,
520 # "vm-clock-nsec": 30
524 # "filename":"disks/base.qcow2",
526 # "virtual-size":2048000
534 # "device":"ide1-cd0",
540 # "device":"floppy0",
555 { 'command': 'query-block', 'returns': ['BlockInfo'] }
559 # @BlockDeviceTimedStats:
561 # Statistics of a block device during a given interval of time.
563 # @interval_length: Interval used for calculating the statistics,
566 # @min_rd_latency_ns: Minimum latency of read operations in the
567 # defined interval, in nanoseconds.
569 # @min_wr_latency_ns: Minimum latency of write operations in the
570 # defined interval, in nanoseconds.
572 # @min_flush_latency_ns: Minimum latency of flush operations in the
573 # defined interval, in nanoseconds.
575 # @max_rd_latency_ns: Maximum latency of read operations in the
576 # defined interval, in nanoseconds.
578 # @max_wr_latency_ns: Maximum latency of write operations in the
579 # defined interval, in nanoseconds.
581 # @max_flush_latency_ns: Maximum latency of flush operations in the
582 # defined interval, in nanoseconds.
584 # @avg_rd_latency_ns: Average latency of read operations in the
585 # defined interval, in nanoseconds.
587 # @avg_wr_latency_ns: Average latency of write operations in the
588 # defined interval, in nanoseconds.
590 # @avg_flush_latency_ns: Average latency of flush operations in the
591 # defined interval, in nanoseconds.
593 # @avg_rd_queue_depth: Average number of pending read operations
594 # in the defined interval.
596 # @avg_wr_queue_depth: Average number of pending write operations
597 # in the defined interval.
601 { 'struct': 'BlockDeviceTimedStats',
602 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
603 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
604 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
605 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
606 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
607 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
612 # Statistics of a virtual block device or a block backing device.
614 # @rd_bytes: The number of bytes read by the device.
616 # @wr_bytes: The number of bytes written by the device.
618 # @rd_operations: The number of read operations performed by the device.
620 # @wr_operations: The number of write operations performed by the device.
622 # @flush_operations: The number of cache flush operations performed by the
623 # device (since 0.15.0)
625 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
628 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
630 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
632 # @wr_highest_offset: The offset after the greatest byte written to the
633 # device. The intended use of this information is for
634 # growable sparse files (like qcow2) that are used on top
635 # of a physical device.
637 # @rd_merged: Number of read requests that have been merged into another
638 # request (Since 2.3).
640 # @wr_merged: Number of write requests that have been merged into another
641 # request (Since 2.3).
643 # @idle_time_ns: Time since the last I/O operation, in
644 # nanoseconds. If the field is absent it means that
645 # there haven't been any operations yet (Since 2.5).
647 # @failed_rd_operations: The number of failed read operations
648 # performed by the device (Since 2.5)
650 # @failed_wr_operations: The number of failed write operations
651 # performed by the device (Since 2.5)
653 # @failed_flush_operations: The number of failed flush operations
654 # performed by the device (Since 2.5)
656 # @invalid_rd_operations: The number of invalid read operations
657 # performed by the device (Since 2.5)
659 # @invalid_wr_operations: The number of invalid write operations
660 # performed by the device (Since 2.5)
662 # @invalid_flush_operations: The number of invalid flush operations
663 # performed by the device (Since 2.5)
665 # @account_invalid: Whether invalid operations are included in the
666 # last access statistics (Since 2.5)
668 # @account_failed: Whether failed operations are included in the
669 # latency and last access statistics (Since 2.5)
671 # @timed_stats: Statistics specific to the set of previously defined
672 # intervals of time (Since 2.5)
676 { 'struct': 'BlockDeviceStats',
677 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
678 'wr_operations': 'int', 'flush_operations': 'int',
679 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
680 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
681 'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
682 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
683 'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
684 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
685 'account_invalid': 'bool', 'account_failed': 'bool',
686 'timed_stats': ['BlockDeviceTimedStats'] } }
691 # Statistics of a virtual block device or a block backing device.
693 # @device: If the stats are for a virtual block device, the name
694 # corresponding to the virtual block device.
696 # @node-name: The node name of the device. (Since 2.3)
698 # @stats: A @BlockDeviceStats for the device.
700 # @parent: This describes the file block device if it has one.
701 # Contains recursively the statistics of the underlying
702 # protocol (e.g. the host file for a qcow2 image). If there is
703 # no underlying protocol, this field is omitted
705 # @backing: This describes the backing block device if it has one.
710 { 'struct': 'BlockStats',
711 'data': {'*device': 'str', '*node-name': 'str',
712 'stats': 'BlockDeviceStats',
713 '*parent': 'BlockStats',
714 '*backing': 'BlockStats'} }
719 # Query the @BlockStats for all virtual block devices.
721 # @query-nodes: If true, the command will query all the block nodes
722 # that have a node name, in a list which will include "parent"
723 # information, but not "backing".
724 # If false or omitted, the behavior is as before - query all the
725 # device backends, recursively including their "parent" and
726 # "backing". (Since 2.3)
728 # Returns: A list of @BlockStats for each virtual block devices.
734 # -> { "execute": "query-blockstats" }
738 # "device":"ide0-hd0",
741 # "wr_highest_offset":3686448128,
742 # "wr_bytes":9786368,
743 # "wr_operations":751,
744 # "rd_bytes":122567168,
745 # "rd_operations":36772
746 # "wr_total_times_ns":313253456
747 # "rd_total_times_ns":3465673657
748 # "flush_total_times_ns":49653
749 # "flush_operations":61,
752 # "idle_time_ns":2953431879,
753 # "account_invalid":true,
754 # "account_failed":false
758 # "wr_highest_offset":2821110784,
759 # "wr_bytes":9786368,
760 # "wr_operations":692,
761 # "rd_bytes":122739200,
762 # "rd_operations":36604
763 # "flush_operations":51,
764 # "wr_total_times_ns":313253456
765 # "rd_total_times_ns":3465673657
766 # "flush_total_times_ns":49653,
769 # "idle_time_ns":2953431879,
770 # "account_invalid":true,
771 # "account_failed":false
775 # "device":"ide1-cd0",
777 # "wr_highest_offset":0,
782 # "flush_operations":0,
783 # "wr_total_times_ns":0
784 # "rd_total_times_ns":0
785 # "flush_total_times_ns":0,
788 # "account_invalid":false,
789 # "account_failed":false
793 # "device":"floppy0",
795 # "wr_highest_offset":0,
800 # "flush_operations":0,
801 # "wr_total_times_ns":0
802 # "rd_total_times_ns":0
803 # "flush_total_times_ns":0,
806 # "account_invalid":false,
807 # "account_failed":false
813 # "wr_highest_offset":0,
818 # "flush_operations":0,
819 # "wr_total_times_ns":0
820 # "rd_total_times_ns":0
821 # "flush_total_times_ns":0,
824 # "account_invalid":false,
825 # "account_failed":false
832 { 'command': 'query-blockstats',
833 'data': { '*query-nodes': 'bool' },
834 'returns': ['BlockStats'] }
839 # An enumeration of possible behaviors for errors on I/O operations.
840 # The exact meaning depends on whether the I/O was initiated by a guest
843 # @report: for guest operations, report the error to the guest;
844 # for jobs, cancel the job
846 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
847 # or BLOCK_JOB_ERROR)
849 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
851 # @stop: for guest operations, stop the virtual machine;
852 # for jobs, pause the job
854 # @auto: inherit the error handling policy of the backend (since: 2.7)
858 { 'enum': 'BlockdevOnError',
859 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
864 # An enumeration of possible behaviors for the initial synchronization
865 # phase of storage mirroring.
867 # @top: copies data in the topmost image to the destination
869 # @full: copies data from all images to the destination
871 # @none: only copy data written from now on
873 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
877 { 'enum': 'MirrorSyncMode',
878 'data': ['top', 'full', 'none', 'incremental'] }
883 # Type of a block job.
885 # @commit: block commit job type, see "block-commit"
887 # @stream: block stream job type, see "block-stream"
889 # @mirror: drive mirror job type, see "drive-mirror"
891 # @backup: drive backup job type, see "drive-backup"
895 { 'enum': 'BlockJobType',
896 'data': ['commit', 'stream', 'mirror', 'backup'] }
901 # Information about a long-running block device operation.
903 # @type: the job type ('stream' for image streaming)
905 # @device: The job identifier. Originally the device name but other
906 # values are allowed since QEMU 2.7
908 # @len: the maximum progress value
910 # @busy: false if the job is known to be in a quiescent state, with
911 # no pending I/O. Since 1.3.
913 # @paused: whether the job is paused or, if @busy is true, will
914 # pause itself as soon as possible. Since 1.3.
916 # @offset: the current progress value
918 # @speed: the rate limit, bytes per second
920 # @io-status: the status of the job (since 1.3)
922 # @ready: true if the job may be completed (since 2.2)
926 { 'struct': 'BlockJobInfo',
927 'data': {'type': 'str', 'device': 'str', 'len': 'int',
928 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
929 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool'} }
934 # Return information about long-running block device operations.
936 # Returns: a list of @BlockJobInfo for each active block job
940 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
945 # This command sets the password of a block device that has not been open
946 # with a password and requires one.
948 # The two cases where this can happen are a block device is created through
949 # QEMU's initial command line or a block device is changed through the legacy
952 # In the event that the block device is created through the initial command
953 # line, the VM will start in the stopped state regardless of whether '-S' is
954 # used. The intention is for a management tool to query the block devices to
955 # determine which ones are encrypted, set the passwords with this command, and
956 # then start the guest with the @cont command.
958 # Either @device or @node-name must be set but not both.
960 # @device: the name of the block backend device to set the password on
962 # @node-name: graph node name to set the password on (Since 2.0)
964 # @password: the password to use for the device
966 # Returns: nothing on success
967 # If @device is not a valid block device, DeviceNotFound
968 # If @device is not encrypted, DeviceNotEncrypted
970 # Notes: Not all block formats support encryption and some that do are not
971 # able to validate that a password is correct. Disk corruption may
972 # occur if an invalid password is specified.
978 # -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
979 # "password": "12345" } }
980 # <- { "return": {} }
983 { 'command': 'block_passwd', 'data': {'*device': 'str',
984 '*node-name': 'str', 'password': 'str'} }
989 # Resize a block image while a guest is running.
991 # Either @device or @node-name must be set but not both.
993 # @device: the name of the device to get the image resized
995 # @node-name: graph node name to get the image resized (Since 2.0)
997 # @size: new image size in bytes
999 # Returns: nothing on success
1000 # If @device is not a valid block device, DeviceNotFound
1006 # -> { "execute": "block_resize",
1007 # "arguments": { "device": "scratch", "size": 1073741824 } }
1008 # <- { "return": {} }
1011 { 'command': 'block_resize', 'data': { '*device': 'str',
1012 '*node-name': 'str',
1018 # An enumeration that tells QEMU how to set the backing file path in
1021 # @existing: QEMU should look for an existing image file.
1023 # @absolute-paths: QEMU should create a new image with absolute paths
1024 # for the backing file. If there is no backing file available, the new
1025 # image will not be backed either.
1029 { 'enum': 'NewImageMode',
1030 'data': [ 'existing', 'absolute-paths' ] }
1033 # @BlockdevSnapshotSync:
1035 # Either @device or @node-name must be set but not both.
1037 # @device: the name of the device to generate the snapshot from.
1039 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1041 # @snapshot-file: the target of the new image. If the file exists, or
1042 # if it is a device, the snapshot will be created in the existing
1043 # file/device. Otherwise, a new file will be created.
1045 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1047 # @format: the format of the snapshot image, default is 'qcow2'.
1049 # @mode: whether and how QEMU should create a new image, default is
1052 { 'struct': 'BlockdevSnapshotSync',
1053 'data': { '*device': 'str', '*node-name': 'str',
1054 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1055 '*format': 'str', '*mode': 'NewImageMode' } }
1058 # @BlockdevSnapshot:
1060 # @node: device or node name that will have a snapshot created.
1062 # @overlay: reference to the existing block device that will become
1063 # the overlay of @node, as part of creating the snapshot.
1064 # It must not have a current backing file (this can be
1065 # achieved by passing "backing": "" to blockdev-add).
1069 { 'struct': 'BlockdevSnapshot',
1070 'data': { 'node': 'str', 'overlay': 'str' } }
1075 # @job-id: identifier for the newly-created block job. If
1076 # omitted, the device name will be used. (Since 2.7)
1078 # @device: the device name or node-name of a root node which should be copied.
1080 # @target: the target of the new image. If the file exists, or if it
1081 # is a device, the existing file/device will be used as the new
1082 # destination. If it does not exist, a new file will be created.
1084 # @format: the format of the new destination, default is to
1085 # probe if @mode is 'existing', else the format of the source
1087 # @sync: what parts of the disk image should be copied to the destination
1088 # (all the disk, only the sectors allocated in the topmost image, from a
1089 # dirty bitmap, or only new I/O).
1091 # @mode: whether and how QEMU should create a new image, default is
1094 # @speed: the maximum speed, in bytes per second
1096 # @bitmap: the name of dirty bitmap if sync is "incremental".
1097 # Must be present if sync is "incremental", must NOT be present
1098 # otherwise. (Since 2.4)
1100 # @compress: true to compress data, if the target format supports it.
1101 # (default: false) (since 2.8)
1103 # @on-source-error: the action to take on an error on the source,
1104 # default 'report'. 'stop' and 'enospc' can only be used
1105 # if the block device supports io-status (see BlockInfo).
1107 # @on-target-error: the action to take on an error on the target,
1108 # default 'report' (no limitations, since this applies to
1109 # a different block device than @device).
1111 # Note: @on-source-error and @on-target-error only affect background
1112 # I/O. If an error occurs during a guest write request, the device's
1113 # rerror/werror actions will be used.
1117 { 'struct': 'DriveBackup',
1118 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1119 '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1120 '*speed': 'int', '*bitmap': 'str', '*compress': 'bool',
1121 '*on-source-error': 'BlockdevOnError',
1122 '*on-target-error': 'BlockdevOnError' } }
1127 # @job-id: identifier for the newly-created block job. If
1128 # omitted, the device name will be used. (Since 2.7)
1130 # @device: the device name or node-name of a root node which should be copied.
1132 # @target: the device name or node-name of the backup target node.
1134 # @sync: what parts of the disk image should be copied to the destination
1135 # (all the disk, only the sectors allocated in the topmost image, or
1138 # @speed: the maximum speed, in bytes per second. The default is 0,
1141 # @compress: true to compress data, if the target format supports it.
1142 # (default: false) (since 2.8)
1144 # @on-source-error: the action to take on an error on the source,
1145 # default 'report'. 'stop' and 'enospc' can only be used
1146 # if the block device supports io-status (see BlockInfo).
1148 # @on-target-error: the action to take on an error on the target,
1149 # default 'report' (no limitations, since this applies to
1150 # a different block device than @device).
1152 # Note: @on-source-error and @on-target-error only affect background
1153 # I/O. If an error occurs during a guest write request, the device's
1154 # rerror/werror actions will be used.
1158 { 'struct': 'BlockdevBackup',
1159 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1160 'sync': 'MirrorSyncMode',
1162 '*compress': 'bool',
1163 '*on-source-error': 'BlockdevOnError',
1164 '*on-target-error': 'BlockdevOnError' } }
1167 # @blockdev-snapshot-sync:
1169 # Generates a synchronous snapshot of a block device.
1171 # For the arguments, see the documentation of BlockdevSnapshotSync.
1173 # Returns: nothing on success
1174 # If @device is not a valid block device, DeviceNotFound
1180 # -> { "execute": "blockdev-snapshot-sync",
1181 # "arguments": { "device": "ide-hd0",
1183 # "/some/place/my-image",
1184 # "format": "qcow2" } }
1185 # <- { "return": {} }
1188 { 'command': 'blockdev-snapshot-sync',
1189 'data': 'BlockdevSnapshotSync' }
1193 # @blockdev-snapshot:
1195 # Generates a snapshot of a block device.
1197 # Create a snapshot, by installing 'node' as the backing image of
1198 # 'overlay'. Additionally, if 'node' is associated with a block
1199 # device, the block device changes to using 'overlay' as its new active
1202 # For the arguments, see the documentation of BlockdevSnapshot.
1208 # -> { "execute": "blockdev-add",
1209 # "arguments": { "options": { "driver": "qcow2",
1210 # "node-name": "node1534",
1211 # "file": { "driver": "file",
1212 # "filename": "hd1.qcow2" },
1213 # "backing": "" } } }
1215 # <- { "return": {} }
1217 # -> { "execute": "blockdev-snapshot",
1218 # "arguments": { "node": "ide-hd0",
1219 # "overlay": "node1534" } }
1220 # <- { "return": {} }
1223 { 'command': 'blockdev-snapshot',
1224 'data': 'BlockdevSnapshot' }
1227 # @change-backing-file:
1229 # Change the backing file in the image file metadata. This does not
1230 # cause QEMU to reopen the image file to reparse the backing filename
1231 # (it may, however, perform a reopen to change permissions from
1232 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1233 # into the image file metadata, and the QEMU internal strings are
1236 # @image-node-name: The name of the block driver state node of the
1237 # image to modify. The "device" argument is used
1238 # to verify "image-node-name" is in the chain
1239 # described by "device".
1241 # @device: The device name or node-name of the root node that owns
1244 # @backing-file: The string to write as the backing file. This
1245 # string is not validated, so care should be taken
1246 # when specifying the string or the image chain may
1247 # not be able to be reopened again.
1249 # Returns: Nothing on success
1251 # If "device" does not exist or cannot be determined, DeviceNotFound
1255 { 'command': 'change-backing-file',
1256 'data': { 'device': 'str', 'image-node-name': 'str',
1257 'backing-file': 'str' } }
1262 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1263 # writes data between 'top' and 'base' into 'base'.
1265 # @job-id: identifier for the newly-created block job. If
1266 # omitted, the device name will be used. (Since 2.7)
1268 # @device: the device name or node-name of a root node
1270 # @base: The file name of the backing image to write data into.
1271 # If not specified, this is the deepest backing image.
1273 # @top: The file name of the backing image within the image chain,
1274 # which contains the topmost data to be committed down. If
1275 # not specified, this is the active layer.
1277 # @backing-file: The backing file string to write into the overlay
1278 # image of 'top'. If 'top' is the active layer,
1279 # specifying a backing file string is an error. This
1280 # filename is not validated.
1282 # If a pathname string is such that it cannot be
1283 # resolved by QEMU, that means that subsequent QMP or
1284 # HMP commands must use node-names for the image in
1285 # question, as filename lookup methods will fail.
1287 # If not specified, QEMU will automatically determine
1288 # the backing file string to use, or error out if
1289 # there is no obvious choice. Care should be taken
1290 # when specifying the string, to specify a valid
1291 # filename or protocol.
1294 # If top == base, that is an error.
1295 # If top == active, the job will not be completed by itself,
1296 # user needs to complete the job with the block-job-complete
1297 # command after getting the ready event. (Since 2.0)
1299 # If the base image is smaller than top, then the base image
1300 # will be resized to be the same size as top. If top is
1301 # smaller than the base image, the base will not be
1302 # truncated. If you want the base image size to match the
1303 # size of the smaller top, you can safely truncate it
1304 # yourself once the commit operation successfully completes.
1306 # @speed: the maximum speed, in bytes per second
1308 # @filter-node-name: the node name that should be assigned to the
1309 # filter driver that the commit job inserts into the graph
1310 # above @top. If this option is not given, a node name is
1311 # autogenerated. (Since: 2.9)
1313 # Returns: Nothing on success
1314 # If commit or stream is already active on this device, DeviceInUse
1315 # If @device does not exist, DeviceNotFound
1316 # If image commit is not supported by this device, NotSupported
1317 # If @base or @top is invalid, a generic error is returned
1318 # If @speed is invalid, InvalidParameter
1324 # -> { "execute": "block-commit",
1325 # "arguments": { "device": "virtio0",
1326 # "top": "/tmp/snap1.qcow2" } }
1327 # <- { "return": {} }
1330 { 'command': 'block-commit',
1331 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
1332 '*backing-file': 'str', '*speed': 'int',
1333 '*filter-node-name': 'str' } }
1338 # Start a point-in-time copy of a block device to a new destination. The
1339 # status of ongoing drive-backup operations can be checked with
1340 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1341 # The operation can be stopped before it has completed using the
1342 # block-job-cancel command.
1344 # Returns: nothing on success
1345 # If @device is not a valid block device, GenericError
1351 # -> { "execute": "drive-backup",
1352 # "arguments": { "device": "drive0",
1354 # "target": "backup.img" } }
1355 # <- { "return": {} }
1358 { 'command': 'drive-backup', 'boxed': true,
1359 'data': 'DriveBackup' }
1364 # Start a point-in-time copy of a block device to a new destination. The
1365 # status of ongoing blockdev-backup operations can be checked with
1366 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1367 # The operation can be stopped before it has completed using the
1368 # block-job-cancel command.
1370 # Returns: nothing on success
1371 # If @device is not a valid block device, DeviceNotFound
1376 # -> { "execute": "blockdev-backup",
1377 # "arguments": { "device": "src-id",
1379 # "target": "tgt-id" } }
1380 # <- { "return": {} }
1383 { 'command': 'blockdev-backup', 'boxed': true,
1384 'data': 'BlockdevBackup' }
1388 # @query-named-block-nodes:
1390 # Get the named block driver list
1392 # Returns: the list of BlockDeviceInfo
1398 # -> { "execute": "query-named-block-nodes" }
1399 # <- { "return": [ { "ro":false,
1401 # "encrypted":false,
1402 # "file":"disks/test.qcow2",
1403 # "node-name": "my-node",
1404 # "backing_file_depth":1,
1411 # "bps_max": 8000000,
1418 # "write_threshold": 0,
1420 # "filename":"disks/test.qcow2",
1422 # "virtual-size":2048000,
1423 # "backing_file":"base.qcow2",
1424 # "full-backing-filename":"disks/base.qcow2",
1425 # "backing-filename-format":"qcow2",
1429 # "name": "snapshot1",
1430 # "vm-state-size": 0,
1431 # "date-sec": 10000200,
1433 # "vm-clock-sec": 206,
1434 # "vm-clock-nsec": 30
1438 # "filename":"disks/base.qcow2",
1440 # "virtual-size":2048000
1445 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1450 # Start mirroring a block device's writes to a new destination. target
1451 # specifies the target of the new image. If the file exists, or if it
1452 # is a device, it will be used as the new destination for writes. If
1453 # it does not exist, a new file will be created. format specifies the
1454 # format of the mirror image, default is to probe if mode='existing',
1455 # else the format of the source.
1457 # Returns: nothing on success
1458 # If @device is not a valid block device, GenericError
1464 # -> { "execute": "drive-mirror",
1465 # "arguments": { "device": "ide-hd0",
1466 # "target": "/some/place/my-image",
1468 # "format": "qcow2" } }
1469 # <- { "return": {} }
1472 { 'command': 'drive-mirror', 'boxed': true,
1473 'data': 'DriveMirror' }
1478 # A set of parameters describing drive mirror setup.
1480 # @job-id: identifier for the newly-created block job. If
1481 # omitted, the device name will be used. (Since 2.7)
1483 # @device: the device name or node-name of a root node whose writes should be
1486 # @target: the target of the new image. If the file exists, or if it
1487 # is a device, the existing file/device will be used as the new
1488 # destination. If it does not exist, a new file will be created.
1490 # @format: the format of the new destination, default is to
1491 # probe if @mode is 'existing', else the format of the source
1493 # @node-name: the new block driver state node name in the graph
1496 # @replaces: with sync=full graph node name to be replaced by the new
1497 # image when a whole image copy is done. This can be used to repair
1498 # broken Quorum files. (Since 2.1)
1500 # @mode: whether and how QEMU should create a new image, default is
1503 # @speed: the maximum speed, in bytes per second
1505 # @sync: what parts of the disk image should be copied to the destination
1506 # (all the disk, only the sectors allocated in the topmost image, or
1509 # @granularity: granularity of the dirty bitmap, default is 64K
1510 # if the image format doesn't have clusters, 4K if the clusters
1511 # are smaller than that, else the cluster size. Must be a
1512 # power of 2 between 512 and 64M (since 1.4).
1514 # @buf-size: maximum amount of data in flight from source to
1515 # target (since 1.4).
1517 # @on-source-error: the action to take on an error on the source,
1518 # default 'report'. 'stop' and 'enospc' can only be used
1519 # if the block device supports io-status (see BlockInfo).
1521 # @on-target-error: the action to take on an error on the target,
1522 # default 'report' (no limitations, since this applies to
1523 # a different block device than @device).
1524 # @unmap: Whether to try to unmap target sectors where source has
1525 # only zero. If true, and target unallocated sectors will read as zero,
1526 # target image sectors will be unmapped; otherwise, zeroes will be
1527 # written. Both will result in identical contents.
1528 # Default is true. (Since 2.4)
1532 { 'struct': 'DriveMirror',
1533 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1534 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1535 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1536 '*speed': 'int', '*granularity': 'uint32',
1537 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1538 '*on-target-error': 'BlockdevOnError',
1539 '*unmap': 'bool' } }
1542 # @BlockDirtyBitmap:
1544 # @node: name of device/node which the bitmap is tracking
1546 # @name: name of the dirty bitmap
1550 { 'struct': 'BlockDirtyBitmap',
1551 'data': { 'node': 'str', 'name': 'str' } }
1554 # @BlockDirtyBitmapAdd:
1556 # @node: name of device/node which the bitmap is tracking
1558 # @name: name of the dirty bitmap
1560 # @granularity: the bitmap granularity, default is 64k for
1561 # block-dirty-bitmap-add
1565 { 'struct': 'BlockDirtyBitmapAdd',
1566 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32' } }
1569 # @block-dirty-bitmap-add:
1571 # Create a dirty bitmap with a name on the node, and start tracking the writes.
1573 # Returns: nothing on success
1574 # If @node is not a valid block device or node, DeviceNotFound
1575 # If @name is already taken, GenericError with an explanation
1581 # -> { "execute": "block-dirty-bitmap-add",
1582 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1583 # <- { "return": {} }
1586 { 'command': 'block-dirty-bitmap-add',
1587 'data': 'BlockDirtyBitmapAdd' }
1590 # @block-dirty-bitmap-remove:
1592 # Stop write tracking and remove the dirty bitmap that was created
1593 # with block-dirty-bitmap-add.
1595 # Returns: nothing on success
1596 # If @node is not a valid block device or node, DeviceNotFound
1597 # If @name is not found, GenericError with an explanation
1598 # if @name is frozen by an operation, GenericError
1604 # -> { "execute": "block-dirty-bitmap-remove",
1605 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1606 # <- { "return": {} }
1609 { 'command': 'block-dirty-bitmap-remove',
1610 'data': 'BlockDirtyBitmap' }
1613 # @block-dirty-bitmap-clear:
1615 # Clear (reset) a dirty bitmap on the device, so that an incremental
1616 # backup from this point in time forward will only backup clusters
1617 # modified after this clear operation.
1619 # Returns: nothing on success
1620 # If @node is not a valid block device, DeviceNotFound
1621 # If @name is not found, GenericError with an explanation
1627 # -> { "execute": "block-dirty-bitmap-clear",
1628 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1629 # <- { "return": {} }
1632 { 'command': 'block-dirty-bitmap-clear',
1633 'data': 'BlockDirtyBitmap' }
1638 # Start mirroring a block device's writes to a new destination.
1640 # @job-id: identifier for the newly-created block job. If
1641 # omitted, the device name will be used. (Since 2.7)
1643 # @device: The device name or node-name of a root node whose writes should be
1646 # @target: the id or node-name of the block device to mirror to. This mustn't be
1647 # attached to guest.
1649 # @replaces: with sync=full graph node name to be replaced by the new
1650 # image when a whole image copy is done. This can be used to repair
1651 # broken Quorum files.
1653 # @speed: the maximum speed, in bytes per second
1655 # @sync: what parts of the disk image should be copied to the destination
1656 # (all the disk, only the sectors allocated in the topmost image, or
1659 # @granularity: granularity of the dirty bitmap, default is 64K
1660 # if the image format doesn't have clusters, 4K if the clusters
1661 # are smaller than that, else the cluster size. Must be a
1662 # power of 2 between 512 and 64M
1664 # @buf-size: maximum amount of data in flight from source to
1667 # @on-source-error: the action to take on an error on the source,
1668 # default 'report'. 'stop' and 'enospc' can only be used
1669 # if the block device supports io-status (see BlockInfo).
1671 # @on-target-error: the action to take on an error on the target,
1672 # default 'report' (no limitations, since this applies to
1673 # a different block device than @device).
1675 # @filter-node-name: the node name that should be assigned to the
1676 # filter driver that the mirror job inserts into the graph
1677 # above @device. If this option is not given, a node name is
1678 # autogenerated. (Since: 2.9)
1680 # Returns: nothing on success.
1686 # -> { "execute": "blockdev-mirror",
1687 # "arguments": { "device": "ide-hd0",
1688 # "target": "target0",
1689 # "sync": "full" } }
1690 # <- { "return": {} }
1693 { 'command': 'blockdev-mirror',
1694 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1696 'sync': 'MirrorSyncMode',
1697 '*speed': 'int', '*granularity': 'uint32',
1698 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1699 '*on-target-error': 'BlockdevOnError',
1700 '*filter-node-name': 'str' } }
1703 # @block_set_io_throttle:
1705 # Change I/O throttle limits for a block drive.
1707 # Since QEMU 2.4, each device with I/O limits is member of a throttle
1710 # If two or more devices are members of the same group, the limits
1711 # will apply to the combined I/O of the whole group in a round-robin
1712 # fashion. Therefore, setting new I/O limits to a device will affect
1715 # The name of the group can be specified using the 'group' parameter.
1716 # If the parameter is unset, it is assumed to be the current group of
1717 # that device. If it's not in any group yet, the name of the device
1718 # will be used as the name for its group.
1720 # The 'group' parameter can also be used to move a device to a
1721 # different group. In this case the limits specified in the parameters
1722 # will be applied to the new group only.
1724 # I/O limits can be disabled by setting all of them to 0. In this case
1725 # the device will be removed from its group and the rest of its
1726 # members will not be affected. The 'group' parameter is ignored.
1728 # Returns: Nothing on success
1729 # If @device is not a valid block device, DeviceNotFound
1735 # -> { "execute": "block_set_io_throttle",
1736 # "arguments": { "id": "ide0-1-0",
1743 # "bps_max": 8000000,
1749 # "bps_max_length": 60,
1750 # "iops_size": 0 } }
1751 # <- { "return": {} }
1753 { 'command': 'block_set_io_throttle', 'boxed': true,
1754 'data': 'BlockIOThrottle' }
1759 # A set of parameters describing block throttling.
1761 # @device: Block device name (deprecated, use @id instead)
1763 # @id: The name or QOM path of the guest device (since: 2.8)
1765 # @bps: total throughput limit in bytes per second
1767 # @bps_rd: read throughput limit in bytes per second
1769 # @bps_wr: write throughput limit in bytes per second
1771 # @iops: total I/O operations per second
1773 # @iops_rd: read I/O operations per second
1775 # @iops_wr: write I/O operations per second
1777 # @bps_max: total throughput limit during bursts,
1778 # in bytes (Since 1.7)
1780 # @bps_rd_max: read throughput limit during bursts,
1781 # in bytes (Since 1.7)
1783 # @bps_wr_max: write throughput limit during bursts,
1784 # in bytes (Since 1.7)
1786 # @iops_max: total I/O operations per second during bursts,
1787 # in bytes (Since 1.7)
1789 # @iops_rd_max: read I/O operations per second during bursts,
1790 # in bytes (Since 1.7)
1792 # @iops_wr_max: write I/O operations per second during bursts,
1793 # in bytes (Since 1.7)
1795 # @bps_max_length: maximum length of the @bps_max burst
1796 # period, in seconds. It must only
1797 # be set if @bps_max is set as well.
1798 # Defaults to 1. (Since 2.6)
1800 # @bps_rd_max_length: maximum length of the @bps_rd_max
1801 # burst period, in seconds. It must only
1802 # be set if @bps_rd_max is set as well.
1803 # Defaults to 1. (Since 2.6)
1805 # @bps_wr_max_length: maximum length of the @bps_wr_max
1806 # burst period, in seconds. It must only
1807 # be set if @bps_wr_max is set as well.
1808 # Defaults to 1. (Since 2.6)
1810 # @iops_max_length: maximum length of the @iops burst
1811 # period, in seconds. It must only
1812 # be set if @iops_max is set as well.
1813 # Defaults to 1. (Since 2.6)
1815 # @iops_rd_max_length: maximum length of the @iops_rd_max
1816 # burst period, in seconds. It must only
1817 # be set if @iops_rd_max is set as well.
1818 # Defaults to 1. (Since 2.6)
1820 # @iops_wr_max_length: maximum length of the @iops_wr_max
1821 # burst period, in seconds. It must only
1822 # be set if @iops_wr_max is set as well.
1823 # Defaults to 1. (Since 2.6)
1825 # @iops_size: an I/O size in bytes (Since 1.7)
1827 # @group: throttle group name (Since 2.4)
1831 { 'struct': 'BlockIOThrottle',
1832 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
1833 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
1834 '*bps_max': 'int', '*bps_rd_max': 'int',
1835 '*bps_wr_max': 'int', '*iops_max': 'int',
1836 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
1837 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
1838 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
1839 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
1840 '*iops_size': 'int', '*group': 'str' } }
1845 # Copy data from a backing file into a block device.
1847 # The block streaming operation is performed in the background until the entire
1848 # backing file has been copied. This command returns immediately once streaming
1849 # has started. The status of ongoing block streaming operations can be checked
1850 # with query-block-jobs. The operation can be stopped before it has completed
1851 # using the block-job-cancel command.
1853 # The node that receives the data is called the top image, can be located in
1854 # any part of the chain (but always above the base image; see below) and can be
1855 # specified using its device or node name. Earlier qemu versions only allowed
1856 # 'device' to name the top level node; presence of the 'base-node' parameter
1857 # during introspection can be used as a witness of the enhanced semantics
1860 # If a base file is specified then sectors are not copied from that base file and
1861 # its backing chain. When streaming completes the image file will have the base
1862 # file as its backing file. This can be used to stream a subset of the backing
1863 # file chain instead of flattening the entire image.
1865 # On successful completion the image file is updated to drop the backing file
1866 # and the BLOCK_JOB_COMPLETED event is emitted.
1868 # @job-id: identifier for the newly-created block job. If
1869 # omitted, the device name will be used. (Since 2.7)
1871 # @device: the device or node name of the top image
1873 # @base: the common backing file name.
1874 # It cannot be set if @base-node is also set.
1876 # @base-node: the node name of the backing file.
1877 # It cannot be set if @base is also set. (Since 2.8)
1879 # @backing-file: The backing file string to write into the top
1880 # image. This filename is not validated.
1882 # If a pathname string is such that it cannot be
1883 # resolved by QEMU, that means that subsequent QMP or
1884 # HMP commands must use node-names for the image in
1885 # question, as filename lookup methods will fail.
1887 # If not specified, QEMU will automatically determine
1888 # the backing file string to use, or error out if there
1889 # is no obvious choice. Care should be taken when
1890 # specifying the string, to specify a valid filename or
1894 # @speed: the maximum speed, in bytes per second
1896 # @on-error: the action to take on an error (default report).
1897 # 'stop' and 'enospc' can only be used if the block device
1898 # supports io-status (see BlockInfo). Since 1.3.
1900 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
1906 # -> { "execute": "block-stream",
1907 # "arguments": { "device": "virtio0",
1908 # "base": "/tmp/master.qcow2" } }
1909 # <- { "return": {} }
1912 { 'command': 'block-stream',
1913 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
1914 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
1915 '*on-error': 'BlockdevOnError' } }
1918 # @block-job-set-speed:
1920 # Set maximum speed for a background block operation.
1922 # This command can only be issued when there is an active block job.
1924 # Throttling can be disabled by setting the speed to 0.
1926 # @device: The job identifier. This used to be a device name (hence
1927 # the name of the parameter), but since QEMU 2.7 it can have
1930 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
1933 # Returns: Nothing on success
1934 # If no background operation is active on this device, DeviceNotActive
1938 { 'command': 'block-job-set-speed',
1939 'data': { 'device': 'str', 'speed': 'int' } }
1942 # @block-job-cancel:
1944 # Stop an active background block operation.
1946 # This command returns immediately after marking the active background block
1947 # operation for cancellation. It is an error to call this command if no
1948 # operation is in progress.
1950 # The operation will cancel as soon as possible and then emit the
1951 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
1952 # enumerated using query-block-jobs.
1954 # For streaming, the image file retains its backing file unless the streaming
1955 # operation happens to complete just as it is being cancelled. A new streaming
1956 # operation can be started at a later time to finish copying all data from the
1959 # @device: The job identifier. This used to be a device name (hence
1960 # the name of the parameter), but since QEMU 2.7 it can have
1963 # @force: whether to allow cancellation of a paused job (default
1964 # false). Since 1.3.
1966 # Returns: Nothing on success
1967 # If no background operation is active on this device, DeviceNotActive
1971 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
1976 # Pause an active background block operation.
1978 # This command returns immediately after marking the active background block
1979 # operation for pausing. It is an error to call this command if no
1980 # operation is in progress. Pausing an already paused job has no cumulative
1981 # effect; a single block-job-resume command will resume the job.
1983 # The operation will pause as soon as possible. No event is emitted when
1984 # the operation is actually paused. Cancelling a paused job automatically
1987 # @device: The job identifier. This used to be a device name (hence
1988 # the name of the parameter), but since QEMU 2.7 it can have
1991 # Returns: Nothing on success
1992 # If no background operation is active on this device, DeviceNotActive
1996 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
1999 # @block-job-resume:
2001 # Resume an active background block operation.
2003 # This command returns immediately after resuming a paused background block
2004 # operation. It is an error to call this command if no operation is in
2005 # progress. Resuming an already running job is not an error.
2007 # This command also clears the error status of the job.
2009 # @device: The job identifier. This used to be a device name (hence
2010 # the name of the parameter), but since QEMU 2.7 it can have
2013 # Returns: Nothing on success
2014 # If no background operation is active on this device, DeviceNotActive
2018 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2021 # @block-job-complete:
2023 # Manually trigger completion of an active background block operation. This
2024 # is supported for drive mirroring, where it also switches the device to
2025 # write to the target path only. The ability to complete is signaled with
2026 # a BLOCK_JOB_READY event.
2028 # This command completes an active background block operation synchronously.
2029 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2030 # is not defined. Note that if an I/O error occurs during the processing of
2031 # this command: 1) the command itself will fail; 2) the error will be processed
2032 # according to the rerror/werror arguments that were specified when starting
2035 # A cancelled or paused job cannot be completed.
2037 # @device: The job identifier. This used to be a device name (hence
2038 # the name of the parameter), but since QEMU 2.7 it can have
2041 # Returns: Nothing on success
2042 # If no background operation is active on this device, DeviceNotActive
2046 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2049 # @BlockdevDiscardOptions:
2051 # Determines how to handle discard requests.
2053 # @ignore: Ignore the request
2054 # @unmap: Forward as an unmap request
2058 { 'enum': 'BlockdevDiscardOptions',
2059 'data': [ 'ignore', 'unmap' ] }
2062 # @BlockdevDetectZeroesOptions:
2064 # Describes the operation mode for the automatic conversion of plain
2065 # zero writes by the OS to driver specific optimized zero write commands.
2067 # @off: Disabled (default)
2069 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2070 # also that @BlockdevDiscardOptions is set to unmap for this device.
2074 { 'enum': 'BlockdevDetectZeroesOptions',
2075 'data': [ 'off', 'on', 'unmap' ] }
2078 # @BlockdevAioOptions:
2080 # Selects the AIO backend to handle I/O requests
2082 # @threads: Use qemu's thread pool
2083 # @native: Use native AIO backend (only Linux and Windows)
2087 { 'enum': 'BlockdevAioOptions',
2088 'data': [ 'threads', 'native' ] }
2091 # @BlockdevCacheOptions:
2093 # Includes cache-related options for block devices
2095 # @direct: enables use of O_DIRECT (bypass the host page cache;
2097 # @no-flush: ignore any flush requests for the device (default:
2102 { 'struct': 'BlockdevCacheOptions',
2103 'data': { '*direct': 'bool',
2104 '*no-flush': 'bool' } }
2109 # Drivers that are supported in block device operations.
2115 { 'enum': 'BlockdevDriver',
2116 'data': [ 'blkdebug', 'blkverify', 'bochs', 'cloop',
2117 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
2118 'host_device', 'http', 'https', 'iscsi', 'luks', 'nbd', 'nfs',
2119 'null-aio', 'null-co', 'parallels', 'qcow', 'qcow2', 'qed',
2120 'quorum', 'raw', 'rbd', 'replication', 'sheepdog', 'ssh',
2121 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2124 # @BlockdevOptionsFile:
2126 # Driver specific block device options for the file backend.
2128 # @filename: path to the image file
2129 # @aio: AIO backend (default: threads) (since: 2.8)
2133 { 'struct': 'BlockdevOptionsFile',
2134 'data': { 'filename': 'str',
2135 '*aio': 'BlockdevAioOptions' } }
2138 # @BlockdevOptionsNull:
2140 # Driver specific block device options for the null backend.
2142 # @size: size of the device in bytes.
2143 # @latency-ns: emulated latency (in nanoseconds) in processing
2144 # requests. Default to zero which completes requests immediately.
2149 { 'struct': 'BlockdevOptionsNull',
2150 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
2153 # @BlockdevOptionsVVFAT:
2155 # Driver specific block device options for the vvfat protocol.
2157 # @dir: directory to be exported as FAT image
2158 # @fat-type: FAT type: 12, 16 or 32
2159 # @floppy: whether to export a floppy image (true) or
2160 # partitioned hard disk (false; default)
2161 # @label: set the volume label, limited to 11 bytes. FAT16 and
2162 # FAT32 traditionally have some restrictions on labels, which are
2163 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2165 # @rw: whether to allow write operations (default: false)
2169 { 'struct': 'BlockdevOptionsVVFAT',
2170 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2171 '*label': 'str', '*rw': 'bool' } }
2174 # @BlockdevOptionsGenericFormat:
2176 # Driver specific block device options for image format that have no option
2177 # besides their data source.
2179 # @file: reference to or definition of the data source block device
2183 { 'struct': 'BlockdevOptionsGenericFormat',
2184 'data': { 'file': 'BlockdevRef' } }
2187 # @BlockdevOptionsLUKS:
2189 # Driver specific block device options for LUKS.
2191 # @key-secret: the ID of a QCryptoSecret object providing
2192 # the decryption key (since 2.6). Mandatory except when
2193 # doing a metadata-only probe of the image.
2197 { 'struct': 'BlockdevOptionsLUKS',
2198 'base': 'BlockdevOptionsGenericFormat',
2199 'data': { '*key-secret': 'str' } }
2203 # @BlockdevOptionsGenericCOWFormat:
2205 # Driver specific block device options for image format that have no option
2206 # besides their data source and an optional backing file.
2208 # @backing: reference to or definition of the backing file block
2209 # device (if missing, taken from the image file content). It is
2210 # allowed to pass an empty string here in order to disable the
2211 # default backing file.
2215 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2216 'base': 'BlockdevOptionsGenericFormat',
2217 'data': { '*backing': 'BlockdevRef' } }
2220 # @Qcow2OverlapCheckMode:
2222 # General overlap check modes.
2224 # @none: Do not perform any checks
2226 # @constant: Perform only checks which can be done in constant time and
2227 # without reading anything from disk
2229 # @cached: Perform only checks which can be done without reading anything
2232 # @all: Perform all available overlap checks
2236 { 'enum': 'Qcow2OverlapCheckMode',
2237 'data': [ 'none', 'constant', 'cached', 'all' ] }
2240 # @Qcow2OverlapCheckFlags:
2242 # Structure of flags for each metadata structure. Setting a field to 'true'
2243 # makes qemu guard that structure against unintended overwriting. The default
2244 # value is chosen according to the template given.
2246 # @template: Specifies a template mode which can be adjusted using the other
2247 # flags, defaults to 'cached'
2251 { 'struct': 'Qcow2OverlapCheckFlags',
2252 'data': { '*template': 'Qcow2OverlapCheckMode',
2253 '*main-header': 'bool',
2254 '*active-l1': 'bool',
2255 '*active-l2': 'bool',
2256 '*refcount-table': 'bool',
2257 '*refcount-block': 'bool',
2258 '*snapshot-table': 'bool',
2259 '*inactive-l1': 'bool',
2260 '*inactive-l2': 'bool' } }
2263 # @Qcow2OverlapChecks:
2265 # Specifies which metadata structures should be guarded against unintended
2268 # @flags: set of flags for separate specification of each metadata structure
2271 # @mode: named mode which chooses a specific set of flags
2275 { 'alternate': 'Qcow2OverlapChecks',
2276 'data': { 'flags': 'Qcow2OverlapCheckFlags',
2277 'mode': 'Qcow2OverlapCheckMode' } }
2280 # @BlockdevOptionsQcow2:
2282 # Driver specific block device options for qcow2.
2284 # @lazy-refcounts: whether to enable the lazy refcounts
2285 # feature (default is taken from the image file)
2287 # @pass-discard-request: whether discard requests to the qcow2
2288 # device should be forwarded to the data source
2290 # @pass-discard-snapshot: whether discard requests for the data source
2291 # should be issued when a snapshot operation (e.g.
2292 # deleting a snapshot) frees clusters in the qcow2 file
2294 # @pass-discard-other: whether discard requests for the data source
2295 # should be issued on other occasions where a cluster
2298 # @overlap-check: which overlap checks to perform for writes
2299 # to the image, defaults to 'cached' (since 2.2)
2301 # @cache-size: the maximum total size of the L2 table and
2302 # refcount block caches in bytes (since 2.2)
2304 # @l2-cache-size: the maximum size of the L2 table cache in
2307 # @refcount-cache-size: the maximum size of the refcount block cache
2308 # in bytes (since 2.2)
2310 # @cache-clean-interval: clean unused entries in the L2 and refcount
2311 # caches. The interval is in seconds. The default value
2312 # is 0 and it disables this feature (since 2.5)
2316 { 'struct': 'BlockdevOptionsQcow2',
2317 'base': 'BlockdevOptionsGenericCOWFormat',
2318 'data': { '*lazy-refcounts': 'bool',
2319 '*pass-discard-request': 'bool',
2320 '*pass-discard-snapshot': 'bool',
2321 '*pass-discard-other': 'bool',
2322 '*overlap-check': 'Qcow2OverlapChecks',
2323 '*cache-size': 'int',
2324 '*l2-cache-size': 'int',
2325 '*refcount-cache-size': 'int',
2326 '*cache-clean-interval': 'int' } }
2330 # @BlockdevOptionsSsh:
2332 # @server: host address
2334 # @path: path to the image on the host
2336 # @user: user as which to connect, defaults to current
2339 # TODO: Expose the host_key_check option in QMP
2343 { 'struct': 'BlockdevOptionsSsh',
2344 'data': { 'server': 'InetSocketAddress',
2352 # Trigger events supported by blkdebug.
2356 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
2357 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
2358 'l1_grow_activate_table', 'l2_load', 'l2_update',
2359 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
2360 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
2361 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
2362 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
2363 'refblock_load', 'refblock_update', 'refblock_update_part',
2364 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
2365 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
2366 'refblock_alloc_switch_table', 'cluster_alloc',
2367 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
2368 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
2369 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
2370 'pwritev_zero', 'pwritev_done', 'empty_image_prepare' ] }
2373 # @BlkdebugInjectErrorOptions:
2375 # Describes a single error injection for blkdebug.
2377 # @event: trigger event
2379 # @state: the state identifier blkdebug needs to be in to
2380 # actually trigger the event; defaults to "any"
2382 # @errno: error identifier (errno) to be returned; defaults to
2385 # @sector: specifies the sector index which has to be affected
2386 # in order to actually trigger the event; defaults to "any
2389 # @once: disables further events after this one has been
2390 # triggered; defaults to false
2392 # @immediately: fail immediately; defaults to false
2396 { 'struct': 'BlkdebugInjectErrorOptions',
2397 'data': { 'event': 'BlkdebugEvent',
2402 '*immediately': 'bool' } }
2405 # @BlkdebugSetStateOptions:
2407 # Describes a single state-change event for blkdebug.
2409 # @event: trigger event
2411 # @state: the current state identifier blkdebug needs to be in;
2414 # @new_state: the state identifier blkdebug is supposed to assume if
2415 # this event is triggered
2419 { 'struct': 'BlkdebugSetStateOptions',
2420 'data': { 'event': 'BlkdebugEvent',
2422 'new_state': 'int' } }
2425 # @BlockdevOptionsBlkdebug:
2427 # Driver specific block device options for blkdebug.
2429 # @image: underlying raw block device (or image file)
2431 # @config: filename of the configuration file
2433 # @align: required alignment for requests in bytes,
2434 # must be power of 2, or 0 for default
2436 # @inject-error: array of error injection descriptions
2438 # @set-state: array of state-change descriptions
2442 { 'struct': 'BlockdevOptionsBlkdebug',
2443 'data': { 'image': 'BlockdevRef',
2446 '*inject-error': ['BlkdebugInjectErrorOptions'],
2447 '*set-state': ['BlkdebugSetStateOptions'] } }
2450 # @BlockdevOptionsBlkverify:
2452 # Driver specific block device options for blkverify.
2454 # @test: block device to be tested
2456 # @raw: raw image used for verification
2460 { 'struct': 'BlockdevOptionsBlkverify',
2461 'data': { 'test': 'BlockdevRef',
2462 'raw': 'BlockdevRef' } }
2465 # @QuorumReadPattern:
2467 # An enumeration of quorum read patterns.
2469 # @quorum: read all the children and do a quorum vote on reads
2471 # @fifo: read only from the first child that has not failed
2475 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
2478 # @BlockdevOptionsQuorum:
2480 # Driver specific block device options for Quorum
2482 # @blkverify: true if the driver must print content mismatch
2483 # set to false by default
2485 # @children: the children block devices to use
2487 # @vote-threshold: the vote limit under which a read will fail
2489 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
2492 # @read-pattern: choose read pattern and set to quorum by default
2497 { 'struct': 'BlockdevOptionsQuorum',
2498 'data': { '*blkverify': 'bool',
2499 'children': [ 'BlockdevRef' ],
2500 'vote-threshold': 'int',
2501 '*rewrite-corrupted': 'bool',
2502 '*read-pattern': 'QuorumReadPattern' } }
2505 # @BlockdevOptionsGluster:
2507 # Driver specific block device options for Gluster
2509 # @volume: name of gluster volume where VM image resides
2511 # @path: absolute path to image file in gluster volume
2513 # @server: gluster servers description
2515 # @debug: libgfapi log level (default '4' which is Error)
2518 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
2522 { 'struct': 'BlockdevOptionsGluster',
2523 'data': { 'volume': 'str',
2525 'server': ['SocketAddressFlat'],
2527 '*logfile': 'str' } }
2532 # An enumeration of libiscsi transport types
2536 { 'enum': 'IscsiTransport',
2537 'data': [ 'tcp', 'iser' ] }
2540 # @IscsiHeaderDigest:
2542 # An enumeration of header digests supported by libiscsi
2546 { 'enum': 'IscsiHeaderDigest',
2547 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
2548 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
2551 # @BlockdevOptionsIscsi:
2553 # @transport: The iscsi transport type
2555 # @portal: The address of the iscsi portal
2557 # @target: The target iqn name
2559 # @lun: LUN to connect to. Defaults to 0.
2561 # @user: User name to log in with. If omitted, no CHAP
2562 # authentication is performed.
2564 # @password-secret: The ID of a QCryptoSecret object providing
2565 # the password for the login. This option is required if
2566 # @user is specified.
2568 # @initiator-name: The iqn name we want to identify to the target
2569 # as. If this option is not specified, an initiator name is
2570 # generated automatically.
2572 # @header-digest: The desired header digest. Defaults to
2575 # @timeout: Timeout in seconds after which a request will
2576 # timeout. 0 means no timeout and is the default.
2578 # Driver specific block device options for iscsi
2582 { 'struct': 'BlockdevOptionsIscsi',
2583 'data': { 'transport': 'IscsiTransport',
2588 '*password-secret': 'str',
2589 '*initiator-name': 'str',
2590 '*header-digest': 'IscsiHeaderDigest',
2591 '*timeout': 'int' } }
2595 # @BlockdevOptionsRbd:
2597 # @pool: Ceph pool name.
2599 # @image: Image name in the Ceph pool.
2601 # @conf: path to Ceph configuration file. Values
2602 # in the configuration file will be overridden by
2603 # options specified via QAPI.
2605 # @snapshot: Ceph snapshot name.
2607 # @user: Ceph id name.
2609 # @server: Monitor host address and port. This maps
2610 # to the "mon_host" Ceph option.
2614 { 'struct': 'BlockdevOptionsRbd',
2615 'data': { 'pool': 'str',
2620 '*server': ['InetSocketAddressBase'] } }
2623 # @BlockdevOptionsSheepdog:
2625 # Driver specific block device options for sheepdog
2627 # @vdi: Virtual disk image name
2628 # @server: The Sheepdog server to connect to
2629 # @snap-id: Snapshot ID
2630 # @tag: Snapshot tag name
2632 # Only one of @snap-id and @tag may be present.
2636 { 'struct': 'BlockdevOptionsSheepdog',
2637 'data': { 'server': 'SocketAddressFlat',
2639 '*snap-id': 'uint32',
2645 # An enumeration of replication modes.
2647 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
2649 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
2653 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
2656 # @BlockdevOptionsReplication:
2658 # Driver specific block device options for replication
2660 # @mode: the replication mode
2662 # @top-id: In secondary mode, node name or device ID of the root
2663 # node who owns the replication node chain. Must not be given in
2668 { 'struct': 'BlockdevOptionsReplication',
2669 'base': 'BlockdevOptionsGenericFormat',
2670 'data': { 'mode': 'ReplicationMode',
2671 '*top-id': 'str' } }
2676 # An enumeration of NFS transport types
2678 # @inet: TCP transport
2682 { 'enum': 'NFSTransport',
2683 'data': [ 'inet' ] }
2688 # Captures the address of the socket
2690 # @type: transport type used for NFS (only TCP supported)
2692 # @host: host address for NFS server
2696 { 'struct': 'NFSServer',
2697 'data': { 'type': 'NFSTransport',
2701 # @BlockdevOptionsNfs:
2703 # Driver specific block device option for NFS
2705 # @server: host address
2707 # @path: path of the image on the host
2709 # @user: UID value to use when talking to the
2710 # server (defaults to 65534 on Windows and getuid()
2713 # @group: GID value to use when talking to the
2714 # server (defaults to 65534 on Windows and getgid()
2717 # @tcp-syn-count: number of SYNs during the session
2718 # establishment (defaults to libnfs default)
2720 # @readahead-size: set the readahead size in bytes (defaults
2721 # to libnfs default)
2723 # @page-cache-size: set the pagecache size in bytes (defaults
2724 # to libnfs default)
2726 # @debug: set the NFS debug level (max 2) (defaults
2727 # to libnfs default)
2731 { 'struct': 'BlockdevOptionsNfs',
2732 'data': { 'server': 'NFSServer',
2736 '*tcp-syn-count': 'int',
2737 '*readahead-size': 'int',
2738 '*page-cache-size': 'int',
2742 # @BlockdevOptionsCurlBase:
2744 # Driver specific block device options shared by all protocols supported by the
2747 # @url: URL of the image file
2749 # @readahead: Size of the read-ahead cache; must be a multiple of
2750 # 512 (defaults to 256 kB)
2752 # @timeout: Timeout for connections, in seconds (defaults to 5)
2754 # @username: Username for authentication (defaults to none)
2756 # @password-secret: ID of a QCryptoSecret object providing a password
2757 # for authentication (defaults to no password)
2759 # @proxy-username: Username for proxy authentication (defaults to none)
2761 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
2762 # for proxy authentication (defaults to no password)
2766 { 'struct': 'BlockdevOptionsCurlBase',
2767 'data': { 'url': 'str',
2768 '*readahead': 'int',
2771 '*password-secret': 'str',
2772 '*proxy-username': 'str',
2773 '*proxy-password-secret': 'str' } }
2776 # @BlockdevOptionsCurlHttp:
2778 # Driver specific block device options for HTTP connections over the curl
2779 # backend. URLs must start with "http://".
2781 # @cookie: List of cookies to set; format is
2782 # "name1=content1; name2=content2;" as explained by
2783 # CURLOPT_COOKIE(3). Defaults to no cookies.
2787 { 'struct': 'BlockdevOptionsCurlHttp',
2788 'base': 'BlockdevOptionsCurlBase',
2789 'data': { '*cookie': 'str' } }
2792 # @BlockdevOptionsCurlHttps:
2794 # Driver specific block device options for HTTPS connections over the curl
2795 # backend. URLs must start with "https://".
2797 # @cookie: List of cookies to set; format is
2798 # "name1=content1; name2=content2;" as explained by
2799 # CURLOPT_COOKIE(3). Defaults to no cookies.
2801 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
2806 { 'struct': 'BlockdevOptionsCurlHttps',
2807 'base': 'BlockdevOptionsCurlBase',
2808 'data': { '*cookie': 'str',
2809 '*sslverify': 'bool' } }
2812 # @BlockdevOptionsCurlFtp:
2814 # Driver specific block device options for FTP connections over the curl
2815 # backend. URLs must start with "ftp://".
2819 { 'struct': 'BlockdevOptionsCurlFtp',
2820 'base': 'BlockdevOptionsCurlBase',
2824 # @BlockdevOptionsCurlFtps:
2826 # Driver specific block device options for FTPS connections over the curl
2827 # backend. URLs must start with "ftps://".
2829 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
2834 { 'struct': 'BlockdevOptionsCurlFtps',
2835 'base': 'BlockdevOptionsCurlBase',
2836 'data': { '*sslverify': 'bool' } }
2839 # @BlockdevOptionsNbd:
2841 # Driver specific block device options for NBD.
2843 # @server: NBD server address
2845 # @export: export name
2847 # @tls-creds: TLS credentials ID
2851 { 'struct': 'BlockdevOptionsNbd',
2852 'data': { 'server': 'SocketAddressFlat',
2854 '*tls-creds': 'str' } }
2857 # @BlockdevOptionsRaw:
2859 # Driver specific block device options for the raw driver.
2861 # @offset: position where the block device starts
2862 # @size: the assumed size of the device
2866 { 'struct': 'BlockdevOptionsRaw',
2867 'base': 'BlockdevOptionsGenericFormat',
2868 'data': { '*offset': 'int', '*size': 'int' } }
2871 # @BlockdevOptionsVxHS:
2873 # Driver specific block device options for VxHS
2875 # @vdisk-id: UUID of VxHS volume
2876 # @server: vxhs server IP, port
2877 # @tls-creds: TLS credentials ID
2881 { 'struct': 'BlockdevOptionsVxHS',
2882 'data': { 'vdisk-id': 'str',
2883 'server': 'InetSocketAddressBase',
2884 '*tls-creds': 'str' } }
2889 # Options for creating a block device. Many options are available for all
2890 # block devices, independent of the block driver:
2892 # @driver: block driver name
2893 # @node-name: the node name of the new node (Since 2.0).
2894 # This option is required on the top level of blockdev-add.
2895 # @discard: discard-related options (default: ignore)
2896 # @cache: cache-related options
2897 # @read-only: whether the block device should be read-only
2899 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
2902 # Remaining options are determined by the block driver.
2906 { 'union': 'BlockdevOptions',
2907 'base': { 'driver': 'BlockdevDriver',
2908 '*node-name': 'str',
2909 '*discard': 'BlockdevDiscardOptions',
2910 '*cache': 'BlockdevCacheOptions',
2911 '*read-only': 'bool',
2912 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
2913 'discriminator': 'driver',
2915 'blkdebug': 'BlockdevOptionsBlkdebug',
2916 'blkverify': 'BlockdevOptionsBlkverify',
2917 'bochs': 'BlockdevOptionsGenericFormat',
2918 'cloop': 'BlockdevOptionsGenericFormat',
2919 'dmg': 'BlockdevOptionsGenericFormat',
2920 'file': 'BlockdevOptionsFile',
2921 'ftp': 'BlockdevOptionsCurlFtp',
2922 'ftps': 'BlockdevOptionsCurlFtps',
2923 'gluster': 'BlockdevOptionsGluster',
2924 'host_cdrom': 'BlockdevOptionsFile',
2925 'host_device':'BlockdevOptionsFile',
2926 'http': 'BlockdevOptionsCurlHttp',
2927 'https': 'BlockdevOptionsCurlHttps',
2928 'iscsi': 'BlockdevOptionsIscsi',
2929 'luks': 'BlockdevOptionsLUKS',
2930 'nbd': 'BlockdevOptionsNbd',
2931 'nfs': 'BlockdevOptionsNfs',
2932 'null-aio': 'BlockdevOptionsNull',
2933 'null-co': 'BlockdevOptionsNull',
2934 'parallels': 'BlockdevOptionsGenericFormat',
2935 'qcow2': 'BlockdevOptionsQcow2',
2936 'qcow': 'BlockdevOptionsGenericCOWFormat',
2937 'qed': 'BlockdevOptionsGenericCOWFormat',
2938 'quorum': 'BlockdevOptionsQuorum',
2939 'raw': 'BlockdevOptionsRaw',
2940 'rbd': 'BlockdevOptionsRbd',
2941 'replication':'BlockdevOptionsReplication',
2942 'sheepdog': 'BlockdevOptionsSheepdog',
2943 'ssh': 'BlockdevOptionsSsh',
2944 'vdi': 'BlockdevOptionsGenericFormat',
2945 'vhdx': 'BlockdevOptionsGenericFormat',
2946 'vmdk': 'BlockdevOptionsGenericCOWFormat',
2947 'vpc': 'BlockdevOptionsGenericFormat',
2948 'vvfat': 'BlockdevOptionsVVFAT',
2949 'vxhs': 'BlockdevOptionsVxHS'
2955 # Reference to a block device.
2957 # @definition: defines a new block device inline
2958 # @reference: references the ID of an existing block device. An
2959 # empty string means that no block device should be
2964 { 'alternate': 'BlockdevRef',
2965 'data': { 'definition': 'BlockdevOptions',
2966 'reference': 'str' } }
2971 # Creates a new block device. If the @id option is given at the top level, a
2972 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
2973 # level and no BlockBackend will be created.
2980 # -> { "execute": "blockdev-add",
2982 # "driver": "qcow2",
2983 # "node-name": "test1",
2986 # "filename": "test.qcow2"
2990 # <- { "return": {} }
2993 # -> { "execute": "blockdev-add",
2995 # "driver": "qcow2",
2996 # "node-name": "node0",
2997 # "discard": "unmap",
3003 # "filename": "/tmp/test.qcow2"
3009 # "filename": "/dev/fdset/4"
3015 # <- { "return": {} }
3018 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
3023 # Deletes a block device that has been added using blockdev-add.
3024 # The command will fail if the node is attached to a device or is
3025 # otherwise being used.
3027 # @node-name: Name of the graph node to delete.
3033 # -> { "execute": "blockdev-add",
3035 # "driver": "qcow2",
3036 # "node-name": "node0",
3039 # "filename": "test.qcow2"
3043 # <- { "return": {} }
3045 # -> { "execute": "blockdev-del",
3046 # "arguments": { "node-name": "node0" }
3048 # <- { "return": {} }
3051 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
3054 # @blockdev-open-tray:
3056 # Opens a block device's tray. If there is a block driver state tree inserted as
3057 # a medium, it will become inaccessible to the guest (but it will remain
3058 # associated to the block device, so closing the tray will make it accessible
3061 # If the tray was already open before, this will be a no-op.
3063 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
3064 # which no such event will be generated, these include:
3065 # - if the guest has locked the tray, @force is false and the guest does not
3066 # respond to the eject request
3067 # - if the BlockBackend denoted by @device does not have a guest device attached
3069 # - if the guest device does not have an actual tray
3071 # @device: Block device name (deprecated, use @id instead)
3073 # @id: The name or QOM path of the guest device (since: 2.8)
3075 # @force: if false (the default), an eject request will be sent to
3076 # the guest if it has locked the tray (and the tray will not be opened
3077 # immediately); if true, the tray will be opened regardless of whether
3084 # -> { "execute": "blockdev-open-tray",
3085 # "arguments": { "id": "ide0-1-0" } }
3087 # <- { "timestamp": { "seconds": 1418751016,
3088 # "microseconds": 716996 },
3089 # "event": "DEVICE_TRAY_MOVED",
3090 # "data": { "device": "ide1-cd0",
3092 # "tray-open": true } }
3094 # <- { "return": {} }
3097 { 'command': 'blockdev-open-tray',
3098 'data': { '*device': 'str',
3100 '*force': 'bool' } }
3103 # @blockdev-close-tray:
3105 # Closes a block device's tray. If there is a block driver state tree associated
3106 # with the block device (which is currently ejected), that tree will be loaded
3109 # If the tray was already closed before, this will be a no-op.
3111 # @device: Block device name (deprecated, use @id instead)
3113 # @id: The name or QOM path of the guest device (since: 2.8)
3119 # -> { "execute": "blockdev-close-tray",
3120 # "arguments": { "id": "ide0-1-0" } }
3122 # <- { "timestamp": { "seconds": 1418751345,
3123 # "microseconds": 272147 },
3124 # "event": "DEVICE_TRAY_MOVED",
3125 # "data": { "device": "ide1-cd0",
3127 # "tray-open": false } }
3129 # <- { "return": {} }
3132 { 'command': 'blockdev-close-tray',
3133 'data': { '*device': 'str',
3137 # @x-blockdev-remove-medium:
3139 # Removes a medium (a block driver state tree) from a block device. That block
3140 # device's tray must currently be open (unless there is no attached guest
3143 # If the tray is open and there is no medium inserted, this will be a no-op.
3145 # @device: Block device name (deprecated, use @id instead)
3147 # @id: The name or QOM path of the guest device (since: 2.8)
3149 # Note: This command is still a work in progress and is considered experimental.
3150 # Stay away from it unless you want to help with its development.
3156 # -> { "execute": "x-blockdev-remove-medium",
3157 # "arguments": { "id": "ide0-1-0" } }
3159 # <- { "error": { "class": "GenericError",
3160 # "desc": "Tray of device 'ide0-1-0' is not open" } }
3162 # -> { "execute": "blockdev-open-tray",
3163 # "arguments": { "id": "ide0-1-0" } }
3165 # <- { "timestamp": { "seconds": 1418751627,
3166 # "microseconds": 549958 },
3167 # "event": "DEVICE_TRAY_MOVED",
3168 # "data": { "device": "ide1-cd0",
3170 # "tray-open": true } }
3172 # <- { "return": {} }
3174 # -> { "execute": "x-blockdev-remove-medium",
3175 # "arguments": { "device": "ide0-1-0" } }
3177 # <- { "return": {} }
3180 { 'command': 'x-blockdev-remove-medium',
3181 'data': { '*device': 'str',
3185 # @x-blockdev-insert-medium:
3187 # Inserts a medium (a block driver state tree) into a block device. That block
3188 # device's tray must currently be open (unless there is no attached guest
3189 # device) and there must be no medium inserted already.
3191 # @device: Block device name (deprecated, use @id instead)
3193 # @id: The name or QOM path of the guest device (since: 2.8)
3195 # @node-name: name of a node in the block driver state graph
3197 # Note: This command is still a work in progress and is considered experimental.
3198 # Stay away from it unless you want to help with its development.
3204 # -> { "execute": "blockdev-add",
3206 # "options": { "node-name": "node0",
3208 # "file": { "driver": "file",
3209 # "filename": "fedora.iso" } } } }
3210 # <- { "return": {} }
3212 # -> { "execute": "x-blockdev-insert-medium",
3213 # "arguments": { "id": "ide0-1-0",
3214 # "node-name": "node0" } }
3216 # <- { "return": {} }
3219 { 'command': 'x-blockdev-insert-medium',
3220 'data': { '*device': 'str',
3222 'node-name': 'str'} }
3226 # @BlockdevChangeReadOnlyMode:
3228 # Specifies the new read-only mode of a block device subject to the
3229 # @blockdev-change-medium command.
3231 # @retain: Retains the current read-only mode
3233 # @read-only: Makes the device read-only
3235 # @read-write: Makes the device writable
3240 { 'enum': 'BlockdevChangeReadOnlyMode',
3241 'data': ['retain', 'read-only', 'read-write'] }
3245 # @blockdev-change-medium:
3247 # Changes the medium inserted into a block device by ejecting the current medium
3248 # and loading a new image file which is inserted as the new medium (this command
3249 # combines blockdev-open-tray, x-blockdev-remove-medium,
3250 # x-blockdev-insert-medium and blockdev-close-tray).
3252 # @device: Block device name (deprecated, use @id instead)
3254 # @id: The name or QOM path of the guest device
3257 # @filename: filename of the new image to be loaded
3259 # @format: format to open the new image with (defaults to
3260 # the probed format)
3262 # @read-only-mode: change the read-only mode of the device; defaults
3269 # 1. Change a removable medium
3271 # -> { "execute": "blockdev-change-medium",
3272 # "arguments": { "id": "ide0-1-0",
3273 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
3274 # "format": "raw" } }
3275 # <- { "return": {} }
3277 # 2. Load a read-only medium into a writable drive
3279 # -> { "execute": "blockdev-change-medium",
3280 # "arguments": { "id": "floppyA",
3281 # "filename": "/srv/images/ro.img",
3283 # "read-only-mode": "retain" } }
3286 # { "class": "GenericError",
3287 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
3289 # -> { "execute": "blockdev-change-medium",
3290 # "arguments": { "id": "floppyA",
3291 # "filename": "/srv/images/ro.img",
3293 # "read-only-mode": "read-only" } }
3295 # <- { "return": {} }
3298 { 'command': 'blockdev-change-medium',
3299 'data': { '*device': 'str',
3303 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
3307 # @BlockErrorAction:
3309 # An enumeration of action that has been taken when a DISK I/O occurs
3311 # @ignore: error has been ignored
3313 # @report: error has been reported to the device
3315 # @stop: error caused VM to be stopped
3319 { 'enum': 'BlockErrorAction',
3320 'data': [ 'ignore', 'report', 'stop' ] }
3324 # @BLOCK_IMAGE_CORRUPTED:
3326 # Emitted when a disk image is being marked corrupt. The image can be
3327 # identified by its device or node name. The 'device' field is always
3328 # present for compatibility reasons, but it can be empty ("") if the
3329 # image does not have a device name associated.
3331 # @device: device name. This is always present for compatibility
3332 # reasons, but it can be empty ("") if the image does not
3333 # have a device name associated.
3335 # @node-name: node name (Since: 2.4)
3337 # @msg: informative message for human consumption, such as the kind of
3338 # corruption being detected. It should not be parsed by machine as it is
3339 # not guaranteed to be stable
3341 # @offset: if the corruption resulted from an image access, this is
3342 # the host's access offset into the image
3344 # @size: if the corruption resulted from an image access, this is
3347 # @fatal: if set, the image is marked corrupt and therefore unusable after this
3348 # event and must be repaired (Since 2.2; before, every
3349 # BLOCK_IMAGE_CORRUPTED event was fatal)
3351 # Note: If action is "stop", a STOP event will eventually follow the
3352 # BLOCK_IO_ERROR event.
3356 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
3357 # "data": { "device": "ide0-hd0", "node-name": "node0",
3358 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
3360 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
3364 { 'event': 'BLOCK_IMAGE_CORRUPTED',
3365 'data': { 'device' : 'str',
3366 '*node-name' : 'str',
3370 'fatal' : 'bool' } }
3375 # Emitted when a disk I/O error occurs
3377 # @device: device name. This is always present for compatibility
3378 # reasons, but it can be empty ("") if the image does not
3379 # have a device name associated.
3381 # @node-name: node name. Note that errors may be reported for the root node
3382 # that is directly attached to a guest device rather than for the
3383 # node where the error occurred. (Since: 2.8)
3385 # @operation: I/O operation
3387 # @action: action that has been taken
3389 # @nospace: true if I/O error was caused due to a no-space
3390 # condition. This key is only present if query-block's
3391 # io-status is present, please see query-block documentation
3392 # for more information (since: 2.2)
3394 # @reason: human readable string describing the error cause.
3395 # (This field is a debugging aid for humans, it should not
3396 # be parsed by applications) (since: 2.2)
3398 # Note: If action is "stop", a STOP event will eventually follow the
3399 # BLOCK_IO_ERROR event
3405 # <- { "event": "BLOCK_IO_ERROR",
3406 # "data": { "device": "ide0-hd1",
3407 # "node-name": "#block212",
3408 # "operation": "write",
3409 # "action": "stop" },
3410 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3413 { 'event': 'BLOCK_IO_ERROR',
3414 'data': { 'device': 'str', 'node-name': 'str', 'operation': 'IoOperationType',
3415 'action': 'BlockErrorAction', '*nospace': 'bool',
3419 # @BLOCK_JOB_COMPLETED:
3421 # Emitted when a block job has completed
3425 # @device: The job identifier. Originally the device name but other
3426 # values are allowed since QEMU 2.7
3428 # @len: maximum progress value
3430 # @offset: current progress value. On success this is equal to len.
3431 # On failure this is less than len
3433 # @speed: rate limit, bytes per second
3435 # @error: error message. Only present on failure. This field
3436 # contains a human-readable error message. There are no semantics
3437 # other than that streaming has failed and clients should not try to
3438 # interpret the error string
3444 # <- { "event": "BLOCK_JOB_COMPLETED",
3445 # "data": { "type": "stream", "device": "virtio-disk0",
3446 # "len": 10737418240, "offset": 10737418240,
3448 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
3451 { 'event': 'BLOCK_JOB_COMPLETED',
3452 'data': { 'type' : 'BlockJobType',
3460 # @BLOCK_JOB_CANCELLED:
3462 # Emitted when a block job has been cancelled
3466 # @device: The job identifier. Originally the device name but other
3467 # values are allowed since QEMU 2.7
3469 # @len: maximum progress value
3471 # @offset: current progress value. On success this is equal to len.
3472 # On failure this is less than len
3474 # @speed: rate limit, bytes per second
3480 # <- { "event": "BLOCK_JOB_CANCELLED",
3481 # "data": { "type": "stream", "device": "virtio-disk0",
3482 # "len": 10737418240, "offset": 134217728,
3484 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
3487 { 'event': 'BLOCK_JOB_CANCELLED',
3488 'data': { 'type' : 'BlockJobType',
3497 # Emitted when a block job encounters an error
3499 # @device: The job identifier. Originally the device name but other
3500 # values are allowed since QEMU 2.7
3502 # @operation: I/O operation
3504 # @action: action that has been taken
3510 # <- { "event": "BLOCK_JOB_ERROR",
3511 # "data": { "device": "ide0-hd1",
3512 # "operation": "write",
3513 # "action": "stop" },
3514 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3517 { 'event': 'BLOCK_JOB_ERROR',
3518 'data': { 'device' : 'str',
3519 'operation': 'IoOperationType',
3520 'action' : 'BlockErrorAction' } }
3525 # Emitted when a block job is ready to complete
3529 # @device: The job identifier. Originally the device name but other
3530 # values are allowed since QEMU 2.7
3532 # @len: maximum progress value
3534 # @offset: current progress value. On success this is equal to len.
3535 # On failure this is less than len
3537 # @speed: rate limit, bytes per second
3539 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
3546 # <- { "event": "BLOCK_JOB_READY",
3547 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
3548 # "len": 2097152, "offset": 2097152 }
3549 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3552 { 'event': 'BLOCK_JOB_READY',
3553 'data': { 'type' : 'BlockJobType',
3562 # Preallocation mode of QEMU image file
3564 # @off: no preallocation
3565 # @metadata: preallocate only for metadata
3566 # @falloc: like @full preallocation but allocate disk space by
3567 # posix_fallocate() rather than writing zeros.
3568 # @full: preallocate all data by writing zeros to device to ensure disk
3569 # space is really available. @full preallocation also sets up
3570 # metadata correctly.
3574 { 'enum': 'PreallocMode',
3575 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
3578 # @BLOCK_WRITE_THRESHOLD:
3580 # Emitted when writes on block device reaches or exceeds the
3581 # configured write threshold. For thin-provisioned devices, this
3582 # means the device should be extended to avoid pausing for
3584 # The event is one shot. Once triggered, it needs to be
3585 # re-registered with another block-set-threshold command.
3587 # @node-name: graph node name on which the threshold was exceeded.
3589 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
3591 # @write-threshold: last configured threshold, in bytes.
3595 { 'event': 'BLOCK_WRITE_THRESHOLD',
3596 'data': { 'node-name': 'str',
3597 'amount-exceeded': 'uint64',
3598 'write-threshold': 'uint64' } }
3601 # @block-set-write-threshold:
3603 # Change the write threshold for a block drive. An event will be
3604 # delivered if a write to this block drive crosses the configured
3605 # threshold. The threshold is an offset, thus must be
3606 # non-negative. Default is no write threshold. Setting the threshold
3607 # to zero disables it.
3609 # This is useful to transparently resize thin-provisioned drives without
3610 # the guest OS noticing.
3612 # @node-name: graph node name on which the threshold must be set.
3614 # @write-threshold: configured threshold for the block device, bytes.
3615 # Use 0 to disable the threshold.
3621 # -> { "execute": "block-set-write-threshold",
3622 # "arguments": { "node-name": "mydev",
3623 # "write-threshold": 17179869184 } }
3624 # <- { "return": {} }
3627 { 'command': 'block-set-write-threshold',
3628 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
3631 # @x-blockdev-change:
3633 # Dynamically reconfigure the block driver state graph. It can be used
3634 # to add, remove, insert or replace a graph node. Currently only the
3635 # Quorum driver implements this feature to add or remove its child. This
3636 # is useful to fix a broken quorum child.
3638 # If @node is specified, it will be inserted under @parent. @child
3639 # may not be specified in this case. If both @parent and @child are
3640 # specified but @node is not, @child will be detached from @parent.
3642 # @parent: the id or name of the parent node.
3644 # @child: the name of a child under the given parent node.
3646 # @node: the name of the node that will be added.
3648 # Note: this command is experimental, and its API is not stable. It
3649 # does not support all kinds of operations, all kinds of children, nor
3650 # all block drivers.
3652 # Warning: The data in a new quorum child MUST be consistent with that of
3653 # the rest of the array.
3659 # 1. Add a new node to a quorum
3660 # -> { "execute": "blockdev-add",
3662 # "options": { "driver": "raw",
3663 # "node-name": "new_node",
3664 # "file": { "driver": "file",
3665 # "filename": "test.raw" } } } }
3666 # <- { "return": {} }
3667 # -> { "execute": "x-blockdev-change",
3668 # "arguments": { "parent": "disk1",
3669 # "node": "new_node" } }
3670 # <- { "return": {} }
3672 # 2. Delete a quorum's node
3673 # -> { "execute": "x-blockdev-change",
3674 # "arguments": { "parent": "disk1",
3675 # "child": "children.1" } }
3676 # <- { "return": {} }
3679 { 'command': 'x-blockdev-change',
3680 'data' : { 'parent': 'str',