blob: aad645c4a6bf0905baeeb1f25369670de05650cb [file] [log] [blame]
Benoît Canet5db15092014-06-05 13:45:30 +02001# -*- Mode: Python -*-
2#
3# QAPI block definitions (vm related)
4
5# QAPI block core definitions
6{ 'include': 'block-core.json' }
7
Benoît Canet2e95fa12014-06-05 13:45:32 +02008##
9# BiosAtaTranslation:
10#
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.
15#
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.
22#
23# @none: The physical disk geometry is equal to the logical geometry.
24#
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.
29#
30# @large: The number of cylinders per head is scaled down to 1024
31# by correspondingly scaling up the number of heads.
32#
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.
36#
37# Since: 2.0
38##
39{ 'enum': 'BiosAtaTranslation',
40 'data': ['auto', 'none', 'lba', 'large', 'rechs']}
41
42##
43# @BlockdevSnapshotInternal
44#
45# @device: the name of the device to generate the snapshot from
46#
47# @name: the name of the internal snapshot to be created
48#
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.
52#
53# Since: 1.7
54##
Eric Blake895a2a82015-05-04 09:05:27 -060055{ 'struct': 'BlockdevSnapshotInternal',
Benoît Canet2e95fa12014-06-05 13:45:32 +020056 'data': { 'device': 'str', 'name': 'str' } }
57
58##
59# @blockdev-snapshot-internal-sync
60#
61# Synchronously take an internal snapshot of a block device, when the format
62# of the image used supports it.
63#
64# For the arguments, see the documentation of BlockdevSnapshotInternal.
65#
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
72#
73# Since 1.7
74##
75{ 'command': 'blockdev-snapshot-internal-sync',
76 'data': 'BlockdevSnapshotInternal' }
77
78##
79# @blockdev-snapshot-delete-internal-sync
80#
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.
85#
86# @device: the name of the device to delete the snapshot from
87#
88# @id: optional the snapshot's ID to be deleted
89#
90# @name: optional the snapshot's name to be deleted
91#
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
98#
99# Since 1.7
100##
101{ 'command': 'blockdev-snapshot-delete-internal-sync',
102 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
103 'returns': 'SnapshotInfo' }
104
105##
106# @eject:
107#
108# Ejects a device from a removable drive.
109#
110# @device: The name of the device
111#
112# @force: @optional If true, eject regardless of whether the drive is locked.
113# If not specified, the default value is false.
114#
115# Returns: Nothing on success
116# If @device is not a valid block device, DeviceNotFound
117#
118# Notes: Ejecting a device will no media results in success
119#
120# Since: 0.14.0
121##
122{ 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
123
124##
125# @nbd-server-start:
126#
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".
131#
132# @addr: Address on which to listen.
133#
134# Returns: error if the server is already running.
135#
136# Since: 1.3.0
137##
138{ 'command': 'nbd-server-start',
139 'data': { 'addr': 'SocketAddress' } }
140
141##
142# @nbd-server-add:
143#
144# Export a device to QEMU's embedded NBD server.
145#
146# @device: Block device to be exported
147#
148# @writable: Whether clients should be able to write to the device via the
149# NBD connection (default false). #optional
150#
151# Returns: error if the device is already marked for export.
152#
153# Since: 1.3.0
154##
155{ 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
156
157##
158# @nbd-server-stop:
159#
160# Stop QEMU's embedded NBD server, and unregister all devices previously
161# added via @nbd-server-add.
162#
163# Since: 1.3.0
164##
165{ 'command': 'nbd-server-stop' }
166
Wenchao Xiaa5ee7bd2014-06-18 08:43:44 +0200167##
168# @DEVICE_TRAY_MOVED
169#
170# Emitted whenever the tray of a removable device is moved by the guest or by
171# HMP/QMP commands
172#
173# @device: device name
174#
175# @tray-open: true if the tray has been opened or false if it has been closed
176#
177# Since: 1.1
178##
179{ 'event': 'DEVICE_TRAY_MOVED',
180 'data': { 'device': 'str', 'tray-open': 'bool' } }