package: update version (2.6.16)
[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  = "job-id:s?,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 - "job-id": Identifier for the newly-created block job. If omitted,
1168             the device name will be used. (json-string, optional)
1169 - "device": The device's ID, must be unique (json-string)
1170 - "base": The file name of the backing image to write data into.
1171           If not specified, this is the deepest backing image
1172           (json-string, optional)
1173 - "top":  The file name of the backing image within the image chain,
1174           which contains the topmost data to be committed down. If
1175           not specified, this is the active layer. (json-string, optional)
1176
1177 - backing-file:     The backing file string to write into the overlay
1178                     image of 'top'.  If 'top' is the active layer,
1179                     specifying a backing file string is an error. This
1180                     filename is not validated.
1181
1182                     If a pathname string is such that it cannot be
1183                     resolved by QEMU, that means that subsequent QMP or
1184                     HMP commands must use node-names for the image in
1185                     question, as filename lookup methods will fail.
1186
1187                     If not specified, QEMU will automatically determine
1188                     the backing file string to use, or error out if
1189                     there is no obvious choice. Care should be taken
1190                     when specifying the string, to specify a valid
1191                     filename or protocol.
1192                     (json-string, optional) (Since 2.1)
1193
1194           If top == base, that is an error.
1195           If top == active, the job will not be completed by itself,
1196           user needs to complete the job with the block-job-complete
1197           command after getting the ready event. (Since 2.0)
1198
1199           If the base image is smaller than top, then the base image
1200           will be resized to be the same size as top.  If top is
1201           smaller than the base image, the base will not be
1202           truncated.  If you want the base image size to match the
1203           size of the smaller top, you can safely truncate it
1204           yourself once the commit operation successfully completes.
1205           (json-string)
1206 - "speed":  the maximum speed, in bytes per second (json-int, optional)
1207
1208
1209 Example:
1210
1211 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1212                                               "top": "/tmp/snap1.qcow2" } }
1213 <- { "return": {} }
1214
1215 EQMP
1216
1217     {
1218         .name       = "drive-backup",
1219         .args_type  = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
1220                       "format:s?,bitmap:s?,on-source-error:s?,on-target-error:s?",
1221         .mhandler.cmd_new = qmp_marshal_drive_backup,
1222     },
1223
1224 SQMP
1225 drive-backup
1226 ------------
1227
1228 Start a point-in-time copy of a block device to a new destination.  The
1229 status of ongoing drive-backup operations can be checked with
1230 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1231 The operation can be stopped before it has completed using the
1232 block-job-cancel command.
1233
1234 Arguments:
1235
1236 - "job-id": Identifier for the newly-created block job. If omitted,
1237             the device name will be used. (json-string, optional)
1238 - "device": the name of the device which should be copied.
1239             (json-string)
1240 - "target": the target of the new image. If the file exists, or if it is a
1241             device, the existing file/device will be used as the new
1242             destination.  If it does not exist, a new file will be created.
1243             (json-string)
1244 - "format": the format of the new destination, default is to probe if 'mode' is
1245             'existing', else the format of the source
1246             (json-string, optional)
1247 - "sync": what parts of the disk image should be copied to the destination;
1248   possibilities include "full" for all the disk, "top" for only the sectors
1249   allocated in the topmost image, "incremental" for only the dirty sectors in
1250   the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1251 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1252             is "incremental", must NOT be present otherwise.
1253 - "mode": whether and how QEMU should create a new image
1254           (NewImageMode, optional, default 'absolute-paths')
1255 - "speed": the maximum speed, in bytes per second (json-int, optional)
1256 - "on-source-error": the action to take on an error on the source, default
1257                      'report'.  'stop' and 'enospc' can only be used
1258                      if the block device supports io-status.
1259                      (BlockdevOnError, optional)
1260 - "on-target-error": the action to take on an error on the target, default
1261                      'report' (no limitations, since this applies to
1262                      a different block device than device).
1263                      (BlockdevOnError, optional)
1264
1265 Example:
1266 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1267                                                "sync": "full",
1268                                                "target": "backup.img" } }
1269 <- { "return": {} }
1270
1271 EQMP
1272
1273     {
1274         .name       = "blockdev-backup",
1275         .args_type  = "job-id:s?,sync:s,device:B,target:B,speed:i?,"
1276                       "on-source-error:s?,on-target-error:s?",
1277         .mhandler.cmd_new = qmp_marshal_blockdev_backup,
1278     },
1279
1280 SQMP
1281 blockdev-backup
1282 ---------------
1283
1284 The device version of drive-backup: this command takes an existing named device
1285 as backup target.
1286
1287 Arguments:
1288
1289 - "job-id": Identifier for the newly-created block job. If omitted,
1290             the device name will be used. (json-string, optional)
1291 - "device": the name of the device which should be copied.
1292             (json-string)
1293 - "target": the name of the backup target device. (json-string)
1294 - "sync": what parts of the disk image should be copied to the destination;
1295           possibilities include "full" for all the disk, "top" for only the
1296           sectors allocated in the topmost image, or "none" to only replicate
1297           new I/O (MirrorSyncMode).
1298 - "speed": the maximum speed, in bytes per second (json-int, optional)
1299 - "on-source-error": the action to take on an error on the source, default
1300                      'report'.  'stop' and 'enospc' can only be used
1301                      if the block device supports io-status.
1302                      (BlockdevOnError, optional)
1303 - "on-target-error": the action to take on an error on the target, default
1304                      'report' (no limitations, since this applies to
1305                      a different block device than device).
1306                      (BlockdevOnError, optional)
1307
1308 Example:
1309 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1310                                                   "sync": "full",
1311                                                   "target": "tgt-id" } }
1312 <- { "return": {} }
1313
1314 EQMP
1315
1316     {
1317         .name       = "block-job-set-speed",
1318         .args_type  = "device:B,speed:o",
1319         .mhandler.cmd_new = qmp_marshal_block_job_set_speed,
1320     },
1321
1322     {
1323         .name       = "block-job-cancel",
1324         .args_type  = "device:B,force:b?",
1325         .mhandler.cmd_new = qmp_marshal_block_job_cancel,
1326     },
1327     {
1328         .name       = "block-job-pause",
1329         .args_type  = "device:B",
1330         .mhandler.cmd_new = qmp_marshal_block_job_pause,
1331     },
1332     {
1333         .name       = "block-job-resume",
1334         .args_type  = "device:B",
1335         .mhandler.cmd_new = qmp_marshal_block_job_resume,
1336     },
1337     {
1338         .name       = "block-job-complete",
1339         .args_type  = "device:B",
1340         .mhandler.cmd_new = qmp_marshal_block_job_complete,
1341     },
1342     {
1343         .name       = "transaction",
1344         .args_type  = "actions:q,properties:q?",
1345         .mhandler.cmd_new = qmp_marshal_transaction,
1346     },
1347
1348 SQMP
1349 transaction
1350 -----------
1351
1352 Atomically operate on one or more block devices.  Operations that are
1353 currently supported:
1354
1355     - drive-backup
1356     - blockdev-backup
1357     - blockdev-snapshot-sync
1358     - blockdev-snapshot-internal-sync
1359     - abort
1360     - block-dirty-bitmap-add
1361     - block-dirty-bitmap-clear
1362
1363 Refer to the qemu/qapi-schema.json file for minimum required QEMU
1364 versions for these operations.  A list of dictionaries is accepted,
1365 that contains the actions to be performed.  If there is any failure
1366 performing any of the operations, all operations for the group are
1367 abandoned.
1368
1369 For external snapshots, the dictionary contains the device, the file to use for
1370 the new snapshot, and the format.  The default format, if not specified, is
1371 qcow2.
1372
1373 Each new snapshot defaults to being created by QEMU (wiping any
1374 contents if the file already exists), but it is also possible to reuse
1375 an externally-created file.  In the latter case, you should ensure that
1376 the new image file has the same contents as the current one; QEMU cannot
1377 perform any meaningful check.  Typically this is achieved by using the
1378 current image file as the backing file for the new image.
1379
1380 On failure, the original disks pre-snapshot attempt will be used.
1381
1382 For internal snapshots, the dictionary contains the device and the snapshot's
1383 name.  If an internal snapshot matching name already exists, the request will
1384 be rejected.  Only some image formats support it, for example, qcow2, rbd,
1385 and sheepdog.
1386
1387 On failure, qemu will try delete the newly created internal snapshot in the
1388 transaction.  When an I/O error occurs during deletion, the user needs to fix
1389 it later with qemu-img or other command.
1390
1391 Arguments:
1392
1393 actions array:
1394     - "type": the operation to perform (json-string).  Possible
1395               values: "drive-backup", "blockdev-backup",
1396                       "blockdev-snapshot-sync",
1397                       "blockdev-snapshot-internal-sync",
1398                       "abort", "block-dirty-bitmap-add",
1399                       "block-dirty-bitmap-clear"
1400     - "data": a dictionary.  The contents depend on the value
1401       of "type".  When "type" is "blockdev-snapshot-sync":
1402       - "device": device name to snapshot (json-string)
1403       - "node-name": graph node name to snapshot (json-string)
1404       - "snapshot-file": name of new image file (json-string)
1405       - "snapshot-node-name": graph node name of the new snapshot (json-string)
1406       - "format": format of new image (json-string, optional)
1407       - "mode": whether and how QEMU should create the snapshot file
1408         (NewImageMode, optional, default "absolute-paths")
1409       When "type" is "blockdev-snapshot-internal-sync":
1410       - "device": device name to snapshot (json-string)
1411       - "name": name of the new snapshot (json-string)
1412
1413 Example:
1414
1415 -> { "execute": "transaction",
1416      "arguments": { "actions": [
1417          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1418                                          "snapshot-file": "/some/place/my-image",
1419                                          "format": "qcow2" } },
1420          { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1421                                          "snapshot-file": "/some/place/my-image2",
1422                                          "snapshot-node-name": "node3432",
1423                                          "mode": "existing",
1424                                          "format": "qcow2" } },
1425          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1426                                          "snapshot-file": "/some/place/my-image2",
1427                                          "mode": "existing",
1428                                          "format": "qcow2" } },
1429          { "type": "blockdev-snapshot-internal-sync", "data" : {
1430                                          "device": "ide-hd2",
1431                                          "name": "snapshot0" } } ] } }
1432 <- { "return": {} }
1433
1434 EQMP
1435
1436     {
1437         .name       = "block-dirty-bitmap-add",
1438         .args_type  = "node:B,name:s,granularity:i?",
1439         .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_add,
1440     },
1441
1442 SQMP
1443
1444 block-dirty-bitmap-add
1445 ----------------------
1446 Since 2.4
1447
1448 Create a dirty bitmap with a name on the device, and start tracking the writes.
1449
1450 Arguments:
1451
1452 - "node": device/node on which to create dirty bitmap (json-string)
1453 - "name": name of the new dirty bitmap (json-string)
1454 - "granularity": granularity to track writes with (int, optional)
1455
1456 Example:
1457
1458 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1459                                                    "name": "bitmap0" } }
1460 <- { "return": {} }
1461
1462 EQMP
1463
1464     {
1465         .name       = "block-dirty-bitmap-remove",
1466         .args_type  = "node:B,name:s",
1467         .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_remove,
1468     },
1469
1470 SQMP
1471
1472 block-dirty-bitmap-remove
1473 -------------------------
1474 Since 2.4
1475
1476 Stop write tracking and remove the dirty bitmap that was created with
1477 block-dirty-bitmap-add.
1478
1479 Arguments:
1480
1481 - "node": device/node on which to remove dirty bitmap (json-string)
1482 - "name": name of the dirty bitmap to remove (json-string)
1483
1484 Example:
1485
1486 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1487                                                       "name": "bitmap0" } }
1488 <- { "return": {} }
1489
1490 EQMP
1491
1492     {
1493         .name       = "block-dirty-bitmap-clear",
1494         .args_type  = "node:B,name:s",
1495         .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_clear,
1496     },
1497
1498 SQMP
1499
1500 block-dirty-bitmap-clear
1501 ------------------------
1502 Since 2.4
1503
1504 Reset the dirty bitmap associated with a node so that an incremental backup
1505 from this point in time forward will only backup clusters modified after this
1506 clear operation.
1507
1508 Arguments:
1509
1510 - "node": device/node on which to remove dirty bitmap (json-string)
1511 - "name": name of the dirty bitmap to remove (json-string)
1512
1513 Example:
1514
1515 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1516                                                            "name": "bitmap0" } }
1517 <- { "return": {} }
1518
1519 EQMP
1520
1521     {
1522         .name       = "blockdev-snapshot-sync",
1523         .args_type  = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1524         .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_sync,
1525     },
1526
1527 SQMP
1528 blockdev-snapshot-sync
1529 ----------------------
1530
1531 Synchronous snapshot of a block device. snapshot-file specifies the
1532 target of the new image. If the file exists, or if it is a device, the
1533 snapshot will be created in the existing file/device. If does not
1534 exist, a new file will be created. format specifies the format of the
1535 snapshot image, default is qcow2.
1536
1537 Arguments:
1538
1539 - "device": device name to snapshot (json-string)
1540 - "node-name": graph node name to snapshot (json-string)
1541 - "snapshot-file": name of new image file (json-string)
1542 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1543 - "mode": whether and how QEMU should create the snapshot file
1544   (NewImageMode, optional, default "absolute-paths")
1545 - "format": format of new image (json-string, optional)
1546
1547 Example:
1548
1549 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1550                                                          "snapshot-file":
1551                                                         "/some/place/my-image",
1552                                                         "format": "qcow2" } }
1553 <- { "return": {} }
1554
1555 EQMP
1556
1557     {
1558         .name       = "blockdev-snapshot",
1559         .args_type  = "node:s,overlay:s",
1560         .mhandler.cmd_new = qmp_marshal_blockdev_snapshot,
1561     },
1562
1563 SQMP
1564 blockdev-snapshot
1565 -----------------
1566 Since 2.5
1567
1568 Create a snapshot, by installing 'node' as the backing image of
1569 'overlay'. Additionally, if 'node' is associated with a block
1570 device, the block device changes to using 'overlay' as its new active
1571 image.
1572
1573 Arguments:
1574
1575 - "node": device that will have a snapshot created (json-string)
1576 - "overlay": device that will have 'node' as its backing image (json-string)
1577
1578 Example:
1579
1580 -> { "execute": "blockdev-add",
1581                 "arguments": { "options": { "driver": "qcow2",
1582                                             "node-name": "node1534",
1583                                             "file": { "driver": "file",
1584                                                       "filename": "hd1.qcow2" },
1585                                             "backing": "" } } }
1586
1587 <- { "return": {} }
1588
1589 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1590                                                     "overlay": "node1534" } }
1591 <- { "return": {} }
1592
1593 EQMP
1594
1595     {
1596         .name       = "blockdev-snapshot-internal-sync",
1597         .args_type  = "device:B,name:s",
1598         .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_internal_sync,
1599     },
1600
1601 SQMP
1602 blockdev-snapshot-internal-sync
1603 -------------------------------
1604
1605 Synchronously take an internal snapshot of a block device when the format of
1606 image used supports it.  If the name is an empty string, or a snapshot with
1607 name already exists, the operation will fail.
1608
1609 Arguments:
1610
1611 - "device": device name to snapshot (json-string)
1612 - "name": name of the new snapshot (json-string)
1613
1614 Example:
1615
1616 -> { "execute": "blockdev-snapshot-internal-sync",
1617                 "arguments": { "device": "ide-hd0",
1618                                "name": "snapshot0" }
1619    }
1620 <- { "return": {} }
1621
1622 EQMP
1623
1624     {
1625         .name       = "blockdev-snapshot-delete-internal-sync",
1626         .args_type  = "device:B,id:s?,name:s?",
1627         .mhandler.cmd_new =
1628                       qmp_marshal_blockdev_snapshot_delete_internal_sync,
1629     },
1630
1631 SQMP
1632 blockdev-snapshot-delete-internal-sync
1633 --------------------------------------
1634
1635 Synchronously delete an internal snapshot of a block device when the format of
1636 image used supports it.  The snapshot is identified by name or id or both.  One
1637 of name or id is required.  If the snapshot is not found, the operation will
1638 fail.
1639
1640 Arguments:
1641
1642 - "device": device name (json-string)
1643 - "id": ID of the snapshot (json-string, optional)
1644 - "name": name of the snapshot (json-string, optional)
1645
1646 Example:
1647
1648 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1649                 "arguments": { "device": "ide-hd0",
1650                                "name": "snapshot0" }
1651    }
1652 <- { "return": {
1653                    "id": "1",
1654                    "name": "snapshot0",
1655                    "vm-state-size": 0,
1656                    "date-sec": 1000012,
1657                    "date-nsec": 10,
1658                    "vm-clock-sec": 100,
1659                    "vm-clock-nsec": 20
1660      }
1661    }
1662
1663 EQMP
1664
1665     {
1666         .name       = "drive-mirror",
1667         .args_type  = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
1668                       "format:s?,node-name:s?,replaces:s?,"
1669                       "on-source-error:s?,on-target-error:s?,"
1670                       "unmap:b?,"
1671                       "granularity:i?,buf-size:i?",
1672         .mhandler.cmd_new = qmp_marshal_drive_mirror,
1673     },
1674
1675 SQMP
1676 drive-mirror
1677 ------------
1678
1679 Start mirroring a block device's writes to a new destination. target
1680 specifies the target of the new image. If the file exists, or if it is
1681 a device, it will be used as the new destination for writes. If it does not
1682 exist, a new file will be created. format specifies the format of the
1683 mirror image, default is to probe if mode='existing', else the format
1684 of the source.
1685
1686 Arguments:
1687
1688 - "job-id": Identifier for the newly-created block job. If omitted,
1689             the device name will be used. (json-string, optional)
1690 - "device": device name to operate on (json-string)
1691 - "target": name of new image file (json-string)
1692 - "format": format of new image (json-string, optional)
1693 - "node-name": the name of the new block driver state in the node graph
1694                (json-string, optional)
1695 - "replaces": the block driver node name to replace when finished
1696               (json-string, optional)
1697 - "mode": how an image file should be created into the target
1698   file/device (NewImageMode, optional, default 'absolute-paths')
1699 - "speed": maximum speed of the streaming job, in bytes per second
1700   (json-int)
1701 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1702 - "buf-size": maximum amount of data in flight from source to target, in bytes
1703   (json-int, default 10M)
1704 - "sync": what parts of the disk image should be copied to the destination;
1705   possibilities include "full" for all the disk, "top" for only the sectors
1706   allocated in the topmost image, or "none" to only replicate new I/O
1707   (MirrorSyncMode).
1708 - "on-source-error": the action to take on an error on the source
1709   (BlockdevOnError, default 'report')
1710 - "on-target-error": the action to take on an error on the target
1711   (BlockdevOnError, default 'report')
1712 - "unmap": whether the target sectors should be discarded where source has only
1713   zeroes. (json-bool, optional, default true)
1714
1715 The default value of the granularity is the image cluster size clamped
1716 between 4096 and 65536, if the image format defines one.  If the format
1717 does not define a cluster size, the default value of the granularity
1718 is 65536.
1719
1720
1721 Example:
1722
1723 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1724                                                "target": "/some/place/my-image",
1725                                                "sync": "full",
1726                                                "format": "qcow2" } }
1727 <- { "return": {} }
1728
1729 EQMP
1730
1731     {
1732         .name       = "blockdev-mirror",
1733         .args_type  = "job-id:s?,sync:s,device:B,target:B,replaces:s?,speed:i?,"
1734                       "on-source-error:s?,on-target-error:s?,"
1735                       "granularity:i?,buf-size:i?",
1736         .mhandler.cmd_new = qmp_marshal_blockdev_mirror,
1737     },
1738
1739 SQMP
1740 blockdev-mirror
1741 ------------
1742
1743 Start mirroring a block device's writes to another block device. target
1744 specifies the target of mirror operation.
1745
1746 Arguments:
1747
1748 - "job-id": Identifier for the newly-created block job. If omitted,
1749             the device name will be used. (json-string, optional)
1750 - "device": device name to operate on (json-string)
1751 - "target": device name to mirror to (json-string)
1752 - "replaces": the block driver node name to replace when finished
1753               (json-string, optional)
1754 - "speed": maximum speed of the streaming job, in bytes per second
1755   (json-int)
1756 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1757 - "buf_size": maximum amount of data in flight from source to target, in bytes
1758   (json-int, default 10M)
1759 - "sync": what parts of the disk image should be copied to the destination;
1760   possibilities include "full" for all the disk, "top" for only the sectors
1761   allocated in the topmost image, or "none" to only replicate new I/O
1762   (MirrorSyncMode).
1763 - "on-source-error": the action to take on an error on the source
1764   (BlockdevOnError, default 'report')
1765 - "on-target-error": the action to take on an error on the target
1766   (BlockdevOnError, default 'report')
1767
1768 The default value of the granularity is the image cluster size clamped
1769 between 4096 and 65536, if the image format defines one.  If the format
1770 does not define a cluster size, the default value of the granularity
1771 is 65536.
1772
1773 Example:
1774
1775 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1776                                                   "target": "target0",
1777                                                   "sync": "full" } }
1778 <- { "return": {} }
1779
1780 EQMP
1781     {
1782         .name       = "change-backing-file",
1783         .args_type  = "device:s,image-node-name:s,backing-file:s",
1784         .mhandler.cmd_new = qmp_marshal_change_backing_file,
1785     },
1786
1787 SQMP
1788 change-backing-file
1789 -------------------
1790 Since: 2.1
1791
1792 Change the backing file in the image file metadata.  This does not cause
1793 QEMU to reopen the image file to reparse the backing filename (it may,
1794 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1795 if needed). The new backing file string is written into the image file
1796 metadata, and the QEMU internal strings are updated.
1797
1798 Arguments:
1799
1800 - "image-node-name":    The name of the block driver state node of the
1801                         image to modify.  The "device" is argument is used to
1802                         verify "image-node-name" is in the chain described by
1803                         "device".
1804                         (json-string, optional)
1805
1806 - "device":             The name of the device.
1807                         (json-string)
1808
1809 - "backing-file":       The string to write as the backing file.  This string is
1810                         not validated, so care should be taken when specifying
1811                         the string or the image chain may not be able to be
1812                         reopened again.
1813                         (json-string)
1814
1815 Returns: Nothing on success
1816          If "device" does not exist or cannot be determined, DeviceNotFound
1817
1818 EQMP
1819
1820     {
1821         .name       = "balloon",
1822         .args_type  = "value:M",
1823         .mhandler.cmd_new = qmp_marshal_balloon,
1824     },
1825
1826 SQMP
1827 balloon
1828 -------
1829
1830 Request VM to change its memory allocation (in bytes).
1831
1832 Arguments:
1833
1834 - "value": New memory allocation (json-int)
1835
1836 Example:
1837
1838 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1839 <- { "return": {} }
1840
1841 EQMP
1842
1843     {
1844         .name       = "set_link",
1845         .args_type  = "name:s,up:b",
1846         .mhandler.cmd_new = qmp_marshal_set_link,
1847     },
1848
1849 SQMP
1850 set_link
1851 --------
1852
1853 Change the link status of a network adapter.
1854
1855 Arguments:
1856
1857 - "name": network device name (json-string)
1858 - "up": status is up (json-bool)
1859
1860 Example:
1861
1862 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1863 <- { "return": {} }
1864
1865 EQMP
1866
1867
1868     {
1869         .name       = "get_link",
1870         .args_type  = "name:s",
1871         .mhandler.cmd_new = qmp_marshal_get_link,
1872     },
1873
1874 SQMP
1875 get_link
1876 --------
1877
1878 Get the link status of a network adapter.
1879
1880 Arguments:
1881
1882 - "name": network device name (json-string)
1883
1884 Example:
1885
1886 -> { "execute": "get_link", "arguments": { "name": "e1000.0" } }
1887 <- { "return": {on|off} }
1888
1889 EQMP
1890
1891     {
1892         .name       = "getfd",
1893         .args_type  = "fdname:s",
1894         .params     = "getfd name",
1895         .help       = "receive a file descriptor via SCM rights and assign it a name",
1896         .mhandler.cmd_new = qmp_marshal_getfd,
1897     },
1898
1899 SQMP
1900 getfd
1901 -----
1902
1903 Receive a file descriptor via SCM rights and assign it a name.
1904
1905 Arguments:
1906
1907 - "fdname": file descriptor name (json-string)
1908
1909 Example:
1910
1911 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1912 <- { "return": {} }
1913
1914 Notes:
1915
1916 (1) If the name specified by the "fdname" argument already exists,
1917     the file descriptor assigned to it will be closed and replaced
1918     by the received file descriptor.
1919 (2) The 'closefd' command can be used to explicitly close the file
1920     descriptor when it is no longer needed.
1921
1922 EQMP
1923
1924     {
1925         .name       = "closefd",
1926         .args_type  = "fdname:s",
1927         .params     = "closefd name",
1928         .help       = "close a file descriptor previously passed via SCM rights",
1929         .mhandler.cmd_new = qmp_marshal_closefd,
1930     },
1931
1932 SQMP
1933 closefd
1934 -------
1935
1936 Close a file descriptor previously passed via SCM rights.
1937
1938 Arguments:
1939
1940 - "fdname": file descriptor name (json-string)
1941
1942 Example:
1943
1944 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1945 <- { "return": {} }
1946
1947 EQMP
1948
1949      {
1950         .name       = "add-fd",
1951         .args_type  = "fdset-id:i?,opaque:s?",
1952         .params     = "add-fd fdset-id opaque",
1953         .help       = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1954         .mhandler.cmd_new = qmp_marshal_add_fd,
1955     },
1956
1957 SQMP
1958 add-fd
1959 -------
1960
1961 Add a file descriptor, that was passed via SCM rights, to an fd set.
1962
1963 Arguments:
1964
1965 - "fdset-id": The ID of the fd set to add the file descriptor to.
1966               (json-int, optional)
1967 - "opaque": A free-form string that can be used to describe the fd.
1968             (json-string, optional)
1969
1970 Return a json-object with the following information:
1971
1972 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1973 - "fd": The file descriptor that was received via SCM rights and added to the
1974         fd set. (json-int)
1975
1976 Example:
1977
1978 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1979 <- { "return": { "fdset-id": 1, "fd": 3 } }
1980
1981 Notes:
1982
1983 (1) The list of fd sets is shared by all monitor connections.
1984 (2) If "fdset-id" is not specified, a new fd set will be created.
1985
1986 EQMP
1987
1988      {
1989         .name       = "remove-fd",
1990         .args_type  = "fdset-id:i,fd:i?",
1991         .params     = "remove-fd fdset-id fd",
1992         .help       = "Remove a file descriptor from an fd set",
1993         .mhandler.cmd_new = qmp_marshal_remove_fd,
1994     },
1995
1996 SQMP
1997 remove-fd
1998 ---------
1999
2000 Remove a file descriptor from an fd set.
2001
2002 Arguments:
2003
2004 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
2005               (json-int)
2006 - "fd": The file descriptor that is to be removed. (json-int, optional)
2007
2008 Example:
2009
2010 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
2011 <- { "return": {} }
2012
2013 Notes:
2014
2015 (1) The list of fd sets is shared by all monitor connections.
2016 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
2017     removed.
2018
2019 EQMP
2020
2021     {
2022         .name       = "query-fdsets",
2023         .args_type  = "",
2024         .help       = "Return information describing all fd sets",
2025         .mhandler.cmd_new = qmp_marshal_query_fdsets,
2026     },
2027
2028 SQMP
2029 query-fdsets
2030 -------------
2031
2032 Return information describing all fd sets.
2033
2034 Arguments: None
2035
2036 Example:
2037
2038 -> { "execute": "query-fdsets" }
2039 <- { "return": [
2040        {
2041          "fds": [
2042            {
2043              "fd": 30,
2044              "opaque": "rdonly:/path/to/file"
2045            },
2046            {
2047              "fd": 24,
2048              "opaque": "rdwr:/path/to/file"
2049            }
2050          ],
2051          "fdset-id": 1
2052        },
2053        {
2054          "fds": [
2055            {
2056              "fd": 28
2057            },
2058            {
2059              "fd": 29
2060            }
2061          ],
2062          "fdset-id": 0
2063        }
2064      ]
2065    }
2066
2067 Note: The list of fd sets is shared by all monitor connections.
2068
2069 EQMP
2070
2071     {
2072         .name       = "block_passwd",
2073         .args_type  = "device:s?,node-name:s?,password:s",
2074         .mhandler.cmd_new = qmp_marshal_block_passwd,
2075     },
2076
2077 SQMP
2078 block_passwd
2079 ------------
2080
2081 Set the password of encrypted block devices.
2082
2083 Arguments:
2084
2085 - "device": device name (json-string)
2086 - "node-name": name in the block driver state graph (json-string)
2087 - "password": password (json-string)
2088
2089 Example:
2090
2091 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
2092                                                "password": "12345" } }
2093 <- { "return": {} }
2094
2095 EQMP
2096
2097     {
2098         .name       = "block_set_io_throttle",
2099         .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?",
2100         .mhandler.cmd_new = qmp_marshal_block_set_io_throttle,
2101     },
2102
2103 SQMP
2104 block_set_io_throttle
2105 ------------
2106
2107 Change I/O throttle limits for a block drive.
2108
2109 Arguments:
2110
2111 - "device": device name (json-string)
2112 - "bps": total throughput limit in bytes per second (json-int)
2113 - "bps_rd": read throughput limit in bytes per second (json-int)
2114 - "bps_wr": write throughput limit in bytes per second (json-int)
2115 - "iops": total I/O operations per second (json-int)
2116 - "iops_rd": read I/O operations per second (json-int)
2117 - "iops_wr": write I/O operations per second (json-int)
2118 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
2119 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
2120 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
2121 - "iops_max": total I/O operations per second during bursts (json-int, optional)
2122 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
2123 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
2124 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
2125 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
2126 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
2127 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
2128 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
2129 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
2130 - "iops_size":  I/O size in bytes when limiting (json-int, optional)
2131 - "group": throttle group name (json-string, optional)
2132
2133 Example:
2134
2135 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
2136                                                "bps": 1000000,
2137                                                "bps_rd": 0,
2138                                                "bps_wr": 0,
2139                                                "iops": 0,
2140                                                "iops_rd": 0,
2141                                                "iops_wr": 0,
2142                                                "bps_max": 8000000,
2143                                                "bps_rd_max": 0,
2144                                                "bps_wr_max": 0,
2145                                                "iops_max": 0,
2146                                                "iops_rd_max": 0,
2147                                                "iops_wr_max": 0,
2148                                                "bps_max_length": 60,
2149                                                "iops_size": 0 } }
2150 <- { "return": {} }
2151
2152 EQMP
2153
2154     {
2155         .name       = "set_password",
2156         .args_type  = "protocol:s,password:s,connected:s?",
2157         .mhandler.cmd_new = qmp_marshal_set_password,
2158     },
2159
2160 SQMP
2161 set_password
2162 ------------
2163
2164 Set the password for vnc/spice protocols.
2165
2166 Arguments:
2167
2168 - "protocol": protocol name (json-string)
2169 - "password": password (json-string)
2170 - "connected": [ keep | disconnect | fail ] (json-string, optional)
2171
2172 Example:
2173
2174 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2175                                                "password": "secret" } }
2176 <- { "return": {} }
2177
2178 EQMP
2179
2180     {
2181         .name       = "expire_password",
2182         .args_type  = "protocol:s,time:s",
2183         .mhandler.cmd_new = qmp_marshal_expire_password,
2184     },
2185
2186 SQMP
2187 expire_password
2188 ---------------
2189
2190 Set the password expire time for vnc/spice protocols.
2191
2192 Arguments:
2193
2194 - "protocol": protocol name (json-string)
2195 - "time": [ now | never | +secs | secs ] (json-string)
2196
2197 Example:
2198
2199 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2200                                                   "time": "+60" } }
2201 <- { "return": {} }
2202
2203 EQMP
2204
2205     {
2206         .name       = "add_client",
2207         .args_type  = "protocol:s,fdname:s,skipauth:b?,tls:b?",
2208         .mhandler.cmd_new = qmp_marshal_add_client,
2209     },
2210
2211 SQMP
2212 add_client
2213 ----------
2214
2215 Add a graphics client
2216
2217 Arguments:
2218
2219 - "protocol": protocol name (json-string)
2220 - "fdname": file descriptor name (json-string)
2221 - "skipauth": whether to skip authentication (json-bool, optional)
2222 - "tls": whether to perform TLS (json-bool, optional)
2223
2224 Example:
2225
2226 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
2227                                              "fdname": "myclient" } }
2228 <- { "return": {} }
2229
2230 EQMP
2231     {
2232         .name       = "qmp_capabilities",
2233         .args_type  = "",
2234         .params     = "",
2235         .help       = "enable QMP capabilities",
2236         .mhandler.cmd_new = qmp_capabilities,
2237     },
2238
2239 SQMP
2240 qmp_capabilities
2241 ----------------
2242
2243 Enable QMP capabilities.
2244
2245 Arguments: None.
2246
2247 Example:
2248
2249 -> { "execute": "qmp_capabilities" }
2250 <- { "return": {} }
2251
2252 Note: This command must be issued before issuing any other command.
2253
2254 EQMP
2255
2256     {
2257         .name       = "human-monitor-command",
2258         .args_type  = "command-line:s,cpu-index:i?",
2259         .mhandler.cmd_new = qmp_marshal_human_monitor_command,
2260     },
2261
2262 SQMP
2263 human-monitor-command
2264 ---------------------
2265
2266 Execute a Human Monitor command.
2267
2268 Arguments: 
2269
2270 - command-line: the command name and its arguments, just like the
2271                 Human Monitor's shell (json-string)
2272 - cpu-index: select the CPU number to be used by commands which access CPU
2273              data, like 'info registers'. The Monitor selects CPU 0 if this
2274              argument is not provided (json-int, optional)
2275
2276 Example:
2277
2278 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2279 <- { "return": "kvm support: enabled\r\n" }
2280
2281 Notes:
2282
2283 (1) The Human Monitor is NOT an stable interface, this means that command
2284     names, arguments and responses can change or be removed at ANY time.
2285     Applications that rely on long term stability guarantees should NOT
2286     use this command
2287
2288 (2) Limitations:
2289
2290     o This command is stateless, this means that commands that depend
2291       on state information (such as getfd) might not work
2292
2293     o Commands that prompt the user for data (eg. 'cont' when the block
2294       device is encrypted) don't currently work
2295
2296 3. Query Commands
2297 =================
2298
2299 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2300 HXCOMM this! We will possibly move query commands definitions inside those
2301 HXCOMM sections, just like regular commands.
2302
2303 EQMP
2304
2305 SQMP
2306 query-version
2307 -------------
2308
2309 Show QEMU version.
2310
2311 Return a json-object with the following information:
2312
2313 - "qemu": A json-object containing three integer values:
2314     - "major": QEMU's major version (json-int)
2315     - "minor": QEMU's minor version (json-int)
2316     - "micro": QEMU's micro version (json-int)
2317 - "package": package's version (json-string)
2318
2319 Example:
2320
2321 -> { "execute": "query-version" }
2322 <- {
2323       "return":{
2324          "qemu":{
2325             "major":0,
2326             "minor":11,
2327             "micro":5
2328          },
2329          "package":""
2330       }
2331    }
2332
2333 EQMP
2334
2335     {
2336         .name       = "query-version",
2337         .args_type  = "",
2338         .mhandler.cmd_new = qmp_marshal_query_version,
2339     },
2340
2341 SQMP
2342 query-commands
2343 --------------
2344
2345 List QMP available commands.
2346
2347 Each command is represented by a json-object, the returned value is a json-array
2348 of all commands.
2349
2350 Each json-object contain:
2351
2352 - "name": command's name (json-string)
2353
2354 Example:
2355
2356 -> { "execute": "query-commands" }
2357 <- {
2358       "return":[
2359          {
2360             "name":"query-balloon"
2361          },
2362          {
2363             "name":"system_powerdown"
2364          }
2365       ]
2366    }
2367
2368 Note: This example has been shortened as the real response is too long.
2369
2370 EQMP
2371
2372     {
2373         .name       = "query-commands",
2374         .args_type  = "",
2375         .mhandler.cmd_new = qmp_marshal_query_commands,
2376     },
2377
2378 SQMP
2379 query-events
2380 --------------
2381
2382 List QMP available events.
2383
2384 Each event is represented by a json-object, the returned value is a json-array
2385 of all events.
2386
2387 Each json-object contains:
2388
2389 - "name": event's name (json-string)
2390
2391 Example:
2392
2393 -> { "execute": "query-events" }
2394 <- {
2395       "return":[
2396          {
2397             "name":"SHUTDOWN"
2398          },
2399          {
2400             "name":"RESET"
2401          }
2402       ]
2403    }
2404
2405 Note: This example has been shortened as the real response is too long.
2406
2407 EQMP
2408
2409     {
2410         .name       = "query-events",
2411         .args_type  = "",
2412         .mhandler.cmd_new = qmp_marshal_query_events,
2413     },
2414
2415 SQMP
2416 query-qmp-schema
2417 ----------------
2418
2419 Return the QMP wire schema.  The returned value is a json-array of
2420 named schema entities.  Entities are commands, events and various
2421 types.  See docs/qapi-code-gen.txt for information on their structure
2422 and intended use.
2423
2424 EQMP
2425
2426     {
2427         .name       = "query-qmp-schema",
2428         .args_type  = "",
2429         .mhandler.cmd_new = qmp_query_qmp_schema,
2430     },
2431
2432 SQMP
2433 query-chardev
2434 -------------
2435
2436 Each device is represented by a json-object. The returned value is a json-array
2437 of all devices.
2438
2439 Each json-object contain the following:
2440
2441 - "label": device's label (json-string)
2442 - "filename": device's file (json-string)
2443 - "frontend-open": open/closed state of the frontend device attached to this
2444                    backend (json-bool)
2445
2446 Example:
2447
2448 -> { "execute": "query-chardev" }
2449 <- {
2450       "return": [
2451          {
2452             "label": "charchannel0",
2453             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2454             "frontend-open": false
2455          },
2456          {
2457             "label": "charmonitor",
2458             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2459             "frontend-open": true
2460          },
2461          {
2462             "label": "charserial0",
2463             "filename": "pty:/dev/pts/2",
2464             "frontend-open": true
2465          }
2466       ]
2467    }
2468
2469 EQMP
2470
2471     {
2472         .name       = "query-chardev",
2473         .args_type  = "",
2474         .mhandler.cmd_new = qmp_marshal_query_chardev,
2475     },
2476
2477 SQMP
2478 query-chardev-backends
2479 -------------
2480
2481 List available character device backends.
2482
2483 Each backend is represented by a json-object, the returned value is a json-array
2484 of all backends.
2485
2486 Each json-object contains:
2487
2488 - "name": backend name (json-string)
2489
2490 Example:
2491
2492 -> { "execute": "query-chardev-backends" }
2493 <- {
2494       "return":[
2495          {
2496             "name":"udp"
2497          },
2498          {
2499             "name":"tcp"
2500          },
2501          {
2502             "name":"unix"
2503          },
2504          {
2505             "name":"spiceport"
2506          }
2507       ]
2508    }
2509
2510 EQMP
2511
2512     {
2513         .name       = "query-chardev-backends",
2514         .args_type  = "",
2515         .mhandler.cmd_new = qmp_marshal_query_chardev_backends,
2516     },
2517
2518 SQMP
2519 query-block
2520 -----------
2521
2522 Show the block devices.
2523
2524 Each block device information is stored in a json-object and the returned value
2525 is a json-array of all devices.
2526
2527 Each json-object contain the following:
2528
2529 - "device": device name (json-string)
2530 - "type": device type (json-string)
2531          - deprecated, retained for backward compatibility
2532          - Possible values: "unknown"
2533 - "removable": true if the device is removable, false otherwise (json-bool)
2534 - "locked": true if the device is locked, false otherwise (json-bool)
2535 - "tray_open": only present if removable, true if the device has a tray,
2536                and it is open (json-bool)
2537 - "inserted": only present if the device is inserted, it is a json-object
2538    containing the following:
2539          - "file": device file name (json-string)
2540          - "ro": true if read-only, false otherwise (json-bool)
2541          - "drv": driver format name (json-string)
2542              - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2543                                 "file", "file", "ftp", "ftps", "host_cdrom",
2544                                 "host_device", "http", "https",
2545                                 "nbd", "parallels", "qcow", "qcow2", "raw",
2546                                 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2547          - "backing_file": backing file name (json-string, optional)
2548          - "backing_file_depth": number of files in the backing file chain (json-int)
2549          - "encrypted": true if encrypted, false otherwise (json-bool)
2550          - "bps": limit total bytes per second (json-int)
2551          - "bps_rd": limit read bytes per second (json-int)
2552          - "bps_wr": limit write bytes per second (json-int)
2553          - "iops": limit total I/O operations per second (json-int)
2554          - "iops_rd": limit read operations per second (json-int)
2555          - "iops_wr": limit write operations per second (json-int)
2556          - "bps_max":  total max in bytes (json-int)
2557          - "bps_rd_max":  read max in bytes (json-int)
2558          - "bps_wr_max":  write max in bytes (json-int)
2559          - "iops_max":  total I/O operations max (json-int)
2560          - "iops_rd_max":  read I/O operations max (json-int)
2561          - "iops_wr_max":  write I/O operations max (json-int)
2562          - "iops_size": I/O size when limiting by iops (json-int)
2563          - "detect_zeroes": detect and optimize zero writing (json-string)
2564              - Possible values: "off", "on", "unmap"
2565          - "write_threshold": write offset threshold in bytes, a event will be
2566                               emitted if crossed. Zero if disabled (json-int)
2567          - "image": the detail of the image, it is a json-object containing
2568             the following:
2569              - "filename": image file name (json-string)
2570              - "format": image format (json-string)
2571              - "virtual-size": image capacity in bytes (json-int)
2572              - "dirty-flag": true if image is not cleanly closed, not present
2573                              means clean (json-bool, optional)
2574              - "actual-size": actual size on disk in bytes of the image, not
2575                               present when image does not support thin
2576                               provision (json-int, optional)
2577              - "cluster-size": size of a cluster in bytes, not present if image
2578                                format does not support it (json-int, optional)
2579              - "encrypted": true if the image is encrypted, not present means
2580                             false or the image format does not support
2581                             encryption (json-bool, optional)
2582              - "backing_file": backing file name, not present means no backing
2583                                file is used or the image format does not
2584                                support backing file chain
2585                                (json-string, optional)
2586              - "full-backing-filename": full path of the backing file, not
2587                                         present if it equals backing_file or no
2588                                         backing file is used
2589                                         (json-string, optional)
2590              - "backing-filename-format": the format of the backing file, not
2591                                           present means unknown or no backing
2592                                           file (json-string, optional)
2593              - "snapshots": the internal snapshot info, it is an optional list
2594                 of json-object containing the following:
2595                  - "id": unique snapshot id (json-string)
2596                  - "name": snapshot name (json-string)
2597                  - "vm-state-size": size of the VM state in bytes (json-int)
2598                  - "date-sec": UTC date of the snapshot in seconds (json-int)
2599                  - "date-nsec": fractional part in nanoseconds to be used with
2600                                 date-sec (json-int)
2601                  - "vm-clock-sec": VM clock relative to boot in seconds
2602                                    (json-int)
2603                  - "vm-clock-nsec": fractional part in nanoseconds to be used
2604                                     with vm-clock-sec (json-int)
2605              - "backing-image": the detail of the backing image, it is an
2606                                 optional json-object only present when a
2607                                 backing image present for this image
2608
2609 - "io-status": I/O operation status, only present if the device supports it
2610                and the VM is configured to stop on errors. It's always reset
2611                to "ok" when the "cont" command is issued (json_string, optional)
2612              - Possible values: "ok", "failed", "nospace"
2613
2614 Example:
2615
2616 -> { "execute": "query-block" }
2617 <- {
2618       "return":[
2619          {
2620             "io-status": "ok",
2621             "device":"ide0-hd0",
2622             "locked":false,
2623             "removable":false,
2624             "inserted":{
2625                "ro":false,
2626                "drv":"qcow2",
2627                "encrypted":false,
2628                "file":"disks/test.qcow2",
2629                "backing_file_depth":1,
2630                "bps":1000000,
2631                "bps_rd":0,
2632                "bps_wr":0,
2633                "iops":1000000,
2634                "iops_rd":0,
2635                "iops_wr":0,
2636                "bps_max": 8000000,
2637                "bps_rd_max": 0,
2638                "bps_wr_max": 0,
2639                "iops_max": 0,
2640                "iops_rd_max": 0,
2641                "iops_wr_max": 0,
2642                "iops_size": 0,
2643                "detect_zeroes": "on",
2644                "write_threshold": 0,
2645                "image":{
2646                   "filename":"disks/test.qcow2",
2647                   "format":"qcow2",
2648                   "virtual-size":2048000,
2649                   "backing_file":"base.qcow2",
2650                   "full-backing-filename":"disks/base.qcow2",
2651                   "backing-filename-format":"qcow2",
2652                   "snapshots":[
2653                      {
2654                         "id": "1",
2655                         "name": "snapshot1",
2656                         "vm-state-size": 0,
2657                         "date-sec": 10000200,
2658                         "date-nsec": 12,
2659                         "vm-clock-sec": 206,
2660                         "vm-clock-nsec": 30
2661                      }
2662                   ],
2663                   "backing-image":{
2664                       "filename":"disks/base.qcow2",
2665                       "format":"qcow2",
2666                       "virtual-size":2048000
2667                   }
2668                }
2669             },
2670             "type":"unknown"
2671          },
2672          {
2673             "io-status": "ok",
2674             "device":"ide1-cd0",
2675             "locked":false,
2676             "removable":true,
2677             "type":"unknown"
2678          },
2679          {
2680             "device":"floppy0",
2681             "locked":false,
2682             "removable":true,
2683             "type":"unknown"
2684          },
2685          {
2686             "device":"sd0",
2687             "locked":false,
2688             "removable":true,
2689             "type":"unknown"
2690          }
2691       ]
2692    }
2693
2694 EQMP
2695
2696     {
2697         .name       = "query-block",
2698         .args_type  = "",
2699         .mhandler.cmd_new = qmp_marshal_query_block,
2700     },
2701
2702 SQMP
2703 query-blockstats
2704 ----------------
2705
2706 Show block device statistics.
2707
2708 Each device statistic information is stored in a json-object and the returned
2709 value is a json-array of all devices.
2710
2711 Each json-object contain the following:
2712
2713 - "device": device name (json-string)
2714 - "stats": A json-object with the statistics information, it contains:
2715     - "rd_bytes": bytes read (json-int)
2716     - "wr_bytes": bytes written (json-int)
2717     - "rd_operations": read operations (json-int)
2718     - "wr_operations": write operations (json-int)
2719     - "flush_operations": cache flush operations (json-int)
2720     - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2721     - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2722     - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2723     - "wr_highest_offset": The offset after the greatest byte written to the
2724                            BlockDriverState since it has been opened (json-int)
2725     - "rd_merged": number of read requests that have been merged into
2726                    another request (json-int)
2727     - "wr_merged": number of write requests that have been merged into
2728                    another request (json-int)
2729     - "idle_time_ns": time since the last I/O operation, in
2730                       nanoseconds. If the field is absent it means
2731                       that there haven't been any operations yet
2732                       (json-int, optional)
2733     - "failed_rd_operations": number of failed read operations
2734                               (json-int)
2735     - "failed_wr_operations": number of failed write operations
2736                               (json-int)
2737     - "failed_flush_operations": number of failed flush operations
2738                                (json-int)
2739     - "invalid_rd_operations": number of invalid read operations
2740                                (json-int)
2741     - "invalid_wr_operations": number of invalid write operations
2742                                (json-int)
2743     - "invalid_flush_operations": number of invalid flush operations
2744                                   (json-int)
2745     - "account_invalid": whether invalid operations are included in
2746                          the last access statistics (json-bool)
2747     - "account_failed": whether failed operations are included in the
2748                          latency and last access statistics
2749                          (json-bool)
2750     - "timed_stats": A json-array containing statistics collected in
2751                      specific intervals, with the following members:
2752         - "interval_length": interval used for calculating the
2753                              statistics, in seconds (json-int)
2754         - "min_rd_latency_ns": minimum latency of read operations in
2755                                the defined interval, in nanoseconds
2756                                (json-int)
2757         - "min_wr_latency_ns": minimum latency of write operations in
2758                                the defined interval, in nanoseconds
2759                                (json-int)
2760         - "min_flush_latency_ns": minimum latency of flush operations
2761                                   in the defined interval, in
2762                                   nanoseconds (json-int)
2763         - "max_rd_latency_ns": maximum latency of read operations in
2764                                the defined interval, in nanoseconds
2765                                (json-int)
2766         - "max_wr_latency_ns": maximum latency of write operations in
2767                                the defined interval, in nanoseconds
2768                                (json-int)
2769         - "max_flush_latency_ns": maximum latency of flush operations
2770                                   in the defined interval, in
2771                                   nanoseconds (json-int)
2772         - "avg_rd_latency_ns": average latency of read operations in
2773                                the defined interval, in nanoseconds
2774                                (json-int)
2775         - "avg_wr_latency_ns": average latency of write operations in
2776                                the defined interval, in nanoseconds
2777                                (json-int)
2778         - "avg_flush_latency_ns": average latency of flush operations
2779                                   in the defined interval, in
2780                                   nanoseconds (json-int)
2781         - "avg_rd_queue_depth": average number of pending read
2782                                 operations in the defined interval
2783                                 (json-number)
2784         - "avg_wr_queue_depth": average number of pending write
2785                                 operations in the defined interval
2786                                 (json-number).
2787 - "parent": Contains recursively the statistics of the underlying
2788             protocol (e.g. the host file for a qcow2 image). If there is
2789             no underlying protocol, this field is omitted
2790             (json-object, optional)
2791
2792 Example:
2793
2794 -> { "execute": "query-blockstats" }
2795 <- {
2796       "return":[
2797          {
2798             "device":"ide0-hd0",
2799             "parent":{
2800                "stats":{
2801                   "wr_highest_offset":3686448128,
2802                   "wr_bytes":9786368,
2803                   "wr_operations":751,
2804                   "rd_bytes":122567168,
2805                   "rd_operations":36772
2806                   "wr_total_times_ns":313253456
2807                   "rd_total_times_ns":3465673657
2808                   "flush_total_times_ns":49653
2809                   "flush_operations":61,
2810                   "rd_merged":0,
2811                   "wr_merged":0,
2812                   "idle_time_ns":2953431879,
2813                   "account_invalid":true,
2814                   "account_failed":false
2815                }
2816             },
2817             "stats":{
2818                "wr_highest_offset":2821110784,
2819                "wr_bytes":9786368,
2820                "wr_operations":692,
2821                "rd_bytes":122739200,
2822                "rd_operations":36604
2823                "flush_operations":51,
2824                "wr_total_times_ns":313253456
2825                "rd_total_times_ns":3465673657
2826                "flush_total_times_ns":49653,
2827                "rd_merged":0,
2828                "wr_merged":0,
2829                "idle_time_ns":2953431879,
2830                "account_invalid":true,
2831                "account_failed":false
2832             }
2833          },
2834          {
2835             "device":"ide1-cd0",
2836             "stats":{
2837                "wr_highest_offset":0,
2838                "wr_bytes":0,
2839                "wr_operations":0,
2840                "rd_bytes":0,
2841                "rd_operations":0
2842                "flush_operations":0,
2843                "wr_total_times_ns":0
2844                "rd_total_times_ns":0
2845                "flush_total_times_ns":0,
2846                "rd_merged":0,
2847                "wr_merged":0,
2848                "account_invalid":false,
2849                "account_failed":false
2850             }
2851          },
2852          {
2853             "device":"floppy0",
2854             "stats":{
2855                "wr_highest_offset":0,
2856                "wr_bytes":0,
2857                "wr_operations":0,
2858                "rd_bytes":0,
2859                "rd_operations":0
2860                "flush_operations":0,
2861                "wr_total_times_ns":0
2862                "rd_total_times_ns":0
2863                "flush_total_times_ns":0,
2864                "rd_merged":0,
2865                "wr_merged":0,
2866                "account_invalid":false,
2867                "account_failed":false
2868             }
2869          },
2870          {
2871             "device":"sd0",
2872             "stats":{
2873                "wr_highest_offset":0,
2874                "wr_bytes":0,
2875                "wr_operations":0,
2876                "rd_bytes":0,
2877                "rd_operations":0
2878                "flush_operations":0,
2879                "wr_total_times_ns":0
2880                "rd_total_times_ns":0
2881                "flush_total_times_ns":0,
2882                "rd_merged":0,
2883                "wr_merged":0,
2884                "account_invalid":false,
2885                "account_failed":false
2886             }
2887          }
2888       ]
2889    }
2890
2891 EQMP
2892
2893     {
2894         .name       = "query-blockstats",
2895         .args_type  = "query-nodes:b?",
2896         .mhandler.cmd_new = qmp_marshal_query_blockstats,
2897     },
2898
2899 SQMP
2900 query-cpus
2901 ----------
2902
2903 Show CPU information.
2904
2905 Return a json-array. Each CPU is represented by a json-object, which contains:
2906
2907 - "CPU": CPU index (json-int)
2908 - "current": true if this is the current CPU, false otherwise (json-bool)
2909 - "halted": true if the cpu is halted, false otherwise (json-bool)
2910 - "qom_path": path to the CPU object in the QOM tree (json-str)
2911 - "arch": architecture of the cpu, which determines what additional
2912           keys will be present (json-str)
2913 - Current program counter. The key's name depends on the architecture:
2914      "pc": i386/x86_64 (json-int)
2915      "nip": PPC (json-int)
2916      "pc" and "npc": sparc (json-int)
2917      "PC": mips (json-int)
2918 - "thread_id": ID of the underlying host thread (json-int)
2919
2920 Example:
2921
2922 -> { "execute": "query-cpus" }
2923 <- {
2924       "return":[
2925          {
2926             "CPU":0,
2927             "current":true,
2928             "halted":false,
2929             "qom_path":"/machine/unattached/device[0]",
2930             "arch":"x86",
2931             "pc":3227107138,
2932             "thread_id":3134
2933          },
2934          {
2935             "CPU":1,
2936             "current":false,
2937             "halted":true,
2938             "qom_path":"/machine/unattached/device[2]",
2939             "arch":"x86",
2940             "pc":7108165,
2941             "thread_id":3135
2942          }
2943       ]
2944    }
2945
2946 EQMP
2947
2948     {
2949         .name       = "query-cpus",
2950         .args_type  = "",
2951         .mhandler.cmd_new = qmp_marshal_query_cpus,
2952     },
2953
2954 SQMP
2955 query-iothreads
2956 ---------------
2957
2958 Returns a list of information about each iothread.
2959
2960 Note this list excludes the QEMU main loop thread, which is not declared
2961 using the -object iothread command-line option.  It is always the main thread
2962 of the process.
2963
2964 Return a json-array. Each iothread is represented by a json-object, which contains:
2965
2966 - "id": name of iothread (json-str)
2967 - "thread-id": ID of the underlying host thread (json-int)
2968
2969 Example:
2970
2971 -> { "execute": "query-iothreads" }
2972 <- {
2973       "return":[
2974          {
2975             "id":"iothread0",
2976             "thread-id":3134
2977          },
2978          {
2979             "id":"iothread1",
2980             "thread-id":3135
2981          }
2982       ]
2983    }
2984
2985 EQMP
2986
2987     {
2988         .name       = "query-iothreads",
2989         .args_type  = "",
2990         .mhandler.cmd_new = qmp_marshal_query_iothreads,
2991     },
2992
2993 SQMP
2994 query-pci
2995 ---------
2996
2997 PCI buses and devices information.
2998
2999 The returned value is a json-array of all buses. Each bus is represented by
3000 a json-object, which has a key with a json-array of all PCI devices attached
3001 to it. Each device is represented by a json-object.
3002
3003 The bus json-object contains the following:
3004
3005 - "bus": bus number (json-int)
3006 - "devices": a json-array of json-objects, each json-object represents a
3007              PCI device
3008
3009 The PCI device json-object contains the following:
3010
3011 - "bus": identical to the parent's bus number (json-int)
3012 - "slot": slot number (json-int)
3013 - "function": function number (json-int)
3014 - "class_info": a json-object containing:
3015      - "desc": device class description (json-string, optional)
3016      - "class": device class number (json-int)
3017 - "id": a json-object containing:
3018      - "device": device ID (json-int)
3019      - "vendor": vendor ID (json-int)
3020 - "irq": device's IRQ if assigned (json-int, optional)
3021 - "qdev_id": qdev id string (json-string)
3022 - "pci_bridge": It's a json-object, only present if this device is a
3023                 PCI bridge, contains:
3024      - "bus": bus number (json-int)
3025      - "secondary": secondary bus number (json-int)
3026      - "subordinate": subordinate bus number (json-int)
3027      - "io_range": I/O memory range information, a json-object with the
3028                    following members:
3029                  - "base": base address, in bytes (json-int)
3030                  - "limit": limit address, in bytes (json-int)
3031      - "memory_range": memory range information, a json-object with the
3032                        following members:
3033                  - "base": base address, in bytes (json-int)
3034                  - "limit": limit address, in bytes (json-int)
3035      - "prefetchable_range": Prefetchable memory range information, a
3036                              json-object with the following members:
3037                  - "base": base address, in bytes (json-int)
3038                  - "limit": limit address, in bytes (json-int)
3039      - "devices": a json-array of PCI devices if there's any attached, each
3040                   each element is represented by a json-object, which contains
3041                   the same members of the 'PCI device json-object' described
3042                   above (optional)
3043 - "regions": a json-array of json-objects, each json-object represents a
3044              memory region of this device
3045
3046 The memory range json-object contains the following:
3047
3048 - "base": base memory address (json-int)
3049 - "limit": limit value (json-int)
3050
3051 The region json-object can be an I/O region or a memory region, an I/O region
3052 json-object contains the following:
3053
3054 - "type": "io" (json-string, fixed)
3055 - "bar": BAR number (json-int)
3056 - "address": memory address (json-int)
3057 - "size": memory size (json-int)
3058
3059 A memory region json-object contains the following:
3060
3061 - "type": "memory" (json-string, fixed)
3062 - "bar": BAR number (json-int)
3063 - "address": memory address (json-int)
3064 - "size": memory size (json-int)
3065 - "mem_type_64": true or false (json-bool)
3066 - "prefetch": true or false (json-bool)
3067
3068 Example:
3069
3070 -> { "execute": "query-pci" }
3071 <- {
3072       "return":[
3073          {
3074             "bus":0,
3075             "devices":[
3076                {
3077                   "bus":0,
3078                   "qdev_id":"",
3079                   "slot":0,
3080                   "class_info":{
3081                      "class":1536,
3082                      "desc":"Host bridge"
3083                   },
3084                   "id":{
3085                      "device":32902,
3086                      "vendor":4663
3087                   },
3088                   "function":0,
3089                   "regions":[
3090    
3091                   ]
3092                },
3093                {
3094                   "bus":0,
3095                   "qdev_id":"",
3096                   "slot":1,
3097                   "class_info":{
3098                      "class":1537,
3099                      "desc":"ISA bridge"
3100                   },
3101                   "id":{
3102                      "device":32902,
3103                      "vendor":28672
3104                   },
3105                   "function":0,
3106                   "regions":[
3107    
3108                   ]
3109                },
3110                {
3111                   "bus":0,
3112                   "qdev_id":"",
3113                   "slot":1,
3114                   "class_info":{
3115                      "class":257,
3116                      "desc":"IDE controller"
3117                   },
3118                   "id":{
3119                      "device":32902,
3120                      "vendor":28688
3121                   },
3122                   "function":1,
3123                   "regions":[
3124                      {
3125                         "bar":4,
3126                         "size":16,
3127                         "address":49152,
3128                         "type":"io"
3129                      }
3130                   ]
3131                },
3132                {
3133                   "bus":0,
3134                   "qdev_id":"",
3135                   "slot":2,
3136                   "class_info":{
3137                      "class":768,
3138                      "desc":"VGA controller"
3139                   },
3140                   "id":{
3141                      "device":4115,
3142                      "vendor":184
3143                   },
3144                   "function":0,
3145                   "regions":[
3146                      {
3147                         "prefetch":true,
3148                         "mem_type_64":false,
3149                         "bar":0,
3150                         "size":33554432,
3151                         "address":4026531840,
3152                         "type":"memory"
3153                      },
3154                      {
3155                         "prefetch":false,
3156                         "mem_type_64":false,
3157                         "bar":1,
3158                         "size":4096,
3159                         "address":4060086272,
3160                         "type":"memory"
3161                      },
3162                      {
3163                         "prefetch":false,
3164                         "mem_type_64":false,
3165                         "bar":6,
3166                         "size":65536,
3167                         "address":-1,
3168                         "type":"memory"
3169                      }
3170                   ]
3171                },
3172                {
3173                   "bus":0,
3174                   "qdev_id":"",
3175                   "irq":11,
3176                   "slot":4,
3177                   "class_info":{
3178                      "class":1280,
3179                      "desc":"RAM controller"
3180                   },
3181                   "id":{
3182                      "device":6900,
3183                      "vendor":4098
3184                   },
3185                   "function":0,
3186                   "regions":[
3187                      {
3188                         "bar":0,
3189                         "size":32,
3190                         "address":49280,
3191                         "type":"io"
3192                      }
3193                   ]
3194                }
3195             ]
3196          }
3197       ]
3198    }
3199
3200 Note: This example has been shortened as the real response is too long.
3201
3202 EQMP
3203
3204     {
3205         .name       = "query-pci",
3206         .args_type  = "",
3207         .mhandler.cmd_new = qmp_marshal_query_pci,
3208     },
3209
3210 SQMP
3211 query-kvm
3212 ---------
3213
3214 Show KVM information.
3215
3216 Return a json-object with the following information:
3217
3218 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
3219 - "present": true if QEMU has KVM support, false otherwise (json-bool)
3220
3221 Example:
3222
3223 -> { "execute": "query-kvm" }
3224 <- { "return": { "enabled": true, "present": true } }
3225
3226 EQMP
3227
3228     {
3229         .name       = "query-kvm",
3230         .args_type  = "",
3231         .mhandler.cmd_new = qmp_marshal_query_kvm,
3232     },
3233
3234 SQMP
3235 query-status
3236 ------------
3237
3238 Return a json-object with the following information:
3239
3240 - "running": true if the VM is running, or false if it is paused (json-bool)
3241 - "singlestep": true if the VM is in single step mode,
3242                 false otherwise (json-bool)
3243 - "status": one of the following values (json-string)
3244     "debug" - QEMU is running on a debugger
3245     "inmigrate" - guest is paused waiting for an incoming migration
3246     "internal-error" - An internal error that prevents further guest
3247     execution has occurred
3248     "io-error" - the last IOP has failed and the device is configured
3249     to pause on I/O errors
3250     "paused" - guest has been paused via the 'stop' command
3251     "postmigrate" - guest is paused following a successful 'migrate'
3252     "prelaunch" - QEMU was started with -S and guest has not started
3253     "finish-migrate" - guest is paused to finish the migration process
3254     "restore-vm" - guest is paused to restore VM state
3255     "running" - guest is actively running
3256     "save-vm" - guest is paused to save the VM state
3257     "shutdown" - guest is shut down (and -no-shutdown is in use)
3258     "watchdog" - the watchdog action is configured to pause and
3259      has been triggered
3260
3261 Example:
3262
3263 -> { "execute": "query-status" }
3264 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
3265
3266 EQMP
3267     
3268     {
3269         .name       = "query-status",
3270         .args_type  = "",
3271         .mhandler.cmd_new = qmp_marshal_query_status,
3272     },
3273
3274 SQMP
3275 query-mice
3276 ----------
3277
3278 Show VM mice information.
3279
3280 Each mouse is represented by a json-object, the returned value is a json-array
3281 of all mice.
3282
3283 The mouse json-object contains the following:
3284
3285 - "name": mouse's name (json-string)
3286 - "index": mouse's index (json-int)
3287 - "current": true if this mouse is receiving events, false otherwise (json-bool)
3288 - "absolute": true if the mouse generates absolute input events (json-bool)
3289
3290 Example:
3291
3292 -> { "execute": "query-mice" }
3293 <- {
3294       "return":[
3295          {
3296             "name":"QEMU Microsoft Mouse",
3297             "index":0,
3298             "current":false,
3299             "absolute":false
3300          },
3301          {
3302             "name":"QEMU PS/2 Mouse",
3303             "index":1,
3304             "current":true,
3305             "absolute":true
3306          }
3307       ]
3308    }
3309
3310 EQMP
3311
3312     {
3313         .name       = "query-mice",
3314         .args_type  = "",
3315         .mhandler.cmd_new = qmp_marshal_query_mice,
3316     },
3317
3318 SQMP
3319 query-vnc
3320 ---------
3321
3322 Show VNC server information.
3323
3324 Return a json-object with server information. Connected clients are returned
3325 as a json-array of json-objects.
3326
3327 The main json-object contains the following:
3328
3329 - "enabled": true or false (json-bool)
3330 - "host": server's IP address (json-string)
3331 - "family": address family (json-string)
3332          - Possible values: "ipv4", "ipv6", "unix", "unknown"
3333 - "service": server's port number (json-string)
3334 - "auth": authentication method (json-string)
3335          - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3336                             "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3337                             "vencrypt+plain", "vencrypt+tls+none",
3338                             "vencrypt+tls+plain", "vencrypt+tls+sasl",
3339                             "vencrypt+tls+vnc", "vencrypt+x509+none",
3340                             "vencrypt+x509+plain", "vencrypt+x509+sasl",
3341                             "vencrypt+x509+vnc", "vnc"
3342 - "clients": a json-array of all connected clients
3343
3344 Clients are described by a json-object, each one contain the following:
3345
3346 - "host": client's IP address (json-string)
3347 - "family": address family (json-string)
3348          - Possible values: "ipv4", "ipv6", "unix", "unknown"
3349 - "service": client's port number (json-string)
3350 - "x509_dname": TLS dname (json-string, optional)
3351 - "sasl_username": SASL username (json-string, optional)
3352
3353 Example:
3354
3355 -> { "execute": "query-vnc" }
3356 <- {
3357       "return":{
3358          "enabled":true,
3359          "host":"0.0.0.0",
3360          "service":"50402",
3361          "auth":"vnc",
3362          "family":"ipv4",
3363          "clients":[
3364             {
3365                "host":"127.0.0.1",
3366                "service":"50401",
3367                "family":"ipv4"
3368             }
3369          ]
3370       }
3371    }
3372
3373 EQMP
3374
3375     {
3376         .name       = "query-vnc",
3377         .args_type  = "",
3378         .mhandler.cmd_new = qmp_marshal_query_vnc,
3379     },
3380     {
3381         .name       = "query-vnc-servers",
3382         .args_type  = "",
3383         .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
3384     },
3385
3386 SQMP
3387 query-spice
3388 -----------
3389
3390 Show SPICE server information.
3391
3392 Return a json-object with server information. Connected clients are returned
3393 as a json-array of json-objects.
3394
3395 The main json-object contains the following:
3396
3397 - "enabled": true or false (json-bool)
3398 - "host": server's IP address (json-string)
3399 - "port": server's port number (json-int, optional)
3400 - "tls-port": server's port number (json-int, optional)
3401 - "auth": authentication method (json-string)
3402          - Possible values: "none", "spice"
3403 - "channels": a json-array of all active channels clients
3404
3405 Channels are described by a json-object, each one contain the following:
3406
3407 - "host": client's IP address (json-string)
3408 - "family": address family (json-string)
3409          - Possible values: "ipv4", "ipv6", "unix", "unknown"
3410 - "port": client's port number (json-string)
3411 - "connection-id": spice connection id.  All channels with the same id
3412                    belong to the same spice session (json-int)
3413 - "channel-type": channel type.  "1" is the main control channel, filter for
3414                   this one if you want track spice sessions only (json-int)
3415 - "channel-id": channel id.  Usually "0", might be different needed when
3416                 multiple channels of the same type exist, such as multiple
3417                 display channels in a multihead setup (json-int)
3418 - "tls": whether the channel is encrypted (json-bool)
3419
3420 Example:
3421
3422 -> { "execute": "query-spice" }
3423 <- {
3424       "return": {
3425          "enabled": true,
3426          "auth": "spice",
3427          "port": 5920,
3428          "tls-port": 5921,
3429          "host": "0.0.0.0",
3430          "channels": [
3431             {
3432                "port": "54924",
3433                "family": "ipv4",
3434                "channel-type": 1,
3435                "connection-id": 1804289383,
3436                "host": "127.0.0.1",
3437                "channel-id": 0,
3438                "tls": true
3439             },
3440             {
3441                "port": "36710",
3442                "family": "ipv4",
3443                "channel-type": 4,
3444                "connection-id": 1804289383,
3445                "host": "127.0.0.1",
3446                "channel-id": 0,
3447                "tls": false
3448             },
3449             [ ... more channels follow ... ]
3450          ]
3451       }
3452    }
3453
3454 EQMP
3455
3456 #if defined(CONFIG_SPICE)
3457     {
3458         .name       = "query-spice",
3459         .args_type  = "",
3460         .mhandler.cmd_new = qmp_marshal_query_spice,
3461     },
3462 #endif
3463
3464 SQMP
3465 query-name
3466 ----------
3467
3468 Show VM name.
3469
3470 Return a json-object with the following information:
3471
3472 - "name": VM's name (json-string, optional)
3473
3474 Example:
3475
3476 -> { "execute": "query-name" }
3477 <- { "return": { "name": "qemu-name" } }
3478
3479 EQMP
3480
3481     {
3482         .name       = "query-name",
3483         .args_type  = "",
3484         .mhandler.cmd_new = qmp_marshal_query_name,
3485     },
3486
3487 SQMP
3488 query-uuid
3489 ----------
3490
3491 Show VM UUID.
3492
3493 Return a json-object with the following information:
3494
3495 - "UUID": Universally Unique Identifier (json-string)
3496
3497 Example:
3498
3499 -> { "execute": "query-uuid" }
3500 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3501
3502 EQMP
3503
3504     {
3505         .name       = "query-uuid",
3506         .args_type  = "",
3507         .mhandler.cmd_new = qmp_marshal_query_uuid,
3508     },
3509
3510 SQMP
3511 query-command-line-options
3512 --------------------------
3513
3514 Show command line option schema.
3515
3516 Return a json-array of command line option schema for all options (or for
3517 the given option), returning an error if the given option doesn't exist.
3518
3519 Each array entry contains the following:
3520
3521 - "option": option name (json-string)
3522 - "parameters": a json-array describes all parameters of the option:
3523     - "name": parameter name (json-string)
3524     - "type": parameter type (one of 'string', 'boolean', 'number',
3525               or 'size')
3526     - "help": human readable description of the parameter
3527               (json-string, optional)
3528     - "default": default value string for the parameter
3529                  (json-string, optional)
3530
3531 Example:
3532
3533 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3534 <- { "return": [
3535         {
3536             "parameters": [
3537                 {
3538                     "name": "romfile",
3539                     "type": "string"
3540                 },
3541                 {
3542                     "name": "bootindex",
3543                     "type": "number"
3544                 }
3545             ],
3546             "option": "option-rom"
3547         }
3548      ]
3549    }
3550
3551 EQMP
3552
3553     {
3554         .name       = "query-command-line-options",
3555         .args_type  = "option:s?",
3556         .mhandler.cmd_new = qmp_marshal_query_command_line_options,
3557     },
3558
3559 SQMP
3560 query-migrate
3561 -------------
3562
3563 Migration status.
3564
3565 Return a json-object. If migration is active there will be another json-object
3566 with RAM migration status and if block migration is active another one with
3567 block migration status.
3568
3569 The main json-object contains the following:
3570
3571 - "status": migration status (json-string)
3572      - Possible values: "setup", "active", "completed", "failed", "cancelled"
3573 - "total-time": total amount of ms since migration started.  If
3574                 migration has ended, it returns the total migration
3575                 time (json-int)
3576 - "setup-time" amount of setup time in milliseconds _before_ the
3577                iterations begin but _after_ the QMP command is issued.
3578                This is designed to provide an accounting of any activities
3579                (such as RDMA pinning) which may be expensive, but do not 
3580                actually occur during the iterative migration rounds 
3581                themselves. (json-int)
3582 - "downtime": only present when migration has finished correctly
3583               total amount in ms for downtime that happened (json-int)
3584 - "expected-downtime": only present while migration is active
3585                 total amount in ms for downtime that was calculated on
3586                 the last bitmap round (json-int)
3587 - "ram": only present if "status" is "active", it is a json-object with the
3588   following RAM information:
3589          - "transferred": amount transferred in bytes (json-int)
3590          - "remaining": amount remaining to transfer in bytes (json-int)
3591          - "total": total amount of memory in bytes (json-int)
3592          - "duplicate": number of pages filled entirely with the same
3593             byte (json-int)
3594             These are sent over the wire much more efficiently.
3595          - "skipped": number of skipped zero pages (json-int)
3596          - "normal" : number of whole pages transferred.  I.e. they
3597             were not sent as duplicate or xbzrle pages (json-int)
3598          - "normal-bytes" : number of bytes transferred in whole
3599             pages. This is just normal pages times size of one page,
3600             but this way upper levels don't need to care about page
3601             size (json-int)
3602          - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3603 - "disk": only present if "status" is "active" and it is a block migration,
3604   it is a json-object with the following disk information:
3605          - "transferred": amount transferred in bytes (json-int)
3606          - "remaining": amount remaining to transfer in bytes json-int)
3607          - "total": total disk size in bytes (json-int)
3608 - "xbzrle-cache": only present if XBZRLE is active.
3609   It is a json-object with the following XBZRLE information:
3610          - "cache-size": XBZRLE cache size in bytes
3611          - "bytes": number of bytes transferred for XBZRLE compressed pages
3612          - "pages": number of XBZRLE compressed pages
3613          - "cache-miss": number of XBRZRLE page cache misses
3614          - "cache-miss-rate": rate of XBRZRLE page cache misses
3615          - "overflow": number of times XBZRLE overflows.  This means
3616            that the XBZRLE encoding was bigger than just sent the
3617            whole page, and then we sent the whole page instead (as as
3618            normal page).
3619
3620 Examples:
3621
3622 1. Before the first migration
3623
3624 -> { "execute": "query-migrate" }
3625 <- { "return": {} }
3626
3627 2. Migration is done and has succeeded
3628
3629 -> { "execute": "query-migrate" }
3630 <- { "return": {
3631         "status": "completed",
3632         "ram":{
3633           "transferred":123,
3634           "remaining":123,
3635           "total":246,
3636           "total-time":12345,
3637           "setup-time":12345,
3638           "downtime":12345,
3639           "duplicate":123,
3640           "normal":123,
3641           "normal-bytes":123456,
3642           "dirty-sync-count":15
3643         }
3644      }
3645    }
3646
3647 3. Migration is done and has failed
3648
3649 -> { "execute": "query-migrate" }
3650 <- { "return": { "status": "failed" } }
3651
3652 4. Migration is being performed and is not a block migration:
3653
3654 -> { "execute": "query-migrate" }
3655 <- {
3656       "return":{
3657          "status":"active",
3658          "ram":{
3659             "transferred":123,
3660             "remaining":123,
3661             "total":246,
3662             "total-time":12345,
3663             "setup-time":12345,
3664             "expected-downtime":12345,
3665             "duplicate":123,
3666             "normal":123,
3667             "normal-bytes":123456,
3668             "dirty-sync-count":15
3669          }
3670       }
3671    }
3672
3673 5. Migration is being performed and is a block migration:
3674
3675 -> { "execute": "query-migrate" }
3676 <- {
3677       "return":{
3678          "status":"active",
3679          "ram":{
3680             "total":1057024,
3681             "remaining":1053304,
3682             "transferred":3720,
3683             "total-time":12345,
3684             "setup-time":12345,
3685             "expected-downtime":12345,
3686             "duplicate":123,
3687             "normal":123,
3688             "normal-bytes":123456,
3689             "dirty-sync-count":15
3690          },
3691          "disk":{
3692             "total":20971520,
3693             "remaining":20880384,
3694             "transferred":91136
3695          }
3696       }
3697    }
3698
3699 6. Migration is being performed and XBZRLE is active:
3700
3701 -> { "execute": "query-migrate" }
3702 <- {
3703       "return":{
3704          "status":"active",
3705          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3706          "ram":{
3707             "total":1057024,
3708             "remaining":1053304,
3709             "transferred":3720,
3710             "total-time":12345,
3711             "setup-time":12345,
3712             "expected-downtime":12345,
3713             "duplicate":10,
3714             "normal":3333,
3715             "normal-bytes":3412992,
3716             "dirty-sync-count":15
3717          },
3718          "xbzrle-cache":{
3719             "cache-size":67108864,
3720             "bytes":20971520,
3721             "pages":2444343,
3722             "cache-miss":2244,
3723             "cache-miss-rate":0.123,
3724             "overflow":34434
3725          }
3726       }
3727    }
3728
3729 EQMP
3730
3731     {
3732         .name       = "query-migrate",
3733         .args_type  = "",
3734         .mhandler.cmd_new = qmp_marshal_query_migrate,
3735     },
3736
3737 SQMP
3738 migrate-set-capabilities
3739 ------------------------
3740
3741 Enable/Disable migration capabilities
3742
3743 - "xbzrle": XBZRLE support
3744 - "rdma-pin-all": pin all pages when using RDMA during migration
3745 - "auto-converge": throttle down guest to help convergence of migration
3746 - "zero-blocks": compress zero blocks during block migration
3747 - "compress": use multiple compression threads to accelerate live migration
3748 - "events": generate events for each migration state change
3749 - "postcopy-ram": postcopy mode for live migration
3750
3751 Arguments:
3752
3753 Example:
3754
3755 -> { "execute": "migrate-set-capabilities" , "arguments":
3756      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3757
3758 EQMP
3759
3760     {
3761         .name       = "migrate-set-capabilities",
3762         .args_type  = "capabilities:q",
3763         .params     = "capability:s,state:b",
3764         .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
3765     },
3766 SQMP
3767 query-migrate-capabilities
3768 --------------------------
3769
3770 Query current migration capabilities
3771
3772 - "capabilities": migration capabilities state
3773          - "xbzrle" : XBZRLE state (json-bool)
3774          - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3775          - "auto-converge" : Auto Converge state (json-bool)
3776          - "zero-blocks" : Zero Blocks state (json-bool)
3777          - "compress": Multiple compression threads state (json-bool)
3778          - "events": Migration state change event state (json-bool)
3779          - "postcopy-ram": postcopy ram state (json-bool)
3780
3781 Arguments:
3782
3783 Example:
3784
3785 -> { "execute": "query-migrate-capabilities" }
3786 <- {"return": [
3787      {"state": false, "capability": "xbzrle"},
3788      {"state": false, "capability": "rdma-pin-all"},
3789      {"state": false, "capability": "auto-converge"},
3790      {"state": false, "capability": "zero-blocks"},
3791      {"state": false, "capability": "compress"},
3792      {"state": true, "capability": "events"},
3793      {"state": false, "capability": "postcopy-ram"}
3794    ]}
3795
3796 EQMP
3797
3798     {
3799         .name       = "query-migrate-capabilities",
3800         .args_type  = "",
3801         .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
3802     },
3803
3804 SQMP
3805 migrate-set-parameters
3806 ----------------------
3807
3808 Set migration parameters
3809
3810 - "compress-level": set compression level during migration (json-int)
3811 - "compress-threads": set compression thread count for migration (json-int)
3812 - "decompress-threads": set decompression thread count for migration (json-int)
3813 - "cpu-throttle-initial": set initial percentage of time guest cpus are
3814                           throttled for auto-converge (json-int)
3815 - "cpu-throttle-increment": set throttle increasing percentage for
3816                             auto-converge (json-int)
3817
3818 Arguments:
3819
3820 Example:
3821
3822 -> { "execute": "migrate-set-parameters" , "arguments":
3823       { "compress-level": 1 } }
3824
3825 EQMP
3826
3827     {
3828         .name       = "migrate-set-parameters",
3829         .args_type  =
3830             "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?",
3831         .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
3832     },
3833 SQMP
3834 query-migrate-parameters
3835 ------------------------
3836
3837 Query current migration parameters
3838
3839 - "parameters": migration parameters value
3840          - "compress-level" : compression level value (json-int)
3841          - "compress-threads" : compression thread count value (json-int)
3842          - "decompress-threads" : decompression thread count value (json-int)
3843          - "cpu-throttle-initial" : initial percentage of time guest cpus are
3844                                     throttled (json-int)
3845          - "cpu-throttle-increment" : throttle increasing percentage for
3846                                       auto-converge (json-int)
3847
3848 Arguments:
3849
3850 Example:
3851
3852 -> { "execute": "query-migrate-parameters" }
3853 <- {
3854       "return": {
3855          "decompress-threads": 2,
3856          "cpu-throttle-increment": 10,
3857          "compress-threads": 8,
3858          "compress-level": 1,
3859          "cpu-throttle-initial": 20
3860       }
3861    }
3862
3863 EQMP
3864
3865     {
3866         .name       = "query-migrate-parameters",
3867         .args_type  = "",
3868         .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
3869     },
3870
3871 SQMP
3872 query-balloon
3873 -------------
3874
3875 Show balloon information.
3876
3877 Make an asynchronous request for balloon info. When the request completes a
3878 json-object will be returned containing the following data:
3879
3880 - "actual": current balloon value in bytes (json-int)
3881
3882 Example:
3883
3884 -> { "execute": "query-balloon" }
3885 <- {
3886       "return":{
3887          "actual":1073741824,
3888       }
3889    }
3890
3891 EQMP
3892
3893     {
3894         .name       = "query-balloon",
3895         .args_type  = "",
3896         .mhandler.cmd_new = qmp_marshal_query_balloon,
3897     },
3898
3899     {
3900         .name       = "query-block-jobs",
3901         .args_type  = "",
3902         .mhandler.cmd_new = qmp_marshal_query_block_jobs,
3903     },
3904
3905     {
3906         .name       = "qom-list",
3907         .args_type  = "path:s",
3908         .mhandler.cmd_new = qmp_marshal_qom_list,
3909     },
3910
3911     {
3912         .name       = "qom-set",
3913         .args_type  = "path:s,property:s,value:q",
3914         .mhandler.cmd_new = qmp_marshal_qom_set,
3915     },
3916
3917     {
3918         .name       = "qom-get",
3919         .args_type  = "path:s,property:s",
3920         .mhandler.cmd_new = qmp_marshal_qom_get,
3921     },
3922
3923     {
3924         .name       = "nbd-server-start",
3925         .args_type  = "addr:q,tls-creds:s?",
3926         .mhandler.cmd_new = qmp_marshal_nbd_server_start,
3927     },
3928     {
3929         .name       = "nbd-server-add",
3930         .args_type  = "device:B,writable:b?",
3931         .mhandler.cmd_new = qmp_marshal_nbd_server_add,
3932     },
3933     {
3934         .name       = "nbd-server-stop",
3935         .args_type  = "",
3936         .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
3937     },
3938
3939     {
3940         .name       = "change-vnc-password",
3941         .args_type  = "password:s",
3942         .mhandler.cmd_new = qmp_marshal_change_vnc_password,
3943     },
3944     {
3945         .name       = "qom-list-types",
3946         .args_type  = "implements:s?,abstract:b?",
3947         .mhandler.cmd_new = qmp_marshal_qom_list_types,
3948     },
3949
3950     {
3951         .name       = "device-list-properties",
3952         .args_type  = "typename:s",
3953         .mhandler.cmd_new = qmp_marshal_device_list_properties,
3954     },
3955
3956     {
3957         .name       = "query-machines",
3958         .args_type  = "",
3959         .mhandler.cmd_new = qmp_marshal_query_machines,
3960     },
3961
3962     {
3963         .name       = "query-cpu-definitions",
3964         .args_type  = "",
3965         .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
3966     },
3967
3968     {
3969         .name       = "query-target",
3970         .args_type  = "",
3971         .mhandler.cmd_new = qmp_marshal_query_target,
3972     },
3973
3974     {
3975         .name       = "query-tpm",
3976         .args_type  = "",
3977         .mhandler.cmd_new = qmp_marshal_query_tpm,
3978     },
3979
3980 SQMP
3981 query-tpm
3982 ---------
3983
3984 Return information about the TPM device.
3985
3986 Arguments: None
3987
3988 Example:
3989
3990 -> { "execute": "query-tpm" }
3991 <- { "return":
3992      [
3993        { "model": "tpm-tis",
3994          "options":
3995            { "type": "passthrough",
3996              "data":
3997                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3998                  "path": "/dev/tpm0"
3999                }
4000            },
4001          "id": "tpm0"
4002        }
4003      ]
4004    }
4005
4006 EQMP
4007
4008     {
4009         .name       = "query-tpm-models",
4010         .args_type  = "",
4011         .mhandler.cmd_new = qmp_marshal_query_tpm_models,
4012     },
4013
4014 SQMP
4015 query-tpm-models
4016 ----------------
4017
4018 Return a list of supported TPM models.
4019
4020 Arguments: None
4021
4022 Example:
4023
4024 -> { "execute": "query-tpm-models" }
4025 <- { "return": [ "tpm-tis" ] }
4026
4027 EQMP
4028
4029     {
4030         .name       = "query-tpm-types",
4031         .args_type  = "",
4032         .mhandler.cmd_new = qmp_marshal_query_tpm_types,
4033     },
4034
4035 SQMP
4036 query-tpm-types
4037 ---------------
4038
4039 Return a list of supported TPM types.
4040
4041 Arguments: None
4042
4043 Example:
4044
4045 -> { "execute": "query-tpm-types" }
4046 <- { "return": [ "passthrough" ] }
4047
4048 EQMP
4049
4050     {
4051         .name       = "chardev-add",
4052         .args_type  = "id:s,backend:q",
4053         .mhandler.cmd_new = qmp_marshal_chardev_add,
4054     },
4055
4056 SQMP
4057 chardev-add
4058 ----------------
4059
4060 Add a chardev.
4061
4062 Arguments:
4063
4064 - "id": the chardev's ID, must be unique (json-string)
4065 - "backend": chardev backend type + parameters
4066
4067 Examples:
4068
4069 -> { "execute" : "chardev-add",
4070      "arguments" : { "id" : "foo",
4071                      "backend" : { "type" : "null", "data" : {} } } }
4072 <- { "return": {} }
4073
4074 -> { "execute" : "chardev-add",
4075      "arguments" : { "id" : "bar",
4076                      "backend" : { "type" : "file",
4077                                    "data" : { "out" : "/tmp/bar.log" } } } }
4078 <- { "return": {} }
4079
4080 -> { "execute" : "chardev-add",
4081      "arguments" : { "id" : "baz",
4082                      "backend" : { "type" : "pty", "data" : {} } } }
4083 <- { "return": { "pty" : "/dev/pty/42" } }
4084
4085 EQMP
4086
4087     {
4088         .name       = "chardev-remove",
4089         .args_type  = "id:s",
4090         .mhandler.cmd_new = qmp_marshal_chardev_remove,
4091     },
4092
4093
4094 SQMP
4095 chardev-remove
4096 --------------
4097
4098 Remove a chardev.
4099
4100 Arguments:
4101
4102 - "id": the chardev's ID, must exist and not be in use (json-string)
4103
4104 Example:
4105
4106 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
4107 <- { "return": {} }
4108
4109 EQMP
4110     {
4111         .name       = "query-rx-filter",
4112         .args_type  = "name:s?",
4113         .mhandler.cmd_new = qmp_marshal_query_rx_filter,
4114     },
4115
4116 SQMP
4117 query-rx-filter
4118 ---------------
4119
4120 Show rx-filter information.
4121
4122 Returns a json-array of rx-filter information for all NICs (or for the
4123 given NIC), returning an error if the given NIC doesn't exist, or
4124 given NIC doesn't support rx-filter querying, or given net client
4125 isn't a NIC.
4126
4127 The query will clear the event notification flag of each NIC, then qemu
4128 will start to emit event to QMP monitor.
4129
4130 Each array entry contains the following:
4131
4132 - "name": net client name (json-string)
4133 - "promiscuous": promiscuous mode is enabled (json-bool)
4134 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
4135 - "unicast": unicast receive state  (one of 'normal', 'none', 'all')
4136 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
4137 - "broadcast-allowed": allow to receive broadcast (json-bool)
4138 - "multicast-overflow": multicast table is overflowed (json-bool)
4139 - "unicast-overflow": unicast table is overflowed (json-bool)
4140 - "main-mac": main macaddr string (json-string)
4141 - "vlan-table": a json-array of active vlan id
4142 - "unicast-table": a json-array of unicast macaddr string
4143 - "multicast-table": a json-array of multicast macaddr string
4144
4145 Example:
4146
4147 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
4148 <- { "return": [
4149         {
4150             "promiscuous": true,
4151             "name": "vnet0",
4152             "main-mac": "52:54:00:12:34:56",
4153             "unicast": "normal",
4154             "vlan": "normal",
4155             "vlan-table": [
4156                 4,
4157                 0
4158             ],
4159             "unicast-table": [
4160             ],
4161             "multicast": "normal",
4162             "multicast-overflow": false,
4163             "unicast-overflow": false,
4164             "multicast-table": [
4165                 "01:00:5e:00:00:01",
4166                 "33:33:00:00:00:01",
4167                 "33:33:ff:12:34:56"
4168             ],
4169             "broadcast-allowed": false
4170         }
4171       ]
4172    }
4173
4174 EQMP
4175
4176     {
4177         .name       = "blockdev-add",
4178         .args_type  = "options:q",
4179         .mhandler.cmd_new = qmp_marshal_blockdev_add,
4180     },
4181
4182 SQMP
4183 blockdev-add
4184 ------------
4185
4186 Add a block device.
4187
4188 This command is still a work in progress.  It doesn't support all
4189 block drivers among other things.  Stay away from it unless you want
4190 to help with its development.
4191
4192 Arguments:
4193
4194 - "options": block driver options
4195
4196 Example (1):
4197
4198 -> { "execute": "blockdev-add",
4199     "arguments": { "options" : { "driver": "qcow2",
4200                                  "file": { "driver": "file",
4201                                            "filename": "test.qcow2" } } } }
4202 <- { "return": {} }
4203
4204 Example (2):
4205
4206 -> { "execute": "blockdev-add",
4207      "arguments": {
4208          "options": {
4209            "driver": "qcow2",
4210            "id": "my_disk",
4211            "discard": "unmap",
4212            "cache": {
4213                "direct": true,
4214                "writeback": true
4215            },
4216            "file": {
4217                "driver": "file",
4218                "filename": "/tmp/test.qcow2"
4219            },
4220            "backing": {
4221                "driver": "raw",
4222                "file": {
4223                    "driver": "file",
4224                    "filename": "/dev/fdset/4"
4225                }
4226            }
4227          }
4228        }
4229      }
4230
4231 <- { "return": {} }
4232
4233 EQMP
4234
4235     {
4236         .name       = "x-blockdev-del",
4237         .args_type  = "id:s?,node-name:s?",
4238         .mhandler.cmd_new = qmp_marshal_x_blockdev_del,
4239     },
4240
4241 SQMP
4242 x-blockdev-del
4243 ------------
4244 Since 2.5
4245
4246 Deletes a block device thas has been added using blockdev-add.
4247 The selected device can be either a block backend or a graph node.
4248
4249 In the former case the backend will be destroyed, along with its
4250 inserted medium if there's any. The command will fail if the backend
4251 or its medium are in use.
4252
4253 In the latter case the node will be destroyed. The command will fail
4254 if the node is attached to a block backend or is otherwise being
4255 used.
4256
4257 One of "id" or "node-name" must be specified, but not both.
4258
4259 This command is still a work in progress and is considered
4260 experimental. Stay away from it unless you want to help with its
4261 development.
4262
4263 Arguments:
4264
4265 - "id": Name of the block backend device to delete (json-string, optional)
4266 - "node-name": Name of the graph node to delete (json-string, optional)
4267
4268 Example:
4269
4270 -> { "execute": "blockdev-add",
4271      "arguments": {
4272          "options": {
4273              "driver": "qcow2",
4274              "id": "drive0",
4275              "file": {
4276                  "driver": "file",
4277                  "filename": "test.qcow2"
4278              }
4279          }
4280      }
4281    }
4282
4283 <- { "return": {} }
4284
4285 -> { "execute": "x-blockdev-del",
4286      "arguments": { "id": "drive0" }
4287    }
4288 <- { "return": {} }
4289
4290 EQMP
4291
4292     {
4293         .name       = "blockdev-open-tray",
4294         .args_type  = "device:s,force:b?",
4295         .mhandler.cmd_new = qmp_marshal_blockdev_open_tray,
4296     },
4297
4298 SQMP
4299 blockdev-open-tray
4300 ------------------
4301
4302 Opens a block device's tray. If there is a block driver state tree inserted as a
4303 medium, it will become inaccessible to the guest (but it will remain associated
4304 to the block device, so closing the tray will make it accessible again).
4305
4306 If the tray was already open before, this will be a no-op.
4307
4308 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4309 which no such event will be generated, these include:
4310 - if the guest has locked the tray, @force is false and the guest does not
4311   respond to the eject request
4312 - if the BlockBackend denoted by @device does not have a guest device attached
4313   to it
4314 - if the guest device does not have an actual tray and is empty, for instance
4315   for floppy disk drives
4316
4317 Arguments:
4318
4319 - "device": block device name (json-string)
4320 - "force": if false (the default), an eject request will be sent to the guest if
4321            it has locked the tray (and the tray will not be opened immediately);
4322            if true, the tray will be opened regardless of whether it is locked
4323            (json-bool, optional)
4324
4325 Example:
4326
4327 -> { "execute": "blockdev-open-tray",
4328      "arguments": { "device": "ide1-cd0" } }
4329
4330 <- { "timestamp": { "seconds": 1418751016,
4331                     "microseconds": 716996 },
4332      "event": "DEVICE_TRAY_MOVED",
4333      "data": { "device": "ide1-cd0",
4334                "tray-open": true } }
4335
4336 <- { "return": {} }
4337
4338 EQMP
4339
4340     {
4341         .name       = "blockdev-close-tray",
4342         .args_type  = "device:s",
4343         .mhandler.cmd_new = qmp_marshal_blockdev_close_tray,
4344     },
4345
4346 SQMP
4347 blockdev-close-tray
4348 -------------------
4349
4350 Closes a block device's tray. If there is a block driver state tree associated
4351 with the block device (which is currently ejected), that tree will be loaded as
4352 the medium.
4353
4354 If the tray was already closed before, this will be a no-op.
4355
4356 Arguments:
4357
4358 - "device": block device name (json-string)
4359
4360 Example:
4361
4362 -> { "execute": "blockdev-close-tray",
4363      "arguments": { "device": "ide1-cd0" } }
4364
4365 <- { "timestamp": { "seconds": 1418751345,
4366                     "microseconds": 272147 },
4367      "event": "DEVICE_TRAY_MOVED",
4368      "data": { "device": "ide1-cd0",
4369                "tray-open": false } }
4370
4371 <- { "return": {} }
4372
4373 EQMP
4374
4375     {
4376         .name       = "x-blockdev-remove-medium",
4377         .args_type  = "device:s",
4378         .mhandler.cmd_new = qmp_marshal_x_blockdev_remove_medium,
4379     },
4380
4381 SQMP
4382 x-blockdev-remove-medium
4383 ------------------------
4384
4385 Removes a medium (a block driver state tree) from a block device. That block
4386 device's tray must currently be open (unless there is no attached guest device).
4387
4388 If the tray is open and there is no medium inserted, this will be a no-op.
4389
4390 This command is still a work in progress and is considered experimental.
4391 Stay away from it unless you want to help with its development.
4392
4393 Arguments:
4394
4395 - "device": block device name (json-string)
4396
4397 Example:
4398
4399 -> { "execute": "x-blockdev-remove-medium",
4400      "arguments": { "device": "ide1-cd0" } }
4401
4402 <- { "error": { "class": "GenericError",
4403                 "desc": "Tray of device 'ide1-cd0' is not open" } }
4404
4405 -> { "execute": "blockdev-open-tray",
4406      "arguments": { "device": "ide1-cd0" } }
4407
4408 <- { "timestamp": { "seconds": 1418751627,
4409                     "microseconds": 549958 },
4410      "event": "DEVICE_TRAY_MOVED",
4411      "data": { "device": "ide1-cd0",
4412                "tray-open": true } }
4413
4414 <- { "return": {} }
4415
4416 -> { "execute": "x-blockdev-remove-medium",
4417      "arguments": { "device": "ide1-cd0" } }
4418
4419 <- { "return": {} }
4420
4421 EQMP
4422
4423     {
4424         .name       = "x-blockdev-insert-medium",
4425         .args_type  = "device:s,node-name:s",
4426         .mhandler.cmd_new = qmp_marshal_x_blockdev_insert_medium,
4427     },
4428
4429 SQMP
4430 x-blockdev-insert-medium
4431 ------------------------
4432
4433 Inserts a medium (a block driver state tree) into a block device. That block
4434 device's tray must currently be open (unless there is no attached guest device)
4435 and there must be no medium inserted already.
4436
4437 This command is still a work in progress and is considered experimental.
4438 Stay away from it unless you want to help with its development.
4439
4440 Arguments:
4441
4442 - "device": block device name (json-string)
4443 - "node-name": root node of the BDS tree to insert into the block device
4444
4445 Example:
4446
4447 -> { "execute": "blockdev-add",
4448      "arguments": { "options": { "node-name": "node0",
4449                                  "driver": "raw",
4450                                  "file": { "driver": "file",
4451                                            "filename": "fedora.iso" } } } }
4452
4453 <- { "return": {} }
4454
4455 -> { "execute": "x-blockdev-insert-medium",
4456      "arguments": { "device": "ide1-cd0",
4457                     "node-name": "node0" } }
4458
4459 <- { "return": {} }
4460
4461 EQMP
4462
4463     {
4464         .name       = "x-blockdev-change",
4465         .args_type  = "parent:B,child:B?,node:B?",
4466         .mhandler.cmd_new = qmp_marshal_x_blockdev_change,
4467     },
4468
4469 SQMP
4470 x-blockdev-change
4471 -----------------
4472
4473 Dynamically reconfigure the block driver state graph. It can be used
4474 to add, remove, insert or replace a graph node. Currently only the
4475 Quorum driver implements this feature to add or remove its child. This
4476 is useful to fix a broken quorum child.
4477
4478 If @node is specified, it will be inserted under @parent. @child
4479 may not be specified in this case. If both @parent and @child are
4480 specified but @node is not, @child will be detached from @parent.
4481
4482 Arguments:
4483 - "parent": the id or name of the parent node (json-string)
4484 - "child": the name of a child under the given parent node (json-string, optional)
4485 - "node": the name of the node that will be added (json-string, optional)
4486
4487 Note: this command is experimental, and not a stable API. It doesn't
4488 support all kinds of operations, all kinds of children, nor all block
4489 drivers.
4490
4491 Warning: The data in a new quorum child MUST be consistent with that of
4492 the rest of the array.
4493
4494 Example:
4495
4496 Add a new node to a quorum
4497 -> { "execute": "blockdev-add",
4498      "arguments": { "options": { "driver": "raw",
4499                                  "node-name": "new_node",
4500                                  "file": { "driver": "file",
4501                                            "filename": "test.raw" } } } }
4502 <- { "return": {} }
4503 -> { "execute": "x-blockdev-change",
4504      "arguments": { "parent": "disk1",
4505                     "node": "new_node" } }
4506 <- { "return": {} }
4507
4508 Delete a quorum's node
4509 -> { "execute": "x-blockdev-change",
4510      "arguments": { "parent": "disk1",
4511                     "child": "children.1" } }
4512 <- { "return": {} }
4513
4514 EQMP
4515
4516     {
4517         .name       = "query-named-block-nodes",
4518         .args_type  = "",
4519         .mhandler.cmd_new = qmp_marshal_query_named_block_nodes,
4520     },
4521
4522 SQMP
4523 @query-named-block-nodes
4524 ------------------------
4525
4526 Return a list of BlockDeviceInfo for all the named block driver nodes
4527
4528 Example:
4529
4530 -> { "execute": "query-named-block-nodes" }
4531 <- { "return": [ { "ro":false,
4532                    "drv":"qcow2",
4533                    "encrypted":false,
4534                    "file":"disks/test.qcow2",
4535                    "node-name": "my-node",
4536                    "backing_file_depth":1,
4537                    "bps":1000000,
4538                    "bps_rd":0,
4539                    "bps_wr":0,
4540                    "iops":1000000,
4541                    "iops_rd":0,
4542                    "iops_wr":0,
4543                    "bps_max": 8000000,
4544                    "bps_rd_max": 0,
4545                    "bps_wr_max": 0,
4546                    "iops_max": 0,
4547                    "iops_rd_max": 0,
4548                    "iops_wr_max": 0,
4549                    "iops_size": 0,
4550                    "write_threshold": 0,
4551                    "image":{
4552                       "filename":"disks/test.qcow2",
4553                       "format":"qcow2",
4554                       "virtual-size":2048000,
4555                       "backing_file":"base.qcow2",
4556                       "full-backing-filename":"disks/base.qcow2",
4557                       "backing-filename-format":"qcow2",
4558                       "snapshots":[
4559                          {
4560                             "id": "1",
4561                             "name": "snapshot1",
4562                             "vm-state-size": 0,
4563                             "date-sec": 10000200,
4564                             "date-nsec": 12,
4565                             "vm-clock-sec": 206,
4566                             "vm-clock-nsec": 30
4567                          }
4568                       ],
4569                       "backing-image":{
4570                           "filename":"disks/base.qcow2",
4571                           "format":"qcow2",
4572                           "virtual-size":2048000
4573                       }
4574                    } } ] }
4575
4576 EQMP
4577
4578     {
4579         .name       = "blockdev-change-medium",
4580         .args_type  = "device:B,filename:F,format:s?,read-only-mode:s?",
4581         .mhandler.cmd_new = qmp_marshal_blockdev_change_medium,
4582     },
4583
4584 SQMP
4585 blockdev-change-medium
4586 ----------------------
4587
4588 Changes the medium inserted into a block device by ejecting the current medium
4589 and loading a new image file which is inserted as the new medium.
4590
4591 Arguments:
4592
4593 - "device": device name (json-string)
4594 - "filename": filename of the new image (json-string)
4595 - "format": format of the new image (json-string, optional)
4596 - "read-only-mode": new read-only mode (json-string, optional)
4597           - Possible values: "retain" (default), "read-only", "read-write"
4598
4599 Examples:
4600
4601 1. Change a removable medium
4602
4603 -> { "execute": "blockdev-change-medium",
4604              "arguments": { "device": "ide1-cd0",
4605                             "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4606                             "format": "raw" } }
4607 <- { "return": {} }
4608
4609 2. Load a read-only medium into a writable drive
4610
4611 -> { "execute": "blockdev-change-medium",
4612              "arguments": { "device": "isa-fd0",
4613                             "filename": "/srv/images/ro.img",
4614                             "format": "raw",
4615                             "read-only-mode": "retain" } }
4616
4617 <- { "error":
4618      { "class": "GenericError",
4619        "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4620
4621 -> { "execute": "blockdev-change-medium",
4622              "arguments": { "device": "isa-fd0",
4623                             "filename": "/srv/images/ro.img",
4624                             "format": "raw",
4625                             "read-only-mode": "read-only" } }
4626
4627 <- { "return": {} }
4628
4629 EQMP
4630
4631     {
4632         .name       = "query-memdev",
4633         .args_type  = "",
4634         .mhandler.cmd_new = qmp_marshal_query_memdev,
4635     },
4636
4637 SQMP
4638 query-memdev
4639 ------------
4640
4641 Show memory devices information.
4642
4643
4644 Example (1):
4645
4646 -> { "execute": "query-memdev" }
4647 <- { "return": [
4648        {
4649          "size": 536870912,
4650          "merge": false,
4651          "dump": true,
4652          "prealloc": false,
4653          "host-nodes": [0, 1],
4654          "policy": "bind"
4655        },
4656        {
4657          "size": 536870912,
4658          "merge": false,
4659          "dump": true,
4660          "prealloc": true,
4661          "host-nodes": [2, 3],
4662          "policy": "preferred"
4663        }
4664      ]
4665    }
4666
4667 EQMP
4668
4669     {
4670         .name       = "query-memory-devices",
4671         .args_type  = "",
4672         .mhandler.cmd_new = qmp_marshal_query_memory_devices,
4673     },
4674
4675 SQMP
4676 @query-memory-devices
4677 --------------------
4678
4679 Return a list of memory devices.
4680
4681 Example:
4682 -> { "execute": "query-memory-devices" }
4683 <- { "return": [ { "data":
4684                       { "addr": 5368709120,
4685                         "hotpluggable": true,
4686                         "hotplugged": true,
4687                         "id": "d1",
4688                         "memdev": "/objects/memX",
4689                         "node": 0,
4690                         "size": 1073741824,
4691                         "slot": 0},
4692                    "type": "dimm"
4693                  } ] }
4694 EQMP
4695
4696     {
4697         .name       = "query-acpi-ospm-status",
4698         .args_type  = "",
4699         .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status,
4700     },
4701
4702 SQMP
4703 @query-acpi-ospm-status
4704 --------------------
4705
4706 Return list of ACPIOSTInfo for devices that support status reporting
4707 via ACPI _OST method.
4708
4709 Example:
4710 -> { "execute": "query-acpi-ospm-status" }
4711 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4712                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4713                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4714                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4715    ]}
4716 EQMP
4717
4718 #if defined TARGET_I386
4719     {
4720         .name       = "rtc-reset-reinjection",
4721         .args_type  = "",
4722         .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection,
4723     },
4724 #endif
4725
4726 SQMP
4727 rtc-reset-reinjection
4728 ---------------------
4729
4730 Reset the RTC interrupt reinjection backlog.
4731
4732 Arguments: None.
4733
4734 Example:
4735
4736 -> { "execute": "rtc-reset-reinjection" }
4737 <- { "return": {} }
4738 EQMP
4739
4740     {
4741         .name       = "trace-event-get-state",
4742         .args_type  = "name:s,vcpu:i?",
4743         .mhandler.cmd_new = qmp_marshal_trace_event_get_state,
4744     },
4745
4746 SQMP
4747 trace-event-get-state
4748 ---------------------
4749
4750 Query the state of events.
4751
4752 Arguments:
4753
4754 - "name": Event name pattern (json-string).
4755 - "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
4756
4757 An event is returned if:
4758 - its name matches the "name" pattern, and
4759 - if "vcpu" is given, the event has the "vcpu" property.
4760
4761 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4762 returning their state on the specified vCPU. Special case: if "name" is an exact
4763 match, "vcpu" is given and the event does not have the "vcpu" property, an error
4764 is returned.
4765
4766 Example:
4767
4768 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4769 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4770 EQMP
4771
4772     {
4773         .name       = "trace-event-set-state",
4774         .args_type  = "name:s,enable:b,ignore-unavailable:b?,vcpu:i?",
4775         .mhandler.cmd_new = qmp_marshal_trace_event_set_state,
4776     },
4777
4778 SQMP
4779 trace-event-set-state
4780 ---------------------
4781
4782 Set the state of events.
4783
4784 Arguments:
4785
4786 - "name": Event name pattern (json-string).
4787 - "enable": Whether to enable or disable the event (json-bool).
4788 - "ignore-unavailable": Whether to ignore errors for events that cannot be
4789   changed (json-bool, optional).
4790 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
4791
4792 An event's state is modified if:
4793 - its name matches the "name" pattern, and
4794 - if "vcpu" is given, the event has the "vcpu" property.
4795
4796 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4797 setting their state on the specified vCPU. Special case: if "name" is an exact
4798 match, "vcpu" is given and the event does not have the "vcpu" property, an error
4799 is returned.
4800
4801 Example:
4802
4803 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4804 <- { "return": {} }
4805 EQMP
4806
4807     {
4808         .name       = "input-send-event",
4809         .args_type  = "console:i?,events:q",
4810         .mhandler.cmd_new = qmp_marshal_input_send_event,
4811     },
4812
4813 SQMP
4814 @input-send-event
4815 -----------------
4816
4817 Send input event to guest.
4818
4819 Arguments:
4820
4821 - "device": display device (json-string, optional)
4822 - "head": display head (json-int, optional)
4823 - "events": list of input events
4824
4825 The consoles are visible in the qom tree, under
4826 /backend/console[$index]. They have a device link and head property, so
4827 it is possible to map which console belongs to which device and display.
4828
4829 Example (1):
4830
4831 Press left mouse button.
4832
4833 -> { "execute": "input-send-event",
4834     "arguments": { "device": "video0",
4835                    "events": [ { "type": "btn",
4836                    "data" : { "down": true, "button": "left" } } ] } }
4837 <- { "return": {} }
4838
4839 -> { "execute": "input-send-event",
4840     "arguments": { "device": "video0",
4841                    "events": [ { "type": "btn",
4842                    "data" : { "down": false, "button": "left" } } ] } }
4843 <- { "return": {} }
4844
4845 Example (2):
4846
4847 Press ctrl-alt-del.
4848
4849 -> { "execute": "input-send-event",
4850      "arguments": { "events": [
4851         { "type": "key", "data" : { "down": true,
4852           "key": {"type": "qcode", "data": "ctrl" } } },
4853         { "type": "key", "data" : { "down": true,
4854           "key": {"type": "qcode", "data": "alt" } } },
4855         { "type": "key", "data" : { "down": true,
4856           "key": {"type": "qcode", "data": "delete" } } } ] } }
4857 <- { "return": {} }
4858
4859 Example (3):
4860
4861 Move mouse pointer to absolute coordinates (20000, 400).
4862
4863 -> { "execute": "input-send-event" ,
4864   "arguments": { "events": [
4865                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
4866                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
4867 <- { "return": {} }
4868
4869 EQMP
4870
4871     {
4872         .name       = "block-set-write-threshold",
4873         .args_type  = "node-name:s,write-threshold:l",
4874         .mhandler.cmd_new = qmp_marshal_block_set_write_threshold,
4875     },
4876
4877 SQMP
4878 block-set-write-threshold
4879 ------------
4880
4881 Change the write threshold for a block drive. The threshold is an offset,
4882 thus must be non-negative. Default is no write threshold.
4883 Setting the threshold to zero disables it.
4884
4885 Arguments:
4886
4887 - "node-name": the node name in the block driver state graph (json-string)
4888 - "write-threshold": the write threshold in bytes (json-int)
4889
4890 Example:
4891
4892 -> { "execute": "block-set-write-threshold",
4893   "arguments": { "node-name": "mydev",
4894                  "write-threshold": 17179869184 } }
4895 <- { "return": {} }
4896
4897 EQMP
4898
4899     {
4900         .name       = "query-rocker",
4901         .args_type  = "name:s",
4902         .mhandler.cmd_new = qmp_marshal_query_rocker,
4903     },
4904
4905 SQMP
4906 Show rocker switch
4907 ------------------
4908
4909 Arguments:
4910
4911 - "name": switch name
4912
4913 Example:
4914
4915 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4916 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4917
4918 EQMP
4919
4920     {
4921         .name       = "query-rocker-ports",
4922         .args_type  = "name:s",
4923         .mhandler.cmd_new = qmp_marshal_query_rocker_ports,
4924     },
4925
4926 SQMP
4927 Show rocker switch ports
4928 ------------------------
4929
4930 Arguments:
4931
4932 - "name": switch name
4933
4934 Example:
4935
4936 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4937 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4938                   "autoneg": "off", "link-up": true, "speed": 10000},
4939                  {"duplex": "full", "enabled": true, "name": "sw1.2",
4940                   "autoneg": "off", "link-up": true, "speed": 10000}
4941    ]}
4942
4943 EQMP
4944
4945     {
4946         .name       = "query-rocker-of-dpa-flows",
4947         .args_type  = "name:s,tbl-id:i?",
4948         .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows,
4949     },
4950
4951 SQMP
4952 Show rocker switch OF-DPA flow tables
4953 -------------------------------------
4954
4955 Arguments:
4956
4957 - "name": switch name
4958 - "tbl-id": (optional) flow table ID
4959
4960 Example:
4961
4962 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4963 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4964                   "hits": 138,
4965                   "cookie": 0,
4966                   "action": {"goto-tbl": 10},
4967                   "mask": {"in-pport": 4294901760}
4968                  },
4969                  {...more...},
4970    ]}
4971
4972 EQMP
4973
4974     {
4975         .name       = "query-rocker-of-dpa-groups",
4976         .args_type  = "name:s,type:i?",
4977         .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups,
4978     },
4979
4980 SQMP
4981 Show rocker OF-DPA group tables
4982 -------------------------------
4983
4984 Arguments:
4985
4986 - "name": switch name
4987 - "type": (optional) group type
4988
4989 Example:
4990
4991 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4992 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4993                   "pop-vlan": 1, "id": 251723778},
4994                  {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4995                   "pop-vlan": 1, "id": 251723776},
4996                  {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4997                   "pop-vlan": 1, "id": 251658241},
4998                  {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4999                   "pop-vlan": 1, "id": 251658240}
5000    ]}
5001
5002 EQMP
5003
5004 #if defined TARGET_ARM
5005     {
5006         .name       = "query-gic-capabilities",
5007         .args_type  = "",
5008         .mhandler.cmd_new = qmp_marshal_query_gic_capabilities,
5009     },
5010 #endif
5011
5012 SQMP
5013 query-gic-capabilities
5014 ---------------
5015
5016 Return a list of GICCapability objects, describing supported GIC
5017 (Generic Interrupt Controller) versions.
5018
5019 Arguments: None
5020
5021 Example:
5022
5023 -> { "execute": "query-gic-capabilities" }
5024 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
5025                 { "version": 3, "emulated": false, "kernel": true } ] }
5026
5027 EQMP
5028
5029     {
5030         .name       = "query-hotpluggable-cpus",
5031         .args_type  = "",
5032         .mhandler.cmd_new = qmp_marshal_query_hotpluggable_cpus,
5033     },
5034
5035 SQMP
5036 Show existing/possible CPUs
5037 ---------------------------
5038
5039 Arguments: None.
5040
5041 Example for pseries machine type started with
5042 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
5043
5044 -> { "execute": "query-hotpluggable-cpus" }
5045 <- {"return": [
5046      { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
5047        "vcpus-count": 1 },
5048      { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
5049        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
5050    ]}'
5051
5052 Example for pc machine type started with
5053 -smp 1,maxcpus=2:
5054     -> { "execute": "query-hotpluggable-cpus" }
5055     <- {"return": [
5056          {
5057             "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5058             "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
5059          },
5060          {
5061             "qom-path": "/machine/unattached/device[0]",
5062             "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5063             "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
5064          }
5065        ]}