]> git.proxmox.com Git - mirror_qemu.git/blob - qapi/block-core.json
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
[mirror_qemu.git] / qapi / block-core.json
1 # -*- Mode: Python -*-
2 # vim: filetype=python
3
4 ##
5 # == Block core (VM unrelated)
6 ##
7
8 { 'include': 'common.json' }
9 { 'include': 'crypto.json' }
10 { 'include': 'job.json' }
11 { 'include': 'sockets.json' }
12
13 ##
14 # @SnapshotInfo:
15 #
16 # @id: unique snapshot id
17 #
18 # @name: user chosen name
19 #
20 # @vm-state-size: size of the VM state
21 #
22 # @date-sec: UTC date of the snapshot in seconds
23 #
24 # @date-nsec: fractional part in nano seconds to be used with date-sec
25 #
26 # @vm-clock-sec: VM clock relative to boot in seconds
27 #
28 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
29 #
30 # @icount: Current instruction count. Appears when execution record/replay
31 # is enabled. Used for "time-traveling" to match the moment
32 # in the recorded execution with the snapshots. This counter may
33 # be obtained through @query-replay command (since 5.2)
34 #
35 # Since: 1.3
36 #
37 ##
38 { 'struct': 'SnapshotInfo',
39 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
40 'date-sec': 'int', 'date-nsec': 'int',
41 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int',
42 '*icount': 'int' } }
43
44 ##
45 # @ImageInfoSpecificQCow2EncryptionBase:
46 #
47 # @format: The encryption format
48 #
49 # Since: 2.10
50 ##
51 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
52 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
53
54 ##
55 # @ImageInfoSpecificQCow2Encryption:
56 #
57 # Since: 2.10
58 ##
59 { 'union': 'ImageInfoSpecificQCow2Encryption',
60 'base': 'ImageInfoSpecificQCow2EncryptionBase',
61 'discriminator': 'format',
62 'data': { 'luks': 'QCryptoBlockInfoLUKS' } }
63
64 ##
65 # @ImageInfoSpecificQCow2:
66 #
67 # @compat: compatibility level
68 #
69 # @data-file: the filename of the external data file that is stored in the
70 # image and used as a default for opening the image (since: 4.0)
71 #
72 # @data-file-raw: True if the external data file must stay valid as a
73 # standalone (read-only) raw image without looking at qcow2
74 # metadata (since: 4.0)
75 #
76 # @extended-l2: true if the image has extended L2 entries; only valid for
77 # compat >= 1.1 (since 5.2)
78 #
79 # @lazy-refcounts: on or off; only valid for compat >= 1.1
80 #
81 # @corrupt: true if the image has been marked corrupt; only valid for
82 # compat >= 1.1 (since 2.2)
83 #
84 # @refcount-bits: width of a refcount entry in bits (since 2.3)
85 #
86 # @encrypt: details about encryption parameters; only set if image
87 # is encrypted (since 2.10)
88 #
89 # @bitmaps: A list of qcow2 bitmap details (since 4.0)
90 #
91 # @compression-type: the image cluster compression method (since 5.1)
92 #
93 # Since: 1.7
94 ##
95 { 'struct': 'ImageInfoSpecificQCow2',
96 'data': {
97 'compat': 'str',
98 '*data-file': 'str',
99 '*data-file-raw': 'bool',
100 '*extended-l2': 'bool',
101 '*lazy-refcounts': 'bool',
102 '*corrupt': 'bool',
103 'refcount-bits': 'int',
104 '*encrypt': 'ImageInfoSpecificQCow2Encryption',
105 '*bitmaps': ['Qcow2BitmapInfo'],
106 'compression-type': 'Qcow2CompressionType'
107 } }
108
109 ##
110 # @ImageInfoSpecificVmdk:
111 #
112 # @create-type: The create type of VMDK image
113 #
114 # @cid: Content id of image
115 #
116 # @parent-cid: Parent VMDK image's cid
117 #
118 # @extents: List of extent files
119 #
120 # Since: 1.7
121 ##
122 { 'struct': 'ImageInfoSpecificVmdk',
123 'data': {
124 'create-type': 'str',
125 'cid': 'int',
126 'parent-cid': 'int',
127 'extents': ['ImageInfo']
128 } }
129
130 ##
131 # @ImageInfoSpecificRbd:
132 #
133 # @encryption-format: Image encryption format
134 #
135 # Since: 6.1
136 ##
137 { 'struct': 'ImageInfoSpecificRbd',
138 'data': {
139 '*encryption-format': 'RbdImageEncryptionFormat'
140 } }
141
142 ##
143 # @ImageInfoSpecificKind:
144 #
145 # @luks: Since 2.7
146 # @rbd: Since 6.1
147 #
148 # Since: 1.7
149 ##
150 { 'enum': 'ImageInfoSpecificKind',
151 'data': [ 'qcow2', 'vmdk', 'luks', 'rbd' ] }
152
153 ##
154 # @ImageInfoSpecificQCow2Wrapper:
155 #
156 # Since: 1.7
157 ##
158 { 'struct': 'ImageInfoSpecificQCow2Wrapper',
159 'data': { 'data': 'ImageInfoSpecificQCow2' } }
160
161 ##
162 # @ImageInfoSpecificVmdkWrapper:
163 #
164 # Since: 6.1
165 ##
166 { 'struct': 'ImageInfoSpecificVmdkWrapper',
167 'data': { 'data': 'ImageInfoSpecificVmdk' } }
168
169 ##
170 # @ImageInfoSpecificLUKSWrapper:
171 #
172 # Since: 2.7
173 ##
174 { 'struct': 'ImageInfoSpecificLUKSWrapper',
175 'data': { 'data': 'QCryptoBlockInfoLUKS' } }
176 # If we need to add block driver specific parameters for
177 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
178 # to define a ImageInfoSpecificLUKS
179
180 ##
181 # @ImageInfoSpecificRbdWrapper:
182 #
183 # Since: 6.1
184 ##
185 { 'struct': 'ImageInfoSpecificRbdWrapper',
186 'data': { 'data': 'ImageInfoSpecificRbd' } }
187
188 ##
189 # @ImageInfoSpecific:
190 #
191 # A discriminated record of image format specific information structures.
192 #
193 # Since: 1.7
194 ##
195 { 'union': 'ImageInfoSpecific',
196 'base': { 'type': 'ImageInfoSpecificKind' },
197 'discriminator': 'type',
198 'data': {
199 'qcow2': 'ImageInfoSpecificQCow2Wrapper',
200 'vmdk': 'ImageInfoSpecificVmdkWrapper',
201 'luks': 'ImageInfoSpecificLUKSWrapper',
202 'rbd': 'ImageInfoSpecificRbdWrapper'
203 } }
204
205 ##
206 # @ImageInfo:
207 #
208 # Information about a QEMU image file
209 #
210 # @filename: name of the image file
211 #
212 # @format: format of the image file
213 #
214 # @virtual-size: maximum capacity in bytes of the image
215 #
216 # @actual-size: actual size on disk in bytes of the image
217 #
218 # @dirty-flag: true if image is not cleanly closed
219 #
220 # @cluster-size: size of a cluster in bytes
221 #
222 # @encrypted: true if the image is encrypted
223 #
224 # @compressed: true if the image is compressed (Since 1.7)
225 #
226 # @backing-filename: name of the backing file
227 #
228 # @full-backing-filename: full path of the backing file
229 #
230 # @backing-filename-format: the format of the backing file
231 #
232 # @snapshots: list of VM snapshots
233 #
234 # @backing-image: info of the backing image (since 1.6)
235 #
236 # @format-specific: structure supplying additional format-specific
237 # information (since 1.7)
238 #
239 # Since: 1.3
240 #
241 ##
242 { 'struct': 'ImageInfo',
243 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
244 '*actual-size': 'int', 'virtual-size': 'int',
245 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
246 '*backing-filename': 'str', '*full-backing-filename': 'str',
247 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
248 '*backing-image': 'ImageInfo',
249 '*format-specific': 'ImageInfoSpecific' } }
250
251 ##
252 # @ImageCheck:
253 #
254 # Information about a QEMU image file check
255 #
256 # @filename: name of the image file checked
257 #
258 # @format: format of the image file checked
259 #
260 # @check-errors: number of unexpected errors occurred during check
261 #
262 # @image-end-offset: offset (in bytes) where the image ends, this
263 # field is present if the driver for the image format
264 # supports it
265 #
266 # @corruptions: number of corruptions found during the check if any
267 #
268 # @leaks: number of leaks found during the check if any
269 #
270 # @corruptions-fixed: number of corruptions fixed during the check
271 # if any
272 #
273 # @leaks-fixed: number of leaks fixed during the check if any
274 #
275 # @total-clusters: total number of clusters, this field is present
276 # if the driver for the image format supports it
277 #
278 # @allocated-clusters: total number of allocated clusters, this
279 # field is present if the driver for the image format
280 # supports it
281 #
282 # @fragmented-clusters: total number of fragmented clusters, this
283 # field is present if the driver for the image format
284 # supports it
285 #
286 # @compressed-clusters: total number of compressed clusters, this
287 # field is present if the driver for the image format
288 # supports it
289 #
290 # Since: 1.4
291 #
292 ##
293 { 'struct': 'ImageCheck',
294 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
295 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
296 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
297 '*total-clusters': 'int', '*allocated-clusters': 'int',
298 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
299
300 ##
301 # @MapEntry:
302 #
303 # Mapping information from a virtual block range to a host file range
304 #
305 # @start: virtual (guest) offset of the first byte described by this
306 # entry
307 #
308 # @length: the number of bytes of the mapped virtual range
309 #
310 # @data: reading the image will actually read data from a file (in
311 # particular, if @offset is present this means that the sectors
312 # are not simply preallocated, but contain actual data in raw
313 # format)
314 #
315 # @zero: whether the virtual blocks read as zeroes
316 #
317 # @depth: number of layers (0 = top image, 1 = top image's backing
318 # file, ..., n - 1 = bottom image (where n is the number of
319 # images in the chain)) before reaching one for which the
320 # range is allocated
321 #
322 # @present: true if this layer provides the data, false if adding a backing
323 # layer could impact this region (since 6.1)
324 #
325 # @offset: if present, the image file stores the data for this range
326 # in raw format at the given (host) offset
327 #
328 # @filename: filename that is referred to by @offset
329 #
330 # Since: 2.6
331 #
332 ##
333 { 'struct': 'MapEntry',
334 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
335 'zero': 'bool', 'depth': 'int', 'present': 'bool',
336 '*offset': 'int', '*filename': 'str' } }
337
338 ##
339 # @BlockdevCacheInfo:
340 #
341 # Cache mode information for a block device
342 #
343 # @writeback: true if writeback mode is enabled
344 # @direct: true if the host page cache is bypassed (O_DIRECT)
345 # @no-flush: true if flush requests are ignored for the device
346 #
347 # Since: 2.3
348 ##
349 { 'struct': 'BlockdevCacheInfo',
350 'data': { 'writeback': 'bool',
351 'direct': 'bool',
352 'no-flush': 'bool' } }
353
354 ##
355 # @BlockDeviceInfo:
356 #
357 # Information about the backing device for a block device.
358 #
359 # @file: the filename of the backing device
360 #
361 # @node-name: the name of the block driver node (Since 2.0)
362 #
363 # @ro: true if the backing device was open read-only
364 #
365 # @drv: the name of the block format used to open the backing device. As of
366 # 0.14 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
367 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
368 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
369 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
370 # 2.2: 'archipelago' added, 'cow' dropped
371 # 2.3: 'host_floppy' deprecated
372 # 2.5: 'host_floppy' dropped
373 # 2.6: 'luks' added
374 # 2.8: 'replication' added, 'tftp' dropped
375 # 2.9: 'archipelago' dropped
376 #
377 # @backing_file: the name of the backing file (for copy-on-write)
378 #
379 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
380 #
381 # @encrypted: true if the backing device is encrypted
382 #
383 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
384 #
385 # @bps: total throughput limit in bytes per second is specified
386 #
387 # @bps_rd: read throughput limit in bytes per second is specified
388 #
389 # @bps_wr: write throughput limit in bytes per second is specified
390 #
391 # @iops: total I/O operations per second is specified
392 #
393 # @iops_rd: read I/O operations per second is specified
394 #
395 # @iops_wr: write I/O operations per second is specified
396 #
397 # @image: the info of image used (since: 1.6)
398 #
399 # @bps_max: total throughput limit during bursts,
400 # in bytes (Since 1.7)
401 #
402 # @bps_rd_max: read throughput limit during bursts,
403 # in bytes (Since 1.7)
404 #
405 # @bps_wr_max: write throughput limit during bursts,
406 # in bytes (Since 1.7)
407 #
408 # @iops_max: total I/O operations per second during bursts,
409 # in bytes (Since 1.7)
410 #
411 # @iops_rd_max: read I/O operations per second during bursts,
412 # in bytes (Since 1.7)
413 #
414 # @iops_wr_max: write I/O operations per second during bursts,
415 # in bytes (Since 1.7)
416 #
417 # @bps_max_length: maximum length of the @bps_max burst
418 # period, in seconds. (Since 2.6)
419 #
420 # @bps_rd_max_length: maximum length of the @bps_rd_max
421 # burst period, in seconds. (Since 2.6)
422 #
423 # @bps_wr_max_length: maximum length of the @bps_wr_max
424 # burst period, in seconds. (Since 2.6)
425 #
426 # @iops_max_length: maximum length of the @iops burst
427 # period, in seconds. (Since 2.6)
428 #
429 # @iops_rd_max_length: maximum length of the @iops_rd_max
430 # burst period, in seconds. (Since 2.6)
431 #
432 # @iops_wr_max_length: maximum length of the @iops_wr_max
433 # burst period, in seconds. (Since 2.6)
434 #
435 # @iops_size: an I/O size in bytes (Since 1.7)
436 #
437 # @group: throttle group name (Since 2.4)
438 #
439 # @cache: the cache mode used for the block device (since: 2.3)
440 #
441 # @write_threshold: configured write threshold for the device.
442 # 0 if disabled. (Since 2.3)
443 #
444 # @dirty-bitmaps: dirty bitmaps information (only present if node
445 # has one or more dirty bitmaps) (Since 4.2)
446 #
447 # Since: 0.14
448 #
449 ##
450 { 'struct': 'BlockDeviceInfo',
451 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
452 '*backing_file': 'str', 'backing_file_depth': 'int',
453 'encrypted': 'bool',
454 'detect_zeroes': 'BlockdevDetectZeroesOptions',
455 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
456 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
457 'image': 'ImageInfo',
458 '*bps_max': 'int', '*bps_rd_max': 'int',
459 '*bps_wr_max': 'int', '*iops_max': 'int',
460 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
461 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
462 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
463 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
464 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
465 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } }
466
467 ##
468 # @BlockDeviceIoStatus:
469 #
470 # An enumeration of block device I/O status.
471 #
472 # @ok: The last I/O operation has succeeded
473 #
474 # @failed: The last I/O operation has failed
475 #
476 # @nospace: The last I/O operation has failed due to a no-space condition
477 #
478 # Since: 1.0
479 ##
480 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
481
482 ##
483 # @BlockDirtyInfo:
484 #
485 # Block dirty bitmap information.
486 #
487 # @name: the name of the dirty bitmap (Since 2.4)
488 #
489 # @count: number of dirty bytes according to the dirty bitmap
490 #
491 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
492 #
493 # @recording: true if the bitmap is recording new writes from the guest.
494 # Replaces ``active`` and ``disabled`` statuses. (since 4.0)
495 #
496 # @busy: true if the bitmap is in-use by some operation (NBD or jobs)
497 # and cannot be modified via QMP or used by another operation.
498 # Replaces ``locked`` and ``frozen`` statuses. (since 4.0)
499 #
500 # @persistent: true if the bitmap was stored on disk, is scheduled to be stored
501 # on disk, or both. (since 4.0)
502 #
503 # @inconsistent: true if this is a persistent bitmap that was improperly
504 # stored. Implies @persistent to be true; @recording and
505 # @busy to be false. This bitmap cannot be used. To remove
506 # it, use @block-dirty-bitmap-remove. (Since 4.0)
507 #
508 # Since: 1.3
509 ##
510 { 'struct': 'BlockDirtyInfo',
511 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
512 'recording': 'bool', 'busy': 'bool',
513 'persistent': 'bool', '*inconsistent': 'bool' } }
514
515 ##
516 # @Qcow2BitmapInfoFlags:
517 #
518 # An enumeration of flags that a bitmap can report to the user.
519 #
520 # @in-use: This flag is set by any process actively modifying the qcow2 file,
521 # and cleared when the updated bitmap is flushed to the qcow2 image.
522 # The presence of this flag in an offline image means that the bitmap
523 # was not saved correctly after its last usage, and may contain
524 # inconsistent data.
525 #
526 # @auto: The bitmap must reflect all changes of the virtual disk by any
527 # application that would write to this qcow2 file.
528 #
529 # Since: 4.0
530 ##
531 { 'enum': 'Qcow2BitmapInfoFlags',
532 'data': ['in-use', 'auto'] }
533
534 ##
535 # @Qcow2BitmapInfo:
536 #
537 # Qcow2 bitmap information.
538 #
539 # @name: the name of the bitmap
540 #
541 # @granularity: granularity of the bitmap in bytes
542 #
543 # @flags: flags of the bitmap
544 #
545 # Since: 4.0
546 ##
547 { 'struct': 'Qcow2BitmapInfo',
548 'data': {'name': 'str', 'granularity': 'uint32',
549 'flags': ['Qcow2BitmapInfoFlags'] } }
550
551 ##
552 # @BlockLatencyHistogramInfo:
553 #
554 # Block latency histogram.
555 #
556 # @boundaries: list of interval boundary values in nanoseconds, all greater
557 # than zero and in ascending order.
558 # For example, the list [10, 50, 100] produces the following
559 # histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf).
560 #
561 # @bins: list of io request counts corresponding to histogram intervals.
562 # len(@bins) = len(@boundaries) + 1
563 # For the example above, @bins may be something like [3, 1, 5, 2],
564 # and corresponding histogram looks like:
565 #
566 # ::
567 #
568 # 5| *
569 # 4| *
570 # 3| * *
571 # 2| * * *
572 # 1| * * * *
573 # +------------------
574 # 10 50 100
575 #
576 # Since: 4.0
577 ##
578 { 'struct': 'BlockLatencyHistogramInfo',
579 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } }
580
581 ##
582 # @BlockInfo:
583 #
584 # Block device information. This structure describes a virtual device and
585 # the backing device associated with it.
586 #
587 # @device: The device name associated with the virtual device.
588 #
589 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
590 # device. (since 2.10)
591 #
592 # @type: This field is returned only for compatibility reasons, it should
593 # not be used (always returns 'unknown')
594 #
595 # @removable: True if the device supports removable media.
596 #
597 # @locked: True if the guest has locked this device from having its media
598 # removed
599 #
600 # @tray_open: True if the device's tray is open
601 # (only present if it has a tray)
602 #
603 # @io-status: @BlockDeviceIoStatus. Only present if the device
604 # supports it and the VM is configured to stop on errors
605 # (supported device models: virtio-blk, IDE, SCSI except
606 # scsi-generic)
607 #
608 # @inserted: @BlockDeviceInfo describing the device if media is
609 # present
610 #
611 # Since: 0.14
612 ##
613 { 'struct': 'BlockInfo',
614 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
615 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
616 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus' } }
617
618 ##
619 # @BlockMeasureInfo:
620 #
621 # Image file size calculation information. This structure describes the size
622 # requirements for creating a new image file.
623 #
624 # The size requirements depend on the new image file format. File size always
625 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
626 # Compact formats such as 'qcow2' represent unallocated and zero regions
627 # efficiently so file size may be smaller than virtual disk size.
628 #
629 # The values are upper bounds that are guaranteed to fit the new image file.
630 # Subsequent modification, such as internal snapshot or further bitmap
631 # creation, may require additional space and is not covered here.
632 #
633 # @required: Size required for a new image file, in bytes, when copying just
634 # allocated guest-visible contents.
635 #
636 # @fully-allocated: Image file size, in bytes, once data has been written
637 # to all sectors, when copying just guest-visible contents.
638 #
639 # @bitmaps: Additional size required if all the top-level bitmap metadata
640 # in the source image were to be copied to the destination,
641 # present only when source and destination both support
642 # persistent bitmaps. (since 5.1)
643 #
644 # Since: 2.10
645 ##
646 { 'struct': 'BlockMeasureInfo',
647 'data': {'required': 'int', 'fully-allocated': 'int', '*bitmaps': 'int'} }
648
649 ##
650 # @query-block:
651 #
652 # Get a list of BlockInfo for all virtual block devices.
653 #
654 # Returns: a list of @BlockInfo describing each virtual block device. Filter
655 # nodes that were created implicitly are skipped over.
656 #
657 # Since: 0.14
658 #
659 # Example:
660 #
661 # -> { "execute": "query-block" }
662 # <- {
663 # "return":[
664 # {
665 # "io-status": "ok",
666 # "device":"ide0-hd0",
667 # "locked":false,
668 # "removable":false,
669 # "inserted":{
670 # "ro":false,
671 # "drv":"qcow2",
672 # "encrypted":false,
673 # "file":"disks/test.qcow2",
674 # "backing_file_depth":1,
675 # "bps":1000000,
676 # "bps_rd":0,
677 # "bps_wr":0,
678 # "iops":1000000,
679 # "iops_rd":0,
680 # "iops_wr":0,
681 # "bps_max": 8000000,
682 # "bps_rd_max": 0,
683 # "bps_wr_max": 0,
684 # "iops_max": 0,
685 # "iops_rd_max": 0,
686 # "iops_wr_max": 0,
687 # "iops_size": 0,
688 # "detect_zeroes": "on",
689 # "write_threshold": 0,
690 # "image":{
691 # "filename":"disks/test.qcow2",
692 # "format":"qcow2",
693 # "virtual-size":2048000,
694 # "backing_file":"base.qcow2",
695 # "full-backing-filename":"disks/base.qcow2",
696 # "backing-filename-format":"qcow2",
697 # "snapshots":[
698 # {
699 # "id": "1",
700 # "name": "snapshot1",
701 # "vm-state-size": 0,
702 # "date-sec": 10000200,
703 # "date-nsec": 12,
704 # "vm-clock-sec": 206,
705 # "vm-clock-nsec": 30
706 # }
707 # ],
708 # "backing-image":{
709 # "filename":"disks/base.qcow2",
710 # "format":"qcow2",
711 # "virtual-size":2048000
712 # }
713 # }
714 # },
715 # "qdev": "ide_disk",
716 # "type":"unknown"
717 # },
718 # {
719 # "io-status": "ok",
720 # "device":"ide1-cd0",
721 # "locked":false,
722 # "removable":true,
723 # "qdev": "/machine/unattached/device[23]",
724 # "tray_open": false,
725 # "type":"unknown"
726 # },
727 # {
728 # "device":"floppy0",
729 # "locked":false,
730 # "removable":true,
731 # "qdev": "/machine/unattached/device[20]",
732 # "type":"unknown"
733 # },
734 # {
735 # "device":"sd0",
736 # "locked":false,
737 # "removable":true,
738 # "type":"unknown"
739 # }
740 # ]
741 # }
742 #
743 ##
744 { 'command': 'query-block', 'returns': ['BlockInfo'] }
745
746
747 ##
748 # @BlockDeviceTimedStats:
749 #
750 # Statistics of a block device during a given interval of time.
751 #
752 # @interval_length: Interval used for calculating the statistics,
753 # in seconds.
754 #
755 # @min_rd_latency_ns: Minimum latency of read operations in the
756 # defined interval, in nanoseconds.
757 #
758 # @min_wr_latency_ns: Minimum latency of write operations in the
759 # defined interval, in nanoseconds.
760 #
761 # @min_flush_latency_ns: Minimum latency of flush operations in the
762 # defined interval, in nanoseconds.
763 #
764 # @max_rd_latency_ns: Maximum latency of read operations in the
765 # defined interval, in nanoseconds.
766 #
767 # @max_wr_latency_ns: Maximum latency of write operations in the
768 # defined interval, in nanoseconds.
769 #
770 # @max_flush_latency_ns: Maximum latency of flush operations in the
771 # defined interval, in nanoseconds.
772 #
773 # @avg_rd_latency_ns: Average latency of read operations in the
774 # defined interval, in nanoseconds.
775 #
776 # @avg_wr_latency_ns: Average latency of write operations in the
777 # defined interval, in nanoseconds.
778 #
779 # @avg_flush_latency_ns: Average latency of flush operations in the
780 # defined interval, in nanoseconds.
781 #
782 # @avg_rd_queue_depth: Average number of pending read operations
783 # in the defined interval.
784 #
785 # @avg_wr_queue_depth: Average number of pending write operations
786 # in the defined interval.
787 #
788 # Since: 2.5
789 ##
790 { 'struct': 'BlockDeviceTimedStats',
791 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
792 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
793 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
794 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
795 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
796 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
797
798 ##
799 # @BlockDeviceStats:
800 #
801 # Statistics of a virtual block device or a block backing device.
802 #
803 # @rd_bytes: The number of bytes read by the device.
804 #
805 # @wr_bytes: The number of bytes written by the device.
806 #
807 # @unmap_bytes: The number of bytes unmapped by the device (Since 4.2)
808 #
809 # @rd_operations: The number of read operations performed by the device.
810 #
811 # @wr_operations: The number of write operations performed by the device.
812 #
813 # @flush_operations: The number of cache flush operations performed by the
814 # device (since 0.15)
815 #
816 # @unmap_operations: The number of unmap operations performed by the device
817 # (Since 4.2)
818 #
819 # @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15).
820 #
821 # @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15).
822 #
823 # @flush_total_time_ns: Total time spent on cache flushes in nanoseconds
824 # (since 0.15).
825 #
826 # @unmap_total_time_ns: Total time spent on unmap operations in nanoseconds
827 # (Since 4.2)
828 #
829 # @wr_highest_offset: The offset after the greatest byte written to the
830 # device. The intended use of this information is for
831 # growable sparse files (like qcow2) that are used on top
832 # of a physical device.
833 #
834 # @rd_merged: Number of read requests that have been merged into another
835 # request (Since 2.3).
836 #
837 # @wr_merged: Number of write requests that have been merged into another
838 # request (Since 2.3).
839 #
840 # @unmap_merged: Number of unmap requests that have been merged into another
841 # request (Since 4.2)
842 #
843 # @idle_time_ns: Time since the last I/O operation, in
844 # nanoseconds. If the field is absent it means that
845 # there haven't been any operations yet (Since 2.5).
846 #
847 # @failed_rd_operations: The number of failed read operations
848 # performed by the device (Since 2.5)
849 #
850 # @failed_wr_operations: The number of failed write operations
851 # performed by the device (Since 2.5)
852 #
853 # @failed_flush_operations: The number of failed flush operations
854 # performed by the device (Since 2.5)
855 #
856 # @failed_unmap_operations: The number of failed unmap operations performed
857 # by the device (Since 4.2)
858 #
859 # @invalid_rd_operations: The number of invalid read operations
860 # performed by the device (Since 2.5)
861 #
862 # @invalid_wr_operations: The number of invalid write operations
863 # performed by the device (Since 2.5)
864 #
865 # @invalid_flush_operations: The number of invalid flush operations
866 # performed by the device (Since 2.5)
867 #
868 # @invalid_unmap_operations: The number of invalid unmap operations performed
869 # by the device (Since 4.2)
870 #
871 # @account_invalid: Whether invalid operations are included in the
872 # last access statistics (Since 2.5)
873 #
874 # @account_failed: Whether failed operations are included in the
875 # latency and last access statistics (Since 2.5)
876 #
877 # @timed_stats: Statistics specific to the set of previously defined
878 # intervals of time (Since 2.5)
879 #
880 # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
881 #
882 # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
883 #
884 # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0)
885 #
886 # Since: 0.14
887 ##
888 { 'struct': 'BlockDeviceStats',
889 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int',
890 'rd_operations': 'int', 'wr_operations': 'int',
891 'flush_operations': 'int', 'unmap_operations': 'int',
892 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int',
893 'flush_total_time_ns': 'int', 'unmap_total_time_ns': 'int',
894 'wr_highest_offset': 'int',
895 'rd_merged': 'int', 'wr_merged': 'int', 'unmap_merged': 'int',
896 '*idle_time_ns': 'int',
897 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
898 'failed_flush_operations': 'int', 'failed_unmap_operations': 'int',
899 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int',
900 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int',
901 'account_invalid': 'bool', 'account_failed': 'bool',
902 'timed_stats': ['BlockDeviceTimedStats'],
903 '*rd_latency_histogram': 'BlockLatencyHistogramInfo',
904 '*wr_latency_histogram': 'BlockLatencyHistogramInfo',
905 '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } }
906
907 ##
908 # @BlockStatsSpecificFile:
909 #
910 # File driver statistics
911 #
912 # @discard-nb-ok: The number of successful discard operations performed by
913 # the driver.
914 #
915 # @discard-nb-failed: The number of failed discard operations performed by
916 # the driver.
917 #
918 # @discard-bytes-ok: The number of bytes discarded by the driver.
919 #
920 # Since: 4.2
921 ##
922 { 'struct': 'BlockStatsSpecificFile',
923 'data': {
924 'discard-nb-ok': 'uint64',
925 'discard-nb-failed': 'uint64',
926 'discard-bytes-ok': 'uint64' } }
927
928 ##
929 # @BlockStatsSpecificNvme:
930 #
931 # NVMe driver statistics
932 #
933 # @completion-errors: The number of completion errors.
934 #
935 # @aligned-accesses: The number of aligned accesses performed by
936 # the driver.
937 #
938 # @unaligned-accesses: The number of unaligned accesses performed by
939 # the driver.
940 #
941 # Since: 5.2
942 ##
943 { 'struct': 'BlockStatsSpecificNvme',
944 'data': {
945 'completion-errors': 'uint64',
946 'aligned-accesses': 'uint64',
947 'unaligned-accesses': 'uint64' } }
948
949 ##
950 # @BlockStatsSpecific:
951 #
952 # Block driver specific statistics
953 #
954 # Since: 4.2
955 ##
956 { 'union': 'BlockStatsSpecific',
957 'base': { 'driver': 'BlockdevDriver' },
958 'discriminator': 'driver',
959 'data': {
960 'file': 'BlockStatsSpecificFile',
961 'host_device': { 'type': 'BlockStatsSpecificFile',
962 'if': 'HAVE_HOST_BLOCK_DEVICE' },
963 'nvme': 'BlockStatsSpecificNvme' } }
964
965 ##
966 # @BlockStats:
967 #
968 # Statistics of a virtual block device or a block backing device.
969 #
970 # @device: If the stats are for a virtual block device, the name
971 # corresponding to the virtual block device.
972 #
973 # @node-name: The node name of the device. (Since 2.3)
974 #
975 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
976 # device. (since 3.0)
977 #
978 # @stats: A @BlockDeviceStats for the device.
979 #
980 # @driver-specific: Optional driver-specific stats. (Since 4.2)
981 #
982 # @parent: This describes the file block device if it has one.
983 # Contains recursively the statistics of the underlying
984 # protocol (e.g. the host file for a qcow2 image). If there is
985 # no underlying protocol, this field is omitted
986 #
987 # @backing: This describes the backing block device if it has one.
988 # (Since 2.0)
989 #
990 # Since: 0.14
991 ##
992 { 'struct': 'BlockStats',
993 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str',
994 'stats': 'BlockDeviceStats',
995 '*driver-specific': 'BlockStatsSpecific',
996 '*parent': 'BlockStats',
997 '*backing': 'BlockStats'} }
998
999 ##
1000 # @query-blockstats:
1001 #
1002 # Query the @BlockStats for all virtual block devices.
1003 #
1004 # @query-nodes: If true, the command will query all the block nodes
1005 # that have a node name, in a list which will include "parent"
1006 # information, but not "backing".
1007 # If false or omitted, the behavior is as before - query all the
1008 # device backends, recursively including their "parent" and
1009 # "backing". Filter nodes that were created implicitly are
1010 # skipped over in this mode. (Since 2.3)
1011 #
1012 # Returns: A list of @BlockStats for each virtual block devices.
1013 #
1014 # Since: 0.14
1015 #
1016 # Example:
1017 #
1018 # -> { "execute": "query-blockstats" }
1019 # <- {
1020 # "return":[
1021 # {
1022 # "device":"ide0-hd0",
1023 # "parent":{
1024 # "stats":{
1025 # "wr_highest_offset":3686448128,
1026 # "wr_bytes":9786368,
1027 # "wr_operations":751,
1028 # "rd_bytes":122567168,
1029 # "rd_operations":36772
1030 # "wr_total_times_ns":313253456
1031 # "rd_total_times_ns":3465673657
1032 # "flush_total_times_ns":49653
1033 # "flush_operations":61,
1034 # "rd_merged":0,
1035 # "wr_merged":0,
1036 # "idle_time_ns":2953431879,
1037 # "account_invalid":true,
1038 # "account_failed":false
1039 # }
1040 # },
1041 # "stats":{
1042 # "wr_highest_offset":2821110784,
1043 # "wr_bytes":9786368,
1044 # "wr_operations":692,
1045 # "rd_bytes":122739200,
1046 # "rd_operations":36604
1047 # "flush_operations":51,
1048 # "wr_total_times_ns":313253456
1049 # "rd_total_times_ns":3465673657
1050 # "flush_total_times_ns":49653,
1051 # "rd_merged":0,
1052 # "wr_merged":0,
1053 # "idle_time_ns":2953431879,
1054 # "account_invalid":true,
1055 # "account_failed":false
1056 # },
1057 # "qdev": "/machine/unattached/device[23]"
1058 # },
1059 # {
1060 # "device":"ide1-cd0",
1061 # "stats":{
1062 # "wr_highest_offset":0,
1063 # "wr_bytes":0,
1064 # "wr_operations":0,
1065 # "rd_bytes":0,
1066 # "rd_operations":0
1067 # "flush_operations":0,
1068 # "wr_total_times_ns":0
1069 # "rd_total_times_ns":0
1070 # "flush_total_times_ns":0,
1071 # "rd_merged":0,
1072 # "wr_merged":0,
1073 # "account_invalid":false,
1074 # "account_failed":false
1075 # },
1076 # "qdev": "/machine/unattached/device[24]"
1077 # },
1078 # {
1079 # "device":"floppy0",
1080 # "stats":{
1081 # "wr_highest_offset":0,
1082 # "wr_bytes":0,
1083 # "wr_operations":0,
1084 # "rd_bytes":0,
1085 # "rd_operations":0
1086 # "flush_operations":0,
1087 # "wr_total_times_ns":0
1088 # "rd_total_times_ns":0
1089 # "flush_total_times_ns":0,
1090 # "rd_merged":0,
1091 # "wr_merged":0,
1092 # "account_invalid":false,
1093 # "account_failed":false
1094 # },
1095 # "qdev": "/machine/unattached/device[16]"
1096 # },
1097 # {
1098 # "device":"sd0",
1099 # "stats":{
1100 # "wr_highest_offset":0,
1101 # "wr_bytes":0,
1102 # "wr_operations":0,
1103 # "rd_bytes":0,
1104 # "rd_operations":0
1105 # "flush_operations":0,
1106 # "wr_total_times_ns":0
1107 # "rd_total_times_ns":0
1108 # "flush_total_times_ns":0,
1109 # "rd_merged":0,
1110 # "wr_merged":0,
1111 # "account_invalid":false,
1112 # "account_failed":false
1113 # }
1114 # }
1115 # ]
1116 # }
1117 #
1118 ##
1119 { 'command': 'query-blockstats',
1120 'data': { '*query-nodes': 'bool' },
1121 'returns': ['BlockStats'] }
1122
1123 ##
1124 # @BlockdevOnError:
1125 #
1126 # An enumeration of possible behaviors for errors on I/O operations.
1127 # The exact meaning depends on whether the I/O was initiated by a guest
1128 # or by a block job
1129 #
1130 # @report: for guest operations, report the error to the guest;
1131 # for jobs, cancel the job
1132 #
1133 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1134 # or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs retry
1135 # the failing request later and may still complete successfully. The
1136 # stream block job continues to stream and will complete with an
1137 # error.
1138 #
1139 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1140 #
1141 # @stop: for guest operations, stop the virtual machine;
1142 # for jobs, pause the job
1143 #
1144 # @auto: inherit the error handling policy of the backend (since: 2.7)
1145 #
1146 # Since: 1.3
1147 ##
1148 { 'enum': 'BlockdevOnError',
1149 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
1150
1151 ##
1152 # @MirrorSyncMode:
1153 #
1154 # An enumeration of possible behaviors for the initial synchronization
1155 # phase of storage mirroring.
1156 #
1157 # @top: copies data in the topmost image to the destination
1158 #
1159 # @full: copies data from all images to the destination
1160 #
1161 # @none: only copy data written from now on
1162 #
1163 # @incremental: only copy data described by the dirty bitmap. (since: 2.4)
1164 #
1165 # @bitmap: only copy data described by the dirty bitmap. (since: 4.2)
1166 # Behavior on completion is determined by the BitmapSyncMode.
1167 #
1168 # Since: 1.3
1169 ##
1170 { 'enum': 'MirrorSyncMode',
1171 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
1172
1173 ##
1174 # @BitmapSyncMode:
1175 #
1176 # An enumeration of possible behaviors for the synchronization of a bitmap
1177 # when used for data copy operations.
1178 #
1179 # @on-success: The bitmap is only synced when the operation is successful.
1180 # This is the behavior always used for 'INCREMENTAL' backups.
1181 #
1182 # @never: The bitmap is never synchronized with the operation, and is
1183 # treated solely as a read-only manifest of blocks to copy.
1184 #
1185 # @always: The bitmap is always synchronized with the operation,
1186 # regardless of whether or not the operation was successful.
1187 #
1188 # Since: 4.2
1189 ##
1190 { 'enum': 'BitmapSyncMode',
1191 'data': ['on-success', 'never', 'always'] }
1192
1193 ##
1194 # @MirrorCopyMode:
1195 #
1196 # An enumeration whose values tell the mirror block job when to
1197 # trigger writes to the target.
1198 #
1199 # @background: copy data in background only.
1200 #
1201 # @write-blocking: when data is written to the source, write it
1202 # (synchronously) to the target as well. In
1203 # addition, data is copied in background just like in
1204 # @background mode.
1205 #
1206 # Since: 3.0
1207 ##
1208 { 'enum': 'MirrorCopyMode',
1209 'data': ['background', 'write-blocking'] }
1210
1211 ##
1212 # @BlockJobInfo:
1213 #
1214 # Information about a long-running block device operation.
1215 #
1216 # @type: the job type ('stream' for image streaming)
1217 #
1218 # @device: The job identifier. Originally the device name but other
1219 # values are allowed since QEMU 2.7
1220 #
1221 # @len: Estimated @offset value at the completion of the job. This value can
1222 # arbitrarily change while the job is running, in both directions.
1223 #
1224 # @offset: Progress made until now. The unit is arbitrary and the value can
1225 # only meaningfully be used for the ratio of @offset to @len. The
1226 # value is monotonically increasing.
1227 #
1228 # @busy: false if the job is known to be in a quiescent state, with
1229 # no pending I/O. Since 1.3.
1230 #
1231 # @paused: whether the job is paused or, if @busy is true, will
1232 # pause itself as soon as possible. Since 1.3.
1233 #
1234 # @speed: the rate limit, bytes per second
1235 #
1236 # @io-status: the status of the job (since 1.3)
1237 #
1238 # @ready: true if the job may be completed (since 2.2)
1239 #
1240 # @status: Current job state/status (since 2.12)
1241 #
1242 # @auto-finalize: Job will finalize itself when PENDING, moving to
1243 # the CONCLUDED state. (since 2.12)
1244 #
1245 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1246 # state and disappearing from the query list. (since 2.12)
1247 #
1248 # @error: Error information if the job did not complete successfully.
1249 # Not set if the job completed successfully. (since 2.12.1)
1250 #
1251 # Since: 1.1
1252 ##
1253 { 'struct': 'BlockJobInfo',
1254 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1255 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1256 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1257 'status': 'JobStatus',
1258 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1259 '*error': 'str' } }
1260
1261 ##
1262 # @query-block-jobs:
1263 #
1264 # Return information about long-running block device operations.
1265 #
1266 # Returns: a list of @BlockJobInfo for each active block job
1267 #
1268 # Since: 1.1
1269 ##
1270 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1271
1272 ##
1273 # @block_resize:
1274 #
1275 # Resize a block image while a guest is running.
1276 #
1277 # Either @device or @node-name must be set but not both.
1278 #
1279 # @device: the name of the device to get the image resized
1280 #
1281 # @node-name: graph node name to get the image resized (Since 2.0)
1282 #
1283 # @size: new image size in bytes
1284 #
1285 # Returns: - nothing on success
1286 # - If @device is not a valid block device, DeviceNotFound
1287 #
1288 # Since: 0.14
1289 #
1290 # Example:
1291 #
1292 # -> { "execute": "block_resize",
1293 # "arguments": { "device": "scratch", "size": 1073741824 } }
1294 # <- { "return": {} }
1295 #
1296 ##
1297 { 'command': 'block_resize',
1298 'data': { '*device': 'str',
1299 '*node-name': 'str',
1300 'size': 'int' },
1301 'coroutine': true }
1302
1303 ##
1304 # @NewImageMode:
1305 #
1306 # An enumeration that tells QEMU how to set the backing file path in
1307 # a new image file.
1308 #
1309 # @existing: QEMU should look for an existing image file.
1310 #
1311 # @absolute-paths: QEMU should create a new image with absolute paths
1312 # for the backing file. If there is no backing file available, the new
1313 # image will not be backed either.
1314 #
1315 # Since: 1.1
1316 ##
1317 { 'enum': 'NewImageMode',
1318 'data': [ 'existing', 'absolute-paths' ] }
1319
1320 ##
1321 # @BlockdevSnapshotSync:
1322 #
1323 # Either @device or @node-name must be set but not both.
1324 #
1325 # @device: the name of the device to take a snapshot of.
1326 #
1327 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1328 #
1329 # @snapshot-file: the target of the new overlay image. If the file
1330 # exists, or if it is a device, the overlay will be created in the
1331 # existing file/device. Otherwise, a new file will be created.
1332 #
1333 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1334 #
1335 # @format: the format of the overlay image, default is 'qcow2'.
1336 #
1337 # @mode: whether and how QEMU should create a new image, default is
1338 # 'absolute-paths'.
1339 ##
1340 { 'struct': 'BlockdevSnapshotSync',
1341 'data': { '*device': 'str', '*node-name': 'str',
1342 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1343 '*format': 'str', '*mode': 'NewImageMode' } }
1344
1345 ##
1346 # @BlockdevSnapshot:
1347 #
1348 # @node: device or node name that will have a snapshot taken.
1349 #
1350 # @overlay: reference to the existing block device that will become
1351 # the overlay of @node, as part of taking the snapshot.
1352 # It must not have a current backing file (this can be
1353 # achieved by passing "backing": null to blockdev-add).
1354 #
1355 # Since: 2.5
1356 ##
1357 { 'struct': 'BlockdevSnapshot',
1358 'data': { 'node': 'str', 'overlay': 'str' } }
1359
1360 ##
1361 # @BackupPerf:
1362 #
1363 # Optional parameters for backup. These parameters don't affect
1364 # functionality, but may significantly affect performance.
1365 #
1366 # @use-copy-range: Use copy offloading. Default false.
1367 #
1368 # @max-workers: Maximum number of parallel requests for the sustained background
1369 # copying process. Doesn't influence copy-before-write operations.
1370 # Default 64.
1371 #
1372 # @max-chunk: Maximum request length for the sustained background copying
1373 # process. Doesn't influence copy-before-write operations.
1374 # 0 means unlimited. If max-chunk is non-zero then it should not be
1375 # less than job cluster size which is calculated as maximum of
1376 # target image cluster size and 64k. Default 0.
1377 #
1378 # Since: 6.0
1379 ##
1380 { 'struct': 'BackupPerf',
1381 'data': { '*use-copy-range': 'bool',
1382 '*max-workers': 'int', '*max-chunk': 'int64' } }
1383
1384 ##
1385 # @BackupCommon:
1386 #
1387 # @job-id: identifier for the newly-created block job. If
1388 # omitted, the device name will be used. (Since 2.7)
1389 #
1390 # @device: the device name or node-name of a root node which should be copied.
1391 #
1392 # @sync: what parts of the disk image should be copied to the destination
1393 # (all the disk, only the sectors allocated in the topmost image, from a
1394 # dirty bitmap, or only new I/O).
1395 #
1396 # @speed: the maximum speed, in bytes per second. The default is 0,
1397 # for unlimited.
1398 #
1399 # @bitmap: The name of a dirty bitmap to use.
1400 # Must be present if sync is "bitmap" or "incremental".
1401 # Can be present if sync is "full" or "top".
1402 # Must not be present otherwise.
1403 # (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1404 #
1405 # @bitmap-mode: Specifies the type of data the bitmap should contain after
1406 # the operation concludes.
1407 # Must be present if a bitmap was provided,
1408 # Must NOT be present otherwise. (Since 4.2)
1409 #
1410 # @compress: true to compress data, if the target format supports it.
1411 # (default: false) (since 2.8)
1412 #
1413 # @on-source-error: the action to take on an error on the source,
1414 # default 'report'. 'stop' and 'enospc' can only be used
1415 # if the block device supports io-status (see BlockInfo).
1416 #
1417 # @on-target-error: the action to take on an error on the target,
1418 # default 'report' (no limitations, since this applies to
1419 # a different block device than @device).
1420 #
1421 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1422 # finished its work, waiting for @block-job-finalize before
1423 # making any block graph changes.
1424 # When true, this job will automatically
1425 # perform its abort or commit actions.
1426 # Defaults to true. (Since 2.12)
1427 #
1428 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1429 # has completely ceased all work, and awaits @block-job-dismiss.
1430 # When true, this job will automatically disappear from the query
1431 # list without user intervention.
1432 # Defaults to true. (Since 2.12)
1433 #
1434 # @filter-node-name: the node name that should be assigned to the
1435 # filter driver that the backup job inserts into the graph
1436 # above node specified by @drive. If this option is not given,
1437 # a node name is autogenerated. (Since: 4.2)
1438 #
1439 # @x-perf: Performance options. (Since 6.0)
1440 #
1441 # Features:
1442 # @unstable: Member @x-perf is experimental.
1443 #
1444 # Note: @on-source-error and @on-target-error only affect background
1445 # I/O. If an error occurs during a guest write request, the device's
1446 # rerror/werror actions will be used.
1447 #
1448 # Since: 4.2
1449 ##
1450 { 'struct': 'BackupCommon',
1451 'data': { '*job-id': 'str', 'device': 'str',
1452 'sync': 'MirrorSyncMode', '*speed': 'int',
1453 '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
1454 '*compress': 'bool',
1455 '*on-source-error': 'BlockdevOnError',
1456 '*on-target-error': 'BlockdevOnError',
1457 '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
1458 '*filter-node-name': 'str',
1459 '*x-perf': { 'type': 'BackupPerf',
1460 'features': [ 'unstable' ] } } }
1461
1462 ##
1463 # @DriveBackup:
1464 #
1465 # @target: the target of the new image. If the file exists, or if it
1466 # is a device, the existing file/device will be used as the new
1467 # destination. If it does not exist, a new file will be created.
1468 #
1469 # @format: the format of the new destination, default is to
1470 # probe if @mode is 'existing', else the format of the source
1471 #
1472 # @mode: whether and how QEMU should create a new image, default is
1473 # 'absolute-paths'.
1474 #
1475 # Since: 1.6
1476 ##
1477 { 'struct': 'DriveBackup',
1478 'base': 'BackupCommon',
1479 'data': { 'target': 'str',
1480 '*format': 'str',
1481 '*mode': 'NewImageMode' } }
1482
1483 ##
1484 # @BlockdevBackup:
1485 #
1486 # @target: the device name or node-name of the backup target node.
1487 #
1488 # Since: 2.3
1489 ##
1490 { 'struct': 'BlockdevBackup',
1491 'base': 'BackupCommon',
1492 'data': { 'target': 'str' } }
1493
1494 ##
1495 # @blockdev-snapshot-sync:
1496 #
1497 # Takes a synchronous snapshot of a block device.
1498 #
1499 # For the arguments, see the documentation of BlockdevSnapshotSync.
1500 #
1501 # Returns: - nothing on success
1502 # - If @device is not a valid block device, DeviceNotFound
1503 #
1504 # Since: 0.14
1505 #
1506 # Example:
1507 #
1508 # -> { "execute": "blockdev-snapshot-sync",
1509 # "arguments": { "device": "ide-hd0",
1510 # "snapshot-file":
1511 # "/some/place/my-image",
1512 # "format": "qcow2" } }
1513 # <- { "return": {} }
1514 #
1515 ##
1516 { 'command': 'blockdev-snapshot-sync',
1517 'data': 'BlockdevSnapshotSync' }
1518
1519
1520 ##
1521 # @blockdev-snapshot:
1522 #
1523 # Takes a snapshot of a block device.
1524 #
1525 # Take a snapshot, by installing 'node' as the backing image of
1526 # 'overlay'. Additionally, if 'node' is associated with a block
1527 # device, the block device changes to using 'overlay' as its new active
1528 # image.
1529 #
1530 # For the arguments, see the documentation of BlockdevSnapshot.
1531 #
1532 # Features:
1533 # @allow-write-only-overlay: If present, the check whether this operation is safe
1534 # was relaxed so that it can be used to change
1535 # backing file of a destination of a blockdev-mirror.
1536 # (since 5.0)
1537 #
1538 # Since: 2.5
1539 #
1540 # Example:
1541 #
1542 # -> { "execute": "blockdev-add",
1543 # "arguments": { "driver": "qcow2",
1544 # "node-name": "node1534",
1545 # "file": { "driver": "file",
1546 # "filename": "hd1.qcow2" },
1547 # "backing": null } }
1548 #
1549 # <- { "return": {} }
1550 #
1551 # -> { "execute": "blockdev-snapshot",
1552 # "arguments": { "node": "ide-hd0",
1553 # "overlay": "node1534" } }
1554 # <- { "return": {} }
1555 #
1556 ##
1557 { 'command': 'blockdev-snapshot',
1558 'data': 'BlockdevSnapshot',
1559 'features': [ 'allow-write-only-overlay' ] }
1560
1561 ##
1562 # @change-backing-file:
1563 #
1564 # Change the backing file in the image file metadata. This does not
1565 # cause QEMU to reopen the image file to reparse the backing filename
1566 # (it may, however, perform a reopen to change permissions from
1567 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1568 # into the image file metadata, and the QEMU internal strings are
1569 # updated.
1570 #
1571 # @image-node-name: The name of the block driver state node of the
1572 # image to modify. The "device" argument is used
1573 # to verify "image-node-name" is in the chain
1574 # described by "device".
1575 #
1576 # @device: The device name or node-name of the root node that owns
1577 # image-node-name.
1578 #
1579 # @backing-file: The string to write as the backing file. This
1580 # string is not validated, so care should be taken
1581 # when specifying the string or the image chain may
1582 # not be able to be reopened again.
1583 #
1584 # Returns: - Nothing on success
1585 # - If "device" does not exist or cannot be determined, DeviceNotFound
1586 #
1587 # Since: 2.1
1588 ##
1589 { 'command': 'change-backing-file',
1590 'data': { 'device': 'str', 'image-node-name': 'str',
1591 'backing-file': 'str' } }
1592
1593 ##
1594 # @block-commit:
1595 #
1596 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1597 # writes data between 'top' and 'base' into 'base'.
1598 #
1599 # If top == base, that is an error.
1600 # If top has no overlays on top of it, or if it is in use by a writer,
1601 # the job will not be completed by itself. The user needs to complete
1602 # the job with the block-job-complete command after getting the ready
1603 # event. (Since 2.0)
1604 #
1605 # If the base image is smaller than top, then the base image will be
1606 # resized to be the same size as top. If top is smaller than the base
1607 # image, the base will not be truncated. If you want the base image
1608 # size to match the size of the smaller top, you can safely truncate
1609 # it yourself once the commit operation successfully completes.
1610 #
1611 # @job-id: identifier for the newly-created block job. If
1612 # omitted, the device name will be used. (Since 2.7)
1613 #
1614 # @device: the device name or node-name of a root node
1615 #
1616 # @base-node: The node name of the backing image to write data into.
1617 # If not specified, this is the deepest backing image.
1618 # (since: 3.1)
1619 #
1620 # @base: Same as @base-node, except that it is a file name rather than a node
1621 # name. This must be the exact filename string that was used to open the
1622 # node; other strings, even if addressing the same file, are not
1623 # accepted
1624 #
1625 # @top-node: The node name of the backing image within the image chain
1626 # which contains the topmost data to be committed down. If
1627 # not specified, this is the active layer. (since: 3.1)
1628 #
1629 # @top: Same as @top-node, except that it is a file name rather than a node
1630 # name. This must be the exact filename string that was used to open the
1631 # node; other strings, even if addressing the same file, are not
1632 # accepted
1633 #
1634 # @backing-file: The backing file string to write into the overlay
1635 # image of 'top'. If 'top' does not have an overlay
1636 # image, or if 'top' is in use by a writer, specifying
1637 # a backing file string is an error.
1638 #
1639 # This filename is not validated. If a pathname string
1640 # is such that it cannot be resolved by QEMU, that
1641 # means that subsequent QMP or HMP commands must use
1642 # node-names for the image in question, as filename
1643 # lookup methods will fail.
1644 #
1645 # If not specified, QEMU will automatically determine
1646 # the backing file string to use, or error out if
1647 # there is no obvious choice. Care should be taken
1648 # when specifying the string, to specify a valid
1649 # filename or protocol.
1650 # (Since 2.1)
1651 #
1652 # @speed: the maximum speed, in bytes per second
1653 #
1654 # @on-error: the action to take on an error. 'ignore' means that the request
1655 # should be retried. (default: report; Since: 5.0)
1656 #
1657 # @filter-node-name: the node name that should be assigned to the
1658 # filter driver that the commit job inserts into the graph
1659 # above @top. If this option is not given, a node name is
1660 # autogenerated. (Since: 2.9)
1661 #
1662 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1663 # finished its work, waiting for @block-job-finalize before
1664 # making any block graph changes.
1665 # When true, this job will automatically
1666 # perform its abort or commit actions.
1667 # Defaults to true. (Since 3.1)
1668 #
1669 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1670 # has completely ceased all work, and awaits @block-job-dismiss.
1671 # When true, this job will automatically disappear from the query
1672 # list without user intervention.
1673 # Defaults to true. (Since 3.1)
1674 #
1675 # Features:
1676 # @deprecated: Members @base and @top are deprecated. Use @base-node
1677 # and @top-node instead.
1678 #
1679 # Returns: - Nothing on success
1680 # - If @device does not exist, DeviceNotFound
1681 # - Any other error returns a GenericError.
1682 #
1683 # Since: 1.3
1684 #
1685 # Example:
1686 #
1687 # -> { "execute": "block-commit",
1688 # "arguments": { "device": "virtio0",
1689 # "top": "/tmp/snap1.qcow2" } }
1690 # <- { "return": {} }
1691 #
1692 ##
1693 { 'command': 'block-commit',
1694 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1695 '*base': { 'type': 'str', 'features': [ 'deprecated' ] },
1696 '*top-node': 'str',
1697 '*top': { 'type': 'str', 'features': [ 'deprecated' ] },
1698 '*backing-file': 'str', '*speed': 'int',
1699 '*on-error': 'BlockdevOnError',
1700 '*filter-node-name': 'str',
1701 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1702
1703 ##
1704 # @drive-backup:
1705 #
1706 # Start a point-in-time copy of a block device to a new destination. The
1707 # status of ongoing drive-backup operations can be checked with
1708 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1709 # The operation can be stopped before it has completed using the
1710 # block-job-cancel command.
1711 #
1712 # Returns: - nothing on success
1713 # - If @device is not a valid block device, GenericError
1714 #
1715 # Since: 1.6
1716 #
1717 # Example:
1718 #
1719 # -> { "execute": "drive-backup",
1720 # "arguments": { "device": "drive0",
1721 # "sync": "full",
1722 # "target": "backup.img" } }
1723 # <- { "return": {} }
1724 #
1725 ##
1726 { 'command': 'drive-backup', 'boxed': true,
1727 'data': 'DriveBackup' }
1728
1729 ##
1730 # @blockdev-backup:
1731 #
1732 # Start a point-in-time copy of a block device to a new destination. The
1733 # status of ongoing blockdev-backup operations can be checked with
1734 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1735 # The operation can be stopped before it has completed using the
1736 # block-job-cancel command.
1737 #
1738 # Returns: - nothing on success
1739 # - If @device is not a valid block device, DeviceNotFound
1740 #
1741 # Since: 2.3
1742 #
1743 # Example:
1744 # -> { "execute": "blockdev-backup",
1745 # "arguments": { "device": "src-id",
1746 # "sync": "full",
1747 # "target": "tgt-id" } }
1748 # <- { "return": {} }
1749 #
1750 ##
1751 { 'command': 'blockdev-backup', 'boxed': true,
1752 'data': 'BlockdevBackup' }
1753
1754
1755 ##
1756 # @query-named-block-nodes:
1757 #
1758 # Get the named block driver list
1759 #
1760 # @flat: Omit the nested data about backing image ("backing-image" key) if true.
1761 # Default is false (Since 5.0)
1762 #
1763 # Returns: the list of BlockDeviceInfo
1764 #
1765 # Since: 2.0
1766 #
1767 # Example:
1768 #
1769 # -> { "execute": "query-named-block-nodes" }
1770 # <- { "return": [ { "ro":false,
1771 # "drv":"qcow2",
1772 # "encrypted":false,
1773 # "file":"disks/test.qcow2",
1774 # "node-name": "my-node",
1775 # "backing_file_depth":1,
1776 # "bps":1000000,
1777 # "bps_rd":0,
1778 # "bps_wr":0,
1779 # "iops":1000000,
1780 # "iops_rd":0,
1781 # "iops_wr":0,
1782 # "bps_max": 8000000,
1783 # "bps_rd_max": 0,
1784 # "bps_wr_max": 0,
1785 # "iops_max": 0,
1786 # "iops_rd_max": 0,
1787 # "iops_wr_max": 0,
1788 # "iops_size": 0,
1789 # "write_threshold": 0,
1790 # "image":{
1791 # "filename":"disks/test.qcow2",
1792 # "format":"qcow2",
1793 # "virtual-size":2048000,
1794 # "backing_file":"base.qcow2",
1795 # "full-backing-filename":"disks/base.qcow2",
1796 # "backing-filename-format":"qcow2",
1797 # "snapshots":[
1798 # {
1799 # "id": "1",
1800 # "name": "snapshot1",
1801 # "vm-state-size": 0,
1802 # "date-sec": 10000200,
1803 # "date-nsec": 12,
1804 # "vm-clock-sec": 206,
1805 # "vm-clock-nsec": 30
1806 # }
1807 # ],
1808 # "backing-image":{
1809 # "filename":"disks/base.qcow2",
1810 # "format":"qcow2",
1811 # "virtual-size":2048000
1812 # }
1813 # } } ] }
1814 #
1815 ##
1816 { 'command': 'query-named-block-nodes',
1817 'returns': [ 'BlockDeviceInfo' ],
1818 'data': { '*flat': 'bool' } }
1819
1820 ##
1821 # @XDbgBlockGraphNodeType:
1822 #
1823 # @block-backend: corresponds to BlockBackend
1824 #
1825 # @block-job: corresponds to BlockJob
1826 #
1827 # @block-driver: corresponds to BlockDriverState
1828 #
1829 # Since: 4.0
1830 ##
1831 { 'enum': 'XDbgBlockGraphNodeType',
1832 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1833
1834 ##
1835 # @XDbgBlockGraphNode:
1836 #
1837 # @id: Block graph node identifier. This @id is generated only for
1838 # x-debug-query-block-graph and does not relate to any other identifiers in
1839 # Qemu.
1840 #
1841 # @type: Type of graph node. Can be one of block-backend, block-job or
1842 # block-driver-state.
1843 #
1844 # @name: Human readable name of the node. Corresponds to node-name for
1845 # block-driver-state nodes; is not guaranteed to be unique in the whole
1846 # graph (with block-jobs and block-backends).
1847 #
1848 # Since: 4.0
1849 ##
1850 { 'struct': 'XDbgBlockGraphNode',
1851 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1852
1853 ##
1854 # @BlockPermission:
1855 #
1856 # Enum of base block permissions.
1857 #
1858 # @consistent-read: A user that has the "permission" of consistent reads is
1859 # guaranteed that their view of the contents of the block
1860 # device is complete and self-consistent, representing the
1861 # contents of a disk at a specific point.
1862 # For most block devices (including their backing files) this
1863 # is true, but the property cannot be maintained in a few
1864 # situations like for intermediate nodes of a commit block
1865 # job.
1866 #
1867 # @write: This permission is required to change the visible disk contents.
1868 #
1869 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1870 # both enough and required for writes to the block node when
1871 # the caller promises that the visible disk content doesn't
1872 # change.
1873 # As the BLK_PERM_WRITE permission is strictly stronger,
1874 # either is sufficient to perform an unchanging write.
1875 #
1876 # @resize: This permission is required to change the size of a block node.
1877 #
1878 # @graph-mod: This permission is required to change the node that this
1879 # BdrvChild points to.
1880 #
1881 # Since: 4.0
1882 ##
1883 { 'enum': 'BlockPermission',
1884 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
1885 'graph-mod' ] }
1886 ##
1887 # @XDbgBlockGraphEdge:
1888 #
1889 # Block Graph edge description for x-debug-query-block-graph.
1890 #
1891 # @parent: parent id
1892 #
1893 # @child: child id
1894 #
1895 # @name: name of the relation (examples are 'file' and 'backing')
1896 #
1897 # @perm: granted permissions for the parent operating on the child
1898 #
1899 # @shared-perm: permissions that can still be granted to other users of the
1900 # child while it is still attached to this parent
1901 #
1902 # Since: 4.0
1903 ##
1904 { 'struct': 'XDbgBlockGraphEdge',
1905 'data': { 'parent': 'uint64', 'child': 'uint64',
1906 'name': 'str', 'perm': [ 'BlockPermission' ],
1907 'shared-perm': [ 'BlockPermission' ] } }
1908
1909 ##
1910 # @XDbgBlockGraph:
1911 #
1912 # Block Graph - list of nodes and list of edges.
1913 #
1914 # Since: 4.0
1915 ##
1916 { 'struct': 'XDbgBlockGraph',
1917 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1918
1919 ##
1920 # @x-debug-query-block-graph:
1921 #
1922 # Get the block graph.
1923 #
1924 # Features:
1925 # @unstable: This command is meant for debugging.
1926 #
1927 # Since: 4.0
1928 ##
1929 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph',
1930 'features': [ 'unstable' ] }
1931
1932 ##
1933 # @drive-mirror:
1934 #
1935 # Start mirroring a block device's writes to a new destination. target
1936 # specifies the target of the new image. If the file exists, or if it
1937 # is a device, it will be used as the new destination for writes. If
1938 # it does not exist, a new file will be created. format specifies the
1939 # format of the mirror image, default is to probe if mode='existing',
1940 # else the format of the source.
1941 #
1942 # Returns: - nothing on success
1943 # - If @device is not a valid block device, GenericError
1944 #
1945 # Since: 1.3
1946 #
1947 # Example:
1948 #
1949 # -> { "execute": "drive-mirror",
1950 # "arguments": { "device": "ide-hd0",
1951 # "target": "/some/place/my-image",
1952 # "sync": "full",
1953 # "format": "qcow2" } }
1954 # <- { "return": {} }
1955 #
1956 ##
1957 { 'command': 'drive-mirror', 'boxed': true,
1958 'data': 'DriveMirror' }
1959
1960 ##
1961 # @DriveMirror:
1962 #
1963 # A set of parameters describing drive mirror setup.
1964 #
1965 # @job-id: identifier for the newly-created block job. If
1966 # omitted, the device name will be used. (Since 2.7)
1967 #
1968 # @device: the device name or node-name of a root node whose writes should be
1969 # mirrored.
1970 #
1971 # @target: the target of the new image. If the file exists, or if it
1972 # is a device, the existing file/device will be used as the new
1973 # destination. If it does not exist, a new file will be created.
1974 #
1975 # @format: the format of the new destination, default is to
1976 # probe if @mode is 'existing', else the format of the source
1977 #
1978 # @node-name: the new block driver state node name in the graph
1979 # (Since 2.1)
1980 #
1981 # @replaces: with sync=full graph node name to be replaced by the new
1982 # image when a whole image copy is done. This can be used to repair
1983 # broken Quorum files. By default, @device is replaced, although
1984 # implicitly created filters on it are kept. (Since 2.1)
1985 #
1986 # @mode: whether and how QEMU should create a new image, default is
1987 # 'absolute-paths'.
1988 #
1989 # @speed: the maximum speed, in bytes per second
1990 #
1991 # @sync: what parts of the disk image should be copied to the destination
1992 # (all the disk, only the sectors allocated in the topmost image, or
1993 # only new I/O).
1994 #
1995 # @granularity: granularity of the dirty bitmap, default is 64K
1996 # if the image format doesn't have clusters, 4K if the clusters
1997 # are smaller than that, else the cluster size. Must be a
1998 # power of 2 between 512 and 64M (since 1.4).
1999 #
2000 # @buf-size: maximum amount of data in flight from source to
2001 # target (since 1.4).
2002 #
2003 # @on-source-error: the action to take on an error on the source,
2004 # default 'report'. 'stop' and 'enospc' can only be used
2005 # if the block device supports io-status (see BlockInfo).
2006 #
2007 # @on-target-error: the action to take on an error on the target,
2008 # default 'report' (no limitations, since this applies to
2009 # a different block device than @device).
2010 # @unmap: Whether to try to unmap target sectors where source has
2011 # only zero. If true, and target unallocated sectors will read as zero,
2012 # target image sectors will be unmapped; otherwise, zeroes will be
2013 # written. Both will result in identical contents.
2014 # Default is true. (Since 2.4)
2015 #
2016 # @copy-mode: when to copy data to the destination; defaults to 'background'
2017 # (Since: 3.0)
2018 #
2019 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2020 # finished its work, waiting for @block-job-finalize before
2021 # making any block graph changes.
2022 # When true, this job will automatically
2023 # perform its abort or commit actions.
2024 # Defaults to true. (Since 3.1)
2025 #
2026 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2027 # has completely ceased all work, and awaits @block-job-dismiss.
2028 # When true, this job will automatically disappear from the query
2029 # list without user intervention.
2030 # Defaults to true. (Since 3.1)
2031 # Since: 1.3
2032 ##
2033 { 'struct': 'DriveMirror',
2034 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2035 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
2036 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2037 '*speed': 'int', '*granularity': 'uint32',
2038 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2039 '*on-target-error': 'BlockdevOnError',
2040 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
2041 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2042
2043 ##
2044 # @BlockDirtyBitmap:
2045 #
2046 # @node: name of device/node which the bitmap is tracking
2047 #
2048 # @name: name of the dirty bitmap
2049 #
2050 # Since: 2.4
2051 ##
2052 { 'struct': 'BlockDirtyBitmap',
2053 'data': { 'node': 'str', 'name': 'str' } }
2054
2055 ##
2056 # @BlockDirtyBitmapAdd:
2057 #
2058 # @node: name of device/node which the bitmap is tracking
2059 #
2060 # @name: name of the dirty bitmap (must be less than 1024 bytes)
2061 #
2062 # @granularity: the bitmap granularity, default is 64k for
2063 # block-dirty-bitmap-add
2064 #
2065 # @persistent: the bitmap is persistent, i.e. it will be saved to the
2066 # corresponding block device image file on its close. For now only
2067 # Qcow2 disks support persistent bitmaps. Default is false for
2068 # block-dirty-bitmap-add. (Since: 2.10)
2069 #
2070 # @disabled: the bitmap is created in the disabled state, which means that
2071 # it will not track drive changes. The bitmap may be enabled with
2072 # block-dirty-bitmap-enable. Default is false. (Since: 4.0)
2073 #
2074 # Since: 2.4
2075 ##
2076 { 'struct': 'BlockDirtyBitmapAdd',
2077 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
2078 '*persistent': 'bool', '*disabled': 'bool' } }
2079
2080 ##
2081 # @BlockDirtyBitmapMergeSource:
2082 #
2083 # @local: name of the bitmap, attached to the same node as target bitmap.
2084 #
2085 # @external: bitmap with specified node
2086 #
2087 # Since: 4.1
2088 ##
2089 { 'alternate': 'BlockDirtyBitmapMergeSource',
2090 'data': { 'local': 'str',
2091 'external': 'BlockDirtyBitmap' } }
2092
2093 ##
2094 # @BlockDirtyBitmapMerge:
2095 #
2096 # @node: name of device/node which the @target bitmap is tracking
2097 #
2098 # @target: name of the destination dirty bitmap
2099 #
2100 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully
2101 # specified BlockDirtyBitmap elements. The latter are supported
2102 # since 4.1.
2103 #
2104 # Since: 4.0
2105 ##
2106 { 'struct': 'BlockDirtyBitmapMerge',
2107 'data': { 'node': 'str', 'target': 'str',
2108 'bitmaps': ['BlockDirtyBitmapMergeSource'] } }
2109
2110 ##
2111 # @block-dirty-bitmap-add:
2112 #
2113 # Create a dirty bitmap with a name on the node, and start tracking the writes.
2114 #
2115 # Returns: - nothing on success
2116 # - If @node is not a valid block device or node, DeviceNotFound
2117 # - If @name is already taken, GenericError with an explanation
2118 #
2119 # Since: 2.4
2120 #
2121 # Example:
2122 #
2123 # -> { "execute": "block-dirty-bitmap-add",
2124 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2125 # <- { "return": {} }
2126 #
2127 ##
2128 { 'command': 'block-dirty-bitmap-add',
2129 'data': 'BlockDirtyBitmapAdd' }
2130
2131 ##
2132 # @block-dirty-bitmap-remove:
2133 #
2134 # Stop write tracking and remove the dirty bitmap that was created
2135 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2136 # storage too.
2137 #
2138 # Returns: - nothing on success
2139 # - If @node is not a valid block device or node, DeviceNotFound
2140 # - If @name is not found, GenericError with an explanation
2141 # - if @name is frozen by an operation, GenericError
2142 #
2143 # Since: 2.4
2144 #
2145 # Example:
2146 #
2147 # -> { "execute": "block-dirty-bitmap-remove",
2148 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2149 # <- { "return": {} }
2150 #
2151 ##
2152 { 'command': 'block-dirty-bitmap-remove',
2153 'data': 'BlockDirtyBitmap' }
2154
2155 ##
2156 # @block-dirty-bitmap-clear:
2157 #
2158 # Clear (reset) a dirty bitmap on the device, so that an incremental
2159 # backup from this point in time forward will only backup clusters
2160 # modified after this clear operation.
2161 #
2162 # Returns: - nothing on success
2163 # - If @node is not a valid block device, DeviceNotFound
2164 # - If @name is not found, GenericError with an explanation
2165 #
2166 # Since: 2.4
2167 #
2168 # Example:
2169 #
2170 # -> { "execute": "block-dirty-bitmap-clear",
2171 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2172 # <- { "return": {} }
2173 #
2174 ##
2175 { 'command': 'block-dirty-bitmap-clear',
2176 'data': 'BlockDirtyBitmap' }
2177
2178 ##
2179 # @block-dirty-bitmap-enable:
2180 #
2181 # Enables a dirty bitmap so that it will begin tracking disk changes.
2182 #
2183 # Returns: - nothing on success
2184 # - If @node is not a valid block device, DeviceNotFound
2185 # - If @name is not found, GenericError with an explanation
2186 #
2187 # Since: 4.0
2188 #
2189 # Example:
2190 #
2191 # -> { "execute": "block-dirty-bitmap-enable",
2192 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2193 # <- { "return": {} }
2194 #
2195 ##
2196 { 'command': 'block-dirty-bitmap-enable',
2197 'data': 'BlockDirtyBitmap' }
2198
2199 ##
2200 # @block-dirty-bitmap-disable:
2201 #
2202 # Disables a dirty bitmap so that it will stop tracking disk changes.
2203 #
2204 # Returns: - nothing on success
2205 # - If @node is not a valid block device, DeviceNotFound
2206 # - If @name is not found, GenericError with an explanation
2207 #
2208 # Since: 4.0
2209 #
2210 # Example:
2211 #
2212 # -> { "execute": "block-dirty-bitmap-disable",
2213 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2214 # <- { "return": {} }
2215 #
2216 ##
2217 { 'command': 'block-dirty-bitmap-disable',
2218 'data': 'BlockDirtyBitmap' }
2219
2220 ##
2221 # @block-dirty-bitmap-merge:
2222 #
2223 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2224 # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2225 # as the @target bitmap. Any bits already set in @target will still be
2226 # set after the merge, i.e., this operation does not clear the target.
2227 # On error, @target is unchanged.
2228 #
2229 # The resulting bitmap will count as dirty any clusters that were dirty in any
2230 # of the source bitmaps. This can be used to achieve backup checkpoints, or in
2231 # simpler usages, to copy bitmaps.
2232 #
2233 # Returns: - nothing on success
2234 # - If @node is not a valid block device, DeviceNotFound
2235 # - If any bitmap in @bitmaps or @target is not found, GenericError
2236 # - If any of the bitmaps have different sizes or granularities,
2237 # GenericError
2238 #
2239 # Since: 4.0
2240 #
2241 # Example:
2242 #
2243 # -> { "execute": "block-dirty-bitmap-merge",
2244 # "arguments": { "node": "drive0", "target": "bitmap0",
2245 # "bitmaps": ["bitmap1"] } }
2246 # <- { "return": {} }
2247 #
2248 ##
2249 { 'command': 'block-dirty-bitmap-merge',
2250 'data': 'BlockDirtyBitmapMerge' }
2251
2252 ##
2253 # @BlockDirtyBitmapSha256:
2254 #
2255 # SHA256 hash of dirty bitmap data
2256 #
2257 # @sha256: ASCII representation of SHA256 bitmap hash
2258 #
2259 # Since: 2.10
2260 ##
2261 { 'struct': 'BlockDirtyBitmapSha256',
2262 'data': {'sha256': 'str'} }
2263
2264 ##
2265 # @x-debug-block-dirty-bitmap-sha256:
2266 #
2267 # Get bitmap SHA256.
2268 #
2269 # Features:
2270 # @unstable: This command is meant for debugging.
2271 #
2272 # Returns: - BlockDirtyBitmapSha256 on success
2273 # - If @node is not a valid block device, DeviceNotFound
2274 # - If @name is not found or if hashing has failed, GenericError with an
2275 # explanation
2276 #
2277 # Since: 2.10
2278 ##
2279 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2280 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256',
2281 'features': [ 'unstable' ] }
2282
2283 ##
2284 # @blockdev-mirror:
2285 #
2286 # Start mirroring a block device's writes to a new destination.
2287 #
2288 # @job-id: identifier for the newly-created block job. If
2289 # omitted, the device name will be used. (Since 2.7)
2290 #
2291 # @device: The device name or node-name of a root node whose writes should be
2292 # mirrored.
2293 #
2294 # @target: the id or node-name of the block device to mirror to. This mustn't be
2295 # attached to guest.
2296 #
2297 # @replaces: with sync=full graph node name to be replaced by the new
2298 # image when a whole image copy is done. This can be used to repair
2299 # broken Quorum files. By default, @device is replaced, although
2300 # implicitly created filters on it are kept.
2301 #
2302 # @speed: the maximum speed, in bytes per second
2303 #
2304 # @sync: what parts of the disk image should be copied to the destination
2305 # (all the disk, only the sectors allocated in the topmost image, or
2306 # only new I/O).
2307 #
2308 # @granularity: granularity of the dirty bitmap, default is 64K
2309 # if the image format doesn't have clusters, 4K if the clusters
2310 # are smaller than that, else the cluster size. Must be a
2311 # power of 2 between 512 and 64M
2312 #
2313 # @buf-size: maximum amount of data in flight from source to
2314 # target
2315 #
2316 # @on-source-error: the action to take on an error on the source,
2317 # default 'report'. 'stop' and 'enospc' can only be used
2318 # if the block device supports io-status (see BlockInfo).
2319 #
2320 # @on-target-error: the action to take on an error on the target,
2321 # default 'report' (no limitations, since this applies to
2322 # a different block device than @device).
2323 #
2324 # @filter-node-name: the node name that should be assigned to the
2325 # filter driver that the mirror job inserts into the graph
2326 # above @device. If this option is not given, a node name is
2327 # autogenerated. (Since: 2.9)
2328 #
2329 # @copy-mode: when to copy data to the destination; defaults to 'background'
2330 # (Since: 3.0)
2331 #
2332 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2333 # finished its work, waiting for @block-job-finalize before
2334 # making any block graph changes.
2335 # When true, this job will automatically
2336 # perform its abort or commit actions.
2337 # Defaults to true. (Since 3.1)
2338 #
2339 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2340 # has completely ceased all work, and awaits @block-job-dismiss.
2341 # When true, this job will automatically disappear from the query
2342 # list without user intervention.
2343 # Defaults to true. (Since 3.1)
2344 # Returns: nothing on success.
2345 #
2346 # Since: 2.6
2347 #
2348 # Example:
2349 #
2350 # -> { "execute": "blockdev-mirror",
2351 # "arguments": { "device": "ide-hd0",
2352 # "target": "target0",
2353 # "sync": "full" } }
2354 # <- { "return": {} }
2355 #
2356 ##
2357 { 'command': 'blockdev-mirror',
2358 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2359 '*replaces': 'str',
2360 'sync': 'MirrorSyncMode',
2361 '*speed': 'int', '*granularity': 'uint32',
2362 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2363 '*on-target-error': 'BlockdevOnError',
2364 '*filter-node-name': 'str',
2365 '*copy-mode': 'MirrorCopyMode',
2366 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2367
2368 ##
2369 # @BlockIOThrottle:
2370 #
2371 # A set of parameters describing block throttling.
2372 #
2373 # @device: Block device name
2374 #
2375 # @id: The name or QOM path of the guest device (since: 2.8)
2376 #
2377 # @bps: total throughput limit in bytes per second
2378 #
2379 # @bps_rd: read throughput limit in bytes per second
2380 #
2381 # @bps_wr: write throughput limit in bytes per second
2382 #
2383 # @iops: total I/O operations per second
2384 #
2385 # @iops_rd: read I/O operations per second
2386 #
2387 # @iops_wr: write I/O operations per second
2388 #
2389 # @bps_max: total throughput limit during bursts,
2390 # in bytes (Since 1.7)
2391 #
2392 # @bps_rd_max: read throughput limit during bursts,
2393 # in bytes (Since 1.7)
2394 #
2395 # @bps_wr_max: write throughput limit during bursts,
2396 # in bytes (Since 1.7)
2397 #
2398 # @iops_max: total I/O operations per second during bursts,
2399 # in bytes (Since 1.7)
2400 #
2401 # @iops_rd_max: read I/O operations per second during bursts,
2402 # in bytes (Since 1.7)
2403 #
2404 # @iops_wr_max: write I/O operations per second during bursts,
2405 # in bytes (Since 1.7)
2406 #
2407 # @bps_max_length: maximum length of the @bps_max burst
2408 # period, in seconds. It must only
2409 # be set if @bps_max is set as well.
2410 # Defaults to 1. (Since 2.6)
2411 #
2412 # @bps_rd_max_length: maximum length of the @bps_rd_max
2413 # burst period, in seconds. It must only
2414 # be set if @bps_rd_max is set as well.
2415 # Defaults to 1. (Since 2.6)
2416 #
2417 # @bps_wr_max_length: maximum length of the @bps_wr_max
2418 # burst period, in seconds. It must only
2419 # be set if @bps_wr_max is set as well.
2420 # Defaults to 1. (Since 2.6)
2421 #
2422 # @iops_max_length: maximum length of the @iops burst
2423 # period, in seconds. It must only
2424 # be set if @iops_max is set as well.
2425 # Defaults to 1. (Since 2.6)
2426 #
2427 # @iops_rd_max_length: maximum length of the @iops_rd_max
2428 # burst period, in seconds. It must only
2429 # be set if @iops_rd_max is set as well.
2430 # Defaults to 1. (Since 2.6)
2431 #
2432 # @iops_wr_max_length: maximum length of the @iops_wr_max
2433 # burst period, in seconds. It must only
2434 # be set if @iops_wr_max is set as well.
2435 # Defaults to 1. (Since 2.6)
2436 #
2437 # @iops_size: an I/O size in bytes (Since 1.7)
2438 #
2439 # @group: throttle group name (Since 2.4)
2440 #
2441 # Features:
2442 # @deprecated: Member @device is deprecated. Use @id instead.
2443 #
2444 # Since: 1.1
2445 ##
2446 { 'struct': 'BlockIOThrottle',
2447 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
2448 '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2449 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2450 '*bps_max': 'int', '*bps_rd_max': 'int',
2451 '*bps_wr_max': 'int', '*iops_max': 'int',
2452 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2453 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2454 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2455 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2456 '*iops_size': 'int', '*group': 'str' } }
2457
2458 ##
2459 # @ThrottleLimits:
2460 #
2461 # Limit parameters for throttling.
2462 # Since some limit combinations are illegal, limits should always be set in one
2463 # transaction. All fields are optional. When setting limits, if a field is
2464 # missing the current value is not changed.
2465 #
2466 # @iops-total: limit total I/O operations per second
2467 # @iops-total-max: I/O operations burst
2468 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2469 # It must only be set if @iops-total-max is set as well.
2470 # @iops-read: limit read operations per second
2471 # @iops-read-max: I/O operations read burst
2472 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2473 # It must only be set if @iops-read-max is set as well.
2474 # @iops-write: limit write operations per second
2475 # @iops-write-max: I/O operations write burst
2476 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2477 # It must only be set if @iops-write-max is set as well.
2478 # @bps-total: limit total bytes per second
2479 # @bps-total-max: total bytes burst
2480 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2481 # It must only be set if @bps-total-max is set as well.
2482 # @bps-read: limit read bytes per second
2483 # @bps-read-max: total bytes read burst
2484 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2485 # It must only be set if @bps-read-max is set as well.
2486 # @bps-write: limit write bytes per second
2487 # @bps-write-max: total bytes write burst
2488 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2489 # It must only be set if @bps-write-max is set as well.
2490 # @iops-size: when limiting by iops max size of an I/O in bytes
2491 #
2492 # Since: 2.11
2493 ##
2494 { 'struct': 'ThrottleLimits',
2495 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2496 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2497 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2498 '*iops-write' : 'int', '*iops-write-max' : 'int',
2499 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2500 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2501 '*bps-read' : 'int', '*bps-read-max' : 'int',
2502 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2503 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2504 '*iops-size' : 'int' } }
2505
2506 ##
2507 # @ThrottleGroupProperties:
2508 #
2509 # Properties for throttle-group objects.
2510 #
2511 # @limits: limits to apply for this throttle group
2512 #
2513 # Features:
2514 # @unstable: All members starting with x- are aliases for the same key
2515 # without x- in the @limits object. This is not a stable
2516 # interface and may be removed or changed incompatibly in
2517 # the future. Use @limits for a supported stable
2518 # interface.
2519 #
2520 # Since: 2.11
2521 ##
2522 { 'struct': 'ThrottleGroupProperties',
2523 'data': { '*limits': 'ThrottleLimits',
2524 '*x-iops-total': { 'type': 'int',
2525 'features': [ 'unstable' ] },
2526 '*x-iops-total-max': { 'type': 'int',
2527 'features': [ 'unstable' ] },
2528 '*x-iops-total-max-length': { 'type': 'int',
2529 'features': [ 'unstable' ] },
2530 '*x-iops-read': { 'type': 'int',
2531 'features': [ 'unstable' ] },
2532 '*x-iops-read-max': { 'type': 'int',
2533 'features': [ 'unstable' ] },
2534 '*x-iops-read-max-length': { 'type': 'int',
2535 'features': [ 'unstable' ] },
2536 '*x-iops-write': { 'type': 'int',
2537 'features': [ 'unstable' ] },
2538 '*x-iops-write-max': { 'type': 'int',
2539 'features': [ 'unstable' ] },
2540 '*x-iops-write-max-length': { 'type': 'int',
2541 'features': [ 'unstable' ] },
2542 '*x-bps-total': { 'type': 'int',
2543 'features': [ 'unstable' ] },
2544 '*x-bps-total-max': { 'type': 'int',
2545 'features': [ 'unstable' ] },
2546 '*x-bps-total-max-length': { 'type': 'int',
2547 'features': [ 'unstable' ] },
2548 '*x-bps-read': { 'type': 'int',
2549 'features': [ 'unstable' ] },
2550 '*x-bps-read-max': { 'type': 'int',
2551 'features': [ 'unstable' ] },
2552 '*x-bps-read-max-length': { 'type': 'int',
2553 'features': [ 'unstable' ] },
2554 '*x-bps-write': { 'type': 'int',
2555 'features': [ 'unstable' ] },
2556 '*x-bps-write-max': { 'type': 'int',
2557 'features': [ 'unstable' ] },
2558 '*x-bps-write-max-length': { 'type': 'int',
2559 'features': [ 'unstable' ] },
2560 '*x-iops-size': { 'type': 'int',
2561 'features': [ 'unstable' ] } } }
2562
2563 ##
2564 # @block-stream:
2565 #
2566 # Copy data from a backing file into a block device.
2567 #
2568 # The block streaming operation is performed in the background until the entire
2569 # backing file has been copied. This command returns immediately once streaming
2570 # has started. The status of ongoing block streaming operations can be checked
2571 # with query-block-jobs. The operation can be stopped before it has completed
2572 # using the block-job-cancel command.
2573 #
2574 # The node that receives the data is called the top image, can be located in
2575 # any part of the chain (but always above the base image; see below) and can be
2576 # specified using its device or node name. Earlier qemu versions only allowed
2577 # 'device' to name the top level node; presence of the 'base-node' parameter
2578 # during introspection can be used as a witness of the enhanced semantics
2579 # of 'device'.
2580 #
2581 # If a base file is specified then sectors are not copied from that base file and
2582 # its backing chain. This can be used to stream a subset of the backing file
2583 # chain instead of flattening the entire image.
2584 # When streaming completes the image file will have the base file as its backing
2585 # file, unless that node was changed while the job was running. In that case,
2586 # base's parent's backing (or filtered, whichever exists) child (i.e., base at
2587 # the beginning of the job) will be the new backing file.
2588 #
2589 # On successful completion the image file is updated to drop the backing file
2590 # and the BLOCK_JOB_COMPLETED event is emitted.
2591 #
2592 # In case @device is a filter node, block-stream modifies the first non-filter
2593 # overlay node below it to point to the new backing node instead of modifying
2594 # @device itself.
2595 #
2596 # @job-id: identifier for the newly-created block job. If
2597 # omitted, the device name will be used. (Since 2.7)
2598 #
2599 # @device: the device or node name of the top image
2600 #
2601 # @base: the common backing file name.
2602 # It cannot be set if @base-node or @bottom is also set.
2603 #
2604 # @base-node: the node name of the backing file.
2605 # It cannot be set if @base or @bottom is also set. (Since 2.8)
2606 #
2607 # @bottom: the last node in the chain that should be streamed into
2608 # top. It cannot be set if @base or @base-node is also set.
2609 # It cannot be filter node. (Since 6.0)
2610 #
2611 # @backing-file: The backing file string to write into the top
2612 # image. This filename is not validated.
2613 #
2614 # If a pathname string is such that it cannot be
2615 # resolved by QEMU, that means that subsequent QMP or
2616 # HMP commands must use node-names for the image in
2617 # question, as filename lookup methods will fail.
2618 #
2619 # If not specified, QEMU will automatically determine
2620 # the backing file string to use, or error out if there
2621 # is no obvious choice. Care should be taken when
2622 # specifying the string, to specify a valid filename or
2623 # protocol.
2624 # (Since 2.1)
2625 #
2626 # @speed: the maximum speed, in bytes per second
2627 #
2628 # @on-error: the action to take on an error (default report).
2629 # 'stop' and 'enospc' can only be used if the block device
2630 # supports io-status (see BlockInfo). Since 1.3.
2631 #
2632 # @filter-node-name: the node name that should be assigned to the
2633 # filter driver that the stream job inserts into the graph
2634 # above @device. If this option is not given, a node name is
2635 # autogenerated. (Since: 6.0)
2636 #
2637 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2638 # finished its work, waiting for @block-job-finalize before
2639 # making any block graph changes.
2640 # When true, this job will automatically
2641 # perform its abort or commit actions.
2642 # Defaults to true. (Since 3.1)
2643 #
2644 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2645 # has completely ceased all work, and awaits @block-job-dismiss.
2646 # When true, this job will automatically disappear from the query
2647 # list without user intervention.
2648 # Defaults to true. (Since 3.1)
2649 #
2650 # Returns: - Nothing on success.
2651 # - If @device does not exist, DeviceNotFound.
2652 #
2653 # Since: 1.1
2654 #
2655 # Example:
2656 #
2657 # -> { "execute": "block-stream",
2658 # "arguments": { "device": "virtio0",
2659 # "base": "/tmp/master.qcow2" } }
2660 # <- { "return": {} }
2661 #
2662 ##
2663 { 'command': 'block-stream',
2664 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2665 '*base-node': 'str', '*backing-file': 'str', '*bottom': 'str',
2666 '*speed': 'int', '*on-error': 'BlockdevOnError',
2667 '*filter-node-name': 'str',
2668 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2669
2670 ##
2671 # @block-job-set-speed:
2672 #
2673 # Set maximum speed for a background block operation.
2674 #
2675 # This command can only be issued when there is an active block job.
2676 #
2677 # Throttling can be disabled by setting the speed to 0.
2678 #
2679 # @device: The job identifier. This used to be a device name (hence
2680 # the name of the parameter), but since QEMU 2.7 it can have
2681 # other values.
2682 #
2683 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2684 # Defaults to 0.
2685 #
2686 # Returns: - Nothing on success
2687 # - If no background operation is active on this device, DeviceNotActive
2688 #
2689 # Since: 1.1
2690 ##
2691 { 'command': 'block-job-set-speed',
2692 'data': { 'device': 'str', 'speed': 'int' } }
2693
2694 ##
2695 # @block-job-cancel:
2696 #
2697 # Stop an active background block operation.
2698 #
2699 # This command returns immediately after marking the active background block
2700 # operation for cancellation. It is an error to call this command if no
2701 # operation is in progress.
2702 #
2703 # The operation will cancel as soon as possible and then emit the
2704 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2705 # enumerated using query-block-jobs.
2706 #
2707 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2708 # (via the event BLOCK_JOB_READY) that the source and destination are
2709 # synchronized, then the event triggered by this command changes to
2710 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2711 # destination now has a point-in-time copy tied to the time of the cancellation.
2712 #
2713 # For streaming, the image file retains its backing file unless the streaming
2714 # operation happens to complete just as it is being cancelled. A new streaming
2715 # operation can be started at a later time to finish copying all data from the
2716 # backing file.
2717 #
2718 # @device: The job identifier. This used to be a device name (hence
2719 # the name of the parameter), but since QEMU 2.7 it can have
2720 # other values.
2721 #
2722 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2723 # abandon the job immediately (even if it is paused) instead of waiting
2724 # for the destination to complete its final synchronization (since 1.3)
2725 #
2726 # Returns: - Nothing on success
2727 # - If no background operation is active on this device, DeviceNotActive
2728 #
2729 # Since: 1.1
2730 ##
2731 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2732
2733 ##
2734 # @block-job-pause:
2735 #
2736 # Pause an active background block operation.
2737 #
2738 # This command returns immediately after marking the active background block
2739 # operation for pausing. It is an error to call this command if no
2740 # operation is in progress or if the job is already paused.
2741 #
2742 # The operation will pause as soon as possible. No event is emitted when
2743 # the operation is actually paused. Cancelling a paused job automatically
2744 # resumes it.
2745 #
2746 # @device: The job identifier. This used to be a device name (hence
2747 # the name of the parameter), but since QEMU 2.7 it can have
2748 # other values.
2749 #
2750 # Returns: - Nothing on success
2751 # - If no background operation is active on this device, DeviceNotActive
2752 #
2753 # Since: 1.3
2754 ##
2755 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2756
2757 ##
2758 # @block-job-resume:
2759 #
2760 # Resume an active background block operation.
2761 #
2762 # This command returns immediately after resuming a paused background block
2763 # operation. It is an error to call this command if no operation is in
2764 # progress or if the job is not paused.
2765 #
2766 # This command also clears the error status of the job.
2767 #
2768 # @device: The job identifier. This used to be a device name (hence
2769 # the name of the parameter), but since QEMU 2.7 it can have
2770 # other values.
2771 #
2772 # Returns: - Nothing on success
2773 # - If no background operation is active on this device, DeviceNotActive
2774 #
2775 # Since: 1.3
2776 ##
2777 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2778
2779 ##
2780 # @block-job-complete:
2781 #
2782 # Manually trigger completion of an active background block operation. This
2783 # is supported for drive mirroring, where it also switches the device to
2784 # write to the target path only. The ability to complete is signaled with
2785 # a BLOCK_JOB_READY event.
2786 #
2787 # This command completes an active background block operation synchronously.
2788 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2789 # is not defined. Note that if an I/O error occurs during the processing of
2790 # this command: 1) the command itself will fail; 2) the error will be processed
2791 # according to the rerror/werror arguments that were specified when starting
2792 # the operation.
2793 #
2794 # A cancelled or paused job cannot be completed.
2795 #
2796 # @device: The job identifier. This used to be a device name (hence
2797 # the name of the parameter), but since QEMU 2.7 it can have
2798 # other values.
2799 #
2800 # Returns: - Nothing on success
2801 # - If no background operation is active on this device, DeviceNotActive
2802 #
2803 # Since: 1.3
2804 ##
2805 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2806
2807 ##
2808 # @block-job-dismiss:
2809 #
2810 # For jobs that have already concluded, remove them from the block-job-query
2811 # list. This command only needs to be run for jobs which were started with
2812 # QEMU 2.12+ job lifetime management semantics.
2813 #
2814 # This command will refuse to operate on any job that has not yet reached
2815 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2816 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2817 # to be used as appropriate.
2818 #
2819 # @id: The job identifier.
2820 #
2821 # Returns: Nothing on success
2822 #
2823 # Since: 2.12
2824 ##
2825 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2826
2827 ##
2828 # @block-job-finalize:
2829 #
2830 # Once a job that has manual=true reaches the pending state, it can be
2831 # instructed to finalize any graph changes and do any necessary cleanup
2832 # via this command.
2833 # For jobs in a transaction, instructing one job to finalize will force
2834 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2835 # a single member job to finalize.
2836 #
2837 # @id: The job identifier.
2838 #
2839 # Returns: Nothing on success
2840 #
2841 # Since: 2.12
2842 ##
2843 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2844
2845 ##
2846 # @BlockdevDiscardOptions:
2847 #
2848 # Determines how to handle discard requests.
2849 #
2850 # @ignore: Ignore the request
2851 # @unmap: Forward as an unmap request
2852 #
2853 # Since: 2.9
2854 ##
2855 { 'enum': 'BlockdevDiscardOptions',
2856 'data': [ 'ignore', 'unmap' ] }
2857
2858 ##
2859 # @BlockdevDetectZeroesOptions:
2860 #
2861 # Describes the operation mode for the automatic conversion of plain
2862 # zero writes by the OS to driver specific optimized zero write commands.
2863 #
2864 # @off: Disabled (default)
2865 # @on: Enabled
2866 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2867 # also that @BlockdevDiscardOptions is set to unmap for this device.
2868 #
2869 # Since: 2.1
2870 ##
2871 { 'enum': 'BlockdevDetectZeroesOptions',
2872 'data': [ 'off', 'on', 'unmap' ] }
2873
2874 ##
2875 # @BlockdevAioOptions:
2876 #
2877 # Selects the AIO backend to handle I/O requests
2878 #
2879 # @threads: Use qemu's thread pool
2880 # @native: Use native AIO backend (only Linux and Windows)
2881 # @io_uring: Use linux io_uring (since 5.0)
2882 #
2883 # Since: 2.9
2884 ##
2885 { 'enum': 'BlockdevAioOptions',
2886 'data': [ 'threads', 'native',
2887 { 'name': 'io_uring', 'if': 'CONFIG_LINUX_IO_URING' } ] }
2888
2889 ##
2890 # @BlockdevCacheOptions:
2891 #
2892 # Includes cache-related options for block devices
2893 #
2894 # @direct: enables use of O_DIRECT (bypass the host page cache;
2895 # default: false)
2896 # @no-flush: ignore any flush requests for the device (default:
2897 # false)
2898 #
2899 # Since: 2.9
2900 ##
2901 { 'struct': 'BlockdevCacheOptions',
2902 'data': { '*direct': 'bool',
2903 '*no-flush': 'bool' } }
2904
2905 ##
2906 # @BlockdevDriver:
2907 #
2908 # Drivers that are supported in block device operations.
2909 #
2910 # @throttle: Since 2.11
2911 # @nvme: Since 2.12
2912 # @copy-on-read: Since 3.0
2913 # @blklogwrites: Since 3.0
2914 # @blkreplay: Since 4.2
2915 # @compress: Since 5.0
2916 # @copy-before-write: Since 6.2
2917 #
2918 # Since: 2.9
2919 ##
2920 { 'enum': 'BlockdevDriver',
2921 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
2922 'cloop', 'compress', 'copy-before-write', 'copy-on-read', 'dmg',
2923 'file', 'ftp', 'ftps', 'gluster',
2924 {'name': 'host_cdrom', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
2925 {'name': 'host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
2926 'http', 'https', 'iscsi',
2927 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
2928 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
2929 { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
2930 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
2931
2932 ##
2933 # @BlockdevOptionsFile:
2934 #
2935 # Driver specific block device options for the file backend.
2936 #
2937 # @filename: path to the image file
2938 # @pr-manager: the id for the object that will handle persistent reservations
2939 # for this device (default: none, forward the commands via SG_IO;
2940 # since 2.11)
2941 # @aio: AIO backend (default: threads) (since: 2.8)
2942 # @aio-max-batch: maximum number of requests to batch together into a single
2943 # submission in the AIO backend. The smallest value between
2944 # this and the aio-max-batch value of the IOThread object is
2945 # chosen.
2946 # 0 means that the AIO backend will handle it automatically.
2947 # (default: 0, since 6.2)
2948 # @locking: whether to enable file locking. If set to 'auto', only enable
2949 # when Open File Descriptor (OFD) locking API is available
2950 # (default: auto, since 2.10)
2951 # @drop-cache: invalidate page cache during live migration. This prevents
2952 # stale data on the migration destination with cache.direct=off.
2953 # Currently only supported on Linux hosts.
2954 # (default: on, since: 4.0)
2955 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2956 # migration. May cause noticeable delays if the image
2957 # file is large, do not use in production.
2958 # (default: off) (since: 3.0)
2959 #
2960 # Features:
2961 # @dynamic-auto-read-only: If present, enabled auto-read-only means that the
2962 # driver will open the image read-only at first,
2963 # dynamically reopen the image file read-write when
2964 # the first writer is attached to the node and reopen
2965 # read-only when the last writer is detached. This
2966 # allows giving QEMU write permissions only on demand
2967 # when an operation actually needs write access.
2968 # @unstable: Member x-check-cache-dropped is meant for debugging.
2969 #
2970 # Since: 2.9
2971 ##
2972 { 'struct': 'BlockdevOptionsFile',
2973 'data': { 'filename': 'str',
2974 '*pr-manager': 'str',
2975 '*locking': 'OnOffAuto',
2976 '*aio': 'BlockdevAioOptions',
2977 '*aio-max-batch': 'int',
2978 '*drop-cache': {'type': 'bool',
2979 'if': 'CONFIG_LINUX'},
2980 '*x-check-cache-dropped': { 'type': 'bool',
2981 'features': [ 'unstable' ] } },
2982 'features': [ { 'name': 'dynamic-auto-read-only',
2983 'if': 'CONFIG_POSIX' } ] }
2984
2985 ##
2986 # @BlockdevOptionsNull:
2987 #
2988 # Driver specific block device options for the null backend.
2989 #
2990 # @size: size of the device in bytes.
2991 # @latency-ns: emulated latency (in nanoseconds) in processing
2992 # requests. Default to zero which completes requests immediately.
2993 # (Since 2.4)
2994 # @read-zeroes: if true, reads from the device produce zeroes; if false, the
2995 # buffer is left unchanged. (default: false; since: 4.1)
2996 #
2997 # Since: 2.9
2998 ##
2999 { 'struct': 'BlockdevOptionsNull',
3000 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
3001
3002 ##
3003 # @BlockdevOptionsNVMe:
3004 #
3005 # Driver specific block device options for the NVMe backend.
3006 #
3007 # @device: PCI controller address of the NVMe device in
3008 # format hhhh:bb:ss.f (host:bus:slot.function)
3009 # @namespace: namespace number of the device, starting from 1.
3010 #
3011 # Note that the PCI @device must have been unbound from any host
3012 # kernel driver before instructing QEMU to add the blockdev.
3013 #
3014 # Since: 2.12
3015 ##
3016 { 'struct': 'BlockdevOptionsNVMe',
3017 'data': { 'device': 'str', 'namespace': 'int' } }
3018
3019 ##
3020 # @BlockdevOptionsVVFAT:
3021 #
3022 # Driver specific block device options for the vvfat protocol.
3023 #
3024 # @dir: directory to be exported as FAT image
3025 # @fat-type: FAT type: 12, 16 or 32
3026 # @floppy: whether to export a floppy image (true) or
3027 # partitioned hard disk (false; default)
3028 # @label: set the volume label, limited to 11 bytes. FAT16 and
3029 # FAT32 traditionally have some restrictions on labels, which are
3030 # ignored by most operating systems. Defaults to "QEMU VVFAT".
3031 # (since 2.4)
3032 # @rw: whether to allow write operations (default: false)
3033 #
3034 # Since: 2.9
3035 ##
3036 { 'struct': 'BlockdevOptionsVVFAT',
3037 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
3038 '*label': 'str', '*rw': 'bool' } }
3039
3040 ##
3041 # @BlockdevOptionsGenericFormat:
3042 #
3043 # Driver specific block device options for image format that have no option
3044 # besides their data source.
3045 #
3046 # @file: reference to or definition of the data source block device
3047 #
3048 # Since: 2.9
3049 ##
3050 { 'struct': 'BlockdevOptionsGenericFormat',
3051 'data': { 'file': 'BlockdevRef' } }
3052
3053 ##
3054 # @BlockdevOptionsLUKS:
3055 #
3056 # Driver specific block device options for LUKS.
3057 #
3058 # @key-secret: the ID of a QCryptoSecret object providing
3059 # the decryption key (since 2.6). Mandatory except when
3060 # doing a metadata-only probe of the image.
3061 #
3062 # Since: 2.9
3063 ##
3064 { 'struct': 'BlockdevOptionsLUKS',
3065 'base': 'BlockdevOptionsGenericFormat',
3066 'data': { '*key-secret': 'str' } }
3067
3068
3069 ##
3070 # @BlockdevOptionsGenericCOWFormat:
3071 #
3072 # Driver specific block device options for image format that have no option
3073 # besides their data source and an optional backing file.
3074 #
3075 # @backing: reference to or definition of the backing file block
3076 # device, null disables the backing file entirely.
3077 # Defaults to the backing file stored the image file.
3078 #
3079 # Since: 2.9
3080 ##
3081 { 'struct': 'BlockdevOptionsGenericCOWFormat',
3082 'base': 'BlockdevOptionsGenericFormat',
3083 'data': { '*backing': 'BlockdevRefOrNull' } }
3084
3085 ##
3086 # @Qcow2OverlapCheckMode:
3087 #
3088 # General overlap check modes.
3089 #
3090 # @none: Do not perform any checks
3091 #
3092 # @constant: Perform only checks which can be done in constant time and
3093 # without reading anything from disk
3094 #
3095 # @cached: Perform only checks which can be done without reading anything
3096 # from disk
3097 #
3098 # @all: Perform all available overlap checks
3099 #
3100 # Since: 2.9
3101 ##
3102 { 'enum': 'Qcow2OverlapCheckMode',
3103 'data': [ 'none', 'constant', 'cached', 'all' ] }
3104
3105 ##
3106 # @Qcow2OverlapCheckFlags:
3107 #
3108 # Structure of flags for each metadata structure. Setting a field to 'true'
3109 # makes qemu guard that structure against unintended overwriting. The default
3110 # value is chosen according to the template given.
3111 #
3112 # @template: Specifies a template mode which can be adjusted using the other
3113 # flags, defaults to 'cached'
3114 #
3115 # @bitmap-directory: since 3.0
3116 #
3117 # Since: 2.9
3118 ##
3119 { 'struct': 'Qcow2OverlapCheckFlags',
3120 'data': { '*template': 'Qcow2OverlapCheckMode',
3121 '*main-header': 'bool',
3122 '*active-l1': 'bool',
3123 '*active-l2': 'bool',
3124 '*refcount-table': 'bool',
3125 '*refcount-block': 'bool',
3126 '*snapshot-table': 'bool',
3127 '*inactive-l1': 'bool',
3128 '*inactive-l2': 'bool',
3129 '*bitmap-directory': 'bool' } }
3130
3131 ##
3132 # @Qcow2OverlapChecks:
3133 #
3134 # Specifies which metadata structures should be guarded against unintended
3135 # overwriting.
3136 #
3137 # @flags: set of flags for separate specification of each metadata structure
3138 # type
3139 #
3140 # @mode: named mode which chooses a specific set of flags
3141 #
3142 # Since: 2.9
3143 ##
3144 { 'alternate': 'Qcow2OverlapChecks',
3145 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3146 'mode': 'Qcow2OverlapCheckMode' } }
3147
3148 ##
3149 # @BlockdevQcowEncryptionFormat:
3150 #
3151 # @aes: AES-CBC with plain64 initialization vectors
3152 #
3153 # Since: 2.10
3154 ##
3155 { 'enum': 'BlockdevQcowEncryptionFormat',
3156 'data': [ 'aes' ] }
3157
3158 ##
3159 # @BlockdevQcowEncryption:
3160 #
3161 # Since: 2.10
3162 ##
3163 { 'union': 'BlockdevQcowEncryption',
3164 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3165 'discriminator': 'format',
3166 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3167
3168 ##
3169 # @BlockdevOptionsQcow:
3170 #
3171 # Driver specific block device options for qcow.
3172 #
3173 # @encrypt: Image decryption options. Mandatory for
3174 # encrypted images, except when doing a metadata-only
3175 # probe of the image.
3176 #
3177 # Since: 2.10
3178 ##
3179 { 'struct': 'BlockdevOptionsQcow',
3180 'base': 'BlockdevOptionsGenericCOWFormat',
3181 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3182
3183
3184
3185 ##
3186 # @BlockdevQcow2EncryptionFormat:
3187 #
3188 # @aes: AES-CBC with plain64 initialization vectors
3189 #
3190 # Since: 2.10
3191 ##
3192 { 'enum': 'BlockdevQcow2EncryptionFormat',
3193 'data': [ 'aes', 'luks' ] }
3194
3195 ##
3196 # @BlockdevQcow2Encryption:
3197 #
3198 # Since: 2.10
3199 ##
3200 { 'union': 'BlockdevQcow2Encryption',
3201 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3202 'discriminator': 'format',
3203 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3204 'luks': 'QCryptoBlockOptionsLUKS'} }
3205
3206 ##
3207 # @BlockdevOptionsPreallocate:
3208 #
3209 # Filter driver intended to be inserted between format and protocol node
3210 # and do preallocation in protocol node on write.
3211 #
3212 # @prealloc-align: on preallocation, align file length to this number,
3213 # default 1048576 (1M)
3214 #
3215 # @prealloc-size: how much to preallocate, default 134217728 (128M)
3216 #
3217 # Since: 6.0
3218 ##
3219 { 'struct': 'BlockdevOptionsPreallocate',
3220 'base': 'BlockdevOptionsGenericFormat',
3221 'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } }
3222
3223 ##
3224 # @BlockdevOptionsQcow2:
3225 #
3226 # Driver specific block device options for qcow2.
3227 #
3228 # @lazy-refcounts: whether to enable the lazy refcounts
3229 # feature (default is taken from the image file)
3230 #
3231 # @pass-discard-request: whether discard requests to the qcow2
3232 # device should be forwarded to the data source
3233 #
3234 # @pass-discard-snapshot: whether discard requests for the data source
3235 # should be issued when a snapshot operation (e.g.
3236 # deleting a snapshot) frees clusters in the qcow2 file
3237 #
3238 # @pass-discard-other: whether discard requests for the data source
3239 # should be issued on other occasions where a cluster
3240 # gets freed
3241 #
3242 # @overlap-check: which overlap checks to perform for writes
3243 # to the image, defaults to 'cached' (since 2.2)
3244 #
3245 # @cache-size: the maximum total size of the L2 table and
3246 # refcount block caches in bytes (since 2.2)
3247 #
3248 # @l2-cache-size: the maximum size of the L2 table cache in
3249 # bytes (since 2.2)
3250 #
3251 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3252 # bytes. It must be a power of two between 512
3253 # and the cluster size. The default value is
3254 # the cluster size (since 2.12)
3255 #
3256 # @refcount-cache-size: the maximum size of the refcount block cache
3257 # in bytes (since 2.2)
3258 #
3259 # @cache-clean-interval: clean unused entries in the L2 and refcount
3260 # caches. The interval is in seconds. The default value
3261 # is 600 on supporting platforms, and 0 on other
3262 # platforms. 0 disables this feature. (since 2.5)
3263 #
3264 # @encrypt: Image decryption options. Mandatory for
3265 # encrypted images, except when doing a metadata-only
3266 # probe of the image. (since 2.10)
3267 #
3268 # @data-file: reference to or definition of the external data file.
3269 # This may only be specified for images that require an
3270 # external data file. If it is not specified for such
3271 # an image, the data file name is loaded from the image
3272 # file. (since 4.0)
3273 #
3274 # Since: 2.9
3275 ##
3276 { 'struct': 'BlockdevOptionsQcow2',
3277 'base': 'BlockdevOptionsGenericCOWFormat',
3278 'data': { '*lazy-refcounts': 'bool',
3279 '*pass-discard-request': 'bool',
3280 '*pass-discard-snapshot': 'bool',
3281 '*pass-discard-other': 'bool',
3282 '*overlap-check': 'Qcow2OverlapChecks',
3283 '*cache-size': 'int',
3284 '*l2-cache-size': 'int',
3285 '*l2-cache-entry-size': 'int',
3286 '*refcount-cache-size': 'int',
3287 '*cache-clean-interval': 'int',
3288 '*encrypt': 'BlockdevQcow2Encryption',
3289 '*data-file': 'BlockdevRef' } }
3290
3291 ##
3292 # @SshHostKeyCheckMode:
3293 #
3294 # @none: Don't check the host key at all
3295 # @hash: Compare the host key with a given hash
3296 # @known_hosts: Check the host key against the known_hosts file
3297 #
3298 # Since: 2.12
3299 ##
3300 { 'enum': 'SshHostKeyCheckMode',
3301 'data': [ 'none', 'hash', 'known_hosts' ] }
3302
3303 ##
3304 # @SshHostKeyCheckHashType:
3305 #
3306 # @md5: The given hash is an md5 hash
3307 # @sha1: The given hash is an sha1 hash
3308 # @sha256: The given hash is an sha256 hash
3309 #
3310 # Since: 2.12
3311 ##
3312 { 'enum': 'SshHostKeyCheckHashType',
3313 'data': [ 'md5', 'sha1', 'sha256' ] }
3314
3315 ##
3316 # @SshHostKeyHash:
3317 #
3318 # @type: The hash algorithm used for the hash
3319 # @hash: The expected hash value
3320 #
3321 # Since: 2.12
3322 ##
3323 { 'struct': 'SshHostKeyHash',
3324 'data': { 'type': 'SshHostKeyCheckHashType',
3325 'hash': 'str' }}
3326
3327 ##
3328 # @SshHostKeyCheck:
3329 #
3330 # Since: 2.12
3331 ##
3332 { 'union': 'SshHostKeyCheck',
3333 'base': { 'mode': 'SshHostKeyCheckMode' },
3334 'discriminator': 'mode',
3335 'data': { 'hash': 'SshHostKeyHash' } }
3336
3337 ##
3338 # @BlockdevOptionsSsh:
3339 #
3340 # @server: host address
3341 #
3342 # @path: path to the image on the host
3343 #
3344 # @user: user as which to connect, defaults to current
3345 # local user name
3346 #
3347 # @host-key-check: Defines how and what to check the host key against
3348 # (default: known_hosts)
3349 #
3350 # Since: 2.9
3351 ##
3352 { 'struct': 'BlockdevOptionsSsh',
3353 'data': { 'server': 'InetSocketAddress',
3354 'path': 'str',
3355 '*user': 'str',
3356 '*host-key-check': 'SshHostKeyCheck' } }
3357
3358
3359 ##
3360 # @BlkdebugEvent:
3361 #
3362 # Trigger events supported by blkdebug.
3363 #
3364 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3365 # (since 2.11)
3366 #
3367 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3368 #
3369 # @cor_write: a write due to copy-on-read (since 2.11)
3370 #
3371 # @cluster_alloc_space: an allocation of file space for a cluster (since 4.1)
3372 #
3373 # @none: triggers once at creation of the blkdebug node (since 4.1)
3374 #
3375 # Since: 2.9
3376 ##
3377 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3378 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3379 'l1_grow_activate_table', 'l2_load', 'l2_update',
3380 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3381 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3382 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3383 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3384 'refblock_load', 'refblock_update', 'refblock_update_part',
3385 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3386 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3387 'refblock_alloc_switch_table', 'cluster_alloc',
3388 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3389 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3390 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3391 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3392 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3393 'cor_write', 'cluster_alloc_space', 'none'] }
3394
3395 ##
3396 # @BlkdebugIOType:
3397 #
3398 # Kinds of I/O that blkdebug can inject errors in.
3399 #
3400 # @read: .bdrv_co_preadv()
3401 #
3402 # @write: .bdrv_co_pwritev()
3403 #
3404 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3405 #
3406 # @discard: .bdrv_co_pdiscard()
3407 #
3408 # @flush: .bdrv_co_flush_to_disk()
3409 #
3410 # @block-status: .bdrv_co_block_status()
3411 #
3412 # Since: 4.1
3413 ##
3414 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3415 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3416 'block-status' ] }
3417
3418 ##
3419 # @BlkdebugInjectErrorOptions:
3420 #
3421 # Describes a single error injection for blkdebug.
3422 #
3423 # @event: trigger event
3424 #
3425 # @state: the state identifier blkdebug needs to be in to
3426 # actually trigger the event; defaults to "any"
3427 #
3428 # @iotype: the type of I/O operations on which this error should
3429 # be injected; defaults to "all read, write,
3430 # write-zeroes, discard, and flush operations"
3431 # (since: 4.1)
3432 #
3433 # @errno: error identifier (errno) to be returned; defaults to
3434 # EIO
3435 #
3436 # @sector: specifies the sector index which has to be affected
3437 # in order to actually trigger the event; defaults to "any
3438 # sector"
3439 #
3440 # @once: disables further events after this one has been
3441 # triggered; defaults to false
3442 #
3443 # @immediately: fail immediately; defaults to false
3444 #
3445 # Since: 2.9
3446 ##
3447 { 'struct': 'BlkdebugInjectErrorOptions',
3448 'data': { 'event': 'BlkdebugEvent',
3449 '*state': 'int',
3450 '*iotype': 'BlkdebugIOType',
3451 '*errno': 'int',
3452 '*sector': 'int',
3453 '*once': 'bool',
3454 '*immediately': 'bool' } }
3455
3456 ##
3457 # @BlkdebugSetStateOptions:
3458 #
3459 # Describes a single state-change event for blkdebug.
3460 #
3461 # @event: trigger event
3462 #
3463 # @state: the current state identifier blkdebug needs to be in;
3464 # defaults to "any"
3465 #
3466 # @new_state: the state identifier blkdebug is supposed to assume if
3467 # this event is triggered
3468 #
3469 # Since: 2.9
3470 ##
3471 { 'struct': 'BlkdebugSetStateOptions',
3472 'data': { 'event': 'BlkdebugEvent',
3473 '*state': 'int',
3474 'new_state': 'int' } }
3475
3476 ##
3477 # @BlockdevOptionsBlkdebug:
3478 #
3479 # Driver specific block device options for blkdebug.
3480 #
3481 # @image: underlying raw block device (or image file)
3482 #
3483 # @config: filename of the configuration file
3484 #
3485 # @align: required alignment for requests in bytes, must be
3486 # positive power of 2, or 0 for default
3487 #
3488 # @max-transfer: maximum size for I/O transfers in bytes, must be
3489 # positive multiple of @align and of the underlying
3490 # file's request alignment (but need not be a power of
3491 # 2), or 0 for default (since 2.10)
3492 #
3493 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3494 # must be positive multiple of @align and of the
3495 # underlying file's request alignment (but need not be a
3496 # power of 2), or 0 for default (since 2.10)
3497 #
3498 # @max-write-zero: maximum size for write zero requests in bytes, must be
3499 # positive multiple of @align, of @opt-write-zero, and of
3500 # the underlying file's request alignment (but need not
3501 # be a power of 2), or 0 for default (since 2.10)
3502 #
3503 # @opt-discard: preferred alignment for discard requests in bytes, must
3504 # be positive multiple of @align and of the underlying
3505 # file's request alignment (but need not be a power of
3506 # 2), or 0 for default (since 2.10)
3507 #
3508 # @max-discard: maximum size for discard requests in bytes, must be
3509 # positive multiple of @align, of @opt-discard, and of
3510 # the underlying file's request alignment (but need not
3511 # be a power of 2), or 0 for default (since 2.10)
3512 #
3513 # @inject-error: array of error injection descriptions
3514 #
3515 # @set-state: array of state-change descriptions
3516 #
3517 # @take-child-perms: Permissions to take on @image in addition to what
3518 # is necessary anyway (which depends on how the
3519 # blkdebug node is used). Defaults to none.
3520 # (since 5.0)
3521 #
3522 # @unshare-child-perms: Permissions not to share on @image in addition
3523 # to what cannot be shared anyway (which depends
3524 # on how the blkdebug node is used). Defaults
3525 # to none. (since 5.0)
3526 #
3527 # Since: 2.9
3528 ##
3529 { 'struct': 'BlockdevOptionsBlkdebug',
3530 'data': { 'image': 'BlockdevRef',
3531 '*config': 'str',
3532 '*align': 'int', '*max-transfer': 'int32',
3533 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3534 '*opt-discard': 'int32', '*max-discard': 'int32',
3535 '*inject-error': ['BlkdebugInjectErrorOptions'],
3536 '*set-state': ['BlkdebugSetStateOptions'],
3537 '*take-child-perms': ['BlockPermission'],
3538 '*unshare-child-perms': ['BlockPermission'] } }
3539
3540 ##
3541 # @BlockdevOptionsBlklogwrites:
3542 #
3543 # Driver specific block device options for blklogwrites.
3544 #
3545 # @file: block device
3546 #
3547 # @log: block device used to log writes to @file
3548 #
3549 # @log-sector-size: sector size used in logging writes to @file, determines
3550 # granularity of offsets and sizes of writes (default: 512)
3551 #
3552 # @log-append: append to an existing log (default: false)
3553 #
3554 # @log-super-update-interval: interval of write requests after which the log
3555 # super block is updated to disk (default: 4096)
3556 #
3557 # Since: 3.0
3558 ##
3559 { 'struct': 'BlockdevOptionsBlklogwrites',
3560 'data': { 'file': 'BlockdevRef',
3561 'log': 'BlockdevRef',
3562 '*log-sector-size': 'uint32',
3563 '*log-append': 'bool',
3564 '*log-super-update-interval': 'uint64' } }
3565
3566 ##
3567 # @BlockdevOptionsBlkverify:
3568 #
3569 # Driver specific block device options for blkverify.
3570 #
3571 # @test: block device to be tested
3572 #
3573 # @raw: raw image used for verification
3574 #
3575 # Since: 2.9
3576 ##
3577 { 'struct': 'BlockdevOptionsBlkverify',
3578 'data': { 'test': 'BlockdevRef',
3579 'raw': 'BlockdevRef' } }
3580
3581 ##
3582 # @BlockdevOptionsBlkreplay:
3583 #
3584 # Driver specific block device options for blkreplay.
3585 #
3586 # @image: disk image which should be controlled with blkreplay
3587 #
3588 # Since: 4.2
3589 ##
3590 { 'struct': 'BlockdevOptionsBlkreplay',
3591 'data': { 'image': 'BlockdevRef' } }
3592
3593 ##
3594 # @QuorumReadPattern:
3595 #
3596 # An enumeration of quorum read patterns.
3597 #
3598 # @quorum: read all the children and do a quorum vote on reads
3599 #
3600 # @fifo: read only from the first child that has not failed
3601 #
3602 # Since: 2.9
3603 ##
3604 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3605
3606 ##
3607 # @BlockdevOptionsQuorum:
3608 #
3609 # Driver specific block device options for Quorum
3610 #
3611 # @blkverify: true if the driver must print content mismatch
3612 # set to false by default
3613 #
3614 # @children: the children block devices to use
3615 #
3616 # @vote-threshold: the vote limit under which a read will fail
3617 #
3618 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3619 # (Since 2.1)
3620 #
3621 # @read-pattern: choose read pattern and set to quorum by default
3622 # (Since 2.2)
3623 #
3624 # Since: 2.9
3625 ##
3626 { 'struct': 'BlockdevOptionsQuorum',
3627 'data': { '*blkverify': 'bool',
3628 'children': [ 'BlockdevRef' ],
3629 'vote-threshold': 'int',
3630 '*rewrite-corrupted': 'bool',
3631 '*read-pattern': 'QuorumReadPattern' } }
3632
3633 ##
3634 # @BlockdevOptionsGluster:
3635 #
3636 # Driver specific block device options for Gluster
3637 #
3638 # @volume: name of gluster volume where VM image resides
3639 #
3640 # @path: absolute path to image file in gluster volume
3641 #
3642 # @server: gluster servers description
3643 #
3644 # @debug: libgfapi log level (default '4' which is Error)
3645 # (Since 2.8)
3646 #
3647 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3648 #
3649 # Since: 2.9
3650 ##
3651 { 'struct': 'BlockdevOptionsGluster',
3652 'data': { 'volume': 'str',
3653 'path': 'str',
3654 'server': ['SocketAddress'],
3655 '*debug': 'int',
3656 '*logfile': 'str' } }
3657
3658 ##
3659 # @IscsiTransport:
3660 #
3661 # An enumeration of libiscsi transport types
3662 #
3663 # Since: 2.9
3664 ##
3665 { 'enum': 'IscsiTransport',
3666 'data': [ 'tcp', 'iser' ] }
3667
3668 ##
3669 # @IscsiHeaderDigest:
3670 #
3671 # An enumeration of header digests supported by libiscsi
3672 #
3673 # Since: 2.9
3674 ##
3675 { 'enum': 'IscsiHeaderDigest',
3676 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3677 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3678
3679 ##
3680 # @BlockdevOptionsIscsi:
3681 #
3682 # @transport: The iscsi transport type
3683 #
3684 # @portal: The address of the iscsi portal
3685 #
3686 # @target: The target iqn name
3687 #
3688 # @lun: LUN to connect to. Defaults to 0.
3689 #
3690 # @user: User name to log in with. If omitted, no CHAP
3691 # authentication is performed.
3692 #
3693 # @password-secret: The ID of a QCryptoSecret object providing
3694 # the password for the login. This option is required if
3695 # @user is specified.
3696 #
3697 # @initiator-name: The iqn name we want to identify to the target
3698 # as. If this option is not specified, an initiator name is
3699 # generated automatically.
3700 #
3701 # @header-digest: The desired header digest. Defaults to
3702 # none-crc32c.
3703 #
3704 # @timeout: Timeout in seconds after which a request will
3705 # timeout. 0 means no timeout and is the default.
3706 #
3707 # Driver specific block device options for iscsi
3708 #
3709 # Since: 2.9
3710 ##
3711 { 'struct': 'BlockdevOptionsIscsi',
3712 'data': { 'transport': 'IscsiTransport',
3713 'portal': 'str',
3714 'target': 'str',
3715 '*lun': 'int',
3716 '*user': 'str',
3717 '*password-secret': 'str',
3718 '*initiator-name': 'str',
3719 '*header-digest': 'IscsiHeaderDigest',
3720 '*timeout': 'int' } }
3721
3722
3723 ##
3724 # @RbdAuthMode:
3725 #
3726 # Since: 3.0
3727 ##
3728 { 'enum': 'RbdAuthMode',
3729 'data': [ 'cephx', 'none' ] }
3730
3731 ##
3732 # @RbdImageEncryptionFormat:
3733 #
3734 # Since: 6.1
3735 ##
3736 { 'enum': 'RbdImageEncryptionFormat',
3737 'data': [ 'luks', 'luks2' ] }
3738
3739 ##
3740 # @RbdEncryptionOptionsLUKSBase:
3741 #
3742 # @key-secret: ID of a QCryptoSecret object providing a passphrase
3743 # for unlocking the encryption
3744 #
3745 # Since: 6.1
3746 ##
3747 { 'struct': 'RbdEncryptionOptionsLUKSBase',
3748 'data': { 'key-secret': 'str' } }
3749
3750 ##
3751 # @RbdEncryptionCreateOptionsLUKSBase:
3752 #
3753 # @cipher-alg: The encryption algorithm
3754 #
3755 # Since: 6.1
3756 ##
3757 { 'struct': 'RbdEncryptionCreateOptionsLUKSBase',
3758 'base': 'RbdEncryptionOptionsLUKSBase',
3759 'data': { '*cipher-alg': 'QCryptoCipherAlgorithm' } }
3760
3761 ##
3762 # @RbdEncryptionOptionsLUKS:
3763 #
3764 # Since: 6.1
3765 ##
3766 { 'struct': 'RbdEncryptionOptionsLUKS',
3767 'base': 'RbdEncryptionOptionsLUKSBase',
3768 'data': { } }
3769
3770 ##
3771 # @RbdEncryptionOptionsLUKS2:
3772 #
3773 # Since: 6.1
3774 ##
3775 { 'struct': 'RbdEncryptionOptionsLUKS2',
3776 'base': 'RbdEncryptionOptionsLUKSBase',
3777 'data': { } }
3778
3779 ##
3780 # @RbdEncryptionCreateOptionsLUKS:
3781 #
3782 # Since: 6.1
3783 ##
3784 { 'struct': 'RbdEncryptionCreateOptionsLUKS',
3785 'base': 'RbdEncryptionCreateOptionsLUKSBase',
3786 'data': { } }
3787
3788 ##
3789 # @RbdEncryptionCreateOptionsLUKS2:
3790 #
3791 # Since: 6.1
3792 ##
3793 { 'struct': 'RbdEncryptionCreateOptionsLUKS2',
3794 'base': 'RbdEncryptionCreateOptionsLUKSBase',
3795 'data': { } }
3796
3797 ##
3798 # @RbdEncryptionOptions:
3799 #
3800 # Since: 6.1
3801 ##
3802 { 'union': 'RbdEncryptionOptions',
3803 'base': { 'format': 'RbdImageEncryptionFormat' },
3804 'discriminator': 'format',
3805 'data': { 'luks': 'RbdEncryptionOptionsLUKS',
3806 'luks2': 'RbdEncryptionOptionsLUKS2' } }
3807
3808 ##
3809 # @RbdEncryptionCreateOptions:
3810 #
3811 # Since: 6.1
3812 ##
3813 { 'union': 'RbdEncryptionCreateOptions',
3814 'base': { 'format': 'RbdImageEncryptionFormat' },
3815 'discriminator': 'format',
3816 'data': { 'luks': 'RbdEncryptionCreateOptionsLUKS',
3817 'luks2': 'RbdEncryptionCreateOptionsLUKS2' } }
3818
3819 ##
3820 # @BlockdevOptionsRbd:
3821 #
3822 # @pool: Ceph pool name.
3823 #
3824 # @namespace: Rados namespace name in the Ceph pool. (Since 5.0)
3825 #
3826 # @image: Image name in the Ceph pool.
3827 #
3828 # @conf: path to Ceph configuration file. Values
3829 # in the configuration file will be overridden by
3830 # options specified via QAPI.
3831 #
3832 # @snapshot: Ceph snapshot name.
3833 #
3834 # @encrypt: Image encryption options. (Since 6.1)
3835 #
3836 # @user: Ceph id name.
3837 #
3838 # @auth-client-required: Acceptable authentication modes.
3839 # This maps to Ceph configuration option
3840 # "auth_client_required". (Since 3.0)
3841 #
3842 # @key-secret: ID of a QCryptoSecret object providing a key
3843 # for cephx authentication.
3844 # This maps to Ceph configuration option
3845 # "key". (Since 3.0)
3846 #
3847 # @server: Monitor host address and port. This maps
3848 # to the "mon_host" Ceph option.
3849 #
3850 # Since: 2.9
3851 ##
3852 { 'struct': 'BlockdevOptionsRbd',
3853 'data': { 'pool': 'str',
3854 '*namespace': 'str',
3855 'image': 'str',
3856 '*conf': 'str',
3857 '*snapshot': 'str',
3858 '*encrypt': 'RbdEncryptionOptions',
3859 '*user': 'str',
3860 '*auth-client-required': ['RbdAuthMode'],
3861 '*key-secret': 'str',
3862 '*server': ['InetSocketAddressBase'] } }
3863
3864 ##
3865 # @ReplicationMode:
3866 #
3867 # An enumeration of replication modes.
3868 #
3869 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3870 #
3871 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3872 #
3873 # Since: 2.9
3874 ##
3875 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3876 'if': 'CONFIG_REPLICATION' }
3877
3878 ##
3879 # @BlockdevOptionsReplication:
3880 #
3881 # Driver specific block device options for replication
3882 #
3883 # @mode: the replication mode
3884 #
3885 # @top-id: In secondary mode, node name or device ID of the root
3886 # node who owns the replication node chain. Must not be given in
3887 # primary mode.
3888 #
3889 # Since: 2.9
3890 ##
3891 { 'struct': 'BlockdevOptionsReplication',
3892 'base': 'BlockdevOptionsGenericFormat',
3893 'data': { 'mode': 'ReplicationMode',
3894 '*top-id': 'str' },
3895 'if': 'CONFIG_REPLICATION' }
3896
3897 ##
3898 # @NFSTransport:
3899 #
3900 # An enumeration of NFS transport types
3901 #
3902 # @inet: TCP transport
3903 #
3904 # Since: 2.9
3905 ##
3906 { 'enum': 'NFSTransport',
3907 'data': [ 'inet' ] }
3908
3909 ##
3910 # @NFSServer:
3911 #
3912 # Captures the address of the socket
3913 #
3914 # @type: transport type used for NFS (only TCP supported)
3915 #
3916 # @host: host address for NFS server
3917 #
3918 # Since: 2.9
3919 ##
3920 { 'struct': 'NFSServer',
3921 'data': { 'type': 'NFSTransport',
3922 'host': 'str' } }
3923
3924 ##
3925 # @BlockdevOptionsNfs:
3926 #
3927 # Driver specific block device option for NFS
3928 #
3929 # @server: host address
3930 #
3931 # @path: path of the image on the host
3932 #
3933 # @user: UID value to use when talking to the
3934 # server (defaults to 65534 on Windows and getuid()
3935 # on unix)
3936 #
3937 # @group: GID value to use when talking to the
3938 # server (defaults to 65534 on Windows and getgid()
3939 # in unix)
3940 #
3941 # @tcp-syn-count: number of SYNs during the session
3942 # establishment (defaults to libnfs default)
3943 #
3944 # @readahead-size: set the readahead size in bytes (defaults
3945 # to libnfs default)
3946 #
3947 # @page-cache-size: set the pagecache size in bytes (defaults
3948 # to libnfs default)
3949 #
3950 # @debug: set the NFS debug level (max 2) (defaults
3951 # to libnfs default)
3952 #
3953 # Since: 2.9
3954 ##
3955 { 'struct': 'BlockdevOptionsNfs',
3956 'data': { 'server': 'NFSServer',
3957 'path': 'str',
3958 '*user': 'int',
3959 '*group': 'int',
3960 '*tcp-syn-count': 'int',
3961 '*readahead-size': 'int',
3962 '*page-cache-size': 'int',
3963 '*debug': 'int' } }
3964
3965 ##
3966 # @BlockdevOptionsCurlBase:
3967 #
3968 # Driver specific block device options shared by all protocols supported by the
3969 # curl backend.
3970 #
3971 # @url: URL of the image file
3972 #
3973 # @readahead: Size of the read-ahead cache; must be a multiple of
3974 # 512 (defaults to 256 kB)
3975 #
3976 # @timeout: Timeout for connections, in seconds (defaults to 5)
3977 #
3978 # @username: Username for authentication (defaults to none)
3979 #
3980 # @password-secret: ID of a QCryptoSecret object providing a password
3981 # for authentication (defaults to no password)
3982 #
3983 # @proxy-username: Username for proxy authentication (defaults to none)
3984 #
3985 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3986 # for proxy authentication (defaults to no password)
3987 #
3988 # Since: 2.9
3989 ##
3990 { 'struct': 'BlockdevOptionsCurlBase',
3991 'data': { 'url': 'str',
3992 '*readahead': 'int',
3993 '*timeout': 'int',
3994 '*username': 'str',
3995 '*password-secret': 'str',
3996 '*proxy-username': 'str',
3997 '*proxy-password-secret': 'str' } }
3998
3999 ##
4000 # @BlockdevOptionsCurlHttp:
4001 #
4002 # Driver specific block device options for HTTP connections over the curl
4003 # backend. URLs must start with "http://".
4004 #
4005 # @cookie: List of cookies to set; format is
4006 # "name1=content1; name2=content2;" as explained by
4007 # CURLOPT_COOKIE(3). Defaults to no cookies.
4008 #
4009 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
4010 # secure way. See @cookie for the format. (since 2.10)
4011 #
4012 # Since: 2.9
4013 ##
4014 { 'struct': 'BlockdevOptionsCurlHttp',
4015 'base': 'BlockdevOptionsCurlBase',
4016 'data': { '*cookie': 'str',
4017 '*cookie-secret': 'str'} }
4018
4019 ##
4020 # @BlockdevOptionsCurlHttps:
4021 #
4022 # Driver specific block device options for HTTPS connections over the curl
4023 # backend. URLs must start with "https://".
4024 #
4025 # @cookie: List of cookies to set; format is
4026 # "name1=content1; name2=content2;" as explained by
4027 # CURLOPT_COOKIE(3). Defaults to no cookies.
4028 #
4029 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
4030 # true)
4031 #
4032 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
4033 # secure way. See @cookie for the format. (since 2.10)
4034 #
4035 # Since: 2.9
4036 ##
4037 { 'struct': 'BlockdevOptionsCurlHttps',
4038 'base': 'BlockdevOptionsCurlBase',
4039 'data': { '*cookie': 'str',
4040 '*sslverify': 'bool',
4041 '*cookie-secret': 'str'} }
4042
4043 ##
4044 # @BlockdevOptionsCurlFtp:
4045 #
4046 # Driver specific block device options for FTP connections over the curl
4047 # backend. URLs must start with "ftp://".
4048 #
4049 # Since: 2.9
4050 ##
4051 { 'struct': 'BlockdevOptionsCurlFtp',
4052 'base': 'BlockdevOptionsCurlBase',
4053 'data': { } }
4054
4055 ##
4056 # @BlockdevOptionsCurlFtps:
4057 #
4058 # Driver specific block device options for FTPS connections over the curl
4059 # backend. URLs must start with "ftps://".
4060 #
4061 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
4062 # true)
4063 #
4064 # Since: 2.9
4065 ##
4066 { 'struct': 'BlockdevOptionsCurlFtps',
4067 'base': 'BlockdevOptionsCurlBase',
4068 'data': { '*sslverify': 'bool' } }
4069
4070 ##
4071 # @BlockdevOptionsNbd:
4072 #
4073 # Driver specific block device options for NBD.
4074 #
4075 # @server: NBD server address
4076 #
4077 # @export: export name
4078 #
4079 # @tls-creds: TLS credentials ID
4080 #
4081 # @x-dirty-bitmap: A metadata context name such as "qemu:dirty-bitmap:NAME"
4082 # or "qemu:allocation-depth" to query in place of the
4083 # traditional "base:allocation" block status (see
4084 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol; and
4085 # yes, naming this option x-context would have made
4086 # more sense) (since 3.0)
4087 #
4088 # @reconnect-delay: On an unexpected disconnect, the nbd client tries to
4089 # connect again until succeeding or encountering a serious
4090 # error. During the first @reconnect-delay seconds, all
4091 # requests are paused and will be rerun on a successful
4092 # reconnect. After that time, any delayed requests and all
4093 # future requests before a successful reconnect will
4094 # immediately fail. Default 0 (Since 4.2)
4095 #
4096 # Features:
4097 # @unstable: Member @x-dirty-bitmap is experimental.
4098 #
4099 # Since: 2.9
4100 ##
4101 { 'struct': 'BlockdevOptionsNbd',
4102 'data': { 'server': 'SocketAddress',
4103 '*export': 'str',
4104 '*tls-creds': 'str',
4105 '*x-dirty-bitmap': { 'type': 'str', 'features': [ 'unstable' ] },
4106 '*reconnect-delay': 'uint32' } }
4107
4108 ##
4109 # @BlockdevOptionsRaw:
4110 #
4111 # Driver specific block device options for the raw driver.
4112 #
4113 # @offset: position where the block device starts
4114 # @size: the assumed size of the device
4115 #
4116 # Since: 2.9
4117 ##
4118 { 'struct': 'BlockdevOptionsRaw',
4119 'base': 'BlockdevOptionsGenericFormat',
4120 'data': { '*offset': 'int', '*size': 'int' } }
4121
4122 ##
4123 # @BlockdevOptionsThrottle:
4124 #
4125 # Driver specific block device options for the throttle driver
4126 #
4127 # @throttle-group: the name of the throttle-group object to use. It
4128 # must already exist.
4129 # @file: reference to or definition of the data source block device
4130 # Since: 2.11
4131 ##
4132 { 'struct': 'BlockdevOptionsThrottle',
4133 'data': { 'throttle-group': 'str',
4134 'file' : 'BlockdevRef'
4135 } }
4136
4137 ##
4138 # @BlockdevOptionsCor:
4139 #
4140 # Driver specific block device options for the copy-on-read driver.
4141 #
4142 # @bottom: The name of a non-filter node (allocation-bearing layer) that
4143 # limits the COR operations in the backing chain (inclusive), so
4144 # that no data below this node will be copied by this filter.
4145 # If option is absent, the limit is not applied, so that data
4146 # from all backing layers may be copied.
4147 #
4148 # Since: 6.0
4149 ##
4150 { 'struct': 'BlockdevOptionsCor',
4151 'base': 'BlockdevOptionsGenericFormat',
4152 'data': { '*bottom': 'str' } }
4153
4154 ##
4155 # @BlockdevOptionsCbw:
4156 #
4157 # Driver specific block device options for the copy-before-write driver,
4158 # which does so called copy-before-write operations: when data is
4159 # written to the filter, the filter first reads corresponding blocks
4160 # from its file child and copies them to @target child. After successfully
4161 # copying, the write request is propagated to file child. If copying
4162 # fails, the original write request is failed too and no data is written
4163 # to file child.
4164 #
4165 # @target: The target for copy-before-write operations.
4166 #
4167 # Since: 6.2
4168 ##
4169 { 'struct': 'BlockdevOptionsCbw',
4170 'base': 'BlockdevOptionsGenericFormat',
4171 'data': { 'target': 'BlockdevRef' } }
4172
4173 ##
4174 # @BlockdevOptions:
4175 #
4176 # Options for creating a block device. Many options are available for all
4177 # block devices, independent of the block driver:
4178 #
4179 # @driver: block driver name
4180 # @node-name: the node name of the new node (Since 2.0).
4181 # This option is required on the top level of blockdev-add.
4182 # Valid node names start with an alphabetic character and may
4183 # contain only alphanumeric characters, '-', '.' and '_'. Their
4184 # maximum length is 31 characters.
4185 # @discard: discard-related options (default: ignore)
4186 # @cache: cache-related options
4187 # @read-only: whether the block device should be read-only (default: false).
4188 # Note that some block drivers support only read-only access,
4189 # either generally or in certain configurations. In this case,
4190 # the default value does not work and the option must be
4191 # specified explicitly.
4192 # @auto-read-only: if true and @read-only is false, QEMU may automatically
4193 # decide not to open the image read-write as requested, but
4194 # fall back to read-only instead (and switch between the modes
4195 # later), e.g. depending on whether the image file is writable
4196 # or whether a writing user is attached to the node
4197 # (default: false, since 3.1)
4198 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
4199 # (default: off)
4200 # @force-share: force share all permission on added nodes.
4201 # Requires read-only=true. (Since 2.10)
4202 #
4203 # Remaining options are determined by the block driver.
4204 #
4205 # Since: 2.9
4206 ##
4207 { 'union': 'BlockdevOptions',
4208 'base': { 'driver': 'BlockdevDriver',
4209 '*node-name': 'str',
4210 '*discard': 'BlockdevDiscardOptions',
4211 '*cache': 'BlockdevCacheOptions',
4212 '*read-only': 'bool',
4213 '*auto-read-only': 'bool',
4214 '*force-share': 'bool',
4215 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
4216 'discriminator': 'driver',
4217 'data': {
4218 'blkdebug': 'BlockdevOptionsBlkdebug',
4219 'blklogwrites':'BlockdevOptionsBlklogwrites',
4220 'blkverify': 'BlockdevOptionsBlkverify',
4221 'blkreplay': 'BlockdevOptionsBlkreplay',
4222 'bochs': 'BlockdevOptionsGenericFormat',
4223 'cloop': 'BlockdevOptionsGenericFormat',
4224 'compress': 'BlockdevOptionsGenericFormat',
4225 'copy-before-write':'BlockdevOptionsCbw',
4226 'copy-on-read':'BlockdevOptionsCor',
4227 'dmg': 'BlockdevOptionsGenericFormat',
4228 'file': 'BlockdevOptionsFile',
4229 'ftp': 'BlockdevOptionsCurlFtp',
4230 'ftps': 'BlockdevOptionsCurlFtps',
4231 'gluster': 'BlockdevOptionsGluster',
4232 'host_cdrom': { 'type': 'BlockdevOptionsFile',
4233 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4234 'host_device': { 'type': 'BlockdevOptionsFile',
4235 'if': 'HAVE_HOST_BLOCK_DEVICE' },
4236 'http': 'BlockdevOptionsCurlHttp',
4237 'https': 'BlockdevOptionsCurlHttps',
4238 'iscsi': 'BlockdevOptionsIscsi',
4239 'luks': 'BlockdevOptionsLUKS',
4240 'nbd': 'BlockdevOptionsNbd',
4241 'nfs': 'BlockdevOptionsNfs',
4242 'null-aio': 'BlockdevOptionsNull',
4243 'null-co': 'BlockdevOptionsNull',
4244 'nvme': 'BlockdevOptionsNVMe',
4245 'parallels': 'BlockdevOptionsGenericFormat',
4246 'preallocate':'BlockdevOptionsPreallocate',
4247 'qcow2': 'BlockdevOptionsQcow2',
4248 'qcow': 'BlockdevOptionsQcow',
4249 'qed': 'BlockdevOptionsGenericCOWFormat',
4250 'quorum': 'BlockdevOptionsQuorum',
4251 'raw': 'BlockdevOptionsRaw',
4252 'rbd': 'BlockdevOptionsRbd',
4253 'replication': { 'type': 'BlockdevOptionsReplication',
4254 'if': 'CONFIG_REPLICATION' },
4255 'ssh': 'BlockdevOptionsSsh',
4256 'throttle': 'BlockdevOptionsThrottle',
4257 'vdi': 'BlockdevOptionsGenericFormat',
4258 'vhdx': 'BlockdevOptionsGenericFormat',
4259 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4260 'vpc': 'BlockdevOptionsGenericFormat',
4261 'vvfat': 'BlockdevOptionsVVFAT'
4262 } }
4263
4264 ##
4265 # @BlockdevRef:
4266 #
4267 # Reference to a block device.
4268 #
4269 # @definition: defines a new block device inline
4270 # @reference: references the ID of an existing block device
4271 #
4272 # Since: 2.9
4273 ##
4274 { 'alternate': 'BlockdevRef',
4275 'data': { 'definition': 'BlockdevOptions',
4276 'reference': 'str' } }
4277
4278 ##
4279 # @BlockdevRefOrNull:
4280 #
4281 # Reference to a block device.
4282 #
4283 # @definition: defines a new block device inline
4284 # @reference: references the ID of an existing block device.
4285 # An empty string means that no block device should
4286 # be referenced. Deprecated; use null instead.
4287 # @null: No block device should be referenced (since 2.10)
4288 #
4289 # Since: 2.9
4290 ##
4291 { 'alternate': 'BlockdevRefOrNull',
4292 'data': { 'definition': 'BlockdevOptions',
4293 'reference': 'str',
4294 'null': 'null' } }
4295
4296 ##
4297 # @blockdev-add:
4298 #
4299 # Creates a new block device.
4300 #
4301 # Since: 2.9
4302 #
4303 # Example:
4304 #
4305 # 1.
4306 # -> { "execute": "blockdev-add",
4307 # "arguments": {
4308 # "driver": "qcow2",
4309 # "node-name": "test1",
4310 # "file": {
4311 # "driver": "file",
4312 # "filename": "test.qcow2"
4313 # }
4314 # }
4315 # }
4316 # <- { "return": {} }
4317 #
4318 # 2.
4319 # -> { "execute": "blockdev-add",
4320 # "arguments": {
4321 # "driver": "qcow2",
4322 # "node-name": "node0",
4323 # "discard": "unmap",
4324 # "cache": {
4325 # "direct": true
4326 # },
4327 # "file": {
4328 # "driver": "file",
4329 # "filename": "/tmp/test.qcow2"
4330 # },
4331 # "backing": {
4332 # "driver": "raw",
4333 # "file": {
4334 # "driver": "file",
4335 # "filename": "/dev/fdset/4"
4336 # }
4337 # }
4338 # }
4339 # }
4340 #
4341 # <- { "return": {} }
4342 #
4343 ##
4344 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
4345
4346 ##
4347 # @blockdev-reopen:
4348 #
4349 # Reopens one or more block devices using the given set of options.
4350 # Any option not specified will be reset to its default value regardless
4351 # of its previous status. If an option cannot be changed or a particular
4352 # driver does not support reopening then the command will return an
4353 # error. All devices in the list are reopened in one transaction, so
4354 # if one of them fails then the whole transaction is cancelled.
4355 #
4356 # The command receives a list of block devices to reopen. For each one
4357 # of them, the top-level @node-name option (from BlockdevOptions) must be
4358 # specified and is used to select the block device to be reopened.
4359 # Other @node-name options must be either omitted or set to the
4360 # current name of the appropriate node. This command won't change any
4361 # node name and any attempt to do it will result in an error.
4362 #
4363 # In the case of options that refer to child nodes, the behavior of
4364 # this command depends on the value:
4365 #
4366 # 1) A set of options (BlockdevOptions): the child is reopened with
4367 # the specified set of options.
4368 #
4369 # 2) A reference to the current child: the child is reopened using
4370 # its existing set of options.
4371 #
4372 # 3) A reference to a different node: the current child is replaced
4373 # with the specified one.
4374 #
4375 # 4) NULL: the current child (if any) is detached.
4376 #
4377 # Options (1) and (2) are supported in all cases. Option (3) is
4378 # supported for @file and @backing, and option (4) for @backing only.
4379 #
4380 # Unlike with blockdev-add, the @backing option must always be present
4381 # unless the node being reopened does not have a backing file and its
4382 # image does not have a default backing file name as part of its
4383 # metadata.
4384 #
4385 # Since: 6.1
4386 ##
4387 { 'command': 'blockdev-reopen',
4388 'data': { 'options': ['BlockdevOptions'] } }
4389
4390 ##
4391 # @blockdev-del:
4392 #
4393 # Deletes a block device that has been added using blockdev-add.
4394 # The command will fail if the node is attached to a device or is
4395 # otherwise being used.
4396 #
4397 # @node-name: Name of the graph node to delete.
4398 #
4399 # Since: 2.9
4400 #
4401 # Example:
4402 #
4403 # -> { "execute": "blockdev-add",
4404 # "arguments": {
4405 # "driver": "qcow2",
4406 # "node-name": "node0",
4407 # "file": {
4408 # "driver": "file",
4409 # "filename": "test.qcow2"
4410 # }
4411 # }
4412 # }
4413 # <- { "return": {} }
4414 #
4415 # -> { "execute": "blockdev-del",
4416 # "arguments": { "node-name": "node0" }
4417 # }
4418 # <- { "return": {} }
4419 #
4420 ##
4421 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
4422
4423 ##
4424 # @BlockdevCreateOptionsFile:
4425 #
4426 # Driver specific image creation options for file.
4427 #
4428 # @filename: Filename for the new image file
4429 # @size: Size of the virtual disk in bytes
4430 # @preallocation: Preallocation mode for the new image (default: off;
4431 # allowed values: off,
4432 # falloc (if CONFIG_POSIX_FALLOCATE),
4433 # full (if CONFIG_POSIX))
4434 # @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
4435 # @extent-size-hint: Extent size hint to add to the image file; 0 for not
4436 # adding an extent size hint (default: 1 MB, since 5.1)
4437 #
4438 # Since: 2.12
4439 ##
4440 { 'struct': 'BlockdevCreateOptionsFile',
4441 'data': { 'filename': 'str',
4442 'size': 'size',
4443 '*preallocation': 'PreallocMode',
4444 '*nocow': 'bool',
4445 '*extent-size-hint': 'size'} }
4446
4447 ##
4448 # @BlockdevCreateOptionsGluster:
4449 #
4450 # Driver specific image creation options for gluster.
4451 #
4452 # @location: Where to store the new image file
4453 # @size: Size of the virtual disk in bytes
4454 # @preallocation: Preallocation mode for the new image (default: off;
4455 # allowed values: off,
4456 # falloc (if CONFIG_GLUSTERFS_FALLOCATE),
4457 # full (if CONFIG_GLUSTERFS_ZEROFILL))
4458 #
4459 # Since: 2.12
4460 ##
4461 { 'struct': 'BlockdevCreateOptionsGluster',
4462 'data': { 'location': 'BlockdevOptionsGluster',
4463 'size': 'size',
4464 '*preallocation': 'PreallocMode' } }
4465
4466 ##
4467 # @BlockdevCreateOptionsLUKS:
4468 #
4469 # Driver specific image creation options for LUKS.
4470 #
4471 # @file: Node to create the image format on
4472 # @size: Size of the virtual disk in bytes
4473 # @preallocation: Preallocation mode for the new image
4474 # (since: 4.2)
4475 # (default: off; allowed values: off, metadata, falloc, full)
4476 #
4477 # Since: 2.12
4478 ##
4479 { 'struct': 'BlockdevCreateOptionsLUKS',
4480 'base': 'QCryptoBlockCreateOptionsLUKS',
4481 'data': { 'file': 'BlockdevRef',
4482 'size': 'size',
4483 '*preallocation': 'PreallocMode' } }
4484
4485 ##
4486 # @BlockdevCreateOptionsNfs:
4487 #
4488 # Driver specific image creation options for NFS.
4489 #
4490 # @location: Where to store the new image file
4491 # @size: Size of the virtual disk in bytes
4492 #
4493 # Since: 2.12
4494 ##
4495 { 'struct': 'BlockdevCreateOptionsNfs',
4496 'data': { 'location': 'BlockdevOptionsNfs',
4497 'size': 'size' } }
4498
4499 ##
4500 # @BlockdevCreateOptionsParallels:
4501 #
4502 # Driver specific image creation options for parallels.
4503 #
4504 # @file: Node to create the image format on
4505 # @size: Size of the virtual disk in bytes
4506 # @cluster-size: Cluster size in bytes (default: 1 MB)
4507 #
4508 # Since: 2.12
4509 ##
4510 { 'struct': 'BlockdevCreateOptionsParallels',
4511 'data': { 'file': 'BlockdevRef',
4512 'size': 'size',
4513 '*cluster-size': 'size' } }
4514
4515 ##
4516 # @BlockdevCreateOptionsQcow:
4517 #
4518 # Driver specific image creation options for qcow.
4519 #
4520 # @file: Node to create the image format on
4521 # @size: Size of the virtual disk in bytes
4522 # @backing-file: File name of the backing file if a backing file
4523 # should be used
4524 # @encrypt: Encryption options if the image should be encrypted
4525 #
4526 # Since: 2.12
4527 ##
4528 { 'struct': 'BlockdevCreateOptionsQcow',
4529 'data': { 'file': 'BlockdevRef',
4530 'size': 'size',
4531 '*backing-file': 'str',
4532 '*encrypt': 'QCryptoBlockCreateOptions' } }
4533
4534 ##
4535 # @BlockdevQcow2Version:
4536 #
4537 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4538 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4539 #
4540 # Since: 2.12
4541 ##
4542 { 'enum': 'BlockdevQcow2Version',
4543 'data': [ 'v2', 'v3' ] }
4544
4545
4546 ##
4547 # @Qcow2CompressionType:
4548 #
4549 # Compression type used in qcow2 image file
4550 #
4551 # @zlib: zlib compression, see <http://zlib.net/>
4552 # @zstd: zstd compression, see <http://github.com/facebook/zstd>
4553 #
4554 # Since: 5.1
4555 ##
4556 { 'enum': 'Qcow2CompressionType',
4557 'data': [ 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
4558
4559 ##
4560 # @BlockdevCreateOptionsQcow2:
4561 #
4562 # Driver specific image creation options for qcow2.
4563 #
4564 # @file: Node to create the image format on
4565 # @data-file: Node to use as an external data file in which all guest
4566 # data is stored so that only metadata remains in the qcow2
4567 # file (since: 4.0)
4568 # @data-file-raw: True if the external data file must stay valid as a
4569 # standalone (read-only) raw image without looking at qcow2
4570 # metadata (default: false; since: 4.0)
4571 # @extended-l2: True to make the image have extended L2 entries
4572 # (default: false; since 5.2)
4573 # @size: Size of the virtual disk in bytes
4574 # @version: Compatibility level (default: v3)
4575 # @backing-file: File name of the backing file if a backing file
4576 # should be used
4577 # @backing-fmt: Name of the block driver to use for the backing file
4578 # @encrypt: Encryption options if the image should be encrypted
4579 # @cluster-size: qcow2 cluster size in bytes (default: 65536)
4580 # @preallocation: Preallocation mode for the new image (default: off;
4581 # allowed values: off, falloc, full, metadata)
4582 # @lazy-refcounts: True if refcounts may be updated lazily (default: off)
4583 # @refcount-bits: Width of reference counts in bits (default: 16)
4584 # @compression-type: The image cluster compression method
4585 # (default: zlib, since 5.1)
4586 #
4587 # Since: 2.12
4588 ##
4589 { 'struct': 'BlockdevCreateOptionsQcow2',
4590 'data': { 'file': 'BlockdevRef',
4591 '*data-file': 'BlockdevRef',
4592 '*data-file-raw': 'bool',
4593 '*extended-l2': 'bool',
4594 'size': 'size',
4595 '*version': 'BlockdevQcow2Version',
4596 '*backing-file': 'str',
4597 '*backing-fmt': 'BlockdevDriver',
4598 '*encrypt': 'QCryptoBlockCreateOptions',
4599 '*cluster-size': 'size',
4600 '*preallocation': 'PreallocMode',
4601 '*lazy-refcounts': 'bool',
4602 '*refcount-bits': 'int',
4603 '*compression-type':'Qcow2CompressionType' } }
4604
4605 ##
4606 # @BlockdevCreateOptionsQed:
4607 #
4608 # Driver specific image creation options for qed.
4609 #
4610 # @file: Node to create the image format on
4611 # @size: Size of the virtual disk in bytes
4612 # @backing-file: File name of the backing file if a backing file
4613 # should be used
4614 # @backing-fmt: Name of the block driver to use for the backing file
4615 # @cluster-size: Cluster size in bytes (default: 65536)
4616 # @table-size: L1/L2 table size (in clusters)
4617 #
4618 # Since: 2.12
4619 ##
4620 { 'struct': 'BlockdevCreateOptionsQed',
4621 'data': { 'file': 'BlockdevRef',
4622 'size': 'size',
4623 '*backing-file': 'str',
4624 '*backing-fmt': 'BlockdevDriver',
4625 '*cluster-size': 'size',
4626 '*table-size': 'int' } }
4627
4628 ##
4629 # @BlockdevCreateOptionsRbd:
4630 #
4631 # Driver specific image creation options for rbd/Ceph.
4632 #
4633 # @location: Where to store the new image file. This location cannot
4634 # point to a snapshot.
4635 # @size: Size of the virtual disk in bytes
4636 # @cluster-size: RBD object size
4637 # @encrypt: Image encryption options. (Since 6.1)
4638 #
4639 # Since: 2.12
4640 ##
4641 { 'struct': 'BlockdevCreateOptionsRbd',
4642 'data': { 'location': 'BlockdevOptionsRbd',
4643 'size': 'size',
4644 '*cluster-size' : 'size',
4645 '*encrypt' : 'RbdEncryptionCreateOptions' } }
4646
4647 ##
4648 # @BlockdevVmdkSubformat:
4649 #
4650 # Subformat options for VMDK images
4651 #
4652 # @monolithicSparse: Single file image with sparse cluster allocation
4653 #
4654 # @monolithicFlat: Single flat data image and a descriptor file
4655 #
4656 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4657 # files, in addition to a descriptor file
4658 #
4659 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4660 # files, in addition to a descriptor file
4661 #
4662 # @streamOptimized: Single file image sparse cluster allocation, optimized
4663 # for streaming over network.
4664 #
4665 # Since: 4.0
4666 ##
4667 { 'enum': 'BlockdevVmdkSubformat',
4668 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4669 'twoGbMaxExtentFlat', 'streamOptimized'] }
4670
4671 ##
4672 # @BlockdevVmdkAdapterType:
4673 #
4674 # Adapter type info for VMDK images
4675 #
4676 # Since: 4.0
4677 ##
4678 { 'enum': 'BlockdevVmdkAdapterType',
4679 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4680
4681 ##
4682 # @BlockdevCreateOptionsVmdk:
4683 #
4684 # Driver specific image creation options for VMDK.
4685 #
4686 # @file: Where to store the new image file. This refers to the image
4687 # file for monolithcSparse and streamOptimized format, or the
4688 # descriptor file for other formats.
4689 # @size: Size of the virtual disk in bytes
4690 # @extents: Where to store the data extents. Required for monolithcFlat,
4691 # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4692 # monolithicFlat, only one entry is required; for
4693 # twoGbMaxExtent* formats, the number of entries required is
4694 # calculated as extent_number = virtual_size / 2GB. Providing
4695 # more extents than will be used is an error.
4696 # @subformat: The subformat of the VMDK image. Default: "monolithicSparse".
4697 # @backing-file: The path of backing file. Default: no backing file is used.
4698 # @adapter-type: The adapter type used to fill in the descriptor. Default: ide.
4699 # @hwversion: Hardware version. The meaningful options are "4" or "6".
4700 # Default: "4".
4701 # @toolsversion: VMware guest tools version.
4702 # Default: "2147483647" (Since 6.2)
4703 # @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats.
4704 # Default: false.
4705 #
4706 # Since: 4.0
4707 ##
4708 { 'struct': 'BlockdevCreateOptionsVmdk',
4709 'data': { 'file': 'BlockdevRef',
4710 'size': 'size',
4711 '*extents': ['BlockdevRef'],
4712 '*subformat': 'BlockdevVmdkSubformat',
4713 '*backing-file': 'str',
4714 '*adapter-type': 'BlockdevVmdkAdapterType',
4715 '*hwversion': 'str',
4716 '*toolsversion': 'str',
4717 '*zeroed-grain': 'bool' } }
4718
4719
4720 ##
4721 # @BlockdevCreateOptionsSsh:
4722 #
4723 # Driver specific image creation options for SSH.
4724 #
4725 # @location: Where to store the new image file
4726 # @size: Size of the virtual disk in bytes
4727 #
4728 # Since: 2.12
4729 ##
4730 { 'struct': 'BlockdevCreateOptionsSsh',
4731 'data': { 'location': 'BlockdevOptionsSsh',
4732 'size': 'size' } }
4733
4734 ##
4735 # @BlockdevCreateOptionsVdi:
4736 #
4737 # Driver specific image creation options for VDI.
4738 #
4739 # @file: Node to create the image format on
4740 # @size: Size of the virtual disk in bytes
4741 # @preallocation: Preallocation mode for the new image (default: off;
4742 # allowed values: off, metadata)
4743 #
4744 # Since: 2.12
4745 ##
4746 { 'struct': 'BlockdevCreateOptionsVdi',
4747 'data': { 'file': 'BlockdevRef',
4748 'size': 'size',
4749 '*preallocation': 'PreallocMode' } }
4750
4751 ##
4752 # @BlockdevVhdxSubformat:
4753 #
4754 # @dynamic: Growing image file
4755 # @fixed: Preallocated fixed-size image file
4756 #
4757 # Since: 2.12
4758 ##
4759 { 'enum': 'BlockdevVhdxSubformat',
4760 'data': [ 'dynamic', 'fixed' ] }
4761
4762 ##
4763 # @BlockdevCreateOptionsVhdx:
4764 #
4765 # Driver specific image creation options for vhdx.
4766 #
4767 # @file: Node to create the image format on
4768 # @size: Size of the virtual disk in bytes
4769 # @log-size: Log size in bytes, must be a multiple of 1 MB
4770 # (default: 1 MB)
4771 # @block-size: Block size in bytes, must be a multiple of 1 MB and not
4772 # larger than 256 MB (default: automatically choose a block
4773 # size depending on the image size)
4774 # @subformat: vhdx subformat (default: dynamic)
4775 # @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard,
4776 # but default. Do not set to 'off' when using 'qemu-img
4777 # convert' with subformat=dynamic.
4778 #
4779 # Since: 2.12
4780 ##
4781 { 'struct': 'BlockdevCreateOptionsVhdx',
4782 'data': { 'file': 'BlockdevRef',
4783 'size': 'size',
4784 '*log-size': 'size',
4785 '*block-size': 'size',
4786 '*subformat': 'BlockdevVhdxSubformat',
4787 '*block-state-zero': 'bool' } }
4788
4789 ##
4790 # @BlockdevVpcSubformat:
4791 #
4792 # @dynamic: Growing image file
4793 # @fixed: Preallocated fixed-size image file
4794 #
4795 # Since: 2.12
4796 ##
4797 { 'enum': 'BlockdevVpcSubformat',
4798 'data': [ 'dynamic', 'fixed' ] }
4799
4800 ##
4801 # @BlockdevCreateOptionsVpc:
4802 #
4803 # Driver specific image creation options for vpc (VHD).
4804 #
4805 # @file: Node to create the image format on
4806 # @size: Size of the virtual disk in bytes
4807 # @subformat: vhdx subformat (default: dynamic)
4808 # @force-size: Force use of the exact byte size instead of rounding to the
4809 # next size that can be represented in CHS geometry
4810 # (default: false)
4811 #
4812 # Since: 2.12
4813 ##
4814 { 'struct': 'BlockdevCreateOptionsVpc',
4815 'data': { 'file': 'BlockdevRef',
4816 'size': 'size',
4817 '*subformat': 'BlockdevVpcSubformat',
4818 '*force-size': 'bool' } }
4819
4820 ##
4821 # @BlockdevCreateOptions:
4822 #
4823 # Options for creating an image format on a given node.
4824 #
4825 # @driver: block driver to create the image format
4826 #
4827 # Since: 2.12
4828 ##
4829 { 'union': 'BlockdevCreateOptions',
4830 'base': {
4831 'driver': 'BlockdevDriver' },
4832 'discriminator': 'driver',
4833 'data': {
4834 'file': 'BlockdevCreateOptionsFile',
4835 'gluster': 'BlockdevCreateOptionsGluster',
4836 'luks': 'BlockdevCreateOptionsLUKS',
4837 'nfs': 'BlockdevCreateOptionsNfs',
4838 'parallels': 'BlockdevCreateOptionsParallels',
4839 'qcow': 'BlockdevCreateOptionsQcow',
4840 'qcow2': 'BlockdevCreateOptionsQcow2',
4841 'qed': 'BlockdevCreateOptionsQed',
4842 'rbd': 'BlockdevCreateOptionsRbd',
4843 'ssh': 'BlockdevCreateOptionsSsh',
4844 'vdi': 'BlockdevCreateOptionsVdi',
4845 'vhdx': 'BlockdevCreateOptionsVhdx',
4846 'vmdk': 'BlockdevCreateOptionsVmdk',
4847 'vpc': 'BlockdevCreateOptionsVpc'
4848 } }
4849
4850 ##
4851 # @blockdev-create:
4852 #
4853 # Starts a job to create an image format on a given node. The job is
4854 # automatically finalized, but a manual job-dismiss is required.
4855 #
4856 # @job-id: Identifier for the newly created job.
4857 #
4858 # @options: Options for the image creation.
4859 #
4860 # Since: 3.0
4861 ##
4862 { 'command': 'blockdev-create',
4863 'data': { 'job-id': 'str',
4864 'options': 'BlockdevCreateOptions' } }
4865
4866 ##
4867 # @BlockdevAmendOptionsLUKS:
4868 #
4869 # Driver specific image amend options for LUKS.
4870 #
4871 # Since: 5.1
4872 ##
4873 { 'struct': 'BlockdevAmendOptionsLUKS',
4874 'base': 'QCryptoBlockAmendOptionsLUKS',
4875 'data': { }
4876 }
4877
4878 ##
4879 # @BlockdevAmendOptionsQcow2:
4880 #
4881 # Driver specific image amend options for qcow2.
4882 # For now, only encryption options can be amended
4883 #
4884 # @encrypt Encryption options to be amended
4885 #
4886 # Since: 5.1
4887 ##
4888 { 'struct': 'BlockdevAmendOptionsQcow2',
4889 'data': { '*encrypt': 'QCryptoBlockAmendOptions' } }
4890
4891 ##
4892 # @BlockdevAmendOptions:
4893 #
4894 # Options for amending an image format
4895 #
4896 # @driver: Block driver of the node to amend.
4897 #
4898 # Since: 5.1
4899 ##
4900 { 'union': 'BlockdevAmendOptions',
4901 'base': {
4902 'driver': 'BlockdevDriver' },
4903 'discriminator': 'driver',
4904 'data': {
4905 'luks': 'BlockdevAmendOptionsLUKS',
4906 'qcow2': 'BlockdevAmendOptionsQcow2' } }
4907
4908 ##
4909 # @x-blockdev-amend:
4910 #
4911 # Starts a job to amend format specific options of an existing open block device
4912 # The job is automatically finalized, but a manual job-dismiss is required.
4913 #
4914 # @job-id: Identifier for the newly created job.
4915 #
4916 # @node-name: Name of the block node to work on
4917 #
4918 # @options: Options (driver specific)
4919 #
4920 # @force: Allow unsafe operations, format specific
4921 # For luks that allows erase of the last active keyslot
4922 # (permanent loss of data),
4923 # and replacement of an active keyslot
4924 # (possible loss of data if IO error happens)
4925 #
4926 # Features:
4927 # @unstable: This command is experimental.
4928 #
4929 # Since: 5.1
4930 ##
4931 { 'command': 'x-blockdev-amend',
4932 'data': { 'job-id': 'str',
4933 'node-name': 'str',
4934 'options': 'BlockdevAmendOptions',
4935 '*force': 'bool' },
4936 'features': [ 'unstable' ] }
4937
4938 ##
4939 # @BlockErrorAction:
4940 #
4941 # An enumeration of action that has been taken when a DISK I/O occurs
4942 #
4943 # @ignore: error has been ignored
4944 #
4945 # @report: error has been reported to the device
4946 #
4947 # @stop: error caused VM to be stopped
4948 #
4949 # Since: 2.1
4950 ##
4951 { 'enum': 'BlockErrorAction',
4952 'data': [ 'ignore', 'report', 'stop' ] }
4953
4954
4955 ##
4956 # @BLOCK_IMAGE_CORRUPTED:
4957 #
4958 # Emitted when a disk image is being marked corrupt. The image can be
4959 # identified by its device or node name. The 'device' field is always
4960 # present for compatibility reasons, but it can be empty ("") if the
4961 # image does not have a device name associated.
4962 #
4963 # @device: device name. This is always present for compatibility
4964 # reasons, but it can be empty ("") if the image does not
4965 # have a device name associated.
4966 #
4967 # @node-name: node name (Since: 2.4)
4968 #
4969 # @msg: informative message for human consumption, such as the kind of
4970 # corruption being detected. It should not be parsed by machine as it is
4971 # not guaranteed to be stable
4972 #
4973 # @offset: if the corruption resulted from an image access, this is
4974 # the host's access offset into the image
4975 #
4976 # @size: if the corruption resulted from an image access, this is
4977 # the access size
4978 #
4979 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4980 # event and must be repaired (Since 2.2; before, every
4981 # BLOCK_IMAGE_CORRUPTED event was fatal)
4982 #
4983 # Note: If action is "stop", a STOP event will eventually follow the
4984 # BLOCK_IO_ERROR event.
4985 #
4986 # Example:
4987 #
4988 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4989 # "data": { "device": "ide0-hd0", "node-name": "node0",
4990 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4991 # "size": 65536 },
4992 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4993 #
4994 # Since: 1.7
4995 ##
4996 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4997 'data': { 'device' : 'str',
4998 '*node-name' : 'str',
4999 'msg' : 'str',
5000 '*offset' : 'int',
5001 '*size' : 'int',
5002 'fatal' : 'bool' } }
5003
5004 ##
5005 # @BLOCK_IO_ERROR:
5006 #
5007 # Emitted when a disk I/O error occurs
5008 #
5009 # @device: device name. This is always present for compatibility
5010 # reasons, but it can be empty ("") if the image does not
5011 # have a device name associated.
5012 #
5013 # @node-name: node name. Note that errors may be reported for the root node
5014 # that is directly attached to a guest device rather than for the
5015 # node where the error occurred. The node name is not present if
5016 # the drive is empty. (Since: 2.8)
5017 #
5018 # @operation: I/O operation
5019 #
5020 # @action: action that has been taken
5021 #
5022 # @nospace: true if I/O error was caused due to a no-space
5023 # condition. This key is only present if query-block's
5024 # io-status is present, please see query-block documentation
5025 # for more information (since: 2.2)
5026 #
5027 # @reason: human readable string describing the error cause.
5028 # (This field is a debugging aid for humans, it should not
5029 # be parsed by applications) (since: 2.2)
5030 #
5031 # Note: If action is "stop", a STOP event will eventually follow the
5032 # BLOCK_IO_ERROR event
5033 #
5034 # Since: 0.13
5035 #
5036 # Example:
5037 #
5038 # <- { "event": "BLOCK_IO_ERROR",
5039 # "data": { "device": "ide0-hd1",
5040 # "node-name": "#block212",
5041 # "operation": "write",
5042 # "action": "stop" },
5043 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5044 #
5045 ##
5046 { 'event': 'BLOCK_IO_ERROR',
5047 'data': { 'device': 'str', '*node-name': 'str',
5048 'operation': 'IoOperationType',
5049 'action': 'BlockErrorAction', '*nospace': 'bool',
5050 'reason': 'str' } }
5051
5052 ##
5053 # @BLOCK_JOB_COMPLETED:
5054 #
5055 # Emitted when a block job has completed
5056 #
5057 # @type: job type
5058 #
5059 # @device: The job identifier. Originally the device name but other
5060 # values are allowed since QEMU 2.7
5061 #
5062 # @len: maximum progress value
5063 #
5064 # @offset: current progress value. On success this is equal to len.
5065 # On failure this is less than len
5066 #
5067 # @speed: rate limit, bytes per second
5068 #
5069 # @error: error message. Only present on failure. This field
5070 # contains a human-readable error message. There are no semantics
5071 # other than that streaming has failed and clients should not try to
5072 # interpret the error string
5073 #
5074 # Since: 1.1
5075 #
5076 # Example:
5077 #
5078 # <- { "event": "BLOCK_JOB_COMPLETED",
5079 # "data": { "type": "stream", "device": "virtio-disk0",
5080 # "len": 10737418240, "offset": 10737418240,
5081 # "speed": 0 },
5082 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5083 #
5084 ##
5085 { 'event': 'BLOCK_JOB_COMPLETED',
5086 'data': { 'type' : 'JobType',
5087 'device': 'str',
5088 'len' : 'int',
5089 'offset': 'int',
5090 'speed' : 'int',
5091 '*error': 'str' } }
5092
5093 ##
5094 # @BLOCK_JOB_CANCELLED:
5095 #
5096 # Emitted when a block job has been cancelled
5097 #
5098 # @type: job type
5099 #
5100 # @device: The job identifier. Originally the device name but other
5101 # values are allowed since QEMU 2.7
5102 #
5103 # @len: maximum progress value
5104 #
5105 # @offset: current progress value. On success this is equal to len.
5106 # On failure this is less than len
5107 #
5108 # @speed: rate limit, bytes per second
5109 #
5110 # Since: 1.1
5111 #
5112 # Example:
5113 #
5114 # <- { "event": "BLOCK_JOB_CANCELLED",
5115 # "data": { "type": "stream", "device": "virtio-disk0",
5116 # "len": 10737418240, "offset": 134217728,
5117 # "speed": 0 },
5118 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5119 #
5120 ##
5121 { 'event': 'BLOCK_JOB_CANCELLED',
5122 'data': { 'type' : 'JobType',
5123 'device': 'str',
5124 'len' : 'int',
5125 'offset': 'int',
5126 'speed' : 'int' } }
5127
5128 ##
5129 # @BLOCK_JOB_ERROR:
5130 #
5131 # Emitted when a block job encounters an error
5132 #
5133 # @device: The job identifier. Originally the device name but other
5134 # values are allowed since QEMU 2.7
5135 #
5136 # @operation: I/O operation
5137 #
5138 # @action: action that has been taken
5139 #
5140 # Since: 1.3
5141 #
5142 # Example:
5143 #
5144 # <- { "event": "BLOCK_JOB_ERROR",
5145 # "data": { "device": "ide0-hd1",
5146 # "operation": "write",
5147 # "action": "stop" },
5148 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5149 #
5150 ##
5151 { 'event': 'BLOCK_JOB_ERROR',
5152 'data': { 'device' : 'str',
5153 'operation': 'IoOperationType',
5154 'action' : 'BlockErrorAction' } }
5155
5156 ##
5157 # @BLOCK_JOB_READY:
5158 #
5159 # Emitted when a block job is ready to complete
5160 #
5161 # @type: job type
5162 #
5163 # @device: The job identifier. Originally the device name but other
5164 # values are allowed since QEMU 2.7
5165 #
5166 # @len: maximum progress value
5167 #
5168 # @offset: current progress value. On success this is equal to len.
5169 # On failure this is less than len
5170 #
5171 # @speed: rate limit, bytes per second
5172 #
5173 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
5174 # event
5175 #
5176 # Since: 1.3
5177 #
5178 # Example:
5179 #
5180 # <- { "event": "BLOCK_JOB_READY",
5181 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5182 # "len": 2097152, "offset": 2097152 }
5183 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5184 #
5185 ##
5186 { 'event': 'BLOCK_JOB_READY',
5187 'data': { 'type' : 'JobType',
5188 'device': 'str',
5189 'len' : 'int',
5190 'offset': 'int',
5191 'speed' : 'int' } }
5192
5193 ##
5194 # @BLOCK_JOB_PENDING:
5195 #
5196 # Emitted when a block job is awaiting explicit authorization to finalize graph
5197 # changes via @block-job-finalize. If this job is part of a transaction, it will
5198 # not emit this event until the transaction has converged first.
5199 #
5200 # @type: job type
5201 #
5202 # @id: The job identifier.
5203 #
5204 # Since: 2.12
5205 #
5206 # Example:
5207 #
5208 # <- { "event": "BLOCK_JOB_WAITING",
5209 # "data": { "device": "drive0", "type": "mirror" },
5210 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5211 #
5212 ##
5213 { 'event': 'BLOCK_JOB_PENDING',
5214 'data': { 'type' : 'JobType',
5215 'id' : 'str' } }
5216
5217 ##
5218 # @PreallocMode:
5219 #
5220 # Preallocation mode of QEMU image file
5221 #
5222 # @off: no preallocation
5223 # @metadata: preallocate only for metadata
5224 # @falloc: like @full preallocation but allocate disk space by
5225 # posix_fallocate() rather than writing data.
5226 # @full: preallocate all data by writing it to the device to ensure
5227 # disk space is really available. This data may or may not be
5228 # zero, depending on the image format and storage.
5229 # @full preallocation also sets up metadata correctly.
5230 #
5231 # Since: 2.2
5232 ##
5233 { 'enum': 'PreallocMode',
5234 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5235
5236 ##
5237 # @BLOCK_WRITE_THRESHOLD:
5238 #
5239 # Emitted when writes on block device reaches or exceeds the
5240 # configured write threshold. For thin-provisioned devices, this
5241 # means the device should be extended to avoid pausing for
5242 # disk exhaustion.
5243 # The event is one shot. Once triggered, it needs to be
5244 # re-registered with another block-set-write-threshold command.
5245 #
5246 # @node-name: graph node name on which the threshold was exceeded.
5247 #
5248 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5249 #
5250 # @write-threshold: last configured threshold, in bytes.
5251 #
5252 # Since: 2.3
5253 ##
5254 { 'event': 'BLOCK_WRITE_THRESHOLD',
5255 'data': { 'node-name': 'str',
5256 'amount-exceeded': 'uint64',
5257 'write-threshold': 'uint64' } }
5258
5259 ##
5260 # @block-set-write-threshold:
5261 #
5262 # Change the write threshold for a block drive. An event will be
5263 # delivered if a write to this block drive crosses the configured
5264 # threshold. The threshold is an offset, thus must be
5265 # non-negative. Default is no write threshold. Setting the threshold
5266 # to zero disables it.
5267 #
5268 # This is useful to transparently resize thin-provisioned drives without
5269 # the guest OS noticing.
5270 #
5271 # @node-name: graph node name on which the threshold must be set.
5272 #
5273 # @write-threshold: configured threshold for the block device, bytes.
5274 # Use 0 to disable the threshold.
5275 #
5276 # Since: 2.3
5277 #
5278 # Example:
5279 #
5280 # -> { "execute": "block-set-write-threshold",
5281 # "arguments": { "node-name": "mydev",
5282 # "write-threshold": 17179869184 } }
5283 # <- { "return": {} }
5284 #
5285 ##
5286 { 'command': 'block-set-write-threshold',
5287 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
5288
5289 ##
5290 # @x-blockdev-change:
5291 #
5292 # Dynamically reconfigure the block driver state graph. It can be used
5293 # to add, remove, insert or replace a graph node. Currently only the
5294 # Quorum driver implements this feature to add or remove its child. This
5295 # is useful to fix a broken quorum child.
5296 #
5297 # If @node is specified, it will be inserted under @parent. @child
5298 # may not be specified in this case. If both @parent and @child are
5299 # specified but @node is not, @child will be detached from @parent.
5300 #
5301 # @parent: the id or name of the parent node.
5302 #
5303 # @child: the name of a child under the given parent node.
5304 #
5305 # @node: the name of the node that will be added.
5306 #
5307 # Features:
5308 # @unstable: This command is experimental, and its API is not stable. It
5309 # does not support all kinds of operations, all kinds of
5310 # children, nor all block drivers.
5311 #
5312 # FIXME Removing children from a quorum node means introducing
5313 # gaps in the child indices. This cannot be represented in the
5314 # 'children' list of BlockdevOptionsQuorum, as returned by
5315 # .bdrv_refresh_filename().
5316 #
5317 # Warning: The data in a new quorum child MUST be consistent
5318 # with that of the rest of the array.
5319 #
5320 # Since: 2.7
5321 #
5322 # Example:
5323 #
5324 # 1. Add a new node to a quorum
5325 # -> { "execute": "blockdev-add",
5326 # "arguments": {
5327 # "driver": "raw",
5328 # "node-name": "new_node",
5329 # "file": { "driver": "file",
5330 # "filename": "test.raw" } } }
5331 # <- { "return": {} }
5332 # -> { "execute": "x-blockdev-change",
5333 # "arguments": { "parent": "disk1",
5334 # "node": "new_node" } }
5335 # <- { "return": {} }
5336 #
5337 # 2. Delete a quorum's node
5338 # -> { "execute": "x-blockdev-change",
5339 # "arguments": { "parent": "disk1",
5340 # "child": "children.1" } }
5341 # <- { "return": {} }
5342 #
5343 ##
5344 { 'command': 'x-blockdev-change',
5345 'data' : { 'parent': 'str',
5346 '*child': 'str',
5347 '*node': 'str' },
5348 'features': [ 'unstable' ] }
5349
5350 ##
5351 # @x-blockdev-set-iothread:
5352 #
5353 # Move @node and its children into the @iothread. If @iothread is null then
5354 # move @node and its children into the main loop.
5355 #
5356 # The node must not be attached to a BlockBackend.
5357 #
5358 # @node-name: the name of the block driver node
5359 #
5360 # @iothread: the name of the IOThread object or null for the main loop
5361 #
5362 # @force: true if the node and its children should be moved when a BlockBackend
5363 # is already attached
5364 #
5365 # Features:
5366 # @unstable: This command is experimental and intended for test cases that
5367 # need control over IOThreads only.
5368 #
5369 # Since: 2.12
5370 #
5371 # Example:
5372 #
5373 # 1. Move a node into an IOThread
5374 # -> { "execute": "x-blockdev-set-iothread",
5375 # "arguments": { "node-name": "disk1",
5376 # "iothread": "iothread0" } }
5377 # <- { "return": {} }
5378 #
5379 # 2. Move a node into the main loop
5380 # -> { "execute": "x-blockdev-set-iothread",
5381 # "arguments": { "node-name": "disk1",
5382 # "iothread": null } }
5383 # <- { "return": {} }
5384 #
5385 ##
5386 { 'command': 'x-blockdev-set-iothread',
5387 'data' : { 'node-name': 'str',
5388 'iothread': 'StrOrNull',
5389 '*force': 'bool' },
5390 'features': [ 'unstable' ] }
5391
5392 ##
5393 # @QuorumOpType:
5394 #
5395 # An enumeration of the quorum operation types
5396 #
5397 # @read: read operation
5398 #
5399 # @write: write operation
5400 #
5401 # @flush: flush operation
5402 #
5403 # Since: 2.6
5404 ##
5405 { 'enum': 'QuorumOpType',
5406 'data': [ 'read', 'write', 'flush' ] }
5407
5408 ##
5409 # @QUORUM_FAILURE:
5410 #
5411 # Emitted by the Quorum block driver if it fails to establish a quorum
5412 #
5413 # @reference: device name if defined else node name
5414 #
5415 # @sector-num: number of the first sector of the failed read operation
5416 #
5417 # @sectors-count: failed read operation sector count
5418 #
5419 # Note: This event is rate-limited.
5420 #
5421 # Since: 2.0
5422 #
5423 # Example:
5424 #
5425 # <- { "event": "QUORUM_FAILURE",
5426 # "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
5427 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5428 #
5429 ##
5430 { 'event': 'QUORUM_FAILURE',
5431 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
5432
5433 ##
5434 # @QUORUM_REPORT_BAD:
5435 #
5436 # Emitted to report a corruption of a Quorum file
5437 #
5438 # @type: quorum operation type (Since 2.6)
5439 #
5440 # @error: error message. Only present on failure. This field
5441 # contains a human-readable error message. There are no semantics other
5442 # than that the block layer reported an error and clients should not
5443 # try to interpret the error string.
5444 #
5445 # @node-name: the graph node name of the block driver state
5446 #
5447 # @sector-num: number of the first sector of the failed read operation
5448 #
5449 # @sectors-count: failed read operation sector count
5450 #
5451 # Note: This event is rate-limited.
5452 #
5453 # Since: 2.0
5454 #
5455 # Example:
5456 #
5457 # 1. Read operation
5458 #
5459 # { "event": "QUORUM_REPORT_BAD",
5460 # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
5461 # "type": "read" },
5462 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
5463 #
5464 # 2. Flush operation
5465 #
5466 # { "event": "QUORUM_REPORT_BAD",
5467 # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
5468 # "type": "flush", "error": "Broken pipe" },
5469 # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
5470 #
5471 ##
5472 { 'event': 'QUORUM_REPORT_BAD',
5473 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
5474 'sector-num': 'int', 'sectors-count': 'int' } }
5475
5476 ##
5477 # @BlockdevSnapshotInternal:
5478 #
5479 # @device: the device name or node-name of a root node to generate the snapshot
5480 # from
5481 #
5482 # @name: the name of the internal snapshot to be created
5483 #
5484 # Notes: In transaction, if @name is empty, or any snapshot matching @name
5485 # exists, the operation will fail. Only some image formats support it,
5486 # for example, qcow2, and rbd.
5487 #
5488 # Since: 1.7
5489 ##
5490 { 'struct': 'BlockdevSnapshotInternal',
5491 'data': { 'device': 'str', 'name': 'str' } }
5492
5493 ##
5494 # @blockdev-snapshot-internal-sync:
5495 #
5496 # Synchronously take an internal snapshot of a block device, when the
5497 # format of the image used supports it. If the name is an empty
5498 # string, or a snapshot with name already exists, the operation will
5499 # fail.
5500 #
5501 # For the arguments, see the documentation of BlockdevSnapshotInternal.
5502 #
5503 # Returns: - nothing on success
5504 # - If @device is not a valid block device, GenericError
5505 # - If any snapshot matching @name exists, or @name is empty,
5506 # GenericError
5507 # - If the format of the image used does not support it,
5508 # BlockFormatFeatureNotSupported
5509 #
5510 # Since: 1.7
5511 #
5512 # Example:
5513 #
5514 # -> { "execute": "blockdev-snapshot-internal-sync",
5515 # "arguments": { "device": "ide-hd0",
5516 # "name": "snapshot0" }
5517 # }
5518 # <- { "return": {} }
5519 #
5520 ##
5521 { 'command': 'blockdev-snapshot-internal-sync',
5522 'data': 'BlockdevSnapshotInternal' }
5523
5524 ##
5525 # @blockdev-snapshot-delete-internal-sync:
5526 #
5527 # Synchronously delete an internal snapshot of a block device, when the format
5528 # of the image used support it. The snapshot is identified by name or id or
5529 # both. One of the name or id is required. Return SnapshotInfo for the
5530 # successfully deleted snapshot.
5531 #
5532 # @device: the device name or node-name of a root node to delete the snapshot
5533 # from
5534 #
5535 # @id: optional the snapshot's ID to be deleted
5536 #
5537 # @name: optional the snapshot's name to be deleted
5538 #
5539 # Returns: - SnapshotInfo on success
5540 # - If @device is not a valid block device, GenericError
5541 # - If snapshot not found, GenericError
5542 # - If the format of the image used does not support it,
5543 # BlockFormatFeatureNotSupported
5544 # - If @id and @name are both not specified, GenericError
5545 #
5546 # Since: 1.7
5547 #
5548 # Example:
5549 #
5550 # -> { "execute": "blockdev-snapshot-delete-internal-sync",
5551 # "arguments": { "device": "ide-hd0",
5552 # "name": "snapshot0" }
5553 # }
5554 # <- { "return": {
5555 # "id": "1",
5556 # "name": "snapshot0",
5557 # "vm-state-size": 0,
5558 # "date-sec": 1000012,
5559 # "date-nsec": 10,
5560 # "vm-clock-sec": 100,
5561 # "vm-clock-nsec": 20,
5562 # "icount": 220414
5563 # }
5564 # }
5565 #
5566 ##
5567 { 'command': 'blockdev-snapshot-delete-internal-sync',
5568 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
5569 'returns': 'SnapshotInfo' }