3 # QAPI block definitions (vm related)
5 # QAPI block core definitions
6 { 'include': 'block-core.json' }
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
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),
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
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.
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,
70 # If the format of the image used does not support it,
71 # BlockFormatFeatureNotSupported
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
101 { 'command': 'blockdev-snapshot-delete-internal-sync',
102 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
103 'returns': 'SnapshotInfo' }
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
122 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
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.
138 { 'command': 'nbd-server-start',
139 'data': { 'addr': 'SocketAddress' } }
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.
155 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
160 # Stop QEMU's embedded NBD server, and unregister all devices previously
161 # added via @nbd-server-add.
165 { 'command': 'nbd-server-stop' }
170 # Emitted whenever the tray of a removable device is moved by the guest or by
173 # @device: device name
175 # @tray-open: true if the tray has been opened or false if it has been closed
179 { 'event': 'DEVICE_TRAY_MOVED',
180 'data': { 'device': 'str', 'tray-open': 'bool' } }