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 devices |
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': 'block-core.json' } |
| 9 | |
Benoît Canet | 2e95fa1 | 2014-06-05 13:45:32 +0200 | [diff] [blame] | 10 | ## |
Markus Armbruster | f5cf31c | 2017-08-24 21:14:08 +0200 | [diff] [blame] | 11 | # == Additional block stuff (VM related) |
Marc-André Lureau | d3a4837 | 2017-01-13 15:41:23 +0100 | [diff] [blame] | 12 | ## |
| 13 | |
| 14 | ## |
Marc-André Lureau | f169f8f | 2015-09-25 16:03:30 +0200 | [diff] [blame] | 15 | # @BiosAtaTranslation: |
Benoît Canet | 2e95fa1 | 2014-06-05 13:45:32 +0200 | [diff] [blame] | 16 | # |
| 17 | # Policy that BIOS should use to interpret cylinder/head/sector |
| 18 | # addresses. Note that Bochs BIOS and SeaBIOS will not actually |
| 19 | # translate logical CHS to physical; instead, they will use logical |
| 20 | # block addressing. |
| 21 | # |
| 22 | # @auto: If cylinder/heads/sizes are passed, choose between none and LBA |
| 23 | # depending on the size of the disk. If they are not passed, |
| 24 | # choose none if QEMU can guess that the disk had 16 or fewer |
| 25 | # heads, large if QEMU can guess that the disk had 131072 or |
| 26 | # fewer tracks across all heads (i.e. cylinders*heads<131072), |
| 27 | # otherwise LBA. |
| 28 | # |
| 29 | # @none: The physical disk geometry is equal to the logical geometry. |
| 30 | # |
| 31 | # @lba: Assume 63 sectors per track and one of 16, 32, 64, 128 or 255 |
| 32 | # heads (if fewer than 255 are enough to cover the whole disk |
| 33 | # with 1024 cylinders/head). The number of cylinders/head is |
| 34 | # then computed based on the number of sectors and heads. |
| 35 | # |
| 36 | # @large: The number of cylinders per head is scaled down to 1024 |
| 37 | # by correspondingly scaling up the number of heads. |
| 38 | # |
| 39 | # @rechs: Same as @large, but first convert a 16-head geometry to |
| 40 | # 15-head, by proportionally scaling up the number of |
| 41 | # cylinders/head. |
| 42 | # |
| 43 | # Since: 2.0 |
| 44 | ## |
| 45 | { 'enum': 'BiosAtaTranslation', |
| 46 | 'data': ['auto', 'none', 'lba', 'large', 'rechs']} |
| 47 | |
| 48 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 49 | # @FloppyDriveType: |
John Snow | 2da44dd | 2016-01-22 15:50:56 -0500 | [diff] [blame] | 50 | # |
| 51 | # Type of Floppy drive to be emulated by the Floppy Disk Controller. |
| 52 | # |
Andrea Bolognani | c0ac533 | 2022-05-03 09:37:36 +0200 | [diff] [blame] | 53 | # @144: 1.44MB 3.5" drive |
| 54 | # @288: 2.88MB 3.5" drive |
| 55 | # @120: 1.2MB 5.25" drive |
John Snow | 2da44dd | 2016-01-22 15:50:56 -0500 | [diff] [blame] | 56 | # @none: No drive connected |
| 57 | # @auto: Automatically determined by inserted media at boot |
| 58 | # |
| 59 | # Since: 2.6 |
| 60 | ## |
| 61 | { 'enum': 'FloppyDriveType', |
| 62 | 'data': ['144', '288', '120', 'none', 'auto']} |
| 63 | |
| 64 | ## |
Paolo Bonzini | 5f64089 | 2018-02-28 18:47:57 +0100 | [diff] [blame] | 65 | # @PRManagerInfo: |
| 66 | # |
| 67 | # Information about a persistent reservation manager |
| 68 | # |
| 69 | # @id: the identifier of the persistent reservation manager |
| 70 | # |
| 71 | # @connected: true if the persistent reservation manager is connected to |
| 72 | # the underlying storage or helper |
| 73 | # |
| 74 | # Since: 3.0 |
| 75 | ## |
| 76 | { 'struct': 'PRManagerInfo', |
| 77 | 'data': {'id': 'str', 'connected': 'bool'} } |
| 78 | |
| 79 | ## |
| 80 | # @query-pr-managers: |
| 81 | # |
| 82 | # Returns a list of information about each persistent reservation manager. |
| 83 | # |
| 84 | # Returns: a list of @PRManagerInfo for each persistent reservation manager |
| 85 | # |
| 86 | # Since: 3.0 |
| 87 | ## |
| 88 | { 'command': 'query-pr-managers', 'returns': ['PRManagerInfo'], |
| 89 | 'allow-preconfig': true } |
| 90 | |
Benoît Canet | 2e95fa1 | 2014-06-05 13:45:32 +0200 | [diff] [blame] | 91 | ## |
| 92 | # @eject: |
| 93 | # |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 94 | # Ejects the medium from a removable drive. |
Benoît Canet | 2e95fa1 | 2014-06-05 13:45:32 +0200 | [diff] [blame] | 95 | # |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 96 | # @device: Block device name |
Kevin Wolf | fbe2d81 | 2016-09-20 13:38:46 +0200 | [diff] [blame] | 97 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 98 | # @id: The name or QOM path of the guest device (since: 2.8) |
Benoît Canet | 2e95fa1 | 2014-06-05 13:45:32 +0200 | [diff] [blame] | 99 | # |
Peter Maydell | 26ec4e5 | 2020-02-13 17:56:26 +0000 | [diff] [blame] | 100 | # @force: If true, eject regardless of whether the drive is locked. |
| 101 | # If not specified, the default value is false. |
Benoît Canet | 2e95fa1 | 2014-06-05 13:45:32 +0200 | [diff] [blame] | 102 | # |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 103 | # Features: |
| 104 | # @deprecated: Member @device is deprecated. Use @id instead. |
| 105 | # |
Peter Maydell | e050e42 | 2020-02-13 17:56:30 +0000 | [diff] [blame] | 106 | # Returns: - Nothing on success |
| 107 | # - If @device is not a valid block device, DeviceNotFound |
Andrea Bolognani | 4ae65a5 | 2022-05-03 09:37:32 +0200 | [diff] [blame] | 108 | # |
Andrea Bolognani | 23e4645 | 2022-05-03 09:37:35 +0200 | [diff] [blame] | 109 | # Notes: Ejecting a device with no media results in success |
Benoît Canet | 2e95fa1 | 2014-06-05 13:45:32 +0200 | [diff] [blame] | 110 | # |
Markus Armbruster | 9bc6e89 | 2020-11-18 07:41:58 +0100 | [diff] [blame] | 111 | # Since: 0.14 |
Marc-André Lureau | 5fba0a7 | 2016-06-23 15:08:55 +0200 | [diff] [blame] | 112 | # |
| 113 | # Example: |
| 114 | # |
Eric Blake | 244d04d | 2017-05-23 12:44:20 -0500 | [diff] [blame] | 115 | # -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } } |
Marc-André Lureau | 5fba0a7 | 2016-06-23 15:08:55 +0200 | [diff] [blame] | 116 | # <- { "return": {} } |
Benoît Canet | 2e95fa1 | 2014-06-05 13:45:32 +0200 | [diff] [blame] | 117 | ## |
Kevin Wolf | fbe2d81 | 2016-09-20 13:38:46 +0200 | [diff] [blame] | 118 | { 'command': 'eject', |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 119 | 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] }, |
Kevin Wolf | fbe2d81 | 2016-09-20 13:38:46 +0200 | [diff] [blame] | 120 | '*id': 'str', |
| 121 | '*force': 'bool' } } |
Benoît Canet | 2e95fa1 | 2014-06-05 13:45:32 +0200 | [diff] [blame] | 122 | |
| 123 | ## |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 124 | # @blockdev-open-tray: |
| 125 | # |
| 126 | # Opens a block device's tray. If there is a block driver state tree inserted as |
| 127 | # a medium, it will become inaccessible to the guest (but it will remain |
| 128 | # associated to the block device, so closing the tray will make it accessible |
| 129 | # again). |
| 130 | # |
| 131 | # If the tray was already open before, this will be a no-op. |
| 132 | # |
| 133 | # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in |
| 134 | # which no such event will be generated, these include: |
| 135 | # |
| 136 | # - if the guest has locked the tray, @force is false and the guest does not |
| 137 | # respond to the eject request |
| 138 | # - if the BlockBackend denoted by @device does not have a guest device attached |
| 139 | # to it |
| 140 | # - if the guest device does not have an actual tray |
| 141 | # |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 142 | # @device: Block device name |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 143 | # |
| 144 | # @id: The name or QOM path of the guest device (since: 2.8) |
| 145 | # |
| 146 | # @force: if false (the default), an eject request will be sent to |
| 147 | # the guest if it has locked the tray (and the tray will not be opened |
| 148 | # immediately); if true, the tray will be opened regardless of whether |
| 149 | # it is locked |
| 150 | # |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 151 | # Features: |
| 152 | # @deprecated: Member @device is deprecated. Use @id instead. |
| 153 | # |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 154 | # Since: 2.5 |
| 155 | # |
| 156 | # Example: |
| 157 | # |
| 158 | # -> { "execute": "blockdev-open-tray", |
| 159 | # "arguments": { "id": "ide0-1-0" } } |
| 160 | # |
| 161 | # <- { "timestamp": { "seconds": 1418751016, |
| 162 | # "microseconds": 716996 }, |
| 163 | # "event": "DEVICE_TRAY_MOVED", |
| 164 | # "data": { "device": "ide1-cd0", |
| 165 | # "id": "ide0-1-0", |
| 166 | # "tray-open": true } } |
| 167 | # |
| 168 | # <- { "return": {} } |
| 169 | # |
| 170 | ## |
| 171 | { 'command': 'blockdev-open-tray', |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 172 | 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] }, |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 173 | '*id': 'str', |
| 174 | '*force': 'bool' } } |
| 175 | |
| 176 | ## |
| 177 | # @blockdev-close-tray: |
| 178 | # |
| 179 | # Closes a block device's tray. If there is a block driver state tree associated |
| 180 | # with the block device (which is currently ejected), that tree will be loaded |
| 181 | # as the medium. |
| 182 | # |
| 183 | # If the tray was already closed before, this will be a no-op. |
| 184 | # |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 185 | # @device: Block device name |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 186 | # |
| 187 | # @id: The name or QOM path of the guest device (since: 2.8) |
| 188 | # |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 189 | # Features: |
| 190 | # @deprecated: Member @device is deprecated. Use @id instead. |
| 191 | # |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 192 | # Since: 2.5 |
| 193 | # |
| 194 | # Example: |
| 195 | # |
| 196 | # -> { "execute": "blockdev-close-tray", |
| 197 | # "arguments": { "id": "ide0-1-0" } } |
| 198 | # |
| 199 | # <- { "timestamp": { "seconds": 1418751345, |
| 200 | # "microseconds": 272147 }, |
| 201 | # "event": "DEVICE_TRAY_MOVED", |
| 202 | # "data": { "device": "ide1-cd0", |
| 203 | # "id": "ide0-1-0", |
| 204 | # "tray-open": false } } |
| 205 | # |
| 206 | # <- { "return": {} } |
| 207 | # |
| 208 | ## |
| 209 | { 'command': 'blockdev-close-tray', |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 210 | 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] }, |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 211 | '*id': 'str' } } |
| 212 | |
| 213 | ## |
| 214 | # @blockdev-remove-medium: |
| 215 | # |
| 216 | # Removes a medium (a block driver state tree) from a block device. That block |
| 217 | # device's tray must currently be open (unless there is no attached guest |
| 218 | # device). |
| 219 | # |
| 220 | # If the tray is open and there is no medium inserted, this will be a no-op. |
| 221 | # |
| 222 | # @id: The name or QOM path of the guest device |
| 223 | # |
| 224 | # Since: 2.12 |
| 225 | # |
| 226 | # Example: |
| 227 | # |
| 228 | # -> { "execute": "blockdev-remove-medium", |
| 229 | # "arguments": { "id": "ide0-1-0" } } |
| 230 | # |
| 231 | # <- { "error": { "class": "GenericError", |
| 232 | # "desc": "Tray of device 'ide0-1-0' is not open" } } |
| 233 | # |
| 234 | # -> { "execute": "blockdev-open-tray", |
| 235 | # "arguments": { "id": "ide0-1-0" } } |
| 236 | # |
| 237 | # <- { "timestamp": { "seconds": 1418751627, |
| 238 | # "microseconds": 549958 }, |
| 239 | # "event": "DEVICE_TRAY_MOVED", |
| 240 | # "data": { "device": "ide1-cd0", |
| 241 | # "id": "ide0-1-0", |
| 242 | # "tray-open": true } } |
| 243 | # |
| 244 | # <- { "return": {} } |
| 245 | # |
| 246 | # -> { "execute": "blockdev-remove-medium", |
| 247 | # "arguments": { "id": "ide0-1-0" } } |
| 248 | # |
| 249 | # <- { "return": {} } |
| 250 | # |
| 251 | ## |
| 252 | { 'command': 'blockdev-remove-medium', |
| 253 | 'data': { 'id': 'str' } } |
| 254 | |
| 255 | ## |
| 256 | # @blockdev-insert-medium: |
| 257 | # |
| 258 | # Inserts a medium (a block driver state tree) into a block device. That block |
| 259 | # device's tray must currently be open (unless there is no attached guest |
| 260 | # device) and there must be no medium inserted already. |
| 261 | # |
| 262 | # @id: The name or QOM path of the guest device |
| 263 | # |
| 264 | # @node-name: name of a node in the block driver state graph |
| 265 | # |
| 266 | # Since: 2.12 |
| 267 | # |
| 268 | # Example: |
| 269 | # |
| 270 | # -> { "execute": "blockdev-add", |
| 271 | # "arguments": { |
| 272 | # "node-name": "node0", |
| 273 | # "driver": "raw", |
| 274 | # "file": { "driver": "file", |
| 275 | # "filename": "fedora.iso" } } } |
| 276 | # <- { "return": {} } |
| 277 | # |
| 278 | # -> { "execute": "blockdev-insert-medium", |
| 279 | # "arguments": { "id": "ide0-1-0", |
| 280 | # "node-name": "node0" } } |
| 281 | # |
| 282 | # <- { "return": {} } |
| 283 | # |
| 284 | ## |
| 285 | { 'command': 'blockdev-insert-medium', |
| 286 | 'data': { 'id': 'str', |
| 287 | 'node-name': 'str'} } |
| 288 | |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 289 | ## |
| 290 | # @BlockdevChangeReadOnlyMode: |
| 291 | # |
| 292 | # Specifies the new read-only mode of a block device subject to the |
| 293 | # @blockdev-change-medium command. |
| 294 | # |
| 295 | # @retain: Retains the current read-only mode |
| 296 | # |
| 297 | # @read-only: Makes the device read-only |
| 298 | # |
| 299 | # @read-write: Makes the device writable |
| 300 | # |
| 301 | # Since: 2.3 |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 302 | ## |
| 303 | { 'enum': 'BlockdevChangeReadOnlyMode', |
| 304 | 'data': ['retain', 'read-only', 'read-write'] } |
| 305 | |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 306 | ## |
| 307 | # @blockdev-change-medium: |
| 308 | # |
| 309 | # Changes the medium inserted into a block device by ejecting the current medium |
| 310 | # and loading a new image file which is inserted as the new medium (this command |
| 311 | # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium |
| 312 | # and blockdev-close-tray). |
| 313 | # |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 314 | # @device: Block device name |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 315 | # |
| 316 | # @id: The name or QOM path of the guest device |
| 317 | # (since: 2.8) |
| 318 | # |
| 319 | # @filename: filename of the new image to be loaded |
| 320 | # |
| 321 | # @format: format to open the new image with (defaults to |
| 322 | # the probed format) |
| 323 | # |
| 324 | # @read-only-mode: change the read-only mode of the device; defaults |
| 325 | # to 'retain' |
| 326 | # |
Denis V. Lunev | 80dd5af | 2022-04-13 01:18:46 +0300 | [diff] [blame] | 327 | # @force: if false (the default), an eject request through blockdev-open-tray |
| 328 | # will be sent to the guest if it has locked the tray (and the tray |
| 329 | # will not be opened immediately); if true, the tray will be opened |
| 330 | # regardless of whether it is locked. (since 7.1) |
| 331 | # |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 332 | # Features: |
| 333 | # @deprecated: Member @device is deprecated. Use @id instead. |
| 334 | # |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 335 | # Since: 2.5 |
| 336 | # |
| 337 | # Examples: |
| 338 | # |
| 339 | # 1. Change a removable medium |
| 340 | # |
| 341 | # -> { "execute": "blockdev-change-medium", |
| 342 | # "arguments": { "id": "ide0-1-0", |
| 343 | # "filename": "/srv/images/Fedora-12-x86_64-DVD.iso", |
| 344 | # "format": "raw" } } |
| 345 | # <- { "return": {} } |
| 346 | # |
| 347 | # 2. Load a read-only medium into a writable drive |
| 348 | # |
| 349 | # -> { "execute": "blockdev-change-medium", |
| 350 | # "arguments": { "id": "floppyA", |
| 351 | # "filename": "/srv/images/ro.img", |
| 352 | # "format": "raw", |
| 353 | # "read-only-mode": "retain" } } |
| 354 | # |
| 355 | # <- { "error": |
| 356 | # { "class": "GenericError", |
| 357 | # "desc": "Could not open '/srv/images/ro.img': Permission denied" } } |
| 358 | # |
| 359 | # -> { "execute": "blockdev-change-medium", |
| 360 | # "arguments": { "id": "floppyA", |
| 361 | # "filename": "/srv/images/ro.img", |
| 362 | # "format": "raw", |
| 363 | # "read-only-mode": "read-only" } } |
| 364 | # |
| 365 | # <- { "return": {} } |
| 366 | # |
| 367 | ## |
| 368 | { 'command': 'blockdev-change-medium', |
Markus Armbruster | df4097a | 2020-03-17 12:54:51 +0100 | [diff] [blame] | 369 | 'data': { '*device': { 'type': 'str', 'features': [ 'deprecated' ] }, |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 370 | '*id': 'str', |
| 371 | 'filename': 'str', |
| 372 | '*format': 'str', |
Denis V. Lunev | 80dd5af | 2022-04-13 01:18:46 +0300 | [diff] [blame] | 373 | '*force': 'bool', |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 374 | '*read-only-mode': 'BlockdevChangeReadOnlyMode' } } |
| 375 | |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 376 | ## |
Marc-André Lureau | 5072f7b | 2016-11-17 19:54:55 +0400 | [diff] [blame] | 377 | # @DEVICE_TRAY_MOVED: |
Wenchao Xia | a5ee7bd | 2014-06-18 08:43:44 +0200 | [diff] [blame] | 378 | # |
| 379 | # Emitted whenever the tray of a removable device is moved by the guest or by |
| 380 | # HMP/QMP commands |
| 381 | # |
Kevin Wolf | 2d76e72 | 2016-09-29 18:30:53 +0200 | [diff] [blame] | 382 | # @device: Block device name. This is always present for compatibility |
| 383 | # reasons, but it can be empty ("") if the image does not |
| 384 | # have a device name associated. |
| 385 | # |
Eric Blake | d750c3a | 2016-12-06 10:03:45 -0600 | [diff] [blame] | 386 | # @id: The name or QOM path of the guest device (since 2.8) |
Wenchao Xia | a5ee7bd | 2014-06-18 08:43:44 +0200 | [diff] [blame] | 387 | # |
| 388 | # @tray-open: true if the tray has been opened or false if it has been closed |
| 389 | # |
| 390 | # Since: 1.1 |
Marc-André Lureau | 01b7d4b | 2016-06-23 15:57:27 +0200 | [diff] [blame] | 391 | # |
| 392 | # Example: |
| 393 | # |
| 394 | # <- { "event": "DEVICE_TRAY_MOVED", |
| 395 | # "data": { "device": "ide1-cd0", |
| 396 | # "id": "/machine/unattached/device[22]", |
| 397 | # "tray-open": true |
| 398 | # }, |
| 399 | # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } |
| 400 | # |
Wenchao Xia | a5ee7bd | 2014-06-18 08:43:44 +0200 | [diff] [blame] | 401 | ## |
| 402 | { 'event': 'DEVICE_TRAY_MOVED', |
Kevin Wolf | 2d76e72 | 2016-09-29 18:30:53 +0200 | [diff] [blame] | 403 | 'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } } |
Changlong Xie | 0ae053b | 2016-02-26 09:39:01 +0800 | [diff] [blame] | 404 | |
| 405 | ## |
Paolo Bonzini | e2c81a4 | 2018-02-28 19:01:40 +0100 | [diff] [blame] | 406 | # @PR_MANAGER_STATUS_CHANGED: |
| 407 | # |
| 408 | # Emitted whenever the connected status of a persistent reservation |
| 409 | # manager changes. |
| 410 | # |
| 411 | # @id: The id of the PR manager object |
| 412 | # |
| 413 | # @connected: true if the PR manager is connected to a backend |
| 414 | # |
| 415 | # Since: 3.0 |
| 416 | # |
| 417 | # Example: |
| 418 | # |
| 419 | # <- { "event": "PR_MANAGER_STATUS_CHANGED", |
| 420 | # "data": { "id": "pr-helper0", |
| 421 | # "connected": true |
| 422 | # }, |
| 423 | # "timestamp": { "seconds": 1519840375, "microseconds": 450486 } } |
| 424 | # |
| 425 | ## |
| 426 | { 'event': 'PR_MANAGER_STATUS_CHANGED', |
| 427 | 'data': { 'id': 'str', 'connected': 'bool' } } |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 428 | |
| 429 | ## |
| 430 | # @block_set_io_throttle: |
| 431 | # |
| 432 | # Change I/O throttle limits for a block drive. |
| 433 | # |
| 434 | # Since QEMU 2.4, each device with I/O limits is member of a throttle |
| 435 | # group. |
| 436 | # |
| 437 | # If two or more devices are members of the same group, the limits |
| 438 | # will apply to the combined I/O of the whole group in a round-robin |
| 439 | # fashion. Therefore, setting new I/O limits to a device will affect |
| 440 | # the whole group. |
| 441 | # |
| 442 | # The name of the group can be specified using the 'group' parameter. |
| 443 | # If the parameter is unset, it is assumed to be the current group of |
| 444 | # that device. If it's not in any group yet, the name of the device |
| 445 | # will be used as the name for its group. |
| 446 | # |
| 447 | # The 'group' parameter can also be used to move a device to a |
| 448 | # different group. In this case the limits specified in the parameters |
| 449 | # will be applied to the new group only. |
| 450 | # |
| 451 | # I/O limits can be disabled by setting all of them to 0. In this case |
| 452 | # the device will be removed from its group and the rest of its |
| 453 | # members will not be affected. The 'group' parameter is ignored. |
| 454 | # |
| 455 | # Returns: - Nothing on success |
| 456 | # - If @device is not a valid block device, DeviceNotFound |
| 457 | # |
| 458 | # Since: 1.1 |
| 459 | # |
| 460 | # Example: |
| 461 | # |
| 462 | # -> { "execute": "block_set_io_throttle", |
| 463 | # "arguments": { "id": "virtio-blk-pci0/virtio-backend", |
| 464 | # "bps": 0, |
| 465 | # "bps_rd": 0, |
| 466 | # "bps_wr": 0, |
| 467 | # "iops": 512, |
| 468 | # "iops_rd": 0, |
| 469 | # "iops_wr": 0, |
| 470 | # "bps_max": 0, |
| 471 | # "bps_rd_max": 0, |
| 472 | # "bps_wr_max": 0, |
| 473 | # "iops_max": 0, |
| 474 | # "iops_rd_max": 0, |
| 475 | # "iops_wr_max": 0, |
| 476 | # "bps_max_length": 0, |
| 477 | # "iops_size": 0 } } |
| 478 | # <- { "return": {} } |
| 479 | # |
| 480 | # -> { "execute": "block_set_io_throttle", |
| 481 | # "arguments": { "id": "ide0-1-0", |
| 482 | # "bps": 1000000, |
| 483 | # "bps_rd": 0, |
| 484 | # "bps_wr": 0, |
| 485 | # "iops": 0, |
| 486 | # "iops_rd": 0, |
| 487 | # "iops_wr": 0, |
| 488 | # "bps_max": 8000000, |
| 489 | # "bps_rd_max": 0, |
| 490 | # "bps_wr_max": 0, |
| 491 | # "iops_max": 0, |
| 492 | # "iops_rd_max": 0, |
| 493 | # "iops_wr_max": 0, |
| 494 | # "bps_max_length": 60, |
| 495 | # "iops_size": 0 } } |
| 496 | # <- { "return": {} } |
| 497 | ## |
| 498 | { 'command': 'block_set_io_throttle', 'boxed': true, |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 499 | 'data': 'BlockIOThrottle', |
| 500 | 'allow-preconfig': true } |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 501 | |
| 502 | ## |
| 503 | # @block-latency-histogram-set: |
| 504 | # |
| 505 | # Manage read, write and flush latency histograms for the device. |
| 506 | # |
| 507 | # If only @id parameter is specified, remove all present latency histograms |
| 508 | # for the device. Otherwise, add/reset some of (or all) latency histograms. |
| 509 | # |
| 510 | # @id: The name or QOM path of the guest device. |
| 511 | # |
| 512 | # @boundaries: list of interval boundary values (see description in |
| 513 | # BlockLatencyHistogramInfo definition). If specified, all |
| 514 | # latency histograms are removed, and empty ones created for all |
| 515 | # io types with intervals corresponding to @boundaries (except for |
| 516 | # io types, for which specific boundaries are set through the |
| 517 | # following parameters). |
| 518 | # |
| 519 | # @boundaries-read: list of interval boundary values for read latency |
| 520 | # histogram. If specified, old read latency histogram is |
| 521 | # removed, and empty one created with intervals |
| 522 | # corresponding to @boundaries-read. The parameter has higher |
| 523 | # priority then @boundaries. |
| 524 | # |
| 525 | # @boundaries-write: list of interval boundary values for write latency |
| 526 | # histogram. |
| 527 | # |
| 528 | # @boundaries-flush: list of interval boundary values for flush latency |
| 529 | # histogram. |
| 530 | # |
| 531 | # Returns: error if device is not found or any boundary arrays are invalid. |
| 532 | # |
| 533 | # Since: 4.0 |
| 534 | # |
Peter Maydell | 8b5905a | 2020-09-25 17:22:57 +0100 | [diff] [blame] | 535 | # Example: |
| 536 | # set new histograms for all io types with intervals |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 537 | # [0, 10), [10, 50), [50, 100), [100, +inf): |
| 538 | # |
| 539 | # -> { "execute": "block-latency-histogram-set", |
| 540 | # "arguments": { "id": "drive0", |
| 541 | # "boundaries": [10, 50, 100] } } |
| 542 | # <- { "return": {} } |
| 543 | # |
Peter Maydell | 8b5905a | 2020-09-25 17:22:57 +0100 | [diff] [blame] | 544 | # Example: |
| 545 | # set new histogram only for write, other histograms will remain |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 546 | # not changed (or not created): |
| 547 | # |
| 548 | # -> { "execute": "block-latency-histogram-set", |
| 549 | # "arguments": { "id": "drive0", |
| 550 | # "boundaries-write": [10, 50, 100] } } |
| 551 | # <- { "return": {} } |
| 552 | # |
Peter Maydell | 8b5905a | 2020-09-25 17:22:57 +0100 | [diff] [blame] | 553 | # Example: |
| 554 | # set new histograms with the following intervals: |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 555 | # read, flush: [0, 10), [10, 50), [50, 100), [100, +inf) |
| 556 | # write: [0, 1000), [1000, 5000), [5000, +inf) |
| 557 | # |
| 558 | # -> { "execute": "block-latency-histogram-set", |
| 559 | # "arguments": { "id": "drive0", |
| 560 | # "boundaries": [10, 50, 100], |
| 561 | # "boundaries-write": [1000, 5000] } } |
| 562 | # <- { "return": {} } |
| 563 | # |
Peter Maydell | 8b5905a | 2020-09-25 17:22:57 +0100 | [diff] [blame] | 564 | # Example: |
| 565 | # remove all latency histograms: |
Kevin Wolf | 5a16818 | 2020-02-24 15:29:53 +0100 | [diff] [blame] | 566 | # |
| 567 | # -> { "execute": "block-latency-histogram-set", |
| 568 | # "arguments": { "id": "drive0" } } |
| 569 | # <- { "return": {} } |
| 570 | ## |
| 571 | { 'command': 'block-latency-histogram-set', |
| 572 | 'data': {'id': 'str', |
| 573 | '*boundaries': ['uint64'], |
| 574 | '*boundaries-read': ['uint64'], |
| 575 | '*boundaries-write': ['uint64'], |
Paolo Bonzini | f55ba80 | 2020-11-03 04:37:20 -0500 | [diff] [blame] | 576 | '*boundaries-flush': ['uint64'] }, |
| 577 | 'allow-preconfig': true } |