Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 1 | # *-*- Mode: Python -*-* |
| 2 | |
| 3 | ## |
Michael Roth | 3cf0bed | 2012-02-07 13:56:48 -0600 | [diff] [blame] | 4 | # |
Laszlo Ersek | 9481ecd | 2013-03-15 19:07:51 +0100 | [diff] [blame] | 5 | # General note concerning the use of guest agent interfaces: |
| 6 | # |
| 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. |
| 11 | # |
| 12 | ## |
| 13 | |
Markus Armbruster | bc52d03 | 2017-03-15 13:56:51 +0100 | [diff] [blame] | 14 | { 'pragma': { 'doc-required': true } } |
| 15 | |
Markus Armbruster | 1554a8f | 2017-03-15 13:56:54 +0100 | [diff] [blame] | 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' ] } } |
| 30 | |
Laszlo Ersek | 9481ecd | 2013-03-15 19:07:51 +0100 | [diff] [blame] | 31 | ## |
Marc-André Lureau | 71e0e06 | 2015-08-27 12:48:35 +0200 | [diff] [blame] | 32 | # @guest-sync-delimited: |
Laszlo Ersek | 9481ecd | 2013-03-15 19:07:51 +0100 | [diff] [blame] | 33 | # |
Michael Roth | 3cf0bed | 2012-02-07 13:56:48 -0600 | [diff] [blame] | 34 | # Echo back a unique integer value, and prepend to response a |
| 35 | # leading sentinel byte (0xFF) the client can check scan for. |
| 36 | # |
| 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). |
| 42 | # |
| 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 |
Jim Meyering | a31f053 | 2012-05-09 05:12:04 +0000 | [diff] [blame] | 50 | # sentinel value is receiving to avoid unnecessary processing of |
Michael Roth | 3cf0bed | 2012-02-07 13:56:48 -0600 | [diff] [blame] | 51 | # stale data. |
| 52 | # |
| 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. |
| 56 | # |
| 57 | # @id: randomly generated 64-bit integer |
| 58 | # |
| 59 | # Returns: The unique integer id passed in by the client |
| 60 | # |
| 61 | # Since: 1.1 |
Marc-André Lureau | 71e0e06 | 2015-08-27 12:48:35 +0200 | [diff] [blame] | 62 | ## |
Eric Blake | 01b87f6 | 2013-01-02 09:15:11 -0700 | [diff] [blame] | 63 | { 'command': 'guest-sync-delimited', |
Michael Roth | 3cf0bed | 2012-02-07 13:56:48 -0600 | [diff] [blame] | 64 | 'data': { 'id': 'int' }, |
| 65 | 'returns': 'int' } |
| 66 | |
| 67 | ## |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 68 | # @guest-sync: |
| 69 | # |
| 70 | # Echo back a unique integer value |
| 71 | # |
| 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. |
| 79 | # |
Michael Roth | 3cf0bed | 2012-02-07 13:56:48 -0600 | [diff] [blame] | 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. |
| 85 | # |
| 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. |
| 90 | # |
Stefan Weil | e7d8100 | 2011-12-10 00:19:46 +0100 | [diff] [blame] | 91 | # Such clients should also precede this command |
Michael Roth | 3cf0bed | 2012-02-07 13:56:48 -0600 | [diff] [blame] | 92 | # with a 0xFF byte to make sure the guest agent flushes any |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 93 | # partially read JSON data from a previous session. |
| 94 | # |
| 95 | # @id: randomly generated 64-bit integer |
| 96 | # |
| 97 | # Returns: The unique integer id passed in by the client |
| 98 | # |
| 99 | # Since: 0.15.0 |
| 100 | ## |
Eric Blake | 01b87f6 | 2013-01-02 09:15:11 -0700 | [diff] [blame] | 101 | { 'command': 'guest-sync', |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 102 | 'data': { 'id': 'int' }, |
| 103 | 'returns': 'int' } |
| 104 | |
| 105 | ## |
| 106 | # @guest-ping: |
| 107 | # |
| 108 | # Ping the guest agent, a non-error return implies success |
| 109 | # |
| 110 | # Since: 0.15.0 |
| 111 | ## |
| 112 | { 'command': 'guest-ping' } |
| 113 | |
| 114 | ## |
Lei Li | 6912e6a | 2013-03-05 17:39:11 +0800 | [diff] [blame] | 115 | # @guest-get-time: |
| 116 | # |
Amos Kong | 1634df5 | 2014-04-04 23:25:02 +0800 | [diff] [blame] | 117 | # Get the information about guest's System Time relative to |
| 118 | # the Epoch of 1970-01-01 in UTC. |
Lei Li | 6912e6a | 2013-03-05 17:39:11 +0800 | [diff] [blame] | 119 | # |
| 120 | # Returns: Time in nanoseconds. |
| 121 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 122 | # Since: 1.5 |
Lei Li | 6912e6a | 2013-03-05 17:39:11 +0800 | [diff] [blame] | 123 | ## |
| 124 | { 'command': 'guest-get-time', |
| 125 | 'returns': 'int' } |
| 126 | |
| 127 | ## |
Lei Li | a1bca57 | 2013-03-05 17:39:12 +0800 | [diff] [blame] | 128 | # @guest-set-time: |
| 129 | # |
| 130 | # Set guest time. |
| 131 | # |
| 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. |
| 137 | # |
Amos Kong | 1634df5 | 2014-04-04 23:25:02 +0800 | [diff] [blame] | 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 |
Michal Privoznik | ee17cbd | 2015-01-21 12:09:50 +0100 | [diff] [blame] | 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. |
Lei Li | a1bca57 | 2013-03-05 17:39:12 +0800 | [diff] [blame] | 146 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 147 | # @time: time of nanoseconds, relative to the Epoch |
Michal Privoznik | 2c95892 | 2014-01-31 11:29:51 +0100 | [diff] [blame] | 148 | # of 1970-01-01 in UTC. |
Lei Li | a1bca57 | 2013-03-05 17:39:12 +0800 | [diff] [blame] | 149 | # |
| 150 | # Returns: Nothing on success. |
| 151 | # |
| 152 | # Since: 1.5 |
| 153 | ## |
| 154 | { 'command': 'guest-set-time', |
Michal Privoznik | 2c95892 | 2014-01-31 11:29:51 +0100 | [diff] [blame] | 155 | 'data': { '*time': 'int' } } |
Lei Li | a1bca57 | 2013-03-05 17:39:12 +0800 | [diff] [blame] | 156 | |
| 157 | ## |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 158 | # @GuestAgentCommandInfo: |
| 159 | # |
| 160 | # Information about guest agent commands. |
| 161 | # |
| 162 | # @name: name of the command |
| 163 | # |
| 164 | # @enabled: whether command is currently enabled by guest admin |
| 165 | # |
Mark Wu | 0106dc4 | 2013-10-09 10:37:26 +0800 | [diff] [blame] | 166 | # @success-response: whether command returns a response on success |
| 167 | # (since 1.7) |
| 168 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 169 | # Since: 1.1.0 |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 170 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 171 | { 'struct': 'GuestAgentCommandInfo', |
Mark Wu | 0106dc4 | 2013-10-09 10:37:26 +0800 | [diff] [blame] | 172 | 'data': { 'name': 'str', 'enabled': 'bool', 'success-response': 'bool' } } |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 173 | |
| 174 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 175 | # @GuestAgentInfo: |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 176 | # |
| 177 | # Information about guest agent. |
| 178 | # |
| 179 | # @version: guest agent version |
| 180 | # |
| 181 | # @supported_commands: Information about guest agent commands |
| 182 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 183 | # Since: 0.15.0 |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 184 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 185 | { 'struct': 'GuestAgentInfo', |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 186 | 'data': { 'version': 'str', |
| 187 | 'supported_commands': ['GuestAgentCommandInfo'] } } |
| 188 | ## |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 189 | # @guest-info: |
| 190 | # |
| 191 | # Get some information about the guest agent. |
| 192 | # |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 193 | # Returns: @GuestAgentInfo |
| 194 | # |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 195 | # Since: 0.15.0 |
| 196 | ## |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 197 | { 'command': 'guest-info', |
| 198 | 'returns': 'GuestAgentInfo' } |
| 199 | |
| 200 | ## |
| 201 | # @guest-shutdown: |
| 202 | # |
| 203 | # Initiate guest-activated shutdown. Note: this is an asynchronous |
Luiz Capitulino | 3674838 | 2012-05-14 15:25:20 -0300 | [diff] [blame] | 204 | # shutdown request, with no guarantee of successful shutdown. |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 205 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 206 | # @mode: "halt", "powerdown" (default), or "reboot" |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 207 | # |
Luiz Capitulino | 8926817 | 2012-05-08 14:24:46 -0300 | [diff] [blame] | 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". |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 212 | # |
| 213 | # Since: 0.15.0 |
| 214 | ## |
Luiz Capitulino | 8926817 | 2012-05-08 14:24:46 -0300 | [diff] [blame] | 215 | { 'command': 'guest-shutdown', 'data': { '*mode': 'str' }, |
Eric Blake | d708cdb | 2015-05-04 09:05:19 -0600 | [diff] [blame] | 216 | 'success-response': false } |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 217 | |
| 218 | ## |
| 219 | # @guest-file-open: |
| 220 | # |
| 221 | # Open a file in the guest and retrieve a file handle for it |
| 222 | # |
Marc-André Lureau | 4d5c8bc | 2016-11-17 19:54:53 +0400 | [diff] [blame] | 223 | # @path: Full path to the file in the guest to open. |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 224 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 225 | # @mode: open mode, as per fopen(), "r" is the default. |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 226 | # |
| 227 | # Returns: Guest file handle on success. |
| 228 | # |
| 229 | # Since: 0.15.0 |
| 230 | ## |
| 231 | { 'command': 'guest-file-open', |
| 232 | 'data': { 'path': 'str', '*mode': 'str' }, |
| 233 | 'returns': 'int' } |
| 234 | |
| 235 | ## |
| 236 | # @guest-file-close: |
| 237 | # |
| 238 | # Close an open file in the guest |
| 239 | # |
| 240 | # @handle: filehandle returned by guest-file-open |
| 241 | # |
| 242 | # Returns: Nothing on success. |
| 243 | # |
| 244 | # Since: 0.15.0 |
| 245 | ## |
| 246 | { 'command': 'guest-file-close', |
| 247 | 'data': { 'handle': 'int' } } |
| 248 | |
| 249 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 250 | # @GuestFileRead: |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 251 | # |
| 252 | # Result of guest agent file-read operation |
| 253 | # |
| 254 | # @count: number of bytes read (note: count is *before* |
| 255 | # base64-encoding is applied) |
| 256 | # |
| 257 | # @buf-b64: base64-encoded bytes read |
| 258 | # |
| 259 | # @eof: whether EOF was encountered during read operation. |
| 260 | # |
| 261 | # Since: 0.15.0 |
| 262 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 263 | { 'struct': 'GuestFileRead', |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 264 | 'data': { 'count': 'int', 'buf-b64': 'str', 'eof': 'bool' } } |
| 265 | |
| 266 | ## |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 267 | # @guest-file-read: |
| 268 | # |
| 269 | # Read from an open file in the guest. Data will be base64-encoded |
| 270 | # |
| 271 | # @handle: filehandle returned by guest-file-open |
| 272 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 273 | # @count: maximum number of bytes to read (default is 4KB) |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 274 | # |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 275 | # Returns: @GuestFileRead on success. |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 276 | # |
| 277 | # Since: 0.15.0 |
| 278 | ## |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 279 | { 'command': 'guest-file-read', |
| 280 | 'data': { 'handle': 'int', '*count': 'int' }, |
| 281 | 'returns': 'GuestFileRead' } |
| 282 | |
| 283 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 284 | # @GuestFileWrite: |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 285 | # |
| 286 | # Result of guest agent file-write operation |
| 287 | # |
| 288 | # @count: number of bytes written (note: count is actual bytes |
| 289 | # written, after base64-decoding of provided buffer) |
| 290 | # |
| 291 | # @eof: whether EOF was encountered during write operation. |
| 292 | # |
| 293 | # Since: 0.15.0 |
| 294 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 295 | { 'struct': 'GuestFileWrite', |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 296 | 'data': { 'count': 'int', 'eof': 'bool' } } |
| 297 | |
| 298 | ## |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 299 | # @guest-file-write: |
| 300 | # |
| 301 | # Write to an open file in the guest. |
| 302 | # |
| 303 | # @handle: filehandle returned by guest-file-open |
| 304 | # |
| 305 | # @buf-b64: base64-encoded string representing data to be written |
| 306 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 307 | # @count: bytes to write (actual bytes, after base64-decode), |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 308 | # default is all content in buf-b64 buffer after base64 decoding |
| 309 | # |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 310 | # Returns: @GuestFileWrite on success. |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 311 | # |
| 312 | # Since: 0.15.0 |
| 313 | ## |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 314 | { 'command': 'guest-file-write', |
| 315 | 'data': { 'handle': 'int', 'buf-b64': 'str', '*count': 'int' }, |
| 316 | 'returns': 'GuestFileWrite' } |
| 317 | |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 318 | |
| 319 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 320 | # @GuestFileSeek: |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 321 | # |
| 322 | # Result of guest agent file-seek operation |
| 323 | # |
| 324 | # @position: current file position |
| 325 | # |
| 326 | # @eof: whether EOF was encountered during file seek |
| 327 | # |
| 328 | # Since: 0.15.0 |
| 329 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 330 | { 'struct': 'GuestFileSeek', |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 331 | 'data': { 'position': 'int', 'eof': 'bool' } } |
| 332 | |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 333 | ## |
Eric Blake | 0b4b493 | 2016-02-09 14:27:16 -0700 | [diff] [blame] | 334 | # @QGASeek: |
| 335 | # |
| 336 | # Symbolic names for use in @guest-file-seek |
| 337 | # |
| 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) |
| 341 | # |
| 342 | # Since: 2.6 |
| 343 | ## |
| 344 | { 'enum': 'QGASeek', 'data': [ 'set', 'cur', 'end' ] } |
| 345 | |
| 346 | ## |
| 347 | # @GuestFileWhence: |
| 348 | # |
| 349 | # Controls the meaning of offset to @guest-file-seek. |
| 350 | # |
| 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 |
| 355 | # |
| 356 | # Since: 2.6 |
| 357 | ## |
| 358 | { 'alternate': 'GuestFileWhence', |
| 359 | 'data': { 'value': 'int', 'name': 'QGASeek' } } |
| 360 | |
| 361 | ## |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 362 | # @guest-file-seek: |
| 363 | # |
| 364 | # Seek to a position in the file, as with fseek(), and return the |
| 365 | # current file position afterward. Also encapsulates ftell()'s |
Eric Blake | 0a982b1 | 2015-11-25 10:37:15 -0700 | [diff] [blame] | 366 | # functionality, with offset=0 and whence=1. |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 367 | # |
| 368 | # @handle: filehandle returned by guest-file-open |
| 369 | # |
| 370 | # @offset: bytes to skip over in the file stream |
| 371 | # |
Eric Blake | 0b4b493 | 2016-02-09 14:27:16 -0700 | [diff] [blame] | 372 | # @whence: Symbolic or numeric code for interpreting offset |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 373 | # |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 374 | # Returns: @GuestFileSeek on success. |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 375 | # |
| 376 | # Since: 0.15.0 |
| 377 | ## |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 378 | { 'command': 'guest-file-seek', |
Eric Blake | 0b4b493 | 2016-02-09 14:27:16 -0700 | [diff] [blame] | 379 | 'data': { 'handle': 'int', 'offset': 'int', |
| 380 | 'whence': 'GuestFileWhence' }, |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 381 | 'returns': 'GuestFileSeek' } |
| 382 | |
| 383 | ## |
| 384 | # @guest-file-flush: |
| 385 | # |
| 386 | # Write file changes bufferred in userspace to disk/kernel buffers |
| 387 | # |
| 388 | # @handle: filehandle returned by guest-file-open |
| 389 | # |
| 390 | # Returns: Nothing on success. |
| 391 | # |
| 392 | # Since: 0.15.0 |
| 393 | ## |
| 394 | { 'command': 'guest-file-flush', |
| 395 | 'data': { 'handle': 'int' } } |
| 396 | |
| 397 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 398 | # @GuestFsfreezeStatus: |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 399 | # |
Lei Li | 6932a69 | 2012-08-23 13:14:25 +0800 | [diff] [blame] | 400 | # An enumeration of filesystem freeze states |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 401 | # |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 402 | # @thawed: filesystems thawed/unfrozen |
| 403 | # |
| 404 | # @frozen: all non-network guest filesystems frozen |
| 405 | # |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 406 | # Since: 0.15.0 |
| 407 | ## |
| 408 | { 'enum': 'GuestFsfreezeStatus', |
Michael Roth | 9e8aded43 | 2012-04-16 19:52:17 -0500 | [diff] [blame] | 409 | 'data': [ 'thawed', 'frozen' ] } |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 410 | |
| 411 | ## |
| 412 | # @guest-fsfreeze-status: |
| 413 | # |
| 414 | # Get guest fsfreeze state. error state indicates |
| 415 | # |
| 416 | # Returns: GuestFsfreezeStatus ("thawed", "frozen", etc., as defined below) |
| 417 | # |
Michael Roth | 9e8aded43 | 2012-04-16 19:52:17 -0500 | [diff] [blame] | 418 | # Note: This may fail to properly report the current state as a result of |
Michael Roth | f789aa7 | 2012-04-18 16:28:01 -0500 | [diff] [blame] | 419 | # some other guest processes having issued an fs freeze/thaw. |
Michael Roth | 9e8aded43 | 2012-04-16 19:52:17 -0500 | [diff] [blame] | 420 | # |
Michael Roth | 5438372 | 2012-01-16 17:44:16 -0600 | [diff] [blame] | 421 | # Since: 0.15.0 |
| 422 | ## |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 423 | { 'command': 'guest-fsfreeze-status', |
| 424 | 'returns': 'GuestFsfreezeStatus' } |
| 425 | |
| 426 | ## |
| 427 | # @guest-fsfreeze-freeze: |
| 428 | # |
Marc-André Lureau | 1dbfbc1 | 2017-04-03 11:54:38 +0200 | [diff] [blame] | 429 | # Sync and freeze all freezable, local guest filesystems. If this |
| 430 | # command succeeded, you may call @guest-fsfreeze-thaw later to |
| 431 | # unfreeze. |
| 432 | # |
| 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. |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 436 | # |
Michael Roth | 9e8aded43 | 2012-04-16 19:52:17 -0500 | [diff] [blame] | 437 | # Returns: Number of file systems currently frozen. On error, all filesystems |
Chen Hanxiao | 65650f0 | 2018-06-14 16:10:13 +0800 | [diff] [blame] | 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. |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 441 | # |
| 442 | # Since: 0.15.0 |
| 443 | ## |
| 444 | { 'command': 'guest-fsfreeze-freeze', |
| 445 | 'returns': 'int' } |
| 446 | |
| 447 | ## |
Tomoki Sekiyama | e99bce2 | 2014-06-30 17:51:27 -0400 | [diff] [blame] | 448 | # @guest-fsfreeze-freeze-list: |
| 449 | # |
Marc-André Lureau | 1dbfbc1 | 2017-04-03 11:54:38 +0200 | [diff] [blame] | 450 | # Sync and freeze specified guest filesystems. |
| 451 | # See also @guest-fsfreeze-freeze. |
Tomoki Sekiyama | e99bce2 | 2014-06-30 17:51:27 -0400 | [diff] [blame] | 452 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 453 | # @mountpoints: an array of mountpoints of filesystems to be frozen. |
Tomoki Sekiyama | e99bce2 | 2014-06-30 17:51:27 -0400 | [diff] [blame] | 454 | # If omitted, every mounted filesystem is frozen. |
Marc-André Lureau | 1dbfbc1 | 2017-04-03 11:54:38 +0200 | [diff] [blame] | 455 | # Invalid mount points are ignored. |
Tomoki Sekiyama | e99bce2 | 2014-06-30 17:51:27 -0400 | [diff] [blame] | 456 | # |
| 457 | # Returns: Number of file systems currently frozen. On error, all filesystems |
| 458 | # will be thawed. |
| 459 | # |
| 460 | # Since: 2.2 |
| 461 | ## |
| 462 | { 'command': 'guest-fsfreeze-freeze-list', |
| 463 | 'data': { '*mountpoints': ['str'] }, |
| 464 | 'returns': 'int' } |
| 465 | |
| 466 | ## |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 467 | # @guest-fsfreeze-thaw: |
| 468 | # |
Michael Roth | 9e8aded43 | 2012-04-16 19:52:17 -0500 | [diff] [blame] | 469 | # Unfreeze all frozen guest filesystems |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 470 | # |
Michael Roth | 9e8aded43 | 2012-04-16 19:52:17 -0500 | [diff] [blame] | 471 | # Returns: Number of file systems thawed by this call |
| 472 | # |
| 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. |
Michael Roth | e3d4d25 | 2011-07-19 15:41:55 -0500 | [diff] [blame] | 478 | # |
| 479 | # Since: 0.15.0 |
| 480 | ## |
| 481 | { 'command': 'guest-fsfreeze-thaw', |
| 482 | 'returns': 'int' } |
Luiz Capitulino | 11d0f12 | 2012-02-28 11:03:03 -0300 | [diff] [blame] | 483 | |
| 484 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 485 | # @GuestFilesystemTrimResult: |
Justin Ossevoort | e82855d | 2015-05-11 08:58:45 +0200 | [diff] [blame] | 486 | # |
| 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 |
| 491 | # |
| 492 | # Since: 2.4 |
| 493 | ## |
| 494 | { 'struct': 'GuestFilesystemTrimResult', |
| 495 | 'data': {'path': 'str', |
| 496 | '*trimmed': 'int', '*minimum': 'int', '*error': 'str'} } |
| 497 | |
| 498 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 499 | # @GuestFilesystemTrimResponse: |
Justin Ossevoort | e82855d | 2015-05-11 08:58:45 +0200 | [diff] [blame] | 500 | # |
| 501 | # @paths: list of @GuestFilesystemTrimResult per path that was trimmed |
| 502 | # |
| 503 | # Since: 2.4 |
| 504 | ## |
| 505 | { 'struct': 'GuestFilesystemTrimResponse', |
| 506 | 'data': {'paths': ['GuestFilesystemTrimResult']} } |
| 507 | |
| 508 | ## |
Paolo Bonzini | eab5fd5 | 2012-06-13 07:41:28 +0200 | [diff] [blame] | 509 | # @guest-fstrim: |
| 510 | # |
| 511 | # Discard (or "trim") blocks which are not in use by the filesystem. |
| 512 | # |
| 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". |
| 520 | # |
Justin Ossevoort | e82855d | 2015-05-11 08:58:45 +0200 | [diff] [blame] | 521 | # Returns: A @GuestFilesystemTrimResponse which contains the |
| 522 | # status of all trimmed paths. (since 2.4) |
Paolo Bonzini | eab5fd5 | 2012-06-13 07:41:28 +0200 | [diff] [blame] | 523 | # |
| 524 | # Since: 1.2 |
| 525 | ## |
| 526 | { 'command': 'guest-fstrim', |
Justin Ossevoort | e82855d | 2015-05-11 08:58:45 +0200 | [diff] [blame] | 527 | 'data': { '*minimum': 'int' }, |
| 528 | 'returns': 'GuestFilesystemTrimResponse' } |
Paolo Bonzini | eab5fd5 | 2012-06-13 07:41:28 +0200 | [diff] [blame] | 529 | |
| 530 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 531 | # @guest-suspend-disk: |
Luiz Capitulino | 11d0f12 | 2012-02-28 11:03:03 -0300 | [diff] [blame] | 532 | # |
| 533 | # Suspend guest to disk. |
| 534 | # |
Daniel Henrique Barboza | bb6c8d4 | 2018-11-13 14:55:39 -0200 | [diff] [blame] | 535 | # This command attempts to suspend the guest using three strategies, in this |
| 536 | # order: |
Luiz Capitulino | 11d0f12 | 2012-02-28 11:03:03 -0300 | [diff] [blame] | 537 | # |
Daniel Henrique Barboza | bb6c8d4 | 2018-11-13 14:55:39 -0200 | [diff] [blame] | 538 | # - systemd hibernate |
| 539 | # - pm-utils (via pm-hibernate) |
| 540 | # - manual write into sysfs |
Luiz Capitulino | 11d0f12 | 2012-02-28 11:03:03 -0300 | [diff] [blame] | 541 | # |
Luiz Capitulino | c6fcc10 | 2012-05-08 14:24:47 -0300 | [diff] [blame] | 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. |
| 547 | # |
| 548 | # The following errors may be returned: |
Luiz Capitulino | 11d0f12 | 2012-02-28 11:03:03 -0300 | [diff] [blame] | 549 | # If suspend to disk is not supported, Unsupported |
| 550 | # |
Luiz Capitulino | c6fcc10 | 2012-05-08 14:24:47 -0300 | [diff] [blame] | 551 | # Notes: It's strongly recommended to issue the guest-sync command before |
| 552 | # sending commands when the guest resumes |
Luiz Capitulino | 11d0f12 | 2012-02-28 11:03:03 -0300 | [diff] [blame] | 553 | # |
| 554 | # Since: 1.1 |
| 555 | ## |
Eric Blake | d708cdb | 2015-05-04 09:05:19 -0600 | [diff] [blame] | 556 | { 'command': 'guest-suspend-disk', 'success-response': false } |
Luiz Capitulino | fbf4221 | 2012-02-28 11:03:04 -0300 | [diff] [blame] | 557 | |
| 558 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 559 | # @guest-suspend-ram: |
Luiz Capitulino | fbf4221 | 2012-02-28 11:03:04 -0300 | [diff] [blame] | 560 | # |
| 561 | # Suspend guest to ram. |
| 562 | # |
Daniel Henrique Barboza | bb6c8d4 | 2018-11-13 14:55:39 -0200 | [diff] [blame] | 563 | # This command attempts to suspend the guest using three strategies, in this |
| 564 | # order: |
Luiz Capitulino | fbf4221 | 2012-02-28 11:03:04 -0300 | [diff] [blame] | 565 | # |
Daniel Henrique Barboza | bb6c8d4 | 2018-11-13 14:55:39 -0200 | [diff] [blame] | 566 | # - systemd suspend |
| 567 | # - pm-utils (via pm-suspend) |
| 568 | # - manual write into sysfs |
Luiz Capitulino | fbf4221 | 2012-02-28 11:03:04 -0300 | [diff] [blame] | 569 | # |
Daniel Henrique Barboza | f8a5777 | 2018-12-05 17:47:00 -0200 | [diff] [blame] | 570 | # IMPORTANT: guest-suspend-ram requires working wakeup support in |
| 571 | # QEMU. You should check QMP command query-current-machine returns |
| 572 | # wakeup-suspend-support: true before issuing this command. Failure in |
| 573 | # doing so can result in a suspended guest that QEMU will not be able to |
| 574 | # awaken, forcing the user to power cycle the guest to bring it back. |
Luiz Capitulino | fbf4221 | 2012-02-28 11:03:04 -0300 | [diff] [blame] | 575 | # |
Luiz Capitulino | 432d29d | 2012-05-08 14:24:48 -0300 | [diff] [blame] | 576 | # This command does NOT return a response on success. There are two options |
| 577 | # to check for success: |
| 578 | # 1. Wait for the SUSPEND QMP event from QEMU |
| 579 | # 2. Issue the query-status QMP command to confirm the VM status is |
| 580 | # "suspended" |
| 581 | # |
| 582 | # The following errors may be returned: |
Luiz Capitulino | fbf4221 | 2012-02-28 11:03:04 -0300 | [diff] [blame] | 583 | # If suspend to ram is not supported, Unsupported |
| 584 | # |
Luiz Capitulino | 432d29d | 2012-05-08 14:24:48 -0300 | [diff] [blame] | 585 | # Notes: It's strongly recommended to issue the guest-sync command before |
| 586 | # sending commands when the guest resumes |
Luiz Capitulino | fbf4221 | 2012-02-28 11:03:04 -0300 | [diff] [blame] | 587 | # |
| 588 | # Since: 1.1 |
| 589 | ## |
Eric Blake | d708cdb | 2015-05-04 09:05:19 -0600 | [diff] [blame] | 590 | { 'command': 'guest-suspend-ram', 'success-response': false } |
Luiz Capitulino | 95f4f40 | 2012-02-28 11:03:05 -0300 | [diff] [blame] | 591 | |
| 592 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 593 | # @guest-suspend-hybrid: |
Luiz Capitulino | 95f4f40 | 2012-02-28 11:03:05 -0300 | [diff] [blame] | 594 | # |
| 595 | # Save guest state to disk and suspend to ram. |
| 596 | # |
Daniel Henrique Barboza | bb6c8d4 | 2018-11-13 14:55:39 -0200 | [diff] [blame] | 597 | # This command attempts to suspend the guest by executing, in this order: |
| 598 | # |
| 599 | # - systemd hybrid-sleep |
| 600 | # - pm-utils (via pm-suspend-hybrid) |
Luiz Capitulino | 95f4f40 | 2012-02-28 11:03:05 -0300 | [diff] [blame] | 601 | # |
Daniel Henrique Barboza | f8a5777 | 2018-12-05 17:47:00 -0200 | [diff] [blame] | 602 | # IMPORTANT: guest-suspend-hybrid requires working wakeup support in |
| 603 | # QEMU. You should check QMP command query-current-machine returns |
| 604 | # wakeup-suspend-support: true before issuing this command. Failure in |
| 605 | # doing so can result in a suspended guest that QEMU will not be able to |
| 606 | # awaken, forcing the user to power cycle the guest to bring it back. |
Luiz Capitulino | 95f4f40 | 2012-02-28 11:03:05 -0300 | [diff] [blame] | 607 | # |
Luiz Capitulino | d9fcd2a | 2012-05-08 14:24:49 -0300 | [diff] [blame] | 608 | # This command does NOT return a response on success. There are two options |
| 609 | # to check for success: |
| 610 | # 1. Wait for the SUSPEND QMP event from QEMU |
| 611 | # 2. Issue the query-status QMP command to confirm the VM status is |
| 612 | # "suspended" |
| 613 | # |
| 614 | # The following errors may be returned: |
Luiz Capitulino | 95f4f40 | 2012-02-28 11:03:05 -0300 | [diff] [blame] | 615 | # If hybrid suspend is not supported, Unsupported |
| 616 | # |
Luiz Capitulino | d9fcd2a | 2012-05-08 14:24:49 -0300 | [diff] [blame] | 617 | # Notes: It's strongly recommended to issue the guest-sync command before |
| 618 | # sending commands when the guest resumes |
Luiz Capitulino | 95f4f40 | 2012-02-28 11:03:05 -0300 | [diff] [blame] | 619 | # |
| 620 | # Since: 1.1 |
| 621 | ## |
Eric Blake | d708cdb | 2015-05-04 09:05:19 -0600 | [diff] [blame] | 622 | { 'command': 'guest-suspend-hybrid', 'success-response': false } |
Michal Privoznik | 3424fc9 | 2012-02-29 17:02:23 +0100 | [diff] [blame] | 623 | |
| 624 | ## |
| 625 | # @GuestIpAddressType: |
| 626 | # |
| 627 | # An enumeration of supported IP address types |
| 628 | # |
| 629 | # @ipv4: IP version 4 |
| 630 | # |
| 631 | # @ipv6: IP version 6 |
| 632 | # |
| 633 | # Since: 1.1 |
| 634 | ## |
| 635 | { 'enum': 'GuestIpAddressType', |
| 636 | 'data': [ 'ipv4', 'ipv6' ] } |
| 637 | |
| 638 | ## |
| 639 | # @GuestIpAddress: |
| 640 | # |
| 641 | # @ip-address: IP address |
| 642 | # |
| 643 | # @ip-address-type: Type of @ip-address (e.g. ipv4, ipv6) |
| 644 | # |
| 645 | # @prefix: Network prefix length of @ip-address |
| 646 | # |
| 647 | # Since: 1.1 |
| 648 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 649 | { 'struct': 'GuestIpAddress', |
Michal Privoznik | 3424fc9 | 2012-02-29 17:02:23 +0100 | [diff] [blame] | 650 | 'data': {'ip-address': 'str', |
| 651 | 'ip-address-type': 'GuestIpAddressType', |
| 652 | 'prefix': 'int'} } |
| 653 | |
| 654 | ## |
ZhiPeng Lu | 53f9fcb | 2017-09-12 16:54:26 +0800 | [diff] [blame] | 655 | # @GuestNetworkInterfaceStat: |
| 656 | # |
| 657 | # @rx-bytes: total bytes received |
| 658 | # |
| 659 | # @rx-packets: total packets received |
| 660 | # |
| 661 | # @rx-errs: bad packets received |
| 662 | # |
| 663 | # @rx-dropped: receiver dropped packets |
| 664 | # |
| 665 | # @tx-bytes: total bytes transmitted |
| 666 | # |
| 667 | # @tx-packets: total packets transmitted |
| 668 | # |
| 669 | # @tx-errs: packet transmit problems |
| 670 | # |
| 671 | # @tx-dropped: dropped packets transmitted |
| 672 | # |
| 673 | # Since: 2.11 |
| 674 | ## |
| 675 | { 'struct': 'GuestNetworkInterfaceStat', |
| 676 | 'data': {'rx-bytes': 'uint64', |
| 677 | 'rx-packets': 'uint64', |
| 678 | 'rx-errs': 'uint64', |
| 679 | 'rx-dropped': 'uint64', |
| 680 | 'tx-bytes': 'uint64', |
| 681 | 'tx-packets': 'uint64', |
| 682 | 'tx-errs': 'uint64', |
| 683 | 'tx-dropped': 'uint64' |
| 684 | } } |
| 685 | |
| 686 | ## |
Michal Privoznik | 3424fc9 | 2012-02-29 17:02:23 +0100 | [diff] [blame] | 687 | # @GuestNetworkInterface: |
| 688 | # |
| 689 | # @name: The name of interface for which info are being delivered |
| 690 | # |
| 691 | # @hardware-address: Hardware address of @name |
| 692 | # |
| 693 | # @ip-addresses: List of addresses assigned to @name |
| 694 | # |
ZhiPeng Lu | 53f9fcb | 2017-09-12 16:54:26 +0800 | [diff] [blame] | 695 | # @statistics: various statistic counters related to @name |
| 696 | # (since 2.11) |
| 697 | # |
Michal Privoznik | 3424fc9 | 2012-02-29 17:02:23 +0100 | [diff] [blame] | 698 | # Since: 1.1 |
| 699 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 700 | { 'struct': 'GuestNetworkInterface', |
Michal Privoznik | 3424fc9 | 2012-02-29 17:02:23 +0100 | [diff] [blame] | 701 | 'data': {'name': 'str', |
| 702 | '*hardware-address': 'str', |
ZhiPeng Lu | 53f9fcb | 2017-09-12 16:54:26 +0800 | [diff] [blame] | 703 | '*ip-addresses': ['GuestIpAddress'], |
| 704 | '*statistics': 'GuestNetworkInterfaceStat' } } |
Michal Privoznik | 3424fc9 | 2012-02-29 17:02:23 +0100 | [diff] [blame] | 705 | |
| 706 | ## |
| 707 | # @guest-network-get-interfaces: |
| 708 | # |
| 709 | # Get list of guest IP addresses, MAC addresses |
| 710 | # and netmasks. |
| 711 | # |
| 712 | # Returns: List of GuestNetworkInfo on success. |
| 713 | # |
| 714 | # Since: 1.1 |
| 715 | ## |
| 716 | { 'command': 'guest-network-get-interfaces', |
| 717 | 'returns': ['GuestNetworkInterface'] } |
Laszlo Ersek | 70e133a | 2013-03-06 22:59:29 +0100 | [diff] [blame] | 718 | |
| 719 | ## |
| 720 | # @GuestLogicalProcessor: |
| 721 | # |
| 722 | # @logical-id: Arbitrary guest-specific unique identifier of the VCPU. |
| 723 | # |
| 724 | # @online: Whether the VCPU is enabled. |
| 725 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 726 | # @can-offline: Whether offlining the VCPU is possible. This member |
Laszlo Ersek | c964c9e | 2013-03-15 19:07:50 +0100 | [diff] [blame] | 727 | # is always filled in by the guest agent when the structure is |
| 728 | # returned, and always ignored on input (hence it can be omitted |
| 729 | # then). |
Laszlo Ersek | 70e133a | 2013-03-06 22:59:29 +0100 | [diff] [blame] | 730 | # |
| 731 | # Since: 1.5 |
| 732 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 733 | { 'struct': 'GuestLogicalProcessor', |
Laszlo Ersek | 70e133a | 2013-03-06 22:59:29 +0100 | [diff] [blame] | 734 | 'data': {'logical-id': 'int', |
| 735 | 'online': 'bool', |
| 736 | '*can-offline': 'bool'} } |
| 737 | |
| 738 | ## |
| 739 | # @guest-get-vcpus: |
| 740 | # |
| 741 | # Retrieve the list of the guest's logical processors. |
| 742 | # |
| 743 | # This is a read-only operation. |
| 744 | # |
| 745 | # Returns: The list of all VCPUs the guest knows about. Each VCPU is put on the |
| 746 | # list exactly once, but their order is unspecified. |
| 747 | # |
| 748 | # Since: 1.5 |
| 749 | ## |
| 750 | { 'command': 'guest-get-vcpus', |
| 751 | 'returns': ['GuestLogicalProcessor'] } |
| 752 | |
| 753 | ## |
| 754 | # @guest-set-vcpus: |
| 755 | # |
| 756 | # Attempt to reconfigure (currently: enable/disable) logical processors inside |
| 757 | # the guest. |
| 758 | # |
| 759 | # The input list is processed node by node in order. In each node @logical-id |
| 760 | # is used to look up the guest VCPU, for which @online specifies the requested |
| 761 | # state. The set of distinct @logical-id's is only required to be a subset of |
| 762 | # the guest-supported identifiers. There's no restriction on list length or on |
| 763 | # repeating the same @logical-id (with possibly different @online field). |
| 764 | # Preferably the input list should describe a modified subset of |
| 765 | # @guest-get-vcpus' return value. |
| 766 | # |
| 767 | # Returns: The length of the initial sublist that has been successfully |
| 768 | # processed. The guest agent maximizes this value. Possible cases: |
| 769 | # |
Marc-André Lureau | ae4dbed | 2017-01-13 15:41:20 +0100 | [diff] [blame] | 770 | # - 0: if the @vcpus list was empty on input. Guest state |
Laszlo Ersek | 70e133a | 2013-03-06 22:59:29 +0100 | [diff] [blame] | 771 | # has not been changed. Otherwise, |
Marc-André Lureau | ae4dbed | 2017-01-13 15:41:20 +0100 | [diff] [blame] | 772 | # - Error: processing the first node of @vcpus failed for the |
Laszlo Ersek | 70e133a | 2013-03-06 22:59:29 +0100 | [diff] [blame] | 773 | # reason returned. Guest state has not been changed. |
| 774 | # Otherwise, |
Marc-André Lureau | ae4dbed | 2017-01-13 15:41:20 +0100 | [diff] [blame] | 775 | # - < length(@vcpus): more than zero initial nodes have been processed, |
Laszlo Ersek | 70e133a | 2013-03-06 22:59:29 +0100 | [diff] [blame] | 776 | # but not the entire @vcpus list. Guest state has |
| 777 | # changed accordingly. To retrieve the error |
| 778 | # (assuming it persists), repeat the call with the |
| 779 | # successfully processed initial sublist removed. |
| 780 | # Otherwise, |
Marc-André Lureau | ae4dbed | 2017-01-13 15:41:20 +0100 | [diff] [blame] | 781 | # - length(@vcpus): call successful. |
Laszlo Ersek | 70e133a | 2013-03-06 22:59:29 +0100 | [diff] [blame] | 782 | # |
| 783 | # Since: 1.5 |
| 784 | ## |
| 785 | { 'command': 'guest-set-vcpus', |
| 786 | 'data': {'vcpus': ['GuestLogicalProcessor'] }, |
| 787 | 'returns': 'int' } |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 788 | |
| 789 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 790 | # @GuestDiskBusType: |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 791 | # |
| 792 | # An enumeration of bus type of disks |
| 793 | # |
| 794 | # @ide: IDE disks |
| 795 | # @fdc: floppy disks |
| 796 | # @scsi: SCSI disks |
| 797 | # @virtio: virtio disks |
| 798 | # @xen: Xen disks |
| 799 | # @usb: USB disks |
| 800 | # @uml: UML disks |
| 801 | # @sata: SATA disks |
| 802 | # @sd: SD cards |
Olga Krishtal | a3ef3b2 | 2015-06-30 13:25:22 +0300 | [diff] [blame] | 803 | # @unknown: Unknown bus type |
| 804 | # @ieee1394: Win IEEE 1394 bus type |
| 805 | # @ssa: Win SSA bus type |
| 806 | # @fibre: Win fiber channel bus type |
| 807 | # @raid: Win RAID bus type |
| 808 | # @iscsi: Win iScsi bus type |
| 809 | # @sas: Win serial-attaches SCSI bus type |
| 810 | # @mmc: Win multimedia card (MMC) bus type |
| 811 | # @virtual: Win virtual bus type |
| 812 | # @file-backed virtual: Win file-backed bus type |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 813 | # |
Olga Krishtal | 5f8343d | 2015-07-21 15:25:08 +0300 | [diff] [blame] | 814 | # Since: 2.2; 'Unknown' and all entries below since 2.4 |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 815 | ## |
| 816 | { 'enum': 'GuestDiskBusType', |
| 817 | 'data': [ 'ide', 'fdc', 'scsi', 'virtio', 'xen', 'usb', 'uml', 'sata', |
Olga Krishtal | a3ef3b2 | 2015-06-30 13:25:22 +0300 | [diff] [blame] | 818 | 'sd', 'unknown', 'ieee1394', 'ssa', 'fibre', 'raid', 'iscsi', |
| 819 | 'sas', 'mmc', 'virtual', 'file-backed-virtual' ] } |
| 820 | |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 821 | |
| 822 | ## |
| 823 | # @GuestPCIAddress: |
| 824 | # |
| 825 | # @domain: domain id |
| 826 | # @bus: bus id |
| 827 | # @slot: slot id |
| 828 | # @function: function id |
| 829 | # |
| 830 | # Since: 2.2 |
| 831 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 832 | { 'struct': 'GuestPCIAddress', |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 833 | 'data': {'domain': 'int', 'bus': 'int', |
| 834 | 'slot': 'int', 'function': 'int'} } |
| 835 | |
| 836 | ## |
| 837 | # @GuestDiskAddress: |
| 838 | # |
| 839 | # @pci-controller: controller's PCI address |
Marc-André Lureau | 4d5c8bc | 2016-11-17 19:54:53 +0400 | [diff] [blame] | 840 | # @bus-type: bus type |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 841 | # @bus: bus id |
| 842 | # @target: target id |
| 843 | # @unit: unit id |
Tomáš Golembiovský | b616105 | 2018-10-23 13:23:11 +0200 | [diff] [blame] | 844 | # @serial: serial number (since: 3.1) |
Tomáš Golembiovský | 6589ce3 | 2018-10-23 13:23:12 +0200 | [diff] [blame] | 845 | # @dev: device node (POSIX) or device UNC (Windows) (since: 3.1) |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 846 | # |
| 847 | # Since: 2.2 |
| 848 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 849 | { 'struct': 'GuestDiskAddress', |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 850 | 'data': {'pci-controller': 'GuestPCIAddress', |
| 851 | 'bus-type': 'GuestDiskBusType', |
Tomáš Golembiovský | b616105 | 2018-10-23 13:23:11 +0200 | [diff] [blame] | 852 | 'bus': 'int', 'target': 'int', 'unit': 'int', |
Tomáš Golembiovský | 6589ce3 | 2018-10-23 13:23:12 +0200 | [diff] [blame] | 853 | '*serial': 'str', '*dev': 'str'} } |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 854 | |
| 855 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 856 | # @GuestFilesystemInfo: |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 857 | # |
| 858 | # @name: disk name |
| 859 | # @mountpoint: mount point path |
| 860 | # @type: file system type string |
Chen Hanxiao | 25b5ff1 | 2018-06-14 16:06:06 +0800 | [diff] [blame] | 861 | # @used-bytes: file system used bytes (since 3.0) |
| 862 | # @total-bytes: non-root file system total bytes (since 3.0) |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 863 | # @disk: an array of disk hardware information that the volume lies on, |
| 864 | # which may be empty if the disk type is not supported |
| 865 | # |
| 866 | # Since: 2.2 |
| 867 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 868 | { 'struct': 'GuestFilesystemInfo', |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 869 | 'data': {'name': 'str', 'mountpoint': 'str', 'type': 'str', |
Chen Hanxiao | 25b5ff1 | 2018-06-14 16:06:06 +0800 | [diff] [blame] | 870 | '*used-bytes': 'uint64', '*total-bytes': 'uint64', |
Tomoki Sekiyama | 46d4c57 | 2014-06-30 17:51:34 -0400 | [diff] [blame] | 871 | 'disk': ['GuestDiskAddress']} } |
| 872 | |
| 873 | ## |
| 874 | # @guest-get-fsinfo: |
| 875 | # |
| 876 | # Returns: The list of filesystems information mounted in the guest. |
| 877 | # The returned mountpoints may be specified to |
| 878 | # @guest-fsfreeze-freeze-list. |
| 879 | # Network filesystems (such as CIFS and NFS) are not listed. |
| 880 | # |
| 881 | # Since: 2.2 |
| 882 | ## |
| 883 | { 'command': 'guest-get-fsinfo', |
| 884 | 'returns': ['GuestFilesystemInfo'] } |
Daniel P. Berrange | 215a277 | 2015-02-11 11:26:12 +0000 | [diff] [blame] | 885 | |
| 886 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 887 | # @guest-set-user-password: |
Daniel P. Berrange | 215a277 | 2015-02-11 11:26:12 +0000 | [diff] [blame] | 888 | # |
| 889 | # @username: the user account whose password to change |
| 890 | # @password: the new password entry string, base64 encoded |
| 891 | # @crypted: true if password is already crypt()d, false if raw |
| 892 | # |
| 893 | # If the @crypted flag is true, it is the caller's responsibility |
| 894 | # to ensure the correct crypt() encryption scheme is used. This |
| 895 | # command does not attempt to interpret or report on the encryption |
| 896 | # scheme. Refer to the documentation of the guest operating system |
| 897 | # in question to determine what is supported. |
| 898 | # |
Marc-André Lureau | 2e2a58e | 2015-08-27 01:34:47 +0200 | [diff] [blame] | 899 | # Not all guest operating systems will support use of the |
Daniel P. Berrange | 215a277 | 2015-02-11 11:26:12 +0000 | [diff] [blame] | 900 | # @crypted flag, as they may require the clear-text password |
| 901 | # |
| 902 | # The @password parameter must always be base64 encoded before |
| 903 | # transmission, even if already crypt()d, to ensure it is 8-bit |
| 904 | # safe when passed as JSON. |
| 905 | # |
| 906 | # Returns: Nothing on success. |
| 907 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 908 | # Since: 2.3 |
Daniel P. Berrange | 215a277 | 2015-02-11 11:26:12 +0000 | [diff] [blame] | 909 | ## |
| 910 | { 'command': 'guest-set-user-password', |
| 911 | 'data': { 'username': 'str', 'password': 'str', 'crypted': 'bool' } } |
zhanghailiang | a065aaa | 2015-01-22 10:40:02 +0800 | [diff] [blame] | 912 | |
Marc-André Lureau | 49687ac | 2016-11-17 19:54:51 +0400 | [diff] [blame] | 913 | ## |
zhanghailiang | a065aaa | 2015-01-22 10:40:02 +0800 | [diff] [blame] | 914 | # @GuestMemoryBlock: |
| 915 | # |
| 916 | # @phys-index: Arbitrary guest-specific unique identifier of the MEMORY BLOCK. |
| 917 | # |
| 918 | # @online: Whether the MEMORY BLOCK is enabled in guest. |
| 919 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 920 | # @can-offline: Whether offlining the MEMORY BLOCK is possible. |
zhanghailiang | a065aaa | 2015-01-22 10:40:02 +0800 | [diff] [blame] | 921 | # This member is always filled in by the guest agent when the |
| 922 | # structure is returned, and always ignored on input (hence it |
| 923 | # can be omitted then). |
| 924 | # |
| 925 | # Since: 2.3 |
| 926 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 927 | { 'struct': 'GuestMemoryBlock', |
zhanghailiang | a065aaa | 2015-01-22 10:40:02 +0800 | [diff] [blame] | 928 | 'data': {'phys-index': 'uint64', |
| 929 | 'online': 'bool', |
| 930 | '*can-offline': 'bool'} } |
| 931 | |
| 932 | ## |
| 933 | # @guest-get-memory-blocks: |
| 934 | # |
| 935 | # Retrieve the list of the guest's memory blocks. |
| 936 | # |
| 937 | # This is a read-only operation. |
| 938 | # |
| 939 | # Returns: The list of all memory blocks the guest knows about. |
| 940 | # Each memory block is put on the list exactly once, but their order |
| 941 | # is unspecified. |
| 942 | # |
| 943 | # Since: 2.3 |
| 944 | ## |
| 945 | { 'command': 'guest-get-memory-blocks', |
| 946 | 'returns': ['GuestMemoryBlock'] } |
| 947 | |
| 948 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 949 | # @GuestMemoryBlockResponseType: |
zhanghailiang | a065aaa | 2015-01-22 10:40:02 +0800 | [diff] [blame] | 950 | # |
| 951 | # An enumeration of memory block operation result. |
| 952 | # |
Stefan Weil | 631b22e | 2015-04-09 20:32:39 +0200 | [diff] [blame] | 953 | # @success: the operation of online/offline memory block is successful. |
zhanghailiang | a065aaa | 2015-01-22 10:40:02 +0800 | [diff] [blame] | 954 | # @not-found: can't find the corresponding memoryXXX directory in sysfs. |
| 955 | # @operation-not-supported: for some old kernels, it does not support |
| 956 | # online or offline memory block. |
| 957 | # @operation-failed: the operation of online/offline memory block fails, |
| 958 | # because of some errors happen. |
| 959 | # |
| 960 | # Since: 2.3 |
| 961 | ## |
| 962 | { 'enum': 'GuestMemoryBlockResponseType', |
| 963 | 'data': ['success', 'not-found', 'operation-not-supported', |
| 964 | 'operation-failed'] } |
| 965 | |
| 966 | ## |
| 967 | # @GuestMemoryBlockResponse: |
| 968 | # |
| 969 | # @phys-index: same with the 'phys-index' member of @GuestMemoryBlock. |
| 970 | # |
| 971 | # @response: the result of memory block operation. |
| 972 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 973 | # @error-code: the error number. |
zhanghailiang | a065aaa | 2015-01-22 10:40:02 +0800 | [diff] [blame] | 974 | # When memory block operation fails, we assign the value of |
| 975 | # 'errno' to this member, it indicates what goes wrong. |
| 976 | # When the operation succeeds, it will be omitted. |
| 977 | # |
| 978 | # Since: 2.3 |
| 979 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 980 | { 'struct': 'GuestMemoryBlockResponse', |
zhanghailiang | a065aaa | 2015-01-22 10:40:02 +0800 | [diff] [blame] | 981 | 'data': { 'phys-index': 'uint64', |
| 982 | 'response': 'GuestMemoryBlockResponseType', |
| 983 | '*error-code': 'int' }} |
| 984 | |
| 985 | ## |
| 986 | # @guest-set-memory-blocks: |
| 987 | # |
| 988 | # Attempt to reconfigure (currently: enable/disable) state of memory blocks |
| 989 | # inside the guest. |
| 990 | # |
| 991 | # The input list is processed node by node in order. In each node @phys-index |
| 992 | # is used to look up the guest MEMORY BLOCK, for which @online specifies the |
| 993 | # requested state. The set of distinct @phys-index's is only required to be a |
| 994 | # subset of the guest-supported identifiers. There's no restriction on list |
| 995 | # length or on repeating the same @phys-index (with possibly different @online |
| 996 | # field). |
| 997 | # Preferably the input list should describe a modified subset of |
| 998 | # @guest-get-memory-blocks' return value. |
| 999 | # |
| 1000 | # Returns: The operation results, it is a list of @GuestMemoryBlockResponse, |
| 1001 | # which is corresponding to the input list. |
| 1002 | # |
| 1003 | # Note: it will return NULL if the @mem-blks list was empty on input, |
| 1004 | # or there is an error, and in this case, guest state will not be |
| 1005 | # changed. |
| 1006 | # |
| 1007 | # Since: 2.3 |
| 1008 | ## |
| 1009 | { 'command': 'guest-set-memory-blocks', |
| 1010 | 'data': {'mem-blks': ['GuestMemoryBlock'] }, |
| 1011 | 'returns': ['GuestMemoryBlockResponse'] } |
| 1012 | |
Marc-André Lureau | 49687ac | 2016-11-17 19:54:51 +0400 | [diff] [blame] | 1013 | ## |
zhanghailiang | a065aaa | 2015-01-22 10:40:02 +0800 | [diff] [blame] | 1014 | # @GuestMemoryBlockInfo: |
| 1015 | # |
| 1016 | # @size: the size (in bytes) of the guest memory blocks, |
| 1017 | # which are the minimal units of memory block online/offline |
| 1018 | # operations (also called Logical Memory Hotplug). |
| 1019 | # |
| 1020 | # Since: 2.3 |
| 1021 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 1022 | { 'struct': 'GuestMemoryBlockInfo', |
zhanghailiang | a065aaa | 2015-01-22 10:40:02 +0800 | [diff] [blame] | 1023 | 'data': {'size': 'uint64'} } |
| 1024 | |
| 1025 | ## |
| 1026 | # @guest-get-memory-block-info: |
| 1027 | # |
| 1028 | # Get information relating to guest memory blocks. |
| 1029 | # |
zhanghailiang | a065aaa | 2015-01-22 10:40:02 +0800 | [diff] [blame] | 1030 | # Returns: @GuestMemoryBlockInfo |
| 1031 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1032 | # Since: 2.3 |
zhanghailiang | a065aaa | 2015-01-22 10:40:02 +0800 | [diff] [blame] | 1033 | ## |
| 1034 | { 'command': 'guest-get-memory-block-info', |
| 1035 | 'returns': 'GuestMemoryBlockInfo' } |
Yuri Pudgorodskiy | d697e30 | 2015-10-13 18:41:20 +0300 | [diff] [blame] | 1036 | |
Marc-André Lureau | 49687ac | 2016-11-17 19:54:51 +0400 | [diff] [blame] | 1037 | ## |
Yuri Pudgorodskiy | d697e30 | 2015-10-13 18:41:20 +0300 | [diff] [blame] | 1038 | # @GuestExecStatus: |
| 1039 | # |
| 1040 | # @exited: true if process has already terminated. |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1041 | # @exitcode: process exit code if it was normally terminated. |
| 1042 | # @signal: signal number (linux) or unhandled exception code |
Yuri Pudgorodskiy | d697e30 | 2015-10-13 18:41:20 +0300 | [diff] [blame] | 1043 | # (windows) if the process was abnormally terminated. |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1044 | # @out-data: base64-encoded stdout of the process |
| 1045 | # @err-data: base64-encoded stderr of the process |
Yuri Pudgorodskiy | d697e30 | 2015-10-13 18:41:20 +0300 | [diff] [blame] | 1046 | # Note: @out-data and @err-data are present only |
| 1047 | # if 'capture-output' was specified for 'guest-exec' |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1048 | # @out-truncated: true if stdout was not fully captured |
Yuri Pudgorodskiy | a1853dc | 2015-10-13 18:41:23 +0300 | [diff] [blame] | 1049 | # due to size limitation. |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1050 | # @err-truncated: true if stderr was not fully captured |
Yuri Pudgorodskiy | a1853dc | 2015-10-13 18:41:23 +0300 | [diff] [blame] | 1051 | # due to size limitation. |
Yuri Pudgorodskiy | d697e30 | 2015-10-13 18:41:20 +0300 | [diff] [blame] | 1052 | # |
| 1053 | # Since: 2.5 |
| 1054 | ## |
| 1055 | { 'struct': 'GuestExecStatus', |
| 1056 | 'data': { 'exited': 'bool', '*exitcode': 'int', '*signal': 'int', |
Yuri Pudgorodskiy | a1853dc | 2015-10-13 18:41:23 +0300 | [diff] [blame] | 1057 | '*out-data': 'str', '*err-data': 'str', |
| 1058 | '*out-truncated': 'bool', '*err-truncated': 'bool' }} |
Yuri Pudgorodskiy | d697e30 | 2015-10-13 18:41:20 +0300 | [diff] [blame] | 1059 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1060 | # @guest-exec-status: |
Yuri Pudgorodskiy | d697e30 | 2015-10-13 18:41:20 +0300 | [diff] [blame] | 1061 | # |
| 1062 | # Check status of process associated with PID retrieved via guest-exec. |
| 1063 | # Reap the process and associated metadata if it has exited. |
| 1064 | # |
| 1065 | # @pid: pid returned from guest-exec |
| 1066 | # |
| 1067 | # Returns: GuestExecStatus on success. |
| 1068 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1069 | # Since: 2.5 |
Yuri Pudgorodskiy | d697e30 | 2015-10-13 18:41:20 +0300 | [diff] [blame] | 1070 | ## |
| 1071 | { 'command': 'guest-exec-status', |
| 1072 | 'data': { 'pid': 'int' }, |
| 1073 | 'returns': 'GuestExecStatus' } |
| 1074 | |
| 1075 | ## |
| 1076 | # @GuestExec: |
| 1077 | # @pid: pid of child process in guest OS |
| 1078 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1079 | # Since: 2.5 |
Yuri Pudgorodskiy | d697e30 | 2015-10-13 18:41:20 +0300 | [diff] [blame] | 1080 | ## |
| 1081 | { 'struct': 'GuestExec', |
| 1082 | 'data': { 'pid': 'int'} } |
| 1083 | |
| 1084 | ## |
| 1085 | # @guest-exec: |
| 1086 | # |
| 1087 | # Execute a command in the guest |
| 1088 | # |
| 1089 | # @path: path or executable name to execute |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1090 | # @arg: argument list to pass to executable |
| 1091 | # @env: environment variables to pass to executable |
| 1092 | # @input-data: data to be passed to process stdin (base64 encoded) |
| 1093 | # @capture-output: bool flag to enable capture of |
Yuri Pudgorodskiy | d697e30 | 2015-10-13 18:41:20 +0300 | [diff] [blame] | 1094 | # stdout/stderr of running process. defaults to false. |
| 1095 | # |
| 1096 | # Returns: PID on success. |
| 1097 | # |
| 1098 | # Since: 2.5 |
| 1099 | ## |
| 1100 | { 'command': 'guest-exec', |
| 1101 | 'data': { 'path': 'str', '*arg': ['str'], '*env': ['str'], |
| 1102 | '*input-data': 'str', '*capture-output': 'bool' }, |
| 1103 | 'returns': 'GuestExec' } |
Vinzenz Feenstra | 0a3d197 | 2017-04-04 08:46:31 +0200 | [diff] [blame] | 1104 | |
| 1105 | |
| 1106 | ## |
| 1107 | # @GuestHostName: |
| 1108 | # @host-name: Fully qualified domain name of the guest OS |
| 1109 | # |
| 1110 | # Since: 2.10 |
| 1111 | ## |
| 1112 | { 'struct': 'GuestHostName', |
| 1113 | 'data': { 'host-name': 'str' } } |
| 1114 | |
| 1115 | ## |
| 1116 | # @guest-get-host-name: |
| 1117 | # |
| 1118 | # Return a name for the machine. |
| 1119 | # |
| 1120 | # The returned name is not necessarily a fully-qualified domain name, or even |
| 1121 | # present in DNS or some other name service at all. It need not even be unique |
| 1122 | # on your local network or site, but usually it is. |
| 1123 | # |
| 1124 | # Returns: the host name of the machine on success |
| 1125 | # |
| 1126 | # Since: 2.10 |
| 1127 | ## |
| 1128 | { 'command': 'guest-get-host-name', |
| 1129 | 'returns': 'GuestHostName' } |
Vinzenz Feenstra | 161a56a | 2017-04-19 11:26:15 +0200 | [diff] [blame] | 1130 | |
| 1131 | |
| 1132 | ## |
| 1133 | # @GuestUser: |
| 1134 | # @user: Username |
| 1135 | # @domain: Logon domain (windows only) |
| 1136 | # @login-time: Time of login of this user on the computer. If multiple |
| 1137 | # instances of the user are logged in, the earliest login time is |
| 1138 | # reported. The value is in fractional seconds since epoch time. |
| 1139 | # |
| 1140 | # Since: 2.10 |
| 1141 | ## |
| 1142 | { 'struct': 'GuestUser', |
| 1143 | 'data': { 'user': 'str', 'login-time': 'number', '*domain': 'str' } } |
| 1144 | |
| 1145 | ## |
| 1146 | # @guest-get-users: |
| 1147 | # Retrieves a list of currently active users on the VM. |
| 1148 | # |
| 1149 | # Returns: A unique list of users. |
| 1150 | # |
| 1151 | # Since: 2.10 |
| 1152 | ## |
| 1153 | { 'command': 'guest-get-users', |
| 1154 | 'returns': ['GuestUser'] } |
Vinzenz Feenstra | 53c58e6 | 2017-04-19 12:52:58 +0200 | [diff] [blame] | 1155 | |
| 1156 | ## |
| 1157 | # @GuestTimezone: |
| 1158 | # |
| 1159 | # @zone: Timezone name. These values may differ depending on guest/OS and |
| 1160 | # should only be used for informational purposes. |
| 1161 | # @offset: Offset to UTC in seconds, negative numbers for time zones west of |
| 1162 | # GMT, positive numbers for east |
| 1163 | # |
| 1164 | # Since: 2.10 |
| 1165 | ## |
| 1166 | { 'struct': 'GuestTimezone', |
| 1167 | 'data': { '*zone': 'str', 'offset': 'int' } } |
| 1168 | |
| 1169 | ## |
| 1170 | # @guest-get-timezone: |
| 1171 | # |
| 1172 | # Retrieves the timezone information from the guest. |
| 1173 | # |
| 1174 | # Returns: A GuestTimezone dictionary. |
| 1175 | # |
| 1176 | # Since: 2.10 |
| 1177 | ## |
| 1178 | { 'command': 'guest-get-timezone', |
| 1179 | 'returns': 'GuestTimezone' } |
Tomáš Golembiovský | 9848f79 | 2017-07-14 16:28:56 +0200 | [diff] [blame] | 1180 | |
| 1181 | ## |
| 1182 | # @GuestOSInfo: |
| 1183 | # |
| 1184 | # @kernel-release: |
| 1185 | # * POSIX: release field returned by uname(2) |
Tomáš Golembiovský | 84ece8e | 2018-04-20 20:12:45 +0200 | [diff] [blame] | 1186 | # * Windows: build number of the OS |
Tomáš Golembiovský | 9848f79 | 2017-07-14 16:28:56 +0200 | [diff] [blame] | 1187 | # @kernel-version: |
| 1188 | # * POSIX: version field returned by uname(2) |
Tomáš Golembiovský | 84ece8e | 2018-04-20 20:12:45 +0200 | [diff] [blame] | 1189 | # * Windows: version number of the OS |
Tomáš Golembiovský | 9848f79 | 2017-07-14 16:28:56 +0200 | [diff] [blame] | 1190 | # @machine: |
| 1191 | # * POSIX: machine field returned by uname(2) |
| 1192 | # * Windows: one of x86, x86_64, arm, ia64 |
| 1193 | # @id: |
| 1194 | # * POSIX: as defined by os-release(5) |
| 1195 | # * Windows: contains string "mswindows" |
| 1196 | # @name: |
| 1197 | # * POSIX: as defined by os-release(5) |
| 1198 | # * Windows: contains string "Microsoft Windows" |
| 1199 | # @pretty-name: |
| 1200 | # * POSIX: as defined by os-release(5) |
| 1201 | # * Windows: product name, e.g. "Microsoft Windows 10 Enterprise" |
| 1202 | # @version: |
| 1203 | # * POSIX: as defined by os-release(5) |
| 1204 | # * Windows: long version string, e.g. "Microsoft Windows Server 2008" |
| 1205 | # @version-id: |
| 1206 | # * POSIX: as defined by os-release(5) |
| 1207 | # * Windows: short version identifier, e.g. "7" or "20012r2" |
| 1208 | # @variant: |
| 1209 | # * POSIX: as defined by os-release(5) |
| 1210 | # * Windows: contains string "server" or "client" |
| 1211 | # @variant-id: |
| 1212 | # * POSIX: as defined by os-release(5) |
| 1213 | # * Windows: contains string "server" or "client" |
| 1214 | # |
| 1215 | # Notes: |
| 1216 | # |
| 1217 | # On POSIX systems the fields @id, @name, @pretty-name, @version, @version-id, |
| 1218 | # @variant and @variant-id follow the definition specified in os-release(5). |
| 1219 | # Refer to the manual page for exact description of the fields. Their values |
| 1220 | # are taken from the os-release file. If the file is not present in the system, |
| 1221 | # or the values are not present in the file, the fields are not included. |
| 1222 | # |
| 1223 | # On Windows the values are filled from information gathered from the system. |
| 1224 | # |
| 1225 | # Since: 2.10 |
| 1226 | ## |
| 1227 | { 'struct': 'GuestOSInfo', |
| 1228 | 'data': { |
| 1229 | '*kernel-release': 'str', '*kernel-version': 'str', |
| 1230 | '*machine': 'str', '*id': 'str', '*name': 'str', |
| 1231 | '*pretty-name': 'str', '*version': 'str', '*version-id': 'str', |
| 1232 | '*variant': 'str', '*variant-id': 'str' } } |
| 1233 | |
| 1234 | ## |
| 1235 | # @guest-get-osinfo: |
| 1236 | # |
| 1237 | # Retrieve guest operating system information |
| 1238 | # |
| 1239 | # Returns: @GuestOSInfo |
| 1240 | # |
| 1241 | # Since: 2.10 |
| 1242 | ## |
| 1243 | { 'command': 'guest-get-osinfo', |
| 1244 | 'returns': 'GuestOSInfo' } |