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