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
23 # LBA 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 fewer
26 # tracks across all heads (i.e. cylinders*heads<131072), otherwise
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 with
33 # 1024 cylinders/head). The number of cylinders/head is then
34 # computed based on the number of sectors and heads.
36 # @large: The number of cylinders per head is scaled down to 1024 by
37 # 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
55 # @288: 2.88MB 3.5" drive
57 # @120: 1.2MB 5.25" drive
59 # @none: No drive connected
61 # @auto: Automatically determined by inserted media at boot
65 { 'enum': 'FloppyDriveType',
66 'data': ['144', '288', '120', 'none', 'auto']}
71 # Information about a persistent reservation manager
73 # @id: the identifier of the persistent reservation manager
75 # @connected: true if the persistent reservation manager is connected
76 # to the underlying storage or helper
80 { 'struct': 'PRManagerInfo',
81 'data': {'id': 'str', 'connected': 'bool'} }
86 # Returns a list of information about each persistent reservation
89 # Returns: a list of @PRManagerInfo for each persistent reservation
94 { 'command': 'query-pr-managers', 'returns': ['PRManagerInfo'],
95 'allow-preconfig': true }
100 # Ejects the medium from a removable drive.
102 # @device: Block device name
104 # @id: The name or QOM path of the guest device (since: 2.8)
106 # @force: If true, eject regardless of whether the drive is locked.
107 # If not specified, the default value is false.
111 # @deprecated: Member @device is deprecated. Use @id instead.
114 # - Nothing on success
115 # - If @device is not a valid block device, DeviceNotFound
117 # Notes: Ejecting a device with no media results in success
123 # -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } }
124 # <- { "return": {} }
126 { 'command': 'eject',
127 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
132 # @blockdev-open-tray:
134 # Opens a block device's tray. If there is a block driver state tree
135 # inserted as a medium, it will become inaccessible to the guest (but
136 # it will remain associated to the block device, so closing the tray
137 # will make it accessible again).
139 # If the tray was already open before, this will be a no-op.
141 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There
142 # are cases in which no such event will be generated, these include:
144 # - if the guest has locked the tray, @force is false and the guest
145 # does not respond to the eject request
146 # - if the BlockBackend denoted by @device does not have a guest
147 # device attached to it
148 # - if the guest device does not have an actual tray
150 # @device: Block device name
152 # @id: The name or QOM path of the guest device (since: 2.8)
154 # @force: if false (the default), an eject request will be sent to the
155 # guest if it has locked the tray (and the tray will not be opened
156 # immediately); if true, the tray will be opened regardless of
157 # whether it is locked
161 # @deprecated: Member @device is deprecated. Use @id instead.
167 # -> { "execute": "blockdev-open-tray",
168 # "arguments": { "id": "ide0-1-0" } }
170 # <- { "timestamp": { "seconds": 1418751016,
171 # "microseconds": 716996 },
172 # "event": "DEVICE_TRAY_MOVED",
173 # "data": { "device": "ide1-cd0",
175 # "tray-open": true } }
177 # <- { "return": {} }
179 { 'command': 'blockdev-open-tray',
180 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
185 # @blockdev-close-tray:
187 # Closes a block device's tray. If there is a block driver state tree
188 # associated with the block device (which is currently ejected), that
189 # tree will be loaded as the medium.
191 # If the tray was already closed before, this will be a no-op.
193 # @device: Block device name
195 # @id: The name or QOM path of the guest device (since: 2.8)
199 # @deprecated: Member @device is deprecated. Use @id instead.
205 # -> { "execute": "blockdev-close-tray",
206 # "arguments": { "id": "ide0-1-0" } }
208 # <- { "timestamp": { "seconds": 1418751345,
209 # "microseconds": 272147 },
210 # "event": "DEVICE_TRAY_MOVED",
211 # "data": { "device": "ide1-cd0",
213 # "tray-open": false } }
215 # <- { "return": {} }
217 { 'command': 'blockdev-close-tray',
218 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
222 # @blockdev-remove-medium:
224 # Removes a medium (a block driver state tree) from a block device.
225 # That block device's tray must currently be open (unless there is no
226 # attached guest device).
228 # If the tray is open and there is no medium inserted, this will be a
231 # @id: The name or QOM path of the guest device
237 # -> { "execute": "blockdev-remove-medium",
238 # "arguments": { "id": "ide0-1-0" } }
240 # <- { "error": { "class": "GenericError",
241 # "desc": "Tray of device 'ide0-1-0' is not open" } }
243 # -> { "execute": "blockdev-open-tray",
244 # "arguments": { "id": "ide0-1-0" } }
246 # <- { "timestamp": { "seconds": 1418751627,
247 # "microseconds": 549958 },
248 # "event": "DEVICE_TRAY_MOVED",
249 # "data": { "device": "ide1-cd0",
251 # "tray-open": true } }
253 # <- { "return": {} }
255 # -> { "execute": "blockdev-remove-medium",
256 # "arguments": { "id": "ide0-1-0" } }
258 # <- { "return": {} }
260 { 'command': 'blockdev-remove-medium',
261 'data': { 'id': 'str' } }
264 # @blockdev-insert-medium:
266 # Inserts a medium (a block driver state tree) into a block device.
267 # That block device's tray must currently be open (unless there is no
268 # attached guest device) and there must be no medium inserted already.
270 # @id: The name or QOM path of the guest device
272 # @node-name: name of a node in the block driver state graph
278 # -> { "execute": "blockdev-add",
280 # "node-name": "node0",
282 # "file": { "driver": "file",
283 # "filename": "fedora.iso" } } }
284 # <- { "return": {} }
286 # -> { "execute": "blockdev-insert-medium",
287 # "arguments": { "id": "ide0-1-0",
288 # "node-name": "node0" } }
290 # <- { "return": {} }
292 { 'command': 'blockdev-insert-medium',
293 'data': { 'id': 'str',
294 'node-name': 'str'} }
297 # @BlockdevChangeReadOnlyMode:
299 # Specifies the new read-only mode of a block device subject to the
300 # @blockdev-change-medium command.
302 # @retain: Retains the current read-only mode
304 # @read-only: Makes the device read-only
306 # @read-write: Makes the device writable
310 { 'enum': 'BlockdevChangeReadOnlyMode',
311 'data': ['retain', 'read-only', 'read-write'] }
314 # @blockdev-change-medium:
316 # Changes the medium inserted into a block device by ejecting the
317 # current medium and loading a new image file which is inserted as the
318 # new medium (this command combines blockdev-open-tray,
319 # blockdev-remove-medium, blockdev-insert-medium and
320 # blockdev-close-tray).
322 # @device: Block device name
324 # @id: The name or QOM path of the guest device (since: 2.8)
326 # @filename: filename of the new image to be loaded
328 # @format: format to open the new image with (defaults to the probed
331 # @read-only-mode: change the read-only mode of the device; defaults
334 # @force: if false (the default), an eject request through
335 # blockdev-open-tray will be sent to the guest if it has locked
336 # the tray (and the tray will not be opened immediately); if true,
337 # the tray will be opened regardless of whether it is locked.
342 # @deprecated: Member @device is deprecated. Use @id instead.
348 # 1. Change a removable medium
350 # -> { "execute": "blockdev-change-medium",
351 # "arguments": { "id": "ide0-1-0",
352 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
353 # "format": "raw" } }
354 # <- { "return": {} }
356 # 2. Load a read-only medium into a writable drive
358 # -> { "execute": "blockdev-change-medium",
359 # "arguments": { "id": "floppyA",
360 # "filename": "/srv/images/ro.img",
362 # "read-only-mode": "retain" } }
365 # { "class": "GenericError",
366 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
368 # -> { "execute": "blockdev-change-medium",
369 # "arguments": { "id": "floppyA",
370 # "filename": "/srv/images/ro.img",
372 # "read-only-mode": "read-only" } }
374 # <- { "return": {} }
376 { 'command': 'blockdev-change-medium',
377 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
382 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
385 # @DEVICE_TRAY_MOVED:
387 # Emitted whenever the tray of a removable device is moved by the
388 # guest or by HMP/QMP commands
390 # @device: Block device name. This is always present for
391 # compatibility reasons, but it can be empty ("") if the image
392 # does not have a device name associated.
394 # @id: The name or QOM path of the guest device (since 2.8)
396 # @tray-open: true if the tray has been opened or false if it has been
403 # <- { "event": "DEVICE_TRAY_MOVED",
404 # "data": { "device": "ide1-cd0",
405 # "id": "/machine/unattached/device[22]",
408 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
410 { 'event': 'DEVICE_TRAY_MOVED',
411 'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
414 # @PR_MANAGER_STATUS_CHANGED:
416 # Emitted whenever the connected status of a persistent reservation
419 # @id: The id of the PR manager object
421 # @connected: true if the PR manager is connected to a backend
427 # <- { "event": "PR_MANAGER_STATUS_CHANGED",
428 # "data": { "id": "pr-helper0",
431 # "timestamp": { "seconds": 1519840375, "microseconds": 450486 } }
433 { 'event': 'PR_MANAGER_STATUS_CHANGED',
434 'data': { 'id': 'str', 'connected': 'bool' } }
437 # @block_set_io_throttle:
439 # Change I/O throttle limits for a block drive.
441 # Since QEMU 2.4, each device with I/O limits is member of a throttle
444 # If two or more devices are members of the same group, the limits
445 # will apply to the combined I/O of the whole group in a round-robin
446 # fashion. Therefore, setting new I/O limits to a device will affect
449 # The name of the group can be specified using the 'group' parameter.
450 # If the parameter is unset, it is assumed to be the current group of
451 # that device. If it's not in any group yet, the name of the device
452 # will be used as the name for its group.
454 # The 'group' parameter can also be used to move a device to a
455 # different group. In this case the limits specified in the
456 # parameters will be applied to the new group only.
458 # I/O limits can be disabled by setting all of them to 0. In this case
459 # the device will be removed from its group and the rest of its
460 # members will not be affected. The 'group' parameter is ignored.
463 # - Nothing on success
464 # - If @device is not a valid block device, DeviceNotFound
470 # -> { "execute": "block_set_io_throttle",
471 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
484 # "bps_max_length": 0,
486 # <- { "return": {} }
488 # -> { "execute": "block_set_io_throttle",
489 # "arguments": { "id": "ide0-1-0",
496 # "bps_max": 8000000,
502 # "bps_max_length": 60,
504 # <- { "return": {} }
506 { 'command': 'block_set_io_throttle', 'boxed': true,
507 'data': 'BlockIOThrottle',
508 'allow-preconfig': true }
511 # @block-latency-histogram-set:
513 # Manage read, write and flush latency histograms for the device.
515 # If only @id parameter is specified, remove all present latency
516 # histograms for the device. Otherwise, add/reset some of (or all)
517 # latency histograms.
519 # @id: The name or QOM path of the guest device.
521 # @boundaries: list of interval boundary values (see description in
522 # BlockLatencyHistogramInfo definition). If specified, all latency
523 # histograms are removed, and empty ones created for all io types
524 # with intervals corresponding to @boundaries (except for io
525 # types, for which specific boundaries are set through the
526 # following parameters).
528 # @boundaries-read: list of interval boundary values for read latency
529 # histogram. If specified, old read latency histogram is removed,
530 # and empty one created with intervals corresponding to
531 # @boundaries-read. The parameter has higher priority then
534 # @boundaries-write: list of interval boundary values for write
537 # @boundaries-zap: list of interval boundary values for zone append
538 # write latency histogram.
540 # @boundaries-flush: list of interval boundary values for flush
543 # Returns: error if device is not found or any boundary arrays are
550 # Set new histograms for all io types with intervals [0, 10), [10,
551 # 50), [50, 100), [100, +inf):
553 # -> { "execute": "block-latency-histogram-set",
554 # "arguments": { "id": "drive0",
555 # "boundaries": [10, 50, 100] } }
556 # <- { "return": {} }
560 # Set new histogram only for write, other histograms will remain not
561 # changed (or not created):
563 # -> { "execute": "block-latency-histogram-set",
564 # "arguments": { "id": "drive0",
565 # "boundaries-write": [10, 50, 100] } }
566 # <- { "return": {} }
570 # Set new histograms with the following intervals: read, flush: [0,
571 # 10), [10, 50), [50, 100), [100, +inf) write: [0, 1000), [1000,
572 # 5000), [5000, +inf)
574 # -> { "execute": "block-latency-histogram-set",
575 # "arguments": { "id": "drive0",
576 # "boundaries": [10, 50, 100],
577 # "boundaries-write": [1000, 5000] } }
578 # <- { "return": {} }
582 # Remove all latency histograms:
584 # -> { "execute": "block-latency-histogram-set",
585 # "arguments": { "id": "drive0" } }
586 # <- { "return": {} }
588 { 'command': 'block-latency-histogram-set',
589 'data': {'id': 'str',
590 '*boundaries': ['uint64'],
591 '*boundaries-read': ['uint64'],
592 '*boundaries-write': ['uint64'],
593 '*boundaries-zap': ['uint64'],
594 '*boundaries-flush': ['uint64'] },
595 'allow-preconfig': true }