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