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