]> git.proxmox.com Git - mirror_qemu.git/blob - qapi/block-core.json
block: Accept node-name for drive-backup
[mirror_qemu.git] / qapi / block-core.json
1 # -*- Mode: Python -*-
2 #
3 # QAPI block core definitions (vm unrelated)
4
5 # QAPI common definitions
6 { 'include': 'common.json' }
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
29 { 'struct': 'SnapshotInfo',
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 #
41 # @corrupt: #optional true if the image has been marked corrupt; only valid for
42 # compat >= 1.1 (since 2.2)
43 #
44 # @refcount-bits: width of a refcount entry in bits (since 2.3)
45 #
46 # Since: 1.7
47 ##
48 { 'struct': 'ImageInfoSpecificQCow2',
49 'data': {
50 'compat': 'str',
51 '*lazy-refcounts': 'bool',
52 '*corrupt': 'bool',
53 'refcount-bits': 'int'
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 ##
69 { 'struct': 'ImageInfoSpecificVmdk',
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',
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'
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
133 { 'struct': 'ImageInfo',
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',
140 '*format-specific': 'ImageInfoSpecific' } }
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
185 { 'struct': 'ImageCheck',
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
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
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 ##
230 { 'struct': 'BlockdevCacheInfo',
231 'data': { 'writeback': 'bool',
232 'direct': 'bool',
233 'no-flush': 'bool' } }
234
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',
249 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
250 # 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
251 # 2.2: 'archipelago' added, 'cow' dropped
252 # 2.3: 'host_floppy' deprecated
253 # 2.5: 'host_floppy' dropped
254 # 2.6: 'luks' added
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 #
281 # @bps_max: #optional total throughput limit during bursts,
282 # in bytes (Since 1.7)
283 #
284 # @bps_rd_max: #optional read throughput limit during bursts,
285 # in bytes (Since 1.7)
286 #
287 # @bps_wr_max: #optional write throughput limit during bursts,
288 # in bytes (Since 1.7)
289 #
290 # @iops_max: #optional total I/O operations per second during bursts,
291 # in bytes (Since 1.7)
292 #
293 # @iops_rd_max: #optional read I/O operations per second during bursts,
294 # in bytes (Since 1.7)
295 #
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)
316 #
317 # @iops_size: #optional an I/O size in bytes (Since 1.7)
318 #
319 # @group: #optional throttle group name (Since 2.4)
320 #
321 # @cache: the cache mode used for the block device (since: 2.3)
322 #
323 # @write_threshold: configured write threshold for the device.
324 # 0 if disabled. (Since 2.3)
325 #
326 # Since: 0.14.0
327 #
328 ##
329 { 'struct': 'BlockDeviceInfo',
330 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
331 '*backing_file': 'str', 'backing_file_depth': 'int',
332 'encrypted': 'bool', 'encryption_key_missing': 'bool',
333 'detect_zeroes': 'BlockdevDetectZeroesOptions',
334 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
335 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
336 'image': 'ImageInfo',
337 '*bps_max': 'int', '*bps_rd_max': 'int',
338 '*bps_wr_max': 'int', '*iops_max': 'int',
339 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
340 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
341 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
342 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
343 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
344 'write_threshold': 'int' } }
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 ##
386 { 'struct': 'BlockDeviceMapEntry',
387 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
388 'data': 'bool', '*offset': 'int' } }
389
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
409 ##
410 # @BlockDirtyInfo:
411 #
412 # Block dirty bitmap information.
413 #
414 # @name: #optional the name of the dirty bitmap (Since 2.4)
415 #
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 #
420 # @status: current status of the dirty bitmap (since 2.4)
421 #
422 # Since: 1.3
423 ##
424 { 'struct': 'BlockDirtyInfo',
425 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
426 'status': 'DirtyBitmapStatus'} }
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 #
444 # @tray_open: #optional True if the device's tray is open
445 # (only present if it has a tray)
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
452 # (supported device models: virtio-blk, ide, scsi-disk)
453 #
454 # @inserted: #optional @BlockDeviceInfo describing the device if media is
455 # present
456 #
457 # Since: 0.14.0
458 ##
459 { 'struct': 'BlockInfo',
460 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
461 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
462 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
463 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
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
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 #
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 #
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',
526 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
527 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
528
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 #
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 #
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 #
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 #
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 #
591 # @timed_stats: Statistics specific to the set of previously defined
592 # intervals of time (Since 2.5)
593 #
594 # Since: 0.14.0
595 ##
596 { 'struct': 'BlockDeviceStats',
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',
600 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
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',
604 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
605 'account_invalid': 'bool', 'account_failed': 'bool',
606 'timed_stats': ['BlockDeviceTimedStats'] } }
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 #
616 # @node-name: #optional The node name of the device. (Since 2.3)
617 #
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 ##
627 { 'struct': 'BlockStats',
628 'data': {'*device': 'str', '*node-name': 'str',
629 'stats': 'BlockDeviceStats',
630 '*parent': 'BlockStats',
631 '*backing': 'BlockStats'} }
632
633 ##
634 # @query-blockstats:
635 #
636 # Query the @BlockStats for all virtual block devices.
637 #
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 #
645 # Returns: A list of @BlockStats for each virtual block devices.
646 #
647 # Since: 0.14.0
648 ##
649 { 'command': 'query-blockstats',
650 'data': { '*query-nodes': 'bool' },
651 'returns': ['BlockStats'] }
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 #
671 # @auto: inherit the error handling policy of the backend (since: 2.7)
672 #
673 # Since: 1.3
674 ##
675 { 'enum': 'BlockdevOnError',
676 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
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 #
690 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
691 #
692 # Since: 1.3
693 ##
694 { 'enum': 'MirrorSyncMode',
695 'data': ['top', 'full', 'none', 'incremental'] }
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 #
722 # @device: The job identifier. Originally the device name but other
723 # values are allowed since QEMU 2.7
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 #
739 # @ready: true if the job may be completed (since 2.2)
740 #
741 # Since: 1.1
742 ##
743 { 'struct': 'BlockJobInfo',
744 'data': {'type': 'str', 'device': 'str', 'len': 'int',
745 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
746 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool'} }
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 ##
836 # @BlockdevSnapshotSync
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 ##
853 { 'struct': 'BlockdevSnapshotSync',
854 'data': { '*device': 'str', '*node-name': 'str',
855 'snapshot-file': 'str', '*snapshot-node-name': 'str',
856 '*format': 'str', '*mode': 'NewImageMode' } }
857
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
873 ##
874 # @DriveBackup
875 #
876 # @job-id: #optional identifier for the newly-created block job. If
877 # omitted, the device name will be used. (Since 2.7)
878 #
879 # @device: the device name or node-name of a root node which should be copied.
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
889 # (all the disk, only the sectors allocated in the topmost image, from a
890 # dirty bitmap, or only new I/O).
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 #
897 # @bitmap: #optional the name of dirty bitmap if sync is "incremental".
898 # Must be present if sync is "incremental", must NOT be present
899 # otherwise. (Since 2.4)
900 #
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 ##
915 { 'struct': 'DriveBackup',
916 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
917 '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
918 '*speed': 'int', '*bitmap': 'str',
919 '*on-source-error': 'BlockdevOnError',
920 '*on-target-error': 'BlockdevOnError' } }
921
922 ##
923 # @BlockdevBackup
924 #
925 # @job-id: #optional identifier for the newly-created block job. If
926 # omitted, the device name will be used. (Since 2.7)
927 #
928 # @device: the device name or node-name of a root node which should be copied.
929 #
930 # @target: the device name or node-name of the backup target node.
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 ##
953 { 'struct': 'BlockdevBackup',
954 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
955 'sync': 'MirrorSyncMode',
956 '*speed': 'int',
957 '*on-source-error': 'BlockdevOnError',
958 '*on-target-error': 'BlockdevOnError' } }
959
960 ##
961 # @blockdev-snapshot-sync
962 #
963 # Generates a synchronous snapshot of a block device.
964 #
965 # For the arguments, see the documentation of BlockdevSnapshotSync.
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',
973 'data': 'BlockdevSnapshotSync' }
974
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
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 #
1001 # @device: The device name or node-name of the root node that owns
1002 # image-node-name.
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
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 #
1021 # @job-id: #optional identifier for the newly-created block job. If
1022 # omitted, the device name will be used. (Since 2.7)
1023 #
1024 # @device: the device name or node-name of a root node
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 #
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.
1032 #
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 #
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 #
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',
1075 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
1076 '*backing-file': 'str', '*speed': 'int' } }
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
1090 # If @device is not a valid block device, GenericError
1091 #
1092 # Since 1.6
1093 ##
1094 { 'command': 'drive-backup', 'data': 'DriveBackup' }
1095
1096 ##
1097 # @blockdev-backup
1098 #
1099 # Start a point-in-time copy of a block device to a new destination. The
1100 # status of ongoing blockdev-backup operations can be checked with
1101 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1102 # The operation can be stopped before it has completed using the
1103 # block-job-cancel command.
1104 #
1105 # For the arguments, see the documentation of BlockdevBackup.
1106 #
1107 # Since 2.3
1108 ##
1109 { 'command': 'blockdev-backup', 'data': 'BlockdevBackup' }
1110
1111
1112 ##
1113 # @query-named-block-nodes
1114 #
1115 # Get the named block driver list
1116 #
1117 # Returns: the list of BlockDeviceInfo
1118 #
1119 # Since 2.0
1120 ##
1121 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1122
1123 ##
1124 # @drive-mirror
1125 #
1126 # Start mirroring a block device's writes to a new destination.
1127 #
1128 # See DriveMirror for parameter descriptions
1129 #
1130 # Returns: nothing on success
1131 # If @device is not a valid block device, DeviceNotFound
1132 #
1133 # Since 1.3
1134 ##
1135 { 'command': 'drive-mirror', 'boxed': true,
1136 'data': 'DriveMirror' }
1137
1138 ##
1139 # DriveMirror
1140 #
1141 # A set of parameters describing drive mirror setup.
1142 #
1143 # @job-id: #optional identifier for the newly-created block job. If
1144 # omitted, the device name will be used. (Since 2.7)
1145 #
1146 # @device: the name of the device whose writes should be mirrored.
1147 #
1148 # @target: the target of the new image. If the file exists, or if it
1149 # is a device, the existing file/device will be used as the new
1150 # destination. If it does not exist, a new file will be created.
1151 #
1152 # @format: #optional the format of the new destination, default is to
1153 # probe if @mode is 'existing', else the format of the source
1154 #
1155 # @node-name: #optional the new block driver state node name in the graph
1156 # (Since 2.1)
1157 #
1158 # @replaces: #optional with sync=full graph node name to be replaced by the new
1159 # image when a whole image copy is done. This can be used to repair
1160 # broken Quorum files. (Since 2.1)
1161 #
1162 # @mode: #optional whether and how QEMU should create a new image, default is
1163 # 'absolute-paths'.
1164 #
1165 # @speed: #optional the maximum speed, in bytes per second
1166 #
1167 # @sync: what parts of the disk image should be copied to the destination
1168 # (all the disk, only the sectors allocated in the topmost image, or
1169 # only new I/O).
1170 #
1171 # @granularity: #optional granularity of the dirty bitmap, default is 64K
1172 # if the image format doesn't have clusters, 4K if the clusters
1173 # are smaller than that, else the cluster size. Must be a
1174 # power of 2 between 512 and 64M (since 1.4).
1175 #
1176 # @buf-size: #optional maximum amount of data in flight from source to
1177 # target (since 1.4).
1178 #
1179 # @on-source-error: #optional the action to take on an error on the source,
1180 # default 'report'. 'stop' and 'enospc' can only be used
1181 # if the block device supports io-status (see BlockInfo).
1182 #
1183 # @on-target-error: #optional the action to take on an error on the target,
1184 # default 'report' (no limitations, since this applies to
1185 # a different block device than @device).
1186 # @unmap: #optional Whether to try to unmap target sectors where source has
1187 # only zero. If true, and target unallocated sectors will read as zero,
1188 # target image sectors will be unmapped; otherwise, zeroes will be
1189 # written. Both will result in identical contents.
1190 # Default is true. (Since 2.4)
1191 #
1192 # Since 1.3
1193 ##
1194 { 'struct': 'DriveMirror',
1195 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1196 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1197 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1198 '*speed': 'int', '*granularity': 'uint32',
1199 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1200 '*on-target-error': 'BlockdevOnError',
1201 '*unmap': 'bool' } }
1202
1203 ##
1204 # @BlockDirtyBitmap
1205 #
1206 # @node: name of device/node which the bitmap is tracking
1207 #
1208 # @name: name of the dirty bitmap
1209 #
1210 # Since 2.4
1211 ##
1212 { 'struct': 'BlockDirtyBitmap',
1213 'data': { 'node': 'str', 'name': 'str' } }
1214
1215 ##
1216 # @BlockDirtyBitmapAdd
1217 #
1218 # @node: name of device/node which the bitmap is tracking
1219 #
1220 # @name: name of the dirty bitmap
1221 #
1222 # @granularity: #optional the bitmap granularity, default is 64k for
1223 # block-dirty-bitmap-add
1224 #
1225 # Since 2.4
1226 ##
1227 { 'struct': 'BlockDirtyBitmapAdd',
1228 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32' } }
1229
1230 ##
1231 # @block-dirty-bitmap-add
1232 #
1233 # Create a dirty bitmap with a name on the node
1234 #
1235 # Returns: nothing on success
1236 # If @node is not a valid block device or node, DeviceNotFound
1237 # If @name is already taken, GenericError with an explanation
1238 #
1239 # Since 2.4
1240 ##
1241 { 'command': 'block-dirty-bitmap-add',
1242 'data': 'BlockDirtyBitmapAdd' }
1243
1244 ##
1245 # @block-dirty-bitmap-remove
1246 #
1247 # Remove a dirty bitmap on the node
1248 #
1249 # Returns: nothing on success
1250 # If @node is not a valid block device or node, DeviceNotFound
1251 # If @name is not found, GenericError with an explanation
1252 # if @name is frozen by an operation, GenericError
1253 #
1254 # Since 2.4
1255 ##
1256 { 'command': 'block-dirty-bitmap-remove',
1257 'data': 'BlockDirtyBitmap' }
1258
1259 ##
1260 # @block-dirty-bitmap-clear
1261 #
1262 # Clear (reset) a dirty bitmap on the device
1263 #
1264 # Returns: nothing on success
1265 # If @node is not a valid block device, DeviceNotFound
1266 # If @name is not found, GenericError with an explanation
1267 #
1268 # Since 2.4
1269 ##
1270 { 'command': 'block-dirty-bitmap-clear',
1271 'data': 'BlockDirtyBitmap' }
1272
1273 ##
1274 # @blockdev-mirror
1275 #
1276 # Start mirroring a block device's writes to a new destination.
1277 #
1278 # @job-id: #optional identifier for the newly-created block job. If
1279 # omitted, the device name will be used. (Since 2.7)
1280 #
1281 # @device: The device name or node-name of a root node whose writes should be
1282 # mirrored.
1283 #
1284 # @target: the id or node-name of the block device to mirror to. This mustn't be
1285 # attached to guest.
1286 #
1287 # @replaces: #optional with sync=full graph node name to be replaced by the new
1288 # image when a whole image copy is done. This can be used to repair
1289 # broken Quorum files.
1290 #
1291 # @speed: #optional the maximum speed, in bytes per second
1292 #
1293 # @sync: what parts of the disk image should be copied to the destination
1294 # (all the disk, only the sectors allocated in the topmost image, or
1295 # only new I/O).
1296 #
1297 # @granularity: #optional granularity of the dirty bitmap, default is 64K
1298 # if the image format doesn't have clusters, 4K if the clusters
1299 # are smaller than that, else the cluster size. Must be a
1300 # power of 2 between 512 and 64M
1301 #
1302 # @buf-size: #optional maximum amount of data in flight from source to
1303 # target
1304 #
1305 # @on-source-error: #optional the action to take on an error on the source,
1306 # default 'report'. 'stop' and 'enospc' can only be used
1307 # if the block device supports io-status (see BlockInfo).
1308 #
1309 # @on-target-error: #optional the action to take on an error on the target,
1310 # default 'report' (no limitations, since this applies to
1311 # a different block device than @device).
1312 #
1313 # Returns: nothing on success.
1314 #
1315 # Since 2.6
1316 ##
1317 { 'command': 'blockdev-mirror',
1318 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1319 '*replaces': 'str',
1320 'sync': 'MirrorSyncMode',
1321 '*speed': 'int', '*granularity': 'uint32',
1322 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1323 '*on-target-error': 'BlockdevOnError' } }
1324
1325 ##
1326 # @block_set_io_throttle:
1327 #
1328 # Change I/O throttle limits for a block drive.
1329 #
1330 # Since QEMU 2.4, each device with I/O limits is member of a throttle
1331 # group.
1332 #
1333 # If two or more devices are members of the same group, the limits
1334 # will apply to the combined I/O of the whole group in a round-robin
1335 # fashion. Therefore, setting new I/O limits to a device will affect
1336 # the whole group.
1337 #
1338 # The name of the group can be specified using the 'group' parameter.
1339 # If the parameter is unset, it is assumed to be the current group of
1340 # that device. If it's not in any group yet, the name of the device
1341 # will be used as the name for its group.
1342 #
1343 # The 'group' parameter can also be used to move a device to a
1344 # different group. In this case the limits specified in the parameters
1345 # will be applied to the new group only.
1346 #
1347 # I/O limits can be disabled by setting all of them to 0. In this case
1348 # the device will be removed from its group and the rest of its
1349 # members will not be affected. The 'group' parameter is ignored.
1350 #
1351 # See BlockIOThrottle for parameter descriptions.
1352 #
1353 # Returns: Nothing on success
1354 # If @device is not a valid block device, DeviceNotFound
1355 #
1356 # Since: 1.1
1357 ##
1358 { 'command': 'block_set_io_throttle', 'boxed': true,
1359 'data': 'BlockIOThrottle' }
1360
1361 ##
1362 # BlockIOThrottle
1363 #
1364 # A set of parameters describing block throttling.
1365 #
1366 # @device: The name of the device
1367 #
1368 # @bps: total throughput limit in bytes per second
1369 #
1370 # @bps_rd: read throughput limit in bytes per second
1371 #
1372 # @bps_wr: write throughput limit in bytes per second
1373 #
1374 # @iops: total I/O operations per second
1375 #
1376 # @iops_rd: read I/O operations per second
1377 #
1378 # @iops_wr: write I/O operations per second
1379 #
1380 # @bps_max: #optional total throughput limit during bursts,
1381 # in bytes (Since 1.7)
1382 #
1383 # @bps_rd_max: #optional read throughput limit during bursts,
1384 # in bytes (Since 1.7)
1385 #
1386 # @bps_wr_max: #optional write throughput limit during bursts,
1387 # in bytes (Since 1.7)
1388 #
1389 # @iops_max: #optional total I/O operations per second during bursts,
1390 # in bytes (Since 1.7)
1391 #
1392 # @iops_rd_max: #optional read I/O operations per second during bursts,
1393 # in bytes (Since 1.7)
1394 #
1395 # @iops_wr_max: #optional write I/O operations per second during bursts,
1396 # in bytes (Since 1.7)
1397 #
1398 # @bps_max_length: #optional maximum length of the @bps_max burst
1399 # period, in seconds. It must only
1400 # be set if @bps_max is set as well.
1401 # Defaults to 1. (Since 2.6)
1402 #
1403 # @bps_rd_max_length: #optional maximum length of the @bps_rd_max
1404 # burst period, in seconds. It must only
1405 # be set if @bps_rd_max is set as well.
1406 # Defaults to 1. (Since 2.6)
1407 #
1408 # @bps_wr_max_length: #optional maximum length of the @bps_wr_max
1409 # burst period, in seconds. It must only
1410 # be set if @bps_wr_max is set as well.
1411 # Defaults to 1. (Since 2.6)
1412 #
1413 # @iops_max_length: #optional maximum length of the @iops burst
1414 # period, in seconds. It must only
1415 # be set if @iops_max is set as well.
1416 # Defaults to 1. (Since 2.6)
1417 #
1418 # @iops_rd_max_length: #optional maximum length of the @iops_rd_max
1419 # burst period, in seconds. It must only
1420 # be set if @iops_rd_max is set as well.
1421 # Defaults to 1. (Since 2.6)
1422 #
1423 # @iops_wr_max_length: #optional maximum length of the @iops_wr_max
1424 # burst period, in seconds. It must only
1425 # be set if @iops_wr_max is set as well.
1426 # Defaults to 1. (Since 2.6)
1427 #
1428 # @iops_size: #optional an I/O size in bytes (Since 1.7)
1429 #
1430 # @group: #optional throttle group name (Since 2.4)
1431 #
1432 # Since: 1.1
1433 ##
1434 { 'struct': 'BlockIOThrottle',
1435 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
1436 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
1437 '*bps_max': 'int', '*bps_rd_max': 'int',
1438 '*bps_wr_max': 'int', '*iops_max': 'int',
1439 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
1440 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
1441 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
1442 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
1443 '*iops_size': 'int', '*group': 'str' } }
1444
1445 ##
1446 # @block-stream:
1447 #
1448 # Copy data from a backing file into a block device.
1449 #
1450 # The block streaming operation is performed in the background until the entire
1451 # backing file has been copied. This command returns immediately once streaming
1452 # has started. The status of ongoing block streaming operations can be checked
1453 # with query-block-jobs. The operation can be stopped before it has completed
1454 # using the block-job-cancel command.
1455 #
1456 # If a base file is specified then sectors are not copied from that base file and
1457 # its backing chain. When streaming completes the image file will have the base
1458 # file as its backing file. This can be used to stream a subset of the backing
1459 # file chain instead of flattening the entire image.
1460 #
1461 # On successful completion the image file is updated to drop the backing file
1462 # and the BLOCK_JOB_COMPLETED event is emitted.
1463 #
1464 # @job-id: #optional identifier for the newly-created block job. If
1465 # omitted, the device name will be used. (Since 2.7)
1466 #
1467 # @device: the device name or node-name of a root node
1468 #
1469 # @base: #optional the common backing file name
1470 #
1471 # @backing-file: #optional The backing file string to write into the active
1472 # layer. This filename is not validated.
1473 #
1474 # If a pathname string is such that it cannot be
1475 # resolved by QEMU, that means that subsequent QMP or
1476 # HMP commands must use node-names for the image in
1477 # question, as filename lookup methods will fail.
1478 #
1479 # If not specified, QEMU will automatically determine
1480 # the backing file string to use, or error out if there
1481 # is no obvious choice. Care should be taken when
1482 # specifying the string, to specify a valid filename or
1483 # protocol.
1484 # (Since 2.1)
1485 #
1486 # @speed: #optional the maximum speed, in bytes per second
1487 #
1488 # @on-error: #optional the action to take on an error (default report).
1489 # 'stop' and 'enospc' can only be used if the block device
1490 # supports io-status (see BlockInfo). Since 1.3.
1491 #
1492 # Since: 1.1
1493 ##
1494 { 'command': 'block-stream',
1495 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
1496 '*backing-file': 'str', '*speed': 'int',
1497 '*on-error': 'BlockdevOnError' } }
1498
1499 ##
1500 # @block-job-set-speed:
1501 #
1502 # Set maximum speed for a background block operation.
1503 #
1504 # This command can only be issued when there is an active block job.
1505 #
1506 # Throttling can be disabled by setting the speed to 0.
1507 #
1508 # @device: The job identifier. This used to be a device name (hence
1509 # the name of the parameter), but since QEMU 2.7 it can have
1510 # other values.
1511 #
1512 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
1513 # Defaults to 0.
1514 #
1515 # Returns: Nothing on success
1516 # If no background operation is active on this device, DeviceNotActive
1517 #
1518 # Since: 1.1
1519 ##
1520 { 'command': 'block-job-set-speed',
1521 'data': { 'device': 'str', 'speed': 'int' } }
1522
1523 ##
1524 # @block-job-cancel:
1525 #
1526 # Stop an active background block operation.
1527 #
1528 # This command returns immediately after marking the active background block
1529 # operation for cancellation. It is an error to call this command if no
1530 # operation is in progress.
1531 #
1532 # The operation will cancel as soon as possible and then emit the
1533 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
1534 # enumerated using query-block-jobs.
1535 #
1536 # For streaming, the image file retains its backing file unless the streaming
1537 # operation happens to complete just as it is being cancelled. A new streaming
1538 # operation can be started at a later time to finish copying all data from the
1539 # backing file.
1540 #
1541 # @device: The job identifier. This used to be a device name (hence
1542 # the name of the parameter), but since QEMU 2.7 it can have
1543 # other values.
1544 #
1545 # @force: #optional whether to allow cancellation of a paused job (default
1546 # false). Since 1.3.
1547 #
1548 # Returns: Nothing on success
1549 # If no background operation is active on this device, DeviceNotActive
1550 #
1551 # Since: 1.1
1552 ##
1553 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
1554
1555 ##
1556 # @block-job-pause:
1557 #
1558 # Pause an active background block operation.
1559 #
1560 # This command returns immediately after marking the active background block
1561 # operation for pausing. It is an error to call this command if no
1562 # operation is in progress. Pausing an already paused job has no cumulative
1563 # effect; a single block-job-resume command will resume the job.
1564 #
1565 # The operation will pause as soon as possible. No event is emitted when
1566 # the operation is actually paused. Cancelling a paused job automatically
1567 # resumes it.
1568 #
1569 # @device: The job identifier. This used to be a device name (hence
1570 # the name of the parameter), but since QEMU 2.7 it can have
1571 # other values.
1572 #
1573 # Returns: Nothing on success
1574 # If no background operation is active on this device, DeviceNotActive
1575 #
1576 # Since: 1.3
1577 ##
1578 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
1579
1580 ##
1581 # @block-job-resume:
1582 #
1583 # Resume an active background block operation.
1584 #
1585 # This command returns immediately after resuming a paused background block
1586 # operation. It is an error to call this command if no operation is in
1587 # progress. Resuming an already running job is not an error.
1588 #
1589 # This command also clears the error status of the job.
1590 #
1591 # @device: The job identifier. This used to be a device name (hence
1592 # the name of the parameter), but since QEMU 2.7 it can have
1593 # other values.
1594 #
1595 # Returns: Nothing on success
1596 # If no background operation is active on this device, DeviceNotActive
1597 #
1598 # Since: 1.3
1599 ##
1600 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
1601
1602 ##
1603 # @block-job-complete:
1604 #
1605 # Manually trigger completion of an active background block operation. This
1606 # is supported for drive mirroring, where it also switches the device to
1607 # write to the target path only. The ability to complete is signaled with
1608 # a BLOCK_JOB_READY event.
1609 #
1610 # This command completes an active background block operation synchronously.
1611 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
1612 # is not defined. Note that if an I/O error occurs during the processing of
1613 # this command: 1) the command itself will fail; 2) the error will be processed
1614 # according to the rerror/werror arguments that were specified when starting
1615 # the operation.
1616 #
1617 # A cancelled or paused job cannot be completed.
1618 #
1619 # @device: The job identifier. This used to be a device name (hence
1620 # the name of the parameter), but since QEMU 2.7 it can have
1621 # other values.
1622 #
1623 # Returns: Nothing on success
1624 # If no background operation is active on this device, DeviceNotActive
1625 #
1626 # Since: 1.3
1627 ##
1628 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
1629
1630 ##
1631 # @BlockdevDiscardOptions
1632 #
1633 # Determines how to handle discard requests.
1634 #
1635 # @ignore: Ignore the request
1636 # @unmap: Forward as an unmap request
1637 #
1638 # Since: 1.7
1639 ##
1640 { 'enum': 'BlockdevDiscardOptions',
1641 'data': [ 'ignore', 'unmap' ] }
1642
1643 ##
1644 # @BlockdevDetectZeroesOptions
1645 #
1646 # Describes the operation mode for the automatic conversion of plain
1647 # zero writes by the OS to driver specific optimized zero write commands.
1648 #
1649 # @off: Disabled (default)
1650 # @on: Enabled
1651 # @unmap: Enabled and even try to unmap blocks if possible. This requires
1652 # also that @BlockdevDiscardOptions is set to unmap for this device.
1653 #
1654 # Since: 2.1
1655 ##
1656 { 'enum': 'BlockdevDetectZeroesOptions',
1657 'data': [ 'off', 'on', 'unmap' ] }
1658
1659 ##
1660 # @BlockdevAioOptions
1661 #
1662 # Selects the AIO backend to handle I/O requests
1663 #
1664 # @threads: Use qemu's thread pool
1665 # @native: Use native AIO backend (only Linux and Windows)
1666 #
1667 # Since: 1.7
1668 ##
1669 { 'enum': 'BlockdevAioOptions',
1670 'data': [ 'threads', 'native' ] }
1671
1672 ##
1673 # @BlockdevCacheOptions
1674 #
1675 # Includes cache-related options for block devices
1676 #
1677 # @direct: #optional enables use of O_DIRECT (bypass the host page cache;
1678 # default: false)
1679 # @no-flush: #optional ignore any flush requests for the device (default:
1680 # false)
1681 #
1682 # Since: 1.7
1683 ##
1684 { 'struct': 'BlockdevCacheOptions',
1685 'data': { '*direct': 'bool',
1686 '*no-flush': 'bool' } }
1687
1688 ##
1689 # @BlockdevDriver
1690 #
1691 # Drivers that are supported in block device operations.
1692 #
1693 # @host_device, @host_cdrom: Since 2.1
1694 # @gluster: Since 2.7
1695 #
1696 # Since: 2.0
1697 ##
1698 { 'enum': 'BlockdevDriver',
1699 'data': [ 'archipelago', 'blkdebug', 'blkverify', 'bochs', 'cloop',
1700 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
1701 'host_device', 'http', 'https', 'luks', 'null-aio', 'null-co',
1702 'parallels', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'tftp',
1703 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
1704
1705 ##
1706 # @BlockdevOptionsFile
1707 #
1708 # Driver specific block device options for the file backend and similar
1709 # protocols.
1710 #
1711 # @filename: path to the image file
1712 #
1713 # Since: 1.7
1714 ##
1715 { 'struct': 'BlockdevOptionsFile',
1716 'data': { 'filename': 'str' } }
1717
1718 ##
1719 # @BlockdevOptionsNull
1720 #
1721 # Driver specific block device options for the null backend.
1722 #
1723 # @size: #optional size of the device in bytes.
1724 # @latency-ns: #optional emulated latency (in nanoseconds) in processing
1725 # requests. Default to zero which completes requests immediately.
1726 # (Since 2.4)
1727 #
1728 # Since: 2.2
1729 ##
1730 { 'struct': 'BlockdevOptionsNull',
1731 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
1732
1733 ##
1734 # @BlockdevOptionsVVFAT
1735 #
1736 # Driver specific block device options for the vvfat protocol.
1737 #
1738 # @dir: directory to be exported as FAT image
1739 # @fat-type: #optional FAT type: 12, 16 or 32
1740 # @floppy: #optional whether to export a floppy image (true) or
1741 # partitioned hard disk (false; default)
1742 # @label: #optional set the volume label, limited to 11 bytes. FAT16 and
1743 # FAT32 traditionally have some restrictions on labels, which are
1744 # ignored by most operating systems. Defaults to "QEMU VVFAT".
1745 # (since 2.4)
1746 # @rw: #optional whether to allow write operations (default: false)
1747 #
1748 # Since: 1.7
1749 ##
1750 { 'struct': 'BlockdevOptionsVVFAT',
1751 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
1752 '*label': 'str', '*rw': 'bool' } }
1753
1754 ##
1755 # @BlockdevOptionsGenericFormat
1756 #
1757 # Driver specific block device options for image format that have no option
1758 # besides their data source.
1759 #
1760 # @file: reference to or definition of the data source block device
1761 #
1762 # Since: 1.7
1763 ##
1764 { 'struct': 'BlockdevOptionsGenericFormat',
1765 'data': { 'file': 'BlockdevRef' } }
1766
1767 ##
1768 # @BlockdevOptionsLUKS
1769 #
1770 # Driver specific block device options for LUKS.
1771 #
1772 # @key-secret: #optional the ID of a QCryptoSecret object providing
1773 # the decryption key (since 2.6). Mandatory except when
1774 # doing a metadata-only probe of the image.
1775 #
1776 # Since: 2.6
1777 ##
1778 { 'struct': 'BlockdevOptionsLUKS',
1779 'base': 'BlockdevOptionsGenericFormat',
1780 'data': { '*key-secret': 'str' } }
1781
1782
1783 ##
1784 # @BlockdevOptionsGenericCOWFormat
1785 #
1786 # Driver specific block device options for image format that have no option
1787 # besides their data source and an optional backing file.
1788 #
1789 # @backing: #optional reference to or definition of the backing file block
1790 # device (if missing, taken from the image file content). It is
1791 # allowed to pass an empty string here in order to disable the
1792 # default backing file.
1793 #
1794 # Since: 1.7
1795 ##
1796 { 'struct': 'BlockdevOptionsGenericCOWFormat',
1797 'base': 'BlockdevOptionsGenericFormat',
1798 'data': { '*backing': 'BlockdevRef' } }
1799
1800 ##
1801 # @Qcow2OverlapCheckMode
1802 #
1803 # General overlap check modes.
1804 #
1805 # @none: Do not perform any checks
1806 #
1807 # @constant: Perform only checks which can be done in constant time and
1808 # without reading anything from disk
1809 #
1810 # @cached: Perform only checks which can be done without reading anything
1811 # from disk
1812 #
1813 # @all: Perform all available overlap checks
1814 #
1815 # Since: 2.2
1816 ##
1817 { 'enum': 'Qcow2OverlapCheckMode',
1818 'data': [ 'none', 'constant', 'cached', 'all' ] }
1819
1820 ##
1821 # @Qcow2OverlapCheckFlags
1822 #
1823 # Structure of flags for each metadata structure. Setting a field to 'true'
1824 # makes qemu guard that structure against unintended overwriting. The default
1825 # value is chosen according to the template given.
1826 #
1827 # @template: Specifies a template mode which can be adjusted using the other
1828 # flags, defaults to 'cached'
1829 #
1830 # Since: 2.2
1831 ##
1832 { 'struct': 'Qcow2OverlapCheckFlags',
1833 'data': { '*template': 'Qcow2OverlapCheckMode',
1834 '*main-header': 'bool',
1835 '*active-l1': 'bool',
1836 '*active-l2': 'bool',
1837 '*refcount-table': 'bool',
1838 '*refcount-block': 'bool',
1839 '*snapshot-table': 'bool',
1840 '*inactive-l1': 'bool',
1841 '*inactive-l2': 'bool' } }
1842
1843 ##
1844 # @Qcow2OverlapChecks
1845 #
1846 # Specifies which metadata structures should be guarded against unintended
1847 # overwriting.
1848 #
1849 # @flags: set of flags for separate specification of each metadata structure
1850 # type
1851 #
1852 # @mode: named mode which chooses a specific set of flags
1853 #
1854 # Since: 2.2
1855 ##
1856 { 'alternate': 'Qcow2OverlapChecks',
1857 'data': { 'flags': 'Qcow2OverlapCheckFlags',
1858 'mode': 'Qcow2OverlapCheckMode' } }
1859
1860 ##
1861 # @BlockdevOptionsQcow2
1862 #
1863 # Driver specific block device options for qcow2.
1864 #
1865 # @lazy-refcounts: #optional whether to enable the lazy refcounts
1866 # feature (default is taken from the image file)
1867 #
1868 # @pass-discard-request: #optional whether discard requests to the qcow2
1869 # device should be forwarded to the data source
1870 #
1871 # @pass-discard-snapshot: #optional whether discard requests for the data source
1872 # should be issued when a snapshot operation (e.g.
1873 # deleting a snapshot) frees clusters in the qcow2 file
1874 #
1875 # @pass-discard-other: #optional whether discard requests for the data source
1876 # should be issued on other occasions where a cluster
1877 # gets freed
1878 #
1879 # @overlap-check: #optional which overlap checks to perform for writes
1880 # to the image, defaults to 'cached' (since 2.2)
1881 #
1882 # @cache-size: #optional the maximum total size of the L2 table and
1883 # refcount block caches in bytes (since 2.2)
1884 #
1885 # @l2-cache-size: #optional the maximum size of the L2 table cache in
1886 # bytes (since 2.2)
1887 #
1888 # @refcount-cache-size: #optional the maximum size of the refcount block cache
1889 # in bytes (since 2.2)
1890 #
1891 # @cache-clean-interval: #optional clean unused entries in the L2 and refcount
1892 # caches. The interval is in seconds. The default value
1893 # is 0 and it disables this feature (since 2.5)
1894 #
1895 # Since: 1.7
1896 ##
1897 { 'struct': 'BlockdevOptionsQcow2',
1898 'base': 'BlockdevOptionsGenericCOWFormat',
1899 'data': { '*lazy-refcounts': 'bool',
1900 '*pass-discard-request': 'bool',
1901 '*pass-discard-snapshot': 'bool',
1902 '*pass-discard-other': 'bool',
1903 '*overlap-check': 'Qcow2OverlapChecks',
1904 '*cache-size': 'int',
1905 '*l2-cache-size': 'int',
1906 '*refcount-cache-size': 'int',
1907 '*cache-clean-interval': 'int' } }
1908
1909
1910 ##
1911 # @BlockdevOptionsArchipelago
1912 #
1913 # Driver specific block device options for Archipelago.
1914 #
1915 # @volume: Name of the Archipelago volume image
1916 #
1917 # @mport: #optional The port number on which mapperd is
1918 # listening. This is optional
1919 # and if not specified, QEMU will make Archipelago
1920 # use the default port (1001).
1921 #
1922 # @vport: #optional The port number on which vlmcd is
1923 # listening. This is optional
1924 # and if not specified, QEMU will make Archipelago
1925 # use the default port (501).
1926 #
1927 # @segment: #optional The name of the shared memory segment
1928 # Archipelago stack is using. This is optional
1929 # and if not specified, QEMU will make Archipelago
1930 # use the default value, 'archipelago'.
1931 # Since: 2.2
1932 ##
1933 { 'struct': 'BlockdevOptionsArchipelago',
1934 'data': { 'volume': 'str',
1935 '*mport': 'int',
1936 '*vport': 'int',
1937 '*segment': 'str' } }
1938
1939
1940 ##
1941 # @BlkdebugEvent
1942 #
1943 # Trigger events supported by blkdebug.
1944 #
1945 # Since: 2.0
1946 ##
1947 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
1948 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
1949 'l1_grow_activate_table', 'l2_load', 'l2_update',
1950 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
1951 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
1952 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
1953 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
1954 'refblock_load', 'refblock_update', 'refblock_update_part',
1955 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
1956 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
1957 'refblock_alloc_switch_table', 'cluster_alloc',
1958 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
1959 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
1960 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
1961 'pwritev_zero', 'pwritev_done', 'empty_image_prepare' ] }
1962
1963 ##
1964 # @BlkdebugInjectErrorOptions
1965 #
1966 # Describes a single error injection for blkdebug.
1967 #
1968 # @event: trigger event
1969 #
1970 # @state: #optional the state identifier blkdebug needs to be in to
1971 # actually trigger the event; defaults to "any"
1972 #
1973 # @errno: #optional error identifier (errno) to be returned; defaults to
1974 # EIO
1975 #
1976 # @sector: #optional specifies the sector index which has to be affected
1977 # in order to actually trigger the event; defaults to "any
1978 # sector"
1979 #
1980 # @once: #optional disables further events after this one has been
1981 # triggered; defaults to false
1982 #
1983 # @immediately: #optional fail immediately; defaults to false
1984 #
1985 # Since: 2.0
1986 ##
1987 { 'struct': 'BlkdebugInjectErrorOptions',
1988 'data': { 'event': 'BlkdebugEvent',
1989 '*state': 'int',
1990 '*errno': 'int',
1991 '*sector': 'int',
1992 '*once': 'bool',
1993 '*immediately': 'bool' } }
1994
1995 ##
1996 # @BlkdebugSetStateOptions
1997 #
1998 # Describes a single state-change event for blkdebug.
1999 #
2000 # @event: trigger event
2001 #
2002 # @state: #optional the current state identifier blkdebug needs to be in;
2003 # defaults to "any"
2004 #
2005 # @new_state: the state identifier blkdebug is supposed to assume if
2006 # this event is triggered
2007 #
2008 # Since: 2.0
2009 ##
2010 { 'struct': 'BlkdebugSetStateOptions',
2011 'data': { 'event': 'BlkdebugEvent',
2012 '*state': 'int',
2013 'new_state': 'int' } }
2014
2015 ##
2016 # @BlockdevOptionsBlkdebug
2017 #
2018 # Driver specific block device options for blkdebug.
2019 #
2020 # @image: underlying raw block device (or image file)
2021 #
2022 # @config: #optional filename of the configuration file
2023 #
2024 # @align: #optional required alignment for requests in bytes,
2025 # must be power of 2, or 0 for default
2026 #
2027 # @inject-error: #optional array of error injection descriptions
2028 #
2029 # @set-state: #optional array of state-change descriptions
2030 #
2031 # Since: 2.0
2032 ##
2033 { 'struct': 'BlockdevOptionsBlkdebug',
2034 'data': { 'image': 'BlockdevRef',
2035 '*config': 'str',
2036 '*align': 'int',
2037 '*inject-error': ['BlkdebugInjectErrorOptions'],
2038 '*set-state': ['BlkdebugSetStateOptions'] } }
2039
2040 ##
2041 # @BlockdevOptionsBlkverify
2042 #
2043 # Driver specific block device options for blkverify.
2044 #
2045 # @test: block device to be tested
2046 #
2047 # @raw: raw image used for verification
2048 #
2049 # Since: 2.0
2050 ##
2051 { 'struct': 'BlockdevOptionsBlkverify',
2052 'data': { 'test': 'BlockdevRef',
2053 'raw': 'BlockdevRef' } }
2054
2055 ##
2056 # @QuorumReadPattern
2057 #
2058 # An enumeration of quorum read patterns.
2059 #
2060 # @quorum: read all the children and do a quorum vote on reads
2061 #
2062 # @fifo: read only from the first child that has not failed
2063 #
2064 # Since: 2.2
2065 ##
2066 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
2067
2068 ##
2069 # @BlockdevOptionsQuorum
2070 #
2071 # Driver specific block device options for Quorum
2072 #
2073 # @blkverify: #optional true if the driver must print content mismatch
2074 # set to false by default
2075 #
2076 # @children: the children block devices to use
2077 #
2078 # @vote-threshold: the vote limit under which a read will fail
2079 #
2080 # @rewrite-corrupted: #optional rewrite corrupted data when quorum is reached
2081 # (Since 2.1)
2082 #
2083 # @read-pattern: #optional choose read pattern and set to quorum by default
2084 # (Since 2.2)
2085 #
2086 # Since: 2.0
2087 ##
2088 { 'struct': 'BlockdevOptionsQuorum',
2089 'data': { '*blkverify': 'bool',
2090 'children': [ 'BlockdevRef' ],
2091 'vote-threshold': 'int',
2092 '*rewrite-corrupted': 'bool',
2093 '*read-pattern': 'QuorumReadPattern' } }
2094
2095 ##
2096 # @GlusterTransport
2097 #
2098 # An enumeration of Gluster transport types
2099 #
2100 # @tcp: TCP - Transmission Control Protocol
2101 #
2102 # @unix: UNIX - Unix domain socket
2103 #
2104 # Since: 2.7
2105 ##
2106 { 'enum': 'GlusterTransport',
2107 'data': [ 'unix', 'tcp' ] }
2108
2109
2110 ##
2111 # @GlusterServer
2112 #
2113 # Captures the address of a socket
2114 #
2115 # Details for connecting to a gluster server
2116 #
2117 # @type: Transport type used for gluster connection
2118 #
2119 # @unix: socket file
2120 #
2121 # @tcp: host address and port number
2122 #
2123 # Since: 2.7
2124 ##
2125 { 'union': 'GlusterServer',
2126 'base': { 'type': 'GlusterTransport' },
2127 'discriminator': 'type',
2128 'data': { 'unix': 'UnixSocketAddress',
2129 'tcp': 'InetSocketAddress' } }
2130
2131 ##
2132 # @BlockdevOptionsGluster
2133 #
2134 # Driver specific block device options for Gluster
2135 #
2136 # @volume: name of gluster volume where VM image resides
2137 #
2138 # @path: absolute path to image file in gluster volume
2139 #
2140 # @server: gluster servers description
2141 #
2142 # @debug-level: #optional libgfapi log level (default '4' which is Error)
2143 #
2144 # Since: 2.7
2145 ##
2146 { 'struct': 'BlockdevOptionsGluster',
2147 'data': { 'volume': 'str',
2148 'path': 'str',
2149 'server': ['GlusterServer'],
2150 '*debug-level': 'int' } }
2151
2152 ##
2153 # @BlockdevOptions
2154 #
2155 # Options for creating a block device. Many options are available for all
2156 # block devices, independent of the block driver:
2157 #
2158 # @driver: block driver name
2159 # @id: #optional id by which the new block device can be referred to.
2160 # This option is only allowed on the top level of blockdev-add.
2161 # A BlockBackend will be created by blockdev-add if and only if
2162 # this option is given.
2163 # @node-name: #optional the name of a block driver state node (Since 2.0).
2164 # This option is required on the top level of blockdev-add if
2165 # the @id option is not given there.
2166 # @discard: #optional discard-related options (default: ignore)
2167 # @cache: #optional cache-related options
2168 # @aio: #optional AIO backend (default: threads)
2169 # @read-only: #optional whether the block device should be read-only
2170 # (default: false)
2171 # @detect-zeroes: #optional detect and optimize zero writes (Since 2.1)
2172 # (default: off)
2173 #
2174 # Remaining options are determined by the block driver.
2175 #
2176 # Since: 1.7
2177 ##
2178 { 'union': 'BlockdevOptions',
2179 'base': { 'driver': 'BlockdevDriver',
2180 # TODO 'id' is a BB-level option, remove it
2181 '*id': 'str',
2182 '*node-name': 'str',
2183 '*discard': 'BlockdevDiscardOptions',
2184 '*cache': 'BlockdevCacheOptions',
2185 '*aio': 'BlockdevAioOptions',
2186 '*read-only': 'bool',
2187 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
2188 'discriminator': 'driver',
2189 'data': {
2190 'archipelago':'BlockdevOptionsArchipelago',
2191 'blkdebug': 'BlockdevOptionsBlkdebug',
2192 'blkverify': 'BlockdevOptionsBlkverify',
2193 'bochs': 'BlockdevOptionsGenericFormat',
2194 'cloop': 'BlockdevOptionsGenericFormat',
2195 'dmg': 'BlockdevOptionsGenericFormat',
2196 'file': 'BlockdevOptionsFile',
2197 'ftp': 'BlockdevOptionsFile',
2198 'ftps': 'BlockdevOptionsFile',
2199 'gluster': 'BlockdevOptionsGluster',
2200 'host_cdrom': 'BlockdevOptionsFile',
2201 'host_device':'BlockdevOptionsFile',
2202 'http': 'BlockdevOptionsFile',
2203 'https': 'BlockdevOptionsFile',
2204 # TODO iscsi: Wait for structured options
2205 'luks': 'BlockdevOptionsLUKS',
2206 # TODO nbd: Should take InetSocketAddress for 'host'?
2207 # TODO nfs: Wait for structured options
2208 'null-aio': 'BlockdevOptionsNull',
2209 'null-co': 'BlockdevOptionsNull',
2210 'parallels': 'BlockdevOptionsGenericFormat',
2211 'qcow2': 'BlockdevOptionsQcow2',
2212 'qcow': 'BlockdevOptionsGenericCOWFormat',
2213 'qed': 'BlockdevOptionsGenericCOWFormat',
2214 'quorum': 'BlockdevOptionsQuorum',
2215 'raw': 'BlockdevOptionsGenericFormat',
2216 # TODO rbd: Wait for structured options
2217 # TODO sheepdog: Wait for structured options
2218 # TODO ssh: Should take InetSocketAddress for 'host'?
2219 'tftp': 'BlockdevOptionsFile',
2220 'vdi': 'BlockdevOptionsGenericFormat',
2221 'vhdx': 'BlockdevOptionsGenericFormat',
2222 'vmdk': 'BlockdevOptionsGenericCOWFormat',
2223 'vpc': 'BlockdevOptionsGenericFormat',
2224 'vvfat': 'BlockdevOptionsVVFAT'
2225 } }
2226
2227 ##
2228 # @BlockdevRef
2229 #
2230 # Reference to a block device.
2231 #
2232 # @definition: defines a new block device inline
2233 # @reference: references the ID of an existing block device. An
2234 # empty string means that no block device should be
2235 # referenced.
2236 #
2237 # Since: 1.7
2238 ##
2239 { 'alternate': 'BlockdevRef',
2240 'data': { 'definition': 'BlockdevOptions',
2241 'reference': 'str' } }
2242
2243 ##
2244 # @blockdev-add:
2245 #
2246 # Creates a new block device. If the @id option is given at the top level, a
2247 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
2248 # level and no BlockBackend will be created.
2249 #
2250 # This command is still a work in progress. It doesn't support all
2251 # block drivers among other things. Stay away from it unless you want
2252 # to help with its development.
2253 #
2254 # @options: block device options for the new device
2255 #
2256 # Since: 1.7
2257 ##
2258 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }
2259
2260 ##
2261 # @x-blockdev-del:
2262 #
2263 # Deletes a block device that has been added using blockdev-add.
2264 # The selected device can be either a block backend or a graph node.
2265 #
2266 # In the former case the backend will be destroyed, along with its
2267 # inserted medium if there's any. The command will fail if the backend
2268 # or its medium are in use.
2269 #
2270 # In the latter case the node will be destroyed. The command will fail
2271 # if the node is attached to a block backend or is otherwise being
2272 # used.
2273 #
2274 # One of @id or @node-name must be specified, but not both.
2275 #
2276 # This command is still a work in progress and is considered
2277 # experimental. Stay away from it unless you want to help with its
2278 # development.
2279 #
2280 # @id: #optional Name of the block backend device to delete.
2281 #
2282 # @node-name: #optional Name of the graph node to delete.
2283 #
2284 # Since: 2.5
2285 ##
2286 { 'command': 'x-blockdev-del', 'data': { '*id': 'str', '*node-name': 'str' } }
2287
2288 ##
2289 # @blockdev-open-tray:
2290 #
2291 # Opens a block device's tray. If there is a block driver state tree inserted as
2292 # a medium, it will become inaccessible to the guest (but it will remain
2293 # associated to the block device, so closing the tray will make it accessible
2294 # again).
2295 #
2296 # If the tray was already open before, this will be a no-op.
2297 #
2298 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
2299 # which no such event will be generated, these include:
2300 # - if the guest has locked the tray, @force is false and the guest does not
2301 # respond to the eject request
2302 # - if the BlockBackend denoted by @device does not have a guest device attached
2303 # to it
2304 # - if the guest device does not have an actual tray
2305 #
2306 # @device: block device name
2307 #
2308 # @force: #optional if false (the default), an eject request will be sent to
2309 # the guest if it has locked the tray (and the tray will not be opened
2310 # immediately); if true, the tray will be opened regardless of whether
2311 # it is locked
2312 #
2313 # Since: 2.5
2314 ##
2315 { 'command': 'blockdev-open-tray',
2316 'data': { 'device': 'str',
2317 '*force': 'bool' } }
2318
2319 ##
2320 # @blockdev-close-tray:
2321 #
2322 # Closes a block device's tray. If there is a block driver state tree associated
2323 # with the block device (which is currently ejected), that tree will be loaded
2324 # as the medium.
2325 #
2326 # If the tray was already closed before, this will be a no-op.
2327 #
2328 # @device: block device name
2329 #
2330 # Since: 2.5
2331 ##
2332 { 'command': 'blockdev-close-tray',
2333 'data': { 'device': 'str' } }
2334
2335 ##
2336 # @x-blockdev-remove-medium:
2337 #
2338 # Removes a medium (a block driver state tree) from a block device. That block
2339 # device's tray must currently be open (unless there is no attached guest
2340 # device).
2341 #
2342 # If the tray is open and there is no medium inserted, this will be a no-op.
2343 #
2344 # This command is still a work in progress and is considered experimental.
2345 # Stay away from it unless you want to help with its development.
2346 #
2347 # @device: block device name
2348 #
2349 # Since: 2.5
2350 ##
2351 { 'command': 'x-blockdev-remove-medium',
2352 'data': { 'device': 'str' } }
2353
2354 ##
2355 # @x-blockdev-insert-medium:
2356 #
2357 # Inserts a medium (a block driver state tree) into a block device. That block
2358 # device's tray must currently be open (unless there is no attached guest
2359 # device) and there must be no medium inserted already.
2360 #
2361 # This command is still a work in progress and is considered experimental.
2362 # Stay away from it unless you want to help with its development.
2363 #
2364 # @device: block device name
2365 #
2366 # @node-name: name of a node in the block driver state graph
2367 #
2368 # Since: 2.5
2369 ##
2370 { 'command': 'x-blockdev-insert-medium',
2371 'data': { 'device': 'str',
2372 'node-name': 'str'} }
2373
2374
2375 ##
2376 # @BlockdevChangeReadOnlyMode:
2377 #
2378 # Specifies the new read-only mode of a block device subject to the
2379 # @blockdev-change-medium command.
2380 #
2381 # @retain: Retains the current read-only mode
2382 #
2383 # @read-only: Makes the device read-only
2384 #
2385 # @read-write: Makes the device writable
2386 #
2387 # Since: 2.3
2388 ##
2389 { 'enum': 'BlockdevChangeReadOnlyMode',
2390 'data': ['retain', 'read-only', 'read-write'] }
2391
2392
2393 ##
2394 # @blockdev-change-medium:
2395 #
2396 # Changes the medium inserted into a block device by ejecting the current medium
2397 # and loading a new image file which is inserted as the new medium (this command
2398 # combines blockdev-open-tray, x-blockdev-remove-medium,
2399 # x-blockdev-insert-medium and blockdev-close-tray).
2400 #
2401 # @device: block device name
2402 #
2403 # @filename: filename of the new image to be loaded
2404 #
2405 # @format: #optional, format to open the new image with (defaults to
2406 # the probed format)
2407 #
2408 # @read-only-mode: #optional, change the read-only mode of the device; defaults
2409 # to 'retain'
2410 #
2411 # Since: 2.5
2412 ##
2413 { 'command': 'blockdev-change-medium',
2414 'data': { 'device': 'str',
2415 'filename': 'str',
2416 '*format': 'str',
2417 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
2418
2419
2420 ##
2421 # @BlockErrorAction
2422 #
2423 # An enumeration of action that has been taken when a DISK I/O occurs
2424 #
2425 # @ignore: error has been ignored
2426 #
2427 # @report: error has been reported to the device
2428 #
2429 # @stop: error caused VM to be stopped
2430 #
2431 # Since: 2.1
2432 ##
2433 { 'enum': 'BlockErrorAction',
2434 'data': [ 'ignore', 'report', 'stop' ] }
2435
2436
2437 ##
2438 # @BLOCK_IMAGE_CORRUPTED
2439 #
2440 # Emitted when a corruption has been detected in a disk image
2441 #
2442 # @device: device name. This is always present for compatibility
2443 # reasons, but it can be empty ("") if the image does not
2444 # have a device name associated.
2445 #
2446 # @node-name: #optional node name (Since: 2.4)
2447 #
2448 # @msg: informative message for human consumption, such as the kind of
2449 # corruption being detected. It should not be parsed by machine as it is
2450 # not guaranteed to be stable
2451 #
2452 # @offset: #optional, if the corruption resulted from an image access, this is
2453 # the host's access offset into the image
2454 #
2455 # @size: #optional, if the corruption resulted from an image access, this is
2456 # the access size
2457 #
2458 # fatal: if set, the image is marked corrupt and therefore unusable after this
2459 # event and must be repaired (Since 2.2; before, every
2460 # BLOCK_IMAGE_CORRUPTED event was fatal)
2461 #
2462 # Since: 1.7
2463 ##
2464 { 'event': 'BLOCK_IMAGE_CORRUPTED',
2465 'data': { 'device' : 'str',
2466 '*node-name' : 'str',
2467 'msg' : 'str',
2468 '*offset' : 'int',
2469 '*size' : 'int',
2470 'fatal' : 'bool' } }
2471
2472 ##
2473 # @BLOCK_IO_ERROR
2474 #
2475 # Emitted when a disk I/O error occurs
2476 #
2477 # @device: device name
2478 #
2479 # @operation: I/O operation
2480 #
2481 # @action: action that has been taken
2482 #
2483 # @nospace: #optional true if I/O error was caused due to a no-space
2484 # condition. This key is only present if query-block's
2485 # io-status is present, please see query-block documentation
2486 # for more information (since: 2.2)
2487 #
2488 # @reason: human readable string describing the error cause.
2489 # (This field is a debugging aid for humans, it should not
2490 # be parsed by applications) (since: 2.2)
2491 #
2492 # Note: If action is "stop", a STOP event will eventually follow the
2493 # BLOCK_IO_ERROR event
2494 #
2495 # Since: 0.13.0
2496 ##
2497 { 'event': 'BLOCK_IO_ERROR',
2498 'data': { 'device': 'str', 'operation': 'IoOperationType',
2499 'action': 'BlockErrorAction', '*nospace': 'bool',
2500 'reason': 'str' } }
2501
2502 ##
2503 # @BLOCK_JOB_COMPLETED
2504 #
2505 # Emitted when a block job has completed
2506 #
2507 # @type: job type
2508 #
2509 # @device: The job identifier. Originally the device name but other
2510 # values are allowed since QEMU 2.7
2511 #
2512 # @len: maximum progress value
2513 #
2514 # @offset: current progress value. On success this is equal to len.
2515 # On failure this is less than len
2516 #
2517 # @speed: rate limit, bytes per second
2518 #
2519 # @error: #optional, error message. Only present on failure. This field
2520 # contains a human-readable error message. There are no semantics
2521 # other than that streaming has failed and clients should not try to
2522 # interpret the error string
2523 #
2524 # Since: 1.1
2525 ##
2526 { 'event': 'BLOCK_JOB_COMPLETED',
2527 'data': { 'type' : 'BlockJobType',
2528 'device': 'str',
2529 'len' : 'int',
2530 'offset': 'int',
2531 'speed' : 'int',
2532 '*error': 'str' } }
2533
2534 ##
2535 # @BLOCK_JOB_CANCELLED
2536 #
2537 # Emitted when a block job has been cancelled
2538 #
2539 # @type: job type
2540 #
2541 # @device: The job identifier. Originally the device name but other
2542 # values are allowed since QEMU 2.7
2543 #
2544 # @len: maximum progress value
2545 #
2546 # @offset: current progress value. On success this is equal to len.
2547 # On failure this is less than len
2548 #
2549 # @speed: rate limit, bytes per second
2550 #
2551 # Since: 1.1
2552 ##
2553 { 'event': 'BLOCK_JOB_CANCELLED',
2554 'data': { 'type' : 'BlockJobType',
2555 'device': 'str',
2556 'len' : 'int',
2557 'offset': 'int',
2558 'speed' : 'int' } }
2559
2560 ##
2561 # @BLOCK_JOB_ERROR
2562 #
2563 # Emitted when a block job encounters an error
2564 #
2565 # @device: The job identifier. Originally the device name but other
2566 # values are allowed since QEMU 2.7
2567 #
2568 # @operation: I/O operation
2569 #
2570 # @action: action that has been taken
2571 #
2572 # Since: 1.3
2573 ##
2574 { 'event': 'BLOCK_JOB_ERROR',
2575 'data': { 'device' : 'str',
2576 'operation': 'IoOperationType',
2577 'action' : 'BlockErrorAction' } }
2578
2579 ##
2580 # @BLOCK_JOB_READY
2581 #
2582 # Emitted when a block job is ready to complete
2583 #
2584 # @type: job type
2585 #
2586 # @device: The job identifier. Originally the device name but other
2587 # values are allowed since QEMU 2.7
2588 #
2589 # @len: maximum progress value
2590 #
2591 # @offset: current progress value. On success this is equal to len.
2592 # On failure this is less than len
2593 #
2594 # @speed: rate limit, bytes per second
2595 #
2596 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
2597 # event
2598 #
2599 # Since: 1.3
2600 ##
2601 { 'event': 'BLOCK_JOB_READY',
2602 'data': { 'type' : 'BlockJobType',
2603 'device': 'str',
2604 'len' : 'int',
2605 'offset': 'int',
2606 'speed' : 'int' } }
2607
2608 # @PreallocMode
2609 #
2610 # Preallocation mode of QEMU image file
2611 #
2612 # @off: no preallocation
2613 # @metadata: preallocate only for metadata
2614 # @falloc: like @full preallocation but allocate disk space by
2615 # posix_fallocate() rather than writing zeros.
2616 # @full: preallocate all data by writing zeros to device to ensure disk
2617 # space is really available. @full preallocation also sets up
2618 # metadata correctly.
2619 #
2620 # Since 2.2
2621 ##
2622 { 'enum': 'PreallocMode',
2623 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
2624
2625 ##
2626 # @BLOCK_WRITE_THRESHOLD
2627 #
2628 # Emitted when writes on block device reaches or exceeds the
2629 # configured write threshold. For thin-provisioned devices, this
2630 # means the device should be extended to avoid pausing for
2631 # disk exhaustion.
2632 # The event is one shot. Once triggered, it needs to be
2633 # re-registered with another block-set-threshold command.
2634 #
2635 # @node-name: graph node name on which the threshold was exceeded.
2636 #
2637 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
2638 #
2639 # @write-threshold: last configured threshold, in bytes.
2640 #
2641 # Since: 2.3
2642 ##
2643 { 'event': 'BLOCK_WRITE_THRESHOLD',
2644 'data': { 'node-name': 'str',
2645 'amount-exceeded': 'uint64',
2646 'write-threshold': 'uint64' } }
2647
2648 ##
2649 # @block-set-write-threshold
2650 #
2651 # Change the write threshold for a block drive. An event will be delivered
2652 # if a write to this block drive crosses the configured threshold.
2653 # This is useful to transparently resize thin-provisioned drives without
2654 # the guest OS noticing.
2655 #
2656 # @node-name: graph node name on which the threshold must be set.
2657 #
2658 # @write-threshold: configured threshold for the block device, bytes.
2659 # Use 0 to disable the threshold.
2660 #
2661 # Since: 2.3
2662 ##
2663 { 'command': 'block-set-write-threshold',
2664 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
2665
2666 ##
2667 # @x-blockdev-change
2668 #
2669 # Dynamically reconfigure the block driver state graph. It can be used
2670 # to add, remove, insert or replace a graph node. Currently only the
2671 # Quorum driver implements this feature to add or remove its child. This
2672 # is useful to fix a broken quorum child.
2673 #
2674 # If @node is specified, it will be inserted under @parent. @child
2675 # may not be specified in this case. If both @parent and @child are
2676 # specified but @node is not, @child will be detached from @parent.
2677 #
2678 # @parent: the id or name of the parent node.
2679 #
2680 # @child: #optional the name of a child under the given parent node.
2681 #
2682 # @node: #optional the name of the node that will be added.
2683 #
2684 # Note: this command is experimental, and its API is not stable. It
2685 # does not support all kinds of operations, all kinds of children, nor
2686 # all block drivers.
2687 #
2688 # Warning: The data in a new quorum child MUST be consistent with that of
2689 # the rest of the array.
2690 #
2691 # Since: 2.7
2692 ##
2693 { 'command': 'x-blockdev-change',
2694 'data' : { 'parent': 'str',
2695 '*child': 'str',
2696 '*node': 'str' } }