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' } }
81 # @blockdev-snapshot-internal-sync:
83 # Synchronously take an internal snapshot of a block device, when the
84 # format of the image used supports it. If the name is an empty
85 # string, or a snapshot with name already exists, the operation will
88 # For the arguments, see the documentation of BlockdevSnapshotInternal.
90 # Returns: nothing on success
92 # If @device is not a valid block device, GenericError
94 # If any snapshot matching @name exists, or @name is empty,
97 # If the format of the image used does not support it,
98 # BlockFormatFeatureNotSupported
104 # -> { "execute": "blockdev-snapshot-internal-sync",
105 # "arguments": { "device": "ide-hd0",
106 # "name": "snapshot0" }
108 # <- { "return": {} }
111 { 'command': 'blockdev-snapshot-internal-sync',
112 'data': 'BlockdevSnapshotInternal' }
115 # @blockdev-snapshot-delete-internal-sync:
117 # Synchronously delete an internal snapshot of a block device, when the format
118 # of the image used support it. The snapshot is identified by name or id or
119 # both. One of the name or id is required. Return SnapshotInfo for the
120 # successfully deleted snapshot.
122 # @device: the device name or node-name of a root node to delete the snapshot
125 # @id: optional the snapshot's ID to be deleted
127 # @name: optional the snapshot's name to be deleted
129 # Returns: SnapshotInfo on success
130 # If @device is not a valid block device, GenericError
131 # If snapshot not found, GenericError
132 # If the format of the image used does not support it,
133 # BlockFormatFeatureNotSupported
134 # If @id and @name are both not specified, GenericError
140 # -> { "execute": "blockdev-snapshot-delete-internal-sync",
141 # "arguments": { "device": "ide-hd0",
142 # "name": "snapshot0" }
146 # "name": "snapshot0",
147 # "vm-state-size": 0,
148 # "date-sec": 1000012,
150 # "vm-clock-sec": 100,
151 # "vm-clock-nsec": 20
156 { 'command': 'blockdev-snapshot-delete-internal-sync',
157 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
158 'returns': 'SnapshotInfo' }
163 # Ejects a device from a removable drive.
165 # @device: Block device name (deprecated, use @id instead)
167 # @id: The name or QOM path of the guest device (since: 2.8)
169 # @force: If true, eject regardless of whether the drive is locked.
170 # If not specified, the default value is false.
172 # Returns: Nothing on success
174 # If @device is not a valid block device, DeviceNotFound
176 # Notes: Ejecting a device with no media results in success
182 # -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } }
183 # <- { "return": {} }
185 { 'command': 'eject',
186 'data': { '*device': 'str',
193 # Start an NBD server listening on the given host and port. Block
194 # devices can then be exported using @nbd-server-add. The NBD
195 # server will present them as named exports; for example, another
196 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
198 # @addr: Address on which to listen.
199 # @tls-creds: (optional) ID of the TLS credentials object. Since 2.6
201 # Returns: error if the server is already running.
205 { 'command': 'nbd-server-start',
206 'data': { 'addr': 'SocketAddressLegacy',
207 '*tls-creds': 'str'} }
212 # Export a block node to QEMU's embedded NBD server.
214 # @device: The device name or node name of the node to be exported
216 # @name: Export name. If unspecified, the @device parameter is used as the
217 # export name. (Since 2.12)
219 # @writable: Whether clients should be able to write to the device via the
220 # NBD connection (default false).
222 # Returns: error if the server is not running, or export with the same name
227 { 'command': 'nbd-server-add',
228 'data': {'device': 'str', '*name': 'str', '*writable': 'bool'} }
233 # Stop QEMU's embedded NBD server, and unregister all devices previously
234 # added via @nbd-server-add.
238 { 'command': 'nbd-server-stop' }
241 # @DEVICE_TRAY_MOVED:
243 # Emitted whenever the tray of a removable device is moved by the guest or by
246 # @device: Block device name. This is always present for compatibility
247 # reasons, but it can be empty ("") if the image does not
248 # have a device name associated.
250 # @id: The name or QOM path of the guest device (since 2.8)
252 # @tray-open: true if the tray has been opened or false if it has been closed
258 # <- { "event": "DEVICE_TRAY_MOVED",
259 # "data": { "device": "ide1-cd0",
260 # "id": "/machine/unattached/device[22]",
263 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
266 { 'event': 'DEVICE_TRAY_MOVED',
267 'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
272 # An enumeration of the quorum operation types
274 # @read: read operation
276 # @write: write operation
278 # @flush: flush operation
282 { 'enum': 'QuorumOpType',
283 'data': [ 'read', 'write', 'flush' ] }
288 # Emitted by the Quorum block driver if it fails to establish a quorum
290 # @reference: device name if defined else node name
292 # @sector-num: number of the first sector of the failed read operation
294 # @sectors-count: failed read operation sector count
296 # Note: This event is rate-limited.
302 # <- { "event": "QUORUM_FAILURE",
303 # "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
304 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
307 { 'event': 'QUORUM_FAILURE',
308 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
311 # @QUORUM_REPORT_BAD:
313 # Emitted to report a corruption of a Quorum file
315 # @type: quorum operation type (Since 2.6)
317 # @error: error message. Only present on failure. This field
318 # contains a human-readable error message. There are no semantics other
319 # than that the block layer reported an error and clients should not
320 # try to interpret the error string.
322 # @node-name: the graph node name of the block driver state
324 # @sector-num: number of the first sector of the failed read operation
326 # @sectors-count: failed read operation sector count
328 # Note: This event is rate-limited.
336 # { "event": "QUORUM_REPORT_BAD",
337 # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
339 # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
343 # { "event": "QUORUM_REPORT_BAD",
344 # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
345 # "type": "flush", "error": "Broken pipe" },
346 # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
349 { 'event': 'QUORUM_REPORT_BAD',
350 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
351 'sector-num': 'int', 'sectors-count': 'int' } }