1 # *-*- Mode: Python -*-*
6 # General note concerning the use of guest agent interfaces:
8 # "unsupported" is a higher-level error than the errors that individual
9 # commands might document. The caller should always be prepared to receive
10 # QERR_UNSUPPORTED, even if the given command doesn't specify it, or doesn't
11 # document any failure mode at all.
15 { 'pragma': { 'doc-required': true } }
17 # Whitelists to permit QAPI rule violations; think twice before you
20 # Commands allowed to return a non-dictionary:
21 'returns-whitelist': [
23 'guest-fsfreeze-freeze',
24 'guest-fsfreeze-freeze-list',
25 'guest-fsfreeze-status',
26 'guest-fsfreeze-thaw',
30 'guest-sync-delimited' ] } }
33 # @guest-sync-delimited:
35 # Echo back a unique integer value, and prepend to response a
36 # leading sentinel byte (0xFF) the client can check scan for.
38 # This is used by clients talking to the guest agent over the
39 # wire to ensure the stream is in sync and doesn't contain stale
40 # data from previous client. It must be issued upon initial
41 # connection, and after any client-side timeouts (including
42 # timeouts on receiving a response to this command).
44 # After issuing this request, all guest agent responses should be
45 # ignored until the response containing the unique integer value
46 # the client passed in is returned. Receival of the 0xFF sentinel
47 # byte must be handled as an indication that the client's
48 # lexer/tokenizer/parser state should be flushed/reset in
49 # preparation for reliably receiving the subsequent response. As
50 # an optimization, clients may opt to ignore all data until a
51 # sentinel value is receiving to avoid unnecessary processing of
54 # Similarly, clients should also precede this *request*
55 # with a 0xFF byte to make sure the guest agent flushes any
56 # partially read JSON data from a previous client connection.
58 # @id: randomly generated 64-bit integer
60 # Returns: The unique integer id passed in by the client
64 { 'command': 'guest-sync-delimited',
65 'data': { 'id': 'int' },
71 # Echo back a unique integer value
73 # This is used by clients talking to the guest agent over the
74 # wire to ensure the stream is in sync and doesn't contain stale
75 # data from previous client. All guest agent responses should be
76 # ignored until the provided unique integer value is returned,
77 # and it is up to the client to handle stale whole or
78 # partially-delivered JSON text in such a way that this response
81 # In cases where a partial stale response was previously
82 # received by the client, this cannot always be done reliably.
83 # One particular scenario being if qemu-ga responses are fed
84 # character-by-character into a JSON parser. In these situations,
85 # using guest-sync-delimited may be optimal.
87 # For clients that fetch responses line by line and convert them
88 # to JSON objects, guest-sync should be sufficient, but note that
89 # in cases where the channel is dirty some attempts at parsing the
90 # response may result in a parser error.
92 # Such clients should also precede this command
93 # with a 0xFF byte to make sure the guest agent flushes any
94 # partially read JSON data from a previous session.
96 # @id: randomly generated 64-bit integer
98 # Returns: The unique integer id passed in by the client
102 { 'command': 'guest-sync',
103 'data': { 'id': 'int' },
109 # Ping the guest agent, a non-error return implies success
113 { 'command': 'guest-ping' }
118 # Get the information about guest's System Time relative to
119 # the Epoch of 1970-01-01 in UTC.
121 # Returns: Time in nanoseconds.
125 { 'command': 'guest-get-time',
133 # When a guest is paused or migrated to a file then loaded
134 # from that file, the guest OS has no idea that there
135 # was a big gap in the time. Depending on how long the
136 # gap was, NTP might not be able to resynchronize the
139 # This command tries to set guest's System Time to the
140 # given value, then sets the Hardware Clock (RTC) to the
141 # current System Time. This will make it easier for a guest
142 # to resynchronize without waiting for NTP. If no @time is
143 # specified, then the time to set is read from RTC. However,
144 # this may not be supported on all platforms (i.e. Windows).
145 # If that's the case users are advised to always pass a
148 # @time: time of nanoseconds, relative to the Epoch
149 # of 1970-01-01 in UTC.
151 # Returns: Nothing on success.
155 { 'command': 'guest-set-time',
156 'data': { '*time': 'int' } }
159 # @GuestAgentCommandInfo:
161 # Information about guest agent commands.
163 # @name: name of the command
165 # @enabled: whether command is currently enabled by guest admin
167 # @success-response: whether command returns a response on success
172 { 'struct': 'GuestAgentCommandInfo',
173 'data': { 'name': 'str', 'enabled': 'bool', 'success-response': 'bool' } }
178 # Information about guest agent.
180 # @version: guest agent version
182 # @supported_commands: Information about guest agent commands
186 { 'struct': 'GuestAgentInfo',
187 'data': { 'version': 'str',
188 'supported_commands': ['GuestAgentCommandInfo'] } }
192 # Get some information about the guest agent.
194 # Returns: @GuestAgentInfo
198 { 'command': 'guest-info',
199 'returns': 'GuestAgentInfo' }
204 # Initiate guest-activated shutdown. Note: this is an asynchronous
205 # shutdown request, with no guarantee of successful shutdown.
207 # @mode: "halt", "powerdown" (default), or "reboot"
209 # This command does NOT return a response on success. Success condition
210 # is indicated by the VM exiting with a zero exit status or, when
211 # running with --no-shutdown, by issuing the query-status QMP command
212 # to confirm the VM status is "shutdown".
216 { 'command': 'guest-shutdown', 'data': { '*mode': 'str' },
217 'success-response': false }
222 # Open a file in the guest and retrieve a file handle for it
224 # @path: Full path to the file in the guest to open.
226 # @mode: open mode, as per fopen(), "r" is the default.
228 # Returns: Guest file handle on success.
232 { 'command': 'guest-file-open',
233 'data': { 'path': 'str', '*mode': 'str' },
239 # Close an open file in the guest
241 # @handle: filehandle returned by guest-file-open
243 # Returns: Nothing on success.
247 { 'command': 'guest-file-close',
248 'data': { 'handle': 'int' } }
253 # Result of guest agent file-read operation
255 # @count: number of bytes read (note: count is *before*
256 # base64-encoding is applied)
258 # @buf-b64: base64-encoded bytes read
260 # @eof: whether EOF was encountered during read operation.
264 { 'struct': 'GuestFileRead',
265 'data': { 'count': 'int', 'buf-b64': 'str', 'eof': 'bool' } }
270 # Read from an open file in the guest. Data will be base64-encoded.
271 # As this command is just for limited, ad-hoc debugging, such as log
272 # file access, the number of bytes to read is limited to 48 MB.
274 # @handle: filehandle returned by guest-file-open
276 # @count: maximum number of bytes to read (default is 4KB, maximum is 48MB)
278 # Returns: @GuestFileRead on success.
282 { 'command': 'guest-file-read',
283 'data': { 'handle': 'int', '*count': 'int' },
284 'returns': 'GuestFileRead' }
289 # Result of guest agent file-write operation
291 # @count: number of bytes written (note: count is actual bytes
292 # written, after base64-decoding of provided buffer)
294 # @eof: whether EOF was encountered during write operation.
298 { 'struct': 'GuestFileWrite',
299 'data': { 'count': 'int', 'eof': 'bool' } }
304 # Write to an open file in the guest.
306 # @handle: filehandle returned by guest-file-open
308 # @buf-b64: base64-encoded string representing data to be written
310 # @count: bytes to write (actual bytes, after base64-decode),
311 # default is all content in buf-b64 buffer after base64 decoding
313 # Returns: @GuestFileWrite on success.
317 { 'command': 'guest-file-write',
318 'data': { 'handle': 'int', 'buf-b64': 'str', '*count': 'int' },
319 'returns': 'GuestFileWrite' }
325 # Result of guest agent file-seek operation
327 # @position: current file position
329 # @eof: whether EOF was encountered during file seek
333 { 'struct': 'GuestFileSeek',
334 'data': { 'position': 'int', 'eof': 'bool' } }
339 # Symbolic names for use in @guest-file-seek
341 # @set: Set to the specified offset (same effect as 'whence':0)
342 # @cur: Add offset to the current location (same effect as 'whence':1)
343 # @end: Add offset to the end of the file (same effect as 'whence':2)
347 { 'enum': 'QGASeek', 'data': [ 'set', 'cur', 'end' ] }
352 # Controls the meaning of offset to @guest-file-seek.
354 # @value: Integral value (0 for set, 1 for cur, 2 for end), available
355 # for historical reasons, and might differ from the host's or
356 # guest's SEEK_* values (since: 0.15)
357 # @name: Symbolic name, and preferred interface
361 { 'alternate': 'GuestFileWhence',
362 'data': { 'value': 'int', 'name': 'QGASeek' } }
367 # Seek to a position in the file, as with fseek(), and return the
368 # current file position afterward. Also encapsulates ftell()'s
369 # functionality, with offset=0 and whence=1.
371 # @handle: filehandle returned by guest-file-open
373 # @offset: bytes to skip over in the file stream
375 # @whence: Symbolic or numeric code for interpreting offset
377 # Returns: @GuestFileSeek on success.
381 { 'command': 'guest-file-seek',
382 'data': { 'handle': 'int', 'offset': 'int',
383 'whence': 'GuestFileWhence' },
384 'returns': 'GuestFileSeek' }
389 # Write file changes bufferred in userspace to disk/kernel buffers
391 # @handle: filehandle returned by guest-file-open
393 # Returns: Nothing on success.
397 { 'command': 'guest-file-flush',
398 'data': { 'handle': 'int' } }
401 # @GuestFsfreezeStatus:
403 # An enumeration of filesystem freeze states
405 # @thawed: filesystems thawed/unfrozen
407 # @frozen: all non-network guest filesystems frozen
411 { 'enum': 'GuestFsfreezeStatus',
412 'data': [ 'thawed', 'frozen' ] }
415 # @guest-fsfreeze-status:
417 # Get guest fsfreeze state. error state indicates
419 # Returns: GuestFsfreezeStatus ("thawed", "frozen", etc., as defined below)
421 # Note: This may fail to properly report the current state as a result of
422 # some other guest processes having issued an fs freeze/thaw.
426 { 'command': 'guest-fsfreeze-status',
427 'returns': 'GuestFsfreezeStatus' }
430 # @guest-fsfreeze-freeze:
432 # Sync and freeze all freezable, local guest filesystems. If this
433 # command succeeded, you may call @guest-fsfreeze-thaw later to
436 # Note: On Windows, the command is implemented with the help of a
437 # Volume Shadow-copy Service DLL helper. The frozen state is limited
438 # for up to 10 seconds by VSS.
440 # Returns: Number of file systems currently frozen. On error, all filesystems
441 # will be thawed. If no filesystems are frozen as a result of this call,
442 # then @guest-fsfreeze-status will remain "thawed" and calling
443 # @guest-fsfreeze-thaw is not necessary.
447 { 'command': 'guest-fsfreeze-freeze',
451 # @guest-fsfreeze-freeze-list:
453 # Sync and freeze specified guest filesystems.
454 # See also @guest-fsfreeze-freeze.
456 # @mountpoints: an array of mountpoints of filesystems to be frozen.
457 # If omitted, every mounted filesystem is frozen.
458 # Invalid mount points are ignored.
460 # Returns: Number of file systems currently frozen. On error, all filesystems
465 { 'command': 'guest-fsfreeze-freeze-list',
466 'data': { '*mountpoints': ['str'] },
470 # @guest-fsfreeze-thaw:
472 # Unfreeze all frozen guest filesystems
474 # Returns: Number of file systems thawed by this call
476 # Note: if return value does not match the previous call to
477 # guest-fsfreeze-freeze, this likely means some freezable
478 # filesystems were unfrozen before this call, and that the
479 # filesystem state may have changed before issuing this
484 { 'command': 'guest-fsfreeze-thaw',
488 # @GuestFilesystemTrimResult:
490 # @path: path that was trimmed
491 # @error: an error message when trim failed
492 # @trimmed: bytes trimmed for this path
493 # @minimum: reported effective minimum for this path
497 { 'struct': 'GuestFilesystemTrimResult',
498 'data': {'path': 'str',
499 '*trimmed': 'int', '*minimum': 'int', '*error': 'str'} }
502 # @GuestFilesystemTrimResponse:
504 # @paths: list of @GuestFilesystemTrimResult per path that was trimmed
508 { 'struct': 'GuestFilesystemTrimResponse',
509 'data': {'paths': ['GuestFilesystemTrimResult']} }
514 # Discard (or "trim") blocks which are not in use by the filesystem.
516 # @minimum: Minimum contiguous free range to discard, in bytes. Free ranges
517 # smaller than this may be ignored (this is a hint and the guest
518 # may not respect it). By increasing this value, the fstrim
519 # operation will complete more quickly for filesystems with badly
520 # fragmented free space, although not all blocks will be discarded.
521 # The default value is zero, meaning "discard every free block".
523 # Returns: A @GuestFilesystemTrimResponse which contains the
524 # status of all trimmed paths. (since 2.4)
528 { 'command': 'guest-fstrim',
529 'data': { '*minimum': 'int' },
530 'returns': 'GuestFilesystemTrimResponse' }
533 # @guest-suspend-disk:
535 # Suspend guest to disk.
537 # This command attempts to suspend the guest using three strategies, in this
540 # - systemd hibernate
541 # - pm-utils (via pm-hibernate)
542 # - manual write into sysfs
544 # This command does NOT return a response on success. There is a high chance
545 # the command succeeded if the VM exits with a zero exit status or, when
546 # running with --no-shutdown, by issuing the query-status QMP command to
547 # to confirm the VM status is "shutdown". However, the VM could also exit
548 # (or set its status to "shutdown") due to other reasons.
550 # The following errors may be returned:
552 # - If suspend to disk is not supported, Unsupported
554 # Notes: It's strongly recommended to issue the guest-sync command before
555 # sending commands when the guest resumes
559 { 'command': 'guest-suspend-disk', 'success-response': false }
562 # @guest-suspend-ram:
564 # Suspend guest to ram.
566 # This command attempts to suspend the guest using three strategies, in this
570 # - pm-utils (via pm-suspend)
571 # - manual write into sysfs
573 # IMPORTANT: guest-suspend-ram requires working wakeup support in
574 # QEMU. You should check QMP command query-current-machine returns
575 # wakeup-suspend-support: true before issuing this command. Failure in
576 # doing so can result in a suspended guest that QEMU will not be able to
577 # awaken, forcing the user to power cycle the guest to bring it back.
579 # This command does NOT return a response on success. There are two options
580 # to check for success:
582 # 1. Wait for the SUSPEND QMP event from QEMU
583 # 2. Issue the query-status QMP command to confirm the VM status is
586 # The following errors may be returned:
588 # - If suspend to ram is not supported, Unsupported
590 # Notes: It's strongly recommended to issue the guest-sync command before
591 # sending commands when the guest resumes
595 { 'command': 'guest-suspend-ram', 'success-response': false }
598 # @guest-suspend-hybrid:
600 # Save guest state to disk and suspend to ram.
602 # This command attempts to suspend the guest by executing, in this order:
604 # - systemd hybrid-sleep
605 # - pm-utils (via pm-suspend-hybrid)
607 # IMPORTANT: guest-suspend-hybrid requires working wakeup support in
608 # QEMU. You should check QMP command query-current-machine returns
609 # wakeup-suspend-support: true before issuing this command. Failure in
610 # doing so can result in a suspended guest that QEMU will not be able to
611 # awaken, forcing the user to power cycle the guest to bring it back.
613 # This command does NOT return a response on success. There are two options
614 # to check for success:
616 # 1. Wait for the SUSPEND QMP event from QEMU
617 # 2. Issue the query-status QMP command to confirm the VM status is
620 # The following errors may be returned:
622 # - If hybrid suspend is not supported, Unsupported
624 # Notes: It's strongly recommended to issue the guest-sync command before
625 # sending commands when the guest resumes
629 { 'command': 'guest-suspend-hybrid', 'success-response': false }
632 # @GuestIpAddressType:
634 # An enumeration of supported IP address types
636 # @ipv4: IP version 4
638 # @ipv6: IP version 6
642 { 'enum': 'GuestIpAddressType',
643 'data': [ 'ipv4', 'ipv6' ] }
648 # @ip-address: IP address
650 # @ip-address-type: Type of @ip-address (e.g. ipv4, ipv6)
652 # @prefix: Network prefix length of @ip-address
656 { 'struct': 'GuestIpAddress',
657 'data': {'ip-address': 'str',
658 'ip-address-type': 'GuestIpAddressType',
662 # @GuestNetworkInterfaceStat:
664 # @rx-bytes: total bytes received
666 # @rx-packets: total packets received
668 # @rx-errs: bad packets received
670 # @rx-dropped: receiver dropped packets
672 # @tx-bytes: total bytes transmitted
674 # @tx-packets: total packets transmitted
676 # @tx-errs: packet transmit problems
678 # @tx-dropped: dropped packets transmitted
682 { 'struct': 'GuestNetworkInterfaceStat',
683 'data': {'rx-bytes': 'uint64',
684 'rx-packets': 'uint64',
686 'rx-dropped': 'uint64',
687 'tx-bytes': 'uint64',
688 'tx-packets': 'uint64',
690 'tx-dropped': 'uint64'
694 # @GuestNetworkInterface:
696 # @name: The name of interface for which info are being delivered
698 # @hardware-address: Hardware address of @name
700 # @ip-addresses: List of addresses assigned to @name
702 # @statistics: various statistic counters related to @name
707 { 'struct': 'GuestNetworkInterface',
708 'data': {'name': 'str',
709 '*hardware-address': 'str',
710 '*ip-addresses': ['GuestIpAddress'],
711 '*statistics': 'GuestNetworkInterfaceStat' } }
714 # @guest-network-get-interfaces:
716 # Get list of guest IP addresses, MAC addresses
719 # Returns: List of GuestNetworkInfo on success.
723 { 'command': 'guest-network-get-interfaces',
724 'returns': ['GuestNetworkInterface'] }
727 # @GuestLogicalProcessor:
729 # @logical-id: Arbitrary guest-specific unique identifier of the VCPU.
731 # @online: Whether the VCPU is enabled.
733 # @can-offline: Whether offlining the VCPU is possible. This member
734 # is always filled in by the guest agent when the structure is
735 # returned, and always ignored on input (hence it can be omitted
740 { 'struct': 'GuestLogicalProcessor',
741 'data': {'logical-id': 'int',
743 '*can-offline': 'bool'} }
748 # Retrieve the list of the guest's logical processors.
750 # This is a read-only operation.
752 # Returns: The list of all VCPUs the guest knows about. Each VCPU is put on the
753 # list exactly once, but their order is unspecified.
757 { 'command': 'guest-get-vcpus',
758 'returns': ['GuestLogicalProcessor'] }
763 # Attempt to reconfigure (currently: enable/disable) logical processors inside
766 # The input list is processed node by node in order. In each node @logical-id
767 # is used to look up the guest VCPU, for which @online specifies the requested
768 # state. The set of distinct @logical-id's is only required to be a subset of
769 # the guest-supported identifiers. There's no restriction on list length or on
770 # repeating the same @logical-id (with possibly different @online field).
771 # Preferably the input list should describe a modified subset of
772 # @guest-get-vcpus' return value.
774 # Returns: The length of the initial sublist that has been successfully
775 # processed. The guest agent maximizes this value. Possible cases:
778 # if the @vcpus list was empty on input. Guest state
779 # has not been changed. Otherwise,
781 # processing the first node of @vcpus failed for the
782 # reason returned. Guest state has not been changed.
784 # - < length(@vcpus):
785 # more than zero initial nodes have been processed,
786 # but not the entire @vcpus list. Guest state has
787 # changed accordingly. To retrieve the error
788 # (assuming it persists), repeat the call with the
789 # successfully processed initial sublist removed.
796 { 'command': 'guest-set-vcpus',
797 'data': {'vcpus': ['GuestLogicalProcessor'] },
803 # An enumeration of bus type of disks
808 # @virtio: virtio disks
814 # @unknown: Unknown bus type
815 # @ieee1394: Win IEEE 1394 bus type
816 # @ssa: Win SSA bus type
817 # @fibre: Win fiber channel bus type
818 # @raid: Win RAID bus type
819 # @iscsi: Win iScsi bus type
820 # @sas: Win serial-attaches SCSI bus type
821 # @mmc: Win multimedia card (MMC) bus type
822 # @virtual: Win virtual bus type
823 # @file-backed-virtual: Win file-backed bus type
825 # Since: 2.2; 'Unknown' and all entries below since 2.4
827 { 'enum': 'GuestDiskBusType',
828 'data': [ 'ide', 'fdc', 'scsi', 'virtio', 'xen', 'usb', 'uml', 'sata',
829 'sd', 'unknown', 'ieee1394', 'ssa', 'fibre', 'raid', 'iscsi',
830 'sas', 'mmc', 'virtual', 'file-backed-virtual' ] }
839 # @function: function id
843 { 'struct': 'GuestPCIAddress',
844 'data': {'domain': 'int', 'bus': 'int',
845 'slot': 'int', 'function': 'int'} }
850 # @pci-controller: controller's PCI address (fields are set to -1 if invalid)
851 # @bus-type: bus type
855 # @serial: serial number (since: 3.1)
856 # @dev: device node (POSIX) or device UNC (Windows) (since: 3.1)
860 { 'struct': 'GuestDiskAddress',
861 'data': {'pci-controller': 'GuestPCIAddress',
862 'bus-type': 'GuestDiskBusType',
863 'bus': 'int', 'target': 'int', 'unit': 'int',
864 '*serial': 'str', '*dev': 'str'} }
867 # @GuestFilesystemInfo:
870 # @mountpoint: mount point path
871 # @type: file system type string
872 # @used-bytes: file system used bytes (since 3.0)
873 # @total-bytes: non-root file system total bytes (since 3.0)
874 # @disk: an array of disk hardware information that the volume lies on,
875 # which may be empty if the disk type is not supported
879 { 'struct': 'GuestFilesystemInfo',
880 'data': {'name': 'str', 'mountpoint': 'str', 'type': 'str',
881 '*used-bytes': 'uint64', '*total-bytes': 'uint64',
882 'disk': ['GuestDiskAddress']} }
887 # Returns: The list of filesystems information mounted in the guest.
888 # The returned mountpoints may be specified to
889 # @guest-fsfreeze-freeze-list.
890 # Network filesystems (such as CIFS and NFS) are not listed.
894 { 'command': 'guest-get-fsinfo',
895 'returns': ['GuestFilesystemInfo'] }
898 # @guest-set-user-password:
900 # @username: the user account whose password to change
901 # @password: the new password entry string, base64 encoded
902 # @crypted: true if password is already crypt()d, false if raw
904 # If the @crypted flag is true, it is the caller's responsibility
905 # to ensure the correct crypt() encryption scheme is used. This
906 # command does not attempt to interpret or report on the encryption
907 # scheme. Refer to the documentation of the guest operating system
908 # in question to determine what is supported.
910 # Not all guest operating systems will support use of the
911 # @crypted flag, as they may require the clear-text password
913 # The @password parameter must always be base64 encoded before
914 # transmission, even if already crypt()d, to ensure it is 8-bit
915 # safe when passed as JSON.
917 # Returns: Nothing on success.
921 { 'command': 'guest-set-user-password',
922 'data': { 'username': 'str', 'password': 'str', 'crypted': 'bool' } }
927 # @phys-index: Arbitrary guest-specific unique identifier of the MEMORY BLOCK.
929 # @online: Whether the MEMORY BLOCK is enabled in guest.
931 # @can-offline: Whether offlining the MEMORY BLOCK is possible.
932 # This member is always filled in by the guest agent when the
933 # structure is returned, and always ignored on input (hence it
934 # can be omitted then).
938 { 'struct': 'GuestMemoryBlock',
939 'data': {'phys-index': 'uint64',
941 '*can-offline': 'bool'} }
944 # @guest-get-memory-blocks:
946 # Retrieve the list of the guest's memory blocks.
948 # This is a read-only operation.
950 # Returns: The list of all memory blocks the guest knows about.
951 # Each memory block is put on the list exactly once, but their order
956 { 'command': 'guest-get-memory-blocks',
957 'returns': ['GuestMemoryBlock'] }
960 # @GuestMemoryBlockResponseType:
962 # An enumeration of memory block operation result.
964 # @success: the operation of online/offline memory block is successful.
965 # @not-found: can't find the corresponding memoryXXX directory in sysfs.
966 # @operation-not-supported: for some old kernels, it does not support
967 # online or offline memory block.
968 # @operation-failed: the operation of online/offline memory block fails,
969 # because of some errors happen.
973 { 'enum': 'GuestMemoryBlockResponseType',
974 'data': ['success', 'not-found', 'operation-not-supported',
975 'operation-failed'] }
978 # @GuestMemoryBlockResponse:
980 # @phys-index: same with the 'phys-index' member of @GuestMemoryBlock.
982 # @response: the result of memory block operation.
984 # @error-code: the error number.
985 # When memory block operation fails, we assign the value of
986 # 'errno' to this member, it indicates what goes wrong.
987 # When the operation succeeds, it will be omitted.
991 { 'struct': 'GuestMemoryBlockResponse',
992 'data': { 'phys-index': 'uint64',
993 'response': 'GuestMemoryBlockResponseType',
994 '*error-code': 'int' }}
997 # @guest-set-memory-blocks:
999 # Attempt to reconfigure (currently: enable/disable) state of memory blocks
1002 # The input list is processed node by node in order. In each node @phys-index
1003 # is used to look up the guest MEMORY BLOCK, for which @online specifies the
1004 # requested state. The set of distinct @phys-index's is only required to be a
1005 # subset of the guest-supported identifiers. There's no restriction on list
1006 # length or on repeating the same @phys-index (with possibly different @online
1008 # Preferably the input list should describe a modified subset of
1009 # @guest-get-memory-blocks' return value.
1011 # Returns: The operation results, it is a list of @GuestMemoryBlockResponse,
1012 # which is corresponding to the input list.
1014 # Note: it will return NULL if the @mem-blks list was empty on input,
1015 # or there is an error, and in this case, guest state will not be
1020 { 'command': 'guest-set-memory-blocks',
1021 'data': {'mem-blks': ['GuestMemoryBlock'] },
1022 'returns': ['GuestMemoryBlockResponse'] }
1025 # @GuestMemoryBlockInfo:
1027 # @size: the size (in bytes) of the guest memory blocks,
1028 # which are the minimal units of memory block online/offline
1029 # operations (also called Logical Memory Hotplug).
1033 { 'struct': 'GuestMemoryBlockInfo',
1034 'data': {'size': 'uint64'} }
1037 # @guest-get-memory-block-info:
1039 # Get information relating to guest memory blocks.
1041 # Returns: @GuestMemoryBlockInfo
1045 { 'command': 'guest-get-memory-block-info',
1046 'returns': 'GuestMemoryBlockInfo' }
1051 # @exited: true if process has already terminated.
1052 # @exitcode: process exit code if it was normally terminated.
1053 # @signal: signal number (linux) or unhandled exception code
1054 # (windows) if the process was abnormally terminated.
1055 # @out-data: base64-encoded stdout of the process
1056 # @err-data: base64-encoded stderr of the process
1057 # Note: @out-data and @err-data are present only
1058 # if 'capture-output' was specified for 'guest-exec'
1059 # @out-truncated: true if stdout was not fully captured
1060 # due to size limitation.
1061 # @err-truncated: true if stderr was not fully captured
1062 # due to size limitation.
1066 { 'struct': 'GuestExecStatus',
1067 'data': { 'exited': 'bool', '*exitcode': 'int', '*signal': 'int',
1068 '*out-data': 'str', '*err-data': 'str',
1069 '*out-truncated': 'bool', '*err-truncated': 'bool' }}
1071 # @guest-exec-status:
1073 # Check status of process associated with PID retrieved via guest-exec.
1074 # Reap the process and associated metadata if it has exited.
1076 # @pid: pid returned from guest-exec
1078 # Returns: GuestExecStatus on success.
1082 { 'command': 'guest-exec-status',
1083 'data': { 'pid': 'int' },
1084 'returns': 'GuestExecStatus' }
1088 # @pid: pid of child process in guest OS
1092 { 'struct': 'GuestExec',
1093 'data': { 'pid': 'int'} }
1098 # Execute a command in the guest
1100 # @path: path or executable name to execute
1101 # @arg: argument list to pass to executable
1102 # @env: environment variables to pass to executable
1103 # @input-data: data to be passed to process stdin (base64 encoded)
1104 # @capture-output: bool flag to enable capture of
1105 # stdout/stderr of running process. defaults to false.
1107 # Returns: PID on success.
1111 { 'command': 'guest-exec',
1112 'data': { 'path': 'str', '*arg': ['str'], '*env': ['str'],
1113 '*input-data': 'str', '*capture-output': 'bool' },
1114 'returns': 'GuestExec' }
1119 # @host-name: Fully qualified domain name of the guest OS
1123 { 'struct': 'GuestHostName',
1124 'data': { 'host-name': 'str' } }
1127 # @guest-get-host-name:
1129 # Return a name for the machine.
1131 # The returned name is not necessarily a fully-qualified domain name, or even
1132 # present in DNS or some other name service at all. It need not even be unique
1133 # on your local network or site, but usually it is.
1135 # Returns: the host name of the machine on success
1139 { 'command': 'guest-get-host-name',
1140 'returns': 'GuestHostName' }
1146 # @domain: Logon domain (windows only)
1147 # @login-time: Time of login of this user on the computer. If multiple
1148 # instances of the user are logged in, the earliest login time is
1149 # reported. The value is in fractional seconds since epoch time.
1153 { 'struct': 'GuestUser',
1154 'data': { 'user': 'str', 'login-time': 'number', '*domain': 'str' } }
1158 # Retrieves a list of currently active users on the VM.
1160 # Returns: A unique list of users.
1164 { 'command': 'guest-get-users',
1165 'returns': ['GuestUser'] }
1170 # @zone: Timezone name. These values may differ depending on guest/OS and
1171 # should only be used for informational purposes.
1172 # @offset: Offset to UTC in seconds, negative numbers for time zones west of
1173 # GMT, positive numbers for east
1177 { 'struct': 'GuestTimezone',
1178 'data': { '*zone': 'str', 'offset': 'int' } }
1181 # @guest-get-timezone:
1183 # Retrieves the timezone information from the guest.
1185 # Returns: A GuestTimezone dictionary.
1189 { 'command': 'guest-get-timezone',
1190 'returns': 'GuestTimezone' }
1196 # * POSIX: release field returned by uname(2)
1197 # * Windows: build number of the OS
1199 # * POSIX: version field returned by uname(2)
1200 # * Windows: version number of the OS
1202 # * POSIX: machine field returned by uname(2)
1203 # * Windows: one of x86, x86_64, arm, ia64
1205 # * POSIX: as defined by os-release(5)
1206 # * Windows: contains string "mswindows"
1208 # * POSIX: as defined by os-release(5)
1209 # * Windows: contains string "Microsoft Windows"
1211 # * POSIX: as defined by os-release(5)
1212 # * Windows: product name, e.g. "Microsoft Windows 10 Enterprise"
1214 # * POSIX: as defined by os-release(5)
1215 # * Windows: long version string, e.g. "Microsoft Windows Server 2008"
1217 # * POSIX: as defined by os-release(5)
1218 # * Windows: short version identifier, e.g. "7" or "20012r2"
1220 # * POSIX: as defined by os-release(5)
1221 # * Windows: contains string "server" or "client"
1223 # * POSIX: as defined by os-release(5)
1224 # * Windows: contains string "server" or "client"
1228 # On POSIX systems the fields @id, @name, @pretty-name, @version, @version-id,
1229 # @variant and @variant-id follow the definition specified in os-release(5).
1230 # Refer to the manual page for exact description of the fields. Their values
1231 # are taken from the os-release file. If the file is not present in the system,
1232 # or the values are not present in the file, the fields are not included.
1234 # On Windows the values are filled from information gathered from the system.
1238 { 'struct': 'GuestOSInfo',
1240 '*kernel-release': 'str', '*kernel-version': 'str',
1241 '*machine': 'str', '*id': 'str', '*name': 'str',
1242 '*pretty-name': 'str', '*version': 'str', '*version-id': 'str',
1243 '*variant': 'str', '*variant-id': 'str' } }
1246 # @guest-get-osinfo:
1248 # Retrieve guest operating system information
1250 # Returns: @GuestOSInfo
1254 { 'command': 'guest-get-osinfo',
1255 'returns': 'GuestOSInfo' }