blob: 17884c7c709ef64e44bd6ef95ff15d8900590ceb [file] [log] [blame]
Michael Rothe3d4d252011-07-19 15:41:55 -05001# *-*- Mode: Python -*-*
2
3##
Michael Roth3cf0bed2012-02-07 13:56:48 -06004#
Laszlo Ersek9481ecd2013-03-15 19:07:51 +01005# General note concerning the use of guest agent interfaces:
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.
11#
12##
13
Markus Armbrusterbc52d032017-03-15 13:56:51 +010014{ 'pragma': { 'doc-required': true } }
15
Markus Armbruster1554a8f2017-03-15 13:56:54 +010016# Whitelists to permit QAPI rule violations; think twice before you
17# add to them!
18{ 'pragma': {
19 # Commands allowed to return a non-dictionary:
20 'returns-whitelist': [
21 'guest-file-open',
22 'guest-fsfreeze-freeze',
23 'guest-fsfreeze-freeze-list',
24 'guest-fsfreeze-status',
25 'guest-fsfreeze-thaw',
26 'guest-get-time',
27 'guest-set-vcpus',
28 'guest-sync',
29 'guest-sync-delimited' ] } }
30
Laszlo Ersek9481ecd2013-03-15 19:07:51 +010031##
Marc-André Lureau71e0e062015-08-27 12:48:35 +020032# @guest-sync-delimited:
Laszlo Ersek9481ecd2013-03-15 19:07:51 +010033#
Michael Roth3cf0bed2012-02-07 13:56:48 -060034# Echo back a unique integer value, and prepend to response a
35# leading sentinel byte (0xFF) the client can check scan for.
36#
37# This is used by clients talking to the guest agent over the
38# wire to ensure the stream is in sync and doesn't contain stale
39# data from previous client. It must be issued upon initial
40# connection, and after any client-side timeouts (including
41# timeouts on receiving a response to this command).
42#
43# After issuing this request, all guest agent responses should be
44# ignored until the response containing the unique integer value
45# the client passed in is returned. Receival of the 0xFF sentinel
46# byte must be handled as an indication that the client's
47# lexer/tokenizer/parser state should be flushed/reset in
48# preparation for reliably receiving the subsequent response. As
49# an optimization, clients may opt to ignore all data until a
Jim Meyeringa31f0532012-05-09 05:12:04 +000050# sentinel value is receiving to avoid unnecessary processing of
Michael Roth3cf0bed2012-02-07 13:56:48 -060051# stale data.
52#
53# Similarly, clients should also precede this *request*
54# with a 0xFF byte to make sure the guest agent flushes any
55# partially read JSON data from a previous client connection.
56#
57# @id: randomly generated 64-bit integer
58#
59# Returns: The unique integer id passed in by the client
60#
61# Since: 1.1
Marc-André Lureau71e0e062015-08-27 12:48:35 +020062##
Eric Blake01b87f62013-01-02 09:15:11 -070063{ 'command': 'guest-sync-delimited',
Michael Roth3cf0bed2012-02-07 13:56:48 -060064 'data': { 'id': 'int' },
65 'returns': 'int' }
66
67##
Michael Rothe3d4d252011-07-19 15:41:55 -050068# @guest-sync:
69#
70# Echo back a unique integer value
71#
72# This is used by clients talking to the guest agent over the
73# wire to ensure the stream is in sync and doesn't contain stale
74# data from previous client. All guest agent responses should be
75# ignored until the provided unique integer value is returned,
76# and it is up to the client to handle stale whole or
77# partially-delivered JSON text in such a way that this response
78# can be obtained.
79#
Michael Roth3cf0bed2012-02-07 13:56:48 -060080# In cases where a partial stale response was previously
81# received by the client, this cannot always be done reliably.
82# One particular scenario being if qemu-ga responses are fed
83# character-by-character into a JSON parser. In these situations,
84# using guest-sync-delimited may be optimal.
85#
86# For clients that fetch responses line by line and convert them
87# to JSON objects, guest-sync should be sufficient, but note that
88# in cases where the channel is dirty some attempts at parsing the
89# response may result in a parser error.
90#
Stefan Weile7d81002011-12-10 00:19:46 +010091# Such clients should also precede this command
Michael Roth3cf0bed2012-02-07 13:56:48 -060092# with a 0xFF byte to make sure the guest agent flushes any
Michael Rothe3d4d252011-07-19 15:41:55 -050093# partially read JSON data from a previous session.
94#
95# @id: randomly generated 64-bit integer
96#
97# Returns: The unique integer id passed in by the client
98#
99# Since: 0.15.0
100##
Eric Blake01b87f62013-01-02 09:15:11 -0700101{ 'command': 'guest-sync',
Michael Rothe3d4d252011-07-19 15:41:55 -0500102 'data': { 'id': 'int' },
103 'returns': 'int' }
104
105##
106# @guest-ping:
107#
108# Ping the guest agent, a non-error return implies success
109#
110# Since: 0.15.0
111##
112{ 'command': 'guest-ping' }
113
114##
Lei Li6912e6a2013-03-05 17:39:11 +0800115# @guest-get-time:
116#
Amos Kong1634df52014-04-04 23:25:02 +0800117# Get the information about guest's System Time relative to
118# the Epoch of 1970-01-01 in UTC.
Lei Li6912e6a2013-03-05 17:39:11 +0800119#
120# Returns: Time in nanoseconds.
121#
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400122# Since: 1.5
Lei Li6912e6a2013-03-05 17:39:11 +0800123##
124{ 'command': 'guest-get-time',
125 'returns': 'int' }
126
127##
Lei Lia1bca572013-03-05 17:39:12 +0800128# @guest-set-time:
129#
130# Set guest time.
131#
132# When a guest is paused or migrated to a file then loaded
133# from that file, the guest OS has no idea that there
134# was a big gap in the time. Depending on how long the
135# gap was, NTP might not be able to resynchronize the
136# guest.
137#
Amos Kong1634df52014-04-04 23:25:02 +0800138# This command tries to set guest's System Time to the
139# given value, then sets the Hardware Clock (RTC) to the
140# current System Time. This will make it easier for a guest
141# to resynchronize without waiting for NTP. If no @time is
Michal Privoznikee17cbd2015-01-21 12:09:50 +0100142# specified, then the time to set is read from RTC. However,
143# this may not be supported on all platforms (i.e. Windows).
144# If that's the case users are advised to always pass a
145# value.
Lei Lia1bca572013-03-05 17:39:12 +0800146#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100147# @time: time of nanoseconds, relative to the Epoch
Michal Privoznik2c958922014-01-31 11:29:51 +0100148# of 1970-01-01 in UTC.
Lei Lia1bca572013-03-05 17:39:12 +0800149#
150# Returns: Nothing on success.
151#
152# Since: 1.5
153##
154{ 'command': 'guest-set-time',
Michal Privoznik2c958922014-01-31 11:29:51 +0100155 'data': { '*time': 'int' } }
Lei Lia1bca572013-03-05 17:39:12 +0800156
157##
Michael Roth54383722012-01-16 17:44:16 -0600158# @GuestAgentCommandInfo:
159#
160# Information about guest agent commands.
161#
162# @name: name of the command
163#
164# @enabled: whether command is currently enabled by guest admin
165#
Mark Wu0106dc42013-10-09 10:37:26 +0800166# @success-response: whether command returns a response on success
167# (since 1.7)
168#
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400169# Since: 1.1.0
Michael Roth54383722012-01-16 17:44:16 -0600170##
Eric Blake895a2a82015-05-04 09:05:27 -0600171{ 'struct': 'GuestAgentCommandInfo',
Mark Wu0106dc42013-10-09 10:37:26 +0800172 'data': { 'name': 'str', 'enabled': 'bool', 'success-response': 'bool' } }
Michael Roth54383722012-01-16 17:44:16 -0600173
174##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400175# @GuestAgentInfo:
Michael Roth54383722012-01-16 17:44:16 -0600176#
177# Information about guest agent.
178#
179# @version: guest agent version
180#
181# @supported_commands: Information about guest agent commands
182#
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400183# Since: 0.15.0
Michael Roth54383722012-01-16 17:44:16 -0600184##
Eric Blake895a2a82015-05-04 09:05:27 -0600185{ 'struct': 'GuestAgentInfo',
Michael Roth54383722012-01-16 17:44:16 -0600186 'data': { 'version': 'str',
187 'supported_commands': ['GuestAgentCommandInfo'] } }
188##
Michael Rothe3d4d252011-07-19 15:41:55 -0500189# @guest-info:
190#
191# Get some information about the guest agent.
192#
Michael Roth54383722012-01-16 17:44:16 -0600193# Returns: @GuestAgentInfo
194#
Michael Rothe3d4d252011-07-19 15:41:55 -0500195# Since: 0.15.0
196##
Michael Rothe3d4d252011-07-19 15:41:55 -0500197{ 'command': 'guest-info',
198 'returns': 'GuestAgentInfo' }
199
200##
201# @guest-shutdown:
202#
203# Initiate guest-activated shutdown. Note: this is an asynchronous
Luiz Capitulino36748382012-05-14 15:25:20 -0300204# shutdown request, with no guarantee of successful shutdown.
Michael Rothe3d4d252011-07-19 15:41:55 -0500205#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100206# @mode: "halt", "powerdown" (default), or "reboot"
Michael Rothe3d4d252011-07-19 15:41:55 -0500207#
Luiz Capitulino89268172012-05-08 14:24:46 -0300208# This command does NOT return a response on success. Success condition
209# is indicated by the VM exiting with a zero exit status or, when
210# running with --no-shutdown, by issuing the query-status QMP command
211# to confirm the VM status is "shutdown".
Michael Rothe3d4d252011-07-19 15:41:55 -0500212#
213# Since: 0.15.0
214##
Luiz Capitulino89268172012-05-08 14:24:46 -0300215{ 'command': 'guest-shutdown', 'data': { '*mode': 'str' },
Eric Blaked708cdb2015-05-04 09:05:19 -0600216 'success-response': false }
Michael Rothe3d4d252011-07-19 15:41:55 -0500217
218##
219# @guest-file-open:
220#
221# Open a file in the guest and retrieve a file handle for it
222#
Marc-André Lureau4d5c8bc2016-11-17 19:54:53 +0400223# @path: Full path to the file in the guest to open.
Michael Rothe3d4d252011-07-19 15:41:55 -0500224#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100225# @mode: open mode, as per fopen(), "r" is the default.
Michael Rothe3d4d252011-07-19 15:41:55 -0500226#
227# Returns: Guest file handle on success.
228#
229# Since: 0.15.0
230##
231{ 'command': 'guest-file-open',
232 'data': { 'path': 'str', '*mode': 'str' },
233 'returns': 'int' }
234
235##
236# @guest-file-close:
237#
238# Close an open file in the guest
239#
240# @handle: filehandle returned by guest-file-open
241#
242# Returns: Nothing on success.
243#
244# Since: 0.15.0
245##
246{ 'command': 'guest-file-close',
247 'data': { 'handle': 'int' } }
248
249##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400250# @GuestFileRead:
Michael Roth54383722012-01-16 17:44:16 -0600251#
252# Result of guest agent file-read operation
253#
254# @count: number of bytes read (note: count is *before*
255# base64-encoding is applied)
256#
257# @buf-b64: base64-encoded bytes read
258#
259# @eof: whether EOF was encountered during read operation.
260#
261# Since: 0.15.0
262##
Eric Blake895a2a82015-05-04 09:05:27 -0600263{ 'struct': 'GuestFileRead',
Michael Roth54383722012-01-16 17:44:16 -0600264 'data': { 'count': 'int', 'buf-b64': 'str', 'eof': 'bool' } }
265
266##
Michael Rothe3d4d252011-07-19 15:41:55 -0500267# @guest-file-read:
268#
269# Read from an open file in the guest. Data will be base64-encoded
270#
271# @handle: filehandle returned by guest-file-open
272#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100273# @count: maximum number of bytes to read (default is 4KB)
Michael Rothe3d4d252011-07-19 15:41:55 -0500274#
Michael Roth54383722012-01-16 17:44:16 -0600275# Returns: @GuestFileRead on success.
Michael Rothe3d4d252011-07-19 15:41:55 -0500276#
277# Since: 0.15.0
278##
Michael Rothe3d4d252011-07-19 15:41:55 -0500279{ 'command': 'guest-file-read',
280 'data': { 'handle': 'int', '*count': 'int' },
281 'returns': 'GuestFileRead' }
282
283##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400284# @GuestFileWrite:
Michael Roth54383722012-01-16 17:44:16 -0600285#
286# Result of guest agent file-write operation
287#
288# @count: number of bytes written (note: count is actual bytes
289# written, after base64-decoding of provided buffer)
290#
291# @eof: whether EOF was encountered during write operation.
292#
293# Since: 0.15.0
294##
Eric Blake895a2a82015-05-04 09:05:27 -0600295{ 'struct': 'GuestFileWrite',
Michael Roth54383722012-01-16 17:44:16 -0600296 'data': { 'count': 'int', 'eof': 'bool' } }
297
298##
Michael Rothe3d4d252011-07-19 15:41:55 -0500299# @guest-file-write:
300#
301# Write to an open file in the guest.
302#
303# @handle: filehandle returned by guest-file-open
304#
305# @buf-b64: base64-encoded string representing data to be written
306#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100307# @count: bytes to write (actual bytes, after base64-decode),
Michael Rothe3d4d252011-07-19 15:41:55 -0500308# default is all content in buf-b64 buffer after base64 decoding
309#
Michael Roth54383722012-01-16 17:44:16 -0600310# Returns: @GuestFileWrite on success.
Michael Rothe3d4d252011-07-19 15:41:55 -0500311#
312# Since: 0.15.0
313##
Michael Rothe3d4d252011-07-19 15:41:55 -0500314{ 'command': 'guest-file-write',
315 'data': { 'handle': 'int', 'buf-b64': 'str', '*count': 'int' },
316 'returns': 'GuestFileWrite' }
317
Michael Roth54383722012-01-16 17:44:16 -0600318
319##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400320# @GuestFileSeek:
Michael Roth54383722012-01-16 17:44:16 -0600321#
322# Result of guest agent file-seek operation
323#
324# @position: current file position
325#
326# @eof: whether EOF was encountered during file seek
327#
328# Since: 0.15.0
329##
Eric Blake895a2a82015-05-04 09:05:27 -0600330{ 'struct': 'GuestFileSeek',
Michael Roth54383722012-01-16 17:44:16 -0600331 'data': { 'position': 'int', 'eof': 'bool' } }
332
Michael Rothe3d4d252011-07-19 15:41:55 -0500333##
Eric Blake0b4b4932016-02-09 14:27:16 -0700334# @QGASeek:
335#
336# Symbolic names for use in @guest-file-seek
337#
338# @set: Set to the specified offset (same effect as 'whence':0)
339# @cur: Add offset to the current location (same effect as 'whence':1)
340# @end: Add offset to the end of the file (same effect as 'whence':2)
341#
342# Since: 2.6
343##
344{ 'enum': 'QGASeek', 'data': [ 'set', 'cur', 'end' ] }
345
346##
347# @GuestFileWhence:
348#
349# Controls the meaning of offset to @guest-file-seek.
350#
351# @value: Integral value (0 for set, 1 for cur, 2 for end), available
352# for historical reasons, and might differ from the host's or
353# guest's SEEK_* values (since: 0.15)
354# @name: Symbolic name, and preferred interface
355#
356# Since: 2.6
357##
358{ 'alternate': 'GuestFileWhence',
359 'data': { 'value': 'int', 'name': 'QGASeek' } }
360
361##
Michael Rothe3d4d252011-07-19 15:41:55 -0500362# @guest-file-seek:
363#
364# Seek to a position in the file, as with fseek(), and return the
365# current file position afterward. Also encapsulates ftell()'s
Eric Blake0a982b12015-11-25 10:37:15 -0700366# functionality, with offset=0 and whence=1.
Michael Rothe3d4d252011-07-19 15:41:55 -0500367#
368# @handle: filehandle returned by guest-file-open
369#
370# @offset: bytes to skip over in the file stream
371#
Eric Blake0b4b4932016-02-09 14:27:16 -0700372# @whence: Symbolic or numeric code for interpreting offset
Michael Rothe3d4d252011-07-19 15:41:55 -0500373#
Michael Roth54383722012-01-16 17:44:16 -0600374# Returns: @GuestFileSeek on success.
Michael Rothe3d4d252011-07-19 15:41:55 -0500375#
376# Since: 0.15.0
377##
Michael Rothe3d4d252011-07-19 15:41:55 -0500378{ 'command': 'guest-file-seek',
Eric Blake0b4b4932016-02-09 14:27:16 -0700379 'data': { 'handle': 'int', 'offset': 'int',
380 'whence': 'GuestFileWhence' },
Michael Rothe3d4d252011-07-19 15:41:55 -0500381 'returns': 'GuestFileSeek' }
382
383##
384# @guest-file-flush:
385#
386# Write file changes bufferred in userspace to disk/kernel buffers
387#
388# @handle: filehandle returned by guest-file-open
389#
390# Returns: Nothing on success.
391#
392# Since: 0.15.0
393##
394{ 'command': 'guest-file-flush',
395 'data': { 'handle': 'int' } }
396
397##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400398# @GuestFsfreezeStatus:
Michael Rothe3d4d252011-07-19 15:41:55 -0500399#
Lei Li6932a692012-08-23 13:14:25 +0800400# An enumeration of filesystem freeze states
Michael Rothe3d4d252011-07-19 15:41:55 -0500401#
Michael Roth54383722012-01-16 17:44:16 -0600402# @thawed: filesystems thawed/unfrozen
403#
404# @frozen: all non-network guest filesystems frozen
405#
Michael Rothe3d4d252011-07-19 15:41:55 -0500406# Since: 0.15.0
407##
408{ 'enum': 'GuestFsfreezeStatus',
Michael Roth9e8aded432012-04-16 19:52:17 -0500409 'data': [ 'thawed', 'frozen' ] }
Michael Roth54383722012-01-16 17:44:16 -0600410
411##
412# @guest-fsfreeze-status:
413#
414# Get guest fsfreeze state. error state indicates
415#
416# Returns: GuestFsfreezeStatus ("thawed", "frozen", etc., as defined below)
417#
Michael Roth9e8aded432012-04-16 19:52:17 -0500418# Note: This may fail to properly report the current state as a result of
Michael Rothf789aa72012-04-18 16:28:01 -0500419# some other guest processes having issued an fs freeze/thaw.
Michael Roth9e8aded432012-04-16 19:52:17 -0500420#
Michael Roth54383722012-01-16 17:44:16 -0600421# Since: 0.15.0
422##
Michael Rothe3d4d252011-07-19 15:41:55 -0500423{ 'command': 'guest-fsfreeze-status',
424 'returns': 'GuestFsfreezeStatus' }
425
426##
427# @guest-fsfreeze-freeze:
428#
Marc-André Lureau1dbfbc12017-04-03 11:54:38 +0200429# Sync and freeze all freezable, local guest filesystems. If this
430# command succeeded, you may call @guest-fsfreeze-thaw later to
431# unfreeze.
432#
433# Note: On Windows, the command is implemented with the help of a
434# Volume Shadow-copy Service DLL helper. The frozen state is limited
435# for up to 10 seconds by VSS.
Michael Rothe3d4d252011-07-19 15:41:55 -0500436#
Michael Roth9e8aded432012-04-16 19:52:17 -0500437# Returns: Number of file systems currently frozen. On error, all filesystems
438# will be thawed.
Michael Rothe3d4d252011-07-19 15:41:55 -0500439#
440# Since: 0.15.0
441##
442{ 'command': 'guest-fsfreeze-freeze',
443 'returns': 'int' }
444
445##
Tomoki Sekiyamae99bce22014-06-30 17:51:27 -0400446# @guest-fsfreeze-freeze-list:
447#
Marc-André Lureau1dbfbc12017-04-03 11:54:38 +0200448# Sync and freeze specified guest filesystems.
449# See also @guest-fsfreeze-freeze.
Tomoki Sekiyamae99bce22014-06-30 17:51:27 -0400450#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100451# @mountpoints: an array of mountpoints of filesystems to be frozen.
Tomoki Sekiyamae99bce22014-06-30 17:51:27 -0400452# If omitted, every mounted filesystem is frozen.
Marc-André Lureau1dbfbc12017-04-03 11:54:38 +0200453# Invalid mount points are ignored.
Tomoki Sekiyamae99bce22014-06-30 17:51:27 -0400454#
455# Returns: Number of file systems currently frozen. On error, all filesystems
456# will be thawed.
457#
458# Since: 2.2
459##
460{ 'command': 'guest-fsfreeze-freeze-list',
461 'data': { '*mountpoints': ['str'] },
462 'returns': 'int' }
463
464##
Michael Rothe3d4d252011-07-19 15:41:55 -0500465# @guest-fsfreeze-thaw:
466#
Michael Roth9e8aded432012-04-16 19:52:17 -0500467# Unfreeze all frozen guest filesystems
Michael Rothe3d4d252011-07-19 15:41:55 -0500468#
Michael Roth9e8aded432012-04-16 19:52:17 -0500469# Returns: Number of file systems thawed by this call
470#
471# Note: if return value does not match the previous call to
472# guest-fsfreeze-freeze, this likely means some freezable
473# filesystems were unfrozen before this call, and that the
474# filesystem state may have changed before issuing this
475# command.
Michael Rothe3d4d252011-07-19 15:41:55 -0500476#
477# Since: 0.15.0
478##
479{ 'command': 'guest-fsfreeze-thaw',
480 'returns': 'int' }
Luiz Capitulino11d0f122012-02-28 11:03:03 -0300481
482##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400483# @GuestFilesystemTrimResult:
Justin Ossevoorte82855d2015-05-11 08:58:45 +0200484#
485# @path: path that was trimmed
486# @error: an error message when trim failed
487# @trimmed: bytes trimmed for this path
488# @minimum: reported effective minimum for this path
489#
490# Since: 2.4
491##
492{ 'struct': 'GuestFilesystemTrimResult',
493 'data': {'path': 'str',
494 '*trimmed': 'int', '*minimum': 'int', '*error': 'str'} }
495
496##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400497# @GuestFilesystemTrimResponse:
Justin Ossevoorte82855d2015-05-11 08:58:45 +0200498#
499# @paths: list of @GuestFilesystemTrimResult per path that was trimmed
500#
501# Since: 2.4
502##
503{ 'struct': 'GuestFilesystemTrimResponse',
504 'data': {'paths': ['GuestFilesystemTrimResult']} }
505
506##
Paolo Bonzinieab5fd52012-06-13 07:41:28 +0200507# @guest-fstrim:
508#
509# Discard (or "trim") blocks which are not in use by the filesystem.
510#
511# @minimum:
512# Minimum contiguous free range to discard, in bytes. Free ranges
513# smaller than this may be ignored (this is a hint and the guest
514# may not respect it). By increasing this value, the fstrim
515# operation will complete more quickly for filesystems with badly
516# fragmented free space, although not all blocks will be discarded.
517# The default value is zero, meaning "discard every free block".
518#
Justin Ossevoorte82855d2015-05-11 08:58:45 +0200519# Returns: A @GuestFilesystemTrimResponse which contains the
520# status of all trimmed paths. (since 2.4)
Paolo Bonzinieab5fd52012-06-13 07:41:28 +0200521#
522# Since: 1.2
523##
524{ 'command': 'guest-fstrim',
Justin Ossevoorte82855d2015-05-11 08:58:45 +0200525 'data': { '*minimum': 'int' },
526 'returns': 'GuestFilesystemTrimResponse' }
Paolo Bonzinieab5fd52012-06-13 07:41:28 +0200527
528##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400529# @guest-suspend-disk:
Luiz Capitulino11d0f122012-02-28 11:03:03 -0300530#
531# Suspend guest to disk.
532#
533# This command tries to execute the scripts provided by the pm-utils package.
534# If it's not available, the suspend operation will be performed by manually
535# writing to a sysfs file.
536#
537# For the best results it's strongly recommended to have the pm-utils
538# package installed in the guest.
539#
Luiz Capitulinoc6fcc102012-05-08 14:24:47 -0300540# This command does NOT return a response on success. There is a high chance
541# the command succeeded if the VM exits with a zero exit status or, when
542# running with --no-shutdown, by issuing the query-status QMP command to
543# to confirm the VM status is "shutdown". However, the VM could also exit
544# (or set its status to "shutdown") due to other reasons.
545#
546# The following errors may be returned:
Luiz Capitulino11d0f122012-02-28 11:03:03 -0300547# If suspend to disk is not supported, Unsupported
548#
Luiz Capitulinoc6fcc102012-05-08 14:24:47 -0300549# Notes: It's strongly recommended to issue the guest-sync command before
550# sending commands when the guest resumes
Luiz Capitulino11d0f122012-02-28 11:03:03 -0300551#
552# Since: 1.1
553##
Eric Blaked708cdb2015-05-04 09:05:19 -0600554{ 'command': 'guest-suspend-disk', 'success-response': false }
Luiz Capitulinofbf42212012-02-28 11:03:04 -0300555
556##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400557# @guest-suspend-ram:
Luiz Capitulinofbf42212012-02-28 11:03:04 -0300558#
559# Suspend guest to ram.
560#
561# This command tries to execute the scripts provided by the pm-utils package.
562# If it's not available, the suspend operation will be performed by manually
563# writing to a sysfs file.
564#
565# For the best results it's strongly recommended to have the pm-utils
566# package installed in the guest.
567#
568# IMPORTANT: guest-suspend-ram requires QEMU to support the 'system_wakeup'
569# command. Thus, it's *required* to query QEMU for the presence of the
570# 'system_wakeup' command before issuing guest-suspend-ram.
571#
Luiz Capitulino432d29d2012-05-08 14:24:48 -0300572# This command does NOT return a response on success. There are two options
573# to check for success:
574# 1. Wait for the SUSPEND QMP event from QEMU
575# 2. Issue the query-status QMP command to confirm the VM status is
576# "suspended"
577#
578# The following errors may be returned:
Luiz Capitulinofbf42212012-02-28 11:03:04 -0300579# If suspend to ram is not supported, Unsupported
580#
Luiz Capitulino432d29d2012-05-08 14:24:48 -0300581# Notes: It's strongly recommended to issue the guest-sync command before
582# sending commands when the guest resumes
Luiz Capitulinofbf42212012-02-28 11:03:04 -0300583#
584# Since: 1.1
585##
Eric Blaked708cdb2015-05-04 09:05:19 -0600586{ 'command': 'guest-suspend-ram', 'success-response': false }
Luiz Capitulino95f4f402012-02-28 11:03:05 -0300587
588##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400589# @guest-suspend-hybrid:
Luiz Capitulino95f4f402012-02-28 11:03:05 -0300590#
591# Save guest state to disk and suspend to ram.
592#
593# This command requires the pm-utils package to be installed in the guest.
594#
595# IMPORTANT: guest-suspend-hybrid requires QEMU to support the 'system_wakeup'
596# command. Thus, it's *required* to query QEMU for the presence of the
597# 'system_wakeup' command before issuing guest-suspend-hybrid.
598#
Luiz Capitulinod9fcd2a2012-05-08 14:24:49 -0300599# This command does NOT return a response on success. There are two options
600# to check for success:
601# 1. Wait for the SUSPEND QMP event from QEMU
602# 2. Issue the query-status QMP command to confirm the VM status is
603# "suspended"
604#
605# The following errors may be returned:
Luiz Capitulino95f4f402012-02-28 11:03:05 -0300606# If hybrid suspend is not supported, Unsupported
607#
Luiz Capitulinod9fcd2a2012-05-08 14:24:49 -0300608# Notes: It's strongly recommended to issue the guest-sync command before
609# sending commands when the guest resumes
Luiz Capitulino95f4f402012-02-28 11:03:05 -0300610#
611# Since: 1.1
612##
Eric Blaked708cdb2015-05-04 09:05:19 -0600613{ 'command': 'guest-suspend-hybrid', 'success-response': false }
Michal Privoznik3424fc92012-02-29 17:02:23 +0100614
615##
616# @GuestIpAddressType:
617#
618# An enumeration of supported IP address types
619#
620# @ipv4: IP version 4
621#
622# @ipv6: IP version 6
623#
624# Since: 1.1
625##
626{ 'enum': 'GuestIpAddressType',
627 'data': [ 'ipv4', 'ipv6' ] }
628
629##
630# @GuestIpAddress:
631#
632# @ip-address: IP address
633#
634# @ip-address-type: Type of @ip-address (e.g. ipv4, ipv6)
635#
636# @prefix: Network prefix length of @ip-address
637#
638# Since: 1.1
639##
Eric Blake895a2a82015-05-04 09:05:27 -0600640{ 'struct': 'GuestIpAddress',
Michal Privoznik3424fc92012-02-29 17:02:23 +0100641 'data': {'ip-address': 'str',
642 'ip-address-type': 'GuestIpAddressType',
643 'prefix': 'int'} }
644
645##
ZhiPeng Lu53f9fcb2017-09-12 16:54:26 +0800646# @GuestNetworkInterfaceStat:
647#
648# @rx-bytes: total bytes received
649#
650# @rx-packets: total packets received
651#
652# @rx-errs: bad packets received
653#
654# @rx-dropped: receiver dropped packets
655#
656# @tx-bytes: total bytes transmitted
657#
658# @tx-packets: total packets transmitted
659#
660# @tx-errs: packet transmit problems
661#
662# @tx-dropped: dropped packets transmitted
663#
664# Since: 2.11
665##
666{ 'struct': 'GuestNetworkInterfaceStat',
667 'data': {'rx-bytes': 'uint64',
668 'rx-packets': 'uint64',
669 'rx-errs': 'uint64',
670 'rx-dropped': 'uint64',
671 'tx-bytes': 'uint64',
672 'tx-packets': 'uint64',
673 'tx-errs': 'uint64',
674 'tx-dropped': 'uint64'
675 } }
676
677##
Michal Privoznik3424fc92012-02-29 17:02:23 +0100678# @GuestNetworkInterface:
679#
680# @name: The name of interface for which info are being delivered
681#
682# @hardware-address: Hardware address of @name
683#
684# @ip-addresses: List of addresses assigned to @name
685#
ZhiPeng Lu53f9fcb2017-09-12 16:54:26 +0800686# @statistics: various statistic counters related to @name
687# (since 2.11)
688#
Michal Privoznik3424fc92012-02-29 17:02:23 +0100689# Since: 1.1
690##
Eric Blake895a2a82015-05-04 09:05:27 -0600691{ 'struct': 'GuestNetworkInterface',
Michal Privoznik3424fc92012-02-29 17:02:23 +0100692 'data': {'name': 'str',
693 '*hardware-address': 'str',
ZhiPeng Lu53f9fcb2017-09-12 16:54:26 +0800694 '*ip-addresses': ['GuestIpAddress'],
695 '*statistics': 'GuestNetworkInterfaceStat' } }
Michal Privoznik3424fc92012-02-29 17:02:23 +0100696
697##
698# @guest-network-get-interfaces:
699#
700# Get list of guest IP addresses, MAC addresses
701# and netmasks.
702#
703# Returns: List of GuestNetworkInfo on success.
704#
705# Since: 1.1
706##
707{ 'command': 'guest-network-get-interfaces',
708 'returns': ['GuestNetworkInterface'] }
Laszlo Ersek70e133a2013-03-06 22:59:29 +0100709
710##
711# @GuestLogicalProcessor:
712#
713# @logical-id: Arbitrary guest-specific unique identifier of the VCPU.
714#
715# @online: Whether the VCPU is enabled.
716#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100717# @can-offline: Whether offlining the VCPU is possible. This member
Laszlo Ersekc964c9e2013-03-15 19:07:50 +0100718# is always filled in by the guest agent when the structure is
719# returned, and always ignored on input (hence it can be omitted
720# then).
Laszlo Ersek70e133a2013-03-06 22:59:29 +0100721#
722# Since: 1.5
723##
Eric Blake895a2a82015-05-04 09:05:27 -0600724{ 'struct': 'GuestLogicalProcessor',
Laszlo Ersek70e133a2013-03-06 22:59:29 +0100725 'data': {'logical-id': 'int',
726 'online': 'bool',
727 '*can-offline': 'bool'} }
728
729##
730# @guest-get-vcpus:
731#
732# Retrieve the list of the guest's logical processors.
733#
734# This is a read-only operation.
735#
736# Returns: The list of all VCPUs the guest knows about. Each VCPU is put on the
737# list exactly once, but their order is unspecified.
738#
739# Since: 1.5
740##
741{ 'command': 'guest-get-vcpus',
742 'returns': ['GuestLogicalProcessor'] }
743
744##
745# @guest-set-vcpus:
746#
747# Attempt to reconfigure (currently: enable/disable) logical processors inside
748# the guest.
749#
750# The input list is processed node by node in order. In each node @logical-id
751# is used to look up the guest VCPU, for which @online specifies the requested
752# state. The set of distinct @logical-id's is only required to be a subset of
753# the guest-supported identifiers. There's no restriction on list length or on
754# repeating the same @logical-id (with possibly different @online field).
755# Preferably the input list should describe a modified subset of
756# @guest-get-vcpus' return value.
757#
758# Returns: The length of the initial sublist that has been successfully
759# processed. The guest agent maximizes this value. Possible cases:
760#
Marc-André Lureauae4dbed2017-01-13 15:41:20 +0100761# - 0: if the @vcpus list was empty on input. Guest state
Laszlo Ersek70e133a2013-03-06 22:59:29 +0100762# has not been changed. Otherwise,
Marc-André Lureauae4dbed2017-01-13 15:41:20 +0100763# - Error: processing the first node of @vcpus failed for the
Laszlo Ersek70e133a2013-03-06 22:59:29 +0100764# reason returned. Guest state has not been changed.
765# Otherwise,
Marc-André Lureauae4dbed2017-01-13 15:41:20 +0100766# - < length(@vcpus): more than zero initial nodes have been processed,
Laszlo Ersek70e133a2013-03-06 22:59:29 +0100767# but not the entire @vcpus list. Guest state has
768# changed accordingly. To retrieve the error
769# (assuming it persists), repeat the call with the
770# successfully processed initial sublist removed.
771# Otherwise,
Marc-André Lureauae4dbed2017-01-13 15:41:20 +0100772# - length(@vcpus): call successful.
Laszlo Ersek70e133a2013-03-06 22:59:29 +0100773#
774# Since: 1.5
775##
776{ 'command': 'guest-set-vcpus',
777 'data': {'vcpus': ['GuestLogicalProcessor'] },
778 'returns': 'int' }
Tomoki Sekiyama46d4c572014-06-30 17:51:34 -0400779
780##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400781# @GuestDiskBusType:
Tomoki Sekiyama46d4c572014-06-30 17:51:34 -0400782#
783# An enumeration of bus type of disks
784#
785# @ide: IDE disks
786# @fdc: floppy disks
787# @scsi: SCSI disks
788# @virtio: virtio disks
789# @xen: Xen disks
790# @usb: USB disks
791# @uml: UML disks
792# @sata: SATA disks
793# @sd: SD cards
Olga Krishtala3ef3b22015-06-30 13:25:22 +0300794# @unknown: Unknown bus type
795# @ieee1394: Win IEEE 1394 bus type
796# @ssa: Win SSA bus type
797# @fibre: Win fiber channel bus type
798# @raid: Win RAID bus type
799# @iscsi: Win iScsi bus type
800# @sas: Win serial-attaches SCSI bus type
801# @mmc: Win multimedia card (MMC) bus type
802# @virtual: Win virtual bus type
803# @file-backed virtual: Win file-backed bus type
Tomoki Sekiyama46d4c572014-06-30 17:51:34 -0400804#
Olga Krishtal5f8343d2015-07-21 15:25:08 +0300805# Since: 2.2; 'Unknown' and all entries below since 2.4
Tomoki Sekiyama46d4c572014-06-30 17:51:34 -0400806##
807{ 'enum': 'GuestDiskBusType',
808 'data': [ 'ide', 'fdc', 'scsi', 'virtio', 'xen', 'usb', 'uml', 'sata',
Olga Krishtala3ef3b22015-06-30 13:25:22 +0300809 'sd', 'unknown', 'ieee1394', 'ssa', 'fibre', 'raid', 'iscsi',
810 'sas', 'mmc', 'virtual', 'file-backed-virtual' ] }
811
Tomoki Sekiyama46d4c572014-06-30 17:51:34 -0400812
813##
814# @GuestPCIAddress:
815#
816# @domain: domain id
817# @bus: bus id
818# @slot: slot id
819# @function: function id
820#
821# Since: 2.2
822##
Eric Blake895a2a82015-05-04 09:05:27 -0600823{ 'struct': 'GuestPCIAddress',
Tomoki Sekiyama46d4c572014-06-30 17:51:34 -0400824 'data': {'domain': 'int', 'bus': 'int',
825 'slot': 'int', 'function': 'int'} }
826
827##
828# @GuestDiskAddress:
829#
830# @pci-controller: controller's PCI address
Marc-André Lureau4d5c8bc2016-11-17 19:54:53 +0400831# @bus-type: bus type
Tomoki Sekiyama46d4c572014-06-30 17:51:34 -0400832# @bus: bus id
833# @target: target id
834# @unit: unit id
835#
836# Since: 2.2
837##
Eric Blake895a2a82015-05-04 09:05:27 -0600838{ 'struct': 'GuestDiskAddress',
Tomoki Sekiyama46d4c572014-06-30 17:51:34 -0400839 'data': {'pci-controller': 'GuestPCIAddress',
840 'bus-type': 'GuestDiskBusType',
841 'bus': 'int', 'target': 'int', 'unit': 'int'} }
842
843##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400844# @GuestFilesystemInfo:
Tomoki Sekiyama46d4c572014-06-30 17:51:34 -0400845#
846# @name: disk name
847# @mountpoint: mount point path
848# @type: file system type string
849# @disk: an array of disk hardware information that the volume lies on,
850# which may be empty if the disk type is not supported
851#
852# Since: 2.2
853##
Eric Blake895a2a82015-05-04 09:05:27 -0600854{ 'struct': 'GuestFilesystemInfo',
Tomoki Sekiyama46d4c572014-06-30 17:51:34 -0400855 'data': {'name': 'str', 'mountpoint': 'str', 'type': 'str',
856 'disk': ['GuestDiskAddress']} }
857
858##
859# @guest-get-fsinfo:
860#
861# Returns: The list of filesystems information mounted in the guest.
862# The returned mountpoints may be specified to
863# @guest-fsfreeze-freeze-list.
864# Network filesystems (such as CIFS and NFS) are not listed.
865#
866# Since: 2.2
867##
868{ 'command': 'guest-get-fsinfo',
869 'returns': ['GuestFilesystemInfo'] }
Daniel P. Berrange215a2772015-02-11 11:26:12 +0000870
871##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400872# @guest-set-user-password:
Daniel P. Berrange215a2772015-02-11 11:26:12 +0000873#
874# @username: the user account whose password to change
875# @password: the new password entry string, base64 encoded
876# @crypted: true if password is already crypt()d, false if raw
877#
878# If the @crypted flag is true, it is the caller's responsibility
879# to ensure the correct crypt() encryption scheme is used. This
880# command does not attempt to interpret or report on the encryption
881# scheme. Refer to the documentation of the guest operating system
882# in question to determine what is supported.
883#
Marc-André Lureau2e2a58e2015-08-27 01:34:47 +0200884# Not all guest operating systems will support use of the
Daniel P. Berrange215a2772015-02-11 11:26:12 +0000885# @crypted flag, as they may require the clear-text password
886#
887# The @password parameter must always be base64 encoded before
888# transmission, even if already crypt()d, to ensure it is 8-bit
889# safe when passed as JSON.
890#
891# Returns: Nothing on success.
892#
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400893# Since: 2.3
Daniel P. Berrange215a2772015-02-11 11:26:12 +0000894##
895{ 'command': 'guest-set-user-password',
896 'data': { 'username': 'str', 'password': 'str', 'crypted': 'bool' } }
zhanghailianga065aaa2015-01-22 10:40:02 +0800897
Marc-André Lureau49687ac2016-11-17 19:54:51 +0400898##
zhanghailianga065aaa2015-01-22 10:40:02 +0800899# @GuestMemoryBlock:
900#
901# @phys-index: Arbitrary guest-specific unique identifier of the MEMORY BLOCK.
902#
903# @online: Whether the MEMORY BLOCK is enabled in guest.
904#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100905# @can-offline: Whether offlining the MEMORY BLOCK is possible.
zhanghailianga065aaa2015-01-22 10:40:02 +0800906# This member is always filled in by the guest agent when the
907# structure is returned, and always ignored on input (hence it
908# can be omitted then).
909#
910# Since: 2.3
911##
Eric Blake895a2a82015-05-04 09:05:27 -0600912{ 'struct': 'GuestMemoryBlock',
zhanghailianga065aaa2015-01-22 10:40:02 +0800913 'data': {'phys-index': 'uint64',
914 'online': 'bool',
915 '*can-offline': 'bool'} }
916
917##
918# @guest-get-memory-blocks:
919#
920# Retrieve the list of the guest's memory blocks.
921#
922# This is a read-only operation.
923#
924# Returns: The list of all memory blocks the guest knows about.
925# Each memory block is put on the list exactly once, but their order
926# is unspecified.
927#
928# Since: 2.3
929##
930{ 'command': 'guest-get-memory-blocks',
931 'returns': ['GuestMemoryBlock'] }
932
933##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400934# @GuestMemoryBlockResponseType:
zhanghailianga065aaa2015-01-22 10:40:02 +0800935#
936# An enumeration of memory block operation result.
937#
Stefan Weil631b22e2015-04-09 20:32:39 +0200938# @success: the operation of online/offline memory block is successful.
zhanghailianga065aaa2015-01-22 10:40:02 +0800939# @not-found: can't find the corresponding memoryXXX directory in sysfs.
940# @operation-not-supported: for some old kernels, it does not support
941# online or offline memory block.
942# @operation-failed: the operation of online/offline memory block fails,
943# because of some errors happen.
944#
945# Since: 2.3
946##
947{ 'enum': 'GuestMemoryBlockResponseType',
948 'data': ['success', 'not-found', 'operation-not-supported',
949 'operation-failed'] }
950
951##
952# @GuestMemoryBlockResponse:
953#
954# @phys-index: same with the 'phys-index' member of @GuestMemoryBlock.
955#
956# @response: the result of memory block operation.
957#
Markus Armbruster1d8bda12017-03-15 13:57:06 +0100958# @error-code: the error number.
zhanghailianga065aaa2015-01-22 10:40:02 +0800959# When memory block operation fails, we assign the value of
960# 'errno' to this member, it indicates what goes wrong.
961# When the operation succeeds, it will be omitted.
962#
963# Since: 2.3
964##
Eric Blake895a2a82015-05-04 09:05:27 -0600965{ 'struct': 'GuestMemoryBlockResponse',
zhanghailianga065aaa2015-01-22 10:40:02 +0800966 'data': { 'phys-index': 'uint64',
967 'response': 'GuestMemoryBlockResponseType',
968 '*error-code': 'int' }}
969
970##
971# @guest-set-memory-blocks:
972#
973# Attempt to reconfigure (currently: enable/disable) state of memory blocks
974# inside the guest.
975#
976# The input list is processed node by node in order. In each node @phys-index
977# is used to look up the guest MEMORY BLOCK, for which @online specifies the
978# requested state. The set of distinct @phys-index's is only required to be a
979# subset of the guest-supported identifiers. There's no restriction on list
980# length or on repeating the same @phys-index (with possibly different @online
981# field).
982# Preferably the input list should describe a modified subset of
983# @guest-get-memory-blocks' return value.
984#
985# Returns: The operation results, it is a list of @GuestMemoryBlockResponse,
986# which is corresponding to the input list.
987#
988# Note: it will return NULL if the @mem-blks list was empty on input,
989# or there is an error, and in this case, guest state will not be
990# changed.
991#
992# Since: 2.3
993##
994{ 'command': 'guest-set-memory-blocks',
995 'data': {'mem-blks': ['GuestMemoryBlock'] },
996 'returns': ['GuestMemoryBlockResponse'] }
997
Marc-André Lureau49687ac2016-11-17 19:54:51 +0400998##
zhanghailianga065aaa2015-01-22 10:40:02 +0800999# @GuestMemoryBlockInfo:
1000#
1001# @size: the size (in bytes) of the guest memory blocks,
1002# which are the minimal units of memory block online/offline
1003# operations (also called Logical Memory Hotplug).
1004#
1005# Since: 2.3
1006##
Eric Blake895a2a82015-05-04 09:05:27 -06001007{ 'struct': 'GuestMemoryBlockInfo',
zhanghailianga065aaa2015-01-22 10:40:02 +08001008 'data': {'size': 'uint64'} }
1009
1010##
1011# @guest-get-memory-block-info:
1012#
1013# Get information relating to guest memory blocks.
1014#
zhanghailianga065aaa2015-01-22 10:40:02 +08001015# Returns: @GuestMemoryBlockInfo
1016#
Marc-André Lureau5072f7b2016-11-17 19:54:55 +04001017# Since: 2.3
zhanghailianga065aaa2015-01-22 10:40:02 +08001018##
1019{ 'command': 'guest-get-memory-block-info',
1020 'returns': 'GuestMemoryBlockInfo' }
Yuri Pudgorodskiyd697e302015-10-13 18:41:20 +03001021
Marc-André Lureau49687ac2016-11-17 19:54:51 +04001022##
Yuri Pudgorodskiyd697e302015-10-13 18:41:20 +03001023# @GuestExecStatus:
1024#
1025# @exited: true if process has already terminated.
Markus Armbruster1d8bda12017-03-15 13:57:06 +01001026# @exitcode: process exit code if it was normally terminated.
1027# @signal: signal number (linux) or unhandled exception code
Yuri Pudgorodskiyd697e302015-10-13 18:41:20 +03001028# (windows) if the process was abnormally terminated.
Markus Armbruster1d8bda12017-03-15 13:57:06 +01001029# @out-data: base64-encoded stdout of the process
1030# @err-data: base64-encoded stderr of the process
Yuri Pudgorodskiyd697e302015-10-13 18:41:20 +03001031# Note: @out-data and @err-data are present only
1032# if 'capture-output' was specified for 'guest-exec'
Markus Armbruster1d8bda12017-03-15 13:57:06 +01001033# @out-truncated: true if stdout was not fully captured
Yuri Pudgorodskiya1853dc2015-10-13 18:41:23 +03001034# due to size limitation.
Markus Armbruster1d8bda12017-03-15 13:57:06 +01001035# @err-truncated: true if stderr was not fully captured
Yuri Pudgorodskiya1853dc2015-10-13 18:41:23 +03001036# due to size limitation.
Yuri Pudgorodskiyd697e302015-10-13 18:41:20 +03001037#
1038# Since: 2.5
1039##
1040{ 'struct': 'GuestExecStatus',
1041 'data': { 'exited': 'bool', '*exitcode': 'int', '*signal': 'int',
Yuri Pudgorodskiya1853dc2015-10-13 18:41:23 +03001042 '*out-data': 'str', '*err-data': 'str',
1043 '*out-truncated': 'bool', '*err-truncated': 'bool' }}
Yuri Pudgorodskiyd697e302015-10-13 18:41:20 +03001044##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +04001045# @guest-exec-status:
Yuri Pudgorodskiyd697e302015-10-13 18:41:20 +03001046#
1047# Check status of process associated with PID retrieved via guest-exec.
1048# Reap the process and associated metadata if it has exited.
1049#
1050# @pid: pid returned from guest-exec
1051#
1052# Returns: GuestExecStatus on success.
1053#
Marc-André Lureau5072f7b2016-11-17 19:54:55 +04001054# Since: 2.5
Yuri Pudgorodskiyd697e302015-10-13 18:41:20 +03001055##
1056{ 'command': 'guest-exec-status',
1057 'data': { 'pid': 'int' },
1058 'returns': 'GuestExecStatus' }
1059
1060##
1061# @GuestExec:
1062# @pid: pid of child process in guest OS
1063#
Marc-André Lureau5072f7b2016-11-17 19:54:55 +04001064# Since: 2.5
Yuri Pudgorodskiyd697e302015-10-13 18:41:20 +03001065##
1066{ 'struct': 'GuestExec',
1067 'data': { 'pid': 'int'} }
1068
1069##
1070# @guest-exec:
1071#
1072# Execute a command in the guest
1073#
1074# @path: path or executable name to execute
Markus Armbruster1d8bda12017-03-15 13:57:06 +01001075# @arg: argument list to pass to executable
1076# @env: environment variables to pass to executable
1077# @input-data: data to be passed to process stdin (base64 encoded)
1078# @capture-output: bool flag to enable capture of
Yuri Pudgorodskiyd697e302015-10-13 18:41:20 +03001079# stdout/stderr of running process. defaults to false.
1080#
1081# Returns: PID on success.
1082#
1083# Since: 2.5
1084##
1085{ 'command': 'guest-exec',
1086 'data': { 'path': 'str', '*arg': ['str'], '*env': ['str'],
1087 '*input-data': 'str', '*capture-output': 'bool' },
1088 'returns': 'GuestExec' }
Vinzenz Feenstra0a3d1972017-04-04 08:46:31 +02001089
1090
1091##
1092# @GuestHostName:
1093# @host-name: Fully qualified domain name of the guest OS
1094#
1095# Since: 2.10
1096##
1097{ 'struct': 'GuestHostName',
1098 'data': { 'host-name': 'str' } }
1099
1100##
1101# @guest-get-host-name:
1102#
1103# Return a name for the machine.
1104#
1105# The returned name is not necessarily a fully-qualified domain name, or even
1106# present in DNS or some other name service at all. It need not even be unique
1107# on your local network or site, but usually it is.
1108#
1109# Returns: the host name of the machine on success
1110#
1111# Since: 2.10
1112##
1113{ 'command': 'guest-get-host-name',
1114 'returns': 'GuestHostName' }
Vinzenz Feenstra161a56a2017-04-19 11:26:15 +02001115
1116
1117##
1118# @GuestUser:
1119# @user: Username
1120# @domain: Logon domain (windows only)
1121# @login-time: Time of login of this user on the computer. If multiple
1122# instances of the user are logged in, the earliest login time is
1123# reported. The value is in fractional seconds since epoch time.
1124#
1125# Since: 2.10
1126##
1127{ 'struct': 'GuestUser',
1128 'data': { 'user': 'str', 'login-time': 'number', '*domain': 'str' } }
1129
1130##
1131# @guest-get-users:
1132# Retrieves a list of currently active users on the VM.
1133#
1134# Returns: A unique list of users.
1135#
1136# Since: 2.10
1137##
1138{ 'command': 'guest-get-users',
1139 'returns': ['GuestUser'] }
Vinzenz Feenstra53c58e62017-04-19 12:52:58 +02001140
1141##
1142# @GuestTimezone:
1143#
1144# @zone: Timezone name. These values may differ depending on guest/OS and
1145# should only be used for informational purposes.
1146# @offset: Offset to UTC in seconds, negative numbers for time zones west of
1147# GMT, positive numbers for east
1148#
1149# Since: 2.10
1150##
1151{ 'struct': 'GuestTimezone',
1152 'data': { '*zone': 'str', 'offset': 'int' } }
1153
1154##
1155# @guest-get-timezone:
1156#
1157# Retrieves the timezone information from the guest.
1158#
1159# Returns: A GuestTimezone dictionary.
1160#
1161# Since: 2.10
1162##
1163{ 'command': 'guest-get-timezone',
1164 'returns': 'GuestTimezone' }
Tomáš Golembiovský9848f792017-07-14 16:28:56 +02001165
1166##
1167# @GuestOSInfo:
1168#
1169# @kernel-release:
1170# * POSIX: release field returned by uname(2)
1171# * Windows: version number of the OS
1172# @kernel-version:
1173# * POSIX: version field returned by uname(2)
1174# * Windows: build number of the OS
1175# @machine:
1176# * POSIX: machine field returned by uname(2)
1177# * Windows: one of x86, x86_64, arm, ia64
1178# @id:
1179# * POSIX: as defined by os-release(5)
1180# * Windows: contains string "mswindows"
1181# @name:
1182# * POSIX: as defined by os-release(5)
1183# * Windows: contains string "Microsoft Windows"
1184# @pretty-name:
1185# * POSIX: as defined by os-release(5)
1186# * Windows: product name, e.g. "Microsoft Windows 10 Enterprise"
1187# @version:
1188# * POSIX: as defined by os-release(5)
1189# * Windows: long version string, e.g. "Microsoft Windows Server 2008"
1190# @version-id:
1191# * POSIX: as defined by os-release(5)
1192# * Windows: short version identifier, e.g. "7" or "20012r2"
1193# @variant:
1194# * POSIX: as defined by os-release(5)
1195# * Windows: contains string "server" or "client"
1196# @variant-id:
1197# * POSIX: as defined by os-release(5)
1198# * Windows: contains string "server" or "client"
1199#
1200# Notes:
1201#
1202# On POSIX systems the fields @id, @name, @pretty-name, @version, @version-id,
1203# @variant and @variant-id follow the definition specified in os-release(5).
1204# Refer to the manual page for exact description of the fields. Their values
1205# are taken from the os-release file. If the file is not present in the system,
1206# or the values are not present in the file, the fields are not included.
1207#
1208# On Windows the values are filled from information gathered from the system.
1209#
1210# Since: 2.10
1211##
1212{ 'struct': 'GuestOSInfo',
1213 'data': {
1214 '*kernel-release': 'str', '*kernel-version': 'str',
1215 '*machine': 'str', '*id': 'str', '*name': 'str',
1216 '*pretty-name': 'str', '*version': 'str', '*version-id': 'str',
1217 '*variant': 'str', '*variant-id': 'str' } }
1218
1219##
1220# @guest-get-osinfo:
1221#
1222# Retrieve guest operating system information
1223#
1224# Returns: @GuestOSInfo
1225#
1226# Since: 2.10
1227##
1228{ 'command': 'guest-get-osinfo',
1229 'returns': 'GuestOSInfo' }