blob: 5eb4b76dfc99fda1a7208c584d10b9f5cc1e6fe6 [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 = "",
Luiz Capitulino6cdedb02011-11-27 22:54:09 -0200474 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300475 },
476
477SQMP
478migrate_cancel
479--------------
480
481Cancel the current migration.
482
483Arguments: None.
484
485Example:
486
487-> { "execute": "migrate_cancel" }
488<- { "return": {} }
489
490EQMP
491
492 {
493 .name = "migrate_set_speed",
Wen Congyang3a019b62010-11-25 09:06:05 +0800494 .args_type = "value:o",
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300495 .params = "value",
496 .help = "set maximum speed (in bytes) for migrations",
497 .user_print = monitor_user_noop,
498 .mhandler.cmd_new = do_migrate_set_speed,
499 },
500
501SQMP
502migrate_set_speed
503-----------------
504
505Set maximum speed for migrations.
506
507Arguments:
508
Luiz Capitulino5569fd72010-12-15 17:56:18 -0200509- "value": maximum speed, in bytes per second (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300510
511Example:
512
513-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
514<- { "return": {} }
515
516EQMP
517
518 {
519 .name = "migrate_set_downtime",
520 .args_type = "value:T",
521 .params = "value",
522 .help = "set maximum tolerated downtime (in seconds) for migrations",
523 .user_print = monitor_user_noop,
524 .mhandler.cmd_new = do_migrate_set_downtime,
525 },
526
527SQMP
528migrate_set_downtime
529--------------------
530
531Set maximum tolerated downtime (in seconds) for migrations.
532
533Arguments:
534
535- "value": maximum downtime (json-number)
536
537Example:
538
539-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
540<- { "return": {} }
541
542EQMP
543
544 {
Jes Sorensenff73edf2011-03-09 14:31:06 +0100545 .name = "client_migrate_info",
546 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
547 .params = "protocol hostname port tls-port cert-subject",
548 .help = "send migration info to spice/vnc client",
549 .user_print = monitor_user_noop,
Yonit Halperinedc5cb12011-10-17 10:03:18 +0200550 .mhandler.cmd_async = client_migrate_info,
551 .flags = MONITOR_CMD_ASYNC,
Jes Sorensenff73edf2011-03-09 14:31:06 +0100552 },
553
554SQMP
555client_migrate_info
556------------------
557
558Set the spice/vnc connection info for the migration target. The spice/vnc
559server will ask the spice/vnc client to automatically reconnect using the
560new parameters (if specified) once the vm migration finished successfully.
561
562Arguments:
563
564- "protocol": protocol: "spice" or "vnc" (json-string)
565- "hostname": migration target hostname (json-string)
566- "port": spice/vnc tcp port for plaintext channels (json-int, optional)
567- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
568- "cert-subject": server certificate subject (json-string, optional)
569
570Example:
571
572-> { "execute": "client_migrate_info",
573 "arguments": { "protocol": "spice",
574 "hostname": "virt42.lab.kraxel.org",
575 "port": 1234 } }
576<- { "return": {} }
577
578EQMP
579
580 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300581 .name = "netdev_add",
582 .args_type = "netdev:O",
583 .params = "[user|tap|socket],id=str[,prop=value][,...]",
584 .help = "add host network device",
585 .user_print = monitor_user_noop,
586 .mhandler.cmd_new = do_netdev_add,
587 },
588
589SQMP
590netdev_add
591----------
592
593Add host network device.
594
595Arguments:
596
597- "type": the device type, "tap", "user", ... (json-string)
598- "id": the device's ID, must be unique (json-string)
599- device options
600
601Example:
602
603-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
604<- { "return": {} }
605
606Note: The supported device options are the same ones supported by the '-net'
607 command-line argument, which are listed in the '-help' output or QEMU's
608 manual
609
610EQMP
611
612 {
613 .name = "netdev_del",
614 .args_type = "id:s",
615 .params = "id",
616 .help = "remove host network device",
617 .user_print = monitor_user_noop,
618 .mhandler.cmd_new = do_netdev_del,
619 },
620
621SQMP
622netdev_del
623----------
624
625Remove host network device.
626
627Arguments:
628
629- "id": the device's ID, must be unique (json-string)
630
631Example:
632
633-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
634<- { "return": {} }
635
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100636
637EQMP
638
639 {
640 .name = "block_resize",
641 .args_type = "device:B,size:o",
Luiz Capitulino5e7caac2011-11-25 14:57:10 -0200642 .mhandler.cmd_new = qmp_marshal_input_block_resize,
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100643 },
644
645SQMP
646block_resize
647------------
648
649Resize a block image while a guest is running.
650
651Arguments:
652
653- "device": the device's ID, must be unique (json-string)
654- "size": new size
655
656Example:
657
658-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
659<- { "return": {} }
660
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300661EQMP
662
663 {
Jes Sorensend967b2f2011-07-11 20:01:09 +0200664 .name = "blockdev-snapshot-sync",
Luiz Capitulino6106e242011-11-25 16:15:19 -0200665 .args_type = "device:B,snapshot-file:s,format:s?",
666 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
Jes Sorensend967b2f2011-07-11 20:01:09 +0200667 },
668
669SQMP
670blockdev-snapshot-sync
671----------------------
672
673Synchronous snapshot of a block device. snapshot-file specifies the
674target of the new image. If the file exists, or if it is a device, the
675snapshot will be created in the existing file/device. If does not
676exist, a new file will be created. format specifies the format of the
677snapshot image, default is qcow2.
678
679Arguments:
680
681- "device": device name to snapshot (json-string)
682- "snapshot-file": name of new image file (json-string)
683- "format": format of new image (json-string, optional)
684
685Example:
686
Luiz Capitulino7f3850c2011-10-10 17:30:08 -0300687-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
688 "snapshot-file":
689 "/some/place/my-image",
690 "format": "qcow2" } }
Jes Sorensend967b2f2011-07-11 20:01:09 +0200691<- { "return": {} }
692
693EQMP
694
695 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300696 .name = "balloon",
697 .args_type = "value:M",
Luiz Capitulinod72f3262011-11-25 14:38:09 -0200698 .mhandler.cmd_new = qmp_marshal_input_balloon,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300699 },
700
701SQMP
702balloon
703-------
704
705Request VM to change its memory allocation (in bytes).
706
707Arguments:
708
709- "value": New memory allocation (json-int)
710
711Example:
712
713-> { "execute": "balloon", "arguments": { "value": 536870912 } }
714<- { "return": {} }
715
716EQMP
717
718 {
719 .name = "set_link",
720 .args_type = "name:s,up:b",
Luiz Capitulino4b371562011-11-23 13:11:55 -0200721 .mhandler.cmd_new = qmp_marshal_input_set_link,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300722 },
723
724SQMP
725set_link
726--------
727
728Change the link status of a network adapter.
729
730Arguments:
731
732- "name": network device name (json-string)
733- "up": status is up (json-bool)
734
735Example:
736
737-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
738<- { "return": {} }
739
740EQMP
741
742 {
743 .name = "getfd",
744 .args_type = "fdname:s",
745 .params = "getfd name",
746 .help = "receive a file descriptor via SCM rights and assign it a name",
747 .user_print = monitor_user_noop,
748 .mhandler.cmd_new = do_getfd,
749 },
750
751SQMP
752getfd
753-----
754
755Receive a file descriptor via SCM rights and assign it a name.
756
757Arguments:
758
759- "fdname": file descriptor name (json-string)
760
761Example:
762
763-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
764<- { "return": {} }
765
766EQMP
767
768 {
769 .name = "closefd",
770 .args_type = "fdname:s",
771 .params = "closefd name",
772 .help = "close a file descriptor previously passed via SCM rights",
773 .user_print = monitor_user_noop,
774 .mhandler.cmd_new = do_closefd,
775 },
776
777SQMP
778closefd
779-------
780
781Close a file descriptor previously passed via SCM rights.
782
783Arguments:
784
785- "fdname": file descriptor name (json-string)
786
787Example:
788
789-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
790<- { "return": {} }
791
792EQMP
793
794 {
795 .name = "block_passwd",
796 .args_type = "device:B,password:s",
Luiz Capitulinoa4dea8a2011-11-23 13:28:21 -0200797 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300798 },
799
800SQMP
801block_passwd
802------------
803
804Set the password of encrypted block devices.
805
806Arguments:
807
808- "device": device name (json-string)
809- "password": password (json-string)
810
811Example:
812
813-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
814 "password": "12345" } }
815<- { "return": {} }
816
817EQMP
818
819 {
Zhi Yong Wu727f0052011-11-08 13:00:31 +0800820 .name = "block_set_io_throttle",
821 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
822 .params = "device bps bps_rd bps_wr iops iops_rd iops_wr",
823 .help = "change I/O throttle limits for a block drive",
824 .user_print = monitor_user_noop,
825 .mhandler.cmd_new = do_block_set_io_throttle,
826 },
827
828SQMP
829block_set_io_throttle
830------------
831
832Change I/O throttle limits for a block drive.
833
834Arguments:
835
836- "device": device name (json-string)
837- "bps": total throughput limit in bytes per second(json-int)
838- "bps_rd": read throughput limit in bytes per second(json-int)
839- "bps_wr": read throughput limit in bytes per second(json-int)
840- "iops": total I/O operations per second(json-int)
841- "iops_rd": read I/O operations per second(json-int)
842- "iops_wr": write I/O operations per second(json-int)
843
844Example:
845
846-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
847 "bps": "1000000",
848 "bps_rd": "0",
849 "bps_wr": "0",
850 "iops": "0",
851 "iops_rd": "0",
852 "iops_wr": "0" } }
853<- { "return": {} }
854
855EQMP
856
857 {
Gerd Hoffmann75721502010-10-07 12:22:54 +0200858 .name = "set_password",
859 .args_type = "protocol:s,password:s,connected:s?",
860 .params = "protocol password action-if-connected",
861 .help = "set spice/vnc password",
862 .user_print = monitor_user_noop,
863 .mhandler.cmd_new = set_password,
864 },
865
866SQMP
867set_password
868------------
869
870Set the password for vnc/spice protocols.
871
872Arguments:
873
874- "protocol": protocol name (json-string)
875- "password": password (json-string)
876- "connected": [ keep | disconnect | fail ] (josn-string, optional)
877
878Example:
879
880-> { "execute": "set_password", "arguments": { "protocol": "vnc",
881 "password": "secret" } }
882<- { "return": {} }
883
884EQMP
885
886 {
887 .name = "expire_password",
888 .args_type = "protocol:s,time:s",
889 .params = "protocol time",
890 .help = "set spice/vnc password expire-time",
891 .user_print = monitor_user_noop,
892 .mhandler.cmd_new = expire_password,
893 },
894
895SQMP
896expire_password
897---------------
898
899Set the password expire time for vnc/spice protocols.
900
901Arguments:
902
903- "protocol": protocol name (json-string)
904- "time": [ now | never | +secs | secs ] (json-string)
905
906Example:
907
908-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
909 "time": "+60" } }
910<- { "return": {} }
911
912EQMP
913
914 {
Daniel P. Berrange13661082011-06-23 13:31:42 +0100915 .name = "add_client",
916 .args_type = "protocol:s,fdname:s,skipauth:b?",
917 .params = "protocol fdname skipauth",
918 .help = "add a graphics client",
919 .user_print = monitor_user_noop,
920 .mhandler.cmd_new = add_graphics_client,
921 },
922
923SQMP
924add_client
925----------
926
927Add a graphics client
928
929Arguments:
930
931- "protocol": protocol name (json-string)
932- "fdname": file descriptor name (json-string)
933
934Example:
935
936-> { "execute": "add_client", "arguments": { "protocol": "vnc",
937 "fdname": "myclient" } }
938<- { "return": {} }
939
940EQMP
941 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300942 .name = "qmp_capabilities",
943 .args_type = "",
944 .params = "",
945 .help = "enable QMP capabilities",
946 .user_print = monitor_user_noop,
947 .mhandler.cmd_new = do_qmp_capabilities,
948 },
949
950SQMP
951qmp_capabilities
952----------------
953
954Enable QMP capabilities.
955
956Arguments: None.
957
958Example:
959
960-> { "execute": "qmp_capabilities" }
961<- { "return": {} }
962
963Note: This command must be issued before issuing any other command.
964
Luiz Capitulino0268d972010-10-22 10:08:02 -0200965EQMP
966
967 {
968 .name = "human-monitor-command",
969 .args_type = "command-line:s,cpu-index:i?",
Luiz Capitulinod51a67b2011-11-25 17:52:45 -0200970 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
Luiz Capitulino0268d972010-10-22 10:08:02 -0200971 },
972
973SQMP
974human-monitor-command
975---------------------
976
977Execute a Human Monitor command.
978
979Arguments:
980
981- command-line: the command name and its arguments, just like the
982 Human Monitor's shell (json-string)
983- cpu-index: select the CPU number to be used by commands which access CPU
984 data, like 'info registers'. The Monitor selects CPU 0 if this
985 argument is not provided (json-int, optional)
986
987Example:
988
989-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
990<- { "return": "kvm support: enabled\r\n" }
991
992Notes:
993
994(1) The Human Monitor is NOT an stable interface, this means that command
995 names, arguments and responses can change or be removed at ANY time.
996 Applications that rely on long term stability guarantees should NOT
997 use this command
998
999(2) Limitations:
1000
1001 o This command is stateless, this means that commands that depend
1002 on state information (such as getfd) might not work
1003
1004 o Commands that prompt the user for data (eg. 'cont' when the block
1005 device is encrypted) don't currently work
1006
Luiz Capitulino82a56f02010-09-13 12:26:00 -030010073. Query Commands
1008=================
1009
1010HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1011HXCOMM this! We will possibly move query commands definitions inside those
1012HXCOMM sections, just like regular commands.
1013
1014EQMP
1015
1016SQMP
1017query-version
1018-------------
1019
1020Show QEMU version.
1021
1022Return a json-object with the following information:
1023
1024- "qemu": A json-object containing three integer values:
1025 - "major": QEMU's major version (json-int)
1026 - "minor": QEMU's minor version (json-int)
1027 - "micro": QEMU's micro version (json-int)
1028- "package": package's version (json-string)
1029
1030Example:
1031
1032-> { "execute": "query-version" }
1033<- {
1034 "return":{
1035 "qemu":{
1036 "major":0,
1037 "minor":11,
1038 "micro":5
1039 },
1040 "package":""
1041 }
1042 }
1043
1044EQMP
1045
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03001046 {
1047 .name = "query-version",
1048 .args_type = "",
1049 .mhandler.cmd_new = qmp_marshal_input_query_version,
1050 },
1051
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001052SQMP
1053query-commands
1054--------------
1055
1056List QMP available commands.
1057
1058Each command is represented by a json-object, the returned value is a json-array
1059of all commands.
1060
1061Each json-object contain:
1062
1063- "name": command's name (json-string)
1064
1065Example:
1066
1067-> { "execute": "query-commands" }
1068<- {
1069 "return":[
1070 {
1071 "name":"query-balloon"
1072 },
1073 {
1074 "name":"system_powerdown"
1075 }
1076 ]
1077 }
1078
1079Note: This example has been shortened as the real response is too long.
1080
1081EQMP
1082
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03001083 {
1084 .name = "query-commands",
1085 .args_type = "",
1086 .mhandler.cmd_new = qmp_marshal_input_query_commands,
1087 },
1088
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001089SQMP
1090query-chardev
1091-------------
1092
1093Each device is represented by a json-object. The returned value is a json-array
1094of all devices.
1095
1096Each json-object contain the following:
1097
1098- "label": device's label (json-string)
1099- "filename": device's file (json-string)
1100
1101Example:
1102
1103-> { "execute": "query-chardev" }
1104<- {
1105 "return":[
1106 {
1107 "label":"monitor",
1108 "filename":"stdio"
1109 },
1110 {
1111 "label":"serial0",
1112 "filename":"vc"
1113 }
1114 ]
1115 }
1116
1117EQMP
1118
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03001119 {
1120 .name = "query-chardev",
1121 .args_type = "",
1122 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
1123 },
1124
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001125SQMP
1126query-block
1127-----------
1128
1129Show the block devices.
1130
1131Each block device information is stored in a json-object and the returned value
1132is a json-array of all devices.
1133
1134Each json-object contain the following:
1135
1136- "device": device name (json-string)
1137- "type": device type (json-string)
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001138 - deprecated, retained for backward compatibility
1139 - Possible values: "unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001140- "removable": true if the device is removable, false otherwise (json-bool)
1141- "locked": true if the device is locked, false otherwise (json-bool)
Markus Armbrustere4def802011-09-06 18:58:53 +02001142- "tray-open": only present if removable, true if the device has a tray,
1143 and it is open (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001144- "inserted": only present if the device is inserted, it is a json-object
1145 containing the following:
1146 - "file": device file name (json-string)
1147 - "ro": true if read-only, false otherwise (json-bool)
1148 - "drv": driver format name (json-string)
1149 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1150 "file", "file", "ftp", "ftps", "host_cdrom",
1151 "host_device", "host_floppy", "http", "https",
1152 "nbd", "parallels", "qcow", "qcow2", "raw",
1153 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1154 - "backing_file": backing file name (json-string, optional)
1155 - "encrypted": true if encrypted, false otherwise (json-bool)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001156 - "bps": limit total bytes per second (json-int)
1157 - "bps_rd": limit read bytes per second (json-int)
1158 - "bps_wr": limit write bytes per second (json-int)
1159 - "iops": limit total I/O operations per second (json-int)
1160 - "iops_rd": limit read operations per second (json-int)
1161 - "iops_wr": limit write operations per second (json-int)
1162
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001163- "io-status": I/O operation status, only present if the device supports it
1164 and the VM is configured to stop on errors. It's always reset
1165 to "ok" when the "cont" command is issued (json_string, optional)
1166 - Possible values: "ok", "failed", "nospace"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001167
1168Example:
1169
1170-> { "execute": "query-block" }
1171<- {
1172 "return":[
1173 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001174 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001175 "device":"ide0-hd0",
1176 "locked":false,
1177 "removable":false,
1178 "inserted":{
1179 "ro":false,
1180 "drv":"qcow2",
1181 "encrypted":false,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001182 "file":"disks/test.img",
1183 "bps":1000000,
1184 "bps_rd":0,
1185 "bps_wr":0,
1186 "iops":1000000,
1187 "iops_rd":0,
1188 "iops_wr":0,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001189 },
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001190 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001191 },
1192 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001193 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001194 "device":"ide1-cd0",
1195 "locked":false,
1196 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001197 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001198 },
1199 {
1200 "device":"floppy0",
1201 "locked":false,
1202 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001203 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001204 },
1205 {
1206 "device":"sd0",
1207 "locked":false,
1208 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001209 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001210 }
1211 ]
1212 }
1213
1214EQMP
1215
Luiz Capitulinob2023812011-09-21 17:16:47 -03001216 {
1217 .name = "query-block",
1218 .args_type = "",
1219 .mhandler.cmd_new = qmp_marshal_input_query_block,
1220 },
1221
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001222SQMP
1223query-blockstats
1224----------------
1225
1226Show block device statistics.
1227
1228Each device statistic information is stored in a json-object and the returned
1229value is a json-array of all devices.
1230
1231Each json-object contain the following:
1232
1233- "device": device name (json-string)
1234- "stats": A json-object with the statistics information, it contains:
1235 - "rd_bytes": bytes read (json-int)
1236 - "wr_bytes": bytes written (json-int)
1237 - "rd_operations": read operations (json-int)
1238 - "wr_operations": write operations (json-int)
Christoph Hellwige8045d62011-08-22 00:25:58 +02001239 - "flush_operations": cache flush operations (json-int)
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001240 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1241 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1242 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001243 - "wr_highest_offset": Highest offset of a sector written since the
1244 BlockDriverState has been opened (json-int)
1245- "parent": Contains recursively the statistics of the underlying
1246 protocol (e.g. the host file for a qcow2 image). If there is
1247 no underlying protocol, this field is omitted
1248 (json-object, optional)
1249
1250Example:
1251
1252-> { "execute": "query-blockstats" }
1253<- {
1254 "return":[
1255 {
1256 "device":"ide0-hd0",
1257 "parent":{
1258 "stats":{
1259 "wr_highest_offset":3686448128,
1260 "wr_bytes":9786368,
1261 "wr_operations":751,
1262 "rd_bytes":122567168,
1263 "rd_operations":36772
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001264 "wr_total_times_ns":313253456
1265 "rd_total_times_ns":3465673657
1266 "flush_total_times_ns":49653
Christoph Hellwige8045d62011-08-22 00:25:58 +02001267 "flush_operations":61,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001268 }
1269 },
1270 "stats":{
1271 "wr_highest_offset":2821110784,
1272 "wr_bytes":9786368,
1273 "wr_operations":692,
1274 "rd_bytes":122739200,
1275 "rd_operations":36604
Christoph Hellwige8045d62011-08-22 00:25:58 +02001276 "flush_operations":51,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001277 "wr_total_times_ns":313253456
1278 "rd_total_times_ns":3465673657
1279 "flush_total_times_ns":49653
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001280 }
1281 },
1282 {
1283 "device":"ide1-cd0",
1284 "stats":{
1285 "wr_highest_offset":0,
1286 "wr_bytes":0,
1287 "wr_operations":0,
1288 "rd_bytes":0,
1289 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001290 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001291 "wr_total_times_ns":0
1292 "rd_total_times_ns":0
1293 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001294 }
1295 },
1296 {
1297 "device":"floppy0",
1298 "stats":{
1299 "wr_highest_offset":0,
1300 "wr_bytes":0,
1301 "wr_operations":0,
1302 "rd_bytes":0,
1303 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001304 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001305 "wr_total_times_ns":0
1306 "rd_total_times_ns":0
1307 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001308 }
1309 },
1310 {
1311 "device":"sd0",
1312 "stats":{
1313 "wr_highest_offset":0,
1314 "wr_bytes":0,
1315 "wr_operations":0,
1316 "rd_bytes":0,
1317 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001318 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001319 "wr_total_times_ns":0
1320 "rd_total_times_ns":0
1321 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001322 }
1323 }
1324 ]
1325 }
1326
1327EQMP
1328
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03001329 {
1330 .name = "query-blockstats",
1331 .args_type = "",
1332 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
1333 },
1334
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001335SQMP
1336query-cpus
1337----------
1338
1339Show CPU information.
1340
1341Return a json-array. Each CPU is represented by a json-object, which contains:
1342
1343- "CPU": CPU index (json-int)
1344- "current": true if this is the current CPU, false otherwise (json-bool)
1345- "halted": true if the cpu is halted, false otherwise (json-bool)
1346- Current program counter. The key's name depends on the architecture:
1347 "pc": i386/x86_64 (json-int)
1348 "nip": PPC (json-int)
1349 "pc" and "npc": sparc (json-int)
1350 "PC": mips (json-int)
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001351- "thread_id": ID of the underlying host thread (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001352
1353Example:
1354
1355-> { "execute": "query-cpus" }
1356<- {
1357 "return":[
1358 {
1359 "CPU":0,
1360 "current":true,
1361 "halted":false,
1362 "pc":3227107138
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001363 "thread_id":3134
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001364 },
1365 {
1366 "CPU":1,
1367 "current":false,
1368 "halted":true,
1369 "pc":7108165
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001370 "thread_id":3135
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001371 }
1372 ]
1373 }
1374
1375EQMP
1376
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03001377 {
1378 .name = "query-cpus",
1379 .args_type = "",
1380 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
1381 },
1382
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001383SQMP
1384query-pci
1385---------
1386
1387PCI buses and devices information.
1388
1389The returned value is a json-array of all buses. Each bus is represented by
1390a json-object, which has a key with a json-array of all PCI devices attached
1391to it. Each device is represented by a json-object.
1392
1393The bus json-object contains the following:
1394
1395- "bus": bus number (json-int)
1396- "devices": a json-array of json-objects, each json-object represents a
1397 PCI device
1398
1399The PCI device json-object contains the following:
1400
1401- "bus": identical to the parent's bus number (json-int)
1402- "slot": slot number (json-int)
1403- "function": function number (json-int)
1404- "class_info": a json-object containing:
1405 - "desc": device class description (json-string, optional)
1406 - "class": device class number (json-int)
1407- "id": a json-object containing:
1408 - "device": device ID (json-int)
1409 - "vendor": vendor ID (json-int)
1410- "irq": device's IRQ if assigned (json-int, optional)
1411- "qdev_id": qdev id string (json-string)
1412- "pci_bridge": It's a json-object, only present if this device is a
1413 PCI bridge, contains:
1414 - "bus": bus number (json-int)
1415 - "secondary": secondary bus number (json-int)
1416 - "subordinate": subordinate bus number (json-int)
1417 - "io_range": I/O memory range information, a json-object with the
1418 following members:
1419 - "base": base address, in bytes (json-int)
1420 - "limit": limit address, in bytes (json-int)
1421 - "memory_range": memory range information, a json-object with the
1422 following members:
1423 - "base": base address, in bytes (json-int)
1424 - "limit": limit address, in bytes (json-int)
1425 - "prefetchable_range": Prefetchable memory range information, a
1426 json-object with the following members:
1427 - "base": base address, in bytes (json-int)
1428 - "limit": limit address, in bytes (json-int)
1429 - "devices": a json-array of PCI devices if there's any attached, each
1430 each element is represented by a json-object, which contains
1431 the same members of the 'PCI device json-object' described
1432 above (optional)
1433- "regions": a json-array of json-objects, each json-object represents a
1434 memory region of this device
1435
1436The memory range json-object contains the following:
1437
1438- "base": base memory address (json-int)
1439- "limit": limit value (json-int)
1440
1441The region json-object can be an I/O region or a memory region, an I/O region
1442json-object contains the following:
1443
1444- "type": "io" (json-string, fixed)
1445- "bar": BAR number (json-int)
1446- "address": memory address (json-int)
1447- "size": memory size (json-int)
1448
1449A memory region json-object contains the following:
1450
1451- "type": "memory" (json-string, fixed)
1452- "bar": BAR number (json-int)
1453- "address": memory address (json-int)
1454- "size": memory size (json-int)
1455- "mem_type_64": true or false (json-bool)
1456- "prefetch": true or false (json-bool)
1457
1458Example:
1459
1460-> { "execute": "query-pci" }
1461<- {
1462 "return":[
1463 {
1464 "bus":0,
1465 "devices":[
1466 {
1467 "bus":0,
1468 "qdev_id":"",
1469 "slot":0,
1470 "class_info":{
1471 "class":1536,
1472 "desc":"Host bridge"
1473 },
1474 "id":{
1475 "device":32902,
1476 "vendor":4663
1477 },
1478 "function":0,
1479 "regions":[
1480
1481 ]
1482 },
1483 {
1484 "bus":0,
1485 "qdev_id":"",
1486 "slot":1,
1487 "class_info":{
1488 "class":1537,
1489 "desc":"ISA bridge"
1490 },
1491 "id":{
1492 "device":32902,
1493 "vendor":28672
1494 },
1495 "function":0,
1496 "regions":[
1497
1498 ]
1499 },
1500 {
1501 "bus":0,
1502 "qdev_id":"",
1503 "slot":1,
1504 "class_info":{
1505 "class":257,
1506 "desc":"IDE controller"
1507 },
1508 "id":{
1509 "device":32902,
1510 "vendor":28688
1511 },
1512 "function":1,
1513 "regions":[
1514 {
1515 "bar":4,
1516 "size":16,
1517 "address":49152,
1518 "type":"io"
1519 }
1520 ]
1521 },
1522 {
1523 "bus":0,
1524 "qdev_id":"",
1525 "slot":2,
1526 "class_info":{
1527 "class":768,
1528 "desc":"VGA controller"
1529 },
1530 "id":{
1531 "device":4115,
1532 "vendor":184
1533 },
1534 "function":0,
1535 "regions":[
1536 {
1537 "prefetch":true,
1538 "mem_type_64":false,
1539 "bar":0,
1540 "size":33554432,
1541 "address":4026531840,
1542 "type":"memory"
1543 },
1544 {
1545 "prefetch":false,
1546 "mem_type_64":false,
1547 "bar":1,
1548 "size":4096,
1549 "address":4060086272,
1550 "type":"memory"
1551 },
1552 {
1553 "prefetch":false,
1554 "mem_type_64":false,
1555 "bar":6,
1556 "size":65536,
1557 "address":-1,
1558 "type":"memory"
1559 }
1560 ]
1561 },
1562 {
1563 "bus":0,
1564 "qdev_id":"",
1565 "irq":11,
1566 "slot":4,
1567 "class_info":{
1568 "class":1280,
1569 "desc":"RAM controller"
1570 },
1571 "id":{
1572 "device":6900,
1573 "vendor":4098
1574 },
1575 "function":0,
1576 "regions":[
1577 {
1578 "bar":0,
1579 "size":32,
1580 "address":49280,
1581 "type":"io"
1582 }
1583 ]
1584 }
1585 ]
1586 }
1587 ]
1588 }
1589
1590Note: This example has been shortened as the real response is too long.
1591
1592EQMP
1593
Luiz Capitulino79627472011-10-21 14:15:33 -02001594 {
1595 .name = "query-pci",
1596 .args_type = "",
1597 .mhandler.cmd_new = qmp_marshal_input_query_pci,
1598 },
1599
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001600SQMP
1601query-kvm
1602---------
1603
1604Show KVM information.
1605
1606Return a json-object with the following information:
1607
1608- "enabled": true if KVM support is enabled, false otherwise (json-bool)
1609- "present": true if QEMU has KVM support, false otherwise (json-bool)
1610
1611Example:
1612
1613-> { "execute": "query-kvm" }
1614<- { "return": { "enabled": true, "present": true } }
1615
1616EQMP
1617
Luiz Capitulino292a2602011-09-12 15:10:53 -03001618 {
1619 .name = "query-kvm",
1620 .args_type = "",
1621 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
1622 },
1623
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001624SQMP
1625query-status
1626------------
1627
1628Return a json-object with the following information:
1629
1630- "running": true if the VM is running, or false if it is paused (json-bool)
1631- "singlestep": true if the VM is in single step mode,
1632 false otherwise (json-bool)
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03001633- "status": one of the following values (json-string)
1634 "debug" - QEMU is running on a debugger
1635 "inmigrate" - guest is paused waiting for an incoming migration
1636 "internal-error" - An internal error that prevents further guest
1637 execution has occurred
1638 "io-error" - the last IOP has failed and the device is configured
1639 to pause on I/O errors
1640 "paused" - guest has been paused via the 'stop' command
1641 "postmigrate" - guest is paused following a successful 'migrate'
1642 "prelaunch" - QEMU was started with -S and guest has not started
1643 "finish-migrate" - guest is paused to finish the migration process
1644 "restore-vm" - guest is paused to restore VM state
1645 "running" - guest is actively running
1646 "save-vm" - guest is paused to save the VM state
1647 "shutdown" - guest is shut down (and -no-shutdown is in use)
1648 "watchdog" - the watchdog action is configured to pause and
1649 has been triggered
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001650
1651Example:
1652
1653-> { "execute": "query-status" }
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03001654<- { "return": { "running": true, "singlestep": false, "status": "running" } }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001655
1656EQMP
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03001657
1658 {
1659 .name = "query-status",
1660 .args_type = "",
1661 .mhandler.cmd_new = qmp_marshal_input_query_status,
1662 },
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001663
1664SQMP
1665query-mice
1666----------
1667
1668Show VM mice information.
1669
1670Each mouse is represented by a json-object, the returned value is a json-array
1671of all mice.
1672
1673The mouse json-object contains the following:
1674
1675- "name": mouse's name (json-string)
1676- "index": mouse's index (json-int)
1677- "current": true if this mouse is receiving events, false otherwise (json-bool)
1678- "absolute": true if the mouse generates absolute input events (json-bool)
1679
1680Example:
1681
1682-> { "execute": "query-mice" }
1683<- {
1684 "return":[
1685 {
1686 "name":"QEMU Microsoft Mouse",
1687 "index":0,
1688 "current":false,
1689 "absolute":false
1690 },
1691 {
1692 "name":"QEMU PS/2 Mouse",
1693 "index":1,
1694 "current":true,
1695 "absolute":true
1696 }
1697 ]
1698 }
1699
1700EQMP
1701
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03001702 {
1703 .name = "query-mice",
1704 .args_type = "",
1705 .mhandler.cmd_new = qmp_marshal_input_query_mice,
1706 },
1707
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001708SQMP
1709query-vnc
1710---------
1711
1712Show VNC server information.
1713
1714Return a json-object with server information. Connected clients are returned
1715as a json-array of json-objects.
1716
1717The main json-object contains the following:
1718
1719- "enabled": true or false (json-bool)
1720- "host": server's IP address (json-string)
1721- "family": address family (json-string)
1722 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1723- "service": server's port number (json-string)
1724- "auth": authentication method (json-string)
1725 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
1726 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
1727 "vencrypt+plain", "vencrypt+tls+none",
1728 "vencrypt+tls+plain", "vencrypt+tls+sasl",
1729 "vencrypt+tls+vnc", "vencrypt+x509+none",
1730 "vencrypt+x509+plain", "vencrypt+x509+sasl",
1731 "vencrypt+x509+vnc", "vnc"
1732- "clients": a json-array of all connected clients
1733
1734Clients are described by a json-object, each one contain the following:
1735
1736- "host": client's IP address (json-string)
1737- "family": address family (json-string)
1738 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1739- "service": client's port number (json-string)
1740- "x509_dname": TLS dname (json-string, optional)
1741- "sasl_username": SASL username (json-string, optional)
1742
1743Example:
1744
1745-> { "execute": "query-vnc" }
1746<- {
1747 "return":{
1748 "enabled":true,
1749 "host":"0.0.0.0",
1750 "service":"50402",
1751 "auth":"vnc",
1752 "family":"ipv4",
1753 "clients":[
1754 {
1755 "host":"127.0.0.1",
1756 "service":"50401",
1757 "family":"ipv4"
1758 }
1759 ]
1760 }
1761 }
1762
1763EQMP
1764
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02001765 {
1766 .name = "query-vnc",
1767 .args_type = "",
1768 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
1769 },
1770
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001771SQMP
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01001772query-spice
1773-----------
1774
1775Show SPICE server information.
1776
1777Return a json-object with server information. Connected clients are returned
1778as a json-array of json-objects.
1779
1780The main json-object contains the following:
1781
1782- "enabled": true or false (json-bool)
1783- "host": server's IP address (json-string)
1784- "port": server's port number (json-int, optional)
1785- "tls-port": server's port number (json-int, optional)
1786- "auth": authentication method (json-string)
1787 - Possible values: "none", "spice"
1788- "channels": a json-array of all active channels clients
1789
1790Channels are described by a json-object, each one contain the following:
1791
1792- "host": client's IP address (json-string)
1793- "family": address family (json-string)
1794 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1795- "port": client's port number (json-string)
1796- "connection-id": spice connection id. All channels with the same id
1797 belong to the same spice session (json-int)
1798- "channel-type": channel type. "1" is the main control channel, filter for
1799 this one if you want track spice sessions only (json-int)
1800- "channel-id": channel id. Usually "0", might be different needed when
1801 multiple channels of the same type exist, such as multiple
1802 display channels in a multihead setup (json-int)
1803- "tls": whevener the channel is encrypted (json-bool)
1804
1805Example:
1806
1807-> { "execute": "query-spice" }
1808<- {
1809 "return": {
1810 "enabled": true,
1811 "auth": "spice",
1812 "port": 5920,
1813 "tls-port": 5921,
1814 "host": "0.0.0.0",
1815 "channels": [
1816 {
1817 "port": "54924",
1818 "family": "ipv4",
1819 "channel-type": 1,
1820 "connection-id": 1804289383,
1821 "host": "127.0.0.1",
1822 "channel-id": 0,
1823 "tls": true
1824 },
1825 {
1826 "port": "36710",
1827 "family": "ipv4",
1828 "channel-type": 4,
1829 "connection-id": 1804289383,
1830 "host": "127.0.0.1",
1831 "channel-id": 0,
1832 "tls": false
1833 },
1834 [ ... more channels follow ... ]
1835 ]
1836 }
1837 }
1838
1839EQMP
1840
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001841#if defined(CONFIG_SPICE)
1842 {
1843 .name = "query-spice",
1844 .args_type = "",
1845 .mhandler.cmd_new = qmp_marshal_input_query_spice,
1846 },
1847#endif
1848
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01001849SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001850query-name
1851----------
1852
1853Show VM name.
1854
1855Return a json-object with the following information:
1856
1857- "name": VM's name (json-string, optional)
1858
1859Example:
1860
1861-> { "execute": "query-name" }
1862<- { "return": { "name": "qemu-name" } }
1863
1864EQMP
1865
Anthony Liguori48a32be2011-09-02 12:34:48 -05001866 {
1867 .name = "query-name",
1868 .args_type = "",
1869 .mhandler.cmd_new = qmp_marshal_input_query_name,
1870 },
1871
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001872SQMP
1873query-uuid
1874----------
1875
1876Show VM UUID.
1877
1878Return a json-object with the following information:
1879
1880- "UUID": Universally Unique Identifier (json-string)
1881
1882Example:
1883
1884-> { "execute": "query-uuid" }
1885<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
1886
1887EQMP
1888
Luiz Capitulinoefab7672011-09-13 17:16:25 -03001889 {
1890 .name = "query-uuid",
1891 .args_type = "",
1892 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
1893 },
1894
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001895SQMP
1896query-migrate
1897-------------
1898
1899Migration status.
1900
1901Return a json-object. If migration is active there will be another json-object
1902with RAM migration status and if block migration is active another one with
1903block migration status.
1904
1905The main json-object contains the following:
1906
1907- "status": migration status (json-string)
1908 - Possible values: "active", "completed", "failed", "cancelled"
1909- "ram": only present if "status" is "active", it is a json-object with the
1910 following RAM information (in bytes):
1911 - "transferred": amount transferred (json-int)
1912 - "remaining": amount remaining (json-int)
1913 - "total": total (json-int)
1914- "disk": only present if "status" is "active" and it is a block migration,
1915 it is a json-object with the following disk information (in bytes):
1916 - "transferred": amount transferred (json-int)
1917 - "remaining": amount remaining (json-int)
1918 - "total": total (json-int)
1919
1920Examples:
1921
19221. Before the first migration
1923
1924-> { "execute": "query-migrate" }
1925<- { "return": {} }
1926
19272. Migration is done and has succeeded
1928
1929-> { "execute": "query-migrate" }
1930<- { "return": { "status": "completed" } }
1931
19323. Migration is done and has failed
1933
1934-> { "execute": "query-migrate" }
1935<- { "return": { "status": "failed" } }
1936
19374. Migration is being performed and is not a block migration:
1938
1939-> { "execute": "query-migrate" }
1940<- {
1941 "return":{
1942 "status":"active",
1943 "ram":{
1944 "transferred":123,
1945 "remaining":123,
1946 "total":246
1947 }
1948 }
1949 }
1950
19515. Migration is being performed and is a block migration:
1952
1953-> { "execute": "query-migrate" }
1954<- {
1955 "return":{
1956 "status":"active",
1957 "ram":{
1958 "total":1057024,
1959 "remaining":1053304,
1960 "transferred":3720
1961 },
1962 "disk":{
1963 "total":20971520,
1964 "remaining":20880384,
1965 "transferred":91136
1966 }
1967 }
1968 }
1969
1970EQMP
1971
Luiz Capitulino791e7c82011-09-13 17:37:16 -03001972 {
1973 .name = "query-migrate",
1974 .args_type = "",
1975 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
1976 },
1977
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001978SQMP
1979query-balloon
1980-------------
1981
1982Show balloon information.
1983
1984Make an asynchronous request for balloon info. When the request completes a
1985json-object will be returned containing the following data:
1986
1987- "actual": current balloon value in bytes (json-int)
1988- "mem_swapped_in": Amount of memory swapped in bytes (json-int, optional)
1989- "mem_swapped_out": Amount of memory swapped out in bytes (json-int, optional)
1990- "major_page_faults": Number of major faults (json-int, optional)
1991- "minor_page_faults": Number of minor faults (json-int, optional)
1992- "free_mem": Total amount of free and unused memory in
1993 bytes (json-int, optional)
1994- "total_mem": Total amount of available memory in bytes (json-int, optional)
1995
1996Example:
1997
1998-> { "execute": "query-balloon" }
1999<- {
2000 "return":{
2001 "actual":1073741824,
2002 "mem_swapped_in":0,
2003 "mem_swapped_out":0,
2004 "major_page_faults":142,
2005 "minor_page_faults":239245,
2006 "free_mem":1014185984,
2007 "total_mem":1044668416
2008 }
2009 }
2010
2011EQMP
2012
Luiz Capitulino96637bc2011-10-21 11:41:37 -02002013 {
2014 .name = "query-balloon",
2015 .args_type = "",
2016 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
2017 },