]> git.proxmox.com Git - mirror_qemu.git/blob - qmp-commands.hx
9b10d3d2e809fb89530dc5dd73ed26ffbd787b45
[mirror_qemu.git] / qmp-commands.hx
1 HXCOMM QMP dispatch table and documentation
2 HXCOMM Text between SQMP and EQMP is copied to the QMP documentation 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 .mhandler.cmd_new = qmp_marshal_input_screendump,
150 },
151
152 SQMP
153 screendump
154 ----------
155
156 Save screen into PPM image.
157
158 Arguments:
159
160 - "filename": file path (json-string)
161
162 Example:
163
164 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
165 <- { "return": {} }
166
167 EQMP
168
169 {
170 .name = "stop",
171 .args_type = "",
172 .mhandler.cmd_new = qmp_marshal_input_stop,
173 },
174
175 SQMP
176 stop
177 ----
178
179 Stop the emulator.
180
181 Arguments: None.
182
183 Example:
184
185 -> { "execute": "stop" }
186 <- { "return": {} }
187
188 EQMP
189
190 {
191 .name = "cont",
192 .args_type = "",
193 .mhandler.cmd_new = qmp_marshal_input_cont,
194 },
195
196 SQMP
197 cont
198 ----
199
200 Resume emulation.
201
202 Arguments: None.
203
204 Example:
205
206 -> { "execute": "cont" }
207 <- { "return": {} }
208
209 EQMP
210
211 {
212 .name = "system_wakeup",
213 .args_type = "",
214 .mhandler.cmd_new = qmp_marshal_input_system_wakeup,
215 },
216
217 SQMP
218 system_wakeup
219 -------------
220
221 Wakeup guest from suspend.
222
223 Arguments: None.
224
225 Example:
226
227 -> { "execute": "system_wakeup" }
228 <- { "return": {} }
229
230 EQMP
231
232 {
233 .name = "system_reset",
234 .args_type = "",
235 .mhandler.cmd_new = qmp_marshal_input_system_reset,
236 },
237
238 SQMP
239 system_reset
240 ------------
241
242 Reset the system.
243
244 Arguments: None.
245
246 Example:
247
248 -> { "execute": "system_reset" }
249 <- { "return": {} }
250
251 EQMP
252
253 {
254 .name = "system_powerdown",
255 .args_type = "",
256 .mhandler.cmd_new = qmp_marshal_input_system_powerdown,
257 },
258
259 SQMP
260 system_powerdown
261 ----------------
262
263 Send system power down event.
264
265 Arguments: None.
266
267 Example:
268
269 -> { "execute": "system_powerdown" }
270 <- { "return": {} }
271
272 EQMP
273
274 {
275 .name = "device_add",
276 .args_type = "device:O",
277 .params = "driver[,prop=value][,...]",
278 .help = "add device, like -device on the command line",
279 .mhandler.cmd_new = do_device_add,
280 },
281
282 SQMP
283 device_add
284 ----------
285
286 Add a device.
287
288 Arguments:
289
290 - "driver": the name of the new device's driver (json-string)
291 - "bus": the device's parent bus (device tree path, json-string, optional)
292 - "id": the device's ID, must be unique (json-string)
293 - device properties
294
295 Example:
296
297 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
298 <- { "return": {} }
299
300 Notes:
301
302 (1) For detailed information about this command, please refer to the
303 'docs/qdev-device-use.txt' file.
304
305 (2) It's possible to list device properties by running QEMU with the
306 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
307
308 EQMP
309
310 {
311 .name = "device_del",
312 .args_type = "id:s",
313 .mhandler.cmd_new = qmp_marshal_input_device_del,
314 },
315
316 SQMP
317 device_del
318 ----------
319
320 Remove a device.
321
322 Arguments:
323
324 - "id": the device's ID (json-string)
325
326 Example:
327
328 -> { "execute": "device_del", "arguments": { "id": "net1" } }
329 <- { "return": {} }
330
331 EQMP
332
333 {
334 .name = "send-key",
335 .args_type = "keys:q,hold-time:i?",
336 .mhandler.cmd_new = qmp_marshal_input_send_key,
337 },
338
339 SQMP
340 send-key
341 ----------
342
343 Send keys to VM.
344
345 Arguments:
346
347 keys array:
348 - "key": key sequence (a json-array of key union values,
349 union can be number or qcode enum)
350
351 - hold-time: time to delay key up events, milliseconds. Defaults to 100
352 (json-int, optional)
353
354 Example:
355
356 -> { "execute": "send-key",
357 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
358 { "type": "qcode", "data": "alt" },
359 { "type": "qcode", "data": "delete" } ] } }
360 <- { "return": {} }
361
362 EQMP
363
364 {
365 .name = "cpu",
366 .args_type = "index:i",
367 .mhandler.cmd_new = qmp_marshal_input_cpu,
368 },
369
370 SQMP
371 cpu
372 ---
373
374 Set the default CPU.
375
376 Arguments:
377
378 - "index": the CPU's index (json-int)
379
380 Example:
381
382 -> { "execute": "cpu", "arguments": { "index": 0 } }
383 <- { "return": {} }
384
385 Note: CPUs' indexes are obtained with the 'query-cpus' command.
386
387 EQMP
388
389 {
390 .name = "cpu-add",
391 .args_type = "id:i",
392 .mhandler.cmd_new = qmp_marshal_input_cpu_add,
393 },
394
395 SQMP
396 cpu-add
397 -------
398
399 Adds virtual cpu
400
401 Arguments:
402
403 - "id": cpu id (json-int)
404
405 Example:
406
407 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
408 <- { "return": {} }
409
410 EQMP
411
412 {
413 .name = "memsave",
414 .args_type = "val:l,size:i,filename:s,cpu:i?",
415 .mhandler.cmd_new = qmp_marshal_input_memsave,
416 },
417
418 SQMP
419 memsave
420 -------
421
422 Save to disk virtual memory dump starting at 'val' of size 'size'.
423
424 Arguments:
425
426 - "val": the starting address (json-int)
427 - "size": the memory size, in bytes (json-int)
428 - "filename": file path (json-string)
429 - "cpu": virtual CPU index (json-int, optional)
430
431 Example:
432
433 -> { "execute": "memsave",
434 "arguments": { "val": 10,
435 "size": 100,
436 "filename": "/tmp/virtual-mem-dump" } }
437 <- { "return": {} }
438
439 EQMP
440
441 {
442 .name = "pmemsave",
443 .args_type = "val:l,size:i,filename:s",
444 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
445 },
446
447 SQMP
448 pmemsave
449 --------
450
451 Save to disk physical memory dump starting at 'val' of size 'size'.
452
453 Arguments:
454
455 - "val": the starting address (json-int)
456 - "size": the memory size, in bytes (json-int)
457 - "filename": file path (json-string)
458
459 Example:
460
461 -> { "execute": "pmemsave",
462 "arguments": { "val": 10,
463 "size": 100,
464 "filename": "/tmp/physical-mem-dump" } }
465 <- { "return": {} }
466
467 EQMP
468
469 {
470 .name = "inject-nmi",
471 .args_type = "",
472 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
473 },
474
475 SQMP
476 inject-nmi
477 ----------
478
479 Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
480
481 Arguments: None.
482
483 Example:
484
485 -> { "execute": "inject-nmi" }
486 <- { "return": {} }
487
488 Note: inject-nmi fails when the guest doesn't support injecting.
489
490 EQMP
491
492 {
493 .name = "ringbuf-write",
494 .args_type = "device:s,data:s,format:s?",
495 .mhandler.cmd_new = qmp_marshal_input_ringbuf_write,
496 },
497
498 SQMP
499 ringbuf-write
500 -------------
501
502 Write to a ring buffer character device.
503
504 Arguments:
505
506 - "device": ring buffer character device name (json-string)
507 - "data": data to write (json-string)
508 - "format": data format (json-string, optional)
509 - Possible values: "utf8" (default), "base64"
510 Bug: invalid base64 is currently not rejected.
511 Whitespace *is* invalid.
512
513 Example:
514
515 -> { "execute": "ringbuf-write",
516 "arguments": { "device": "foo",
517 "data": "abcdefgh",
518 "format": "utf8" } }
519 <- { "return": {} }
520
521 EQMP
522
523 {
524 .name = "ringbuf-read",
525 .args_type = "device:s,size:i,format:s?",
526 .mhandler.cmd_new = qmp_marshal_input_ringbuf_read,
527 },
528
529 SQMP
530 ringbuf-read
531 -------------
532
533 Read from a ring buffer character device.
534
535 Arguments:
536
537 - "device": ring buffer character device name (json-string)
538 - "size": how many bytes to read at most (json-int)
539 - Number of data bytes, not number of characters in encoded data
540 - "format": data format (json-string, optional)
541 - Possible values: "utf8" (default), "base64"
542 - Naturally, format "utf8" works only when the ring buffer
543 contains valid UTF-8 text. Invalid UTF-8 sequences get
544 replaced. Bug: replacement doesn't work. Bug: can screw
545 up on encountering NUL characters, after the ring buffer
546 lost data, and when reading stops because the size limit
547 is reached.
548
549 Example:
550
551 -> { "execute": "ringbuf-read",
552 "arguments": { "device": "foo",
553 "size": 1000,
554 "format": "utf8" } }
555 <- {"return": "abcdefgh"}
556
557 EQMP
558
559 {
560 .name = "xen-save-devices-state",
561 .args_type = "filename:F",
562 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
563 },
564
565 SQMP
566 xen-save-devices-state
567 -------
568
569 Save the state of all devices to file. The RAM and the block devices
570 of the VM are not saved by this command.
571
572 Arguments:
573
574 - "filename": the file to save the state of the devices to as binary
575 data. See xen-save-devices-state.txt for a description of the binary
576 format.
577
578 Example:
579
580 -> { "execute": "xen-save-devices-state",
581 "arguments": { "filename": "/tmp/save" } }
582 <- { "return": {} }
583
584 EQMP
585
586 {
587 .name = "xen-set-global-dirty-log",
588 .args_type = "enable:b",
589 .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
590 },
591
592 SQMP
593 xen-set-global-dirty-log
594 -------
595
596 Enable or disable the global dirty log mode.
597
598 Arguments:
599
600 - "enable": Enable it or disable it.
601
602 Example:
603
604 -> { "execute": "xen-set-global-dirty-log",
605 "arguments": { "enable": true } }
606 <- { "return": {} }
607
608 EQMP
609
610 {
611 .name = "migrate",
612 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
613 .mhandler.cmd_new = qmp_marshal_input_migrate,
614 },
615
616 SQMP
617 migrate
618 -------
619
620 Migrate to URI.
621
622 Arguments:
623
624 - "blk": block migration, full disk copy (json-bool, optional)
625 - "inc": incremental disk copy (json-bool, optional)
626 - "uri": Destination URI (json-string)
627
628 Example:
629
630 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
631 <- { "return": {} }
632
633 Notes:
634
635 (1) The 'query-migrate' command should be used to check migration's progress
636 and final result (this information is provided by the 'status' member)
637 (2) All boolean arguments default to false
638 (3) The user Monitor's "detach" argument is invalid in QMP and should not
639 be used
640
641 EQMP
642
643 {
644 .name = "migrate_cancel",
645 .args_type = "",
646 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
647 },
648
649 SQMP
650 migrate_cancel
651 --------------
652
653 Cancel the current migration.
654
655 Arguments: None.
656
657 Example:
658
659 -> { "execute": "migrate_cancel" }
660 <- { "return": {} }
661
662 EQMP
663
664 {
665 .name = "migrate-incoming",
666 .args_type = "uri:s",
667 .mhandler.cmd_new = qmp_marshal_input_migrate_incoming,
668 },
669
670 SQMP
671 migrate-incoming
672 ----------------
673
674 Continue an incoming migration
675
676 Arguments:
677
678 - "uri": Source/listening URI (json-string)
679
680 Example:
681
682 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
683 <- { "return": {} }
684
685 Notes:
686
687 (1) QEMU must be started with -incoming defer to allow migrate-incoming to
688 be used
689 (2) The uri format is the same as to -incoming
690
691 EQMP
692 {
693 .name = "migrate-set-cache-size",
694 .args_type = "value:o",
695 .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
696 },
697
698 SQMP
699 migrate-set-cache-size
700 ----------------------
701
702 Set cache size to be used by XBZRLE migration, the cache size will be rounded
703 down to the nearest power of 2
704
705 Arguments:
706
707 - "value": cache size in bytes (json-int)
708
709 Example:
710
711 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
712 <- { "return": {} }
713
714 EQMP
715 {
716 .name = "query-migrate-cache-size",
717 .args_type = "",
718 .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
719 },
720
721 SQMP
722 query-migrate-cache-size
723 ------------------------
724
725 Show cache size to be used by XBZRLE migration
726
727 returns a json-object with the following information:
728 - "size" : json-int
729
730 Example:
731
732 -> { "execute": "query-migrate-cache-size" }
733 <- { "return": 67108864 }
734
735 EQMP
736
737 {
738 .name = "migrate_set_speed",
739 .args_type = "value:o",
740 .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
741 },
742
743 SQMP
744 migrate_set_speed
745 -----------------
746
747 Set maximum speed for migrations.
748
749 Arguments:
750
751 - "value": maximum speed, in bytes per second (json-int)
752
753 Example:
754
755 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
756 <- { "return": {} }
757
758 EQMP
759
760 {
761 .name = "migrate_set_downtime",
762 .args_type = "value:T",
763 .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
764 },
765
766 SQMP
767 migrate_set_downtime
768 --------------------
769
770 Set maximum tolerated downtime (in seconds) for migrations.
771
772 Arguments:
773
774 - "value": maximum downtime (json-number)
775
776 Example:
777
778 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
779 <- { "return": {} }
780
781 EQMP
782
783 {
784 .name = "client_migrate_info",
785 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
786 .params = "protocol hostname port tls-port cert-subject",
787 .help = "send migration info to spice/vnc client",
788 .mhandler.cmd_new = client_migrate_info,
789 },
790
791 SQMP
792 client_migrate_info
793 ------------------
794
795 Set the spice/vnc connection info for the migration target. The spice/vnc
796 server will ask the spice/vnc client to automatically reconnect using the
797 new parameters (if specified) once the vm migration finished successfully.
798
799 Arguments:
800
801 - "protocol": protocol: "spice" or "vnc" (json-string)
802 - "hostname": migration target hostname (json-string)
803 - "port": spice/vnc tcp port for plaintext channels (json-int, optional)
804 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
805 - "cert-subject": server certificate subject (json-string, optional)
806
807 Example:
808
809 -> { "execute": "client_migrate_info",
810 "arguments": { "protocol": "spice",
811 "hostname": "virt42.lab.kraxel.org",
812 "port": 1234 } }
813 <- { "return": {} }
814
815 EQMP
816
817 {
818 .name = "dump-guest-memory",
819 .args_type = "paging:b,protocol:s,begin:i?,end:i?,format:s?",
820 .params = "-p protocol [begin] [length] [format]",
821 .help = "dump guest memory to file",
822 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
823 },
824
825 SQMP
826 dump
827
828
829 Dump guest memory to file. The file can be processed with crash or gdb.
830
831 Arguments:
832
833 - "paging": do paging to get guest's memory mapping (json-bool)
834 - "protocol": destination file(started with "file:") or destination file
835 descriptor (started with "fd:") (json-string)
836 - "begin": the starting physical address. It's optional, and should be specified
837 with length together (json-int)
838 - "length": the memory size, in bytes. It's optional, and should be specified
839 with begin together (json-int)
840 - "format": the format of guest memory dump. It's optional, and can be
841 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
842 conflict with paging and filter, ie. begin and length (json-string)
843
844 Example:
845
846 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
847 <- { "return": {} }
848
849 Notes:
850
851 (1) All boolean arguments default to false
852
853 EQMP
854
855 {
856 .name = "query-dump-guest-memory-capability",
857 .args_type = "",
858 .mhandler.cmd_new = qmp_marshal_input_query_dump_guest_memory_capability,
859 },
860
861 SQMP
862 query-dump-guest-memory-capability
863 ----------
864
865 Show available formats for 'dump-guest-memory'
866
867 Example:
868
869 -> { "execute": "query-dump-guest-memory-capability" }
870 <- { "return": { "formats":
871 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
872
873 EQMP
874
875 {
876 .name = "netdev_add",
877 .args_type = "netdev:O",
878 .mhandler.cmd_new = qmp_netdev_add,
879 },
880
881 SQMP
882 netdev_add
883 ----------
884
885 Add host network device.
886
887 Arguments:
888
889 - "type": the device type, "tap", "user", ... (json-string)
890 - "id": the device's ID, must be unique (json-string)
891 - device options
892
893 Example:
894
895 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
896 <- { "return": {} }
897
898 Note: The supported device options are the same ones supported by the '-netdev'
899 command-line argument, which are listed in the '-help' output or QEMU's
900 manual
901
902 EQMP
903
904 {
905 .name = "netdev_del",
906 .args_type = "id:s",
907 .mhandler.cmd_new = qmp_marshal_input_netdev_del,
908 },
909
910 SQMP
911 netdev_del
912 ----------
913
914 Remove host network device.
915
916 Arguments:
917
918 - "id": the device's ID, must be unique (json-string)
919
920 Example:
921
922 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
923 <- { "return": {} }
924
925
926 EQMP
927
928 {
929 .name = "object-add",
930 .args_type = "qom-type:s,id:s,props:q?",
931 .mhandler.cmd_new = qmp_object_add,
932 },
933
934 SQMP
935 object-add
936 ----------
937
938 Create QOM object.
939
940 Arguments:
941
942 - "qom-type": the object's QOM type, i.e. the class name (json-string)
943 - "id": the object's ID, must be unique (json-string)
944 - "props": a dictionary of object property values (optional, json-dict)
945
946 Example:
947
948 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
949 "props": { "filename": "/dev/hwrng" } } }
950 <- { "return": {} }
951
952 EQMP
953
954 {
955 .name = "object-del",
956 .args_type = "id:s",
957 .mhandler.cmd_new = qmp_marshal_input_object_del,
958 },
959
960 SQMP
961 object-del
962 ----------
963
964 Remove QOM object.
965
966 Arguments:
967
968 - "id": the object's ID (json-string)
969
970 Example:
971
972 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
973 <- { "return": {} }
974
975
976 EQMP
977
978
979 {
980 .name = "block_resize",
981 .args_type = "device:s?,node-name:s?,size:o",
982 .mhandler.cmd_new = qmp_marshal_input_block_resize,
983 },
984
985 SQMP
986 block_resize
987 ------------
988
989 Resize a block image while a guest is running.
990
991 Arguments:
992
993 - "device": the device's ID, must be unique (json-string)
994 - "node-name": the node name in the block driver state graph (json-string)
995 - "size": new size
996
997 Example:
998
999 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1000 <- { "return": {} }
1001
1002 EQMP
1003
1004 {
1005 .name = "block-stream",
1006 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1007 .mhandler.cmd_new = qmp_marshal_input_block_stream,
1008 },
1009
1010 SQMP
1011 block-stream
1012 ------------
1013
1014 Copy data from a backing file into a block device.
1015
1016 Arguments:
1017
1018 - "device": The device's ID, must be unique (json-string)
1019 - "base": The file name of the backing image above which copying starts
1020 (json-string, optional)
1021 - "backing-file": The backing file string to write into the active layer. This
1022 filename is not validated.
1023
1024 If a pathname string is such that it cannot be resolved by
1025 QEMU, that means that subsequent QMP or HMP commands must use
1026 node-names for the image in question, as filename lookup
1027 methods will fail.
1028
1029 If not specified, QEMU will automatically determine the
1030 backing file string to use, or error out if there is no
1031 obvious choice. Care should be taken when specifying the
1032 string, to specify a valid filename or protocol.
1033 (json-string, optional) (Since 2.1)
1034 - "speed": the maximum speed, in bytes per second (json-int, optional)
1035 - "on-error": the action to take on an error (default 'report'). 'stop' and
1036 'enospc' can only be used if the block device supports io-status.
1037 (json-string, optional) (Since 2.1)
1038
1039 Example:
1040
1041 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
1042 "base": "/tmp/master.qcow2" } }
1043 <- { "return": {} }
1044
1045 EQMP
1046
1047 {
1048 .name = "block-commit",
1049 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1050 .mhandler.cmd_new = qmp_marshal_input_block_commit,
1051 },
1052
1053 SQMP
1054 block-commit
1055 ------------
1056
1057 Live commit of data from overlay image nodes into backing nodes - i.e., writes
1058 data between 'top' and 'base' into 'base'.
1059
1060 Arguments:
1061
1062 - "device": The device's ID, must be unique (json-string)
1063 - "base": The file name of the backing image to write data into.
1064 If not specified, this is the deepest backing image
1065 (json-string, optional)
1066 - "top": The file name of the backing image within the image chain,
1067 which contains the topmost data to be committed down. If
1068 not specified, this is the active layer. (json-string, optional)
1069
1070 - backing-file: The backing file string to write into the overlay
1071 image of 'top'. If 'top' is the active layer,
1072 specifying a backing file string is an error. This
1073 filename is not validated.
1074
1075 If a pathname string is such that it cannot be
1076 resolved by QEMU, that means that subsequent QMP or
1077 HMP commands must use node-names for the image in
1078 question, as filename lookup methods will fail.
1079
1080 If not specified, QEMU will automatically determine
1081 the backing file string to use, or error out if
1082 there is no obvious choice. Care should be taken
1083 when specifying the string, to specify a valid
1084 filename or protocol.
1085 (json-string, optional) (Since 2.1)
1086
1087 If top == base, that is an error.
1088 If top == active, the job will not be completed by itself,
1089 user needs to complete the job with the block-job-complete
1090 command after getting the ready event. (Since 2.0)
1091
1092 If the base image is smaller than top, then the base image
1093 will be resized to be the same size as top. If top is
1094 smaller than the base image, the base will not be
1095 truncated. If you want the base image size to match the
1096 size of the smaller top, you can safely truncate it
1097 yourself once the commit operation successfully completes.
1098 (json-string)
1099 - "speed": the maximum speed, in bytes per second (json-int, optional)
1100
1101
1102 Example:
1103
1104 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1105 "top": "/tmp/snap1.qcow2" } }
1106 <- { "return": {} }
1107
1108 EQMP
1109
1110 {
1111 .name = "drive-backup",
1112 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1113 "bitmap:s?,on-source-error:s?,on-target-error:s?",
1114 .mhandler.cmd_new = qmp_marshal_input_drive_backup,
1115 },
1116
1117 SQMP
1118 drive-backup
1119 ------------
1120
1121 Start a point-in-time copy of a block device to a new destination. The
1122 status of ongoing drive-backup operations can be checked with
1123 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1124 The operation can be stopped before it has completed using the
1125 block-job-cancel command.
1126
1127 Arguments:
1128
1129 - "device": the name of the device which should be copied.
1130 (json-string)
1131 - "target": the target of the new image. If the file exists, or if it is a
1132 device, the existing file/device will be used as the new
1133 destination. If it does not exist, a new file will be created.
1134 (json-string)
1135 - "format": the format of the new destination, default is to probe if 'mode' is
1136 'existing', else the format of the source
1137 (json-string, optional)
1138 - "sync": what parts of the disk image should be copied to the destination;
1139 possibilities include "full" for all the disk, "top" for only the sectors
1140 allocated in the topmost image, "dirty-bitmap" for only the dirty sectors in
1141 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1142 - "bitmap": dirty bitmap name for sync==dirty-bitmap. Must be present if sync
1143 is "dirty-bitmap", must NOT be present otherwise.
1144 - "mode": whether and how QEMU should create a new image
1145 (NewImageMode, optional, default 'absolute-paths')
1146 - "speed": the maximum speed, in bytes per second (json-int, optional)
1147 - "on-source-error": the action to take on an error on the source, default
1148 'report'. 'stop' and 'enospc' can only be used
1149 if the block device supports io-status.
1150 (BlockdevOnError, optional)
1151 - "on-target-error": the action to take on an error on the target, default
1152 'report' (no limitations, since this applies to
1153 a different block device than device).
1154 (BlockdevOnError, optional)
1155
1156 Example:
1157 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1158 "sync": "full",
1159 "target": "backup.img" } }
1160 <- { "return": {} }
1161
1162 EQMP
1163
1164 {
1165 .name = "blockdev-backup",
1166 .args_type = "sync:s,device:B,target:B,speed:i?,"
1167 "on-source-error:s?,on-target-error:s?",
1168 .mhandler.cmd_new = qmp_marshal_input_blockdev_backup,
1169 },
1170
1171 SQMP
1172 blockdev-backup
1173 ---------------
1174
1175 The device version of drive-backup: this command takes an existing named device
1176 as backup target.
1177
1178 Arguments:
1179
1180 - "device": the name of the device which should be copied.
1181 (json-string)
1182 - "target": the name of the backup target device. (json-string)
1183 - "sync": what parts of the disk image should be copied to the destination;
1184 possibilities include "full" for all the disk, "top" for only the
1185 sectors allocated in the topmost image, or "none" to only replicate
1186 new I/O (MirrorSyncMode).
1187 - "speed": the maximum speed, in bytes per second (json-int, optional)
1188 - "on-source-error": the action to take on an error on the source, default
1189 'report'. 'stop' and 'enospc' can only be used
1190 if the block device supports io-status.
1191 (BlockdevOnError, optional)
1192 - "on-target-error": the action to take on an error on the target, default
1193 'report' (no limitations, since this applies to
1194 a different block device than device).
1195 (BlockdevOnError, optional)
1196
1197 Example:
1198 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1199 "sync": "full",
1200 "target": "tgt-id" } }
1201 <- { "return": {} }
1202
1203 EQMP
1204
1205 {
1206 .name = "block-job-set-speed",
1207 .args_type = "device:B,speed:o",
1208 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
1209 },
1210
1211 {
1212 .name = "block-job-cancel",
1213 .args_type = "device:B,force:b?",
1214 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
1215 },
1216 {
1217 .name = "block-job-pause",
1218 .args_type = "device:B",
1219 .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
1220 },
1221 {
1222 .name = "block-job-resume",
1223 .args_type = "device:B",
1224 .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
1225 },
1226 {
1227 .name = "block-job-complete",
1228 .args_type = "device:B",
1229 .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
1230 },
1231 {
1232 .name = "transaction",
1233 .args_type = "actions:q",
1234 .mhandler.cmd_new = qmp_marshal_input_transaction,
1235 },
1236
1237 SQMP
1238 transaction
1239 -----------
1240
1241 Atomically operate on one or more block devices. The only supported operations
1242 for now are drive-backup, internal and external snapshotting. A list of
1243 dictionaries is accepted, that contains the actions to be performed.
1244 If there is any failure performing any of the operations, all operations
1245 for the group are abandoned.
1246
1247 For external snapshots, the dictionary contains the device, the file to use for
1248 the new snapshot, and the format. The default format, if not specified, is
1249 qcow2.
1250
1251 Each new snapshot defaults to being created by QEMU (wiping any
1252 contents if the file already exists), but it is also possible to reuse
1253 an externally-created file. In the latter case, you should ensure that
1254 the new image file has the same contents as the current one; QEMU cannot
1255 perform any meaningful check. Typically this is achieved by using the
1256 current image file as the backing file for the new image.
1257
1258 On failure, the original disks pre-snapshot attempt will be used.
1259
1260 For internal snapshots, the dictionary contains the device and the snapshot's
1261 name. If an internal snapshot matching name already exists, the request will
1262 be rejected. Only some image formats support it, for example, qcow2, rbd,
1263 and sheepdog.
1264
1265 On failure, qemu will try delete the newly created internal snapshot in the
1266 transaction. When an I/O error occurs during deletion, the user needs to fix
1267 it later with qemu-img or other command.
1268
1269 Arguments:
1270
1271 actions array:
1272 - "type": the operation to perform. The only supported
1273 value is "blockdev-snapshot-sync". (json-string)
1274 - "data": a dictionary. The contents depend on the value
1275 of "type". When "type" is "blockdev-snapshot-sync":
1276 - "device": device name to snapshot (json-string)
1277 - "node-name": graph node name to snapshot (json-string)
1278 - "snapshot-file": name of new image file (json-string)
1279 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1280 - "format": format of new image (json-string, optional)
1281 - "mode": whether and how QEMU should create the snapshot file
1282 (NewImageMode, optional, default "absolute-paths")
1283 When "type" is "blockdev-snapshot-internal-sync":
1284 - "device": device name to snapshot (json-string)
1285 - "name": name of the new snapshot (json-string)
1286
1287 Example:
1288
1289 -> { "execute": "transaction",
1290 "arguments": { "actions": [
1291 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1292 "snapshot-file": "/some/place/my-image",
1293 "format": "qcow2" } },
1294 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1295 "snapshot-file": "/some/place/my-image2",
1296 "snapshot-node-name": "node3432",
1297 "mode": "existing",
1298 "format": "qcow2" } },
1299 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1300 "snapshot-file": "/some/place/my-image2",
1301 "mode": "existing",
1302 "format": "qcow2" } },
1303 { "type": "blockdev-snapshot-internal-sync", "data" : {
1304 "device": "ide-hd2",
1305 "name": "snapshot0" } } ] } }
1306 <- { "return": {} }
1307
1308 EQMP
1309
1310 {
1311 .name = "block-dirty-bitmap-add",
1312 .args_type = "node:B,name:s,granularity:i?",
1313 .mhandler.cmd_new = qmp_marshal_input_block_dirty_bitmap_add,
1314 },
1315
1316 SQMP
1317
1318 block-dirty-bitmap-add
1319 ----------------------
1320 Since 2.4
1321
1322 Create a dirty bitmap with a name on the device, and start tracking the writes.
1323
1324 Arguments:
1325
1326 - "node": device/node on which to create dirty bitmap (json-string)
1327 - "name": name of the new dirty bitmap (json-string)
1328 - "granularity": granularity to track writes with (int, optional)
1329
1330 Example:
1331
1332 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1333 "name": "bitmap0" } }
1334 <- { "return": {} }
1335
1336 EQMP
1337
1338 {
1339 .name = "block-dirty-bitmap-remove",
1340 .args_type = "node:B,name:s",
1341 .mhandler.cmd_new = qmp_marshal_input_block_dirty_bitmap_remove,
1342 },
1343
1344 SQMP
1345
1346 block-dirty-bitmap-remove
1347 -------------------------
1348 Since 2.4
1349
1350 Stop write tracking and remove the dirty bitmap that was created with
1351 block-dirty-bitmap-add.
1352
1353 Arguments:
1354
1355 - "node": device/node on which to remove dirty bitmap (json-string)
1356 - "name": name of the dirty bitmap to remove (json-string)
1357
1358 Example:
1359
1360 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1361 "name": "bitmap0" } }
1362 <- { "return": {} }
1363
1364 EQMP
1365
1366 {
1367 .name = "blockdev-snapshot-sync",
1368 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1369 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
1370 },
1371
1372 SQMP
1373 blockdev-snapshot-sync
1374 ----------------------
1375
1376 Synchronous snapshot of a block device. snapshot-file specifies the
1377 target of the new image. If the file exists, or if it is a device, the
1378 snapshot will be created in the existing file/device. If does not
1379 exist, a new file will be created. format specifies the format of the
1380 snapshot image, default is qcow2.
1381
1382 Arguments:
1383
1384 - "device": device name to snapshot (json-string)
1385 - "node-name": graph node name to snapshot (json-string)
1386 - "snapshot-file": name of new image file (json-string)
1387 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1388 - "mode": whether and how QEMU should create the snapshot file
1389 (NewImageMode, optional, default "absolute-paths")
1390 - "format": format of new image (json-string, optional)
1391
1392 Example:
1393
1394 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1395 "snapshot-file":
1396 "/some/place/my-image",
1397 "format": "qcow2" } }
1398 <- { "return": {} }
1399
1400 EQMP
1401
1402 {
1403 .name = "blockdev-snapshot-internal-sync",
1404 .args_type = "device:B,name:s",
1405 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,
1406 },
1407
1408 SQMP
1409 blockdev-snapshot-internal-sync
1410 -------------------------------
1411
1412 Synchronously take an internal snapshot of a block device when the format of
1413 image used supports it. If the name is an empty string, or a snapshot with
1414 name already exists, the operation will fail.
1415
1416 Arguments:
1417
1418 - "device": device name to snapshot (json-string)
1419 - "name": name of the new snapshot (json-string)
1420
1421 Example:
1422
1423 -> { "execute": "blockdev-snapshot-internal-sync",
1424 "arguments": { "device": "ide-hd0",
1425 "name": "snapshot0" }
1426 }
1427 <- { "return": {} }
1428
1429 EQMP
1430
1431 {
1432 .name = "blockdev-snapshot-delete-internal-sync",
1433 .args_type = "device:B,id:s?,name:s?",
1434 .mhandler.cmd_new =
1435 qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
1436 },
1437
1438 SQMP
1439 blockdev-snapshot-delete-internal-sync
1440 --------------------------------------
1441
1442 Synchronously delete an internal snapshot of a block device when the format of
1443 image used supports it. The snapshot is identified by name or id or both. One
1444 of name or id is required. If the snapshot is not found, the operation will
1445 fail.
1446
1447 Arguments:
1448
1449 - "device": device name (json-string)
1450 - "id": ID of the snapshot (json-string, optional)
1451 - "name": name of the snapshot (json-string, optional)
1452
1453 Example:
1454
1455 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1456 "arguments": { "device": "ide-hd0",
1457 "name": "snapshot0" }
1458 }
1459 <- { "return": {
1460 "id": "1",
1461 "name": "snapshot0",
1462 "vm-state-size": 0,
1463 "date-sec": 1000012,
1464 "date-nsec": 10,
1465 "vm-clock-sec": 100,
1466 "vm-clock-nsec": 20
1467 }
1468 }
1469
1470 EQMP
1471
1472 {
1473 .name = "drive-mirror",
1474 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1475 "node-name:s?,replaces:s?,"
1476 "on-source-error:s?,on-target-error:s?,"
1477 "granularity:i?,buf-size:i?",
1478 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1479 },
1480
1481 SQMP
1482 drive-mirror
1483 ------------
1484
1485 Start mirroring a block device's writes to a new destination. target
1486 specifies the target of the new image. If the file exists, or if it is
1487 a device, it will be used as the new destination for writes. If it does not
1488 exist, a new file will be created. format specifies the format of the
1489 mirror image, default is to probe if mode='existing', else the format
1490 of the source.
1491
1492 Arguments:
1493
1494 - "device": device name to operate on (json-string)
1495 - "target": name of new image file (json-string)
1496 - "format": format of new image (json-string, optional)
1497 - "node-name": the name of the new block driver state in the node graph
1498 (json-string, optional)
1499 - "replaces": the block driver node name to replace when finished
1500 (json-string, optional)
1501 - "mode": how an image file should be created into the target
1502 file/device (NewImageMode, optional, default 'absolute-paths')
1503 - "speed": maximum speed of the streaming job, in bytes per second
1504 (json-int)
1505 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1506 - "buf_size": maximum amount of data in flight from source to target, in bytes
1507 (json-int, default 10M)
1508 - "sync": what parts of the disk image should be copied to the destination;
1509 possibilities include "full" for all the disk, "top" for only the sectors
1510 allocated in the topmost image, or "none" to only replicate new I/O
1511 (MirrorSyncMode).
1512 - "on-source-error": the action to take on an error on the source
1513 (BlockdevOnError, default 'report')
1514 - "on-target-error": the action to take on an error on the target
1515 (BlockdevOnError, default 'report')
1516
1517 The default value of the granularity is the image cluster size clamped
1518 between 4096 and 65536, if the image format defines one. If the format
1519 does not define a cluster size, the default value of the granularity
1520 is 65536.
1521
1522
1523 Example:
1524
1525 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1526 "target": "/some/place/my-image",
1527 "sync": "full",
1528 "format": "qcow2" } }
1529 <- { "return": {} }
1530
1531 EQMP
1532
1533 {
1534 .name = "change-backing-file",
1535 .args_type = "device:s,image-node-name:s,backing-file:s",
1536 .mhandler.cmd_new = qmp_marshal_input_change_backing_file,
1537 },
1538
1539 SQMP
1540 change-backing-file
1541 -------------------
1542 Since: 2.1
1543
1544 Change the backing file in the image file metadata. This does not cause
1545 QEMU to reopen the image file to reparse the backing filename (it may,
1546 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1547 if needed). The new backing file string is written into the image file
1548 metadata, and the QEMU internal strings are updated.
1549
1550 Arguments:
1551
1552 - "image-node-name": The name of the block driver state node of the
1553 image to modify. The "device" is argument is used to
1554 verify "image-node-name" is in the chain described by
1555 "device".
1556 (json-string, optional)
1557
1558 - "device": The name of the device.
1559 (json-string)
1560
1561 - "backing-file": The string to write as the backing file. This string is
1562 not validated, so care should be taken when specifying
1563 the string or the image chain may not be able to be
1564 reopened again.
1565 (json-string)
1566
1567 Returns: Nothing on success
1568 If "device" does not exist or cannot be determined, DeviceNotFound
1569
1570 EQMP
1571
1572 {
1573 .name = "balloon",
1574 .args_type = "value:M",
1575 .mhandler.cmd_new = qmp_marshal_input_balloon,
1576 },
1577
1578 SQMP
1579 balloon
1580 -------
1581
1582 Request VM to change its memory allocation (in bytes).
1583
1584 Arguments:
1585
1586 - "value": New memory allocation (json-int)
1587
1588 Example:
1589
1590 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1591 <- { "return": {} }
1592
1593 EQMP
1594
1595 {
1596 .name = "set_link",
1597 .args_type = "name:s,up:b",
1598 .mhandler.cmd_new = qmp_marshal_input_set_link,
1599 },
1600
1601 SQMP
1602 set_link
1603 --------
1604
1605 Change the link status of a network adapter.
1606
1607 Arguments:
1608
1609 - "name": network device name (json-string)
1610 - "up": status is up (json-bool)
1611
1612 Example:
1613
1614 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1615 <- { "return": {} }
1616
1617 EQMP
1618
1619 {
1620 .name = "getfd",
1621 .args_type = "fdname:s",
1622 .params = "getfd name",
1623 .help = "receive a file descriptor via SCM rights and assign it a name",
1624 .mhandler.cmd_new = qmp_marshal_input_getfd,
1625 },
1626
1627 SQMP
1628 getfd
1629 -----
1630
1631 Receive a file descriptor via SCM rights and assign it a name.
1632
1633 Arguments:
1634
1635 - "fdname": file descriptor name (json-string)
1636
1637 Example:
1638
1639 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1640 <- { "return": {} }
1641
1642 Notes:
1643
1644 (1) If the name specified by the "fdname" argument already exists,
1645 the file descriptor assigned to it will be closed and replaced
1646 by the received file descriptor.
1647 (2) The 'closefd' command can be used to explicitly close the file
1648 descriptor when it is no longer needed.
1649
1650 EQMP
1651
1652 {
1653 .name = "closefd",
1654 .args_type = "fdname:s",
1655 .params = "closefd name",
1656 .help = "close a file descriptor previously passed via SCM rights",
1657 .mhandler.cmd_new = qmp_marshal_input_closefd,
1658 },
1659
1660 SQMP
1661 closefd
1662 -------
1663
1664 Close a file descriptor previously passed via SCM rights.
1665
1666 Arguments:
1667
1668 - "fdname": file descriptor name (json-string)
1669
1670 Example:
1671
1672 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1673 <- { "return": {} }
1674
1675 EQMP
1676
1677 {
1678 .name = "add-fd",
1679 .args_type = "fdset-id:i?,opaque:s?",
1680 .params = "add-fd fdset-id opaque",
1681 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1682 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1683 },
1684
1685 SQMP
1686 add-fd
1687 -------
1688
1689 Add a file descriptor, that was passed via SCM rights, to an fd set.
1690
1691 Arguments:
1692
1693 - "fdset-id": The ID of the fd set to add the file descriptor to.
1694 (json-int, optional)
1695 - "opaque": A free-form string that can be used to describe the fd.
1696 (json-string, optional)
1697
1698 Return a json-object with the following information:
1699
1700 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1701 - "fd": The file descriptor that was received via SCM rights and added to the
1702 fd set. (json-int)
1703
1704 Example:
1705
1706 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1707 <- { "return": { "fdset-id": 1, "fd": 3 } }
1708
1709 Notes:
1710
1711 (1) The list of fd sets is shared by all monitor connections.
1712 (2) If "fdset-id" is not specified, a new fd set will be created.
1713
1714 EQMP
1715
1716 {
1717 .name = "remove-fd",
1718 .args_type = "fdset-id:i,fd:i?",
1719 .params = "remove-fd fdset-id fd",
1720 .help = "Remove a file descriptor from an fd set",
1721 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1722 },
1723
1724 SQMP
1725 remove-fd
1726 ---------
1727
1728 Remove a file descriptor from an fd set.
1729
1730 Arguments:
1731
1732 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1733 (json-int)
1734 - "fd": The file descriptor that is to be removed. (json-int, optional)
1735
1736 Example:
1737
1738 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1739 <- { "return": {} }
1740
1741 Notes:
1742
1743 (1) The list of fd sets is shared by all monitor connections.
1744 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1745 removed.
1746
1747 EQMP
1748
1749 {
1750 .name = "query-fdsets",
1751 .args_type = "",
1752 .help = "Return information describing all fd sets",
1753 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1754 },
1755
1756 SQMP
1757 query-fdsets
1758 -------------
1759
1760 Return information describing all fd sets.
1761
1762 Arguments: None
1763
1764 Example:
1765
1766 -> { "execute": "query-fdsets" }
1767 <- { "return": [
1768 {
1769 "fds": [
1770 {
1771 "fd": 30,
1772 "opaque": "rdonly:/path/to/file"
1773 },
1774 {
1775 "fd": 24,
1776 "opaque": "rdwr:/path/to/file"
1777 }
1778 ],
1779 "fdset-id": 1
1780 },
1781 {
1782 "fds": [
1783 {
1784 "fd": 28
1785 },
1786 {
1787 "fd": 29
1788 }
1789 ],
1790 "fdset-id": 0
1791 }
1792 ]
1793 }
1794
1795 Note: The list of fd sets is shared by all monitor connections.
1796
1797 EQMP
1798
1799 {
1800 .name = "block_passwd",
1801 .args_type = "device:s?,node-name:s?,password:s",
1802 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
1803 },
1804
1805 SQMP
1806 block_passwd
1807 ------------
1808
1809 Set the password of encrypted block devices.
1810
1811 Arguments:
1812
1813 - "device": device name (json-string)
1814 - "node-name": name in the block driver state graph (json-string)
1815 - "password": password (json-string)
1816
1817 Example:
1818
1819 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1820 "password": "12345" } }
1821 <- { "return": {} }
1822
1823 EQMP
1824
1825 {
1826 .name = "block_set_io_throttle",
1827 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l,bps_max:l?,bps_rd_max:l?,bps_wr_max:l?,iops_max:l?,iops_rd_max:l?,iops_wr_max:l?,iops_size:l?",
1828 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
1829 },
1830
1831 SQMP
1832 block_set_io_throttle
1833 ------------
1834
1835 Change I/O throttle limits for a block drive.
1836
1837 Arguments:
1838
1839 - "device": device name (json-string)
1840 - "bps": total throughput limit in bytes per second (json-int)
1841 - "bps_rd": read throughput limit in bytes per second (json-int)
1842 - "bps_wr": write throughput limit in bytes per second (json-int)
1843 - "iops": total I/O operations per second (json-int)
1844 - "iops_rd": read I/O operations per second (json-int)
1845 - "iops_wr": write I/O operations per second (json-int)
1846 - "bps_max": total max in bytes (json-int)
1847 - "bps_rd_max": read max in bytes (json-int)
1848 - "bps_wr_max": write max in bytes (json-int)
1849 - "iops_max": total I/O operations max (json-int)
1850 - "iops_rd_max": read I/O operations max (json-int)
1851 - "iops_wr_max": write I/O operations max (json-int)
1852 - "iops_size": I/O size in bytes when limiting (json-int)
1853
1854 Example:
1855
1856 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1857 "bps": 1000000,
1858 "bps_rd": 0,
1859 "bps_wr": 0,
1860 "iops": 0,
1861 "iops_rd": 0,
1862 "iops_wr": 0,
1863 "bps_max": 8000000,
1864 "bps_rd_max": 0,
1865 "bps_wr_max": 0,
1866 "iops_max": 0,
1867 "iops_rd_max": 0,
1868 "iops_wr_max": 0,
1869 "iops_size": 0 } }
1870 <- { "return": {} }
1871
1872 EQMP
1873
1874 {
1875 .name = "set_password",
1876 .args_type = "protocol:s,password:s,connected:s?",
1877 .mhandler.cmd_new = qmp_marshal_input_set_password,
1878 },
1879
1880 SQMP
1881 set_password
1882 ------------
1883
1884 Set the password for vnc/spice protocols.
1885
1886 Arguments:
1887
1888 - "protocol": protocol name (json-string)
1889 - "password": password (json-string)
1890 - "connected": [ keep | disconnect | fail ] (json-string, optional)
1891
1892 Example:
1893
1894 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1895 "password": "secret" } }
1896 <- { "return": {} }
1897
1898 EQMP
1899
1900 {
1901 .name = "expire_password",
1902 .args_type = "protocol:s,time:s",
1903 .mhandler.cmd_new = qmp_marshal_input_expire_password,
1904 },
1905
1906 SQMP
1907 expire_password
1908 ---------------
1909
1910 Set the password expire time for vnc/spice protocols.
1911
1912 Arguments:
1913
1914 - "protocol": protocol name (json-string)
1915 - "time": [ now | never | +secs | secs ] (json-string)
1916
1917 Example:
1918
1919 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1920 "time": "+60" } }
1921 <- { "return": {} }
1922
1923 EQMP
1924
1925 {
1926 .name = "add_client",
1927 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
1928 .mhandler.cmd_new = qmp_marshal_input_add_client,
1929 },
1930
1931 SQMP
1932 add_client
1933 ----------
1934
1935 Add a graphics client
1936
1937 Arguments:
1938
1939 - "protocol": protocol name (json-string)
1940 - "fdname": file descriptor name (json-string)
1941 - "skipauth": whether to skip authentication (json-bool, optional)
1942 - "tls": whether to perform TLS (json-bool, optional)
1943
1944 Example:
1945
1946 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1947 "fdname": "myclient" } }
1948 <- { "return": {} }
1949
1950 EQMP
1951 {
1952 .name = "qmp_capabilities",
1953 .args_type = "",
1954 .params = "",
1955 .help = "enable QMP capabilities",
1956 .mhandler.cmd_new = do_qmp_capabilities,
1957 },
1958
1959 SQMP
1960 qmp_capabilities
1961 ----------------
1962
1963 Enable QMP capabilities.
1964
1965 Arguments: None.
1966
1967 Example:
1968
1969 -> { "execute": "qmp_capabilities" }
1970 <- { "return": {} }
1971
1972 Note: This command must be issued before issuing any other command.
1973
1974 EQMP
1975
1976 {
1977 .name = "human-monitor-command",
1978 .args_type = "command-line:s,cpu-index:i?",
1979 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
1980 },
1981
1982 SQMP
1983 human-monitor-command
1984 ---------------------
1985
1986 Execute a Human Monitor command.
1987
1988 Arguments:
1989
1990 - command-line: the command name and its arguments, just like the
1991 Human Monitor's shell (json-string)
1992 - cpu-index: select the CPU number to be used by commands which access CPU
1993 data, like 'info registers'. The Monitor selects CPU 0 if this
1994 argument is not provided (json-int, optional)
1995
1996 Example:
1997
1998 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1999 <- { "return": "kvm support: enabled\r\n" }
2000
2001 Notes:
2002
2003 (1) The Human Monitor is NOT an stable interface, this means that command
2004 names, arguments and responses can change or be removed at ANY time.
2005 Applications that rely on long term stability guarantees should NOT
2006 use this command
2007
2008 (2) Limitations:
2009
2010 o This command is stateless, this means that commands that depend
2011 on state information (such as getfd) might not work
2012
2013 o Commands that prompt the user for data (eg. 'cont' when the block
2014 device is encrypted) don't currently work
2015
2016 3. Query Commands
2017 =================
2018
2019 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2020 HXCOMM this! We will possibly move query commands definitions inside those
2021 HXCOMM sections, just like regular commands.
2022
2023 EQMP
2024
2025 SQMP
2026 query-version
2027 -------------
2028
2029 Show QEMU version.
2030
2031 Return a json-object with the following information:
2032
2033 - "qemu": A json-object containing three integer values:
2034 - "major": QEMU's major version (json-int)
2035 - "minor": QEMU's minor version (json-int)
2036 - "micro": QEMU's micro version (json-int)
2037 - "package": package's version (json-string)
2038
2039 Example:
2040
2041 -> { "execute": "query-version" }
2042 <- {
2043 "return":{
2044 "qemu":{
2045 "major":0,
2046 "minor":11,
2047 "micro":5
2048 },
2049 "package":""
2050 }
2051 }
2052
2053 EQMP
2054
2055 {
2056 .name = "query-version",
2057 .args_type = "",
2058 .mhandler.cmd_new = qmp_marshal_input_query_version,
2059 },
2060
2061 SQMP
2062 query-commands
2063 --------------
2064
2065 List QMP available commands.
2066
2067 Each command is represented by a json-object, the returned value is a json-array
2068 of all commands.
2069
2070 Each json-object contain:
2071
2072 - "name": command's name (json-string)
2073
2074 Example:
2075
2076 -> { "execute": "query-commands" }
2077 <- {
2078 "return":[
2079 {
2080 "name":"query-balloon"
2081 },
2082 {
2083 "name":"system_powerdown"
2084 }
2085 ]
2086 }
2087
2088 Note: This example has been shortened as the real response is too long.
2089
2090 EQMP
2091
2092 {
2093 .name = "query-commands",
2094 .args_type = "",
2095 .mhandler.cmd_new = qmp_marshal_input_query_commands,
2096 },
2097
2098 SQMP
2099 query-events
2100 --------------
2101
2102 List QMP available events.
2103
2104 Each event is represented by a json-object, the returned value is a json-array
2105 of all events.
2106
2107 Each json-object contains:
2108
2109 - "name": event's name (json-string)
2110
2111 Example:
2112
2113 -> { "execute": "query-events" }
2114 <- {
2115 "return":[
2116 {
2117 "name":"SHUTDOWN"
2118 },
2119 {
2120 "name":"RESET"
2121 }
2122 ]
2123 }
2124
2125 Note: This example has been shortened as the real response is too long.
2126
2127 EQMP
2128
2129 {
2130 .name = "query-events",
2131 .args_type = "",
2132 .mhandler.cmd_new = qmp_marshal_input_query_events,
2133 },
2134
2135 SQMP
2136 query-chardev
2137 -------------
2138
2139 Each device is represented by a json-object. The returned value is a json-array
2140 of all devices.
2141
2142 Each json-object contain the following:
2143
2144 - "label": device's label (json-string)
2145 - "filename": device's file (json-string)
2146 - "frontend-open": open/closed state of the frontend device attached to this
2147 backend (json-bool)
2148
2149 Example:
2150
2151 -> { "execute": "query-chardev" }
2152 <- {
2153 "return": [
2154 {
2155 "label": "charchannel0",
2156 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2157 "frontend-open": false
2158 },
2159 {
2160 "label": "charmonitor",
2161 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2162 "frontend-open": true
2163 },
2164 {
2165 "label": "charserial0",
2166 "filename": "pty:/dev/pts/2",
2167 "frontend-open": true
2168 }
2169 ]
2170 }
2171
2172 EQMP
2173
2174 {
2175 .name = "query-chardev",
2176 .args_type = "",
2177 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
2178 },
2179
2180 SQMP
2181 query-chardev-backends
2182 -------------
2183
2184 List available character device backends.
2185
2186 Each backend is represented by a json-object, the returned value is a json-array
2187 of all backends.
2188
2189 Each json-object contains:
2190
2191 - "name": backend name (json-string)
2192
2193 Example:
2194
2195 -> { "execute": "query-chardev-backends" }
2196 <- {
2197 "return":[
2198 {
2199 "name":"udp"
2200 },
2201 {
2202 "name":"tcp"
2203 },
2204 {
2205 "name":"unix"
2206 },
2207 {
2208 "name":"spiceport"
2209 }
2210 ]
2211 }
2212
2213 EQMP
2214
2215 {
2216 .name = "query-chardev-backends",
2217 .args_type = "",
2218 .mhandler.cmd_new = qmp_marshal_input_query_chardev_backends,
2219 },
2220
2221 SQMP
2222 query-block
2223 -----------
2224
2225 Show the block devices.
2226
2227 Each block device information is stored in a json-object and the returned value
2228 is a json-array of all devices.
2229
2230 Each json-object contain the following:
2231
2232 - "device": device name (json-string)
2233 - "type": device type (json-string)
2234 - deprecated, retained for backward compatibility
2235 - Possible values: "unknown"
2236 - "removable": true if the device is removable, false otherwise (json-bool)
2237 - "locked": true if the device is locked, false otherwise (json-bool)
2238 - "tray_open": only present if removable, true if the device has a tray,
2239 and it is open (json-bool)
2240 - "inserted": only present if the device is inserted, it is a json-object
2241 containing the following:
2242 - "file": device file name (json-string)
2243 - "ro": true if read-only, false otherwise (json-bool)
2244 - "drv": driver format name (json-string)
2245 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2246 "file", "file", "ftp", "ftps", "host_cdrom",
2247 "host_device", "http", "https",
2248 "nbd", "parallels", "qcow", "qcow2", "raw",
2249 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2250 - "backing_file": backing file name (json-string, optional)
2251 - "backing_file_depth": number of files in the backing file chain (json-int)
2252 - "encrypted": true if encrypted, false otherwise (json-bool)
2253 - "bps": limit total bytes per second (json-int)
2254 - "bps_rd": limit read bytes per second (json-int)
2255 - "bps_wr": limit write bytes per second (json-int)
2256 - "iops": limit total I/O operations per second (json-int)
2257 - "iops_rd": limit read operations per second (json-int)
2258 - "iops_wr": limit write operations per second (json-int)
2259 - "bps_max": total max in bytes (json-int)
2260 - "bps_rd_max": read max in bytes (json-int)
2261 - "bps_wr_max": write max in bytes (json-int)
2262 - "iops_max": total I/O operations max (json-int)
2263 - "iops_rd_max": read I/O operations max (json-int)
2264 - "iops_wr_max": write I/O operations max (json-int)
2265 - "iops_size": I/O size when limiting by iops (json-int)
2266 - "detect_zeroes": detect and optimize zero writing (json-string)
2267 - Possible values: "off", "on", "unmap"
2268 - "write_threshold": write offset threshold in bytes, a event will be
2269 emitted if crossed. Zero if disabled (json-int)
2270 - "image": the detail of the image, it is a json-object containing
2271 the following:
2272 - "filename": image file name (json-string)
2273 - "format": image format (json-string)
2274 - "virtual-size": image capacity in bytes (json-int)
2275 - "dirty-flag": true if image is not cleanly closed, not present
2276 means clean (json-bool, optional)
2277 - "actual-size": actual size on disk in bytes of the image, not
2278 present when image does not support thin
2279 provision (json-int, optional)
2280 - "cluster-size": size of a cluster in bytes, not present if image
2281 format does not support it (json-int, optional)
2282 - "encrypted": true if the image is encrypted, not present means
2283 false or the image format does not support
2284 encryption (json-bool, optional)
2285 - "backing_file": backing file name, not present means no backing
2286 file is used or the image format does not
2287 support backing file chain
2288 (json-string, optional)
2289 - "full-backing-filename": full path of the backing file, not
2290 present if it equals backing_file or no
2291 backing file is used
2292 (json-string, optional)
2293 - "backing-filename-format": the format of the backing file, not
2294 present means unknown or no backing
2295 file (json-string, optional)
2296 - "snapshots": the internal snapshot info, it is an optional list
2297 of json-object containing the following:
2298 - "id": unique snapshot id (json-string)
2299 - "name": snapshot name (json-string)
2300 - "vm-state-size": size of the VM state in bytes (json-int)
2301 - "date-sec": UTC date of the snapshot in seconds (json-int)
2302 - "date-nsec": fractional part in nanoseconds to be used with
2303 date-sec (json-int)
2304 - "vm-clock-sec": VM clock relative to boot in seconds
2305 (json-int)
2306 - "vm-clock-nsec": fractional part in nanoseconds to be used
2307 with vm-clock-sec (json-int)
2308 - "backing-image": the detail of the backing image, it is an
2309 optional json-object only present when a
2310 backing image present for this image
2311
2312 - "io-status": I/O operation status, only present if the device supports it
2313 and the VM is configured to stop on errors. It's always reset
2314 to "ok" when the "cont" command is issued (json_string, optional)
2315 - Possible values: "ok", "failed", "nospace"
2316
2317 Example:
2318
2319 -> { "execute": "query-block" }
2320 <- {
2321 "return":[
2322 {
2323 "io-status": "ok",
2324 "device":"ide0-hd0",
2325 "locked":false,
2326 "removable":false,
2327 "inserted":{
2328 "ro":false,
2329 "drv":"qcow2",
2330 "encrypted":false,
2331 "file":"disks/test.qcow2",
2332 "backing_file_depth":1,
2333 "bps":1000000,
2334 "bps_rd":0,
2335 "bps_wr":0,
2336 "iops":1000000,
2337 "iops_rd":0,
2338 "iops_wr":0,
2339 "bps_max": 8000000,
2340 "bps_rd_max": 0,
2341 "bps_wr_max": 0,
2342 "iops_max": 0,
2343 "iops_rd_max": 0,
2344 "iops_wr_max": 0,
2345 "iops_size": 0,
2346 "detect_zeroes": "on",
2347 "write_threshold": 0,
2348 "image":{
2349 "filename":"disks/test.qcow2",
2350 "format":"qcow2",
2351 "virtual-size":2048000,
2352 "backing_file":"base.qcow2",
2353 "full-backing-filename":"disks/base.qcow2",
2354 "backing-filename-format:"qcow2",
2355 "snapshots":[
2356 {
2357 "id": "1",
2358 "name": "snapshot1",
2359 "vm-state-size": 0,
2360 "date-sec": 10000200,
2361 "date-nsec": 12,
2362 "vm-clock-sec": 206,
2363 "vm-clock-nsec": 30
2364 }
2365 ],
2366 "backing-image":{
2367 "filename":"disks/base.qcow2",
2368 "format":"qcow2",
2369 "virtual-size":2048000
2370 }
2371 }
2372 },
2373 "type":"unknown"
2374 },
2375 {
2376 "io-status": "ok",
2377 "device":"ide1-cd0",
2378 "locked":false,
2379 "removable":true,
2380 "type":"unknown"
2381 },
2382 {
2383 "device":"floppy0",
2384 "locked":false,
2385 "removable":true,
2386 "type":"unknown"
2387 },
2388 {
2389 "device":"sd0",
2390 "locked":false,
2391 "removable":true,
2392 "type":"unknown"
2393 }
2394 ]
2395 }
2396
2397 EQMP
2398
2399 {
2400 .name = "query-block",
2401 .args_type = "",
2402 .mhandler.cmd_new = qmp_marshal_input_query_block,
2403 },
2404
2405 SQMP
2406 query-blockstats
2407 ----------------
2408
2409 Show block device statistics.
2410
2411 Each device statistic information is stored in a json-object and the returned
2412 value is a json-array of all devices.
2413
2414 Each json-object contain the following:
2415
2416 - "device": device name (json-string)
2417 - "stats": A json-object with the statistics information, it contains:
2418 - "rd_bytes": bytes read (json-int)
2419 - "wr_bytes": bytes written (json-int)
2420 - "rd_operations": read operations (json-int)
2421 - "wr_operations": write operations (json-int)
2422 - "flush_operations": cache flush operations (json-int)
2423 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2424 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2425 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2426 - "wr_highest_offset": Highest offset of a sector written since the
2427 BlockDriverState has been opened (json-int)
2428 - "rd_merged": number of read requests that have been merged into
2429 another request (json-int)
2430 - "wr_merged": number of write requests that have been merged into
2431 another request (json-int)
2432 - "parent": Contains recursively the statistics of the underlying
2433 protocol (e.g. the host file for a qcow2 image). If there is
2434 no underlying protocol, this field is omitted
2435 (json-object, optional)
2436
2437 Example:
2438
2439 -> { "execute": "query-blockstats" }
2440 <- {
2441 "return":[
2442 {
2443 "device":"ide0-hd0",
2444 "parent":{
2445 "stats":{
2446 "wr_highest_offset":3686448128,
2447 "wr_bytes":9786368,
2448 "wr_operations":751,
2449 "rd_bytes":122567168,
2450 "rd_operations":36772
2451 "wr_total_times_ns":313253456
2452 "rd_total_times_ns":3465673657
2453 "flush_total_times_ns":49653
2454 "flush_operations":61,
2455 "rd_merged":0,
2456 "wr_merged":0
2457 }
2458 },
2459 "stats":{
2460 "wr_highest_offset":2821110784,
2461 "wr_bytes":9786368,
2462 "wr_operations":692,
2463 "rd_bytes":122739200,
2464 "rd_operations":36604
2465 "flush_operations":51,
2466 "wr_total_times_ns":313253456
2467 "rd_total_times_ns":3465673657
2468 "flush_total_times_ns":49653,
2469 "rd_merged":0,
2470 "wr_merged":0
2471 }
2472 },
2473 {
2474 "device":"ide1-cd0",
2475 "stats":{
2476 "wr_highest_offset":0,
2477 "wr_bytes":0,
2478 "wr_operations":0,
2479 "rd_bytes":0,
2480 "rd_operations":0
2481 "flush_operations":0,
2482 "wr_total_times_ns":0
2483 "rd_total_times_ns":0
2484 "flush_total_times_ns":0,
2485 "rd_merged":0,
2486 "wr_merged":0
2487 }
2488 },
2489 {
2490 "device":"floppy0",
2491 "stats":{
2492 "wr_highest_offset":0,
2493 "wr_bytes":0,
2494 "wr_operations":0,
2495 "rd_bytes":0,
2496 "rd_operations":0
2497 "flush_operations":0,
2498 "wr_total_times_ns":0
2499 "rd_total_times_ns":0
2500 "flush_total_times_ns":0,
2501 "rd_merged":0,
2502 "wr_merged":0
2503 }
2504 },
2505 {
2506 "device":"sd0",
2507 "stats":{
2508 "wr_highest_offset":0,
2509 "wr_bytes":0,
2510 "wr_operations":0,
2511 "rd_bytes":0,
2512 "rd_operations":0
2513 "flush_operations":0,
2514 "wr_total_times_ns":0
2515 "rd_total_times_ns":0
2516 "flush_total_times_ns":0,
2517 "rd_merged":0,
2518 "wr_merged":0
2519 }
2520 }
2521 ]
2522 }
2523
2524 EQMP
2525
2526 {
2527 .name = "query-blockstats",
2528 .args_type = "query-nodes:b?",
2529 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
2530 },
2531
2532 SQMP
2533 query-cpus
2534 ----------
2535
2536 Show CPU information.
2537
2538 Return a json-array. Each CPU is represented by a json-object, which contains:
2539
2540 - "CPU": CPU index (json-int)
2541 - "current": true if this is the current CPU, false otherwise (json-bool)
2542 - "halted": true if the cpu is halted, false otherwise (json-bool)
2543 - Current program counter. The key's name depends on the architecture:
2544 "pc": i386/x86_64 (json-int)
2545 "nip": PPC (json-int)
2546 "pc" and "npc": sparc (json-int)
2547 "PC": mips (json-int)
2548 - "thread_id": ID of the underlying host thread (json-int)
2549
2550 Example:
2551
2552 -> { "execute": "query-cpus" }
2553 <- {
2554 "return":[
2555 {
2556 "CPU":0,
2557 "current":true,
2558 "halted":false,
2559 "pc":3227107138
2560 "thread_id":3134
2561 },
2562 {
2563 "CPU":1,
2564 "current":false,
2565 "halted":true,
2566 "pc":7108165
2567 "thread_id":3135
2568 }
2569 ]
2570 }
2571
2572 EQMP
2573
2574 {
2575 .name = "query-cpus",
2576 .args_type = "",
2577 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
2578 },
2579
2580 SQMP
2581 query-iothreads
2582 ---------------
2583
2584 Returns a list of information about each iothread.
2585
2586 Note this list excludes the QEMU main loop thread, which is not declared
2587 using the -object iothread command-line option. It is always the main thread
2588 of the process.
2589
2590 Return a json-array. Each iothread is represented by a json-object, which contains:
2591
2592 - "id": name of iothread (json-str)
2593 - "thread-id": ID of the underlying host thread (json-int)
2594
2595 Example:
2596
2597 -> { "execute": "query-iothreads" }
2598 <- {
2599 "return":[
2600 {
2601 "id":"iothread0",
2602 "thread-id":3134
2603 },
2604 {
2605 "id":"iothread1",
2606 "thread-id":3135
2607 }
2608 ]
2609 }
2610
2611 EQMP
2612
2613 {
2614 .name = "query-iothreads",
2615 .args_type = "",
2616 .mhandler.cmd_new = qmp_marshal_input_query_iothreads,
2617 },
2618
2619 SQMP
2620 query-pci
2621 ---------
2622
2623 PCI buses and devices information.
2624
2625 The returned value is a json-array of all buses. Each bus is represented by
2626 a json-object, which has a key with a json-array of all PCI devices attached
2627 to it. Each device is represented by a json-object.
2628
2629 The bus json-object contains the following:
2630
2631 - "bus": bus number (json-int)
2632 - "devices": a json-array of json-objects, each json-object represents a
2633 PCI device
2634
2635 The PCI device json-object contains the following:
2636
2637 - "bus": identical to the parent's bus number (json-int)
2638 - "slot": slot number (json-int)
2639 - "function": function number (json-int)
2640 - "class_info": a json-object containing:
2641 - "desc": device class description (json-string, optional)
2642 - "class": device class number (json-int)
2643 - "id": a json-object containing:
2644 - "device": device ID (json-int)
2645 - "vendor": vendor ID (json-int)
2646 - "irq": device's IRQ if assigned (json-int, optional)
2647 - "qdev_id": qdev id string (json-string)
2648 - "pci_bridge": It's a json-object, only present if this device is a
2649 PCI bridge, contains:
2650 - "bus": bus number (json-int)
2651 - "secondary": secondary bus number (json-int)
2652 - "subordinate": subordinate bus number (json-int)
2653 - "io_range": I/O memory range information, a json-object with the
2654 following members:
2655 - "base": base address, in bytes (json-int)
2656 - "limit": limit address, in bytes (json-int)
2657 - "memory_range": memory range information, a json-object with the
2658 following members:
2659 - "base": base address, in bytes (json-int)
2660 - "limit": limit address, in bytes (json-int)
2661 - "prefetchable_range": Prefetchable memory range information, a
2662 json-object with the following members:
2663 - "base": base address, in bytes (json-int)
2664 - "limit": limit address, in bytes (json-int)
2665 - "devices": a json-array of PCI devices if there's any attached, each
2666 each element is represented by a json-object, which contains
2667 the same members of the 'PCI device json-object' described
2668 above (optional)
2669 - "regions": a json-array of json-objects, each json-object represents a
2670 memory region of this device
2671
2672 The memory range json-object contains the following:
2673
2674 - "base": base memory address (json-int)
2675 - "limit": limit value (json-int)
2676
2677 The region json-object can be an I/O region or a memory region, an I/O region
2678 json-object contains the following:
2679
2680 - "type": "io" (json-string, fixed)
2681 - "bar": BAR number (json-int)
2682 - "address": memory address (json-int)
2683 - "size": memory size (json-int)
2684
2685 A memory region json-object contains the following:
2686
2687 - "type": "memory" (json-string, fixed)
2688 - "bar": BAR number (json-int)
2689 - "address": memory address (json-int)
2690 - "size": memory size (json-int)
2691 - "mem_type_64": true or false (json-bool)
2692 - "prefetch": true or false (json-bool)
2693
2694 Example:
2695
2696 -> { "execute": "query-pci" }
2697 <- {
2698 "return":[
2699 {
2700 "bus":0,
2701 "devices":[
2702 {
2703 "bus":0,
2704 "qdev_id":"",
2705 "slot":0,
2706 "class_info":{
2707 "class":1536,
2708 "desc":"Host bridge"
2709 },
2710 "id":{
2711 "device":32902,
2712 "vendor":4663
2713 },
2714 "function":0,
2715 "regions":[
2716
2717 ]
2718 },
2719 {
2720 "bus":0,
2721 "qdev_id":"",
2722 "slot":1,
2723 "class_info":{
2724 "class":1537,
2725 "desc":"ISA bridge"
2726 },
2727 "id":{
2728 "device":32902,
2729 "vendor":28672
2730 },
2731 "function":0,
2732 "regions":[
2733
2734 ]
2735 },
2736 {
2737 "bus":0,
2738 "qdev_id":"",
2739 "slot":1,
2740 "class_info":{
2741 "class":257,
2742 "desc":"IDE controller"
2743 },
2744 "id":{
2745 "device":32902,
2746 "vendor":28688
2747 },
2748 "function":1,
2749 "regions":[
2750 {
2751 "bar":4,
2752 "size":16,
2753 "address":49152,
2754 "type":"io"
2755 }
2756 ]
2757 },
2758 {
2759 "bus":0,
2760 "qdev_id":"",
2761 "slot":2,
2762 "class_info":{
2763 "class":768,
2764 "desc":"VGA controller"
2765 },
2766 "id":{
2767 "device":4115,
2768 "vendor":184
2769 },
2770 "function":0,
2771 "regions":[
2772 {
2773 "prefetch":true,
2774 "mem_type_64":false,
2775 "bar":0,
2776 "size":33554432,
2777 "address":4026531840,
2778 "type":"memory"
2779 },
2780 {
2781 "prefetch":false,
2782 "mem_type_64":false,
2783 "bar":1,
2784 "size":4096,
2785 "address":4060086272,
2786 "type":"memory"
2787 },
2788 {
2789 "prefetch":false,
2790 "mem_type_64":false,
2791 "bar":6,
2792 "size":65536,
2793 "address":-1,
2794 "type":"memory"
2795 }
2796 ]
2797 },
2798 {
2799 "bus":0,
2800 "qdev_id":"",
2801 "irq":11,
2802 "slot":4,
2803 "class_info":{
2804 "class":1280,
2805 "desc":"RAM controller"
2806 },
2807 "id":{
2808 "device":6900,
2809 "vendor":4098
2810 },
2811 "function":0,
2812 "regions":[
2813 {
2814 "bar":0,
2815 "size":32,
2816 "address":49280,
2817 "type":"io"
2818 }
2819 ]
2820 }
2821 ]
2822 }
2823 ]
2824 }
2825
2826 Note: This example has been shortened as the real response is too long.
2827
2828 EQMP
2829
2830 {
2831 .name = "query-pci",
2832 .args_type = "",
2833 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2834 },
2835
2836 SQMP
2837 query-kvm
2838 ---------
2839
2840 Show KVM information.
2841
2842 Return a json-object with the following information:
2843
2844 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2845 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2846
2847 Example:
2848
2849 -> { "execute": "query-kvm" }
2850 <- { "return": { "enabled": true, "present": true } }
2851
2852 EQMP
2853
2854 {
2855 .name = "query-kvm",
2856 .args_type = "",
2857 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2858 },
2859
2860 SQMP
2861 query-status
2862 ------------
2863
2864 Return a json-object with the following information:
2865
2866 - "running": true if the VM is running, or false if it is paused (json-bool)
2867 - "singlestep": true if the VM is in single step mode,
2868 false otherwise (json-bool)
2869 - "status": one of the following values (json-string)
2870 "debug" - QEMU is running on a debugger
2871 "inmigrate" - guest is paused waiting for an incoming migration
2872 "internal-error" - An internal error that prevents further guest
2873 execution has occurred
2874 "io-error" - the last IOP has failed and the device is configured
2875 to pause on I/O errors
2876 "paused" - guest has been paused via the 'stop' command
2877 "postmigrate" - guest is paused following a successful 'migrate'
2878 "prelaunch" - QEMU was started with -S and guest has not started
2879 "finish-migrate" - guest is paused to finish the migration process
2880 "restore-vm" - guest is paused to restore VM state
2881 "running" - guest is actively running
2882 "save-vm" - guest is paused to save the VM state
2883 "shutdown" - guest is shut down (and -no-shutdown is in use)
2884 "watchdog" - the watchdog action is configured to pause and
2885 has been triggered
2886
2887 Example:
2888
2889 -> { "execute": "query-status" }
2890 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2891
2892 EQMP
2893
2894 {
2895 .name = "query-status",
2896 .args_type = "",
2897 .mhandler.cmd_new = qmp_marshal_input_query_status,
2898 },
2899
2900 SQMP
2901 query-mice
2902 ----------
2903
2904 Show VM mice information.
2905
2906 Each mouse is represented by a json-object, the returned value is a json-array
2907 of all mice.
2908
2909 The mouse json-object contains the following:
2910
2911 - "name": mouse's name (json-string)
2912 - "index": mouse's index (json-int)
2913 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2914 - "absolute": true if the mouse generates absolute input events (json-bool)
2915
2916 Example:
2917
2918 -> { "execute": "query-mice" }
2919 <- {
2920 "return":[
2921 {
2922 "name":"QEMU Microsoft Mouse",
2923 "index":0,
2924 "current":false,
2925 "absolute":false
2926 },
2927 {
2928 "name":"QEMU PS/2 Mouse",
2929 "index":1,
2930 "current":true,
2931 "absolute":true
2932 }
2933 ]
2934 }
2935
2936 EQMP
2937
2938 {
2939 .name = "query-mice",
2940 .args_type = "",
2941 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2942 },
2943
2944 SQMP
2945 query-vnc
2946 ---------
2947
2948 Show VNC server information.
2949
2950 Return a json-object with server information. Connected clients are returned
2951 as a json-array of json-objects.
2952
2953 The main json-object contains the following:
2954
2955 - "enabled": true or false (json-bool)
2956 - "host": server's IP address (json-string)
2957 - "family": address family (json-string)
2958 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2959 - "service": server's port number (json-string)
2960 - "auth": authentication method (json-string)
2961 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2962 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2963 "vencrypt+plain", "vencrypt+tls+none",
2964 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2965 "vencrypt+tls+vnc", "vencrypt+x509+none",
2966 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2967 "vencrypt+x509+vnc", "vnc"
2968 - "clients": a json-array of all connected clients
2969
2970 Clients are described by a json-object, each one contain the following:
2971
2972 - "host": client's IP address (json-string)
2973 - "family": address family (json-string)
2974 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2975 - "service": client's port number (json-string)
2976 - "x509_dname": TLS dname (json-string, optional)
2977 - "sasl_username": SASL username (json-string, optional)
2978
2979 Example:
2980
2981 -> { "execute": "query-vnc" }
2982 <- {
2983 "return":{
2984 "enabled":true,
2985 "host":"0.0.0.0",
2986 "service":"50402",
2987 "auth":"vnc",
2988 "family":"ipv4",
2989 "clients":[
2990 {
2991 "host":"127.0.0.1",
2992 "service":"50401",
2993 "family":"ipv4"
2994 }
2995 ]
2996 }
2997 }
2998
2999 EQMP
3000
3001 {
3002 .name = "query-vnc",
3003 .args_type = "",
3004 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
3005 },
3006 {
3007 .name = "query-vnc-servers",
3008 .args_type = "",
3009 .mhandler.cmd_new = qmp_marshal_input_query_vnc_servers,
3010 },
3011
3012 SQMP
3013 query-spice
3014 -----------
3015
3016 Show SPICE server information.
3017
3018 Return a json-object with server information. Connected clients are returned
3019 as a json-array of json-objects.
3020
3021 The main json-object contains the following:
3022
3023 - "enabled": true or false (json-bool)
3024 - "host": server's IP address (json-string)
3025 - "port": server's port number (json-int, optional)
3026 - "tls-port": server's port number (json-int, optional)
3027 - "auth": authentication method (json-string)
3028 - Possible values: "none", "spice"
3029 - "channels": a json-array of all active channels clients
3030
3031 Channels are described by a json-object, each one contain the following:
3032
3033 - "host": client's IP address (json-string)
3034 - "family": address family (json-string)
3035 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3036 - "port": client's port number (json-string)
3037 - "connection-id": spice connection id. All channels with the same id
3038 belong to the same spice session (json-int)
3039 - "channel-type": channel type. "1" is the main control channel, filter for
3040 this one if you want track spice sessions only (json-int)
3041 - "channel-id": channel id. Usually "0", might be different needed when
3042 multiple channels of the same type exist, such as multiple
3043 display channels in a multihead setup (json-int)
3044 - "tls": whether the channel is encrypted (json-bool)
3045
3046 Example:
3047
3048 -> { "execute": "query-spice" }
3049 <- {
3050 "return": {
3051 "enabled": true,
3052 "auth": "spice",
3053 "port": 5920,
3054 "tls-port": 5921,
3055 "host": "0.0.0.0",
3056 "channels": [
3057 {
3058 "port": "54924",
3059 "family": "ipv4",
3060 "channel-type": 1,
3061 "connection-id": 1804289383,
3062 "host": "127.0.0.1",
3063 "channel-id": 0,
3064 "tls": true
3065 },
3066 {
3067 "port": "36710",
3068 "family": "ipv4",
3069 "channel-type": 4,
3070 "connection-id": 1804289383,
3071 "host": "127.0.0.1",
3072 "channel-id": 0,
3073 "tls": false
3074 },
3075 [ ... more channels follow ... ]
3076 ]
3077 }
3078 }
3079
3080 EQMP
3081
3082 #if defined(CONFIG_SPICE)
3083 {
3084 .name = "query-spice",
3085 .args_type = "",
3086 .mhandler.cmd_new = qmp_marshal_input_query_spice,
3087 },
3088 #endif
3089
3090 SQMP
3091 query-name
3092 ----------
3093
3094 Show VM name.
3095
3096 Return a json-object with the following information:
3097
3098 - "name": VM's name (json-string, optional)
3099
3100 Example:
3101
3102 -> { "execute": "query-name" }
3103 <- { "return": { "name": "qemu-name" } }
3104
3105 EQMP
3106
3107 {
3108 .name = "query-name",
3109 .args_type = "",
3110 .mhandler.cmd_new = qmp_marshal_input_query_name,
3111 },
3112
3113 SQMP
3114 query-uuid
3115 ----------
3116
3117 Show VM UUID.
3118
3119 Return a json-object with the following information:
3120
3121 - "UUID": Universally Unique Identifier (json-string)
3122
3123 Example:
3124
3125 -> { "execute": "query-uuid" }
3126 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3127
3128 EQMP
3129
3130 {
3131 .name = "query-uuid",
3132 .args_type = "",
3133 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
3134 },
3135
3136 SQMP
3137 query-command-line-options
3138 --------------------------
3139
3140 Show command line option schema.
3141
3142 Return a json-array of command line option schema for all options (or for
3143 the given option), returning an error if the given option doesn't exist.
3144
3145 Each array entry contains the following:
3146
3147 - "option": option name (json-string)
3148 - "parameters": a json-array describes all parameters of the option:
3149 - "name": parameter name (json-string)
3150 - "type": parameter type (one of 'string', 'boolean', 'number',
3151 or 'size')
3152 - "help": human readable description of the parameter
3153 (json-string, optional)
3154 - "default": default value string for the parameter
3155 (json-string, optional)
3156
3157 Example:
3158
3159 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3160 <- { "return": [
3161 {
3162 "parameters": [
3163 {
3164 "name": "romfile",
3165 "type": "string"
3166 },
3167 {
3168 "name": "bootindex",
3169 "type": "number"
3170 }
3171 ],
3172 "option": "option-rom"
3173 }
3174 ]
3175 }
3176
3177 EQMP
3178
3179 {
3180 .name = "query-command-line-options",
3181 .args_type = "option:s?",
3182 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
3183 },
3184
3185 SQMP
3186 query-migrate
3187 -------------
3188
3189 Migration status.
3190
3191 Return a json-object. If migration is active there will be another json-object
3192 with RAM migration status and if block migration is active another one with
3193 block migration status.
3194
3195 The main json-object contains the following:
3196
3197 - "status": migration status (json-string)
3198 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3199 - "total-time": total amount of ms since migration started. If
3200 migration has ended, it returns the total migration
3201 time (json-int)
3202 - "setup-time" amount of setup time in milliseconds _before_ the
3203 iterations begin but _after_ the QMP command is issued.
3204 This is designed to provide an accounting of any activities
3205 (such as RDMA pinning) which may be expensive, but do not
3206 actually occur during the iterative migration rounds
3207 themselves. (json-int)
3208 - "downtime": only present when migration has finished correctly
3209 total amount in ms for downtime that happened (json-int)
3210 - "expected-downtime": only present while migration is active
3211 total amount in ms for downtime that was calculated on
3212 the last bitmap round (json-int)
3213 - "ram": only present if "status" is "active", it is a json-object with the
3214 following RAM information:
3215 - "transferred": amount transferred in bytes (json-int)
3216 - "remaining": amount remaining to transfer in bytes (json-int)
3217 - "total": total amount of memory in bytes (json-int)
3218 - "duplicate": number of pages filled entirely with the same
3219 byte (json-int)
3220 These are sent over the wire much more efficiently.
3221 - "skipped": number of skipped zero pages (json-int)
3222 - "normal" : number of whole pages transferred. I.e. they
3223 were not sent as duplicate or xbzrle pages (json-int)
3224 - "normal-bytes" : number of bytes transferred in whole
3225 pages. This is just normal pages times size of one page,
3226 but this way upper levels don't need to care about page
3227 size (json-int)
3228 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3229 - "disk": only present if "status" is "active" and it is a block migration,
3230 it is a json-object with the following disk information:
3231 - "transferred": amount transferred in bytes (json-int)
3232 - "remaining": amount remaining to transfer in bytes json-int)
3233 - "total": total disk size in bytes (json-int)
3234 - "xbzrle-cache": only present if XBZRLE is active.
3235 It is a json-object with the following XBZRLE information:
3236 - "cache-size": XBZRLE cache size in bytes
3237 - "bytes": number of bytes transferred for XBZRLE compressed pages
3238 - "pages": number of XBZRLE compressed pages
3239 - "cache-miss": number of XBRZRLE page cache misses
3240 - "cache-miss-rate": rate of XBRZRLE page cache misses
3241 - "overflow": number of times XBZRLE overflows. This means
3242 that the XBZRLE encoding was bigger than just sent the
3243 whole page, and then we sent the whole page instead (as as
3244 normal page).
3245
3246 Examples:
3247
3248 1. Before the first migration
3249
3250 -> { "execute": "query-migrate" }
3251 <- { "return": {} }
3252
3253 2. Migration is done and has succeeded
3254
3255 -> { "execute": "query-migrate" }
3256 <- { "return": {
3257 "status": "completed",
3258 "ram":{
3259 "transferred":123,
3260 "remaining":123,
3261 "total":246,
3262 "total-time":12345,
3263 "setup-time":12345,
3264 "downtime":12345,
3265 "duplicate":123,
3266 "normal":123,
3267 "normal-bytes":123456,
3268 "dirty-sync-count":15
3269 }
3270 }
3271 }
3272
3273 3. Migration is done and has failed
3274
3275 -> { "execute": "query-migrate" }
3276 <- { "return": { "status": "failed" } }
3277
3278 4. Migration is being performed and is not a block migration:
3279
3280 -> { "execute": "query-migrate" }
3281 <- {
3282 "return":{
3283 "status":"active",
3284 "ram":{
3285 "transferred":123,
3286 "remaining":123,
3287 "total":246,
3288 "total-time":12345,
3289 "setup-time":12345,
3290 "expected-downtime":12345,
3291 "duplicate":123,
3292 "normal":123,
3293 "normal-bytes":123456,
3294 "dirty-sync-count":15
3295 }
3296 }
3297 }
3298
3299 5. Migration is being performed and is a block migration:
3300
3301 -> { "execute": "query-migrate" }
3302 <- {
3303 "return":{
3304 "status":"active",
3305 "ram":{
3306 "total":1057024,
3307 "remaining":1053304,
3308 "transferred":3720,
3309 "total-time":12345,
3310 "setup-time":12345,
3311 "expected-downtime":12345,
3312 "duplicate":123,
3313 "normal":123,
3314 "normal-bytes":123456,
3315 "dirty-sync-count":15
3316 },
3317 "disk":{
3318 "total":20971520,
3319 "remaining":20880384,
3320 "transferred":91136
3321 }
3322 }
3323 }
3324
3325 6. Migration is being performed and XBZRLE is active:
3326
3327 -> { "execute": "query-migrate" }
3328 <- {
3329 "return":{
3330 "status":"active",
3331 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3332 "ram":{
3333 "total":1057024,
3334 "remaining":1053304,
3335 "transferred":3720,
3336 "total-time":12345,
3337 "setup-time":12345,
3338 "expected-downtime":12345,
3339 "duplicate":10,
3340 "normal":3333,
3341 "normal-bytes":3412992,
3342 "dirty-sync-count":15
3343 },
3344 "xbzrle-cache":{
3345 "cache-size":67108864,
3346 "bytes":20971520,
3347 "pages":2444343,
3348 "cache-miss":2244,
3349 "cache-miss-rate":0.123,
3350 "overflow":34434
3351 }
3352 }
3353 }
3354
3355 EQMP
3356
3357 {
3358 .name = "query-migrate",
3359 .args_type = "",
3360 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
3361 },
3362
3363 SQMP
3364 migrate-set-capabilities
3365 ------------------------
3366
3367 Enable/Disable migration capabilities
3368
3369 - "xbzrle": XBZRLE support
3370 - "rdma-pin-all": pin all pages when using RDMA during migration
3371 - "auto-converge": throttle down guest to help convergence of migration
3372 - "zero-blocks": compress zero blocks during block migration
3373
3374 Arguments:
3375
3376 Example:
3377
3378 -> { "execute": "migrate-set-capabilities" , "arguments":
3379 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3380
3381 EQMP
3382
3383 {
3384 .name = "migrate-set-capabilities",
3385 .args_type = "capabilities:q",
3386 .params = "capability:s,state:b",
3387 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
3388 },
3389 SQMP
3390 query-migrate-capabilities
3391 --------------------------
3392
3393 Query current migration capabilities
3394
3395 - "capabilities": migration capabilities state
3396 - "xbzrle" : XBZRLE state (json-bool)
3397 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3398 - "auto-converge" : Auto Converge state (json-bool)
3399 - "zero-blocks" : Zero Blocks state (json-bool)
3400
3401 Arguments:
3402
3403 Example:
3404
3405 -> { "execute": "query-migrate-capabilities" }
3406 <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3407
3408 EQMP
3409
3410 {
3411 .name = "query-migrate-capabilities",
3412 .args_type = "",
3413 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
3414 },
3415
3416 SQMP
3417 query-balloon
3418 -------------
3419
3420 Show balloon information.
3421
3422 Make an asynchronous request for balloon info. When the request completes a
3423 json-object will be returned containing the following data:
3424
3425 - "actual": current balloon value in bytes (json-int)
3426
3427 Example:
3428
3429 -> { "execute": "query-balloon" }
3430 <- {
3431 "return":{
3432 "actual":1073741824,
3433 }
3434 }
3435
3436 EQMP
3437
3438 {
3439 .name = "query-balloon",
3440 .args_type = "",
3441 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
3442 },
3443
3444 {
3445 .name = "query-block-jobs",
3446 .args_type = "",
3447 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
3448 },
3449
3450 {
3451 .name = "qom-list",
3452 .args_type = "path:s",
3453 .mhandler.cmd_new = qmp_marshal_input_qom_list,
3454 },
3455
3456 {
3457 .name = "qom-set",
3458 .args_type = "path:s,property:s,value:q",
3459 .mhandler.cmd_new = qmp_qom_set,
3460 },
3461
3462 {
3463 .name = "qom-get",
3464 .args_type = "path:s,property:s",
3465 .mhandler.cmd_new = qmp_qom_get,
3466 },
3467
3468 {
3469 .name = "nbd-server-start",
3470 .args_type = "addr:q",
3471 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
3472 },
3473 {
3474 .name = "nbd-server-add",
3475 .args_type = "device:B,writable:b?",
3476 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
3477 },
3478 {
3479 .name = "nbd-server-stop",
3480 .args_type = "",
3481 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
3482 },
3483
3484 {
3485 .name = "change-vnc-password",
3486 .args_type = "password:s",
3487 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
3488 },
3489 {
3490 .name = "qom-list-types",
3491 .args_type = "implements:s?,abstract:b?",
3492 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
3493 },
3494
3495 {
3496 .name = "device-list-properties",
3497 .args_type = "typename:s",
3498 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
3499 },
3500
3501 {
3502 .name = "query-machines",
3503 .args_type = "",
3504 .mhandler.cmd_new = qmp_marshal_input_query_machines,
3505 },
3506
3507 {
3508 .name = "query-cpu-definitions",
3509 .args_type = "",
3510 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
3511 },
3512
3513 {
3514 .name = "query-target",
3515 .args_type = "",
3516 .mhandler.cmd_new = qmp_marshal_input_query_target,
3517 },
3518
3519 {
3520 .name = "query-tpm",
3521 .args_type = "",
3522 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
3523 },
3524
3525 SQMP
3526 query-tpm
3527 ---------
3528
3529 Return information about the TPM device.
3530
3531 Arguments: None
3532
3533 Example:
3534
3535 -> { "execute": "query-tpm" }
3536 <- { "return":
3537 [
3538 { "model": "tpm-tis",
3539 "options":
3540 { "type": "passthrough",
3541 "data":
3542 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3543 "path": "/dev/tpm0"
3544 }
3545 },
3546 "id": "tpm0"
3547 }
3548 ]
3549 }
3550
3551 EQMP
3552
3553 {
3554 .name = "query-tpm-models",
3555 .args_type = "",
3556 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
3557 },
3558
3559 SQMP
3560 query-tpm-models
3561 ----------------
3562
3563 Return a list of supported TPM models.
3564
3565 Arguments: None
3566
3567 Example:
3568
3569 -> { "execute": "query-tpm-models" }
3570 <- { "return": [ "tpm-tis" ] }
3571
3572 EQMP
3573
3574 {
3575 .name = "query-tpm-types",
3576 .args_type = "",
3577 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
3578 },
3579
3580 SQMP
3581 query-tpm-types
3582 ---------------
3583
3584 Return a list of supported TPM types.
3585
3586 Arguments: None
3587
3588 Example:
3589
3590 -> { "execute": "query-tpm-types" }
3591 <- { "return": [ "passthrough" ] }
3592
3593 EQMP
3594
3595 {
3596 .name = "chardev-add",
3597 .args_type = "id:s,backend:q",
3598 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
3599 },
3600
3601 SQMP
3602 chardev-add
3603 ----------------
3604
3605 Add a chardev.
3606
3607 Arguments:
3608
3609 - "id": the chardev's ID, must be unique (json-string)
3610 - "backend": chardev backend type + parameters
3611
3612 Examples:
3613
3614 -> { "execute" : "chardev-add",
3615 "arguments" : { "id" : "foo",
3616 "backend" : { "type" : "null", "data" : {} } } }
3617 <- { "return": {} }
3618
3619 -> { "execute" : "chardev-add",
3620 "arguments" : { "id" : "bar",
3621 "backend" : { "type" : "file",
3622 "data" : { "out" : "/tmp/bar.log" } } } }
3623 <- { "return": {} }
3624
3625 -> { "execute" : "chardev-add",
3626 "arguments" : { "id" : "baz",
3627 "backend" : { "type" : "pty", "data" : {} } } }
3628 <- { "return": { "pty" : "/dev/pty/42" } }
3629
3630 EQMP
3631
3632 {
3633 .name = "chardev-remove",
3634 .args_type = "id:s",
3635 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3636 },
3637
3638
3639 SQMP
3640 chardev-remove
3641 --------------
3642
3643 Remove a chardev.
3644
3645 Arguments:
3646
3647 - "id": the chardev's ID, must exist and not be in use (json-string)
3648
3649 Example:
3650
3651 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3652 <- { "return": {} }
3653
3654 EQMP
3655 {
3656 .name = "query-rx-filter",
3657 .args_type = "name:s?",
3658 .mhandler.cmd_new = qmp_marshal_input_query_rx_filter,
3659 },
3660
3661 SQMP
3662 query-rx-filter
3663 ---------------
3664
3665 Show rx-filter information.
3666
3667 Returns a json-array of rx-filter information for all NICs (or for the
3668 given NIC), returning an error if the given NIC doesn't exist, or
3669 given NIC doesn't support rx-filter querying, or given net client
3670 isn't a NIC.
3671
3672 The query will clear the event notification flag of each NIC, then qemu
3673 will start to emit event to QMP monitor.
3674
3675 Each array entry contains the following:
3676
3677 - "name": net client name (json-string)
3678 - "promiscuous": promiscuous mode is enabled (json-bool)
3679 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
3680 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
3681 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
3682 - "broadcast-allowed": allow to receive broadcast (json-bool)
3683 - "multicast-overflow": multicast table is overflowed (json-bool)
3684 - "unicast-overflow": unicast table is overflowed (json-bool)
3685 - "main-mac": main macaddr string (json-string)
3686 - "vlan-table": a json-array of active vlan id
3687 - "unicast-table": a json-array of unicast macaddr string
3688 - "multicast-table": a json-array of multicast macaddr string
3689
3690 Example:
3691
3692 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3693 <- { "return": [
3694 {
3695 "promiscuous": true,
3696 "name": "vnet0",
3697 "main-mac": "52:54:00:12:34:56",
3698 "unicast": "normal",
3699 "vlan": "normal",
3700 "vlan-table": [
3701 4,
3702 0
3703 ],
3704 "unicast-table": [
3705 ],
3706 "multicast": "normal",
3707 "multicast-overflow": false,
3708 "unicast-overflow": false,
3709 "multicast-table": [
3710 "01:00:5e:00:00:01",
3711 "33:33:00:00:00:01",
3712 "33:33:ff:12:34:56"
3713 ],
3714 "broadcast-allowed": false
3715 }
3716 ]
3717 }
3718
3719 EQMP
3720
3721 {
3722 .name = "blockdev-add",
3723 .args_type = "options:q",
3724 .mhandler.cmd_new = qmp_marshal_input_blockdev_add,
3725 },
3726
3727 SQMP
3728 blockdev-add
3729 ------------
3730
3731 Add a block device.
3732
3733 This command is still a work in progress. It doesn't support all
3734 block drivers, it lacks a matching blockdev-del, and more. Stay away
3735 from it unless you want to help with its development.
3736
3737 Arguments:
3738
3739 - "options": block driver options
3740
3741 Example (1):
3742
3743 -> { "execute": "blockdev-add",
3744 "arguments": { "options" : { "driver": "qcow2",
3745 "file": { "driver": "file",
3746 "filename": "test.qcow2" } } } }
3747 <- { "return": {} }
3748
3749 Example (2):
3750
3751 -> { "execute": "blockdev-add",
3752 "arguments": {
3753 "options": {
3754 "driver": "qcow2",
3755 "id": "my_disk",
3756 "discard": "unmap",
3757 "cache": {
3758 "direct": true,
3759 "writeback": true
3760 },
3761 "file": {
3762 "driver": "file",
3763 "filename": "/tmp/test.qcow2"
3764 },
3765 "backing": {
3766 "driver": "raw",
3767 "file": {
3768 "driver": "file",
3769 "filename": "/dev/fdset/4"
3770 }
3771 }
3772 }
3773 }
3774 }
3775
3776 <- { "return": {} }
3777
3778 EQMP
3779
3780 {
3781 .name = "query-named-block-nodes",
3782 .args_type = "",
3783 .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes,
3784 },
3785
3786 SQMP
3787 @query-named-block-nodes
3788 ------------------------
3789
3790 Return a list of BlockDeviceInfo for all the named block driver nodes
3791
3792 Example:
3793
3794 -> { "execute": "query-named-block-nodes" }
3795 <- { "return": [ { "ro":false,
3796 "drv":"qcow2",
3797 "encrypted":false,
3798 "file":"disks/test.qcow2",
3799 "node-name": "my-node",
3800 "backing_file_depth":1,
3801 "bps":1000000,
3802 "bps_rd":0,
3803 "bps_wr":0,
3804 "iops":1000000,
3805 "iops_rd":0,
3806 "iops_wr":0,
3807 "bps_max": 8000000,
3808 "bps_rd_max": 0,
3809 "bps_wr_max": 0,
3810 "iops_max": 0,
3811 "iops_rd_max": 0,
3812 "iops_wr_max": 0,
3813 "iops_size": 0,
3814 "write_threshold": 0,
3815 "image":{
3816 "filename":"disks/test.qcow2",
3817 "format":"qcow2",
3818 "virtual-size":2048000,
3819 "backing_file":"base.qcow2",
3820 "full-backing-filename":"disks/base.qcow2",
3821 "backing-filename-format:"qcow2",
3822 "snapshots":[
3823 {
3824 "id": "1",
3825 "name": "snapshot1",
3826 "vm-state-size": 0,
3827 "date-sec": 10000200,
3828 "date-nsec": 12,
3829 "vm-clock-sec": 206,
3830 "vm-clock-nsec": 30
3831 }
3832 ],
3833 "backing-image":{
3834 "filename":"disks/base.qcow2",
3835 "format":"qcow2",
3836 "virtual-size":2048000
3837 }
3838 } } ] }
3839
3840 EQMP
3841
3842 {
3843 .name = "query-memdev",
3844 .args_type = "",
3845 .mhandler.cmd_new = qmp_marshal_input_query_memdev,
3846 },
3847
3848 SQMP
3849 query-memdev
3850 ------------
3851
3852 Show memory devices information.
3853
3854
3855 Example (1):
3856
3857 -> { "execute": "query-memdev" }
3858 <- { "return": [
3859 {
3860 "size": 536870912,
3861 "merge": false,
3862 "dump": true,
3863 "prealloc": false,
3864 "host-nodes": [0, 1],
3865 "policy": "bind"
3866 },
3867 {
3868 "size": 536870912,
3869 "merge": false,
3870 "dump": true,
3871 "prealloc": true,
3872 "host-nodes": [2, 3],
3873 "policy": "preferred"
3874 }
3875 ]
3876 }
3877
3878 EQMP
3879
3880 {
3881 .name = "query-memory-devices",
3882 .args_type = "",
3883 .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
3884 },
3885
3886 SQMP
3887 @query-memory-devices
3888 --------------------
3889
3890 Return a list of memory devices.
3891
3892 Example:
3893 -> { "execute": "query-memory-devices" }
3894 <- { "return": [ { "data":
3895 { "addr": 5368709120,
3896 "hotpluggable": true,
3897 "hotplugged": true,
3898 "id": "d1",
3899 "memdev": "/objects/memX",
3900 "node": 0,
3901 "size": 1073741824,
3902 "slot": 0},
3903 "type": "dimm"
3904 } ] }
3905 EQMP
3906
3907 {
3908 .name = "query-acpi-ospm-status",
3909 .args_type = "",
3910 .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
3911 },
3912
3913 SQMP
3914 @query-acpi-ospm-status
3915 --------------------
3916
3917 Return list of ACPIOSTInfo for devices that support status reporting
3918 via ACPI _OST method.
3919
3920 Example:
3921 -> { "execute": "query-acpi-ospm-status" }
3922 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3923 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3924 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3925 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3926 ]}
3927 EQMP
3928
3929 #if defined TARGET_I386
3930 {
3931 .name = "rtc-reset-reinjection",
3932 .args_type = "",
3933 .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
3934 },
3935 #endif
3936
3937 SQMP
3938 rtc-reset-reinjection
3939 ---------------------
3940
3941 Reset the RTC interrupt reinjection backlog.
3942
3943 Arguments: None.
3944
3945 Example:
3946
3947 -> { "execute": "rtc-reset-reinjection" }
3948 <- { "return": {} }
3949 EQMP
3950
3951 {
3952 .name = "trace-event-get-state",
3953 .args_type = "name:s",
3954 .mhandler.cmd_new = qmp_marshal_input_trace_event_get_state,
3955 },
3956
3957 SQMP
3958 trace-event-get-state
3959 ---------------------
3960
3961 Query the state of events.
3962
3963 Example:
3964
3965 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
3966 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
3967 EQMP
3968
3969 {
3970 .name = "trace-event-set-state",
3971 .args_type = "name:s,enable:b,ignore-unavailable:b?",
3972 .mhandler.cmd_new = qmp_marshal_input_trace_event_set_state,
3973 },
3974
3975 SQMP
3976 trace-event-set-state
3977 ---------------------
3978
3979 Set the state of events.
3980
3981 Example:
3982
3983 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
3984 <- { "return": {} }
3985 EQMP
3986
3987 {
3988 .name = "x-input-send-event",
3989 .args_type = "console:i?,events:q",
3990 .mhandler.cmd_new = qmp_marshal_input_x_input_send_event,
3991 },
3992
3993 SQMP
3994 @x-input-send-event
3995 -----------------
3996
3997 Send input event to guest.
3998
3999 Arguments:
4000
4001 - "console": console index. (json-int, optional)
4002 - "events": list of input events.
4003
4004 The consoles are visible in the qom tree, under
4005 /backend/console[$index]. They have a device link and head property, so
4006 it is possible to map which console belongs to which device and display.
4007
4008 Note: this command is experimental, and not a stable API.
4009
4010 Example (1):
4011
4012 Press left mouse button.
4013
4014 -> { "execute": "x-input-send-event",
4015 "arguments": { "console": 0,
4016 "events": [ { "type": "btn",
4017 "data" : { "down": true, "button": "Left" } } ] } }
4018 <- { "return": {} }
4019
4020 -> { "execute": "x-input-send-event",
4021 "arguments": { "console": 0,
4022 "events": [ { "type": "btn",
4023 "data" : { "down": false, "button": "Left" } } ] } }
4024 <- { "return": {} }
4025
4026 Example (2):
4027
4028 Press ctrl-alt-del.
4029
4030 -> { "execute": "x-input-send-event",
4031 "arguments": { "console": 0, "events": [
4032 { "type": "key", "data" : { "down": true,
4033 "key": {"type": "qcode", "data": "ctrl" } } },
4034 { "type": "key", "data" : { "down": true,
4035 "key": {"type": "qcode", "data": "alt" } } },
4036 { "type": "key", "data" : { "down": true,
4037 "key": {"type": "qcode", "data": "delete" } } } ] } }
4038 <- { "return": {} }
4039
4040 Example (3):
4041
4042 Move mouse pointer to absolute coordinates (20000, 400).
4043
4044 -> { "execute": "x-input-send-event" ,
4045 "arguments": { "console": 0, "events": [
4046 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
4047 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
4048 <- { "return": {} }
4049
4050 EQMP
4051
4052 {
4053 .name = "block-set-write-threshold",
4054 .args_type = "node-name:s,write-threshold:l",
4055 .mhandler.cmd_new = qmp_marshal_input_block_set_write_threshold,
4056 },
4057
4058 SQMP
4059 block-set-write-threshold
4060 ------------
4061
4062 Change the write threshold for a block drive. The threshold is an offset,
4063 thus must be non-negative. Default is no write threshold.
4064 Setting the threshold to zero disables it.
4065
4066 Arguments:
4067
4068 - "node-name": the node name in the block driver state graph (json-string)
4069 - "write-threshold": the write threshold in bytes (json-int)
4070
4071 Example:
4072
4073 -> { "execute": "block-set-write-threshold",
4074 "arguments": { "node-name": "mydev",
4075 "write-threshold": 17179869184 } }
4076 <- { "return": {} }
4077
4078 EQMP