]> Git Repo - qemu.git/blame - qapi/block-core.json
block: simplify blockdev-backup
[qemu.git] / qapi / block-core.json
CommitLineData
5db15096
BC
1# -*- Mode: Python -*-
2#
3# QAPI block core definitions (vm unrelated)
4
5# QAPI common definitions
6{ 'include': 'common.json' }
1ad166b6
BC
7
8##
9# @SnapshotInfo
10#
11# @id: unique snapshot id
12#
13# @name: user chosen name
14#
15# @vm-state-size: size of the VM state
16#
17# @date-sec: UTC date of the snapshot in seconds
18#
19# @date-nsec: fractional part in nano seconds to be used with date-sec
20#
21# @vm-clock-sec: VM clock relative to boot in seconds
22#
23# @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
24#
25# Since: 1.3
26#
27##
28
895a2a80 29{ 'struct': 'SnapshotInfo',
1ad166b6
BC
30 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
31 'date-sec': 'int', 'date-nsec': 'int',
32 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
33
34##
35# @ImageInfoSpecificQCow2:
36#
37# @compat: compatibility level
38#
39# @lazy-refcounts: #optional on or off; only valid for compat >= 1.1
40#
9009b196
HR
41# @corrupt: #optional true if the image has been marked corrupt; only valid for
42# compat >= 1.1 (since 2.2)
43#
0709c5a1
HR
44# @refcount-bits: width of a refcount entry in bits (since 2.3)
45#
1ad166b6
BC
46# Since: 1.7
47##
895a2a80 48{ 'struct': 'ImageInfoSpecificQCow2',
1ad166b6
BC
49 'data': {
50 'compat': 'str',
9009b196 51 '*lazy-refcounts': 'bool',
0709c5a1
HR
52 '*corrupt': 'bool',
53 'refcount-bits': 'int'
1ad166b6
BC
54 } }
55
56##
57# @ImageInfoSpecificVmdk:
58#
59# @create-type: The create type of VMDK image
60#
61# @cid: Content id of image
62#
63# @parent-cid: Parent VMDK image's cid
64#
65# @extents: List of extent files
66#
67# Since: 1.7
68##
895a2a80 69{ 'struct': 'ImageInfoSpecificVmdk',
1ad166b6
BC
70 'data': {
71 'create-type': 'str',
72 'cid': 'int',
73 'parent-cid': 'int',
74 'extents': ['ImageInfo']
75 } }
76
77##
78# @ImageInfoSpecific:
79#
80# A discriminated record of image format specific information structures.
81#
82# Since: 1.7
83##
84
85{ 'union': 'ImageInfoSpecific',
86 'data': {
87 'qcow2': 'ImageInfoSpecificQCow2',
c7c4cf49
DB
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'
1ad166b6
BC
93 } }
94
95##
96# @ImageInfo:
97#
98# Information about a QEMU image file
99#
100# @filename: name of the image file
101#
102# @format: format of the image file
103#
104# @virtual-size: maximum capacity in bytes of the image
105#
106# @actual-size: #optional actual size on disk in bytes of the image
107#
108# @dirty-flag: #optional true if image is not cleanly closed
109#
110# @cluster-size: #optional size of a cluster in bytes
111#
112# @encrypted: #optional true if the image is encrypted
113#
114# @compressed: #optional true if the image is compressed (Since 1.7)
115#
116# @backing-filename: #optional name of the backing file
117#
118# @full-backing-filename: #optional full path of the backing file
119#
120# @backing-filename-format: #optional the format of the backing file
121#
122# @snapshots: #optional list of VM snapshots
123#
124# @backing-image: #optional info of the backing image (since 1.6)
125#
126# @format-specific: #optional structure supplying additional format-specific
127# information (since 1.7)
128#
129# Since: 1.3
130#
131##
132
895a2a80 133{ 'struct': 'ImageInfo',
1ad166b6
BC
134 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
135 '*actual-size': 'int', 'virtual-size': 'int',
136 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
137 '*backing-filename': 'str', '*full-backing-filename': 'str',
138 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
139 '*backing-image': 'ImageInfo',
24bf10da 140 '*format-specific': 'ImageInfoSpecific' } }
1ad166b6
BC
141
142##
143# @ImageCheck:
144#
145# Information about a QEMU image file check
146#
147# @filename: name of the image file checked
148#
149# @format: format of the image file checked
150#
151# @check-errors: number of unexpected errors occurred during check
152#
153# @image-end-offset: #optional offset (in bytes) where the image ends, this
154# field is present if the driver for the image format
155# supports it
156#
157# @corruptions: #optional number of corruptions found during the check if any
158#
159# @leaks: #optional number of leaks found during the check if any
160#
161# @corruptions-fixed: #optional number of corruptions fixed during the check
162# if any
163#
164# @leaks-fixed: #optional number of leaks fixed during the check if any
165#
166# @total-clusters: #optional total number of clusters, this field is present
167# if the driver for the image format supports it
168#
169# @allocated-clusters: #optional total number of allocated clusters, this
170# field is present if the driver for the image format
171# supports it
172#
173# @fragmented-clusters: #optional total number of fragmented clusters, this
174# field is present if the driver for the image format
175# supports it
176#
177# @compressed-clusters: #optional total number of compressed clusters, this
178# field is present if the driver for the image format
179# supports it
180#
181# Since: 1.4
182#
183##
184
895a2a80 185{ 'struct': 'ImageCheck',
1ad166b6
BC
186 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
187 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
188 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
189 '*total-clusters': 'int', '*allocated-clusters': 'int',
190 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
191
16b0d555
FZ
192##
193# @MapEntry:
194#
195# Mapping information from a virtual block range to a host file range
196#
197# @start: the start byte of the mapped virtual range
198#
199# @length: the number of bytes of the mapped virtual range
200#
201# @data: whether the mapped range has data
202#
203# @zero: whether the virtual blocks are zeroed
204#
205# @depth: the depth of the mapping
206#
207# @offset: #optional the offset in file that the virtual sectors are mapped to
208#
209# @filename: #optional filename that is referred to by @offset
210#
211# Since: 2.6
212#
213##
214{ 'struct': 'MapEntry',
215 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
216 'zero': 'bool', 'depth': 'int', '*offset': 'int',
217 '*filename': 'str' } }
218
9e193c5a
KW
219##
220# @BlockdevCacheInfo
221#
222# Cache mode information for a block device
223#
224# @writeback: true if writeback mode is enabled
225# @direct: true if the host page cache is bypassed (O_DIRECT)
226# @no-flush: true if flush requests are ignored for the device
227#
228# Since: 2.3
229##
895a2a80 230{ 'struct': 'BlockdevCacheInfo',
9e193c5a
KW
231 'data': { 'writeback': 'bool',
232 'direct': 'bool',
233 'no-flush': 'bool' } }
234
1ad166b6
BC
235##
236# @BlockDeviceInfo:
237#
238# Information about the backing device for a block device.
239#
240# @file: the filename of the backing device
241#
242# @node-name: #optional the name of the block driver node (Since 2.0)
243#
244# @ro: true if the backing device was open read-only
245#
246# @drv: the name of the block format used to open the backing device. As of
247# 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
248# 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
78368575 249# 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
1ad166b6 250# 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
550830f9 251# 2.2: 'archipelago' added, 'cow' dropped
92a539d2 252# 2.3: 'host_floppy' deprecated
f709623b 253# 2.5: 'host_floppy' dropped
78368575 254# 2.6: 'luks' added
1ad166b6
BC
255#
256# @backing_file: #optional the name of the backing file (for copy-on-write)
257#
258# @backing_file_depth: number of files in the backing file chain (since: 1.2)
259#
260# @encrypted: true if the backing device is encrypted
261#
262# @encryption_key_missing: true if the backing device is encrypted but an
263# valid encryption key is missing
264#
265# @detect_zeroes: detect and optimize zero writes (Since 2.1)
266#
267# @bps: total throughput limit in bytes per second is specified
268#
269# @bps_rd: read throughput limit in bytes per second is specified
270#
271# @bps_wr: write throughput limit in bytes per second is specified
272#
273# @iops: total I/O operations per second is specified
274#
275# @iops_rd: read I/O operations per second is specified
276#
277# @iops_wr: write I/O operations per second is specified
278#
279# @image: the info of image used (since: 1.6)
280#
398befdf
AG
281# @bps_max: #optional total throughput limit during bursts,
282# in bytes (Since 1.7)
1ad166b6 283#
398befdf
AG
284# @bps_rd_max: #optional read throughput limit during bursts,
285# in bytes (Since 1.7)
1ad166b6 286#
398befdf
AG
287# @bps_wr_max: #optional write throughput limit during bursts,
288# in bytes (Since 1.7)
1ad166b6 289#
398befdf
AG
290# @iops_max: #optional total I/O operations per second during bursts,
291# in bytes (Since 1.7)
1ad166b6 292#
398befdf
AG
293# @iops_rd_max: #optional read I/O operations per second during bursts,
294# in bytes (Since 1.7)
1ad166b6 295#
398befdf
AG
296# @iops_wr_max: #optional write I/O operations per second during bursts,
297# in bytes (Since 1.7)
298#
299# @bps_max_length: #optional maximum length of the @bps_max burst
300# period, in seconds. (Since 2.6)
301#
302# @bps_rd_max_length: #optional maximum length of the @bps_rd_max
303# burst period, in seconds. (Since 2.6)
304#
305# @bps_wr_max_length: #optional maximum length of the @bps_wr_max
306# burst period, in seconds. (Since 2.6)
307#
308# @iops_max_length: #optional maximum length of the @iops burst
309# period, in seconds. (Since 2.6)
310#
311# @iops_rd_max_length: #optional maximum length of the @iops_rd_max
312# burst period, in seconds. (Since 2.6)
313#
314# @iops_wr_max_length: #optional maximum length of the @iops_wr_max
315# burst period, in seconds. (Since 2.6)
1ad166b6
BC
316#
317# @iops_size: #optional an I/O size in bytes (Since 1.7)
318#
b8fe1694
AG
319# @group: #optional throttle group name (Since 2.4)
320#
9e193c5a
KW
321# @cache: the cache mode used for the block device (since: 2.3)
322#
e2462113
FR
323# @write_threshold: configured write threshold for the device.
324# 0 if disabled. (Since 2.3)
325#
1ad166b6
BC
326# Since: 0.14.0
327#
328##
895a2a80 329{ 'struct': 'BlockDeviceInfo',
1ad166b6
BC
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',
398befdf
AG
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',
b8fe1694 343 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
e2462113 344 'write_threshold': 'int' } }
1ad166b6
BC
345
346##
347# @BlockDeviceIoStatus:
348#
349# An enumeration of block device I/O status.
350#
351# @ok: The last I/O operation has succeeded
352#
353# @failed: The last I/O operation has failed
354#
355# @nospace: The last I/O operation has failed due to a no-space condition
356#
357# Since: 1.0
358##
359{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
360
361##
362# @BlockDeviceMapEntry:
363#
364# Entry in the metadata map of the device (returned by "qemu-img map")
365#
366# @start: Offset in the image of the first byte described by this entry
367# (in bytes)
368#
369# @length: Length of the range described by this entry (in bytes)
370#
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.
374#
375# @zero: the sectors in this range read as zeros
376#
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)
380#
381# @offset: if present, the image file stores the data for this range in
382# raw format at the given offset.
383#
384# Since 1.7
385##
895a2a80 386{ 'struct': 'BlockDeviceMapEntry',
1ad166b6
BC
387 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
388 'data': 'bool', '*offset': 'int' } }
389
9abe3bdc
JS
390##
391# @DirtyBitmapStatus:
392#
393# An enumeration of possible states that a dirty bitmap can report to the user.
394#
395# @frozen: The bitmap is currently in-use by a backup operation or block job,
396# and is immutable.
397#
398# @disabled: The bitmap is currently in-use by an internal operation and is
399# read-only. It can still be deleted.
400#
401# @active: The bitmap is actively monitoring for new writes, and can be cleared,
402# deleted, or used for backup operations.
403#
404# Since: 2.4
405##
406{ 'enum': 'DirtyBitmapStatus',
407 'data': ['active', 'disabled', 'frozen'] }
408
1ad166b6
BC
409##
410# @BlockDirtyInfo:
411#
412# Block dirty bitmap information.
413#
0db6e54a
FZ
414# @name: #optional the name of the dirty bitmap (Since 2.4)
415#
1ad166b6
BC
416# @count: number of dirty bytes according to the dirty bitmap
417#
418# @granularity: granularity of the dirty bitmap in bytes (since 1.4)
419#
9abe3bdc 420# @status: current status of the dirty bitmap (since 2.4)
a113534f 421#
1ad166b6
BC
422# Since: 1.3
423##
895a2a80 424{ 'struct': 'BlockDirtyInfo',
a113534f 425 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
9abe3bdc 426 'status': 'DirtyBitmapStatus'} }
1ad166b6
BC
427
428##
429# @BlockInfo:
430#
431# Block device information. This structure describes a virtual device and
432# the backing device associated with it.
433#
434# @device: The device name associated with the virtual device.
435#
436# @type: This field is returned only for compatibility reasons, it should
437# not be used (always returns 'unknown')
438#
439# @removable: True if the device supports removable media.
440#
441# @locked: True if the guest has locked this device from having its media
442# removed
443#
327032ce
HR
444# @tray_open: #optional True if the device's tray is open
445# (only present if it has a tray)
1ad166b6
BC
446#
447# @dirty-bitmaps: #optional dirty bitmaps information (only present if the
448# driver has one or more dirty bitmaps) (Since 2.0)
449#
450# @io-status: #optional @BlockDeviceIoStatus. Only present if the device
451# supports it and the VM is configured to stop on errors
c7c2ff0c 452# (supported device models: virtio-blk, ide, scsi-disk)
1ad166b6
BC
453#
454# @inserted: #optional @BlockDeviceInfo describing the device if media is
455# present
456#
457# Since: 0.14.0
458##
895a2a80 459{ 'struct': 'BlockInfo',
1ad166b6
BC
460 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
461 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
462 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
463 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
464
465##
466# @query-block:
467#
468# Get a list of BlockInfo for all virtual block devices.
469#
470# Returns: a list of @BlockInfo describing each virtual block device
471#
472# Since: 0.14.0
473##
474{ 'command': 'query-block', 'returns': ['BlockInfo'] }
475
979e9b03
AG
476
477##
478# @BlockDeviceTimedStats:
479#
480# Statistics of a block device during a given interval of time.
481#
482# @interval_length: Interval used for calculating the statistics,
483# in seconds.
484#
485# @min_rd_latency_ns: Minimum latency of read operations in the
486# defined interval, in nanoseconds.
487#
488# @min_wr_latency_ns: Minimum latency of write operations in the
489# defined interval, in nanoseconds.
490#
491# @min_flush_latency_ns: Minimum latency of flush operations in the
492# defined interval, in nanoseconds.
493#
494# @max_rd_latency_ns: Maximum latency of read operations in the
495# defined interval, in nanoseconds.
496#
497# @max_wr_latency_ns: Maximum latency of write operations in the
498# defined interval, in nanoseconds.
499#
500# @max_flush_latency_ns: Maximum latency of flush operations in the
501# defined interval, in nanoseconds.
502#
503# @avg_rd_latency_ns: Average latency of read operations in the
504# defined interval, in nanoseconds.
505#
506# @avg_wr_latency_ns: Average latency of write operations in the
507# defined interval, in nanoseconds.
508#
509# @avg_flush_latency_ns: Average latency of flush operations in the
510# defined interval, in nanoseconds.
511#
96e4deda
AG
512# @avg_rd_queue_depth: Average number of pending read operations
513# in the defined interval.
514#
515# @avg_wr_queue_depth: Average number of pending write operations
516# in the defined interval.
517#
979e9b03
AG
518# Since: 2.5
519##
520
521{ 'struct': 'BlockDeviceTimedStats',
522 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
523 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
524 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
525 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
96e4deda
AG
526 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
527 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
979e9b03 528
1ad166b6
BC
529##
530# @BlockDeviceStats:
531#
532# Statistics of a virtual block device or a block backing device.
533#
534# @rd_bytes: The number of bytes read by the device.
535#
536# @wr_bytes: The number of bytes written by the device.
537#
538# @rd_operations: The number of read operations performed by the device.
539#
540# @wr_operations: The number of write operations performed by the device.
541#
542# @flush_operations: The number of cache flush operations performed by the
543# device (since 0.15.0)
544#
545# @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
546# (since 0.15.0).
547#
548# @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
549#
550# @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
551#
552# @wr_highest_offset: The offset after the greatest byte written to the
553# device. The intended use of this information is for
554# growable sparse files (like qcow2) that are used on top
555# of a physical device.
556#
f4564d53
PL
557# @rd_merged: Number of read requests that have been merged into another
558# request (Since 2.3).
559#
560# @wr_merged: Number of write requests that have been merged into another
561# request (Since 2.3).
562#
cb38fffb
AG
563# @idle_time_ns: #optional Time since the last I/O operation, in
564# nanoseconds. If the field is absent it means that
565# there haven't been any operations yet (Since 2.5).
566#
7ee12daf
AG
567# @failed_rd_operations: The number of failed read operations
568# performed by the device (Since 2.5)
569#
570# @failed_wr_operations: The number of failed write operations
571# performed by the device (Since 2.5)
572#
573# @failed_flush_operations: The number of failed flush operations
574# performed by the device (Since 2.5)
575#
576# @invalid_rd_operations: The number of invalid read operations
577# performed by the device (Since 2.5)
578#
579# @invalid_wr_operations: The number of invalid write operations
580# performed by the device (Since 2.5)
581#
582# @invalid_flush_operations: The number of invalid flush operations
583# performed by the device (Since 2.5)
584#
362e9299
AG
585# @account_invalid: Whether invalid operations are included in the
586# last access statistics (Since 2.5)
587#
588# @account_failed: Whether failed operations are included in the
589# latency and last access statistics (Since 2.5)
590#
979e9b03
AG
591# @timed_stats: Statistics specific to the set of previously defined
592# intervals of time (Since 2.5)
593#
1ad166b6
BC
594# Since: 0.14.0
595##
895a2a80 596{ 'struct': 'BlockDeviceStats',
1ad166b6
BC
597 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
598 'wr_operations': 'int', 'flush_operations': 'int',
599 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
f4564d53 600 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
7ee12daf
AG
601 'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
602 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
603 'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
362e9299 604 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
979e9b03
AG
605 'account_invalid': 'bool', 'account_failed': 'bool',
606 'timed_stats': ['BlockDeviceTimedStats'] } }
1ad166b6
BC
607
608##
609# @BlockStats:
610#
611# Statistics of a virtual block device or a block backing device.
612#
613# @device: #optional If the stats are for a virtual block device, the name
614# corresponding to the virtual block device.
615#
a06e4355 616# @node-name: #optional The node name of the device. (Since 2.3)
4875a779 617#
1ad166b6
BC
618# @stats: A @BlockDeviceStats for the device.
619#
620# @parent: #optional This describes the file block device if it has one.
621#
622# @backing: #optional This describes the backing block device if it has one.
623# (Since 2.0)
624#
625# Since: 0.14.0
626##
895a2a80 627{ 'struct': 'BlockStats',
4875a779
FZ
628 'data': {'*device': 'str', '*node-name': 'str',
629 'stats': 'BlockDeviceStats',
1ad166b6
BC
630 '*parent': 'BlockStats',
631 '*backing': 'BlockStats'} }
632
633##
634# @query-blockstats:
635#
636# Query the @BlockStats for all virtual block devices.
637#
f71eaa74
FZ
638# @query-nodes: #optional If true, the command will query all the block nodes
639# that have a node name, in a list which will include "parent"
640# information, but not "backing".
641# If false or omitted, the behavior is as before - query all the
642# device backends, recursively including their "parent" and
643# "backing". (Since 2.3)
644#
1ad166b6
BC
645# Returns: A list of @BlockStats for each virtual block devices.
646#
647# Since: 0.14.0
648##
f71eaa74
FZ
649{ 'command': 'query-blockstats',
650 'data': { '*query-nodes': 'bool' },
651 'returns': ['BlockStats'] }
1ad166b6
BC
652
653##
654# @BlockdevOnError:
655#
656# An enumeration of possible behaviors for errors on I/O operations.
657# The exact meaning depends on whether the I/O was initiated by a guest
658# or by a block job
659#
660# @report: for guest operations, report the error to the guest;
661# for jobs, cancel the job
662#
663# @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
664# or BLOCK_JOB_ERROR)
665#
666# @enospc: same as @stop on ENOSPC, same as @report otherwise.
667#
668# @stop: for guest operations, stop the virtual machine;
669# for jobs, pause the job
670#
8c398252
KW
671# @auto: inherit the error handling policy of the backend (since: 2.7)
672#
1ad166b6
BC
673# Since: 1.3
674##
675{ 'enum': 'BlockdevOnError',
8c398252 676 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1ad166b6
BC
677
678##
679# @MirrorSyncMode:
680#
681# An enumeration of possible behaviors for the initial synchronization
682# phase of storage mirroring.
683#
684# @top: copies data in the topmost image to the destination
685#
686# @full: copies data from all images to the destination
687#
688# @none: only copy data written from now on
689#
4b80ab2b 690# @incremental: only copy data described by the dirty bitmap. Since: 2.4
d58d8453 691#
1ad166b6
BC
692# Since: 1.3
693##
694{ 'enum': 'MirrorSyncMode',
4b80ab2b 695 'data': ['top', 'full', 'none', 'incremental'] }
1ad166b6
BC
696
697##
698# @BlockJobType:
699#
700# Type of a block job.
701#
702# @commit: block commit job type, see "block-commit"
703#
704# @stream: block stream job type, see "block-stream"
705#
706# @mirror: drive mirror job type, see "drive-mirror"
707#
708# @backup: drive backup job type, see "drive-backup"
709#
710# Since: 1.7
711##
712{ 'enum': 'BlockJobType',
713 'data': ['commit', 'stream', 'mirror', 'backup'] }
714
715##
716# @BlockJobInfo:
717#
718# Information about a long-running block device operation.
719#
720# @type: the job type ('stream' for image streaming)
721#
6aae5be6
AG
722# @device: The job identifier. Originally the device name but other
723# values are allowed since QEMU 2.7
1ad166b6
BC
724#
725# @len: the maximum progress value
726#
727# @busy: false if the job is known to be in a quiescent state, with
728# no pending I/O. Since 1.3.
729#
730# @paused: whether the job is paused or, if @busy is true, will
731# pause itself as soon as possible. Since 1.3.
732#
733# @offset: the current progress value
734#
735# @speed: the rate limit, bytes per second
736#
737# @io-status: the status of the job (since 1.3)
738#
ef6dbf1e
HR
739# @ready: true if the job may be completed (since 2.2)
740#
1ad166b6
BC
741# Since: 1.1
742##
895a2a80 743{ 'struct': 'BlockJobInfo',
1ad166b6
BC
744 'data': {'type': 'str', 'device': 'str', 'len': 'int',
745 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
ef6dbf1e 746 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool'} }
1ad166b6
BC
747
748##
749# @query-block-jobs:
750#
751# Return information about long-running block device operations.
752#
753# Returns: a list of @BlockJobInfo for each active block job
754#
755# Since: 1.1
756##
757{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
758
759##
760# @block_passwd:
761#
762# This command sets the password of a block device that has not been open
763# with a password and requires one.
764#
765# The two cases where this can happen are a block device is created through
766# QEMU's initial command line or a block device is changed through the legacy
767# @change interface.
768#
769# In the event that the block device is created through the initial command
770# line, the VM will start in the stopped state regardless of whether '-S' is
771# used. The intention is for a management tool to query the block devices to
772# determine which ones are encrypted, set the passwords with this command, and
773# then start the guest with the @cont command.
774#
775# Either @device or @node-name must be set but not both.
776#
777# @device: #optional the name of the block backend device to set the password on
778#
779# @node-name: #optional graph node name to set the password on (Since 2.0)
780#
781# @password: the password to use for the device
782#
783# Returns: nothing on success
784# If @device is not a valid block device, DeviceNotFound
785# If @device is not encrypted, DeviceNotEncrypted
786#
787# Notes: Not all block formats support encryption and some that do are not
788# able to validate that a password is correct. Disk corruption may
789# occur if an invalid password is specified.
790#
791# Since: 0.14.0
792##
793{ 'command': 'block_passwd', 'data': {'*device': 'str',
794 '*node-name': 'str', 'password': 'str'} }
795
796##
797# @block_resize
798#
799# Resize a block image while a guest is running.
800#
801# Either @device or @node-name must be set but not both.
802#
803# @device: #optional the name of the device to get the image resized
804#
805# @node-name: #optional graph node name to get the image resized (Since 2.0)
806#
807# @size: new image size in bytes
808#
809# Returns: nothing on success
810# If @device is not a valid block device, DeviceNotFound
811#
812# Since: 0.14.0
813##
814{ 'command': 'block_resize', 'data': { '*device': 'str',
815 '*node-name': 'str',
816 'size': 'int' }}
817
818##
819# @NewImageMode
820#
821# An enumeration that tells QEMU how to set the backing file path in
822# a new image file.
823#
824# @existing: QEMU should look for an existing image file.
825#
826# @absolute-paths: QEMU should create a new image with absolute paths
827# for the backing file. If there is no backing file available, the new
828# image will not be backed either.
829#
830# Since: 1.1
831##
832{ 'enum': 'NewImageMode',
833 'data': [ 'existing', 'absolute-paths' ] }
834
835##
a911e6ae 836# @BlockdevSnapshotSync
1ad166b6
BC
837#
838# Either @device or @node-name must be set but not both.
839#
840# @device: #optional the name of the device to generate the snapshot from.
841#
842# @node-name: #optional graph node name to generate the snapshot from (Since 2.0)
843#
844# @snapshot-file: the target of the new image. A new file will be created.
845#
846# @snapshot-node-name: #optional the graph node name of the new image (Since 2.0)
847#
848# @format: #optional the format of the snapshot image, default is 'qcow2'.
849#
850# @mode: #optional whether and how QEMU should create a new image, default is
851# 'absolute-paths'.
852##
a911e6ae 853{ 'struct': 'BlockdevSnapshotSync',
1ad166b6
BC
854 'data': { '*device': 'str', '*node-name': 'str',
855 'snapshot-file': 'str', '*snapshot-node-name': 'str',
856 '*format': 'str', '*mode': 'NewImageMode' } }
857
43de7e2d
AG
858##
859# @BlockdevSnapshot
860#
861# @node: device or node name that will have a snapshot created.
862#
863# @overlay: reference to the existing block device that will become
864# the overlay of @node, as part of creating the snapshot.
865# It must not have a current backing file (this can be
866# achieved by passing "backing": "" to blockdev-add).
867#
868# Since 2.5
869##
870{ 'struct': 'BlockdevSnapshot',
871 'data': { 'node': 'str', 'overlay': 'str' } }
872
1ad166b6
BC
873##
874# @DriveBackup
875#
70559d49
AG
876# @job-id: #optional identifier for the newly-created block job. If
877# omitted, the device name will be used. (Since 2.7)
878#
b7e4fa22 879# @device: the device name or node-name of a root node which should be copied.
1ad166b6
BC
880#
881# @target: the target of the new image. If the file exists, or if it
882# is a device, the existing file/device will be used as the new
883# destination. If it does not exist, a new file will be created.
884#
885# @format: #optional the format of the new destination, default is to
886# probe if @mode is 'existing', else the format of the source
887#
888# @sync: what parts of the disk image should be copied to the destination
d58d8453
JS
889# (all the disk, only the sectors allocated in the topmost image, from a
890# dirty bitmap, or only new I/O).
1ad166b6
BC
891#
892# @mode: #optional whether and how QEMU should create a new image, default is
893# 'absolute-paths'.
894#
895# @speed: #optional the maximum speed, in bytes per second
896#
4b80ab2b
JS
897# @bitmap: #optional the name of dirty bitmap if sync is "incremental".
898# Must be present if sync is "incremental", must NOT be present
d58d8453
JS
899# otherwise. (Since 2.4)
900#
1ad166b6
BC
901# @on-source-error: #optional the action to take on an error on the source,
902# default 'report'. 'stop' and 'enospc' can only be used
903# if the block device supports io-status (see BlockInfo).
904#
905# @on-target-error: #optional the action to take on an error on the target,
906# default 'report' (no limitations, since this applies to
907# a different block device than @device).
908#
909# Note that @on-source-error and @on-target-error only affect background I/O.
910# If an error occurs during a guest write request, the device's rerror/werror
911# actions will be used.
912#
913# Since: 1.6
914##
895a2a80 915{ 'struct': 'DriveBackup',
70559d49
AG
916 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
917 '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
d58d8453 918 '*speed': 'int', '*bitmap': 'str',
1ad166b6
BC
919 '*on-source-error': 'BlockdevOnError',
920 '*on-target-error': 'BlockdevOnError' } }
921
c29c1dd3
FZ
922##
923# @BlockdevBackup
924#
70559d49
AG
925# @job-id: #optional identifier for the newly-created block job. If
926# omitted, the device name will be used. (Since 2.7)
927#
cef34eeb 928# @device: the device name or node-name of a root node which should be copied.
c29c1dd3 929#
39d990ac 930# @target: the device name or node-name of the backup target node.
c29c1dd3
FZ
931#
932# @sync: what parts of the disk image should be copied to the destination
933# (all the disk, only the sectors allocated in the topmost image, or
934# only new I/O).
935#
936# @speed: #optional the maximum speed, in bytes per second. The default is 0,
937# for unlimited.
938#
939# @on-source-error: #optional the action to take on an error on the source,
940# default 'report'. 'stop' and 'enospc' can only be used
941# if the block device supports io-status (see BlockInfo).
942#
943# @on-target-error: #optional the action to take on an error on the target,
944# default 'report' (no limitations, since this applies to
945# a different block device than @device).
946#
947# Note that @on-source-error and @on-target-error only affect background I/O.
948# If an error occurs during a guest write request, the device's rerror/werror
949# actions will be used.
950#
951# Since: 2.3
952##
895a2a80 953{ 'struct': 'BlockdevBackup',
70559d49 954 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
c29c1dd3
FZ
955 'sync': 'MirrorSyncMode',
956 '*speed': 'int',
957 '*on-source-error': 'BlockdevOnError',
958 '*on-target-error': 'BlockdevOnError' } }
959
1ad166b6
BC
960##
961# @blockdev-snapshot-sync
962#
963# Generates a synchronous snapshot of a block device.
964#
a911e6ae 965# For the arguments, see the documentation of BlockdevSnapshotSync.
1ad166b6
BC
966#
967# Returns: nothing on success
968# If @device is not a valid block device, DeviceNotFound
969#
970# Since 0.14.0
971##
972{ 'command': 'blockdev-snapshot-sync',
a911e6ae 973 'data': 'BlockdevSnapshotSync' }
1ad166b6 974
43de7e2d
AG
975
976##
977# @blockdev-snapshot
978#
979# Generates a snapshot of a block device.
980#
981# For the arguments, see the documentation of BlockdevSnapshot.
982#
983# Since 2.5
984##
985{ 'command': 'blockdev-snapshot',
986 'data': 'BlockdevSnapshot' }
987
fa40e656
JC
988##
989# @change-backing-file
990#
991# Change the backing file in the image file metadata. This does not
992# cause QEMU to reopen the image file to reparse the backing filename
993# (it may, however, perform a reopen to change permissions from
994# r/o -> r/w -> r/o, if needed). The new backing file string is written
995# into the image file metadata, and the QEMU internal strings are
996# updated.
997#
998# @image-node-name: The name of the block driver state node of the
999# image to modify.
1000#
7b5dca3f
KW
1001# @device: The device name or node-name of the root node that owns
1002# image-node-name.
fa40e656
JC
1003#
1004# @backing-file: The string to write as the backing file. This
1005# string is not validated, so care should be taken
1006# when specifying the string or the image chain may
1007# not be able to be reopened again.
1008#
1009# Since: 2.1
1010##
1011{ 'command': 'change-backing-file',
1012 'data': { 'device': 'str', 'image-node-name': 'str',
1013 'backing-file': 'str' } }
1014
1ad166b6
BC
1015##
1016# @block-commit
1017#
1018# Live commit of data from overlay image nodes into backing nodes - i.e.,
1019# writes data between 'top' and 'base' into 'base'.
1020#
fd62c609
AG
1021# @job-id: #optional identifier for the newly-created block job. If
1022# omitted, the device name will be used. (Since 2.7)
1023#
1d13b167 1024# @device: the device name or node-name of a root node
1ad166b6
BC
1025#
1026# @base: #optional The file name of the backing image to write data into.
1027# If not specified, this is the deepest backing image
1028#
7676e2c5
JC
1029# @top: #optional The file name of the backing image within the image chain,
1030# which contains the topmost data to be committed down. If
1031# not specified, this is the active layer.
1ad166b6 1032#
54e26900
JC
1033# @backing-file: #optional The backing file string to write into the overlay
1034# image of 'top'. If 'top' is the active layer,
1035# specifying a backing file string is an error. This
1036# filename is not validated.
1037#
1038# If a pathname string is such that it cannot be
1039# resolved by QEMU, that means that subsequent QMP or
1040# HMP commands must use node-names for the image in
1041# question, as filename lookup methods will fail.
1042#
1043# If not specified, QEMU will automatically determine
1044# the backing file string to use, or error out if
1045# there is no obvious choice. Care should be taken
1046# when specifying the string, to specify a valid
1047# filename or protocol.
1048# (Since 2.1)
1049#
1ad166b6
BC
1050# If top == base, that is an error.
1051# If top == active, the job will not be completed by itself,
1052# user needs to complete the job with the block-job-complete
1053# command after getting the ready event. (Since 2.0)
1054#
1055# If the base image is smaller than top, then the base image
1056# will be resized to be the same size as top. If top is
1057# smaller than the base image, the base will not be
1058# truncated. If you want the base image size to match the
1059# size of the smaller top, you can safely truncate it
1060# yourself once the commit operation successfully completes.
1061#
1ad166b6
BC
1062# @speed: #optional the maximum speed, in bytes per second
1063#
1064# Returns: Nothing on success
1065# If commit or stream is already active on this device, DeviceInUse
1066# If @device does not exist, DeviceNotFound
1067# If image commit is not supported by this device, NotSupported
1068# If @base or @top is invalid, a generic error is returned
1069# If @speed is invalid, InvalidParameter
1070#
1071# Since: 1.3
1072#
1073##
1074{ 'command': 'block-commit',
fd62c609 1075 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
54e26900 1076 '*backing-file': 'str', '*speed': 'int' } }
1ad166b6
BC
1077
1078##
1079# @drive-backup
1080#
1081# Start a point-in-time copy of a block device to a new destination. The
1082# status of ongoing drive-backup operations can be checked with
1083# query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1084# The operation can be stopped before it has completed using the
1085# block-job-cancel command.
1086#
1087# For the arguments, see the documentation of DriveBackup.
1088#
1089# Returns: nothing on success
b7e4fa22 1090# If @device is not a valid block device, GenericError
1ad166b6
BC
1091#
1092# Since 1.6
1093##
81206a89
PB
1094{ 'command': 'drive-backup', 'boxed': true,
1095 'data': 'DriveBackup' }
1ad166b6 1096
c29c1dd3
FZ
1097##
1098# @blockdev-backup
1099#
1100# Start a point-in-time copy of a block device to a new destination. The
1101# status of ongoing blockdev-backup operations can be checked with
1102# query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1103# The operation can be stopped before it has completed using the
1104# block-job-cancel command.
1105#
1106# For the arguments, see the documentation of BlockdevBackup.
1107#
dc7a4a9e
PB
1108# Returns: nothing on success
1109# If @device is not a valid block device, DeviceNotFound
1110#
c29c1dd3
FZ
1111# Since 2.3
1112##
dc7a4a9e
PB
1113{ 'command': 'blockdev-backup', 'boxed': true,
1114 'data': 'BlockdevBackup' }
c29c1dd3
FZ
1115
1116
1ad166b6
BC
1117##
1118# @query-named-block-nodes
1119#
1120# Get the named block driver list
1121#
1122# Returns: the list of BlockDeviceInfo
1123#
1124# Since 2.0
1125##
1126{ 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1127
1128##
1129# @drive-mirror
1130#
1131# Start mirroring a block device's writes to a new destination.
1132#
faecd40a
EB
1133# See DriveMirror for parameter descriptions
1134#
1135# Returns: nothing on success
0524e93a 1136# If @device is not a valid block device, GenericError
faecd40a
EB
1137#
1138# Since 1.3
1139##
1140{ 'command': 'drive-mirror', 'boxed': true,
1141 'data': 'DriveMirror' }
1142
1143##
1144# DriveMirror
1145#
1146# A set of parameters describing drive mirror setup.
1147#
71aa9867
AG
1148# @job-id: #optional identifier for the newly-created block job. If
1149# omitted, the device name will be used. (Since 2.7)
1150#
0524e93a
KW
1151# @device: the device name or node-name of a root node whose writes should be
1152# mirrored.
1ad166b6
BC
1153#
1154# @target: the target of the new image. If the file exists, or if it
1155# is a device, the existing file/device will be used as the new
1156# destination. If it does not exist, a new file will be created.
1157#
1158# @format: #optional the format of the new destination, default is to
1159# probe if @mode is 'existing', else the format of the source
1160#
4c828dc6
BC
1161# @node-name: #optional the new block driver state node name in the graph
1162# (Since 2.1)
1163#
09158f00
BC
1164# @replaces: #optional with sync=full graph node name to be replaced by the new
1165# image when a whole image copy is done. This can be used to repair
1166# broken Quorum files. (Since 2.1)
1167#
1ad166b6
BC
1168# @mode: #optional whether and how QEMU should create a new image, default is
1169# 'absolute-paths'.
1170#
1171# @speed: #optional the maximum speed, in bytes per second
1172#
1173# @sync: what parts of the disk image should be copied to the destination
1174# (all the disk, only the sectors allocated in the topmost image, or
1175# only new I/O).
1176#
1177# @granularity: #optional granularity of the dirty bitmap, default is 64K
1178# if the image format doesn't have clusters, 4K if the clusters
1179# are smaller than that, else the cluster size. Must be a
1180# power of 2 between 512 and 64M (since 1.4).
1181#
1182# @buf-size: #optional maximum amount of data in flight from source to
1183# target (since 1.4).
1184#
1185# @on-source-error: #optional the action to take on an error on the source,
1186# default 'report'. 'stop' and 'enospc' can only be used
1187# if the block device supports io-status (see BlockInfo).
1188#
1189# @on-target-error: #optional the action to take on an error on the target,
1190# default 'report' (no limitations, since this applies to
1191# a different block device than @device).
0fc9f8ea
FZ
1192# @unmap: #optional Whether to try to unmap target sectors where source has
1193# only zero. If true, and target unallocated sectors will read as zero,
1194# target image sectors will be unmapped; otherwise, zeroes will be
1195# written. Both will result in identical contents.
1196# Default is true. (Since 2.4)
1ad166b6 1197#
1ad166b6
BC
1198# Since 1.3
1199##
faecd40a 1200{ 'struct': 'DriveMirror',
71aa9867
AG
1201 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1202 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1ad166b6
BC
1203 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1204 '*speed': 'int', '*granularity': 'uint32',
1205 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
0fc9f8ea
FZ
1206 '*on-target-error': 'BlockdevOnError',
1207 '*unmap': 'bool' } }
1ad166b6 1208
341ebc2f
JS
1209##
1210# @BlockDirtyBitmap
1211#
1212# @node: name of device/node which the bitmap is tracking
1213#
1214# @name: name of the dirty bitmap
1215#
1216# Since 2.4
1217##
895a2a80 1218{ 'struct': 'BlockDirtyBitmap',
341ebc2f
JS
1219 'data': { 'node': 'str', 'name': 'str' } }
1220
1221##
1222# @BlockDirtyBitmapAdd
1223#
1224# @node: name of device/node which the bitmap is tracking
1225#
1226# @name: name of the dirty bitmap
1227#
1228# @granularity: #optional the bitmap granularity, default is 64k for
1229# block-dirty-bitmap-add
1230#
1231# Since 2.4
1232##
895a2a80 1233{ 'struct': 'BlockDirtyBitmapAdd',
341ebc2f
JS
1234 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32' } }
1235
1236##
1237# @block-dirty-bitmap-add
1238#
1239# Create a dirty bitmap with a name on the node
1240#
1241# Returns: nothing on success
1242# If @node is not a valid block device or node, DeviceNotFound
1243# If @name is already taken, GenericError with an explanation
1244#
1245# Since 2.4
1246##
1247{ 'command': 'block-dirty-bitmap-add',
1248 'data': 'BlockDirtyBitmapAdd' }
1249
1250##
1251# @block-dirty-bitmap-remove
1252#
1253# Remove a dirty bitmap on the node
1254#
1255# Returns: nothing on success
1256# If @node is not a valid block device or node, DeviceNotFound
1257# If @name is not found, GenericError with an explanation
9bd2b08f 1258# if @name is frozen by an operation, GenericError
341ebc2f
JS
1259#
1260# Since 2.4
1261##
1262{ 'command': 'block-dirty-bitmap-remove',
1263 'data': 'BlockDirtyBitmap' }
1264
e74e6b78
JS
1265##
1266# @block-dirty-bitmap-clear
1267#
1268# Clear (reset) a dirty bitmap on the device
1269#
1270# Returns: nothing on success
1271# If @node is not a valid block device, DeviceNotFound
1272# If @name is not found, GenericError with an explanation
1273#
1274# Since 2.4
1275##
1276{ 'command': 'block-dirty-bitmap-clear',
1277 'data': 'BlockDirtyBitmap' }
1278
df92562e
FZ
1279##
1280# @blockdev-mirror
1281#
1282# Start mirroring a block device's writes to a new destination.
1283#
71aa9867
AG
1284# @job-id: #optional identifier for the newly-created block job. If
1285# omitted, the device name will be used. (Since 2.7)
1286#
07eec652
KW
1287# @device: The device name or node-name of a root node whose writes should be
1288# mirrored.
df92562e
FZ
1289#
1290# @target: the id or node-name of the block device to mirror to. This mustn't be
1291# attached to guest.
1292#
1293# @replaces: #optional with sync=full graph node name to be replaced by the new
1294# image when a whole image copy is done. This can be used to repair
1295# broken Quorum files.
1296#
1297# @speed: #optional the maximum speed, in bytes per second
1298#
1299# @sync: what parts of the disk image should be copied to the destination
1300# (all the disk, only the sectors allocated in the topmost image, or
1301# only new I/O).
1302#
1303# @granularity: #optional granularity of the dirty bitmap, default is 64K
1304# if the image format doesn't have clusters, 4K if the clusters
1305# are smaller than that, else the cluster size. Must be a
1306# power of 2 between 512 and 64M
1307#
1308# @buf-size: #optional maximum amount of data in flight from source to
1309# target
1310#
1311# @on-source-error: #optional the action to take on an error on the source,
1312# default 'report'. 'stop' and 'enospc' can only be used
1313# if the block device supports io-status (see BlockInfo).
1314#
1315# @on-target-error: #optional the action to take on an error on the target,
1316# default 'report' (no limitations, since this applies to
1317# a different block device than @device).
1318#
1319# Returns: nothing on success.
1320#
1321# Since 2.6
1322##
1323{ 'command': 'blockdev-mirror',
71aa9867 1324 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
df92562e
FZ
1325 '*replaces': 'str',
1326 'sync': 'MirrorSyncMode',
1327 '*speed': 'int', '*granularity': 'uint32',
1328 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1329 '*on-target-error': 'BlockdevOnError' } }
1330
1ad166b6
BC
1331##
1332# @block_set_io_throttle:
1333#
1334# Change I/O throttle limits for a block drive.
1335#
76f4afb4
AG
1336# Since QEMU 2.4, each device with I/O limits is member of a throttle
1337# group.
1338#
1339# If two or more devices are members of the same group, the limits
1340# will apply to the combined I/O of the whole group in a round-robin
1341# fashion. Therefore, setting new I/O limits to a device will affect
1342# the whole group.
1343#
1344# The name of the group can be specified using the 'group' parameter.
1345# If the parameter is unset, it is assumed to be the current group of
1346# that device. If it's not in any group yet, the name of the device
1347# will be used as the name for its group.
1348#
1349# The 'group' parameter can also be used to move a device to a
1350# different group. In this case the limits specified in the parameters
1351# will be applied to the new group only.
1352#
1353# I/O limits can be disabled by setting all of them to 0. In this case
1354# the device will be removed from its group and the rest of its
6b932c0a 1355# members will not be affected. The 'group' parameter is ignored.
76f4afb4 1356#
4dc9397b
EB
1357# See BlockIOThrottle for parameter descriptions.
1358#
1359# Returns: Nothing on success
1360# If @device is not a valid block device, DeviceNotFound
1361#
1362# Since: 1.1
1363##
1364{ 'command': 'block_set_io_throttle', 'boxed': true,
1365 'data': 'BlockIOThrottle' }
1366
1367##
1368# BlockIOThrottle
1369#
1370# A set of parameters describing block throttling.
1371#
1ad166b6
BC
1372# @device: The name of the device
1373#
1374# @bps: total throughput limit in bytes per second
1375#
1376# @bps_rd: read throughput limit in bytes per second
1377#
1378# @bps_wr: write throughput limit in bytes per second
1379#
1380# @iops: total I/O operations per second
1381#
f5a845fd 1382# @iops_rd: read I/O operations per second
1ad166b6
BC
1383#
1384# @iops_wr: write I/O operations per second
1385#
dce13204
AG
1386# @bps_max: #optional total throughput limit during bursts,
1387# in bytes (Since 1.7)
1ad166b6 1388#
dce13204
AG
1389# @bps_rd_max: #optional read throughput limit during bursts,
1390# in bytes (Since 1.7)
1ad166b6 1391#
dce13204
AG
1392# @bps_wr_max: #optional write throughput limit during bursts,
1393# in bytes (Since 1.7)
1ad166b6 1394#
dce13204
AG
1395# @iops_max: #optional total I/O operations per second during bursts,
1396# in bytes (Since 1.7)
1ad166b6 1397#
dce13204
AG
1398# @iops_rd_max: #optional read I/O operations per second during bursts,
1399# in bytes (Since 1.7)
1ad166b6 1400#
dce13204
AG
1401# @iops_wr_max: #optional write I/O operations per second during bursts,
1402# in bytes (Since 1.7)
1403#
1404# @bps_max_length: #optional maximum length of the @bps_max burst
1405# period, in seconds. It must only
1406# be set if @bps_max is set as well.
1407# Defaults to 1. (Since 2.6)
1408#
1409# @bps_rd_max_length: #optional maximum length of the @bps_rd_max
1410# burst period, in seconds. It must only
1411# be set if @bps_rd_max is set as well.
1412# Defaults to 1. (Since 2.6)
1413#
1414# @bps_wr_max_length: #optional maximum length of the @bps_wr_max
1415# burst period, in seconds. It must only
1416# be set if @bps_wr_max is set as well.
1417# Defaults to 1. (Since 2.6)
1418#
1419# @iops_max_length: #optional maximum length of the @iops burst
1420# period, in seconds. It must only
1421# be set if @iops_max is set as well.
1422# Defaults to 1. (Since 2.6)
1423#
1424# @iops_rd_max_length: #optional maximum length of the @iops_rd_max
1425# burst period, in seconds. It must only
1426# be set if @iops_rd_max is set as well.
1427# Defaults to 1. (Since 2.6)
1428#
1429# @iops_wr_max_length: #optional maximum length of the @iops_wr_max
1430# burst period, in seconds. It must only
1431# be set if @iops_wr_max is set as well.
1432# Defaults to 1. (Since 2.6)
1ad166b6
BC
1433#
1434# @iops_size: #optional an I/O size in bytes (Since 1.7)
1435#
76f4afb4
AG
1436# @group: #optional throttle group name (Since 2.4)
1437#
1ad166b6
BC
1438# Since: 1.1
1439##
4dc9397b 1440{ 'struct': 'BlockIOThrottle',
1ad166b6
BC
1441 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
1442 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
1443 '*bps_max': 'int', '*bps_rd_max': 'int',
1444 '*bps_wr_max': 'int', '*iops_max': 'int',
1445 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
dce13204
AG
1446 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
1447 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
1448 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
76f4afb4 1449 '*iops_size': 'int', '*group': 'str' } }
1ad166b6
BC
1450
1451##
1452# @block-stream:
1453#
1454# Copy data from a backing file into a block device.
1455#
1456# The block streaming operation is performed in the background until the entire
1457# backing file has been copied. This command returns immediately once streaming
1458# has started. The status of ongoing block streaming operations can be checked
1459# with query-block-jobs. The operation can be stopped before it has completed
1460# using the block-job-cancel command.
1461#
1462# If a base file is specified then sectors are not copied from that base file and
1463# its backing chain. When streaming completes the image file will have the base
1464# file as its backing file. This can be used to stream a subset of the backing
1465# file chain instead of flattening the entire image.
1466#
1467# On successful completion the image file is updated to drop the backing file
1468# and the BLOCK_JOB_COMPLETED event is emitted.
1469#
2323322e
AG
1470# @job-id: #optional identifier for the newly-created block job. If
1471# omitted, the device name will be used. (Since 2.7)
1472#
b6c1bae5 1473# @device: the device name or node-name of a root node
1ad166b6
BC
1474#
1475# @base: #optional the common backing file name
1476#
13d8cc51
JC
1477# @backing-file: #optional The backing file string to write into the active
1478# layer. This filename is not validated.
1479#
1480# If a pathname string is such that it cannot be
1481# resolved by QEMU, that means that subsequent QMP or
1482# HMP commands must use node-names for the image in
1483# question, as filename lookup methods will fail.
1484#
1485# If not specified, QEMU will automatically determine
1486# the backing file string to use, or error out if there
1487# is no obvious choice. Care should be taken when
1488# specifying the string, to specify a valid filename or
1489# protocol.
1490# (Since 2.1)
1491#
1ad166b6
BC
1492# @speed: #optional the maximum speed, in bytes per second
1493#
1494# @on-error: #optional the action to take on an error (default report).
1495# 'stop' and 'enospc' can only be used if the block device
1496# supports io-status (see BlockInfo). Since 1.3.
1497#
1ad166b6
BC
1498# Since: 1.1
1499##
1500{ 'command': 'block-stream',
2323322e
AG
1501 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
1502 '*backing-file': 'str', '*speed': 'int',
1503 '*on-error': 'BlockdevOnError' } }
1ad166b6
BC
1504
1505##
1506# @block-job-set-speed:
1507#
1508# Set maximum speed for a background block operation.
1509#
1510# This command can only be issued when there is an active block job.
1511#
1512# Throttling can be disabled by setting the speed to 0.
1513#
6aae5be6
AG
1514# @device: The job identifier. This used to be a device name (hence
1515# the name of the parameter), but since QEMU 2.7 it can have
1516# other values.
1ad166b6
BC
1517#
1518# @speed: the maximum speed, in bytes per second, or 0 for unlimited.
1519# Defaults to 0.
1520#
1521# Returns: Nothing on success
1522# If no background operation is active on this device, DeviceNotActive
1523#
1524# Since: 1.1
1525##
1526{ 'command': 'block-job-set-speed',
1527 'data': { 'device': 'str', 'speed': 'int' } }
1528
1529##
1530# @block-job-cancel:
1531#
1532# Stop an active background block operation.
1533#
1534# This command returns immediately after marking the active background block
1535# operation for cancellation. It is an error to call this command if no
1536# operation is in progress.
1537#
1538# The operation will cancel as soon as possible and then emit the
1539# BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
1540# enumerated using query-block-jobs.
1541#
1542# For streaming, the image file retains its backing file unless the streaming
1543# operation happens to complete just as it is being cancelled. A new streaming
1544# operation can be started at a later time to finish copying all data from the
1545# backing file.
1546#
6aae5be6
AG
1547# @device: The job identifier. This used to be a device name (hence
1548# the name of the parameter), but since QEMU 2.7 it can have
1549# other values.
1ad166b6
BC
1550#
1551# @force: #optional whether to allow cancellation of a paused job (default
1552# false). Since 1.3.
1553#
1554# Returns: Nothing on success
1555# If no background operation is active on this device, DeviceNotActive
1556#
1557# Since: 1.1
1558##
1559{ 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
1560
1561##
1562# @block-job-pause:
1563#
1564# Pause an active background block operation.
1565#
1566# This command returns immediately after marking the active background block
1567# operation for pausing. It is an error to call this command if no
1568# operation is in progress. Pausing an already paused job has no cumulative
1569# effect; a single block-job-resume command will resume the job.
1570#
1571# The operation will pause as soon as possible. No event is emitted when
1572# the operation is actually paused. Cancelling a paused job automatically
1573# resumes it.
1574#
6aae5be6
AG
1575# @device: The job identifier. This used to be a device name (hence
1576# the name of the parameter), but since QEMU 2.7 it can have
1577# other values.
1ad166b6
BC
1578#
1579# Returns: Nothing on success
1580# If no background operation is active on this device, DeviceNotActive
1581#
1582# Since: 1.3
1583##
1584{ 'command': 'block-job-pause', 'data': { 'device': 'str' } }
1585
1586##
1587# @block-job-resume:
1588#
1589# Resume an active background block operation.
1590#
1591# This command returns immediately after resuming a paused background block
1592# operation. It is an error to call this command if no operation is in
1593# progress. Resuming an already running job is not an error.
1594#
1595# This command also clears the error status of the job.
1596#
6aae5be6
AG
1597# @device: The job identifier. This used to be a device name (hence
1598# the name of the parameter), but since QEMU 2.7 it can have
1599# other values.
1ad166b6
BC
1600#
1601# Returns: Nothing on success
1602# If no background operation is active on this device, DeviceNotActive
1603#
1604# Since: 1.3
1605##
1606{ 'command': 'block-job-resume', 'data': { 'device': 'str' } }
1607
1608##
1609# @block-job-complete:
1610#
1611# Manually trigger completion of an active background block operation. This
1612# is supported for drive mirroring, where it also switches the device to
1613# write to the target path only. The ability to complete is signaled with
1614# a BLOCK_JOB_READY event.
1615#
1616# This command completes an active background block operation synchronously.
1617# The ordering of this command's return with the BLOCK_JOB_COMPLETED event
1618# is not defined. Note that if an I/O error occurs during the processing of
1619# this command: 1) the command itself will fail; 2) the error will be processed
1620# according to the rerror/werror arguments that were specified when starting
1621# the operation.
1622#
1623# A cancelled or paused job cannot be completed.
1624#
6aae5be6
AG
1625# @device: The job identifier. This used to be a device name (hence
1626# the name of the parameter), but since QEMU 2.7 it can have
1627# other values.
1ad166b6
BC
1628#
1629# Returns: Nothing on success
1630# If no background operation is active on this device, DeviceNotActive
1631#
1632# Since: 1.3
1633##
1634{ 'command': 'block-job-complete', 'data': { 'device': 'str' } }
1635
1636##
1637# @BlockdevDiscardOptions
1638#
1639# Determines how to handle discard requests.
1640#
1641# @ignore: Ignore the request
1642# @unmap: Forward as an unmap request
1643#
1644# Since: 1.7
1645##
1646{ 'enum': 'BlockdevDiscardOptions',
1647 'data': [ 'ignore', 'unmap' ] }
1648
1649##
1650# @BlockdevDetectZeroesOptions
1651#
1652# Describes the operation mode for the automatic conversion of plain
1653# zero writes by the OS to driver specific optimized zero write commands.
1654#
1655# @off: Disabled (default)
1656# @on: Enabled
1657# @unmap: Enabled and even try to unmap blocks if possible. This requires
1658# also that @BlockdevDiscardOptions is set to unmap for this device.
1659#
1660# Since: 2.1
1661##
1662{ 'enum': 'BlockdevDetectZeroesOptions',
1663 'data': [ 'off', 'on', 'unmap' ] }
1664
1665##
1666# @BlockdevAioOptions
1667#
1668# Selects the AIO backend to handle I/O requests
1669#
1670# @threads: Use qemu's thread pool
1671# @native: Use native AIO backend (only Linux and Windows)
1672#
1673# Since: 1.7
1674##
1675{ 'enum': 'BlockdevAioOptions',
1676 'data': [ 'threads', 'native' ] }
1677
1678##
1679# @BlockdevCacheOptions
1680#
1681# Includes cache-related options for block devices
1682#
1ad166b6
BC
1683# @direct: #optional enables use of O_DIRECT (bypass the host page cache;
1684# default: false)
1685# @no-flush: #optional ignore any flush requests for the device (default:
1686# false)
1687#
1688# Since: 1.7
1689##
895a2a80 1690{ 'struct': 'BlockdevCacheOptions',
aaa436f9 1691 'data': { '*direct': 'bool',
1ad166b6
BC
1692 '*no-flush': 'bool' } }
1693
1694##
1695# @BlockdevDriver
1696#
1697# Drivers that are supported in block device operations.
1698#
f709623b 1699# @host_device, @host_cdrom: Since 2.1
0a189ffb 1700# @gluster: Since 2.7
1ad166b6
BC
1701#
1702# Since: 2.0
1703##
1704{ 'enum': 'BlockdevDriver',
550830f9 1705 'data': [ 'archipelago', 'blkdebug', 'blkverify', 'bochs', 'cloop',
7edac2dd
PKK
1706 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
1707 'host_device', 'http', 'https', 'luks', 'null-aio', 'null-co',
1708 'parallels', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'tftp',
1709 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
1ad166b6 1710
1ad166b6
BC
1711##
1712# @BlockdevOptionsFile
1713#
1714# Driver specific block device options for the file backend and similar
1715# protocols.
1716#
1717# @filename: path to the image file
1718#
1719# Since: 1.7
1720##
895a2a80 1721{ 'struct': 'BlockdevOptionsFile',
1ad166b6
BC
1722 'data': { 'filename': 'str' } }
1723
e819ab22
FZ
1724##
1725# @BlockdevOptionsNull
1726#
1727# Driver specific block device options for the null backend.
1728#
1729# @size: #optional size of the device in bytes.
e5e51dd3
FZ
1730# @latency-ns: #optional emulated latency (in nanoseconds) in processing
1731# requests. Default to zero which completes requests immediately.
1732# (Since 2.4)
e819ab22
FZ
1733#
1734# Since: 2.2
1735##
895a2a80 1736{ 'struct': 'BlockdevOptionsNull',
e5e51dd3 1737 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
e819ab22 1738
1ad166b6
BC
1739##
1740# @BlockdevOptionsVVFAT
1741#
1742# Driver specific block device options for the vvfat protocol.
1743#
1744# @dir: directory to be exported as FAT image
1745# @fat-type: #optional FAT type: 12, 16 or 32
1746# @floppy: #optional whether to export a floppy image (true) or
1747# partitioned hard disk (false; default)
d5941dda
WB
1748# @label: #optional set the volume label, limited to 11 bytes. FAT16 and
1749# FAT32 traditionally have some restrictions on labels, which are
1750# ignored by most operating systems. Defaults to "QEMU VVFAT".
1751# (since 2.4)
1ad166b6
BC
1752# @rw: #optional whether to allow write operations (default: false)
1753#
1754# Since: 1.7
1755##
895a2a80 1756{ 'struct': 'BlockdevOptionsVVFAT',
1ad166b6 1757 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
d5941dda 1758 '*label': 'str', '*rw': 'bool' } }
1ad166b6
BC
1759
1760##
1761# @BlockdevOptionsGenericFormat
1762#
1763# Driver specific block device options for image format that have no option
1764# besides their data source.
1765#
1766# @file: reference to or definition of the data source block device
1767#
1768# Since: 1.7
1769##
895a2a80 1770{ 'struct': 'BlockdevOptionsGenericFormat',
1ad166b6
BC
1771 'data': { 'file': 'BlockdevRef' } }
1772
78368575
DB
1773##
1774# @BlockdevOptionsLUKS
1775#
1776# Driver specific block device options for LUKS.
1777#
1778# @key-secret: #optional the ID of a QCryptoSecret object providing
1779# the decryption key (since 2.6). Mandatory except when
1780# doing a metadata-only probe of the image.
1781#
1782# Since: 2.6
1783##
1784{ 'struct': 'BlockdevOptionsLUKS',
1785 'base': 'BlockdevOptionsGenericFormat',
1786 'data': { '*key-secret': 'str' } }
1787
1788
1ad166b6
BC
1789##
1790# @BlockdevOptionsGenericCOWFormat
1791#
1792# Driver specific block device options for image format that have no option
1793# besides their data source and an optional backing file.
1794#
1795# @backing: #optional reference to or definition of the backing file block
1796# device (if missing, taken from the image file content). It is
1797# allowed to pass an empty string here in order to disable the
1798# default backing file.
1799#
1800# Since: 1.7
1801##
895a2a80 1802{ 'struct': 'BlockdevOptionsGenericCOWFormat',
1ad166b6
BC
1803 'base': 'BlockdevOptionsGenericFormat',
1804 'data': { '*backing': 'BlockdevRef' } }
1805
f6585811
HR
1806##
1807# @Qcow2OverlapCheckMode
1808#
1809# General overlap check modes.
1810#
1811# @none: Do not perform any checks
1812#
1813# @constant: Perform only checks which can be done in constant time and
1814# without reading anything from disk
1815#
1816# @cached: Perform only checks which can be done without reading anything
1817# from disk
1818#
1819# @all: Perform all available overlap checks
1820#
1821# Since: 2.2
1822##
1823{ 'enum': 'Qcow2OverlapCheckMode',
1824 'data': [ 'none', 'constant', 'cached', 'all' ] }
1825
1826##
1827# @Qcow2OverlapCheckFlags
1828#
1829# Structure of flags for each metadata structure. Setting a field to 'true'
1830# makes qemu guard that structure against unintended overwriting. The default
1831# value is chosen according to the template given.
1832#
1833# @template: Specifies a template mode which can be adjusted using the other
1834# flags, defaults to 'cached'
1835#
1836# Since: 2.2
1837##
895a2a80 1838{ 'struct': 'Qcow2OverlapCheckFlags',
f6585811
HR
1839 'data': { '*template': 'Qcow2OverlapCheckMode',
1840 '*main-header': 'bool',
1841 '*active-l1': 'bool',
1842 '*active-l2': 'bool',
1843 '*refcount-table': 'bool',
1844 '*refcount-block': 'bool',
1845 '*snapshot-table': 'bool',
1846 '*inactive-l1': 'bool',
1847 '*inactive-l2': 'bool' } }
1848
1849##
1850# @Qcow2OverlapChecks
1851#
1852# Specifies which metadata structures should be guarded against unintended
1853# overwriting.
1854#
1855# @flags: set of flags for separate specification of each metadata structure
1856# type
1857#
1858# @mode: named mode which chooses a specific set of flags
1859#
1860# Since: 2.2
1861##
ab916fad 1862{ 'alternate': 'Qcow2OverlapChecks',
f6585811
HR
1863 'data': { 'flags': 'Qcow2OverlapCheckFlags',
1864 'mode': 'Qcow2OverlapCheckMode' } }
1865
1ad166b6
BC
1866##
1867# @BlockdevOptionsQcow2
1868#
1869# Driver specific block device options for qcow2.
1870#
1871# @lazy-refcounts: #optional whether to enable the lazy refcounts
1872# feature (default is taken from the image file)
1873#
1874# @pass-discard-request: #optional whether discard requests to the qcow2
1875# device should be forwarded to the data source
1876#
1877# @pass-discard-snapshot: #optional whether discard requests for the data source
1878# should be issued when a snapshot operation (e.g.
1879# deleting a snapshot) frees clusters in the qcow2 file
1880#
1881# @pass-discard-other: #optional whether discard requests for the data source
1882# should be issued on other occasions where a cluster
1883# gets freed
1884#
f6585811
HR
1885# @overlap-check: #optional which overlap checks to perform for writes
1886# to the image, defaults to 'cached' (since 2.2)
1887#
1888# @cache-size: #optional the maximum total size of the L2 table and
1889# refcount block caches in bytes (since 2.2)
1890#
1891# @l2-cache-size: #optional the maximum size of the L2 table cache in
1892# bytes (since 2.2)
1893#
1894# @refcount-cache-size: #optional the maximum size of the refcount block cache
1895# in bytes (since 2.2)
1896#
279621c0
AG
1897# @cache-clean-interval: #optional clean unused entries in the L2 and refcount
1898# caches. The interval is in seconds. The default value
1899# is 0 and it disables this feature (since 2.5)
1900#
1ad166b6
BC
1901# Since: 1.7
1902##
895a2a80 1903{ 'struct': 'BlockdevOptionsQcow2',
1ad166b6
BC
1904 'base': 'BlockdevOptionsGenericCOWFormat',
1905 'data': { '*lazy-refcounts': 'bool',
1906 '*pass-discard-request': 'bool',
1907 '*pass-discard-snapshot': 'bool',
f6585811
HR
1908 '*pass-discard-other': 'bool',
1909 '*overlap-check': 'Qcow2OverlapChecks',
1910 '*cache-size': 'int',
1911 '*l2-cache-size': 'int',
279621c0
AG
1912 '*refcount-cache-size': 'int',
1913 '*cache-clean-interval': 'int' } }
1ad166b6 1914
b1de5f43
CN
1915
1916##
1917# @BlockdevOptionsArchipelago
1918#
1919# Driver specific block device options for Archipelago.
1920#
1921# @volume: Name of the Archipelago volume image
1922#
1923# @mport: #optional The port number on which mapperd is
1924# listening. This is optional
1925# and if not specified, QEMU will make Archipelago
1926# use the default port (1001).
1927#
1928# @vport: #optional The port number on which vlmcd is
1929# listening. This is optional
1930# and if not specified, QEMU will make Archipelago
1931# use the default port (501).
1932#
1933# @segment: #optional The name of the shared memory segment
1934# Archipelago stack is using. This is optional
1935# and if not specified, QEMU will make Archipelago
1936# use the default value, 'archipelago'.
1937# Since: 2.2
1938##
895a2a80 1939{ 'struct': 'BlockdevOptionsArchipelago',
b1de5f43
CN
1940 'data': { 'volume': 'str',
1941 '*mport': 'int',
1942 '*vport': 'int',
1943 '*segment': 'str' } }
1944
1945
1ad166b6
BC
1946##
1947# @BlkdebugEvent
1948#
1949# Trigger events supported by blkdebug.
a31939e6
EB
1950#
1951# Since: 2.0
1ad166b6 1952##
a31939e6 1953{ 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
5be5b776
EB
1954 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
1955 'l1_grow_activate_table', 'l2_load', 'l2_update',
1956 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
1ad166b6
BC
1957 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
1958 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
1959 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
1960 'refblock_load', 'refblock_update', 'refblock_update_part',
5be5b776
EB
1961 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
1962 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
1963 'refblock_alloc_switch_table', 'cluster_alloc',
1ad166b6 1964 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
5be5b776
EB
1965 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
1966 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
d21de4d9 1967 'pwritev_zero', 'pwritev_done', 'empty_image_prepare' ] }
1ad166b6
BC
1968
1969##
1970# @BlkdebugInjectErrorOptions
1971#
1972# Describes a single error injection for blkdebug.
1973#
1974# @event: trigger event
1975#
1976# @state: #optional the state identifier blkdebug needs to be in to
1977# actually trigger the event; defaults to "any"
1978#
1979# @errno: #optional error identifier (errno) to be returned; defaults to
1980# EIO
1981#
1982# @sector: #optional specifies the sector index which has to be affected
1983# in order to actually trigger the event; defaults to "any
1984# sector"
1985#
1986# @once: #optional disables further events after this one has been
1987# triggered; defaults to false
1988#
1989# @immediately: #optional fail immediately; defaults to false
1990#
1991# Since: 2.0
1992##
895a2a80 1993{ 'struct': 'BlkdebugInjectErrorOptions',
1ad166b6
BC
1994 'data': { 'event': 'BlkdebugEvent',
1995 '*state': 'int',
1996 '*errno': 'int',
1997 '*sector': 'int',
1998 '*once': 'bool',
1999 '*immediately': 'bool' } }
2000
2001##
2002# @BlkdebugSetStateOptions
2003#
2004# Describes a single state-change event for blkdebug.
2005#
2006# @event: trigger event
2007#
2008# @state: #optional the current state identifier blkdebug needs to be in;
2009# defaults to "any"
2010#
2011# @new_state: the state identifier blkdebug is supposed to assume if
2012# this event is triggered
2013#
2014# Since: 2.0
2015##
895a2a80 2016{ 'struct': 'BlkdebugSetStateOptions',
1ad166b6
BC
2017 'data': { 'event': 'BlkdebugEvent',
2018 '*state': 'int',
2019 'new_state': 'int' } }
2020
2021##
2022# @BlockdevOptionsBlkdebug
2023#
2024# Driver specific block device options for blkdebug.
2025#
2026# @image: underlying raw block device (or image file)
2027#
2028# @config: #optional filename of the configuration file
2029#
835db3ee
EB
2030# @align: #optional required alignment for requests in bytes,
2031# must be power of 2, or 0 for default
1ad166b6
BC
2032#
2033# @inject-error: #optional array of error injection descriptions
2034#
2035# @set-state: #optional array of state-change descriptions
2036#
2037# Since: 2.0
2038##
895a2a80 2039{ 'struct': 'BlockdevOptionsBlkdebug',
1ad166b6
BC
2040 'data': { 'image': 'BlockdevRef',
2041 '*config': 'str',
2042 '*align': 'int',
2043 '*inject-error': ['BlkdebugInjectErrorOptions'],
2044 '*set-state': ['BlkdebugSetStateOptions'] } }
2045
2046##
2047# @BlockdevOptionsBlkverify
2048#
2049# Driver specific block device options for blkverify.
2050#
2051# @test: block device to be tested
2052#
2053# @raw: raw image used for verification
2054#
2055# Since: 2.0
2056##
895a2a80 2057{ 'struct': 'BlockdevOptionsBlkverify',
1ad166b6
BC
2058 'data': { 'test': 'BlockdevRef',
2059 'raw': 'BlockdevRef' } }
2060
62c6031f
LY
2061##
2062# @QuorumReadPattern
2063#
2064# An enumeration of quorum read patterns.
2065#
2066# @quorum: read all the children and do a quorum vote on reads
2067#
2068# @fifo: read only from the first child that has not failed
2069#
2070# Since: 2.2
2071##
2072{ 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
2073
1ad166b6
BC
2074##
2075# @BlockdevOptionsQuorum
2076#
2077# Driver specific block device options for Quorum
2078#
2079# @blkverify: #optional true if the driver must print content mismatch
2080# set to false by default
2081#
2082# @children: the children block devices to use
2083#
2084# @vote-threshold: the vote limit under which a read will fail
2085#
cf29a570
BC
2086# @rewrite-corrupted: #optional rewrite corrupted data when quorum is reached
2087# (Since 2.1)
2088#
62c6031f
LY
2089# @read-pattern: #optional choose read pattern and set to quorum by default
2090# (Since 2.2)
2091#
1ad166b6
BC
2092# Since: 2.0
2093##
895a2a80 2094{ 'struct': 'BlockdevOptionsQuorum',
1ad166b6
BC
2095 'data': { '*blkverify': 'bool',
2096 'children': [ 'BlockdevRef' ],
62c6031f
LY
2097 'vote-threshold': 'int',
2098 '*rewrite-corrupted': 'bool',
2099 '*read-pattern': 'QuorumReadPattern' } }
1ad166b6 2100
7edac2dd
PKK
2101##
2102# @GlusterTransport
2103#
2104# An enumeration of Gluster transport types
2105#
2106# @tcp: TCP - Transmission Control Protocol
2107#
2108# @unix: UNIX - Unix domain socket
2109#
2110# Since: 2.7
2111##
2112{ 'enum': 'GlusterTransport',
2113 'data': [ 'unix', 'tcp' ] }
2114
2115
2116##
2117# @GlusterServer
2118#
2119# Captures the address of a socket
2120#
2121# Details for connecting to a gluster server
2122#
2123# @type: Transport type used for gluster connection
2124#
2125# @unix: socket file
2126#
2127# @tcp: host address and port number
2128#
2129# Since: 2.7
2130##
2131{ 'union': 'GlusterServer',
2132 'base': { 'type': 'GlusterTransport' },
2133 'discriminator': 'type',
2134 'data': { 'unix': 'UnixSocketAddress',
2135 'tcp': 'InetSocketAddress' } }
2136
2137##
2138# @BlockdevOptionsGluster
2139#
2140# Driver specific block device options for Gluster
2141#
2142# @volume: name of gluster volume where VM image resides
2143#
2144# @path: absolute path to image file in gluster volume
2145#
0a189ffb 2146# @server: gluster servers description
7edac2dd
PKK
2147#
2148# @debug-level: #optional libgfapi log level (default '4' which is Error)
2149#
2150# Since: 2.7
2151##
2152{ 'struct': 'BlockdevOptionsGluster',
2153 'data': { 'volume': 'str',
2154 'path': 'str',
6c7189bb 2155 'server': ['GlusterServer'],
0a189ffb 2156 '*debug-level': 'int' } }
7edac2dd 2157
1ad166b6
BC
2158##
2159# @BlockdevOptions
2160#
3666a97f
EB
2161# Options for creating a block device. Many options are available for all
2162# block devices, independent of the block driver:
2163#
2164# @driver: block driver name
2165# @id: #optional id by which the new block device can be referred to.
2166# This option is only allowed on the top level of blockdev-add.
2167# A BlockBackend will be created by blockdev-add if and only if
2168# this option is given.
2169# @node-name: #optional the name of a block driver state node (Since 2.0).
2170# This option is required on the top level of blockdev-add if
2171# the @id option is not given there.
2172# @discard: #optional discard-related options (default: ignore)
2173# @cache: #optional cache-related options
2174# @aio: #optional AIO backend (default: threads)
3666a97f
EB
2175# @read-only: #optional whether the block device should be read-only
2176# (default: false)
3666a97f
EB
2177# @detect-zeroes: #optional detect and optimize zero writes (Since 2.1)
2178# (default: off)
2179#
2180# Remaining options are determined by the block driver.
1ad166b6
BC
2181#
2182# Since: 1.7
2183##
2184{ 'union': 'BlockdevOptions',
3666a97f 2185 'base': { 'driver': 'BlockdevDriver',
35fedb7b 2186# TODO 'id' is a BB-level option, remove it
3666a97f
EB
2187 '*id': 'str',
2188 '*node-name': 'str',
2189 '*discard': 'BlockdevDiscardOptions',
2190 '*cache': 'BlockdevCacheOptions',
2191 '*aio': 'BlockdevAioOptions',
3666a97f 2192 '*read-only': 'bool',
3666a97f 2193 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
1ad166b6
BC
2194 'discriminator': 'driver',
2195 'data': {
b1de5f43 2196 'archipelago':'BlockdevOptionsArchipelago',
db866be9
FZ
2197 'blkdebug': 'BlockdevOptionsBlkdebug',
2198 'blkverify': 'BlockdevOptionsBlkverify',
2199 'bochs': 'BlockdevOptionsGenericFormat',
2200 'cloop': 'BlockdevOptionsGenericFormat',
db866be9 2201 'dmg': 'BlockdevOptionsGenericFormat',
1ad166b6 2202 'file': 'BlockdevOptionsFile',
db866be9
FZ
2203 'ftp': 'BlockdevOptionsFile',
2204 'ftps': 'BlockdevOptionsFile',
7edac2dd 2205 'gluster': 'BlockdevOptionsGluster',
1ad166b6 2206 'host_cdrom': 'BlockdevOptionsFile',
db866be9 2207 'host_device':'BlockdevOptionsFile',
1ad166b6
BC
2208 'http': 'BlockdevOptionsFile',
2209 'https': 'BlockdevOptionsFile',
1ad166b6 2210# TODO iscsi: Wait for structured options
78368575 2211 'luks': 'BlockdevOptionsLUKS',
1ad166b6
BC
2212# TODO nbd: Should take InetSocketAddress for 'host'?
2213# TODO nfs: Wait for structured options
db866be9
FZ
2214 'null-aio': 'BlockdevOptionsNull',
2215 'null-co': 'BlockdevOptionsNull',
1ad166b6 2216 'parallels': 'BlockdevOptionsGenericFormat',
1ad166b6 2217 'qcow2': 'BlockdevOptionsQcow2',
db866be9 2218 'qcow': 'BlockdevOptionsGenericCOWFormat',
1ad166b6 2219 'qed': 'BlockdevOptionsGenericCOWFormat',
db866be9 2220 'quorum': 'BlockdevOptionsQuorum',
1ad166b6 2221 'raw': 'BlockdevOptionsGenericFormat',
db866be9
FZ
2222# TODO rbd: Wait for structured options
2223# TODO sheepdog: Wait for structured options
2224# TODO ssh: Should take InetSocketAddress for 'host'?
2225 'tftp': 'BlockdevOptionsFile',
1ad166b6
BC
2226 'vdi': 'BlockdevOptionsGenericFormat',
2227 'vhdx': 'BlockdevOptionsGenericFormat',
2228 'vmdk': 'BlockdevOptionsGenericCOWFormat',
2229 'vpc': 'BlockdevOptionsGenericFormat',
db866be9 2230 'vvfat': 'BlockdevOptionsVVFAT'
1ad166b6
BC
2231 } }
2232
2233##
2234# @BlockdevRef
2235#
2236# Reference to a block device.
2237#
2238# @definition: defines a new block device inline
2239# @reference: references the ID of an existing block device. An
2240# empty string means that no block device should be
2241# referenced.
2242#
2243# Since: 1.7
2244##
ab916fad 2245{ 'alternate': 'BlockdevRef',
1ad166b6
BC
2246 'data': { 'definition': 'BlockdevOptions',
2247 'reference': 'str' } }
2248
2249##
2250# @blockdev-add:
2251#
be4b67bc
HR
2252# Creates a new block device. If the @id option is given at the top level, a
2253# BlockBackend will be created; otherwise, @node-name is mandatory at the top
2254# level and no BlockBackend will be created.
1ad166b6 2255#
da2cf4e8 2256# This command is still a work in progress. It doesn't support all
81b936ae
AG
2257# block drivers among other things. Stay away from it unless you want
2258# to help with its development.
da2cf4e8 2259#
1ad166b6
BC
2260# @options: block device options for the new device
2261#
2262# Since: 1.7
2263##
2264{ 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }
2265
81b936ae
AG
2266##
2267# @x-blockdev-del:
2268#
2269# Deletes a block device that has been added using blockdev-add.
2270# The selected device can be either a block backend or a graph node.
2271#
2272# In the former case the backend will be destroyed, along with its
2273# inserted medium if there's any. The command will fail if the backend
2274# or its medium are in use.
2275#
2276# In the latter case the node will be destroyed. The command will fail
2277# if the node is attached to a block backend or is otherwise being
2278# used.
2279#
2280# One of @id or @node-name must be specified, but not both.
2281#
2282# This command is still a work in progress and is considered
2283# experimental. Stay away from it unless you want to help with its
2284# development.
2285#
2286# @id: #optional Name of the block backend device to delete.
2287#
2288# @node-name: #optional Name of the graph node to delete.
2289#
2290# Since: 2.5
2291##
2292{ 'command': 'x-blockdev-del', 'data': { '*id': 'str', '*node-name': 'str' } }
2293
7d8a9f71
HR
2294##
2295# @blockdev-open-tray:
2296#
2297# Opens a block device's tray. If there is a block driver state tree inserted as
2298# a medium, it will become inaccessible to the guest (but it will remain
2299# associated to the block device, so closing the tray will make it accessible
2300# again).
2301#
2302# If the tray was already open before, this will be a no-op.
2303#
2304# Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
2305# which no such event will be generated, these include:
2306# - if the guest has locked the tray, @force is false and the guest does not
2307# respond to the eject request
2308# - if the BlockBackend denoted by @device does not have a guest device attached
2309# to it
12c7ec87 2310# - if the guest device does not have an actual tray
7d8a9f71
HR
2311#
2312# @device: block device name
2313#
2314# @force: #optional if false (the default), an eject request will be sent to
2315# the guest if it has locked the tray (and the tray will not be opened
2316# immediately); if true, the tray will be opened regardless of whether
2317# it is locked
2318#
2319# Since: 2.5
2320##
2321{ 'command': 'blockdev-open-tray',
2322 'data': { 'device': 'str',
2323 '*force': 'bool' } }
2324
abaaf59d
HR
2325##
2326# @blockdev-close-tray:
2327#
2328# Closes a block device's tray. If there is a block driver state tree associated
2329# with the block device (which is currently ejected), that tree will be loaded
2330# as the medium.
2331#
2332# If the tray was already closed before, this will be a no-op.
2333#
2334# @device: block device name
2335#
2336# Since: 2.5
2337##
2338{ 'command': 'blockdev-close-tray',
2339 'data': { 'device': 'str' } }
2340
2814f672 2341##
6e0abc25 2342# @x-blockdev-remove-medium:
2814f672
HR
2343#
2344# Removes a medium (a block driver state tree) from a block device. That block
2345# device's tray must currently be open (unless there is no attached guest
2346# device).
2347#
2348# If the tray is open and there is no medium inserted, this will be a no-op.
2349#
6e0abc25
HR
2350# This command is still a work in progress and is considered experimental.
2351# Stay away from it unless you want to help with its development.
2352#
2814f672
HR
2353# @device: block device name
2354#
2355# Since: 2.5
2356##
6e0abc25 2357{ 'command': 'x-blockdev-remove-medium',
2814f672
HR
2358 'data': { 'device': 'str' } }
2359
d1299882 2360##
6e0abc25 2361# @x-blockdev-insert-medium:
d1299882
HR
2362#
2363# Inserts a medium (a block driver state tree) into a block device. That block
2364# device's tray must currently be open (unless there is no attached guest
2365# device) and there must be no medium inserted already.
2366#
6e0abc25
HR
2367# This command is still a work in progress and is considered experimental.
2368# Stay away from it unless you want to help with its development.
2369#
d1299882
HR
2370# @device: block device name
2371#
2372# @node-name: name of a node in the block driver state graph
2373#
2374# Since: 2.5
2375##
6e0abc25 2376{ 'command': 'x-blockdev-insert-medium',
d1299882
HR
2377 'data': { 'device': 'str',
2378 'node-name': 'str'} }
2379
a589569f 2380
39ff43d9
HR
2381##
2382# @BlockdevChangeReadOnlyMode:
2383#
2384# Specifies the new read-only mode of a block device subject to the
2385# @blockdev-change-medium command.
2386#
2387# @retain: Retains the current read-only mode
2388#
2389# @read-only: Makes the device read-only
2390#
2391# @read-write: Makes the device writable
2392#
2393# Since: 2.3
2394##
2395{ 'enum': 'BlockdevChangeReadOnlyMode',
2396 'data': ['retain', 'read-only', 'read-write'] }
2397
2398
24fb4133
HR
2399##
2400# @blockdev-change-medium:
2401#
2402# Changes the medium inserted into a block device by ejecting the current medium
2403# and loading a new image file which is inserted as the new medium (this command
6e0abc25
HR
2404# combines blockdev-open-tray, x-blockdev-remove-medium,
2405# x-blockdev-insert-medium and blockdev-close-tray).
24fb4133
HR
2406#
2407# @device: block device name
2408#
2409# @filename: filename of the new image to be loaded
2410#
2411# @format: #optional, format to open the new image with (defaults to
2412# the probed format)
2413#
39ff43d9
HR
2414# @read-only-mode: #optional, change the read-only mode of the device; defaults
2415# to 'retain'
2416#
24fb4133
HR
2417# Since: 2.5
2418##
2419{ 'command': 'blockdev-change-medium',
2420 'data': { 'device': 'str',
2421 'filename': 'str',
39ff43d9
HR
2422 '*format': 'str',
2423 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
24fb4133
HR
2424
2425
a589569f
WX
2426##
2427# @BlockErrorAction
2428#
2429# An enumeration of action that has been taken when a DISK I/O occurs
2430#
2431# @ignore: error has been ignored
2432#
2433# @report: error has been reported to the device
2434#
2435# @stop: error caused VM to be stopped
2436#
2437# Since: 2.1
2438##
2439{ 'enum': 'BlockErrorAction',
2440 'data': [ 'ignore', 'report', 'stop' ] }
5a2d2cbd
WX
2441
2442
c120f0fa
WX
2443##
2444# @BLOCK_IMAGE_CORRUPTED
2445#
9bf040b9 2446# Emitted when a corruption has been detected in a disk image
c120f0fa 2447#
dc881b44
AG
2448# @device: device name. This is always present for compatibility
2449# reasons, but it can be empty ("") if the image does not
2450# have a device name associated.
2451#
2452# @node-name: #optional node name (Since: 2.4)
c120f0fa
WX
2453#
2454# @msg: informative message for human consumption, such as the kind of
2f44a08b
WX
2455# corruption being detected. It should not be parsed by machine as it is
2456# not guaranteed to be stable
c120f0fa
WX
2457#
2458# @offset: #optional, if the corruption resulted from an image access, this is
0caef8f6 2459# the host's access offset into the image
c120f0fa
WX
2460#
2461# @size: #optional, if the corruption resulted from an image access, this is
2462# the access size
2463#
9bf040b9
HR
2464# fatal: if set, the image is marked corrupt and therefore unusable after this
2465# event and must be repaired (Since 2.2; before, every
2466# BLOCK_IMAGE_CORRUPTED event was fatal)
2467#
c120f0fa
WX
2468# Since: 1.7
2469##
2470{ 'event': 'BLOCK_IMAGE_CORRUPTED',
dc881b44
AG
2471 'data': { 'device' : 'str',
2472 '*node-name' : 'str',
2473 'msg' : 'str',
2474 '*offset' : 'int',
2475 '*size' : 'int',
2476 'fatal' : 'bool' } }
c120f0fa 2477
5a2d2cbd
WX
2478##
2479# @BLOCK_IO_ERROR
2480#
2481# Emitted when a disk I/O error occurs
2482#
2483# @device: device name
2484#
2485# @operation: I/O operation
2486#
2487# @action: action that has been taken
2488#
c7c2ff0c
LC
2489# @nospace: #optional true if I/O error was caused due to a no-space
2490# condition. This key is only present if query-block's
2491# io-status is present, please see query-block documentation
2492# for more information (since: 2.2)
2493#
624ff573
LC
2494# @reason: human readable string describing the error cause.
2495# (This field is a debugging aid for humans, it should not
2496# be parsed by applications) (since: 2.2)
2497#
5a2d2cbd
WX
2498# Note: If action is "stop", a STOP event will eventually follow the
2499# BLOCK_IO_ERROR event
2500#
2501# Since: 0.13.0
2502##
2503{ 'event': 'BLOCK_IO_ERROR',
2504 'data': { 'device': 'str', 'operation': 'IoOperationType',
624ff573
LC
2505 'action': 'BlockErrorAction', '*nospace': 'bool',
2506 'reason': 'str' } }
5a2d2cbd 2507
bcada37b
WX
2508##
2509# @BLOCK_JOB_COMPLETED
2510#
2511# Emitted when a block job has completed
2512#
2513# @type: job type
2514#
6aae5be6
AG
2515# @device: The job identifier. Originally the device name but other
2516# values are allowed since QEMU 2.7
bcada37b
WX
2517#
2518# @len: maximum progress value
2519#
2520# @offset: current progress value. On success this is equal to len.
2521# On failure this is less than len
2522#
2523# @speed: rate limit, bytes per second
2524#
2525# @error: #optional, error message. Only present on failure. This field
2526# contains a human-readable error message. There are no semantics
2527# other than that streaming has failed and clients should not try to
2528# interpret the error string
2529#
2530# Since: 1.1
2531##
2532{ 'event': 'BLOCK_JOB_COMPLETED',
2533 'data': { 'type' : 'BlockJobType',
2534 'device': 'str',
2535 'len' : 'int',
2536 'offset': 'int',
2537 'speed' : 'int',
2538 '*error': 'str' } }
2539
2540##
2541# @BLOCK_JOB_CANCELLED
2542#
2543# Emitted when a block job has been cancelled
2544#
2545# @type: job type
2546#
6aae5be6
AG
2547# @device: The job identifier. Originally the device name but other
2548# values are allowed since QEMU 2.7
bcada37b
WX
2549#
2550# @len: maximum progress value
2551#
2552# @offset: current progress value. On success this is equal to len.
2553# On failure this is less than len
2554#
2555# @speed: rate limit, bytes per second
2556#
2557# Since: 1.1
2558##
2559{ 'event': 'BLOCK_JOB_CANCELLED',
2560 'data': { 'type' : 'BlockJobType',
2561 'device': 'str',
2562 'len' : 'int',
2563 'offset': 'int',
2564 'speed' : 'int' } }
2565
5a2d2cbd
WX
2566##
2567# @BLOCK_JOB_ERROR
2568#
2569# Emitted when a block job encounters an error
2570#
6aae5be6
AG
2571# @device: The job identifier. Originally the device name but other
2572# values are allowed since QEMU 2.7
5a2d2cbd
WX
2573#
2574# @operation: I/O operation
2575#
2576# @action: action that has been taken
2577#
2578# Since: 1.3
2579##
2580{ 'event': 'BLOCK_JOB_ERROR',
2581 'data': { 'device' : 'str',
2582 'operation': 'IoOperationType',
823c6863 2583 'action' : 'BlockErrorAction' } }
bcada37b
WX
2584
2585##
2586# @BLOCK_JOB_READY
2587#
2588# Emitted when a block job is ready to complete
2589#
518848a2
MA
2590# @type: job type
2591#
6aae5be6
AG
2592# @device: The job identifier. Originally the device name but other
2593# values are allowed since QEMU 2.7
bcada37b 2594#
518848a2
MA
2595# @len: maximum progress value
2596#
2597# @offset: current progress value. On success this is equal to len.
2598# On failure this is less than len
2599#
2600# @speed: rate limit, bytes per second
2601#
bcada37b
WX
2602# Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
2603# event
2604#
2605# Since: 1.3
2606##
2607{ 'event': 'BLOCK_JOB_READY',
518848a2
MA
2608 'data': { 'type' : 'BlockJobType',
2609 'device': 'str',
2610 'len' : 'int',
2611 'offset': 'int',
2612 'speed' : 'int' } }
ffeaac9b
HT
2613
2614# @PreallocMode
2615#
2616# Preallocation mode of QEMU image file
2617#
2618# @off: no preallocation
2619# @metadata: preallocate only for metadata
2620# @falloc: like @full preallocation but allocate disk space by
2621# posix_fallocate() rather than writing zeros.
2622# @full: preallocate all data by writing zeros to device to ensure disk
2623# space is really available. @full preallocation also sets up
2624# metadata correctly.
2625#
2626# Since 2.2
2627##
2628{ 'enum': 'PreallocMode',
2629 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
e2462113
FR
2630
2631##
2632# @BLOCK_WRITE_THRESHOLD
2633#
2634# Emitted when writes on block device reaches or exceeds the
2635# configured write threshold. For thin-provisioned devices, this
2636# means the device should be extended to avoid pausing for
2637# disk exhaustion.
2638# The event is one shot. Once triggered, it needs to be
2639# re-registered with another block-set-threshold command.
2640#
2641# @node-name: graph node name on which the threshold was exceeded.
2642#
2643# @amount-exceeded: amount of data which exceeded the threshold, in bytes.
2644#
2645# @write-threshold: last configured threshold, in bytes.
2646#
2647# Since: 2.3
2648##
2649{ 'event': 'BLOCK_WRITE_THRESHOLD',
2650 'data': { 'node-name': 'str',
2651 'amount-exceeded': 'uint64',
2652 'write-threshold': 'uint64' } }
2653
2654##
2655# @block-set-write-threshold
2656#
2657# Change the write threshold for a block drive. An event will be delivered
2658# if a write to this block drive crosses the configured threshold.
2659# This is useful to transparently resize thin-provisioned drives without
2660# the guest OS noticing.
2661#
2662# @node-name: graph node name on which the threshold must be set.
2663#
2664# @write-threshold: configured threshold for the block device, bytes.
2665# Use 0 to disable the threshold.
2666#
e2462113
FR
2667# Since: 2.3
2668##
2669{ 'command': 'block-set-write-threshold',
2670 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
7f821597
WC
2671
2672##
2673# @x-blockdev-change
2674#
2675# Dynamically reconfigure the block driver state graph. It can be used
2676# to add, remove, insert or replace a graph node. Currently only the
2677# Quorum driver implements this feature to add or remove its child. This
2678# is useful to fix a broken quorum child.
2679#
2680# If @node is specified, it will be inserted under @parent. @child
2681# may not be specified in this case. If both @parent and @child are
2682# specified but @node is not, @child will be detached from @parent.
2683#
2684# @parent: the id or name of the parent node.
2685#
2686# @child: #optional the name of a child under the given parent node.
2687#
2688# @node: #optional the name of the node that will be added.
2689#
2690# Note: this command is experimental, and its API is not stable. It
2691# does not support all kinds of operations, all kinds of children, nor
2692# all block drivers.
2693#
2694# Warning: The data in a new quorum child MUST be consistent with that of
2695# the rest of the array.
2696#
2697# Since: 2.7
2698##
2699{ 'command': 'x-blockdev-change',
2700 'data' : { 'parent': 'str',
2701 '*child': 'str',
2702 '*node': 'str' } }
This page took 0.540069 seconds and 4 git commands to generate.