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