]> git.proxmox.com Git - qemu.git/blob - qmp-commands.hx
qapi: convert sendkey
[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 .mhandler.cmd_new = qmp_marshal_input_device_del,
318 },
319
320 SQMP
321 device_del
322 ----------
323
324 Remove a device.
325
326 Arguments:
327
328 - "id": the device's ID (json-string)
329
330 Example:
331
332 -> { "execute": "device_del", "arguments": { "id": "net1" } }
333 <- { "return": {} }
334
335 EQMP
336
337 {
338 .name = "send-key",
339 .args_type = "keys:O,hold-time:i?",
340 .mhandler.cmd_new = qmp_marshal_input_send_key,
341 },
342
343 SQMP
344 send-key
345 ----------
346
347 Send keys to VM.
348
349 Arguments:
350
351 keys array:
352 - "key": key sequence (a json-array of key enum values)
353
354 - hold-time: time to delay key up events, milliseconds. Defaults to 100
355 (json-int, optional)
356
357 Example:
358
359 -> { "execute": "send-key",
360 "arguments": { 'keys': [ 'ctrl', 'alt', 'delete' ] } }
361 <- { "return": {} }
362
363 EQMP
364
365 {
366 .name = "cpu",
367 .args_type = "index:i",
368 .mhandler.cmd_new = qmp_marshal_input_cpu,
369 },
370
371 SQMP
372 cpu
373 ---
374
375 Set the default CPU.
376
377 Arguments:
378
379 - "index": the CPU's index (json-int)
380
381 Example:
382
383 -> { "execute": "cpu", "arguments": { "index": 0 } }
384 <- { "return": {} }
385
386 Note: CPUs' indexes are obtained with the 'query-cpus' command.
387
388 EQMP
389
390 {
391 .name = "memsave",
392 .args_type = "val:l,size:i,filename:s,cpu:i?",
393 .mhandler.cmd_new = qmp_marshal_input_memsave,
394 },
395
396 SQMP
397 memsave
398 -------
399
400 Save to disk virtual memory dump starting at 'val' of size 'size'.
401
402 Arguments:
403
404 - "val": the starting address (json-int)
405 - "size": the memory size, in bytes (json-int)
406 - "filename": file path (json-string)
407 - "cpu": virtual CPU index (json-int, optional)
408
409 Example:
410
411 -> { "execute": "memsave",
412 "arguments": { "val": 10,
413 "size": 100,
414 "filename": "/tmp/virtual-mem-dump" } }
415 <- { "return": {} }
416
417 EQMP
418
419 {
420 .name = "pmemsave",
421 .args_type = "val:l,size:i,filename:s",
422 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
423 },
424
425 SQMP
426 pmemsave
427 --------
428
429 Save to disk physical memory dump starting at 'val' of size 'size'.
430
431 Arguments:
432
433 - "val": the starting address (json-int)
434 - "size": the memory size, in bytes (json-int)
435 - "filename": file path (json-string)
436
437 Example:
438
439 -> { "execute": "pmemsave",
440 "arguments": { "val": 10,
441 "size": 100,
442 "filename": "/tmp/physical-mem-dump" } }
443 <- { "return": {} }
444
445 EQMP
446
447 {
448 .name = "inject-nmi",
449 .args_type = "",
450 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
451 },
452
453 SQMP
454 inject-nmi
455 ----------
456
457 Inject an NMI on guest's CPUs.
458
459 Arguments: None.
460
461 Example:
462
463 -> { "execute": "inject-nmi" }
464 <- { "return": {} }
465
466 Note: inject-nmi fails when the guest doesn't support injecting.
467 Currently, only x86 guests do.
468
469 EQMP
470
471 {
472 .name = "xen-save-devices-state",
473 .args_type = "filename:F",
474 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
475 },
476
477 SQMP
478 xen-save-devices-state
479 -------
480
481 Save the state of all devices to file. The RAM and the block devices
482 of the VM are not saved by this command.
483
484 Arguments:
485
486 - "filename": the file to save the state of the devices to as binary
487 data. See xen-save-devices-state.txt for a description of the binary
488 format.
489
490 Example:
491
492 -> { "execute": "xen-save-devices-state",
493 "arguments": { "filename": "/tmp/save" } }
494 <- { "return": {} }
495
496 EQMP
497
498 {
499 .name = "migrate",
500 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
501 .mhandler.cmd_new = qmp_marshal_input_migrate,
502 },
503
504 SQMP
505 migrate
506 -------
507
508 Migrate to URI.
509
510 Arguments:
511
512 - "blk": block migration, full disk copy (json-bool, optional)
513 - "inc": incremental disk copy (json-bool, optional)
514 - "uri": Destination URI (json-string)
515
516 Example:
517
518 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
519 <- { "return": {} }
520
521 Notes:
522
523 (1) The 'query-migrate' command should be used to check migration's progress
524 and final result (this information is provided by the 'status' member)
525 (2) All boolean arguments default to false
526 (3) The user Monitor's "detach" argument is invalid in QMP and should not
527 be used
528
529 EQMP
530
531 {
532 .name = "migrate_cancel",
533 .args_type = "",
534 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
535 },
536
537 SQMP
538 migrate_cancel
539 --------------
540
541 Cancel the current migration.
542
543 Arguments: None.
544
545 Example:
546
547 -> { "execute": "migrate_cancel" }
548 <- { "return": {} }
549
550 EQMP
551 {
552 .name = "migrate-set-cache-size",
553 .args_type = "value:o",
554 .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
555 },
556
557 SQMP
558 migrate-set-cache-size
559 ---------------------
560
561 Set cache size to be used by XBZRLE migration, the cache size will be rounded
562 down to the nearest power of 2
563
564 Arguments:
565
566 - "value": cache size in bytes (json-int)
567
568 Example:
569
570 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
571 <- { "return": {} }
572
573 EQMP
574 {
575 .name = "query-migrate-cache-size",
576 .args_type = "",
577 .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
578 },
579
580 SQMP
581 query-migrate-cache-size
582 ---------------------
583
584 Show cache size to be used by XBZRLE migration
585
586 returns a json-object with the following information:
587 - "size" : json-int
588
589 Example:
590
591 -> { "execute": "query-migrate-cache-size" }
592 <- { "return": 67108864 }
593
594 EQMP
595
596 {
597 .name = "migrate_set_speed",
598 .args_type = "value:o",
599 .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
600 },
601
602 SQMP
603 migrate_set_speed
604 -----------------
605
606 Set maximum speed for migrations.
607
608 Arguments:
609
610 - "value": maximum speed, in bytes per second (json-int)
611
612 Example:
613
614 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
615 <- { "return": {} }
616
617 EQMP
618
619 {
620 .name = "migrate_set_downtime",
621 .args_type = "value:T",
622 .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
623 },
624
625 SQMP
626 migrate_set_downtime
627 --------------------
628
629 Set maximum tolerated downtime (in seconds) for migrations.
630
631 Arguments:
632
633 - "value": maximum downtime (json-number)
634
635 Example:
636
637 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
638 <- { "return": {} }
639
640 EQMP
641
642 {
643 .name = "client_migrate_info",
644 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
645 .params = "protocol hostname port tls-port cert-subject",
646 .help = "send migration info to spice/vnc client",
647 .user_print = monitor_user_noop,
648 .mhandler.cmd_async = client_migrate_info,
649 .flags = MONITOR_CMD_ASYNC,
650 },
651
652 SQMP
653 client_migrate_info
654 ------------------
655
656 Set the spice/vnc connection info for the migration target. The spice/vnc
657 server will ask the spice/vnc client to automatically reconnect using the
658 new parameters (if specified) once the vm migration finished successfully.
659
660 Arguments:
661
662 - "protocol": protocol: "spice" or "vnc" (json-string)
663 - "hostname": migration target hostname (json-string)
664 - "port": spice/vnc tcp port for plaintext channels (json-int, optional)
665 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
666 - "cert-subject": server certificate subject (json-string, optional)
667
668 Example:
669
670 -> { "execute": "client_migrate_info",
671 "arguments": { "protocol": "spice",
672 "hostname": "virt42.lab.kraxel.org",
673 "port": 1234 } }
674 <- { "return": {} }
675
676 EQMP
677
678 {
679 .name = "dump-guest-memory",
680 .args_type = "paging:b,protocol:s,begin:i?,end:i?",
681 .params = "-p protocol [begin] [length]",
682 .help = "dump guest memory to file",
683 .user_print = monitor_user_noop,
684 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
685 },
686
687 SQMP
688 dump
689
690
691 Dump guest memory to file. The file can be processed with crash or gdb.
692
693 Arguments:
694
695 - "paging": do paging to get guest's memory mapping (json-bool)
696 - "protocol": destination file(started with "file:") or destination file
697 descriptor (started with "fd:") (json-string)
698 - "begin": the starting physical address. It's optional, and should be specified
699 with length together (json-int)
700 - "length": the memory size, in bytes. It's optional, and should be specified
701 with begin together (json-int)
702
703 Example:
704
705 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
706 <- { "return": {} }
707
708 Notes:
709
710 (1) All boolean arguments default to false
711
712 EQMP
713
714 {
715 .name = "netdev_add",
716 .args_type = "netdev:O",
717 .mhandler.cmd_new = qmp_netdev_add,
718 },
719
720 SQMP
721 netdev_add
722 ----------
723
724 Add host network device.
725
726 Arguments:
727
728 - "type": the device type, "tap", "user", ... (json-string)
729 - "id": the device's ID, must be unique (json-string)
730 - device options
731
732 Example:
733
734 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
735 <- { "return": {} }
736
737 Note: The supported device options are the same ones supported by the '-net'
738 command-line argument, which are listed in the '-help' output or QEMU's
739 manual
740
741 EQMP
742
743 {
744 .name = "netdev_del",
745 .args_type = "id:s",
746 .mhandler.cmd_new = qmp_marshal_input_netdev_del,
747 },
748
749 SQMP
750 netdev_del
751 ----------
752
753 Remove host network device.
754
755 Arguments:
756
757 - "id": the device's ID, must be unique (json-string)
758
759 Example:
760
761 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
762 <- { "return": {} }
763
764
765 EQMP
766
767 {
768 .name = "block_resize",
769 .args_type = "device:B,size:o",
770 .mhandler.cmd_new = qmp_marshal_input_block_resize,
771 },
772
773 SQMP
774 block_resize
775 ------------
776
777 Resize a block image while a guest is running.
778
779 Arguments:
780
781 - "device": the device's ID, must be unique (json-string)
782 - "size": new size
783
784 Example:
785
786 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
787 <- { "return": {} }
788
789 EQMP
790
791 {
792 .name = "block-stream",
793 .args_type = "device:B,base:s?,speed:o?",
794 .mhandler.cmd_new = qmp_marshal_input_block_stream,
795 },
796
797 {
798 .name = "block-job-set-speed",
799 .args_type = "device:B,speed:o",
800 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
801 },
802
803 {
804 .name = "block-job-cancel",
805 .args_type = "device:B",
806 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
807 },
808 {
809 .name = "transaction",
810 .args_type = "actions:q",
811 .mhandler.cmd_new = qmp_marshal_input_transaction,
812 },
813
814 SQMP
815 transaction
816 -----------
817
818 Atomically operate on one or more block devices. The only supported
819 operation for now is snapshotting. If there is any failure performing
820 any of the operations, all snapshots for the group are abandoned, and
821 the original disks pre-snapshot attempt are used.
822
823 A list of dictionaries is accepted, that contains the actions to be performed.
824 For snapshots this is the device, the file to use for the new snapshot,
825 and the format. The default format, if not specified, is qcow2.
826
827 Each new snapshot defaults to being created by QEMU (wiping any
828 contents if the file already exists), but it is also possible to reuse
829 an externally-created file. In the latter case, you should ensure that
830 the new image file has the same contents as the current one; QEMU cannot
831 perform any meaningful check. Typically this is achieved by using the
832 current image file as the backing file for the new image.
833
834 Arguments:
835
836 actions array:
837 - "type": the operation to perform. The only supported
838 value is "blockdev-snapshot-sync". (json-string)
839 - "data": a dictionary. The contents depend on the value
840 of "type". When "type" is "blockdev-snapshot-sync":
841 - "device": device name to snapshot (json-string)
842 - "snapshot-file": name of new image file (json-string)
843 - "format": format of new image (json-string, optional)
844 - "mode": whether and how QEMU should create the snapshot file
845 (NewImageMode, optional, default "absolute-paths")
846
847 Example:
848
849 -> { "execute": "transaction",
850 "arguments": { "actions": [
851 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd0",
852 "snapshot-file": "/some/place/my-image",
853 "format": "qcow2" } },
854 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd1",
855 "snapshot-file": "/some/place/my-image2",
856 "mode": "existing",
857 "format": "qcow2" } } ] } }
858 <- { "return": {} }
859
860 EQMP
861
862 {
863 .name = "blockdev-snapshot-sync",
864 .args_type = "device:B,snapshot-file:s,format:s?,mode:s?",
865 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
866 },
867
868 SQMP
869 blockdev-snapshot-sync
870 ----------------------
871
872 Synchronous snapshot of a block device. snapshot-file specifies the
873 target of the new image. If the file exists, or if it is a device, the
874 snapshot will be created in the existing file/device. If does not
875 exist, a new file will be created. format specifies the format of the
876 snapshot image, default is qcow2.
877
878 Arguments:
879
880 - "device": device name to snapshot (json-string)
881 - "snapshot-file": name of new image file (json-string)
882 - "mode": whether and how QEMU should create the snapshot file
883 (NewImageMode, optional, default "absolute-paths")
884 - "format": format of new image (json-string, optional)
885
886 Example:
887
888 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
889 "snapshot-file":
890 "/some/place/my-image",
891 "format": "qcow2" } }
892 <- { "return": {} }
893
894 EQMP
895
896 {
897 .name = "balloon",
898 .args_type = "value:M",
899 .mhandler.cmd_new = qmp_marshal_input_balloon,
900 },
901
902 SQMP
903 balloon
904 -------
905
906 Request VM to change its memory allocation (in bytes).
907
908 Arguments:
909
910 - "value": New memory allocation (json-int)
911
912 Example:
913
914 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
915 <- { "return": {} }
916
917 EQMP
918
919 {
920 .name = "set_link",
921 .args_type = "name:s,up:b",
922 .mhandler.cmd_new = qmp_marshal_input_set_link,
923 },
924
925 SQMP
926 set_link
927 --------
928
929 Change the link status of a network adapter.
930
931 Arguments:
932
933 - "name": network device name (json-string)
934 - "up": status is up (json-bool)
935
936 Example:
937
938 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
939 <- { "return": {} }
940
941 EQMP
942
943 {
944 .name = "getfd",
945 .args_type = "fdname:s",
946 .params = "getfd name",
947 .help = "receive a file descriptor via SCM rights and assign it a name",
948 .mhandler.cmd_new = qmp_marshal_input_getfd,
949 },
950
951 SQMP
952 getfd
953 -----
954
955 Receive a file descriptor via SCM rights and assign it a name.
956
957 Arguments:
958
959 - "fdname": file descriptor name (json-string)
960
961 Example:
962
963 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
964 <- { "return": {} }
965
966 Notes:
967
968 (1) If the name specified by the "fdname" argument already exists,
969 the file descriptor assigned to it will be closed and replaced
970 by the received file descriptor.
971 (2) The 'closefd' command can be used to explicitly close the file
972 descriptor when it is no longer needed.
973
974 EQMP
975
976 {
977 .name = "closefd",
978 .args_type = "fdname:s",
979 .params = "closefd name",
980 .help = "close a file descriptor previously passed via SCM rights",
981 .mhandler.cmd_new = qmp_marshal_input_closefd,
982 },
983
984 SQMP
985 closefd
986 -------
987
988 Close a file descriptor previously passed via SCM rights.
989
990 Arguments:
991
992 - "fdname": file descriptor name (json-string)
993
994 Example:
995
996 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
997 <- { "return": {} }
998
999 EQMP
1000
1001 {
1002 .name = "add-fd",
1003 .args_type = "fdset-id:i?,opaque:s?",
1004 .params = "add-fd fdset-id opaque",
1005 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1006 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1007 },
1008
1009 SQMP
1010 add-fd
1011 -------
1012
1013 Add a file descriptor, that was passed via SCM rights, to an fd set.
1014
1015 Arguments:
1016
1017 - "fdset-id": The ID of the fd set to add the file descriptor to.
1018 (json-int, optional)
1019 - "opaque": A free-form string that can be used to describe the fd.
1020 (json-string, optional)
1021
1022 Return a json-object with the following information:
1023
1024 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1025 - "fd": The file descriptor that was received via SCM rights and added to the
1026 fd set. (json-int)
1027
1028 Example:
1029
1030 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1031 <- { "return": { "fdset-id": 1, "fd": 3 } }
1032
1033 Notes:
1034
1035 (1) The list of fd sets is shared by all monitor connections.
1036 (2) If "fdset-id" is not specified, a new fd set will be created.
1037
1038 EQMP
1039
1040 {
1041 .name = "remove-fd",
1042 .args_type = "fdset-id:i,fd:i?",
1043 .params = "remove-fd fdset-id fd",
1044 .help = "Remove a file descriptor from an fd set",
1045 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1046 },
1047
1048 SQMP
1049 remove-fd
1050 ---------
1051
1052 Remove a file descriptor from an fd set.
1053
1054 Arguments:
1055
1056 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1057 (json-int)
1058 - "fd": The file descriptor that is to be removed. (json-int, optional)
1059
1060 Example:
1061
1062 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1063 <- { "return": {} }
1064
1065 Notes:
1066
1067 (1) The list of fd sets is shared by all monitor connections.
1068 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1069 removed.
1070
1071 EQMP
1072
1073 {
1074 .name = "query-fdsets",
1075 .args_type = "",
1076 .help = "Return information describing all fd sets",
1077 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1078 },
1079
1080 SQMP
1081 query-fdsets
1082 -------------
1083
1084 Return information describing all fd sets.
1085
1086 Arguments: None
1087
1088 Example:
1089
1090 -> { "execute": "query-fdsets" }
1091 <- { "return": [
1092 {
1093 "fds": [
1094 {
1095 "fd": 30,
1096 "opaque": "rdonly:/path/to/file"
1097 },
1098 {
1099 "fd": 24,
1100 "opaque": "rdwr:/path/to/file"
1101 }
1102 ],
1103 "fdset-id": 1
1104 },
1105 {
1106 "fds": [
1107 {
1108 "fd": 28
1109 },
1110 {
1111 "fd": 29
1112 }
1113 ],
1114 "fdset-id": 0
1115 }
1116 ]
1117 }
1118
1119 Note: The list of fd sets is shared by all monitor connections.
1120
1121 EQMP
1122
1123 {
1124 .name = "block_passwd",
1125 .args_type = "device:B,password:s",
1126 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
1127 },
1128
1129 SQMP
1130 block_passwd
1131 ------------
1132
1133 Set the password of encrypted block devices.
1134
1135 Arguments:
1136
1137 - "device": device name (json-string)
1138 - "password": password (json-string)
1139
1140 Example:
1141
1142 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1143 "password": "12345" } }
1144 <- { "return": {} }
1145
1146 EQMP
1147
1148 {
1149 .name = "block_set_io_throttle",
1150 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
1151 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
1152 },
1153
1154 SQMP
1155 block_set_io_throttle
1156 ------------
1157
1158 Change I/O throttle limits for a block drive.
1159
1160 Arguments:
1161
1162 - "device": device name (json-string)
1163 - "bps": total throughput limit in bytes per second(json-int)
1164 - "bps_rd": read throughput limit in bytes per second(json-int)
1165 - "bps_wr": read throughput limit in bytes per second(json-int)
1166 - "iops": total I/O operations per second(json-int)
1167 - "iops_rd": read I/O operations per second(json-int)
1168 - "iops_wr": write I/O operations per second(json-int)
1169
1170 Example:
1171
1172 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1173 "bps": "1000000",
1174 "bps_rd": "0",
1175 "bps_wr": "0",
1176 "iops": "0",
1177 "iops_rd": "0",
1178 "iops_wr": "0" } }
1179 <- { "return": {} }
1180
1181 EQMP
1182
1183 {
1184 .name = "set_password",
1185 .args_type = "protocol:s,password:s,connected:s?",
1186 .mhandler.cmd_new = qmp_marshal_input_set_password,
1187 },
1188
1189 SQMP
1190 set_password
1191 ------------
1192
1193 Set the password for vnc/spice protocols.
1194
1195 Arguments:
1196
1197 - "protocol": protocol name (json-string)
1198 - "password": password (json-string)
1199 - "connected": [ keep | disconnect | fail ] (josn-string, optional)
1200
1201 Example:
1202
1203 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1204 "password": "secret" } }
1205 <- { "return": {} }
1206
1207 EQMP
1208
1209 {
1210 .name = "expire_password",
1211 .args_type = "protocol:s,time:s",
1212 .mhandler.cmd_new = qmp_marshal_input_expire_password,
1213 },
1214
1215 SQMP
1216 expire_password
1217 ---------------
1218
1219 Set the password expire time for vnc/spice protocols.
1220
1221 Arguments:
1222
1223 - "protocol": protocol name (json-string)
1224 - "time": [ now | never | +secs | secs ] (json-string)
1225
1226 Example:
1227
1228 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1229 "time": "+60" } }
1230 <- { "return": {} }
1231
1232 EQMP
1233
1234 {
1235 .name = "add_client",
1236 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
1237 .params = "protocol fdname skipauth tls",
1238 .help = "add a graphics client",
1239 .user_print = monitor_user_noop,
1240 .mhandler.cmd_new = add_graphics_client,
1241 },
1242
1243 SQMP
1244 add_client
1245 ----------
1246
1247 Add a graphics client
1248
1249 Arguments:
1250
1251 - "protocol": protocol name (json-string)
1252 - "fdname": file descriptor name (json-string)
1253 - "skipauth": whether to skip authentication (json-bool, optional)
1254 - "tls": whether to perform TLS (json-bool, optional)
1255
1256 Example:
1257
1258 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1259 "fdname": "myclient" } }
1260 <- { "return": {} }
1261
1262 EQMP
1263 {
1264 .name = "qmp_capabilities",
1265 .args_type = "",
1266 .params = "",
1267 .help = "enable QMP capabilities",
1268 .user_print = monitor_user_noop,
1269 .mhandler.cmd_new = do_qmp_capabilities,
1270 },
1271
1272 SQMP
1273 qmp_capabilities
1274 ----------------
1275
1276 Enable QMP capabilities.
1277
1278 Arguments: None.
1279
1280 Example:
1281
1282 -> { "execute": "qmp_capabilities" }
1283 <- { "return": {} }
1284
1285 Note: This command must be issued before issuing any other command.
1286
1287 EQMP
1288
1289 {
1290 .name = "human-monitor-command",
1291 .args_type = "command-line:s,cpu-index:i?",
1292 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
1293 },
1294
1295 SQMP
1296 human-monitor-command
1297 ---------------------
1298
1299 Execute a Human Monitor command.
1300
1301 Arguments:
1302
1303 - command-line: the command name and its arguments, just like the
1304 Human Monitor's shell (json-string)
1305 - cpu-index: select the CPU number to be used by commands which access CPU
1306 data, like 'info registers'. The Monitor selects CPU 0 if this
1307 argument is not provided (json-int, optional)
1308
1309 Example:
1310
1311 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1312 <- { "return": "kvm support: enabled\r\n" }
1313
1314 Notes:
1315
1316 (1) The Human Monitor is NOT an stable interface, this means that command
1317 names, arguments and responses can change or be removed at ANY time.
1318 Applications that rely on long term stability guarantees should NOT
1319 use this command
1320
1321 (2) Limitations:
1322
1323 o This command is stateless, this means that commands that depend
1324 on state information (such as getfd) might not work
1325
1326 o Commands that prompt the user for data (eg. 'cont' when the block
1327 device is encrypted) don't currently work
1328
1329 3. Query Commands
1330 =================
1331
1332 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1333 HXCOMM this! We will possibly move query commands definitions inside those
1334 HXCOMM sections, just like regular commands.
1335
1336 EQMP
1337
1338 SQMP
1339 query-version
1340 -------------
1341
1342 Show QEMU version.
1343
1344 Return a json-object with the following information:
1345
1346 - "qemu": A json-object containing three integer values:
1347 - "major": QEMU's major version (json-int)
1348 - "minor": QEMU's minor version (json-int)
1349 - "micro": QEMU's micro version (json-int)
1350 - "package": package's version (json-string)
1351
1352 Example:
1353
1354 -> { "execute": "query-version" }
1355 <- {
1356 "return":{
1357 "qemu":{
1358 "major":0,
1359 "minor":11,
1360 "micro":5
1361 },
1362 "package":""
1363 }
1364 }
1365
1366 EQMP
1367
1368 {
1369 .name = "query-version",
1370 .args_type = "",
1371 .mhandler.cmd_new = qmp_marshal_input_query_version,
1372 },
1373
1374 SQMP
1375 query-commands
1376 --------------
1377
1378 List QMP available commands.
1379
1380 Each command is represented by a json-object, the returned value is a json-array
1381 of all commands.
1382
1383 Each json-object contain:
1384
1385 - "name": command's name (json-string)
1386
1387 Example:
1388
1389 -> { "execute": "query-commands" }
1390 <- {
1391 "return":[
1392 {
1393 "name":"query-balloon"
1394 },
1395 {
1396 "name":"system_powerdown"
1397 }
1398 ]
1399 }
1400
1401 Note: This example has been shortened as the real response is too long.
1402
1403 EQMP
1404
1405 {
1406 .name = "query-commands",
1407 .args_type = "",
1408 .mhandler.cmd_new = qmp_marshal_input_query_commands,
1409 },
1410
1411 SQMP
1412 query-events
1413 --------------
1414
1415 List QMP available events.
1416
1417 Each event is represented by a json-object, the returned value is a json-array
1418 of all events.
1419
1420 Each json-object contains:
1421
1422 - "name": event's name (json-string)
1423
1424 Example:
1425
1426 -> { "execute": "query-events" }
1427 <- {
1428 "return":[
1429 {
1430 "name":"SHUTDOWN"
1431 },
1432 {
1433 "name":"RESET"
1434 }
1435 ]
1436 }
1437
1438 Note: This example has been shortened as the real response is too long.
1439
1440 EQMP
1441
1442 {
1443 .name = "query-events",
1444 .args_type = "",
1445 .mhandler.cmd_new = qmp_marshal_input_query_events,
1446 },
1447
1448 SQMP
1449 query-chardev
1450 -------------
1451
1452 Each device is represented by a json-object. The returned value is a json-array
1453 of all devices.
1454
1455 Each json-object contain the following:
1456
1457 - "label": device's label (json-string)
1458 - "filename": device's file (json-string)
1459
1460 Example:
1461
1462 -> { "execute": "query-chardev" }
1463 <- {
1464 "return":[
1465 {
1466 "label":"monitor",
1467 "filename":"stdio"
1468 },
1469 {
1470 "label":"serial0",
1471 "filename":"vc"
1472 }
1473 ]
1474 }
1475
1476 EQMP
1477
1478 {
1479 .name = "query-chardev",
1480 .args_type = "",
1481 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
1482 },
1483
1484 SQMP
1485 query-block
1486 -----------
1487
1488 Show the block devices.
1489
1490 Each block device information is stored in a json-object and the returned value
1491 is a json-array of all devices.
1492
1493 Each json-object contain the following:
1494
1495 - "device": device name (json-string)
1496 - "type": device type (json-string)
1497 - deprecated, retained for backward compatibility
1498 - Possible values: "unknown"
1499 - "removable": true if the device is removable, false otherwise (json-bool)
1500 - "locked": true if the device is locked, false otherwise (json-bool)
1501 - "tray-open": only present if removable, true if the device has a tray,
1502 and it is open (json-bool)
1503 - "inserted": only present if the device is inserted, it is a json-object
1504 containing the following:
1505 - "file": device file name (json-string)
1506 - "ro": true if read-only, false otherwise (json-bool)
1507 - "drv": driver format name (json-string)
1508 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1509 "file", "file", "ftp", "ftps", "host_cdrom",
1510 "host_device", "host_floppy", "http", "https",
1511 "nbd", "parallels", "qcow", "qcow2", "raw",
1512 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1513 - "backing_file": backing file name (json-string, optional)
1514 - "backing_file_depth": number of files in the backing file chain (json-int)
1515 - "encrypted": true if encrypted, false otherwise (json-bool)
1516 - "bps": limit total bytes per second (json-int)
1517 - "bps_rd": limit read bytes per second (json-int)
1518 - "bps_wr": limit write bytes per second (json-int)
1519 - "iops": limit total I/O operations per second (json-int)
1520 - "iops_rd": limit read operations per second (json-int)
1521 - "iops_wr": limit write operations per second (json-int)
1522
1523 - "io-status": I/O operation status, only present if the device supports it
1524 and the VM is configured to stop on errors. It's always reset
1525 to "ok" when the "cont" command is issued (json_string, optional)
1526 - Possible values: "ok", "failed", "nospace"
1527
1528 Example:
1529
1530 -> { "execute": "query-block" }
1531 <- {
1532 "return":[
1533 {
1534 "io-status": "ok",
1535 "device":"ide0-hd0",
1536 "locked":false,
1537 "removable":false,
1538 "inserted":{
1539 "ro":false,
1540 "drv":"qcow2",
1541 "encrypted":false,
1542 "file":"disks/test.img",
1543 "backing_file_depth":0,
1544 "bps":1000000,
1545 "bps_rd":0,
1546 "bps_wr":0,
1547 "iops":1000000,
1548 "iops_rd":0,
1549 "iops_wr":0,
1550 },
1551 "type":"unknown"
1552 },
1553 {
1554 "io-status": "ok",
1555 "device":"ide1-cd0",
1556 "locked":false,
1557 "removable":true,
1558 "type":"unknown"
1559 },
1560 {
1561 "device":"floppy0",
1562 "locked":false,
1563 "removable":true,
1564 "type":"unknown"
1565 },
1566 {
1567 "device":"sd0",
1568 "locked":false,
1569 "removable":true,
1570 "type":"unknown"
1571 }
1572 ]
1573 }
1574
1575 EQMP
1576
1577 {
1578 .name = "query-block",
1579 .args_type = "",
1580 .mhandler.cmd_new = qmp_marshal_input_query_block,
1581 },
1582
1583 SQMP
1584 query-blockstats
1585 ----------------
1586
1587 Show block device statistics.
1588
1589 Each device statistic information is stored in a json-object and the returned
1590 value is a json-array of all devices.
1591
1592 Each json-object contain the following:
1593
1594 - "device": device name (json-string)
1595 - "stats": A json-object with the statistics information, it contains:
1596 - "rd_bytes": bytes read (json-int)
1597 - "wr_bytes": bytes written (json-int)
1598 - "rd_operations": read operations (json-int)
1599 - "wr_operations": write operations (json-int)
1600 - "flush_operations": cache flush operations (json-int)
1601 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1602 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1603 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
1604 - "wr_highest_offset": Highest offset of a sector written since the
1605 BlockDriverState has been opened (json-int)
1606 - "parent": Contains recursively the statistics of the underlying
1607 protocol (e.g. the host file for a qcow2 image). If there is
1608 no underlying protocol, this field is omitted
1609 (json-object, optional)
1610
1611 Example:
1612
1613 -> { "execute": "query-blockstats" }
1614 <- {
1615 "return":[
1616 {
1617 "device":"ide0-hd0",
1618 "parent":{
1619 "stats":{
1620 "wr_highest_offset":3686448128,
1621 "wr_bytes":9786368,
1622 "wr_operations":751,
1623 "rd_bytes":122567168,
1624 "rd_operations":36772
1625 "wr_total_times_ns":313253456
1626 "rd_total_times_ns":3465673657
1627 "flush_total_times_ns":49653
1628 "flush_operations":61,
1629 }
1630 },
1631 "stats":{
1632 "wr_highest_offset":2821110784,
1633 "wr_bytes":9786368,
1634 "wr_operations":692,
1635 "rd_bytes":122739200,
1636 "rd_operations":36604
1637 "flush_operations":51,
1638 "wr_total_times_ns":313253456
1639 "rd_total_times_ns":3465673657
1640 "flush_total_times_ns":49653
1641 }
1642 },
1643 {
1644 "device":"ide1-cd0",
1645 "stats":{
1646 "wr_highest_offset":0,
1647 "wr_bytes":0,
1648 "wr_operations":0,
1649 "rd_bytes":0,
1650 "rd_operations":0
1651 "flush_operations":0,
1652 "wr_total_times_ns":0
1653 "rd_total_times_ns":0
1654 "flush_total_times_ns":0
1655 }
1656 },
1657 {
1658 "device":"floppy0",
1659 "stats":{
1660 "wr_highest_offset":0,
1661 "wr_bytes":0,
1662 "wr_operations":0,
1663 "rd_bytes":0,
1664 "rd_operations":0
1665 "flush_operations":0,
1666 "wr_total_times_ns":0
1667 "rd_total_times_ns":0
1668 "flush_total_times_ns":0
1669 }
1670 },
1671 {
1672 "device":"sd0",
1673 "stats":{
1674 "wr_highest_offset":0,
1675 "wr_bytes":0,
1676 "wr_operations":0,
1677 "rd_bytes":0,
1678 "rd_operations":0
1679 "flush_operations":0,
1680 "wr_total_times_ns":0
1681 "rd_total_times_ns":0
1682 "flush_total_times_ns":0
1683 }
1684 }
1685 ]
1686 }
1687
1688 EQMP
1689
1690 {
1691 .name = "query-blockstats",
1692 .args_type = "",
1693 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
1694 },
1695
1696 SQMP
1697 query-cpus
1698 ----------
1699
1700 Show CPU information.
1701
1702 Return a json-array. Each CPU is represented by a json-object, which contains:
1703
1704 - "CPU": CPU index (json-int)
1705 - "current": true if this is the current CPU, false otherwise (json-bool)
1706 - "halted": true if the cpu is halted, false otherwise (json-bool)
1707 - Current program counter. The key's name depends on the architecture:
1708 "pc": i386/x86_64 (json-int)
1709 "nip": PPC (json-int)
1710 "pc" and "npc": sparc (json-int)
1711 "PC": mips (json-int)
1712 - "thread_id": ID of the underlying host thread (json-int)
1713
1714 Example:
1715
1716 -> { "execute": "query-cpus" }
1717 <- {
1718 "return":[
1719 {
1720 "CPU":0,
1721 "current":true,
1722 "halted":false,
1723 "pc":3227107138
1724 "thread_id":3134
1725 },
1726 {
1727 "CPU":1,
1728 "current":false,
1729 "halted":true,
1730 "pc":7108165
1731 "thread_id":3135
1732 }
1733 ]
1734 }
1735
1736 EQMP
1737
1738 {
1739 .name = "query-cpus",
1740 .args_type = "",
1741 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
1742 },
1743
1744 SQMP
1745 query-pci
1746 ---------
1747
1748 PCI buses and devices information.
1749
1750 The returned value is a json-array of all buses. Each bus is represented by
1751 a json-object, which has a key with a json-array of all PCI devices attached
1752 to it. Each device is represented by a json-object.
1753
1754 The bus json-object contains the following:
1755
1756 - "bus": bus number (json-int)
1757 - "devices": a json-array of json-objects, each json-object represents a
1758 PCI device
1759
1760 The PCI device json-object contains the following:
1761
1762 - "bus": identical to the parent's bus number (json-int)
1763 - "slot": slot number (json-int)
1764 - "function": function number (json-int)
1765 - "class_info": a json-object containing:
1766 - "desc": device class description (json-string, optional)
1767 - "class": device class number (json-int)
1768 - "id": a json-object containing:
1769 - "device": device ID (json-int)
1770 - "vendor": vendor ID (json-int)
1771 - "irq": device's IRQ if assigned (json-int, optional)
1772 - "qdev_id": qdev id string (json-string)
1773 - "pci_bridge": It's a json-object, only present if this device is a
1774 PCI bridge, contains:
1775 - "bus": bus number (json-int)
1776 - "secondary": secondary bus number (json-int)
1777 - "subordinate": subordinate bus number (json-int)
1778 - "io_range": I/O memory range information, a json-object with the
1779 following members:
1780 - "base": base address, in bytes (json-int)
1781 - "limit": limit address, in bytes (json-int)
1782 - "memory_range": memory range information, a json-object with the
1783 following members:
1784 - "base": base address, in bytes (json-int)
1785 - "limit": limit address, in bytes (json-int)
1786 - "prefetchable_range": Prefetchable memory range information, a
1787 json-object with the following members:
1788 - "base": base address, in bytes (json-int)
1789 - "limit": limit address, in bytes (json-int)
1790 - "devices": a json-array of PCI devices if there's any attached, each
1791 each element is represented by a json-object, which contains
1792 the same members of the 'PCI device json-object' described
1793 above (optional)
1794 - "regions": a json-array of json-objects, each json-object represents a
1795 memory region of this device
1796
1797 The memory range json-object contains the following:
1798
1799 - "base": base memory address (json-int)
1800 - "limit": limit value (json-int)
1801
1802 The region json-object can be an I/O region or a memory region, an I/O region
1803 json-object contains the following:
1804
1805 - "type": "io" (json-string, fixed)
1806 - "bar": BAR number (json-int)
1807 - "address": memory address (json-int)
1808 - "size": memory size (json-int)
1809
1810 A memory region json-object contains the following:
1811
1812 - "type": "memory" (json-string, fixed)
1813 - "bar": BAR number (json-int)
1814 - "address": memory address (json-int)
1815 - "size": memory size (json-int)
1816 - "mem_type_64": true or false (json-bool)
1817 - "prefetch": true or false (json-bool)
1818
1819 Example:
1820
1821 -> { "execute": "query-pci" }
1822 <- {
1823 "return":[
1824 {
1825 "bus":0,
1826 "devices":[
1827 {
1828 "bus":0,
1829 "qdev_id":"",
1830 "slot":0,
1831 "class_info":{
1832 "class":1536,
1833 "desc":"Host bridge"
1834 },
1835 "id":{
1836 "device":32902,
1837 "vendor":4663
1838 },
1839 "function":0,
1840 "regions":[
1841
1842 ]
1843 },
1844 {
1845 "bus":0,
1846 "qdev_id":"",
1847 "slot":1,
1848 "class_info":{
1849 "class":1537,
1850 "desc":"ISA bridge"
1851 },
1852 "id":{
1853 "device":32902,
1854 "vendor":28672
1855 },
1856 "function":0,
1857 "regions":[
1858
1859 ]
1860 },
1861 {
1862 "bus":0,
1863 "qdev_id":"",
1864 "slot":1,
1865 "class_info":{
1866 "class":257,
1867 "desc":"IDE controller"
1868 },
1869 "id":{
1870 "device":32902,
1871 "vendor":28688
1872 },
1873 "function":1,
1874 "regions":[
1875 {
1876 "bar":4,
1877 "size":16,
1878 "address":49152,
1879 "type":"io"
1880 }
1881 ]
1882 },
1883 {
1884 "bus":0,
1885 "qdev_id":"",
1886 "slot":2,
1887 "class_info":{
1888 "class":768,
1889 "desc":"VGA controller"
1890 },
1891 "id":{
1892 "device":4115,
1893 "vendor":184
1894 },
1895 "function":0,
1896 "regions":[
1897 {
1898 "prefetch":true,
1899 "mem_type_64":false,
1900 "bar":0,
1901 "size":33554432,
1902 "address":4026531840,
1903 "type":"memory"
1904 },
1905 {
1906 "prefetch":false,
1907 "mem_type_64":false,
1908 "bar":1,
1909 "size":4096,
1910 "address":4060086272,
1911 "type":"memory"
1912 },
1913 {
1914 "prefetch":false,
1915 "mem_type_64":false,
1916 "bar":6,
1917 "size":65536,
1918 "address":-1,
1919 "type":"memory"
1920 }
1921 ]
1922 },
1923 {
1924 "bus":0,
1925 "qdev_id":"",
1926 "irq":11,
1927 "slot":4,
1928 "class_info":{
1929 "class":1280,
1930 "desc":"RAM controller"
1931 },
1932 "id":{
1933 "device":6900,
1934 "vendor":4098
1935 },
1936 "function":0,
1937 "regions":[
1938 {
1939 "bar":0,
1940 "size":32,
1941 "address":49280,
1942 "type":"io"
1943 }
1944 ]
1945 }
1946 ]
1947 }
1948 ]
1949 }
1950
1951 Note: This example has been shortened as the real response is too long.
1952
1953 EQMP
1954
1955 {
1956 .name = "query-pci",
1957 .args_type = "",
1958 .mhandler.cmd_new = qmp_marshal_input_query_pci,
1959 },
1960
1961 SQMP
1962 query-kvm
1963 ---------
1964
1965 Show KVM information.
1966
1967 Return a json-object with the following information:
1968
1969 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
1970 - "present": true if QEMU has KVM support, false otherwise (json-bool)
1971
1972 Example:
1973
1974 -> { "execute": "query-kvm" }
1975 <- { "return": { "enabled": true, "present": true } }
1976
1977 EQMP
1978
1979 {
1980 .name = "query-kvm",
1981 .args_type = "",
1982 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
1983 },
1984
1985 SQMP
1986 query-status
1987 ------------
1988
1989 Return a json-object with the following information:
1990
1991 - "running": true if the VM is running, or false if it is paused (json-bool)
1992 - "singlestep": true if the VM is in single step mode,
1993 false otherwise (json-bool)
1994 - "status": one of the following values (json-string)
1995 "debug" - QEMU is running on a debugger
1996 "inmigrate" - guest is paused waiting for an incoming migration
1997 "internal-error" - An internal error that prevents further guest
1998 execution has occurred
1999 "io-error" - the last IOP has failed and the device is configured
2000 to pause on I/O errors
2001 "paused" - guest has been paused via the 'stop' command
2002 "postmigrate" - guest is paused following a successful 'migrate'
2003 "prelaunch" - QEMU was started with -S and guest has not started
2004 "finish-migrate" - guest is paused to finish the migration process
2005 "restore-vm" - guest is paused to restore VM state
2006 "running" - guest is actively running
2007 "save-vm" - guest is paused to save the VM state
2008 "shutdown" - guest is shut down (and -no-shutdown is in use)
2009 "watchdog" - the watchdog action is configured to pause and
2010 has been triggered
2011
2012 Example:
2013
2014 -> { "execute": "query-status" }
2015 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2016
2017 EQMP
2018
2019 {
2020 .name = "query-status",
2021 .args_type = "",
2022 .mhandler.cmd_new = qmp_marshal_input_query_status,
2023 },
2024
2025 SQMP
2026 query-mice
2027 ----------
2028
2029 Show VM mice information.
2030
2031 Each mouse is represented by a json-object, the returned value is a json-array
2032 of all mice.
2033
2034 The mouse json-object contains the following:
2035
2036 - "name": mouse's name (json-string)
2037 - "index": mouse's index (json-int)
2038 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2039 - "absolute": true if the mouse generates absolute input events (json-bool)
2040
2041 Example:
2042
2043 -> { "execute": "query-mice" }
2044 <- {
2045 "return":[
2046 {
2047 "name":"QEMU Microsoft Mouse",
2048 "index":0,
2049 "current":false,
2050 "absolute":false
2051 },
2052 {
2053 "name":"QEMU PS/2 Mouse",
2054 "index":1,
2055 "current":true,
2056 "absolute":true
2057 }
2058 ]
2059 }
2060
2061 EQMP
2062
2063 {
2064 .name = "query-mice",
2065 .args_type = "",
2066 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2067 },
2068
2069 SQMP
2070 query-vnc
2071 ---------
2072
2073 Show VNC server information.
2074
2075 Return a json-object with server information. Connected clients are returned
2076 as a json-array of json-objects.
2077
2078 The main json-object contains the following:
2079
2080 - "enabled": true or false (json-bool)
2081 - "host": server's IP address (json-string)
2082 - "family": address family (json-string)
2083 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2084 - "service": server's port number (json-string)
2085 - "auth": authentication method (json-string)
2086 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2087 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2088 "vencrypt+plain", "vencrypt+tls+none",
2089 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2090 "vencrypt+tls+vnc", "vencrypt+x509+none",
2091 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2092 "vencrypt+x509+vnc", "vnc"
2093 - "clients": a json-array of all connected clients
2094
2095 Clients are described by a json-object, each one contain the following:
2096
2097 - "host": client's IP address (json-string)
2098 - "family": address family (json-string)
2099 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2100 - "service": client's port number (json-string)
2101 - "x509_dname": TLS dname (json-string, optional)
2102 - "sasl_username": SASL username (json-string, optional)
2103
2104 Example:
2105
2106 -> { "execute": "query-vnc" }
2107 <- {
2108 "return":{
2109 "enabled":true,
2110 "host":"0.0.0.0",
2111 "service":"50402",
2112 "auth":"vnc",
2113 "family":"ipv4",
2114 "clients":[
2115 {
2116 "host":"127.0.0.1",
2117 "service":"50401",
2118 "family":"ipv4"
2119 }
2120 ]
2121 }
2122 }
2123
2124 EQMP
2125
2126 {
2127 .name = "query-vnc",
2128 .args_type = "",
2129 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
2130 },
2131
2132 SQMP
2133 query-spice
2134 -----------
2135
2136 Show SPICE server information.
2137
2138 Return a json-object with server information. Connected clients are returned
2139 as a json-array of json-objects.
2140
2141 The main json-object contains the following:
2142
2143 - "enabled": true or false (json-bool)
2144 - "host": server's IP address (json-string)
2145 - "port": server's port number (json-int, optional)
2146 - "tls-port": server's port number (json-int, optional)
2147 - "auth": authentication method (json-string)
2148 - Possible values: "none", "spice"
2149 - "channels": a json-array of all active channels clients
2150
2151 Channels are described by a json-object, each one contain the following:
2152
2153 - "host": client's IP address (json-string)
2154 - "family": address family (json-string)
2155 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2156 - "port": client's port number (json-string)
2157 - "connection-id": spice connection id. All channels with the same id
2158 belong to the same spice session (json-int)
2159 - "channel-type": channel type. "1" is the main control channel, filter for
2160 this one if you want track spice sessions only (json-int)
2161 - "channel-id": channel id. Usually "0", might be different needed when
2162 multiple channels of the same type exist, such as multiple
2163 display channels in a multihead setup (json-int)
2164 - "tls": whevener the channel is encrypted (json-bool)
2165
2166 Example:
2167
2168 -> { "execute": "query-spice" }
2169 <- {
2170 "return": {
2171 "enabled": true,
2172 "auth": "spice",
2173 "port": 5920,
2174 "tls-port": 5921,
2175 "host": "0.0.0.0",
2176 "channels": [
2177 {
2178 "port": "54924",
2179 "family": "ipv4",
2180 "channel-type": 1,
2181 "connection-id": 1804289383,
2182 "host": "127.0.0.1",
2183 "channel-id": 0,
2184 "tls": true
2185 },
2186 {
2187 "port": "36710",
2188 "family": "ipv4",
2189 "channel-type": 4,
2190 "connection-id": 1804289383,
2191 "host": "127.0.0.1",
2192 "channel-id": 0,
2193 "tls": false
2194 },
2195 [ ... more channels follow ... ]
2196 ]
2197 }
2198 }
2199
2200 EQMP
2201
2202 #if defined(CONFIG_SPICE)
2203 {
2204 .name = "query-spice",
2205 .args_type = "",
2206 .mhandler.cmd_new = qmp_marshal_input_query_spice,
2207 },
2208 #endif
2209
2210 SQMP
2211 query-name
2212 ----------
2213
2214 Show VM name.
2215
2216 Return a json-object with the following information:
2217
2218 - "name": VM's name (json-string, optional)
2219
2220 Example:
2221
2222 -> { "execute": "query-name" }
2223 <- { "return": { "name": "qemu-name" } }
2224
2225 EQMP
2226
2227 {
2228 .name = "query-name",
2229 .args_type = "",
2230 .mhandler.cmd_new = qmp_marshal_input_query_name,
2231 },
2232
2233 SQMP
2234 query-uuid
2235 ----------
2236
2237 Show VM UUID.
2238
2239 Return a json-object with the following information:
2240
2241 - "UUID": Universally Unique Identifier (json-string)
2242
2243 Example:
2244
2245 -> { "execute": "query-uuid" }
2246 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2247
2248 EQMP
2249
2250 {
2251 .name = "query-uuid",
2252 .args_type = "",
2253 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
2254 },
2255
2256 SQMP
2257 query-migrate
2258 -------------
2259
2260 Migration status.
2261
2262 Return a json-object. If migration is active there will be another json-object
2263 with RAM migration status and if block migration is active another one with
2264 block migration status.
2265
2266 The main json-object contains the following:
2267
2268 - "status": migration status (json-string)
2269 - Possible values: "active", "completed", "failed", "cancelled"
2270 - "total-time": total amount of ms since migration started. If
2271 migration has ended, it returns the total migration
2272 time (json-int)
2273 - "ram": only present if "status" is "active", it is a json-object with the
2274 following RAM information (in bytes):
2275 - "transferred": amount transferred (json-int)
2276 - "remaining": amount remaining (json-int)
2277 - "total": total (json-int)
2278 - "duplicate": number of duplicated pages (json-int)
2279 - "normal" : number of normal pages transferred (json-int)
2280 - "normal-bytes" : number of normal bytes transferred (json-int)
2281 - "disk": only present if "status" is "active" and it is a block migration,
2282 it is a json-object with the following disk information (in bytes):
2283 - "transferred": amount transferred (json-int)
2284 - "remaining": amount remaining (json-int)
2285 - "total": total (json-int)
2286 - "xbzrle-cache": only present if XBZRLE is active.
2287 It is a json-object with the following XBZRLE information:
2288 - "cache-size": XBZRLE cache size
2289 - "bytes": total XBZRLE bytes transferred
2290 - "pages": number of XBZRLE compressed pages
2291 - "cache-miss": number of cache misses
2292 - "overflow": number of XBZRLE overflows
2293 Examples:
2294
2295 1. Before the first migration
2296
2297 -> { "execute": "query-migrate" }
2298 <- { "return": {} }
2299
2300 2. Migration is done and has succeeded
2301
2302 -> { "execute": "query-migrate" }
2303 <- { "return": {
2304 "status": "completed",
2305 "ram":{
2306 "transferred":123,
2307 "remaining":123,
2308 "total":246,
2309 "total-time":12345,
2310 "duplicate":123,
2311 "normal":123,
2312 "normal-bytes":123456
2313 }
2314 }
2315 }
2316
2317 3. Migration is done and has failed
2318
2319 -> { "execute": "query-migrate" }
2320 <- { "return": { "status": "failed" } }
2321
2322 4. Migration is being performed and is not a block migration:
2323
2324 -> { "execute": "query-migrate" }
2325 <- {
2326 "return":{
2327 "status":"active",
2328 "ram":{
2329 "transferred":123,
2330 "remaining":123,
2331 "total":246,
2332 "total-time":12345,
2333 "duplicate":123,
2334 "normal":123,
2335 "normal-bytes":123456
2336 }
2337 }
2338 }
2339
2340 5. Migration is being performed and is a block migration:
2341
2342 -> { "execute": "query-migrate" }
2343 <- {
2344 "return":{
2345 "status":"active",
2346 "ram":{
2347 "total":1057024,
2348 "remaining":1053304,
2349 "transferred":3720,
2350 "total-time":12345,
2351 "duplicate":123,
2352 "normal":123,
2353 "normal-bytes":123456
2354 },
2355 "disk":{
2356 "total":20971520,
2357 "remaining":20880384,
2358 "transferred":91136
2359 }
2360 }
2361 }
2362
2363 6. Migration is being performed and XBZRLE is active:
2364
2365 -> { "execute": "query-migrate" }
2366 <- {
2367 "return":{
2368 "status":"active",
2369 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
2370 "ram":{
2371 "total":1057024,
2372 "remaining":1053304,
2373 "transferred":3720,
2374 "total-time":12345,
2375 "duplicate":10,
2376 "normal":3333,
2377 "normal-bytes":3412992
2378 },
2379 "xbzrle-cache":{
2380 "cache-size":67108864,
2381 "bytes":20971520,
2382 "pages":2444343,
2383 "cache-miss":2244,
2384 "overflow":34434
2385 }
2386 }
2387 }
2388
2389 EQMP
2390
2391 {
2392 .name = "query-migrate",
2393 .args_type = "",
2394 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
2395 },
2396
2397 SQMP
2398 migrate-set-capabilities
2399 -------
2400
2401 Enable/Disable migration capabilities
2402
2403 - "xbzrle": xbzrle support
2404
2405 Arguments:
2406
2407 Example:
2408
2409 -> { "execute": "migrate-set-capabilities" , "arguments":
2410 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
2411
2412 EQMP
2413
2414 {
2415 .name = "migrate-set-capabilities",
2416 .args_type = "capabilities:O",
2417 .params = "capability:s,state:b",
2418 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
2419 },
2420 SQMP
2421 query-migrate-capabilities
2422 -------
2423
2424 Query current migration capabilities
2425
2426 - "capabilities": migration capabilities state
2427 - "xbzrle" : XBZRLE state (json-bool)
2428
2429 Arguments:
2430
2431 Example:
2432
2433 -> { "execute": "query-migrate-capabilities" }
2434 <- { "return": {
2435 "capabilities" : [ { "capability" : "xbzrle", "state" : false } ]
2436 }
2437 }
2438 EQMP
2439
2440 {
2441 .name = "query-migrate-capabilities",
2442 .args_type = "",
2443 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
2444 },
2445
2446 SQMP
2447 query-balloon
2448 -------------
2449
2450 Show balloon information.
2451
2452 Make an asynchronous request for balloon info. When the request completes a
2453 json-object will be returned containing the following data:
2454
2455 - "actual": current balloon value in bytes (json-int)
2456 - "mem_swapped_in": Amount of memory swapped in bytes (json-int, optional)
2457 - "mem_swapped_out": Amount of memory swapped out in bytes (json-int, optional)
2458 - "major_page_faults": Number of major faults (json-int, optional)
2459 - "minor_page_faults": Number of minor faults (json-int, optional)
2460 - "free_mem": Total amount of free and unused memory in
2461 bytes (json-int, optional)
2462 - "total_mem": Total amount of available memory in bytes (json-int, optional)
2463
2464 Example:
2465
2466 -> { "execute": "query-balloon" }
2467 <- {
2468 "return":{
2469 "actual":1073741824,
2470 "mem_swapped_in":0,
2471 "mem_swapped_out":0,
2472 "major_page_faults":142,
2473 "minor_page_faults":239245,
2474 "free_mem":1014185984,
2475 "total_mem":1044668416
2476 }
2477 }
2478
2479 EQMP
2480
2481 {
2482 .name = "query-balloon",
2483 .args_type = "",
2484 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
2485 },
2486
2487 {
2488 .name = "query-block-jobs",
2489 .args_type = "",
2490 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
2491 },
2492
2493 {
2494 .name = "qom-list",
2495 .args_type = "path:s",
2496 .mhandler.cmd_new = qmp_marshal_input_qom_list,
2497 },
2498
2499 {
2500 .name = "qom-set",
2501 .args_type = "path:s,property:s,value:q",
2502 .mhandler.cmd_new = qmp_qom_set,
2503 },
2504
2505 {
2506 .name = "qom-get",
2507 .args_type = "path:s,property:s",
2508 .mhandler.cmd_new = qmp_qom_get,
2509 },
2510
2511 {
2512 .name = "change-vnc-password",
2513 .args_type = "password:s",
2514 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
2515 },
2516 {
2517 .name = "qom-list-types",
2518 .args_type = "implements:s?,abstract:b?",
2519 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
2520 },
2521
2522 {
2523 .name = "device-list-properties",
2524 .args_type = "typename:s",
2525 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
2526 },
2527
2528 {
2529 .name = "query-machines",
2530 .args_type = "",
2531 .mhandler.cmd_new = qmp_marshal_input_query_machines,
2532 },
2533
2534 {
2535 .name = "query-cpu-definitions",
2536 .args_type = "",
2537 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
2538 },
2539
2540 {
2541 .name = "query-target",
2542 .args_type = "",
2543 .mhandler.cmd_new = qmp_marshal_input_query_target,
2544 },