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