Benoît Canet | 5db1509 | 2014-06-05 13:45:30 +0200 | [diff] [blame] | 1 | # -*- Mode: Python -*- |
Andrea Bolognani | f7160f3 | 2020-07-29 20:50:24 +0200 | [diff] [blame] | 2 | # vim: filetype=python |
Marc-André Lureau | d3a4837 | 2017-01-13 15:41:23 +0100 | [diff] [blame] | 3 | |
| 4 | ## |
Markus Armbruster | f5cf31c | 2017-08-24 21:14:08 +0200 | [diff] [blame] | 5 | # == Block core (VM unrelated) |
Marc-André Lureau | d3a4837 | 2017-01-13 15:41:23 +0100 | [diff] [blame] | 6 | ## |
Benoît Canet | 5db1509 | 2014-06-05 13:45:30 +0200 | [diff] [blame] | 7 | |
Benoît Canet | 5db1509 | 2014-06-05 13:45:30 +0200 | [diff] [blame] | 8 | { 'include': 'common.json' } |
Markus Armbruster | 2031c13 | 2017-08-24 21:14:06 +0200 | [diff] [blame] | 9 | { 'include': 'crypto.json' } |
Kevin Wolf | bf42508 | 2018-05-16 16:03:10 +0200 | [diff] [blame] | 10 | { 'include': 'job.json' } |
Markus Armbruster | a2ff5a4 | 2017-08-24 21:13:56 +0200 | [diff] [blame] | 11 | { 'include': 'sockets.json' } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 12 | |
| 13 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 14 | # @SnapshotInfo: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 15 | # |
| 16 | # @id: unique snapshot id |
| 17 | # |
| 18 | # @name: user chosen name |
| 19 | # |
| 20 | # @vm-state-size: size of the VM state |
| 21 | # |
| 22 | # @date-sec: UTC date of the snapshot in seconds |
| 23 | # |
| 24 | # @date-nsec: fractional part in nano seconds to be used with date-sec |
| 25 | # |
| 26 | # @vm-clock-sec: VM clock relative to boot in seconds |
| 27 | # |
| 28 | # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec |
| 29 | # |
Pavel Dovgalyuk | b39847a | 2020-10-03 20:13:08 +0300 | [diff] [blame] | 30 | # @icount: Current instruction count. Appears when execution record/replay |
| 31 | # is enabled. Used for "time-traveling" to match the moment |
Pavel Dovgalyuk | e3b09ad | 2020-10-03 20:13:20 +0300 | [diff] [blame] | 32 | # in the recorded execution with the snapshots. This counter may |
| 33 | # be obtained through @query-replay command (since 5.2) |
Pavel Dovgalyuk | b39847a | 2020-10-03 20:13:08 +0300 | [diff] [blame] | 34 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 35 | # Since: 1.3 |
| 36 | # |
| 37 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 38 | { 'struct': 'SnapshotInfo', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 39 | 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int', |
| 40 | 'date-sec': 'int', 'date-nsec': 'int', |
Pavel Dovgalyuk | b39847a | 2020-10-03 20:13:08 +0300 | [diff] [blame] | 41 | 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int', |
| 42 | '*icount': 'int' } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 43 | |
| 44 | ## |
Daniel P. Berrange | 0a12f6f | 2017-06-23 17:24:18 +0100 | [diff] [blame] | 45 | # @ImageInfoSpecificQCow2EncryptionBase: |
| 46 | # |
| 47 | # @format: The encryption format |
| 48 | # |
| 49 | # Since: 2.10 |
| 50 | ## |
| 51 | { 'struct': 'ImageInfoSpecificQCow2EncryptionBase', |
| 52 | 'data': { 'format': 'BlockdevQcow2EncryptionFormat'}} |
| 53 | |
| 54 | ## |
| 55 | # @ImageInfoSpecificQCow2Encryption: |
| 56 | # |
| 57 | # Since: 2.10 |
| 58 | ## |
| 59 | { 'union': 'ImageInfoSpecificQCow2Encryption', |
| 60 | 'base': 'ImageInfoSpecificQCow2EncryptionBase', |
| 61 | 'discriminator': 'format', |
Anton Nefedov | 29cd040 | 2018-06-18 11:40:06 +0300 | [diff] [blame] | 62 | 'data': { 'luks': 'QCryptoBlockInfoLUKS' } } |
Daniel P. Berrange | 0a12f6f | 2017-06-23 17:24:18 +0100 | [diff] [blame] | 63 | |
| 64 | ## |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 65 | # @ImageInfoSpecificQCow2: |
| 66 | # |
| 67 | # @compat: compatibility level |
| 68 | # |
Kevin Wolf | 9b890bd | 2019-01-15 19:02:40 +0100 | [diff] [blame] | 69 | # @data-file: the filename of the external data file that is stored in the |
| 70 | # image and used as a default for opening the image (since: 4.0) |
| 71 | # |
Kevin Wolf | 6c3944d | 2019-02-22 14:29:38 +0100 | [diff] [blame] | 72 | # @data-file-raw: True if the external data file must stay valid as a |
| 73 | # standalone (read-only) raw image without looking at qcow2 |
| 74 | # metadata (since: 4.0) |
| 75 | # |
Alberto Garcia | 7be2025 | 2020-07-10 18:13:13 +0200 | [diff] [blame] | 76 | # @extended-l2: true if the image has extended L2 entries; only valid for |
| 77 | # compat >= 1.1 (since 5.2) |
| 78 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 79 | # @lazy-refcounts: on or off; only valid for compat >= 1.1 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 80 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 81 | # @corrupt: true if the image has been marked corrupt; only valid for |
Max Reitz | 9009b19 | 2014-09-30 21:31:28 +0200 | [diff] [blame] | 82 | # compat >= 1.1 (since 2.2) |
| 83 | # |
Max Reitz | 0709c5a | 2015-02-10 15:28:44 -0500 | [diff] [blame] | 84 | # @refcount-bits: width of a refcount entry in bits (since 2.3) |
| 85 | # |
Daniel P. Berrange | 0a12f6f | 2017-06-23 17:24:18 +0100 | [diff] [blame] | 86 | # @encrypt: details about encryption parameters; only set if image |
| 87 | # is encrypted (since 2.10) |
| 88 | # |
Andrey Shinkevich | b8968c8 | 2019-02-08 18:06:07 +0300 | [diff] [blame] | 89 | # @bitmaps: A list of qcow2 bitmap details (since 4.0) |
| 90 | # |
Denis Plotnikov | 572ad97 | 2020-05-07 11:25:18 +0300 | [diff] [blame] | 91 | # @compression-type: the image cluster compression method (since 5.1) |
| 92 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 93 | # Since: 1.7 |
| 94 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 95 | { 'struct': 'ImageInfoSpecificQCow2', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 96 | 'data': { |
| 97 | 'compat': 'str', |
Kevin Wolf | 9b890bd | 2019-01-15 19:02:40 +0100 | [diff] [blame] | 98 | '*data-file': 'str', |
Kevin Wolf | 6c3944d | 2019-02-22 14:29:38 +0100 | [diff] [blame] | 99 | '*data-file-raw': 'bool', |
Alberto Garcia | 7be2025 | 2020-07-10 18:13:13 +0200 | [diff] [blame] | 100 | '*extended-l2': 'bool', |
Max Reitz | 9009b19 | 2014-09-30 21:31:28 +0200 | [diff] [blame] | 101 | '*lazy-refcounts': 'bool', |
Max Reitz | 0709c5a | 2015-02-10 15:28:44 -0500 | [diff] [blame] | 102 | '*corrupt': 'bool', |
Daniel P. Berrange | 0a12f6f | 2017-06-23 17:24:18 +0100 | [diff] [blame] | 103 | 'refcount-bits': 'int', |
Andrey Shinkevich | b8968c8 | 2019-02-08 18:06:07 +0300 | [diff] [blame] | 104 | '*encrypt': 'ImageInfoSpecificQCow2Encryption', |
Denis Plotnikov | 572ad97 | 2020-05-07 11:25:18 +0300 | [diff] [blame] | 105 | '*bitmaps': ['Qcow2BitmapInfo'], |
| 106 | 'compression-type': 'Qcow2CompressionType' |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 107 | } } |
| 108 | |
| 109 | ## |
| 110 | # @ImageInfoSpecificVmdk: |
| 111 | # |
| 112 | # @create-type: The create type of VMDK image |
| 113 | # |
| 114 | # @cid: Content id of image |
| 115 | # |
| 116 | # @parent-cid: Parent VMDK image's cid |
| 117 | # |
| 118 | # @extents: List of extent files |
| 119 | # |
| 120 | # Since: 1.7 |
| 121 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 122 | { 'struct': 'ImageInfoSpecificVmdk', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 123 | 'data': { |
| 124 | 'create-type': 'str', |
| 125 | 'cid': 'int', |
| 126 | 'parent-cid': 'int', |
Hanna Reitz | 456e751 | 2022-06-20 18:26:55 +0200 | [diff] [blame] | 127 | 'extents': ['VmdkExtentInfo'] |
| 128 | } } |
| 129 | |
| 130 | ## |
| 131 | # @VmdkExtentInfo: |
| 132 | # |
| 133 | # Information about a VMDK extent file |
| 134 | # |
| 135 | # @filename: Name of the extent file |
| 136 | # |
| 137 | # @format: Extent type (e.g. FLAT or SPARSE) |
| 138 | # |
| 139 | # @virtual-size: Number of bytes covered by this extent |
| 140 | # |
| 141 | # @cluster-size: Cluster size in bytes (for non-flat extents) |
| 142 | # |
| 143 | # @compressed: Whether this extent contains compressed data |
| 144 | # |
| 145 | # Since: 8.0 |
| 146 | ## |
| 147 | { 'struct': 'VmdkExtentInfo', |
| 148 | 'data': { |
| 149 | 'filename': 'str', |
| 150 | 'format': 'str', |
| 151 | 'virtual-size': 'int', |
| 152 | '*cluster-size': 'int', |
| 153 | '*compressed': 'bool' |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 154 | } } |
| 155 | |
| 156 | ## |
Or Ozeri | 42e4ac9 | 2021-06-27 14:46:35 +0300 | [diff] [blame] | 157 | # @ImageInfoSpecificRbd: |
| 158 | # |
| 159 | # @encryption-format: Image encryption format |
| 160 | # |
| 161 | # Since: 6.1 |
| 162 | ## |
| 163 | { 'struct': 'ImageInfoSpecificRbd', |
| 164 | 'data': { |
| 165 | '*encryption-format': 'RbdImageEncryptionFormat' |
| 166 | } } |
| 167 | |
| 168 | ## |
Hanna Reitz | 7f36a50 | 2022-06-20 18:26:54 +0200 | [diff] [blame] | 169 | # @ImageInfoSpecificFile: |
| 170 | # |
| 171 | # @extent-size-hint: Extent size hint (if available) |
| 172 | # |
| 173 | # Since: 8.0 |
| 174 | ## |
| 175 | { 'struct': 'ImageInfoSpecificFile', |
| 176 | 'data': { |
| 177 | '*extent-size-hint': 'size' |
| 178 | } } |
| 179 | |
| 180 | ## |
Markus Armbruster | 0db4f50 | 2021-09-17 16:31:20 +0200 | [diff] [blame] | 181 | # @ImageInfoSpecificKind: |
| 182 | # |
| 183 | # @luks: Since 2.7 |
| 184 | # @rbd: Since 6.1 |
Hanna Reitz | 7f36a50 | 2022-06-20 18:26:54 +0200 | [diff] [blame] | 185 | # @file: Since 8.0 |
Markus Armbruster | 0db4f50 | 2021-09-17 16:31:20 +0200 | [diff] [blame] | 186 | # |
| 187 | # Since: 1.7 |
| 188 | ## |
| 189 | { 'enum': 'ImageInfoSpecificKind', |
Hanna Reitz | 7f36a50 | 2022-06-20 18:26:54 +0200 | [diff] [blame] | 190 | 'data': [ 'qcow2', 'vmdk', 'luks', 'rbd', 'file' ] } |
Markus Armbruster | 0db4f50 | 2021-09-17 16:31:20 +0200 | [diff] [blame] | 191 | |
| 192 | ## |
| 193 | # @ImageInfoSpecificQCow2Wrapper: |
| 194 | # |
| 195 | # Since: 1.7 |
| 196 | ## |
| 197 | { 'struct': 'ImageInfoSpecificQCow2Wrapper', |
| 198 | 'data': { 'data': 'ImageInfoSpecificQCow2' } } |
| 199 | |
| 200 | ## |
| 201 | # @ImageInfoSpecificVmdkWrapper: |
| 202 | # |
| 203 | # Since: 6.1 |
| 204 | ## |
| 205 | { 'struct': 'ImageInfoSpecificVmdkWrapper', |
| 206 | 'data': { 'data': 'ImageInfoSpecificVmdk' } } |
| 207 | |
| 208 | ## |
| 209 | # @ImageInfoSpecificLUKSWrapper: |
| 210 | # |
| 211 | # Since: 2.7 |
| 212 | ## |
| 213 | { 'struct': 'ImageInfoSpecificLUKSWrapper', |
| 214 | 'data': { 'data': 'QCryptoBlockInfoLUKS' } } |
| 215 | # If we need to add block driver specific parameters for |
| 216 | # LUKS in future, then we'll subclass QCryptoBlockInfoLUKS |
| 217 | # to define a ImageInfoSpecificLUKS |
| 218 | |
| 219 | ## |
| 220 | # @ImageInfoSpecificRbdWrapper: |
| 221 | # |
| 222 | # Since: 6.1 |
| 223 | ## |
| 224 | { 'struct': 'ImageInfoSpecificRbdWrapper', |
| 225 | 'data': { 'data': 'ImageInfoSpecificRbd' } } |
| 226 | |
| 227 | ## |
Hanna Reitz | 7f36a50 | 2022-06-20 18:26:54 +0200 | [diff] [blame] | 228 | # @ImageInfoSpecificFileWrapper: |
| 229 | # |
| 230 | # Since: 8.0 |
| 231 | ## |
| 232 | { 'struct': 'ImageInfoSpecificFileWrapper', |
| 233 | 'data': { 'data': 'ImageInfoSpecificFile' } } |
| 234 | |
| 235 | ## |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 236 | # @ImageInfoSpecific: |
| 237 | # |
| 238 | # A discriminated record of image format specific information structures. |
| 239 | # |
| 240 | # Since: 1.7 |
| 241 | ## |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 242 | { 'union': 'ImageInfoSpecific', |
Markus Armbruster | 0db4f50 | 2021-09-17 16:31:20 +0200 | [diff] [blame] | 243 | 'base': { 'type': 'ImageInfoSpecificKind' }, |
| 244 | 'discriminator': 'type', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 245 | 'data': { |
Markus Armbruster | 0db4f50 | 2021-09-17 16:31:20 +0200 | [diff] [blame] | 246 | 'qcow2': 'ImageInfoSpecificQCow2Wrapper', |
| 247 | 'vmdk': 'ImageInfoSpecificVmdkWrapper', |
| 248 | 'luks': 'ImageInfoSpecificLUKSWrapper', |
Hanna Reitz | 7f36a50 | 2022-06-20 18:26:54 +0200 | [diff] [blame] | 249 | 'rbd': 'ImageInfoSpecificRbdWrapper', |
| 250 | 'file': 'ImageInfoSpecificFileWrapper' |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 251 | } } |
| 252 | |
| 253 | ## |
Hanna Reitz | a2085f8 | 2022-06-20 18:26:56 +0200 | [diff] [blame] | 254 | # @BlockNodeInfo: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 255 | # |
| 256 | # Information about a QEMU image file |
| 257 | # |
| 258 | # @filename: name of the image file |
| 259 | # |
| 260 | # @format: format of the image file |
| 261 | # |
| 262 | # @virtual-size: maximum capacity in bytes of the image |
| 263 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 264 | # @actual-size: actual size on disk in bytes of the image |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 265 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 266 | # @dirty-flag: true if image is not cleanly closed |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 267 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 268 | # @cluster-size: size of a cluster in bytes |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 269 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 270 | # @encrypted: true if the image is encrypted |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 271 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 272 | # @compressed: true if the image is compressed (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 273 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 274 | # @backing-filename: name of the backing file |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 275 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 276 | # @full-backing-filename: full path of the backing file |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 277 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 278 | # @backing-filename-format: the format of the backing file |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 279 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 280 | # @snapshots: list of VM snapshots |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 281 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 282 | # @format-specific: structure supplying additional format-specific |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 283 | # information (since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 284 | # |
Hanna Reitz | a2085f8 | 2022-06-20 18:26:56 +0200 | [diff] [blame] | 285 | # Since: 8.0 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 286 | ## |
Hanna Reitz | a2085f8 | 2022-06-20 18:26:56 +0200 | [diff] [blame] | 287 | { 'struct': 'BlockNodeInfo', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 288 | 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool', |
| 289 | '*actual-size': 'int', 'virtual-size': 'int', |
| 290 | '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool', |
| 291 | '*backing-filename': 'str', '*full-backing-filename': 'str', |
| 292 | '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'], |
Kevin Wolf | 24bf10d | 2014-11-21 17:43:57 +0100 | [diff] [blame] | 293 | '*format-specific': 'ImageInfoSpecific' } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 294 | |
| 295 | ## |
Hanna Reitz | a2085f8 | 2022-06-20 18:26:56 +0200 | [diff] [blame] | 296 | # @ImageInfo: |
| 297 | # |
| 298 | # Information about a QEMU image file, and potentially its backing image |
| 299 | # |
| 300 | # @backing-image: info of the backing image |
| 301 | # |
| 302 | # Since: 1.3 |
| 303 | ## |
| 304 | { 'struct': 'ImageInfo', |
| 305 | 'base': 'BlockNodeInfo', |
| 306 | 'data': { |
| 307 | '*backing-image': 'ImageInfo' |
| 308 | } } |
| 309 | |
| 310 | ## |
Hanna Reitz | 6cab339 | 2022-06-20 18:26:59 +0200 | [diff] [blame] | 311 | # @BlockChildInfo: |
| 312 | # |
| 313 | # Information about all nodes in the block graph starting at some node, |
| 314 | # annotated with information about that node in relation to its parent. |
| 315 | # |
| 316 | # @name: Child name of the root node in the BlockGraphInfo struct, in its role |
| 317 | # as the child of some undescribed parent node |
| 318 | # |
| 319 | # @info: Block graph information starting at this node |
| 320 | # |
| 321 | # Since: 8.0 |
| 322 | ## |
| 323 | { 'struct': 'BlockChildInfo', |
| 324 | 'data': { |
| 325 | 'name': 'str', |
| 326 | 'info': 'BlockGraphInfo' |
| 327 | } } |
| 328 | |
| 329 | ## |
| 330 | # @BlockGraphInfo: |
| 331 | # |
| 332 | # Information about all nodes in a block (sub)graph in the form of BlockNodeInfo |
| 333 | # data. |
| 334 | # The base BlockNodeInfo struct contains the information for the (sub)graph's |
| 335 | # root node. |
| 336 | # |
| 337 | # @children: Array of links to this node's child nodes' information |
| 338 | # |
| 339 | # Since: 8.0 |
| 340 | ## |
| 341 | { 'struct': 'BlockGraphInfo', |
| 342 | 'base': 'BlockNodeInfo', |
| 343 | 'data': { 'children': ['BlockChildInfo'] } } |
| 344 | |
| 345 | ## |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 346 | # @ImageCheck: |
| 347 | # |
| 348 | # Information about a QEMU image file check |
| 349 | # |
| 350 | # @filename: name of the image file checked |
| 351 | # |
| 352 | # @format: format of the image file checked |
| 353 | # |
| 354 | # @check-errors: number of unexpected errors occurred during check |
| 355 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 356 | # @image-end-offset: offset (in bytes) where the image ends, this |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 357 | # field is present if the driver for the image format |
| 358 | # supports it |
| 359 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 360 | # @corruptions: number of corruptions found during the check if any |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 361 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 362 | # @leaks: number of leaks found during the check if any |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 363 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 364 | # @corruptions-fixed: number of corruptions fixed during the check |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 365 | # if any |
| 366 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 367 | # @leaks-fixed: number of leaks fixed during the check if any |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 368 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 369 | # @total-clusters: total number of clusters, this field is present |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 370 | # if the driver for the image format supports it |
| 371 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 372 | # @allocated-clusters: total number of allocated clusters, this |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 373 | # field is present if the driver for the image format |
| 374 | # supports it |
| 375 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 376 | # @fragmented-clusters: total number of fragmented clusters, this |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 377 | # field is present if the driver for the image format |
| 378 | # supports it |
| 379 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 380 | # @compressed-clusters: total number of compressed clusters, this |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 381 | # field is present if the driver for the image format |
| 382 | # supports it |
| 383 | # |
| 384 | # Since: 1.4 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 385 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 386 | { 'struct': 'ImageCheck', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 387 | 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int', |
| 388 | '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int', |
| 389 | '*corruptions-fixed': 'int', '*leaks-fixed': 'int', |
| 390 | '*total-clusters': 'int', '*allocated-clusters': 'int', |
| 391 | '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } } |
| 392 | |
| 393 | ## |
Fam Zheng | 16b0d55 | 2016-01-26 11:59:02 +0800 | [diff] [blame] | 394 | # @MapEntry: |
| 395 | # |
| 396 | # Mapping information from a virtual block range to a host file range |
| 397 | # |
Max Reitz | ffb515f | 2020-11-04 17:55:12 +0100 | [diff] [blame] | 398 | # @start: virtual (guest) offset of the first byte described by this |
| 399 | # entry |
Fam Zheng | 16b0d55 | 2016-01-26 11:59:02 +0800 | [diff] [blame] | 400 | # |
| 401 | # @length: the number of bytes of the mapped virtual range |
| 402 | # |
Max Reitz | ffb515f | 2020-11-04 17:55:12 +0100 | [diff] [blame] | 403 | # @data: reading the image will actually read data from a file (in |
| 404 | # particular, if @offset is present this means that the sectors |
| 405 | # are not simply preallocated, but contain actual data in raw |
| 406 | # format) |
Fam Zheng | 16b0d55 | 2016-01-26 11:59:02 +0800 | [diff] [blame] | 407 | # |
Max Reitz | ffb515f | 2020-11-04 17:55:12 +0100 | [diff] [blame] | 408 | # @zero: whether the virtual blocks read as zeroes |
Fam Zheng | 16b0d55 | 2016-01-26 11:59:02 +0800 | [diff] [blame] | 409 | # |
Max Reitz | ffb515f | 2020-11-04 17:55:12 +0100 | [diff] [blame] | 410 | # @depth: number of layers (0 = top image, 1 = top image's backing |
| 411 | # file, ..., n - 1 = bottom image (where n is the number of |
| 412 | # images in the chain)) before reaching one for which the |
| 413 | # range is allocated |
Fam Zheng | 16b0d55 | 2016-01-26 11:59:02 +0800 | [diff] [blame] | 414 | # |
Eric Blake | 8417e13 | 2021-07-01 14:06:55 -0500 | [diff] [blame] | 415 | # @present: true if this layer provides the data, false if adding a backing |
| 416 | # layer could impact this region (since 6.1) |
| 417 | # |
Max Reitz | ffb515f | 2020-11-04 17:55:12 +0100 | [diff] [blame] | 418 | # @offset: if present, the image file stores the data for this range |
| 419 | # in raw format at the given (host) offset |
Fam Zheng | 16b0d55 | 2016-01-26 11:59:02 +0800 | [diff] [blame] | 420 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 421 | # @filename: filename that is referred to by @offset |
Fam Zheng | 16b0d55 | 2016-01-26 11:59:02 +0800 | [diff] [blame] | 422 | # |
| 423 | # Since: 2.6 |
Fam Zheng | 16b0d55 | 2016-01-26 11:59:02 +0800 | [diff] [blame] | 424 | ## |
| 425 | { 'struct': 'MapEntry', |
| 426 | 'data': {'start': 'int', 'length': 'int', 'data': 'bool', |
Eric Blake | 8417e13 | 2021-07-01 14:06:55 -0500 | [diff] [blame] | 427 | 'zero': 'bool', 'depth': 'int', 'present': 'bool', |
| 428 | '*offset': 'int', '*filename': 'str' } } |
Fam Zheng | 16b0d55 | 2016-01-26 11:59:02 +0800 | [diff] [blame] | 429 | |
| 430 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 431 | # @BlockdevCacheInfo: |
Kevin Wolf | 9e193c5 | 2014-05-22 13:28:45 +0200 | [diff] [blame] | 432 | # |
| 433 | # Cache mode information for a block device |
| 434 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 435 | # @writeback: true if writeback mode is enabled |
| 436 | # @direct: true if the host page cache is bypassed (O_DIRECT) |
| 437 | # @no-flush: true if flush requests are ignored for the device |
Kevin Wolf | 9e193c5 | 2014-05-22 13:28:45 +0200 | [diff] [blame] | 438 | # |
| 439 | # Since: 2.3 |
| 440 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 441 | { 'struct': 'BlockdevCacheInfo', |
Kevin Wolf | 9e193c5 | 2014-05-22 13:28:45 +0200 | [diff] [blame] | 442 | 'data': { 'writeback': 'bool', |
| 443 | 'direct': 'bool', |
| 444 | 'no-flush': 'bool' } } |
| 445 | |
| 446 | ## |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 447 | # @BlockDeviceInfo: |
| 448 | # |
| 449 | # Information about the backing device for a block device. |
| 450 | # |
| 451 | # @file: the filename of the backing device |
| 452 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 453 | # @node-name: the name of the block driver node (Since 2.0) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 454 | # |
| 455 | # @ro: true if the backing device was open read-only |
| 456 | # |
| 457 | # @drv: the name of the block format used to open the backing device. As of |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 458 | # 0.14 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 459 | # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device', |
Daniel P. Berrange | 7836857 | 2016-03-21 14:11:47 +0000 | [diff] [blame] | 460 | # 'http', 'https', 'luks', 'nbd', 'parallels', 'qcow', |
Max Reitz | 23dce38 | 2016-11-02 18:55:37 +0100 | [diff] [blame] | 461 | # 'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat' |
Stefan Hajnoczi | 550830f | 2014-09-16 15:24:24 +0100 | [diff] [blame] | 462 | # 2.2: 'archipelago' added, 'cow' dropped |
Markus Armbruster | 92a539d | 2015-03-17 17:02:20 +0100 | [diff] [blame] | 463 | # 2.3: 'host_floppy' deprecated |
Max Reitz | f709623 | 2015-10-19 17:53:07 +0200 | [diff] [blame] | 464 | # 2.5: 'host_floppy' dropped |
Daniel P. Berrange | 7836857 | 2016-03-21 14:11:47 +0000 | [diff] [blame] | 465 | # 2.6: 'luks' added |
Max Reitz | 23dce38 | 2016-11-02 18:55:37 +0100 | [diff] [blame] | 466 | # 2.8: 'replication' added, 'tftp' dropped |
Eric Blake | e32ccbc | 2017-03-08 14:02:16 -0600 | [diff] [blame] | 467 | # 2.9: 'archipelago' dropped |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 468 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 469 | # @backing_file: the name of the backing file (for copy-on-write) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 470 | # |
| 471 | # @backing_file_depth: number of files in the backing file chain (since: 1.2) |
| 472 | # |
| 473 | # @encrypted: true if the backing device is encrypted |
| 474 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 475 | # @detect_zeroes: detect and optimize zero writes (Since 2.1) |
| 476 | # |
| 477 | # @bps: total throughput limit in bytes per second is specified |
| 478 | # |
| 479 | # @bps_rd: read throughput limit in bytes per second is specified |
| 480 | # |
| 481 | # @bps_wr: write throughput limit in bytes per second is specified |
| 482 | # |
| 483 | # @iops: total I/O operations per second is specified |
| 484 | # |
| 485 | # @iops_rd: read I/O operations per second is specified |
| 486 | # |
| 487 | # @iops_wr: write I/O operations per second is specified |
| 488 | # |
| 489 | # @image: the info of image used (since: 1.6) |
| 490 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 491 | # @bps_max: total throughput limit during bursts, |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 492 | # in bytes (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 493 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 494 | # @bps_rd_max: read throughput limit during bursts, |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 495 | # in bytes (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 496 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 497 | # @bps_wr_max: write throughput limit during bursts, |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 498 | # in bytes (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 499 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 500 | # @iops_max: total I/O operations per second during bursts, |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 501 | # in bytes (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 502 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 503 | # @iops_rd_max: read I/O operations per second during bursts, |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 504 | # in bytes (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 505 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 506 | # @iops_wr_max: write I/O operations per second during bursts, |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 507 | # in bytes (Since 1.7) |
| 508 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 509 | # @bps_max_length: maximum length of the @bps_max burst |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 510 | # period, in seconds. (Since 2.6) |
| 511 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 512 | # @bps_rd_max_length: maximum length of the @bps_rd_max |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 513 | # burst period, in seconds. (Since 2.6) |
| 514 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 515 | # @bps_wr_max_length: maximum length of the @bps_wr_max |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 516 | # burst period, in seconds. (Since 2.6) |
| 517 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 518 | # @iops_max_length: maximum length of the @iops burst |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 519 | # period, in seconds. (Since 2.6) |
| 520 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 521 | # @iops_rd_max_length: maximum length of the @iops_rd_max |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 522 | # burst period, in seconds. (Since 2.6) |
| 523 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 524 | # @iops_wr_max_length: maximum length of the @iops_wr_max |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 525 | # burst period, in seconds. (Since 2.6) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 526 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 527 | # @iops_size: an I/O size in bytes (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 528 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 529 | # @group: throttle group name (Since 2.4) |
Alberto Garcia | b8fe169 | 2015-06-08 18:17:46 +0200 | [diff] [blame] | 530 | # |
Kevin Wolf | 9e193c5 | 2014-05-22 13:28:45 +0200 | [diff] [blame] | 531 | # @cache: the cache mode used for the block device (since: 2.3) |
| 532 | # |
Francesco Romani | e246211 | 2015-01-12 14:11:13 +0100 | [diff] [blame] | 533 | # @write_threshold: configured write threshold for the device. |
| 534 | # 0 if disabled. (Since 2.3) |
| 535 | # |
Vladimir Sementsov-Ogievskiy | 590a63d | 2019-07-29 16:35:56 -0400 | [diff] [blame] | 536 | # @dirty-bitmaps: dirty bitmaps information (only present if node |
| 537 | # has one or more dirty bitmaps) (Since 4.2) |
| 538 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 539 | # Since: 0.14 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 540 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 541 | { 'struct': 'BlockDeviceInfo', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 542 | 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str', |
| 543 | '*backing_file': 'str', 'backing_file_depth': 'int', |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 544 | 'encrypted': 'bool', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 545 | 'detect_zeroes': 'BlockdevDetectZeroesOptions', |
| 546 | 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int', |
| 547 | 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int', |
| 548 | 'image': 'ImageInfo', |
| 549 | '*bps_max': 'int', '*bps_rd_max': 'int', |
| 550 | '*bps_wr_max': 'int', '*iops_max': 'int', |
| 551 | '*iops_rd_max': 'int', '*iops_wr_max': 'int', |
Alberto Garcia | 398befd | 2016-02-18 12:27:04 +0200 | [diff] [blame] | 552 | '*bps_max_length': 'int', '*bps_rd_max_length': 'int', |
| 553 | '*bps_wr_max_length': 'int', '*iops_max_length': 'int', |
| 554 | '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int', |
Alberto Garcia | b8fe169 | 2015-06-08 18:17:46 +0200 | [diff] [blame] | 555 | '*iops_size': 'int', '*group': 'str', 'cache': 'BlockdevCacheInfo', |
Vladimir Sementsov-Ogievskiy | 590a63d | 2019-07-29 16:35:56 -0400 | [diff] [blame] | 556 | 'write_threshold': 'int', '*dirty-bitmaps': ['BlockDirtyInfo'] } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 557 | |
| 558 | ## |
| 559 | # @BlockDeviceIoStatus: |
| 560 | # |
| 561 | # An enumeration of block device I/O status. |
| 562 | # |
| 563 | # @ok: The last I/O operation has succeeded |
| 564 | # |
| 565 | # @failed: The last I/O operation has failed |
| 566 | # |
| 567 | # @nospace: The last I/O operation has failed due to a no-space condition |
| 568 | # |
| 569 | # Since: 1.0 |
| 570 | ## |
| 571 | { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] } |
| 572 | |
| 573 | ## |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 574 | # @BlockDirtyInfo: |
| 575 | # |
| 576 | # Block dirty bitmap information. |
| 577 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 578 | # @name: the name of the dirty bitmap (Since 2.4) |
Fam Zheng | 0db6e54 | 2015-04-17 19:49:50 -0400 | [diff] [blame] | 579 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 580 | # @count: number of dirty bytes according to the dirty bitmap |
| 581 | # |
| 582 | # @granularity: granularity of the dirty bitmap in bytes (since 1.4) |
| 583 | # |
John Snow | 4db6ceb | 2019-03-12 12:05:48 -0400 | [diff] [blame] | 584 | # @recording: true if the bitmap is recording new writes from the guest. |
John Snow | 450e0f2 | 2021-10-04 17:52:36 -0400 | [diff] [blame] | 585 | # Replaces ``active`` and ``disabled`` statuses. (since 4.0) |
John Snow | 4db6ceb | 2019-03-12 12:05:48 -0400 | [diff] [blame] | 586 | # |
| 587 | # @busy: true if the bitmap is in-use by some operation (NBD or jobs) |
| 588 | # and cannot be modified via QMP or used by another operation. |
John Snow | 450e0f2 | 2021-10-04 17:52:36 -0400 | [diff] [blame] | 589 | # Replaces ``locked`` and ``frozen`` statuses. (since 4.0) |
John Snow | a113534 | 2015-04-17 19:50:00 -0400 | [diff] [blame] | 590 | # |
John Snow | b0f4555 | 2019-03-12 12:05:49 -0400 | [diff] [blame] | 591 | # @persistent: true if the bitmap was stored on disk, is scheduled to be stored |
| 592 | # on disk, or both. (since 4.0) |
| 593 | # |
| 594 | # @inconsistent: true if this is a persistent bitmap that was improperly |
| 595 | # stored. Implies @persistent to be true; @recording and |
| 596 | # @busy to be false. This bitmap cannot be used. To remove |
| 597 | # it, use @block-dirty-bitmap-remove. (Since 4.0) |
Eric Blake | f67cf66 | 2019-02-19 17:49:43 -0500 | [diff] [blame] | 598 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 599 | # Since: 1.3 |
| 600 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 601 | { 'struct': 'BlockDirtyInfo', |
John Snow | a113534 | 2015-04-17 19:50:00 -0400 | [diff] [blame] | 602 | 'data': {'*name': 'str', 'count': 'int', 'granularity': 'uint32', |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 603 | 'recording': 'bool', 'busy': 'bool', |
John Snow | b0f4555 | 2019-03-12 12:05:49 -0400 | [diff] [blame] | 604 | 'persistent': 'bool', '*inconsistent': 'bool' } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 605 | |
| 606 | ## |
Andrey Shinkevich | b8968c8 | 2019-02-08 18:06:07 +0300 | [diff] [blame] | 607 | # @Qcow2BitmapInfoFlags: |
| 608 | # |
| 609 | # An enumeration of flags that a bitmap can report to the user. |
| 610 | # |
| 611 | # @in-use: This flag is set by any process actively modifying the qcow2 file, |
| 612 | # and cleared when the updated bitmap is flushed to the qcow2 image. |
| 613 | # The presence of this flag in an offline image means that the bitmap |
| 614 | # was not saved correctly after its last usage, and may contain |
| 615 | # inconsistent data. |
| 616 | # |
| 617 | # @auto: The bitmap must reflect all changes of the virtual disk by any |
| 618 | # application that would write to this qcow2 file. |
| 619 | # |
| 620 | # Since: 4.0 |
| 621 | ## |
| 622 | { 'enum': 'Qcow2BitmapInfoFlags', |
| 623 | 'data': ['in-use', 'auto'] } |
| 624 | |
| 625 | ## |
| 626 | # @Qcow2BitmapInfo: |
| 627 | # |
| 628 | # Qcow2 bitmap information. |
| 629 | # |
| 630 | # @name: the name of the bitmap |
| 631 | # |
| 632 | # @granularity: granularity of the bitmap in bytes |
| 633 | # |
| 634 | # @flags: flags of the bitmap |
| 635 | # |
| 636 | # Since: 4.0 |
| 637 | ## |
| 638 | { 'struct': 'Qcow2BitmapInfo', |
| 639 | 'data': {'name': 'str', 'granularity': 'uint32', |
| 640 | 'flags': ['Qcow2BitmapInfoFlags'] } } |
| 641 | |
| 642 | ## |
Vladimir Sementsov-Ogievskiy | 7e5c776 | 2018-03-09 19:52:12 +0300 | [diff] [blame] | 643 | # @BlockLatencyHistogramInfo: |
| 644 | # |
| 645 | # Block latency histogram. |
| 646 | # |
| 647 | # @boundaries: list of interval boundary values in nanoseconds, all greater |
| 648 | # than zero and in ascending order. |
| 649 | # For example, the list [10, 50, 100] produces the following |
| 650 | # histogram intervals: [0, 10), [10, 50), [50, 100), [100, +inf). |
| 651 | # |
| 652 | # @bins: list of io request counts corresponding to histogram intervals. |
| 653 | # len(@bins) = len(@boundaries) + 1 |
| 654 | # For the example above, @bins may be something like [3, 1, 5, 2], |
| 655 | # and corresponding histogram looks like: |
| 656 | # |
Peter Maydell | a0fcff3 | 2020-09-25 17:23:05 +0100 | [diff] [blame] | 657 | # :: |
| 658 | # |
| 659 | # 5| * |
| 660 | # 4| * |
| 661 | # 3| * * |
| 662 | # 2| * * * |
| 663 | # 1| * * * * |
| 664 | # +------------------ |
| 665 | # 10 50 100 |
Vladimir Sementsov-Ogievskiy | 7e5c776 | 2018-03-09 19:52:12 +0300 | [diff] [blame] | 666 | # |
Vladimir Sementsov-Ogievskiy | cb8aac3 | 2019-03-05 15:53:17 +0300 | [diff] [blame] | 667 | # Since: 4.0 |
Vladimir Sementsov-Ogievskiy | 7e5c776 | 2018-03-09 19:52:12 +0300 | [diff] [blame] | 668 | ## |
| 669 | { 'struct': 'BlockLatencyHistogramInfo', |
| 670 | 'data': {'boundaries': ['uint64'], 'bins': ['uint64'] } } |
| 671 | |
| 672 | ## |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 673 | # @BlockInfo: |
| 674 | # |
| 675 | # Block device information. This structure describes a virtual device and |
| 676 | # the backing device associated with it. |
| 677 | # |
| 678 | # @device: The device name associated with the virtual device. |
| 679 | # |
Kevin Wolf | 46eade7 | 2017-07-11 13:27:38 +0200 | [diff] [blame] | 680 | # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block |
| 681 | # device. (since 2.10) |
| 682 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 683 | # @type: This field is returned only for compatibility reasons, it should |
| 684 | # not be used (always returns 'unknown') |
| 685 | # |
| 686 | # @removable: True if the device supports removable media. |
| 687 | # |
| 688 | # @locked: True if the guest has locked this device from having its media |
| 689 | # removed |
| 690 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 691 | # @tray_open: True if the device's tray is open |
Max Reitz | 327032c | 2016-01-29 20:49:13 +0100 | [diff] [blame] | 692 | # (only present if it has a tray) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 693 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 694 | # @io-status: @BlockDeviceIoStatus. Only present if the device |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 695 | # supports it and the VM is configured to stop on errors |
Markus Armbruster | f6f55af | 2017-05-09 12:56:01 +0200 | [diff] [blame] | 696 | # (supported device models: virtio-blk, IDE, SCSI except |
| 697 | # scsi-generic) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 698 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 699 | # @inserted: @BlockDeviceInfo describing the device if media is |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 700 | # present |
| 701 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 702 | # Since: 0.14 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 703 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 704 | { 'struct': 'BlockInfo', |
Kevin Wolf | 46eade7 | 2017-07-11 13:27:38 +0200 | [diff] [blame] | 705 | 'data': {'device': 'str', '*qdev': 'str', 'type': 'str', 'removable': 'bool', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 706 | 'locked': 'bool', '*inserted': 'BlockDeviceInfo', |
Daniel P. Berrangé | e67d8e2 | 2021-02-19 19:22:36 +0000 | [diff] [blame] | 707 | '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus' } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 708 | |
| 709 | ## |
Stefan Hajnoczi | 90880ff | 2017-07-05 13:57:30 +0100 | [diff] [blame] | 710 | # @BlockMeasureInfo: |
| 711 | # |
| 712 | # Image file size calculation information. This structure describes the size |
| 713 | # requirements for creating a new image file. |
| 714 | # |
| 715 | # The size requirements depend on the new image file format. File size always |
| 716 | # equals virtual disk size for the 'raw' format, even for sparse POSIX files. |
| 717 | # Compact formats such as 'qcow2' represent unallocated and zero regions |
| 718 | # efficiently so file size may be smaller than virtual disk size. |
| 719 | # |
| 720 | # The values are upper bounds that are guaranteed to fit the new image file. |
Eric Blake | 5d72c68 | 2020-05-21 14:21:34 -0500 | [diff] [blame] | 721 | # Subsequent modification, such as internal snapshot or further bitmap |
| 722 | # creation, may require additional space and is not covered here. |
Stefan Hajnoczi | 90880ff | 2017-07-05 13:57:30 +0100 | [diff] [blame] | 723 | # |
Eric Blake | 5d72c68 | 2020-05-21 14:21:34 -0500 | [diff] [blame] | 724 | # @required: Size required for a new image file, in bytes, when copying just |
| 725 | # allocated guest-visible contents. |
Stefan Hajnoczi | 90880ff | 2017-07-05 13:57:30 +0100 | [diff] [blame] | 726 | # |
| 727 | # @fully-allocated: Image file size, in bytes, once data has been written |
Eric Blake | 5d72c68 | 2020-05-21 14:21:34 -0500 | [diff] [blame] | 728 | # to all sectors, when copying just guest-visible contents. |
| 729 | # |
| 730 | # @bitmaps: Additional size required if all the top-level bitmap metadata |
| 731 | # in the source image were to be copied to the destination, |
| 732 | # present only when source and destination both support |
| 733 | # persistent bitmaps. (since 5.1) |
Stefan Hajnoczi | 90880ff | 2017-07-05 13:57:30 +0100 | [diff] [blame] | 734 | # |
| 735 | # Since: 2.10 |
| 736 | ## |
| 737 | { 'struct': 'BlockMeasureInfo', |
Eric Blake | 5d72c68 | 2020-05-21 14:21:34 -0500 | [diff] [blame] | 738 | 'data': {'required': 'int', 'fully-allocated': 'int', '*bitmaps': 'int'} } |
Stefan Hajnoczi | 90880ff | 2017-07-05 13:57:30 +0100 | [diff] [blame] | 739 | |
| 740 | ## |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 741 | # @query-block: |
| 742 | # |
| 743 | # Get a list of BlockInfo for all virtual block devices. |
| 744 | # |
Kevin Wolf | d3c8c67 | 2017-07-18 17:24:05 +0200 | [diff] [blame] | 745 | # Returns: a list of @BlockInfo describing each virtual block device. Filter |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 746 | # nodes that were created implicitly are skipped over. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 747 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 748 | # Since: 0.14 |
Marc-André Lureau | 978ccea | 2016-06-23 13:58:48 +0200 | [diff] [blame] | 749 | # |
| 750 | # Example: |
| 751 | # |
| 752 | # -> { "execute": "query-block" } |
| 753 | # <- { |
| 754 | # "return":[ |
| 755 | # { |
| 756 | # "io-status": "ok", |
| 757 | # "device":"ide0-hd0", |
| 758 | # "locked":false, |
| 759 | # "removable":false, |
| 760 | # "inserted":{ |
| 761 | # "ro":false, |
| 762 | # "drv":"qcow2", |
| 763 | # "encrypted":false, |
| 764 | # "file":"disks/test.qcow2", |
| 765 | # "backing_file_depth":1, |
| 766 | # "bps":1000000, |
| 767 | # "bps_rd":0, |
| 768 | # "bps_wr":0, |
| 769 | # "iops":1000000, |
| 770 | # "iops_rd":0, |
| 771 | # "iops_wr":0, |
| 772 | # "bps_max": 8000000, |
| 773 | # "bps_rd_max": 0, |
| 774 | # "bps_wr_max": 0, |
| 775 | # "iops_max": 0, |
| 776 | # "iops_rd_max": 0, |
| 777 | # "iops_wr_max": 0, |
| 778 | # "iops_size": 0, |
| 779 | # "detect_zeroes": "on", |
| 780 | # "write_threshold": 0, |
| 781 | # "image":{ |
| 782 | # "filename":"disks/test.qcow2", |
| 783 | # "format":"qcow2", |
| 784 | # "virtual-size":2048000, |
| 785 | # "backing_file":"base.qcow2", |
| 786 | # "full-backing-filename":"disks/base.qcow2", |
| 787 | # "backing-filename-format":"qcow2", |
| 788 | # "snapshots":[ |
| 789 | # { |
| 790 | # "id": "1", |
| 791 | # "name": "snapshot1", |
| 792 | # "vm-state-size": 0, |
| 793 | # "date-sec": 10000200, |
| 794 | # "date-nsec": 12, |
| 795 | # "vm-clock-sec": 206, |
| 796 | # "vm-clock-nsec": 30 |
| 797 | # } |
| 798 | # ], |
| 799 | # "backing-image":{ |
| 800 | # "filename":"disks/base.qcow2", |
| 801 | # "format":"qcow2", |
| 802 | # "virtual-size":2048000 |
| 803 | # } |
| 804 | # } |
| 805 | # }, |
Kevin Wolf | 46eade7 | 2017-07-11 13:27:38 +0200 | [diff] [blame] | 806 | # "qdev": "ide_disk", |
Marc-André Lureau | 978ccea | 2016-06-23 13:58:48 +0200 | [diff] [blame] | 807 | # "type":"unknown" |
| 808 | # }, |
| 809 | # { |
| 810 | # "io-status": "ok", |
| 811 | # "device":"ide1-cd0", |
| 812 | # "locked":false, |
| 813 | # "removable":true, |
Kevin Wolf | 46eade7 | 2017-07-11 13:27:38 +0200 | [diff] [blame] | 814 | # "qdev": "/machine/unattached/device[23]", |
| 815 | # "tray_open": false, |
Marc-André Lureau | 978ccea | 2016-06-23 13:58:48 +0200 | [diff] [blame] | 816 | # "type":"unknown" |
| 817 | # }, |
| 818 | # { |
| 819 | # "device":"floppy0", |
| 820 | # "locked":false, |
| 821 | # "removable":true, |
Kevin Wolf | 46eade7 | 2017-07-11 13:27:38 +0200 | [diff] [blame] | 822 | # "qdev": "/machine/unattached/device[20]", |
Marc-André Lureau | 978ccea | 2016-06-23 13:58:48 +0200 | [diff] [blame] | 823 | # "type":"unknown" |
| 824 | # }, |
| 825 | # { |
| 826 | # "device":"sd0", |
| 827 | # "locked":false, |
| 828 | # "removable":true, |
| 829 | # "type":"unknown" |
| 830 | # } |
| 831 | # ] |
| 832 | # } |
| 833 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 834 | ## |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 835 | { 'command': 'query-block', 'returns': ['BlockInfo'], |
| 836 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 837 | |
Alberto Garcia | 979e9b0 | 2015-10-28 17:33:05 +0200 | [diff] [blame] | 838 | ## |
| 839 | # @BlockDeviceTimedStats: |
| 840 | # |
| 841 | # Statistics of a block device during a given interval of time. |
| 842 | # |
| 843 | # @interval_length: Interval used for calculating the statistics, |
| 844 | # in seconds. |
| 845 | # |
| 846 | # @min_rd_latency_ns: Minimum latency of read operations in the |
| 847 | # defined interval, in nanoseconds. |
| 848 | # |
| 849 | # @min_wr_latency_ns: Minimum latency of write operations in the |
| 850 | # defined interval, in nanoseconds. |
| 851 | # |
| 852 | # @min_flush_latency_ns: Minimum latency of flush operations in the |
| 853 | # defined interval, in nanoseconds. |
| 854 | # |
| 855 | # @max_rd_latency_ns: Maximum latency of read operations in the |
| 856 | # defined interval, in nanoseconds. |
| 857 | # |
| 858 | # @max_wr_latency_ns: Maximum latency of write operations in the |
| 859 | # defined interval, in nanoseconds. |
| 860 | # |
| 861 | # @max_flush_latency_ns: Maximum latency of flush operations in the |
| 862 | # defined interval, in nanoseconds. |
| 863 | # |
| 864 | # @avg_rd_latency_ns: Average latency of read operations in the |
| 865 | # defined interval, in nanoseconds. |
| 866 | # |
| 867 | # @avg_wr_latency_ns: Average latency of write operations in the |
| 868 | # defined interval, in nanoseconds. |
| 869 | # |
| 870 | # @avg_flush_latency_ns: Average latency of flush operations in the |
| 871 | # defined interval, in nanoseconds. |
| 872 | # |
Alberto Garcia | 96e4ded | 2015-10-28 17:33:06 +0200 | [diff] [blame] | 873 | # @avg_rd_queue_depth: Average number of pending read operations |
| 874 | # in the defined interval. |
| 875 | # |
| 876 | # @avg_wr_queue_depth: Average number of pending write operations |
| 877 | # in the defined interval. |
| 878 | # |
Alberto Garcia | 979e9b0 | 2015-10-28 17:33:05 +0200 | [diff] [blame] | 879 | # Since: 2.5 |
| 880 | ## |
Alberto Garcia | 979e9b0 | 2015-10-28 17:33:05 +0200 | [diff] [blame] | 881 | { 'struct': 'BlockDeviceTimedStats', |
| 882 | 'data': { 'interval_length': 'int', 'min_rd_latency_ns': 'int', |
| 883 | 'max_rd_latency_ns': 'int', 'avg_rd_latency_ns': 'int', |
| 884 | 'min_wr_latency_ns': 'int', 'max_wr_latency_ns': 'int', |
| 885 | 'avg_wr_latency_ns': 'int', 'min_flush_latency_ns': 'int', |
Alberto Garcia | 96e4ded | 2015-10-28 17:33:06 +0200 | [diff] [blame] | 886 | 'max_flush_latency_ns': 'int', 'avg_flush_latency_ns': 'int', |
| 887 | 'avg_rd_queue_depth': 'number', 'avg_wr_queue_depth': 'number' } } |
Alberto Garcia | 979e9b0 | 2015-10-28 17:33:05 +0200 | [diff] [blame] | 888 | |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 889 | ## |
| 890 | # @BlockDeviceStats: |
| 891 | # |
| 892 | # Statistics of a virtual block device or a block backing device. |
| 893 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 894 | # @rd_bytes: The number of bytes read by the device. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 895 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 896 | # @wr_bytes: The number of bytes written by the device. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 897 | # |
Anton Nefedov | 159f85d | 2019-09-23 15:17:30 +0300 | [diff] [blame] | 898 | # @unmap_bytes: The number of bytes unmapped by the device (Since 4.2) |
| 899 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 900 | # @rd_operations: The number of read operations performed by the device. |
| 901 | # |
| 902 | # @wr_operations: The number of write operations performed by the device. |
| 903 | # |
| 904 | # @flush_operations: The number of cache flush operations performed by the |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 905 | # device (since 0.15) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 906 | # |
Anton Nefedov | 159f85d | 2019-09-23 15:17:30 +0300 | [diff] [blame] | 907 | # @unmap_operations: The number of unmap operations performed by the device |
| 908 | # (Since 4.2) |
| 909 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 910 | # @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15). |
Anton Nefedov | 329d27e | 2019-09-23 15:17:29 +0300 | [diff] [blame] | 911 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 912 | # @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15). |
Anton Nefedov | 329d27e | 2019-09-23 15:17:29 +0300 | [diff] [blame] | 913 | # |
| 914 | # @flush_total_time_ns: Total time spent on cache flushes in nanoseconds |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 915 | # (since 0.15). |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 916 | # |
Anton Nefedov | 159f85d | 2019-09-23 15:17:30 +0300 | [diff] [blame] | 917 | # @unmap_total_time_ns: Total time spent on unmap operations in nanoseconds |
| 918 | # (Since 4.2) |
| 919 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 920 | # @wr_highest_offset: The offset after the greatest byte written to the |
| 921 | # device. The intended use of this information is for |
| 922 | # growable sparse files (like qcow2) that are used on top |
| 923 | # of a physical device. |
| 924 | # |
Peter Lieven | f4564d5 | 2015-02-02 14:52:18 +0100 | [diff] [blame] | 925 | # @rd_merged: Number of read requests that have been merged into another |
| 926 | # request (Since 2.3). |
| 927 | # |
| 928 | # @wr_merged: Number of write requests that have been merged into another |
| 929 | # request (Since 2.3). |
| 930 | # |
Anton Nefedov | 159f85d | 2019-09-23 15:17:30 +0300 | [diff] [blame] | 931 | # @unmap_merged: Number of unmap requests that have been merged into another |
| 932 | # request (Since 4.2) |
| 933 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 934 | # @idle_time_ns: Time since the last I/O operation, in |
Alberto Garcia | cb38fff | 2015-10-28 17:33:02 +0200 | [diff] [blame] | 935 | # nanoseconds. If the field is absent it means that |
| 936 | # there haven't been any operations yet (Since 2.5). |
| 937 | # |
Alberto Garcia | 7ee12da | 2015-10-28 17:33:03 +0200 | [diff] [blame] | 938 | # @failed_rd_operations: The number of failed read operations |
| 939 | # performed by the device (Since 2.5) |
| 940 | # |
| 941 | # @failed_wr_operations: The number of failed write operations |
| 942 | # performed by the device (Since 2.5) |
| 943 | # |
| 944 | # @failed_flush_operations: The number of failed flush operations |
| 945 | # performed by the device (Since 2.5) |
| 946 | # |
Anton Nefedov | 159f85d | 2019-09-23 15:17:30 +0300 | [diff] [blame] | 947 | # @failed_unmap_operations: The number of failed unmap operations performed |
| 948 | # by the device (Since 4.2) |
| 949 | # |
Alberto Garcia | 7ee12da | 2015-10-28 17:33:03 +0200 | [diff] [blame] | 950 | # @invalid_rd_operations: The number of invalid read operations |
| 951 | # performed by the device (Since 2.5) |
| 952 | # |
| 953 | # @invalid_wr_operations: The number of invalid write operations |
| 954 | # performed by the device (Since 2.5) |
| 955 | # |
| 956 | # @invalid_flush_operations: The number of invalid flush operations |
| 957 | # performed by the device (Since 2.5) |
| 958 | # |
Anton Nefedov | 159f85d | 2019-09-23 15:17:30 +0300 | [diff] [blame] | 959 | # @invalid_unmap_operations: The number of invalid unmap operations performed |
| 960 | # by the device (Since 4.2) |
| 961 | # |
Alberto Garcia | 362e929 | 2015-10-28 17:33:04 +0200 | [diff] [blame] | 962 | # @account_invalid: Whether invalid operations are included in the |
| 963 | # last access statistics (Since 2.5) |
| 964 | # |
| 965 | # @account_failed: Whether failed operations are included in the |
| 966 | # latency and last access statistics (Since 2.5) |
| 967 | # |
Alberto Garcia | 979e9b0 | 2015-10-28 17:33:05 +0200 | [diff] [blame] | 968 | # @timed_stats: Statistics specific to the set of previously defined |
| 969 | # intervals of time (Since 2.5) |
| 970 | # |
Vladimir Sementsov-Ogievskiy | cb8aac3 | 2019-03-05 15:53:17 +0300 | [diff] [blame] | 971 | # @rd_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0) |
Vladimir Sementsov-Ogievskiy | 7e5c776 | 2018-03-09 19:52:12 +0300 | [diff] [blame] | 972 | # |
Vladimir Sementsov-Ogievskiy | cb8aac3 | 2019-03-05 15:53:17 +0300 | [diff] [blame] | 973 | # @wr_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0) |
Vladimir Sementsov-Ogievskiy | 7e5c776 | 2018-03-09 19:52:12 +0300 | [diff] [blame] | 974 | # |
Vladimir Sementsov-Ogievskiy | cb8aac3 | 2019-03-05 15:53:17 +0300 | [diff] [blame] | 975 | # @flush_latency_histogram: @BlockLatencyHistogramInfo. (Since 4.0) |
Vladimir Sementsov-Ogievskiy | 7e5c776 | 2018-03-09 19:52:12 +0300 | [diff] [blame] | 976 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 977 | # Since: 0.14 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 978 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 979 | { 'struct': 'BlockDeviceStats', |
Anton Nefedov | 159f85d | 2019-09-23 15:17:30 +0300 | [diff] [blame] | 980 | 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int', |
Anton Nefedov | 329d27e | 2019-09-23 15:17:29 +0300 | [diff] [blame] | 981 | 'rd_operations': 'int', 'wr_operations': 'int', |
Anton Nefedov | 159f85d | 2019-09-23 15:17:30 +0300 | [diff] [blame] | 982 | 'flush_operations': 'int', 'unmap_operations': 'int', |
Anton Nefedov | 329d27e | 2019-09-23 15:17:29 +0300 | [diff] [blame] | 983 | 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int', |
Anton Nefedov | 159f85d | 2019-09-23 15:17:30 +0300 | [diff] [blame] | 984 | 'flush_total_time_ns': 'int', 'unmap_total_time_ns': 'int', |
Anton Nefedov | 329d27e | 2019-09-23 15:17:29 +0300 | [diff] [blame] | 985 | 'wr_highest_offset': 'int', |
Anton Nefedov | 159f85d | 2019-09-23 15:17:30 +0300 | [diff] [blame] | 986 | 'rd_merged': 'int', 'wr_merged': 'int', 'unmap_merged': 'int', |
Anton Nefedov | 329d27e | 2019-09-23 15:17:29 +0300 | [diff] [blame] | 987 | '*idle_time_ns': 'int', |
Alberto Garcia | 7ee12da | 2015-10-28 17:33:03 +0200 | [diff] [blame] | 988 | 'failed_rd_operations': 'int', 'failed_wr_operations': 'int', |
Anton Nefedov | 159f85d | 2019-09-23 15:17:30 +0300 | [diff] [blame] | 989 | 'failed_flush_operations': 'int', 'failed_unmap_operations': 'int', |
Anton Nefedov | 329d27e | 2019-09-23 15:17:29 +0300 | [diff] [blame] | 990 | 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int', |
Anton Nefedov | 159f85d | 2019-09-23 15:17:30 +0300 | [diff] [blame] | 991 | 'invalid_flush_operations': 'int', 'invalid_unmap_operations': 'int', |
Alberto Garcia | 979e9b0 | 2015-10-28 17:33:05 +0200 | [diff] [blame] | 992 | 'account_invalid': 'bool', 'account_failed': 'bool', |
Vladimir Sementsov-Ogievskiy | 7e5c776 | 2018-03-09 19:52:12 +0300 | [diff] [blame] | 993 | 'timed_stats': ['BlockDeviceTimedStats'], |
Vladimir Sementsov-Ogievskiy | cb8aac3 | 2019-03-05 15:53:17 +0300 | [diff] [blame] | 994 | '*rd_latency_histogram': 'BlockLatencyHistogramInfo', |
| 995 | '*wr_latency_histogram': 'BlockLatencyHistogramInfo', |
| 996 | '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 997 | |
| 998 | ## |
Anton Nefedov | d924559 | 2019-09-23 15:17:37 +0300 | [diff] [blame] | 999 | # @BlockStatsSpecificFile: |
| 1000 | # |
| 1001 | # File driver statistics |
| 1002 | # |
| 1003 | # @discard-nb-ok: The number of successful discard operations performed by |
| 1004 | # the driver. |
| 1005 | # |
| 1006 | # @discard-nb-failed: The number of failed discard operations performed by |
| 1007 | # the driver. |
| 1008 | # |
| 1009 | # @discard-bytes-ok: The number of bytes discarded by the driver. |
| 1010 | # |
| 1011 | # Since: 4.2 |
| 1012 | ## |
| 1013 | { 'struct': 'BlockStatsSpecificFile', |
| 1014 | 'data': { |
| 1015 | 'discard-nb-ok': 'uint64', |
| 1016 | 'discard-nb-failed': 'uint64', |
| 1017 | 'discard-bytes-ok': 'uint64' } } |
| 1018 | |
| 1019 | ## |
Philippe Mathieu-Daudé | f25e7ab | 2020-10-01 18:29:39 +0200 | [diff] [blame] | 1020 | # @BlockStatsSpecificNvme: |
| 1021 | # |
| 1022 | # NVMe driver statistics |
| 1023 | # |
| 1024 | # @completion-errors: The number of completion errors. |
| 1025 | # |
| 1026 | # @aligned-accesses: The number of aligned accesses performed by |
| 1027 | # the driver. |
| 1028 | # |
| 1029 | # @unaligned-accesses: The number of unaligned accesses performed by |
| 1030 | # the driver. |
| 1031 | # |
| 1032 | # Since: 5.2 |
| 1033 | ## |
| 1034 | { 'struct': 'BlockStatsSpecificNvme', |
| 1035 | 'data': { |
| 1036 | 'completion-errors': 'uint64', |
| 1037 | 'aligned-accesses': 'uint64', |
| 1038 | 'unaligned-accesses': 'uint64' } } |
| 1039 | |
| 1040 | ## |
Anton Nefedov | d924559 | 2019-09-23 15:17:37 +0300 | [diff] [blame] | 1041 | # @BlockStatsSpecific: |
| 1042 | # |
| 1043 | # Block driver specific statistics |
| 1044 | # |
| 1045 | # Since: 4.2 |
| 1046 | ## |
| 1047 | { 'union': 'BlockStatsSpecific', |
| 1048 | 'base': { 'driver': 'BlockdevDriver' }, |
| 1049 | 'discriminator': 'driver', |
| 1050 | 'data': { |
| 1051 | 'file': 'BlockStatsSpecificFile', |
Joelle van Dyne | 14176c8 | 2021-03-15 11:03:38 -0700 | [diff] [blame] | 1052 | 'host_device': { 'type': 'BlockStatsSpecificFile', |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 1053 | 'if': 'HAVE_HOST_BLOCK_DEVICE' }, |
Philippe Mathieu-Daudé | f25e7ab | 2020-10-01 18:29:39 +0200 | [diff] [blame] | 1054 | 'nvme': 'BlockStatsSpecificNvme' } } |
Anton Nefedov | d924559 | 2019-09-23 15:17:37 +0300 | [diff] [blame] | 1055 | |
| 1056 | ## |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1057 | # @BlockStats: |
| 1058 | # |
| 1059 | # Statistics of a virtual block device or a block backing device. |
| 1060 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1061 | # @device: If the stats are for a virtual block device, the name |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1062 | # corresponding to the virtual block device. |
| 1063 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1064 | # @node-name: The node name of the device. (Since 2.3) |
Fam Zheng | 4875a77 | 2014-10-31 11:32:56 +0800 | [diff] [blame] | 1065 | # |
Kevin Wolf | 5a9cb5a | 2018-07-27 16:07:07 +0200 | [diff] [blame] | 1066 | # @qdev: The qdev ID, or if no ID is assigned, the QOM path of the block |
| 1067 | # device. (since 3.0) |
| 1068 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 1069 | # @stats: A @BlockDeviceStats for the device. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1070 | # |
Anton Nefedov | d924559 | 2019-09-23 15:17:37 +0300 | [diff] [blame] | 1071 | # @driver-specific: Optional driver-specific stats. (Since 4.2) |
| 1072 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1073 | # @parent: This describes the file block device if it has one. |
Marc-André Lureau | f2eaea1 | 2016-06-23 14:00:14 +0200 | [diff] [blame] | 1074 | # Contains recursively the statistics of the underlying |
| 1075 | # protocol (e.g. the host file for a qcow2 image). If there is |
| 1076 | # no underlying protocol, this field is omitted |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1077 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1078 | # @backing: This describes the backing block device if it has one. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1079 | # (Since 2.0) |
| 1080 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 1081 | # Since: 0.14 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1082 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 1083 | { 'struct': 'BlockStats', |
Kevin Wolf | 5a9cb5a | 2018-07-27 16:07:07 +0200 | [diff] [blame] | 1084 | 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str', |
Fam Zheng | 4875a77 | 2014-10-31 11:32:56 +0800 | [diff] [blame] | 1085 | 'stats': 'BlockDeviceStats', |
Anton Nefedov | d924559 | 2019-09-23 15:17:37 +0300 | [diff] [blame] | 1086 | '*driver-specific': 'BlockStatsSpecific', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1087 | '*parent': 'BlockStats', |
| 1088 | '*backing': 'BlockStats'} } |
| 1089 | |
| 1090 | ## |
| 1091 | # @query-blockstats: |
| 1092 | # |
| 1093 | # Query the @BlockStats for all virtual block devices. |
| 1094 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1095 | # @query-nodes: If true, the command will query all the block nodes |
Fam Zheng | f71eaa7 | 2014-10-31 11:32:57 +0800 | [diff] [blame] | 1096 | # that have a node name, in a list which will include "parent" |
| 1097 | # information, but not "backing". |
| 1098 | # If false or omitted, the behavior is as before - query all the |
| 1099 | # device backends, recursively including their "parent" and |
Kevin Wolf | d3c8c67 | 2017-07-18 17:24:05 +0200 | [diff] [blame] | 1100 | # "backing". Filter nodes that were created implicitly are |
| 1101 | # skipped over in this mode. (Since 2.3) |
Fam Zheng | f71eaa7 | 2014-10-31 11:32:57 +0800 | [diff] [blame] | 1102 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1103 | # Returns: A list of @BlockStats for each virtual block devices. |
| 1104 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 1105 | # Since: 0.14 |
Marc-André Lureau | f2eaea1 | 2016-06-23 14:00:14 +0200 | [diff] [blame] | 1106 | # |
| 1107 | # Example: |
| 1108 | # |
| 1109 | # -> { "execute": "query-blockstats" } |
| 1110 | # <- { |
| 1111 | # "return":[ |
| 1112 | # { |
| 1113 | # "device":"ide0-hd0", |
| 1114 | # "parent":{ |
| 1115 | # "stats":{ |
| 1116 | # "wr_highest_offset":3686448128, |
| 1117 | # "wr_bytes":9786368, |
| 1118 | # "wr_operations":751, |
| 1119 | # "rd_bytes":122567168, |
| 1120 | # "rd_operations":36772 |
| 1121 | # "wr_total_times_ns":313253456 |
| 1122 | # "rd_total_times_ns":3465673657 |
| 1123 | # "flush_total_times_ns":49653 |
| 1124 | # "flush_operations":61, |
| 1125 | # "rd_merged":0, |
| 1126 | # "wr_merged":0, |
| 1127 | # "idle_time_ns":2953431879, |
| 1128 | # "account_invalid":true, |
| 1129 | # "account_failed":false |
| 1130 | # } |
| 1131 | # }, |
| 1132 | # "stats":{ |
| 1133 | # "wr_highest_offset":2821110784, |
| 1134 | # "wr_bytes":9786368, |
| 1135 | # "wr_operations":692, |
| 1136 | # "rd_bytes":122739200, |
| 1137 | # "rd_operations":36604 |
| 1138 | # "flush_operations":51, |
| 1139 | # "wr_total_times_ns":313253456 |
| 1140 | # "rd_total_times_ns":3465673657 |
| 1141 | # "flush_total_times_ns":49653, |
| 1142 | # "rd_merged":0, |
| 1143 | # "wr_merged":0, |
| 1144 | # "idle_time_ns":2953431879, |
| 1145 | # "account_invalid":true, |
| 1146 | # "account_failed":false |
Kevin Wolf | 5a9cb5a | 2018-07-27 16:07:07 +0200 | [diff] [blame] | 1147 | # }, |
| 1148 | # "qdev": "/machine/unattached/device[23]" |
Marc-André Lureau | f2eaea1 | 2016-06-23 14:00:14 +0200 | [diff] [blame] | 1149 | # }, |
| 1150 | # { |
| 1151 | # "device":"ide1-cd0", |
| 1152 | # "stats":{ |
| 1153 | # "wr_highest_offset":0, |
| 1154 | # "wr_bytes":0, |
| 1155 | # "wr_operations":0, |
| 1156 | # "rd_bytes":0, |
| 1157 | # "rd_operations":0 |
| 1158 | # "flush_operations":0, |
| 1159 | # "wr_total_times_ns":0 |
| 1160 | # "rd_total_times_ns":0 |
| 1161 | # "flush_total_times_ns":0, |
| 1162 | # "rd_merged":0, |
| 1163 | # "wr_merged":0, |
| 1164 | # "account_invalid":false, |
| 1165 | # "account_failed":false |
Kevin Wolf | 5a9cb5a | 2018-07-27 16:07:07 +0200 | [diff] [blame] | 1166 | # }, |
| 1167 | # "qdev": "/machine/unattached/device[24]" |
Marc-André Lureau | f2eaea1 | 2016-06-23 14:00:14 +0200 | [diff] [blame] | 1168 | # }, |
| 1169 | # { |
| 1170 | # "device":"floppy0", |
| 1171 | # "stats":{ |
| 1172 | # "wr_highest_offset":0, |
| 1173 | # "wr_bytes":0, |
| 1174 | # "wr_operations":0, |
| 1175 | # "rd_bytes":0, |
| 1176 | # "rd_operations":0 |
| 1177 | # "flush_operations":0, |
| 1178 | # "wr_total_times_ns":0 |
| 1179 | # "rd_total_times_ns":0 |
| 1180 | # "flush_total_times_ns":0, |
| 1181 | # "rd_merged":0, |
| 1182 | # "wr_merged":0, |
| 1183 | # "account_invalid":false, |
| 1184 | # "account_failed":false |
Kevin Wolf | 5a9cb5a | 2018-07-27 16:07:07 +0200 | [diff] [blame] | 1185 | # }, |
| 1186 | # "qdev": "/machine/unattached/device[16]" |
Marc-André Lureau | f2eaea1 | 2016-06-23 14:00:14 +0200 | [diff] [blame] | 1187 | # }, |
| 1188 | # { |
| 1189 | # "device":"sd0", |
| 1190 | # "stats":{ |
| 1191 | # "wr_highest_offset":0, |
| 1192 | # "wr_bytes":0, |
| 1193 | # "wr_operations":0, |
| 1194 | # "rd_bytes":0, |
| 1195 | # "rd_operations":0 |
| 1196 | # "flush_operations":0, |
| 1197 | # "wr_total_times_ns":0 |
| 1198 | # "rd_total_times_ns":0 |
| 1199 | # "flush_total_times_ns":0, |
| 1200 | # "rd_merged":0, |
| 1201 | # "wr_merged":0, |
| 1202 | # "account_invalid":false, |
| 1203 | # "account_failed":false |
| 1204 | # } |
| 1205 | # } |
| 1206 | # ] |
| 1207 | # } |
| 1208 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1209 | ## |
Fam Zheng | f71eaa7 | 2014-10-31 11:32:57 +0800 | [diff] [blame] | 1210 | { 'command': 'query-blockstats', |
| 1211 | 'data': { '*query-nodes': 'bool' }, |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 1212 | 'returns': ['BlockStats'], |
| 1213 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1214 | |
| 1215 | ## |
| 1216 | # @BlockdevOnError: |
| 1217 | # |
| 1218 | # An enumeration of possible behaviors for errors on I/O operations. |
| 1219 | # The exact meaning depends on whether the I/O was initiated by a guest |
| 1220 | # or by a block job |
| 1221 | # |
| 1222 | # @report: for guest operations, report the error to the guest; |
| 1223 | # for jobs, cancel the job |
| 1224 | # |
| 1225 | # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR |
Kevin Wolf | 248e3ff | 2020-02-14 21:08:06 +0100 | [diff] [blame] | 1226 | # or BLOCK_JOB_ERROR). The backup, mirror and commit block jobs retry |
| 1227 | # the failing request later and may still complete successfully. The |
| 1228 | # stream block job continues to stream and will complete with an |
| 1229 | # error. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1230 | # |
| 1231 | # @enospc: same as @stop on ENOSPC, same as @report otherwise. |
| 1232 | # |
| 1233 | # @stop: for guest operations, stop the virtual machine; |
| 1234 | # for jobs, pause the job |
| 1235 | # |
Kevin Wolf | 8c39825 | 2016-06-29 17:41:35 +0200 | [diff] [blame] | 1236 | # @auto: inherit the error handling policy of the backend (since: 2.7) |
| 1237 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1238 | # Since: 1.3 |
| 1239 | ## |
| 1240 | { 'enum': 'BlockdevOnError', |
Kevin Wolf | 8c39825 | 2016-06-29 17:41:35 +0200 | [diff] [blame] | 1241 | 'data': ['report', 'ignore', 'enospc', 'stop', 'auto'] } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1242 | |
| 1243 | ## |
| 1244 | # @MirrorSyncMode: |
| 1245 | # |
| 1246 | # An enumeration of possible behaviors for the initial synchronization |
| 1247 | # phase of storage mirroring. |
| 1248 | # |
| 1249 | # @top: copies data in the topmost image to the destination |
| 1250 | # |
| 1251 | # @full: copies data from all images to the destination |
| 1252 | # |
| 1253 | # @none: only copy data written from now on |
| 1254 | # |
John Snow | c8b5650 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1255 | # @incremental: only copy data described by the dirty bitmap. (since: 2.4) |
| 1256 | # |
| 1257 | # @bitmap: only copy data described by the dirty bitmap. (since: 4.2) |
| 1258 | # Behavior on completion is determined by the BitmapSyncMode. |
John Snow | d58d845 | 2015-04-17 19:49:58 -0400 | [diff] [blame] | 1259 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1260 | # Since: 1.3 |
| 1261 | ## |
| 1262 | { 'enum': 'MirrorSyncMode', |
John Snow | c8b5650 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1263 | 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1264 | |
| 1265 | ## |
John Snow | 00a463b | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1266 | # @BitmapSyncMode: |
| 1267 | # |
| 1268 | # An enumeration of possible behaviors for the synchronization of a bitmap |
| 1269 | # when used for data copy operations. |
| 1270 | # |
| 1271 | # @on-success: The bitmap is only synced when the operation is successful. |
| 1272 | # This is the behavior always used for 'INCREMENTAL' backups. |
| 1273 | # |
John Snow | cf0cd29 | 2019-07-29 16:35:53 -0400 | [diff] [blame] | 1274 | # @never: The bitmap is never synchronized with the operation, and is |
| 1275 | # treated solely as a read-only manifest of blocks to copy. |
| 1276 | # |
John Snow | c23909e | 2019-07-29 16:35:53 -0400 | [diff] [blame] | 1277 | # @always: The bitmap is always synchronized with the operation, |
| 1278 | # regardless of whether or not the operation was successful. |
| 1279 | # |
John Snow | 00a463b | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1280 | # Since: 4.2 |
| 1281 | ## |
| 1282 | { 'enum': 'BitmapSyncMode', |
John Snow | c23909e | 2019-07-29 16:35:53 -0400 | [diff] [blame] | 1283 | 'data': ['on-success', 'never', 'always'] } |
John Snow | 00a463b | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1284 | |
| 1285 | ## |
Max Reitz | d06107a | 2018-06-13 20:18:21 +0200 | [diff] [blame] | 1286 | # @MirrorCopyMode: |
| 1287 | # |
| 1288 | # An enumeration whose values tell the mirror block job when to |
| 1289 | # trigger writes to the target. |
| 1290 | # |
| 1291 | # @background: copy data in background only. |
| 1292 | # |
| 1293 | # @write-blocking: when data is written to the source, write it |
| 1294 | # (synchronously) to the target as well. In |
| 1295 | # addition, data is copied in background just like in |
| 1296 | # @background mode. |
| 1297 | # |
| 1298 | # Since: 3.0 |
| 1299 | ## |
| 1300 | { 'enum': 'MirrorCopyMode', |
| 1301 | 'data': ['background', 'write-blocking'] } |
| 1302 | |
| 1303 | ## |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1304 | # @BlockJobInfo: |
| 1305 | # |
| 1306 | # Information about a long-running block device operation. |
| 1307 | # |
| 1308 | # @type: the job type ('stream' for image streaming) |
| 1309 | # |
Alberto Garcia | 6aae5be | 2016-07-05 17:29:02 +0300 | [diff] [blame] | 1310 | # @device: The job identifier. Originally the device name but other |
| 1311 | # values are allowed since QEMU 2.7 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1312 | # |
Kevin Wolf | a81e0a8 | 2018-05-16 13:04:34 +0200 | [diff] [blame] | 1313 | # @len: Estimated @offset value at the completion of the job. This value can |
| 1314 | # arbitrarily change while the job is running, in both directions. |
| 1315 | # |
| 1316 | # @offset: Progress made until now. The unit is arbitrary and the value can |
| 1317 | # only meaningfully be used for the ratio of @offset to @len. The |
| 1318 | # value is monotonically increasing. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1319 | # |
| 1320 | # @busy: false if the job is known to be in a quiescent state, with |
| 1321 | # no pending I/O. Since 1.3. |
| 1322 | # |
| 1323 | # @paused: whether the job is paused or, if @busy is true, will |
| 1324 | # pause itself as soon as possible. Since 1.3. |
| 1325 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1326 | # @speed: the rate limit, bytes per second |
| 1327 | # |
| 1328 | # @io-status: the status of the job (since 1.3) |
| 1329 | # |
Max Reitz | ef6dbf1 | 2014-10-24 15:57:34 +0200 | [diff] [blame] | 1330 | # @ready: true if the job may be completed (since 2.2) |
| 1331 | # |
John Snow | 58b295b | 2018-03-10 03:27:29 -0500 | [diff] [blame] | 1332 | # @status: Current job state/status (since 2.12) |
| 1333 | # |
John Snow | b40dacd | 2018-03-10 03:27:44 -0500 | [diff] [blame] | 1334 | # @auto-finalize: Job will finalize itself when PENDING, moving to |
| 1335 | # the CONCLUDED state. (since 2.12) |
| 1336 | # |
| 1337 | # @auto-dismiss: Job will dismiss itself when CONCLUDED, moving to the NULL |
| 1338 | # state and disappearing from the query list. (since 2.12) |
| 1339 | # |
John Snow | ab9ba61 | 2018-05-08 19:36:59 -0400 | [diff] [blame] | 1340 | # @error: Error information if the job did not complete successfully. |
| 1341 | # Not set if the job completed successfully. (since 2.12.1) |
| 1342 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1343 | # Since: 1.1 |
| 1344 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 1345 | { 'struct': 'BlockJobInfo', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1346 | 'data': {'type': 'str', 'device': 'str', 'len': 'int', |
| 1347 | 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int', |
John Snow | 58b295b | 2018-03-10 03:27:29 -0500 | [diff] [blame] | 1348 | 'io-status': 'BlockDeviceIoStatus', 'ready': 'bool', |
Kevin Wolf | a50c2ab | 2018-04-13 17:19:31 +0200 | [diff] [blame] | 1349 | 'status': 'JobStatus', |
John Snow | ab9ba61 | 2018-05-08 19:36:59 -0400 | [diff] [blame] | 1350 | 'auto-finalize': 'bool', 'auto-dismiss': 'bool', |
| 1351 | '*error': 'str' } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1352 | |
| 1353 | ## |
| 1354 | # @query-block-jobs: |
| 1355 | # |
| 1356 | # Return information about long-running block device operations. |
| 1357 | # |
| 1358 | # Returns: a list of @BlockJobInfo for each active block job |
| 1359 | # |
| 1360 | # Since: 1.1 |
| 1361 | ## |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 1362 | { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'], |
| 1363 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1364 | |
| 1365 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1366 | # @block_resize: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1367 | # |
| 1368 | # Resize a block image while a guest is running. |
| 1369 | # |
| 1370 | # Either @device or @node-name must be set but not both. |
| 1371 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1372 | # @device: the name of the device to get the image resized |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1373 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1374 | # @node-name: graph node name to get the image resized (Since 2.0) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1375 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 1376 | # @size: new image size in bytes |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1377 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 1378 | # Returns: - nothing on success |
| 1379 | # - If @device is not a valid block device, DeviceNotFound |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1380 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 1381 | # Since: 0.14 |
Marc-André Lureau | 0dc869c | 2016-06-23 14:01:52 +0200 | [diff] [blame] | 1382 | # |
| 1383 | # Example: |
| 1384 | # |
| 1385 | # -> { "execute": "block_resize", |
| 1386 | # "arguments": { "device": "scratch", "size": 1073741824 } } |
| 1387 | # <- { "return": {} } |
| 1388 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1389 | ## |
Marc-André Lureau | b0ddeba | 2018-12-08 15:16:04 +0400 | [diff] [blame] | 1390 | { 'command': 'block_resize', |
| 1391 | 'data': { '*device': 'str', |
| 1392 | '*node-name': 'str', |
Kevin Wolf | eb94b81 | 2020-10-05 17:58:55 +0200 | [diff] [blame] | 1393 | 'size': 'int' }, |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 1394 | 'coroutine': true, |
| 1395 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1396 | |
| 1397 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1398 | # @NewImageMode: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1399 | # |
| 1400 | # An enumeration that tells QEMU how to set the backing file path in |
| 1401 | # a new image file. |
| 1402 | # |
| 1403 | # @existing: QEMU should look for an existing image file. |
| 1404 | # |
| 1405 | # @absolute-paths: QEMU should create a new image with absolute paths |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 1406 | # for the backing file. If there is no backing file available, the new |
| 1407 | # image will not be backed either. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1408 | # |
| 1409 | # Since: 1.1 |
| 1410 | ## |
| 1411 | { 'enum': 'NewImageMode', |
| 1412 | 'data': [ 'existing', 'absolute-paths' ] } |
| 1413 | |
| 1414 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1415 | # @BlockdevSnapshotSync: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1416 | # |
| 1417 | # Either @device or @node-name must be set but not both. |
| 1418 | # |
Max Reitz | 681b86a | 2019-06-03 22:22:35 +0200 | [diff] [blame] | 1419 | # @device: the name of the device to take a snapshot of. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1420 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1421 | # @node-name: graph node name to generate the snapshot from (Since 2.0) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1422 | # |
Max Reitz | 681b86a | 2019-06-03 22:22:35 +0200 | [diff] [blame] | 1423 | # @snapshot-file: the target of the new overlay image. If the file |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 1424 | # exists, or if it is a device, the overlay will be created in the |
| 1425 | # existing file/device. Otherwise, a new file will be created. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1426 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1427 | # @snapshot-node-name: the graph node name of the new image (Since 2.0) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1428 | # |
Max Reitz | 681b86a | 2019-06-03 22:22:35 +0200 | [diff] [blame] | 1429 | # @format: the format of the overlay image, default is 'qcow2'. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1430 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1431 | # @mode: whether and how QEMU should create a new image, default is |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1432 | # 'absolute-paths'. |
| 1433 | ## |
Alberto Garcia | a911e6a | 2015-10-26 14:27:14 +0200 | [diff] [blame] | 1434 | { 'struct': 'BlockdevSnapshotSync', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1435 | 'data': { '*device': 'str', '*node-name': 'str', |
| 1436 | 'snapshot-file': 'str', '*snapshot-node-name': 'str', |
| 1437 | '*format': 'str', '*mode': 'NewImageMode' } } |
| 1438 | |
| 1439 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1440 | # @BlockdevSnapshot: |
Alberto Garcia | 43de7e2 | 2015-10-26 14:27:16 +0200 | [diff] [blame] | 1441 | # |
Max Reitz | 681b86a | 2019-06-03 22:22:35 +0200 | [diff] [blame] | 1442 | # @node: device or node name that will have a snapshot taken. |
Alberto Garcia | 43de7e2 | 2015-10-26 14:27:16 +0200 | [diff] [blame] | 1443 | # |
| 1444 | # @overlay: reference to the existing block device that will become |
Max Reitz | 681b86a | 2019-06-03 22:22:35 +0200 | [diff] [blame] | 1445 | # the overlay of @node, as part of taking the snapshot. |
Alberto Garcia | 43de7e2 | 2015-10-26 14:27:16 +0200 | [diff] [blame] | 1446 | # It must not have a current backing file (this can be |
Max Reitz | 4f7be28 | 2018-02-24 16:40:33 +0100 | [diff] [blame] | 1447 | # achieved by passing "backing": null to blockdev-add). |
Alberto Garcia | 43de7e2 | 2015-10-26 14:27:16 +0200 | [diff] [blame] | 1448 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1449 | # Since: 2.5 |
Alberto Garcia | 43de7e2 | 2015-10-26 14:27:16 +0200 | [diff] [blame] | 1450 | ## |
| 1451 | { 'struct': 'BlockdevSnapshot', |
| 1452 | 'data': { 'node': 'str', 'overlay': 'str' } } |
| 1453 | |
| 1454 | ## |
Vladimir Sementsov-Ogievskiy | 86c6a3b | 2021-01-17 00:46:43 +0300 | [diff] [blame] | 1455 | # @BackupPerf: |
| 1456 | # |
| 1457 | # Optional parameters for backup. These parameters don't affect |
| 1458 | # functionality, but may significantly affect performance. |
| 1459 | # |
Vladimir Sementsov-Ogievskiy | 6a30f66 | 2021-01-17 00:47:00 +0300 | [diff] [blame] | 1460 | # @use-copy-range: Use copy offloading. Default false. |
Vladimir Sementsov-Ogievskiy | 86c6a3b | 2021-01-17 00:46:43 +0300 | [diff] [blame] | 1461 | # |
Vladimir Sementsov-Ogievskiy | 2c59fd8 | 2021-01-17 00:46:52 +0300 | [diff] [blame] | 1462 | # @max-workers: Maximum number of parallel requests for the sustained background |
| 1463 | # copying process. Doesn't influence copy-before-write operations. |
| 1464 | # Default 64. |
| 1465 | # |
| 1466 | # @max-chunk: Maximum request length for the sustained background copying |
| 1467 | # process. Doesn't influence copy-before-write operations. |
| 1468 | # 0 means unlimited. If max-chunk is non-zero then it should not be |
| 1469 | # less than job cluster size which is calculated as maximum of |
| 1470 | # target image cluster size and 64k. Default 0. |
| 1471 | # |
Vladimir Sementsov-Ogievskiy | 86c6a3b | 2021-01-17 00:46:43 +0300 | [diff] [blame] | 1472 | # Since: 6.0 |
| 1473 | ## |
| 1474 | { 'struct': 'BackupPerf', |
Vladimir Sementsov-Ogievskiy | 2c59fd8 | 2021-01-17 00:46:52 +0300 | [diff] [blame] | 1475 | 'data': { '*use-copy-range': 'bool', |
| 1476 | '*max-workers': 'int', '*max-chunk': 'int64' } } |
Vladimir Sementsov-Ogievskiy | 86c6a3b | 2021-01-17 00:46:43 +0300 | [diff] [blame] | 1477 | |
| 1478 | ## |
John Snow | 3c95037 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1479 | # @BackupCommon: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1480 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1481 | # @job-id: identifier for the newly-created block job. If |
Alberto Garcia | 70559d4 | 2016-07-05 17:28:58 +0300 | [diff] [blame] | 1482 | # omitted, the device name will be used. (Since 2.7) |
| 1483 | # |
Kevin Wolf | b7e4fa2 | 2016-06-23 14:20:24 +0200 | [diff] [blame] | 1484 | # @device: the device name or node-name of a root node which should be copied. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1485 | # |
John Snow | 3c95037 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1486 | # @sync: what parts of the disk image should be copied to the destination |
| 1487 | # (all the disk, only the sectors allocated in the topmost image, from a |
| 1488 | # dirty bitmap, or only new I/O). |
| 1489 | # |
| 1490 | # @speed: the maximum speed, in bytes per second. The default is 0, |
| 1491 | # for unlimited. |
| 1492 | # |
John Snow | 1a2b8b4 | 2019-07-29 16:35:55 -0400 | [diff] [blame] | 1493 | # @bitmap: The name of a dirty bitmap to use. |
John Snow | c8b5650 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1494 | # Must be present if sync is "bitmap" or "incremental". |
John Snow | 1a2b8b4 | 2019-07-29 16:35:55 -0400 | [diff] [blame] | 1495 | # Can be present if sync is "full" or "top". |
John Snow | c8b5650 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1496 | # Must not be present otherwise. |
| 1497 | # (Since 2.4 (drive-backup), 3.1 (blockdev-backup)) |
| 1498 | # |
| 1499 | # @bitmap-mode: Specifies the type of data the bitmap should contain after |
John Snow | 1a2b8b4 | 2019-07-29 16:35:55 -0400 | [diff] [blame] | 1500 | # the operation concludes. |
| 1501 | # Must be present if a bitmap was provided, |
John Snow | c8b5650 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1502 | # Must NOT be present otherwise. (Since 4.2) |
John Snow | 3c95037 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1503 | # |
| 1504 | # @compress: true to compress data, if the target format supports it. |
| 1505 | # (default: false) (since 2.8) |
| 1506 | # |
| 1507 | # @on-source-error: the action to take on an error on the source, |
| 1508 | # default 'report'. 'stop' and 'enospc' can only be used |
| 1509 | # if the block device supports io-status (see BlockInfo). |
| 1510 | # |
| 1511 | # @on-target-error: the action to take on an error on the target, |
| 1512 | # default 'report' (no limitations, since this applies to |
| 1513 | # a different block device than @device). |
| 1514 | # |
| 1515 | # @auto-finalize: When false, this job will wait in a PENDING state after it has |
| 1516 | # finished its work, waiting for @block-job-finalize before |
| 1517 | # making any block graph changes. |
| 1518 | # When true, this job will automatically |
| 1519 | # perform its abort or commit actions. |
| 1520 | # Defaults to true. (Since 2.12) |
| 1521 | # |
| 1522 | # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it |
| 1523 | # has completely ceased all work, and awaits @block-job-dismiss. |
| 1524 | # When true, this job will automatically disappear from the query |
| 1525 | # list without user intervention. |
| 1526 | # Defaults to true. (Since 2.12) |
| 1527 | # |
Vladimir Sementsov-Ogievskiy | 00e30f0 | 2019-10-01 16:14:09 +0300 | [diff] [blame] | 1528 | # @filter-node-name: the node name that should be assigned to the |
| 1529 | # filter driver that the backup job inserts into the graph |
| 1530 | # above node specified by @drive. If this option is not given, |
| 1531 | # a node name is autogenerated. (Since: 4.2) |
| 1532 | # |
Vladimir Sementsov-Ogievskiy | 86c6a3b | 2021-01-17 00:46:43 +0300 | [diff] [blame] | 1533 | # @x-perf: Performance options. (Since 6.0) |
| 1534 | # |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 1535 | # Features: |
| 1536 | # @unstable: Member @x-perf is experimental. |
| 1537 | # |
John Snow | 3c95037 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1538 | # Note: @on-source-error and @on-target-error only affect background |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 1539 | # I/O. If an error occurs during a guest write request, the device's |
| 1540 | # rerror/werror actions will be used. |
John Snow | 3c95037 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1541 | # |
| 1542 | # Since: 4.2 |
| 1543 | ## |
| 1544 | { 'struct': 'BackupCommon', |
| 1545 | 'data': { '*job-id': 'str', 'device': 'str', |
| 1546 | 'sync': 'MirrorSyncMode', '*speed': 'int', |
John Snow | c8b5650 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1547 | '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode', |
| 1548 | '*compress': 'bool', |
John Snow | 3c95037 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1549 | '*on-source-error': 'BlockdevOnError', |
| 1550 | '*on-target-error': 'BlockdevOnError', |
Vladimir Sementsov-Ogievskiy | 00e30f0 | 2019-10-01 16:14:09 +0300 | [diff] [blame] | 1551 | '*auto-finalize': 'bool', '*auto-dismiss': 'bool', |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 1552 | '*filter-node-name': 'str', |
| 1553 | '*x-perf': { 'type': 'BackupPerf', |
| 1554 | 'features': [ 'unstable' ] } } } |
John Snow | 3c95037 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1555 | |
| 1556 | ## |
| 1557 | # @DriveBackup: |
| 1558 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1559 | # @target: the target of the new image. If the file exists, or if it |
| 1560 | # is a device, the existing file/device will be used as the new |
| 1561 | # destination. If it does not exist, a new file will be created. |
| 1562 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1563 | # @format: the format of the new destination, default is to |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1564 | # probe if @mode is 'existing', else the format of the source |
| 1565 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1566 | # @mode: whether and how QEMU should create a new image, default is |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1567 | # 'absolute-paths'. |
| 1568 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1569 | # Since: 1.6 |
| 1570 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 1571 | { 'struct': 'DriveBackup', |
John Snow | 3c95037 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1572 | 'base': 'BackupCommon', |
| 1573 | 'data': { 'target': 'str', |
| 1574 | '*format': 'str', |
| 1575 | '*mode': 'NewImageMode' } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1576 | |
| 1577 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1578 | # @BlockdevBackup: |
Fam Zheng | c29c1dd | 2014-12-18 18:37:05 +0800 | [diff] [blame] | 1579 | # |
Kevin Wolf | 39d990a | 2016-08-02 19:22:04 +0200 | [diff] [blame] | 1580 | # @target: the device name or node-name of the backup target node. |
Fam Zheng | c29c1dd | 2014-12-18 18:37:05 +0800 | [diff] [blame] | 1581 | # |
Fam Zheng | c29c1dd | 2014-12-18 18:37:05 +0800 | [diff] [blame] | 1582 | # Since: 2.3 |
| 1583 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 1584 | { 'struct': 'BlockdevBackup', |
John Snow | 3c95037 | 2019-07-29 16:35:52 -0400 | [diff] [blame] | 1585 | 'base': 'BackupCommon', |
| 1586 | 'data': { 'target': 'str' } } |
Fam Zheng | c29c1dd | 2014-12-18 18:37:05 +0800 | [diff] [blame] | 1587 | |
| 1588 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1589 | # @blockdev-snapshot-sync: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1590 | # |
Max Reitz | 681b86a | 2019-06-03 22:22:35 +0200 | [diff] [blame] | 1591 | # Takes a synchronous snapshot of a block device. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1592 | # |
Alberto Garcia | a911e6a | 2015-10-26 14:27:14 +0200 | [diff] [blame] | 1593 | # For the arguments, see the documentation of BlockdevSnapshotSync. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1594 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 1595 | # Returns: - nothing on success |
| 1596 | # - If @device is not a valid block device, DeviceNotFound |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1597 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 1598 | # Since: 0.14 |
Marc-André Lureau | b4039d8 | 2016-06-23 14:04:28 +0200 | [diff] [blame] | 1599 | # |
| 1600 | # Example: |
| 1601 | # |
| 1602 | # -> { "execute": "blockdev-snapshot-sync", |
| 1603 | # "arguments": { "device": "ide-hd0", |
| 1604 | # "snapshot-file": |
| 1605 | # "/some/place/my-image", |
| 1606 | # "format": "qcow2" } } |
| 1607 | # <- { "return": {} } |
| 1608 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1609 | ## |
| 1610 | { 'command': 'blockdev-snapshot-sync', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 1611 | 'data': 'BlockdevSnapshotSync', |
| 1612 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1613 | |
Alberto Garcia | 43de7e2 | 2015-10-26 14:27:16 +0200 | [diff] [blame] | 1614 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1615 | # @blockdev-snapshot: |
Alberto Garcia | 43de7e2 | 2015-10-26 14:27:16 +0200 | [diff] [blame] | 1616 | # |
Max Reitz | 681b86a | 2019-06-03 22:22:35 +0200 | [diff] [blame] | 1617 | # Takes a snapshot of a block device. |
Alberto Garcia | 43de7e2 | 2015-10-26 14:27:16 +0200 | [diff] [blame] | 1618 | # |
Max Reitz | 681b86a | 2019-06-03 22:22:35 +0200 | [diff] [blame] | 1619 | # Take a snapshot, by installing 'node' as the backing image of |
Marc-André Lureau | 3282eca | 2016-06-23 14:08:19 +0200 | [diff] [blame] | 1620 | # 'overlay'. Additionally, if 'node' is associated with a block |
| 1621 | # device, the block device changes to using 'overlay' as its new active |
| 1622 | # image. |
| 1623 | # |
Alberto Garcia | 43de7e2 | 2015-10-26 14:27:16 +0200 | [diff] [blame] | 1624 | # For the arguments, see the documentation of BlockdevSnapshot. |
| 1625 | # |
Peter Krempa | c6bdc31 | 2020-03-10 12:38:31 +0100 | [diff] [blame] | 1626 | # Features: |
| 1627 | # @allow-write-only-overlay: If present, the check whether this operation is safe |
| 1628 | # was relaxed so that it can be used to change |
| 1629 | # backing file of a destination of a blockdev-mirror. |
| 1630 | # (since 5.0) |
| 1631 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1632 | # Since: 2.5 |
Marc-André Lureau | 3282eca | 2016-06-23 14:08:19 +0200 | [diff] [blame] | 1633 | # |
| 1634 | # Example: |
| 1635 | # |
| 1636 | # -> { "execute": "blockdev-add", |
Eric Blake | 244d04d | 2017-05-23 12:44:20 -0500 | [diff] [blame] | 1637 | # "arguments": { "driver": "qcow2", |
| 1638 | # "node-name": "node1534", |
Markus Armbruster | 34f58df | 2022-09-30 19:19:08 +0200 | [diff] [blame] | 1639 | # "file": { "driver": "file", |
| 1640 | # "filename": "hd1.qcow2" }, |
Max Reitz | 4f7be28 | 2018-02-24 16:40:33 +0100 | [diff] [blame] | 1641 | # "backing": null } } |
Marc-André Lureau | 3282eca | 2016-06-23 14:08:19 +0200 | [diff] [blame] | 1642 | # |
| 1643 | # <- { "return": {} } |
| 1644 | # |
| 1645 | # -> { "execute": "blockdev-snapshot", |
| 1646 | # "arguments": { "node": "ide-hd0", |
| 1647 | # "overlay": "node1534" } } |
| 1648 | # <- { "return": {} } |
| 1649 | # |
Alberto Garcia | 43de7e2 | 2015-10-26 14:27:16 +0200 | [diff] [blame] | 1650 | ## |
| 1651 | { 'command': 'blockdev-snapshot', |
Peter Krempa | c6bdc31 | 2020-03-10 12:38:31 +0100 | [diff] [blame] | 1652 | 'data': 'BlockdevSnapshot', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 1653 | 'features': [ 'allow-write-only-overlay' ], |
| 1654 | 'allow-preconfig': true } |
Alberto Garcia | 43de7e2 | 2015-10-26 14:27:16 +0200 | [diff] [blame] | 1655 | |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1656 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1657 | # @change-backing-file: |
Jeff Cody | fa40e65 | 2014-07-01 09:52:16 +0200 | [diff] [blame] | 1658 | # |
| 1659 | # Change the backing file in the image file metadata. This does not |
| 1660 | # cause QEMU to reopen the image file to reparse the backing filename |
| 1661 | # (it may, however, perform a reopen to change permissions from |
| 1662 | # r/o -> r/w -> r/o, if needed). The new backing file string is written |
| 1663 | # into the image file metadata, and the QEMU internal strings are |
| 1664 | # updated. |
| 1665 | # |
| 1666 | # @image-node-name: The name of the block driver state node of the |
Marc-André Lureau | 280c4b3 | 2016-06-23 14:09:20 +0200 | [diff] [blame] | 1667 | # image to modify. The "device" argument is used |
| 1668 | # to verify "image-node-name" is in the chain |
| 1669 | # described by "device". |
Jeff Cody | fa40e65 | 2014-07-01 09:52:16 +0200 | [diff] [blame] | 1670 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 1671 | # @device: The device name or node-name of the root node that owns |
| 1672 | # image-node-name. |
Jeff Cody | fa40e65 | 2014-07-01 09:52:16 +0200 | [diff] [blame] | 1673 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 1674 | # @backing-file: The string to write as the backing file. This |
| 1675 | # string is not validated, so care should be taken |
| 1676 | # when specifying the string or the image chain may |
| 1677 | # not be able to be reopened again. |
Jeff Cody | fa40e65 | 2014-07-01 09:52:16 +0200 | [diff] [blame] | 1678 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 1679 | # Returns: - Nothing on success |
| 1680 | # - If "device" does not exist or cannot be determined, DeviceNotFound |
Marc-André Lureau | 280c4b3 | 2016-06-23 14:09:20 +0200 | [diff] [blame] | 1681 | # |
Jeff Cody | fa40e65 | 2014-07-01 09:52:16 +0200 | [diff] [blame] | 1682 | # Since: 2.1 |
| 1683 | ## |
| 1684 | { 'command': 'change-backing-file', |
| 1685 | 'data': { 'device': 'str', 'image-node-name': 'str', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 1686 | 'backing-file': 'str' }, |
| 1687 | 'allow-preconfig': true } |
Jeff Cody | fa40e65 | 2014-07-01 09:52:16 +0200 | [diff] [blame] | 1688 | |
| 1689 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1690 | # @block-commit: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1691 | # |
| 1692 | # Live commit of data from overlay image nodes into backing nodes - i.e., |
| 1693 | # writes data between 'top' and 'base' into 'base'. |
| 1694 | # |
Max Reitz | 05ea385 | 2019-06-11 21:19:26 +0200 | [diff] [blame] | 1695 | # If top == base, that is an error. |
| 1696 | # If top has no overlays on top of it, or if it is in use by a writer, |
| 1697 | # the job will not be completed by itself. The user needs to complete |
| 1698 | # the job with the block-job-complete command after getting the ready |
| 1699 | # event. (Since 2.0) |
| 1700 | # |
| 1701 | # If the base image is smaller than top, then the base image will be |
| 1702 | # resized to be the same size as top. If top is smaller than the base |
| 1703 | # image, the base will not be truncated. If you want the base image |
| 1704 | # size to match the size of the smaller top, you can safely truncate |
| 1705 | # it yourself once the commit operation successfully completes. |
| 1706 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1707 | # @job-id: identifier for the newly-created block job. If |
Alberto Garcia | fd62c60 | 2016-07-05 17:29:00 +0300 | [diff] [blame] | 1708 | # omitted, the device name will be used. (Since 2.7) |
| 1709 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 1710 | # @device: the device name or node-name of a root node |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1711 | # |
Kevin Wolf | 3c605f4 | 2017-06-27 17:18:20 +0200 | [diff] [blame] | 1712 | # @base-node: The node name of the backing image to write data into. |
| 1713 | # If not specified, this is the deepest backing image. |
| 1714 | # (since: 3.1) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1715 | # |
Kevin Wolf | 3c605f4 | 2017-06-27 17:18:20 +0200 | [diff] [blame] | 1716 | # @base: Same as @base-node, except that it is a file name rather than a node |
| 1717 | # name. This must be the exact filename string that was used to open the |
| 1718 | # node; other strings, even if addressing the same file, are not |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 1719 | # accepted |
Kevin Wolf | 3c605f4 | 2017-06-27 17:18:20 +0200 | [diff] [blame] | 1720 | # |
| 1721 | # @top-node: The node name of the backing image within the image chain |
| 1722 | # which contains the topmost data to be committed down. If |
| 1723 | # not specified, this is the active layer. (since: 3.1) |
| 1724 | # |
| 1725 | # @top: Same as @top-node, except that it is a file name rather than a node |
| 1726 | # name. This must be the exact filename string that was used to open the |
| 1727 | # node; other strings, even if addressing the same file, are not |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 1728 | # accepted |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1729 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 1730 | # @backing-file: The backing file string to write into the overlay |
Max Reitz | 05ea385 | 2019-06-11 21:19:26 +0200 | [diff] [blame] | 1731 | # image of 'top'. If 'top' does not have an overlay |
| 1732 | # image, or if 'top' is in use by a writer, specifying |
| 1733 | # a backing file string is an error. |
Jeff Cody | 54e2690 | 2014-06-25 15:40:10 -0400 | [diff] [blame] | 1734 | # |
Max Reitz | 05ea385 | 2019-06-11 21:19:26 +0200 | [diff] [blame] | 1735 | # This filename is not validated. If a pathname string |
| 1736 | # is such that it cannot be resolved by QEMU, that |
| 1737 | # means that subsequent QMP or HMP commands must use |
| 1738 | # node-names for the image in question, as filename |
| 1739 | # lookup methods will fail. |
Jeff Cody | 54e2690 | 2014-06-25 15:40:10 -0400 | [diff] [blame] | 1740 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 1741 | # If not specified, QEMU will automatically determine |
| 1742 | # the backing file string to use, or error out if |
| 1743 | # there is no obvious choice. Care should be taken |
| 1744 | # when specifying the string, to specify a valid |
| 1745 | # filename or protocol. |
| 1746 | # (Since 2.1) |
Jeff Cody | 54e2690 | 2014-06-25 15:40:10 -0400 | [diff] [blame] | 1747 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 1748 | # @speed: the maximum speed, in bytes per second |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1749 | # |
Kevin Wolf | 8faad1c | 2020-02-14 21:08:11 +0100 | [diff] [blame] | 1750 | # @on-error: the action to take on an error. 'ignore' means that the request |
| 1751 | # should be retried. (default: report; Since: 5.0) |
| 1752 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 1753 | # @filter-node-name: the node name that should be assigned to the |
Kevin Wolf | 0db832f | 2017-02-20 18:10:05 +0100 | [diff] [blame] | 1754 | # filter driver that the commit job inserts into the graph |
| 1755 | # above @top. If this option is not given, a node name is |
| 1756 | # autogenerated. (Since: 2.9) |
| 1757 | # |
John Snow | 96fbf53 | 2018-09-06 09:02:21 -0400 | [diff] [blame] | 1758 | # @auto-finalize: When false, this job will wait in a PENDING state after it has |
| 1759 | # finished its work, waiting for @block-job-finalize before |
| 1760 | # making any block graph changes. |
| 1761 | # When true, this job will automatically |
| 1762 | # perform its abort or commit actions. |
| 1763 | # Defaults to true. (Since 3.1) |
| 1764 | # |
| 1765 | # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it |
| 1766 | # has completely ceased all work, and awaits @block-job-dismiss. |
| 1767 | # When true, this job will automatically disappear from the query |
| 1768 | # list without user intervention. |
| 1769 | # Defaults to true. (Since 3.1) |
| 1770 | # |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 1771 | # Features: |
| 1772 | # @deprecated: Members @base and @top are deprecated. Use @base-node |
Peter Maydell | b2f1c13 | 2020-08-10 20:50:01 +0100 | [diff] [blame] | 1773 | # and @top-node instead. |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 1774 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 1775 | # Returns: - Nothing on success |
| 1776 | # - If @device does not exist, DeviceNotFound |
| 1777 | # - Any other error returns a GenericError. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1778 | # |
| 1779 | # Since: 1.3 |
| 1780 | # |
Marc-André Lureau | f44fb58 | 2016-06-23 14:10:29 +0200 | [diff] [blame] | 1781 | # Example: |
| 1782 | # |
| 1783 | # -> { "execute": "block-commit", |
| 1784 | # "arguments": { "device": "virtio0", |
| 1785 | # "top": "/tmp/snap1.qcow2" } } |
| 1786 | # <- { "return": {} } |
| 1787 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1788 | ## |
| 1789 | { 'command': 'block-commit', |
Kevin Wolf | 3c605f4 | 2017-06-27 17:18:20 +0200 | [diff] [blame] | 1790 | 'data': { '*job-id': 'str', 'device': 'str', '*base-node': 'str', |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 1791 | '*base': { 'type': 'str', 'features': [ 'deprecated' ] }, |
| 1792 | '*top-node': 'str', |
| 1793 | '*top': { 'type': 'str', 'features': [ 'deprecated' ] }, |
Kevin Wolf | 0db832f | 2017-02-20 18:10:05 +0100 | [diff] [blame] | 1794 | '*backing-file': 'str', '*speed': 'int', |
Kevin Wolf | 8faad1c | 2020-02-14 21:08:11 +0100 | [diff] [blame] | 1795 | '*on-error': 'BlockdevOnError', |
John Snow | 96fbf53 | 2018-09-06 09:02:21 -0400 | [diff] [blame] | 1796 | '*filter-node-name': 'str', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 1797 | '*auto-finalize': 'bool', '*auto-dismiss': 'bool' }, |
| 1798 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1799 | |
| 1800 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1801 | # @drive-backup: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1802 | # |
| 1803 | # Start a point-in-time copy of a block device to a new destination. The |
| 1804 | # status of ongoing drive-backup operations can be checked with |
| 1805 | # query-block-jobs where the BlockJobInfo.type field has the value 'backup'. |
| 1806 | # The operation can be stopped before it has completed using the |
| 1807 | # block-job-cancel command. |
| 1808 | # |
Vladimir Sementsov-Ogievskiy | 1084159 | 2021-11-04 09:58:11 +0100 | [diff] [blame] | 1809 | # Features: |
| 1810 | # @deprecated: This command is deprecated. Use @blockdev-backup instead. |
| 1811 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 1812 | # Returns: - nothing on success |
| 1813 | # - If @device is not a valid block device, GenericError |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1814 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1815 | # Since: 1.6 |
Marc-André Lureau | b033641 | 2016-06-23 14:11:47 +0200 | [diff] [blame] | 1816 | # |
| 1817 | # Example: |
| 1818 | # |
| 1819 | # -> { "execute": "drive-backup", |
| 1820 | # "arguments": { "device": "drive0", |
| 1821 | # "sync": "full", |
| 1822 | # "target": "backup.img" } } |
| 1823 | # <- { "return": {} } |
| 1824 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1825 | ## |
Pavel Butsykin | 81206a8 | 2016-07-22 11:17:50 +0300 | [diff] [blame] | 1826 | { 'command': 'drive-backup', 'boxed': true, |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 1827 | 'data': 'DriveBackup', 'features': ['deprecated'], |
| 1828 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1829 | |
| 1830 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1831 | # @blockdev-backup: |
Fam Zheng | c29c1dd | 2014-12-18 18:37:05 +0800 | [diff] [blame] | 1832 | # |
| 1833 | # Start a point-in-time copy of a block device to a new destination. The |
| 1834 | # status of ongoing blockdev-backup operations can be checked with |
| 1835 | # query-block-jobs where the BlockJobInfo.type field has the value 'backup'. |
| 1836 | # The operation can be stopped before it has completed using the |
| 1837 | # block-job-cancel command. |
| 1838 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 1839 | # Returns: - nothing on success |
| 1840 | # - If @device is not a valid block device, DeviceNotFound |
Pavel Butsykin | dc7a4a9 | 2016-07-22 11:17:51 +0300 | [diff] [blame] | 1841 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1842 | # Since: 2.3 |
Marc-André Lureau | 1cf7511 | 2016-06-23 14:13:07 +0200 | [diff] [blame] | 1843 | # |
| 1844 | # Example: |
Andrea Bolognani | 4ae65a5 | 2022-05-03 09:37:32 +0200 | [diff] [blame] | 1845 | # |
Marc-André Lureau | 1cf7511 | 2016-06-23 14:13:07 +0200 | [diff] [blame] | 1846 | # -> { "execute": "blockdev-backup", |
| 1847 | # "arguments": { "device": "src-id", |
| 1848 | # "sync": "full", |
| 1849 | # "target": "tgt-id" } } |
| 1850 | # <- { "return": {} } |
| 1851 | # |
Fam Zheng | c29c1dd | 2014-12-18 18:37:05 +0800 | [diff] [blame] | 1852 | ## |
Pavel Butsykin | dc7a4a9 | 2016-07-22 11:17:51 +0300 | [diff] [blame] | 1853 | { 'command': 'blockdev-backup', 'boxed': true, |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 1854 | 'data': 'BlockdevBackup', |
| 1855 | 'allow-preconfig': true } |
Fam Zheng | c29c1dd | 2014-12-18 18:37:05 +0800 | [diff] [blame] | 1856 | |
Fam Zheng | c29c1dd | 2014-12-18 18:37:05 +0800 | [diff] [blame] | 1857 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1858 | # @query-named-block-nodes: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1859 | # |
| 1860 | # Get the named block driver list |
| 1861 | # |
Peter Krempa | facda54 | 2020-01-20 09:50:49 +0100 | [diff] [blame] | 1862 | # @flat: Omit the nested data about backing image ("backing-image" key) if true. |
| 1863 | # Default is false (Since 5.0) |
| 1864 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1865 | # Returns: the list of BlockDeviceInfo |
| 1866 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 1867 | # Since: 2.0 |
Marc-André Lureau | e1f34cb | 2016-06-23 14:13:48 +0200 | [diff] [blame] | 1868 | # |
| 1869 | # Example: |
| 1870 | # |
| 1871 | # -> { "execute": "query-named-block-nodes" } |
| 1872 | # <- { "return": [ { "ro":false, |
| 1873 | # "drv":"qcow2", |
| 1874 | # "encrypted":false, |
| 1875 | # "file":"disks/test.qcow2", |
| 1876 | # "node-name": "my-node", |
| 1877 | # "backing_file_depth":1, |
Victor Toso | 016b835 | 2022-03-31 21:06:27 +0200 | [diff] [blame] | 1878 | # "detect_zeroes":"off", |
Marc-André Lureau | e1f34cb | 2016-06-23 14:13:48 +0200 | [diff] [blame] | 1879 | # "bps":1000000, |
| 1880 | # "bps_rd":0, |
| 1881 | # "bps_wr":0, |
| 1882 | # "iops":1000000, |
| 1883 | # "iops_rd":0, |
| 1884 | # "iops_wr":0, |
| 1885 | # "bps_max": 8000000, |
| 1886 | # "bps_rd_max": 0, |
| 1887 | # "bps_wr_max": 0, |
| 1888 | # "iops_max": 0, |
| 1889 | # "iops_rd_max": 0, |
| 1890 | # "iops_wr_max": 0, |
| 1891 | # "iops_size": 0, |
| 1892 | # "write_threshold": 0, |
| 1893 | # "image":{ |
| 1894 | # "filename":"disks/test.qcow2", |
| 1895 | # "format":"qcow2", |
| 1896 | # "virtual-size":2048000, |
| 1897 | # "backing_file":"base.qcow2", |
| 1898 | # "full-backing-filename":"disks/base.qcow2", |
| 1899 | # "backing-filename-format":"qcow2", |
| 1900 | # "snapshots":[ |
| 1901 | # { |
| 1902 | # "id": "1", |
| 1903 | # "name": "snapshot1", |
| 1904 | # "vm-state-size": 0, |
| 1905 | # "date-sec": 10000200, |
| 1906 | # "date-nsec": 12, |
| 1907 | # "vm-clock-sec": 206, |
| 1908 | # "vm-clock-nsec": 30 |
| 1909 | # } |
| 1910 | # ], |
| 1911 | # "backing-image":{ |
| 1912 | # "filename":"disks/base.qcow2", |
| 1913 | # "format":"qcow2", |
| 1914 | # "virtual-size":2048000 |
| 1915 | # } |
| 1916 | # } } ] } |
| 1917 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1918 | ## |
Peter Krempa | facda54 | 2020-01-20 09:50:49 +0100 | [diff] [blame] | 1919 | { 'command': 'query-named-block-nodes', |
| 1920 | 'returns': [ 'BlockDeviceInfo' ], |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 1921 | 'data': { '*flat': 'bool' }, |
| 1922 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 1923 | |
| 1924 | ## |
Vladimir Sementsov-Ogievskiy | 5d3b4e9 | 2018-12-21 20:09:07 +0300 | [diff] [blame] | 1925 | # @XDbgBlockGraphNodeType: |
| 1926 | # |
| 1927 | # @block-backend: corresponds to BlockBackend |
| 1928 | # |
zhaolichang | 2400e50 | 2020-09-17 15:50:28 +0800 | [diff] [blame] | 1929 | # @block-job: corresponds to BlockJob |
Vladimir Sementsov-Ogievskiy | 5d3b4e9 | 2018-12-21 20:09:07 +0300 | [diff] [blame] | 1930 | # |
| 1931 | # @block-driver: corresponds to BlockDriverState |
| 1932 | # |
| 1933 | # Since: 4.0 |
| 1934 | ## |
| 1935 | { 'enum': 'XDbgBlockGraphNodeType', |
| 1936 | 'data': [ 'block-backend', 'block-job', 'block-driver' ] } |
| 1937 | |
| 1938 | ## |
| 1939 | # @XDbgBlockGraphNode: |
| 1940 | # |
| 1941 | # @id: Block graph node identifier. This @id is generated only for |
| 1942 | # x-debug-query-block-graph and does not relate to any other identifiers in |
| 1943 | # Qemu. |
| 1944 | # |
| 1945 | # @type: Type of graph node. Can be one of block-backend, block-job or |
| 1946 | # block-driver-state. |
| 1947 | # |
| 1948 | # @name: Human readable name of the node. Corresponds to node-name for |
| 1949 | # block-driver-state nodes; is not guaranteed to be unique in the whole |
| 1950 | # graph (with block-jobs and block-backends). |
| 1951 | # |
| 1952 | # Since: 4.0 |
| 1953 | ## |
| 1954 | { 'struct': 'XDbgBlockGraphNode', |
| 1955 | 'data': { 'id': 'uint64', 'type': 'XDbgBlockGraphNodeType', 'name': 'str' } } |
| 1956 | |
| 1957 | ## |
| 1958 | # @BlockPermission: |
| 1959 | # |
| 1960 | # Enum of base block permissions. |
| 1961 | # |
| 1962 | # @consistent-read: A user that has the "permission" of consistent reads is |
| 1963 | # guaranteed that their view of the contents of the block |
| 1964 | # device is complete and self-consistent, representing the |
| 1965 | # contents of a disk at a specific point. |
| 1966 | # For most block devices (including their backing files) this |
| 1967 | # is true, but the property cannot be maintained in a few |
| 1968 | # situations like for intermediate nodes of a commit block |
| 1969 | # job. |
| 1970 | # |
| 1971 | # @write: This permission is required to change the visible disk contents. |
| 1972 | # |
| 1973 | # @write-unchanged: This permission (which is weaker than BLK_PERM_WRITE) is |
| 1974 | # both enough and required for writes to the block node when |
| 1975 | # the caller promises that the visible disk content doesn't |
| 1976 | # change. |
| 1977 | # As the BLK_PERM_WRITE permission is strictly stronger, |
| 1978 | # either is sufficient to perform an unchanging write. |
| 1979 | # |
| 1980 | # @resize: This permission is required to change the size of a block node. |
| 1981 | # |
Vladimir Sementsov-Ogievskiy | 5d3b4e9 | 2018-12-21 20:09:07 +0300 | [diff] [blame] | 1982 | # Since: 4.0 |
| 1983 | ## |
Markus Armbruster | fbeed19 | 2020-07-30 11:16:56 +0200 | [diff] [blame] | 1984 | { 'enum': 'BlockPermission', |
Vladimir Sementsov-Ogievskiy | 64631f3 | 2021-09-02 12:37:54 +0300 | [diff] [blame] | 1985 | 'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize' ] } |
| 1986 | |
Vladimir Sementsov-Ogievskiy | 5d3b4e9 | 2018-12-21 20:09:07 +0300 | [diff] [blame] | 1987 | ## |
| 1988 | # @XDbgBlockGraphEdge: |
| 1989 | # |
| 1990 | # Block Graph edge description for x-debug-query-block-graph. |
| 1991 | # |
| 1992 | # @parent: parent id |
| 1993 | # |
| 1994 | # @child: child id |
| 1995 | # |
| 1996 | # @name: name of the relation (examples are 'file' and 'backing') |
| 1997 | # |
| 1998 | # @perm: granted permissions for the parent operating on the child |
| 1999 | # |
| 2000 | # @shared-perm: permissions that can still be granted to other users of the |
| 2001 | # child while it is still attached to this parent |
| 2002 | # |
| 2003 | # Since: 4.0 |
| 2004 | ## |
| 2005 | { 'struct': 'XDbgBlockGraphEdge', |
| 2006 | 'data': { 'parent': 'uint64', 'child': 'uint64', |
| 2007 | 'name': 'str', 'perm': [ 'BlockPermission' ], |
| 2008 | 'shared-perm': [ 'BlockPermission' ] } } |
| 2009 | |
| 2010 | ## |
| 2011 | # @XDbgBlockGraph: |
| 2012 | # |
| 2013 | # Block Graph - list of nodes and list of edges. |
| 2014 | # |
| 2015 | # Since: 4.0 |
| 2016 | ## |
| 2017 | { 'struct': 'XDbgBlockGraph', |
| 2018 | 'data': { 'nodes': ['XDbgBlockGraphNode'], 'edges': ['XDbgBlockGraphEdge'] } } |
| 2019 | |
| 2020 | ## |
| 2021 | # @x-debug-query-block-graph: |
| 2022 | # |
| 2023 | # Get the block graph. |
| 2024 | # |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 2025 | # Features: |
| 2026 | # @unstable: This command is meant for debugging. |
| 2027 | # |
Vladimir Sementsov-Ogievskiy | 5d3b4e9 | 2018-12-21 20:09:07 +0300 | [diff] [blame] | 2028 | # Since: 4.0 |
| 2029 | ## |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 2030 | { 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2031 | 'features': [ 'unstable' ], |
| 2032 | 'allow-preconfig': true } |
Vladimir Sementsov-Ogievskiy | 5d3b4e9 | 2018-12-21 20:09:07 +0300 | [diff] [blame] | 2033 | |
| 2034 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2035 | # @drive-mirror: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2036 | # |
Marc-André Lureau | 12a21b7 | 2016-06-23 14:17:31 +0200 | [diff] [blame] | 2037 | # Start mirroring a block device's writes to a new destination. target |
| 2038 | # specifies the target of the new image. If the file exists, or if it |
| 2039 | # is a device, it will be used as the new destination for writes. If |
| 2040 | # it does not exist, a new file will be created. format specifies the |
| 2041 | # format of the mirror image, default is to probe if mode='existing', |
| 2042 | # else the format of the source. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2043 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2044 | # Returns: - nothing on success |
| 2045 | # - If @device is not a valid block device, GenericError |
Eric Blake | faecd40 | 2016-07-14 16:37:58 -0600 | [diff] [blame] | 2046 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2047 | # Since: 1.3 |
Marc-André Lureau | 12a21b7 | 2016-06-23 14:17:31 +0200 | [diff] [blame] | 2048 | # |
| 2049 | # Example: |
| 2050 | # |
| 2051 | # -> { "execute": "drive-mirror", |
| 2052 | # "arguments": { "device": "ide-hd0", |
| 2053 | # "target": "/some/place/my-image", |
| 2054 | # "sync": "full", |
| 2055 | # "format": "qcow2" } } |
| 2056 | # <- { "return": {} } |
| 2057 | # |
Eric Blake | faecd40 | 2016-07-14 16:37:58 -0600 | [diff] [blame] | 2058 | ## |
| 2059 | { 'command': 'drive-mirror', 'boxed': true, |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2060 | 'data': 'DriveMirror', |
| 2061 | 'allow-preconfig': true } |
Eric Blake | faecd40 | 2016-07-14 16:37:58 -0600 | [diff] [blame] | 2062 | |
| 2063 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2064 | # @DriveMirror: |
Eric Blake | faecd40 | 2016-07-14 16:37:58 -0600 | [diff] [blame] | 2065 | # |
| 2066 | # A set of parameters describing drive mirror setup. |
| 2067 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2068 | # @job-id: identifier for the newly-created block job. If |
Alberto Garcia | 71aa986 | 2016-07-05 17:28:57 +0300 | [diff] [blame] | 2069 | # omitted, the device name will be used. (Since 2.7) |
| 2070 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 2071 | # @device: the device name or node-name of a root node whose writes should be |
| 2072 | # mirrored. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2073 | # |
| 2074 | # @target: the target of the new image. If the file exists, or if it |
| 2075 | # is a device, the existing file/device will be used as the new |
| 2076 | # destination. If it does not exist, a new file will be created. |
| 2077 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2078 | # @format: the format of the new destination, default is to |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2079 | # probe if @mode is 'existing', else the format of the source |
| 2080 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2081 | # @node-name: the new block driver state node name in the graph |
Benoît Canet | 4c828dc | 2014-06-16 12:00:55 +0200 | [diff] [blame] | 2082 | # (Since 2.1) |
| 2083 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2084 | # @replaces: with sync=full graph node name to be replaced by the new |
Benoît Canet | 09158f0 | 2014-06-27 18:25:25 +0200 | [diff] [blame] | 2085 | # image when a whole image copy is done. This can be used to repair |
Max Reitz | 3f072a7 | 2019-06-12 16:27:32 +0200 | [diff] [blame] | 2086 | # broken Quorum files. By default, @device is replaced, although |
| 2087 | # implicitly created filters on it are kept. (Since 2.1) |
Benoît Canet | 09158f0 | 2014-06-27 18:25:25 +0200 | [diff] [blame] | 2088 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2089 | # @mode: whether and how QEMU should create a new image, default is |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2090 | # 'absolute-paths'. |
| 2091 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 2092 | # @speed: the maximum speed, in bytes per second |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2093 | # |
| 2094 | # @sync: what parts of the disk image should be copied to the destination |
| 2095 | # (all the disk, only the sectors allocated in the topmost image, or |
| 2096 | # only new I/O). |
| 2097 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2098 | # @granularity: granularity of the dirty bitmap, default is 64K |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2099 | # if the image format doesn't have clusters, 4K if the clusters |
| 2100 | # are smaller than that, else the cluster size. Must be a |
| 2101 | # power of 2 between 512 and 64M (since 1.4). |
| 2102 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2103 | # @buf-size: maximum amount of data in flight from source to |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2104 | # target (since 1.4). |
| 2105 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2106 | # @on-source-error: the action to take on an error on the source, |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2107 | # default 'report'. 'stop' and 'enospc' can only be used |
| 2108 | # if the block device supports io-status (see BlockInfo). |
| 2109 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2110 | # @on-target-error: the action to take on an error on the target, |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2111 | # default 'report' (no limitations, since this applies to |
| 2112 | # a different block device than @device). |
Andrea Bolognani | 4ae65a5 | 2022-05-03 09:37:32 +0200 | [diff] [blame] | 2113 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2114 | # @unmap: Whether to try to unmap target sectors where source has |
Fam Zheng | 0fc9f8e | 2015-06-08 13:56:08 +0800 | [diff] [blame] | 2115 | # only zero. If true, and target unallocated sectors will read as zero, |
| 2116 | # target image sectors will be unmapped; otherwise, zeroes will be |
| 2117 | # written. Both will result in identical contents. |
| 2118 | # Default is true. (Since 2.4) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2119 | # |
Max Reitz | 481deba | 2018-06-13 20:18:22 +0200 | [diff] [blame] | 2120 | # @copy-mode: when to copy data to the destination; defaults to 'background' |
| 2121 | # (Since: 3.0) |
| 2122 | # |
John Snow | a6b58ad | 2018-09-06 09:02:22 -0400 | [diff] [blame] | 2123 | # @auto-finalize: When false, this job will wait in a PENDING state after it has |
| 2124 | # finished its work, waiting for @block-job-finalize before |
| 2125 | # making any block graph changes. |
| 2126 | # When true, this job will automatically |
| 2127 | # perform its abort or commit actions. |
| 2128 | # Defaults to true. (Since 3.1) |
| 2129 | # |
| 2130 | # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it |
| 2131 | # has completely ceased all work, and awaits @block-job-dismiss. |
| 2132 | # When true, this job will automatically disappear from the query |
| 2133 | # list without user intervention. |
| 2134 | # Defaults to true. (Since 3.1) |
Andrea Bolognani | 4ae65a5 | 2022-05-03 09:37:32 +0200 | [diff] [blame] | 2135 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2136 | # Since: 1.3 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2137 | ## |
Eric Blake | faecd40 | 2016-07-14 16:37:58 -0600 | [diff] [blame] | 2138 | { 'struct': 'DriveMirror', |
Alberto Garcia | 71aa986 | 2016-07-05 17:28:57 +0300 | [diff] [blame] | 2139 | 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str', |
| 2140 | '*format': 'str', '*node-name': 'str', '*replaces': 'str', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2141 | 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode', |
| 2142 | '*speed': 'int', '*granularity': 'uint32', |
| 2143 | '*buf-size': 'int', '*on-source-error': 'BlockdevOnError', |
Fam Zheng | 0fc9f8e | 2015-06-08 13:56:08 +0800 | [diff] [blame] | 2144 | '*on-target-error': 'BlockdevOnError', |
John Snow | a6b58ad | 2018-09-06 09:02:22 -0400 | [diff] [blame] | 2145 | '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode', |
| 2146 | '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2147 | |
| 2148 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2149 | # @BlockDirtyBitmap: |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2150 | # |
| 2151 | # @node: name of device/node which the bitmap is tracking |
| 2152 | # |
| 2153 | # @name: name of the dirty bitmap |
| 2154 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2155 | # Since: 2.4 |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2156 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 2157 | { 'struct': 'BlockDirtyBitmap', |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2158 | 'data': { 'node': 'str', 'name': 'str' } } |
| 2159 | |
| 2160 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2161 | # @BlockDirtyBitmapAdd: |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2162 | # |
| 2163 | # @node: name of device/node which the bitmap is tracking |
| 2164 | # |
Eric Blake | cf7c49c | 2019-11-13 20:46:33 -0600 | [diff] [blame] | 2165 | # @name: name of the dirty bitmap (must be less than 1024 bytes) |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2166 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2167 | # @granularity: the bitmap granularity, default is 64k for |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2168 | # block-dirty-bitmap-add |
| 2169 | # |
Vladimir Sementsov-Ogievskiy | fd5ae4c | 2017-06-28 15:05:23 +0300 | [diff] [blame] | 2170 | # @persistent: the bitmap is persistent, i.e. it will be saved to the |
| 2171 | # corresponding block device image file on its close. For now only |
| 2172 | # Qcow2 disks support persistent bitmaps. Default is false for |
| 2173 | # block-dirty-bitmap-add. (Since: 2.10) |
| 2174 | # |
John Snow | 0e2b7f0 | 2018-12-21 04:35:22 -0500 | [diff] [blame] | 2175 | # @disabled: the bitmap is created in the disabled state, which means that |
| 2176 | # it will not track drive changes. The bitmap may be enabled with |
| 2177 | # block-dirty-bitmap-enable. Default is false. (Since: 4.0) |
Vladimir Sementsov-Ogievskiy | a6e2ca5 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2178 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2179 | # Since: 2.4 |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2180 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 2181 | { 'struct': 'BlockDirtyBitmapAdd', |
Vladimir Sementsov-Ogievskiy | fd5ae4c | 2017-06-28 15:05:23 +0300 | [diff] [blame] | 2182 | 'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32', |
John Snow | 3264ffc | 2019-10-02 19:24:11 -0400 | [diff] [blame] | 2183 | '*persistent': 'bool', '*disabled': 'bool' } } |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2184 | |
| 2185 | ## |
Vladimir Sementsov-Ogievskiy | 1466ef6 | 2022-03-15 00:32:24 +0300 | [diff] [blame] | 2186 | # @BlockDirtyBitmapOrStr: |
Vladimir Sementsov-Ogievskiy | eff0829 | 2019-05-28 19:33:31 -0400 | [diff] [blame] | 2187 | # |
| 2188 | # @local: name of the bitmap, attached to the same node as target bitmap. |
| 2189 | # |
| 2190 | # @external: bitmap with specified node |
| 2191 | # |
| 2192 | # Since: 4.1 |
| 2193 | ## |
Vladimir Sementsov-Ogievskiy | 1466ef6 | 2022-03-15 00:32:24 +0300 | [diff] [blame] | 2194 | { 'alternate': 'BlockDirtyBitmapOrStr', |
Vladimir Sementsov-Ogievskiy | eff0829 | 2019-05-28 19:33:31 -0400 | [diff] [blame] | 2195 | 'data': { 'local': 'str', |
| 2196 | 'external': 'BlockDirtyBitmap' } } |
| 2197 | |
| 2198 | ## |
Vladimir Sementsov-Ogievskiy | b598e53 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2199 | # @BlockDirtyBitmapMerge: |
| 2200 | # |
Vladimir Sementsov-Ogievskiy | eff0829 | 2019-05-28 19:33:31 -0400 | [diff] [blame] | 2201 | # @node: name of device/node which the @target bitmap is tracking |
Vladimir Sementsov-Ogievskiy | b598e53 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2202 | # |
John Snow | 360d4e4 | 2018-12-21 04:35:21 -0500 | [diff] [blame] | 2203 | # @target: name of the destination dirty bitmap |
Vladimir Sementsov-Ogievskiy | b598e53 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2204 | # |
Vladimir Sementsov-Ogievskiy | eff0829 | 2019-05-28 19:33:31 -0400 | [diff] [blame] | 2205 | # @bitmaps: name(s) of the source dirty bitmap(s) at @node and/or fully |
zhaolichang | 2400e50 | 2020-09-17 15:50:28 +0800 | [diff] [blame] | 2206 | # specified BlockDirtyBitmap elements. The latter are supported |
Vladimir Sementsov-Ogievskiy | eff0829 | 2019-05-28 19:33:31 -0400 | [diff] [blame] | 2207 | # since 4.1. |
Vladimir Sementsov-Ogievskiy | b598e53 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2208 | # |
John Snow | 0e2b7f0 | 2018-12-21 04:35:22 -0500 | [diff] [blame] | 2209 | # Since: 4.0 |
Vladimir Sementsov-Ogievskiy | b598e53 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2210 | ## |
| 2211 | { 'struct': 'BlockDirtyBitmapMerge', |
Vladimir Sementsov-Ogievskiy | eff0829 | 2019-05-28 19:33:31 -0400 | [diff] [blame] | 2212 | 'data': { 'node': 'str', 'target': 'str', |
Vladimir Sementsov-Ogievskiy | 1466ef6 | 2022-03-15 00:32:24 +0300 | [diff] [blame] | 2213 | 'bitmaps': ['BlockDirtyBitmapOrStr'] } } |
Vladimir Sementsov-Ogievskiy | b598e53 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2214 | |
| 2215 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2216 | # @block-dirty-bitmap-add: |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2217 | # |
Marc-André Lureau | 2258a5d | 2016-06-23 14:19:37 +0200 | [diff] [blame] | 2218 | # Create a dirty bitmap with a name on the node, and start tracking the writes. |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2219 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2220 | # Returns: - nothing on success |
| 2221 | # - If @node is not a valid block device or node, DeviceNotFound |
| 2222 | # - If @name is already taken, GenericError with an explanation |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2223 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2224 | # Since: 2.4 |
Marc-André Lureau | 2258a5d | 2016-06-23 14:19:37 +0200 | [diff] [blame] | 2225 | # |
| 2226 | # Example: |
| 2227 | # |
| 2228 | # -> { "execute": "block-dirty-bitmap-add", |
| 2229 | # "arguments": { "node": "drive0", "name": "bitmap0" } } |
| 2230 | # <- { "return": {} } |
| 2231 | # |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2232 | ## |
| 2233 | { 'command': 'block-dirty-bitmap-add', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2234 | 'data': 'BlockDirtyBitmapAdd', |
| 2235 | 'allow-preconfig': true } |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2236 | |
| 2237 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2238 | # @block-dirty-bitmap-remove: |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2239 | # |
Marc-André Lureau | 4bbca42 | 2016-06-23 14:23:39 +0200 | [diff] [blame] | 2240 | # Stop write tracking and remove the dirty bitmap that was created |
Vladimir Sementsov-Ogievskiy | 5c36c1a | 2017-06-28 15:05:29 +0300 | [diff] [blame] | 2241 | # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its |
| 2242 | # storage too. |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2243 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2244 | # Returns: - nothing on success |
| 2245 | # - If @node is not a valid block device or node, DeviceNotFound |
| 2246 | # - If @name is not found, GenericError with an explanation |
| 2247 | # - if @name is frozen by an operation, GenericError |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2248 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2249 | # Since: 2.4 |
Marc-André Lureau | 4bbca42 | 2016-06-23 14:23:39 +0200 | [diff] [blame] | 2250 | # |
| 2251 | # Example: |
| 2252 | # |
| 2253 | # -> { "execute": "block-dirty-bitmap-remove", |
| 2254 | # "arguments": { "node": "drive0", "name": "bitmap0" } } |
| 2255 | # <- { "return": {} } |
| 2256 | # |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2257 | ## |
| 2258 | { 'command': 'block-dirty-bitmap-remove', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2259 | 'data': 'BlockDirtyBitmap', |
| 2260 | 'allow-preconfig': true } |
John Snow | 341ebc2 | 2015-04-17 19:49:52 -0400 | [diff] [blame] | 2261 | |
| 2262 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2263 | # @block-dirty-bitmap-clear: |
John Snow | e74e6b7 | 2015-04-17 19:49:59 -0400 | [diff] [blame] | 2264 | # |
Marc-André Lureau | 73dffdc | 2016-06-23 14:25:54 +0200 | [diff] [blame] | 2265 | # Clear (reset) a dirty bitmap on the device, so that an incremental |
| 2266 | # backup from this point in time forward will only backup clusters |
| 2267 | # modified after this clear operation. |
John Snow | e74e6b7 | 2015-04-17 19:49:59 -0400 | [diff] [blame] | 2268 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2269 | # Returns: - nothing on success |
| 2270 | # - If @node is not a valid block device, DeviceNotFound |
| 2271 | # - If @name is not found, GenericError with an explanation |
John Snow | e74e6b7 | 2015-04-17 19:49:59 -0400 | [diff] [blame] | 2272 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2273 | # Since: 2.4 |
Marc-André Lureau | 73dffdc | 2016-06-23 14:25:54 +0200 | [diff] [blame] | 2274 | # |
| 2275 | # Example: |
| 2276 | # |
| 2277 | # -> { "execute": "block-dirty-bitmap-clear", |
| 2278 | # "arguments": { "node": "drive0", "name": "bitmap0" } } |
| 2279 | # <- { "return": {} } |
| 2280 | # |
John Snow | e74e6b7 | 2015-04-17 19:49:59 -0400 | [diff] [blame] | 2281 | ## |
| 2282 | { 'command': 'block-dirty-bitmap-clear', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2283 | 'data': 'BlockDirtyBitmap', |
| 2284 | 'allow-preconfig': true } |
John Snow | e74e6b7 | 2015-04-17 19:49:59 -0400 | [diff] [blame] | 2285 | |
| 2286 | ## |
John Snow | 0e2b7f0 | 2018-12-21 04:35:22 -0500 | [diff] [blame] | 2287 | # @block-dirty-bitmap-enable: |
Vladimir Sementsov-Ogievskiy | 5c5d2e5 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2288 | # |
| 2289 | # Enables a dirty bitmap so that it will begin tracking disk changes. |
| 2290 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2291 | # Returns: - nothing on success |
| 2292 | # - If @node is not a valid block device, DeviceNotFound |
| 2293 | # - If @name is not found, GenericError with an explanation |
Vladimir Sementsov-Ogievskiy | 5c5d2e5 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2294 | # |
John Snow | 0e2b7f0 | 2018-12-21 04:35:22 -0500 | [diff] [blame] | 2295 | # Since: 4.0 |
Vladimir Sementsov-Ogievskiy | 5c5d2e5 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2296 | # |
| 2297 | # Example: |
| 2298 | # |
John Snow | 0e2b7f0 | 2018-12-21 04:35:22 -0500 | [diff] [blame] | 2299 | # -> { "execute": "block-dirty-bitmap-enable", |
Vladimir Sementsov-Ogievskiy | 5c5d2e5 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2300 | # "arguments": { "node": "drive0", "name": "bitmap0" } } |
| 2301 | # <- { "return": {} } |
| 2302 | # |
| 2303 | ## |
Markus Armbruster | fbeed19 | 2020-07-30 11:16:56 +0200 | [diff] [blame] | 2304 | { 'command': 'block-dirty-bitmap-enable', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2305 | 'data': 'BlockDirtyBitmap', |
| 2306 | 'allow-preconfig': true } |
Vladimir Sementsov-Ogievskiy | 5c5d2e5 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2307 | |
| 2308 | ## |
John Snow | 0e2b7f0 | 2018-12-21 04:35:22 -0500 | [diff] [blame] | 2309 | # @block-dirty-bitmap-disable: |
Vladimir Sementsov-Ogievskiy | 5c5d2e5 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2310 | # |
| 2311 | # Disables a dirty bitmap so that it will stop tracking disk changes. |
| 2312 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2313 | # Returns: - nothing on success |
| 2314 | # - If @node is not a valid block device, DeviceNotFound |
| 2315 | # - If @name is not found, GenericError with an explanation |
Vladimir Sementsov-Ogievskiy | 5c5d2e5 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2316 | # |
John Snow | 0e2b7f0 | 2018-12-21 04:35:22 -0500 | [diff] [blame] | 2317 | # Since: 4.0 |
Vladimir Sementsov-Ogievskiy | 5c5d2e5 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2318 | # |
| 2319 | # Example: |
| 2320 | # |
John Snow | 0e2b7f0 | 2018-12-21 04:35:22 -0500 | [diff] [blame] | 2321 | # -> { "execute": "block-dirty-bitmap-disable", |
Vladimir Sementsov-Ogievskiy | 5c5d2e5 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2322 | # "arguments": { "node": "drive0", "name": "bitmap0" } } |
| 2323 | # <- { "return": {} } |
| 2324 | # |
| 2325 | ## |
Markus Armbruster | fbeed19 | 2020-07-30 11:16:56 +0200 | [diff] [blame] | 2326 | { 'command': 'block-dirty-bitmap-disable', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2327 | 'data': 'BlockDirtyBitmap', |
| 2328 | 'allow-preconfig': true } |
Vladimir Sementsov-Ogievskiy | 5c5d2e5 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2329 | |
| 2330 | ## |
John Snow | 0e2b7f0 | 2018-12-21 04:35:22 -0500 | [diff] [blame] | 2331 | # @block-dirty-bitmap-merge: |
Vladimir Sementsov-Ogievskiy | b598e53 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2332 | # |
John Snow | 360d4e4 | 2018-12-21 04:35:21 -0500 | [diff] [blame] | 2333 | # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap. |
John Snow | 73ab5d6 | 2019-02-19 17:49:43 -0500 | [diff] [blame] | 2334 | # Dirty bitmaps in @bitmaps will be unchanged, except if it also appears |
| 2335 | # as the @target bitmap. Any bits already set in @target will still be |
| 2336 | # set after the merge, i.e., this operation does not clear the target. |
John Snow | 360d4e4 | 2018-12-21 04:35:21 -0500 | [diff] [blame] | 2337 | # On error, @target is unchanged. |
Vladimir Sementsov-Ogievskiy | b598e53 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2338 | # |
John Snow | 73ab5d6 | 2019-02-19 17:49:43 -0500 | [diff] [blame] | 2339 | # The resulting bitmap will count as dirty any clusters that were dirty in any |
| 2340 | # of the source bitmaps. This can be used to achieve backup checkpoints, or in |
| 2341 | # simpler usages, to copy bitmaps. |
| 2342 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2343 | # Returns: - nothing on success |
| 2344 | # - If @node is not a valid block device, DeviceNotFound |
| 2345 | # - If any bitmap in @bitmaps or @target is not found, GenericError |
| 2346 | # - If any of the bitmaps have different sizes or granularities, |
| 2347 | # GenericError |
Vladimir Sementsov-Ogievskiy | b598e53 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2348 | # |
John Snow | 0e2b7f0 | 2018-12-21 04:35:22 -0500 | [diff] [blame] | 2349 | # Since: 4.0 |
Vladimir Sementsov-Ogievskiy | b598e53 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2350 | # |
| 2351 | # Example: |
| 2352 | # |
John Snow | 0e2b7f0 | 2018-12-21 04:35:22 -0500 | [diff] [blame] | 2353 | # -> { "execute": "block-dirty-bitmap-merge", |
John Snow | 360d4e4 | 2018-12-21 04:35:21 -0500 | [diff] [blame] | 2354 | # "arguments": { "node": "drive0", "target": "bitmap0", |
| 2355 | # "bitmaps": ["bitmap1"] } } |
Vladimir Sementsov-Ogievskiy | b598e53 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2356 | # <- { "return": {} } |
| 2357 | # |
| 2358 | ## |
Markus Armbruster | fbeed19 | 2020-07-30 11:16:56 +0200 | [diff] [blame] | 2359 | { 'command': 'block-dirty-bitmap-merge', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2360 | 'data': 'BlockDirtyBitmapMerge', |
| 2361 | 'allow-preconfig': true } |
Vladimir Sementsov-Ogievskiy | b598e53 | 2018-06-11 14:53:32 -0400 | [diff] [blame] | 2362 | |
| 2363 | ## |
Vladimir Sementsov-Ogievskiy | a3b5253 | 2017-06-28 15:05:25 +0300 | [diff] [blame] | 2364 | # @BlockDirtyBitmapSha256: |
| 2365 | # |
| 2366 | # SHA256 hash of dirty bitmap data |
| 2367 | # |
| 2368 | # @sha256: ASCII representation of SHA256 bitmap hash |
| 2369 | # |
| 2370 | # Since: 2.10 |
| 2371 | ## |
Markus Armbruster | fbeed19 | 2020-07-30 11:16:56 +0200 | [diff] [blame] | 2372 | { 'struct': 'BlockDirtyBitmapSha256', |
| 2373 | 'data': {'sha256': 'str'} } |
Vladimir Sementsov-Ogievskiy | a3b5253 | 2017-06-28 15:05:25 +0300 | [diff] [blame] | 2374 | |
| 2375 | ## |
| 2376 | # @x-debug-block-dirty-bitmap-sha256: |
| 2377 | # |
John Snow | 73ab5d6 | 2019-02-19 17:49:43 -0500 | [diff] [blame] | 2378 | # Get bitmap SHA256. |
Vladimir Sementsov-Ogievskiy | a3b5253 | 2017-06-28 15:05:25 +0300 | [diff] [blame] | 2379 | # |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 2380 | # Features: |
| 2381 | # @unstable: This command is meant for debugging. |
| 2382 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2383 | # Returns: - BlockDirtyBitmapSha256 on success |
| 2384 | # - If @node is not a valid block device, DeviceNotFound |
| 2385 | # - If @name is not found or if hashing has failed, GenericError with an |
| 2386 | # explanation |
Vladimir Sementsov-Ogievskiy | a3b5253 | 2017-06-28 15:05:25 +0300 | [diff] [blame] | 2387 | # |
| 2388 | # Since: 2.10 |
| 2389 | ## |
Markus Armbruster | fbeed19 | 2020-07-30 11:16:56 +0200 | [diff] [blame] | 2390 | { 'command': 'x-debug-block-dirty-bitmap-sha256', |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 2391 | 'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2392 | 'features': [ 'unstable' ], |
| 2393 | 'allow-preconfig': true } |
Vladimir Sementsov-Ogievskiy | a3b5253 | 2017-06-28 15:05:25 +0300 | [diff] [blame] | 2394 | |
| 2395 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2396 | # @blockdev-mirror: |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2397 | # |
| 2398 | # Start mirroring a block device's writes to a new destination. |
| 2399 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2400 | # @job-id: identifier for the newly-created block job. If |
Alberto Garcia | 71aa986 | 2016-07-05 17:28:57 +0300 | [diff] [blame] | 2401 | # omitted, the device name will be used. (Since 2.7) |
| 2402 | # |
Kevin Wolf | 07eec65 | 2016-06-23 14:20:24 +0200 | [diff] [blame] | 2403 | # @device: The device name or node-name of a root node whose writes should be |
| 2404 | # mirrored. |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2405 | # |
| 2406 | # @target: the id or node-name of the block device to mirror to. This mustn't be |
| 2407 | # attached to guest. |
| 2408 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2409 | # @replaces: with sync=full graph node name to be replaced by the new |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2410 | # image when a whole image copy is done. This can be used to repair |
Max Reitz | 3f072a7 | 2019-06-12 16:27:32 +0200 | [diff] [blame] | 2411 | # broken Quorum files. By default, @device is replaced, although |
| 2412 | # implicitly created filters on it are kept. |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2413 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 2414 | # @speed: the maximum speed, in bytes per second |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2415 | # |
| 2416 | # @sync: what parts of the disk image should be copied to the destination |
| 2417 | # (all the disk, only the sectors allocated in the topmost image, or |
| 2418 | # only new I/O). |
| 2419 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2420 | # @granularity: granularity of the dirty bitmap, default is 64K |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2421 | # if the image format doesn't have clusters, 4K if the clusters |
| 2422 | # are smaller than that, else the cluster size. Must be a |
| 2423 | # power of 2 between 512 and 64M |
| 2424 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2425 | # @buf-size: maximum amount of data in flight from source to |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2426 | # target |
| 2427 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2428 | # @on-source-error: the action to take on an error on the source, |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2429 | # default 'report'. 'stop' and 'enospc' can only be used |
| 2430 | # if the block device supports io-status (see BlockInfo). |
| 2431 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2432 | # @on-target-error: the action to take on an error on the target, |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2433 | # default 'report' (no limitations, since this applies to |
| 2434 | # a different block device than @device). |
| 2435 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2436 | # @filter-node-name: the node name that should be assigned to the |
Kevin Wolf | 6cdbceb | 2017-02-20 18:10:05 +0100 | [diff] [blame] | 2437 | # filter driver that the mirror job inserts into the graph |
| 2438 | # above @device. If this option is not given, a node name is |
| 2439 | # autogenerated. (Since: 2.9) |
| 2440 | # |
Max Reitz | 481deba | 2018-06-13 20:18:22 +0200 | [diff] [blame] | 2441 | # @copy-mode: when to copy data to the destination; defaults to 'background' |
| 2442 | # (Since: 3.0) |
| 2443 | # |
John Snow | a6b58ad | 2018-09-06 09:02:22 -0400 | [diff] [blame] | 2444 | # @auto-finalize: When false, this job will wait in a PENDING state after it has |
| 2445 | # finished its work, waiting for @block-job-finalize before |
| 2446 | # making any block graph changes. |
| 2447 | # When true, this job will automatically |
| 2448 | # perform its abort or commit actions. |
| 2449 | # Defaults to true. (Since 3.1) |
| 2450 | # |
| 2451 | # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it |
| 2452 | # has completely ceased all work, and awaits @block-job-dismiss. |
| 2453 | # When true, this job will automatically disappear from the query |
| 2454 | # list without user intervention. |
| 2455 | # Defaults to true. (Since 3.1) |
Andrea Bolognani | 4ae65a5 | 2022-05-03 09:37:32 +0200 | [diff] [blame] | 2456 | # |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2457 | # Returns: nothing on success. |
| 2458 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2459 | # Since: 2.6 |
Marc-André Lureau | f6235a2 | 2016-06-23 15:32:39 +0200 | [diff] [blame] | 2460 | # |
| 2461 | # Example: |
| 2462 | # |
| 2463 | # -> { "execute": "blockdev-mirror", |
| 2464 | # "arguments": { "device": "ide-hd0", |
| 2465 | # "target": "target0", |
| 2466 | # "sync": "full" } } |
| 2467 | # <- { "return": {} } |
| 2468 | # |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2469 | ## |
| 2470 | { 'command': 'blockdev-mirror', |
Alberto Garcia | 71aa986 | 2016-07-05 17:28:57 +0300 | [diff] [blame] | 2471 | 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str', |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2472 | '*replaces': 'str', |
| 2473 | 'sync': 'MirrorSyncMode', |
| 2474 | '*speed': 'int', '*granularity': 'uint32', |
| 2475 | '*buf-size': 'int', '*on-source-error': 'BlockdevOnError', |
Kevin Wolf | 6cdbceb | 2017-02-20 18:10:05 +0100 | [diff] [blame] | 2476 | '*on-target-error': 'BlockdevOnError', |
Max Reitz | 481deba | 2018-06-13 20:18:22 +0200 | [diff] [blame] | 2477 | '*filter-node-name': 'str', |
John Snow | a6b58ad | 2018-09-06 09:02:22 -0400 | [diff] [blame] | 2478 | '*copy-mode': 'MirrorCopyMode', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2479 | '*auto-finalize': 'bool', '*auto-dismiss': 'bool' }, |
| 2480 | 'allow-preconfig': true } |
Fam Zheng | df92562 | 2015-12-24 12:45:05 +0800 | [diff] [blame] | 2481 | |
| 2482 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2483 | # @BlockIOThrottle: |
Eric Blake | 4dc9397 | 2016-07-13 21:50:21 -0600 | [diff] [blame] | 2484 | # |
| 2485 | # A set of parameters describing block throttling. |
| 2486 | # |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 2487 | # @device: Block device name |
Kevin Wolf | 7a9877a | 2016-09-20 13:38:48 +0200 | [diff] [blame] | 2488 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2489 | # @id: The name or QOM path of the guest device (since: 2.8) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2490 | # |
| 2491 | # @bps: total throughput limit in bytes per second |
| 2492 | # |
| 2493 | # @bps_rd: read throughput limit in bytes per second |
| 2494 | # |
| 2495 | # @bps_wr: write throughput limit in bytes per second |
| 2496 | # |
| 2497 | # @iops: total I/O operations per second |
| 2498 | # |
Alberto Garcia | f5a845f | 2016-02-18 12:27:08 +0200 | [diff] [blame] | 2499 | # @iops_rd: read I/O operations per second |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2500 | # |
| 2501 | # @iops_wr: write I/O operations per second |
| 2502 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2503 | # @bps_max: total throughput limit during bursts, |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2504 | # in bytes (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2505 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2506 | # @bps_rd_max: read throughput limit during bursts, |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2507 | # in bytes (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2508 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2509 | # @bps_wr_max: write throughput limit during bursts, |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2510 | # in bytes (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2511 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2512 | # @iops_max: total I/O operations per second during bursts, |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2513 | # in bytes (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2514 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2515 | # @iops_rd_max: read I/O operations per second during bursts, |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2516 | # in bytes (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2517 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2518 | # @iops_wr_max: write I/O operations per second during bursts, |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2519 | # in bytes (Since 1.7) |
Alberto Garcia | dce1320 | 2016-02-18 12:27:03 +0200 | [diff] [blame] | 2520 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2521 | # @bps_max_length: maximum length of the @bps_max burst |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2522 | # period, in seconds. It must only |
| 2523 | # be set if @bps_max is set as well. |
| 2524 | # Defaults to 1. (Since 2.6) |
Alberto Garcia | dce1320 | 2016-02-18 12:27:03 +0200 | [diff] [blame] | 2525 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2526 | # @bps_rd_max_length: maximum length of the @bps_rd_max |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2527 | # burst period, in seconds. It must only |
| 2528 | # be set if @bps_rd_max is set as well. |
| 2529 | # Defaults to 1. (Since 2.6) |
Alberto Garcia | dce1320 | 2016-02-18 12:27:03 +0200 | [diff] [blame] | 2530 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2531 | # @bps_wr_max_length: maximum length of the @bps_wr_max |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2532 | # burst period, in seconds. It must only |
| 2533 | # be set if @bps_wr_max is set as well. |
| 2534 | # Defaults to 1. (Since 2.6) |
Alberto Garcia | dce1320 | 2016-02-18 12:27:03 +0200 | [diff] [blame] | 2535 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2536 | # @iops_max_length: maximum length of the @iops burst |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2537 | # period, in seconds. It must only |
| 2538 | # be set if @iops_max is set as well. |
| 2539 | # Defaults to 1. (Since 2.6) |
Alberto Garcia | dce1320 | 2016-02-18 12:27:03 +0200 | [diff] [blame] | 2540 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2541 | # @iops_rd_max_length: maximum length of the @iops_rd_max |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2542 | # burst period, in seconds. It must only |
| 2543 | # be set if @iops_rd_max is set as well. |
| 2544 | # Defaults to 1. (Since 2.6) |
Alberto Garcia | dce1320 | 2016-02-18 12:27:03 +0200 | [diff] [blame] | 2545 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2546 | # @iops_wr_max_length: maximum length of the @iops_wr_max |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2547 | # burst period, in seconds. It must only |
| 2548 | # be set if @iops_wr_max is set as well. |
| 2549 | # Defaults to 1. (Since 2.6) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2550 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2551 | # @iops_size: an I/O size in bytes (Since 1.7) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2552 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2553 | # @group: throttle group name (Since 2.4) |
Alberto Garcia | 76f4afb | 2015-06-08 18:17:44 +0200 | [diff] [blame] | 2554 | # |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 2555 | # Features: |
| 2556 | # @deprecated: Member @device is deprecated. Use @id instead. |
| 2557 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2558 | # Since: 1.1 |
| 2559 | ## |
Eric Blake | 4dc9397 | 2016-07-13 21:50:21 -0600 | [diff] [blame] | 2560 | { 'struct': 'BlockIOThrottle', |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 2561 | 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] }, |
| 2562 | '*id': 'str', 'bps': 'int', 'bps_rd': 'int', |
Kevin Wolf | 7a9877a | 2016-09-20 13:38:48 +0200 | [diff] [blame] | 2563 | 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2564 | '*bps_max': 'int', '*bps_rd_max': 'int', |
| 2565 | '*bps_wr_max': 'int', '*iops_max': 'int', |
| 2566 | '*iops_rd_max': 'int', '*iops_wr_max': 'int', |
Alberto Garcia | dce1320 | 2016-02-18 12:27:03 +0200 | [diff] [blame] | 2567 | '*bps_max_length': 'int', '*bps_rd_max_length': 'int', |
| 2568 | '*bps_wr_max_length': 'int', '*iops_max_length': 'int', |
| 2569 | '*iops_rd_max_length': 'int', '*iops_wr_max_length': 'int', |
Alberto Garcia | 76f4afb | 2015-06-08 18:17:44 +0200 | [diff] [blame] | 2570 | '*iops_size': 'int', '*group': 'str' } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2571 | |
| 2572 | ## |
Manos Pitsidianakis | 432d889 | 2017-08-25 16:20:26 +0300 | [diff] [blame] | 2573 | # @ThrottleLimits: |
| 2574 | # |
| 2575 | # Limit parameters for throttling. |
| 2576 | # Since some limit combinations are illegal, limits should always be set in one |
| 2577 | # transaction. All fields are optional. When setting limits, if a field is |
| 2578 | # missing the current value is not changed. |
| 2579 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2580 | # @iops-total: limit total I/O operations per second |
| 2581 | # @iops-total-max: I/O operations burst |
| 2582 | # @iops-total-max-length: length of the iops-total-max burst period, in seconds |
| 2583 | # It must only be set if @iops-total-max is set as well. |
| 2584 | # @iops-read: limit read operations per second |
| 2585 | # @iops-read-max: I/O operations read burst |
| 2586 | # @iops-read-max-length: length of the iops-read-max burst period, in seconds |
| 2587 | # It must only be set if @iops-read-max is set as well. |
| 2588 | # @iops-write: limit write operations per second |
| 2589 | # @iops-write-max: I/O operations write burst |
| 2590 | # @iops-write-max-length: length of the iops-write-max burst period, in seconds |
| 2591 | # It must only be set if @iops-write-max is set as well. |
| 2592 | # @bps-total: limit total bytes per second |
| 2593 | # @bps-total-max: total bytes burst |
| 2594 | # @bps-total-max-length: length of the bps-total-max burst period, in seconds. |
| 2595 | # It must only be set if @bps-total-max is set as well. |
| 2596 | # @bps-read: limit read bytes per second |
| 2597 | # @bps-read-max: total bytes read burst |
| 2598 | # @bps-read-max-length: length of the bps-read-max burst period, in seconds |
| 2599 | # It must only be set if @bps-read-max is set as well. |
| 2600 | # @bps-write: limit write bytes per second |
| 2601 | # @bps-write-max: total bytes write burst |
| 2602 | # @bps-write-max-length: length of the bps-write-max burst period, in seconds |
| 2603 | # It must only be set if @bps-write-max is set as well. |
| 2604 | # @iops-size: when limiting by iops max size of an I/O in bytes |
Manos Pitsidianakis | 432d889 | 2017-08-25 16:20:26 +0300 | [diff] [blame] | 2605 | # |
| 2606 | # Since: 2.11 |
| 2607 | ## |
| 2608 | { 'struct': 'ThrottleLimits', |
| 2609 | 'data': { '*iops-total' : 'int', '*iops-total-max' : 'int', |
| 2610 | '*iops-total-max-length' : 'int', '*iops-read' : 'int', |
| 2611 | '*iops-read-max' : 'int', '*iops-read-max-length' : 'int', |
| 2612 | '*iops-write' : 'int', '*iops-write-max' : 'int', |
| 2613 | '*iops-write-max-length' : 'int', '*bps-total' : 'int', |
| 2614 | '*bps-total-max' : 'int', '*bps-total-max-length' : 'int', |
| 2615 | '*bps-read' : 'int', '*bps-read-max' : 'int', |
| 2616 | '*bps-read-max-length' : 'int', '*bps-write' : 'int', |
| 2617 | '*bps-write-max' : 'int', '*bps-write-max-length' : 'int', |
| 2618 | '*iops-size' : 'int' } } |
| 2619 | |
| 2620 | ## |
Kevin Wolf | 381bd74 | 2020-10-20 12:47:58 +0200 | [diff] [blame] | 2621 | # @ThrottleGroupProperties: |
| 2622 | # |
| 2623 | # Properties for throttle-group objects. |
| 2624 | # |
Kevin Wolf | 381bd74 | 2020-10-20 12:47:58 +0200 | [diff] [blame] | 2625 | # @limits: limits to apply for this throttle group |
| 2626 | # |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 2627 | # Features: |
| 2628 | # @unstable: All members starting with x- are aliases for the same key |
| 2629 | # without x- in the @limits object. This is not a stable |
| 2630 | # interface and may be removed or changed incompatibly in |
| 2631 | # the future. Use @limits for a supported stable |
| 2632 | # interface. |
| 2633 | # |
Kevin Wolf | 381bd74 | 2020-10-20 12:47:58 +0200 | [diff] [blame] | 2634 | # Since: 2.11 |
| 2635 | ## |
| 2636 | { 'struct': 'ThrottleGroupProperties', |
| 2637 | 'data': { '*limits': 'ThrottleLimits', |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 2638 | '*x-iops-total': { 'type': 'int', |
| 2639 | 'features': [ 'unstable' ] }, |
| 2640 | '*x-iops-total-max': { 'type': 'int', |
| 2641 | 'features': [ 'unstable' ] }, |
| 2642 | '*x-iops-total-max-length': { 'type': 'int', |
| 2643 | 'features': [ 'unstable' ] }, |
| 2644 | '*x-iops-read': { 'type': 'int', |
| 2645 | 'features': [ 'unstable' ] }, |
| 2646 | '*x-iops-read-max': { 'type': 'int', |
| 2647 | 'features': [ 'unstable' ] }, |
| 2648 | '*x-iops-read-max-length': { 'type': 'int', |
| 2649 | 'features': [ 'unstable' ] }, |
| 2650 | '*x-iops-write': { 'type': 'int', |
| 2651 | 'features': [ 'unstable' ] }, |
| 2652 | '*x-iops-write-max': { 'type': 'int', |
| 2653 | 'features': [ 'unstable' ] }, |
| 2654 | '*x-iops-write-max-length': { 'type': 'int', |
| 2655 | 'features': [ 'unstable' ] }, |
| 2656 | '*x-bps-total': { 'type': 'int', |
| 2657 | 'features': [ 'unstable' ] }, |
| 2658 | '*x-bps-total-max': { 'type': 'int', |
| 2659 | 'features': [ 'unstable' ] }, |
| 2660 | '*x-bps-total-max-length': { 'type': 'int', |
| 2661 | 'features': [ 'unstable' ] }, |
| 2662 | '*x-bps-read': { 'type': 'int', |
| 2663 | 'features': [ 'unstable' ] }, |
| 2664 | '*x-bps-read-max': { 'type': 'int', |
| 2665 | 'features': [ 'unstable' ] }, |
| 2666 | '*x-bps-read-max-length': { 'type': 'int', |
| 2667 | 'features': [ 'unstable' ] }, |
| 2668 | '*x-bps-write': { 'type': 'int', |
| 2669 | 'features': [ 'unstable' ] }, |
| 2670 | '*x-bps-write-max': { 'type': 'int', |
| 2671 | 'features': [ 'unstable' ] }, |
| 2672 | '*x-bps-write-max-length': { 'type': 'int', |
| 2673 | 'features': [ 'unstable' ] }, |
| 2674 | '*x-iops-size': { 'type': 'int', |
| 2675 | 'features': [ 'unstable' ] } } } |
Kevin Wolf | 381bd74 | 2020-10-20 12:47:58 +0200 | [diff] [blame] | 2676 | |
| 2677 | ## |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2678 | # @block-stream: |
| 2679 | # |
| 2680 | # Copy data from a backing file into a block device. |
| 2681 | # |
| 2682 | # The block streaming operation is performed in the background until the entire |
| 2683 | # backing file has been copied. This command returns immediately once streaming |
| 2684 | # has started. The status of ongoing block streaming operations can be checked |
| 2685 | # with query-block-jobs. The operation can be stopped before it has completed |
| 2686 | # using the block-job-cancel command. |
| 2687 | # |
Alberto Garcia | 554b614 | 2016-10-28 10:08:11 +0300 | [diff] [blame] | 2688 | # The node that receives the data is called the top image, can be located in |
| 2689 | # any part of the chain (but always above the base image; see below) and can be |
| 2690 | # specified using its device or node name. Earlier qemu versions only allowed |
| 2691 | # 'device' to name the top level node; presence of the 'base-node' parameter |
| 2692 | # during introspection can be used as a witness of the enhanced semantics |
| 2693 | # of 'device'. |
| 2694 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2695 | # If a base file is specified then sectors are not copied from that base file and |
Max Reitz | 67acfd2 | 2019-06-12 17:48:11 +0200 | [diff] [blame] | 2696 | # its backing chain. This can be used to stream a subset of the backing file |
| 2697 | # chain instead of flattening the entire image. |
| 2698 | # When streaming completes the image file will have the base file as its backing |
| 2699 | # file, unless that node was changed while the job was running. In that case, |
| 2700 | # base's parent's backing (or filtered, whichever exists) child (i.e., base at |
| 2701 | # the beginning of the job) will be the new backing file. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2702 | # |
| 2703 | # On successful completion the image file is updated to drop the backing file |
| 2704 | # and the BLOCK_JOB_COMPLETED event is emitted. |
| 2705 | # |
Max Reitz | 67acfd2 | 2019-06-12 17:48:11 +0200 | [diff] [blame] | 2706 | # In case @device is a filter node, block-stream modifies the first non-filter |
| 2707 | # overlay node below it to point to the new backing node instead of modifying |
| 2708 | # @device itself. |
| 2709 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2710 | # @job-id: identifier for the newly-created block job. If |
Alberto Garcia | 2323322 | 2016-07-05 17:28:59 +0300 | [diff] [blame] | 2711 | # omitted, the device name will be used. (Since 2.7) |
| 2712 | # |
Alberto Garcia | 554b614 | 2016-10-28 10:08:11 +0300 | [diff] [blame] | 2713 | # @device: the device or node name of the top image |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2714 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2715 | # @base: the common backing file name. |
Vladimir Sementsov-Ogievskiy | 7f4a396 | 2020-12-16 09:17:00 +0300 | [diff] [blame] | 2716 | # It cannot be set if @base-node or @bottom is also set. |
Alberto Garcia | 312fe09 | 2016-10-28 10:08:19 +0300 | [diff] [blame] | 2717 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2718 | # @base-node: the node name of the backing file. |
Vladimir Sementsov-Ogievskiy | 7f4a396 | 2020-12-16 09:17:00 +0300 | [diff] [blame] | 2719 | # It cannot be set if @base or @bottom is also set. (Since 2.8) |
| 2720 | # |
| 2721 | # @bottom: the last node in the chain that should be streamed into |
| 2722 | # top. It cannot be set if @base or @base-node is also set. |
| 2723 | # It cannot be filter node. (Since 6.0) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2724 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2725 | # @backing-file: The backing file string to write into the top |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2726 | # image. This filename is not validated. |
Jeff Cody | 13d8cc5 | 2014-06-25 15:40:11 -0400 | [diff] [blame] | 2727 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2728 | # If a pathname string is such that it cannot be |
| 2729 | # resolved by QEMU, that means that subsequent QMP or |
| 2730 | # HMP commands must use node-names for the image in |
| 2731 | # question, as filename lookup methods will fail. |
Jeff Cody | 13d8cc5 | 2014-06-25 15:40:11 -0400 | [diff] [blame] | 2732 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2733 | # If not specified, QEMU will automatically determine |
| 2734 | # the backing file string to use, or error out if there |
| 2735 | # is no obvious choice. Care should be taken when |
| 2736 | # specifying the string, to specify a valid filename or |
| 2737 | # protocol. |
| 2738 | # (Since 2.1) |
Jeff Cody | 13d8cc5 | 2014-06-25 15:40:11 -0400 | [diff] [blame] | 2739 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2740 | # @speed: the maximum speed, in bytes per second |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2741 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 2742 | # @on-error: the action to take on an error (default report). |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2743 | # 'stop' and 'enospc' can only be used if the block device |
| 2744 | # supports io-status (see BlockInfo). Since 1.3. |
| 2745 | # |
Andrey Shinkevich | 880747a | 2020-12-16 09:16:54 +0300 | [diff] [blame] | 2746 | # @filter-node-name: the node name that should be assigned to the |
| 2747 | # filter driver that the stream job inserts into the graph |
| 2748 | # above @device. If this option is not given, a node name is |
| 2749 | # autogenerated. (Since: 6.0) |
| 2750 | # |
John Snow | 241ca1a | 2018-09-06 09:02:23 -0400 | [diff] [blame] | 2751 | # @auto-finalize: When false, this job will wait in a PENDING state after it has |
| 2752 | # finished its work, waiting for @block-job-finalize before |
| 2753 | # making any block graph changes. |
| 2754 | # When true, this job will automatically |
| 2755 | # perform its abort or commit actions. |
| 2756 | # Defaults to true. (Since 3.1) |
| 2757 | # |
| 2758 | # @auto-dismiss: When false, this job will wait in a CONCLUDED state after it |
| 2759 | # has completely ceased all work, and awaits @block-job-dismiss. |
| 2760 | # When true, this job will automatically disappear from the query |
| 2761 | # list without user intervention. |
| 2762 | # Defaults to true. (Since 3.1) |
| 2763 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2764 | # Returns: - Nothing on success. |
| 2765 | # - If @device does not exist, DeviceNotFound. |
Marc-André Lureau | 49b37c2 | 2016-06-23 14:52:13 +0200 | [diff] [blame] | 2766 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2767 | # Since: 1.1 |
Marc-André Lureau | 49b37c2 | 2016-06-23 14:52:13 +0200 | [diff] [blame] | 2768 | # |
| 2769 | # Example: |
| 2770 | # |
| 2771 | # -> { "execute": "block-stream", |
| 2772 | # "arguments": { "device": "virtio0", |
| 2773 | # "base": "/tmp/master.qcow2" } } |
| 2774 | # <- { "return": {} } |
| 2775 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2776 | ## |
| 2777 | { 'command': 'block-stream', |
Alberto Garcia | 2323322 | 2016-07-05 17:28:59 +0300 | [diff] [blame] | 2778 | 'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', |
Vladimir Sementsov-Ogievskiy | 7f4a396 | 2020-12-16 09:17:00 +0300 | [diff] [blame] | 2779 | '*base-node': 'str', '*backing-file': 'str', '*bottom': 'str', |
| 2780 | '*speed': 'int', '*on-error': 'BlockdevOnError', |
Andrey Shinkevich | 880747a | 2020-12-16 09:16:54 +0300 | [diff] [blame] | 2781 | '*filter-node-name': 'str', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2782 | '*auto-finalize': 'bool', '*auto-dismiss': 'bool' }, |
| 2783 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2784 | |
| 2785 | ## |
| 2786 | # @block-job-set-speed: |
| 2787 | # |
| 2788 | # Set maximum speed for a background block operation. |
| 2789 | # |
| 2790 | # This command can only be issued when there is an active block job. |
| 2791 | # |
| 2792 | # Throttling can be disabled by setting the speed to 0. |
| 2793 | # |
Alberto Garcia | 6aae5be | 2016-07-05 17:29:02 +0300 | [diff] [blame] | 2794 | # @device: The job identifier. This used to be a device name (hence |
| 2795 | # the name of the parameter), but since QEMU 2.7 it can have |
| 2796 | # other values. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2797 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2798 | # @speed: the maximum speed, in bytes per second, or 0 for unlimited. |
| 2799 | # Defaults to 0. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2800 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2801 | # Returns: - Nothing on success |
| 2802 | # - If no background operation is active on this device, DeviceNotActive |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2803 | # |
| 2804 | # Since: 1.1 |
| 2805 | ## |
| 2806 | { 'command': 'block-job-set-speed', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2807 | 'data': { 'device': 'str', 'speed': 'int' }, |
| 2808 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2809 | |
| 2810 | ## |
| 2811 | # @block-job-cancel: |
| 2812 | # |
| 2813 | # Stop an active background block operation. |
| 2814 | # |
| 2815 | # This command returns immediately after marking the active background block |
| 2816 | # operation for cancellation. It is an error to call this command if no |
| 2817 | # operation is in progress. |
| 2818 | # |
| 2819 | # The operation will cancel as soon as possible and then emit the |
| 2820 | # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when |
| 2821 | # enumerated using query-block-jobs. |
| 2822 | # |
Kashyap Chamarthy | c117bb1 | 2017-11-21 12:52:53 +0100 | [diff] [blame] | 2823 | # Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated |
| 2824 | # (via the event BLOCK_JOB_READY) that the source and destination are |
| 2825 | # synchronized, then the event triggered by this command changes to |
| 2826 | # BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the |
| 2827 | # destination now has a point-in-time copy tied to the time of the cancellation. |
| 2828 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2829 | # For streaming, the image file retains its backing file unless the streaming |
| 2830 | # operation happens to complete just as it is being cancelled. A new streaming |
| 2831 | # operation can be started at a later time to finish copying all data from the |
| 2832 | # backing file. |
| 2833 | # |
Alberto Garcia | 6aae5be | 2016-07-05 17:29:02 +0300 | [diff] [blame] | 2834 | # @device: The job identifier. This used to be a device name (hence |
| 2835 | # the name of the parameter), but since QEMU 2.7 it can have |
| 2836 | # other values. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2837 | # |
Liang Li | b76e445 | 2018-03-13 08:12:16 -0400 | [diff] [blame] | 2838 | # @force: If true, and the job has already emitted the event BLOCK_JOB_READY, |
| 2839 | # abandon the job immediately (even if it is paused) instead of waiting |
| 2840 | # for the destination to complete its final synchronization (since 1.3) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2841 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2842 | # Returns: - Nothing on success |
| 2843 | # - If no background operation is active on this device, DeviceNotActive |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2844 | # |
| 2845 | # Since: 1.1 |
| 2846 | ## |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2847 | { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' }, |
| 2848 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2849 | |
| 2850 | ## |
| 2851 | # @block-job-pause: |
| 2852 | # |
| 2853 | # Pause an active background block operation. |
| 2854 | # |
| 2855 | # This command returns immediately after marking the active background block |
| 2856 | # operation for pausing. It is an error to call this command if no |
Kevin Wolf | cd44d96 | 2018-05-16 12:55:48 +0200 | [diff] [blame] | 2857 | # operation is in progress or if the job is already paused. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2858 | # |
| 2859 | # The operation will pause as soon as possible. No event is emitted when |
| 2860 | # the operation is actually paused. Cancelling a paused job automatically |
| 2861 | # resumes it. |
| 2862 | # |
Alberto Garcia | 6aae5be | 2016-07-05 17:29:02 +0300 | [diff] [blame] | 2863 | # @device: The job identifier. This used to be a device name (hence |
| 2864 | # the name of the parameter), but since QEMU 2.7 it can have |
| 2865 | # other values. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2866 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2867 | # Returns: - Nothing on success |
| 2868 | # - If no background operation is active on this device, DeviceNotActive |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2869 | # |
| 2870 | # Since: 1.3 |
| 2871 | ## |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2872 | { 'command': 'block-job-pause', 'data': { 'device': 'str' }, |
| 2873 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2874 | |
| 2875 | ## |
| 2876 | # @block-job-resume: |
| 2877 | # |
| 2878 | # Resume an active background block operation. |
| 2879 | # |
| 2880 | # This command returns immediately after resuming a paused background block |
| 2881 | # operation. It is an error to call this command if no operation is in |
Kevin Wolf | cd44d96 | 2018-05-16 12:55:48 +0200 | [diff] [blame] | 2882 | # progress or if the job is not paused. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2883 | # |
| 2884 | # This command also clears the error status of the job. |
| 2885 | # |
Alberto Garcia | 6aae5be | 2016-07-05 17:29:02 +0300 | [diff] [blame] | 2886 | # @device: The job identifier. This used to be a device name (hence |
| 2887 | # the name of the parameter), but since QEMU 2.7 it can have |
| 2888 | # other values. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2889 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2890 | # Returns: - Nothing on success |
| 2891 | # - If no background operation is active on this device, DeviceNotActive |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2892 | # |
| 2893 | # Since: 1.3 |
| 2894 | ## |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2895 | { 'command': 'block-job-resume', 'data': { 'device': 'str' }, |
| 2896 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2897 | |
| 2898 | ## |
| 2899 | # @block-job-complete: |
| 2900 | # |
| 2901 | # Manually trigger completion of an active background block operation. This |
| 2902 | # is supported for drive mirroring, where it also switches the device to |
| 2903 | # write to the target path only. The ability to complete is signaled with |
| 2904 | # a BLOCK_JOB_READY event. |
| 2905 | # |
| 2906 | # This command completes an active background block operation synchronously. |
| 2907 | # The ordering of this command's return with the BLOCK_JOB_COMPLETED event |
| 2908 | # is not defined. Note that if an I/O error occurs during the processing of |
| 2909 | # this command: 1) the command itself will fail; 2) the error will be processed |
| 2910 | # according to the rerror/werror arguments that were specified when starting |
| 2911 | # the operation. |
| 2912 | # |
| 2913 | # A cancelled or paused job cannot be completed. |
| 2914 | # |
Alberto Garcia | 6aae5be | 2016-07-05 17:29:02 +0300 | [diff] [blame] | 2915 | # @device: The job identifier. This used to be a device name (hence |
| 2916 | # the name of the parameter), but since QEMU 2.7 it can have |
| 2917 | # other values. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2918 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 2919 | # Returns: - Nothing on success |
| 2920 | # - If no background operation is active on this device, DeviceNotActive |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2921 | # |
| 2922 | # Since: 1.3 |
| 2923 | ## |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2924 | { 'command': 'block-job-complete', 'data': { 'device': 'str' }, |
| 2925 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2926 | |
| 2927 | ## |
John Snow | 75f7105 | 2018-03-10 03:27:36 -0500 | [diff] [blame] | 2928 | # @block-job-dismiss: |
| 2929 | # |
| 2930 | # For jobs that have already concluded, remove them from the block-job-query |
| 2931 | # list. This command only needs to be run for jobs which were started with |
| 2932 | # QEMU 2.12+ job lifetime management semantics. |
| 2933 | # |
| 2934 | # This command will refuse to operate on any job that has not yet reached |
Kevin Wolf | a50c2ab | 2018-04-13 17:19:31 +0200 | [diff] [blame] | 2935 | # its terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of the |
John Snow | 75f7105 | 2018-03-10 03:27:36 -0500 | [diff] [blame] | 2936 | # BLOCK_JOB_READY event, block-job-cancel or block-job-complete will still need |
| 2937 | # to be used as appropriate. |
| 2938 | # |
| 2939 | # @id: The job identifier. |
| 2940 | # |
| 2941 | # Returns: Nothing on success |
| 2942 | # |
| 2943 | # Since: 2.12 |
| 2944 | ## |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2945 | { 'command': 'block-job-dismiss', 'data': { 'id': 'str' }, |
| 2946 | 'allow-preconfig': true } |
John Snow | 75f7105 | 2018-03-10 03:27:36 -0500 | [diff] [blame] | 2947 | |
| 2948 | ## |
John Snow | 11b61fb | 2018-03-10 03:27:43 -0500 | [diff] [blame] | 2949 | # @block-job-finalize: |
| 2950 | # |
| 2951 | # Once a job that has manual=true reaches the pending state, it can be |
| 2952 | # instructed to finalize any graph changes and do any necessary cleanup |
| 2953 | # via this command. |
| 2954 | # For jobs in a transaction, instructing one job to finalize will force |
| 2955 | # ALL jobs in the transaction to finalize, so it is only necessary to instruct |
| 2956 | # a single member job to finalize. |
| 2957 | # |
| 2958 | # @id: The job identifier. |
| 2959 | # |
| 2960 | # Returns: Nothing on success |
| 2961 | # |
| 2962 | # Since: 2.12 |
| 2963 | ## |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 2964 | { 'command': 'block-job-finalize', 'data': { 'id': 'str' }, |
| 2965 | 'allow-preconfig': true } |
John Snow | 11b61fb | 2018-03-10 03:27:43 -0500 | [diff] [blame] | 2966 | |
| 2967 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2968 | # @BlockdevDiscardOptions: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2969 | # |
| 2970 | # Determines how to handle discard requests. |
| 2971 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2972 | # @ignore: Ignore the request |
| 2973 | # @unmap: Forward as an unmap request |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2974 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 2975 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2976 | ## |
| 2977 | { 'enum': 'BlockdevDiscardOptions', |
| 2978 | 'data': [ 'ignore', 'unmap' ] } |
| 2979 | |
| 2980 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2981 | # @BlockdevDetectZeroesOptions: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2982 | # |
| 2983 | # Describes the operation mode for the automatic conversion of plain |
| 2984 | # zero writes by the OS to driver specific optimized zero write commands. |
| 2985 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 2986 | # @off: Disabled (default) |
| 2987 | # @on: Enabled |
| 2988 | # @unmap: Enabled and even try to unmap blocks if possible. This requires |
| 2989 | # also that @BlockdevDiscardOptions is set to unmap for this device. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2990 | # |
| 2991 | # Since: 2.1 |
| 2992 | ## |
| 2993 | { 'enum': 'BlockdevDetectZeroesOptions', |
| 2994 | 'data': [ 'off', 'on', 'unmap' ] } |
| 2995 | |
| 2996 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 2997 | # @BlockdevAioOptions: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 2998 | # |
| 2999 | # Selects the AIO backend to handle I/O requests |
| 3000 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3001 | # @threads: Use qemu's thread pool |
| 3002 | # @native: Use native AIO backend (only Linux and Windows) |
| 3003 | # @io_uring: Use linux io_uring (since 5.0) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3004 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3005 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3006 | ## |
| 3007 | { 'enum': 'BlockdevAioOptions', |
Aarushi Mehta | f14beae | 2020-01-20 14:18:45 +0000 | [diff] [blame] | 3008 | 'data': [ 'threads', 'native', |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 3009 | { 'name': 'io_uring', 'if': 'CONFIG_LINUX_IO_URING' } ] } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3010 | |
| 3011 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3012 | # @BlockdevCacheOptions: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3013 | # |
| 3014 | # Includes cache-related options for block devices |
| 3015 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3016 | # @direct: enables use of O_DIRECT (bypass the host page cache; |
| 3017 | # default: false) |
| 3018 | # @no-flush: ignore any flush requests for the device (default: |
| 3019 | # false) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3020 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3021 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3022 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3023 | { 'struct': 'BlockdevCacheOptions', |
Kevin Wolf | aaa436f | 2016-03-14 13:16:51 +0100 | [diff] [blame] | 3024 | 'data': { '*direct': 'bool', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3025 | '*no-flush': 'bool' } } |
| 3026 | |
| 3027 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3028 | # @BlockdevDriver: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3029 | # |
| 3030 | # Drivers that are supported in block device operations. |
| 3031 | # |
Manos Pitsidianakis | d8e7d87 | 2017-08-25 16:20:27 +0300 | [diff] [blame] | 3032 | # @throttle: Since 2.11 |
Fam Zheng | d87ee3d | 2018-01-16 14:09:01 +0800 | [diff] [blame] | 3033 | # @nvme: Since 2.12 |
Peter Maydell | 51f63ec | 2018-05-22 11:39:56 +0100 | [diff] [blame] | 3034 | # @copy-on-read: Since 3.0 |
Aapo Vienamo | bfcc224 | 2018-07-03 17:48:48 +0300 | [diff] [blame] | 3035 | # @blklogwrites: Since 3.0 |
Pavel Dovgalyuk | 35e32d9 | 2019-10-16 11:40:39 +0300 | [diff] [blame] | 3036 | # @blkreplay: Since 4.2 |
Andrey Shinkevich | f41388e | 2019-12-02 15:15:04 +0300 | [diff] [blame] | 3037 | # @compress: Since 5.0 |
Vladimir Sementsov-Ogievskiy | 783b282 | 2021-08-24 11:38:44 +0300 | [diff] [blame] | 3038 | # @copy-before-write: Since 6.2 |
Vladimir Sementsov-Ogievskiy | 1c14eaa | 2022-03-03 20:43:44 +0100 | [diff] [blame] | 3039 | # @snapshot-access: Since 7.0 |
Ashish Mittal | da92c3f | 2017-04-03 20:48:08 -0700 | [diff] [blame] | 3040 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3041 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3042 | ## |
| 3043 | { 'enum': 'BlockdevDriver', |
Pavel Dovgalyuk | 35e32d9 | 2019-10-16 11:40:39 +0300 | [diff] [blame] | 3044 | 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs', |
Vladimir Sementsov-Ogievskiy | 783b282 | 2021-08-24 11:38:44 +0300 | [diff] [blame] | 3045 | 'cloop', 'compress', 'copy-before-write', 'copy-on-read', 'dmg', |
Vladimir Sementsov-Ogievskiy | 1c14eaa | 2022-03-03 20:43:44 +0100 | [diff] [blame] | 3046 | 'file', 'snapshot-access', 'ftp', 'ftps', 'gluster', |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 3047 | {'name': 'host_cdrom', 'if': 'HAVE_HOST_BLOCK_DEVICE' }, |
| 3048 | {'name': 'host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' }, |
Stefan Hajnoczi | fd66dbd | 2022-10-13 14:58:57 -0400 | [diff] [blame] | 3049 | 'http', 'https', |
| 3050 | { 'name': 'io_uring', 'if': 'CONFIG_BLKIO' }, |
| 3051 | 'iscsi', |
| 3052 | 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', |
| 3053 | { 'name': 'nvme-io_uring', 'if': 'CONFIG_BLKIO' }, |
| 3054 | 'parallels', 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', |
| 3055 | 'raw', 'rbd', |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 3056 | { 'name': 'replication', 'if': 'CONFIG_REPLICATION' }, |
Stefan Hajnoczi | fd66dbd | 2022-10-13 14:58:57 -0400 | [diff] [blame] | 3057 | 'ssh', 'throttle', 'vdi', 'vhdx', |
Alberto Faria | 03d9e4c | 2022-10-28 14:16:35 +0100 | [diff] [blame] | 3058 | { 'name': 'virtio-blk-vfio-pci', 'if': 'CONFIG_BLKIO' }, |
Stefan Hajnoczi | fd66dbd | 2022-10-13 14:58:57 -0400 | [diff] [blame] | 3059 | { 'name': 'virtio-blk-vhost-user', 'if': 'CONFIG_BLKIO' }, |
| 3060 | { 'name': 'virtio-blk-vhost-vdpa', 'if': 'CONFIG_BLKIO' }, |
| 3061 | 'vmdk', 'vpc', 'vvfat' ] } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3062 | |
| 3063 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3064 | # @BlockdevOptionsFile: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3065 | # |
Kevin Wolf | 6855528 | 2016-09-08 13:08:20 +0200 | [diff] [blame] | 3066 | # Driver specific block device options for the file backend. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3067 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3068 | # @filename: path to the image file |
| 3069 | # @pr-manager: the id for the object that will handle persistent reservations |
| 3070 | # for this device (default: none, forward the commands via SG_IO; |
| 3071 | # since 2.11) |
| 3072 | # @aio: AIO backend (default: threads) (since: 2.8) |
Stefano Garzarella | 684960d | 2021-10-26 18:23:44 +0200 | [diff] [blame] | 3073 | # @aio-max-batch: maximum number of requests to batch together into a single |
| 3074 | # submission in the AIO backend. The smallest value between |
| 3075 | # this and the aio-max-batch value of the IOThread object is |
| 3076 | # chosen. |
| 3077 | # 0 means that the AIO backend will handle it automatically. |
| 3078 | # (default: 0, since 6.2) |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3079 | # @locking: whether to enable file locking. If set to 'auto', only enable |
| 3080 | # when Open File Descriptor (OFD) locking API is available |
| 3081 | # (default: auto, since 2.10) |
| 3082 | # @drop-cache: invalidate page cache during live migration. This prevents |
| 3083 | # stale data on the migration destination with cache.direct=off. |
| 3084 | # Currently only supported on Linux hosts. |
| 3085 | # (default: on, since: 4.0) |
Stefan Hajnoczi | 31be8a2 | 2018-04-27 17:23:12 +0100 | [diff] [blame] | 3086 | # @x-check-cache-dropped: whether to check that page cache was dropped on live |
| 3087 | # migration. May cause noticeable delays if the image |
| 3088 | # file is large, do not use in production. |
Peter Maydell | 51f63ec | 2018-05-22 11:39:56 +0100 | [diff] [blame] | 3089 | # (default: off) (since: 3.0) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3090 | # |
Kevin Wolf | c9d4070 | 2019-06-06 17:38:02 +0200 | [diff] [blame] | 3091 | # Features: |
| 3092 | # @dynamic-auto-read-only: If present, enabled auto-read-only means that the |
| 3093 | # driver will open the image read-only at first, |
| 3094 | # dynamically reopen the image file read-write when |
| 3095 | # the first writer is attached to the node and reopen |
| 3096 | # read-only when the last writer is detached. This |
| 3097 | # allows giving QEMU write permissions only on demand |
| 3098 | # when an operation actually needs write access. |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 3099 | # @unstable: Member x-check-cache-dropped is meant for debugging. |
Kevin Wolf | c9d4070 | 2019-06-06 17:38:02 +0200 | [diff] [blame] | 3100 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3101 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3102 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3103 | { 'struct': 'BlockdevOptionsFile', |
Kevin Wolf | 0a4279d | 2016-09-08 15:09:01 +0200 | [diff] [blame] | 3104 | 'data': { 'filename': 'str', |
Paolo Bonzini | 7c9e527 | 2017-08-21 18:58:56 +0200 | [diff] [blame] | 3105 | '*pr-manager': 'str', |
Fam Zheng | 16b48d5 | 2017-05-03 00:35:50 +0800 | [diff] [blame] | 3106 | '*locking': 'OnOffAuto', |
Stefan Hajnoczi | 31be8a2 | 2018-04-27 17:23:12 +0100 | [diff] [blame] | 3107 | '*aio': 'BlockdevAioOptions', |
Stefano Garzarella | 684960d | 2021-10-26 18:23:44 +0200 | [diff] [blame] | 3108 | '*aio-max-batch': 'int', |
Peter Maydell | dbb28bc | 2020-02-13 17:56:27 +0000 | [diff] [blame] | 3109 | '*drop-cache': {'type': 'bool', |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 3110 | 'if': 'CONFIG_LINUX'}, |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 3111 | '*x-check-cache-dropped': { 'type': 'bool', |
| 3112 | 'features': [ 'unstable' ] } }, |
Kevin Wolf | c9d4070 | 2019-06-06 17:38:02 +0200 | [diff] [blame] | 3113 | 'features': [ { 'name': 'dynamic-auto-read-only', |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 3114 | 'if': 'CONFIG_POSIX' } ] } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3115 | |
| 3116 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3117 | # @BlockdevOptionsNull: |
Fam Zheng | e819ab2 | 2014-09-11 14:09:56 +0800 | [diff] [blame] | 3118 | # |
| 3119 | # Driver specific block device options for the null backend. |
| 3120 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3121 | # @size: size of the device in bytes. |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 3122 | # @latency-ns: emulated latency (in nanoseconds) in processing |
Fam Zheng | e5e51dd | 2015-04-01 09:45:38 +0800 | [diff] [blame] | 3123 | # requests. Default to zero which completes requests immediately. |
| 3124 | # (Since 2.4) |
Kevin Wolf | 128b05f | 2019-06-17 13:54:48 +0200 | [diff] [blame] | 3125 | # @read-zeroes: if true, reads from the device produce zeroes; if false, the |
| 3126 | # buffer is left unchanged. (default: false; since: 4.1) |
Fam Zheng | e819ab2 | 2014-09-11 14:09:56 +0800 | [diff] [blame] | 3127 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3128 | # Since: 2.9 |
Fam Zheng | e819ab2 | 2014-09-11 14:09:56 +0800 | [diff] [blame] | 3129 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3130 | { 'struct': 'BlockdevOptionsNull', |
Kevin Wolf | 128b05f | 2019-06-17 13:54:48 +0200 | [diff] [blame] | 3131 | 'data': { '*size': 'int', '*latency-ns': 'uint64', '*read-zeroes': 'bool' } } |
Fam Zheng | e819ab2 | 2014-09-11 14:09:56 +0800 | [diff] [blame] | 3132 | |
| 3133 | ## |
Fam Zheng | d87ee3d | 2018-01-16 14:09:01 +0800 | [diff] [blame] | 3134 | # @BlockdevOptionsNVMe: |
| 3135 | # |
| 3136 | # Driver specific block device options for the NVMe backend. |
| 3137 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3138 | # @device: PCI controller address of the NVMe device in |
| 3139 | # format hhhh:bb:ss.f (host:bus:slot.function) |
Fam Zheng | d87ee3d | 2018-01-16 14:09:01 +0800 | [diff] [blame] | 3140 | # @namespace: namespace number of the device, starting from 1. |
| 3141 | # |
Daniel P. Berrangé | ecaf647 | 2019-12-06 14:38:11 +0000 | [diff] [blame] | 3142 | # Note that the PCI @device must have been unbound from any host |
| 3143 | # kernel driver before instructing QEMU to add the blockdev. |
| 3144 | # |
Fam Zheng | d87ee3d | 2018-01-16 14:09:01 +0800 | [diff] [blame] | 3145 | # Since: 2.12 |
| 3146 | ## |
| 3147 | { 'struct': 'BlockdevOptionsNVMe', |
| 3148 | 'data': { 'device': 'str', 'namespace': 'int' } } |
| 3149 | |
| 3150 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3151 | # @BlockdevOptionsVVFAT: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3152 | # |
| 3153 | # Driver specific block device options for the vvfat protocol. |
| 3154 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3155 | # @dir: directory to be exported as FAT image |
| 3156 | # @fat-type: FAT type: 12, 16 or 32 |
| 3157 | # @floppy: whether to export a floppy image (true) or |
| 3158 | # partitioned hard disk (false; default) |
| 3159 | # @label: set the volume label, limited to 11 bytes. FAT16 and |
| 3160 | # FAT32 traditionally have some restrictions on labels, which are |
| 3161 | # ignored by most operating systems. Defaults to "QEMU VVFAT". |
| 3162 | # (since 2.4) |
| 3163 | # @rw: whether to allow write operations (default: false) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3164 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3165 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3166 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3167 | { 'struct': 'BlockdevOptionsVVFAT', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3168 | 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool', |
Wolfgang Bumiller | d5941dd | 2015-06-19 11:35:29 +0200 | [diff] [blame] | 3169 | '*label': 'str', '*rw': 'bool' } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3170 | |
| 3171 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3172 | # @BlockdevOptionsGenericFormat: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3173 | # |
| 3174 | # Driver specific block device options for image format that have no option |
| 3175 | # besides their data source. |
| 3176 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3177 | # @file: reference to or definition of the data source block device |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3178 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3179 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3180 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3181 | { 'struct': 'BlockdevOptionsGenericFormat', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3182 | 'data': { 'file': 'BlockdevRef' } } |
| 3183 | |
| 3184 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3185 | # @BlockdevOptionsLUKS: |
Daniel P. Berrange | 7836857 | 2016-03-21 14:11:47 +0000 | [diff] [blame] | 3186 | # |
| 3187 | # Driver specific block device options for LUKS. |
| 3188 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 3189 | # @key-secret: the ID of a QCryptoSecret object providing |
Daniel P. Berrange | 7836857 | 2016-03-21 14:11:47 +0000 | [diff] [blame] | 3190 | # the decryption key (since 2.6). Mandatory except when |
| 3191 | # doing a metadata-only probe of the image. |
| 3192 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3193 | # Since: 2.9 |
Daniel P. Berrange | 7836857 | 2016-03-21 14:11:47 +0000 | [diff] [blame] | 3194 | ## |
| 3195 | { 'struct': 'BlockdevOptionsLUKS', |
| 3196 | 'base': 'BlockdevOptionsGenericFormat', |
| 3197 | 'data': { '*key-secret': 'str' } } |
| 3198 | |
Daniel P. Berrange | 7836857 | 2016-03-21 14:11:47 +0000 | [diff] [blame] | 3199 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3200 | # @BlockdevOptionsGenericCOWFormat: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3201 | # |
| 3202 | # Driver specific block device options for image format that have no option |
| 3203 | # besides their data source and an optional backing file. |
| 3204 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3205 | # @backing: reference to or definition of the backing file block |
| 3206 | # device, null disables the backing file entirely. |
| 3207 | # Defaults to the backing file stored the image file. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3208 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3209 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3210 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3211 | { 'struct': 'BlockdevOptionsGenericCOWFormat', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3212 | 'base': 'BlockdevOptionsGenericFormat', |
Markus Armbruster | c42e874 | 2017-07-18 08:54:00 +0200 | [diff] [blame] | 3213 | 'data': { '*backing': 'BlockdevRefOrNull' } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3214 | |
| 3215 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3216 | # @Qcow2OverlapCheckMode: |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3217 | # |
| 3218 | # General overlap check modes. |
| 3219 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3220 | # @none: Do not perform any checks |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3221 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3222 | # @constant: Perform only checks which can be done in constant time and |
| 3223 | # without reading anything from disk |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3224 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3225 | # @cached: Perform only checks which can be done without reading anything |
| 3226 | # from disk |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3227 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3228 | # @all: Perform all available overlap checks |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3229 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3230 | # Since: 2.9 |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3231 | ## |
| 3232 | { 'enum': 'Qcow2OverlapCheckMode', |
| 3233 | 'data': [ 'none', 'constant', 'cached', 'all' ] } |
| 3234 | |
| 3235 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3236 | # @Qcow2OverlapCheckFlags: |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3237 | # |
| 3238 | # Structure of flags for each metadata structure. Setting a field to 'true' |
| 3239 | # makes qemu guard that structure against unintended overwriting. The default |
| 3240 | # value is chosen according to the template given. |
| 3241 | # |
| 3242 | # @template: Specifies a template mode which can be adjusted using the other |
| 3243 | # flags, defaults to 'cached' |
| 3244 | # |
Vladimir Sementsov-Ogievskiy | 0e4e431 | 2018-07-05 18:15:15 +0300 | [diff] [blame] | 3245 | # @bitmap-directory: since 3.0 |
| 3246 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3247 | # Since: 2.9 |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3248 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3249 | { 'struct': 'Qcow2OverlapCheckFlags', |
Vladimir Sementsov-Ogievskiy | 0e4e431 | 2018-07-05 18:15:15 +0300 | [diff] [blame] | 3250 | 'data': { '*template': 'Qcow2OverlapCheckMode', |
| 3251 | '*main-header': 'bool', |
| 3252 | '*active-l1': 'bool', |
| 3253 | '*active-l2': 'bool', |
| 3254 | '*refcount-table': 'bool', |
| 3255 | '*refcount-block': 'bool', |
| 3256 | '*snapshot-table': 'bool', |
| 3257 | '*inactive-l1': 'bool', |
| 3258 | '*inactive-l2': 'bool', |
| 3259 | '*bitmap-directory': 'bool' } } |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3260 | |
| 3261 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3262 | # @Qcow2OverlapChecks: |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3263 | # |
| 3264 | # Specifies which metadata structures should be guarded against unintended |
| 3265 | # overwriting. |
| 3266 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3267 | # @flags: set of flags for separate specification of each metadata structure |
| 3268 | # type |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3269 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3270 | # @mode: named mode which chooses a specific set of flags |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3271 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3272 | # Since: 2.9 |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3273 | ## |
Eric Blake | ab916fa | 2015-05-04 09:05:13 -0600 | [diff] [blame] | 3274 | { 'alternate': 'Qcow2OverlapChecks', |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3275 | 'data': { 'flags': 'Qcow2OverlapCheckFlags', |
| 3276 | 'mode': 'Qcow2OverlapCheckMode' } } |
| 3277 | |
| 3278 | ## |
Daniel P. Berrange | d85f422 | 2017-06-23 17:24:08 +0100 | [diff] [blame] | 3279 | # @BlockdevQcowEncryptionFormat: |
| 3280 | # |
| 3281 | # @aes: AES-CBC with plain64 initialization vectors |
| 3282 | # |
| 3283 | # Since: 2.10 |
| 3284 | ## |
| 3285 | { 'enum': 'BlockdevQcowEncryptionFormat', |
| 3286 | 'data': [ 'aes' ] } |
| 3287 | |
| 3288 | ## |
| 3289 | # @BlockdevQcowEncryption: |
| 3290 | # |
| 3291 | # Since: 2.10 |
| 3292 | ## |
| 3293 | { 'union': 'BlockdevQcowEncryption', |
| 3294 | 'base': { 'format': 'BlockdevQcowEncryptionFormat' }, |
| 3295 | 'discriminator': 'format', |
| 3296 | 'data': { 'aes': 'QCryptoBlockOptionsQCow' } } |
| 3297 | |
| 3298 | ## |
| 3299 | # @BlockdevOptionsQcow: |
| 3300 | # |
| 3301 | # Driver specific block device options for qcow. |
| 3302 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3303 | # @encrypt: Image decryption options. Mandatory for |
| 3304 | # encrypted images, except when doing a metadata-only |
| 3305 | # probe of the image. |
Daniel P. Berrange | d85f422 | 2017-06-23 17:24:08 +0100 | [diff] [blame] | 3306 | # |
| 3307 | # Since: 2.10 |
| 3308 | ## |
| 3309 | { 'struct': 'BlockdevOptionsQcow', |
| 3310 | 'base': 'BlockdevOptionsGenericCOWFormat', |
| 3311 | 'data': { '*encrypt': 'BlockdevQcowEncryption' } } |
| 3312 | |
Daniel P. Berrange | b25b387 | 2017-06-23 17:24:10 +0100 | [diff] [blame] | 3313 | ## |
| 3314 | # @BlockdevQcow2EncryptionFormat: |
John Snow | a9e2eb0 | 2021-09-30 16:57:07 -0400 | [diff] [blame] | 3315 | # |
Eric Blake | 58823a0 | 2019-02-06 14:28:48 -0600 | [diff] [blame] | 3316 | # @aes: AES-CBC with plain64 initialization vectors |
Daniel P. Berrange | b25b387 | 2017-06-23 17:24:10 +0100 | [diff] [blame] | 3317 | # |
| 3318 | # Since: 2.10 |
| 3319 | ## |
| 3320 | { 'enum': 'BlockdevQcow2EncryptionFormat', |
Daniel P. Berrange | 4652b8f | 2017-06-23 17:24:12 +0100 | [diff] [blame] | 3321 | 'data': [ 'aes', 'luks' ] } |
Daniel P. Berrange | b25b387 | 2017-06-23 17:24:10 +0100 | [diff] [blame] | 3322 | |
| 3323 | ## |
| 3324 | # @BlockdevQcow2Encryption: |
| 3325 | # |
| 3326 | # Since: 2.10 |
| 3327 | ## |
| 3328 | { 'union': 'BlockdevQcow2Encryption', |
| 3329 | 'base': { 'format': 'BlockdevQcow2EncryptionFormat' }, |
| 3330 | 'discriminator': 'format', |
Daniel P. Berrange | 4652b8f | 2017-06-23 17:24:12 +0100 | [diff] [blame] | 3331 | 'data': { 'aes': 'QCryptoBlockOptionsQCow', |
| 3332 | 'luks': 'QCryptoBlockOptionsLUKS'} } |
Daniel P. Berrange | b25b387 | 2017-06-23 17:24:10 +0100 | [diff] [blame] | 3333 | |
Daniel P. Berrange | d85f422 | 2017-06-23 17:24:08 +0100 | [diff] [blame] | 3334 | ## |
Vladimir Sementsov-Ogievskiy | 33fa222 | 2020-10-21 17:58:46 +0300 | [diff] [blame] | 3335 | # @BlockdevOptionsPreallocate: |
| 3336 | # |
| 3337 | # Filter driver intended to be inserted between format and protocol node |
| 3338 | # and do preallocation in protocol node on write. |
| 3339 | # |
| 3340 | # @prealloc-align: on preallocation, align file length to this number, |
| 3341 | # default 1048576 (1M) |
| 3342 | # |
| 3343 | # @prealloc-size: how much to preallocate, default 134217728 (128M) |
| 3344 | # |
| 3345 | # Since: 6.0 |
| 3346 | ## |
| 3347 | { 'struct': 'BlockdevOptionsPreallocate', |
| 3348 | 'base': 'BlockdevOptionsGenericFormat', |
| 3349 | 'data': { '*prealloc-align': 'int', '*prealloc-size': 'int' } } |
| 3350 | |
| 3351 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3352 | # @BlockdevOptionsQcow2: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3353 | # |
| 3354 | # Driver specific block device options for qcow2. |
| 3355 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3356 | # @lazy-refcounts: whether to enable the lazy refcounts |
| 3357 | # feature (default is taken from the image file) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3358 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3359 | # @pass-discard-request: whether discard requests to the qcow2 |
| 3360 | # device should be forwarded to the data source |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3361 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 3362 | # @pass-discard-snapshot: whether discard requests for the data source |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3363 | # should be issued when a snapshot operation (e.g. |
| 3364 | # deleting a snapshot) frees clusters in the qcow2 file |
| 3365 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3366 | # @pass-discard-other: whether discard requests for the data source |
| 3367 | # should be issued on other occasions where a cluster |
| 3368 | # gets freed |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3369 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3370 | # @overlap-check: which overlap checks to perform for writes |
| 3371 | # to the image, defaults to 'cached' (since 2.2) |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3372 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3373 | # @cache-size: the maximum total size of the L2 table and |
| 3374 | # refcount block caches in bytes (since 2.2) |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3375 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3376 | # @l2-cache-size: the maximum size of the L2 table cache in |
| 3377 | # bytes (since 2.2) |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3378 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3379 | # @l2-cache-entry-size: the size of each entry in the L2 cache in |
| 3380 | # bytes. It must be a power of two between 512 |
| 3381 | # and the cluster size. The default value is |
| 3382 | # the cluster size (since 2.12) |
Alberto Garcia | 1221fe6 | 2018-02-05 16:33:36 +0200 | [diff] [blame] | 3383 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3384 | # @refcount-cache-size: the maximum size of the refcount block cache |
| 3385 | # in bytes (since 2.2) |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3386 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3387 | # @cache-clean-interval: clean unused entries in the L2 and refcount |
| 3388 | # caches. The interval is in seconds. The default value |
| 3389 | # is 600 on supporting platforms, and 0 on other |
| 3390 | # platforms. 0 disables this feature. (since 2.5) |
Leonid Bloch | e957b50 | 2018-09-26 19:04:46 +0300 | [diff] [blame] | 3391 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3392 | # @encrypt: Image decryption options. Mandatory for |
| 3393 | # encrypted images, except when doing a metadata-only |
| 3394 | # probe of the image. (since 2.10) |
Alberto Garcia | 279621c | 2015-08-04 15:14:40 +0300 | [diff] [blame] | 3395 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3396 | # @data-file: reference to or definition of the external data file. |
| 3397 | # This may only be specified for images that require an |
| 3398 | # external data file. If it is not specified for such |
| 3399 | # an image, the data file name is loaded from the image |
| 3400 | # file. (since 4.0) |
Kevin Wolf | 0e8c08b | 2019-01-29 17:13:57 +0100 | [diff] [blame] | 3401 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3402 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3403 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3404 | { 'struct': 'BlockdevOptionsQcow2', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3405 | 'base': 'BlockdevOptionsGenericCOWFormat', |
| 3406 | 'data': { '*lazy-refcounts': 'bool', |
| 3407 | '*pass-discard-request': 'bool', |
| 3408 | '*pass-discard-snapshot': 'bool', |
Max Reitz | f658581 | 2014-08-20 19:59:36 +0200 | [diff] [blame] | 3409 | '*pass-discard-other': 'bool', |
| 3410 | '*overlap-check': 'Qcow2OverlapChecks', |
| 3411 | '*cache-size': 'int', |
| 3412 | '*l2-cache-size': 'int', |
Alberto Garcia | 1221fe6 | 2018-02-05 16:33:36 +0200 | [diff] [blame] | 3413 | '*l2-cache-entry-size': 'int', |
Alberto Garcia | 279621c | 2015-08-04 15:14:40 +0300 | [diff] [blame] | 3414 | '*refcount-cache-size': 'int', |
Daniel P. Berrange | b25b387 | 2017-06-23 17:24:10 +0100 | [diff] [blame] | 3415 | '*cache-clean-interval': 'int', |
Kevin Wolf | 0e8c08b | 2019-01-29 17:13:57 +0100 | [diff] [blame] | 3416 | '*encrypt': 'BlockdevQcow2Encryption', |
| 3417 | '*data-file': 'BlockdevRef' } } |
Chrysostomos Nanakos | b1de5f4 | 2014-07-30 20:59:09 +0300 | [diff] [blame] | 3418 | |
| 3419 | ## |
Kevin Wolf | ec2f541 | 2018-02-05 14:59:05 +0100 | [diff] [blame] | 3420 | # @SshHostKeyCheckMode: |
| 3421 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 3422 | # @none: Don't check the host key at all |
| 3423 | # @hash: Compare the host key with a given hash |
| 3424 | # @known_hosts: Check the host key against the known_hosts file |
Kevin Wolf | ec2f541 | 2018-02-05 14:59:05 +0100 | [diff] [blame] | 3425 | # |
| 3426 | # Since: 2.12 |
| 3427 | ## |
| 3428 | { 'enum': 'SshHostKeyCheckMode', |
| 3429 | 'data': [ 'none', 'hash', 'known_hosts' ] } |
| 3430 | |
| 3431 | ## |
| 3432 | # @SshHostKeyCheckHashType: |
| 3433 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 3434 | # @md5: The given hash is an md5 hash |
| 3435 | # @sha1: The given hash is an sha1 hash |
Daniel P. Berrangé | bf78326 | 2021-06-22 12:51:56 +0100 | [diff] [blame] | 3436 | # @sha256: The given hash is an sha256 hash |
Kevin Wolf | ec2f541 | 2018-02-05 14:59:05 +0100 | [diff] [blame] | 3437 | # |
| 3438 | # Since: 2.12 |
| 3439 | ## |
| 3440 | { 'enum': 'SshHostKeyCheckHashType', |
Daniel P. Berrangé | bf78326 | 2021-06-22 12:51:56 +0100 | [diff] [blame] | 3441 | 'data': [ 'md5', 'sha1', 'sha256' ] } |
Kevin Wolf | ec2f541 | 2018-02-05 14:59:05 +0100 | [diff] [blame] | 3442 | |
| 3443 | ## |
| 3444 | # @SshHostKeyHash: |
| 3445 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 3446 | # @type: The hash algorithm used for the hash |
| 3447 | # @hash: The expected hash value |
Kevin Wolf | ec2f541 | 2018-02-05 14:59:05 +0100 | [diff] [blame] | 3448 | # |
| 3449 | # Since: 2.12 |
| 3450 | ## |
| 3451 | { 'struct': 'SshHostKeyHash', |
| 3452 | 'data': { 'type': 'SshHostKeyCheckHashType', |
| 3453 | 'hash': 'str' }} |
| 3454 | |
| 3455 | ## |
Kevin Wolf | ec2f541 | 2018-02-05 14:59:05 +0100 | [diff] [blame] | 3456 | # @SshHostKeyCheck: |
| 3457 | # |
| 3458 | # Since: 2.12 |
| 3459 | ## |
| 3460 | { 'union': 'SshHostKeyCheck', |
| 3461 | 'base': { 'mode': 'SshHostKeyCheckMode' }, |
| 3462 | 'discriminator': 'mode', |
Anton Nefedov | 29cd040 | 2018-06-18 11:40:06 +0300 | [diff] [blame] | 3463 | 'data': { 'hash': 'SshHostKeyHash' } } |
Kevin Wolf | ec2f541 | 2018-02-05 14:59:05 +0100 | [diff] [blame] | 3464 | |
| 3465 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3466 | # @BlockdevOptionsSsh: |
Ashijeet Acharya | ad0e90a | 2016-10-25 18:34:01 +0530 | [diff] [blame] | 3467 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 3468 | # @server: host address |
Ashijeet Acharya | ad0e90a | 2016-10-25 18:34:01 +0530 | [diff] [blame] | 3469 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 3470 | # @path: path to the image on the host |
Ashijeet Acharya | ad0e90a | 2016-10-25 18:34:01 +0530 | [diff] [blame] | 3471 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 3472 | # @user: user as which to connect, defaults to current local user name |
Ashijeet Acharya | ad0e90a | 2016-10-25 18:34:01 +0530 | [diff] [blame] | 3473 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 3474 | # @host-key-check: Defines how and what to check the host key against |
| 3475 | # (default: known_hosts) |
Ashijeet Acharya | ad0e90a | 2016-10-25 18:34:01 +0530 | [diff] [blame] | 3476 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3477 | # Since: 2.9 |
Ashijeet Acharya | ad0e90a | 2016-10-25 18:34:01 +0530 | [diff] [blame] | 3478 | ## |
| 3479 | { 'struct': 'BlockdevOptionsSsh', |
| 3480 | 'data': { 'server': 'InetSocketAddress', |
| 3481 | 'path': 'str', |
Kevin Wolf | ec2f541 | 2018-02-05 14:59:05 +0100 | [diff] [blame] | 3482 | '*user': 'str', |
| 3483 | '*host-key-check': 'SshHostKeyCheck' } } |
Ashijeet Acharya | ad0e90a | 2016-10-25 18:34:01 +0530 | [diff] [blame] | 3484 | |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3485 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3486 | # @BlkdebugEvent: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3487 | # |
| 3488 | # Trigger events supported by blkdebug. |
Eric Blake | a31939e | 2015-11-18 01:52:54 -0700 | [diff] [blame] | 3489 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3490 | # @l1_shrink_write_table: write zeros to the l1 table to shrink image. |
| 3491 | # (since 2.11) |
Pavel Butsykin | 46b732c | 2017-09-18 15:42:29 +0300 | [diff] [blame] | 3492 | # |
| 3493 | # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11) |
| 3494 | # |
Eric Blake | d855ebc | 2017-10-05 14:02:46 -0500 | [diff] [blame] | 3495 | # @cor_write: a write due to copy-on-read (since 2.11) |
| 3496 | # |
Anton Nefedov | c8bb23c | 2019-05-16 17:27:49 +0300 | [diff] [blame] | 3497 | # @cluster_alloc_space: an allocation of file space for a cluster (since 4.1) |
| 3498 | # |
Max Reitz | f8cec15 | 2019-05-07 22:35:05 +0200 | [diff] [blame] | 3499 | # @none: triggers once at creation of the blkdebug node (since 4.1) |
| 3500 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3501 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3502 | ## |
Eric Blake | a31939e | 2015-11-18 01:52:54 -0700 | [diff] [blame] | 3503 | { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG', |
Eric Blake | 5be5b77 | 2015-11-18 01:52:55 -0700 | [diff] [blame] | 3504 | 'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table', |
| 3505 | 'l1_grow_activate_table', 'l2_load', 'l2_update', |
| 3506 | 'l2_update_compressed', 'l2_alloc_cow_read', 'l2_alloc_write', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3507 | 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio', |
| 3508 | 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read', |
| 3509 | 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update', |
| 3510 | 'refblock_load', 'refblock_update', 'refblock_update_part', |
Eric Blake | 5be5b77 | 2015-11-18 01:52:55 -0700 | [diff] [blame] | 3511 | 'refblock_alloc', 'refblock_alloc_hookup', 'refblock_alloc_write', |
| 3512 | 'refblock_alloc_write_blocks', 'refblock_alloc_write_table', |
| 3513 | 'refblock_alloc_switch_table', 'cluster_alloc', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3514 | 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os', |
Eric Blake | 5be5b77 | 2015-11-18 01:52:55 -0700 | [diff] [blame] | 3515 | 'flush_to_disk', 'pwritev_rmw_head', 'pwritev_rmw_after_head', |
| 3516 | 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev', |
Pavel Butsykin | 46b732c | 2017-09-18 15:42:29 +0300 | [diff] [blame] | 3517 | 'pwritev_zero', 'pwritev_done', 'empty_image_prepare', |
Eric Blake | d855ebc | 2017-10-05 14:02:46 -0500 | [diff] [blame] | 3518 | 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters', |
Max Reitz | f8cec15 | 2019-05-07 22:35:05 +0200 | [diff] [blame] | 3519 | 'cor_write', 'cluster_alloc_space', 'none'] } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3520 | |
| 3521 | ## |
Max Reitz | 16789db | 2019-05-07 22:35:04 +0200 | [diff] [blame] | 3522 | # @BlkdebugIOType: |
| 3523 | # |
| 3524 | # Kinds of I/O that blkdebug can inject errors in. |
| 3525 | # |
| 3526 | # @read: .bdrv_co_preadv() |
| 3527 | # |
| 3528 | # @write: .bdrv_co_pwritev() |
| 3529 | # |
| 3530 | # @write-zeroes: .bdrv_co_pwrite_zeroes() |
| 3531 | # |
| 3532 | # @discard: .bdrv_co_pdiscard() |
| 3533 | # |
| 3534 | # @flush: .bdrv_co_flush_to_disk() |
| 3535 | # |
Max Reitz | 1adb0b5 | 2019-05-07 22:35:06 +0200 | [diff] [blame] | 3536 | # @block-status: .bdrv_co_block_status() |
| 3537 | # |
Max Reitz | 16789db | 2019-05-07 22:35:04 +0200 | [diff] [blame] | 3538 | # Since: 4.1 |
| 3539 | ## |
| 3540 | { 'enum': 'BlkdebugIOType', 'prefix': 'BLKDEBUG_IO_TYPE', |
Max Reitz | 1adb0b5 | 2019-05-07 22:35:06 +0200 | [diff] [blame] | 3541 | 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush', |
| 3542 | 'block-status' ] } |
Max Reitz | 16789db | 2019-05-07 22:35:04 +0200 | [diff] [blame] | 3543 | |
| 3544 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3545 | # @BlkdebugInjectErrorOptions: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3546 | # |
| 3547 | # Describes a single error injection for blkdebug. |
| 3548 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3549 | # @event: trigger event |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3550 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3551 | # @state: the state identifier blkdebug needs to be in to |
| 3552 | # actually trigger the event; defaults to "any" |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3553 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3554 | # @iotype: the type of I/O operations on which this error should |
| 3555 | # be injected; defaults to "all read, write, |
| 3556 | # write-zeroes, discard, and flush operations" |
| 3557 | # (since: 4.1) |
Max Reitz | 16789db | 2019-05-07 22:35:04 +0200 | [diff] [blame] | 3558 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3559 | # @errno: error identifier (errno) to be returned; defaults to |
| 3560 | # EIO |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3561 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3562 | # @sector: specifies the sector index which has to be affected |
| 3563 | # in order to actually trigger the event; defaults to "any |
| 3564 | # sector" |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3565 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3566 | # @once: disables further events after this one has been |
| 3567 | # triggered; defaults to false |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3568 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 3569 | # @immediately: fail immediately; defaults to false |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3570 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3571 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3572 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3573 | { 'struct': 'BlkdebugInjectErrorOptions', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3574 | 'data': { 'event': 'BlkdebugEvent', |
| 3575 | '*state': 'int', |
Max Reitz | 16789db | 2019-05-07 22:35:04 +0200 | [diff] [blame] | 3576 | '*iotype': 'BlkdebugIOType', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3577 | '*errno': 'int', |
| 3578 | '*sector': 'int', |
| 3579 | '*once': 'bool', |
| 3580 | '*immediately': 'bool' } } |
| 3581 | |
| 3582 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3583 | # @BlkdebugSetStateOptions: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3584 | # |
| 3585 | # Describes a single state-change event for blkdebug. |
| 3586 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3587 | # @event: trigger event |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3588 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3589 | # @state: the current state identifier blkdebug needs to be in; |
| 3590 | # defaults to "any" |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3591 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3592 | # @new_state: the state identifier blkdebug is supposed to assume if |
| 3593 | # this event is triggered |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3594 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3595 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3596 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3597 | { 'struct': 'BlkdebugSetStateOptions', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3598 | 'data': { 'event': 'BlkdebugEvent', |
| 3599 | '*state': 'int', |
| 3600 | 'new_state': 'int' } } |
| 3601 | |
| 3602 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3603 | # @BlockdevOptionsBlkdebug: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3604 | # |
| 3605 | # Driver specific block device options for blkdebug. |
| 3606 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3607 | # @image: underlying raw block device (or image file) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3608 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3609 | # @config: filename of the configuration file |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3610 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3611 | # @align: required alignment for requests in bytes, must be |
| 3612 | # positive power of 2, or 0 for default |
Eric Blake | 430b26a | 2017-04-29 14:14:18 -0500 | [diff] [blame] | 3613 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3614 | # @max-transfer: maximum size for I/O transfers in bytes, must be |
| 3615 | # positive multiple of @align and of the underlying |
| 3616 | # file's request alignment (but need not be a power of |
| 3617 | # 2), or 0 for default (since 2.10) |
Eric Blake | 430b26a | 2017-04-29 14:14:18 -0500 | [diff] [blame] | 3618 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3619 | # @opt-write-zero: preferred alignment for write zero requests in bytes, |
| 3620 | # must be positive multiple of @align and of the |
| 3621 | # underlying file's request alignment (but need not be a |
| 3622 | # power of 2), or 0 for default (since 2.10) |
Eric Blake | 430b26a | 2017-04-29 14:14:18 -0500 | [diff] [blame] | 3623 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3624 | # @max-write-zero: maximum size for write zero requests in bytes, must be |
| 3625 | # positive multiple of @align, of @opt-write-zero, and of |
| 3626 | # the underlying file's request alignment (but need not |
| 3627 | # be a power of 2), or 0 for default (since 2.10) |
Eric Blake | 430b26a | 2017-04-29 14:14:18 -0500 | [diff] [blame] | 3628 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3629 | # @opt-discard: preferred alignment for discard requests in bytes, must |
| 3630 | # be positive multiple of @align and of the underlying |
| 3631 | # file's request alignment (but need not be a power of |
| 3632 | # 2), or 0 for default (since 2.10) |
Eric Blake | 430b26a | 2017-04-29 14:14:18 -0500 | [diff] [blame] | 3633 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3634 | # @max-discard: maximum size for discard requests in bytes, must be |
| 3635 | # positive multiple of @align, of @opt-discard, and of |
| 3636 | # the underlying file's request alignment (but need not |
| 3637 | # be a power of 2), or 0 for default (since 2.10) |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3638 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3639 | # @inject-error: array of error injection descriptions |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3640 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3641 | # @set-state: array of state-change descriptions |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3642 | # |
Max Reitz | 69c6449 | 2019-11-08 13:34:53 +0100 | [diff] [blame] | 3643 | # @take-child-perms: Permissions to take on @image in addition to what |
| 3644 | # is necessary anyway (which depends on how the |
| 3645 | # blkdebug node is used). Defaults to none. |
| 3646 | # (since 5.0) |
| 3647 | # |
| 3648 | # @unshare-child-perms: Permissions not to share on @image in addition |
| 3649 | # to what cannot be shared anyway (which depends |
| 3650 | # on how the blkdebug node is used). Defaults |
| 3651 | # to none. (since 5.0) |
| 3652 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3653 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3654 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3655 | { 'struct': 'BlockdevOptionsBlkdebug', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3656 | 'data': { 'image': 'BlockdevRef', |
| 3657 | '*config': 'str', |
Eric Blake | 430b26a | 2017-04-29 14:14:18 -0500 | [diff] [blame] | 3658 | '*align': 'int', '*max-transfer': 'int32', |
| 3659 | '*opt-write-zero': 'int32', '*max-write-zero': 'int32', |
| 3660 | '*opt-discard': 'int32', '*max-discard': 'int32', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3661 | '*inject-error': ['BlkdebugInjectErrorOptions'], |
Max Reitz | 69c6449 | 2019-11-08 13:34:53 +0100 | [diff] [blame] | 3662 | '*set-state': ['BlkdebugSetStateOptions'], |
| 3663 | '*take-child-perms': ['BlockPermission'], |
| 3664 | '*unshare-child-perms': ['BlockPermission'] } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3665 | |
| 3666 | ## |
Aapo Vienamo | bfcc224 | 2018-07-03 17:48:48 +0300 | [diff] [blame] | 3667 | # @BlockdevOptionsBlklogwrites: |
| 3668 | # |
| 3669 | # Driver specific block device options for blklogwrites. |
| 3670 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3671 | # @file: block device |
Aapo Vienamo | bfcc224 | 2018-07-03 17:48:48 +0300 | [diff] [blame] | 3672 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3673 | # @log: block device used to log writes to @file |
Aapo Vienamo | bfcc224 | 2018-07-03 17:48:48 +0300 | [diff] [blame] | 3674 | # |
| 3675 | # @log-sector-size: sector size used in logging writes to @file, determines |
| 3676 | # granularity of offsets and sizes of writes (default: 512) |
| 3677 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3678 | # @log-append: append to an existing log (default: false) |
Ari Sundholm | 7769eaa | 2018-07-06 17:01:36 +0300 | [diff] [blame] | 3679 | # |
Ari Sundholm | 1dce698 | 2018-07-04 17:59:36 +0300 | [diff] [blame] | 3680 | # @log-super-update-interval: interval of write requests after which the log |
| 3681 | # super block is updated to disk (default: 4096) |
| 3682 | # |
Aapo Vienamo | bfcc224 | 2018-07-03 17:48:48 +0300 | [diff] [blame] | 3683 | # Since: 3.0 |
| 3684 | ## |
| 3685 | { 'struct': 'BlockdevOptionsBlklogwrites', |
| 3686 | 'data': { 'file': 'BlockdevRef', |
| 3687 | 'log': 'BlockdevRef', |
Ari Sundholm | 0878b3c | 2018-07-04 17:59:35 +0300 | [diff] [blame] | 3688 | '*log-sector-size': 'uint32', |
Ari Sundholm | 1dce698 | 2018-07-04 17:59:36 +0300 | [diff] [blame] | 3689 | '*log-append': 'bool', |
| 3690 | '*log-super-update-interval': 'uint64' } } |
Aapo Vienamo | bfcc224 | 2018-07-03 17:48:48 +0300 | [diff] [blame] | 3691 | |
| 3692 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3693 | # @BlockdevOptionsBlkverify: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3694 | # |
| 3695 | # Driver specific block device options for blkverify. |
| 3696 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3697 | # @test: block device to be tested |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3698 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3699 | # @raw: raw image used for verification |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3700 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3701 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3702 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3703 | { 'struct': 'BlockdevOptionsBlkverify', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3704 | 'data': { 'test': 'BlockdevRef', |
| 3705 | 'raw': 'BlockdevRef' } } |
| 3706 | |
| 3707 | ## |
Pavel Dovgalyuk | 35e32d9 | 2019-10-16 11:40:39 +0300 | [diff] [blame] | 3708 | # @BlockdevOptionsBlkreplay: |
| 3709 | # |
| 3710 | # Driver specific block device options for blkreplay. |
| 3711 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3712 | # @image: disk image which should be controlled with blkreplay |
Pavel Dovgalyuk | 35e32d9 | 2019-10-16 11:40:39 +0300 | [diff] [blame] | 3713 | # |
| 3714 | # Since: 4.2 |
| 3715 | ## |
| 3716 | { 'struct': 'BlockdevOptionsBlkreplay', |
| 3717 | 'data': { 'image': 'BlockdevRef' } } |
| 3718 | |
| 3719 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3720 | # @QuorumReadPattern: |
Liu Yuan | 62c6031 | 2014-08-18 17:41:04 +0800 | [diff] [blame] | 3721 | # |
| 3722 | # An enumeration of quorum read patterns. |
| 3723 | # |
| 3724 | # @quorum: read all the children and do a quorum vote on reads |
| 3725 | # |
| 3726 | # @fifo: read only from the first child that has not failed |
| 3727 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3728 | # Since: 2.9 |
Liu Yuan | 62c6031 | 2014-08-18 17:41:04 +0800 | [diff] [blame] | 3729 | ## |
| 3730 | { 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] } |
| 3731 | |
| 3732 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3733 | # @BlockdevOptionsQuorum: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3734 | # |
| 3735 | # Driver specific block device options for Quorum |
| 3736 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3737 | # @blkverify: true if the driver must print content mismatch |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3738 | # set to false by default |
| 3739 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3740 | # @children: the children block devices to use |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3741 | # |
| 3742 | # @vote-threshold: the vote limit under which a read will fail |
| 3743 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 3744 | # @rewrite-corrupted: rewrite corrupted data when quorum is reached |
Benoît Canet | cf29a57 | 2014-06-11 15:24:10 +0200 | [diff] [blame] | 3745 | # (Since 2.1) |
| 3746 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 3747 | # @read-pattern: choose read pattern and set to quorum by default |
Liu Yuan | 62c6031 | 2014-08-18 17:41:04 +0800 | [diff] [blame] | 3748 | # (Since 2.2) |
| 3749 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3750 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3751 | ## |
Eric Blake | 895a2a8 | 2015-05-04 09:05:27 -0600 | [diff] [blame] | 3752 | { 'struct': 'BlockdevOptionsQuorum', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3753 | 'data': { '*blkverify': 'bool', |
| 3754 | 'children': [ 'BlockdevRef' ], |
Liu Yuan | 62c6031 | 2014-08-18 17:41:04 +0800 | [diff] [blame] | 3755 | 'vote-threshold': 'int', |
| 3756 | '*rewrite-corrupted': 'bool', |
| 3757 | '*read-pattern': 'QuorumReadPattern' } } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 3758 | |
| 3759 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 3760 | # @BlockdevOptionsGluster: |
Prasanna Kumar Kalever | 7edac2d | 2016-07-19 22:27:32 +0530 | [diff] [blame] | 3761 | # |
| 3762 | # Driver specific block device options for Gluster |
| 3763 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3764 | # @volume: name of gluster volume where VM image resides |
Prasanna Kumar Kalever | 7edac2d | 2016-07-19 22:27:32 +0530 | [diff] [blame] | 3765 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3766 | # @path: absolute path to image file in gluster volume |
Prasanna Kumar Kalever | 7edac2d | 2016-07-19 22:27:32 +0530 | [diff] [blame] | 3767 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3768 | # @server: gluster servers description |
Prasanna Kumar Kalever | 7edac2d | 2016-07-19 22:27:32 +0530 | [diff] [blame] | 3769 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3770 | # @debug: libgfapi log level (default '4' which is Error) |
| 3771 | # (Since 2.8) |
Prasanna Kumar Kalever | 7edac2d | 2016-07-19 22:27:32 +0530 | [diff] [blame] | 3772 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3773 | # @logfile: libgfapi log file (default /dev/stderr) (Since 2.8) |
Prasanna Kumar Kalever | e9db8ff | 2016-07-22 20:26:48 +0530 | [diff] [blame] | 3774 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 3775 | # Since: 2.9 |
Prasanna Kumar Kalever | 7edac2d | 2016-07-19 22:27:32 +0530 | [diff] [blame] | 3776 | ## |
| 3777 | { 'struct': 'BlockdevOptionsGluster', |
| 3778 | 'data': { 'volume': 'str', |
| 3779 | 'path': 'str', |
Markus Armbruster | 62cf396 | 2017-04-26 09:36:40 +0200 | [diff] [blame] | 3780 | 'server': ['SocketAddress'], |
Prasanna Kumar Kalever | 1a417e4 | 2016-11-02 22:20:36 +0530 | [diff] [blame] | 3781 | '*debug': 'int', |
Prasanna Kumar Kalever | e9db8ff | 2016-07-22 20:26:48 +0530 | [diff] [blame] | 3782 | '*logfile': 'str' } } |
Prasanna Kumar Kalever | 7edac2d | 2016-07-19 22:27:32 +0530 | [diff] [blame] | 3783 | |
| 3784 | ## |
Stefan Hajnoczi | fd66dbd | 2022-10-13 14:58:57 -0400 | [diff] [blame] | 3785 | # @BlockdevOptionsIoUring: |
| 3786 | # |
| 3787 | # Driver specific block device options for the io_uring backend. |
| 3788 | # |
| 3789 | # @filename: path to the image file |
| 3790 | # |
| 3791 | # Since: 7.2 |
| 3792 | ## |
| 3793 | { 'struct': 'BlockdevOptionsIoUring', |
| 3794 | 'data': { 'filename': 'str' }, |
| 3795 | 'if': 'CONFIG_BLKIO' } |
| 3796 | |
| 3797 | ## |
| 3798 | # @BlockdevOptionsNvmeIoUring: |
| 3799 | # |
| 3800 | # Driver specific block device options for the nvme-io_uring backend. |
| 3801 | # |
Alberto Faria | c785326 | 2022-11-08 14:23:47 +0000 | [diff] [blame] | 3802 | # @path: path to the NVMe namespace's character device (e.g. /dev/ng0n1). |
Stefan Hajnoczi | fd66dbd | 2022-10-13 14:58:57 -0400 | [diff] [blame] | 3803 | # |
| 3804 | # Since: 7.2 |
| 3805 | ## |
| 3806 | { 'struct': 'BlockdevOptionsNvmeIoUring', |
Alberto Faria | 6c32fc0 | 2022-10-29 00:38:54 +0100 | [diff] [blame] | 3807 | 'data': { 'path': 'str' }, |
Stefan Hajnoczi | fd66dbd | 2022-10-13 14:58:57 -0400 | [diff] [blame] | 3808 | 'if': 'CONFIG_BLKIO' } |
| 3809 | |
| 3810 | ## |
Alberto Faria | 03d9e4c | 2022-10-28 14:16:35 +0100 | [diff] [blame] | 3811 | # @BlockdevOptionsVirtioBlkVfioPci: |
| 3812 | # |
| 3813 | # Driver specific block device options for the virtio-blk-vfio-pci backend. |
| 3814 | # |
| 3815 | # @path: path to the PCI device's sysfs directory (e.g. |
| 3816 | # /sys/bus/pci/devices/0000:00:01.0). |
| 3817 | # |
| 3818 | # Since: 7.2 |
| 3819 | ## |
| 3820 | { 'struct': 'BlockdevOptionsVirtioBlkVfioPci', |
| 3821 | 'data': { 'path': 'str' }, |
| 3822 | 'if': 'CONFIG_BLKIO' } |
| 3823 | |
| 3824 | ## |
Stefan Hajnoczi | fd66dbd | 2022-10-13 14:58:57 -0400 | [diff] [blame] | 3825 | # @BlockdevOptionsVirtioBlkVhostUser: |
| 3826 | # |
| 3827 | # Driver specific block device options for the virtio-blk-vhost-user backend. |
| 3828 | # |
| 3829 | # @path: path to the vhost-user UNIX domain socket. |
| 3830 | # |
| 3831 | # Since: 7.2 |
| 3832 | ## |
| 3833 | { 'struct': 'BlockdevOptionsVirtioBlkVhostUser', |
| 3834 | 'data': { 'path': 'str' }, |
| 3835 | 'if': 'CONFIG_BLKIO' } |
| 3836 | |
| 3837 | ## |
| 3838 | # @BlockdevOptionsVirtioBlkVhostVdpa: |
| 3839 | # |
| 3840 | # Driver specific block device options for the virtio-blk-vhost-vdpa backend. |
| 3841 | # |
| 3842 | # @path: path to the vhost-vdpa character device. |
| 3843 | # |
| 3844 | # Since: 7.2 |
| 3845 | ## |
| 3846 | { 'struct': 'BlockdevOptionsVirtioBlkVhostVdpa', |
| 3847 | 'data': { 'path': 'str' }, |
| 3848 | 'if': 'CONFIG_BLKIO' } |
| 3849 | |
| 3850 | ## |
Kevin Wolf | 31eb120 | 2016-12-08 14:23:11 +0100 | [diff] [blame] | 3851 | # @IscsiTransport: |
| 3852 | # |
| 3853 | # An enumeration of libiscsi transport types |
| 3854 | # |
| 3855 | # Since: 2.9 |
| 3856 | ## |
| 3857 | { 'enum': 'IscsiTransport', |
| 3858 | 'data': [ 'tcp', 'iser' ] } |
| 3859 | |
| 3860 | ## |
| 3861 | # @IscsiHeaderDigest: |
| 3862 | # |
| 3863 | # An enumeration of header digests supported by libiscsi |
| 3864 | # |
| 3865 | # Since: 2.9 |
| 3866 | ## |
| 3867 | { 'enum': 'IscsiHeaderDigest', |
| 3868 | 'prefix': 'QAPI_ISCSI_HEADER_DIGEST', |
| 3869 | 'data': [ 'crc32c', 'none', 'crc32c-none', 'none-crc32c' ] } |
| 3870 | |
| 3871 | ## |
| 3872 | # @BlockdevOptionsIscsi: |
| 3873 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3874 | # @transport: The iscsi transport type |
Kevin Wolf | 31eb120 | 2016-12-08 14:23:11 +0100 | [diff] [blame] | 3875 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3876 | # @portal: The address of the iscsi portal |
Kevin Wolf | 31eb120 | 2016-12-08 14:23:11 +0100 | [diff] [blame] | 3877 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3878 | # @target: The target iqn name |
Kevin Wolf | 31eb120 | 2016-12-08 14:23:11 +0100 | [diff] [blame] | 3879 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3880 | # @lun: LUN to connect to. Defaults to 0. |
Kevin Wolf | 31eb120 | 2016-12-08 14:23:11 +0100 | [diff] [blame] | 3881 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3882 | # @user: User name to log in with. If omitted, no CHAP |
| 3883 | # authentication is performed. |
Kevin Wolf | 31eb120 | 2016-12-08 14:23:11 +0100 | [diff] [blame] | 3884 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 3885 | # @password-secret: The ID of a QCryptoSecret object providing |
Kevin Wolf | 31eb120 | 2016-12-08 14:23:11 +0100 | [diff] [blame] | 3886 | # the password for the login. This option is required if |
| 3887 | # @user is specified. |
| 3888 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3889 | # @initiator-name: The iqn name we want to identify to the target |
| 3890 | # as. If this option is not specified, an initiator name is |
| 3891 | # generated automatically. |
Kevin Wolf | 31eb120 | 2016-12-08 14:23:11 +0100 | [diff] [blame] | 3892 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3893 | # @header-digest: The desired header digest. Defaults to |
| 3894 | # none-crc32c. |
Kevin Wolf | 31eb120 | 2016-12-08 14:23:11 +0100 | [diff] [blame] | 3895 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 3896 | # @timeout: Timeout in seconds after which a request will |
| 3897 | # timeout. 0 means no timeout and is the default. |
Kevin Wolf | 31eb120 | 2016-12-08 14:23:11 +0100 | [diff] [blame] | 3898 | # |
| 3899 | # Driver specific block device options for iscsi |
| 3900 | # |
| 3901 | # Since: 2.9 |
| 3902 | ## |
| 3903 | { 'struct': 'BlockdevOptionsIscsi', |
| 3904 | 'data': { 'transport': 'IscsiTransport', |
| 3905 | 'portal': 'str', |
| 3906 | 'target': 'str', |
| 3907 | '*lun': 'int', |
| 3908 | '*user': 'str', |
| 3909 | '*password-secret': 'str', |
| 3910 | '*initiator-name': 'str', |
| 3911 | '*header-digest': 'IscsiHeaderDigest', |
| 3912 | '*timeout': 'int' } } |
| 3913 | |
Jeff Cody | 0a55679 | 2017-02-27 12:36:46 -0500 | [diff] [blame] | 3914 | ## |
Markus Armbruster | a3699de | 2018-06-14 21:14:42 +0200 | [diff] [blame] | 3915 | # @RbdAuthMode: |
| 3916 | # |
| 3917 | # Since: 3.0 |
| 3918 | ## |
| 3919 | { 'enum': 'RbdAuthMode', |
| 3920 | 'data': [ 'cephx', 'none' ] } |
| 3921 | |
| 3922 | ## |
Or Ozeri | 42e4ac9 | 2021-06-27 14:46:35 +0300 | [diff] [blame] | 3923 | # @RbdImageEncryptionFormat: |
| 3924 | # |
Or Ozeri | b8f218e | 2023-01-29 05:31:19 -0600 | [diff] [blame] | 3925 | # @luks-any: Used for opening either luks or luks2 (Since 8.0) |
| 3926 | # |
Or Ozeri | 42e4ac9 | 2021-06-27 14:46:35 +0300 | [diff] [blame] | 3927 | # Since: 6.1 |
| 3928 | ## |
| 3929 | { 'enum': 'RbdImageEncryptionFormat', |
Or Ozeri | b8f218e | 2023-01-29 05:31:19 -0600 | [diff] [blame] | 3930 | 'data': [ 'luks', 'luks2', 'luks-any' ] } |
Or Ozeri | 42e4ac9 | 2021-06-27 14:46:35 +0300 | [diff] [blame] | 3931 | |
| 3932 | ## |
| 3933 | # @RbdEncryptionOptionsLUKSBase: |
| 3934 | # |
| 3935 | # @key-secret: ID of a QCryptoSecret object providing a passphrase |
| 3936 | # for unlocking the encryption |
| 3937 | # |
| 3938 | # Since: 6.1 |
| 3939 | ## |
| 3940 | { 'struct': 'RbdEncryptionOptionsLUKSBase', |
| 3941 | 'data': { 'key-secret': 'str' } } |
| 3942 | |
| 3943 | ## |
| 3944 | # @RbdEncryptionCreateOptionsLUKSBase: |
| 3945 | # |
| 3946 | # @cipher-alg: The encryption algorithm |
| 3947 | # |
| 3948 | # Since: 6.1 |
| 3949 | ## |
| 3950 | { 'struct': 'RbdEncryptionCreateOptionsLUKSBase', |
| 3951 | 'base': 'RbdEncryptionOptionsLUKSBase', |
| 3952 | 'data': { '*cipher-alg': 'QCryptoCipherAlgorithm' } } |
| 3953 | |
| 3954 | ## |
| 3955 | # @RbdEncryptionOptionsLUKS: |
| 3956 | # |
| 3957 | # Since: 6.1 |
| 3958 | ## |
| 3959 | { 'struct': 'RbdEncryptionOptionsLUKS', |
| 3960 | 'base': 'RbdEncryptionOptionsLUKSBase', |
| 3961 | 'data': { } } |
| 3962 | |
| 3963 | ## |
| 3964 | # @RbdEncryptionOptionsLUKS2: |
| 3965 | # |
| 3966 | # Since: 6.1 |
| 3967 | ## |
| 3968 | { 'struct': 'RbdEncryptionOptionsLUKS2', |
| 3969 | 'base': 'RbdEncryptionOptionsLUKSBase', |
| 3970 | 'data': { } } |
| 3971 | |
| 3972 | ## |
Or Ozeri | b8f218e | 2023-01-29 05:31:19 -0600 | [diff] [blame] | 3973 | # @RbdEncryptionOptionsLUKSAny: |
| 3974 | # |
| 3975 | # Since: 8.0 |
| 3976 | ## |
| 3977 | { 'struct': 'RbdEncryptionOptionsLUKSAny', |
| 3978 | 'base': 'RbdEncryptionOptionsLUKSBase', |
| 3979 | 'data': { } } |
| 3980 | |
| 3981 | ## |
Or Ozeri | 42e4ac9 | 2021-06-27 14:46:35 +0300 | [diff] [blame] | 3982 | # @RbdEncryptionCreateOptionsLUKS: |
| 3983 | # |
| 3984 | # Since: 6.1 |
| 3985 | ## |
| 3986 | { 'struct': 'RbdEncryptionCreateOptionsLUKS', |
| 3987 | 'base': 'RbdEncryptionCreateOptionsLUKSBase', |
| 3988 | 'data': { } } |
| 3989 | |
| 3990 | ## |
| 3991 | # @RbdEncryptionCreateOptionsLUKS2: |
| 3992 | # |
| 3993 | # Since: 6.1 |
| 3994 | ## |
| 3995 | { 'struct': 'RbdEncryptionCreateOptionsLUKS2', |
| 3996 | 'base': 'RbdEncryptionCreateOptionsLUKSBase', |
| 3997 | 'data': { } } |
| 3998 | |
| 3999 | ## |
| 4000 | # @RbdEncryptionOptions: |
| 4001 | # |
Or Ozeri | 0f385a2 | 2023-01-29 05:31:20 -0600 | [diff] [blame] | 4002 | # @format: Encryption format. |
| 4003 | # |
| 4004 | # @parent: Parent image encryption options (for cloned images). |
| 4005 | # Can be left unspecified if this cloned image is encrypted |
| 4006 | # using the same format and secret as its parent image (i.e. |
| 4007 | # not explicitly formatted) or if its parent image is not |
| 4008 | # encrypted. (Since 8.0) |
| 4009 | # |
Or Ozeri | 42e4ac9 | 2021-06-27 14:46:35 +0300 | [diff] [blame] | 4010 | # Since: 6.1 |
| 4011 | ## |
| 4012 | { 'union': 'RbdEncryptionOptions', |
Or Ozeri | 0f385a2 | 2023-01-29 05:31:20 -0600 | [diff] [blame] | 4013 | 'base': { 'format': 'RbdImageEncryptionFormat', |
| 4014 | '*parent': 'RbdEncryptionOptions' }, |
Or Ozeri | 42e4ac9 | 2021-06-27 14:46:35 +0300 | [diff] [blame] | 4015 | 'discriminator': 'format', |
| 4016 | 'data': { 'luks': 'RbdEncryptionOptionsLUKS', |
Or Ozeri | b8f218e | 2023-01-29 05:31:19 -0600 | [diff] [blame] | 4017 | 'luks2': 'RbdEncryptionOptionsLUKS2', |
| 4018 | 'luks-any': 'RbdEncryptionOptionsLUKSAny'} } |
Or Ozeri | 42e4ac9 | 2021-06-27 14:46:35 +0300 | [diff] [blame] | 4019 | |
| 4020 | ## |
| 4021 | # @RbdEncryptionCreateOptions: |
| 4022 | # |
| 4023 | # Since: 6.1 |
| 4024 | ## |
| 4025 | { 'union': 'RbdEncryptionCreateOptions', |
| 4026 | 'base': { 'format': 'RbdImageEncryptionFormat' }, |
| 4027 | 'discriminator': 'format', |
| 4028 | 'data': { 'luks': 'RbdEncryptionCreateOptionsLUKS', |
| 4029 | 'luks2': 'RbdEncryptionCreateOptionsLUKS2' } } |
| 4030 | |
| 4031 | ## |
Jeff Cody | 8a47e8e | 2017-02-27 01:16:41 -0500 | [diff] [blame] | 4032 | # @BlockdevOptionsRbd: |
| 4033 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4034 | # @pool: Ceph pool name. |
Jeff Cody | 8a47e8e | 2017-02-27 01:16:41 -0500 | [diff] [blame] | 4035 | # |
Florian Florensa | 19ae9ae | 2020-01-10 12:15:13 +0100 | [diff] [blame] | 4036 | # @namespace: Rados namespace name in the Ceph pool. (Since 5.0) |
| 4037 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4038 | # @image: Image name in the Ceph pool. |
Jeff Cody | 8a47e8e | 2017-02-27 01:16:41 -0500 | [diff] [blame] | 4039 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4040 | # @conf: path to Ceph configuration file. Values |
| 4041 | # in the configuration file will be overridden by |
| 4042 | # options specified via QAPI. |
Jeff Cody | 8a47e8e | 2017-02-27 01:16:41 -0500 | [diff] [blame] | 4043 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4044 | # @snapshot: Ceph snapshot name. |
Jeff Cody | 8a47e8e | 2017-02-27 01:16:41 -0500 | [diff] [blame] | 4045 | # |
Or Ozeri | 42e4ac9 | 2021-06-27 14:46:35 +0300 | [diff] [blame] | 4046 | # @encrypt: Image encryption options. (Since 6.1) |
| 4047 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4048 | # @user: Ceph id name. |
Jeff Cody | 8a47e8e | 2017-02-27 01:16:41 -0500 | [diff] [blame] | 4049 | # |
Markus Armbruster | a3699de | 2018-06-14 21:14:42 +0200 | [diff] [blame] | 4050 | # @auth-client-required: Acceptable authentication modes. |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4051 | # This maps to Ceph configuration option |
| 4052 | # "auth_client_required". (Since 3.0) |
Markus Armbruster | a3699de | 2018-06-14 21:14:42 +0200 | [diff] [blame] | 4053 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4054 | # @key-secret: ID of a QCryptoSecret object providing a key |
| 4055 | # for cephx authentication. |
| 4056 | # This maps to Ceph configuration option |
| 4057 | # "key". (Since 3.0) |
Markus Armbruster | d083f95 | 2018-06-14 21:14:43 +0200 | [diff] [blame] | 4058 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4059 | # @server: Monitor host address and port. This maps |
| 4060 | # to the "mon_host" Ceph option. |
Jeff Cody | 0a55679 | 2017-02-27 12:36:46 -0500 | [diff] [blame] | 4061 | # |
Jeff Cody | 8a47e8e | 2017-02-27 01:16:41 -0500 | [diff] [blame] | 4062 | # Since: 2.9 |
| 4063 | ## |
| 4064 | { 'struct': 'BlockdevOptionsRbd', |
| 4065 | 'data': { 'pool': 'str', |
Florian Florensa | 19ae9ae | 2020-01-10 12:15:13 +0100 | [diff] [blame] | 4066 | '*namespace': 'str', |
Jeff Cody | 8a47e8e | 2017-02-27 01:16:41 -0500 | [diff] [blame] | 4067 | 'image': 'str', |
| 4068 | '*conf': 'str', |
| 4069 | '*snapshot': 'str', |
Or Ozeri | 42e4ac9 | 2021-06-27 14:46:35 +0300 | [diff] [blame] | 4070 | '*encrypt': 'RbdEncryptionOptions', |
Jeff Cody | 8a47e8e | 2017-02-27 01:16:41 -0500 | [diff] [blame] | 4071 | '*user': 'str', |
Markus Armbruster | a3699de | 2018-06-14 21:14:42 +0200 | [diff] [blame] | 4072 | '*auth-client-required': ['RbdAuthMode'], |
Markus Armbruster | d083f95 | 2018-06-14 21:14:43 +0200 | [diff] [blame] | 4073 | '*key-secret': 'str', |
Markus Armbruster | 577d8c9 | 2017-03-28 10:56:07 +0200 | [diff] [blame] | 4074 | '*server': ['InetSocketAddressBase'] } } |
Jeff Cody | 8a47e8e | 2017-02-27 01:16:41 -0500 | [diff] [blame] | 4075 | |
Kevin Wolf | 31eb120 | 2016-12-08 14:23:11 +0100 | [diff] [blame] | 4076 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 4077 | # @ReplicationMode: |
Changlong Xie | 190b9a8 | 2016-07-27 15:01:49 +0800 | [diff] [blame] | 4078 | # |
| 4079 | # An enumeration of replication modes. |
| 4080 | # |
| 4081 | # @primary: Primary mode, the vm's state will be sent to secondary QEMU. |
| 4082 | # |
| 4083 | # @secondary: Secondary mode, receive the vm's state from primary QEMU. |
| 4084 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4085 | # Since: 2.9 |
Changlong Xie | 190b9a8 | 2016-07-27 15:01:49 +0800 | [diff] [blame] | 4086 | ## |
Marc-André Lureau | 335d10c | 2018-12-13 16:37:24 +0400 | [diff] [blame] | 4087 | { 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ], |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 4088 | 'if': 'CONFIG_REPLICATION' } |
Changlong Xie | 190b9a8 | 2016-07-27 15:01:49 +0800 | [diff] [blame] | 4089 | |
| 4090 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 4091 | # @BlockdevOptionsReplication: |
Wen Congyang | 82ac554 | 2016-07-27 15:01:52 +0800 | [diff] [blame] | 4092 | # |
| 4093 | # Driver specific block device options for replication |
| 4094 | # |
| 4095 | # @mode: the replication mode |
| 4096 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 4097 | # @top-id: In secondary mode, node name or device ID of the root |
Changlong Xie | f4f2539 | 2016-10-12 12:50:08 +0800 | [diff] [blame] | 4098 | # node who owns the replication node chain. Must not be given in |
| 4099 | # primary mode. |
Wen Congyang | 82ac554 | 2016-07-27 15:01:52 +0800 | [diff] [blame] | 4100 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4101 | # Since: 2.9 |
Wen Congyang | 82ac554 | 2016-07-27 15:01:52 +0800 | [diff] [blame] | 4102 | ## |
| 4103 | { 'struct': 'BlockdevOptionsReplication', |
| 4104 | 'base': 'BlockdevOptionsGenericFormat', |
| 4105 | 'data': { 'mode': 'ReplicationMode', |
Marc-André Lureau | 335d10c | 2018-12-13 16:37:24 +0400 | [diff] [blame] | 4106 | '*top-id': 'str' }, |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 4107 | 'if': 'CONFIG_REPLICATION' } |
Wen Congyang | 82ac554 | 2016-07-27 15:01:52 +0800 | [diff] [blame] | 4108 | |
| 4109 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 4110 | # @NFSTransport: |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4111 | # |
| 4112 | # An enumeration of NFS transport types |
| 4113 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4114 | # @inet: TCP transport |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4115 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4116 | # Since: 2.9 |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4117 | ## |
| 4118 | { 'enum': 'NFSTransport', |
| 4119 | 'data': [ 'inet' ] } |
| 4120 | |
| 4121 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 4122 | # @NFSServer: |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4123 | # |
| 4124 | # Captures the address of the socket |
| 4125 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4126 | # @type: transport type used for NFS (only TCP supported) |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4127 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4128 | # @host: host address for NFS server |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4129 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4130 | # Since: 2.9 |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4131 | ## |
| 4132 | { 'struct': 'NFSServer', |
| 4133 | 'data': { 'type': 'NFSTransport', |
| 4134 | 'host': 'str' } } |
| 4135 | |
| 4136 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 4137 | # @BlockdevOptionsNfs: |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4138 | # |
| 4139 | # Driver specific block device option for NFS |
| 4140 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4141 | # @server: host address |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4142 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4143 | # @path: path of the image on the host |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4144 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4145 | # @user: UID value to use when talking to the |
| 4146 | # server (defaults to 65534 on Windows and getuid() |
| 4147 | # on unix) |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4148 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4149 | # @group: GID value to use when talking to the |
| 4150 | # server (defaults to 65534 on Windows and getgid() |
| 4151 | # in unix) |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4152 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4153 | # @tcp-syn-count: number of SYNs during the session |
| 4154 | # establishment (defaults to libnfs default) |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4155 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4156 | # @readahead-size: set the readahead size in bytes (defaults |
| 4157 | # to libnfs default) |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4158 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4159 | # @page-cache-size: set the pagecache size in bytes (defaults |
| 4160 | # to libnfs default) |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4161 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4162 | # @debug: set the NFS debug level (max 2) (defaults |
| 4163 | # to libnfs default) |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4164 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4165 | # Since: 2.9 |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4166 | ## |
| 4167 | { 'struct': 'BlockdevOptionsNfs', |
| 4168 | 'data': { 'server': 'NFSServer', |
| 4169 | 'path': 'str', |
| 4170 | '*user': 'int', |
| 4171 | '*group': 'int', |
| 4172 | '*tcp-syn-count': 'int', |
| 4173 | '*readahead-size': 'int', |
| 4174 | '*page-cache-size': 'int', |
Prasanna Kumar Kalever | 7103d91 | 2016-11-02 22:20:37 +0530 | [diff] [blame] | 4175 | '*debug': 'int' } } |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4176 | |
| 4177 | ## |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4178 | # @BlockdevOptionsCurlBase: |
Kevin Wolf | 6855528 | 2016-09-08 13:08:20 +0200 | [diff] [blame] | 4179 | # |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4180 | # Driver specific block device options shared by all protocols supported by the |
| 4181 | # curl backend. |
Kevin Wolf | 6855528 | 2016-09-08 13:08:20 +0200 | [diff] [blame] | 4182 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4183 | # @url: URL of the image file |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4184 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4185 | # @readahead: Size of the read-ahead cache; must be a multiple of |
| 4186 | # 512 (defaults to 256 kB) |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4187 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4188 | # @timeout: Timeout for connections, in seconds (defaults to 5) |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4189 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4190 | # @username: Username for authentication (defaults to none) |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4191 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4192 | # @password-secret: ID of a QCryptoSecret object providing a password |
| 4193 | # for authentication (defaults to no password) |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4194 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4195 | # @proxy-username: Username for proxy authentication (defaults to none) |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4196 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4197 | # @proxy-password-secret: ID of a QCryptoSecret object providing a password |
| 4198 | # for proxy authentication (defaults to no password) |
Kevin Wolf | 6855528 | 2016-09-08 13:08:20 +0200 | [diff] [blame] | 4199 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4200 | # Since: 2.9 |
Kevin Wolf | 6855528 | 2016-09-08 13:08:20 +0200 | [diff] [blame] | 4201 | ## |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4202 | { 'struct': 'BlockdevOptionsCurlBase', |
| 4203 | 'data': { 'url': 'str', |
| 4204 | '*readahead': 'int', |
| 4205 | '*timeout': 'int', |
| 4206 | '*username': 'str', |
| 4207 | '*password-secret': 'str', |
| 4208 | '*proxy-username': 'str', |
| 4209 | '*proxy-password-secret': 'str' } } |
| 4210 | |
| 4211 | ## |
| 4212 | # @BlockdevOptionsCurlHttp: |
| 4213 | # |
| 4214 | # Driver specific block device options for HTTP connections over the curl |
| 4215 | # backend. URLs must start with "http://". |
| 4216 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4217 | # @cookie: List of cookies to set; format is |
| 4218 | # "name1=content1; name2=content2;" as explained by |
| 4219 | # CURLOPT_COOKIE(3). Defaults to no cookies. |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4220 | # |
Peter Krempa | 327c8eb | 2017-05-04 16:00:06 +0200 | [diff] [blame] | 4221 | # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a |
| 4222 | # secure way. See @cookie for the format. (since 2.10) |
| 4223 | # |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4224 | # Since: 2.9 |
| 4225 | ## |
| 4226 | { 'struct': 'BlockdevOptionsCurlHttp', |
| 4227 | 'base': 'BlockdevOptionsCurlBase', |
Peter Krempa | 327c8eb | 2017-05-04 16:00:06 +0200 | [diff] [blame] | 4228 | 'data': { '*cookie': 'str', |
| 4229 | '*cookie-secret': 'str'} } |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4230 | |
| 4231 | ## |
| 4232 | # @BlockdevOptionsCurlHttps: |
| 4233 | # |
| 4234 | # Driver specific block device options for HTTPS connections over the curl |
| 4235 | # backend. URLs must start with "https://". |
| 4236 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4237 | # @cookie: List of cookies to set; format is |
| 4238 | # "name1=content1; name2=content2;" as explained by |
| 4239 | # CURLOPT_COOKIE(3). Defaults to no cookies. |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4240 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4241 | # @sslverify: Whether to verify the SSL certificate's validity (defaults to |
| 4242 | # true) |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4243 | # |
Peter Krempa | 327c8eb | 2017-05-04 16:00:06 +0200 | [diff] [blame] | 4244 | # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a |
| 4245 | # secure way. See @cookie for the format. (since 2.10) |
| 4246 | # |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4247 | # Since: 2.9 |
| 4248 | ## |
| 4249 | { 'struct': 'BlockdevOptionsCurlHttps', |
| 4250 | 'base': 'BlockdevOptionsCurlBase', |
| 4251 | 'data': { '*cookie': 'str', |
Peter Krempa | 327c8eb | 2017-05-04 16:00:06 +0200 | [diff] [blame] | 4252 | '*sslverify': 'bool', |
| 4253 | '*cookie-secret': 'str'} } |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4254 | |
| 4255 | ## |
| 4256 | # @BlockdevOptionsCurlFtp: |
| 4257 | # |
| 4258 | # Driver specific block device options for FTP connections over the curl |
| 4259 | # backend. URLs must start with "ftp://". |
| 4260 | # |
| 4261 | # Since: 2.9 |
| 4262 | ## |
| 4263 | { 'struct': 'BlockdevOptionsCurlFtp', |
| 4264 | 'base': 'BlockdevOptionsCurlBase', |
| 4265 | 'data': { } } |
| 4266 | |
| 4267 | ## |
| 4268 | # @BlockdevOptionsCurlFtps: |
| 4269 | # |
| 4270 | # Driver specific block device options for FTPS connections over the curl |
| 4271 | # backend. URLs must start with "ftps://". |
| 4272 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4273 | # @sslverify: Whether to verify the SSL certificate's validity (defaults to |
| 4274 | # true) |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4275 | # |
| 4276 | # Since: 2.9 |
| 4277 | ## |
| 4278 | { 'struct': 'BlockdevOptionsCurlFtps', |
| 4279 | 'base': 'BlockdevOptionsCurlBase', |
| 4280 | 'data': { '*sslverify': 'bool' } } |
Kevin Wolf | 6855528 | 2016-09-08 13:08:20 +0200 | [diff] [blame] | 4281 | |
| 4282 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 4283 | # @BlockdevOptionsNbd: |
Max Reitz | 6b02b1f | 2016-10-25 15:11:36 +0200 | [diff] [blame] | 4284 | # |
| 4285 | # Driver specific block device options for NBD. |
| 4286 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4287 | # @server: NBD server address |
Max Reitz | 6b02b1f | 2016-10-25 15:11:36 +0200 | [diff] [blame] | 4288 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4289 | # @export: export name |
Max Reitz | 6b02b1f | 2016-10-25 15:11:36 +0200 | [diff] [blame] | 4290 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4291 | # @tls-creds: TLS credentials ID |
Max Reitz | 6b02b1f | 2016-10-25 15:11:36 +0200 | [diff] [blame] | 4292 | # |
Daniel P. Berrangé | a0cd6d2 | 2022-03-04 19:36:01 +0000 | [diff] [blame] | 4293 | # @tls-hostname: TLS hostname override for certificate validation (Since 7.0) |
| 4294 | # |
Eric Blake | dbc7b01 | 2020-10-27 00:05:55 -0500 | [diff] [blame] | 4295 | # @x-dirty-bitmap: A metadata context name such as "qemu:dirty-bitmap:NAME" |
| 4296 | # or "qemu:allocation-depth" to query in place of the |
Eric Blake | 216ee36 | 2018-07-02 14:14:57 -0500 | [diff] [blame] | 4297 | # traditional "base:allocation" block status (see |
Eric Blake | dbc7b01 | 2020-10-27 00:05:55 -0500 | [diff] [blame] | 4298 | # NBD_OPT_LIST_META_CONTEXT in the NBD protocol; and |
| 4299 | # yes, naming this option x-context would have made |
| 4300 | # more sense) (since 3.0) |
Eric Blake | 216ee36 | 2018-07-02 14:14:57 -0500 | [diff] [blame] | 4301 | # |
Vladimir Sementsov-Ogievskiy | b172ae2 | 2019-06-18 14:43:23 +0300 | [diff] [blame] | 4302 | # @reconnect-delay: On an unexpected disconnect, the nbd client tries to |
| 4303 | # connect again until succeeding or encountering a serious |
| 4304 | # error. During the first @reconnect-delay seconds, all |
| 4305 | # requests are paused and will be rerun on a successful |
| 4306 | # reconnect. After that time, any delayed requests and all |
| 4307 | # future requests before a successful reconnect will |
| 4308 | # immediately fail. Default 0 (Since 4.2) |
| 4309 | # |
Vladimir Sementsov-Ogievskiy | be16b8b | 2021-09-06 22:06:48 +0300 | [diff] [blame] | 4310 | # @open-timeout: In seconds. If zero, the nbd driver tries the connection |
| 4311 | # only once, and fails to open if the connection fails. |
| 4312 | # If non-zero, the nbd driver will repeat connection attempts |
| 4313 | # until successful or until @open-timeout seconds have elapsed. |
| 4314 | # Default 0 (Since 7.0) |
| 4315 | # |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 4316 | # Features: |
| 4317 | # @unstable: Member @x-dirty-bitmap is experimental. |
| 4318 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4319 | # Since: 2.9 |
Max Reitz | 6b02b1f | 2016-10-25 15:11:36 +0200 | [diff] [blame] | 4320 | ## |
| 4321 | { 'struct': 'BlockdevOptionsNbd', |
Markus Armbruster | 62cf396 | 2017-04-26 09:36:40 +0200 | [diff] [blame] | 4322 | 'data': { 'server': 'SocketAddress', |
Max Reitz | 6b02b1f | 2016-10-25 15:11:36 +0200 | [diff] [blame] | 4323 | '*export': 'str', |
Eric Blake | 216ee36 | 2018-07-02 14:14:57 -0500 | [diff] [blame] | 4324 | '*tls-creds': 'str', |
Daniel P. Berrangé | a0cd6d2 | 2022-03-04 19:36:01 +0000 | [diff] [blame] | 4325 | '*tls-hostname': 'str', |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 4326 | '*x-dirty-bitmap': { 'type': 'str', 'features': [ 'unstable' ] }, |
Vladimir Sementsov-Ogievskiy | be16b8b | 2021-09-06 22:06:48 +0300 | [diff] [blame] | 4327 | '*reconnect-delay': 'uint32', |
| 4328 | '*open-timeout': 'uint32' } } |
Max Reitz | 6b02b1f | 2016-10-25 15:11:36 +0200 | [diff] [blame] | 4329 | |
| 4330 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 4331 | # @BlockdevOptionsRaw: |
Tomáš Golembiovský | 2fdc704 | 2016-10-31 11:27:40 +0100 | [diff] [blame] | 4332 | # |
| 4333 | # Driver specific block device options for the raw driver. |
| 4334 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4335 | # @offset: position where the block device starts |
| 4336 | # @size: the assumed size of the device |
Tomáš Golembiovský | 2fdc704 | 2016-10-31 11:27:40 +0100 | [diff] [blame] | 4337 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4338 | # Since: 2.9 |
Tomáš Golembiovský | 2fdc704 | 2016-10-31 11:27:40 +0100 | [diff] [blame] | 4339 | ## |
| 4340 | { 'struct': 'BlockdevOptionsRaw', |
| 4341 | 'base': 'BlockdevOptionsGenericFormat', |
| 4342 | 'data': { '*offset': 'int', '*size': 'int' } } |
| 4343 | |
| 4344 | ## |
Manos Pitsidianakis | d8e7d87 | 2017-08-25 16:20:27 +0300 | [diff] [blame] | 4345 | # @BlockdevOptionsThrottle: |
| 4346 | # |
| 4347 | # Driver specific block device options for the throttle driver |
| 4348 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4349 | # @throttle-group: the name of the throttle-group object to use. It |
| 4350 | # must already exist. |
| 4351 | # @file: reference to or definition of the data source block device |
Andrea Bolognani | 4ae65a5 | 2022-05-03 09:37:32 +0200 | [diff] [blame] | 4352 | # |
Manos Pitsidianakis | d8e7d87 | 2017-08-25 16:20:27 +0300 | [diff] [blame] | 4353 | # Since: 2.11 |
| 4354 | ## |
| 4355 | { 'struct': 'BlockdevOptionsThrottle', |
| 4356 | 'data': { 'throttle-group': 'str', |
| 4357 | 'file' : 'BlockdevRef' |
| 4358 | } } |
Andrey Shinkevich | e4c8fdd | 2020-12-16 09:16:55 +0300 | [diff] [blame] | 4359 | |
| 4360 | ## |
| 4361 | # @BlockdevOptionsCor: |
| 4362 | # |
| 4363 | # Driver specific block device options for the copy-on-read driver. |
| 4364 | # |
| 4365 | # @bottom: The name of a non-filter node (allocation-bearing layer) that |
| 4366 | # limits the COR operations in the backing chain (inclusive), so |
| 4367 | # that no data below this node will be copied by this filter. |
| 4368 | # If option is absent, the limit is not applied, so that data |
| 4369 | # from all backing layers may be copied. |
| 4370 | # |
| 4371 | # Since: 6.0 |
| 4372 | ## |
| 4373 | { 'struct': 'BlockdevOptionsCor', |
| 4374 | 'base': 'BlockdevOptionsGenericFormat', |
| 4375 | 'data': { '*bottom': 'str' } } |
| 4376 | |
Manos Pitsidianakis | d8e7d87 | 2017-08-25 16:20:27 +0300 | [diff] [blame] | 4377 | ## |
Vladimir Sementsov-Ogievskiy | f1bb39a | 2022-04-07 16:27:21 +0300 | [diff] [blame] | 4378 | # @OnCbwError: |
| 4379 | # |
| 4380 | # An enumeration of possible behaviors for copy-before-write operation |
| 4381 | # failures. |
| 4382 | # |
| 4383 | # @break-guest-write: report the error to the guest. This way, the guest |
| 4384 | # will not be able to overwrite areas that cannot be |
| 4385 | # backed up, so the backup process remains valid. |
| 4386 | # |
| 4387 | # @break-snapshot: continue guest write. Doing so will make the provided |
| 4388 | # snapshot state invalid and any backup or export |
| 4389 | # process based on it will finally fail. |
| 4390 | # |
| 4391 | # Since: 7.1 |
| 4392 | ## |
| 4393 | { 'enum': 'OnCbwError', |
| 4394 | 'data': [ 'break-guest-write', 'break-snapshot' ] } |
| 4395 | |
| 4396 | ## |
Vladimir Sementsov-Ogievskiy | 783b282 | 2021-08-24 11:38:44 +0300 | [diff] [blame] | 4397 | # @BlockdevOptionsCbw: |
| 4398 | # |
| 4399 | # Driver specific block device options for the copy-before-write driver, |
| 4400 | # which does so called copy-before-write operations: when data is |
| 4401 | # written to the filter, the filter first reads corresponding blocks |
| 4402 | # from its file child and copies them to @target child. After successfully |
| 4403 | # copying, the write request is propagated to file child. If copying |
| 4404 | # fails, the original write request is failed too and no data is written |
| 4405 | # to file child. |
| 4406 | # |
| 4407 | # @target: The target for copy-before-write operations. |
| 4408 | # |
Vladimir Sementsov-Ogievskiy | 5f3a3cd | 2022-03-03 20:43:37 +0100 | [diff] [blame] | 4409 | # @bitmap: If specified, copy-before-write filter will do |
| 4410 | # copy-before-write operations only for dirty regions of the |
| 4411 | # bitmap. Bitmap size must be equal to length of file and |
| 4412 | # target child of the filter. Note also, that bitmap is used |
| 4413 | # only to initialize internal bitmap of the process, so further |
| 4414 | # modifications (or removing) of specified bitmap doesn't |
| 4415 | # influence the filter. (Since 7.0) |
| 4416 | # |
Vladimir Sementsov-Ogievskiy | f1bb39a | 2022-04-07 16:27:21 +0300 | [diff] [blame] | 4417 | # @on-cbw-error: Behavior on failure of copy-before-write operation. |
| 4418 | # Default is @break-guest-write. (Since 7.1) |
| 4419 | # |
Vladimir Sementsov-Ogievskiy | 6db7fd1 | 2022-04-07 16:27:25 +0300 | [diff] [blame] | 4420 | # @cbw-timeout: Zero means no limit. Non-zero sets the timeout in seconds |
| 4421 | # for copy-before-write operation. When a timeout occurs, |
| 4422 | # the respective copy-before-write operation will fail, and |
| 4423 | # the @on-cbw-error parameter will decide how this failure |
| 4424 | # is handled. Default 0. (Since 7.1) |
| 4425 | # |
Vladimir Sementsov-Ogievskiy | 783b282 | 2021-08-24 11:38:44 +0300 | [diff] [blame] | 4426 | # Since: 6.2 |
| 4427 | ## |
| 4428 | { 'struct': 'BlockdevOptionsCbw', |
| 4429 | 'base': 'BlockdevOptionsGenericFormat', |
Vladimir Sementsov-Ogievskiy | f1bb39a | 2022-04-07 16:27:21 +0300 | [diff] [blame] | 4430 | 'data': { 'target': 'BlockdevRef', '*bitmap': 'BlockDirtyBitmap', |
Vladimir Sementsov-Ogievskiy | 6db7fd1 | 2022-04-07 16:27:25 +0300 | [diff] [blame] | 4431 | '*on-cbw-error': 'OnCbwError', '*cbw-timeout': 'uint32' } } |
Vladimir Sementsov-Ogievskiy | 783b282 | 2021-08-24 11:38:44 +0300 | [diff] [blame] | 4432 | |
| 4433 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 4434 | # @BlockdevOptions: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4435 | # |
Eric Blake | 3666a97 | 2016-03-17 16:48:40 -0600 | [diff] [blame] | 4436 | # Options for creating a block device. Many options are available for all |
| 4437 | # block devices, independent of the block driver: |
| 4438 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4439 | # @driver: block driver name |
| 4440 | # @node-name: the node name of the new node (Since 2.0). |
| 4441 | # This option is required on the top level of blockdev-add. |
| 4442 | # Valid node names start with an alphabetic character and may |
| 4443 | # contain only alphanumeric characters, '-', '.' and '_'. Their |
| 4444 | # maximum length is 31 characters. |
| 4445 | # @discard: discard-related options (default: ignore) |
| 4446 | # @cache: cache-related options |
| 4447 | # @read-only: whether the block device should be read-only (default: false). |
| 4448 | # Note that some block drivers support only read-only access, |
| 4449 | # either generally or in certain configurations. In this case, |
| 4450 | # the default value does not work and the option must be |
| 4451 | # specified explicitly. |
Kevin Wolf | e35bdc1 | 2018-10-05 18:57:40 +0200 | [diff] [blame] | 4452 | # @auto-read-only: if true and @read-only is false, QEMU may automatically |
| 4453 | # decide not to open the image read-write as requested, but |
| 4454 | # fall back to read-only instead (and switch between the modes |
| 4455 | # later), e.g. depending on whether the image file is writable |
| 4456 | # or whether a writing user is attached to the node |
| 4457 | # (default: false, since 3.1) |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 4458 | # @detect-zeroes: detect and optimize zero writes (Since 2.1) |
Eric Blake | 3666a97 | 2016-03-17 16:48:40 -0600 | [diff] [blame] | 4459 | # (default: off) |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4460 | # @force-share: force share all permission on added nodes. |
| 4461 | # Requires read-only=true. (Since 2.10) |
Eric Blake | 3666a97 | 2016-03-17 16:48:40 -0600 | [diff] [blame] | 4462 | # |
| 4463 | # Remaining options are determined by the block driver. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4464 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4465 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4466 | ## |
| 4467 | { 'union': 'BlockdevOptions', |
Eric Blake | 3666a97 | 2016-03-17 16:48:40 -0600 | [diff] [blame] | 4468 | 'base': { 'driver': 'BlockdevDriver', |
Eric Blake | 3666a97 | 2016-03-17 16:48:40 -0600 | [diff] [blame] | 4469 | '*node-name': 'str', |
| 4470 | '*discard': 'BlockdevDiscardOptions', |
| 4471 | '*cache': 'BlockdevCacheOptions', |
Eric Blake | 3666a97 | 2016-03-17 16:48:40 -0600 | [diff] [blame] | 4472 | '*read-only': 'bool', |
Kevin Wolf | e35bdc1 | 2018-10-05 18:57:40 +0200 | [diff] [blame] | 4473 | '*auto-read-only': 'bool', |
Fam Zheng | 5a9347c | 2017-05-03 00:35:37 +0800 | [diff] [blame] | 4474 | '*force-share': 'bool', |
Eric Blake | 3666a97 | 2016-03-17 16:48:40 -0600 | [diff] [blame] | 4475 | '*detect-zeroes': 'BlockdevDetectZeroesOptions' }, |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4476 | 'discriminator': 'driver', |
| 4477 | 'data': { |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4478 | 'blkdebug': 'BlockdevOptionsBlkdebug', |
Aapo Vienamo | bfcc224 | 2018-07-03 17:48:48 +0300 | [diff] [blame] | 4479 | 'blklogwrites':'BlockdevOptionsBlklogwrites', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4480 | 'blkverify': 'BlockdevOptionsBlkverify', |
Pavel Dovgalyuk | 35e32d9 | 2019-10-16 11:40:39 +0300 | [diff] [blame] | 4481 | 'blkreplay': 'BlockdevOptionsBlkreplay', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4482 | 'bochs': 'BlockdevOptionsGenericFormat', |
| 4483 | 'cloop': 'BlockdevOptionsGenericFormat', |
Andrey Shinkevich | f41388e | 2019-12-02 15:15:04 +0300 | [diff] [blame] | 4484 | 'compress': 'BlockdevOptionsGenericFormat', |
Vladimir Sementsov-Ogievskiy | 783b282 | 2021-08-24 11:38:44 +0300 | [diff] [blame] | 4485 | 'copy-before-write':'BlockdevOptionsCbw', |
Andrey Shinkevich | e4c8fdd | 2020-12-16 09:16:55 +0300 | [diff] [blame] | 4486 | 'copy-on-read':'BlockdevOptionsCor', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4487 | 'dmg': 'BlockdevOptionsGenericFormat', |
Fam Zheng | db866be | 2014-09-11 14:09:58 +0800 | [diff] [blame] | 4488 | 'file': 'BlockdevOptionsFile', |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4489 | 'ftp': 'BlockdevOptionsCurlFtp', |
| 4490 | 'ftps': 'BlockdevOptionsCurlFtps', |
Prasanna Kumar Kalever | 7edac2d | 2016-07-19 22:27:32 +0530 | [diff] [blame] | 4491 | 'gluster': 'BlockdevOptionsGluster', |
Joelle van Dyne | 14176c8 | 2021-03-15 11:03:38 -0700 | [diff] [blame] | 4492 | 'host_cdrom': { 'type': 'BlockdevOptionsFile', |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 4493 | 'if': 'HAVE_HOST_BLOCK_DEVICE' }, |
Joelle van Dyne | 14176c8 | 2021-03-15 11:03:38 -0700 | [diff] [blame] | 4494 | 'host_device': { 'type': 'BlockdevOptionsFile', |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 4495 | 'if': 'HAVE_HOST_BLOCK_DEVICE' }, |
Max Reitz | 6b9d62d | 2017-03-31 14:04:30 +0200 | [diff] [blame] | 4496 | 'http': 'BlockdevOptionsCurlHttp', |
| 4497 | 'https': 'BlockdevOptionsCurlHttps', |
Stefan Hajnoczi | fd66dbd | 2022-10-13 14:58:57 -0400 | [diff] [blame] | 4498 | 'io_uring': { 'type': 'BlockdevOptionsIoUring', |
| 4499 | 'if': 'CONFIG_BLKIO' }, |
Kevin Wolf | 31eb120 | 2016-12-08 14:23:11 +0100 | [diff] [blame] | 4500 | 'iscsi': 'BlockdevOptionsIscsi', |
Daniel P. Berrange | 7836857 | 2016-03-21 14:11:47 +0000 | [diff] [blame] | 4501 | 'luks': 'BlockdevOptionsLUKS', |
Max Reitz | 6b02b1f | 2016-10-25 15:11:36 +0200 | [diff] [blame] | 4502 | 'nbd': 'BlockdevOptionsNbd', |
Ashijeet Acharya | aa2623d | 2016-10-31 20:35:50 +0530 | [diff] [blame] | 4503 | 'nfs': 'BlockdevOptionsNfs', |
Fam Zheng | db866be | 2014-09-11 14:09:58 +0800 | [diff] [blame] | 4504 | 'null-aio': 'BlockdevOptionsNull', |
| 4505 | 'null-co': 'BlockdevOptionsNull', |
Fam Zheng | d87ee3d | 2018-01-16 14:09:01 +0800 | [diff] [blame] | 4506 | 'nvme': 'BlockdevOptionsNVMe', |
Stefan Hajnoczi | fd66dbd | 2022-10-13 14:58:57 -0400 | [diff] [blame] | 4507 | 'nvme-io_uring': { 'type': 'BlockdevOptionsNvmeIoUring', |
| 4508 | 'if': 'CONFIG_BLKIO' }, |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4509 | 'parallels': 'BlockdevOptionsGenericFormat', |
Vladimir Sementsov-Ogievskiy | 33fa222 | 2020-10-21 17:58:46 +0300 | [diff] [blame] | 4510 | 'preallocate':'BlockdevOptionsPreallocate', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4511 | 'qcow2': 'BlockdevOptionsQcow2', |
Daniel P. Berrange | d85f422 | 2017-06-23 17:24:08 +0100 | [diff] [blame] | 4512 | 'qcow': 'BlockdevOptionsQcow', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4513 | 'qed': 'BlockdevOptionsGenericCOWFormat', |
Fam Zheng | db866be | 2014-09-11 14:09:58 +0800 | [diff] [blame] | 4514 | 'quorum': 'BlockdevOptionsQuorum', |
Tomáš Golembiovský | 2fdc704 | 2016-10-31 11:27:40 +0100 | [diff] [blame] | 4515 | 'raw': 'BlockdevOptionsRaw', |
Jeff Cody | 8a47e8e | 2017-02-27 01:16:41 -0500 | [diff] [blame] | 4516 | 'rbd': 'BlockdevOptionsRbd', |
Marc-André Lureau | 335d10c | 2018-12-13 16:37:24 +0400 | [diff] [blame] | 4517 | 'replication': { 'type': 'BlockdevOptionsReplication', |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 4518 | 'if': 'CONFIG_REPLICATION' }, |
Vladimir Sementsov-Ogievskiy | 1c14eaa | 2022-03-03 20:43:44 +0100 | [diff] [blame] | 4519 | 'snapshot-access': 'BlockdevOptionsGenericFormat', |
Ashijeet Acharya | ad0e90a | 2016-10-25 18:34:01 +0530 | [diff] [blame] | 4520 | 'ssh': 'BlockdevOptionsSsh', |
Manos Pitsidianakis | d8e7d87 | 2017-08-25 16:20:27 +0300 | [diff] [blame] | 4521 | 'throttle': 'BlockdevOptionsThrottle', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4522 | 'vdi': 'BlockdevOptionsGenericFormat', |
| 4523 | 'vhdx': 'BlockdevOptionsGenericFormat', |
Alberto Faria | 03d9e4c | 2022-10-28 14:16:35 +0100 | [diff] [blame] | 4524 | 'virtio-blk-vfio-pci': |
| 4525 | { 'type': 'BlockdevOptionsVirtioBlkVfioPci', |
| 4526 | 'if': 'CONFIG_BLKIO' }, |
Stefan Hajnoczi | fd66dbd | 2022-10-13 14:58:57 -0400 | [diff] [blame] | 4527 | 'virtio-blk-vhost-user': |
| 4528 | { 'type': 'BlockdevOptionsVirtioBlkVhostUser', |
| 4529 | 'if': 'CONFIG_BLKIO' }, |
| 4530 | 'virtio-blk-vhost-vdpa': |
| 4531 | { 'type': 'BlockdevOptionsVirtioBlkVhostVdpa', |
| 4532 | 'if': 'CONFIG_BLKIO' }, |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4533 | 'vmdk': 'BlockdevOptionsGenericCOWFormat', |
| 4534 | 'vpc': 'BlockdevOptionsGenericFormat', |
Marc-André Lureau | a084645 | 2020-07-11 10:59:26 +0400 | [diff] [blame] | 4535 | 'vvfat': 'BlockdevOptionsVVFAT' |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4536 | } } |
| 4537 | |
| 4538 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 4539 | # @BlockdevRef: |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4540 | # |
| 4541 | # Reference to a block device. |
| 4542 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4543 | # @definition: defines a new block device inline |
| 4544 | # @reference: references the ID of an existing block device |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4545 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4546 | # Since: 2.9 |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4547 | ## |
Eric Blake | ab916fa | 2015-05-04 09:05:13 -0600 | [diff] [blame] | 4548 | { 'alternate': 'BlockdevRef', |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4549 | 'data': { 'definition': 'BlockdevOptions', |
| 4550 | 'reference': 'str' } } |
| 4551 | |
| 4552 | ## |
Markus Armbruster | c42e874 | 2017-07-18 08:54:00 +0200 | [diff] [blame] | 4553 | # @BlockdevRefOrNull: |
| 4554 | # |
| 4555 | # Reference to a block device. |
| 4556 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 4557 | # @definition: defines a new block device inline |
| 4558 | # @reference: references the ID of an existing block device. |
| 4559 | # An empty string means that no block device should |
| 4560 | # be referenced. Deprecated; use null instead. |
| 4561 | # @null: No block device should be referenced (since 2.10) |
Markus Armbruster | c42e874 | 2017-07-18 08:54:00 +0200 | [diff] [blame] | 4562 | # |
| 4563 | # Since: 2.9 |
| 4564 | ## |
| 4565 | { 'alternate': 'BlockdevRefOrNull', |
| 4566 | 'data': { 'definition': 'BlockdevOptions', |
| 4567 | 'reference': 'str', |
| 4568 | 'null': 'null' } } |
| 4569 | |
| 4570 | ## |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4571 | # @blockdev-add: |
| 4572 | # |
Kashyap Chamarthy | e947e9c | 2020-08-05 12:01:58 +0200 | [diff] [blame] | 4573 | # Creates a new block device. |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4574 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4575 | # Since: 2.9 |
Marc-André Lureau | b474994 | 2016-06-23 14:54:05 +0200 | [diff] [blame] | 4576 | # |
| 4577 | # Example: |
| 4578 | # |
| 4579 | # 1. |
| 4580 | # -> { "execute": "blockdev-add", |
| 4581 | # "arguments": { |
Jeff Cody | b166099 | 2017-01-24 20:14:11 -0500 | [diff] [blame] | 4582 | # "driver": "qcow2", |
| 4583 | # "node-name": "test1", |
Markus Armbruster | 34f58df | 2022-09-30 19:19:08 +0200 | [diff] [blame] | 4584 | # "file": { |
Jeff Cody | b166099 | 2017-01-24 20:14:11 -0500 | [diff] [blame] | 4585 | # "driver": "file", |
| 4586 | # "filename": "test.qcow2" |
| 4587 | # } |
| 4588 | # } |
| 4589 | # } |
Marc-André Lureau | b474994 | 2016-06-23 14:54:05 +0200 | [diff] [blame] | 4590 | # <- { "return": {} } |
| 4591 | # |
| 4592 | # 2. |
| 4593 | # -> { "execute": "blockdev-add", |
| 4594 | # "arguments": { |
Jeff Cody | b166099 | 2017-01-24 20:14:11 -0500 | [diff] [blame] | 4595 | # "driver": "qcow2", |
| 4596 | # "node-name": "node0", |
| 4597 | # "discard": "unmap", |
| 4598 | # "cache": { |
| 4599 | # "direct": true |
Marc-André Lureau | b474994 | 2016-06-23 14:54:05 +0200 | [diff] [blame] | 4600 | # }, |
Markus Armbruster | 34f58df | 2022-09-30 19:19:08 +0200 | [diff] [blame] | 4601 | # "file": { |
Jeff Cody | b166099 | 2017-01-24 20:14:11 -0500 | [diff] [blame] | 4602 | # "driver": "file", |
| 4603 | # "filename": "/tmp/test.qcow2" |
Marc-André Lureau | b474994 | 2016-06-23 14:54:05 +0200 | [diff] [blame] | 4604 | # }, |
| 4605 | # "backing": { |
Jeff Cody | b166099 | 2017-01-24 20:14:11 -0500 | [diff] [blame] | 4606 | # "driver": "raw", |
| 4607 | # "file": { |
| 4608 | # "driver": "file", |
| 4609 | # "filename": "/dev/fdset/4" |
Marc-André Lureau | b474994 | 2016-06-23 14:54:05 +0200 | [diff] [blame] | 4610 | # } |
| 4611 | # } |
Marc-André Lureau | b474994 | 2016-06-23 14:54:05 +0200 | [diff] [blame] | 4612 | # } |
| 4613 | # } |
| 4614 | # |
| 4615 | # <- { "return": {} } |
| 4616 | # |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4617 | ## |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 4618 | { 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true, |
| 4619 | 'allow-preconfig': true } |
Benoît Canet | 1ad166b | 2014-06-05 13:45:31 +0200 | [diff] [blame] | 4620 | |
Max Reitz | 7d8a9f7 | 2015-10-26 21:39:08 +0100 | [diff] [blame] | 4621 | ## |
Alberto Garcia | e60edf6 | 2021-07-08 13:47:09 +0200 | [diff] [blame] | 4622 | # @blockdev-reopen: |
Alberto Garcia | 1479c73 | 2019-03-12 18:48:51 +0200 | [diff] [blame] | 4623 | # |
Alberto Garcia | 3908b7a | 2021-07-08 13:47:07 +0200 | [diff] [blame] | 4624 | # Reopens one or more block devices using the given set of options. |
| 4625 | # Any option not specified will be reset to its default value regardless |
| 4626 | # of its previous status. If an option cannot be changed or a particular |
Alberto Garcia | 1479c73 | 2019-03-12 18:48:51 +0200 | [diff] [blame] | 4627 | # driver does not support reopening then the command will return an |
Alberto Garcia | 3908b7a | 2021-07-08 13:47:07 +0200 | [diff] [blame] | 4628 | # error. All devices in the list are reopened in one transaction, so |
| 4629 | # if one of them fails then the whole transaction is cancelled. |
Alberto Garcia | 1479c73 | 2019-03-12 18:48:51 +0200 | [diff] [blame] | 4630 | # |
Alberto Garcia | 3908b7a | 2021-07-08 13:47:07 +0200 | [diff] [blame] | 4631 | # The command receives a list of block devices to reopen. For each one |
| 4632 | # of them, the top-level @node-name option (from BlockdevOptions) must be |
Alberto Garcia | 1479c73 | 2019-03-12 18:48:51 +0200 | [diff] [blame] | 4633 | # specified and is used to select the block device to be reopened. |
| 4634 | # Other @node-name options must be either omitted or set to the |
| 4635 | # current name of the appropriate node. This command won't change any |
| 4636 | # node name and any attempt to do it will result in an error. |
| 4637 | # |
| 4638 | # In the case of options that refer to child nodes, the behavior of |
| 4639 | # this command depends on the value: |
| 4640 | # |
| 4641 | # 1) A set of options (BlockdevOptions): the child is reopened with |
| 4642 | # the specified set of options. |
| 4643 | # |
| 4644 | # 2) A reference to the current child: the child is reopened using |
| 4645 | # its existing set of options. |
| 4646 | # |
| 4647 | # 3) A reference to a different node: the current child is replaced |
| 4648 | # with the specified one. |
| 4649 | # |
| 4650 | # 4) NULL: the current child (if any) is detached. |
| 4651 | # |
Alberto Garcia | 3908b7a | 2021-07-08 13:47:07 +0200 | [diff] [blame] | 4652 | # Options (1) and (2) are supported in all cases. Option (3) is |
| 4653 | # supported for @file and @backing, and option (4) for @backing only. |
Alberto Garcia | 1479c73 | 2019-03-12 18:48:51 +0200 | [diff] [blame] | 4654 | # |
| 4655 | # Unlike with blockdev-add, the @backing option must always be present |
| 4656 | # unless the node being reopened does not have a backing file and its |
| 4657 | # image does not have a default backing file name as part of its |
| 4658 | # metadata. |
| 4659 | # |
Alberto Garcia | e60edf6 | 2021-07-08 13:47:09 +0200 | [diff] [blame] | 4660 | # Since: 6.1 |
Alberto Garcia | 1479c73 | 2019-03-12 18:48:51 +0200 | [diff] [blame] | 4661 | ## |
Alberto Garcia | e60edf6 | 2021-07-08 13:47:09 +0200 | [diff] [blame] | 4662 | { 'command': 'blockdev-reopen', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 4663 | 'data': { 'options': ['BlockdevOptions'] }, |
| 4664 | 'allow-preconfig': true } |
Alberto Garcia | 1479c73 | 2019-03-12 18:48:51 +0200 | [diff] [blame] | 4665 | |
| 4666 | ## |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4667 | # @blockdev-del: |
Alberto Garcia | 81b936a | 2015-11-02 16:51:55 +0200 | [diff] [blame] | 4668 | # |
| 4669 | # Deletes a block device that has been added using blockdev-add. |
Kevin Wolf | 9ec8873 | 2016-09-21 14:56:11 +0200 | [diff] [blame] | 4670 | # The command will fail if the node is attached to a device or is |
| 4671 | # otherwise being used. |
Alberto Garcia | 81b936a | 2015-11-02 16:51:55 +0200 | [diff] [blame] | 4672 | # |
Marc-André Lureau | 7a30538 | 2017-01-13 15:41:22 +0100 | [diff] [blame] | 4673 | # @node-name: Name of the graph node to delete. |
| 4674 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4675 | # Since: 2.9 |
Marc-André Lureau | 915a213 | 2016-06-23 14:55:00 +0200 | [diff] [blame] | 4676 | # |
| 4677 | # Example: |
| 4678 | # |
| 4679 | # -> { "execute": "blockdev-add", |
| 4680 | # "arguments": { |
Jeff Cody | b166099 | 2017-01-24 20:14:11 -0500 | [diff] [blame] | 4681 | # "driver": "qcow2", |
| 4682 | # "node-name": "node0", |
Markus Armbruster | 34f58df | 2022-09-30 19:19:08 +0200 | [diff] [blame] | 4683 | # "file": { |
Jeff Cody | b166099 | 2017-01-24 20:14:11 -0500 | [diff] [blame] | 4684 | # "driver": "file", |
| 4685 | # "filename": "test.qcow2" |
| 4686 | # } |
Marc-André Lureau | 915a213 | 2016-06-23 14:55:00 +0200 | [diff] [blame] | 4687 | # } |
| 4688 | # } |
| 4689 | # <- { "return": {} } |
| 4690 | # |
Markus Armbruster | 79b7a77 | 2017-03-21 17:53:28 +0100 | [diff] [blame] | 4691 | # -> { "execute": "blockdev-del", |
Marc-André Lureau | 915a213 | 2016-06-23 14:55:00 +0200 | [diff] [blame] | 4692 | # "arguments": { "node-name": "node0" } |
| 4693 | # } |
| 4694 | # <- { "return": {} } |
| 4695 | # |
Alberto Garcia | 81b936a | 2015-11-02 16:51:55 +0200 | [diff] [blame] | 4696 | ## |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 4697 | { 'command': 'blockdev-del', 'data': { 'node-name': 'str' }, |
| 4698 | 'allow-preconfig': true } |
Alberto Garcia | 81b936a | 2015-11-02 16:51:55 +0200 | [diff] [blame] | 4699 | |
| 4700 | ## |
Kevin Wolf | 927f11e | 2018-01-16 16:04:21 +0100 | [diff] [blame] | 4701 | # @BlockdevCreateOptionsFile: |
| 4702 | # |
| 4703 | # Driver specific image creation options for file. |
| 4704 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4705 | # @filename: Filename for the new image file |
| 4706 | # @size: Size of the virtual disk in bytes |
| 4707 | # @preallocation: Preallocation mode for the new image (default: off; |
| 4708 | # allowed values: off, |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 4709 | # falloc (if CONFIG_POSIX_FALLOCATE), |
| 4710 | # full (if CONFIG_POSIX)) |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4711 | # @nocow: Turn off copy-on-write (valid only on btrfs; default: off) |
Kevin Wolf | ffa244c | 2020-07-07 16:23:29 +0200 | [diff] [blame] | 4712 | # @extent-size-hint: Extent size hint to add to the image file; 0 for not |
| 4713 | # adding an extent size hint (default: 1 MB, since 5.1) |
Kevin Wolf | 927f11e | 2018-01-16 16:04:21 +0100 | [diff] [blame] | 4714 | # |
| 4715 | # Since: 2.12 |
| 4716 | ## |
| 4717 | { 'struct': 'BlockdevCreateOptionsFile', |
Kevin Wolf | ffa244c | 2020-07-07 16:23:29 +0200 | [diff] [blame] | 4718 | 'data': { 'filename': 'str', |
| 4719 | 'size': 'size', |
| 4720 | '*preallocation': 'PreallocMode', |
| 4721 | '*nocow': 'bool', |
| 4722 | '*extent-size-hint': 'size'} } |
Kevin Wolf | 927f11e | 2018-01-16 16:04:21 +0100 | [diff] [blame] | 4723 | |
| 4724 | ## |
Kevin Wolf | ab8bda7 | 2018-01-31 16:27:38 +0100 | [diff] [blame] | 4725 | # @BlockdevCreateOptionsGluster: |
| 4726 | # |
| 4727 | # Driver specific image creation options for gluster. |
| 4728 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4729 | # @location: Where to store the new image file |
| 4730 | # @size: Size of the virtual disk in bytes |
| 4731 | # @preallocation: Preallocation mode for the new image (default: off; |
| 4732 | # allowed values: off, |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 4733 | # falloc (if CONFIG_GLUSTERFS_FALLOCATE), |
| 4734 | # full (if CONFIG_GLUSTERFS_ZEROFILL)) |
Kevin Wolf | ab8bda7 | 2018-01-31 16:27:38 +0100 | [diff] [blame] | 4735 | # |
| 4736 | # Since: 2.12 |
| 4737 | ## |
| 4738 | { 'struct': 'BlockdevCreateOptionsGluster', |
| 4739 | 'data': { 'location': 'BlockdevOptionsGluster', |
| 4740 | 'size': 'size', |
| 4741 | '*preallocation': 'PreallocMode' } } |
| 4742 | |
| 4743 | ## |
Kevin Wolf | 1bedcaf | 2018-03-02 14:31:04 +0100 | [diff] [blame] | 4744 | # @BlockdevCreateOptionsLUKS: |
| 4745 | # |
| 4746 | # Driver specific image creation options for LUKS. |
| 4747 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4748 | # @file: Node to create the image format on |
| 4749 | # @size: Size of the virtual disk in bytes |
| 4750 | # @preallocation: Preallocation mode for the new image |
| 4751 | # (since: 4.2) |
| 4752 | # (default: off; allowed values: off, metadata, falloc, full) |
Kevin Wolf | 1bedcaf | 2018-03-02 14:31:04 +0100 | [diff] [blame] | 4753 | # |
| 4754 | # Since: 2.12 |
| 4755 | ## |
| 4756 | { 'struct': 'BlockdevCreateOptionsLUKS', |
| 4757 | 'base': 'QCryptoBlockCreateOptionsLUKS', |
| 4758 | 'data': { 'file': 'BlockdevRef', |
Maxim Levitsky | 672de729 | 2019-07-16 19:19:01 +0300 | [diff] [blame] | 4759 | 'size': 'size', |
| 4760 | '*preallocation': 'PreallocMode' } } |
Kevin Wolf | 1bedcaf | 2018-03-02 14:31:04 +0100 | [diff] [blame] | 4761 | |
| 4762 | ## |
Kevin Wolf | a1a42af | 2018-01-31 16:27:38 +0100 | [diff] [blame] | 4763 | # @BlockdevCreateOptionsNfs: |
| 4764 | # |
| 4765 | # Driver specific image creation options for NFS. |
| 4766 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4767 | # @location: Where to store the new image file |
| 4768 | # @size: Size of the virtual disk in bytes |
Kevin Wolf | a1a42af | 2018-01-31 16:27:38 +0100 | [diff] [blame] | 4769 | # |
| 4770 | # Since: 2.12 |
| 4771 | ## |
| 4772 | { 'struct': 'BlockdevCreateOptionsNfs', |
| 4773 | 'data': { 'location': 'BlockdevOptionsNfs', |
| 4774 | 'size': 'size' } } |
| 4775 | |
| 4776 | ## |
Kevin Wolf | 1511b49 | 2018-03-06 12:13:58 +0100 | [diff] [blame] | 4777 | # @BlockdevCreateOptionsParallels: |
| 4778 | # |
| 4779 | # Driver specific image creation options for parallels. |
| 4780 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4781 | # @file: Node to create the image format on |
| 4782 | # @size: Size of the virtual disk in bytes |
| 4783 | # @cluster-size: Cluster size in bytes (default: 1 MB) |
Kevin Wolf | 1511b49 | 2018-03-06 12:13:58 +0100 | [diff] [blame] | 4784 | # |
| 4785 | # Since: 2.12 |
| 4786 | ## |
| 4787 | { 'struct': 'BlockdevCreateOptionsParallels', |
| 4788 | 'data': { 'file': 'BlockdevRef', |
| 4789 | 'size': 'size', |
| 4790 | '*cluster-size': 'size' } } |
| 4791 | |
| 4792 | ## |
Kevin Wolf | 42a3e1a | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 4793 | # @BlockdevCreateOptionsQcow: |
| 4794 | # |
| 4795 | # Driver specific image creation options for qcow. |
| 4796 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4797 | # @file: Node to create the image format on |
| 4798 | # @size: Size of the virtual disk in bytes |
| 4799 | # @backing-file: File name of the backing file if a backing file |
| 4800 | # should be used |
| 4801 | # @encrypt: Encryption options if the image should be encrypted |
Kevin Wolf | 42a3e1a | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 4802 | # |
| 4803 | # Since: 2.12 |
| 4804 | ## |
| 4805 | { 'struct': 'BlockdevCreateOptionsQcow', |
| 4806 | 'data': { 'file': 'BlockdevRef', |
| 4807 | 'size': 'size', |
| 4808 | '*backing-file': 'str', |
| 4809 | '*encrypt': 'QCryptoBlockCreateOptions' } } |
| 4810 | |
| 4811 | ## |
Kevin Wolf | c2808ab | 2017-11-24 16:01:07 +0100 | [diff] [blame] | 4812 | # @BlockdevQcow2Version: |
| 4813 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 4814 | # @v2: The original QCOW2 format as introduced in qemu 0.10 (version 2) |
| 4815 | # @v3: The extended QCOW2 format as introduced in qemu 1.1 (version 3) |
Kevin Wolf | c2808ab | 2017-11-24 16:01:07 +0100 | [diff] [blame] | 4816 | # |
| 4817 | # Since: 2.12 |
| 4818 | ## |
| 4819 | { 'enum': 'BlockdevQcow2Version', |
| 4820 | 'data': [ 'v2', 'v3' ] } |
| 4821 | |
Kevin Wolf | c2808ab | 2017-11-24 16:01:07 +0100 | [diff] [blame] | 4822 | ## |
Denis Plotnikov | 572ad97 | 2020-05-07 11:25:18 +0300 | [diff] [blame] | 4823 | # @Qcow2CompressionType: |
| 4824 | # |
| 4825 | # Compression type used in qcow2 image file |
| 4826 | # |
| 4827 | # @zlib: zlib compression, see <http://zlib.net/> |
Denis Plotnikov | d298ac1 | 2020-05-07 11:25:20 +0300 | [diff] [blame] | 4828 | # @zstd: zstd compression, see <http://github.com/facebook/zstd> |
Denis Plotnikov | 572ad97 | 2020-05-07 11:25:18 +0300 | [diff] [blame] | 4829 | # |
| 4830 | # Since: 5.1 |
| 4831 | ## |
| 4832 | { 'enum': 'Qcow2CompressionType', |
Marc-André Lureau | 8a9f1e1 | 2021-08-04 12:31:05 +0400 | [diff] [blame] | 4833 | 'data': [ 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] } |
Denis Plotnikov | 572ad97 | 2020-05-07 11:25:18 +0300 | [diff] [blame] | 4834 | |
| 4835 | ## |
Kevin Wolf | c2808ab | 2017-11-24 16:01:07 +0100 | [diff] [blame] | 4836 | # @BlockdevCreateOptionsQcow2: |
| 4837 | # |
| 4838 | # Driver specific image creation options for qcow2. |
| 4839 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4840 | # @file: Node to create the image format on |
| 4841 | # @data-file: Node to use as an external data file in which all guest |
| 4842 | # data is stored so that only metadata remains in the qcow2 |
| 4843 | # file (since: 4.0) |
| 4844 | # @data-file-raw: True if the external data file must stay valid as a |
| 4845 | # standalone (read-only) raw image without looking at qcow2 |
| 4846 | # metadata (default: false; since: 4.0) |
Peter Maydell | 826bd06 | 2020-09-25 17:22:56 +0100 | [diff] [blame] | 4847 | # @extended-l2: True to make the image have extended L2 entries |
| 4848 | # (default: false; since 5.2) |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4849 | # @size: Size of the virtual disk in bytes |
| 4850 | # @version: Compatibility level (default: v3) |
| 4851 | # @backing-file: File name of the backing file if a backing file |
| 4852 | # should be used |
| 4853 | # @backing-fmt: Name of the block driver to use for the backing file |
| 4854 | # @encrypt: Encryption options if the image should be encrypted |
| 4855 | # @cluster-size: qcow2 cluster size in bytes (default: 65536) |
| 4856 | # @preallocation: Preallocation mode for the new image (default: off; |
| 4857 | # allowed values: off, falloc, full, metadata) |
| 4858 | # @lazy-refcounts: True if refcounts may be updated lazily (default: off) |
| 4859 | # @refcount-bits: Width of reference counts in bits (default: 16) |
Denis Plotnikov | 572ad97 | 2020-05-07 11:25:18 +0300 | [diff] [blame] | 4860 | # @compression-type: The image cluster compression method |
| 4861 | # (default: zlib, since 5.1) |
Kevin Wolf | c2808ab | 2017-11-24 16:01:07 +0100 | [diff] [blame] | 4862 | # |
| 4863 | # Since: 2.12 |
| 4864 | ## |
| 4865 | { 'struct': 'BlockdevCreateOptionsQcow2', |
| 4866 | 'data': { 'file': 'BlockdevRef', |
Kevin Wolf | dcc9868 | 2019-01-14 16:57:27 +0100 | [diff] [blame] | 4867 | '*data-file': 'BlockdevRef', |
Kevin Wolf | 6c3944d | 2019-02-22 14:29:38 +0100 | [diff] [blame] | 4868 | '*data-file-raw': 'bool', |
Alberto Garcia | 7be2025 | 2020-07-10 18:13:13 +0200 | [diff] [blame] | 4869 | '*extended-l2': 'bool', |
Kevin Wolf | c2808ab | 2017-11-24 16:01:07 +0100 | [diff] [blame] | 4870 | 'size': 'size', |
| 4871 | '*version': 'BlockdevQcow2Version', |
| 4872 | '*backing-file': 'str', |
| 4873 | '*backing-fmt': 'BlockdevDriver', |
| 4874 | '*encrypt': 'QCryptoBlockCreateOptions', |
| 4875 | '*cluster-size': 'size', |
| 4876 | '*preallocation': 'PreallocMode', |
| 4877 | '*lazy-refcounts': 'bool', |
Denis Plotnikov | 572ad97 | 2020-05-07 11:25:18 +0300 | [diff] [blame] | 4878 | '*refcount-bits': 'int', |
| 4879 | '*compression-type':'Qcow2CompressionType' } } |
Kevin Wolf | c2808ab | 2017-11-24 16:01:07 +0100 | [diff] [blame] | 4880 | |
| 4881 | ## |
Kevin Wolf | 959355a | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 4882 | # @BlockdevCreateOptionsQed: |
| 4883 | # |
| 4884 | # Driver specific image creation options for qed. |
| 4885 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4886 | # @file: Node to create the image format on |
| 4887 | # @size: Size of the virtual disk in bytes |
| 4888 | # @backing-file: File name of the backing file if a backing file |
| 4889 | # should be used |
| 4890 | # @backing-fmt: Name of the block driver to use for the backing file |
| 4891 | # @cluster-size: Cluster size in bytes (default: 65536) |
| 4892 | # @table-size: L1/L2 table size (in clusters) |
Kevin Wolf | 959355a | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 4893 | # |
| 4894 | # Since: 2.12 |
| 4895 | ## |
| 4896 | { 'struct': 'BlockdevCreateOptionsQed', |
| 4897 | 'data': { 'file': 'BlockdevRef', |
| 4898 | 'size': 'size', |
| 4899 | '*backing-file': 'str', |
| 4900 | '*backing-fmt': 'BlockdevDriver', |
| 4901 | '*cluster-size': 'size', |
| 4902 | '*table-size': 'int' } } |
| 4903 | |
| 4904 | ## |
Kevin Wolf | 1bebea3 | 2018-01-31 16:27:38 +0100 | [diff] [blame] | 4905 | # @BlockdevCreateOptionsRbd: |
| 4906 | # |
| 4907 | # Driver specific image creation options for rbd/Ceph. |
| 4908 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4909 | # @location: Where to store the new image file. This location cannot |
| 4910 | # point to a snapshot. |
| 4911 | # @size: Size of the virtual disk in bytes |
| 4912 | # @cluster-size: RBD object size |
Or Ozeri | 42e4ac9 | 2021-06-27 14:46:35 +0300 | [diff] [blame] | 4913 | # @encrypt: Image encryption options. (Since 6.1) |
Kevin Wolf | 1bebea3 | 2018-01-31 16:27:38 +0100 | [diff] [blame] | 4914 | # |
| 4915 | # Since: 2.12 |
| 4916 | ## |
| 4917 | { 'struct': 'BlockdevCreateOptionsRbd', |
| 4918 | 'data': { 'location': 'BlockdevOptionsRbd', |
| 4919 | 'size': 'size', |
Or Ozeri | 42e4ac9 | 2021-06-27 14:46:35 +0300 | [diff] [blame] | 4920 | '*cluster-size' : 'size', |
| 4921 | '*encrypt' : 'RbdEncryptionCreateOptions' } } |
Kevin Wolf | 1bebea3 | 2018-01-31 16:27:38 +0100 | [diff] [blame] | 4922 | |
| 4923 | ## |
Fam Zheng | 3015372 | 2018-05-15 23:36:32 +0800 | [diff] [blame] | 4924 | # @BlockdevVmdkSubformat: |
| 4925 | # |
| 4926 | # Subformat options for VMDK images |
| 4927 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 4928 | # @monolithicSparse: Single file image with sparse cluster allocation |
Fam Zheng | 3015372 | 2018-05-15 23:36:32 +0800 | [diff] [blame] | 4929 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 4930 | # @monolithicFlat: Single flat data image and a descriptor file |
Fam Zheng | 3015372 | 2018-05-15 23:36:32 +0800 | [diff] [blame] | 4931 | # |
| 4932 | # @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse extent |
| 4933 | # files, in addition to a descriptor file |
| 4934 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 4935 | # @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent |
| 4936 | # files, in addition to a descriptor file |
Fam Zheng | 3015372 | 2018-05-15 23:36:32 +0800 | [diff] [blame] | 4937 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 4938 | # @streamOptimized: Single file image sparse cluster allocation, optimized |
| 4939 | # for streaming over network. |
Fam Zheng | 3015372 | 2018-05-15 23:36:32 +0800 | [diff] [blame] | 4940 | # |
| 4941 | # Since: 4.0 |
| 4942 | ## |
| 4943 | { 'enum': 'BlockdevVmdkSubformat', |
| 4944 | 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse', |
| 4945 | 'twoGbMaxExtentFlat', 'streamOptimized'] } |
| 4946 | |
| 4947 | ## |
| 4948 | # @BlockdevVmdkAdapterType: |
| 4949 | # |
| 4950 | # Adapter type info for VMDK images |
| 4951 | # |
| 4952 | # Since: 4.0 |
| 4953 | ## |
| 4954 | { 'enum': 'BlockdevVmdkAdapterType', |
| 4955 | 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] } |
| 4956 | |
| 4957 | ## |
| 4958 | # @BlockdevCreateOptionsVmdk: |
| 4959 | # |
| 4960 | # Driver specific image creation options for VMDK. |
| 4961 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4962 | # @file: Where to store the new image file. This refers to the image |
| 4963 | # file for monolithcSparse and streamOptimized format, or the |
| 4964 | # descriptor file for other formats. |
| 4965 | # @size: Size of the virtual disk in bytes |
| 4966 | # @extents: Where to store the data extents. Required for monolithcFlat, |
| 4967 | # twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For |
| 4968 | # monolithicFlat, only one entry is required; for |
| 4969 | # twoGbMaxExtent* formats, the number of entries required is |
| 4970 | # calculated as extent_number = virtual_size / 2GB. Providing |
| 4971 | # more extents than will be used is an error. |
| 4972 | # @subformat: The subformat of the VMDK image. Default: "monolithicSparse". |
| 4973 | # @backing-file: The path of backing file. Default: no backing file is used. |
| 4974 | # @adapter-type: The adapter type used to fill in the descriptor. Default: ide. |
| 4975 | # @hwversion: Hardware version. The meaningful options are "4" or "6". |
| 4976 | # Default: "4". |
Thomas Weißschuh | f3d43df | 2021-09-13 15:04:19 +0200 | [diff] [blame] | 4977 | # @toolsversion: VMware guest tools version. |
| 4978 | # Default: "2147483647" (Since 6.2) |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 4979 | # @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats. |
| 4980 | # Default: false. |
Fam Zheng | 3015372 | 2018-05-15 23:36:32 +0800 | [diff] [blame] | 4981 | # |
| 4982 | # Since: 4.0 |
| 4983 | ## |
| 4984 | { 'struct': 'BlockdevCreateOptionsVmdk', |
| 4985 | 'data': { 'file': 'BlockdevRef', |
| 4986 | 'size': 'size', |
| 4987 | '*extents': ['BlockdevRef'], |
| 4988 | '*subformat': 'BlockdevVmdkSubformat', |
| 4989 | '*backing-file': 'str', |
| 4990 | '*adapter-type': 'BlockdevVmdkAdapterType', |
| 4991 | '*hwversion': 'str', |
Thomas Weißschuh | f3d43df | 2021-09-13 15:04:19 +0200 | [diff] [blame] | 4992 | '*toolsversion': 'str', |
Fam Zheng | 3015372 | 2018-05-15 23:36:32 +0800 | [diff] [blame] | 4993 | '*zeroed-grain': 'bool' } } |
| 4994 | |
Fam Zheng | 3015372 | 2018-05-15 23:36:32 +0800 | [diff] [blame] | 4995 | ## |
Kevin Wolf | 4906da7 | 2018-02-05 16:24:32 +0100 | [diff] [blame] | 4996 | # @BlockdevCreateOptionsSsh: |
| 4997 | # |
| 4998 | # Driver specific image creation options for SSH. |
| 4999 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 5000 | # @location: Where to store the new image file |
| 5001 | # @size: Size of the virtual disk in bytes |
Kevin Wolf | 4906da7 | 2018-02-05 16:24:32 +0100 | [diff] [blame] | 5002 | # |
| 5003 | # Since: 2.12 |
| 5004 | ## |
| 5005 | { 'struct': 'BlockdevCreateOptionsSsh', |
| 5006 | 'data': { 'location': 'BlockdevOptionsSsh', |
| 5007 | 'size': 'size' } } |
| 5008 | |
| 5009 | ## |
Max Reitz | 49858b5 | 2018-03-12 17:55:26 +0100 | [diff] [blame] | 5010 | # @BlockdevCreateOptionsVdi: |
| 5011 | # |
| 5012 | # Driver specific image creation options for VDI. |
| 5013 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 5014 | # @file: Node to create the image format on |
| 5015 | # @size: Size of the virtual disk in bytes |
| 5016 | # @preallocation: Preallocation mode for the new image (default: off; |
| 5017 | # allowed values: off, metadata) |
Max Reitz | 49858b5 | 2018-03-12 17:55:26 +0100 | [diff] [blame] | 5018 | # |
| 5019 | # Since: 2.12 |
| 5020 | ## |
| 5021 | { 'struct': 'BlockdevCreateOptionsVdi', |
| 5022 | 'data': { 'file': 'BlockdevRef', |
| 5023 | 'size': 'size', |
Kevin Wolf | 61fa648 | 2018-03-20 15:08:00 +0100 | [diff] [blame] | 5024 | '*preallocation': 'PreallocMode' } } |
Max Reitz | 49858b5 | 2018-03-12 17:55:26 +0100 | [diff] [blame] | 5025 | |
| 5026 | ## |
Kevin Wolf | 09b68da | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 5027 | # @BlockdevVhdxSubformat: |
| 5028 | # |
| 5029 | # @dynamic: Growing image file |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 5030 | # @fixed: Preallocated fixed-size image file |
Kevin Wolf | 09b68da | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 5031 | # |
| 5032 | # Since: 2.12 |
| 5033 | ## |
| 5034 | { 'enum': 'BlockdevVhdxSubformat', |
| 5035 | 'data': [ 'dynamic', 'fixed' ] } |
| 5036 | |
| 5037 | ## |
| 5038 | # @BlockdevCreateOptionsVhdx: |
| 5039 | # |
| 5040 | # Driver specific image creation options for vhdx. |
| 5041 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 5042 | # @file: Node to create the image format on |
| 5043 | # @size: Size of the virtual disk in bytes |
| 5044 | # @log-size: Log size in bytes, must be a multiple of 1 MB |
| 5045 | # (default: 1 MB) |
| 5046 | # @block-size: Block size in bytes, must be a multiple of 1 MB and not |
| 5047 | # larger than 256 MB (default: automatically choose a block |
| 5048 | # size depending on the image size) |
| 5049 | # @subformat: vhdx subformat (default: dynamic) |
| 5050 | # @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard, |
| 5051 | # but default. Do not set to 'off' when using 'qemu-img |
| 5052 | # convert' with subformat=dynamic. |
Kevin Wolf | 09b68da | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 5053 | # |
| 5054 | # Since: 2.12 |
| 5055 | ## |
| 5056 | { 'struct': 'BlockdevCreateOptionsVhdx', |
| 5057 | 'data': { 'file': 'BlockdevRef', |
| 5058 | 'size': 'size', |
| 5059 | '*log-size': 'size', |
| 5060 | '*block-size': 'size', |
| 5061 | '*subformat': 'BlockdevVhdxSubformat', |
| 5062 | '*block-state-zero': 'bool' } } |
| 5063 | |
| 5064 | ## |
Kevin Wolf | 182c883 | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 5065 | # @BlockdevVpcSubformat: |
| 5066 | # |
| 5067 | # @dynamic: Growing image file |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 5068 | # @fixed: Preallocated fixed-size image file |
Kevin Wolf | 182c883 | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 5069 | # |
| 5070 | # Since: 2.12 |
| 5071 | ## |
| 5072 | { 'enum': 'BlockdevVpcSubformat', |
| 5073 | 'data': [ 'dynamic', 'fixed' ] } |
| 5074 | |
| 5075 | ## |
| 5076 | # @BlockdevCreateOptionsVpc: |
| 5077 | # |
| 5078 | # Driver specific image creation options for vpc (VHD). |
| 5079 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 5080 | # @file: Node to create the image format on |
| 5081 | # @size: Size of the virtual disk in bytes |
| 5082 | # @subformat: vhdx subformat (default: dynamic) |
| 5083 | # @force-size: Force use of the exact byte size instead of rounding to the |
| 5084 | # next size that can be represented in CHS geometry |
| 5085 | # (default: false) |
Kevin Wolf | 182c883 | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 5086 | # |
| 5087 | # Since: 2.12 |
| 5088 | ## |
| 5089 | { 'struct': 'BlockdevCreateOptionsVpc', |
| 5090 | 'data': { 'file': 'BlockdevRef', |
| 5091 | 'size': 'size', |
| 5092 | '*subformat': 'BlockdevVpcSubformat', |
| 5093 | '*force-size': 'bool' } } |
| 5094 | |
| 5095 | ## |
Kevin Wolf | 5361468 | 2017-11-24 16:01:07 +0100 | [diff] [blame] | 5096 | # @BlockdevCreateOptions: |
| 5097 | # |
| 5098 | # Options for creating an image format on a given node. |
| 5099 | # |
Peter Maydell | f562750 | 2020-02-13 17:56:25 +0000 | [diff] [blame] | 5100 | # @driver: block driver to create the image format |
Kevin Wolf | 5361468 | 2017-11-24 16:01:07 +0100 | [diff] [blame] | 5101 | # |
| 5102 | # Since: 2.12 |
| 5103 | ## |
| 5104 | { 'union': 'BlockdevCreateOptions', |
| 5105 | 'base': { |
| 5106 | 'driver': 'BlockdevDriver' }, |
| 5107 | 'discriminator': 'driver', |
| 5108 | 'data': { |
Kevin Wolf | 927f11e | 2018-01-16 16:04:21 +0100 | [diff] [blame] | 5109 | 'file': 'BlockdevCreateOptionsFile', |
Kevin Wolf | ab8bda7 | 2018-01-31 16:27:38 +0100 | [diff] [blame] | 5110 | 'gluster': 'BlockdevCreateOptionsGluster', |
Kevin Wolf | 1bedcaf | 2018-03-02 14:31:04 +0100 | [diff] [blame] | 5111 | 'luks': 'BlockdevCreateOptionsLUKS', |
Kevin Wolf | a1a42af | 2018-01-31 16:27:38 +0100 | [diff] [blame] | 5112 | 'nfs': 'BlockdevCreateOptionsNfs', |
Kevin Wolf | 1511b49 | 2018-03-06 12:13:58 +0100 | [diff] [blame] | 5113 | 'parallels': 'BlockdevCreateOptionsParallels', |
Kevin Wolf | 42a3e1a | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 5114 | 'qcow': 'BlockdevCreateOptionsQcow', |
Kevin Wolf | c2808ab | 2017-11-24 16:01:07 +0100 | [diff] [blame] | 5115 | 'qcow2': 'BlockdevCreateOptionsQcow2', |
Kevin Wolf | 959355a | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 5116 | 'qed': 'BlockdevCreateOptionsQed', |
Kevin Wolf | 1bebea3 | 2018-01-31 16:27:38 +0100 | [diff] [blame] | 5117 | 'rbd': 'BlockdevCreateOptionsRbd', |
Kevin Wolf | 4906da7 | 2018-02-05 16:24:32 +0100 | [diff] [blame] | 5118 | 'ssh': 'BlockdevCreateOptionsSsh', |
Max Reitz | e381057 | 2018-03-12 17:55:28 +0100 | [diff] [blame] | 5119 | 'vdi': 'BlockdevCreateOptionsVdi', |
Kevin Wolf | 09b68da | 2018-03-09 19:53:19 +0100 | [diff] [blame] | 5120 | 'vhdx': 'BlockdevCreateOptionsVhdx', |
Fam Zheng | 3015372 | 2018-05-15 23:36:32 +0800 | [diff] [blame] | 5121 | 'vmdk': 'BlockdevCreateOptionsVmdk', |
Anton Nefedov | 29cd040 | 2018-06-18 11:40:06 +0300 | [diff] [blame] | 5122 | 'vpc': 'BlockdevCreateOptionsVpc' |
Kevin Wolf | 5361468 | 2017-11-24 16:01:07 +0100 | [diff] [blame] | 5123 | } } |
| 5124 | |
| 5125 | ## |
Kevin Wolf | 3fb588a | 2018-05-25 18:24:51 +0200 | [diff] [blame] | 5126 | # @blockdev-create: |
Kevin Wolf | b0292b8 | 2018-01-09 16:50:57 +0100 | [diff] [blame] | 5127 | # |
Kevin Wolf | e5ab434 | 2018-01-18 14:33:04 +0100 | [diff] [blame] | 5128 | # Starts a job to create an image format on a given node. The job is |
| 5129 | # automatically finalized, but a manual job-dismiss is required. |
Kevin Wolf | b0292b8 | 2018-01-09 16:50:57 +0100 | [diff] [blame] | 5130 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 5131 | # @job-id: Identifier for the newly created job. |
Kevin Wolf | e5ab434 | 2018-01-18 14:33:04 +0100 | [diff] [blame] | 5132 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 5133 | # @options: Options for the image creation. |
Kevin Wolf | e5ab434 | 2018-01-18 14:33:04 +0100 | [diff] [blame] | 5134 | # |
| 5135 | # Since: 3.0 |
Kevin Wolf | b0292b8 | 2018-01-09 16:50:57 +0100 | [diff] [blame] | 5136 | ## |
Kevin Wolf | 3fb588a | 2018-05-25 18:24:51 +0200 | [diff] [blame] | 5137 | { 'command': 'blockdev-create', |
Kevin Wolf | e5ab434 | 2018-01-18 14:33:04 +0100 | [diff] [blame] | 5138 | 'data': { 'job-id': 'str', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 5139 | 'options': 'BlockdevCreateOptions' }, |
| 5140 | 'allow-preconfig': true } |
Kevin Wolf | b0292b8 | 2018-01-09 16:50:57 +0100 | [diff] [blame] | 5141 | |
| 5142 | ## |
Maxim Levitsky | 30da9dd | 2020-06-25 14:55:46 +0200 | [diff] [blame] | 5143 | # @BlockdevAmendOptionsLUKS: |
| 5144 | # |
| 5145 | # Driver specific image amend options for LUKS. |
| 5146 | # |
| 5147 | # Since: 5.1 |
| 5148 | ## |
| 5149 | { 'struct': 'BlockdevAmendOptionsLUKS', |
| 5150 | 'base': 'QCryptoBlockAmendOptionsLUKS', |
| 5151 | 'data': { } |
| 5152 | } |
| 5153 | |
| 5154 | ## |
Maxim Levitsky | 8ea1613 | 2020-06-25 14:55:47 +0200 | [diff] [blame] | 5155 | # @BlockdevAmendOptionsQcow2: |
| 5156 | # |
| 5157 | # Driver specific image amend options for qcow2. |
| 5158 | # For now, only encryption options can be amended |
| 5159 | # |
| 5160 | # @encrypt Encryption options to be amended |
| 5161 | # |
| 5162 | # Since: 5.1 |
| 5163 | ## |
| 5164 | { 'struct': 'BlockdevAmendOptionsQcow2', |
| 5165 | 'data': { '*encrypt': 'QCryptoBlockAmendOptions' } } |
| 5166 | |
| 5167 | ## |
Maxim Levitsky | ced914d | 2020-06-25 14:55:45 +0200 | [diff] [blame] | 5168 | # @BlockdevAmendOptions: |
| 5169 | # |
| 5170 | # Options for amending an image format |
| 5171 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 5172 | # @driver: Block driver of the node to amend. |
Maxim Levitsky | ced914d | 2020-06-25 14:55:45 +0200 | [diff] [blame] | 5173 | # |
| 5174 | # Since: 5.1 |
| 5175 | ## |
| 5176 | { 'union': 'BlockdevAmendOptions', |
| 5177 | 'base': { |
| 5178 | 'driver': 'BlockdevDriver' }, |
| 5179 | 'discriminator': 'driver', |
| 5180 | 'data': { |
Maxim Levitsky | 8ea1613 | 2020-06-25 14:55:47 +0200 | [diff] [blame] | 5181 | 'luks': 'BlockdevAmendOptionsLUKS', |
| 5182 | 'qcow2': 'BlockdevAmendOptionsQcow2' } } |
Maxim Levitsky | ced914d | 2020-06-25 14:55:45 +0200 | [diff] [blame] | 5183 | |
| 5184 | ## |
| 5185 | # @x-blockdev-amend: |
| 5186 | # |
| 5187 | # Starts a job to amend format specific options of an existing open block device |
| 5188 | # The job is automatically finalized, but a manual job-dismiss is required. |
| 5189 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 5190 | # @job-id: Identifier for the newly created job. |
Maxim Levitsky | ced914d | 2020-06-25 14:55:45 +0200 | [diff] [blame] | 5191 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 5192 | # @node-name: Name of the block node to work on |
Maxim Levitsky | ced914d | 2020-06-25 14:55:45 +0200 | [diff] [blame] | 5193 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 5194 | # @options: Options (driver specific) |
Maxim Levitsky | ced914d | 2020-06-25 14:55:45 +0200 | [diff] [blame] | 5195 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 5196 | # @force: Allow unsafe operations, format specific |
| 5197 | # For luks that allows erase of the last active keyslot |
| 5198 | # (permanent loss of data), |
| 5199 | # and replacement of an active keyslot |
| 5200 | # (possible loss of data if IO error happens) |
Maxim Levitsky | ced914d | 2020-06-25 14:55:45 +0200 | [diff] [blame] | 5201 | # |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 5202 | # Features: |
| 5203 | # @unstable: This command is experimental. |
| 5204 | # |
Maxim Levitsky | ced914d | 2020-06-25 14:55:45 +0200 | [diff] [blame] | 5205 | # Since: 5.1 |
| 5206 | ## |
| 5207 | { 'command': 'x-blockdev-amend', |
| 5208 | 'data': { 'job-id': 'str', |
| 5209 | 'node-name': 'str', |
| 5210 | 'options': 'BlockdevAmendOptions', |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 5211 | '*force': 'bool' }, |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 5212 | 'features': [ 'unstable' ], |
| 5213 | 'allow-preconfig': true } |
Maxim Levitsky | ced914d | 2020-06-25 14:55:45 +0200 | [diff] [blame] | 5214 | |
| 5215 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 5216 | # @BlockErrorAction: |
Wenchao Xia | a589569 | 2014-06-18 08:43:30 +0200 | [diff] [blame] | 5217 | # |
| 5218 | # An enumeration of action that has been taken when a DISK I/O occurs |
| 5219 | # |
| 5220 | # @ignore: error has been ignored |
| 5221 | # |
| 5222 | # @report: error has been reported to the device |
| 5223 | # |
| 5224 | # @stop: error caused VM to be stopped |
| 5225 | # |
| 5226 | # Since: 2.1 |
| 5227 | ## |
| 5228 | { 'enum': 'BlockErrorAction', |
| 5229 | 'data': [ 'ignore', 'report', 'stop' ] } |
Wenchao Xia | 5a2d2cb | 2014-06-18 08:43:45 +0200 | [diff] [blame] | 5230 | |
Wenchao Xia | 5a2d2cb | 2014-06-18 08:43:45 +0200 | [diff] [blame] | 5231 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 5232 | # @BLOCK_IMAGE_CORRUPTED: |
Wenchao Xia | c120f0f | 2014-06-18 08:43:46 +0200 | [diff] [blame] | 5233 | # |
Marc-André Lureau | 370d4eb | 2016-06-23 15:51:26 +0200 | [diff] [blame] | 5234 | # Emitted when a disk image is being marked corrupt. The image can be |
| 5235 | # identified by its device or node name. The 'device' field is always |
| 5236 | # present for compatibility reasons, but it can be empty ("") if the |
| 5237 | # image does not have a device name associated. |
Wenchao Xia | c120f0f | 2014-06-18 08:43:46 +0200 | [diff] [blame] | 5238 | # |
Alberto Garcia | dc881b4 | 2015-04-08 12:29:20 +0300 | [diff] [blame] | 5239 | # @device: device name. This is always present for compatibility |
| 5240 | # reasons, but it can be empty ("") if the image does not |
| 5241 | # have a device name associated. |
| 5242 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 5243 | # @node-name: node name (Since: 2.4) |
Wenchao Xia | c120f0f | 2014-06-18 08:43:46 +0200 | [diff] [blame] | 5244 | # |
| 5245 | # @msg: informative message for human consumption, such as the kind of |
Wenchao Xia | 2f44a08 | 2014-06-24 16:34:00 -0700 | [diff] [blame] | 5246 | # corruption being detected. It should not be parsed by machine as it is |
| 5247 | # not guaranteed to be stable |
Wenchao Xia | c120f0f | 2014-06-18 08:43:46 +0200 | [diff] [blame] | 5248 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 5249 | # @offset: if the corruption resulted from an image access, this is |
Alberto Garcia | 0caef8f | 2015-05-07 17:58:26 +0300 | [diff] [blame] | 5250 | # the host's access offset into the image |
Wenchao Xia | c120f0f | 2014-06-18 08:43:46 +0200 | [diff] [blame] | 5251 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 5252 | # @size: if the corruption resulted from an image access, this is |
Wenchao Xia | c120f0f | 2014-06-18 08:43:46 +0200 | [diff] [blame] | 5253 | # the access size |
| 5254 | # |
Marc-André Lureau | 370d4eb | 2016-06-23 15:51:26 +0200 | [diff] [blame] | 5255 | # @fatal: if set, the image is marked corrupt and therefore unusable after this |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 5256 | # event and must be repaired (Since 2.2; before, every |
| 5257 | # BLOCK_IMAGE_CORRUPTED event was fatal) |
Max Reitz | 9bf040b | 2014-09-05 16:07:15 +0200 | [diff] [blame] | 5258 | # |
Marc-André Lureau | 07c9f58 | 2016-06-23 15:52:10 +0200 | [diff] [blame] | 5259 | # Note: If action is "stop", a STOP event will eventually follow the |
| 5260 | # BLOCK_IO_ERROR event. |
| 5261 | # |
Marc-André Lureau | 370d4eb | 2016-06-23 15:51:26 +0200 | [diff] [blame] | 5262 | # Example: |
| 5263 | # |
| 5264 | # <- { "event": "BLOCK_IMAGE_CORRUPTED", |
Victor Toso | abbf047 | 2022-03-28 16:05:52 +0200 | [diff] [blame] | 5265 | # "data": { "device": "", "node-name": "drive", "fatal": false, |
| 5266 | # "msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)" }, |
| 5267 | # "timestamp": { "seconds": 1648243240, "microseconds": 906060 } } |
Marc-André Lureau | 370d4eb | 2016-06-23 15:51:26 +0200 | [diff] [blame] | 5268 | # |
Wenchao Xia | c120f0f | 2014-06-18 08:43:46 +0200 | [diff] [blame] | 5269 | # Since: 1.7 |
| 5270 | ## |
| 5271 | { 'event': 'BLOCK_IMAGE_CORRUPTED', |
Alberto Garcia | dc881b4 | 2015-04-08 12:29:20 +0300 | [diff] [blame] | 5272 | 'data': { 'device' : 'str', |
| 5273 | '*node-name' : 'str', |
| 5274 | 'msg' : 'str', |
| 5275 | '*offset' : 'int', |
| 5276 | '*size' : 'int', |
| 5277 | 'fatal' : 'bool' } } |
Wenchao Xia | c120f0f | 2014-06-18 08:43:46 +0200 | [diff] [blame] | 5278 | |
| 5279 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 5280 | # @BLOCK_IO_ERROR: |
Wenchao Xia | 5a2d2cb | 2014-06-18 08:43:45 +0200 | [diff] [blame] | 5281 | # |
| 5282 | # Emitted when a disk I/O error occurs |
| 5283 | # |
Kevin Wolf | 2bf7e10 | 2016-09-29 16:47:58 +0200 | [diff] [blame] | 5284 | # @device: device name. This is always present for compatibility |
| 5285 | # reasons, but it can be empty ("") if the image does not |
| 5286 | # have a device name associated. |
| 5287 | # |
| 5288 | # @node-name: node name. Note that errors may be reported for the root node |
| 5289 | # that is directly attached to a guest device rather than for the |
Kevin Wolf | bfe1a14 | 2018-03-05 15:59:35 +0100 | [diff] [blame] | 5290 | # node where the error occurred. The node name is not present if |
| 5291 | # the drive is empty. (Since: 2.8) |
Wenchao Xia | 5a2d2cb | 2014-06-18 08:43:45 +0200 | [diff] [blame] | 5292 | # |
| 5293 | # @operation: I/O operation |
| 5294 | # |
| 5295 | # @action: action that has been taken |
| 5296 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 5297 | # @nospace: true if I/O error was caused due to a no-space |
Luiz Capitulino | c7c2ff0 | 2014-08-29 16:07:27 -0400 | [diff] [blame] | 5298 | # condition. This key is only present if query-block's |
| 5299 | # io-status is present, please see query-block documentation |
| 5300 | # for more information (since: 2.2) |
| 5301 | # |
Luiz Capitulino | 624ff57 | 2014-09-11 10:25:48 -0400 | [diff] [blame] | 5302 | # @reason: human readable string describing the error cause. |
| 5303 | # (This field is a debugging aid for humans, it should not |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 5304 | # be parsed by applications) (since: 2.2) |
Luiz Capitulino | 624ff57 | 2014-09-11 10:25:48 -0400 | [diff] [blame] | 5305 | # |
Wenchao Xia | 5a2d2cb | 2014-06-18 08:43:45 +0200 | [diff] [blame] | 5306 | # Note: If action is "stop", a STOP event will eventually follow the |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 5307 | # BLOCK_IO_ERROR event |
Wenchao Xia | 5a2d2cb | 2014-06-18 08:43:45 +0200 | [diff] [blame] | 5308 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 5309 | # Since: 0.13 |
Marc-André Lureau | 07c9f58 | 2016-06-23 15:52:10 +0200 | [diff] [blame] | 5310 | # |
| 5311 | # Example: |
| 5312 | # |
| 5313 | # <- { "event": "BLOCK_IO_ERROR", |
| 5314 | # "data": { "device": "ide0-hd1", |
| 5315 | # "node-name": "#block212", |
| 5316 | # "operation": "write", |
Victor Toso | 39e8bb2 | 2022-03-28 16:05:53 +0200 | [diff] [blame] | 5317 | # "action": "stop", |
| 5318 | # "reason": "No space left on device" }, |
Marc-André Lureau | 07c9f58 | 2016-06-23 15:52:10 +0200 | [diff] [blame] | 5319 | # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } |
| 5320 | # |
Wenchao Xia | 5a2d2cb | 2014-06-18 08:43:45 +0200 | [diff] [blame] | 5321 | ## |
| 5322 | { 'event': 'BLOCK_IO_ERROR', |
Kevin Wolf | bfe1a14 | 2018-03-05 15:59:35 +0100 | [diff] [blame] | 5323 | 'data': { 'device': 'str', '*node-name': 'str', |
| 5324 | 'operation': 'IoOperationType', |
Luiz Capitulino | 624ff57 | 2014-09-11 10:25:48 -0400 | [diff] [blame] | 5325 | 'action': 'BlockErrorAction', '*nospace': 'bool', |
| 5326 | 'reason': 'str' } } |
Wenchao Xia | 5a2d2cb | 2014-06-18 08:43:45 +0200 | [diff] [blame] | 5327 | |
| 5328 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 5329 | # @BLOCK_JOB_COMPLETED: |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5330 | # |
| 5331 | # Emitted when a block job has completed |
| 5332 | # |
| 5333 | # @type: job type |
| 5334 | # |
Alberto Garcia | 6aae5be | 2016-07-05 17:29:02 +0300 | [diff] [blame] | 5335 | # @device: The job identifier. Originally the device name but other |
| 5336 | # values are allowed since QEMU 2.7 |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5337 | # |
| 5338 | # @len: maximum progress value |
| 5339 | # |
| 5340 | # @offset: current progress value. On success this is equal to len. |
| 5341 | # On failure this is less than len |
| 5342 | # |
| 5343 | # @speed: rate limit, bytes per second |
| 5344 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 5345 | # @error: error message. Only present on failure. This field |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5346 | # contains a human-readable error message. There are no semantics |
| 5347 | # other than that streaming has failed and clients should not try to |
| 5348 | # interpret the error string |
| 5349 | # |
| 5350 | # Since: 1.1 |
Marc-André Lureau | e21e65b | 2016-06-23 15:52:56 +0200 | [diff] [blame] | 5351 | # |
| 5352 | # Example: |
| 5353 | # |
| 5354 | # <- { "event": "BLOCK_JOB_COMPLETED", |
| 5355 | # "data": { "type": "stream", "device": "virtio-disk0", |
| 5356 | # "len": 10737418240, "offset": 10737418240, |
| 5357 | # "speed": 0 }, |
| 5358 | # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } } |
| 5359 | # |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5360 | ## |
| 5361 | { 'event': 'BLOCK_JOB_COMPLETED', |
Kevin Wolf | 8e4c870 | 2018-04-12 18:01:07 +0200 | [diff] [blame] | 5362 | 'data': { 'type' : 'JobType', |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5363 | 'device': 'str', |
| 5364 | 'len' : 'int', |
| 5365 | 'offset': 'int', |
| 5366 | 'speed' : 'int', |
| 5367 | '*error': 'str' } } |
| 5368 | |
| 5369 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 5370 | # @BLOCK_JOB_CANCELLED: |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5371 | # |
| 5372 | # Emitted when a block job has been cancelled |
| 5373 | # |
| 5374 | # @type: job type |
| 5375 | # |
Alberto Garcia | 6aae5be | 2016-07-05 17:29:02 +0300 | [diff] [blame] | 5376 | # @device: The job identifier. Originally the device name but other |
| 5377 | # values are allowed since QEMU 2.7 |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5378 | # |
| 5379 | # @len: maximum progress value |
| 5380 | # |
| 5381 | # @offset: current progress value. On success this is equal to len. |
| 5382 | # On failure this is less than len |
| 5383 | # |
| 5384 | # @speed: rate limit, bytes per second |
| 5385 | # |
| 5386 | # Since: 1.1 |
Marc-André Lureau | e161df3 | 2016-06-23 15:53:50 +0200 | [diff] [blame] | 5387 | # |
| 5388 | # Example: |
| 5389 | # |
| 5390 | # <- { "event": "BLOCK_JOB_CANCELLED", |
| 5391 | # "data": { "type": "stream", "device": "virtio-disk0", |
| 5392 | # "len": 10737418240, "offset": 134217728, |
| 5393 | # "speed": 0 }, |
| 5394 | # "timestamp": { "seconds": 1267061043, "microseconds": 959568 } } |
| 5395 | # |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5396 | ## |
| 5397 | { 'event': 'BLOCK_JOB_CANCELLED', |
Kevin Wolf | 8e4c870 | 2018-04-12 18:01:07 +0200 | [diff] [blame] | 5398 | 'data': { 'type' : 'JobType', |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5399 | 'device': 'str', |
| 5400 | 'len' : 'int', |
| 5401 | 'offset': 'int', |
| 5402 | 'speed' : 'int' } } |
| 5403 | |
| 5404 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 5405 | # @BLOCK_JOB_ERROR: |
Wenchao Xia | 5a2d2cb | 2014-06-18 08:43:45 +0200 | [diff] [blame] | 5406 | # |
| 5407 | # Emitted when a block job encounters an error |
| 5408 | # |
Alberto Garcia | 6aae5be | 2016-07-05 17:29:02 +0300 | [diff] [blame] | 5409 | # @device: The job identifier. Originally the device name but other |
| 5410 | # values are allowed since QEMU 2.7 |
Wenchao Xia | 5a2d2cb | 2014-06-18 08:43:45 +0200 | [diff] [blame] | 5411 | # |
| 5412 | # @operation: I/O operation |
| 5413 | # |
| 5414 | # @action: action that has been taken |
| 5415 | # |
| 5416 | # Since: 1.3 |
Marc-André Lureau | af0e091 | 2016-06-23 15:54:20 +0200 | [diff] [blame] | 5417 | # |
| 5418 | # Example: |
| 5419 | # |
| 5420 | # <- { "event": "BLOCK_JOB_ERROR", |
| 5421 | # "data": { "device": "ide0-hd1", |
| 5422 | # "operation": "write", |
| 5423 | # "action": "stop" }, |
| 5424 | # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } |
| 5425 | # |
Wenchao Xia | 5a2d2cb | 2014-06-18 08:43:45 +0200 | [diff] [blame] | 5426 | ## |
| 5427 | { 'event': 'BLOCK_JOB_ERROR', |
| 5428 | 'data': { 'device' : 'str', |
| 5429 | 'operation': 'IoOperationType', |
Markus Armbruster | 823c686 | 2014-06-27 19:24:14 +0200 | [diff] [blame] | 5430 | 'action' : 'BlockErrorAction' } } |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5431 | |
| 5432 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 5433 | # @BLOCK_JOB_READY: |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5434 | # |
| 5435 | # Emitted when a block job is ready to complete |
| 5436 | # |
Markus Armbruster | 518848a | 2014-06-27 19:24:13 +0200 | [diff] [blame] | 5437 | # @type: job type |
| 5438 | # |
Alberto Garcia | 6aae5be | 2016-07-05 17:29:02 +0300 | [diff] [blame] | 5439 | # @device: The job identifier. Originally the device name but other |
| 5440 | # values are allowed since QEMU 2.7 |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5441 | # |
Markus Armbruster | 518848a | 2014-06-27 19:24:13 +0200 | [diff] [blame] | 5442 | # @len: maximum progress value |
| 5443 | # |
| 5444 | # @offset: current progress value. On success this is equal to len. |
| 5445 | # On failure this is less than len |
| 5446 | # |
| 5447 | # @speed: rate limit, bytes per second |
| 5448 | # |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5449 | # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 5450 | # event |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5451 | # |
| 5452 | # Since: 1.3 |
Marc-André Lureau | 11a3dee | 2016-06-23 15:54:49 +0200 | [diff] [blame] | 5453 | # |
| 5454 | # Example: |
| 5455 | # |
| 5456 | # <- { "event": "BLOCK_JOB_READY", |
| 5457 | # "data": { "device": "drive0", "type": "mirror", "speed": 0, |
Victor Toso | ccc9ddb | 2022-09-01 10:58:34 +0200 | [diff] [blame] | 5458 | # "len": 2097152, "offset": 2097152 }, |
Marc-André Lureau | 11a3dee | 2016-06-23 15:54:49 +0200 | [diff] [blame] | 5459 | # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } |
| 5460 | # |
Wenchao Xia | bcada37b | 2014-06-18 08:43:47 +0200 | [diff] [blame] | 5461 | ## |
| 5462 | { 'event': 'BLOCK_JOB_READY', |
Kevin Wolf | 8e4c870 | 2018-04-12 18:01:07 +0200 | [diff] [blame] | 5463 | 'data': { 'type' : 'JobType', |
Markus Armbruster | 518848a | 2014-06-27 19:24:13 +0200 | [diff] [blame] | 5464 | 'device': 'str', |
| 5465 | 'len' : 'int', |
| 5466 | 'offset': 'int', |
| 5467 | 'speed' : 'int' } } |
Hu Tao | ffeaac9 | 2014-09-10 17:05:47 +0800 | [diff] [blame] | 5468 | |
Marc-André Lureau | 49687ac | 2016-11-17 19:54:51 +0400 | [diff] [blame] | 5469 | ## |
John Snow | 5f24159 | 2018-03-10 03:27:42 -0500 | [diff] [blame] | 5470 | # @BLOCK_JOB_PENDING: |
| 5471 | # |
| 5472 | # Emitted when a block job is awaiting explicit authorization to finalize graph |
| 5473 | # changes via @block-job-finalize. If this job is part of a transaction, it will |
| 5474 | # not emit this event until the transaction has converged first. |
| 5475 | # |
| 5476 | # @type: job type |
| 5477 | # |
| 5478 | # @id: The job identifier. |
| 5479 | # |
| 5480 | # Since: 2.12 |
| 5481 | # |
| 5482 | # Example: |
| 5483 | # |
Victor Toso | 2c29d9b | 2022-03-28 16:05:54 +0200 | [diff] [blame] | 5484 | # <- { "event": "BLOCK_JOB_PENDING", |
| 5485 | # "data": { "type": "mirror", "id": "backup_1" }, |
John Snow | 5f24159 | 2018-03-10 03:27:42 -0500 | [diff] [blame] | 5486 | # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } |
| 5487 | # |
| 5488 | ## |
| 5489 | { 'event': 'BLOCK_JOB_PENDING', |
Kevin Wolf | 8e4c870 | 2018-04-12 18:01:07 +0200 | [diff] [blame] | 5490 | 'data': { 'type' : 'JobType', |
John Snow | 5f24159 | 2018-03-10 03:27:42 -0500 | [diff] [blame] | 5491 | 'id' : 'str' } } |
| 5492 | |
| 5493 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 5494 | # @PreallocMode: |
Hu Tao | ffeaac9 | 2014-09-10 17:05:47 +0800 | [diff] [blame] | 5495 | # |
| 5496 | # Preallocation mode of QEMU image file |
| 5497 | # |
| 5498 | # @off: no preallocation |
| 5499 | # @metadata: preallocate only for metadata |
| 5500 | # @falloc: like @full preallocation but allocate disk space by |
Max Reitz | fa27c47 | 2019-07-11 15:29:35 +0200 | [diff] [blame] | 5501 | # posix_fallocate() rather than writing data. |
| 5502 | # @full: preallocate all data by writing it to the device to ensure |
| 5503 | # disk space is really available. This data may or may not be |
| 5504 | # zero, depending on the image format and storage. |
| 5505 | # @full preallocation also sets up metadata correctly. |
Hu Tao | ffeaac9 | 2014-09-10 17:05:47 +0800 | [diff] [blame] | 5506 | # |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 5507 | # Since: 2.2 |
Hu Tao | ffeaac9 | 2014-09-10 17:05:47 +0800 | [diff] [blame] | 5508 | ## |
| 5509 | { 'enum': 'PreallocMode', |
| 5510 | 'data': [ 'off', 'metadata', 'falloc', 'full' ] } |
Francesco Romani | e246211 | 2015-01-12 14:11:13 +0100 | [diff] [blame] | 5511 | |
| 5512 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 5513 | # @BLOCK_WRITE_THRESHOLD: |
Francesco Romani | e246211 | 2015-01-12 14:11:13 +0100 | [diff] [blame] | 5514 | # |
| 5515 | # Emitted when writes on block device reaches or exceeds the |
| 5516 | # configured write threshold. For thin-provisioned devices, this |
| 5517 | # means the device should be extended to avoid pausing for |
| 5518 | # disk exhaustion. |
| 5519 | # The event is one shot. Once triggered, it needs to be |
Eric Blake | f85d66f | 2017-05-12 14:30:15 -0500 | [diff] [blame] | 5520 | # re-registered with another block-set-write-threshold command. |
Francesco Romani | e246211 | 2015-01-12 14:11:13 +0100 | [diff] [blame] | 5521 | # |
| 5522 | # @node-name: graph node name on which the threshold was exceeded. |
| 5523 | # |
| 5524 | # @amount-exceeded: amount of data which exceeded the threshold, in bytes. |
| 5525 | # |
| 5526 | # @write-threshold: last configured threshold, in bytes. |
| 5527 | # |
| 5528 | # Since: 2.3 |
| 5529 | ## |
| 5530 | { 'event': 'BLOCK_WRITE_THRESHOLD', |
| 5531 | 'data': { 'node-name': 'str', |
| 5532 | 'amount-exceeded': 'uint64', |
| 5533 | 'write-threshold': 'uint64' } } |
| 5534 | |
| 5535 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 5536 | # @block-set-write-threshold: |
Francesco Romani | e246211 | 2015-01-12 14:11:13 +0100 | [diff] [blame] | 5537 | # |
Marc-André Lureau | e817862 | 2016-06-23 15:04:41 +0200 | [diff] [blame] | 5538 | # Change the write threshold for a block drive. An event will be |
| 5539 | # delivered if a write to this block drive crosses the configured |
| 5540 | # threshold. The threshold is an offset, thus must be |
| 5541 | # non-negative. Default is no write threshold. Setting the threshold |
| 5542 | # to zero disables it. |
| 5543 | # |
Francesco Romani | e246211 | 2015-01-12 14:11:13 +0100 | [diff] [blame] | 5544 | # This is useful to transparently resize thin-provisioned drives without |
| 5545 | # the guest OS noticing. |
| 5546 | # |
| 5547 | # @node-name: graph node name on which the threshold must be set. |
| 5548 | # |
| 5549 | # @write-threshold: configured threshold for the block device, bytes. |
| 5550 | # Use 0 to disable the threshold. |
| 5551 | # |
Francesco Romani | e246211 | 2015-01-12 14:11:13 +0100 | [diff] [blame] | 5552 | # Since: 2.3 |
Marc-André Lureau | e817862 | 2016-06-23 15:04:41 +0200 | [diff] [blame] | 5553 | # |
| 5554 | # Example: |
| 5555 | # |
| 5556 | # -> { "execute": "block-set-write-threshold", |
| 5557 | # "arguments": { "node-name": "mydev", |
| 5558 | # "write-threshold": 17179869184 } } |
| 5559 | # <- { "return": {} } |
| 5560 | # |
Francesco Romani | e246211 | 2015-01-12 14:11:13 +0100 | [diff] [blame] | 5561 | ## |
| 5562 | { 'command': 'block-set-write-threshold', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 5563 | 'data': { 'node-name': 'str', 'write-threshold': 'uint64' }, |
| 5564 | 'allow-preconfig': true } |
Wen Congyang | 7f82159 | 2016-05-10 15:36:39 +0800 | [diff] [blame] | 5565 | |
| 5566 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 5567 | # @x-blockdev-change: |
Wen Congyang | 7f82159 | 2016-05-10 15:36:39 +0800 | [diff] [blame] | 5568 | # |
| 5569 | # Dynamically reconfigure the block driver state graph. It can be used |
| 5570 | # to add, remove, insert or replace a graph node. Currently only the |
| 5571 | # Quorum driver implements this feature to add or remove its child. This |
| 5572 | # is useful to fix a broken quorum child. |
| 5573 | # |
| 5574 | # If @node is specified, it will be inserted under @parent. @child |
| 5575 | # may not be specified in this case. If both @parent and @child are |
| 5576 | # specified but @node is not, @child will be detached from @parent. |
| 5577 | # |
| 5578 | # @parent: the id or name of the parent node. |
| 5579 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 5580 | # @child: the name of a child under the given parent node. |
Wen Congyang | 7f82159 | 2016-05-10 15:36:39 +0800 | [diff] [blame] | 5581 | # |
Markus Armbruster | 1d8bda1 | 2017-03-15 13:57:06 +0100 | [diff] [blame] | 5582 | # @node: the name of the node that will be added. |
Wen Congyang | 7f82159 | 2016-05-10 15:36:39 +0800 | [diff] [blame] | 5583 | # |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 5584 | # Features: |
| 5585 | # @unstable: This command is experimental, and its API is not stable. It |
| 5586 | # does not support all kinds of operations, all kinds of |
| 5587 | # children, nor all block drivers. |
Wen Congyang | 7f82159 | 2016-05-10 15:36:39 +0800 | [diff] [blame] | 5588 | # |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 5589 | # FIXME Removing children from a quorum node means introducing |
| 5590 | # gaps in the child indices. This cannot be represented in the |
| 5591 | # 'children' list of BlockdevOptionsQuorum, as returned by |
| 5592 | # .bdrv_refresh_filename(). |
Kevin Wolf | 6b4738c | 2017-12-15 11:54:22 +0100 | [diff] [blame] | 5593 | # |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 5594 | # Warning: The data in a new quorum child MUST be consistent |
| 5595 | # with that of the rest of the array. |
Wen Congyang | 7f82159 | 2016-05-10 15:36:39 +0800 | [diff] [blame] | 5596 | # |
| 5597 | # Since: 2.7 |
Marc-André Lureau | bd77ea2 | 2016-06-23 15:28:23 +0200 | [diff] [blame] | 5598 | # |
| 5599 | # Example: |
| 5600 | # |
| 5601 | # 1. Add a new node to a quorum |
| 5602 | # -> { "execute": "blockdev-add", |
| 5603 | # "arguments": { |
Eric Blake | 244d04d | 2017-05-23 12:44:20 -0500 | [diff] [blame] | 5604 | # "driver": "raw", |
| 5605 | # "node-name": "new_node", |
| 5606 | # "file": { "driver": "file", |
| 5607 | # "filename": "test.raw" } } } |
Marc-André Lureau | bd77ea2 | 2016-06-23 15:28:23 +0200 | [diff] [blame] | 5608 | # <- { "return": {} } |
| 5609 | # -> { "execute": "x-blockdev-change", |
| 5610 | # "arguments": { "parent": "disk1", |
| 5611 | # "node": "new_node" } } |
| 5612 | # <- { "return": {} } |
| 5613 | # |
| 5614 | # 2. Delete a quorum's node |
| 5615 | # -> { "execute": "x-blockdev-change", |
| 5616 | # "arguments": { "parent": "disk1", |
| 5617 | # "child": "children.1" } } |
| 5618 | # <- { "return": {} } |
| 5619 | # |
Wen Congyang | 7f82159 | 2016-05-10 15:36:39 +0800 | [diff] [blame] | 5620 | ## |
| 5621 | { 'command': 'x-blockdev-change', |
| 5622 | 'data' : { 'parent': 'str', |
| 5623 | '*child': 'str', |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 5624 | '*node': 'str' }, |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 5625 | 'features': [ 'unstable' ], |
| 5626 | 'allow-preconfig': true } |
Stefan Hajnoczi | ca00bbb | 2017-12-06 14:45:49 +0000 | [diff] [blame] | 5627 | |
| 5628 | ## |
| 5629 | # @x-blockdev-set-iothread: |
| 5630 | # |
| 5631 | # Move @node and its children into the @iothread. If @iothread is null then |
| 5632 | # move @node and its children into the main loop. |
| 5633 | # |
| 5634 | # The node must not be attached to a BlockBackend. |
| 5635 | # |
| 5636 | # @node-name: the name of the block driver node |
| 5637 | # |
| 5638 | # @iothread: the name of the IOThread object or null for the main loop |
| 5639 | # |
Stefan Hajnoczi | 882e9b8 | 2017-12-07 20:13:17 +0000 | [diff] [blame] | 5640 | # @force: true if the node and its children should be moved when a BlockBackend |
| 5641 | # is already attached |
| 5642 | # |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 5643 | # Features: |
| 5644 | # @unstable: This command is experimental and intended for test cases that |
| 5645 | # need control over IOThreads only. |
Stefan Hajnoczi | ca00bbb | 2017-12-06 14:45:49 +0000 | [diff] [blame] | 5646 | # |
| 5647 | # Since: 2.12 |
| 5648 | # |
| 5649 | # Example: |
| 5650 | # |
| 5651 | # 1. Move a node into an IOThread |
| 5652 | # -> { "execute": "x-blockdev-set-iothread", |
| 5653 | # "arguments": { "node-name": "disk1", |
| 5654 | # "iothread": "iothread0" } } |
| 5655 | # <- { "return": {} } |
| 5656 | # |
| 5657 | # 2. Move a node into the main loop |
| 5658 | # -> { "execute": "x-blockdev-set-iothread", |
| 5659 | # "arguments": { "node-name": "disk1", |
| 5660 | # "iothread": null } } |
| 5661 | # <- { "return": {} } |
| 5662 | # |
| 5663 | ## |
| 5664 | { 'command': 'x-blockdev-set-iothread', |
| 5665 | 'data' : { 'node-name': 'str', |
Stefan Hajnoczi | 882e9b8 | 2017-12-07 20:13:17 +0000 | [diff] [blame] | 5666 | 'iothread': 'StrOrNull', |
Markus Armbruster | 9fb49da | 2021-10-28 12:25:13 +0200 | [diff] [blame] | 5667 | '*force': 'bool' }, |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 5668 | 'features': [ 'unstable' ], |
| 5669 | 'allow-preconfig': true } |
Kevin Wolf | b3cf1ec | 2020-02-24 15:29:52 +0100 | [diff] [blame] | 5670 | |
| 5671 | ## |
Kevin Wolf | b3cf1ec | 2020-02-24 15:29:52 +0100 | [diff] [blame] | 5672 | # @QuorumOpType: |
| 5673 | # |
| 5674 | # An enumeration of the quorum operation types |
| 5675 | # |
| 5676 | # @read: read operation |
| 5677 | # |
| 5678 | # @write: write operation |
| 5679 | # |
| 5680 | # @flush: flush operation |
| 5681 | # |
| 5682 | # Since: 2.6 |
| 5683 | ## |
| 5684 | { 'enum': 'QuorumOpType', |
| 5685 | 'data': [ 'read', 'write', 'flush' ] } |
| 5686 | |
| 5687 | ## |
| 5688 | # @QUORUM_FAILURE: |
| 5689 | # |
| 5690 | # Emitted by the Quorum block driver if it fails to establish a quorum |
| 5691 | # |
| 5692 | # @reference: device name if defined else node name |
| 5693 | # |
| 5694 | # @sector-num: number of the first sector of the failed read operation |
| 5695 | # |
| 5696 | # @sectors-count: failed read operation sector count |
| 5697 | # |
| 5698 | # Note: This event is rate-limited. |
| 5699 | # |
| 5700 | # Since: 2.0 |
| 5701 | # |
| 5702 | # Example: |
| 5703 | # |
| 5704 | # <- { "event": "QUORUM_FAILURE", |
| 5705 | # "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 }, |
| 5706 | # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } } |
| 5707 | # |
| 5708 | ## |
| 5709 | { 'event': 'QUORUM_FAILURE', |
| 5710 | 'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } } |
| 5711 | |
| 5712 | ## |
| 5713 | # @QUORUM_REPORT_BAD: |
| 5714 | # |
| 5715 | # Emitted to report a corruption of a Quorum file |
| 5716 | # |
| 5717 | # @type: quorum operation type (Since 2.6) |
| 5718 | # |
| 5719 | # @error: error message. Only present on failure. This field |
| 5720 | # contains a human-readable error message. There are no semantics other |
| 5721 | # than that the block layer reported an error and clients should not |
| 5722 | # try to interpret the error string. |
| 5723 | # |
| 5724 | # @node-name: the graph node name of the block driver state |
| 5725 | # |
| 5726 | # @sector-num: number of the first sector of the failed read operation |
| 5727 | # |
| 5728 | # @sectors-count: failed read operation sector count |
| 5729 | # |
| 5730 | # Note: This event is rate-limited. |
| 5731 | # |
| 5732 | # Since: 2.0 |
| 5733 | # |
| 5734 | # Example: |
| 5735 | # |
| 5736 | # 1. Read operation |
| 5737 | # |
| 5738 | # { "event": "QUORUM_REPORT_BAD", |
| 5739 | # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5, |
| 5740 | # "type": "read" }, |
| 5741 | # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } } |
| 5742 | # |
| 5743 | # 2. Flush operation |
| 5744 | # |
| 5745 | # { "event": "QUORUM_REPORT_BAD", |
| 5746 | # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120, |
| 5747 | # "type": "flush", "error": "Broken pipe" }, |
| 5748 | # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } } |
| 5749 | # |
| 5750 | ## |
| 5751 | { 'event': 'QUORUM_REPORT_BAD', |
| 5752 | 'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str', |
| 5753 | 'sector-num': 'int', 'sectors-count': 'int' } } |
| 5754 | |
| 5755 | ## |
| 5756 | # @BlockdevSnapshotInternal: |
| 5757 | # |
| 5758 | # @device: the device name or node-name of a root node to generate the snapshot |
| 5759 | # from |
| 5760 | # |
| 5761 | # @name: the name of the internal snapshot to be created |
| 5762 | # |
| 5763 | # Notes: In transaction, if @name is empty, or any snapshot matching @name |
| 5764 | # exists, the operation will fail. Only some image formats support it, |
Markus Armbruster | 09ec851 | 2021-05-01 09:57:47 +0200 | [diff] [blame] | 5765 | # for example, qcow2, and rbd. |
Kevin Wolf | b3cf1ec | 2020-02-24 15:29:52 +0100 | [diff] [blame] | 5766 | # |
| 5767 | # Since: 1.7 |
| 5768 | ## |
| 5769 | { 'struct': 'BlockdevSnapshotInternal', |
| 5770 | 'data': { 'device': 'str', 'name': 'str' } } |
| 5771 | |
| 5772 | ## |
| 5773 | # @blockdev-snapshot-internal-sync: |
| 5774 | # |
| 5775 | # Synchronously take an internal snapshot of a block device, when the |
| 5776 | # format of the image used supports it. If the name is an empty |
| 5777 | # string, or a snapshot with name already exists, the operation will |
| 5778 | # fail. |
| 5779 | # |
| 5780 | # For the arguments, see the documentation of BlockdevSnapshotInternal. |
| 5781 | # |
| 5782 | # Returns: - nothing on success |
| 5783 | # - If @device is not a valid block device, GenericError |
| 5784 | # - If any snapshot matching @name exists, or @name is empty, |
| 5785 | # GenericError |
| 5786 | # - If the format of the image used does not support it, |
| 5787 | # BlockFormatFeatureNotSupported |
| 5788 | # |
| 5789 | # Since: 1.7 |
| 5790 | # |
| 5791 | # Example: |
| 5792 | # |
| 5793 | # -> { "execute": "blockdev-snapshot-internal-sync", |
| 5794 | # "arguments": { "device": "ide-hd0", |
| 5795 | # "name": "snapshot0" } |
| 5796 | # } |
| 5797 | # <- { "return": {} } |
| 5798 | # |
| 5799 | ## |
| 5800 | { 'command': 'blockdev-snapshot-internal-sync', |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 5801 | 'data': 'BlockdevSnapshotInternal', |
| 5802 | 'allow-preconfig': true } |
Kevin Wolf | b3cf1ec | 2020-02-24 15:29:52 +0100 | [diff] [blame] | 5803 | |
| 5804 | ## |
| 5805 | # @blockdev-snapshot-delete-internal-sync: |
| 5806 | # |
| 5807 | # Synchronously delete an internal snapshot of a block device, when the format |
| 5808 | # of the image used support it. The snapshot is identified by name or id or |
| 5809 | # both. One of the name or id is required. Return SnapshotInfo for the |
| 5810 | # successfully deleted snapshot. |
| 5811 | # |
| 5812 | # @device: the device name or node-name of a root node to delete the snapshot |
| 5813 | # from |
| 5814 | # |
| 5815 | # @id: optional the snapshot's ID to be deleted |
| 5816 | # |
| 5817 | # @name: optional the snapshot's name to be deleted |
| 5818 | # |
| 5819 | # Returns: - SnapshotInfo on success |
| 5820 | # - If @device is not a valid block device, GenericError |
| 5821 | # - If snapshot not found, GenericError |
| 5822 | # - If the format of the image used does not support it, |
| 5823 | # BlockFormatFeatureNotSupported |
| 5824 | # - If @id and @name are both not specified, GenericError |
| 5825 | # |
| 5826 | # Since: 1.7 |
| 5827 | # |
| 5828 | # Example: |
| 5829 | # |
| 5830 | # -> { "execute": "blockdev-snapshot-delete-internal-sync", |
| 5831 | # "arguments": { "device": "ide-hd0", |
| 5832 | # "name": "snapshot0" } |
| 5833 | # } |
| 5834 | # <- { "return": { |
| 5835 | # "id": "1", |
| 5836 | # "name": "snapshot0", |
| 5837 | # "vm-state-size": 0, |
| 5838 | # "date-sec": 1000012, |
| 5839 | # "date-nsec": 10, |
| 5840 | # "vm-clock-sec": 100, |
Pavel Dovgalyuk | b39847a | 2020-10-03 20:13:08 +0300 | [diff] [blame] | 5841 | # "vm-clock-nsec": 20, |
| 5842 | # "icount": 220414 |
Kevin Wolf | b3cf1ec | 2020-02-24 15:29:52 +0100 | [diff] [blame] | 5843 | # } |
| 5844 | # } |
| 5845 | # |
| 5846 | ## |
| 5847 | { 'command': 'blockdev-snapshot-delete-internal-sync', |
| 5848 | 'data': { 'device': 'str', '*id': 'str', '*name': 'str'}, |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 5849 | 'returns': 'SnapshotInfo', |
| 5850 | 'allow-preconfig': true } |
Hanna Reitz | 456e751 | 2022-06-20 18:26:55 +0200 | [diff] [blame] | 5851 | |
| 5852 | ## |
| 5853 | # @DummyBlockCoreForceArrays: |
| 5854 | # |
Hanna Reitz | c04d0ab | 2022-06-20 18:27:03 +0200 | [diff] [blame] | 5855 | # Not used by QMP; hack to let us use BlockGraphInfoList internally |
Hanna Reitz | 456e751 | 2022-06-20 18:26:55 +0200 | [diff] [blame] | 5856 | # |
| 5857 | # Since: 8.0 |
| 5858 | ## |
| 5859 | { 'struct': 'DummyBlockCoreForceArrays', |
Hanna Reitz | c04d0ab | 2022-06-20 18:27:03 +0200 | [diff] [blame] | 5860 | 'data': { 'unused-block-graph-info': ['BlockGraphInfo'] } } |