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