]> git.proxmox.com Git - mirror_qemu.git/blame - qga/qapi-schema.json
Merge remote-tracking branch 'remotes/kraxel/tags/seabios-1.12.1-20190318-pull-reques...
[mirror_qemu.git] / qga / qapi-schema.json
CommitLineData
e3d4d252
MR
1# *-*- Mode: Python -*-*
2
9481ecd7
LE
3##
4#
5# 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
bc52d03f
MA
14{ 'pragma': { 'doc-required': true } }
15
1554a8fa
MA
16# 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
3cf0bed8 31##
71e0e067 32# @guest-sync-delimited:
3cf0bed8
MR
33#
34# 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
a31f0531 50# sentinel value is receiving to avoid unnecessary processing of
3cf0bed8
MR
51# 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
71e0e067 62##
01b87f6d 63{ 'command': 'guest-sync-delimited',
3cf0bed8
MR
64 'data': { 'id': 'int' },
65 'returns': 'int' }
66
e3d4d252
MR
67##
68# @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#
3cf0bed8
MR
80# 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#
e7d81004 91# Such clients should also precede this command
3cf0bed8 92# with a 0xFF byte to make sure the guest agent flushes any
e3d4d252
MR
93# 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##
01b87f6d 101{ 'command': 'guest-sync',
e3d4d252
MR
102 '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
6912e6a9
LL
114##
115# @guest-get-time:
116#
1634df56
AK
117# Get the information about guest's System Time relative to
118# the Epoch of 1970-01-01 in UTC.
6912e6a9
LL
119#
120# Returns: Time in nanoseconds.
121#
5072f7b3 122# Since: 1.5
6912e6a9
LL
123##
124{ 'command': 'guest-get-time',
125 'returns': 'int' }
126
a1bca57f
LL
127##
128# @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#
1634df56
AK
138# 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
ee17cbdc
MP
142# 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.
a1bca57f 146#
1d8bda12 147# @time: time of nanoseconds, relative to the Epoch
2c958923 148# of 1970-01-01 in UTC.
a1bca57f
LL
149#
150# Returns: Nothing on success.
151#
152# Since: 1.5
153##
154{ 'command': 'guest-set-time',
2c958923 155 'data': { '*time': 'int' } }
a1bca57f 156
e3d4d252 157##
54383726 158# @GuestAgentCommandInfo:
e3d4d252 159#
54383726 160# Information about guest agent commands.
e3d4d252 161#
54383726
MR
162# @name: name of the command
163#
164# @enabled: whether command is currently enabled by guest admin
165#
0106dc4f
MW
166# @success-response: whether command returns a response on success
167# (since 1.7)
168#
5072f7b3 169# Since: 1.1.0
e3d4d252 170##
895a2a80 171{ 'struct': 'GuestAgentCommandInfo',
0106dc4f 172 'data': { 'name': 'str', 'enabled': 'bool', 'success-response': 'bool' } }
54383726
MR
173
174##
5072f7b3 175# @GuestAgentInfo:
54383726
MR
176#
177# Information about guest agent.
178#
179# @version: guest agent version
180#
181# @supported_commands: Information about guest agent commands
182#
5072f7b3 183# Since: 0.15.0
54383726 184##
895a2a80 185{ 'struct': 'GuestAgentInfo',
bf95c0d5
MR
186 'data': { 'version': 'str',
187 'supported_commands': ['GuestAgentCommandInfo'] } }
54383726
MR
188##
189# @guest-info:
190#
191# Get some information about the guest agent.
192#
193# Returns: @GuestAgentInfo
194#
195# Since: 0.15.0
196##
e3d4d252
MR
197{ 'command': 'guest-info',
198 'returns': 'GuestAgentInfo' }
199
200##
201# @guest-shutdown:
202#
203# Initiate guest-activated shutdown. Note: this is an asynchronous
3674838c 204# shutdown request, with no guarantee of successful shutdown.
e3d4d252 205#
1d8bda12 206# @mode: "halt", "powerdown" (default), or "reboot"
e3d4d252 207#
89268172
LC
208# 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".
e3d4d252
MR
212#
213# Since: 0.15.0
214##
89268172 215{ 'command': 'guest-shutdown', 'data': { '*mode': 'str' },
d708cdbe 216 'success-response': false }
e3d4d252
MR
217
218##
219# @guest-file-open:
220#
221# Open a file in the guest and retrieve a file handle for it
222#
4d5c8bc4 223# @path: Full path to the file in the guest to open.
e3d4d252 224#
1d8bda12 225# @mode: open mode, as per fopen(), "r" is the default.
e3d4d252
MR
226#
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
54383726 249##
5072f7b3 250# @GuestFileRead:
54383726
MR
251#
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##
895a2a80 263{ 'struct': 'GuestFileRead',
54383726
MR
264 'data': { 'count': 'int', 'buf-b64': 'str', 'eof': 'bool' } }
265
e3d4d252
MR
266##
267# @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#
1d8bda12 273# @count: maximum number of bytes to read (default is 4KB)
e3d4d252 274#
54383726 275# Returns: @GuestFileRead on success.
e3d4d252
MR
276#
277# Since: 0.15.0
278##
e3d4d252
MR
279{ 'command': 'guest-file-read',
280 'data': { 'handle': 'int', '*count': 'int' },
281 'returns': 'GuestFileRead' }
282
54383726 283##
5072f7b3 284# @GuestFileWrite:
54383726
MR
285#
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##
895a2a80 295{ 'struct': 'GuestFileWrite',
54383726
MR
296 'data': { 'count': 'int', 'eof': 'bool' } }
297
e3d4d252
MR
298##
299# @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#
1d8bda12 307# @count: bytes to write (actual bytes, after base64-decode),
e3d4d252
MR
308# default is all content in buf-b64 buffer after base64 decoding
309#
54383726 310# Returns: @GuestFileWrite on success.
e3d4d252
MR
311#
312# Since: 0.15.0
313##
e3d4d252
MR
314{ 'command': 'guest-file-write',
315 'data': { 'handle': 'int', 'buf-b64': 'str', '*count': 'int' },
316 'returns': 'GuestFileWrite' }
317
54383726
MR
318
319##
5072f7b3 320# @GuestFileSeek:
54383726
MR
321#
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##
895a2a80 330{ 'struct': 'GuestFileSeek',
54383726
MR
331 'data': { 'position': 'int', 'eof': 'bool' } }
332
0b4b4938
EB
333##
334# @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
e3d4d252
MR
361##
362# @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
0a982b1b 366# functionality, with offset=0 and whence=1.
e3d4d252
MR
367#
368# @handle: filehandle returned by guest-file-open
369#
370# @offset: bytes to skip over in the file stream
371#
0b4b4938 372# @whence: Symbolic or numeric code for interpreting offset
e3d4d252 373#
54383726 374# Returns: @GuestFileSeek on success.
e3d4d252
MR
375#
376# Since: 0.15.0
377##
e3d4d252 378{ 'command': 'guest-file-seek',
0b4b4938
EB
379 'data': { 'handle': 'int', 'offset': 'int',
380 'whence': 'GuestFileWhence' },
e3d4d252
MR
381 '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##
5072f7b3 398# @GuestFsfreezeStatus:
e3d4d252 399#
6932a69b 400# An enumeration of filesystem freeze states
e3d4d252 401#
54383726
MR
402# @thawed: filesystems thawed/unfrozen
403#
404# @frozen: all non-network guest filesystems frozen
405#
e3d4d252
MR
406# Since: 0.15.0
407##
408{ 'enum': 'GuestFsfreezeStatus',
9e8aded4 409 'data': [ 'thawed', 'frozen' ] }
54383726
MR
410
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#
9e8aded4 418# Note: This may fail to properly report the current state as a result of
f789aa7b 419# some other guest processes having issued an fs freeze/thaw.
9e8aded4 420#
54383726
MR
421# Since: 0.15.0
422##
e3d4d252
MR
423{ 'command': 'guest-fsfreeze-status',
424 'returns': 'GuestFsfreezeStatus' }
425
426##
427# @guest-fsfreeze-freeze:
428#
1dbfbc17
MAL
429# 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.
e3d4d252 436#
9e8aded4 437# Returns: Number of file systems currently frozen. On error, all filesystems
65650f01
CH
438# will be thawed. If no filesystems are frozen as a result of this call,
439# then @guest-fsfreeze-status will remain "thawed" and calling
440# @guest-fsfreeze-thaw is not necessary.
e3d4d252
MR
441#
442# Since: 0.15.0
443##
444{ 'command': 'guest-fsfreeze-freeze',
445 'returns': 'int' }
446
e99bce20
TS
447##
448# @guest-fsfreeze-freeze-list:
449#
1dbfbc17
MAL
450# Sync and freeze specified guest filesystems.
451# See also @guest-fsfreeze-freeze.
e99bce20 452#
1d8bda12 453# @mountpoints: an array of mountpoints of filesystems to be frozen.
e99bce20 454# If omitted, every mounted filesystem is frozen.
1dbfbc17 455# Invalid mount points are ignored.
e99bce20
TS
456#
457# Returns: Number of file systems currently frozen. On error, all filesystems
458# will be thawed.
459#
460# Since: 2.2
461##
462{ 'command': 'guest-fsfreeze-freeze-list',
463 'data': { '*mountpoints': ['str'] },
464 'returns': 'int' }
465
e3d4d252
MR
466##
467# @guest-fsfreeze-thaw:
468#
9e8aded4
MR
469# Unfreeze all frozen guest filesystems
470#
471# Returns: Number of file systems thawed by this call
e3d4d252 472#
9e8aded4
MR
473# Note: if return value does not match the previous call to
474# guest-fsfreeze-freeze, this likely means some freezable
475# filesystems were unfrozen before this call, and that the
476# filesystem state may have changed before issuing this
477# command.
e3d4d252
MR
478#
479# Since: 0.15.0
480##
481{ 'command': 'guest-fsfreeze-thaw',
482 'returns': 'int' }
11d0f125 483
e82855d9 484##
5072f7b3 485# @GuestFilesystemTrimResult:
e82855d9
JO
486#
487# @path: path that was trimmed
488# @error: an error message when trim failed
489# @trimmed: bytes trimmed for this path
490# @minimum: reported effective minimum for this path
491#
492# Since: 2.4
493##
494{ 'struct': 'GuestFilesystemTrimResult',
495 'data': {'path': 'str',
496 '*trimmed': 'int', '*minimum': 'int', '*error': 'str'} }
497
498##
5072f7b3 499# @GuestFilesystemTrimResponse:
e82855d9
JO
500#
501# @paths: list of @GuestFilesystemTrimResult per path that was trimmed
502#
503# Since: 2.4
504##
505{ 'struct': 'GuestFilesystemTrimResponse',
506 'data': {'paths': ['GuestFilesystemTrimResult']} }
507
eab5fd59
PB
508##
509# @guest-fstrim:
510#
511# Discard (or "trim") blocks which are not in use by the filesystem.
512#
513# @minimum:
514# Minimum contiguous free range to discard, in bytes. Free ranges
515# smaller than this may be ignored (this is a hint and the guest
516# may not respect it). By increasing this value, the fstrim
517# operation will complete more quickly for filesystems with badly
518# fragmented free space, although not all blocks will be discarded.
519# The default value is zero, meaning "discard every free block".
520#
e82855d9
JO
521# Returns: A @GuestFilesystemTrimResponse which contains the
522# status of all trimmed paths. (since 2.4)
eab5fd59
PB
523#
524# Since: 1.2
525##
526{ 'command': 'guest-fstrim',
e82855d9
JO
527 'data': { '*minimum': 'int' },
528 'returns': 'GuestFilesystemTrimResponse' }
eab5fd59 529
11d0f125 530##
5072f7b3 531# @guest-suspend-disk:
11d0f125
LC
532#
533# Suspend guest to disk.
534#
535# This command tries to execute the scripts provided by the pm-utils package.
536# If it's not available, the suspend operation will be performed by manually
537# writing to a sysfs file.
538#
539# For the best results it's strongly recommended to have the pm-utils
540# package installed in the guest.
541#
c6fcc10a
LC
542# This command does NOT return a response on success. There is a high chance
543# the command succeeded if the VM exits with a zero exit status or, when
544# running with --no-shutdown, by issuing the query-status QMP command to
545# to confirm the VM status is "shutdown". However, the VM could also exit
546# (or set its status to "shutdown") due to other reasons.
547#
548# The following errors may be returned:
11d0f125
LC
549# If suspend to disk is not supported, Unsupported
550#
c6fcc10a
LC
551# Notes: It's strongly recommended to issue the guest-sync command before
552# sending commands when the guest resumes
11d0f125
LC
553#
554# Since: 1.1
555##
d708cdbe 556{ 'command': 'guest-suspend-disk', 'success-response': false }
fbf42210
LC
557
558##
5072f7b3 559# @guest-suspend-ram:
fbf42210
LC
560#
561# Suspend guest to ram.
562#
563# This command tries to execute the scripts provided by the pm-utils package.
564# If it's not available, the suspend operation will be performed by manually
565# writing to a sysfs file.
566#
567# For the best results it's strongly recommended to have the pm-utils
568# package installed in the guest.
569#
f8a57777
DHB
570# IMPORTANT: guest-suspend-ram requires working wakeup support in
571# QEMU. You should check QMP command query-current-machine returns
572# wakeup-suspend-support: true before issuing this command. Failure in
573# doing so can result in a suspended guest that QEMU will not be able to
574# awaken, forcing the user to power cycle the guest to bring it back.
fbf42210 575#
432d29db
LC
576# This command does NOT return a response on success. There are two options
577# to check for success:
578# 1. Wait for the SUSPEND QMP event from QEMU
579# 2. Issue the query-status QMP command to confirm the VM status is
580# "suspended"
581#
582# The following errors may be returned:
fbf42210
LC
583# If suspend to ram is not supported, Unsupported
584#
432d29db
LC
585# Notes: It's strongly recommended to issue the guest-sync command before
586# sending commands when the guest resumes
fbf42210
LC
587#
588# Since: 1.1
589##
d708cdbe 590{ 'command': 'guest-suspend-ram', 'success-response': false }
95f4f404
LC
591
592##
5072f7b3 593# @guest-suspend-hybrid:
95f4f404
LC
594#
595# Save guest state to disk and suspend to ram.
596#
597# This command requires the pm-utils package to be installed in the guest.
598#
f8a57777
DHB
599# IMPORTANT: guest-suspend-hybrid requires working wakeup support in
600# QEMU. You should check QMP command query-current-machine returns
601# wakeup-suspend-support: true before issuing this command. Failure in
602# doing so can result in a suspended guest that QEMU will not be able to
603# awaken, forcing the user to power cycle the guest to bring it back.
95f4f404 604#
d9fcd2a1
LC
605# This command does NOT return a response on success. There are two options
606# to check for success:
607# 1. Wait for the SUSPEND QMP event from QEMU
608# 2. Issue the query-status QMP command to confirm the VM status is
609# "suspended"
610#
611# The following errors may be returned:
95f4f404
LC
612# If hybrid suspend is not supported, Unsupported
613#
d9fcd2a1
LC
614# Notes: It's strongly recommended to issue the guest-sync command before
615# sending commands when the guest resumes
95f4f404
LC
616#
617# Since: 1.1
618##
d708cdbe 619{ 'command': 'guest-suspend-hybrid', 'success-response': false }
3424fc9f
MP
620
621##
622# @GuestIpAddressType:
623#
624# An enumeration of supported IP address types
625#
626# @ipv4: IP version 4
627#
628# @ipv6: IP version 6
629#
630# Since: 1.1
631##
632{ 'enum': 'GuestIpAddressType',
633 'data': [ 'ipv4', 'ipv6' ] }
634
635##
636# @GuestIpAddress:
637#
638# @ip-address: IP address
639#
640# @ip-address-type: Type of @ip-address (e.g. ipv4, ipv6)
641#
642# @prefix: Network prefix length of @ip-address
643#
644# Since: 1.1
645##
895a2a80 646{ 'struct': 'GuestIpAddress',
3424fc9f
MP
647 'data': {'ip-address': 'str',
648 'ip-address-type': 'GuestIpAddressType',
649 'prefix': 'int'} }
650
53f9fcb2
ZL
651##
652# @GuestNetworkInterfaceStat:
653#
654# @rx-bytes: total bytes received
655#
656# @rx-packets: total packets received
657#
658# @rx-errs: bad packets received
659#
660# @rx-dropped: receiver dropped packets
661#
662# @tx-bytes: total bytes transmitted
663#
664# @tx-packets: total packets transmitted
665#
666# @tx-errs: packet transmit problems
667#
668# @tx-dropped: dropped packets transmitted
669#
670# Since: 2.11
671##
672{ 'struct': 'GuestNetworkInterfaceStat',
673 'data': {'rx-bytes': 'uint64',
674 'rx-packets': 'uint64',
675 'rx-errs': 'uint64',
676 'rx-dropped': 'uint64',
677 'tx-bytes': 'uint64',
678 'tx-packets': 'uint64',
679 'tx-errs': 'uint64',
680 'tx-dropped': 'uint64'
681 } }
682
3424fc9f
MP
683##
684# @GuestNetworkInterface:
685#
686# @name: The name of interface for which info are being delivered
687#
688# @hardware-address: Hardware address of @name
689#
690# @ip-addresses: List of addresses assigned to @name
691#
53f9fcb2
ZL
692# @statistics: various statistic counters related to @name
693# (since 2.11)
694#
3424fc9f
MP
695# Since: 1.1
696##
895a2a80 697{ 'struct': 'GuestNetworkInterface',
3424fc9f
MP
698 'data': {'name': 'str',
699 '*hardware-address': 'str',
53f9fcb2
ZL
700 '*ip-addresses': ['GuestIpAddress'],
701 '*statistics': 'GuestNetworkInterfaceStat' } }
3424fc9f
MP
702
703##
704# @guest-network-get-interfaces:
705#
706# Get list of guest IP addresses, MAC addresses
707# and netmasks.
708#
709# Returns: List of GuestNetworkInfo on success.
710#
711# Since: 1.1
712##
713{ 'command': 'guest-network-get-interfaces',
714 'returns': ['GuestNetworkInterface'] }
70e133a7
LE
715
716##
717# @GuestLogicalProcessor:
718#
719# @logical-id: Arbitrary guest-specific unique identifier of the VCPU.
720#
721# @online: Whether the VCPU is enabled.
722#
1d8bda12 723# @can-offline: Whether offlining the VCPU is possible. This member
c964c9e0
LE
724# is always filled in by the guest agent when the structure is
725# returned, and always ignored on input (hence it can be omitted
726# then).
70e133a7
LE
727#
728# Since: 1.5
729##
895a2a80 730{ 'struct': 'GuestLogicalProcessor',
70e133a7
LE
731 'data': {'logical-id': 'int',
732 'online': 'bool',
733 '*can-offline': 'bool'} }
734
735##
736# @guest-get-vcpus:
737#
738# Retrieve the list of the guest's logical processors.
739#
740# This is a read-only operation.
741#
742# Returns: The list of all VCPUs the guest knows about. Each VCPU is put on the
743# list exactly once, but their order is unspecified.
744#
745# Since: 1.5
746##
747{ 'command': 'guest-get-vcpus',
748 'returns': ['GuestLogicalProcessor'] }
749
750##
751# @guest-set-vcpus:
752#
753# Attempt to reconfigure (currently: enable/disable) logical processors inside
754# the guest.
755#
756# The input list is processed node by node in order. In each node @logical-id
757# is used to look up the guest VCPU, for which @online specifies the requested
758# state. The set of distinct @logical-id's is only required to be a subset of
759# the guest-supported identifiers. There's no restriction on list length or on
760# repeating the same @logical-id (with possibly different @online field).
761# Preferably the input list should describe a modified subset of
762# @guest-get-vcpus' return value.
763#
764# Returns: The length of the initial sublist that has been successfully
765# processed. The guest agent maximizes this value. Possible cases:
766#
ae4dbed0 767# - 0: if the @vcpus list was empty on input. Guest state
70e133a7 768# has not been changed. Otherwise,
ae4dbed0 769# - Error: processing the first node of @vcpus failed for the
70e133a7
LE
770# reason returned. Guest state has not been changed.
771# Otherwise,
ae4dbed0 772# - < length(@vcpus): more than zero initial nodes have been processed,
70e133a7
LE
773# but not the entire @vcpus list. Guest state has
774# changed accordingly. To retrieve the error
775# (assuming it persists), repeat the call with the
776# successfully processed initial sublist removed.
777# Otherwise,
ae4dbed0 778# - length(@vcpus): call successful.
70e133a7
LE
779#
780# Since: 1.5
781##
782{ 'command': 'guest-set-vcpus',
783 'data': {'vcpus': ['GuestLogicalProcessor'] },
784 'returns': 'int' }
46d4c572
TS
785
786##
5072f7b3 787# @GuestDiskBusType:
46d4c572
TS
788#
789# An enumeration of bus type of disks
790#
791# @ide: IDE disks
792# @fdc: floppy disks
793# @scsi: SCSI disks
794# @virtio: virtio disks
795# @xen: Xen disks
796# @usb: USB disks
797# @uml: UML disks
798# @sata: SATA disks
799# @sd: SD cards
a3ef3b22
OK
800# @unknown: Unknown bus type
801# @ieee1394: Win IEEE 1394 bus type
802# @ssa: Win SSA bus type
803# @fibre: Win fiber channel bus type
804# @raid: Win RAID bus type
805# @iscsi: Win iScsi bus type
806# @sas: Win serial-attaches SCSI bus type
807# @mmc: Win multimedia card (MMC) bus type
808# @virtual: Win virtual bus type
809# @file-backed virtual: Win file-backed bus type
46d4c572 810#
5f8343d0 811# Since: 2.2; 'Unknown' and all entries below since 2.4
46d4c572
TS
812##
813{ 'enum': 'GuestDiskBusType',
814 'data': [ 'ide', 'fdc', 'scsi', 'virtio', 'xen', 'usb', 'uml', 'sata',
a3ef3b22
OK
815 'sd', 'unknown', 'ieee1394', 'ssa', 'fibre', 'raid', 'iscsi',
816 'sas', 'mmc', 'virtual', 'file-backed-virtual' ] }
817
46d4c572
TS
818
819##
820# @GuestPCIAddress:
821#
822# @domain: domain id
823# @bus: bus id
824# @slot: slot id
825# @function: function id
826#
827# Since: 2.2
828##
895a2a80 829{ 'struct': 'GuestPCIAddress',
46d4c572
TS
830 'data': {'domain': 'int', 'bus': 'int',
831 'slot': 'int', 'function': 'int'} }
832
833##
834# @GuestDiskAddress:
835#
836# @pci-controller: controller's PCI address
4d5c8bc4 837# @bus-type: bus type
46d4c572
TS
838# @bus: bus id
839# @target: target id
840# @unit: unit id
b616105a 841# @serial: serial number (since: 3.1)
6589ce35 842# @dev: device node (POSIX) or device UNC (Windows) (since: 3.1)
46d4c572
TS
843#
844# Since: 2.2
845##
895a2a80 846{ 'struct': 'GuestDiskAddress',
46d4c572
TS
847 'data': {'pci-controller': 'GuestPCIAddress',
848 'bus-type': 'GuestDiskBusType',
b616105a 849 'bus': 'int', 'target': 'int', 'unit': 'int',
6589ce35 850 '*serial': 'str', '*dev': 'str'} }
46d4c572
TS
851
852##
5072f7b3 853# @GuestFilesystemInfo:
46d4c572
TS
854#
855# @name: disk name
856# @mountpoint: mount point path
857# @type: file system type string
25b5ff1a
CH
858# @used-bytes: file system used bytes (since 3.0)
859# @total-bytes: non-root file system total bytes (since 3.0)
46d4c572
TS
860# @disk: an array of disk hardware information that the volume lies on,
861# which may be empty if the disk type is not supported
862#
863# Since: 2.2
864##
895a2a80 865{ 'struct': 'GuestFilesystemInfo',
46d4c572 866 'data': {'name': 'str', 'mountpoint': 'str', 'type': 'str',
25b5ff1a 867 '*used-bytes': 'uint64', '*total-bytes': 'uint64',
46d4c572
TS
868 'disk': ['GuestDiskAddress']} }
869
870##
871# @guest-get-fsinfo:
872#
873# Returns: The list of filesystems information mounted in the guest.
874# The returned mountpoints may be specified to
875# @guest-fsfreeze-freeze-list.
876# Network filesystems (such as CIFS and NFS) are not listed.
877#
878# Since: 2.2
879##
880{ 'command': 'guest-get-fsinfo',
881 'returns': ['GuestFilesystemInfo'] }
215a2771
DB
882
883##
5072f7b3 884# @guest-set-user-password:
215a2771
DB
885#
886# @username: the user account whose password to change
887# @password: the new password entry string, base64 encoded
888# @crypted: true if password is already crypt()d, false if raw
889#
890# If the @crypted flag is true, it is the caller's responsibility
891# to ensure the correct crypt() encryption scheme is used. This
892# command does not attempt to interpret or report on the encryption
893# scheme. Refer to the documentation of the guest operating system
894# in question to determine what is supported.
895#
2e2a58e0 896# Not all guest operating systems will support use of the
215a2771
DB
897# @crypted flag, as they may require the clear-text password
898#
899# The @password parameter must always be base64 encoded before
900# transmission, even if already crypt()d, to ensure it is 8-bit
901# safe when passed as JSON.
902#
903# Returns: Nothing on success.
904#
5072f7b3 905# Since: 2.3
215a2771
DB
906##
907{ 'command': 'guest-set-user-password',
908 'data': { 'username': 'str', 'password': 'str', 'crypted': 'bool' } }
a065aaa9 909
49687ace 910##
a065aaa9
HZ
911# @GuestMemoryBlock:
912#
913# @phys-index: Arbitrary guest-specific unique identifier of the MEMORY BLOCK.
914#
915# @online: Whether the MEMORY BLOCK is enabled in guest.
916#
1d8bda12 917# @can-offline: Whether offlining the MEMORY BLOCK is possible.
a065aaa9
HZ
918# This member is always filled in by the guest agent when the
919# structure is returned, and always ignored on input (hence it
920# can be omitted then).
921#
922# Since: 2.3
923##
895a2a80 924{ 'struct': 'GuestMemoryBlock',
a065aaa9
HZ
925 'data': {'phys-index': 'uint64',
926 'online': 'bool',
927 '*can-offline': 'bool'} }
928
929##
930# @guest-get-memory-blocks:
931#
932# Retrieve the list of the guest's memory blocks.
933#
934# This is a read-only operation.
935#
936# Returns: The list of all memory blocks the guest knows about.
937# Each memory block is put on the list exactly once, but their order
938# is unspecified.
939#
940# Since: 2.3
941##
942{ 'command': 'guest-get-memory-blocks',
943 'returns': ['GuestMemoryBlock'] }
944
945##
5072f7b3 946# @GuestMemoryBlockResponseType:
a065aaa9
HZ
947#
948# An enumeration of memory block operation result.
949#
631b22ea 950# @success: the operation of online/offline memory block is successful.
a065aaa9
HZ
951# @not-found: can't find the corresponding memoryXXX directory in sysfs.
952# @operation-not-supported: for some old kernels, it does not support
953# online or offline memory block.
954# @operation-failed: the operation of online/offline memory block fails,
955# because of some errors happen.
956#
957# Since: 2.3
958##
959{ 'enum': 'GuestMemoryBlockResponseType',
960 'data': ['success', 'not-found', 'operation-not-supported',
961 'operation-failed'] }
962
963##
964# @GuestMemoryBlockResponse:
965#
966# @phys-index: same with the 'phys-index' member of @GuestMemoryBlock.
967#
968# @response: the result of memory block operation.
969#
1d8bda12 970# @error-code: the error number.
a065aaa9
HZ
971# When memory block operation fails, we assign the value of
972# 'errno' to this member, it indicates what goes wrong.
973# When the operation succeeds, it will be omitted.
974#
975# Since: 2.3
976##
895a2a80 977{ 'struct': 'GuestMemoryBlockResponse',
a065aaa9
HZ
978 'data': { 'phys-index': 'uint64',
979 'response': 'GuestMemoryBlockResponseType',
980 '*error-code': 'int' }}
981
982##
983# @guest-set-memory-blocks:
984#
985# Attempt to reconfigure (currently: enable/disable) state of memory blocks
986# inside the guest.
987#
988# The input list is processed node by node in order. In each node @phys-index
989# is used to look up the guest MEMORY BLOCK, for which @online specifies the
990# requested state. The set of distinct @phys-index's is only required to be a
991# subset of the guest-supported identifiers. There's no restriction on list
992# length or on repeating the same @phys-index (with possibly different @online
993# field).
994# Preferably the input list should describe a modified subset of
995# @guest-get-memory-blocks' return value.
996#
997# Returns: The operation results, it is a list of @GuestMemoryBlockResponse,
998# which is corresponding to the input list.
999#
1000# Note: it will return NULL if the @mem-blks list was empty on input,
1001# or there is an error, and in this case, guest state will not be
1002# changed.
1003#
1004# Since: 2.3
1005##
1006{ 'command': 'guest-set-memory-blocks',
1007 'data': {'mem-blks': ['GuestMemoryBlock'] },
1008 'returns': ['GuestMemoryBlockResponse'] }
1009
49687ace 1010##
a065aaa9
HZ
1011# @GuestMemoryBlockInfo:
1012#
1013# @size: the size (in bytes) of the guest memory blocks,
1014# which are the minimal units of memory block online/offline
1015# operations (also called Logical Memory Hotplug).
1016#
1017# Since: 2.3
1018##
895a2a80 1019{ 'struct': 'GuestMemoryBlockInfo',
a065aaa9
HZ
1020 'data': {'size': 'uint64'} }
1021
1022##
1023# @guest-get-memory-block-info:
1024#
1025# Get information relating to guest memory blocks.
1026#
a065aaa9
HZ
1027# Returns: @GuestMemoryBlockInfo
1028#
5072f7b3 1029# Since: 2.3
a065aaa9
HZ
1030##
1031{ 'command': 'guest-get-memory-block-info',
1032 'returns': 'GuestMemoryBlockInfo' }
d697e30c 1033
49687ace 1034##
d697e30c
YP
1035# @GuestExecStatus:
1036#
1037# @exited: true if process has already terminated.
1d8bda12
MA
1038# @exitcode: process exit code if it was normally terminated.
1039# @signal: signal number (linux) or unhandled exception code
d697e30c 1040# (windows) if the process was abnormally terminated.
1d8bda12
MA
1041# @out-data: base64-encoded stdout of the process
1042# @err-data: base64-encoded stderr of the process
d697e30c
YP
1043# Note: @out-data and @err-data are present only
1044# if 'capture-output' was specified for 'guest-exec'
1d8bda12 1045# @out-truncated: true if stdout was not fully captured
a1853dca 1046# due to size limitation.
1d8bda12 1047# @err-truncated: true if stderr was not fully captured
a1853dca 1048# due to size limitation.
d697e30c
YP
1049#
1050# Since: 2.5
1051##
1052{ 'struct': 'GuestExecStatus',
1053 'data': { 'exited': 'bool', '*exitcode': 'int', '*signal': 'int',
a1853dca
YP
1054 '*out-data': 'str', '*err-data': 'str',
1055 '*out-truncated': 'bool', '*err-truncated': 'bool' }}
d697e30c 1056##
5072f7b3 1057# @guest-exec-status:
d697e30c
YP
1058#
1059# Check status of process associated with PID retrieved via guest-exec.
1060# Reap the process and associated metadata if it has exited.
1061#
1062# @pid: pid returned from guest-exec
1063#
1064# Returns: GuestExecStatus on success.
1065#
5072f7b3 1066# Since: 2.5
d697e30c
YP
1067##
1068{ 'command': 'guest-exec-status',
1069 'data': { 'pid': 'int' },
1070 'returns': 'GuestExecStatus' }
1071
1072##
1073# @GuestExec:
1074# @pid: pid of child process in guest OS
1075#
5072f7b3 1076# Since: 2.5
d697e30c
YP
1077##
1078{ 'struct': 'GuestExec',
1079 'data': { 'pid': 'int'} }
1080
1081##
1082# @guest-exec:
1083#
1084# Execute a command in the guest
1085#
1086# @path: path or executable name to execute
1d8bda12
MA
1087# @arg: argument list to pass to executable
1088# @env: environment variables to pass to executable
1089# @input-data: data to be passed to process stdin (base64 encoded)
1090# @capture-output: bool flag to enable capture of
d697e30c
YP
1091# stdout/stderr of running process. defaults to false.
1092#
1093# Returns: PID on success.
1094#
1095# Since: 2.5
1096##
1097{ 'command': 'guest-exec',
1098 'data': { 'path': 'str', '*arg': ['str'], '*env': ['str'],
1099 '*input-data': 'str', '*capture-output': 'bool' },
1100 'returns': 'GuestExec' }
0a3d197a
VF
1101
1102
1103##
1104# @GuestHostName:
1105# @host-name: Fully qualified domain name of the guest OS
1106#
1107# Since: 2.10
1108##
1109{ 'struct': 'GuestHostName',
1110 'data': { 'host-name': 'str' } }
1111
1112##
1113# @guest-get-host-name:
1114#
1115# Return a name for the machine.
1116#
1117# The returned name is not necessarily a fully-qualified domain name, or even
1118# present in DNS or some other name service at all. It need not even be unique
1119# on your local network or site, but usually it is.
1120#
1121# Returns: the host name of the machine on success
1122#
1123# Since: 2.10
1124##
1125{ 'command': 'guest-get-host-name',
1126 'returns': 'GuestHostName' }
161a56a9
VF
1127
1128
1129##
1130# @GuestUser:
1131# @user: Username
1132# @domain: Logon domain (windows only)
1133# @login-time: Time of login of this user on the computer. If multiple
1134# instances of the user are logged in, the earliest login time is
1135# reported. The value is in fractional seconds since epoch time.
1136#
1137# Since: 2.10
1138##
1139{ 'struct': 'GuestUser',
1140 'data': { 'user': 'str', 'login-time': 'number', '*domain': 'str' } }
1141
1142##
1143# @guest-get-users:
1144# Retrieves a list of currently active users on the VM.
1145#
1146# Returns: A unique list of users.
1147#
1148# Since: 2.10
1149##
1150{ 'command': 'guest-get-users',
1151 'returns': ['GuestUser'] }
53c58e64
VF
1152
1153##
1154# @GuestTimezone:
1155#
1156# @zone: Timezone name. These values may differ depending on guest/OS and
1157# should only be used for informational purposes.
1158# @offset: Offset to UTC in seconds, negative numbers for time zones west of
1159# GMT, positive numbers for east
1160#
1161# Since: 2.10
1162##
1163{ 'struct': 'GuestTimezone',
1164 'data': { '*zone': 'str', 'offset': 'int' } }
1165
1166##
1167# @guest-get-timezone:
1168#
1169# Retrieves the timezone information from the guest.
1170#
1171# Returns: A GuestTimezone dictionary.
1172#
1173# Since: 2.10
1174##
1175{ 'command': 'guest-get-timezone',
1176 'returns': 'GuestTimezone' }
9848f797
TG
1177
1178##
1179# @GuestOSInfo:
1180#
1181# @kernel-release:
1182# * POSIX: release field returned by uname(2)
84ece8ef 1183# * Windows: build number of the OS
9848f797
TG
1184# @kernel-version:
1185# * POSIX: version field returned by uname(2)
84ece8ef 1186# * Windows: version number of the OS
9848f797
TG
1187# @machine:
1188# * POSIX: machine field returned by uname(2)
1189# * Windows: one of x86, x86_64, arm, ia64
1190# @id:
1191# * POSIX: as defined by os-release(5)
1192# * Windows: contains string "mswindows"
1193# @name:
1194# * POSIX: as defined by os-release(5)
1195# * Windows: contains string "Microsoft Windows"
1196# @pretty-name:
1197# * POSIX: as defined by os-release(5)
1198# * Windows: product name, e.g. "Microsoft Windows 10 Enterprise"
1199# @version:
1200# * POSIX: as defined by os-release(5)
1201# * Windows: long version string, e.g. "Microsoft Windows Server 2008"
1202# @version-id:
1203# * POSIX: as defined by os-release(5)
1204# * Windows: short version identifier, e.g. "7" or "20012r2"
1205# @variant:
1206# * POSIX: as defined by os-release(5)
1207# * Windows: contains string "server" or "client"
1208# @variant-id:
1209# * POSIX: as defined by os-release(5)
1210# * Windows: contains string "server" or "client"
1211#
1212# Notes:
1213#
1214# On POSIX systems the fields @id, @name, @pretty-name, @version, @version-id,
1215# @variant and @variant-id follow the definition specified in os-release(5).
1216# Refer to the manual page for exact description of the fields. Their values
1217# are taken from the os-release file. If the file is not present in the system,
1218# or the values are not present in the file, the fields are not included.
1219#
1220# On Windows the values are filled from information gathered from the system.
1221#
1222# Since: 2.10
1223##
1224{ 'struct': 'GuestOSInfo',
1225 'data': {
1226 '*kernel-release': 'str', '*kernel-version': 'str',
1227 '*machine': 'str', '*id': 'str', '*name': 'str',
1228 '*pretty-name': 'str', '*version': 'str', '*version-id': 'str',
1229 '*variant': 'str', '*variant-id': 'str' } }
1230
1231##
1232# @guest-get-osinfo:
1233#
1234# Retrieve guest operating system information
1235#
1236# Returns: @GuestOSInfo
1237#
1238# Since: 2.10
1239##
1240{ 'command': 'guest-get-osinfo',
1241 'returns': 'GuestOSInfo' }