]>
Commit | Line | Data |
---|---|---|
82a56f0d | 1 | HXCOMM QMP dispatch table and documentation |
3599d46b | 2 | HXCOMM Text between SQMP and EQMP is copied to the QMP documentation file and |
82a56f0d LC |
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 | ||
c20cdf8b | 45 | 1. The deprecation policy will take effect and be documented soon, please |
82a56f0d LC |
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 = "", | |
7fad30f0 | 66 | .mhandler.cmd_new = qmp_marshal_quit, |
82a56f0d LC |
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", | |
7fad30f0 | 87 | .mhandler.cmd_new = qmp_marshal_eject, |
82a56f0d LC |
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?", | |
7fad30f0 | 113 | .mhandler.cmd_new = qmp_marshal_change, |
82a56f0d LC |
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", | |
7fad30f0 | 149 | .mhandler.cmd_new = qmp_marshal_screendump, |
82a56f0d LC |
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 = "", | |
7fad30f0 | 172 | .mhandler.cmd_new = qmp_marshal_stop, |
82a56f0d LC |
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 = "", | |
7fad30f0 | 193 | .mhandler.cmd_new = qmp_marshal_cont, |
82a56f0d LC |
194 | }, |
195 | ||
196 | SQMP | |
197 | cont | |
198 | ---- | |
199 | ||
200 | Resume emulation. | |
201 | ||
202 | Arguments: None. | |
203 | ||
204 | Example: | |
205 | ||
206 | -> { "execute": "cont" } | |
207 | <- { "return": {} } | |
9b9df25a GH |
208 | |
209 | EQMP | |
210 | ||
211 | { | |
212 | .name = "system_wakeup", | |
213 | .args_type = "", | |
7fad30f0 | 214 | .mhandler.cmd_new = qmp_marshal_system_wakeup, |
9b9df25a GH |
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": {} } | |
82a56f0d LC |
229 | |
230 | EQMP | |
231 | ||
232 | { | |
233 | .name = "system_reset", | |
234 | .args_type = "", | |
7fad30f0 | 235 | .mhandler.cmd_new = qmp_marshal_system_reset, |
82a56f0d LC |
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 = "", | |
7fad30f0 | 256 | .mhandler.cmd_new = qmp_marshal_system_powerdown, |
82a56f0d LC |
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", | |
485febc6 | 279 | .mhandler.cmd_new = qmp_device_add, |
82a56f0d LC |
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", | |
7fad30f0 | 313 | .mhandler.cmd_new = qmp_marshal_device_del, |
82a56f0d LC |
314 | }, |
315 | ||
316 | SQMP | |
317 | device_del | |
318 | ---------- | |
319 | ||
320 | Remove a device. | |
321 | ||
322 | Arguments: | |
323 | ||
6287d827 | 324 | - "id": the device's ID or QOM path (json-string) |
82a56f0d LC |
325 | |
326 | Example: | |
327 | ||
328 | -> { "execute": "device_del", "arguments": { "id": "net1" } } | |
329 | <- { "return": {} } | |
330 | ||
6287d827 DB |
331 | Example: |
332 | ||
333 | -> { "execute": "device_del", "arguments": { "id": "/machine/peripheral-anon/device[0]" } } | |
334 | <- { "return": {} } | |
335 | ||
e4c8f004 AK |
336 | EQMP |
337 | ||
338 | { | |
339 | .name = "send-key", | |
43d0a2c1 | 340 | .args_type = "keys:q,hold-time:i?", |
7fad30f0 | 341 | .mhandler.cmd_new = qmp_marshal_send_key, |
e4c8f004 AK |
342 | }, |
343 | ||
344 | SQMP | |
345 | send-key | |
346 | ---------- | |
347 | ||
348 | Send keys to VM. | |
349 | ||
350 | Arguments: | |
351 | ||
352 | keys array: | |
f9b1d9b2 AK |
353 | - "key": key sequence (a json-array of key union values, |
354 | union can be number or qcode enum) | |
e4c8f004 AK |
355 | |
356 | - hold-time: time to delay key up events, milliseconds. Defaults to 100 | |
357 | (json-int, optional) | |
358 | ||
359 | Example: | |
360 | ||
361 | -> { "execute": "send-key", | |
f9b1d9b2 AK |
362 | "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" }, |
363 | { "type": "qcode", "data": "alt" }, | |
364 | { "type": "qcode", "data": "delete" } ] } } | |
e4c8f004 AK |
365 | <- { "return": {} } |
366 | ||
82a56f0d LC |
367 | EQMP |
368 | ||
369 | { | |
370 | .name = "cpu", | |
371 | .args_type = "index:i", | |
7fad30f0 | 372 | .mhandler.cmd_new = qmp_marshal_cpu, |
82a56f0d LC |
373 | }, |
374 | ||
375 | SQMP | |
376 | cpu | |
377 | --- | |
378 | ||
379 | Set the default CPU. | |
380 | ||
381 | Arguments: | |
382 | ||
383 | - "index": the CPU's index (json-int) | |
384 | ||
385 | Example: | |
386 | ||
387 | -> { "execute": "cpu", "arguments": { "index": 0 } } | |
388 | <- { "return": {} } | |
389 | ||
390 | Note: CPUs' indexes are obtained with the 'query-cpus' command. | |
391 | ||
69ca3ea5 IM |
392 | EQMP |
393 | ||
394 | { | |
395 | .name = "cpu-add", | |
396 | .args_type = "id:i", | |
7fad30f0 | 397 | .mhandler.cmd_new = qmp_marshal_cpu_add, |
69ca3ea5 IM |
398 | }, |
399 | ||
400 | SQMP | |
401 | cpu-add | |
402 | ------- | |
403 | ||
404 | Adds virtual cpu | |
405 | ||
406 | Arguments: | |
407 | ||
408 | - "id": cpu id (json-int) | |
409 | ||
410 | Example: | |
411 | ||
412 | -> { "execute": "cpu-add", "arguments": { "id": 2 } } | |
413 | <- { "return": {} } | |
414 | ||
82a56f0d LC |
415 | EQMP |
416 | ||
417 | { | |
418 | .name = "memsave", | |
0cfd6a9a | 419 | .args_type = "val:l,size:i,filename:s,cpu:i?", |
7fad30f0 | 420 | .mhandler.cmd_new = qmp_marshal_memsave, |
82a56f0d LC |
421 | }, |
422 | ||
423 | SQMP | |
424 | memsave | |
425 | ------- | |
426 | ||
427 | Save to disk virtual memory dump starting at 'val' of size 'size'. | |
428 | ||
429 | Arguments: | |
430 | ||
431 | - "val": the starting address (json-int) | |
432 | - "size": the memory size, in bytes (json-int) | |
433 | - "filename": file path (json-string) | |
0cfd6a9a | 434 | - "cpu": virtual CPU index (json-int, optional) |
82a56f0d LC |
435 | |
436 | Example: | |
437 | ||
438 | -> { "execute": "memsave", | |
439 | "arguments": { "val": 10, | |
440 | "size": 100, | |
441 | "filename": "/tmp/virtual-mem-dump" } } | |
442 | <- { "return": {} } | |
443 | ||
82a56f0d LC |
444 | EQMP |
445 | ||
446 | { | |
447 | .name = "pmemsave", | |
448 | .args_type = "val:l,size:i,filename:s", | |
7fad30f0 | 449 | .mhandler.cmd_new = qmp_marshal_pmemsave, |
82a56f0d LC |
450 | }, |
451 | ||
452 | SQMP | |
453 | pmemsave | |
454 | -------- | |
455 | ||
456 | Save to disk physical memory dump starting at 'val' of size 'size'. | |
457 | ||
458 | Arguments: | |
459 | ||
460 | - "val": the starting address (json-int) | |
461 | - "size": the memory size, in bytes (json-int) | |
462 | - "filename": file path (json-string) | |
463 | ||
464 | Example: | |
465 | ||
466 | -> { "execute": "pmemsave", | |
467 | "arguments": { "val": 10, | |
468 | "size": 100, | |
469 | "filename": "/tmp/physical-mem-dump" } } | |
470 | <- { "return": {} } | |
471 | ||
a4046664 LJ |
472 | EQMP |
473 | ||
474 | { | |
475 | .name = "inject-nmi", | |
476 | .args_type = "", | |
7fad30f0 | 477 | .mhandler.cmd_new = qmp_marshal_inject_nmi, |
a4046664 LJ |
478 | }, |
479 | ||
480 | SQMP | |
481 | inject-nmi | |
482 | ---------- | |
483 | ||
9cb805fd | 484 | Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64). |
a4046664 LJ |
485 | |
486 | Arguments: None. | |
487 | ||
488 | Example: | |
489 | ||
490 | -> { "execute": "inject-nmi" } | |
491 | <- { "return": {} } | |
492 | ||
de253f14 | 493 | Note: inject-nmi fails when the guest doesn't support injecting. |
a4046664 | 494 | |
1f590cf9 LL |
495 | EQMP |
496 | ||
497 | { | |
3949e594 | 498 | .name = "ringbuf-write", |
82e59a67 | 499 | .args_type = "device:s,data:s,format:s?", |
7fad30f0 | 500 | .mhandler.cmd_new = qmp_marshal_ringbuf_write, |
1f590cf9 LL |
501 | }, |
502 | ||
503 | SQMP | |
3949e594 | 504 | ringbuf-write |
1f590cf9 LL |
505 | ------------- |
506 | ||
3949e594 | 507 | Write to a ring buffer character device. |
1f590cf9 LL |
508 | |
509 | Arguments: | |
510 | ||
3949e594 MA |
511 | - "device": ring buffer character device name (json-string) |
512 | - "data": data to write (json-string) | |
513 | - "format": data format (json-string, optional) | |
514 | - Possible values: "utf8" (default), "base64" | |
1f590cf9 LL |
515 | |
516 | Example: | |
517 | ||
3949e594 MA |
518 | -> { "execute": "ringbuf-write", |
519 | "arguments": { "device": "foo", | |
1f590cf9 LL |
520 | "data": "abcdefgh", |
521 | "format": "utf8" } } | |
522 | <- { "return": {} } | |
523 | ||
49b6d722 LL |
524 | EQMP |
525 | ||
526 | { | |
3949e594 | 527 | .name = "ringbuf-read", |
49b6d722 | 528 | .args_type = "device:s,size:i,format:s?", |
7fad30f0 | 529 | .mhandler.cmd_new = qmp_marshal_ringbuf_read, |
49b6d722 LL |
530 | }, |
531 | ||
532 | SQMP | |
3949e594 | 533 | ringbuf-read |
49b6d722 LL |
534 | ------------- |
535 | ||
3949e594 | 536 | Read from a ring buffer character device. |
49b6d722 LL |
537 | |
538 | Arguments: | |
539 | ||
3949e594 MA |
540 | - "device": ring buffer character device name (json-string) |
541 | - "size": how many bytes to read at most (json-int) | |
542 | - Number of data bytes, not number of characters in encoded data | |
543 | - "format": data format (json-string, optional) | |
544 | - Possible values: "utf8" (default), "base64" | |
545 | - Naturally, format "utf8" works only when the ring buffer | |
546 | contains valid UTF-8 text. Invalid UTF-8 sequences get | |
547 | replaced. Bug: replacement doesn't work. Bug: can screw | |
548 | up on encountering NUL characters, after the ring buffer | |
549 | lost data, and when reading stops because the size limit | |
550 | is reached. | |
49b6d722 LL |
551 | |
552 | Example: | |
553 | ||
3949e594 MA |
554 | -> { "execute": "ringbuf-read", |
555 | "arguments": { "device": "foo", | |
49b6d722 LL |
556 | "size": 1000, |
557 | "format": "utf8" } } | |
3ab651fc | 558 | <- {"return": "abcdefgh"} |
49b6d722 | 559 | |
a7ae8355 SS |
560 | EQMP |
561 | ||
562 | { | |
563 | .name = "xen-save-devices-state", | |
564 | .args_type = "filename:F", | |
7fad30f0 | 565 | .mhandler.cmd_new = qmp_marshal_xen_save_devices_state, |
a7ae8355 SS |
566 | }, |
567 | ||
568 | SQMP | |
569 | xen-save-devices-state | |
570 | ------- | |
571 | ||
572 | Save the state of all devices to file. The RAM and the block devices | |
573 | of the VM are not saved by this command. | |
574 | ||
575 | Arguments: | |
576 | ||
577 | - "filename": the file to save the state of the devices to as binary | |
578 | data. See xen-save-devices-state.txt for a description of the binary | |
579 | format. | |
580 | ||
581 | Example: | |
582 | ||
583 | -> { "execute": "xen-save-devices-state", | |
584 | "arguments": { "filename": "/tmp/save" } } | |
585 | <- { "return": {} } | |
586 | ||
88c16567 WC |
587 | EQMP |
588 | ||
589 | { | |
590 | .name = "xen-load-devices-state", | |
591 | .args_type = "filename:F", | |
592 | .mhandler.cmd_new = qmp_marshal_xen_load_devices_state, | |
593 | }, | |
594 | ||
595 | SQMP | |
596 | xen-load-devices-state | |
597 | ---------------------- | |
598 | ||
599 | Load the state of all devices from file. The RAM and the block devices | |
600 | of the VM are not loaded by this command. | |
601 | ||
602 | Arguments: | |
603 | ||
604 | - "filename": the file to load the state of the devices from as binary | |
605 | data. See xen-save-devices-state.txt for a description of the binary | |
606 | format. | |
607 | ||
608 | Example: | |
609 | ||
610 | -> { "execute": "xen-load-devices-state", | |
611 | "arguments": { "filename": "/tmp/resume" } } | |
612 | <- { "return": {} } | |
613 | ||
39f42439 AP |
614 | EQMP |
615 | ||
616 | { | |
617 | .name = "xen-set-global-dirty-log", | |
618 | .args_type = "enable:b", | |
7fad30f0 | 619 | .mhandler.cmd_new = qmp_marshal_xen_set_global_dirty_log, |
39f42439 AP |
620 | }, |
621 | ||
622 | SQMP | |
623 | xen-set-global-dirty-log | |
624 | ------- | |
625 | ||
626 | Enable or disable the global dirty log mode. | |
627 | ||
628 | Arguments: | |
629 | ||
630 | - "enable": Enable it or disable it. | |
631 | ||
632 | Example: | |
633 | ||
634 | -> { "execute": "xen-set-global-dirty-log", | |
635 | "arguments": { "enable": true } } | |
636 | <- { "return": {} } | |
637 | ||
82a56f0d LC |
638 | EQMP |
639 | ||
640 | { | |
641 | .name = "migrate", | |
642 | .args_type = "detach:-d,blk:-b,inc:-i,uri:s", | |
7fad30f0 | 643 | .mhandler.cmd_new = qmp_marshal_migrate, |
82a56f0d LC |
644 | }, |
645 | ||
646 | SQMP | |
647 | migrate | |
648 | ------- | |
649 | ||
650 | Migrate to URI. | |
651 | ||
652 | Arguments: | |
653 | ||
654 | - "blk": block migration, full disk copy (json-bool, optional) | |
655 | - "inc": incremental disk copy (json-bool, optional) | |
656 | - "uri": Destination URI (json-string) | |
657 | ||
658 | Example: | |
659 | ||
660 | -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } } | |
661 | <- { "return": {} } | |
662 | ||
663 | Notes: | |
664 | ||
665 | (1) The 'query-migrate' command should be used to check migration's progress | |
666 | and final result (this information is provided by the 'status' member) | |
667 | (2) All boolean arguments default to false | |
668 | (3) The user Monitor's "detach" argument is invalid in QMP and should not | |
669 | be used | |
670 | ||
671 | EQMP | |
672 | ||
673 | { | |
674 | .name = "migrate_cancel", | |
675 | .args_type = "", | |
7fad30f0 | 676 | .mhandler.cmd_new = qmp_marshal_migrate_cancel, |
82a56f0d LC |
677 | }, |
678 | ||
679 | SQMP | |
680 | migrate_cancel | |
681 | -------------- | |
682 | ||
683 | Cancel the current migration. | |
684 | ||
685 | Arguments: None. | |
686 | ||
687 | Example: | |
688 | ||
689 | -> { "execute": "migrate_cancel" } | |
690 | <- { "return": {} } | |
691 | ||
9e1ba4cc | 692 | EQMP |
bf1ae1f4 DDAG |
693 | |
694 | { | |
695 | .name = "migrate-incoming", | |
696 | .args_type = "uri:s", | |
7fad30f0 | 697 | .mhandler.cmd_new = qmp_marshal_migrate_incoming, |
bf1ae1f4 DDAG |
698 | }, |
699 | ||
700 | SQMP | |
701 | migrate-incoming | |
702 | ---------------- | |
703 | ||
704 | Continue an incoming migration | |
705 | ||
706 | Arguments: | |
707 | ||
708 | - "uri": Source/listening URI (json-string) | |
709 | ||
710 | Example: | |
711 | ||
712 | -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } } | |
713 | <- { "return": {} } | |
714 | ||
715 | Notes: | |
716 | ||
717 | (1) QEMU must be started with -incoming defer to allow migrate-incoming to | |
718 | be used | |
4aab6282 | 719 | (2) The uri format is the same as for -incoming |
bf1ae1f4 DDAG |
720 | |
721 | EQMP | |
722 | { | |
9e1ba4cc OW |
723 | .name = "migrate-set-cache-size", |
724 | .args_type = "value:o", | |
7fad30f0 | 725 | .mhandler.cmd_new = qmp_marshal_migrate_set_cache_size, |
9e1ba4cc OW |
726 | }, |
727 | ||
728 | SQMP | |
729 | migrate-set-cache-size | |
817c6045 | 730 | ---------------------- |
9e1ba4cc OW |
731 | |
732 | Set cache size to be used by XBZRLE migration, the cache size will be rounded | |
733 | down to the nearest power of 2 | |
734 | ||
735 | Arguments: | |
736 | ||
737 | - "value": cache size in bytes (json-int) | |
738 | ||
739 | Example: | |
740 | ||
741 | -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } } | |
742 | <- { "return": {} } | |
743 | ||
744 | EQMP | |
4886a1bc DDAG |
745 | { |
746 | .name = "migrate-start-postcopy", | |
747 | .args_type = "", | |
748 | .mhandler.cmd_new = qmp_marshal_migrate_start_postcopy, | |
749 | }, | |
750 | ||
751 | SQMP | |
752 | migrate-start-postcopy | |
753 | ---------------------- | |
754 | ||
755 | Switch an in-progress migration to postcopy mode. Ignored after the end of | |
756 | migration (or once already in postcopy). | |
757 | ||
758 | Example: | |
759 | -> { "execute": "migrate-start-postcopy" } | |
760 | <- { "return": {} } | |
761 | ||
762 | EQMP | |
763 | ||
9e1ba4cc OW |
764 | { |
765 | .name = "query-migrate-cache-size", | |
766 | .args_type = "", | |
7fad30f0 | 767 | .mhandler.cmd_new = qmp_marshal_query_migrate_cache_size, |
9e1ba4cc OW |
768 | }, |
769 | ||
770 | SQMP | |
771 | query-migrate-cache-size | |
817c6045 | 772 | ------------------------ |
9e1ba4cc OW |
773 | |
774 | Show cache size to be used by XBZRLE migration | |
775 | ||
776 | returns a json-object with the following information: | |
777 | - "size" : json-int | |
778 | ||
779 | Example: | |
780 | ||
781 | -> { "execute": "query-migrate-cache-size" } | |
782 | <- { "return": 67108864 } | |
783 | ||
82a56f0d LC |
784 | EQMP |
785 | ||
786 | { | |
787 | .name = "migrate_set_speed", | |
3a019b6e | 788 | .args_type = "value:o", |
7fad30f0 | 789 | .mhandler.cmd_new = qmp_marshal_migrate_set_speed, |
82a56f0d LC |
790 | }, |
791 | ||
e866e239 | 792 | SQMP |
ff73edf5 JS |
793 | migrate_set_speed |
794 | ----------------- | |
e866e239 | 795 | |
ff73edf5 | 796 | Set maximum speed for migrations. |
e866e239 GH |
797 | |
798 | Arguments: | |
799 | ||
ff73edf5 | 800 | - "value": maximum speed, in bytes per second (json-int) |
e866e239 GH |
801 | |
802 | Example: | |
803 | ||
ff73edf5 | 804 | -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } } |
e866e239 GH |
805 | <- { "return": {} } |
806 | ||
807 | EQMP | |
808 | ||
809 | { | |
ff73edf5 JS |
810 | .name = "migrate_set_downtime", |
811 | .args_type = "value:T", | |
7fad30f0 | 812 | .mhandler.cmd_new = qmp_marshal_migrate_set_downtime, |
e866e239 GH |
813 | }, |
814 | ||
82a56f0d | 815 | SQMP |
ff73edf5 JS |
816 | migrate_set_downtime |
817 | -------------------- | |
82a56f0d | 818 | |
ff73edf5 | 819 | Set maximum tolerated downtime (in seconds) for migrations. |
82a56f0d LC |
820 | |
821 | Arguments: | |
822 | ||
ff73edf5 | 823 | - "value": maximum downtime (json-number) |
82a56f0d LC |
824 | |
825 | Example: | |
826 | ||
ff73edf5 | 827 | -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } } |
82a56f0d LC |
828 | <- { "return": {} } |
829 | ||
830 | EQMP | |
831 | ||
832 | { | |
ff73edf5 JS |
833 | .name = "client_migrate_info", |
834 | .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?", | |
835 | .params = "protocol hostname port tls-port cert-subject", | |
13cadefb | 836 | .help = "set migration information for remote display", |
7fad30f0 | 837 | .mhandler.cmd_new = qmp_marshal_client_migrate_info, |
82a56f0d LC |
838 | }, |
839 | ||
840 | SQMP | |
ff73edf5 | 841 | client_migrate_info |
13cadefb | 842 | ------------------- |
82a56f0d | 843 | |
13cadefb MA |
844 | Set migration information for remote display. This makes the server |
845 | ask the client to automatically reconnect using the new parameters | |
846 | once migration finished successfully. Only implemented for SPICE. | |
82a56f0d LC |
847 | |
848 | Arguments: | |
849 | ||
13cadefb | 850 | - "protocol": must be "spice" (json-string) |
ff73edf5 | 851 | - "hostname": migration target hostname (json-string) |
13cadefb | 852 | - "port": spice tcp port for plaintext channels (json-int, optional) |
ff73edf5 JS |
853 | - "tls-port": spice tcp port for tls-secured channels (json-int, optional) |
854 | - "cert-subject": server certificate subject (json-string, optional) | |
82a56f0d LC |
855 | |
856 | Example: | |
857 | ||
ff73edf5 JS |
858 | -> { "execute": "client_migrate_info", |
859 | "arguments": { "protocol": "spice", | |
860 | "hostname": "virt42.lab.kraxel.org", | |
861 | "port": 1234 } } | |
82a56f0d LC |
862 | <- { "return": {} } |
863 | ||
783e9b48 WC |
864 | EQMP |
865 | ||
866 | { | |
867 | .name = "dump-guest-memory", | |
228de9cf PX |
868 | .args_type = "paging:b,protocol:s,detach:b?,begin:i?,end:i?,format:s?", |
869 | .params = "-p protocol [-d] [begin] [length] [format]", | |
783e9b48 | 870 | .help = "dump guest memory to file", |
7fad30f0 | 871 | .mhandler.cmd_new = qmp_marshal_dump_guest_memory, |
783e9b48 WC |
872 | }, |
873 | ||
874 | SQMP | |
875 | dump | |
876 | ||
877 | ||
878 | Dump guest memory to file. The file can be processed with crash or gdb. | |
879 | ||
880 | Arguments: | |
881 | ||
882 | - "paging": do paging to get guest's memory mapping (json-bool) | |
883 | - "protocol": destination file(started with "file:") or destination file | |
884 | descriptor (started with "fd:") (json-string) | |
228de9cf | 885 | - "detach": if specified, command will return immediately, without waiting |
39ba2ea6 PX |
886 | for the dump to finish. The user can track progress using |
887 | "query-dump". (json-bool) | |
783e9b48 WC |
888 | - "begin": the starting physical address. It's optional, and should be specified |
889 | with length together (json-int) | |
890 | - "length": the memory size, in bytes. It's optional, and should be specified | |
891 | with begin together (json-int) | |
b53ccc30 QN |
892 | - "format": the format of guest memory dump. It's optional, and can be |
893 | elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will | |
894 | conflict with paging and filter, ie. begin and length (json-string) | |
783e9b48 WC |
895 | |
896 | Example: | |
897 | ||
898 | -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } } | |
899 | <- { "return": {} } | |
900 | ||
901 | Notes: | |
902 | ||
903 | (1) All boolean arguments default to false | |
904 | ||
7d6dc7f3 QN |
905 | EQMP |
906 | ||
907 | { | |
908 | .name = "query-dump-guest-memory-capability", | |
909 | .args_type = "", | |
7fad30f0 | 910 | .mhandler.cmd_new = qmp_marshal_query_dump_guest_memory_capability, |
7d6dc7f3 QN |
911 | }, |
912 | ||
913 | SQMP | |
914 | query-dump-guest-memory-capability | |
915 | ---------- | |
916 | ||
917 | Show available formats for 'dump-guest-memory' | |
918 | ||
919 | Example: | |
920 | ||
921 | -> { "execute": "query-dump-guest-memory-capability" } | |
922 | <- { "return": { "formats": | |
923 | ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] } | |
924 | ||
39ba2ea6 PX |
925 | EQMP |
926 | ||
927 | { | |
928 | .name = "query-dump", | |
929 | .args_type = "", | |
930 | .params = "", | |
931 | .help = "query background dump status", | |
932 | .mhandler.cmd_new = qmp_marshal_query_dump, | |
933 | }, | |
934 | ||
935 | SQMP | |
936 | query-dump | |
937 | ---------- | |
938 | ||
939 | Query background dump status. | |
940 | ||
941 | Arguments: None. | |
942 | ||
943 | Example: | |
944 | ||
945 | -> { "execute": "query-dump" } | |
946 | <- { "return": { "status": "active", "completed": 1024000, | |
947 | "total": 2048000 } } | |
948 | ||
7ee0c3e3 JH |
949 | EQMP |
950 | ||
951 | #if defined TARGET_S390X | |
952 | { | |
953 | .name = "dump-skeys", | |
954 | .args_type = "filename:F", | |
7fad30f0 | 955 | .mhandler.cmd_new = qmp_marshal_dump_skeys, |
7ee0c3e3 JH |
956 | }, |
957 | #endif | |
958 | ||
959 | SQMP | |
960 | dump-skeys | |
961 | ---------- | |
962 | ||
963 | Save guest storage keys to file. | |
964 | ||
965 | Arguments: | |
966 | ||
967 | - "filename": file path (json-string) | |
968 | ||
969 | Example: | |
970 | ||
971 | -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } } | |
972 | <- { "return": {} } | |
973 | ||
82a56f0d LC |
974 | EQMP |
975 | ||
976 | { | |
977 | .name = "netdev_add", | |
978 | .args_type = "netdev:O", | |
928059a3 | 979 | .mhandler.cmd_new = qmp_netdev_add, |
82a56f0d LC |
980 | }, |
981 | ||
982 | SQMP | |
983 | netdev_add | |
984 | ---------- | |
985 | ||
986 | Add host network device. | |
987 | ||
988 | Arguments: | |
989 | ||
990 | - "type": the device type, "tap", "user", ... (json-string) | |
991 | - "id": the device's ID, must be unique (json-string) | |
992 | - device options | |
993 | ||
994 | Example: | |
995 | ||
b8a98326 MA |
996 | -> { "execute": "netdev_add", |
997 | "arguments": { "type": "user", "id": "netdev1", | |
998 | "dnssearch": "example.org" } } | |
82a56f0d LC |
999 | <- { "return": {} } |
1000 | ||
af347aa5 | 1001 | Note: The supported device options are the same ones supported by the '-netdev' |
82a56f0d LC |
1002 | command-line argument, which are listed in the '-help' output or QEMU's |
1003 | manual | |
1004 | ||
1005 | EQMP | |
1006 | ||
1007 | { | |
1008 | .name = "netdev_del", | |
1009 | .args_type = "id:s", | |
7fad30f0 | 1010 | .mhandler.cmd_new = qmp_marshal_netdev_del, |
82a56f0d LC |
1011 | }, |
1012 | ||
1013 | SQMP | |
1014 | netdev_del | |
1015 | ---------- | |
1016 | ||
1017 | Remove host network device. | |
1018 | ||
1019 | Arguments: | |
1020 | ||
1021 | - "id": the device's ID, must be unique (json-string) | |
1022 | ||
1023 | Example: | |
1024 | ||
1025 | -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } } | |
1026 | <- { "return": {} } | |
1027 | ||
6d4a2b3a | 1028 | |
cff8b2c6 PB |
1029 | EQMP |
1030 | ||
1031 | { | |
1032 | .name = "object-add", | |
1033 | .args_type = "qom-type:s,id:s,props:q?", | |
6eb3937e | 1034 | .mhandler.cmd_new = qmp_marshal_object_add, |
cff8b2c6 PB |
1035 | }, |
1036 | ||
1037 | SQMP | |
1038 | object-add | |
1039 | ---------- | |
1040 | ||
1041 | Create QOM object. | |
1042 | ||
1043 | Arguments: | |
1044 | ||
1045 | - "qom-type": the object's QOM type, i.e. the class name (json-string) | |
1046 | - "id": the object's ID, must be unique (json-string) | |
1047 | - "props": a dictionary of object property values (optional, json-dict) | |
1048 | ||
1049 | Example: | |
1050 | ||
1051 | -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1", | |
1052 | "props": { "filename": "/dev/hwrng" } } } | |
1053 | <- { "return": {} } | |
1054 | ||
6d4a2b3a CH |
1055 | EQMP |
1056 | ||
ab2d0531 PB |
1057 | { |
1058 | .name = "object-del", | |
1059 | .args_type = "id:s", | |
7fad30f0 | 1060 | .mhandler.cmd_new = qmp_marshal_object_del, |
ab2d0531 PB |
1061 | }, |
1062 | ||
1063 | SQMP | |
1064 | object-del | |
1065 | ---------- | |
1066 | ||
1067 | Remove QOM object. | |
1068 | ||
1069 | Arguments: | |
1070 | ||
1071 | - "id": the object's ID (json-string) | |
1072 | ||
1073 | Example: | |
1074 | ||
1075 | -> { "execute": "object-del", "arguments": { "id": "rng1" } } | |
1076 | <- { "return": {} } | |
1077 | ||
1078 | ||
1079 | EQMP | |
1080 | ||
1081 | ||
6d4a2b3a CH |
1082 | { |
1083 | .name = "block_resize", | |
3b1dbd11 | 1084 | .args_type = "device:s?,node-name:s?,size:o", |
7fad30f0 | 1085 | .mhandler.cmd_new = qmp_marshal_block_resize, |
6d4a2b3a CH |
1086 | }, |
1087 | ||
1088 | SQMP | |
1089 | block_resize | |
1090 | ------------ | |
1091 | ||
1092 | Resize a block image while a guest is running. | |
1093 | ||
1094 | Arguments: | |
1095 | ||
1096 | - "device": the device's ID, must be unique (json-string) | |
3b1dbd11 | 1097 | - "node-name": the node name in the block driver state graph (json-string) |
6d4a2b3a CH |
1098 | - "size": new size |
1099 | ||
1100 | Example: | |
1101 | ||
1102 | -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } } | |
1103 | <- { "return": {} } | |
1104 | ||
d967b2f1 JS |
1105 | EQMP |
1106 | ||
12bd451f | 1107 | { |
db58f9c0 | 1108 | .name = "block-stream", |
13d8cc51 | 1109 | .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?", |
7fad30f0 | 1110 | .mhandler.cmd_new = qmp_marshal_block_stream, |
12bd451f SH |
1111 | }, |
1112 | ||
ec683d60 SH |
1113 | SQMP |
1114 | block-stream | |
1115 | ------------ | |
1116 | ||
1117 | Copy data from a backing file into a block device. | |
1118 | ||
1119 | Arguments: | |
1120 | ||
1121 | - "device": The device's ID, must be unique (json-string) | |
1122 | - "base": The file name of the backing image above which copying starts | |
1123 | (json-string, optional) | |
1124 | - "backing-file": The backing file string to write into the active layer. This | |
1125 | filename is not validated. | |
1126 | ||
1127 | If a pathname string is such that it cannot be resolved by | |
1128 | QEMU, that means that subsequent QMP or HMP commands must use | |
1129 | node-names for the image in question, as filename lookup | |
1130 | methods will fail. | |
1131 | ||
1132 | If not specified, QEMU will automatically determine the | |
1133 | backing file string to use, or error out if there is no | |
1134 | obvious choice. Care should be taken when specifying the | |
1135 | string, to specify a valid filename or protocol. | |
1136 | (json-string, optional) (Since 2.1) | |
1137 | - "speed": the maximum speed, in bytes per second (json-int, optional) | |
1138 | - "on-error": the action to take on an error (default 'report'). 'stop' and | |
1139 | 'enospc' can only be used if the block device supports io-status. | |
1140 | (json-string, optional) (Since 2.1) | |
1141 | ||
1142 | Example: | |
1143 | ||
1144 | -> { "execute": "block-stream", "arguments": { "device": "virtio0", | |
1145 | "base": "/tmp/master.qcow2" } } | |
1146 | <- { "return": {} } | |
1147 | ||
1148 | EQMP | |
1149 | ||
ed61fc10 JC |
1150 | { |
1151 | .name = "block-commit", | |
54e26900 | 1152 | .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?", |
7fad30f0 | 1153 | .mhandler.cmd_new = qmp_marshal_block_commit, |
ed61fc10 JC |
1154 | }, |
1155 | ||
37222900 JC |
1156 | SQMP |
1157 | block-commit | |
1158 | ------------ | |
1159 | ||
1160 | Live commit of data from overlay image nodes into backing nodes - i.e., writes | |
1161 | data between 'top' and 'base' into 'base'. | |
1162 | ||
1163 | Arguments: | |
1164 | ||
1165 | - "device": The device's ID, must be unique (json-string) | |
1166 | - "base": The file name of the backing image to write data into. | |
1167 | If not specified, this is the deepest backing image | |
1168 | (json-string, optional) | |
1169 | - "top": The file name of the backing image within the image chain, | |
7676e2c5 JC |
1170 | which contains the topmost data to be committed down. If |
1171 | not specified, this is the active layer. (json-string, optional) | |
37222900 | 1172 | |
54e26900 JC |
1173 | - backing-file: The backing file string to write into the overlay |
1174 | image of 'top'. If 'top' is the active layer, | |
1175 | specifying a backing file string is an error. This | |
1176 | filename is not validated. | |
1177 | ||
1178 | If a pathname string is such that it cannot be | |
1179 | resolved by QEMU, that means that subsequent QMP or | |
1180 | HMP commands must use node-names for the image in | |
1181 | question, as filename lookup methods will fail. | |
1182 | ||
1183 | If not specified, QEMU will automatically determine | |
1184 | the backing file string to use, or error out if | |
1185 | there is no obvious choice. Care should be taken | |
1186 | when specifying the string, to specify a valid | |
1187 | filename or protocol. | |
1188 | (json-string, optional) (Since 2.1) | |
1189 | ||
37222900 JC |
1190 | If top == base, that is an error. |
1191 | If top == active, the job will not be completed by itself, | |
1192 | user needs to complete the job with the block-job-complete | |
1193 | command after getting the ready event. (Since 2.0) | |
1194 | ||
1195 | If the base image is smaller than top, then the base image | |
1196 | will be resized to be the same size as top. If top is | |
1197 | smaller than the base image, the base will not be | |
1198 | truncated. If you want the base image size to match the | |
1199 | size of the smaller top, you can safely truncate it | |
1200 | yourself once the commit operation successfully completes. | |
1201 | (json-string) | |
1202 | - "speed": the maximum speed, in bytes per second (json-int, optional) | |
1203 | ||
1204 | ||
1205 | Example: | |
1206 | ||
1207 | -> { "execute": "block-commit", "arguments": { "device": "virtio0", | |
1208 | "top": "/tmp/snap1.qcow2" } } | |
1209 | <- { "return": {} } | |
1210 | ||
1211 | EQMP | |
1212 | ||
99a9addf SH |
1213 | { |
1214 | .name = "drive-backup", | |
b53169ea | 1215 | .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?," |
d58d8453 | 1216 | "bitmap:s?,on-source-error:s?,on-target-error:s?", |
7fad30f0 | 1217 | .mhandler.cmd_new = qmp_marshal_drive_backup, |
99a9addf SH |
1218 | }, |
1219 | ||
1220 | SQMP | |
1221 | drive-backup | |
1222 | ------------ | |
1223 | ||
1224 | Start a point-in-time copy of a block device to a new destination. The | |
1225 | status of ongoing drive-backup operations can be checked with | |
1226 | query-block-jobs where the BlockJobInfo.type field has the value 'backup'. | |
1227 | The operation can be stopped before it has completed using the | |
1228 | block-job-cancel command. | |
1229 | ||
1230 | Arguments: | |
1231 | ||
1232 | - "device": the name of the device which should be copied. | |
1233 | (json-string) | |
1234 | - "target": the target of the new image. If the file exists, or if it is a | |
1235 | device, the existing file/device will be used as the new | |
1236 | destination. If it does not exist, a new file will be created. | |
1237 | (json-string) | |
1238 | - "format": the format of the new destination, default is to probe if 'mode' is | |
1239 | 'existing', else the format of the source | |
1240 | (json-string, optional) | |
b53169ea SH |
1241 | - "sync": what parts of the disk image should be copied to the destination; |
1242 | possibilities include "full" for all the disk, "top" for only the sectors | |
4b80ab2b | 1243 | allocated in the topmost image, "incremental" for only the dirty sectors in |
d58d8453 | 1244 | the bitmap, or "none" to only replicate new I/O (MirrorSyncMode). |
4b80ab2b JS |
1245 | - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync |
1246 | is "incremental", must NOT be present otherwise. | |
99a9addf SH |
1247 | - "mode": whether and how QEMU should create a new image |
1248 | (NewImageMode, optional, default 'absolute-paths') | |
1249 | - "speed": the maximum speed, in bytes per second (json-int, optional) | |
1250 | - "on-source-error": the action to take on an error on the source, default | |
1251 | 'report'. 'stop' and 'enospc' can only be used | |
1252 | if the block device supports io-status. | |
1253 | (BlockdevOnError, optional) | |
1254 | - "on-target-error": the action to take on an error on the target, default | |
1255 | 'report' (no limitations, since this applies to | |
1256 | a different block device than device). | |
1257 | (BlockdevOnError, optional) | |
1258 | ||
1259 | Example: | |
1260 | -> { "execute": "drive-backup", "arguments": { "device": "drive0", | |
fc5d3f84 | 1261 | "sync": "full", |
99a9addf SH |
1262 | "target": "backup.img" } } |
1263 | <- { "return": {} } | |
c29c1dd3 FZ |
1264 | |
1265 | EQMP | |
1266 | ||
1267 | { | |
1268 | .name = "blockdev-backup", | |
1269 | .args_type = "sync:s,device:B,target:B,speed:i?," | |
1270 | "on-source-error:s?,on-target-error:s?", | |
7fad30f0 | 1271 | .mhandler.cmd_new = qmp_marshal_blockdev_backup, |
c29c1dd3 FZ |
1272 | }, |
1273 | ||
1274 | SQMP | |
1275 | blockdev-backup | |
1276 | --------------- | |
1277 | ||
1278 | The device version of drive-backup: this command takes an existing named device | |
1279 | as backup target. | |
1280 | ||
1281 | Arguments: | |
1282 | ||
1283 | - "device": the name of the device which should be copied. | |
1284 | (json-string) | |
1285 | - "target": the name of the backup target device. (json-string) | |
1286 | - "sync": what parts of the disk image should be copied to the destination; | |
1287 | possibilities include "full" for all the disk, "top" for only the | |
1288 | sectors allocated in the topmost image, or "none" to only replicate | |
1289 | new I/O (MirrorSyncMode). | |
1290 | - "speed": the maximum speed, in bytes per second (json-int, optional) | |
1291 | - "on-source-error": the action to take on an error on the source, default | |
1292 | 'report'. 'stop' and 'enospc' can only be used | |
1293 | if the block device supports io-status. | |
1294 | (BlockdevOnError, optional) | |
1295 | - "on-target-error": the action to take on an error on the target, default | |
1296 | 'report' (no limitations, since this applies to | |
1297 | a different block device than device). | |
1298 | (BlockdevOnError, optional) | |
1299 | ||
1300 | Example: | |
1301 | -> { "execute": "blockdev-backup", "arguments": { "device": "src-id", | |
1302 | "sync": "full", | |
1303 | "target": "tgt-id" } } | |
1304 | <- { "return": {} } | |
1305 | ||
99a9addf SH |
1306 | EQMP |
1307 | ||
2d47c6e9 | 1308 | { |
db58f9c0 | 1309 | .name = "block-job-set-speed", |
882ec7ce | 1310 | .args_type = "device:B,speed:o", |
7fad30f0 | 1311 | .mhandler.cmd_new = qmp_marshal_block_job_set_speed, |
2d47c6e9 SH |
1312 | }, |
1313 | ||
370521a1 | 1314 | { |
db58f9c0 | 1315 | .name = "block-job-cancel", |
6e37fb81 | 1316 | .args_type = "device:B,force:b?", |
7fad30f0 | 1317 | .mhandler.cmd_new = qmp_marshal_block_job_cancel, |
370521a1 | 1318 | }, |
6e37fb81 PB |
1319 | { |
1320 | .name = "block-job-pause", | |
1321 | .args_type = "device:B", | |
7fad30f0 | 1322 | .mhandler.cmd_new = qmp_marshal_block_job_pause, |
6e37fb81 PB |
1323 | }, |
1324 | { | |
1325 | .name = "block-job-resume", | |
1326 | .args_type = "device:B", | |
7fad30f0 | 1327 | .mhandler.cmd_new = qmp_marshal_block_job_resume, |
6e37fb81 | 1328 | }, |
aeae883b PB |
1329 | { |
1330 | .name = "block-job-complete", | |
1331 | .args_type = "device:B", | |
7fad30f0 | 1332 | .mhandler.cmd_new = qmp_marshal_block_job_complete, |
aeae883b | 1333 | }, |
c186402c | 1334 | { |
52e7c241 | 1335 | .name = "transaction", |
94d16a64 | 1336 | .args_type = "actions:q,properties:q?", |
7fad30f0 | 1337 | .mhandler.cmd_new = qmp_marshal_transaction, |
c186402c JC |
1338 | }, |
1339 | ||
1340 | SQMP | |
52e7c241 PB |
1341 | transaction |
1342 | ----------- | |
c186402c | 1343 | |
a910523a KC |
1344 | Atomically operate on one or more block devices. Operations that are |
1345 | currently supported: | |
1346 | ||
1347 | - drive-backup | |
1348 | - blockdev-backup | |
1349 | - blockdev-snapshot-sync | |
1350 | - blockdev-snapshot-internal-sync | |
1351 | - abort | |
1352 | - block-dirty-bitmap-add | |
1353 | - block-dirty-bitmap-clear | |
1354 | ||
1355 | Refer to the qemu/qapi-schema.json file for minimum required QEMU | |
1356 | versions for these operations. A list of dictionaries is accepted, | |
1357 | that contains the actions to be performed. If there is any failure | |
1358 | performing any of the operations, all operations for the group are | |
1359 | abandoned. | |
c186402c | 1360 | |
bbe86010 WX |
1361 | For external snapshots, the dictionary contains the device, the file to use for |
1362 | the new snapshot, and the format. The default format, if not specified, is | |
1363 | qcow2. | |
c186402c | 1364 | |
bc8b094f PB |
1365 | Each new snapshot defaults to being created by QEMU (wiping any |
1366 | contents if the file already exists), but it is also possible to reuse | |
1367 | an externally-created file. In the latter case, you should ensure that | |
1368 | the new image file has the same contents as the current one; QEMU cannot | |
1369 | perform any meaningful check. Typically this is achieved by using the | |
1370 | current image file as the backing file for the new image. | |
1371 | ||
bbe86010 WX |
1372 | On failure, the original disks pre-snapshot attempt will be used. |
1373 | ||
1374 | For internal snapshots, the dictionary contains the device and the snapshot's | |
1375 | name. If an internal snapshot matching name already exists, the request will | |
1376 | be rejected. Only some image formats support it, for example, qcow2, rbd, | |
1377 | and sheepdog. | |
1378 | ||
1379 | On failure, qemu will try delete the newly created internal snapshot in the | |
1380 | transaction. When an I/O error occurs during deletion, the user needs to fix | |
1381 | it later with qemu-img or other command. | |
1382 | ||
c186402c JC |
1383 | Arguments: |
1384 | ||
52e7c241 | 1385 | actions array: |
a910523a KC |
1386 | - "type": the operation to perform (json-string). Possible |
1387 | values: "drive-backup", "blockdev-backup", | |
1388 | "blockdev-snapshot-sync", | |
1389 | "blockdev-snapshot-internal-sync", | |
1390 | "abort", "block-dirty-bitmap-add", | |
1391 | "block-dirty-bitmap-clear" | |
52e7c241 PB |
1392 | - "data": a dictionary. The contents depend on the value |
1393 | of "type". When "type" is "blockdev-snapshot-sync": | |
1394 | - "device": device name to snapshot (json-string) | |
0901f67e | 1395 | - "node-name": graph node name to snapshot (json-string) |
52e7c241 | 1396 | - "snapshot-file": name of new image file (json-string) |
0901f67e | 1397 | - "snapshot-node-name": graph node name of the new snapshot (json-string) |
52e7c241 | 1398 | - "format": format of new image (json-string, optional) |
bc8b094f PB |
1399 | - "mode": whether and how QEMU should create the snapshot file |
1400 | (NewImageMode, optional, default "absolute-paths") | |
bbe86010 WX |
1401 | When "type" is "blockdev-snapshot-internal-sync": |
1402 | - "device": device name to snapshot (json-string) | |
1403 | - "name": name of the new snapshot (json-string) | |
c186402c JC |
1404 | |
1405 | Example: | |
1406 | ||
52e7c241 PB |
1407 | -> { "execute": "transaction", |
1408 | "arguments": { "actions": [ | |
cd0c5389 | 1409 | { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0", |
52e7c241 PB |
1410 | "snapshot-file": "/some/place/my-image", |
1411 | "format": "qcow2" } }, | |
cd0c5389 | 1412 | { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile", |
0901f67e BC |
1413 | "snapshot-file": "/some/place/my-image2", |
1414 | "snapshot-node-name": "node3432", | |
1415 | "mode": "existing", | |
1416 | "format": "qcow2" } }, | |
cd0c5389 | 1417 | { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1", |
52e7c241 | 1418 | "snapshot-file": "/some/place/my-image2", |
bc8b094f | 1419 | "mode": "existing", |
bbe86010 | 1420 | "format": "qcow2" } }, |
cd0c5389 | 1421 | { "type": "blockdev-snapshot-internal-sync", "data" : { |
bbe86010 WX |
1422 | "device": "ide-hd2", |
1423 | "name": "snapshot0" } } ] } } | |
c186402c JC |
1424 | <- { "return": {} } |
1425 | ||
341ebc2f JS |
1426 | EQMP |
1427 | ||
1428 | { | |
1429 | .name = "block-dirty-bitmap-add", | |
1430 | .args_type = "node:B,name:s,granularity:i?", | |
7fad30f0 | 1431 | .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_add, |
341ebc2f JS |
1432 | }, |
1433 | ||
1434 | SQMP | |
1435 | ||
1436 | block-dirty-bitmap-add | |
1437 | ---------------------- | |
1438 | Since 2.4 | |
1439 | ||
1440 | Create a dirty bitmap with a name on the device, and start tracking the writes. | |
1441 | ||
1442 | Arguments: | |
1443 | ||
1444 | - "node": device/node on which to create dirty bitmap (json-string) | |
1445 | - "name": name of the new dirty bitmap (json-string) | |
1446 | - "granularity": granularity to track writes with (int, optional) | |
1447 | ||
1448 | Example: | |
1449 | ||
1450 | -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0", | |
1451 | "name": "bitmap0" } } | |
1452 | <- { "return": {} } | |
1453 | ||
1454 | EQMP | |
1455 | ||
1456 | { | |
1457 | .name = "block-dirty-bitmap-remove", | |
1458 | .args_type = "node:B,name:s", | |
7fad30f0 | 1459 | .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_remove, |
341ebc2f JS |
1460 | }, |
1461 | ||
1462 | SQMP | |
1463 | ||
1464 | block-dirty-bitmap-remove | |
1465 | ------------------------- | |
1466 | Since 2.4 | |
1467 | ||
1468 | Stop write tracking and remove the dirty bitmap that was created with | |
1469 | block-dirty-bitmap-add. | |
1470 | ||
1471 | Arguments: | |
1472 | ||
1473 | - "node": device/node on which to remove dirty bitmap (json-string) | |
1474 | - "name": name of the dirty bitmap to remove (json-string) | |
1475 | ||
1476 | Example: | |
1477 | ||
1478 | -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0", | |
1479 | "name": "bitmap0" } } | |
1480 | <- { "return": {} } | |
1481 | ||
e74e6b78 JS |
1482 | EQMP |
1483 | ||
1484 | { | |
1485 | .name = "block-dirty-bitmap-clear", | |
1486 | .args_type = "node:B,name:s", | |
7fad30f0 | 1487 | .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_clear, |
e74e6b78 JS |
1488 | }, |
1489 | ||
1490 | SQMP | |
1491 | ||
1492 | block-dirty-bitmap-clear | |
1493 | ------------------------ | |
1494 | Since 2.4 | |
1495 | ||
1496 | Reset the dirty bitmap associated with a node so that an incremental backup | |
1497 | from this point in time forward will only backup clusters modified after this | |
1498 | clear operation. | |
1499 | ||
1500 | Arguments: | |
1501 | ||
1502 | - "node": device/node on which to remove dirty bitmap (json-string) | |
1503 | - "name": name of the dirty bitmap to remove (json-string) | |
1504 | ||
1505 | Example: | |
1506 | ||
1507 | -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0", | |
1508 | "name": "bitmap0" } } | |
1509 | <- { "return": {} } | |
1510 | ||
c186402c | 1511 | EQMP |
370521a1 | 1512 | |
d967b2f1 JS |
1513 | { |
1514 | .name = "blockdev-snapshot-sync", | |
0901f67e | 1515 | .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?", |
7fad30f0 | 1516 | .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_sync, |
d967b2f1 JS |
1517 | }, |
1518 | ||
1519 | SQMP | |
1520 | blockdev-snapshot-sync | |
1521 | ---------------------- | |
1522 | ||
1523 | Synchronous snapshot of a block device. snapshot-file specifies the | |
1524 | target of the new image. If the file exists, or if it is a device, the | |
1525 | snapshot will be created in the existing file/device. If does not | |
1526 | exist, a new file will be created. format specifies the format of the | |
1527 | snapshot image, default is qcow2. | |
1528 | ||
1529 | Arguments: | |
1530 | ||
1531 | - "device": device name to snapshot (json-string) | |
0901f67e | 1532 | - "node-name": graph node name to snapshot (json-string) |
d967b2f1 | 1533 | - "snapshot-file": name of new image file (json-string) |
0901f67e | 1534 | - "snapshot-node-name": graph node name of the new snapshot (json-string) |
6cc2a415 PB |
1535 | - "mode": whether and how QEMU should create the snapshot file |
1536 | (NewImageMode, optional, default "absolute-paths") | |
d967b2f1 JS |
1537 | - "format": format of new image (json-string, optional) |
1538 | ||
1539 | Example: | |
1540 | ||
7f3850c2 LC |
1541 | -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0", |
1542 | "snapshot-file": | |
1543 | "/some/place/my-image", | |
1544 | "format": "qcow2" } } | |
d967b2f1 JS |
1545 | <- { "return": {} } |
1546 | ||
43de7e2d AG |
1547 | EQMP |
1548 | ||
1549 | { | |
1550 | .name = "blockdev-snapshot", | |
1551 | .args_type = "node:s,overlay:s", | |
1552 | .mhandler.cmd_new = qmp_marshal_blockdev_snapshot, | |
1553 | }, | |
1554 | ||
1555 | SQMP | |
1556 | blockdev-snapshot | |
1557 | ----------------- | |
1558 | Since 2.5 | |
1559 | ||
1560 | Create a snapshot, by installing 'node' as the backing image of | |
1561 | 'overlay'. Additionally, if 'node' is associated with a block | |
1562 | device, the block device changes to using 'overlay' as its new active | |
1563 | image. | |
1564 | ||
1565 | Arguments: | |
1566 | ||
1567 | - "node": device that will have a snapshot created (json-string) | |
1568 | - "overlay": device that will have 'node' as its backing image (json-string) | |
1569 | ||
1570 | Example: | |
1571 | ||
1572 | -> { "execute": "blockdev-add", | |
1573 | "arguments": { "options": { "driver": "qcow2", | |
1574 | "node-name": "node1534", | |
1575 | "file": { "driver": "file", | |
1576 | "filename": "hd1.qcow2" }, | |
1577 | "backing": "" } } } | |
1578 | ||
1579 | <- { "return": {} } | |
1580 | ||
1581 | -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0", | |
1582 | "overlay": "node1534" } } | |
1583 | <- { "return": {} } | |
1584 | ||
f323bc9e WX |
1585 | EQMP |
1586 | ||
1587 | { | |
1588 | .name = "blockdev-snapshot-internal-sync", | |
1589 | .args_type = "device:B,name:s", | |
7fad30f0 | 1590 | .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_internal_sync, |
f323bc9e WX |
1591 | }, |
1592 | ||
1593 | SQMP | |
1594 | blockdev-snapshot-internal-sync | |
1595 | ------------------------------- | |
1596 | ||
1597 | Synchronously take an internal snapshot of a block device when the format of | |
1598 | image used supports it. If the name is an empty string, or a snapshot with | |
1599 | name already exists, the operation will fail. | |
1600 | ||
1601 | Arguments: | |
1602 | ||
1603 | - "device": device name to snapshot (json-string) | |
1604 | - "name": name of the new snapshot (json-string) | |
1605 | ||
1606 | Example: | |
1607 | ||
1608 | -> { "execute": "blockdev-snapshot-internal-sync", | |
1609 | "arguments": { "device": "ide-hd0", | |
1610 | "name": "snapshot0" } | |
1611 | } | |
1612 | <- { "return": {} } | |
1613 | ||
44e3e053 WX |
1614 | EQMP |
1615 | ||
1616 | { | |
1617 | .name = "blockdev-snapshot-delete-internal-sync", | |
1618 | .args_type = "device:B,id:s?,name:s?", | |
1619 | .mhandler.cmd_new = | |
7fad30f0 | 1620 | qmp_marshal_blockdev_snapshot_delete_internal_sync, |
44e3e053 WX |
1621 | }, |
1622 | ||
1623 | SQMP | |
1624 | blockdev-snapshot-delete-internal-sync | |
1625 | -------------------------------------- | |
1626 | ||
1627 | Synchronously delete an internal snapshot of a block device when the format of | |
1628 | image used supports it. The snapshot is identified by name or id or both. One | |
1629 | of name or id is required. If the snapshot is not found, the operation will | |
1630 | fail. | |
1631 | ||
1632 | Arguments: | |
1633 | ||
1634 | - "device": device name (json-string) | |
1635 | - "id": ID of the snapshot (json-string, optional) | |
1636 | - "name": name of the snapshot (json-string, optional) | |
1637 | ||
1638 | Example: | |
1639 | ||
1640 | -> { "execute": "blockdev-snapshot-delete-internal-sync", | |
1641 | "arguments": { "device": "ide-hd0", | |
1642 | "name": "snapshot0" } | |
1643 | } | |
1644 | <- { "return": { | |
1645 | "id": "1", | |
1646 | "name": "snapshot0", | |
1647 | "vm-state-size": 0, | |
1648 | "date-sec": 1000012, | |
1649 | "date-nsec": 10, | |
1650 | "vm-clock-sec": 100, | |
1651 | "vm-clock-nsec": 20 | |
1652 | } | |
1653 | } | |
1654 | ||
d9b902db PB |
1655 | EQMP |
1656 | ||
1657 | { | |
1658 | .name = "drive-mirror", | |
b952b558 | 1659 | .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?," |
09158f00 | 1660 | "node-name:s?,replaces:s?," |
eee13dfe | 1661 | "on-source-error:s?,on-target-error:s?," |
0fc9f8ea | 1662 | "unmap:b?," |
08e4ed6c | 1663 | "granularity:i?,buf-size:i?", |
7fad30f0 | 1664 | .mhandler.cmd_new = qmp_marshal_drive_mirror, |
d9b902db PB |
1665 | }, |
1666 | ||
1667 | SQMP | |
1668 | drive-mirror | |
1669 | ------------ | |
1670 | ||
1671 | Start mirroring a block device's writes to a new destination. target | |
1672 | specifies the target of the new image. If the file exists, or if it is | |
1673 | a device, it will be used as the new destination for writes. If it does not | |
1674 | exist, a new file will be created. format specifies the format of the | |
1675 | mirror image, default is to probe if mode='existing', else the format | |
1676 | of the source. | |
1677 | ||
1678 | Arguments: | |
1679 | ||
1680 | - "device": device name to operate on (json-string) | |
1681 | - "target": name of new image file (json-string) | |
1682 | - "format": format of new image (json-string, optional) | |
4c828dc6 BC |
1683 | - "node-name": the name of the new block driver state in the node graph |
1684 | (json-string, optional) | |
09158f00 BC |
1685 | - "replaces": the block driver node name to replace when finished |
1686 | (json-string, optional) | |
d9b902db PB |
1687 | - "mode": how an image file should be created into the target |
1688 | file/device (NewImageMode, optional, default 'absolute-paths') | |
1689 | - "speed": maximum speed of the streaming job, in bytes per second | |
1690 | (json-int) | |
eee13dfe | 1691 | - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional) |
df92562e | 1692 | - "buf-size": maximum amount of data in flight from source to target, in bytes |
08e4ed6c | 1693 | (json-int, default 10M) |
d9b902db PB |
1694 | - "sync": what parts of the disk image should be copied to the destination; |
1695 | possibilities include "full" for all the disk, "top" for only the sectors | |
1696 | allocated in the topmost image, or "none" to only replicate new I/O | |
1697 | (MirrorSyncMode). | |
b952b558 PB |
1698 | - "on-source-error": the action to take on an error on the source |
1699 | (BlockdevOnError, default 'report') | |
1700 | - "on-target-error": the action to take on an error on the target | |
1701 | (BlockdevOnError, default 'report') | |
0fc9f8ea FZ |
1702 | - "unmap": whether the target sectors should be discarded where source has only |
1703 | zeroes. (json-bool, optional, default true) | |
b952b558 | 1704 | |
eee13dfe PB |
1705 | The default value of the granularity is the image cluster size clamped |
1706 | between 4096 and 65536, if the image format defines one. If the format | |
1707 | does not define a cluster size, the default value of the granularity | |
1708 | is 65536. | |
d9b902db PB |
1709 | |
1710 | ||
1711 | Example: | |
1712 | ||
1713 | -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0", | |
1714 | "target": "/some/place/my-image", | |
1715 | "sync": "full", | |
1716 | "format": "qcow2" } } | |
1717 | <- { "return": {} } | |
1718 | ||
fa40e656 JC |
1719 | EQMP |
1720 | ||
df92562e FZ |
1721 | { |
1722 | .name = "blockdev-mirror", | |
1723 | .args_type = "sync:s,device:B,target:B,replaces:s?,speed:i?," | |
1724 | "on-source-error:s?,on-target-error:s?," | |
1725 | "granularity:i?,buf-size:i?", | |
1726 | .mhandler.cmd_new = qmp_marshal_blockdev_mirror, | |
1727 | }, | |
1728 | ||
1729 | SQMP | |
1730 | blockdev-mirror | |
1731 | ------------ | |
1732 | ||
1733 | Start mirroring a block device's writes to another block device. target | |
1734 | specifies the target of mirror operation. | |
1735 | ||
1736 | Arguments: | |
1737 | ||
1738 | - "device": device name to operate on (json-string) | |
1739 | - "target": device name to mirror to (json-string) | |
1740 | - "replaces": the block driver node name to replace when finished | |
1741 | (json-string, optional) | |
1742 | - "speed": maximum speed of the streaming job, in bytes per second | |
1743 | (json-int) | |
1744 | - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional) | |
1745 | - "buf_size": maximum amount of data in flight from source to target, in bytes | |
1746 | (json-int, default 10M) | |
1747 | - "sync": what parts of the disk image should be copied to the destination; | |
1748 | possibilities include "full" for all the disk, "top" for only the sectors | |
1749 | allocated in the topmost image, or "none" to only replicate new I/O | |
1750 | (MirrorSyncMode). | |
1751 | - "on-source-error": the action to take on an error on the source | |
1752 | (BlockdevOnError, default 'report') | |
1753 | - "on-target-error": the action to take on an error on the target | |
1754 | (BlockdevOnError, default 'report') | |
1755 | ||
1756 | The default value of the granularity is the image cluster size clamped | |
1757 | between 4096 and 65536, if the image format defines one. If the format | |
1758 | does not define a cluster size, the default value of the granularity | |
1759 | is 65536. | |
1760 | ||
1761 | Example: | |
1762 | ||
1763 | -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0", | |
1764 | "target": "target0", | |
1765 | "sync": "full" } } | |
1766 | <- { "return": {} } | |
1767 | ||
1768 | EQMP | |
fa40e656 JC |
1769 | { |
1770 | .name = "change-backing-file", | |
1771 | .args_type = "device:s,image-node-name:s,backing-file:s", | |
7fad30f0 | 1772 | .mhandler.cmd_new = qmp_marshal_change_backing_file, |
fa40e656 JC |
1773 | }, |
1774 | ||
1775 | SQMP | |
1776 | change-backing-file | |
1777 | ------------------- | |
1778 | Since: 2.1 | |
1779 | ||
1780 | Change the backing file in the image file metadata. This does not cause | |
1781 | QEMU to reopen the image file to reparse the backing filename (it may, | |
1782 | however, perform a reopen to change permissions from r/o -> r/w -> r/o, | |
1783 | if needed). The new backing file string is written into the image file | |
1784 | metadata, and the QEMU internal strings are updated. | |
1785 | ||
1786 | Arguments: | |
1787 | ||
1788 | - "image-node-name": The name of the block driver state node of the | |
1789 | image to modify. The "device" is argument is used to | |
1790 | verify "image-node-name" is in the chain described by | |
1791 | "device". | |
1792 | (json-string, optional) | |
1793 | ||
1794 | - "device": The name of the device. | |
1795 | (json-string) | |
1796 | ||
1797 | - "backing-file": The string to write as the backing file. This string is | |
1798 | not validated, so care should be taken when specifying | |
1799 | the string or the image chain may not be able to be | |
1800 | reopened again. | |
1801 | (json-string) | |
1802 | ||
1803 | Returns: Nothing on success | |
1804 | If "device" does not exist or cannot be determined, DeviceNotFound | |
1805 | ||
82a56f0d LC |
1806 | EQMP |
1807 | ||
1808 | { | |
1809 | .name = "balloon", | |
1810 | .args_type = "value:M", | |
7fad30f0 | 1811 | .mhandler.cmd_new = qmp_marshal_balloon, |
82a56f0d LC |
1812 | }, |
1813 | ||
1814 | SQMP | |
1815 | balloon | |
1816 | ------- | |
1817 | ||
1818 | Request VM to change its memory allocation (in bytes). | |
1819 | ||
1820 | Arguments: | |
1821 | ||
1822 | - "value": New memory allocation (json-int) | |
1823 | ||
1824 | Example: | |
1825 | ||
1826 | -> { "execute": "balloon", "arguments": { "value": 536870912 } } | |
1827 | <- { "return": {} } | |
1828 | ||
1829 | EQMP | |
1830 | ||
1831 | { | |
1832 | .name = "set_link", | |
1833 | .args_type = "name:s,up:b", | |
7fad30f0 | 1834 | .mhandler.cmd_new = qmp_marshal_set_link, |
82a56f0d LC |
1835 | }, |
1836 | ||
1837 | SQMP | |
1838 | set_link | |
1839 | -------- | |
1840 | ||
1841 | Change the link status of a network adapter. | |
1842 | ||
1843 | Arguments: | |
1844 | ||
1845 | - "name": network device name (json-string) | |
1846 | - "up": status is up (json-bool) | |
1847 | ||
1848 | Example: | |
1849 | ||
1850 | -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } } | |
1851 | <- { "return": {} } | |
1852 | ||
1853 | EQMP | |
1854 | ||
1855 | { | |
1856 | .name = "getfd", | |
1857 | .args_type = "fdname:s", | |
1858 | .params = "getfd name", | |
1859 | .help = "receive a file descriptor via SCM rights and assign it a name", | |
7fad30f0 | 1860 | .mhandler.cmd_new = qmp_marshal_getfd, |
82a56f0d LC |
1861 | }, |
1862 | ||
1863 | SQMP | |
1864 | getfd | |
1865 | ----- | |
1866 | ||
1867 | Receive a file descriptor via SCM rights and assign it a name. | |
1868 | ||
1869 | Arguments: | |
1870 | ||
1871 | - "fdname": file descriptor name (json-string) | |
1872 | ||
1873 | Example: | |
1874 | ||
1875 | -> { "execute": "getfd", "arguments": { "fdname": "fd1" } } | |
1876 | <- { "return": {} } | |
1877 | ||
208c9d1b CB |
1878 | Notes: |
1879 | ||
1880 | (1) If the name specified by the "fdname" argument already exists, | |
1881 | the file descriptor assigned to it will be closed and replaced | |
1882 | by the received file descriptor. | |
1883 | (2) The 'closefd' command can be used to explicitly close the file | |
1884 | descriptor when it is no longer needed. | |
1885 | ||
82a56f0d LC |
1886 | EQMP |
1887 | ||
1888 | { | |
1889 | .name = "closefd", | |
1890 | .args_type = "fdname:s", | |
1891 | .params = "closefd name", | |
1892 | .help = "close a file descriptor previously passed via SCM rights", | |
7fad30f0 | 1893 | .mhandler.cmd_new = qmp_marshal_closefd, |
82a56f0d LC |
1894 | }, |
1895 | ||
1896 | SQMP | |
1897 | closefd | |
1898 | ------- | |
1899 | ||
1900 | Close a file descriptor previously passed via SCM rights. | |
1901 | ||
1902 | Arguments: | |
1903 | ||
1904 | - "fdname": file descriptor name (json-string) | |
1905 | ||
1906 | Example: | |
1907 | ||
1908 | -> { "execute": "closefd", "arguments": { "fdname": "fd1" } } | |
1909 | <- { "return": {} } | |
1910 | ||
ba1c048a CB |
1911 | EQMP |
1912 | ||
1913 | { | |
1914 | .name = "add-fd", | |
1915 | .args_type = "fdset-id:i?,opaque:s?", | |
1916 | .params = "add-fd fdset-id opaque", | |
1917 | .help = "Add a file descriptor, that was passed via SCM rights, to an fd set", | |
7fad30f0 | 1918 | .mhandler.cmd_new = qmp_marshal_add_fd, |
ba1c048a CB |
1919 | }, |
1920 | ||
1921 | SQMP | |
1922 | add-fd | |
1923 | ------- | |
1924 | ||
1925 | Add a file descriptor, that was passed via SCM rights, to an fd set. | |
1926 | ||
1927 | Arguments: | |
1928 | ||
1929 | - "fdset-id": The ID of the fd set to add the file descriptor to. | |
1930 | (json-int, optional) | |
1931 | - "opaque": A free-form string that can be used to describe the fd. | |
1932 | (json-string, optional) | |
1933 | ||
1934 | Return a json-object with the following information: | |
1935 | ||
1936 | - "fdset-id": The ID of the fd set that the fd was added to. (json-int) | |
1937 | - "fd": The file descriptor that was received via SCM rights and added to the | |
1938 | fd set. (json-int) | |
1939 | ||
1940 | Example: | |
1941 | ||
1942 | -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } } | |
1943 | <- { "return": { "fdset-id": 1, "fd": 3 } } | |
1944 | ||
1945 | Notes: | |
1946 | ||
1947 | (1) The list of fd sets is shared by all monitor connections. | |
1948 | (2) If "fdset-id" is not specified, a new fd set will be created. | |
1949 | ||
1950 | EQMP | |
1951 | ||
1952 | { | |
1953 | .name = "remove-fd", | |
1954 | .args_type = "fdset-id:i,fd:i?", | |
1955 | .params = "remove-fd fdset-id fd", | |
1956 | .help = "Remove a file descriptor from an fd set", | |
7fad30f0 | 1957 | .mhandler.cmd_new = qmp_marshal_remove_fd, |
ba1c048a CB |
1958 | }, |
1959 | ||
1960 | SQMP | |
1961 | remove-fd | |
1962 | --------- | |
1963 | ||
1964 | Remove a file descriptor from an fd set. | |
1965 | ||
1966 | Arguments: | |
1967 | ||
1968 | - "fdset-id": The ID of the fd set that the file descriptor belongs to. | |
1969 | (json-int) | |
1970 | - "fd": The file descriptor that is to be removed. (json-int, optional) | |
1971 | ||
1972 | Example: | |
1973 | ||
1974 | -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } } | |
1975 | <- { "return": {} } | |
1976 | ||
1977 | Notes: | |
1978 | ||
1979 | (1) The list of fd sets is shared by all monitor connections. | |
1980 | (2) If "fd" is not specified, all file descriptors in "fdset-id" will be | |
1981 | removed. | |
1982 | ||
1983 | EQMP | |
1984 | ||
1985 | { | |
1986 | .name = "query-fdsets", | |
1987 | .args_type = "", | |
1988 | .help = "Return information describing all fd sets", | |
7fad30f0 | 1989 | .mhandler.cmd_new = qmp_marshal_query_fdsets, |
ba1c048a CB |
1990 | }, |
1991 | ||
1992 | SQMP | |
1993 | query-fdsets | |
1994 | ------------- | |
1995 | ||
1996 | Return information describing all fd sets. | |
1997 | ||
1998 | Arguments: None | |
1999 | ||
2000 | Example: | |
2001 | ||
2002 | -> { "execute": "query-fdsets" } | |
2003 | <- { "return": [ | |
2004 | { | |
2005 | "fds": [ | |
2006 | { | |
2007 | "fd": 30, | |
2008 | "opaque": "rdonly:/path/to/file" | |
2009 | }, | |
2010 | { | |
2011 | "fd": 24, | |
2012 | "opaque": "rdwr:/path/to/file" | |
2013 | } | |
2014 | ], | |
2015 | "fdset-id": 1 | |
2016 | }, | |
2017 | { | |
2018 | "fds": [ | |
2019 | { | |
2020 | "fd": 28 | |
2021 | }, | |
2022 | { | |
2023 | "fd": 29 | |
2024 | } | |
2025 | ], | |
2026 | "fdset-id": 0 | |
2027 | } | |
2028 | ] | |
2029 | } | |
2030 | ||
2031 | Note: The list of fd sets is shared by all monitor connections. | |
2032 | ||
82a56f0d LC |
2033 | EQMP |
2034 | ||
2035 | { | |
2036 | .name = "block_passwd", | |
12d3ba82 | 2037 | .args_type = "device:s?,node-name:s?,password:s", |
7fad30f0 | 2038 | .mhandler.cmd_new = qmp_marshal_block_passwd, |
82a56f0d LC |
2039 | }, |
2040 | ||
2041 | SQMP | |
2042 | block_passwd | |
2043 | ------------ | |
2044 | ||
2045 | Set the password of encrypted block devices. | |
2046 | ||
2047 | Arguments: | |
2048 | ||
2049 | - "device": device name (json-string) | |
12d3ba82 | 2050 | - "node-name": name in the block driver state graph (json-string) |
82a56f0d LC |
2051 | - "password": password (json-string) |
2052 | ||
2053 | Example: | |
2054 | ||
2055 | -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0", | |
2056 | "password": "12345" } } | |
2057 | <- { "return": {} } | |
2058 | ||
727f005e ZYW |
2059 | EQMP |
2060 | ||
2061 | { | |
2062 | .name = "block_set_io_throttle", | |
dce13204 | 2063 | .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?,bps_max_length:l?,bps_rd_max_length:l?,bps_wr_max_length:l?,iops_max_length:l?,iops_rd_max_length:l?,iops_wr_max_length:l?,iops_size:l?,group:s?", |
7fad30f0 | 2064 | .mhandler.cmd_new = qmp_marshal_block_set_io_throttle, |
727f005e ZYW |
2065 | }, |
2066 | ||
2067 | SQMP | |
2068 | block_set_io_throttle | |
2069 | ------------ | |
2070 | ||
2071 | Change I/O throttle limits for a block drive. | |
2072 | ||
2073 | Arguments: | |
2074 | ||
2075 | - "device": device name (json-string) | |
586b5466 EB |
2076 | - "bps": total throughput limit in bytes per second (json-int) |
2077 | - "bps_rd": read throughput limit in bytes per second (json-int) | |
2078 | - "bps_wr": write throughput limit in bytes per second (json-int) | |
2079 | - "iops": total I/O operations per second (json-int) | |
2080 | - "iops_rd": read I/O operations per second (json-int) | |
2081 | - "iops_wr": write I/O operations per second (json-int) | |
dce13204 AG |
2082 | - "bps_max": total throughput limit during bursts, in bytes (json-int, optional) |
2083 | - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional) | |
2084 | - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional) | |
2085 | - "iops_max": total I/O operations per second during bursts (json-int, optional) | |
2086 | - "iops_rd_max": read I/O operations per second during bursts (json-int, optional) | |
2087 | - "iops_wr_max": write I/O operations per second during bursts (json-int, optional) | |
2088 | - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional) | |
2089 | - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional) | |
2090 | - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional) | |
2091 | - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional) | |
2092 | - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional) | |
2093 | - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional) | |
2094 | - "iops_size": I/O size in bytes when limiting (json-int, optional) | |
2095 | - "group": throttle group name (json-string, optional) | |
727f005e ZYW |
2096 | |
2097 | Example: | |
2098 | ||
2099 | -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0", | |
586b5466 EB |
2100 | "bps": 1000000, |
2101 | "bps_rd": 0, | |
2102 | "bps_wr": 0, | |
2103 | "iops": 0, | |
2104 | "iops_rd": 0, | |
3e9fab69 BC |
2105 | "iops_wr": 0, |
2106 | "bps_max": 8000000, | |
2107 | "bps_rd_max": 0, | |
2108 | "bps_wr_max": 0, | |
2109 | "iops_max": 0, | |
2110 | "iops_rd_max": 0, | |
2024c1df | 2111 | "iops_wr_max": 0, |
dce13204 | 2112 | "bps_max_length": 60, |
2024c1df | 2113 | "iops_size": 0 } } |
727f005e ZYW |
2114 | <- { "return": {} } |
2115 | ||
7572150c GH |
2116 | EQMP |
2117 | ||
2118 | { | |
2119 | .name = "set_password", | |
2120 | .args_type = "protocol:s,password:s,connected:s?", | |
7fad30f0 | 2121 | .mhandler.cmd_new = qmp_marshal_set_password, |
7572150c GH |
2122 | }, |
2123 | ||
2124 | SQMP | |
2125 | set_password | |
2126 | ------------ | |
2127 | ||
2128 | Set the password for vnc/spice protocols. | |
2129 | ||
2130 | Arguments: | |
2131 | ||
2132 | - "protocol": protocol name (json-string) | |
2133 | - "password": password (json-string) | |
3599d46b | 2134 | - "connected": [ keep | disconnect | fail ] (json-string, optional) |
7572150c GH |
2135 | |
2136 | Example: | |
2137 | ||
2138 | -> { "execute": "set_password", "arguments": { "protocol": "vnc", | |
2139 | "password": "secret" } } | |
2140 | <- { "return": {} } | |
2141 | ||
2142 | EQMP | |
2143 | ||
2144 | { | |
2145 | .name = "expire_password", | |
2146 | .args_type = "protocol:s,time:s", | |
7fad30f0 | 2147 | .mhandler.cmd_new = qmp_marshal_expire_password, |
7572150c GH |
2148 | }, |
2149 | ||
2150 | SQMP | |
2151 | expire_password | |
2152 | --------------- | |
2153 | ||
2154 | Set the password expire time for vnc/spice protocols. | |
2155 | ||
2156 | Arguments: | |
2157 | ||
2158 | - "protocol": protocol name (json-string) | |
2159 | - "time": [ now | never | +secs | secs ] (json-string) | |
2160 | ||
2161 | Example: | |
2162 | ||
2163 | -> { "execute": "expire_password", "arguments": { "protocol": "vnc", | |
2164 | "time": "+60" } } | |
2165 | <- { "return": {} } | |
2166 | ||
82a56f0d LC |
2167 | EQMP |
2168 | ||
13661089 DB |
2169 | { |
2170 | .name = "add_client", | |
f1f5f407 | 2171 | .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?", |
7fad30f0 | 2172 | .mhandler.cmd_new = qmp_marshal_add_client, |
13661089 DB |
2173 | }, |
2174 | ||
2175 | SQMP | |
2176 | add_client | |
2177 | ---------- | |
2178 | ||
2179 | Add a graphics client | |
2180 | ||
2181 | Arguments: | |
2182 | ||
2183 | - "protocol": protocol name (json-string) | |
2184 | - "fdname": file descriptor name (json-string) | |
f1f5f407 DB |
2185 | - "skipauth": whether to skip authentication (json-bool, optional) |
2186 | - "tls": whether to perform TLS (json-bool, optional) | |
13661089 DB |
2187 | |
2188 | Example: | |
2189 | ||
2190 | -> { "execute": "add_client", "arguments": { "protocol": "vnc", | |
2191 | "fdname": "myclient" } } | |
2192 | <- { "return": {} } | |
2193 | ||
2194 | EQMP | |
82a56f0d LC |
2195 | { |
2196 | .name = "qmp_capabilities", | |
2197 | .args_type = "", | |
2198 | .params = "", | |
2199 | .help = "enable QMP capabilities", | |
485febc6 | 2200 | .mhandler.cmd_new = qmp_capabilities, |
82a56f0d LC |
2201 | }, |
2202 | ||
2203 | SQMP | |
2204 | qmp_capabilities | |
2205 | ---------------- | |
2206 | ||
2207 | Enable QMP capabilities. | |
2208 | ||
2209 | Arguments: None. | |
2210 | ||
2211 | Example: | |
2212 | ||
2213 | -> { "execute": "qmp_capabilities" } | |
2214 | <- { "return": {} } | |
2215 | ||
2216 | Note: This command must be issued before issuing any other command. | |
2217 | ||
0268d97c LC |
2218 | EQMP |
2219 | ||
2220 | { | |
2221 | .name = "human-monitor-command", | |
2222 | .args_type = "command-line:s,cpu-index:i?", | |
7fad30f0 | 2223 | .mhandler.cmd_new = qmp_marshal_human_monitor_command, |
0268d97c LC |
2224 | }, |
2225 | ||
2226 | SQMP | |
2227 | human-monitor-command | |
2228 | --------------------- | |
2229 | ||
2230 | Execute a Human Monitor command. | |
2231 | ||
2232 | Arguments: | |
2233 | ||
2234 | - command-line: the command name and its arguments, just like the | |
2235 | Human Monitor's shell (json-string) | |
2236 | - cpu-index: select the CPU number to be used by commands which access CPU | |
2237 | data, like 'info registers'. The Monitor selects CPU 0 if this | |
2238 | argument is not provided (json-int, optional) | |
2239 | ||
2240 | Example: | |
2241 | ||
2242 | -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } } | |
2243 | <- { "return": "kvm support: enabled\r\n" } | |
2244 | ||
2245 | Notes: | |
2246 | ||
2247 | (1) The Human Monitor is NOT an stable interface, this means that command | |
2248 | names, arguments and responses can change or be removed at ANY time. | |
2249 | Applications that rely on long term stability guarantees should NOT | |
2250 | use this command | |
2251 | ||
2252 | (2) Limitations: | |
2253 | ||
2254 | o This command is stateless, this means that commands that depend | |
2255 | on state information (such as getfd) might not work | |
2256 | ||
2257 | o Commands that prompt the user for data (eg. 'cont' when the block | |
2258 | device is encrypted) don't currently work | |
2259 | ||
82a56f0d LC |
2260 | 3. Query Commands |
2261 | ================= | |
2262 | ||
2263 | HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change | |
2264 | HXCOMM this! We will possibly move query commands definitions inside those | |
2265 | HXCOMM sections, just like regular commands. | |
2266 | ||
2267 | EQMP | |
2268 | ||
2269 | SQMP | |
2270 | query-version | |
2271 | ------------- | |
2272 | ||
2273 | Show QEMU version. | |
2274 | ||
2275 | Return a json-object with the following information: | |
2276 | ||
2277 | - "qemu": A json-object containing three integer values: | |
2278 | - "major": QEMU's major version (json-int) | |
2279 | - "minor": QEMU's minor version (json-int) | |
2280 | - "micro": QEMU's micro version (json-int) | |
2281 | - "package": package's version (json-string) | |
2282 | ||
2283 | Example: | |
2284 | ||
2285 | -> { "execute": "query-version" } | |
2286 | <- { | |
2287 | "return":{ | |
2288 | "qemu":{ | |
2289 | "major":0, | |
2290 | "minor":11, | |
2291 | "micro":5 | |
2292 | }, | |
2293 | "package":"" | |
2294 | } | |
2295 | } | |
2296 | ||
2297 | EQMP | |
2298 | ||
b9c15f16 LC |
2299 | { |
2300 | .name = "query-version", | |
2301 | .args_type = "", | |
7fad30f0 | 2302 | .mhandler.cmd_new = qmp_marshal_query_version, |
b9c15f16 LC |
2303 | }, |
2304 | ||
82a56f0d LC |
2305 | SQMP |
2306 | query-commands | |
2307 | -------------- | |
2308 | ||
2309 | List QMP available commands. | |
2310 | ||
2311 | Each command is represented by a json-object, the returned value is a json-array | |
2312 | of all commands. | |
2313 | ||
2314 | Each json-object contain: | |
2315 | ||
2316 | - "name": command's name (json-string) | |
2317 | ||
2318 | Example: | |
2319 | ||
2320 | -> { "execute": "query-commands" } | |
2321 | <- { | |
2322 | "return":[ | |
2323 | { | |
2324 | "name":"query-balloon" | |
2325 | }, | |
2326 | { | |
2327 | "name":"system_powerdown" | |
2328 | } | |
2329 | ] | |
2330 | } | |
2331 | ||
2332 | Note: This example has been shortened as the real response is too long. | |
2333 | ||
2334 | EQMP | |
2335 | ||
aa9b79bc LC |
2336 | { |
2337 | .name = "query-commands", | |
2338 | .args_type = "", | |
7fad30f0 | 2339 | .mhandler.cmd_new = qmp_marshal_query_commands, |
aa9b79bc LC |
2340 | }, |
2341 | ||
4860853d DB |
2342 | SQMP |
2343 | query-events | |
2344 | -------------- | |
2345 | ||
2346 | List QMP available events. | |
2347 | ||
2348 | Each event is represented by a json-object, the returned value is a json-array | |
2349 | of all events. | |
2350 | ||
2351 | Each json-object contains: | |
2352 | ||
2353 | - "name": event's name (json-string) | |
2354 | ||
2355 | Example: | |
2356 | ||
2357 | -> { "execute": "query-events" } | |
2358 | <- { | |
2359 | "return":[ | |
2360 | { | |
2361 | "name":"SHUTDOWN" | |
2362 | }, | |
2363 | { | |
2364 | "name":"RESET" | |
2365 | } | |
2366 | ] | |
2367 | } | |
2368 | ||
2369 | Note: This example has been shortened as the real response is too long. | |
2370 | ||
2371 | EQMP | |
2372 | ||
2373 | { | |
2374 | .name = "query-events", | |
2375 | .args_type = "", | |
7fad30f0 | 2376 | .mhandler.cmd_new = qmp_marshal_query_events, |
4860853d DB |
2377 | }, |
2378 | ||
39a18158 MA |
2379 | SQMP |
2380 | query-qmp-schema | |
2381 | ---------------- | |
2382 | ||
2383 | Return the QMP wire schema. The returned value is a json-array of | |
2384 | named schema entities. Entities are commands, events and various | |
2385 | types. See docs/qapi-code-gen.txt for information on their structure | |
2386 | and intended use. | |
2387 | ||
2388 | EQMP | |
2389 | ||
2390 | { | |
2391 | .name = "query-qmp-schema", | |
2392 | .args_type = "", | |
2393 | .mhandler.cmd_new = qmp_query_qmp_schema, | |
2394 | }, | |
2395 | ||
82a56f0d LC |
2396 | SQMP |
2397 | query-chardev | |
2398 | ------------- | |
2399 | ||
2400 | Each device is represented by a json-object. The returned value is a json-array | |
2401 | of all devices. | |
2402 | ||
2403 | Each json-object contain the following: | |
2404 | ||
2405 | - "label": device's label (json-string) | |
2406 | - "filename": device's file (json-string) | |
32a97ea1 LE |
2407 | - "frontend-open": open/closed state of the frontend device attached to this |
2408 | backend (json-bool) | |
82a56f0d LC |
2409 | |
2410 | Example: | |
2411 | ||
2412 | -> { "execute": "query-chardev" } | |
2413 | <- { | |
32a97ea1 LE |
2414 | "return": [ |
2415 | { | |
2416 | "label": "charchannel0", | |
2417 | "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server", | |
2418 | "frontend-open": false | |
2419 | }, | |
82a56f0d | 2420 | { |
32a97ea1 LE |
2421 | "label": "charmonitor", |
2422 | "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server", | |
2423 | "frontend-open": true | |
82a56f0d LC |
2424 | }, |
2425 | { | |
32a97ea1 LE |
2426 | "label": "charserial0", |
2427 | "filename": "pty:/dev/pts/2", | |
2428 | "frontend-open": true | |
82a56f0d LC |
2429 | } |
2430 | ] | |
2431 | } | |
2432 | ||
2433 | EQMP | |
2434 | ||
c5a415a0 LC |
2435 | { |
2436 | .name = "query-chardev", | |
2437 | .args_type = "", | |
7fad30f0 | 2438 | .mhandler.cmd_new = qmp_marshal_query_chardev, |
c5a415a0 LC |
2439 | }, |
2440 | ||
77d1c3c6 MK |
2441 | SQMP |
2442 | query-chardev-backends | |
2443 | ------------- | |
2444 | ||
2445 | List available character device backends. | |
2446 | ||
2447 | Each backend is represented by a json-object, the returned value is a json-array | |
2448 | of all backends. | |
2449 | ||
2450 | Each json-object contains: | |
2451 | ||
2452 | - "name": backend name (json-string) | |
2453 | ||
2454 | Example: | |
2455 | ||
2456 | -> { "execute": "query-chardev-backends" } | |
2457 | <- { | |
2458 | "return":[ | |
2459 | { | |
2460 | "name":"udp" | |
2461 | }, | |
2462 | { | |
2463 | "name":"tcp" | |
2464 | }, | |
2465 | { | |
2466 | "name":"unix" | |
2467 | }, | |
2468 | { | |
2469 | "name":"spiceport" | |
2470 | } | |
2471 | ] | |
2472 | } | |
2473 | ||
2474 | EQMP | |
2475 | ||
2476 | { | |
2477 | .name = "query-chardev-backends", | |
2478 | .args_type = "", | |
7fad30f0 | 2479 | .mhandler.cmd_new = qmp_marshal_query_chardev_backends, |
77d1c3c6 MK |
2480 | }, |
2481 | ||
82a56f0d LC |
2482 | SQMP |
2483 | query-block | |
2484 | ----------- | |
2485 | ||
2486 | Show the block devices. | |
2487 | ||
2488 | Each block device information is stored in a json-object and the returned value | |
2489 | is a json-array of all devices. | |
2490 | ||
2491 | Each json-object contain the following: | |
2492 | ||
2493 | - "device": device name (json-string) | |
2494 | - "type": device type (json-string) | |
d8aeeb31 MA |
2495 | - deprecated, retained for backward compatibility |
2496 | - Possible values: "unknown" | |
82a56f0d LC |
2497 | - "removable": true if the device is removable, false otherwise (json-bool) |
2498 | - "locked": true if the device is locked, false otherwise (json-bool) | |
99f42808 | 2499 | - "tray_open": only present if removable, true if the device has a tray, |
e4def80b | 2500 | and it is open (json-bool) |
82a56f0d LC |
2501 | - "inserted": only present if the device is inserted, it is a json-object |
2502 | containing the following: | |
2503 | - "file": device file name (json-string) | |
2504 | - "ro": true if read-only, false otherwise (json-bool) | |
2505 | - "drv": driver format name (json-string) | |
550830f9 | 2506 | - Possible values: "blkdebug", "bochs", "cloop", "dmg", |
82a56f0d | 2507 | "file", "file", "ftp", "ftps", "host_cdrom", |
92a539d2 | 2508 | "host_device", "http", "https", |
82a56f0d LC |
2509 | "nbd", "parallels", "qcow", "qcow2", "raw", |
2510 | "tftp", "vdi", "vmdk", "vpc", "vvfat" | |
2511 | - "backing_file": backing file name (json-string, optional) | |
2e3e3317 | 2512 | - "backing_file_depth": number of files in the backing file chain (json-int) |
82a56f0d | 2513 | - "encrypted": true if encrypted, false otherwise (json-bool) |
727f005e ZYW |
2514 | - "bps": limit total bytes per second (json-int) |
2515 | - "bps_rd": limit read bytes per second (json-int) | |
2516 | - "bps_wr": limit write bytes per second (json-int) | |
2517 | - "iops": limit total I/O operations per second (json-int) | |
2518 | - "iops_rd": limit read operations per second (json-int) | |
2519 | - "iops_wr": limit write operations per second (json-int) | |
3e9fab69 BC |
2520 | - "bps_max": total max in bytes (json-int) |
2521 | - "bps_rd_max": read max in bytes (json-int) | |
2522 | - "bps_wr_max": write max in bytes (json-int) | |
2523 | - "iops_max": total I/O operations max (json-int) | |
2524 | - "iops_rd_max": read I/O operations max (json-int) | |
2525 | - "iops_wr_max": write I/O operations max (json-int) | |
2024c1df | 2526 | - "iops_size": I/O size when limiting by iops (json-int) |
465bee1d PL |
2527 | - "detect_zeroes": detect and optimize zero writing (json-string) |
2528 | - Possible values: "off", "on", "unmap" | |
e2462113 FR |
2529 | - "write_threshold": write offset threshold in bytes, a event will be |
2530 | emitted if crossed. Zero if disabled (json-int) | |
553a7e87 WX |
2531 | - "image": the detail of the image, it is a json-object containing |
2532 | the following: | |
2533 | - "filename": image file name (json-string) | |
2534 | - "format": image format (json-string) | |
2535 | - "virtual-size": image capacity in bytes (json-int) | |
2536 | - "dirty-flag": true if image is not cleanly closed, not present | |
2537 | means clean (json-bool, optional) | |
2538 | - "actual-size": actual size on disk in bytes of the image, not | |
2539 | present when image does not support thin | |
2540 | provision (json-int, optional) | |
2541 | - "cluster-size": size of a cluster in bytes, not present if image | |
2542 | format does not support it (json-int, optional) | |
2543 | - "encrypted": true if the image is encrypted, not present means | |
2544 | false or the image format does not support | |
2545 | encryption (json-bool, optional) | |
2546 | - "backing_file": backing file name, not present means no backing | |
2547 | file is used or the image format does not | |
2548 | support backing file chain | |
2549 | (json-string, optional) | |
2550 | - "full-backing-filename": full path of the backing file, not | |
2551 | present if it equals backing_file or no | |
2552 | backing file is used | |
2553 | (json-string, optional) | |
2554 | - "backing-filename-format": the format of the backing file, not | |
2555 | present means unknown or no backing | |
2556 | file (json-string, optional) | |
2557 | - "snapshots": the internal snapshot info, it is an optional list | |
2558 | of json-object containing the following: | |
2559 | - "id": unique snapshot id (json-string) | |
2560 | - "name": snapshot name (json-string) | |
2561 | - "vm-state-size": size of the VM state in bytes (json-int) | |
2562 | - "date-sec": UTC date of the snapshot in seconds (json-int) | |
2563 | - "date-nsec": fractional part in nanoseconds to be used with | |
586b5466 | 2564 | date-sec (json-int) |
553a7e87 WX |
2565 | - "vm-clock-sec": VM clock relative to boot in seconds |
2566 | (json-int) | |
2567 | - "vm-clock-nsec": fractional part in nanoseconds to be used | |
2568 | with vm-clock-sec (json-int) | |
2569 | - "backing-image": the detail of the backing image, it is an | |
2570 | optional json-object only present when a | |
2571 | backing image present for this image | |
727f005e | 2572 | |
f04ef601 LC |
2573 | - "io-status": I/O operation status, only present if the device supports it |
2574 | and the VM is configured to stop on errors. It's always reset | |
2575 | to "ok" when the "cont" command is issued (json_string, optional) | |
2576 | - Possible values: "ok", "failed", "nospace" | |
82a56f0d LC |
2577 | |
2578 | Example: | |
2579 | ||
2580 | -> { "execute": "query-block" } | |
2581 | <- { | |
2582 | "return":[ | |
2583 | { | |
f04ef601 | 2584 | "io-status": "ok", |
82a56f0d LC |
2585 | "device":"ide0-hd0", |
2586 | "locked":false, | |
2587 | "removable":false, | |
2588 | "inserted":{ | |
2589 | "ro":false, | |
2590 | "drv":"qcow2", | |
2591 | "encrypted":false, | |
553a7e87 WX |
2592 | "file":"disks/test.qcow2", |
2593 | "backing_file_depth":1, | |
727f005e ZYW |
2594 | "bps":1000000, |
2595 | "bps_rd":0, | |
2596 | "bps_wr":0, | |
2597 | "iops":1000000, | |
2598 | "iops_rd":0, | |
2599 | "iops_wr":0, | |
3e9fab69 BC |
2600 | "bps_max": 8000000, |
2601 | "bps_rd_max": 0, | |
2602 | "bps_wr_max": 0, | |
2603 | "iops_max": 0, | |
2604 | "iops_rd_max": 0, | |
2605 | "iops_wr_max": 0, | |
2024c1df | 2606 | "iops_size": 0, |
465bee1d | 2607 | "detect_zeroes": "on", |
e2462113 | 2608 | "write_threshold": 0, |
553a7e87 WX |
2609 | "image":{ |
2610 | "filename":"disks/test.qcow2", | |
2611 | "format":"qcow2", | |
2612 | "virtual-size":2048000, | |
2613 | "backing_file":"base.qcow2", | |
2614 | "full-backing-filename":"disks/base.qcow2", | |
5403432f | 2615 | "backing-filename-format":"qcow2", |
553a7e87 WX |
2616 | "snapshots":[ |
2617 | { | |
2618 | "id": "1", | |
2619 | "name": "snapshot1", | |
2620 | "vm-state-size": 0, | |
2621 | "date-sec": 10000200, | |
2622 | "date-nsec": 12, | |
2623 | "vm-clock-sec": 206, | |
2624 | "vm-clock-nsec": 30 | |
2625 | } | |
2626 | ], | |
2627 | "backing-image":{ | |
2628 | "filename":"disks/base.qcow2", | |
2629 | "format":"qcow2", | |
2630 | "virtual-size":2048000 | |
2631 | } | |
2632 | } | |
82a56f0d | 2633 | }, |
d8aeeb31 | 2634 | "type":"unknown" |
82a56f0d LC |
2635 | }, |
2636 | { | |
f04ef601 | 2637 | "io-status": "ok", |
82a56f0d LC |
2638 | "device":"ide1-cd0", |
2639 | "locked":false, | |
2640 | "removable":true, | |
d8aeeb31 | 2641 | "type":"unknown" |
82a56f0d LC |
2642 | }, |
2643 | { | |
2644 | "device":"floppy0", | |
2645 | "locked":false, | |
2646 | "removable":true, | |
d8aeeb31 | 2647 | "type":"unknown" |
82a56f0d LC |
2648 | }, |
2649 | { | |
2650 | "device":"sd0", | |
2651 | "locked":false, | |
2652 | "removable":true, | |
d8aeeb31 | 2653 | "type":"unknown" |
82a56f0d LC |
2654 | } |
2655 | ] | |
2656 | } | |
2657 | ||
2658 | EQMP | |
2659 | ||
b2023818 LC |
2660 | { |
2661 | .name = "query-block", | |
2662 | .args_type = "", | |
7fad30f0 | 2663 | .mhandler.cmd_new = qmp_marshal_query_block, |
b2023818 LC |
2664 | }, |
2665 | ||
82a56f0d LC |
2666 | SQMP |
2667 | query-blockstats | |
2668 | ---------------- | |
2669 | ||
2670 | Show block device statistics. | |
2671 | ||
2672 | Each device statistic information is stored in a json-object and the returned | |
2673 | value is a json-array of all devices. | |
2674 | ||
2675 | Each json-object contain the following: | |
2676 | ||
2677 | - "device": device name (json-string) | |
2678 | - "stats": A json-object with the statistics information, it contains: | |
2679 | - "rd_bytes": bytes read (json-int) | |
2680 | - "wr_bytes": bytes written (json-int) | |
2681 | - "rd_operations": read operations (json-int) | |
2682 | - "wr_operations": write operations (json-int) | |
e8045d67 | 2683 | - "flush_operations": cache flush operations (json-int) |
c488c7f6 CH |
2684 | - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int) |
2685 | - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int) | |
2686 | - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int) | |
53d8f9d8 HR |
2687 | - "wr_highest_offset": The offset after the greatest byte written to the |
2688 | BlockDriverState since it has been opened (json-int) | |
f4564d53 PL |
2689 | - "rd_merged": number of read requests that have been merged into |
2690 | another request (json-int) | |
2691 | - "wr_merged": number of write requests that have been merged into | |
2692 | another request (json-int) | |
cb38fffb AG |
2693 | - "idle_time_ns": time since the last I/O operation, in |
2694 | nanoseconds. If the field is absent it means | |
2695 | that there haven't been any operations yet | |
2696 | (json-int, optional) | |
7ee12daf AG |
2697 | - "failed_rd_operations": number of failed read operations |
2698 | (json-int) | |
2699 | - "failed_wr_operations": number of failed write operations | |
2700 | (json-int) | |
2701 | - "failed_flush_operations": number of failed flush operations | |
2702 | (json-int) | |
2703 | - "invalid_rd_operations": number of invalid read operations | |
2704 | (json-int) | |
2705 | - "invalid_wr_operations": number of invalid write operations | |
2706 | (json-int) | |
2707 | - "invalid_flush_operations": number of invalid flush operations | |
2708 | (json-int) | |
362e9299 AG |
2709 | - "account_invalid": whether invalid operations are included in |
2710 | the last access statistics (json-bool) | |
2711 | - "account_failed": whether failed operations are included in the | |
2712 | latency and last access statistics | |
2713 | (json-bool) | |
979e9b03 AG |
2714 | - "timed_stats": A json-array containing statistics collected in |
2715 | specific intervals, with the following members: | |
2716 | - "interval_length": interval used for calculating the | |
2717 | statistics, in seconds (json-int) | |
2718 | - "min_rd_latency_ns": minimum latency of read operations in | |
2719 | the defined interval, in nanoseconds | |
2720 | (json-int) | |
2721 | - "min_wr_latency_ns": minimum latency of write operations in | |
2722 | the defined interval, in nanoseconds | |
2723 | (json-int) | |
2724 | - "min_flush_latency_ns": minimum latency of flush operations | |
2725 | in the defined interval, in | |
2726 | nanoseconds (json-int) | |
2727 | - "max_rd_latency_ns": maximum latency of read operations in | |
2728 | the defined interval, in nanoseconds | |
2729 | (json-int) | |
2730 | - "max_wr_latency_ns": maximum latency of write operations in | |
2731 | the defined interval, in nanoseconds | |
2732 | (json-int) | |
2733 | - "max_flush_latency_ns": maximum latency of flush operations | |
2734 | in the defined interval, in | |
2735 | nanoseconds (json-int) | |
2736 | - "avg_rd_latency_ns": average latency of read operations in | |
2737 | the defined interval, in nanoseconds | |
2738 | (json-int) | |
2739 | - "avg_wr_latency_ns": average latency of write operations in | |
2740 | the defined interval, in nanoseconds | |
2741 | (json-int) | |
2742 | - "avg_flush_latency_ns": average latency of flush operations | |
2743 | in the defined interval, in | |
2744 | nanoseconds (json-int) | |
96e4deda AG |
2745 | - "avg_rd_queue_depth": average number of pending read |
2746 | operations in the defined interval | |
2747 | (json-number) | |
2748 | - "avg_wr_queue_depth": average number of pending write | |
2749 | operations in the defined interval | |
2750 | (json-number). | |
82a56f0d LC |
2751 | - "parent": Contains recursively the statistics of the underlying |
2752 | protocol (e.g. the host file for a qcow2 image). If there is | |
2753 | no underlying protocol, this field is omitted | |
2754 | (json-object, optional) | |
2755 | ||
2756 | Example: | |
2757 | ||
2758 | -> { "execute": "query-blockstats" } | |
2759 | <- { | |
2760 | "return":[ | |
2761 | { | |
2762 | "device":"ide0-hd0", | |
2763 | "parent":{ | |
2764 | "stats":{ | |
2765 | "wr_highest_offset":3686448128, | |
2766 | "wr_bytes":9786368, | |
2767 | "wr_operations":751, | |
2768 | "rd_bytes":122567168, | |
2769 | "rd_operations":36772 | |
c488c7f6 CH |
2770 | "wr_total_times_ns":313253456 |
2771 | "rd_total_times_ns":3465673657 | |
2772 | "flush_total_times_ns":49653 | |
e8045d67 | 2773 | "flush_operations":61, |
f4564d53 | 2774 | "rd_merged":0, |
cb38fffb | 2775 | "wr_merged":0, |
362e9299 AG |
2776 | "idle_time_ns":2953431879, |
2777 | "account_invalid":true, | |
2778 | "account_failed":false | |
82a56f0d LC |
2779 | } |
2780 | }, | |
2781 | "stats":{ | |
2782 | "wr_highest_offset":2821110784, | |
2783 | "wr_bytes":9786368, | |
2784 | "wr_operations":692, | |
2785 | "rd_bytes":122739200, | |
2786 | "rd_operations":36604 | |
e8045d67 | 2787 | "flush_operations":51, |
c488c7f6 CH |
2788 | "wr_total_times_ns":313253456 |
2789 | "rd_total_times_ns":3465673657 | |
f4564d53 PL |
2790 | "flush_total_times_ns":49653, |
2791 | "rd_merged":0, | |
cb38fffb | 2792 | "wr_merged":0, |
362e9299 AG |
2793 | "idle_time_ns":2953431879, |
2794 | "account_invalid":true, | |
2795 | "account_failed":false | |
82a56f0d LC |
2796 | } |
2797 | }, | |
2798 | { | |
2799 | "device":"ide1-cd0", | |
2800 | "stats":{ | |
2801 | "wr_highest_offset":0, | |
2802 | "wr_bytes":0, | |
2803 | "wr_operations":0, | |
2804 | "rd_bytes":0, | |
2805 | "rd_operations":0 | |
e8045d67 | 2806 | "flush_operations":0, |
c488c7f6 CH |
2807 | "wr_total_times_ns":0 |
2808 | "rd_total_times_ns":0 | |
f4564d53 PL |
2809 | "flush_total_times_ns":0, |
2810 | "rd_merged":0, | |
362e9299 AG |
2811 | "wr_merged":0, |
2812 | "account_invalid":false, | |
2813 | "account_failed":false | |
82a56f0d LC |
2814 | } |
2815 | }, | |
2816 | { | |
2817 | "device":"floppy0", | |
2818 | "stats":{ | |
2819 | "wr_highest_offset":0, | |
2820 | "wr_bytes":0, | |
2821 | "wr_operations":0, | |
2822 | "rd_bytes":0, | |
2823 | "rd_operations":0 | |
e8045d67 | 2824 | "flush_operations":0, |
c488c7f6 CH |
2825 | "wr_total_times_ns":0 |
2826 | "rd_total_times_ns":0 | |
f4564d53 PL |
2827 | "flush_total_times_ns":0, |
2828 | "rd_merged":0, | |
362e9299 AG |
2829 | "wr_merged":0, |
2830 | "account_invalid":false, | |
2831 | "account_failed":false | |
82a56f0d LC |
2832 | } |
2833 | }, | |
2834 | { | |
2835 | "device":"sd0", | |
2836 | "stats":{ | |
2837 | "wr_highest_offset":0, | |
2838 | "wr_bytes":0, | |
2839 | "wr_operations":0, | |
2840 | "rd_bytes":0, | |
2841 | "rd_operations":0 | |
e8045d67 | 2842 | "flush_operations":0, |
c488c7f6 CH |
2843 | "wr_total_times_ns":0 |
2844 | "rd_total_times_ns":0 | |
f4564d53 PL |
2845 | "flush_total_times_ns":0, |
2846 | "rd_merged":0, | |
362e9299 AG |
2847 | "wr_merged":0, |
2848 | "account_invalid":false, | |
2849 | "account_failed":false | |
82a56f0d LC |
2850 | } |
2851 | } | |
2852 | ] | |
2853 | } | |
2854 | ||
2855 | EQMP | |
2856 | ||
f11f57e4 LC |
2857 | { |
2858 | .name = "query-blockstats", | |
f71eaa74 | 2859 | .args_type = "query-nodes:b?", |
7fad30f0 | 2860 | .mhandler.cmd_new = qmp_marshal_query_blockstats, |
f11f57e4 LC |
2861 | }, |
2862 | ||
82a56f0d LC |
2863 | SQMP |
2864 | query-cpus | |
2865 | ---------- | |
2866 | ||
2867 | Show CPU information. | |
2868 | ||
2869 | Return a json-array. Each CPU is represented by a json-object, which contains: | |
2870 | ||
2871 | - "CPU": CPU index (json-int) | |
2872 | - "current": true if this is the current CPU, false otherwise (json-bool) | |
2873 | - "halted": true if the cpu is halted, false otherwise (json-bool) | |
58f88d4b | 2874 | - "qom_path": path to the CPU object in the QOM tree (json-str) |
86f4b687 EB |
2875 | - "arch": architecture of the cpu, which determines what additional |
2876 | keys will be present (json-str) | |
82a56f0d LC |
2877 | - Current program counter. The key's name depends on the architecture: |
2878 | "pc": i386/x86_64 (json-int) | |
2879 | "nip": PPC (json-int) | |
2880 | "pc" and "npc": sparc (json-int) | |
2881 | "PC": mips (json-int) | |
dc7a09cf | 2882 | - "thread_id": ID of the underlying host thread (json-int) |
82a56f0d LC |
2883 | |
2884 | Example: | |
2885 | ||
2886 | -> { "execute": "query-cpus" } | |
2887 | <- { | |
2888 | "return":[ | |
2889 | { | |
2890 | "CPU":0, | |
2891 | "current":true, | |
2892 | "halted":false, | |
58f88d4b | 2893 | "qom_path":"/machine/unattached/device[0]", |
86f4b687 | 2894 | "arch":"x86", |
58f88d4b | 2895 | "pc":3227107138, |
dc7a09cf | 2896 | "thread_id":3134 |
82a56f0d LC |
2897 | }, |
2898 | { | |
2899 | "CPU":1, | |
2900 | "current":false, | |
2901 | "halted":true, | |
58f88d4b | 2902 | "qom_path":"/machine/unattached/device[2]", |
86f4b687 | 2903 | "arch":"x86", |
58f88d4b | 2904 | "pc":7108165, |
dc7a09cf | 2905 | "thread_id":3135 |
82a56f0d LC |
2906 | } |
2907 | ] | |
2908 | } | |
2909 | ||
2910 | EQMP | |
2911 | ||
de0b36b6 LC |
2912 | { |
2913 | .name = "query-cpus", | |
2914 | .args_type = "", | |
7fad30f0 | 2915 | .mhandler.cmd_new = qmp_marshal_query_cpus, |
de0b36b6 LC |
2916 | }, |
2917 | ||
dc3dd0d2 SH |
2918 | SQMP |
2919 | query-iothreads | |
2920 | --------------- | |
2921 | ||
2922 | Returns a list of information about each iothread. | |
2923 | ||
2924 | Note this list excludes the QEMU main loop thread, which is not declared | |
2925 | using the -object iothread command-line option. It is always the main thread | |
2926 | of the process. | |
2927 | ||
2928 | Return a json-array. Each iothread is represented by a json-object, which contains: | |
2929 | ||
2930 | - "id": name of iothread (json-str) | |
2931 | - "thread-id": ID of the underlying host thread (json-int) | |
2932 | ||
2933 | Example: | |
2934 | ||
2935 | -> { "execute": "query-iothreads" } | |
2936 | <- { | |
2937 | "return":[ | |
2938 | { | |
2939 | "id":"iothread0", | |
2940 | "thread-id":3134 | |
2941 | }, | |
2942 | { | |
2943 | "id":"iothread1", | |
2944 | "thread-id":3135 | |
2945 | } | |
2946 | ] | |
2947 | } | |
2948 | ||
2949 | EQMP | |
2950 | ||
2951 | { | |
2952 | .name = "query-iothreads", | |
2953 | .args_type = "", | |
7fad30f0 | 2954 | .mhandler.cmd_new = qmp_marshal_query_iothreads, |
dc3dd0d2 SH |
2955 | }, |
2956 | ||
82a56f0d LC |
2957 | SQMP |
2958 | query-pci | |
2959 | --------- | |
2960 | ||
2961 | PCI buses and devices information. | |
2962 | ||
2963 | The returned value is a json-array of all buses. Each bus is represented by | |
2964 | a json-object, which has a key with a json-array of all PCI devices attached | |
2965 | to it. Each device is represented by a json-object. | |
2966 | ||
2967 | The bus json-object contains the following: | |
2968 | ||
2969 | - "bus": bus number (json-int) | |
2970 | - "devices": a json-array of json-objects, each json-object represents a | |
2971 | PCI device | |
2972 | ||
2973 | The PCI device json-object contains the following: | |
2974 | ||
2975 | - "bus": identical to the parent's bus number (json-int) | |
2976 | - "slot": slot number (json-int) | |
2977 | - "function": function number (json-int) | |
2978 | - "class_info": a json-object containing: | |
2979 | - "desc": device class description (json-string, optional) | |
2980 | - "class": device class number (json-int) | |
2981 | - "id": a json-object containing: | |
2982 | - "device": device ID (json-int) | |
2983 | - "vendor": vendor ID (json-int) | |
2984 | - "irq": device's IRQ if assigned (json-int, optional) | |
2985 | - "qdev_id": qdev id string (json-string) | |
2986 | - "pci_bridge": It's a json-object, only present if this device is a | |
2987 | PCI bridge, contains: | |
2988 | - "bus": bus number (json-int) | |
2989 | - "secondary": secondary bus number (json-int) | |
2990 | - "subordinate": subordinate bus number (json-int) | |
2991 | - "io_range": I/O memory range information, a json-object with the | |
2992 | following members: | |
2993 | - "base": base address, in bytes (json-int) | |
2994 | - "limit": limit address, in bytes (json-int) | |
2995 | - "memory_range": memory range information, a json-object with the | |
2996 | following members: | |
2997 | - "base": base address, in bytes (json-int) | |
2998 | - "limit": limit address, in bytes (json-int) | |
2999 | - "prefetchable_range": Prefetchable memory range information, a | |
3000 | json-object with the following members: | |
3001 | - "base": base address, in bytes (json-int) | |
3002 | - "limit": limit address, in bytes (json-int) | |
3003 | - "devices": a json-array of PCI devices if there's any attached, each | |
3004 | each element is represented by a json-object, which contains | |
3005 | the same members of the 'PCI device json-object' described | |
3006 | above (optional) | |
3007 | - "regions": a json-array of json-objects, each json-object represents a | |
3008 | memory region of this device | |
3009 | ||
3010 | The memory range json-object contains the following: | |
3011 | ||
3012 | - "base": base memory address (json-int) | |
3013 | - "limit": limit value (json-int) | |
3014 | ||
3015 | The region json-object can be an I/O region or a memory region, an I/O region | |
3016 | json-object contains the following: | |
3017 | ||
3018 | - "type": "io" (json-string, fixed) | |
3019 | - "bar": BAR number (json-int) | |
3020 | - "address": memory address (json-int) | |
3021 | - "size": memory size (json-int) | |
3022 | ||
3023 | A memory region json-object contains the following: | |
3024 | ||
3025 | - "type": "memory" (json-string, fixed) | |
3026 | - "bar": BAR number (json-int) | |
3027 | - "address": memory address (json-int) | |
3028 | - "size": memory size (json-int) | |
3029 | - "mem_type_64": true or false (json-bool) | |
3030 | - "prefetch": true or false (json-bool) | |
3031 | ||
3032 | Example: | |
3033 | ||
3034 | -> { "execute": "query-pci" } | |
3035 | <- { | |
3036 | "return":[ | |
3037 | { | |
3038 | "bus":0, | |
3039 | "devices":[ | |
3040 | { | |
3041 | "bus":0, | |
3042 | "qdev_id":"", | |
3043 | "slot":0, | |
3044 | "class_info":{ | |
3045 | "class":1536, | |
3046 | "desc":"Host bridge" | |
3047 | }, | |
3048 | "id":{ | |
3049 | "device":32902, | |
3050 | "vendor":4663 | |
3051 | }, | |
3052 | "function":0, | |
3053 | "regions":[ | |
3054 | ||
3055 | ] | |
3056 | }, | |
3057 | { | |
3058 | "bus":0, | |
3059 | "qdev_id":"", | |
3060 | "slot":1, | |
3061 | "class_info":{ | |
3062 | "class":1537, | |
3063 | "desc":"ISA bridge" | |
3064 | }, | |
3065 | "id":{ | |
3066 | "device":32902, | |
3067 | "vendor":28672 | |
3068 | }, | |
3069 | "function":0, | |
3070 | "regions":[ | |
3071 | ||
3072 | ] | |
3073 | }, | |
3074 | { | |
3075 | "bus":0, | |
3076 | "qdev_id":"", | |
3077 | "slot":1, | |
3078 | "class_info":{ | |
3079 | "class":257, | |
3080 | "desc":"IDE controller" | |
3081 | }, | |
3082 | "id":{ | |
3083 | "device":32902, | |
3084 | "vendor":28688 | |
3085 | }, | |
3086 | "function":1, | |
3087 | "regions":[ | |
3088 | { | |
3089 | "bar":4, | |
3090 | "size":16, | |
3091 | "address":49152, | |
3092 | "type":"io" | |
3093 | } | |
3094 | ] | |
3095 | }, | |
3096 | { | |
3097 | "bus":0, | |
3098 | "qdev_id":"", | |
3099 | "slot":2, | |
3100 | "class_info":{ | |
3101 | "class":768, | |
3102 | "desc":"VGA controller" | |
3103 | }, | |
3104 | "id":{ | |
3105 | "device":4115, | |
3106 | "vendor":184 | |
3107 | }, | |
3108 | "function":0, | |
3109 | "regions":[ | |
3110 | { | |
3111 | "prefetch":true, | |
3112 | "mem_type_64":false, | |
3113 | "bar":0, | |
3114 | "size":33554432, | |
3115 | "address":4026531840, | |
3116 | "type":"memory" | |
3117 | }, | |
3118 | { | |
3119 | "prefetch":false, | |
3120 | "mem_type_64":false, | |
3121 | "bar":1, | |
3122 | "size":4096, | |
3123 | "address":4060086272, | |
3124 | "type":"memory" | |
3125 | }, | |
3126 | { | |
3127 | "prefetch":false, | |
3128 | "mem_type_64":false, | |
3129 | "bar":6, | |
3130 | "size":65536, | |
3131 | "address":-1, | |
3132 | "type":"memory" | |
3133 | } | |
3134 | ] | |
3135 | }, | |
3136 | { | |
3137 | "bus":0, | |
3138 | "qdev_id":"", | |
3139 | "irq":11, | |
3140 | "slot":4, | |
3141 | "class_info":{ | |
3142 | "class":1280, | |
3143 | "desc":"RAM controller" | |
3144 | }, | |
3145 | "id":{ | |
3146 | "device":6900, | |
3147 | "vendor":4098 | |
3148 | }, | |
3149 | "function":0, | |
3150 | "regions":[ | |
3151 | { | |
3152 | "bar":0, | |
3153 | "size":32, | |
3154 | "address":49280, | |
3155 | "type":"io" | |
3156 | } | |
3157 | ] | |
3158 | } | |
3159 | ] | |
3160 | } | |
3161 | ] | |
3162 | } | |
3163 | ||
3164 | Note: This example has been shortened as the real response is too long. | |
3165 | ||
3166 | EQMP | |
3167 | ||
79627472 LC |
3168 | { |
3169 | .name = "query-pci", | |
3170 | .args_type = "", | |
7fad30f0 | 3171 | .mhandler.cmd_new = qmp_marshal_query_pci, |
79627472 LC |
3172 | }, |
3173 | ||
82a56f0d LC |
3174 | SQMP |
3175 | query-kvm | |
3176 | --------- | |
3177 | ||
3178 | Show KVM information. | |
3179 | ||
3180 | Return a json-object with the following information: | |
3181 | ||
3182 | - "enabled": true if KVM support is enabled, false otherwise (json-bool) | |
3183 | - "present": true if QEMU has KVM support, false otherwise (json-bool) | |
3184 | ||
3185 | Example: | |
3186 | ||
3187 | -> { "execute": "query-kvm" } | |
3188 | <- { "return": { "enabled": true, "present": true } } | |
3189 | ||
3190 | EQMP | |
3191 | ||
292a2602 LC |
3192 | { |
3193 | .name = "query-kvm", | |
3194 | .args_type = "", | |
7fad30f0 | 3195 | .mhandler.cmd_new = qmp_marshal_query_kvm, |
292a2602 LC |
3196 | }, |
3197 | ||
82a56f0d LC |
3198 | SQMP |
3199 | query-status | |
3200 | ------------ | |
3201 | ||
3202 | Return a json-object with the following information: | |
3203 | ||
3204 | - "running": true if the VM is running, or false if it is paused (json-bool) | |
3205 | - "singlestep": true if the VM is in single step mode, | |
3206 | false otherwise (json-bool) | |
9e37b9dc LC |
3207 | - "status": one of the following values (json-string) |
3208 | "debug" - QEMU is running on a debugger | |
3209 | "inmigrate" - guest is paused waiting for an incoming migration | |
3210 | "internal-error" - An internal error that prevents further guest | |
3211 | execution has occurred | |
3212 | "io-error" - the last IOP has failed and the device is configured | |
3213 | to pause on I/O errors | |
3214 | "paused" - guest has been paused via the 'stop' command | |
3215 | "postmigrate" - guest is paused following a successful 'migrate' | |
3216 | "prelaunch" - QEMU was started with -S and guest has not started | |
3217 | "finish-migrate" - guest is paused to finish the migration process | |
3218 | "restore-vm" - guest is paused to restore VM state | |
3219 | "running" - guest is actively running | |
3220 | "save-vm" - guest is paused to save the VM state | |
3221 | "shutdown" - guest is shut down (and -no-shutdown is in use) | |
3222 | "watchdog" - the watchdog action is configured to pause and | |
3223 | has been triggered | |
82a56f0d LC |
3224 | |
3225 | Example: | |
3226 | ||
3227 | -> { "execute": "query-status" } | |
9e37b9dc | 3228 | <- { "return": { "running": true, "singlestep": false, "status": "running" } } |
82a56f0d LC |
3229 | |
3230 | EQMP | |
1fa9a5e4 LC |
3231 | |
3232 | { | |
3233 | .name = "query-status", | |
3234 | .args_type = "", | |
7fad30f0 | 3235 | .mhandler.cmd_new = qmp_marshal_query_status, |
1fa9a5e4 | 3236 | }, |
82a56f0d LC |
3237 | |
3238 | SQMP | |
3239 | query-mice | |
3240 | ---------- | |
3241 | ||
3242 | Show VM mice information. | |
3243 | ||
3244 | Each mouse is represented by a json-object, the returned value is a json-array | |
3245 | of all mice. | |
3246 | ||
3247 | The mouse json-object contains the following: | |
3248 | ||
3249 | - "name": mouse's name (json-string) | |
3250 | - "index": mouse's index (json-int) | |
3251 | - "current": true if this mouse is receiving events, false otherwise (json-bool) | |
3252 | - "absolute": true if the mouse generates absolute input events (json-bool) | |
3253 | ||
3254 | Example: | |
3255 | ||
3256 | -> { "execute": "query-mice" } | |
3257 | <- { | |
3258 | "return":[ | |
3259 | { | |
3260 | "name":"QEMU Microsoft Mouse", | |
3261 | "index":0, | |
3262 | "current":false, | |
3263 | "absolute":false | |
3264 | }, | |
3265 | { | |
3266 | "name":"QEMU PS/2 Mouse", | |
3267 | "index":1, | |
3268 | "current":true, | |
3269 | "absolute":true | |
3270 | } | |
3271 | ] | |
3272 | } | |
3273 | ||
3274 | EQMP | |
3275 | ||
e235cec3 LC |
3276 | { |
3277 | .name = "query-mice", | |
3278 | .args_type = "", | |
7fad30f0 | 3279 | .mhandler.cmd_new = qmp_marshal_query_mice, |
e235cec3 LC |
3280 | }, |
3281 | ||
82a56f0d LC |
3282 | SQMP |
3283 | query-vnc | |
3284 | --------- | |
3285 | ||
3286 | Show VNC server information. | |
3287 | ||
3288 | Return a json-object with server information. Connected clients are returned | |
3289 | as a json-array of json-objects. | |
3290 | ||
3291 | The main json-object contains the following: | |
3292 | ||
3293 | - "enabled": true or false (json-bool) | |
3294 | - "host": server's IP address (json-string) | |
3295 | - "family": address family (json-string) | |
3296 | - Possible values: "ipv4", "ipv6", "unix", "unknown" | |
3297 | - "service": server's port number (json-string) | |
3298 | - "auth": authentication method (json-string) | |
3299 | - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight", | |
3300 | "tls", "ultra", "unknown", "vencrypt", "vencrypt", | |
3301 | "vencrypt+plain", "vencrypt+tls+none", | |
3302 | "vencrypt+tls+plain", "vencrypt+tls+sasl", | |
3303 | "vencrypt+tls+vnc", "vencrypt+x509+none", | |
3304 | "vencrypt+x509+plain", "vencrypt+x509+sasl", | |
3305 | "vencrypt+x509+vnc", "vnc" | |
3306 | - "clients": a json-array of all connected clients | |
3307 | ||
3308 | Clients are described by a json-object, each one contain the following: | |
3309 | ||
3310 | - "host": client's IP address (json-string) | |
3311 | - "family": address family (json-string) | |
3312 | - Possible values: "ipv4", "ipv6", "unix", "unknown" | |
3313 | - "service": client's port number (json-string) | |
3314 | - "x509_dname": TLS dname (json-string, optional) | |
3315 | - "sasl_username": SASL username (json-string, optional) | |
3316 | ||
3317 | Example: | |
3318 | ||
3319 | -> { "execute": "query-vnc" } | |
3320 | <- { | |
3321 | "return":{ | |
3322 | "enabled":true, | |
3323 | "host":"0.0.0.0", | |
3324 | "service":"50402", | |
3325 | "auth":"vnc", | |
3326 | "family":"ipv4", | |
3327 | "clients":[ | |
3328 | { | |
3329 | "host":"127.0.0.1", | |
3330 | "service":"50401", | |
3331 | "family":"ipv4" | |
3332 | } | |
3333 | ] | |
3334 | } | |
3335 | } | |
3336 | ||
3337 | EQMP | |
3338 | ||
2b54aa87 LC |
3339 | { |
3340 | .name = "query-vnc", | |
3341 | .args_type = "", | |
7fad30f0 | 3342 | .mhandler.cmd_new = qmp_marshal_query_vnc, |
2b54aa87 | 3343 | }, |
df887684 GH |
3344 | { |
3345 | .name = "query-vnc-servers", | |
3346 | .args_type = "", | |
7fad30f0 | 3347 | .mhandler.cmd_new = qmp_marshal_query_vnc_servers, |
df887684 | 3348 | }, |
2b54aa87 | 3349 | |
cb42a870 GH |
3350 | SQMP |
3351 | query-spice | |
3352 | ----------- | |
3353 | ||
3354 | Show SPICE server information. | |
3355 | ||
3356 | Return a json-object with server information. Connected clients are returned | |
3357 | as a json-array of json-objects. | |
3358 | ||
3359 | The main json-object contains the following: | |
3360 | ||
3361 | - "enabled": true or false (json-bool) | |
3362 | - "host": server's IP address (json-string) | |
3363 | - "port": server's port number (json-int, optional) | |
3364 | - "tls-port": server's port number (json-int, optional) | |
3365 | - "auth": authentication method (json-string) | |
3366 | - Possible values: "none", "spice" | |
3367 | - "channels": a json-array of all active channels clients | |
3368 | ||
3369 | Channels are described by a json-object, each one contain the following: | |
3370 | ||
3371 | - "host": client's IP address (json-string) | |
3372 | - "family": address family (json-string) | |
3373 | - Possible values: "ipv4", "ipv6", "unix", "unknown" | |
3374 | - "port": client's port number (json-string) | |
3375 | - "connection-id": spice connection id. All channels with the same id | |
3376 | belong to the same spice session (json-int) | |
3377 | - "channel-type": channel type. "1" is the main control channel, filter for | |
3378 | this one if you want track spice sessions only (json-int) | |
3379 | - "channel-id": channel id. Usually "0", might be different needed when | |
3380 | multiple channels of the same type exist, such as multiple | |
3381 | display channels in a multihead setup (json-int) | |
3599d46b | 3382 | - "tls": whether the channel is encrypted (json-bool) |
cb42a870 GH |
3383 | |
3384 | Example: | |
3385 | ||
3386 | -> { "execute": "query-spice" } | |
3387 | <- { | |
3388 | "return": { | |
3389 | "enabled": true, | |
3390 | "auth": "spice", | |
3391 | "port": 5920, | |
3392 | "tls-port": 5921, | |
3393 | "host": "0.0.0.0", | |
3394 | "channels": [ | |
3395 | { | |
3396 | "port": "54924", | |
3397 | "family": "ipv4", | |
3398 | "channel-type": 1, | |
3399 | "connection-id": 1804289383, | |
3400 | "host": "127.0.0.1", | |
3401 | "channel-id": 0, | |
3402 | "tls": true | |
3403 | }, | |
3404 | { | |
3405 | "port": "36710", | |
3406 | "family": "ipv4", | |
3407 | "channel-type": 4, | |
3408 | "connection-id": 1804289383, | |
3409 | "host": "127.0.0.1", | |
3410 | "channel-id": 0, | |
3411 | "tls": false | |
3412 | }, | |
3413 | [ ... more channels follow ... ] | |
3414 | ] | |
3415 | } | |
3416 | } | |
3417 | ||
3418 | EQMP | |
3419 | ||
d1f29646 LC |
3420 | #if defined(CONFIG_SPICE) |
3421 | { | |
3422 | .name = "query-spice", | |
3423 | .args_type = "", | |
7fad30f0 | 3424 | .mhandler.cmd_new = qmp_marshal_query_spice, |
d1f29646 LC |
3425 | }, |
3426 | #endif | |
3427 | ||
82a56f0d LC |
3428 | SQMP |
3429 | query-name | |
3430 | ---------- | |
3431 | ||
3432 | Show VM name. | |
3433 | ||
3434 | Return a json-object with the following information: | |
3435 | ||
3436 | - "name": VM's name (json-string, optional) | |
3437 | ||
3438 | Example: | |
3439 | ||
3440 | -> { "execute": "query-name" } | |
3441 | <- { "return": { "name": "qemu-name" } } | |
3442 | ||
3443 | EQMP | |
3444 | ||
48a32bed AL |
3445 | { |
3446 | .name = "query-name", | |
3447 | .args_type = "", | |
7fad30f0 | 3448 | .mhandler.cmd_new = qmp_marshal_query_name, |
48a32bed AL |
3449 | }, |
3450 | ||
82a56f0d LC |
3451 | SQMP |
3452 | query-uuid | |
3453 | ---------- | |
3454 | ||
3455 | Show VM UUID. | |
3456 | ||
3457 | Return a json-object with the following information: | |
3458 | ||
3459 | - "UUID": Universally Unique Identifier (json-string) | |
3460 | ||
3461 | Example: | |
3462 | ||
3463 | -> { "execute": "query-uuid" } | |
3464 | <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } } | |
3465 | ||
3466 | EQMP | |
3467 | ||
efab767e LC |
3468 | { |
3469 | .name = "query-uuid", | |
3470 | .args_type = "", | |
7fad30f0 | 3471 | .mhandler.cmd_new = qmp_marshal_query_uuid, |
efab767e LC |
3472 | }, |
3473 | ||
1f8f987d AK |
3474 | SQMP |
3475 | query-command-line-options | |
3476 | -------------------------- | |
3477 | ||
3478 | Show command line option schema. | |
3479 | ||
3480 | Return a json-array of command line option schema for all options (or for | |
3481 | the given option), returning an error if the given option doesn't exist. | |
3482 | ||
3483 | Each array entry contains the following: | |
3484 | ||
3485 | - "option": option name (json-string) | |
3486 | - "parameters": a json-array describes all parameters of the option: | |
3487 | - "name": parameter name (json-string) | |
3488 | - "type": parameter type (one of 'string', 'boolean', 'number', | |
3489 | or 'size') | |
3490 | - "help": human readable description of the parameter | |
3491 | (json-string, optional) | |
e36af94f CL |
3492 | - "default": default value string for the parameter |
3493 | (json-string, optional) | |
1f8f987d AK |
3494 | |
3495 | Example: | |
3496 | ||
3497 | -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } } | |
3498 | <- { "return": [ | |
3499 | { | |
3500 | "parameters": [ | |
3501 | { | |
3502 | "name": "romfile", | |
3503 | "type": "string" | |
3504 | }, | |
3505 | { | |
3506 | "name": "bootindex", | |
3507 | "type": "number" | |
3508 | } | |
3509 | ], | |
3510 | "option": "option-rom" | |
3511 | } | |
3512 | ] | |
3513 | } | |
3514 | ||
3515 | EQMP | |
3516 | ||
3517 | { | |
3518 | .name = "query-command-line-options", | |
3519 | .args_type = "option:s?", | |
7fad30f0 | 3520 | .mhandler.cmd_new = qmp_marshal_query_command_line_options, |
1f8f987d AK |
3521 | }, |
3522 | ||
82a56f0d LC |
3523 | SQMP |
3524 | query-migrate | |
3525 | ------------- | |
3526 | ||
3527 | Migration status. | |
3528 | ||
3529 | Return a json-object. If migration is active there will be another json-object | |
3530 | with RAM migration status and if block migration is active another one with | |
3531 | block migration status. | |
3532 | ||
3533 | The main json-object contains the following: | |
3534 | ||
3535 | - "status": migration status (json-string) | |
3b695950 | 3536 | - Possible values: "setup", "active", "completed", "failed", "cancelled" |
7aa939af JQ |
3537 | - "total-time": total amount of ms since migration started. If |
3538 | migration has ended, it returns the total migration | |
817c6045 | 3539 | time (json-int) |
8f3067bd MH |
3540 | - "setup-time" amount of setup time in milliseconds _before_ the |
3541 | iterations begin but _after_ the QMP command is issued. | |
3542 | This is designed to provide an accounting of any activities | |
3543 | (such as RDMA pinning) which may be expensive, but do not | |
3544 | actually occur during the iterative migration rounds | |
3545 | themselves. (json-int) | |
9c5a9fcf JQ |
3546 | - "downtime": only present when migration has finished correctly |
3547 | total amount in ms for downtime that happened (json-int) | |
2c52ddf1 JQ |
3548 | - "expected-downtime": only present while migration is active |
3549 | total amount in ms for downtime that was calculated on | |
817c6045 | 3550 | the last bitmap round (json-int) |
82a56f0d | 3551 | - "ram": only present if "status" is "active", it is a json-object with the |
817c6045 JQ |
3552 | following RAM information: |
3553 | - "transferred": amount transferred in bytes (json-int) | |
3554 | - "remaining": amount remaining to transfer in bytes (json-int) | |
3555 | - "total": total amount of memory in bytes (json-int) | |
3556 | - "duplicate": number of pages filled entirely with the same | |
3557 | byte (json-int) | |
3558 | These are sent over the wire much more efficiently. | |
f1c72795 | 3559 | - "skipped": number of skipped zero pages (json-int) |
805a2505 | 3560 | - "normal" : number of whole pages transferred. I.e. they |
817c6045 JQ |
3561 | were not sent as duplicate or xbzrle pages (json-int) |
3562 | - "normal-bytes" : number of bytes transferred in whole | |
3563 | pages. This is just normal pages times size of one page, | |
3564 | but this way upper levels don't need to care about page | |
3565 | size (json-int) | |
58570ed8 | 3566 | - "dirty-sync-count": times that dirty ram was synchronized (json-int) |
82a56f0d | 3567 | - "disk": only present if "status" is "active" and it is a block migration, |
817c6045 JQ |
3568 | it is a json-object with the following disk information: |
3569 | - "transferred": amount transferred in bytes (json-int) | |
3570 | - "remaining": amount remaining to transfer in bytes json-int) | |
3571 | - "total": total disk size in bytes (json-int) | |
f36d55af OW |
3572 | - "xbzrle-cache": only present if XBZRLE is active. |
3573 | It is a json-object with the following XBZRLE information: | |
817c6045 JQ |
3574 | - "cache-size": XBZRLE cache size in bytes |
3575 | - "bytes": number of bytes transferred for XBZRLE compressed pages | |
f36d55af | 3576 | - "pages": number of XBZRLE compressed pages |
817c6045 | 3577 | - "cache-miss": number of XBRZRLE page cache misses |
8bc39233 | 3578 | - "cache-miss-rate": rate of XBRZRLE page cache misses |
817c6045 JQ |
3579 | - "overflow": number of times XBZRLE overflows. This means |
3580 | that the XBZRLE encoding was bigger than just sent the | |
3581 | whole page, and then we sent the whole page instead (as as | |
3582 | normal page). | |
3583 | ||
82a56f0d LC |
3584 | Examples: |
3585 | ||
3586 | 1. Before the first migration | |
3587 | ||
3588 | -> { "execute": "query-migrate" } | |
3589 | <- { "return": {} } | |
3590 | ||
3591 | 2. Migration is done and has succeeded | |
3592 | ||
3593 | -> { "execute": "query-migrate" } | |
004d4c10 OW |
3594 | <- { "return": { |
3595 | "status": "completed", | |
3596 | "ram":{ | |
3597 | "transferred":123, | |
3598 | "remaining":123, | |
3599 | "total":246, | |
3600 | "total-time":12345, | |
8f3067bd | 3601 | "setup-time":12345, |
9c5a9fcf | 3602 | "downtime":12345, |
004d4c10 OW |
3603 | "duplicate":123, |
3604 | "normal":123, | |
58570ed8 C |
3605 | "normal-bytes":123456, |
3606 | "dirty-sync-count":15 | |
004d4c10 OW |
3607 | } |
3608 | } | |
3609 | } | |
82a56f0d LC |
3610 | |
3611 | 3. Migration is done and has failed | |
3612 | ||
3613 | -> { "execute": "query-migrate" } | |
3614 | <- { "return": { "status": "failed" } } | |
3615 | ||
3616 | 4. Migration is being performed and is not a block migration: | |
3617 | ||
3618 | -> { "execute": "query-migrate" } | |
3619 | <- { | |
3620 | "return":{ | |
3621 | "status":"active", | |
3622 | "ram":{ | |
3623 | "transferred":123, | |
3624 | "remaining":123, | |
62d4e3fe | 3625 | "total":246, |
004d4c10 | 3626 | "total-time":12345, |
8f3067bd | 3627 | "setup-time":12345, |
2c52ddf1 | 3628 | "expected-downtime":12345, |
004d4c10 OW |
3629 | "duplicate":123, |
3630 | "normal":123, | |
58570ed8 C |
3631 | "normal-bytes":123456, |
3632 | "dirty-sync-count":15 | |
82a56f0d LC |
3633 | } |
3634 | } | |
3635 | } | |
3636 | ||
3637 | 5. Migration is being performed and is a block migration: | |
3638 | ||
3639 | -> { "execute": "query-migrate" } | |
3640 | <- { | |
3641 | "return":{ | |
3642 | "status":"active", | |
3643 | "ram":{ | |
3644 | "total":1057024, | |
3645 | "remaining":1053304, | |
62d4e3fe | 3646 | "transferred":3720, |
004d4c10 | 3647 | "total-time":12345, |
8f3067bd | 3648 | "setup-time":12345, |
2c52ddf1 | 3649 | "expected-downtime":12345, |
004d4c10 OW |
3650 | "duplicate":123, |
3651 | "normal":123, | |
58570ed8 C |
3652 | "normal-bytes":123456, |
3653 | "dirty-sync-count":15 | |
82a56f0d LC |
3654 | }, |
3655 | "disk":{ | |
3656 | "total":20971520, | |
3657 | "remaining":20880384, | |
3658 | "transferred":91136 | |
3659 | } | |
3660 | } | |
3661 | } | |
3662 | ||
f36d55af OW |
3663 | 6. Migration is being performed and XBZRLE is active: |
3664 | ||
3665 | -> { "execute": "query-migrate" } | |
3666 | <- { | |
3667 | "return":{ | |
3668 | "status":"active", | |
3669 | "capabilities" : [ { "capability": "xbzrle", "state" : true } ], | |
3670 | "ram":{ | |
3671 | "total":1057024, | |
3672 | "remaining":1053304, | |
3673 | "transferred":3720, | |
3674 | "total-time":12345, | |
8f3067bd | 3675 | "setup-time":12345, |
2c52ddf1 | 3676 | "expected-downtime":12345, |
f36d55af OW |
3677 | "duplicate":10, |
3678 | "normal":3333, | |
58570ed8 C |
3679 | "normal-bytes":3412992, |
3680 | "dirty-sync-count":15 | |
f36d55af OW |
3681 | }, |
3682 | "xbzrle-cache":{ | |
3683 | "cache-size":67108864, | |
3684 | "bytes":20971520, | |
3685 | "pages":2444343, | |
3686 | "cache-miss":2244, | |
8bc39233 | 3687 | "cache-miss-rate":0.123, |
f36d55af OW |
3688 | "overflow":34434 |
3689 | } | |
3690 | } | |
3691 | } | |
3692 | ||
82a56f0d LC |
3693 | EQMP |
3694 | ||
791e7c82 LC |
3695 | { |
3696 | .name = "query-migrate", | |
3697 | .args_type = "", | |
7fad30f0 | 3698 | .mhandler.cmd_new = qmp_marshal_query_migrate, |
791e7c82 LC |
3699 | }, |
3700 | ||
bbf6da32 | 3701 | SQMP |
00458433 | 3702 | migrate-set-capabilities |
817c6045 | 3703 | ------------------------ |
00458433 OW |
3704 | |
3705 | Enable/Disable migration capabilities | |
3706 | ||
817c6045 | 3707 | - "xbzrle": XBZRLE support |
d6d69731 HZ |
3708 | - "rdma-pin-all": pin all pages when using RDMA during migration |
3709 | - "auto-converge": throttle down guest to help convergence of migration | |
3710 | - "zero-blocks": compress zero blocks during block migration | |
164f59e8 | 3711 | - "compress": use multiple compression threads to accelerate live migration |
72e72e1a | 3712 | - "events": generate events for each migration state change |
32c3db5b | 3713 | - "postcopy-ram": postcopy mode for live migration |
00458433 OW |
3714 | |
3715 | Arguments: | |
3716 | ||
3717 | Example: | |
3718 | ||
3719 | -> { "execute": "migrate-set-capabilities" , "arguments": | |
3720 | { "capabilities": [ { "capability": "xbzrle", "state": true } ] } } | |
3721 | ||
3722 | EQMP | |
3723 | ||
3724 | { | |
3725 | .name = "migrate-set-capabilities", | |
43d0a2c1 | 3726 | .args_type = "capabilities:q", |
00458433 | 3727 | .params = "capability:s,state:b", |
7fad30f0 | 3728 | .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities, |
00458433 OW |
3729 | }, |
3730 | SQMP | |
bbf6da32 | 3731 | query-migrate-capabilities |
817c6045 | 3732 | -------------------------- |
bbf6da32 OW |
3733 | |
3734 | Query current migration capabilities | |
3735 | ||
3736 | - "capabilities": migration capabilities state | |
3737 | - "xbzrle" : XBZRLE state (json-bool) | |
d6d69731 HZ |
3738 | - "rdma-pin-all" : RDMA Pin Page state (json-bool) |
3739 | - "auto-converge" : Auto Converge state (json-bool) | |
3740 | - "zero-blocks" : Zero Blocks state (json-bool) | |
164f59e8 HZ |
3741 | - "compress": Multiple compression threads state (json-bool) |
3742 | - "events": Migration state change event state (json-bool) | |
32c3db5b | 3743 | - "postcopy-ram": postcopy ram state (json-bool) |
bbf6da32 OW |
3744 | |
3745 | Arguments: | |
3746 | ||
3747 | Example: | |
3748 | ||
3749 | -> { "execute": "query-migrate-capabilities" } | |
164f59e8 HZ |
3750 | <- {"return": [ |
3751 | {"state": false, "capability": "xbzrle"}, | |
3752 | {"state": false, "capability": "rdma-pin-all"}, | |
3753 | {"state": false, "capability": "auto-converge"}, | |
3754 | {"state": false, "capability": "zero-blocks"}, | |
3755 | {"state": false, "capability": "compress"}, | |
3756 | {"state": true, "capability": "events"}, | |
32c3db5b | 3757 | {"state": false, "capability": "postcopy-ram"} |
164f59e8 | 3758 | ]} |
dbca1b37 | 3759 | |
bbf6da32 OW |
3760 | EQMP |
3761 | ||
3762 | { | |
3763 | .name = "query-migrate-capabilities", | |
3764 | .args_type = "", | |
7fad30f0 | 3765 | .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities, |
bbf6da32 OW |
3766 | }, |
3767 | ||
85de8323 LL |
3768 | SQMP |
3769 | migrate-set-parameters | |
3770 | ---------------------- | |
3771 | ||
3772 | Set migration parameters | |
3773 | ||
3774 | - "compress-level": set compression level during migration (json-int) | |
3775 | - "compress-threads": set compression thread count for migration (json-int) | |
3776 | - "decompress-threads": set decompression thread count for migration (json-int) | |
d85a31d1 JH |
3777 | - "cpu-throttle-initial": set initial percentage of time guest cpus are |
3778 | throttled for auto-converge (json-int) | |
3779 | - "cpu-throttle-increment": set throttle increasing percentage for | |
3780 | auto-converge (json-int) | |
85de8323 LL |
3781 | |
3782 | Arguments: | |
3783 | ||
3784 | Example: | |
3785 | ||
3786 | -> { "execute": "migrate-set-parameters" , "arguments": | |
3787 | { "compress-level": 1 } } | |
3788 | ||
3789 | EQMP | |
3790 | ||
3791 | { | |
3792 | .name = "migrate-set-parameters", | |
3793 | .args_type = | |
d85a31d1 | 3794 | "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?", |
7fad30f0 | 3795 | .mhandler.cmd_new = qmp_marshal_migrate_set_parameters, |
85de8323 LL |
3796 | }, |
3797 | SQMP | |
3798 | query-migrate-parameters | |
3799 | ------------------------ | |
3800 | ||
3801 | Query current migration parameters | |
3802 | ||
3803 | - "parameters": migration parameters value | |
3804 | - "compress-level" : compression level value (json-int) | |
3805 | - "compress-threads" : compression thread count value (json-int) | |
3806 | - "decompress-threads" : decompression thread count value (json-int) | |
d85a31d1 JH |
3807 | - "cpu-throttle-initial" : initial percentage of time guest cpus are |
3808 | throttled (json-int) | |
3809 | - "cpu-throttle-increment" : throttle increasing percentage for | |
3810 | auto-converge (json-int) | |
85de8323 LL |
3811 | |
3812 | Arguments: | |
3813 | ||
3814 | Example: | |
3815 | ||
3816 | -> { "execute": "query-migrate-parameters" } | |
3817 | <- { | |
3818 | "return": { | |
9c994a97 | 3819 | "decompress-threads": 2, |
d85a31d1 | 3820 | "cpu-throttle-increment": 10, |
9c994a97 HZ |
3821 | "compress-threads": 8, |
3822 | "compress-level": 1, | |
d85a31d1 | 3823 | "cpu-throttle-initial": 20 |
85de8323 LL |
3824 | } |
3825 | } | |
3826 | ||
3827 | EQMP | |
3828 | ||
3829 | { | |
3830 | .name = "query-migrate-parameters", | |
3831 | .args_type = "", | |
7fad30f0 | 3832 | .mhandler.cmd_new = qmp_marshal_query_migrate_parameters, |
85de8323 LL |
3833 | }, |
3834 | ||
82a56f0d LC |
3835 | SQMP |
3836 | query-balloon | |
3837 | ------------- | |
3838 | ||
3839 | Show balloon information. | |
3840 | ||
3841 | Make an asynchronous request for balloon info. When the request completes a | |
3842 | json-object will be returned containing the following data: | |
3843 | ||
3844 | - "actual": current balloon value in bytes (json-int) | |
82a56f0d LC |
3845 | |
3846 | Example: | |
3847 | ||
3848 | -> { "execute": "query-balloon" } | |
3849 | <- { | |
3850 | "return":{ | |
3851 | "actual":1073741824, | |
82a56f0d LC |
3852 | } |
3853 | } | |
3854 | ||
3855 | EQMP | |
3856 | ||
96637bcd LC |
3857 | { |
3858 | .name = "query-balloon", | |
3859 | .args_type = "", | |
7fad30f0 | 3860 | .mhandler.cmd_new = qmp_marshal_query_balloon, |
96637bcd | 3861 | }, |
b4b12c62 | 3862 | |
fb5458cd SH |
3863 | { |
3864 | .name = "query-block-jobs", | |
3865 | .args_type = "", | |
7fad30f0 | 3866 | .mhandler.cmd_new = qmp_marshal_query_block_jobs, |
fb5458cd SH |
3867 | }, |
3868 | ||
b4b12c62 AL |
3869 | { |
3870 | .name = "qom-list", | |
3871 | .args_type = "path:s", | |
7fad30f0 | 3872 | .mhandler.cmd_new = qmp_marshal_qom_list, |
b4b12c62 | 3873 | }, |
eb6e8ea5 AL |
3874 | |
3875 | { | |
3876 | .name = "qom-set", | |
b9f8978c | 3877 | .args_type = "path:s,property:s,value:q", |
6eb3937e | 3878 | .mhandler.cmd_new = qmp_marshal_qom_set, |
eb6e8ea5 AL |
3879 | }, |
3880 | ||
3881 | { | |
3882 | .name = "qom-get", | |
3883 | .args_type = "path:s,property:s", | |
6eb3937e | 3884 | .mhandler.cmd_new = qmp_marshal_qom_get, |
eb6e8ea5 | 3885 | }, |
270b243f | 3886 | |
6dd844db PB |
3887 | { |
3888 | .name = "nbd-server-start", | |
ddffee39 | 3889 | .args_type = "addr:q,tls-creds:s?", |
7fad30f0 | 3890 | .mhandler.cmd_new = qmp_marshal_nbd_server_start, |
6dd844db PB |
3891 | }, |
3892 | { | |
3893 | .name = "nbd-server-add", | |
3894 | .args_type = "device:B,writable:b?", | |
7fad30f0 | 3895 | .mhandler.cmd_new = qmp_marshal_nbd_server_add, |
6dd844db PB |
3896 | }, |
3897 | { | |
3898 | .name = "nbd-server-stop", | |
3899 | .args_type = "", | |
7fad30f0 | 3900 | .mhandler.cmd_new = qmp_marshal_nbd_server_stop, |
6dd844db PB |
3901 | }, |
3902 | ||
270b243f LC |
3903 | { |
3904 | .name = "change-vnc-password", | |
3905 | .args_type = "password:s", | |
7fad30f0 | 3906 | .mhandler.cmd_new = qmp_marshal_change_vnc_password, |
270b243f | 3907 | }, |
5eeee3fa AL |
3908 | { |
3909 | .name = "qom-list-types", | |
3910 | .args_type = "implements:s?,abstract:b?", | |
7fad30f0 | 3911 | .mhandler.cmd_new = qmp_marshal_qom_list_types, |
5eeee3fa | 3912 | }, |
1daa31b9 AL |
3913 | |
3914 | { | |
3915 | .name = "device-list-properties", | |
3916 | .args_type = "typename:s", | |
7fad30f0 | 3917 | .mhandler.cmd_new = qmp_marshal_device_list_properties, |
1daa31b9 AL |
3918 | }, |
3919 | ||
01d3c80d AL |
3920 | { |
3921 | .name = "query-machines", | |
3922 | .args_type = "", | |
7fad30f0 | 3923 | .mhandler.cmd_new = qmp_marshal_query_machines, |
01d3c80d AL |
3924 | }, |
3925 | ||
e4e31c63 AL |
3926 | { |
3927 | .name = "query-cpu-definitions", | |
3928 | .args_type = "", | |
7fad30f0 | 3929 | .mhandler.cmd_new = qmp_marshal_query_cpu_definitions, |
e4e31c63 AL |
3930 | }, |
3931 | ||
99afc91d DB |
3932 | { |
3933 | .name = "query-target", | |
3934 | .args_type = "", | |
7fad30f0 | 3935 | .mhandler.cmd_new = qmp_marshal_query_target, |
99afc91d | 3936 | }, |
f1a1a356 | 3937 | |
d1a0cf73 SB |
3938 | { |
3939 | .name = "query-tpm", | |
3940 | .args_type = "", | |
7fad30f0 | 3941 | .mhandler.cmd_new = qmp_marshal_query_tpm, |
d1a0cf73 SB |
3942 | }, |
3943 | ||
28c4fa32 CB |
3944 | SQMP |
3945 | query-tpm | |
3946 | --------- | |
3947 | ||
3948 | Return information about the TPM device. | |
3949 | ||
3950 | Arguments: None | |
3951 | ||
3952 | Example: | |
3953 | ||
3954 | -> { "execute": "query-tpm" } | |
3955 | <- { "return": | |
3956 | [ | |
3957 | { "model": "tpm-tis", | |
3958 | "options": | |
3959 | { "type": "passthrough", | |
3960 | "data": | |
3961 | { "cancel-path": "/sys/class/misc/tpm0/device/cancel", | |
3962 | "path": "/dev/tpm0" | |
3963 | } | |
3964 | }, | |
3965 | "id": "tpm0" | |
3966 | } | |
3967 | ] | |
3968 | } | |
3969 | ||
3970 | EQMP | |
3971 | ||
d1a0cf73 SB |
3972 | { |
3973 | .name = "query-tpm-models", | |
3974 | .args_type = "", | |
7fad30f0 | 3975 | .mhandler.cmd_new = qmp_marshal_query_tpm_models, |
d1a0cf73 SB |
3976 | }, |
3977 | ||
28c4fa32 CB |
3978 | SQMP |
3979 | query-tpm-models | |
3980 | ---------------- | |
3981 | ||
3982 | Return a list of supported TPM models. | |
3983 | ||
3984 | Arguments: None | |
3985 | ||
3986 | Example: | |
3987 | ||
3988 | -> { "execute": "query-tpm-models" } | |
3989 | <- { "return": [ "tpm-tis" ] } | |
3990 | ||
3991 | EQMP | |
3992 | ||
d1a0cf73 SB |
3993 | { |
3994 | .name = "query-tpm-types", | |
3995 | .args_type = "", | |
7fad30f0 | 3996 | .mhandler.cmd_new = qmp_marshal_query_tpm_types, |
d1a0cf73 SB |
3997 | }, |
3998 | ||
28c4fa32 CB |
3999 | SQMP |
4000 | query-tpm-types | |
4001 | --------------- | |
4002 | ||
4003 | Return a list of supported TPM types. | |
4004 | ||
4005 | Arguments: None | |
4006 | ||
4007 | Example: | |
4008 | ||
4009 | -> { "execute": "query-tpm-types" } | |
4010 | <- { "return": [ "passthrough" ] } | |
4011 | ||
4012 | EQMP | |
4013 | ||
f1a1a356 GH |
4014 | { |
4015 | .name = "chardev-add", | |
4016 | .args_type = "id:s,backend:q", | |
7fad30f0 | 4017 | .mhandler.cmd_new = qmp_marshal_chardev_add, |
f1a1a356 GH |
4018 | }, |
4019 | ||
4020 | SQMP | |
4021 | chardev-add | |
4022 | ---------------- | |
4023 | ||
4024 | Add a chardev. | |
4025 | ||
4026 | Arguments: | |
4027 | ||
4028 | - "id": the chardev's ID, must be unique (json-string) | |
4029 | - "backend": chardev backend type + parameters | |
4030 | ||
ffbdbe59 | 4031 | Examples: |
f1a1a356 GH |
4032 | |
4033 | -> { "execute" : "chardev-add", | |
4034 | "arguments" : { "id" : "foo", | |
4035 | "backend" : { "type" : "null", "data" : {} } } } | |
4036 | <- { "return": {} } | |
4037 | ||
ffbdbe59 GH |
4038 | -> { "execute" : "chardev-add", |
4039 | "arguments" : { "id" : "bar", | |
4040 | "backend" : { "type" : "file", | |
4041 | "data" : { "out" : "/tmp/bar.log" } } } } | |
4042 | <- { "return": {} } | |
4043 | ||
0a1a7fab GH |
4044 | -> { "execute" : "chardev-add", |
4045 | "arguments" : { "id" : "baz", | |
4046 | "backend" : { "type" : "pty", "data" : {} } } } | |
4047 | <- { "return": { "pty" : "/dev/pty/42" } } | |
4048 | ||
f1a1a356 GH |
4049 | EQMP |
4050 | ||
4051 | { | |
4052 | .name = "chardev-remove", | |
4053 | .args_type = "id:s", | |
7fad30f0 | 4054 | .mhandler.cmd_new = qmp_marshal_chardev_remove, |
f1a1a356 GH |
4055 | }, |
4056 | ||
4057 | ||
4058 | SQMP | |
4059 | chardev-remove | |
4060 | -------------- | |
4061 | ||
4062 | Remove a chardev. | |
4063 | ||
4064 | Arguments: | |
4065 | ||
4066 | - "id": the chardev's ID, must exist and not be in use (json-string) | |
4067 | ||
4068 | Example: | |
4069 | ||
4070 | -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } } | |
4071 | <- { "return": {} } | |
4072 | ||
b1be4280 AK |
4073 | EQMP |
4074 | { | |
4075 | .name = "query-rx-filter", | |
4076 | .args_type = "name:s?", | |
7fad30f0 | 4077 | .mhandler.cmd_new = qmp_marshal_query_rx_filter, |
b1be4280 AK |
4078 | }, |
4079 | ||
4080 | SQMP | |
4081 | query-rx-filter | |
4082 | --------------- | |
4083 | ||
4084 | Show rx-filter information. | |
4085 | ||
4086 | Returns a json-array of rx-filter information for all NICs (or for the | |
4087 | given NIC), returning an error if the given NIC doesn't exist, or | |
4088 | given NIC doesn't support rx-filter querying, or given net client | |
4089 | isn't a NIC. | |
4090 | ||
4091 | The query will clear the event notification flag of each NIC, then qemu | |
4092 | will start to emit event to QMP monitor. | |
4093 | ||
4094 | Each array entry contains the following: | |
4095 | ||
4096 | - "name": net client name (json-string) | |
4097 | - "promiscuous": promiscuous mode is enabled (json-bool) | |
4098 | - "multicast": multicast receive state (one of 'normal', 'none', 'all') | |
4099 | - "unicast": unicast receive state (one of 'normal', 'none', 'all') | |
f7bc8ef8 | 4100 | - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0) |
b1be4280 AK |
4101 | - "broadcast-allowed": allow to receive broadcast (json-bool) |
4102 | - "multicast-overflow": multicast table is overflowed (json-bool) | |
4103 | - "unicast-overflow": unicast table is overflowed (json-bool) | |
4104 | - "main-mac": main macaddr string (json-string) | |
4105 | - "vlan-table": a json-array of active vlan id | |
4106 | - "unicast-table": a json-array of unicast macaddr string | |
4107 | - "multicast-table": a json-array of multicast macaddr string | |
4108 | ||
4109 | Example: | |
4110 | ||
4111 | -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } } | |
4112 | <- { "return": [ | |
4113 | { | |
4114 | "promiscuous": true, | |
4115 | "name": "vnet0", | |
4116 | "main-mac": "52:54:00:12:34:56", | |
4117 | "unicast": "normal", | |
f7bc8ef8 | 4118 | "vlan": "normal", |
b1be4280 AK |
4119 | "vlan-table": [ |
4120 | 4, | |
4121 | 0 | |
4122 | ], | |
4123 | "unicast-table": [ | |
4124 | ], | |
4125 | "multicast": "normal", | |
4126 | "multicast-overflow": false, | |
4127 | "unicast-overflow": false, | |
4128 | "multicast-table": [ | |
4129 | "01:00:5e:00:00:01", | |
4130 | "33:33:00:00:00:01", | |
4131 | "33:33:ff:12:34:56" | |
4132 | ], | |
4133 | "broadcast-allowed": false | |
4134 | } | |
4135 | ] | |
4136 | } | |
4137 | ||
d26c9a15 KW |
4138 | EQMP |
4139 | ||
4140 | { | |
4141 | .name = "blockdev-add", | |
4142 | .args_type = "options:q", | |
7fad30f0 | 4143 | .mhandler.cmd_new = qmp_marshal_blockdev_add, |
d26c9a15 KW |
4144 | }, |
4145 | ||
4146 | SQMP | |
4147 | blockdev-add | |
4148 | ------------ | |
4149 | ||
4150 | Add a block device. | |
4151 | ||
da2cf4e8 | 4152 | This command is still a work in progress. It doesn't support all |
81b936ae AG |
4153 | block drivers among other things. Stay away from it unless you want |
4154 | to help with its development. | |
da2cf4e8 | 4155 | |
d26c9a15 KW |
4156 | Arguments: |
4157 | ||
4158 | - "options": block driver options | |
4159 | ||
4160 | Example (1): | |
4161 | ||
4162 | -> { "execute": "blockdev-add", | |
4163 | "arguments": { "options" : { "driver": "qcow2", | |
4164 | "file": { "driver": "file", | |
4165 | "filename": "test.qcow2" } } } } | |
4166 | <- { "return": {} } | |
4167 | ||
4168 | Example (2): | |
4169 | ||
4170 | -> { "execute": "blockdev-add", | |
4171 | "arguments": { | |
4172 | "options": { | |
4173 | "driver": "qcow2", | |
4174 | "id": "my_disk", | |
4175 | "discard": "unmap", | |
4176 | "cache": { | |
4177 | "direct": true, | |
4178 | "writeback": true | |
4179 | }, | |
4180 | "file": { | |
4181 | "driver": "file", | |
4182 | "filename": "/tmp/test.qcow2" | |
4183 | }, | |
4184 | "backing": { | |
4185 | "driver": "raw", | |
4186 | "file": { | |
4187 | "driver": "file", | |
4188 | "filename": "/dev/fdset/4" | |
4189 | } | |
4190 | } | |
4191 | } | |
4192 | } | |
4193 | } | |
4194 | ||
4195 | <- { "return": {} } | |
4196 | ||
81b936ae AG |
4197 | EQMP |
4198 | ||
4199 | { | |
4200 | .name = "x-blockdev-del", | |
4201 | .args_type = "id:s?,node-name:s?", | |
4202 | .mhandler.cmd_new = qmp_marshal_x_blockdev_del, | |
4203 | }, | |
4204 | ||
4205 | SQMP | |
4206 | x-blockdev-del | |
4207 | ------------ | |
4208 | Since 2.5 | |
4209 | ||
4210 | Deletes a block device thas has been added using blockdev-add. | |
4211 | The selected device can be either a block backend or a graph node. | |
4212 | ||
4213 | In the former case the backend will be destroyed, along with its | |
4214 | inserted medium if there's any. The command will fail if the backend | |
4215 | or its medium are in use. | |
4216 | ||
4217 | In the latter case the node will be destroyed. The command will fail | |
4218 | if the node is attached to a block backend or is otherwise being | |
4219 | used. | |
4220 | ||
4221 | One of "id" or "node-name" must be specified, but not both. | |
4222 | ||
4223 | This command is still a work in progress and is considered | |
4224 | experimental. Stay away from it unless you want to help with its | |
4225 | development. | |
4226 | ||
4227 | Arguments: | |
4228 | ||
4229 | - "id": Name of the block backend device to delete (json-string, optional) | |
4230 | - "node-name": Name of the graph node to delete (json-string, optional) | |
4231 | ||
4232 | Example: | |
4233 | ||
4234 | -> { "execute": "blockdev-add", | |
4235 | "arguments": { | |
4236 | "options": { | |
4237 | "driver": "qcow2", | |
4238 | "id": "drive0", | |
4239 | "file": { | |
4240 | "driver": "file", | |
4241 | "filename": "test.qcow2" | |
4242 | } | |
4243 | } | |
4244 | } | |
4245 | } | |
4246 | ||
4247 | <- { "return": {} } | |
4248 | ||
4249 | -> { "execute": "x-blockdev-del", | |
4250 | "arguments": { "id": "drive0" } | |
4251 | } | |
4252 | <- { "return": {} } | |
4253 | ||
7d8a9f71 HR |
4254 | EQMP |
4255 | ||
4256 | { | |
4257 | .name = "blockdev-open-tray", | |
4258 | .args_type = "device:s,force:b?", | |
4259 | .mhandler.cmd_new = qmp_marshal_blockdev_open_tray, | |
4260 | }, | |
4261 | ||
4262 | SQMP | |
4263 | blockdev-open-tray | |
4264 | ------------------ | |
4265 | ||
4266 | Opens a block device's tray. If there is a block driver state tree inserted as a | |
4267 | medium, it will become inaccessible to the guest (but it will remain associated | |
4268 | to the block device, so closing the tray will make it accessible again). | |
4269 | ||
4270 | If the tray was already open before, this will be a no-op. | |
4271 | ||
4272 | Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in | |
4273 | which no such event will be generated, these include: | |
4274 | - if the guest has locked the tray, @force is false and the guest does not | |
4275 | respond to the eject request | |
4276 | - if the BlockBackend denoted by @device does not have a guest device attached | |
4277 | to it | |
4278 | - if the guest device does not have an actual tray and is empty, for instance | |
4279 | for floppy disk drives | |
4280 | ||
4281 | Arguments: | |
4282 | ||
4283 | - "device": block device name (json-string) | |
4284 | - "force": if false (the default), an eject request will be sent to the guest if | |
4285 | it has locked the tray (and the tray will not be opened immediately); | |
4286 | if true, the tray will be opened regardless of whether it is locked | |
4287 | (json-bool, optional) | |
4288 | ||
4289 | Example: | |
4290 | ||
4291 | -> { "execute": "blockdev-open-tray", | |
4292 | "arguments": { "device": "ide1-cd0" } } | |
4293 | ||
4294 | <- { "timestamp": { "seconds": 1418751016, | |
4295 | "microseconds": 716996 }, | |
4296 | "event": "DEVICE_TRAY_MOVED", | |
4297 | "data": { "device": "ide1-cd0", | |
4298 | "tray-open": true } } | |
4299 | ||
4300 | <- { "return": {} } | |
4301 | ||
abaaf59d HR |
4302 | EQMP |
4303 | ||
4304 | { | |
4305 | .name = "blockdev-close-tray", | |
4306 | .args_type = "device:s", | |
4307 | .mhandler.cmd_new = qmp_marshal_blockdev_close_tray, | |
4308 | }, | |
4309 | ||
4310 | SQMP | |
4311 | blockdev-close-tray | |
4312 | ------------------- | |
4313 | ||
4314 | Closes a block device's tray. If there is a block driver state tree associated | |
4315 | with the block device (which is currently ejected), that tree will be loaded as | |
4316 | the medium. | |
4317 | ||
4318 | If the tray was already closed before, this will be a no-op. | |
4319 | ||
4320 | Arguments: | |
4321 | ||
4322 | - "device": block device name (json-string) | |
4323 | ||
4324 | Example: | |
4325 | ||
4326 | -> { "execute": "blockdev-close-tray", | |
4327 | "arguments": { "device": "ide1-cd0" } } | |
4328 | ||
4329 | <- { "timestamp": { "seconds": 1418751345, | |
4330 | "microseconds": 272147 }, | |
4331 | "event": "DEVICE_TRAY_MOVED", | |
4332 | "data": { "device": "ide1-cd0", | |
4333 | "tray-open": false } } | |
4334 | ||
4335 | <- { "return": {} } | |
4336 | ||
2814f672 HR |
4337 | EQMP |
4338 | ||
4339 | { | |
6e0abc25 | 4340 | .name = "x-blockdev-remove-medium", |
2814f672 | 4341 | .args_type = "device:s", |
6e0abc25 | 4342 | .mhandler.cmd_new = qmp_marshal_x_blockdev_remove_medium, |
2814f672 HR |
4343 | }, |
4344 | ||
4345 | SQMP | |
6e0abc25 HR |
4346 | x-blockdev-remove-medium |
4347 | ------------------------ | |
2814f672 HR |
4348 | |
4349 | Removes a medium (a block driver state tree) from a block device. That block | |
4350 | device's tray must currently be open (unless there is no attached guest device). | |
4351 | ||
4352 | If the tray is open and there is no medium inserted, this will be a no-op. | |
4353 | ||
6e0abc25 HR |
4354 | This command is still a work in progress and is considered experimental. |
4355 | Stay away from it unless you want to help with its development. | |
4356 | ||
2814f672 HR |
4357 | Arguments: |
4358 | ||
4359 | - "device": block device name (json-string) | |
4360 | ||
4361 | Example: | |
4362 | ||
6e0abc25 | 4363 | -> { "execute": "x-blockdev-remove-medium", |
2814f672 HR |
4364 | "arguments": { "device": "ide1-cd0" } } |
4365 | ||
4366 | <- { "error": { "class": "GenericError", | |
4367 | "desc": "Tray of device 'ide1-cd0' is not open" } } | |
4368 | ||
4369 | -> { "execute": "blockdev-open-tray", | |
4370 | "arguments": { "device": "ide1-cd0" } } | |
4371 | ||
4372 | <- { "timestamp": { "seconds": 1418751627, | |
4373 | "microseconds": 549958 }, | |
4374 | "event": "DEVICE_TRAY_MOVED", | |
4375 | "data": { "device": "ide1-cd0", | |
4376 | "tray-open": true } } | |
4377 | ||
4378 | <- { "return": {} } | |
4379 | ||
6e0abc25 | 4380 | -> { "execute": "x-blockdev-remove-medium", |
2814f672 HR |
4381 | "arguments": { "device": "ide1-cd0" } } |
4382 | ||
4383 | <- { "return": {} } | |
4384 | ||
d1299882 HR |
4385 | EQMP |
4386 | ||
4387 | { | |
6e0abc25 | 4388 | .name = "x-blockdev-insert-medium", |
d1299882 | 4389 | .args_type = "device:s,node-name:s", |
6e0abc25 | 4390 | .mhandler.cmd_new = qmp_marshal_x_blockdev_insert_medium, |
d1299882 HR |
4391 | }, |
4392 | ||
4393 | SQMP | |
6e0abc25 HR |
4394 | x-blockdev-insert-medium |
4395 | ------------------------ | |
d1299882 HR |
4396 | |
4397 | Inserts a medium (a block driver state tree) into a block device. That block | |
4398 | device's tray must currently be open (unless there is no attached guest device) | |
4399 | and there must be no medium inserted already. | |
4400 | ||
6e0abc25 HR |
4401 | This command is still a work in progress and is considered experimental. |
4402 | Stay away from it unless you want to help with its development. | |
4403 | ||
d1299882 HR |
4404 | Arguments: |
4405 | ||
4406 | - "device": block device name (json-string) | |
4407 | - "node-name": root node of the BDS tree to insert into the block device | |
4408 | ||
4409 | Example: | |
4410 | ||
4411 | -> { "execute": "blockdev-add", | |
4412 | "arguments": { "options": { "node-name": "node0", | |
4413 | "driver": "raw", | |
4414 | "file": { "driver": "file", | |
4415 | "filename": "fedora.iso" } } } } | |
4416 | ||
4417 | <- { "return": {} } | |
4418 | ||
6e0abc25 | 4419 | -> { "execute": "x-blockdev-insert-medium", |
d1299882 HR |
4420 | "arguments": { "device": "ide1-cd0", |
4421 | "node-name": "node0" } } | |
4422 | ||
4423 | <- { "return": {} } | |
4424 | ||
7f821597 WC |
4425 | EQMP |
4426 | ||
4427 | { | |
4428 | .name = "x-blockdev-change", | |
4429 | .args_type = "parent:B,child:B?,node:B?", | |
4430 | .mhandler.cmd_new = qmp_marshal_x_blockdev_change, | |
4431 | }, | |
4432 | ||
4433 | SQMP | |
4434 | x-blockdev-change | |
4435 | ----------------- | |
4436 | ||
4437 | Dynamically reconfigure the block driver state graph. It can be used | |
4438 | to add, remove, insert or replace a graph node. Currently only the | |
4439 | Quorum driver implements this feature to add or remove its child. This | |
4440 | is useful to fix a broken quorum child. | |
4441 | ||
4442 | If @node is specified, it will be inserted under @parent. @child | |
4443 | may not be specified in this case. If both @parent and @child are | |
4444 | specified but @node is not, @child will be detached from @parent. | |
4445 | ||
4446 | Arguments: | |
4447 | - "parent": the id or name of the parent node (json-string) | |
4448 | - "child": the name of a child under the given parent node (json-string, optional) | |
4449 | - "node": the name of the node that will be added (json-string, optional) | |
4450 | ||
4451 | Note: this command is experimental, and not a stable API. It doesn't | |
4452 | support all kinds of operations, all kinds of children, nor all block | |
4453 | drivers. | |
4454 | ||
4455 | Warning: The data in a new quorum child MUST be consistent with that of | |
4456 | the rest of the array. | |
4457 | ||
4458 | Example: | |
4459 | ||
4460 | Add a new node to a quorum | |
4461 | -> { "execute": "blockdev-add", | |
4462 | "arguments": { "options": { "driver": "raw", | |
4463 | "node-name": "new_node", | |
4464 | "file": { "driver": "file", | |
4465 | "filename": "test.raw" } } } } | |
4466 | <- { "return": {} } | |
4467 | -> { "execute": "x-blockdev-change", | |
4468 | "arguments": { "parent": "disk1", | |
4469 | "node": "new_node" } } | |
4470 | <- { "return": {} } | |
4471 | ||
4472 | Delete a quorum's node | |
4473 | -> { "execute": "x-blockdev-change", | |
4474 | "arguments": { "parent": "disk1", | |
4475 | "child": "children.1" } } | |
4476 | <- { "return": {} } | |
4477 | ||
c13163fb BC |
4478 | EQMP |
4479 | ||
4480 | { | |
4481 | .name = "query-named-block-nodes", | |
4482 | .args_type = "", | |
7fad30f0 | 4483 | .mhandler.cmd_new = qmp_marshal_query_named_block_nodes, |
c13163fb BC |
4484 | }, |
4485 | ||
4486 | SQMP | |
4487 | @query-named-block-nodes | |
4488 | ------------------------ | |
4489 | ||
4490 | Return a list of BlockDeviceInfo for all the named block driver nodes | |
4491 | ||
4492 | Example: | |
4493 | ||
4494 | -> { "execute": "query-named-block-nodes" } | |
4495 | <- { "return": [ { "ro":false, | |
4496 | "drv":"qcow2", | |
4497 | "encrypted":false, | |
4498 | "file":"disks/test.qcow2", | |
4499 | "node-name": "my-node", | |
4500 | "backing_file_depth":1, | |
4501 | "bps":1000000, | |
4502 | "bps_rd":0, | |
4503 | "bps_wr":0, | |
4504 | "iops":1000000, | |
4505 | "iops_rd":0, | |
4506 | "iops_wr":0, | |
4507 | "bps_max": 8000000, | |
4508 | "bps_rd_max": 0, | |
4509 | "bps_wr_max": 0, | |
4510 | "iops_max": 0, | |
4511 | "iops_rd_max": 0, | |
4512 | "iops_wr_max": 0, | |
4513 | "iops_size": 0, | |
e2462113 | 4514 | "write_threshold": 0, |
c13163fb BC |
4515 | "image":{ |
4516 | "filename":"disks/test.qcow2", | |
4517 | "format":"qcow2", | |
4518 | "virtual-size":2048000, | |
4519 | "backing_file":"base.qcow2", | |
4520 | "full-backing-filename":"disks/base.qcow2", | |
5403432f | 4521 | "backing-filename-format":"qcow2", |
c13163fb BC |
4522 | "snapshots":[ |
4523 | { | |
4524 | "id": "1", | |
4525 | "name": "snapshot1", | |
4526 | "vm-state-size": 0, | |
4527 | "date-sec": 10000200, | |
4528 | "date-nsec": 12, | |
4529 | "vm-clock-sec": 206, | |
4530 | "vm-clock-nsec": 30 | |
4531 | } | |
4532 | ], | |
4533 | "backing-image":{ | |
4534 | "filename":"disks/base.qcow2", | |
4535 | "format":"qcow2", | |
4536 | "virtual-size":2048000 | |
4537 | } | |
c059451c | 4538 | } } ] } |
c13163fb | 4539 | |
24fb4133 HR |
4540 | EQMP |
4541 | ||
4542 | { | |
4543 | .name = "blockdev-change-medium", | |
39ff43d9 | 4544 | .args_type = "device:B,filename:F,format:s?,read-only-mode:s?", |
24fb4133 HR |
4545 | .mhandler.cmd_new = qmp_marshal_blockdev_change_medium, |
4546 | }, | |
4547 | ||
4548 | SQMP | |
4549 | blockdev-change-medium | |
4550 | ---------------------- | |
4551 | ||
4552 | Changes the medium inserted into a block device by ejecting the current medium | |
4553 | and loading a new image file which is inserted as the new medium. | |
4554 | ||
4555 | Arguments: | |
4556 | ||
4557 | - "device": device name (json-string) | |
4558 | - "filename": filename of the new image (json-string) | |
4559 | - "format": format of the new image (json-string, optional) | |
39ff43d9 HR |
4560 | - "read-only-mode": new read-only mode (json-string, optional) |
4561 | - Possible values: "retain" (default), "read-only", "read-write" | |
24fb4133 HR |
4562 | |
4563 | Examples: | |
4564 | ||
4565 | 1. Change a removable medium | |
4566 | ||
4567 | -> { "execute": "blockdev-change-medium", | |
4568 | "arguments": { "device": "ide1-cd0", | |
4569 | "filename": "/srv/images/Fedora-12-x86_64-DVD.iso", | |
4570 | "format": "raw" } } | |
4571 | <- { "return": {} } | |
4572 | ||
39ff43d9 HR |
4573 | 2. Load a read-only medium into a writable drive |
4574 | ||
4575 | -> { "execute": "blockdev-change-medium", | |
4576 | "arguments": { "device": "isa-fd0", | |
4577 | "filename": "/srv/images/ro.img", | |
4578 | "format": "raw", | |
4579 | "read-only-mode": "retain" } } | |
4580 | ||
4581 | <- { "error": | |
4582 | { "class": "GenericError", | |
4583 | "desc": "Could not open '/srv/images/ro.img': Permission denied" } } | |
4584 | ||
4585 | -> { "execute": "blockdev-change-medium", | |
4586 | "arguments": { "device": "isa-fd0", | |
4587 | "filename": "/srv/images/ro.img", | |
4588 | "format": "raw", | |
4589 | "read-only-mode": "read-only" } } | |
4590 | ||
4591 | <- { "return": {} } | |
4592 | ||
76b5d850 HT |
4593 | EQMP |
4594 | ||
4595 | { | |
4596 | .name = "query-memdev", | |
4597 | .args_type = "", | |
7fad30f0 | 4598 | .mhandler.cmd_new = qmp_marshal_query_memdev, |
76b5d850 HT |
4599 | }, |
4600 | ||
4601 | SQMP | |
4602 | query-memdev | |
4603 | ------------ | |
4604 | ||
4605 | Show memory devices information. | |
4606 | ||
4607 | ||
4608 | Example (1): | |
4609 | ||
4610 | -> { "execute": "query-memdev" } | |
4611 | <- { "return": [ | |
4612 | { | |
4613 | "size": 536870912, | |
4614 | "merge": false, | |
4615 | "dump": true, | |
4616 | "prealloc": false, | |
4617 | "host-nodes": [0, 1], | |
4618 | "policy": "bind" | |
4619 | }, | |
4620 | { | |
4621 | "size": 536870912, | |
4622 | "merge": false, | |
4623 | "dump": true, | |
4624 | "prealloc": true, | |
4625 | "host-nodes": [2, 3], | |
4626 | "policy": "preferred" | |
4627 | } | |
4628 | ] | |
4629 | } | |
4630 | ||
6f2e2730 IM |
4631 | EQMP |
4632 | ||
4633 | { | |
4634 | .name = "query-memory-devices", | |
4635 | .args_type = "", | |
7fad30f0 | 4636 | .mhandler.cmd_new = qmp_marshal_query_memory_devices, |
6f2e2730 IM |
4637 | }, |
4638 | ||
4639 | SQMP | |
4640 | @query-memory-devices | |
4641 | -------------------- | |
4642 | ||
4643 | Return a list of memory devices. | |
4644 | ||
4645 | Example: | |
4646 | -> { "execute": "query-memory-devices" } | |
4647 | <- { "return": [ { "data": | |
4648 | { "addr": 5368709120, | |
4649 | "hotpluggable": true, | |
4650 | "hotplugged": true, | |
4651 | "id": "d1", | |
4652 | "memdev": "/objects/memX", | |
4653 | "node": 0, | |
4654 | "size": 1073741824, | |
4655 | "slot": 0}, | |
4656 | "type": "dimm" | |
4657 | } ] } | |
f1a1a356 | 4658 | EQMP |
02419bcb IM |
4659 | |
4660 | { | |
4661 | .name = "query-acpi-ospm-status", | |
4662 | .args_type = "", | |
7fad30f0 | 4663 | .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status, |
02419bcb IM |
4664 | }, |
4665 | ||
4666 | SQMP | |
4667 | @query-acpi-ospm-status | |
4668 | -------------------- | |
4669 | ||
4670 | Return list of ACPIOSTInfo for devices that support status reporting | |
4671 | via ACPI _OST method. | |
4672 | ||
4673 | Example: | |
4674 | -> { "execute": "query-acpi-ospm-status" } | |
4675 | <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0}, | |
4676 | { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0}, | |
4677 | { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0}, | |
4678 | { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0} | |
4679 | ]} | |
4680 | EQMP | |
f2ae8abf MT |
4681 | |
4682 | #if defined TARGET_I386 | |
4683 | { | |
4684 | .name = "rtc-reset-reinjection", | |
4685 | .args_type = "", | |
7fad30f0 | 4686 | .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection, |
f2ae8abf MT |
4687 | }, |
4688 | #endif | |
4689 | ||
4690 | SQMP | |
4691 | rtc-reset-reinjection | |
4692 | --------------------- | |
4693 | ||
4694 | Reset the RTC interrupt reinjection backlog. | |
4695 | ||
4696 | Arguments: None. | |
4697 | ||
4698 | Example: | |
4699 | ||
4700 | -> { "execute": "rtc-reset-reinjection" } | |
4701 | <- { "return": {} } | |
1dde0f48 LV |
4702 | EQMP |
4703 | ||
4704 | { | |
4705 | .name = "trace-event-get-state", | |
4706 | .args_type = "name:s", | |
7fad30f0 | 4707 | .mhandler.cmd_new = qmp_marshal_trace_event_get_state, |
1dde0f48 LV |
4708 | }, |
4709 | ||
4710 | SQMP | |
4711 | trace-event-get-state | |
4712 | --------------------- | |
4713 | ||
4714 | Query the state of events. | |
4715 | ||
4716 | Example: | |
4717 | ||
4718 | -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } } | |
4719 | <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] } | |
4720 | EQMP | |
4721 | ||
4722 | { | |
4723 | .name = "trace-event-set-state", | |
4724 | .args_type = "name:s,enable:b,ignore-unavailable:b?", | |
7fad30f0 | 4725 | .mhandler.cmd_new = qmp_marshal_trace_event_set_state, |
1dde0f48 | 4726 | }, |
f2ae8abf | 4727 | |
1dde0f48 LV |
4728 | SQMP |
4729 | trace-event-set-state | |
4730 | --------------------- | |
4731 | ||
4732 | Set the state of events. | |
4733 | ||
4734 | Example: | |
4735 | ||
4736 | -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } } | |
4737 | <- { "return": {} } | |
50c6617f MT |
4738 | EQMP |
4739 | ||
4740 | { | |
6575ccdd | 4741 | .name = "input-send-event", |
51fc4476 | 4742 | .args_type = "console:i?,events:q", |
6575ccdd | 4743 | .mhandler.cmd_new = qmp_marshal_input_send_event, |
50c6617f MT |
4744 | }, |
4745 | ||
4746 | SQMP | |
6575ccdd | 4747 | @input-send-event |
50c6617f MT |
4748 | ----------------- |
4749 | ||
4750 | Send input event to guest. | |
4751 | ||
4752 | Arguments: | |
4753 | ||
b98d26e3 GH |
4754 | - "device": display device (json-string, optional) |
4755 | - "head": display head (json-int, optional) | |
4756 | - "events": list of input events | |
50c6617f MT |
4757 | |
4758 | The consoles are visible in the qom tree, under | |
4759 | /backend/console[$index]. They have a device link and head property, so | |
4760 | it is possible to map which console belongs to which device and display. | |
4761 | ||
df5b2adb GH |
4762 | Note: this command is experimental, and not a stable API. |
4763 | ||
50c6617f MT |
4764 | Example (1): |
4765 | ||
4766 | Press left mouse button. | |
4767 | ||
6575ccdd | 4768 | -> { "execute": "input-send-event", |
b98d26e3 | 4769 | "arguments": { "device": "video0", |
50c6617f | 4770 | "events": [ { "type": "btn", |
f22d0af0 | 4771 | "data" : { "down": true, "button": "left" } } ] } } |
50c6617f MT |
4772 | <- { "return": {} } |
4773 | ||
6575ccdd | 4774 | -> { "execute": "input-send-event", |
b98d26e3 | 4775 | "arguments": { "device": "video0", |
50c6617f | 4776 | "events": [ { "type": "btn", |
f22d0af0 | 4777 | "data" : { "down": false, "button": "left" } } ] } } |
50c6617f MT |
4778 | <- { "return": {} } |
4779 | ||
4780 | Example (2): | |
4781 | ||
4782 | Press ctrl-alt-del. | |
4783 | ||
6575ccdd | 4784 | -> { "execute": "input-send-event", |
b98d26e3 | 4785 | "arguments": { "events": [ |
50c6617f MT |
4786 | { "type": "key", "data" : { "down": true, |
4787 | "key": {"type": "qcode", "data": "ctrl" } } }, | |
4788 | { "type": "key", "data" : { "down": true, | |
4789 | "key": {"type": "qcode", "data": "alt" } } }, | |
4790 | { "type": "key", "data" : { "down": true, | |
4791 | "key": {"type": "qcode", "data": "delete" } } } ] } } | |
4792 | <- { "return": {} } | |
4793 | ||
4794 | Example (3): | |
4795 | ||
4796 | Move mouse pointer to absolute coordinates (20000, 400). | |
4797 | ||
6575ccdd | 4798 | -> { "execute": "input-send-event" , |
b98d26e3 | 4799 | "arguments": { "events": [ |
01df5143 GH |
4800 | { "type": "abs", "data" : { "axis": "x", "value" : 20000 } }, |
4801 | { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } } | |
50c6617f MT |
4802 | <- { "return": {} } |
4803 | ||
e2462113 FR |
4804 | EQMP |
4805 | ||
4806 | { | |
4807 | .name = "block-set-write-threshold", | |
4808 | .args_type = "node-name:s,write-threshold:l", | |
7fad30f0 | 4809 | .mhandler.cmd_new = qmp_marshal_block_set_write_threshold, |
e2462113 FR |
4810 | }, |
4811 | ||
4812 | SQMP | |
4813 | block-set-write-threshold | |
4814 | ------------ | |
4815 | ||
4816 | Change the write threshold for a block drive. The threshold is an offset, | |
4817 | thus must be non-negative. Default is no write threshold. | |
4818 | Setting the threshold to zero disables it. | |
4819 | ||
4820 | Arguments: | |
4821 | ||
4822 | - "node-name": the node name in the block driver state graph (json-string) | |
4823 | - "write-threshold": the write threshold in bytes (json-int) | |
4824 | ||
4825 | Example: | |
4826 | ||
4827 | -> { "execute": "block-set-write-threshold", | |
4828 | "arguments": { "node-name": "mydev", | |
4829 | "write-threshold": 17179869184 } } | |
4830 | <- { "return": {} } | |
4831 | ||
f2ae8abf | 4832 | EQMP |
fafa4d50 SF |
4833 | |
4834 | { | |
4835 | .name = "query-rocker", | |
4836 | .args_type = "name:s", | |
7fad30f0 | 4837 | .mhandler.cmd_new = qmp_marshal_query_rocker, |
fafa4d50 SF |
4838 | }, |
4839 | ||
4840 | SQMP | |
4841 | Show rocker switch | |
4842 | ------------------ | |
4843 | ||
4844 | Arguments: | |
4845 | ||
4846 | - "name": switch name | |
4847 | ||
4848 | Example: | |
4849 | ||
4850 | -> { "execute": "query-rocker", "arguments": { "name": "sw1" } } | |
4851 | <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}} | |
4852 | ||
4853 | EQMP | |
4854 | ||
4855 | { | |
4856 | .name = "query-rocker-ports", | |
4857 | .args_type = "name:s", | |
7fad30f0 | 4858 | .mhandler.cmd_new = qmp_marshal_query_rocker_ports, |
fafa4d50 SF |
4859 | }, |
4860 | ||
4861 | SQMP | |
4862 | Show rocker switch ports | |
4863 | ------------------------ | |
4864 | ||
4865 | Arguments: | |
4866 | ||
4867 | - "name": switch name | |
4868 | ||
4869 | Example: | |
4870 | ||
4871 | -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } } | |
4872 | <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1", | |
4873 | "autoneg": "off", "link-up": true, "speed": 10000}, | |
4874 | {"duplex": "full", "enabled": true, "name": "sw1.2", | |
4875 | "autoneg": "off", "link-up": true, "speed": 10000} | |
4876 | ]} | |
4877 | ||
4878 | EQMP | |
4879 | ||
4880 | { | |
4881 | .name = "query-rocker-of-dpa-flows", | |
4882 | .args_type = "name:s,tbl-id:i?", | |
7fad30f0 | 4883 | .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows, |
fafa4d50 SF |
4884 | }, |
4885 | ||
4886 | SQMP | |
4887 | Show rocker switch OF-DPA flow tables | |
4888 | ------------------------------------- | |
4889 | ||
4890 | Arguments: | |
4891 | ||
4892 | - "name": switch name | |
4893 | - "tbl-id": (optional) flow table ID | |
4894 | ||
4895 | Example: | |
4896 | ||
4897 | -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } } | |
4898 | <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0}, | |
4899 | "hits": 138, | |
4900 | "cookie": 0, | |
4901 | "action": {"goto-tbl": 10}, | |
4902 | "mask": {"in-pport": 4294901760} | |
4903 | }, | |
4904 | {...more...}, | |
4905 | ]} | |
4906 | ||
4907 | EQMP | |
4908 | ||
4909 | { | |
4910 | .name = "query-rocker-of-dpa-groups", | |
4911 | .args_type = "name:s,type:i?", | |
7fad30f0 | 4912 | .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups, |
fafa4d50 SF |
4913 | }, |
4914 | ||
4915 | SQMP | |
4916 | Show rocker OF-DPA group tables | |
4917 | ------------------------------- | |
4918 | ||
4919 | Arguments: | |
4920 | ||
4921 | - "name": switch name | |
4922 | - "type": (optional) group type | |
4923 | ||
4924 | Example: | |
4925 | ||
4926 | -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } } | |
4927 | <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841, | |
4928 | "pop-vlan": 1, "id": 251723778}, | |
4929 | {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841, | |
4930 | "pop-vlan": 1, "id": 251723776}, | |
4931 | {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840, | |
4932 | "pop-vlan": 1, "id": 251658241}, | |
4933 | {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840, | |
4934 | "pop-vlan": 1, "id": 251658240} | |
4935 | ]} | |
ae50a770 PX |
4936 | |
4937 | EQMP | |
4938 | ||
4939 | #if defined TARGET_ARM | |
4940 | { | |
4941 | .name = "query-gic-capabilities", | |
4942 | .args_type = "", | |
4943 | .mhandler.cmd_new = qmp_marshal_query_gic_capabilities, | |
4944 | }, | |
4945 | #endif | |
4946 | ||
4947 | SQMP | |
4948 | query-gic-capabilities | |
4949 | --------------- | |
4950 | ||
4951 | Return a list of GICCapability objects, describing supported GIC | |
4952 | (Generic Interrupt Controller) versions. | |
4953 | ||
4954 | Arguments: None | |
4955 | ||
4956 | Example: | |
4957 | ||
4958 | -> { "execute": "query-gic-capabilities" } | |
4959 | <- { "return": [{ "version": 2, "emulated": true, "kernel": false }, | |
4960 | { "version": 3, "emulated": false, "kernel": true } ] } | |
4961 | ||
4962 | EQMP | |
d4633541 IM |
4963 | |
4964 | { | |
4965 | .name = "query-hotpluggable-cpus", | |
4966 | .args_type = "", | |
4967 | .mhandler.cmd_new = qmp_marshal_query_hotpluggable_cpus, | |
4968 | }, | |
4969 | ||
4970 | SQMP | |
4971 | Show existing/possible CPUs | |
4972 | --------------------------- | |
4973 | ||
4974 | Arguments: None. | |
4975 | ||
4976 | Example for pseries machine type started with | |
4977 | -smp 2,cores=2,maxcpus=4 -cpu POWER8: | |
4978 | ||
4979 | -> { "execute": "query-hotpluggable-cpus" } | |
4980 | <- {"return": [ | |
4981 | { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core", | |
4982 | "vcpus-count": 1 }, | |
4983 | { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core", | |
4984 | "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"} | |
4985 | ]}' |