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