]> git.proxmox.com Git - mirror_qemu.git/blame - qmp-commands.hx
exec: separate current radix tree from the one being built
[mirror_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",
c245b6a3 87 .mhandler.cmd_new = qmp_marshal_input_eject,
82a56f0d
LC
88 },
89
90SQMP
91eject
92-----
93
94Eject a removable medium.
95
96Arguments:
97
98- force: force ejection (json-bool, optional)
99- device: device name (json-string)
100
101Example:
102
103-> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
104<- { "return": {} }
105
106Note: The "force" argument defaults to false.
107
108EQMP
109
110 {
111 .name = "change",
112 .args_type = "device:B,target:F,arg:s?",
333a96ec 113 .mhandler.cmd_new = qmp_marshal_input_change,
82a56f0d
LC
114 },
115
116SQMP
117change
118------
119
120Change a removable medium or VNC configuration.
121
122Arguments:
123
124- "device": device name (json-string)
125- "target": filename or item (json-string)
126- "arg": additional argument (json-string, optional)
127
128Examples:
129
1301. Change a removable medium
131
132-> { "execute": "change",
133 "arguments": { "device": "ide1-cd0",
134 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
135<- { "return": {} }
136
1372. Change VNC password
138
139-> { "execute": "change",
140 "arguments": { "device": "vnc", "target": "password",
141 "arg": "foobar1" } }
142<- { "return": {} }
143
144EQMP
145
146 {
147 .name = "screendump",
148 .args_type = "filename:F",
ad39cf6d 149 .mhandler.cmd_new = qmp_marshal_input_screendump,
82a56f0d
LC
150 },
151
152SQMP
153screendump
154----------
155
156Save screen into PPM image.
157
158Arguments:
159
160- "filename": file path (json-string)
161
162Example:
163
164-> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
165<- { "return": {} }
166
167EQMP
168
169 {
170 .name = "stop",
171 .args_type = "",
5f158f21 172 .mhandler.cmd_new = qmp_marshal_input_stop,
82a56f0d
LC
173 },
174
175SQMP
176stop
177----
178
179Stop the emulator.
180
181Arguments: None.
182
183Example:
184
185-> { "execute": "stop" }
186<- { "return": {} }
187
188EQMP
189
190 {
191 .name = "cont",
192 .args_type = "",
e42e818b 193 .mhandler.cmd_new = qmp_marshal_input_cont,
82a56f0d
LC
194 },
195
196SQMP
197cont
198----
199
200Resume emulation.
201
202Arguments: None.
203
204Example:
205
206-> { "execute": "cont" }
207<- { "return": {} }
9b9df25a
GH
208
209EQMP
210
211 {
212 .name = "system_wakeup",
213 .args_type = "",
214 .mhandler.cmd_new = qmp_marshal_input_system_wakeup,
215 },
216
217SQMP
218system_wakeup
219-------------
220
221Wakeup guest from suspend.
222
223Arguments: None.
224
225Example:
226
227-> { "execute": "system_wakeup" }
228<- { "return": {} }
82a56f0d
LC
229
230EQMP
231
232 {
233 .name = "system_reset",
234 .args_type = "",
38d22653 235 .mhandler.cmd_new = qmp_marshal_input_system_reset,
82a56f0d
LC
236 },
237
238SQMP
239system_reset
240------------
241
242Reset the system.
243
244Arguments: None.
245
246Example:
247
248-> { "execute": "system_reset" }
249<- { "return": {} }
250
251EQMP
252
253 {
254 .name = "system_powerdown",
255 .args_type = "",
22e1bb9c 256 .mhandler.cmd_new = qmp_marshal_input_system_powerdown,
82a56f0d
LC
257 },
258
259SQMP
260system_powerdown
261----------------
262
263Send system power down event.
264
265Arguments: None.
266
267Example:
268
269-> { "execute": "system_powerdown" }
270<- { "return": {} }
271
272EQMP
273
274 {
275 .name = "device_add",
276 .args_type = "device:O",
277 .params = "driver[,prop=value][,...]",
278 .help = "add device, like -device on the command line",
279 .user_print = monitor_user_noop,
280 .mhandler.cmd_new = do_device_add,
281 },
282
283SQMP
284device_add
285----------
286
287Add a device.
288
289Arguments:
290
291- "driver": the name of the new device's driver (json-string)
292- "bus": the device's parent bus (device tree path, json-string, optional)
293- "id": the device's ID, must be unique (json-string)
294- device properties
295
296Example:
297
298-> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
299<- { "return": {} }
300
301Notes:
302
303(1) For detailed information about this command, please refer to the
304 'docs/qdev-device-use.txt' file.
305
306(2) It's possible to list device properties by running QEMU with the
307 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
308
309EQMP
310
311 {
312 .name = "device_del",
313 .args_type = "id:s",
a15fef21 314 .mhandler.cmd_new = qmp_marshal_input_device_del,
82a56f0d
LC
315 },
316
317SQMP
318device_del
319----------
320
321Remove a device.
322
323Arguments:
324
325- "id": the device's ID (json-string)
326
327Example:
328
329-> { "execute": "device_del", "arguments": { "id": "net1" } }
330<- { "return": {} }
331
e4c8f004
AK
332EQMP
333
334 {
335 .name = "send-key",
336 .args_type = "keys:O,hold-time:i?",
337 .mhandler.cmd_new = qmp_marshal_input_send_key,
338 },
339
340SQMP
341send-key
342----------
343
344Send keys to VM.
345
346Arguments:
347
348keys array:
349 - "key": key sequence (a json-array of key enum values)
350
351- hold-time: time to delay key up events, milliseconds. Defaults to 100
352 (json-int, optional)
353
354Example:
355
356-> { "execute": "send-key",
357 "arguments": { 'keys': [ 'ctrl', 'alt', 'delete' ] } }
358<- { "return": {} }
359
82a56f0d
LC
360EQMP
361
362 {
363 .name = "cpu",
364 .args_type = "index:i",
755f1968 365 .mhandler.cmd_new = qmp_marshal_input_cpu,
82a56f0d
LC
366 },
367
368SQMP
369cpu
370---
371
372Set the default CPU.
373
374Arguments:
375
376- "index": the CPU's index (json-int)
377
378Example:
379
380-> { "execute": "cpu", "arguments": { "index": 0 } }
381<- { "return": {} }
382
383Note: CPUs' indexes are obtained with the 'query-cpus' command.
384
69ca3ea5
IM
385EQMP
386
387 {
388 .name = "cpu-add",
389 .args_type = "id:i",
390 .mhandler.cmd_new = qmp_marshal_input_cpu_add,
391 },
392
393SQMP
394cpu-add
395-------
396
397Adds virtual cpu
398
399Arguments:
400
401- "id": cpu id (json-int)
402
403Example:
404
405-> { "execute": "cpu-add", "arguments": { "id": 2 } }
406<- { "return": {} }
407
82a56f0d
LC
408EQMP
409
410 {
411 .name = "memsave",
0cfd6a9a
LC
412 .args_type = "val:l,size:i,filename:s,cpu:i?",
413 .mhandler.cmd_new = qmp_marshal_input_memsave,
82a56f0d
LC
414 },
415
416SQMP
417memsave
418-------
419
420Save to disk virtual memory dump starting at 'val' of size 'size'.
421
422Arguments:
423
424- "val": the starting address (json-int)
425- "size": the memory size, in bytes (json-int)
426- "filename": file path (json-string)
0cfd6a9a 427- "cpu": virtual CPU index (json-int, optional)
82a56f0d
LC
428
429Example:
430
431-> { "execute": "memsave",
432 "arguments": { "val": 10,
433 "size": 100,
434 "filename": "/tmp/virtual-mem-dump" } }
435<- { "return": {} }
436
82a56f0d
LC
437EQMP
438
439 {
440 .name = "pmemsave",
441 .args_type = "val:l,size:i,filename:s",
6d3962bf 442 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
82a56f0d
LC
443 },
444
445SQMP
446pmemsave
447--------
448
449Save to disk physical memory dump starting at 'val' of size 'size'.
450
451Arguments:
452
453- "val": the starting address (json-int)
454- "size": the memory size, in bytes (json-int)
455- "filename": file path (json-string)
456
457Example:
458
459-> { "execute": "pmemsave",
460 "arguments": { "val": 10,
461 "size": 100,
462 "filename": "/tmp/physical-mem-dump" } }
463<- { "return": {} }
464
a4046664
LJ
465EQMP
466
467 {
468 .name = "inject-nmi",
469 .args_type = "",
ab49ab5c 470 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
a4046664
LJ
471 },
472
473SQMP
474inject-nmi
475----------
476
477Inject an NMI on guest's CPUs.
478
479Arguments: None.
480
481Example:
482
483-> { "execute": "inject-nmi" }
484<- { "return": {} }
485
de253f14
LC
486Note: inject-nmi fails when the guest doesn't support injecting.
487 Currently, only x86 guests do.
a4046664 488
1f590cf9
LL
489EQMP
490
491 {
3949e594 492 .name = "ringbuf-write",
82e59a67 493 .args_type = "device:s,data:s,format:s?",
3949e594 494 .mhandler.cmd_new = qmp_marshal_input_ringbuf_write,
1f590cf9
LL
495 },
496
497SQMP
3949e594 498ringbuf-write
1f590cf9
LL
499-------------
500
3949e594 501Write to a ring buffer character device.
1f590cf9
LL
502
503Arguments:
504
3949e594
MA
505- "device": ring buffer character device name (json-string)
506- "data": data to write (json-string)
507- "format": data format (json-string, optional)
508 - Possible values: "utf8" (default), "base64"
509 Bug: invalid base64 is currently not rejected.
510 Whitespace *is* invalid.
1f590cf9
LL
511
512Example:
513
3949e594
MA
514-> { "execute": "ringbuf-write",
515 "arguments": { "device": "foo",
1f590cf9
LL
516 "data": "abcdefgh",
517 "format": "utf8" } }
518<- { "return": {} }
519
49b6d722
LL
520EQMP
521
522 {
3949e594 523 .name = "ringbuf-read",
49b6d722 524 .args_type = "device:s,size:i,format:s?",
3949e594 525 .mhandler.cmd_new = qmp_marshal_input_ringbuf_read,
49b6d722
LL
526 },
527
528SQMP
3949e594 529ringbuf-read
49b6d722
LL
530-------------
531
3949e594 532Read from a ring buffer character device.
49b6d722
LL
533
534Arguments:
535
3949e594
MA
536- "device": ring buffer character device name (json-string)
537- "size": how many bytes to read at most (json-int)
538 - Number of data bytes, not number of characters in encoded data
539- "format": data format (json-string, optional)
540 - Possible values: "utf8" (default), "base64"
541 - Naturally, format "utf8" works only when the ring buffer
542 contains valid UTF-8 text. Invalid UTF-8 sequences get
543 replaced. Bug: replacement doesn't work. Bug: can screw
544 up on encountering NUL characters, after the ring buffer
545 lost data, and when reading stops because the size limit
546 is reached.
49b6d722
LL
547
548Example:
549
3949e594
MA
550-> { "execute": "ringbuf-read",
551 "arguments": { "device": "foo",
49b6d722
LL
552 "size": 1000,
553 "format": "utf8" } }
3ab651fc 554<- {"return": "abcdefgh"}
49b6d722 555
a7ae8355
SS
556EQMP
557
558 {
559 .name = "xen-save-devices-state",
560 .args_type = "filename:F",
561 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
562 },
563
564SQMP
565xen-save-devices-state
566-------
567
568Save the state of all devices to file. The RAM and the block devices
569of the VM are not saved by this command.
570
571Arguments:
572
573- "filename": the file to save the state of the devices to as binary
574data. See xen-save-devices-state.txt for a description of the binary
575format.
576
577Example:
578
579-> { "execute": "xen-save-devices-state",
580 "arguments": { "filename": "/tmp/save" } }
581<- { "return": {} }
582
39f42439
AP
583EQMP
584
585 {
586 .name = "xen-set-global-dirty-log",
587 .args_type = "enable:b",
588 .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
589 },
590
591SQMP
592xen-set-global-dirty-log
593-------
594
595Enable or disable the global dirty log mode.
596
597Arguments:
598
599- "enable": Enable it or disable it.
600
601Example:
602
603-> { "execute": "xen-set-global-dirty-log",
604 "arguments": { "enable": true } }
605<- { "return": {} }
606
82a56f0d
LC
607EQMP
608
609 {
610 .name = "migrate",
611 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
e1c37d0e 612 .mhandler.cmd_new = qmp_marshal_input_migrate,
82a56f0d
LC
613 },
614
615SQMP
616migrate
617-------
618
619Migrate to URI.
620
621Arguments:
622
623- "blk": block migration, full disk copy (json-bool, optional)
624- "inc": incremental disk copy (json-bool, optional)
625- "uri": Destination URI (json-string)
626
627Example:
628
629-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
630<- { "return": {} }
631
632Notes:
633
634(1) The 'query-migrate' command should be used to check migration's progress
635 and final result (this information is provided by the 'status' member)
636(2) All boolean arguments default to false
637(3) The user Monitor's "detach" argument is invalid in QMP and should not
638 be used
639
640EQMP
641
642 {
643 .name = "migrate_cancel",
644 .args_type = "",
6cdedb07 645 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
82a56f0d
LC
646 },
647
648SQMP
649migrate_cancel
650--------------
651
652Cancel the current migration.
653
654Arguments: None.
655
656Example:
657
658-> { "execute": "migrate_cancel" }
659<- { "return": {} }
660
9e1ba4cc
OW
661EQMP
662{
663 .name = "migrate-set-cache-size",
664 .args_type = "value:o",
665 .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
666 },
667
668SQMP
669migrate-set-cache-size
817c6045 670----------------------
9e1ba4cc
OW
671
672Set cache size to be used by XBZRLE migration, the cache size will be rounded
673down to the nearest power of 2
674
675Arguments:
676
677- "value": cache size in bytes (json-int)
678
679Example:
680
681-> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
682<- { "return": {} }
683
684EQMP
685 {
686 .name = "query-migrate-cache-size",
687 .args_type = "",
688 .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
689 },
690
691SQMP
692query-migrate-cache-size
817c6045 693------------------------
9e1ba4cc
OW
694
695Show cache size to be used by XBZRLE migration
696
697returns a json-object with the following information:
698- "size" : json-int
699
700Example:
701
702-> { "execute": "query-migrate-cache-size" }
703<- { "return": 67108864 }
704
82a56f0d
LC
705EQMP
706
707 {
708 .name = "migrate_set_speed",
3a019b6e 709 .args_type = "value:o",
3dc85383 710 .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
82a56f0d
LC
711 },
712
e866e239 713SQMP
ff73edf5
JS
714migrate_set_speed
715-----------------
e866e239 716
ff73edf5 717Set maximum speed for migrations.
e866e239
GH
718
719Arguments:
720
ff73edf5 721- "value": maximum speed, in bytes per second (json-int)
e866e239
GH
722
723Example:
724
ff73edf5 725-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
e866e239
GH
726<- { "return": {} }
727
728EQMP
729
730 {
ff73edf5
JS
731 .name = "migrate_set_downtime",
732 .args_type = "value:T",
4f0a993b 733 .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
e866e239
GH
734 },
735
82a56f0d 736SQMP
ff73edf5
JS
737migrate_set_downtime
738--------------------
82a56f0d 739
ff73edf5 740Set maximum tolerated downtime (in seconds) for migrations.
82a56f0d
LC
741
742Arguments:
743
ff73edf5 744- "value": maximum downtime (json-number)
82a56f0d
LC
745
746Example:
747
ff73edf5 748-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
82a56f0d
LC
749<- { "return": {} }
750
751EQMP
752
753 {
ff73edf5
JS
754 .name = "client_migrate_info",
755 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
756 .params = "protocol hostname port tls-port cert-subject",
757 .help = "send migration info to spice/vnc client",
82a56f0d 758 .user_print = monitor_user_noop,
edc5cb1a
YH
759 .mhandler.cmd_async = client_migrate_info,
760 .flags = MONITOR_CMD_ASYNC,
82a56f0d
LC
761 },
762
763SQMP
ff73edf5
JS
764client_migrate_info
765------------------
82a56f0d 766
ff73edf5
JS
767Set the spice/vnc connection info for the migration target. The spice/vnc
768server will ask the spice/vnc client to automatically reconnect using the
769new parameters (if specified) once the vm migration finished successfully.
82a56f0d
LC
770
771Arguments:
772
ff73edf5
JS
773- "protocol": protocol: "spice" or "vnc" (json-string)
774- "hostname": migration target hostname (json-string)
775- "port": spice/vnc tcp port for plaintext channels (json-int, optional)
776- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
777- "cert-subject": server certificate subject (json-string, optional)
82a56f0d
LC
778
779Example:
780
ff73edf5
JS
781-> { "execute": "client_migrate_info",
782 "arguments": { "protocol": "spice",
783 "hostname": "virt42.lab.kraxel.org",
784 "port": 1234 } }
82a56f0d
LC
785<- { "return": {} }
786
783e9b48
WC
787EQMP
788
789 {
790 .name = "dump-guest-memory",
791 .args_type = "paging:b,protocol:s,begin:i?,end:i?",
792 .params = "-p protocol [begin] [length]",
793 .help = "dump guest memory to file",
794 .user_print = monitor_user_noop,
795 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
796 },
797
798SQMP
799dump
800
801
802Dump guest memory to file. The file can be processed with crash or gdb.
803
804Arguments:
805
806- "paging": do paging to get guest's memory mapping (json-bool)
807- "protocol": destination file(started with "file:") or destination file
808 descriptor (started with "fd:") (json-string)
809- "begin": the starting physical address. It's optional, and should be specified
810 with length together (json-int)
811- "length": the memory size, in bytes. It's optional, and should be specified
812 with begin together (json-int)
813
814Example:
815
816-> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
817<- { "return": {} }
818
819Notes:
820
821(1) All boolean arguments default to false
822
82a56f0d
LC
823EQMP
824
825 {
826 .name = "netdev_add",
827 .args_type = "netdev:O",
928059a3 828 .mhandler.cmd_new = qmp_netdev_add,
82a56f0d
LC
829 },
830
831SQMP
832netdev_add
833----------
834
835Add host network device.
836
837Arguments:
838
839- "type": the device type, "tap", "user", ... (json-string)
840- "id": the device's ID, must be unique (json-string)
841- device options
842
843Example:
844
845-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
846<- { "return": {} }
847
af347aa5 848Note: The supported device options are the same ones supported by the '-netdev'
82a56f0d
LC
849 command-line argument, which are listed in the '-help' output or QEMU's
850 manual
851
852EQMP
853
854 {
855 .name = "netdev_del",
856 .args_type = "id:s",
5f964155 857 .mhandler.cmd_new = qmp_marshal_input_netdev_del,
82a56f0d
LC
858 },
859
860SQMP
861netdev_del
862----------
863
864Remove host network device.
865
866Arguments:
867
868- "id": the device's ID, must be unique (json-string)
869
870Example:
871
872-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
873<- { "return": {} }
874
6d4a2b3a
CH
875
876EQMP
877
878 {
879 .name = "block_resize",
880 .args_type = "device:B,size:o",
5e7caacb 881 .mhandler.cmd_new = qmp_marshal_input_block_resize,
6d4a2b3a
CH
882 },
883
884SQMP
885block_resize
886------------
887
888Resize a block image while a guest is running.
889
890Arguments:
891
892- "device": the device's ID, must be unique (json-string)
893- "size": new size
894
895Example:
896
897-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
898<- { "return": {} }
899
d967b2f1
JS
900EQMP
901
12bd451f 902 {
db58f9c0 903 .name = "block-stream",
1d809098 904 .args_type = "device:B,base:s?,speed:o?,on-error:s?",
12bd451f
SH
905 .mhandler.cmd_new = qmp_marshal_input_block_stream,
906 },
907
ed61fc10
JC
908 {
909 .name = "block-commit",
910 .args_type = "device:B,base:s?,top:s,speed:o?",
911 .mhandler.cmd_new = qmp_marshal_input_block_commit,
912 },
913
99a9addf
SH
914 {
915 .name = "drive-backup",
916 .args_type = "device:B,target:s,speed:i?,mode:s?,format:s?,"
917 "on-source-error:s?,on-target-error:s?",
918 .mhandler.cmd_new = qmp_marshal_input_drive_backup,
919 },
920
921SQMP
922drive-backup
923------------
924
925Start a point-in-time copy of a block device to a new destination. The
926status of ongoing drive-backup operations can be checked with
927query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
928The operation can be stopped before it has completed using the
929block-job-cancel command.
930
931Arguments:
932
933- "device": the name of the device which should be copied.
934 (json-string)
935- "target": the target of the new image. If the file exists, or if it is a
936 device, the existing file/device will be used as the new
937 destination. If it does not exist, a new file will be created.
938 (json-string)
939- "format": the format of the new destination, default is to probe if 'mode' is
940 'existing', else the format of the source
941 (json-string, optional)
942- "mode": whether and how QEMU should create a new image
943 (NewImageMode, optional, default 'absolute-paths')
944- "speed": the maximum speed, in bytes per second (json-int, optional)
945- "on-source-error": the action to take on an error on the source, default
946 'report'. 'stop' and 'enospc' can only be used
947 if the block device supports io-status.
948 (BlockdevOnError, optional)
949- "on-target-error": the action to take on an error on the target, default
950 'report' (no limitations, since this applies to
951 a different block device than device).
952 (BlockdevOnError, optional)
953
954Example:
955-> { "execute": "drive-backup", "arguments": { "device": "drive0",
956 "target": "backup.img" } }
957<- { "return": {} }
958EQMP
959
2d47c6e9 960 {
db58f9c0 961 .name = "block-job-set-speed",
882ec7ce 962 .args_type = "device:B,speed:o",
2d47c6e9
SH
963 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
964 },
965
370521a1 966 {
db58f9c0 967 .name = "block-job-cancel",
6e37fb81 968 .args_type = "device:B,force:b?",
370521a1
SH
969 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
970 },
6e37fb81
PB
971 {
972 .name = "block-job-pause",
973 .args_type = "device:B",
974 .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
975 },
976 {
977 .name = "block-job-resume",
978 .args_type = "device:B",
979 .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
980 },
aeae883b
PB
981 {
982 .name = "block-job-complete",
983 .args_type = "device:B",
984 .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
985 },
c186402c 986 {
52e7c241 987 .name = "transaction",
b9f8978c 988 .args_type = "actions:q",
52e7c241 989 .mhandler.cmd_new = qmp_marshal_input_transaction,
c186402c
JC
990 },
991
992SQMP
52e7c241
PB
993transaction
994-----------
c186402c 995
52e7c241
PB
996Atomically operate on one or more block devices. The only supported
997operation for now is snapshotting. If there is any failure performing
998any of the operations, all snapshots for the group are abandoned, and
999the original disks pre-snapshot attempt are used.
c186402c 1000
52e7c241
PB
1001A list of dictionaries is accepted, that contains the actions to be performed.
1002For snapshots this is the device, the file to use for the new snapshot,
1003and the format. The default format, if not specified, is qcow2.
c186402c 1004
bc8b094f
PB
1005Each new snapshot defaults to being created by QEMU (wiping any
1006contents if the file already exists), but it is also possible to reuse
1007an externally-created file. In the latter case, you should ensure that
1008the new image file has the same contents as the current one; QEMU cannot
1009perform any meaningful check. Typically this is achieved by using the
1010current image file as the backing file for the new image.
1011
c186402c
JC
1012Arguments:
1013
52e7c241
PB
1014actions array:
1015 - "type": the operation to perform. The only supported
1016 value is "blockdev-snapshot-sync". (json-string)
1017 - "data": a dictionary. The contents depend on the value
1018 of "type". When "type" is "blockdev-snapshot-sync":
1019 - "device": device name to snapshot (json-string)
1020 - "snapshot-file": name of new image file (json-string)
1021 - "format": format of new image (json-string, optional)
bc8b094f
PB
1022 - "mode": whether and how QEMU should create the snapshot file
1023 (NewImageMode, optional, default "absolute-paths")
c186402c
JC
1024
1025Example:
1026
52e7c241
PB
1027-> { "execute": "transaction",
1028 "arguments": { "actions": [
1029 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd0",
1030 "snapshot-file": "/some/place/my-image",
1031 "format": "qcow2" } },
1032 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd1",
1033 "snapshot-file": "/some/place/my-image2",
bc8b094f 1034 "mode": "existing",
52e7c241 1035 "format": "qcow2" } } ] } }
c186402c
JC
1036<- { "return": {} }
1037
1038EQMP
370521a1 1039
d967b2f1
JS
1040 {
1041 .name = "blockdev-snapshot-sync",
31155b9b 1042 .args_type = "device:B,snapshot-file:s,format:s?,mode:s?",
6106e249 1043 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
d967b2f1
JS
1044 },
1045
1046SQMP
1047blockdev-snapshot-sync
1048----------------------
1049
1050Synchronous snapshot of a block device. snapshot-file specifies the
1051target of the new image. If the file exists, or if it is a device, the
1052snapshot will be created in the existing file/device. If does not
1053exist, a new file will be created. format specifies the format of the
1054snapshot image, default is qcow2.
1055
1056Arguments:
1057
1058- "device": device name to snapshot (json-string)
1059- "snapshot-file": name of new image file (json-string)
6cc2a415
PB
1060- "mode": whether and how QEMU should create the snapshot file
1061 (NewImageMode, optional, default "absolute-paths")
d967b2f1
JS
1062- "format": format of new image (json-string, optional)
1063
1064Example:
1065
7f3850c2
LC
1066-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1067 "snapshot-file":
1068 "/some/place/my-image",
1069 "format": "qcow2" } }
d967b2f1
JS
1070<- { "return": {} }
1071
d9b902db
PB
1072EQMP
1073
1074 {
1075 .name = "drive-mirror",
b952b558 1076 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
eee13dfe 1077 "on-source-error:s?,on-target-error:s?,"
08e4ed6c 1078 "granularity:i?,buf-size:i?",
d9b902db
PB
1079 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1080 },
1081
1082SQMP
1083drive-mirror
1084------------
1085
1086Start mirroring a block device's writes to a new destination. target
1087specifies the target of the new image. If the file exists, or if it is
1088a device, it will be used as the new destination for writes. If it does not
1089exist, a new file will be created. format specifies the format of the
1090mirror image, default is to probe if mode='existing', else the format
1091of the source.
1092
1093Arguments:
1094
1095- "device": device name to operate on (json-string)
1096- "target": name of new image file (json-string)
1097- "format": format of new image (json-string, optional)
1098- "mode": how an image file should be created into the target
1099 file/device (NewImageMode, optional, default 'absolute-paths')
1100- "speed": maximum speed of the streaming job, in bytes per second
1101 (json-int)
eee13dfe 1102- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
08e4ed6c
PB
1103- "buf_size": maximum amount of data in flight from source to target, in bytes
1104 (json-int, default 10M)
d9b902db
PB
1105- "sync": what parts of the disk image should be copied to the destination;
1106 possibilities include "full" for all the disk, "top" for only the sectors
1107 allocated in the topmost image, or "none" to only replicate new I/O
1108 (MirrorSyncMode).
b952b558
PB
1109- "on-source-error": the action to take on an error on the source
1110 (BlockdevOnError, default 'report')
1111- "on-target-error": the action to take on an error on the target
1112 (BlockdevOnError, default 'report')
1113
eee13dfe
PB
1114The default value of the granularity is the image cluster size clamped
1115between 4096 and 65536, if the image format defines one. If the format
1116does not define a cluster size, the default value of the granularity
1117is 65536.
d9b902db
PB
1118
1119
1120Example:
1121
1122-> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1123 "target": "/some/place/my-image",
1124 "sync": "full",
1125 "format": "qcow2" } }
1126<- { "return": {} }
1127
82a56f0d
LC
1128EQMP
1129
1130 {
1131 .name = "balloon",
1132 .args_type = "value:M",
d72f3264 1133 .mhandler.cmd_new = qmp_marshal_input_balloon,
82a56f0d
LC
1134 },
1135
1136SQMP
1137balloon
1138-------
1139
1140Request VM to change its memory allocation (in bytes).
1141
1142Arguments:
1143
1144- "value": New memory allocation (json-int)
1145
1146Example:
1147
1148-> { "execute": "balloon", "arguments": { "value": 536870912 } }
1149<- { "return": {} }
1150
1151EQMP
1152
1153 {
1154 .name = "set_link",
1155 .args_type = "name:s,up:b",
4b37156c 1156 .mhandler.cmd_new = qmp_marshal_input_set_link,
82a56f0d
LC
1157 },
1158
1159SQMP
1160set_link
1161--------
1162
1163Change the link status of a network adapter.
1164
1165Arguments:
1166
1167- "name": network device name (json-string)
1168- "up": status is up (json-bool)
1169
1170Example:
1171
1172-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1173<- { "return": {} }
1174
1175EQMP
1176
1177 {
1178 .name = "getfd",
1179 .args_type = "fdname:s",
1180 .params = "getfd name",
1181 .help = "receive a file descriptor via SCM rights and assign it a name",
208c9d1b 1182 .mhandler.cmd_new = qmp_marshal_input_getfd,
82a56f0d
LC
1183 },
1184
1185SQMP
1186getfd
1187-----
1188
1189Receive a file descriptor via SCM rights and assign it a name.
1190
1191Arguments:
1192
1193- "fdname": file descriptor name (json-string)
1194
1195Example:
1196
1197-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1198<- { "return": {} }
1199
208c9d1b
CB
1200Notes:
1201
1202(1) If the name specified by the "fdname" argument already exists,
1203 the file descriptor assigned to it will be closed and replaced
1204 by the received file descriptor.
1205(2) The 'closefd' command can be used to explicitly close the file
1206 descriptor when it is no longer needed.
1207
82a56f0d
LC
1208EQMP
1209
1210 {
1211 .name = "closefd",
1212 .args_type = "fdname:s",
1213 .params = "closefd name",
1214 .help = "close a file descriptor previously passed via SCM rights",
208c9d1b 1215 .mhandler.cmd_new = qmp_marshal_input_closefd,
82a56f0d
LC
1216 },
1217
1218SQMP
1219closefd
1220-------
1221
1222Close a file descriptor previously passed via SCM rights.
1223
1224Arguments:
1225
1226- "fdname": file descriptor name (json-string)
1227
1228Example:
1229
1230-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1231<- { "return": {} }
1232
ba1c048a
CB
1233EQMP
1234
1235 {
1236 .name = "add-fd",
1237 .args_type = "fdset-id:i?,opaque:s?",
1238 .params = "add-fd fdset-id opaque",
1239 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1240 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1241 },
1242
1243SQMP
1244add-fd
1245-------
1246
1247Add a file descriptor, that was passed via SCM rights, to an fd set.
1248
1249Arguments:
1250
1251- "fdset-id": The ID of the fd set to add the file descriptor to.
1252 (json-int, optional)
1253- "opaque": A free-form string that can be used to describe the fd.
1254 (json-string, optional)
1255
1256Return a json-object with the following information:
1257
1258- "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1259- "fd": The file descriptor that was received via SCM rights and added to the
1260 fd set. (json-int)
1261
1262Example:
1263
1264-> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1265<- { "return": { "fdset-id": 1, "fd": 3 } }
1266
1267Notes:
1268
1269(1) The list of fd sets is shared by all monitor connections.
1270(2) If "fdset-id" is not specified, a new fd set will be created.
1271
1272EQMP
1273
1274 {
1275 .name = "remove-fd",
1276 .args_type = "fdset-id:i,fd:i?",
1277 .params = "remove-fd fdset-id fd",
1278 .help = "Remove a file descriptor from an fd set",
1279 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1280 },
1281
1282SQMP
1283remove-fd
1284---------
1285
1286Remove a file descriptor from an fd set.
1287
1288Arguments:
1289
1290- "fdset-id": The ID of the fd set that the file descriptor belongs to.
1291 (json-int)
1292- "fd": The file descriptor that is to be removed. (json-int, optional)
1293
1294Example:
1295
1296-> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1297<- { "return": {} }
1298
1299Notes:
1300
1301(1) The list of fd sets is shared by all monitor connections.
1302(2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1303 removed.
1304
1305EQMP
1306
1307 {
1308 .name = "query-fdsets",
1309 .args_type = "",
1310 .help = "Return information describing all fd sets",
1311 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1312 },
1313
1314SQMP
1315query-fdsets
1316-------------
1317
1318Return information describing all fd sets.
1319
1320Arguments: None
1321
1322Example:
1323
1324-> { "execute": "query-fdsets" }
1325<- { "return": [
1326 {
1327 "fds": [
1328 {
1329 "fd": 30,
1330 "opaque": "rdonly:/path/to/file"
1331 },
1332 {
1333 "fd": 24,
1334 "opaque": "rdwr:/path/to/file"
1335 }
1336 ],
1337 "fdset-id": 1
1338 },
1339 {
1340 "fds": [
1341 {
1342 "fd": 28
1343 },
1344 {
1345 "fd": 29
1346 }
1347 ],
1348 "fdset-id": 0
1349 }
1350 ]
1351 }
1352
1353Note: The list of fd sets is shared by all monitor connections.
1354
82a56f0d
LC
1355EQMP
1356
1357 {
1358 .name = "block_passwd",
1359 .args_type = "device:B,password:s",
a4dea8a9 1360 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
82a56f0d
LC
1361 },
1362
1363SQMP
1364block_passwd
1365------------
1366
1367Set the password of encrypted block devices.
1368
1369Arguments:
1370
1371- "device": device name (json-string)
1372- "password": password (json-string)
1373
1374Example:
1375
1376-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1377 "password": "12345" } }
1378<- { "return": {} }
1379
727f005e
ZYW
1380EQMP
1381
1382 {
1383 .name = "block_set_io_throttle",
1384 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
80047da5 1385 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
727f005e
ZYW
1386 },
1387
1388SQMP
1389block_set_io_throttle
1390------------
1391
1392Change I/O throttle limits for a block drive.
1393
1394Arguments:
1395
1396- "device": device name (json-string)
1397- "bps": total throughput limit in bytes per second(json-int)
1398- "bps_rd": read throughput limit in bytes per second(json-int)
1399- "bps_wr": read throughput limit in bytes per second(json-int)
1400- "iops": total I/O operations per second(json-int)
1401- "iops_rd": read I/O operations per second(json-int)
1402- "iops_wr": write I/O operations per second(json-int)
1403
1404Example:
1405
1406-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1407 "bps": "1000000",
1408 "bps_rd": "0",
1409 "bps_wr": "0",
1410 "iops": "0",
1411 "iops_rd": "0",
1412 "iops_wr": "0" } }
1413<- { "return": {} }
1414
7572150c
GH
1415EQMP
1416
1417 {
1418 .name = "set_password",
1419 .args_type = "protocol:s,password:s,connected:s?",
fbf796fd 1420 .mhandler.cmd_new = qmp_marshal_input_set_password,
7572150c
GH
1421 },
1422
1423SQMP
1424set_password
1425------------
1426
1427Set the password for vnc/spice protocols.
1428
1429Arguments:
1430
1431- "protocol": protocol name (json-string)
1432- "password": password (json-string)
1433- "connected": [ keep | disconnect | fail ] (josn-string, optional)
1434
1435Example:
1436
1437-> { "execute": "set_password", "arguments": { "protocol": "vnc",
1438 "password": "secret" } }
1439<- { "return": {} }
1440
1441EQMP
1442
1443 {
1444 .name = "expire_password",
1445 .args_type = "protocol:s,time:s",
9ad5372d 1446 .mhandler.cmd_new = qmp_marshal_input_expire_password,
7572150c
GH
1447 },
1448
1449SQMP
1450expire_password
1451---------------
1452
1453Set the password expire time for vnc/spice protocols.
1454
1455Arguments:
1456
1457- "protocol": protocol name (json-string)
1458- "time": [ now | never | +secs | secs ] (json-string)
1459
1460Example:
1461
1462-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1463 "time": "+60" } }
1464<- { "return": {} }
1465
82a56f0d
LC
1466EQMP
1467
13661089
DB
1468 {
1469 .name = "add_client",
f1f5f407 1470 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
b224e5e2 1471 .mhandler.cmd_new = qmp_marshal_input_add_client,
13661089
DB
1472 },
1473
1474SQMP
1475add_client
1476----------
1477
1478Add a graphics client
1479
1480Arguments:
1481
1482- "protocol": protocol name (json-string)
1483- "fdname": file descriptor name (json-string)
f1f5f407
DB
1484- "skipauth": whether to skip authentication (json-bool, optional)
1485- "tls": whether to perform TLS (json-bool, optional)
13661089
DB
1486
1487Example:
1488
1489-> { "execute": "add_client", "arguments": { "protocol": "vnc",
1490 "fdname": "myclient" } }
1491<- { "return": {} }
1492
1493EQMP
82a56f0d
LC
1494 {
1495 .name = "qmp_capabilities",
1496 .args_type = "",
1497 .params = "",
1498 .help = "enable QMP capabilities",
1499 .user_print = monitor_user_noop,
1500 .mhandler.cmd_new = do_qmp_capabilities,
1501 },
1502
1503SQMP
1504qmp_capabilities
1505----------------
1506
1507Enable QMP capabilities.
1508
1509Arguments: None.
1510
1511Example:
1512
1513-> { "execute": "qmp_capabilities" }
1514<- { "return": {} }
1515
1516Note: This command must be issued before issuing any other command.
1517
0268d97c
LC
1518EQMP
1519
1520 {
1521 .name = "human-monitor-command",
1522 .args_type = "command-line:s,cpu-index:i?",
d51a67b4 1523 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
0268d97c
LC
1524 },
1525
1526SQMP
1527human-monitor-command
1528---------------------
1529
1530Execute a Human Monitor command.
1531
1532Arguments:
1533
1534- command-line: the command name and its arguments, just like the
1535 Human Monitor's shell (json-string)
1536- cpu-index: select the CPU number to be used by commands which access CPU
1537 data, like 'info registers'. The Monitor selects CPU 0 if this
1538 argument is not provided (json-int, optional)
1539
1540Example:
1541
1542-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1543<- { "return": "kvm support: enabled\r\n" }
1544
1545Notes:
1546
1547(1) The Human Monitor is NOT an stable interface, this means that command
1548 names, arguments and responses can change or be removed at ANY time.
1549 Applications that rely on long term stability guarantees should NOT
1550 use this command
1551
1552(2) Limitations:
1553
1554 o This command is stateless, this means that commands that depend
1555 on state information (such as getfd) might not work
1556
1557 o Commands that prompt the user for data (eg. 'cont' when the block
1558 device is encrypted) don't currently work
1559
82a56f0d
LC
15603. Query Commands
1561=================
1562
1563HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1564HXCOMM this! We will possibly move query commands definitions inside those
1565HXCOMM sections, just like regular commands.
1566
1567EQMP
1568
1569SQMP
1570query-version
1571-------------
1572
1573Show QEMU version.
1574
1575Return a json-object with the following information:
1576
1577- "qemu": A json-object containing three integer values:
1578 - "major": QEMU's major version (json-int)
1579 - "minor": QEMU's minor version (json-int)
1580 - "micro": QEMU's micro version (json-int)
1581- "package": package's version (json-string)
1582
1583Example:
1584
1585-> { "execute": "query-version" }
1586<- {
1587 "return":{
1588 "qemu":{
1589 "major":0,
1590 "minor":11,
1591 "micro":5
1592 },
1593 "package":""
1594 }
1595 }
1596
1597EQMP
1598
b9c15f16
LC
1599 {
1600 .name = "query-version",
1601 .args_type = "",
1602 .mhandler.cmd_new = qmp_marshal_input_query_version,
1603 },
1604
82a56f0d
LC
1605SQMP
1606query-commands
1607--------------
1608
1609List QMP available commands.
1610
1611Each command is represented by a json-object, the returned value is a json-array
1612of all commands.
1613
1614Each json-object contain:
1615
1616- "name": command's name (json-string)
1617
1618Example:
1619
1620-> { "execute": "query-commands" }
1621<- {
1622 "return":[
1623 {
1624 "name":"query-balloon"
1625 },
1626 {
1627 "name":"system_powerdown"
1628 }
1629 ]
1630 }
1631
1632Note: This example has been shortened as the real response is too long.
1633
1634EQMP
1635
aa9b79bc
LC
1636 {
1637 .name = "query-commands",
1638 .args_type = "",
1639 .mhandler.cmd_new = qmp_marshal_input_query_commands,
1640 },
1641
4860853d
DB
1642SQMP
1643query-events
1644--------------
1645
1646List QMP available events.
1647
1648Each event is represented by a json-object, the returned value is a json-array
1649of all events.
1650
1651Each json-object contains:
1652
1653- "name": event's name (json-string)
1654
1655Example:
1656
1657-> { "execute": "query-events" }
1658<- {
1659 "return":[
1660 {
1661 "name":"SHUTDOWN"
1662 },
1663 {
1664 "name":"RESET"
1665 }
1666 ]
1667 }
1668
1669Note: This example has been shortened as the real response is too long.
1670
1671EQMP
1672
1673 {
1674 .name = "query-events",
1675 .args_type = "",
1676 .mhandler.cmd_new = qmp_marshal_input_query_events,
1677 },
1678
82a56f0d
LC
1679SQMP
1680query-chardev
1681-------------
1682
1683Each device is represented by a json-object. The returned value is a json-array
1684of all devices.
1685
1686Each json-object contain the following:
1687
1688- "label": device's label (json-string)
1689- "filename": device's file (json-string)
1690
1691Example:
1692
1693-> { "execute": "query-chardev" }
1694<- {
1695 "return":[
1696 {
1697 "label":"monitor",
1698 "filename":"stdio"
1699 },
1700 {
1701 "label":"serial0",
1702 "filename":"vc"
1703 }
1704 ]
1705 }
1706
1707EQMP
1708
c5a415a0
LC
1709 {
1710 .name = "query-chardev",
1711 .args_type = "",
1712 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
1713 },
1714
82a56f0d
LC
1715SQMP
1716query-block
1717-----------
1718
1719Show the block devices.
1720
1721Each block device information is stored in a json-object and the returned value
1722is a json-array of all devices.
1723
1724Each json-object contain the following:
1725
1726- "device": device name (json-string)
1727- "type": device type (json-string)
d8aeeb31
MA
1728 - deprecated, retained for backward compatibility
1729 - Possible values: "unknown"
82a56f0d
LC
1730- "removable": true if the device is removable, false otherwise (json-bool)
1731- "locked": true if the device is locked, false otherwise (json-bool)
99f42808 1732- "tray_open": only present if removable, true if the device has a tray,
e4def80b 1733 and it is open (json-bool)
82a56f0d
LC
1734- "inserted": only present if the device is inserted, it is a json-object
1735 containing the following:
1736 - "file": device file name (json-string)
1737 - "ro": true if read-only, false otherwise (json-bool)
1738 - "drv": driver format name (json-string)
1739 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1740 "file", "file", "ftp", "ftps", "host_cdrom",
1741 "host_device", "host_floppy", "http", "https",
1742 "nbd", "parallels", "qcow", "qcow2", "raw",
1743 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1744 - "backing_file": backing file name (json-string, optional)
2e3e3317 1745 - "backing_file_depth": number of files in the backing file chain (json-int)
82a56f0d 1746 - "encrypted": true if encrypted, false otherwise (json-bool)
727f005e
ZYW
1747 - "bps": limit total bytes per second (json-int)
1748 - "bps_rd": limit read bytes per second (json-int)
1749 - "bps_wr": limit write bytes per second (json-int)
1750 - "iops": limit total I/O operations per second (json-int)
1751 - "iops_rd": limit read operations per second (json-int)
1752 - "iops_wr": limit write operations per second (json-int)
553a7e87
WX
1753 - "image": the detail of the image, it is a json-object containing
1754 the following:
1755 - "filename": image file name (json-string)
1756 - "format": image format (json-string)
1757 - "virtual-size": image capacity in bytes (json-int)
1758 - "dirty-flag": true if image is not cleanly closed, not present
1759 means clean (json-bool, optional)
1760 - "actual-size": actual size on disk in bytes of the image, not
1761 present when image does not support thin
1762 provision (json-int, optional)
1763 - "cluster-size": size of a cluster in bytes, not present if image
1764 format does not support it (json-int, optional)
1765 - "encrypted": true if the image is encrypted, not present means
1766 false or the image format does not support
1767 encryption (json-bool, optional)
1768 - "backing_file": backing file name, not present means no backing
1769 file is used or the image format does not
1770 support backing file chain
1771 (json-string, optional)
1772 - "full-backing-filename": full path of the backing file, not
1773 present if it equals backing_file or no
1774 backing file is used
1775 (json-string, optional)
1776 - "backing-filename-format": the format of the backing file, not
1777 present means unknown or no backing
1778 file (json-string, optional)
1779 - "snapshots": the internal snapshot info, it is an optional list
1780 of json-object containing the following:
1781 - "id": unique snapshot id (json-string)
1782 - "name": snapshot name (json-string)
1783 - "vm-state-size": size of the VM state in bytes (json-int)
1784 - "date-sec": UTC date of the snapshot in seconds (json-int)
1785 - "date-nsec": fractional part in nanoseconds to be used with
1786 date-sec(json-int)
1787 - "vm-clock-sec": VM clock relative to boot in seconds
1788 (json-int)
1789 - "vm-clock-nsec": fractional part in nanoseconds to be used
1790 with vm-clock-sec (json-int)
1791 - "backing-image": the detail of the backing image, it is an
1792 optional json-object only present when a
1793 backing image present for this image
727f005e 1794
f04ef601
LC
1795- "io-status": I/O operation status, only present if the device supports it
1796 and the VM is configured to stop on errors. It's always reset
1797 to "ok" when the "cont" command is issued (json_string, optional)
1798 - Possible values: "ok", "failed", "nospace"
82a56f0d
LC
1799
1800Example:
1801
1802-> { "execute": "query-block" }
1803<- {
1804 "return":[
1805 {
f04ef601 1806 "io-status": "ok",
82a56f0d
LC
1807 "device":"ide0-hd0",
1808 "locked":false,
1809 "removable":false,
1810 "inserted":{
1811 "ro":false,
1812 "drv":"qcow2",
1813 "encrypted":false,
553a7e87
WX
1814 "file":"disks/test.qcow2",
1815 "backing_file_depth":1,
727f005e
ZYW
1816 "bps":1000000,
1817 "bps_rd":0,
1818 "bps_wr":0,
1819 "iops":1000000,
1820 "iops_rd":0,
1821 "iops_wr":0,
553a7e87
WX
1822 "image":{
1823 "filename":"disks/test.qcow2",
1824 "format":"qcow2",
1825 "virtual-size":2048000,
1826 "backing_file":"base.qcow2",
1827 "full-backing-filename":"disks/base.qcow2",
1828 "backing-filename-format:"qcow2",
1829 "snapshots":[
1830 {
1831 "id": "1",
1832 "name": "snapshot1",
1833 "vm-state-size": 0,
1834 "date-sec": 10000200,
1835 "date-nsec": 12,
1836 "vm-clock-sec": 206,
1837 "vm-clock-nsec": 30
1838 }
1839 ],
1840 "backing-image":{
1841 "filename":"disks/base.qcow2",
1842 "format":"qcow2",
1843 "virtual-size":2048000
1844 }
1845 }
82a56f0d 1846 },
d8aeeb31 1847 "type":"unknown"
82a56f0d
LC
1848 },
1849 {
f04ef601 1850 "io-status": "ok",
82a56f0d
LC
1851 "device":"ide1-cd0",
1852 "locked":false,
1853 "removable":true,
d8aeeb31 1854 "type":"unknown"
82a56f0d
LC
1855 },
1856 {
1857 "device":"floppy0",
1858 "locked":false,
1859 "removable":true,
d8aeeb31 1860 "type":"unknown"
82a56f0d
LC
1861 },
1862 {
1863 "device":"sd0",
1864 "locked":false,
1865 "removable":true,
d8aeeb31 1866 "type":"unknown"
82a56f0d
LC
1867 }
1868 ]
1869 }
1870
1871EQMP
1872
b2023818
LC
1873 {
1874 .name = "query-block",
1875 .args_type = "",
1876 .mhandler.cmd_new = qmp_marshal_input_query_block,
1877 },
1878
82a56f0d
LC
1879SQMP
1880query-blockstats
1881----------------
1882
1883Show block device statistics.
1884
1885Each device statistic information is stored in a json-object and the returned
1886value is a json-array of all devices.
1887
1888Each json-object contain the following:
1889
1890- "device": device name (json-string)
1891- "stats": A json-object with the statistics information, it contains:
1892 - "rd_bytes": bytes read (json-int)
1893 - "wr_bytes": bytes written (json-int)
1894 - "rd_operations": read operations (json-int)
1895 - "wr_operations": write operations (json-int)
e8045d67 1896 - "flush_operations": cache flush operations (json-int)
c488c7f6
CH
1897 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1898 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1899 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
82a56f0d
LC
1900 - "wr_highest_offset": Highest offset of a sector written since the
1901 BlockDriverState has been opened (json-int)
1902- "parent": Contains recursively the statistics of the underlying
1903 protocol (e.g. the host file for a qcow2 image). If there is
1904 no underlying protocol, this field is omitted
1905 (json-object, optional)
1906
1907Example:
1908
1909-> { "execute": "query-blockstats" }
1910<- {
1911 "return":[
1912 {
1913 "device":"ide0-hd0",
1914 "parent":{
1915 "stats":{
1916 "wr_highest_offset":3686448128,
1917 "wr_bytes":9786368,
1918 "wr_operations":751,
1919 "rd_bytes":122567168,
1920 "rd_operations":36772
c488c7f6
CH
1921 "wr_total_times_ns":313253456
1922 "rd_total_times_ns":3465673657
1923 "flush_total_times_ns":49653
e8045d67 1924 "flush_operations":61,
82a56f0d
LC
1925 }
1926 },
1927 "stats":{
1928 "wr_highest_offset":2821110784,
1929 "wr_bytes":9786368,
1930 "wr_operations":692,
1931 "rd_bytes":122739200,
1932 "rd_operations":36604
e8045d67 1933 "flush_operations":51,
c488c7f6
CH
1934 "wr_total_times_ns":313253456
1935 "rd_total_times_ns":3465673657
1936 "flush_total_times_ns":49653
82a56f0d
LC
1937 }
1938 },
1939 {
1940 "device":"ide1-cd0",
1941 "stats":{
1942 "wr_highest_offset":0,
1943 "wr_bytes":0,
1944 "wr_operations":0,
1945 "rd_bytes":0,
1946 "rd_operations":0
e8045d67 1947 "flush_operations":0,
c488c7f6
CH
1948 "wr_total_times_ns":0
1949 "rd_total_times_ns":0
1950 "flush_total_times_ns":0
82a56f0d
LC
1951 }
1952 },
1953 {
1954 "device":"floppy0",
1955 "stats":{
1956 "wr_highest_offset":0,
1957 "wr_bytes":0,
1958 "wr_operations":0,
1959 "rd_bytes":0,
1960 "rd_operations":0
e8045d67 1961 "flush_operations":0,
c488c7f6
CH
1962 "wr_total_times_ns":0
1963 "rd_total_times_ns":0
1964 "flush_total_times_ns":0
82a56f0d
LC
1965 }
1966 },
1967 {
1968 "device":"sd0",
1969 "stats":{
1970 "wr_highest_offset":0,
1971 "wr_bytes":0,
1972 "wr_operations":0,
1973 "rd_bytes":0,
1974 "rd_operations":0
e8045d67 1975 "flush_operations":0,
c488c7f6
CH
1976 "wr_total_times_ns":0
1977 "rd_total_times_ns":0
1978 "flush_total_times_ns":0
82a56f0d
LC
1979 }
1980 }
1981 ]
1982 }
1983
1984EQMP
1985
f11f57e4
LC
1986 {
1987 .name = "query-blockstats",
1988 .args_type = "",
1989 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
1990 },
1991
82a56f0d
LC
1992SQMP
1993query-cpus
1994----------
1995
1996Show CPU information.
1997
1998Return a json-array. Each CPU is represented by a json-object, which contains:
1999
2000- "CPU": CPU index (json-int)
2001- "current": true if this is the current CPU, false otherwise (json-bool)
2002- "halted": true if the cpu is halted, false otherwise (json-bool)
2003- Current program counter. The key's name depends on the architecture:
2004 "pc": i386/x86_64 (json-int)
2005 "nip": PPC (json-int)
2006 "pc" and "npc": sparc (json-int)
2007 "PC": mips (json-int)
dc7a09cf 2008- "thread_id": ID of the underlying host thread (json-int)
82a56f0d
LC
2009
2010Example:
2011
2012-> { "execute": "query-cpus" }
2013<- {
2014 "return":[
2015 {
2016 "CPU":0,
2017 "current":true,
2018 "halted":false,
2019 "pc":3227107138
dc7a09cf 2020 "thread_id":3134
82a56f0d
LC
2021 },
2022 {
2023 "CPU":1,
2024 "current":false,
2025 "halted":true,
2026 "pc":7108165
dc7a09cf 2027 "thread_id":3135
82a56f0d
LC
2028 }
2029 ]
2030 }
2031
2032EQMP
2033
de0b36b6
LC
2034 {
2035 .name = "query-cpus",
2036 .args_type = "",
2037 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
2038 },
2039
82a56f0d
LC
2040SQMP
2041query-pci
2042---------
2043
2044PCI buses and devices information.
2045
2046The returned value is a json-array of all buses. Each bus is represented by
2047a json-object, which has a key with a json-array of all PCI devices attached
2048to it. Each device is represented by a json-object.
2049
2050The bus json-object contains the following:
2051
2052- "bus": bus number (json-int)
2053- "devices": a json-array of json-objects, each json-object represents a
2054 PCI device
2055
2056The PCI device json-object contains the following:
2057
2058- "bus": identical to the parent's bus number (json-int)
2059- "slot": slot number (json-int)
2060- "function": function number (json-int)
2061- "class_info": a json-object containing:
2062 - "desc": device class description (json-string, optional)
2063 - "class": device class number (json-int)
2064- "id": a json-object containing:
2065 - "device": device ID (json-int)
2066 - "vendor": vendor ID (json-int)
2067- "irq": device's IRQ if assigned (json-int, optional)
2068- "qdev_id": qdev id string (json-string)
2069- "pci_bridge": It's a json-object, only present if this device is a
2070 PCI bridge, contains:
2071 - "bus": bus number (json-int)
2072 - "secondary": secondary bus number (json-int)
2073 - "subordinate": subordinate bus number (json-int)
2074 - "io_range": I/O memory range information, a json-object with the
2075 following members:
2076 - "base": base address, in bytes (json-int)
2077 - "limit": limit address, in bytes (json-int)
2078 - "memory_range": memory range information, a json-object with the
2079 following members:
2080 - "base": base address, in bytes (json-int)
2081 - "limit": limit address, in bytes (json-int)
2082 - "prefetchable_range": Prefetchable memory range information, a
2083 json-object with the following members:
2084 - "base": base address, in bytes (json-int)
2085 - "limit": limit address, in bytes (json-int)
2086 - "devices": a json-array of PCI devices if there's any attached, each
2087 each element is represented by a json-object, which contains
2088 the same members of the 'PCI device json-object' described
2089 above (optional)
2090- "regions": a json-array of json-objects, each json-object represents a
2091 memory region of this device
2092
2093The memory range json-object contains the following:
2094
2095- "base": base memory address (json-int)
2096- "limit": limit value (json-int)
2097
2098The region json-object can be an I/O region or a memory region, an I/O region
2099json-object contains the following:
2100
2101- "type": "io" (json-string, fixed)
2102- "bar": BAR number (json-int)
2103- "address": memory address (json-int)
2104- "size": memory size (json-int)
2105
2106A memory region json-object contains the following:
2107
2108- "type": "memory" (json-string, fixed)
2109- "bar": BAR number (json-int)
2110- "address": memory address (json-int)
2111- "size": memory size (json-int)
2112- "mem_type_64": true or false (json-bool)
2113- "prefetch": true or false (json-bool)
2114
2115Example:
2116
2117-> { "execute": "query-pci" }
2118<- {
2119 "return":[
2120 {
2121 "bus":0,
2122 "devices":[
2123 {
2124 "bus":0,
2125 "qdev_id":"",
2126 "slot":0,
2127 "class_info":{
2128 "class":1536,
2129 "desc":"Host bridge"
2130 },
2131 "id":{
2132 "device":32902,
2133 "vendor":4663
2134 },
2135 "function":0,
2136 "regions":[
2137
2138 ]
2139 },
2140 {
2141 "bus":0,
2142 "qdev_id":"",
2143 "slot":1,
2144 "class_info":{
2145 "class":1537,
2146 "desc":"ISA bridge"
2147 },
2148 "id":{
2149 "device":32902,
2150 "vendor":28672
2151 },
2152 "function":0,
2153 "regions":[
2154
2155 ]
2156 },
2157 {
2158 "bus":0,
2159 "qdev_id":"",
2160 "slot":1,
2161 "class_info":{
2162 "class":257,
2163 "desc":"IDE controller"
2164 },
2165 "id":{
2166 "device":32902,
2167 "vendor":28688
2168 },
2169 "function":1,
2170 "regions":[
2171 {
2172 "bar":4,
2173 "size":16,
2174 "address":49152,
2175 "type":"io"
2176 }
2177 ]
2178 },
2179 {
2180 "bus":0,
2181 "qdev_id":"",
2182 "slot":2,
2183 "class_info":{
2184 "class":768,
2185 "desc":"VGA controller"
2186 },
2187 "id":{
2188 "device":4115,
2189 "vendor":184
2190 },
2191 "function":0,
2192 "regions":[
2193 {
2194 "prefetch":true,
2195 "mem_type_64":false,
2196 "bar":0,
2197 "size":33554432,
2198 "address":4026531840,
2199 "type":"memory"
2200 },
2201 {
2202 "prefetch":false,
2203 "mem_type_64":false,
2204 "bar":1,
2205 "size":4096,
2206 "address":4060086272,
2207 "type":"memory"
2208 },
2209 {
2210 "prefetch":false,
2211 "mem_type_64":false,
2212 "bar":6,
2213 "size":65536,
2214 "address":-1,
2215 "type":"memory"
2216 }
2217 ]
2218 },
2219 {
2220 "bus":0,
2221 "qdev_id":"",
2222 "irq":11,
2223 "slot":4,
2224 "class_info":{
2225 "class":1280,
2226 "desc":"RAM controller"
2227 },
2228 "id":{
2229 "device":6900,
2230 "vendor":4098
2231 },
2232 "function":0,
2233 "regions":[
2234 {
2235 "bar":0,
2236 "size":32,
2237 "address":49280,
2238 "type":"io"
2239 }
2240 ]
2241 }
2242 ]
2243 }
2244 ]
2245 }
2246
2247Note: This example has been shortened as the real response is too long.
2248
2249EQMP
2250
79627472
LC
2251 {
2252 .name = "query-pci",
2253 .args_type = "",
2254 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2255 },
2256
82a56f0d
LC
2257SQMP
2258query-kvm
2259---------
2260
2261Show KVM information.
2262
2263Return a json-object with the following information:
2264
2265- "enabled": true if KVM support is enabled, false otherwise (json-bool)
2266- "present": true if QEMU has KVM support, false otherwise (json-bool)
2267
2268Example:
2269
2270-> { "execute": "query-kvm" }
2271<- { "return": { "enabled": true, "present": true } }
2272
2273EQMP
2274
292a2602
LC
2275 {
2276 .name = "query-kvm",
2277 .args_type = "",
2278 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2279 },
2280
82a56f0d
LC
2281SQMP
2282query-status
2283------------
2284
2285Return a json-object with the following information:
2286
2287- "running": true if the VM is running, or false if it is paused (json-bool)
2288- "singlestep": true if the VM is in single step mode,
2289 false otherwise (json-bool)
9e37b9dc
LC
2290- "status": one of the following values (json-string)
2291 "debug" - QEMU is running on a debugger
2292 "inmigrate" - guest is paused waiting for an incoming migration
2293 "internal-error" - An internal error that prevents further guest
2294 execution has occurred
2295 "io-error" - the last IOP has failed and the device is configured
2296 to pause on I/O errors
2297 "paused" - guest has been paused via the 'stop' command
2298 "postmigrate" - guest is paused following a successful 'migrate'
2299 "prelaunch" - QEMU was started with -S and guest has not started
2300 "finish-migrate" - guest is paused to finish the migration process
2301 "restore-vm" - guest is paused to restore VM state
2302 "running" - guest is actively running
2303 "save-vm" - guest is paused to save the VM state
2304 "shutdown" - guest is shut down (and -no-shutdown is in use)
2305 "watchdog" - the watchdog action is configured to pause and
2306 has been triggered
82a56f0d
LC
2307
2308Example:
2309
2310-> { "execute": "query-status" }
9e37b9dc 2311<- { "return": { "running": true, "singlestep": false, "status": "running" } }
82a56f0d
LC
2312
2313EQMP
1fa9a5e4
LC
2314
2315 {
2316 .name = "query-status",
2317 .args_type = "",
2318 .mhandler.cmd_new = qmp_marshal_input_query_status,
2319 },
82a56f0d
LC
2320
2321SQMP
2322query-mice
2323----------
2324
2325Show VM mice information.
2326
2327Each mouse is represented by a json-object, the returned value is a json-array
2328of all mice.
2329
2330The mouse json-object contains the following:
2331
2332- "name": mouse's name (json-string)
2333- "index": mouse's index (json-int)
2334- "current": true if this mouse is receiving events, false otherwise (json-bool)
2335- "absolute": true if the mouse generates absolute input events (json-bool)
2336
2337Example:
2338
2339-> { "execute": "query-mice" }
2340<- {
2341 "return":[
2342 {
2343 "name":"QEMU Microsoft Mouse",
2344 "index":0,
2345 "current":false,
2346 "absolute":false
2347 },
2348 {
2349 "name":"QEMU PS/2 Mouse",
2350 "index":1,
2351 "current":true,
2352 "absolute":true
2353 }
2354 ]
2355 }
2356
2357EQMP
2358
e235cec3
LC
2359 {
2360 .name = "query-mice",
2361 .args_type = "",
2362 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2363 },
2364
82a56f0d
LC
2365SQMP
2366query-vnc
2367---------
2368
2369Show VNC server information.
2370
2371Return a json-object with server information. Connected clients are returned
2372as a json-array of json-objects.
2373
2374The main json-object contains the following:
2375
2376- "enabled": true or false (json-bool)
2377- "host": server's IP address (json-string)
2378- "family": address family (json-string)
2379 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2380- "service": server's port number (json-string)
2381- "auth": authentication method (json-string)
2382 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2383 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2384 "vencrypt+plain", "vencrypt+tls+none",
2385 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2386 "vencrypt+tls+vnc", "vencrypt+x509+none",
2387 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2388 "vencrypt+x509+vnc", "vnc"
2389- "clients": a json-array of all connected clients
2390
2391Clients are described by a json-object, each one contain the following:
2392
2393- "host": client's IP address (json-string)
2394- "family": address family (json-string)
2395 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2396- "service": client's port number (json-string)
2397- "x509_dname": TLS dname (json-string, optional)
2398- "sasl_username": SASL username (json-string, optional)
2399
2400Example:
2401
2402-> { "execute": "query-vnc" }
2403<- {
2404 "return":{
2405 "enabled":true,
2406 "host":"0.0.0.0",
2407 "service":"50402",
2408 "auth":"vnc",
2409 "family":"ipv4",
2410 "clients":[
2411 {
2412 "host":"127.0.0.1",
2413 "service":"50401",
2414 "family":"ipv4"
2415 }
2416 ]
2417 }
2418 }
2419
2420EQMP
2421
2b54aa87
LC
2422 {
2423 .name = "query-vnc",
2424 .args_type = "",
2425 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
2426 },
2427
cb42a870
GH
2428SQMP
2429query-spice
2430-----------
2431
2432Show SPICE server information.
2433
2434Return a json-object with server information. Connected clients are returned
2435as a json-array of json-objects.
2436
2437The main json-object contains the following:
2438
2439- "enabled": true or false (json-bool)
2440- "host": server's IP address (json-string)
2441- "port": server's port number (json-int, optional)
2442- "tls-port": server's port number (json-int, optional)
2443- "auth": authentication method (json-string)
2444 - Possible values: "none", "spice"
2445- "channels": a json-array of all active channels clients
2446
2447Channels are described by a json-object, each one contain the following:
2448
2449- "host": client's IP address (json-string)
2450- "family": address family (json-string)
2451 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2452- "port": client's port number (json-string)
2453- "connection-id": spice connection id. All channels with the same id
2454 belong to the same spice session (json-int)
2455- "channel-type": channel type. "1" is the main control channel, filter for
2456 this one if you want track spice sessions only (json-int)
2457- "channel-id": channel id. Usually "0", might be different needed when
2458 multiple channels of the same type exist, such as multiple
2459 display channels in a multihead setup (json-int)
2460- "tls": whevener the channel is encrypted (json-bool)
2461
2462Example:
2463
2464-> { "execute": "query-spice" }
2465<- {
2466 "return": {
2467 "enabled": true,
2468 "auth": "spice",
2469 "port": 5920,
2470 "tls-port": 5921,
2471 "host": "0.0.0.0",
2472 "channels": [
2473 {
2474 "port": "54924",
2475 "family": "ipv4",
2476 "channel-type": 1,
2477 "connection-id": 1804289383,
2478 "host": "127.0.0.1",
2479 "channel-id": 0,
2480 "tls": true
2481 },
2482 {
2483 "port": "36710",
2484 "family": "ipv4",
2485 "channel-type": 4,
2486 "connection-id": 1804289383,
2487 "host": "127.0.0.1",
2488 "channel-id": 0,
2489 "tls": false
2490 },
2491 [ ... more channels follow ... ]
2492 ]
2493 }
2494 }
2495
2496EQMP
2497
d1f29646
LC
2498#if defined(CONFIG_SPICE)
2499 {
2500 .name = "query-spice",
2501 .args_type = "",
2502 .mhandler.cmd_new = qmp_marshal_input_query_spice,
2503 },
2504#endif
2505
82a56f0d
LC
2506SQMP
2507query-name
2508----------
2509
2510Show VM name.
2511
2512Return a json-object with the following information:
2513
2514- "name": VM's name (json-string, optional)
2515
2516Example:
2517
2518-> { "execute": "query-name" }
2519<- { "return": { "name": "qemu-name" } }
2520
2521EQMP
2522
48a32bed
AL
2523 {
2524 .name = "query-name",
2525 .args_type = "",
2526 .mhandler.cmd_new = qmp_marshal_input_query_name,
2527 },
2528
82a56f0d
LC
2529SQMP
2530query-uuid
2531----------
2532
2533Show VM UUID.
2534
2535Return a json-object with the following information:
2536
2537- "UUID": Universally Unique Identifier (json-string)
2538
2539Example:
2540
2541-> { "execute": "query-uuid" }
2542<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2543
2544EQMP
2545
efab767e
LC
2546 {
2547 .name = "query-uuid",
2548 .args_type = "",
2549 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
2550 },
2551
1f8f987d
AK
2552SQMP
2553query-command-line-options
2554--------------------------
2555
2556Show command line option schema.
2557
2558Return a json-array of command line option schema for all options (or for
2559the given option), returning an error if the given option doesn't exist.
2560
2561Each array entry contains the following:
2562
2563- "option": option name (json-string)
2564- "parameters": a json-array describes all parameters of the option:
2565 - "name": parameter name (json-string)
2566 - "type": parameter type (one of 'string', 'boolean', 'number',
2567 or 'size')
2568 - "help": human readable description of the parameter
2569 (json-string, optional)
2570
2571Example:
2572
2573-> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
2574<- { "return": [
2575 {
2576 "parameters": [
2577 {
2578 "name": "romfile",
2579 "type": "string"
2580 },
2581 {
2582 "name": "bootindex",
2583 "type": "number"
2584 }
2585 ],
2586 "option": "option-rom"
2587 }
2588 ]
2589 }
2590
2591EQMP
2592
2593 {
2594 .name = "query-command-line-options",
2595 .args_type = "option:s?",
2596 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
2597 },
2598
82a56f0d
LC
2599SQMP
2600query-migrate
2601-------------
2602
2603Migration status.
2604
2605Return a json-object. If migration is active there will be another json-object
2606with RAM migration status and if block migration is active another one with
2607block migration status.
2608
2609The main json-object contains the following:
2610
2611- "status": migration status (json-string)
2612 - Possible values: "active", "completed", "failed", "cancelled"
7aa939af
JQ
2613- "total-time": total amount of ms since migration started. If
2614 migration has ended, it returns the total migration
817c6045 2615 time (json-int)
9c5a9fcf
JQ
2616- "downtime": only present when migration has finished correctly
2617 total amount in ms for downtime that happened (json-int)
2c52ddf1
JQ
2618- "expected-downtime": only present while migration is active
2619 total amount in ms for downtime that was calculated on
817c6045 2620 the last bitmap round (json-int)
82a56f0d 2621- "ram": only present if "status" is "active", it is a json-object with the
817c6045
JQ
2622 following RAM information:
2623 - "transferred": amount transferred in bytes (json-int)
2624 - "remaining": amount remaining to transfer in bytes (json-int)
2625 - "total": total amount of memory in bytes (json-int)
2626 - "duplicate": number of pages filled entirely with the same
2627 byte (json-int)
2628 These are sent over the wire much more efficiently.
f1c72795 2629 - "skipped": number of skipped zero pages (json-int)
805a2505 2630 - "normal" : number of whole pages transferred. I.e. they
817c6045
JQ
2631 were not sent as duplicate or xbzrle pages (json-int)
2632 - "normal-bytes" : number of bytes transferred in whole
2633 pages. This is just normal pages times size of one page,
2634 but this way upper levels don't need to care about page
2635 size (json-int)
82a56f0d 2636- "disk": only present if "status" is "active" and it is a block migration,
817c6045
JQ
2637 it is a json-object with the following disk information:
2638 - "transferred": amount transferred in bytes (json-int)
2639 - "remaining": amount remaining to transfer in bytes json-int)
2640 - "total": total disk size in bytes (json-int)
f36d55af
OW
2641- "xbzrle-cache": only present if XBZRLE is active.
2642 It is a json-object with the following XBZRLE information:
817c6045
JQ
2643 - "cache-size": XBZRLE cache size in bytes
2644 - "bytes": number of bytes transferred for XBZRLE compressed pages
f36d55af 2645 - "pages": number of XBZRLE compressed pages
817c6045
JQ
2646 - "cache-miss": number of XBRZRLE page cache misses
2647 - "overflow": number of times XBZRLE overflows. This means
2648 that the XBZRLE encoding was bigger than just sent the
2649 whole page, and then we sent the whole page instead (as as
2650 normal page).
2651
82a56f0d
LC
2652Examples:
2653
26541. Before the first migration
2655
2656-> { "execute": "query-migrate" }
2657<- { "return": {} }
2658
26592. Migration is done and has succeeded
2660
2661-> { "execute": "query-migrate" }
004d4c10
OW
2662<- { "return": {
2663 "status": "completed",
2664 "ram":{
2665 "transferred":123,
2666 "remaining":123,
2667 "total":246,
2668 "total-time":12345,
9c5a9fcf 2669 "downtime":12345,
004d4c10
OW
2670 "duplicate":123,
2671 "normal":123,
2672 "normal-bytes":123456
2673 }
2674 }
2675 }
82a56f0d
LC
2676
26773. Migration is done and has failed
2678
2679-> { "execute": "query-migrate" }
2680<- { "return": { "status": "failed" } }
2681
26824. Migration is being performed and is not a block migration:
2683
2684-> { "execute": "query-migrate" }
2685<- {
2686 "return":{
2687 "status":"active",
2688 "ram":{
2689 "transferred":123,
2690 "remaining":123,
62d4e3fe 2691 "total":246,
004d4c10 2692 "total-time":12345,
2c52ddf1 2693 "expected-downtime":12345,
004d4c10
OW
2694 "duplicate":123,
2695 "normal":123,
2696 "normal-bytes":123456
82a56f0d
LC
2697 }
2698 }
2699 }
2700
27015. Migration is being performed and is a block migration:
2702
2703-> { "execute": "query-migrate" }
2704<- {
2705 "return":{
2706 "status":"active",
2707 "ram":{
2708 "total":1057024,
2709 "remaining":1053304,
62d4e3fe 2710 "transferred":3720,
004d4c10 2711 "total-time":12345,
2c52ddf1 2712 "expected-downtime":12345,
004d4c10
OW
2713 "duplicate":123,
2714 "normal":123,
2715 "normal-bytes":123456
82a56f0d
LC
2716 },
2717 "disk":{
2718 "total":20971520,
2719 "remaining":20880384,
2720 "transferred":91136
2721 }
2722 }
2723 }
2724
f36d55af
OW
27256. Migration is being performed and XBZRLE is active:
2726
2727-> { "execute": "query-migrate" }
2728<- {
2729 "return":{
2730 "status":"active",
2731 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
2732 "ram":{
2733 "total":1057024,
2734 "remaining":1053304,
2735 "transferred":3720,
2736 "total-time":12345,
2c52ddf1 2737 "expected-downtime":12345,
f36d55af
OW
2738 "duplicate":10,
2739 "normal":3333,
2740 "normal-bytes":3412992
2741 },
2742 "xbzrle-cache":{
2743 "cache-size":67108864,
2744 "bytes":20971520,
2745 "pages":2444343,
2746 "cache-miss":2244,
2747 "overflow":34434
2748 }
2749 }
2750 }
2751
82a56f0d
LC
2752EQMP
2753
791e7c82
LC
2754 {
2755 .name = "query-migrate",
2756 .args_type = "",
2757 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
2758 },
2759
bbf6da32 2760SQMP
00458433 2761migrate-set-capabilities
817c6045 2762------------------------
00458433
OW
2763
2764Enable/Disable migration capabilities
2765
817c6045 2766- "xbzrle": XBZRLE support
00458433
OW
2767
2768Arguments:
2769
2770Example:
2771
2772-> { "execute": "migrate-set-capabilities" , "arguments":
2773 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
2774
2775EQMP
2776
2777 {
2778 .name = "migrate-set-capabilities",
2779 .args_type = "capabilities:O",
2780 .params = "capability:s,state:b",
2781 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
2782 },
2783SQMP
bbf6da32 2784query-migrate-capabilities
817c6045 2785--------------------------
bbf6da32
OW
2786
2787Query current migration capabilities
2788
2789- "capabilities": migration capabilities state
2790 - "xbzrle" : XBZRLE state (json-bool)
2791
2792Arguments:
2793
2794Example:
2795
2796-> { "execute": "query-migrate-capabilities" }
dbca1b37
OW
2797<- { "return": [ { "state": false, "capability": "xbzrle" } ] }
2798
bbf6da32
OW
2799EQMP
2800
2801 {
2802 .name = "query-migrate-capabilities",
2803 .args_type = "",
2804 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
2805 },
2806
82a56f0d
LC
2807SQMP
2808query-balloon
2809-------------
2810
2811Show balloon information.
2812
2813Make an asynchronous request for balloon info. When the request completes a
2814json-object will be returned containing the following data:
2815
2816- "actual": current balloon value in bytes (json-int)
82a56f0d
LC
2817
2818Example:
2819
2820-> { "execute": "query-balloon" }
2821<- {
2822 "return":{
2823 "actual":1073741824,
82a56f0d
LC
2824 }
2825 }
2826
2827EQMP
2828
96637bcd
LC
2829 {
2830 .name = "query-balloon",
2831 .args_type = "",
2832 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
2833 },
b4b12c62 2834
fb5458cd
SH
2835 {
2836 .name = "query-block-jobs",
2837 .args_type = "",
2838 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
2839 },
2840
b4b12c62
AL
2841 {
2842 .name = "qom-list",
2843 .args_type = "path:s",
2844 .mhandler.cmd_new = qmp_marshal_input_qom_list,
2845 },
eb6e8ea5
AL
2846
2847 {
2848 .name = "qom-set",
b9f8978c 2849 .args_type = "path:s,property:s,value:q",
eb6e8ea5
AL
2850 .mhandler.cmd_new = qmp_qom_set,
2851 },
2852
2853 {
2854 .name = "qom-get",
2855 .args_type = "path:s,property:s",
2856 .mhandler.cmd_new = qmp_qom_get,
2857 },
270b243f 2858
6dd844db
PB
2859 {
2860 .name = "nbd-server-start",
2861 .args_type = "addr:q",
2862 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
2863 },
2864 {
2865 .name = "nbd-server-add",
2866 .args_type = "device:B,writable:b?",
2867 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
2868 },
2869 {
2870 .name = "nbd-server-stop",
2871 .args_type = "",
2872 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
2873 },
2874
270b243f
LC
2875 {
2876 .name = "change-vnc-password",
2877 .args_type = "password:s",
2878 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
2879 },
5eeee3fa
AL
2880 {
2881 .name = "qom-list-types",
2882 .args_type = "implements:s?,abstract:b?",
2883 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
2884 },
1daa31b9
AL
2885
2886 {
2887 .name = "device-list-properties",
2888 .args_type = "typename:s",
2889 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
2890 },
2891
01d3c80d
AL
2892 {
2893 .name = "query-machines",
2894 .args_type = "",
2895 .mhandler.cmd_new = qmp_marshal_input_query_machines,
2896 },
2897
e4e31c63
AL
2898 {
2899 .name = "query-cpu-definitions",
2900 .args_type = "",
2901 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
2902 },
2903
99afc91d
DB
2904 {
2905 .name = "query-target",
2906 .args_type = "",
2907 .mhandler.cmd_new = qmp_marshal_input_query_target,
2908 },
f1a1a356 2909
d1a0cf73
SB
2910 {
2911 .name = "query-tpm",
2912 .args_type = "",
2913 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
2914 },
2915
28c4fa32
CB
2916SQMP
2917query-tpm
2918---------
2919
2920Return information about the TPM device.
2921
2922Arguments: None
2923
2924Example:
2925
2926-> { "execute": "query-tpm" }
2927<- { "return":
2928 [
2929 { "model": "tpm-tis",
2930 "options":
2931 { "type": "passthrough",
2932 "data":
2933 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
2934 "path": "/dev/tpm0"
2935 }
2936 },
2937 "id": "tpm0"
2938 }
2939 ]
2940 }
2941
2942EQMP
2943
d1a0cf73
SB
2944 {
2945 .name = "query-tpm-models",
2946 .args_type = "",
2947 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
2948 },
2949
28c4fa32
CB
2950SQMP
2951query-tpm-models
2952----------------
2953
2954Return a list of supported TPM models.
2955
2956Arguments: None
2957
2958Example:
2959
2960-> { "execute": "query-tpm-models" }
2961<- { "return": [ "tpm-tis" ] }
2962
2963EQMP
2964
d1a0cf73
SB
2965 {
2966 .name = "query-tpm-types",
2967 .args_type = "",
2968 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
2969 },
2970
28c4fa32
CB
2971SQMP
2972query-tpm-types
2973---------------
2974
2975Return a list of supported TPM types.
2976
2977Arguments: None
2978
2979Example:
2980
2981-> { "execute": "query-tpm-types" }
2982<- { "return": [ "passthrough" ] }
2983
2984EQMP
2985
f1a1a356
GH
2986 {
2987 .name = "chardev-add",
2988 .args_type = "id:s,backend:q",
2989 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
2990 },
2991
2992SQMP
2993chardev-add
2994----------------
2995
2996Add a chardev.
2997
2998Arguments:
2999
3000- "id": the chardev's ID, must be unique (json-string)
3001- "backend": chardev backend type + parameters
3002
ffbdbe59 3003Examples:
f1a1a356
GH
3004
3005-> { "execute" : "chardev-add",
3006 "arguments" : { "id" : "foo",
3007 "backend" : { "type" : "null", "data" : {} } } }
3008<- { "return": {} }
3009
ffbdbe59
GH
3010-> { "execute" : "chardev-add",
3011 "arguments" : { "id" : "bar",
3012 "backend" : { "type" : "file",
3013 "data" : { "out" : "/tmp/bar.log" } } } }
3014<- { "return": {} }
3015
0a1a7fab
GH
3016-> { "execute" : "chardev-add",
3017 "arguments" : { "id" : "baz",
3018 "backend" : { "type" : "pty", "data" : {} } } }
3019<- { "return": { "pty" : "/dev/pty/42" } }
3020
f1a1a356
GH
3021EQMP
3022
3023 {
3024 .name = "chardev-remove",
3025 .args_type = "id:s",
3026 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3027 },
3028
3029
3030SQMP
3031chardev-remove
3032--------------
3033
3034Remove a chardev.
3035
3036Arguments:
3037
3038- "id": the chardev's ID, must exist and not be in use (json-string)
3039
3040Example:
3041
3042-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3043<- { "return": {} }
3044
3045EQMP