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