virtio-gpu: fix crashes upon warm reboot with vga mode
[qemu/ar7.git] / qga / qapi-schema.json
blobdfbc4a5e32bde4070f12497c23973c604accfa7d
1 # *-*- Mode: Python -*-*
3 ##
5 # General note concerning the use of guest agent interfaces:
7 # "unsupported" is a higher-level error than the errors that individual
8 # commands might document. The caller should always be prepared to receive
9 # QERR_UNSUPPORTED, even if the given command doesn't specify it, or doesn't
10 # document any failure mode at all.
14 { 'pragma': { 'doc-required': true } }
16 # Whitelists to permit QAPI rule violations; think twice before you
17 # add to them!
18 { 'pragma': {
19     # Commands allowed to return a non-dictionary:
20     'returns-whitelist': [
21         'guest-file-open',
22         'guest-fsfreeze-freeze',
23         'guest-fsfreeze-freeze-list',
24         'guest-fsfreeze-status',
25         'guest-fsfreeze-thaw',
26         'guest-get-time',
27         'guest-set-vcpus',
28         'guest-sync',
29         'guest-sync-delimited' ] } }
32 # @guest-sync-delimited:
34 # Echo back a unique integer value, and prepend to response a
35 # leading sentinel byte (0xFF) the client can check scan for.
37 # This is used by clients talking to the guest agent over the
38 # wire to ensure the stream is in sync and doesn't contain stale
39 # data from previous client. It must be issued upon initial
40 # connection, and after any client-side timeouts (including
41 # timeouts on receiving a response to this command).
43 # After issuing this request, all guest agent responses should be
44 # ignored until the response containing the unique integer value
45 # the client passed in is returned. Receival of the 0xFF sentinel
46 # byte must be handled as an indication that the client's
47 # lexer/tokenizer/parser state should be flushed/reset in
48 # preparation for reliably receiving the subsequent response. As
49 # an optimization, clients may opt to ignore all data until a
50 # sentinel value is receiving to avoid unnecessary processing of
51 # stale data.
53 # Similarly, clients should also precede this *request*
54 # with a 0xFF byte to make sure the guest agent flushes any
55 # partially read JSON data from a previous client connection.
57 # @id: randomly generated 64-bit integer
59 # Returns: The unique integer id passed in by the client
61 # Since: 1.1
63 { 'command': 'guest-sync-delimited',
64   'data':    { 'id': 'int' },
65   'returns': 'int' }
68 # @guest-sync:
70 # Echo back a unique integer value
72 # This is used by clients talking to the guest agent over the
73 # wire to ensure the stream is in sync and doesn't contain stale
74 # data from previous client. All guest agent responses should be
75 # ignored until the provided unique integer value is returned,
76 # and it is up to the client to handle stale whole or
77 # partially-delivered JSON text in such a way that this response
78 # can be obtained.
80 # In cases where a partial stale response was previously
81 # received by the client, this cannot always be done reliably.
82 # One particular scenario being if qemu-ga responses are fed
83 # character-by-character into a JSON parser. In these situations,
84 # using guest-sync-delimited may be optimal.
86 # For clients that fetch responses line by line and convert them
87 # to JSON objects, guest-sync should be sufficient, but note that
88 # in cases where the channel is dirty some attempts at parsing the
89 # response may result in a parser error.
91 # Such clients should also precede this command
92 # with a 0xFF byte to make sure the guest agent flushes any
93 # partially read JSON data from a previous session.
95 # @id: randomly generated 64-bit integer
97 # Returns: The unique integer id passed in by the client
99 # Since: 0.15.0
101 { 'command': 'guest-sync',
102   'data':    { 'id': 'int' },
103   'returns': 'int' }
106 # @guest-ping:
108 # Ping the guest agent, a non-error return implies success
110 # Since: 0.15.0
112 { 'command': 'guest-ping' }
115 # @guest-get-time:
117 # Get the information about guest's System Time relative to
118 # the Epoch of 1970-01-01 in UTC.
120 # Returns: Time in nanoseconds.
122 # Since: 1.5
124 { 'command': 'guest-get-time',
125   'returns': 'int' }
128 # @guest-set-time:
130 # Set guest time.
132 # When a guest is paused or migrated to a file then loaded
133 # from that file, the guest OS has no idea that there
134 # was a big gap in the time. Depending on how long the
135 # gap was, NTP might not be able to resynchronize the
136 # guest.
138 # This command tries to set guest's System Time to the
139 # given value, then sets the Hardware Clock (RTC) to the
140 # current System Time. This will make it easier for a guest
141 # to resynchronize without waiting for NTP. If no @time is
142 # specified, then the time to set is read from RTC. However,
143 # this may not be supported on all platforms (i.e. Windows).
144 # If that's the case users are advised to always pass a
145 # value.
147 # @time: time of nanoseconds, relative to the Epoch
148 #        of 1970-01-01 in UTC.
150 # Returns: Nothing on success.
152 # Since: 1.5
154 { 'command': 'guest-set-time',
155   'data': { '*time': 'int' } }
158 # @GuestAgentCommandInfo:
160 # Information about guest agent commands.
162 # @name: name of the command
164 # @enabled: whether command is currently enabled by guest admin
166 # @success-response: whether command returns a response on success
167 #                    (since 1.7)
169 # Since: 1.1.0
171 { 'struct': 'GuestAgentCommandInfo',
172   'data': { 'name': 'str', 'enabled': 'bool', 'success-response': 'bool' } }
175 # @GuestAgentInfo:
177 # Information about guest agent.
179 # @version: guest agent version
181 # @supported_commands: Information about guest agent commands
183 # Since: 0.15.0
185 { 'struct': 'GuestAgentInfo',
186   'data': { 'version': 'str',
187             'supported_commands': ['GuestAgentCommandInfo'] } }
189 # @guest-info:
191 # Get some information about the guest agent.
193 # Returns: @GuestAgentInfo
195 # Since: 0.15.0
197 { 'command': 'guest-info',
198   'returns': 'GuestAgentInfo' }
201 # @guest-shutdown:
203 # Initiate guest-activated shutdown. Note: this is an asynchronous
204 # shutdown request, with no guarantee of successful shutdown.
206 # @mode: "halt", "powerdown" (default), or "reboot"
208 # This command does NOT return a response on success. Success condition
209 # is indicated by the VM exiting with a zero exit status or, when
210 # running with --no-shutdown, by issuing the query-status QMP command
211 # to confirm the VM status is "shutdown".
213 # Since: 0.15.0
215 { 'command': 'guest-shutdown', 'data': { '*mode': 'str' },
216   'success-response': false }
219 # @guest-file-open:
221 # Open a file in the guest and retrieve a file handle for it
223 # @path: Full path to the file in the guest to open.
225 # @mode: open mode, as per fopen(), "r" is the default.
227 # Returns: Guest file handle on success.
229 # Since: 0.15.0
231 { 'command': 'guest-file-open',
232   'data':    { 'path': 'str', '*mode': 'str' },
233   'returns': 'int' }
236 # @guest-file-close:
238 # Close an open file in the guest
240 # @handle: filehandle returned by guest-file-open
242 # Returns: Nothing on success.
244 # Since: 0.15.0
246 { 'command': 'guest-file-close',
247   'data': { 'handle': 'int' } }
250 # @GuestFileRead:
252 # Result of guest agent file-read operation
254 # @count: number of bytes read (note: count is *before*
255 #         base64-encoding is applied)
257 # @buf-b64: base64-encoded bytes read
259 # @eof: whether EOF was encountered during read operation.
261 # Since: 0.15.0
263 { 'struct': 'GuestFileRead',
264   'data': { 'count': 'int', 'buf-b64': 'str', 'eof': 'bool' } }
267 # @guest-file-read:
269 # Read from an open file in the guest. Data will be base64-encoded
271 # @handle: filehandle returned by guest-file-open
273 # @count: maximum number of bytes to read (default is 4KB)
275 # Returns: @GuestFileRead on success.
277 # Since: 0.15.0
279 { 'command': 'guest-file-read',
280   'data':    { 'handle': 'int', '*count': 'int' },
281   'returns': 'GuestFileRead' }
284 # @GuestFileWrite:
286 # Result of guest agent file-write operation
288 # @count: number of bytes written (note: count is actual bytes
289 #         written, after base64-decoding of provided buffer)
291 # @eof: whether EOF was encountered during write operation.
293 # Since: 0.15.0
295 { 'struct': 'GuestFileWrite',
296   'data': { 'count': 'int', 'eof': 'bool' } }
299 # @guest-file-write:
301 # Write to an open file in the guest.
303 # @handle: filehandle returned by guest-file-open
305 # @buf-b64: base64-encoded string representing data to be written
307 # @count: bytes to write (actual bytes, after base64-decode),
308 #         default is all content in buf-b64 buffer after base64 decoding
310 # Returns: @GuestFileWrite on success.
312 # Since: 0.15.0
314 { 'command': 'guest-file-write',
315   'data':    { 'handle': 'int', 'buf-b64': 'str', '*count': 'int' },
316   'returns': 'GuestFileWrite' }
320 # @GuestFileSeek:
322 # Result of guest agent file-seek operation
324 # @position: current file position
326 # @eof: whether EOF was encountered during file seek
328 # Since: 0.15.0
330 { 'struct': 'GuestFileSeek',
331   'data': { 'position': 'int', 'eof': 'bool' } }
334 # @QGASeek:
336 # Symbolic names for use in @guest-file-seek
338 # @set: Set to the specified offset (same effect as 'whence':0)
339 # @cur: Add offset to the current location (same effect as 'whence':1)
340 # @end: Add offset to the end of the file (same effect as 'whence':2)
342 # Since: 2.6
344 { 'enum': 'QGASeek', 'data': [ 'set', 'cur', 'end' ] }
347 # @GuestFileWhence:
349 # Controls the meaning of offset to @guest-file-seek.
351 # @value: Integral value (0 for set, 1 for cur, 2 for end), available
352 #         for historical reasons, and might differ from the host's or
353 #         guest's SEEK_* values (since: 0.15)
354 # @name: Symbolic name, and preferred interface
356 # Since: 2.6
358 { 'alternate': 'GuestFileWhence',
359   'data': { 'value': 'int', 'name': 'QGASeek' } }
362 # @guest-file-seek:
364 # Seek to a position in the file, as with fseek(), and return the
365 # current file position afterward. Also encapsulates ftell()'s
366 # functionality, with offset=0 and whence=1.
368 # @handle: filehandle returned by guest-file-open
370 # @offset: bytes to skip over in the file stream
372 # @whence: Symbolic or numeric code for interpreting offset
374 # Returns: @GuestFileSeek on success.
376 # Since: 0.15.0
378 { 'command': 'guest-file-seek',
379   'data':    { 'handle': 'int', 'offset': 'int',
380                'whence': 'GuestFileWhence' },
381   'returns': 'GuestFileSeek' }
384 # @guest-file-flush:
386 # Write file changes bufferred in userspace to disk/kernel buffers
388 # @handle: filehandle returned by guest-file-open
390 # Returns: Nothing on success.
392 # Since: 0.15.0
394 { 'command': 'guest-file-flush',
395   'data': { 'handle': 'int' } }
398 # @GuestFsfreezeStatus:
400 # An enumeration of filesystem freeze states
402 # @thawed: filesystems thawed/unfrozen
404 # @frozen: all non-network guest filesystems frozen
406 # Since: 0.15.0
408 { 'enum': 'GuestFsfreezeStatus',
409   'data': [ 'thawed', 'frozen' ] }
412 # @guest-fsfreeze-status:
414 # Get guest fsfreeze state. error state indicates
416 # Returns: GuestFsfreezeStatus ("thawed", "frozen", etc., as defined below)
418 # Note: This may fail to properly report the current state as a result of
419 # some other guest processes having issued an fs freeze/thaw.
421 # Since: 0.15.0
423 { 'command': 'guest-fsfreeze-status',
424   'returns': 'GuestFsfreezeStatus' }
427 # @guest-fsfreeze-freeze:
429 # Sync and freeze all freezable, local guest filesystems. If this
430 # command succeeded, you may call @guest-fsfreeze-thaw later to
431 # unfreeze.
433 # Note: On Windows, the command is implemented with the help of a
434 # Volume Shadow-copy Service DLL helper. The frozen state is limited
435 # for up to 10 seconds by VSS.
437 # Returns: Number of file systems currently frozen. On error, all filesystems
438 # will be thawed. If no filesystems are frozen as a result of this call,
439 # then @guest-fsfreeze-status will remain "thawed" and calling
440 # @guest-fsfreeze-thaw is not necessary.
442 # Since: 0.15.0
444 { 'command': 'guest-fsfreeze-freeze',
445   'returns': 'int' }
448 # @guest-fsfreeze-freeze-list:
450 # Sync and freeze specified guest filesystems.
451 # See also @guest-fsfreeze-freeze.
453 # @mountpoints: an array of mountpoints of filesystems to be frozen.
454 #               If omitted, every mounted filesystem is frozen.
455 #               Invalid mount points are ignored.
457 # Returns: Number of file systems currently frozen. On error, all filesystems
458 # will be thawed.
460 # Since: 2.2
462 { 'command': 'guest-fsfreeze-freeze-list',
463   'data':    { '*mountpoints': ['str'] },
464   'returns': 'int' }
467 # @guest-fsfreeze-thaw:
469 # Unfreeze all frozen guest filesystems
471 # Returns: Number of file systems thawed by this call
473 # Note: if return value does not match the previous call to
474 #       guest-fsfreeze-freeze, this likely means some freezable
475 #       filesystems were unfrozen before this call, and that the
476 #       filesystem state may have changed before issuing this
477 #       command.
479 # Since: 0.15.0
481 { 'command': 'guest-fsfreeze-thaw',
482   'returns': 'int' }
485 # @GuestFilesystemTrimResult:
487 # @path: path that was trimmed
488 # @error: an error message when trim failed
489 # @trimmed: bytes trimmed for this path
490 # @minimum: reported effective minimum for this path
492 # Since: 2.4
494 { 'struct': 'GuestFilesystemTrimResult',
495   'data': {'path': 'str',
496            '*trimmed': 'int', '*minimum': 'int', '*error': 'str'} }
499 # @GuestFilesystemTrimResponse:
501 # @paths: list of @GuestFilesystemTrimResult per path that was trimmed
503 # Since: 2.4
505 { 'struct': 'GuestFilesystemTrimResponse',
506   'data': {'paths': ['GuestFilesystemTrimResult']} }
509 # @guest-fstrim:
511 # Discard (or "trim") blocks which are not in use by the filesystem.
513 # @minimum:
514 #       Minimum contiguous free range to discard, in bytes. Free ranges
515 #       smaller than this may be ignored (this is a hint and the guest
516 #       may not respect it).  By increasing this value, the fstrim
517 #       operation will complete more quickly for filesystems with badly
518 #       fragmented free space, although not all blocks will be discarded.
519 #       The default value is zero, meaning "discard every free block".
521 # Returns: A @GuestFilesystemTrimResponse which contains the
522 #          status of all trimmed paths. (since 2.4)
524 # Since: 1.2
526 { 'command': 'guest-fstrim',
527   'data': { '*minimum': 'int' },
528   'returns': 'GuestFilesystemTrimResponse' }
531 # @guest-suspend-disk:
533 # Suspend guest to disk.
535 # This command tries to execute the scripts provided by the pm-utils package.
536 # If it's not available, the suspend operation will be performed by manually
537 # writing to a sysfs file.
539 # For the best results it's strongly recommended to have the pm-utils
540 # package installed in the guest.
542 # This command does NOT return a response on success. There is a high chance
543 # the command succeeded if the VM exits with a zero exit status or, when
544 # running with --no-shutdown, by issuing the query-status QMP command to
545 # to confirm the VM status is "shutdown". However, the VM could also exit
546 # (or set its status to "shutdown") due to other reasons.
548 # The following errors may be returned:
549 #          If suspend to disk is not supported, Unsupported
551 # Notes: It's strongly recommended to issue the guest-sync command before
552 #        sending commands when the guest resumes
554 # Since: 1.1
556 { 'command': 'guest-suspend-disk', 'success-response': false }
559 # @guest-suspend-ram:
561 # Suspend guest to ram.
563 # This command tries to execute the scripts provided by the pm-utils package.
564 # If it's not available, the suspend operation will be performed by manually
565 # writing to a sysfs file.
567 # For the best results it's strongly recommended to have the pm-utils
568 # package installed in the guest.
570 # IMPORTANT: guest-suspend-ram requires QEMU to support the 'system_wakeup'
571 # command.  Thus, it's *required* to query QEMU for the presence of the
572 # 'system_wakeup' command before issuing guest-suspend-ram.
574 # This command does NOT return a response on success. There are two options
575 # to check for success:
576 #   1. Wait for the SUSPEND QMP event from QEMU
577 #   2. Issue the query-status QMP command to confirm the VM status is
578 #      "suspended"
580 # The following errors may be returned:
581 #          If suspend to ram is not supported, Unsupported
583 # Notes: It's strongly recommended to issue the guest-sync command before
584 #        sending commands when the guest resumes
586 # Since: 1.1
588 { 'command': 'guest-suspend-ram', 'success-response': false }
591 # @guest-suspend-hybrid:
593 # Save guest state to disk and suspend to ram.
595 # This command requires the pm-utils package to be installed in the guest.
597 # IMPORTANT: guest-suspend-hybrid requires QEMU to support the 'system_wakeup'
598 # command.  Thus, it's *required* to query QEMU for the presence of the
599 # 'system_wakeup' command before issuing guest-suspend-hybrid.
601 # This command does NOT return a response on success. There are two options
602 # to check for success:
603 #   1. Wait for the SUSPEND QMP event from QEMU
604 #   2. Issue the query-status QMP command to confirm the VM status is
605 #      "suspended"
607 # The following errors may be returned:
608 #          If hybrid suspend is not supported, Unsupported
610 # Notes: It's strongly recommended to issue the guest-sync command before
611 #        sending commands when the guest resumes
613 # Since: 1.1
615 { 'command': 'guest-suspend-hybrid', 'success-response': false }
618 # @GuestIpAddressType:
620 # An enumeration of supported IP address types
622 # @ipv4: IP version 4
624 # @ipv6: IP version 6
626 # Since: 1.1
628 { 'enum': 'GuestIpAddressType',
629   'data': [ 'ipv4', 'ipv6' ] }
632 # @GuestIpAddress:
634 # @ip-address: IP address
636 # @ip-address-type: Type of @ip-address (e.g. ipv4, ipv6)
638 # @prefix: Network prefix length of @ip-address
640 # Since: 1.1
642 { 'struct': 'GuestIpAddress',
643   'data': {'ip-address': 'str',
644            'ip-address-type': 'GuestIpAddressType',
645            'prefix': 'int'} }
648 # @GuestNetworkInterfaceStat:
650 # @rx-bytes: total bytes received
652 # @rx-packets: total packets received
654 # @rx-errs: bad packets received
656 # @rx-dropped: receiver dropped packets
658 # @tx-bytes: total bytes transmitted
660 # @tx-packets: total packets transmitted
662 # @tx-errs: packet transmit problems
664 # @tx-dropped: dropped packets transmitted
666 # Since: 2.11
668 { 'struct': 'GuestNetworkInterfaceStat',
669   'data': {'rx-bytes': 'uint64',
670             'rx-packets': 'uint64',
671             'rx-errs': 'uint64',
672             'rx-dropped': 'uint64',
673             'tx-bytes': 'uint64',
674             'tx-packets': 'uint64',
675             'tx-errs': 'uint64',
676             'tx-dropped': 'uint64'
677            } }
680 # @GuestNetworkInterface:
682 # @name: The name of interface for which info are being delivered
684 # @hardware-address: Hardware address of @name
686 # @ip-addresses: List of addresses assigned to @name
688 # @statistics: various statistic counters related to @name
689 # (since 2.11)
691 # Since: 1.1
693 { 'struct': 'GuestNetworkInterface',
694   'data': {'name': 'str',
695            '*hardware-address': 'str',
696            '*ip-addresses': ['GuestIpAddress'],
697            '*statistics': 'GuestNetworkInterfaceStat' } }
700 # @guest-network-get-interfaces:
702 # Get list of guest IP addresses, MAC addresses
703 # and netmasks.
705 # Returns: List of GuestNetworkInfo on success.
707 # Since: 1.1
709 { 'command': 'guest-network-get-interfaces',
710   'returns': ['GuestNetworkInterface'] }
713 # @GuestLogicalProcessor:
715 # @logical-id: Arbitrary guest-specific unique identifier of the VCPU.
717 # @online: Whether the VCPU is enabled.
719 # @can-offline: Whether offlining the VCPU is possible. This member
720 #               is always filled in by the guest agent when the structure is
721 #               returned, and always ignored on input (hence it can be omitted
722 #               then).
724 # Since: 1.5
726 { 'struct': 'GuestLogicalProcessor',
727   'data': {'logical-id': 'int',
728            'online': 'bool',
729            '*can-offline': 'bool'} }
732 # @guest-get-vcpus:
734 # Retrieve the list of the guest's logical processors.
736 # This is a read-only operation.
738 # Returns: The list of all VCPUs the guest knows about. Each VCPU is put on the
739 # list exactly once, but their order is unspecified.
741 # Since: 1.5
743 { 'command': 'guest-get-vcpus',
744   'returns': ['GuestLogicalProcessor'] }
747 # @guest-set-vcpus:
749 # Attempt to reconfigure (currently: enable/disable) logical processors inside
750 # the guest.
752 # The input list is processed node by node in order. In each node @logical-id
753 # is used to look up the guest VCPU, for which @online specifies the requested
754 # state. The set of distinct @logical-id's is only required to be a subset of
755 # the guest-supported identifiers. There's no restriction on list length or on
756 # repeating the same @logical-id (with possibly different @online field).
757 # Preferably the input list should describe a modified subset of
758 # @guest-get-vcpus' return value.
760 # Returns: The length of the initial sublist that has been successfully
761 #          processed. The guest agent maximizes this value. Possible cases:
763 #          - 0:              if the @vcpus list was empty on input. Guest state
764 #                            has not been changed. Otherwise,
765 #          - Error:          processing the first node of @vcpus failed for the
766 #                            reason returned. Guest state has not been changed.
767 #                            Otherwise,
768 #          - < length(@vcpus): more than zero initial nodes have been processed,
769 #                            but not the entire @vcpus list. Guest state has
770 #                            changed accordingly. To retrieve the error
771 #                            (assuming it persists), repeat the call with the
772 #                            successfully processed initial sublist removed.
773 #                            Otherwise,
774 #          - length(@vcpus): call successful.
776 # Since: 1.5
778 { 'command': 'guest-set-vcpus',
779   'data':    {'vcpus': ['GuestLogicalProcessor'] },
780   'returns': 'int' }
783 # @GuestDiskBusType:
785 # An enumeration of bus type of disks
787 # @ide: IDE disks
788 # @fdc: floppy disks
789 # @scsi: SCSI disks
790 # @virtio: virtio disks
791 # @xen: Xen disks
792 # @usb: USB disks
793 # @uml: UML disks
794 # @sata: SATA disks
795 # @sd: SD cards
796 # @unknown: Unknown bus type
797 # @ieee1394: Win IEEE 1394 bus type
798 # @ssa: Win SSA bus type
799 # @fibre: Win fiber channel bus type
800 # @raid: Win RAID bus type
801 # @iscsi: Win iScsi bus type
802 # @sas: Win serial-attaches SCSI bus type
803 # @mmc: Win multimedia card (MMC) bus type
804 # @virtual: Win virtual bus type
805 # @file-backed virtual: Win file-backed bus type
807 # Since: 2.2; 'Unknown' and all entries below since 2.4
809 { 'enum': 'GuestDiskBusType',
810   'data': [ 'ide', 'fdc', 'scsi', 'virtio', 'xen', 'usb', 'uml', 'sata',
811             'sd', 'unknown', 'ieee1394', 'ssa', 'fibre', 'raid', 'iscsi',
812             'sas', 'mmc', 'virtual', 'file-backed-virtual' ] }
816 # @GuestPCIAddress:
818 # @domain: domain id
819 # @bus: bus id
820 # @slot: slot id
821 # @function: function id
823 # Since: 2.2
825 { 'struct': 'GuestPCIAddress',
826   'data': {'domain': 'int', 'bus': 'int',
827            'slot': 'int', 'function': 'int'} }
830 # @GuestDiskAddress:
832 # @pci-controller: controller's PCI address
833 # @bus-type: bus type
834 # @bus: bus id
835 # @target: target id
836 # @unit: unit id
838 # Since: 2.2
840 { 'struct': 'GuestDiskAddress',
841   'data': {'pci-controller': 'GuestPCIAddress',
842            'bus-type': 'GuestDiskBusType',
843            'bus': 'int', 'target': 'int', 'unit': 'int'} }
846 # @GuestFilesystemInfo:
848 # @name: disk name
849 # @mountpoint: mount point path
850 # @type: file system type string
851 # @used-bytes: file system used bytes (since 3.0)
852 # @total-bytes: non-root file system total bytes (since 3.0)
853 # @disk: an array of disk hardware information that the volume lies on,
854 #        which may be empty if the disk type is not supported
856 # Since: 2.2
858 { 'struct': 'GuestFilesystemInfo',
859   'data': {'name': 'str', 'mountpoint': 'str', 'type': 'str',
860            '*used-bytes': 'uint64', '*total-bytes': 'uint64',
861            'disk': ['GuestDiskAddress']} }
864 # @guest-get-fsinfo:
866 # Returns: The list of filesystems information mounted in the guest.
867 #          The returned mountpoints may be specified to
868 #          @guest-fsfreeze-freeze-list.
869 #          Network filesystems (such as CIFS and NFS) are not listed.
871 # Since: 2.2
873 { 'command': 'guest-get-fsinfo',
874   'returns': ['GuestFilesystemInfo'] }
877 # @guest-set-user-password:
879 # @username: the user account whose password to change
880 # @password: the new password entry string, base64 encoded
881 # @crypted: true if password is already crypt()d, false if raw
883 # If the @crypted flag is true, it is the caller's responsibility
884 # to ensure the correct crypt() encryption scheme is used. This
885 # command does not attempt to interpret or report on the encryption
886 # scheme. Refer to the documentation of the guest operating system
887 # in question to determine what is supported.
889 # Not all guest operating systems will support use of the
890 # @crypted flag, as they may require the clear-text password
892 # The @password parameter must always be base64 encoded before
893 # transmission, even if already crypt()d, to ensure it is 8-bit
894 # safe when passed as JSON.
896 # Returns: Nothing on success.
898 # Since: 2.3
900 { 'command': 'guest-set-user-password',
901   'data': { 'username': 'str', 'password': 'str', 'crypted': 'bool' } }
904 # @GuestMemoryBlock:
906 # @phys-index: Arbitrary guest-specific unique identifier of the MEMORY BLOCK.
908 # @online: Whether the MEMORY BLOCK is enabled in guest.
910 # @can-offline: Whether offlining the MEMORY BLOCK is possible.
911 #               This member is always filled in by the guest agent when the
912 #               structure is returned, and always ignored on input (hence it
913 #               can be omitted then).
915 # Since: 2.3
917 { 'struct': 'GuestMemoryBlock',
918   'data': {'phys-index': 'uint64',
919            'online': 'bool',
920            '*can-offline': 'bool'} }
923 # @guest-get-memory-blocks:
925 # Retrieve the list of the guest's memory blocks.
927 # This is a read-only operation.
929 # Returns: The list of all memory blocks the guest knows about.
930 # Each memory block is put on the list exactly once, but their order
931 # is unspecified.
933 # Since: 2.3
935 { 'command': 'guest-get-memory-blocks',
936   'returns': ['GuestMemoryBlock'] }
939 # @GuestMemoryBlockResponseType:
941 # An enumeration of memory block operation result.
943 # @success: the operation of online/offline memory block is successful.
944 # @not-found: can't find the corresponding memoryXXX directory in sysfs.
945 # @operation-not-supported: for some old kernels, it does not support
946 #                           online or offline memory block.
947 # @operation-failed: the operation of online/offline memory block fails,
948 #                    because of some errors happen.
950 # Since: 2.3
952 { 'enum': 'GuestMemoryBlockResponseType',
953   'data': ['success', 'not-found', 'operation-not-supported',
954            'operation-failed'] }
957 # @GuestMemoryBlockResponse:
959 # @phys-index: same with the 'phys-index' member of @GuestMemoryBlock.
961 # @response: the result of memory block operation.
963 # @error-code: the error number.
964 #               When memory block operation fails, we assign the value of
965 #               'errno' to this member, it indicates what goes wrong.
966 #               When the operation succeeds, it will be omitted.
968 # Since: 2.3
970 { 'struct': 'GuestMemoryBlockResponse',
971   'data': { 'phys-index': 'uint64',
972             'response': 'GuestMemoryBlockResponseType',
973             '*error-code': 'int' }}
976 # @guest-set-memory-blocks:
978 # Attempt to reconfigure (currently: enable/disable) state of memory blocks
979 # inside the guest.
981 # The input list is processed node by node in order. In each node @phys-index
982 # is used to look up the guest MEMORY BLOCK, for which @online specifies the
983 # requested state. The set of distinct @phys-index's is only required to be a
984 # subset of the guest-supported identifiers. There's no restriction on list
985 # length or on repeating the same @phys-index (with possibly different @online
986 # field).
987 # Preferably the input list should describe a modified subset of
988 # @guest-get-memory-blocks' return value.
990 # Returns: The operation results, it is a list of @GuestMemoryBlockResponse,
991 #          which is corresponding to the input list.
993 #          Note: it will return NULL if the @mem-blks list was empty on input,
994 #          or there is an error, and in this case, guest state will not be
995 #          changed.
997 # Since: 2.3
999 { 'command': 'guest-set-memory-blocks',
1000   'data':    {'mem-blks': ['GuestMemoryBlock'] },
1001   'returns': ['GuestMemoryBlockResponse'] }
1004 # @GuestMemoryBlockInfo:
1006 # @size: the size (in bytes) of the guest memory blocks,
1007 #        which are the minimal units of memory block online/offline
1008 #        operations (also called Logical Memory Hotplug).
1010 # Since: 2.3
1012 { 'struct': 'GuestMemoryBlockInfo',
1013   'data': {'size': 'uint64'} }
1016 # @guest-get-memory-block-info:
1018 # Get information relating to guest memory blocks.
1020 # Returns: @GuestMemoryBlockInfo
1022 # Since: 2.3
1024 { 'command': 'guest-get-memory-block-info',
1025   'returns': 'GuestMemoryBlockInfo' }
1028 # @GuestExecStatus:
1030 # @exited: true if process has already terminated.
1031 # @exitcode: process exit code if it was normally terminated.
1032 # @signal: signal number (linux) or unhandled exception code
1033 #       (windows) if the process was abnormally terminated.
1034 # @out-data: base64-encoded stdout of the process
1035 # @err-data: base64-encoded stderr of the process
1036 #       Note: @out-data and @err-data are present only
1037 #       if 'capture-output' was specified for 'guest-exec'
1038 # @out-truncated: true if stdout was not fully captured
1039 #       due to size limitation.
1040 # @err-truncated: true if stderr was not fully captured
1041 #       due to size limitation.
1043 # Since: 2.5
1045 { 'struct': 'GuestExecStatus',
1046   'data': { 'exited': 'bool', '*exitcode': 'int', '*signal': 'int',
1047             '*out-data': 'str', '*err-data': 'str',
1048             '*out-truncated': 'bool', '*err-truncated': 'bool' }}
1050 # @guest-exec-status:
1052 # Check status of process associated with PID retrieved via guest-exec.
1053 # Reap the process and associated metadata if it has exited.
1055 # @pid: pid returned from guest-exec
1057 # Returns: GuestExecStatus on success.
1059 # Since: 2.5
1061 { 'command': 'guest-exec-status',
1062   'data':    { 'pid': 'int' },
1063   'returns': 'GuestExecStatus' }
1066 # @GuestExec:
1067 # @pid: pid of child process in guest OS
1069 # Since: 2.5
1071 { 'struct': 'GuestExec',
1072   'data': { 'pid': 'int'} }
1075 # @guest-exec:
1077 # Execute a command in the guest
1079 # @path: path or executable name to execute
1080 # @arg: argument list to pass to executable
1081 # @env: environment variables to pass to executable
1082 # @input-data: data to be passed to process stdin (base64 encoded)
1083 # @capture-output: bool flag to enable capture of
1084 #                  stdout/stderr of running process. defaults to false.
1086 # Returns: PID on success.
1088 # Since: 2.5
1090 { 'command': 'guest-exec',
1091   'data':    { 'path': 'str', '*arg': ['str'], '*env': ['str'],
1092                '*input-data': 'str', '*capture-output': 'bool' },
1093   'returns': 'GuestExec' }
1097 # @GuestHostName:
1098 # @host-name: Fully qualified domain name of the guest OS
1100 # Since: 2.10
1102 { 'struct': 'GuestHostName',
1103   'data':   { 'host-name': 'str' } }
1106 # @guest-get-host-name:
1108 # Return a name for the machine.
1110 # The returned name is not necessarily a fully-qualified domain name, or even
1111 # present in DNS or some other name service at all. It need not even be unique
1112 # on your local network or site, but usually it is.
1114 # Returns: the host name of the machine on success
1116 # Since: 2.10
1118 { 'command': 'guest-get-host-name',
1119   'returns': 'GuestHostName' }
1123 # @GuestUser:
1124 # @user:       Username
1125 # @domain:     Logon domain (windows only)
1126 # @login-time: Time of login of this user on the computer. If multiple
1127 #              instances of the user are logged in, the earliest login time is
1128 #              reported. The value is in fractional seconds since epoch time.
1130 # Since: 2.10
1132 { 'struct': 'GuestUser',
1133   'data': { 'user': 'str', 'login-time': 'number', '*domain': 'str' } }
1136 # @guest-get-users:
1137 # Retrieves a list of currently active users on the VM.
1139 # Returns: A unique list of users.
1141 # Since: 2.10
1143 { 'command': 'guest-get-users',
1144   'returns': ['GuestUser'] }
1147 # @GuestTimezone:
1149 # @zone:    Timezone name. These values may differ depending on guest/OS and
1150 #           should only be used for informational purposes.
1151 # @offset:  Offset to UTC in seconds, negative numbers for time zones west of
1152 #           GMT, positive numbers for east
1154 # Since: 2.10
1156 { 'struct': 'GuestTimezone',
1157   'data':   { '*zone': 'str', 'offset': 'int' } }
1160 # @guest-get-timezone:
1162 # Retrieves the timezone information from the guest.
1164 # Returns: A GuestTimezone dictionary.
1166 # Since: 2.10
1168 { 'command': 'guest-get-timezone',
1169   'returns': 'GuestTimezone' }
1172 # @GuestOSInfo:
1174 # @kernel-release:
1175 #     * POSIX: release field returned by uname(2)
1176 #     * Windows: build number of the OS
1177 # @kernel-version:
1178 #     * POSIX: version field returned by uname(2)
1179 #     * Windows: version number of the OS
1180 # @machine:
1181 #     * POSIX: machine field returned by uname(2)
1182 #     * Windows: one of x86, x86_64, arm, ia64
1183 # @id:
1184 #     * POSIX: as defined by os-release(5)
1185 #     * Windows: contains string "mswindows"
1186 # @name:
1187 #     * POSIX: as defined by os-release(5)
1188 #     * Windows: contains string "Microsoft Windows"
1189 # @pretty-name:
1190 #     * POSIX: as defined by os-release(5)
1191 #     * Windows: product name, e.g. "Microsoft Windows 10 Enterprise"
1192 # @version:
1193 #     * POSIX: as defined by os-release(5)
1194 #     * Windows: long version string, e.g. "Microsoft Windows Server 2008"
1195 # @version-id:
1196 #     * POSIX: as defined by os-release(5)
1197 #     * Windows: short version identifier, e.g. "7" or "20012r2"
1198 # @variant:
1199 #     * POSIX: as defined by os-release(5)
1200 #     * Windows: contains string "server" or "client"
1201 # @variant-id:
1202 #     * POSIX: as defined by os-release(5)
1203 #     * Windows: contains string "server" or "client"
1205 # Notes:
1207 # On POSIX systems the fields @id, @name, @pretty-name, @version, @version-id,
1208 # @variant and @variant-id follow the definition specified in os-release(5).
1209 # Refer to the manual page for exact description of the fields. Their values
1210 # are taken from the os-release file. If the file is not present in the system,
1211 # or the values are not present in the file, the fields are not included.
1213 # On Windows the values are filled from information gathered from the system.
1215 # Since: 2.10
1217 { 'struct': 'GuestOSInfo',
1218   'data': {
1219       '*kernel-release': 'str', '*kernel-version': 'str',
1220       '*machine': 'str', '*id': 'str', '*name': 'str',
1221       '*pretty-name': 'str', '*version': 'str', '*version-id': 'str',
1222       '*variant': 'str', '*variant-id': 'str' } }
1225 # @guest-get-osinfo:
1227 # Retrieve guest operating system information
1229 # Returns: @GuestOSInfo
1231 # Since: 2.10
1233 { 'command': 'guest-get-osinfo',
1234   'returns': 'GuestOSInfo' }