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