tests/arm-cpu-features: Do not assume PMU availability
[qemu/ar7.git] / qga / qapi-schema.json
blob1273d85bb5ff6c8fec42bf2f453e9b1bbe35dd3b
1 # *-*- Mode: Python -*-*
2 # vim: filetype=python
4 ##
5 # = General note concerning the use of guest agent interfaces
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.
14 # = QEMU guest agent protocol commands and structs
17 { 'pragma': { 'doc-required': true } }
19 # Lists with items allowed to permit QAPI rule violations; think twice
20 # before you add to them!
21 { 'pragma': {
22     # Types whose member names may use '_'
23     'member-name-exceptions': [
24         'GuestAgentInfo'
25     ],
26     # Commands allowed to return a non-dictionary:
27     'command-returns-exceptions': [
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     # Types and commands with undocumented members:
38     'documentation-exceptions': [
39         'GuestNVMeSmart' ] } }
42 # @guest-sync-delimited:
44 # Echo back a unique integer value, and prepend to response a leading
45 # sentinel byte (0xFF) the client can check scan for.
47 # This is used by clients talking to the guest agent over the wire to
48 # ensure the stream is in sync and doesn't contain stale data from
49 # previous client.  It must be issued upon initial connection, and
50 # after any client-side timeouts (including timeouts on receiving a
51 # response to this command).
53 # After issuing this request, all guest agent responses should be
54 # ignored until the response containing the unique integer value the
55 # client passed in is returned.  Receival of the 0xFF sentinel byte
56 # must be handled as an indication that the client's
57 # lexer/tokenizer/parser state should be flushed/reset in preparation
58 # for reliably receiving the subsequent response.  As an optimization,
59 # clients may opt to ignore all data until a sentinel value is
60 # receiving to avoid unnecessary processing of stale data.
62 # Similarly, clients should also precede this *request* with a 0xFF
63 # byte to make sure the guest agent flushes any partially read JSON
64 # data from a previous client connection.
66 # @id: randomly generated 64-bit integer
68 # Returns: The unique integer id passed in by the client
70 # Since: 1.1
72 { 'command': 'guest-sync-delimited',
73   'data':    { 'id': 'int' },
74   'returns': 'int' }
77 # @guest-sync:
79 # Echo back a unique integer value
81 # This is used by clients talking to the guest agent over the wire to
82 # ensure the stream is in sync and doesn't contain stale data from
83 # previous client.  All guest agent responses should be ignored until
84 # the provided unique integer value is returned, and it is up to the
85 # client to handle stale whole or partially-delivered JSON text in
86 # such a way that this response can be obtained.
88 # In cases where a partial stale response was previously received by
89 # the client, this cannot always be done reliably.  One particular
90 # scenario being if qemu-ga responses are fed character-by-character
91 # into a JSON parser.  In these situations, using guest-sync-delimited
92 # may be optimal.
94 # For clients that fetch responses line by line and convert them to
95 # JSON objects, guest-sync should be sufficient, but note that in
96 # cases where the channel is dirty some attempts at parsing the
97 # response may result in a parser error.
99 # Such clients should also precede this command with a 0xFF byte to
100 # make sure the guest agent flushes any partially read JSON data from
101 # a previous session.
103 # @id: randomly generated 64-bit integer
105 # Returns: The unique integer id passed in by the client
107 # Since: 0.15.0
109 { 'command': 'guest-sync',
110   'data':    { 'id': 'int' },
111   'returns': 'int' }
114 # @guest-ping:
116 # Ping the guest agent, a non-error return implies success
118 # Since: 0.15.0
120 { 'command': 'guest-ping' }
123 # @guest-get-time:
125 # Get the information about guest's System Time relative to the Epoch
126 # of 1970-01-01 in UTC.
128 # Returns: Time in nanoseconds.
130 # Since: 1.5
132 { 'command': 'guest-get-time',
133   'returns': 'int' }
136 # @guest-set-time:
138 # Set guest time.
140 # When a guest is paused or migrated to a file then loaded from that
141 # file, the guest OS has no idea that there was a big gap in the time.
142 # Depending on how long the gap was, NTP might not be able to
143 # resynchronize the guest.
145 # This command tries to set guest's System Time to the given value,
146 # then sets the Hardware Clock (RTC) to the current System Time.  This
147 # will make it easier for a guest to resynchronize without waiting for
148 # NTP. If no @time is specified, then the time to set is read from
149 # RTC. However, this may not be supported on all platforms (i.e.
150 # Windows). If that's the case users are advised to always pass a
151 # value.
153 # @time: time of nanoseconds, relative to the Epoch of 1970-01-01 in
154 #     UTC.
156 # Since: 1.5
158 { 'command': 'guest-set-time',
159   'data': { '*time': 'int' } }
162 # @GuestAgentCommandInfo:
164 # Information about guest agent commands.
166 # @name: name of the command
168 # @enabled: whether command is currently enabled by guest admin
170 # @success-response: whether command returns a response on success
171 #     (since 1.7)
173 # Since: 1.1.0
175 { 'struct': 'GuestAgentCommandInfo',
176   'data': { 'name': 'str', 'enabled': 'bool', 'success-response': 'bool' } }
179 # @GuestAgentInfo:
181 # Information about guest agent.
183 # @version: guest agent version
185 # @supported_commands: Information about guest agent commands
187 # Since: 0.15.0
189 { 'struct': 'GuestAgentInfo',
190   'data': { 'version': 'str',
191             'supported_commands': ['GuestAgentCommandInfo'] } }
193 # @guest-info:
195 # Get some information about the guest agent.
197 # Returns: @GuestAgentInfo
199 # Since: 0.15.0
201 { 'command': 'guest-info',
202   'returns': 'GuestAgentInfo' }
205 # @guest-shutdown:
207 # Initiate guest-activated shutdown.  Note: this is an asynchronous
208 # shutdown request, with no guarantee of successful shutdown.
210 # @mode: "halt", "powerdown" (default), or "reboot"
212 # This command does NOT return a response on success.  Success
213 # condition is indicated by the VM exiting with a zero exit status or,
214 # when running with --no-shutdown, by issuing the query-status QMP
215 # command to confirm the VM status is "shutdown".
217 # Since: 0.15.0
219 { 'command': 'guest-shutdown', 'data': { '*mode': 'str' },
220   'success-response': false }
223 # @guest-file-open:
225 # Open a file in the guest and retrieve a file handle for it
227 # @path: Full path to the file in the guest to open.
229 # @mode: open mode, as per fopen(), "r" is the default.
231 # Returns: Guest file handle
233 # Since: 0.15.0
235 { 'command': 'guest-file-open',
236   'data':    { 'path': 'str', '*mode': 'str' },
237   'returns': 'int' }
240 # @guest-file-close:
242 # Close an open file in the guest
244 # @handle: filehandle returned by guest-file-open
246 # Since: 0.15.0
248 { 'command': 'guest-file-close',
249   'data': { 'handle': 'int' } }
252 # @GuestFileRead:
254 # Result of guest agent file-read operation
256 # @count: number of bytes read (note: count is *before*
257 #     base64-encoding is applied)
259 # @buf-b64: base64-encoded bytes read
261 # @eof: whether EOF was encountered during read operation.
263 # Since: 0.15.0
265 { 'struct': 'GuestFileRead',
266   'data': { 'count': 'int', 'buf-b64': 'str', 'eof': 'bool' } }
269 # @guest-file-read:
271 # Read from an open file in the guest.  Data will be base64-encoded.
272 # As this command is just for limited, ad-hoc debugging, such as log
273 # file access, the number of bytes to read is limited to 48 MB.
275 # @handle: filehandle returned by guest-file-open
277 # @count: maximum number of bytes to read (default is 4KB, maximum is
278 #     48MB)
280 # Returns: @GuestFileRead
282 # Since: 0.15.0
284 { 'command': 'guest-file-read',
285   'data':    { 'handle': 'int', '*count': 'int' },
286   'returns': 'GuestFileRead' }
289 # @GuestFileWrite:
291 # Result of guest agent file-write operation
293 # @count: number of bytes written (note: count is actual bytes
294 #     written, after base64-decoding of provided buffer)
296 # @eof: whether EOF was encountered during write operation.
298 # Since: 0.15.0
300 { 'struct': 'GuestFileWrite',
301   'data': { 'count': 'int', 'eof': 'bool' } }
304 # @guest-file-write:
306 # Write to an open file in the guest.
308 # @handle: filehandle returned by guest-file-open
310 # @buf-b64: base64-encoded string representing data to be written
312 # @count: bytes to write (actual bytes, after base64-decode), default
313 #     is all content in buf-b64 buffer after base64 decoding
315 # Returns: @GuestFileWrite
317 # Since: 0.15.0
319 { 'command': 'guest-file-write',
320   'data':    { 'handle': 'int', 'buf-b64': 'str', '*count': 'int' },
321   'returns': 'GuestFileWrite' }
325 # @GuestFileSeek:
327 # Result of guest agent file-seek operation
329 # @position: current file position
331 # @eof: whether EOF was encountered during file seek
333 # Since: 0.15.0
335 { 'struct': 'GuestFileSeek',
336   'data': { 'position': 'int', 'eof': 'bool' } }
339 # @QGASeek:
341 # Symbolic names for use in @guest-file-seek
343 # @set: Set to the specified offset (same effect as 'whence':0)
345 # @cur: Add offset to the current location (same effect as 'whence':1)
347 # @end: Add offset to the end of the file (same effect as 'whence':2)
349 # Since: 2.6
351 { 'enum': 'QGASeek', 'data': [ 'set', 'cur', 'end' ] }
354 # @GuestFileWhence:
356 # Controls the meaning of offset to @guest-file-seek.
358 # @value: Integral value (0 for set, 1 for cur, 2 for end), available
359 #     for historical reasons, and might differ from the host's or
360 #     guest's SEEK_* values (since: 0.15)
362 # @name: Symbolic name, and preferred interface
364 # Since: 2.6
366 { 'alternate': 'GuestFileWhence',
367   'data': { 'value': 'int', 'name': 'QGASeek' } }
370 # @guest-file-seek:
372 # Seek to a position in the file, as with fseek(), and return the
373 # current file position afterward.  Also encapsulates ftell()'s
374 # functionality, with offset=0 and whence=1.
376 # @handle: filehandle returned by guest-file-open
378 # @offset: bytes to skip over in the file stream
380 # @whence: Symbolic or numeric code for interpreting offset
382 # Returns: @GuestFileSeek
384 # Since: 0.15.0
386 { 'command': 'guest-file-seek',
387   'data':    { 'handle': 'int', 'offset': 'int',
388                'whence': 'GuestFileWhence' },
389   'returns': 'GuestFileSeek' }
392 # @guest-file-flush:
394 # Write file changes buffered in userspace to disk/kernel buffers
396 # @handle: filehandle returned by guest-file-open
398 # Since: 0.15.0
400 { 'command': 'guest-file-flush',
401   'data': { 'handle': 'int' } }
404 # @GuestFsfreezeStatus:
406 # An enumeration of filesystem freeze states
408 # @thawed: filesystems thawed/unfrozen
410 # @frozen: all non-network guest filesystems frozen
412 # Since: 0.15.0
414 { 'enum': 'GuestFsfreezeStatus',
415   'data': [ 'thawed', 'frozen' ] }
418 # @guest-fsfreeze-status:
420 # Get guest fsfreeze state.
422 # Returns: GuestFsfreezeStatus ("thawed", "frozen", etc., as defined
423 #     below)
425 # .. note:: This may fail to properly report the current state as a
426 #    result of some other guest processes having issued an fs
427 #    freeze/thaw.
429 # Since: 0.15.0
431 { 'command': 'guest-fsfreeze-status',
432   'returns': 'GuestFsfreezeStatus' }
435 # @guest-fsfreeze-freeze:
437 # Sync and freeze all freezable, local guest filesystems.  If this
438 # command succeeded, you may call @guest-fsfreeze-thaw later to
439 # unfreeze.
441 # On error, all filesystems will be thawed.  If no filesystems are
442 # frozen as a result of this call, then @guest-fsfreeze-status will
443 # remain "thawed" and calling @guest-fsfreeze-thaw is not necessary.
445 # Returns: Number of file systems currently frozen.
447 # .. note:: On Windows, the command is implemented with the help of a
448 #    Volume Shadow-copy Service DLL helper.  The frozen state is limited
449 #    for up to 10 seconds by VSS.
451 # Since: 0.15.0
453 { 'command': 'guest-fsfreeze-freeze',
454   'returns': 'int' }
457 # @guest-fsfreeze-freeze-list:
459 # Sync and freeze specified guest filesystems.  See also
460 # @guest-fsfreeze-freeze.
462 # On error, all filesystems will be thawed.
464 # @mountpoints: an array of mountpoints of filesystems to be frozen.
465 #     If omitted, every mounted filesystem is frozen.  Invalid mount
466 #     points are ignored.
468 # Returns: Number of file systems currently frozen.
470 # Since: 2.2
472 { 'command': 'guest-fsfreeze-freeze-list',
473   'data':    { '*mountpoints': ['str'] },
474   'returns': 'int' }
477 # @guest-fsfreeze-thaw:
479 # Unfreeze all frozen guest filesystems
481 # Returns: Number of file systems thawed by this call
483 # .. note:: If the return value does not match the previous call to
484 #    guest-fsfreeze-freeze, this likely means some freezable filesystems
485 #    were unfrozen before this call, and that the filesystem state may
486 #    have changed before issuing this command.
488 # Since: 0.15.0
490 { 'command': 'guest-fsfreeze-thaw',
491   'returns': 'int' }
494 # @GuestFilesystemTrimResult:
496 # @path: path that was trimmed
498 # @error: an error message when trim failed
500 # @trimmed: bytes trimmed for this path
502 # @minimum: reported effective minimum for this path
504 # Since: 2.4
506 { 'struct': 'GuestFilesystemTrimResult',
507   'data': {'path': 'str',
508            '*trimmed': 'int', '*minimum': 'int', '*error': 'str'} }
511 # @GuestFilesystemTrimResponse:
513 # @paths: list of @GuestFilesystemTrimResult per path that was trimmed
515 # Since: 2.4
517 { 'struct': 'GuestFilesystemTrimResponse',
518   'data': {'paths': ['GuestFilesystemTrimResult']} }
521 # @guest-fstrim:
523 # Discard (or "trim") blocks which are not in use by the filesystem.
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".
533 # Returns: A @GuestFilesystemTrimResponse which contains the status of
534 #     all trimmed paths.  (since 2.4)
536 # Since: 1.2
538 { 'command': 'guest-fstrim',
539   'data': { '*minimum': 'int' },
540   'returns': 'GuestFilesystemTrimResponse' }
543 # @guest-suspend-disk:
545 # Suspend guest to disk.
547 # This command attempts to suspend the guest using three strategies,
548 # in this order:
550 # - systemd hibernate
551 # - pm-utils (via pm-hibernate)
552 # - manual write into sysfs
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.
561 # Errors:
562 #     - If suspend to disk is not supported, Unsupported
564 # .. note:: It's strongly recommended to issue the guest-sync command
565 #    before sending commands when the guest resumes.
567 # Since: 1.1
569 { 'command': 'guest-suspend-disk', 'success-response': false }
572 # @guest-suspend-ram:
574 # Suspend guest to ram.
576 # This command attempts to suspend the guest using three strategies,
577 # in this order:
579 # - systemd hibernate
580 # - pm-utils (via pm-hibernate)
581 # - manual write into sysfs
583 # IMPORTANT: guest-suspend-ram requires working wakeup support in
584 # QEMU. You should check QMP command query-current-machine returns
585 # wakeup-suspend-support: true before issuing this command.  Failure
586 # in doing so can result in a suspended guest that QEMU will not be
587 # able to awaken, forcing the user to power cycle the guest to bring
588 # it back.
590 # This command does NOT return a response on success.  There are two
591 # options to check for success:
593 # 1. Wait for the SUSPEND QMP event from QEMU
594 # 2. Issue the query-status QMP command to confirm the VM status is
595 #    "suspended"
597 # Errors:
598 #     - If suspend to ram is not supported, Unsupported
600 # .. note:: It's strongly recommended to issue the guest-sync command
601 #    before sending commands when the guest resumes.
603 # Since: 1.1
605 { 'command': 'guest-suspend-ram', 'success-response': false }
608 # @guest-suspend-hybrid:
610 # Save guest state to disk and suspend to ram.
612 # This command attempts to suspend the guest by executing, in this
613 # order:
615 # - systemd hybrid-sleep
616 # - pm-utils (via pm-suspend-hybrid)
618 # IMPORTANT: guest-suspend-hybrid requires working wakeup support in
619 # QEMU. You should check QMP command query-current-machine returns
620 # wakeup-suspend-support: true before issuing this command.  Failure
621 # in doing so can result in a suspended guest that QEMU will not be
622 # able to awaken, forcing the user to power cycle the guest to bring
623 # it back.
625 # This command does NOT return a response on success.  There are two
626 # options to check for success:
628 # 1. Wait for the SUSPEND QMP event from QEMU
629 # 2. Issue the query-status QMP command to confirm the VM status is
630 #    "suspended"
632 # Errors:
633 #     - If hybrid suspend is not supported, Unsupported
635 # .. note:: It's strongly recommended to issue the guest-sync command
636 #    before sending commands when the guest resumes.
638 # Since: 1.1
640 { 'command': 'guest-suspend-hybrid', 'success-response': false }
643 # @GuestIpAddressType:
645 # An enumeration of supported IP address types
647 # @ipv4: IP version 4
649 # @ipv6: IP version 6
651 # Since: 1.1
653 { 'enum': 'GuestIpAddressType',
654   'data': [ 'ipv4', 'ipv6' ] }
657 # @GuestIpAddress:
659 # @ip-address: IP address
661 # @ip-address-type: Type of @ip-address (e.g. ipv4, ipv6)
663 # @prefix: Network prefix length of @ip-address
665 # Since: 1.1
667 { 'struct': 'GuestIpAddress',
668   'data': {'ip-address': 'str',
669            'ip-address-type': 'GuestIpAddressType',
670            'prefix': 'int'} }
673 # @GuestNetworkInterfaceStat:
675 # @rx-bytes: total bytes received
677 # @rx-packets: total packets received
679 # @rx-errs: bad packets received
681 # @rx-dropped: receiver dropped packets
683 # @tx-bytes: total bytes transmitted
685 # @tx-packets: total packets transmitted
687 # @tx-errs: packet transmit problems
689 # @tx-dropped: dropped packets transmitted
691 # Since: 2.11
693 { 'struct': 'GuestNetworkInterfaceStat',
694   'data': {'rx-bytes': 'uint64',
695             'rx-packets': 'uint64',
696             'rx-errs': 'uint64',
697             'rx-dropped': 'uint64',
698             'tx-bytes': 'uint64',
699             'tx-packets': 'uint64',
700             'tx-errs': 'uint64',
701             'tx-dropped': 'uint64'
702            } }
705 # @GuestNetworkInterface:
707 # @name: The name of interface for which info are being delivered
709 # @hardware-address: Hardware address of @name
711 # @ip-addresses: List of addresses assigned to @name
713 # @statistics: various statistic counters related to @name (since
714 #     2.11)
716 # Since: 1.1
718 { 'struct': 'GuestNetworkInterface',
719   'data': {'name': 'str',
720            '*hardware-address': 'str',
721            '*ip-addresses': ['GuestIpAddress'],
722            '*statistics': 'GuestNetworkInterfaceStat' } }
725 # @guest-network-get-interfaces:
727 # Get list of guest IP addresses, MAC addresses and netmasks.
729 # Returns: List of GuestNetworkInterface
731 # Since: 1.1
733 { 'command': 'guest-network-get-interfaces',
734   'returns': ['GuestNetworkInterface'] }
737 # @GuestLogicalProcessor:
739 # @logical-id: Arbitrary guest-specific unique identifier of the VCPU.
741 # @online: Whether the VCPU is enabled.
743 # @can-offline: Whether offlining the VCPU is possible.  This member
744 #     is always filled in by the guest agent when the structure is
745 #     returned, and always ignored on input (hence it can be omitted
746 #     then).
748 # Since: 1.5
750 { 'struct': 'GuestLogicalProcessor',
751   'data': {'logical-id': 'int',
752            'online': 'bool',
753            '*can-offline': 'bool'} }
756 # @guest-get-vcpus:
758 # Retrieve the list of the guest's logical processors.
760 # This is a read-only operation.
762 # Returns: The list of all VCPUs the guest knows about.  Each VCPU is
763 #     put on the list exactly once, but their order is unspecified.
765 # Since: 1.5
767 { 'command': 'guest-get-vcpus',
768   'returns': ['GuestLogicalProcessor'] }
771 # @guest-set-vcpus:
773 # Attempt to reconfigure (currently: enable/disable) logical
774 # processors inside the guest.
776 # @vcpus: The logical processors to be reconfigured.  This list is
777 #     processed node by node in order.  In each node @logical-id is
778 #     used to look up the guest VCPU, for which @online specifies the
779 #     requested state.  The set of distinct @logical-id's is only
780 #     required to be a subset of the guest-supported identifiers.
781 #     There's no restriction on list length or on repeating the same
782 #     @logical-id (with possibly different @online field).  Preferably
783 #     the input list should describe a modified subset of
784 #     @guest-get-vcpus' return value.
786 # Returns: The length of the initial sublist that has been
787 #     successfully processed.  The guest agent maximizes this value.
788 #     Possible cases:
790 #     - 0:
791 #       if the @vcpus list was empty on input.  Guest state has not
792 #       been changed.  Otherwise,
793 #     - < length(@vcpus):
794 #       more than zero initial nodes have been processed, but not the
795 #       entire @vcpus list.  Guest state has changed accordingly.  To
796 #       retrieve the error (assuming it persists), repeat the call
797 #       with the successfully processed initial sublist removed.
798 #       Otherwise,
799 #     - length(@vcpus):
800 #       call successful.
802 # Errors:
803 #     - If the reconfiguration of the first node in @vcpus failed.
804 #       Guest state has not been changed.
806 # Since: 1.5
808 { 'command': 'guest-set-vcpus',
809   'data':    {'vcpus': ['GuestLogicalProcessor'] },
810   'returns': 'int' }
813 # @GuestDiskBusType:
815 # An enumeration of bus type of disks
817 # @ide: IDE disks
819 # @fdc: floppy disks
821 # @scsi: SCSI disks
823 # @virtio: virtio disks
825 # @xen: Xen disks
827 # @usb: USB disks
829 # @uml: UML disks
831 # @sata: SATA disks
833 # @sd: SD cards
835 # @unknown: Unknown bus type
837 # @ieee1394: Win IEEE 1394 bus type
839 # @ssa: Win SSA bus type
841 # @fibre: Win fiber channel bus type
843 # @raid: Win RAID bus type
845 # @iscsi: Win iScsi bus type
847 # @sas: Win serial-attaches SCSI bus type
849 # @mmc: Win multimedia card (MMC) bus type
851 # @virtual: Win virtual bus type
853 # @file-backed-virtual: Win file-backed bus type
855 # @nvme: NVMe disks (since 7.1)
857 # Since: 2.2; 'Unknown' and all entries below since 2.4
859 { 'enum': 'GuestDiskBusType',
860   'data': [ 'ide', 'fdc', 'scsi', 'virtio', 'xen', 'usb', 'uml', 'sata',
861             'sd', 'unknown', 'ieee1394', 'ssa', 'fibre', 'raid', 'iscsi',
862             'sas', 'mmc', 'virtual', 'file-backed-virtual', 'nvme' ] }
866 # @GuestPCIAddress:
868 # @domain: domain id
870 # @bus: bus id
872 # @slot: slot id
874 # @function: function id
876 # Since: 2.2
878 { 'struct': 'GuestPCIAddress',
879   'data': {'domain': 'int', 'bus': 'int',
880            'slot': 'int', 'function': 'int'} }
883 # @GuestCCWAddress:
885 # @cssid: channel subsystem image id
887 # @ssid: subchannel set id
889 # @subchno: subchannel number
891 # @devno: device number
893 # Since: 6.0
895 { 'struct': 'GuestCCWAddress',
896   'data': {'cssid': 'int',
897            'ssid': 'int',
898            'subchno': 'int',
899            'devno': 'int'} }
902 # @GuestDiskAddress:
904 # @pci-controller: controller's PCI address (fields are set to -1 if
905 #     invalid)
907 # @bus-type: bus type
909 # @bus: bus id
911 # @target: target id
913 # @unit: unit id
915 # @serial: serial number (since: 3.1)
917 # @dev: device node (POSIX) or device UNC (Windows) (since: 3.1)
919 # @ccw-address: CCW address on s390x (since: 6.0)
921 # Since: 2.2
923 { 'struct': 'GuestDiskAddress',
924   'data': {'pci-controller': 'GuestPCIAddress',
925            'bus-type': 'GuestDiskBusType',
926            'bus': 'int', 'target': 'int', 'unit': 'int',
927            '*serial': 'str', '*dev': 'str',
928            '*ccw-address': 'GuestCCWAddress'} }
931 # @GuestNVMeSmart:
933 # NVMe smart information, based on NVMe specification, section
934 # <SMART / Health Information (Log Identifier 02h)>
936 # TODO: document members briefly
938 # Since: 7.1
940 { 'struct': 'GuestNVMeSmart',
941   'data': {'critical-warning': 'int',
942            'temperature': 'int',
943            'available-spare': 'int',
944            'available-spare-threshold': 'int',
945            'percentage-used': 'int',
946            'data-units-read-lo': 'uint64',
947            'data-units-read-hi': 'uint64',
948            'data-units-written-lo': 'uint64',
949            'data-units-written-hi': 'uint64',
950            'host-read-commands-lo': 'uint64',
951            'host-read-commands-hi': 'uint64',
952            'host-write-commands-lo': 'uint64',
953            'host-write-commands-hi': 'uint64',
954            'controller-busy-time-lo': 'uint64',
955            'controller-busy-time-hi': 'uint64',
956            'power-cycles-lo': 'uint64',
957            'power-cycles-hi': 'uint64',
958            'power-on-hours-lo': 'uint64',
959            'power-on-hours-hi': 'uint64',
960            'unsafe-shutdowns-lo': 'uint64',
961            'unsafe-shutdowns-hi': 'uint64',
962            'media-errors-lo': 'uint64',
963            'media-errors-hi': 'uint64',
964            'number-of-error-log-entries-lo': 'uint64',
965            'number-of-error-log-entries-hi': 'uint64' } }
968 # @GuestDiskSmart:
970 # Disk type related smart information.
972 # @type: disk bus type
974 # Since: 7.1
976 { 'union': 'GuestDiskSmart',
977   'base': { 'type': 'GuestDiskBusType' },
978   'discriminator': 'type',
979   'data': { 'nvme': 'GuestNVMeSmart' } }
982 # @GuestDiskInfo:
984 # @name: device node (Linux) or device UNC (Windows)
986 # @partition: whether this is a partition or disk
988 # @dependencies: list of device dependencies; e.g. for LVs of the LVM
989 #     this will hold the list of PVs, for LUKS encrypted volume this
990 #     will contain the disk where the volume is placed.  (Linux)
992 # @address: disk address information (only for non-virtual devices)
994 # @alias: optional alias assigned to the disk, on Linux this is a name
995 #     assigned by device mapper
997 # @smart: disk smart information (Since 7.1)
999 # Since: 5.2
1001 { 'struct': 'GuestDiskInfo',
1002   'data': {'name': 'str', 'partition': 'bool', '*dependencies': ['str'],
1003            '*address': 'GuestDiskAddress', '*alias': 'str',
1004            '*smart': 'GuestDiskSmart'} }
1007 # @guest-get-disks:
1009 # Returns: The list of disks in the guest.  For Windows these are only
1010 #     the physical disks.  On Linux these are all root block devices
1011 #     of non-zero size including e.g. removable devices, loop devices,
1012 #     NBD, etc.
1014 # Since: 5.2
1016 { 'command': 'guest-get-disks',
1017   'returns': ['GuestDiskInfo'] }
1020 # @GuestFilesystemInfo:
1022 # @name: disk name
1024 # @mountpoint: mount point path
1026 # @type: file system type string
1028 # @used-bytes: file system used bytes (since 3.0)
1030 # @total-bytes: filesystem capacity in bytes for unprivileged users (since 3.0)
1032 # @total-bytes-privileged: filesystem capacity in bytes for privileged users
1033 #     (since 9.1)
1035 # @disk: an array of disk hardware information that the volume lies
1036 #     on, which may be empty if the disk type is not supported
1038 # Since: 2.2
1040 { 'struct': 'GuestFilesystemInfo',
1041   'data': {'name': 'str', 'mountpoint': 'str', 'type': 'str',
1042            '*used-bytes': 'uint64', '*total-bytes': 'uint64',
1043            '*total-bytes-privileged': 'uint64', 'disk': ['GuestDiskAddress']} }
1046 # @guest-get-fsinfo:
1048 # Returns: The list of filesystems information mounted in the guest.
1049 #     The returned mountpoints may be specified to
1050 #     @guest-fsfreeze-freeze-list.  Network filesystems (such as CIFS
1051 #     and NFS) are not listed.
1053 # Since: 2.2
1055 { 'command': 'guest-get-fsinfo',
1056   'returns': ['GuestFilesystemInfo'] }
1059 # @guest-set-user-password:
1061 # @username: the user account whose password to change
1063 # @password: the new password entry string, base64 encoded
1065 # @crypted: true if password is already crypt()d, false if raw
1067 # If the @crypted flag is true, it is the caller's responsibility to
1068 # ensure the correct crypt() encryption scheme is used.  This command
1069 # does not attempt to interpret or report on the encryption scheme.
1070 # Refer to the documentation of the guest operating system in question
1071 # to determine what is supported.
1073 # Not all guest operating systems will support use of the @crypted
1074 # flag, as they may require the clear-text password
1076 # The @password parameter must always be base64 encoded before
1077 # transmission, even if already crypt()d, to ensure it is 8-bit safe
1078 # when passed as JSON.
1080 # Since: 2.3
1082 { 'command': 'guest-set-user-password',
1083   'data': { 'username': 'str', 'password': 'str', 'crypted': 'bool' } }
1086 # @GuestMemoryBlock:
1088 # @phys-index: Arbitrary guest-specific unique identifier of the
1089 #     MEMORY BLOCK.
1091 # @online: Whether the MEMORY BLOCK is enabled in guest.
1093 # @can-offline: Whether offlining the MEMORY BLOCK is possible.  This
1094 #     member is always filled in by the guest agent when the structure
1095 #     is returned, and always ignored on input (hence it can be
1096 #     omitted then).
1098 # Since: 2.3
1100 { 'struct': 'GuestMemoryBlock',
1101   'data': {'phys-index': 'uint64',
1102            'online': 'bool',
1103            '*can-offline': 'bool'} }
1106 # @guest-get-memory-blocks:
1108 # Retrieve the list of the guest's memory blocks.
1110 # This is a read-only operation.
1112 # Returns: The list of all memory blocks the guest knows about.  Each
1113 #     memory block is put on the list exactly once, but their order is
1114 #     unspecified.
1116 # Since: 2.3
1118 { 'command': 'guest-get-memory-blocks',
1119   'returns': ['GuestMemoryBlock'] }
1122 # @GuestMemoryBlockResponseType:
1124 # An enumeration of memory block operation result.
1126 # @success: the operation of online/offline memory block is
1127 #     successful.
1129 # @not-found: can't find the corresponding memoryXXX directory in
1130 #     sysfs.
1132 # @operation-not-supported: for some old kernels, it does not support
1133 #     online or offline memory block.
1135 # @operation-failed: the operation of online/offline memory block
1136 #     fails, because of some errors happen.
1138 # Since: 2.3
1140 { 'enum': 'GuestMemoryBlockResponseType',
1141   'data': ['success', 'not-found', 'operation-not-supported',
1142            'operation-failed'] }
1145 # @GuestMemoryBlockResponse:
1147 # @phys-index: same with the 'phys-index' member of @GuestMemoryBlock.
1149 # @response: the result of memory block operation.
1151 # @error-code: the error number.  When memory block operation fails,
1152 #     we assign the value of 'errno' to this member, it indicates what
1153 #     goes wrong.  When the operation succeeds, it will be omitted.
1155 # Since: 2.3
1157 { 'struct': 'GuestMemoryBlockResponse',
1158   'data': { 'phys-index': 'uint64',
1159             'response': 'GuestMemoryBlockResponseType',
1160             '*error-code': 'int' }}
1163 # @guest-set-memory-blocks:
1165 # Attempt to reconfigure (currently: enable/disable) state of memory
1166 # blocks inside the guest.
1168 # @mem-blks: The memory blocks to be reconfigured.  This list is
1169 #     processed node by node in order.  In each node @phys-index is
1170 #     used to look up the guest MEMORY BLOCK, for which @online
1171 #     specifies the requested state.  The set of distinct
1172 #     @phys-index's is only required to be a subset of the
1173 #     guest-supported identifiers.  There's no restriction on list
1174 #     length or on repeating the same @phys-index (with possibly
1175 #     different @online field).  Preferably the input list should
1176 #     describe a modified subset of @guest-get-memory-blocks' return
1177 #     value.
1179 # Returns: The operation results, it is a list of
1180 #     @GuestMemoryBlockResponse, which is corresponding to the input
1181 #     list.
1183 #     Note: it will return an empty list if the @mem-blks list was
1184 #     empty on input, or there is an error, and in this case, guest
1185 #     state will not be changed.
1187 # Since: 2.3
1189 { 'command': 'guest-set-memory-blocks',
1190   'data':    {'mem-blks': ['GuestMemoryBlock'] },
1191   'returns': ['GuestMemoryBlockResponse'] }
1194 # @GuestMemoryBlockInfo:
1196 # @size: the size (in bytes) of the guest memory blocks, which are the
1197 #     minimal units of memory block online/offline operations (also
1198 #     called Logical Memory Hotplug).
1200 # Since: 2.3
1202 { 'struct': 'GuestMemoryBlockInfo',
1203   'data': {'size': 'uint64'} }
1206 # @guest-get-memory-block-info:
1208 # Get information relating to guest memory blocks.
1210 # Returns: @GuestMemoryBlockInfo
1212 # Since: 2.3
1214 { 'command': 'guest-get-memory-block-info',
1215   'returns': 'GuestMemoryBlockInfo' }
1218 # @GuestExecStatus:
1220 # @exited: true if process has already terminated.
1222 # @exitcode: process exit code if it was normally terminated.
1224 # @signal: signal number (linux) or unhandled exception code (windows)
1225 #     if the process was abnormally terminated.
1227 # @out-data: base64-encoded stdout of the process.  This field will
1228 #     only be populated after the process exits.
1230 # @err-data: base64-encoded stderr of the process.  Note: @out-data
1231 #     and @err-data are present only if 'capture-output' was specified
1232 #     for 'guest-exec'.  This field will only be populated after the
1233 #     process exits.
1235 # @out-truncated: true if stdout was not fully captured due to size
1236 #     limitation.
1238 # @err-truncated: true if stderr was not fully captured due to size
1239 #     limitation.
1241 # Since: 2.5
1243 { 'struct': 'GuestExecStatus',
1244   'data': { 'exited': 'bool', '*exitcode': 'int', '*signal': 'int',
1245             '*out-data': 'str', '*err-data': 'str',
1246             '*out-truncated': 'bool', '*err-truncated': 'bool' }}
1248 # @guest-exec-status:
1250 # Check status of process associated with PID retrieved via
1251 # guest-exec.  Reap the process and associated metadata if it has
1252 # exited.
1254 # @pid: pid returned from guest-exec
1256 # Returns: GuestExecStatus
1258 # Since: 2.5
1260 { 'command': 'guest-exec-status',
1261   'data':    { 'pid': 'int' },
1262   'returns': 'GuestExecStatus' }
1265 # @GuestExec:
1267 # @pid: pid of child process in guest OS
1269 # Since: 2.5
1271 { 'struct': 'GuestExec',
1272   'data': { 'pid': 'int'} }
1275 # @GuestExecCaptureOutputMode:
1277 # An enumeration of guest-exec capture modes.
1279 # @none: do not capture any output
1281 # @stdout: only capture stdout
1283 # @stderr: only capture stderr
1285 # @separated: capture both stdout and stderr, but separated into
1286 #     GuestExecStatus out-data and err-data, respectively
1288 # @merged: capture both stdout and stderr, but merge together into
1289 #     out-data.  Not effective on windows guests.
1291 # Since: 8.0
1293  { 'enum': 'GuestExecCaptureOutputMode',
1294    'data': [ 'none', 'stdout', 'stderr', 'separated',
1295              { 'name': 'merged', 'if': { 'not': 'CONFIG_WIN32' } } ] }
1298 # @GuestExecCaptureOutput:
1300 # Controls what guest-exec output gets captures.
1302 # @flag: captures both stdout and stderr if true.  Equivalent to
1303 #     GuestExecCaptureOutputMode::all.  (since 2.5)
1305 # @mode: capture mode; preferred interface
1307 # Since: 8.0
1309  { 'alternate': 'GuestExecCaptureOutput',
1310    'data': { 'flag': 'bool',
1311              'mode': 'GuestExecCaptureOutputMode'} }
1314 # @guest-exec:
1316 # Execute a command in the guest
1318 # @path: path or executable name to execute
1320 # @arg: argument list to pass to executable
1322 # @env: environment variables to pass to executable
1324 # @input-data: data to be passed to process stdin (base64 encoded)
1326 # @capture-output: bool flag to enable capture of stdout/stderr of
1327 #     running process.  Defaults to false.
1329 # Returns: PID
1331 # Since: 2.5
1333 { 'command': 'guest-exec',
1334   'data':    { 'path': 'str', '*arg': ['str'], '*env': ['str'],
1335                '*input-data': 'str', '*capture-output': 'GuestExecCaptureOutput' },
1336   'returns': 'GuestExec' }
1340 # @GuestHostName:
1342 # @host-name: Fully qualified domain name of the guest OS
1344 # Since: 2.10
1346 { 'struct': 'GuestHostName',
1347   'data':   { 'host-name': 'str' } }
1350 # @guest-get-host-name:
1352 # Return a name for the machine.
1354 # The returned name is not necessarily a fully-qualified domain name,
1355 # or even present in DNS or some other name service at all.  It need
1356 # not even be unique on your local network or site, but usually it is.
1358 # Returns: the host name of the machine
1360 # Since: 2.10
1362 { 'command': 'guest-get-host-name',
1363   'returns': 'GuestHostName' }
1367 # @GuestUser:
1369 # @user: Username
1371 # @domain: Logon domain (windows only)
1373 # @login-time: Time of login of this user on the computer.  If
1374 #     multiple instances of the user are logged in, the earliest login
1375 #     time is reported.  The value is in fractional seconds since
1376 #     epoch time.
1378 # Since: 2.10
1380 { 'struct': 'GuestUser',
1381   'data': { 'user': 'str', 'login-time': 'number', '*domain': 'str' } }
1384 # @guest-get-users:
1386 # Retrieves a list of currently active users on the VM.
1388 # Returns: A unique list of users.
1390 # Since: 2.10
1392 { 'command': 'guest-get-users',
1393   'returns': ['GuestUser'] }
1396 # @GuestTimezone:
1398 # @zone: Timezone name.  These values may differ depending on guest/OS
1399 #     and should only be used for informational purposes.
1401 # @offset: Offset to UTC in seconds, negative numbers for time zones
1402 #     west of GMT, positive numbers for east
1404 # Since: 2.10
1406 { 'struct': 'GuestTimezone',
1407   'data':   { '*zone': 'str', 'offset': 'int' } }
1410 # @guest-get-timezone:
1412 # Retrieves the timezone information from the guest.
1414 # Returns: A GuestTimezone dictionary.
1416 # Since: 2.10
1418 { 'command': 'guest-get-timezone',
1419   'returns': 'GuestTimezone' }
1422 # @GuestOSInfo:
1424 # @kernel-release:
1425 #     * POSIX: release field returned by uname(2)
1426 #     * Windows: build number of the OS
1428 # @kernel-version:
1429 #     * POSIX: version field returned by uname(2)
1430 #     * Windows: version number of the OS
1432 # @machine:
1433 #     * POSIX: machine field returned by uname(2)
1434 #     * Windows: one of x86, x86_64, arm, ia64
1436 # @id:
1437 #     * POSIX: as defined by os-release(5)
1438 #     * Windows: contains string "mswindows"
1440 # @name:
1441 #     * POSIX: as defined by os-release(5)
1442 #     * Windows: contains string "Microsoft Windows"
1444 # @pretty-name:
1445 #     * POSIX: as defined by os-release(5)
1446 #     * Windows: product name, e.g. "Microsoft Windows 10 Enterprise"
1448 # @version:
1449 #     * POSIX: as defined by os-release(5)
1450 #     * Windows: long version string, e.g. "Microsoft Windows Server
1451 #       2008"
1453 # @version-id:
1454 #     * POSIX: as defined by os-release(5)
1455 #     * Windows: short version identifier, e.g. "7" or "20012r2"
1457 # @variant:
1458 #     * POSIX: as defined by os-release(5)
1459 #     * Windows: contains string "server" or "client"
1461 # @variant-id:
1462 #     * POSIX: as defined by os-release(5)
1463 #     * Windows: contains string "server" or "client"
1465 # .. note:: On POSIX systems the fields @id, @name, @pretty-name,
1466 #    @version, @version-id, @variant and @variant-id follow the
1467 #    definition specified in os-release(5). Refer to the manual page for
1468 #    exact description of the fields.  Their values are taken from the
1469 #    os-release file.  If the file is not present in the system, or the
1470 #    values are not present in the file, the fields are not included.
1472 #    On Windows the values are filled from information gathered from
1473 #    the system.
1475 # Since: 2.10
1477 { 'struct': 'GuestOSInfo',
1478   'data': {
1479       '*kernel-release': 'str', '*kernel-version': 'str',
1480       '*machine': 'str', '*id': 'str', '*name': 'str',
1481       '*pretty-name': 'str', '*version': 'str', '*version-id': 'str',
1482       '*variant': 'str', '*variant-id': 'str' } }
1485 # @guest-get-osinfo:
1487 # Retrieve guest operating system information
1489 # Returns: @GuestOSInfo
1491 # Since: 2.10
1493 { 'command': 'guest-get-osinfo',
1494   'returns': 'GuestOSInfo' }
1497 # @GuestDeviceType:
1499 # @pci: PCI device
1501 { 'enum': 'GuestDeviceType',
1502   'data': [ 'pci' ] }
1505 # @GuestDeviceIdPCI:
1507 # @vendor-id: vendor ID
1509 # @device-id: device ID
1511 # Since: 5.2
1513 { 'struct': 'GuestDeviceIdPCI',
1514   'data': { 'vendor-id': 'uint16', 'device-id': 'uint16' } }
1517 # @GuestDeviceId:
1519 # Id of the device
1521 # @type: device type
1523 # Since: 5.2
1525 { 'union': 'GuestDeviceId',
1526   'base': { 'type': 'GuestDeviceType' },
1527   'discriminator': 'type',
1528   'data': { 'pci': 'GuestDeviceIdPCI' } }
1531 # @GuestDeviceInfo:
1533 # @driver-name: name of the associated driver
1535 # @driver-date: driver release date, in nanoseconds since the epoch
1537 # @driver-version: driver version
1539 # @id: device ID
1541 # Since: 5.2
1543 { 'struct': 'GuestDeviceInfo',
1544   'data': {
1545       'driver-name': 'str',
1546       '*driver-date': 'int',
1547       '*driver-version': 'str',
1548       '*id': 'GuestDeviceId'
1549   } }
1552 # @guest-get-devices:
1554 # Retrieve information about device drivers in Windows guest
1556 # Returns: @GuestDeviceInfo
1558 # Since: 5.2
1560 { 'command': 'guest-get-devices',
1561   'returns': ['GuestDeviceInfo'] }
1564 # @GuestAuthorizedKeys:
1566 # @keys: public keys (in OpenSSH/sshd(8) authorized_keys format)
1568 # Since: 5.2
1570 { 'struct': 'GuestAuthorizedKeys',
1571   'data': {
1572       'keys': ['str']
1573   }
1577 # @guest-ssh-get-authorized-keys:
1579 # Return the public keys from user .ssh/authorized_keys on Unix
1580 # systems (not implemented for other systems).
1582 # @username: the user account to add the authorized keys
1584 # Returns: @GuestAuthorizedKeys
1586 # Since: 5.2
1588 { 'command': 'guest-ssh-get-authorized-keys',
1589   'data': { 'username': 'str' },
1590   'returns': 'GuestAuthorizedKeys'
1594 # @guest-ssh-add-authorized-keys:
1596 # Append public keys to user .ssh/authorized_keys on Unix systems (not
1597 # implemented for other systems).
1599 # @username: the user account to add the authorized keys
1601 # @keys: the public keys to add (in OpenSSH/sshd(8) authorized_keys
1602 #     format)
1604 # @reset: ignore the existing content, set it with the given keys only
1606 # Since: 5.2
1608 { 'command': 'guest-ssh-add-authorized-keys',
1609   'data': { 'username': 'str', 'keys': ['str'], '*reset': 'bool' }
1613 # @guest-ssh-remove-authorized-keys:
1615 # Remove public keys from the user .ssh/authorized_keys on Unix
1616 # systems (not implemented for other systems). It's not an error if
1617 # the key is already missing.
1619 # @username: the user account to remove the authorized keys
1621 # @keys: the public keys to remove (in OpenSSH/sshd(8) authorized_keys
1622 #     format)
1624 # Since: 5.2
1626 { 'command': 'guest-ssh-remove-authorized-keys',
1627   'data': { 'username': 'str', 'keys': ['str'] }
1631 # @GuestDiskStats:
1633 # @read-sectors: sectors read
1635 # @read-ios: reads completed successfully
1637 # @read-merges: read requests merged
1639 # @write-sectors: sectors written
1641 # @write-ios: writes completed
1643 # @write-merges: write requests merged
1645 # @discard-sectors: sectors discarded
1647 # @discard-ios: discards completed successfully
1649 # @discard-merges: discard requests merged
1651 # @flush-ios: flush requests completed successfully
1653 # @read-ticks: time spent reading(ms)
1655 # @write-ticks: time spent writing(ms)
1657 # @discard-ticks: time spent discarding(ms)
1659 # @flush-ticks: time spent flushing(ms)
1661 # @ios-pgr: number of I/Os currently in flight
1663 # @total-ticks: time spent doing I/Os (ms)
1665 # @weight-ticks: weighted time spent doing I/Os since the last update
1666 #     of this field(ms)
1668 # Since: 7.1
1670 { 'struct': 'GuestDiskStats',
1671   'data': {'*read-sectors': 'uint64',
1672            '*read-ios': 'uint64',
1673            '*read-merges': 'uint64',
1674            '*write-sectors': 'uint64',
1675            '*write-ios': 'uint64',
1676            '*write-merges': 'uint64',
1677            '*discard-sectors': 'uint64',
1678            '*discard-ios': 'uint64',
1679            '*discard-merges': 'uint64',
1680            '*flush-ios': 'uint64',
1681            '*read-ticks': 'uint64',
1682            '*write-ticks': 'uint64',
1683            '*discard-ticks': 'uint64',
1684            '*flush-ticks': 'uint64',
1685            '*ios-pgr': 'uint64',
1686            '*total-ticks': 'uint64',
1687            '*weight-ticks': 'uint64'
1688            } }
1691 # @GuestDiskStatsInfo:
1693 # @name: disk name
1695 # @major: major device number of disk
1697 # @minor: minor device number of disk
1699 # @stats: I/O statistics
1701 { 'struct': 'GuestDiskStatsInfo',
1702   'data': {'name': 'str',
1703            'major': 'uint64',
1704            'minor': 'uint64',
1705            'stats': 'GuestDiskStats' } }
1708 # @guest-get-diskstats:
1710 # Retrieve information about disk stats.
1712 # Returns: List of disk stats of guest.
1714 # Since: 7.1
1716 { 'command': 'guest-get-diskstats',
1717   'returns': ['GuestDiskStatsInfo']
1721 # @GuestCpuStatsType:
1723 # Guest operating systems supporting CPU statistics
1725 # @linux: Linux
1727 # Since: 7.1
1729 { 'enum': 'GuestCpuStatsType',
1730   'data': [ 'linux' ] }
1734 # @GuestLinuxCpuStats:
1736 # CPU statistics of Linux
1738 # @cpu: CPU index in guest OS
1740 # @user: Time spent in user mode
1742 # @nice: Time spent in user mode with low priority (nice)
1744 # @system: Time spent in system mode
1746 # @idle: Time spent in the idle task
1748 # @iowait: Time waiting for I/O to complete (since Linux 2.5.41)
1750 # @irq: Time servicing interrupts (since Linux 2.6.0-test4)
1752 # @softirq: Time servicing softirqs (since Linux 2.6.0-test4)
1754 # @steal: Stolen time by host (since Linux 2.6.11)
1756 # @guest: ime spent running a virtual CPU for guest operating systems
1757 #     under the  control of the Linux kernel (since Linux 2.6.24)
1759 # @guestnice: Time spent running a niced guest (since Linux 2.6.33)
1761 # Since: 7.1
1763 { 'struct': 'GuestLinuxCpuStats',
1764   'data': {'cpu': 'int',
1765            'user': 'uint64',
1766            'nice': 'uint64',
1767            'system': 'uint64',
1768            'idle': 'uint64',
1769            '*iowait': 'uint64',
1770            '*irq': 'uint64',
1771            '*softirq': 'uint64',
1772            '*steal': 'uint64',
1773            '*guest': 'uint64',
1774            '*guestnice': 'uint64'
1775            } }
1778 # @GuestCpuStats:
1780 # Get statistics of each CPU in millisecond.
1782 # @type: guest operating system
1784 # Since: 7.1
1786 { 'union': 'GuestCpuStats',
1787   'base': { 'type': 'GuestCpuStatsType' },
1788   'discriminator': 'type',
1789   'data': { 'linux': 'GuestLinuxCpuStats' } }
1792 # @guest-get-cpustats:
1794 # Retrieve information about CPU stats.
1796 # Returns: List of CPU stats of guest.
1798 # Since: 7.1
1800 { 'command': 'guest-get-cpustats',
1801   'returns': ['GuestCpuStats']