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 # - If @device is not a valid block device, DeviceNotFound
116 # Notes: Ejecting a device with no media results in success
122 # -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } }
123 # <- { "return": {} }
125 { 'command': 'eject',
126 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
131 # @blockdev-open-tray:
133 # Opens a block device's tray. If there is a block driver state tree
134 # inserted as a medium, it will become inaccessible to the guest (but
135 # it will remain associated to the block device, so closing the tray
136 # will make it accessible again).
138 # If the tray was already open before, this will be a no-op.
140 # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There
141 # are cases in which no such event will be generated, these include:
143 # - if the guest has locked the tray, @force is false and the guest
144 # does not respond to the eject request
145 # - if the BlockBackend denoted by @device does not have a guest
146 # device attached to it
147 # - if the guest device does not have an actual tray
149 # @device: Block device name
151 # @id: The name or QOM path of the guest device (since: 2.8)
153 # @force: if false (the default), an eject request will be sent to the
154 # guest if it has locked the tray (and the tray will not be opened
155 # immediately); if true, the tray will be opened regardless of
156 # whether it is locked
160 # @deprecated: Member @device is deprecated. Use @id instead.
166 # -> { "execute": "blockdev-open-tray",
167 # "arguments": { "id": "ide0-1-0" } }
169 # <- { "timestamp": { "seconds": 1418751016,
170 # "microseconds": 716996 },
171 # "event": "DEVICE_TRAY_MOVED",
172 # "data": { "device": "ide1-cd0",
174 # "tray-open": true } }
176 # <- { "return": {} }
178 { 'command': 'blockdev-open-tray',
179 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
184 # @blockdev-close-tray:
186 # Closes a block device's tray. If there is a block driver state tree
187 # associated with the block device (which is currently ejected), that
188 # tree will be loaded as the medium.
190 # If the tray was already closed before, this will be a no-op.
192 # @device: Block device name
194 # @id: The name or QOM path of the guest device (since: 2.8)
198 # @deprecated: Member @device is deprecated. Use @id instead.
204 # -> { "execute": "blockdev-close-tray",
205 # "arguments": { "id": "ide0-1-0" } }
207 # <- { "timestamp": { "seconds": 1418751345,
208 # "microseconds": 272147 },
209 # "event": "DEVICE_TRAY_MOVED",
210 # "data": { "device": "ide1-cd0",
212 # "tray-open": false } }
214 # <- { "return": {} }
216 { 'command': 'blockdev-close-tray',
217 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
221 # @blockdev-remove-medium:
223 # Removes a medium (a block driver state tree) from a block device.
224 # That block device's tray must currently be open (unless there is no
225 # attached guest device).
227 # If the tray is open and there is no medium inserted, this will be a
230 # @id: The name or QOM path of the guest device
236 # -> { "execute": "blockdev-remove-medium",
237 # "arguments": { "id": "ide0-1-0" } }
239 # <- { "error": { "class": "GenericError",
240 # "desc": "Tray of device 'ide0-1-0' is not open" } }
242 # -> { "execute": "blockdev-open-tray",
243 # "arguments": { "id": "ide0-1-0" } }
245 # <- { "timestamp": { "seconds": 1418751627,
246 # "microseconds": 549958 },
247 # "event": "DEVICE_TRAY_MOVED",
248 # "data": { "device": "ide1-cd0",
250 # "tray-open": true } }
252 # <- { "return": {} }
254 # -> { "execute": "blockdev-remove-medium",
255 # "arguments": { "id": "ide0-1-0" } }
257 # <- { "return": {} }
259 { 'command': 'blockdev-remove-medium',
260 'data': { 'id': 'str' } }
263 # @blockdev-insert-medium:
265 # Inserts a medium (a block driver state tree) into a block device.
266 # That block device's tray must currently be open (unless there is no
267 # attached guest device) and there must be no medium inserted already.
269 # @id: The name or QOM path of the guest device
271 # @node-name: name of a node in the block driver state graph
277 # -> { "execute": "blockdev-add",
279 # "node-name": "node0",
281 # "file": { "driver": "file",
282 # "filename": "fedora.iso" } } }
283 # <- { "return": {} }
285 # -> { "execute": "blockdev-insert-medium",
286 # "arguments": { "id": "ide0-1-0",
287 # "node-name": "node0" } }
289 # <- { "return": {} }
291 { 'command': 'blockdev-insert-medium',
292 'data': { 'id': 'str',
293 'node-name': 'str'} }
296 # @BlockdevChangeReadOnlyMode:
298 # Specifies the new read-only mode of a block device subject to the
299 # @blockdev-change-medium command.
301 # @retain: Retains the current read-only mode
303 # @read-only: Makes the device read-only
305 # @read-write: Makes the device writable
309 { 'enum': 'BlockdevChangeReadOnlyMode',
310 'data': ['retain', 'read-only', 'read-write'] }
313 # @blockdev-change-medium:
315 # Changes the medium inserted into a block device by ejecting the
316 # current medium and loading a new image file which is inserted as the
317 # new medium (this command combines blockdev-open-tray,
318 # blockdev-remove-medium, blockdev-insert-medium and
319 # blockdev-close-tray).
321 # @device: Block device name
323 # @id: The name or QOM path of the guest device (since: 2.8)
325 # @filename: filename of the new image to be loaded
327 # @format: format to open the new image with (defaults to the probed
330 # @read-only-mode: change the read-only mode of the device; defaults
333 # @force: if false (the default), an eject request through
334 # blockdev-open-tray will be sent to the guest if it has locked
335 # the tray (and the tray will not be opened immediately); if true,
336 # the tray will be opened regardless of whether it is locked.
341 # @deprecated: Member @device is deprecated. Use @id instead.
347 # 1. Change a removable medium
349 # -> { "execute": "blockdev-change-medium",
350 # "arguments": { "id": "ide0-1-0",
351 # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
352 # "format": "raw" } }
353 # <- { "return": {} }
355 # 2. Load a read-only medium into a writable drive
357 # -> { "execute": "blockdev-change-medium",
358 # "arguments": { "id": "floppyA",
359 # "filename": "/srv/images/ro.img",
361 # "read-only-mode": "retain" } }
364 # { "class": "GenericError",
365 # "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
367 # -> { "execute": "blockdev-change-medium",
368 # "arguments": { "id": "floppyA",
369 # "filename": "/srv/images/ro.img",
371 # "read-only-mode": "read-only" } }
373 # <- { "return": {} }
375 { 'command': 'blockdev-change-medium',
376 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] },
381 '*read-only-mode': 'BlockdevChangeReadOnlyMode' } }
384 # @DEVICE_TRAY_MOVED:
386 # Emitted whenever the tray of a removable device is moved by the
387 # guest or by HMP/QMP commands
389 # @device: Block device name. This is always present for
390 # compatibility reasons, but it can be empty ("") if the image
391 # does not have a device name associated.
393 # @id: The name or QOM path of the guest device (since 2.8)
395 # @tray-open: true if the tray has been opened or false if it has been
402 # <- { "event": "DEVICE_TRAY_MOVED",
403 # "data": { "device": "ide1-cd0",
404 # "id": "/machine/unattached/device[22]",
407 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
409 { 'event': 'DEVICE_TRAY_MOVED',
410 'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
413 # @PR_MANAGER_STATUS_CHANGED:
415 # Emitted whenever the connected status of a persistent reservation
418 # @id: The id of the PR manager object
420 # @connected: true if the PR manager is connected to a backend
426 # <- { "event": "PR_MANAGER_STATUS_CHANGED",
427 # "data": { "id": "pr-helper0",
430 # "timestamp": { "seconds": 1519840375, "microseconds": 450486 } }
432 { 'event': 'PR_MANAGER_STATUS_CHANGED',
433 'data': { 'id': 'str', 'connected': 'bool' } }
436 # @block_set_io_throttle:
438 # Change I/O throttle limits for a block drive.
440 # Since QEMU 2.4, each device with I/O limits is member of a throttle
443 # If two or more devices are members of the same group, the limits
444 # will apply to the combined I/O of the whole group in a round-robin
445 # fashion. Therefore, setting new I/O limits to a device will affect
448 # The name of the group can be specified using the 'group' parameter.
449 # If the parameter is unset, it is assumed to be the current group of
450 # that device. If it's not in any group yet, the name of the device
451 # will be used as the name for its group.
453 # The 'group' parameter can also be used to move a device to a
454 # different group. In this case the limits specified in the
455 # parameters will be applied to the new group only.
457 # I/O limits can be disabled by setting all of them to 0. In this case
458 # the device will be removed from its group and the rest of its
459 # members will not be affected. The 'group' parameter is ignored.
462 # - If @device is not a valid block device, DeviceNotFound
468 # -> { "execute": "block_set_io_throttle",
469 # "arguments": { "id": "virtio-blk-pci0/virtio-backend",
482 # "bps_max_length": 0,
484 # <- { "return": {} }
486 # -> { "execute": "block_set_io_throttle",
487 # "arguments": { "id": "ide0-1-0",
494 # "bps_max": 8000000,
500 # "bps_max_length": 60,
502 # <- { "return": {} }
504 { 'command': 'block_set_io_throttle', 'boxed': true,
505 'data': 'BlockIOThrottle',
506 'allow-preconfig': true }
509 # @block-latency-histogram-set:
511 # Manage read, write and flush latency histograms for the device.
513 # If only @id parameter is specified, remove all present latency
514 # histograms for the device. Otherwise, add/reset some of (or all)
515 # latency histograms.
517 # @id: The name or QOM path of the guest device.
519 # @boundaries: list of interval boundary values (see description in
520 # BlockLatencyHistogramInfo definition). If specified, all latency
521 # histograms are removed, and empty ones created for all io types
522 # with intervals corresponding to @boundaries (except for io
523 # types, for which specific boundaries are set through the
524 # following parameters).
526 # @boundaries-read: list of interval boundary values for read latency
527 # histogram. If specified, old read latency histogram is removed,
528 # and empty one created with intervals corresponding to
529 # @boundaries-read. The parameter has higher priority then
532 # @boundaries-write: list of interval boundary values for write
535 # @boundaries-zap: list of interval boundary values for zone append
536 # write latency histogram.
538 # @boundaries-flush: list of interval boundary values for flush
542 # - if device is not found or any boundary arrays are invalid.
548 # Set new histograms for all io types with intervals [0, 10), [10,
549 # 50), [50, 100), [100, +inf):
551 # -> { "execute": "block-latency-histogram-set",
552 # "arguments": { "id": "drive0",
553 # "boundaries": [10, 50, 100] } }
554 # <- { "return": {} }
558 # Set new histogram only for write, other histograms will remain not
559 # changed (or not created):
561 # -> { "execute": "block-latency-histogram-set",
562 # "arguments": { "id": "drive0",
563 # "boundaries-write": [10, 50, 100] } }
564 # <- { "return": {} }
568 # Set new histograms with the following intervals: read, flush: [0,
569 # 10), [10, 50), [50, 100), [100, +inf) write: [0, 1000), [1000,
570 # 5000), [5000, +inf)
572 # -> { "execute": "block-latency-histogram-set",
573 # "arguments": { "id": "drive0",
574 # "boundaries": [10, 50, 100],
575 # "boundaries-write": [1000, 5000] } }
576 # <- { "return": {} }
580 # Remove all latency histograms:
582 # -> { "execute": "block-latency-histogram-set",
583 # "arguments": { "id": "drive0" } }
584 # <- { "return": {} }
586 { 'command': 'block-latency-histogram-set',
587 'data': {'id': 'str',
588 '*boundaries': ['uint64'],
589 '*boundaries-read': ['uint64'],
590 '*boundaries-write': ['uint64'],
591 '*boundaries-zap': ['uint64'],
592 '*boundaries-flush': ['uint64'] },
593 'allow-preconfig': true }