]> git.proxmox.com Git - qemu.git/blame - qmp-commands.hx
qapi: Convert blockdev_snapshot_sync
[qemu.git] / qmp-commands.hx
CommitLineData
82a56f0d
LC
1HXCOMM QMP dispatch table and documentation
2HXCOMM Text between SQMP and EQMP is copied to the QMP documention file and
3HXCOMM does not show up in the other formats.
4
5SQMP
6 QMP Supported Commands
7 ----------------------
8
9This document describes all commands currently supported by QMP.
10
11Most of the time their usage is exactly the same as in the user Monitor, this
12means that any other document which also describe commands (the manpage,
13QEMU's manual, etc) can and should be consulted.
14
15QMP has two types of commands: regular and query commands. Regular commands
16usually change the Virtual Machine's state someway, while query commands just
17return information. The sections below are divided accordingly.
18
19It's important to observe that all communication examples are formatted in
20a reader-friendly way, so that they're easier to understand. However, in real
21protocol usage, they're emitted as a single line.
22
23Also, the following notation is used to denote data flow:
24
25-> data issued by the Client
26<- Server data response
27
28Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed
29information on the Server command and response formats.
30
31NOTE: This document is temporary and will be replaced soon.
32
331. Stability Considerations
34===========================
35
36The current QMP command set (described in this file) may be useful for a
37number of use cases, however it's limited and several commands have bad
38defined semantics, specially with regard to command completion.
39
40These problems are going to be solved incrementally in the next QEMU releases
41and we're going to establish a deprecation policy for badly defined commands.
42
43If you're planning to adopt QMP, please observe the following:
44
c20cdf8b 45 1. The deprecation policy will take effect and be documented soon, please
82a56f0d
LC
46 check the documentation of each used command as soon as a new release of
47 QEMU is available
48
49 2. DO NOT rely on anything which is not explicit documented
50
51 3. Errors, in special, are not documented. Applications should NOT check
52 for specific errors classes or data (it's strongly recommended to only
53 check for the "error" key)
54
552. Regular Commands
56===================
57
58Server's responses in the examples below are always a success response, please
59refer to the QMP specification for more details on error responses.
60
61EQMP
62
63 {
64 .name = "quit",
65 .args_type = "",
7a7f325e 66 .mhandler.cmd_new = qmp_marshal_input_quit,
82a56f0d
LC
67 },
68
69SQMP
70quit
71----
72
73Quit the emulator.
74
75Arguments: None.
76
77Example:
78
79-> { "execute": "quit" }
80<- { "return": {} }
81
82EQMP
83
84 {
85 .name = "eject",
86 .args_type = "force:-f,device:B",
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 = "",
5f158f21 181 .mhandler.cmd_new = qmp_marshal_input_stop,
82a56f0d
LC
182 },
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 = "",
e42e818b 202 .mhandler.cmd_new = qmp_marshal_input_cont,
82a56f0d
LC
203 },
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 = "",
38d22653 223 .mhandler.cmd_new = qmp_marshal_input_system_reset,
82a56f0d
LC
224 },
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 = "",
22e1bb9c 244 .mhandler.cmd_new = qmp_marshal_input_system_powerdown,
82a56f0d
LC
245 },
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",
755f1968 328 .mhandler.cmd_new = qmp_marshal_input_cpu,
82a56f0d
LC
329 },
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",
0cfd6a9a
LC
352 .args_type = "val:l,size:i,filename:s,cpu:i?",
353 .mhandler.cmd_new = qmp_marshal_input_memsave,
82a56f0d
LC
354 },
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)
0cfd6a9a 367- "cpu": virtual CPU index (json-int, optional)
82a56f0d
LC
368
369Example:
370
371-> { "execute": "memsave",
372 "arguments": { "val": 10,
373 "size": 100,
374 "filename": "/tmp/virtual-mem-dump" } }
375<- { "return": {} }
376
82a56f0d
LC
377EQMP
378
379 {
380 .name = "pmemsave",
381 .args_type = "val:l,size:i,filename:s",
6d3962bf 382 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
82a56f0d
LC
383 },
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
a4046664
LJ
405EQMP
406
407 {
408 .name = "inject-nmi",
409 .args_type = "",
ab49ab5c 410 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
a4046664
LJ
411 },
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
82a56f0d
LC
429EQMP
430
431 {
432 .name = "migrate",
433 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
434 .params = "[-d] [-b] [-i] uri",
435 .help = "migrate to URI (using -d to not wait for completion)"
436 "\n\t\t\t -b for migration without shared storage with"
437 " full copy of disk\n\t\t\t -i for migration without "
438 "shared storage with incremental copy of disk "
439 "(base image shared between src and destination)",
440 .user_print = monitor_user_noop,
441 .mhandler.cmd_new = do_migrate,
442 },
443
444SQMP
445migrate
446-------
447
448Migrate to URI.
449
450Arguments:
451
452- "blk": block migration, full disk copy (json-bool, optional)
453- "inc": incremental disk copy (json-bool, optional)
454- "uri": Destination URI (json-string)
455
456Example:
457
458-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
459<- { "return": {} }
460
461Notes:
462
463(1) The 'query-migrate' command should be used to check migration's progress
464 and final result (this information is provided by the 'status' member)
465(2) All boolean arguments default to false
466(3) The user Monitor's "detach" argument is invalid in QMP and should not
467 be used
468
469EQMP
470
471 {
472 .name = "migrate_cancel",
473 .args_type = "",
474 .params = "",
475 .help = "cancel the current VM migration",
476 .user_print = monitor_user_noop,
477 .mhandler.cmd_new = do_migrate_cancel,
478 },
479
480SQMP
481migrate_cancel
482--------------
483
484Cancel the current migration.
485
486Arguments: None.
487
488Example:
489
490-> { "execute": "migrate_cancel" }
491<- { "return": {} }
492
493EQMP
494
495 {
496 .name = "migrate_set_speed",
3a019b6e 497 .args_type = "value:o",
82a56f0d
LC
498 .params = "value",
499 .help = "set maximum speed (in bytes) for migrations",
500 .user_print = monitor_user_noop,
501 .mhandler.cmd_new = do_migrate_set_speed,
502 },
503
e866e239 504SQMP
ff73edf5
JS
505migrate_set_speed
506-----------------
e866e239 507
ff73edf5 508Set maximum speed for migrations.
e866e239
GH
509
510Arguments:
511
ff73edf5 512- "value": maximum speed, in bytes per second (json-int)
e866e239
GH
513
514Example:
515
ff73edf5 516-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
e866e239
GH
517<- { "return": {} }
518
519EQMP
520
521 {
ff73edf5
JS
522 .name = "migrate_set_downtime",
523 .args_type = "value:T",
524 .params = "value",
525 .help = "set maximum tolerated downtime (in seconds) for migrations",
e866e239 526 .user_print = monitor_user_noop,
ff73edf5 527 .mhandler.cmd_new = do_migrate_set_downtime,
e866e239
GH
528 },
529
82a56f0d 530SQMP
ff73edf5
JS
531migrate_set_downtime
532--------------------
82a56f0d 533
ff73edf5 534Set maximum tolerated downtime (in seconds) for migrations.
82a56f0d
LC
535
536Arguments:
537
ff73edf5 538- "value": maximum downtime (json-number)
82a56f0d
LC
539
540Example:
541
ff73edf5 542-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
82a56f0d
LC
543<- { "return": {} }
544
545EQMP
546
547 {
ff73edf5
JS
548 .name = "client_migrate_info",
549 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
550 .params = "protocol hostname port tls-port cert-subject",
551 .help = "send migration info to spice/vnc client",
82a56f0d 552 .user_print = monitor_user_noop,
edc5cb1a
YH
553 .mhandler.cmd_async = client_migrate_info,
554 .flags = MONITOR_CMD_ASYNC,
82a56f0d
LC
555 },
556
557SQMP
ff73edf5
JS
558client_migrate_info
559------------------
82a56f0d 560
ff73edf5
JS
561Set the spice/vnc connection info for the migration target. The spice/vnc
562server will ask the spice/vnc client to automatically reconnect using the
563new parameters (if specified) once the vm migration finished successfully.
82a56f0d
LC
564
565Arguments:
566
ff73edf5
JS
567- "protocol": protocol: "spice" or "vnc" (json-string)
568- "hostname": migration target hostname (json-string)
569- "port": spice/vnc tcp port for plaintext channels (json-int, optional)
570- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
571- "cert-subject": server certificate subject (json-string, optional)
82a56f0d
LC
572
573Example:
574
ff73edf5
JS
575-> { "execute": "client_migrate_info",
576 "arguments": { "protocol": "spice",
577 "hostname": "virt42.lab.kraxel.org",
578 "port": 1234 } }
82a56f0d
LC
579<- { "return": {} }
580
581EQMP
582
583 {
584 .name = "netdev_add",
585 .args_type = "netdev:O",
586 .params = "[user|tap|socket],id=str[,prop=value][,...]",
587 .help = "add host network device",
588 .user_print = monitor_user_noop,
589 .mhandler.cmd_new = do_netdev_add,
590 },
591
592SQMP
593netdev_add
594----------
595
596Add host network device.
597
598Arguments:
599
600- "type": the device type, "tap", "user", ... (json-string)
601- "id": the device's ID, must be unique (json-string)
602- device options
603
604Example:
605
606-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
607<- { "return": {} }
608
609Note: The supported device options are the same ones supported by the '-net'
610 command-line argument, which are listed in the '-help' output or QEMU's
611 manual
612
613EQMP
614
615 {
616 .name = "netdev_del",
617 .args_type = "id:s",
618 .params = "id",
619 .help = "remove host network device",
620 .user_print = monitor_user_noop,
621 .mhandler.cmd_new = do_netdev_del,
622 },
623
624SQMP
625netdev_del
626----------
627
628Remove host network device.
629
630Arguments:
631
632- "id": the device's ID, must be unique (json-string)
633
634Example:
635
636-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
637<- { "return": {} }
638
6d4a2b3a
CH
639
640EQMP
641
642 {
643 .name = "block_resize",
644 .args_type = "device:B,size:o",
5e7caacb 645 .mhandler.cmd_new = qmp_marshal_input_block_resize,
6d4a2b3a
CH
646 },
647
648SQMP
649block_resize
650------------
651
652Resize a block image while a guest is running.
653
654Arguments:
655
656- "device": the device's ID, must be unique (json-string)
657- "size": new size
658
659Example:
660
661-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
662<- { "return": {} }
663
d967b2f1
JS
664EQMP
665
666 {
667 .name = "blockdev-snapshot-sync",
6106e249
LC
668 .args_type = "device:B,snapshot-file:s,format:s?",
669 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
d967b2f1
JS
670 },
671
672SQMP
673blockdev-snapshot-sync
674----------------------
675
676Synchronous snapshot of a block device. snapshot-file specifies the
677target of the new image. If the file exists, or if it is a device, the
678snapshot will be created in the existing file/device. If does not
679exist, a new file will be created. format specifies the format of the
680snapshot image, default is qcow2.
681
682Arguments:
683
684- "device": device name to snapshot (json-string)
685- "snapshot-file": name of new image file (json-string)
686- "format": format of new image (json-string, optional)
687
688Example:
689
7f3850c2
LC
690-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
691 "snapshot-file":
692 "/some/place/my-image",
693 "format": "qcow2" } }
d967b2f1
JS
694<- { "return": {} }
695
82a56f0d
LC
696EQMP
697
698 {
699 .name = "balloon",
700 .args_type = "value:M",
d72f3264 701 .mhandler.cmd_new = qmp_marshal_input_balloon,
82a56f0d
LC
702 },
703
704SQMP
705balloon
706-------
707
708Request VM to change its memory allocation (in bytes).
709
710Arguments:
711
712- "value": New memory allocation (json-int)
713
714Example:
715
716-> { "execute": "balloon", "arguments": { "value": 536870912 } }
717<- { "return": {} }
718
719EQMP
720
721 {
722 .name = "set_link",
723 .args_type = "name:s,up:b",
4b37156c 724 .mhandler.cmd_new = qmp_marshal_input_set_link,
82a56f0d
LC
725 },
726
727SQMP
728set_link
729--------
730
731Change the link status of a network adapter.
732
733Arguments:
734
735- "name": network device name (json-string)
736- "up": status is up (json-bool)
737
738Example:
739
740-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
741<- { "return": {} }
742
743EQMP
744
745 {
746 .name = "getfd",
747 .args_type = "fdname:s",
748 .params = "getfd name",
749 .help = "receive a file descriptor via SCM rights and assign it a name",
750 .user_print = monitor_user_noop,
751 .mhandler.cmd_new = do_getfd,
752 },
753
754SQMP
755getfd
756-----
757
758Receive a file descriptor via SCM rights and assign it a name.
759
760Arguments:
761
762- "fdname": file descriptor name (json-string)
763
764Example:
765
766-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
767<- { "return": {} }
768
769EQMP
770
771 {
772 .name = "closefd",
773 .args_type = "fdname:s",
774 .params = "closefd name",
775 .help = "close a file descriptor previously passed via SCM rights",
776 .user_print = monitor_user_noop,
777 .mhandler.cmd_new = do_closefd,
778 },
779
780SQMP
781closefd
782-------
783
784Close a file descriptor previously passed via SCM rights.
785
786Arguments:
787
788- "fdname": file descriptor name (json-string)
789
790Example:
791
792-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
793<- { "return": {} }
794
795EQMP
796
797 {
798 .name = "block_passwd",
799 .args_type = "device:B,password:s",
a4dea8a9 800 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
82a56f0d
LC
801 },
802
803SQMP
804block_passwd
805------------
806
807Set the password of encrypted block devices.
808
809Arguments:
810
811- "device": device name (json-string)
812- "password": password (json-string)
813
814Example:
815
816-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
817 "password": "12345" } }
818<- { "return": {} }
819
727f005e
ZYW
820EQMP
821
822 {
823 .name = "block_set_io_throttle",
824 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
825 .params = "device bps bps_rd bps_wr iops iops_rd iops_wr",
826 .help = "change I/O throttle limits for a block drive",
827 .user_print = monitor_user_noop,
828 .mhandler.cmd_new = do_block_set_io_throttle,
829 },
830
831SQMP
832block_set_io_throttle
833------------
834
835Change I/O throttle limits for a block drive.
836
837Arguments:
838
839- "device": device name (json-string)
840- "bps": total throughput limit in bytes per second(json-int)
841- "bps_rd": read throughput limit in bytes per second(json-int)
842- "bps_wr": read throughput limit in bytes per second(json-int)
843- "iops": total I/O operations per second(json-int)
844- "iops_rd": read I/O operations per second(json-int)
845- "iops_wr": write I/O operations per second(json-int)
846
847Example:
848
849-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
850 "bps": "1000000",
851 "bps_rd": "0",
852 "bps_wr": "0",
853 "iops": "0",
854 "iops_rd": "0",
855 "iops_wr": "0" } }
856<- { "return": {} }
857
7572150c
GH
858EQMP
859
860 {
861 .name = "set_password",
862 .args_type = "protocol:s,password:s,connected:s?",
863 .params = "protocol password action-if-connected",
864 .help = "set spice/vnc password",
865 .user_print = monitor_user_noop,
866 .mhandler.cmd_new = set_password,
867 },
868
869SQMP
870set_password
871------------
872
873Set the password for vnc/spice protocols.
874
875Arguments:
876
877- "protocol": protocol name (json-string)
878- "password": password (json-string)
879- "connected": [ keep | disconnect | fail ] (josn-string, optional)
880
881Example:
882
883-> { "execute": "set_password", "arguments": { "protocol": "vnc",
884 "password": "secret" } }
885<- { "return": {} }
886
887EQMP
888
889 {
890 .name = "expire_password",
891 .args_type = "protocol:s,time:s",
892 .params = "protocol time",
893 .help = "set spice/vnc password expire-time",
894 .user_print = monitor_user_noop,
895 .mhandler.cmd_new = expire_password,
896 },
897
898SQMP
899expire_password
900---------------
901
902Set the password expire time for vnc/spice protocols.
903
904Arguments:
905
906- "protocol": protocol name (json-string)
907- "time": [ now | never | +secs | secs ] (json-string)
908
909Example:
910
911-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
912 "time": "+60" } }
913<- { "return": {} }
914
82a56f0d
LC
915EQMP
916
13661089
DB
917 {
918 .name = "add_client",
919 .args_type = "protocol:s,fdname:s,skipauth:b?",
920 .params = "protocol fdname skipauth",
921 .help = "add a graphics client",
922 .user_print = monitor_user_noop,
923 .mhandler.cmd_new = add_graphics_client,
924 },
925
926SQMP
927add_client
928----------
929
930Add a graphics client
931
932Arguments:
933
934- "protocol": protocol name (json-string)
935- "fdname": file descriptor name (json-string)
936
937Example:
938
939-> { "execute": "add_client", "arguments": { "protocol": "vnc",
940 "fdname": "myclient" } }
941<- { "return": {} }
942
943EQMP
82a56f0d
LC
944 {
945 .name = "qmp_capabilities",
946 .args_type = "",
947 .params = "",
948 .help = "enable QMP capabilities",
949 .user_print = monitor_user_noop,
950 .mhandler.cmd_new = do_qmp_capabilities,
951 },
952
953SQMP
954qmp_capabilities
955----------------
956
957Enable QMP capabilities.
958
959Arguments: None.
960
961Example:
962
963-> { "execute": "qmp_capabilities" }
964<- { "return": {} }
965
966Note: This command must be issued before issuing any other command.
967
0268d97c
LC
968EQMP
969
970 {
971 .name = "human-monitor-command",
972 .args_type = "command-line:s,cpu-index:i?",
973 .params = "",
974 .help = "",
975 .user_print = monitor_user_noop,
976 .mhandler.cmd_new = do_hmp_passthrough,
977 },
978
979SQMP
980human-monitor-command
981---------------------
982
983Execute a Human Monitor command.
984
985Arguments:
986
987- command-line: the command name and its arguments, just like the
988 Human Monitor's shell (json-string)
989- cpu-index: select the CPU number to be used by commands which access CPU
990 data, like 'info registers'. The Monitor selects CPU 0 if this
991 argument is not provided (json-int, optional)
992
993Example:
994
995-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
996<- { "return": "kvm support: enabled\r\n" }
997
998Notes:
999
1000(1) The Human Monitor is NOT an stable interface, this means that command
1001 names, arguments and responses can change or be removed at ANY time.
1002 Applications that rely on long term stability guarantees should NOT
1003 use this command
1004
1005(2) Limitations:
1006
1007 o This command is stateless, this means that commands that depend
1008 on state information (such as getfd) might not work
1009
1010 o Commands that prompt the user for data (eg. 'cont' when the block
1011 device is encrypted) don't currently work
1012
82a56f0d
LC
10133. Query Commands
1014=================
1015
1016HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1017HXCOMM this! We will possibly move query commands definitions inside those
1018HXCOMM sections, just like regular commands.
1019
1020EQMP
1021
1022SQMP
1023query-version
1024-------------
1025
1026Show QEMU version.
1027
1028Return a json-object with the following information:
1029
1030- "qemu": A json-object containing three integer values:
1031 - "major": QEMU's major version (json-int)
1032 - "minor": QEMU's minor version (json-int)
1033 - "micro": QEMU's micro version (json-int)
1034- "package": package's version (json-string)
1035
1036Example:
1037
1038-> { "execute": "query-version" }
1039<- {
1040 "return":{
1041 "qemu":{
1042 "major":0,
1043 "minor":11,
1044 "micro":5
1045 },
1046 "package":""
1047 }
1048 }
1049
1050EQMP
1051
b9c15f16
LC
1052 {
1053 .name = "query-version",
1054 .args_type = "",
1055 .mhandler.cmd_new = qmp_marshal_input_query_version,
1056 },
1057
82a56f0d
LC
1058SQMP
1059query-commands
1060--------------
1061
1062List QMP available commands.
1063
1064Each command is represented by a json-object, the returned value is a json-array
1065of all commands.
1066
1067Each json-object contain:
1068
1069- "name": command's name (json-string)
1070
1071Example:
1072
1073-> { "execute": "query-commands" }
1074<- {
1075 "return":[
1076 {
1077 "name":"query-balloon"
1078 },
1079 {
1080 "name":"system_powerdown"
1081 }
1082 ]
1083 }
1084
1085Note: This example has been shortened as the real response is too long.
1086
1087EQMP
1088
aa9b79bc
LC
1089 {
1090 .name = "query-commands",
1091 .args_type = "",
1092 .mhandler.cmd_new = qmp_marshal_input_query_commands,
1093 },
1094
82a56f0d
LC
1095SQMP
1096query-chardev
1097-------------
1098
1099Each device is represented by a json-object. The returned value is a json-array
1100of all devices.
1101
1102Each json-object contain the following:
1103
1104- "label": device's label (json-string)
1105- "filename": device's file (json-string)
1106
1107Example:
1108
1109-> { "execute": "query-chardev" }
1110<- {
1111 "return":[
1112 {
1113 "label":"monitor",
1114 "filename":"stdio"
1115 },
1116 {
1117 "label":"serial0",
1118 "filename":"vc"
1119 }
1120 ]
1121 }
1122
1123EQMP
1124
c5a415a0
LC
1125 {
1126 .name = "query-chardev",
1127 .args_type = "",
1128 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
1129 },
1130
82a56f0d
LC
1131SQMP
1132query-block
1133-----------
1134
1135Show the block devices.
1136
1137Each block device information is stored in a json-object and the returned value
1138is a json-array of all devices.
1139
1140Each json-object contain the following:
1141
1142- "device": device name (json-string)
1143- "type": device type (json-string)
d8aeeb31
MA
1144 - deprecated, retained for backward compatibility
1145 - Possible values: "unknown"
82a56f0d
LC
1146- "removable": true if the device is removable, false otherwise (json-bool)
1147- "locked": true if the device is locked, false otherwise (json-bool)
e4def80b
MA
1148- "tray-open": only present if removable, true if the device has a tray,
1149 and it is open (json-bool)
82a56f0d
LC
1150- "inserted": only present if the device is inserted, it is a json-object
1151 containing the following:
1152 - "file": device file name (json-string)
1153 - "ro": true if read-only, false otherwise (json-bool)
1154 - "drv": driver format name (json-string)
1155 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1156 "file", "file", "ftp", "ftps", "host_cdrom",
1157 "host_device", "host_floppy", "http", "https",
1158 "nbd", "parallels", "qcow", "qcow2", "raw",
1159 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1160 - "backing_file": backing file name (json-string, optional)
1161 - "encrypted": true if encrypted, false otherwise (json-bool)
727f005e
ZYW
1162 - "bps": limit total bytes per second (json-int)
1163 - "bps_rd": limit read bytes per second (json-int)
1164 - "bps_wr": limit write bytes per second (json-int)
1165 - "iops": limit total I/O operations per second (json-int)
1166 - "iops_rd": limit read operations per second (json-int)
1167 - "iops_wr": limit write operations per second (json-int)
1168
f04ef601
LC
1169- "io-status": I/O operation status, only present if the device supports it
1170 and the VM is configured to stop on errors. It's always reset
1171 to "ok" when the "cont" command is issued (json_string, optional)
1172 - Possible values: "ok", "failed", "nospace"
82a56f0d
LC
1173
1174Example:
1175
1176-> { "execute": "query-block" }
1177<- {
1178 "return":[
1179 {
f04ef601 1180 "io-status": "ok",
82a56f0d
LC
1181 "device":"ide0-hd0",
1182 "locked":false,
1183 "removable":false,
1184 "inserted":{
1185 "ro":false,
1186 "drv":"qcow2",
1187 "encrypted":false,
727f005e
ZYW
1188 "file":"disks/test.img",
1189 "bps":1000000,
1190 "bps_rd":0,
1191 "bps_wr":0,
1192 "iops":1000000,
1193 "iops_rd":0,
1194 "iops_wr":0,
82a56f0d 1195 },
d8aeeb31 1196 "type":"unknown"
82a56f0d
LC
1197 },
1198 {
f04ef601 1199 "io-status": "ok",
82a56f0d
LC
1200 "device":"ide1-cd0",
1201 "locked":false,
1202 "removable":true,
d8aeeb31 1203 "type":"unknown"
82a56f0d
LC
1204 },
1205 {
1206 "device":"floppy0",
1207 "locked":false,
1208 "removable":true,
d8aeeb31 1209 "type":"unknown"
82a56f0d
LC
1210 },
1211 {
1212 "device":"sd0",
1213 "locked":false,
1214 "removable":true,
d8aeeb31 1215 "type":"unknown"
82a56f0d
LC
1216 }
1217 ]
1218 }
1219
1220EQMP
1221
b2023818
LC
1222 {
1223 .name = "query-block",
1224 .args_type = "",
1225 .mhandler.cmd_new = qmp_marshal_input_query_block,
1226 },
1227
82a56f0d
LC
1228SQMP
1229query-blockstats
1230----------------
1231
1232Show block device statistics.
1233
1234Each device statistic information is stored in a json-object and the returned
1235value is a json-array of all devices.
1236
1237Each json-object contain the following:
1238
1239- "device": device name (json-string)
1240- "stats": A json-object with the statistics information, it contains:
1241 - "rd_bytes": bytes read (json-int)
1242 - "wr_bytes": bytes written (json-int)
1243 - "rd_operations": read operations (json-int)
1244 - "wr_operations": write operations (json-int)
e8045d67 1245 - "flush_operations": cache flush operations (json-int)
c488c7f6
CH
1246 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1247 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1248 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
82a56f0d
LC
1249 - "wr_highest_offset": Highest offset of a sector written since the
1250 BlockDriverState has been opened (json-int)
1251- "parent": Contains recursively the statistics of the underlying
1252 protocol (e.g. the host file for a qcow2 image). If there is
1253 no underlying protocol, this field is omitted
1254 (json-object, optional)
1255
1256Example:
1257
1258-> { "execute": "query-blockstats" }
1259<- {
1260 "return":[
1261 {
1262 "device":"ide0-hd0",
1263 "parent":{
1264 "stats":{
1265 "wr_highest_offset":3686448128,
1266 "wr_bytes":9786368,
1267 "wr_operations":751,
1268 "rd_bytes":122567168,
1269 "rd_operations":36772
c488c7f6
CH
1270 "wr_total_times_ns":313253456
1271 "rd_total_times_ns":3465673657
1272 "flush_total_times_ns":49653
e8045d67 1273 "flush_operations":61,
82a56f0d
LC
1274 }
1275 },
1276 "stats":{
1277 "wr_highest_offset":2821110784,
1278 "wr_bytes":9786368,
1279 "wr_operations":692,
1280 "rd_bytes":122739200,
1281 "rd_operations":36604
e8045d67 1282 "flush_operations":51,
c488c7f6
CH
1283 "wr_total_times_ns":313253456
1284 "rd_total_times_ns":3465673657
1285 "flush_total_times_ns":49653
82a56f0d
LC
1286 }
1287 },
1288 {
1289 "device":"ide1-cd0",
1290 "stats":{
1291 "wr_highest_offset":0,
1292 "wr_bytes":0,
1293 "wr_operations":0,
1294 "rd_bytes":0,
1295 "rd_operations":0
e8045d67 1296 "flush_operations":0,
c488c7f6
CH
1297 "wr_total_times_ns":0
1298 "rd_total_times_ns":0
1299 "flush_total_times_ns":0
82a56f0d
LC
1300 }
1301 },
1302 {
1303 "device":"floppy0",
1304 "stats":{
1305 "wr_highest_offset":0,
1306 "wr_bytes":0,
1307 "wr_operations":0,
1308 "rd_bytes":0,
1309 "rd_operations":0
e8045d67 1310 "flush_operations":0,
c488c7f6
CH
1311 "wr_total_times_ns":0
1312 "rd_total_times_ns":0
1313 "flush_total_times_ns":0
82a56f0d
LC
1314 }
1315 },
1316 {
1317 "device":"sd0",
1318 "stats":{
1319 "wr_highest_offset":0,
1320 "wr_bytes":0,
1321 "wr_operations":0,
1322 "rd_bytes":0,
1323 "rd_operations":0
e8045d67 1324 "flush_operations":0,
c488c7f6
CH
1325 "wr_total_times_ns":0
1326 "rd_total_times_ns":0
1327 "flush_total_times_ns":0
82a56f0d
LC
1328 }
1329 }
1330 ]
1331 }
1332
1333EQMP
1334
f11f57e4
LC
1335 {
1336 .name = "query-blockstats",
1337 .args_type = "",
1338 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
1339 },
1340
82a56f0d
LC
1341SQMP
1342query-cpus
1343----------
1344
1345Show CPU information.
1346
1347Return a json-array. Each CPU is represented by a json-object, which contains:
1348
1349- "CPU": CPU index (json-int)
1350- "current": true if this is the current CPU, false otherwise (json-bool)
1351- "halted": true if the cpu is halted, false otherwise (json-bool)
1352- Current program counter. The key's name depends on the architecture:
1353 "pc": i386/x86_64 (json-int)
1354 "nip": PPC (json-int)
1355 "pc" and "npc": sparc (json-int)
1356 "PC": mips (json-int)
dc7a09cf 1357- "thread_id": ID of the underlying host thread (json-int)
82a56f0d
LC
1358
1359Example:
1360
1361-> { "execute": "query-cpus" }
1362<- {
1363 "return":[
1364 {
1365 "CPU":0,
1366 "current":true,
1367 "halted":false,
1368 "pc":3227107138
dc7a09cf 1369 "thread_id":3134
82a56f0d
LC
1370 },
1371 {
1372 "CPU":1,
1373 "current":false,
1374 "halted":true,
1375 "pc":7108165
dc7a09cf 1376 "thread_id":3135
82a56f0d
LC
1377 }
1378 ]
1379 }
1380
1381EQMP
1382
de0b36b6
LC
1383 {
1384 .name = "query-cpus",
1385 .args_type = "",
1386 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
1387 },
1388
82a56f0d
LC
1389SQMP
1390query-pci
1391---------
1392
1393PCI buses and devices information.
1394
1395The returned value is a json-array of all buses. Each bus is represented by
1396a json-object, which has a key with a json-array of all PCI devices attached
1397to it. Each device is represented by a json-object.
1398
1399The bus json-object contains the following:
1400
1401- "bus": bus number (json-int)
1402- "devices": a json-array of json-objects, each json-object represents a
1403 PCI device
1404
1405The PCI device json-object contains the following:
1406
1407- "bus": identical to the parent's bus number (json-int)
1408- "slot": slot number (json-int)
1409- "function": function number (json-int)
1410- "class_info": a json-object containing:
1411 - "desc": device class description (json-string, optional)
1412 - "class": device class number (json-int)
1413- "id": a json-object containing:
1414 - "device": device ID (json-int)
1415 - "vendor": vendor ID (json-int)
1416- "irq": device's IRQ if assigned (json-int, optional)
1417- "qdev_id": qdev id string (json-string)
1418- "pci_bridge": It's a json-object, only present if this device is a
1419 PCI bridge, contains:
1420 - "bus": bus number (json-int)
1421 - "secondary": secondary bus number (json-int)
1422 - "subordinate": subordinate bus number (json-int)
1423 - "io_range": I/O memory range information, a json-object with the
1424 following members:
1425 - "base": base address, in bytes (json-int)
1426 - "limit": limit address, in bytes (json-int)
1427 - "memory_range": memory range information, a json-object with the
1428 following members:
1429 - "base": base address, in bytes (json-int)
1430 - "limit": limit address, in bytes (json-int)
1431 - "prefetchable_range": Prefetchable memory range information, a
1432 json-object with the following members:
1433 - "base": base address, in bytes (json-int)
1434 - "limit": limit address, in bytes (json-int)
1435 - "devices": a json-array of PCI devices if there's any attached, each
1436 each element is represented by a json-object, which contains
1437 the same members of the 'PCI device json-object' described
1438 above (optional)
1439- "regions": a json-array of json-objects, each json-object represents a
1440 memory region of this device
1441
1442The memory range json-object contains the following:
1443
1444- "base": base memory address (json-int)
1445- "limit": limit value (json-int)
1446
1447The region json-object can be an I/O region or a memory region, an I/O region
1448json-object contains the following:
1449
1450- "type": "io" (json-string, fixed)
1451- "bar": BAR number (json-int)
1452- "address": memory address (json-int)
1453- "size": memory size (json-int)
1454
1455A memory region json-object contains the following:
1456
1457- "type": "memory" (json-string, fixed)
1458- "bar": BAR number (json-int)
1459- "address": memory address (json-int)
1460- "size": memory size (json-int)
1461- "mem_type_64": true or false (json-bool)
1462- "prefetch": true or false (json-bool)
1463
1464Example:
1465
1466-> { "execute": "query-pci" }
1467<- {
1468 "return":[
1469 {
1470 "bus":0,
1471 "devices":[
1472 {
1473 "bus":0,
1474 "qdev_id":"",
1475 "slot":0,
1476 "class_info":{
1477 "class":1536,
1478 "desc":"Host bridge"
1479 },
1480 "id":{
1481 "device":32902,
1482 "vendor":4663
1483 },
1484 "function":0,
1485 "regions":[
1486
1487 ]
1488 },
1489 {
1490 "bus":0,
1491 "qdev_id":"",
1492 "slot":1,
1493 "class_info":{
1494 "class":1537,
1495 "desc":"ISA bridge"
1496 },
1497 "id":{
1498 "device":32902,
1499 "vendor":28672
1500 },
1501 "function":0,
1502 "regions":[
1503
1504 ]
1505 },
1506 {
1507 "bus":0,
1508 "qdev_id":"",
1509 "slot":1,
1510 "class_info":{
1511 "class":257,
1512 "desc":"IDE controller"
1513 },
1514 "id":{
1515 "device":32902,
1516 "vendor":28688
1517 },
1518 "function":1,
1519 "regions":[
1520 {
1521 "bar":4,
1522 "size":16,
1523 "address":49152,
1524 "type":"io"
1525 }
1526 ]
1527 },
1528 {
1529 "bus":0,
1530 "qdev_id":"",
1531 "slot":2,
1532 "class_info":{
1533 "class":768,
1534 "desc":"VGA controller"
1535 },
1536 "id":{
1537 "device":4115,
1538 "vendor":184
1539 },
1540 "function":0,
1541 "regions":[
1542 {
1543 "prefetch":true,
1544 "mem_type_64":false,
1545 "bar":0,
1546 "size":33554432,
1547 "address":4026531840,
1548 "type":"memory"
1549 },
1550 {
1551 "prefetch":false,
1552 "mem_type_64":false,
1553 "bar":1,
1554 "size":4096,
1555 "address":4060086272,
1556 "type":"memory"
1557 },
1558 {
1559 "prefetch":false,
1560 "mem_type_64":false,
1561 "bar":6,
1562 "size":65536,
1563 "address":-1,
1564 "type":"memory"
1565 }
1566 ]
1567 },
1568 {
1569 "bus":0,
1570 "qdev_id":"",
1571 "irq":11,
1572 "slot":4,
1573 "class_info":{
1574 "class":1280,
1575 "desc":"RAM controller"
1576 },
1577 "id":{
1578 "device":6900,
1579 "vendor":4098
1580 },
1581 "function":0,
1582 "regions":[
1583 {
1584 "bar":0,
1585 "size":32,
1586 "address":49280,
1587 "type":"io"
1588 }
1589 ]
1590 }
1591 ]
1592 }
1593 ]
1594 }
1595
1596Note: This example has been shortened as the real response is too long.
1597
1598EQMP
1599
79627472
LC
1600 {
1601 .name = "query-pci",
1602 .args_type = "",
1603 .mhandler.cmd_new = qmp_marshal_input_query_pci,
1604 },
1605
82a56f0d
LC
1606SQMP
1607query-kvm
1608---------
1609
1610Show KVM information.
1611
1612Return a json-object with the following information:
1613
1614- "enabled": true if KVM support is enabled, false otherwise (json-bool)
1615- "present": true if QEMU has KVM support, false otherwise (json-bool)
1616
1617Example:
1618
1619-> { "execute": "query-kvm" }
1620<- { "return": { "enabled": true, "present": true } }
1621
1622EQMP
1623
292a2602
LC
1624 {
1625 .name = "query-kvm",
1626 .args_type = "",
1627 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
1628 },
1629
82a56f0d
LC
1630SQMP
1631query-status
1632------------
1633
1634Return a json-object with the following information:
1635
1636- "running": true if the VM is running, or false if it is paused (json-bool)
1637- "singlestep": true if the VM is in single step mode,
1638 false otherwise (json-bool)
9e37b9dc
LC
1639- "status": one of the following values (json-string)
1640 "debug" - QEMU is running on a debugger
1641 "inmigrate" - guest is paused waiting for an incoming migration
1642 "internal-error" - An internal error that prevents further guest
1643 execution has occurred
1644 "io-error" - the last IOP has failed and the device is configured
1645 to pause on I/O errors
1646 "paused" - guest has been paused via the 'stop' command
1647 "postmigrate" - guest is paused following a successful 'migrate'
1648 "prelaunch" - QEMU was started with -S and guest has not started
1649 "finish-migrate" - guest is paused to finish the migration process
1650 "restore-vm" - guest is paused to restore VM state
1651 "running" - guest is actively running
1652 "save-vm" - guest is paused to save the VM state
1653 "shutdown" - guest is shut down (and -no-shutdown is in use)
1654 "watchdog" - the watchdog action is configured to pause and
1655 has been triggered
82a56f0d
LC
1656
1657Example:
1658
1659-> { "execute": "query-status" }
9e37b9dc 1660<- { "return": { "running": true, "singlestep": false, "status": "running" } }
82a56f0d
LC
1661
1662EQMP
1fa9a5e4
LC
1663
1664 {
1665 .name = "query-status",
1666 .args_type = "",
1667 .mhandler.cmd_new = qmp_marshal_input_query_status,
1668 },
82a56f0d
LC
1669
1670SQMP
1671query-mice
1672----------
1673
1674Show VM mice information.
1675
1676Each mouse is represented by a json-object, the returned value is a json-array
1677of all mice.
1678
1679The mouse json-object contains the following:
1680
1681- "name": mouse's name (json-string)
1682- "index": mouse's index (json-int)
1683- "current": true if this mouse is receiving events, false otherwise (json-bool)
1684- "absolute": true if the mouse generates absolute input events (json-bool)
1685
1686Example:
1687
1688-> { "execute": "query-mice" }
1689<- {
1690 "return":[
1691 {
1692 "name":"QEMU Microsoft Mouse",
1693 "index":0,
1694 "current":false,
1695 "absolute":false
1696 },
1697 {
1698 "name":"QEMU PS/2 Mouse",
1699 "index":1,
1700 "current":true,
1701 "absolute":true
1702 }
1703 ]
1704 }
1705
1706EQMP
1707
e235cec3
LC
1708 {
1709 .name = "query-mice",
1710 .args_type = "",
1711 .mhandler.cmd_new = qmp_marshal_input_query_mice,
1712 },
1713
82a56f0d
LC
1714SQMP
1715query-vnc
1716---------
1717
1718Show VNC server information.
1719
1720Return a json-object with server information. Connected clients are returned
1721as a json-array of json-objects.
1722
1723The main json-object contains the following:
1724
1725- "enabled": true or false (json-bool)
1726- "host": server's IP address (json-string)
1727- "family": address family (json-string)
1728 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1729- "service": server's port number (json-string)
1730- "auth": authentication method (json-string)
1731 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
1732 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
1733 "vencrypt+plain", "vencrypt+tls+none",
1734 "vencrypt+tls+plain", "vencrypt+tls+sasl",
1735 "vencrypt+tls+vnc", "vencrypt+x509+none",
1736 "vencrypt+x509+plain", "vencrypt+x509+sasl",
1737 "vencrypt+x509+vnc", "vnc"
1738- "clients": a json-array of all connected clients
1739
1740Clients are described by a json-object, each one contain the following:
1741
1742- "host": client's IP address (json-string)
1743- "family": address family (json-string)
1744 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1745- "service": client's port number (json-string)
1746- "x509_dname": TLS dname (json-string, optional)
1747- "sasl_username": SASL username (json-string, optional)
1748
1749Example:
1750
1751-> { "execute": "query-vnc" }
1752<- {
1753 "return":{
1754 "enabled":true,
1755 "host":"0.0.0.0",
1756 "service":"50402",
1757 "auth":"vnc",
1758 "family":"ipv4",
1759 "clients":[
1760 {
1761 "host":"127.0.0.1",
1762 "service":"50401",
1763 "family":"ipv4"
1764 }
1765 ]
1766 }
1767 }
1768
1769EQMP
1770
2b54aa87
LC
1771 {
1772 .name = "query-vnc",
1773 .args_type = "",
1774 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
1775 },
1776
cb42a870
GH
1777SQMP
1778query-spice
1779-----------
1780
1781Show SPICE server information.
1782
1783Return a json-object with server information. Connected clients are returned
1784as a json-array of json-objects.
1785
1786The main json-object contains the following:
1787
1788- "enabled": true or false (json-bool)
1789- "host": server's IP address (json-string)
1790- "port": server's port number (json-int, optional)
1791- "tls-port": server's port number (json-int, optional)
1792- "auth": authentication method (json-string)
1793 - Possible values: "none", "spice"
1794- "channels": a json-array of all active channels clients
1795
1796Channels are described by a json-object, each one contain the following:
1797
1798- "host": client's IP address (json-string)
1799- "family": address family (json-string)
1800 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1801- "port": client's port number (json-string)
1802- "connection-id": spice connection id. All channels with the same id
1803 belong to the same spice session (json-int)
1804- "channel-type": channel type. "1" is the main control channel, filter for
1805 this one if you want track spice sessions only (json-int)
1806- "channel-id": channel id. Usually "0", might be different needed when
1807 multiple channels of the same type exist, such as multiple
1808 display channels in a multihead setup (json-int)
1809- "tls": whevener the channel is encrypted (json-bool)
1810
1811Example:
1812
1813-> { "execute": "query-spice" }
1814<- {
1815 "return": {
1816 "enabled": true,
1817 "auth": "spice",
1818 "port": 5920,
1819 "tls-port": 5921,
1820 "host": "0.0.0.0",
1821 "channels": [
1822 {
1823 "port": "54924",
1824 "family": "ipv4",
1825 "channel-type": 1,
1826 "connection-id": 1804289383,
1827 "host": "127.0.0.1",
1828 "channel-id": 0,
1829 "tls": true
1830 },
1831 {
1832 "port": "36710",
1833 "family": "ipv4",
1834 "channel-type": 4,
1835 "connection-id": 1804289383,
1836 "host": "127.0.0.1",
1837 "channel-id": 0,
1838 "tls": false
1839 },
1840 [ ... more channels follow ... ]
1841 ]
1842 }
1843 }
1844
1845EQMP
1846
d1f29646
LC
1847#if defined(CONFIG_SPICE)
1848 {
1849 .name = "query-spice",
1850 .args_type = "",
1851 .mhandler.cmd_new = qmp_marshal_input_query_spice,
1852 },
1853#endif
1854
82a56f0d
LC
1855SQMP
1856query-name
1857----------
1858
1859Show VM name.
1860
1861Return a json-object with the following information:
1862
1863- "name": VM's name (json-string, optional)
1864
1865Example:
1866
1867-> { "execute": "query-name" }
1868<- { "return": { "name": "qemu-name" } }
1869
1870EQMP
1871
48a32bed
AL
1872 {
1873 .name = "query-name",
1874 .args_type = "",
1875 .mhandler.cmd_new = qmp_marshal_input_query_name,
1876 },
1877
82a56f0d
LC
1878SQMP
1879query-uuid
1880----------
1881
1882Show VM UUID.
1883
1884Return a json-object with the following information:
1885
1886- "UUID": Universally Unique Identifier (json-string)
1887
1888Example:
1889
1890-> { "execute": "query-uuid" }
1891<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
1892
1893EQMP
1894
efab767e
LC
1895 {
1896 .name = "query-uuid",
1897 .args_type = "",
1898 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
1899 },
1900
82a56f0d
LC
1901SQMP
1902query-migrate
1903-------------
1904
1905Migration status.
1906
1907Return a json-object. If migration is active there will be another json-object
1908with RAM migration status and if block migration is active another one with
1909block migration status.
1910
1911The main json-object contains the following:
1912
1913- "status": migration status (json-string)
1914 - Possible values: "active", "completed", "failed", "cancelled"
1915- "ram": only present if "status" is "active", it is a json-object with the
1916 following RAM information (in bytes):
1917 - "transferred": amount transferred (json-int)
1918 - "remaining": amount remaining (json-int)
1919 - "total": total (json-int)
1920- "disk": only present if "status" is "active" and it is a block migration,
1921 it is a json-object with the following disk information (in bytes):
1922 - "transferred": amount transferred (json-int)
1923 - "remaining": amount remaining (json-int)
1924 - "total": total (json-int)
1925
1926Examples:
1927
19281. Before the first migration
1929
1930-> { "execute": "query-migrate" }
1931<- { "return": {} }
1932
19332. Migration is done and has succeeded
1934
1935-> { "execute": "query-migrate" }
1936<- { "return": { "status": "completed" } }
1937
19383. Migration is done and has failed
1939
1940-> { "execute": "query-migrate" }
1941<- { "return": { "status": "failed" } }
1942
19434. Migration is being performed and is not a block migration:
1944
1945-> { "execute": "query-migrate" }
1946<- {
1947 "return":{
1948 "status":"active",
1949 "ram":{
1950 "transferred":123,
1951 "remaining":123,
1952 "total":246
1953 }
1954 }
1955 }
1956
19575. Migration is being performed and is a block migration:
1958
1959-> { "execute": "query-migrate" }
1960<- {
1961 "return":{
1962 "status":"active",
1963 "ram":{
1964 "total":1057024,
1965 "remaining":1053304,
1966 "transferred":3720
1967 },
1968 "disk":{
1969 "total":20971520,
1970 "remaining":20880384,
1971 "transferred":91136
1972 }
1973 }
1974 }
1975
1976EQMP
1977
791e7c82
LC
1978 {
1979 .name = "query-migrate",
1980 .args_type = "",
1981 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
1982 },
1983
82a56f0d
LC
1984SQMP
1985query-balloon
1986-------------
1987
1988Show balloon information.
1989
1990Make an asynchronous request for balloon info. When the request completes a
1991json-object will be returned containing the following data:
1992
1993- "actual": current balloon value in bytes (json-int)
1994- "mem_swapped_in": Amount of memory swapped in bytes (json-int, optional)
1995- "mem_swapped_out": Amount of memory swapped out in bytes (json-int, optional)
1996- "major_page_faults": Number of major faults (json-int, optional)
1997- "minor_page_faults": Number of minor faults (json-int, optional)
1998- "free_mem": Total amount of free and unused memory in
1999 bytes (json-int, optional)
2000- "total_mem": Total amount of available memory in bytes (json-int, optional)
2001
2002Example:
2003
2004-> { "execute": "query-balloon" }
2005<- {
2006 "return":{
2007 "actual":1073741824,
2008 "mem_swapped_in":0,
2009 "mem_swapped_out":0,
2010 "major_page_faults":142,
2011 "minor_page_faults":239245,
2012 "free_mem":1014185984,
2013 "total_mem":1044668416
2014 }
2015 }
2016
2017EQMP
2018
96637bcd
LC
2019 {
2020 .name = "query-balloon",
2021 .args_type = "",
2022 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
2023 },