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