]> Git Repo - qemu.git/blob - qapi/block.json
qmp-commands: move 'blockdev-snapshot-internal-sync' doc to schema
[qemu.git] / qapi / block.json
1 # -*- Mode: Python -*-
2
3 ##
4 # = QAPI block definitions
5 ##
6
7 # QAPI block core definitions
8 { 'include': 'block-core.json' }
9
10 ##
11 # == QAPI block definitions (vm unrelated)
12 ##
13
14 ##
15 # @BiosAtaTranslation:
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
48 ##
49 # @FloppyDriveType:
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
64 ##
65 # @BlockdevSnapshotInternal:
66 #
67 # @device: the device name or node-name of a root node to generate the snapshot
68 #          from
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 ##
78 { 'struct': 'BlockdevSnapshotInternal',
79   'data': { 'device': 'str', 'name': 'str' } }
80
81 ##
82 # @blockdev-snapshot-internal-sync:
83 #
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.
88 #
89 # For the arguments, see the documentation of BlockdevSnapshotInternal.
90 #
91 # Returns: nothing on success
92 #
93 #          If @device is not a valid block device, GenericError
94 #
95 #          If any snapshot matching @name exists, or @name is empty,
96 #          GenericError
97 #
98 #          If the format of the image used does not support it,
99 #          BlockFormatFeatureNotSupported
100 #
101 # Since: 1.7
102 #
103 # Example:
104 #
105 # -> { "execute": "blockdev-snapshot-internal-sync",
106 #      "arguments": { "device": "ide-hd0",
107 #                     "name": "snapshot0" }
108 #    }
109 # <- { "return": {} }
110 #
111 ##
112 { 'command': 'blockdev-snapshot-internal-sync',
113   'data': 'BlockdevSnapshotInternal' }
114
115 ##
116 # @blockdev-snapshot-delete-internal-sync:
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 #
123 # @device: the device name or node-name of a root node to delete the snapshot
124 #          from
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
131 #          If @device is not a valid block device, GenericError
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 #
137 # Since: 1.7
138 ##
139 { 'command': 'blockdev-snapshot-delete-internal-sync',
140   'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
141   'returns': 'SnapshotInfo' }
142
143 ##
144 # @eject:
145 #
146 # Ejects a device from a removable drive.
147 #
148 # @device:  #optional Block device name (deprecated, use @id instead)
149 #
150 # @id:      #optional The name or QOM path of the guest device (since: 2.8)
151 #
152 # @force:   @optional If true, eject regardless of whether the drive is locked.
153 #           If not specified, the default value is false.
154 #
155 # Returns:  Nothing on success
156 #           If @device is not a valid block device, DeviceNotFound
157 #
158 # Notes:    Ejecting a device will no media results in success
159 #
160 # Since: 0.14.0
161 ##
162 { 'command': 'eject',
163   'data': { '*device': 'str',
164             '*id': 'str',
165             '*force': 'bool' } }
166
167 ##
168 # @nbd-server-start:
169 #
170 # Start an NBD server listening on the given host and port.  Block
171 # devices can then be exported using @nbd-server-add.  The NBD
172 # server will present them as named exports; for example, another
173 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
174 #
175 # @addr: Address on which to listen.
176 # @tls-creds: (optional) ID of the TLS credentials object. Since 2.6
177 #
178 # Returns: error if the server is already running.
179 #
180 # Since: 1.3.0
181 ##
182 { 'command': 'nbd-server-start',
183   'data': { 'addr': 'SocketAddress',
184             '*tls-creds': 'str'} }
185
186 ##
187 # @nbd-server-add:
188 #
189 # Export a block node to QEMU's embedded NBD server.
190 #
191 # @device: The device name or node name of the node to be exported
192 #
193 # @writable: Whether clients should be able to write to the device via the
194 #     NBD connection (default false). #optional
195 #
196 # Returns: error if the device is already marked for export.
197 #
198 # Since: 1.3.0
199 ##
200 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
201
202 ##
203 # @nbd-server-stop:
204 #
205 # Stop QEMU's embedded NBD server, and unregister all devices previously
206 # added via @nbd-server-add.
207 #
208 # Since: 1.3.0
209 ##
210 { 'command': 'nbd-server-stop' }
211
212 ##
213 # @DEVICE_TRAY_MOVED:
214 #
215 # Emitted whenever the tray of a removable device is moved by the guest or by
216 # HMP/QMP commands
217 #
218 # @device: Block device name. This is always present for compatibility
219 #          reasons, but it can be empty ("") if the image does not
220 #          have a device name associated.
221 #
222 # @id: The name or QOM path of the guest device (since 2.8)
223 #
224 # @tray-open: true if the tray has been opened or false if it has been closed
225 #
226 # Since: 1.1
227 ##
228 { 'event': 'DEVICE_TRAY_MOVED',
229   'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
230
231 ##
232 # @QuorumOpType:
233 #
234 # An enumeration of the quorum operation types
235 #
236 # @read: read operation
237 #
238 # @write: write operation
239 #
240 # @flush: flush operation
241 #
242 # Since: 2.6
243 ##
244 { 'enum': 'QuorumOpType',
245   'data': [ 'read', 'write', 'flush' ] }
This page took 0.035886 seconds and 4 git commands to generate.