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