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