pci-assign: Use PCI-2.3-based shared legacy interrupts
[qemu-kvm.git] / qapi-schema-guest.json
blob706925dea62923ee9a374f36a1189d082e321960
1 # *-*- Mode: Python -*-*
3 ##
4 # @guest-sync:
6 # Echo back a unique integer value
8 # This is used by clients talking to the guest agent over the
9 # wire to ensure the stream is in sync and doesn't contain stale
10 # data from previous client. All guest agent responses should be
11 # ignored until the provided unique integer value is returned,
12 # and it is up to the client to handle stale whole or
13 # partially-delivered JSON text in such a way that this response
14 # can be obtained.
16 # Such clients should also precede this command
17 # with a 0xFF byte to make such the guest agent flushes any
18 # partially read JSON data from a previous session.
20 # @id: randomly generated 64-bit integer
22 # Returns: The unique integer id passed in by the client
24 # Since: 0.15.0
26 { 'command': 'guest-sync'
27   'data':    { 'id': 'int' },
28   'returns': 'int' }
31 # @guest-ping:
33 # Ping the guest agent, a non-error return implies success
35 # Since: 0.15.0
37 { 'command': 'guest-ping' }
40 # @GuestAgentCommandInfo:
42 # Information about guest agent commands.
44 # @name: name of the command
46 # @enabled: whether command is currently enabled by guest admin
48 # Since 1.1.0
50 { 'type': 'GuestAgentCommandInfo',
51   'data': { 'name': 'str', 'enabled': 'bool' } }
54 # @GuestAgentInfo
56 # Information about guest agent.
58 # @version: guest agent version
60 # @supported_commands: Information about guest agent commands
62 # Since 0.15.0
64 { 'type': 'GuestAgentInfo',
65   'data': { 'version': 'str',
66             'supported_commands': ['GuestAgentCommandInfo'] } }
68 # @guest-info:
70 # Get some information about the guest agent.
72 # Returns: @GuestAgentInfo
74 # Since: 0.15.0
76 { 'command': 'guest-info',
77   'returns': 'GuestAgentInfo' }
80 # @guest-shutdown:
82 # Initiate guest-activated shutdown. Note: this is an asynchronous
83 # shutdown request, with no guaruntee of successful shutdown. Errors
84 # will be logged to guest's syslog.
86 # @mode: #optional "halt", "powerdown" (default), or "reboot"
88 # Returns: Nothing on success
90 # Since: 0.15.0
92 { 'command': 'guest-shutdown', 'data': { '*mode': 'str' } }
95 # @guest-file-open:
97 # Open a file in the guest and retrieve a file handle for it
99 # @filepath: Full path to the file in the guest to open.
101 # @mode: #optional open mode, as per fopen(), "r" is the default.
103 # Returns: Guest file handle on success.
105 # Since: 0.15.0
107 { 'command': 'guest-file-open',
108   'data':    { 'path': 'str', '*mode': 'str' },
109   'returns': 'int' }
112 # @guest-file-close:
114 # Close an open file in the guest
116 # @handle: filehandle returned by guest-file-open
118 # Returns: Nothing on success.
120 # Since: 0.15.0
122 { 'command': 'guest-file-close',
123   'data': { 'handle': 'int' } }
126 # @GuestFileRead
128 # Result of guest agent file-read operation
130 # @count: number of bytes read (note: count is *before*
131 #         base64-encoding is applied)
133 # @buf-b64: base64-encoded bytes read
135 # @eof: whether EOF was encountered during read operation.
137 # Since: 0.15.0
139 { 'type': 'GuestFileRead',
140   'data': { 'count': 'int', 'buf-b64': 'str', 'eof': 'bool' } }
143 # @guest-file-read:
145 # Read from an open file in the guest. Data will be base64-encoded
147 # @handle: filehandle returned by guest-file-open
149 # @count: #optional maximum number of bytes to read (default is 4KB)
151 # Returns: @GuestFileRead on success.
153 # Since: 0.15.0
155 { 'command': 'guest-file-read',
156   'data':    { 'handle': 'int', '*count': 'int' },
157   'returns': 'GuestFileRead' }
160 # @GuestFileWrite
162 # Result of guest agent file-write operation
164 # @count: number of bytes written (note: count is actual bytes
165 #         written, after base64-decoding of provided buffer)
167 # @eof: whether EOF was encountered during write operation.
169 # Since: 0.15.0
171 { 'type': 'GuestFileWrite',
172   'data': { 'count': 'int', 'eof': 'bool' } }
175 # @guest-file-write:
177 # Write to an open file in the guest.
179 # @handle: filehandle returned by guest-file-open
181 # @buf-b64: base64-encoded string representing data to be written
183 # @count: #optional bytes to write (actual bytes, after base64-decode),
184 #         default is all content in buf-b64 buffer after base64 decoding
186 # Returns: @GuestFileWrite on success.
188 # Since: 0.15.0
190 { 'command': 'guest-file-write',
191   'data':    { 'handle': 'int', 'buf-b64': 'str', '*count': 'int' },
192   'returns': 'GuestFileWrite' }
196 # @GuestFileSeek
198 # Result of guest agent file-seek operation
200 # @position: current file position
202 # @eof: whether EOF was encountered during file seek
204 # Since: 0.15.0
206 { 'type': 'GuestFileSeek',
207   'data': { 'position': 'int', 'eof': 'bool' } }
210 # @guest-file-seek:
212 # Seek to a position in the file, as with fseek(), and return the
213 # current file position afterward. Also encapsulates ftell()'s
214 # functionality, just Set offset=0, whence=SEEK_CUR.
216 # @handle: filehandle returned by guest-file-open
218 # @offset: bytes to skip over in the file stream
220 # @whence: SEEK_SET, SEEK_CUR, or SEEK_END, as with fseek()
222 # Returns: @GuestFileSeek on success.
224 # Since: 0.15.0
226 { 'command': 'guest-file-seek',
227   'data':    { 'handle': 'int', 'offset': 'int', 'whence': 'int' },
228   'returns': 'GuestFileSeek' }
231 # @guest-file-flush:
233 # Write file changes bufferred in userspace to disk/kernel buffers
235 # @handle: filehandle returned by guest-file-open
237 # Returns: Nothing on success.
239 # Since: 0.15.0
241 { 'command': 'guest-file-flush',
242   'data': { 'handle': 'int' } }
245 # @GuestFsFreezeStatus
247 # An enumation of filesystem freeze states
249 # @thawed: filesystems thawed/unfrozen
251 # @frozen: all non-network guest filesystems frozen
253 # @error: failure to thaw 1 or more
254 #         previously frozen filesystems, or failure to open a previously
255 #         cached filesytem (filesystem unmounted/directory changes, etc).
257 # Since: 0.15.0
259 { 'enum': 'GuestFsfreezeStatus',
260   'data': [ 'thawed', 'frozen', 'error' ] }
263 # @guest-fsfreeze-status:
265 # Get guest fsfreeze state. error state indicates
267 # Returns: GuestFsfreezeStatus ("thawed", "frozen", etc., as defined below)
269 # Since: 0.15.0
271 { 'command': 'guest-fsfreeze-status',
272   'returns': 'GuestFsfreezeStatus' }
275 # @guest-fsfreeze-freeze:
277 # Sync and freeze all non-network guest filesystems
279 # Returns: Number of file systems frozen on success
281 # Since: 0.15.0
283 { 'command': 'guest-fsfreeze-freeze',
284   'returns': 'int' }
287 # @guest-fsfreeze-thaw:
289 # Unfreeze frozen guest fileystems
291 # Returns: Number of file systems thawed
292 #          If error, -1 (unknown error) or -errno
294 # Since: 0.15.0
296 { 'command': 'guest-fsfreeze-thaw',
297   'returns': 'int' }