]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/block.json
block/parallels: Avoid overflows
[mirror_qemu.git] / qapi / block.json
CommitLineData
5db15096 1# -*- Mode: Python -*-
d3a48372
MAL
2
3##
4# = QAPI block definitions
5##
5db15096
BC
6
7# QAPI block core definitions
8{ 'include': 'block-core.json' }
9
d3a48372
MAL
10##
11# == QAPI block definitions (vm unrelated)
12##
13
2e95fa17 14##
f169f8fb 15# @BiosAtaTranslation:
2e95fa17
BC
16#
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
20# block addressing.
21#
22# @auto: If cylinder/heads/sizes are passed, choose between none and LBA
23# 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
26# fewer tracks across all heads (i.e. cylinders*heads<131072),
27# otherwise LBA.
28#
29# @none: The physical disk geometry is equal to the logical geometry.
30#
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
33# with 1024 cylinders/head). The number of cylinders/head is
34# then computed based on the number of sectors and heads.
35#
36# @large: The number of cylinders per head is scaled down to 1024
37# by correspondingly scaling up the number of heads.
38#
39# @rechs: Same as @large, but first convert a 16-head geometry to
40# 15-head, by proportionally scaling up the number of
41# cylinders/head.
42#
43# Since: 2.0
44##
45{ 'enum': 'BiosAtaTranslation',
46 'data': ['auto', 'none', 'lba', 'large', 'rechs']}
47
2da44dd0 48##
5072f7b3 49# @FloppyDriveType:
2da44dd0
JS
50#
51# Type of Floppy drive to be emulated by the Floppy Disk Controller.
52#
53# @144: 1.44MB 3.5" drive
54# @288: 2.88MB 3.5" drive
55# @120: 1.2MB 5.25" drive
56# @none: No drive connected
57# @auto: Automatically determined by inserted media at boot
58#
59# Since: 2.6
60##
61{ 'enum': 'FloppyDriveType',
62 'data': ['144', '288', '120', 'none', 'auto']}
63
2e95fa17 64##
5072f7b3 65# @BlockdevSnapshotInternal:
2e95fa17 66#
75dfd402
KW
67# @device: the device name or node-name of a root node to generate the snapshot
68# from
2e95fa17
BC
69#
70# @name: the name of the internal snapshot to be created
71#
72# Notes: In transaction, if @name is empty, or any snapshot matching @name
73# exists, the operation will fail. Only some image formats support it,
74# for example, qcow2, rbd, and sheepdog.
75#
76# Since: 1.7
77##
895a2a80 78{ 'struct': 'BlockdevSnapshotInternal',
2e95fa17
BC
79 'data': { 'device': 'str', 'name': 'str' } }
80
81##
5072f7b3 82# @blockdev-snapshot-internal-sync:
2e95fa17 83#
bfeafc9c
MAL
84# Synchronously take an internal snapshot of a block device, when the
85# format of the image used supports it. If the name is an empty
86# string, or a snapshot with name already exists, the operation will
87# fail.
2e95fa17
BC
88#
89# For the arguments, see the documentation of BlockdevSnapshotInternal.
90#
91# Returns: nothing on success
bfeafc9c 92#
75dfd402 93# If @device is not a valid block device, GenericError
bfeafc9c 94#
2e95fa17
BC
95# If any snapshot matching @name exists, or @name is empty,
96# GenericError
bfeafc9c 97#
2e95fa17
BC
98# If the format of the image used does not support it,
99# BlockFormatFeatureNotSupported
100#
5072f7b3 101# Since: 1.7
bfeafc9c
MAL
102#
103# Example:
104#
105# -> { "execute": "blockdev-snapshot-internal-sync",
106# "arguments": { "device": "ide-hd0",
107# "name": "snapshot0" }
108# }
109# <- { "return": {} }
110#
2e95fa17
BC
111##
112{ 'command': 'blockdev-snapshot-internal-sync',
113 'data': 'BlockdevSnapshotInternal' }
114
115##
5072f7b3 116# @blockdev-snapshot-delete-internal-sync:
2e95fa17
BC
117#
118# Synchronously delete an internal snapshot of a block device, when the format
119# of the image used support it. The snapshot is identified by name or id or
120# both. One of the name or id is required. Return SnapshotInfo for the
121# successfully deleted snapshot.
122#
2dfb4c03
KW
123# @device: the device name or node-name of a root node to delete the snapshot
124# from
2e95fa17
BC
125#
126# @id: optional the snapshot's ID to be deleted
127#
128# @name: optional the snapshot's name to be deleted
129#
130# Returns: SnapshotInfo on success
2dfb4c03 131# If @device is not a valid block device, GenericError
2e95fa17
BC
132# If snapshot not found, GenericError
133# If the format of the image used does not support it,
134# BlockFormatFeatureNotSupported
135# If @id and @name are both not specified, GenericError
136#
5072f7b3 137# Since: 1.7
b31177b0
MAL
138#
139# Example:
140#
141# -> { "execute": "blockdev-snapshot-delete-internal-sync",
142# "arguments": { "device": "ide-hd0",
143# "name": "snapshot0" }
144# }
145# <- { "return": {
146# "id": "1",
147# "name": "snapshot0",
148# "vm-state-size": 0,
149# "date-sec": 1000012,
150# "date-nsec": 10,
151# "vm-clock-sec": 100,
152# "vm-clock-nsec": 20
153# }
154# }
155#
2e95fa17
BC
156##
157{ 'command': 'blockdev-snapshot-delete-internal-sync',
158 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
159 'returns': 'SnapshotInfo' }
160
161##
162# @eject:
163#
164# Ejects a device from a removable drive.
165#
1d8bda12 166# @device: Block device name (deprecated, use @id instead)
fbe2d816 167#
1d8bda12 168# @id: The name or QOM path of the guest device (since: 2.8)
2e95fa17 169#
1d8bda12 170# @force: If true, eject regardless of whether the drive is locked.
2e95fa17
BC
171# If not specified, the default value is false.
172#
173# Returns: Nothing on success
5fba0a72 174#
2e95fa17
BC
175# If @device is not a valid block device, DeviceNotFound
176#
5fba0a72 177# Notes: Ejecting a device with no media results in success
2e95fa17
BC
178#
179# Since: 0.14.0
5fba0a72
MAL
180#
181# Example:
182#
183# -> { "execute": "eject", "arguments": { "device": "ide1-0-1" } }
184# <- { "return": {} }
2e95fa17 185##
fbe2d816
KW
186{ 'command': 'eject',
187 'data': { '*device': 'str',
188 '*id': 'str',
189 '*force': 'bool' } }
2e95fa17
BC
190
191##
192# @nbd-server-start:
193#
194# Start an NBD server listening on the given host and port. Block
195# devices can then be exported using @nbd-server-add. The NBD
196# server will present them as named exports; for example, another
197# QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
198#
199# @addr: Address on which to listen.
ddffee39 200# @tls-creds: (optional) ID of the TLS credentials object. Since 2.6
2e95fa17
BC
201#
202# Returns: error if the server is already running.
203#
204# Since: 1.3.0
205##
206{ 'command': 'nbd-server-start',
ddffee39
DB
207 'data': { 'addr': 'SocketAddress',
208 '*tls-creds': 'str'} }
2e95fa17
BC
209
210##
211# @nbd-server-add:
212#
094138d0 213# Export a block node to QEMU's embedded NBD server.
2e95fa17 214#
094138d0 215# @device: The device name or node name of the node to be exported
2e95fa17
BC
216#
217# @writable: Whether clients should be able to write to the device via the
1d8bda12 218# NBD connection (default false).
2e95fa17
BC
219#
220# Returns: error if the device is already marked for export.
221#
222# Since: 1.3.0
223##
224{ 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
225
226##
227# @nbd-server-stop:
228#
229# Stop QEMU's embedded NBD server, and unregister all devices previously
230# added via @nbd-server-add.
231#
232# Since: 1.3.0
233##
234{ 'command': 'nbd-server-stop' }
235
a5ee7bd4 236##
5072f7b3 237# @DEVICE_TRAY_MOVED:
a5ee7bd4
WX
238#
239# Emitted whenever the tray of a removable device is moved by the guest or by
240# HMP/QMP commands
241#
2d76e724
KW
242# @device: Block device name. This is always present for compatibility
243# reasons, but it can be empty ("") if the image does not
244# have a device name associated.
245#
d750c3a9 246# @id: The name or QOM path of the guest device (since 2.8)
a5ee7bd4
WX
247#
248# @tray-open: true if the tray has been opened or false if it has been closed
249#
250# Since: 1.1
01b7d4be
MAL
251#
252# Example:
253#
254# <- { "event": "DEVICE_TRAY_MOVED",
255# "data": { "device": "ide1-cd0",
256# "id": "/machine/unattached/device[22]",
257# "tray-open": true
258# },
259# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
260#
a5ee7bd4
WX
261##
262{ 'event': 'DEVICE_TRAY_MOVED',
2d76e724 263 'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
0ae053b7
CX
264
265##
5072f7b3 266# @QuorumOpType:
0ae053b7
CX
267#
268# An enumeration of the quorum operation types
269#
270# @read: read operation
271#
272# @write: write operation
273#
274# @flush: flush operation
275#
276# Since: 2.6
277##
278{ 'enum': 'QuorumOpType',
279 'data': [ 'read', 'write', 'flush' ] }