hw/intc/armv7m_nvic: Rebuild hflags on reset
[qemu/ar7.git] / qapi / block.json
blob97bf52b7c7cc9094ff82ecc74d1cd7fa5daf336d
1 # -*- Mode: Python -*-
3 ##
4 # = Block devices
5 ##
7 { 'include': 'block-core.json' }
9 ##
10 # == Additional block stuff (VM related)
14 # @BiosAtaTranslation:
16 # Policy that BIOS should use to interpret cylinder/head/sector
17 # addresses.  Note that Bochs BIOS and SeaBIOS will not actually
18 # translate logical CHS to physical; instead, they will use logical
19 # block addressing.
21 # @auto: If cylinder/heads/sizes are passed, choose between none and LBA
22 #        depending on the size of the disk.  If they are not passed,
23 #        choose none if QEMU can guess that the disk had 16 or fewer
24 #        heads, large if QEMU can guess that the disk had 131072 or
25 #        fewer tracks across all heads (i.e. cylinders*heads<131072),
26 #        otherwise LBA.
28 # @none: The physical disk geometry is equal to the logical geometry.
30 # @lba: Assume 63 sectors per track and one of 16, 32, 64, 128 or 255
31 #       heads (if fewer than 255 are enough to cover the whole disk
32 #       with 1024 cylinders/head).  The number of cylinders/head is
33 #       then computed based on the number of sectors and heads.
35 # @large: The number of cylinders per head is scaled down to 1024
36 #         by correspondingly scaling up the number of heads.
38 # @rechs: Same as @large, but first convert a 16-head geometry to
39 #         15-head, by proportionally scaling up the number of
40 #         cylinders/head.
42 # Since: 2.0
44 { 'enum': 'BiosAtaTranslation',
45   'data': ['auto', 'none', 'lba', 'large', 'rechs']}
48 # @FloppyDriveType:
50 # Type of Floppy drive to be emulated by the Floppy Disk Controller.
52 # @144:  1.44MB 3.5" drive
53 # @288:  2.88MB 3.5" drive
54 # @120:  1.2MB 5.25" drive
55 # @none: No drive connected
56 # @auto: Automatically determined by inserted media at boot
58 # Since: 2.6
60 { 'enum': 'FloppyDriveType',
61   'data': ['144', '288', '120', 'none', 'auto']}
64 # @PRManagerInfo:
66 # Information about a persistent reservation manager
68 # @id: the identifier of the persistent reservation manager
70 # @connected: true if the persistent reservation manager is connected to
71 #             the underlying storage or helper
73 # Since: 3.0
75 { 'struct': 'PRManagerInfo',
76   'data': {'id': 'str', 'connected': 'bool'} }
79 # @query-pr-managers:
81 # Returns a list of information about each persistent reservation manager.
83 # Returns: a list of @PRManagerInfo for each persistent reservation manager
85 # Since: 3.0
87 { 'command': 'query-pr-managers', 'returns': ['PRManagerInfo'],
88   'allow-preconfig': true }
91 # @eject:
93 # Ejects a device from a removable drive.
95 # @device: Block device name (deprecated, use @id instead)
97 # @id: The name or QOM path of the guest device (since: 2.8)
99 # @force: If true, eject regardless of whether the drive is locked.
100 #         If not specified, the default value is false.
102 # Returns: - Nothing on success
103 #          - If @device is not a valid block device, DeviceNotFound
104 # Notes:    Ejecting a device with no media results in success
106 # Since: 0.14.0
108 # Example:
110 # -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } }
111 # <- { "return": {} }
113 { 'command': 'eject',
114   'data': { '*device': 'str',
115             '*id': 'str',
116             '*force': 'bool' } }
119 # @blockdev-open-tray:
121 # Opens a block device's tray. If there is a block driver state tree inserted as
122 # a medium, it will become inaccessible to the guest (but it will remain
123 # associated to the block device, so closing the tray will make it accessible
124 # again).
126 # If the tray was already open before, this will be a no-op.
128 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
129 # which no such event will be generated, these include:
131 # - if the guest has locked the tray, @force is false and the guest does not
132 #   respond to the eject request
133 # - if the BlockBackend denoted by @device does not have a guest device attached
134 #   to it
135 # - if the guest device does not have an actual tray
137 # @device: Block device name (deprecated, use @id instead)
139 # @id: The name or QOM path of the guest device (since: 2.8)
141 # @force: if false (the default), an eject request will be sent to
142 #         the guest if it has locked the tray (and the tray will not be opened
143 #         immediately); if true, the tray will be opened regardless of whether
144 #         it is locked
146 # Since: 2.5
148 # Example:
150 # -> { "execute": "blockdev-open-tray",
151 #      "arguments": { "id": "ide0-1-0" } }
153 # <- { "timestamp": { "seconds": 1418751016,
154 #                     "microseconds": 716996 },
155 #      "event": "DEVICE_TRAY_MOVED",
156 #      "data": { "device": "ide1-cd0",
157 #                "id": "ide0-1-0",
158 #                "tray-open": true } }
160 # <- { "return": {} }
163 { 'command': 'blockdev-open-tray',
164   'data': { '*device': 'str',
165             '*id': 'str',
166             '*force': 'bool' } }
169 # @blockdev-close-tray:
171 # Closes a block device's tray. If there is a block driver state tree associated
172 # with the block device (which is currently ejected), that tree will be loaded
173 # as the medium.
175 # If the tray was already closed before, this will be a no-op.
177 # @device: Block device name (deprecated, use @id instead)
179 # @id: The name or QOM path of the guest device (since: 2.8)
181 # Since: 2.5
183 # Example:
185 # -> { "execute": "blockdev-close-tray",
186 #      "arguments": { "id": "ide0-1-0" } }
188 # <- { "timestamp": { "seconds": 1418751345,
189 #                     "microseconds": 272147 },
190 #      "event": "DEVICE_TRAY_MOVED",
191 #      "data": { "device": "ide1-cd0",
192 #                "id": "ide0-1-0",
193 #                "tray-open": false } }
195 # <- { "return": {} }
198 { 'command': 'blockdev-close-tray',
199   'data': { '*device': 'str',
200             '*id': 'str' } }
203 # @blockdev-remove-medium:
205 # Removes a medium (a block driver state tree) from a block device. That block
206 # device's tray must currently be open (unless there is no attached guest
207 # device).
209 # If the tray is open and there is no medium inserted, this will be a no-op.
211 # @id: The name or QOM path of the guest device
213 # Since: 2.12
215 # Example:
217 # -> { "execute": "blockdev-remove-medium",
218 #      "arguments": { "id": "ide0-1-0" } }
220 # <- { "error": { "class": "GenericError",
221 #                 "desc": "Tray of device 'ide0-1-0' is not open" } }
223 # -> { "execute": "blockdev-open-tray",
224 #      "arguments": { "id": "ide0-1-0" } }
226 # <- { "timestamp": { "seconds": 1418751627,
227 #                     "microseconds": 549958 },
228 #      "event": "DEVICE_TRAY_MOVED",
229 #      "data": { "device": "ide1-cd0",
230 #                "id": "ide0-1-0",
231 #                "tray-open": true } }
233 # <- { "return": {} }
235 # -> { "execute": "blockdev-remove-medium",
236 #      "arguments": { "id": "ide0-1-0" } }
238 # <- { "return": {} }
241 { 'command': 'blockdev-remove-medium',
242   'data': { 'id': 'str' } }
245 # @blockdev-insert-medium:
247 # Inserts a medium (a block driver state tree) into a block device. That block
248 # device's tray must currently be open (unless there is no attached guest
249 # device) and there must be no medium inserted already.
251 # @id: The name or QOM path of the guest device
253 # @node-name: name of a node in the block driver state graph
255 # Since: 2.12
257 # Example:
259 # -> { "execute": "blockdev-add",
260 #      "arguments": {
261 #          "node-name": "node0",
262 #          "driver": "raw",
263 #          "file": { "driver": "file",
264 #                    "filename": "fedora.iso" } } }
265 # <- { "return": {} }
267 # -> { "execute": "blockdev-insert-medium",
268 #      "arguments": { "id": "ide0-1-0",
269 #                     "node-name": "node0" } }
271 # <- { "return": {} }
274 { 'command': 'blockdev-insert-medium',
275   'data': { 'id': 'str',
276             'node-name': 'str'} }
280 # @BlockdevChangeReadOnlyMode:
282 # Specifies the new read-only mode of a block device subject to the
283 # @blockdev-change-medium command.
285 # @retain: Retains the current read-only mode
287 # @read-only: Makes the device read-only
289 # @read-write: Makes the device writable
291 # Since: 2.3
294 { 'enum': 'BlockdevChangeReadOnlyMode',
295   'data': ['retain', 'read-only', 'read-write'] }
299 # @blockdev-change-medium:
301 # Changes the medium inserted into a block device by ejecting the current medium
302 # and loading a new image file which is inserted as the new medium (this command
303 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
304 # and blockdev-close-tray).
306 # @device: Block device name (deprecated, use @id instead)
308 # @id: The name or QOM path of the guest device
309 #      (since: 2.8)
311 # @filename: filename of the new image to be loaded
313 # @format: format to open the new image with (defaults to
314 #          the probed format)
316 # @read-only-mode: change the read-only mode of the device; defaults
317 #                  to 'retain'
319 # Since: 2.5
321 # Examples:
323 # 1. Change a removable medium
325 # -> { "execute": "blockdev-change-medium",
326 #      "arguments": { "id": "ide0-1-0",
327 #                     "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
328 #                     "format": "raw" } }
329 # <- { "return": {} }
331 # 2. Load a read-only medium into a writable drive
333 # -> { "execute": "blockdev-change-medium",
334 #      "arguments": { "id": "floppyA",
335 #                     "filename": "/srv/images/ro.img",
336 #                     "format": "raw",
337 #                     "read-only-mode": "retain" } }
339 # <- { "error":
340 #      { "class": "GenericError",
341 #        "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
343 # -> { "execute": "blockdev-change-medium",
344 #      "arguments": { "id": "floppyA",
345 #                     "filename": "/srv/images/ro.img",
346 #                     "format": "raw",
347 #                     "read-only-mode": "read-only" } }
349 # <- { "return": {} }
352 { 'command': 'blockdev-change-medium',
353   'data': { '*device': 'str',
354             '*id': 'str',
355             'filename': 'str',
356             '*format': 'str',
357             '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
361 # @DEVICE_TRAY_MOVED:
363 # Emitted whenever the tray of a removable device is moved by the guest or by
364 # HMP/QMP commands
366 # @device: Block device name. This is always present for compatibility
367 #          reasons, but it can be empty ("") if the image does not
368 #          have a device name associated.
370 # @id: The name or QOM path of the guest device (since 2.8)
372 # @tray-open: true if the tray has been opened or false if it has been closed
374 # Since: 1.1
376 # Example:
378 # <- { "event": "DEVICE_TRAY_MOVED",
379 #      "data": { "device": "ide1-cd0",
380 #                "id": "/machine/unattached/device[22]",
381 #                "tray-open": true
382 #      },
383 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
386 { 'event': 'DEVICE_TRAY_MOVED',
387   'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
390 # @PR_MANAGER_STATUS_CHANGED:
392 # Emitted whenever the connected status of a persistent reservation
393 # manager changes.
395 # @id: The id of the PR manager object
397 # @connected: true if the PR manager is connected to a backend
399 # Since: 3.0
401 # Example:
403 # <- { "event": "PR_MANAGER_STATUS_CHANGED",
404 #      "data": { "id": "pr-helper0",
405 #                "connected": true
406 #      },
407 #      "timestamp": { "seconds": 1519840375, "microseconds": 450486 } }
410 { 'event': 'PR_MANAGER_STATUS_CHANGED',
411   'data': { 'id': 'str', 'connected': 'bool' } }
414 # @block_set_io_throttle:
416 # Change I/O throttle limits for a block drive.
418 # Since QEMU 2.4, each device with I/O limits is member of a throttle
419 # group.
421 # If two or more devices are members of the same group, the limits
422 # will apply to the combined I/O of the whole group in a round-robin
423 # fashion. Therefore, setting new I/O limits to a device will affect
424 # the whole group.
426 # The name of the group can be specified using the 'group' parameter.
427 # If the parameter is unset, it is assumed to be the current group of
428 # that device. If it's not in any group yet, the name of the device
429 # will be used as the name for its group.
431 # The 'group' parameter can also be used to move a device to a
432 # different group. In this case the limits specified in the parameters
433 # will be applied to the new group only.
435 # I/O limits can be disabled by setting all of them to 0. In this case
436 # the device will be removed from its group and the rest of its
437 # members will not be affected. The 'group' parameter is ignored.
439 # Returns: - Nothing on success
440 #          - If @device is not a valid block device, DeviceNotFound
442 # Since: 1.1
444 # Example:
446 # -> { "execute": "block_set_io_throttle",
447 #      "arguments": { "id": "virtio-blk-pci0/virtio-backend",
448 #                     "bps": 0,
449 #                     "bps_rd": 0,
450 #                     "bps_wr": 0,
451 #                     "iops": 512,
452 #                     "iops_rd": 0,
453 #                     "iops_wr": 0,
454 #                     "bps_max": 0,
455 #                     "bps_rd_max": 0,
456 #                     "bps_wr_max": 0,
457 #                     "iops_max": 0,
458 #                     "iops_rd_max": 0,
459 #                     "iops_wr_max": 0,
460 #                     "bps_max_length": 0,
461 #                     "iops_size": 0 } }
462 # <- { "return": {} }
464 # -> { "execute": "block_set_io_throttle",
465 #      "arguments": { "id": "ide0-1-0",
466 #                     "bps": 1000000,
467 #                     "bps_rd": 0,
468 #                     "bps_wr": 0,
469 #                     "iops": 0,
470 #                     "iops_rd": 0,
471 #                     "iops_wr": 0,
472 #                     "bps_max": 8000000,
473 #                     "bps_rd_max": 0,
474 #                     "bps_wr_max": 0,
475 #                     "iops_max": 0,
476 #                     "iops_rd_max": 0,
477 #                     "iops_wr_max": 0,
478 #                     "bps_max_length": 60,
479 #                     "iops_size": 0 } }
480 # <- { "return": {} }
482 { 'command': 'block_set_io_throttle', 'boxed': true,
483   'data': 'BlockIOThrottle' }
486 # @block-latency-histogram-set:
488 # Manage read, write and flush latency histograms for the device.
490 # If only @id parameter is specified, remove all present latency histograms
491 # for the device. Otherwise, add/reset some of (or all) latency histograms.
493 # @id: The name or QOM path of the guest device.
495 # @boundaries: list of interval boundary values (see description in
496 #              BlockLatencyHistogramInfo definition). If specified, all
497 #              latency histograms are removed, and empty ones created for all
498 #              io types with intervals corresponding to @boundaries (except for
499 #              io types, for which specific boundaries are set through the
500 #              following parameters).
502 # @boundaries-read: list of interval boundary values for read latency
503 #                   histogram. If specified, old read latency histogram is
504 #                   removed, and empty one created with intervals
505 #                   corresponding to @boundaries-read. The parameter has higher
506 #                   priority then @boundaries.
508 # @boundaries-write: list of interval boundary values for write latency
509 #                    histogram.
511 # @boundaries-flush: list of interval boundary values for flush latency
512 #                    histogram.
514 # Returns: error if device is not found or any boundary arrays are invalid.
516 # Since: 4.0
518 # Example: set new histograms for all io types with intervals
519 # [0, 10), [10, 50), [50, 100), [100, +inf):
521 # -> { "execute": "block-latency-histogram-set",
522 #      "arguments": { "id": "drive0",
523 #                     "boundaries": [10, 50, 100] } }
524 # <- { "return": {} }
526 # Example: set new histogram only for write, other histograms will remain
527 # not changed (or not created):
529 # -> { "execute": "block-latency-histogram-set",
530 #      "arguments": { "id": "drive0",
531 #                     "boundaries-write": [10, 50, 100] } }
532 # <- { "return": {} }
534 # Example: set new histograms with the following intervals:
535 #   read, flush: [0, 10), [10, 50), [50, 100), [100, +inf)
536 #   write: [0, 1000), [1000, 5000), [5000, +inf)
538 # -> { "execute": "block-latency-histogram-set",
539 #      "arguments": { "id": "drive0",
540 #                     "boundaries": [10, 50, 100],
541 #                     "boundaries-write": [1000, 5000] } }
542 # <- { "return": {} }
544 # Example: remove all latency histograms:
546 # -> { "execute": "block-latency-histogram-set",
547 #      "arguments": { "id": "drive0" } }
548 # <- { "return": {} }
550 { 'command': 'block-latency-histogram-set',
551   'data': {'id': 'str',
552            '*boundaries': ['uint64'],
553            '*boundaries-read': ['uint64'],
554            '*boundaries-write': ['uint64'],
555            '*boundaries-flush': ['uint64'] } }