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