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