root / qapi-schema-guest.json @ 0056c093
History | View | Annotate | Download (6.4 kB)
1 | e3d4d252 | Michael Roth | # *-*- Mode: Python -*-* |
---|---|---|---|
2 | e3d4d252 | Michael Roth | |
3 | e3d4d252 | Michael Roth | ## |
4 | e3d4d252 | Michael Roth | # @guest-sync: |
5 | e3d4d252 | Michael Roth | #
|
6 | e3d4d252 | Michael Roth | # Echo back a unique integer value |
7 | e3d4d252 | Michael Roth | #
|
8 | e3d4d252 | Michael Roth | # This is used by clients talking to the guest agent over the |
9 | e3d4d252 | Michael Roth | # wire to ensure the stream is in sync and doesn't contain stale |
10 | e3d4d252 | Michael Roth | # data from previous client. All guest agent responses should be |
11 | e3d4d252 | Michael Roth | # ignored until the provided unique integer value is returned, |
12 | e3d4d252 | Michael Roth | # and it is up to the client to handle stale whole or |
13 | e3d4d252 | Michael Roth | # partially-delivered JSON text in such a way that this response |
14 | e3d4d252 | Michael Roth | # can be obtained. |
15 | e3d4d252 | Michael Roth | #
|
16 | e7d81004 | Stefan Weil | # Such clients should also precede this command |
17 | e3d4d252 | Michael Roth | # with a 0xFF byte to make such the guest agent flushes any |
18 | e3d4d252 | Michael Roth | # partially read JSON data from a previous session. |
19 | e3d4d252 | Michael Roth | #
|
20 | e3d4d252 | Michael Roth | # @id: randomly generated 64-bit integer |
21 | e3d4d252 | Michael Roth | #
|
22 | e3d4d252 | Michael Roth | # Returns: The unique integer id passed in by the client |
23 | e3d4d252 | Michael Roth | #
|
24 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
25 | e3d4d252 | Michael Roth | ## |
26 | e3d4d252 | Michael Roth | { 'command': 'guest-sync' |
27 | e3d4d252 | Michael Roth | 'data': { 'id': 'int' }, |
28 | e3d4d252 | Michael Roth | 'returns': 'int' } |
29 | e3d4d252 | Michael Roth | |
30 | e3d4d252 | Michael Roth | ## |
31 | e3d4d252 | Michael Roth | # @guest-ping: |
32 | e3d4d252 | Michael Roth | #
|
33 | e3d4d252 | Michael Roth | # Ping the guest agent, a non-error return implies success |
34 | e3d4d252 | Michael Roth | #
|
35 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
36 | e3d4d252 | Michael Roth | ## |
37 | e3d4d252 | Michael Roth | { 'command': 'guest-ping' } |
38 | e3d4d252 | Michael Roth | |
39 | e3d4d252 | Michael Roth | ## |
40 | 54383726 | Michael Roth | # @GuestAgentCommandInfo: |
41 | e3d4d252 | Michael Roth | #
|
42 | 54383726 | Michael Roth | # Information about guest agent commands. |
43 | e3d4d252 | Michael Roth | #
|
44 | 54383726 | Michael Roth | # @name: name of the command |
45 | 54383726 | Michael Roth | #
|
46 | 54383726 | Michael Roth | # @enabled: whether command is currently enabled by guest admin |
47 | 54383726 | Michael Roth | #
|
48 | 54383726 | Michael Roth | # Since 1.1.0 |
49 | e3d4d252 | Michael Roth | ## |
50 | bf95c0d5 | Michael Roth | { 'type': 'GuestAgentCommandInfo', |
51 | bf95c0d5 | Michael Roth | 'data': { 'name': 'str', 'enabled': 'bool' } } |
52 | 54383726 | Michael Roth | |
53 | 54383726 | Michael Roth | ## |
54 | 54383726 | Michael Roth | # @GuestAgentInfo |
55 | 54383726 | Michael Roth | #
|
56 | 54383726 | Michael Roth | # Information about guest agent. |
57 | 54383726 | Michael Roth | #
|
58 | 54383726 | Michael Roth | # @version: guest agent version |
59 | 54383726 | Michael Roth | #
|
60 | 54383726 | Michael Roth | # @supported_commands: Information about guest agent commands |
61 | 54383726 | Michael Roth | #
|
62 | 54383726 | Michael Roth | # Since 0.15.0 |
63 | 54383726 | Michael Roth | ## |
64 | bf95c0d5 | Michael Roth | { 'type': 'GuestAgentInfo', |
65 | bf95c0d5 | Michael Roth | 'data': { 'version': 'str', |
66 | bf95c0d5 | Michael Roth | 'supported_commands': ['GuestAgentCommandInfo'] } } |
67 | 54383726 | Michael Roth | ## |
68 | 54383726 | Michael Roth | # @guest-info: |
69 | 54383726 | Michael Roth | #
|
70 | 54383726 | Michael Roth | # Get some information about the guest agent. |
71 | 54383726 | Michael Roth | #
|
72 | 54383726 | Michael Roth | # Returns: @GuestAgentInfo |
73 | 54383726 | Michael Roth | #
|
74 | 54383726 | Michael Roth | # Since: 0.15.0 |
75 | 54383726 | Michael Roth | ## |
76 | e3d4d252 | Michael Roth | { 'command': 'guest-info', |
77 | e3d4d252 | Michael Roth | 'returns': 'GuestAgentInfo' } |
78 | e3d4d252 | Michael Roth | |
79 | e3d4d252 | Michael Roth | ## |
80 | e3d4d252 | Michael Roth | # @guest-shutdown: |
81 | e3d4d252 | Michael Roth | #
|
82 | e3d4d252 | Michael Roth | # Initiate guest-activated shutdown. Note: this is an asynchronous |
83 | e3d4d252 | Michael Roth | # shutdown request, with no guaruntee of successful shutdown. Errors |
84 | e3d4d252 | Michael Roth | # will be logged to guest's syslog. |
85 | e3d4d252 | Michael Roth | #
|
86 | e3d4d252 | Michael Roth | # @mode: #optional "halt", "powerdown" (default), or "reboot" |
87 | e3d4d252 | Michael Roth | #
|
88 | e3d4d252 | Michael Roth | # Returns: Nothing on success |
89 | e3d4d252 | Michael Roth | #
|
90 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
91 | e3d4d252 | Michael Roth | ## |
92 | e3d4d252 | Michael Roth | { 'command': 'guest-shutdown', 'data': { '*mode': 'str' } } |
93 | e3d4d252 | Michael Roth | |
94 | e3d4d252 | Michael Roth | ## |
95 | e3d4d252 | Michael Roth | # @guest-file-open: |
96 | e3d4d252 | Michael Roth | #
|
97 | e3d4d252 | Michael Roth | # Open a file in the guest and retrieve a file handle for it |
98 | e3d4d252 | Michael Roth | #
|
99 | e3d4d252 | Michael Roth | # @filepath: Full path to the file in the guest to open. |
100 | e3d4d252 | Michael Roth | #
|
101 | e3d4d252 | Michael Roth | # @mode: #optional open mode, as per fopen(), "r" is the default. |
102 | e3d4d252 | Michael Roth | #
|
103 | e3d4d252 | Michael Roth | # Returns: Guest file handle on success. |
104 | e3d4d252 | Michael Roth | #
|
105 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
106 | e3d4d252 | Michael Roth | ## |
107 | e3d4d252 | Michael Roth | { 'command': 'guest-file-open', |
108 | e3d4d252 | Michael Roth | 'data': { 'path': 'str', '*mode': 'str' }, |
109 | e3d4d252 | Michael Roth | 'returns': 'int' } |
110 | e3d4d252 | Michael Roth | |
111 | e3d4d252 | Michael Roth | ## |
112 | e3d4d252 | Michael Roth | # @guest-file-close: |
113 | e3d4d252 | Michael Roth | #
|
114 | e3d4d252 | Michael Roth | # Close an open file in the guest |
115 | e3d4d252 | Michael Roth | #
|
116 | e3d4d252 | Michael Roth | # @handle: filehandle returned by guest-file-open |
117 | e3d4d252 | Michael Roth | #
|
118 | e3d4d252 | Michael Roth | # Returns: Nothing on success. |
119 | e3d4d252 | Michael Roth | #
|
120 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
121 | e3d4d252 | Michael Roth | ## |
122 | e3d4d252 | Michael Roth | { 'command': 'guest-file-close', |
123 | e3d4d252 | Michael Roth | 'data': { 'handle': 'int' } } |
124 | e3d4d252 | Michael Roth | |
125 | e3d4d252 | Michael Roth | ## |
126 | 54383726 | Michael Roth | # @GuestFileRead |
127 | 54383726 | Michael Roth | #
|
128 | 54383726 | Michael Roth | # Result of guest agent file-read operation |
129 | 54383726 | Michael Roth | #
|
130 | 54383726 | Michael Roth | # @count: number of bytes read (note: count is *before* |
131 | 54383726 | Michael Roth | # base64-encoding is applied) |
132 | 54383726 | Michael Roth | #
|
133 | 54383726 | Michael Roth | # @buf-b64: base64-encoded bytes read |
134 | 54383726 | Michael Roth | #
|
135 | 54383726 | Michael Roth | # @eof: whether EOF was encountered during read operation. |
136 | 54383726 | Michael Roth | #
|
137 | 54383726 | Michael Roth | # Since: 0.15.0 |
138 | 54383726 | Michael Roth | ## |
139 | 54383726 | Michael Roth | { 'type': 'GuestFileRead', |
140 | 54383726 | Michael Roth | 'data': { 'count': 'int', 'buf-b64': 'str', 'eof': 'bool' } } |
141 | 54383726 | Michael Roth | |
142 | 54383726 | Michael Roth | ## |
143 | e3d4d252 | Michael Roth | # @guest-file-read: |
144 | e3d4d252 | Michael Roth | #
|
145 | e3d4d252 | Michael Roth | # Read from an open file in the guest. Data will be base64-encoded |
146 | e3d4d252 | Michael Roth | #
|
147 | e3d4d252 | Michael Roth | # @handle: filehandle returned by guest-file-open |
148 | e3d4d252 | Michael Roth | #
|
149 | e3d4d252 | Michael Roth | # @count: #optional maximum number of bytes to read (default is 4KB) |
150 | e3d4d252 | Michael Roth | #
|
151 | 54383726 | Michael Roth | # Returns: @GuestFileRead on success. |
152 | e3d4d252 | Michael Roth | #
|
153 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
154 | e3d4d252 | Michael Roth | ## |
155 | e3d4d252 | Michael Roth | { 'command': 'guest-file-read', |
156 | e3d4d252 | Michael Roth | 'data': { 'handle': 'int', '*count': 'int' }, |
157 | e3d4d252 | Michael Roth | 'returns': 'GuestFileRead' } |
158 | e3d4d252 | Michael Roth | |
159 | e3d4d252 | Michael Roth | ## |
160 | 54383726 | Michael Roth | # @GuestFileWrite |
161 | 54383726 | Michael Roth | #
|
162 | 54383726 | Michael Roth | # Result of guest agent file-write operation |
163 | 54383726 | Michael Roth | #
|
164 | 54383726 | Michael Roth | # @count: number of bytes written (note: count is actual bytes |
165 | 54383726 | Michael Roth | # written, after base64-decoding of provided buffer) |
166 | 54383726 | Michael Roth | #
|
167 | 54383726 | Michael Roth | # @eof: whether EOF was encountered during write operation. |
168 | 54383726 | Michael Roth | #
|
169 | 54383726 | Michael Roth | # Since: 0.15.0 |
170 | 54383726 | Michael Roth | ## |
171 | 54383726 | Michael Roth | { 'type': 'GuestFileWrite', |
172 | 54383726 | Michael Roth | 'data': { 'count': 'int', 'eof': 'bool' } } |
173 | 54383726 | Michael Roth | |
174 | 54383726 | Michael Roth | ## |
175 | e3d4d252 | Michael Roth | # @guest-file-write: |
176 | e3d4d252 | Michael Roth | #
|
177 | e3d4d252 | Michael Roth | # Write to an open file in the guest. |
178 | e3d4d252 | Michael Roth | #
|
179 | e3d4d252 | Michael Roth | # @handle: filehandle returned by guest-file-open |
180 | e3d4d252 | Michael Roth | #
|
181 | e3d4d252 | Michael Roth | # @buf-b64: base64-encoded string representing data to be written |
182 | e3d4d252 | Michael Roth | #
|
183 | e3d4d252 | Michael Roth | # @count: #optional bytes to write (actual bytes, after base64-decode), |
184 | e3d4d252 | Michael Roth | # default is all content in buf-b64 buffer after base64 decoding |
185 | e3d4d252 | Michael Roth | #
|
186 | 54383726 | Michael Roth | # Returns: @GuestFileWrite on success. |
187 | e3d4d252 | Michael Roth | #
|
188 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
189 | e3d4d252 | Michael Roth | ## |
190 | e3d4d252 | Michael Roth | { 'command': 'guest-file-write', |
191 | e3d4d252 | Michael Roth | 'data': { 'handle': 'int', 'buf-b64': 'str', '*count': 'int' }, |
192 | e3d4d252 | Michael Roth | 'returns': 'GuestFileWrite' } |
193 | e3d4d252 | Michael Roth | |
194 | 54383726 | Michael Roth | |
195 | 54383726 | Michael Roth | ## |
196 | 54383726 | Michael Roth | # @GuestFileSeek |
197 | 54383726 | Michael Roth | #
|
198 | 54383726 | Michael Roth | # Result of guest agent file-seek operation |
199 | 54383726 | Michael Roth | #
|
200 | 54383726 | Michael Roth | # @position: current file position |
201 | 54383726 | Michael Roth | #
|
202 | 54383726 | Michael Roth | # @eof: whether EOF was encountered during file seek |
203 | 54383726 | Michael Roth | #
|
204 | 54383726 | Michael Roth | # Since: 0.15.0 |
205 | 54383726 | Michael Roth | ## |
206 | 54383726 | Michael Roth | { 'type': 'GuestFileSeek', |
207 | 54383726 | Michael Roth | 'data': { 'position': 'int', 'eof': 'bool' } } |
208 | 54383726 | Michael Roth | |
209 | e3d4d252 | Michael Roth | ## |
210 | e3d4d252 | Michael Roth | # @guest-file-seek: |
211 | e3d4d252 | Michael Roth | #
|
212 | e3d4d252 | Michael Roth | # Seek to a position in the file, as with fseek(), and return the |
213 | e3d4d252 | Michael Roth | # current file position afterward. Also encapsulates ftell()'s |
214 | e3d4d252 | Michael Roth | # functionality, just Set offset=0, whence=SEEK_CUR. |
215 | e3d4d252 | Michael Roth | #
|
216 | e3d4d252 | Michael Roth | # @handle: filehandle returned by guest-file-open |
217 | e3d4d252 | Michael Roth | #
|
218 | e3d4d252 | Michael Roth | # @offset: bytes to skip over in the file stream |
219 | e3d4d252 | Michael Roth | #
|
220 | e3d4d252 | Michael Roth | # @whence: SEEK_SET, SEEK_CUR, or SEEK_END, as with fseek() |
221 | e3d4d252 | Michael Roth | #
|
222 | 54383726 | Michael Roth | # Returns: @GuestFileSeek on success. |
223 | e3d4d252 | Michael Roth | #
|
224 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
225 | e3d4d252 | Michael Roth | ## |
226 | e3d4d252 | Michael Roth | { 'command': 'guest-file-seek', |
227 | e3d4d252 | Michael Roth | 'data': { 'handle': 'int', 'offset': 'int', 'whence': 'int' }, |
228 | e3d4d252 | Michael Roth | 'returns': 'GuestFileSeek' } |
229 | e3d4d252 | Michael Roth | |
230 | e3d4d252 | Michael Roth | ## |
231 | e3d4d252 | Michael Roth | # @guest-file-flush: |
232 | e3d4d252 | Michael Roth | #
|
233 | e3d4d252 | Michael Roth | # Write file changes bufferred in userspace to disk/kernel buffers |
234 | e3d4d252 | Michael Roth | #
|
235 | e3d4d252 | Michael Roth | # @handle: filehandle returned by guest-file-open |
236 | e3d4d252 | Michael Roth | #
|
237 | e3d4d252 | Michael Roth | # Returns: Nothing on success. |
238 | e3d4d252 | Michael Roth | #
|
239 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
240 | e3d4d252 | Michael Roth | ## |
241 | e3d4d252 | Michael Roth | { 'command': 'guest-file-flush', |
242 | e3d4d252 | Michael Roth | 'data': { 'handle': 'int' } } |
243 | e3d4d252 | Michael Roth | |
244 | e3d4d252 | Michael Roth | ## |
245 | 54383726 | Michael Roth | # @GuestFsFreezeStatus |
246 | e3d4d252 | Michael Roth | #
|
247 | 54383726 | Michael Roth | # An enumation of filesystem freeze states |
248 | e3d4d252 | Michael Roth | #
|
249 | 54383726 | Michael Roth | # @thawed: filesystems thawed/unfrozen |
250 | 54383726 | Michael Roth | #
|
251 | 54383726 | Michael Roth | # @frozen: all non-network guest filesystems frozen |
252 | 54383726 | Michael Roth | #
|
253 | 54383726 | Michael Roth | # @error: failure to thaw 1 or more |
254 | 54383726 | Michael Roth | # previously frozen filesystems, or failure to open a previously |
255 | 54383726 | Michael Roth | # cached filesytem (filesystem unmounted/directory changes, etc). |
256 | e3d4d252 | Michael Roth | #
|
257 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
258 | e3d4d252 | Michael Roth | ## |
259 | e3d4d252 | Michael Roth | { 'enum': 'GuestFsfreezeStatus', |
260 | e3d4d252 | Michael Roth | 'data': [ 'thawed', 'frozen', 'error' ] } |
261 | 54383726 | Michael Roth | |
262 | 54383726 | Michael Roth | ## |
263 | 54383726 | Michael Roth | # @guest-fsfreeze-status: |
264 | 54383726 | Michael Roth | #
|
265 | 54383726 | Michael Roth | # Get guest fsfreeze state. error state indicates |
266 | 54383726 | Michael Roth | #
|
267 | 54383726 | Michael Roth | # Returns: GuestFsfreezeStatus ("thawed", "frozen", etc., as defined below) |
268 | 54383726 | Michael Roth | #
|
269 | 54383726 | Michael Roth | # Since: 0.15.0 |
270 | 54383726 | Michael Roth | ## |
271 | e3d4d252 | Michael Roth | { 'command': 'guest-fsfreeze-status', |
272 | e3d4d252 | Michael Roth | 'returns': 'GuestFsfreezeStatus' } |
273 | e3d4d252 | Michael Roth | |
274 | e3d4d252 | Michael Roth | ## |
275 | e3d4d252 | Michael Roth | # @guest-fsfreeze-freeze: |
276 | e3d4d252 | Michael Roth | #
|
277 | e3d4d252 | Michael Roth | # Sync and freeze all non-network guest filesystems |
278 | e3d4d252 | Michael Roth | #
|
279 | e3d4d252 | Michael Roth | # Returns: Number of file systems frozen on success |
280 | e3d4d252 | Michael Roth | #
|
281 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
282 | e3d4d252 | Michael Roth | ## |
283 | e3d4d252 | Michael Roth | { 'command': 'guest-fsfreeze-freeze', |
284 | e3d4d252 | Michael Roth | 'returns': 'int' } |
285 | e3d4d252 | Michael Roth | |
286 | e3d4d252 | Michael Roth | ## |
287 | e3d4d252 | Michael Roth | # @guest-fsfreeze-thaw: |
288 | e3d4d252 | Michael Roth | #
|
289 | e3d4d252 | Michael Roth | # Unfreeze frozen guest fileystems |
290 | e3d4d252 | Michael Roth | #
|
291 | e3d4d252 | Michael Roth | # Returns: Number of file systems thawed |
292 | e3d4d252 | Michael Roth | # If error, -1 (unknown error) or -errno |
293 | e3d4d252 | Michael Roth | #
|
294 | e3d4d252 | Michael Roth | # Since: 0.15.0 |
295 | e3d4d252 | Michael Roth | ## |
296 | e3d4d252 | Michael Roth | { 'command': 'guest-fsfreeze-thaw', |
297 | e3d4d252 | Michael Roth | 'returns': 'int' } |