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