blob: dbb623677c8767c28e5414592f2c26c0d95f7990 [file] [log] [blame]
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001HXCOMM 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
Zhi Yong Wuc20cdf82011-07-27 14:32:56 +080045 1. The deprecation policy will take effect and be documented soon, please
Luiz Capitulino82a56f02010-09-13 12:26:00 -030046 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 = "",
Luiz Capitulino7a7f3252011-09-15 14:20:28 -030066 .mhandler.cmd_new = qmp_marshal_input_quit,
Luiz Capitulino82a56f02010-09-13 12:26:00 -030067 },
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",
Luiz Capitulinoc245b6a2011-12-07 16:02:36 -020087 .mhandler.cmd_new = qmp_marshal_input_eject,
Luiz Capitulino82a56f02010-09-13 12:26:00 -030088 },
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?",
Luiz Capitulino333a96e2011-12-08 11:13:50 -0200113 .mhandler.cmd_new = qmp_marshal_input_change,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300114 },
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 = "",
Luiz Capitulino5f158f22011-09-15 14:34:39 -0300175 .mhandler.cmd_new = qmp_marshal_input_stop,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300176 },
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 = "",
Luiz Capitulinoe42e8182011-11-22 17:58:31 -0200196 .mhandler.cmd_new = qmp_marshal_input_cont,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300197 },
198
199SQMP
200cont
201----
202
203Resume emulation.
204
205Arguments: None.
206
207Example:
208
209-> { "execute": "cont" }
210<- { "return": {} }
211
212EQMP
213
214 {
Gerd Hoffmann9b9df252012-02-23 13:45:21 +0100215 .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": {} }
232
233EQMP
234
235 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300236 .name = "system_reset",
237 .args_type = "",
Luiz Capitulino38d22652011-09-15 14:41:46 -0300238 .mhandler.cmd_new = qmp_marshal_input_system_reset,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300239 },
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 = "",
Luiz Capitulino22e1bb92011-11-27 22:40:03 -0200259 .mhandler.cmd_new = qmp_marshal_input_system_powerdown,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300260 },
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",
317 .params = "device",
318 .help = "remove device",
319 .user_print = monitor_user_noop,
320 .mhandler.cmd_new = do_device_del,
321 },
322
323SQMP
324device_del
325----------
326
327Remove a device.
328
329Arguments:
330
331- "id": the device's ID (json-string)
332
333Example:
334
335-> { "execute": "device_del", "arguments": { "id": "net1" } }
336<- { "return": {} }
337
338EQMP
339
340 {
341 .name = "cpu",
342 .args_type = "index:i",
Luiz Capitulino755f1962011-10-06 14:31:39 -0300343 .mhandler.cmd_new = qmp_marshal_input_cpu,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300344 },
345
346SQMP
347cpu
348---
349
350Set the default CPU.
351
352Arguments:
353
354- "index": the CPU's index (json-int)
355
356Example:
357
358-> { "execute": "cpu", "arguments": { "index": 0 } }
359<- { "return": {} }
360
361Note: CPUs' indexes are obtained with the 'query-cpus' command.
362
363EQMP
364
365 {
366 .name = "memsave",
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200367 .args_type = "val:l,size:i,filename:s,cpu:i?",
368 .mhandler.cmd_new = qmp_marshal_input_memsave,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300369 },
370
371SQMP
372memsave
373-------
374
375Save to disk virtual memory dump starting at 'val' of size 'size'.
376
377Arguments:
378
379- "val": the starting address (json-int)
380- "size": the memory size, in bytes (json-int)
381- "filename": file path (json-string)
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200382- "cpu": virtual CPU index (json-int, optional)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300383
384Example:
385
386-> { "execute": "memsave",
387 "arguments": { "val": 10,
388 "size": 100,
389 "filename": "/tmp/virtual-mem-dump" } }
390<- { "return": {} }
391
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300392EQMP
393
394 {
395 .name = "pmemsave",
396 .args_type = "val:l,size:i,filename:s",
Luiz Capitulino6d3962b2011-11-22 17:26:46 -0200397 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300398 },
399
400SQMP
401pmemsave
402--------
403
404Save to disk physical memory dump starting at 'val' of size 'size'.
405
406Arguments:
407
408- "val": the starting address (json-int)
409- "size": the memory size, in bytes (json-int)
410- "filename": file path (json-string)
411
412Example:
413
414-> { "execute": "pmemsave",
415 "arguments": { "val": 10,
416 "size": 100,
417 "filename": "/tmp/physical-mem-dump" } }
418<- { "return": {} }
419
420EQMP
421
422 {
Lai Jiangshana4046662011-03-07 17:05:15 +0800423 .name = "inject-nmi",
424 .args_type = "",
Luiz Capitulinoab49ab52011-11-23 12:55:53 -0200425 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
Lai Jiangshana4046662011-03-07 17:05:15 +0800426 },
427
428SQMP
429inject-nmi
430----------
431
432Inject an NMI on guest's CPUs.
433
434Arguments: None.
435
436Example:
437
438-> { "execute": "inject-nmi" }
439<- { "return": {} }
440
441Note: inject-nmi is only supported for x86 guest currently, it will
442 returns "Unsupported" error for non-x86 guest.
443
444EQMP
445
446 {
Stefano Stabellinia7ae8352012-01-25 12:24:51 +0000447 .name = "xen-save-devices-state",
448 .args_type = "filename:F",
449 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
450 },
451
452SQMP
453xen-save-devices-state
454-------
455
456Save the state of all devices to file. The RAM and the block devices
457of the VM are not saved by this command.
458
459Arguments:
460
461- "filename": the file to save the state of the devices to as binary
462data. See xen-save-devices-state.txt for a description of the binary
463format.
464
465Example:
466
467-> { "execute": "xen-save-devices-state",
468 "arguments": { "filename": "/tmp/save" } }
469<- { "return": {} }
470
471EQMP
472
473 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300474 .name = "migrate",
475 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
476 .params = "[-d] [-b] [-i] uri",
477 .help = "migrate to URI (using -d to not wait for completion)"
478 "\n\t\t\t -b for migration without shared storage with"
479 " full copy of disk\n\t\t\t -i for migration without "
480 "shared storage with incremental copy of disk "
481 "(base image shared between src and destination)",
482 .user_print = monitor_user_noop,
483 .mhandler.cmd_new = do_migrate,
484 },
485
486SQMP
487migrate
488-------
489
490Migrate to URI.
491
492Arguments:
493
494- "blk": block migration, full disk copy (json-bool, optional)
495- "inc": incremental disk copy (json-bool, optional)
496- "uri": Destination URI (json-string)
497
498Example:
499
500-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
501<- { "return": {} }
502
503Notes:
504
505(1) The 'query-migrate' command should be used to check migration's progress
506 and final result (this information is provided by the 'status' member)
507(2) All boolean arguments default to false
508(3) The user Monitor's "detach" argument is invalid in QMP and should not
509 be used
510
511EQMP
512
513 {
514 .name = "migrate_cancel",
515 .args_type = "",
Luiz Capitulino6cdedb02011-11-27 22:54:09 -0200516 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300517 },
518
519SQMP
520migrate_cancel
521--------------
522
523Cancel the current migration.
524
525Arguments: None.
526
527Example:
528
529-> { "execute": "migrate_cancel" }
530<- { "return": {} }
531
532EQMP
533
534 {
535 .name = "migrate_set_speed",
Wen Congyang3a019b62010-11-25 09:06:05 +0800536 .args_type = "value:o",
Luiz Capitulino3dc85382011-11-28 11:59:37 -0200537 .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300538 },
539
540SQMP
541migrate_set_speed
542-----------------
543
544Set maximum speed for migrations.
545
546Arguments:
547
Luiz Capitulino5569fd72010-12-15 17:56:18 -0200548- "value": maximum speed, in bytes per second (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300549
550Example:
551
552-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
553<- { "return": {} }
554
555EQMP
556
557 {
558 .name = "migrate_set_downtime",
559 .args_type = "value:T",
Luiz Capitulino4f0a9932011-11-27 23:18:01 -0200560 .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300561 },
562
563SQMP
564migrate_set_downtime
565--------------------
566
567Set maximum tolerated downtime (in seconds) for migrations.
568
569Arguments:
570
571- "value": maximum downtime (json-number)
572
573Example:
574
575-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
576<- { "return": {} }
577
578EQMP
579
580 {
Jes Sorensenff73edf2011-03-09 14:31:06 +0100581 .name = "client_migrate_info",
582 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
583 .params = "protocol hostname port tls-port cert-subject",
584 .help = "send migration info to spice/vnc client",
585 .user_print = monitor_user_noop,
Yonit Halperinedc5cb12011-10-17 10:03:18 +0200586 .mhandler.cmd_async = client_migrate_info,
587 .flags = MONITOR_CMD_ASYNC,
Jes Sorensenff73edf2011-03-09 14:31:06 +0100588 },
589
590SQMP
591client_migrate_info
592------------------
593
594Set the spice/vnc connection info for the migration target. The spice/vnc
595server will ask the spice/vnc client to automatically reconnect using the
596new parameters (if specified) once the vm migration finished successfully.
597
598Arguments:
599
600- "protocol": protocol: "spice" or "vnc" (json-string)
601- "hostname": migration target hostname (json-string)
602- "port": spice/vnc tcp port for plaintext channels (json-int, optional)
603- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
604- "cert-subject": server certificate subject (json-string, optional)
605
606Example:
607
608-> { "execute": "client_migrate_info",
609 "arguments": { "protocol": "spice",
610 "hostname": "virt42.lab.kraxel.org",
611 "port": 1234 } }
612<- { "return": {} }
613
614EQMP
615
616 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300617 .name = "netdev_add",
618 .args_type = "netdev:O",
619 .params = "[user|tap|socket],id=str[,prop=value][,...]",
620 .help = "add host network device",
621 .user_print = monitor_user_noop,
622 .mhandler.cmd_new = do_netdev_add,
623 },
624
625SQMP
626netdev_add
627----------
628
629Add host network device.
630
631Arguments:
632
633- "type": the device type, "tap", "user", ... (json-string)
634- "id": the device's ID, must be unique (json-string)
635- device options
636
637Example:
638
639-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
640<- { "return": {} }
641
642Note: The supported device options are the same ones supported by the '-net'
643 command-line argument, which are listed in the '-help' output or QEMU's
644 manual
645
646EQMP
647
648 {
649 .name = "netdev_del",
650 .args_type = "id:s",
651 .params = "id",
652 .help = "remove host network device",
653 .user_print = monitor_user_noop,
654 .mhandler.cmd_new = do_netdev_del,
655 },
656
657SQMP
658netdev_del
659----------
660
661Remove host network device.
662
663Arguments:
664
665- "id": the device's ID, must be unique (json-string)
666
667Example:
668
669-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
670<- { "return": {} }
671
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100672
673EQMP
674
675 {
676 .name = "block_resize",
677 .args_type = "device:B,size:o",
Luiz Capitulino5e7caac2011-11-25 14:57:10 -0200678 .mhandler.cmd_new = qmp_marshal_input_block_resize,
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100679 },
680
681SQMP
682block_resize
683------------
684
685Resize a block image while a guest is running.
686
687Arguments:
688
689- "device": the device's ID, must be unique (json-string)
690- "size": new size
691
692Example:
693
694-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
695<- { "return": {} }
696
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300697EQMP
698
699 {
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +0000700 .name = "block_stream",
701 .args_type = "device:B,base:s?",
702 .mhandler.cmd_new = qmp_marshal_input_block_stream,
703 },
704
705 {
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +0000706 .name = "block_job_set_speed",
707 .args_type = "device:B,value:o",
708 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
709 },
710
711 {
Stefan Hajnoczi370521a2012-01-18 14:40:48 +0000712 .name = "block_job_cancel",
713 .args_type = "device:B",
714 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
715 },
716
717 {
Jes Sorensend967b2f2011-07-11 20:01:09 +0200718 .name = "blockdev-snapshot-sync",
Luiz Capitulino6106e242011-11-25 16:15:19 -0200719 .args_type = "device:B,snapshot-file:s,format:s?",
720 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
Jes Sorensend967b2f2011-07-11 20:01:09 +0200721 },
722
723SQMP
724blockdev-snapshot-sync
725----------------------
726
727Synchronous snapshot of a block device. snapshot-file specifies the
728target of the new image. If the file exists, or if it is a device, the
729snapshot will be created in the existing file/device. If does not
730exist, a new file will be created. format specifies the format of the
731snapshot image, default is qcow2.
732
733Arguments:
734
735- "device": device name to snapshot (json-string)
736- "snapshot-file": name of new image file (json-string)
737- "format": format of new image (json-string, optional)
738
739Example:
740
Luiz Capitulino7f3850c2011-10-10 17:30:08 -0300741-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
742 "snapshot-file":
743 "/some/place/my-image",
744 "format": "qcow2" } }
Jes Sorensend967b2f2011-07-11 20:01:09 +0200745<- { "return": {} }
746
747EQMP
748
749 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300750 .name = "balloon",
751 .args_type = "value:M",
Luiz Capitulinod72f3262011-11-25 14:38:09 -0200752 .mhandler.cmd_new = qmp_marshal_input_balloon,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300753 },
754
755SQMP
756balloon
757-------
758
759Request VM to change its memory allocation (in bytes).
760
761Arguments:
762
763- "value": New memory allocation (json-int)
764
765Example:
766
767-> { "execute": "balloon", "arguments": { "value": 536870912 } }
768<- { "return": {} }
769
770EQMP
771
772 {
773 .name = "set_link",
774 .args_type = "name:s,up:b",
Luiz Capitulino4b371562011-11-23 13:11:55 -0200775 .mhandler.cmd_new = qmp_marshal_input_set_link,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300776 },
777
778SQMP
779set_link
780--------
781
782Change the link status of a network adapter.
783
784Arguments:
785
786- "name": network device name (json-string)
787- "up": status is up (json-bool)
788
789Example:
790
791-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
792<- { "return": {} }
793
794EQMP
795
796 {
797 .name = "getfd",
798 .args_type = "fdname:s",
799 .params = "getfd name",
800 .help = "receive a file descriptor via SCM rights and assign it a name",
801 .user_print = monitor_user_noop,
802 .mhandler.cmd_new = do_getfd,
803 },
804
805SQMP
806getfd
807-----
808
809Receive a file descriptor via SCM rights and assign it a name.
810
811Arguments:
812
813- "fdname": file descriptor name (json-string)
814
815Example:
816
817-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
818<- { "return": {} }
819
820EQMP
821
822 {
823 .name = "closefd",
824 .args_type = "fdname:s",
825 .params = "closefd name",
826 .help = "close a file descriptor previously passed via SCM rights",
827 .user_print = monitor_user_noop,
828 .mhandler.cmd_new = do_closefd,
829 },
830
831SQMP
832closefd
833-------
834
835Close a file descriptor previously passed via SCM rights.
836
837Arguments:
838
839- "fdname": file descriptor name (json-string)
840
841Example:
842
843-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
844<- { "return": {} }
845
846EQMP
847
848 {
849 .name = "block_passwd",
850 .args_type = "device:B,password:s",
Luiz Capitulinoa4dea8a2011-11-23 13:28:21 -0200851 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300852 },
853
854SQMP
855block_passwd
856------------
857
858Set the password of encrypted block devices.
859
860Arguments:
861
862- "device": device name (json-string)
863- "password": password (json-string)
864
865Example:
866
867-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
868 "password": "12345" } }
869<- { "return": {} }
870
871EQMP
872
873 {
Zhi Yong Wu727f0052011-11-08 13:00:31 +0800874 .name = "block_set_io_throttle",
875 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
Luiz Capitulino80047da2011-12-14 16:49:14 -0200876 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
Zhi Yong Wu727f0052011-11-08 13:00:31 +0800877 },
878
879SQMP
880block_set_io_throttle
881------------
882
883Change I/O throttle limits for a block drive.
884
885Arguments:
886
887- "device": device name (json-string)
888- "bps": total throughput limit in bytes per second(json-int)
889- "bps_rd": read throughput limit in bytes per second(json-int)
890- "bps_wr": read throughput limit in bytes per second(json-int)
891- "iops": total I/O operations per second(json-int)
892- "iops_rd": read I/O operations per second(json-int)
893- "iops_wr": write I/O operations per second(json-int)
894
895Example:
896
897-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
898 "bps": "1000000",
899 "bps_rd": "0",
900 "bps_wr": "0",
901 "iops": "0",
902 "iops_rd": "0",
903 "iops_wr": "0" } }
904<- { "return": {} }
905
906EQMP
907
908 {
Gerd Hoffmann75721502010-10-07 12:22:54 +0200909 .name = "set_password",
910 .args_type = "protocol:s,password:s,connected:s?",
Luiz Capitulinofbf796f2011-12-07 11:17:51 -0200911 .mhandler.cmd_new = qmp_marshal_input_set_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +0200912 },
913
914SQMP
915set_password
916------------
917
918Set the password for vnc/spice protocols.
919
920Arguments:
921
922- "protocol": protocol name (json-string)
923- "password": password (json-string)
924- "connected": [ keep | disconnect | fail ] (josn-string, optional)
925
926Example:
927
928-> { "execute": "set_password", "arguments": { "protocol": "vnc",
929 "password": "secret" } }
930<- { "return": {} }
931
932EQMP
933
934 {
935 .name = "expire_password",
936 .args_type = "protocol:s,time:s",
Luiz Capitulino9ad53722011-12-07 11:47:57 -0200937 .mhandler.cmd_new = qmp_marshal_input_expire_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +0200938 },
939
940SQMP
941expire_password
942---------------
943
944Set the password expire time for vnc/spice protocols.
945
946Arguments:
947
948- "protocol": protocol name (json-string)
949- "time": [ now | never | +secs | secs ] (json-string)
950
951Example:
952
953-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
954 "time": "+60" } }
955<- { "return": {} }
956
957EQMP
958
959 {
Daniel P. Berrange13661082011-06-23 13:31:42 +0100960 .name = "add_client",
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +0000961 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
962 .params = "protocol fdname skipauth tls",
Daniel P. Berrange13661082011-06-23 13:31:42 +0100963 .help = "add a graphics client",
964 .user_print = monitor_user_noop,
965 .mhandler.cmd_new = add_graphics_client,
966 },
967
968SQMP
969add_client
970----------
971
972Add a graphics client
973
974Arguments:
975
976- "protocol": protocol name (json-string)
977- "fdname": file descriptor name (json-string)
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +0000978- "skipauth": whether to skip authentication (json-bool, optional)
979- "tls": whether to perform TLS (json-bool, optional)
Daniel P. Berrange13661082011-06-23 13:31:42 +0100980
981Example:
982
983-> { "execute": "add_client", "arguments": { "protocol": "vnc",
984 "fdname": "myclient" } }
985<- { "return": {} }
986
987EQMP
988 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300989 .name = "qmp_capabilities",
990 .args_type = "",
991 .params = "",
992 .help = "enable QMP capabilities",
993 .user_print = monitor_user_noop,
994 .mhandler.cmd_new = do_qmp_capabilities,
995 },
996
997SQMP
998qmp_capabilities
999----------------
1000
1001Enable QMP capabilities.
1002
1003Arguments: None.
1004
1005Example:
1006
1007-> { "execute": "qmp_capabilities" }
1008<- { "return": {} }
1009
1010Note: This command must be issued before issuing any other command.
1011
Luiz Capitulino0268d972010-10-22 10:08:02 -02001012EQMP
1013
1014 {
1015 .name = "human-monitor-command",
1016 .args_type = "command-line:s,cpu-index:i?",
Luiz Capitulinod51a67b2011-11-25 17:52:45 -02001017 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
Luiz Capitulino0268d972010-10-22 10:08:02 -02001018 },
1019
1020SQMP
1021human-monitor-command
1022---------------------
1023
1024Execute a Human Monitor command.
1025
1026Arguments:
1027
1028- command-line: the command name and its arguments, just like the
1029 Human Monitor's shell (json-string)
1030- cpu-index: select the CPU number to be used by commands which access CPU
1031 data, like 'info registers'. The Monitor selects CPU 0 if this
1032 argument is not provided (json-int, optional)
1033
1034Example:
1035
1036-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1037<- { "return": "kvm support: enabled\r\n" }
1038
1039Notes:
1040
1041(1) The Human Monitor is NOT an stable interface, this means that command
1042 names, arguments and responses can change or be removed at ANY time.
1043 Applications that rely on long term stability guarantees should NOT
1044 use this command
1045
1046(2) Limitations:
1047
1048 o This command is stateless, this means that commands that depend
1049 on state information (such as getfd) might not work
1050
1051 o Commands that prompt the user for data (eg. 'cont' when the block
1052 device is encrypted) don't currently work
1053
Luiz Capitulino82a56f02010-09-13 12:26:00 -030010543. Query Commands
1055=================
1056
1057HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1058HXCOMM this! We will possibly move query commands definitions inside those
1059HXCOMM sections, just like regular commands.
1060
1061EQMP
1062
1063SQMP
1064query-version
1065-------------
1066
1067Show QEMU version.
1068
1069Return a json-object with the following information:
1070
1071- "qemu": A json-object containing three integer values:
1072 - "major": QEMU's major version (json-int)
1073 - "minor": QEMU's minor version (json-int)
1074 - "micro": QEMU's micro version (json-int)
1075- "package": package's version (json-string)
1076
1077Example:
1078
1079-> { "execute": "query-version" }
1080<- {
1081 "return":{
1082 "qemu":{
1083 "major":0,
1084 "minor":11,
1085 "micro":5
1086 },
1087 "package":""
1088 }
1089 }
1090
1091EQMP
1092
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03001093 {
1094 .name = "query-version",
1095 .args_type = "",
1096 .mhandler.cmd_new = qmp_marshal_input_query_version,
1097 },
1098
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001099SQMP
1100query-commands
1101--------------
1102
1103List QMP available commands.
1104
1105Each command is represented by a json-object, the returned value is a json-array
1106of all commands.
1107
1108Each json-object contain:
1109
1110- "name": command's name (json-string)
1111
1112Example:
1113
1114-> { "execute": "query-commands" }
1115<- {
1116 "return":[
1117 {
1118 "name":"query-balloon"
1119 },
1120 {
1121 "name":"system_powerdown"
1122 }
1123 ]
1124 }
1125
1126Note: This example has been shortened as the real response is too long.
1127
1128EQMP
1129
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03001130 {
1131 .name = "query-commands",
1132 .args_type = "",
1133 .mhandler.cmd_new = qmp_marshal_input_query_commands,
1134 },
1135
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001136SQMP
1137query-chardev
1138-------------
1139
1140Each device is represented by a json-object. The returned value is a json-array
1141of all devices.
1142
1143Each json-object contain the following:
1144
1145- "label": device's label (json-string)
1146- "filename": device's file (json-string)
1147
1148Example:
1149
1150-> { "execute": "query-chardev" }
1151<- {
1152 "return":[
1153 {
1154 "label":"monitor",
1155 "filename":"stdio"
1156 },
1157 {
1158 "label":"serial0",
1159 "filename":"vc"
1160 }
1161 ]
1162 }
1163
1164EQMP
1165
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03001166 {
1167 .name = "query-chardev",
1168 .args_type = "",
1169 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
1170 },
1171
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001172SQMP
1173query-block
1174-----------
1175
1176Show the block devices.
1177
1178Each block device information is stored in a json-object and the returned value
1179is a json-array of all devices.
1180
1181Each json-object contain the following:
1182
1183- "device": device name (json-string)
1184- "type": device type (json-string)
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001185 - deprecated, retained for backward compatibility
1186 - Possible values: "unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001187- "removable": true if the device is removable, false otherwise (json-bool)
1188- "locked": true if the device is locked, false otherwise (json-bool)
Markus Armbrustere4def802011-09-06 18:58:53 +02001189- "tray-open": only present if removable, true if the device has a tray,
1190 and it is open (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001191- "inserted": only present if the device is inserted, it is a json-object
1192 containing the following:
1193 - "file": device file name (json-string)
1194 - "ro": true if read-only, false otherwise (json-bool)
1195 - "drv": driver format name (json-string)
1196 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1197 "file", "file", "ftp", "ftps", "host_cdrom",
1198 "host_device", "host_floppy", "http", "https",
1199 "nbd", "parallels", "qcow", "qcow2", "raw",
1200 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1201 - "backing_file": backing file name (json-string, optional)
1202 - "encrypted": true if encrypted, false otherwise (json-bool)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001203 - "bps": limit total bytes per second (json-int)
1204 - "bps_rd": limit read bytes per second (json-int)
1205 - "bps_wr": limit write bytes per second (json-int)
1206 - "iops": limit total I/O operations per second (json-int)
1207 - "iops_rd": limit read operations per second (json-int)
1208 - "iops_wr": limit write operations per second (json-int)
1209
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001210- "io-status": I/O operation status, only present if the device supports it
1211 and the VM is configured to stop on errors. It's always reset
1212 to "ok" when the "cont" command is issued (json_string, optional)
1213 - Possible values: "ok", "failed", "nospace"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001214
1215Example:
1216
1217-> { "execute": "query-block" }
1218<- {
1219 "return":[
1220 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001221 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001222 "device":"ide0-hd0",
1223 "locked":false,
1224 "removable":false,
1225 "inserted":{
1226 "ro":false,
1227 "drv":"qcow2",
1228 "encrypted":false,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001229 "file":"disks/test.img",
1230 "bps":1000000,
1231 "bps_rd":0,
1232 "bps_wr":0,
1233 "iops":1000000,
1234 "iops_rd":0,
1235 "iops_wr":0,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001236 },
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001237 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001238 },
1239 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001240 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001241 "device":"ide1-cd0",
1242 "locked":false,
1243 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001244 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001245 },
1246 {
1247 "device":"floppy0",
1248 "locked":false,
1249 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001250 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001251 },
1252 {
1253 "device":"sd0",
1254 "locked":false,
1255 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001256 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001257 }
1258 ]
1259 }
1260
1261EQMP
1262
Luiz Capitulinob2023812011-09-21 17:16:47 -03001263 {
1264 .name = "query-block",
1265 .args_type = "",
1266 .mhandler.cmd_new = qmp_marshal_input_query_block,
1267 },
1268
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001269SQMP
1270query-blockstats
1271----------------
1272
1273Show block device statistics.
1274
1275Each device statistic information is stored in a json-object and the returned
1276value is a json-array of all devices.
1277
1278Each json-object contain the following:
1279
1280- "device": device name (json-string)
1281- "stats": A json-object with the statistics information, it contains:
1282 - "rd_bytes": bytes read (json-int)
1283 - "wr_bytes": bytes written (json-int)
1284 - "rd_operations": read operations (json-int)
1285 - "wr_operations": write operations (json-int)
Christoph Hellwige8045d62011-08-22 00:25:58 +02001286 - "flush_operations": cache flush operations (json-int)
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001287 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1288 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1289 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001290 - "wr_highest_offset": Highest offset of a sector written since the
1291 BlockDriverState has been opened (json-int)
1292- "parent": Contains recursively the statistics of the underlying
1293 protocol (e.g. the host file for a qcow2 image). If there is
1294 no underlying protocol, this field is omitted
1295 (json-object, optional)
1296
1297Example:
1298
1299-> { "execute": "query-blockstats" }
1300<- {
1301 "return":[
1302 {
1303 "device":"ide0-hd0",
1304 "parent":{
1305 "stats":{
1306 "wr_highest_offset":3686448128,
1307 "wr_bytes":9786368,
1308 "wr_operations":751,
1309 "rd_bytes":122567168,
1310 "rd_operations":36772
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001311 "wr_total_times_ns":313253456
1312 "rd_total_times_ns":3465673657
1313 "flush_total_times_ns":49653
Christoph Hellwige8045d62011-08-22 00:25:58 +02001314 "flush_operations":61,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001315 }
1316 },
1317 "stats":{
1318 "wr_highest_offset":2821110784,
1319 "wr_bytes":9786368,
1320 "wr_operations":692,
1321 "rd_bytes":122739200,
1322 "rd_operations":36604
Christoph Hellwige8045d62011-08-22 00:25:58 +02001323 "flush_operations":51,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001324 "wr_total_times_ns":313253456
1325 "rd_total_times_ns":3465673657
1326 "flush_total_times_ns":49653
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001327 }
1328 },
1329 {
1330 "device":"ide1-cd0",
1331 "stats":{
1332 "wr_highest_offset":0,
1333 "wr_bytes":0,
1334 "wr_operations":0,
1335 "rd_bytes":0,
1336 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001337 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001338 "wr_total_times_ns":0
1339 "rd_total_times_ns":0
1340 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001341 }
1342 },
1343 {
1344 "device":"floppy0",
1345 "stats":{
1346 "wr_highest_offset":0,
1347 "wr_bytes":0,
1348 "wr_operations":0,
1349 "rd_bytes":0,
1350 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001351 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001352 "wr_total_times_ns":0
1353 "rd_total_times_ns":0
1354 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001355 }
1356 },
1357 {
1358 "device":"sd0",
1359 "stats":{
1360 "wr_highest_offset":0,
1361 "wr_bytes":0,
1362 "wr_operations":0,
1363 "rd_bytes":0,
1364 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001365 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001366 "wr_total_times_ns":0
1367 "rd_total_times_ns":0
1368 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001369 }
1370 }
1371 ]
1372 }
1373
1374EQMP
1375
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03001376 {
1377 .name = "query-blockstats",
1378 .args_type = "",
1379 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
1380 },
1381
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001382SQMP
1383query-cpus
1384----------
1385
1386Show CPU information.
1387
1388Return a json-array. Each CPU is represented by a json-object, which contains:
1389
1390- "CPU": CPU index (json-int)
1391- "current": true if this is the current CPU, false otherwise (json-bool)
1392- "halted": true if the cpu is halted, false otherwise (json-bool)
1393- Current program counter. The key's name depends on the architecture:
1394 "pc": i386/x86_64 (json-int)
1395 "nip": PPC (json-int)
1396 "pc" and "npc": sparc (json-int)
1397 "PC": mips (json-int)
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001398- "thread_id": ID of the underlying host thread (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001399
1400Example:
1401
1402-> { "execute": "query-cpus" }
1403<- {
1404 "return":[
1405 {
1406 "CPU":0,
1407 "current":true,
1408 "halted":false,
1409 "pc":3227107138
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001410 "thread_id":3134
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001411 },
1412 {
1413 "CPU":1,
1414 "current":false,
1415 "halted":true,
1416 "pc":7108165
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001417 "thread_id":3135
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001418 }
1419 ]
1420 }
1421
1422EQMP
1423
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03001424 {
1425 .name = "query-cpus",
1426 .args_type = "",
1427 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
1428 },
1429
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001430SQMP
1431query-pci
1432---------
1433
1434PCI buses and devices information.
1435
1436The returned value is a json-array of all buses. Each bus is represented by
1437a json-object, which has a key with a json-array of all PCI devices attached
1438to it. Each device is represented by a json-object.
1439
1440The bus json-object contains the following:
1441
1442- "bus": bus number (json-int)
1443- "devices": a json-array of json-objects, each json-object represents a
1444 PCI device
1445
1446The PCI device json-object contains the following:
1447
1448- "bus": identical to the parent's bus number (json-int)
1449- "slot": slot number (json-int)
1450- "function": function number (json-int)
1451- "class_info": a json-object containing:
1452 - "desc": device class description (json-string, optional)
1453 - "class": device class number (json-int)
1454- "id": a json-object containing:
1455 - "device": device ID (json-int)
1456 - "vendor": vendor ID (json-int)
1457- "irq": device's IRQ if assigned (json-int, optional)
1458- "qdev_id": qdev id string (json-string)
1459- "pci_bridge": It's a json-object, only present if this device is a
1460 PCI bridge, contains:
1461 - "bus": bus number (json-int)
1462 - "secondary": secondary bus number (json-int)
1463 - "subordinate": subordinate bus number (json-int)
1464 - "io_range": I/O memory range information, a json-object with the
1465 following members:
1466 - "base": base address, in bytes (json-int)
1467 - "limit": limit address, in bytes (json-int)
1468 - "memory_range": memory range information, a json-object with the
1469 following members:
1470 - "base": base address, in bytes (json-int)
1471 - "limit": limit address, in bytes (json-int)
1472 - "prefetchable_range": Prefetchable memory range information, a
1473 json-object with the following members:
1474 - "base": base address, in bytes (json-int)
1475 - "limit": limit address, in bytes (json-int)
1476 - "devices": a json-array of PCI devices if there's any attached, each
1477 each element is represented by a json-object, which contains
1478 the same members of the 'PCI device json-object' described
1479 above (optional)
1480- "regions": a json-array of json-objects, each json-object represents a
1481 memory region of this device
1482
1483The memory range json-object contains the following:
1484
1485- "base": base memory address (json-int)
1486- "limit": limit value (json-int)
1487
1488The region json-object can be an I/O region or a memory region, an I/O region
1489json-object contains the following:
1490
1491- "type": "io" (json-string, fixed)
1492- "bar": BAR number (json-int)
1493- "address": memory address (json-int)
1494- "size": memory size (json-int)
1495
1496A memory region json-object contains the following:
1497
1498- "type": "memory" (json-string, fixed)
1499- "bar": BAR number (json-int)
1500- "address": memory address (json-int)
1501- "size": memory size (json-int)
1502- "mem_type_64": true or false (json-bool)
1503- "prefetch": true or false (json-bool)
1504
1505Example:
1506
1507-> { "execute": "query-pci" }
1508<- {
1509 "return":[
1510 {
1511 "bus":0,
1512 "devices":[
1513 {
1514 "bus":0,
1515 "qdev_id":"",
1516 "slot":0,
1517 "class_info":{
1518 "class":1536,
1519 "desc":"Host bridge"
1520 },
1521 "id":{
1522 "device":32902,
1523 "vendor":4663
1524 },
1525 "function":0,
1526 "regions":[
1527
1528 ]
1529 },
1530 {
1531 "bus":0,
1532 "qdev_id":"",
1533 "slot":1,
1534 "class_info":{
1535 "class":1537,
1536 "desc":"ISA bridge"
1537 },
1538 "id":{
1539 "device":32902,
1540 "vendor":28672
1541 },
1542 "function":0,
1543 "regions":[
1544
1545 ]
1546 },
1547 {
1548 "bus":0,
1549 "qdev_id":"",
1550 "slot":1,
1551 "class_info":{
1552 "class":257,
1553 "desc":"IDE controller"
1554 },
1555 "id":{
1556 "device":32902,
1557 "vendor":28688
1558 },
1559 "function":1,
1560 "regions":[
1561 {
1562 "bar":4,
1563 "size":16,
1564 "address":49152,
1565 "type":"io"
1566 }
1567 ]
1568 },
1569 {
1570 "bus":0,
1571 "qdev_id":"",
1572 "slot":2,
1573 "class_info":{
1574 "class":768,
1575 "desc":"VGA controller"
1576 },
1577 "id":{
1578 "device":4115,
1579 "vendor":184
1580 },
1581 "function":0,
1582 "regions":[
1583 {
1584 "prefetch":true,
1585 "mem_type_64":false,
1586 "bar":0,
1587 "size":33554432,
1588 "address":4026531840,
1589 "type":"memory"
1590 },
1591 {
1592 "prefetch":false,
1593 "mem_type_64":false,
1594 "bar":1,
1595 "size":4096,
1596 "address":4060086272,
1597 "type":"memory"
1598 },
1599 {
1600 "prefetch":false,
1601 "mem_type_64":false,
1602 "bar":6,
1603 "size":65536,
1604 "address":-1,
1605 "type":"memory"
1606 }
1607 ]
1608 },
1609 {
1610 "bus":0,
1611 "qdev_id":"",
1612 "irq":11,
1613 "slot":4,
1614 "class_info":{
1615 "class":1280,
1616 "desc":"RAM controller"
1617 },
1618 "id":{
1619 "device":6900,
1620 "vendor":4098
1621 },
1622 "function":0,
1623 "regions":[
1624 {
1625 "bar":0,
1626 "size":32,
1627 "address":49280,
1628 "type":"io"
1629 }
1630 ]
1631 }
1632 ]
1633 }
1634 ]
1635 }
1636
1637Note: This example has been shortened as the real response is too long.
1638
1639EQMP
1640
Luiz Capitulino79627472011-10-21 14:15:33 -02001641 {
1642 .name = "query-pci",
1643 .args_type = "",
1644 .mhandler.cmd_new = qmp_marshal_input_query_pci,
1645 },
1646
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001647SQMP
1648query-kvm
1649---------
1650
1651Show KVM information.
1652
1653Return a json-object with the following information:
1654
1655- "enabled": true if KVM support is enabled, false otherwise (json-bool)
1656- "present": true if QEMU has KVM support, false otherwise (json-bool)
1657
1658Example:
1659
1660-> { "execute": "query-kvm" }
1661<- { "return": { "enabled": true, "present": true } }
1662
1663EQMP
1664
Luiz Capitulino292a2602011-09-12 15:10:53 -03001665 {
1666 .name = "query-kvm",
1667 .args_type = "",
1668 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
1669 },
1670
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001671SQMP
1672query-status
1673------------
1674
1675Return a json-object with the following information:
1676
1677- "running": true if the VM is running, or false if it is paused (json-bool)
1678- "singlestep": true if the VM is in single step mode,
1679 false otherwise (json-bool)
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03001680- "status": one of the following values (json-string)
1681 "debug" - QEMU is running on a debugger
1682 "inmigrate" - guest is paused waiting for an incoming migration
1683 "internal-error" - An internal error that prevents further guest
1684 execution has occurred
1685 "io-error" - the last IOP has failed and the device is configured
1686 to pause on I/O errors
1687 "paused" - guest has been paused via the 'stop' command
1688 "postmigrate" - guest is paused following a successful 'migrate'
1689 "prelaunch" - QEMU was started with -S and guest has not started
1690 "finish-migrate" - guest is paused to finish the migration process
1691 "restore-vm" - guest is paused to restore VM state
1692 "running" - guest is actively running
1693 "save-vm" - guest is paused to save the VM state
1694 "shutdown" - guest is shut down (and -no-shutdown is in use)
1695 "watchdog" - the watchdog action is configured to pause and
1696 has been triggered
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001697
1698Example:
1699
1700-> { "execute": "query-status" }
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03001701<- { "return": { "running": true, "singlestep": false, "status": "running" } }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001702
1703EQMP
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03001704
1705 {
1706 .name = "query-status",
1707 .args_type = "",
1708 .mhandler.cmd_new = qmp_marshal_input_query_status,
1709 },
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001710
1711SQMP
1712query-mice
1713----------
1714
1715Show VM mice information.
1716
1717Each mouse is represented by a json-object, the returned value is a json-array
1718of all mice.
1719
1720The mouse json-object contains the following:
1721
1722- "name": mouse's name (json-string)
1723- "index": mouse's index (json-int)
1724- "current": true if this mouse is receiving events, false otherwise (json-bool)
1725- "absolute": true if the mouse generates absolute input events (json-bool)
1726
1727Example:
1728
1729-> { "execute": "query-mice" }
1730<- {
1731 "return":[
1732 {
1733 "name":"QEMU Microsoft Mouse",
1734 "index":0,
1735 "current":false,
1736 "absolute":false
1737 },
1738 {
1739 "name":"QEMU PS/2 Mouse",
1740 "index":1,
1741 "current":true,
1742 "absolute":true
1743 }
1744 ]
1745 }
1746
1747EQMP
1748
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03001749 {
1750 .name = "query-mice",
1751 .args_type = "",
1752 .mhandler.cmd_new = qmp_marshal_input_query_mice,
1753 },
1754
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001755SQMP
1756query-vnc
1757---------
1758
1759Show VNC server information.
1760
1761Return a json-object with server information. Connected clients are returned
1762as a json-array of json-objects.
1763
1764The main json-object contains the following:
1765
1766- "enabled": true or false (json-bool)
1767- "host": server's IP address (json-string)
1768- "family": address family (json-string)
1769 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1770- "service": server's port number (json-string)
1771- "auth": authentication method (json-string)
1772 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
1773 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
1774 "vencrypt+plain", "vencrypt+tls+none",
1775 "vencrypt+tls+plain", "vencrypt+tls+sasl",
1776 "vencrypt+tls+vnc", "vencrypt+x509+none",
1777 "vencrypt+x509+plain", "vencrypt+x509+sasl",
1778 "vencrypt+x509+vnc", "vnc"
1779- "clients": a json-array of all connected clients
1780
1781Clients are described by a json-object, each one contain the following:
1782
1783- "host": client's IP address (json-string)
1784- "family": address family (json-string)
1785 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1786- "service": client's port number (json-string)
1787- "x509_dname": TLS dname (json-string, optional)
1788- "sasl_username": SASL username (json-string, optional)
1789
1790Example:
1791
1792-> { "execute": "query-vnc" }
1793<- {
1794 "return":{
1795 "enabled":true,
1796 "host":"0.0.0.0",
1797 "service":"50402",
1798 "auth":"vnc",
1799 "family":"ipv4",
1800 "clients":[
1801 {
1802 "host":"127.0.0.1",
1803 "service":"50401",
1804 "family":"ipv4"
1805 }
1806 ]
1807 }
1808 }
1809
1810EQMP
1811
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02001812 {
1813 .name = "query-vnc",
1814 .args_type = "",
1815 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
1816 },
1817
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001818SQMP
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01001819query-spice
1820-----------
1821
1822Show SPICE server information.
1823
1824Return a json-object with server information. Connected clients are returned
1825as a json-array of json-objects.
1826
1827The main json-object contains the following:
1828
1829- "enabled": true or false (json-bool)
1830- "host": server's IP address (json-string)
1831- "port": server's port number (json-int, optional)
1832- "tls-port": server's port number (json-int, optional)
1833- "auth": authentication method (json-string)
1834 - Possible values: "none", "spice"
1835- "channels": a json-array of all active channels clients
1836
1837Channels are described by a json-object, each one contain the following:
1838
1839- "host": client's IP address (json-string)
1840- "family": address family (json-string)
1841 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1842- "port": client's port number (json-string)
1843- "connection-id": spice connection id. All channels with the same id
1844 belong to the same spice session (json-int)
1845- "channel-type": channel type. "1" is the main control channel, filter for
1846 this one if you want track spice sessions only (json-int)
1847- "channel-id": channel id. Usually "0", might be different needed when
1848 multiple channels of the same type exist, such as multiple
1849 display channels in a multihead setup (json-int)
1850- "tls": whevener the channel is encrypted (json-bool)
1851
1852Example:
1853
1854-> { "execute": "query-spice" }
1855<- {
1856 "return": {
1857 "enabled": true,
1858 "auth": "spice",
1859 "port": 5920,
1860 "tls-port": 5921,
1861 "host": "0.0.0.0",
1862 "channels": [
1863 {
1864 "port": "54924",
1865 "family": "ipv4",
1866 "channel-type": 1,
1867 "connection-id": 1804289383,
1868 "host": "127.0.0.1",
1869 "channel-id": 0,
1870 "tls": true
1871 },
1872 {
1873 "port": "36710",
1874 "family": "ipv4",
1875 "channel-type": 4,
1876 "connection-id": 1804289383,
1877 "host": "127.0.0.1",
1878 "channel-id": 0,
1879 "tls": false
1880 },
1881 [ ... more channels follow ... ]
1882 ]
1883 }
1884 }
1885
1886EQMP
1887
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001888#if defined(CONFIG_SPICE)
1889 {
1890 .name = "query-spice",
1891 .args_type = "",
1892 .mhandler.cmd_new = qmp_marshal_input_query_spice,
1893 },
1894#endif
1895
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01001896SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001897query-name
1898----------
1899
1900Show VM name.
1901
1902Return a json-object with the following information:
1903
1904- "name": VM's name (json-string, optional)
1905
1906Example:
1907
1908-> { "execute": "query-name" }
1909<- { "return": { "name": "qemu-name" } }
1910
1911EQMP
1912
Anthony Liguori48a32be2011-09-02 12:34:48 -05001913 {
1914 .name = "query-name",
1915 .args_type = "",
1916 .mhandler.cmd_new = qmp_marshal_input_query_name,
1917 },
1918
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001919SQMP
1920query-uuid
1921----------
1922
1923Show VM UUID.
1924
1925Return a json-object with the following information:
1926
1927- "UUID": Universally Unique Identifier (json-string)
1928
1929Example:
1930
1931-> { "execute": "query-uuid" }
1932<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
1933
1934EQMP
1935
Luiz Capitulinoefab7672011-09-13 17:16:25 -03001936 {
1937 .name = "query-uuid",
1938 .args_type = "",
1939 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
1940 },
1941
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001942SQMP
1943query-migrate
1944-------------
1945
1946Migration status.
1947
1948Return a json-object. If migration is active there will be another json-object
1949with RAM migration status and if block migration is active another one with
1950block migration status.
1951
1952The main json-object contains the following:
1953
1954- "status": migration status (json-string)
1955 - Possible values: "active", "completed", "failed", "cancelled"
1956- "ram": only present if "status" is "active", it is a json-object with the
1957 following RAM information (in bytes):
1958 - "transferred": amount transferred (json-int)
1959 - "remaining": amount remaining (json-int)
1960 - "total": total (json-int)
1961- "disk": only present if "status" is "active" and it is a block migration,
1962 it is a json-object with the following disk information (in bytes):
1963 - "transferred": amount transferred (json-int)
1964 - "remaining": amount remaining (json-int)
1965 - "total": total (json-int)
1966
1967Examples:
1968
19691. Before the first migration
1970
1971-> { "execute": "query-migrate" }
1972<- { "return": {} }
1973
19742. Migration is done and has succeeded
1975
1976-> { "execute": "query-migrate" }
1977<- { "return": { "status": "completed" } }
1978
19793. Migration is done and has failed
1980
1981-> { "execute": "query-migrate" }
1982<- { "return": { "status": "failed" } }
1983
19844. Migration is being performed and is not a block migration:
1985
1986-> { "execute": "query-migrate" }
1987<- {
1988 "return":{
1989 "status":"active",
1990 "ram":{
1991 "transferred":123,
1992 "remaining":123,
1993 "total":246
1994 }
1995 }
1996 }
1997
19985. Migration is being performed and is a block migration:
1999
2000-> { "execute": "query-migrate" }
2001<- {
2002 "return":{
2003 "status":"active",
2004 "ram":{
2005 "total":1057024,
2006 "remaining":1053304,
2007 "transferred":3720
2008 },
2009 "disk":{
2010 "total":20971520,
2011 "remaining":20880384,
2012 "transferred":91136
2013 }
2014 }
2015 }
2016
2017EQMP
2018
Luiz Capitulino791e7c82011-09-13 17:37:16 -03002019 {
2020 .name = "query-migrate",
2021 .args_type = "",
2022 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
2023 },
2024
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002025SQMP
2026query-balloon
2027-------------
2028
2029Show balloon information.
2030
2031Make an asynchronous request for balloon info. When the request completes a
2032json-object will be returned containing the following data:
2033
2034- "actual": current balloon value in bytes (json-int)
2035- "mem_swapped_in": Amount of memory swapped in bytes (json-int, optional)
2036- "mem_swapped_out": Amount of memory swapped out in bytes (json-int, optional)
2037- "major_page_faults": Number of major faults (json-int, optional)
2038- "minor_page_faults": Number of minor faults (json-int, optional)
2039- "free_mem": Total amount of free and unused memory in
2040 bytes (json-int, optional)
2041- "total_mem": Total amount of available memory in bytes (json-int, optional)
2042
2043Example:
2044
2045-> { "execute": "query-balloon" }
2046<- {
2047 "return":{
2048 "actual":1073741824,
2049 "mem_swapped_in":0,
2050 "mem_swapped_out":0,
2051 "major_page_faults":142,
2052 "minor_page_faults":239245,
2053 "free_mem":1014185984,
2054 "total_mem":1044668416
2055 }
2056 }
2057
2058EQMP
2059
Luiz Capitulino96637bc2011-10-21 11:41:37 -02002060 {
2061 .name = "query-balloon",
2062 .args_type = "",
2063 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
2064 },
Anthony Liguorib4b12c62011-12-12 14:29:34 -06002065
2066 {
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00002067 .name = "query-block-jobs",
2068 .args_type = "",
2069 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
2070 },
2071
2072 {
Anthony Liguorib4b12c62011-12-12 14:29:34 -06002073 .name = "qom-list",
2074 .args_type = "path:s",
2075 .mhandler.cmd_new = qmp_marshal_input_qom_list,
2076 },
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06002077
2078 {
2079 .name = "qom-set",
2080 .args_type = "path:s,property:s,opts:O",
2081 .mhandler.cmd_new = qmp_qom_set,
2082 },
2083
2084 {
2085 .name = "qom-get",
2086 .args_type = "path:s,property:s",
2087 .mhandler.cmd_new = qmp_qom_get,
2088 },
Luiz Capitulino270b2432011-12-08 11:45:55 -02002089
2090 {
2091 .name = "change-vnc-password",
2092 .args_type = "password:s",
2093 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
2094 },
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06002095 {
2096 .name = "qom-list-types",
2097 .args_type = "implements:s?,abstract:b?",
2098 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
2099 },