Benoît Canet | d34bda7 | 2014-06-05 13:45:29 +0200 | [diff] [blame] | 1 | # -*- Mode: Python -*- |
Marc-André Lureau | d3a4837 | 2017-01-13 15:41:23 +0100 | [diff] [blame] | 2 | |
| 3 | ## |
| 4 | # = QAPI common definitions |
| 5 | ## |
Benoît Canet | d34bda7 | 2014-06-05 13:45:29 +0200 | [diff] [blame] | 6 | |
| 7 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 8 | # @QapiErrorClass: |
Benoît Canet | d34bda7 | 2014-06-05 13:45:29 +0200 | [diff] [blame] | 9 | # |
| 10 | # QEMU error classes |
| 11 | # |
| 12 | # @GenericError: this is used for errors that don't require a specific error |
| 13 | # class. This should be the default case for most errors |
| 14 | # |
| 15 | # @CommandNotFound: the requested command has not been found |
| 16 | # |
Benoît Canet | d34bda7 | 2014-06-05 13:45:29 +0200 | [diff] [blame] | 17 | # @DeviceNotActive: a device has failed to be become active |
| 18 | # |
| 19 | # @DeviceNotFound: the requested device has not been found |
| 20 | # |
| 21 | # @KVMMissingCap: the requested operation can't be fulfilled because a |
| 22 | # required KVM capability is missing |
| 23 | # |
| 24 | # Since: 1.2 |
| 25 | ## |
Eric Blake | f22a28b | 2015-11-18 01:53:00 -0700 | [diff] [blame] | 26 | { 'enum': 'QapiErrorClass', |
| 27 | # Keep this in sync with ErrorClass in error.h |
Daniel P. Berrange | c01c214 | 2017-06-23 17:24:16 +0100 | [diff] [blame] | 28 | 'data': [ 'GenericError', 'CommandNotFound', |
Benoît Canet | d34bda7 | 2014-06-05 13:45:29 +0200 | [diff] [blame] | 29 | 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] } |
| 30 | |
| 31 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 32 | # @VersionTriple: |
Eric Blake | 4752cdb | 2015-05-04 09:05:31 -0600 | [diff] [blame] | 33 | # |
| 34 | # A three-part version number. |
| 35 | # |
Marc-André Lureau | 4d5c8bc | 2016-11-17 19:54:53 +0400 | [diff] [blame] | 36 | # @major: The major version number. |
Eric Blake | 4752cdb | 2015-05-04 09:05:31 -0600 | [diff] [blame] | 37 | # |
Marc-André Lureau | 4d5c8bc | 2016-11-17 19:54:53 +0400 | [diff] [blame] | 38 | # @minor: The minor version number. |
Eric Blake | 4752cdb | 2015-05-04 09:05:31 -0600 | [diff] [blame] | 39 | # |
Marc-André Lureau | 4d5c8bc | 2016-11-17 19:54:53 +0400 | [diff] [blame] | 40 | # @micro: The micro version number. |
Eric Blake | 4752cdb | 2015-05-04 09:05:31 -0600 | [diff] [blame] | 41 | # |
| 42 | # Since: 2.4 |
| 43 | ## |
| 44 | { 'struct': 'VersionTriple', |
| 45 | 'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} } |
| 46 | |
| 47 | |
| 48 | ## |
Benoît Canet | d34bda7 | 2014-06-05 13:45:29 +0200 | [diff] [blame] | 49 | # @VersionInfo: |
| 50 | # |
| 51 | # A description of QEMU's version. |
| 52 | # |
Eric Blake | 4752cdb | 2015-05-04 09:05:31 -0600 | [diff] [blame] | 53 | # @qemu: The version of QEMU. By current convention, a micro |
Benoît Canet | d34bda7 | 2014-06-05 13:45:29 +0200 | [diff] [blame] | 54 | # version of 50 signifies a development branch. A micro version |
| 55 | # greater than or equal to 90 signifies a release candidate for |
| 56 | # the next minor version. A micro version of less than 50 |
| 57 | # signifies a stable release. |
| 58 | # |
| 59 | # @package: QEMU will always set this field to an empty string. Downstream |
| 60 | # versions of QEMU should set this to a non-empty string. The |
| 61 | # exact format depends on the downstream however it highly |
| 62 | # recommended that a unique name is used. |
| 63 | # |
| 64 | # Since: 0.14.0 |
| 65 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 66 | { 'struct': 'VersionInfo', |
Eric Blake | 4752cdb | 2015-05-04 09:05:31 -0600 | [diff] [blame] | 67 | 'data': {'qemu': 'VersionTriple', 'package': 'str'} } |
Benoît Canet | d34bda7 | 2014-06-05 13:45:29 +0200 | [diff] [blame] | 68 | |
| 69 | ## |
| 70 | # @query-version: |
| 71 | # |
| 72 | # Returns the current version of QEMU. |
| 73 | # |
| 74 | # Returns: A @VersionInfo object describing the current version of QEMU. |
| 75 | # |
| 76 | # Since: 0.14.0 |
Marc-André Lureau | dd746af | 2016-06-23 15:09:51 +0200 | [diff] [blame] | 77 | # |
| 78 | # Example: |
| 79 | # |
| 80 | # -> { "execute": "query-version" } |
| 81 | # <- { |
| 82 | # "return":{ |
| 83 | # "qemu":{ |
| 84 | # "major":0, |
| 85 | # "minor":11, |
| 86 | # "micro":5 |
| 87 | # }, |
| 88 | # "package":"" |
| 89 | # } |
| 90 | # } |
| 91 | # |
Benoît Canet | d34bda7 | 2014-06-05 13:45:29 +0200 | [diff] [blame] | 92 | ## |
| 93 | { 'command': 'query-version', 'returns': 'VersionInfo' } |
| 94 | |
| 95 | ## |
| 96 | # @CommandInfo: |
| 97 | # |
| 98 | # Information about a QMP command |
| 99 | # |
| 100 | # @name: The command name |
| 101 | # |
| 102 | # Since: 0.14.0 |
| 103 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 104 | { 'struct': 'CommandInfo', 'data': {'name': 'str'} } |
Benoît Canet | d34bda7 | 2014-06-05 13:45:29 +0200 | [diff] [blame] | 105 | |
| 106 | ## |
| 107 | # @query-commands: |
| 108 | # |
| 109 | # Return a list of supported QMP commands by this server |
| 110 | # |
| 111 | # Returns: A list of @CommandInfo for all supported commands |
| 112 | # |
| 113 | # Since: 0.14.0 |
Marc-André Lureau | 8b0ffce | 2016-06-23 15:10:40 +0200 | [diff] [blame] | 114 | # |
| 115 | # Example: |
| 116 | # |
| 117 | # -> { "execute": "query-commands" } |
| 118 | # <- { |
| 119 | # "return":[ |
| 120 | # { |
| 121 | # "name":"query-balloon" |
| 122 | # }, |
| 123 | # { |
| 124 | # "name":"system_powerdown" |
| 125 | # } |
| 126 | # ] |
| 127 | # } |
| 128 | # |
| 129 | # Note: This example has been shortened as the real response is too long. |
| 130 | # |
Benoît Canet | d34bda7 | 2014-06-05 13:45:29 +0200 | [diff] [blame] | 131 | ## |
| 132 | { 'command': 'query-commands', 'returns': ['CommandInfo'] } |
| 133 | |
Don Slutz | d1048be | 2014-11-21 11:18:52 -0500 | [diff] [blame] | 134 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 135 | # @OnOffAuto: |
Don Slutz | d1048be | 2014-11-21 11:18:52 -0500 | [diff] [blame] | 136 | # |
| 137 | # An enumeration of three options: on, off, and auto |
| 138 | # |
| 139 | # @auto: QEMU selects the value between on and off |
| 140 | # |
| 141 | # @on: Enabled |
| 142 | # |
| 143 | # @off: Disabled |
| 144 | # |
| 145 | # Since: 2.2 |
| 146 | ## |
| 147 | { 'enum': 'OnOffAuto', |
| 148 | 'data': [ 'auto', 'on', 'off' ] } |
Matt Gingell | 32c18a2 | 2015-11-16 10:03:06 -0800 | [diff] [blame] | 149 | |
| 150 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 151 | # @OnOffSplit: |
Matt Gingell | 32c18a2 | 2015-11-16 10:03:06 -0800 | [diff] [blame] | 152 | # |
| 153 | # An enumeration of three values: on, off, and split |
| 154 | # |
| 155 | # @on: Enabled |
| 156 | # |
| 157 | # @off: Disabled |
| 158 | # |
| 159 | # @split: Mixed |
| 160 | # |
| 161 | # Since: 2.6 |
| 162 | ## |
| 163 | { 'enum': 'OnOffSplit', |
| 164 | 'data': [ 'on', 'off', 'split' ] } |