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