8 { 'include': 'block-core.json' }
11 # == Additional block stuff (VM related)
15 # @BiosAtaTranslation:
17 # Policy that BIOS should use to interpret cylinder/head/sector
18 # addresses. Note that Bochs BIOS and SeaBIOS will not actually
19 # translate logical CHS to physical; instead, they will use logical
22 # @auto: If cylinder/heads/sizes are passed, choose between none and LBA
23 # depending on the size of the disk. If they are not passed,
24 # choose none if QEMU can guess that the disk had 16 or fewer
25 # heads, large if QEMU can guess that the disk had 131072 or
26 # fewer tracks across all heads (i.e. cylinders*heads<131072),
29 # @none: The physical disk geometry is equal to the logical geometry.
31 # @lba: Assume 63 sectors per track and one of 16, 32, 64, 128 or 255
32 # heads (if fewer than 255 are enough to cover the whole disk
33 # with 1024 cylinders/head). The number of cylinders/head is
34 # then computed based on the number of sectors and heads.
36 # @large: The number of cylinders per head is scaled down to 1024
37 # by correspondingly scaling up the number of heads.
39 # @rechs: Same as @large, but first convert a 16-head geometry to
40 # 15-head, by proportionally scaling up the number of
45 { 'enum': 'BiosAtaTranslation',
46 'data': ['auto', 'none', 'lba', 'large', 'rechs']}
51 # Type of Floppy drive to be emulated by the Floppy Disk Controller.
53 # @144: 1.44MB 3.5" drive
54 # @288: 2.88MB 3.5" drive
55 # @120: 1.2MB 5.25" drive
56 # @none: No drive connected
57 # @auto: Automatically determined by inserted media at boot
61 { 'enum': 'FloppyDriveType',
62 'data': ['144', '288', '120', 'none', 'auto']}
67 # Information about a persistent reservation manager
69 # @id: the identifier of the persistent reservation manager
71 # @connected: true if the persistent reservation manager is connected to
72 # the underlying storage or helper
76 { 'struct': 'PRManagerInfo',
77 'data': {'id': 'str', 'connected': 'bool'} }
82 # Returns a list of information about each persistent reservation manager.
84 # Returns: a list of @PRManagerInfo for each persistent reservation manager
88 { 'command': 'query-pr-managers', 'returns': ['PRManagerInfo'],
89 'allow-preconfig': true }
94 # Ejects the medium from a removable drive.
96 # @device: Block device name
98 # @id: The name or QOM path of the guest device (since: 2.8)
100 # @force: If true, eject regardless of whether the drive is locked.
101 # If not specified, the default value is false.
104 # @deprecated: Member @device is deprecated. Use @id instead.
106 # Returns: - Nothing on success
107 # - If @device is not a valid block device, DeviceNotFound
108 # Notes: Ejecting a device with no media results in success
114 # -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } }
115 # <- { "return": {} }
117 { 'command': 'eject',
118 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
123 # @blockdev-open-tray:
125 # Opens a block device's tray. If there is a block driver state tree inserted as
126 # a medium, it will become inaccessible to the guest (but it will remain
127 # associated to the block device, so closing the tray will make it accessible
130 # If the tray was already open before, this will be a no-op.
132 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
133 # which no such event will be generated, these include:
135 # - if the guest has locked the tray, @force is false and the guest does not
136 # respond to the eject request
137 # - if the BlockBackend denoted by @device does not have a guest device attached
139 # - if the guest device does not have an actual tray
141 # @device: Block device name
143 # @id: The name or QOM path of the guest device (since: 2.8)
145 # @force: if false (the default), an eject request will be sent to
146 # the guest if it has locked the tray (and the tray will not be opened
147 # immediately); if true, the tray will be opened regardless of whether
151 # @deprecated: Member @device is deprecated. Use @id instead.
157 # -> { "execute": "blockdev-open-tray",
158 # "arguments": { "id": "ide0-1-0" } }
160 # <- { "timestamp": { "seconds": 1418751016,
161 # "microseconds": 716996 },
162 # "event": "DEVICE_TRAY_MOVED",
163 # "data": { "device": "ide1-cd0",
165 # "tray-open": true } }
167 # <- { "return": {} }
170 { 'command': 'blockdev-open-tray',
171 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
176 # @blockdev-close-tray:
178 # Closes a block device's tray. If there is a block driver state tree associated
179 # with the block device (which is currently ejected), that tree will be loaded
182 # If the tray was already closed before, this will be a no-op.
184 # @device: Block device name
186 # @id: The name or QOM path of the guest device (since: 2.8)
189 # @deprecated: Member @device is deprecated. Use @id instead.
195 # -> { "execute": "blockdev-close-tray",
196 # "arguments": { "id": "ide0-1-0" } }
198 # <- { "timestamp": { "seconds": 1418751345,
199 # "microseconds": 272147 },
200 # "event": "DEVICE_TRAY_MOVED",
201 # "data": { "device": "ide1-cd0",
203 # "tray-open": false } }
205 # <- { "return": {} }
208 { 'command': 'blockdev-close-tray',
209 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
213 # @blockdev-remove-medium:
215 # Removes a medium (a block driver state tree) from a block device. That block
216 # device's tray must currently be open (unless there is no attached guest
219 # If the tray is open and there is no medium inserted, this will be a no-op.
221 # @id: The name or QOM path of the guest device
227 # -> { "execute": "blockdev-remove-medium",
228 # "arguments": { "id": "ide0-1-0" } }
230 # <- { "error": { "class": "GenericError",
231 # "desc": "Tray of device 'ide0-1-0' is not open" } }
233 # -> { "execute": "blockdev-open-tray",
234 # "arguments": { "id": "ide0-1-0" } }
236 # <- { "timestamp": { "seconds": 1418751627,
237 # "microseconds": 549958 },
238 # "event": "DEVICE_TRAY_MOVED",
239 # "data": { "device": "ide1-cd0",
241 # "tray-open": true } }
243 # <- { "return": {} }
245 # -> { "execute": "blockdev-remove-medium",
246 # "arguments": { "id": "ide0-1-0" } }
248 # <- { "return": {} }
251 { 'command': 'blockdev-remove-medium',
252 'data': { 'id': 'str' } }
255 # @blockdev-insert-medium:
257 # Inserts a medium (a block driver state tree) into a block device. That block
258 # device's tray must currently be open (unless there is no attached guest
259 # device) and there must be no medium inserted already.
261 # @id: The name or QOM path of the guest device
263 # @node-name: name of a node in the block driver state graph
269 # -> { "execute": "blockdev-add",
271 # "node-name": "node0",
273 # "file": { "driver": "file",
274 # "filename": "fedora.iso" } } }
275 # <- { "return": {} }
277 # -> { "execute": "blockdev-insert-medium",
278 # "arguments": { "id": "ide0-1-0",
279 # "node-name": "node0" } }
281 # <- { "return": {} }
284 { 'command': 'blockdev-insert-medium',
285 'data': { 'id': 'str',
286 'node-name': 'str'} }
290 # @BlockdevChangeReadOnlyMode:
292 # Specifies the new read-only mode of a block device subject to the
293 # @blockdev-change-medium command.
295 # @retain: Retains the current read-only mode
297 # @read-only: Makes the device read-only
299 # @read-write: Makes the device writable
304 { 'enum': 'BlockdevChangeReadOnlyMode',
305 'data': ['retain', 'read-only', 'read-write'] }
309 # @blockdev-change-medium:
311 # Changes the medium inserted into a block device by ejecting the current medium
312 # and loading a new image file which is inserted as the new medium (this command
313 # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
314 # and blockdev-close-tray).
316 # @device: Block device name
318 # @id: The name or QOM path of the guest device
321 # @filename: filename of the new image to be loaded
323 # @format: format to open the new image with (defaults to
326 # @read-only-mode: change the read-only mode of the device; defaults
330 # @deprecated: Member @device is deprecated. Use @id instead.
336 # 1. Change a removable medium
338 # -> { "execute": "blockdev-change-medium",
339 # "arguments": { "id": "ide0-1-0",
340 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
341 # "format": "raw" } }
342 # <- { "return": {} }
344 # 2. Load a read-only medium into a writable drive
346 # -> { "execute": "blockdev-change-medium",
347 # "arguments": { "id": "floppyA",
348 # "filename": "/srv/images/ro.img",
350 # "read-only-mode": "retain" } }
353 # { "class": "GenericError",
354 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
356 # -> { "execute": "blockdev-change-medium",
357 # "arguments": { "id": "floppyA",
358 # "filename": "/srv/images/ro.img",
360 # "read-only-mode": "read-only" } }
362 # <- { "return": {} }
365 { 'command': 'blockdev-change-medium',
366 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
370 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
374 # @DEVICE_TRAY_MOVED:
376 # Emitted whenever the tray of a removable device is moved by the guest or by
379 # @device: Block device name. This is always present for compatibility
380 # reasons, but it can be empty ("") if the image does not
381 # have a device name associated.
383 # @id: The name or QOM path of the guest device (since 2.8)
385 # @tray-open: true if the tray has been opened or false if it has been closed
391 # <- { "event": "DEVICE_TRAY_MOVED",
392 # "data": { "device": "ide1-cd0",
393 # "id": "/machine/unattached/device[22]",
396 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
399 { 'event': 'DEVICE_TRAY_MOVED',
400 'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
403 # @PR_MANAGER_STATUS_CHANGED:
405 # Emitted whenever the connected status of a persistent reservation
408 # @id: The id of the PR manager object
410 # @connected: true if the PR manager is connected to a backend
416 # <- { "event": "PR_MANAGER_STATUS_CHANGED",
417 # "data": { "id": "pr-helper0",
420 # "timestamp": { "seconds": 1519840375, "microseconds": 450486 } }
423 { 'event': 'PR_MANAGER_STATUS_CHANGED',
424 'data': { 'id': 'str', 'connected': 'bool' } }
427 # @block_set_io_throttle:
429 # Change I/O throttle limits for a block drive.
431 # Since QEMU 2.4, each device with I/O limits is member of a throttle
434 # If two or more devices are members of the same group, the limits
435 # will apply to the combined I/O of the whole group in a round-robin
436 # fashion. Therefore, setting new I/O limits to a device will affect
439 # The name of the group can be specified using the 'group' parameter.
440 # If the parameter is unset, it is assumed to be the current group of
441 # that device. If it's not in any group yet, the name of the device
442 # will be used as the name for its group.
444 # The 'group' parameter can also be used to move a device to a
445 # different group. In this case the limits specified in the parameters
446 # will be applied to the new group only.
448 # I/O limits can be disabled by setting all of them to 0. In this case
449 # the device will be removed from its group and the rest of its
450 # members will not be affected. The 'group' parameter is ignored.
452 # Returns: - Nothing on success
453 # - If @device is not a valid block device, DeviceNotFound
459 # -> { "execute": "block_set_io_throttle",
460 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
473 # "bps_max_length": 0,
475 # <- { "return": {} }
477 # -> { "execute": "block_set_io_throttle",
478 # "arguments": { "id": "ide0-1-0",
485 # "bps_max": 8000000,
491 # "bps_max_length": 60,
493 # <- { "return": {} }
495 { 'command': 'block_set_io_throttle', 'boxed': true,
496 'data': 'BlockIOThrottle' }
499 # @block-latency-histogram-set:
501 # Manage read, write and flush latency histograms for the device.
503 # If only @id parameter is specified, remove all present latency histograms
504 # for the device. Otherwise, add/reset some of (or all) latency histograms.
506 # @id: The name or QOM path of the guest device.
508 # @boundaries: list of interval boundary values (see description in
509 # BlockLatencyHistogramInfo definition). If specified, all
510 # latency histograms are removed, and empty ones created for all
511 # io types with intervals corresponding to @boundaries (except for
512 # io types, for which specific boundaries are set through the
513 # following parameters).
515 # @boundaries-read: list of interval boundary values for read latency
516 # histogram. If specified, old read latency histogram is
517 # removed, and empty one created with intervals
518 # corresponding to @boundaries-read. The parameter has higher
519 # priority then @boundaries.
521 # @boundaries-write: list of interval boundary values for write latency
524 # @boundaries-flush: list of interval boundary values for flush latency
527 # Returns: error if device is not found or any boundary arrays are invalid.
532 # set new histograms for all io types with intervals
533 # [0, 10), [10, 50), [50, 100), [100, +inf):
535 # -> { "execute": "block-latency-histogram-set",
536 # "arguments": { "id": "drive0",
537 # "boundaries": [10, 50, 100] } }
538 # <- { "return": {} }
541 # set new histogram only for write, other histograms will remain
542 # not changed (or not created):
544 # -> { "execute": "block-latency-histogram-set",
545 # "arguments": { "id": "drive0",
546 # "boundaries-write": [10, 50, 100] } }
547 # <- { "return": {} }
550 # set new histograms with the following intervals:
551 # read, flush: [0, 10), [10, 50), [50, 100), [100, +inf)
552 # write: [0, 1000), [1000, 5000), [5000, +inf)
554 # -> { "execute": "block-latency-histogram-set",
555 # "arguments": { "id": "drive0",
556 # "boundaries": [10, 50, 100],
557 # "boundaries-write": [1000, 5000] } }
558 # <- { "return": {} }
561 # remove all latency histograms:
563 # -> { "execute": "block-latency-histogram-set",
564 # "arguments": { "id": "drive0" } }
565 # <- { "return": {} }
567 { 'command': 'block-latency-histogram-set',
568 'data': {'id': 'str',
569 '*boundaries': ['uint64'],
570 '*boundaries-read': ['uint64'],
571 '*boundaries-write': ['uint64'],
572 '*boundaries-flush': ['uint64'] } }