]> git.proxmox.com Git - mirror_qemu.git/blob - qapi/block-core.json
block: Skip implicit nodes in query-block/blockstats
[mirror_qemu.git] / qapi / block-core.json
1 # -*- Mode: Python -*-
2
3 ##
4 # == QAPI block core definitions (vm unrelated)
5 ##
6
7 # QAPI common definitions
8 { 'include': 'common.json' }
9
10 ##
11 # @SnapshotInfo:
12 #
13 # @id: unique snapshot id
14 #
15 # @name: user chosen name
16 #
17 # @vm-state-size: size of the VM state
18 #
19 # @date-sec: UTC date of the snapshot in seconds
20 #
21 # @date-nsec: fractional part in nano seconds to be used with date-sec
22 #
23 # @vm-clock-sec: VM clock relative to boot in seconds
24 #
25 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
26 #
27 # Since: 1.3
28 #
29 ##
30 { 'struct': 'SnapshotInfo',
31 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
32 'date-sec': 'int', 'date-nsec': 'int',
33 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
34
35 ##
36 # @ImageInfoSpecificQCow2EncryptionBase:
37 #
38 # @format: The encryption format
39 #
40 # Since: 2.10
41 ##
42 { 'struct': 'ImageInfoSpecificQCow2EncryptionBase',
43 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}}
44
45 ##
46 # @ImageInfoSpecificQCow2Encryption:
47 #
48 # Since: 2.10
49 ##
50 { 'union': 'ImageInfoSpecificQCow2Encryption',
51 'base': 'ImageInfoSpecificQCow2EncryptionBase',
52 'discriminator': 'format',
53 'data': { 'aes': 'QCryptoBlockInfoQCow',
54 'luks': 'QCryptoBlockInfoLUKS' } }
55
56 ##
57 # @ImageInfoSpecificQCow2:
58 #
59 # @compat: compatibility level
60 #
61 # @lazy-refcounts: on or off; only valid for compat >= 1.1
62 #
63 # @corrupt: true if the image has been marked corrupt; only valid for
64 # compat >= 1.1 (since 2.2)
65 #
66 # @refcount-bits: width of a refcount entry in bits (since 2.3)
67 #
68 # @encrypt: details about encryption parameters; only set if image
69 # is encrypted (since 2.10)
70 #
71 # Since: 1.7
72 ##
73 { 'struct': 'ImageInfoSpecificQCow2',
74 'data': {
75 'compat': 'str',
76 '*lazy-refcounts': 'bool',
77 '*corrupt': 'bool',
78 'refcount-bits': 'int',
79 '*encrypt': 'ImageInfoSpecificQCow2Encryption'
80 } }
81
82 ##
83 # @ImageInfoSpecificVmdk:
84 #
85 # @create-type: The create type of VMDK image
86 #
87 # @cid: Content id of image
88 #
89 # @parent-cid: Parent VMDK image's cid
90 #
91 # @extents: List of extent files
92 #
93 # Since: 1.7
94 ##
95 { 'struct': 'ImageInfoSpecificVmdk',
96 'data': {
97 'create-type': 'str',
98 'cid': 'int',
99 'parent-cid': 'int',
100 'extents': ['ImageInfo']
101 } }
102
103 ##
104 # @ImageInfoSpecific:
105 #
106 # A discriminated record of image format specific information structures.
107 #
108 # Since: 1.7
109 ##
110 { 'union': 'ImageInfoSpecific',
111 'data': {
112 'qcow2': 'ImageInfoSpecificQCow2',
113 'vmdk': 'ImageInfoSpecificVmdk',
114 # If we need to add block driver specific parameters for
115 # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS
116 # to define a ImageInfoSpecificLUKS
117 'luks': 'QCryptoBlockInfoLUKS'
118 } }
119
120 ##
121 # @ImageInfo:
122 #
123 # Information about a QEMU image file
124 #
125 # @filename: name of the image file
126 #
127 # @format: format of the image file
128 #
129 # @virtual-size: maximum capacity in bytes of the image
130 #
131 # @actual-size: actual size on disk in bytes of the image
132 #
133 # @dirty-flag: true if image is not cleanly closed
134 #
135 # @cluster-size: size of a cluster in bytes
136 #
137 # @encrypted: true if the image is encrypted
138 #
139 # @compressed: true if the image is compressed (Since 1.7)
140 #
141 # @backing-filename: name of the backing file
142 #
143 # @full-backing-filename: full path of the backing file
144 #
145 # @backing-filename-format: the format of the backing file
146 #
147 # @snapshots: list of VM snapshots
148 #
149 # @backing-image: info of the backing image (since 1.6)
150 #
151 # @format-specific: structure supplying additional format-specific
152 # information (since 1.7)
153 #
154 # Since: 1.3
155 #
156 ##
157 { 'struct': 'ImageInfo',
158 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
159 '*actual-size': 'int', 'virtual-size': 'int',
160 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
161 '*backing-filename': 'str', '*full-backing-filename': 'str',
162 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
163 '*backing-image': 'ImageInfo',
164 '*format-specific': 'ImageInfoSpecific' } }
165
166 ##
167 # @ImageCheck:
168 #
169 # Information about a QEMU image file check
170 #
171 # @filename: name of the image file checked
172 #
173 # @format: format of the image file checked
174 #
175 # @check-errors: number of unexpected errors occurred during check
176 #
177 # @image-end-offset: offset (in bytes) where the image ends, this
178 # field is present if the driver for the image format
179 # supports it
180 #
181 # @corruptions: number of corruptions found during the check if any
182 #
183 # @leaks: number of leaks found during the check if any
184 #
185 # @corruptions-fixed: number of corruptions fixed during the check
186 # if any
187 #
188 # @leaks-fixed: number of leaks fixed during the check if any
189 #
190 # @total-clusters: total number of clusters, this field is present
191 # if the driver for the image format supports it
192 #
193 # @allocated-clusters: total number of allocated clusters, this
194 # field is present if the driver for the image format
195 # supports it
196 #
197 # @fragmented-clusters: total number of fragmented clusters, this
198 # field is present if the driver for the image format
199 # supports it
200 #
201 # @compressed-clusters: total number of compressed clusters, this
202 # field is present if the driver for the image format
203 # supports it
204 #
205 # Since: 1.4
206 #
207 ##
208 { 'struct': 'ImageCheck',
209 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
210 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
211 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
212 '*total-clusters': 'int', '*allocated-clusters': 'int',
213 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
214
215 ##
216 # @MapEntry:
217 #
218 # Mapping information from a virtual block range to a host file range
219 #
220 # @start: the start byte of the mapped virtual range
221 #
222 # @length: the number of bytes of the mapped virtual range
223 #
224 # @data: whether the mapped range has data
225 #
226 # @zero: whether the virtual blocks are zeroed
227 #
228 # @depth: the depth of the mapping
229 #
230 # @offset: the offset in file that the virtual sectors are mapped to
231 #
232 # @filename: filename that is referred to by @offset
233 #
234 # Since: 2.6
235 #
236 ##
237 { 'struct': 'MapEntry',
238 'data': {'start': 'int', 'length': 'int', 'data': 'bool',
239 'zero': 'bool', 'depth': 'int', '*offset': 'int',
240 '*filename': 'str' } }
241
242 ##
243 # @BlockdevCacheInfo:
244 #
245 # Cache mode information for a block device
246 #
247 # @writeback: true if writeback mode is enabled
248 # @direct: true if the host page cache is bypassed (O_DIRECT)
249 # @no-flush: true if flush requests are ignored for the device
250 #
251 # Since: 2.3
252 ##
253 { 'struct': 'BlockdevCacheInfo',
254 'data': { 'writeback': 'bool',
255 'direct': 'bool',
256 'no-flush': 'bool' } }
257
258 ##
259 # @BlockDeviceInfo:
260 #
261 # Information about the backing device for a block device.
262 #
263 # @file: the filename of the backing device
264 #
265 # @node-name: the name of the block driver node (Since 2.0)
266 #
267 # @ro: true if the backing device was open read-only
268 #
269 # @drv: the name of the block format used to open the backing device. As of
270 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
271 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
272 # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
273 # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
274 # 2.2: 'archipelago' added, 'cow' dropped
275 # 2.3: 'host_floppy' deprecated
276 # 2.5: 'host_floppy' dropped
277 # 2.6: 'luks' added
278 # 2.8: 'replication' added, 'tftp' dropped
279 # 2.9: 'archipelago' dropped
280 #
281 # @backing_file: the name of the backing file (for copy-on-write)
282 #
283 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
284 #
285 # @encrypted: true if the backing device is encrypted
286 #
287 # @encryption_key_missing: Deprecated; always false
288 #
289 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
290 #
291 # @bps: total throughput limit in bytes per second is specified
292 #
293 # @bps_rd: read throughput limit in bytes per second is specified
294 #
295 # @bps_wr: write throughput limit in bytes per second is specified
296 #
297 # @iops: total I/O operations per second is specified
298 #
299 # @iops_rd: read I/O operations per second is specified
300 #
301 # @iops_wr: write I/O operations per second is specified
302 #
303 # @image: the info of image used (since: 1.6)
304 #
305 # @bps_max: total throughput limit during bursts,
306 # in bytes (Since 1.7)
307 #
308 # @bps_rd_max: read throughput limit during bursts,
309 # in bytes (Since 1.7)
310 #
311 # @bps_wr_max: write throughput limit during bursts,
312 # in bytes (Since 1.7)
313 #
314 # @iops_max: total I/O operations per second during bursts,
315 # in bytes (Since 1.7)
316 #
317 # @iops_rd_max: read I/O operations per second during bursts,
318 # in bytes (Since 1.7)
319 #
320 # @iops_wr_max: write I/O operations per second during bursts,
321 # in bytes (Since 1.7)
322 #
323 # @bps_max_length: maximum length of the @bps_max burst
324 # period, in seconds. (Since 2.6)
325 #
326 # @bps_rd_max_length: maximum length of the @bps_rd_max
327 # burst period, in seconds. (Since 2.6)
328 #
329 # @bps_wr_max_length: maximum length of the @bps_wr_max
330 # burst period, in seconds. (Since 2.6)
331 #
332 # @iops_max_length: maximum length of the @iops burst
333 # period, in seconds. (Since 2.6)
334 #
335 # @iops_rd_max_length: maximum length of the @iops_rd_max
336 # burst period, in seconds. (Since 2.6)
337 #
338 # @iops_wr_max_length: maximum length of the @iops_wr_max
339 # burst period, in seconds. (Since 2.6)
340 #
341 # @iops_size: an I/O size in bytes (Since 1.7)
342 #
343 # @group: throttle group name (Since 2.4)
344 #
345 # @cache: the cache mode used for the block device (since: 2.3)
346 #
347 # @write_threshold: configured write threshold for the device.
348 # 0 if disabled. (Since 2.3)
349 #
350 # Since: 0.14.0
351 #
352 ##
353 { 'struct': 'BlockDeviceInfo',
354 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
355 '*backing_file': 'str', 'backing_file_depth': 'int',
356 'encrypted': 'bool', 'encryption_key_missing': 'bool',
357 'detect_zeroes': 'BlockdevDetectZeroesOptions',
358 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
359 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
360 'image': 'ImageInfo',
361 '*bps_max': 'int', '*bps_rd_max': 'int',
362 '*bps_wr_max': 'int', '*iops_max': 'int',
363 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
364 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
365 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
366 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
367 '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo',
368 'write_threshold': 'int' } }
369
370 ##
371 # @BlockDeviceIoStatus:
372 #
373 # An enumeration of block device I/O status.
374 #
375 # @ok: The last I/O operation has succeeded
376 #
377 # @failed: The last I/O operation has failed
378 #
379 # @nospace: The last I/O operation has failed due to a no-space condition
380 #
381 # Since: 1.0
382 ##
383 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
384
385 ##
386 # @BlockDeviceMapEntry:
387 #
388 # Entry in the metadata map of the device (returned by "qemu-img map")
389 #
390 # @start: Offset in the image of the first byte described by this entry
391 # (in bytes)
392 #
393 # @length: Length of the range described by this entry (in bytes)
394 #
395 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
396 # before reaching one for which the range is allocated. The value is
397 # in the range 0 to the depth of the image chain - 1.
398 #
399 # @zero: the sectors in this range read as zeros
400 #
401 # @data: reading the image will actually read data from a file (in particular,
402 # if @offset is present this means that the sectors are not simply
403 # preallocated, but contain actual data in raw format)
404 #
405 # @offset: if present, the image file stores the data for this range in
406 # raw format at the given offset.
407 #
408 # Since: 1.7
409 ##
410 { 'struct': 'BlockDeviceMapEntry',
411 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
412 'data': 'bool', '*offset': 'int' } }
413
414 ##
415 # @DirtyBitmapStatus:
416 #
417 # An enumeration of possible states that a dirty bitmap can report to the user.
418 #
419 # @frozen: The bitmap is currently in-use by a backup operation or block job,
420 # and is immutable.
421 #
422 # @disabled: The bitmap is currently in-use by an internal operation and is
423 # read-only. It can still be deleted.
424 #
425 # @active: The bitmap is actively monitoring for new writes, and can be cleared,
426 # deleted, or used for backup operations.
427 #
428 # Since: 2.4
429 ##
430 { 'enum': 'DirtyBitmapStatus',
431 'data': ['active', 'disabled', 'frozen'] }
432
433 ##
434 # @BlockDirtyInfo:
435 #
436 # Block dirty bitmap information.
437 #
438 # @name: the name of the dirty bitmap (Since 2.4)
439 #
440 # @count: number of dirty bytes according to the dirty bitmap
441 #
442 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
443 #
444 # @status: current status of the dirty bitmap (since 2.4)
445 #
446 # Since: 1.3
447 ##
448 { 'struct': 'BlockDirtyInfo',
449 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32',
450 'status': 'DirtyBitmapStatus'} }
451
452 ##
453 # @BlockInfo:
454 #
455 # Block device information. This structure describes a virtual device and
456 # the backing device associated with it.
457 #
458 # @device: The device name associated with the virtual device.
459 #
460 # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block
461 # device. (since 2.10)
462 #
463 # @type: This field is returned only for compatibility reasons, it should
464 # not be used (always returns 'unknown')
465 #
466 # @removable: True if the device supports removable media.
467 #
468 # @locked: True if the guest has locked this device from having its media
469 # removed
470 #
471 # @tray_open: True if the device's tray is open
472 # (only present if it has a tray)
473 #
474 # @dirty-bitmaps: dirty bitmaps information (only present if the
475 # driver has one or more dirty bitmaps) (Since 2.0)
476 #
477 # @io-status: @BlockDeviceIoStatus. Only present if the device
478 # supports it and the VM is configured to stop on errors
479 # (supported device models: virtio-blk, IDE, SCSI except
480 # scsi-generic)
481 #
482 # @inserted: @BlockDeviceInfo describing the device if media is
483 # present
484 #
485 # Since: 0.14.0
486 ##
487 { 'struct': 'BlockInfo',
488 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool',
489 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
490 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
491 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
492
493 ##
494 # @BlockMeasureInfo:
495 #
496 # Image file size calculation information. This structure describes the size
497 # requirements for creating a new image file.
498 #
499 # The size requirements depend on the new image file format. File size always
500 # equals virtual disk size for the 'raw' format, even for sparse POSIX files.
501 # Compact formats such as 'qcow2' represent unallocated and zero regions
502 # efficiently so file size may be smaller than virtual disk size.
503 #
504 # The values are upper bounds that are guaranteed to fit the new image file.
505 # Subsequent modification, such as internal snapshot or bitmap creation, may
506 # require additional space and is not covered here.
507 #
508 # @required: Size required for a new image file, in bytes.
509 #
510 # @fully-allocated: Image file size, in bytes, once data has been written
511 # to all sectors.
512 #
513 # Since: 2.10
514 ##
515 { 'struct': 'BlockMeasureInfo',
516 'data': {'required': 'int', 'fully-allocated': 'int'} }
517
518 ##
519 # @query-block:
520 #
521 # Get a list of BlockInfo for all virtual block devices.
522 #
523 # Returns: a list of @BlockInfo describing each virtual block device. Filter
524 # nodes that were created implicitly are skipped over.
525 #
526 # Since: 0.14.0
527 #
528 # Example:
529 #
530 # -> { "execute": "query-block" }
531 # <- {
532 # "return":[
533 # {
534 # "io-status": "ok",
535 # "device":"ide0-hd0",
536 # "locked":false,
537 # "removable":false,
538 # "inserted":{
539 # "ro":false,
540 # "drv":"qcow2",
541 # "encrypted":false,
542 # "file":"disks/test.qcow2",
543 # "backing_file_depth":1,
544 # "bps":1000000,
545 # "bps_rd":0,
546 # "bps_wr":0,
547 # "iops":1000000,
548 # "iops_rd":0,
549 # "iops_wr":0,
550 # "bps_max": 8000000,
551 # "bps_rd_max": 0,
552 # "bps_wr_max": 0,
553 # "iops_max": 0,
554 # "iops_rd_max": 0,
555 # "iops_wr_max": 0,
556 # "iops_size": 0,
557 # "detect_zeroes": "on",
558 # "write_threshold": 0,
559 # "image":{
560 # "filename":"disks/test.qcow2",
561 # "format":"qcow2",
562 # "virtual-size":2048000,
563 # "backing_file":"base.qcow2",
564 # "full-backing-filename":"disks/base.qcow2",
565 # "backing-filename-format":"qcow2",
566 # "snapshots":[
567 # {
568 # "id": "1",
569 # "name": "snapshot1",
570 # "vm-state-size": 0,
571 # "date-sec": 10000200,
572 # "date-nsec": 12,
573 # "vm-clock-sec": 206,
574 # "vm-clock-nsec": 30
575 # }
576 # ],
577 # "backing-image":{
578 # "filename":"disks/base.qcow2",
579 # "format":"qcow2",
580 # "virtual-size":2048000
581 # }
582 # }
583 # },
584 # "qdev": "ide_disk",
585 # "type":"unknown"
586 # },
587 # {
588 # "io-status": "ok",
589 # "device":"ide1-cd0",
590 # "locked":false,
591 # "removable":true,
592 # "qdev": "/machine/unattached/device[23]",
593 # "tray_open": false,
594 # "type":"unknown"
595 # },
596 # {
597 # "device":"floppy0",
598 # "locked":false,
599 # "removable":true,
600 # "qdev": "/machine/unattached/device[20]",
601 # "type":"unknown"
602 # },
603 # {
604 # "device":"sd0",
605 # "locked":false,
606 # "removable":true,
607 # "type":"unknown"
608 # }
609 # ]
610 # }
611 #
612 ##
613 { 'command': 'query-block', 'returns': ['BlockInfo'] }
614
615
616 ##
617 # @BlockDeviceTimedStats:
618 #
619 # Statistics of a block device during a given interval of time.
620 #
621 # @interval_length: Interval used for calculating the statistics,
622 # in seconds.
623 #
624 # @min_rd_latency_ns: Minimum latency of read operations in the
625 # defined interval, in nanoseconds.
626 #
627 # @min_wr_latency_ns: Minimum latency of write operations in the
628 # defined interval, in nanoseconds.
629 #
630 # @min_flush_latency_ns: Minimum latency of flush operations in the
631 # defined interval, in nanoseconds.
632 #
633 # @max_rd_latency_ns: Maximum latency of read operations in the
634 # defined interval, in nanoseconds.
635 #
636 # @max_wr_latency_ns: Maximum latency of write operations in the
637 # defined interval, in nanoseconds.
638 #
639 # @max_flush_latency_ns: Maximum latency of flush operations in the
640 # defined interval, in nanoseconds.
641 #
642 # @avg_rd_latency_ns: Average latency of read operations in the
643 # defined interval, in nanoseconds.
644 #
645 # @avg_wr_latency_ns: Average latency of write operations in the
646 # defined interval, in nanoseconds.
647 #
648 # @avg_flush_latency_ns: Average latency of flush operations in the
649 # defined interval, in nanoseconds.
650 #
651 # @avg_rd_queue_depth: Average number of pending read operations
652 # in the defined interval.
653 #
654 # @avg_wr_queue_depth: Average number of pending write operations
655 # in the defined interval.
656 #
657 # Since: 2.5
658 ##
659 { 'struct': 'BlockDeviceTimedStats',
660 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int',
661 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int',
662 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int',
663 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int',
664 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int',
665 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } }
666
667 ##
668 # @BlockDeviceStats:
669 #
670 # Statistics of a virtual block device or a block backing device.
671 #
672 # @rd_bytes: The number of bytes read by the device.
673 #
674 # @wr_bytes: The number of bytes written by the device.
675 #
676 # @rd_operations: The number of read operations performed by the device.
677 #
678 # @wr_operations: The number of write operations performed by the device.
679 #
680 # @flush_operations: The number of cache flush operations performed by the
681 # device (since 0.15.0)
682 #
683 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
684 # (since 0.15.0).
685 #
686 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
687 #
688 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
689 #
690 # @wr_highest_offset: The offset after the greatest byte written to the
691 # device. The intended use of this information is for
692 # growable sparse files (like qcow2) that are used on top
693 # of a physical device.
694 #
695 # @rd_merged: Number of read requests that have been merged into another
696 # request (Since 2.3).
697 #
698 # @wr_merged: Number of write requests that have been merged into another
699 # request (Since 2.3).
700 #
701 # @idle_time_ns: Time since the last I/O operation, in
702 # nanoseconds. If the field is absent it means that
703 # there haven't been any operations yet (Since 2.5).
704 #
705 # @failed_rd_operations: The number of failed read operations
706 # performed by the device (Since 2.5)
707 #
708 # @failed_wr_operations: The number of failed write operations
709 # performed by the device (Since 2.5)
710 #
711 # @failed_flush_operations: The number of failed flush operations
712 # performed by the device (Since 2.5)
713 #
714 # @invalid_rd_operations: The number of invalid read operations
715 # performed by the device (Since 2.5)
716 #
717 # @invalid_wr_operations: The number of invalid write operations
718 # performed by the device (Since 2.5)
719 #
720 # @invalid_flush_operations: The number of invalid flush operations
721 # performed by the device (Since 2.5)
722 #
723 # @account_invalid: Whether invalid operations are included in the
724 # last access statistics (Since 2.5)
725 #
726 # @account_failed: Whether failed operations are included in the
727 # latency and last access statistics (Since 2.5)
728 #
729 # @timed_stats: Statistics specific to the set of previously defined
730 # intervals of time (Since 2.5)
731 #
732 # Since: 0.14.0
733 ##
734 { 'struct': 'BlockDeviceStats',
735 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
736 'wr_operations': 'int', 'flush_operations': 'int',
737 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
738 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
739 'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int',
740 'failed_rd_operations': 'int', 'failed_wr_operations': 'int',
741 'failed_flush_operations': 'int', 'invalid_rd_operations': 'int',
742 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int',
743 'account_invalid': 'bool', 'account_failed': 'bool',
744 'timed_stats': ['BlockDeviceTimedStats'] } }
745
746 ##
747 # @BlockStats:
748 #
749 # Statistics of a virtual block device or a block backing device.
750 #
751 # @device: If the stats are for a virtual block device, the name
752 # corresponding to the virtual block device.
753 #
754 # @node-name: The node name of the device. (Since 2.3)
755 #
756 # @stats: A @BlockDeviceStats for the device.
757 #
758 # @parent: This describes the file block device if it has one.
759 # Contains recursively the statistics of the underlying
760 # protocol (e.g. the host file for a qcow2 image). If there is
761 # no underlying protocol, this field is omitted
762 #
763 # @backing: This describes the backing block device if it has one.
764 # (Since 2.0)
765 #
766 # Since: 0.14.0
767 ##
768 { 'struct': 'BlockStats',
769 'data': {'*device': 'str', '*node-name': 'str',
770 'stats': 'BlockDeviceStats',
771 '*parent': 'BlockStats',
772 '*backing': 'BlockStats'} }
773
774 ##
775 # @query-blockstats:
776 #
777 # Query the @BlockStats for all virtual block devices.
778 #
779 # @query-nodes: If true, the command will query all the block nodes
780 # that have a node name, in a list which will include "parent"
781 # information, but not "backing".
782 # If false or omitted, the behavior is as before - query all the
783 # device backends, recursively including their "parent" and
784 # "backing". Filter nodes that were created implicitly are
785 # skipped over in this mode. (Since 2.3)
786 #
787 # Returns: A list of @BlockStats for each virtual block devices.
788 #
789 # Since: 0.14.0
790 #
791 # Example:
792 #
793 # -> { "execute": "query-blockstats" }
794 # <- {
795 # "return":[
796 # {
797 # "device":"ide0-hd0",
798 # "parent":{
799 # "stats":{
800 # "wr_highest_offset":3686448128,
801 # "wr_bytes":9786368,
802 # "wr_operations":751,
803 # "rd_bytes":122567168,
804 # "rd_operations":36772
805 # "wr_total_times_ns":313253456
806 # "rd_total_times_ns":3465673657
807 # "flush_total_times_ns":49653
808 # "flush_operations":61,
809 # "rd_merged":0,
810 # "wr_merged":0,
811 # "idle_time_ns":2953431879,
812 # "account_invalid":true,
813 # "account_failed":false
814 # }
815 # },
816 # "stats":{
817 # "wr_highest_offset":2821110784,
818 # "wr_bytes":9786368,
819 # "wr_operations":692,
820 # "rd_bytes":122739200,
821 # "rd_operations":36604
822 # "flush_operations":51,
823 # "wr_total_times_ns":313253456
824 # "rd_total_times_ns":3465673657
825 # "flush_total_times_ns":49653,
826 # "rd_merged":0,
827 # "wr_merged":0,
828 # "idle_time_ns":2953431879,
829 # "account_invalid":true,
830 # "account_failed":false
831 # }
832 # },
833 # {
834 # "device":"ide1-cd0",
835 # "stats":{
836 # "wr_highest_offset":0,
837 # "wr_bytes":0,
838 # "wr_operations":0,
839 # "rd_bytes":0,
840 # "rd_operations":0
841 # "flush_operations":0,
842 # "wr_total_times_ns":0
843 # "rd_total_times_ns":0
844 # "flush_total_times_ns":0,
845 # "rd_merged":0,
846 # "wr_merged":0,
847 # "account_invalid":false,
848 # "account_failed":false
849 # }
850 # },
851 # {
852 # "device":"floppy0",
853 # "stats":{
854 # "wr_highest_offset":0,
855 # "wr_bytes":0,
856 # "wr_operations":0,
857 # "rd_bytes":0,
858 # "rd_operations":0
859 # "flush_operations":0,
860 # "wr_total_times_ns":0
861 # "rd_total_times_ns":0
862 # "flush_total_times_ns":0,
863 # "rd_merged":0,
864 # "wr_merged":0,
865 # "account_invalid":false,
866 # "account_failed":false
867 # }
868 # },
869 # {
870 # "device":"sd0",
871 # "stats":{
872 # "wr_highest_offset":0,
873 # "wr_bytes":0,
874 # "wr_operations":0,
875 # "rd_bytes":0,
876 # "rd_operations":0
877 # "flush_operations":0,
878 # "wr_total_times_ns":0
879 # "rd_total_times_ns":0
880 # "flush_total_times_ns":0,
881 # "rd_merged":0,
882 # "wr_merged":0,
883 # "account_invalid":false,
884 # "account_failed":false
885 # }
886 # }
887 # ]
888 # }
889 #
890 ##
891 { 'command': 'query-blockstats',
892 'data': { '*query-nodes': 'bool' },
893 'returns': ['BlockStats'] }
894
895 ##
896 # @BlockdevOnError:
897 #
898 # An enumeration of possible behaviors for errors on I/O operations.
899 # The exact meaning depends on whether the I/O was initiated by a guest
900 # or by a block job
901 #
902 # @report: for guest operations, report the error to the guest;
903 # for jobs, cancel the job
904 #
905 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
906 # or BLOCK_JOB_ERROR)
907 #
908 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
909 #
910 # @stop: for guest operations, stop the virtual machine;
911 # for jobs, pause the job
912 #
913 # @auto: inherit the error handling policy of the backend (since: 2.7)
914 #
915 # Since: 1.3
916 ##
917 { 'enum': 'BlockdevOnError',
918 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] }
919
920 ##
921 # @MirrorSyncMode:
922 #
923 # An enumeration of possible behaviors for the initial synchronization
924 # phase of storage mirroring.
925 #
926 # @top: copies data in the topmost image to the destination
927 #
928 # @full: copies data from all images to the destination
929 #
930 # @none: only copy data written from now on
931 #
932 # @incremental: only copy data described by the dirty bitmap. Since: 2.4
933 #
934 # Since: 1.3
935 ##
936 { 'enum': 'MirrorSyncMode',
937 'data': ['top', 'full', 'none', 'incremental'] }
938
939 ##
940 # @BlockJobType:
941 #
942 # Type of a block job.
943 #
944 # @commit: block commit job type, see "block-commit"
945 #
946 # @stream: block stream job type, see "block-stream"
947 #
948 # @mirror: drive mirror job type, see "drive-mirror"
949 #
950 # @backup: drive backup job type, see "drive-backup"
951 #
952 # Since: 1.7
953 ##
954 { 'enum': 'BlockJobType',
955 'data': ['commit', 'stream', 'mirror', 'backup'] }
956
957 ##
958 # @BlockJobInfo:
959 #
960 # Information about a long-running block device operation.
961 #
962 # @type: the job type ('stream' for image streaming)
963 #
964 # @device: The job identifier. Originally the device name but other
965 # values are allowed since QEMU 2.7
966 #
967 # @len: the maximum progress value
968 #
969 # @busy: false if the job is known to be in a quiescent state, with
970 # no pending I/O. Since 1.3.
971 #
972 # @paused: whether the job is paused or, if @busy is true, will
973 # pause itself as soon as possible. Since 1.3.
974 #
975 # @offset: the current progress value
976 #
977 # @speed: the rate limit, bytes per second
978 #
979 # @io-status: the status of the job (since 1.3)
980 #
981 # @ready: true if the job may be completed (since 2.2)
982 #
983 # Since: 1.1
984 ##
985 { 'struct': 'BlockJobInfo',
986 'data': {'type': 'str', 'device': 'str', 'len': 'int',
987 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
988 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool'} }
989
990 ##
991 # @query-block-jobs:
992 #
993 # Return information about long-running block device operations.
994 #
995 # Returns: a list of @BlockJobInfo for each active block job
996 #
997 # Since: 1.1
998 ##
999 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1000
1001 ##
1002 # @block_passwd:
1003 #
1004 # This command sets the password of a block device that has not been open
1005 # with a password and requires one.
1006 #
1007 # This command is now obsolete and will always return an error since 2.10
1008 #
1009 ##
1010 { 'command': 'block_passwd', 'data': {'*device': 'str',
1011 '*node-name': 'str', 'password': 'str'} }
1012
1013 ##
1014 # @block_resize:
1015 #
1016 # Resize a block image while a guest is running.
1017 #
1018 # Either @device or @node-name must be set but not both.
1019 #
1020 # @device: the name of the device to get the image resized
1021 #
1022 # @node-name: graph node name to get the image resized (Since 2.0)
1023 #
1024 # @size: new image size in bytes
1025 #
1026 # Returns: nothing on success
1027 # If @device is not a valid block device, DeviceNotFound
1028 #
1029 # Since: 0.14.0
1030 #
1031 # Example:
1032 #
1033 # -> { "execute": "block_resize",
1034 # "arguments": { "device": "scratch", "size": 1073741824 } }
1035 # <- { "return": {} }
1036 #
1037 ##
1038 { 'command': 'block_resize', 'data': { '*device': 'str',
1039 '*node-name': 'str',
1040 'size': 'int' }}
1041
1042 ##
1043 # @NewImageMode:
1044 #
1045 # An enumeration that tells QEMU how to set the backing file path in
1046 # a new image file.
1047 #
1048 # @existing: QEMU should look for an existing image file.
1049 #
1050 # @absolute-paths: QEMU should create a new image with absolute paths
1051 # for the backing file. If there is no backing file available, the new
1052 # image will not be backed either.
1053 #
1054 # Since: 1.1
1055 ##
1056 { 'enum': 'NewImageMode',
1057 'data': [ 'existing', 'absolute-paths' ] }
1058
1059 ##
1060 # @BlockdevSnapshotSync:
1061 #
1062 # Either @device or @node-name must be set but not both.
1063 #
1064 # @device: the name of the device to generate the snapshot from.
1065 #
1066 # @node-name: graph node name to generate the snapshot from (Since 2.0)
1067 #
1068 # @snapshot-file: the target of the new image. If the file exists, or
1069 # if it is a device, the snapshot will be created in the existing
1070 # file/device. Otherwise, a new file will be created.
1071 #
1072 # @snapshot-node-name: the graph node name of the new image (Since 2.0)
1073 #
1074 # @format: the format of the snapshot image, default is 'qcow2'.
1075 #
1076 # @mode: whether and how QEMU should create a new image, default is
1077 # 'absolute-paths'.
1078 ##
1079 { 'struct': 'BlockdevSnapshotSync',
1080 'data': { '*device': 'str', '*node-name': 'str',
1081 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1082 '*format': 'str', '*mode': 'NewImageMode' } }
1083
1084 ##
1085 # @BlockdevSnapshot:
1086 #
1087 # @node: device or node name that will have a snapshot created.
1088 #
1089 # @overlay: reference to the existing block device that will become
1090 # the overlay of @node, as part of creating the snapshot.
1091 # It must not have a current backing file (this can be
1092 # achieved by passing "backing": "" to blockdev-add).
1093 #
1094 # Since: 2.5
1095 ##
1096 { 'struct': 'BlockdevSnapshot',
1097 'data': { 'node': 'str', 'overlay': 'str' } }
1098
1099 ##
1100 # @DriveBackup:
1101 #
1102 # @job-id: identifier for the newly-created block job. If
1103 # omitted, the device name will be used. (Since 2.7)
1104 #
1105 # @device: the device name or node-name of a root node which should be copied.
1106 #
1107 # @target: the target of the new image. If the file exists, or if it
1108 # is a device, the existing file/device will be used as the new
1109 # destination. If it does not exist, a new file will be created.
1110 #
1111 # @format: the format of the new destination, default is to
1112 # probe if @mode is 'existing', else the format of the source
1113 #
1114 # @sync: what parts of the disk image should be copied to the destination
1115 # (all the disk, only the sectors allocated in the topmost image, from a
1116 # dirty bitmap, or only new I/O).
1117 #
1118 # @mode: whether and how QEMU should create a new image, default is
1119 # 'absolute-paths'.
1120 #
1121 # @speed: the maximum speed, in bytes per second
1122 #
1123 # @bitmap: the name of dirty bitmap if sync is "incremental".
1124 # Must be present if sync is "incremental", must NOT be present
1125 # otherwise. (Since 2.4)
1126 #
1127 # @compress: true to compress data, if the target format supports it.
1128 # (default: false) (since 2.8)
1129 #
1130 # @on-source-error: the action to take on an error on the source,
1131 # default 'report'. 'stop' and 'enospc' can only be used
1132 # if the block device supports io-status (see BlockInfo).
1133 #
1134 # @on-target-error: the action to take on an error on the target,
1135 # default 'report' (no limitations, since this applies to
1136 # a different block device than @device).
1137 #
1138 # Note: @on-source-error and @on-target-error only affect background
1139 # I/O. If an error occurs during a guest write request, the device's
1140 # rerror/werror actions will be used.
1141 #
1142 # Since: 1.6
1143 ##
1144 { 'struct': 'DriveBackup',
1145 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1146 '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1147 '*speed': 'int', '*bitmap': 'str', '*compress': 'bool',
1148 '*on-source-error': 'BlockdevOnError',
1149 '*on-target-error': 'BlockdevOnError' } }
1150
1151 ##
1152 # @BlockdevBackup:
1153 #
1154 # @job-id: identifier for the newly-created block job. If
1155 # omitted, the device name will be used. (Since 2.7)
1156 #
1157 # @device: the device name or node-name of a root node which should be copied.
1158 #
1159 # @target: the device name or node-name of the backup target node.
1160 #
1161 # @sync: what parts of the disk image should be copied to the destination
1162 # (all the disk, only the sectors allocated in the topmost image, or
1163 # only new I/O).
1164 #
1165 # @speed: the maximum speed, in bytes per second. The default is 0,
1166 # for unlimited.
1167 #
1168 # @compress: true to compress data, if the target format supports it.
1169 # (default: false) (since 2.8)
1170 #
1171 # @on-source-error: the action to take on an error on the source,
1172 # default 'report'. 'stop' and 'enospc' can only be used
1173 # if the block device supports io-status (see BlockInfo).
1174 #
1175 # @on-target-error: the action to take on an error on the target,
1176 # default 'report' (no limitations, since this applies to
1177 # a different block device than @device).
1178 #
1179 # Note: @on-source-error and @on-target-error only affect background
1180 # I/O. If an error occurs during a guest write request, the device's
1181 # rerror/werror actions will be used.
1182 #
1183 # Since: 2.3
1184 ##
1185 { 'struct': 'BlockdevBackup',
1186 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1187 'sync': 'MirrorSyncMode',
1188 '*speed': 'int',
1189 '*compress': 'bool',
1190 '*on-source-error': 'BlockdevOnError',
1191 '*on-target-error': 'BlockdevOnError' } }
1192
1193 ##
1194 # @blockdev-snapshot-sync:
1195 #
1196 # Generates a synchronous snapshot of a block device.
1197 #
1198 # For the arguments, see the documentation of BlockdevSnapshotSync.
1199 #
1200 # Returns: nothing on success
1201 # If @device is not a valid block device, DeviceNotFound
1202 #
1203 # Since: 0.14.0
1204 #
1205 # Example:
1206 #
1207 # -> { "execute": "blockdev-snapshot-sync",
1208 # "arguments": { "device": "ide-hd0",
1209 # "snapshot-file":
1210 # "/some/place/my-image",
1211 # "format": "qcow2" } }
1212 # <- { "return": {} }
1213 #
1214 ##
1215 { 'command': 'blockdev-snapshot-sync',
1216 'data': 'BlockdevSnapshotSync' }
1217
1218
1219 ##
1220 # @blockdev-snapshot:
1221 #
1222 # Generates a snapshot of a block device.
1223 #
1224 # Create a snapshot, by installing 'node' as the backing image of
1225 # 'overlay'. Additionally, if 'node' is associated with a block
1226 # device, the block device changes to using 'overlay' as its new active
1227 # image.
1228 #
1229 # For the arguments, see the documentation of BlockdevSnapshot.
1230 #
1231 # Since: 2.5
1232 #
1233 # Example:
1234 #
1235 # -> { "execute": "blockdev-add",
1236 # "arguments": { "driver": "qcow2",
1237 # "node-name": "node1534",
1238 # "file": { "driver": "file",
1239 # "filename": "hd1.qcow2" },
1240 # "backing": "" } }
1241 #
1242 # <- { "return": {} }
1243 #
1244 # -> { "execute": "blockdev-snapshot",
1245 # "arguments": { "node": "ide-hd0",
1246 # "overlay": "node1534" } }
1247 # <- { "return": {} }
1248 #
1249 ##
1250 { 'command': 'blockdev-snapshot',
1251 'data': 'BlockdevSnapshot' }
1252
1253 ##
1254 # @change-backing-file:
1255 #
1256 # Change the backing file in the image file metadata. This does not
1257 # cause QEMU to reopen the image file to reparse the backing filename
1258 # (it may, however, perform a reopen to change permissions from
1259 # r/o -> r/w -> r/o, if needed). The new backing file string is written
1260 # into the image file metadata, and the QEMU internal strings are
1261 # updated.
1262 #
1263 # @image-node-name: The name of the block driver state node of the
1264 # image to modify. The "device" argument is used
1265 # to verify "image-node-name" is in the chain
1266 # described by "device".
1267 #
1268 # @device: The device name or node-name of the root node that owns
1269 # image-node-name.
1270 #
1271 # @backing-file: The string to write as the backing file. This
1272 # string is not validated, so care should be taken
1273 # when specifying the string or the image chain may
1274 # not be able to be reopened again.
1275 #
1276 # Returns: Nothing on success
1277 #
1278 # If "device" does not exist or cannot be determined, DeviceNotFound
1279 #
1280 # Since: 2.1
1281 ##
1282 { 'command': 'change-backing-file',
1283 'data': { 'device': 'str', 'image-node-name': 'str',
1284 'backing-file': 'str' } }
1285
1286 ##
1287 # @block-commit:
1288 #
1289 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1290 # writes data between 'top' and 'base' into 'base'.
1291 #
1292 # @job-id: identifier for the newly-created block job. If
1293 # omitted, the device name will be used. (Since 2.7)
1294 #
1295 # @device: the device name or node-name of a root node
1296 #
1297 # @base: The file name of the backing image to write data into.
1298 # If not specified, this is the deepest backing image.
1299 #
1300 # @top: The file name of the backing image within the image chain,
1301 # which contains the topmost data to be committed down. If
1302 # not specified, this is the active layer.
1303 #
1304 # @backing-file: The backing file string to write into the overlay
1305 # image of 'top'. If 'top' is the active layer,
1306 # specifying a backing file string is an error. This
1307 # filename is not validated.
1308 #
1309 # If a pathname string is such that it cannot be
1310 # resolved by QEMU, that means that subsequent QMP or
1311 # HMP commands must use node-names for the image in
1312 # question, as filename lookup methods will fail.
1313 #
1314 # If not specified, QEMU will automatically determine
1315 # the backing file string to use, or error out if
1316 # there is no obvious choice. Care should be taken
1317 # when specifying the string, to specify a valid
1318 # filename or protocol.
1319 # (Since 2.1)
1320 #
1321 # If top == base, that is an error.
1322 # If top == active, the job will not be completed by itself,
1323 # user needs to complete the job with the block-job-complete
1324 # command after getting the ready event. (Since 2.0)
1325 #
1326 # If the base image is smaller than top, then the base image
1327 # will be resized to be the same size as top. If top is
1328 # smaller than the base image, the base will not be
1329 # truncated. If you want the base image size to match the
1330 # size of the smaller top, you can safely truncate it
1331 # yourself once the commit operation successfully completes.
1332 #
1333 # @speed: the maximum speed, in bytes per second
1334 #
1335 # @filter-node-name: the node name that should be assigned to the
1336 # filter driver that the commit job inserts into the graph
1337 # above @top. If this option is not given, a node name is
1338 # autogenerated. (Since: 2.9)
1339 #
1340 # Returns: Nothing on success
1341 # If commit or stream is already active on this device, DeviceInUse
1342 # If @device does not exist, DeviceNotFound
1343 # If image commit is not supported by this device, NotSupported
1344 # If @base or @top is invalid, a generic error is returned
1345 # If @speed is invalid, InvalidParameter
1346 #
1347 # Since: 1.3
1348 #
1349 # Example:
1350 #
1351 # -> { "execute": "block-commit",
1352 # "arguments": { "device": "virtio0",
1353 # "top": "/tmp/snap1.qcow2" } }
1354 # <- { "return": {} }
1355 #
1356 ##
1357 { 'command': 'block-commit',
1358 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
1359 '*backing-file': 'str', '*speed': 'int',
1360 '*filter-node-name': 'str' } }
1361
1362 ##
1363 # @drive-backup:
1364 #
1365 # Start a point-in-time copy of a block device to a new destination. The
1366 # status of ongoing drive-backup operations can be checked with
1367 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1368 # The operation can be stopped before it has completed using the
1369 # block-job-cancel command.
1370 #
1371 # Returns: nothing on success
1372 # If @device is not a valid block device, GenericError
1373 #
1374 # Since: 1.6
1375 #
1376 # Example:
1377 #
1378 # -> { "execute": "drive-backup",
1379 # "arguments": { "device": "drive0",
1380 # "sync": "full",
1381 # "target": "backup.img" } }
1382 # <- { "return": {} }
1383 #
1384 ##
1385 { 'command': 'drive-backup', 'boxed': true,
1386 'data': 'DriveBackup' }
1387
1388 ##
1389 # @blockdev-backup:
1390 #
1391 # Start a point-in-time copy of a block device to a new destination. The
1392 # status of ongoing blockdev-backup operations can be checked with
1393 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1394 # The operation can be stopped before it has completed using the
1395 # block-job-cancel command.
1396 #
1397 # Returns: nothing on success
1398 # If @device is not a valid block device, DeviceNotFound
1399 #
1400 # Since: 2.3
1401 #
1402 # Example:
1403 # -> { "execute": "blockdev-backup",
1404 # "arguments": { "device": "src-id",
1405 # "sync": "full",
1406 # "target": "tgt-id" } }
1407 # <- { "return": {} }
1408 #
1409 ##
1410 { 'command': 'blockdev-backup', 'boxed': true,
1411 'data': 'BlockdevBackup' }
1412
1413
1414 ##
1415 # @query-named-block-nodes:
1416 #
1417 # Get the named block driver list
1418 #
1419 # Returns: the list of BlockDeviceInfo
1420 #
1421 # Since: 2.0
1422 #
1423 # Example:
1424 #
1425 # -> { "execute": "query-named-block-nodes" }
1426 # <- { "return": [ { "ro":false,
1427 # "drv":"qcow2",
1428 # "encrypted":false,
1429 # "file":"disks/test.qcow2",
1430 # "node-name": "my-node",
1431 # "backing_file_depth":1,
1432 # "bps":1000000,
1433 # "bps_rd":0,
1434 # "bps_wr":0,
1435 # "iops":1000000,
1436 # "iops_rd":0,
1437 # "iops_wr":0,
1438 # "bps_max": 8000000,
1439 # "bps_rd_max": 0,
1440 # "bps_wr_max": 0,
1441 # "iops_max": 0,
1442 # "iops_rd_max": 0,
1443 # "iops_wr_max": 0,
1444 # "iops_size": 0,
1445 # "write_threshold": 0,
1446 # "image":{
1447 # "filename":"disks/test.qcow2",
1448 # "format":"qcow2",
1449 # "virtual-size":2048000,
1450 # "backing_file":"base.qcow2",
1451 # "full-backing-filename":"disks/base.qcow2",
1452 # "backing-filename-format":"qcow2",
1453 # "snapshots":[
1454 # {
1455 # "id": "1",
1456 # "name": "snapshot1",
1457 # "vm-state-size": 0,
1458 # "date-sec": 10000200,
1459 # "date-nsec": 12,
1460 # "vm-clock-sec": 206,
1461 # "vm-clock-nsec": 30
1462 # }
1463 # ],
1464 # "backing-image":{
1465 # "filename":"disks/base.qcow2",
1466 # "format":"qcow2",
1467 # "virtual-size":2048000
1468 # }
1469 # } } ] }
1470 #
1471 ##
1472 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
1473
1474 ##
1475 # @drive-mirror:
1476 #
1477 # Start mirroring a block device's writes to a new destination. target
1478 # specifies the target of the new image. If the file exists, or if it
1479 # is a device, it will be used as the new destination for writes. If
1480 # it does not exist, a new file will be created. format specifies the
1481 # format of the mirror image, default is to probe if mode='existing',
1482 # else the format of the source.
1483 #
1484 # Returns: nothing on success
1485 # If @device is not a valid block device, GenericError
1486 #
1487 # Since: 1.3
1488 #
1489 # Example:
1490 #
1491 # -> { "execute": "drive-mirror",
1492 # "arguments": { "device": "ide-hd0",
1493 # "target": "/some/place/my-image",
1494 # "sync": "full",
1495 # "format": "qcow2" } }
1496 # <- { "return": {} }
1497 #
1498 ##
1499 { 'command': 'drive-mirror', 'boxed': true,
1500 'data': 'DriveMirror' }
1501
1502 ##
1503 # @DriveMirror:
1504 #
1505 # A set of parameters describing drive mirror setup.
1506 #
1507 # @job-id: identifier for the newly-created block job. If
1508 # omitted, the device name will be used. (Since 2.7)
1509 #
1510 # @device: the device name or node-name of a root node whose writes should be
1511 # mirrored.
1512 #
1513 # @target: the target of the new image. If the file exists, or if it
1514 # is a device, the existing file/device will be used as the new
1515 # destination. If it does not exist, a new file will be created.
1516 #
1517 # @format: the format of the new destination, default is to
1518 # probe if @mode is 'existing', else the format of the source
1519 #
1520 # @node-name: the new block driver state node name in the graph
1521 # (Since 2.1)
1522 #
1523 # @replaces: with sync=full graph node name to be replaced by the new
1524 # image when a whole image copy is done. This can be used to repair
1525 # broken Quorum files. (Since 2.1)
1526 #
1527 # @mode: whether and how QEMU should create a new image, default is
1528 # 'absolute-paths'.
1529 #
1530 # @speed: the maximum speed, in bytes per second
1531 #
1532 # @sync: what parts of the disk image should be copied to the destination
1533 # (all the disk, only the sectors allocated in the topmost image, or
1534 # only new I/O).
1535 #
1536 # @granularity: granularity of the dirty bitmap, default is 64K
1537 # if the image format doesn't have clusters, 4K if the clusters
1538 # are smaller than that, else the cluster size. Must be a
1539 # power of 2 between 512 and 64M (since 1.4).
1540 #
1541 # @buf-size: maximum amount of data in flight from source to
1542 # target (since 1.4).
1543 #
1544 # @on-source-error: the action to take on an error on the source,
1545 # default 'report'. 'stop' and 'enospc' can only be used
1546 # if the block device supports io-status (see BlockInfo).
1547 #
1548 # @on-target-error: the action to take on an error on the target,
1549 # default 'report' (no limitations, since this applies to
1550 # a different block device than @device).
1551 # @unmap: Whether to try to unmap target sectors where source has
1552 # only zero. If true, and target unallocated sectors will read as zero,
1553 # target image sectors will be unmapped; otherwise, zeroes will be
1554 # written. Both will result in identical contents.
1555 # Default is true. (Since 2.4)
1556 #
1557 # Since: 1.3
1558 ##
1559 { 'struct': 'DriveMirror',
1560 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1561 '*format': 'str', '*node-name': 'str', '*replaces': 'str',
1562 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1563 '*speed': 'int', '*granularity': 'uint32',
1564 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1565 '*on-target-error': 'BlockdevOnError',
1566 '*unmap': 'bool' } }
1567
1568 ##
1569 # @BlockDirtyBitmap:
1570 #
1571 # @node: name of device/node which the bitmap is tracking
1572 #
1573 # @name: name of the dirty bitmap
1574 #
1575 # Since: 2.4
1576 ##
1577 { 'struct': 'BlockDirtyBitmap',
1578 'data': { 'node': 'str', 'name': 'str' } }
1579
1580 ##
1581 # @BlockDirtyBitmapAdd:
1582 #
1583 # @node: name of device/node which the bitmap is tracking
1584 #
1585 # @name: name of the dirty bitmap
1586 #
1587 # @granularity: the bitmap granularity, default is 64k for
1588 # block-dirty-bitmap-add
1589 #
1590 # @persistent: the bitmap is persistent, i.e. it will be saved to the
1591 # corresponding block device image file on its close. For now only
1592 # Qcow2 disks support persistent bitmaps. Default is false for
1593 # block-dirty-bitmap-add. (Since: 2.10)
1594 #
1595 # @autoload: the bitmap will be automatically loaded when the image it is stored
1596 # in is opened. This flag may only be specified for persistent
1597 # bitmaps. Default is false for block-dirty-bitmap-add. (Since: 2.10)
1598 #
1599 # Since: 2.4
1600 ##
1601 { 'struct': 'BlockDirtyBitmapAdd',
1602 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
1603 '*persistent': 'bool', '*autoload': 'bool' } }
1604
1605 ##
1606 # @block-dirty-bitmap-add:
1607 #
1608 # Create a dirty bitmap with a name on the node, and start tracking the writes.
1609 #
1610 # Returns: nothing on success
1611 # If @node is not a valid block device or node, DeviceNotFound
1612 # If @name is already taken, GenericError with an explanation
1613 #
1614 # Since: 2.4
1615 #
1616 # Example:
1617 #
1618 # -> { "execute": "block-dirty-bitmap-add",
1619 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1620 # <- { "return": {} }
1621 #
1622 ##
1623 { 'command': 'block-dirty-bitmap-add',
1624 'data': 'BlockDirtyBitmapAdd' }
1625
1626 ##
1627 # @block-dirty-bitmap-remove:
1628 #
1629 # Stop write tracking and remove the dirty bitmap that was created
1630 # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its
1631 # storage too.
1632 #
1633 # Returns: nothing on success
1634 # If @node is not a valid block device or node, DeviceNotFound
1635 # If @name is not found, GenericError with an explanation
1636 # if @name is frozen by an operation, GenericError
1637 #
1638 # Since: 2.4
1639 #
1640 # Example:
1641 #
1642 # -> { "execute": "block-dirty-bitmap-remove",
1643 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1644 # <- { "return": {} }
1645 #
1646 ##
1647 { 'command': 'block-dirty-bitmap-remove',
1648 'data': 'BlockDirtyBitmap' }
1649
1650 ##
1651 # @block-dirty-bitmap-clear:
1652 #
1653 # Clear (reset) a dirty bitmap on the device, so that an incremental
1654 # backup from this point in time forward will only backup clusters
1655 # modified after this clear operation.
1656 #
1657 # Returns: nothing on success
1658 # If @node is not a valid block device, DeviceNotFound
1659 # If @name is not found, GenericError with an explanation
1660 #
1661 # Since: 2.4
1662 #
1663 # Example:
1664 #
1665 # -> { "execute": "block-dirty-bitmap-clear",
1666 # "arguments": { "node": "drive0", "name": "bitmap0" } }
1667 # <- { "return": {} }
1668 #
1669 ##
1670 { 'command': 'block-dirty-bitmap-clear',
1671 'data': 'BlockDirtyBitmap' }
1672
1673 ##
1674 # @BlockDirtyBitmapSha256:
1675 #
1676 # SHA256 hash of dirty bitmap data
1677 #
1678 # @sha256: ASCII representation of SHA256 bitmap hash
1679 #
1680 # Since: 2.10
1681 ##
1682 { 'struct': 'BlockDirtyBitmapSha256',
1683 'data': {'sha256': 'str'} }
1684
1685 ##
1686 # @x-debug-block-dirty-bitmap-sha256:
1687 #
1688 # Get bitmap SHA256
1689 #
1690 # Returns: BlockDirtyBitmapSha256 on success
1691 # If @node is not a valid block device, DeviceNotFound
1692 # If @name is not found or if hashing has failed, GenericError with an
1693 # explanation
1694 #
1695 # Since: 2.10
1696 ##
1697 { 'command': 'x-debug-block-dirty-bitmap-sha256',
1698 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
1699
1700 ##
1701 # @blockdev-mirror:
1702 #
1703 # Start mirroring a block device's writes to a new destination.
1704 #
1705 # @job-id: identifier for the newly-created block job. If
1706 # omitted, the device name will be used. (Since 2.7)
1707 #
1708 # @device: The device name or node-name of a root node whose writes should be
1709 # mirrored.
1710 #
1711 # @target: the id or node-name of the block device to mirror to. This mustn't be
1712 # attached to guest.
1713 #
1714 # @replaces: with sync=full graph node name to be replaced by the new
1715 # image when a whole image copy is done. This can be used to repair
1716 # broken Quorum files.
1717 #
1718 # @speed: the maximum speed, in bytes per second
1719 #
1720 # @sync: what parts of the disk image should be copied to the destination
1721 # (all the disk, only the sectors allocated in the topmost image, or
1722 # only new I/O).
1723 #
1724 # @granularity: granularity of the dirty bitmap, default is 64K
1725 # if the image format doesn't have clusters, 4K if the clusters
1726 # are smaller than that, else the cluster size. Must be a
1727 # power of 2 between 512 and 64M
1728 #
1729 # @buf-size: maximum amount of data in flight from source to
1730 # target
1731 #
1732 # @on-source-error: the action to take on an error on the source,
1733 # default 'report'. 'stop' and 'enospc' can only be used
1734 # if the block device supports io-status (see BlockInfo).
1735 #
1736 # @on-target-error: the action to take on an error on the target,
1737 # default 'report' (no limitations, since this applies to
1738 # a different block device than @device).
1739 #
1740 # @filter-node-name: the node name that should be assigned to the
1741 # filter driver that the mirror job inserts into the graph
1742 # above @device. If this option is not given, a node name is
1743 # autogenerated. (Since: 2.9)
1744 #
1745 # Returns: nothing on success.
1746 #
1747 # Since: 2.6
1748 #
1749 # Example:
1750 #
1751 # -> { "execute": "blockdev-mirror",
1752 # "arguments": { "device": "ide-hd0",
1753 # "target": "target0",
1754 # "sync": "full" } }
1755 # <- { "return": {} }
1756 #
1757 ##
1758 { 'command': 'blockdev-mirror',
1759 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
1760 '*replaces': 'str',
1761 'sync': 'MirrorSyncMode',
1762 '*speed': 'int', '*granularity': 'uint32',
1763 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1764 '*on-target-error': 'BlockdevOnError',
1765 '*filter-node-name': 'str' } }
1766
1767 ##
1768 # @block_set_io_throttle:
1769 #
1770 # Change I/O throttle limits for a block drive.
1771 #
1772 # Since QEMU 2.4, each device with I/O limits is member of a throttle
1773 # group.
1774 #
1775 # If two or more devices are members of the same group, the limits
1776 # will apply to the combined I/O of the whole group in a round-robin
1777 # fashion. Therefore, setting new I/O limits to a device will affect
1778 # the whole group.
1779 #
1780 # The name of the group can be specified using the 'group' parameter.
1781 # If the parameter is unset, it is assumed to be the current group of
1782 # that device. If it's not in any group yet, the name of the device
1783 # will be used as the name for its group.
1784 #
1785 # The 'group' parameter can also be used to move a device to a
1786 # different group. In this case the limits specified in the parameters
1787 # will be applied to the new group only.
1788 #
1789 # I/O limits can be disabled by setting all of them to 0. In this case
1790 # the device will be removed from its group and the rest of its
1791 # members will not be affected. The 'group' parameter is ignored.
1792 #
1793 # Returns: Nothing on success
1794 # If @device is not a valid block device, DeviceNotFound
1795 #
1796 # Since: 1.1
1797 #
1798 # Example:
1799 #
1800 # -> { "execute": "block_set_io_throttle",
1801 # "arguments": { "id": "ide0-1-0",
1802 # "bps": 1000000,
1803 # "bps_rd": 0,
1804 # "bps_wr": 0,
1805 # "iops": 0,
1806 # "iops_rd": 0,
1807 # "iops_wr": 0,
1808 # "bps_max": 8000000,
1809 # "bps_rd_max": 0,
1810 # "bps_wr_max": 0,
1811 # "iops_max": 0,
1812 # "iops_rd_max": 0,
1813 # "iops_wr_max": 0,
1814 # "bps_max_length": 60,
1815 # "iops_size": 0 } }
1816 # <- { "return": {} }
1817 ##
1818 { 'command': 'block_set_io_throttle', 'boxed': true,
1819 'data': 'BlockIOThrottle' }
1820
1821 ##
1822 # @BlockIOThrottle:
1823 #
1824 # A set of parameters describing block throttling.
1825 #
1826 # @device: Block device name (deprecated, use @id instead)
1827 #
1828 # @id: The name or QOM path of the guest device (since: 2.8)
1829 #
1830 # @bps: total throughput limit in bytes per second
1831 #
1832 # @bps_rd: read throughput limit in bytes per second
1833 #
1834 # @bps_wr: write throughput limit in bytes per second
1835 #
1836 # @iops: total I/O operations per second
1837 #
1838 # @iops_rd: read I/O operations per second
1839 #
1840 # @iops_wr: write I/O operations per second
1841 #
1842 # @bps_max: total throughput limit during bursts,
1843 # in bytes (Since 1.7)
1844 #
1845 # @bps_rd_max: read throughput limit during bursts,
1846 # in bytes (Since 1.7)
1847 #
1848 # @bps_wr_max: write throughput limit during bursts,
1849 # in bytes (Since 1.7)
1850 #
1851 # @iops_max: total I/O operations per second during bursts,
1852 # in bytes (Since 1.7)
1853 #
1854 # @iops_rd_max: read I/O operations per second during bursts,
1855 # in bytes (Since 1.7)
1856 #
1857 # @iops_wr_max: write I/O operations per second during bursts,
1858 # in bytes (Since 1.7)
1859 #
1860 # @bps_max_length: maximum length of the @bps_max burst
1861 # period, in seconds. It must only
1862 # be set if @bps_max is set as well.
1863 # Defaults to 1. (Since 2.6)
1864 #
1865 # @bps_rd_max_length: maximum length of the @bps_rd_max
1866 # burst period, in seconds. It must only
1867 # be set if @bps_rd_max is set as well.
1868 # Defaults to 1. (Since 2.6)
1869 #
1870 # @bps_wr_max_length: maximum length of the @bps_wr_max
1871 # burst period, in seconds. It must only
1872 # be set if @bps_wr_max is set as well.
1873 # Defaults to 1. (Since 2.6)
1874 #
1875 # @iops_max_length: maximum length of the @iops burst
1876 # period, in seconds. It must only
1877 # be set if @iops_max is set as well.
1878 # Defaults to 1. (Since 2.6)
1879 #
1880 # @iops_rd_max_length: maximum length of the @iops_rd_max
1881 # burst period, in seconds. It must only
1882 # be set if @iops_rd_max is set as well.
1883 # Defaults to 1. (Since 2.6)
1884 #
1885 # @iops_wr_max_length: maximum length of the @iops_wr_max
1886 # burst period, in seconds. It must only
1887 # be set if @iops_wr_max is set as well.
1888 # Defaults to 1. (Since 2.6)
1889 #
1890 # @iops_size: an I/O size in bytes (Since 1.7)
1891 #
1892 # @group: throttle group name (Since 2.4)
1893 #
1894 # Since: 1.1
1895 ##
1896 { 'struct': 'BlockIOThrottle',
1897 'data': { '*device': 'str', '*id': 'str', 'bps': 'int', 'bps_rd': 'int',
1898 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
1899 '*bps_max': 'int', '*bps_rd_max': 'int',
1900 '*bps_wr_max': 'int', '*iops_max': 'int',
1901 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
1902 '*bps_max_length': 'int', '*bps_rd_max_length': 'int',
1903 '*bps_wr_max_length': 'int', '*iops_max_length': 'int',
1904 '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int',
1905 '*iops_size': 'int', '*group': 'str' } }
1906
1907 ##
1908 # @block-stream:
1909 #
1910 # Copy data from a backing file into a block device.
1911 #
1912 # The block streaming operation is performed in the background until the entire
1913 # backing file has been copied. This command returns immediately once streaming
1914 # has started. The status of ongoing block streaming operations can be checked
1915 # with query-block-jobs. The operation can be stopped before it has completed
1916 # using the block-job-cancel command.
1917 #
1918 # The node that receives the data is called the top image, can be located in
1919 # any part of the chain (but always above the base image; see below) and can be
1920 # specified using its device or node name. Earlier qemu versions only allowed
1921 # 'device' to name the top level node; presence of the 'base-node' parameter
1922 # during introspection can be used as a witness of the enhanced semantics
1923 # of 'device'.
1924 #
1925 # If a base file is specified then sectors are not copied from that base file and
1926 # its backing chain. When streaming completes the image file will have the base
1927 # file as its backing file. This can be used to stream a subset of the backing
1928 # file chain instead of flattening the entire image.
1929 #
1930 # On successful completion the image file is updated to drop the backing file
1931 # and the BLOCK_JOB_COMPLETED event is emitted.
1932 #
1933 # @job-id: identifier for the newly-created block job. If
1934 # omitted, the device name will be used. (Since 2.7)
1935 #
1936 # @device: the device or node name of the top image
1937 #
1938 # @base: the common backing file name.
1939 # It cannot be set if @base-node is also set.
1940 #
1941 # @base-node: the node name of the backing file.
1942 # It cannot be set if @base is also set. (Since 2.8)
1943 #
1944 # @backing-file: The backing file string to write into the top
1945 # image. This filename is not validated.
1946 #
1947 # If a pathname string is such that it cannot be
1948 # resolved by QEMU, that means that subsequent QMP or
1949 # HMP commands must use node-names for the image in
1950 # question, as filename lookup methods will fail.
1951 #
1952 # If not specified, QEMU will automatically determine
1953 # the backing file string to use, or error out if there
1954 # is no obvious choice. Care should be taken when
1955 # specifying the string, to specify a valid filename or
1956 # protocol.
1957 # (Since 2.1)
1958 #
1959 # @speed: the maximum speed, in bytes per second
1960 #
1961 # @on-error: the action to take on an error (default report).
1962 # 'stop' and 'enospc' can only be used if the block device
1963 # supports io-status (see BlockInfo). Since 1.3.
1964 #
1965 # Returns: Nothing on success. If @device does not exist, DeviceNotFound.
1966 #
1967 # Since: 1.1
1968 #
1969 # Example:
1970 #
1971 # -> { "execute": "block-stream",
1972 # "arguments": { "device": "virtio0",
1973 # "base": "/tmp/master.qcow2" } }
1974 # <- { "return": {} }
1975 #
1976 ##
1977 { 'command': 'block-stream',
1978 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
1979 '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
1980 '*on-error': 'BlockdevOnError' } }
1981
1982 ##
1983 # @block-job-set-speed:
1984 #
1985 # Set maximum speed for a background block operation.
1986 #
1987 # This command can only be issued when there is an active block job.
1988 #
1989 # Throttling can be disabled by setting the speed to 0.
1990 #
1991 # @device: The job identifier. This used to be a device name (hence
1992 # the name of the parameter), but since QEMU 2.7 it can have
1993 # other values.
1994 #
1995 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
1996 # Defaults to 0.
1997 #
1998 # Returns: Nothing on success
1999 # If no background operation is active on this device, DeviceNotActive
2000 #
2001 # Since: 1.1
2002 ##
2003 { 'command': 'block-job-set-speed',
2004 'data': { 'device': 'str', 'speed': 'int' } }
2005
2006 ##
2007 # @block-job-cancel:
2008 #
2009 # Stop an active background block operation.
2010 #
2011 # This command returns immediately after marking the active background block
2012 # operation for cancellation. It is an error to call this command if no
2013 # operation is in progress.
2014 #
2015 # The operation will cancel as soon as possible and then emit the
2016 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2017 # enumerated using query-block-jobs.
2018 #
2019 # For streaming, the image file retains its backing file unless the streaming
2020 # operation happens to complete just as it is being cancelled. A new streaming
2021 # operation can be started at a later time to finish copying all data from the
2022 # backing file.
2023 #
2024 # @device: The job identifier. This used to be a device name (hence
2025 # the name of the parameter), but since QEMU 2.7 it can have
2026 # other values.
2027 #
2028 # @force: whether to allow cancellation of a paused job (default
2029 # false). Since 1.3.
2030 #
2031 # Returns: Nothing on success
2032 # If no background operation is active on this device, DeviceNotActive
2033 #
2034 # Since: 1.1
2035 ##
2036 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2037
2038 ##
2039 # @block-job-pause:
2040 #
2041 # Pause an active background block operation.
2042 #
2043 # This command returns immediately after marking the active background block
2044 # operation for pausing. It is an error to call this command if no
2045 # operation is in progress. Pausing an already paused job has no cumulative
2046 # effect; a single block-job-resume command will resume the job.
2047 #
2048 # The operation will pause as soon as possible. No event is emitted when
2049 # the operation is actually paused. Cancelling a paused job automatically
2050 # resumes it.
2051 #
2052 # @device: The job identifier. This used to be a device name (hence
2053 # the name of the parameter), but since QEMU 2.7 it can have
2054 # other values.
2055 #
2056 # Returns: Nothing on success
2057 # If no background operation is active on this device, DeviceNotActive
2058 #
2059 # Since: 1.3
2060 ##
2061 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2062
2063 ##
2064 # @block-job-resume:
2065 #
2066 # Resume an active background block operation.
2067 #
2068 # This command returns immediately after resuming a paused background block
2069 # operation. It is an error to call this command if no operation is in
2070 # progress. Resuming an already running job is not an error.
2071 #
2072 # This command also clears the error status of the job.
2073 #
2074 # @device: The job identifier. This used to be a device name (hence
2075 # the name of the parameter), but since QEMU 2.7 it can have
2076 # other values.
2077 #
2078 # Returns: Nothing on success
2079 # If no background operation is active on this device, DeviceNotActive
2080 #
2081 # Since: 1.3
2082 ##
2083 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2084
2085 ##
2086 # @block-job-complete:
2087 #
2088 # Manually trigger completion of an active background block operation. This
2089 # is supported for drive mirroring, where it also switches the device to
2090 # write to the target path only. The ability to complete is signaled with
2091 # a BLOCK_JOB_READY event.
2092 #
2093 # This command completes an active background block operation synchronously.
2094 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2095 # is not defined. Note that if an I/O error occurs during the processing of
2096 # this command: 1) the command itself will fail; 2) the error will be processed
2097 # according to the rerror/werror arguments that were specified when starting
2098 # the operation.
2099 #
2100 # A cancelled or paused job cannot be completed.
2101 #
2102 # @device: The job identifier. This used to be a device name (hence
2103 # the name of the parameter), but since QEMU 2.7 it can have
2104 # other values.
2105 #
2106 # Returns: Nothing on success
2107 # If no background operation is active on this device, DeviceNotActive
2108 #
2109 # Since: 1.3
2110 ##
2111 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2112
2113 ##
2114 # @BlockdevDiscardOptions:
2115 #
2116 # Determines how to handle discard requests.
2117 #
2118 # @ignore: Ignore the request
2119 # @unmap: Forward as an unmap request
2120 #
2121 # Since: 2.9
2122 ##
2123 { 'enum': 'BlockdevDiscardOptions',
2124 'data': [ 'ignore', 'unmap' ] }
2125
2126 ##
2127 # @BlockdevDetectZeroesOptions:
2128 #
2129 # Describes the operation mode for the automatic conversion of plain
2130 # zero writes by the OS to driver specific optimized zero write commands.
2131 #
2132 # @off: Disabled (default)
2133 # @on: Enabled
2134 # @unmap: Enabled and even try to unmap blocks if possible. This requires
2135 # also that @BlockdevDiscardOptions is set to unmap for this device.
2136 #
2137 # Since: 2.1
2138 ##
2139 { 'enum': 'BlockdevDetectZeroesOptions',
2140 'data': [ 'off', 'on', 'unmap' ] }
2141
2142 ##
2143 # @BlockdevAioOptions:
2144 #
2145 # Selects the AIO backend to handle I/O requests
2146 #
2147 # @threads: Use qemu's thread pool
2148 # @native: Use native AIO backend (only Linux and Windows)
2149 #
2150 # Since: 2.9
2151 ##
2152 { 'enum': 'BlockdevAioOptions',
2153 'data': [ 'threads', 'native' ] }
2154
2155 ##
2156 # @BlockdevCacheOptions:
2157 #
2158 # Includes cache-related options for block devices
2159 #
2160 # @direct: enables use of O_DIRECT (bypass the host page cache;
2161 # default: false)
2162 # @no-flush: ignore any flush requests for the device (default:
2163 # false)
2164 #
2165 # Since: 2.9
2166 ##
2167 { 'struct': 'BlockdevCacheOptions',
2168 'data': { '*direct': 'bool',
2169 '*no-flush': 'bool' } }
2170
2171 ##
2172 # @BlockdevDriver:
2173 #
2174 # Drivers that are supported in block device operations.
2175 #
2176 # @vxhs: Since 2.10
2177 #
2178 # Since: 2.9
2179 ##
2180 { 'enum': 'BlockdevDriver',
2181 'data': [ 'blkdebug', 'blkverify', 'bochs', 'cloop',
2182 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom',
2183 'host_device', 'http', 'https', 'iscsi', 'luks', 'nbd', 'nfs',
2184 'null-aio', 'null-co', 'parallels', 'qcow', 'qcow2', 'qed',
2185 'quorum', 'raw', 'rbd', 'replication', 'sheepdog', 'ssh',
2186 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
2187
2188 ##
2189 # @BlockdevOptionsFile:
2190 #
2191 # Driver specific block device options for the file backend.
2192 #
2193 # @filename: path to the image file
2194 # @aio: AIO backend (default: threads) (since: 2.8)
2195 # @locking: whether to enable file locking. If set to 'auto', only enable
2196 # when Open File Descriptor (OFD) locking API is available
2197 # (default: auto, since 2.10)
2198 #
2199 # Since: 2.9
2200 ##
2201 { 'struct': 'BlockdevOptionsFile',
2202 'data': { 'filename': 'str',
2203 '*locking': 'OnOffAuto',
2204 '*aio': 'BlockdevAioOptions' } }
2205
2206 ##
2207 # @BlockdevOptionsNull:
2208 #
2209 # Driver specific block device options for the null backend.
2210 #
2211 # @size: size of the device in bytes.
2212 # @latency-ns: emulated latency (in nanoseconds) in processing
2213 # requests. Default to zero which completes requests immediately.
2214 # (Since 2.4)
2215 #
2216 # Since: 2.9
2217 ##
2218 { 'struct': 'BlockdevOptionsNull',
2219 'data': { '*size': 'int', '*latency-ns': 'uint64' } }
2220
2221 ##
2222 # @BlockdevOptionsVVFAT:
2223 #
2224 # Driver specific block device options for the vvfat protocol.
2225 #
2226 # @dir: directory to be exported as FAT image
2227 # @fat-type: FAT type: 12, 16 or 32
2228 # @floppy: whether to export a floppy image (true) or
2229 # partitioned hard disk (false; default)
2230 # @label: set the volume label, limited to 11 bytes. FAT16 and
2231 # FAT32 traditionally have some restrictions on labels, which are
2232 # ignored by most operating systems. Defaults to "QEMU VVFAT".
2233 # (since 2.4)
2234 # @rw: whether to allow write operations (default: false)
2235 #
2236 # Since: 2.9
2237 ##
2238 { 'struct': 'BlockdevOptionsVVFAT',
2239 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
2240 '*label': 'str', '*rw': 'bool' } }
2241
2242 ##
2243 # @BlockdevOptionsGenericFormat:
2244 #
2245 # Driver specific block device options for image format that have no option
2246 # besides their data source.
2247 #
2248 # @file: reference to or definition of the data source block device
2249 #
2250 # Since: 2.9
2251 ##
2252 { 'struct': 'BlockdevOptionsGenericFormat',
2253 'data': { 'file': 'BlockdevRef' } }
2254
2255 ##
2256 # @BlockdevOptionsLUKS:
2257 #
2258 # Driver specific block device options for LUKS.
2259 #
2260 # @key-secret: the ID of a QCryptoSecret object providing
2261 # the decryption key (since 2.6). Mandatory except when
2262 # doing a metadata-only probe of the image.
2263 #
2264 # Since: 2.9
2265 ##
2266 { 'struct': 'BlockdevOptionsLUKS',
2267 'base': 'BlockdevOptionsGenericFormat',
2268 'data': { '*key-secret': 'str' } }
2269
2270
2271 ##
2272 # @BlockdevOptionsGenericCOWFormat:
2273 #
2274 # Driver specific block device options for image format that have no option
2275 # besides their data source and an optional backing file.
2276 #
2277 # @backing: reference to or definition of the backing file block
2278 # device (if missing, taken from the image file content). It is
2279 # allowed to pass an empty string here in order to disable the
2280 # default backing file.
2281 #
2282 # Since: 2.9
2283 ##
2284 { 'struct': 'BlockdevOptionsGenericCOWFormat',
2285 'base': 'BlockdevOptionsGenericFormat',
2286 'data': { '*backing': 'BlockdevRef' } }
2287
2288 ##
2289 # @Qcow2OverlapCheckMode:
2290 #
2291 # General overlap check modes.
2292 #
2293 # @none: Do not perform any checks
2294 #
2295 # @constant: Perform only checks which can be done in constant time and
2296 # without reading anything from disk
2297 #
2298 # @cached: Perform only checks which can be done without reading anything
2299 # from disk
2300 #
2301 # @all: Perform all available overlap checks
2302 #
2303 # Since: 2.9
2304 ##
2305 { 'enum': 'Qcow2OverlapCheckMode',
2306 'data': [ 'none', 'constant', 'cached', 'all' ] }
2307
2308 ##
2309 # @Qcow2OverlapCheckFlags:
2310 #
2311 # Structure of flags for each metadata structure. Setting a field to 'true'
2312 # makes qemu guard that structure against unintended overwriting. The default
2313 # value is chosen according to the template given.
2314 #
2315 # @template: Specifies a template mode which can be adjusted using the other
2316 # flags, defaults to 'cached'
2317 #
2318 # Since: 2.9
2319 ##
2320 { 'struct': 'Qcow2OverlapCheckFlags',
2321 'data': { '*template': 'Qcow2OverlapCheckMode',
2322 '*main-header': 'bool',
2323 '*active-l1': 'bool',
2324 '*active-l2': 'bool',
2325 '*refcount-table': 'bool',
2326 '*refcount-block': 'bool',
2327 '*snapshot-table': 'bool',
2328 '*inactive-l1': 'bool',
2329 '*inactive-l2': 'bool' } }
2330
2331 ##
2332 # @Qcow2OverlapChecks:
2333 #
2334 # Specifies which metadata structures should be guarded against unintended
2335 # overwriting.
2336 #
2337 # @flags: set of flags for separate specification of each metadata structure
2338 # type
2339 #
2340 # @mode: named mode which chooses a specific set of flags
2341 #
2342 # Since: 2.9
2343 ##
2344 { 'alternate': 'Qcow2OverlapChecks',
2345 'data': { 'flags': 'Qcow2OverlapCheckFlags',
2346 'mode': 'Qcow2OverlapCheckMode' } }
2347
2348 ##
2349 # @BlockdevQcowEncryptionFormat:
2350 #
2351 # @aes: AES-CBC with plain64 initialization vectors
2352 #
2353 # Since: 2.10
2354 ##
2355 { 'enum': 'BlockdevQcowEncryptionFormat',
2356 'data': [ 'aes' ] }
2357
2358 ##
2359 # @BlockdevQcowEncryption:
2360 #
2361 # Since: 2.10
2362 ##
2363 { 'union': 'BlockdevQcowEncryption',
2364 'base': { 'format': 'BlockdevQcowEncryptionFormat' },
2365 'discriminator': 'format',
2366 'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
2367
2368 ##
2369 # @BlockdevOptionsQcow:
2370 #
2371 # Driver specific block device options for qcow.
2372 #
2373 # @encrypt: Image decryption options. Mandatory for
2374 # encrypted images, except when doing a metadata-only
2375 # probe of the image.
2376 #
2377 # Since: 2.10
2378 ##
2379 { 'struct': 'BlockdevOptionsQcow',
2380 'base': 'BlockdevOptionsGenericCOWFormat',
2381 'data': { '*encrypt': 'BlockdevQcowEncryption' } }
2382
2383
2384
2385 ##
2386 # @BlockdevQcow2EncryptionFormat:
2387 # @aes: AES-CBC with plain64 initialization venctors
2388 #
2389 # Since: 2.10
2390 ##
2391 { 'enum': 'BlockdevQcow2EncryptionFormat',
2392 'data': [ 'aes', 'luks' ] }
2393
2394 ##
2395 # @BlockdevQcow2Encryption:
2396 #
2397 # Since: 2.10
2398 ##
2399 { 'union': 'BlockdevQcow2Encryption',
2400 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
2401 'discriminator': 'format',
2402 'data': { 'aes': 'QCryptoBlockOptionsQCow',
2403 'luks': 'QCryptoBlockOptionsLUKS'} }
2404
2405 ##
2406 # @BlockdevOptionsQcow2:
2407 #
2408 # Driver specific block device options for qcow2.
2409 #
2410 # @lazy-refcounts: whether to enable the lazy refcounts
2411 # feature (default is taken from the image file)
2412 #
2413 # @pass-discard-request: whether discard requests to the qcow2
2414 # device should be forwarded to the data source
2415 #
2416 # @pass-discard-snapshot: whether discard requests for the data source
2417 # should be issued when a snapshot operation (e.g.
2418 # deleting a snapshot) frees clusters in the qcow2 file
2419 #
2420 # @pass-discard-other: whether discard requests for the data source
2421 # should be issued on other occasions where a cluster
2422 # gets freed
2423 #
2424 # @overlap-check: which overlap checks to perform for writes
2425 # to the image, defaults to 'cached' (since 2.2)
2426 #
2427 # @cache-size: the maximum total size of the L2 table and
2428 # refcount block caches in bytes (since 2.2)
2429 #
2430 # @l2-cache-size: the maximum size of the L2 table cache in
2431 # bytes (since 2.2)
2432 #
2433 # @refcount-cache-size: the maximum size of the refcount block cache
2434 # in bytes (since 2.2)
2435 #
2436 # @cache-clean-interval: clean unused entries in the L2 and refcount
2437 # caches. The interval is in seconds. The default value
2438 # is 0 and it disables this feature (since 2.5)
2439 # @encrypt: Image decryption options. Mandatory for
2440 # encrypted images, except when doing a metadata-only
2441 # probe of the image. (since 2.10)
2442 #
2443 # Since: 2.9
2444 ##
2445 { 'struct': 'BlockdevOptionsQcow2',
2446 'base': 'BlockdevOptionsGenericCOWFormat',
2447 'data': { '*lazy-refcounts': 'bool',
2448 '*pass-discard-request': 'bool',
2449 '*pass-discard-snapshot': 'bool',
2450 '*pass-discard-other': 'bool',
2451 '*overlap-check': 'Qcow2OverlapChecks',
2452 '*cache-size': 'int',
2453 '*l2-cache-size': 'int',
2454 '*refcount-cache-size': 'int',
2455 '*cache-clean-interval': 'int',
2456 '*encrypt': 'BlockdevQcow2Encryption' } }
2457
2458 ##
2459 # @BlockdevOptionsSsh:
2460 #
2461 # @server: host address
2462 #
2463 # @path: path to the image on the host
2464 #
2465 # @user: user as which to connect, defaults to current
2466 # local user name
2467 #
2468 # TODO: Expose the host_key_check option in QMP
2469 #
2470 # Since: 2.9
2471 ##
2472 { 'struct': 'BlockdevOptionsSsh',
2473 'data': { 'server': 'InetSocketAddress',
2474 'path': 'str',
2475 '*user': 'str' } }
2476
2477
2478 ##
2479 # @BlkdebugEvent:
2480 #
2481 # Trigger events supported by blkdebug.
2482 #
2483 # Since: 2.9
2484 ##
2485 { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
2486 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
2487 'l1_grow_activate_table', 'l2_load', 'l2_update',
2488 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write',
2489 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
2490 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
2491 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
2492 'refblock_load', 'refblock_update', 'refblock_update_part',
2493 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write',
2494 'refblock_alloc_write_blocks', 'refblock_alloc_write_table',
2495 'refblock_alloc_switch_table', 'cluster_alloc',
2496 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
2497 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head',
2498 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev',
2499 'pwritev_zero', 'pwritev_done', 'empty_image_prepare' ] }
2500
2501 ##
2502 # @BlkdebugInjectErrorOptions:
2503 #
2504 # Describes a single error injection for blkdebug.
2505 #
2506 # @event: trigger event
2507 #
2508 # @state: the state identifier blkdebug needs to be in to
2509 # actually trigger the event; defaults to "any"
2510 #
2511 # @errno: error identifier (errno) to be returned; defaults to
2512 # EIO
2513 #
2514 # @sector: specifies the sector index which has to be affected
2515 # in order to actually trigger the event; defaults to "any
2516 # sector"
2517 #
2518 # @once: disables further events after this one has been
2519 # triggered; defaults to false
2520 #
2521 # @immediately: fail immediately; defaults to false
2522 #
2523 # Since: 2.9
2524 ##
2525 { 'struct': 'BlkdebugInjectErrorOptions',
2526 'data': { 'event': 'BlkdebugEvent',
2527 '*state': 'int',
2528 '*errno': 'int',
2529 '*sector': 'int',
2530 '*once': 'bool',
2531 '*immediately': 'bool' } }
2532
2533 ##
2534 # @BlkdebugSetStateOptions:
2535 #
2536 # Describes a single state-change event for blkdebug.
2537 #
2538 # @event: trigger event
2539 #
2540 # @state: the current state identifier blkdebug needs to be in;
2541 # defaults to "any"
2542 #
2543 # @new_state: the state identifier blkdebug is supposed to assume if
2544 # this event is triggered
2545 #
2546 # Since: 2.9
2547 ##
2548 { 'struct': 'BlkdebugSetStateOptions',
2549 'data': { 'event': 'BlkdebugEvent',
2550 '*state': 'int',
2551 'new_state': 'int' } }
2552
2553 ##
2554 # @BlockdevOptionsBlkdebug:
2555 #
2556 # Driver specific block device options for blkdebug.
2557 #
2558 # @image: underlying raw block device (or image file)
2559 #
2560 # @config: filename of the configuration file
2561 #
2562 # @align: required alignment for requests in bytes, must be
2563 # positive power of 2, or 0 for default
2564 #
2565 # @max-transfer: maximum size for I/O transfers in bytes, must be
2566 # positive multiple of @align and of the underlying
2567 # file's request alignment (but need not be a power of
2568 # 2), or 0 for default (since 2.10)
2569 #
2570 # @opt-write-zero: preferred alignment for write zero requests in bytes,
2571 # must be positive multiple of @align and of the
2572 # underlying file's request alignment (but need not be a
2573 # power of 2), or 0 for default (since 2.10)
2574 #
2575 # @max-write-zero: maximum size for write zero requests in bytes, must be
2576 # positive multiple of @align, of @opt-write-zero, and of
2577 # the underlying file's request alignment (but need not
2578 # be a power of 2), or 0 for default (since 2.10)
2579 #
2580 # @opt-discard: preferred alignment for discard requests in bytes, must
2581 # be positive multiple of @align and of the underlying
2582 # file's request alignment (but need not be a power of
2583 # 2), or 0 for default (since 2.10)
2584 #
2585 # @max-discard: maximum size for discard requests in bytes, must be
2586 # positive multiple of @align, of @opt-discard, and of
2587 # the underlying file's request alignment (but need not
2588 # be a power of 2), or 0 for default (since 2.10)
2589 #
2590 # @inject-error: array of error injection descriptions
2591 #
2592 # @set-state: array of state-change descriptions
2593 #
2594 # Since: 2.9
2595 ##
2596 { 'struct': 'BlockdevOptionsBlkdebug',
2597 'data': { 'image': 'BlockdevRef',
2598 '*config': 'str',
2599 '*align': 'int', '*max-transfer': 'int32',
2600 '*opt-write-zero': 'int32', '*max-write-zero': 'int32',
2601 '*opt-discard': 'int32', '*max-discard': 'int32',
2602 '*inject-error': ['BlkdebugInjectErrorOptions'],
2603 '*set-state': ['BlkdebugSetStateOptions'] } }
2604
2605 ##
2606 # @BlockdevOptionsBlkverify:
2607 #
2608 # Driver specific block device options for blkverify.
2609 #
2610 # @test: block device to be tested
2611 #
2612 # @raw: raw image used for verification
2613 #
2614 # Since: 2.9
2615 ##
2616 { 'struct': 'BlockdevOptionsBlkverify',
2617 'data': { 'test': 'BlockdevRef',
2618 'raw': 'BlockdevRef' } }
2619
2620 ##
2621 # @QuorumReadPattern:
2622 #
2623 # An enumeration of quorum read patterns.
2624 #
2625 # @quorum: read all the children and do a quorum vote on reads
2626 #
2627 # @fifo: read only from the first child that has not failed
2628 #
2629 # Since: 2.9
2630 ##
2631 { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
2632
2633 ##
2634 # @BlockdevOptionsQuorum:
2635 #
2636 # Driver specific block device options for Quorum
2637 #
2638 # @blkverify: true if the driver must print content mismatch
2639 # set to false by default
2640 #
2641 # @children: the children block devices to use
2642 #
2643 # @vote-threshold: the vote limit under which a read will fail
2644 #
2645 # @rewrite-corrupted: rewrite corrupted data when quorum is reached
2646 # (Since 2.1)
2647 #
2648 # @read-pattern: choose read pattern and set to quorum by default
2649 # (Since 2.2)
2650 #
2651 # Since: 2.9
2652 ##
2653 { 'struct': 'BlockdevOptionsQuorum',
2654 'data': { '*blkverify': 'bool',
2655 'children': [ 'BlockdevRef' ],
2656 'vote-threshold': 'int',
2657 '*rewrite-corrupted': 'bool',
2658 '*read-pattern': 'QuorumReadPattern' } }
2659
2660 ##
2661 # @BlockdevOptionsGluster:
2662 #
2663 # Driver specific block device options for Gluster
2664 #
2665 # @volume: name of gluster volume where VM image resides
2666 #
2667 # @path: absolute path to image file in gluster volume
2668 #
2669 # @server: gluster servers description
2670 #
2671 # @debug: libgfapi log level (default '4' which is Error)
2672 # (Since 2.8)
2673 #
2674 # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8)
2675 #
2676 # Since: 2.9
2677 ##
2678 { 'struct': 'BlockdevOptionsGluster',
2679 'data': { 'volume': 'str',
2680 'path': 'str',
2681 'server': ['SocketAddress'],
2682 '*debug': 'int',
2683 '*logfile': 'str' } }
2684
2685 ##
2686 # @IscsiTransport:
2687 #
2688 # An enumeration of libiscsi transport types
2689 #
2690 # Since: 2.9
2691 ##
2692 { 'enum': 'IscsiTransport',
2693 'data': [ 'tcp', 'iser' ] }
2694
2695 ##
2696 # @IscsiHeaderDigest:
2697 #
2698 # An enumeration of header digests supported by libiscsi
2699 #
2700 # Since: 2.9
2701 ##
2702 { 'enum': 'IscsiHeaderDigest',
2703 'prefix': 'QAPI_ISCSI_HEADER_DIGEST',
2704 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] }
2705
2706 ##
2707 # @BlockdevOptionsIscsi:
2708 #
2709 # @transport: The iscsi transport type
2710 #
2711 # @portal: The address of the iscsi portal
2712 #
2713 # @target: The target iqn name
2714 #
2715 # @lun: LUN to connect to. Defaults to 0.
2716 #
2717 # @user: User name to log in with. If omitted, no CHAP
2718 # authentication is performed.
2719 #
2720 # @password-secret: The ID of a QCryptoSecret object providing
2721 # the password for the login. This option is required if
2722 # @user is specified.
2723 #
2724 # @initiator-name: The iqn name we want to identify to the target
2725 # as. If this option is not specified, an initiator name is
2726 # generated automatically.
2727 #
2728 # @header-digest: The desired header digest. Defaults to
2729 # none-crc32c.
2730 #
2731 # @timeout: Timeout in seconds after which a request will
2732 # timeout. 0 means no timeout and is the default.
2733 #
2734 # Driver specific block device options for iscsi
2735 #
2736 # Since: 2.9
2737 ##
2738 { 'struct': 'BlockdevOptionsIscsi',
2739 'data': { 'transport': 'IscsiTransport',
2740 'portal': 'str',
2741 'target': 'str',
2742 '*lun': 'int',
2743 '*user': 'str',
2744 '*password-secret': 'str',
2745 '*initiator-name': 'str',
2746 '*header-digest': 'IscsiHeaderDigest',
2747 '*timeout': 'int' } }
2748
2749
2750 ##
2751 # @BlockdevOptionsRbd:
2752 #
2753 # @pool: Ceph pool name.
2754 #
2755 # @image: Image name in the Ceph pool.
2756 #
2757 # @conf: path to Ceph configuration file. Values
2758 # in the configuration file will be overridden by
2759 # options specified via QAPI.
2760 #
2761 # @snapshot: Ceph snapshot name.
2762 #
2763 # @user: Ceph id name.
2764 #
2765 # @server: Monitor host address and port. This maps
2766 # to the "mon_host" Ceph option.
2767 #
2768 # Since: 2.9
2769 ##
2770 { 'struct': 'BlockdevOptionsRbd',
2771 'data': { 'pool': 'str',
2772 'image': 'str',
2773 '*conf': 'str',
2774 '*snapshot': 'str',
2775 '*user': 'str',
2776 '*server': ['InetSocketAddressBase'] } }
2777
2778 ##
2779 # @BlockdevOptionsSheepdog:
2780 #
2781 # Driver specific block device options for sheepdog
2782 #
2783 # @vdi: Virtual disk image name
2784 # @server: The Sheepdog server to connect to
2785 # @snap-id: Snapshot ID
2786 # @tag: Snapshot tag name
2787 #
2788 # Only one of @snap-id and @tag may be present.
2789 #
2790 # Since: 2.9
2791 ##
2792 { 'struct': 'BlockdevOptionsSheepdog',
2793 'data': { 'server': 'SocketAddress',
2794 'vdi': 'str',
2795 '*snap-id': 'uint32',
2796 '*tag': 'str' } }
2797
2798 ##
2799 # @ReplicationMode:
2800 #
2801 # An enumeration of replication modes.
2802 #
2803 # @primary: Primary mode, the vm's state will be sent to secondary QEMU.
2804 #
2805 # @secondary: Secondary mode, receive the vm's state from primary QEMU.
2806 #
2807 # Since: 2.9
2808 ##
2809 { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
2810
2811 ##
2812 # @BlockdevOptionsReplication:
2813 #
2814 # Driver specific block device options for replication
2815 #
2816 # @mode: the replication mode
2817 #
2818 # @top-id: In secondary mode, node name or device ID of the root
2819 # node who owns the replication node chain. Must not be given in
2820 # primary mode.
2821 #
2822 # Since: 2.9
2823 ##
2824 { 'struct': 'BlockdevOptionsReplication',
2825 'base': 'BlockdevOptionsGenericFormat',
2826 'data': { 'mode': 'ReplicationMode',
2827 '*top-id': 'str' } }
2828
2829 ##
2830 # @NFSTransport:
2831 #
2832 # An enumeration of NFS transport types
2833 #
2834 # @inet: TCP transport
2835 #
2836 # Since: 2.9
2837 ##
2838 { 'enum': 'NFSTransport',
2839 'data': [ 'inet' ] }
2840
2841 ##
2842 # @NFSServer:
2843 #
2844 # Captures the address of the socket
2845 #
2846 # @type: transport type used for NFS (only TCP supported)
2847 #
2848 # @host: host address for NFS server
2849 #
2850 # Since: 2.9
2851 ##
2852 { 'struct': 'NFSServer',
2853 'data': { 'type': 'NFSTransport',
2854 'host': 'str' } }
2855
2856 ##
2857 # @BlockdevOptionsNfs:
2858 #
2859 # Driver specific block device option for NFS
2860 #
2861 # @server: host address
2862 #
2863 # @path: path of the image on the host
2864 #
2865 # @user: UID value to use when talking to the
2866 # server (defaults to 65534 on Windows and getuid()
2867 # on unix)
2868 #
2869 # @group: GID value to use when talking to the
2870 # server (defaults to 65534 on Windows and getgid()
2871 # in unix)
2872 #
2873 # @tcp-syn-count: number of SYNs during the session
2874 # establishment (defaults to libnfs default)
2875 #
2876 # @readahead-size: set the readahead size in bytes (defaults
2877 # to libnfs default)
2878 #
2879 # @page-cache-size: set the pagecache size in bytes (defaults
2880 # to libnfs default)
2881 #
2882 # @debug: set the NFS debug level (max 2) (defaults
2883 # to libnfs default)
2884 #
2885 # Since: 2.9
2886 ##
2887 { 'struct': 'BlockdevOptionsNfs',
2888 'data': { 'server': 'NFSServer',
2889 'path': 'str',
2890 '*user': 'int',
2891 '*group': 'int',
2892 '*tcp-syn-count': 'int',
2893 '*readahead-size': 'int',
2894 '*page-cache-size': 'int',
2895 '*debug': 'int' } }
2896
2897 ##
2898 # @BlockdevOptionsCurlBase:
2899 #
2900 # Driver specific block device options shared by all protocols supported by the
2901 # curl backend.
2902 #
2903 # @url: URL of the image file
2904 #
2905 # @readahead: Size of the read-ahead cache; must be a multiple of
2906 # 512 (defaults to 256 kB)
2907 #
2908 # @timeout: Timeout for connections, in seconds (defaults to 5)
2909 #
2910 # @username: Username for authentication (defaults to none)
2911 #
2912 # @password-secret: ID of a QCryptoSecret object providing a password
2913 # for authentication (defaults to no password)
2914 #
2915 # @proxy-username: Username for proxy authentication (defaults to none)
2916 #
2917 # @proxy-password-secret: ID of a QCryptoSecret object providing a password
2918 # for proxy authentication (defaults to no password)
2919 #
2920 # Since: 2.9
2921 ##
2922 { 'struct': 'BlockdevOptionsCurlBase',
2923 'data': { 'url': 'str',
2924 '*readahead': 'int',
2925 '*timeout': 'int',
2926 '*username': 'str',
2927 '*password-secret': 'str',
2928 '*proxy-username': 'str',
2929 '*proxy-password-secret': 'str' } }
2930
2931 ##
2932 # @BlockdevOptionsCurlHttp:
2933 #
2934 # Driver specific block device options for HTTP connections over the curl
2935 # backend. URLs must start with "http://".
2936 #
2937 # @cookie: List of cookies to set; format is
2938 # "name1=content1; name2=content2;" as explained by
2939 # CURLOPT_COOKIE(3). Defaults to no cookies.
2940 #
2941 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
2942 # secure way. See @cookie for the format. (since 2.10)
2943 #
2944 # Since: 2.9
2945 ##
2946 { 'struct': 'BlockdevOptionsCurlHttp',
2947 'base': 'BlockdevOptionsCurlBase',
2948 'data': { '*cookie': 'str',
2949 '*cookie-secret': 'str'} }
2950
2951 ##
2952 # @BlockdevOptionsCurlHttps:
2953 #
2954 # Driver specific block device options for HTTPS connections over the curl
2955 # backend. URLs must start with "https://".
2956 #
2957 # @cookie: List of cookies to set; format is
2958 # "name1=content1; name2=content2;" as explained by
2959 # CURLOPT_COOKIE(3). Defaults to no cookies.
2960 #
2961 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
2962 # true)
2963 #
2964 # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a
2965 # secure way. See @cookie for the format. (since 2.10)
2966 #
2967 # Since: 2.9
2968 ##
2969 { 'struct': 'BlockdevOptionsCurlHttps',
2970 'base': 'BlockdevOptionsCurlBase',
2971 'data': { '*cookie': 'str',
2972 '*sslverify': 'bool',
2973 '*cookie-secret': 'str'} }
2974
2975 ##
2976 # @BlockdevOptionsCurlFtp:
2977 #
2978 # Driver specific block device options for FTP connections over the curl
2979 # backend. URLs must start with "ftp://".
2980 #
2981 # Since: 2.9
2982 ##
2983 { 'struct': 'BlockdevOptionsCurlFtp',
2984 'base': 'BlockdevOptionsCurlBase',
2985 'data': { } }
2986
2987 ##
2988 # @BlockdevOptionsCurlFtps:
2989 #
2990 # Driver specific block device options for FTPS connections over the curl
2991 # backend. URLs must start with "ftps://".
2992 #
2993 # @sslverify: Whether to verify the SSL certificate's validity (defaults to
2994 # true)
2995 #
2996 # Since: 2.9
2997 ##
2998 { 'struct': 'BlockdevOptionsCurlFtps',
2999 'base': 'BlockdevOptionsCurlBase',
3000 'data': { '*sslverify': 'bool' } }
3001
3002 ##
3003 # @BlockdevOptionsNbd:
3004 #
3005 # Driver specific block device options for NBD.
3006 #
3007 # @server: NBD server address
3008 #
3009 # @export: export name
3010 #
3011 # @tls-creds: TLS credentials ID
3012 #
3013 # Since: 2.9
3014 ##
3015 { 'struct': 'BlockdevOptionsNbd',
3016 'data': { 'server': 'SocketAddress',
3017 '*export': 'str',
3018 '*tls-creds': 'str' } }
3019
3020 ##
3021 # @BlockdevOptionsRaw:
3022 #
3023 # Driver specific block device options for the raw driver.
3024 #
3025 # @offset: position where the block device starts
3026 # @size: the assumed size of the device
3027 #
3028 # Since: 2.9
3029 ##
3030 { 'struct': 'BlockdevOptionsRaw',
3031 'base': 'BlockdevOptionsGenericFormat',
3032 'data': { '*offset': 'int', '*size': 'int' } }
3033
3034 ##
3035 # @BlockdevOptionsVxHS:
3036 #
3037 # Driver specific block device options for VxHS
3038 #
3039 # @vdisk-id: UUID of VxHS volume
3040 # @server: vxhs server IP, port
3041 # @tls-creds: TLS credentials ID
3042 #
3043 # Since: 2.10
3044 ##
3045 { 'struct': 'BlockdevOptionsVxHS',
3046 'data': { 'vdisk-id': 'str',
3047 'server': 'InetSocketAddressBase',
3048 '*tls-creds': 'str' } }
3049
3050 ##
3051 # @BlockdevOptions:
3052 #
3053 # Options for creating a block device. Many options are available for all
3054 # block devices, independent of the block driver:
3055 #
3056 # @driver: block driver name
3057 # @node-name: the node name of the new node (Since 2.0).
3058 # This option is required on the top level of blockdev-add.
3059 # @discard: discard-related options (default: ignore)
3060 # @cache: cache-related options
3061 # @read-only: whether the block device should be read-only
3062 # (default: false)
3063 # @detect-zeroes: detect and optimize zero writes (Since 2.1)
3064 # (default: off)
3065 # @force-share: force share all permission on added nodes.
3066 # Requires read-only=true. (Since 2.10)
3067 #
3068 # Remaining options are determined by the block driver.
3069 #
3070 # Since: 2.9
3071 ##
3072 { 'union': 'BlockdevOptions',
3073 'base': { 'driver': 'BlockdevDriver',
3074 '*node-name': 'str',
3075 '*discard': 'BlockdevDiscardOptions',
3076 '*cache': 'BlockdevCacheOptions',
3077 '*read-only': 'bool',
3078 '*force-share': 'bool',
3079 '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
3080 'discriminator': 'driver',
3081 'data': {
3082 'blkdebug': 'BlockdevOptionsBlkdebug',
3083 'blkverify': 'BlockdevOptionsBlkverify',
3084 'bochs': 'BlockdevOptionsGenericFormat',
3085 'cloop': 'BlockdevOptionsGenericFormat',
3086 'dmg': 'BlockdevOptionsGenericFormat',
3087 'file': 'BlockdevOptionsFile',
3088 'ftp': 'BlockdevOptionsCurlFtp',
3089 'ftps': 'BlockdevOptionsCurlFtps',
3090 'gluster': 'BlockdevOptionsGluster',
3091 'host_cdrom': 'BlockdevOptionsFile',
3092 'host_device':'BlockdevOptionsFile',
3093 'http': 'BlockdevOptionsCurlHttp',
3094 'https': 'BlockdevOptionsCurlHttps',
3095 'iscsi': 'BlockdevOptionsIscsi',
3096 'luks': 'BlockdevOptionsLUKS',
3097 'nbd': 'BlockdevOptionsNbd',
3098 'nfs': 'BlockdevOptionsNfs',
3099 'null-aio': 'BlockdevOptionsNull',
3100 'null-co': 'BlockdevOptionsNull',
3101 'parallels': 'BlockdevOptionsGenericFormat',
3102 'qcow2': 'BlockdevOptionsQcow2',
3103 'qcow': 'BlockdevOptionsQcow',
3104 'qed': 'BlockdevOptionsGenericCOWFormat',
3105 'quorum': 'BlockdevOptionsQuorum',
3106 'raw': 'BlockdevOptionsRaw',
3107 'rbd': 'BlockdevOptionsRbd',
3108 'replication':'BlockdevOptionsReplication',
3109 'sheepdog': 'BlockdevOptionsSheepdog',
3110 'ssh': 'BlockdevOptionsSsh',
3111 'vdi': 'BlockdevOptionsGenericFormat',
3112 'vhdx': 'BlockdevOptionsGenericFormat',
3113 'vmdk': 'BlockdevOptionsGenericCOWFormat',
3114 'vpc': 'BlockdevOptionsGenericFormat',
3115 'vvfat': 'BlockdevOptionsVVFAT',
3116 'vxhs': 'BlockdevOptionsVxHS'
3117 } }
3118
3119 ##
3120 # @BlockdevRef:
3121 #
3122 # Reference to a block device.
3123 #
3124 # @definition: defines a new block device inline
3125 # @reference: references the ID of an existing block device. An
3126 # empty string means that no block device should be
3127 # referenced.
3128 #
3129 # Since: 2.9
3130 ##
3131 { 'alternate': 'BlockdevRef',
3132 'data': { 'definition': 'BlockdevOptions',
3133 'reference': 'str' } }
3134
3135 ##
3136 # @blockdev-add:
3137 #
3138 # Creates a new block device. If the @id option is given at the top level, a
3139 # BlockBackend will be created; otherwise, @node-name is mandatory at the top
3140 # level and no BlockBackend will be created.
3141 #
3142 # Since: 2.9
3143 #
3144 # Example:
3145 #
3146 # 1.
3147 # -> { "execute": "blockdev-add",
3148 # "arguments": {
3149 # "driver": "qcow2",
3150 # "node-name": "test1",
3151 # "file": {
3152 # "driver": "file",
3153 # "filename": "test.qcow2"
3154 # }
3155 # }
3156 # }
3157 # <- { "return": {} }
3158 #
3159 # 2.
3160 # -> { "execute": "blockdev-add",
3161 # "arguments": {
3162 # "driver": "qcow2",
3163 # "node-name": "node0",
3164 # "discard": "unmap",
3165 # "cache": {
3166 # "direct": true
3167 # },
3168 # "file": {
3169 # "driver": "file",
3170 # "filename": "/tmp/test.qcow2"
3171 # },
3172 # "backing": {
3173 # "driver": "raw",
3174 # "file": {
3175 # "driver": "file",
3176 # "filename": "/dev/fdset/4"
3177 # }
3178 # }
3179 # }
3180 # }
3181 #
3182 # <- { "return": {} }
3183 #
3184 ##
3185 { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
3186
3187 ##
3188 # @blockdev-del:
3189 #
3190 # Deletes a block device that has been added using blockdev-add.
3191 # The command will fail if the node is attached to a device or is
3192 # otherwise being used.
3193 #
3194 # @node-name: Name of the graph node to delete.
3195 #
3196 # Since: 2.9
3197 #
3198 # Example:
3199 #
3200 # -> { "execute": "blockdev-add",
3201 # "arguments": {
3202 # "driver": "qcow2",
3203 # "node-name": "node0",
3204 # "file": {
3205 # "driver": "file",
3206 # "filename": "test.qcow2"
3207 # }
3208 # }
3209 # }
3210 # <- { "return": {} }
3211 #
3212 # -> { "execute": "blockdev-del",
3213 # "arguments": { "node-name": "node0" }
3214 # }
3215 # <- { "return": {} }
3216 #
3217 ##
3218 { 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
3219
3220 ##
3221 # @blockdev-open-tray:
3222 #
3223 # Opens a block device's tray. If there is a block driver state tree inserted as
3224 # a medium, it will become inaccessible to the guest (but it will remain
3225 # associated to the block device, so closing the tray will make it accessible
3226 # again).
3227 #
3228 # If the tray was already open before, this will be a no-op.
3229 #
3230 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
3231 # which no such event will be generated, these include:
3232 # - if the guest has locked the tray, @force is false and the guest does not
3233 # respond to the eject request
3234 # - if the BlockBackend denoted by @device does not have a guest device attached
3235 # to it
3236 # - if the guest device does not have an actual tray
3237 #
3238 # @device: Block device name (deprecated, use @id instead)
3239 #
3240 # @id: The name or QOM path of the guest device (since: 2.8)
3241 #
3242 # @force: if false (the default), an eject request will be sent to
3243 # the guest if it has locked the tray (and the tray will not be opened
3244 # immediately); if true, the tray will be opened regardless of whether
3245 # it is locked
3246 #
3247 # Since: 2.5
3248 #
3249 # Example:
3250 #
3251 # -> { "execute": "blockdev-open-tray",
3252 # "arguments": { "id": "ide0-1-0" } }
3253 #
3254 # <- { "timestamp": { "seconds": 1418751016,
3255 # "microseconds": 716996 },
3256 # "event": "DEVICE_TRAY_MOVED",
3257 # "data": { "device": "ide1-cd0",
3258 # "id": "ide0-1-0",
3259 # "tray-open": true } }
3260 #
3261 # <- { "return": {} }
3262 #
3263 ##
3264 { 'command': 'blockdev-open-tray',
3265 'data': { '*device': 'str',
3266 '*id': 'str',
3267 '*force': 'bool' } }
3268
3269 ##
3270 # @blockdev-close-tray:
3271 #
3272 # Closes a block device's tray. If there is a block driver state tree associated
3273 # with the block device (which is currently ejected), that tree will be loaded
3274 # as the medium.
3275 #
3276 # If the tray was already closed before, this will be a no-op.
3277 #
3278 # @device: Block device name (deprecated, use @id instead)
3279 #
3280 # @id: The name or QOM path of the guest device (since: 2.8)
3281 #
3282 # Since: 2.5
3283 #
3284 # Example:
3285 #
3286 # -> { "execute": "blockdev-close-tray",
3287 # "arguments": { "id": "ide0-1-0" } }
3288 #
3289 # <- { "timestamp": { "seconds": 1418751345,
3290 # "microseconds": 272147 },
3291 # "event": "DEVICE_TRAY_MOVED",
3292 # "data": { "device": "ide1-cd0",
3293 # "id": "ide0-1-0",
3294 # "tray-open": false } }
3295 #
3296 # <- { "return": {} }
3297 #
3298 ##
3299 { 'command': 'blockdev-close-tray',
3300 'data': { '*device': 'str',
3301 '*id': 'str' } }
3302
3303 ##
3304 # @x-blockdev-remove-medium:
3305 #
3306 # Removes a medium (a block driver state tree) from a block device. That block
3307 # device's tray must currently be open (unless there is no attached guest
3308 # device).
3309 #
3310 # If the tray is open and there is no medium inserted, this will be a no-op.
3311 #
3312 # @device: Block device name (deprecated, use @id instead)
3313 #
3314 # @id: The name or QOM path of the guest device (since: 2.8)
3315 #
3316 # Note: This command is still a work in progress and is considered experimental.
3317 # Stay away from it unless you want to help with its development.
3318 #
3319 # Since: 2.5
3320 #
3321 # Example:
3322 #
3323 # -> { "execute": "x-blockdev-remove-medium",
3324 # "arguments": { "id": "ide0-1-0" } }
3325 #
3326 # <- { "error": { "class": "GenericError",
3327 # "desc": "Tray of device 'ide0-1-0' is not open" } }
3328 #
3329 # -> { "execute": "blockdev-open-tray",
3330 # "arguments": { "id": "ide0-1-0" } }
3331 #
3332 # <- { "timestamp": { "seconds": 1418751627,
3333 # "microseconds": 549958 },
3334 # "event": "DEVICE_TRAY_MOVED",
3335 # "data": { "device": "ide1-cd0",
3336 # "id": "ide0-1-0",
3337 # "tray-open": true } }
3338 #
3339 # <- { "return": {} }
3340 #
3341 # -> { "execute": "x-blockdev-remove-medium",
3342 # "arguments": { "id": "ide0-1-0" } }
3343 #
3344 # <- { "return": {} }
3345 #
3346 ##
3347 { 'command': 'x-blockdev-remove-medium',
3348 'data': { '*device': 'str',
3349 '*id': 'str' } }
3350
3351 ##
3352 # @x-blockdev-insert-medium:
3353 #
3354 # Inserts a medium (a block driver state tree) into a block device. That block
3355 # device's tray must currently be open (unless there is no attached guest
3356 # device) and there must be no medium inserted already.
3357 #
3358 # @device: Block device name (deprecated, use @id instead)
3359 #
3360 # @id: The name or QOM path of the guest device (since: 2.8)
3361 #
3362 # @node-name: name of a node in the block driver state graph
3363 #
3364 # Note: This command is still a work in progress and is considered experimental.
3365 # Stay away from it unless you want to help with its development.
3366 #
3367 # Since: 2.5
3368 #
3369 # Example:
3370 #
3371 # -> { "execute": "blockdev-add",
3372 # "arguments": {
3373 # "node-name": "node0",
3374 # "driver": "raw",
3375 # "file": { "driver": "file",
3376 # "filename": "fedora.iso" } } }
3377 # <- { "return": {} }
3378 #
3379 # -> { "execute": "x-blockdev-insert-medium",
3380 # "arguments": { "id": "ide0-1-0",
3381 # "node-name": "node0" } }
3382 #
3383 # <- { "return": {} }
3384 #
3385 ##
3386 { 'command': 'x-blockdev-insert-medium',
3387 'data': { '*device': 'str',
3388 '*id': 'str',
3389 'node-name': 'str'} }
3390
3391
3392 ##
3393 # @BlockdevChangeReadOnlyMode:
3394 #
3395 # Specifies the new read-only mode of a block device subject to the
3396 # @blockdev-change-medium command.
3397 #
3398 # @retain: Retains the current read-only mode
3399 #
3400 # @read-only: Makes the device read-only
3401 #
3402 # @read-write: Makes the device writable
3403 #
3404 # Since: 2.3
3405 #
3406 ##
3407 { 'enum': 'BlockdevChangeReadOnlyMode',
3408 'data': ['retain', 'read-only', 'read-write'] }
3409
3410
3411 ##
3412 # @blockdev-change-medium:
3413 #
3414 # Changes the medium inserted into a block device by ejecting the current medium
3415 # and loading a new image file which is inserted as the new medium (this command
3416 # combines blockdev-open-tray, x-blockdev-remove-medium,
3417 # x-blockdev-insert-medium and blockdev-close-tray).
3418 #
3419 # @device: Block device name (deprecated, use @id instead)
3420 #
3421 # @id: The name or QOM path of the guest device
3422 # (since: 2.8)
3423 #
3424 # @filename: filename of the new image to be loaded
3425 #
3426 # @format: format to open the new image with (defaults to
3427 # the probed format)
3428 #
3429 # @read-only-mode: change the read-only mode of the device; defaults
3430 # to 'retain'
3431 #
3432 # Since: 2.5
3433 #
3434 # Examples:
3435 #
3436 # 1. Change a removable medium
3437 #
3438 # -> { "execute": "blockdev-change-medium",
3439 # "arguments": { "id": "ide0-1-0",
3440 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
3441 # "format": "raw" } }
3442 # <- { "return": {} }
3443 #
3444 # 2. Load a read-only medium into a writable drive
3445 #
3446 # -> { "execute": "blockdev-change-medium",
3447 # "arguments": { "id": "floppyA",
3448 # "filename": "/srv/images/ro.img",
3449 # "format": "raw",
3450 # "read-only-mode": "retain" } }
3451 #
3452 # <- { "error":
3453 # { "class": "GenericError",
3454 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
3455 #
3456 # -> { "execute": "blockdev-change-medium",
3457 # "arguments": { "id": "floppyA",
3458 # "filename": "/srv/images/ro.img",
3459 # "format": "raw",
3460 # "read-only-mode": "read-only" } }
3461 #
3462 # <- { "return": {} }
3463 #
3464 ##
3465 { 'command': 'blockdev-change-medium',
3466 'data': { '*device': 'str',
3467 '*id': 'str',
3468 'filename': 'str',
3469 '*format': 'str',
3470 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
3471
3472
3473 ##
3474 # @BlockErrorAction:
3475 #
3476 # An enumeration of action that has been taken when a DISK I/O occurs
3477 #
3478 # @ignore: error has been ignored
3479 #
3480 # @report: error has been reported to the device
3481 #
3482 # @stop: error caused VM to be stopped
3483 #
3484 # Since: 2.1
3485 ##
3486 { 'enum': 'BlockErrorAction',
3487 'data': [ 'ignore', 'report', 'stop' ] }
3488
3489
3490 ##
3491 # @BLOCK_IMAGE_CORRUPTED:
3492 #
3493 # Emitted when a disk image is being marked corrupt. The image can be
3494 # identified by its device or node name. The 'device' field is always
3495 # present for compatibility reasons, but it can be empty ("") if the
3496 # image does not have a device name associated.
3497 #
3498 # @device: device name. This is always present for compatibility
3499 # reasons, but it can be empty ("") if the image does not
3500 # have a device name associated.
3501 #
3502 # @node-name: node name (Since: 2.4)
3503 #
3504 # @msg: informative message for human consumption, such as the kind of
3505 # corruption being detected. It should not be parsed by machine as it is
3506 # not guaranteed to be stable
3507 #
3508 # @offset: if the corruption resulted from an image access, this is
3509 # the host's access offset into the image
3510 #
3511 # @size: if the corruption resulted from an image access, this is
3512 # the access size
3513 #
3514 # @fatal: if set, the image is marked corrupt and therefore unusable after this
3515 # event and must be repaired (Since 2.2; before, every
3516 # BLOCK_IMAGE_CORRUPTED event was fatal)
3517 #
3518 # Note: If action is "stop", a STOP event will eventually follow the
3519 # BLOCK_IO_ERROR event.
3520 #
3521 # Example:
3522 #
3523 # <- { "event": "BLOCK_IMAGE_CORRUPTED",
3524 # "data": { "device": "ide0-hd0", "node-name": "node0",
3525 # "msg": "Prevented active L1 table overwrite", "offset": 196608,
3526 # "size": 65536 },
3527 # "timestamp": { "seconds": 1378126126, "microseconds": 966463 } }
3528 #
3529 # Since: 1.7
3530 ##
3531 { 'event': 'BLOCK_IMAGE_CORRUPTED',
3532 'data': { 'device' : 'str',
3533 '*node-name' : 'str',
3534 'msg' : 'str',
3535 '*offset' : 'int',
3536 '*size' : 'int',
3537 'fatal' : 'bool' } }
3538
3539 ##
3540 # @BLOCK_IO_ERROR:
3541 #
3542 # Emitted when a disk I/O error occurs
3543 #
3544 # @device: device name. This is always present for compatibility
3545 # reasons, but it can be empty ("") if the image does not
3546 # have a device name associated.
3547 #
3548 # @node-name: node name. Note that errors may be reported for the root node
3549 # that is directly attached to a guest device rather than for the
3550 # node where the error occurred. (Since: 2.8)
3551 #
3552 # @operation: I/O operation
3553 #
3554 # @action: action that has been taken
3555 #
3556 # @nospace: true if I/O error was caused due to a no-space
3557 # condition. This key is only present if query-block's
3558 # io-status is present, please see query-block documentation
3559 # for more information (since: 2.2)
3560 #
3561 # @reason: human readable string describing the error cause.
3562 # (This field is a debugging aid for humans, it should not
3563 # be parsed by applications) (since: 2.2)
3564 #
3565 # Note: If action is "stop", a STOP event will eventually follow the
3566 # BLOCK_IO_ERROR event
3567 #
3568 # Since: 0.13.0
3569 #
3570 # Example:
3571 #
3572 # <- { "event": "BLOCK_IO_ERROR",
3573 # "data": { "device": "ide0-hd1",
3574 # "node-name": "#block212",
3575 # "operation": "write",
3576 # "action": "stop" },
3577 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3578 #
3579 ##
3580 { 'event': 'BLOCK_IO_ERROR',
3581 'data': { 'device': 'str', 'node-name': 'str', 'operation': 'IoOperationType',
3582 'action': 'BlockErrorAction', '*nospace': 'bool',
3583 'reason': 'str' } }
3584
3585 ##
3586 # @BLOCK_JOB_COMPLETED:
3587 #
3588 # Emitted when a block job has completed
3589 #
3590 # @type: job type
3591 #
3592 # @device: The job identifier. Originally the device name but other
3593 # values are allowed since QEMU 2.7
3594 #
3595 # @len: maximum progress value
3596 #
3597 # @offset: current progress value. On success this is equal to len.
3598 # On failure this is less than len
3599 #
3600 # @speed: rate limit, bytes per second
3601 #
3602 # @error: error message. Only present on failure. This field
3603 # contains a human-readable error message. There are no semantics
3604 # other than that streaming has failed and clients should not try to
3605 # interpret the error string
3606 #
3607 # Since: 1.1
3608 #
3609 # Example:
3610 #
3611 # <- { "event": "BLOCK_JOB_COMPLETED",
3612 # "data": { "type": "stream", "device": "virtio-disk0",
3613 # "len": 10737418240, "offset": 10737418240,
3614 # "speed": 0 },
3615 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
3616 #
3617 ##
3618 { 'event': 'BLOCK_JOB_COMPLETED',
3619 'data': { 'type' : 'BlockJobType',
3620 'device': 'str',
3621 'len' : 'int',
3622 'offset': 'int',
3623 'speed' : 'int',
3624 '*error': 'str' } }
3625
3626 ##
3627 # @BLOCK_JOB_CANCELLED:
3628 #
3629 # Emitted when a block job has been cancelled
3630 #
3631 # @type: job type
3632 #
3633 # @device: The job identifier. Originally the device name but other
3634 # values are allowed since QEMU 2.7
3635 #
3636 # @len: maximum progress value
3637 #
3638 # @offset: current progress value. On success this is equal to len.
3639 # On failure this is less than len
3640 #
3641 # @speed: rate limit, bytes per second
3642 #
3643 # Since: 1.1
3644 #
3645 # Example:
3646 #
3647 # <- { "event": "BLOCK_JOB_CANCELLED",
3648 # "data": { "type": "stream", "device": "virtio-disk0",
3649 # "len": 10737418240, "offset": 134217728,
3650 # "speed": 0 },
3651 # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }
3652 #
3653 ##
3654 { 'event': 'BLOCK_JOB_CANCELLED',
3655 'data': { 'type' : 'BlockJobType',
3656 'device': 'str',
3657 'len' : 'int',
3658 'offset': 'int',
3659 'speed' : 'int' } }
3660
3661 ##
3662 # @BLOCK_JOB_ERROR:
3663 #
3664 # Emitted when a block job encounters an error
3665 #
3666 # @device: The job identifier. Originally the device name but other
3667 # values are allowed since QEMU 2.7
3668 #
3669 # @operation: I/O operation
3670 #
3671 # @action: action that has been taken
3672 #
3673 # Since: 1.3
3674 #
3675 # Example:
3676 #
3677 # <- { "event": "BLOCK_JOB_ERROR",
3678 # "data": { "device": "ide0-hd1",
3679 # "operation": "write",
3680 # "action": "stop" },
3681 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3682 #
3683 ##
3684 { 'event': 'BLOCK_JOB_ERROR',
3685 'data': { 'device' : 'str',
3686 'operation': 'IoOperationType',
3687 'action' : 'BlockErrorAction' } }
3688
3689 ##
3690 # @BLOCK_JOB_READY:
3691 #
3692 # Emitted when a block job is ready to complete
3693 #
3694 # @type: job type
3695 #
3696 # @device: The job identifier. Originally the device name but other
3697 # values are allowed since QEMU 2.7
3698 #
3699 # @len: maximum progress value
3700 #
3701 # @offset: current progress value. On success this is equal to len.
3702 # On failure this is less than len
3703 #
3704 # @speed: rate limit, bytes per second
3705 #
3706 # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR
3707 # event
3708 #
3709 # Since: 1.3
3710 #
3711 # Example:
3712 #
3713 # <- { "event": "BLOCK_JOB_READY",
3714 # "data": { "device": "drive0", "type": "mirror", "speed": 0,
3715 # "len": 2097152, "offset": 2097152 }
3716 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3717 #
3718 ##
3719 { 'event': 'BLOCK_JOB_READY',
3720 'data': { 'type' : 'BlockJobType',
3721 'device': 'str',
3722 'len' : 'int',
3723 'offset': 'int',
3724 'speed' : 'int' } }
3725
3726 ##
3727 # @PreallocMode:
3728 #
3729 # Preallocation mode of QEMU image file
3730 #
3731 # @off: no preallocation
3732 # @metadata: preallocate only for metadata
3733 # @falloc: like @full preallocation but allocate disk space by
3734 # posix_fallocate() rather than writing zeros.
3735 # @full: preallocate all data by writing zeros to device to ensure disk
3736 # space is really available. @full preallocation also sets up
3737 # metadata correctly.
3738 #
3739 # Since: 2.2
3740 ##
3741 { 'enum': 'PreallocMode',
3742 'data': [ 'off', 'metadata', 'falloc', 'full' ] }
3743
3744 ##
3745 # @BLOCK_WRITE_THRESHOLD:
3746 #
3747 # Emitted when writes on block device reaches or exceeds the
3748 # configured write threshold. For thin-provisioned devices, this
3749 # means the device should be extended to avoid pausing for
3750 # disk exhaustion.
3751 # The event is one shot. Once triggered, it needs to be
3752 # re-registered with another block-set-write-threshold command.
3753 #
3754 # @node-name: graph node name on which the threshold was exceeded.
3755 #
3756 # @amount-exceeded: amount of data which exceeded the threshold, in bytes.
3757 #
3758 # @write-threshold: last configured threshold, in bytes.
3759 #
3760 # Since: 2.3
3761 ##
3762 { 'event': 'BLOCK_WRITE_THRESHOLD',
3763 'data': { 'node-name': 'str',
3764 'amount-exceeded': 'uint64',
3765 'write-threshold': 'uint64' } }
3766
3767 ##
3768 # @block-set-write-threshold:
3769 #
3770 # Change the write threshold for a block drive. An event will be
3771 # delivered if a write to this block drive crosses the configured
3772 # threshold. The threshold is an offset, thus must be
3773 # non-negative. Default is no write threshold. Setting the threshold
3774 # to zero disables it.
3775 #
3776 # This is useful to transparently resize thin-provisioned drives without
3777 # the guest OS noticing.
3778 #
3779 # @node-name: graph node name on which the threshold must be set.
3780 #
3781 # @write-threshold: configured threshold for the block device, bytes.
3782 # Use 0 to disable the threshold.
3783 #
3784 # Since: 2.3
3785 #
3786 # Example:
3787 #
3788 # -> { "execute": "block-set-write-threshold",
3789 # "arguments": { "node-name": "mydev",
3790 # "write-threshold": 17179869184 } }
3791 # <- { "return": {} }
3792 #
3793 ##
3794 { 'command': 'block-set-write-threshold',
3795 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
3796
3797 ##
3798 # @x-blockdev-change:
3799 #
3800 # Dynamically reconfigure the block driver state graph. It can be used
3801 # to add, remove, insert or replace a graph node. Currently only the
3802 # Quorum driver implements this feature to add or remove its child. This
3803 # is useful to fix a broken quorum child.
3804 #
3805 # If @node is specified, it will be inserted under @parent. @child
3806 # may not be specified in this case. If both @parent and @child are
3807 # specified but @node is not, @child will be detached from @parent.
3808 #
3809 # @parent: the id or name of the parent node.
3810 #
3811 # @child: the name of a child under the given parent node.
3812 #
3813 # @node: the name of the node that will be added.
3814 #
3815 # Note: this command is experimental, and its API is not stable. It
3816 # does not support all kinds of operations, all kinds of children, nor
3817 # all block drivers.
3818 #
3819 # Warning: The data in a new quorum child MUST be consistent with that of
3820 # the rest of the array.
3821 #
3822 # Since: 2.7
3823 #
3824 # Example:
3825 #
3826 # 1. Add a new node to a quorum
3827 # -> { "execute": "blockdev-add",
3828 # "arguments": {
3829 # "driver": "raw",
3830 # "node-name": "new_node",
3831 # "file": { "driver": "file",
3832 # "filename": "test.raw" } } }
3833 # <- { "return": {} }
3834 # -> { "execute": "x-blockdev-change",
3835 # "arguments": { "parent": "disk1",
3836 # "node": "new_node" } }
3837 # <- { "return": {} }
3838 #
3839 # 2. Delete a quorum's node
3840 # -> { "execute": "x-blockdev-change",
3841 # "arguments": { "parent": "disk1",
3842 # "child": "children.1" } }
3843 # <- { "return": {} }
3844 #
3845 ##
3846 { 'command': 'x-blockdev-change',
3847 'data' : { 'parent': 'str',
3848 '*child': 'str',
3849 '*node': 'str' } }