]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/block.json
sparc32_dma: make esp device child of espdma device
[mirror_qemu.git] / qapi / block.json
CommitLineData
5db15096 1# -*- Mode: Python -*-
d3a48372
MAL
2
3##
f5cf31c5 4# = Block devices
d3a48372 5##
5db15096 6
5db15096
BC
7{ 'include': 'block-core.json' }
8
d3a48372 9##
f5cf31c5 10# == Additional block stuff (VM related)
d3a48372
MAL
11##
12
2e95fa17 13##
f169f8fb 14# @BiosAtaTranslation:
2e95fa17
BC
15#
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
19# block addressing.
20#
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),
26# otherwise LBA.
27#
28# @none: The physical disk geometry is equal to the logical geometry.
29#
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.
34#
35# @large: The number of cylinders per head is scaled down to 1024
36# by correspondingly scaling up the number of heads.
37#
38# @rechs: Same as @large, but first convert a 16-head geometry to
39# 15-head, by proportionally scaling up the number of
40# cylinders/head.
41#
42# Since: 2.0
43##
44{ 'enum': 'BiosAtaTranslation',
45 'data': ['auto', 'none', 'lba', 'large', 'rechs']}
46
2da44dd0 47##
5072f7b3 48# @FloppyDriveType:
2da44dd0
JS
49#
50# Type of Floppy drive to be emulated by the Floppy Disk Controller.
51#
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
57#
58# Since: 2.6
59##
60{ 'enum': 'FloppyDriveType',
61 'data': ['144', '288', '120', 'none', 'auto']}
62
2e95fa17 63##
5072f7b3 64# @BlockdevSnapshotInternal:
2e95fa17 65#
75dfd402
KW
66# @device: the device name or node-name of a root node to generate the snapshot
67# from
2e95fa17
BC
68#
69# @name: the name of the internal snapshot to be created
70#
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.
74#
75# Since: 1.7
76##
895a2a80 77{ 'struct': 'BlockdevSnapshotInternal',
2e95fa17
BC
78 'data': { 'device': 'str', 'name': 'str' } }
79
80##
5072f7b3 81# @blockdev-snapshot-internal-sync:
2e95fa17 82#
bfeafc9c
MAL
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
86# fail.
2e95fa17
BC
87#
88# For the arguments, see the documentation of BlockdevSnapshotInternal.
89#
90# Returns: nothing on success
bfeafc9c 91#
75dfd402 92# If @device is not a valid block device, GenericError
bfeafc9c 93#
2e95fa17
BC
94# If any snapshot matching @name exists, or @name is empty,
95# GenericError
bfeafc9c 96#
2e95fa17
BC
97# If the format of the image used does not support it,
98# BlockFormatFeatureNotSupported
99#
5072f7b3 100# Since: 1.7
bfeafc9c
MAL
101#
102# Example:
103#
104# -> { "execute": "blockdev-snapshot-internal-sync",
105# "arguments": { "device": "ide-hd0",
106# "name": "snapshot0" }
107# }
108# <- { "return": {} }
109#
2e95fa17
BC
110##
111{ 'command': 'blockdev-snapshot-internal-sync',
112 'data': 'BlockdevSnapshotInternal' }
113
114##
5072f7b3 115# @blockdev-snapshot-delete-internal-sync:
2e95fa17
BC
116#
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.
121#
2dfb4c03
KW
122# @device: the device name or node-name of a root node to delete the snapshot
123# from
2e95fa17
BC
124#
125# @id: optional the snapshot's ID to be deleted
126#
127# @name: optional the snapshot's name to be deleted
128#
129# Returns: SnapshotInfo on success
2dfb4c03 130# If @device is not a valid block device, GenericError
2e95fa17
BC
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
135#
5072f7b3 136# Since: 1.7
b31177b0
MAL
137#
138# Example:
139#
140# -> { "execute": "blockdev-snapshot-delete-internal-sync",
141# "arguments": { "device": "ide-hd0",
142# "name": "snapshot0" }
143# }
144# <- { "return": {
145# "id": "1",
146# "name": "snapshot0",
147# "vm-state-size": 0,
148# "date-sec": 1000012,
149# "date-nsec": 10,
150# "vm-clock-sec": 100,
151# "vm-clock-nsec": 20
152# }
153# }
154#
2e95fa17
BC
155##
156{ 'command': 'blockdev-snapshot-delete-internal-sync',
157 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
158 'returns': 'SnapshotInfo' }
159
160##
161# @eject:
162#
163# Ejects a device from a removable drive.
164#
1d8bda12 165# @device: Block device name (deprecated, use @id instead)
fbe2d816 166#
1d8bda12 167# @id: The name or QOM path of the guest device (since: 2.8)
2e95fa17 168#
1d8bda12 169# @force: If true, eject regardless of whether the drive is locked.
2e95fa17
BC
170# If not specified, the default value is false.
171#
172# Returns: Nothing on success
5fba0a72 173#
2e95fa17
BC
174# If @device is not a valid block device, DeviceNotFound
175#
5fba0a72 176# Notes: Ejecting a device with no media results in success
2e95fa17
BC
177#
178# Since: 0.14.0
5fba0a72
MAL
179#
180# Example:
181#
244d04db 182# -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } }
5fba0a72 183# <- { "return": {} }
2e95fa17 184##
fbe2d816
KW
185{ 'command': 'eject',
186 'data': { '*device': 'str',
187 '*id': 'str',
188 '*force': 'bool' } }
2e95fa17
BC
189
190##
191# @nbd-server-start:
192#
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".
197#
198# @addr: Address on which to listen.
ddffee39 199# @tls-creds: (optional) ID of the TLS credentials object. Since 2.6
2e95fa17
BC
200#
201# Returns: error if the server is already running.
202#
203# Since: 1.3.0
204##
205{ 'command': 'nbd-server-start',
dfd100f2 206 'data': { 'addr': 'SocketAddressLegacy',
ddffee39 207 '*tls-creds': 'str'} }
2e95fa17
BC
208
209##
210# @nbd-server-add:
211#
094138d0 212# Export a block node to QEMU's embedded NBD server.
2e95fa17 213#
094138d0 214# @device: The device name or node name of the node to be exported
2e95fa17
BC
215#
216# @writable: Whether clients should be able to write to the device via the
1d8bda12 217# NBD connection (default false).
2e95fa17
BC
218#
219# Returns: error if the device is already marked for export.
220#
221# Since: 1.3.0
222##
223{ 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
224
225##
226# @nbd-server-stop:
227#
228# Stop QEMU's embedded NBD server, and unregister all devices previously
229# added via @nbd-server-add.
230#
231# Since: 1.3.0
232##
233{ 'command': 'nbd-server-stop' }
234
a5ee7bd4 235##
5072f7b3 236# @DEVICE_TRAY_MOVED:
a5ee7bd4
WX
237#
238# Emitted whenever the tray of a removable device is moved by the guest or by
239# HMP/QMP commands
240#
2d76e724
KW
241# @device: Block device name. This is always present for compatibility
242# reasons, but it can be empty ("") if the image does not
243# have a device name associated.
244#
d750c3a9 245# @id: The name or QOM path of the guest device (since 2.8)
a5ee7bd4
WX
246#
247# @tray-open: true if the tray has been opened or false if it has been closed
248#
249# Since: 1.1
01b7d4be
MAL
250#
251# Example:
252#
253# <- { "event": "DEVICE_TRAY_MOVED",
254# "data": { "device": "ide1-cd0",
255# "id": "/machine/unattached/device[22]",
256# "tray-open": true
257# },
258# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
259#
a5ee7bd4
WX
260##
261{ 'event': 'DEVICE_TRAY_MOVED',
2d76e724 262 'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
0ae053b7
CX
263
264##
5072f7b3 265# @QuorumOpType:
0ae053b7
CX
266#
267# An enumeration of the quorum operation types
268#
269# @read: read operation
270#
271# @write: write operation
272#
273# @flush: flush operation
274#
275# Since: 2.6
276##
277{ 'enum': 'QuorumOpType',
278 'data': [ 'read', 'write', 'flush' ] }
fd87a6bd
MA
279
280##
281# @QUORUM_FAILURE:
282#
283# Emitted by the Quorum block driver if it fails to establish a quorum
284#
285# @reference: device name if defined else node name
286#
287# @sector-num: number of the first sector of the failed read operation
288#
289# @sectors-count: failed read operation sector count
290#
291# Note: This event is rate-limited.
292#
293# Since: 2.0
294#
295# Example:
296#
297# <- { "event": "QUORUM_FAILURE",
298# "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
299# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
300#
301##
302{ 'event': 'QUORUM_FAILURE',
303 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
304
305##
306# @QUORUM_REPORT_BAD:
307#
308# Emitted to report a corruption of a Quorum file
309#
310# @type: quorum operation type (Since 2.6)
311#
312# @error: error message. Only present on failure. This field
313# contains a human-readable error message. There are no semantics other
314# than that the block layer reported an error and clients should not
315# try to interpret the error string.
316#
317# @node-name: the graph node name of the block driver state
318#
319# @sector-num: number of the first sector of the failed read operation
320#
321# @sectors-count: failed read operation sector count
322#
323# Note: This event is rate-limited.
324#
325# Since: 2.0
326#
327# Example:
328#
329# 1. Read operation
330#
331# { "event": "QUORUM_REPORT_BAD",
332# "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
333# "type": "read" },
334# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
335#
336# 2. Flush operation
337#
338# { "event": "QUORUM_REPORT_BAD",
339# "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
340# "type": "flush", "error": "Broken pipe" },
341# "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
342#
343##
344{ 'event': 'QUORUM_REPORT_BAD',
345 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
346 'sector-num': 'int', 'sectors-count': 'int' } }