Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1 | HXCOMM QMP dispatch table and documentation |
Alberto Garcia | 3599d46 | 2015-02-26 16:35:07 +0200 | [diff] [blame] | 2 | HXCOMM Text between SQMP and EQMP is copied to the QMP documentation file and |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3 | HXCOMM does not show up in the other formats. |
| 4 | |
| 5 | SQMP |
| 6 | QMP Supported Commands |
| 7 | ---------------------- |
| 8 | |
| 9 | This document describes all commands currently supported by QMP. |
| 10 | |
| 11 | Most of the time their usage is exactly the same as in the user Monitor, this |
| 12 | means that any other document which also describe commands (the manpage, |
| 13 | QEMU's manual, etc) can and should be consulted. |
| 14 | |
| 15 | QMP has two types of commands: regular and query commands. Regular commands |
| 16 | usually change the Virtual Machine's state someway, while query commands just |
| 17 | return information. The sections below are divided accordingly. |
| 18 | |
| 19 | It's important to observe that all communication examples are formatted in |
| 20 | a reader-friendly way, so that they're easier to understand. However, in real |
| 21 | protocol usage, they're emitted as a single line. |
| 22 | |
| 23 | Also, the following notation is used to denote data flow: |
| 24 | |
| 25 | -> data issued by the Client |
| 26 | <- Server data response |
| 27 | |
| 28 | Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed |
| 29 | information on the Server command and response formats. |
| 30 | |
| 31 | NOTE: This document is temporary and will be replaced soon. |
| 32 | |
| 33 | 1. Stability Considerations |
| 34 | =========================== |
| 35 | |
| 36 | The current QMP command set (described in this file) may be useful for a |
| 37 | number of use cases, however it's limited and several commands have bad |
| 38 | defined semantics, specially with regard to command completion. |
| 39 | |
| 40 | These problems are going to be solved incrementally in the next QEMU releases |
| 41 | and we're going to establish a deprecation policy for badly defined commands. |
| 42 | |
| 43 | If you're planning to adopt QMP, please observe the following: |
| 44 | |
Zhi Yong Wu | c20cdf8 | 2011-07-27 14:32:56 +0800 | [diff] [blame] | 45 | 1. The deprecation policy will take effect and be documented soon, please |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 46 | check the documentation of each used command as soon as a new release of |
| 47 | QEMU is available |
| 48 | |
| 49 | 2. DO NOT rely on anything which is not explicit documented |
| 50 | |
| 51 | 3. Errors, in special, are not documented. Applications should NOT check |
| 52 | for specific errors classes or data (it's strongly recommended to only |
| 53 | check for the "error" key) |
| 54 | |
| 55 | 2. Regular Commands |
| 56 | =================== |
| 57 | |
| 58 | Server's responses in the examples below are always a success response, please |
| 59 | refer to the QMP specification for more details on error responses. |
| 60 | |
| 61 | EQMP |
| 62 | |
| 63 | { |
| 64 | .name = "quit", |
| 65 | .args_type = "", |
Luiz Capitulino | 7a7f325 | 2011-09-15 14:20:28 -0300 | [diff] [blame] | 66 | .mhandler.cmd_new = qmp_marshal_input_quit, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 67 | }, |
| 68 | |
| 69 | SQMP |
| 70 | quit |
| 71 | ---- |
| 72 | |
| 73 | Quit the emulator. |
| 74 | |
| 75 | Arguments: None. |
| 76 | |
| 77 | Example: |
| 78 | |
| 79 | -> { "execute": "quit" } |
| 80 | <- { "return": {} } |
| 81 | |
| 82 | EQMP |
| 83 | |
| 84 | { |
| 85 | .name = "eject", |
| 86 | .args_type = "force:-f,device:B", |
Luiz Capitulino | c245b6a | 2011-12-07 16:02:36 -0200 | [diff] [blame] | 87 | .mhandler.cmd_new = qmp_marshal_input_eject, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 88 | }, |
| 89 | |
| 90 | SQMP |
| 91 | eject |
| 92 | ----- |
| 93 | |
| 94 | Eject a removable medium. |
| 95 | |
| 96 | Arguments: |
| 97 | |
| 98 | - force: force ejection (json-bool, optional) |
| 99 | - device: device name (json-string) |
| 100 | |
| 101 | Example: |
| 102 | |
| 103 | -> { "execute": "eject", "arguments": { "device": "ide1-cd0" } } |
| 104 | <- { "return": {} } |
| 105 | |
| 106 | Note: The "force" argument defaults to false. |
| 107 | |
| 108 | EQMP |
| 109 | |
| 110 | { |
| 111 | .name = "change", |
| 112 | .args_type = "device:B,target:F,arg:s?", |
Luiz Capitulino | 333a96e | 2011-12-08 11:13:50 -0200 | [diff] [blame] | 113 | .mhandler.cmd_new = qmp_marshal_input_change, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 114 | }, |
| 115 | |
| 116 | SQMP |
| 117 | change |
| 118 | ------ |
| 119 | |
| 120 | Change a removable medium or VNC configuration. |
| 121 | |
| 122 | Arguments: |
| 123 | |
| 124 | - "device": device name (json-string) |
| 125 | - "target": filename or item (json-string) |
| 126 | - "arg": additional argument (json-string, optional) |
| 127 | |
| 128 | Examples: |
| 129 | |
| 130 | 1. Change a removable medium |
| 131 | |
| 132 | -> { "execute": "change", |
| 133 | "arguments": { "device": "ide1-cd0", |
| 134 | "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } } |
| 135 | <- { "return": {} } |
| 136 | |
| 137 | 2. Change VNC password |
| 138 | |
| 139 | -> { "execute": "change", |
| 140 | "arguments": { "device": "vnc", "target": "password", |
| 141 | "arg": "foobar1" } } |
| 142 | <- { "return": {} } |
| 143 | |
| 144 | EQMP |
| 145 | |
| 146 | { |
| 147 | .name = "screendump", |
| 148 | .args_type = "filename:F", |
Luiz Capitulino | ad39cf6 | 2012-05-24 13:48:23 -0300 | [diff] [blame] | 149 | .mhandler.cmd_new = qmp_marshal_input_screendump, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 150 | }, |
| 151 | |
| 152 | SQMP |
| 153 | screendump |
| 154 | ---------- |
| 155 | |
| 156 | Save screen into PPM image. |
| 157 | |
| 158 | Arguments: |
| 159 | |
| 160 | - "filename": file path (json-string) |
| 161 | |
| 162 | Example: |
| 163 | |
| 164 | -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } } |
| 165 | <- { "return": {} } |
| 166 | |
| 167 | EQMP |
| 168 | |
| 169 | { |
| 170 | .name = "stop", |
| 171 | .args_type = "", |
Luiz Capitulino | 5f158f2 | 2011-09-15 14:34:39 -0300 | [diff] [blame] | 172 | .mhandler.cmd_new = qmp_marshal_input_stop, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 173 | }, |
| 174 | |
| 175 | SQMP |
| 176 | stop |
| 177 | ---- |
| 178 | |
| 179 | Stop the emulator. |
| 180 | |
| 181 | Arguments: None. |
| 182 | |
| 183 | Example: |
| 184 | |
| 185 | -> { "execute": "stop" } |
| 186 | <- { "return": {} } |
| 187 | |
| 188 | EQMP |
| 189 | |
| 190 | { |
| 191 | .name = "cont", |
| 192 | .args_type = "", |
Luiz Capitulino | e42e818 | 2011-11-22 17:58:31 -0200 | [diff] [blame] | 193 | .mhandler.cmd_new = qmp_marshal_input_cont, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 194 | }, |
| 195 | |
| 196 | SQMP |
| 197 | cont |
| 198 | ---- |
| 199 | |
| 200 | Resume emulation. |
| 201 | |
| 202 | Arguments: None. |
| 203 | |
| 204 | Example: |
| 205 | |
| 206 | -> { "execute": "cont" } |
| 207 | <- { "return": {} } |
| 208 | |
| 209 | EQMP |
| 210 | |
| 211 | { |
Gerd Hoffmann | 9b9df25 | 2012-02-23 13:45:21 +0100 | [diff] [blame] | 212 | .name = "system_wakeup", |
| 213 | .args_type = "", |
| 214 | .mhandler.cmd_new = qmp_marshal_input_system_wakeup, |
| 215 | }, |
| 216 | |
| 217 | SQMP |
| 218 | system_wakeup |
| 219 | ------------- |
| 220 | |
| 221 | Wakeup guest from suspend. |
| 222 | |
| 223 | Arguments: None. |
| 224 | |
| 225 | Example: |
| 226 | |
| 227 | -> { "execute": "system_wakeup" } |
| 228 | <- { "return": {} } |
| 229 | |
| 230 | EQMP |
| 231 | |
| 232 | { |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 233 | .name = "system_reset", |
| 234 | .args_type = "", |
Luiz Capitulino | 38d2265 | 2011-09-15 14:41:46 -0300 | [diff] [blame] | 235 | .mhandler.cmd_new = qmp_marshal_input_system_reset, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 236 | }, |
| 237 | |
| 238 | SQMP |
| 239 | system_reset |
| 240 | ------------ |
| 241 | |
| 242 | Reset the system. |
| 243 | |
| 244 | Arguments: None. |
| 245 | |
| 246 | Example: |
| 247 | |
| 248 | -> { "execute": "system_reset" } |
| 249 | <- { "return": {} } |
| 250 | |
| 251 | EQMP |
| 252 | |
| 253 | { |
| 254 | .name = "system_powerdown", |
| 255 | .args_type = "", |
Luiz Capitulino | 22e1bb9 | 2011-11-27 22:40:03 -0200 | [diff] [blame] | 256 | .mhandler.cmd_new = qmp_marshal_input_system_powerdown, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 257 | }, |
| 258 | |
| 259 | SQMP |
| 260 | system_powerdown |
| 261 | ---------------- |
| 262 | |
| 263 | Send system power down event. |
| 264 | |
| 265 | Arguments: None. |
| 266 | |
| 267 | Example: |
| 268 | |
| 269 | -> { "execute": "system_powerdown" } |
| 270 | <- { "return": {} } |
| 271 | |
| 272 | EQMP |
| 273 | |
| 274 | { |
| 275 | .name = "device_add", |
| 276 | .args_type = "device:O", |
| 277 | .params = "driver[,prop=value][,...]", |
| 278 | .help = "add device, like -device on the command line", |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 279 | .mhandler.cmd_new = do_device_add, |
| 280 | }, |
| 281 | |
| 282 | SQMP |
| 283 | device_add |
| 284 | ---------- |
| 285 | |
| 286 | Add a device. |
| 287 | |
| 288 | Arguments: |
| 289 | |
| 290 | - "driver": the name of the new device's driver (json-string) |
| 291 | - "bus": the device's parent bus (device tree path, json-string, optional) |
| 292 | - "id": the device's ID, must be unique (json-string) |
| 293 | - device properties |
| 294 | |
| 295 | Example: |
| 296 | |
| 297 | -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } } |
| 298 | <- { "return": {} } |
| 299 | |
| 300 | Notes: |
| 301 | |
| 302 | (1) For detailed information about this command, please refer to the |
| 303 | 'docs/qdev-device-use.txt' file. |
| 304 | |
| 305 | (2) It's possible to list device properties by running QEMU with the |
| 306 | "-device DEVICE,\?" command-line argument, where DEVICE is the device's name |
| 307 | |
| 308 | EQMP |
| 309 | |
| 310 | { |
| 311 | .name = "device_del", |
| 312 | .args_type = "id:s", |
Luiz Capitulino | a15fef2 | 2012-03-29 12:38:50 -0300 | [diff] [blame] | 313 | .mhandler.cmd_new = qmp_marshal_input_device_del, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 314 | }, |
| 315 | |
| 316 | SQMP |
| 317 | device_del |
| 318 | ---------- |
| 319 | |
| 320 | Remove a device. |
| 321 | |
| 322 | Arguments: |
| 323 | |
| 324 | - "id": the device's ID (json-string) |
| 325 | |
| 326 | Example: |
| 327 | |
| 328 | -> { "execute": "device_del", "arguments": { "id": "net1" } } |
| 329 | <- { "return": {} } |
| 330 | |
| 331 | EQMP |
| 332 | |
| 333 | { |
Amos Kong | e4c8f00 | 2012-08-31 10:56:26 +0800 | [diff] [blame] | 334 | .name = "send-key", |
Paolo Bonzini | 43d0a2c | 2015-04-15 13:30:04 +0200 | [diff] [blame] | 335 | .args_type = "keys:q,hold-time:i?", |
Amos Kong | e4c8f00 | 2012-08-31 10:56:26 +0800 | [diff] [blame] | 336 | .mhandler.cmd_new = qmp_marshal_input_send_key, |
| 337 | }, |
| 338 | |
| 339 | SQMP |
| 340 | send-key |
| 341 | ---------- |
| 342 | |
| 343 | Send keys to VM. |
| 344 | |
| 345 | Arguments: |
| 346 | |
| 347 | keys array: |
Amos Kong | f9b1d9b | 2013-07-16 19:52:14 +0800 | [diff] [blame] | 348 | - "key": key sequence (a json-array of key union values, |
| 349 | union can be number or qcode enum) |
Amos Kong | e4c8f00 | 2012-08-31 10:56:26 +0800 | [diff] [blame] | 350 | |
| 351 | - hold-time: time to delay key up events, milliseconds. Defaults to 100 |
| 352 | (json-int, optional) |
| 353 | |
| 354 | Example: |
| 355 | |
| 356 | -> { "execute": "send-key", |
Amos Kong | f9b1d9b | 2013-07-16 19:52:14 +0800 | [diff] [blame] | 357 | "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" }, |
| 358 | { "type": "qcode", "data": "alt" }, |
| 359 | { "type": "qcode", "data": "delete" } ] } } |
Amos Kong | e4c8f00 | 2012-08-31 10:56:26 +0800 | [diff] [blame] | 360 | <- { "return": {} } |
| 361 | |
| 362 | EQMP |
| 363 | |
| 364 | { |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 365 | .name = "cpu", |
| 366 | .args_type = "index:i", |
Luiz Capitulino | 755f196 | 2011-10-06 14:31:39 -0300 | [diff] [blame] | 367 | .mhandler.cmd_new = qmp_marshal_input_cpu, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 368 | }, |
| 369 | |
| 370 | SQMP |
| 371 | cpu |
| 372 | --- |
| 373 | |
| 374 | Set the default CPU. |
| 375 | |
| 376 | Arguments: |
| 377 | |
| 378 | - "index": the CPU's index (json-int) |
| 379 | |
| 380 | Example: |
| 381 | |
| 382 | -> { "execute": "cpu", "arguments": { "index": 0 } } |
| 383 | <- { "return": {} } |
| 384 | |
| 385 | Note: CPUs' indexes are obtained with the 'query-cpus' command. |
| 386 | |
| 387 | EQMP |
| 388 | |
| 389 | { |
Igor Mammedov | 69ca3ea | 2013-04-30 15:41:25 +0200 | [diff] [blame] | 390 | .name = "cpu-add", |
| 391 | .args_type = "id:i", |
| 392 | .mhandler.cmd_new = qmp_marshal_input_cpu_add, |
| 393 | }, |
| 394 | |
| 395 | SQMP |
| 396 | cpu-add |
| 397 | ------- |
| 398 | |
| 399 | Adds virtual cpu |
| 400 | |
| 401 | Arguments: |
| 402 | |
| 403 | - "id": cpu id (json-int) |
| 404 | |
| 405 | Example: |
| 406 | |
| 407 | -> { "execute": "cpu-add", "arguments": { "id": 2 } } |
| 408 | <- { "return": {} } |
| 409 | |
| 410 | EQMP |
| 411 | |
| 412 | { |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 413 | .name = "memsave", |
Luiz Capitulino | 0cfd6a9 | 2011-11-22 16:32:37 -0200 | [diff] [blame] | 414 | .args_type = "val:l,size:i,filename:s,cpu:i?", |
| 415 | .mhandler.cmd_new = qmp_marshal_input_memsave, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 416 | }, |
| 417 | |
| 418 | SQMP |
| 419 | memsave |
| 420 | ------- |
| 421 | |
| 422 | Save to disk virtual memory dump starting at 'val' of size 'size'. |
| 423 | |
| 424 | Arguments: |
| 425 | |
| 426 | - "val": the starting address (json-int) |
| 427 | - "size": the memory size, in bytes (json-int) |
| 428 | - "filename": file path (json-string) |
Luiz Capitulino | 0cfd6a9 | 2011-11-22 16:32:37 -0200 | [diff] [blame] | 429 | - "cpu": virtual CPU index (json-int, optional) |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 430 | |
| 431 | Example: |
| 432 | |
| 433 | -> { "execute": "memsave", |
| 434 | "arguments": { "val": 10, |
| 435 | "size": 100, |
| 436 | "filename": "/tmp/virtual-mem-dump" } } |
| 437 | <- { "return": {} } |
| 438 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 439 | EQMP |
| 440 | |
| 441 | { |
| 442 | .name = "pmemsave", |
| 443 | .args_type = "val:l,size:i,filename:s", |
Luiz Capitulino | 6d3962b | 2011-11-22 17:26:46 -0200 | [diff] [blame] | 444 | .mhandler.cmd_new = qmp_marshal_input_pmemsave, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 445 | }, |
| 446 | |
| 447 | SQMP |
| 448 | pmemsave |
| 449 | -------- |
| 450 | |
| 451 | Save to disk physical memory dump starting at 'val' of size 'size'. |
| 452 | |
| 453 | Arguments: |
| 454 | |
| 455 | - "val": the starting address (json-int) |
| 456 | - "size": the memory size, in bytes (json-int) |
| 457 | - "filename": file path (json-string) |
| 458 | |
| 459 | Example: |
| 460 | |
| 461 | -> { "execute": "pmemsave", |
| 462 | "arguments": { "val": 10, |
| 463 | "size": 100, |
| 464 | "filename": "/tmp/physical-mem-dump" } } |
| 465 | <- { "return": {} } |
| 466 | |
| 467 | EQMP |
| 468 | |
| 469 | { |
Lai Jiangshan | a404666 | 2011-03-07 17:05:15 +0800 | [diff] [blame] | 470 | .name = "inject-nmi", |
| 471 | .args_type = "", |
Luiz Capitulino | ab49ab5 | 2011-11-23 12:55:53 -0200 | [diff] [blame] | 472 | .mhandler.cmd_new = qmp_marshal_input_inject_nmi, |
Lai Jiangshan | a404666 | 2011-03-07 17:05:15 +0800 | [diff] [blame] | 473 | }, |
| 474 | |
| 475 | SQMP |
| 476 | inject-nmi |
| 477 | ---------- |
| 478 | |
Alexey Kardashevskiy | 9cb805f | 2014-08-20 22:16:33 +1000 | [diff] [blame] | 479 | Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64). |
Lai Jiangshan | a404666 | 2011-03-07 17:05:15 +0800 | [diff] [blame] | 480 | |
| 481 | Arguments: None. |
| 482 | |
| 483 | Example: |
| 484 | |
| 485 | -> { "execute": "inject-nmi" } |
| 486 | <- { "return": {} } |
| 487 | |
Luiz Capitulino | de253f1 | 2012-07-27 16:18:16 -0300 | [diff] [blame] | 488 | Note: inject-nmi fails when the guest doesn't support injecting. |
Lai Jiangshan | a404666 | 2011-03-07 17:05:15 +0800 | [diff] [blame] | 489 | |
| 490 | EQMP |
| 491 | |
| 492 | { |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 493 | .name = "ringbuf-write", |
Markus Armbruster | 82e59a6 | 2013-02-06 21:27:14 +0100 | [diff] [blame] | 494 | .args_type = "device:s,data:s,format:s?", |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 495 | .mhandler.cmd_new = qmp_marshal_input_ringbuf_write, |
Lei Li | 1f590cf | 2013-01-25 00:03:20 +0800 | [diff] [blame] | 496 | }, |
| 497 | |
| 498 | SQMP |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 499 | ringbuf-write |
Lei Li | 1f590cf | 2013-01-25 00:03:20 +0800 | [diff] [blame] | 500 | ------------- |
| 501 | |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 502 | Write to a ring buffer character device. |
Lei Li | 1f590cf | 2013-01-25 00:03:20 +0800 | [diff] [blame] | 503 | |
| 504 | Arguments: |
| 505 | |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 506 | - "device": ring buffer character device name (json-string) |
| 507 | - "data": data to write (json-string) |
| 508 | - "format": data format (json-string, optional) |
| 509 | - Possible values: "utf8" (default), "base64" |
| 510 | Bug: invalid base64 is currently not rejected. |
| 511 | Whitespace *is* invalid. |
Lei Li | 1f590cf | 2013-01-25 00:03:20 +0800 | [diff] [blame] | 512 | |
| 513 | Example: |
| 514 | |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 515 | -> { "execute": "ringbuf-write", |
| 516 | "arguments": { "device": "foo", |
Lei Li | 1f590cf | 2013-01-25 00:03:20 +0800 | [diff] [blame] | 517 | "data": "abcdefgh", |
| 518 | "format": "utf8" } } |
| 519 | <- { "return": {} } |
| 520 | |
| 521 | EQMP |
| 522 | |
| 523 | { |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 524 | .name = "ringbuf-read", |
Lei Li | 49b6d72 | 2013-01-25 00:03:21 +0800 | [diff] [blame] | 525 | .args_type = "device:s,size:i,format:s?", |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 526 | .mhandler.cmd_new = qmp_marshal_input_ringbuf_read, |
Lei Li | 49b6d72 | 2013-01-25 00:03:21 +0800 | [diff] [blame] | 527 | }, |
| 528 | |
| 529 | SQMP |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 530 | ringbuf-read |
Lei Li | 49b6d72 | 2013-01-25 00:03:21 +0800 | [diff] [blame] | 531 | ------------- |
| 532 | |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 533 | Read from a ring buffer character device. |
Lei Li | 49b6d72 | 2013-01-25 00:03:21 +0800 | [diff] [blame] | 534 | |
| 535 | Arguments: |
| 536 | |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 537 | - "device": ring buffer character device name (json-string) |
| 538 | - "size": how many bytes to read at most (json-int) |
| 539 | - Number of data bytes, not number of characters in encoded data |
| 540 | - "format": data format (json-string, optional) |
| 541 | - Possible values: "utf8" (default), "base64" |
| 542 | - Naturally, format "utf8" works only when the ring buffer |
| 543 | contains valid UTF-8 text. Invalid UTF-8 sequences get |
| 544 | replaced. Bug: replacement doesn't work. Bug: can screw |
| 545 | up on encountering NUL characters, after the ring buffer |
| 546 | lost data, and when reading stops because the size limit |
| 547 | is reached. |
Lei Li | 49b6d72 | 2013-01-25 00:03:21 +0800 | [diff] [blame] | 548 | |
| 549 | Example: |
| 550 | |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 551 | -> { "execute": "ringbuf-read", |
| 552 | "arguments": { "device": "foo", |
Lei Li | 49b6d72 | 2013-01-25 00:03:21 +0800 | [diff] [blame] | 553 | "size": 1000, |
| 554 | "format": "utf8" } } |
Markus Armbruster | 3ab651f | 2013-02-06 21:27:15 +0100 | [diff] [blame] | 555 | <- {"return": "abcdefgh"} |
Lei Li | 49b6d72 | 2013-01-25 00:03:21 +0800 | [diff] [blame] | 556 | |
| 557 | EQMP |
| 558 | |
| 559 | { |
Stefano Stabellini | a7ae835 | 2012-01-25 12:24:51 +0000 | [diff] [blame] | 560 | .name = "xen-save-devices-state", |
| 561 | .args_type = "filename:F", |
| 562 | .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state, |
| 563 | }, |
| 564 | |
| 565 | SQMP |
| 566 | xen-save-devices-state |
| 567 | ------- |
| 568 | |
| 569 | Save the state of all devices to file. The RAM and the block devices |
| 570 | of the VM are not saved by this command. |
| 571 | |
| 572 | Arguments: |
| 573 | |
| 574 | - "filename": the file to save the state of the devices to as binary |
| 575 | data. See xen-save-devices-state.txt for a description of the binary |
| 576 | format. |
| 577 | |
| 578 | Example: |
| 579 | |
| 580 | -> { "execute": "xen-save-devices-state", |
| 581 | "arguments": { "filename": "/tmp/save" } } |
| 582 | <- { "return": {} } |
| 583 | |
| 584 | EQMP |
| 585 | |
| 586 | { |
Anthony PERARD | 39f4243 | 2012-10-03 13:48:19 +0000 | [diff] [blame] | 587 | .name = "xen-set-global-dirty-log", |
| 588 | .args_type = "enable:b", |
| 589 | .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log, |
| 590 | }, |
| 591 | |
| 592 | SQMP |
| 593 | xen-set-global-dirty-log |
| 594 | ------- |
| 595 | |
| 596 | Enable or disable the global dirty log mode. |
| 597 | |
| 598 | Arguments: |
| 599 | |
| 600 | - "enable": Enable it or disable it. |
| 601 | |
| 602 | Example: |
| 603 | |
| 604 | -> { "execute": "xen-set-global-dirty-log", |
| 605 | "arguments": { "enable": true } } |
| 606 | <- { "return": {} } |
| 607 | |
| 608 | EQMP |
| 609 | |
| 610 | { |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 611 | .name = "migrate", |
| 612 | .args_type = "detach:-d,blk:-b,inc:-i,uri:s", |
Luiz Capitulino | e1c37d0 | 2011-12-05 14:48:01 -0200 | [diff] [blame] | 613 | .mhandler.cmd_new = qmp_marshal_input_migrate, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 614 | }, |
| 615 | |
| 616 | SQMP |
| 617 | migrate |
| 618 | ------- |
| 619 | |
| 620 | Migrate to URI. |
| 621 | |
| 622 | Arguments: |
| 623 | |
| 624 | - "blk": block migration, full disk copy (json-bool, optional) |
| 625 | - "inc": incremental disk copy (json-bool, optional) |
| 626 | - "uri": Destination URI (json-string) |
| 627 | |
| 628 | Example: |
| 629 | |
| 630 | -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } } |
| 631 | <- { "return": {} } |
| 632 | |
| 633 | Notes: |
| 634 | |
| 635 | (1) The 'query-migrate' command should be used to check migration's progress |
| 636 | and final result (this information is provided by the 'status' member) |
| 637 | (2) All boolean arguments default to false |
| 638 | (3) The user Monitor's "detach" argument is invalid in QMP and should not |
| 639 | be used |
| 640 | |
| 641 | EQMP |
| 642 | |
| 643 | { |
| 644 | .name = "migrate_cancel", |
| 645 | .args_type = "", |
Luiz Capitulino | 6cdedb0 | 2011-11-27 22:54:09 -0200 | [diff] [blame] | 646 | .mhandler.cmd_new = qmp_marshal_input_migrate_cancel, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 647 | }, |
| 648 | |
| 649 | SQMP |
| 650 | migrate_cancel |
| 651 | -------------- |
| 652 | |
| 653 | Cancel the current migration. |
| 654 | |
| 655 | Arguments: None. |
| 656 | |
| 657 | Example: |
| 658 | |
| 659 | -> { "execute": "migrate_cancel" } |
| 660 | <- { "return": {} } |
| 661 | |
| 662 | EQMP |
Dr. David Alan Gilbert | bf1ae1f | 2015-02-19 11:40:28 +0000 | [diff] [blame] | 663 | |
| 664 | { |
| 665 | .name = "migrate-incoming", |
| 666 | .args_type = "uri:s", |
| 667 | .mhandler.cmd_new = qmp_marshal_input_migrate_incoming, |
| 668 | }, |
| 669 | |
| 670 | SQMP |
| 671 | migrate-incoming |
| 672 | ---------------- |
| 673 | |
| 674 | Continue an incoming migration |
| 675 | |
| 676 | Arguments: |
| 677 | |
| 678 | - "uri": Source/listening URI (json-string) |
| 679 | |
| 680 | Example: |
| 681 | |
| 682 | -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } } |
| 683 | <- { "return": {} } |
| 684 | |
| 685 | Notes: |
| 686 | |
| 687 | (1) QEMU must be started with -incoming defer to allow migrate-incoming to |
| 688 | be used |
| 689 | (2) The uri format is the same as to -incoming |
| 690 | |
| 691 | EQMP |
| 692 | { |
Orit Wasserman | 9e1ba4c | 2012-08-06 21:42:54 +0300 | [diff] [blame] | 693 | .name = "migrate-set-cache-size", |
| 694 | .args_type = "value:o", |
| 695 | .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size, |
| 696 | }, |
| 697 | |
| 698 | SQMP |
| 699 | migrate-set-cache-size |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 700 | ---------------------- |
Orit Wasserman | 9e1ba4c | 2012-08-06 21:42:54 +0300 | [diff] [blame] | 701 | |
| 702 | Set cache size to be used by XBZRLE migration, the cache size will be rounded |
| 703 | down to the nearest power of 2 |
| 704 | |
| 705 | Arguments: |
| 706 | |
| 707 | - "value": cache size in bytes (json-int) |
| 708 | |
| 709 | Example: |
| 710 | |
| 711 | -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } } |
| 712 | <- { "return": {} } |
| 713 | |
| 714 | EQMP |
| 715 | { |
| 716 | .name = "query-migrate-cache-size", |
| 717 | .args_type = "", |
| 718 | .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size, |
| 719 | }, |
| 720 | |
| 721 | SQMP |
| 722 | query-migrate-cache-size |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 723 | ------------------------ |
Orit Wasserman | 9e1ba4c | 2012-08-06 21:42:54 +0300 | [diff] [blame] | 724 | |
| 725 | Show cache size to be used by XBZRLE migration |
| 726 | |
| 727 | returns a json-object with the following information: |
| 728 | - "size" : json-int |
| 729 | |
| 730 | Example: |
| 731 | |
| 732 | -> { "execute": "query-migrate-cache-size" } |
| 733 | <- { "return": 67108864 } |
| 734 | |
| 735 | EQMP |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 736 | |
| 737 | { |
| 738 | .name = "migrate_set_speed", |
Wen Congyang | 3a019b6 | 2010-11-25 09:06:05 +0800 | [diff] [blame] | 739 | .args_type = "value:o", |
Luiz Capitulino | 3dc8538 | 2011-11-28 11:59:37 -0200 | [diff] [blame] | 740 | .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 741 | }, |
| 742 | |
| 743 | SQMP |
| 744 | migrate_set_speed |
| 745 | ----------------- |
| 746 | |
| 747 | Set maximum speed for migrations. |
| 748 | |
| 749 | Arguments: |
| 750 | |
Luiz Capitulino | 5569fd7 | 2010-12-15 17:56:18 -0200 | [diff] [blame] | 751 | - "value": maximum speed, in bytes per second (json-int) |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 752 | |
| 753 | Example: |
| 754 | |
| 755 | -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } } |
| 756 | <- { "return": {} } |
| 757 | |
| 758 | EQMP |
| 759 | |
| 760 | { |
| 761 | .name = "migrate_set_downtime", |
| 762 | .args_type = "value:T", |
Luiz Capitulino | 4f0a993 | 2011-11-27 23:18:01 -0200 | [diff] [blame] | 763 | .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 764 | }, |
| 765 | |
| 766 | SQMP |
| 767 | migrate_set_downtime |
| 768 | -------------------- |
| 769 | |
| 770 | Set maximum tolerated downtime (in seconds) for migrations. |
| 771 | |
| 772 | Arguments: |
| 773 | |
| 774 | - "value": maximum downtime (json-number) |
| 775 | |
| 776 | Example: |
| 777 | |
| 778 | -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } } |
| 779 | <- { "return": {} } |
| 780 | |
| 781 | EQMP |
| 782 | |
| 783 | { |
Jes Sorensen | ff73edf | 2011-03-09 14:31:06 +0100 | [diff] [blame] | 784 | .name = "client_migrate_info", |
| 785 | .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?", |
| 786 | .params = "protocol hostname port tls-port cert-subject", |
| 787 | .help = "send migration info to spice/vnc client", |
Markus Armbruster | 3b5704b | 2015-03-05 09:30:16 +0100 | [diff] [blame] | 788 | .mhandler.cmd_new = client_migrate_info, |
Jes Sorensen | ff73edf | 2011-03-09 14:31:06 +0100 | [diff] [blame] | 789 | }, |
| 790 | |
| 791 | SQMP |
| 792 | client_migrate_info |
| 793 | ------------------ |
| 794 | |
| 795 | Set the spice/vnc connection info for the migration target. The spice/vnc |
| 796 | server will ask the spice/vnc client to automatically reconnect using the |
| 797 | new parameters (if specified) once the vm migration finished successfully. |
| 798 | |
| 799 | Arguments: |
| 800 | |
| 801 | - "protocol": protocol: "spice" or "vnc" (json-string) |
| 802 | - "hostname": migration target hostname (json-string) |
| 803 | - "port": spice/vnc tcp port for plaintext channels (json-int, optional) |
| 804 | - "tls-port": spice tcp port for tls-secured channels (json-int, optional) |
| 805 | - "cert-subject": server certificate subject (json-string, optional) |
| 806 | |
| 807 | Example: |
| 808 | |
| 809 | -> { "execute": "client_migrate_info", |
| 810 | "arguments": { "protocol": "spice", |
| 811 | "hostname": "virt42.lab.kraxel.org", |
| 812 | "port": 1234 } } |
| 813 | <- { "return": {} } |
| 814 | |
| 815 | EQMP |
| 816 | |
| 817 | { |
Wen Congyang | 783e9b4 | 2012-05-07 12:10:47 +0800 | [diff] [blame] | 818 | .name = "dump-guest-memory", |
qiaonuohan | b53ccc3 | 2014-02-18 14:11:36 +0800 | [diff] [blame] | 819 | .args_type = "paging:b,protocol:s,begin:i?,end:i?,format:s?", |
| 820 | .params = "-p protocol [begin] [length] [format]", |
Wen Congyang | 783e9b4 | 2012-05-07 12:10:47 +0800 | [diff] [blame] | 821 | .help = "dump guest memory to file", |
Wen Congyang | 783e9b4 | 2012-05-07 12:10:47 +0800 | [diff] [blame] | 822 | .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory, |
| 823 | }, |
| 824 | |
| 825 | SQMP |
| 826 | dump |
| 827 | |
| 828 | |
| 829 | Dump guest memory to file. The file can be processed with crash or gdb. |
| 830 | |
| 831 | Arguments: |
| 832 | |
| 833 | - "paging": do paging to get guest's memory mapping (json-bool) |
| 834 | - "protocol": destination file(started with "file:") or destination file |
| 835 | descriptor (started with "fd:") (json-string) |
| 836 | - "begin": the starting physical address. It's optional, and should be specified |
| 837 | with length together (json-int) |
| 838 | - "length": the memory size, in bytes. It's optional, and should be specified |
| 839 | with begin together (json-int) |
qiaonuohan | b53ccc3 | 2014-02-18 14:11:36 +0800 | [diff] [blame] | 840 | - "format": the format of guest memory dump. It's optional, and can be |
| 841 | elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will |
| 842 | conflict with paging and filter, ie. begin and length (json-string) |
Wen Congyang | 783e9b4 | 2012-05-07 12:10:47 +0800 | [diff] [blame] | 843 | |
| 844 | Example: |
| 845 | |
| 846 | -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } } |
| 847 | <- { "return": {} } |
| 848 | |
| 849 | Notes: |
| 850 | |
| 851 | (1) All boolean arguments default to false |
| 852 | |
| 853 | EQMP |
| 854 | |
| 855 | { |
qiaonuohan | 7d6dc7f | 2014-02-18 14:11:38 +0800 | [diff] [blame] | 856 | .name = "query-dump-guest-memory-capability", |
| 857 | .args_type = "", |
| 858 | .mhandler.cmd_new = qmp_marshal_input_query_dump_guest_memory_capability, |
| 859 | }, |
| 860 | |
| 861 | SQMP |
| 862 | query-dump-guest-memory-capability |
| 863 | ---------- |
| 864 | |
| 865 | Show available formats for 'dump-guest-memory' |
| 866 | |
| 867 | Example: |
| 868 | |
| 869 | -> { "execute": "query-dump-guest-memory-capability" } |
| 870 | <- { "return": { "formats": |
| 871 | ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] } |
| 872 | |
| 873 | EQMP |
| 874 | |
| 875 | { |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 876 | .name = "netdev_add", |
| 877 | .args_type = "netdev:O", |
Luiz Capitulino | 928059a | 2012-04-18 17:34:15 -0300 | [diff] [blame] | 878 | .mhandler.cmd_new = qmp_netdev_add, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 879 | }, |
| 880 | |
| 881 | SQMP |
| 882 | netdev_add |
| 883 | ---------- |
| 884 | |
| 885 | Add host network device. |
| 886 | |
| 887 | Arguments: |
| 888 | |
| 889 | - "type": the device type, "tap", "user", ... (json-string) |
| 890 | - "id": the device's ID, must be unique (json-string) |
| 891 | - device options |
| 892 | |
| 893 | Example: |
| 894 | |
| 895 | -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } } |
| 896 | <- { "return": {} } |
| 897 | |
Markus Armbruster | af347aa | 2013-02-22 18:31:51 +0100 | [diff] [blame] | 898 | Note: The supported device options are the same ones supported by the '-netdev' |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 899 | command-line argument, which are listed in the '-help' output or QEMU's |
| 900 | manual |
| 901 | |
| 902 | EQMP |
| 903 | |
| 904 | { |
| 905 | .name = "netdev_del", |
| 906 | .args_type = "id:s", |
Luiz Capitulino | 5f96415 | 2012-04-16 14:36:32 -0300 | [diff] [blame] | 907 | .mhandler.cmd_new = qmp_marshal_input_netdev_del, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 908 | }, |
| 909 | |
| 910 | SQMP |
| 911 | netdev_del |
| 912 | ---------- |
| 913 | |
| 914 | Remove host network device. |
| 915 | |
| 916 | Arguments: |
| 917 | |
| 918 | - "id": the device's ID, must be unique (json-string) |
| 919 | |
| 920 | Example: |
| 921 | |
| 922 | -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } } |
| 923 | <- { "return": {} } |
| 924 | |
Christoph Hellwig | 6d4a2b3 | 2011-01-24 13:32:33 +0100 | [diff] [blame] | 925 | |
| 926 | EQMP |
| 927 | |
| 928 | { |
Paolo Bonzini | cff8b2c | 2013-12-20 23:21:10 +0100 | [diff] [blame] | 929 | .name = "object-add", |
| 930 | .args_type = "qom-type:s,id:s,props:q?", |
| 931 | .mhandler.cmd_new = qmp_object_add, |
| 932 | }, |
| 933 | |
| 934 | SQMP |
| 935 | object-add |
| 936 | ---------- |
| 937 | |
| 938 | Create QOM object. |
| 939 | |
| 940 | Arguments: |
| 941 | |
| 942 | - "qom-type": the object's QOM type, i.e. the class name (json-string) |
| 943 | - "id": the object's ID, must be unique (json-string) |
| 944 | - "props": a dictionary of object property values (optional, json-dict) |
| 945 | |
| 946 | Example: |
| 947 | |
| 948 | -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1", |
| 949 | "props": { "filename": "/dev/hwrng" } } } |
| 950 | <- { "return": {} } |
| 951 | |
| 952 | EQMP |
| 953 | |
| 954 | { |
Paolo Bonzini | ab2d053 | 2013-12-20 23:21:09 +0100 | [diff] [blame] | 955 | .name = "object-del", |
| 956 | .args_type = "id:s", |
| 957 | .mhandler.cmd_new = qmp_marshal_input_object_del, |
| 958 | }, |
| 959 | |
| 960 | SQMP |
| 961 | object-del |
| 962 | ---------- |
| 963 | |
| 964 | Remove QOM object. |
| 965 | |
| 966 | Arguments: |
| 967 | |
| 968 | - "id": the object's ID (json-string) |
| 969 | |
| 970 | Example: |
| 971 | |
| 972 | -> { "execute": "object-del", "arguments": { "id": "rng1" } } |
| 973 | <- { "return": {} } |
| 974 | |
| 975 | |
| 976 | EQMP |
| 977 | |
| 978 | |
| 979 | { |
Christoph Hellwig | 6d4a2b3 | 2011-01-24 13:32:33 +0100 | [diff] [blame] | 980 | .name = "block_resize", |
Benoît Canet | 3b1dbd1 | 2014-01-23 21:31:37 +0100 | [diff] [blame] | 981 | .args_type = "device:s?,node-name:s?,size:o", |
Luiz Capitulino | 5e7caac | 2011-11-25 14:57:10 -0200 | [diff] [blame] | 982 | .mhandler.cmd_new = qmp_marshal_input_block_resize, |
Christoph Hellwig | 6d4a2b3 | 2011-01-24 13:32:33 +0100 | [diff] [blame] | 983 | }, |
| 984 | |
| 985 | SQMP |
| 986 | block_resize |
| 987 | ------------ |
| 988 | |
| 989 | Resize a block image while a guest is running. |
| 990 | |
| 991 | Arguments: |
| 992 | |
| 993 | - "device": the device's ID, must be unique (json-string) |
Benoît Canet | 3b1dbd1 | 2014-01-23 21:31:37 +0100 | [diff] [blame] | 994 | - "node-name": the node name in the block driver state graph (json-string) |
Christoph Hellwig | 6d4a2b3 | 2011-01-24 13:32:33 +0100 | [diff] [blame] | 995 | - "size": new size |
| 996 | |
| 997 | Example: |
| 998 | |
| 999 | -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } } |
| 1000 | <- { "return": {} } |
| 1001 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1002 | EQMP |
| 1003 | |
| 1004 | { |
Stefan Hajnoczi | db58f9c | 2012-04-11 16:27:10 +0100 | [diff] [blame] | 1005 | .name = "block-stream", |
Jeff Cody | 13d8cc5 | 2014-06-25 15:40:11 -0400 | [diff] [blame] | 1006 | .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?", |
Stefan Hajnoczi | 12bd451 | 2012-01-18 14:40:46 +0000 | [diff] [blame] | 1007 | .mhandler.cmd_new = qmp_marshal_input_block_stream, |
| 1008 | }, |
| 1009 | |
Stefan Hajnoczi | ec683d6 | 2015-04-15 11:43:42 +0100 | [diff] [blame^] | 1010 | SQMP |
| 1011 | block-stream |
| 1012 | ------------ |
| 1013 | |
| 1014 | Copy data from a backing file into a block device. |
| 1015 | |
| 1016 | Arguments: |
| 1017 | |
| 1018 | - "device": The device's ID, must be unique (json-string) |
| 1019 | - "base": The file name of the backing image above which copying starts |
| 1020 | (json-string, optional) |
| 1021 | - "backing-file": The backing file string to write into the active layer. This |
| 1022 | filename is not validated. |
| 1023 | |
| 1024 | If a pathname string is such that it cannot be resolved by |
| 1025 | QEMU, that means that subsequent QMP or HMP commands must use |
| 1026 | node-names for the image in question, as filename lookup |
| 1027 | methods will fail. |
| 1028 | |
| 1029 | If not specified, QEMU will automatically determine the |
| 1030 | backing file string to use, or error out if there is no |
| 1031 | obvious choice. Care should be taken when specifying the |
| 1032 | string, to specify a valid filename or protocol. |
| 1033 | (json-string, optional) (Since 2.1) |
| 1034 | - "speed": the maximum speed, in bytes per second (json-int, optional) |
| 1035 | - "on-error": the action to take on an error (default 'report'). 'stop' and |
| 1036 | 'enospc' can only be used if the block device supports io-status. |
| 1037 | (json-string, optional) (Since 2.1) |
| 1038 | |
| 1039 | Example: |
| 1040 | |
| 1041 | -> { "execute": "block-stream", "arguments": { "device": "virtio0", |
| 1042 | "base": "/tmp/master.qcow2" } } |
| 1043 | <- { "return": {} } |
| 1044 | |
| 1045 | EQMP |
| 1046 | |
Stefan Hajnoczi | 12bd451 | 2012-01-18 14:40:46 +0000 | [diff] [blame] | 1047 | { |
Jeff Cody | ed61fc1 | 2012-09-27 13:29:16 -0400 | [diff] [blame] | 1048 | .name = "block-commit", |
Jeff Cody | 54e2690 | 2014-06-25 15:40:10 -0400 | [diff] [blame] | 1049 | .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?", |
Jeff Cody | ed61fc1 | 2012-09-27 13:29:16 -0400 | [diff] [blame] | 1050 | .mhandler.cmd_new = qmp_marshal_input_block_commit, |
| 1051 | }, |
| 1052 | |
Jeff Cody | 3722290 | 2014-01-24 09:02:37 -0500 | [diff] [blame] | 1053 | SQMP |
| 1054 | block-commit |
| 1055 | ------------ |
| 1056 | |
| 1057 | Live commit of data from overlay image nodes into backing nodes - i.e., writes |
| 1058 | data between 'top' and 'base' into 'base'. |
| 1059 | |
| 1060 | Arguments: |
| 1061 | |
| 1062 | - "device": The device's ID, must be unique (json-string) |
| 1063 | - "base": The file name of the backing image to write data into. |
| 1064 | If not specified, this is the deepest backing image |
| 1065 | (json-string, optional) |
| 1066 | - "top": The file name of the backing image within the image chain, |
Jeff Cody | 7676e2c | 2014-06-30 15:14:15 +0200 | [diff] [blame] | 1067 | which contains the topmost data to be committed down. If |
| 1068 | not specified, this is the active layer. (json-string, optional) |
Jeff Cody | 3722290 | 2014-01-24 09:02:37 -0500 | [diff] [blame] | 1069 | |
Jeff Cody | 54e2690 | 2014-06-25 15:40:10 -0400 | [diff] [blame] | 1070 | - backing-file: The backing file string to write into the overlay |
| 1071 | image of 'top'. If 'top' is the active layer, |
| 1072 | specifying a backing file string is an error. This |
| 1073 | filename is not validated. |
| 1074 | |
| 1075 | If a pathname string is such that it cannot be |
| 1076 | resolved by QEMU, that means that subsequent QMP or |
| 1077 | HMP commands must use node-names for the image in |
| 1078 | question, as filename lookup methods will fail. |
| 1079 | |
| 1080 | If not specified, QEMU will automatically determine |
| 1081 | the backing file string to use, or error out if |
| 1082 | there is no obvious choice. Care should be taken |
| 1083 | when specifying the string, to specify a valid |
| 1084 | filename or protocol. |
| 1085 | (json-string, optional) (Since 2.1) |
| 1086 | |
Jeff Cody | 3722290 | 2014-01-24 09:02:37 -0500 | [diff] [blame] | 1087 | If top == base, that is an error. |
| 1088 | If top == active, the job will not be completed by itself, |
| 1089 | user needs to complete the job with the block-job-complete |
| 1090 | command after getting the ready event. (Since 2.0) |
| 1091 | |
| 1092 | If the base image is smaller than top, then the base image |
| 1093 | will be resized to be the same size as top. If top is |
| 1094 | smaller than the base image, the base will not be |
| 1095 | truncated. If you want the base image size to match the |
| 1096 | size of the smaller top, you can safely truncate it |
| 1097 | yourself once the commit operation successfully completes. |
| 1098 | (json-string) |
| 1099 | - "speed": the maximum speed, in bytes per second (json-int, optional) |
| 1100 | |
| 1101 | |
| 1102 | Example: |
| 1103 | |
| 1104 | -> { "execute": "block-commit", "arguments": { "device": "virtio0", |
| 1105 | "top": "/tmp/snap1.qcow2" } } |
| 1106 | <- { "return": {} } |
| 1107 | |
| 1108 | EQMP |
| 1109 | |
Jeff Cody | ed61fc1 | 2012-09-27 13:29:16 -0400 | [diff] [blame] | 1110 | { |
Stefan Hajnoczi | 99a9add | 2013-06-24 17:13:14 +0200 | [diff] [blame] | 1111 | .name = "drive-backup", |
Stefan Hajnoczi | b53169e | 2013-06-26 14:11:57 +0200 | [diff] [blame] | 1112 | .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?," |
Stefan Hajnoczi | 99a9add | 2013-06-24 17:13:14 +0200 | [diff] [blame] | 1113 | "on-source-error:s?,on-target-error:s?", |
| 1114 | .mhandler.cmd_new = qmp_marshal_input_drive_backup, |
| 1115 | }, |
| 1116 | |
| 1117 | SQMP |
| 1118 | drive-backup |
| 1119 | ------------ |
| 1120 | |
| 1121 | Start a point-in-time copy of a block device to a new destination. The |
| 1122 | status of ongoing drive-backup operations can be checked with |
| 1123 | query-block-jobs where the BlockJobInfo.type field has the value 'backup'. |
| 1124 | The operation can be stopped before it has completed using the |
| 1125 | block-job-cancel command. |
| 1126 | |
| 1127 | Arguments: |
| 1128 | |
| 1129 | - "device": the name of the device which should be copied. |
| 1130 | (json-string) |
| 1131 | - "target": the target of the new image. If the file exists, or if it is a |
| 1132 | device, the existing file/device will be used as the new |
| 1133 | destination. If it does not exist, a new file will be created. |
| 1134 | (json-string) |
| 1135 | - "format": the format of the new destination, default is to probe if 'mode' is |
| 1136 | 'existing', else the format of the source |
| 1137 | (json-string, optional) |
Stefan Hajnoczi | b53169e | 2013-06-26 14:11:57 +0200 | [diff] [blame] | 1138 | - "sync": what parts of the disk image should be copied to the destination; |
| 1139 | possibilities include "full" for all the disk, "top" for only the sectors |
| 1140 | allocated in the topmost image, or "none" to only replicate new I/O |
| 1141 | (MirrorSyncMode). |
Stefan Hajnoczi | 99a9add | 2013-06-24 17:13:14 +0200 | [diff] [blame] | 1142 | - "mode": whether and how QEMU should create a new image |
| 1143 | (NewImageMode, optional, default 'absolute-paths') |
| 1144 | - "speed": the maximum speed, in bytes per second (json-int, optional) |
| 1145 | - "on-source-error": the action to take on an error on the source, default |
| 1146 | 'report'. 'stop' and 'enospc' can only be used |
| 1147 | if the block device supports io-status. |
| 1148 | (BlockdevOnError, optional) |
| 1149 | - "on-target-error": the action to take on an error on the target, default |
| 1150 | 'report' (no limitations, since this applies to |
| 1151 | a different block device than device). |
| 1152 | (BlockdevOnError, optional) |
| 1153 | |
| 1154 | Example: |
| 1155 | -> { "execute": "drive-backup", "arguments": { "device": "drive0", |
Ian Main | fc5d3f8 | 2013-07-26 11:39:04 -0700 | [diff] [blame] | 1156 | "sync": "full", |
Stefan Hajnoczi | 99a9add | 2013-06-24 17:13:14 +0200 | [diff] [blame] | 1157 | "target": "backup.img" } } |
| 1158 | <- { "return": {} } |
Fam Zheng | c29c1dd | 2014-12-18 18:37:05 +0800 | [diff] [blame] | 1159 | |
| 1160 | EQMP |
| 1161 | |
| 1162 | { |
| 1163 | .name = "blockdev-backup", |
| 1164 | .args_type = "sync:s,device:B,target:B,speed:i?," |
| 1165 | "on-source-error:s?,on-target-error:s?", |
| 1166 | .mhandler.cmd_new = qmp_marshal_input_blockdev_backup, |
| 1167 | }, |
| 1168 | |
| 1169 | SQMP |
| 1170 | blockdev-backup |
| 1171 | --------------- |
| 1172 | |
| 1173 | The device version of drive-backup: this command takes an existing named device |
| 1174 | as backup target. |
| 1175 | |
| 1176 | Arguments: |
| 1177 | |
| 1178 | - "device": the name of the device which should be copied. |
| 1179 | (json-string) |
| 1180 | - "target": the name of the backup target device. (json-string) |
| 1181 | - "sync": what parts of the disk image should be copied to the destination; |
| 1182 | possibilities include "full" for all the disk, "top" for only the |
| 1183 | sectors allocated in the topmost image, or "none" to only replicate |
| 1184 | new I/O (MirrorSyncMode). |
| 1185 | - "speed": the maximum speed, in bytes per second (json-int, optional) |
| 1186 | - "on-source-error": the action to take on an error on the source, default |
| 1187 | 'report'. 'stop' and 'enospc' can only be used |
| 1188 | if the block device supports io-status. |
| 1189 | (BlockdevOnError, optional) |
| 1190 | - "on-target-error": the action to take on an error on the target, default |
| 1191 | 'report' (no limitations, since this applies to |
| 1192 | a different block device than device). |
| 1193 | (BlockdevOnError, optional) |
| 1194 | |
| 1195 | Example: |
| 1196 | -> { "execute": "blockdev-backup", "arguments": { "device": "src-id", |
| 1197 | "sync": "full", |
| 1198 | "target": "tgt-id" } } |
| 1199 | <- { "return": {} } |
| 1200 | |
Stefan Hajnoczi | 99a9add | 2013-06-24 17:13:14 +0200 | [diff] [blame] | 1201 | EQMP |
| 1202 | |
| 1203 | { |
Stefan Hajnoczi | db58f9c | 2012-04-11 16:27:10 +0100 | [diff] [blame] | 1204 | .name = "block-job-set-speed", |
Stefan Hajnoczi | 882ec7c | 2012-04-25 16:51:02 +0100 | [diff] [blame] | 1205 | .args_type = "device:B,speed:o", |
Stefan Hajnoczi | 2d47c6e | 2012-01-18 14:40:47 +0000 | [diff] [blame] | 1206 | .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed, |
| 1207 | }, |
| 1208 | |
| 1209 | { |
Stefan Hajnoczi | db58f9c | 2012-04-11 16:27:10 +0100 | [diff] [blame] | 1210 | .name = "block-job-cancel", |
Paolo Bonzini | 6e37fb8 | 2012-09-28 17:22:51 +0200 | [diff] [blame] | 1211 | .args_type = "device:B,force:b?", |
Stefan Hajnoczi | 370521a | 2012-01-18 14:40:48 +0000 | [diff] [blame] | 1212 | .mhandler.cmd_new = qmp_marshal_input_block_job_cancel, |
| 1213 | }, |
Jeff Cody | c186402 | 2012-02-28 15:54:07 -0500 | [diff] [blame] | 1214 | { |
Paolo Bonzini | 6e37fb8 | 2012-09-28 17:22:51 +0200 | [diff] [blame] | 1215 | .name = "block-job-pause", |
| 1216 | .args_type = "device:B", |
| 1217 | .mhandler.cmd_new = qmp_marshal_input_block_job_pause, |
| 1218 | }, |
| 1219 | { |
| 1220 | .name = "block-job-resume", |
| 1221 | .args_type = "device:B", |
| 1222 | .mhandler.cmd_new = qmp_marshal_input_block_job_resume, |
| 1223 | }, |
| 1224 | { |
Paolo Bonzini | aeae883 | 2012-10-18 16:49:21 +0200 | [diff] [blame] | 1225 | .name = "block-job-complete", |
| 1226 | .args_type = "device:B", |
| 1227 | .mhandler.cmd_new = qmp_marshal_input_block_job_complete, |
| 1228 | }, |
| 1229 | { |
Paolo Bonzini | 52e7c24 | 2012-03-06 18:55:57 +0100 | [diff] [blame] | 1230 | .name = "transaction", |
Paolo Bonzini | b9f8978 | 2012-03-22 12:51:11 +0100 | [diff] [blame] | 1231 | .args_type = "actions:q", |
Paolo Bonzini | 52e7c24 | 2012-03-06 18:55:57 +0100 | [diff] [blame] | 1232 | .mhandler.cmd_new = qmp_marshal_input_transaction, |
Jeff Cody | c186402 | 2012-02-28 15:54:07 -0500 | [diff] [blame] | 1233 | }, |
| 1234 | |
| 1235 | SQMP |
Paolo Bonzini | 52e7c24 | 2012-03-06 18:55:57 +0100 | [diff] [blame] | 1236 | transaction |
| 1237 | ----------- |
Jeff Cody | c186402 | 2012-02-28 15:54:07 -0500 | [diff] [blame] | 1238 | |
Wenchao Xia | bbe8601 | 2013-09-11 14:04:34 +0800 | [diff] [blame] | 1239 | Atomically operate on one or more block devices. The only supported operations |
| 1240 | for now are drive-backup, internal and external snapshotting. A list of |
| 1241 | dictionaries is accepted, that contains the actions to be performed. |
| 1242 | If there is any failure performing any of the operations, all operations |
| 1243 | for the group are abandoned. |
Jeff Cody | c186402 | 2012-02-28 15:54:07 -0500 | [diff] [blame] | 1244 | |
Wenchao Xia | bbe8601 | 2013-09-11 14:04:34 +0800 | [diff] [blame] | 1245 | For external snapshots, the dictionary contains the device, the file to use for |
| 1246 | the new snapshot, and the format. The default format, if not specified, is |
| 1247 | qcow2. |
Jeff Cody | c186402 | 2012-02-28 15:54:07 -0500 | [diff] [blame] | 1248 | |
Paolo Bonzini | bc8b094 | 2012-03-06 18:55:58 +0100 | [diff] [blame] | 1249 | Each new snapshot defaults to being created by QEMU (wiping any |
| 1250 | contents if the file already exists), but it is also possible to reuse |
| 1251 | an externally-created file. In the latter case, you should ensure that |
| 1252 | the new image file has the same contents as the current one; QEMU cannot |
| 1253 | perform any meaningful check. Typically this is achieved by using the |
| 1254 | current image file as the backing file for the new image. |
| 1255 | |
Wenchao Xia | bbe8601 | 2013-09-11 14:04:34 +0800 | [diff] [blame] | 1256 | On failure, the original disks pre-snapshot attempt will be used. |
| 1257 | |
| 1258 | For internal snapshots, the dictionary contains the device and the snapshot's |
| 1259 | name. If an internal snapshot matching name already exists, the request will |
| 1260 | be rejected. Only some image formats support it, for example, qcow2, rbd, |
| 1261 | and sheepdog. |
| 1262 | |
| 1263 | On failure, qemu will try delete the newly created internal snapshot in the |
| 1264 | transaction. When an I/O error occurs during deletion, the user needs to fix |
| 1265 | it later with qemu-img or other command. |
| 1266 | |
Jeff Cody | c186402 | 2012-02-28 15:54:07 -0500 | [diff] [blame] | 1267 | Arguments: |
| 1268 | |
Paolo Bonzini | 52e7c24 | 2012-03-06 18:55:57 +0100 | [diff] [blame] | 1269 | actions array: |
| 1270 | - "type": the operation to perform. The only supported |
| 1271 | value is "blockdev-snapshot-sync". (json-string) |
| 1272 | - "data": a dictionary. The contents depend on the value |
| 1273 | of "type". When "type" is "blockdev-snapshot-sync": |
| 1274 | - "device": device name to snapshot (json-string) |
Benoît Canet | 0901f67 | 2014-01-23 21:31:38 +0100 | [diff] [blame] | 1275 | - "node-name": graph node name to snapshot (json-string) |
Paolo Bonzini | 52e7c24 | 2012-03-06 18:55:57 +0100 | [diff] [blame] | 1276 | - "snapshot-file": name of new image file (json-string) |
Benoît Canet | 0901f67 | 2014-01-23 21:31:38 +0100 | [diff] [blame] | 1277 | - "snapshot-node-name": graph node name of the new snapshot (json-string) |
Paolo Bonzini | 52e7c24 | 2012-03-06 18:55:57 +0100 | [diff] [blame] | 1278 | - "format": format of new image (json-string, optional) |
Paolo Bonzini | bc8b094 | 2012-03-06 18:55:58 +0100 | [diff] [blame] | 1279 | - "mode": whether and how QEMU should create the snapshot file |
| 1280 | (NewImageMode, optional, default "absolute-paths") |
Wenchao Xia | bbe8601 | 2013-09-11 14:04:34 +0800 | [diff] [blame] | 1281 | When "type" is "blockdev-snapshot-internal-sync": |
| 1282 | - "device": device name to snapshot (json-string) |
| 1283 | - "name": name of the new snapshot (json-string) |
Jeff Cody | c186402 | 2012-02-28 15:54:07 -0500 | [diff] [blame] | 1284 | |
| 1285 | Example: |
| 1286 | |
Paolo Bonzini | 52e7c24 | 2012-03-06 18:55:57 +0100 | [diff] [blame] | 1287 | -> { "execute": "transaction", |
| 1288 | "arguments": { "actions": [ |
Eric Blake | cd0c538 | 2014-05-06 09:39:03 -0600 | [diff] [blame] | 1289 | { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0", |
Paolo Bonzini | 52e7c24 | 2012-03-06 18:55:57 +0100 | [diff] [blame] | 1290 | "snapshot-file": "/some/place/my-image", |
| 1291 | "format": "qcow2" } }, |
Eric Blake | cd0c538 | 2014-05-06 09:39:03 -0600 | [diff] [blame] | 1292 | { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile", |
Benoît Canet | 0901f67 | 2014-01-23 21:31:38 +0100 | [diff] [blame] | 1293 | "snapshot-file": "/some/place/my-image2", |
| 1294 | "snapshot-node-name": "node3432", |
| 1295 | "mode": "existing", |
| 1296 | "format": "qcow2" } }, |
Eric Blake | cd0c538 | 2014-05-06 09:39:03 -0600 | [diff] [blame] | 1297 | { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1", |
Paolo Bonzini | 52e7c24 | 2012-03-06 18:55:57 +0100 | [diff] [blame] | 1298 | "snapshot-file": "/some/place/my-image2", |
Paolo Bonzini | bc8b094 | 2012-03-06 18:55:58 +0100 | [diff] [blame] | 1299 | "mode": "existing", |
Wenchao Xia | bbe8601 | 2013-09-11 14:04:34 +0800 | [diff] [blame] | 1300 | "format": "qcow2" } }, |
Eric Blake | cd0c538 | 2014-05-06 09:39:03 -0600 | [diff] [blame] | 1301 | { "type": "blockdev-snapshot-internal-sync", "data" : { |
Wenchao Xia | bbe8601 | 2013-09-11 14:04:34 +0800 | [diff] [blame] | 1302 | "device": "ide-hd2", |
| 1303 | "name": "snapshot0" } } ] } } |
Jeff Cody | c186402 | 2012-02-28 15:54:07 -0500 | [diff] [blame] | 1304 | <- { "return": {} } |
| 1305 | |
| 1306 | EQMP |
Stefan Hajnoczi | 370521a | 2012-01-18 14:40:48 +0000 | [diff] [blame] | 1307 | |
| 1308 | { |
Jes Sorensen | d967b2f | 2011-07-11 20:01:09 +0200 | [diff] [blame] | 1309 | .name = "blockdev-snapshot-sync", |
Benoît Canet | 0901f67 | 2014-01-23 21:31:38 +0100 | [diff] [blame] | 1310 | .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?", |
Luiz Capitulino | 6106e24 | 2011-11-25 16:15:19 -0200 | [diff] [blame] | 1311 | .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync, |
Jes Sorensen | d967b2f | 2011-07-11 20:01:09 +0200 | [diff] [blame] | 1312 | }, |
| 1313 | |
| 1314 | SQMP |
| 1315 | blockdev-snapshot-sync |
| 1316 | ---------------------- |
| 1317 | |
| 1318 | Synchronous snapshot of a block device. snapshot-file specifies the |
| 1319 | target of the new image. If the file exists, or if it is a device, the |
| 1320 | snapshot will be created in the existing file/device. If does not |
| 1321 | exist, a new file will be created. format specifies the format of the |
| 1322 | snapshot image, default is qcow2. |
| 1323 | |
| 1324 | Arguments: |
| 1325 | |
| 1326 | - "device": device name to snapshot (json-string) |
Benoît Canet | 0901f67 | 2014-01-23 21:31:38 +0100 | [diff] [blame] | 1327 | - "node-name": graph node name to snapshot (json-string) |
Jes Sorensen | d967b2f | 2011-07-11 20:01:09 +0200 | [diff] [blame] | 1328 | - "snapshot-file": name of new image file (json-string) |
Benoît Canet | 0901f67 | 2014-01-23 21:31:38 +0100 | [diff] [blame] | 1329 | - "snapshot-node-name": graph node name of the new snapshot (json-string) |
Paolo Bonzini | 6cc2a41 | 2012-03-06 18:55:59 +0100 | [diff] [blame] | 1330 | - "mode": whether and how QEMU should create the snapshot file |
| 1331 | (NewImageMode, optional, default "absolute-paths") |
Jes Sorensen | d967b2f | 2011-07-11 20:01:09 +0200 | [diff] [blame] | 1332 | - "format": format of new image (json-string, optional) |
| 1333 | |
| 1334 | Example: |
| 1335 | |
Luiz Capitulino | 7f3850c | 2011-10-10 17:30:08 -0300 | [diff] [blame] | 1336 | -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0", |
| 1337 | "snapshot-file": |
| 1338 | "/some/place/my-image", |
| 1339 | "format": "qcow2" } } |
Jes Sorensen | d967b2f | 2011-07-11 20:01:09 +0200 | [diff] [blame] | 1340 | <- { "return": {} } |
| 1341 | |
| 1342 | EQMP |
| 1343 | |
| 1344 | { |
Wenchao Xia | f323bc9 | 2013-09-11 14:04:35 +0800 | [diff] [blame] | 1345 | .name = "blockdev-snapshot-internal-sync", |
| 1346 | .args_type = "device:B,name:s", |
| 1347 | .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync, |
| 1348 | }, |
| 1349 | |
| 1350 | SQMP |
| 1351 | blockdev-snapshot-internal-sync |
| 1352 | ------------------------------- |
| 1353 | |
| 1354 | Synchronously take an internal snapshot of a block device when the format of |
| 1355 | image used supports it. If the name is an empty string, or a snapshot with |
| 1356 | name already exists, the operation will fail. |
| 1357 | |
| 1358 | Arguments: |
| 1359 | |
| 1360 | - "device": device name to snapshot (json-string) |
| 1361 | - "name": name of the new snapshot (json-string) |
| 1362 | |
| 1363 | Example: |
| 1364 | |
| 1365 | -> { "execute": "blockdev-snapshot-internal-sync", |
| 1366 | "arguments": { "device": "ide-hd0", |
| 1367 | "name": "snapshot0" } |
| 1368 | } |
| 1369 | <- { "return": {} } |
| 1370 | |
| 1371 | EQMP |
| 1372 | |
| 1373 | { |
Wenchao Xia | 44e3e05 | 2013-09-11 14:04:36 +0800 | [diff] [blame] | 1374 | .name = "blockdev-snapshot-delete-internal-sync", |
| 1375 | .args_type = "device:B,id:s?,name:s?", |
| 1376 | .mhandler.cmd_new = |
| 1377 | qmp_marshal_input_blockdev_snapshot_delete_internal_sync, |
| 1378 | }, |
| 1379 | |
| 1380 | SQMP |
| 1381 | blockdev-snapshot-delete-internal-sync |
| 1382 | -------------------------------------- |
| 1383 | |
| 1384 | Synchronously delete an internal snapshot of a block device when the format of |
| 1385 | image used supports it. The snapshot is identified by name or id or both. One |
| 1386 | of name or id is required. If the snapshot is not found, the operation will |
| 1387 | fail. |
| 1388 | |
| 1389 | Arguments: |
| 1390 | |
| 1391 | - "device": device name (json-string) |
| 1392 | - "id": ID of the snapshot (json-string, optional) |
| 1393 | - "name": name of the snapshot (json-string, optional) |
| 1394 | |
| 1395 | Example: |
| 1396 | |
| 1397 | -> { "execute": "blockdev-snapshot-delete-internal-sync", |
| 1398 | "arguments": { "device": "ide-hd0", |
| 1399 | "name": "snapshot0" } |
| 1400 | } |
| 1401 | <- { "return": { |
| 1402 | "id": "1", |
| 1403 | "name": "snapshot0", |
| 1404 | "vm-state-size": 0, |
| 1405 | "date-sec": 1000012, |
| 1406 | "date-nsec": 10, |
| 1407 | "vm-clock-sec": 100, |
| 1408 | "vm-clock-nsec": 20 |
| 1409 | } |
| 1410 | } |
| 1411 | |
| 1412 | EQMP |
| 1413 | |
| 1414 | { |
Paolo Bonzini | d9b902d | 2012-10-18 16:49:24 +0200 | [diff] [blame] | 1415 | .name = "drive-mirror", |
Paolo Bonzini | b952b55 | 2012-10-18 16:49:28 +0200 | [diff] [blame] | 1416 | .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?," |
Benoît Canet | 09158f0 | 2014-06-27 18:25:25 +0200 | [diff] [blame] | 1417 | "node-name:s?,replaces:s?," |
Paolo Bonzini | eee13df | 2013-01-21 17:09:46 +0100 | [diff] [blame] | 1418 | "on-source-error:s?,on-target-error:s?," |
Paolo Bonzini | 08e4ed6 | 2013-01-22 09:03:13 +0100 | [diff] [blame] | 1419 | "granularity:i?,buf-size:i?", |
Paolo Bonzini | d9b902d | 2012-10-18 16:49:24 +0200 | [diff] [blame] | 1420 | .mhandler.cmd_new = qmp_marshal_input_drive_mirror, |
| 1421 | }, |
| 1422 | |
| 1423 | SQMP |
| 1424 | drive-mirror |
| 1425 | ------------ |
| 1426 | |
| 1427 | Start mirroring a block device's writes to a new destination. target |
| 1428 | specifies the target of the new image. If the file exists, or if it is |
| 1429 | a device, it will be used as the new destination for writes. If it does not |
| 1430 | exist, a new file will be created. format specifies the format of the |
| 1431 | mirror image, default is to probe if mode='existing', else the format |
| 1432 | of the source. |
| 1433 | |
| 1434 | Arguments: |
| 1435 | |
| 1436 | - "device": device name to operate on (json-string) |
| 1437 | - "target": name of new image file (json-string) |
| 1438 | - "format": format of new image (json-string, optional) |
Benoît Canet | 4c828dc | 2014-06-16 12:00:55 +0200 | [diff] [blame] | 1439 | - "node-name": the name of the new block driver state in the node graph |
| 1440 | (json-string, optional) |
Benoît Canet | 09158f0 | 2014-06-27 18:25:25 +0200 | [diff] [blame] | 1441 | - "replaces": the block driver node name to replace when finished |
| 1442 | (json-string, optional) |
Paolo Bonzini | d9b902d | 2012-10-18 16:49:24 +0200 | [diff] [blame] | 1443 | - "mode": how an image file should be created into the target |
| 1444 | file/device (NewImageMode, optional, default 'absolute-paths') |
| 1445 | - "speed": maximum speed of the streaming job, in bytes per second |
| 1446 | (json-int) |
Paolo Bonzini | eee13df | 2013-01-21 17:09:46 +0100 | [diff] [blame] | 1447 | - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional) |
Paolo Bonzini | 08e4ed6 | 2013-01-22 09:03:13 +0100 | [diff] [blame] | 1448 | - "buf_size": maximum amount of data in flight from source to target, in bytes |
| 1449 | (json-int, default 10M) |
Paolo Bonzini | d9b902d | 2012-10-18 16:49:24 +0200 | [diff] [blame] | 1450 | - "sync": what parts of the disk image should be copied to the destination; |
| 1451 | possibilities include "full" for all the disk, "top" for only the sectors |
| 1452 | allocated in the topmost image, or "none" to only replicate new I/O |
| 1453 | (MirrorSyncMode). |
Paolo Bonzini | b952b55 | 2012-10-18 16:49:28 +0200 | [diff] [blame] | 1454 | - "on-source-error": the action to take on an error on the source |
| 1455 | (BlockdevOnError, default 'report') |
| 1456 | - "on-target-error": the action to take on an error on the target |
| 1457 | (BlockdevOnError, default 'report') |
| 1458 | |
Paolo Bonzini | eee13df | 2013-01-21 17:09:46 +0100 | [diff] [blame] | 1459 | The default value of the granularity is the image cluster size clamped |
| 1460 | between 4096 and 65536, if the image format defines one. If the format |
| 1461 | does not define a cluster size, the default value of the granularity |
| 1462 | is 65536. |
Paolo Bonzini | d9b902d | 2012-10-18 16:49:24 +0200 | [diff] [blame] | 1463 | |
| 1464 | |
| 1465 | Example: |
| 1466 | |
| 1467 | -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0", |
| 1468 | "target": "/some/place/my-image", |
| 1469 | "sync": "full", |
| 1470 | "format": "qcow2" } } |
| 1471 | <- { "return": {} } |
| 1472 | |
| 1473 | EQMP |
| 1474 | |
| 1475 | { |
Jeff Cody | fa40e65 | 2014-07-01 09:52:16 +0200 | [diff] [blame] | 1476 | .name = "change-backing-file", |
| 1477 | .args_type = "device:s,image-node-name:s,backing-file:s", |
| 1478 | .mhandler.cmd_new = qmp_marshal_input_change_backing_file, |
| 1479 | }, |
| 1480 | |
| 1481 | SQMP |
| 1482 | change-backing-file |
| 1483 | ------------------- |
| 1484 | Since: 2.1 |
| 1485 | |
| 1486 | Change the backing file in the image file metadata. This does not cause |
| 1487 | QEMU to reopen the image file to reparse the backing filename (it may, |
| 1488 | however, perform a reopen to change permissions from r/o -> r/w -> r/o, |
| 1489 | if needed). The new backing file string is written into the image file |
| 1490 | metadata, and the QEMU internal strings are updated. |
| 1491 | |
| 1492 | Arguments: |
| 1493 | |
| 1494 | - "image-node-name": The name of the block driver state node of the |
| 1495 | image to modify. The "device" is argument is used to |
| 1496 | verify "image-node-name" is in the chain described by |
| 1497 | "device". |
| 1498 | (json-string, optional) |
| 1499 | |
| 1500 | - "device": The name of the device. |
| 1501 | (json-string) |
| 1502 | |
| 1503 | - "backing-file": The string to write as the backing file. This string is |
| 1504 | not validated, so care should be taken when specifying |
| 1505 | the string or the image chain may not be able to be |
| 1506 | reopened again. |
| 1507 | (json-string) |
| 1508 | |
| 1509 | Returns: Nothing on success |
| 1510 | If "device" does not exist or cannot be determined, DeviceNotFound |
| 1511 | |
| 1512 | EQMP |
| 1513 | |
| 1514 | { |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1515 | .name = "balloon", |
| 1516 | .args_type = "value:M", |
Luiz Capitulino | d72f326 | 2011-11-25 14:38:09 -0200 | [diff] [blame] | 1517 | .mhandler.cmd_new = qmp_marshal_input_balloon, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1518 | }, |
| 1519 | |
| 1520 | SQMP |
| 1521 | balloon |
| 1522 | ------- |
| 1523 | |
| 1524 | Request VM to change its memory allocation (in bytes). |
| 1525 | |
| 1526 | Arguments: |
| 1527 | |
| 1528 | - "value": New memory allocation (json-int) |
| 1529 | |
| 1530 | Example: |
| 1531 | |
| 1532 | -> { "execute": "balloon", "arguments": { "value": 536870912 } } |
| 1533 | <- { "return": {} } |
| 1534 | |
| 1535 | EQMP |
| 1536 | |
| 1537 | { |
| 1538 | .name = "set_link", |
| 1539 | .args_type = "name:s,up:b", |
Luiz Capitulino | 4b37156 | 2011-11-23 13:11:55 -0200 | [diff] [blame] | 1540 | .mhandler.cmd_new = qmp_marshal_input_set_link, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1541 | }, |
| 1542 | |
| 1543 | SQMP |
| 1544 | set_link |
| 1545 | -------- |
| 1546 | |
| 1547 | Change the link status of a network adapter. |
| 1548 | |
| 1549 | Arguments: |
| 1550 | |
| 1551 | - "name": network device name (json-string) |
| 1552 | - "up": status is up (json-bool) |
| 1553 | |
| 1554 | Example: |
| 1555 | |
| 1556 | -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } } |
| 1557 | <- { "return": {} } |
| 1558 | |
| 1559 | EQMP |
| 1560 | |
| 1561 | { |
| 1562 | .name = "getfd", |
| 1563 | .args_type = "fdname:s", |
| 1564 | .params = "getfd name", |
| 1565 | .help = "receive a file descriptor via SCM rights and assign it a name", |
Corey Bryant | 208c9d1 | 2012-06-22 14:36:09 -0400 | [diff] [blame] | 1566 | .mhandler.cmd_new = qmp_marshal_input_getfd, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1567 | }, |
| 1568 | |
| 1569 | SQMP |
| 1570 | getfd |
| 1571 | ----- |
| 1572 | |
| 1573 | Receive a file descriptor via SCM rights and assign it a name. |
| 1574 | |
| 1575 | Arguments: |
| 1576 | |
| 1577 | - "fdname": file descriptor name (json-string) |
| 1578 | |
| 1579 | Example: |
| 1580 | |
| 1581 | -> { "execute": "getfd", "arguments": { "fdname": "fd1" } } |
| 1582 | <- { "return": {} } |
| 1583 | |
Corey Bryant | 208c9d1 | 2012-06-22 14:36:09 -0400 | [diff] [blame] | 1584 | Notes: |
| 1585 | |
| 1586 | (1) If the name specified by the "fdname" argument already exists, |
| 1587 | the file descriptor assigned to it will be closed and replaced |
| 1588 | by the received file descriptor. |
| 1589 | (2) The 'closefd' command can be used to explicitly close the file |
| 1590 | descriptor when it is no longer needed. |
| 1591 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1592 | EQMP |
| 1593 | |
| 1594 | { |
| 1595 | .name = "closefd", |
| 1596 | .args_type = "fdname:s", |
| 1597 | .params = "closefd name", |
| 1598 | .help = "close a file descriptor previously passed via SCM rights", |
Corey Bryant | 208c9d1 | 2012-06-22 14:36:09 -0400 | [diff] [blame] | 1599 | .mhandler.cmd_new = qmp_marshal_input_closefd, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1600 | }, |
| 1601 | |
| 1602 | SQMP |
| 1603 | closefd |
| 1604 | ------- |
| 1605 | |
| 1606 | Close a file descriptor previously passed via SCM rights. |
| 1607 | |
| 1608 | Arguments: |
| 1609 | |
| 1610 | - "fdname": file descriptor name (json-string) |
| 1611 | |
| 1612 | Example: |
| 1613 | |
| 1614 | -> { "execute": "closefd", "arguments": { "fdname": "fd1" } } |
| 1615 | <- { "return": {} } |
| 1616 | |
| 1617 | EQMP |
| 1618 | |
Corey Bryant | ba1c048 | 2012-08-14 16:43:43 -0400 | [diff] [blame] | 1619 | { |
| 1620 | .name = "add-fd", |
| 1621 | .args_type = "fdset-id:i?,opaque:s?", |
| 1622 | .params = "add-fd fdset-id opaque", |
| 1623 | .help = "Add a file descriptor, that was passed via SCM rights, to an fd set", |
| 1624 | .mhandler.cmd_new = qmp_marshal_input_add_fd, |
| 1625 | }, |
| 1626 | |
| 1627 | SQMP |
| 1628 | add-fd |
| 1629 | ------- |
| 1630 | |
| 1631 | Add a file descriptor, that was passed via SCM rights, to an fd set. |
| 1632 | |
| 1633 | Arguments: |
| 1634 | |
| 1635 | - "fdset-id": The ID of the fd set to add the file descriptor to. |
| 1636 | (json-int, optional) |
| 1637 | - "opaque": A free-form string that can be used to describe the fd. |
| 1638 | (json-string, optional) |
| 1639 | |
| 1640 | Return a json-object with the following information: |
| 1641 | |
| 1642 | - "fdset-id": The ID of the fd set that the fd was added to. (json-int) |
| 1643 | - "fd": The file descriptor that was received via SCM rights and added to the |
| 1644 | fd set. (json-int) |
| 1645 | |
| 1646 | Example: |
| 1647 | |
| 1648 | -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } } |
| 1649 | <- { "return": { "fdset-id": 1, "fd": 3 } } |
| 1650 | |
| 1651 | Notes: |
| 1652 | |
| 1653 | (1) The list of fd sets is shared by all monitor connections. |
| 1654 | (2) If "fdset-id" is not specified, a new fd set will be created. |
| 1655 | |
| 1656 | EQMP |
| 1657 | |
| 1658 | { |
| 1659 | .name = "remove-fd", |
| 1660 | .args_type = "fdset-id:i,fd:i?", |
| 1661 | .params = "remove-fd fdset-id fd", |
| 1662 | .help = "Remove a file descriptor from an fd set", |
| 1663 | .mhandler.cmd_new = qmp_marshal_input_remove_fd, |
| 1664 | }, |
| 1665 | |
| 1666 | SQMP |
| 1667 | remove-fd |
| 1668 | --------- |
| 1669 | |
| 1670 | Remove a file descriptor from an fd set. |
| 1671 | |
| 1672 | Arguments: |
| 1673 | |
| 1674 | - "fdset-id": The ID of the fd set that the file descriptor belongs to. |
| 1675 | (json-int) |
| 1676 | - "fd": The file descriptor that is to be removed. (json-int, optional) |
| 1677 | |
| 1678 | Example: |
| 1679 | |
| 1680 | -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } } |
| 1681 | <- { "return": {} } |
| 1682 | |
| 1683 | Notes: |
| 1684 | |
| 1685 | (1) The list of fd sets is shared by all monitor connections. |
| 1686 | (2) If "fd" is not specified, all file descriptors in "fdset-id" will be |
| 1687 | removed. |
| 1688 | |
| 1689 | EQMP |
| 1690 | |
| 1691 | { |
| 1692 | .name = "query-fdsets", |
| 1693 | .args_type = "", |
| 1694 | .help = "Return information describing all fd sets", |
| 1695 | .mhandler.cmd_new = qmp_marshal_input_query_fdsets, |
| 1696 | }, |
| 1697 | |
| 1698 | SQMP |
| 1699 | query-fdsets |
| 1700 | ------------- |
| 1701 | |
| 1702 | Return information describing all fd sets. |
| 1703 | |
| 1704 | Arguments: None |
| 1705 | |
| 1706 | Example: |
| 1707 | |
| 1708 | -> { "execute": "query-fdsets" } |
| 1709 | <- { "return": [ |
| 1710 | { |
| 1711 | "fds": [ |
| 1712 | { |
| 1713 | "fd": 30, |
| 1714 | "opaque": "rdonly:/path/to/file" |
| 1715 | }, |
| 1716 | { |
| 1717 | "fd": 24, |
| 1718 | "opaque": "rdwr:/path/to/file" |
| 1719 | } |
| 1720 | ], |
| 1721 | "fdset-id": 1 |
| 1722 | }, |
| 1723 | { |
| 1724 | "fds": [ |
| 1725 | { |
| 1726 | "fd": 28 |
| 1727 | }, |
| 1728 | { |
| 1729 | "fd": 29 |
| 1730 | } |
| 1731 | ], |
| 1732 | "fdset-id": 0 |
| 1733 | } |
| 1734 | ] |
| 1735 | } |
| 1736 | |
| 1737 | Note: The list of fd sets is shared by all monitor connections. |
| 1738 | |
| 1739 | EQMP |
| 1740 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1741 | { |
| 1742 | .name = "block_passwd", |
Benoît Canet | 12d3ba8 | 2014-01-23 21:31:35 +0100 | [diff] [blame] | 1743 | .args_type = "device:s?,node-name:s?,password:s", |
Luiz Capitulino | a4dea8a | 2011-11-23 13:28:21 -0200 | [diff] [blame] | 1744 | .mhandler.cmd_new = qmp_marshal_input_block_passwd, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1745 | }, |
| 1746 | |
| 1747 | SQMP |
| 1748 | block_passwd |
| 1749 | ------------ |
| 1750 | |
| 1751 | Set the password of encrypted block devices. |
| 1752 | |
| 1753 | Arguments: |
| 1754 | |
| 1755 | - "device": device name (json-string) |
Benoît Canet | 12d3ba8 | 2014-01-23 21:31:35 +0100 | [diff] [blame] | 1756 | - "node-name": name in the block driver state graph (json-string) |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1757 | - "password": password (json-string) |
| 1758 | |
| 1759 | Example: |
| 1760 | |
| 1761 | -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0", |
| 1762 | "password": "12345" } } |
| 1763 | <- { "return": {} } |
| 1764 | |
| 1765 | EQMP |
| 1766 | |
| 1767 | { |
Zhi Yong Wu | 727f005 | 2011-11-08 13:00:31 +0800 | [diff] [blame] | 1768 | .name = "block_set_io_throttle", |
Benoît Canet | 2024c1d | 2013-09-02 14:14:41 +0200 | [diff] [blame] | 1769 | .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l,bps_max:l?,bps_rd_max:l?,bps_wr_max:l?,iops_max:l?,iops_rd_max:l?,iops_wr_max:l?,iops_size:l?", |
Luiz Capitulino | 80047da | 2011-12-14 16:49:14 -0200 | [diff] [blame] | 1770 | .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle, |
Zhi Yong Wu | 727f005 | 2011-11-08 13:00:31 +0800 | [diff] [blame] | 1771 | }, |
| 1772 | |
| 1773 | SQMP |
| 1774 | block_set_io_throttle |
| 1775 | ------------ |
| 1776 | |
| 1777 | Change I/O throttle limits for a block drive. |
| 1778 | |
| 1779 | Arguments: |
| 1780 | |
| 1781 | - "device": device name (json-string) |
Eric Blake | 586b546 | 2013-08-30 14:44:11 -0600 | [diff] [blame] | 1782 | - "bps": total throughput limit in bytes per second (json-int) |
| 1783 | - "bps_rd": read throughput limit in bytes per second (json-int) |
| 1784 | - "bps_wr": write throughput limit in bytes per second (json-int) |
| 1785 | - "iops": total I/O operations per second (json-int) |
| 1786 | - "iops_rd": read I/O operations per second (json-int) |
| 1787 | - "iops_wr": write I/O operations per second (json-int) |
Benoît Canet | 3e9fab6 | 2013-09-02 14:14:40 +0200 | [diff] [blame] | 1788 | - "bps_max": total max in bytes (json-int) |
| 1789 | - "bps_rd_max": read max in bytes (json-int) |
| 1790 | - "bps_wr_max": write max in bytes (json-int) |
| 1791 | - "iops_max": total I/O operations max (json-int) |
| 1792 | - "iops_rd_max": read I/O operations max (json-int) |
| 1793 | - "iops_wr_max": write I/O operations max (json-int) |
Benoît Canet | 2024c1d | 2013-09-02 14:14:41 +0200 | [diff] [blame] | 1794 | - "iops_size": I/O size in bytes when limiting (json-int) |
Zhi Yong Wu | 727f005 | 2011-11-08 13:00:31 +0800 | [diff] [blame] | 1795 | |
| 1796 | Example: |
| 1797 | |
| 1798 | -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0", |
Eric Blake | 586b546 | 2013-08-30 14:44:11 -0600 | [diff] [blame] | 1799 | "bps": 1000000, |
| 1800 | "bps_rd": 0, |
| 1801 | "bps_wr": 0, |
| 1802 | "iops": 0, |
| 1803 | "iops_rd": 0, |
Benoît Canet | 3e9fab6 | 2013-09-02 14:14:40 +0200 | [diff] [blame] | 1804 | "iops_wr": 0, |
| 1805 | "bps_max": 8000000, |
| 1806 | "bps_rd_max": 0, |
| 1807 | "bps_wr_max": 0, |
| 1808 | "iops_max": 0, |
| 1809 | "iops_rd_max": 0, |
Benoît Canet | 2024c1d | 2013-09-02 14:14:41 +0200 | [diff] [blame] | 1810 | "iops_wr_max": 0, |
| 1811 | "iops_size": 0 } } |
Zhi Yong Wu | 727f005 | 2011-11-08 13:00:31 +0800 | [diff] [blame] | 1812 | <- { "return": {} } |
| 1813 | |
| 1814 | EQMP |
| 1815 | |
| 1816 | { |
Gerd Hoffmann | 7572150 | 2010-10-07 12:22:54 +0200 | [diff] [blame] | 1817 | .name = "set_password", |
| 1818 | .args_type = "protocol:s,password:s,connected:s?", |
Luiz Capitulino | fbf796f | 2011-12-07 11:17:51 -0200 | [diff] [blame] | 1819 | .mhandler.cmd_new = qmp_marshal_input_set_password, |
Gerd Hoffmann | 7572150 | 2010-10-07 12:22:54 +0200 | [diff] [blame] | 1820 | }, |
| 1821 | |
| 1822 | SQMP |
| 1823 | set_password |
| 1824 | ------------ |
| 1825 | |
| 1826 | Set the password for vnc/spice protocols. |
| 1827 | |
| 1828 | Arguments: |
| 1829 | |
| 1830 | - "protocol": protocol name (json-string) |
| 1831 | - "password": password (json-string) |
Alberto Garcia | 3599d46 | 2015-02-26 16:35:07 +0200 | [diff] [blame] | 1832 | - "connected": [ keep | disconnect | fail ] (json-string, optional) |
Gerd Hoffmann | 7572150 | 2010-10-07 12:22:54 +0200 | [diff] [blame] | 1833 | |
| 1834 | Example: |
| 1835 | |
| 1836 | -> { "execute": "set_password", "arguments": { "protocol": "vnc", |
| 1837 | "password": "secret" } } |
| 1838 | <- { "return": {} } |
| 1839 | |
| 1840 | EQMP |
| 1841 | |
| 1842 | { |
| 1843 | .name = "expire_password", |
| 1844 | .args_type = "protocol:s,time:s", |
Luiz Capitulino | 9ad5372 | 2011-12-07 11:47:57 -0200 | [diff] [blame] | 1845 | .mhandler.cmd_new = qmp_marshal_input_expire_password, |
Gerd Hoffmann | 7572150 | 2010-10-07 12:22:54 +0200 | [diff] [blame] | 1846 | }, |
| 1847 | |
| 1848 | SQMP |
| 1849 | expire_password |
| 1850 | --------------- |
| 1851 | |
| 1852 | Set the password expire time for vnc/spice protocols. |
| 1853 | |
| 1854 | Arguments: |
| 1855 | |
| 1856 | - "protocol": protocol name (json-string) |
| 1857 | - "time": [ now | never | +secs | secs ] (json-string) |
| 1858 | |
| 1859 | Example: |
| 1860 | |
| 1861 | -> { "execute": "expire_password", "arguments": { "protocol": "vnc", |
| 1862 | "time": "+60" } } |
| 1863 | <- { "return": {} } |
| 1864 | |
| 1865 | EQMP |
| 1866 | |
| 1867 | { |
Daniel P. Berrange | 1366108 | 2011-06-23 13:31:42 +0100 | [diff] [blame] | 1868 | .name = "add_client", |
Daniel P. Berrange | f1f5f40 | 2012-02-13 13:43:08 +0000 | [diff] [blame] | 1869 | .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?", |
Luiz Capitulino | b224e5e | 2012-09-13 16:52:20 -0300 | [diff] [blame] | 1870 | .mhandler.cmd_new = qmp_marshal_input_add_client, |
Daniel P. Berrange | 1366108 | 2011-06-23 13:31:42 +0100 | [diff] [blame] | 1871 | }, |
| 1872 | |
| 1873 | SQMP |
| 1874 | add_client |
| 1875 | ---------- |
| 1876 | |
| 1877 | Add a graphics client |
| 1878 | |
| 1879 | Arguments: |
| 1880 | |
| 1881 | - "protocol": protocol name (json-string) |
| 1882 | - "fdname": file descriptor name (json-string) |
Daniel P. Berrange | f1f5f40 | 2012-02-13 13:43:08 +0000 | [diff] [blame] | 1883 | - "skipauth": whether to skip authentication (json-bool, optional) |
| 1884 | - "tls": whether to perform TLS (json-bool, optional) |
Daniel P. Berrange | 1366108 | 2011-06-23 13:31:42 +0100 | [diff] [blame] | 1885 | |
| 1886 | Example: |
| 1887 | |
| 1888 | -> { "execute": "add_client", "arguments": { "protocol": "vnc", |
| 1889 | "fdname": "myclient" } } |
| 1890 | <- { "return": {} } |
| 1891 | |
| 1892 | EQMP |
| 1893 | { |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1894 | .name = "qmp_capabilities", |
| 1895 | .args_type = "", |
| 1896 | .params = "", |
| 1897 | .help = "enable QMP capabilities", |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1898 | .mhandler.cmd_new = do_qmp_capabilities, |
| 1899 | }, |
| 1900 | |
| 1901 | SQMP |
| 1902 | qmp_capabilities |
| 1903 | ---------------- |
| 1904 | |
| 1905 | Enable QMP capabilities. |
| 1906 | |
| 1907 | Arguments: None. |
| 1908 | |
| 1909 | Example: |
| 1910 | |
| 1911 | -> { "execute": "qmp_capabilities" } |
| 1912 | <- { "return": {} } |
| 1913 | |
| 1914 | Note: This command must be issued before issuing any other command. |
| 1915 | |
Luiz Capitulino | 0268d97 | 2010-10-22 10:08:02 -0200 | [diff] [blame] | 1916 | EQMP |
| 1917 | |
| 1918 | { |
| 1919 | .name = "human-monitor-command", |
| 1920 | .args_type = "command-line:s,cpu-index:i?", |
Luiz Capitulino | d51a67b | 2011-11-25 17:52:45 -0200 | [diff] [blame] | 1921 | .mhandler.cmd_new = qmp_marshal_input_human_monitor_command, |
Luiz Capitulino | 0268d97 | 2010-10-22 10:08:02 -0200 | [diff] [blame] | 1922 | }, |
| 1923 | |
| 1924 | SQMP |
| 1925 | human-monitor-command |
| 1926 | --------------------- |
| 1927 | |
| 1928 | Execute a Human Monitor command. |
| 1929 | |
| 1930 | Arguments: |
| 1931 | |
| 1932 | - command-line: the command name and its arguments, just like the |
| 1933 | Human Monitor's shell (json-string) |
| 1934 | - cpu-index: select the CPU number to be used by commands which access CPU |
| 1935 | data, like 'info registers'. The Monitor selects CPU 0 if this |
| 1936 | argument is not provided (json-int, optional) |
| 1937 | |
| 1938 | Example: |
| 1939 | |
| 1940 | -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } } |
| 1941 | <- { "return": "kvm support: enabled\r\n" } |
| 1942 | |
| 1943 | Notes: |
| 1944 | |
| 1945 | (1) The Human Monitor is NOT an stable interface, this means that command |
| 1946 | names, arguments and responses can change or be removed at ANY time. |
| 1947 | Applications that rely on long term stability guarantees should NOT |
| 1948 | use this command |
| 1949 | |
| 1950 | (2) Limitations: |
| 1951 | |
| 1952 | o This command is stateless, this means that commands that depend |
| 1953 | on state information (such as getfd) might not work |
| 1954 | |
| 1955 | o Commands that prompt the user for data (eg. 'cont' when the block |
| 1956 | device is encrypted) don't currently work |
| 1957 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 1958 | 3. Query Commands |
| 1959 | ================= |
| 1960 | |
| 1961 | HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change |
| 1962 | HXCOMM this! We will possibly move query commands definitions inside those |
| 1963 | HXCOMM sections, just like regular commands. |
| 1964 | |
| 1965 | EQMP |
| 1966 | |
| 1967 | SQMP |
| 1968 | query-version |
| 1969 | ------------- |
| 1970 | |
| 1971 | Show QEMU version. |
| 1972 | |
| 1973 | Return a json-object with the following information: |
| 1974 | |
| 1975 | - "qemu": A json-object containing three integer values: |
| 1976 | - "major": QEMU's major version (json-int) |
| 1977 | - "minor": QEMU's minor version (json-int) |
| 1978 | - "micro": QEMU's micro version (json-int) |
| 1979 | - "package": package's version (json-string) |
| 1980 | |
| 1981 | Example: |
| 1982 | |
| 1983 | -> { "execute": "query-version" } |
| 1984 | <- { |
| 1985 | "return":{ |
| 1986 | "qemu":{ |
| 1987 | "major":0, |
| 1988 | "minor":11, |
| 1989 | "micro":5 |
| 1990 | }, |
| 1991 | "package":"" |
| 1992 | } |
| 1993 | } |
| 1994 | |
| 1995 | EQMP |
| 1996 | |
Luiz Capitulino | b9c15f1 | 2011-08-26 17:38:13 -0300 | [diff] [blame] | 1997 | { |
| 1998 | .name = "query-version", |
| 1999 | .args_type = "", |
| 2000 | .mhandler.cmd_new = qmp_marshal_input_query_version, |
| 2001 | }, |
| 2002 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2003 | SQMP |
| 2004 | query-commands |
| 2005 | -------------- |
| 2006 | |
| 2007 | List QMP available commands. |
| 2008 | |
| 2009 | Each command is represented by a json-object, the returned value is a json-array |
| 2010 | of all commands. |
| 2011 | |
| 2012 | Each json-object contain: |
| 2013 | |
| 2014 | - "name": command's name (json-string) |
| 2015 | |
| 2016 | Example: |
| 2017 | |
| 2018 | -> { "execute": "query-commands" } |
| 2019 | <- { |
| 2020 | "return":[ |
| 2021 | { |
| 2022 | "name":"query-balloon" |
| 2023 | }, |
| 2024 | { |
| 2025 | "name":"system_powerdown" |
| 2026 | } |
| 2027 | ] |
| 2028 | } |
| 2029 | |
| 2030 | Note: This example has been shortened as the real response is too long. |
| 2031 | |
| 2032 | EQMP |
| 2033 | |
Luiz Capitulino | aa9b79b | 2011-09-21 14:31:51 -0300 | [diff] [blame] | 2034 | { |
| 2035 | .name = "query-commands", |
| 2036 | .args_type = "", |
| 2037 | .mhandler.cmd_new = qmp_marshal_input_query_commands, |
| 2038 | }, |
| 2039 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2040 | SQMP |
Daniel P. Berrange | 4860853 | 2012-05-21 17:59:51 +0100 | [diff] [blame] | 2041 | query-events |
| 2042 | -------------- |
| 2043 | |
| 2044 | List QMP available events. |
| 2045 | |
| 2046 | Each event is represented by a json-object, the returned value is a json-array |
| 2047 | of all events. |
| 2048 | |
| 2049 | Each json-object contains: |
| 2050 | |
| 2051 | - "name": event's name (json-string) |
| 2052 | |
| 2053 | Example: |
| 2054 | |
| 2055 | -> { "execute": "query-events" } |
| 2056 | <- { |
| 2057 | "return":[ |
| 2058 | { |
| 2059 | "name":"SHUTDOWN" |
| 2060 | }, |
| 2061 | { |
| 2062 | "name":"RESET" |
| 2063 | } |
| 2064 | ] |
| 2065 | } |
| 2066 | |
| 2067 | Note: This example has been shortened as the real response is too long. |
| 2068 | |
| 2069 | EQMP |
| 2070 | |
| 2071 | { |
| 2072 | .name = "query-events", |
| 2073 | .args_type = "", |
| 2074 | .mhandler.cmd_new = qmp_marshal_input_query_events, |
| 2075 | }, |
| 2076 | |
| 2077 | SQMP |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2078 | query-chardev |
| 2079 | ------------- |
| 2080 | |
| 2081 | Each device is represented by a json-object. The returned value is a json-array |
| 2082 | of all devices. |
| 2083 | |
| 2084 | Each json-object contain the following: |
| 2085 | |
| 2086 | - "label": device's label (json-string) |
| 2087 | - "filename": device's file (json-string) |
Laszlo Ersek | 32a97ea | 2014-06-26 17:50:03 +0200 | [diff] [blame] | 2088 | - "frontend-open": open/closed state of the frontend device attached to this |
| 2089 | backend (json-bool) |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2090 | |
| 2091 | Example: |
| 2092 | |
| 2093 | -> { "execute": "query-chardev" } |
| 2094 | <- { |
Laszlo Ersek | 32a97ea | 2014-06-26 17:50:03 +0200 | [diff] [blame] | 2095 | "return": [ |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2096 | { |
Laszlo Ersek | 32a97ea | 2014-06-26 17:50:03 +0200 | [diff] [blame] | 2097 | "label": "charchannel0", |
| 2098 | "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server", |
| 2099 | "frontend-open": false |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2100 | }, |
| 2101 | { |
Laszlo Ersek | 32a97ea | 2014-06-26 17:50:03 +0200 | [diff] [blame] | 2102 | "label": "charmonitor", |
| 2103 | "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server", |
| 2104 | "frontend-open": true |
| 2105 | }, |
| 2106 | { |
| 2107 | "label": "charserial0", |
| 2108 | "filename": "pty:/dev/pts/2", |
| 2109 | "frontend-open": true |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2110 | } |
| 2111 | ] |
| 2112 | } |
| 2113 | |
| 2114 | EQMP |
| 2115 | |
Luiz Capitulino | c5a415a | 2011-09-14 16:05:49 -0300 | [diff] [blame] | 2116 | { |
| 2117 | .name = "query-chardev", |
| 2118 | .args_type = "", |
| 2119 | .mhandler.cmd_new = qmp_marshal_input_query_chardev, |
| 2120 | }, |
| 2121 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2122 | SQMP |
Martin Kletzander | 77d1c3c | 2014-02-01 12:52:42 +0100 | [diff] [blame] | 2123 | query-chardev-backends |
| 2124 | ------------- |
| 2125 | |
| 2126 | List available character device backends. |
| 2127 | |
| 2128 | Each backend is represented by a json-object, the returned value is a json-array |
| 2129 | of all backends. |
| 2130 | |
| 2131 | Each json-object contains: |
| 2132 | |
| 2133 | - "name": backend name (json-string) |
| 2134 | |
| 2135 | Example: |
| 2136 | |
| 2137 | -> { "execute": "query-chardev-backends" } |
| 2138 | <- { |
| 2139 | "return":[ |
| 2140 | { |
| 2141 | "name":"udp" |
| 2142 | }, |
| 2143 | { |
| 2144 | "name":"tcp" |
| 2145 | }, |
| 2146 | { |
| 2147 | "name":"unix" |
| 2148 | }, |
| 2149 | { |
| 2150 | "name":"spiceport" |
| 2151 | } |
| 2152 | ] |
| 2153 | } |
| 2154 | |
| 2155 | EQMP |
| 2156 | |
| 2157 | { |
| 2158 | .name = "query-chardev-backends", |
| 2159 | .args_type = "", |
| 2160 | .mhandler.cmd_new = qmp_marshal_input_query_chardev_backends, |
| 2161 | }, |
| 2162 | |
| 2163 | SQMP |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2164 | query-block |
| 2165 | ----------- |
| 2166 | |
| 2167 | Show the block devices. |
| 2168 | |
| 2169 | Each block device information is stored in a json-object and the returned value |
| 2170 | is a json-array of all devices. |
| 2171 | |
| 2172 | Each json-object contain the following: |
| 2173 | |
| 2174 | - "device": device name (json-string) |
| 2175 | - "type": device type (json-string) |
Markus Armbruster | d8aeeb3 | 2011-05-16 15:04:55 +0200 | [diff] [blame] | 2176 | - deprecated, retained for backward compatibility |
| 2177 | - Possible values: "unknown" |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2178 | - "removable": true if the device is removable, false otherwise (json-bool) |
| 2179 | - "locked": true if the device is locked, false otherwise (json-bool) |
Michal Privoznik | 99f4280 | 2013-01-29 17:58:41 +0100 | [diff] [blame] | 2180 | - "tray_open": only present if removable, true if the device has a tray, |
Markus Armbruster | e4def80 | 2011-09-06 18:58:53 +0200 | [diff] [blame] | 2181 | and it is open (json-bool) |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2182 | - "inserted": only present if the device is inserted, it is a json-object |
| 2183 | containing the following: |
| 2184 | - "file": device file name (json-string) |
| 2185 | - "ro": true if read-only, false otherwise (json-bool) |
| 2186 | - "drv": driver format name (json-string) |
Stefan Hajnoczi | 550830f | 2014-09-16 15:24:24 +0100 | [diff] [blame] | 2187 | - Possible values: "blkdebug", "bochs", "cloop", "dmg", |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2188 | "file", "file", "ftp", "ftps", "host_cdrom", |
Markus Armbruster | 92a539d | 2015-03-17 17:02:20 +0100 | [diff] [blame] | 2189 | "host_device", "http", "https", |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2190 | "nbd", "parallels", "qcow", "qcow2", "raw", |
| 2191 | "tftp", "vdi", "vmdk", "vpc", "vvfat" |
| 2192 | - "backing_file": backing file name (json-string, optional) |
Benoît Canet | 2e3e331 | 2012-08-02 10:22:48 +0200 | [diff] [blame] | 2193 | - "backing_file_depth": number of files in the backing file chain (json-int) |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2194 | - "encrypted": true if encrypted, false otherwise (json-bool) |
Zhi Yong Wu | 727f005 | 2011-11-08 13:00:31 +0800 | [diff] [blame] | 2195 | - "bps": limit total bytes per second (json-int) |
| 2196 | - "bps_rd": limit read bytes per second (json-int) |
| 2197 | - "bps_wr": limit write bytes per second (json-int) |
| 2198 | - "iops": limit total I/O operations per second (json-int) |
| 2199 | - "iops_rd": limit read operations per second (json-int) |
| 2200 | - "iops_wr": limit write operations per second (json-int) |
Benoît Canet | 3e9fab6 | 2013-09-02 14:14:40 +0200 | [diff] [blame] | 2201 | - "bps_max": total max in bytes (json-int) |
| 2202 | - "bps_rd_max": read max in bytes (json-int) |
| 2203 | - "bps_wr_max": write max in bytes (json-int) |
| 2204 | - "iops_max": total I/O operations max (json-int) |
| 2205 | - "iops_rd_max": read I/O operations max (json-int) |
| 2206 | - "iops_wr_max": write I/O operations max (json-int) |
Benoît Canet | 2024c1d | 2013-09-02 14:14:41 +0200 | [diff] [blame] | 2207 | - "iops_size": I/O size when limiting by iops (json-int) |
Peter Lieven | 465bee1 | 2014-05-18 00:58:19 +0200 | [diff] [blame] | 2208 | - "detect_zeroes": detect and optimize zero writing (json-string) |
| 2209 | - Possible values: "off", "on", "unmap" |
Francesco Romani | e246211 | 2015-01-12 14:11:13 +0100 | [diff] [blame] | 2210 | - "write_threshold": write offset threshold in bytes, a event will be |
| 2211 | emitted if crossed. Zero if disabled (json-int) |
Wenchao Xia | 553a7e8 | 2013-06-06 12:27:59 +0800 | [diff] [blame] | 2212 | - "image": the detail of the image, it is a json-object containing |
| 2213 | the following: |
| 2214 | - "filename": image file name (json-string) |
| 2215 | - "format": image format (json-string) |
| 2216 | - "virtual-size": image capacity in bytes (json-int) |
| 2217 | - "dirty-flag": true if image is not cleanly closed, not present |
| 2218 | means clean (json-bool, optional) |
| 2219 | - "actual-size": actual size on disk in bytes of the image, not |
| 2220 | present when image does not support thin |
| 2221 | provision (json-int, optional) |
| 2222 | - "cluster-size": size of a cluster in bytes, not present if image |
| 2223 | format does not support it (json-int, optional) |
| 2224 | - "encrypted": true if the image is encrypted, not present means |
| 2225 | false or the image format does not support |
| 2226 | encryption (json-bool, optional) |
| 2227 | - "backing_file": backing file name, not present means no backing |
| 2228 | file is used or the image format does not |
| 2229 | support backing file chain |
| 2230 | (json-string, optional) |
| 2231 | - "full-backing-filename": full path of the backing file, not |
| 2232 | present if it equals backing_file or no |
| 2233 | backing file is used |
| 2234 | (json-string, optional) |
| 2235 | - "backing-filename-format": the format of the backing file, not |
| 2236 | present means unknown or no backing |
| 2237 | file (json-string, optional) |
| 2238 | - "snapshots": the internal snapshot info, it is an optional list |
| 2239 | of json-object containing the following: |
| 2240 | - "id": unique snapshot id (json-string) |
| 2241 | - "name": snapshot name (json-string) |
| 2242 | - "vm-state-size": size of the VM state in bytes (json-int) |
| 2243 | - "date-sec": UTC date of the snapshot in seconds (json-int) |
| 2244 | - "date-nsec": fractional part in nanoseconds to be used with |
Eric Blake | 586b546 | 2013-08-30 14:44:11 -0600 | [diff] [blame] | 2245 | date-sec (json-int) |
Wenchao Xia | 553a7e8 | 2013-06-06 12:27:59 +0800 | [diff] [blame] | 2246 | - "vm-clock-sec": VM clock relative to boot in seconds |
| 2247 | (json-int) |
| 2248 | - "vm-clock-nsec": fractional part in nanoseconds to be used |
| 2249 | with vm-clock-sec (json-int) |
| 2250 | - "backing-image": the detail of the backing image, it is an |
| 2251 | optional json-object only present when a |
| 2252 | backing image present for this image |
Zhi Yong Wu | 727f005 | 2011-11-08 13:00:31 +0800 | [diff] [blame] | 2253 | |
Luiz Capitulino | f04ef60 | 2011-09-26 17:43:54 -0300 | [diff] [blame] | 2254 | - "io-status": I/O operation status, only present if the device supports it |
| 2255 | and the VM is configured to stop on errors. It's always reset |
| 2256 | to "ok" when the "cont" command is issued (json_string, optional) |
| 2257 | - Possible values: "ok", "failed", "nospace" |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2258 | |
| 2259 | Example: |
| 2260 | |
| 2261 | -> { "execute": "query-block" } |
| 2262 | <- { |
| 2263 | "return":[ |
| 2264 | { |
Luiz Capitulino | f04ef60 | 2011-09-26 17:43:54 -0300 | [diff] [blame] | 2265 | "io-status": "ok", |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2266 | "device":"ide0-hd0", |
| 2267 | "locked":false, |
| 2268 | "removable":false, |
| 2269 | "inserted":{ |
| 2270 | "ro":false, |
| 2271 | "drv":"qcow2", |
| 2272 | "encrypted":false, |
Wenchao Xia | 553a7e8 | 2013-06-06 12:27:59 +0800 | [diff] [blame] | 2273 | "file":"disks/test.qcow2", |
| 2274 | "backing_file_depth":1, |
Zhi Yong Wu | 727f005 | 2011-11-08 13:00:31 +0800 | [diff] [blame] | 2275 | "bps":1000000, |
| 2276 | "bps_rd":0, |
| 2277 | "bps_wr":0, |
| 2278 | "iops":1000000, |
| 2279 | "iops_rd":0, |
| 2280 | "iops_wr":0, |
Benoît Canet | 3e9fab6 | 2013-09-02 14:14:40 +0200 | [diff] [blame] | 2281 | "bps_max": 8000000, |
| 2282 | "bps_rd_max": 0, |
| 2283 | "bps_wr_max": 0, |
| 2284 | "iops_max": 0, |
| 2285 | "iops_rd_max": 0, |
| 2286 | "iops_wr_max": 0, |
Benoît Canet | 2024c1d | 2013-09-02 14:14:41 +0200 | [diff] [blame] | 2287 | "iops_size": 0, |
Peter Lieven | 465bee1 | 2014-05-18 00:58:19 +0200 | [diff] [blame] | 2288 | "detect_zeroes": "on", |
Francesco Romani | e246211 | 2015-01-12 14:11:13 +0100 | [diff] [blame] | 2289 | "write_threshold": 0, |
Wenchao Xia | 553a7e8 | 2013-06-06 12:27:59 +0800 | [diff] [blame] | 2290 | "image":{ |
| 2291 | "filename":"disks/test.qcow2", |
| 2292 | "format":"qcow2", |
| 2293 | "virtual-size":2048000, |
| 2294 | "backing_file":"base.qcow2", |
| 2295 | "full-backing-filename":"disks/base.qcow2", |
| 2296 | "backing-filename-format:"qcow2", |
| 2297 | "snapshots":[ |
| 2298 | { |
| 2299 | "id": "1", |
| 2300 | "name": "snapshot1", |
| 2301 | "vm-state-size": 0, |
| 2302 | "date-sec": 10000200, |
| 2303 | "date-nsec": 12, |
| 2304 | "vm-clock-sec": 206, |
| 2305 | "vm-clock-nsec": 30 |
| 2306 | } |
| 2307 | ], |
| 2308 | "backing-image":{ |
| 2309 | "filename":"disks/base.qcow2", |
| 2310 | "format":"qcow2", |
| 2311 | "virtual-size":2048000 |
| 2312 | } |
| 2313 | } |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2314 | }, |
Markus Armbruster | d8aeeb3 | 2011-05-16 15:04:55 +0200 | [diff] [blame] | 2315 | "type":"unknown" |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2316 | }, |
| 2317 | { |
Luiz Capitulino | f04ef60 | 2011-09-26 17:43:54 -0300 | [diff] [blame] | 2318 | "io-status": "ok", |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2319 | "device":"ide1-cd0", |
| 2320 | "locked":false, |
| 2321 | "removable":true, |
Markus Armbruster | d8aeeb3 | 2011-05-16 15:04:55 +0200 | [diff] [blame] | 2322 | "type":"unknown" |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2323 | }, |
| 2324 | { |
| 2325 | "device":"floppy0", |
| 2326 | "locked":false, |
| 2327 | "removable":true, |
Markus Armbruster | d8aeeb3 | 2011-05-16 15:04:55 +0200 | [diff] [blame] | 2328 | "type":"unknown" |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2329 | }, |
| 2330 | { |
| 2331 | "device":"sd0", |
| 2332 | "locked":false, |
| 2333 | "removable":true, |
Markus Armbruster | d8aeeb3 | 2011-05-16 15:04:55 +0200 | [diff] [blame] | 2334 | "type":"unknown" |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2335 | } |
| 2336 | ] |
| 2337 | } |
| 2338 | |
| 2339 | EQMP |
| 2340 | |
Luiz Capitulino | b202381 | 2011-09-21 17:16:47 -0300 | [diff] [blame] | 2341 | { |
| 2342 | .name = "query-block", |
| 2343 | .args_type = "", |
| 2344 | .mhandler.cmd_new = qmp_marshal_input_query_block, |
| 2345 | }, |
| 2346 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2347 | SQMP |
| 2348 | query-blockstats |
| 2349 | ---------------- |
| 2350 | |
| 2351 | Show block device statistics. |
| 2352 | |
| 2353 | Each device statistic information is stored in a json-object and the returned |
| 2354 | value is a json-array of all devices. |
| 2355 | |
| 2356 | Each json-object contain the following: |
| 2357 | |
| 2358 | - "device": device name (json-string) |
| 2359 | - "stats": A json-object with the statistics information, it contains: |
| 2360 | - "rd_bytes": bytes read (json-int) |
| 2361 | - "wr_bytes": bytes written (json-int) |
| 2362 | - "rd_operations": read operations (json-int) |
| 2363 | - "wr_operations": write operations (json-int) |
Christoph Hellwig | e8045d6 | 2011-08-22 00:25:58 +0200 | [diff] [blame] | 2364 | - "flush_operations": cache flush operations (json-int) |
Christoph Hellwig | c488c7f | 2011-08-25 08:26:10 +0200 | [diff] [blame] | 2365 | - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int) |
| 2366 | - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int) |
| 2367 | - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int) |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2368 | - "wr_highest_offset": Highest offset of a sector written since the |
| 2369 | BlockDriverState has been opened (json-int) |
Peter Lieven | f4564d5 | 2015-02-02 14:52:18 +0100 | [diff] [blame] | 2370 | - "rd_merged": number of read requests that have been merged into |
| 2371 | another request (json-int) |
| 2372 | - "wr_merged": number of write requests that have been merged into |
| 2373 | another request (json-int) |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2374 | - "parent": Contains recursively the statistics of the underlying |
| 2375 | protocol (e.g. the host file for a qcow2 image). If there is |
| 2376 | no underlying protocol, this field is omitted |
| 2377 | (json-object, optional) |
| 2378 | |
| 2379 | Example: |
| 2380 | |
| 2381 | -> { "execute": "query-blockstats" } |
| 2382 | <- { |
| 2383 | "return":[ |
| 2384 | { |
| 2385 | "device":"ide0-hd0", |
| 2386 | "parent":{ |
| 2387 | "stats":{ |
| 2388 | "wr_highest_offset":3686448128, |
| 2389 | "wr_bytes":9786368, |
| 2390 | "wr_operations":751, |
| 2391 | "rd_bytes":122567168, |
| 2392 | "rd_operations":36772 |
Christoph Hellwig | c488c7f | 2011-08-25 08:26:10 +0200 | [diff] [blame] | 2393 | "wr_total_times_ns":313253456 |
| 2394 | "rd_total_times_ns":3465673657 |
| 2395 | "flush_total_times_ns":49653 |
Christoph Hellwig | e8045d6 | 2011-08-22 00:25:58 +0200 | [diff] [blame] | 2396 | "flush_operations":61, |
Peter Lieven | f4564d5 | 2015-02-02 14:52:18 +0100 | [diff] [blame] | 2397 | "rd_merged":0, |
| 2398 | "wr_merged":0 |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2399 | } |
| 2400 | }, |
| 2401 | "stats":{ |
| 2402 | "wr_highest_offset":2821110784, |
| 2403 | "wr_bytes":9786368, |
| 2404 | "wr_operations":692, |
| 2405 | "rd_bytes":122739200, |
| 2406 | "rd_operations":36604 |
Christoph Hellwig | e8045d6 | 2011-08-22 00:25:58 +0200 | [diff] [blame] | 2407 | "flush_operations":51, |
Christoph Hellwig | c488c7f | 2011-08-25 08:26:10 +0200 | [diff] [blame] | 2408 | "wr_total_times_ns":313253456 |
| 2409 | "rd_total_times_ns":3465673657 |
Peter Lieven | f4564d5 | 2015-02-02 14:52:18 +0100 | [diff] [blame] | 2410 | "flush_total_times_ns":49653, |
| 2411 | "rd_merged":0, |
| 2412 | "wr_merged":0 |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2413 | } |
| 2414 | }, |
| 2415 | { |
| 2416 | "device":"ide1-cd0", |
| 2417 | "stats":{ |
| 2418 | "wr_highest_offset":0, |
| 2419 | "wr_bytes":0, |
| 2420 | "wr_operations":0, |
| 2421 | "rd_bytes":0, |
| 2422 | "rd_operations":0 |
Christoph Hellwig | e8045d6 | 2011-08-22 00:25:58 +0200 | [diff] [blame] | 2423 | "flush_operations":0, |
Christoph Hellwig | c488c7f | 2011-08-25 08:26:10 +0200 | [diff] [blame] | 2424 | "wr_total_times_ns":0 |
| 2425 | "rd_total_times_ns":0 |
Peter Lieven | f4564d5 | 2015-02-02 14:52:18 +0100 | [diff] [blame] | 2426 | "flush_total_times_ns":0, |
| 2427 | "rd_merged":0, |
| 2428 | "wr_merged":0 |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2429 | } |
| 2430 | }, |
| 2431 | { |
| 2432 | "device":"floppy0", |
| 2433 | "stats":{ |
| 2434 | "wr_highest_offset":0, |
| 2435 | "wr_bytes":0, |
| 2436 | "wr_operations":0, |
| 2437 | "rd_bytes":0, |
| 2438 | "rd_operations":0 |
Christoph Hellwig | e8045d6 | 2011-08-22 00:25:58 +0200 | [diff] [blame] | 2439 | "flush_operations":0, |
Christoph Hellwig | c488c7f | 2011-08-25 08:26:10 +0200 | [diff] [blame] | 2440 | "wr_total_times_ns":0 |
| 2441 | "rd_total_times_ns":0 |
Peter Lieven | f4564d5 | 2015-02-02 14:52:18 +0100 | [diff] [blame] | 2442 | "flush_total_times_ns":0, |
| 2443 | "rd_merged":0, |
| 2444 | "wr_merged":0 |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2445 | } |
| 2446 | }, |
| 2447 | { |
| 2448 | "device":"sd0", |
| 2449 | "stats":{ |
| 2450 | "wr_highest_offset":0, |
| 2451 | "wr_bytes":0, |
| 2452 | "wr_operations":0, |
| 2453 | "rd_bytes":0, |
| 2454 | "rd_operations":0 |
Christoph Hellwig | e8045d6 | 2011-08-22 00:25:58 +0200 | [diff] [blame] | 2455 | "flush_operations":0, |
Christoph Hellwig | c488c7f | 2011-08-25 08:26:10 +0200 | [diff] [blame] | 2456 | "wr_total_times_ns":0 |
| 2457 | "rd_total_times_ns":0 |
Peter Lieven | f4564d5 | 2015-02-02 14:52:18 +0100 | [diff] [blame] | 2458 | "flush_total_times_ns":0, |
| 2459 | "rd_merged":0, |
| 2460 | "wr_merged":0 |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2461 | } |
| 2462 | } |
| 2463 | ] |
| 2464 | } |
| 2465 | |
| 2466 | EQMP |
| 2467 | |
Luiz Capitulino | f11f57e | 2011-09-22 15:56:36 -0300 | [diff] [blame] | 2468 | { |
| 2469 | .name = "query-blockstats", |
Fam Zheng | f71eaa7 | 2014-10-31 11:32:57 +0800 | [diff] [blame] | 2470 | .args_type = "query-nodes:b?", |
Luiz Capitulino | f11f57e | 2011-09-22 15:56:36 -0300 | [diff] [blame] | 2471 | .mhandler.cmd_new = qmp_marshal_input_query_blockstats, |
| 2472 | }, |
| 2473 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2474 | SQMP |
| 2475 | query-cpus |
| 2476 | ---------- |
| 2477 | |
| 2478 | Show CPU information. |
| 2479 | |
| 2480 | Return a json-array. Each CPU is represented by a json-object, which contains: |
| 2481 | |
| 2482 | - "CPU": CPU index (json-int) |
| 2483 | - "current": true if this is the current CPU, false otherwise (json-bool) |
| 2484 | - "halted": true if the cpu is halted, false otherwise (json-bool) |
| 2485 | - Current program counter. The key's name depends on the architecture: |
| 2486 | "pc": i386/x86_64 (json-int) |
| 2487 | "nip": PPC (json-int) |
| 2488 | "pc" and "npc": sparc (json-int) |
| 2489 | "PC": mips (json-int) |
Jan Kiszka | dc7a09c | 2011-03-15 12:26:31 +0100 | [diff] [blame] | 2490 | - "thread_id": ID of the underlying host thread (json-int) |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2491 | |
| 2492 | Example: |
| 2493 | |
| 2494 | -> { "execute": "query-cpus" } |
| 2495 | <- { |
| 2496 | "return":[ |
| 2497 | { |
| 2498 | "CPU":0, |
| 2499 | "current":true, |
| 2500 | "halted":false, |
| 2501 | "pc":3227107138 |
Jan Kiszka | dc7a09c | 2011-03-15 12:26:31 +0100 | [diff] [blame] | 2502 | "thread_id":3134 |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2503 | }, |
| 2504 | { |
| 2505 | "CPU":1, |
| 2506 | "current":false, |
| 2507 | "halted":true, |
| 2508 | "pc":7108165 |
Jan Kiszka | dc7a09c | 2011-03-15 12:26:31 +0100 | [diff] [blame] | 2509 | "thread_id":3135 |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2510 | } |
| 2511 | ] |
| 2512 | } |
| 2513 | |
| 2514 | EQMP |
| 2515 | |
Luiz Capitulino | de0b36b | 2011-09-21 16:38:35 -0300 | [diff] [blame] | 2516 | { |
| 2517 | .name = "query-cpus", |
| 2518 | .args_type = "", |
| 2519 | .mhandler.cmd_new = qmp_marshal_input_query_cpus, |
| 2520 | }, |
| 2521 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2522 | SQMP |
Stefan Hajnoczi | dc3dd0d | 2014-02-27 11:48:42 +0100 | [diff] [blame] | 2523 | query-iothreads |
| 2524 | --------------- |
| 2525 | |
| 2526 | Returns a list of information about each iothread. |
| 2527 | |
| 2528 | Note this list excludes the QEMU main loop thread, which is not declared |
| 2529 | using the -object iothread command-line option. It is always the main thread |
| 2530 | of the process. |
| 2531 | |
| 2532 | Return a json-array. Each iothread is represented by a json-object, which contains: |
| 2533 | |
| 2534 | - "id": name of iothread (json-str) |
| 2535 | - "thread-id": ID of the underlying host thread (json-int) |
| 2536 | |
| 2537 | Example: |
| 2538 | |
| 2539 | -> { "execute": "query-iothreads" } |
| 2540 | <- { |
| 2541 | "return":[ |
| 2542 | { |
| 2543 | "id":"iothread0", |
| 2544 | "thread-id":3134 |
| 2545 | }, |
| 2546 | { |
| 2547 | "id":"iothread1", |
| 2548 | "thread-id":3135 |
| 2549 | } |
| 2550 | ] |
| 2551 | } |
| 2552 | |
| 2553 | EQMP |
| 2554 | |
| 2555 | { |
| 2556 | .name = "query-iothreads", |
| 2557 | .args_type = "", |
| 2558 | .mhandler.cmd_new = qmp_marshal_input_query_iothreads, |
| 2559 | }, |
| 2560 | |
| 2561 | SQMP |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2562 | query-pci |
| 2563 | --------- |
| 2564 | |
| 2565 | PCI buses and devices information. |
| 2566 | |
| 2567 | The returned value is a json-array of all buses. Each bus is represented by |
| 2568 | a json-object, which has a key with a json-array of all PCI devices attached |
| 2569 | to it. Each device is represented by a json-object. |
| 2570 | |
| 2571 | The bus json-object contains the following: |
| 2572 | |
| 2573 | - "bus": bus number (json-int) |
| 2574 | - "devices": a json-array of json-objects, each json-object represents a |
| 2575 | PCI device |
| 2576 | |
| 2577 | The PCI device json-object contains the following: |
| 2578 | |
| 2579 | - "bus": identical to the parent's bus number (json-int) |
| 2580 | - "slot": slot number (json-int) |
| 2581 | - "function": function number (json-int) |
| 2582 | - "class_info": a json-object containing: |
| 2583 | - "desc": device class description (json-string, optional) |
| 2584 | - "class": device class number (json-int) |
| 2585 | - "id": a json-object containing: |
| 2586 | - "device": device ID (json-int) |
| 2587 | - "vendor": vendor ID (json-int) |
| 2588 | - "irq": device's IRQ if assigned (json-int, optional) |
| 2589 | - "qdev_id": qdev id string (json-string) |
| 2590 | - "pci_bridge": It's a json-object, only present if this device is a |
| 2591 | PCI bridge, contains: |
| 2592 | - "bus": bus number (json-int) |
| 2593 | - "secondary": secondary bus number (json-int) |
| 2594 | - "subordinate": subordinate bus number (json-int) |
| 2595 | - "io_range": I/O memory range information, a json-object with the |
| 2596 | following members: |
| 2597 | - "base": base address, in bytes (json-int) |
| 2598 | - "limit": limit address, in bytes (json-int) |
| 2599 | - "memory_range": memory range information, a json-object with the |
| 2600 | following members: |
| 2601 | - "base": base address, in bytes (json-int) |
| 2602 | - "limit": limit address, in bytes (json-int) |
| 2603 | - "prefetchable_range": Prefetchable memory range information, a |
| 2604 | json-object with the following members: |
| 2605 | - "base": base address, in bytes (json-int) |
| 2606 | - "limit": limit address, in bytes (json-int) |
| 2607 | - "devices": a json-array of PCI devices if there's any attached, each |
| 2608 | each element is represented by a json-object, which contains |
| 2609 | the same members of the 'PCI device json-object' described |
| 2610 | above (optional) |
| 2611 | - "regions": a json-array of json-objects, each json-object represents a |
| 2612 | memory region of this device |
| 2613 | |
| 2614 | The memory range json-object contains the following: |
| 2615 | |
| 2616 | - "base": base memory address (json-int) |
| 2617 | - "limit": limit value (json-int) |
| 2618 | |
| 2619 | The region json-object can be an I/O region or a memory region, an I/O region |
| 2620 | json-object contains the following: |
| 2621 | |
| 2622 | - "type": "io" (json-string, fixed) |
| 2623 | - "bar": BAR number (json-int) |
| 2624 | - "address": memory address (json-int) |
| 2625 | - "size": memory size (json-int) |
| 2626 | |
| 2627 | A memory region json-object contains the following: |
| 2628 | |
| 2629 | - "type": "memory" (json-string, fixed) |
| 2630 | - "bar": BAR number (json-int) |
| 2631 | - "address": memory address (json-int) |
| 2632 | - "size": memory size (json-int) |
| 2633 | - "mem_type_64": true or false (json-bool) |
| 2634 | - "prefetch": true or false (json-bool) |
| 2635 | |
| 2636 | Example: |
| 2637 | |
| 2638 | -> { "execute": "query-pci" } |
| 2639 | <- { |
| 2640 | "return":[ |
| 2641 | { |
| 2642 | "bus":0, |
| 2643 | "devices":[ |
| 2644 | { |
| 2645 | "bus":0, |
| 2646 | "qdev_id":"", |
| 2647 | "slot":0, |
| 2648 | "class_info":{ |
| 2649 | "class":1536, |
| 2650 | "desc":"Host bridge" |
| 2651 | }, |
| 2652 | "id":{ |
| 2653 | "device":32902, |
| 2654 | "vendor":4663 |
| 2655 | }, |
| 2656 | "function":0, |
| 2657 | "regions":[ |
| 2658 | |
| 2659 | ] |
| 2660 | }, |
| 2661 | { |
| 2662 | "bus":0, |
| 2663 | "qdev_id":"", |
| 2664 | "slot":1, |
| 2665 | "class_info":{ |
| 2666 | "class":1537, |
| 2667 | "desc":"ISA bridge" |
| 2668 | }, |
| 2669 | "id":{ |
| 2670 | "device":32902, |
| 2671 | "vendor":28672 |
| 2672 | }, |
| 2673 | "function":0, |
| 2674 | "regions":[ |
| 2675 | |
| 2676 | ] |
| 2677 | }, |
| 2678 | { |
| 2679 | "bus":0, |
| 2680 | "qdev_id":"", |
| 2681 | "slot":1, |
| 2682 | "class_info":{ |
| 2683 | "class":257, |
| 2684 | "desc":"IDE controller" |
| 2685 | }, |
| 2686 | "id":{ |
| 2687 | "device":32902, |
| 2688 | "vendor":28688 |
| 2689 | }, |
| 2690 | "function":1, |
| 2691 | "regions":[ |
| 2692 | { |
| 2693 | "bar":4, |
| 2694 | "size":16, |
| 2695 | "address":49152, |
| 2696 | "type":"io" |
| 2697 | } |
| 2698 | ] |
| 2699 | }, |
| 2700 | { |
| 2701 | "bus":0, |
| 2702 | "qdev_id":"", |
| 2703 | "slot":2, |
| 2704 | "class_info":{ |
| 2705 | "class":768, |
| 2706 | "desc":"VGA controller" |
| 2707 | }, |
| 2708 | "id":{ |
| 2709 | "device":4115, |
| 2710 | "vendor":184 |
| 2711 | }, |
| 2712 | "function":0, |
| 2713 | "regions":[ |
| 2714 | { |
| 2715 | "prefetch":true, |
| 2716 | "mem_type_64":false, |
| 2717 | "bar":0, |
| 2718 | "size":33554432, |
| 2719 | "address":4026531840, |
| 2720 | "type":"memory" |
| 2721 | }, |
| 2722 | { |
| 2723 | "prefetch":false, |
| 2724 | "mem_type_64":false, |
| 2725 | "bar":1, |
| 2726 | "size":4096, |
| 2727 | "address":4060086272, |
| 2728 | "type":"memory" |
| 2729 | }, |
| 2730 | { |
| 2731 | "prefetch":false, |
| 2732 | "mem_type_64":false, |
| 2733 | "bar":6, |
| 2734 | "size":65536, |
| 2735 | "address":-1, |
| 2736 | "type":"memory" |
| 2737 | } |
| 2738 | ] |
| 2739 | }, |
| 2740 | { |
| 2741 | "bus":0, |
| 2742 | "qdev_id":"", |
| 2743 | "irq":11, |
| 2744 | "slot":4, |
| 2745 | "class_info":{ |
| 2746 | "class":1280, |
| 2747 | "desc":"RAM controller" |
| 2748 | }, |
| 2749 | "id":{ |
| 2750 | "device":6900, |
| 2751 | "vendor":4098 |
| 2752 | }, |
| 2753 | "function":0, |
| 2754 | "regions":[ |
| 2755 | { |
| 2756 | "bar":0, |
| 2757 | "size":32, |
| 2758 | "address":49280, |
| 2759 | "type":"io" |
| 2760 | } |
| 2761 | ] |
| 2762 | } |
| 2763 | ] |
| 2764 | } |
| 2765 | ] |
| 2766 | } |
| 2767 | |
| 2768 | Note: This example has been shortened as the real response is too long. |
| 2769 | |
| 2770 | EQMP |
| 2771 | |
Luiz Capitulino | 7962747 | 2011-10-21 14:15:33 -0200 | [diff] [blame] | 2772 | { |
| 2773 | .name = "query-pci", |
| 2774 | .args_type = "", |
| 2775 | .mhandler.cmd_new = qmp_marshal_input_query_pci, |
| 2776 | }, |
| 2777 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2778 | SQMP |
| 2779 | query-kvm |
| 2780 | --------- |
| 2781 | |
| 2782 | Show KVM information. |
| 2783 | |
| 2784 | Return a json-object with the following information: |
| 2785 | |
| 2786 | - "enabled": true if KVM support is enabled, false otherwise (json-bool) |
| 2787 | - "present": true if QEMU has KVM support, false otherwise (json-bool) |
| 2788 | |
| 2789 | Example: |
| 2790 | |
| 2791 | -> { "execute": "query-kvm" } |
| 2792 | <- { "return": { "enabled": true, "present": true } } |
| 2793 | |
| 2794 | EQMP |
| 2795 | |
Luiz Capitulino | 292a260 | 2011-09-12 15:10:53 -0300 | [diff] [blame] | 2796 | { |
| 2797 | .name = "query-kvm", |
| 2798 | .args_type = "", |
| 2799 | .mhandler.cmd_new = qmp_marshal_input_query_kvm, |
| 2800 | }, |
| 2801 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2802 | SQMP |
| 2803 | query-status |
| 2804 | ------------ |
| 2805 | |
| 2806 | Return a json-object with the following information: |
| 2807 | |
| 2808 | - "running": true if the VM is running, or false if it is paused (json-bool) |
| 2809 | - "singlestep": true if the VM is in single step mode, |
| 2810 | false otherwise (json-bool) |
Luiz Capitulino | 9e37b9d | 2011-08-29 16:02:57 -0300 | [diff] [blame] | 2811 | - "status": one of the following values (json-string) |
| 2812 | "debug" - QEMU is running on a debugger |
| 2813 | "inmigrate" - guest is paused waiting for an incoming migration |
| 2814 | "internal-error" - An internal error that prevents further guest |
| 2815 | execution has occurred |
| 2816 | "io-error" - the last IOP has failed and the device is configured |
| 2817 | to pause on I/O errors |
| 2818 | "paused" - guest has been paused via the 'stop' command |
| 2819 | "postmigrate" - guest is paused following a successful 'migrate' |
| 2820 | "prelaunch" - QEMU was started with -S and guest has not started |
| 2821 | "finish-migrate" - guest is paused to finish the migration process |
| 2822 | "restore-vm" - guest is paused to restore VM state |
| 2823 | "running" - guest is actively running |
| 2824 | "save-vm" - guest is paused to save the VM state |
| 2825 | "shutdown" - guest is shut down (and -no-shutdown is in use) |
| 2826 | "watchdog" - the watchdog action is configured to pause and |
| 2827 | has been triggered |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2828 | |
| 2829 | Example: |
| 2830 | |
| 2831 | -> { "execute": "query-status" } |
Luiz Capitulino | 9e37b9d | 2011-08-29 16:02:57 -0300 | [diff] [blame] | 2832 | <- { "return": { "running": true, "singlestep": false, "status": "running" } } |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2833 | |
| 2834 | EQMP |
Luiz Capitulino | 1fa9a5e | 2011-09-12 17:54:20 -0300 | [diff] [blame] | 2835 | |
| 2836 | { |
| 2837 | .name = "query-status", |
| 2838 | .args_type = "", |
| 2839 | .mhandler.cmd_new = qmp_marshal_input_query_status, |
| 2840 | }, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2841 | |
| 2842 | SQMP |
| 2843 | query-mice |
| 2844 | ---------- |
| 2845 | |
| 2846 | Show VM mice information. |
| 2847 | |
| 2848 | Each mouse is represented by a json-object, the returned value is a json-array |
| 2849 | of all mice. |
| 2850 | |
| 2851 | The mouse json-object contains the following: |
| 2852 | |
| 2853 | - "name": mouse's name (json-string) |
| 2854 | - "index": mouse's index (json-int) |
| 2855 | - "current": true if this mouse is receiving events, false otherwise (json-bool) |
| 2856 | - "absolute": true if the mouse generates absolute input events (json-bool) |
| 2857 | |
| 2858 | Example: |
| 2859 | |
| 2860 | -> { "execute": "query-mice" } |
| 2861 | <- { |
| 2862 | "return":[ |
| 2863 | { |
| 2864 | "name":"QEMU Microsoft Mouse", |
| 2865 | "index":0, |
| 2866 | "current":false, |
| 2867 | "absolute":false |
| 2868 | }, |
| 2869 | { |
| 2870 | "name":"QEMU PS/2 Mouse", |
| 2871 | "index":1, |
| 2872 | "current":true, |
| 2873 | "absolute":true |
| 2874 | } |
| 2875 | ] |
| 2876 | } |
| 2877 | |
| 2878 | EQMP |
| 2879 | |
Luiz Capitulino | e235cec | 2011-09-21 15:29:55 -0300 | [diff] [blame] | 2880 | { |
| 2881 | .name = "query-mice", |
| 2882 | .args_type = "", |
| 2883 | .mhandler.cmd_new = qmp_marshal_input_query_mice, |
| 2884 | }, |
| 2885 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2886 | SQMP |
| 2887 | query-vnc |
| 2888 | --------- |
| 2889 | |
| 2890 | Show VNC server information. |
| 2891 | |
| 2892 | Return a json-object with server information. Connected clients are returned |
| 2893 | as a json-array of json-objects. |
| 2894 | |
| 2895 | The main json-object contains the following: |
| 2896 | |
| 2897 | - "enabled": true or false (json-bool) |
| 2898 | - "host": server's IP address (json-string) |
| 2899 | - "family": address family (json-string) |
| 2900 | - Possible values: "ipv4", "ipv6", "unix", "unknown" |
| 2901 | - "service": server's port number (json-string) |
| 2902 | - "auth": authentication method (json-string) |
| 2903 | - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight", |
| 2904 | "tls", "ultra", "unknown", "vencrypt", "vencrypt", |
| 2905 | "vencrypt+plain", "vencrypt+tls+none", |
| 2906 | "vencrypt+tls+plain", "vencrypt+tls+sasl", |
| 2907 | "vencrypt+tls+vnc", "vencrypt+x509+none", |
| 2908 | "vencrypt+x509+plain", "vencrypt+x509+sasl", |
| 2909 | "vencrypt+x509+vnc", "vnc" |
| 2910 | - "clients": a json-array of all connected clients |
| 2911 | |
| 2912 | Clients are described by a json-object, each one contain the following: |
| 2913 | |
| 2914 | - "host": client's IP address (json-string) |
| 2915 | - "family": address family (json-string) |
| 2916 | - Possible values: "ipv4", "ipv6", "unix", "unknown" |
| 2917 | - "service": client's port number (json-string) |
| 2918 | - "x509_dname": TLS dname (json-string, optional) |
| 2919 | - "sasl_username": SASL username (json-string, optional) |
| 2920 | |
| 2921 | Example: |
| 2922 | |
| 2923 | -> { "execute": "query-vnc" } |
| 2924 | <- { |
| 2925 | "return":{ |
| 2926 | "enabled":true, |
| 2927 | "host":"0.0.0.0", |
| 2928 | "service":"50402", |
| 2929 | "auth":"vnc", |
| 2930 | "family":"ipv4", |
| 2931 | "clients":[ |
| 2932 | { |
| 2933 | "host":"127.0.0.1", |
| 2934 | "service":"50401", |
| 2935 | "family":"ipv4" |
| 2936 | } |
| 2937 | ] |
| 2938 | } |
| 2939 | } |
| 2940 | |
| 2941 | EQMP |
| 2942 | |
Luiz Capitulino | 2b54aa8 | 2011-10-17 16:41:22 -0200 | [diff] [blame] | 2943 | { |
| 2944 | .name = "query-vnc", |
| 2945 | .args_type = "", |
| 2946 | .mhandler.cmd_new = qmp_marshal_input_query_vnc, |
| 2947 | }, |
Gerd Hoffmann | df88768 | 2014-12-17 15:49:44 +0100 | [diff] [blame] | 2948 | { |
| 2949 | .name = "query-vnc-servers", |
| 2950 | .args_type = "", |
| 2951 | .mhandler.cmd_new = qmp_marshal_input_query_vnc_servers, |
| 2952 | }, |
Luiz Capitulino | 2b54aa8 | 2011-10-17 16:41:22 -0200 | [diff] [blame] | 2953 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 2954 | SQMP |
Gerd Hoffmann | cb42a87 | 2010-11-30 11:02:51 +0100 | [diff] [blame] | 2955 | query-spice |
| 2956 | ----------- |
| 2957 | |
| 2958 | Show SPICE server information. |
| 2959 | |
| 2960 | Return a json-object with server information. Connected clients are returned |
| 2961 | as a json-array of json-objects. |
| 2962 | |
| 2963 | The main json-object contains the following: |
| 2964 | |
| 2965 | - "enabled": true or false (json-bool) |
| 2966 | - "host": server's IP address (json-string) |
| 2967 | - "port": server's port number (json-int, optional) |
| 2968 | - "tls-port": server's port number (json-int, optional) |
| 2969 | - "auth": authentication method (json-string) |
| 2970 | - Possible values: "none", "spice" |
| 2971 | - "channels": a json-array of all active channels clients |
| 2972 | |
| 2973 | Channels are described by a json-object, each one contain the following: |
| 2974 | |
| 2975 | - "host": client's IP address (json-string) |
| 2976 | - "family": address family (json-string) |
| 2977 | - Possible values: "ipv4", "ipv6", "unix", "unknown" |
| 2978 | - "port": client's port number (json-string) |
| 2979 | - "connection-id": spice connection id. All channels with the same id |
| 2980 | belong to the same spice session (json-int) |
| 2981 | - "channel-type": channel type. "1" is the main control channel, filter for |
| 2982 | this one if you want track spice sessions only (json-int) |
| 2983 | - "channel-id": channel id. Usually "0", might be different needed when |
| 2984 | multiple channels of the same type exist, such as multiple |
| 2985 | display channels in a multihead setup (json-int) |
Alberto Garcia | 3599d46 | 2015-02-26 16:35:07 +0200 | [diff] [blame] | 2986 | - "tls": whether the channel is encrypted (json-bool) |
Gerd Hoffmann | cb42a87 | 2010-11-30 11:02:51 +0100 | [diff] [blame] | 2987 | |
| 2988 | Example: |
| 2989 | |
| 2990 | -> { "execute": "query-spice" } |
| 2991 | <- { |
| 2992 | "return": { |
| 2993 | "enabled": true, |
| 2994 | "auth": "spice", |
| 2995 | "port": 5920, |
| 2996 | "tls-port": 5921, |
| 2997 | "host": "0.0.0.0", |
| 2998 | "channels": [ |
| 2999 | { |
| 3000 | "port": "54924", |
| 3001 | "family": "ipv4", |
| 3002 | "channel-type": 1, |
| 3003 | "connection-id": 1804289383, |
| 3004 | "host": "127.0.0.1", |
| 3005 | "channel-id": 0, |
| 3006 | "tls": true |
| 3007 | }, |
| 3008 | { |
| 3009 | "port": "36710", |
| 3010 | "family": "ipv4", |
| 3011 | "channel-type": 4, |
| 3012 | "connection-id": 1804289383, |
| 3013 | "host": "127.0.0.1", |
| 3014 | "channel-id": 0, |
| 3015 | "tls": false |
| 3016 | }, |
| 3017 | [ ... more channels follow ... ] |
| 3018 | ] |
| 3019 | } |
| 3020 | } |
| 3021 | |
| 3022 | EQMP |
| 3023 | |
Luiz Capitulino | d1f2964 | 2011-10-20 17:01:33 -0200 | [diff] [blame] | 3024 | #if defined(CONFIG_SPICE) |
| 3025 | { |
| 3026 | .name = "query-spice", |
| 3027 | .args_type = "", |
| 3028 | .mhandler.cmd_new = qmp_marshal_input_query_spice, |
| 3029 | }, |
| 3030 | #endif |
| 3031 | |
Gerd Hoffmann | cb42a87 | 2010-11-30 11:02:51 +0100 | [diff] [blame] | 3032 | SQMP |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3033 | query-name |
| 3034 | ---------- |
| 3035 | |
| 3036 | Show VM name. |
| 3037 | |
| 3038 | Return a json-object with the following information: |
| 3039 | |
| 3040 | - "name": VM's name (json-string, optional) |
| 3041 | |
| 3042 | Example: |
| 3043 | |
| 3044 | -> { "execute": "query-name" } |
| 3045 | <- { "return": { "name": "qemu-name" } } |
| 3046 | |
| 3047 | EQMP |
| 3048 | |
Anthony Liguori | 48a32be | 2011-09-02 12:34:48 -0500 | [diff] [blame] | 3049 | { |
| 3050 | .name = "query-name", |
| 3051 | .args_type = "", |
| 3052 | .mhandler.cmd_new = qmp_marshal_input_query_name, |
| 3053 | }, |
| 3054 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3055 | SQMP |
| 3056 | query-uuid |
| 3057 | ---------- |
| 3058 | |
| 3059 | Show VM UUID. |
| 3060 | |
| 3061 | Return a json-object with the following information: |
| 3062 | |
| 3063 | - "UUID": Universally Unique Identifier (json-string) |
| 3064 | |
| 3065 | Example: |
| 3066 | |
| 3067 | -> { "execute": "query-uuid" } |
| 3068 | <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } } |
| 3069 | |
| 3070 | EQMP |
| 3071 | |
Luiz Capitulino | efab767 | 2011-09-13 17:16:25 -0300 | [diff] [blame] | 3072 | { |
| 3073 | .name = "query-uuid", |
| 3074 | .args_type = "", |
| 3075 | .mhandler.cmd_new = qmp_marshal_input_query_uuid, |
| 3076 | }, |
| 3077 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3078 | SQMP |
Amos Kong | 1f8f987 | 2013-04-25 17:50:35 +0800 | [diff] [blame] | 3079 | query-command-line-options |
| 3080 | -------------------------- |
| 3081 | |
| 3082 | Show command line option schema. |
| 3083 | |
| 3084 | Return a json-array of command line option schema for all options (or for |
| 3085 | the given option), returning an error if the given option doesn't exist. |
| 3086 | |
| 3087 | Each array entry contains the following: |
| 3088 | |
| 3089 | - "option": option name (json-string) |
| 3090 | - "parameters": a json-array describes all parameters of the option: |
| 3091 | - "name": parameter name (json-string) |
| 3092 | - "type": parameter type (one of 'string', 'boolean', 'number', |
| 3093 | or 'size') |
| 3094 | - "help": human readable description of the parameter |
| 3095 | (json-string, optional) |
Chunyan Liu | e36af94 | 2014-06-05 17:20:43 +0800 | [diff] [blame] | 3096 | - "default": default value string for the parameter |
| 3097 | (json-string, optional) |
Amos Kong | 1f8f987 | 2013-04-25 17:50:35 +0800 | [diff] [blame] | 3098 | |
| 3099 | Example: |
| 3100 | |
| 3101 | -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } } |
| 3102 | <- { "return": [ |
| 3103 | { |
| 3104 | "parameters": [ |
| 3105 | { |
| 3106 | "name": "romfile", |
| 3107 | "type": "string" |
| 3108 | }, |
| 3109 | { |
| 3110 | "name": "bootindex", |
| 3111 | "type": "number" |
| 3112 | } |
| 3113 | ], |
| 3114 | "option": "option-rom" |
| 3115 | } |
| 3116 | ] |
| 3117 | } |
| 3118 | |
| 3119 | EQMP |
| 3120 | |
| 3121 | { |
| 3122 | .name = "query-command-line-options", |
| 3123 | .args_type = "option:s?", |
| 3124 | .mhandler.cmd_new = qmp_marshal_input_query_command_line_options, |
| 3125 | }, |
| 3126 | |
| 3127 | SQMP |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3128 | query-migrate |
| 3129 | ------------- |
| 3130 | |
| 3131 | Migration status. |
| 3132 | |
| 3133 | Return a json-object. If migration is active there will be another json-object |
| 3134 | with RAM migration status and if block migration is active another one with |
| 3135 | block migration status. |
| 3136 | |
| 3137 | The main json-object contains the following: |
| 3138 | |
| 3139 | - "status": migration status (json-string) |
Peter Feiner | 3b69595 | 2014-05-16 10:40:47 -0400 | [diff] [blame] | 3140 | - Possible values: "setup", "active", "completed", "failed", "cancelled" |
Juan Quintela | 7aa939a | 2012-08-18 13:17:10 +0200 | [diff] [blame] | 3141 | - "total-time": total amount of ms since migration started. If |
| 3142 | migration has ended, it returns the total migration |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 3143 | time (json-int) |
Michael R. Hines | 8f3067b | 2013-08-09 16:05:45 -0400 | [diff] [blame] | 3144 | - "setup-time" amount of setup time in milliseconds _before_ the |
| 3145 | iterations begin but _after_ the QMP command is issued. |
| 3146 | This is designed to provide an accounting of any activities |
| 3147 | (such as RDMA pinning) which may be expensive, but do not |
| 3148 | actually occur during the iterative migration rounds |
| 3149 | themselves. (json-int) |
Juan Quintela | 9c5a9fc | 2012-08-13 09:35:16 +0200 | [diff] [blame] | 3150 | - "downtime": only present when migration has finished correctly |
| 3151 | total amount in ms for downtime that happened (json-int) |
Juan Quintela | 2c52ddf | 2012-08-13 09:53:12 +0200 | [diff] [blame] | 3152 | - "expected-downtime": only present while migration is active |
| 3153 | total amount in ms for downtime that was calculated on |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 3154 | the last bitmap round (json-int) |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3155 | - "ram": only present if "status" is "active", it is a json-object with the |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 3156 | following RAM information: |
| 3157 | - "transferred": amount transferred in bytes (json-int) |
| 3158 | - "remaining": amount remaining to transfer in bytes (json-int) |
| 3159 | - "total": total amount of memory in bytes (json-int) |
| 3160 | - "duplicate": number of pages filled entirely with the same |
| 3161 | byte (json-int) |
| 3162 | These are sent over the wire much more efficiently. |
Peter Lieven | f1c7279 | 2013-03-26 10:58:37 +0100 | [diff] [blame] | 3163 | - "skipped": number of skipped zero pages (json-int) |
Stefan Weil | 805a250 | 2013-04-28 11:49:57 +0200 | [diff] [blame] | 3164 | - "normal" : number of whole pages transferred. I.e. they |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 3165 | were not sent as duplicate or xbzrle pages (json-int) |
| 3166 | - "normal-bytes" : number of bytes transferred in whole |
| 3167 | pages. This is just normal pages times size of one page, |
| 3168 | but this way upper levels don't need to care about page |
| 3169 | size (json-int) |
ChenLiang | 58570ed | 2014-04-04 17:57:55 +0800 | [diff] [blame] | 3170 | - "dirty-sync-count": times that dirty ram was synchronized (json-int) |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3171 | - "disk": only present if "status" is "active" and it is a block migration, |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 3172 | it is a json-object with the following disk information: |
| 3173 | - "transferred": amount transferred in bytes (json-int) |
| 3174 | - "remaining": amount remaining to transfer in bytes json-int) |
| 3175 | - "total": total disk size in bytes (json-int) |
Orit Wasserman | f36d55a | 2012-08-06 21:42:57 +0300 | [diff] [blame] | 3176 | - "xbzrle-cache": only present if XBZRLE is active. |
| 3177 | It is a json-object with the following XBZRLE information: |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 3178 | - "cache-size": XBZRLE cache size in bytes |
| 3179 | - "bytes": number of bytes transferred for XBZRLE compressed pages |
Orit Wasserman | f36d55a | 2012-08-06 21:42:57 +0300 | [diff] [blame] | 3180 | - "pages": number of XBZRLE compressed pages |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 3181 | - "cache-miss": number of XBRZRLE page cache misses |
ChenLiang | 8bc3923 | 2014-04-04 17:57:56 +0800 | [diff] [blame] | 3182 | - "cache-miss-rate": rate of XBRZRLE page cache misses |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 3183 | - "overflow": number of times XBZRLE overflows. This means |
| 3184 | that the XBZRLE encoding was bigger than just sent the |
| 3185 | whole page, and then we sent the whole page instead (as as |
| 3186 | normal page). |
| 3187 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3188 | Examples: |
| 3189 | |
| 3190 | 1. Before the first migration |
| 3191 | |
| 3192 | -> { "execute": "query-migrate" } |
| 3193 | <- { "return": {} } |
| 3194 | |
| 3195 | 2. Migration is done and has succeeded |
| 3196 | |
| 3197 | -> { "execute": "query-migrate" } |
Orit Wasserman | 004d4c1 | 2012-08-06 21:42:56 +0300 | [diff] [blame] | 3198 | <- { "return": { |
| 3199 | "status": "completed", |
| 3200 | "ram":{ |
| 3201 | "transferred":123, |
| 3202 | "remaining":123, |
| 3203 | "total":246, |
| 3204 | "total-time":12345, |
Michael R. Hines | 8f3067b | 2013-08-09 16:05:45 -0400 | [diff] [blame] | 3205 | "setup-time":12345, |
Juan Quintela | 9c5a9fc | 2012-08-13 09:35:16 +0200 | [diff] [blame] | 3206 | "downtime":12345, |
Orit Wasserman | 004d4c1 | 2012-08-06 21:42:56 +0300 | [diff] [blame] | 3207 | "duplicate":123, |
| 3208 | "normal":123, |
ChenLiang | 58570ed | 2014-04-04 17:57:55 +0800 | [diff] [blame] | 3209 | "normal-bytes":123456, |
| 3210 | "dirty-sync-count":15 |
Orit Wasserman | 004d4c1 | 2012-08-06 21:42:56 +0300 | [diff] [blame] | 3211 | } |
| 3212 | } |
| 3213 | } |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3214 | |
| 3215 | 3. Migration is done and has failed |
| 3216 | |
| 3217 | -> { "execute": "query-migrate" } |
| 3218 | <- { "return": { "status": "failed" } } |
| 3219 | |
| 3220 | 4. Migration is being performed and is not a block migration: |
| 3221 | |
| 3222 | -> { "execute": "query-migrate" } |
| 3223 | <- { |
| 3224 | "return":{ |
| 3225 | "status":"active", |
| 3226 | "ram":{ |
| 3227 | "transferred":123, |
| 3228 | "remaining":123, |
Orit Wasserman | 62d4e3f | 2012-08-06 21:42:55 +0300 | [diff] [blame] | 3229 | "total":246, |
Orit Wasserman | 004d4c1 | 2012-08-06 21:42:56 +0300 | [diff] [blame] | 3230 | "total-time":12345, |
Michael R. Hines | 8f3067b | 2013-08-09 16:05:45 -0400 | [diff] [blame] | 3231 | "setup-time":12345, |
Juan Quintela | 2c52ddf | 2012-08-13 09:53:12 +0200 | [diff] [blame] | 3232 | "expected-downtime":12345, |
Orit Wasserman | 004d4c1 | 2012-08-06 21:42:56 +0300 | [diff] [blame] | 3233 | "duplicate":123, |
| 3234 | "normal":123, |
ChenLiang | 58570ed | 2014-04-04 17:57:55 +0800 | [diff] [blame] | 3235 | "normal-bytes":123456, |
| 3236 | "dirty-sync-count":15 |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3237 | } |
| 3238 | } |
| 3239 | } |
| 3240 | |
| 3241 | 5. Migration is being performed and is a block migration: |
| 3242 | |
| 3243 | -> { "execute": "query-migrate" } |
| 3244 | <- { |
| 3245 | "return":{ |
| 3246 | "status":"active", |
| 3247 | "ram":{ |
| 3248 | "total":1057024, |
| 3249 | "remaining":1053304, |
Orit Wasserman | 62d4e3f | 2012-08-06 21:42:55 +0300 | [diff] [blame] | 3250 | "transferred":3720, |
Orit Wasserman | 004d4c1 | 2012-08-06 21:42:56 +0300 | [diff] [blame] | 3251 | "total-time":12345, |
Michael R. Hines | 8f3067b | 2013-08-09 16:05:45 -0400 | [diff] [blame] | 3252 | "setup-time":12345, |
Juan Quintela | 2c52ddf | 2012-08-13 09:53:12 +0200 | [diff] [blame] | 3253 | "expected-downtime":12345, |
Orit Wasserman | 004d4c1 | 2012-08-06 21:42:56 +0300 | [diff] [blame] | 3254 | "duplicate":123, |
| 3255 | "normal":123, |
ChenLiang | 58570ed | 2014-04-04 17:57:55 +0800 | [diff] [blame] | 3256 | "normal-bytes":123456, |
| 3257 | "dirty-sync-count":15 |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3258 | }, |
| 3259 | "disk":{ |
| 3260 | "total":20971520, |
| 3261 | "remaining":20880384, |
| 3262 | "transferred":91136 |
| 3263 | } |
| 3264 | } |
| 3265 | } |
| 3266 | |
Orit Wasserman | f36d55a | 2012-08-06 21:42:57 +0300 | [diff] [blame] | 3267 | 6. Migration is being performed and XBZRLE is active: |
| 3268 | |
| 3269 | -> { "execute": "query-migrate" } |
| 3270 | <- { |
| 3271 | "return":{ |
| 3272 | "status":"active", |
| 3273 | "capabilities" : [ { "capability": "xbzrle", "state" : true } ], |
| 3274 | "ram":{ |
| 3275 | "total":1057024, |
| 3276 | "remaining":1053304, |
| 3277 | "transferred":3720, |
| 3278 | "total-time":12345, |
Michael R. Hines | 8f3067b | 2013-08-09 16:05:45 -0400 | [diff] [blame] | 3279 | "setup-time":12345, |
Juan Quintela | 2c52ddf | 2012-08-13 09:53:12 +0200 | [diff] [blame] | 3280 | "expected-downtime":12345, |
Orit Wasserman | f36d55a | 2012-08-06 21:42:57 +0300 | [diff] [blame] | 3281 | "duplicate":10, |
| 3282 | "normal":3333, |
ChenLiang | 58570ed | 2014-04-04 17:57:55 +0800 | [diff] [blame] | 3283 | "normal-bytes":3412992, |
| 3284 | "dirty-sync-count":15 |
Orit Wasserman | f36d55a | 2012-08-06 21:42:57 +0300 | [diff] [blame] | 3285 | }, |
| 3286 | "xbzrle-cache":{ |
| 3287 | "cache-size":67108864, |
| 3288 | "bytes":20971520, |
| 3289 | "pages":2444343, |
| 3290 | "cache-miss":2244, |
ChenLiang | 8bc3923 | 2014-04-04 17:57:56 +0800 | [diff] [blame] | 3291 | "cache-miss-rate":0.123, |
Orit Wasserman | f36d55a | 2012-08-06 21:42:57 +0300 | [diff] [blame] | 3292 | "overflow":34434 |
| 3293 | } |
| 3294 | } |
| 3295 | } |
| 3296 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3297 | EQMP |
| 3298 | |
Luiz Capitulino | 791e7c8 | 2011-09-13 17:37:16 -0300 | [diff] [blame] | 3299 | { |
| 3300 | .name = "query-migrate", |
| 3301 | .args_type = "", |
| 3302 | .mhandler.cmd_new = qmp_marshal_input_query_migrate, |
| 3303 | }, |
| 3304 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3305 | SQMP |
Orit Wasserman | 0045843 | 2012-08-06 21:42:48 +0300 | [diff] [blame] | 3306 | migrate-set-capabilities |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 3307 | ------------------------ |
Orit Wasserman | 0045843 | 2012-08-06 21:42:48 +0300 | [diff] [blame] | 3308 | |
| 3309 | Enable/Disable migration capabilities |
| 3310 | |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 3311 | - "xbzrle": XBZRLE support |
zhanghailiang | d6d6973 | 2014-12-09 14:38:37 +0800 | [diff] [blame] | 3312 | - "rdma-pin-all": pin all pages when using RDMA during migration |
| 3313 | - "auto-converge": throttle down guest to help convergence of migration |
| 3314 | - "zero-blocks": compress zero blocks during block migration |
Orit Wasserman | 0045843 | 2012-08-06 21:42:48 +0300 | [diff] [blame] | 3315 | |
| 3316 | Arguments: |
| 3317 | |
| 3318 | Example: |
| 3319 | |
| 3320 | -> { "execute": "migrate-set-capabilities" , "arguments": |
| 3321 | { "capabilities": [ { "capability": "xbzrle", "state": true } ] } } |
| 3322 | |
| 3323 | EQMP |
| 3324 | |
| 3325 | { |
| 3326 | .name = "migrate-set-capabilities", |
Paolo Bonzini | 43d0a2c | 2015-04-15 13:30:04 +0200 | [diff] [blame] | 3327 | .args_type = "capabilities:q", |
Orit Wasserman | 0045843 | 2012-08-06 21:42:48 +0300 | [diff] [blame] | 3328 | .params = "capability:s,state:b", |
| 3329 | .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities, |
| 3330 | }, |
| 3331 | SQMP |
Orit Wasserman | bbf6da3 | 2012-08-06 21:42:47 +0300 | [diff] [blame] | 3332 | query-migrate-capabilities |
Juan Quintela | 817c604 | 2013-02-11 15:11:10 +0100 | [diff] [blame] | 3333 | -------------------------- |
Orit Wasserman | bbf6da3 | 2012-08-06 21:42:47 +0300 | [diff] [blame] | 3334 | |
| 3335 | Query current migration capabilities |
| 3336 | |
| 3337 | - "capabilities": migration capabilities state |
| 3338 | - "xbzrle" : XBZRLE state (json-bool) |
zhanghailiang | d6d6973 | 2014-12-09 14:38:37 +0800 | [diff] [blame] | 3339 | - "rdma-pin-all" : RDMA Pin Page state (json-bool) |
| 3340 | - "auto-converge" : Auto Converge state (json-bool) |
| 3341 | - "zero-blocks" : Zero Blocks state (json-bool) |
Orit Wasserman | bbf6da3 | 2012-08-06 21:42:47 +0300 | [diff] [blame] | 3342 | |
| 3343 | Arguments: |
| 3344 | |
| 3345 | Example: |
| 3346 | |
| 3347 | -> { "execute": "query-migrate-capabilities" } |
Orit Wasserman | dbca1b3 | 2013-01-31 09:12:17 +0200 | [diff] [blame] | 3348 | <- { "return": [ { "state": false, "capability": "xbzrle" } ] } |
| 3349 | |
Orit Wasserman | bbf6da3 | 2012-08-06 21:42:47 +0300 | [diff] [blame] | 3350 | EQMP |
| 3351 | |
| 3352 | { |
| 3353 | .name = "query-migrate-capabilities", |
| 3354 | .args_type = "", |
| 3355 | .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities, |
| 3356 | }, |
| 3357 | |
| 3358 | SQMP |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3359 | query-balloon |
| 3360 | ------------- |
| 3361 | |
| 3362 | Show balloon information. |
| 3363 | |
| 3364 | Make an asynchronous request for balloon info. When the request completes a |
| 3365 | json-object will be returned containing the following data: |
| 3366 | |
| 3367 | - "actual": current balloon value in bytes (json-int) |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3368 | |
| 3369 | Example: |
| 3370 | |
| 3371 | -> { "execute": "query-balloon" } |
| 3372 | <- { |
| 3373 | "return":{ |
| 3374 | "actual":1073741824, |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 3375 | } |
| 3376 | } |
| 3377 | |
| 3378 | EQMP |
| 3379 | |
Luiz Capitulino | 96637bc | 2011-10-21 11:41:37 -0200 | [diff] [blame] | 3380 | { |
| 3381 | .name = "query-balloon", |
| 3382 | .args_type = "", |
| 3383 | .mhandler.cmd_new = qmp_marshal_input_query_balloon, |
| 3384 | }, |
Anthony Liguori | b4b12c6 | 2011-12-12 14:29:34 -0600 | [diff] [blame] | 3385 | |
| 3386 | { |
Stefan Hajnoczi | fb5458c | 2012-01-18 14:40:49 +0000 | [diff] [blame] | 3387 | .name = "query-block-jobs", |
| 3388 | .args_type = "", |
| 3389 | .mhandler.cmd_new = qmp_marshal_input_query_block_jobs, |
| 3390 | }, |
| 3391 | |
| 3392 | { |
Anthony Liguori | b4b12c6 | 2011-12-12 14:29:34 -0600 | [diff] [blame] | 3393 | .name = "qom-list", |
| 3394 | .args_type = "path:s", |
| 3395 | .mhandler.cmd_new = qmp_marshal_input_qom_list, |
| 3396 | }, |
Anthony Liguori | eb6e8ea | 2011-12-12 14:29:35 -0600 | [diff] [blame] | 3397 | |
| 3398 | { |
| 3399 | .name = "qom-set", |
Paolo Bonzini | b9f8978 | 2012-03-22 12:51:11 +0100 | [diff] [blame] | 3400 | .args_type = "path:s,property:s,value:q", |
Anthony Liguori | eb6e8ea | 2011-12-12 14:29:35 -0600 | [diff] [blame] | 3401 | .mhandler.cmd_new = qmp_qom_set, |
| 3402 | }, |
| 3403 | |
| 3404 | { |
| 3405 | .name = "qom-get", |
| 3406 | .args_type = "path:s,property:s", |
| 3407 | .mhandler.cmd_new = qmp_qom_get, |
| 3408 | }, |
Luiz Capitulino | 270b243 | 2011-12-08 11:45:55 -0200 | [diff] [blame] | 3409 | |
| 3410 | { |
Paolo Bonzini | 6dd844d | 2012-08-22 16:43:07 +0200 | [diff] [blame] | 3411 | .name = "nbd-server-start", |
| 3412 | .args_type = "addr:q", |
| 3413 | .mhandler.cmd_new = qmp_marshal_input_nbd_server_start, |
| 3414 | }, |
| 3415 | { |
| 3416 | .name = "nbd-server-add", |
| 3417 | .args_type = "device:B,writable:b?", |
| 3418 | .mhandler.cmd_new = qmp_marshal_input_nbd_server_add, |
| 3419 | }, |
| 3420 | { |
| 3421 | .name = "nbd-server-stop", |
| 3422 | .args_type = "", |
| 3423 | .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop, |
| 3424 | }, |
| 3425 | |
| 3426 | { |
Luiz Capitulino | 270b243 | 2011-12-08 11:45:55 -0200 | [diff] [blame] | 3427 | .name = "change-vnc-password", |
| 3428 | .args_type = "password:s", |
| 3429 | .mhandler.cmd_new = qmp_marshal_input_change_vnc_password, |
| 3430 | }, |
Anthony Liguori | 5eeee3f | 2011-12-22 14:40:54 -0600 | [diff] [blame] | 3431 | { |
| 3432 | .name = "qom-list-types", |
| 3433 | .args_type = "implements:s?,abstract:b?", |
| 3434 | .mhandler.cmd_new = qmp_marshal_input_qom_list_types, |
| 3435 | }, |
Anthony Liguori | 1daa31b | 2012-08-10 11:04:09 -0500 | [diff] [blame] | 3436 | |
| 3437 | { |
| 3438 | .name = "device-list-properties", |
| 3439 | .args_type = "typename:s", |
| 3440 | .mhandler.cmd_new = qmp_marshal_input_device_list_properties, |
| 3441 | }, |
| 3442 | |
Anthony Liguori | 01d3c80 | 2012-08-10 11:04:11 -0500 | [diff] [blame] | 3443 | { |
| 3444 | .name = "query-machines", |
| 3445 | .args_type = "", |
| 3446 | .mhandler.cmd_new = qmp_marshal_input_query_machines, |
| 3447 | }, |
| 3448 | |
Anthony Liguori | e4e31c6 | 2012-08-10 11:04:13 -0500 | [diff] [blame] | 3449 | { |
| 3450 | .name = "query-cpu-definitions", |
| 3451 | .args_type = "", |
| 3452 | .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions, |
| 3453 | }, |
| 3454 | |
Daniel P. Berrange | 99afc91 | 2012-08-20 15:31:38 +0100 | [diff] [blame] | 3455 | { |
| 3456 | .name = "query-target", |
| 3457 | .args_type = "", |
| 3458 | .mhandler.cmd_new = qmp_marshal_input_query_target, |
| 3459 | }, |
Gerd Hoffmann | f1a1a35 | 2012-12-19 10:33:56 +0100 | [diff] [blame] | 3460 | |
| 3461 | { |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 3462 | .name = "query-tpm", |
| 3463 | .args_type = "", |
| 3464 | .mhandler.cmd_new = qmp_marshal_input_query_tpm, |
| 3465 | }, |
| 3466 | |
Corey Bryant | 28c4fa3 | 2013-03-20 12:34:49 -0400 | [diff] [blame] | 3467 | SQMP |
| 3468 | query-tpm |
| 3469 | --------- |
| 3470 | |
| 3471 | Return information about the TPM device. |
| 3472 | |
| 3473 | Arguments: None |
| 3474 | |
| 3475 | Example: |
| 3476 | |
| 3477 | -> { "execute": "query-tpm" } |
| 3478 | <- { "return": |
| 3479 | [ |
| 3480 | { "model": "tpm-tis", |
| 3481 | "options": |
| 3482 | { "type": "passthrough", |
| 3483 | "data": |
| 3484 | { "cancel-path": "/sys/class/misc/tpm0/device/cancel", |
| 3485 | "path": "/dev/tpm0" |
| 3486 | } |
| 3487 | }, |
| 3488 | "id": "tpm0" |
| 3489 | } |
| 3490 | ] |
| 3491 | } |
| 3492 | |
| 3493 | EQMP |
| 3494 | |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 3495 | { |
| 3496 | .name = "query-tpm-models", |
| 3497 | .args_type = "", |
| 3498 | .mhandler.cmd_new = qmp_marshal_input_query_tpm_models, |
| 3499 | }, |
| 3500 | |
Corey Bryant | 28c4fa3 | 2013-03-20 12:34:49 -0400 | [diff] [blame] | 3501 | SQMP |
| 3502 | query-tpm-models |
| 3503 | ---------------- |
| 3504 | |
| 3505 | Return a list of supported TPM models. |
| 3506 | |
| 3507 | Arguments: None |
| 3508 | |
| 3509 | Example: |
| 3510 | |
| 3511 | -> { "execute": "query-tpm-models" } |
| 3512 | <- { "return": [ "tpm-tis" ] } |
| 3513 | |
| 3514 | EQMP |
| 3515 | |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 3516 | { |
| 3517 | .name = "query-tpm-types", |
| 3518 | .args_type = "", |
| 3519 | .mhandler.cmd_new = qmp_marshal_input_query_tpm_types, |
| 3520 | }, |
| 3521 | |
Corey Bryant | 28c4fa3 | 2013-03-20 12:34:49 -0400 | [diff] [blame] | 3522 | SQMP |
| 3523 | query-tpm-types |
| 3524 | --------------- |
| 3525 | |
| 3526 | Return a list of supported TPM types. |
| 3527 | |
| 3528 | Arguments: None |
| 3529 | |
| 3530 | Example: |
| 3531 | |
| 3532 | -> { "execute": "query-tpm-types" } |
| 3533 | <- { "return": [ "passthrough" ] } |
| 3534 | |
| 3535 | EQMP |
| 3536 | |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 3537 | { |
Gerd Hoffmann | f1a1a35 | 2012-12-19 10:33:56 +0100 | [diff] [blame] | 3538 | .name = "chardev-add", |
| 3539 | .args_type = "id:s,backend:q", |
| 3540 | .mhandler.cmd_new = qmp_marshal_input_chardev_add, |
| 3541 | }, |
| 3542 | |
| 3543 | SQMP |
| 3544 | chardev-add |
| 3545 | ---------------- |
| 3546 | |
| 3547 | Add a chardev. |
| 3548 | |
| 3549 | Arguments: |
| 3550 | |
| 3551 | - "id": the chardev's ID, must be unique (json-string) |
| 3552 | - "backend": chardev backend type + parameters |
| 3553 | |
Gerd Hoffmann | ffbdbe5 | 2012-12-19 13:13:57 +0100 | [diff] [blame] | 3554 | Examples: |
Gerd Hoffmann | f1a1a35 | 2012-12-19 10:33:56 +0100 | [diff] [blame] | 3555 | |
| 3556 | -> { "execute" : "chardev-add", |
| 3557 | "arguments" : { "id" : "foo", |
| 3558 | "backend" : { "type" : "null", "data" : {} } } } |
| 3559 | <- { "return": {} } |
| 3560 | |
Gerd Hoffmann | ffbdbe5 | 2012-12-19 13:13:57 +0100 | [diff] [blame] | 3561 | -> { "execute" : "chardev-add", |
| 3562 | "arguments" : { "id" : "bar", |
| 3563 | "backend" : { "type" : "file", |
| 3564 | "data" : { "out" : "/tmp/bar.log" } } } } |
| 3565 | <- { "return": {} } |
| 3566 | |
Gerd Hoffmann | 0a1a7fa | 2012-12-20 14:39:13 +0100 | [diff] [blame] | 3567 | -> { "execute" : "chardev-add", |
| 3568 | "arguments" : { "id" : "baz", |
| 3569 | "backend" : { "type" : "pty", "data" : {} } } } |
| 3570 | <- { "return": { "pty" : "/dev/pty/42" } } |
| 3571 | |
Gerd Hoffmann | f1a1a35 | 2012-12-19 10:33:56 +0100 | [diff] [blame] | 3572 | EQMP |
| 3573 | |
| 3574 | { |
| 3575 | .name = "chardev-remove", |
| 3576 | .args_type = "id:s", |
| 3577 | .mhandler.cmd_new = qmp_marshal_input_chardev_remove, |
| 3578 | }, |
| 3579 | |
| 3580 | |
| 3581 | SQMP |
| 3582 | chardev-remove |
| 3583 | -------------- |
| 3584 | |
| 3585 | Remove a chardev. |
| 3586 | |
| 3587 | Arguments: |
| 3588 | |
| 3589 | - "id": the chardev's ID, must exist and not be in use (json-string) |
| 3590 | |
| 3591 | Example: |
| 3592 | |
| 3593 | -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } } |
| 3594 | <- { "return": {} } |
| 3595 | |
| 3596 | EQMP |
Amos Kong | b1be428 | 2013-06-14 15:45:52 +0800 | [diff] [blame] | 3597 | { |
| 3598 | .name = "query-rx-filter", |
| 3599 | .args_type = "name:s?", |
| 3600 | .mhandler.cmd_new = qmp_marshal_input_query_rx_filter, |
| 3601 | }, |
| 3602 | |
| 3603 | SQMP |
| 3604 | query-rx-filter |
| 3605 | --------------- |
| 3606 | |
| 3607 | Show rx-filter information. |
| 3608 | |
| 3609 | Returns a json-array of rx-filter information for all NICs (or for the |
| 3610 | given NIC), returning an error if the given NIC doesn't exist, or |
| 3611 | given NIC doesn't support rx-filter querying, or given net client |
| 3612 | isn't a NIC. |
| 3613 | |
| 3614 | The query will clear the event notification flag of each NIC, then qemu |
| 3615 | will start to emit event to QMP monitor. |
| 3616 | |
| 3617 | Each array entry contains the following: |
| 3618 | |
| 3619 | - "name": net client name (json-string) |
| 3620 | - "promiscuous": promiscuous mode is enabled (json-bool) |
| 3621 | - "multicast": multicast receive state (one of 'normal', 'none', 'all') |
| 3622 | - "unicast": unicast receive state (one of 'normal', 'none', 'all') |
Amos Kong | f7bc8ef | 2014-03-26 08:19:43 +0800 | [diff] [blame] | 3623 | - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0) |
Amos Kong | b1be428 | 2013-06-14 15:45:52 +0800 | [diff] [blame] | 3624 | - "broadcast-allowed": allow to receive broadcast (json-bool) |
| 3625 | - "multicast-overflow": multicast table is overflowed (json-bool) |
| 3626 | - "unicast-overflow": unicast table is overflowed (json-bool) |
| 3627 | - "main-mac": main macaddr string (json-string) |
| 3628 | - "vlan-table": a json-array of active vlan id |
| 3629 | - "unicast-table": a json-array of unicast macaddr string |
| 3630 | - "multicast-table": a json-array of multicast macaddr string |
| 3631 | |
| 3632 | Example: |
| 3633 | |
| 3634 | -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } } |
| 3635 | <- { "return": [ |
| 3636 | { |
| 3637 | "promiscuous": true, |
| 3638 | "name": "vnet0", |
| 3639 | "main-mac": "52:54:00:12:34:56", |
| 3640 | "unicast": "normal", |
Amos Kong | f7bc8ef | 2014-03-26 08:19:43 +0800 | [diff] [blame] | 3641 | "vlan": "normal", |
Amos Kong | b1be428 | 2013-06-14 15:45:52 +0800 | [diff] [blame] | 3642 | "vlan-table": [ |
| 3643 | 4, |
| 3644 | 0 |
| 3645 | ], |
| 3646 | "unicast-table": [ |
| 3647 | ], |
| 3648 | "multicast": "normal", |
| 3649 | "multicast-overflow": false, |
| 3650 | "unicast-overflow": false, |
| 3651 | "multicast-table": [ |
| 3652 | "01:00:5e:00:00:01", |
| 3653 | "33:33:00:00:00:01", |
| 3654 | "33:33:ff:12:34:56" |
| 3655 | ], |
| 3656 | "broadcast-allowed": false |
| 3657 | } |
| 3658 | ] |
| 3659 | } |
| 3660 | |
| 3661 | EQMP |
Kevin Wolf | d26c9a1 | 2013-09-23 15:26:03 +0200 | [diff] [blame] | 3662 | |
| 3663 | { |
| 3664 | .name = "blockdev-add", |
| 3665 | .args_type = "options:q", |
| 3666 | .mhandler.cmd_new = qmp_marshal_input_blockdev_add, |
| 3667 | }, |
| 3668 | |
| 3669 | SQMP |
| 3670 | blockdev-add |
| 3671 | ------------ |
| 3672 | |
| 3673 | Add a block device. |
| 3674 | |
Markus Armbruster | da2cf4e | 2015-03-20 14:32:17 +0100 | [diff] [blame] | 3675 | This command is still a work in progress. It doesn't support all |
| 3676 | block drivers, it lacks a matching blockdev-del, and more. Stay away |
| 3677 | from it unless you want to help with its development. |
| 3678 | |
Kevin Wolf | d26c9a1 | 2013-09-23 15:26:03 +0200 | [diff] [blame] | 3679 | Arguments: |
| 3680 | |
| 3681 | - "options": block driver options |
| 3682 | |
| 3683 | Example (1): |
| 3684 | |
| 3685 | -> { "execute": "blockdev-add", |
| 3686 | "arguments": { "options" : { "driver": "qcow2", |
| 3687 | "file": { "driver": "file", |
| 3688 | "filename": "test.qcow2" } } } } |
| 3689 | <- { "return": {} } |
| 3690 | |
| 3691 | Example (2): |
| 3692 | |
| 3693 | -> { "execute": "blockdev-add", |
| 3694 | "arguments": { |
| 3695 | "options": { |
| 3696 | "driver": "qcow2", |
| 3697 | "id": "my_disk", |
| 3698 | "discard": "unmap", |
| 3699 | "cache": { |
| 3700 | "direct": true, |
| 3701 | "writeback": true |
| 3702 | }, |
| 3703 | "file": { |
| 3704 | "driver": "file", |
| 3705 | "filename": "/tmp/test.qcow2" |
| 3706 | }, |
| 3707 | "backing": { |
| 3708 | "driver": "raw", |
| 3709 | "file": { |
| 3710 | "driver": "file", |
| 3711 | "filename": "/dev/fdset/4" |
| 3712 | } |
| 3713 | } |
| 3714 | } |
| 3715 | } |
| 3716 | } |
| 3717 | |
| 3718 | <- { "return": {} } |
| 3719 | |
| 3720 | EQMP |
Benoît Canet | c13163f | 2014-01-23 21:31:34 +0100 | [diff] [blame] | 3721 | |
| 3722 | { |
| 3723 | .name = "query-named-block-nodes", |
| 3724 | .args_type = "", |
| 3725 | .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes, |
| 3726 | }, |
| 3727 | |
| 3728 | SQMP |
| 3729 | @query-named-block-nodes |
| 3730 | ------------------------ |
| 3731 | |
| 3732 | Return a list of BlockDeviceInfo for all the named block driver nodes |
| 3733 | |
| 3734 | Example: |
| 3735 | |
| 3736 | -> { "execute": "query-named-block-nodes" } |
| 3737 | <- { "return": [ { "ro":false, |
| 3738 | "drv":"qcow2", |
| 3739 | "encrypted":false, |
| 3740 | "file":"disks/test.qcow2", |
| 3741 | "node-name": "my-node", |
| 3742 | "backing_file_depth":1, |
| 3743 | "bps":1000000, |
| 3744 | "bps_rd":0, |
| 3745 | "bps_wr":0, |
| 3746 | "iops":1000000, |
| 3747 | "iops_rd":0, |
| 3748 | "iops_wr":0, |
| 3749 | "bps_max": 8000000, |
| 3750 | "bps_rd_max": 0, |
| 3751 | "bps_wr_max": 0, |
| 3752 | "iops_max": 0, |
| 3753 | "iops_rd_max": 0, |
| 3754 | "iops_wr_max": 0, |
| 3755 | "iops_size": 0, |
Francesco Romani | e246211 | 2015-01-12 14:11:13 +0100 | [diff] [blame] | 3756 | "write_threshold": 0, |
Benoît Canet | c13163f | 2014-01-23 21:31:34 +0100 | [diff] [blame] | 3757 | "image":{ |
| 3758 | "filename":"disks/test.qcow2", |
| 3759 | "format":"qcow2", |
| 3760 | "virtual-size":2048000, |
| 3761 | "backing_file":"base.qcow2", |
| 3762 | "full-backing-filename":"disks/base.qcow2", |
| 3763 | "backing-filename-format:"qcow2", |
| 3764 | "snapshots":[ |
| 3765 | { |
| 3766 | "id": "1", |
| 3767 | "name": "snapshot1", |
| 3768 | "vm-state-size": 0, |
| 3769 | "date-sec": 10000200, |
| 3770 | "date-nsec": 12, |
| 3771 | "vm-clock-sec": 206, |
| 3772 | "vm-clock-nsec": 30 |
| 3773 | } |
| 3774 | ], |
| 3775 | "backing-image":{ |
| 3776 | "filename":"disks/base.qcow2", |
| 3777 | "format":"qcow2", |
| 3778 | "virtual-size":2048000 |
| 3779 | } |
Michael S. Tsirkin | c059451 | 2014-06-16 15:20:18 +0300 | [diff] [blame] | 3780 | } } ] } |
Benoît Canet | c13163f | 2014-01-23 21:31:34 +0100 | [diff] [blame] | 3781 | |
| 3782 | EQMP |
Hu Tao | 76b5d85 | 2014-06-16 18:05:41 +0800 | [diff] [blame] | 3783 | |
| 3784 | { |
| 3785 | .name = "query-memdev", |
| 3786 | .args_type = "", |
| 3787 | .mhandler.cmd_new = qmp_marshal_input_query_memdev, |
| 3788 | }, |
| 3789 | |
| 3790 | SQMP |
| 3791 | query-memdev |
| 3792 | ------------ |
| 3793 | |
| 3794 | Show memory devices information. |
| 3795 | |
| 3796 | |
| 3797 | Example (1): |
| 3798 | |
| 3799 | -> { "execute": "query-memdev" } |
| 3800 | <- { "return": [ |
| 3801 | { |
| 3802 | "size": 536870912, |
| 3803 | "merge": false, |
| 3804 | "dump": true, |
| 3805 | "prealloc": false, |
| 3806 | "host-nodes": [0, 1], |
| 3807 | "policy": "bind" |
| 3808 | }, |
| 3809 | { |
| 3810 | "size": 536870912, |
| 3811 | "merge": false, |
| 3812 | "dump": true, |
| 3813 | "prealloc": true, |
| 3814 | "host-nodes": [2, 3], |
| 3815 | "policy": "preferred" |
| 3816 | } |
| 3817 | ] |
| 3818 | } |
| 3819 | |
| 3820 | EQMP |
Igor Mammedov | 6f2e273 | 2014-06-16 19:12:25 +0200 | [diff] [blame] | 3821 | |
| 3822 | { |
| 3823 | .name = "query-memory-devices", |
| 3824 | .args_type = "", |
| 3825 | .mhandler.cmd_new = qmp_marshal_input_query_memory_devices, |
| 3826 | }, |
| 3827 | |
| 3828 | SQMP |
| 3829 | @query-memory-devices |
| 3830 | -------------------- |
| 3831 | |
| 3832 | Return a list of memory devices. |
| 3833 | |
| 3834 | Example: |
| 3835 | -> { "execute": "query-memory-devices" } |
| 3836 | <- { "return": [ { "data": |
| 3837 | { "addr": 5368709120, |
| 3838 | "hotpluggable": true, |
| 3839 | "hotplugged": true, |
| 3840 | "id": "d1", |
| 3841 | "memdev": "/objects/memX", |
| 3842 | "node": 0, |
| 3843 | "size": 1073741824, |
| 3844 | "slot": 0}, |
| 3845 | "type": "dimm" |
| 3846 | } ] } |
| 3847 | EQMP |
Igor Mammedov | 02419bc | 2014-06-16 19:12:28 +0200 | [diff] [blame] | 3848 | |
| 3849 | { |
| 3850 | .name = "query-acpi-ospm-status", |
| 3851 | .args_type = "", |
| 3852 | .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status, |
| 3853 | }, |
| 3854 | |
| 3855 | SQMP |
| 3856 | @query-acpi-ospm-status |
| 3857 | -------------------- |
| 3858 | |
| 3859 | Return list of ACPIOSTInfo for devices that support status reporting |
| 3860 | via ACPI _OST method. |
| 3861 | |
| 3862 | Example: |
| 3863 | -> { "execute": "query-acpi-ospm-status" } |
| 3864 | <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0}, |
| 3865 | { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0}, |
| 3866 | { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0}, |
| 3867 | { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0} |
| 3868 | ]} |
| 3869 | EQMP |
Marcelo Tosatti | f2ae8ab | 2014-06-24 18:55:11 -0300 | [diff] [blame] | 3870 | |
| 3871 | #if defined TARGET_I386 |
| 3872 | { |
| 3873 | .name = "rtc-reset-reinjection", |
| 3874 | .args_type = "", |
| 3875 | .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection, |
| 3876 | }, |
| 3877 | #endif |
| 3878 | |
| 3879 | SQMP |
| 3880 | rtc-reset-reinjection |
| 3881 | --------------------- |
| 3882 | |
| 3883 | Reset the RTC interrupt reinjection backlog. |
| 3884 | |
| 3885 | Arguments: None. |
| 3886 | |
| 3887 | Example: |
| 3888 | |
| 3889 | -> { "execute": "rtc-reset-reinjection" } |
| 3890 | <- { "return": {} } |
Lluís Vilanova | 1dde0f4 | 2014-08-25 13:19:57 +0200 | [diff] [blame] | 3891 | EQMP |
Marcelo Tosatti | f2ae8ab | 2014-06-24 18:55:11 -0300 | [diff] [blame] | 3892 | |
Lluís Vilanova | 1dde0f4 | 2014-08-25 13:19:57 +0200 | [diff] [blame] | 3893 | { |
| 3894 | .name = "trace-event-get-state", |
| 3895 | .args_type = "name:s", |
| 3896 | .mhandler.cmd_new = qmp_marshal_input_trace_event_get_state, |
| 3897 | }, |
| 3898 | |
| 3899 | SQMP |
| 3900 | trace-event-get-state |
| 3901 | --------------------- |
| 3902 | |
| 3903 | Query the state of events. |
| 3904 | |
| 3905 | Example: |
| 3906 | |
| 3907 | -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } } |
| 3908 | <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] } |
| 3909 | EQMP |
| 3910 | |
| 3911 | { |
| 3912 | .name = "trace-event-set-state", |
| 3913 | .args_type = "name:s,enable:b,ignore-unavailable:b?", |
| 3914 | .mhandler.cmd_new = qmp_marshal_input_trace_event_set_state, |
| 3915 | }, |
| 3916 | |
| 3917 | SQMP |
| 3918 | trace-event-set-state |
| 3919 | --------------------- |
| 3920 | |
| 3921 | Set the state of events. |
| 3922 | |
| 3923 | Example: |
| 3924 | |
| 3925 | -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } } |
| 3926 | <- { "return": {} } |
Marcelo Tosatti | f2ae8ab | 2014-06-24 18:55:11 -0300 | [diff] [blame] | 3927 | EQMP |
Marcelo Tosatti | 50c6617 | 2014-09-30 18:10:17 -0300 | [diff] [blame] | 3928 | |
| 3929 | { |
Gerd Hoffmann | df5b2ad | 2014-11-25 14:54:17 +0100 | [diff] [blame] | 3930 | .name = "x-input-send-event", |
Amos Kong | 51fc447 | 2014-11-07 12:41:25 +0800 | [diff] [blame] | 3931 | .args_type = "console:i?,events:q", |
Gerd Hoffmann | df5b2ad | 2014-11-25 14:54:17 +0100 | [diff] [blame] | 3932 | .mhandler.cmd_new = qmp_marshal_input_x_input_send_event, |
Marcelo Tosatti | 50c6617 | 2014-09-30 18:10:17 -0300 | [diff] [blame] | 3933 | }, |
| 3934 | |
| 3935 | SQMP |
Gerd Hoffmann | df5b2ad | 2014-11-25 14:54:17 +0100 | [diff] [blame] | 3936 | @x-input-send-event |
Marcelo Tosatti | 50c6617 | 2014-09-30 18:10:17 -0300 | [diff] [blame] | 3937 | ----------------- |
| 3938 | |
| 3939 | Send input event to guest. |
| 3940 | |
| 3941 | Arguments: |
| 3942 | |
Amos Kong | 51fc447 | 2014-11-07 12:41:25 +0800 | [diff] [blame] | 3943 | - "console": console index. (json-int, optional) |
Marcelo Tosatti | 50c6617 | 2014-09-30 18:10:17 -0300 | [diff] [blame] | 3944 | - "events": list of input events. |
| 3945 | |
| 3946 | The consoles are visible in the qom tree, under |
| 3947 | /backend/console[$index]. They have a device link and head property, so |
| 3948 | it is possible to map which console belongs to which device and display. |
| 3949 | |
Gerd Hoffmann | df5b2ad | 2014-11-25 14:54:17 +0100 | [diff] [blame] | 3950 | Note: this command is experimental, and not a stable API. |
| 3951 | |
Marcelo Tosatti | 50c6617 | 2014-09-30 18:10:17 -0300 | [diff] [blame] | 3952 | Example (1): |
| 3953 | |
| 3954 | Press left mouse button. |
| 3955 | |
Gerd Hoffmann | df5b2ad | 2014-11-25 14:54:17 +0100 | [diff] [blame] | 3956 | -> { "execute": "x-input-send-event", |
Marcelo Tosatti | 50c6617 | 2014-09-30 18:10:17 -0300 | [diff] [blame] | 3957 | "arguments": { "console": 0, |
| 3958 | "events": [ { "type": "btn", |
Amos Kong | b5369dd | 2014-11-25 16:05:56 +0800 | [diff] [blame] | 3959 | "data" : { "down": true, "button": "Left" } } ] } } |
Marcelo Tosatti | 50c6617 | 2014-09-30 18:10:17 -0300 | [diff] [blame] | 3960 | <- { "return": {} } |
| 3961 | |
Gerd Hoffmann | df5b2ad | 2014-11-25 14:54:17 +0100 | [diff] [blame] | 3962 | -> { "execute": "x-input-send-event", |
Marcelo Tosatti | 50c6617 | 2014-09-30 18:10:17 -0300 | [diff] [blame] | 3963 | "arguments": { "console": 0, |
| 3964 | "events": [ { "type": "btn", |
Amos Kong | b5369dd | 2014-11-25 16:05:56 +0800 | [diff] [blame] | 3965 | "data" : { "down": false, "button": "Left" } } ] } } |
Marcelo Tosatti | 50c6617 | 2014-09-30 18:10:17 -0300 | [diff] [blame] | 3966 | <- { "return": {} } |
| 3967 | |
| 3968 | Example (2): |
| 3969 | |
| 3970 | Press ctrl-alt-del. |
| 3971 | |
Gerd Hoffmann | df5b2ad | 2014-11-25 14:54:17 +0100 | [diff] [blame] | 3972 | -> { "execute": "x-input-send-event", |
Marcelo Tosatti | 50c6617 | 2014-09-30 18:10:17 -0300 | [diff] [blame] | 3973 | "arguments": { "console": 0, "events": [ |
| 3974 | { "type": "key", "data" : { "down": true, |
| 3975 | "key": {"type": "qcode", "data": "ctrl" } } }, |
| 3976 | { "type": "key", "data" : { "down": true, |
| 3977 | "key": {"type": "qcode", "data": "alt" } } }, |
| 3978 | { "type": "key", "data" : { "down": true, |
| 3979 | "key": {"type": "qcode", "data": "delete" } } } ] } } |
| 3980 | <- { "return": {} } |
| 3981 | |
| 3982 | Example (3): |
| 3983 | |
| 3984 | Move mouse pointer to absolute coordinates (20000, 400). |
| 3985 | |
Gerd Hoffmann | df5b2ad | 2014-11-25 14:54:17 +0100 | [diff] [blame] | 3986 | -> { "execute": "x-input-send-event" , |
Marcelo Tosatti | 50c6617 | 2014-09-30 18:10:17 -0300 | [diff] [blame] | 3987 | "arguments": { "console": 0, "events": [ |
| 3988 | { "type": "abs", "data" : { "axis": "X", "value" : 20000 } }, |
| 3989 | { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } } |
| 3990 | <- { "return": {} } |
| 3991 | |
| 3992 | EQMP |
Francesco Romani | e246211 | 2015-01-12 14:11:13 +0100 | [diff] [blame] | 3993 | |
| 3994 | { |
| 3995 | .name = "block-set-write-threshold", |
| 3996 | .args_type = "node-name:s,write-threshold:l", |
| 3997 | .mhandler.cmd_new = qmp_marshal_input_block_set_write_threshold, |
| 3998 | }, |
| 3999 | |
| 4000 | SQMP |
| 4001 | block-set-write-threshold |
| 4002 | ------------ |
| 4003 | |
| 4004 | Change the write threshold for a block drive. The threshold is an offset, |
| 4005 | thus must be non-negative. Default is no write threshold. |
| 4006 | Setting the threshold to zero disables it. |
| 4007 | |
| 4008 | Arguments: |
| 4009 | |
| 4010 | - "node-name": the node name in the block driver state graph (json-string) |
| 4011 | - "write-threshold": the write threshold in bytes (json-int) |
| 4012 | |
| 4013 | Example: |
| 4014 | |
| 4015 | -> { "execute": "block-set-write-threshold", |
| 4016 | "arguments": { "node-name": "mydev", |
| 4017 | "write-threshold": 17179869184 } } |
| 4018 | <- { "return": {} } |
| 4019 | |
| 4020 | EQMP |