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