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']}
64 # @BlockdevSnapshotInternal:
66 # @device: the device name or node-name of a root node to generate the snapshot
69 # @name: the name of the internal snapshot to be created
71 # Notes: In transaction, if @name is empty, or any snapshot matching @name
72 # exists, the operation will fail. Only some image formats support it,
73 # for example, qcow2, rbd, and sheepdog.
77 { 'struct': 'BlockdevSnapshotInternal',
78 'data': { 'device': 'str', 'name': 'str' } }
83 # Information about a persistent reservation manager
85 # @id: the identifier of the persistent reservation manager
87 # @connected: true if the persistent reservation manager is connected to
88 # the underlying storage or helper
92 { 'struct': 'PRManagerInfo',
93 'data': {'id': 'str', 'connected': 'bool'} }
98 # Returns a list of information about each persistent reservation manager.
100 # Returns: a list of @PRManagerInfo for each persistent reservation manager
104 { 'command': 'query-pr-managers', 'returns': ['PRManagerInfo'],
105 'allow-preconfig': true }
109 # @blockdev-snapshot-internal-sync:
111 # Synchronously take an internal snapshot of a block device, when the
112 # format of the image used supports it. If the name is an empty
113 # string, or a snapshot with name already exists, the operation will
116 # For the arguments, see the documentation of BlockdevSnapshotInternal.
118 # Returns: nothing on success
120 # If @device is not a valid block device, GenericError
122 # If any snapshot matching @name exists, or @name is empty,
125 # If the format of the image used does not support it,
126 # BlockFormatFeatureNotSupported
132 # -> { "execute": "blockdev-snapshot-internal-sync",
133 # "arguments": { "device": "ide-hd0",
134 # "name": "snapshot0" }
136 # <- { "return": {} }
139 { 'command': 'blockdev-snapshot-internal-sync',
140 'data': 'BlockdevSnapshotInternal' }
143 # @blockdev-snapshot-delete-internal-sync:
145 # Synchronously delete an internal snapshot of a block device, when the format
146 # of the image used support it. The snapshot is identified by name or id or
147 # both. One of the name or id is required. Return SnapshotInfo for the
148 # successfully deleted snapshot.
150 # @device: the device name or node-name of a root node to delete the snapshot
153 # @id: optional the snapshot's ID to be deleted
155 # @name: optional the snapshot's name to be deleted
157 # Returns: SnapshotInfo on success
158 # If @device is not a valid block device, GenericError
159 # If snapshot not found, GenericError
160 # If the format of the image used does not support it,
161 # BlockFormatFeatureNotSupported
162 # If @id and @name are both not specified, GenericError
168 # -> { "execute": "blockdev-snapshot-delete-internal-sync",
169 # "arguments": { "device": "ide-hd0",
170 # "name": "snapshot0" }
174 # "name": "snapshot0",
175 # "vm-state-size": 0,
176 # "date-sec": 1000012,
178 # "vm-clock-sec": 100,
179 # "vm-clock-nsec": 20
184 { 'command': 'blockdev-snapshot-delete-internal-sync',
185 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
186 'returns': 'SnapshotInfo' }
191 # Ejects a device from a removable drive.
193 # @device: Block device name (deprecated, use @id instead)
195 # @id: The name or QOM path of the guest device (since: 2.8)
197 # @force: If true, eject regardless of whether the drive is locked.
198 # If not specified, the default value is false.
200 # Returns: Nothing on success
202 # If @device is not a valid block device, DeviceNotFound
204 # Notes: Ejecting a device with no media results in success
210 # -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } }
211 # <- { "return": {} }
213 { 'command': 'eject',
214 'data': { '*device': 'str',
221 # Start an NBD server listening on the given host and port. Block
222 # devices can then be exported using @nbd-server-add. The NBD
223 # server will present them as named exports; for example, another
224 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
226 # @addr: Address on which to listen.
227 # @tls-creds: (optional) ID of the TLS credentials object. Since 2.6
229 # Returns: error if the server is already running.
233 { 'command': 'nbd-server-start',
234 'data': { 'addr': 'SocketAddressLegacy',
235 '*tls-creds': 'str'} }
240 # Export a block node to QEMU's embedded NBD server.
242 # @device: The device name or node name of the node to be exported
244 # @name: Export name. If unspecified, the @device parameter is used as the
245 # export name. (Since 2.12)
247 # @writable: Whether clients should be able to write to the device via the
248 # NBD connection (default false).
250 # @bitmap: Also export the dirty bitmap reachable from @device, so the
251 # NBD client can use NBD_OPT_SET_META_CONTEXT with
252 # "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)
254 # Returns: error if the server is not running, or export with the same name
259 { 'command': 'nbd-server-add',
260 'data': {'device': 'str', '*name': 'str', '*writable': 'bool',
264 # @NbdServerRemoveMode:
266 # Mode for removing an NBD export.
268 # @safe: Remove export if there are no existing connections, fail otherwise.
270 # @hard: Drop all connections immediately and remove export.
272 # Potential additional modes to be added in the future:
274 # hide: Just hide export from new clients, leave existing connections as is.
275 # Remove export after all clients are disconnected.
277 # soft: Hide export from new clients, answer with ESHUTDOWN for all further
278 # requests from existing clients.
282 {'enum': 'NbdServerRemoveMode', 'data': ['safe', 'hard']}
285 # @nbd-server-remove:
287 # Remove NBD export by name.
289 # @name: Export name.
291 # @mode: Mode of command operation. See @NbdServerRemoveMode description.
295 # - the server is not running
296 # - export is not found
297 # - mode is 'safe' and there are existing connections
301 { 'command': 'nbd-server-remove',
302 'data': {'name': 'str', '*mode': 'NbdServerRemoveMode'} }
307 # Stop QEMU's embedded NBD server, and unregister all devices previously
308 # added via @nbd-server-add.
312 { 'command': 'nbd-server-stop' }
315 # @DEVICE_TRAY_MOVED:
317 # Emitted whenever the tray of a removable device is moved by the guest or by
320 # @device: Block device name. This is always present for compatibility
321 # reasons, but it can be empty ("") if the image does not
322 # have a device name associated.
324 # @id: The name or QOM path of the guest device (since 2.8)
326 # @tray-open: true if the tray has been opened or false if it has been closed
332 # <- { "event": "DEVICE_TRAY_MOVED",
333 # "data": { "device": "ide1-cd0",
334 # "id": "/machine/unattached/device[22]",
337 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
340 { 'event': 'DEVICE_TRAY_MOVED',
341 'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
344 # @PR_MANAGER_STATUS_CHANGED:
346 # Emitted whenever the connected status of a persistent reservation
349 # @id: The id of the PR manager object
351 # @connected: true if the PR manager is connected to a backend
357 # <- { "event": "PR_MANAGER_STATUS_CHANGED",
358 # "data": { "id": "pr-helper0",
361 # "timestamp": { "seconds": 1519840375, "microseconds": 450486 } }
364 { 'event': 'PR_MANAGER_STATUS_CHANGED',
365 'data': { 'id': 'str', 'connected': 'bool' } }
370 # An enumeration of the quorum operation types
372 # @read: read operation
374 # @write: write operation
376 # @flush: flush operation
380 { 'enum': 'QuorumOpType',
381 'data': [ 'read', 'write', 'flush' ] }
386 # Emitted by the Quorum block driver if it fails to establish a quorum
388 # @reference: device name if defined else node name
390 # @sector-num: number of the first sector of the failed read operation
392 # @sectors-count: failed read operation sector count
394 # Note: This event is rate-limited.
400 # <- { "event": "QUORUM_FAILURE",
401 # "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
402 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
405 { 'event': 'QUORUM_FAILURE',
406 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
409 # @QUORUM_REPORT_BAD:
411 # Emitted to report a corruption of a Quorum file
413 # @type: quorum operation type (Since 2.6)
415 # @error: error message. Only present on failure. This field
416 # contains a human-readable error message. There are no semantics other
417 # than that the block layer reported an error and clients should not
418 # try to interpret the error string.
420 # @node-name: the graph node name of the block driver state
422 # @sector-num: number of the first sector of the failed read operation
424 # @sectors-count: failed read operation sector count
426 # Note: This event is rate-limited.
434 # { "event": "QUORUM_REPORT_BAD",
435 # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
437 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
441 # { "event": "QUORUM_REPORT_BAD",
442 # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
443 # "type": "flush", "error": "Broken pipe" },
444 # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
447 { 'event': 'QUORUM_REPORT_BAD',
448 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
449 'sector-num': 'int', 'sectors-count': 'int' } }