7 { 'include': 'block-core.json' }
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
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),
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
44 { 'enum': 'BiosAtaTranslation',
45 'data': ['auto', 'none', 'lba', 'large', 'rechs']}
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
60 { 'enum': 'FloppyDriveType',
61 'data': ['144', '288', '120', 'none', 'auto']}
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
75 { 'struct': 'PRManagerInfo',
76 'data': {'id': 'str', 'connected': 'bool'} }
81 # Returns a list of information about each persistent reservation manager.
83 # Returns: a list of @PRManagerInfo for each persistent reservation manager
87 { 'command': 'query-pr-managers', 'returns': ['PRManagerInfo'],
88 'allow-preconfig': true }
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.
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
113 # -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } }
114 # <- { "return": {} }
116 { 'command': 'eject',
117 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
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
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
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
150 # @deprecated: Member @device is deprecated. Use @id instead.
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",
164 # "tray-open": true } }
166 # <- { "return": {} }
169 { 'command': 'blockdev-open-tray',
170 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
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
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)
188 # @deprecated: Member @device is deprecated. Use @id instead.
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",
202 # "tray-open": false } }
204 # <- { "return": {} }
207 { 'command': 'blockdev-close-tray',
208 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
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
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
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",
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
268 # -> { "execute": "blockdev-add",
270 # "node-name": "node0",
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
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
320 # @filename: filename of the new image to be loaded
322 # @format: format to open the new image with (defaults to
325 # @read-only-mode: change the read-only mode of the device; defaults
329 # @deprecated: Member @device is deprecated. Use @id instead.
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",
349 # "read-only-mode": "retain" } }
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",
359 # "read-only-mode": "read-only" } }
361 # <- { "return": {} }
364 { 'command': 'blockdev-change-medium',
365 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
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
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
390 # <- { "event": "DEVICE_TRAY_MOVED",
391 # "data": { "device": "ide1-cd0",
392 # "id": "/machine/unattached/device[22]",
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
407 # @id: The id of the PR manager object
409 # @connected: true if the PR manager is connected to a backend
415 # <- { "event": "PR_MANAGER_STATUS_CHANGED",
416 # "data": { "id": "pr-helper0",
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
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
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
458 # -> { "execute": "block_set_io_throttle",
459 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
472 # "bps_max_length": 0,
474 # <- { "return": {} }
476 # -> { "execute": "block_set_io_throttle",
477 # "arguments": { "id": "ide0-1-0",
484 # "bps_max": 8000000,
490 # "bps_max_length": 60,
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
523 # @boundaries-flush: list of interval boundary values for flush latency
526 # Returns: error if device is not found or any boundary arrays are invalid.
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'] } }