#Echo back a unique integer value
{ 'command': 'guest-sync',
'data': { 'id': 'int' },
'returns':'int' }
#Ping the guest agent, a non-error return implies success
{ 'command': 'guest-ping' }
#Get some information about the guest agent.
{ 'command': 'guest-info',
'returns':'GuestAgentInfo' }
##Information about guest agent
{ 'struct': 'GuestAgentInfo',
'data': {'version': 'str',
'supported_commands': ['GuestAgentCommandInfo'] } }
{ 'struct': 'GuestAgentCommandInfo',
'data': {'name': 'str', 'enabled': 'bool', 'success-response': 'bool' } }
#Initiate guest-activated shutdown. Note: this isan asynchronous shutdown request, with no guarantee of successful shutdown.
{ 'command': 'guest-shutdown', 'data': { '*mode':'str' },
'success-response': false }
##Open a file in the guest and retrieve a filehandle for it
{ 'command': 'guest-file-open',
'data': { 'path': 'str', '*mode': 'str' },
'returns':'int' }
##Close an open file in the guest
{ 'command': 'guest-file-close',
'data': {'handle': 'int' } }
##Read from an open file in the guest. Data willbe base64-encoded
{ 'command': 'guest-file-read',
'data': { 'handle': 'int','*count': 'int' },
'returns':'GuestFileRead' }
##Result of guest agent file-read operation
{ 'struct': 'GuestFileRead',
'data': {'count': 'int', 'buf-b64': 'str', 'eof': 'bool' } }
##Write to an open file in the guest
{ 'command': 'guest-file-write',
'data': { 'handle': 'int','buf-b64': 'str', '*count': 'int' },
'returns':'GuestFileWrite' }
##Result of guest agent file-write operation
{ 'struct': 'GuestFileWrite',
'data': {'count': 'int', 'eof': 'bool' } }
##Seek to a position in the file, as with fseek(),and return the current file position afterward. Alsoencapsulates ftell()'s functionality, just Set offset=0,whence=SEEK_CUR.
{ 'command': 'guest-file-seek',
'data': { 'handle': 'int','offset': 'int', 'whence': 'int' },
'returns':'GuestFileSeek' }
##Result of guest agent file-seek operation
{ 'struct': 'GuestFileSeek',
'data': {'position': 'int', 'eof': 'bool' } }
##Write file changes bufferred in userspace todisk/kernel buffers
{ 'command': 'guest-file-flush',
'data': {'handle': 'int' } }
##Get guest fsfreeze state. error state indicates
{ 'command': 'guest-fsfreeze-status',
'returns':'GuestFsfreezeStatus' }
##An enumeration of filesystem freeze states
{ 'enum': 'GuestFsfreezeStatus',
'data': ['thawed', 'frozen' ] }
##Sync and freeze all freezable, local guestfilesystems
{ 'command': 'guest-fsfreeze-freeze',
'returns':'int' }
##Unfreeze all frozen guest filesystems
{ 'command': 'guest-fsfreeze-thaw',
'returns':'int' }
##Echo back a unique integer value, and prepend to response a leadingsentinel byte (0xFF) the client can check scan for.
{ 'command': 'guest-sync-delimited',
'data': { 'id': 'int' },
'returns':'int' }
##Suspend guest to disk.
{ 'command': 'guest-suspend-disk','success-response': false }
##Suspend guest to ram
{ 'command': 'guest-suspend-ram','success-response': false }
##Save guest state to disk and suspend to ram.
{ 'command': 'guest-suspend-hybrid', 'success-response':false }
##Get list of guest IP addresses, MAC addresses and netmasks.
{ 'command': 'guest-network-get-interfaces',
'returns':['GuestNetworkInterface'] }
##An enumeration of supported IP address types
{ 'enum': 'GuestIpAddressType',
'data': ['ipv4', 'ipv6' ] }
##
{ 'struct': 'GuestIpAddress',
'data':{'ip-address': 'str',
'ip-address-type': 'GuestIpAddressType',
'prefix': 'int'} }
##
{ 'struct': 'GuestNetworkInterface',
'data':{'name': 'str',
'*hardware-address': 'str',
'*ip-addresses': ['GuestIpAddress'] } }
##Discard (or "trim") blocks which arenot in use by the filesystem.
{ 'command': 'guest-fstrim',
'data': {'*minimum': 'int' },
'returns':'GuestFilesystemTrimResponse' }
##Get the information about guest's System Timerelative to
{ 'command': 'guest-get-time',
'returns':'int' }
##Set guest time.
{ 'command': 'guest-set-time',
'data': {'*time': 'int' } }
##Retrieve the list of the guest's logicalprocessors.
{ 'command': 'guest-get-vcpus',
'returns':['GuestLogicalProcessor'] }
{ 'struct': 'GuestLogicalProcessor',
'data':{'logical-id': 'int',
'online': 'bool',
'*can-offline': 'bool'} }
##Attempt to reconfigure (currently:enable/disable) logical processors inside
# the guest.
{ 'command': 'guest-set-vcpus',
'data': {'vcpus': ['GuestLogicalProcessor'] },
'returns':'int' }
##Sync and freeze specified guest filesystems
{ 'command': 'guest-fsfreeze-freeze-list',
'data': { '*mountpoints':['str'] },
'returns':'int' }
##Returns: The list of filesystems information mounted in the guest.The returned mountpoints may be specified to guest-fsfreeze-freeze-list.Network filesystems (such as CIFS and NFS) are not listed.
{ 'command': 'guest-get-fsinfo',
'returns':['GuestFilesystemInfo'] }
##An enumeration of bus type of disks,'Unknown' and all entries below since 2.4
{ 'enum': 'GuestDiskBusType',
'data': [ 'ide','fdc', 'scsi', 'virtio', 'xen', 'usb', 'uml', 'sata',
'sd','unknown', 'ieee1394', 'ssa', 'fibre', 'raid', 'iscsi',
'sas','mmc', 'virtual', 'file-backed-virtual' ] }
##
{ 'struct': 'GuestPCIAddress',
'data': {'domain':'int', 'bus': 'int',
'slot':'int', 'function': 'int'} }
##
{ 'struct': 'GuestDiskAddress',
'data': {'pci-controller':'GuestPCIAddress',
'bus-type':'GuestDiskBusType',
'bus':'int', 'target': 'int', 'unit': 'int'} }
##
{ 'struct': 'GuestFilesystemInfo',
'data': {'name':'str', 'mountpoint': 'str', 'type': 'str',
'disk':['GuestDiskAddress']} }
## If the @crypted flag is true, it is the caller's responsibility to ensure the correct crypt() encryption scheme is used. This command does not attempt to interpret or reporton the encryption scheme. Refer to the documentation of the guestoperating system in question to determine what is supported.
{ 'command': 'guest-set-user-password',
'data': { 'username':'str', 'password': 'str', 'crypted': 'bool' } }
##Retrieve the list of the guest's memory blocks.
{ 'command': 'guest-get-memory-blocks',
'returns':['GuestMemoryBlock'] }
##
{ 'struct': 'GuestMemoryBlock',
'data': {'phys-index':'uint64',
'online':'bool',
'*can-offline':'bool'} }
## Attempt to reconfigure (currently:enable/disable) state of memory blocks
# inside the guest.
{ 'command': 'guest-set-memory-blocks',
'data': {'mem-blks': ['GuestMemoryBlock'] },
'returns':['GuestMemoryBlockResponse'] }
##response: the result of memory block operation.
{ 'struct': 'GuestMemoryBlockResponse',
'data': { 'phys-index':'uint64',
'response':'GuestMemoryBlockResponseType',
'*error-code':'int' }}
##An enumeration of memory block operation result.
{ 'enum': 'GuestMemoryBlockResponseType',
'data': ['success','not-found', 'operation-not-supported',
'operation-failed']}
##Get information relating to guest memory blocks
{ 'command': 'guest-get-memory-block-info',
'returns':'GuestMemoryBlockInfo' }
##
{ 'struct': 'GuestMemoryBlockInfo',
'data': {'size':'uint64'} }
{ 'struct': 'GuestFilesystemTrimResult',
'data':{'path': 'str',
'*trimmed': 'int', '*minimum': 'int', '*error': 'str'} }
{ 'struct': 'GuestFilesystemTrimResponse',
'data':{'paths': ['GuestFilesystemTrimResult']} }
详情见:https://github.com/qemu/qemu/blob/master/qga/qapi-schema.json