sm501: Drop unneded variable
[qemu/ar7.git] / qapi / block.json
blob2ddbfa8306aad1c2818e6d9a60381675ffc214ec
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 the medium from a removable drive.
95 # @device: Block device name
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 # Features:
103 # @deprecated: Member @device is deprecated.  Use @id instead.
105 # Returns: - Nothing on success
106 #          - If @device is not a valid block device, DeviceNotFound
107 # Notes:    Ejecting a device with no media results in success
109 # Since: 0.14.0
111 # Example:
113 # -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } }
114 # <- { "return": {} }
116 { 'command': 'eject',
117   'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
118             '*id': 'str',
119             '*force': 'bool' } }
122 # @blockdev-open-tray:
124 # Opens a block device's tray. If there is a block driver state tree inserted as
125 # a medium, it will become inaccessible to the guest (but it will remain
126 # associated to the block device, so closing the tray will make it accessible
127 # again).
129 # If the tray was already open before, this will be a no-op.
131 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
132 # which no such event will be generated, these include:
134 # - if the guest has locked the tray, @force is false and the guest does not
135 #   respond to the eject request
136 # - if the BlockBackend denoted by @device does not have a guest device attached
137 #   to it
138 # - if the guest device does not have an actual tray
140 # @device: Block device name
142 # @id: The name or QOM path of the guest device (since: 2.8)
144 # @force: if false (the default), an eject request will be sent to
145 #         the guest if it has locked the tray (and the tray will not be opened
146 #         immediately); if true, the tray will be opened regardless of whether
147 #         it is locked
149 # Features:
150 # @deprecated: Member @device is deprecated.  Use @id instead.
152 # Since: 2.5
154 # Example:
156 # -> { "execute": "blockdev-open-tray",
157 #      "arguments": { "id": "ide0-1-0" } }
159 # <- { "timestamp": { "seconds": 1418751016,
160 #                     "microseconds": 716996 },
161 #      "event": "DEVICE_TRAY_MOVED",
162 #      "data": { "device": "ide1-cd0",
163 #                "id": "ide0-1-0",
164 #                "tray-open": true } }
166 # <- { "return": {} }
169 { 'command': 'blockdev-open-tray',
170   'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
171             '*id': 'str',
172             '*force': 'bool' } }
175 # @blockdev-close-tray:
177 # Closes a block device's tray. If there is a block driver state tree associated
178 # with the block device (which is currently ejected), that tree will be loaded
179 # as the medium.
181 # If the tray was already closed before, this will be a no-op.
183 # @device: Block device name
185 # @id: The name or QOM path of the guest device (since: 2.8)
187 # Features:
188 # @deprecated: Member @device is deprecated.  Use @id instead.
190 # Since: 2.5
192 # Example:
194 # -> { "execute": "blockdev-close-tray",
195 #      "arguments": { "id": "ide0-1-0" } }
197 # <- { "timestamp": { "seconds": 1418751345,
198 #                     "microseconds": 272147 },
199 #      "event": "DEVICE_TRAY_MOVED",
200 #      "data": { "device": "ide1-cd0",
201 #                "id": "ide0-1-0",
202 #                "tray-open": false } }
204 # <- { "return": {} }
207 { 'command': 'blockdev-close-tray',
208   'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
209             '*id': 'str' } }
212 # @blockdev-remove-medium:
214 # Removes a medium (a block driver state tree) from a block device. That block
215 # device's tray must currently be open (unless there is no attached guest
216 # device).
218 # If the tray is open and there is no medium inserted, this will be a no-op.
220 # @id: The name or QOM path of the guest device
222 # Since: 2.12
224 # Example:
226 # -> { "execute": "blockdev-remove-medium",
227 #      "arguments": { "id": "ide0-1-0" } }
229 # <- { "error": { "class": "GenericError",
230 #                 "desc": "Tray of device 'ide0-1-0' is not open" } }
232 # -> { "execute": "blockdev-open-tray",
233 #      "arguments": { "id": "ide0-1-0" } }
235 # <- { "timestamp": { "seconds": 1418751627,
236 #                     "microseconds": 549958 },
237 #      "event": "DEVICE_TRAY_MOVED",
238 #      "data": { "device": "ide1-cd0",
239 #                "id": "ide0-1-0",
240 #                "tray-open": true } }
242 # <- { "return": {} }
244 # -> { "execute": "blockdev-remove-medium",
245 #      "arguments": { "id": "ide0-1-0" } }
247 # <- { "return": {} }
250 { 'command': 'blockdev-remove-medium',
251   'data': { 'id': 'str' } }
254 # @blockdev-insert-medium:
256 # Inserts a medium (a block driver state tree) into a block device. That block
257 # device's tray must currently be open (unless there is no attached guest
258 # device) and there must be no medium inserted already.
260 # @id: The name or QOM path of the guest device
262 # @node-name: name of a node in the block driver state graph
264 # Since: 2.12
266 # Example:
268 # -> { "execute": "blockdev-add",
269 #      "arguments": {
270 #          "node-name": "node0",
271 #          "driver": "raw",
272 #          "file": { "driver": "file",
273 #                    "filename": "fedora.iso" } } }
274 # <- { "return": {} }
276 # -> { "execute": "blockdev-insert-medium",
277 #      "arguments": { "id": "ide0-1-0",
278 #                     "node-name": "node0" } }
280 # <- { "return": {} }
283 { 'command': 'blockdev-insert-medium',
284   'data': { 'id': 'str',
285             'node-name': 'str'} }
289 # @BlockdevChangeReadOnlyMode:
291 # Specifies the new read-only mode of a block device subject to the
292 # @blockdev-change-medium command.
294 # @retain: Retains the current read-only mode
296 # @read-only: Makes the device read-only
298 # @read-write: Makes the device writable
300 # Since: 2.3
303 { 'enum': 'BlockdevChangeReadOnlyMode',
304   'data': ['retain', 'read-only', 'read-write'] }
308 # @blockdev-change-medium:
310 # Changes the medium inserted into a block device by ejecting the current medium
311 # and loading a new image file which is inserted as the new medium (this command
312 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
313 # and blockdev-close-tray).
315 # @device: Block device name
317 # @id: The name or QOM path of the guest device
318 #      (since: 2.8)
320 # @filename: filename of the new image to be loaded
322 # @format: format to open the new image with (defaults to
323 #          the probed format)
325 # @read-only-mode: change the read-only mode of the device; defaults
326 #                  to 'retain'
328 # Features:
329 # @deprecated: Member @device is deprecated.  Use @id instead.
331 # Since: 2.5
333 # Examples:
335 # 1. Change a removable medium
337 # -> { "execute": "blockdev-change-medium",
338 #      "arguments": { "id": "ide0-1-0",
339 #                     "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
340 #                     "format": "raw" } }
341 # <- { "return": {} }
343 # 2. Load a read-only medium into a writable drive
345 # -> { "execute": "blockdev-change-medium",
346 #      "arguments": { "id": "floppyA",
347 #                     "filename": "/srv/images/ro.img",
348 #                     "format": "raw",
349 #                     "read-only-mode": "retain" } }
351 # <- { "error":
352 #      { "class": "GenericError",
353 #        "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
355 # -> { "execute": "blockdev-change-medium",
356 #      "arguments": { "id": "floppyA",
357 #                     "filename": "/srv/images/ro.img",
358 #                     "format": "raw",
359 #                     "read-only-mode": "read-only" } }
361 # <- { "return": {} }
364 { 'command': 'blockdev-change-medium',
365   'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
366             '*id': 'str',
367             'filename': 'str',
368             '*format': 'str',
369             '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
373 # @DEVICE_TRAY_MOVED:
375 # Emitted whenever the tray of a removable device is moved by the guest or by
376 # HMP/QMP commands
378 # @device: Block device name. This is always present for compatibility
379 #          reasons, but it can be empty ("") if the image does not
380 #          have a device name associated.
382 # @id: The name or QOM path of the guest device (since 2.8)
384 # @tray-open: true if the tray has been opened or false if it has been closed
386 # Since: 1.1
388 # Example:
390 # <- { "event": "DEVICE_TRAY_MOVED",
391 #      "data": { "device": "ide1-cd0",
392 #                "id": "/machine/unattached/device[22]",
393 #                "tray-open": true
394 #      },
395 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
398 { 'event': 'DEVICE_TRAY_MOVED',
399   'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
402 # @PR_MANAGER_STATUS_CHANGED:
404 # Emitted whenever the connected status of a persistent reservation
405 # manager changes.
407 # @id: The id of the PR manager object
409 # @connected: true if the PR manager is connected to a backend
411 # Since: 3.0
413 # Example:
415 # <- { "event": "PR_MANAGER_STATUS_CHANGED",
416 #      "data": { "id": "pr-helper0",
417 #                "connected": true
418 #      },
419 #      "timestamp": { "seconds": 1519840375, "microseconds": 450486 } }
422 { 'event': 'PR_MANAGER_STATUS_CHANGED',
423   'data': { 'id': 'str', 'connected': 'bool' } }
426 # @block_set_io_throttle:
428 # Change I/O throttle limits for a block drive.
430 # Since QEMU 2.4, each device with I/O limits is member of a throttle
431 # group.
433 # If two or more devices are members of the same group, the limits
434 # will apply to the combined I/O of the whole group in a round-robin
435 # fashion. Therefore, setting new I/O limits to a device will affect
436 # the whole group.
438 # The name of the group can be specified using the 'group' parameter.
439 # If the parameter is unset, it is assumed to be the current group of
440 # that device. If it's not in any group yet, the name of the device
441 # will be used as the name for its group.
443 # The 'group' parameter can also be used to move a device to a
444 # different group. In this case the limits specified in the parameters
445 # will be applied to the new group only.
447 # I/O limits can be disabled by setting all of them to 0. In this case
448 # the device will be removed from its group and the rest of its
449 # members will not be affected. The 'group' parameter is ignored.
451 # Returns: - Nothing on success
452 #          - If @device is not a valid block device, DeviceNotFound
454 # Since: 1.1
456 # Example:
458 # -> { "execute": "block_set_io_throttle",
459 #      "arguments": { "id": "virtio-blk-pci0/virtio-backend",
460 #                     "bps": 0,
461 #                     "bps_rd": 0,
462 #                     "bps_wr": 0,
463 #                     "iops": 512,
464 #                     "iops_rd": 0,
465 #                     "iops_wr": 0,
466 #                     "bps_max": 0,
467 #                     "bps_rd_max": 0,
468 #                     "bps_wr_max": 0,
469 #                     "iops_max": 0,
470 #                     "iops_rd_max": 0,
471 #                     "iops_wr_max": 0,
472 #                     "bps_max_length": 0,
473 #                     "iops_size": 0 } }
474 # <- { "return": {} }
476 # -> { "execute": "block_set_io_throttle",
477 #      "arguments": { "id": "ide0-1-0",
478 #                     "bps": 1000000,
479 #                     "bps_rd": 0,
480 #                     "bps_wr": 0,
481 #                     "iops": 0,
482 #                     "iops_rd": 0,
483 #                     "iops_wr": 0,
484 #                     "bps_max": 8000000,
485 #                     "bps_rd_max": 0,
486 #                     "bps_wr_max": 0,
487 #                     "iops_max": 0,
488 #                     "iops_rd_max": 0,
489 #                     "iops_wr_max": 0,
490 #                     "bps_max_length": 60,
491 #                     "iops_size": 0 } }
492 # <- { "return": {} }
494 { 'command': 'block_set_io_throttle', 'boxed': true,
495   'data': 'BlockIOThrottle' }
498 # @block-latency-histogram-set:
500 # Manage read, write and flush latency histograms for the device.
502 # If only @id parameter is specified, remove all present latency histograms
503 # for the device. Otherwise, add/reset some of (or all) latency histograms.
505 # @id: The name or QOM path of the guest device.
507 # @boundaries: list of interval boundary values (see description in
508 #              BlockLatencyHistogramInfo definition). If specified, all
509 #              latency histograms are removed, and empty ones created for all
510 #              io types with intervals corresponding to @boundaries (except for
511 #              io types, for which specific boundaries are set through the
512 #              following parameters).
514 # @boundaries-read: list of interval boundary values for read latency
515 #                   histogram. If specified, old read latency histogram is
516 #                   removed, and empty one created with intervals
517 #                   corresponding to @boundaries-read. The parameter has higher
518 #                   priority then @boundaries.
520 # @boundaries-write: list of interval boundary values for write latency
521 #                    histogram.
523 # @boundaries-flush: list of interval boundary values for flush latency
524 #                    histogram.
526 # Returns: error if device is not found or any boundary arrays are invalid.
528 # Since: 4.0
530 # Example: set new histograms for all io types with intervals
531 # [0, 10), [10, 50), [50, 100), [100, +inf):
533 # -> { "execute": "block-latency-histogram-set",
534 #      "arguments": { "id": "drive0",
535 #                     "boundaries": [10, 50, 100] } }
536 # <- { "return": {} }
538 # Example: set new histogram only for write, other histograms will remain
539 # not changed (or not created):
541 # -> { "execute": "block-latency-histogram-set",
542 #      "arguments": { "id": "drive0",
543 #                     "boundaries-write": [10, 50, 100] } }
544 # <- { "return": {} }
546 # Example: set new histograms with the following intervals:
547 #   read, flush: [0, 10), [10, 50), [50, 100), [100, +inf)
548 #   write: [0, 1000), [1000, 5000), [5000, +inf)
550 # -> { "execute": "block-latency-histogram-set",
551 #      "arguments": { "id": "drive0",
552 #                     "boundaries": [10, 50, 100],
553 #                     "boundaries-write": [1000, 5000] } }
554 # <- { "return": {} }
556 # Example: remove all latency histograms:
558 # -> { "execute": "block-latency-histogram-set",
559 #      "arguments": { "id": "drive0" } }
560 # <- { "return": {} }
562 { 'command': 'block-latency-histogram-set',
563   'data': {'id': 'str',
564            '*boundaries': ['uint64'],
565            '*boundaries-read': ['uint64'],
566            '*boundaries-write': ['uint64'],
567            '*boundaries-flush': ['uint64'] } }