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