]> git.proxmox.com Git - qemu.git/blame - qmp-commands.hx
target-i386: Add "feature-words" property to X86CPU
[qemu.git] / qmp-commands.hx
CommitLineData
82a56f0d
LC
1HXCOMM QMP dispatch table and documentation
2HXCOMM Text between SQMP and EQMP is copied to the QMP documention file and
3HXCOMM does not show up in the other formats.
4
5SQMP
6 QMP Supported Commands
7 ----------------------
8
9This document describes all commands currently supported by QMP.
10
11Most of the time their usage is exactly the same as in the user Monitor, this
12means that any other document which also describe commands (the manpage,
13QEMU's manual, etc) can and should be consulted.
14
15QMP has two types of commands: regular and query commands. Regular commands
16usually change the Virtual Machine's state someway, while query commands just
17return information. The sections below are divided accordingly.
18
19It's important to observe that all communication examples are formatted in
20a reader-friendly way, so that they're easier to understand. However, in real
21protocol usage, they're emitted as a single line.
22
23Also, the following notation is used to denote data flow:
24
25-> data issued by the Client
26<- Server data response
27
28Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed
29information on the Server command and response formats.
30
31NOTE: This document is temporary and will be replaced soon.
32
331. Stability Considerations
34===========================
35
36The current QMP command set (described in this file) may be useful for a
37number of use cases, however it's limited and several commands have bad
38defined semantics, specially with regard to command completion.
39
40These problems are going to be solved incrementally in the next QEMU releases
41and we're going to establish a deprecation policy for badly defined commands.
42
43If you're planning to adopt QMP, please observe the following:
44
c20cdf8b 45 1. The deprecation policy will take effect and be documented soon, please
82a56f0d
LC
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
552. Regular Commands
56===================
57
58Server's responses in the examples below are always a success response, please
59refer to the QMP specification for more details on error responses.
60
61EQMP
62
63 {
64 .name = "quit",
65 .args_type = "",
7a7f325e 66 .mhandler.cmd_new = qmp_marshal_input_quit,
82a56f0d
LC
67 },
68
69SQMP
70quit
71----
72
73Quit the emulator.
74
75Arguments: None.
76
77Example:
78
79-> { "execute": "quit" }
80<- { "return": {} }
81
82EQMP
83
84 {
85 .name = "eject",
86 .args_type = "force:-f,device:B",
c245b6a3 87 .mhandler.cmd_new = qmp_marshal_input_eject,
82a56f0d
LC
88 },
89
90SQMP
91eject
92-----
93
94Eject a removable medium.
95
96Arguments:
97
98- force: force ejection (json-bool, optional)
99- device: device name (json-string)
100
101Example:
102
103-> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
104<- { "return": {} }
105
106Note: The "force" argument defaults to false.
107
108EQMP
109
110 {
111 .name = "change",
112 .args_type = "device:B,target:F,arg:s?",
333a96ec 113 .mhandler.cmd_new = qmp_marshal_input_change,
82a56f0d
LC
114 },
115
116SQMP
117change
118------
119
120Change a removable medium or VNC configuration.
121
122Arguments:
123
124- "device": device name (json-string)
125- "target": filename or item (json-string)
126- "arg": additional argument (json-string, optional)
127
128Examples:
129
1301. 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
1372. Change VNC password
138
139-> { "execute": "change",
140 "arguments": { "device": "vnc", "target": "password",
141 "arg": "foobar1" } }
142<- { "return": {} }
143
144EQMP
145
146 {
147 .name = "screendump",
148 .args_type = "filename:F",
ad39cf6d 149 .mhandler.cmd_new = qmp_marshal_input_screendump,
82a56f0d
LC
150 },
151
152SQMP
153screendump
154----------
155
156Save screen into PPM image.
157
158Arguments:
159
160- "filename": file path (json-string)
161
162Example:
163
164-> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
165<- { "return": {} }
166
167EQMP
168
169 {
170 .name = "stop",
171 .args_type = "",
5f158f21 172 .mhandler.cmd_new = qmp_marshal_input_stop,
82a56f0d
LC
173 },
174
175SQMP
176stop
177----
178
179Stop the emulator.
180
181Arguments: None.
182
183Example:
184
185-> { "execute": "stop" }
186<- { "return": {} }
187
188EQMP
189
190 {
191 .name = "cont",
192 .args_type = "",
e42e818b 193 .mhandler.cmd_new = qmp_marshal_input_cont,
82a56f0d
LC
194 },
195
196SQMP
197cont
198----
199
200Resume emulation.
201
202Arguments: None.
203
204Example:
205
206-> { "execute": "cont" }
207<- { "return": {} }
9b9df25a
GH
208
209EQMP
210
211 {
212 .name = "system_wakeup",
213 .args_type = "",
214 .mhandler.cmd_new = qmp_marshal_input_system_wakeup,
215 },
216
217SQMP
218system_wakeup
219-------------
220
221Wakeup guest from suspend.
222
223Arguments: None.
224
225Example:
226
227-> { "execute": "system_wakeup" }
228<- { "return": {} }
82a56f0d
LC
229
230EQMP
231
232 {
233 .name = "system_reset",
234 .args_type = "",
38d22653 235 .mhandler.cmd_new = qmp_marshal_input_system_reset,
82a56f0d
LC
236 },
237
238SQMP
239system_reset
240------------
241
242Reset the system.
243
244Arguments: None.
245
246Example:
247
248-> { "execute": "system_reset" }
249<- { "return": {} }
250
251EQMP
252
253 {
254 .name = "system_powerdown",
255 .args_type = "",
22e1bb9c 256 .mhandler.cmd_new = qmp_marshal_input_system_powerdown,
82a56f0d
LC
257 },
258
259SQMP
260system_powerdown
261----------------
262
263Send system power down event.
264
265Arguments: None.
266
267Example:
268
269-> { "execute": "system_powerdown" }
270<- { "return": {} }
271
272EQMP
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 .user_print = monitor_user_noop,
280 .mhandler.cmd_new = do_device_add,
281 },
282
283SQMP
284device_add
285----------
286
287Add a device.
288
289Arguments:
290
291- "driver": the name of the new device's driver (json-string)
292- "bus": the device's parent bus (device tree path, json-string, optional)
293- "id": the device's ID, must be unique (json-string)
294- device properties
295
296Example:
297
298-> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
299<- { "return": {} }
300
301Notes:
302
303(1) For detailed information about this command, please refer to the
304 'docs/qdev-device-use.txt' file.
305
306(2) It's possible to list device properties by running QEMU with the
307 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
308
309EQMP
310
311 {
312 .name = "device_del",
313 .args_type = "id:s",
a15fef21 314 .mhandler.cmd_new = qmp_marshal_input_device_del,
82a56f0d
LC
315 },
316
317SQMP
318device_del
319----------
320
321Remove a device.
322
323Arguments:
324
325- "id": the device's ID (json-string)
326
327Example:
328
329-> { "execute": "device_del", "arguments": { "id": "net1" } }
330<- { "return": {} }
331
e4c8f004
AK
332EQMP
333
334 {
335 .name = "send-key",
336 .args_type = "keys:O,hold-time:i?",
337 .mhandler.cmd_new = qmp_marshal_input_send_key,
338 },
339
340SQMP
341send-key
342----------
343
344Send keys to VM.
345
346Arguments:
347
348keys array:
349 - "key": key sequence (a json-array of key enum values)
350
351- hold-time: time to delay key up events, milliseconds. Defaults to 100
352 (json-int, optional)
353
354Example:
355
356-> { "execute": "send-key",
357 "arguments": { 'keys': [ 'ctrl', 'alt', 'delete' ] } }
358<- { "return": {} }
359
82a56f0d
LC
360EQMP
361
362 {
363 .name = "cpu",
364 .args_type = "index:i",
755f1968 365 .mhandler.cmd_new = qmp_marshal_input_cpu,
82a56f0d
LC
366 },
367
368SQMP
369cpu
370---
371
372Set the default CPU.
373
374Arguments:
375
376- "index": the CPU's index (json-int)
377
378Example:
379
380-> { "execute": "cpu", "arguments": { "index": 0 } }
381<- { "return": {} }
382
383Note: CPUs' indexes are obtained with the 'query-cpus' command.
384
69ca3ea5
IM
385EQMP
386
387 {
388 .name = "cpu-add",
389 .args_type = "id:i",
390 .mhandler.cmd_new = qmp_marshal_input_cpu_add,
391 },
392
393SQMP
394cpu-add
395-------
396
397Adds virtual cpu
398
399Arguments:
400
401- "id": cpu id (json-int)
402
403Example:
404
405-> { "execute": "cpu-add", "arguments": { "id": 2 } }
406<- { "return": {} }
407
82a56f0d
LC
408EQMP
409
410 {
411 .name = "memsave",
0cfd6a9a
LC
412 .args_type = "val:l,size:i,filename:s,cpu:i?",
413 .mhandler.cmd_new = qmp_marshal_input_memsave,
82a56f0d
LC
414 },
415
416SQMP
417memsave
418-------
419
420Save to disk virtual memory dump starting at 'val' of size 'size'.
421
422Arguments:
423
424- "val": the starting address (json-int)
425- "size": the memory size, in bytes (json-int)
426- "filename": file path (json-string)
0cfd6a9a 427- "cpu": virtual CPU index (json-int, optional)
82a56f0d
LC
428
429Example:
430
431-> { "execute": "memsave",
432 "arguments": { "val": 10,
433 "size": 100,
434 "filename": "/tmp/virtual-mem-dump" } }
435<- { "return": {} }
436
82a56f0d
LC
437EQMP
438
439 {
440 .name = "pmemsave",
441 .args_type = "val:l,size:i,filename:s",
6d3962bf 442 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
82a56f0d
LC
443 },
444
445SQMP
446pmemsave
447--------
448
449Save to disk physical memory dump starting at 'val' of size 'size'.
450
451Arguments:
452
453- "val": the starting address (json-int)
454- "size": the memory size, in bytes (json-int)
455- "filename": file path (json-string)
456
457Example:
458
459-> { "execute": "pmemsave",
460 "arguments": { "val": 10,
461 "size": 100,
462 "filename": "/tmp/physical-mem-dump" } }
463<- { "return": {} }
464
a4046664
LJ
465EQMP
466
467 {
468 .name = "inject-nmi",
469 .args_type = "",
ab49ab5c 470 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
a4046664
LJ
471 },
472
473SQMP
474inject-nmi
475----------
476
477Inject an NMI on guest's CPUs.
478
479Arguments: None.
480
481Example:
482
483-> { "execute": "inject-nmi" }
484<- { "return": {} }
485
de253f14
LC
486Note: inject-nmi fails when the guest doesn't support injecting.
487 Currently, only x86 guests do.
a4046664 488
1f590cf9
LL
489EQMP
490
491 {
3949e594 492 .name = "ringbuf-write",
82e59a67 493 .args_type = "device:s,data:s,format:s?",
3949e594 494 .mhandler.cmd_new = qmp_marshal_input_ringbuf_write,
1f590cf9
LL
495 },
496
497SQMP
3949e594 498ringbuf-write
1f590cf9
LL
499-------------
500
3949e594 501Write to a ring buffer character device.
1f590cf9
LL
502
503Arguments:
504
3949e594
MA
505- "device": ring buffer character device name (json-string)
506- "data": data to write (json-string)
507- "format": data format (json-string, optional)
508 - Possible values: "utf8" (default), "base64"
509 Bug: invalid base64 is currently not rejected.
510 Whitespace *is* invalid.
1f590cf9
LL
511
512Example:
513
3949e594
MA
514-> { "execute": "ringbuf-write",
515 "arguments": { "device": "foo",
1f590cf9
LL
516 "data": "abcdefgh",
517 "format": "utf8" } }
518<- { "return": {} }
519
49b6d722
LL
520EQMP
521
522 {
3949e594 523 .name = "ringbuf-read",
49b6d722 524 .args_type = "device:s,size:i,format:s?",
3949e594 525 .mhandler.cmd_new = qmp_marshal_input_ringbuf_read,
49b6d722
LL
526 },
527
528SQMP
3949e594 529ringbuf-read
49b6d722
LL
530-------------
531
3949e594 532Read from a ring buffer character device.
49b6d722
LL
533
534Arguments:
535
3949e594
MA
536- "device": ring buffer character device name (json-string)
537- "size": how many bytes to read at most (json-int)
538 - Number of data bytes, not number of characters in encoded data
539- "format": data format (json-string, optional)
540 - Possible values: "utf8" (default), "base64"
541 - Naturally, format "utf8" works only when the ring buffer
542 contains valid UTF-8 text. Invalid UTF-8 sequences get
543 replaced. Bug: replacement doesn't work. Bug: can screw
544 up on encountering NUL characters, after the ring buffer
545 lost data, and when reading stops because the size limit
546 is reached.
49b6d722
LL
547
548Example:
549
3949e594
MA
550-> { "execute": "ringbuf-read",
551 "arguments": { "device": "foo",
49b6d722
LL
552 "size": 1000,
553 "format": "utf8" } }
3ab651fc 554<- {"return": "abcdefgh"}
49b6d722 555
a7ae8355
SS
556EQMP
557
558 {
559 .name = "xen-save-devices-state",
560 .args_type = "filename:F",
561 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
562 },
563
564SQMP
565xen-save-devices-state
566-------
567
568Save the state of all devices to file. The RAM and the block devices
569of the VM are not saved by this command.
570
571Arguments:
572
573- "filename": the file to save the state of the devices to as binary
574data. See xen-save-devices-state.txt for a description of the binary
575format.
576
577Example:
578
579-> { "execute": "xen-save-devices-state",
580 "arguments": { "filename": "/tmp/save" } }
581<- { "return": {} }
582
39f42439
AP
583EQMP
584
585 {
586 .name = "xen-set-global-dirty-log",
587 .args_type = "enable:b",
588 .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
589 },
590
591SQMP
592xen-set-global-dirty-log
593-------
594
595Enable or disable the global dirty log mode.
596
597Arguments:
598
599- "enable": Enable it or disable it.
600
601Example:
602
603-> { "execute": "xen-set-global-dirty-log",
604 "arguments": { "enable": true } }
605<- { "return": {} }
606
82a56f0d
LC
607EQMP
608
609 {
610 .name = "migrate",
611 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
e1c37d0e 612 .mhandler.cmd_new = qmp_marshal_input_migrate,
82a56f0d
LC
613 },
614
615SQMP
616migrate
617-------
618
619Migrate to URI.
620
621Arguments:
622
623- "blk": block migration, full disk copy (json-bool, optional)
624- "inc": incremental disk copy (json-bool, optional)
625- "uri": Destination URI (json-string)
626
627Example:
628
629-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
630<- { "return": {} }
631
632Notes:
633
634(1) The 'query-migrate' command should be used to check migration's progress
635 and final result (this information is provided by the 'status' member)
636(2) All boolean arguments default to false
637(3) The user Monitor's "detach" argument is invalid in QMP and should not
638 be used
639
640EQMP
641
642 {
643 .name = "migrate_cancel",
644 .args_type = "",
6cdedb07 645 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
82a56f0d
LC
646 },
647
648SQMP
649migrate_cancel
650--------------
651
652Cancel the current migration.
653
654Arguments: None.
655
656Example:
657
658-> { "execute": "migrate_cancel" }
659<- { "return": {} }
660
9e1ba4cc
OW
661EQMP
662{
663 .name = "migrate-set-cache-size",
664 .args_type = "value:o",
665 .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
666 },
667
668SQMP
669migrate-set-cache-size
817c6045 670----------------------
9e1ba4cc
OW
671
672Set cache size to be used by XBZRLE migration, the cache size will be rounded
673down to the nearest power of 2
674
675Arguments:
676
677- "value": cache size in bytes (json-int)
678
679Example:
680
681-> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
682<- { "return": {} }
683
684EQMP
685 {
686 .name = "query-migrate-cache-size",
687 .args_type = "",
688 .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
689 },
690
691SQMP
692query-migrate-cache-size
817c6045 693------------------------
9e1ba4cc
OW
694
695Show cache size to be used by XBZRLE migration
696
697returns a json-object with the following information:
698- "size" : json-int
699
700Example:
701
702-> { "execute": "query-migrate-cache-size" }
703<- { "return": 67108864 }
704
82a56f0d
LC
705EQMP
706
707 {
708 .name = "migrate_set_speed",
3a019b6e 709 .args_type = "value:o",
3dc85383 710 .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
82a56f0d
LC
711 },
712
e866e239 713SQMP
ff73edf5
JS
714migrate_set_speed
715-----------------
e866e239 716
ff73edf5 717Set maximum speed for migrations.
e866e239
GH
718
719Arguments:
720
ff73edf5 721- "value": maximum speed, in bytes per second (json-int)
e866e239
GH
722
723Example:
724
ff73edf5 725-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
e866e239
GH
726<- { "return": {} }
727
728EQMP
729
730 {
ff73edf5
JS
731 .name = "migrate_set_downtime",
732 .args_type = "value:T",
4f0a993b 733 .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
e866e239
GH
734 },
735
82a56f0d 736SQMP
ff73edf5
JS
737migrate_set_downtime
738--------------------
82a56f0d 739
ff73edf5 740Set maximum tolerated downtime (in seconds) for migrations.
82a56f0d
LC
741
742Arguments:
743
ff73edf5 744- "value": maximum downtime (json-number)
82a56f0d
LC
745
746Example:
747
ff73edf5 748-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
82a56f0d
LC
749<- { "return": {} }
750
751EQMP
752
753 {
ff73edf5
JS
754 .name = "client_migrate_info",
755 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
756 .params = "protocol hostname port tls-port cert-subject",
757 .help = "send migration info to spice/vnc client",
82a56f0d 758 .user_print = monitor_user_noop,
edc5cb1a
YH
759 .mhandler.cmd_async = client_migrate_info,
760 .flags = MONITOR_CMD_ASYNC,
82a56f0d
LC
761 },
762
763SQMP
ff73edf5
JS
764client_migrate_info
765------------------
82a56f0d 766
ff73edf5
JS
767Set the spice/vnc connection info for the migration target. The spice/vnc
768server will ask the spice/vnc client to automatically reconnect using the
769new parameters (if specified) once the vm migration finished successfully.
82a56f0d
LC
770
771Arguments:
772
ff73edf5
JS
773- "protocol": protocol: "spice" or "vnc" (json-string)
774- "hostname": migration target hostname (json-string)
775- "port": spice/vnc tcp port for plaintext channels (json-int, optional)
776- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
777- "cert-subject": server certificate subject (json-string, optional)
82a56f0d
LC
778
779Example:
780
ff73edf5
JS
781-> { "execute": "client_migrate_info",
782 "arguments": { "protocol": "spice",
783 "hostname": "virt42.lab.kraxel.org",
784 "port": 1234 } }
82a56f0d
LC
785<- { "return": {} }
786
783e9b48
WC
787EQMP
788
789 {
790 .name = "dump-guest-memory",
791 .args_type = "paging:b,protocol:s,begin:i?,end:i?",
792 .params = "-p protocol [begin] [length]",
793 .help = "dump guest memory to file",
794 .user_print = monitor_user_noop,
795 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
796 },
797
798SQMP
799dump
800
801
802Dump guest memory to file. The file can be processed with crash or gdb.
803
804Arguments:
805
806- "paging": do paging to get guest's memory mapping (json-bool)
807- "protocol": destination file(started with "file:") or destination file
808 descriptor (started with "fd:") (json-string)
809- "begin": the starting physical address. It's optional, and should be specified
810 with length together (json-int)
811- "length": the memory size, in bytes. It's optional, and should be specified
812 with begin together (json-int)
813
814Example:
815
816-> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
817<- { "return": {} }
818
819Notes:
820
821(1) All boolean arguments default to false
822
82a56f0d
LC
823EQMP
824
825 {
826 .name = "netdev_add",
827 .args_type = "netdev:O",
928059a3 828 .mhandler.cmd_new = qmp_netdev_add,
82a56f0d
LC
829 },
830
831SQMP
832netdev_add
833----------
834
835Add host network device.
836
837Arguments:
838
839- "type": the device type, "tap", "user", ... (json-string)
840- "id": the device's ID, must be unique (json-string)
841- device options
842
843Example:
844
845-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
846<- { "return": {} }
847
af347aa5 848Note: The supported device options are the same ones supported by the '-netdev'
82a56f0d
LC
849 command-line argument, which are listed in the '-help' output or QEMU's
850 manual
851
852EQMP
853
854 {
855 .name = "netdev_del",
856 .args_type = "id:s",
5f964155 857 .mhandler.cmd_new = qmp_marshal_input_netdev_del,
82a56f0d
LC
858 },
859
860SQMP
861netdev_del
862----------
863
864Remove host network device.
865
866Arguments:
867
868- "id": the device's ID, must be unique (json-string)
869
870Example:
871
872-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
873<- { "return": {} }
874
6d4a2b3a
CH
875
876EQMP
877
878 {
879 .name = "block_resize",
880 .args_type = "device:B,size:o",
5e7caacb 881 .mhandler.cmd_new = qmp_marshal_input_block_resize,
6d4a2b3a
CH
882 },
883
884SQMP
885block_resize
886------------
887
888Resize a block image while a guest is running.
889
890Arguments:
891
892- "device": the device's ID, must be unique (json-string)
893- "size": new size
894
895Example:
896
897-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
898<- { "return": {} }
899
d967b2f1
JS
900EQMP
901
12bd451f 902 {
db58f9c0 903 .name = "block-stream",
1d809098 904 .args_type = "device:B,base:s?,speed:o?,on-error:s?",
12bd451f
SH
905 .mhandler.cmd_new = qmp_marshal_input_block_stream,
906 },
907
ed61fc10
JC
908 {
909 .name = "block-commit",
910 .args_type = "device:B,base:s?,top:s,speed:o?",
911 .mhandler.cmd_new = qmp_marshal_input_block_commit,
912 },
913
2d47c6e9 914 {
db58f9c0 915 .name = "block-job-set-speed",
882ec7ce 916 .args_type = "device:B,speed:o",
2d47c6e9
SH
917 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
918 },
919
370521a1 920 {
db58f9c0 921 .name = "block-job-cancel",
6e37fb81 922 .args_type = "device:B,force:b?",
370521a1
SH
923 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
924 },
6e37fb81
PB
925 {
926 .name = "block-job-pause",
927 .args_type = "device:B",
928 .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
929 },
930 {
931 .name = "block-job-resume",
932 .args_type = "device:B",
933 .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
934 },
aeae883b
PB
935 {
936 .name = "block-job-complete",
937 .args_type = "device:B",
938 .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
939 },
c186402c 940 {
52e7c241 941 .name = "transaction",
b9f8978c 942 .args_type = "actions:q",
52e7c241 943 .mhandler.cmd_new = qmp_marshal_input_transaction,
c186402c
JC
944 },
945
946SQMP
52e7c241
PB
947transaction
948-----------
c186402c 949
52e7c241
PB
950Atomically operate on one or more block devices. The only supported
951operation for now is snapshotting. If there is any failure performing
952any of the operations, all snapshots for the group are abandoned, and
953the original disks pre-snapshot attempt are used.
c186402c 954
52e7c241
PB
955A list of dictionaries is accepted, that contains the actions to be performed.
956For snapshots this is the device, the file to use for the new snapshot,
957and the format. The default format, if not specified, is qcow2.
c186402c 958
bc8b094f
PB
959Each new snapshot defaults to being created by QEMU (wiping any
960contents if the file already exists), but it is also possible to reuse
961an externally-created file. In the latter case, you should ensure that
962the new image file has the same contents as the current one; QEMU cannot
963perform any meaningful check. Typically this is achieved by using the
964current image file as the backing file for the new image.
965
c186402c
JC
966Arguments:
967
52e7c241
PB
968actions array:
969 - "type": the operation to perform. The only supported
970 value is "blockdev-snapshot-sync". (json-string)
971 - "data": a dictionary. The contents depend on the value
972 of "type". When "type" is "blockdev-snapshot-sync":
973 - "device": device name to snapshot (json-string)
974 - "snapshot-file": name of new image file (json-string)
975 - "format": format of new image (json-string, optional)
bc8b094f
PB
976 - "mode": whether and how QEMU should create the snapshot file
977 (NewImageMode, optional, default "absolute-paths")
c186402c
JC
978
979Example:
980
52e7c241
PB
981-> { "execute": "transaction",
982 "arguments": { "actions": [
983 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd0",
984 "snapshot-file": "/some/place/my-image",
985 "format": "qcow2" } },
986 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd1",
987 "snapshot-file": "/some/place/my-image2",
bc8b094f 988 "mode": "existing",
52e7c241 989 "format": "qcow2" } } ] } }
c186402c
JC
990<- { "return": {} }
991
992EQMP
370521a1 993
d967b2f1
JS
994 {
995 .name = "blockdev-snapshot-sync",
31155b9b 996 .args_type = "device:B,snapshot-file:s,format:s?,mode:s?",
6106e249 997 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
d967b2f1
JS
998 },
999
1000SQMP
1001blockdev-snapshot-sync
1002----------------------
1003
1004Synchronous snapshot of a block device. snapshot-file specifies the
1005target of the new image. If the file exists, or if it is a device, the
1006snapshot will be created in the existing file/device. If does not
1007exist, a new file will be created. format specifies the format of the
1008snapshot image, default is qcow2.
1009
1010Arguments:
1011
1012- "device": device name to snapshot (json-string)
1013- "snapshot-file": name of new image file (json-string)
6cc2a415
PB
1014- "mode": whether and how QEMU should create the snapshot file
1015 (NewImageMode, optional, default "absolute-paths")
d967b2f1
JS
1016- "format": format of new image (json-string, optional)
1017
1018Example:
1019
7f3850c2
LC
1020-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1021 "snapshot-file":
1022 "/some/place/my-image",
1023 "format": "qcow2" } }
d967b2f1
JS
1024<- { "return": {} }
1025
d9b902db
PB
1026EQMP
1027
1028 {
1029 .name = "drive-mirror",
b952b558 1030 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
eee13dfe 1031 "on-source-error:s?,on-target-error:s?,"
08e4ed6c 1032 "granularity:i?,buf-size:i?",
d9b902db
PB
1033 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1034 },
1035
1036SQMP
1037drive-mirror
1038------------
1039
1040Start mirroring a block device's writes to a new destination. target
1041specifies the target of the new image. If the file exists, or if it is
1042a device, it will be used as the new destination for writes. If it does not
1043exist, a new file will be created. format specifies the format of the
1044mirror image, default is to probe if mode='existing', else the format
1045of the source.
1046
1047Arguments:
1048
1049- "device": device name to operate on (json-string)
1050- "target": name of new image file (json-string)
1051- "format": format of new image (json-string, optional)
1052- "mode": how an image file should be created into the target
1053 file/device (NewImageMode, optional, default 'absolute-paths')
1054- "speed": maximum speed of the streaming job, in bytes per second
1055 (json-int)
eee13dfe 1056- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
08e4ed6c
PB
1057- "buf_size": maximum amount of data in flight from source to target, in bytes
1058 (json-int, default 10M)
d9b902db
PB
1059- "sync": what parts of the disk image should be copied to the destination;
1060 possibilities include "full" for all the disk, "top" for only the sectors
1061 allocated in the topmost image, or "none" to only replicate new I/O
1062 (MirrorSyncMode).
b952b558
PB
1063- "on-source-error": the action to take on an error on the source
1064 (BlockdevOnError, default 'report')
1065- "on-target-error": the action to take on an error on the target
1066 (BlockdevOnError, default 'report')
1067
eee13dfe
PB
1068The default value of the granularity is the image cluster size clamped
1069between 4096 and 65536, if the image format defines one. If the format
1070does not define a cluster size, the default value of the granularity
1071is 65536.
d9b902db
PB
1072
1073
1074Example:
1075
1076-> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1077 "target": "/some/place/my-image",
1078 "sync": "full",
1079 "format": "qcow2" } }
1080<- { "return": {} }
1081
82a56f0d
LC
1082EQMP
1083
1084 {
1085 .name = "balloon",
1086 .args_type = "value:M",
d72f3264 1087 .mhandler.cmd_new = qmp_marshal_input_balloon,
82a56f0d
LC
1088 },
1089
1090SQMP
1091balloon
1092-------
1093
1094Request VM to change its memory allocation (in bytes).
1095
1096Arguments:
1097
1098- "value": New memory allocation (json-int)
1099
1100Example:
1101
1102-> { "execute": "balloon", "arguments": { "value": 536870912 } }
1103<- { "return": {} }
1104
1105EQMP
1106
1107 {
1108 .name = "set_link",
1109 .args_type = "name:s,up:b",
4b37156c 1110 .mhandler.cmd_new = qmp_marshal_input_set_link,
82a56f0d
LC
1111 },
1112
1113SQMP
1114set_link
1115--------
1116
1117Change the link status of a network adapter.
1118
1119Arguments:
1120
1121- "name": network device name (json-string)
1122- "up": status is up (json-bool)
1123
1124Example:
1125
1126-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1127<- { "return": {} }
1128
1129EQMP
1130
1131 {
1132 .name = "getfd",
1133 .args_type = "fdname:s",
1134 .params = "getfd name",
1135 .help = "receive a file descriptor via SCM rights and assign it a name",
208c9d1b 1136 .mhandler.cmd_new = qmp_marshal_input_getfd,
82a56f0d
LC
1137 },
1138
1139SQMP
1140getfd
1141-----
1142
1143Receive a file descriptor via SCM rights and assign it a name.
1144
1145Arguments:
1146
1147- "fdname": file descriptor name (json-string)
1148
1149Example:
1150
1151-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1152<- { "return": {} }
1153
208c9d1b
CB
1154Notes:
1155
1156(1) If the name specified by the "fdname" argument already exists,
1157 the file descriptor assigned to it will be closed and replaced
1158 by the received file descriptor.
1159(2) The 'closefd' command can be used to explicitly close the file
1160 descriptor when it is no longer needed.
1161
82a56f0d
LC
1162EQMP
1163
1164 {
1165 .name = "closefd",
1166 .args_type = "fdname:s",
1167 .params = "closefd name",
1168 .help = "close a file descriptor previously passed via SCM rights",
208c9d1b 1169 .mhandler.cmd_new = qmp_marshal_input_closefd,
82a56f0d
LC
1170 },
1171
1172SQMP
1173closefd
1174-------
1175
1176Close a file descriptor previously passed via SCM rights.
1177
1178Arguments:
1179
1180- "fdname": file descriptor name (json-string)
1181
1182Example:
1183
1184-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1185<- { "return": {} }
1186
ba1c048a
CB
1187EQMP
1188
1189 {
1190 .name = "add-fd",
1191 .args_type = "fdset-id:i?,opaque:s?",
1192 .params = "add-fd fdset-id opaque",
1193 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1194 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1195 },
1196
1197SQMP
1198add-fd
1199-------
1200
1201Add a file descriptor, that was passed via SCM rights, to an fd set.
1202
1203Arguments:
1204
1205- "fdset-id": The ID of the fd set to add the file descriptor to.
1206 (json-int, optional)
1207- "opaque": A free-form string that can be used to describe the fd.
1208 (json-string, optional)
1209
1210Return a json-object with the following information:
1211
1212- "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1213- "fd": The file descriptor that was received via SCM rights and added to the
1214 fd set. (json-int)
1215
1216Example:
1217
1218-> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1219<- { "return": { "fdset-id": 1, "fd": 3 } }
1220
1221Notes:
1222
1223(1) The list of fd sets is shared by all monitor connections.
1224(2) If "fdset-id" is not specified, a new fd set will be created.
1225
1226EQMP
1227
1228 {
1229 .name = "remove-fd",
1230 .args_type = "fdset-id:i,fd:i?",
1231 .params = "remove-fd fdset-id fd",
1232 .help = "Remove a file descriptor from an fd set",
1233 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1234 },
1235
1236SQMP
1237remove-fd
1238---------
1239
1240Remove a file descriptor from an fd set.
1241
1242Arguments:
1243
1244- "fdset-id": The ID of the fd set that the file descriptor belongs to.
1245 (json-int)
1246- "fd": The file descriptor that is to be removed. (json-int, optional)
1247
1248Example:
1249
1250-> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1251<- { "return": {} }
1252
1253Notes:
1254
1255(1) The list of fd sets is shared by all monitor connections.
1256(2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1257 removed.
1258
1259EQMP
1260
1261 {
1262 .name = "query-fdsets",
1263 .args_type = "",
1264 .help = "Return information describing all fd sets",
1265 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1266 },
1267
1268SQMP
1269query-fdsets
1270-------------
1271
1272Return information describing all fd sets.
1273
1274Arguments: None
1275
1276Example:
1277
1278-> { "execute": "query-fdsets" }
1279<- { "return": [
1280 {
1281 "fds": [
1282 {
1283 "fd": 30,
1284 "opaque": "rdonly:/path/to/file"
1285 },
1286 {
1287 "fd": 24,
1288 "opaque": "rdwr:/path/to/file"
1289 }
1290 ],
1291 "fdset-id": 1
1292 },
1293 {
1294 "fds": [
1295 {
1296 "fd": 28
1297 },
1298 {
1299 "fd": 29
1300 }
1301 ],
1302 "fdset-id": 0
1303 }
1304 ]
1305 }
1306
1307Note: The list of fd sets is shared by all monitor connections.
1308
82a56f0d
LC
1309EQMP
1310
1311 {
1312 .name = "block_passwd",
1313 .args_type = "device:B,password:s",
a4dea8a9 1314 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
82a56f0d
LC
1315 },
1316
1317SQMP
1318block_passwd
1319------------
1320
1321Set the password of encrypted block devices.
1322
1323Arguments:
1324
1325- "device": device name (json-string)
1326- "password": password (json-string)
1327
1328Example:
1329
1330-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1331 "password": "12345" } }
1332<- { "return": {} }
1333
727f005e
ZYW
1334EQMP
1335
1336 {
1337 .name = "block_set_io_throttle",
1338 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
80047da5 1339 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
727f005e
ZYW
1340 },
1341
1342SQMP
1343block_set_io_throttle
1344------------
1345
1346Change I/O throttle limits for a block drive.
1347
1348Arguments:
1349
1350- "device": device name (json-string)
1351- "bps": total throughput limit in bytes per second(json-int)
1352- "bps_rd": read throughput limit in bytes per second(json-int)
1353- "bps_wr": read throughput limit in bytes per second(json-int)
1354- "iops": total I/O operations per second(json-int)
1355- "iops_rd": read I/O operations per second(json-int)
1356- "iops_wr": write I/O operations per second(json-int)
1357
1358Example:
1359
1360-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1361 "bps": "1000000",
1362 "bps_rd": "0",
1363 "bps_wr": "0",
1364 "iops": "0",
1365 "iops_rd": "0",
1366 "iops_wr": "0" } }
1367<- { "return": {} }
1368
7572150c
GH
1369EQMP
1370
1371 {
1372 .name = "set_password",
1373 .args_type = "protocol:s,password:s,connected:s?",
fbf796fd 1374 .mhandler.cmd_new = qmp_marshal_input_set_password,
7572150c
GH
1375 },
1376
1377SQMP
1378set_password
1379------------
1380
1381Set the password for vnc/spice protocols.
1382
1383Arguments:
1384
1385- "protocol": protocol name (json-string)
1386- "password": password (json-string)
1387- "connected": [ keep | disconnect | fail ] (josn-string, optional)
1388
1389Example:
1390
1391-> { "execute": "set_password", "arguments": { "protocol": "vnc",
1392 "password": "secret" } }
1393<- { "return": {} }
1394
1395EQMP
1396
1397 {
1398 .name = "expire_password",
1399 .args_type = "protocol:s,time:s",
9ad5372d 1400 .mhandler.cmd_new = qmp_marshal_input_expire_password,
7572150c
GH
1401 },
1402
1403SQMP
1404expire_password
1405---------------
1406
1407Set the password expire time for vnc/spice protocols.
1408
1409Arguments:
1410
1411- "protocol": protocol name (json-string)
1412- "time": [ now | never | +secs | secs ] (json-string)
1413
1414Example:
1415
1416-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1417 "time": "+60" } }
1418<- { "return": {} }
1419
82a56f0d
LC
1420EQMP
1421
13661089
DB
1422 {
1423 .name = "add_client",
f1f5f407 1424 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
b224e5e2 1425 .mhandler.cmd_new = qmp_marshal_input_add_client,
13661089
DB
1426 },
1427
1428SQMP
1429add_client
1430----------
1431
1432Add a graphics client
1433
1434Arguments:
1435
1436- "protocol": protocol name (json-string)
1437- "fdname": file descriptor name (json-string)
f1f5f407
DB
1438- "skipauth": whether to skip authentication (json-bool, optional)
1439- "tls": whether to perform TLS (json-bool, optional)
13661089
DB
1440
1441Example:
1442
1443-> { "execute": "add_client", "arguments": { "protocol": "vnc",
1444 "fdname": "myclient" } }
1445<- { "return": {} }
1446
1447EQMP
82a56f0d
LC
1448 {
1449 .name = "qmp_capabilities",
1450 .args_type = "",
1451 .params = "",
1452 .help = "enable QMP capabilities",
1453 .user_print = monitor_user_noop,
1454 .mhandler.cmd_new = do_qmp_capabilities,
1455 },
1456
1457SQMP
1458qmp_capabilities
1459----------------
1460
1461Enable QMP capabilities.
1462
1463Arguments: None.
1464
1465Example:
1466
1467-> { "execute": "qmp_capabilities" }
1468<- { "return": {} }
1469
1470Note: This command must be issued before issuing any other command.
1471
0268d97c
LC
1472EQMP
1473
1474 {
1475 .name = "human-monitor-command",
1476 .args_type = "command-line:s,cpu-index:i?",
d51a67b4 1477 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
0268d97c
LC
1478 },
1479
1480SQMP
1481human-monitor-command
1482---------------------
1483
1484Execute a Human Monitor command.
1485
1486Arguments:
1487
1488- command-line: the command name and its arguments, just like the
1489 Human Monitor's shell (json-string)
1490- cpu-index: select the CPU number to be used by commands which access CPU
1491 data, like 'info registers'. The Monitor selects CPU 0 if this
1492 argument is not provided (json-int, optional)
1493
1494Example:
1495
1496-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1497<- { "return": "kvm support: enabled\r\n" }
1498
1499Notes:
1500
1501(1) The Human Monitor is NOT an stable interface, this means that command
1502 names, arguments and responses can change or be removed at ANY time.
1503 Applications that rely on long term stability guarantees should NOT
1504 use this command
1505
1506(2) Limitations:
1507
1508 o This command is stateless, this means that commands that depend
1509 on state information (such as getfd) might not work
1510
1511 o Commands that prompt the user for data (eg. 'cont' when the block
1512 device is encrypted) don't currently work
1513
82a56f0d
LC
15143. Query Commands
1515=================
1516
1517HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1518HXCOMM this! We will possibly move query commands definitions inside those
1519HXCOMM sections, just like regular commands.
1520
1521EQMP
1522
1523SQMP
1524query-version
1525-------------
1526
1527Show QEMU version.
1528
1529Return a json-object with the following information:
1530
1531- "qemu": A json-object containing three integer values:
1532 - "major": QEMU's major version (json-int)
1533 - "minor": QEMU's minor version (json-int)
1534 - "micro": QEMU's micro version (json-int)
1535- "package": package's version (json-string)
1536
1537Example:
1538
1539-> { "execute": "query-version" }
1540<- {
1541 "return":{
1542 "qemu":{
1543 "major":0,
1544 "minor":11,
1545 "micro":5
1546 },
1547 "package":""
1548 }
1549 }
1550
1551EQMP
1552
b9c15f16
LC
1553 {
1554 .name = "query-version",
1555 .args_type = "",
1556 .mhandler.cmd_new = qmp_marshal_input_query_version,
1557 },
1558
82a56f0d
LC
1559SQMP
1560query-commands
1561--------------
1562
1563List QMP available commands.
1564
1565Each command is represented by a json-object, the returned value is a json-array
1566of all commands.
1567
1568Each json-object contain:
1569
1570- "name": command's name (json-string)
1571
1572Example:
1573
1574-> { "execute": "query-commands" }
1575<- {
1576 "return":[
1577 {
1578 "name":"query-balloon"
1579 },
1580 {
1581 "name":"system_powerdown"
1582 }
1583 ]
1584 }
1585
1586Note: This example has been shortened as the real response is too long.
1587
1588EQMP
1589
aa9b79bc
LC
1590 {
1591 .name = "query-commands",
1592 .args_type = "",
1593 .mhandler.cmd_new = qmp_marshal_input_query_commands,
1594 },
1595
4860853d
DB
1596SQMP
1597query-events
1598--------------
1599
1600List QMP available events.
1601
1602Each event is represented by a json-object, the returned value is a json-array
1603of all events.
1604
1605Each json-object contains:
1606
1607- "name": event's name (json-string)
1608
1609Example:
1610
1611-> { "execute": "query-events" }
1612<- {
1613 "return":[
1614 {
1615 "name":"SHUTDOWN"
1616 },
1617 {
1618 "name":"RESET"
1619 }
1620 ]
1621 }
1622
1623Note: This example has been shortened as the real response is too long.
1624
1625EQMP
1626
1627 {
1628 .name = "query-events",
1629 .args_type = "",
1630 .mhandler.cmd_new = qmp_marshal_input_query_events,
1631 },
1632
82a56f0d
LC
1633SQMP
1634query-chardev
1635-------------
1636
1637Each device is represented by a json-object. The returned value is a json-array
1638of all devices.
1639
1640Each json-object contain the following:
1641
1642- "label": device's label (json-string)
1643- "filename": device's file (json-string)
1644
1645Example:
1646
1647-> { "execute": "query-chardev" }
1648<- {
1649 "return":[
1650 {
1651 "label":"monitor",
1652 "filename":"stdio"
1653 },
1654 {
1655 "label":"serial0",
1656 "filename":"vc"
1657 }
1658 ]
1659 }
1660
1661EQMP
1662
c5a415a0
LC
1663 {
1664 .name = "query-chardev",
1665 .args_type = "",
1666 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
1667 },
1668
82a56f0d
LC
1669SQMP
1670query-block
1671-----------
1672
1673Show the block devices.
1674
1675Each block device information is stored in a json-object and the returned value
1676is a json-array of all devices.
1677
1678Each json-object contain the following:
1679
1680- "device": device name (json-string)
1681- "type": device type (json-string)
d8aeeb31
MA
1682 - deprecated, retained for backward compatibility
1683 - Possible values: "unknown"
82a56f0d
LC
1684- "removable": true if the device is removable, false otherwise (json-bool)
1685- "locked": true if the device is locked, false otherwise (json-bool)
99f42808 1686- "tray_open": only present if removable, true if the device has a tray,
e4def80b 1687 and it is open (json-bool)
82a56f0d
LC
1688- "inserted": only present if the device is inserted, it is a json-object
1689 containing the following:
1690 - "file": device file name (json-string)
1691 - "ro": true if read-only, false otherwise (json-bool)
1692 - "drv": driver format name (json-string)
1693 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1694 "file", "file", "ftp", "ftps", "host_cdrom",
1695 "host_device", "host_floppy", "http", "https",
1696 "nbd", "parallels", "qcow", "qcow2", "raw",
1697 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1698 - "backing_file": backing file name (json-string, optional)
2e3e3317 1699 - "backing_file_depth": number of files in the backing file chain (json-int)
82a56f0d 1700 - "encrypted": true if encrypted, false otherwise (json-bool)
727f005e
ZYW
1701 - "bps": limit total bytes per second (json-int)
1702 - "bps_rd": limit read bytes per second (json-int)
1703 - "bps_wr": limit write bytes per second (json-int)
1704 - "iops": limit total I/O operations per second (json-int)
1705 - "iops_rd": limit read operations per second (json-int)
1706 - "iops_wr": limit write operations per second (json-int)
1707
f04ef601
LC
1708- "io-status": I/O operation status, only present if the device supports it
1709 and the VM is configured to stop on errors. It's always reset
1710 to "ok" when the "cont" command is issued (json_string, optional)
1711 - Possible values: "ok", "failed", "nospace"
82a56f0d
LC
1712
1713Example:
1714
1715-> { "execute": "query-block" }
1716<- {
1717 "return":[
1718 {
f04ef601 1719 "io-status": "ok",
82a56f0d
LC
1720 "device":"ide0-hd0",
1721 "locked":false,
1722 "removable":false,
1723 "inserted":{
1724 "ro":false,
1725 "drv":"qcow2",
1726 "encrypted":false,
727f005e 1727 "file":"disks/test.img",
2e3e3317 1728 "backing_file_depth":0,
727f005e
ZYW
1729 "bps":1000000,
1730 "bps_rd":0,
1731 "bps_wr":0,
1732 "iops":1000000,
1733 "iops_rd":0,
1734 "iops_wr":0,
82a56f0d 1735 },
d8aeeb31 1736 "type":"unknown"
82a56f0d
LC
1737 },
1738 {
f04ef601 1739 "io-status": "ok",
82a56f0d
LC
1740 "device":"ide1-cd0",
1741 "locked":false,
1742 "removable":true,
d8aeeb31 1743 "type":"unknown"
82a56f0d
LC
1744 },
1745 {
1746 "device":"floppy0",
1747 "locked":false,
1748 "removable":true,
d8aeeb31 1749 "type":"unknown"
82a56f0d
LC
1750 },
1751 {
1752 "device":"sd0",
1753 "locked":false,
1754 "removable":true,
d8aeeb31 1755 "type":"unknown"
82a56f0d
LC
1756 }
1757 ]
1758 }
1759
1760EQMP
1761
b2023818
LC
1762 {
1763 .name = "query-block",
1764 .args_type = "",
1765 .mhandler.cmd_new = qmp_marshal_input_query_block,
1766 },
1767
82a56f0d
LC
1768SQMP
1769query-blockstats
1770----------------
1771
1772Show block device statistics.
1773
1774Each device statistic information is stored in a json-object and the returned
1775value is a json-array of all devices.
1776
1777Each json-object contain the following:
1778
1779- "device": device name (json-string)
1780- "stats": A json-object with the statistics information, it contains:
1781 - "rd_bytes": bytes read (json-int)
1782 - "wr_bytes": bytes written (json-int)
1783 - "rd_operations": read operations (json-int)
1784 - "wr_operations": write operations (json-int)
e8045d67 1785 - "flush_operations": cache flush operations (json-int)
c488c7f6
CH
1786 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1787 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1788 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
82a56f0d
LC
1789 - "wr_highest_offset": Highest offset of a sector written since the
1790 BlockDriverState has been opened (json-int)
1791- "parent": Contains recursively the statistics of the underlying
1792 protocol (e.g. the host file for a qcow2 image). If there is
1793 no underlying protocol, this field is omitted
1794 (json-object, optional)
1795
1796Example:
1797
1798-> { "execute": "query-blockstats" }
1799<- {
1800 "return":[
1801 {
1802 "device":"ide0-hd0",
1803 "parent":{
1804 "stats":{
1805 "wr_highest_offset":3686448128,
1806 "wr_bytes":9786368,
1807 "wr_operations":751,
1808 "rd_bytes":122567168,
1809 "rd_operations":36772
c488c7f6
CH
1810 "wr_total_times_ns":313253456
1811 "rd_total_times_ns":3465673657
1812 "flush_total_times_ns":49653
e8045d67 1813 "flush_operations":61,
82a56f0d
LC
1814 }
1815 },
1816 "stats":{
1817 "wr_highest_offset":2821110784,
1818 "wr_bytes":9786368,
1819 "wr_operations":692,
1820 "rd_bytes":122739200,
1821 "rd_operations":36604
e8045d67 1822 "flush_operations":51,
c488c7f6
CH
1823 "wr_total_times_ns":313253456
1824 "rd_total_times_ns":3465673657
1825 "flush_total_times_ns":49653
82a56f0d
LC
1826 }
1827 },
1828 {
1829 "device":"ide1-cd0",
1830 "stats":{
1831 "wr_highest_offset":0,
1832 "wr_bytes":0,
1833 "wr_operations":0,
1834 "rd_bytes":0,
1835 "rd_operations":0
e8045d67 1836 "flush_operations":0,
c488c7f6
CH
1837 "wr_total_times_ns":0
1838 "rd_total_times_ns":0
1839 "flush_total_times_ns":0
82a56f0d
LC
1840 }
1841 },
1842 {
1843 "device":"floppy0",
1844 "stats":{
1845 "wr_highest_offset":0,
1846 "wr_bytes":0,
1847 "wr_operations":0,
1848 "rd_bytes":0,
1849 "rd_operations":0
e8045d67 1850 "flush_operations":0,
c488c7f6
CH
1851 "wr_total_times_ns":0
1852 "rd_total_times_ns":0
1853 "flush_total_times_ns":0
82a56f0d
LC
1854 }
1855 },
1856 {
1857 "device":"sd0",
1858 "stats":{
1859 "wr_highest_offset":0,
1860 "wr_bytes":0,
1861 "wr_operations":0,
1862 "rd_bytes":0,
1863 "rd_operations":0
e8045d67 1864 "flush_operations":0,
c488c7f6
CH
1865 "wr_total_times_ns":0
1866 "rd_total_times_ns":0
1867 "flush_total_times_ns":0
82a56f0d
LC
1868 }
1869 }
1870 ]
1871 }
1872
1873EQMP
1874
f11f57e4
LC
1875 {
1876 .name = "query-blockstats",
1877 .args_type = "",
1878 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
1879 },
1880
82a56f0d
LC
1881SQMP
1882query-cpus
1883----------
1884
1885Show CPU information.
1886
1887Return a json-array. Each CPU is represented by a json-object, which contains:
1888
1889- "CPU": CPU index (json-int)
1890- "current": true if this is the current CPU, false otherwise (json-bool)
1891- "halted": true if the cpu is halted, false otherwise (json-bool)
1892- Current program counter. The key's name depends on the architecture:
1893 "pc": i386/x86_64 (json-int)
1894 "nip": PPC (json-int)
1895 "pc" and "npc": sparc (json-int)
1896 "PC": mips (json-int)
dc7a09cf 1897- "thread_id": ID of the underlying host thread (json-int)
82a56f0d
LC
1898
1899Example:
1900
1901-> { "execute": "query-cpus" }
1902<- {
1903 "return":[
1904 {
1905 "CPU":0,
1906 "current":true,
1907 "halted":false,
1908 "pc":3227107138
dc7a09cf 1909 "thread_id":3134
82a56f0d
LC
1910 },
1911 {
1912 "CPU":1,
1913 "current":false,
1914 "halted":true,
1915 "pc":7108165
dc7a09cf 1916 "thread_id":3135
82a56f0d
LC
1917 }
1918 ]
1919 }
1920
1921EQMP
1922
de0b36b6
LC
1923 {
1924 .name = "query-cpus",
1925 .args_type = "",
1926 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
1927 },
1928
82a56f0d
LC
1929SQMP
1930query-pci
1931---------
1932
1933PCI buses and devices information.
1934
1935The returned value is a json-array of all buses. Each bus is represented by
1936a json-object, which has a key with a json-array of all PCI devices attached
1937to it. Each device is represented by a json-object.
1938
1939The bus json-object contains the following:
1940
1941- "bus": bus number (json-int)
1942- "devices": a json-array of json-objects, each json-object represents a
1943 PCI device
1944
1945The PCI device json-object contains the following:
1946
1947- "bus": identical to the parent's bus number (json-int)
1948- "slot": slot number (json-int)
1949- "function": function number (json-int)
1950- "class_info": a json-object containing:
1951 - "desc": device class description (json-string, optional)
1952 - "class": device class number (json-int)
1953- "id": a json-object containing:
1954 - "device": device ID (json-int)
1955 - "vendor": vendor ID (json-int)
1956- "irq": device's IRQ if assigned (json-int, optional)
1957- "qdev_id": qdev id string (json-string)
1958- "pci_bridge": It's a json-object, only present if this device is a
1959 PCI bridge, contains:
1960 - "bus": bus number (json-int)
1961 - "secondary": secondary bus number (json-int)
1962 - "subordinate": subordinate bus number (json-int)
1963 - "io_range": I/O memory range information, a json-object with the
1964 following members:
1965 - "base": base address, in bytes (json-int)
1966 - "limit": limit address, in bytes (json-int)
1967 - "memory_range": memory range information, a json-object with the
1968 following members:
1969 - "base": base address, in bytes (json-int)
1970 - "limit": limit address, in bytes (json-int)
1971 - "prefetchable_range": Prefetchable memory range information, a
1972 json-object with the following members:
1973 - "base": base address, in bytes (json-int)
1974 - "limit": limit address, in bytes (json-int)
1975 - "devices": a json-array of PCI devices if there's any attached, each
1976 each element is represented by a json-object, which contains
1977 the same members of the 'PCI device json-object' described
1978 above (optional)
1979- "regions": a json-array of json-objects, each json-object represents a
1980 memory region of this device
1981
1982The memory range json-object contains the following:
1983
1984- "base": base memory address (json-int)
1985- "limit": limit value (json-int)
1986
1987The region json-object can be an I/O region or a memory region, an I/O region
1988json-object contains the following:
1989
1990- "type": "io" (json-string, fixed)
1991- "bar": BAR number (json-int)
1992- "address": memory address (json-int)
1993- "size": memory size (json-int)
1994
1995A memory region json-object contains the following:
1996
1997- "type": "memory" (json-string, fixed)
1998- "bar": BAR number (json-int)
1999- "address": memory address (json-int)
2000- "size": memory size (json-int)
2001- "mem_type_64": true or false (json-bool)
2002- "prefetch": true or false (json-bool)
2003
2004Example:
2005
2006-> { "execute": "query-pci" }
2007<- {
2008 "return":[
2009 {
2010 "bus":0,
2011 "devices":[
2012 {
2013 "bus":0,
2014 "qdev_id":"",
2015 "slot":0,
2016 "class_info":{
2017 "class":1536,
2018 "desc":"Host bridge"
2019 },
2020 "id":{
2021 "device":32902,
2022 "vendor":4663
2023 },
2024 "function":0,
2025 "regions":[
2026
2027 ]
2028 },
2029 {
2030 "bus":0,
2031 "qdev_id":"",
2032 "slot":1,
2033 "class_info":{
2034 "class":1537,
2035 "desc":"ISA bridge"
2036 },
2037 "id":{
2038 "device":32902,
2039 "vendor":28672
2040 },
2041 "function":0,
2042 "regions":[
2043
2044 ]
2045 },
2046 {
2047 "bus":0,
2048 "qdev_id":"",
2049 "slot":1,
2050 "class_info":{
2051 "class":257,
2052 "desc":"IDE controller"
2053 },
2054 "id":{
2055 "device":32902,
2056 "vendor":28688
2057 },
2058 "function":1,
2059 "regions":[
2060 {
2061 "bar":4,
2062 "size":16,
2063 "address":49152,
2064 "type":"io"
2065 }
2066 ]
2067 },
2068 {
2069 "bus":0,
2070 "qdev_id":"",
2071 "slot":2,
2072 "class_info":{
2073 "class":768,
2074 "desc":"VGA controller"
2075 },
2076 "id":{
2077 "device":4115,
2078 "vendor":184
2079 },
2080 "function":0,
2081 "regions":[
2082 {
2083 "prefetch":true,
2084 "mem_type_64":false,
2085 "bar":0,
2086 "size":33554432,
2087 "address":4026531840,
2088 "type":"memory"
2089 },
2090 {
2091 "prefetch":false,
2092 "mem_type_64":false,
2093 "bar":1,
2094 "size":4096,
2095 "address":4060086272,
2096 "type":"memory"
2097 },
2098 {
2099 "prefetch":false,
2100 "mem_type_64":false,
2101 "bar":6,
2102 "size":65536,
2103 "address":-1,
2104 "type":"memory"
2105 }
2106 ]
2107 },
2108 {
2109 "bus":0,
2110 "qdev_id":"",
2111 "irq":11,
2112 "slot":4,
2113 "class_info":{
2114 "class":1280,
2115 "desc":"RAM controller"
2116 },
2117 "id":{
2118 "device":6900,
2119 "vendor":4098
2120 },
2121 "function":0,
2122 "regions":[
2123 {
2124 "bar":0,
2125 "size":32,
2126 "address":49280,
2127 "type":"io"
2128 }
2129 ]
2130 }
2131 ]
2132 }
2133 ]
2134 }
2135
2136Note: This example has been shortened as the real response is too long.
2137
2138EQMP
2139
79627472
LC
2140 {
2141 .name = "query-pci",
2142 .args_type = "",
2143 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2144 },
2145
82a56f0d
LC
2146SQMP
2147query-kvm
2148---------
2149
2150Show KVM information.
2151
2152Return a json-object with the following information:
2153
2154- "enabled": true if KVM support is enabled, false otherwise (json-bool)
2155- "present": true if QEMU has KVM support, false otherwise (json-bool)
2156
2157Example:
2158
2159-> { "execute": "query-kvm" }
2160<- { "return": { "enabled": true, "present": true } }
2161
2162EQMP
2163
292a2602
LC
2164 {
2165 .name = "query-kvm",
2166 .args_type = "",
2167 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2168 },
2169
82a56f0d
LC
2170SQMP
2171query-status
2172------------
2173
2174Return a json-object with the following information:
2175
2176- "running": true if the VM is running, or false if it is paused (json-bool)
2177- "singlestep": true if the VM is in single step mode,
2178 false otherwise (json-bool)
9e37b9dc
LC
2179- "status": one of the following values (json-string)
2180 "debug" - QEMU is running on a debugger
2181 "inmigrate" - guest is paused waiting for an incoming migration
2182 "internal-error" - An internal error that prevents further guest
2183 execution has occurred
2184 "io-error" - the last IOP has failed and the device is configured
2185 to pause on I/O errors
2186 "paused" - guest has been paused via the 'stop' command
2187 "postmigrate" - guest is paused following a successful 'migrate'
2188 "prelaunch" - QEMU was started with -S and guest has not started
2189 "finish-migrate" - guest is paused to finish the migration process
2190 "restore-vm" - guest is paused to restore VM state
2191 "running" - guest is actively running
2192 "save-vm" - guest is paused to save the VM state
2193 "shutdown" - guest is shut down (and -no-shutdown is in use)
2194 "watchdog" - the watchdog action is configured to pause and
2195 has been triggered
82a56f0d
LC
2196
2197Example:
2198
2199-> { "execute": "query-status" }
9e37b9dc 2200<- { "return": { "running": true, "singlestep": false, "status": "running" } }
82a56f0d
LC
2201
2202EQMP
1fa9a5e4
LC
2203
2204 {
2205 .name = "query-status",
2206 .args_type = "",
2207 .mhandler.cmd_new = qmp_marshal_input_query_status,
2208 },
82a56f0d
LC
2209
2210SQMP
2211query-mice
2212----------
2213
2214Show VM mice information.
2215
2216Each mouse is represented by a json-object, the returned value is a json-array
2217of all mice.
2218
2219The mouse json-object contains the following:
2220
2221- "name": mouse's name (json-string)
2222- "index": mouse's index (json-int)
2223- "current": true if this mouse is receiving events, false otherwise (json-bool)
2224- "absolute": true if the mouse generates absolute input events (json-bool)
2225
2226Example:
2227
2228-> { "execute": "query-mice" }
2229<- {
2230 "return":[
2231 {
2232 "name":"QEMU Microsoft Mouse",
2233 "index":0,
2234 "current":false,
2235 "absolute":false
2236 },
2237 {
2238 "name":"QEMU PS/2 Mouse",
2239 "index":1,
2240 "current":true,
2241 "absolute":true
2242 }
2243 ]
2244 }
2245
2246EQMP
2247
e235cec3
LC
2248 {
2249 .name = "query-mice",
2250 .args_type = "",
2251 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2252 },
2253
82a56f0d
LC
2254SQMP
2255query-vnc
2256---------
2257
2258Show VNC server information.
2259
2260Return a json-object with server information. Connected clients are returned
2261as a json-array of json-objects.
2262
2263The main json-object contains the following:
2264
2265- "enabled": true or false (json-bool)
2266- "host": server's IP address (json-string)
2267- "family": address family (json-string)
2268 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2269- "service": server's port number (json-string)
2270- "auth": authentication method (json-string)
2271 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2272 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2273 "vencrypt+plain", "vencrypt+tls+none",
2274 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2275 "vencrypt+tls+vnc", "vencrypt+x509+none",
2276 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2277 "vencrypt+x509+vnc", "vnc"
2278- "clients": a json-array of all connected clients
2279
2280Clients are described by a json-object, each one contain the following:
2281
2282- "host": client's IP address (json-string)
2283- "family": address family (json-string)
2284 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2285- "service": client's port number (json-string)
2286- "x509_dname": TLS dname (json-string, optional)
2287- "sasl_username": SASL username (json-string, optional)
2288
2289Example:
2290
2291-> { "execute": "query-vnc" }
2292<- {
2293 "return":{
2294 "enabled":true,
2295 "host":"0.0.0.0",
2296 "service":"50402",
2297 "auth":"vnc",
2298 "family":"ipv4",
2299 "clients":[
2300 {
2301 "host":"127.0.0.1",
2302 "service":"50401",
2303 "family":"ipv4"
2304 }
2305 ]
2306 }
2307 }
2308
2309EQMP
2310
2b54aa87
LC
2311 {
2312 .name = "query-vnc",
2313 .args_type = "",
2314 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
2315 },
2316
cb42a870
GH
2317SQMP
2318query-spice
2319-----------
2320
2321Show SPICE server information.
2322
2323Return a json-object with server information. Connected clients are returned
2324as a json-array of json-objects.
2325
2326The main json-object contains the following:
2327
2328- "enabled": true or false (json-bool)
2329- "host": server's IP address (json-string)
2330- "port": server's port number (json-int, optional)
2331- "tls-port": server's port number (json-int, optional)
2332- "auth": authentication method (json-string)
2333 - Possible values: "none", "spice"
2334- "channels": a json-array of all active channels clients
2335
2336Channels are described by a json-object, each one contain the following:
2337
2338- "host": client's IP address (json-string)
2339- "family": address family (json-string)
2340 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2341- "port": client's port number (json-string)
2342- "connection-id": spice connection id. All channels with the same id
2343 belong to the same spice session (json-int)
2344- "channel-type": channel type. "1" is the main control channel, filter for
2345 this one if you want track spice sessions only (json-int)
2346- "channel-id": channel id. Usually "0", might be different needed when
2347 multiple channels of the same type exist, such as multiple
2348 display channels in a multihead setup (json-int)
2349- "tls": whevener the channel is encrypted (json-bool)
2350
2351Example:
2352
2353-> { "execute": "query-spice" }
2354<- {
2355 "return": {
2356 "enabled": true,
2357 "auth": "spice",
2358 "port": 5920,
2359 "tls-port": 5921,
2360 "host": "0.0.0.0",
2361 "channels": [
2362 {
2363 "port": "54924",
2364 "family": "ipv4",
2365 "channel-type": 1,
2366 "connection-id": 1804289383,
2367 "host": "127.0.0.1",
2368 "channel-id": 0,
2369 "tls": true
2370 },
2371 {
2372 "port": "36710",
2373 "family": "ipv4",
2374 "channel-type": 4,
2375 "connection-id": 1804289383,
2376 "host": "127.0.0.1",
2377 "channel-id": 0,
2378 "tls": false
2379 },
2380 [ ... more channels follow ... ]
2381 ]
2382 }
2383 }
2384
2385EQMP
2386
d1f29646
LC
2387#if defined(CONFIG_SPICE)
2388 {
2389 .name = "query-spice",
2390 .args_type = "",
2391 .mhandler.cmd_new = qmp_marshal_input_query_spice,
2392 },
2393#endif
2394
82a56f0d
LC
2395SQMP
2396query-name
2397----------
2398
2399Show VM name.
2400
2401Return a json-object with the following information:
2402
2403- "name": VM's name (json-string, optional)
2404
2405Example:
2406
2407-> { "execute": "query-name" }
2408<- { "return": { "name": "qemu-name" } }
2409
2410EQMP
2411
48a32bed
AL
2412 {
2413 .name = "query-name",
2414 .args_type = "",
2415 .mhandler.cmd_new = qmp_marshal_input_query_name,
2416 },
2417
82a56f0d
LC
2418SQMP
2419query-uuid
2420----------
2421
2422Show VM UUID.
2423
2424Return a json-object with the following information:
2425
2426- "UUID": Universally Unique Identifier (json-string)
2427
2428Example:
2429
2430-> { "execute": "query-uuid" }
2431<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2432
2433EQMP
2434
efab767e
LC
2435 {
2436 .name = "query-uuid",
2437 .args_type = "",
2438 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
2439 },
2440
1f8f987d
AK
2441SQMP
2442query-command-line-options
2443--------------------------
2444
2445Show command line option schema.
2446
2447Return a json-array of command line option schema for all options (or for
2448the given option), returning an error if the given option doesn't exist.
2449
2450Each array entry contains the following:
2451
2452- "option": option name (json-string)
2453- "parameters": a json-array describes all parameters of the option:
2454 - "name": parameter name (json-string)
2455 - "type": parameter type (one of 'string', 'boolean', 'number',
2456 or 'size')
2457 - "help": human readable description of the parameter
2458 (json-string, optional)
2459
2460Example:
2461
2462-> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
2463<- { "return": [
2464 {
2465 "parameters": [
2466 {
2467 "name": "romfile",
2468 "type": "string"
2469 },
2470 {
2471 "name": "bootindex",
2472 "type": "number"
2473 }
2474 ],
2475 "option": "option-rom"
2476 }
2477 ]
2478 }
2479
2480EQMP
2481
2482 {
2483 .name = "query-command-line-options",
2484 .args_type = "option:s?",
2485 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
2486 },
2487
82a56f0d
LC
2488SQMP
2489query-migrate
2490-------------
2491
2492Migration status.
2493
2494Return a json-object. If migration is active there will be another json-object
2495with RAM migration status and if block migration is active another one with
2496block migration status.
2497
2498The main json-object contains the following:
2499
2500- "status": migration status (json-string)
2501 - Possible values: "active", "completed", "failed", "cancelled"
7aa939af
JQ
2502- "total-time": total amount of ms since migration started. If
2503 migration has ended, it returns the total migration
817c6045 2504 time (json-int)
9c5a9fcf
JQ
2505- "downtime": only present when migration has finished correctly
2506 total amount in ms for downtime that happened (json-int)
2c52ddf1
JQ
2507- "expected-downtime": only present while migration is active
2508 total amount in ms for downtime that was calculated on
817c6045 2509 the last bitmap round (json-int)
82a56f0d 2510- "ram": only present if "status" is "active", it is a json-object with the
817c6045
JQ
2511 following RAM information:
2512 - "transferred": amount transferred in bytes (json-int)
2513 - "remaining": amount remaining to transfer in bytes (json-int)
2514 - "total": total amount of memory in bytes (json-int)
2515 - "duplicate": number of pages filled entirely with the same
2516 byte (json-int)
2517 These are sent over the wire much more efficiently.
f1c72795 2518 - "skipped": number of skipped zero pages (json-int)
805a2505 2519 - "normal" : number of whole pages transferred. I.e. they
817c6045
JQ
2520 were not sent as duplicate or xbzrle pages (json-int)
2521 - "normal-bytes" : number of bytes transferred in whole
2522 pages. This is just normal pages times size of one page,
2523 but this way upper levels don't need to care about page
2524 size (json-int)
82a56f0d 2525- "disk": only present if "status" is "active" and it is a block migration,
817c6045
JQ
2526 it is a json-object with the following disk information:
2527 - "transferred": amount transferred in bytes (json-int)
2528 - "remaining": amount remaining to transfer in bytes json-int)
2529 - "total": total disk size in bytes (json-int)
f36d55af
OW
2530- "xbzrle-cache": only present if XBZRLE is active.
2531 It is a json-object with the following XBZRLE information:
817c6045
JQ
2532 - "cache-size": XBZRLE cache size in bytes
2533 - "bytes": number of bytes transferred for XBZRLE compressed pages
f36d55af 2534 - "pages": number of XBZRLE compressed pages
817c6045
JQ
2535 - "cache-miss": number of XBRZRLE page cache misses
2536 - "overflow": number of times XBZRLE overflows. This means
2537 that the XBZRLE encoding was bigger than just sent the
2538 whole page, and then we sent the whole page instead (as as
2539 normal page).
2540
82a56f0d
LC
2541Examples:
2542
25431. Before the first migration
2544
2545-> { "execute": "query-migrate" }
2546<- { "return": {} }
2547
25482. Migration is done and has succeeded
2549
2550-> { "execute": "query-migrate" }
004d4c10
OW
2551<- { "return": {
2552 "status": "completed",
2553 "ram":{
2554 "transferred":123,
2555 "remaining":123,
2556 "total":246,
2557 "total-time":12345,
9c5a9fcf 2558 "downtime":12345,
004d4c10
OW
2559 "duplicate":123,
2560 "normal":123,
2561 "normal-bytes":123456
2562 }
2563 }
2564 }
82a56f0d
LC
2565
25663. Migration is done and has failed
2567
2568-> { "execute": "query-migrate" }
2569<- { "return": { "status": "failed" } }
2570
25714. Migration is being performed and is not a block migration:
2572
2573-> { "execute": "query-migrate" }
2574<- {
2575 "return":{
2576 "status":"active",
2577 "ram":{
2578 "transferred":123,
2579 "remaining":123,
62d4e3fe 2580 "total":246,
004d4c10 2581 "total-time":12345,
2c52ddf1 2582 "expected-downtime":12345,
004d4c10
OW
2583 "duplicate":123,
2584 "normal":123,
2585 "normal-bytes":123456
82a56f0d
LC
2586 }
2587 }
2588 }
2589
25905. Migration is being performed and is a block migration:
2591
2592-> { "execute": "query-migrate" }
2593<- {
2594 "return":{
2595 "status":"active",
2596 "ram":{
2597 "total":1057024,
2598 "remaining":1053304,
62d4e3fe 2599 "transferred":3720,
004d4c10 2600 "total-time":12345,
2c52ddf1 2601 "expected-downtime":12345,
004d4c10
OW
2602 "duplicate":123,
2603 "normal":123,
2604 "normal-bytes":123456
82a56f0d
LC
2605 },
2606 "disk":{
2607 "total":20971520,
2608 "remaining":20880384,
2609 "transferred":91136
2610 }
2611 }
2612 }
2613
f36d55af
OW
26146. Migration is being performed and XBZRLE is active:
2615
2616-> { "execute": "query-migrate" }
2617<- {
2618 "return":{
2619 "status":"active",
2620 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
2621 "ram":{
2622 "total":1057024,
2623 "remaining":1053304,
2624 "transferred":3720,
2625 "total-time":12345,
2c52ddf1 2626 "expected-downtime":12345,
f36d55af
OW
2627 "duplicate":10,
2628 "normal":3333,
2629 "normal-bytes":3412992
2630 },
2631 "xbzrle-cache":{
2632 "cache-size":67108864,
2633 "bytes":20971520,
2634 "pages":2444343,
2635 "cache-miss":2244,
2636 "overflow":34434
2637 }
2638 }
2639 }
2640
82a56f0d
LC
2641EQMP
2642
791e7c82
LC
2643 {
2644 .name = "query-migrate",
2645 .args_type = "",
2646 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
2647 },
2648
bbf6da32 2649SQMP
00458433 2650migrate-set-capabilities
817c6045 2651------------------------
00458433
OW
2652
2653Enable/Disable migration capabilities
2654
817c6045 2655- "xbzrle": XBZRLE support
00458433
OW
2656
2657Arguments:
2658
2659Example:
2660
2661-> { "execute": "migrate-set-capabilities" , "arguments":
2662 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
2663
2664EQMP
2665
2666 {
2667 .name = "migrate-set-capabilities",
2668 .args_type = "capabilities:O",
2669 .params = "capability:s,state:b",
2670 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
2671 },
2672SQMP
bbf6da32 2673query-migrate-capabilities
817c6045 2674--------------------------
bbf6da32
OW
2675
2676Query current migration capabilities
2677
2678- "capabilities": migration capabilities state
2679 - "xbzrle" : XBZRLE state (json-bool)
2680
2681Arguments:
2682
2683Example:
2684
2685-> { "execute": "query-migrate-capabilities" }
dbca1b37
OW
2686<- { "return": [ { "state": false, "capability": "xbzrle" } ] }
2687
bbf6da32
OW
2688EQMP
2689
2690 {
2691 .name = "query-migrate-capabilities",
2692 .args_type = "",
2693 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
2694 },
2695
82a56f0d
LC
2696SQMP
2697query-balloon
2698-------------
2699
2700Show balloon information.
2701
2702Make an asynchronous request for balloon info. When the request completes a
2703json-object will be returned containing the following data:
2704
2705- "actual": current balloon value in bytes (json-int)
82a56f0d
LC
2706
2707Example:
2708
2709-> { "execute": "query-balloon" }
2710<- {
2711 "return":{
2712 "actual":1073741824,
82a56f0d
LC
2713 }
2714 }
2715
2716EQMP
2717
96637bcd
LC
2718 {
2719 .name = "query-balloon",
2720 .args_type = "",
2721 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
2722 },
b4b12c62 2723
fb5458cd
SH
2724 {
2725 .name = "query-block-jobs",
2726 .args_type = "",
2727 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
2728 },
2729
b4b12c62
AL
2730 {
2731 .name = "qom-list",
2732 .args_type = "path:s",
2733 .mhandler.cmd_new = qmp_marshal_input_qom_list,
2734 },
eb6e8ea5
AL
2735
2736 {
2737 .name = "qom-set",
b9f8978c 2738 .args_type = "path:s,property:s,value:q",
eb6e8ea5
AL
2739 .mhandler.cmd_new = qmp_qom_set,
2740 },
2741
2742 {
2743 .name = "qom-get",
2744 .args_type = "path:s,property:s",
2745 .mhandler.cmd_new = qmp_qom_get,
2746 },
270b243f 2747
6dd844db
PB
2748 {
2749 .name = "nbd-server-start",
2750 .args_type = "addr:q",
2751 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
2752 },
2753 {
2754 .name = "nbd-server-add",
2755 .args_type = "device:B,writable:b?",
2756 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
2757 },
2758 {
2759 .name = "nbd-server-stop",
2760 .args_type = "",
2761 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
2762 },
2763
270b243f
LC
2764 {
2765 .name = "change-vnc-password",
2766 .args_type = "password:s",
2767 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
2768 },
5eeee3fa
AL
2769 {
2770 .name = "qom-list-types",
2771 .args_type = "implements:s?,abstract:b?",
2772 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
2773 },
1daa31b9
AL
2774
2775 {
2776 .name = "device-list-properties",
2777 .args_type = "typename:s",
2778 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
2779 },
2780
01d3c80d
AL
2781 {
2782 .name = "query-machines",
2783 .args_type = "",
2784 .mhandler.cmd_new = qmp_marshal_input_query_machines,
2785 },
2786
e4e31c63
AL
2787 {
2788 .name = "query-cpu-definitions",
2789 .args_type = "",
2790 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
2791 },
2792
99afc91d
DB
2793 {
2794 .name = "query-target",
2795 .args_type = "",
2796 .mhandler.cmd_new = qmp_marshal_input_query_target,
2797 },
f1a1a356 2798
d1a0cf73
SB
2799 {
2800 .name = "query-tpm",
2801 .args_type = "",
2802 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
2803 },
2804
28c4fa32
CB
2805SQMP
2806query-tpm
2807---------
2808
2809Return information about the TPM device.
2810
2811Arguments: None
2812
2813Example:
2814
2815-> { "execute": "query-tpm" }
2816<- { "return":
2817 [
2818 { "model": "tpm-tis",
2819 "options":
2820 { "type": "passthrough",
2821 "data":
2822 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
2823 "path": "/dev/tpm0"
2824 }
2825 },
2826 "id": "tpm0"
2827 }
2828 ]
2829 }
2830
2831EQMP
2832
d1a0cf73
SB
2833 {
2834 .name = "query-tpm-models",
2835 .args_type = "",
2836 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
2837 },
2838
28c4fa32
CB
2839SQMP
2840query-tpm-models
2841----------------
2842
2843Return a list of supported TPM models.
2844
2845Arguments: None
2846
2847Example:
2848
2849-> { "execute": "query-tpm-models" }
2850<- { "return": [ "tpm-tis" ] }
2851
2852EQMP
2853
d1a0cf73
SB
2854 {
2855 .name = "query-tpm-types",
2856 .args_type = "",
2857 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
2858 },
2859
28c4fa32
CB
2860SQMP
2861query-tpm-types
2862---------------
2863
2864Return a list of supported TPM types.
2865
2866Arguments: None
2867
2868Example:
2869
2870-> { "execute": "query-tpm-types" }
2871<- { "return": [ "passthrough" ] }
2872
2873EQMP
2874
f1a1a356
GH
2875 {
2876 .name = "chardev-add",
2877 .args_type = "id:s,backend:q",
2878 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
2879 },
2880
2881SQMP
2882chardev-add
2883----------------
2884
2885Add a chardev.
2886
2887Arguments:
2888
2889- "id": the chardev's ID, must be unique (json-string)
2890- "backend": chardev backend type + parameters
2891
ffbdbe59 2892Examples:
f1a1a356
GH
2893
2894-> { "execute" : "chardev-add",
2895 "arguments" : { "id" : "foo",
2896 "backend" : { "type" : "null", "data" : {} } } }
2897<- { "return": {} }
2898
ffbdbe59
GH
2899-> { "execute" : "chardev-add",
2900 "arguments" : { "id" : "bar",
2901 "backend" : { "type" : "file",
2902 "data" : { "out" : "/tmp/bar.log" } } } }
2903<- { "return": {} }
2904
0a1a7fab
GH
2905-> { "execute" : "chardev-add",
2906 "arguments" : { "id" : "baz",
2907 "backend" : { "type" : "pty", "data" : {} } } }
2908<- { "return": { "pty" : "/dev/pty/42" } }
2909
f1a1a356
GH
2910EQMP
2911
2912 {
2913 .name = "chardev-remove",
2914 .args_type = "id:s",
2915 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
2916 },
2917
2918
2919SQMP
2920chardev-remove
2921--------------
2922
2923Remove a chardev.
2924
2925Arguments:
2926
2927- "id": the chardev's ID, must exist and not be in use (json-string)
2928
2929Example:
2930
2931-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
2932<- { "return": {} }
2933
2934EQMP