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']}
45 # Type of Floppy drive to be emulated by the Floppy Disk Controller.
47 # @144: 1.44MB 3.5" drive
48 # @288: 2.88MB 3.5" drive
49 # @120: 1.2MB 5.25" drive
50 # @none: No drive connected
51 # @auto: Automatically determined by inserted media at boot
55 { 'enum': 'FloppyDriveType',
56 'data': ['144', '288', '120', 'none', 'auto']}
59 # @BlockdevSnapshotInternal
61 # @device: the name of the device to generate the snapshot from
63 # @name: the name of the internal snapshot to be created
65 # Notes: In transaction, if @name is empty, or any snapshot matching @name
66 # exists, the operation will fail. Only some image formats support it,
67 # for example, qcow2, rbd, and sheepdog.
71 { 'struct': 'BlockdevSnapshotInternal',
72 'data': { 'device': 'str', 'name': 'str' } }
75 # @blockdev-snapshot-internal-sync
77 # Synchronously take an internal snapshot of a block device, when the format
78 # of the image used supports it.
80 # For the arguments, see the documentation of BlockdevSnapshotInternal.
82 # Returns: nothing on success
83 # If @device is not a valid block device, DeviceNotFound
84 # If any snapshot matching @name exists, or @name is empty,
86 # If the format of the image used does not support it,
87 # BlockFormatFeatureNotSupported
91 { 'command': 'blockdev-snapshot-internal-sync',
92 'data': 'BlockdevSnapshotInternal' }
95 # @blockdev-snapshot-delete-internal-sync
97 # Synchronously delete an internal snapshot of a block device, when the format
98 # of the image used support it. The snapshot is identified by name or id or
99 # both. One of the name or id is required. Return SnapshotInfo for the
100 # successfully deleted snapshot.
102 # @device: the name of the device to delete the snapshot from
104 # @id: optional the snapshot's ID to be deleted
106 # @name: optional the snapshot's name to be deleted
108 # Returns: SnapshotInfo on success
109 # If @device is not a valid block device, DeviceNotFound
110 # If snapshot not found, GenericError
111 # If the format of the image used does not support it,
112 # BlockFormatFeatureNotSupported
113 # If @id and @name are both not specified, GenericError
117 { 'command': 'blockdev-snapshot-delete-internal-sync',
118 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
119 'returns': 'SnapshotInfo' }
124 # Ejects a device from a removable drive.
126 # @device: The name of the device
128 # @force: @optional If true, eject regardless of whether the drive is locked.
129 # If not specified, the default value is false.
131 # Returns: Nothing on success
132 # If @device is not a valid block device, DeviceNotFound
134 # Notes: Ejecting a device will no media results in success
138 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
143 # Start an NBD server listening on the given host and port. Block
144 # devices can then be exported using @nbd-server-add. The NBD
145 # server will present them as named exports; for example, another
146 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
148 # @addr: Address on which to listen.
150 # Returns: error if the server is already running.
154 { 'command': 'nbd-server-start',
155 'data': { 'addr': 'SocketAddress' } }
160 # Export a device to QEMU's embedded NBD server.
162 # @device: Block device to be exported
164 # @writable: Whether clients should be able to write to the device via the
165 # NBD connection (default false). #optional
167 # Returns: error if the device is already marked for export.
171 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
176 # Stop QEMU's embedded NBD server, and unregister all devices previously
177 # added via @nbd-server-add.
181 { 'command': 'nbd-server-stop' }
186 # Emitted whenever the tray of a removable device is moved by the guest or by
189 # @device: device name
191 # @tray-open: true if the tray has been opened or false if it has been closed
195 { 'event': 'DEVICE_TRAY_MOVED',
196 'data': { 'device': 'str', 'tray-open': 'bool' } }