]>
Commit | Line | Data |
---|---|---|
e3d4d252 | 1 | # *-*- Mode: Python -*-* |
f7160f32 | 2 | # vim: filetype=python |
e3d4d252 | 3 | |
9481ecd7 | 4 | ## |
ac741a9e | 5 | # = General note concerning the use of guest agent interfaces |
9481ecd7 LE |
6 | # |
7 | # "unsupported" is a higher-level error than the errors that individual | |
8 | # commands might document. The caller should always be prepared to receive | |
9 | # QERR_UNSUPPORTED, even if the given command doesn't specify it, or doesn't | |
10 | # document any failure mode at all. | |
ac741a9e PM |
11 | ## |
12 | ||
13 | ## | |
14 | # = QEMU guest agent protocol commands and structs | |
9481ecd7 LE |
15 | ## |
16 | ||
bc52d03f MA |
17 | { 'pragma': { 'doc-required': true } } |
18 | ||
0e4ef702 TH |
19 | # Lists with items allowed to permit QAPI rule violations; think twice |
20 | # before you add to them! | |
1554a8fa | 21 | { 'pragma': { |
5aceeac0 MA |
22 | # Types whose member names may use '_' |
23 | 'member-name-exceptions': [ | |
24 | 'GuestAgentInfo' | |
25 | ], | |
1554a8fa | 26 | # Commands allowed to return a non-dictionary: |
b86df374 | 27 | 'command-returns-exceptions': [ |
1554a8fa MA |
28 | 'guest-file-open', |
29 | 'guest-fsfreeze-freeze', | |
30 | 'guest-fsfreeze-freeze-list', | |
31 | 'guest-fsfreeze-status', | |
32 | 'guest-fsfreeze-thaw', | |
33 | 'guest-get-time', | |
34 | 'guest-set-vcpus', | |
35 | 'guest-sync', | |
36 | 'guest-sync-delimited' ] } } | |
37 | ||
3cf0bed8 | 38 | ## |
71e0e067 | 39 | # @guest-sync-delimited: |
3cf0bed8 MR |
40 | # |
41 | # Echo back a unique integer value, and prepend to response a | |
42 | # leading sentinel byte (0xFF) the client can check scan for. | |
43 | # | |
44 | # This is used by clients talking to the guest agent over the | |
45 | # wire to ensure the stream is in sync and doesn't contain stale | |
46 | # data from previous client. It must be issued upon initial | |
47 | # connection, and after any client-side timeouts (including | |
48 | # timeouts on receiving a response to this command). | |
49 | # | |
50 | # After issuing this request, all guest agent responses should be | |
51 | # ignored until the response containing the unique integer value | |
52 | # the client passed in is returned. Receival of the 0xFF sentinel | |
53 | # byte must be handled as an indication that the client's | |
54 | # lexer/tokenizer/parser state should be flushed/reset in | |
55 | # preparation for reliably receiving the subsequent response. As | |
56 | # an optimization, clients may opt to ignore all data until a | |
a31f0531 | 57 | # sentinel value is receiving to avoid unnecessary processing of |
3cf0bed8 MR |
58 | # stale data. |
59 | # | |
60 | # Similarly, clients should also precede this *request* | |
61 | # with a 0xFF byte to make sure the guest agent flushes any | |
62 | # partially read JSON data from a previous client connection. | |
63 | # | |
64 | # @id: randomly generated 64-bit integer | |
65 | # | |
66 | # Returns: The unique integer id passed in by the client | |
67 | # | |
68 | # Since: 1.1 | |
71e0e067 | 69 | ## |
01b87f6d | 70 | { 'command': 'guest-sync-delimited', |
3cf0bed8 MR |
71 | 'data': { 'id': 'int' }, |
72 | 'returns': 'int' } | |
73 | ||
e3d4d252 MR |
74 | ## |
75 | # @guest-sync: | |
76 | # | |
77 | # Echo back a unique integer value | |
78 | # | |
79 | # This is used by clients talking to the guest agent over the | |
80 | # wire to ensure the stream is in sync and doesn't contain stale | |
81 | # data from previous client. All guest agent responses should be | |
82 | # ignored until the provided unique integer value is returned, | |
83 | # and it is up to the client to handle stale whole or | |
84 | # partially-delivered JSON text in such a way that this response | |
85 | # can be obtained. | |
86 | # | |
3cf0bed8 MR |
87 | # In cases where a partial stale response was previously |
88 | # received by the client, this cannot always be done reliably. | |
89 | # One particular scenario being if qemu-ga responses are fed | |
90 | # character-by-character into a JSON parser. In these situations, | |
91 | # using guest-sync-delimited may be optimal. | |
92 | # | |
93 | # For clients that fetch responses line by line and convert them | |
94 | # to JSON objects, guest-sync should be sufficient, but note that | |
95 | # in cases where the channel is dirty some attempts at parsing the | |
96 | # response may result in a parser error. | |
97 | # | |
e7d81004 | 98 | # Such clients should also precede this command |
3cf0bed8 | 99 | # with a 0xFF byte to make sure the guest agent flushes any |
e3d4d252 MR |
100 | # partially read JSON data from a previous session. |
101 | # | |
102 | # @id: randomly generated 64-bit integer | |
103 | # | |
104 | # Returns: The unique integer id passed in by the client | |
105 | # | |
106 | # Since: 0.15.0 | |
107 | ## | |
01b87f6d | 108 | { 'command': 'guest-sync', |
e3d4d252 MR |
109 | 'data': { 'id': 'int' }, |
110 | 'returns': 'int' } | |
111 | ||
112 | ## | |
113 | # @guest-ping: | |
114 | # | |
115 | # Ping the guest agent, a non-error return implies success | |
116 | # | |
117 | # Since: 0.15.0 | |
118 | ## | |
119 | { 'command': 'guest-ping' } | |
120 | ||
6912e6a9 LL |
121 | ## |
122 | # @guest-get-time: | |
123 | # | |
1634df56 AK |
124 | # Get the information about guest's System Time relative to |
125 | # the Epoch of 1970-01-01 in UTC. | |
6912e6a9 LL |
126 | # |
127 | # Returns: Time in nanoseconds. | |
128 | # | |
5072f7b3 | 129 | # Since: 1.5 |
6912e6a9 LL |
130 | ## |
131 | { 'command': 'guest-get-time', | |
132 | 'returns': 'int' } | |
133 | ||
a1bca57f LL |
134 | ## |
135 | # @guest-set-time: | |
136 | # | |
137 | # Set guest time. | |
138 | # | |
139 | # When a guest is paused or migrated to a file then loaded | |
140 | # from that file, the guest OS has no idea that there | |
141 | # was a big gap in the time. Depending on how long the | |
142 | # gap was, NTP might not be able to resynchronize the | |
143 | # guest. | |
144 | # | |
1634df56 AK |
145 | # This command tries to set guest's System Time to the |
146 | # given value, then sets the Hardware Clock (RTC) to the | |
147 | # current System Time. This will make it easier for a guest | |
148 | # to resynchronize without waiting for NTP. If no @time is | |
ee17cbdc MP |
149 | # specified, then the time to set is read from RTC. However, |
150 | # this may not be supported on all platforms (i.e. Windows). | |
151 | # If that's the case users are advised to always pass a | |
152 | # value. | |
a1bca57f | 153 | # |
1d8bda12 | 154 | # @time: time of nanoseconds, relative to the Epoch |
2c958923 | 155 | # of 1970-01-01 in UTC. |
a1bca57f LL |
156 | # |
157 | # Returns: Nothing on success. | |
158 | # | |
159 | # Since: 1.5 | |
160 | ## | |
161 | { 'command': 'guest-set-time', | |
2c958923 | 162 | 'data': { '*time': 'int' } } |
a1bca57f | 163 | |
e3d4d252 | 164 | ## |
54383726 | 165 | # @GuestAgentCommandInfo: |
e3d4d252 | 166 | # |
54383726 | 167 | # Information about guest agent commands. |
e3d4d252 | 168 | # |
54383726 MR |
169 | # @name: name of the command |
170 | # | |
171 | # @enabled: whether command is currently enabled by guest admin | |
172 | # | |
0106dc4f MW |
173 | # @success-response: whether command returns a response on success |
174 | # (since 1.7) | |
175 | # | |
5072f7b3 | 176 | # Since: 1.1.0 |
e3d4d252 | 177 | ## |
895a2a80 | 178 | { 'struct': 'GuestAgentCommandInfo', |
0106dc4f | 179 | 'data': { 'name': 'str', 'enabled': 'bool', 'success-response': 'bool' } } |
54383726 MR |
180 | |
181 | ## | |
5072f7b3 | 182 | # @GuestAgentInfo: |
54383726 MR |
183 | # |
184 | # Information about guest agent. | |
185 | # | |
186 | # @version: guest agent version | |
187 | # | |
188 | # @supported_commands: Information about guest agent commands | |
189 | # | |
5072f7b3 | 190 | # Since: 0.15.0 |
54383726 | 191 | ## |
895a2a80 | 192 | { 'struct': 'GuestAgentInfo', |
bf95c0d5 MR |
193 | 'data': { 'version': 'str', |
194 | 'supported_commands': ['GuestAgentCommandInfo'] } } | |
54383726 MR |
195 | ## |
196 | # @guest-info: | |
197 | # | |
198 | # Get some information about the guest agent. | |
199 | # | |
200 | # Returns: @GuestAgentInfo | |
201 | # | |
202 | # Since: 0.15.0 | |
203 | ## | |
e3d4d252 MR |
204 | { 'command': 'guest-info', |
205 | 'returns': 'GuestAgentInfo' } | |
206 | ||
207 | ## | |
208 | # @guest-shutdown: | |
209 | # | |
210 | # Initiate guest-activated shutdown. Note: this is an asynchronous | |
3674838c | 211 | # shutdown request, with no guarantee of successful shutdown. |
e3d4d252 | 212 | # |
1d8bda12 | 213 | # @mode: "halt", "powerdown" (default), or "reboot" |
e3d4d252 | 214 | # |
89268172 LC |
215 | # This command does NOT return a response on success. Success condition |
216 | # is indicated by the VM exiting with a zero exit status or, when | |
217 | # running with --no-shutdown, by issuing the query-status QMP command | |
218 | # to confirm the VM status is "shutdown". | |
e3d4d252 MR |
219 | # |
220 | # Since: 0.15.0 | |
221 | ## | |
89268172 | 222 | { 'command': 'guest-shutdown', 'data': { '*mode': 'str' }, |
d708cdbe | 223 | 'success-response': false } |
e3d4d252 MR |
224 | |
225 | ## | |
226 | # @guest-file-open: | |
227 | # | |
228 | # Open a file in the guest and retrieve a file handle for it | |
229 | # | |
4d5c8bc4 | 230 | # @path: Full path to the file in the guest to open. |
e3d4d252 | 231 | # |
1d8bda12 | 232 | # @mode: open mode, as per fopen(), "r" is the default. |
e3d4d252 MR |
233 | # |
234 | # Returns: Guest file handle on success. | |
235 | # | |
236 | # Since: 0.15.0 | |
237 | ## | |
238 | { 'command': 'guest-file-open', | |
239 | 'data': { 'path': 'str', '*mode': 'str' }, | |
240 | 'returns': 'int' } | |
241 | ||
242 | ## | |
243 | # @guest-file-close: | |
244 | # | |
245 | # Close an open file in the guest | |
246 | # | |
247 | # @handle: filehandle returned by guest-file-open | |
248 | # | |
249 | # Returns: Nothing on success. | |
250 | # | |
251 | # Since: 0.15.0 | |
252 | ## | |
253 | { 'command': 'guest-file-close', | |
254 | 'data': { 'handle': 'int' } } | |
255 | ||
54383726 | 256 | ## |
5072f7b3 | 257 | # @GuestFileRead: |
54383726 MR |
258 | # |
259 | # Result of guest agent file-read operation | |
260 | # | |
261 | # @count: number of bytes read (note: count is *before* | |
262 | # base64-encoding is applied) | |
263 | # | |
264 | # @buf-b64: base64-encoded bytes read | |
265 | # | |
266 | # @eof: whether EOF was encountered during read operation. | |
267 | # | |
268 | # Since: 0.15.0 | |
269 | ## | |
895a2a80 | 270 | { 'struct': 'GuestFileRead', |
54383726 MR |
271 | 'data': { 'count': 'int', 'buf-b64': 'str', 'eof': 'bool' } } |
272 | ||
e3d4d252 MR |
273 | ## |
274 | # @guest-file-read: | |
275 | # | |
1329651f PMD |
276 | # Read from an open file in the guest. Data will be base64-encoded. |
277 | # As this command is just for limited, ad-hoc debugging, such as log | |
278 | # file access, the number of bytes to read is limited to 48 MB. | |
e3d4d252 MR |
279 | # |
280 | # @handle: filehandle returned by guest-file-open | |
281 | # | |
1329651f | 282 | # @count: maximum number of bytes to read (default is 4KB, maximum is 48MB) |
e3d4d252 | 283 | # |
54383726 | 284 | # Returns: @GuestFileRead on success. |
e3d4d252 MR |
285 | # |
286 | # Since: 0.15.0 | |
287 | ## | |
e3d4d252 MR |
288 | { 'command': 'guest-file-read', |
289 | 'data': { 'handle': 'int', '*count': 'int' }, | |
290 | 'returns': 'GuestFileRead' } | |
291 | ||
54383726 | 292 | ## |
5072f7b3 | 293 | # @GuestFileWrite: |
54383726 MR |
294 | # |
295 | # Result of guest agent file-write operation | |
296 | # | |
297 | # @count: number of bytes written (note: count is actual bytes | |
298 | # written, after base64-decoding of provided buffer) | |
299 | # | |
300 | # @eof: whether EOF was encountered during write operation. | |
301 | # | |
302 | # Since: 0.15.0 | |
303 | ## | |
895a2a80 | 304 | { 'struct': 'GuestFileWrite', |
54383726 MR |
305 | 'data': { 'count': 'int', 'eof': 'bool' } } |
306 | ||
e3d4d252 MR |
307 | ## |
308 | # @guest-file-write: | |
309 | # | |
310 | # Write to an open file in the guest. | |
311 | # | |
312 | # @handle: filehandle returned by guest-file-open | |
313 | # | |
314 | # @buf-b64: base64-encoded string representing data to be written | |
315 | # | |
1d8bda12 | 316 | # @count: bytes to write (actual bytes, after base64-decode), |
e3d4d252 MR |
317 | # default is all content in buf-b64 buffer after base64 decoding |
318 | # | |
54383726 | 319 | # Returns: @GuestFileWrite on success. |
e3d4d252 MR |
320 | # |
321 | # Since: 0.15.0 | |
322 | ## | |
e3d4d252 MR |
323 | { 'command': 'guest-file-write', |
324 | 'data': { 'handle': 'int', 'buf-b64': 'str', '*count': 'int' }, | |
325 | 'returns': 'GuestFileWrite' } | |
326 | ||
54383726 MR |
327 | |
328 | ## | |
5072f7b3 | 329 | # @GuestFileSeek: |
54383726 MR |
330 | # |
331 | # Result of guest agent file-seek operation | |
332 | # | |
333 | # @position: current file position | |
334 | # | |
335 | # @eof: whether EOF was encountered during file seek | |
336 | # | |
337 | # Since: 0.15.0 | |
338 | ## | |
895a2a80 | 339 | { 'struct': 'GuestFileSeek', |
54383726 MR |
340 | 'data': { 'position': 'int', 'eof': 'bool' } } |
341 | ||
0b4b4938 EB |
342 | ## |
343 | # @QGASeek: | |
344 | # | |
345 | # Symbolic names for use in @guest-file-seek | |
346 | # | |
347 | # @set: Set to the specified offset (same effect as 'whence':0) | |
348 | # @cur: Add offset to the current location (same effect as 'whence':1) | |
349 | # @end: Add offset to the end of the file (same effect as 'whence':2) | |
350 | # | |
351 | # Since: 2.6 | |
352 | ## | |
353 | { 'enum': 'QGASeek', 'data': [ 'set', 'cur', 'end' ] } | |
354 | ||
355 | ## | |
356 | # @GuestFileWhence: | |
357 | # | |
358 | # Controls the meaning of offset to @guest-file-seek. | |
359 | # | |
360 | # @value: Integral value (0 for set, 1 for cur, 2 for end), available | |
361 | # for historical reasons, and might differ from the host's or | |
362 | # guest's SEEK_* values (since: 0.15) | |
363 | # @name: Symbolic name, and preferred interface | |
364 | # | |
365 | # Since: 2.6 | |
366 | ## | |
367 | { 'alternate': 'GuestFileWhence', | |
368 | 'data': { 'value': 'int', 'name': 'QGASeek' } } | |
369 | ||
e3d4d252 MR |
370 | ## |
371 | # @guest-file-seek: | |
372 | # | |
373 | # Seek to a position in the file, as with fseek(), and return the | |
374 | # current file position afterward. Also encapsulates ftell()'s | |
0a982b1b | 375 | # functionality, with offset=0 and whence=1. |
e3d4d252 MR |
376 | # |
377 | # @handle: filehandle returned by guest-file-open | |
378 | # | |
379 | # @offset: bytes to skip over in the file stream | |
380 | # | |
0b4b4938 | 381 | # @whence: Symbolic or numeric code for interpreting offset |
e3d4d252 | 382 | # |
54383726 | 383 | # Returns: @GuestFileSeek on success. |
e3d4d252 MR |
384 | # |
385 | # Since: 0.15.0 | |
386 | ## | |
e3d4d252 | 387 | { 'command': 'guest-file-seek', |
0b4b4938 EB |
388 | 'data': { 'handle': 'int', 'offset': 'int', |
389 | 'whence': 'GuestFileWhence' }, | |
e3d4d252 MR |
390 | 'returns': 'GuestFileSeek' } |
391 | ||
392 | ## | |
393 | # @guest-file-flush: | |
394 | # | |
1e458f11 | 395 | # Write file changes buffered in userspace to disk/kernel buffers |
e3d4d252 MR |
396 | # |
397 | # @handle: filehandle returned by guest-file-open | |
398 | # | |
399 | # Returns: Nothing on success. | |
400 | # | |
401 | # Since: 0.15.0 | |
402 | ## | |
403 | { 'command': 'guest-file-flush', | |
404 | 'data': { 'handle': 'int' } } | |
405 | ||
406 | ## | |
5072f7b3 | 407 | # @GuestFsfreezeStatus: |
e3d4d252 | 408 | # |
6932a69b | 409 | # An enumeration of filesystem freeze states |
e3d4d252 | 410 | # |
54383726 MR |
411 | # @thawed: filesystems thawed/unfrozen |
412 | # | |
413 | # @frozen: all non-network guest filesystems frozen | |
414 | # | |
e3d4d252 MR |
415 | # Since: 0.15.0 |
416 | ## | |
417 | { 'enum': 'GuestFsfreezeStatus', | |
9e8aded4 | 418 | 'data': [ 'thawed', 'frozen' ] } |
54383726 MR |
419 | |
420 | ## | |
421 | # @guest-fsfreeze-status: | |
422 | # | |
423 | # Get guest fsfreeze state. error state indicates | |
424 | # | |
425 | # Returns: GuestFsfreezeStatus ("thawed", "frozen", etc., as defined below) | |
426 | # | |
9e8aded4 | 427 | # Note: This may fail to properly report the current state as a result of |
883aff68 | 428 | # some other guest processes having issued an fs freeze/thaw. |
9e8aded4 | 429 | # |
54383726 MR |
430 | # Since: 0.15.0 |
431 | ## | |
e3d4d252 MR |
432 | { 'command': 'guest-fsfreeze-status', |
433 | 'returns': 'GuestFsfreezeStatus' } | |
434 | ||
435 | ## | |
436 | # @guest-fsfreeze-freeze: | |
437 | # | |
1dbfbc17 MAL |
438 | # Sync and freeze all freezable, local guest filesystems. If this |
439 | # command succeeded, you may call @guest-fsfreeze-thaw later to | |
440 | # unfreeze. | |
441 | # | |
442 | # Note: On Windows, the command is implemented with the help of a | |
883aff68 PM |
443 | # Volume Shadow-copy Service DLL helper. The frozen state is limited |
444 | # for up to 10 seconds by VSS. | |
e3d4d252 | 445 | # |
9e8aded4 | 446 | # Returns: Number of file systems currently frozen. On error, all filesystems |
883aff68 PM |
447 | # will be thawed. If no filesystems are frozen as a result of this call, |
448 | # then @guest-fsfreeze-status will remain "thawed" and calling | |
449 | # @guest-fsfreeze-thaw is not necessary. | |
e3d4d252 MR |
450 | # |
451 | # Since: 0.15.0 | |
452 | ## | |
453 | { 'command': 'guest-fsfreeze-freeze', | |
454 | 'returns': 'int' } | |
455 | ||
e99bce20 TS |
456 | ## |
457 | # @guest-fsfreeze-freeze-list: | |
458 | # | |
1dbfbc17 MAL |
459 | # Sync and freeze specified guest filesystems. |
460 | # See also @guest-fsfreeze-freeze. | |
e99bce20 | 461 | # |
1d8bda12 | 462 | # @mountpoints: an array of mountpoints of filesystems to be frozen. |
e99bce20 | 463 | # If omitted, every mounted filesystem is frozen. |
1dbfbc17 | 464 | # Invalid mount points are ignored. |
e99bce20 TS |
465 | # |
466 | # Returns: Number of file systems currently frozen. On error, all filesystems | |
883aff68 | 467 | # will be thawed. |
e99bce20 TS |
468 | # |
469 | # Since: 2.2 | |
470 | ## | |
471 | { 'command': 'guest-fsfreeze-freeze-list', | |
472 | 'data': { '*mountpoints': ['str'] }, | |
473 | 'returns': 'int' } | |
474 | ||
e3d4d252 MR |
475 | ## |
476 | # @guest-fsfreeze-thaw: | |
477 | # | |
9e8aded4 MR |
478 | # Unfreeze all frozen guest filesystems |
479 | # | |
480 | # Returns: Number of file systems thawed by this call | |
e3d4d252 | 481 | # |
9e8aded4 MR |
482 | # Note: if return value does not match the previous call to |
483 | # guest-fsfreeze-freeze, this likely means some freezable | |
484 | # filesystems were unfrozen before this call, and that the | |
485 | # filesystem state may have changed before issuing this | |
486 | # command. | |
e3d4d252 MR |
487 | # |
488 | # Since: 0.15.0 | |
489 | ## | |
490 | { 'command': 'guest-fsfreeze-thaw', | |
491 | 'returns': 'int' } | |
11d0f125 | 492 | |
e82855d9 | 493 | ## |
5072f7b3 | 494 | # @GuestFilesystemTrimResult: |
e82855d9 JO |
495 | # |
496 | # @path: path that was trimmed | |
497 | # @error: an error message when trim failed | |
498 | # @trimmed: bytes trimmed for this path | |
499 | # @minimum: reported effective minimum for this path | |
500 | # | |
501 | # Since: 2.4 | |
502 | ## | |
503 | { 'struct': 'GuestFilesystemTrimResult', | |
504 | 'data': {'path': 'str', | |
505 | '*trimmed': 'int', '*minimum': 'int', '*error': 'str'} } | |
506 | ||
507 | ## | |
5072f7b3 | 508 | # @GuestFilesystemTrimResponse: |
e82855d9 JO |
509 | # |
510 | # @paths: list of @GuestFilesystemTrimResult per path that was trimmed | |
511 | # | |
512 | # Since: 2.4 | |
513 | ## | |
514 | { 'struct': 'GuestFilesystemTrimResponse', | |
515 | 'data': {'paths': ['GuestFilesystemTrimResult']} } | |
516 | ||
eab5fd59 PB |
517 | ## |
518 | # @guest-fstrim: | |
519 | # | |
520 | # Discard (or "trim") blocks which are not in use by the filesystem. | |
521 | # | |
a7b6e896 | 522 | # @minimum: Minimum contiguous free range to discard, in bytes. Free ranges |
883aff68 PM |
523 | # smaller than this may be ignored (this is a hint and the guest |
524 | # may not respect it). By increasing this value, the fstrim | |
525 | # operation will complete more quickly for filesystems with badly | |
526 | # fragmented free space, although not all blocks will be discarded. | |
527 | # The default value is zero, meaning "discard every free block". | |
eab5fd59 | 528 | # |
e82855d9 JO |
529 | # Returns: A @GuestFilesystemTrimResponse which contains the |
530 | # status of all trimmed paths. (since 2.4) | |
eab5fd59 PB |
531 | # |
532 | # Since: 1.2 | |
533 | ## | |
534 | { 'command': 'guest-fstrim', | |
e82855d9 JO |
535 | 'data': { '*minimum': 'int' }, |
536 | 'returns': 'GuestFilesystemTrimResponse' } | |
eab5fd59 | 537 | |
11d0f125 | 538 | ## |
5072f7b3 | 539 | # @guest-suspend-disk: |
11d0f125 LC |
540 | # |
541 | # Suspend guest to disk. | |
542 | # | |
bb6c8d40 DHB |
543 | # This command attempts to suspend the guest using three strategies, in this |
544 | # order: | |
11d0f125 | 545 | # |
bb6c8d40 DHB |
546 | # - systemd hibernate |
547 | # - pm-utils (via pm-hibernate) | |
548 | # - manual write into sysfs | |
11d0f125 | 549 | # |
c6fcc10a LC |
550 | # This command does NOT return a response on success. There is a high chance |
551 | # the command succeeded if the VM exits with a zero exit status or, when | |
552 | # running with --no-shutdown, by issuing the query-status QMP command to | |
553 | # to confirm the VM status is "shutdown". However, the VM could also exit | |
554 | # (or set its status to "shutdown") due to other reasons. | |
555 | # | |
556 | # The following errors may be returned: | |
a7b6e896 PM |
557 | # |
558 | # - If suspend to disk is not supported, Unsupported | |
11d0f125 | 559 | # |
c6fcc10a LC |
560 | # Notes: It's strongly recommended to issue the guest-sync command before |
561 | # sending commands when the guest resumes | |
11d0f125 LC |
562 | # |
563 | # Since: 1.1 | |
564 | ## | |
d708cdbe | 565 | { 'command': 'guest-suspend-disk', 'success-response': false } |
fbf42210 LC |
566 | |
567 | ## | |
5072f7b3 | 568 | # @guest-suspend-ram: |
fbf42210 LC |
569 | # |
570 | # Suspend guest to ram. | |
571 | # | |
bb6c8d40 DHB |
572 | # This command attempts to suspend the guest using three strategies, in this |
573 | # order: | |
fbf42210 | 574 | # |
bb6c8d40 DHB |
575 | # - systemd suspend |
576 | # - pm-utils (via pm-suspend) | |
577 | # - manual write into sysfs | |
fbf42210 | 578 | # |
f8a57777 DHB |
579 | # IMPORTANT: guest-suspend-ram requires working wakeup support in |
580 | # QEMU. You should check QMP command query-current-machine returns | |
581 | # wakeup-suspend-support: true before issuing this command. Failure in | |
582 | # doing so can result in a suspended guest that QEMU will not be able to | |
583 | # awaken, forcing the user to power cycle the guest to bring it back. | |
fbf42210 | 584 | # |
432d29db LC |
585 | # This command does NOT return a response on success. There are two options |
586 | # to check for success: | |
a7b6e896 PM |
587 | # |
588 | # 1. Wait for the SUSPEND QMP event from QEMU | |
589 | # 2. Issue the query-status QMP command to confirm the VM status is | |
590 | # "suspended" | |
432d29db LC |
591 | # |
592 | # The following errors may be returned: | |
a7b6e896 PM |
593 | # |
594 | # - If suspend to ram is not supported, Unsupported | |
fbf42210 | 595 | # |
432d29db LC |
596 | # Notes: It's strongly recommended to issue the guest-sync command before |
597 | # sending commands when the guest resumes | |
fbf42210 LC |
598 | # |
599 | # Since: 1.1 | |
600 | ## | |
d708cdbe | 601 | { 'command': 'guest-suspend-ram', 'success-response': false } |
95f4f404 LC |
602 | |
603 | ## | |
5072f7b3 | 604 | # @guest-suspend-hybrid: |
95f4f404 LC |
605 | # |
606 | # Save guest state to disk and suspend to ram. | |
607 | # | |
bb6c8d40 DHB |
608 | # This command attempts to suspend the guest by executing, in this order: |
609 | # | |
610 | # - systemd hybrid-sleep | |
611 | # - pm-utils (via pm-suspend-hybrid) | |
95f4f404 | 612 | # |
f8a57777 DHB |
613 | # IMPORTANT: guest-suspend-hybrid requires working wakeup support in |
614 | # QEMU. You should check QMP command query-current-machine returns | |
615 | # wakeup-suspend-support: true before issuing this command. Failure in | |
616 | # doing so can result in a suspended guest that QEMU will not be able to | |
617 | # awaken, forcing the user to power cycle the guest to bring it back. | |
95f4f404 | 618 | # |
d9fcd2a1 LC |
619 | # This command does NOT return a response on success. There are two options |
620 | # to check for success: | |
a7b6e896 PM |
621 | # |
622 | # 1. Wait for the SUSPEND QMP event from QEMU | |
623 | # 2. Issue the query-status QMP command to confirm the VM status is | |
624 | # "suspended" | |
d9fcd2a1 LC |
625 | # |
626 | # The following errors may be returned: | |
a7b6e896 PM |
627 | # |
628 | # - If hybrid suspend is not supported, Unsupported | |
95f4f404 | 629 | # |
d9fcd2a1 LC |
630 | # Notes: It's strongly recommended to issue the guest-sync command before |
631 | # sending commands when the guest resumes | |
95f4f404 LC |
632 | # |
633 | # Since: 1.1 | |
634 | ## | |
d708cdbe | 635 | { 'command': 'guest-suspend-hybrid', 'success-response': false } |
3424fc9f MP |
636 | |
637 | ## | |
638 | # @GuestIpAddressType: | |
639 | # | |
640 | # An enumeration of supported IP address types | |
641 | # | |
642 | # @ipv4: IP version 4 | |
643 | # | |
644 | # @ipv6: IP version 6 | |
645 | # | |
646 | # Since: 1.1 | |
647 | ## | |
648 | { 'enum': 'GuestIpAddressType', | |
649 | 'data': [ 'ipv4', 'ipv6' ] } | |
650 | ||
651 | ## | |
652 | # @GuestIpAddress: | |
653 | # | |
654 | # @ip-address: IP address | |
655 | # | |
656 | # @ip-address-type: Type of @ip-address (e.g. ipv4, ipv6) | |
657 | # | |
658 | # @prefix: Network prefix length of @ip-address | |
659 | # | |
660 | # Since: 1.1 | |
661 | ## | |
895a2a80 | 662 | { 'struct': 'GuestIpAddress', |
3424fc9f MP |
663 | 'data': {'ip-address': 'str', |
664 | 'ip-address-type': 'GuestIpAddressType', | |
665 | 'prefix': 'int'} } | |
666 | ||
53f9fcb2 ZL |
667 | ## |
668 | # @GuestNetworkInterfaceStat: | |
669 | # | |
670 | # @rx-bytes: total bytes received | |
671 | # | |
672 | # @rx-packets: total packets received | |
673 | # | |
674 | # @rx-errs: bad packets received | |
675 | # | |
676 | # @rx-dropped: receiver dropped packets | |
677 | # | |
678 | # @tx-bytes: total bytes transmitted | |
679 | # | |
680 | # @tx-packets: total packets transmitted | |
681 | # | |
682 | # @tx-errs: packet transmit problems | |
683 | # | |
684 | # @tx-dropped: dropped packets transmitted | |
685 | # | |
686 | # Since: 2.11 | |
687 | ## | |
688 | { 'struct': 'GuestNetworkInterfaceStat', | |
689 | 'data': {'rx-bytes': 'uint64', | |
690 | 'rx-packets': 'uint64', | |
691 | 'rx-errs': 'uint64', | |
692 | 'rx-dropped': 'uint64', | |
693 | 'tx-bytes': 'uint64', | |
694 | 'tx-packets': 'uint64', | |
695 | 'tx-errs': 'uint64', | |
696 | 'tx-dropped': 'uint64' | |
697 | } } | |
698 | ||
3424fc9f MP |
699 | ## |
700 | # @GuestNetworkInterface: | |
701 | # | |
702 | # @name: The name of interface for which info are being delivered | |
703 | # | |
704 | # @hardware-address: Hardware address of @name | |
705 | # | |
706 | # @ip-addresses: List of addresses assigned to @name | |
707 | # | |
53f9fcb2 | 708 | # @statistics: various statistic counters related to @name |
883aff68 | 709 | # (since 2.11) |
53f9fcb2 | 710 | # |
3424fc9f MP |
711 | # Since: 1.1 |
712 | ## | |
895a2a80 | 713 | { 'struct': 'GuestNetworkInterface', |
3424fc9f MP |
714 | 'data': {'name': 'str', |
715 | '*hardware-address': 'str', | |
53f9fcb2 ZL |
716 | '*ip-addresses': ['GuestIpAddress'], |
717 | '*statistics': 'GuestNetworkInterfaceStat' } } | |
3424fc9f MP |
718 | |
719 | ## | |
720 | # @guest-network-get-interfaces: | |
721 | # | |
722 | # Get list of guest IP addresses, MAC addresses | |
723 | # and netmasks. | |
724 | # | |
725 | # Returns: List of GuestNetworkInfo on success. | |
726 | # | |
727 | # Since: 1.1 | |
728 | ## | |
729 | { 'command': 'guest-network-get-interfaces', | |
730 | 'returns': ['GuestNetworkInterface'] } | |
70e133a7 LE |
731 | |
732 | ## | |
733 | # @GuestLogicalProcessor: | |
734 | # | |
735 | # @logical-id: Arbitrary guest-specific unique identifier of the VCPU. | |
736 | # | |
737 | # @online: Whether the VCPU is enabled. | |
738 | # | |
1d8bda12 | 739 | # @can-offline: Whether offlining the VCPU is possible. This member |
c964c9e0 LE |
740 | # is always filled in by the guest agent when the structure is |
741 | # returned, and always ignored on input (hence it can be omitted | |
742 | # then). | |
70e133a7 LE |
743 | # |
744 | # Since: 1.5 | |
745 | ## | |
895a2a80 | 746 | { 'struct': 'GuestLogicalProcessor', |
70e133a7 LE |
747 | 'data': {'logical-id': 'int', |
748 | 'online': 'bool', | |
749 | '*can-offline': 'bool'} } | |
750 | ||
751 | ## | |
752 | # @guest-get-vcpus: | |
753 | # | |
754 | # Retrieve the list of the guest's logical processors. | |
755 | # | |
756 | # This is a read-only operation. | |
757 | # | |
758 | # Returns: The list of all VCPUs the guest knows about. Each VCPU is put on the | |
883aff68 | 759 | # list exactly once, but their order is unspecified. |
70e133a7 LE |
760 | # |
761 | # Since: 1.5 | |
762 | ## | |
763 | { 'command': 'guest-get-vcpus', | |
764 | 'returns': ['GuestLogicalProcessor'] } | |
765 | ||
766 | ## | |
767 | # @guest-set-vcpus: | |
768 | # | |
769 | # Attempt to reconfigure (currently: enable/disable) logical processors inside | |
770 | # the guest. | |
771 | # | |
772 | # The input list is processed node by node in order. In each node @logical-id | |
773 | # is used to look up the guest VCPU, for which @online specifies the requested | |
774 | # state. The set of distinct @logical-id's is only required to be a subset of | |
775 | # the guest-supported identifiers. There's no restriction on list length or on | |
776 | # repeating the same @logical-id (with possibly different @online field). | |
777 | # Preferably the input list should describe a modified subset of | |
778 | # @guest-get-vcpus' return value. | |
779 | # | |
780 | # Returns: The length of the initial sublist that has been successfully | |
781 | # processed. The guest agent maximizes this value. Possible cases: | |
782 | # | |
a7b6e896 PM |
783 | # - 0: |
784 | # if the @vcpus list was empty on input. Guest state | |
785 | # has not been changed. Otherwise, | |
786 | # - Error: | |
787 | # processing the first node of @vcpus failed for the | |
788 | # reason returned. Guest state has not been changed. | |
789 | # Otherwise, | |
790 | # - < length(@vcpus): | |
791 | # more than zero initial nodes have been processed, | |
792 | # but not the entire @vcpus list. Guest state has | |
793 | # changed accordingly. To retrieve the error | |
794 | # (assuming it persists), repeat the call with the | |
795 | # successfully processed initial sublist removed. | |
796 | # Otherwise, | |
797 | # - length(@vcpus): | |
798 | # call successful. | |
70e133a7 LE |
799 | # |
800 | # Since: 1.5 | |
801 | ## | |
802 | { 'command': 'guest-set-vcpus', | |
803 | 'data': {'vcpus': ['GuestLogicalProcessor'] }, | |
804 | 'returns': 'int' } | |
46d4c572 TS |
805 | |
806 | ## | |
5072f7b3 | 807 | # @GuestDiskBusType: |
46d4c572 TS |
808 | # |
809 | # An enumeration of bus type of disks | |
810 | # | |
811 | # @ide: IDE disks | |
812 | # @fdc: floppy disks | |
813 | # @scsi: SCSI disks | |
814 | # @virtio: virtio disks | |
815 | # @xen: Xen disks | |
816 | # @usb: USB disks | |
817 | # @uml: UML disks | |
818 | # @sata: SATA disks | |
819 | # @sd: SD cards | |
a3ef3b22 OK |
820 | # @unknown: Unknown bus type |
821 | # @ieee1394: Win IEEE 1394 bus type | |
822 | # @ssa: Win SSA bus type | |
823 | # @fibre: Win fiber channel bus type | |
824 | # @raid: Win RAID bus type | |
825 | # @iscsi: Win iScsi bus type | |
826 | # @sas: Win serial-attaches SCSI bus type | |
827 | # @mmc: Win multimedia card (MMC) bus type | |
828 | # @virtual: Win virtual bus type | |
72ec8bf3 | 829 | # @file-backed-virtual: Win file-backed bus type |
d48f61c8 | 830 | # @nvme: NVMe disks (since 7.1) |
46d4c572 | 831 | # |
5f8343d0 | 832 | # Since: 2.2; 'Unknown' and all entries below since 2.4 |
46d4c572 TS |
833 | ## |
834 | { 'enum': 'GuestDiskBusType', | |
835 | 'data': [ 'ide', 'fdc', 'scsi', 'virtio', 'xen', 'usb', 'uml', 'sata', | |
a3ef3b22 | 836 | 'sd', 'unknown', 'ieee1394', 'ssa', 'fibre', 'raid', 'iscsi', |
d48f61c8 | 837 | 'sas', 'mmc', 'virtual', 'file-backed-virtual', 'nvme' ] } |
a3ef3b22 | 838 | |
46d4c572 TS |
839 | |
840 | ## | |
841 | # @GuestPCIAddress: | |
842 | # | |
843 | # @domain: domain id | |
844 | # @bus: bus id | |
845 | # @slot: slot id | |
846 | # @function: function id | |
847 | # | |
848 | # Since: 2.2 | |
849 | ## | |
895a2a80 | 850 | { 'struct': 'GuestPCIAddress', |
46d4c572 TS |
851 | 'data': {'domain': 'int', 'bus': 'int', |
852 | 'slot': 'int', 'function': 'int'} } | |
853 | ||
5b723a5d TH |
854 | ## |
855 | # @GuestCCWAddress: | |
856 | # | |
857 | # @cssid: channel subsystem image id | |
858 | # @ssid: subchannel set id | |
859 | # @subchno: subchannel number | |
860 | # @devno: device number | |
861 | # | |
862 | # Since: 6.0 | |
863 | ## | |
864 | { 'struct': 'GuestCCWAddress', | |
865 | 'data': {'cssid': 'int', | |
866 | 'ssid': 'int', | |
867 | 'subchno': 'int', | |
868 | 'devno': 'int'} } | |
869 | ||
46d4c572 TS |
870 | ## |
871 | # @GuestDiskAddress: | |
872 | # | |
ba620541 | 873 | # @pci-controller: controller's PCI address (fields are set to -1 if invalid) |
4d5c8bc4 | 874 | # @bus-type: bus type |
46d4c572 TS |
875 | # @bus: bus id |
876 | # @target: target id | |
877 | # @unit: unit id | |
b616105a | 878 | # @serial: serial number (since: 3.1) |
6589ce35 | 879 | # @dev: device node (POSIX) or device UNC (Windows) (since: 3.1) |
5b723a5d | 880 | # @ccw-address: CCW address on s390x (since: 6.0) |
46d4c572 TS |
881 | # |
882 | # Since: 2.2 | |
883 | ## | |
895a2a80 | 884 | { 'struct': 'GuestDiskAddress', |
46d4c572 TS |
885 | 'data': {'pci-controller': 'GuestPCIAddress', |
886 | 'bus-type': 'GuestDiskBusType', | |
b616105a | 887 | 'bus': 'int', 'target': 'int', 'unit': 'int', |
5b723a5d TH |
888 | '*serial': 'str', '*dev': 'str', |
889 | '*ccw-address': 'GuestCCWAddress'} } | |
46d4c572 | 890 | |
22668881 ZP |
891 | ## |
892 | # @GuestNVMeSmart: | |
893 | # | |
894 | # NVMe smart informations, based on NVMe specification, | |
895 | # section <SMART / Health Information (Log Identifier 02h)> | |
896 | # | |
897 | # Since: 7.1 | |
898 | ## | |
899 | { 'struct': 'GuestNVMeSmart', | |
900 | 'data': {'critical-warning': 'int', | |
901 | 'temperature': 'int', | |
902 | 'available-spare': 'int', | |
903 | 'available-spare-threshold': 'int', | |
904 | 'percentage-used': 'int', | |
905 | 'data-units-read-lo': 'uint64', | |
906 | 'data-units-read-hi': 'uint64', | |
907 | 'data-units-written-lo': 'uint64', | |
908 | 'data-units-written-hi': 'uint64', | |
909 | 'host-read-commands-lo': 'uint64', | |
910 | 'host-read-commands-hi': 'uint64', | |
911 | 'host-write-commands-lo': 'uint64', | |
912 | 'host-write-commands-hi': 'uint64', | |
913 | 'controller-busy-time-lo': 'uint64', | |
914 | 'controller-busy-time-hi': 'uint64', | |
915 | 'power-cycles-lo': 'uint64', | |
916 | 'power-cycles-hi': 'uint64', | |
917 | 'power-on-hours-lo': 'uint64', | |
918 | 'power-on-hours-hi': 'uint64', | |
919 | 'unsafe-shutdowns-lo': 'uint64', | |
920 | 'unsafe-shutdowns-hi': 'uint64', | |
921 | 'media-errors-lo': 'uint64', | |
922 | 'media-errors-hi': 'uint64', | |
923 | 'number-of-error-log-entries-lo': 'uint64', | |
924 | 'number-of-error-log-entries-hi': 'uint64' } } | |
925 | ||
926 | ## | |
927 | # @GuestDiskSmart: | |
928 | # | |
929 | # Disk type related smart information. | |
930 | # | |
931 | # - @nvme: NVMe disk smart | |
932 | # | |
933 | # Since: 7.1 | |
934 | ## | |
935 | { 'union': 'GuestDiskSmart', | |
936 | 'base': { 'type': 'GuestDiskBusType' }, | |
937 | 'discriminator': 'type', | |
938 | 'data': { 'nvme': 'GuestNVMeSmart' } } | |
939 | ||
c27ea3f9 TG |
940 | ## |
941 | # @GuestDiskInfo: | |
942 | # | |
943 | # @name: device node (Linux) or device UNC (Windows) | |
944 | # @partition: whether this is a partition or disk | |
a8aa94b5 MR |
945 | # @dependencies: list of device dependencies; e.g. for LVs of the LVM this will |
946 | # hold the list of PVs, for LUKS encrypted volume this will | |
947 | # contain the disk where the volume is placed. (Linux) | |
c27ea3f9 TG |
948 | # @address: disk address information (only for non-virtual devices) |
949 | # @alias: optional alias assigned to the disk, on Linux this is a name assigned | |
950 | # by device mapper | |
22668881 | 951 | # @smart: disk smart information (Since 7.1) |
c27ea3f9 | 952 | # |
433a4fdc | 953 | # Since: 5.2 |
c27ea3f9 TG |
954 | ## |
955 | { 'struct': 'GuestDiskInfo', | |
a8aa94b5 | 956 | 'data': {'name': 'str', 'partition': 'bool', '*dependencies': ['str'], |
22668881 ZP |
957 | '*address': 'GuestDiskAddress', '*alias': 'str', |
958 | '*smart': 'GuestDiskSmart'} } | |
c27ea3f9 TG |
959 | |
960 | ## | |
961 | # @guest-get-disks: | |
962 | # | |
963 | # Returns: The list of disks in the guest. For Windows these are only the | |
964 | # physical disks. On Linux these are all root block devices of | |
965 | # non-zero size including e.g. removable devices, loop devices, | |
966 | # NBD, etc. | |
967 | # | |
968 | # Since: 5.2 | |
969 | ## | |
970 | { 'command': 'guest-get-disks', | |
971 | 'returns': ['GuestDiskInfo'] } | |
972 | ||
46d4c572 | 973 | ## |
5072f7b3 | 974 | # @GuestFilesystemInfo: |
46d4c572 TS |
975 | # |
976 | # @name: disk name | |
977 | # @mountpoint: mount point path | |
978 | # @type: file system type string | |
25b5ff1a CH |
979 | # @used-bytes: file system used bytes (since 3.0) |
980 | # @total-bytes: non-root file system total bytes (since 3.0) | |
46d4c572 TS |
981 | # @disk: an array of disk hardware information that the volume lies on, |
982 | # which may be empty if the disk type is not supported | |
983 | # | |
984 | # Since: 2.2 | |
985 | ## | |
895a2a80 | 986 | { 'struct': 'GuestFilesystemInfo', |
46d4c572 | 987 | 'data': {'name': 'str', 'mountpoint': 'str', 'type': 'str', |
25b5ff1a | 988 | '*used-bytes': 'uint64', '*total-bytes': 'uint64', |
46d4c572 TS |
989 | 'disk': ['GuestDiskAddress']} } |
990 | ||
991 | ## | |
992 | # @guest-get-fsinfo: | |
993 | # | |
994 | # Returns: The list of filesystems information mounted in the guest. | |
995 | # The returned mountpoints may be specified to | |
996 | # @guest-fsfreeze-freeze-list. | |
997 | # Network filesystems (such as CIFS and NFS) are not listed. | |
998 | # | |
999 | # Since: 2.2 | |
1000 | ## | |
1001 | { 'command': 'guest-get-fsinfo', | |
1002 | 'returns': ['GuestFilesystemInfo'] } | |
215a2771 DB |
1003 | |
1004 | ## | |
5072f7b3 | 1005 | # @guest-set-user-password: |
215a2771 DB |
1006 | # |
1007 | # @username: the user account whose password to change | |
1008 | # @password: the new password entry string, base64 encoded | |
1009 | # @crypted: true if password is already crypt()d, false if raw | |
1010 | # | |
1011 | # If the @crypted flag is true, it is the caller's responsibility | |
1012 | # to ensure the correct crypt() encryption scheme is used. This | |
1013 | # command does not attempt to interpret or report on the encryption | |
1014 | # scheme. Refer to the documentation of the guest operating system | |
1015 | # in question to determine what is supported. | |
1016 | # | |
2e2a58e0 | 1017 | # Not all guest operating systems will support use of the |
215a2771 DB |
1018 | # @crypted flag, as they may require the clear-text password |
1019 | # | |
1020 | # The @password parameter must always be base64 encoded before | |
1021 | # transmission, even if already crypt()d, to ensure it is 8-bit | |
1022 | # safe when passed as JSON. | |
1023 | # | |
1024 | # Returns: Nothing on success. | |
1025 | # | |
5072f7b3 | 1026 | # Since: 2.3 |
215a2771 DB |
1027 | ## |
1028 | { 'command': 'guest-set-user-password', | |
1029 | 'data': { 'username': 'str', 'password': 'str', 'crypted': 'bool' } } | |
a065aaa9 | 1030 | |
49687ace | 1031 | ## |
a065aaa9 HZ |
1032 | # @GuestMemoryBlock: |
1033 | # | |
1034 | # @phys-index: Arbitrary guest-specific unique identifier of the MEMORY BLOCK. | |
1035 | # | |
1036 | # @online: Whether the MEMORY BLOCK is enabled in guest. | |
1037 | # | |
1d8bda12 | 1038 | # @can-offline: Whether offlining the MEMORY BLOCK is possible. |
a065aaa9 HZ |
1039 | # This member is always filled in by the guest agent when the |
1040 | # structure is returned, and always ignored on input (hence it | |
1041 | # can be omitted then). | |
1042 | # | |
1043 | # Since: 2.3 | |
1044 | ## | |
895a2a80 | 1045 | { 'struct': 'GuestMemoryBlock', |
a065aaa9 HZ |
1046 | 'data': {'phys-index': 'uint64', |
1047 | 'online': 'bool', | |
1048 | '*can-offline': 'bool'} } | |
1049 | ||
1050 | ## | |
1051 | # @guest-get-memory-blocks: | |
1052 | # | |
1053 | # Retrieve the list of the guest's memory blocks. | |
1054 | # | |
1055 | # This is a read-only operation. | |
1056 | # | |
1057 | # Returns: The list of all memory blocks the guest knows about. | |
883aff68 PM |
1058 | # Each memory block is put on the list exactly once, but their order |
1059 | # is unspecified. | |
a065aaa9 HZ |
1060 | # |
1061 | # Since: 2.3 | |
1062 | ## | |
1063 | { 'command': 'guest-get-memory-blocks', | |
1064 | 'returns': ['GuestMemoryBlock'] } | |
1065 | ||
1066 | ## | |
5072f7b3 | 1067 | # @GuestMemoryBlockResponseType: |
a065aaa9 HZ |
1068 | # |
1069 | # An enumeration of memory block operation result. | |
1070 | # | |
631b22ea | 1071 | # @success: the operation of online/offline memory block is successful. |
a065aaa9 HZ |
1072 | # @not-found: can't find the corresponding memoryXXX directory in sysfs. |
1073 | # @operation-not-supported: for some old kernels, it does not support | |
1074 | # online or offline memory block. | |
1075 | # @operation-failed: the operation of online/offline memory block fails, | |
1076 | # because of some errors happen. | |
1077 | # | |
1078 | # Since: 2.3 | |
1079 | ## | |
1080 | { 'enum': 'GuestMemoryBlockResponseType', | |
1081 | 'data': ['success', 'not-found', 'operation-not-supported', | |
1082 | 'operation-failed'] } | |
1083 | ||
1084 | ## | |
1085 | # @GuestMemoryBlockResponse: | |
1086 | # | |
1087 | # @phys-index: same with the 'phys-index' member of @GuestMemoryBlock. | |
1088 | # | |
1089 | # @response: the result of memory block operation. | |
1090 | # | |
1d8bda12 | 1091 | # @error-code: the error number. |
883aff68 PM |
1092 | # When memory block operation fails, we assign the value of |
1093 | # 'errno' to this member, it indicates what goes wrong. | |
1094 | # When the operation succeeds, it will be omitted. | |
a065aaa9 HZ |
1095 | # |
1096 | # Since: 2.3 | |
1097 | ## | |
895a2a80 | 1098 | { 'struct': 'GuestMemoryBlockResponse', |
a065aaa9 HZ |
1099 | 'data': { 'phys-index': 'uint64', |
1100 | 'response': 'GuestMemoryBlockResponseType', | |
1101 | '*error-code': 'int' }} | |
1102 | ||
1103 | ## | |
1104 | # @guest-set-memory-blocks: | |
1105 | # | |
1106 | # Attempt to reconfigure (currently: enable/disable) state of memory blocks | |
1107 | # inside the guest. | |
1108 | # | |
1109 | # The input list is processed node by node in order. In each node @phys-index | |
1110 | # is used to look up the guest MEMORY BLOCK, for which @online specifies the | |
1111 | # requested state. The set of distinct @phys-index's is only required to be a | |
1112 | # subset of the guest-supported identifiers. There's no restriction on list | |
1113 | # length or on repeating the same @phys-index (with possibly different @online | |
1114 | # field). | |
1115 | # Preferably the input list should describe a modified subset of | |
1116 | # @guest-get-memory-blocks' return value. | |
1117 | # | |
1118 | # Returns: The operation results, it is a list of @GuestMemoryBlockResponse, | |
1119 | # which is corresponding to the input list. | |
1120 | # | |
1121 | # Note: it will return NULL if the @mem-blks list was empty on input, | |
1122 | # or there is an error, and in this case, guest state will not be | |
1123 | # changed. | |
1124 | # | |
1125 | # Since: 2.3 | |
1126 | ## | |
1127 | { 'command': 'guest-set-memory-blocks', | |
1128 | 'data': {'mem-blks': ['GuestMemoryBlock'] }, | |
1129 | 'returns': ['GuestMemoryBlockResponse'] } | |
1130 | ||
49687ace | 1131 | ## |
a065aaa9 HZ |
1132 | # @GuestMemoryBlockInfo: |
1133 | # | |
1134 | # @size: the size (in bytes) of the guest memory blocks, | |
1135 | # which are the minimal units of memory block online/offline | |
1136 | # operations (also called Logical Memory Hotplug). | |
1137 | # | |
1138 | # Since: 2.3 | |
1139 | ## | |
895a2a80 | 1140 | { 'struct': 'GuestMemoryBlockInfo', |
a065aaa9 HZ |
1141 | 'data': {'size': 'uint64'} } |
1142 | ||
1143 | ## | |
1144 | # @guest-get-memory-block-info: | |
1145 | # | |
1146 | # Get information relating to guest memory blocks. | |
1147 | # | |
a065aaa9 HZ |
1148 | # Returns: @GuestMemoryBlockInfo |
1149 | # | |
5072f7b3 | 1150 | # Since: 2.3 |
a065aaa9 HZ |
1151 | ## |
1152 | { 'command': 'guest-get-memory-block-info', | |
1153 | 'returns': 'GuestMemoryBlockInfo' } | |
d697e30c | 1154 | |
49687ace | 1155 | ## |
d697e30c YP |
1156 | # @GuestExecStatus: |
1157 | # | |
1158 | # @exited: true if process has already terminated. | |
1d8bda12 MA |
1159 | # @exitcode: process exit code if it was normally terminated. |
1160 | # @signal: signal number (linux) or unhandled exception code | |
883aff68 | 1161 | # (windows) if the process was abnormally terminated. |
1d8bda12 MA |
1162 | # @out-data: base64-encoded stdout of the process |
1163 | # @err-data: base64-encoded stderr of the process | |
883aff68 PM |
1164 | # Note: @out-data and @err-data are present only |
1165 | # if 'capture-output' was specified for 'guest-exec' | |
1d8bda12 | 1166 | # @out-truncated: true if stdout was not fully captured |
883aff68 | 1167 | # due to size limitation. |
1d8bda12 | 1168 | # @err-truncated: true if stderr was not fully captured |
883aff68 | 1169 | # due to size limitation. |
d697e30c YP |
1170 | # |
1171 | # Since: 2.5 | |
1172 | ## | |
1173 | { 'struct': 'GuestExecStatus', | |
1174 | 'data': { 'exited': 'bool', '*exitcode': 'int', '*signal': 'int', | |
a1853dca YP |
1175 | '*out-data': 'str', '*err-data': 'str', |
1176 | '*out-truncated': 'bool', '*err-truncated': 'bool' }} | |
d697e30c | 1177 | ## |
5072f7b3 | 1178 | # @guest-exec-status: |
d697e30c YP |
1179 | # |
1180 | # Check status of process associated with PID retrieved via guest-exec. | |
1181 | # Reap the process and associated metadata if it has exited. | |
1182 | # | |
1183 | # @pid: pid returned from guest-exec | |
1184 | # | |
1185 | # Returns: GuestExecStatus on success. | |
1186 | # | |
5072f7b3 | 1187 | # Since: 2.5 |
d697e30c YP |
1188 | ## |
1189 | { 'command': 'guest-exec-status', | |
1190 | 'data': { 'pid': 'int' }, | |
1191 | 'returns': 'GuestExecStatus' } | |
1192 | ||
1193 | ## | |
1194 | # @GuestExec: | |
a9e2eb06 | 1195 | # |
d697e30c YP |
1196 | # @pid: pid of child process in guest OS |
1197 | # | |
5072f7b3 | 1198 | # Since: 2.5 |
d697e30c YP |
1199 | ## |
1200 | { 'struct': 'GuestExec', | |
1201 | 'data': { 'pid': 'int'} } | |
1202 | ||
1203 | ## | |
1204 | # @guest-exec: | |
1205 | # | |
1206 | # Execute a command in the guest | |
1207 | # | |
1208 | # @path: path or executable name to execute | |
1d8bda12 MA |
1209 | # @arg: argument list to pass to executable |
1210 | # @env: environment variables to pass to executable | |
1211 | # @input-data: data to be passed to process stdin (base64 encoded) | |
1212 | # @capture-output: bool flag to enable capture of | |
d697e30c YP |
1213 | # stdout/stderr of running process. defaults to false. |
1214 | # | |
1215 | # Returns: PID on success. | |
1216 | # | |
1217 | # Since: 2.5 | |
1218 | ## | |
1219 | { 'command': 'guest-exec', | |
1220 | 'data': { 'path': 'str', '*arg': ['str'], '*env': ['str'], | |
1221 | '*input-data': 'str', '*capture-output': 'bool' }, | |
1222 | 'returns': 'GuestExec' } | |
0a3d197a VF |
1223 | |
1224 | ||
1225 | ## | |
1226 | # @GuestHostName: | |
a9e2eb06 | 1227 | # |
0a3d197a VF |
1228 | # @host-name: Fully qualified domain name of the guest OS |
1229 | # | |
1230 | # Since: 2.10 | |
1231 | ## | |
1232 | { 'struct': 'GuestHostName', | |
1233 | 'data': { 'host-name': 'str' } } | |
1234 | ||
1235 | ## | |
1236 | # @guest-get-host-name: | |
1237 | # | |
1238 | # Return a name for the machine. | |
1239 | # | |
1240 | # The returned name is not necessarily a fully-qualified domain name, or even | |
1241 | # present in DNS or some other name service at all. It need not even be unique | |
1242 | # on your local network or site, but usually it is. | |
1243 | # | |
1244 | # Returns: the host name of the machine on success | |
1245 | # | |
1246 | # Since: 2.10 | |
1247 | ## | |
1248 | { 'command': 'guest-get-host-name', | |
1249 | 'returns': 'GuestHostName' } | |
161a56a9 VF |
1250 | |
1251 | ||
1252 | ## | |
1253 | # @GuestUser: | |
a9e2eb06 | 1254 | # |
883aff68 PM |
1255 | # @user: Username |
1256 | # @domain: Logon domain (windows only) | |
161a56a9 VF |
1257 | # @login-time: Time of login of this user on the computer. If multiple |
1258 | # instances of the user are logged in, the earliest login time is | |
1259 | # reported. The value is in fractional seconds since epoch time. | |
1260 | # | |
1261 | # Since: 2.10 | |
1262 | ## | |
1263 | { 'struct': 'GuestUser', | |
1264 | 'data': { 'user': 'str', 'login-time': 'number', '*domain': 'str' } } | |
1265 | ||
1266 | ## | |
1267 | # @guest-get-users: | |
1268 | # Retrieves a list of currently active users on the VM. | |
1269 | # | |
1270 | # Returns: A unique list of users. | |
1271 | # | |
1272 | # Since: 2.10 | |
1273 | ## | |
1274 | { 'command': 'guest-get-users', | |
1275 | 'returns': ['GuestUser'] } | |
53c58e64 VF |
1276 | |
1277 | ## | |
1278 | # @GuestTimezone: | |
1279 | # | |
883aff68 PM |
1280 | # @zone: Timezone name. These values may differ depending on guest/OS and |
1281 | # should only be used for informational purposes. | |
1282 | # @offset: Offset to UTC in seconds, negative numbers for time zones west of | |
1283 | # GMT, positive numbers for east | |
53c58e64 VF |
1284 | # |
1285 | # Since: 2.10 | |
1286 | ## | |
1287 | { 'struct': 'GuestTimezone', | |
1288 | 'data': { '*zone': 'str', 'offset': 'int' } } | |
1289 | ||
1290 | ## | |
1291 | # @guest-get-timezone: | |
1292 | # | |
1293 | # Retrieves the timezone information from the guest. | |
1294 | # | |
1295 | # Returns: A GuestTimezone dictionary. | |
1296 | # | |
1297 | # Since: 2.10 | |
1298 | ## | |
1299 | { 'command': 'guest-get-timezone', | |
1300 | 'returns': 'GuestTimezone' } | |
9848f797 TG |
1301 | |
1302 | ## | |
1303 | # @GuestOSInfo: | |
1304 | # | |
1305 | # @kernel-release: | |
a7b6e896 PM |
1306 | # * POSIX: release field returned by uname(2) |
1307 | # * Windows: build number of the OS | |
9848f797 | 1308 | # @kernel-version: |
a7b6e896 PM |
1309 | # * POSIX: version field returned by uname(2) |
1310 | # * Windows: version number of the OS | |
9848f797 | 1311 | # @machine: |
a7b6e896 PM |
1312 | # * POSIX: machine field returned by uname(2) |
1313 | # * Windows: one of x86, x86_64, arm, ia64 | |
9848f797 | 1314 | # @id: |
a7b6e896 PM |
1315 | # * POSIX: as defined by os-release(5) |
1316 | # * Windows: contains string "mswindows" | |
9848f797 | 1317 | # @name: |
a7b6e896 PM |
1318 | # * POSIX: as defined by os-release(5) |
1319 | # * Windows: contains string "Microsoft Windows" | |
9848f797 | 1320 | # @pretty-name: |
a7b6e896 PM |
1321 | # * POSIX: as defined by os-release(5) |
1322 | # * Windows: product name, e.g. "Microsoft Windows 10 Enterprise" | |
9848f797 | 1323 | # @version: |
a7b6e896 PM |
1324 | # * POSIX: as defined by os-release(5) |
1325 | # * Windows: long version string, e.g. "Microsoft Windows Server 2008" | |
9848f797 | 1326 | # @version-id: |
a7b6e896 PM |
1327 | # * POSIX: as defined by os-release(5) |
1328 | # * Windows: short version identifier, e.g. "7" or "20012r2" | |
9848f797 | 1329 | # @variant: |
a7b6e896 PM |
1330 | # * POSIX: as defined by os-release(5) |
1331 | # * Windows: contains string "server" or "client" | |
9848f797 | 1332 | # @variant-id: |
a7b6e896 PM |
1333 | # * POSIX: as defined by os-release(5) |
1334 | # * Windows: contains string "server" or "client" | |
9848f797 TG |
1335 | # |
1336 | # Notes: | |
1337 | # | |
1338 | # On POSIX systems the fields @id, @name, @pretty-name, @version, @version-id, | |
1339 | # @variant and @variant-id follow the definition specified in os-release(5). | |
1340 | # Refer to the manual page for exact description of the fields. Their values | |
1341 | # are taken from the os-release file. If the file is not present in the system, | |
1342 | # or the values are not present in the file, the fields are not included. | |
1343 | # | |
1344 | # On Windows the values are filled from information gathered from the system. | |
1345 | # | |
1346 | # Since: 2.10 | |
1347 | ## | |
1348 | { 'struct': 'GuestOSInfo', | |
1349 | 'data': { | |
1350 | '*kernel-release': 'str', '*kernel-version': 'str', | |
1351 | '*machine': 'str', '*id': 'str', '*name': 'str', | |
1352 | '*pretty-name': 'str', '*version': 'str', '*version-id': 'str', | |
1353 | '*variant': 'str', '*variant-id': 'str' } } | |
1354 | ||
1355 | ## | |
1356 | # @guest-get-osinfo: | |
1357 | # | |
1358 | # Retrieve guest operating system information | |
1359 | # | |
1360 | # Returns: @GuestOSInfo | |
1361 | # | |
1362 | # Since: 2.10 | |
1363 | ## | |
1364 | { 'command': 'guest-get-osinfo', | |
1365 | 'returns': 'GuestOSInfo' } | |
2e4211ce | 1366 | |
0083124b MA |
1367 | ## |
1368 | # @GuestDeviceType: | |
1369 | ## | |
1370 | { 'enum': 'GuestDeviceType', | |
1371 | 'data': [ 'pci' ] } | |
1372 | ||
2e4211ce | 1373 | ## |
b519e2e9 | 1374 | # @GuestDeviceIdPCI: |
2e4211ce TG |
1375 | # |
1376 | # @vendor-id: vendor ID | |
1377 | # @device-id: device ID | |
1378 | # | |
1379 | # Since: 5.2 | |
1380 | ## | |
b519e2e9 | 1381 | { 'struct': 'GuestDeviceIdPCI', |
2e4211ce TG |
1382 | 'data': { 'vendor-id': 'uint16', 'device-id': 'uint16' } } |
1383 | ||
1384 | ## | |
b519e2e9 | 1385 | # @GuestDeviceId: |
2e4211ce | 1386 | # |
b519e2e9 MA |
1387 | # Id of the device |
1388 | # - @pci: PCI ID, since: 5.2 | |
2e4211ce TG |
1389 | # |
1390 | # Since: 5.2 | |
1391 | ## | |
b519e2e9 | 1392 | { 'union': 'GuestDeviceId', |
0083124b MA |
1393 | 'base': { 'type': 'GuestDeviceType' }, |
1394 | 'discriminator': 'type', | |
b519e2e9 | 1395 | 'data': { 'pci': 'GuestDeviceIdPCI' } } |
2e4211ce TG |
1396 | |
1397 | ## | |
1398 | # @GuestDeviceInfo: | |
1399 | # | |
1400 | # @driver-name: name of the associated driver | |
a88bceef | 1401 | # @driver-date: driver release date, in nanoseconds since the epoch |
2e4211ce | 1402 | # @driver-version: driver version |
b519e2e9 | 1403 | # @id: device ID |
2e4211ce TG |
1404 | # |
1405 | # Since: 5.2 | |
1406 | ## | |
1407 | { 'struct': 'GuestDeviceInfo', | |
1408 | 'data': { | |
1409 | 'driver-name': 'str', | |
a88bceef | 1410 | '*driver-date': 'int', |
2e4211ce | 1411 | '*driver-version': 'str', |
b519e2e9 | 1412 | '*id': 'GuestDeviceId' |
2e4211ce TG |
1413 | } } |
1414 | ||
1415 | ## | |
1416 | # @guest-get-devices: | |
1417 | # | |
1418 | # Retrieve information about device drivers in Windows guest | |
1419 | # | |
1420 | # Returns: @GuestDeviceInfo | |
1421 | # | |
1422 | # Since: 5.2 | |
1423 | ## | |
1424 | { 'command': 'guest-get-devices', | |
1425 | 'returns': ['GuestDeviceInfo'] } | |
8d769ec7 | 1426 | |
cad97c08 MAL |
1427 | ## |
1428 | # @GuestAuthorizedKeys: | |
1429 | # | |
1430 | # @keys: public keys (in OpenSSH/sshd(8) authorized_keys format) | |
1431 | # | |
1432 | # Since: 5.2 | |
1433 | ## | |
1434 | { 'struct': 'GuestAuthorizedKeys', | |
1435 | 'data': { | |
1436 | 'keys': ['str'] | |
1437 | }, | |
8a9f1e1d | 1438 | 'if': 'CONFIG_POSIX' } |
cad97c08 MAL |
1439 | |
1440 | ||
1441 | ## | |
1442 | # @guest-ssh-get-authorized-keys: | |
1443 | # | |
1444 | # @username: the user account to add the authorized keys | |
1445 | # | |
1446 | # Return the public keys from user .ssh/authorized_keys on Unix systems (not | |
1447 | # implemented for other systems). | |
1448 | # | |
1449 | # Returns: @GuestAuthorizedKeys | |
1450 | # | |
1451 | # Since: 5.2 | |
1452 | ## | |
1453 | { 'command': 'guest-ssh-get-authorized-keys', | |
1454 | 'data': { 'username': 'str' }, | |
1455 | 'returns': 'GuestAuthorizedKeys', | |
8a9f1e1d | 1456 | 'if': 'CONFIG_POSIX' } |
cad97c08 | 1457 | |
8d769ec7 MAL |
1458 | ## |
1459 | # @guest-ssh-add-authorized-keys: | |
1460 | # | |
1461 | # @username: the user account to add the authorized keys | |
1462 | # @keys: the public keys to add (in OpenSSH/sshd(8) authorized_keys format) | |
0e3c9475 | 1463 | # @reset: ignore the existing content, set it with the given keys only |
8d769ec7 MAL |
1464 | # |
1465 | # Append public keys to user .ssh/authorized_keys on Unix systems (not | |
1466 | # implemented for other systems). | |
1467 | # | |
1468 | # Returns: Nothing on success. | |
1469 | # | |
1470 | # Since: 5.2 | |
1471 | ## | |
1472 | { 'command': 'guest-ssh-add-authorized-keys', | |
0e3c9475 | 1473 | 'data': { 'username': 'str', 'keys': ['str'], '*reset': 'bool' }, |
8a9f1e1d | 1474 | 'if': 'CONFIG_POSIX' } |
8d769ec7 MAL |
1475 | |
1476 | ## | |
1477 | # @guest-ssh-remove-authorized-keys: | |
1478 | # | |
1479 | # @username: the user account to remove the authorized keys | |
1480 | # @keys: the public keys to remove (in OpenSSH/sshd(8) authorized_keys format) | |
1481 | # | |
1482 | # Remove public keys from the user .ssh/authorized_keys on Unix systems (not | |
1483 | # implemented for other systems). It's not an error if the key is already | |
1484 | # missing. | |
1485 | # | |
1486 | # Returns: Nothing on success. | |
1487 | # | |
1488 | # Since: 5.2 | |
1489 | ## | |
1490 | { 'command': 'guest-ssh-remove-authorized-keys', | |
1491 | 'data': { 'username': 'str', 'keys': ['str'] }, | |
8a9f1e1d | 1492 | 'if': 'CONFIG_POSIX' } |
3569664e | 1493 | |
1494 | ## | |
1495 | # @GuestDiskStats: | |
1496 | # | |
1497 | # @read-sectors: sectors read | |
1498 | # | |
1499 | # @read-ios: reads completed successfully | |
1500 | # | |
1501 | # @read-merges: read requests merged | |
1502 | # | |
1503 | # @write-sectors: sectors written | |
1504 | # | |
1505 | # @write-ios: writes completed | |
1506 | # | |
1507 | # @write-merges: write requests merged | |
1508 | # | |
1509 | # @discard-sectors: sectors discarded | |
1510 | # | |
1511 | # @discard-ios: discards completed successfully | |
1512 | # | |
1513 | # @discard-merges: discard requests merged | |
1514 | # | |
1515 | # @flush-ios: flush requests completed successfully | |
1516 | # | |
1517 | # @read-ticks: time spent reading(ms) | |
1518 | # | |
1519 | # @write-ticks: time spent writing(ms) | |
1520 | # | |
1521 | # @discard-ticks: time spent discarding(ms) | |
1522 | # | |
1523 | # @flush-ticks: time spent flushing(ms) | |
1524 | # | |
1525 | # @ios-pgr: number of I/Os currently in flight | |
1526 | # | |
1527 | # @total-ticks: time spent doing I/Os (ms) | |
1528 | # | |
1529 | # @weight-ticks: weighted time spent doing I/Os since the last update of this field(ms) | |
1530 | # | |
1531 | # Since: 7.1 | |
1532 | ## | |
1533 | { 'struct': 'GuestDiskStats', | |
1534 | 'data': {'*read-sectors': 'uint64', | |
1535 | '*read-ios': 'uint64', | |
1536 | '*read-merges': 'uint64', | |
1537 | '*write-sectors': 'uint64', | |
1538 | '*write-ios': 'uint64', | |
1539 | '*write-merges': 'uint64', | |
1540 | '*discard-sectors': 'uint64', | |
1541 | '*discard-ios': 'uint64', | |
1542 | '*discard-merges': 'uint64', | |
1543 | '*flush-ios': 'uint64', | |
1544 | '*read-ticks': 'uint64', | |
1545 | '*write-ticks': 'uint64', | |
1546 | '*discard-ticks': 'uint64', | |
1547 | '*flush-ticks': 'uint64', | |
1548 | '*ios-pgr': 'uint64', | |
1549 | '*total-ticks': 'uint64', | |
1550 | '*weight-ticks': 'uint64' | |
1551 | } } | |
1552 | ||
1553 | ## | |
1554 | # @GuestDiskStatsInfo: | |
1555 | # | |
1556 | # @name disk name | |
1557 | # | |
1558 | # @major major device number of disk | |
1559 | # | |
1560 | # @minor minor device number of disk | |
1561 | ## | |
1562 | { 'struct': 'GuestDiskStatsInfo', | |
1563 | 'data': {'name': 'str', | |
1564 | 'major': 'uint64', | |
1565 | 'minor': 'uint64', | |
1566 | 'stats': 'GuestDiskStats' } } | |
1567 | ||
1568 | ## | |
1569 | # @guest-get-diskstats: | |
1570 | # | |
1571 | # Retrieve information about disk stats. | |
1572 | # Returns: List of disk stats of guest. | |
1573 | # | |
1574 | # Since: 7.1 | |
1575 | ## | |
1576 | { 'command': 'guest-get-diskstats', | |
1577 | 'returns': ['GuestDiskStatsInfo'] | |
1578 | } | |
1db8a0b0 ZP |
1579 | |
1580 | ## | |
1581 | # @GuestCpuStatsType: | |
1582 | # | |
1583 | # An enumeration of OS type | |
1584 | # | |
1585 | # Since: 7.1 | |
1586 | ## | |
1587 | { 'enum': 'GuestCpuStatsType', | |
1588 | 'data': [ 'linux' ] } | |
1589 | ||
1590 | ||
1591 | ## | |
1592 | # @GuestLinuxCpuStats: | |
1593 | # | |
1594 | # CPU statistics of Linux | |
1595 | # | |
1596 | # @cpu: CPU index in guest OS | |
1597 | # | |
1598 | # @user: Time spent in user mode | |
1599 | # | |
1600 | # @nice: Time spent in user mode with low priority (nice) | |
1601 | # | |
1602 | # @system: Time spent in system mode | |
1603 | # | |
1604 | # @idle: Time spent in the idle task | |
1605 | # | |
1606 | # @iowait: Time waiting for I/O to complete (since Linux 2.5.41) | |
1607 | # | |
1608 | # @irq: Time servicing interrupts (since Linux 2.6.0-test4) | |
1609 | # | |
1610 | # @softirq: Time servicing softirqs (since Linux 2.6.0-test4) | |
1611 | # | |
1612 | # @steal: Stolen time by host (since Linux 2.6.11) | |
1613 | # | |
1614 | # @guest: ime spent running a virtual CPU for guest operating systems under | |
1615 | # the control of the Linux kernel (since Linux 2.6.24) | |
1616 | # | |
1617 | # @guestnice: Time spent running a niced guest (since Linux 2.6.33) | |
1618 | # | |
1619 | # Since: 7.1 | |
1620 | ## | |
1621 | { 'struct': 'GuestLinuxCpuStats', | |
1622 | 'data': {'cpu': 'int', | |
1623 | 'user': 'uint64', | |
1624 | 'nice': 'uint64', | |
1625 | 'system': 'uint64', | |
1626 | 'idle': 'uint64', | |
1627 | '*iowait': 'uint64', | |
1628 | '*irq': 'uint64', | |
1629 | '*softirq': 'uint64', | |
1630 | '*steal': 'uint64', | |
1631 | '*guest': 'uint64', | |
1632 | '*guestnice': 'uint64' | |
1633 | } } | |
1634 | ||
1635 | ## | |
1636 | # @GuestCpuStats: | |
1637 | # | |
1638 | # Get statistics of each CPU in millisecond. | |
1639 | # | |
1640 | # - @linux: Linux style CPU statistics | |
1641 | # | |
1642 | # Since: 7.1 | |
1643 | ## | |
1644 | { 'union': 'GuestCpuStats', | |
1645 | 'base': { 'type': 'GuestCpuStatsType' }, | |
1646 | 'discriminator': 'type', | |
1647 | 'data': { 'linux': 'GuestLinuxCpuStats' } } | |
1648 | ||
1649 | ## | |
1650 | # @guest-get-cpustats: | |
1651 | # | |
1652 | # Retrieve information about CPU stats. | |
1653 | # Returns: List of CPU stats of guest. | |
1654 | # | |
1655 | # Since: 7.1 | |
1656 | ## | |
1657 | { 'command': 'guest-get-cpustats', | |
1658 | 'returns': ['GuestCpuStats'] | |
1659 | } |