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