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