crypto: fix build with gcrypt enabled
[qemu/ar7.git] / qga / qapi-schema.json
blobb1e9ed836de77ed9684a41391e2f45b2e6f3238e
1 # *-*- Mode: Python -*-*
2 # vim: filetype=python
4 ##
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
18 # add to them!
19 { 'pragma': {
20     # Commands allowed to return a non-dictionary:
21     'returns-whitelist': [
22         'guest-file-open',
23         'guest-fsfreeze-freeze',
24         'guest-fsfreeze-freeze-list',
25         'guest-fsfreeze-status',
26         'guest-fsfreeze-thaw',
27         'guest-get-time',
28         'guest-set-vcpus',
29         'guest-sync',
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
52 # stale data.
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
62 # Since: 1.1
64 { 'command': 'guest-sync-delimited',
65   'data':    { 'id': 'int' },
66   'returns': 'int' }
69 # @guest-sync:
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
79 # can be obtained.
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
100 # Since: 0.15.0
102 { 'command': 'guest-sync',
103   'data':    { 'id': 'int' },
104   'returns': 'int' }
107 # @guest-ping:
109 # Ping the guest agent, a non-error return implies success
111 # Since: 0.15.0
113 { 'command': 'guest-ping' }
116 # @guest-get-time:
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.
123 # Since: 1.5
125 { 'command': 'guest-get-time',
126   'returns': 'int' }
129 # @guest-set-time:
131 # Set guest 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
137 # guest.
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
146 # value.
148 # @time: time of nanoseconds, relative to the Epoch
149 #        of 1970-01-01 in UTC.
151 # Returns: Nothing on success.
153 # Since: 1.5
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
168 #                    (since 1.7)
170 # Since: 1.1.0
172 { 'struct': 'GuestAgentCommandInfo',
173   'data': { 'name': 'str', 'enabled': 'bool', 'success-response': 'bool' } }
176 # @GuestAgentInfo:
178 # Information about guest agent.
180 # @version: guest agent version
182 # @supported_commands: Information about guest agent commands
184 # Since: 0.15.0
186 { 'struct': 'GuestAgentInfo',
187   'data': { 'version': 'str',
188             'supported_commands': ['GuestAgentCommandInfo'] } }
190 # @guest-info:
192 # Get some information about the guest agent.
194 # Returns: @GuestAgentInfo
196 # Since: 0.15.0
198 { 'command': 'guest-info',
199   'returns': 'GuestAgentInfo' }
202 # @guest-shutdown:
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".
214 # Since: 0.15.0
216 { 'command': 'guest-shutdown', 'data': { '*mode': 'str' },
217   'success-response': false }
220 # @guest-file-open:
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.
230 # Since: 0.15.0
232 { 'command': 'guest-file-open',
233   'data':    { 'path': 'str', '*mode': 'str' },
234   'returns': 'int' }
237 # @guest-file-close:
239 # Close an open file in the guest
241 # @handle: filehandle returned by guest-file-open
243 # Returns: Nothing on success.
245 # Since: 0.15.0
247 { 'command': 'guest-file-close',
248   'data': { 'handle': 'int' } }
251 # @GuestFileRead:
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.
262 # Since: 0.15.0
264 { 'struct': 'GuestFileRead',
265   'data': { 'count': 'int', 'buf-b64': 'str', 'eof': 'bool' } }
268 # @guest-file-read:
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.
280 # Since: 0.15.0
282 { 'command': 'guest-file-read',
283   'data':    { 'handle': 'int', '*count': 'int' },
284   'returns': 'GuestFileRead' }
287 # @GuestFileWrite:
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.
296 # Since: 0.15.0
298 { 'struct': 'GuestFileWrite',
299   'data': { 'count': 'int', 'eof': 'bool' } }
302 # @guest-file-write:
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.
315 # Since: 0.15.0
317 { 'command': 'guest-file-write',
318   'data':    { 'handle': 'int', 'buf-b64': 'str', '*count': 'int' },
319   'returns': 'GuestFileWrite' }
323 # @GuestFileSeek:
325 # Result of guest agent file-seek operation
327 # @position: current file position
329 # @eof: whether EOF was encountered during file seek
331 # Since: 0.15.0
333 { 'struct': 'GuestFileSeek',
334   'data': { 'position': 'int', 'eof': 'bool' } }
337 # @QGASeek:
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)
345 # Since: 2.6
347 { 'enum': 'QGASeek', 'data': [ 'set', 'cur', 'end' ] }
350 # @GuestFileWhence:
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
359 # Since: 2.6
361 { 'alternate': 'GuestFileWhence',
362   'data': { 'value': 'int', 'name': 'QGASeek' } }
365 # @guest-file-seek:
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.
379 # Since: 0.15.0
381 { 'command': 'guest-file-seek',
382   'data':    { 'handle': 'int', 'offset': 'int',
383                'whence': 'GuestFileWhence' },
384   'returns': 'GuestFileSeek' }
387 # @guest-file-flush:
389 # Write file changes bufferred in userspace to disk/kernel buffers
391 # @handle: filehandle returned by guest-file-open
393 # Returns: Nothing on success.
395 # Since: 0.15.0
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
409 # Since: 0.15.0
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.
424 # Since: 0.15.0
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
434 # unfreeze.
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.
445 # Since: 0.15.0
447 { 'command': 'guest-fsfreeze-freeze',
448   'returns': 'int' }
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
461 #          will be thawed.
463 # Since: 2.2
465 { 'command': 'guest-fsfreeze-freeze-list',
466   'data':    { '*mountpoints': ['str'] },
467   'returns': 'int' }
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
480 #       command.
482 # Since: 0.15.0
484 { 'command': 'guest-fsfreeze-thaw',
485   'returns': 'int' }
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
495 # Since: 2.4
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
506 # Since: 2.4
508 { 'struct': 'GuestFilesystemTrimResponse',
509   'data': {'paths': ['GuestFilesystemTrimResult']} }
512 # @guest-fstrim:
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)
526 # Since: 1.2
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
538 # order:
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
557 # Since: 1.1
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
567 # order:
569 # - systemd suspend
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
584 #    "suspended"
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
593 # Since: 1.1
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
618 #    "suspended"
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
627 # Since: 1.1
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
640 # Since: 1.1
642 { 'enum': 'GuestIpAddressType',
643   'data': [ 'ipv4', 'ipv6' ] }
646 # @GuestIpAddress:
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
654 # Since: 1.1
656 { 'struct': 'GuestIpAddress',
657   'data': {'ip-address': 'str',
658            'ip-address-type': 'GuestIpAddressType',
659            'prefix': 'int'} }
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
680 # Since: 2.11
682 { 'struct': 'GuestNetworkInterfaceStat',
683   'data': {'rx-bytes': 'uint64',
684             'rx-packets': 'uint64',
685             'rx-errs': 'uint64',
686             'rx-dropped': 'uint64',
687             'tx-bytes': 'uint64',
688             'tx-packets': 'uint64',
689             'tx-errs': 'uint64',
690             'tx-dropped': 'uint64'
691            } }
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
703 #              (since 2.11)
705 # Since: 1.1
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
717 # and netmasks.
719 # Returns: List of GuestNetworkInfo on success.
721 # Since: 1.1
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
736 #               then).
738 # Since: 1.5
740 { 'struct': 'GuestLogicalProcessor',
741   'data': {'logical-id': 'int',
742            'online': 'bool',
743            '*can-offline': 'bool'} }
746 # @guest-get-vcpus:
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.
755 # Since: 1.5
757 { 'command': 'guest-get-vcpus',
758   'returns': ['GuestLogicalProcessor'] }
761 # @guest-set-vcpus:
763 # Attempt to reconfigure (currently: enable/disable) logical processors inside
764 # the guest.
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:
777 #          - 0:
778 #            if the @vcpus list was empty on input. Guest state
779 #            has not been changed. Otherwise,
780 #          - Error:
781 #            processing the first node of @vcpus failed for the
782 #            reason returned. Guest state has not been changed.
783 #            Otherwise,
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.
790 #            Otherwise,
791 #          - length(@vcpus):
792 #            call successful.
794 # Since: 1.5
796 { 'command': 'guest-set-vcpus',
797   'data':    {'vcpus': ['GuestLogicalProcessor'] },
798   'returns': 'int' }
801 # @GuestDiskBusType:
803 # An enumeration of bus type of disks
805 # @ide: IDE disks
806 # @fdc: floppy disks
807 # @scsi: SCSI disks
808 # @virtio: virtio disks
809 # @xen: Xen disks
810 # @usb: USB disks
811 # @uml: UML disks
812 # @sata: SATA disks
813 # @sd: SD cards
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' ] }
834 # @GuestPCIAddress:
836 # @domain: domain id
837 # @bus: bus id
838 # @slot: slot id
839 # @function: function id
841 # Since: 2.2
843 { 'struct': 'GuestPCIAddress',
844   'data': {'domain': 'int', 'bus': 'int',
845            'slot': 'int', 'function': 'int'} }
848 # @GuestDiskAddress:
850 # @pci-controller: controller's PCI address (fields are set to -1 if invalid)
851 # @bus-type: bus type
852 # @bus: bus id
853 # @target: target id
854 # @unit: unit id
855 # @serial: serial number (since: 3.1)
856 # @dev: device node (POSIX) or device UNC (Windows) (since: 3.1)
858 # Since: 2.2
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:
869 # @name: disk name
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
877 # Since: 2.2
879 { 'struct': 'GuestFilesystemInfo',
880   'data': {'name': 'str', 'mountpoint': 'str', 'type': 'str',
881            '*used-bytes': 'uint64', '*total-bytes': 'uint64',
882            'disk': ['GuestDiskAddress']} }
885 # @guest-get-fsinfo:
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.
892 # Since: 2.2
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.
919 # Since: 2.3
921 { 'command': 'guest-set-user-password',
922   'data': { 'username': 'str', 'password': 'str', 'crypted': 'bool' } }
925 # @GuestMemoryBlock:
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).
936 # Since: 2.3
938 { 'struct': 'GuestMemoryBlock',
939   'data': {'phys-index': 'uint64',
940            'online': 'bool',
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
952 #          is unspecified.
954 # Since: 2.3
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.
971 # Since: 2.3
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.
989 # Since: 2.3
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
1000 # inside the guest.
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
1007 # field).
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
1016 #          changed.
1018 # Since: 2.3
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).
1031 # Since: 2.3
1033 { 'struct': 'GuestMemoryBlockInfo',
1034   'data': {'size': 'uint64'} }
1037 # @guest-get-memory-block-info:
1039 # Get information relating to guest memory blocks.
1041 # Returns: @GuestMemoryBlockInfo
1043 # Since: 2.3
1045 { 'command': 'guest-get-memory-block-info',
1046   'returns': 'GuestMemoryBlockInfo' }
1049 # @GuestExecStatus:
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.
1064 # Since: 2.5
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.
1080 # Since: 2.5
1082 { 'command': 'guest-exec-status',
1083   'data':    { 'pid': 'int' },
1084   'returns': 'GuestExecStatus' }
1087 # @GuestExec:
1088 # @pid: pid of child process in guest OS
1090 # Since: 2.5
1092 { 'struct': 'GuestExec',
1093   'data': { 'pid': 'int'} }
1096 # @guest-exec:
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.
1109 # Since: 2.5
1111 { 'command': 'guest-exec',
1112   'data':    { 'path': 'str', '*arg': ['str'], '*env': ['str'],
1113                '*input-data': 'str', '*capture-output': 'bool' },
1114   'returns': 'GuestExec' }
1118 # @GuestHostName:
1119 # @host-name: Fully qualified domain name of the guest OS
1121 # Since: 2.10
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
1137 # Since: 2.10
1139 { 'command': 'guest-get-host-name',
1140   'returns': 'GuestHostName' }
1144 # @GuestUser:
1145 # @user: Username
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.
1151 # Since: 2.10
1153 { 'struct': 'GuestUser',
1154   'data': { 'user': 'str', 'login-time': 'number', '*domain': 'str' } }
1157 # @guest-get-users:
1158 # Retrieves a list of currently active users on the VM.
1160 # Returns: A unique list of users.
1162 # Since: 2.10
1164 { 'command': 'guest-get-users',
1165   'returns': ['GuestUser'] }
1168 # @GuestTimezone:
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
1175 # Since: 2.10
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.
1187 # Since: 2.10
1189 { 'command': 'guest-get-timezone',
1190   'returns': 'GuestTimezone' }
1193 # @GuestOSInfo:
1195 # @kernel-release:
1196 # * POSIX: release field returned by uname(2)
1197 # * Windows: build number of the OS
1198 # @kernel-version:
1199 # * POSIX: version field returned by uname(2)
1200 # * Windows: version number of the OS
1201 # @machine:
1202 # * POSIX: machine field returned by uname(2)
1203 # * Windows: one of x86, x86_64, arm, ia64
1204 # @id:
1205 # * POSIX: as defined by os-release(5)
1206 # * Windows: contains string "mswindows"
1207 # @name:
1208 # * POSIX: as defined by os-release(5)
1209 # * Windows: contains string "Microsoft Windows"
1210 # @pretty-name:
1211 # * POSIX: as defined by os-release(5)
1212 # * Windows: product name, e.g. "Microsoft Windows 10 Enterprise"
1213 # @version:
1214 # * POSIX: as defined by os-release(5)
1215 # * Windows: long version string, e.g. "Microsoft Windows Server 2008"
1216 # @version-id:
1217 # * POSIX: as defined by os-release(5)
1218 # * Windows: short version identifier, e.g. "7" or "20012r2"
1219 # @variant:
1220 # * POSIX: as defined by os-release(5)
1221 # * Windows: contains string "server" or "client"
1222 # @variant-id:
1223 # * POSIX: as defined by os-release(5)
1224 # * Windows: contains string "server" or "client"
1226 # Notes:
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.
1236 # Since: 2.10
1238 { 'struct': 'GuestOSInfo',
1239   'data': {
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
1252 # Since: 2.10
1254 { 'command': 'guest-get-osinfo',
1255   'returns': 'GuestOSInfo' }