]>
Commit | Line | Data |
---|---|---|
82a56f0d LC |
1 | HXCOMM QMP dispatch table and documentation |
2 | HXCOMM Text between SQMP and EQMP is copied to the QMP documention file and | |
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 = "", | |
7a7f325e | 66 | .mhandler.cmd_new = qmp_marshal_input_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", | |
87 | .params = "[-f] device", | |
88 | .help = "eject a removable medium (use -f to force it)", | |
89 | .user_print = monitor_user_noop, | |
90 | .mhandler.cmd_new = do_eject, | |
91 | }, | |
92 | ||
93 | SQMP | |
94 | eject | |
95 | ----- | |
96 | ||
97 | Eject a removable medium. | |
98 | ||
99 | Arguments: | |
100 | ||
101 | - force: force ejection (json-bool, optional) | |
102 | - device: device name (json-string) | |
103 | ||
104 | Example: | |
105 | ||
106 | -> { "execute": "eject", "arguments": { "device": "ide1-cd0" } } | |
107 | <- { "return": {} } | |
108 | ||
109 | Note: The "force" argument defaults to false. | |
110 | ||
111 | EQMP | |
112 | ||
113 | { | |
114 | .name = "change", | |
115 | .args_type = "device:B,target:F,arg:s?", | |
116 | .params = "device filename [format]", | |
117 | .help = "change a removable medium, optional format", | |
118 | .user_print = monitor_user_noop, | |
119 | .mhandler.cmd_new = do_change, | |
120 | }, | |
121 | ||
122 | SQMP | |
123 | change | |
124 | ------ | |
125 | ||
126 | Change a removable medium or VNC configuration. | |
127 | ||
128 | Arguments: | |
129 | ||
130 | - "device": device name (json-string) | |
131 | - "target": filename or item (json-string) | |
132 | - "arg": additional argument (json-string, optional) | |
133 | ||
134 | Examples: | |
135 | ||
136 | 1. Change a removable medium | |
137 | ||
138 | -> { "execute": "change", | |
139 | "arguments": { "device": "ide1-cd0", | |
140 | "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } } | |
141 | <- { "return": {} } | |
142 | ||
143 | 2. Change VNC password | |
144 | ||
145 | -> { "execute": "change", | |
146 | "arguments": { "device": "vnc", "target": "password", | |
147 | "arg": "foobar1" } } | |
148 | <- { "return": {} } | |
149 | ||
150 | EQMP | |
151 | ||
152 | { | |
153 | .name = "screendump", | |
154 | .args_type = "filename:F", | |
155 | .params = "filename", | |
156 | .help = "save screen into PPM image 'filename'", | |
157 | .user_print = monitor_user_noop, | |
158 | .mhandler.cmd_new = do_screen_dump, | |
159 | }, | |
160 | ||
161 | SQMP | |
162 | screendump | |
163 | ---------- | |
164 | ||
165 | Save screen into PPM image. | |
166 | ||
167 | Arguments: | |
168 | ||
169 | - "filename": file path (json-string) | |
170 | ||
171 | Example: | |
172 | ||
173 | -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } } | |
174 | <- { "return": {} } | |
175 | ||
176 | EQMP | |
177 | ||
178 | { | |
179 | .name = "stop", | |
180 | .args_type = "", | |
5f158f21 | 181 | .mhandler.cmd_new = qmp_marshal_input_stop, |
82a56f0d LC |
182 | }, |
183 | ||
184 | SQMP | |
185 | stop | |
186 | ---- | |
187 | ||
188 | Stop the emulator. | |
189 | ||
190 | Arguments: None. | |
191 | ||
192 | Example: | |
193 | ||
194 | -> { "execute": "stop" } | |
195 | <- { "return": {} } | |
196 | ||
197 | EQMP | |
198 | ||
199 | { | |
200 | .name = "cont", | |
201 | .args_type = "", | |
202 | .params = "", | |
203 | .help = "resume emulation", | |
204 | .user_print = monitor_user_noop, | |
205 | .mhandler.cmd_new = do_cont, | |
206 | }, | |
207 | ||
208 | SQMP | |
209 | cont | |
210 | ---- | |
211 | ||
212 | Resume emulation. | |
213 | ||
214 | Arguments: None. | |
215 | ||
216 | Example: | |
217 | ||
218 | -> { "execute": "cont" } | |
219 | <- { "return": {} } | |
220 | ||
221 | EQMP | |
222 | ||
223 | { | |
224 | .name = "system_reset", | |
225 | .args_type = "", | |
226 | .params = "", | |
227 | .help = "reset the system", | |
228 | .user_print = monitor_user_noop, | |
229 | .mhandler.cmd_new = do_system_reset, | |
230 | }, | |
231 | ||
232 | SQMP | |
233 | system_reset | |
234 | ------------ | |
235 | ||
236 | Reset the system. | |
237 | ||
238 | Arguments: None. | |
239 | ||
240 | Example: | |
241 | ||
242 | -> { "execute": "system_reset" } | |
243 | <- { "return": {} } | |
244 | ||
245 | EQMP | |
246 | ||
247 | { | |
248 | .name = "system_powerdown", | |
249 | .args_type = "", | |
250 | .params = "", | |
251 | .help = "send system power down event", | |
252 | .user_print = monitor_user_noop, | |
253 | .mhandler.cmd_new = do_system_powerdown, | |
254 | }, | |
255 | ||
256 | SQMP | |
257 | system_powerdown | |
258 | ---------------- | |
259 | ||
260 | Send system power down event. | |
261 | ||
262 | Arguments: None. | |
263 | ||
264 | Example: | |
265 | ||
266 | -> { "execute": "system_powerdown" } | |
267 | <- { "return": {} } | |
268 | ||
269 | EQMP | |
270 | ||
271 | { | |
272 | .name = "device_add", | |
273 | .args_type = "device:O", | |
274 | .params = "driver[,prop=value][,...]", | |
275 | .help = "add device, like -device on the command line", | |
276 | .user_print = monitor_user_noop, | |
277 | .mhandler.cmd_new = do_device_add, | |
278 | }, | |
279 | ||
280 | SQMP | |
281 | device_add | |
282 | ---------- | |
283 | ||
284 | Add a device. | |
285 | ||
286 | Arguments: | |
287 | ||
288 | - "driver": the name of the new device's driver (json-string) | |
289 | - "bus": the device's parent bus (device tree path, json-string, optional) | |
290 | - "id": the device's ID, must be unique (json-string) | |
291 | - device properties | |
292 | ||
293 | Example: | |
294 | ||
295 | -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } } | |
296 | <- { "return": {} } | |
297 | ||
298 | Notes: | |
299 | ||
300 | (1) For detailed information about this command, please refer to the | |
301 | 'docs/qdev-device-use.txt' file. | |
302 | ||
303 | (2) It's possible to list device properties by running QEMU with the | |
304 | "-device DEVICE,\?" command-line argument, where DEVICE is the device's name | |
305 | ||
306 | EQMP | |
307 | ||
308 | { | |
309 | .name = "device_del", | |
310 | .args_type = "id:s", | |
311 | .params = "device", | |
312 | .help = "remove device", | |
313 | .user_print = monitor_user_noop, | |
314 | .mhandler.cmd_new = do_device_del, | |
315 | }, | |
316 | ||
317 | SQMP | |
318 | device_del | |
319 | ---------- | |
320 | ||
321 | Remove a device. | |
322 | ||
323 | Arguments: | |
324 | ||
325 | - "id": the device's ID (json-string) | |
326 | ||
327 | Example: | |
328 | ||
329 | -> { "execute": "device_del", "arguments": { "id": "net1" } } | |
330 | <- { "return": {} } | |
331 | ||
332 | EQMP | |
333 | ||
334 | { | |
335 | .name = "cpu", | |
336 | .args_type = "index:i", | |
337 | .params = "index", | |
338 | .help = "set the default CPU", | |
339 | .user_print = monitor_user_noop, | |
340 | .mhandler.cmd_new = do_cpu_set, | |
341 | }, | |
342 | ||
343 | SQMP | |
344 | cpu | |
345 | --- | |
346 | ||
347 | Set the default CPU. | |
348 | ||
349 | Arguments: | |
350 | ||
351 | - "index": the CPU's index (json-int) | |
352 | ||
353 | Example: | |
354 | ||
355 | -> { "execute": "cpu", "arguments": { "index": 0 } } | |
356 | <- { "return": {} } | |
357 | ||
358 | Note: CPUs' indexes are obtained with the 'query-cpus' command. | |
359 | ||
360 | EQMP | |
361 | ||
362 | { | |
363 | .name = "memsave", | |
364 | .args_type = "val:l,size:i,filename:s", | |
365 | .params = "addr size file", | |
366 | .help = "save to disk virtual memory dump starting at 'addr' of size 'size'", | |
367 | .user_print = monitor_user_noop, | |
368 | .mhandler.cmd_new = do_memory_save, | |
369 | }, | |
370 | ||
371 | SQMP | |
372 | memsave | |
373 | ------- | |
374 | ||
375 | Save to disk virtual memory dump starting at 'val' of size 'size'. | |
376 | ||
377 | Arguments: | |
378 | ||
379 | - "val": the starting address (json-int) | |
380 | - "size": the memory size, in bytes (json-int) | |
381 | - "filename": file path (json-string) | |
382 | ||
383 | Example: | |
384 | ||
385 | -> { "execute": "memsave", | |
386 | "arguments": { "val": 10, | |
387 | "size": 100, | |
388 | "filename": "/tmp/virtual-mem-dump" } } | |
389 | <- { "return": {} } | |
390 | ||
391 | Note: Depends on the current CPU. | |
392 | ||
393 | EQMP | |
394 | ||
395 | { | |
396 | .name = "pmemsave", | |
397 | .args_type = "val:l,size:i,filename:s", | |
398 | .params = "addr size file", | |
399 | .help = "save to disk physical memory dump starting at 'addr' of size 'size'", | |
400 | .user_print = monitor_user_noop, | |
401 | .mhandler.cmd_new = do_physical_memory_save, | |
402 | }, | |
403 | ||
404 | SQMP | |
405 | pmemsave | |
406 | -------- | |
407 | ||
408 | Save to disk physical memory dump starting at 'val' of size 'size'. | |
409 | ||
410 | Arguments: | |
411 | ||
412 | - "val": the starting address (json-int) | |
413 | - "size": the memory size, in bytes (json-int) | |
414 | - "filename": file path (json-string) | |
415 | ||
416 | Example: | |
417 | ||
418 | -> { "execute": "pmemsave", | |
419 | "arguments": { "val": 10, | |
420 | "size": 100, | |
421 | "filename": "/tmp/physical-mem-dump" } } | |
422 | <- { "return": {} } | |
423 | ||
a4046664 LJ |
424 | EQMP |
425 | ||
426 | { | |
427 | .name = "inject-nmi", | |
428 | .args_type = "", | |
429 | .params = "", | |
430 | .help = "", | |
431 | .user_print = monitor_user_noop, | |
e9b4b432 | 432 | .mhandler.cmd_new = do_inject_nmi, |
a4046664 LJ |
433 | }, |
434 | ||
435 | SQMP | |
436 | inject-nmi | |
437 | ---------- | |
438 | ||
439 | Inject an NMI on guest's CPUs. | |
440 | ||
441 | Arguments: None. | |
442 | ||
443 | Example: | |
444 | ||
445 | -> { "execute": "inject-nmi" } | |
446 | <- { "return": {} } | |
447 | ||
448 | Note: inject-nmi is only supported for x86 guest currently, it will | |
449 | returns "Unsupported" error for non-x86 guest. | |
450 | ||
82a56f0d LC |
451 | EQMP |
452 | ||
453 | { | |
454 | .name = "migrate", | |
455 | .args_type = "detach:-d,blk:-b,inc:-i,uri:s", | |
456 | .params = "[-d] [-b] [-i] uri", | |
457 | .help = "migrate to URI (using -d to not wait for completion)" | |
458 | "\n\t\t\t -b for migration without shared storage with" | |
459 | " full copy of disk\n\t\t\t -i for migration without " | |
460 | "shared storage with incremental copy of disk " | |
461 | "(base image shared between src and destination)", | |
462 | .user_print = monitor_user_noop, | |
463 | .mhandler.cmd_new = do_migrate, | |
464 | }, | |
465 | ||
466 | SQMP | |
467 | migrate | |
468 | ------- | |
469 | ||
470 | Migrate to URI. | |
471 | ||
472 | Arguments: | |
473 | ||
474 | - "blk": block migration, full disk copy (json-bool, optional) | |
475 | - "inc": incremental disk copy (json-bool, optional) | |
476 | - "uri": Destination URI (json-string) | |
477 | ||
478 | Example: | |
479 | ||
480 | -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } } | |
481 | <- { "return": {} } | |
482 | ||
483 | Notes: | |
484 | ||
485 | (1) The 'query-migrate' command should be used to check migration's progress | |
486 | and final result (this information is provided by the 'status' member) | |
487 | (2) All boolean arguments default to false | |
488 | (3) The user Monitor's "detach" argument is invalid in QMP and should not | |
489 | be used | |
490 | ||
491 | EQMP | |
492 | ||
493 | { | |
494 | .name = "migrate_cancel", | |
495 | .args_type = "", | |
496 | .params = "", | |
497 | .help = "cancel the current VM migration", | |
498 | .user_print = monitor_user_noop, | |
499 | .mhandler.cmd_new = do_migrate_cancel, | |
500 | }, | |
501 | ||
502 | SQMP | |
503 | migrate_cancel | |
504 | -------------- | |
505 | ||
506 | Cancel the current migration. | |
507 | ||
508 | Arguments: None. | |
509 | ||
510 | Example: | |
511 | ||
512 | -> { "execute": "migrate_cancel" } | |
513 | <- { "return": {} } | |
514 | ||
515 | EQMP | |
516 | ||
517 | { | |
518 | .name = "migrate_set_speed", | |
3a019b6e | 519 | .args_type = "value:o", |
82a56f0d LC |
520 | .params = "value", |
521 | .help = "set maximum speed (in bytes) for migrations", | |
522 | .user_print = monitor_user_noop, | |
523 | .mhandler.cmd_new = do_migrate_set_speed, | |
524 | }, | |
525 | ||
e866e239 | 526 | SQMP |
ff73edf5 JS |
527 | migrate_set_speed |
528 | ----------------- | |
e866e239 | 529 | |
ff73edf5 | 530 | Set maximum speed for migrations. |
e866e239 GH |
531 | |
532 | Arguments: | |
533 | ||
ff73edf5 | 534 | - "value": maximum speed, in bytes per second (json-int) |
e866e239 GH |
535 | |
536 | Example: | |
537 | ||
ff73edf5 | 538 | -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } } |
e866e239 GH |
539 | <- { "return": {} } |
540 | ||
541 | EQMP | |
542 | ||
543 | { | |
ff73edf5 JS |
544 | .name = "migrate_set_downtime", |
545 | .args_type = "value:T", | |
546 | .params = "value", | |
547 | .help = "set maximum tolerated downtime (in seconds) for migrations", | |
e866e239 | 548 | .user_print = monitor_user_noop, |
ff73edf5 | 549 | .mhandler.cmd_new = do_migrate_set_downtime, |
e866e239 GH |
550 | }, |
551 | ||
82a56f0d | 552 | SQMP |
ff73edf5 JS |
553 | migrate_set_downtime |
554 | -------------------- | |
82a56f0d | 555 | |
ff73edf5 | 556 | Set maximum tolerated downtime (in seconds) for migrations. |
82a56f0d LC |
557 | |
558 | Arguments: | |
559 | ||
ff73edf5 | 560 | - "value": maximum downtime (json-number) |
82a56f0d LC |
561 | |
562 | Example: | |
563 | ||
ff73edf5 | 564 | -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } } |
82a56f0d LC |
565 | <- { "return": {} } |
566 | ||
567 | EQMP | |
568 | ||
569 | { | |
ff73edf5 JS |
570 | .name = "client_migrate_info", |
571 | .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?", | |
572 | .params = "protocol hostname port tls-port cert-subject", | |
573 | .help = "send migration info to spice/vnc client", | |
82a56f0d | 574 | .user_print = monitor_user_noop, |
ff73edf5 | 575 | .mhandler.cmd_new = client_migrate_info, |
82a56f0d LC |
576 | }, |
577 | ||
578 | SQMP | |
ff73edf5 JS |
579 | client_migrate_info |
580 | ------------------ | |
82a56f0d | 581 | |
ff73edf5 JS |
582 | Set the spice/vnc connection info for the migration target. The spice/vnc |
583 | server will ask the spice/vnc client to automatically reconnect using the | |
584 | new parameters (if specified) once the vm migration finished successfully. | |
82a56f0d LC |
585 | |
586 | Arguments: | |
587 | ||
ff73edf5 JS |
588 | - "protocol": protocol: "spice" or "vnc" (json-string) |
589 | - "hostname": migration target hostname (json-string) | |
590 | - "port": spice/vnc tcp port for plaintext channels (json-int, optional) | |
591 | - "tls-port": spice tcp port for tls-secured channels (json-int, optional) | |
592 | - "cert-subject": server certificate subject (json-string, optional) | |
82a56f0d LC |
593 | |
594 | Example: | |
595 | ||
ff73edf5 JS |
596 | -> { "execute": "client_migrate_info", |
597 | "arguments": { "protocol": "spice", | |
598 | "hostname": "virt42.lab.kraxel.org", | |
599 | "port": 1234 } } | |
82a56f0d LC |
600 | <- { "return": {} } |
601 | ||
602 | EQMP | |
603 | ||
604 | { | |
605 | .name = "netdev_add", | |
606 | .args_type = "netdev:O", | |
607 | .params = "[user|tap|socket],id=str[,prop=value][,...]", | |
608 | .help = "add host network device", | |
609 | .user_print = monitor_user_noop, | |
610 | .mhandler.cmd_new = do_netdev_add, | |
611 | }, | |
612 | ||
613 | SQMP | |
614 | netdev_add | |
615 | ---------- | |
616 | ||
617 | Add host network device. | |
618 | ||
619 | Arguments: | |
620 | ||
621 | - "type": the device type, "tap", "user", ... (json-string) | |
622 | - "id": the device's ID, must be unique (json-string) | |
623 | - device options | |
624 | ||
625 | Example: | |
626 | ||
627 | -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } } | |
628 | <- { "return": {} } | |
629 | ||
630 | Note: The supported device options are the same ones supported by the '-net' | |
631 | command-line argument, which are listed in the '-help' output or QEMU's | |
632 | manual | |
633 | ||
634 | EQMP | |
635 | ||
636 | { | |
637 | .name = "netdev_del", | |
638 | .args_type = "id:s", | |
639 | .params = "id", | |
640 | .help = "remove host network device", | |
641 | .user_print = monitor_user_noop, | |
642 | .mhandler.cmd_new = do_netdev_del, | |
643 | }, | |
644 | ||
645 | SQMP | |
646 | netdev_del | |
647 | ---------- | |
648 | ||
649 | Remove host network device. | |
650 | ||
651 | Arguments: | |
652 | ||
653 | - "id": the device's ID, must be unique (json-string) | |
654 | ||
655 | Example: | |
656 | ||
657 | -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } } | |
658 | <- { "return": {} } | |
659 | ||
6d4a2b3a CH |
660 | |
661 | EQMP | |
662 | ||
663 | { | |
664 | .name = "block_resize", | |
665 | .args_type = "device:B,size:o", | |
666 | .params = "device size", | |
667 | .help = "resize a block image", | |
668 | .user_print = monitor_user_noop, | |
669 | .mhandler.cmd_new = do_block_resize, | |
670 | }, | |
671 | ||
672 | SQMP | |
673 | block_resize | |
674 | ------------ | |
675 | ||
676 | Resize a block image while a guest is running. | |
677 | ||
678 | Arguments: | |
679 | ||
680 | - "device": the device's ID, must be unique (json-string) | |
681 | - "size": new size | |
682 | ||
683 | Example: | |
684 | ||
685 | -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } } | |
686 | <- { "return": {} } | |
687 | ||
d967b2f1 JS |
688 | EQMP |
689 | ||
690 | { | |
691 | .name = "blockdev-snapshot-sync", | |
692 | .args_type = "device:B,snapshot-file:s?,format:s?", | |
693 | .params = "device [new-image-file] [format]", | |
694 | .user_print = monitor_user_noop, | |
695 | .mhandler.cmd_new = do_snapshot_blkdev, | |
696 | }, | |
697 | ||
698 | SQMP | |
699 | blockdev-snapshot-sync | |
700 | ---------------------- | |
701 | ||
702 | Synchronous snapshot of a block device. snapshot-file specifies the | |
703 | target of the new image. If the file exists, or if it is a device, the | |
704 | snapshot will be created in the existing file/device. If does not | |
705 | exist, a new file will be created. format specifies the format of the | |
706 | snapshot image, default is qcow2. | |
707 | ||
708 | Arguments: | |
709 | ||
710 | - "device": device name to snapshot (json-string) | |
711 | - "snapshot-file": name of new image file (json-string) | |
712 | - "format": format of new image (json-string, optional) | |
713 | ||
714 | Example: | |
715 | ||
716 | -> { "execute": "blockdev-snapshot", "arguments": { "device": "ide-hd0", | |
717 | "snapshot-file": | |
718 | "/some/place/my-image", | |
719 | "format": "qcow2" } } | |
720 | <- { "return": {} } | |
721 | ||
82a56f0d LC |
722 | EQMP |
723 | ||
724 | { | |
725 | .name = "balloon", | |
726 | .args_type = "value:M", | |
727 | .params = "target", | |
728 | .help = "request VM to change its memory allocation (in MB)", | |
729 | .user_print = monitor_user_noop, | |
730 | .mhandler.cmd_async = do_balloon, | |
731 | .flags = MONITOR_CMD_ASYNC, | |
732 | }, | |
733 | ||
734 | SQMP | |
735 | balloon | |
736 | ------- | |
737 | ||
738 | Request VM to change its memory allocation (in bytes). | |
739 | ||
740 | Arguments: | |
741 | ||
742 | - "value": New memory allocation (json-int) | |
743 | ||
744 | Example: | |
745 | ||
746 | -> { "execute": "balloon", "arguments": { "value": 536870912 } } | |
747 | <- { "return": {} } | |
748 | ||
749 | EQMP | |
750 | ||
751 | { | |
752 | .name = "set_link", | |
753 | .args_type = "name:s,up:b", | |
754 | .params = "name on|off", | |
755 | .help = "change the link status of a network adapter", | |
756 | .user_print = monitor_user_noop, | |
757 | .mhandler.cmd_new = do_set_link, | |
758 | }, | |
759 | ||
760 | SQMP | |
761 | set_link | |
762 | -------- | |
763 | ||
764 | Change the link status of a network adapter. | |
765 | ||
766 | Arguments: | |
767 | ||
768 | - "name": network device name (json-string) | |
769 | - "up": status is up (json-bool) | |
770 | ||
771 | Example: | |
772 | ||
773 | -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } } | |
774 | <- { "return": {} } | |
775 | ||
776 | EQMP | |
777 | ||
778 | { | |
779 | .name = "getfd", | |
780 | .args_type = "fdname:s", | |
781 | .params = "getfd name", | |
782 | .help = "receive a file descriptor via SCM rights and assign it a name", | |
783 | .user_print = monitor_user_noop, | |
784 | .mhandler.cmd_new = do_getfd, | |
785 | }, | |
786 | ||
787 | SQMP | |
788 | getfd | |
789 | ----- | |
790 | ||
791 | Receive a file descriptor via SCM rights and assign it a name. | |
792 | ||
793 | Arguments: | |
794 | ||
795 | - "fdname": file descriptor name (json-string) | |
796 | ||
797 | Example: | |
798 | ||
799 | -> { "execute": "getfd", "arguments": { "fdname": "fd1" } } | |
800 | <- { "return": {} } | |
801 | ||
802 | EQMP | |
803 | ||
804 | { | |
805 | .name = "closefd", | |
806 | .args_type = "fdname:s", | |
807 | .params = "closefd name", | |
808 | .help = "close a file descriptor previously passed via SCM rights", | |
809 | .user_print = monitor_user_noop, | |
810 | .mhandler.cmd_new = do_closefd, | |
811 | }, | |
812 | ||
813 | SQMP | |
814 | closefd | |
815 | ------- | |
816 | ||
817 | Close a file descriptor previously passed via SCM rights. | |
818 | ||
819 | Arguments: | |
820 | ||
821 | - "fdname": file descriptor name (json-string) | |
822 | ||
823 | Example: | |
824 | ||
825 | -> { "execute": "closefd", "arguments": { "fdname": "fd1" } } | |
826 | <- { "return": {} } | |
827 | ||
828 | EQMP | |
829 | ||
830 | { | |
831 | .name = "block_passwd", | |
832 | .args_type = "device:B,password:s", | |
833 | .params = "block_passwd device password", | |
834 | .help = "set the password of encrypted block devices", | |
835 | .user_print = monitor_user_noop, | |
836 | .mhandler.cmd_new = do_block_set_passwd, | |
837 | }, | |
838 | ||
839 | SQMP | |
840 | block_passwd | |
841 | ------------ | |
842 | ||
843 | Set the password of encrypted block devices. | |
844 | ||
845 | Arguments: | |
846 | ||
847 | - "device": device name (json-string) | |
848 | - "password": password (json-string) | |
849 | ||
850 | Example: | |
851 | ||
852 | -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0", | |
853 | "password": "12345" } } | |
854 | <- { "return": {} } | |
855 | ||
7572150c GH |
856 | EQMP |
857 | ||
858 | { | |
859 | .name = "set_password", | |
860 | .args_type = "protocol:s,password:s,connected:s?", | |
861 | .params = "protocol password action-if-connected", | |
862 | .help = "set spice/vnc password", | |
863 | .user_print = monitor_user_noop, | |
864 | .mhandler.cmd_new = set_password, | |
865 | }, | |
866 | ||
867 | SQMP | |
868 | set_password | |
869 | ------------ | |
870 | ||
871 | Set the password for vnc/spice protocols. | |
872 | ||
873 | Arguments: | |
874 | ||
875 | - "protocol": protocol name (json-string) | |
876 | - "password": password (json-string) | |
877 | - "connected": [ keep | disconnect | fail ] (josn-string, optional) | |
878 | ||
879 | Example: | |
880 | ||
881 | -> { "execute": "set_password", "arguments": { "protocol": "vnc", | |
882 | "password": "secret" } } | |
883 | <- { "return": {} } | |
884 | ||
885 | EQMP | |
886 | ||
887 | { | |
888 | .name = "expire_password", | |
889 | .args_type = "protocol:s,time:s", | |
890 | .params = "protocol time", | |
891 | .help = "set spice/vnc password expire-time", | |
892 | .user_print = monitor_user_noop, | |
893 | .mhandler.cmd_new = expire_password, | |
894 | }, | |
895 | ||
896 | SQMP | |
897 | expire_password | |
898 | --------------- | |
899 | ||
900 | Set the password expire time for vnc/spice protocols. | |
901 | ||
902 | Arguments: | |
903 | ||
904 | - "protocol": protocol name (json-string) | |
905 | - "time": [ now | never | +secs | secs ] (json-string) | |
906 | ||
907 | Example: | |
908 | ||
909 | -> { "execute": "expire_password", "arguments": { "protocol": "vnc", | |
910 | "time": "+60" } } | |
911 | <- { "return": {} } | |
912 | ||
82a56f0d LC |
913 | EQMP |
914 | ||
13661089 DB |
915 | { |
916 | .name = "add_client", | |
917 | .args_type = "protocol:s,fdname:s,skipauth:b?", | |
918 | .params = "protocol fdname skipauth", | |
919 | .help = "add a graphics client", | |
920 | .user_print = monitor_user_noop, | |
921 | .mhandler.cmd_new = add_graphics_client, | |
922 | }, | |
923 | ||
924 | SQMP | |
925 | add_client | |
926 | ---------- | |
927 | ||
928 | Add a graphics client | |
929 | ||
930 | Arguments: | |
931 | ||
932 | - "protocol": protocol name (json-string) | |
933 | - "fdname": file descriptor name (json-string) | |
934 | ||
935 | Example: | |
936 | ||
937 | -> { "execute": "add_client", "arguments": { "protocol": "vnc", | |
938 | "fdname": "myclient" } } | |
939 | <- { "return": {} } | |
940 | ||
941 | EQMP | |
82a56f0d LC |
942 | { |
943 | .name = "qmp_capabilities", | |
944 | .args_type = "", | |
945 | .params = "", | |
946 | .help = "enable QMP capabilities", | |
947 | .user_print = monitor_user_noop, | |
948 | .mhandler.cmd_new = do_qmp_capabilities, | |
949 | }, | |
950 | ||
951 | SQMP | |
952 | qmp_capabilities | |
953 | ---------------- | |
954 | ||
955 | Enable QMP capabilities. | |
956 | ||
957 | Arguments: None. | |
958 | ||
959 | Example: | |
960 | ||
961 | -> { "execute": "qmp_capabilities" } | |
962 | <- { "return": {} } | |
963 | ||
964 | Note: This command must be issued before issuing any other command. | |
965 | ||
0268d97c LC |
966 | EQMP |
967 | ||
968 | { | |
969 | .name = "human-monitor-command", | |
970 | .args_type = "command-line:s,cpu-index:i?", | |
971 | .params = "", | |
972 | .help = "", | |
973 | .user_print = monitor_user_noop, | |
974 | .mhandler.cmd_new = do_hmp_passthrough, | |
975 | }, | |
976 | ||
977 | SQMP | |
978 | human-monitor-command | |
979 | --------------------- | |
980 | ||
981 | Execute a Human Monitor command. | |
982 | ||
983 | Arguments: | |
984 | ||
985 | - command-line: the command name and its arguments, just like the | |
986 | Human Monitor's shell (json-string) | |
987 | - cpu-index: select the CPU number to be used by commands which access CPU | |
988 | data, like 'info registers'. The Monitor selects CPU 0 if this | |
989 | argument is not provided (json-int, optional) | |
990 | ||
991 | Example: | |
992 | ||
993 | -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } } | |
994 | <- { "return": "kvm support: enabled\r\n" } | |
995 | ||
996 | Notes: | |
997 | ||
998 | (1) The Human Monitor is NOT an stable interface, this means that command | |
999 | names, arguments and responses can change or be removed at ANY time. | |
1000 | Applications that rely on long term stability guarantees should NOT | |
1001 | use this command | |
1002 | ||
1003 | (2) Limitations: | |
1004 | ||
1005 | o This command is stateless, this means that commands that depend | |
1006 | on state information (such as getfd) might not work | |
1007 | ||
1008 | o Commands that prompt the user for data (eg. 'cont' when the block | |
1009 | device is encrypted) don't currently work | |
1010 | ||
82a56f0d LC |
1011 | 3. Query Commands |
1012 | ================= | |
1013 | ||
1014 | HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change | |
1015 | HXCOMM this! We will possibly move query commands definitions inside those | |
1016 | HXCOMM sections, just like regular commands. | |
1017 | ||
1018 | EQMP | |
1019 | ||
1020 | SQMP | |
1021 | query-version | |
1022 | ------------- | |
1023 | ||
1024 | Show QEMU version. | |
1025 | ||
1026 | Return a json-object with the following information: | |
1027 | ||
1028 | - "qemu": A json-object containing three integer values: | |
1029 | - "major": QEMU's major version (json-int) | |
1030 | - "minor": QEMU's minor version (json-int) | |
1031 | - "micro": QEMU's micro version (json-int) | |
1032 | - "package": package's version (json-string) | |
1033 | ||
1034 | Example: | |
1035 | ||
1036 | -> { "execute": "query-version" } | |
1037 | <- { | |
1038 | "return":{ | |
1039 | "qemu":{ | |
1040 | "major":0, | |
1041 | "minor":11, | |
1042 | "micro":5 | |
1043 | }, | |
1044 | "package":"" | |
1045 | } | |
1046 | } | |
1047 | ||
1048 | EQMP | |
1049 | ||
b9c15f16 LC |
1050 | { |
1051 | .name = "query-version", | |
1052 | .args_type = "", | |
1053 | .mhandler.cmd_new = qmp_marshal_input_query_version, | |
1054 | }, | |
1055 | ||
82a56f0d LC |
1056 | SQMP |
1057 | query-commands | |
1058 | -------------- | |
1059 | ||
1060 | List QMP available commands. | |
1061 | ||
1062 | Each command is represented by a json-object, the returned value is a json-array | |
1063 | of all commands. | |
1064 | ||
1065 | Each json-object contain: | |
1066 | ||
1067 | - "name": command's name (json-string) | |
1068 | ||
1069 | Example: | |
1070 | ||
1071 | -> { "execute": "query-commands" } | |
1072 | <- { | |
1073 | "return":[ | |
1074 | { | |
1075 | "name":"query-balloon" | |
1076 | }, | |
1077 | { | |
1078 | "name":"system_powerdown" | |
1079 | } | |
1080 | ] | |
1081 | } | |
1082 | ||
1083 | Note: This example has been shortened as the real response is too long. | |
1084 | ||
1085 | EQMP | |
1086 | ||
aa9b79bc LC |
1087 | { |
1088 | .name = "query-commands", | |
1089 | .args_type = "", | |
1090 | .mhandler.cmd_new = qmp_marshal_input_query_commands, | |
1091 | }, | |
1092 | ||
82a56f0d LC |
1093 | SQMP |
1094 | query-chardev | |
1095 | ------------- | |
1096 | ||
1097 | Each device is represented by a json-object. The returned value is a json-array | |
1098 | of all devices. | |
1099 | ||
1100 | Each json-object contain the following: | |
1101 | ||
1102 | - "label": device's label (json-string) | |
1103 | - "filename": device's file (json-string) | |
1104 | ||
1105 | Example: | |
1106 | ||
1107 | -> { "execute": "query-chardev" } | |
1108 | <- { | |
1109 | "return":[ | |
1110 | { | |
1111 | "label":"monitor", | |
1112 | "filename":"stdio" | |
1113 | }, | |
1114 | { | |
1115 | "label":"serial0", | |
1116 | "filename":"vc" | |
1117 | } | |
1118 | ] | |
1119 | } | |
1120 | ||
1121 | EQMP | |
1122 | ||
c5a415a0 LC |
1123 | { |
1124 | .name = "query-chardev", | |
1125 | .args_type = "", | |
1126 | .mhandler.cmd_new = qmp_marshal_input_query_chardev, | |
1127 | }, | |
1128 | ||
82a56f0d LC |
1129 | SQMP |
1130 | query-block | |
1131 | ----------- | |
1132 | ||
1133 | Show the block devices. | |
1134 | ||
1135 | Each block device information is stored in a json-object and the returned value | |
1136 | is a json-array of all devices. | |
1137 | ||
1138 | Each json-object contain the following: | |
1139 | ||
1140 | - "device": device name (json-string) | |
1141 | - "type": device type (json-string) | |
d8aeeb31 MA |
1142 | - deprecated, retained for backward compatibility |
1143 | - Possible values: "unknown" | |
82a56f0d LC |
1144 | - "removable": true if the device is removable, false otherwise (json-bool) |
1145 | - "locked": true if the device is locked, false otherwise (json-bool) | |
e4def80b MA |
1146 | - "tray-open": only present if removable, true if the device has a tray, |
1147 | and it is open (json-bool) | |
82a56f0d LC |
1148 | - "inserted": only present if the device is inserted, it is a json-object |
1149 | containing the following: | |
1150 | - "file": device file name (json-string) | |
1151 | - "ro": true if read-only, false otherwise (json-bool) | |
1152 | - "drv": driver format name (json-string) | |
1153 | - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg", | |
1154 | "file", "file", "ftp", "ftps", "host_cdrom", | |
1155 | "host_device", "host_floppy", "http", "https", | |
1156 | "nbd", "parallels", "qcow", "qcow2", "raw", | |
1157 | "tftp", "vdi", "vmdk", "vpc", "vvfat" | |
1158 | - "backing_file": backing file name (json-string, optional) | |
1159 | - "encrypted": true if encrypted, false otherwise (json-bool) | |
1160 | ||
1161 | Example: | |
1162 | ||
1163 | -> { "execute": "query-block" } | |
1164 | <- { | |
1165 | "return":[ | |
1166 | { | |
1167 | "device":"ide0-hd0", | |
1168 | "locked":false, | |
1169 | "removable":false, | |
1170 | "inserted":{ | |
1171 | "ro":false, | |
1172 | "drv":"qcow2", | |
1173 | "encrypted":false, | |
1174 | "file":"disks/test.img" | |
1175 | }, | |
d8aeeb31 | 1176 | "type":"unknown" |
82a56f0d LC |
1177 | }, |
1178 | { | |
1179 | "device":"ide1-cd0", | |
1180 | "locked":false, | |
1181 | "removable":true, | |
d8aeeb31 | 1182 | "type":"unknown" |
82a56f0d LC |
1183 | }, |
1184 | { | |
1185 | "device":"floppy0", | |
1186 | "locked":false, | |
1187 | "removable":true, | |
d8aeeb31 | 1188 | "type":"unknown" |
82a56f0d LC |
1189 | }, |
1190 | { | |
1191 | "device":"sd0", | |
1192 | "locked":false, | |
1193 | "removable":true, | |
d8aeeb31 | 1194 | "type":"unknown" |
82a56f0d LC |
1195 | } |
1196 | ] | |
1197 | } | |
1198 | ||
1199 | EQMP | |
1200 | ||
1201 | SQMP | |
1202 | query-blockstats | |
1203 | ---------------- | |
1204 | ||
1205 | Show block device statistics. | |
1206 | ||
1207 | Each device statistic information is stored in a json-object and the returned | |
1208 | value is a json-array of all devices. | |
1209 | ||
1210 | Each json-object contain the following: | |
1211 | ||
1212 | - "device": device name (json-string) | |
1213 | - "stats": A json-object with the statistics information, it contains: | |
1214 | - "rd_bytes": bytes read (json-int) | |
1215 | - "wr_bytes": bytes written (json-int) | |
1216 | - "rd_operations": read operations (json-int) | |
1217 | - "wr_operations": write operations (json-int) | |
e8045d67 | 1218 | - "flush_operations": cache flush operations (json-int) |
c488c7f6 CH |
1219 | - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int) |
1220 | - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int) | |
1221 | - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int) | |
82a56f0d LC |
1222 | - "wr_highest_offset": Highest offset of a sector written since the |
1223 | BlockDriverState has been opened (json-int) | |
1224 | - "parent": Contains recursively the statistics of the underlying | |
1225 | protocol (e.g. the host file for a qcow2 image). If there is | |
1226 | no underlying protocol, this field is omitted | |
1227 | (json-object, optional) | |
1228 | ||
1229 | Example: | |
1230 | ||
1231 | -> { "execute": "query-blockstats" } | |
1232 | <- { | |
1233 | "return":[ | |
1234 | { | |
1235 | "device":"ide0-hd0", | |
1236 | "parent":{ | |
1237 | "stats":{ | |
1238 | "wr_highest_offset":3686448128, | |
1239 | "wr_bytes":9786368, | |
1240 | "wr_operations":751, | |
1241 | "rd_bytes":122567168, | |
1242 | "rd_operations":36772 | |
c488c7f6 CH |
1243 | "wr_total_times_ns":313253456 |
1244 | "rd_total_times_ns":3465673657 | |
1245 | "flush_total_times_ns":49653 | |
e8045d67 | 1246 | "flush_operations":61, |
82a56f0d LC |
1247 | } |
1248 | }, | |
1249 | "stats":{ | |
1250 | "wr_highest_offset":2821110784, | |
1251 | "wr_bytes":9786368, | |
1252 | "wr_operations":692, | |
1253 | "rd_bytes":122739200, | |
1254 | "rd_operations":36604 | |
e8045d67 | 1255 | "flush_operations":51, |
c488c7f6 CH |
1256 | "wr_total_times_ns":313253456 |
1257 | "rd_total_times_ns":3465673657 | |
1258 | "flush_total_times_ns":49653 | |
82a56f0d LC |
1259 | } |
1260 | }, | |
1261 | { | |
1262 | "device":"ide1-cd0", | |
1263 | "stats":{ | |
1264 | "wr_highest_offset":0, | |
1265 | "wr_bytes":0, | |
1266 | "wr_operations":0, | |
1267 | "rd_bytes":0, | |
1268 | "rd_operations":0 | |
e8045d67 | 1269 | "flush_operations":0, |
c488c7f6 CH |
1270 | "wr_total_times_ns":0 |
1271 | "rd_total_times_ns":0 | |
1272 | "flush_total_times_ns":0 | |
82a56f0d LC |
1273 | } |
1274 | }, | |
1275 | { | |
1276 | "device":"floppy0", | |
1277 | "stats":{ | |
1278 | "wr_highest_offset":0, | |
1279 | "wr_bytes":0, | |
1280 | "wr_operations":0, | |
1281 | "rd_bytes":0, | |
1282 | "rd_operations":0 | |
e8045d67 | 1283 | "flush_operations":0, |
c488c7f6 CH |
1284 | "wr_total_times_ns":0 |
1285 | "rd_total_times_ns":0 | |
1286 | "flush_total_times_ns":0 | |
82a56f0d LC |
1287 | } |
1288 | }, | |
1289 | { | |
1290 | "device":"sd0", | |
1291 | "stats":{ | |
1292 | "wr_highest_offset":0, | |
1293 | "wr_bytes":0, | |
1294 | "wr_operations":0, | |
1295 | "rd_bytes":0, | |
1296 | "rd_operations":0 | |
e8045d67 | 1297 | "flush_operations":0, |
c488c7f6 CH |
1298 | "wr_total_times_ns":0 |
1299 | "rd_total_times_ns":0 | |
1300 | "flush_total_times_ns":0 | |
82a56f0d LC |
1301 | } |
1302 | } | |
1303 | ] | |
1304 | } | |
1305 | ||
1306 | EQMP | |
1307 | ||
1308 | SQMP | |
1309 | query-cpus | |
1310 | ---------- | |
1311 | ||
1312 | Show CPU information. | |
1313 | ||
1314 | Return a json-array. Each CPU is represented by a json-object, which contains: | |
1315 | ||
1316 | - "CPU": CPU index (json-int) | |
1317 | - "current": true if this is the current CPU, false otherwise (json-bool) | |
1318 | - "halted": true if the cpu is halted, false otherwise (json-bool) | |
1319 | - Current program counter. The key's name depends on the architecture: | |
1320 | "pc": i386/x86_64 (json-int) | |
1321 | "nip": PPC (json-int) | |
1322 | "pc" and "npc": sparc (json-int) | |
1323 | "PC": mips (json-int) | |
dc7a09cf | 1324 | - "thread_id": ID of the underlying host thread (json-int) |
82a56f0d LC |
1325 | |
1326 | Example: | |
1327 | ||
1328 | -> { "execute": "query-cpus" } | |
1329 | <- { | |
1330 | "return":[ | |
1331 | { | |
1332 | "CPU":0, | |
1333 | "current":true, | |
1334 | "halted":false, | |
1335 | "pc":3227107138 | |
dc7a09cf | 1336 | "thread_id":3134 |
82a56f0d LC |
1337 | }, |
1338 | { | |
1339 | "CPU":1, | |
1340 | "current":false, | |
1341 | "halted":true, | |
1342 | "pc":7108165 | |
dc7a09cf | 1343 | "thread_id":3135 |
82a56f0d LC |
1344 | } |
1345 | ] | |
1346 | } | |
1347 | ||
1348 | EQMP | |
1349 | ||
1350 | SQMP | |
1351 | query-pci | |
1352 | --------- | |
1353 | ||
1354 | PCI buses and devices information. | |
1355 | ||
1356 | The returned value is a json-array of all buses. Each bus is represented by | |
1357 | a json-object, which has a key with a json-array of all PCI devices attached | |
1358 | to it. Each device is represented by a json-object. | |
1359 | ||
1360 | The bus json-object contains the following: | |
1361 | ||
1362 | - "bus": bus number (json-int) | |
1363 | - "devices": a json-array of json-objects, each json-object represents a | |
1364 | PCI device | |
1365 | ||
1366 | The PCI device json-object contains the following: | |
1367 | ||
1368 | - "bus": identical to the parent's bus number (json-int) | |
1369 | - "slot": slot number (json-int) | |
1370 | - "function": function number (json-int) | |
1371 | - "class_info": a json-object containing: | |
1372 | - "desc": device class description (json-string, optional) | |
1373 | - "class": device class number (json-int) | |
1374 | - "id": a json-object containing: | |
1375 | - "device": device ID (json-int) | |
1376 | - "vendor": vendor ID (json-int) | |
1377 | - "irq": device's IRQ if assigned (json-int, optional) | |
1378 | - "qdev_id": qdev id string (json-string) | |
1379 | - "pci_bridge": It's a json-object, only present if this device is a | |
1380 | PCI bridge, contains: | |
1381 | - "bus": bus number (json-int) | |
1382 | - "secondary": secondary bus number (json-int) | |
1383 | - "subordinate": subordinate bus number (json-int) | |
1384 | - "io_range": I/O memory range information, a json-object with the | |
1385 | following members: | |
1386 | - "base": base address, in bytes (json-int) | |
1387 | - "limit": limit address, in bytes (json-int) | |
1388 | - "memory_range": memory range information, a json-object with the | |
1389 | following members: | |
1390 | - "base": base address, in bytes (json-int) | |
1391 | - "limit": limit address, in bytes (json-int) | |
1392 | - "prefetchable_range": Prefetchable memory range information, a | |
1393 | json-object with the following members: | |
1394 | - "base": base address, in bytes (json-int) | |
1395 | - "limit": limit address, in bytes (json-int) | |
1396 | - "devices": a json-array of PCI devices if there's any attached, each | |
1397 | each element is represented by a json-object, which contains | |
1398 | the same members of the 'PCI device json-object' described | |
1399 | above (optional) | |
1400 | - "regions": a json-array of json-objects, each json-object represents a | |
1401 | memory region of this device | |
1402 | ||
1403 | The memory range json-object contains the following: | |
1404 | ||
1405 | - "base": base memory address (json-int) | |
1406 | - "limit": limit value (json-int) | |
1407 | ||
1408 | The region json-object can be an I/O region or a memory region, an I/O region | |
1409 | json-object contains the following: | |
1410 | ||
1411 | - "type": "io" (json-string, fixed) | |
1412 | - "bar": BAR number (json-int) | |
1413 | - "address": memory address (json-int) | |
1414 | - "size": memory size (json-int) | |
1415 | ||
1416 | A memory region json-object contains the following: | |
1417 | ||
1418 | - "type": "memory" (json-string, fixed) | |
1419 | - "bar": BAR number (json-int) | |
1420 | - "address": memory address (json-int) | |
1421 | - "size": memory size (json-int) | |
1422 | - "mem_type_64": true or false (json-bool) | |
1423 | - "prefetch": true or false (json-bool) | |
1424 | ||
1425 | Example: | |
1426 | ||
1427 | -> { "execute": "query-pci" } | |
1428 | <- { | |
1429 | "return":[ | |
1430 | { | |
1431 | "bus":0, | |
1432 | "devices":[ | |
1433 | { | |
1434 | "bus":0, | |
1435 | "qdev_id":"", | |
1436 | "slot":0, | |
1437 | "class_info":{ | |
1438 | "class":1536, | |
1439 | "desc":"Host bridge" | |
1440 | }, | |
1441 | "id":{ | |
1442 | "device":32902, | |
1443 | "vendor":4663 | |
1444 | }, | |
1445 | "function":0, | |
1446 | "regions":[ | |
1447 | ||
1448 | ] | |
1449 | }, | |
1450 | { | |
1451 | "bus":0, | |
1452 | "qdev_id":"", | |
1453 | "slot":1, | |
1454 | "class_info":{ | |
1455 | "class":1537, | |
1456 | "desc":"ISA bridge" | |
1457 | }, | |
1458 | "id":{ | |
1459 | "device":32902, | |
1460 | "vendor":28672 | |
1461 | }, | |
1462 | "function":0, | |
1463 | "regions":[ | |
1464 | ||
1465 | ] | |
1466 | }, | |
1467 | { | |
1468 | "bus":0, | |
1469 | "qdev_id":"", | |
1470 | "slot":1, | |
1471 | "class_info":{ | |
1472 | "class":257, | |
1473 | "desc":"IDE controller" | |
1474 | }, | |
1475 | "id":{ | |
1476 | "device":32902, | |
1477 | "vendor":28688 | |
1478 | }, | |
1479 | "function":1, | |
1480 | "regions":[ | |
1481 | { | |
1482 | "bar":4, | |
1483 | "size":16, | |
1484 | "address":49152, | |
1485 | "type":"io" | |
1486 | } | |
1487 | ] | |
1488 | }, | |
1489 | { | |
1490 | "bus":0, | |
1491 | "qdev_id":"", | |
1492 | "slot":2, | |
1493 | "class_info":{ | |
1494 | "class":768, | |
1495 | "desc":"VGA controller" | |
1496 | }, | |
1497 | "id":{ | |
1498 | "device":4115, | |
1499 | "vendor":184 | |
1500 | }, | |
1501 | "function":0, | |
1502 | "regions":[ | |
1503 | { | |
1504 | "prefetch":true, | |
1505 | "mem_type_64":false, | |
1506 | "bar":0, | |
1507 | "size":33554432, | |
1508 | "address":4026531840, | |
1509 | "type":"memory" | |
1510 | }, | |
1511 | { | |
1512 | "prefetch":false, | |
1513 | "mem_type_64":false, | |
1514 | "bar":1, | |
1515 | "size":4096, | |
1516 | "address":4060086272, | |
1517 | "type":"memory" | |
1518 | }, | |
1519 | { | |
1520 | "prefetch":false, | |
1521 | "mem_type_64":false, | |
1522 | "bar":6, | |
1523 | "size":65536, | |
1524 | "address":-1, | |
1525 | "type":"memory" | |
1526 | } | |
1527 | ] | |
1528 | }, | |
1529 | { | |
1530 | "bus":0, | |
1531 | "qdev_id":"", | |
1532 | "irq":11, | |
1533 | "slot":4, | |
1534 | "class_info":{ | |
1535 | "class":1280, | |
1536 | "desc":"RAM controller" | |
1537 | }, | |
1538 | "id":{ | |
1539 | "device":6900, | |
1540 | "vendor":4098 | |
1541 | }, | |
1542 | "function":0, | |
1543 | "regions":[ | |
1544 | { | |
1545 | "bar":0, | |
1546 | "size":32, | |
1547 | "address":49280, | |
1548 | "type":"io" | |
1549 | } | |
1550 | ] | |
1551 | } | |
1552 | ] | |
1553 | } | |
1554 | ] | |
1555 | } | |
1556 | ||
1557 | Note: This example has been shortened as the real response is too long. | |
1558 | ||
1559 | EQMP | |
1560 | ||
1561 | SQMP | |
1562 | query-kvm | |
1563 | --------- | |
1564 | ||
1565 | Show KVM information. | |
1566 | ||
1567 | Return a json-object with the following information: | |
1568 | ||
1569 | - "enabled": true if KVM support is enabled, false otherwise (json-bool) | |
1570 | - "present": true if QEMU has KVM support, false otherwise (json-bool) | |
1571 | ||
1572 | Example: | |
1573 | ||
1574 | -> { "execute": "query-kvm" } | |
1575 | <- { "return": { "enabled": true, "present": true } } | |
1576 | ||
1577 | EQMP | |
1578 | ||
292a2602 LC |
1579 | { |
1580 | .name = "query-kvm", | |
1581 | .args_type = "", | |
1582 | .mhandler.cmd_new = qmp_marshal_input_query_kvm, | |
1583 | }, | |
1584 | ||
82a56f0d LC |
1585 | SQMP |
1586 | query-status | |
1587 | ------------ | |
1588 | ||
1589 | Return a json-object with the following information: | |
1590 | ||
1591 | - "running": true if the VM is running, or false if it is paused (json-bool) | |
1592 | - "singlestep": true if the VM is in single step mode, | |
1593 | false otherwise (json-bool) | |
9e37b9dc LC |
1594 | - "status": one of the following values (json-string) |
1595 | "debug" - QEMU is running on a debugger | |
1596 | "inmigrate" - guest is paused waiting for an incoming migration | |
1597 | "internal-error" - An internal error that prevents further guest | |
1598 | execution has occurred | |
1599 | "io-error" - the last IOP has failed and the device is configured | |
1600 | to pause on I/O errors | |
1601 | "paused" - guest has been paused via the 'stop' command | |
1602 | "postmigrate" - guest is paused following a successful 'migrate' | |
1603 | "prelaunch" - QEMU was started with -S and guest has not started | |
1604 | "finish-migrate" - guest is paused to finish the migration process | |
1605 | "restore-vm" - guest is paused to restore VM state | |
1606 | "running" - guest is actively running | |
1607 | "save-vm" - guest is paused to save the VM state | |
1608 | "shutdown" - guest is shut down (and -no-shutdown is in use) | |
1609 | "watchdog" - the watchdog action is configured to pause and | |
1610 | has been triggered | |
82a56f0d LC |
1611 | |
1612 | Example: | |
1613 | ||
1614 | -> { "execute": "query-status" } | |
9e37b9dc | 1615 | <- { "return": { "running": true, "singlestep": false, "status": "running" } } |
82a56f0d LC |
1616 | |
1617 | EQMP | |
1fa9a5e4 LC |
1618 | |
1619 | { | |
1620 | .name = "query-status", | |
1621 | .args_type = "", | |
1622 | .mhandler.cmd_new = qmp_marshal_input_query_status, | |
1623 | }, | |
82a56f0d LC |
1624 | |
1625 | SQMP | |
1626 | query-mice | |
1627 | ---------- | |
1628 | ||
1629 | Show VM mice information. | |
1630 | ||
1631 | Each mouse is represented by a json-object, the returned value is a json-array | |
1632 | of all mice. | |
1633 | ||
1634 | The mouse json-object contains the following: | |
1635 | ||
1636 | - "name": mouse's name (json-string) | |
1637 | - "index": mouse's index (json-int) | |
1638 | - "current": true if this mouse is receiving events, false otherwise (json-bool) | |
1639 | - "absolute": true if the mouse generates absolute input events (json-bool) | |
1640 | ||
1641 | Example: | |
1642 | ||
1643 | -> { "execute": "query-mice" } | |
1644 | <- { | |
1645 | "return":[ | |
1646 | { | |
1647 | "name":"QEMU Microsoft Mouse", | |
1648 | "index":0, | |
1649 | "current":false, | |
1650 | "absolute":false | |
1651 | }, | |
1652 | { | |
1653 | "name":"QEMU PS/2 Mouse", | |
1654 | "index":1, | |
1655 | "current":true, | |
1656 | "absolute":true | |
1657 | } | |
1658 | ] | |
1659 | } | |
1660 | ||
1661 | EQMP | |
1662 | ||
1663 | SQMP | |
1664 | query-vnc | |
1665 | --------- | |
1666 | ||
1667 | Show VNC server information. | |
1668 | ||
1669 | Return a json-object with server information. Connected clients are returned | |
1670 | as a json-array of json-objects. | |
1671 | ||
1672 | The main json-object contains the following: | |
1673 | ||
1674 | - "enabled": true or false (json-bool) | |
1675 | - "host": server's IP address (json-string) | |
1676 | - "family": address family (json-string) | |
1677 | - Possible values: "ipv4", "ipv6", "unix", "unknown" | |
1678 | - "service": server's port number (json-string) | |
1679 | - "auth": authentication method (json-string) | |
1680 | - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight", | |
1681 | "tls", "ultra", "unknown", "vencrypt", "vencrypt", | |
1682 | "vencrypt+plain", "vencrypt+tls+none", | |
1683 | "vencrypt+tls+plain", "vencrypt+tls+sasl", | |
1684 | "vencrypt+tls+vnc", "vencrypt+x509+none", | |
1685 | "vencrypt+x509+plain", "vencrypt+x509+sasl", | |
1686 | "vencrypt+x509+vnc", "vnc" | |
1687 | - "clients": a json-array of all connected clients | |
1688 | ||
1689 | Clients are described by a json-object, each one contain the following: | |
1690 | ||
1691 | - "host": client's IP address (json-string) | |
1692 | - "family": address family (json-string) | |
1693 | - Possible values: "ipv4", "ipv6", "unix", "unknown" | |
1694 | - "service": client's port number (json-string) | |
1695 | - "x509_dname": TLS dname (json-string, optional) | |
1696 | - "sasl_username": SASL username (json-string, optional) | |
1697 | ||
1698 | Example: | |
1699 | ||
1700 | -> { "execute": "query-vnc" } | |
1701 | <- { | |
1702 | "return":{ | |
1703 | "enabled":true, | |
1704 | "host":"0.0.0.0", | |
1705 | "service":"50402", | |
1706 | "auth":"vnc", | |
1707 | "family":"ipv4", | |
1708 | "clients":[ | |
1709 | { | |
1710 | "host":"127.0.0.1", | |
1711 | "service":"50401", | |
1712 | "family":"ipv4" | |
1713 | } | |
1714 | ] | |
1715 | } | |
1716 | } | |
1717 | ||
1718 | EQMP | |
1719 | ||
cb42a870 GH |
1720 | SQMP |
1721 | query-spice | |
1722 | ----------- | |
1723 | ||
1724 | Show SPICE server information. | |
1725 | ||
1726 | Return a json-object with server information. Connected clients are returned | |
1727 | as a json-array of json-objects. | |
1728 | ||
1729 | The main json-object contains the following: | |
1730 | ||
1731 | - "enabled": true or false (json-bool) | |
1732 | - "host": server's IP address (json-string) | |
1733 | - "port": server's port number (json-int, optional) | |
1734 | - "tls-port": server's port number (json-int, optional) | |
1735 | - "auth": authentication method (json-string) | |
1736 | - Possible values: "none", "spice" | |
1737 | - "channels": a json-array of all active channels clients | |
1738 | ||
1739 | Channels are described by a json-object, each one contain the following: | |
1740 | ||
1741 | - "host": client's IP address (json-string) | |
1742 | - "family": address family (json-string) | |
1743 | - Possible values: "ipv4", "ipv6", "unix", "unknown" | |
1744 | - "port": client's port number (json-string) | |
1745 | - "connection-id": spice connection id. All channels with the same id | |
1746 | belong to the same spice session (json-int) | |
1747 | - "channel-type": channel type. "1" is the main control channel, filter for | |
1748 | this one if you want track spice sessions only (json-int) | |
1749 | - "channel-id": channel id. Usually "0", might be different needed when | |
1750 | multiple channels of the same type exist, such as multiple | |
1751 | display channels in a multihead setup (json-int) | |
1752 | - "tls": whevener the channel is encrypted (json-bool) | |
1753 | ||
1754 | Example: | |
1755 | ||
1756 | -> { "execute": "query-spice" } | |
1757 | <- { | |
1758 | "return": { | |
1759 | "enabled": true, | |
1760 | "auth": "spice", | |
1761 | "port": 5920, | |
1762 | "tls-port": 5921, | |
1763 | "host": "0.0.0.0", | |
1764 | "channels": [ | |
1765 | { | |
1766 | "port": "54924", | |
1767 | "family": "ipv4", | |
1768 | "channel-type": 1, | |
1769 | "connection-id": 1804289383, | |
1770 | "host": "127.0.0.1", | |
1771 | "channel-id": 0, | |
1772 | "tls": true | |
1773 | }, | |
1774 | { | |
1775 | "port": "36710", | |
1776 | "family": "ipv4", | |
1777 | "channel-type": 4, | |
1778 | "connection-id": 1804289383, | |
1779 | "host": "127.0.0.1", | |
1780 | "channel-id": 0, | |
1781 | "tls": false | |
1782 | }, | |
1783 | [ ... more channels follow ... ] | |
1784 | ] | |
1785 | } | |
1786 | } | |
1787 | ||
1788 | EQMP | |
1789 | ||
82a56f0d LC |
1790 | SQMP |
1791 | query-name | |
1792 | ---------- | |
1793 | ||
1794 | Show VM name. | |
1795 | ||
1796 | Return a json-object with the following information: | |
1797 | ||
1798 | - "name": VM's name (json-string, optional) | |
1799 | ||
1800 | Example: | |
1801 | ||
1802 | -> { "execute": "query-name" } | |
1803 | <- { "return": { "name": "qemu-name" } } | |
1804 | ||
1805 | EQMP | |
1806 | ||
48a32bed AL |
1807 | { |
1808 | .name = "query-name", | |
1809 | .args_type = "", | |
1810 | .mhandler.cmd_new = qmp_marshal_input_query_name, | |
1811 | }, | |
1812 | ||
82a56f0d LC |
1813 | SQMP |
1814 | query-uuid | |
1815 | ---------- | |
1816 | ||
1817 | Show VM UUID. | |
1818 | ||
1819 | Return a json-object with the following information: | |
1820 | ||
1821 | - "UUID": Universally Unique Identifier (json-string) | |
1822 | ||
1823 | Example: | |
1824 | ||
1825 | -> { "execute": "query-uuid" } | |
1826 | <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } } | |
1827 | ||
1828 | EQMP | |
1829 | ||
efab767e LC |
1830 | { |
1831 | .name = "query-uuid", | |
1832 | .args_type = "", | |
1833 | .mhandler.cmd_new = qmp_marshal_input_query_uuid, | |
1834 | }, | |
1835 | ||
82a56f0d LC |
1836 | SQMP |
1837 | query-migrate | |
1838 | ------------- | |
1839 | ||
1840 | Migration status. | |
1841 | ||
1842 | Return a json-object. If migration is active there will be another json-object | |
1843 | with RAM migration status and if block migration is active another one with | |
1844 | block migration status. | |
1845 | ||
1846 | The main json-object contains the following: | |
1847 | ||
1848 | - "status": migration status (json-string) | |
1849 | - Possible values: "active", "completed", "failed", "cancelled" | |
1850 | - "ram": only present if "status" is "active", it is a json-object with the | |
1851 | following RAM information (in bytes): | |
1852 | - "transferred": amount transferred (json-int) | |
1853 | - "remaining": amount remaining (json-int) | |
1854 | - "total": total (json-int) | |
1855 | - "disk": only present if "status" is "active" and it is a block migration, | |
1856 | it is a json-object with the following disk information (in bytes): | |
1857 | - "transferred": amount transferred (json-int) | |
1858 | - "remaining": amount remaining (json-int) | |
1859 | - "total": total (json-int) | |
1860 | ||
1861 | Examples: | |
1862 | ||
1863 | 1. Before the first migration | |
1864 | ||
1865 | -> { "execute": "query-migrate" } | |
1866 | <- { "return": {} } | |
1867 | ||
1868 | 2. Migration is done and has succeeded | |
1869 | ||
1870 | -> { "execute": "query-migrate" } | |
1871 | <- { "return": { "status": "completed" } } | |
1872 | ||
1873 | 3. Migration is done and has failed | |
1874 | ||
1875 | -> { "execute": "query-migrate" } | |
1876 | <- { "return": { "status": "failed" } } | |
1877 | ||
1878 | 4. Migration is being performed and is not a block migration: | |
1879 | ||
1880 | -> { "execute": "query-migrate" } | |
1881 | <- { | |
1882 | "return":{ | |
1883 | "status":"active", | |
1884 | "ram":{ | |
1885 | "transferred":123, | |
1886 | "remaining":123, | |
1887 | "total":246 | |
1888 | } | |
1889 | } | |
1890 | } | |
1891 | ||
1892 | 5. Migration is being performed and is a block migration: | |
1893 | ||
1894 | -> { "execute": "query-migrate" } | |
1895 | <- { | |
1896 | "return":{ | |
1897 | "status":"active", | |
1898 | "ram":{ | |
1899 | "total":1057024, | |
1900 | "remaining":1053304, | |
1901 | "transferred":3720 | |
1902 | }, | |
1903 | "disk":{ | |
1904 | "total":20971520, | |
1905 | "remaining":20880384, | |
1906 | "transferred":91136 | |
1907 | } | |
1908 | } | |
1909 | } | |
1910 | ||
1911 | EQMP | |
1912 | ||
1913 | SQMP | |
1914 | query-balloon | |
1915 | ------------- | |
1916 | ||
1917 | Show balloon information. | |
1918 | ||
1919 | Make an asynchronous request for balloon info. When the request completes a | |
1920 | json-object will be returned containing the following data: | |
1921 | ||
1922 | - "actual": current balloon value in bytes (json-int) | |
1923 | - "mem_swapped_in": Amount of memory swapped in bytes (json-int, optional) | |
1924 | - "mem_swapped_out": Amount of memory swapped out in bytes (json-int, optional) | |
1925 | - "major_page_faults": Number of major faults (json-int, optional) | |
1926 | - "minor_page_faults": Number of minor faults (json-int, optional) | |
1927 | - "free_mem": Total amount of free and unused memory in | |
1928 | bytes (json-int, optional) | |
1929 | - "total_mem": Total amount of available memory in bytes (json-int, optional) | |
1930 | ||
1931 | Example: | |
1932 | ||
1933 | -> { "execute": "query-balloon" } | |
1934 | <- { | |
1935 | "return":{ | |
1936 | "actual":1073741824, | |
1937 | "mem_swapped_in":0, | |
1938 | "mem_swapped_out":0, | |
1939 | "major_page_faults":142, | |
1940 | "minor_page_faults":239245, | |
1941 | "free_mem":1014185984, | |
1942 | "total_mem":1044668416 | |
1943 | } | |
1944 | } | |
1945 | ||
1946 | EQMP | |
1947 |