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