blob: 03b261710c63f5c01aaae6081e86699d38cb8493 [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 = "",
410 .params = "",
411 .help = "",
412 .user_print = monitor_user_noop,
Luiz Capitulinoe9b4b432011-04-29 12:11:50 -0300413 .mhandler.cmd_new = do_inject_nmi,
Lai Jiangshana4046662011-03-07 17:05:15 +0800414 },
415
416SQMP
417inject-nmi
418----------
419
420Inject an NMI on guest's CPUs.
421
422Arguments: None.
423
424Example:
425
426-> { "execute": "inject-nmi" }
427<- { "return": {} }
428
429Note: inject-nmi is only supported for x86 guest currently, it will
430 returns "Unsupported" error for non-x86 guest.
431
432EQMP
433
434 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300435 .name = "migrate",
436 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
437 .params = "[-d] [-b] [-i] uri",
438 .help = "migrate to URI (using -d to not wait for completion)"
439 "\n\t\t\t -b for migration without shared storage with"
440 " full copy of disk\n\t\t\t -i for migration without "
441 "shared storage with incremental copy of disk "
442 "(base image shared between src and destination)",
443 .user_print = monitor_user_noop,
444 .mhandler.cmd_new = do_migrate,
445 },
446
447SQMP
448migrate
449-------
450
451Migrate to URI.
452
453Arguments:
454
455- "blk": block migration, full disk copy (json-bool, optional)
456- "inc": incremental disk copy (json-bool, optional)
457- "uri": Destination URI (json-string)
458
459Example:
460
461-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
462<- { "return": {} }
463
464Notes:
465
466(1) The 'query-migrate' command should be used to check migration's progress
467 and final result (this information is provided by the 'status' member)
468(2) All boolean arguments default to false
469(3) The user Monitor's "detach" argument is invalid in QMP and should not
470 be used
471
472EQMP
473
474 {
475 .name = "migrate_cancel",
476 .args_type = "",
477 .params = "",
478 .help = "cancel the current VM migration",
479 .user_print = monitor_user_noop,
480 .mhandler.cmd_new = do_migrate_cancel,
481 },
482
483SQMP
484migrate_cancel
485--------------
486
487Cancel the current migration.
488
489Arguments: None.
490
491Example:
492
493-> { "execute": "migrate_cancel" }
494<- { "return": {} }
495
496EQMP
497
498 {
499 .name = "migrate_set_speed",
Wen Congyang3a019b62010-11-25 09:06:05 +0800500 .args_type = "value:o",
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300501 .params = "value",
502 .help = "set maximum speed (in bytes) for migrations",
503 .user_print = monitor_user_noop,
504 .mhandler.cmd_new = do_migrate_set_speed,
505 },
506
507SQMP
508migrate_set_speed
509-----------------
510
511Set maximum speed for migrations.
512
513Arguments:
514
Luiz Capitulino5569fd72010-12-15 17:56:18 -0200515- "value": maximum speed, in bytes per second (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300516
517Example:
518
519-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
520<- { "return": {} }
521
522EQMP
523
524 {
525 .name = "migrate_set_downtime",
526 .args_type = "value:T",
527 .params = "value",
528 .help = "set maximum tolerated downtime (in seconds) for migrations",
529 .user_print = monitor_user_noop,
530 .mhandler.cmd_new = do_migrate_set_downtime,
531 },
532
533SQMP
534migrate_set_downtime
535--------------------
536
537Set maximum tolerated downtime (in seconds) for migrations.
538
539Arguments:
540
541- "value": maximum downtime (json-number)
542
543Example:
544
545-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
546<- { "return": {} }
547
548EQMP
549
550 {
Jes Sorensenff73edf2011-03-09 14:31:06 +0100551 .name = "client_migrate_info",
552 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
553 .params = "protocol hostname port tls-port cert-subject",
554 .help = "send migration info to spice/vnc client",
555 .user_print = monitor_user_noop,
Yonit Halperinedc5cb12011-10-17 10:03:18 +0200556 .mhandler.cmd_async = client_migrate_info,
557 .flags = MONITOR_CMD_ASYNC,
Jes Sorensenff73edf2011-03-09 14:31:06 +0100558 },
559
560SQMP
561client_migrate_info
562------------------
563
564Set the spice/vnc connection info for the migration target. The spice/vnc
565server will ask the spice/vnc client to automatically reconnect using the
566new parameters (if specified) once the vm migration finished successfully.
567
568Arguments:
569
570- "protocol": protocol: "spice" or "vnc" (json-string)
571- "hostname": migration target hostname (json-string)
572- "port": spice/vnc tcp port for plaintext channels (json-int, optional)
573- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
574- "cert-subject": server certificate subject (json-string, optional)
575
576Example:
577
578-> { "execute": "client_migrate_info",
579 "arguments": { "protocol": "spice",
580 "hostname": "virt42.lab.kraxel.org",
581 "port": 1234 } }
582<- { "return": {} }
583
584EQMP
585
586 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300587 .name = "netdev_add",
588 .args_type = "netdev:O",
589 .params = "[user|tap|socket],id=str[,prop=value][,...]",
590 .help = "add host network device",
591 .user_print = monitor_user_noop,
592 .mhandler.cmd_new = do_netdev_add,
593 },
594
595SQMP
596netdev_add
597----------
598
599Add host network device.
600
601Arguments:
602
603- "type": the device type, "tap", "user", ... (json-string)
604- "id": the device's ID, must be unique (json-string)
605- device options
606
607Example:
608
609-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
610<- { "return": {} }
611
612Note: The supported device options are the same ones supported by the '-net'
613 command-line argument, which are listed in the '-help' output or QEMU's
614 manual
615
616EQMP
617
618 {
619 .name = "netdev_del",
620 .args_type = "id:s",
621 .params = "id",
622 .help = "remove host network device",
623 .user_print = monitor_user_noop,
624 .mhandler.cmd_new = do_netdev_del,
625 },
626
627SQMP
628netdev_del
629----------
630
631Remove host network device.
632
633Arguments:
634
635- "id": the device's ID, must be unique (json-string)
636
637Example:
638
639-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
640<- { "return": {} }
641
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100642
643EQMP
644
645 {
646 .name = "block_resize",
647 .args_type = "device:B,size:o",
648 .params = "device size",
649 .help = "resize a block image",
650 .user_print = monitor_user_noop,
651 .mhandler.cmd_new = do_block_resize,
652 },
653
654SQMP
655block_resize
656------------
657
658Resize a block image while a guest is running.
659
660Arguments:
661
662- "device": the device's ID, must be unique (json-string)
663- "size": new size
664
665Example:
666
667-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
668<- { "return": {} }
669
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300670EQMP
671
672 {
Jes Sorensend967b2f2011-07-11 20:01:09 +0200673 .name = "blockdev-snapshot-sync",
674 .args_type = "device:B,snapshot-file:s?,format:s?",
675 .params = "device [new-image-file] [format]",
676 .user_print = monitor_user_noop,
677 .mhandler.cmd_new = do_snapshot_blkdev,
678 },
679
680SQMP
681blockdev-snapshot-sync
682----------------------
683
684Synchronous snapshot of a block device. snapshot-file specifies the
685target of the new image. If the file exists, or if it is a device, the
686snapshot will be created in the existing file/device. If does not
687exist, a new file will be created. format specifies the format of the
688snapshot image, default is qcow2.
689
690Arguments:
691
692- "device": device name to snapshot (json-string)
693- "snapshot-file": name of new image file (json-string)
694- "format": format of new image (json-string, optional)
695
696Example:
697
Luiz Capitulino7f3850c2011-10-10 17:30:08 -0300698-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
699 "snapshot-file":
700 "/some/place/my-image",
701 "format": "qcow2" } }
Jes Sorensend967b2f2011-07-11 20:01:09 +0200702<- { "return": {} }
703
704EQMP
705
706 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300707 .name = "balloon",
708 .args_type = "value:M",
709 .params = "target",
710 .help = "request VM to change its memory allocation (in MB)",
711 .user_print = monitor_user_noop,
712 .mhandler.cmd_async = do_balloon,
713 .flags = MONITOR_CMD_ASYNC,
714 },
715
716SQMP
717balloon
718-------
719
720Request VM to change its memory allocation (in bytes).
721
722Arguments:
723
724- "value": New memory allocation (json-int)
725
726Example:
727
728-> { "execute": "balloon", "arguments": { "value": 536870912 } }
729<- { "return": {} }
730
731EQMP
732
733 {
734 .name = "set_link",
735 .args_type = "name:s,up:b",
736 .params = "name on|off",
737 .help = "change the link status of a network adapter",
738 .user_print = monitor_user_noop,
739 .mhandler.cmd_new = do_set_link,
740 },
741
742SQMP
743set_link
744--------
745
746Change the link status of a network adapter.
747
748Arguments:
749
750- "name": network device name (json-string)
751- "up": status is up (json-bool)
752
753Example:
754
755-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
756<- { "return": {} }
757
758EQMP
759
760 {
761 .name = "getfd",
762 .args_type = "fdname:s",
763 .params = "getfd name",
764 .help = "receive a file descriptor via SCM rights and assign it a name",
765 .user_print = monitor_user_noop,
766 .mhandler.cmd_new = do_getfd,
767 },
768
769SQMP
770getfd
771-----
772
773Receive a file descriptor via SCM rights and assign it a name.
774
775Arguments:
776
777- "fdname": file descriptor name (json-string)
778
779Example:
780
781-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
782<- { "return": {} }
783
784EQMP
785
786 {
787 .name = "closefd",
788 .args_type = "fdname:s",
789 .params = "closefd name",
790 .help = "close a file descriptor previously passed via SCM rights",
791 .user_print = monitor_user_noop,
792 .mhandler.cmd_new = do_closefd,
793 },
794
795SQMP
796closefd
797-------
798
799Close a file descriptor previously passed via SCM rights.
800
801Arguments:
802
803- "fdname": file descriptor name (json-string)
804
805Example:
806
807-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
808<- { "return": {} }
809
810EQMP
811
812 {
813 .name = "block_passwd",
814 .args_type = "device:B,password:s",
815 .params = "block_passwd device password",
816 .help = "set the password of encrypted block devices",
817 .user_print = monitor_user_noop,
818 .mhandler.cmd_new = do_block_set_passwd,
819 },
820
821SQMP
822block_passwd
823------------
824
825Set the password of encrypted block devices.
826
827Arguments:
828
829- "device": device name (json-string)
830- "password": password (json-string)
831
832Example:
833
834-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
835 "password": "12345" } }
836<- { "return": {} }
837
838EQMP
839
840 {
Zhi Yong Wu727f0052011-11-08 13:00:31 +0800841 .name = "block_set_io_throttle",
842 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
843 .params = "device bps bps_rd bps_wr iops iops_rd iops_wr",
844 .help = "change I/O throttle limits for a block drive",
845 .user_print = monitor_user_noop,
846 .mhandler.cmd_new = do_block_set_io_throttle,
847 },
848
849SQMP
850block_set_io_throttle
851------------
852
853Change I/O throttle limits for a block drive.
854
855Arguments:
856
857- "device": device name (json-string)
858- "bps": total throughput limit in bytes per second(json-int)
859- "bps_rd": read throughput limit in bytes per second(json-int)
860- "bps_wr": read throughput limit in bytes per second(json-int)
861- "iops": total I/O operations per second(json-int)
862- "iops_rd": read I/O operations per second(json-int)
863- "iops_wr": write I/O operations per second(json-int)
864
865Example:
866
867-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
868 "bps": "1000000",
869 "bps_rd": "0",
870 "bps_wr": "0",
871 "iops": "0",
872 "iops_rd": "0",
873 "iops_wr": "0" } }
874<- { "return": {} }
875
876EQMP
877
878 {
Gerd Hoffmann75721502010-10-07 12:22:54 +0200879 .name = "set_password",
880 .args_type = "protocol:s,password:s,connected:s?",
881 .params = "protocol password action-if-connected",
882 .help = "set spice/vnc password",
883 .user_print = monitor_user_noop,
884 .mhandler.cmd_new = set_password,
885 },
886
887SQMP
888set_password
889------------
890
891Set the password for vnc/spice protocols.
892
893Arguments:
894
895- "protocol": protocol name (json-string)
896- "password": password (json-string)
897- "connected": [ keep | disconnect | fail ] (josn-string, optional)
898
899Example:
900
901-> { "execute": "set_password", "arguments": { "protocol": "vnc",
902 "password": "secret" } }
903<- { "return": {} }
904
905EQMP
906
907 {
908 .name = "expire_password",
909 .args_type = "protocol:s,time:s",
910 .params = "protocol time",
911 .help = "set spice/vnc password expire-time",
912 .user_print = monitor_user_noop,
913 .mhandler.cmd_new = expire_password,
914 },
915
916SQMP
917expire_password
918---------------
919
920Set the password expire time for vnc/spice protocols.
921
922Arguments:
923
924- "protocol": protocol name (json-string)
925- "time": [ now | never | +secs | secs ] (json-string)
926
927Example:
928
929-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
930 "time": "+60" } }
931<- { "return": {} }
932
933EQMP
934
935 {
Daniel P. Berrange13661082011-06-23 13:31:42 +0100936 .name = "add_client",
937 .args_type = "protocol:s,fdname:s,skipauth:b?",
938 .params = "protocol fdname skipauth",
939 .help = "add a graphics client",
940 .user_print = monitor_user_noop,
941 .mhandler.cmd_new = add_graphics_client,
942 },
943
944SQMP
945add_client
946----------
947
948Add a graphics client
949
950Arguments:
951
952- "protocol": protocol name (json-string)
953- "fdname": file descriptor name (json-string)
954
955Example:
956
957-> { "execute": "add_client", "arguments": { "protocol": "vnc",
958 "fdname": "myclient" } }
959<- { "return": {} }
960
961EQMP
962 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300963 .name = "qmp_capabilities",
964 .args_type = "",
965 .params = "",
966 .help = "enable QMP capabilities",
967 .user_print = monitor_user_noop,
968 .mhandler.cmd_new = do_qmp_capabilities,
969 },
970
971SQMP
972qmp_capabilities
973----------------
974
975Enable QMP capabilities.
976
977Arguments: None.
978
979Example:
980
981-> { "execute": "qmp_capabilities" }
982<- { "return": {} }
983
984Note: This command must be issued before issuing any other command.
985
Luiz Capitulino0268d972010-10-22 10:08:02 -0200986EQMP
987
988 {
989 .name = "human-monitor-command",
990 .args_type = "command-line:s,cpu-index:i?",
991 .params = "",
992 .help = "",
993 .user_print = monitor_user_noop,
994 .mhandler.cmd_new = do_hmp_passthrough,
995 },
996
997SQMP
998human-monitor-command
999---------------------
1000
1001Execute a Human Monitor command.
1002
1003Arguments:
1004
1005- command-line: the command name and its arguments, just like the
1006 Human Monitor's shell (json-string)
1007- cpu-index: select the CPU number to be used by commands which access CPU
1008 data, like 'info registers'. The Monitor selects CPU 0 if this
1009 argument is not provided (json-int, optional)
1010
1011Example:
1012
1013-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1014<- { "return": "kvm support: enabled\r\n" }
1015
1016Notes:
1017
1018(1) The Human Monitor is NOT an stable interface, this means that command
1019 names, arguments and responses can change or be removed at ANY time.
1020 Applications that rely on long term stability guarantees should NOT
1021 use this command
1022
1023(2) Limitations:
1024
1025 o This command is stateless, this means that commands that depend
1026 on state information (such as getfd) might not work
1027
1028 o Commands that prompt the user for data (eg. 'cont' when the block
1029 device is encrypted) don't currently work
1030
Luiz Capitulino82a56f02010-09-13 12:26:00 -030010313. Query Commands
1032=================
1033
1034HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1035HXCOMM this! We will possibly move query commands definitions inside those
1036HXCOMM sections, just like regular commands.
1037
1038EQMP
1039
1040SQMP
1041query-version
1042-------------
1043
1044Show QEMU version.
1045
1046Return a json-object with the following information:
1047
1048- "qemu": A json-object containing three integer values:
1049 - "major": QEMU's major version (json-int)
1050 - "minor": QEMU's minor version (json-int)
1051 - "micro": QEMU's micro version (json-int)
1052- "package": package's version (json-string)
1053
1054Example:
1055
1056-> { "execute": "query-version" }
1057<- {
1058 "return":{
1059 "qemu":{
1060 "major":0,
1061 "minor":11,
1062 "micro":5
1063 },
1064 "package":""
1065 }
1066 }
1067
1068EQMP
1069
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03001070 {
1071 .name = "query-version",
1072 .args_type = "",
1073 .mhandler.cmd_new = qmp_marshal_input_query_version,
1074 },
1075
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001076SQMP
1077query-commands
1078--------------
1079
1080List QMP available commands.
1081
1082Each command is represented by a json-object, the returned value is a json-array
1083of all commands.
1084
1085Each json-object contain:
1086
1087- "name": command's name (json-string)
1088
1089Example:
1090
1091-> { "execute": "query-commands" }
1092<- {
1093 "return":[
1094 {
1095 "name":"query-balloon"
1096 },
1097 {
1098 "name":"system_powerdown"
1099 }
1100 ]
1101 }
1102
1103Note: This example has been shortened as the real response is too long.
1104
1105EQMP
1106
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03001107 {
1108 .name = "query-commands",
1109 .args_type = "",
1110 .mhandler.cmd_new = qmp_marshal_input_query_commands,
1111 },
1112
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001113SQMP
1114query-chardev
1115-------------
1116
1117Each device is represented by a json-object. The returned value is a json-array
1118of all devices.
1119
1120Each json-object contain the following:
1121
1122- "label": device's label (json-string)
1123- "filename": device's file (json-string)
1124
1125Example:
1126
1127-> { "execute": "query-chardev" }
1128<- {
1129 "return":[
1130 {
1131 "label":"monitor",
1132 "filename":"stdio"
1133 },
1134 {
1135 "label":"serial0",
1136 "filename":"vc"
1137 }
1138 ]
1139 }
1140
1141EQMP
1142
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03001143 {
1144 .name = "query-chardev",
1145 .args_type = "",
1146 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
1147 },
1148
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001149SQMP
1150query-block
1151-----------
1152
1153Show the block devices.
1154
1155Each block device information is stored in a json-object and the returned value
1156is a json-array of all devices.
1157
1158Each json-object contain the following:
1159
1160- "device": device name (json-string)
1161- "type": device type (json-string)
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001162 - deprecated, retained for backward compatibility
1163 - Possible values: "unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001164- "removable": true if the device is removable, false otherwise (json-bool)
1165- "locked": true if the device is locked, false otherwise (json-bool)
Markus Armbrustere4def802011-09-06 18:58:53 +02001166- "tray-open": only present if removable, true if the device has a tray,
1167 and it is open (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001168- "inserted": only present if the device is inserted, it is a json-object
1169 containing the following:
1170 - "file": device file name (json-string)
1171 - "ro": true if read-only, false otherwise (json-bool)
1172 - "drv": driver format name (json-string)
1173 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1174 "file", "file", "ftp", "ftps", "host_cdrom",
1175 "host_device", "host_floppy", "http", "https",
1176 "nbd", "parallels", "qcow", "qcow2", "raw",
1177 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1178 - "backing_file": backing file name (json-string, optional)
1179 - "encrypted": true if encrypted, false otherwise (json-bool)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001180 - "bps": limit total bytes per second (json-int)
1181 - "bps_rd": limit read bytes per second (json-int)
1182 - "bps_wr": limit write bytes per second (json-int)
1183 - "iops": limit total I/O operations per second (json-int)
1184 - "iops_rd": limit read operations per second (json-int)
1185 - "iops_wr": limit write operations per second (json-int)
1186
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001187- "io-status": I/O operation status, only present if the device supports it
1188 and the VM is configured to stop on errors. It's always reset
1189 to "ok" when the "cont" command is issued (json_string, optional)
1190 - Possible values: "ok", "failed", "nospace"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001191
1192Example:
1193
1194-> { "execute": "query-block" }
1195<- {
1196 "return":[
1197 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001198 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001199 "device":"ide0-hd0",
1200 "locked":false,
1201 "removable":false,
1202 "inserted":{
1203 "ro":false,
1204 "drv":"qcow2",
1205 "encrypted":false,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001206 "file":"disks/test.img",
1207 "bps":1000000,
1208 "bps_rd":0,
1209 "bps_wr":0,
1210 "iops":1000000,
1211 "iops_rd":0,
1212 "iops_wr":0,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001213 },
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001214 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001215 },
1216 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001217 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001218 "device":"ide1-cd0",
1219 "locked":false,
1220 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001221 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001222 },
1223 {
1224 "device":"floppy0",
1225 "locked":false,
1226 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001227 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001228 },
1229 {
1230 "device":"sd0",
1231 "locked":false,
1232 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001233 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001234 }
1235 ]
1236 }
1237
1238EQMP
1239
Luiz Capitulinob2023812011-09-21 17:16:47 -03001240 {
1241 .name = "query-block",
1242 .args_type = "",
1243 .mhandler.cmd_new = qmp_marshal_input_query_block,
1244 },
1245
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001246SQMP
1247query-blockstats
1248----------------
1249
1250Show block device statistics.
1251
1252Each device statistic information is stored in a json-object and the returned
1253value is a json-array of all devices.
1254
1255Each json-object contain the following:
1256
1257- "device": device name (json-string)
1258- "stats": A json-object with the statistics information, it contains:
1259 - "rd_bytes": bytes read (json-int)
1260 - "wr_bytes": bytes written (json-int)
1261 - "rd_operations": read operations (json-int)
1262 - "wr_operations": write operations (json-int)
Christoph Hellwige8045d62011-08-22 00:25:58 +02001263 - "flush_operations": cache flush operations (json-int)
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001264 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1265 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1266 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001267 - "wr_highest_offset": Highest offset of a sector written since the
1268 BlockDriverState has been opened (json-int)
1269- "parent": Contains recursively the statistics of the underlying
1270 protocol (e.g. the host file for a qcow2 image). If there is
1271 no underlying protocol, this field is omitted
1272 (json-object, optional)
1273
1274Example:
1275
1276-> { "execute": "query-blockstats" }
1277<- {
1278 "return":[
1279 {
1280 "device":"ide0-hd0",
1281 "parent":{
1282 "stats":{
1283 "wr_highest_offset":3686448128,
1284 "wr_bytes":9786368,
1285 "wr_operations":751,
1286 "rd_bytes":122567168,
1287 "rd_operations":36772
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
Christoph Hellwige8045d62011-08-22 00:25:58 +02001291 "flush_operations":61,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001292 }
1293 },
1294 "stats":{
1295 "wr_highest_offset":2821110784,
1296 "wr_bytes":9786368,
1297 "wr_operations":692,
1298 "rd_bytes":122739200,
1299 "rd_operations":36604
Christoph Hellwige8045d62011-08-22 00:25:58 +02001300 "flush_operations":51,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001301 "wr_total_times_ns":313253456
1302 "rd_total_times_ns":3465673657
1303 "flush_total_times_ns":49653
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001304 }
1305 },
1306 {
1307 "device":"ide1-cd0",
1308 "stats":{
1309 "wr_highest_offset":0,
1310 "wr_bytes":0,
1311 "wr_operations":0,
1312 "rd_bytes":0,
1313 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001314 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001315 "wr_total_times_ns":0
1316 "rd_total_times_ns":0
1317 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001318 }
1319 },
1320 {
1321 "device":"floppy0",
1322 "stats":{
1323 "wr_highest_offset":0,
1324 "wr_bytes":0,
1325 "wr_operations":0,
1326 "rd_bytes":0,
1327 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001328 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001329 "wr_total_times_ns":0
1330 "rd_total_times_ns":0
1331 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001332 }
1333 },
1334 {
1335 "device":"sd0",
1336 "stats":{
1337 "wr_highest_offset":0,
1338 "wr_bytes":0,
1339 "wr_operations":0,
1340 "rd_bytes":0,
1341 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001342 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001343 "wr_total_times_ns":0
1344 "rd_total_times_ns":0
1345 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001346 }
1347 }
1348 ]
1349 }
1350
1351EQMP
1352
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03001353 {
1354 .name = "query-blockstats",
1355 .args_type = "",
1356 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
1357 },
1358
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001359SQMP
1360query-cpus
1361----------
1362
1363Show CPU information.
1364
1365Return a json-array. Each CPU is represented by a json-object, which contains:
1366
1367- "CPU": CPU index (json-int)
1368- "current": true if this is the current CPU, false otherwise (json-bool)
1369- "halted": true if the cpu is halted, false otherwise (json-bool)
1370- Current program counter. The key's name depends on the architecture:
1371 "pc": i386/x86_64 (json-int)
1372 "nip": PPC (json-int)
1373 "pc" and "npc": sparc (json-int)
1374 "PC": mips (json-int)
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001375- "thread_id": ID of the underlying host thread (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001376
1377Example:
1378
1379-> { "execute": "query-cpus" }
1380<- {
1381 "return":[
1382 {
1383 "CPU":0,
1384 "current":true,
1385 "halted":false,
1386 "pc":3227107138
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001387 "thread_id":3134
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001388 },
1389 {
1390 "CPU":1,
1391 "current":false,
1392 "halted":true,
1393 "pc":7108165
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001394 "thread_id":3135
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001395 }
1396 ]
1397 }
1398
1399EQMP
1400
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03001401 {
1402 .name = "query-cpus",
1403 .args_type = "",
1404 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
1405 },
1406
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001407SQMP
1408query-pci
1409---------
1410
1411PCI buses and devices information.
1412
1413The returned value is a json-array of all buses. Each bus is represented by
1414a json-object, which has a key with a json-array of all PCI devices attached
1415to it. Each device is represented by a json-object.
1416
1417The bus json-object contains the following:
1418
1419- "bus": bus number (json-int)
1420- "devices": a json-array of json-objects, each json-object represents a
1421 PCI device
1422
1423The PCI device json-object contains the following:
1424
1425- "bus": identical to the parent's bus number (json-int)
1426- "slot": slot number (json-int)
1427- "function": function number (json-int)
1428- "class_info": a json-object containing:
1429 - "desc": device class description (json-string, optional)
1430 - "class": device class number (json-int)
1431- "id": a json-object containing:
1432 - "device": device ID (json-int)
1433 - "vendor": vendor ID (json-int)
1434- "irq": device's IRQ if assigned (json-int, optional)
1435- "qdev_id": qdev id string (json-string)
1436- "pci_bridge": It's a json-object, only present if this device is a
1437 PCI bridge, contains:
1438 - "bus": bus number (json-int)
1439 - "secondary": secondary bus number (json-int)
1440 - "subordinate": subordinate bus number (json-int)
1441 - "io_range": I/O memory range information, a json-object with the
1442 following members:
1443 - "base": base address, in bytes (json-int)
1444 - "limit": limit address, in bytes (json-int)
1445 - "memory_range": memory range information, a json-object with the
1446 following members:
1447 - "base": base address, in bytes (json-int)
1448 - "limit": limit address, in bytes (json-int)
1449 - "prefetchable_range": Prefetchable memory range information, a
1450 json-object with the following members:
1451 - "base": base address, in bytes (json-int)
1452 - "limit": limit address, in bytes (json-int)
1453 - "devices": a json-array of PCI devices if there's any attached, each
1454 each element is represented by a json-object, which contains
1455 the same members of the 'PCI device json-object' described
1456 above (optional)
1457- "regions": a json-array of json-objects, each json-object represents a
1458 memory region of this device
1459
1460The memory range json-object contains the following:
1461
1462- "base": base memory address (json-int)
1463- "limit": limit value (json-int)
1464
1465The region json-object can be an I/O region or a memory region, an I/O region
1466json-object contains the following:
1467
1468- "type": "io" (json-string, fixed)
1469- "bar": BAR number (json-int)
1470- "address": memory address (json-int)
1471- "size": memory size (json-int)
1472
1473A memory region json-object contains the following:
1474
1475- "type": "memory" (json-string, fixed)
1476- "bar": BAR number (json-int)
1477- "address": memory address (json-int)
1478- "size": memory size (json-int)
1479- "mem_type_64": true or false (json-bool)
1480- "prefetch": true or false (json-bool)
1481
1482Example:
1483
1484-> { "execute": "query-pci" }
1485<- {
1486 "return":[
1487 {
1488 "bus":0,
1489 "devices":[
1490 {
1491 "bus":0,
1492 "qdev_id":"",
1493 "slot":0,
1494 "class_info":{
1495 "class":1536,
1496 "desc":"Host bridge"
1497 },
1498 "id":{
1499 "device":32902,
1500 "vendor":4663
1501 },
1502 "function":0,
1503 "regions":[
1504
1505 ]
1506 },
1507 {
1508 "bus":0,
1509 "qdev_id":"",
1510 "slot":1,
1511 "class_info":{
1512 "class":1537,
1513 "desc":"ISA bridge"
1514 },
1515 "id":{
1516 "device":32902,
1517 "vendor":28672
1518 },
1519 "function":0,
1520 "regions":[
1521
1522 ]
1523 },
1524 {
1525 "bus":0,
1526 "qdev_id":"",
1527 "slot":1,
1528 "class_info":{
1529 "class":257,
1530 "desc":"IDE controller"
1531 },
1532 "id":{
1533 "device":32902,
1534 "vendor":28688
1535 },
1536 "function":1,
1537 "regions":[
1538 {
1539 "bar":4,
1540 "size":16,
1541 "address":49152,
1542 "type":"io"
1543 }
1544 ]
1545 },
1546 {
1547 "bus":0,
1548 "qdev_id":"",
1549 "slot":2,
1550 "class_info":{
1551 "class":768,
1552 "desc":"VGA controller"
1553 },
1554 "id":{
1555 "device":4115,
1556 "vendor":184
1557 },
1558 "function":0,
1559 "regions":[
1560 {
1561 "prefetch":true,
1562 "mem_type_64":false,
1563 "bar":0,
1564 "size":33554432,
1565 "address":4026531840,
1566 "type":"memory"
1567 },
1568 {
1569 "prefetch":false,
1570 "mem_type_64":false,
1571 "bar":1,
1572 "size":4096,
1573 "address":4060086272,
1574 "type":"memory"
1575 },
1576 {
1577 "prefetch":false,
1578 "mem_type_64":false,
1579 "bar":6,
1580 "size":65536,
1581 "address":-1,
1582 "type":"memory"
1583 }
1584 ]
1585 },
1586 {
1587 "bus":0,
1588 "qdev_id":"",
1589 "irq":11,
1590 "slot":4,
1591 "class_info":{
1592 "class":1280,
1593 "desc":"RAM controller"
1594 },
1595 "id":{
1596 "device":6900,
1597 "vendor":4098
1598 },
1599 "function":0,
1600 "regions":[
1601 {
1602 "bar":0,
1603 "size":32,
1604 "address":49280,
1605 "type":"io"
1606 }
1607 ]
1608 }
1609 ]
1610 }
1611 ]
1612 }
1613
1614Note: This example has been shortened as the real response is too long.
1615
1616EQMP
1617
Luiz Capitulino79627472011-10-21 14:15:33 -02001618 {
1619 .name = "query-pci",
1620 .args_type = "",
1621 .mhandler.cmd_new = qmp_marshal_input_query_pci,
1622 },
1623
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001624SQMP
1625query-kvm
1626---------
1627
1628Show KVM information.
1629
1630Return a json-object with the following information:
1631
1632- "enabled": true if KVM support is enabled, false otherwise (json-bool)
1633- "present": true if QEMU has KVM support, false otherwise (json-bool)
1634
1635Example:
1636
1637-> { "execute": "query-kvm" }
1638<- { "return": { "enabled": true, "present": true } }
1639
1640EQMP
1641
Luiz Capitulino292a2602011-09-12 15:10:53 -03001642 {
1643 .name = "query-kvm",
1644 .args_type = "",
1645 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
1646 },
1647
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001648SQMP
1649query-status
1650------------
1651
1652Return a json-object with the following information:
1653
1654- "running": true if the VM is running, or false if it is paused (json-bool)
1655- "singlestep": true if the VM is in single step mode,
1656 false otherwise (json-bool)
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03001657- "status": one of the following values (json-string)
1658 "debug" - QEMU is running on a debugger
1659 "inmigrate" - guest is paused waiting for an incoming migration
1660 "internal-error" - An internal error that prevents further guest
1661 execution has occurred
1662 "io-error" - the last IOP has failed and the device is configured
1663 to pause on I/O errors
1664 "paused" - guest has been paused via the 'stop' command
1665 "postmigrate" - guest is paused following a successful 'migrate'
1666 "prelaunch" - QEMU was started with -S and guest has not started
1667 "finish-migrate" - guest is paused to finish the migration process
1668 "restore-vm" - guest is paused to restore VM state
1669 "running" - guest is actively running
1670 "save-vm" - guest is paused to save the VM state
1671 "shutdown" - guest is shut down (and -no-shutdown is in use)
1672 "watchdog" - the watchdog action is configured to pause and
1673 has been triggered
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001674
1675Example:
1676
1677-> { "execute": "query-status" }
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03001678<- { "return": { "running": true, "singlestep": false, "status": "running" } }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001679
1680EQMP
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03001681
1682 {
1683 .name = "query-status",
1684 .args_type = "",
1685 .mhandler.cmd_new = qmp_marshal_input_query_status,
1686 },
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001687
1688SQMP
1689query-mice
1690----------
1691
1692Show VM mice information.
1693
1694Each mouse is represented by a json-object, the returned value is a json-array
1695of all mice.
1696
1697The mouse json-object contains the following:
1698
1699- "name": mouse's name (json-string)
1700- "index": mouse's index (json-int)
1701- "current": true if this mouse is receiving events, false otherwise (json-bool)
1702- "absolute": true if the mouse generates absolute input events (json-bool)
1703
1704Example:
1705
1706-> { "execute": "query-mice" }
1707<- {
1708 "return":[
1709 {
1710 "name":"QEMU Microsoft Mouse",
1711 "index":0,
1712 "current":false,
1713 "absolute":false
1714 },
1715 {
1716 "name":"QEMU PS/2 Mouse",
1717 "index":1,
1718 "current":true,
1719 "absolute":true
1720 }
1721 ]
1722 }
1723
1724EQMP
1725
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03001726 {
1727 .name = "query-mice",
1728 .args_type = "",
1729 .mhandler.cmd_new = qmp_marshal_input_query_mice,
1730 },
1731
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001732SQMP
1733query-vnc
1734---------
1735
1736Show VNC server information.
1737
1738Return a json-object with server information. Connected clients are returned
1739as a json-array of json-objects.
1740
1741The main json-object contains the following:
1742
1743- "enabled": true or false (json-bool)
1744- "host": server's IP address (json-string)
1745- "family": address family (json-string)
1746 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1747- "service": server's port number (json-string)
1748- "auth": authentication method (json-string)
1749 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
1750 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
1751 "vencrypt+plain", "vencrypt+tls+none",
1752 "vencrypt+tls+plain", "vencrypt+tls+sasl",
1753 "vencrypt+tls+vnc", "vencrypt+x509+none",
1754 "vencrypt+x509+plain", "vencrypt+x509+sasl",
1755 "vencrypt+x509+vnc", "vnc"
1756- "clients": a json-array of all connected clients
1757
1758Clients are described by a json-object, each one contain the following:
1759
1760- "host": client's IP address (json-string)
1761- "family": address family (json-string)
1762 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1763- "service": client's port number (json-string)
1764- "x509_dname": TLS dname (json-string, optional)
1765- "sasl_username": SASL username (json-string, optional)
1766
1767Example:
1768
1769-> { "execute": "query-vnc" }
1770<- {
1771 "return":{
1772 "enabled":true,
1773 "host":"0.0.0.0",
1774 "service":"50402",
1775 "auth":"vnc",
1776 "family":"ipv4",
1777 "clients":[
1778 {
1779 "host":"127.0.0.1",
1780 "service":"50401",
1781 "family":"ipv4"
1782 }
1783 ]
1784 }
1785 }
1786
1787EQMP
1788
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02001789 {
1790 .name = "query-vnc",
1791 .args_type = "",
1792 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
1793 },
1794
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001795SQMP
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01001796query-spice
1797-----------
1798
1799Show SPICE server information.
1800
1801Return a json-object with server information. Connected clients are returned
1802as a json-array of json-objects.
1803
1804The main json-object contains the following:
1805
1806- "enabled": true or false (json-bool)
1807- "host": server's IP address (json-string)
1808- "port": server's port number (json-int, optional)
1809- "tls-port": server's port number (json-int, optional)
1810- "auth": authentication method (json-string)
1811 - Possible values: "none", "spice"
1812- "channels": a json-array of all active channels clients
1813
1814Channels are described by a json-object, each one contain the following:
1815
1816- "host": client's IP address (json-string)
1817- "family": address family (json-string)
1818 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1819- "port": client's port number (json-string)
1820- "connection-id": spice connection id. All channels with the same id
1821 belong to the same spice session (json-int)
1822- "channel-type": channel type. "1" is the main control channel, filter for
1823 this one if you want track spice sessions only (json-int)
1824- "channel-id": channel id. Usually "0", might be different needed when
1825 multiple channels of the same type exist, such as multiple
1826 display channels in a multihead setup (json-int)
1827- "tls": whevener the channel is encrypted (json-bool)
1828
1829Example:
1830
1831-> { "execute": "query-spice" }
1832<- {
1833 "return": {
1834 "enabled": true,
1835 "auth": "spice",
1836 "port": 5920,
1837 "tls-port": 5921,
1838 "host": "0.0.0.0",
1839 "channels": [
1840 {
1841 "port": "54924",
1842 "family": "ipv4",
1843 "channel-type": 1,
1844 "connection-id": 1804289383,
1845 "host": "127.0.0.1",
1846 "channel-id": 0,
1847 "tls": true
1848 },
1849 {
1850 "port": "36710",
1851 "family": "ipv4",
1852 "channel-type": 4,
1853 "connection-id": 1804289383,
1854 "host": "127.0.0.1",
1855 "channel-id": 0,
1856 "tls": false
1857 },
1858 [ ... more channels follow ... ]
1859 ]
1860 }
1861 }
1862
1863EQMP
1864
Luiz Capitulinod1f29642011-10-20 17:01:33 -02001865#if defined(CONFIG_SPICE)
1866 {
1867 .name = "query-spice",
1868 .args_type = "",
1869 .mhandler.cmd_new = qmp_marshal_input_query_spice,
1870 },
1871#endif
1872
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01001873SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001874query-name
1875----------
1876
1877Show VM name.
1878
1879Return a json-object with the following information:
1880
1881- "name": VM's name (json-string, optional)
1882
1883Example:
1884
1885-> { "execute": "query-name" }
1886<- { "return": { "name": "qemu-name" } }
1887
1888EQMP
1889
Anthony Liguori48a32be2011-09-02 12:34:48 -05001890 {
1891 .name = "query-name",
1892 .args_type = "",
1893 .mhandler.cmd_new = qmp_marshal_input_query_name,
1894 },
1895
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001896SQMP
1897query-uuid
1898----------
1899
1900Show VM UUID.
1901
1902Return a json-object with the following information:
1903
1904- "UUID": Universally Unique Identifier (json-string)
1905
1906Example:
1907
1908-> { "execute": "query-uuid" }
1909<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
1910
1911EQMP
1912
Luiz Capitulinoefab7672011-09-13 17:16:25 -03001913 {
1914 .name = "query-uuid",
1915 .args_type = "",
1916 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
1917 },
1918
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001919SQMP
1920query-migrate
1921-------------
1922
1923Migration status.
1924
1925Return a json-object. If migration is active there will be another json-object
1926with RAM migration status and if block migration is active another one with
1927block migration status.
1928
1929The main json-object contains the following:
1930
1931- "status": migration status (json-string)
1932 - Possible values: "active", "completed", "failed", "cancelled"
1933- "ram": only present if "status" is "active", it is a json-object with the
1934 following RAM information (in bytes):
1935 - "transferred": amount transferred (json-int)
1936 - "remaining": amount remaining (json-int)
1937 - "total": total (json-int)
1938- "disk": only present if "status" is "active" and it is a block migration,
1939 it is a json-object with the following disk information (in bytes):
1940 - "transferred": amount transferred (json-int)
1941 - "remaining": amount remaining (json-int)
1942 - "total": total (json-int)
1943
1944Examples:
1945
19461. Before the first migration
1947
1948-> { "execute": "query-migrate" }
1949<- { "return": {} }
1950
19512. Migration is done and has succeeded
1952
1953-> { "execute": "query-migrate" }
1954<- { "return": { "status": "completed" } }
1955
19563. Migration is done and has failed
1957
1958-> { "execute": "query-migrate" }
1959<- { "return": { "status": "failed" } }
1960
19614. Migration is being performed and is not a block migration:
1962
1963-> { "execute": "query-migrate" }
1964<- {
1965 "return":{
1966 "status":"active",
1967 "ram":{
1968 "transferred":123,
1969 "remaining":123,
1970 "total":246
1971 }
1972 }
1973 }
1974
19755. Migration is being performed and is a block migration:
1976
1977-> { "execute": "query-migrate" }
1978<- {
1979 "return":{
1980 "status":"active",
1981 "ram":{
1982 "total":1057024,
1983 "remaining":1053304,
1984 "transferred":3720
1985 },
1986 "disk":{
1987 "total":20971520,
1988 "remaining":20880384,
1989 "transferred":91136
1990 }
1991 }
1992 }
1993
1994EQMP
1995
Luiz Capitulino791e7c82011-09-13 17:37:16 -03001996 {
1997 .name = "query-migrate",
1998 .args_type = "",
1999 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
2000 },
2001
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002002SQMP
2003query-balloon
2004-------------
2005
2006Show balloon information.
2007
2008Make an asynchronous request for balloon info. When the request completes a
2009json-object will be returned containing the following data:
2010
2011- "actual": current balloon value in bytes (json-int)
2012- "mem_swapped_in": Amount of memory swapped in bytes (json-int, optional)
2013- "mem_swapped_out": Amount of memory swapped out in bytes (json-int, optional)
2014- "major_page_faults": Number of major faults (json-int, optional)
2015- "minor_page_faults": Number of minor faults (json-int, optional)
2016- "free_mem": Total amount of free and unused memory in
2017 bytes (json-int, optional)
2018- "total_mem": Total amount of available memory in bytes (json-int, optional)
2019
2020Example:
2021
2022-> { "execute": "query-balloon" }
2023<- {
2024 "return":{
2025 "actual":1073741824,
2026 "mem_swapped_in":0,
2027 "mem_swapped_out":0,
2028 "major_page_faults":142,
2029 "minor_page_faults":239245,
2030 "free_mem":1014185984,
2031 "total_mem":1044668416
2032 }
2033 }
2034
2035EQMP
2036
Luiz Capitulino96637bc2011-10-21 11:41:37 -02002037 {
2038 .name = "query-balloon",
2039 .args_type = "",
2040 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
2041 },