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