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