Merge remote-tracking branch 'remotes/bkoppelmann/tags/pull-tricore-20150629' into...
[qemu.git] / qapi / block.json
blobaad645c4a6bf0905baeeb1f25369670de05650cb
1 # -*- Mode: Python -*-
3 # QAPI block definitions (vm related)
5 # QAPI block core definitions
6 { 'include': 'block-core.json' }
8 ##
9 # BiosAtaTranslation:
11 # Policy that BIOS should use to interpret cylinder/head/sector
12 # addresses.  Note that Bochs BIOS and SeaBIOS will not actually
13 # translate logical CHS to physical; instead, they will use logical
14 # block addressing.
16 # @auto: If cylinder/heads/sizes are passed, choose between none and LBA
17 #        depending on the size of the disk.  If they are not passed,
18 #        choose none if QEMU can guess that the disk had 16 or fewer
19 #        heads, large if QEMU can guess that the disk had 131072 or
20 #        fewer tracks across all heads (i.e. cylinders*heads<131072),
21 #        otherwise LBA.
23 # @none: The physical disk geometry is equal to the logical geometry.
25 # @lba: Assume 63 sectors per track and one of 16, 32, 64, 128 or 255
26 #       heads (if fewer than 255 are enough to cover the whole disk
27 #       with 1024 cylinders/head).  The number of cylinders/head is
28 #       then computed based on the number of sectors and heads.
30 # @large: The number of cylinders per head is scaled down to 1024
31 #         by correspondingly scaling up the number of heads.
33 # @rechs: Same as @large, but first convert a 16-head geometry to
34 #         15-head, by proportionally scaling up the number of
35 #         cylinders/head.
37 # Since: 2.0
39 { 'enum': 'BiosAtaTranslation',
40   'data': ['auto', 'none', 'lba', 'large', 'rechs']}
43 # @BlockdevSnapshotInternal
45 # @device: the name of the device to generate the snapshot from
47 # @name: the name of the internal snapshot to be created
49 # Notes: In transaction, if @name is empty, or any snapshot matching @name
50 #        exists, the operation will fail. Only some image formats support it,
51 #        for example, qcow2, rbd, and sheepdog.
53 # Since: 1.7
55 { 'struct': 'BlockdevSnapshotInternal',
56   'data': { 'device': 'str', 'name': 'str' } }
59 # @blockdev-snapshot-internal-sync
61 # Synchronously take an internal snapshot of a block device, when the format
62 # of the image used supports it.
64 # For the arguments, see the documentation of BlockdevSnapshotInternal.
66 # Returns: nothing on success
67 #          If @device is not a valid block device, DeviceNotFound
68 #          If any snapshot matching @name exists, or @name is empty,
69 #          GenericError
70 #          If the format of the image used does not support it,
71 #          BlockFormatFeatureNotSupported
73 # Since 1.7
75 { 'command': 'blockdev-snapshot-internal-sync',
76   'data': 'BlockdevSnapshotInternal' }
79 # @blockdev-snapshot-delete-internal-sync
81 # Synchronously delete an internal snapshot of a block device, when the format
82 # of the image used support it. The snapshot is identified by name or id or
83 # both. One of the name or id is required. Return SnapshotInfo for the
84 # successfully deleted snapshot.
86 # @device: the name of the device to delete the snapshot from
88 # @id: optional the snapshot's ID to be deleted
90 # @name: optional the snapshot's name to be deleted
92 # Returns: SnapshotInfo on success
93 #          If @device is not a valid block device, DeviceNotFound
94 #          If snapshot not found, GenericError
95 #          If the format of the image used does not support it,
96 #          BlockFormatFeatureNotSupported
97 #          If @id and @name are both not specified, GenericError
99 # Since 1.7
101 { 'command': 'blockdev-snapshot-delete-internal-sync',
102   'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
103   'returns': 'SnapshotInfo' }
106 # @eject:
108 # Ejects a device from a removable drive.
110 # @device:  The name of the device
112 # @force:   @optional If true, eject regardless of whether the drive is locked.
113 #           If not specified, the default value is false.
115 # Returns:  Nothing on success
116 #           If @device is not a valid block device, DeviceNotFound
118 # Notes:    Ejecting a device will no media results in success
120 # Since: 0.14.0
122 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
125 # @nbd-server-start:
127 # Start an NBD server listening on the given host and port.  Block
128 # devices can then be exported using @nbd-server-add.  The NBD
129 # server will present them as named exports; for example, another
130 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
132 # @addr: Address on which to listen.
134 # Returns: error if the server is already running.
136 # Since: 1.3.0
138 { 'command': 'nbd-server-start',
139   'data': { 'addr': 'SocketAddress' } }
142 # @nbd-server-add:
144 # Export a device to QEMU's embedded NBD server.
146 # @device: Block device to be exported
148 # @writable: Whether clients should be able to write to the device via the
149 #     NBD connection (default false). #optional
151 # Returns: error if the device is already marked for export.
153 # Since: 1.3.0
155 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
158 # @nbd-server-stop:
160 # Stop QEMU's embedded NBD server, and unregister all devices previously
161 # added via @nbd-server-add.
163 # Since: 1.3.0
165 { 'command': 'nbd-server-stop' }
168 # @DEVICE_TRAY_MOVED
170 # Emitted whenever the tray of a removable device is moved by the guest or by
171 # HMP/QMP commands
173 # @device: device name
175 # @tray-open: true if the tray has been opened or false if it has been closed
177 # Since: 1.1
179 { 'event': 'DEVICE_TRAY_MOVED',
180   'data': { 'device': 'str', 'tray-open': 'bool' } }