blob: 7c377f015bb8baf33ade92fe52805db2d874f6a2 [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",
87 .params = "[-f] device",
88 .help = "eject a removable medium (use -f to force it)",
89 .user_print = monitor_user_noop,
90 .mhandler.cmd_new = do_eject,
91 },
92
93SQMP
94eject
95-----
96
97Eject a removable medium.
98
99Arguments:
100
101- force: force ejection (json-bool, optional)
102- device: device name (json-string)
103
104Example:
105
106-> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
107<- { "return": {} }
108
109Note: The "force" argument defaults to false.
110
111EQMP
112
113 {
114 .name = "change",
115 .args_type = "device:B,target:F,arg:s?",
116 .params = "device filename [format]",
117 .help = "change a removable medium, optional format",
118 .user_print = monitor_user_noop,
119 .mhandler.cmd_new = do_change,
120 },
121
122SQMP
123change
124------
125
126Change a removable medium or VNC configuration.
127
128Arguments:
129
130- "device": device name (json-string)
131- "target": filename or item (json-string)
132- "arg": additional argument (json-string, optional)
133
134Examples:
135
1361. Change a removable medium
137
138-> { "execute": "change",
139 "arguments": { "device": "ide1-cd0",
140 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
141<- { "return": {} }
142
1432. Change VNC password
144
145-> { "execute": "change",
146 "arguments": { "device": "vnc", "target": "password",
147 "arg": "foobar1" } }
148<- { "return": {} }
149
150EQMP
151
152 {
153 .name = "screendump",
154 .args_type = "filename:F",
155 .params = "filename",
156 .help = "save screen into PPM image 'filename'",
157 .user_print = monitor_user_noop,
158 .mhandler.cmd_new = do_screen_dump,
159 },
160
161SQMP
162screendump
163----------
164
165Save screen into PPM image.
166
167Arguments:
168
169- "filename": file path (json-string)
170
171Example:
172
173-> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
174<- { "return": {} }
175
176EQMP
177
178 {
179 .name = "stop",
180 .args_type = "",
Luiz Capitulino5f158f22011-09-15 14:34:39 -0300181 .mhandler.cmd_new = qmp_marshal_input_stop,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300182 },
183
184SQMP
185stop
186----
187
188Stop the emulator.
189
190Arguments: None.
191
192Example:
193
194-> { "execute": "stop" }
195<- { "return": {} }
196
197EQMP
198
199 {
200 .name = "cont",
201 .args_type = "",
Luiz Capitulinoe42e8182011-11-22 17:58:31 -0200202 .mhandler.cmd_new = qmp_marshal_input_cont,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300203 },
204
205SQMP
206cont
207----
208
209Resume emulation.
210
211Arguments: None.
212
213Example:
214
215-> { "execute": "cont" }
216<- { "return": {} }
217
218EQMP
219
220 {
221 .name = "system_reset",
222 .args_type = "",
Luiz Capitulino38d22652011-09-15 14:41:46 -0300223 .mhandler.cmd_new = qmp_marshal_input_system_reset,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300224 },
225
226SQMP
227system_reset
228------------
229
230Reset the system.
231
232Arguments: None.
233
234Example:
235
236-> { "execute": "system_reset" }
237<- { "return": {} }
238
239EQMP
240
241 {
242 .name = "system_powerdown",
243 .args_type = "",
Luiz Capitulino22e1bb92011-11-27 22:40:03 -0200244 .mhandler.cmd_new = qmp_marshal_input_system_powerdown,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300245 },
246
247SQMP
248system_powerdown
249----------------
250
251Send system power down event.
252
253Arguments: None.
254
255Example:
256
257-> { "execute": "system_powerdown" }
258<- { "return": {} }
259
260EQMP
261
262 {
263 .name = "device_add",
264 .args_type = "device:O",
265 .params = "driver[,prop=value][,...]",
266 .help = "add device, like -device on the command line",
267 .user_print = monitor_user_noop,
268 .mhandler.cmd_new = do_device_add,
269 },
270
271SQMP
272device_add
273----------
274
275Add a device.
276
277Arguments:
278
279- "driver": the name of the new device's driver (json-string)
280- "bus": the device's parent bus (device tree path, json-string, optional)
281- "id": the device's ID, must be unique (json-string)
282- device properties
283
284Example:
285
286-> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
287<- { "return": {} }
288
289Notes:
290
291(1) For detailed information about this command, please refer to the
292 'docs/qdev-device-use.txt' file.
293
294(2) It's possible to list device properties by running QEMU with the
295 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
296
297EQMP
298
299 {
300 .name = "device_del",
301 .args_type = "id:s",
302 .params = "device",
303 .help = "remove device",
304 .user_print = monitor_user_noop,
305 .mhandler.cmd_new = do_device_del,
306 },
307
308SQMP
309device_del
310----------
311
312Remove a device.
313
314Arguments:
315
316- "id": the device's ID (json-string)
317
318Example:
319
320-> { "execute": "device_del", "arguments": { "id": "net1" } }
321<- { "return": {} }
322
323EQMP
324
325 {
326 .name = "cpu",
327 .args_type = "index:i",
Luiz Capitulino755f1962011-10-06 14:31:39 -0300328 .mhandler.cmd_new = qmp_marshal_input_cpu,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300329 },
330
331SQMP
332cpu
333---
334
335Set the default CPU.
336
337Arguments:
338
339- "index": the CPU's index (json-int)
340
341Example:
342
343-> { "execute": "cpu", "arguments": { "index": 0 } }
344<- { "return": {} }
345
346Note: CPUs' indexes are obtained with the 'query-cpus' command.
347
348EQMP
349
350 {
351 .name = "memsave",
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200352 .args_type = "val:l,size:i,filename:s,cpu:i?",
353 .mhandler.cmd_new = qmp_marshal_input_memsave,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300354 },
355
356SQMP
357memsave
358-------
359
360Save to disk virtual memory dump starting at 'val' of size 'size'.
361
362Arguments:
363
364- "val": the starting address (json-int)
365- "size": the memory size, in bytes (json-int)
366- "filename": file path (json-string)
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200367- "cpu": virtual CPU index (json-int, optional)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300368
369Example:
370
371-> { "execute": "memsave",
372 "arguments": { "val": 10,
373 "size": 100,
374 "filename": "/tmp/virtual-mem-dump" } }
375<- { "return": {} }
376
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300377EQMP
378
379 {
380 .name = "pmemsave",
381 .args_type = "val:l,size:i,filename:s",
Luiz Capitulino6d3962b2011-11-22 17:26:46 -0200382 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300383 },
384
385SQMP
386pmemsave
387--------
388
389Save to disk physical memory dump starting at 'val' of size 'size'.
390
391Arguments:
392
393- "val": the starting address (json-int)
394- "size": the memory size, in bytes (json-int)
395- "filename": file path (json-string)
396
397Example:
398
399-> { "execute": "pmemsave",
400 "arguments": { "val": 10,
401 "size": 100,
402 "filename": "/tmp/physical-mem-dump" } }
403<- { "return": {} }
404
405EQMP
406
407 {
Lai Jiangshana4046662011-03-07 17:05:15 +0800408 .name = "inject-nmi",
409 .args_type = "",
Luiz Capitulinoab49ab52011-11-23 12:55:53 -0200410 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
Lai Jiangshana4046662011-03-07 17:05:15 +0800411 },
412
413SQMP
414inject-nmi
415----------
416
417Inject an NMI on guest's CPUs.
418
419Arguments: None.
420
421Example:
422
423-> { "execute": "inject-nmi" }
424<- { "return": {} }
425
426Note: inject-nmi is only supported for x86 guest currently, it will
427 returns "Unsupported" error for non-x86 guest.
428
429EQMP
430
431 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300432 .name = "migrate",
433 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
434 .params = "[-d] [-b] [-i] uri",
435 .help = "migrate to URI (using -d to not wait for completion)"
436 "\n\t\t\t -b for migration without shared storage with"
437 " full copy of disk\n\t\t\t -i for migration without "
438 "shared storage with incremental copy of disk "
439 "(base image shared between src and destination)",
440 .user_print = monitor_user_noop,
441 .mhandler.cmd_new = do_migrate,
442 },
443
444SQMP
445migrate
446-------
447
448Migrate to URI.
449
450Arguments:
451
452- "blk": block migration, full disk copy (json-bool, optional)
453- "inc": incremental disk copy (json-bool, optional)
454- "uri": Destination URI (json-string)
455
456Example:
457
458-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
459<- { "return": {} }
460
461Notes:
462
463(1) The 'query-migrate' command should be used to check migration's progress
464 and final result (this information is provided by the 'status' member)
465(2) All boolean arguments default to false
466(3) The user Monitor's "detach" argument is invalid in QMP and should not
467 be used
468
469EQMP
470
471 {
472 .name = "migrate_cancel",
473 .args_type = "",
474 .params = "",
475 .help = "cancel the current VM migration",
476 .user_print = monitor_user_noop,
477 .mhandler.cmd_new = do_migrate_cancel,
478 },
479
480SQMP
481migrate_cancel
482--------------
483
484Cancel the current migration.
485
486Arguments: None.
487
488Example:
489
490-> { "execute": "migrate_cancel" }
491<- { "return": {} }
492
493EQMP
494
495 {
496 .name = "migrate_set_speed",
Wen Congyang3a019b62010-11-25 09:06:05 +0800497 .args_type = "value:o",
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300498 .params = "value",
499 .help = "set maximum speed (in bytes) for migrations",
500 .user_print = monitor_user_noop,
501 .mhandler.cmd_new = do_migrate_set_speed,
502 },
503
504SQMP
505migrate_set_speed
506-----------------
507
508Set maximum speed for migrations.
509
510Arguments:
511
Luiz Capitulino5569fd72010-12-15 17:56:18 -0200512- "value": maximum speed, in bytes per second (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300513
514Example:
515
516-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
517<- { "return": {} }
518
519EQMP
520
521 {
522 .name = "migrate_set_downtime",
523 .args_type = "value:T",
524 .params = "value",
525 .help = "set maximum tolerated downtime (in seconds) for migrations",
526 .user_print = monitor_user_noop,
527 .mhandler.cmd_new = do_migrate_set_downtime,
528 },
529
530SQMP
531migrate_set_downtime
532--------------------
533
534Set maximum tolerated downtime (in seconds) for migrations.
535
536Arguments:
537
538- "value": maximum downtime (json-number)
539
540Example:
541
542-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
543<- { "return": {} }
544
545EQMP
546
547 {
Jes Sorensenff73edf2011-03-09 14:31:06 +0100548 .name = "client_migrate_info",
549 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
550 .params = "protocol hostname port tls-port cert-subject",
551 .help = "send migration info to spice/vnc client",
552 .user_print = monitor_user_noop,
Yonit Halperinedc5cb12011-10-17 10:03:18 +0200553 .mhandler.cmd_async = client_migrate_info,
554 .flags = MONITOR_CMD_ASYNC,
Jes Sorensenff73edf2011-03-09 14:31:06 +0100555 },
556
557SQMP
558client_migrate_info
559------------------
560
561Set the spice/vnc connection info for the migration target. The spice/vnc
562server will ask the spice/vnc client to automatically reconnect using the
563new parameters (if specified) once the vm migration finished successfully.
564
565Arguments:
566
567- "protocol": protocol: "spice" or "vnc" (json-string)
568- "hostname": migration target hostname (json-string)
569- "port": spice/vnc tcp port for plaintext channels (json-int, optional)
570- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
571- "cert-subject": server certificate subject (json-string, optional)
572
573Example:
574
575-> { "execute": "client_migrate_info",
576 "arguments": { "protocol": "spice",
577 "hostname": "virt42.lab.kraxel.org",
578 "port": 1234 } }
579<- { "return": {} }
580
581EQMP
582
583 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300584 .name = "netdev_add",
585 .args_type = "netdev:O",
586 .params = "[user|tap|socket],id=str[,prop=value][,...]",
587 .help = "add host network device",
588 .user_print = monitor_user_noop,
589 .mhandler.cmd_new = do_netdev_add,
590 },
591
592SQMP
593netdev_add
594----------
595
596Add host network device.
597
598Arguments:
599
600- "type": the device type, "tap", "user", ... (json-string)
601- "id": the device's ID, must be unique (json-string)
602- device options
603
604Example:
605
606-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
607<- { "return": {} }
608
609Note: The supported device options are the same ones supported by the '-net'
610 command-line argument, which are listed in the '-help' output or QEMU's
611 manual
612
613EQMP
614
615 {
616 .name = "netdev_del",
617 .args_type = "id:s",
618 .params = "id",
619 .help = "remove host network device",
620 .user_print = monitor_user_noop,
621 .mhandler.cmd_new = do_netdev_del,
622 },
623
624SQMP
625netdev_del
626----------
627
628Remove host network device.
629
630Arguments:
631
632- "id": the device's ID, must be unique (json-string)
633
634Example:
635
636-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
637<- { "return": {} }
638
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100639
640EQMP
641
642 {
643 .name = "block_resize",
644 .args_type = "device:B,size:o",
645 .params = "device size",
646 .help = "resize a block image",
647 .user_print = monitor_user_noop,
648 .mhandler.cmd_new = do_block_resize,
649 },
650
651SQMP
652block_resize
653------------
654
655Resize a block image while a guest is running.
656
657Arguments:
658
659- "device": the device's ID, must be unique (json-string)
660- "size": new size
661
662Example:
663
664-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
665<- { "return": {} }
666
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300667EQMP
668
669 {
Jes Sorensend967b2f2011-07-11 20:01:09 +0200670 .name = "blockdev-snapshot-sync",
671 .args_type = "device:B,snapshot-file:s?,format:s?",
672 .params = "device [new-image-file] [format]",
673 .user_print = monitor_user_noop,
674 .mhandler.cmd_new = do_snapshot_blkdev,
675 },
676
677SQMP
678blockdev-snapshot-sync
679----------------------
680
681Synchronous snapshot of a block device. snapshot-file specifies the
682target of the new image. If the file exists, or if it is a device, the
683snapshot will be created in the existing file/device. If does not
684exist, a new file will be created. format specifies the format of the
685snapshot image, default is qcow2.
686
687Arguments:
688
689- "device": device name to snapshot (json-string)
690- "snapshot-file": name of new image file (json-string)
691- "format": format of new image (json-string, optional)
692
693Example:
694
Luiz Capitulino7f3850c2011-10-10 17:30:08 -0300695-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
696 "snapshot-file":
697 "/some/place/my-image",
698 "format": "qcow2" } }
Jes Sorensend967b2f2011-07-11 20:01:09 +0200699<- { "return": {} }
700
701EQMP
702
703 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300704 .name = "balloon",
705 .args_type = "value:M",
Luiz Capitulinod72f3262011-11-25 14:38:09 -0200706 .mhandler.cmd_new = qmp_marshal_input_balloon,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300707 },
708
709SQMP
710balloon
711-------
712
713Request VM to change its memory allocation (in bytes).
714
715Arguments:
716
717- "value": New memory allocation (json-int)
718
719Example:
720
721-> { "execute": "balloon", "arguments": { "value": 536870912 } }
722<- { "return": {} }
723
724EQMP
725
726 {
727 .name = "set_link",
728 .args_type = "name:s,up:b",
Luiz Capitulino4b371562011-11-23 13:11:55 -0200729 .mhandler.cmd_new = qmp_marshal_input_set_link,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300730 },
731
732SQMP
733set_link
734--------
735
736Change the link status of a network adapter.
737
738Arguments:
739
740- "name": network device name (json-string)
741- "up": status is up (json-bool)
742
743Example:
744
745-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
746<- { "return": {} }
747
748EQMP
749
750 {
751 .name = "getfd",
752 .args_type = "fdname:s",
753 .params = "getfd name",
754 .help = "receive a file descriptor via SCM rights and assign it a name",
755 .user_print = monitor_user_noop,
756 .mhandler.cmd_new = do_getfd,
757 },
758
759SQMP
760getfd
761-----
762
763Receive a file descriptor via SCM rights and assign it a name.
764
765Arguments:
766
767- "fdname": file descriptor name (json-string)
768
769Example:
770
771-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
772<- { "return": {} }
773
774EQMP
775
776 {
777 .name = "closefd",
778 .args_type = "fdname:s",
779 .params = "closefd name",
780 .help = "close a file descriptor previously passed via SCM rights",
781 .user_print = monitor_user_noop,
782 .mhandler.cmd_new = do_closefd,
783 },
784
785SQMP
786closefd
787-------
788
789Close a file descriptor previously passed via SCM rights.
790
791Arguments:
792
793- "fdname": file descriptor name (json-string)
794
795Example:
796
797-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
798<- { "return": {} }
799
800EQMP
801
802 {
803 .name = "block_passwd",
804 .args_type = "device:B,password:s",
Luiz Capitulinoa4dea8a2011-11-23 13:28:21 -0200805 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300806 },
807
808SQMP
809block_passwd
810------------
811
812Set the password of encrypted block devices.
813
814Arguments:
815
816- "device": device name (json-string)
817- "password": password (json-string)
818
819Example:
820
821-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
822 "password": "12345" } }
823<- { "return": {} }
824
825EQMP
826
827 {
Zhi Yong Wu727f0052011-11-08 13:00:31 +0800828 .name = "block_set_io_throttle",
829 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
830 .params = "device bps bps_rd bps_wr iops iops_rd iops_wr",
831 .help = "change I/O throttle limits for a block drive",
832 .user_print = monitor_user_noop,
833 .mhandler.cmd_new = do_block_set_io_throttle,
834 },
835
836SQMP
837block_set_io_throttle
838------------
839
840Change I/O throttle limits for a block drive.
841
842Arguments:
843
844- "device": device name (json-string)
845- "bps": total throughput limit in bytes per second(json-int)
846- "bps_rd": read throughput limit in bytes per second(json-int)
847- "bps_wr": read throughput limit in bytes per second(json-int)
848- "iops": total I/O operations per second(json-int)
849- "iops_rd": read I/O operations per second(json-int)
850- "iops_wr": write I/O operations per second(json-int)
851
852Example:
853
854-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
855 "bps": "1000000",
856 "bps_rd": "0",
857 "bps_wr": "0",
858 "iops": "0",
859 "iops_rd": "0",
860 "iops_wr": "0" } }
861<- { "return": {} }
862
863EQMP
864
865 {
Gerd Hoffmann75721502010-10-07 12:22:54 +0200866 .name = "set_password",
867 .args_type = "protocol:s,password:s,connected:s?",
868 .params = "protocol password action-if-connected",
869 .help = "set spice/vnc password",
870 .user_print = monitor_user_noop,
871 .mhandler.cmd_new = set_password,
872 },
873
874SQMP
875set_password
876------------
877
878Set the password for vnc/spice protocols.
879
880Arguments:
881
882- "protocol": protocol name (json-string)
883- "password": password (json-string)
884- "connected": [ keep | disconnect | fail ] (josn-string, optional)
885
886Example:
887
888-> { "execute": "set_password", "arguments": { "protocol": "vnc",
889 "password": "secret" } }
890<- { "return": {} }
891
892EQMP
893
894 {
895 .name = "expire_password",
896 .args_type = "protocol:s,time:s",
897 .params = "protocol time",
898 .help = "set spice/vnc password expire-time",
899 .user_print = monitor_user_noop,
900 .mhandler.cmd_new = expire_password,
901 },
902
903SQMP
904expire_password
905---------------
906
907Set the password expire time for vnc/spice protocols.
908
909Arguments:
910
911- "protocol": protocol name (json-string)
912- "time": [ now | never | +secs | secs ] (json-string)
913
914Example:
915
916-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
917 "time": "+60" } }
918<- { "return": {} }
919
920EQMP
921
922 {
Daniel P. Berrange13661082011-06-23 13:31:42 +0100923 .name = "add_client",
924 .args_type = "protocol:s,fdname:s,skipauth:b?",
925 .params = "protocol fdname skipauth",
926 .help = "add a graphics client",
927 .user_print = monitor_user_noop,
928 .mhandler.cmd_new = add_graphics_client,
929 },
930
931SQMP
932add_client
933----------
934
935Add a graphics client
936
937Arguments:
938
939- "protocol": protocol name (json-string)
940- "fdname": file descriptor name (json-string)
941
942Example:
943
944-> { "execute": "add_client", "arguments": { "protocol": "vnc",
945 "fdname": "myclient" } }
946<- { "return": {} }
947
948EQMP
949 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300950 .name = "qmp_capabilities",
951 .args_type = "",
952 .params = "",
953 .help = "enable QMP capabilities",
954 .user_print = monitor_user_noop,
955 .mhandler.cmd_new = do_qmp_capabilities,
956 },
957
958SQMP
959qmp_capabilities
960----------------
961
962Enable QMP capabilities.
963
964Arguments: None.
965
966Example:
967
968-> { "execute": "qmp_capabilities" }
969<- { "return": {} }
970
971Note: This command must be issued before issuing any other command.
972
Luiz Capitulino0268d972010-10-22 10:08:02 -0200973EQMP
974
975 {
976 .name = "human-monitor-command",
977 .args_type = "command-line:s,cpu-index:i?",
978 .params = "",
979 .help = "",
980 .user_print = monitor_user_noop,
981 .mhandler.cmd_new = do_hmp_passthrough,
982 },
983
984SQMP
985human-monitor-command
986---------------------
987
988Execute a Human Monitor command.
989
990Arguments:
991
992- command-line: the command name and its arguments, just like the
993 Human Monitor's shell (json-string)
994- cpu-index: select the CPU number to be used by commands which access CPU
995 data, like 'info registers'. The Monitor selects CPU 0 if this
996 argument is not provided (json-int, optional)
997
998Example:
999
1000-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1001<- { "return": "kvm support: enabled\r\n" }
1002
1003Notes:
1004
1005(1) The Human Monitor is NOT an stable interface, this means that command
1006 names, arguments and responses can change or be removed at ANY time.
1007 Applications that rely on long term stability guarantees should NOT
1008 use this command
1009
1010(2) Limitations:
1011
1012 o This command is stateless, this means that commands that depend
1013 on state information (such as getfd) might not work
1014
1015 o Commands that prompt the user for data (eg. 'cont' when the block
1016 device is encrypted) don't currently work
1017
Luiz Capitulino82a56f02010-09-13 12:26:00 -030010183. Query Commands
1019=================
1020
1021HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1022HXCOMM this! We will possibly move query commands definitions inside those
1023HXCOMM sections, just like regular commands.
1024
1025EQMP
1026
1027SQMP
1028query-version
1029-------------
1030
1031Show QEMU version.
1032
1033Return a json-object with the following information:
1034
1035- "qemu": A json-object containing three integer values:
1036 - "major": QEMU's major version (json-int)
1037 - "minor": QEMU's minor version (json-int)
1038 - "micro": QEMU's micro version (json-int)
1039- "package": package's version (json-string)
1040
1041Example:
1042
1043-> { "execute": "query-version" }
1044<- {
1045 "return":{
1046 "qemu":{
1047 "major":0,
1048 "minor":11,
1049 "micro":5
1050 },
1051 "package":""
1052 }
1053 }
1054
1055EQMP
1056
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03001057 {
1058 .name = "query-version",
1059 .args_type = "",
1060 .mhandler.cmd_new = qmp_marshal_input_query_version,
1061 },
1062
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001063SQMP
1064query-commands
1065--------------
1066
1067List QMP available commands.
1068
1069Each command is represented by a json-object, the returned value is a json-array
1070of all commands.
1071
1072Each json-object contain:
1073
1074- "name": command's name (json-string)
1075
1076Example:
1077
1078-> { "execute": "query-commands" }
1079<- {
1080 "return":[
1081 {
1082 "name":"query-balloon"
1083 },
1084 {
1085 "name":"system_powerdown"
1086 }
1087 ]
1088 }
1089
1090Note: This example has been shortened as the real response is too long.
1091
1092EQMP
1093
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03001094 {
1095 .name = "query-commands",
1096 .args_type = "",
1097 .mhandler.cmd_new = qmp_marshal_input_query_commands,
1098 },
1099
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001100SQMP
1101query-chardev
1102-------------
1103
1104Each device is represented by a json-object. The returned value is a json-array
1105of all devices.
1106
1107Each json-object contain the following:
1108
1109- "label": device's label (json-string)
1110- "filename": device's file (json-string)
1111
1112Example:
1113
1114-> { "execute": "query-chardev" }
1115<- {
1116 "return":[
1117 {
1118 "label":"monitor",
1119 "filename":"stdio"
1120 },
1121 {
1122 "label":"serial0",
1123 "filename":"vc"
1124 }
1125 ]
1126 }
1127
1128EQMP
1129
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03001130 {
1131 .name = "query-chardev",
1132 .args_type = "",
1133 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
1134 },
1135
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001136SQMP
1137query-block
1138-----------
1139
1140Show the block devices.
1141
1142Each block device information is stored in a json-object and the returned value
1143is a json-array of all devices.
1144
1145Each json-object contain the following:
1146
1147- "device": device name (json-string)
1148- "type": device type (json-string)
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001149 - deprecated, retained for backward compatibility
1150 - Possible values: "unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001151- "removable": true if the device is removable, false otherwise (json-bool)
1152- "locked": true if the device is locked, false otherwise (json-bool)
Markus Armbrustere4def802011-09-06 18:58:53 +02001153- "tray-open": only present if removable, true if the device has a tray,
1154 and it is open (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001155- "inserted": only present if the device is inserted, it is a json-object
1156 containing the following:
1157 - "file": device file name (json-string)
1158 - "ro": true if read-only, false otherwise (json-bool)
1159 - "drv": driver format name (json-string)
1160 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1161 "file", "file", "ftp", "ftps", "host_cdrom",
1162 "host_device", "host_floppy", "http", "https",
1163 "nbd", "parallels", "qcow", "qcow2", "raw",
1164 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1165 - "backing_file": backing file name (json-string, optional)
1166 - "encrypted": true if encrypted, false otherwise (json-bool)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001167 - "bps": limit total bytes per second (json-int)
1168 - "bps_rd": limit read bytes per second (json-int)
1169 - "bps_wr": limit write bytes per second (json-int)
1170 - "iops": limit total I/O operations per second (json-int)
1171 - "iops_rd": limit read operations per second (json-int)
1172 - "iops_wr": limit write operations per second (json-int)
1173
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001174- "io-status": I/O operation status, only present if the device supports it
1175 and the VM is configured to stop on errors. It's always reset
1176 to "ok" when the "cont" command is issued (json_string, optional)
1177 - Possible values: "ok", "failed", "nospace"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001178
1179Example:
1180
1181-> { "execute": "query-block" }
1182<- {
1183 "return":[
1184 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001185 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001186 "device":"ide0-hd0",
1187 "locked":false,
1188 "removable":false,
1189 "inserted":{
1190 "ro":false,
1191 "drv":"qcow2",
1192 "encrypted":false,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001193 "file":"disks/test.img",
1194 "bps":1000000,
1195 "bps_rd":0,
1196 "bps_wr":0,
1197 "iops":1000000,
1198 "iops_rd":0,
1199 "iops_wr":0,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001200 },
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001201 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001202 },
1203 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001204 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001205 "device":"ide1-cd0",
1206 "locked":false,
1207 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001208 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001209 },
1210 {
1211 "device":"floppy0",
1212 "locked":false,
1213 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001214 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001215 },
1216 {
1217 "device":"sd0",
1218 "locked":false,
1219 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001220 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001221 }
1222 ]
1223 }
1224
1225EQMP
1226
Luiz Capitulinob2023812011-09-21 17:16:47 -03001227 {
1228 .name = "query-block",
1229 .args_type = "",
1230 .mhandler.cmd_new = qmp_marshal_input_query_block,
1231 },
1232
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001233SQMP
1234query-blockstats
1235----------------
1236
1237Show block device statistics.
1238
1239Each device statistic information is stored in a json-object and the returned
1240value is a json-array of all devices.
1241
1242Each json-object contain the following:
1243
1244- "device": device name (json-string)
1245- "stats": A json-object with the statistics information, it contains:
1246 - "rd_bytes": bytes read (json-int)
1247 - "wr_bytes": bytes written (json-int)
1248 - "rd_operations": read operations (json-int)
1249 - "wr_operations": write operations (json-int)
Christoph Hellwige8045d62011-08-22 00:25:58 +02001250 - "flush_operations": cache flush operations (json-int)
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001251 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1252 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1253 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001254 - "wr_highest_offset": Highest offset of a sector written since the
1255 BlockDriverState has been opened (json-int)
1256- "parent": Contains recursively the statistics of the underlying
1257 protocol (e.g. the host file for a qcow2 image). If there is
1258 no underlying protocol, this field is omitted
1259 (json-object, optional)
1260
1261Example:
1262
1263-> { "execute": "query-blockstats" }
1264<- {
1265 "return":[
1266 {
1267 "device":"ide0-hd0",
1268 "parent":{
1269 "stats":{
1270 "wr_highest_offset":3686448128,
1271 "wr_bytes":9786368,
1272 "wr_operations":751,
1273 "rd_bytes":122567168,
1274 "rd_operations":36772
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001275 "wr_total_times_ns":313253456
1276 "rd_total_times_ns":3465673657
1277 "flush_total_times_ns":49653
Christoph Hellwige8045d62011-08-22 00:25:58 +02001278 "flush_operations":61,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001279 }
1280 },
1281 "stats":{
1282 "wr_highest_offset":2821110784,
1283 "wr_bytes":9786368,
1284 "wr_operations":692,
1285 "rd_bytes":122739200,
1286 "rd_operations":36604
Christoph Hellwige8045d62011-08-22 00:25:58 +02001287 "flush_operations":51,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001288 "wr_total_times_ns":313253456
1289 "rd_total_times_ns":3465673657
1290 "flush_total_times_ns":49653
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001291 }
1292 },
1293 {
1294 "device":"ide1-cd0",
1295 "stats":{
1296 "wr_highest_offset":0,
1297 "wr_bytes":0,
1298 "wr_operations":0,
1299 "rd_bytes":0,
1300 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001301 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001302 "wr_total_times_ns":0
1303 "rd_total_times_ns":0
1304 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001305 }
1306 },
1307 {
1308 "device":"floppy0",
1309 "stats":{
1310 "wr_highest_offset":0,
1311 "wr_bytes":0,
1312 "wr_operations":0,
1313 "rd_bytes":0,
1314 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001315 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001316 "wr_total_times_ns":0
1317 "rd_total_times_ns":0
1318 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001319 }
1320 },
1321 {
1322 "device":"sd0",
1323 "stats":{
1324 "wr_highest_offset":0,
1325 "wr_bytes":0,
1326 "wr_operations":0,
1327 "rd_bytes":0,
1328 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001329 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001330 "wr_total_times_ns":0
1331 "rd_total_times_ns":0
1332 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001333 }
1334 }
1335 ]
1336 }
1337
1338EQMP
1339
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03001340 {
1341 .name = "query-blockstats",
1342 .args_type = "",
1343 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
1344 },
1345
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001346SQMP
1347query-cpus
1348----------
1349
1350Show CPU information.
1351
1352Return a json-array. Each CPU is represented by a json-object, which contains:
1353
1354- "CPU": CPU index (json-int)
1355- "current": true if this is the current CPU, false otherwise (json-bool)
1356- "halted": true if the cpu is halted, false otherwise (json-bool)
1357- Current program counter. The key's name depends on the architecture:
1358 "pc": i386/x86_64 (json-int)
1359 "nip": PPC (json-int)
1360 "pc" and "npc": sparc (json-int)
1361 "PC": mips (json-int)
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001362- "thread_id": ID of the underlying host thread (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001363
1364Example:
1365
1366-> { "execute": "query-cpus" }
1367<- {
1368 "return":[
1369 {
1370 "CPU":0,
1371 "current":true,
1372 "halted":false,
1373 "pc":3227107138
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001374 "thread_id":3134
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001375 },
1376 {
1377 "CPU":1,
1378 "current":false,
1379 "halted":true,
1380 "pc":7108165
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001381 "thread_id":3135
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001382 }
1383 ]
1384 }
1385
1386EQMP
1387
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03001388 {
1389 .name = "query-cpus",
1390 .args_type = "",
1391 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
1392 },
1393
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001394SQMP
1395query-pci
1396---------
1397
1398PCI buses and devices information.
1399
1400The returned value is a json-array of all buses. Each bus is represented by
1401a json-object, which has a key with a json-array of all PCI devices attached
1402to it. Each device is represented by a json-object.
1403
1404The bus json-object contains the following:
1405
1406- "bus": bus number (json-int)
1407- "devices": a json-array of json-objects, each json-object represents a
1408 PCI device
1409
1410The PCI device json-object contains the following:
1411
1412- "bus": identical to the parent's bus number (json-int)
1413- "slot": slot number (json-int)
1414- "function": function number (json-int)
1415- "class_info": a json-object containing:
1416 - "desc": device class description (json-string, optional)
1417 - "class": device class number (json-int)
1418- "id": a json-object containing:
1419 - "device": device ID (json-int)
1420 - "vendor": vendor ID (json-int)
1421- "irq": device's IRQ if assigned (json-int, optional)
1422- "qdev_id": qdev id string (json-string)
1423- "pci_bridge": It's a json-object, only present if this device is a
1424 PCI bridge, contains:
1425 - "bus": bus number (json-int)
1426 - "secondary": secondary bus number (json-int)
1427 - "subordinate": subordinate bus number (json-int)
1428 - "io_range": I/O memory range information, a json-object with the
1429 following members:
1430 - "base": base address, in bytes (json-int)
1431 - "limit": limit address, in bytes (json-int)
1432 - "memory_range": memory range information, a json-object with the
1433 following members:
1434 - "base": base address, in bytes (json-int)
1435 - "limit": limit address, in bytes (json-int)
1436 - "prefetchable_range": Prefetchable memory range information, a
1437 json-object with the following members:
1438 - "base": base address, in bytes (json-int)
1439 - "limit": limit address, in bytes (json-int)
1440 - "devices": a json-array of PCI devices if there's any attached, each
1441 each element is represented by a json-object, which contains
1442 the same members of the 'PCI device json-object' described
1443 above (optional)
1444- "regions": a json-array of json-objects, each json-object represents a
1445 memory region of this device
1446
1447The memory range json-object contains the following:
1448
1449- "base": base memory address (json-int)
1450- "limit": limit value (json-int)
1451
1452The region json-object can be an I/O region or a memory region, an I/O region
1453json-object contains the following:
1454
1455- "type": "io" (json-string, fixed)
1456- "bar": BAR number (json-int)
1457- "address": memory address (json-int)
1458- "size": memory size (json-int)
1459
1460A memory region json-object contains the following:
1461
1462- "type": "memory" (json-string, fixed)
1463- "bar": BAR number (json-int)
1464- "address": memory address (json-int)
1465- "size": memory size (json-int)
1466- "mem_type_64": true or false (json-bool)
1467- "prefetch": true or false (json-bool)
1468
1469Example:
1470
1471-> { "execute": "query-pci" }
1472<- {
1473 "return":[
1474 {
1475 "bus":0,
1476 "devices":[
1477 {
1478 "bus":0,
1479 "qdev_id":"",
1480 "slot":0,
1481 "class_info":{
1482 "class":1536,
1483 "desc":"Host bridge"
1484 },
1485 "id":{
1486 "device":32902,
1487 "vendor":4663
1488 },
1489 "function":0,
1490 "regions":[
1491
1492 ]
1493 },
1494 {
1495 "bus":0,
1496 "qdev_id":"",
1497 "slot":1,
1498 "class_info":{
1499 "class":1537,
1500 "desc":"ISA bridge"
1501 },
1502 "id":{
1503 "device":32902,
1504 "vendor":28672
1505 },
1506 "function":0,
1507 "regions":[
1508
1509 ]
1510 },
1511 {
1512 "bus":0,
1513 "qdev_id":"",
1514 "slot":1,
1515 "class_info":{
1516 "class":257,
1517 "desc":"IDE controller"
1518 },
1519 "id":{
1520 "device":32902,
1521 "vendor":28688
1522 },
1523 "function":1,
1524 "regions":[
1525 {
1526 "bar":4,
1527 "size":16,
1528 "address":49152,
1529 "type":"io"
1530 }
1531 ]
1532 },
1533 {
1534 "bus":0,
1535 "qdev_id":"",
1536 "slot":2,
1537 "class_info":{
1538 "class":768,
1539 "desc":"VGA controller"
1540 },
1541 "id":{
1542 "device":4115,
1543 "vendor":184
1544 },
1545 "function":0,
1546 "regions":[
1547 {
1548 "prefetch":true,
1549 "mem_type_64":false,
1550 "bar":0,
1551 "size":33554432,
1552 "address":4026531840,
1553 "type":"memory"
1554 },
1555 {
1556 "prefetch":false,
1557 "mem_type_64":false,
1558 "bar":1,
1559 "size":4096,
1560 "address":4060086272,
1561 "type":"memory"
1562 },
1563 {
1564 "prefetch":false,
1565 "mem_type_64":false,
1566 "bar":6,
1567 "size":65536,
1568 "address":-1,
1569 "type":"memory"
1570 }
1571 ]
1572 },
1573 {
1574 "bus":0,
1575 "qdev_id":"",
1576 "irq":11,
1577 "slot":4,
1578 "class_info":{
1579 "class":1280,
1580 "desc":"RAM controller"
1581 },
1582 "id":{
1583 "device":6900,
1584 "vendor":4098
1585 },
1586 "function":0,
1587 "regions":[
1588 {
1589 "bar":0,
1590 "size":32,
1591 "address":49280,
1592 "type":"io"
1593 }
1594 ]
1595 }
1596 ]
1597 }
1598 ]
1599 }
1600
1601Note: This example has been shortened as the real response is too long.
1602
1603EQMP
1604
Luiz Capitulino79627472011-10-21 14:15:33 -02001605 {
1606 .name = "query-pci",
1607 .args_type = "",
1608 .mhandler.cmd_new = qmp_marshal_input_query_pci,
1609 },
1610
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001611SQMP
1612query-kvm
1613---------
1614
1615Show KVM information.
1616
1617Return a json-object with the following information:
1618
1619- "enabled": true if KVM support is enabled, false otherwise (json-bool)
1620- "present": true if QEMU has KVM support, false otherwise (json-bool)
1621
1622Example:
1623
1624-> { "execute": "query-kvm" }
1625<- { "return": { "enabled": true, "present": true } }
1626
1627EQMP
1628
Luiz Capitulino292a2602011-09-12 15:10:53 -03001629 {
1630 .name = "query-kvm",
1631 .args_type = "",
1632 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
1633 },
1634
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001635SQMP
1636query-status
1637------------
1638
1639Return a json-object with the following information:
1640
1641- "running": true if the VM is running, or false if it is paused (json-bool)
1642- "singlestep": true if the VM is in single step mode,
1643 false otherwise (json-bool)
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03001644- "status": one of the following values (json-string)
1645 "debug" - QEMU is running on a debugger
1646 "inmigrate" - guest is paused waiting for an incoming migration
1647 "internal-error" - An internal error that prevents further guest
1648 execution has occurred
1649 "io-error" - the last IOP has failed and the device is configured
1650 to pause on I/O errors
1651 "paused" - guest has been paused via the 'stop' command
1652 "postmigrate" - guest is paused following a successful 'migrate'
1653 "prelaunch" - QEMU was started with -S and guest has not started
1654 "finish-migrate" - guest is paused to finish the migration process
1655 "restore-vm" - guest is paused to restore VM state
1656 "running" - guest is actively running
1657 "save-vm" - guest is paused to save the VM state
1658 "shutdown" - guest is shut down (and -no-shutdown is in use)
1659 "watchdog" - the watchdog action is configured to pause and
1660 has been triggered
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001661
1662Example:
1663
1664-> { "execute": "query-status" }
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03001665<- { "return": { "running": true, "singlestep": false, "status": "running" } }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001666
1667EQMP
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03001668
1669 {
1670 .name = "query-status",
1671 .args_type = "",
1672 .mhandler.cmd_new = qmp_marshal_input_query_status,
1673 },
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001674
1675SQMP
1676query-mice
1677----------
1678
1679Show VM mice information.
1680
1681Each mouse is represented by a json-object, the returned value is a json-array
1682of all mice.
1683
1684The mouse json-object contains the following:
1685
1686- "name": mouse's name (json-string)
1687- "index": mouse's index (json-int)
1688- "current": true if this mouse is receiving events, false otherwise (json-bool)
1689- "absolute": true if the mouse generates absolute input events (json-bool)
1690
1691Example:
1692
1693-> { "execute": "query-mice" }
1694<- {
1695 "return":[
1696 {
1697 "name":"QEMU Microsoft Mouse",
1698 "index":0,
1699 "current":false,
1700 "absolute":false
1701 },
1702 {
1703 "name":"QEMU PS/2 Mouse",
1704 "index":1,
1705 "current":true,
1706 "absolute":true
1707 }
1708 ]
1709 }
1710
1711EQMP
1712
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03001713 {
1714 .name = "query-mice",
1715 .args_type = "",
1716 .mhandler.cmd_new = qmp_marshal_input_query_mice,
1717 },
1718
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001719SQMP
1720query-vnc
1721---------
1722
1723Show VNC server information.
1724
1725Return a json-object with server information. Connected clients are returned
1726as a json-array of json-objects.
1727
1728The main json-object contains the following:
1729
1730- "enabled": true or false (json-bool)
1731- "host": server's IP address (json-string)
1732- "family": address family (json-string)
1733 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1734- "service": server's port number (json-string)
1735- "auth": authentication method (json-string)
1736 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
1737 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
1738 "vencrypt+plain", "vencrypt+tls+none",
1739 "vencrypt+tls+plain", "vencrypt+tls+sasl",
1740 "vencrypt+tls+vnc", "vencrypt+x509+none",
1741 "vencrypt+x509+plain", "vencrypt+x509+sasl",
1742 "vencrypt+x509+vnc", "vnc"
1743- "clients": a json-array of all connected clients
1744
1745Clients are described by a json-object, each one contain the following:
1746
1747- "host": client's IP address (json-string)
1748- "family": address family (json-string)
1749 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1750- "service": client's port number (json-string)
1751- "x509_dname": TLS dname (json-string, optional)
1752- "sasl_username": SASL username (json-string, optional)
1753
1754Example:
1755
1756-> { "execute": "query-vnc" }
1757<- {
1758 "return":{
1759 "enabled":true,
1760 "host":"0.0.0.0",
1761 "service":"50402",
1762 "auth":"vnc",
1763 "family":"ipv4",
1764 "clients":[
1765 {
1766 "host":"127.0.0.1",
1767 "service":"50401",
1768 "family":"ipv4"
1769 }
1770 ]
1771 }
1772 }
1773
1774EQMP
1775
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02001776 {
1777 .name = "query-vnc",
1778 .args_type = "",
1779 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
1780 },
1781
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001782SQMP
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01001783query-spice
1784-----------
1785
1786Show SPICE server information.
1787
1788Return a json-object with server information. Connected clients are returned
1789as a json-array of json-objects.
1790
1791The main json-object contains the following:
1792
1793- "enabled": true or false (json-bool)
1794- "host": server's IP address (json-string)
1795- "port": server's port number (json-int, optional)
1796- "tls-port": server's port number (json-int, optional)
1797- "auth": authentication method (json-string)
1798 - Possible values: "none", "spice"
1799- "channels": a json-array of all active channels clients
1800
1801Channels are described by a json-object, each one contain the following:
1802
1803- "host": client's IP address (json-string)
1804- "family": address family (json-string)
1805 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1806- "port": client's port number (json-string)
1807- "connection-id": spice connection id. All channels with the same id
1808 belong to the same spice session (json-int)
1809- "channel-type": channel type. "1" is the main control channel, filter for
1810 this one if you want track spice sessions only (json-int)
1811- "channel-id": channel id. Usually "0", might be different needed when
1812 multiple channels of the same type exist, such as multiple
1813 display channels in a multihead setup (json-int)
1814- "tls": whevener the channel is encrypted (json-bool)
1815
1816Example:
1817
1818-> { "execute": "query-spice" }
1819<- {
1820 "return": {
1821 "enabled": true,
1822 "auth": "spice",
1823 "port": 5920,
1824 "tls-port": 5921,
1825 "host": "0.0.0.0",
1826 "channels": [
1827 {
1828 "port": "54924",
1829 "family": "ipv4",
1830 "channel-type": 1,
1831 "connection-id": 1804289383,
1832 "host": "127.0.0.1",
1833 "channel-id": 0,
1834 "tls": true
1835 },
1836 {
1837 "port": "36710",
1838 "family": "ipv4",
1839 "channel-type": 4,
1840 "connection-id": 1804289383,
1841 "host": "127.0.0.1",
1842 "channel-id": 0,
1843 "tls": false
1844 },
1845 [ ... more channels follow ... ]
1846 ]
1847 }
1848 }
1849
1850EQMP
1851
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001852#if defined(CONFIG_SPICE)
1853 {
1854 .name = "query-spice",
1855 .args_type = "",
1856 .mhandler.cmd_new = qmp_marshal_input_query_spice,
1857 },
1858#endif
1859
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01001860SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001861query-name
1862----------
1863
1864Show VM name.
1865
1866Return a json-object with the following information:
1867
1868- "name": VM's name (json-string, optional)
1869
1870Example:
1871
1872-> { "execute": "query-name" }
1873<- { "return": { "name": "qemu-name" } }
1874
1875EQMP
1876
Anthony Liguori48a32be2011-09-02 12:34:48 -05001877 {
1878 .name = "query-name",
1879 .args_type = "",
1880 .mhandler.cmd_new = qmp_marshal_input_query_name,
1881 },
1882
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001883SQMP
1884query-uuid
1885----------
1886
1887Show VM UUID.
1888
1889Return a json-object with the following information:
1890
1891- "UUID": Universally Unique Identifier (json-string)
1892
1893Example:
1894
1895-> { "execute": "query-uuid" }
1896<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
1897
1898EQMP
1899
Luiz Capitulinoefab7672011-09-13 17:16:25 -03001900 {
1901 .name = "query-uuid",
1902 .args_type = "",
1903 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
1904 },
1905
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001906SQMP
1907query-migrate
1908-------------
1909
1910Migration status.
1911
1912Return a json-object. If migration is active there will be another json-object
1913with RAM migration status and if block migration is active another one with
1914block migration status.
1915
1916The main json-object contains the following:
1917
1918- "status": migration status (json-string)
1919 - Possible values: "active", "completed", "failed", "cancelled"
1920- "ram": only present if "status" is "active", it is a json-object with the
1921 following RAM information (in bytes):
1922 - "transferred": amount transferred (json-int)
1923 - "remaining": amount remaining (json-int)
1924 - "total": total (json-int)
1925- "disk": only present if "status" is "active" and it is a block migration,
1926 it is a json-object with the following disk information (in bytes):
1927 - "transferred": amount transferred (json-int)
1928 - "remaining": amount remaining (json-int)
1929 - "total": total (json-int)
1930
1931Examples:
1932
19331. Before the first migration
1934
1935-> { "execute": "query-migrate" }
1936<- { "return": {} }
1937
19382. Migration is done and has succeeded
1939
1940-> { "execute": "query-migrate" }
1941<- { "return": { "status": "completed" } }
1942
19433. Migration is done and has failed
1944
1945-> { "execute": "query-migrate" }
1946<- { "return": { "status": "failed" } }
1947
19484. Migration is being performed and is not a block migration:
1949
1950-> { "execute": "query-migrate" }
1951<- {
1952 "return":{
1953 "status":"active",
1954 "ram":{
1955 "transferred":123,
1956 "remaining":123,
1957 "total":246
1958 }
1959 }
1960 }
1961
19625. Migration is being performed and is a block migration:
1963
1964-> { "execute": "query-migrate" }
1965<- {
1966 "return":{
1967 "status":"active",
1968 "ram":{
1969 "total":1057024,
1970 "remaining":1053304,
1971 "transferred":3720
1972 },
1973 "disk":{
1974 "total":20971520,
1975 "remaining":20880384,
1976 "transferred":91136
1977 }
1978 }
1979 }
1980
1981EQMP
1982
Luiz Capitulino791e7c82011-09-13 17:37:16 -03001983 {
1984 .name = "query-migrate",
1985 .args_type = "",
1986 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
1987 },
1988
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001989SQMP
1990query-balloon
1991-------------
1992
1993Show balloon information.
1994
1995Make an asynchronous request for balloon info. When the request completes a
1996json-object will be returned containing the following data:
1997
1998- "actual": current balloon value in bytes (json-int)
1999- "mem_swapped_in": Amount of memory swapped in bytes (json-int, optional)
2000- "mem_swapped_out": Amount of memory swapped out in bytes (json-int, optional)
2001- "major_page_faults": Number of major faults (json-int, optional)
2002- "minor_page_faults": Number of minor faults (json-int, optional)
2003- "free_mem": Total amount of free and unused memory in
2004 bytes (json-int, optional)
2005- "total_mem": Total amount of available memory in bytes (json-int, optional)
2006
2007Example:
2008
2009-> { "execute": "query-balloon" }
2010<- {
2011 "return":{
2012 "actual":1073741824,
2013 "mem_swapped_in":0,
2014 "mem_swapped_out":0,
2015 "major_page_faults":142,
2016 "minor_page_faults":239245,
2017 "free_mem":1014185984,
2018 "total_mem":1044668416
2019 }
2020 }
2021
2022EQMP
2023
Luiz Capitulino96637bc2011-10-21 11:41:37 -02002024 {
2025 .name = "query-balloon",
2026 .args_type = "",
2027 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
2028 },