]> git.proxmox.com Git - qemu.git/blob - qmp-commands.hx
Merge remote-tracking branch 'kwolf/for-anthony' into staging
[qemu.git] / qmp-commands.hx
1 HXCOMM QMP dispatch table and documentation
2 HXCOMM Text between SQMP and EQMP is copied to the QMP documention file and
3 HXCOMM does not show up in the other formats.
4
5 SQMP
6 QMP Supported Commands
7 ----------------------
8
9 This document describes all commands currently supported by QMP.
10
11 Most of the time their usage is exactly the same as in the user Monitor, this
12 means that any other document which also describe commands (the manpage,
13 QEMU's manual, etc) can and should be consulted.
14
15 QMP has two types of commands: regular and query commands. Regular commands
16 usually change the Virtual Machine's state someway, while query commands just
17 return information. The sections below are divided accordingly.
18
19 It's important to observe that all communication examples are formatted in
20 a reader-friendly way, so that they're easier to understand. However, in real
21 protocol usage, they're emitted as a single line.
22
23 Also, the following notation is used to denote data flow:
24
25 -> data issued by the Client
26 <- Server data response
27
28 Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed
29 information on the Server command and response formats.
30
31 NOTE: This document is temporary and will be replaced soon.
32
33 1. Stability Considerations
34 ===========================
35
36 The current QMP command set (described in this file) may be useful for a
37 number of use cases, however it's limited and several commands have bad
38 defined semantics, specially with regard to command completion.
39
40 These problems are going to be solved incrementally in the next QEMU releases
41 and we're going to establish a deprecation policy for badly defined commands.
42
43 If you're planning to adopt QMP, please observe the following:
44
45 1. The deprecation policy will take effect and be documented soon, please
46 check the documentation of each used command as soon as a new release of
47 QEMU is available
48
49 2. DO NOT rely on anything which is not explicit documented
50
51 3. Errors, in special, are not documented. Applications should NOT check
52 for specific errors classes or data (it's strongly recommended to only
53 check for the "error" key)
54
55 2. Regular Commands
56 ===================
57
58 Server's responses in the examples below are always a success response, please
59 refer to the QMP specification for more details on error responses.
60
61 EQMP
62
63 {
64 .name = "quit",
65 .args_type = "",
66 .mhandler.cmd_new = qmp_marshal_input_quit,
67 },
68
69 SQMP
70 quit
71 ----
72
73 Quit the emulator.
74
75 Arguments: None.
76
77 Example:
78
79 -> { "execute": "quit" }
80 <- { "return": {} }
81
82 EQMP
83
84 {
85 .name = "eject",
86 .args_type = "force:-f,device:B",
87 .mhandler.cmd_new = qmp_marshal_input_eject,
88 },
89
90 SQMP
91 eject
92 -----
93
94 Eject a removable medium.
95
96 Arguments:
97
98 - force: force ejection (json-bool, optional)
99 - device: device name (json-string)
100
101 Example:
102
103 -> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
104 <- { "return": {} }
105
106 Note: The "force" argument defaults to false.
107
108 EQMP
109
110 {
111 .name = "change",
112 .args_type = "device:B,target:F,arg:s?",
113 .mhandler.cmd_new = qmp_marshal_input_change,
114 },
115
116 SQMP
117 change
118 ------
119
120 Change a removable medium or VNC configuration.
121
122 Arguments:
123
124 - "device": device name (json-string)
125 - "target": filename or item (json-string)
126 - "arg": additional argument (json-string, optional)
127
128 Examples:
129
130 1. Change a removable medium
131
132 -> { "execute": "change",
133 "arguments": { "device": "ide1-cd0",
134 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
135 <- { "return": {} }
136
137 2. Change VNC password
138
139 -> { "execute": "change",
140 "arguments": { "device": "vnc", "target": "password",
141 "arg": "foobar1" } }
142 <- { "return": {} }
143
144 EQMP
145
146 {
147 .name = "screendump",
148 .args_type = "filename:F",
149 .mhandler.cmd_new = qmp_marshal_input_screendump,
150 },
151
152 SQMP
153 screendump
154 ----------
155
156 Save screen into PPM image.
157
158 Arguments:
159
160 - "filename": file path (json-string)
161
162 Example:
163
164 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
165 <- { "return": {} }
166
167 EQMP
168
169 {
170 .name = "stop",
171 .args_type = "",
172 .mhandler.cmd_new = qmp_marshal_input_stop,
173 },
174
175 SQMP
176 stop
177 ----
178
179 Stop the emulator.
180
181 Arguments: None.
182
183 Example:
184
185 -> { "execute": "stop" }
186 <- { "return": {} }
187
188 EQMP
189
190 {
191 .name = "cont",
192 .args_type = "",
193 .mhandler.cmd_new = qmp_marshal_input_cont,
194 },
195
196 SQMP
197 cont
198 ----
199
200 Resume emulation.
201
202 Arguments: None.
203
204 Example:
205
206 -> { "execute": "cont" }
207 <- { "return": {} }
208
209 EQMP
210
211 {
212 .name = "system_wakeup",
213 .args_type = "",
214 .mhandler.cmd_new = qmp_marshal_input_system_wakeup,
215 },
216
217 SQMP
218 system_wakeup
219 -------------
220
221 Wakeup guest from suspend.
222
223 Arguments: None.
224
225 Example:
226
227 -> { "execute": "system_wakeup" }
228 <- { "return": {} }
229
230 EQMP
231
232 {
233 .name = "system_reset",
234 .args_type = "",
235 .mhandler.cmd_new = qmp_marshal_input_system_reset,
236 },
237
238 SQMP
239 system_reset
240 ------------
241
242 Reset the system.
243
244 Arguments: None.
245
246 Example:
247
248 -> { "execute": "system_reset" }
249 <- { "return": {} }
250
251 EQMP
252
253 {
254 .name = "system_powerdown",
255 .args_type = "",
256 .mhandler.cmd_new = qmp_marshal_input_system_powerdown,
257 },
258
259 SQMP
260 system_powerdown
261 ----------------
262
263 Send system power down event.
264
265 Arguments: None.
266
267 Example:
268
269 -> { "execute": "system_powerdown" }
270 <- { "return": {} }
271
272 EQMP
273
274 {
275 .name = "device_add",
276 .args_type = "device:O",
277 .params = "driver[,prop=value][,...]",
278 .help = "add device, like -device on the command line",
279 .user_print = monitor_user_noop,
280 .mhandler.cmd_new = do_device_add,
281 },
282
283 SQMP
284 device_add
285 ----------
286
287 Add a device.
288
289 Arguments:
290
291 - "driver": the name of the new device's driver (json-string)
292 - "bus": the device's parent bus (device tree path, json-string, optional)
293 - "id": the device's ID, must be unique (json-string)
294 - device properties
295
296 Example:
297
298 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
299 <- { "return": {} }
300
301 Notes:
302
303 (1) For detailed information about this command, please refer to the
304 'docs/qdev-device-use.txt' file.
305
306 (2) It's possible to list device properties by running QEMU with the
307 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
308
309 EQMP
310
311 {
312 .name = "device_del",
313 .args_type = "id:s",
314 .mhandler.cmd_new = qmp_marshal_input_device_del,
315 },
316
317 SQMP
318 device_del
319 ----------
320
321 Remove a device.
322
323 Arguments:
324
325 - "id": the device's ID (json-string)
326
327 Example:
328
329 -> { "execute": "device_del", "arguments": { "id": "net1" } }
330 <- { "return": {} }
331
332 EQMP
333
334 {
335 .name = "send-key",
336 .args_type = "keys:O,hold-time:i?",
337 .mhandler.cmd_new = qmp_marshal_input_send_key,
338 },
339
340 SQMP
341 send-key
342 ----------
343
344 Send keys to VM.
345
346 Arguments:
347
348 keys array:
349 - "key": key sequence (a json-array of key enum values)
350
351 - hold-time: time to delay key up events, milliseconds. Defaults to 100
352 (json-int, optional)
353
354 Example:
355
356 -> { "execute": "send-key",
357 "arguments": { 'keys': [ 'ctrl', 'alt', 'delete' ] } }
358 <- { "return": {} }
359
360 EQMP
361
362 {
363 .name = "cpu",
364 .args_type = "index:i",
365 .mhandler.cmd_new = qmp_marshal_input_cpu,
366 },
367
368 SQMP
369 cpu
370 ---
371
372 Set the default CPU.
373
374 Arguments:
375
376 - "index": the CPU's index (json-int)
377
378 Example:
379
380 -> { "execute": "cpu", "arguments": { "index": 0 } }
381 <- { "return": {} }
382
383 Note: CPUs' indexes are obtained with the 'query-cpus' command.
384
385 EQMP
386
387 {
388 .name = "cpu-add",
389 .args_type = "id:i",
390 .mhandler.cmd_new = qmp_marshal_input_cpu_add,
391 },
392
393 SQMP
394 cpu-add
395 -------
396
397 Adds virtual cpu
398
399 Arguments:
400
401 - "id": cpu id (json-int)
402
403 Example:
404
405 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
406 <- { "return": {} }
407
408 EQMP
409
410 {
411 .name = "memsave",
412 .args_type = "val:l,size:i,filename:s,cpu:i?",
413 .mhandler.cmd_new = qmp_marshal_input_memsave,
414 },
415
416 SQMP
417 memsave
418 -------
419
420 Save to disk virtual memory dump starting at 'val' of size 'size'.
421
422 Arguments:
423
424 - "val": the starting address (json-int)
425 - "size": the memory size, in bytes (json-int)
426 - "filename": file path (json-string)
427 - "cpu": virtual CPU index (json-int, optional)
428
429 Example:
430
431 -> { "execute": "memsave",
432 "arguments": { "val": 10,
433 "size": 100,
434 "filename": "/tmp/virtual-mem-dump" } }
435 <- { "return": {} }
436
437 EQMP
438
439 {
440 .name = "pmemsave",
441 .args_type = "val:l,size:i,filename:s",
442 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
443 },
444
445 SQMP
446 pmemsave
447 --------
448
449 Save to disk physical memory dump starting at 'val' of size 'size'.
450
451 Arguments:
452
453 - "val": the starting address (json-int)
454 - "size": the memory size, in bytes (json-int)
455 - "filename": file path (json-string)
456
457 Example:
458
459 -> { "execute": "pmemsave",
460 "arguments": { "val": 10,
461 "size": 100,
462 "filename": "/tmp/physical-mem-dump" } }
463 <- { "return": {} }
464
465 EQMP
466
467 {
468 .name = "inject-nmi",
469 .args_type = "",
470 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
471 },
472
473 SQMP
474 inject-nmi
475 ----------
476
477 Inject an NMI on guest's CPUs.
478
479 Arguments: None.
480
481 Example:
482
483 -> { "execute": "inject-nmi" }
484 <- { "return": {} }
485
486 Note: inject-nmi fails when the guest doesn't support injecting.
487 Currently, only x86 guests do.
488
489 EQMP
490
491 {
492 .name = "ringbuf-write",
493 .args_type = "device:s,data:s,format:s?",
494 .mhandler.cmd_new = qmp_marshal_input_ringbuf_write,
495 },
496
497 SQMP
498 ringbuf-write
499 -------------
500
501 Write to a ring buffer character device.
502
503 Arguments:
504
505 - "device": ring buffer character device name (json-string)
506 - "data": data to write (json-string)
507 - "format": data format (json-string, optional)
508 - Possible values: "utf8" (default), "base64"
509 Bug: invalid base64 is currently not rejected.
510 Whitespace *is* invalid.
511
512 Example:
513
514 -> { "execute": "ringbuf-write",
515 "arguments": { "device": "foo",
516 "data": "abcdefgh",
517 "format": "utf8" } }
518 <- { "return": {} }
519
520 EQMP
521
522 {
523 .name = "ringbuf-read",
524 .args_type = "device:s,size:i,format:s?",
525 .mhandler.cmd_new = qmp_marshal_input_ringbuf_read,
526 },
527
528 SQMP
529 ringbuf-read
530 -------------
531
532 Read from a ring buffer character device.
533
534 Arguments:
535
536 - "device": ring buffer character device name (json-string)
537 - "size": how many bytes to read at most (json-int)
538 - Number of data bytes, not number of characters in encoded data
539 - "format": data format (json-string, optional)
540 - Possible values: "utf8" (default), "base64"
541 - Naturally, format "utf8" works only when the ring buffer
542 contains valid UTF-8 text. Invalid UTF-8 sequences get
543 replaced. Bug: replacement doesn't work. Bug: can screw
544 up on encountering NUL characters, after the ring buffer
545 lost data, and when reading stops because the size limit
546 is reached.
547
548 Example:
549
550 -> { "execute": "ringbuf-read",
551 "arguments": { "device": "foo",
552 "size": 1000,
553 "format": "utf8" } }
554 <- {"return": "abcdefgh"}
555
556 EQMP
557
558 {
559 .name = "xen-save-devices-state",
560 .args_type = "filename:F",
561 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
562 },
563
564 SQMP
565 xen-save-devices-state
566 -------
567
568 Save the state of all devices to file. The RAM and the block devices
569 of the VM are not saved by this command.
570
571 Arguments:
572
573 - "filename": the file to save the state of the devices to as binary
574 data. See xen-save-devices-state.txt for a description of the binary
575 format.
576
577 Example:
578
579 -> { "execute": "xen-save-devices-state",
580 "arguments": { "filename": "/tmp/save" } }
581 <- { "return": {} }
582
583 EQMP
584
585 {
586 .name = "xen-set-global-dirty-log",
587 .args_type = "enable:b",
588 .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
589 },
590
591 SQMP
592 xen-set-global-dirty-log
593 -------
594
595 Enable or disable the global dirty log mode.
596
597 Arguments:
598
599 - "enable": Enable it or disable it.
600
601 Example:
602
603 -> { "execute": "xen-set-global-dirty-log",
604 "arguments": { "enable": true } }
605 <- { "return": {} }
606
607 EQMP
608
609 {
610 .name = "migrate",
611 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
612 .mhandler.cmd_new = qmp_marshal_input_migrate,
613 },
614
615 SQMP
616 migrate
617 -------
618
619 Migrate to URI.
620
621 Arguments:
622
623 - "blk": block migration, full disk copy (json-bool, optional)
624 - "inc": incremental disk copy (json-bool, optional)
625 - "uri": Destination URI (json-string)
626
627 Example:
628
629 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
630 <- { "return": {} }
631
632 Notes:
633
634 (1) The 'query-migrate' command should be used to check migration's progress
635 and final result (this information is provided by the 'status' member)
636 (2) All boolean arguments default to false
637 (3) The user Monitor's "detach" argument is invalid in QMP and should not
638 be used
639
640 EQMP
641
642 {
643 .name = "migrate_cancel",
644 .args_type = "",
645 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
646 },
647
648 SQMP
649 migrate_cancel
650 --------------
651
652 Cancel the current migration.
653
654 Arguments: None.
655
656 Example:
657
658 -> { "execute": "migrate_cancel" }
659 <- { "return": {} }
660
661 EQMP
662 {
663 .name = "migrate-set-cache-size",
664 .args_type = "value:o",
665 .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
666 },
667
668 SQMP
669 migrate-set-cache-size
670 ----------------------
671
672 Set cache size to be used by XBZRLE migration, the cache size will be rounded
673 down to the nearest power of 2
674
675 Arguments:
676
677 - "value": cache size in bytes (json-int)
678
679 Example:
680
681 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
682 <- { "return": {} }
683
684 EQMP
685 {
686 .name = "query-migrate-cache-size",
687 .args_type = "",
688 .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
689 },
690
691 SQMP
692 query-migrate-cache-size
693 ------------------------
694
695 Show cache size to be used by XBZRLE migration
696
697 returns a json-object with the following information:
698 - "size" : json-int
699
700 Example:
701
702 -> { "execute": "query-migrate-cache-size" }
703 <- { "return": 67108864 }
704
705 EQMP
706
707 {
708 .name = "migrate_set_speed",
709 .args_type = "value:o",
710 .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
711 },
712
713 SQMP
714 migrate_set_speed
715 -----------------
716
717 Set maximum speed for migrations.
718
719 Arguments:
720
721 - "value": maximum speed, in bytes per second (json-int)
722
723 Example:
724
725 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
726 <- { "return": {} }
727
728 EQMP
729
730 {
731 .name = "migrate_set_downtime",
732 .args_type = "value:T",
733 .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
734 },
735
736 SQMP
737 migrate_set_downtime
738 --------------------
739
740 Set maximum tolerated downtime (in seconds) for migrations.
741
742 Arguments:
743
744 - "value": maximum downtime (json-number)
745
746 Example:
747
748 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
749 <- { "return": {} }
750
751 EQMP
752
753 {
754 .name = "client_migrate_info",
755 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
756 .params = "protocol hostname port tls-port cert-subject",
757 .help = "send migration info to spice/vnc client",
758 .user_print = monitor_user_noop,
759 .mhandler.cmd_async = client_migrate_info,
760 .flags = MONITOR_CMD_ASYNC,
761 },
762
763 SQMP
764 client_migrate_info
765 ------------------
766
767 Set the spice/vnc connection info for the migration target. The spice/vnc
768 server will ask the spice/vnc client to automatically reconnect using the
769 new parameters (if specified) once the vm migration finished successfully.
770
771 Arguments:
772
773 - "protocol": protocol: "spice" or "vnc" (json-string)
774 - "hostname": migration target hostname (json-string)
775 - "port": spice/vnc tcp port for plaintext channels (json-int, optional)
776 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
777 - "cert-subject": server certificate subject (json-string, optional)
778
779 Example:
780
781 -> { "execute": "client_migrate_info",
782 "arguments": { "protocol": "spice",
783 "hostname": "virt42.lab.kraxel.org",
784 "port": 1234 } }
785 <- { "return": {} }
786
787 EQMP
788
789 {
790 .name = "dump-guest-memory",
791 .args_type = "paging:b,protocol:s,begin:i?,end:i?",
792 .params = "-p protocol [begin] [length]",
793 .help = "dump guest memory to file",
794 .user_print = monitor_user_noop,
795 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
796 },
797
798 SQMP
799 dump
800
801
802 Dump guest memory to file. The file can be processed with crash or gdb.
803
804 Arguments:
805
806 - "paging": do paging to get guest's memory mapping (json-bool)
807 - "protocol": destination file(started with "file:") or destination file
808 descriptor (started with "fd:") (json-string)
809 - "begin": the starting physical address. It's optional, and should be specified
810 with length together (json-int)
811 - "length": the memory size, in bytes. It's optional, and should be specified
812 with begin together (json-int)
813
814 Example:
815
816 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
817 <- { "return": {} }
818
819 Notes:
820
821 (1) All boolean arguments default to false
822
823 EQMP
824
825 {
826 .name = "netdev_add",
827 .args_type = "netdev:O",
828 .mhandler.cmd_new = qmp_netdev_add,
829 },
830
831 SQMP
832 netdev_add
833 ----------
834
835 Add host network device.
836
837 Arguments:
838
839 - "type": the device type, "tap", "user", ... (json-string)
840 - "id": the device's ID, must be unique (json-string)
841 - device options
842
843 Example:
844
845 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
846 <- { "return": {} }
847
848 Note: The supported device options are the same ones supported by the '-netdev'
849 command-line argument, which are listed in the '-help' output or QEMU's
850 manual
851
852 EQMP
853
854 {
855 .name = "netdev_del",
856 .args_type = "id:s",
857 .mhandler.cmd_new = qmp_marshal_input_netdev_del,
858 },
859
860 SQMP
861 netdev_del
862 ----------
863
864 Remove host network device.
865
866 Arguments:
867
868 - "id": the device's ID, must be unique (json-string)
869
870 Example:
871
872 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
873 <- { "return": {} }
874
875
876 EQMP
877
878 {
879 .name = "block_resize",
880 .args_type = "device:B,size:o",
881 .mhandler.cmd_new = qmp_marshal_input_block_resize,
882 },
883
884 SQMP
885 block_resize
886 ------------
887
888 Resize a block image while a guest is running.
889
890 Arguments:
891
892 - "device": the device's ID, must be unique (json-string)
893 - "size": new size
894
895 Example:
896
897 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
898 <- { "return": {} }
899
900 EQMP
901
902 {
903 .name = "block-stream",
904 .args_type = "device:B,base:s?,speed:o?,on-error:s?",
905 .mhandler.cmd_new = qmp_marshal_input_block_stream,
906 },
907
908 {
909 .name = "block-commit",
910 .args_type = "device:B,base:s?,top:s,speed:o?",
911 .mhandler.cmd_new = qmp_marshal_input_block_commit,
912 },
913
914 {
915 .name = "drive-backup",
916 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
917 "on-source-error:s?,on-target-error:s?",
918 .mhandler.cmd_new = qmp_marshal_input_drive_backup,
919 },
920
921 SQMP
922 drive-backup
923 ------------
924
925 Start a point-in-time copy of a block device to a new destination. The
926 status of ongoing drive-backup operations can be checked with
927 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
928 The operation can be stopped before it has completed using the
929 block-job-cancel command.
930
931 Arguments:
932
933 - "device": the name of the device which should be copied.
934 (json-string)
935 - "target": the target of the new image. If the file exists, or if it is a
936 device, the existing file/device will be used as the new
937 destination. If it does not exist, a new file will be created.
938 (json-string)
939 - "format": the format of the new destination, default is to probe if 'mode' is
940 'existing', else the format of the source
941 (json-string, optional)
942 - "sync": what parts of the disk image should be copied to the destination;
943 possibilities include "full" for all the disk, "top" for only the sectors
944 allocated in the topmost image, or "none" to only replicate new I/O
945 (MirrorSyncMode).
946 - "mode": whether and how QEMU should create a new image
947 (NewImageMode, optional, default 'absolute-paths')
948 - "speed": the maximum speed, in bytes per second (json-int, optional)
949 - "on-source-error": the action to take on an error on the source, default
950 'report'. 'stop' and 'enospc' can only be used
951 if the block device supports io-status.
952 (BlockdevOnError, optional)
953 - "on-target-error": the action to take on an error on the target, default
954 'report' (no limitations, since this applies to
955 a different block device than device).
956 (BlockdevOnError, optional)
957
958 Example:
959 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
960 "target": "backup.img" } }
961 <- { "return": {} }
962 EQMP
963
964 {
965 .name = "block-job-set-speed",
966 .args_type = "device:B,speed:o",
967 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
968 },
969
970 {
971 .name = "block-job-cancel",
972 .args_type = "device:B,force:b?",
973 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
974 },
975 {
976 .name = "block-job-pause",
977 .args_type = "device:B",
978 .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
979 },
980 {
981 .name = "block-job-resume",
982 .args_type = "device:B",
983 .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
984 },
985 {
986 .name = "block-job-complete",
987 .args_type = "device:B",
988 .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
989 },
990 {
991 .name = "transaction",
992 .args_type = "actions:q",
993 .mhandler.cmd_new = qmp_marshal_input_transaction,
994 },
995
996 SQMP
997 transaction
998 -----------
999
1000 Atomically operate on one or more block devices. The only supported
1001 operation for now is snapshotting. If there is any failure performing
1002 any of the operations, all snapshots for the group are abandoned, and
1003 the original disks pre-snapshot attempt are used.
1004
1005 A list of dictionaries is accepted, that contains the actions to be performed.
1006 For snapshots this is the device, the file to use for the new snapshot,
1007 and the format. The default format, if not specified, is qcow2.
1008
1009 Each new snapshot defaults to being created by QEMU (wiping any
1010 contents if the file already exists), but it is also possible to reuse
1011 an externally-created file. In the latter case, you should ensure that
1012 the new image file has the same contents as the current one; QEMU cannot
1013 perform any meaningful check. Typically this is achieved by using the
1014 current image file as the backing file for the new image.
1015
1016 Arguments:
1017
1018 actions array:
1019 - "type": the operation to perform. The only supported
1020 value is "blockdev-snapshot-sync". (json-string)
1021 - "data": a dictionary. The contents depend on the value
1022 of "type". When "type" is "blockdev-snapshot-sync":
1023 - "device": device name to snapshot (json-string)
1024 - "snapshot-file": name of new image file (json-string)
1025 - "format": format of new image (json-string, optional)
1026 - "mode": whether and how QEMU should create the snapshot file
1027 (NewImageMode, optional, default "absolute-paths")
1028
1029 Example:
1030
1031 -> { "execute": "transaction",
1032 "arguments": { "actions": [
1033 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd0",
1034 "snapshot-file": "/some/place/my-image",
1035 "format": "qcow2" } },
1036 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd1",
1037 "snapshot-file": "/some/place/my-image2",
1038 "mode": "existing",
1039 "format": "qcow2" } } ] } }
1040 <- { "return": {} }
1041
1042 EQMP
1043
1044 {
1045 .name = "blockdev-snapshot-sync",
1046 .args_type = "device:B,snapshot-file:s,format:s?,mode:s?",
1047 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
1048 },
1049
1050 SQMP
1051 blockdev-snapshot-sync
1052 ----------------------
1053
1054 Synchronous snapshot of a block device. snapshot-file specifies the
1055 target of the new image. If the file exists, or if it is a device, the
1056 snapshot will be created in the existing file/device. If does not
1057 exist, a new file will be created. format specifies the format of the
1058 snapshot image, default is qcow2.
1059
1060 Arguments:
1061
1062 - "device": device name to snapshot (json-string)
1063 - "snapshot-file": name of new image file (json-string)
1064 - "mode": whether and how QEMU should create the snapshot file
1065 (NewImageMode, optional, default "absolute-paths")
1066 - "format": format of new image (json-string, optional)
1067
1068 Example:
1069
1070 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1071 "snapshot-file":
1072 "/some/place/my-image",
1073 "format": "qcow2" } }
1074 <- { "return": {} }
1075
1076 EQMP
1077
1078 {
1079 .name = "drive-mirror",
1080 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1081 "on-source-error:s?,on-target-error:s?,"
1082 "granularity:i?,buf-size:i?",
1083 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1084 },
1085
1086 SQMP
1087 drive-mirror
1088 ------------
1089
1090 Start mirroring a block device's writes to a new destination. target
1091 specifies the target of the new image. If the file exists, or if it is
1092 a device, it will be used as the new destination for writes. If it does not
1093 exist, a new file will be created. format specifies the format of the
1094 mirror image, default is to probe if mode='existing', else the format
1095 of the source.
1096
1097 Arguments:
1098
1099 - "device": device name to operate on (json-string)
1100 - "target": name of new image file (json-string)
1101 - "format": format of new image (json-string, optional)
1102 - "mode": how an image file should be created into the target
1103 file/device (NewImageMode, optional, default 'absolute-paths')
1104 - "speed": maximum speed of the streaming job, in bytes per second
1105 (json-int)
1106 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1107 - "buf_size": maximum amount of data in flight from source to target, in bytes
1108 (json-int, default 10M)
1109 - "sync": what parts of the disk image should be copied to the destination;
1110 possibilities include "full" for all the disk, "top" for only the sectors
1111 allocated in the topmost image, or "none" to only replicate new I/O
1112 (MirrorSyncMode).
1113 - "on-source-error": the action to take on an error on the source
1114 (BlockdevOnError, default 'report')
1115 - "on-target-error": the action to take on an error on the target
1116 (BlockdevOnError, default 'report')
1117
1118 The default value of the granularity is the image cluster size clamped
1119 between 4096 and 65536, if the image format defines one. If the format
1120 does not define a cluster size, the default value of the granularity
1121 is 65536.
1122
1123
1124 Example:
1125
1126 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1127 "target": "/some/place/my-image",
1128 "sync": "full",
1129 "format": "qcow2" } }
1130 <- { "return": {} }
1131
1132 EQMP
1133
1134 {
1135 .name = "balloon",
1136 .args_type = "value:M",
1137 .mhandler.cmd_new = qmp_marshal_input_balloon,
1138 },
1139
1140 SQMP
1141 balloon
1142 -------
1143
1144 Request VM to change its memory allocation (in bytes).
1145
1146 Arguments:
1147
1148 - "value": New memory allocation (json-int)
1149
1150 Example:
1151
1152 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1153 <- { "return": {} }
1154
1155 EQMP
1156
1157 {
1158 .name = "set_link",
1159 .args_type = "name:s,up:b",
1160 .mhandler.cmd_new = qmp_marshal_input_set_link,
1161 },
1162
1163 SQMP
1164 set_link
1165 --------
1166
1167 Change the link status of a network adapter.
1168
1169 Arguments:
1170
1171 - "name": network device name (json-string)
1172 - "up": status is up (json-bool)
1173
1174 Example:
1175
1176 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1177 <- { "return": {} }
1178
1179 EQMP
1180
1181 {
1182 .name = "getfd",
1183 .args_type = "fdname:s",
1184 .params = "getfd name",
1185 .help = "receive a file descriptor via SCM rights and assign it a name",
1186 .mhandler.cmd_new = qmp_marshal_input_getfd,
1187 },
1188
1189 SQMP
1190 getfd
1191 -----
1192
1193 Receive a file descriptor via SCM rights and assign it a name.
1194
1195 Arguments:
1196
1197 - "fdname": file descriptor name (json-string)
1198
1199 Example:
1200
1201 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1202 <- { "return": {} }
1203
1204 Notes:
1205
1206 (1) If the name specified by the "fdname" argument already exists,
1207 the file descriptor assigned to it will be closed and replaced
1208 by the received file descriptor.
1209 (2) The 'closefd' command can be used to explicitly close the file
1210 descriptor when it is no longer needed.
1211
1212 EQMP
1213
1214 {
1215 .name = "closefd",
1216 .args_type = "fdname:s",
1217 .params = "closefd name",
1218 .help = "close a file descriptor previously passed via SCM rights",
1219 .mhandler.cmd_new = qmp_marshal_input_closefd,
1220 },
1221
1222 SQMP
1223 closefd
1224 -------
1225
1226 Close a file descriptor previously passed via SCM rights.
1227
1228 Arguments:
1229
1230 - "fdname": file descriptor name (json-string)
1231
1232 Example:
1233
1234 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1235 <- { "return": {} }
1236
1237 EQMP
1238
1239 {
1240 .name = "add-fd",
1241 .args_type = "fdset-id:i?,opaque:s?",
1242 .params = "add-fd fdset-id opaque",
1243 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1244 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1245 },
1246
1247 SQMP
1248 add-fd
1249 -------
1250
1251 Add a file descriptor, that was passed via SCM rights, to an fd set.
1252
1253 Arguments:
1254
1255 - "fdset-id": The ID of the fd set to add the file descriptor to.
1256 (json-int, optional)
1257 - "opaque": A free-form string that can be used to describe the fd.
1258 (json-string, optional)
1259
1260 Return a json-object with the following information:
1261
1262 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1263 - "fd": The file descriptor that was received via SCM rights and added to the
1264 fd set. (json-int)
1265
1266 Example:
1267
1268 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1269 <- { "return": { "fdset-id": 1, "fd": 3 } }
1270
1271 Notes:
1272
1273 (1) The list of fd sets is shared by all monitor connections.
1274 (2) If "fdset-id" is not specified, a new fd set will be created.
1275
1276 EQMP
1277
1278 {
1279 .name = "remove-fd",
1280 .args_type = "fdset-id:i,fd:i?",
1281 .params = "remove-fd fdset-id fd",
1282 .help = "Remove a file descriptor from an fd set",
1283 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1284 },
1285
1286 SQMP
1287 remove-fd
1288 ---------
1289
1290 Remove a file descriptor from an fd set.
1291
1292 Arguments:
1293
1294 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1295 (json-int)
1296 - "fd": The file descriptor that is to be removed. (json-int, optional)
1297
1298 Example:
1299
1300 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1301 <- { "return": {} }
1302
1303 Notes:
1304
1305 (1) The list of fd sets is shared by all monitor connections.
1306 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1307 removed.
1308
1309 EQMP
1310
1311 {
1312 .name = "query-fdsets",
1313 .args_type = "",
1314 .help = "Return information describing all fd sets",
1315 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1316 },
1317
1318 SQMP
1319 query-fdsets
1320 -------------
1321
1322 Return information describing all fd sets.
1323
1324 Arguments: None
1325
1326 Example:
1327
1328 -> { "execute": "query-fdsets" }
1329 <- { "return": [
1330 {
1331 "fds": [
1332 {
1333 "fd": 30,
1334 "opaque": "rdonly:/path/to/file"
1335 },
1336 {
1337 "fd": 24,
1338 "opaque": "rdwr:/path/to/file"
1339 }
1340 ],
1341 "fdset-id": 1
1342 },
1343 {
1344 "fds": [
1345 {
1346 "fd": 28
1347 },
1348 {
1349 "fd": 29
1350 }
1351 ],
1352 "fdset-id": 0
1353 }
1354 ]
1355 }
1356
1357 Note: The list of fd sets is shared by all monitor connections.
1358
1359 EQMP
1360
1361 {
1362 .name = "block_passwd",
1363 .args_type = "device:B,password:s",
1364 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
1365 },
1366
1367 SQMP
1368 block_passwd
1369 ------------
1370
1371 Set the password of encrypted block devices.
1372
1373 Arguments:
1374
1375 - "device": device name (json-string)
1376 - "password": password (json-string)
1377
1378 Example:
1379
1380 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1381 "password": "12345" } }
1382 <- { "return": {} }
1383
1384 EQMP
1385
1386 {
1387 .name = "block_set_io_throttle",
1388 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
1389 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
1390 },
1391
1392 SQMP
1393 block_set_io_throttle
1394 ------------
1395
1396 Change I/O throttle limits for a block drive.
1397
1398 Arguments:
1399
1400 - "device": device name (json-string)
1401 - "bps": total throughput limit in bytes per second(json-int)
1402 - "bps_rd": read throughput limit in bytes per second(json-int)
1403 - "bps_wr": read throughput limit in bytes per second(json-int)
1404 - "iops": total I/O operations per second(json-int)
1405 - "iops_rd": read I/O operations per second(json-int)
1406 - "iops_wr": write I/O operations per second(json-int)
1407
1408 Example:
1409
1410 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1411 "bps": "1000000",
1412 "bps_rd": "0",
1413 "bps_wr": "0",
1414 "iops": "0",
1415 "iops_rd": "0",
1416 "iops_wr": "0" } }
1417 <- { "return": {} }
1418
1419 EQMP
1420
1421 {
1422 .name = "set_password",
1423 .args_type = "protocol:s,password:s,connected:s?",
1424 .mhandler.cmd_new = qmp_marshal_input_set_password,
1425 },
1426
1427 SQMP
1428 set_password
1429 ------------
1430
1431 Set the password for vnc/spice protocols.
1432
1433 Arguments:
1434
1435 - "protocol": protocol name (json-string)
1436 - "password": password (json-string)
1437 - "connected": [ keep | disconnect | fail ] (josn-string, optional)
1438
1439 Example:
1440
1441 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1442 "password": "secret" } }
1443 <- { "return": {} }
1444
1445 EQMP
1446
1447 {
1448 .name = "expire_password",
1449 .args_type = "protocol:s,time:s",
1450 .mhandler.cmd_new = qmp_marshal_input_expire_password,
1451 },
1452
1453 SQMP
1454 expire_password
1455 ---------------
1456
1457 Set the password expire time for vnc/spice protocols.
1458
1459 Arguments:
1460
1461 - "protocol": protocol name (json-string)
1462 - "time": [ now | never | +secs | secs ] (json-string)
1463
1464 Example:
1465
1466 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1467 "time": "+60" } }
1468 <- { "return": {} }
1469
1470 EQMP
1471
1472 {
1473 .name = "add_client",
1474 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
1475 .mhandler.cmd_new = qmp_marshal_input_add_client,
1476 },
1477
1478 SQMP
1479 add_client
1480 ----------
1481
1482 Add a graphics client
1483
1484 Arguments:
1485
1486 - "protocol": protocol name (json-string)
1487 - "fdname": file descriptor name (json-string)
1488 - "skipauth": whether to skip authentication (json-bool, optional)
1489 - "tls": whether to perform TLS (json-bool, optional)
1490
1491 Example:
1492
1493 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1494 "fdname": "myclient" } }
1495 <- { "return": {} }
1496
1497 EQMP
1498 {
1499 .name = "qmp_capabilities",
1500 .args_type = "",
1501 .params = "",
1502 .help = "enable QMP capabilities",
1503 .user_print = monitor_user_noop,
1504 .mhandler.cmd_new = do_qmp_capabilities,
1505 },
1506
1507 SQMP
1508 qmp_capabilities
1509 ----------------
1510
1511 Enable QMP capabilities.
1512
1513 Arguments: None.
1514
1515 Example:
1516
1517 -> { "execute": "qmp_capabilities" }
1518 <- { "return": {} }
1519
1520 Note: This command must be issued before issuing any other command.
1521
1522 EQMP
1523
1524 {
1525 .name = "human-monitor-command",
1526 .args_type = "command-line:s,cpu-index:i?",
1527 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
1528 },
1529
1530 SQMP
1531 human-monitor-command
1532 ---------------------
1533
1534 Execute a Human Monitor command.
1535
1536 Arguments:
1537
1538 - command-line: the command name and its arguments, just like the
1539 Human Monitor's shell (json-string)
1540 - cpu-index: select the CPU number to be used by commands which access CPU
1541 data, like 'info registers'. The Monitor selects CPU 0 if this
1542 argument is not provided (json-int, optional)
1543
1544 Example:
1545
1546 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1547 <- { "return": "kvm support: enabled\r\n" }
1548
1549 Notes:
1550
1551 (1) The Human Monitor is NOT an stable interface, this means that command
1552 names, arguments and responses can change or be removed at ANY time.
1553 Applications that rely on long term stability guarantees should NOT
1554 use this command
1555
1556 (2) Limitations:
1557
1558 o This command is stateless, this means that commands that depend
1559 on state information (such as getfd) might not work
1560
1561 o Commands that prompt the user for data (eg. 'cont' when the block
1562 device is encrypted) don't currently work
1563
1564 3. Query Commands
1565 =================
1566
1567 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1568 HXCOMM this! We will possibly move query commands definitions inside those
1569 HXCOMM sections, just like regular commands.
1570
1571 EQMP
1572
1573 SQMP
1574 query-version
1575 -------------
1576
1577 Show QEMU version.
1578
1579 Return a json-object with the following information:
1580
1581 - "qemu": A json-object containing three integer values:
1582 - "major": QEMU's major version (json-int)
1583 - "minor": QEMU's minor version (json-int)
1584 - "micro": QEMU's micro version (json-int)
1585 - "package": package's version (json-string)
1586
1587 Example:
1588
1589 -> { "execute": "query-version" }
1590 <- {
1591 "return":{
1592 "qemu":{
1593 "major":0,
1594 "minor":11,
1595 "micro":5
1596 },
1597 "package":""
1598 }
1599 }
1600
1601 EQMP
1602
1603 {
1604 .name = "query-version",
1605 .args_type = "",
1606 .mhandler.cmd_new = qmp_marshal_input_query_version,
1607 },
1608
1609 SQMP
1610 query-commands
1611 --------------
1612
1613 List QMP available commands.
1614
1615 Each command is represented by a json-object, the returned value is a json-array
1616 of all commands.
1617
1618 Each json-object contain:
1619
1620 - "name": command's name (json-string)
1621
1622 Example:
1623
1624 -> { "execute": "query-commands" }
1625 <- {
1626 "return":[
1627 {
1628 "name":"query-balloon"
1629 },
1630 {
1631 "name":"system_powerdown"
1632 }
1633 ]
1634 }
1635
1636 Note: This example has been shortened as the real response is too long.
1637
1638 EQMP
1639
1640 {
1641 .name = "query-commands",
1642 .args_type = "",
1643 .mhandler.cmd_new = qmp_marshal_input_query_commands,
1644 },
1645
1646 SQMP
1647 query-events
1648 --------------
1649
1650 List QMP available events.
1651
1652 Each event is represented by a json-object, the returned value is a json-array
1653 of all events.
1654
1655 Each json-object contains:
1656
1657 - "name": event's name (json-string)
1658
1659 Example:
1660
1661 -> { "execute": "query-events" }
1662 <- {
1663 "return":[
1664 {
1665 "name":"SHUTDOWN"
1666 },
1667 {
1668 "name":"RESET"
1669 }
1670 ]
1671 }
1672
1673 Note: This example has been shortened as the real response is too long.
1674
1675 EQMP
1676
1677 {
1678 .name = "query-events",
1679 .args_type = "",
1680 .mhandler.cmd_new = qmp_marshal_input_query_events,
1681 },
1682
1683 SQMP
1684 query-chardev
1685 -------------
1686
1687 Each device is represented by a json-object. The returned value is a json-array
1688 of all devices.
1689
1690 Each json-object contain the following:
1691
1692 - "label": device's label (json-string)
1693 - "filename": device's file (json-string)
1694
1695 Example:
1696
1697 -> { "execute": "query-chardev" }
1698 <- {
1699 "return":[
1700 {
1701 "label":"monitor",
1702 "filename":"stdio"
1703 },
1704 {
1705 "label":"serial0",
1706 "filename":"vc"
1707 }
1708 ]
1709 }
1710
1711 EQMP
1712
1713 {
1714 .name = "query-chardev",
1715 .args_type = "",
1716 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
1717 },
1718
1719 SQMP
1720 query-block
1721 -----------
1722
1723 Show the block devices.
1724
1725 Each block device information is stored in a json-object and the returned value
1726 is a json-array of all devices.
1727
1728 Each json-object contain the following:
1729
1730 - "device": device name (json-string)
1731 - "type": device type (json-string)
1732 - deprecated, retained for backward compatibility
1733 - Possible values: "unknown"
1734 - "removable": true if the device is removable, false otherwise (json-bool)
1735 - "locked": true if the device is locked, false otherwise (json-bool)
1736 - "tray_open": only present if removable, true if the device has a tray,
1737 and it is open (json-bool)
1738 - "inserted": only present if the device is inserted, it is a json-object
1739 containing the following:
1740 - "file": device file name (json-string)
1741 - "ro": true if read-only, false otherwise (json-bool)
1742 - "drv": driver format name (json-string)
1743 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1744 "file", "file", "ftp", "ftps", "host_cdrom",
1745 "host_device", "host_floppy", "http", "https",
1746 "nbd", "parallels", "qcow", "qcow2", "raw",
1747 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1748 - "backing_file": backing file name (json-string, optional)
1749 - "backing_file_depth": number of files in the backing file chain (json-int)
1750 - "encrypted": true if encrypted, false otherwise (json-bool)
1751 - "bps": limit total bytes per second (json-int)
1752 - "bps_rd": limit read bytes per second (json-int)
1753 - "bps_wr": limit write bytes per second (json-int)
1754 - "iops": limit total I/O operations per second (json-int)
1755 - "iops_rd": limit read operations per second (json-int)
1756 - "iops_wr": limit write operations per second (json-int)
1757 - "image": the detail of the image, it is a json-object containing
1758 the following:
1759 - "filename": image file name (json-string)
1760 - "format": image format (json-string)
1761 - "virtual-size": image capacity in bytes (json-int)
1762 - "dirty-flag": true if image is not cleanly closed, not present
1763 means clean (json-bool, optional)
1764 - "actual-size": actual size on disk in bytes of the image, not
1765 present when image does not support thin
1766 provision (json-int, optional)
1767 - "cluster-size": size of a cluster in bytes, not present if image
1768 format does not support it (json-int, optional)
1769 - "encrypted": true if the image is encrypted, not present means
1770 false or the image format does not support
1771 encryption (json-bool, optional)
1772 - "backing_file": backing file name, not present means no backing
1773 file is used or the image format does not
1774 support backing file chain
1775 (json-string, optional)
1776 - "full-backing-filename": full path of the backing file, not
1777 present if it equals backing_file or no
1778 backing file is used
1779 (json-string, optional)
1780 - "backing-filename-format": the format of the backing file, not
1781 present means unknown or no backing
1782 file (json-string, optional)
1783 - "snapshots": the internal snapshot info, it is an optional list
1784 of json-object containing the following:
1785 - "id": unique snapshot id (json-string)
1786 - "name": snapshot name (json-string)
1787 - "vm-state-size": size of the VM state in bytes (json-int)
1788 - "date-sec": UTC date of the snapshot in seconds (json-int)
1789 - "date-nsec": fractional part in nanoseconds to be used with
1790 date-sec(json-int)
1791 - "vm-clock-sec": VM clock relative to boot in seconds
1792 (json-int)
1793 - "vm-clock-nsec": fractional part in nanoseconds to be used
1794 with vm-clock-sec (json-int)
1795 - "backing-image": the detail of the backing image, it is an
1796 optional json-object only present when a
1797 backing image present for this image
1798
1799 - "io-status": I/O operation status, only present if the device supports it
1800 and the VM is configured to stop on errors. It's always reset
1801 to "ok" when the "cont" command is issued (json_string, optional)
1802 - Possible values: "ok", "failed", "nospace"
1803
1804 Example:
1805
1806 -> { "execute": "query-block" }
1807 <- {
1808 "return":[
1809 {
1810 "io-status": "ok",
1811 "device":"ide0-hd0",
1812 "locked":false,
1813 "removable":false,
1814 "inserted":{
1815 "ro":false,
1816 "drv":"qcow2",
1817 "encrypted":false,
1818 "file":"disks/test.qcow2",
1819 "backing_file_depth":1,
1820 "bps":1000000,
1821 "bps_rd":0,
1822 "bps_wr":0,
1823 "iops":1000000,
1824 "iops_rd":0,
1825 "iops_wr":0,
1826 "image":{
1827 "filename":"disks/test.qcow2",
1828 "format":"qcow2",
1829 "virtual-size":2048000,
1830 "backing_file":"base.qcow2",
1831 "full-backing-filename":"disks/base.qcow2",
1832 "backing-filename-format:"qcow2",
1833 "snapshots":[
1834 {
1835 "id": "1",
1836 "name": "snapshot1",
1837 "vm-state-size": 0,
1838 "date-sec": 10000200,
1839 "date-nsec": 12,
1840 "vm-clock-sec": 206,
1841 "vm-clock-nsec": 30
1842 }
1843 ],
1844 "backing-image":{
1845 "filename":"disks/base.qcow2",
1846 "format":"qcow2",
1847 "virtual-size":2048000
1848 }
1849 }
1850 },
1851 "type":"unknown"
1852 },
1853 {
1854 "io-status": "ok",
1855 "device":"ide1-cd0",
1856 "locked":false,
1857 "removable":true,
1858 "type":"unknown"
1859 },
1860 {
1861 "device":"floppy0",
1862 "locked":false,
1863 "removable":true,
1864 "type":"unknown"
1865 },
1866 {
1867 "device":"sd0",
1868 "locked":false,
1869 "removable":true,
1870 "type":"unknown"
1871 }
1872 ]
1873 }
1874
1875 EQMP
1876
1877 {
1878 .name = "query-block",
1879 .args_type = "",
1880 .mhandler.cmd_new = qmp_marshal_input_query_block,
1881 },
1882
1883 SQMP
1884 query-blockstats
1885 ----------------
1886
1887 Show block device statistics.
1888
1889 Each device statistic information is stored in a json-object and the returned
1890 value is a json-array of all devices.
1891
1892 Each json-object contain the following:
1893
1894 - "device": device name (json-string)
1895 - "stats": A json-object with the statistics information, it contains:
1896 - "rd_bytes": bytes read (json-int)
1897 - "wr_bytes": bytes written (json-int)
1898 - "rd_operations": read operations (json-int)
1899 - "wr_operations": write operations (json-int)
1900 - "flush_operations": cache flush operations (json-int)
1901 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1902 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1903 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
1904 - "wr_highest_offset": Highest offset of a sector written since the
1905 BlockDriverState has been opened (json-int)
1906 - "parent": Contains recursively the statistics of the underlying
1907 protocol (e.g. the host file for a qcow2 image). If there is
1908 no underlying protocol, this field is omitted
1909 (json-object, optional)
1910
1911 Example:
1912
1913 -> { "execute": "query-blockstats" }
1914 <- {
1915 "return":[
1916 {
1917 "device":"ide0-hd0",
1918 "parent":{
1919 "stats":{
1920 "wr_highest_offset":3686448128,
1921 "wr_bytes":9786368,
1922 "wr_operations":751,
1923 "rd_bytes":122567168,
1924 "rd_operations":36772
1925 "wr_total_times_ns":313253456
1926 "rd_total_times_ns":3465673657
1927 "flush_total_times_ns":49653
1928 "flush_operations":61,
1929 }
1930 },
1931 "stats":{
1932 "wr_highest_offset":2821110784,
1933 "wr_bytes":9786368,
1934 "wr_operations":692,
1935 "rd_bytes":122739200,
1936 "rd_operations":36604
1937 "flush_operations":51,
1938 "wr_total_times_ns":313253456
1939 "rd_total_times_ns":3465673657
1940 "flush_total_times_ns":49653
1941 }
1942 },
1943 {
1944 "device":"ide1-cd0",
1945 "stats":{
1946 "wr_highest_offset":0,
1947 "wr_bytes":0,
1948 "wr_operations":0,
1949 "rd_bytes":0,
1950 "rd_operations":0
1951 "flush_operations":0,
1952 "wr_total_times_ns":0
1953 "rd_total_times_ns":0
1954 "flush_total_times_ns":0
1955 }
1956 },
1957 {
1958 "device":"floppy0",
1959 "stats":{
1960 "wr_highest_offset":0,
1961 "wr_bytes":0,
1962 "wr_operations":0,
1963 "rd_bytes":0,
1964 "rd_operations":0
1965 "flush_operations":0,
1966 "wr_total_times_ns":0
1967 "rd_total_times_ns":0
1968 "flush_total_times_ns":0
1969 }
1970 },
1971 {
1972 "device":"sd0",
1973 "stats":{
1974 "wr_highest_offset":0,
1975 "wr_bytes":0,
1976 "wr_operations":0,
1977 "rd_bytes":0,
1978 "rd_operations":0
1979 "flush_operations":0,
1980 "wr_total_times_ns":0
1981 "rd_total_times_ns":0
1982 "flush_total_times_ns":0
1983 }
1984 }
1985 ]
1986 }
1987
1988 EQMP
1989
1990 {
1991 .name = "query-blockstats",
1992 .args_type = "",
1993 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
1994 },
1995
1996 SQMP
1997 query-cpus
1998 ----------
1999
2000 Show CPU information.
2001
2002 Return a json-array. Each CPU is represented by a json-object, which contains:
2003
2004 - "CPU": CPU index (json-int)
2005 - "current": true if this is the current CPU, false otherwise (json-bool)
2006 - "halted": true if the cpu is halted, false otherwise (json-bool)
2007 - Current program counter. The key's name depends on the architecture:
2008 "pc": i386/x86_64 (json-int)
2009 "nip": PPC (json-int)
2010 "pc" and "npc": sparc (json-int)
2011 "PC": mips (json-int)
2012 - "thread_id": ID of the underlying host thread (json-int)
2013
2014 Example:
2015
2016 -> { "execute": "query-cpus" }
2017 <- {
2018 "return":[
2019 {
2020 "CPU":0,
2021 "current":true,
2022 "halted":false,
2023 "pc":3227107138
2024 "thread_id":3134
2025 },
2026 {
2027 "CPU":1,
2028 "current":false,
2029 "halted":true,
2030 "pc":7108165
2031 "thread_id":3135
2032 }
2033 ]
2034 }
2035
2036 EQMP
2037
2038 {
2039 .name = "query-cpus",
2040 .args_type = "",
2041 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
2042 },
2043
2044 SQMP
2045 query-pci
2046 ---------
2047
2048 PCI buses and devices information.
2049
2050 The returned value is a json-array of all buses. Each bus is represented by
2051 a json-object, which has a key with a json-array of all PCI devices attached
2052 to it. Each device is represented by a json-object.
2053
2054 The bus json-object contains the following:
2055
2056 - "bus": bus number (json-int)
2057 - "devices": a json-array of json-objects, each json-object represents a
2058 PCI device
2059
2060 The PCI device json-object contains the following:
2061
2062 - "bus": identical to the parent's bus number (json-int)
2063 - "slot": slot number (json-int)
2064 - "function": function number (json-int)
2065 - "class_info": a json-object containing:
2066 - "desc": device class description (json-string, optional)
2067 - "class": device class number (json-int)
2068 - "id": a json-object containing:
2069 - "device": device ID (json-int)
2070 - "vendor": vendor ID (json-int)
2071 - "irq": device's IRQ if assigned (json-int, optional)
2072 - "qdev_id": qdev id string (json-string)
2073 - "pci_bridge": It's a json-object, only present if this device is a
2074 PCI bridge, contains:
2075 - "bus": bus number (json-int)
2076 - "secondary": secondary bus number (json-int)
2077 - "subordinate": subordinate bus number (json-int)
2078 - "io_range": I/O memory range information, a json-object with the
2079 following members:
2080 - "base": base address, in bytes (json-int)
2081 - "limit": limit address, in bytes (json-int)
2082 - "memory_range": memory range information, a json-object with the
2083 following members:
2084 - "base": base address, in bytes (json-int)
2085 - "limit": limit address, in bytes (json-int)
2086 - "prefetchable_range": Prefetchable memory range information, a
2087 json-object with the following members:
2088 - "base": base address, in bytes (json-int)
2089 - "limit": limit address, in bytes (json-int)
2090 - "devices": a json-array of PCI devices if there's any attached, each
2091 each element is represented by a json-object, which contains
2092 the same members of the 'PCI device json-object' described
2093 above (optional)
2094 - "regions": a json-array of json-objects, each json-object represents a
2095 memory region of this device
2096
2097 The memory range json-object contains the following:
2098
2099 - "base": base memory address (json-int)
2100 - "limit": limit value (json-int)
2101
2102 The region json-object can be an I/O region or a memory region, an I/O region
2103 json-object contains the following:
2104
2105 - "type": "io" (json-string, fixed)
2106 - "bar": BAR number (json-int)
2107 - "address": memory address (json-int)
2108 - "size": memory size (json-int)
2109
2110 A memory region json-object contains the following:
2111
2112 - "type": "memory" (json-string, fixed)
2113 - "bar": BAR number (json-int)
2114 - "address": memory address (json-int)
2115 - "size": memory size (json-int)
2116 - "mem_type_64": true or false (json-bool)
2117 - "prefetch": true or false (json-bool)
2118
2119 Example:
2120
2121 -> { "execute": "query-pci" }
2122 <- {
2123 "return":[
2124 {
2125 "bus":0,
2126 "devices":[
2127 {
2128 "bus":0,
2129 "qdev_id":"",
2130 "slot":0,
2131 "class_info":{
2132 "class":1536,
2133 "desc":"Host bridge"
2134 },
2135 "id":{
2136 "device":32902,
2137 "vendor":4663
2138 },
2139 "function":0,
2140 "regions":[
2141
2142 ]
2143 },
2144 {
2145 "bus":0,
2146 "qdev_id":"",
2147 "slot":1,
2148 "class_info":{
2149 "class":1537,
2150 "desc":"ISA bridge"
2151 },
2152 "id":{
2153 "device":32902,
2154 "vendor":28672
2155 },
2156 "function":0,
2157 "regions":[
2158
2159 ]
2160 },
2161 {
2162 "bus":0,
2163 "qdev_id":"",
2164 "slot":1,
2165 "class_info":{
2166 "class":257,
2167 "desc":"IDE controller"
2168 },
2169 "id":{
2170 "device":32902,
2171 "vendor":28688
2172 },
2173 "function":1,
2174 "regions":[
2175 {
2176 "bar":4,
2177 "size":16,
2178 "address":49152,
2179 "type":"io"
2180 }
2181 ]
2182 },
2183 {
2184 "bus":0,
2185 "qdev_id":"",
2186 "slot":2,
2187 "class_info":{
2188 "class":768,
2189 "desc":"VGA controller"
2190 },
2191 "id":{
2192 "device":4115,
2193 "vendor":184
2194 },
2195 "function":0,
2196 "regions":[
2197 {
2198 "prefetch":true,
2199 "mem_type_64":false,
2200 "bar":0,
2201 "size":33554432,
2202 "address":4026531840,
2203 "type":"memory"
2204 },
2205 {
2206 "prefetch":false,
2207 "mem_type_64":false,
2208 "bar":1,
2209 "size":4096,
2210 "address":4060086272,
2211 "type":"memory"
2212 },
2213 {
2214 "prefetch":false,
2215 "mem_type_64":false,
2216 "bar":6,
2217 "size":65536,
2218 "address":-1,
2219 "type":"memory"
2220 }
2221 ]
2222 },
2223 {
2224 "bus":0,
2225 "qdev_id":"",
2226 "irq":11,
2227 "slot":4,
2228 "class_info":{
2229 "class":1280,
2230 "desc":"RAM controller"
2231 },
2232 "id":{
2233 "device":6900,
2234 "vendor":4098
2235 },
2236 "function":0,
2237 "regions":[
2238 {
2239 "bar":0,
2240 "size":32,
2241 "address":49280,
2242 "type":"io"
2243 }
2244 ]
2245 }
2246 ]
2247 }
2248 ]
2249 }
2250
2251 Note: This example has been shortened as the real response is too long.
2252
2253 EQMP
2254
2255 {
2256 .name = "query-pci",
2257 .args_type = "",
2258 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2259 },
2260
2261 SQMP
2262 query-kvm
2263 ---------
2264
2265 Show KVM information.
2266
2267 Return a json-object with the following information:
2268
2269 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2270 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2271
2272 Example:
2273
2274 -> { "execute": "query-kvm" }
2275 <- { "return": { "enabled": true, "present": true } }
2276
2277 EQMP
2278
2279 {
2280 .name = "query-kvm",
2281 .args_type = "",
2282 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2283 },
2284
2285 SQMP
2286 query-status
2287 ------------
2288
2289 Return a json-object with the following information:
2290
2291 - "running": true if the VM is running, or false if it is paused (json-bool)
2292 - "singlestep": true if the VM is in single step mode,
2293 false otherwise (json-bool)
2294 - "status": one of the following values (json-string)
2295 "debug" - QEMU is running on a debugger
2296 "inmigrate" - guest is paused waiting for an incoming migration
2297 "internal-error" - An internal error that prevents further guest
2298 execution has occurred
2299 "io-error" - the last IOP has failed and the device is configured
2300 to pause on I/O errors
2301 "paused" - guest has been paused via the 'stop' command
2302 "postmigrate" - guest is paused following a successful 'migrate'
2303 "prelaunch" - QEMU was started with -S and guest has not started
2304 "finish-migrate" - guest is paused to finish the migration process
2305 "restore-vm" - guest is paused to restore VM state
2306 "running" - guest is actively running
2307 "save-vm" - guest is paused to save the VM state
2308 "shutdown" - guest is shut down (and -no-shutdown is in use)
2309 "watchdog" - the watchdog action is configured to pause and
2310 has been triggered
2311
2312 Example:
2313
2314 -> { "execute": "query-status" }
2315 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2316
2317 EQMP
2318
2319 {
2320 .name = "query-status",
2321 .args_type = "",
2322 .mhandler.cmd_new = qmp_marshal_input_query_status,
2323 },
2324
2325 SQMP
2326 query-mice
2327 ----------
2328
2329 Show VM mice information.
2330
2331 Each mouse is represented by a json-object, the returned value is a json-array
2332 of all mice.
2333
2334 The mouse json-object contains the following:
2335
2336 - "name": mouse's name (json-string)
2337 - "index": mouse's index (json-int)
2338 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2339 - "absolute": true if the mouse generates absolute input events (json-bool)
2340
2341 Example:
2342
2343 -> { "execute": "query-mice" }
2344 <- {
2345 "return":[
2346 {
2347 "name":"QEMU Microsoft Mouse",
2348 "index":0,
2349 "current":false,
2350 "absolute":false
2351 },
2352 {
2353 "name":"QEMU PS/2 Mouse",
2354 "index":1,
2355 "current":true,
2356 "absolute":true
2357 }
2358 ]
2359 }
2360
2361 EQMP
2362
2363 {
2364 .name = "query-mice",
2365 .args_type = "",
2366 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2367 },
2368
2369 SQMP
2370 query-vnc
2371 ---------
2372
2373 Show VNC server information.
2374
2375 Return a json-object with server information. Connected clients are returned
2376 as a json-array of json-objects.
2377
2378 The main json-object contains the following:
2379
2380 - "enabled": true or false (json-bool)
2381 - "host": server's IP address (json-string)
2382 - "family": address family (json-string)
2383 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2384 - "service": server's port number (json-string)
2385 - "auth": authentication method (json-string)
2386 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2387 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2388 "vencrypt+plain", "vencrypt+tls+none",
2389 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2390 "vencrypt+tls+vnc", "vencrypt+x509+none",
2391 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2392 "vencrypt+x509+vnc", "vnc"
2393 - "clients": a json-array of all connected clients
2394
2395 Clients are described by a json-object, each one contain the following:
2396
2397 - "host": client's IP address (json-string)
2398 - "family": address family (json-string)
2399 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2400 - "service": client's port number (json-string)
2401 - "x509_dname": TLS dname (json-string, optional)
2402 - "sasl_username": SASL username (json-string, optional)
2403
2404 Example:
2405
2406 -> { "execute": "query-vnc" }
2407 <- {
2408 "return":{
2409 "enabled":true,
2410 "host":"0.0.0.0",
2411 "service":"50402",
2412 "auth":"vnc",
2413 "family":"ipv4",
2414 "clients":[
2415 {
2416 "host":"127.0.0.1",
2417 "service":"50401",
2418 "family":"ipv4"
2419 }
2420 ]
2421 }
2422 }
2423
2424 EQMP
2425
2426 {
2427 .name = "query-vnc",
2428 .args_type = "",
2429 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
2430 },
2431
2432 SQMP
2433 query-spice
2434 -----------
2435
2436 Show SPICE server information.
2437
2438 Return a json-object with server information. Connected clients are returned
2439 as a json-array of json-objects.
2440
2441 The main json-object contains the following:
2442
2443 - "enabled": true or false (json-bool)
2444 - "host": server's IP address (json-string)
2445 - "port": server's port number (json-int, optional)
2446 - "tls-port": server's port number (json-int, optional)
2447 - "auth": authentication method (json-string)
2448 - Possible values: "none", "spice"
2449 - "channels": a json-array of all active channels clients
2450
2451 Channels are described by a json-object, each one contain the following:
2452
2453 - "host": client's IP address (json-string)
2454 - "family": address family (json-string)
2455 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2456 - "port": client's port number (json-string)
2457 - "connection-id": spice connection id. All channels with the same id
2458 belong to the same spice session (json-int)
2459 - "channel-type": channel type. "1" is the main control channel, filter for
2460 this one if you want track spice sessions only (json-int)
2461 - "channel-id": channel id. Usually "0", might be different needed when
2462 multiple channels of the same type exist, such as multiple
2463 display channels in a multihead setup (json-int)
2464 - "tls": whevener the channel is encrypted (json-bool)
2465
2466 Example:
2467
2468 -> { "execute": "query-spice" }
2469 <- {
2470 "return": {
2471 "enabled": true,
2472 "auth": "spice",
2473 "port": 5920,
2474 "tls-port": 5921,
2475 "host": "0.0.0.0",
2476 "channels": [
2477 {
2478 "port": "54924",
2479 "family": "ipv4",
2480 "channel-type": 1,
2481 "connection-id": 1804289383,
2482 "host": "127.0.0.1",
2483 "channel-id": 0,
2484 "tls": true
2485 },
2486 {
2487 "port": "36710",
2488 "family": "ipv4",
2489 "channel-type": 4,
2490 "connection-id": 1804289383,
2491 "host": "127.0.0.1",
2492 "channel-id": 0,
2493 "tls": false
2494 },
2495 [ ... more channels follow ... ]
2496 ]
2497 }
2498 }
2499
2500 EQMP
2501
2502 #if defined(CONFIG_SPICE)
2503 {
2504 .name = "query-spice",
2505 .args_type = "",
2506 .mhandler.cmd_new = qmp_marshal_input_query_spice,
2507 },
2508 #endif
2509
2510 SQMP
2511 query-name
2512 ----------
2513
2514 Show VM name.
2515
2516 Return a json-object with the following information:
2517
2518 - "name": VM's name (json-string, optional)
2519
2520 Example:
2521
2522 -> { "execute": "query-name" }
2523 <- { "return": { "name": "qemu-name" } }
2524
2525 EQMP
2526
2527 {
2528 .name = "query-name",
2529 .args_type = "",
2530 .mhandler.cmd_new = qmp_marshal_input_query_name,
2531 },
2532
2533 SQMP
2534 query-uuid
2535 ----------
2536
2537 Show VM UUID.
2538
2539 Return a json-object with the following information:
2540
2541 - "UUID": Universally Unique Identifier (json-string)
2542
2543 Example:
2544
2545 -> { "execute": "query-uuid" }
2546 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2547
2548 EQMP
2549
2550 {
2551 .name = "query-uuid",
2552 .args_type = "",
2553 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
2554 },
2555
2556 SQMP
2557 query-command-line-options
2558 --------------------------
2559
2560 Show command line option schema.
2561
2562 Return a json-array of command line option schema for all options (or for
2563 the given option), returning an error if the given option doesn't exist.
2564
2565 Each array entry contains the following:
2566
2567 - "option": option name (json-string)
2568 - "parameters": a json-array describes all parameters of the option:
2569 - "name": parameter name (json-string)
2570 - "type": parameter type (one of 'string', 'boolean', 'number',
2571 or 'size')
2572 - "help": human readable description of the parameter
2573 (json-string, optional)
2574
2575 Example:
2576
2577 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
2578 <- { "return": [
2579 {
2580 "parameters": [
2581 {
2582 "name": "romfile",
2583 "type": "string"
2584 },
2585 {
2586 "name": "bootindex",
2587 "type": "number"
2588 }
2589 ],
2590 "option": "option-rom"
2591 }
2592 ]
2593 }
2594
2595 EQMP
2596
2597 {
2598 .name = "query-command-line-options",
2599 .args_type = "option:s?",
2600 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
2601 },
2602
2603 SQMP
2604 query-migrate
2605 -------------
2606
2607 Migration status.
2608
2609 Return a json-object. If migration is active there will be another json-object
2610 with RAM migration status and if block migration is active another one with
2611 block migration status.
2612
2613 The main json-object contains the following:
2614
2615 - "status": migration status (json-string)
2616 - Possible values: "active", "completed", "failed", "cancelled"
2617 - "total-time": total amount of ms since migration started. If
2618 migration has ended, it returns the total migration
2619 time (json-int)
2620 - "downtime": only present when migration has finished correctly
2621 total amount in ms for downtime that happened (json-int)
2622 - "expected-downtime": only present while migration is active
2623 total amount in ms for downtime that was calculated on
2624 the last bitmap round (json-int)
2625 - "ram": only present if "status" is "active", it is a json-object with the
2626 following RAM information:
2627 - "transferred": amount transferred in bytes (json-int)
2628 - "remaining": amount remaining to transfer in bytes (json-int)
2629 - "total": total amount of memory in bytes (json-int)
2630 - "duplicate": number of pages filled entirely with the same
2631 byte (json-int)
2632 These are sent over the wire much more efficiently.
2633 - "skipped": number of skipped zero pages (json-int)
2634 - "normal" : number of whole pages transferred. I.e. they
2635 were not sent as duplicate or xbzrle pages (json-int)
2636 - "normal-bytes" : number of bytes transferred in whole
2637 pages. This is just normal pages times size of one page,
2638 but this way upper levels don't need to care about page
2639 size (json-int)
2640 - "disk": only present if "status" is "active" and it is a block migration,
2641 it is a json-object with the following disk information:
2642 - "transferred": amount transferred in bytes (json-int)
2643 - "remaining": amount remaining to transfer in bytes json-int)
2644 - "total": total disk size in bytes (json-int)
2645 - "xbzrle-cache": only present if XBZRLE is active.
2646 It is a json-object with the following XBZRLE information:
2647 - "cache-size": XBZRLE cache size in bytes
2648 - "bytes": number of bytes transferred for XBZRLE compressed pages
2649 - "pages": number of XBZRLE compressed pages
2650 - "cache-miss": number of XBRZRLE page cache misses
2651 - "overflow": number of times XBZRLE overflows. This means
2652 that the XBZRLE encoding was bigger than just sent the
2653 whole page, and then we sent the whole page instead (as as
2654 normal page).
2655
2656 Examples:
2657
2658 1. Before the first migration
2659
2660 -> { "execute": "query-migrate" }
2661 <- { "return": {} }
2662
2663 2. Migration is done and has succeeded
2664
2665 -> { "execute": "query-migrate" }
2666 <- { "return": {
2667 "status": "completed",
2668 "ram":{
2669 "transferred":123,
2670 "remaining":123,
2671 "total":246,
2672 "total-time":12345,
2673 "downtime":12345,
2674 "duplicate":123,
2675 "normal":123,
2676 "normal-bytes":123456
2677 }
2678 }
2679 }
2680
2681 3. Migration is done and has failed
2682
2683 -> { "execute": "query-migrate" }
2684 <- { "return": { "status": "failed" } }
2685
2686 4. Migration is being performed and is not a block migration:
2687
2688 -> { "execute": "query-migrate" }
2689 <- {
2690 "return":{
2691 "status":"active",
2692 "ram":{
2693 "transferred":123,
2694 "remaining":123,
2695 "total":246,
2696 "total-time":12345,
2697 "expected-downtime":12345,
2698 "duplicate":123,
2699 "normal":123,
2700 "normal-bytes":123456
2701 }
2702 }
2703 }
2704
2705 5. Migration is being performed and is a block migration:
2706
2707 -> { "execute": "query-migrate" }
2708 <- {
2709 "return":{
2710 "status":"active",
2711 "ram":{
2712 "total":1057024,
2713 "remaining":1053304,
2714 "transferred":3720,
2715 "total-time":12345,
2716 "expected-downtime":12345,
2717 "duplicate":123,
2718 "normal":123,
2719 "normal-bytes":123456
2720 },
2721 "disk":{
2722 "total":20971520,
2723 "remaining":20880384,
2724 "transferred":91136
2725 }
2726 }
2727 }
2728
2729 6. Migration is being performed and XBZRLE is active:
2730
2731 -> { "execute": "query-migrate" }
2732 <- {
2733 "return":{
2734 "status":"active",
2735 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
2736 "ram":{
2737 "total":1057024,
2738 "remaining":1053304,
2739 "transferred":3720,
2740 "total-time":12345,
2741 "expected-downtime":12345,
2742 "duplicate":10,
2743 "normal":3333,
2744 "normal-bytes":3412992
2745 },
2746 "xbzrle-cache":{
2747 "cache-size":67108864,
2748 "bytes":20971520,
2749 "pages":2444343,
2750 "cache-miss":2244,
2751 "overflow":34434
2752 }
2753 }
2754 }
2755
2756 EQMP
2757
2758 {
2759 .name = "query-migrate",
2760 .args_type = "",
2761 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
2762 },
2763
2764 SQMP
2765 migrate-set-capabilities
2766 ------------------------
2767
2768 Enable/Disable migration capabilities
2769
2770 - "xbzrle": XBZRLE support
2771
2772 Arguments:
2773
2774 Example:
2775
2776 -> { "execute": "migrate-set-capabilities" , "arguments":
2777 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
2778
2779 EQMP
2780
2781 {
2782 .name = "migrate-set-capabilities",
2783 .args_type = "capabilities:O",
2784 .params = "capability:s,state:b",
2785 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
2786 },
2787 SQMP
2788 query-migrate-capabilities
2789 --------------------------
2790
2791 Query current migration capabilities
2792
2793 - "capabilities": migration capabilities state
2794 - "xbzrle" : XBZRLE state (json-bool)
2795
2796 Arguments:
2797
2798 Example:
2799
2800 -> { "execute": "query-migrate-capabilities" }
2801 <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
2802
2803 EQMP
2804
2805 {
2806 .name = "query-migrate-capabilities",
2807 .args_type = "",
2808 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
2809 },
2810
2811 SQMP
2812 query-balloon
2813 -------------
2814
2815 Show balloon information.
2816
2817 Make an asynchronous request for balloon info. When the request completes a
2818 json-object will be returned containing the following data:
2819
2820 - "actual": current balloon value in bytes (json-int)
2821
2822 Example:
2823
2824 -> { "execute": "query-balloon" }
2825 <- {
2826 "return":{
2827 "actual":1073741824,
2828 }
2829 }
2830
2831 EQMP
2832
2833 {
2834 .name = "query-balloon",
2835 .args_type = "",
2836 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
2837 },
2838
2839 {
2840 .name = "query-block-jobs",
2841 .args_type = "",
2842 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
2843 },
2844
2845 {
2846 .name = "qom-list",
2847 .args_type = "path:s",
2848 .mhandler.cmd_new = qmp_marshal_input_qom_list,
2849 },
2850
2851 {
2852 .name = "qom-set",
2853 .args_type = "path:s,property:s,value:q",
2854 .mhandler.cmd_new = qmp_qom_set,
2855 },
2856
2857 {
2858 .name = "qom-get",
2859 .args_type = "path:s,property:s",
2860 .mhandler.cmd_new = qmp_qom_get,
2861 },
2862
2863 {
2864 .name = "nbd-server-start",
2865 .args_type = "addr:q",
2866 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
2867 },
2868 {
2869 .name = "nbd-server-add",
2870 .args_type = "device:B,writable:b?",
2871 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
2872 },
2873 {
2874 .name = "nbd-server-stop",
2875 .args_type = "",
2876 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
2877 },
2878
2879 {
2880 .name = "change-vnc-password",
2881 .args_type = "password:s",
2882 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
2883 },
2884 {
2885 .name = "qom-list-types",
2886 .args_type = "implements:s?,abstract:b?",
2887 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
2888 },
2889
2890 {
2891 .name = "device-list-properties",
2892 .args_type = "typename:s",
2893 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
2894 },
2895
2896 {
2897 .name = "query-machines",
2898 .args_type = "",
2899 .mhandler.cmd_new = qmp_marshal_input_query_machines,
2900 },
2901
2902 {
2903 .name = "query-cpu-definitions",
2904 .args_type = "",
2905 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
2906 },
2907
2908 {
2909 .name = "query-target",
2910 .args_type = "",
2911 .mhandler.cmd_new = qmp_marshal_input_query_target,
2912 },
2913
2914 {
2915 .name = "query-tpm",
2916 .args_type = "",
2917 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
2918 },
2919
2920 SQMP
2921 query-tpm
2922 ---------
2923
2924 Return information about the TPM device.
2925
2926 Arguments: None
2927
2928 Example:
2929
2930 -> { "execute": "query-tpm" }
2931 <- { "return":
2932 [
2933 { "model": "tpm-tis",
2934 "options":
2935 { "type": "passthrough",
2936 "data":
2937 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
2938 "path": "/dev/tpm0"
2939 }
2940 },
2941 "id": "tpm0"
2942 }
2943 ]
2944 }
2945
2946 EQMP
2947
2948 {
2949 .name = "query-tpm-models",
2950 .args_type = "",
2951 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
2952 },
2953
2954 SQMP
2955 query-tpm-models
2956 ----------------
2957
2958 Return a list of supported TPM models.
2959
2960 Arguments: None
2961
2962 Example:
2963
2964 -> { "execute": "query-tpm-models" }
2965 <- { "return": [ "tpm-tis" ] }
2966
2967 EQMP
2968
2969 {
2970 .name = "query-tpm-types",
2971 .args_type = "",
2972 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
2973 },
2974
2975 SQMP
2976 query-tpm-types
2977 ---------------
2978
2979 Return a list of supported TPM types.
2980
2981 Arguments: None
2982
2983 Example:
2984
2985 -> { "execute": "query-tpm-types" }
2986 <- { "return": [ "passthrough" ] }
2987
2988 EQMP
2989
2990 {
2991 .name = "chardev-add",
2992 .args_type = "id:s,backend:q",
2993 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
2994 },
2995
2996 SQMP
2997 chardev-add
2998 ----------------
2999
3000 Add a chardev.
3001
3002 Arguments:
3003
3004 - "id": the chardev's ID, must be unique (json-string)
3005 - "backend": chardev backend type + parameters
3006
3007 Examples:
3008
3009 -> { "execute" : "chardev-add",
3010 "arguments" : { "id" : "foo",
3011 "backend" : { "type" : "null", "data" : {} } } }
3012 <- { "return": {} }
3013
3014 -> { "execute" : "chardev-add",
3015 "arguments" : { "id" : "bar",
3016 "backend" : { "type" : "file",
3017 "data" : { "out" : "/tmp/bar.log" } } } }
3018 <- { "return": {} }
3019
3020 -> { "execute" : "chardev-add",
3021 "arguments" : { "id" : "baz",
3022 "backend" : { "type" : "pty", "data" : {} } } }
3023 <- { "return": { "pty" : "/dev/pty/42" } }
3024
3025 EQMP
3026
3027 {
3028 .name = "chardev-remove",
3029 .args_type = "id:s",
3030 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3031 },
3032
3033
3034 SQMP
3035 chardev-remove
3036 --------------
3037
3038 Remove a chardev.
3039
3040 Arguments:
3041
3042 - "id": the chardev's ID, must exist and not be in use (json-string)
3043
3044 Example:
3045
3046 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3047 <- { "return": {} }
3048
3049 EQMP