]> git.proxmox.com Git - mirror_qemu.git/blob - qapi/block-core.json
06eb3bb3d78543555cac7fc704d5ef8e842f4a95
[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 @id 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": { "id": "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": { "id": "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": { "id": "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": { "id": "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 # @BitmapSyncMode:
1139 #
1140 # An enumeration of possible behaviors for the synchronization of a bitmap
1141 # when used for data copy operations.
1142 #
1143 # @on-success: The bitmap is only synced when the operation is successful.
1144 # This is the behavior always used for 'INCREMENTAL' backups.
1145 #
1146 # Since: 4.2
1147 ##
1148 { 'enum': 'BitmapSyncMode',
1149 'data': ['on-success'] }
1150
1151 ##
1152 # @MirrorCopyMode:
1153 #
1154 # An enumeration whose values tell the mirror block job when to
1155 # trigger writes to the target.
1156 #
1157 # @background: copy data in background only.
1158 #
1159 # @write-blocking: when data is written to the source, write it
1160 # (synchronously) to the target as well. In
1161 # addition, data is copied in background just like in
1162 # @background mode.
1163 #
1164 # Since: 3.0
1165 ##
1166 { 'enum': 'MirrorCopyMode',
1167 'data': ['background', 'write-blocking'] }
1168
1169 ##
1170 # @BlockJobInfo:
1171 #
1172 # Information about a long-running block device operation.
1173 #
1174 # @type: the job type ('stream' for image streaming)
1175 #
1176 # @device: The job identifier. Originally the device name but other
1177 # values are allowed since QEMU 2.7
1178 #
1179 # @len: Estimated @offset value at the completion of the job. This value can
1180 # arbitrarily change while the job is running, in both directions.
1181 #
1182 # @offset: Progress made until now. The unit is arbitrary and the value can
1183 # only meaningfully be used for the ratio of @offset to @len. The
1184 # value is monotonically increasing.
1185 #
1186 # @busy: false if the job is known to be in a quiescent state, with
1187 # no pending I/O. Since 1.3.
1188 #
1189 # @paused: whether the job is paused or, if @busy is true, will
1190 # pause itself as soon as possible. Since 1.3.
1191 #
1192 # @speed: the rate limit, bytes per second
1193 #
1194 # @io-status: the status of the job (since 1.3)
1195 #
1196 # @ready: true if the job may be completed (since 2.2)
1197 #
1198 # @status: Current job state/status (since 2.12)
1199 #
1200 # @auto-finalize: Job will finalize itself when PENDING, moving to
1201 # the CONCLUDED state. (since 2.12)
1202 #
1203 # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL
1204 # state and disappearing from the query list. (since 2.12)
1205 #
1206 # @error: Error information if the job did not complete successfully.
1207 # Not set if the job completed successfully. (since 2.12.1)
1208 #
1209 # Since: 1.1
1210 ##
1211 { 'struct': 'BlockJobInfo',
1212 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1213 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1214 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool',
1215 'status': 'JobStatus',
1216 'auto-finalize': 'bool', 'auto-dismiss': 'bool',
1217 '*error': 'str' } }
1218
1219 ##
1220 # @query-block-jobs:
1221 #
1222 # Return information about long-running block device operations.
1223 #
1224 # Returns: a list of @BlockJobInfo for each active block job
1225 #
1226 # Since: 1.1
1227 ##
1228 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1229
1230 ##
1231 # @block_passwd:
1232 #
1233 # This command sets the password of a block device that has not been open
1234 # with a password and requires one.
1235 #
1236 # This command is now obsolete and will always return an error since 2.10
1237 #
1238 ##
1239 { 'command': 'block_passwd',
1240 'data': { '*device': 'str',
1241 '*node-name': 'str',
1242 'password': 'str' } }
1243
1244 ##
1245 # @block_resize:
1246 #
1247 # Resize a block image while a guest is running.
1248 #
1249 # Either @device or @node-name must be set but not both.
1250 #
1251 # @device: the name of the device to get the image resized
1252 #
1253 # @node-name: graph node name to get the image resized (Since 2.0)
1254 #
1255 # @size: new image size in bytes
1256 #
1257 # Returns: nothing on success
1258 # If @device is not a valid block device, DeviceNotFound
1259 #
1260 # Since: 0.14.0
1261 #
1262 # Example:
1263 #
1264 # -> { "execute": "block_resize",
1265 # "arguments": { "device": "scratch", "size": 1073741824 } }
1266 # <- { "return": {} }
1267 #
1268 ##
1269 { 'command': 'block_resize',
1270 'data': { '*device': 'str',
1271 '*node-name': 'str',
1272 'size': 'int' } }
1273
1274 ##
1275 # @NewImageMode:
1276 #
1277 # An enumeration that tells QEMU how to set the backing file path in
1278 # a new image file.
1279 #
1280 # @existing: QEMU should look for an existing image file.
1281 #
1282 # @absolute-paths: QEMU should create a new image with absolute paths
1283 # for the backing file. If there is no backing file available, the new
1284 # image will not be backed either.
1285 #
1286 # Since: 1.1
1287 ##
1288 { 'enum': 'NewImageMode',
1289 'data': [ 'existing', 'absolute-paths' ] }
1290
1291 ##
1292 # @BlockdevSnapshotSync:
1293 #
1294 # Either @device or @node-name must be set but not both.
1295 #
1296 # @device: the name of the device to take a snapshot of.
1297 #
1298 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1299 #
1300 # @snapshot-file: the target of the new overlay image. If the file
1301 # exists, or if it is a device, the overlay will be created in the
1302 # existing file/device. Otherwise, a new file will be created.
1303 #
1304 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1305 #
1306 # @format: the format of the overlay image, default is 'qcow2'.
1307 #
1308 # @mode: whether and how QEMU should create a new image, default is
1309 # 'absolute-paths'.
1310 ##
1311 { 'struct': 'BlockdevSnapshotSync',
1312 'data': { '*device': 'str', '*node-name': 'str',
1313 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1314 '*format': 'str', '*mode': 'NewImageMode' } }
1315
1316 ##
1317 # @BlockdevSnapshot:
1318 #
1319 # @node: device or node name that will have a snapshot taken.
1320 #
1321 # @overlay: reference to the existing block device that will become
1322 # the overlay of @node, as part of taking the snapshot.
1323 # It must not have a current backing file (this can be
1324 # achieved by passing "backing": null to blockdev-add).
1325 #
1326 # Since: 2.5
1327 ##
1328 { 'struct': 'BlockdevSnapshot',
1329 'data': { 'node': 'str', 'overlay': 'str' } }
1330
1331 ##
1332 # @BackupCommon:
1333 #
1334 # @job-id: identifier for the newly-created block job. If
1335 # omitted, the device name will be used. (Since 2.7)
1336 #
1337 # @device: the device name or node-name of a root node which should be copied.
1338 #
1339 # @sync: what parts of the disk image should be copied to the destination
1340 # (all the disk, only the sectors allocated in the topmost image, from a
1341 # dirty bitmap, or only new I/O).
1342 #
1343 # @speed: the maximum speed, in bytes per second. The default is 0,
1344 # for unlimited.
1345 #
1346 # @bitmap: the name of dirty bitmap if sync is "incremental".
1347 # Must be present if sync is "incremental", must NOT be present
1348 # otherwise. (Since 2.4 (drive-backup), 3.1 (blockdev-backup))
1349 #
1350 # @compress: true to compress data, if the target format supports it.
1351 # (default: false) (since 2.8)
1352 #
1353 # @on-source-error: the action to take on an error on the source,
1354 # default 'report'. 'stop' and 'enospc' can only be used
1355 # if the block device supports io-status (see BlockInfo).
1356 #
1357 # @on-target-error: the action to take on an error on the target,
1358 # default 'report' (no limitations, since this applies to
1359 # a different block device than @device).
1360 #
1361 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1362 # finished its work, waiting for @block-job-finalize before
1363 # making any block graph changes.
1364 # When true, this job will automatically
1365 # perform its abort or commit actions.
1366 # Defaults to true. (Since 2.12)
1367 #
1368 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1369 # has completely ceased all work, and awaits @block-job-dismiss.
1370 # When true, this job will automatically disappear from the query
1371 # list without user intervention.
1372 # Defaults to true. (Since 2.12)
1373 #
1374 # Note: @on-source-error and @on-target-error only affect background
1375 # I/O. If an error occurs during a guest write request, the device's
1376 # rerror/werror actions will be used.
1377 #
1378 # Since: 4.2
1379 ##
1380 { 'struct': 'BackupCommon',
1381 'data': { '*job-id': 'str', 'device': 'str',
1382 'sync': 'MirrorSyncMode', '*speed': 'int',
1383 '*bitmap': 'str', '*compress': 'bool',
1384 '*on-source-error': 'BlockdevOnError',
1385 '*on-target-error': 'BlockdevOnError',
1386 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1387
1388 ##
1389 # @DriveBackup:
1390 #
1391 # @target: the target of the new image. If the file exists, or if it
1392 # is a device, the existing file/device will be used as the new
1393 # destination. If it does not exist, a new file will be created.
1394 #
1395 # @format: the format of the new destination, default is to
1396 # probe if @mode is 'existing', else the format of the source
1397 #
1398 # @mode: whether and how QEMU should create a new image, default is
1399 # 'absolute-paths'.
1400 #
1401 # Since: 1.6
1402 ##
1403 { 'struct': 'DriveBackup',
1404 'base': 'BackupCommon',
1405 'data': { 'target': 'str',
1406 '*format': 'str',
1407 '*mode': 'NewImageMode' } }
1408
1409 ##
1410 # @BlockdevBackup:
1411 #
1412 # @target: the device name or node-name of the backup target node.
1413 #
1414 # Since: 2.3
1415 ##
1416 { 'struct': 'BlockdevBackup',
1417 'base': 'BackupCommon',
1418 'data': { 'target': 'str' } }
1419
1420 ##
1421 # @blockdev-snapshot-sync:
1422 #
1423 # Takes a synchronous snapshot of a block device.
1424 #
1425 # For the arguments, see the documentation of BlockdevSnapshotSync.
1426 #
1427 # Returns: nothing on success
1428 # If @device is not a valid block device, DeviceNotFound
1429 #
1430 # Since: 0.14.0
1431 #
1432 # Example:
1433 #
1434 # -> { "execute": "blockdev-snapshot-sync",
1435 # "arguments": { "device": "ide-hd0",
1436 # "snapshot-file":
1437 # "/some/place/my-image",
1438 # "format": "qcow2" } }
1439 # <- { "return": {} }
1440 #
1441 ##
1442 { 'command': 'blockdev-snapshot-sync',
1443 'data': 'BlockdevSnapshotSync' }
1444
1445
1446 ##
1447 # @blockdev-snapshot:
1448 #
1449 # Takes a snapshot of a block device.
1450 #
1451 # Take a snapshot, by installing 'node' as the backing image of
1452 # 'overlay'. Additionally, if 'node' is associated with a block
1453 # device, the block device changes to using 'overlay' as its new active
1454 # image.
1455 #
1456 # For the arguments, see the documentation of BlockdevSnapshot.
1457 #
1458 # Since: 2.5
1459 #
1460 # Example:
1461 #
1462 # -> { "execute": "blockdev-add",
1463 # "arguments": { "driver": "qcow2",
1464 # "node-name": "node1534",
1465 # "file": { "driver": "file",
1466 # "filename": "hd1.qcow2" },
1467 # "backing": null } }
1468 #
1469 # <- { "return": {} }
1470 #
1471 # -> { "execute": "blockdev-snapshot",
1472 # "arguments": { "node": "ide-hd0",
1473 # "overlay": "node1534" } }
1474 # <- { "return": {} }
1475 #
1476 ##
1477 { 'command': 'blockdev-snapshot',
1478 'data': 'BlockdevSnapshot' }
1479
1480 ##
1481 # @change-backing-file:
1482 #
1483 # Change the backing file in the image file metadata. This does not
1484 # cause QEMU to reopen the image file to reparse the backing filename
1485 # (it may, however, perform a reopen to change permissions from
1486 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1487 # into the image file metadata, and the QEMU internal strings are
1488 # updated.
1489 #
1490 # @image-node-name: The name of the block driver state node of the
1491 # image to modify. The "device" argument is used
1492 # to verify "image-node-name" is in the chain
1493 # described by "device".
1494 #
1495 # @device: The device name or node-name of the root node that owns
1496 # image-node-name.
1497 #
1498 # @backing-file: The string to write as the backing file. This
1499 # string is not validated, so care should be taken
1500 # when specifying the string or the image chain may
1501 # not be able to be reopened again.
1502 #
1503 # Returns: Nothing on success
1504 #
1505 # If "device" does not exist or cannot be determined, DeviceNotFound
1506 #
1507 # Since: 2.1
1508 ##
1509 { 'command': 'change-backing-file',
1510 'data': { 'device': 'str', 'image-node-name': 'str',
1511 'backing-file': 'str' } }
1512
1513 ##
1514 # @block-commit:
1515 #
1516 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1517 # writes data between 'top' and 'base' into 'base'.
1518 #
1519 # @job-id: identifier for the newly-created block job. If
1520 # omitted, the device name will be used. (Since 2.7)
1521 #
1522 # @device: the device name or node-name of a root node
1523 #
1524 # @base-node: The node name of the backing image to write data into.
1525 # If not specified, this is the deepest backing image.
1526 # (since: 3.1)
1527 #
1528 # @base: Same as @base-node, except that it is a file name rather than a node
1529 # name. This must be the exact filename string that was used to open the
1530 # node; other strings, even if addressing the same file, are not
1531 # accepted (deprecated, use @base-node instead)
1532 #
1533 # @top-node: The node name of the backing image within the image chain
1534 # which contains the topmost data to be committed down. If
1535 # not specified, this is the active layer. (since: 3.1)
1536 #
1537 # @top: Same as @top-node, except that it is a file name rather than a node
1538 # name. This must be the exact filename string that was used to open the
1539 # node; other strings, even if addressing the same file, are not
1540 # accepted (deprecated, use @base-node instead)
1541 #
1542 # @backing-file: The backing file string to write into the overlay
1543 # image of 'top'. If 'top' is the active layer,
1544 # specifying a backing file string is an error. This
1545 # filename is not validated.
1546 #
1547 # If a pathname string is such that it cannot be
1548 # resolved by QEMU, that means that subsequent QMP or
1549 # HMP commands must use node-names for the image in
1550 # question, as filename lookup methods will fail.
1551 #
1552 # If not specified, QEMU will automatically determine
1553 # the backing file string to use, or error out if
1554 # there is no obvious choice. Care should be taken
1555 # when specifying the string, to specify a valid
1556 # filename or protocol.
1557 # (Since 2.1)
1558 #
1559 # If top == base, that is an error.
1560 # If top == active, the job will not be completed by itself,
1561 # user needs to complete the job with the block-job-complete
1562 # command after getting the ready event. (Since 2.0)
1563 #
1564 # If the base image is smaller than top, then the base image
1565 # will be resized to be the same size as top. If top is
1566 # smaller than the base image, the base will not be
1567 # truncated. If you want the base image size to match the
1568 # size of the smaller top, you can safely truncate it
1569 # yourself once the commit operation successfully completes.
1570 #
1571 # @speed: the maximum speed, in bytes per second
1572 #
1573 # @filter-node-name: the node name that should be assigned to the
1574 # filter driver that the commit job inserts into the graph
1575 # above @top. If this option is not given, a node name is
1576 # autogenerated. (Since: 2.9)
1577 #
1578 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1579 # finished its work, waiting for @block-job-finalize before
1580 # making any block graph changes.
1581 # When true, this job will automatically
1582 # perform its abort or commit actions.
1583 # Defaults to true. (Since 3.1)
1584 #
1585 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1586 # has completely ceased all work, and awaits @block-job-dismiss.
1587 # When true, this job will automatically disappear from the query
1588 # list without user intervention.
1589 # Defaults to true. (Since 3.1)
1590 #
1591 # Returns: Nothing on success
1592 # If @device does not exist, DeviceNotFound
1593 # Any other error returns a GenericError.
1594 #
1595 # Since: 1.3
1596 #
1597 # Example:
1598 #
1599 # -> { "execute": "block-commit",
1600 # "arguments": { "device": "virtio0",
1601 # "top": "/tmp/snap1.qcow2" } }
1602 # <- { "return": {} }
1603 #
1604 ##
1605 { 'command': 'block-commit',
1606 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str',
1607 '*base': 'str', '*top-node': 'str', '*top': 'str',
1608 '*backing-file': 'str', '*speed': 'int',
1609 '*filter-node-name': 'str',
1610 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1611
1612 ##
1613 # @drive-backup:
1614 #
1615 # Start a point-in-time copy of a block device to a new destination. The
1616 # status of ongoing drive-backup operations can be checked with
1617 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1618 # The operation can be stopped before it has completed using the
1619 # block-job-cancel command.
1620 #
1621 # Returns: nothing on success
1622 # If @device is not a valid block device, GenericError
1623 #
1624 # Since: 1.6
1625 #
1626 # Example:
1627 #
1628 # -> { "execute": "drive-backup",
1629 # "arguments": { "device": "drive0",
1630 # "sync": "full",
1631 # "target": "backup.img" } }
1632 # <- { "return": {} }
1633 #
1634 ##
1635 { 'command': 'drive-backup', 'boxed': true,
1636 'data': 'DriveBackup' }
1637
1638 ##
1639 # @blockdev-backup:
1640 #
1641 # Start a point-in-time copy of a block device to a new destination. The
1642 # status of ongoing blockdev-backup operations can be checked with
1643 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1644 # The operation can be stopped before it has completed using the
1645 # block-job-cancel command.
1646 #
1647 # Returns: nothing on success
1648 # If @device is not a valid block device, DeviceNotFound
1649 #
1650 # Since: 2.3
1651 #
1652 # Example:
1653 # -> { "execute": "blockdev-backup",
1654 # "arguments": { "device": "src-id",
1655 # "sync": "full",
1656 # "target": "tgt-id" } }
1657 # <- { "return": {} }
1658 #
1659 ##
1660 { 'command': 'blockdev-backup', 'boxed': true,
1661 'data': 'BlockdevBackup' }
1662
1663
1664 ##
1665 # @query-named-block-nodes:
1666 #
1667 # Get the named block driver list
1668 #
1669 # Returns: the list of BlockDeviceInfo
1670 #
1671 # Since: 2.0
1672 #
1673 # Example:
1674 #
1675 # -> { "execute": "query-named-block-nodes" }
1676 # <- { "return": [ { "ro":false,
1677 # "drv":"qcow2",
1678 # "encrypted":false,
1679 # "file":"disks/test.qcow2",
1680 # "node-name": "my-node",
1681 # "backing_file_depth":1,
1682 # "bps":1000000,
1683 # "bps_rd":0,
1684 # "bps_wr":0,
1685 # "iops":1000000,
1686 # "iops_rd":0,
1687 # "iops_wr":0,
1688 # "bps_max": 8000000,
1689 # "bps_rd_max": 0,
1690 # "bps_wr_max": 0,
1691 # "iops_max": 0,
1692 # "iops_rd_max": 0,
1693 # "iops_wr_max": 0,
1694 # "iops_size": 0,
1695 # "write_threshold": 0,
1696 # "image":{
1697 # "filename":"disks/test.qcow2",
1698 # "format":"qcow2",
1699 # "virtual-size":2048000,
1700 # "backing_file":"base.qcow2",
1701 # "full-backing-filename":"disks/base.qcow2",
1702 # "backing-filename-format":"qcow2",
1703 # "snapshots":[
1704 # {
1705 # "id": "1",
1706 # "name": "snapshot1",
1707 # "vm-state-size": 0,
1708 # "date-sec": 10000200,
1709 # "date-nsec": 12,
1710 # "vm-clock-sec": 206,
1711 # "vm-clock-nsec": 30
1712 # }
1713 # ],
1714 # "backing-image":{
1715 # "filename":"disks/base.qcow2",
1716 # "format":"qcow2",
1717 # "virtual-size":2048000
1718 # }
1719 # } } ] }
1720 #
1721 ##
1722 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1723
1724 ##
1725 # @XDbgBlockGraphNodeType:
1726 #
1727 # @block-backend: corresponds to BlockBackend
1728 #
1729 # @block-job: corresonds to BlockJob
1730 #
1731 # @block-driver: corresponds to BlockDriverState
1732 #
1733 # Since: 4.0
1734 ##
1735 { 'enum': 'XDbgBlockGraphNodeType',
1736 'data': [ 'block-backend', 'block-job', 'block-driver' ] }
1737
1738 ##
1739 # @XDbgBlockGraphNode:
1740 #
1741 # @id: Block graph node identifier. This @id is generated only for
1742 # x-debug-query-block-graph and does not relate to any other identifiers in
1743 # Qemu.
1744 #
1745 # @type: Type of graph node. Can be one of block-backend, block-job or
1746 # block-driver-state.
1747 #
1748 # @name: Human readable name of the node. Corresponds to node-name for
1749 # block-driver-state nodes; is not guaranteed to be unique in the whole
1750 # graph (with block-jobs and block-backends).
1751 #
1752 # Since: 4.0
1753 ##
1754 { 'struct': 'XDbgBlockGraphNode',
1755 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } }
1756
1757 ##
1758 # @BlockPermission:
1759 #
1760 # Enum of base block permissions.
1761 #
1762 # @consistent-read: A user that has the "permission" of consistent reads is
1763 # guaranteed that their view of the contents of the block
1764 # device is complete and self-consistent, representing the
1765 # contents of a disk at a specific point.
1766 # For most block devices (including their backing files) this
1767 # is true, but the property cannot be maintained in a few
1768 # situations like for intermediate nodes of a commit block
1769 # job.
1770 #
1771 # @write: This permission is required to change the visible disk contents.
1772 #
1773 # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is
1774 # both enough and required for writes to the block node when
1775 # the caller promises that the visible disk content doesn't
1776 # change.
1777 # As the BLK_PERM_WRITE permission is strictly stronger,
1778 # either is sufficient to perform an unchanging write.
1779 #
1780 # @resize: This permission is required to change the size of a block node.
1781 #
1782 # @graph-mod: This permission is required to change the node that this
1783 # BdrvChild points to.
1784 #
1785 # Since: 4.0
1786 ##
1787 { 'enum': 'BlockPermission',
1788 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
1789 'graph-mod' ] }
1790 ##
1791 # @XDbgBlockGraphEdge:
1792 #
1793 # Block Graph edge description for x-debug-query-block-graph.
1794 #
1795 # @parent: parent id
1796 #
1797 # @child: child id
1798 #
1799 # @name: name of the relation (examples are 'file' and 'backing')
1800 #
1801 # @perm: granted permissions for the parent operating on the child
1802 #
1803 # @shared-perm: permissions that can still be granted to other users of the
1804 # child while it is still attached to this parent
1805 #
1806 # Since: 4.0
1807 ##
1808 { 'struct': 'XDbgBlockGraphEdge',
1809 'data': { 'parent': 'uint64', 'child': 'uint64',
1810 'name': 'str', 'perm': [ 'BlockPermission' ],
1811 'shared-perm': [ 'BlockPermission' ] } }
1812
1813 ##
1814 # @XDbgBlockGraph:
1815 #
1816 # Block Graph - list of nodes and list of edges.
1817 #
1818 # Since: 4.0
1819 ##
1820 { 'struct': 'XDbgBlockGraph',
1821 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } }
1822
1823 ##
1824 # @x-debug-query-block-graph:
1825 #
1826 # Get the block graph.
1827 #
1828 # Since: 4.0
1829 ##
1830 { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph' }
1831
1832 ##
1833 # @drive-mirror:
1834 #
1835 # Start mirroring a block device's writes to a new destination. target
1836 # specifies the target of the new image. If the file exists, or if it
1837 # is a device, it will be used as the new destination for writes. If
1838 # it does not exist, a new file will be created. format specifies the
1839 # format of the mirror image, default is to probe if mode='existing',
1840 # else the format of the source.
1841 #
1842 # Returns: nothing on success
1843 # If @device is not a valid block device, GenericError
1844 #
1845 # Since: 1.3
1846 #
1847 # Example:
1848 #
1849 # -> { "execute": "drive-mirror",
1850 # "arguments": { "device": "ide-hd0",
1851 # "target": "/some/place/my-image",
1852 # "sync": "full",
1853 # "format": "qcow2" } }
1854 # <- { "return": {} }
1855 #
1856 ##
1857 { 'command': 'drive-mirror', 'boxed': true,
1858 'data': 'DriveMirror' }
1859
1860 ##
1861 # @DriveMirror:
1862 #
1863 # A set of parameters describing drive mirror setup.
1864 #
1865 # @job-id: identifier for the newly-created block job. If
1866 # omitted, the device name will be used. (Since 2.7)
1867 #
1868 # @device: the device name or node-name of a root node whose writes should be
1869 # mirrored.
1870 #
1871 # @target: the target of the new image. If the file exists, or if it
1872 # is a device, the existing file/device will be used as the new
1873 # destination. If it does not exist, a new file will be created.
1874 #
1875 # @format: the format of the new destination, default is to
1876 # probe if @mode is 'existing', else the format of the source
1877 #
1878 # @node-name: the new block driver state node name in the graph
1879 # (Since 2.1)
1880 #
1881 # @replaces: with sync=full graph node name to be replaced by the new
1882 # image when a whole image copy is done. This can be used to repair
1883 # broken Quorum files. (Since 2.1)
1884 #
1885 # @mode: whether and how QEMU should create a new image, default is
1886 # 'absolute-paths'.
1887 #
1888 # @speed: the maximum speed, in bytes per second
1889 #
1890 # @sync: what parts of the disk image should be copied to the destination
1891 # (all the disk, only the sectors allocated in the topmost image, or
1892 # only new I/O).
1893 #
1894 # @granularity: granularity of the dirty bitmap, default is 64K
1895 # if the image format doesn't have clusters, 4K if the clusters
1896 # are smaller than that, else the cluster size. Must be a
1897 # power of 2 between 512 and 64M (since 1.4).
1898 #
1899 # @buf-size: maximum amount of data in flight from source to
1900 # target (since 1.4).
1901 #
1902 # @on-source-error: the action to take on an error on the source,
1903 # default 'report'. 'stop' and 'enospc' can only be used
1904 # if the block device supports io-status (see BlockInfo).
1905 #
1906 # @on-target-error: the action to take on an error on the target,
1907 # default 'report' (no limitations, since this applies to
1908 # a different block device than @device).
1909 # @unmap: Whether to try to unmap target sectors where source has
1910 # only zero. If true, and target unallocated sectors will read as zero,
1911 # target image sectors will be unmapped; otherwise, zeroes will be
1912 # written. Both will result in identical contents.
1913 # Default is true. (Since 2.4)
1914 #
1915 # @copy-mode: when to copy data to the destination; defaults to 'background'
1916 # (Since: 3.0)
1917 #
1918 # @auto-finalize: When false, this job will wait in a PENDING state after it has
1919 # finished its work, waiting for @block-job-finalize before
1920 # making any block graph changes.
1921 # When true, this job will automatically
1922 # perform its abort or commit actions.
1923 # Defaults to true. (Since 3.1)
1924 #
1925 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
1926 # has completely ceased all work, and awaits @block-job-dismiss.
1927 # When true, this job will automatically disappear from the query
1928 # list without user intervention.
1929 # Defaults to true. (Since 3.1)
1930 # Since: 1.3
1931 ##
1932 { 'struct': 'DriveMirror',
1933 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1934 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1935 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1936 '*speed': 'int', '*granularity': 'uint32',
1937 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1938 '*on-target-error': 'BlockdevOnError',
1939 '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode',
1940 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
1941
1942 ##
1943 # @BlockDirtyBitmap:
1944 #
1945 # @node: name of device/node which the bitmap is tracking
1946 #
1947 # @name: name of the dirty bitmap
1948 #
1949 # Since: 2.4
1950 ##
1951 { 'struct': 'BlockDirtyBitmap',
1952 'data': { 'node': 'str', 'name': 'str' } }
1953
1954 ##
1955 # @BlockDirtyBitmapAdd:
1956 #
1957 # @node: name of device/node which the bitmap is tracking
1958 #
1959 # @name: name of the dirty bitmap
1960 #
1961 # @granularity: the bitmap granularity, default is 64k for
1962 # block-dirty-bitmap-add
1963 #
1964 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1965 # corresponding block device image file on its close. For now only
1966 # Qcow2 disks support persistent bitmaps. Default is false for
1967 # block-dirty-bitmap-add. (Since: 2.10)
1968 #
1969 # @autoload: ignored and deprecated since 2.12.
1970 # Currently, all dirty tracking bitmaps are loaded from Qcow2 on
1971 # open.
1972 #
1973 # @disabled: the bitmap is created in the disabled state, which means that
1974 # it will not track drive changes. The bitmap may be enabled with
1975 # block-dirty-bitmap-enable. Default is false. (Since: 4.0)
1976 #
1977 # Since: 2.4
1978 ##
1979 { 'struct': 'BlockDirtyBitmapAdd',
1980 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1981 '*persistent': 'bool', '*autoload': 'bool', '*disabled': 'bool' } }
1982
1983 ##
1984 # @BlockDirtyBitmapMergeSource:
1985 #
1986 # @local: name of the bitmap, attached to the same node as target bitmap.
1987 #
1988 # @external: bitmap with specified node
1989 #
1990 # Since: 4.1
1991 ##
1992 { 'alternate': 'BlockDirtyBitmapMergeSource',
1993 'data': { 'local': 'str',
1994 'external': 'BlockDirtyBitmap' } }
1995
1996 ##
1997 # @BlockDirtyBitmapMerge:
1998 #
1999 # @node: name of device/node which the @target bitmap is tracking
2000 #
2001 # @target: name of the destination dirty bitmap
2002 #
2003 # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully
2004 # specifed BlockDirtyBitmap elements. The latter are supported
2005 # since 4.1.
2006 #
2007 # Since: 4.0
2008 ##
2009 { 'struct': 'BlockDirtyBitmapMerge',
2010 'data': { 'node': 'str', 'target': 'str',
2011 'bitmaps': ['BlockDirtyBitmapMergeSource'] } }
2012
2013 ##
2014 # @block-dirty-bitmap-add:
2015 #
2016 # Create a dirty bitmap with a name on the node, and start tracking the writes.
2017 #
2018 # Returns: nothing on success
2019 # If @node is not a valid block device or node, DeviceNotFound
2020 # If @name is already taken, GenericError with an explanation
2021 #
2022 # Since: 2.4
2023 #
2024 # Example:
2025 #
2026 # -> { "execute": "block-dirty-bitmap-add",
2027 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2028 # <- { "return": {} }
2029 #
2030 ##
2031 { 'command': 'block-dirty-bitmap-add',
2032 'data': 'BlockDirtyBitmapAdd' }
2033
2034 ##
2035 # @block-dirty-bitmap-remove:
2036 #
2037 # Stop write tracking and remove the dirty bitmap that was created
2038 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
2039 # storage too.
2040 #
2041 # Returns: nothing on success
2042 # If @node is not a valid block device or node, DeviceNotFound
2043 # If @name is not found, GenericError with an explanation
2044 # if @name is frozen by an operation, GenericError
2045 #
2046 # Since: 2.4
2047 #
2048 # Example:
2049 #
2050 # -> { "execute": "block-dirty-bitmap-remove",
2051 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2052 # <- { "return": {} }
2053 #
2054 ##
2055 { 'command': 'block-dirty-bitmap-remove',
2056 'data': 'BlockDirtyBitmap' }
2057
2058 ##
2059 # @block-dirty-bitmap-clear:
2060 #
2061 # Clear (reset) a dirty bitmap on the device, so that an incremental
2062 # backup from this point in time forward will only backup clusters
2063 # modified after this clear operation.
2064 #
2065 # Returns: nothing on success
2066 # If @node is not a valid block device, DeviceNotFound
2067 # If @name is not found, GenericError with an explanation
2068 #
2069 # Since: 2.4
2070 #
2071 # Example:
2072 #
2073 # -> { "execute": "block-dirty-bitmap-clear",
2074 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2075 # <- { "return": {} }
2076 #
2077 ##
2078 { 'command': 'block-dirty-bitmap-clear',
2079 'data': 'BlockDirtyBitmap' }
2080
2081 ##
2082 # @block-dirty-bitmap-enable:
2083 #
2084 # Enables a dirty bitmap so that it will begin tracking disk changes.
2085 #
2086 # Returns: nothing on success
2087 # If @node is not a valid block device, DeviceNotFound
2088 # If @name is not found, GenericError with an explanation
2089 #
2090 # Since: 4.0
2091 #
2092 # Example:
2093 #
2094 # -> { "execute": "block-dirty-bitmap-enable",
2095 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2096 # <- { "return": {} }
2097 #
2098 ##
2099 { 'command': 'block-dirty-bitmap-enable',
2100 'data': 'BlockDirtyBitmap' }
2101
2102 ##
2103 # @block-dirty-bitmap-disable:
2104 #
2105 # Disables a dirty bitmap so that it will stop tracking disk changes.
2106 #
2107 # Returns: nothing on success
2108 # If @node is not a valid block device, DeviceNotFound
2109 # If @name is not found, GenericError with an explanation
2110 #
2111 # Since: 4.0
2112 #
2113 # Example:
2114 #
2115 # -> { "execute": "block-dirty-bitmap-disable",
2116 # "arguments": { "node": "drive0", "name": "bitmap0" } }
2117 # <- { "return": {} }
2118 #
2119 ##
2120 { 'command': 'block-dirty-bitmap-disable',
2121 'data': 'BlockDirtyBitmap' }
2122
2123 ##
2124 # @block-dirty-bitmap-merge:
2125 #
2126 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
2127 # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears
2128 # as the @target bitmap. Any bits already set in @target will still be
2129 # set after the merge, i.e., this operation does not clear the target.
2130 # On error, @target is unchanged.
2131 #
2132 # The resulting bitmap will count as dirty any clusters that were dirty in any
2133 # of the source bitmaps. This can be used to achieve backup checkpoints, or in
2134 # simpler usages, to copy bitmaps.
2135 #
2136 # Returns: nothing on success
2137 # If @node is not a valid block device, DeviceNotFound
2138 # If any bitmap in @bitmaps or @target is not found, GenericError
2139 # If any of the bitmaps have different sizes or granularities,
2140 # GenericError
2141 #
2142 # Since: 4.0
2143 #
2144 # Example:
2145 #
2146 # -> { "execute": "block-dirty-bitmap-merge",
2147 # "arguments": { "node": "drive0", "target": "bitmap0",
2148 # "bitmaps": ["bitmap1"] } }
2149 # <- { "return": {} }
2150 #
2151 ##
2152 { 'command': 'block-dirty-bitmap-merge',
2153 'data': 'BlockDirtyBitmapMerge' }
2154
2155 ##
2156 # @BlockDirtyBitmapSha256:
2157 #
2158 # SHA256 hash of dirty bitmap data
2159 #
2160 # @sha256: ASCII representation of SHA256 bitmap hash
2161 #
2162 # Since: 2.10
2163 ##
2164 { 'struct': 'BlockDirtyBitmapSha256',
2165 'data': {'sha256': 'str'} }
2166
2167 ##
2168 # @x-debug-block-dirty-bitmap-sha256:
2169 #
2170 # Get bitmap SHA256.
2171 #
2172 # Returns: BlockDirtyBitmapSha256 on success
2173 # If @node is not a valid block device, DeviceNotFound
2174 # If @name is not found or if hashing has failed, GenericError with an
2175 # explanation
2176 #
2177 # Since: 2.10
2178 ##
2179 { 'command': 'x-debug-block-dirty-bitmap-sha256',
2180 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
2181
2182 ##
2183 # @blockdev-mirror:
2184 #
2185 # Start mirroring a block device's writes to a new destination.
2186 #
2187 # @job-id: identifier for the newly-created block job. If
2188 # omitted, the device name will be used. (Since 2.7)
2189 #
2190 # @device: The device name or node-name of a root node whose writes should be
2191 # mirrored.
2192 #
2193 # @target: the id or node-name of the block device to mirror to. This mustn't be
2194 # attached to guest.
2195 #
2196 # @replaces: with sync=full graph node name to be replaced by the new
2197 # image when a whole image copy is done. This can be used to repair
2198 # broken Quorum files.
2199 #
2200 # @speed: the maximum speed, in bytes per second
2201 #
2202 # @sync: what parts of the disk image should be copied to the destination
2203 # (all the disk, only the sectors allocated in the topmost image, or
2204 # only new I/O).
2205 #
2206 # @granularity: granularity of the dirty bitmap, default is 64K
2207 # if the image format doesn't have clusters, 4K if the clusters
2208 # are smaller than that, else the cluster size. Must be a
2209 # power of 2 between 512 and 64M
2210 #
2211 # @buf-size: maximum amount of data in flight from source to
2212 # target
2213 #
2214 # @on-source-error: the action to take on an error on the source,
2215 # default 'report'. 'stop' and 'enospc' can only be used
2216 # if the block device supports io-status (see BlockInfo).
2217 #
2218 # @on-target-error: the action to take on an error on the target,
2219 # default 'report' (no limitations, since this applies to
2220 # a different block device than @device).
2221 #
2222 # @filter-node-name: the node name that should be assigned to the
2223 # filter driver that the mirror job inserts into the graph
2224 # above @device. If this option is not given, a node name is
2225 # autogenerated. (Since: 2.9)
2226 #
2227 # @copy-mode: when to copy data to the destination; defaults to 'background'
2228 # (Since: 3.0)
2229 #
2230 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2231 # finished its work, waiting for @block-job-finalize before
2232 # making any block graph changes.
2233 # When true, this job will automatically
2234 # perform its abort or commit actions.
2235 # Defaults to true. (Since 3.1)
2236 #
2237 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2238 # has completely ceased all work, and awaits @block-job-dismiss.
2239 # When true, this job will automatically disappear from the query
2240 # list without user intervention.
2241 # Defaults to true. (Since 3.1)
2242 # Returns: nothing on success.
2243 #
2244 # Since: 2.6
2245 #
2246 # Example:
2247 #
2248 # -> { "execute": "blockdev-mirror",
2249 # "arguments": { "device": "ide-hd0",
2250 # "target": "target0",
2251 # "sync": "full" } }
2252 # <- { "return": {} }
2253 #
2254 ##
2255 { 'command': 'blockdev-mirror',
2256 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
2257 '*replaces': 'str',
2258 'sync': 'MirrorSyncMode',
2259 '*speed': 'int', '*granularity': 'uint32',
2260 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2261 '*on-target-error': 'BlockdevOnError',
2262 '*filter-node-name': 'str',
2263 '*copy-mode': 'MirrorCopyMode',
2264 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2265
2266 ##
2267 # @block_set_io_throttle:
2268 #
2269 # Change I/O throttle limits for a block drive.
2270 #
2271 # Since QEMU 2.4, each device with I/O limits is member of a throttle
2272 # group.
2273 #
2274 # If two or more devices are members of the same group, the limits
2275 # will apply to the combined I/O of the whole group in a round-robin
2276 # fashion. Therefore, setting new I/O limits to a device will affect
2277 # the whole group.
2278 #
2279 # The name of the group can be specified using the 'group' parameter.
2280 # If the parameter is unset, it is assumed to be the current group of
2281 # that device. If it's not in any group yet, the name of the device
2282 # will be used as the name for its group.
2283 #
2284 # The 'group' parameter can also be used to move a device to a
2285 # different group. In this case the limits specified in the parameters
2286 # will be applied to the new group only.
2287 #
2288 # I/O limits can be disabled by setting all of them to 0. In this case
2289 # the device will be removed from its group and the rest of its
2290 # members will not be affected. The 'group' parameter is ignored.
2291 #
2292 # Returns: Nothing on success
2293 # If @device is not a valid block device, DeviceNotFound
2294 #
2295 # Since: 1.1
2296 #
2297 # Example:
2298 #
2299 # -> { "execute": "block_set_io_throttle",
2300 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
2301 # "bps": 0,
2302 # "bps_rd": 0,
2303 # "bps_wr": 0,
2304 # "iops": 512,
2305 # "iops_rd": 0,
2306 # "iops_wr": 0,
2307 # "bps_max": 0,
2308 # "bps_rd_max": 0,
2309 # "bps_wr_max": 0,
2310 # "iops_max": 0,
2311 # "iops_rd_max": 0,
2312 # "iops_wr_max": 0,
2313 # "bps_max_length": 0,
2314 # "iops_size": 0 } }
2315 # <- { "return": {} }
2316 #
2317 # -> { "execute": "block_set_io_throttle",
2318 # "arguments": { "id": "ide0-1-0",
2319 # "bps": 1000000,
2320 # "bps_rd": 0,
2321 # "bps_wr": 0,
2322 # "iops": 0,
2323 # "iops_rd": 0,
2324 # "iops_wr": 0,
2325 # "bps_max": 8000000,
2326 # "bps_rd_max": 0,
2327 # "bps_wr_max": 0,
2328 # "iops_max": 0,
2329 # "iops_rd_max": 0,
2330 # "iops_wr_max": 0,
2331 # "bps_max_length": 60,
2332 # "iops_size": 0 } }
2333 # <- { "return": {} }
2334 ##
2335 { 'command': 'block_set_io_throttle', 'boxed': true,
2336 'data': 'BlockIOThrottle' }
2337
2338 ##
2339 # @BlockIOThrottle:
2340 #
2341 # A set of parameters describing block throttling.
2342 #
2343 # @device: Block device name (deprecated, use @id instead)
2344 #
2345 # @id: The name or QOM path of the guest device (since: 2.8)
2346 #
2347 # @bps: total throughput limit in bytes per second
2348 #
2349 # @bps_rd: read throughput limit in bytes per second
2350 #
2351 # @bps_wr: write throughput limit in bytes per second
2352 #
2353 # @iops: total I/O operations per second
2354 #
2355 # @iops_rd: read I/O operations per second
2356 #
2357 # @iops_wr: write I/O operations per second
2358 #
2359 # @bps_max: total throughput limit during bursts,
2360 # in bytes (Since 1.7)
2361 #
2362 # @bps_rd_max: read throughput limit during bursts,
2363 # in bytes (Since 1.7)
2364 #
2365 # @bps_wr_max: write throughput limit during bursts,
2366 # in bytes (Since 1.7)
2367 #
2368 # @iops_max: total I/O operations per second during bursts,
2369 # in bytes (Since 1.7)
2370 #
2371 # @iops_rd_max: read I/O operations per second during bursts,
2372 # in bytes (Since 1.7)
2373 #
2374 # @iops_wr_max: write I/O operations per second during bursts,
2375 # in bytes (Since 1.7)
2376 #
2377 # @bps_max_length: maximum length of the @bps_max burst
2378 # period, in seconds. It must only
2379 # be set if @bps_max is set as well.
2380 # Defaults to 1. (Since 2.6)
2381 #
2382 # @bps_rd_max_length: maximum length of the @bps_rd_max
2383 # burst period, in seconds. It must only
2384 # be set if @bps_rd_max is set as well.
2385 # Defaults to 1. (Since 2.6)
2386 #
2387 # @bps_wr_max_length: maximum length of the @bps_wr_max
2388 # burst period, in seconds. It must only
2389 # be set if @bps_wr_max is set as well.
2390 # Defaults to 1. (Since 2.6)
2391 #
2392 # @iops_max_length: maximum length of the @iops burst
2393 # period, in seconds. It must only
2394 # be set if @iops_max is set as well.
2395 # Defaults to 1. (Since 2.6)
2396 #
2397 # @iops_rd_max_length: maximum length of the @iops_rd_max
2398 # burst period, in seconds. It must only
2399 # be set if @iops_rd_max is set as well.
2400 # Defaults to 1. (Since 2.6)
2401 #
2402 # @iops_wr_max_length: maximum length of the @iops_wr_max
2403 # burst period, in seconds. It must only
2404 # be set if @iops_wr_max is set as well.
2405 # Defaults to 1. (Since 2.6)
2406 #
2407 # @iops_size: an I/O size in bytes (Since 1.7)
2408 #
2409 # @group: throttle group name (Since 2.4)
2410 #
2411 # Since: 1.1
2412 ##
2413 { 'struct': 'BlockIOThrottle',
2414 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
2415 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2416 '*bps_max': 'int', '*bps_rd_max': 'int',
2417 '*bps_wr_max': 'int', '*iops_max': 'int',
2418 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2419 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
2420 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
2421 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
2422 '*iops_size': 'int', '*group': 'str' } }
2423
2424 ##
2425 # @ThrottleLimits:
2426 #
2427 # Limit parameters for throttling.
2428 # Since some limit combinations are illegal, limits should always be set in one
2429 # transaction. All fields are optional. When setting limits, if a field is
2430 # missing the current value is not changed.
2431 #
2432 # @iops-total: limit total I/O operations per second
2433 # @iops-total-max: I/O operations burst
2434 # @iops-total-max-length: length of the iops-total-max burst period, in seconds
2435 # It must only be set if @iops-total-max is set as well.
2436 # @iops-read: limit read operations per second
2437 # @iops-read-max: I/O operations read burst
2438 # @iops-read-max-length: length of the iops-read-max burst period, in seconds
2439 # It must only be set if @iops-read-max is set as well.
2440 # @iops-write: limit write operations per second
2441 # @iops-write-max: I/O operations write burst
2442 # @iops-write-max-length: length of the iops-write-max burst period, in seconds
2443 # It must only be set if @iops-write-max is set as well.
2444 # @bps-total: limit total bytes per second
2445 # @bps-total-max: total bytes burst
2446 # @bps-total-max-length: length of the bps-total-max burst period, in seconds.
2447 # It must only be set if @bps-total-max is set as well.
2448 # @bps-read: limit read bytes per second
2449 # @bps-read-max: total bytes read burst
2450 # @bps-read-max-length: length of the bps-read-max burst period, in seconds
2451 # It must only be set if @bps-read-max is set as well.
2452 # @bps-write: limit write bytes per second
2453 # @bps-write-max: total bytes write burst
2454 # @bps-write-max-length: length of the bps-write-max burst period, in seconds
2455 # It must only be set if @bps-write-max is set as well.
2456 # @iops-size: when limiting by iops max size of an I/O in bytes
2457 #
2458 # Since: 2.11
2459 ##
2460 { 'struct': 'ThrottleLimits',
2461 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int',
2462 '*iops-total-max-length' : 'int', '*iops-read' : 'int',
2463 '*iops-read-max' : 'int', '*iops-read-max-length' : 'int',
2464 '*iops-write' : 'int', '*iops-write-max' : 'int',
2465 '*iops-write-max-length' : 'int', '*bps-total' : 'int',
2466 '*bps-total-max' : 'int', '*bps-total-max-length' : 'int',
2467 '*bps-read' : 'int', '*bps-read-max' : 'int',
2468 '*bps-read-max-length' : 'int', '*bps-write' : 'int',
2469 '*bps-write-max' : 'int', '*bps-write-max-length' : 'int',
2470 '*iops-size' : 'int' } }
2471
2472 ##
2473 # @block-stream:
2474 #
2475 # Copy data from a backing file into a block device.
2476 #
2477 # The block streaming operation is performed in the background until the entire
2478 # backing file has been copied. This command returns immediately once streaming
2479 # has started. The status of ongoing block streaming operations can be checked
2480 # with query-block-jobs. The operation can be stopped before it has completed
2481 # using the block-job-cancel command.
2482 #
2483 # The node that receives the data is called the top image, can be located in
2484 # any part of the chain (but always above the base image; see below) and can be
2485 # specified using its device or node name. Earlier qemu versions only allowed
2486 # 'device' to name the top level node; presence of the 'base-node' parameter
2487 # during introspection can be used as a witness of the enhanced semantics
2488 # of 'device'.
2489 #
2490 # If a base file is specified then sectors are not copied from that base file and
2491 # its backing chain. When streaming completes the image file will have the base
2492 # file as its backing file. This can be used to stream a subset of the backing
2493 # file chain instead of flattening the entire image.
2494 #
2495 # On successful completion the image file is updated to drop the backing file
2496 # and the BLOCK_JOB_COMPLETED event is emitted.
2497 #
2498 # @job-id: identifier for the newly-created block job. If
2499 # omitted, the device name will be used. (Since 2.7)
2500 #
2501 # @device: the device or node name of the top image
2502 #
2503 # @base: the common backing file name.
2504 # It cannot be set if @base-node is also set.
2505 #
2506 # @base-node: the node name of the backing file.
2507 # It cannot be set if @base is also set. (Since 2.8)
2508 #
2509 # @backing-file: The backing file string to write into the top
2510 # image. This filename is not validated.
2511 #
2512 # If a pathname string is such that it cannot be
2513 # resolved by QEMU, that means that subsequent QMP or
2514 # HMP commands must use node-names for the image in
2515 # question, as filename lookup methods will fail.
2516 #
2517 # If not specified, QEMU will automatically determine
2518 # the backing file string to use, or error out if there
2519 # is no obvious choice. Care should be taken when
2520 # specifying the string, to specify a valid filename or
2521 # protocol.
2522 # (Since 2.1)
2523 #
2524 # @speed: the maximum speed, in bytes per second
2525 #
2526 # @on-error: the action to take on an error (default report).
2527 # 'stop' and 'enospc' can only be used if the block device
2528 # supports io-status (see BlockInfo). Since 1.3.
2529 #
2530 # @auto-finalize: When false, this job will wait in a PENDING state after it has
2531 # finished its work, waiting for @block-job-finalize before
2532 # making any block graph changes.
2533 # When true, this job will automatically
2534 # perform its abort or commit actions.
2535 # Defaults to true. (Since 3.1)
2536 #
2537 # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
2538 # has completely ceased all work, and awaits @block-job-dismiss.
2539 # When true, this job will automatically disappear from the query
2540 # list without user intervention.
2541 # Defaults to true. (Since 3.1)
2542 #
2543 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
2544 #
2545 # Since: 1.1
2546 #
2547 # Example:
2548 #
2549 # -> { "execute": "block-stream",
2550 # "arguments": { "device": "virtio0",
2551 # "base": "/tmp/master.qcow2" } }
2552 # <- { "return": {} }
2553 #
2554 ##
2555 { 'command': 'block-stream',
2556 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
2557 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
2558 '*on-error': 'BlockdevOnError',
2559 '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
2560
2561 ##
2562 # @block-job-set-speed:
2563 #
2564 # Set maximum speed for a background block operation.
2565 #
2566 # This command can only be issued when there is an active block job.
2567 #
2568 # Throttling can be disabled by setting the speed to 0.
2569 #
2570 # @device: The job identifier. This used to be a device name (hence
2571 # the name of the parameter), but since QEMU 2.7 it can have
2572 # other values.
2573 #
2574 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2575 # Defaults to 0.
2576 #
2577 # Returns: Nothing on success
2578 # If no background operation is active on this device, DeviceNotActive
2579 #
2580 # Since: 1.1
2581 ##
2582 { 'command': 'block-job-set-speed',
2583 'data': { 'device': 'str', 'speed': 'int' } }
2584
2585 ##
2586 # @block-job-cancel:
2587 #
2588 # Stop an active background block operation.
2589 #
2590 # This command returns immediately after marking the active background block
2591 # operation for cancellation. It is an error to call this command if no
2592 # operation is in progress.
2593 #
2594 # The operation will cancel as soon as possible and then emit the
2595 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2596 # enumerated using query-block-jobs.
2597 #
2598 # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
2599 # (via the event BLOCK_JOB_READY) that the source and destination are
2600 # synchronized, then the event triggered by this command changes to
2601 # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
2602 # destination now has a point-in-time copy tied to the time of the cancellation.
2603 #
2604 # For streaming, the image file retains its backing file unless the streaming
2605 # operation happens to complete just as it is being cancelled. A new streaming
2606 # operation can be started at a later time to finish copying all data from the
2607 # backing file.
2608 #
2609 # @device: The job identifier. This used to be a device name (hence
2610 # the name of the parameter), but since QEMU 2.7 it can have
2611 # other values.
2612 #
2613 # @force: If true, and the job has already emitted the event BLOCK_JOB_READY,
2614 # abandon the job immediately (even if it is paused) instead of waiting
2615 # for the destination to complete its final synchronization (since 1.3)
2616 #
2617 # Returns: Nothing on success
2618 # If no background operation is active on this device, DeviceNotActive
2619 #
2620 # Since: 1.1
2621 ##
2622 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2623
2624 ##
2625 # @block-job-pause:
2626 #
2627 # Pause an active background block operation.
2628 #
2629 # This command returns immediately after marking the active background block
2630 # operation for pausing. It is an error to call this command if no
2631 # operation is in progress or if the job is already paused.
2632 #
2633 # The operation will pause as soon as possible. No event is emitted when
2634 # the operation is actually paused. Cancelling a paused job automatically
2635 # resumes it.
2636 #
2637 # @device: The job identifier. This used to be a device name (hence
2638 # the name of the parameter), but since QEMU 2.7 it can have
2639 # other values.
2640 #
2641 # Returns: Nothing on success
2642 # If no background operation is active on this device, DeviceNotActive
2643 #
2644 # Since: 1.3
2645 ##
2646 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2647
2648 ##
2649 # @block-job-resume:
2650 #
2651 # Resume an active background block operation.
2652 #
2653 # This command returns immediately after resuming a paused background block
2654 # operation. It is an error to call this command if no operation is in
2655 # progress or if the job is not paused.
2656 #
2657 # This command also clears the error status of the job.
2658 #
2659 # @device: The job identifier. This used to be a device name (hence
2660 # the name of the parameter), but since QEMU 2.7 it can have
2661 # other values.
2662 #
2663 # Returns: Nothing on success
2664 # If no background operation is active on this device, DeviceNotActive
2665 #
2666 # Since: 1.3
2667 ##
2668 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2669
2670 ##
2671 # @block-job-complete:
2672 #
2673 # Manually trigger completion of an active background block operation. This
2674 # is supported for drive mirroring, where it also switches the device to
2675 # write to the target path only. The ability to complete is signaled with
2676 # a BLOCK_JOB_READY event.
2677 #
2678 # This command completes an active background block operation synchronously.
2679 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2680 # is not defined. Note that if an I/O error occurs during the processing of
2681 # this command: 1) the command itself will fail; 2) the error will be processed
2682 # according to the rerror/werror arguments that were specified when starting
2683 # the operation.
2684 #
2685 # A cancelled or paused job cannot be completed.
2686 #
2687 # @device: The job identifier. This used to be a device name (hence
2688 # the name of the parameter), but since QEMU 2.7 it can have
2689 # other values.
2690 #
2691 # Returns: Nothing on success
2692 # If no background operation is active on this device, DeviceNotActive
2693 #
2694 # Since: 1.3
2695 ##
2696 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2697
2698 ##
2699 # @block-job-dismiss:
2700 #
2701 # For jobs that have already concluded, remove them from the block-job-query
2702 # list. This command only needs to be run for jobs which were started with
2703 # QEMU 2.12+ job lifetime management semantics.
2704 #
2705 # This command will refuse to operate on any job that has not yet reached
2706 # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the
2707 # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need
2708 # to be used as appropriate.
2709 #
2710 # @id: The job identifier.
2711 #
2712 # Returns: Nothing on success
2713 #
2714 # Since: 2.12
2715 ##
2716 { 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
2717
2718 ##
2719 # @block-job-finalize:
2720 #
2721 # Once a job that has manual=true reaches the pending state, it can be
2722 # instructed to finalize any graph changes and do any necessary cleanup
2723 # via this command.
2724 # For jobs in a transaction, instructing one job to finalize will force
2725 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
2726 # a single member job to finalize.
2727 #
2728 # @id: The job identifier.
2729 #
2730 # Returns: Nothing on success
2731 #
2732 # Since: 2.12
2733 ##
2734 { 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
2735
2736 ##
2737 # @BlockdevDiscardOptions:
2738 #
2739 # Determines how to handle discard requests.
2740 #
2741 # @ignore: Ignore the request
2742 # @unmap: Forward as an unmap request
2743 #
2744 # Since: 2.9
2745 ##
2746 { 'enum': 'BlockdevDiscardOptions',
2747 'data': [ 'ignore', 'unmap' ] }
2748
2749 ##
2750 # @BlockdevDetectZeroesOptions:
2751 #
2752 # Describes the operation mode for the automatic conversion of plain
2753 # zero writes by the OS to driver specific optimized zero write commands.
2754 #
2755 # @off: Disabled (default)
2756 # @on: Enabled
2757 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2758 # also that @BlockdevDiscardOptions is set to unmap for this device.
2759 #
2760 # Since: 2.1
2761 ##
2762 { 'enum': 'BlockdevDetectZeroesOptions',
2763 'data': [ 'off', 'on', 'unmap' ] }
2764
2765 ##
2766 # @BlockdevAioOptions:
2767 #
2768 # Selects the AIO backend to handle I/O requests
2769 #
2770 # @threads: Use qemu's thread pool
2771 # @native: Use native AIO backend (only Linux and Windows)
2772 #
2773 # Since: 2.9
2774 ##
2775 { 'enum': 'BlockdevAioOptions',
2776 'data': [ 'threads', 'native' ] }
2777
2778 ##
2779 # @BlockdevCacheOptions:
2780 #
2781 # Includes cache-related options for block devices
2782 #
2783 # @direct: enables use of O_DIRECT (bypass the host page cache;
2784 # default: false)
2785 # @no-flush: ignore any flush requests for the device (default:
2786 # false)
2787 #
2788 # Since: 2.9
2789 ##
2790 { 'struct': 'BlockdevCacheOptions',
2791 'data': { '*direct': 'bool',
2792 '*no-flush': 'bool' } }
2793
2794 ##
2795 # @BlockdevDriver:
2796 #
2797 # Drivers that are supported in block device operations.
2798 #
2799 # @vxhs: Since 2.10
2800 # @throttle: Since 2.11
2801 # @nvme: Since 2.12
2802 # @copy-on-read: Since 3.0
2803 # @blklogwrites: Since 3.0
2804 #
2805 # Since: 2.9
2806 ##
2807 { 'enum': 'BlockdevDriver',
2808 'data': [ 'blkdebug', 'blklogwrites', 'blkverify', 'bochs', 'cloop',
2809 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps', 'gluster',
2810 'host_cdrom', 'host_device', 'http', 'https', 'iscsi', 'luks',
2811 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels', 'qcow',
2812 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
2813 { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
2814 'sheepdog',
2815 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2816
2817 ##
2818 # @BlockdevOptionsFile:
2819 #
2820 # Driver specific block device options for the file backend.
2821 #
2822 # @filename: path to the image file
2823 # @pr-manager: the id for the object that will handle persistent reservations
2824 # for this device (default: none, forward the commands via SG_IO;
2825 # since 2.11)
2826 # @aio: AIO backend (default: threads) (since: 2.8)
2827 # @locking: whether to enable file locking. If set to 'auto', only enable
2828 # when Open File Descriptor (OFD) locking API is available
2829 # (default: auto, since 2.10)
2830 # @drop-cache: invalidate page cache during live migration. This prevents
2831 # stale data on the migration destination with cache.direct=off.
2832 # Currently only supported on Linux hosts.
2833 # (default: on, since: 4.0)
2834 # @x-check-cache-dropped: whether to check that page cache was dropped on live
2835 # migration. May cause noticeable delays if the image
2836 # file is large, do not use in production.
2837 # (default: off) (since: 3.0)
2838 #
2839 # Features:
2840 # @dynamic-auto-read-only: If present, enabled auto-read-only means that the
2841 # driver will open the image read-only at first,
2842 # dynamically reopen the image file read-write when
2843 # the first writer is attached to the node and reopen
2844 # read-only when the last writer is detached. This
2845 # allows giving QEMU write permissions only on demand
2846 # when an operation actually needs write access.
2847 #
2848 # Since: 2.9
2849 ##
2850 { 'struct': 'BlockdevOptionsFile',
2851 'data': { 'filename': 'str',
2852 '*pr-manager': 'str',
2853 '*locking': 'OnOffAuto',
2854 '*aio': 'BlockdevAioOptions',
2855 '*drop-cache': {'type': 'bool',
2856 'if': 'defined(CONFIG_LINUX)'},
2857 '*x-check-cache-dropped': 'bool' },
2858 'features': [ { 'name': 'dynamic-auto-read-only',
2859 'if': 'defined(CONFIG_POSIX)' } ] }
2860
2861 ##
2862 # @BlockdevOptionsNull:
2863 #
2864 # Driver specific block device options for the null backend.
2865 #
2866 # @size: size of the device in bytes.
2867 # @latency-ns: emulated latency (in nanoseconds) in processing
2868 # requests. Default to zero which completes requests immediately.
2869 # (Since 2.4)
2870 # @read-zeroes: if true, reads from the device produce zeroes; if false, the
2871 # buffer is left unchanged. (default: false; since: 4.1)
2872 #
2873 # Since: 2.9
2874 ##
2875 { 'struct': 'BlockdevOptionsNull',
2876 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } }
2877
2878 ##
2879 # @BlockdevOptionsNVMe:
2880 #
2881 # Driver specific block device options for the NVMe backend.
2882 #
2883 # @device: controller address of the NVMe device.
2884 # @namespace: namespace number of the device, starting from 1.
2885 #
2886 # Since: 2.12
2887 ##
2888 { 'struct': 'BlockdevOptionsNVMe',
2889 'data': { 'device': 'str', 'namespace': 'int' } }
2890
2891 ##
2892 # @BlockdevOptionsVVFAT:
2893 #
2894 # Driver specific block device options for the vvfat protocol.
2895 #
2896 # @dir: directory to be exported as FAT image
2897 # @fat-type: FAT type: 12, 16 or 32
2898 # @floppy: whether to export a floppy image (true) or
2899 # partitioned hard disk (false; default)
2900 # @label: set the volume label, limited to 11 bytes. FAT16 and
2901 # FAT32 traditionally have some restrictions on labels, which are
2902 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2903 # (since 2.4)
2904 # @rw: whether to allow write operations (default: false)
2905 #
2906 # Since: 2.9
2907 ##
2908 { 'struct': 'BlockdevOptionsVVFAT',
2909 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2910 '*label': 'str', '*rw': 'bool' } }
2911
2912 ##
2913 # @BlockdevOptionsGenericFormat:
2914 #
2915 # Driver specific block device options for image format that have no option
2916 # besides their data source.
2917 #
2918 # @file: reference to or definition of the data source block device
2919 #
2920 # Since: 2.9
2921 ##
2922 { 'struct': 'BlockdevOptionsGenericFormat',
2923 'data': { 'file': 'BlockdevRef' } }
2924
2925 ##
2926 # @BlockdevOptionsLUKS:
2927 #
2928 # Driver specific block device options for LUKS.
2929 #
2930 # @key-secret: the ID of a QCryptoSecret object providing
2931 # the decryption key (since 2.6). Mandatory except when
2932 # doing a metadata-only probe of the image.
2933 #
2934 # Since: 2.9
2935 ##
2936 { 'struct': 'BlockdevOptionsLUKS',
2937 'base': 'BlockdevOptionsGenericFormat',
2938 'data': { '*key-secret': 'str' } }
2939
2940
2941 ##
2942 # @BlockdevOptionsGenericCOWFormat:
2943 #
2944 # Driver specific block device options for image format that have no option
2945 # besides their data source and an optional backing file.
2946 #
2947 # @backing: reference to or definition of the backing file block
2948 # device, null disables the backing file entirely.
2949 # Defaults to the backing file stored the image file.
2950 #
2951 # Since: 2.9
2952 ##
2953 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2954 'base': 'BlockdevOptionsGenericFormat',
2955 'data': { '*backing': 'BlockdevRefOrNull' } }
2956
2957 ##
2958 # @Qcow2OverlapCheckMode:
2959 #
2960 # General overlap check modes.
2961 #
2962 # @none: Do not perform any checks
2963 #
2964 # @constant: Perform only checks which can be done in constant time and
2965 # without reading anything from disk
2966 #
2967 # @cached: Perform only checks which can be done without reading anything
2968 # from disk
2969 #
2970 # @all: Perform all available overlap checks
2971 #
2972 # Since: 2.9
2973 ##
2974 { 'enum': 'Qcow2OverlapCheckMode',
2975 'data': [ 'none', 'constant', 'cached', 'all' ] }
2976
2977 ##
2978 # @Qcow2OverlapCheckFlags:
2979 #
2980 # Structure of flags for each metadata structure. Setting a field to 'true'
2981 # makes qemu guard that structure against unintended overwriting. The default
2982 # value is chosen according to the template given.
2983 #
2984 # @template: Specifies a template mode which can be adjusted using the other
2985 # flags, defaults to 'cached'
2986 #
2987 # @bitmap-directory: since 3.0
2988 #
2989 # Since: 2.9
2990 ##
2991 { 'struct': 'Qcow2OverlapCheckFlags',
2992 'data': { '*template': 'Qcow2OverlapCheckMode',
2993 '*main-header': 'bool',
2994 '*active-l1': 'bool',
2995 '*active-l2': 'bool',
2996 '*refcount-table': 'bool',
2997 '*refcount-block': 'bool',
2998 '*snapshot-table': 'bool',
2999 '*inactive-l1': 'bool',
3000 '*inactive-l2': 'bool',
3001 '*bitmap-directory': 'bool' } }
3002
3003 ##
3004 # @Qcow2OverlapChecks:
3005 #
3006 # Specifies which metadata structures should be guarded against unintended
3007 # overwriting.
3008 #
3009 # @flags: set of flags for separate specification of each metadata structure
3010 # type
3011 #
3012 # @mode: named mode which chooses a specific set of flags
3013 #
3014 # Since: 2.9
3015 ##
3016 { 'alternate': 'Qcow2OverlapChecks',
3017 'data': { 'flags': 'Qcow2OverlapCheckFlags',
3018 'mode': 'Qcow2OverlapCheckMode' } }
3019
3020 ##
3021 # @BlockdevQcowEncryptionFormat:
3022 #
3023 # @aes: AES-CBC with plain64 initialization vectors
3024 #
3025 # Since: 2.10
3026 ##
3027 { 'enum': 'BlockdevQcowEncryptionFormat',
3028 'data': [ 'aes' ] }
3029
3030 ##
3031 # @BlockdevQcowEncryption:
3032 #
3033 # Since: 2.10
3034 ##
3035 { 'union': 'BlockdevQcowEncryption',
3036 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
3037 'discriminator': 'format',
3038 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
3039
3040 ##
3041 # @BlockdevOptionsQcow:
3042 #
3043 # Driver specific block device options for qcow.
3044 #
3045 # @encrypt: Image decryption options. Mandatory for
3046 # encrypted images, except when doing a metadata-only
3047 # probe of the image.
3048 #
3049 # Since: 2.10
3050 ##
3051 { 'struct': 'BlockdevOptionsQcow',
3052 'base': 'BlockdevOptionsGenericCOWFormat',
3053 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
3054
3055
3056
3057 ##
3058 # @BlockdevQcow2EncryptionFormat:
3059 # @aes: AES-CBC with plain64 initialization vectors
3060 #
3061 # Since: 2.10
3062 ##
3063 { 'enum': 'BlockdevQcow2EncryptionFormat',
3064 'data': [ 'aes', 'luks' ] }
3065
3066 ##
3067 # @BlockdevQcow2Encryption:
3068 #
3069 # Since: 2.10
3070 ##
3071 { 'union': 'BlockdevQcow2Encryption',
3072 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
3073 'discriminator': 'format',
3074 'data': { 'aes': 'QCryptoBlockOptionsQCow',
3075 'luks': 'QCryptoBlockOptionsLUKS'} }
3076
3077 ##
3078 # @BlockdevOptionsQcow2:
3079 #
3080 # Driver specific block device options for qcow2.
3081 #
3082 # @lazy-refcounts: whether to enable the lazy refcounts
3083 # feature (default is taken from the image file)
3084 #
3085 # @pass-discard-request: whether discard requests to the qcow2
3086 # device should be forwarded to the data source
3087 #
3088 # @pass-discard-snapshot: whether discard requests for the data source
3089 # should be issued when a snapshot operation (e.g.
3090 # deleting a snapshot) frees clusters in the qcow2 file
3091 #
3092 # @pass-discard-other: whether discard requests for the data source
3093 # should be issued on other occasions where a cluster
3094 # gets freed
3095 #
3096 # @overlap-check: which overlap checks to perform for writes
3097 # to the image, defaults to 'cached' (since 2.2)
3098 #
3099 # @cache-size: the maximum total size of the L2 table and
3100 # refcount block caches in bytes (since 2.2)
3101 #
3102 # @l2-cache-size: the maximum size of the L2 table cache in
3103 # bytes (since 2.2)
3104 #
3105 # @l2-cache-entry-size: the size of each entry in the L2 cache in
3106 # bytes. It must be a power of two between 512
3107 # and the cluster size. The default value is
3108 # the cluster size (since 2.12)
3109 #
3110 # @refcount-cache-size: the maximum size of the refcount block cache
3111 # in bytes (since 2.2)
3112 #
3113 # @cache-clean-interval: clean unused entries in the L2 and refcount
3114 # caches. The interval is in seconds. The default value
3115 # is 600 on supporting platforms, and 0 on other
3116 # platforms. 0 disables this feature. (since 2.5)
3117 #
3118 # @encrypt: Image decryption options. Mandatory for
3119 # encrypted images, except when doing a metadata-only
3120 # probe of the image. (since 2.10)
3121 #
3122 # @data-file: reference to or definition of the external data file.
3123 # This may only be specified for images that require an
3124 # external data file. If it is not specified for such
3125 # an image, the data file name is loaded from the image
3126 # file. (since 4.0)
3127 #
3128 # Since: 2.9
3129 ##
3130 { 'struct': 'BlockdevOptionsQcow2',
3131 'base': 'BlockdevOptionsGenericCOWFormat',
3132 'data': { '*lazy-refcounts': 'bool',
3133 '*pass-discard-request': 'bool',
3134 '*pass-discard-snapshot': 'bool',
3135 '*pass-discard-other': 'bool',
3136 '*overlap-check': 'Qcow2OverlapChecks',
3137 '*cache-size': 'int',
3138 '*l2-cache-size': 'int',
3139 '*l2-cache-entry-size': 'int',
3140 '*refcount-cache-size': 'int',
3141 '*cache-clean-interval': 'int',
3142 '*encrypt': 'BlockdevQcow2Encryption',
3143 '*data-file': 'BlockdevRef' } }
3144
3145 ##
3146 # @SshHostKeyCheckMode:
3147 #
3148 # @none Don't check the host key at all
3149 # @hash Compare the host key with a given hash
3150 # @known_hosts Check the host key against the known_hosts file
3151 #
3152 # Since: 2.12
3153 ##
3154 { 'enum': 'SshHostKeyCheckMode',
3155 'data': [ 'none', 'hash', 'known_hosts' ] }
3156
3157 ##
3158 # @SshHostKeyCheckHashType:
3159 #
3160 # @md5 The given hash is an md5 hash
3161 # @sha1 The given hash is an sha1 hash
3162 #
3163 # Since: 2.12
3164 ##
3165 { 'enum': 'SshHostKeyCheckHashType',
3166 'data': [ 'md5', 'sha1' ] }
3167
3168 ##
3169 # @SshHostKeyHash:
3170 #
3171 # @type The hash algorithm used for the hash
3172 # @hash The expected hash value
3173 #
3174 # Since: 2.12
3175 ##
3176 { 'struct': 'SshHostKeyHash',
3177 'data': { 'type': 'SshHostKeyCheckHashType',
3178 'hash': 'str' }}
3179
3180 ##
3181 # @SshHostKeyCheck:
3182 #
3183 # Since: 2.12
3184 ##
3185 { 'union': 'SshHostKeyCheck',
3186 'base': { 'mode': 'SshHostKeyCheckMode' },
3187 'discriminator': 'mode',
3188 'data': { 'hash': 'SshHostKeyHash' } }
3189
3190 ##
3191 # @BlockdevOptionsSsh:
3192 #
3193 # @server: host address
3194 #
3195 # @path: path to the image on the host
3196 #
3197 # @user: user as which to connect, defaults to current
3198 # local user name
3199 #
3200 # @host-key-check: Defines how and what to check the host key against
3201 # (default: known_hosts)
3202 #
3203 # Since: 2.9
3204 ##
3205 { 'struct': 'BlockdevOptionsSsh',
3206 'data': { 'server': 'InetSocketAddress',
3207 'path': 'str',
3208 '*user': 'str',
3209 '*host-key-check': 'SshHostKeyCheck' } }
3210
3211
3212 ##
3213 # @BlkdebugEvent:
3214 #
3215 # Trigger events supported by blkdebug.
3216 #
3217 # @l1_shrink_write_table: write zeros to the l1 table to shrink image.
3218 # (since 2.11)
3219 #
3220 # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11)
3221 #
3222 # @cor_write: a write due to copy-on-read (since 2.11)
3223 #
3224 # @cluster_alloc_space: an allocation of file space for a cluster (since 4.1)
3225 #
3226 # @none: triggers once at creation of the blkdebug node (since 4.1)
3227 #
3228 # Since: 2.9
3229 ##
3230 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
3231 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
3232 'l1_grow_activate_table', 'l2_load', 'l2_update',
3233 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
3234 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
3235 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
3236 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
3237 'refblock_load', 'refblock_update', 'refblock_update_part',
3238 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
3239 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
3240 'refblock_alloc_switch_table', 'cluster_alloc',
3241 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
3242 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
3243 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
3244 'pwritev_zero', 'pwritev_done', 'empty_image_prepare',
3245 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters',
3246 'cor_write', 'cluster_alloc_space', 'none'] }
3247
3248 ##
3249 # @BlkdebugIOType:
3250 #
3251 # Kinds of I/O that blkdebug can inject errors in.
3252 #
3253 # @read: .bdrv_co_preadv()
3254 #
3255 # @write: .bdrv_co_pwritev()
3256 #
3257 # @write-zeroes: .bdrv_co_pwrite_zeroes()
3258 #
3259 # @discard: .bdrv_co_pdiscard()
3260 #
3261 # @flush: .bdrv_co_flush_to_disk()
3262 #
3263 # @block-status: .bdrv_co_block_status()
3264 #
3265 # Since: 4.1
3266 ##
3267 { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE',
3268 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
3269 'block-status' ] }
3270
3271 ##
3272 # @BlkdebugInjectErrorOptions:
3273 #
3274 # Describes a single error injection for blkdebug.
3275 #
3276 # @event: trigger event
3277 #
3278 # @state: the state identifier blkdebug needs to be in to
3279 # actually trigger the event; defaults to "any"
3280 #
3281 # @iotype: the type of I/O operations on which this error should
3282 # be injected; defaults to "all read, write,
3283 # write-zeroes, discard, and flush operations"
3284 # (since: 4.1)
3285 #
3286 # @errno: error identifier (errno) to be returned; defaults to
3287 # EIO
3288 #
3289 # @sector: specifies the sector index which has to be affected
3290 # in order to actually trigger the event; defaults to "any
3291 # sector"
3292 #
3293 # @once: disables further events after this one has been
3294 # triggered; defaults to false
3295 #
3296 # @immediately: fail immediately; defaults to false
3297 #
3298 # Since: 2.9
3299 ##
3300 { 'struct': 'BlkdebugInjectErrorOptions',
3301 'data': { 'event': 'BlkdebugEvent',
3302 '*state': 'int',
3303 '*iotype': 'BlkdebugIOType',
3304 '*errno': 'int',
3305 '*sector': 'int',
3306 '*once': 'bool',
3307 '*immediately': 'bool' } }
3308
3309 ##
3310 # @BlkdebugSetStateOptions:
3311 #
3312 # Describes a single state-change event for blkdebug.
3313 #
3314 # @event: trigger event
3315 #
3316 # @state: the current state identifier blkdebug needs to be in;
3317 # defaults to "any"
3318 #
3319 # @new_state: the state identifier blkdebug is supposed to assume if
3320 # this event is triggered
3321 #
3322 # Since: 2.9
3323 ##
3324 { 'struct': 'BlkdebugSetStateOptions',
3325 'data': { 'event': 'BlkdebugEvent',
3326 '*state': 'int',
3327 'new_state': 'int' } }
3328
3329 ##
3330 # @BlockdevOptionsBlkdebug:
3331 #
3332 # Driver specific block device options for blkdebug.
3333 #
3334 # @image: underlying raw block device (or image file)
3335 #
3336 # @config: filename of the configuration file
3337 #
3338 # @align: required alignment for requests in bytes, must be
3339 # positive power of 2, or 0 for default
3340 #
3341 # @max-transfer: maximum size for I/O transfers in bytes, must be
3342 # positive multiple of @align and of the underlying
3343 # file's request alignment (but need not be a power of
3344 # 2), or 0 for default (since 2.10)
3345 #
3346 # @opt-write-zero: preferred alignment for write zero requests in bytes,
3347 # must be positive multiple of @align and of the
3348 # underlying file's request alignment (but need not be a
3349 # power of 2), or 0 for default (since 2.10)
3350 #
3351 # @max-write-zero: maximum size for write zero requests in bytes, must be
3352 # positive multiple of @align, of @opt-write-zero, and of
3353 # the underlying file's request alignment (but need not
3354 # be a power of 2), or 0 for default (since 2.10)
3355 #
3356 # @opt-discard: preferred alignment for discard requests in bytes, must
3357 # be positive multiple of @align and of the underlying
3358 # file's request alignment (but need not be a power of
3359 # 2), or 0 for default (since 2.10)
3360 #
3361 # @max-discard: maximum size for discard requests in bytes, must be
3362 # positive multiple of @align, of @opt-discard, and of
3363 # the underlying file's request alignment (but need not
3364 # be a power of 2), or 0 for default (since 2.10)
3365 #
3366 # @inject-error: array of error injection descriptions
3367 #
3368 # @set-state: array of state-change descriptions
3369 #
3370 # Since: 2.9
3371 ##
3372 { 'struct': 'BlockdevOptionsBlkdebug',
3373 'data': { 'image': 'BlockdevRef',
3374 '*config': 'str',
3375 '*align': 'int', '*max-transfer': 'int32',
3376 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
3377 '*opt-discard': 'int32', '*max-discard': 'int32',
3378 '*inject-error': ['BlkdebugInjectErrorOptions'],
3379 '*set-state': ['BlkdebugSetStateOptions'] } }
3380
3381 ##
3382 # @BlockdevOptionsBlklogwrites:
3383 #
3384 # Driver specific block device options for blklogwrites.
3385 #
3386 # @file: block device
3387 #
3388 # @log: block device used to log writes to @file
3389 #
3390 # @log-sector-size: sector size used in logging writes to @file, determines
3391 # granularity of offsets and sizes of writes (default: 512)
3392 #
3393 # @log-append: append to an existing log (default: false)
3394 #
3395 # @log-super-update-interval: interval of write requests after which the log
3396 # super block is updated to disk (default: 4096)
3397 #
3398 # Since: 3.0
3399 ##
3400 { 'struct': 'BlockdevOptionsBlklogwrites',
3401 'data': { 'file': 'BlockdevRef',
3402 'log': 'BlockdevRef',
3403 '*log-sector-size': 'uint32',
3404 '*log-append': 'bool',
3405 '*log-super-update-interval': 'uint64' } }
3406
3407 ##
3408 # @BlockdevOptionsBlkverify:
3409 #
3410 # Driver specific block device options for blkverify.
3411 #
3412 # @test: block device to be tested
3413 #
3414 # @raw: raw image used for verification
3415 #
3416 # Since: 2.9
3417 ##
3418 { 'struct': 'BlockdevOptionsBlkverify',
3419 'data': { 'test': 'BlockdevRef',
3420 'raw': 'BlockdevRef' } }
3421
3422 ##
3423 # @QuorumReadPattern:
3424 #
3425 # An enumeration of quorum read patterns.
3426 #
3427 # @quorum: read all the children and do a quorum vote on reads
3428 #
3429 # @fifo: read only from the first child that has not failed
3430 #
3431 # Since: 2.9
3432 ##
3433 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
3434
3435 ##
3436 # @BlockdevOptionsQuorum:
3437 #
3438 # Driver specific block device options for Quorum
3439 #
3440 # @blkverify: true if the driver must print content mismatch
3441 # set to false by default
3442 #
3443 # @children: the children block devices to use
3444 #
3445 # @vote-threshold: the vote limit under which a read will fail
3446 #
3447 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
3448 # (Since 2.1)
3449 #
3450 # @read-pattern: choose read pattern and set to quorum by default
3451 # (Since 2.2)
3452 #
3453 # Since: 2.9
3454 ##
3455 { 'struct': 'BlockdevOptionsQuorum',
3456 'data': { '*blkverify': 'bool',
3457 'children': [ 'BlockdevRef' ],
3458 'vote-threshold': 'int',
3459 '*rewrite-corrupted': 'bool',
3460 '*read-pattern': 'QuorumReadPattern' } }
3461
3462 ##
3463 # @BlockdevOptionsGluster:
3464 #
3465 # Driver specific block device options for Gluster
3466 #
3467 # @volume: name of gluster volume where VM image resides
3468 #
3469 # @path: absolute path to image file in gluster volume
3470 #
3471 # @server: gluster servers description
3472 #
3473 # @debug: libgfapi log level (default '4' which is Error)
3474 # (Since 2.8)
3475 #
3476 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
3477 #
3478 # Since: 2.9
3479 ##
3480 { 'struct': 'BlockdevOptionsGluster',
3481 'data': { 'volume': 'str',
3482 'path': 'str',
3483 'server': ['SocketAddress'],
3484 '*debug': 'int',
3485 '*logfile': 'str' } }
3486
3487 ##
3488 # @IscsiTransport:
3489 #
3490 # An enumeration of libiscsi transport types
3491 #
3492 # Since: 2.9
3493 ##
3494 { 'enum': 'IscsiTransport',
3495 'data': [ 'tcp', 'iser' ] }
3496
3497 ##
3498 # @IscsiHeaderDigest:
3499 #
3500 # An enumeration of header digests supported by libiscsi
3501 #
3502 # Since: 2.9
3503 ##
3504 { 'enum': 'IscsiHeaderDigest',
3505 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
3506 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
3507
3508 ##
3509 # @BlockdevOptionsIscsi:
3510 #
3511 # @transport: The iscsi transport type
3512 #
3513 # @portal: The address of the iscsi portal
3514 #
3515 # @target: The target iqn name
3516 #
3517 # @lun: LUN to connect to. Defaults to 0.
3518 #
3519 # @user: User name to log in with. If omitted, no CHAP
3520 # authentication is performed.
3521 #
3522 # @password-secret: The ID of a QCryptoSecret object providing
3523 # the password for the login. This option is required if
3524 # @user is specified.
3525 #
3526 # @initiator-name: The iqn name we want to identify to the target
3527 # as. If this option is not specified, an initiator name is
3528 # generated automatically.
3529 #
3530 # @header-digest: The desired header digest. Defaults to
3531 # none-crc32c.
3532 #
3533 # @timeout: Timeout in seconds after which a request will
3534 # timeout. 0 means no timeout and is the default.
3535 #
3536 # Driver specific block device options for iscsi
3537 #
3538 # Since: 2.9
3539 ##
3540 { 'struct': 'BlockdevOptionsIscsi',
3541 'data': { 'transport': 'IscsiTransport',
3542 'portal': 'str',
3543 'target': 'str',
3544 '*lun': 'int',
3545 '*user': 'str',
3546 '*password-secret': 'str',
3547 '*initiator-name': 'str',
3548 '*header-digest': 'IscsiHeaderDigest',
3549 '*timeout': 'int' } }
3550
3551
3552 ##
3553 # @RbdAuthMode:
3554 #
3555 # Since: 3.0
3556 ##
3557 { 'enum': 'RbdAuthMode',
3558 'data': [ 'cephx', 'none' ] }
3559
3560 ##
3561 # @BlockdevOptionsRbd:
3562 #
3563 # @pool: Ceph pool name.
3564 #
3565 # @image: Image name in the Ceph pool.
3566 #
3567 # @conf: path to Ceph configuration file. Values
3568 # in the configuration file will be overridden by
3569 # options specified via QAPI.
3570 #
3571 # @snapshot: Ceph snapshot name.
3572 #
3573 # @user: Ceph id name.
3574 #
3575 # @auth-client-required: Acceptable authentication modes.
3576 # This maps to Ceph configuration option
3577 # "auth_client_required". (Since 3.0)
3578 #
3579 # @key-secret: ID of a QCryptoSecret object providing a key
3580 # for cephx authentication.
3581 # This maps to Ceph configuration option
3582 # "key". (Since 3.0)
3583 #
3584 # @server: Monitor host address and port. This maps
3585 # to the "mon_host" Ceph option.
3586 #
3587 # Since: 2.9
3588 ##
3589 { 'struct': 'BlockdevOptionsRbd',
3590 'data': { 'pool': 'str',
3591 'image': 'str',
3592 '*conf': 'str',
3593 '*snapshot': 'str',
3594 '*user': 'str',
3595 '*auth-client-required': ['RbdAuthMode'],
3596 '*key-secret': 'str',
3597 '*server': ['InetSocketAddressBase'] } }
3598
3599 ##
3600 # @BlockdevOptionsSheepdog:
3601 #
3602 # Driver specific block device options for sheepdog
3603 #
3604 # @vdi: Virtual disk image name
3605 # @server: The Sheepdog server to connect to
3606 # @snap-id: Snapshot ID
3607 # @tag: Snapshot tag name
3608 #
3609 # Only one of @snap-id and @tag may be present.
3610 #
3611 # Since: 2.9
3612 ##
3613 { 'struct': 'BlockdevOptionsSheepdog',
3614 'data': { 'server': 'SocketAddress',
3615 'vdi': 'str',
3616 '*snap-id': 'uint32',
3617 '*tag': 'str' } }
3618
3619 ##
3620 # @ReplicationMode:
3621 #
3622 # An enumeration of replication modes.
3623 #
3624 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
3625 #
3626 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
3627 #
3628 # Since: 2.9
3629 ##
3630 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ],
3631 'if': 'defined(CONFIG_REPLICATION)' }
3632
3633 ##
3634 # @BlockdevOptionsReplication:
3635 #
3636 # Driver specific block device options for replication
3637 #
3638 # @mode: the replication mode
3639 #
3640 # @top-id: In secondary mode, node name or device ID of the root
3641 # node who owns the replication node chain. Must not be given in
3642 # primary mode.
3643 #
3644 # Since: 2.9
3645 ##
3646 { 'struct': 'BlockdevOptionsReplication',
3647 'base': 'BlockdevOptionsGenericFormat',
3648 'data': { 'mode': 'ReplicationMode',
3649 '*top-id': 'str' },
3650 'if': 'defined(CONFIG_REPLICATION)' }
3651
3652 ##
3653 # @NFSTransport:
3654 #
3655 # An enumeration of NFS transport types
3656 #
3657 # @inet: TCP transport
3658 #
3659 # Since: 2.9
3660 ##
3661 { 'enum': 'NFSTransport',
3662 'data': [ 'inet' ] }
3663
3664 ##
3665 # @NFSServer:
3666 #
3667 # Captures the address of the socket
3668 #
3669 # @type: transport type used for NFS (only TCP supported)
3670 #
3671 # @host: host address for NFS server
3672 #
3673 # Since: 2.9
3674 ##
3675 { 'struct': 'NFSServer',
3676 'data': { 'type': 'NFSTransport',
3677 'host': 'str' } }
3678
3679 ##
3680 # @BlockdevOptionsNfs:
3681 #
3682 # Driver specific block device option for NFS
3683 #
3684 # @server: host address
3685 #
3686 # @path: path of the image on the host
3687 #
3688 # @user: UID value to use when talking to the
3689 # server (defaults to 65534 on Windows and getuid()
3690 # on unix)
3691 #
3692 # @group: GID value to use when talking to the
3693 # server (defaults to 65534 on Windows and getgid()
3694 # in unix)
3695 #
3696 # @tcp-syn-count: number of SYNs during the session
3697 # establishment (defaults to libnfs default)
3698 #
3699 # @readahead-size: set the readahead size in bytes (defaults
3700 # to libnfs default)
3701 #
3702 # @page-cache-size: set the pagecache size in bytes (defaults
3703 # to libnfs default)
3704 #
3705 # @debug: set the NFS debug level (max 2) (defaults
3706 # to libnfs default)
3707 #
3708 # Since: 2.9
3709 ##
3710 { 'struct': 'BlockdevOptionsNfs',
3711 'data': { 'server': 'NFSServer',
3712 'path': 'str',
3713 '*user': 'int',
3714 '*group': 'int',
3715 '*tcp-syn-count': 'int',
3716 '*readahead-size': 'int',
3717 '*page-cache-size': 'int',
3718 '*debug': 'int' } }
3719
3720 ##
3721 # @BlockdevOptionsCurlBase:
3722 #
3723 # Driver specific block device options shared by all protocols supported by the
3724 # curl backend.
3725 #
3726 # @url: URL of the image file
3727 #
3728 # @readahead: Size of the read-ahead cache; must be a multiple of
3729 # 512 (defaults to 256 kB)
3730 #
3731 # @timeout: Timeout for connections, in seconds (defaults to 5)
3732 #
3733 # @username: Username for authentication (defaults to none)
3734 #
3735 # @password-secret: ID of a QCryptoSecret object providing a password
3736 # for authentication (defaults to no password)
3737 #
3738 # @proxy-username: Username for proxy authentication (defaults to none)
3739 #
3740 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
3741 # for proxy authentication (defaults to no password)
3742 #
3743 # Since: 2.9
3744 ##
3745 { 'struct': 'BlockdevOptionsCurlBase',
3746 'data': { 'url': 'str',
3747 '*readahead': 'int',
3748 '*timeout': 'int',
3749 '*username': 'str',
3750 '*password-secret': 'str',
3751 '*proxy-username': 'str',
3752 '*proxy-password-secret': 'str' } }
3753
3754 ##
3755 # @BlockdevOptionsCurlHttp:
3756 #
3757 # Driver specific block device options for HTTP connections over the curl
3758 # backend. URLs must start with "http://".
3759 #
3760 # @cookie: List of cookies to set; format is
3761 # "name1=content1; name2=content2;" as explained by
3762 # CURLOPT_COOKIE(3). Defaults to no cookies.
3763 #
3764 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3765 # secure way. See @cookie for the format. (since 2.10)
3766 #
3767 # Since: 2.9
3768 ##
3769 { 'struct': 'BlockdevOptionsCurlHttp',
3770 'base': 'BlockdevOptionsCurlBase',
3771 'data': { '*cookie': 'str',
3772 '*cookie-secret': 'str'} }
3773
3774 ##
3775 # @BlockdevOptionsCurlHttps:
3776 #
3777 # Driver specific block device options for HTTPS connections over the curl
3778 # backend. URLs must start with "https://".
3779 #
3780 # @cookie: List of cookies to set; format is
3781 # "name1=content1; name2=content2;" as explained by
3782 # CURLOPT_COOKIE(3). Defaults to no cookies.
3783 #
3784 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3785 # true)
3786 #
3787 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
3788 # secure way. See @cookie for the format. (since 2.10)
3789 #
3790 # Since: 2.9
3791 ##
3792 { 'struct': 'BlockdevOptionsCurlHttps',
3793 'base': 'BlockdevOptionsCurlBase',
3794 'data': { '*cookie': 'str',
3795 '*sslverify': 'bool',
3796 '*cookie-secret': 'str'} }
3797
3798 ##
3799 # @BlockdevOptionsCurlFtp:
3800 #
3801 # Driver specific block device options for FTP connections over the curl
3802 # backend. URLs must start with "ftp://".
3803 #
3804 # Since: 2.9
3805 ##
3806 { 'struct': 'BlockdevOptionsCurlFtp',
3807 'base': 'BlockdevOptionsCurlBase',
3808 'data': { } }
3809
3810 ##
3811 # @BlockdevOptionsCurlFtps:
3812 #
3813 # Driver specific block device options for FTPS connections over the curl
3814 # backend. URLs must start with "ftps://".
3815 #
3816 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
3817 # true)
3818 #
3819 # Since: 2.9
3820 ##
3821 { 'struct': 'BlockdevOptionsCurlFtps',
3822 'base': 'BlockdevOptionsCurlBase',
3823 'data': { '*sslverify': 'bool' } }
3824
3825 ##
3826 # @BlockdevOptionsNbd:
3827 #
3828 # Driver specific block device options for NBD.
3829 #
3830 # @server: NBD server address
3831 #
3832 # @export: export name
3833 #
3834 # @tls-creds: TLS credentials ID
3835 #
3836 # @x-dirty-bitmap: A "qemu:dirty-bitmap:NAME" string to query in place of
3837 # traditional "base:allocation" block status (see
3838 # NBD_OPT_LIST_META_CONTEXT in the NBD protocol) (since 3.0)
3839 #
3840 # @reconnect-delay: On an unexpected disconnect, the nbd client tries to
3841 # connect again until succeeding or encountering a serious
3842 # error. During the first @reconnect-delay seconds, all
3843 # requests are paused and will be rerun on a successful
3844 # reconnect. After that time, any delayed requests and all
3845 # future requests before a successful reconnect will
3846 # immediately fail. Default 0 (Since 4.2)
3847 #
3848 # Since: 2.9
3849 ##
3850 { 'struct': 'BlockdevOptionsNbd',
3851 'data': { 'server': 'SocketAddress',
3852 '*export': 'str',
3853 '*tls-creds': 'str',
3854 '*x-dirty-bitmap': 'str',
3855 '*reconnect-delay': 'uint32' } }
3856
3857 ##
3858 # @BlockdevOptionsRaw:
3859 #
3860 # Driver specific block device options for the raw driver.
3861 #
3862 # @offset: position where the block device starts
3863 # @size: the assumed size of the device
3864 #
3865 # Since: 2.9
3866 ##
3867 { 'struct': 'BlockdevOptionsRaw',
3868 'base': 'BlockdevOptionsGenericFormat',
3869 'data': { '*offset': 'int', '*size': 'int' } }
3870
3871 ##
3872 # @BlockdevOptionsVxHS:
3873 #
3874 # Driver specific block device options for VxHS
3875 #
3876 # @vdisk-id: UUID of VxHS volume
3877 # @server: vxhs server IP, port
3878 # @tls-creds: TLS credentials ID
3879 #
3880 # Since: 2.10
3881 ##
3882 { 'struct': 'BlockdevOptionsVxHS',
3883 'data': { 'vdisk-id': 'str',
3884 'server': 'InetSocketAddressBase',
3885 '*tls-creds': 'str' } }
3886
3887 ##
3888 # @BlockdevOptionsThrottle:
3889 #
3890 # Driver specific block device options for the throttle driver
3891 #
3892 # @throttle-group: the name of the throttle-group object to use. It
3893 # must already exist.
3894 # @file: reference to or definition of the data source block device
3895 # Since: 2.11
3896 ##
3897 { 'struct': 'BlockdevOptionsThrottle',
3898 'data': { 'throttle-group': 'str',
3899 'file' : 'BlockdevRef'
3900 } }
3901 ##
3902 # @BlockdevOptions:
3903 #
3904 # Options for creating a block device. Many options are available for all
3905 # block devices, independent of the block driver:
3906 #
3907 # @driver: block driver name
3908 # @node-name: the node name of the new node (Since 2.0).
3909 # This option is required on the top level of blockdev-add.
3910 # Valid node names start with an alphabetic character and may
3911 # contain only alphanumeric characters, '-', '.' and '_'. Their
3912 # maximum length is 31 characters.
3913 # @discard: discard-related options (default: ignore)
3914 # @cache: cache-related options
3915 # @read-only: whether the block device should be read-only (default: false).
3916 # Note that some block drivers support only read-only access,
3917 # either generally or in certain configurations. In this case,
3918 # the default value does not work and the option must be
3919 # specified explicitly.
3920 # @auto-read-only: if true and @read-only is false, QEMU may automatically
3921 # decide not to open the image read-write as requested, but
3922 # fall back to read-only instead (and switch between the modes
3923 # later), e.g. depending on whether the image file is writable
3924 # or whether a writing user is attached to the node
3925 # (default: false, since 3.1)
3926 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3927 # (default: off)
3928 # @force-share: force share all permission on added nodes.
3929 # Requires read-only=true. (Since 2.10)
3930 #
3931 # Remaining options are determined by the block driver.
3932 #
3933 # Since: 2.9
3934 ##
3935 { 'union': 'BlockdevOptions',
3936 'base': { 'driver': 'BlockdevDriver',
3937 '*node-name': 'str',
3938 '*discard': 'BlockdevDiscardOptions',
3939 '*cache': 'BlockdevCacheOptions',
3940 '*read-only': 'bool',
3941 '*auto-read-only': 'bool',
3942 '*force-share': 'bool',
3943 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3944 'discriminator': 'driver',
3945 'data': {
3946 'blkdebug': 'BlockdevOptionsBlkdebug',
3947 'blklogwrites':'BlockdevOptionsBlklogwrites',
3948 'blkverify': 'BlockdevOptionsBlkverify',
3949 'bochs': 'BlockdevOptionsGenericFormat',
3950 'cloop': 'BlockdevOptionsGenericFormat',
3951 'copy-on-read':'BlockdevOptionsGenericFormat',
3952 'dmg': 'BlockdevOptionsGenericFormat',
3953 'file': 'BlockdevOptionsFile',
3954 'ftp': 'BlockdevOptionsCurlFtp',
3955 'ftps': 'BlockdevOptionsCurlFtps',
3956 'gluster': 'BlockdevOptionsGluster',
3957 'host_cdrom': 'BlockdevOptionsFile',
3958 'host_device':'BlockdevOptionsFile',
3959 'http': 'BlockdevOptionsCurlHttp',
3960 'https': 'BlockdevOptionsCurlHttps',
3961 'iscsi': 'BlockdevOptionsIscsi',
3962 'luks': 'BlockdevOptionsLUKS',
3963 'nbd': 'BlockdevOptionsNbd',
3964 'nfs': 'BlockdevOptionsNfs',
3965 'null-aio': 'BlockdevOptionsNull',
3966 'null-co': 'BlockdevOptionsNull',
3967 'nvme': 'BlockdevOptionsNVMe',
3968 'parallels': 'BlockdevOptionsGenericFormat',
3969 'qcow2': 'BlockdevOptionsQcow2',
3970 'qcow': 'BlockdevOptionsQcow',
3971 'qed': 'BlockdevOptionsGenericCOWFormat',
3972 'quorum': 'BlockdevOptionsQuorum',
3973 'raw': 'BlockdevOptionsRaw',
3974 'rbd': 'BlockdevOptionsRbd',
3975 'replication': { 'type': 'BlockdevOptionsReplication',
3976 'if': 'defined(CONFIG_REPLICATION)' },
3977 'sheepdog': 'BlockdevOptionsSheepdog',
3978 'ssh': 'BlockdevOptionsSsh',
3979 'throttle': 'BlockdevOptionsThrottle',
3980 'vdi': 'BlockdevOptionsGenericFormat',
3981 'vhdx': 'BlockdevOptionsGenericFormat',
3982 'vmdk': 'BlockdevOptionsGenericCOWFormat',
3983 'vpc': 'BlockdevOptionsGenericFormat',
3984 'vvfat': 'BlockdevOptionsVVFAT',
3985 'vxhs': 'BlockdevOptionsVxHS'
3986 } }
3987
3988 ##
3989 # @BlockdevRef:
3990 #
3991 # Reference to a block device.
3992 #
3993 # @definition: defines a new block device inline
3994 # @reference: references the ID of an existing block device
3995 #
3996 # Since: 2.9
3997 ##
3998 { 'alternate': 'BlockdevRef',
3999 'data': { 'definition': 'BlockdevOptions',
4000 'reference': 'str' } }
4001
4002 ##
4003 # @BlockdevRefOrNull:
4004 #
4005 # Reference to a block device.
4006 #
4007 # @definition: defines a new block device inline
4008 # @reference: references the ID of an existing block device.
4009 # An empty string means that no block device should
4010 # be referenced. Deprecated; use null instead.
4011 # @null: No block device should be referenced (since 2.10)
4012 #
4013 # Since: 2.9
4014 ##
4015 { 'alternate': 'BlockdevRefOrNull',
4016 'data': { 'definition': 'BlockdevOptions',
4017 'reference': 'str',
4018 'null': 'null' } }
4019
4020 ##
4021 # @blockdev-add:
4022 #
4023 # Creates a new block device. If the @id option is given at the top level, a
4024 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
4025 # level and no BlockBackend will be created.
4026 #
4027 # Since: 2.9
4028 #
4029 # Example:
4030 #
4031 # 1.
4032 # -> { "execute": "blockdev-add",
4033 # "arguments": {
4034 # "driver": "qcow2",
4035 # "node-name": "test1",
4036 # "file": {
4037 # "driver": "file",
4038 # "filename": "test.qcow2"
4039 # }
4040 # }
4041 # }
4042 # <- { "return": {} }
4043 #
4044 # 2.
4045 # -> { "execute": "blockdev-add",
4046 # "arguments": {
4047 # "driver": "qcow2",
4048 # "node-name": "node0",
4049 # "discard": "unmap",
4050 # "cache": {
4051 # "direct": true
4052 # },
4053 # "file": {
4054 # "driver": "file",
4055 # "filename": "/tmp/test.qcow2"
4056 # },
4057 # "backing": {
4058 # "driver": "raw",
4059 # "file": {
4060 # "driver": "file",
4061 # "filename": "/dev/fdset/4"
4062 # }
4063 # }
4064 # }
4065 # }
4066 #
4067 # <- { "return": {} }
4068 #
4069 ##
4070 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
4071
4072 ##
4073 # @x-blockdev-reopen:
4074 #
4075 # Reopens a block device using the given set of options. Any option
4076 # not specified will be reset to its default value regardless of its
4077 # previous status. If an option cannot be changed or a particular
4078 # driver does not support reopening then the command will return an
4079 # error.
4080 #
4081 # The top-level @node-name option (from BlockdevOptions) must be
4082 # specified and is used to select the block device to be reopened.
4083 # Other @node-name options must be either omitted or set to the
4084 # current name of the appropriate node. This command won't change any
4085 # node name and any attempt to do it will result in an error.
4086 #
4087 # In the case of options that refer to child nodes, the behavior of
4088 # this command depends on the value:
4089 #
4090 # 1) A set of options (BlockdevOptions): the child is reopened with
4091 # the specified set of options.
4092 #
4093 # 2) A reference to the current child: the child is reopened using
4094 # its existing set of options.
4095 #
4096 # 3) A reference to a different node: the current child is replaced
4097 # with the specified one.
4098 #
4099 # 4) NULL: the current child (if any) is detached.
4100 #
4101 # Options (1) and (2) are supported in all cases, but at the moment
4102 # only @backing allows replacing or detaching an existing child.
4103 #
4104 # Unlike with blockdev-add, the @backing option must always be present
4105 # unless the node being reopened does not have a backing file and its
4106 # image does not have a default backing file name as part of its
4107 # metadata.
4108 #
4109 # Since: 4.0
4110 ##
4111 { 'command': 'x-blockdev-reopen',
4112 'data': 'BlockdevOptions', 'boxed': true }
4113
4114 ##
4115 # @blockdev-del:
4116 #
4117 # Deletes a block device that has been added using blockdev-add.
4118 # The command will fail if the node is attached to a device or is
4119 # otherwise being used.
4120 #
4121 # @node-name: Name of the graph node to delete.
4122 #
4123 # Since: 2.9
4124 #
4125 # Example:
4126 #
4127 # -> { "execute": "blockdev-add",
4128 # "arguments": {
4129 # "driver": "qcow2",
4130 # "node-name": "node0",
4131 # "file": {
4132 # "driver": "file",
4133 # "filename": "test.qcow2"
4134 # }
4135 # }
4136 # }
4137 # <- { "return": {} }
4138 #
4139 # -> { "execute": "blockdev-del",
4140 # "arguments": { "node-name": "node0" }
4141 # }
4142 # <- { "return": {} }
4143 #
4144 ##
4145 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
4146
4147 ##
4148 # @BlockdevCreateOptionsFile:
4149 #
4150 # Driver specific image creation options for file.
4151 #
4152 # @filename Filename for the new image file
4153 # @size Size of the virtual disk in bytes
4154 # @preallocation Preallocation mode for the new image (default: off;
4155 # allowed values: off,
4156 # falloc (if defined CONFIG_POSIX_FALLOCATE),
4157 # full (if defined CONFIG_POSIX))
4158 # @nocow Turn off copy-on-write (valid only on btrfs; default: off)
4159 #
4160 # Since: 2.12
4161 ##
4162 { 'struct': 'BlockdevCreateOptionsFile',
4163 'data': { 'filename': 'str',
4164 'size': 'size',
4165 '*preallocation': 'PreallocMode',
4166 '*nocow': 'bool' } }
4167
4168 ##
4169 # @BlockdevCreateOptionsGluster:
4170 #
4171 # Driver specific image creation options for gluster.
4172 #
4173 # @location Where to store the new image file
4174 # @size Size of the virtual disk in bytes
4175 # @preallocation Preallocation mode for the new image (default: off;
4176 # allowed values: off,
4177 # falloc (if defined CONFIG_GLUSTERFS_FALLOCATE),
4178 # full (if defined CONFIG_GLUSTERFS_ZEROFILL))
4179 #
4180 # Since: 2.12
4181 ##
4182 { 'struct': 'BlockdevCreateOptionsGluster',
4183 'data': { 'location': 'BlockdevOptionsGluster',
4184 'size': 'size',
4185 '*preallocation': 'PreallocMode' } }
4186
4187 ##
4188 # @BlockdevCreateOptionsLUKS:
4189 #
4190 # Driver specific image creation options for LUKS.
4191 #
4192 # @file Node to create the image format on
4193 # @size Size of the virtual disk in bytes
4194 #
4195 # Since: 2.12
4196 ##
4197 { 'struct': 'BlockdevCreateOptionsLUKS',
4198 'base': 'QCryptoBlockCreateOptionsLUKS',
4199 'data': { 'file': 'BlockdevRef',
4200 'size': 'size' } }
4201
4202 ##
4203 # @BlockdevCreateOptionsNfs:
4204 #
4205 # Driver specific image creation options for NFS.
4206 #
4207 # @location Where to store the new image file
4208 # @size Size of the virtual disk in bytes
4209 #
4210 # Since: 2.12
4211 ##
4212 { 'struct': 'BlockdevCreateOptionsNfs',
4213 'data': { 'location': 'BlockdevOptionsNfs',
4214 'size': 'size' } }
4215
4216 ##
4217 # @BlockdevCreateOptionsParallels:
4218 #
4219 # Driver specific image creation options for parallels.
4220 #
4221 # @file Node to create the image format on
4222 # @size Size of the virtual disk in bytes
4223 # @cluster-size Cluster size in bytes (default: 1 MB)
4224 #
4225 # Since: 2.12
4226 ##
4227 { 'struct': 'BlockdevCreateOptionsParallels',
4228 'data': { 'file': 'BlockdevRef',
4229 'size': 'size',
4230 '*cluster-size': 'size' } }
4231
4232 ##
4233 # @BlockdevCreateOptionsQcow:
4234 #
4235 # Driver specific image creation options for qcow.
4236 #
4237 # @file Node to create the image format on
4238 # @size Size of the virtual disk in bytes
4239 # @backing-file File name of the backing file if a backing file
4240 # should be used
4241 # @encrypt Encryption options if the image should be encrypted
4242 #
4243 # Since: 2.12
4244 ##
4245 { 'struct': 'BlockdevCreateOptionsQcow',
4246 'data': { 'file': 'BlockdevRef',
4247 'size': 'size',
4248 '*backing-file': 'str',
4249 '*encrypt': 'QCryptoBlockCreateOptions' } }
4250
4251 ##
4252 # @BlockdevQcow2Version:
4253 #
4254 # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2)
4255 # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3)
4256 #
4257 # Since: 2.12
4258 ##
4259 { 'enum': 'BlockdevQcow2Version',
4260 'data': [ 'v2', 'v3' ] }
4261
4262
4263 ##
4264 # @BlockdevCreateOptionsQcow2:
4265 #
4266 # Driver specific image creation options for qcow2.
4267 #
4268 # @file Node to create the image format on
4269 # @data-file Node to use as an external data file in which all guest
4270 # data is stored so that only metadata remains in the qcow2
4271 # file (since: 4.0)
4272 # @data-file-raw True if the external data file must stay valid as a
4273 # standalone (read-only) raw image without looking at qcow2
4274 # metadata (default: false; since: 4.0)
4275 # @size Size of the virtual disk in bytes
4276 # @version Compatibility level (default: v3)
4277 # @backing-file File name of the backing file if a backing file
4278 # should be used
4279 # @backing-fmt Name of the block driver to use for the backing file
4280 # @encrypt Encryption options if the image should be encrypted
4281 # @cluster-size qcow2 cluster size in bytes (default: 65536)
4282 # @preallocation Preallocation mode for the new image (default: off;
4283 # allowed values: off, falloc, full, metadata)
4284 # @lazy-refcounts True if refcounts may be updated lazily (default: off)
4285 # @refcount-bits Width of reference counts in bits (default: 16)
4286 #
4287 # Since: 2.12
4288 ##
4289 { 'struct': 'BlockdevCreateOptionsQcow2',
4290 'data': { 'file': 'BlockdevRef',
4291 '*data-file': 'BlockdevRef',
4292 '*data-file-raw': 'bool',
4293 'size': 'size',
4294 '*version': 'BlockdevQcow2Version',
4295 '*backing-file': 'str',
4296 '*backing-fmt': 'BlockdevDriver',
4297 '*encrypt': 'QCryptoBlockCreateOptions',
4298 '*cluster-size': 'size',
4299 '*preallocation': 'PreallocMode',
4300 '*lazy-refcounts': 'bool',
4301 '*refcount-bits': 'int' } }
4302
4303 ##
4304 # @BlockdevCreateOptionsQed:
4305 #
4306 # Driver specific image creation options for qed.
4307 #
4308 # @file Node to create the image format on
4309 # @size Size of the virtual disk in bytes
4310 # @backing-file File name of the backing file if a backing file
4311 # should be used
4312 # @backing-fmt Name of the block driver to use for the backing file
4313 # @cluster-size Cluster size in bytes (default: 65536)
4314 # @table-size L1/L2 table size (in clusters)
4315 #
4316 # Since: 2.12
4317 ##
4318 { 'struct': 'BlockdevCreateOptionsQed',
4319 'data': { 'file': 'BlockdevRef',
4320 'size': 'size',
4321 '*backing-file': 'str',
4322 '*backing-fmt': 'BlockdevDriver',
4323 '*cluster-size': 'size',
4324 '*table-size': 'int' } }
4325
4326 ##
4327 # @BlockdevCreateOptionsRbd:
4328 #
4329 # Driver specific image creation options for rbd/Ceph.
4330 #
4331 # @location Where to store the new image file. This location cannot
4332 # point to a snapshot.
4333 # @size Size of the virtual disk in bytes
4334 # @cluster-size RBD object size
4335 #
4336 # Since: 2.12
4337 ##
4338 { 'struct': 'BlockdevCreateOptionsRbd',
4339 'data': { 'location': 'BlockdevOptionsRbd',
4340 'size': 'size',
4341 '*cluster-size' : 'size' } }
4342
4343 ##
4344 # @BlockdevVmdkSubformat:
4345 #
4346 # Subformat options for VMDK images
4347 #
4348 # @monolithicSparse: Single file image with sparse cluster allocation
4349 #
4350 # @monolithicFlat: Single flat data image and a descriptor file
4351 #
4352 # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent
4353 # files, in addition to a descriptor file
4354 #
4355 # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
4356 # files, in addition to a descriptor file
4357 #
4358 # @streamOptimized: Single file image sparse cluster allocation, optimized
4359 # for streaming over network.
4360 #
4361 # Since: 4.0
4362 ##
4363 { 'enum': 'BlockdevVmdkSubformat',
4364 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
4365 'twoGbMaxExtentFlat', 'streamOptimized'] }
4366
4367 ##
4368 # @BlockdevVmdkAdapterType:
4369 #
4370 # Adapter type info for VMDK images
4371 #
4372 # Since: 4.0
4373 ##
4374 { 'enum': 'BlockdevVmdkAdapterType',
4375 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
4376
4377 ##
4378 # @BlockdevCreateOptionsVmdk:
4379 #
4380 # Driver specific image creation options for VMDK.
4381 #
4382 # @file Where to store the new image file. This refers to the image
4383 # file for monolithcSparse and streamOptimized format, or the
4384 # descriptor file for other formats.
4385 # @size Size of the virtual disk in bytes
4386 # @extents Where to store the data extents. Required for monolithcFlat,
4387 # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
4388 # monolithicFlat, only one entry is required; for
4389 # twoGbMaxExtent* formats, the number of entries required is
4390 # calculated as extent_number = virtual_size / 2GB. Providing
4391 # more extents than will be used is an error.
4392 # @subformat The subformat of the VMDK image. Default: "monolithicSparse".
4393 # @backing-file The path of backing file. Default: no backing file is used.
4394 # @adapter-type The adapter type used to fill in the descriptor. Default: ide.
4395 # @hwversion Hardware version. The meaningful options are "4" or "6".
4396 # Default: "4".
4397 # @zeroed-grain Whether to enable zeroed-grain feature for sparse subformats.
4398 # Default: false.
4399 #
4400 # Since: 4.0
4401 ##
4402 { 'struct': 'BlockdevCreateOptionsVmdk',
4403 'data': { 'file': 'BlockdevRef',
4404 'size': 'size',
4405 '*extents': ['BlockdevRef'],
4406 '*subformat': 'BlockdevVmdkSubformat',
4407 '*backing-file': 'str',
4408 '*adapter-type': 'BlockdevVmdkAdapterType',
4409 '*hwversion': 'str',
4410 '*zeroed-grain': 'bool' } }
4411
4412
4413 ##
4414 # @SheepdogRedundancyType:
4415 #
4416 # @full Create a fully replicated vdi with x copies
4417 # @erasure-coded Create an erasure coded vdi with x data strips and
4418 # y parity strips
4419 #
4420 # Since: 2.12
4421 ##
4422 { 'enum': 'SheepdogRedundancyType',
4423 'data': [ 'full', 'erasure-coded' ] }
4424
4425 ##
4426 # @SheepdogRedundancyFull:
4427 #
4428 # @copies Number of copies to use (between 1 and 31)
4429 #
4430 # Since: 2.12
4431 ##
4432 { 'struct': 'SheepdogRedundancyFull',
4433 'data': { 'copies': 'int' }}
4434
4435 ##
4436 # @SheepdogRedundancyErasureCoded:
4437 #
4438 # @data-strips Number of data strips to use (one of {2,4,8,16})
4439 # @parity-strips Number of parity strips to use (between 1 and 15)
4440 #
4441 # Since: 2.12
4442 ##
4443 { 'struct': 'SheepdogRedundancyErasureCoded',
4444 'data': { 'data-strips': 'int',
4445 'parity-strips': 'int' }}
4446
4447 ##
4448 # @SheepdogRedundancy:
4449 #
4450 # Since: 2.12
4451 ##
4452 { 'union': 'SheepdogRedundancy',
4453 'base': { 'type': 'SheepdogRedundancyType' },
4454 'discriminator': 'type',
4455 'data': { 'full': 'SheepdogRedundancyFull',
4456 'erasure-coded': 'SheepdogRedundancyErasureCoded' } }
4457
4458 ##
4459 # @BlockdevCreateOptionsSheepdog:
4460 #
4461 # Driver specific image creation options for Sheepdog.
4462 #
4463 # @location Where to store the new image file
4464 # @size Size of the virtual disk in bytes
4465 # @backing-file File name of a base image
4466 # @preallocation Preallocation mode for the new image (default: off;
4467 # allowed values: off, full)
4468 # @redundancy Redundancy of the image
4469 # @object-size Object size of the image
4470 #
4471 # Since: 2.12
4472 ##
4473 { 'struct': 'BlockdevCreateOptionsSheepdog',
4474 'data': { 'location': 'BlockdevOptionsSheepdog',
4475 'size': 'size',
4476 '*backing-file': 'str',
4477 '*preallocation': 'PreallocMode',
4478 '*redundancy': 'SheepdogRedundancy',
4479 '*object-size': 'size' } }
4480
4481 ##
4482 # @BlockdevCreateOptionsSsh:
4483 #
4484 # Driver specific image creation options for SSH.
4485 #
4486 # @location Where to store the new image file
4487 # @size Size of the virtual disk in bytes
4488 #
4489 # Since: 2.12
4490 ##
4491 { 'struct': 'BlockdevCreateOptionsSsh',
4492 'data': { 'location': 'BlockdevOptionsSsh',
4493 'size': 'size' } }
4494
4495 ##
4496 # @BlockdevCreateOptionsVdi:
4497 #
4498 # Driver specific image creation options for VDI.
4499 #
4500 # @file Node to create the image format on
4501 # @size Size of the virtual disk in bytes
4502 # @preallocation Preallocation mode for the new image (default: off;
4503 # allowed values: off, metadata)
4504 #
4505 # Since: 2.12
4506 ##
4507 { 'struct': 'BlockdevCreateOptionsVdi',
4508 'data': { 'file': 'BlockdevRef',
4509 'size': 'size',
4510 '*preallocation': 'PreallocMode' } }
4511
4512 ##
4513 # @BlockdevVhdxSubformat:
4514 #
4515 # @dynamic: Growing image file
4516 # @fixed: Preallocated fixed-size image file
4517 #
4518 # Since: 2.12
4519 ##
4520 { 'enum': 'BlockdevVhdxSubformat',
4521 'data': [ 'dynamic', 'fixed' ] }
4522
4523 ##
4524 # @BlockdevCreateOptionsVhdx:
4525 #
4526 # Driver specific image creation options for vhdx.
4527 #
4528 # @file Node to create the image format on
4529 # @size Size of the virtual disk in bytes
4530 # @log-size Log size in bytes, must be a multiple of 1 MB
4531 # (default: 1 MB)
4532 # @block-size Block size in bytes, must be a multiple of 1 MB and not
4533 # larger than 256 MB (default: automatically choose a block
4534 # size depending on the image size)
4535 # @subformat vhdx subformat (default: dynamic)
4536 # @block-state-zero Force use of payload blocks of type 'ZERO'. Non-standard,
4537 # but default. Do not set to 'off' when using 'qemu-img
4538 # convert' with subformat=dynamic.
4539 #
4540 # Since: 2.12
4541 ##
4542 { 'struct': 'BlockdevCreateOptionsVhdx',
4543 'data': { 'file': 'BlockdevRef',
4544 'size': 'size',
4545 '*log-size': 'size',
4546 '*block-size': 'size',
4547 '*subformat': 'BlockdevVhdxSubformat',
4548 '*block-state-zero': 'bool' } }
4549
4550 ##
4551 # @BlockdevVpcSubformat:
4552 #
4553 # @dynamic: Growing image file
4554 # @fixed: Preallocated fixed-size image file
4555 #
4556 # Since: 2.12
4557 ##
4558 { 'enum': 'BlockdevVpcSubformat',
4559 'data': [ 'dynamic', 'fixed' ] }
4560
4561 ##
4562 # @BlockdevCreateOptionsVpc:
4563 #
4564 # Driver specific image creation options for vpc (VHD).
4565 #
4566 # @file Node to create the image format on
4567 # @size Size of the virtual disk in bytes
4568 # @subformat vhdx subformat (default: dynamic)
4569 # @force-size Force use of the exact byte size instead of rounding to the
4570 # next size that can be represented in CHS geometry
4571 # (default: false)
4572 #
4573 # Since: 2.12
4574 ##
4575 { 'struct': 'BlockdevCreateOptionsVpc',
4576 'data': { 'file': 'BlockdevRef',
4577 'size': 'size',
4578 '*subformat': 'BlockdevVpcSubformat',
4579 '*force-size': 'bool' } }
4580
4581 ##
4582 # @BlockdevCreateOptions:
4583 #
4584 # Options for creating an image format on a given node.
4585 #
4586 # @driver block driver to create the image format
4587 #
4588 # Since: 2.12
4589 ##
4590 { 'union': 'BlockdevCreateOptions',
4591 'base': {
4592 'driver': 'BlockdevDriver' },
4593 'discriminator': 'driver',
4594 'data': {
4595 'file': 'BlockdevCreateOptionsFile',
4596 'gluster': 'BlockdevCreateOptionsGluster',
4597 'luks': 'BlockdevCreateOptionsLUKS',
4598 'nfs': 'BlockdevCreateOptionsNfs',
4599 'parallels': 'BlockdevCreateOptionsParallels',
4600 'qcow': 'BlockdevCreateOptionsQcow',
4601 'qcow2': 'BlockdevCreateOptionsQcow2',
4602 'qed': 'BlockdevCreateOptionsQed',
4603 'rbd': 'BlockdevCreateOptionsRbd',
4604 'sheepdog': 'BlockdevCreateOptionsSheepdog',
4605 'ssh': 'BlockdevCreateOptionsSsh',
4606 'vdi': 'BlockdevCreateOptionsVdi',
4607 'vhdx': 'BlockdevCreateOptionsVhdx',
4608 'vmdk': 'BlockdevCreateOptionsVmdk',
4609 'vpc': 'BlockdevCreateOptionsVpc'
4610 } }
4611
4612 ##
4613 # @blockdev-create:
4614 #
4615 # Starts a job to create an image format on a given node. The job is
4616 # automatically finalized, but a manual job-dismiss is required.
4617 #
4618 # @job-id: Identifier for the newly created job.
4619 #
4620 # @options: Options for the image creation.
4621 #
4622 # Since: 3.0
4623 ##
4624 { 'command': 'blockdev-create',
4625 'data': { 'job-id': 'str',
4626 'options': 'BlockdevCreateOptions' } }
4627
4628 ##
4629 # @blockdev-open-tray:
4630 #
4631 # Opens a block device's tray. If there is a block driver state tree inserted as
4632 # a medium, it will become inaccessible to the guest (but it will remain
4633 # associated to the block device, so closing the tray will make it accessible
4634 # again).
4635 #
4636 # If the tray was already open before, this will be a no-op.
4637 #
4638 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4639 # which no such event will be generated, these include:
4640 # - if the guest has locked the tray, @force is false and the guest does not
4641 # respond to the eject request
4642 # - if the BlockBackend denoted by @device does not have a guest device attached
4643 # to it
4644 # - if the guest device does not have an actual tray
4645 #
4646 # @device: Block device name (deprecated, use @id instead)
4647 #
4648 # @id: The name or QOM path of the guest device (since: 2.8)
4649 #
4650 # @force: if false (the default), an eject request will be sent to
4651 # the guest if it has locked the tray (and the tray will not be opened
4652 # immediately); if true, the tray will be opened regardless of whether
4653 # it is locked
4654 #
4655 # Since: 2.5
4656 #
4657 # Example:
4658 #
4659 # -> { "execute": "blockdev-open-tray",
4660 # "arguments": { "id": "ide0-1-0" } }
4661 #
4662 # <- { "timestamp": { "seconds": 1418751016,
4663 # "microseconds": 716996 },
4664 # "event": "DEVICE_TRAY_MOVED",
4665 # "data": { "device": "ide1-cd0",
4666 # "id": "ide0-1-0",
4667 # "tray-open": true } }
4668 #
4669 # <- { "return": {} }
4670 #
4671 ##
4672 { 'command': 'blockdev-open-tray',
4673 'data': { '*device': 'str',
4674 '*id': 'str',
4675 '*force': 'bool' } }
4676
4677 ##
4678 # @blockdev-close-tray:
4679 #
4680 # Closes a block device's tray. If there is a block driver state tree associated
4681 # with the block device (which is currently ejected), that tree will be loaded
4682 # as the medium.
4683 #
4684 # If the tray was already closed before, this will be a no-op.
4685 #
4686 # @device: Block device name (deprecated, use @id instead)
4687 #
4688 # @id: The name or QOM path of the guest device (since: 2.8)
4689 #
4690 # Since: 2.5
4691 #
4692 # Example:
4693 #
4694 # -> { "execute": "blockdev-close-tray",
4695 # "arguments": { "id": "ide0-1-0" } }
4696 #
4697 # <- { "timestamp": { "seconds": 1418751345,
4698 # "microseconds": 272147 },
4699 # "event": "DEVICE_TRAY_MOVED",
4700 # "data": { "device": "ide1-cd0",
4701 # "id": "ide0-1-0",
4702 # "tray-open": false } }
4703 #
4704 # <- { "return": {} }
4705 #
4706 ##
4707 { 'command': 'blockdev-close-tray',
4708 'data': { '*device': 'str',
4709 '*id': 'str' } }
4710
4711 ##
4712 # @blockdev-remove-medium:
4713 #
4714 # Removes a medium (a block driver state tree) from a block device. That block
4715 # device's tray must currently be open (unless there is no attached guest
4716 # device).
4717 #
4718 # If the tray is open and there is no medium inserted, this will be a no-op.
4719 #
4720 # @id: The name or QOM path of the guest device
4721 #
4722 # Since: 2.12
4723 #
4724 # Example:
4725 #
4726 # -> { "execute": "blockdev-remove-medium",
4727 # "arguments": { "id": "ide0-1-0" } }
4728 #
4729 # <- { "error": { "class": "GenericError",
4730 # "desc": "Tray of device 'ide0-1-0' is not open" } }
4731 #
4732 # -> { "execute": "blockdev-open-tray",
4733 # "arguments": { "id": "ide0-1-0" } }
4734 #
4735 # <- { "timestamp": { "seconds": 1418751627,
4736 # "microseconds": 549958 },
4737 # "event": "DEVICE_TRAY_MOVED",
4738 # "data": { "device": "ide1-cd0",
4739 # "id": "ide0-1-0",
4740 # "tray-open": true } }
4741 #
4742 # <- { "return": {} }
4743 #
4744 # -> { "execute": "blockdev-remove-medium",
4745 # "arguments": { "id": "ide0-1-0" } }
4746 #
4747 # <- { "return": {} }
4748 #
4749 ##
4750 { 'command': 'blockdev-remove-medium',
4751 'data': { 'id': 'str' } }
4752
4753 ##
4754 # @blockdev-insert-medium:
4755 #
4756 # Inserts a medium (a block driver state tree) into a block device. That block
4757 # device's tray must currently be open (unless there is no attached guest
4758 # device) and there must be no medium inserted already.
4759 #
4760 # @id: The name or QOM path of the guest device
4761 #
4762 # @node-name: name of a node in the block driver state graph
4763 #
4764 # Since: 2.12
4765 #
4766 # Example:
4767 #
4768 # -> { "execute": "blockdev-add",
4769 # "arguments": {
4770 # "node-name": "node0",
4771 # "driver": "raw",
4772 # "file": { "driver": "file",
4773 # "filename": "fedora.iso" } } }
4774 # <- { "return": {} }
4775 #
4776 # -> { "execute": "blockdev-insert-medium",
4777 # "arguments": { "id": "ide0-1-0",
4778 # "node-name": "node0" } }
4779 #
4780 # <- { "return": {} }
4781 #
4782 ##
4783 { 'command': 'blockdev-insert-medium',
4784 'data': { 'id': 'str',
4785 'node-name': 'str'} }
4786
4787
4788 ##
4789 # @BlockdevChangeReadOnlyMode:
4790 #
4791 # Specifies the new read-only mode of a block device subject to the
4792 # @blockdev-change-medium command.
4793 #
4794 # @retain: Retains the current read-only mode
4795 #
4796 # @read-only: Makes the device read-only
4797 #
4798 # @read-write: Makes the device writable
4799 #
4800 # Since: 2.3
4801 #
4802 ##
4803 { 'enum': 'BlockdevChangeReadOnlyMode',
4804 'data': ['retain', 'read-only', 'read-write'] }
4805
4806
4807 ##
4808 # @blockdev-change-medium:
4809 #
4810 # Changes the medium inserted into a block device by ejecting the current medium
4811 # and loading a new image file which is inserted as the new medium (this command
4812 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
4813 # and blockdev-close-tray).
4814 #
4815 # @device: Block device name (deprecated, use @id instead)
4816 #
4817 # @id: The name or QOM path of the guest device
4818 # (since: 2.8)
4819 #
4820 # @filename: filename of the new image to be loaded
4821 #
4822 # @format: format to open the new image with (defaults to
4823 # the probed format)
4824 #
4825 # @read-only-mode: change the read-only mode of the device; defaults
4826 # to 'retain'
4827 #
4828 # Since: 2.5
4829 #
4830 # Examples:
4831 #
4832 # 1. Change a removable medium
4833 #
4834 # -> { "execute": "blockdev-change-medium",
4835 # "arguments": { "id": "ide0-1-0",
4836 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4837 # "format": "raw" } }
4838 # <- { "return": {} }
4839 #
4840 # 2. Load a read-only medium into a writable drive
4841 #
4842 # -> { "execute": "blockdev-change-medium",
4843 # "arguments": { "id": "floppyA",
4844 # "filename": "/srv/images/ro.img",
4845 # "format": "raw",
4846 # "read-only-mode": "retain" } }
4847 #
4848 # <- { "error":
4849 # { "class": "GenericError",
4850 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4851 #
4852 # -> { "execute": "blockdev-change-medium",
4853 # "arguments": { "id": "floppyA",
4854 # "filename": "/srv/images/ro.img",
4855 # "format": "raw",
4856 # "read-only-mode": "read-only" } }
4857 #
4858 # <- { "return": {} }
4859 #
4860 ##
4861 { 'command': 'blockdev-change-medium',
4862 'data': { '*device': 'str',
4863 '*id': 'str',
4864 'filename': 'str',
4865 '*format': 'str',
4866 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
4867
4868
4869 ##
4870 # @BlockErrorAction:
4871 #
4872 # An enumeration of action that has been taken when a DISK I/O occurs
4873 #
4874 # @ignore: error has been ignored
4875 #
4876 # @report: error has been reported to the device
4877 #
4878 # @stop: error caused VM to be stopped
4879 #
4880 # Since: 2.1
4881 ##
4882 { 'enum': 'BlockErrorAction',
4883 'data': [ 'ignore', 'report', 'stop' ] }
4884
4885
4886 ##
4887 # @BLOCK_IMAGE_CORRUPTED:
4888 #
4889 # Emitted when a disk image is being marked corrupt. The image can be
4890 # identified by its device or node name. The 'device' field is always
4891 # present for compatibility reasons, but it can be empty ("") if the
4892 # image does not have a device name associated.
4893 #
4894 # @device: device name. This is always present for compatibility
4895 # reasons, but it can be empty ("") if the image does not
4896 # have a device name associated.
4897 #
4898 # @node-name: node name (Since: 2.4)
4899 #
4900 # @msg: informative message for human consumption, such as the kind of
4901 # corruption being detected. It should not be parsed by machine as it is
4902 # not guaranteed to be stable
4903 #
4904 # @offset: if the corruption resulted from an image access, this is
4905 # the host's access offset into the image
4906 #
4907 # @size: if the corruption resulted from an image access, this is
4908 # the access size
4909 #
4910 # @fatal: if set, the image is marked corrupt and therefore unusable after this
4911 # event and must be repaired (Since 2.2; before, every
4912 # BLOCK_IMAGE_CORRUPTED event was fatal)
4913 #
4914 # Note: If action is "stop", a STOP event will eventually follow the
4915 # BLOCK_IO_ERROR event.
4916 #
4917 # Example:
4918 #
4919 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
4920 # "data": { "device": "ide0-hd0", "node-name": "node0",
4921 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
4922 # "size": 65536 },
4923 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
4924 #
4925 # Since: 1.7
4926 ##
4927 { 'event': 'BLOCK_IMAGE_CORRUPTED',
4928 'data': { 'device' : 'str',
4929 '*node-name' : 'str',
4930 'msg' : 'str',
4931 '*offset' : 'int',
4932 '*size' : 'int',
4933 'fatal' : 'bool' } }
4934
4935 ##
4936 # @BLOCK_IO_ERROR:
4937 #
4938 # Emitted when a disk I/O error occurs
4939 #
4940 # @device: device name. This is always present for compatibility
4941 # reasons, but it can be empty ("") if the image does not
4942 # have a device name associated.
4943 #
4944 # @node-name: node name. Note that errors may be reported for the root node
4945 # that is directly attached to a guest device rather than for the
4946 # node where the error occurred. The node name is not present if
4947 # the drive is empty. (Since: 2.8)
4948 #
4949 # @operation: I/O operation
4950 #
4951 # @action: action that has been taken
4952 #
4953 # @nospace: true if I/O error was caused due to a no-space
4954 # condition. This key is only present if query-block's
4955 # io-status is present, please see query-block documentation
4956 # for more information (since: 2.2)
4957 #
4958 # @reason: human readable string describing the error cause.
4959 # (This field is a debugging aid for humans, it should not
4960 # be parsed by applications) (since: 2.2)
4961 #
4962 # Note: If action is "stop", a STOP event will eventually follow the
4963 # BLOCK_IO_ERROR event
4964 #
4965 # Since: 0.13.0
4966 #
4967 # Example:
4968 #
4969 # <- { "event": "BLOCK_IO_ERROR",
4970 # "data": { "device": "ide0-hd1",
4971 # "node-name": "#block212",
4972 # "operation": "write",
4973 # "action": "stop" },
4974 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
4975 #
4976 ##
4977 { 'event': 'BLOCK_IO_ERROR',
4978 'data': { 'device': 'str', '*node-name': 'str',
4979 'operation': 'IoOperationType',
4980 'action': 'BlockErrorAction', '*nospace': 'bool',
4981 'reason': 'str' } }
4982
4983 ##
4984 # @BLOCK_JOB_COMPLETED:
4985 #
4986 # Emitted when a block job has completed
4987 #
4988 # @type: job type
4989 #
4990 # @device: The job identifier. Originally the device name but other
4991 # values are allowed since QEMU 2.7
4992 #
4993 # @len: maximum progress value
4994 #
4995 # @offset: current progress value. On success this is equal to len.
4996 # On failure this is less than len
4997 #
4998 # @speed: rate limit, bytes per second
4999 #
5000 # @error: error message. Only present on failure. This field
5001 # contains a human-readable error message. There are no semantics
5002 # other than that streaming has failed and clients should not try to
5003 # interpret the error string
5004 #
5005 # Since: 1.1
5006 #
5007 # Example:
5008 #
5009 # <- { "event": "BLOCK_JOB_COMPLETED",
5010 # "data": { "type": "stream", "device": "virtio-disk0",
5011 # "len": 10737418240, "offset": 10737418240,
5012 # "speed": 0 },
5013 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5014 #
5015 ##
5016 { 'event': 'BLOCK_JOB_COMPLETED',
5017 'data': { 'type' : 'JobType',
5018 'device': 'str',
5019 'len' : 'int',
5020 'offset': 'int',
5021 'speed' : 'int',
5022 '*error': 'str' } }
5023
5024 ##
5025 # @BLOCK_JOB_CANCELLED:
5026 #
5027 # Emitted when a block job has been cancelled
5028 #
5029 # @type: job type
5030 #
5031 # @device: The job identifier. Originally the device name but other
5032 # values are allowed since QEMU 2.7
5033 #
5034 # @len: maximum progress value
5035 #
5036 # @offset: current progress value. On success this is equal to len.
5037 # On failure this is less than len
5038 #
5039 # @speed: rate limit, bytes per second
5040 #
5041 # Since: 1.1
5042 #
5043 # Example:
5044 #
5045 # <- { "event": "BLOCK_JOB_CANCELLED",
5046 # "data": { "type": "stream", "device": "virtio-disk0",
5047 # "len": 10737418240, "offset": 134217728,
5048 # "speed": 0 },
5049 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
5050 #
5051 ##
5052 { 'event': 'BLOCK_JOB_CANCELLED',
5053 'data': { 'type' : 'JobType',
5054 'device': 'str',
5055 'len' : 'int',
5056 'offset': 'int',
5057 'speed' : 'int' } }
5058
5059 ##
5060 # @BLOCK_JOB_ERROR:
5061 #
5062 # Emitted when a block job encounters an error
5063 #
5064 # @device: The job identifier. Originally the device name but other
5065 # values are allowed since QEMU 2.7
5066 #
5067 # @operation: I/O operation
5068 #
5069 # @action: action that has been taken
5070 #
5071 # Since: 1.3
5072 #
5073 # Example:
5074 #
5075 # <- { "event": "BLOCK_JOB_ERROR",
5076 # "data": { "device": "ide0-hd1",
5077 # "operation": "write",
5078 # "action": "stop" },
5079 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5080 #
5081 ##
5082 { 'event': 'BLOCK_JOB_ERROR',
5083 'data': { 'device' : 'str',
5084 'operation': 'IoOperationType',
5085 'action' : 'BlockErrorAction' } }
5086
5087 ##
5088 # @BLOCK_JOB_READY:
5089 #
5090 # Emitted when a block job is ready to complete
5091 #
5092 # @type: job type
5093 #
5094 # @device: The job identifier. Originally the device name but other
5095 # values are allowed since QEMU 2.7
5096 #
5097 # @len: maximum progress value
5098 #
5099 # @offset: current progress value. On success this is equal to len.
5100 # On failure this is less than len
5101 #
5102 # @speed: rate limit, bytes per second
5103 #
5104 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
5105 # event
5106 #
5107 # Since: 1.3
5108 #
5109 # Example:
5110 #
5111 # <- { "event": "BLOCK_JOB_READY",
5112 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
5113 # "len": 2097152, "offset": 2097152 }
5114 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5115 #
5116 ##
5117 { 'event': 'BLOCK_JOB_READY',
5118 'data': { 'type' : 'JobType',
5119 'device': 'str',
5120 'len' : 'int',
5121 'offset': 'int',
5122 'speed' : 'int' } }
5123
5124 ##
5125 # @BLOCK_JOB_PENDING:
5126 #
5127 # Emitted when a block job is awaiting explicit authorization to finalize graph
5128 # changes via @block-job-finalize. If this job is part of a transaction, it will
5129 # not emit this event until the transaction has converged first.
5130 #
5131 # @type: job type
5132 #
5133 # @id: The job identifier.
5134 #
5135 # Since: 2.12
5136 #
5137 # Example:
5138 #
5139 # <- { "event": "BLOCK_JOB_WAITING",
5140 # "data": { "device": "drive0", "type": "mirror" },
5141 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
5142 #
5143 ##
5144 { 'event': 'BLOCK_JOB_PENDING',
5145 'data': { 'type' : 'JobType',
5146 'id' : 'str' } }
5147
5148 ##
5149 # @PreallocMode:
5150 #
5151 # Preallocation mode of QEMU image file
5152 #
5153 # @off: no preallocation
5154 # @metadata: preallocate only for metadata
5155 # @falloc: like @full preallocation but allocate disk space by
5156 # posix_fallocate() rather than writing zeros.
5157 # @full: preallocate all data by writing zeros to device to ensure disk
5158 # space is really available. @full preallocation also sets up
5159 # metadata correctly.
5160 #
5161 # Since: 2.2
5162 ##
5163 { 'enum': 'PreallocMode',
5164 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
5165
5166 ##
5167 # @BLOCK_WRITE_THRESHOLD:
5168 #
5169 # Emitted when writes on block device reaches or exceeds the
5170 # configured write threshold. For thin-provisioned devices, this
5171 # means the device should be extended to avoid pausing for
5172 # disk exhaustion.
5173 # The event is one shot. Once triggered, it needs to be
5174 # re-registered with another block-set-write-threshold command.
5175 #
5176 # @node-name: graph node name on which the threshold was exceeded.
5177 #
5178 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
5179 #
5180 # @write-threshold: last configured threshold, in bytes.
5181 #
5182 # Since: 2.3
5183 ##
5184 { 'event': 'BLOCK_WRITE_THRESHOLD',
5185 'data': { 'node-name': 'str',
5186 'amount-exceeded': 'uint64',
5187 'write-threshold': 'uint64' } }
5188
5189 ##
5190 # @block-set-write-threshold:
5191 #
5192 # Change the write threshold for a block drive. An event will be
5193 # delivered if a write to this block drive crosses the configured
5194 # threshold. The threshold is an offset, thus must be
5195 # non-negative. Default is no write threshold. Setting the threshold
5196 # to zero disables it.
5197 #
5198 # This is useful to transparently resize thin-provisioned drives without
5199 # the guest OS noticing.
5200 #
5201 # @node-name: graph node name on which the threshold must be set.
5202 #
5203 # @write-threshold: configured threshold for the block device, bytes.
5204 # Use 0 to disable the threshold.
5205 #
5206 # Since: 2.3
5207 #
5208 # Example:
5209 #
5210 # -> { "execute": "block-set-write-threshold",
5211 # "arguments": { "node-name": "mydev",
5212 # "write-threshold": 17179869184 } }
5213 # <- { "return": {} }
5214 #
5215 ##
5216 { 'command': 'block-set-write-threshold',
5217 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
5218
5219 ##
5220 # @x-blockdev-change:
5221 #
5222 # Dynamically reconfigure the block driver state graph. It can be used
5223 # to add, remove, insert or replace a graph node. Currently only the
5224 # Quorum driver implements this feature to add or remove its child. This
5225 # is useful to fix a broken quorum child.
5226 #
5227 # If @node is specified, it will be inserted under @parent. @child
5228 # may not be specified in this case. If both @parent and @child are
5229 # specified but @node is not, @child will be detached from @parent.
5230 #
5231 # @parent: the id or name of the parent node.
5232 #
5233 # @child: the name of a child under the given parent node.
5234 #
5235 # @node: the name of the node that will be added.
5236 #
5237 # Note: this command is experimental, and its API is not stable. It
5238 # does not support all kinds of operations, all kinds of children, nor
5239 # all block drivers.
5240 #
5241 # FIXME Removing children from a quorum node means introducing gaps in the
5242 # child indices. This cannot be represented in the 'children' list of
5243 # BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename().
5244 #
5245 # Warning: The data in a new quorum child MUST be consistent with that of
5246 # the rest of the array.
5247 #
5248 # Since: 2.7
5249 #
5250 # Example:
5251 #
5252 # 1. Add a new node to a quorum
5253 # -> { "execute": "blockdev-add",
5254 # "arguments": {
5255 # "driver": "raw",
5256 # "node-name": "new_node",
5257 # "file": { "driver": "file",
5258 # "filename": "test.raw" } } }
5259 # <- { "return": {} }
5260 # -> { "execute": "x-blockdev-change",
5261 # "arguments": { "parent": "disk1",
5262 # "node": "new_node" } }
5263 # <- { "return": {} }
5264 #
5265 # 2. Delete a quorum's node
5266 # -> { "execute": "x-blockdev-change",
5267 # "arguments": { "parent": "disk1",
5268 # "child": "children.1" } }
5269 # <- { "return": {} }
5270 #
5271 ##
5272 { 'command': 'x-blockdev-change',
5273 'data' : { 'parent': 'str',
5274 '*child': 'str',
5275 '*node': 'str' } }
5276
5277 ##
5278 # @x-blockdev-set-iothread:
5279 #
5280 # Move @node and its children into the @iothread. If @iothread is null then
5281 # move @node and its children into the main loop.
5282 #
5283 # The node must not be attached to a BlockBackend.
5284 #
5285 # @node-name: the name of the block driver node
5286 #
5287 # @iothread: the name of the IOThread object or null for the main loop
5288 #
5289 # @force: true if the node and its children should be moved when a BlockBackend
5290 # is already attached
5291 #
5292 # Note: this command is experimental and intended for test cases that need
5293 # control over IOThreads only.
5294 #
5295 # Since: 2.12
5296 #
5297 # Example:
5298 #
5299 # 1. Move a node into an IOThread
5300 # -> { "execute": "x-blockdev-set-iothread",
5301 # "arguments": { "node-name": "disk1",
5302 # "iothread": "iothread0" } }
5303 # <- { "return": {} }
5304 #
5305 # 2. Move a node into the main loop
5306 # -> { "execute": "x-blockdev-set-iothread",
5307 # "arguments": { "node-name": "disk1",
5308 # "iothread": null } }
5309 # <- { "return": {} }
5310 #
5311 ##
5312 { 'command': 'x-blockdev-set-iothread',
5313 'data' : { 'node-name': 'str',
5314 'iothread': 'StrOrNull',
5315 '*force': 'bool' } }