]> git.proxmox.com Git - qemu.git/blame - qmp-commands.hx
Merge remote-tracking branch 'kwolf/for-anthony' into staging
[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
99a9addf
SH
914 {
915 .name = "drive-backup",
b53169ea 916 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
99a9addf
SH
917 "on-source-error:s?,on-target-error:s?",
918 .mhandler.cmd_new = qmp_marshal_input_drive_backup,
919 },
920
921SQMP
922drive-backup
923------------
924
925Start a point-in-time copy of a block device to a new destination. The
926status of ongoing drive-backup operations can be checked with
927query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
928The operation can be stopped before it has completed using the
929block-job-cancel command.
930
931Arguments:
932
933- "device": the name of the device which should be copied.
934 (json-string)
935- "target": the target of the new image. If the file exists, or if it is a
936 device, the existing file/device will be used as the new
937 destination. If it does not exist, a new file will be created.
938 (json-string)
939- "format": the format of the new destination, default is to probe if 'mode' is
940 'existing', else the format of the source
941 (json-string, optional)
b53169ea
SH
942- "sync": what parts of the disk image should be copied to the destination;
943 possibilities include "full" for all the disk, "top" for only the sectors
944 allocated in the topmost image, or "none" to only replicate new I/O
945 (MirrorSyncMode).
99a9addf
SH
946- "mode": whether and how QEMU should create a new image
947 (NewImageMode, optional, default 'absolute-paths')
948- "speed": the maximum speed, in bytes per second (json-int, optional)
949- "on-source-error": the action to take on an error on the source, default
950 'report'. 'stop' and 'enospc' can only be used
951 if the block device supports io-status.
952 (BlockdevOnError, optional)
953- "on-target-error": the action to take on an error on the target, default
954 'report' (no limitations, since this applies to
955 a different block device than device).
956 (BlockdevOnError, optional)
957
958Example:
959-> { "execute": "drive-backup", "arguments": { "device": "drive0",
960 "target": "backup.img" } }
961<- { "return": {} }
962EQMP
963
2d47c6e9 964 {
db58f9c0 965 .name = "block-job-set-speed",
882ec7ce 966 .args_type = "device:B,speed:o",
2d47c6e9
SH
967 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
968 },
969
370521a1 970 {
db58f9c0 971 .name = "block-job-cancel",
6e37fb81 972 .args_type = "device:B,force:b?",
370521a1
SH
973 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
974 },
6e37fb81
PB
975 {
976 .name = "block-job-pause",
977 .args_type = "device:B",
978 .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
979 },
980 {
981 .name = "block-job-resume",
982 .args_type = "device:B",
983 .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
984 },
aeae883b
PB
985 {
986 .name = "block-job-complete",
987 .args_type = "device:B",
988 .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
989 },
c186402c 990 {
52e7c241 991 .name = "transaction",
b9f8978c 992 .args_type = "actions:q",
52e7c241 993 .mhandler.cmd_new = qmp_marshal_input_transaction,
c186402c
JC
994 },
995
996SQMP
52e7c241
PB
997transaction
998-----------
c186402c 999
52e7c241
PB
1000Atomically operate on one or more block devices. The only supported
1001operation for now is snapshotting. If there is any failure performing
1002any of the operations, all snapshots for the group are abandoned, and
1003the original disks pre-snapshot attempt are used.
c186402c 1004
52e7c241
PB
1005A list of dictionaries is accepted, that contains the actions to be performed.
1006For snapshots this is the device, the file to use for the new snapshot,
1007and the format. The default format, if not specified, is qcow2.
c186402c 1008
bc8b094f
PB
1009Each new snapshot defaults to being created by QEMU (wiping any
1010contents if the file already exists), but it is also possible to reuse
1011an externally-created file. In the latter case, you should ensure that
1012the new image file has the same contents as the current one; QEMU cannot
1013perform any meaningful check. Typically this is achieved by using the
1014current image file as the backing file for the new image.
1015
c186402c
JC
1016Arguments:
1017
52e7c241
PB
1018actions array:
1019 - "type": the operation to perform. The only supported
1020 value is "blockdev-snapshot-sync". (json-string)
1021 - "data": a dictionary. The contents depend on the value
1022 of "type". When "type" is "blockdev-snapshot-sync":
1023 - "device": device name to snapshot (json-string)
1024 - "snapshot-file": name of new image file (json-string)
1025 - "format": format of new image (json-string, optional)
bc8b094f
PB
1026 - "mode": whether and how QEMU should create the snapshot file
1027 (NewImageMode, optional, default "absolute-paths")
c186402c
JC
1028
1029Example:
1030
52e7c241
PB
1031-> { "execute": "transaction",
1032 "arguments": { "actions": [
1033 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd0",
1034 "snapshot-file": "/some/place/my-image",
1035 "format": "qcow2" } },
1036 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd1",
1037 "snapshot-file": "/some/place/my-image2",
bc8b094f 1038 "mode": "existing",
52e7c241 1039 "format": "qcow2" } } ] } }
c186402c
JC
1040<- { "return": {} }
1041
1042EQMP
370521a1 1043
d967b2f1
JS
1044 {
1045 .name = "blockdev-snapshot-sync",
31155b9b 1046 .args_type = "device:B,snapshot-file:s,format:s?,mode:s?",
6106e249 1047 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
d967b2f1
JS
1048 },
1049
1050SQMP
1051blockdev-snapshot-sync
1052----------------------
1053
1054Synchronous snapshot of a block device. snapshot-file specifies the
1055target of the new image. If the file exists, or if it is a device, the
1056snapshot will be created in the existing file/device. If does not
1057exist, a new file will be created. format specifies the format of the
1058snapshot image, default is qcow2.
1059
1060Arguments:
1061
1062- "device": device name to snapshot (json-string)
1063- "snapshot-file": name of new image file (json-string)
6cc2a415
PB
1064- "mode": whether and how QEMU should create the snapshot file
1065 (NewImageMode, optional, default "absolute-paths")
d967b2f1
JS
1066- "format": format of new image (json-string, optional)
1067
1068Example:
1069
7f3850c2
LC
1070-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1071 "snapshot-file":
1072 "/some/place/my-image",
1073 "format": "qcow2" } }
d967b2f1
JS
1074<- { "return": {} }
1075
d9b902db
PB
1076EQMP
1077
1078 {
1079 .name = "drive-mirror",
b952b558 1080 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
eee13dfe 1081 "on-source-error:s?,on-target-error:s?,"
08e4ed6c 1082 "granularity:i?,buf-size:i?",
d9b902db
PB
1083 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1084 },
1085
1086SQMP
1087drive-mirror
1088------------
1089
1090Start mirroring a block device's writes to a new destination. target
1091specifies the target of the new image. If the file exists, or if it is
1092a device, it will be used as the new destination for writes. If it does not
1093exist, a new file will be created. format specifies the format of the
1094mirror image, default is to probe if mode='existing', else the format
1095of the source.
1096
1097Arguments:
1098
1099- "device": device name to operate on (json-string)
1100- "target": name of new image file (json-string)
1101- "format": format of new image (json-string, optional)
1102- "mode": how an image file should be created into the target
1103 file/device (NewImageMode, optional, default 'absolute-paths')
1104- "speed": maximum speed of the streaming job, in bytes per second
1105 (json-int)
eee13dfe 1106- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
08e4ed6c
PB
1107- "buf_size": maximum amount of data in flight from source to target, in bytes
1108 (json-int, default 10M)
d9b902db
PB
1109- "sync": what parts of the disk image should be copied to the destination;
1110 possibilities include "full" for all the disk, "top" for only the sectors
1111 allocated in the topmost image, or "none" to only replicate new I/O
1112 (MirrorSyncMode).
b952b558
PB
1113- "on-source-error": the action to take on an error on the source
1114 (BlockdevOnError, default 'report')
1115- "on-target-error": the action to take on an error on the target
1116 (BlockdevOnError, default 'report')
1117
eee13dfe
PB
1118The default value of the granularity is the image cluster size clamped
1119between 4096 and 65536, if the image format defines one. If the format
1120does not define a cluster size, the default value of the granularity
1121is 65536.
d9b902db
PB
1122
1123
1124Example:
1125
1126-> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1127 "target": "/some/place/my-image",
1128 "sync": "full",
1129 "format": "qcow2" } }
1130<- { "return": {} }
1131
82a56f0d
LC
1132EQMP
1133
1134 {
1135 .name = "balloon",
1136 .args_type = "value:M",
d72f3264 1137 .mhandler.cmd_new = qmp_marshal_input_balloon,
82a56f0d
LC
1138 },
1139
1140SQMP
1141balloon
1142-------
1143
1144Request VM to change its memory allocation (in bytes).
1145
1146Arguments:
1147
1148- "value": New memory allocation (json-int)
1149
1150Example:
1151
1152-> { "execute": "balloon", "arguments": { "value": 536870912 } }
1153<- { "return": {} }
1154
1155EQMP
1156
1157 {
1158 .name = "set_link",
1159 .args_type = "name:s,up:b",
4b37156c 1160 .mhandler.cmd_new = qmp_marshal_input_set_link,
82a56f0d
LC
1161 },
1162
1163SQMP
1164set_link
1165--------
1166
1167Change the link status of a network adapter.
1168
1169Arguments:
1170
1171- "name": network device name (json-string)
1172- "up": status is up (json-bool)
1173
1174Example:
1175
1176-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1177<- { "return": {} }
1178
1179EQMP
1180
1181 {
1182 .name = "getfd",
1183 .args_type = "fdname:s",
1184 .params = "getfd name",
1185 .help = "receive a file descriptor via SCM rights and assign it a name",
208c9d1b 1186 .mhandler.cmd_new = qmp_marshal_input_getfd,
82a56f0d
LC
1187 },
1188
1189SQMP
1190getfd
1191-----
1192
1193Receive a file descriptor via SCM rights and assign it a name.
1194
1195Arguments:
1196
1197- "fdname": file descriptor name (json-string)
1198
1199Example:
1200
1201-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1202<- { "return": {} }
1203
208c9d1b
CB
1204Notes:
1205
1206(1) If the name specified by the "fdname" argument already exists,
1207 the file descriptor assigned to it will be closed and replaced
1208 by the received file descriptor.
1209(2) The 'closefd' command can be used to explicitly close the file
1210 descriptor when it is no longer needed.
1211
82a56f0d
LC
1212EQMP
1213
1214 {
1215 .name = "closefd",
1216 .args_type = "fdname:s",
1217 .params = "closefd name",
1218 .help = "close a file descriptor previously passed via SCM rights",
208c9d1b 1219 .mhandler.cmd_new = qmp_marshal_input_closefd,
82a56f0d
LC
1220 },
1221
1222SQMP
1223closefd
1224-------
1225
1226Close a file descriptor previously passed via SCM rights.
1227
1228Arguments:
1229
1230- "fdname": file descriptor name (json-string)
1231
1232Example:
1233
1234-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1235<- { "return": {} }
1236
ba1c048a
CB
1237EQMP
1238
1239 {
1240 .name = "add-fd",
1241 .args_type = "fdset-id:i?,opaque:s?",
1242 .params = "add-fd fdset-id opaque",
1243 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1244 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1245 },
1246
1247SQMP
1248add-fd
1249-------
1250
1251Add a file descriptor, that was passed via SCM rights, to an fd set.
1252
1253Arguments:
1254
1255- "fdset-id": The ID of the fd set to add the file descriptor to.
1256 (json-int, optional)
1257- "opaque": A free-form string that can be used to describe the fd.
1258 (json-string, optional)
1259
1260Return a json-object with the following information:
1261
1262- "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1263- "fd": The file descriptor that was received via SCM rights and added to the
1264 fd set. (json-int)
1265
1266Example:
1267
1268-> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1269<- { "return": { "fdset-id": 1, "fd": 3 } }
1270
1271Notes:
1272
1273(1) The list of fd sets is shared by all monitor connections.
1274(2) If "fdset-id" is not specified, a new fd set will be created.
1275
1276EQMP
1277
1278 {
1279 .name = "remove-fd",
1280 .args_type = "fdset-id:i,fd:i?",
1281 .params = "remove-fd fdset-id fd",
1282 .help = "Remove a file descriptor from an fd set",
1283 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1284 },
1285
1286SQMP
1287remove-fd
1288---------
1289
1290Remove a file descriptor from an fd set.
1291
1292Arguments:
1293
1294- "fdset-id": The ID of the fd set that the file descriptor belongs to.
1295 (json-int)
1296- "fd": The file descriptor that is to be removed. (json-int, optional)
1297
1298Example:
1299
1300-> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1301<- { "return": {} }
1302
1303Notes:
1304
1305(1) The list of fd sets is shared by all monitor connections.
1306(2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1307 removed.
1308
1309EQMP
1310
1311 {
1312 .name = "query-fdsets",
1313 .args_type = "",
1314 .help = "Return information describing all fd sets",
1315 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1316 },
1317
1318SQMP
1319query-fdsets
1320-------------
1321
1322Return information describing all fd sets.
1323
1324Arguments: None
1325
1326Example:
1327
1328-> { "execute": "query-fdsets" }
1329<- { "return": [
1330 {
1331 "fds": [
1332 {
1333 "fd": 30,
1334 "opaque": "rdonly:/path/to/file"
1335 },
1336 {
1337 "fd": 24,
1338 "opaque": "rdwr:/path/to/file"
1339 }
1340 ],
1341 "fdset-id": 1
1342 },
1343 {
1344 "fds": [
1345 {
1346 "fd": 28
1347 },
1348 {
1349 "fd": 29
1350 }
1351 ],
1352 "fdset-id": 0
1353 }
1354 ]
1355 }
1356
1357Note: The list of fd sets is shared by all monitor connections.
1358
82a56f0d
LC
1359EQMP
1360
1361 {
1362 .name = "block_passwd",
1363 .args_type = "device:B,password:s",
a4dea8a9 1364 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
82a56f0d
LC
1365 },
1366
1367SQMP
1368block_passwd
1369------------
1370
1371Set the password of encrypted block devices.
1372
1373Arguments:
1374
1375- "device": device name (json-string)
1376- "password": password (json-string)
1377
1378Example:
1379
1380-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1381 "password": "12345" } }
1382<- { "return": {} }
1383
727f005e
ZYW
1384EQMP
1385
1386 {
1387 .name = "block_set_io_throttle",
1388 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
80047da5 1389 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
727f005e
ZYW
1390 },
1391
1392SQMP
1393block_set_io_throttle
1394------------
1395
1396Change I/O throttle limits for a block drive.
1397
1398Arguments:
1399
1400- "device": device name (json-string)
1401- "bps": total throughput limit in bytes per second(json-int)
1402- "bps_rd": read throughput limit in bytes per second(json-int)
1403- "bps_wr": read throughput limit in bytes per second(json-int)
1404- "iops": total I/O operations per second(json-int)
1405- "iops_rd": read I/O operations per second(json-int)
1406- "iops_wr": write I/O operations per second(json-int)
1407
1408Example:
1409
1410-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1411 "bps": "1000000",
1412 "bps_rd": "0",
1413 "bps_wr": "0",
1414 "iops": "0",
1415 "iops_rd": "0",
1416 "iops_wr": "0" } }
1417<- { "return": {} }
1418
7572150c
GH
1419EQMP
1420
1421 {
1422 .name = "set_password",
1423 .args_type = "protocol:s,password:s,connected:s?",
fbf796fd 1424 .mhandler.cmd_new = qmp_marshal_input_set_password,
7572150c
GH
1425 },
1426
1427SQMP
1428set_password
1429------------
1430
1431Set the password for vnc/spice protocols.
1432
1433Arguments:
1434
1435- "protocol": protocol name (json-string)
1436- "password": password (json-string)
1437- "connected": [ keep | disconnect | fail ] (josn-string, optional)
1438
1439Example:
1440
1441-> { "execute": "set_password", "arguments": { "protocol": "vnc",
1442 "password": "secret" } }
1443<- { "return": {} }
1444
1445EQMP
1446
1447 {
1448 .name = "expire_password",
1449 .args_type = "protocol:s,time:s",
9ad5372d 1450 .mhandler.cmd_new = qmp_marshal_input_expire_password,
7572150c
GH
1451 },
1452
1453SQMP
1454expire_password
1455---------------
1456
1457Set the password expire time for vnc/spice protocols.
1458
1459Arguments:
1460
1461- "protocol": protocol name (json-string)
1462- "time": [ now | never | +secs | secs ] (json-string)
1463
1464Example:
1465
1466-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1467 "time": "+60" } }
1468<- { "return": {} }
1469
82a56f0d
LC
1470EQMP
1471
13661089
DB
1472 {
1473 .name = "add_client",
f1f5f407 1474 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
b224e5e2 1475 .mhandler.cmd_new = qmp_marshal_input_add_client,
13661089
DB
1476 },
1477
1478SQMP
1479add_client
1480----------
1481
1482Add a graphics client
1483
1484Arguments:
1485
1486- "protocol": protocol name (json-string)
1487- "fdname": file descriptor name (json-string)
f1f5f407
DB
1488- "skipauth": whether to skip authentication (json-bool, optional)
1489- "tls": whether to perform TLS (json-bool, optional)
13661089
DB
1490
1491Example:
1492
1493-> { "execute": "add_client", "arguments": { "protocol": "vnc",
1494 "fdname": "myclient" } }
1495<- { "return": {} }
1496
1497EQMP
82a56f0d
LC
1498 {
1499 .name = "qmp_capabilities",
1500 .args_type = "",
1501 .params = "",
1502 .help = "enable QMP capabilities",
1503 .user_print = monitor_user_noop,
1504 .mhandler.cmd_new = do_qmp_capabilities,
1505 },
1506
1507SQMP
1508qmp_capabilities
1509----------------
1510
1511Enable QMP capabilities.
1512
1513Arguments: None.
1514
1515Example:
1516
1517-> { "execute": "qmp_capabilities" }
1518<- { "return": {} }
1519
1520Note: This command must be issued before issuing any other command.
1521
0268d97c
LC
1522EQMP
1523
1524 {
1525 .name = "human-monitor-command",
1526 .args_type = "command-line:s,cpu-index:i?",
d51a67b4 1527 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
0268d97c
LC
1528 },
1529
1530SQMP
1531human-monitor-command
1532---------------------
1533
1534Execute a Human Monitor command.
1535
1536Arguments:
1537
1538- command-line: the command name and its arguments, just like the
1539 Human Monitor's shell (json-string)
1540- cpu-index: select the CPU number to be used by commands which access CPU
1541 data, like 'info registers'. The Monitor selects CPU 0 if this
1542 argument is not provided (json-int, optional)
1543
1544Example:
1545
1546-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1547<- { "return": "kvm support: enabled\r\n" }
1548
1549Notes:
1550
1551(1) The Human Monitor is NOT an stable interface, this means that command
1552 names, arguments and responses can change or be removed at ANY time.
1553 Applications that rely on long term stability guarantees should NOT
1554 use this command
1555
1556(2) Limitations:
1557
1558 o This command is stateless, this means that commands that depend
1559 on state information (such as getfd) might not work
1560
1561 o Commands that prompt the user for data (eg. 'cont' when the block
1562 device is encrypted) don't currently work
1563
82a56f0d
LC
15643. Query Commands
1565=================
1566
1567HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1568HXCOMM this! We will possibly move query commands definitions inside those
1569HXCOMM sections, just like regular commands.
1570
1571EQMP
1572
1573SQMP
1574query-version
1575-------------
1576
1577Show QEMU version.
1578
1579Return a json-object with the following information:
1580
1581- "qemu": A json-object containing three integer values:
1582 - "major": QEMU's major version (json-int)
1583 - "minor": QEMU's minor version (json-int)
1584 - "micro": QEMU's micro version (json-int)
1585- "package": package's version (json-string)
1586
1587Example:
1588
1589-> { "execute": "query-version" }
1590<- {
1591 "return":{
1592 "qemu":{
1593 "major":0,
1594 "minor":11,
1595 "micro":5
1596 },
1597 "package":""
1598 }
1599 }
1600
1601EQMP
1602
b9c15f16
LC
1603 {
1604 .name = "query-version",
1605 .args_type = "",
1606 .mhandler.cmd_new = qmp_marshal_input_query_version,
1607 },
1608
82a56f0d
LC
1609SQMP
1610query-commands
1611--------------
1612
1613List QMP available commands.
1614
1615Each command is represented by a json-object, the returned value is a json-array
1616of all commands.
1617
1618Each json-object contain:
1619
1620- "name": command's name (json-string)
1621
1622Example:
1623
1624-> { "execute": "query-commands" }
1625<- {
1626 "return":[
1627 {
1628 "name":"query-balloon"
1629 },
1630 {
1631 "name":"system_powerdown"
1632 }
1633 ]
1634 }
1635
1636Note: This example has been shortened as the real response is too long.
1637
1638EQMP
1639
aa9b79bc
LC
1640 {
1641 .name = "query-commands",
1642 .args_type = "",
1643 .mhandler.cmd_new = qmp_marshal_input_query_commands,
1644 },
1645
4860853d
DB
1646SQMP
1647query-events
1648--------------
1649
1650List QMP available events.
1651
1652Each event is represented by a json-object, the returned value is a json-array
1653of all events.
1654
1655Each json-object contains:
1656
1657- "name": event's name (json-string)
1658
1659Example:
1660
1661-> { "execute": "query-events" }
1662<- {
1663 "return":[
1664 {
1665 "name":"SHUTDOWN"
1666 },
1667 {
1668 "name":"RESET"
1669 }
1670 ]
1671 }
1672
1673Note: This example has been shortened as the real response is too long.
1674
1675EQMP
1676
1677 {
1678 .name = "query-events",
1679 .args_type = "",
1680 .mhandler.cmd_new = qmp_marshal_input_query_events,
1681 },
1682
82a56f0d
LC
1683SQMP
1684query-chardev
1685-------------
1686
1687Each device is represented by a json-object. The returned value is a json-array
1688of all devices.
1689
1690Each json-object contain the following:
1691
1692- "label": device's label (json-string)
1693- "filename": device's file (json-string)
1694
1695Example:
1696
1697-> { "execute": "query-chardev" }
1698<- {
1699 "return":[
1700 {
1701 "label":"monitor",
1702 "filename":"stdio"
1703 },
1704 {
1705 "label":"serial0",
1706 "filename":"vc"
1707 }
1708 ]
1709 }
1710
1711EQMP
1712
c5a415a0
LC
1713 {
1714 .name = "query-chardev",
1715 .args_type = "",
1716 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
1717 },
1718
82a56f0d
LC
1719SQMP
1720query-block
1721-----------
1722
1723Show the block devices.
1724
1725Each block device information is stored in a json-object and the returned value
1726is a json-array of all devices.
1727
1728Each json-object contain the following:
1729
1730- "device": device name (json-string)
1731- "type": device type (json-string)
d8aeeb31
MA
1732 - deprecated, retained for backward compatibility
1733 - Possible values: "unknown"
82a56f0d
LC
1734- "removable": true if the device is removable, false otherwise (json-bool)
1735- "locked": true if the device is locked, false otherwise (json-bool)
99f42808 1736- "tray_open": only present if removable, true if the device has a tray,
e4def80b 1737 and it is open (json-bool)
82a56f0d
LC
1738- "inserted": only present if the device is inserted, it is a json-object
1739 containing the following:
1740 - "file": device file name (json-string)
1741 - "ro": true if read-only, false otherwise (json-bool)
1742 - "drv": driver format name (json-string)
1743 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1744 "file", "file", "ftp", "ftps", "host_cdrom",
1745 "host_device", "host_floppy", "http", "https",
1746 "nbd", "parallels", "qcow", "qcow2", "raw",
1747 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1748 - "backing_file": backing file name (json-string, optional)
2e3e3317 1749 - "backing_file_depth": number of files in the backing file chain (json-int)
82a56f0d 1750 - "encrypted": true if encrypted, false otherwise (json-bool)
727f005e
ZYW
1751 - "bps": limit total bytes per second (json-int)
1752 - "bps_rd": limit read bytes per second (json-int)
1753 - "bps_wr": limit write bytes per second (json-int)
1754 - "iops": limit total I/O operations per second (json-int)
1755 - "iops_rd": limit read operations per second (json-int)
1756 - "iops_wr": limit write operations per second (json-int)
553a7e87
WX
1757 - "image": the detail of the image, it is a json-object containing
1758 the following:
1759 - "filename": image file name (json-string)
1760 - "format": image format (json-string)
1761 - "virtual-size": image capacity in bytes (json-int)
1762 - "dirty-flag": true if image is not cleanly closed, not present
1763 means clean (json-bool, optional)
1764 - "actual-size": actual size on disk in bytes of the image, not
1765 present when image does not support thin
1766 provision (json-int, optional)
1767 - "cluster-size": size of a cluster in bytes, not present if image
1768 format does not support it (json-int, optional)
1769 - "encrypted": true if the image is encrypted, not present means
1770 false or the image format does not support
1771 encryption (json-bool, optional)
1772 - "backing_file": backing file name, not present means no backing
1773 file is used or the image format does not
1774 support backing file chain
1775 (json-string, optional)
1776 - "full-backing-filename": full path of the backing file, not
1777 present if it equals backing_file or no
1778 backing file is used
1779 (json-string, optional)
1780 - "backing-filename-format": the format of the backing file, not
1781 present means unknown or no backing
1782 file (json-string, optional)
1783 - "snapshots": the internal snapshot info, it is an optional list
1784 of json-object containing the following:
1785 - "id": unique snapshot id (json-string)
1786 - "name": snapshot name (json-string)
1787 - "vm-state-size": size of the VM state in bytes (json-int)
1788 - "date-sec": UTC date of the snapshot in seconds (json-int)
1789 - "date-nsec": fractional part in nanoseconds to be used with
1790 date-sec(json-int)
1791 - "vm-clock-sec": VM clock relative to boot in seconds
1792 (json-int)
1793 - "vm-clock-nsec": fractional part in nanoseconds to be used
1794 with vm-clock-sec (json-int)
1795 - "backing-image": the detail of the backing image, it is an
1796 optional json-object only present when a
1797 backing image present for this image
727f005e 1798
f04ef601
LC
1799- "io-status": I/O operation status, only present if the device supports it
1800 and the VM is configured to stop on errors. It's always reset
1801 to "ok" when the "cont" command is issued (json_string, optional)
1802 - Possible values: "ok", "failed", "nospace"
82a56f0d
LC
1803
1804Example:
1805
1806-> { "execute": "query-block" }
1807<- {
1808 "return":[
1809 {
f04ef601 1810 "io-status": "ok",
82a56f0d
LC
1811 "device":"ide0-hd0",
1812 "locked":false,
1813 "removable":false,
1814 "inserted":{
1815 "ro":false,
1816 "drv":"qcow2",
1817 "encrypted":false,
553a7e87
WX
1818 "file":"disks/test.qcow2",
1819 "backing_file_depth":1,
727f005e
ZYW
1820 "bps":1000000,
1821 "bps_rd":0,
1822 "bps_wr":0,
1823 "iops":1000000,
1824 "iops_rd":0,
1825 "iops_wr":0,
553a7e87
WX
1826 "image":{
1827 "filename":"disks/test.qcow2",
1828 "format":"qcow2",
1829 "virtual-size":2048000,
1830 "backing_file":"base.qcow2",
1831 "full-backing-filename":"disks/base.qcow2",
1832 "backing-filename-format:"qcow2",
1833 "snapshots":[
1834 {
1835 "id": "1",
1836 "name": "snapshot1",
1837 "vm-state-size": 0,
1838 "date-sec": 10000200,
1839 "date-nsec": 12,
1840 "vm-clock-sec": 206,
1841 "vm-clock-nsec": 30
1842 }
1843 ],
1844 "backing-image":{
1845 "filename":"disks/base.qcow2",
1846 "format":"qcow2",
1847 "virtual-size":2048000
1848 }
1849 }
82a56f0d 1850 },
d8aeeb31 1851 "type":"unknown"
82a56f0d
LC
1852 },
1853 {
f04ef601 1854 "io-status": "ok",
82a56f0d
LC
1855 "device":"ide1-cd0",
1856 "locked":false,
1857 "removable":true,
d8aeeb31 1858 "type":"unknown"
82a56f0d
LC
1859 },
1860 {
1861 "device":"floppy0",
1862 "locked":false,
1863 "removable":true,
d8aeeb31 1864 "type":"unknown"
82a56f0d
LC
1865 },
1866 {
1867 "device":"sd0",
1868 "locked":false,
1869 "removable":true,
d8aeeb31 1870 "type":"unknown"
82a56f0d
LC
1871 }
1872 ]
1873 }
1874
1875EQMP
1876
b2023818
LC
1877 {
1878 .name = "query-block",
1879 .args_type = "",
1880 .mhandler.cmd_new = qmp_marshal_input_query_block,
1881 },
1882
82a56f0d
LC
1883SQMP
1884query-blockstats
1885----------------
1886
1887Show block device statistics.
1888
1889Each device statistic information is stored in a json-object and the returned
1890value is a json-array of all devices.
1891
1892Each json-object contain the following:
1893
1894- "device": device name (json-string)
1895- "stats": A json-object with the statistics information, it contains:
1896 - "rd_bytes": bytes read (json-int)
1897 - "wr_bytes": bytes written (json-int)
1898 - "rd_operations": read operations (json-int)
1899 - "wr_operations": write operations (json-int)
e8045d67 1900 - "flush_operations": cache flush operations (json-int)
c488c7f6
CH
1901 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1902 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1903 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
82a56f0d
LC
1904 - "wr_highest_offset": Highest offset of a sector written since the
1905 BlockDriverState has been opened (json-int)
1906- "parent": Contains recursively the statistics of the underlying
1907 protocol (e.g. the host file for a qcow2 image). If there is
1908 no underlying protocol, this field is omitted
1909 (json-object, optional)
1910
1911Example:
1912
1913-> { "execute": "query-blockstats" }
1914<- {
1915 "return":[
1916 {
1917 "device":"ide0-hd0",
1918 "parent":{
1919 "stats":{
1920 "wr_highest_offset":3686448128,
1921 "wr_bytes":9786368,
1922 "wr_operations":751,
1923 "rd_bytes":122567168,
1924 "rd_operations":36772
c488c7f6
CH
1925 "wr_total_times_ns":313253456
1926 "rd_total_times_ns":3465673657
1927 "flush_total_times_ns":49653
e8045d67 1928 "flush_operations":61,
82a56f0d
LC
1929 }
1930 },
1931 "stats":{
1932 "wr_highest_offset":2821110784,
1933 "wr_bytes":9786368,
1934 "wr_operations":692,
1935 "rd_bytes":122739200,
1936 "rd_operations":36604
e8045d67 1937 "flush_operations":51,
c488c7f6
CH
1938 "wr_total_times_ns":313253456
1939 "rd_total_times_ns":3465673657
1940 "flush_total_times_ns":49653
82a56f0d
LC
1941 }
1942 },
1943 {
1944 "device":"ide1-cd0",
1945 "stats":{
1946 "wr_highest_offset":0,
1947 "wr_bytes":0,
1948 "wr_operations":0,
1949 "rd_bytes":0,
1950 "rd_operations":0
e8045d67 1951 "flush_operations":0,
c488c7f6
CH
1952 "wr_total_times_ns":0
1953 "rd_total_times_ns":0
1954 "flush_total_times_ns":0
82a56f0d
LC
1955 }
1956 },
1957 {
1958 "device":"floppy0",
1959 "stats":{
1960 "wr_highest_offset":0,
1961 "wr_bytes":0,
1962 "wr_operations":0,
1963 "rd_bytes":0,
1964 "rd_operations":0
e8045d67 1965 "flush_operations":0,
c488c7f6
CH
1966 "wr_total_times_ns":0
1967 "rd_total_times_ns":0
1968 "flush_total_times_ns":0
82a56f0d
LC
1969 }
1970 },
1971 {
1972 "device":"sd0",
1973 "stats":{
1974 "wr_highest_offset":0,
1975 "wr_bytes":0,
1976 "wr_operations":0,
1977 "rd_bytes":0,
1978 "rd_operations":0
e8045d67 1979 "flush_operations":0,
c488c7f6
CH
1980 "wr_total_times_ns":0
1981 "rd_total_times_ns":0
1982 "flush_total_times_ns":0
82a56f0d
LC
1983 }
1984 }
1985 ]
1986 }
1987
1988EQMP
1989
f11f57e4
LC
1990 {
1991 .name = "query-blockstats",
1992 .args_type = "",
1993 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
1994 },
1995
82a56f0d
LC
1996SQMP
1997query-cpus
1998----------
1999
2000Show CPU information.
2001
2002Return a json-array. Each CPU is represented by a json-object, which contains:
2003
2004- "CPU": CPU index (json-int)
2005- "current": true if this is the current CPU, false otherwise (json-bool)
2006- "halted": true if the cpu is halted, false otherwise (json-bool)
2007- Current program counter. The key's name depends on the architecture:
2008 "pc": i386/x86_64 (json-int)
2009 "nip": PPC (json-int)
2010 "pc" and "npc": sparc (json-int)
2011 "PC": mips (json-int)
dc7a09cf 2012- "thread_id": ID of the underlying host thread (json-int)
82a56f0d
LC
2013
2014Example:
2015
2016-> { "execute": "query-cpus" }
2017<- {
2018 "return":[
2019 {
2020 "CPU":0,
2021 "current":true,
2022 "halted":false,
2023 "pc":3227107138
dc7a09cf 2024 "thread_id":3134
82a56f0d
LC
2025 },
2026 {
2027 "CPU":1,
2028 "current":false,
2029 "halted":true,
2030 "pc":7108165
dc7a09cf 2031 "thread_id":3135
82a56f0d
LC
2032 }
2033 ]
2034 }
2035
2036EQMP
2037
de0b36b6
LC
2038 {
2039 .name = "query-cpus",
2040 .args_type = "",
2041 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
2042 },
2043
82a56f0d
LC
2044SQMP
2045query-pci
2046---------
2047
2048PCI buses and devices information.
2049
2050The returned value is a json-array of all buses. Each bus is represented by
2051a json-object, which has a key with a json-array of all PCI devices attached
2052to it. Each device is represented by a json-object.
2053
2054The bus json-object contains the following:
2055
2056- "bus": bus number (json-int)
2057- "devices": a json-array of json-objects, each json-object represents a
2058 PCI device
2059
2060The PCI device json-object contains the following:
2061
2062- "bus": identical to the parent's bus number (json-int)
2063- "slot": slot number (json-int)
2064- "function": function number (json-int)
2065- "class_info": a json-object containing:
2066 - "desc": device class description (json-string, optional)
2067 - "class": device class number (json-int)
2068- "id": a json-object containing:
2069 - "device": device ID (json-int)
2070 - "vendor": vendor ID (json-int)
2071- "irq": device's IRQ if assigned (json-int, optional)
2072- "qdev_id": qdev id string (json-string)
2073- "pci_bridge": It's a json-object, only present if this device is a
2074 PCI bridge, contains:
2075 - "bus": bus number (json-int)
2076 - "secondary": secondary bus number (json-int)
2077 - "subordinate": subordinate bus number (json-int)
2078 - "io_range": I/O memory range information, a json-object with the
2079 following members:
2080 - "base": base address, in bytes (json-int)
2081 - "limit": limit address, in bytes (json-int)
2082 - "memory_range": memory range information, a json-object with the
2083 following members:
2084 - "base": base address, in bytes (json-int)
2085 - "limit": limit address, in bytes (json-int)
2086 - "prefetchable_range": Prefetchable memory range information, a
2087 json-object with the following members:
2088 - "base": base address, in bytes (json-int)
2089 - "limit": limit address, in bytes (json-int)
2090 - "devices": a json-array of PCI devices if there's any attached, each
2091 each element is represented by a json-object, which contains
2092 the same members of the 'PCI device json-object' described
2093 above (optional)
2094- "regions": a json-array of json-objects, each json-object represents a
2095 memory region of this device
2096
2097The memory range json-object contains the following:
2098
2099- "base": base memory address (json-int)
2100- "limit": limit value (json-int)
2101
2102The region json-object can be an I/O region or a memory region, an I/O region
2103json-object contains the following:
2104
2105- "type": "io" (json-string, fixed)
2106- "bar": BAR number (json-int)
2107- "address": memory address (json-int)
2108- "size": memory size (json-int)
2109
2110A memory region json-object contains the following:
2111
2112- "type": "memory" (json-string, fixed)
2113- "bar": BAR number (json-int)
2114- "address": memory address (json-int)
2115- "size": memory size (json-int)
2116- "mem_type_64": true or false (json-bool)
2117- "prefetch": true or false (json-bool)
2118
2119Example:
2120
2121-> { "execute": "query-pci" }
2122<- {
2123 "return":[
2124 {
2125 "bus":0,
2126 "devices":[
2127 {
2128 "bus":0,
2129 "qdev_id":"",
2130 "slot":0,
2131 "class_info":{
2132 "class":1536,
2133 "desc":"Host bridge"
2134 },
2135 "id":{
2136 "device":32902,
2137 "vendor":4663
2138 },
2139 "function":0,
2140 "regions":[
2141
2142 ]
2143 },
2144 {
2145 "bus":0,
2146 "qdev_id":"",
2147 "slot":1,
2148 "class_info":{
2149 "class":1537,
2150 "desc":"ISA bridge"
2151 },
2152 "id":{
2153 "device":32902,
2154 "vendor":28672
2155 },
2156 "function":0,
2157 "regions":[
2158
2159 ]
2160 },
2161 {
2162 "bus":0,
2163 "qdev_id":"",
2164 "slot":1,
2165 "class_info":{
2166 "class":257,
2167 "desc":"IDE controller"
2168 },
2169 "id":{
2170 "device":32902,
2171 "vendor":28688
2172 },
2173 "function":1,
2174 "regions":[
2175 {
2176 "bar":4,
2177 "size":16,
2178 "address":49152,
2179 "type":"io"
2180 }
2181 ]
2182 },
2183 {
2184 "bus":0,
2185 "qdev_id":"",
2186 "slot":2,
2187 "class_info":{
2188 "class":768,
2189 "desc":"VGA controller"
2190 },
2191 "id":{
2192 "device":4115,
2193 "vendor":184
2194 },
2195 "function":0,
2196 "regions":[
2197 {
2198 "prefetch":true,
2199 "mem_type_64":false,
2200 "bar":0,
2201 "size":33554432,
2202 "address":4026531840,
2203 "type":"memory"
2204 },
2205 {
2206 "prefetch":false,
2207 "mem_type_64":false,
2208 "bar":1,
2209 "size":4096,
2210 "address":4060086272,
2211 "type":"memory"
2212 },
2213 {
2214 "prefetch":false,
2215 "mem_type_64":false,
2216 "bar":6,
2217 "size":65536,
2218 "address":-1,
2219 "type":"memory"
2220 }
2221 ]
2222 },
2223 {
2224 "bus":0,
2225 "qdev_id":"",
2226 "irq":11,
2227 "slot":4,
2228 "class_info":{
2229 "class":1280,
2230 "desc":"RAM controller"
2231 },
2232 "id":{
2233 "device":6900,
2234 "vendor":4098
2235 },
2236 "function":0,
2237 "regions":[
2238 {
2239 "bar":0,
2240 "size":32,
2241 "address":49280,
2242 "type":"io"
2243 }
2244 ]
2245 }
2246 ]
2247 }
2248 ]
2249 }
2250
2251Note: This example has been shortened as the real response is too long.
2252
2253EQMP
2254
79627472
LC
2255 {
2256 .name = "query-pci",
2257 .args_type = "",
2258 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2259 },
2260
82a56f0d
LC
2261SQMP
2262query-kvm
2263---------
2264
2265Show KVM information.
2266
2267Return a json-object with the following information:
2268
2269- "enabled": true if KVM support is enabled, false otherwise (json-bool)
2270- "present": true if QEMU has KVM support, false otherwise (json-bool)
2271
2272Example:
2273
2274-> { "execute": "query-kvm" }
2275<- { "return": { "enabled": true, "present": true } }
2276
2277EQMP
2278
292a2602
LC
2279 {
2280 .name = "query-kvm",
2281 .args_type = "",
2282 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2283 },
2284
82a56f0d
LC
2285SQMP
2286query-status
2287------------
2288
2289Return a json-object with the following information:
2290
2291- "running": true if the VM is running, or false if it is paused (json-bool)
2292- "singlestep": true if the VM is in single step mode,
2293 false otherwise (json-bool)
9e37b9dc
LC
2294- "status": one of the following values (json-string)
2295 "debug" - QEMU is running on a debugger
2296 "inmigrate" - guest is paused waiting for an incoming migration
2297 "internal-error" - An internal error that prevents further guest
2298 execution has occurred
2299 "io-error" - the last IOP has failed and the device is configured
2300 to pause on I/O errors
2301 "paused" - guest has been paused via the 'stop' command
2302 "postmigrate" - guest is paused following a successful 'migrate'
2303 "prelaunch" - QEMU was started with -S and guest has not started
2304 "finish-migrate" - guest is paused to finish the migration process
2305 "restore-vm" - guest is paused to restore VM state
2306 "running" - guest is actively running
2307 "save-vm" - guest is paused to save the VM state
2308 "shutdown" - guest is shut down (and -no-shutdown is in use)
2309 "watchdog" - the watchdog action is configured to pause and
2310 has been triggered
82a56f0d
LC
2311
2312Example:
2313
2314-> { "execute": "query-status" }
9e37b9dc 2315<- { "return": { "running": true, "singlestep": false, "status": "running" } }
82a56f0d
LC
2316
2317EQMP
1fa9a5e4
LC
2318
2319 {
2320 .name = "query-status",
2321 .args_type = "",
2322 .mhandler.cmd_new = qmp_marshal_input_query_status,
2323 },
82a56f0d
LC
2324
2325SQMP
2326query-mice
2327----------
2328
2329Show VM mice information.
2330
2331Each mouse is represented by a json-object, the returned value is a json-array
2332of all mice.
2333
2334The mouse json-object contains the following:
2335
2336- "name": mouse's name (json-string)
2337- "index": mouse's index (json-int)
2338- "current": true if this mouse is receiving events, false otherwise (json-bool)
2339- "absolute": true if the mouse generates absolute input events (json-bool)
2340
2341Example:
2342
2343-> { "execute": "query-mice" }
2344<- {
2345 "return":[
2346 {
2347 "name":"QEMU Microsoft Mouse",
2348 "index":0,
2349 "current":false,
2350 "absolute":false
2351 },
2352 {
2353 "name":"QEMU PS/2 Mouse",
2354 "index":1,
2355 "current":true,
2356 "absolute":true
2357 }
2358 ]
2359 }
2360
2361EQMP
2362
e235cec3
LC
2363 {
2364 .name = "query-mice",
2365 .args_type = "",
2366 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2367 },
2368
82a56f0d
LC
2369SQMP
2370query-vnc
2371---------
2372
2373Show VNC server information.
2374
2375Return a json-object with server information. Connected clients are returned
2376as a json-array of json-objects.
2377
2378The main json-object contains the following:
2379
2380- "enabled": true or false (json-bool)
2381- "host": server's IP address (json-string)
2382- "family": address family (json-string)
2383 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2384- "service": server's port number (json-string)
2385- "auth": authentication method (json-string)
2386 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2387 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2388 "vencrypt+plain", "vencrypt+tls+none",
2389 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2390 "vencrypt+tls+vnc", "vencrypt+x509+none",
2391 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2392 "vencrypt+x509+vnc", "vnc"
2393- "clients": a json-array of all connected clients
2394
2395Clients are described by a json-object, each one contain the following:
2396
2397- "host": client's IP address (json-string)
2398- "family": address family (json-string)
2399 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2400- "service": client's port number (json-string)
2401- "x509_dname": TLS dname (json-string, optional)
2402- "sasl_username": SASL username (json-string, optional)
2403
2404Example:
2405
2406-> { "execute": "query-vnc" }
2407<- {
2408 "return":{
2409 "enabled":true,
2410 "host":"0.0.0.0",
2411 "service":"50402",
2412 "auth":"vnc",
2413 "family":"ipv4",
2414 "clients":[
2415 {
2416 "host":"127.0.0.1",
2417 "service":"50401",
2418 "family":"ipv4"
2419 }
2420 ]
2421 }
2422 }
2423
2424EQMP
2425
2b54aa87
LC
2426 {
2427 .name = "query-vnc",
2428 .args_type = "",
2429 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
2430 },
2431
cb42a870
GH
2432SQMP
2433query-spice
2434-----------
2435
2436Show SPICE server information.
2437
2438Return a json-object with server information. Connected clients are returned
2439as a json-array of json-objects.
2440
2441The main json-object contains the following:
2442
2443- "enabled": true or false (json-bool)
2444- "host": server's IP address (json-string)
2445- "port": server's port number (json-int, optional)
2446- "tls-port": server's port number (json-int, optional)
2447- "auth": authentication method (json-string)
2448 - Possible values: "none", "spice"
2449- "channels": a json-array of all active channels clients
2450
2451Channels are described by a json-object, each one contain the following:
2452
2453- "host": client's IP address (json-string)
2454- "family": address family (json-string)
2455 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2456- "port": client's port number (json-string)
2457- "connection-id": spice connection id. All channels with the same id
2458 belong to the same spice session (json-int)
2459- "channel-type": channel type. "1" is the main control channel, filter for
2460 this one if you want track spice sessions only (json-int)
2461- "channel-id": channel id. Usually "0", might be different needed when
2462 multiple channels of the same type exist, such as multiple
2463 display channels in a multihead setup (json-int)
2464- "tls": whevener the channel is encrypted (json-bool)
2465
2466Example:
2467
2468-> { "execute": "query-spice" }
2469<- {
2470 "return": {
2471 "enabled": true,
2472 "auth": "spice",
2473 "port": 5920,
2474 "tls-port": 5921,
2475 "host": "0.0.0.0",
2476 "channels": [
2477 {
2478 "port": "54924",
2479 "family": "ipv4",
2480 "channel-type": 1,
2481 "connection-id": 1804289383,
2482 "host": "127.0.0.1",
2483 "channel-id": 0,
2484 "tls": true
2485 },
2486 {
2487 "port": "36710",
2488 "family": "ipv4",
2489 "channel-type": 4,
2490 "connection-id": 1804289383,
2491 "host": "127.0.0.1",
2492 "channel-id": 0,
2493 "tls": false
2494 },
2495 [ ... more channels follow ... ]
2496 ]
2497 }
2498 }
2499
2500EQMP
2501
d1f29646
LC
2502#if defined(CONFIG_SPICE)
2503 {
2504 .name = "query-spice",
2505 .args_type = "",
2506 .mhandler.cmd_new = qmp_marshal_input_query_spice,
2507 },
2508#endif
2509
82a56f0d
LC
2510SQMP
2511query-name
2512----------
2513
2514Show VM name.
2515
2516Return a json-object with the following information:
2517
2518- "name": VM's name (json-string, optional)
2519
2520Example:
2521
2522-> { "execute": "query-name" }
2523<- { "return": { "name": "qemu-name" } }
2524
2525EQMP
2526
48a32bed
AL
2527 {
2528 .name = "query-name",
2529 .args_type = "",
2530 .mhandler.cmd_new = qmp_marshal_input_query_name,
2531 },
2532
82a56f0d
LC
2533SQMP
2534query-uuid
2535----------
2536
2537Show VM UUID.
2538
2539Return a json-object with the following information:
2540
2541- "UUID": Universally Unique Identifier (json-string)
2542
2543Example:
2544
2545-> { "execute": "query-uuid" }
2546<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2547
2548EQMP
2549
efab767e
LC
2550 {
2551 .name = "query-uuid",
2552 .args_type = "",
2553 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
2554 },
2555
1f8f987d
AK
2556SQMP
2557query-command-line-options
2558--------------------------
2559
2560Show command line option schema.
2561
2562Return a json-array of command line option schema for all options (or for
2563the given option), returning an error if the given option doesn't exist.
2564
2565Each array entry contains the following:
2566
2567- "option": option name (json-string)
2568- "parameters": a json-array describes all parameters of the option:
2569 - "name": parameter name (json-string)
2570 - "type": parameter type (one of 'string', 'boolean', 'number',
2571 or 'size')
2572 - "help": human readable description of the parameter
2573 (json-string, optional)
2574
2575Example:
2576
2577-> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
2578<- { "return": [
2579 {
2580 "parameters": [
2581 {
2582 "name": "romfile",
2583 "type": "string"
2584 },
2585 {
2586 "name": "bootindex",
2587 "type": "number"
2588 }
2589 ],
2590 "option": "option-rom"
2591 }
2592 ]
2593 }
2594
2595EQMP
2596
2597 {
2598 .name = "query-command-line-options",
2599 .args_type = "option:s?",
2600 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
2601 },
2602
82a56f0d
LC
2603SQMP
2604query-migrate
2605-------------
2606
2607Migration status.
2608
2609Return a json-object. If migration is active there will be another json-object
2610with RAM migration status and if block migration is active another one with
2611block migration status.
2612
2613The main json-object contains the following:
2614
2615- "status": migration status (json-string)
2616 - Possible values: "active", "completed", "failed", "cancelled"
7aa939af
JQ
2617- "total-time": total amount of ms since migration started. If
2618 migration has ended, it returns the total migration
817c6045 2619 time (json-int)
9c5a9fcf
JQ
2620- "downtime": only present when migration has finished correctly
2621 total amount in ms for downtime that happened (json-int)
2c52ddf1
JQ
2622- "expected-downtime": only present while migration is active
2623 total amount in ms for downtime that was calculated on
817c6045 2624 the last bitmap round (json-int)
82a56f0d 2625- "ram": only present if "status" is "active", it is a json-object with the
817c6045
JQ
2626 following RAM information:
2627 - "transferred": amount transferred in bytes (json-int)
2628 - "remaining": amount remaining to transfer in bytes (json-int)
2629 - "total": total amount of memory in bytes (json-int)
2630 - "duplicate": number of pages filled entirely with the same
2631 byte (json-int)
2632 These are sent over the wire much more efficiently.
f1c72795 2633 - "skipped": number of skipped zero pages (json-int)
805a2505 2634 - "normal" : number of whole pages transferred. I.e. they
817c6045
JQ
2635 were not sent as duplicate or xbzrle pages (json-int)
2636 - "normal-bytes" : number of bytes transferred in whole
2637 pages. This is just normal pages times size of one page,
2638 but this way upper levels don't need to care about page
2639 size (json-int)
82a56f0d 2640- "disk": only present if "status" is "active" and it is a block migration,
817c6045
JQ
2641 it is a json-object with the following disk information:
2642 - "transferred": amount transferred in bytes (json-int)
2643 - "remaining": amount remaining to transfer in bytes json-int)
2644 - "total": total disk size in bytes (json-int)
f36d55af
OW
2645- "xbzrle-cache": only present if XBZRLE is active.
2646 It is a json-object with the following XBZRLE information:
817c6045
JQ
2647 - "cache-size": XBZRLE cache size in bytes
2648 - "bytes": number of bytes transferred for XBZRLE compressed pages
f36d55af 2649 - "pages": number of XBZRLE compressed pages
817c6045
JQ
2650 - "cache-miss": number of XBRZRLE page cache misses
2651 - "overflow": number of times XBZRLE overflows. This means
2652 that the XBZRLE encoding was bigger than just sent the
2653 whole page, and then we sent the whole page instead (as as
2654 normal page).
2655
82a56f0d
LC
2656Examples:
2657
26581. Before the first migration
2659
2660-> { "execute": "query-migrate" }
2661<- { "return": {} }
2662
26632. Migration is done and has succeeded
2664
2665-> { "execute": "query-migrate" }
004d4c10
OW
2666<- { "return": {
2667 "status": "completed",
2668 "ram":{
2669 "transferred":123,
2670 "remaining":123,
2671 "total":246,
2672 "total-time":12345,
9c5a9fcf 2673 "downtime":12345,
004d4c10
OW
2674 "duplicate":123,
2675 "normal":123,
2676 "normal-bytes":123456
2677 }
2678 }
2679 }
82a56f0d
LC
2680
26813. Migration is done and has failed
2682
2683-> { "execute": "query-migrate" }
2684<- { "return": { "status": "failed" } }
2685
26864. Migration is being performed and is not a block migration:
2687
2688-> { "execute": "query-migrate" }
2689<- {
2690 "return":{
2691 "status":"active",
2692 "ram":{
2693 "transferred":123,
2694 "remaining":123,
62d4e3fe 2695 "total":246,
004d4c10 2696 "total-time":12345,
2c52ddf1 2697 "expected-downtime":12345,
004d4c10
OW
2698 "duplicate":123,
2699 "normal":123,
2700 "normal-bytes":123456
82a56f0d
LC
2701 }
2702 }
2703 }
2704
27055. Migration is being performed and is a block migration:
2706
2707-> { "execute": "query-migrate" }
2708<- {
2709 "return":{
2710 "status":"active",
2711 "ram":{
2712 "total":1057024,
2713 "remaining":1053304,
62d4e3fe 2714 "transferred":3720,
004d4c10 2715 "total-time":12345,
2c52ddf1 2716 "expected-downtime":12345,
004d4c10
OW
2717 "duplicate":123,
2718 "normal":123,
2719 "normal-bytes":123456
82a56f0d
LC
2720 },
2721 "disk":{
2722 "total":20971520,
2723 "remaining":20880384,
2724 "transferred":91136
2725 }
2726 }
2727 }
2728
f36d55af
OW
27296. Migration is being performed and XBZRLE is active:
2730
2731-> { "execute": "query-migrate" }
2732<- {
2733 "return":{
2734 "status":"active",
2735 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
2736 "ram":{
2737 "total":1057024,
2738 "remaining":1053304,
2739 "transferred":3720,
2740 "total-time":12345,
2c52ddf1 2741 "expected-downtime":12345,
f36d55af
OW
2742 "duplicate":10,
2743 "normal":3333,
2744 "normal-bytes":3412992
2745 },
2746 "xbzrle-cache":{
2747 "cache-size":67108864,
2748 "bytes":20971520,
2749 "pages":2444343,
2750 "cache-miss":2244,
2751 "overflow":34434
2752 }
2753 }
2754 }
2755
82a56f0d
LC
2756EQMP
2757
791e7c82
LC
2758 {
2759 .name = "query-migrate",
2760 .args_type = "",
2761 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
2762 },
2763
bbf6da32 2764SQMP
00458433 2765migrate-set-capabilities
817c6045 2766------------------------
00458433
OW
2767
2768Enable/Disable migration capabilities
2769
817c6045 2770- "xbzrle": XBZRLE support
00458433
OW
2771
2772Arguments:
2773
2774Example:
2775
2776-> { "execute": "migrate-set-capabilities" , "arguments":
2777 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
2778
2779EQMP
2780
2781 {
2782 .name = "migrate-set-capabilities",
2783 .args_type = "capabilities:O",
2784 .params = "capability:s,state:b",
2785 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
2786 },
2787SQMP
bbf6da32 2788query-migrate-capabilities
817c6045 2789--------------------------
bbf6da32
OW
2790
2791Query current migration capabilities
2792
2793- "capabilities": migration capabilities state
2794 - "xbzrle" : XBZRLE state (json-bool)
2795
2796Arguments:
2797
2798Example:
2799
2800-> { "execute": "query-migrate-capabilities" }
dbca1b37
OW
2801<- { "return": [ { "state": false, "capability": "xbzrle" } ] }
2802
bbf6da32
OW
2803EQMP
2804
2805 {
2806 .name = "query-migrate-capabilities",
2807 .args_type = "",
2808 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
2809 },
2810
82a56f0d
LC
2811SQMP
2812query-balloon
2813-------------
2814
2815Show balloon information.
2816
2817Make an asynchronous request for balloon info. When the request completes a
2818json-object will be returned containing the following data:
2819
2820- "actual": current balloon value in bytes (json-int)
82a56f0d
LC
2821
2822Example:
2823
2824-> { "execute": "query-balloon" }
2825<- {
2826 "return":{
2827 "actual":1073741824,
82a56f0d
LC
2828 }
2829 }
2830
2831EQMP
2832
96637bcd
LC
2833 {
2834 .name = "query-balloon",
2835 .args_type = "",
2836 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
2837 },
b4b12c62 2838
fb5458cd
SH
2839 {
2840 .name = "query-block-jobs",
2841 .args_type = "",
2842 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
2843 },
2844
b4b12c62
AL
2845 {
2846 .name = "qom-list",
2847 .args_type = "path:s",
2848 .mhandler.cmd_new = qmp_marshal_input_qom_list,
2849 },
eb6e8ea5
AL
2850
2851 {
2852 .name = "qom-set",
b9f8978c 2853 .args_type = "path:s,property:s,value:q",
eb6e8ea5
AL
2854 .mhandler.cmd_new = qmp_qom_set,
2855 },
2856
2857 {
2858 .name = "qom-get",
2859 .args_type = "path:s,property:s",
2860 .mhandler.cmd_new = qmp_qom_get,
2861 },
270b243f 2862
6dd844db
PB
2863 {
2864 .name = "nbd-server-start",
2865 .args_type = "addr:q",
2866 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
2867 },
2868 {
2869 .name = "nbd-server-add",
2870 .args_type = "device:B,writable:b?",
2871 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
2872 },
2873 {
2874 .name = "nbd-server-stop",
2875 .args_type = "",
2876 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
2877 },
2878
270b243f
LC
2879 {
2880 .name = "change-vnc-password",
2881 .args_type = "password:s",
2882 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
2883 },
5eeee3fa
AL
2884 {
2885 .name = "qom-list-types",
2886 .args_type = "implements:s?,abstract:b?",
2887 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
2888 },
1daa31b9
AL
2889
2890 {
2891 .name = "device-list-properties",
2892 .args_type = "typename:s",
2893 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
2894 },
2895
01d3c80d
AL
2896 {
2897 .name = "query-machines",
2898 .args_type = "",
2899 .mhandler.cmd_new = qmp_marshal_input_query_machines,
2900 },
2901
e4e31c63
AL
2902 {
2903 .name = "query-cpu-definitions",
2904 .args_type = "",
2905 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
2906 },
2907
99afc91d
DB
2908 {
2909 .name = "query-target",
2910 .args_type = "",
2911 .mhandler.cmd_new = qmp_marshal_input_query_target,
2912 },
f1a1a356 2913
d1a0cf73
SB
2914 {
2915 .name = "query-tpm",
2916 .args_type = "",
2917 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
2918 },
2919
28c4fa32
CB
2920SQMP
2921query-tpm
2922---------
2923
2924Return information about the TPM device.
2925
2926Arguments: None
2927
2928Example:
2929
2930-> { "execute": "query-tpm" }
2931<- { "return":
2932 [
2933 { "model": "tpm-tis",
2934 "options":
2935 { "type": "passthrough",
2936 "data":
2937 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
2938 "path": "/dev/tpm0"
2939 }
2940 },
2941 "id": "tpm0"
2942 }
2943 ]
2944 }
2945
2946EQMP
2947
d1a0cf73
SB
2948 {
2949 .name = "query-tpm-models",
2950 .args_type = "",
2951 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
2952 },
2953
28c4fa32
CB
2954SQMP
2955query-tpm-models
2956----------------
2957
2958Return a list of supported TPM models.
2959
2960Arguments: None
2961
2962Example:
2963
2964-> { "execute": "query-tpm-models" }
2965<- { "return": [ "tpm-tis" ] }
2966
2967EQMP
2968
d1a0cf73
SB
2969 {
2970 .name = "query-tpm-types",
2971 .args_type = "",
2972 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
2973 },
2974
28c4fa32
CB
2975SQMP
2976query-tpm-types
2977---------------
2978
2979Return a list of supported TPM types.
2980
2981Arguments: None
2982
2983Example:
2984
2985-> { "execute": "query-tpm-types" }
2986<- { "return": [ "passthrough" ] }
2987
2988EQMP
2989
f1a1a356
GH
2990 {
2991 .name = "chardev-add",
2992 .args_type = "id:s,backend:q",
2993 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
2994 },
2995
2996SQMP
2997chardev-add
2998----------------
2999
3000Add a chardev.
3001
3002Arguments:
3003
3004- "id": the chardev's ID, must be unique (json-string)
3005- "backend": chardev backend type + parameters
3006
ffbdbe59 3007Examples:
f1a1a356
GH
3008
3009-> { "execute" : "chardev-add",
3010 "arguments" : { "id" : "foo",
3011 "backend" : { "type" : "null", "data" : {} } } }
3012<- { "return": {} }
3013
ffbdbe59
GH
3014-> { "execute" : "chardev-add",
3015 "arguments" : { "id" : "bar",
3016 "backend" : { "type" : "file",
3017 "data" : { "out" : "/tmp/bar.log" } } } }
3018<- { "return": {} }
3019
0a1a7fab
GH
3020-> { "execute" : "chardev-add",
3021 "arguments" : { "id" : "baz",
3022 "backend" : { "type" : "pty", "data" : {} } } }
3023<- { "return": { "pty" : "/dev/pty/42" } }
3024
f1a1a356
GH
3025EQMP
3026
3027 {
3028 .name = "chardev-remove",
3029 .args_type = "id:s",
3030 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3031 },
3032
3033
3034SQMP
3035chardev-remove
3036--------------
3037
3038Remove a chardev.
3039
3040Arguments:
3041
3042- "id": the chardev's ID, must exist and not be in use (json-string)
3043
3044Example:
3045
3046-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3047<- { "return": {} }
3048
3049EQMP