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