]> git.proxmox.com Git - mirror_qemu.git/blame - qmp-commands.hx
virtio-pci: error out when both legacy and modern modes are disabled
[mirror_qemu.git] / qmp-commands.hx
CommitLineData
82a56f0d 1HXCOMM QMP dispatch table and documentation
3599d46b 2HXCOMM Text between SQMP and EQMP is copied to the QMP documentation file and
82a56f0d
LC
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 = "",
7fad30f0 66 .mhandler.cmd_new = qmp_marshal_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",
7fad30f0 87 .mhandler.cmd_new = qmp_marshal_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?",
7fad30f0 113 .mhandler.cmd_new = qmp_marshal_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",
7fad30f0 149 .mhandler.cmd_new = qmp_marshal_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 = "",
7fad30f0 172 .mhandler.cmd_new = qmp_marshal_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 = "",
7fad30f0 193 .mhandler.cmd_new = qmp_marshal_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 = "",
7fad30f0 214 .mhandler.cmd_new = qmp_marshal_system_wakeup,
9b9df25a
GH
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 = "",
7fad30f0 235 .mhandler.cmd_new = qmp_marshal_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 = "",
7fad30f0 256 .mhandler.cmd_new = qmp_marshal_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",
485febc6 279 .mhandler.cmd_new = qmp_device_add,
82a56f0d
LC
280 },
281
282SQMP
283device_add
284----------
285
286Add a device.
287
288Arguments:
289
290- "driver": the name of the new device's driver (json-string)
291- "bus": the device's parent bus (device tree path, json-string, optional)
292- "id": the device's ID, must be unique (json-string)
293- device properties
294
295Example:
296
297-> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
298<- { "return": {} }
299
300Notes:
301
302(1) For detailed information about this command, please refer to the
303 'docs/qdev-device-use.txt' file.
304
305(2) It's possible to list device properties by running QEMU with the
306 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
307
308EQMP
309
310 {
311 .name = "device_del",
312 .args_type = "id:s",
7fad30f0 313 .mhandler.cmd_new = qmp_marshal_device_del,
82a56f0d
LC
314 },
315
316SQMP
317device_del
318----------
319
320Remove a device.
321
322Arguments:
323
6287d827 324- "id": the device's ID or QOM path (json-string)
82a56f0d
LC
325
326Example:
327
328-> { "execute": "device_del", "arguments": { "id": "net1" } }
329<- { "return": {} }
330
6287d827
DB
331Example:
332
333-> { "execute": "device_del", "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
334<- { "return": {} }
335
e4c8f004
AK
336EQMP
337
338 {
339 .name = "send-key",
43d0a2c1 340 .args_type = "keys:q,hold-time:i?",
7fad30f0 341 .mhandler.cmd_new = qmp_marshal_send_key,
e4c8f004
AK
342 },
343
344SQMP
345send-key
346----------
347
348Send keys to VM.
349
350Arguments:
351
352keys array:
f9b1d9b2
AK
353 - "key": key sequence (a json-array of key union values,
354 union can be number or qcode enum)
e4c8f004
AK
355
356- hold-time: time to delay key up events, milliseconds. Defaults to 100
357 (json-int, optional)
358
359Example:
360
361-> { "execute": "send-key",
f9b1d9b2
AK
362 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
363 { "type": "qcode", "data": "alt" },
364 { "type": "qcode", "data": "delete" } ] } }
e4c8f004
AK
365<- { "return": {} }
366
82a56f0d
LC
367EQMP
368
369 {
370 .name = "cpu",
371 .args_type = "index:i",
7fad30f0 372 .mhandler.cmd_new = qmp_marshal_cpu,
82a56f0d
LC
373 },
374
375SQMP
376cpu
377---
378
379Set the default CPU.
380
381Arguments:
382
383- "index": the CPU's index (json-int)
384
385Example:
386
387-> { "execute": "cpu", "arguments": { "index": 0 } }
388<- { "return": {} }
389
390Note: CPUs' indexes are obtained with the 'query-cpus' command.
391
69ca3ea5
IM
392EQMP
393
394 {
395 .name = "cpu-add",
396 .args_type = "id:i",
7fad30f0 397 .mhandler.cmd_new = qmp_marshal_cpu_add,
69ca3ea5
IM
398 },
399
400SQMP
401cpu-add
402-------
403
404Adds virtual cpu
405
406Arguments:
407
408- "id": cpu id (json-int)
409
410Example:
411
412-> { "execute": "cpu-add", "arguments": { "id": 2 } }
413<- { "return": {} }
414
82a56f0d
LC
415EQMP
416
417 {
418 .name = "memsave",
0cfd6a9a 419 .args_type = "val:l,size:i,filename:s,cpu:i?",
7fad30f0 420 .mhandler.cmd_new = qmp_marshal_memsave,
82a56f0d
LC
421 },
422
423SQMP
424memsave
425-------
426
427Save to disk virtual memory dump starting at 'val' of size 'size'.
428
429Arguments:
430
431- "val": the starting address (json-int)
432- "size": the memory size, in bytes (json-int)
433- "filename": file path (json-string)
0cfd6a9a 434- "cpu": virtual CPU index (json-int, optional)
82a56f0d
LC
435
436Example:
437
438-> { "execute": "memsave",
439 "arguments": { "val": 10,
440 "size": 100,
441 "filename": "/tmp/virtual-mem-dump" } }
442<- { "return": {} }
443
82a56f0d
LC
444EQMP
445
446 {
447 .name = "pmemsave",
448 .args_type = "val:l,size:i,filename:s",
7fad30f0 449 .mhandler.cmd_new = qmp_marshal_pmemsave,
82a56f0d
LC
450 },
451
452SQMP
453pmemsave
454--------
455
456Save to disk physical memory dump starting at 'val' of size 'size'.
457
458Arguments:
459
460- "val": the starting address (json-int)
461- "size": the memory size, in bytes (json-int)
462- "filename": file path (json-string)
463
464Example:
465
466-> { "execute": "pmemsave",
467 "arguments": { "val": 10,
468 "size": 100,
469 "filename": "/tmp/physical-mem-dump" } }
470<- { "return": {} }
471
a4046664
LJ
472EQMP
473
474 {
475 .name = "inject-nmi",
476 .args_type = "",
7fad30f0 477 .mhandler.cmd_new = qmp_marshal_inject_nmi,
a4046664
LJ
478 },
479
480SQMP
481inject-nmi
482----------
483
9cb805fd 484Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
a4046664
LJ
485
486Arguments: None.
487
488Example:
489
490-> { "execute": "inject-nmi" }
491<- { "return": {} }
492
de253f14 493Note: inject-nmi fails when the guest doesn't support injecting.
a4046664 494
1f590cf9
LL
495EQMP
496
497 {
3949e594 498 .name = "ringbuf-write",
82e59a67 499 .args_type = "device:s,data:s,format:s?",
7fad30f0 500 .mhandler.cmd_new = qmp_marshal_ringbuf_write,
1f590cf9
LL
501 },
502
503SQMP
3949e594 504ringbuf-write
1f590cf9
LL
505-------------
506
3949e594 507Write to a ring buffer character device.
1f590cf9
LL
508
509Arguments:
510
3949e594
MA
511- "device": ring buffer character device name (json-string)
512- "data": data to write (json-string)
513- "format": data format (json-string, optional)
514 - Possible values: "utf8" (default), "base64"
1f590cf9
LL
515
516Example:
517
3949e594
MA
518-> { "execute": "ringbuf-write",
519 "arguments": { "device": "foo",
1f590cf9
LL
520 "data": "abcdefgh",
521 "format": "utf8" } }
522<- { "return": {} }
523
49b6d722
LL
524EQMP
525
526 {
3949e594 527 .name = "ringbuf-read",
49b6d722 528 .args_type = "device:s,size:i,format:s?",
7fad30f0 529 .mhandler.cmd_new = qmp_marshal_ringbuf_read,
49b6d722
LL
530 },
531
532SQMP
3949e594 533ringbuf-read
49b6d722
LL
534-------------
535
3949e594 536Read from a ring buffer character device.
49b6d722
LL
537
538Arguments:
539
3949e594
MA
540- "device": ring buffer character device name (json-string)
541- "size": how many bytes to read at most (json-int)
542 - Number of data bytes, not number of characters in encoded data
543- "format": data format (json-string, optional)
544 - Possible values: "utf8" (default), "base64"
545 - Naturally, format "utf8" works only when the ring buffer
546 contains valid UTF-8 text. Invalid UTF-8 sequences get
547 replaced. Bug: replacement doesn't work. Bug: can screw
548 up on encountering NUL characters, after the ring buffer
549 lost data, and when reading stops because the size limit
550 is reached.
49b6d722
LL
551
552Example:
553
3949e594
MA
554-> { "execute": "ringbuf-read",
555 "arguments": { "device": "foo",
49b6d722
LL
556 "size": 1000,
557 "format": "utf8" } }
3ab651fc 558<- {"return": "abcdefgh"}
49b6d722 559
a7ae8355
SS
560EQMP
561
562 {
563 .name = "xen-save-devices-state",
564 .args_type = "filename:F",
7fad30f0 565 .mhandler.cmd_new = qmp_marshal_xen_save_devices_state,
a7ae8355
SS
566 },
567
568SQMP
569xen-save-devices-state
570-------
571
572Save the state of all devices to file. The RAM and the block devices
573of the VM are not saved by this command.
574
575Arguments:
576
577- "filename": the file to save the state of the devices to as binary
578data. See xen-save-devices-state.txt for a description of the binary
579format.
580
581Example:
582
583-> { "execute": "xen-save-devices-state",
584 "arguments": { "filename": "/tmp/save" } }
585<- { "return": {} }
586
88c16567
WC
587EQMP
588
589 {
590 .name = "xen-load-devices-state",
591 .args_type = "filename:F",
592 .mhandler.cmd_new = qmp_marshal_xen_load_devices_state,
593 },
594
595SQMP
596xen-load-devices-state
597----------------------
598
599Load the state of all devices from file. The RAM and the block devices
600of the VM are not loaded by this command.
601
602Arguments:
603
604- "filename": the file to load the state of the devices from as binary
605data. See xen-save-devices-state.txt for a description of the binary
606format.
607
608Example:
609
610-> { "execute": "xen-load-devices-state",
611 "arguments": { "filename": "/tmp/resume" } }
612<- { "return": {} }
613
39f42439
AP
614EQMP
615
616 {
617 .name = "xen-set-global-dirty-log",
618 .args_type = "enable:b",
7fad30f0 619 .mhandler.cmd_new = qmp_marshal_xen_set_global_dirty_log,
39f42439
AP
620 },
621
622SQMP
623xen-set-global-dirty-log
624-------
625
626Enable or disable the global dirty log mode.
627
628Arguments:
629
630- "enable": Enable it or disable it.
631
632Example:
633
634-> { "execute": "xen-set-global-dirty-log",
635 "arguments": { "enable": true } }
636<- { "return": {} }
637
82a56f0d
LC
638EQMP
639
640 {
641 .name = "migrate",
642 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
7fad30f0 643 .mhandler.cmd_new = qmp_marshal_migrate,
82a56f0d
LC
644 },
645
646SQMP
647migrate
648-------
649
650Migrate to URI.
651
652Arguments:
653
654- "blk": block migration, full disk copy (json-bool, optional)
655- "inc": incremental disk copy (json-bool, optional)
656- "uri": Destination URI (json-string)
657
658Example:
659
660-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
661<- { "return": {} }
662
663Notes:
664
665(1) The 'query-migrate' command should be used to check migration's progress
666 and final result (this information is provided by the 'status' member)
667(2) All boolean arguments default to false
668(3) The user Monitor's "detach" argument is invalid in QMP and should not
669 be used
670
671EQMP
672
673 {
674 .name = "migrate_cancel",
675 .args_type = "",
7fad30f0 676 .mhandler.cmd_new = qmp_marshal_migrate_cancel,
82a56f0d
LC
677 },
678
679SQMP
680migrate_cancel
681--------------
682
683Cancel the current migration.
684
685Arguments: None.
686
687Example:
688
689-> { "execute": "migrate_cancel" }
690<- { "return": {} }
691
9e1ba4cc 692EQMP
bf1ae1f4
DDAG
693
694 {
695 .name = "migrate-incoming",
696 .args_type = "uri:s",
7fad30f0 697 .mhandler.cmd_new = qmp_marshal_migrate_incoming,
bf1ae1f4
DDAG
698 },
699
700SQMP
701migrate-incoming
702----------------
703
704Continue an incoming migration
705
706Arguments:
707
708- "uri": Source/listening URI (json-string)
709
710Example:
711
712-> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
713<- { "return": {} }
714
715Notes:
716
717(1) QEMU must be started with -incoming defer to allow migrate-incoming to
718 be used
4aab6282 719(2) The uri format is the same as for -incoming
bf1ae1f4
DDAG
720
721EQMP
722 {
9e1ba4cc
OW
723 .name = "migrate-set-cache-size",
724 .args_type = "value:o",
7fad30f0 725 .mhandler.cmd_new = qmp_marshal_migrate_set_cache_size,
9e1ba4cc
OW
726 },
727
728SQMP
729migrate-set-cache-size
817c6045 730----------------------
9e1ba4cc
OW
731
732Set cache size to be used by XBZRLE migration, the cache size will be rounded
733down to the nearest power of 2
734
735Arguments:
736
737- "value": cache size in bytes (json-int)
738
739Example:
740
741-> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
742<- { "return": {} }
743
744EQMP
4886a1bc
DDAG
745 {
746 .name = "migrate-start-postcopy",
747 .args_type = "",
748 .mhandler.cmd_new = qmp_marshal_migrate_start_postcopy,
749 },
750
751SQMP
752migrate-start-postcopy
753----------------------
754
755Switch an in-progress migration to postcopy mode. Ignored after the end of
756migration (or once already in postcopy).
757
758Example:
759-> { "execute": "migrate-start-postcopy" }
760<- { "return": {} }
761
762EQMP
763
9e1ba4cc
OW
764 {
765 .name = "query-migrate-cache-size",
766 .args_type = "",
7fad30f0 767 .mhandler.cmd_new = qmp_marshal_query_migrate_cache_size,
9e1ba4cc
OW
768 },
769
770SQMP
771query-migrate-cache-size
817c6045 772------------------------
9e1ba4cc
OW
773
774Show cache size to be used by XBZRLE migration
775
776returns a json-object with the following information:
777- "size" : json-int
778
779Example:
780
781-> { "execute": "query-migrate-cache-size" }
782<- { "return": 67108864 }
783
82a56f0d
LC
784EQMP
785
786 {
787 .name = "migrate_set_speed",
3a019b6e 788 .args_type = "value:o",
7fad30f0 789 .mhandler.cmd_new = qmp_marshal_migrate_set_speed,
82a56f0d
LC
790 },
791
e866e239 792SQMP
ff73edf5
JS
793migrate_set_speed
794-----------------
e866e239 795
ff73edf5 796Set maximum speed for migrations.
e866e239
GH
797
798Arguments:
799
ff73edf5 800- "value": maximum speed, in bytes per second (json-int)
e866e239
GH
801
802Example:
803
ff73edf5 804-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
e866e239
GH
805<- { "return": {} }
806
807EQMP
808
809 {
ff73edf5
JS
810 .name = "migrate_set_downtime",
811 .args_type = "value:T",
7fad30f0 812 .mhandler.cmd_new = qmp_marshal_migrate_set_downtime,
e866e239
GH
813 },
814
82a56f0d 815SQMP
ff73edf5
JS
816migrate_set_downtime
817--------------------
82a56f0d 818
ff73edf5 819Set maximum tolerated downtime (in seconds) for migrations.
82a56f0d
LC
820
821Arguments:
822
ff73edf5 823- "value": maximum downtime (json-number)
82a56f0d
LC
824
825Example:
826
ff73edf5 827-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
82a56f0d
LC
828<- { "return": {} }
829
830EQMP
831
832 {
ff73edf5
JS
833 .name = "client_migrate_info",
834 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
835 .params = "protocol hostname port tls-port cert-subject",
13cadefb 836 .help = "set migration information for remote display",
7fad30f0 837 .mhandler.cmd_new = qmp_marshal_client_migrate_info,
82a56f0d
LC
838 },
839
840SQMP
ff73edf5 841client_migrate_info
13cadefb 842-------------------
82a56f0d 843
13cadefb
MA
844Set migration information for remote display. This makes the server
845ask the client to automatically reconnect using the new parameters
846once migration finished successfully. Only implemented for SPICE.
82a56f0d
LC
847
848Arguments:
849
13cadefb 850- "protocol": must be "spice" (json-string)
ff73edf5 851- "hostname": migration target hostname (json-string)
13cadefb 852- "port": spice tcp port for plaintext channels (json-int, optional)
ff73edf5
JS
853- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
854- "cert-subject": server certificate subject (json-string, optional)
82a56f0d
LC
855
856Example:
857
ff73edf5
JS
858-> { "execute": "client_migrate_info",
859 "arguments": { "protocol": "spice",
860 "hostname": "virt42.lab.kraxel.org",
861 "port": 1234 } }
82a56f0d
LC
862<- { "return": {} }
863
783e9b48
WC
864EQMP
865
866 {
867 .name = "dump-guest-memory",
228de9cf
PX
868 .args_type = "paging:b,protocol:s,detach:b?,begin:i?,end:i?,format:s?",
869 .params = "-p protocol [-d] [begin] [length] [format]",
783e9b48 870 .help = "dump guest memory to file",
7fad30f0 871 .mhandler.cmd_new = qmp_marshal_dump_guest_memory,
783e9b48
WC
872 },
873
874SQMP
875dump
876
877
878Dump guest memory to file. The file can be processed with crash or gdb.
879
880Arguments:
881
882- "paging": do paging to get guest's memory mapping (json-bool)
883- "protocol": destination file(started with "file:") or destination file
884 descriptor (started with "fd:") (json-string)
228de9cf 885- "detach": if specified, command will return immediately, without waiting
39ba2ea6
PX
886 for the dump to finish. The user can track progress using
887 "query-dump". (json-bool)
783e9b48
WC
888- "begin": the starting physical address. It's optional, and should be specified
889 with length together (json-int)
890- "length": the memory size, in bytes. It's optional, and should be specified
891 with begin together (json-int)
b53ccc30
QN
892- "format": the format of guest memory dump. It's optional, and can be
893 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
894 conflict with paging and filter, ie. begin and length (json-string)
783e9b48
WC
895
896Example:
897
898-> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
899<- { "return": {} }
900
901Notes:
902
903(1) All boolean arguments default to false
904
7d6dc7f3
QN
905EQMP
906
907 {
908 .name = "query-dump-guest-memory-capability",
909 .args_type = "",
7fad30f0 910 .mhandler.cmd_new = qmp_marshal_query_dump_guest_memory_capability,
7d6dc7f3
QN
911 },
912
913SQMP
914query-dump-guest-memory-capability
915----------
916
917Show available formats for 'dump-guest-memory'
918
919Example:
920
921-> { "execute": "query-dump-guest-memory-capability" }
922<- { "return": { "formats":
923 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
924
39ba2ea6
PX
925EQMP
926
927 {
928 .name = "query-dump",
929 .args_type = "",
930 .params = "",
931 .help = "query background dump status",
932 .mhandler.cmd_new = qmp_marshal_query_dump,
933 },
934
935SQMP
936query-dump
937----------
938
939Query background dump status.
940
941Arguments: None.
942
943Example:
944
945-> { "execute": "query-dump" }
946<- { "return": { "status": "active", "completed": 1024000,
947 "total": 2048000 } }
948
7ee0c3e3
JH
949EQMP
950
951#if defined TARGET_S390X
952 {
953 .name = "dump-skeys",
954 .args_type = "filename:F",
7fad30f0 955 .mhandler.cmd_new = qmp_marshal_dump_skeys,
7ee0c3e3
JH
956 },
957#endif
958
959SQMP
960dump-skeys
961----------
962
963Save guest storage keys to file.
964
965Arguments:
966
967- "filename": file path (json-string)
968
969Example:
970
971-> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
972<- { "return": {} }
973
82a56f0d
LC
974EQMP
975
976 {
977 .name = "netdev_add",
978 .args_type = "netdev:O",
928059a3 979 .mhandler.cmd_new = qmp_netdev_add,
82a56f0d
LC
980 },
981
982SQMP
983netdev_add
984----------
985
986Add host network device.
987
988Arguments:
989
990- "type": the device type, "tap", "user", ... (json-string)
991- "id": the device's ID, must be unique (json-string)
992- device options
993
994Example:
995
b8a98326
MA
996-> { "execute": "netdev_add",
997 "arguments": { "type": "user", "id": "netdev1",
998 "dnssearch": "example.org" } }
82a56f0d
LC
999<- { "return": {} }
1000
af347aa5 1001Note: The supported device options are the same ones supported by the '-netdev'
82a56f0d
LC
1002 command-line argument, which are listed in the '-help' output or QEMU's
1003 manual
1004
1005EQMP
1006
1007 {
1008 .name = "netdev_del",
1009 .args_type = "id:s",
7fad30f0 1010 .mhandler.cmd_new = qmp_marshal_netdev_del,
82a56f0d
LC
1011 },
1012
1013SQMP
1014netdev_del
1015----------
1016
1017Remove host network device.
1018
1019Arguments:
1020
1021- "id": the device's ID, must be unique (json-string)
1022
1023Example:
1024
1025-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
1026<- { "return": {} }
1027
6d4a2b3a 1028
cff8b2c6
PB
1029EQMP
1030
1031 {
1032 .name = "object-add",
1033 .args_type = "qom-type:s,id:s,props:q?",
6eb3937e 1034 .mhandler.cmd_new = qmp_marshal_object_add,
cff8b2c6
PB
1035 },
1036
1037SQMP
1038object-add
1039----------
1040
1041Create QOM object.
1042
1043Arguments:
1044
1045- "qom-type": the object's QOM type, i.e. the class name (json-string)
1046- "id": the object's ID, must be unique (json-string)
1047- "props": a dictionary of object property values (optional, json-dict)
1048
1049Example:
1050
1051-> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
1052 "props": { "filename": "/dev/hwrng" } } }
1053<- { "return": {} }
1054
6d4a2b3a
CH
1055EQMP
1056
ab2d0531
PB
1057 {
1058 .name = "object-del",
1059 .args_type = "id:s",
7fad30f0 1060 .mhandler.cmd_new = qmp_marshal_object_del,
ab2d0531
PB
1061 },
1062
1063SQMP
1064object-del
1065----------
1066
1067Remove QOM object.
1068
1069Arguments:
1070
1071- "id": the object's ID (json-string)
1072
1073Example:
1074
1075-> { "execute": "object-del", "arguments": { "id": "rng1" } }
1076<- { "return": {} }
1077
1078
1079EQMP
1080
1081
6d4a2b3a
CH
1082 {
1083 .name = "block_resize",
3b1dbd11 1084 .args_type = "device:s?,node-name:s?,size:o",
7fad30f0 1085 .mhandler.cmd_new = qmp_marshal_block_resize,
6d4a2b3a
CH
1086 },
1087
1088SQMP
1089block_resize
1090------------
1091
1092Resize a block image while a guest is running.
1093
1094Arguments:
1095
1096- "device": the device's ID, must be unique (json-string)
3b1dbd11 1097- "node-name": the node name in the block driver state graph (json-string)
6d4a2b3a
CH
1098- "size": new size
1099
1100Example:
1101
1102-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1103<- { "return": {} }
1104
d967b2f1
JS
1105EQMP
1106
12bd451f 1107 {
db58f9c0 1108 .name = "block-stream",
2323322e 1109 .args_type = "job-id:s?,device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
7fad30f0 1110 .mhandler.cmd_new = qmp_marshal_block_stream,
12bd451f
SH
1111 },
1112
ec683d60
SH
1113SQMP
1114block-stream
1115------------
1116
1117Copy data from a backing file into a block device.
1118
1119Arguments:
1120
2323322e
AG
1121- "job-id": Identifier for the newly-created block job. If omitted,
1122 the device name will be used. (json-string, optional)
b6c1bae5 1123- "device": The device name or node-name of a root node (json-string)
ec683d60
SH
1124- "base": The file name of the backing image above which copying starts
1125 (json-string, optional)
1126- "backing-file": The backing file string to write into the active layer. This
1127 filename is not validated.
1128
1129 If a pathname string is such that it cannot be resolved by
1130 QEMU, that means that subsequent QMP or HMP commands must use
1131 node-names for the image in question, as filename lookup
1132 methods will fail.
1133
1134 If not specified, QEMU will automatically determine the
1135 backing file string to use, or error out if there is no
1136 obvious choice. Care should be taken when specifying the
1137 string, to specify a valid filename or protocol.
1138 (json-string, optional) (Since 2.1)
1139- "speed": the maximum speed, in bytes per second (json-int, optional)
1140- "on-error": the action to take on an error (default 'report'). 'stop' and
1141 'enospc' can only be used if the block device supports io-status.
1142 (json-string, optional) (Since 2.1)
1143
1144Example:
1145
1146-> { "execute": "block-stream", "arguments": { "device": "virtio0",
1147 "base": "/tmp/master.qcow2" } }
1148<- { "return": {} }
1149
1150EQMP
1151
ed61fc10
JC
1152 {
1153 .name = "block-commit",
fd62c609 1154 .args_type = "job-id:s?,device:B,base:s?,top:s?,backing-file:s?,speed:o?",
7fad30f0 1155 .mhandler.cmd_new = qmp_marshal_block_commit,
ed61fc10
JC
1156 },
1157
37222900
JC
1158SQMP
1159block-commit
1160------------
1161
1162Live commit of data from overlay image nodes into backing nodes - i.e., writes
1163data between 'top' and 'base' into 'base'.
1164
1165Arguments:
1166
fd62c609
AG
1167- "job-id": Identifier for the newly-created block job. If omitted,
1168 the device name will be used. (json-string, optional)
1d13b167 1169- "device": The device name or node-name of a root node (json-string)
37222900
JC
1170- "base": The file name of the backing image to write data into.
1171 If not specified, this is the deepest backing image
1172 (json-string, optional)
1173- "top": The file name of the backing image within the image chain,
7676e2c5
JC
1174 which contains the topmost data to be committed down. If
1175 not specified, this is the active layer. (json-string, optional)
37222900 1176
54e26900
JC
1177- backing-file: The backing file string to write into the overlay
1178 image of 'top'. If 'top' is the active layer,
1179 specifying a backing file string is an error. This
1180 filename is not validated.
1181
1182 If a pathname string is such that it cannot be
1183 resolved by QEMU, that means that subsequent QMP or
1184 HMP commands must use node-names for the image in
1185 question, as filename lookup methods will fail.
1186
1187 If not specified, QEMU will automatically determine
1188 the backing file string to use, or error out if
1189 there is no obvious choice. Care should be taken
1190 when specifying the string, to specify a valid
1191 filename or protocol.
1192 (json-string, optional) (Since 2.1)
1193
37222900
JC
1194 If top == base, that is an error.
1195 If top == active, the job will not be completed by itself,
1196 user needs to complete the job with the block-job-complete
1197 command after getting the ready event. (Since 2.0)
1198
1199 If the base image is smaller than top, then the base image
1200 will be resized to be the same size as top. If top is
1201 smaller than the base image, the base will not be
1202 truncated. If you want the base image size to match the
1203 size of the smaller top, you can safely truncate it
1204 yourself once the commit operation successfully completes.
1205 (json-string)
1206- "speed": the maximum speed, in bytes per second (json-int, optional)
1207
1208
1209Example:
1210
1211-> { "execute": "block-commit", "arguments": { "device": "virtio0",
1212 "top": "/tmp/snap1.qcow2" } }
1213<- { "return": {} }
1214
1215EQMP
1216
99a9addf
SH
1217 {
1218 .name = "drive-backup",
70559d49 1219 .args_type = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
13b9414b
PB
1220 "format:s?,bitmap:s?,compress:b?,"
1221 "on-source-error:s?,on-target-error:s?",
7fad30f0 1222 .mhandler.cmd_new = qmp_marshal_drive_backup,
99a9addf
SH
1223 },
1224
1225SQMP
1226drive-backup
1227------------
1228
1229Start a point-in-time copy of a block device to a new destination. The
1230status of ongoing drive-backup operations can be checked with
1231query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1232The operation can be stopped before it has completed using the
1233block-job-cancel command.
1234
1235Arguments:
1236
70559d49
AG
1237- "job-id": Identifier for the newly-created block job. If omitted,
1238 the device name will be used. (json-string, optional)
b7e4fa22 1239- "device": the device name or node-name of a root node which should be copied.
99a9addf
SH
1240 (json-string)
1241- "target": the target of the new image. If the file exists, or if it is a
1242 device, the existing file/device will be used as the new
1243 destination. If it does not exist, a new file will be created.
1244 (json-string)
1245- "format": the format of the new destination, default is to probe if 'mode' is
1246 'existing', else the format of the source
1247 (json-string, optional)
b53169ea
SH
1248- "sync": what parts of the disk image should be copied to the destination;
1249 possibilities include "full" for all the disk, "top" for only the sectors
4b80ab2b 1250 allocated in the topmost image, "incremental" for only the dirty sectors in
d58d8453 1251 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
4b80ab2b
JS
1252- "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1253 is "incremental", must NOT be present otherwise.
99a9addf
SH
1254- "mode": whether and how QEMU should create a new image
1255 (NewImageMode, optional, default 'absolute-paths')
1256- "speed": the maximum speed, in bytes per second (json-int, optional)
13b9414b
PB
1257- "compress": true to compress data, if the target format supports it.
1258 (json-bool, optional, default false)
99a9addf
SH
1259- "on-source-error": the action to take on an error on the source, default
1260 'report'. 'stop' and 'enospc' can only be used
1261 if the block device supports io-status.
1262 (BlockdevOnError, optional)
1263- "on-target-error": the action to take on an error on the target, default
1264 'report' (no limitations, since this applies to
1265 a different block device than device).
1266 (BlockdevOnError, optional)
1267
1268Example:
1269-> { "execute": "drive-backup", "arguments": { "device": "drive0",
fc5d3f84 1270 "sync": "full",
99a9addf
SH
1271 "target": "backup.img" } }
1272<- { "return": {} }
c29c1dd3
FZ
1273
1274EQMP
1275
1276 {
1277 .name = "blockdev-backup",
3b7b1236 1278 .args_type = "job-id:s?,sync:s,device:B,target:B,speed:i?,compress:b?,"
c29c1dd3 1279 "on-source-error:s?,on-target-error:s?",
7fad30f0 1280 .mhandler.cmd_new = qmp_marshal_blockdev_backup,
c29c1dd3
FZ
1281 },
1282
1283SQMP
1284blockdev-backup
1285---------------
1286
1287The device version of drive-backup: this command takes an existing named device
1288as backup target.
1289
1290Arguments:
1291
70559d49
AG
1292- "job-id": Identifier for the newly-created block job. If omitted,
1293 the device name will be used. (json-string, optional)
cef34eeb 1294- "device": the device name or node-name of a root node which should be copied.
c29c1dd3
FZ
1295 (json-string)
1296- "target": the name of the backup target device. (json-string)
1297- "sync": what parts of the disk image should be copied to the destination;
1298 possibilities include "full" for all the disk, "top" for only the
1299 sectors allocated in the topmost image, or "none" to only replicate
1300 new I/O (MirrorSyncMode).
1301- "speed": the maximum speed, in bytes per second (json-int, optional)
3b7b1236
PB
1302- "compress": true to compress data, if the target format supports it.
1303 (json-bool, optional, default false)
c29c1dd3
FZ
1304- "on-source-error": the action to take on an error on the source, default
1305 'report'. 'stop' and 'enospc' can only be used
1306 if the block device supports io-status.
1307 (BlockdevOnError, optional)
1308- "on-target-error": the action to take on an error on the target, default
1309 'report' (no limitations, since this applies to
1310 a different block device than device).
1311 (BlockdevOnError, optional)
1312
1313Example:
1314-> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1315 "sync": "full",
1316 "target": "tgt-id" } }
1317<- { "return": {} }
1318
99a9addf
SH
1319EQMP
1320
2d47c6e9 1321 {
db58f9c0 1322 .name = "block-job-set-speed",
882ec7ce 1323 .args_type = "device:B,speed:o",
7fad30f0 1324 .mhandler.cmd_new = qmp_marshal_block_job_set_speed,
2d47c6e9
SH
1325 },
1326
370521a1 1327 {
db58f9c0 1328 .name = "block-job-cancel",
6e37fb81 1329 .args_type = "device:B,force:b?",
7fad30f0 1330 .mhandler.cmd_new = qmp_marshal_block_job_cancel,
370521a1 1331 },
6e37fb81
PB
1332 {
1333 .name = "block-job-pause",
1334 .args_type = "device:B",
7fad30f0 1335 .mhandler.cmd_new = qmp_marshal_block_job_pause,
6e37fb81
PB
1336 },
1337 {
1338 .name = "block-job-resume",
1339 .args_type = "device:B",
7fad30f0 1340 .mhandler.cmd_new = qmp_marshal_block_job_resume,
6e37fb81 1341 },
aeae883b
PB
1342 {
1343 .name = "block-job-complete",
1344 .args_type = "device:B",
7fad30f0 1345 .mhandler.cmd_new = qmp_marshal_block_job_complete,
aeae883b 1346 },
c186402c 1347 {
52e7c241 1348 .name = "transaction",
94d16a64 1349 .args_type = "actions:q,properties:q?",
7fad30f0 1350 .mhandler.cmd_new = qmp_marshal_transaction,
c186402c
JC
1351 },
1352
1353SQMP
52e7c241
PB
1354transaction
1355-----------
c186402c 1356
a910523a
KC
1357Atomically operate on one or more block devices. Operations that are
1358currently supported:
1359
1360 - drive-backup
1361 - blockdev-backup
1362 - blockdev-snapshot-sync
1363 - blockdev-snapshot-internal-sync
1364 - abort
1365 - block-dirty-bitmap-add
1366 - block-dirty-bitmap-clear
1367
1368Refer to the qemu/qapi-schema.json file for minimum required QEMU
1369versions for these operations. A list of dictionaries is accepted,
1370that contains the actions to be performed. If there is any failure
1371performing any of the operations, all operations for the group are
1372abandoned.
c186402c 1373
bbe86010
WX
1374For external snapshots, the dictionary contains the device, the file to use for
1375the new snapshot, and the format. The default format, if not specified, is
1376qcow2.
c186402c 1377
bc8b094f
PB
1378Each new snapshot defaults to being created by QEMU (wiping any
1379contents if the file already exists), but it is also possible to reuse
1380an externally-created file. In the latter case, you should ensure that
1381the new image file has the same contents as the current one; QEMU cannot
1382perform any meaningful check. Typically this is achieved by using the
1383current image file as the backing file for the new image.
1384
bbe86010
WX
1385On failure, the original disks pre-snapshot attempt will be used.
1386
1387For internal snapshots, the dictionary contains the device and the snapshot's
1388name. If an internal snapshot matching name already exists, the request will
1389be rejected. Only some image formats support it, for example, qcow2, rbd,
1390and sheepdog.
1391
1392On failure, qemu will try delete the newly created internal snapshot in the
1393transaction. When an I/O error occurs during deletion, the user needs to fix
1394it later with qemu-img or other command.
1395
c186402c
JC
1396Arguments:
1397
52e7c241 1398actions array:
a910523a
KC
1399 - "type": the operation to perform (json-string). Possible
1400 values: "drive-backup", "blockdev-backup",
1401 "blockdev-snapshot-sync",
1402 "blockdev-snapshot-internal-sync",
1403 "abort", "block-dirty-bitmap-add",
1404 "block-dirty-bitmap-clear"
52e7c241
PB
1405 - "data": a dictionary. The contents depend on the value
1406 of "type". When "type" is "blockdev-snapshot-sync":
1407 - "device": device name to snapshot (json-string)
0901f67e 1408 - "node-name": graph node name to snapshot (json-string)
52e7c241 1409 - "snapshot-file": name of new image file (json-string)
0901f67e 1410 - "snapshot-node-name": graph node name of the new snapshot (json-string)
52e7c241 1411 - "format": format of new image (json-string, optional)
bc8b094f
PB
1412 - "mode": whether and how QEMU should create the snapshot file
1413 (NewImageMode, optional, default "absolute-paths")
bbe86010 1414 When "type" is "blockdev-snapshot-internal-sync":
75dfd402
KW
1415 - "device": the device name or node-name of a root node to snapshot
1416 (json-string)
bbe86010 1417 - "name": name of the new snapshot (json-string)
c186402c
JC
1418
1419Example:
1420
52e7c241
PB
1421-> { "execute": "transaction",
1422 "arguments": { "actions": [
cd0c5389 1423 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
52e7c241
PB
1424 "snapshot-file": "/some/place/my-image",
1425 "format": "qcow2" } },
cd0c5389 1426 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
0901f67e
BC
1427 "snapshot-file": "/some/place/my-image2",
1428 "snapshot-node-name": "node3432",
1429 "mode": "existing",
1430 "format": "qcow2" } },
cd0c5389 1431 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
52e7c241 1432 "snapshot-file": "/some/place/my-image2",
bc8b094f 1433 "mode": "existing",
bbe86010 1434 "format": "qcow2" } },
cd0c5389 1435 { "type": "blockdev-snapshot-internal-sync", "data" : {
bbe86010
WX
1436 "device": "ide-hd2",
1437 "name": "snapshot0" } } ] } }
c186402c
JC
1438<- { "return": {} }
1439
341ebc2f
JS
1440EQMP
1441
1442 {
1443 .name = "block-dirty-bitmap-add",
1444 .args_type = "node:B,name:s,granularity:i?",
7fad30f0 1445 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_add,
341ebc2f
JS
1446 },
1447
1448SQMP
1449
1450block-dirty-bitmap-add
1451----------------------
1452Since 2.4
1453
1454Create a dirty bitmap with a name on the device, and start tracking the writes.
1455
1456Arguments:
1457
1458- "node": device/node on which to create dirty bitmap (json-string)
1459- "name": name of the new dirty bitmap (json-string)
1460- "granularity": granularity to track writes with (int, optional)
1461
1462Example:
1463
1464-> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1465 "name": "bitmap0" } }
1466<- { "return": {} }
1467
1468EQMP
1469
1470 {
1471 .name = "block-dirty-bitmap-remove",
1472 .args_type = "node:B,name:s",
7fad30f0 1473 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_remove,
341ebc2f
JS
1474 },
1475
1476SQMP
1477
1478block-dirty-bitmap-remove
1479-------------------------
1480Since 2.4
1481
1482Stop write tracking and remove the dirty bitmap that was created with
1483block-dirty-bitmap-add.
1484
1485Arguments:
1486
1487- "node": device/node on which to remove dirty bitmap (json-string)
1488- "name": name of the dirty bitmap to remove (json-string)
1489
1490Example:
1491
1492-> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1493 "name": "bitmap0" } }
1494<- { "return": {} }
1495
e74e6b78
JS
1496EQMP
1497
1498 {
1499 .name = "block-dirty-bitmap-clear",
1500 .args_type = "node:B,name:s",
7fad30f0 1501 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_clear,
e74e6b78
JS
1502 },
1503
1504SQMP
1505
1506block-dirty-bitmap-clear
1507------------------------
1508Since 2.4
1509
1510Reset the dirty bitmap associated with a node so that an incremental backup
1511from this point in time forward will only backup clusters modified after this
1512clear operation.
1513
1514Arguments:
1515
1516- "node": device/node on which to remove dirty bitmap (json-string)
1517- "name": name of the dirty bitmap to remove (json-string)
1518
1519Example:
1520
1521-> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1522 "name": "bitmap0" } }
1523<- { "return": {} }
1524
c186402c 1525EQMP
370521a1 1526
d967b2f1
JS
1527 {
1528 .name = "blockdev-snapshot-sync",
0901f67e 1529 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
7fad30f0 1530 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_sync,
d967b2f1
JS
1531 },
1532
1533SQMP
1534blockdev-snapshot-sync
1535----------------------
1536
1537Synchronous snapshot of a block device. snapshot-file specifies the
1538target of the new image. If the file exists, or if it is a device, the
1539snapshot will be created in the existing file/device. If does not
1540exist, a new file will be created. format specifies the format of the
1541snapshot image, default is qcow2.
1542
1543Arguments:
1544
1545- "device": device name to snapshot (json-string)
0901f67e 1546- "node-name": graph node name to snapshot (json-string)
d967b2f1 1547- "snapshot-file": name of new image file (json-string)
0901f67e 1548- "snapshot-node-name": graph node name of the new snapshot (json-string)
6cc2a415
PB
1549- "mode": whether and how QEMU should create the snapshot file
1550 (NewImageMode, optional, default "absolute-paths")
d967b2f1
JS
1551- "format": format of new image (json-string, optional)
1552
1553Example:
1554
7f3850c2
LC
1555-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1556 "snapshot-file":
1557 "/some/place/my-image",
1558 "format": "qcow2" } }
d967b2f1
JS
1559<- { "return": {} }
1560
43de7e2d
AG
1561EQMP
1562
1563 {
1564 .name = "blockdev-snapshot",
1565 .args_type = "node:s,overlay:s",
1566 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot,
1567 },
1568
1569SQMP
1570blockdev-snapshot
1571-----------------
1572Since 2.5
1573
1574Create a snapshot, by installing 'node' as the backing image of
1575'overlay'. Additionally, if 'node' is associated with a block
1576device, the block device changes to using 'overlay' as its new active
1577image.
1578
1579Arguments:
1580
1581- "node": device that will have a snapshot created (json-string)
1582- "overlay": device that will have 'node' as its backing image (json-string)
1583
1584Example:
1585
1586-> { "execute": "blockdev-add",
1587 "arguments": { "options": { "driver": "qcow2",
1588 "node-name": "node1534",
1589 "file": { "driver": "file",
1590 "filename": "hd1.qcow2" },
1591 "backing": "" } } }
1592
1593<- { "return": {} }
1594
1595-> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1596 "overlay": "node1534" } }
1597<- { "return": {} }
1598
f323bc9e
WX
1599EQMP
1600
1601 {
1602 .name = "blockdev-snapshot-internal-sync",
1603 .args_type = "device:B,name:s",
7fad30f0 1604 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_internal_sync,
f323bc9e
WX
1605 },
1606
1607SQMP
1608blockdev-snapshot-internal-sync
1609-------------------------------
1610
1611Synchronously take an internal snapshot of a block device when the format of
1612image used supports it. If the name is an empty string, or a snapshot with
1613name already exists, the operation will fail.
1614
1615Arguments:
1616
75dfd402
KW
1617- "device": the device name or node-name of a root node to snapshot
1618 (json-string)
f323bc9e
WX
1619- "name": name of the new snapshot (json-string)
1620
1621Example:
1622
1623-> { "execute": "blockdev-snapshot-internal-sync",
1624 "arguments": { "device": "ide-hd0",
1625 "name": "snapshot0" }
1626 }
1627<- { "return": {} }
1628
44e3e053
WX
1629EQMP
1630
1631 {
1632 .name = "blockdev-snapshot-delete-internal-sync",
1633 .args_type = "device:B,id:s?,name:s?",
1634 .mhandler.cmd_new =
7fad30f0 1635 qmp_marshal_blockdev_snapshot_delete_internal_sync,
44e3e053
WX
1636 },
1637
1638SQMP
1639blockdev-snapshot-delete-internal-sync
1640--------------------------------------
1641
1642Synchronously delete an internal snapshot of a block device when the format of
1643image used supports it. The snapshot is identified by name or id or both. One
1644of name or id is required. If the snapshot is not found, the operation will
1645fail.
1646
1647Arguments:
1648
2dfb4c03 1649- "device": the device name or node-name of a root node (json-string)
44e3e053
WX
1650- "id": ID of the snapshot (json-string, optional)
1651- "name": name of the snapshot (json-string, optional)
1652
1653Example:
1654
1655-> { "execute": "blockdev-snapshot-delete-internal-sync",
1656 "arguments": { "device": "ide-hd0",
1657 "name": "snapshot0" }
1658 }
1659<- { "return": {
1660 "id": "1",
1661 "name": "snapshot0",
1662 "vm-state-size": 0,
1663 "date-sec": 1000012,
1664 "date-nsec": 10,
1665 "vm-clock-sec": 100,
1666 "vm-clock-nsec": 20
1667 }
1668 }
1669
d9b902db
PB
1670EQMP
1671
1672 {
1673 .name = "drive-mirror",
71aa9867
AG
1674 .args_type = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
1675 "format:s?,node-name:s?,replaces:s?,"
eee13dfe 1676 "on-source-error:s?,on-target-error:s?,"
0fc9f8ea 1677 "unmap:b?,"
08e4ed6c 1678 "granularity:i?,buf-size:i?",
7fad30f0 1679 .mhandler.cmd_new = qmp_marshal_drive_mirror,
d9b902db
PB
1680 },
1681
1682SQMP
1683drive-mirror
1684------------
1685
1686Start mirroring a block device's writes to a new destination. target
1687specifies the target of the new image. If the file exists, or if it is
1688a device, it will be used as the new destination for writes. If it does not
1689exist, a new file will be created. format specifies the format of the
1690mirror image, default is to probe if mode='existing', else the format
1691of the source.
1692
1693Arguments:
1694
71aa9867
AG
1695- "job-id": Identifier for the newly-created block job. If omitted,
1696 the device name will be used. (json-string, optional)
0524e93a
KW
1697- "device": the device name or node-name of a root node whose writes should be
1698 mirrored. (json-string)
d9b902db
PB
1699- "target": name of new image file (json-string)
1700- "format": format of new image (json-string, optional)
4c828dc6
BC
1701- "node-name": the name of the new block driver state in the node graph
1702 (json-string, optional)
09158f00
BC
1703- "replaces": the block driver node name to replace when finished
1704 (json-string, optional)
d9b902db
PB
1705- "mode": how an image file should be created into the target
1706 file/device (NewImageMode, optional, default 'absolute-paths')
1707- "speed": maximum speed of the streaming job, in bytes per second
1708 (json-int)
eee13dfe 1709- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
df92562e 1710- "buf-size": maximum amount of data in flight from source to target, in bytes
08e4ed6c 1711 (json-int, default 10M)
d9b902db
PB
1712- "sync": what parts of the disk image should be copied to the destination;
1713 possibilities include "full" for all the disk, "top" for only the sectors
1714 allocated in the topmost image, or "none" to only replicate new I/O
1715 (MirrorSyncMode).
b952b558
PB
1716- "on-source-error": the action to take on an error on the source
1717 (BlockdevOnError, default 'report')
1718- "on-target-error": the action to take on an error on the target
1719 (BlockdevOnError, default 'report')
0fc9f8ea
FZ
1720- "unmap": whether the target sectors should be discarded where source has only
1721 zeroes. (json-bool, optional, default true)
b952b558 1722
eee13dfe
PB
1723The default value of the granularity is the image cluster size clamped
1724between 4096 and 65536, if the image format defines one. If the format
1725does not define a cluster size, the default value of the granularity
1726is 65536.
d9b902db
PB
1727
1728
1729Example:
1730
1731-> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1732 "target": "/some/place/my-image",
1733 "sync": "full",
1734 "format": "qcow2" } }
1735<- { "return": {} }
1736
fa40e656
JC
1737EQMP
1738
df92562e
FZ
1739 {
1740 .name = "blockdev-mirror",
71aa9867 1741 .args_type = "job-id:s?,sync:s,device:B,target:B,replaces:s?,speed:i?,"
df92562e
FZ
1742 "on-source-error:s?,on-target-error:s?,"
1743 "granularity:i?,buf-size:i?",
1744 .mhandler.cmd_new = qmp_marshal_blockdev_mirror,
1745 },
1746
1747SQMP
1748blockdev-mirror
1749------------
1750
1751Start mirroring a block device's writes to another block device. target
1752specifies the target of mirror operation.
1753
1754Arguments:
1755
71aa9867
AG
1756- "job-id": Identifier for the newly-created block job. If omitted,
1757 the device name will be used. (json-string, optional)
07eec652
KW
1758- "device": The device name or node-name of a root node whose writes should be
1759 mirrored (json-string)
df92562e
FZ
1760- "target": device name to mirror to (json-string)
1761- "replaces": the block driver node name to replace when finished
1762 (json-string, optional)
1763- "speed": maximum speed of the streaming job, in bytes per second
1764 (json-int)
1765- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1766- "buf_size": maximum amount of data in flight from source to target, in bytes
1767 (json-int, default 10M)
1768- "sync": what parts of the disk image should be copied to the destination;
1769 possibilities include "full" for all the disk, "top" for only the sectors
1770 allocated in the topmost image, or "none" to only replicate new I/O
1771 (MirrorSyncMode).
1772- "on-source-error": the action to take on an error on the source
1773 (BlockdevOnError, default 'report')
1774- "on-target-error": the action to take on an error on the target
1775 (BlockdevOnError, default 'report')
1776
1777The default value of the granularity is the image cluster size clamped
1778between 4096 and 65536, if the image format defines one. If the format
1779does not define a cluster size, the default value of the granularity
1780is 65536.
1781
1782Example:
1783
1784-> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1785 "target": "target0",
1786 "sync": "full" } }
1787<- { "return": {} }
1788
1789EQMP
fa40e656
JC
1790 {
1791 .name = "change-backing-file",
1792 .args_type = "device:s,image-node-name:s,backing-file:s",
7fad30f0 1793 .mhandler.cmd_new = qmp_marshal_change_backing_file,
fa40e656
JC
1794 },
1795
1796SQMP
1797change-backing-file
1798-------------------
1799Since: 2.1
1800
1801Change the backing file in the image file metadata. This does not cause
1802QEMU to reopen the image file to reparse the backing filename (it may,
1803however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1804if needed). The new backing file string is written into the image file
1805metadata, and the QEMU internal strings are updated.
1806
1807Arguments:
1808
1809- "image-node-name": The name of the block driver state node of the
1810 image to modify. The "device" is argument is used to
1811 verify "image-node-name" is in the chain described by
1812 "device".
1813 (json-string, optional)
1814
7b5dca3f
KW
1815- "device": The device name or node-name of the root node that owns
1816 image-node-name.
fa40e656
JC
1817 (json-string)
1818
1819- "backing-file": The string to write as the backing file. This string is
1820 not validated, so care should be taken when specifying
1821 the string or the image chain may not be able to be
1822 reopened again.
1823 (json-string)
1824
1825Returns: Nothing on success
1826 If "device" does not exist or cannot be determined, DeviceNotFound
1827
82a56f0d
LC
1828EQMP
1829
1830 {
1831 .name = "balloon",
1832 .args_type = "value:M",
7fad30f0 1833 .mhandler.cmd_new = qmp_marshal_balloon,
82a56f0d
LC
1834 },
1835
1836SQMP
1837balloon
1838-------
1839
1840Request VM to change its memory allocation (in bytes).
1841
1842Arguments:
1843
1844- "value": New memory allocation (json-int)
1845
1846Example:
1847
1848-> { "execute": "balloon", "arguments": { "value": 536870912 } }
1849<- { "return": {} }
1850
1851EQMP
1852
1853 {
1854 .name = "set_link",
1855 .args_type = "name:s,up:b",
7fad30f0 1856 .mhandler.cmd_new = qmp_marshal_set_link,
82a56f0d
LC
1857 },
1858
1859SQMP
1860set_link
1861--------
1862
1863Change the link status of a network adapter.
1864
1865Arguments:
1866
1867- "name": network device name (json-string)
1868- "up": status is up (json-bool)
1869
1870Example:
1871
1872-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1873<- { "return": {} }
1874
1875EQMP
1876
1877 {
1878 .name = "getfd",
1879 .args_type = "fdname:s",
1880 .params = "getfd name",
1881 .help = "receive a file descriptor via SCM rights and assign it a name",
7fad30f0 1882 .mhandler.cmd_new = qmp_marshal_getfd,
82a56f0d
LC
1883 },
1884
1885SQMP
1886getfd
1887-----
1888
1889Receive a file descriptor via SCM rights and assign it a name.
1890
1891Arguments:
1892
1893- "fdname": file descriptor name (json-string)
1894
1895Example:
1896
1897-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1898<- { "return": {} }
1899
208c9d1b
CB
1900Notes:
1901
1902(1) If the name specified by the "fdname" argument already exists,
1903 the file descriptor assigned to it will be closed and replaced
1904 by the received file descriptor.
1905(2) The 'closefd' command can be used to explicitly close the file
1906 descriptor when it is no longer needed.
1907
82a56f0d
LC
1908EQMP
1909
1910 {
1911 .name = "closefd",
1912 .args_type = "fdname:s",
1913 .params = "closefd name",
1914 .help = "close a file descriptor previously passed via SCM rights",
7fad30f0 1915 .mhandler.cmd_new = qmp_marshal_closefd,
82a56f0d
LC
1916 },
1917
1918SQMP
1919closefd
1920-------
1921
1922Close a file descriptor previously passed via SCM rights.
1923
1924Arguments:
1925
1926- "fdname": file descriptor name (json-string)
1927
1928Example:
1929
1930-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1931<- { "return": {} }
1932
ba1c048a
CB
1933EQMP
1934
1935 {
1936 .name = "add-fd",
1937 .args_type = "fdset-id:i?,opaque:s?",
1938 .params = "add-fd fdset-id opaque",
1939 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
7fad30f0 1940 .mhandler.cmd_new = qmp_marshal_add_fd,
ba1c048a
CB
1941 },
1942
1943SQMP
1944add-fd
1945-------
1946
1947Add a file descriptor, that was passed via SCM rights, to an fd set.
1948
1949Arguments:
1950
1951- "fdset-id": The ID of the fd set to add the file descriptor to.
1952 (json-int, optional)
1953- "opaque": A free-form string that can be used to describe the fd.
1954 (json-string, optional)
1955
1956Return a json-object with the following information:
1957
1958- "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1959- "fd": The file descriptor that was received via SCM rights and added to the
1960 fd set. (json-int)
1961
1962Example:
1963
1964-> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1965<- { "return": { "fdset-id": 1, "fd": 3 } }
1966
1967Notes:
1968
1969(1) The list of fd sets is shared by all monitor connections.
1970(2) If "fdset-id" is not specified, a new fd set will be created.
1971
1972EQMP
1973
1974 {
1975 .name = "remove-fd",
1976 .args_type = "fdset-id:i,fd:i?",
1977 .params = "remove-fd fdset-id fd",
1978 .help = "Remove a file descriptor from an fd set",
7fad30f0 1979 .mhandler.cmd_new = qmp_marshal_remove_fd,
ba1c048a
CB
1980 },
1981
1982SQMP
1983remove-fd
1984---------
1985
1986Remove a file descriptor from an fd set.
1987
1988Arguments:
1989
1990- "fdset-id": The ID of the fd set that the file descriptor belongs to.
1991 (json-int)
1992- "fd": The file descriptor that is to be removed. (json-int, optional)
1993
1994Example:
1995
1996-> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1997<- { "return": {} }
1998
1999Notes:
2000
2001(1) The list of fd sets is shared by all monitor connections.
2002(2) If "fd" is not specified, all file descriptors in "fdset-id" will be
2003 removed.
2004
2005EQMP
2006
2007 {
2008 .name = "query-fdsets",
2009 .args_type = "",
2010 .help = "Return information describing all fd sets",
7fad30f0 2011 .mhandler.cmd_new = qmp_marshal_query_fdsets,
ba1c048a
CB
2012 },
2013
2014SQMP
2015query-fdsets
2016-------------
2017
2018Return information describing all fd sets.
2019
2020Arguments: None
2021
2022Example:
2023
2024-> { "execute": "query-fdsets" }
2025<- { "return": [
2026 {
2027 "fds": [
2028 {
2029 "fd": 30,
2030 "opaque": "rdonly:/path/to/file"
2031 },
2032 {
2033 "fd": 24,
2034 "opaque": "rdwr:/path/to/file"
2035 }
2036 ],
2037 "fdset-id": 1
2038 },
2039 {
2040 "fds": [
2041 {
2042 "fd": 28
2043 },
2044 {
2045 "fd": 29
2046 }
2047 ],
2048 "fdset-id": 0
2049 }
2050 ]
2051 }
2052
2053Note: The list of fd sets is shared by all monitor connections.
2054
82a56f0d
LC
2055EQMP
2056
2057 {
2058 .name = "block_passwd",
12d3ba82 2059 .args_type = "device:s?,node-name:s?,password:s",
7fad30f0 2060 .mhandler.cmd_new = qmp_marshal_block_passwd,
82a56f0d
LC
2061 },
2062
2063SQMP
2064block_passwd
2065------------
2066
2067Set the password of encrypted block devices.
2068
2069Arguments:
2070
2071- "device": device name (json-string)
12d3ba82 2072- "node-name": name in the block driver state graph (json-string)
82a56f0d
LC
2073- "password": password (json-string)
2074
2075Example:
2076
2077-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
2078 "password": "12345" } }
2079<- { "return": {} }
2080
727f005e
ZYW
2081EQMP
2082
2083 {
2084 .name = "block_set_io_throttle",
dce13204 2085 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l,bps_max:l?,bps_rd_max:l?,bps_wr_max:l?,iops_max:l?,iops_rd_max:l?,iops_wr_max:l?,bps_max_length:l?,bps_rd_max_length:l?,bps_wr_max_length:l?,iops_max_length:l?,iops_rd_max_length:l?,iops_wr_max_length:l?,iops_size:l?,group:s?",
7fad30f0 2086 .mhandler.cmd_new = qmp_marshal_block_set_io_throttle,
727f005e
ZYW
2087 },
2088
2089SQMP
2090block_set_io_throttle
2091------------
2092
2093Change I/O throttle limits for a block drive.
2094
2095Arguments:
2096
2097- "device": device name (json-string)
586b5466
EB
2098- "bps": total throughput limit in bytes per second (json-int)
2099- "bps_rd": read throughput limit in bytes per second (json-int)
2100- "bps_wr": write throughput limit in bytes per second (json-int)
2101- "iops": total I/O operations per second (json-int)
2102- "iops_rd": read I/O operations per second (json-int)
2103- "iops_wr": write I/O operations per second (json-int)
dce13204
AG
2104- "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
2105- "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
2106- "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
2107- "iops_max": total I/O operations per second during bursts (json-int, optional)
2108- "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
2109- "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
2110- "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
2111- "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
2112- "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
2113- "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
2114- "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
2115- "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
2116- "iops_size": I/O size in bytes when limiting (json-int, optional)
2117- "group": throttle group name (json-string, optional)
727f005e
ZYW
2118
2119Example:
2120
2121-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
586b5466
EB
2122 "bps": 1000000,
2123 "bps_rd": 0,
2124 "bps_wr": 0,
2125 "iops": 0,
2126 "iops_rd": 0,
3e9fab69
BC
2127 "iops_wr": 0,
2128 "bps_max": 8000000,
2129 "bps_rd_max": 0,
2130 "bps_wr_max": 0,
2131 "iops_max": 0,
2132 "iops_rd_max": 0,
2024c1df 2133 "iops_wr_max": 0,
dce13204 2134 "bps_max_length": 60,
2024c1df 2135 "iops_size": 0 } }
727f005e
ZYW
2136<- { "return": {} }
2137
7572150c
GH
2138EQMP
2139
2140 {
2141 .name = "set_password",
2142 .args_type = "protocol:s,password:s,connected:s?",
7fad30f0 2143 .mhandler.cmd_new = qmp_marshal_set_password,
7572150c
GH
2144 },
2145
2146SQMP
2147set_password
2148------------
2149
2150Set the password for vnc/spice protocols.
2151
2152Arguments:
2153
2154- "protocol": protocol name (json-string)
2155- "password": password (json-string)
3599d46b 2156- "connected": [ keep | disconnect | fail ] (json-string, optional)
7572150c
GH
2157
2158Example:
2159
2160-> { "execute": "set_password", "arguments": { "protocol": "vnc",
2161 "password": "secret" } }
2162<- { "return": {} }
2163
2164EQMP
2165
2166 {
2167 .name = "expire_password",
2168 .args_type = "protocol:s,time:s",
7fad30f0 2169 .mhandler.cmd_new = qmp_marshal_expire_password,
7572150c
GH
2170 },
2171
2172SQMP
2173expire_password
2174---------------
2175
2176Set the password expire time for vnc/spice protocols.
2177
2178Arguments:
2179
2180- "protocol": protocol name (json-string)
2181- "time": [ now | never | +secs | secs ] (json-string)
2182
2183Example:
2184
2185-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2186 "time": "+60" } }
2187<- { "return": {} }
2188
82a56f0d
LC
2189EQMP
2190
13661089
DB
2191 {
2192 .name = "add_client",
f1f5f407 2193 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
7fad30f0 2194 .mhandler.cmd_new = qmp_marshal_add_client,
13661089
DB
2195 },
2196
2197SQMP
2198add_client
2199----------
2200
2201Add a graphics client
2202
2203Arguments:
2204
2205- "protocol": protocol name (json-string)
2206- "fdname": file descriptor name (json-string)
f1f5f407
DB
2207- "skipauth": whether to skip authentication (json-bool, optional)
2208- "tls": whether to perform TLS (json-bool, optional)
13661089
DB
2209
2210Example:
2211
2212-> { "execute": "add_client", "arguments": { "protocol": "vnc",
2213 "fdname": "myclient" } }
2214<- { "return": {} }
2215
2216EQMP
82a56f0d
LC
2217 {
2218 .name = "qmp_capabilities",
2219 .args_type = "",
2220 .params = "",
2221 .help = "enable QMP capabilities",
485febc6 2222 .mhandler.cmd_new = qmp_capabilities,
82a56f0d
LC
2223 },
2224
2225SQMP
2226qmp_capabilities
2227----------------
2228
2229Enable QMP capabilities.
2230
2231Arguments: None.
2232
2233Example:
2234
2235-> { "execute": "qmp_capabilities" }
2236<- { "return": {} }
2237
2238Note: This command must be issued before issuing any other command.
2239
0268d97c
LC
2240EQMP
2241
2242 {
2243 .name = "human-monitor-command",
2244 .args_type = "command-line:s,cpu-index:i?",
7fad30f0 2245 .mhandler.cmd_new = qmp_marshal_human_monitor_command,
0268d97c
LC
2246 },
2247
2248SQMP
2249human-monitor-command
2250---------------------
2251
2252Execute a Human Monitor command.
2253
2254Arguments:
2255
2256- command-line: the command name and its arguments, just like the
2257 Human Monitor's shell (json-string)
2258- cpu-index: select the CPU number to be used by commands which access CPU
2259 data, like 'info registers'. The Monitor selects CPU 0 if this
2260 argument is not provided (json-int, optional)
2261
2262Example:
2263
2264-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2265<- { "return": "kvm support: enabled\r\n" }
2266
2267Notes:
2268
2269(1) The Human Monitor is NOT an stable interface, this means that command
2270 names, arguments and responses can change or be removed at ANY time.
2271 Applications that rely on long term stability guarantees should NOT
2272 use this command
2273
2274(2) Limitations:
2275
2276 o This command is stateless, this means that commands that depend
2277 on state information (such as getfd) might not work
2278
2279 o Commands that prompt the user for data (eg. 'cont' when the block
2280 device is encrypted) don't currently work
2281
82a56f0d
LC
22823. Query Commands
2283=================
2284
2285HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2286HXCOMM this! We will possibly move query commands definitions inside those
2287HXCOMM sections, just like regular commands.
2288
2289EQMP
2290
2291SQMP
2292query-version
2293-------------
2294
2295Show QEMU version.
2296
2297Return a json-object with the following information:
2298
2299- "qemu": A json-object containing three integer values:
2300 - "major": QEMU's major version (json-int)
2301 - "minor": QEMU's minor version (json-int)
2302 - "micro": QEMU's micro version (json-int)
2303- "package": package's version (json-string)
2304
2305Example:
2306
2307-> { "execute": "query-version" }
2308<- {
2309 "return":{
2310 "qemu":{
2311 "major":0,
2312 "minor":11,
2313 "micro":5
2314 },
2315 "package":""
2316 }
2317 }
2318
2319EQMP
2320
b9c15f16
LC
2321 {
2322 .name = "query-version",
2323 .args_type = "",
7fad30f0 2324 .mhandler.cmd_new = qmp_marshal_query_version,
b9c15f16
LC
2325 },
2326
82a56f0d
LC
2327SQMP
2328query-commands
2329--------------
2330
2331List QMP available commands.
2332
2333Each command is represented by a json-object, the returned value is a json-array
2334of all commands.
2335
2336Each json-object contain:
2337
2338- "name": command's name (json-string)
2339
2340Example:
2341
2342-> { "execute": "query-commands" }
2343<- {
2344 "return":[
2345 {
2346 "name":"query-balloon"
2347 },
2348 {
2349 "name":"system_powerdown"
2350 }
2351 ]
2352 }
2353
2354Note: This example has been shortened as the real response is too long.
2355
2356EQMP
2357
aa9b79bc
LC
2358 {
2359 .name = "query-commands",
2360 .args_type = "",
7fad30f0 2361 .mhandler.cmd_new = qmp_marshal_query_commands,
aa9b79bc
LC
2362 },
2363
4860853d
DB
2364SQMP
2365query-events
2366--------------
2367
2368List QMP available events.
2369
2370Each event is represented by a json-object, the returned value is a json-array
2371of all events.
2372
2373Each json-object contains:
2374
2375- "name": event's name (json-string)
2376
2377Example:
2378
2379-> { "execute": "query-events" }
2380<- {
2381 "return":[
2382 {
2383 "name":"SHUTDOWN"
2384 },
2385 {
2386 "name":"RESET"
2387 }
2388 ]
2389 }
2390
2391Note: This example has been shortened as the real response is too long.
2392
2393EQMP
2394
2395 {
2396 .name = "query-events",
2397 .args_type = "",
7fad30f0 2398 .mhandler.cmd_new = qmp_marshal_query_events,
4860853d
DB
2399 },
2400
39a18158
MA
2401SQMP
2402query-qmp-schema
2403----------------
2404
2405Return the QMP wire schema. The returned value is a json-array of
2406named schema entities. Entities are commands, events and various
2407types. See docs/qapi-code-gen.txt for information on their structure
2408and intended use.
2409
2410EQMP
2411
2412 {
2413 .name = "query-qmp-schema",
2414 .args_type = "",
2415 .mhandler.cmd_new = qmp_query_qmp_schema,
2416 },
2417
82a56f0d
LC
2418SQMP
2419query-chardev
2420-------------
2421
2422Each device is represented by a json-object. The returned value is a json-array
2423of all devices.
2424
2425Each json-object contain the following:
2426
2427- "label": device's label (json-string)
2428- "filename": device's file (json-string)
32a97ea1
LE
2429- "frontend-open": open/closed state of the frontend device attached to this
2430 backend (json-bool)
82a56f0d
LC
2431
2432Example:
2433
2434-> { "execute": "query-chardev" }
2435<- {
32a97ea1
LE
2436 "return": [
2437 {
2438 "label": "charchannel0",
2439 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2440 "frontend-open": false
2441 },
82a56f0d 2442 {
32a97ea1
LE
2443 "label": "charmonitor",
2444 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2445 "frontend-open": true
82a56f0d
LC
2446 },
2447 {
32a97ea1
LE
2448 "label": "charserial0",
2449 "filename": "pty:/dev/pts/2",
2450 "frontend-open": true
82a56f0d
LC
2451 }
2452 ]
2453 }
2454
2455EQMP
2456
c5a415a0
LC
2457 {
2458 .name = "query-chardev",
2459 .args_type = "",
7fad30f0 2460 .mhandler.cmd_new = qmp_marshal_query_chardev,
c5a415a0
LC
2461 },
2462
77d1c3c6
MK
2463SQMP
2464query-chardev-backends
2465-------------
2466
2467List available character device backends.
2468
2469Each backend is represented by a json-object, the returned value is a json-array
2470of all backends.
2471
2472Each json-object contains:
2473
2474- "name": backend name (json-string)
2475
2476Example:
2477
2478-> { "execute": "query-chardev-backends" }
2479<- {
2480 "return":[
2481 {
2482 "name":"udp"
2483 },
2484 {
2485 "name":"tcp"
2486 },
2487 {
2488 "name":"unix"
2489 },
2490 {
2491 "name":"spiceport"
2492 }
2493 ]
2494 }
2495
2496EQMP
2497
2498 {
2499 .name = "query-chardev-backends",
2500 .args_type = "",
7fad30f0 2501 .mhandler.cmd_new = qmp_marshal_query_chardev_backends,
77d1c3c6
MK
2502 },
2503
82a56f0d
LC
2504SQMP
2505query-block
2506-----------
2507
2508Show the block devices.
2509
2510Each block device information is stored in a json-object and the returned value
2511is a json-array of all devices.
2512
2513Each json-object contain the following:
2514
2515- "device": device name (json-string)
2516- "type": device type (json-string)
d8aeeb31
MA
2517 - deprecated, retained for backward compatibility
2518 - Possible values: "unknown"
82a56f0d
LC
2519- "removable": true if the device is removable, false otherwise (json-bool)
2520- "locked": true if the device is locked, false otherwise (json-bool)
99f42808 2521- "tray_open": only present if removable, true if the device has a tray,
e4def80b 2522 and it is open (json-bool)
82a56f0d
LC
2523- "inserted": only present if the device is inserted, it is a json-object
2524 containing the following:
2525 - "file": device file name (json-string)
2526 - "ro": true if read-only, false otherwise (json-bool)
2527 - "drv": driver format name (json-string)
550830f9 2528 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
82a56f0d 2529 "file", "file", "ftp", "ftps", "host_cdrom",
92a539d2 2530 "host_device", "http", "https",
82a56f0d
LC
2531 "nbd", "parallels", "qcow", "qcow2", "raw",
2532 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2533 - "backing_file": backing file name (json-string, optional)
2e3e3317 2534 - "backing_file_depth": number of files in the backing file chain (json-int)
82a56f0d 2535 - "encrypted": true if encrypted, false otherwise (json-bool)
727f005e
ZYW
2536 - "bps": limit total bytes per second (json-int)
2537 - "bps_rd": limit read bytes per second (json-int)
2538 - "bps_wr": limit write bytes per second (json-int)
2539 - "iops": limit total I/O operations per second (json-int)
2540 - "iops_rd": limit read operations per second (json-int)
2541 - "iops_wr": limit write operations per second (json-int)
3e9fab69
BC
2542 - "bps_max": total max in bytes (json-int)
2543 - "bps_rd_max": read max in bytes (json-int)
2544 - "bps_wr_max": write max in bytes (json-int)
2545 - "iops_max": total I/O operations max (json-int)
2546 - "iops_rd_max": read I/O operations max (json-int)
2547 - "iops_wr_max": write I/O operations max (json-int)
2024c1df 2548 - "iops_size": I/O size when limiting by iops (json-int)
465bee1d
PL
2549 - "detect_zeroes": detect and optimize zero writing (json-string)
2550 - Possible values: "off", "on", "unmap"
e2462113
FR
2551 - "write_threshold": write offset threshold in bytes, a event will be
2552 emitted if crossed. Zero if disabled (json-int)
553a7e87
WX
2553 - "image": the detail of the image, it is a json-object containing
2554 the following:
2555 - "filename": image file name (json-string)
2556 - "format": image format (json-string)
2557 - "virtual-size": image capacity in bytes (json-int)
2558 - "dirty-flag": true if image is not cleanly closed, not present
2559 means clean (json-bool, optional)
2560 - "actual-size": actual size on disk in bytes of the image, not
2561 present when image does not support thin
2562 provision (json-int, optional)
2563 - "cluster-size": size of a cluster in bytes, not present if image
2564 format does not support it (json-int, optional)
2565 - "encrypted": true if the image is encrypted, not present means
2566 false or the image format does not support
2567 encryption (json-bool, optional)
2568 - "backing_file": backing file name, not present means no backing
2569 file is used or the image format does not
2570 support backing file chain
2571 (json-string, optional)
2572 - "full-backing-filename": full path of the backing file, not
2573 present if it equals backing_file or no
2574 backing file is used
2575 (json-string, optional)
2576 - "backing-filename-format": the format of the backing file, not
2577 present means unknown or no backing
2578 file (json-string, optional)
2579 - "snapshots": the internal snapshot info, it is an optional list
2580 of json-object containing the following:
2581 - "id": unique snapshot id (json-string)
2582 - "name": snapshot name (json-string)
2583 - "vm-state-size": size of the VM state in bytes (json-int)
2584 - "date-sec": UTC date of the snapshot in seconds (json-int)
2585 - "date-nsec": fractional part in nanoseconds to be used with
586b5466 2586 date-sec (json-int)
553a7e87
WX
2587 - "vm-clock-sec": VM clock relative to boot in seconds
2588 (json-int)
2589 - "vm-clock-nsec": fractional part in nanoseconds to be used
2590 with vm-clock-sec (json-int)
2591 - "backing-image": the detail of the backing image, it is an
2592 optional json-object only present when a
2593 backing image present for this image
727f005e 2594
f04ef601
LC
2595- "io-status": I/O operation status, only present if the device supports it
2596 and the VM is configured to stop on errors. It's always reset
2597 to "ok" when the "cont" command is issued (json_string, optional)
2598 - Possible values: "ok", "failed", "nospace"
82a56f0d
LC
2599
2600Example:
2601
2602-> { "execute": "query-block" }
2603<- {
2604 "return":[
2605 {
f04ef601 2606 "io-status": "ok",
82a56f0d
LC
2607 "device":"ide0-hd0",
2608 "locked":false,
2609 "removable":false,
2610 "inserted":{
2611 "ro":false,
2612 "drv":"qcow2",
2613 "encrypted":false,
553a7e87
WX
2614 "file":"disks/test.qcow2",
2615 "backing_file_depth":1,
727f005e
ZYW
2616 "bps":1000000,
2617 "bps_rd":0,
2618 "bps_wr":0,
2619 "iops":1000000,
2620 "iops_rd":0,
2621 "iops_wr":0,
3e9fab69
BC
2622 "bps_max": 8000000,
2623 "bps_rd_max": 0,
2624 "bps_wr_max": 0,
2625 "iops_max": 0,
2626 "iops_rd_max": 0,
2627 "iops_wr_max": 0,
2024c1df 2628 "iops_size": 0,
465bee1d 2629 "detect_zeroes": "on",
e2462113 2630 "write_threshold": 0,
553a7e87
WX
2631 "image":{
2632 "filename":"disks/test.qcow2",
2633 "format":"qcow2",
2634 "virtual-size":2048000,
2635 "backing_file":"base.qcow2",
2636 "full-backing-filename":"disks/base.qcow2",
5403432f 2637 "backing-filename-format":"qcow2",
553a7e87
WX
2638 "snapshots":[
2639 {
2640 "id": "1",
2641 "name": "snapshot1",
2642 "vm-state-size": 0,
2643 "date-sec": 10000200,
2644 "date-nsec": 12,
2645 "vm-clock-sec": 206,
2646 "vm-clock-nsec": 30
2647 }
2648 ],
2649 "backing-image":{
2650 "filename":"disks/base.qcow2",
2651 "format":"qcow2",
2652 "virtual-size":2048000
2653 }
2654 }
82a56f0d 2655 },
d8aeeb31 2656 "type":"unknown"
82a56f0d
LC
2657 },
2658 {
f04ef601 2659 "io-status": "ok",
82a56f0d
LC
2660 "device":"ide1-cd0",
2661 "locked":false,
2662 "removable":true,
d8aeeb31 2663 "type":"unknown"
82a56f0d
LC
2664 },
2665 {
2666 "device":"floppy0",
2667 "locked":false,
2668 "removable":true,
d8aeeb31 2669 "type":"unknown"
82a56f0d
LC
2670 },
2671 {
2672 "device":"sd0",
2673 "locked":false,
2674 "removable":true,
d8aeeb31 2675 "type":"unknown"
82a56f0d
LC
2676 }
2677 ]
2678 }
2679
2680EQMP
2681
b2023818
LC
2682 {
2683 .name = "query-block",
2684 .args_type = "",
7fad30f0 2685 .mhandler.cmd_new = qmp_marshal_query_block,
b2023818
LC
2686 },
2687
82a56f0d
LC
2688SQMP
2689query-blockstats
2690----------------
2691
2692Show block device statistics.
2693
2694Each device statistic information is stored in a json-object and the returned
2695value is a json-array of all devices.
2696
2697Each json-object contain the following:
2698
2699- "device": device name (json-string)
2700- "stats": A json-object with the statistics information, it contains:
2701 - "rd_bytes": bytes read (json-int)
2702 - "wr_bytes": bytes written (json-int)
2703 - "rd_operations": read operations (json-int)
2704 - "wr_operations": write operations (json-int)
e8045d67 2705 - "flush_operations": cache flush operations (json-int)
c488c7f6
CH
2706 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2707 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2708 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
53d8f9d8
HR
2709 - "wr_highest_offset": The offset after the greatest byte written to the
2710 BlockDriverState since it has been opened (json-int)
f4564d53
PL
2711 - "rd_merged": number of read requests that have been merged into
2712 another request (json-int)
2713 - "wr_merged": number of write requests that have been merged into
2714 another request (json-int)
cb38fffb
AG
2715 - "idle_time_ns": time since the last I/O operation, in
2716 nanoseconds. If the field is absent it means
2717 that there haven't been any operations yet
2718 (json-int, optional)
7ee12daf
AG
2719 - "failed_rd_operations": number of failed read operations
2720 (json-int)
2721 - "failed_wr_operations": number of failed write operations
2722 (json-int)
2723 - "failed_flush_operations": number of failed flush operations
2724 (json-int)
2725 - "invalid_rd_operations": number of invalid read operations
2726 (json-int)
2727 - "invalid_wr_operations": number of invalid write operations
2728 (json-int)
2729 - "invalid_flush_operations": number of invalid flush operations
2730 (json-int)
362e9299
AG
2731 - "account_invalid": whether invalid operations are included in
2732 the last access statistics (json-bool)
2733 - "account_failed": whether failed operations are included in the
2734 latency and last access statistics
2735 (json-bool)
979e9b03
AG
2736 - "timed_stats": A json-array containing statistics collected in
2737 specific intervals, with the following members:
2738 - "interval_length": interval used for calculating the
2739 statistics, in seconds (json-int)
2740 - "min_rd_latency_ns": minimum latency of read operations in
2741 the defined interval, in nanoseconds
2742 (json-int)
2743 - "min_wr_latency_ns": minimum latency of write operations in
2744 the defined interval, in nanoseconds
2745 (json-int)
2746 - "min_flush_latency_ns": minimum latency of flush operations
2747 in the defined interval, in
2748 nanoseconds (json-int)
2749 - "max_rd_latency_ns": maximum latency of read operations in
2750 the defined interval, in nanoseconds
2751 (json-int)
2752 - "max_wr_latency_ns": maximum latency of write operations in
2753 the defined interval, in nanoseconds
2754 (json-int)
2755 - "max_flush_latency_ns": maximum latency of flush operations
2756 in the defined interval, in
2757 nanoseconds (json-int)
2758 - "avg_rd_latency_ns": average latency of read operations in
2759 the defined interval, in nanoseconds
2760 (json-int)
2761 - "avg_wr_latency_ns": average latency of write operations in
2762 the defined interval, in nanoseconds
2763 (json-int)
2764 - "avg_flush_latency_ns": average latency of flush operations
2765 in the defined interval, in
2766 nanoseconds (json-int)
96e4deda
AG
2767 - "avg_rd_queue_depth": average number of pending read
2768 operations in the defined interval
2769 (json-number)
2770 - "avg_wr_queue_depth": average number of pending write
2771 operations in the defined interval
2772 (json-number).
82a56f0d
LC
2773- "parent": Contains recursively the statistics of the underlying
2774 protocol (e.g. the host file for a qcow2 image). If there is
2775 no underlying protocol, this field is omitted
2776 (json-object, optional)
2777
2778Example:
2779
2780-> { "execute": "query-blockstats" }
2781<- {
2782 "return":[
2783 {
2784 "device":"ide0-hd0",
2785 "parent":{
2786 "stats":{
2787 "wr_highest_offset":3686448128,
2788 "wr_bytes":9786368,
2789 "wr_operations":751,
2790 "rd_bytes":122567168,
2791 "rd_operations":36772
c488c7f6
CH
2792 "wr_total_times_ns":313253456
2793 "rd_total_times_ns":3465673657
2794 "flush_total_times_ns":49653
e8045d67 2795 "flush_operations":61,
f4564d53 2796 "rd_merged":0,
cb38fffb 2797 "wr_merged":0,
362e9299
AG
2798 "idle_time_ns":2953431879,
2799 "account_invalid":true,
2800 "account_failed":false
82a56f0d
LC
2801 }
2802 },
2803 "stats":{
2804 "wr_highest_offset":2821110784,
2805 "wr_bytes":9786368,
2806 "wr_operations":692,
2807 "rd_bytes":122739200,
2808 "rd_operations":36604
e8045d67 2809 "flush_operations":51,
c488c7f6
CH
2810 "wr_total_times_ns":313253456
2811 "rd_total_times_ns":3465673657
f4564d53
PL
2812 "flush_total_times_ns":49653,
2813 "rd_merged":0,
cb38fffb 2814 "wr_merged":0,
362e9299
AG
2815 "idle_time_ns":2953431879,
2816 "account_invalid":true,
2817 "account_failed":false
82a56f0d
LC
2818 }
2819 },
2820 {
2821 "device":"ide1-cd0",
2822 "stats":{
2823 "wr_highest_offset":0,
2824 "wr_bytes":0,
2825 "wr_operations":0,
2826 "rd_bytes":0,
2827 "rd_operations":0
e8045d67 2828 "flush_operations":0,
c488c7f6
CH
2829 "wr_total_times_ns":0
2830 "rd_total_times_ns":0
f4564d53
PL
2831 "flush_total_times_ns":0,
2832 "rd_merged":0,
362e9299
AG
2833 "wr_merged":0,
2834 "account_invalid":false,
2835 "account_failed":false
82a56f0d
LC
2836 }
2837 },
2838 {
2839 "device":"floppy0",
2840 "stats":{
2841 "wr_highest_offset":0,
2842 "wr_bytes":0,
2843 "wr_operations":0,
2844 "rd_bytes":0,
2845 "rd_operations":0
e8045d67 2846 "flush_operations":0,
c488c7f6
CH
2847 "wr_total_times_ns":0
2848 "rd_total_times_ns":0
f4564d53
PL
2849 "flush_total_times_ns":0,
2850 "rd_merged":0,
362e9299
AG
2851 "wr_merged":0,
2852 "account_invalid":false,
2853 "account_failed":false
82a56f0d
LC
2854 }
2855 },
2856 {
2857 "device":"sd0",
2858 "stats":{
2859 "wr_highest_offset":0,
2860 "wr_bytes":0,
2861 "wr_operations":0,
2862 "rd_bytes":0,
2863 "rd_operations":0
e8045d67 2864 "flush_operations":0,
c488c7f6
CH
2865 "wr_total_times_ns":0
2866 "rd_total_times_ns":0
f4564d53
PL
2867 "flush_total_times_ns":0,
2868 "rd_merged":0,
362e9299
AG
2869 "wr_merged":0,
2870 "account_invalid":false,
2871 "account_failed":false
82a56f0d
LC
2872 }
2873 }
2874 ]
2875 }
2876
2877EQMP
2878
f11f57e4
LC
2879 {
2880 .name = "query-blockstats",
f71eaa74 2881 .args_type = "query-nodes:b?",
7fad30f0 2882 .mhandler.cmd_new = qmp_marshal_query_blockstats,
f11f57e4
LC
2883 },
2884
82a56f0d
LC
2885SQMP
2886query-cpus
2887----------
2888
2889Show CPU information.
2890
2891Return a json-array. Each CPU is represented by a json-object, which contains:
2892
2893- "CPU": CPU index (json-int)
2894- "current": true if this is the current CPU, false otherwise (json-bool)
2895- "halted": true if the cpu is halted, false otherwise (json-bool)
58f88d4b 2896- "qom_path": path to the CPU object in the QOM tree (json-str)
86f4b687
EB
2897- "arch": architecture of the cpu, which determines what additional
2898 keys will be present (json-str)
82a56f0d
LC
2899- Current program counter. The key's name depends on the architecture:
2900 "pc": i386/x86_64 (json-int)
2901 "nip": PPC (json-int)
2902 "pc" and "npc": sparc (json-int)
2903 "PC": mips (json-int)
dc7a09cf 2904- "thread_id": ID of the underlying host thread (json-int)
82a56f0d
LC
2905
2906Example:
2907
2908-> { "execute": "query-cpus" }
2909<- {
2910 "return":[
2911 {
2912 "CPU":0,
2913 "current":true,
2914 "halted":false,
58f88d4b 2915 "qom_path":"/machine/unattached/device[0]",
86f4b687 2916 "arch":"x86",
58f88d4b 2917 "pc":3227107138,
dc7a09cf 2918 "thread_id":3134
82a56f0d
LC
2919 },
2920 {
2921 "CPU":1,
2922 "current":false,
2923 "halted":true,
58f88d4b 2924 "qom_path":"/machine/unattached/device[2]",
86f4b687 2925 "arch":"x86",
58f88d4b 2926 "pc":7108165,
dc7a09cf 2927 "thread_id":3135
82a56f0d
LC
2928 }
2929 ]
2930 }
2931
2932EQMP
2933
de0b36b6
LC
2934 {
2935 .name = "query-cpus",
2936 .args_type = "",
7fad30f0 2937 .mhandler.cmd_new = qmp_marshal_query_cpus,
de0b36b6
LC
2938 },
2939
dc3dd0d2
SH
2940SQMP
2941query-iothreads
2942---------------
2943
2944Returns a list of information about each iothread.
2945
2946Note this list excludes the QEMU main loop thread, which is not declared
2947using the -object iothread command-line option. It is always the main thread
2948of the process.
2949
2950Return a json-array. Each iothread is represented by a json-object, which contains:
2951
2952- "id": name of iothread (json-str)
2953- "thread-id": ID of the underlying host thread (json-int)
2954
2955Example:
2956
2957-> { "execute": "query-iothreads" }
2958<- {
2959 "return":[
2960 {
2961 "id":"iothread0",
2962 "thread-id":3134
2963 },
2964 {
2965 "id":"iothread1",
2966 "thread-id":3135
2967 }
2968 ]
2969 }
2970
2971EQMP
2972
2973 {
2974 .name = "query-iothreads",
2975 .args_type = "",
7fad30f0 2976 .mhandler.cmd_new = qmp_marshal_query_iothreads,
dc3dd0d2
SH
2977 },
2978
82a56f0d
LC
2979SQMP
2980query-pci
2981---------
2982
2983PCI buses and devices information.
2984
2985The returned value is a json-array of all buses. Each bus is represented by
2986a json-object, which has a key with a json-array of all PCI devices attached
2987to it. Each device is represented by a json-object.
2988
2989The bus json-object contains the following:
2990
2991- "bus": bus number (json-int)
2992- "devices": a json-array of json-objects, each json-object represents a
2993 PCI device
2994
2995The PCI device json-object contains the following:
2996
2997- "bus": identical to the parent's bus number (json-int)
2998- "slot": slot number (json-int)
2999- "function": function number (json-int)
3000- "class_info": a json-object containing:
3001 - "desc": device class description (json-string, optional)
3002 - "class": device class number (json-int)
3003- "id": a json-object containing:
3004 - "device": device ID (json-int)
3005 - "vendor": vendor ID (json-int)
3006- "irq": device's IRQ if assigned (json-int, optional)
3007- "qdev_id": qdev id string (json-string)
3008- "pci_bridge": It's a json-object, only present if this device is a
3009 PCI bridge, contains:
3010 - "bus": bus number (json-int)
3011 - "secondary": secondary bus number (json-int)
3012 - "subordinate": subordinate bus number (json-int)
3013 - "io_range": I/O memory range information, a json-object with the
3014 following members:
3015 - "base": base address, in bytes (json-int)
3016 - "limit": limit address, in bytes (json-int)
3017 - "memory_range": memory range information, a json-object with the
3018 following members:
3019 - "base": base address, in bytes (json-int)
3020 - "limit": limit address, in bytes (json-int)
3021 - "prefetchable_range": Prefetchable memory range information, a
3022 json-object with the following members:
3023 - "base": base address, in bytes (json-int)
3024 - "limit": limit address, in bytes (json-int)
3025 - "devices": a json-array of PCI devices if there's any attached, each
3026 each element is represented by a json-object, which contains
3027 the same members of the 'PCI device json-object' described
3028 above (optional)
3029- "regions": a json-array of json-objects, each json-object represents a
3030 memory region of this device
3031
3032The memory range json-object contains the following:
3033
3034- "base": base memory address (json-int)
3035- "limit": limit value (json-int)
3036
3037The region json-object can be an I/O region or a memory region, an I/O region
3038json-object contains the following:
3039
3040- "type": "io" (json-string, fixed)
3041- "bar": BAR number (json-int)
3042- "address": memory address (json-int)
3043- "size": memory size (json-int)
3044
3045A memory region json-object contains the following:
3046
3047- "type": "memory" (json-string, fixed)
3048- "bar": BAR number (json-int)
3049- "address": memory address (json-int)
3050- "size": memory size (json-int)
3051- "mem_type_64": true or false (json-bool)
3052- "prefetch": true or false (json-bool)
3053
3054Example:
3055
3056-> { "execute": "query-pci" }
3057<- {
3058 "return":[
3059 {
3060 "bus":0,
3061 "devices":[
3062 {
3063 "bus":0,
3064 "qdev_id":"",
3065 "slot":0,
3066 "class_info":{
3067 "class":1536,
3068 "desc":"Host bridge"
3069 },
3070 "id":{
3071 "device":32902,
3072 "vendor":4663
3073 },
3074 "function":0,
3075 "regions":[
3076
3077 ]
3078 },
3079 {
3080 "bus":0,
3081 "qdev_id":"",
3082 "slot":1,
3083 "class_info":{
3084 "class":1537,
3085 "desc":"ISA bridge"
3086 },
3087 "id":{
3088 "device":32902,
3089 "vendor":28672
3090 },
3091 "function":0,
3092 "regions":[
3093
3094 ]
3095 },
3096 {
3097 "bus":0,
3098 "qdev_id":"",
3099 "slot":1,
3100 "class_info":{
3101 "class":257,
3102 "desc":"IDE controller"
3103 },
3104 "id":{
3105 "device":32902,
3106 "vendor":28688
3107 },
3108 "function":1,
3109 "regions":[
3110 {
3111 "bar":4,
3112 "size":16,
3113 "address":49152,
3114 "type":"io"
3115 }
3116 ]
3117 },
3118 {
3119 "bus":0,
3120 "qdev_id":"",
3121 "slot":2,
3122 "class_info":{
3123 "class":768,
3124 "desc":"VGA controller"
3125 },
3126 "id":{
3127 "device":4115,
3128 "vendor":184
3129 },
3130 "function":0,
3131 "regions":[
3132 {
3133 "prefetch":true,
3134 "mem_type_64":false,
3135 "bar":0,
3136 "size":33554432,
3137 "address":4026531840,
3138 "type":"memory"
3139 },
3140 {
3141 "prefetch":false,
3142 "mem_type_64":false,
3143 "bar":1,
3144 "size":4096,
3145 "address":4060086272,
3146 "type":"memory"
3147 },
3148 {
3149 "prefetch":false,
3150 "mem_type_64":false,
3151 "bar":6,
3152 "size":65536,
3153 "address":-1,
3154 "type":"memory"
3155 }
3156 ]
3157 },
3158 {
3159 "bus":0,
3160 "qdev_id":"",
3161 "irq":11,
3162 "slot":4,
3163 "class_info":{
3164 "class":1280,
3165 "desc":"RAM controller"
3166 },
3167 "id":{
3168 "device":6900,
3169 "vendor":4098
3170 },
3171 "function":0,
3172 "regions":[
3173 {
3174 "bar":0,
3175 "size":32,
3176 "address":49280,
3177 "type":"io"
3178 }
3179 ]
3180 }
3181 ]
3182 }
3183 ]
3184 }
3185
3186Note: This example has been shortened as the real response is too long.
3187
3188EQMP
3189
79627472
LC
3190 {
3191 .name = "query-pci",
3192 .args_type = "",
7fad30f0 3193 .mhandler.cmd_new = qmp_marshal_query_pci,
79627472
LC
3194 },
3195
82a56f0d
LC
3196SQMP
3197query-kvm
3198---------
3199
3200Show KVM information.
3201
3202Return a json-object with the following information:
3203
3204- "enabled": true if KVM support is enabled, false otherwise (json-bool)
3205- "present": true if QEMU has KVM support, false otherwise (json-bool)
3206
3207Example:
3208
3209-> { "execute": "query-kvm" }
3210<- { "return": { "enabled": true, "present": true } }
3211
3212EQMP
3213
292a2602
LC
3214 {
3215 .name = "query-kvm",
3216 .args_type = "",
7fad30f0 3217 .mhandler.cmd_new = qmp_marshal_query_kvm,
292a2602
LC
3218 },
3219
82a56f0d
LC
3220SQMP
3221query-status
3222------------
3223
3224Return a json-object with the following information:
3225
3226- "running": true if the VM is running, or false if it is paused (json-bool)
3227- "singlestep": true if the VM is in single step mode,
3228 false otherwise (json-bool)
9e37b9dc
LC
3229- "status": one of the following values (json-string)
3230 "debug" - QEMU is running on a debugger
3231 "inmigrate" - guest is paused waiting for an incoming migration
3232 "internal-error" - An internal error that prevents further guest
3233 execution has occurred
3234 "io-error" - the last IOP has failed and the device is configured
3235 to pause on I/O errors
3236 "paused" - guest has been paused via the 'stop' command
3237 "postmigrate" - guest is paused following a successful 'migrate'
3238 "prelaunch" - QEMU was started with -S and guest has not started
3239 "finish-migrate" - guest is paused to finish the migration process
3240 "restore-vm" - guest is paused to restore VM state
3241 "running" - guest is actively running
3242 "save-vm" - guest is paused to save the VM state
3243 "shutdown" - guest is shut down (and -no-shutdown is in use)
3244 "watchdog" - the watchdog action is configured to pause and
3245 has been triggered
82a56f0d
LC
3246
3247Example:
3248
3249-> { "execute": "query-status" }
9e37b9dc 3250<- { "return": { "running": true, "singlestep": false, "status": "running" } }
82a56f0d
LC
3251
3252EQMP
1fa9a5e4
LC
3253
3254 {
3255 .name = "query-status",
3256 .args_type = "",
7fad30f0 3257 .mhandler.cmd_new = qmp_marshal_query_status,
1fa9a5e4 3258 },
82a56f0d
LC
3259
3260SQMP
3261query-mice
3262----------
3263
3264Show VM mice information.
3265
3266Each mouse is represented by a json-object, the returned value is a json-array
3267of all mice.
3268
3269The mouse json-object contains the following:
3270
3271- "name": mouse's name (json-string)
3272- "index": mouse's index (json-int)
3273- "current": true if this mouse is receiving events, false otherwise (json-bool)
3274- "absolute": true if the mouse generates absolute input events (json-bool)
3275
3276Example:
3277
3278-> { "execute": "query-mice" }
3279<- {
3280 "return":[
3281 {
3282 "name":"QEMU Microsoft Mouse",
3283 "index":0,
3284 "current":false,
3285 "absolute":false
3286 },
3287 {
3288 "name":"QEMU PS/2 Mouse",
3289 "index":1,
3290 "current":true,
3291 "absolute":true
3292 }
3293 ]
3294 }
3295
3296EQMP
3297
e235cec3
LC
3298 {
3299 .name = "query-mice",
3300 .args_type = "",
7fad30f0 3301 .mhandler.cmd_new = qmp_marshal_query_mice,
e235cec3
LC
3302 },
3303
82a56f0d
LC
3304SQMP
3305query-vnc
3306---------
3307
3308Show VNC server information.
3309
3310Return a json-object with server information. Connected clients are returned
3311as a json-array of json-objects.
3312
3313The main json-object contains the following:
3314
3315- "enabled": true or false (json-bool)
3316- "host": server's IP address (json-string)
3317- "family": address family (json-string)
3318 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3319- "service": server's port number (json-string)
3320- "auth": authentication method (json-string)
3321 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3322 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3323 "vencrypt+plain", "vencrypt+tls+none",
3324 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3325 "vencrypt+tls+vnc", "vencrypt+x509+none",
3326 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3327 "vencrypt+x509+vnc", "vnc"
3328- "clients": a json-array of all connected clients
3329
3330Clients are described by a json-object, each one contain the following:
3331
3332- "host": client's IP address (json-string)
3333- "family": address family (json-string)
3334 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3335- "service": client's port number (json-string)
3336- "x509_dname": TLS dname (json-string, optional)
3337- "sasl_username": SASL username (json-string, optional)
3338
3339Example:
3340
3341-> { "execute": "query-vnc" }
3342<- {
3343 "return":{
3344 "enabled":true,
3345 "host":"0.0.0.0",
3346 "service":"50402",
3347 "auth":"vnc",
3348 "family":"ipv4",
3349 "clients":[
3350 {
3351 "host":"127.0.0.1",
3352 "service":"50401",
3353 "family":"ipv4"
3354 }
3355 ]
3356 }
3357 }
3358
3359EQMP
3360
2b54aa87
LC
3361 {
3362 .name = "query-vnc",
3363 .args_type = "",
7fad30f0 3364 .mhandler.cmd_new = qmp_marshal_query_vnc,
2b54aa87 3365 },
df887684
GH
3366 {
3367 .name = "query-vnc-servers",
3368 .args_type = "",
7fad30f0 3369 .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
df887684 3370 },
2b54aa87 3371
cb42a870
GH
3372SQMP
3373query-spice
3374-----------
3375
3376Show SPICE server information.
3377
3378Return a json-object with server information. Connected clients are returned
3379as a json-array of json-objects.
3380
3381The main json-object contains the following:
3382
3383- "enabled": true or false (json-bool)
3384- "host": server's IP address (json-string)
3385- "port": server's port number (json-int, optional)
3386- "tls-port": server's port number (json-int, optional)
3387- "auth": authentication method (json-string)
3388 - Possible values: "none", "spice"
3389- "channels": a json-array of all active channels clients
3390
3391Channels are described by a json-object, each one contain the following:
3392
3393- "host": client's IP address (json-string)
3394- "family": address family (json-string)
3395 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3396- "port": client's port number (json-string)
3397- "connection-id": spice connection id. All channels with the same id
3398 belong to the same spice session (json-int)
3399- "channel-type": channel type. "1" is the main control channel, filter for
3400 this one if you want track spice sessions only (json-int)
3401- "channel-id": channel id. Usually "0", might be different needed when
3402 multiple channels of the same type exist, such as multiple
3403 display channels in a multihead setup (json-int)
3599d46b 3404- "tls": whether the channel is encrypted (json-bool)
cb42a870
GH
3405
3406Example:
3407
3408-> { "execute": "query-spice" }
3409<- {
3410 "return": {
3411 "enabled": true,
3412 "auth": "spice",
3413 "port": 5920,
3414 "tls-port": 5921,
3415 "host": "0.0.0.0",
3416 "channels": [
3417 {
3418 "port": "54924",
3419 "family": "ipv4",
3420 "channel-type": 1,
3421 "connection-id": 1804289383,
3422 "host": "127.0.0.1",
3423 "channel-id": 0,
3424 "tls": true
3425 },
3426 {
3427 "port": "36710",
3428 "family": "ipv4",
3429 "channel-type": 4,
3430 "connection-id": 1804289383,
3431 "host": "127.0.0.1",
3432 "channel-id": 0,
3433 "tls": false
3434 },
3435 [ ... more channels follow ... ]
3436 ]
3437 }
3438 }
3439
3440EQMP
3441
d1f29646
LC
3442#if defined(CONFIG_SPICE)
3443 {
3444 .name = "query-spice",
3445 .args_type = "",
7fad30f0 3446 .mhandler.cmd_new = qmp_marshal_query_spice,
d1f29646
LC
3447 },
3448#endif
3449
82a56f0d
LC
3450SQMP
3451query-name
3452----------
3453
3454Show VM name.
3455
3456Return a json-object with the following information:
3457
3458- "name": VM's name (json-string, optional)
3459
3460Example:
3461
3462-> { "execute": "query-name" }
3463<- { "return": { "name": "qemu-name" } }
3464
3465EQMP
3466
48a32bed
AL
3467 {
3468 .name = "query-name",
3469 .args_type = "",
7fad30f0 3470 .mhandler.cmd_new = qmp_marshal_query_name,
48a32bed
AL
3471 },
3472
82a56f0d
LC
3473SQMP
3474query-uuid
3475----------
3476
3477Show VM UUID.
3478
3479Return a json-object with the following information:
3480
3481- "UUID": Universally Unique Identifier (json-string)
3482
3483Example:
3484
3485-> { "execute": "query-uuid" }
3486<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3487
3488EQMP
3489
efab767e
LC
3490 {
3491 .name = "query-uuid",
3492 .args_type = "",
7fad30f0 3493 .mhandler.cmd_new = qmp_marshal_query_uuid,
efab767e
LC
3494 },
3495
1f8f987d
AK
3496SQMP
3497query-command-line-options
3498--------------------------
3499
3500Show command line option schema.
3501
3502Return a json-array of command line option schema for all options (or for
3503the given option), returning an error if the given option doesn't exist.
3504
3505Each array entry contains the following:
3506
3507- "option": option name (json-string)
3508- "parameters": a json-array describes all parameters of the option:
3509 - "name": parameter name (json-string)
3510 - "type": parameter type (one of 'string', 'boolean', 'number',
3511 or 'size')
3512 - "help": human readable description of the parameter
3513 (json-string, optional)
e36af94f
CL
3514 - "default": default value string for the parameter
3515 (json-string, optional)
1f8f987d
AK
3516
3517Example:
3518
3519-> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3520<- { "return": [
3521 {
3522 "parameters": [
3523 {
3524 "name": "romfile",
3525 "type": "string"
3526 },
3527 {
3528 "name": "bootindex",
3529 "type": "number"
3530 }
3531 ],
3532 "option": "option-rom"
3533 }
3534 ]
3535 }
3536
3537EQMP
3538
3539 {
3540 .name = "query-command-line-options",
3541 .args_type = "option:s?",
7fad30f0 3542 .mhandler.cmd_new = qmp_marshal_query_command_line_options,
1f8f987d
AK
3543 },
3544
82a56f0d
LC
3545SQMP
3546query-migrate
3547-------------
3548
3549Migration status.
3550
3551Return a json-object. If migration is active there will be another json-object
3552with RAM migration status and if block migration is active another one with
3553block migration status.
3554
3555The main json-object contains the following:
3556
3557- "status": migration status (json-string)
3b695950 3558 - Possible values: "setup", "active", "completed", "failed", "cancelled"
7aa939af
JQ
3559- "total-time": total amount of ms since migration started. If
3560 migration has ended, it returns the total migration
817c6045 3561 time (json-int)
8f3067bd
MH
3562- "setup-time" amount of setup time in milliseconds _before_ the
3563 iterations begin but _after_ the QMP command is issued.
3564 This is designed to provide an accounting of any activities
3565 (such as RDMA pinning) which may be expensive, but do not
3566 actually occur during the iterative migration rounds
3567 themselves. (json-int)
9c5a9fcf
JQ
3568- "downtime": only present when migration has finished correctly
3569 total amount in ms for downtime that happened (json-int)
2c52ddf1
JQ
3570- "expected-downtime": only present while migration is active
3571 total amount in ms for downtime that was calculated on
817c6045 3572 the last bitmap round (json-int)
82a56f0d 3573- "ram": only present if "status" is "active", it is a json-object with the
817c6045
JQ
3574 following RAM information:
3575 - "transferred": amount transferred in bytes (json-int)
3576 - "remaining": amount remaining to transfer in bytes (json-int)
3577 - "total": total amount of memory in bytes (json-int)
3578 - "duplicate": number of pages filled entirely with the same
3579 byte (json-int)
3580 These are sent over the wire much more efficiently.
f1c72795 3581 - "skipped": number of skipped zero pages (json-int)
805a2505 3582 - "normal" : number of whole pages transferred. I.e. they
817c6045
JQ
3583 were not sent as duplicate or xbzrle pages (json-int)
3584 - "normal-bytes" : number of bytes transferred in whole
3585 pages. This is just normal pages times size of one page,
3586 but this way upper levels don't need to care about page
3587 size (json-int)
58570ed8 3588 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
82a56f0d 3589- "disk": only present if "status" is "active" and it is a block migration,
817c6045
JQ
3590 it is a json-object with the following disk information:
3591 - "transferred": amount transferred in bytes (json-int)
3592 - "remaining": amount remaining to transfer in bytes json-int)
3593 - "total": total disk size in bytes (json-int)
f36d55af
OW
3594- "xbzrle-cache": only present if XBZRLE is active.
3595 It is a json-object with the following XBZRLE information:
817c6045
JQ
3596 - "cache-size": XBZRLE cache size in bytes
3597 - "bytes": number of bytes transferred for XBZRLE compressed pages
f36d55af 3598 - "pages": number of XBZRLE compressed pages
817c6045 3599 - "cache-miss": number of XBRZRLE page cache misses
8bc39233 3600 - "cache-miss-rate": rate of XBRZRLE page cache misses
817c6045
JQ
3601 - "overflow": number of times XBZRLE overflows. This means
3602 that the XBZRLE encoding was bigger than just sent the
3603 whole page, and then we sent the whole page instead (as as
3604 normal page).
3605
82a56f0d
LC
3606Examples:
3607
36081. Before the first migration
3609
3610-> { "execute": "query-migrate" }
3611<- { "return": {} }
3612
36132. Migration is done and has succeeded
3614
3615-> { "execute": "query-migrate" }
004d4c10
OW
3616<- { "return": {
3617 "status": "completed",
3618 "ram":{
3619 "transferred":123,
3620 "remaining":123,
3621 "total":246,
3622 "total-time":12345,
8f3067bd 3623 "setup-time":12345,
9c5a9fcf 3624 "downtime":12345,
004d4c10
OW
3625 "duplicate":123,
3626 "normal":123,
58570ed8
C
3627 "normal-bytes":123456,
3628 "dirty-sync-count":15
004d4c10
OW
3629 }
3630 }
3631 }
82a56f0d
LC
3632
36333. Migration is done and has failed
3634
3635-> { "execute": "query-migrate" }
3636<- { "return": { "status": "failed" } }
3637
36384. Migration is being performed and is not a block migration:
3639
3640-> { "execute": "query-migrate" }
3641<- {
3642 "return":{
3643 "status":"active",
3644 "ram":{
3645 "transferred":123,
3646 "remaining":123,
62d4e3fe 3647 "total":246,
004d4c10 3648 "total-time":12345,
8f3067bd 3649 "setup-time":12345,
2c52ddf1 3650 "expected-downtime":12345,
004d4c10
OW
3651 "duplicate":123,
3652 "normal":123,
58570ed8
C
3653 "normal-bytes":123456,
3654 "dirty-sync-count":15
82a56f0d
LC
3655 }
3656 }
3657 }
3658
36595. Migration is being performed and is a block migration:
3660
3661-> { "execute": "query-migrate" }
3662<- {
3663 "return":{
3664 "status":"active",
3665 "ram":{
3666 "total":1057024,
3667 "remaining":1053304,
62d4e3fe 3668 "transferred":3720,
004d4c10 3669 "total-time":12345,
8f3067bd 3670 "setup-time":12345,
2c52ddf1 3671 "expected-downtime":12345,
004d4c10
OW
3672 "duplicate":123,
3673 "normal":123,
58570ed8
C
3674 "normal-bytes":123456,
3675 "dirty-sync-count":15
82a56f0d
LC
3676 },
3677 "disk":{
3678 "total":20971520,
3679 "remaining":20880384,
3680 "transferred":91136
3681 }
3682 }
3683 }
3684
f36d55af
OW
36856. Migration is being performed and XBZRLE is active:
3686
3687-> { "execute": "query-migrate" }
3688<- {
3689 "return":{
3690 "status":"active",
3691 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3692 "ram":{
3693 "total":1057024,
3694 "remaining":1053304,
3695 "transferred":3720,
3696 "total-time":12345,
8f3067bd 3697 "setup-time":12345,
2c52ddf1 3698 "expected-downtime":12345,
f36d55af
OW
3699 "duplicate":10,
3700 "normal":3333,
58570ed8
C
3701 "normal-bytes":3412992,
3702 "dirty-sync-count":15
f36d55af
OW
3703 },
3704 "xbzrle-cache":{
3705 "cache-size":67108864,
3706 "bytes":20971520,
3707 "pages":2444343,
3708 "cache-miss":2244,
8bc39233 3709 "cache-miss-rate":0.123,
f36d55af
OW
3710 "overflow":34434
3711 }
3712 }
3713 }
3714
82a56f0d
LC
3715EQMP
3716
791e7c82
LC
3717 {
3718 .name = "query-migrate",
3719 .args_type = "",
7fad30f0 3720 .mhandler.cmd_new = qmp_marshal_query_migrate,
791e7c82
LC
3721 },
3722
bbf6da32 3723SQMP
00458433 3724migrate-set-capabilities
817c6045 3725------------------------
00458433
OW
3726
3727Enable/Disable migration capabilities
3728
817c6045 3729- "xbzrle": XBZRLE support
d6d69731
HZ
3730- "rdma-pin-all": pin all pages when using RDMA during migration
3731- "auto-converge": throttle down guest to help convergence of migration
3732- "zero-blocks": compress zero blocks during block migration
164f59e8 3733- "compress": use multiple compression threads to accelerate live migration
72e72e1a 3734- "events": generate events for each migration state change
32c3db5b 3735- "postcopy-ram": postcopy mode for live migration
00458433
OW
3736
3737Arguments:
3738
3739Example:
3740
3741-> { "execute": "migrate-set-capabilities" , "arguments":
3742 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3743
3744EQMP
3745
3746 {
3747 .name = "migrate-set-capabilities",
43d0a2c1 3748 .args_type = "capabilities:q",
00458433 3749 .params = "capability:s,state:b",
7fad30f0 3750 .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
00458433
OW
3751 },
3752SQMP
bbf6da32 3753query-migrate-capabilities
817c6045 3754--------------------------
bbf6da32
OW
3755
3756Query current migration capabilities
3757
3758- "capabilities": migration capabilities state
3759 - "xbzrle" : XBZRLE state (json-bool)
d6d69731
HZ
3760 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3761 - "auto-converge" : Auto Converge state (json-bool)
3762 - "zero-blocks" : Zero Blocks state (json-bool)
164f59e8
HZ
3763 - "compress": Multiple compression threads state (json-bool)
3764 - "events": Migration state change event state (json-bool)
32c3db5b 3765 - "postcopy-ram": postcopy ram state (json-bool)
bbf6da32
OW
3766
3767Arguments:
3768
3769Example:
3770
3771-> { "execute": "query-migrate-capabilities" }
164f59e8
HZ
3772<- {"return": [
3773 {"state": false, "capability": "xbzrle"},
3774 {"state": false, "capability": "rdma-pin-all"},
3775 {"state": false, "capability": "auto-converge"},
3776 {"state": false, "capability": "zero-blocks"},
3777 {"state": false, "capability": "compress"},
3778 {"state": true, "capability": "events"},
32c3db5b 3779 {"state": false, "capability": "postcopy-ram"}
164f59e8 3780 ]}
dbca1b37 3781
bbf6da32
OW
3782EQMP
3783
3784 {
3785 .name = "query-migrate-capabilities",
3786 .args_type = "",
7fad30f0 3787 .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
bbf6da32
OW
3788 },
3789
85de8323
LL
3790SQMP
3791migrate-set-parameters
3792----------------------
3793
3794Set migration parameters
3795
3796- "compress-level": set compression level during migration (json-int)
3797- "compress-threads": set compression thread count for migration (json-int)
3798- "decompress-threads": set decompression thread count for migration (json-int)
d85a31d1
JH
3799- "cpu-throttle-initial": set initial percentage of time guest cpus are
3800 throttled for auto-converge (json-int)
3801- "cpu-throttle-increment": set throttle increasing percentage for
3802 auto-converge (json-int)
85de8323
LL
3803
3804Arguments:
3805
3806Example:
3807
3808-> { "execute": "migrate-set-parameters" , "arguments":
3809 { "compress-level": 1 } }
3810
3811EQMP
3812
3813 {
3814 .name = "migrate-set-parameters",
3815 .args_type =
d85a31d1 3816 "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?",
7fad30f0 3817 .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
85de8323
LL
3818 },
3819SQMP
3820query-migrate-parameters
3821------------------------
3822
3823Query current migration parameters
3824
3825- "parameters": migration parameters value
3826 - "compress-level" : compression level value (json-int)
3827 - "compress-threads" : compression thread count value (json-int)
3828 - "decompress-threads" : decompression thread count value (json-int)
d85a31d1
JH
3829 - "cpu-throttle-initial" : initial percentage of time guest cpus are
3830 throttled (json-int)
3831 - "cpu-throttle-increment" : throttle increasing percentage for
3832 auto-converge (json-int)
85de8323
LL
3833
3834Arguments:
3835
3836Example:
3837
3838-> { "execute": "query-migrate-parameters" }
3839<- {
3840 "return": {
9c994a97 3841 "decompress-threads": 2,
d85a31d1 3842 "cpu-throttle-increment": 10,
9c994a97
HZ
3843 "compress-threads": 8,
3844 "compress-level": 1,
d85a31d1 3845 "cpu-throttle-initial": 20
85de8323
LL
3846 }
3847 }
3848
3849EQMP
3850
3851 {
3852 .name = "query-migrate-parameters",
3853 .args_type = "",
7fad30f0 3854 .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
85de8323
LL
3855 },
3856
82a56f0d
LC
3857SQMP
3858query-balloon
3859-------------
3860
3861Show balloon information.
3862
3863Make an asynchronous request for balloon info. When the request completes a
3864json-object will be returned containing the following data:
3865
3866- "actual": current balloon value in bytes (json-int)
82a56f0d
LC
3867
3868Example:
3869
3870-> { "execute": "query-balloon" }
3871<- {
3872 "return":{
3873 "actual":1073741824,
82a56f0d
LC
3874 }
3875 }
3876
3877EQMP
3878
96637bcd
LC
3879 {
3880 .name = "query-balloon",
3881 .args_type = "",
7fad30f0 3882 .mhandler.cmd_new = qmp_marshal_query_balloon,
96637bcd 3883 },
b4b12c62 3884
fb5458cd
SH
3885 {
3886 .name = "query-block-jobs",
3887 .args_type = "",
7fad30f0 3888 .mhandler.cmd_new = qmp_marshal_query_block_jobs,
fb5458cd
SH
3889 },
3890
b4b12c62
AL
3891 {
3892 .name = "qom-list",
3893 .args_type = "path:s",
7fad30f0 3894 .mhandler.cmd_new = qmp_marshal_qom_list,
b4b12c62 3895 },
eb6e8ea5
AL
3896
3897 {
3898 .name = "qom-set",
b9f8978c 3899 .args_type = "path:s,property:s,value:q",
6eb3937e 3900 .mhandler.cmd_new = qmp_marshal_qom_set,
eb6e8ea5
AL
3901 },
3902
3903 {
3904 .name = "qom-get",
3905 .args_type = "path:s,property:s",
6eb3937e 3906 .mhandler.cmd_new = qmp_marshal_qom_get,
eb6e8ea5 3907 },
270b243f 3908
6dd844db
PB
3909 {
3910 .name = "nbd-server-start",
ddffee39 3911 .args_type = "addr:q,tls-creds:s?",
7fad30f0 3912 .mhandler.cmd_new = qmp_marshal_nbd_server_start,
6dd844db
PB
3913 },
3914 {
3915 .name = "nbd-server-add",
3916 .args_type = "device:B,writable:b?",
7fad30f0 3917 .mhandler.cmd_new = qmp_marshal_nbd_server_add,
6dd844db
PB
3918 },
3919 {
3920 .name = "nbd-server-stop",
3921 .args_type = "",
7fad30f0 3922 .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
6dd844db
PB
3923 },
3924
270b243f
LC
3925 {
3926 .name = "change-vnc-password",
3927 .args_type = "password:s",
7fad30f0 3928 .mhandler.cmd_new = qmp_marshal_change_vnc_password,
270b243f 3929 },
5eeee3fa
AL
3930 {
3931 .name = "qom-list-types",
3932 .args_type = "implements:s?,abstract:b?",
7fad30f0 3933 .mhandler.cmd_new = qmp_marshal_qom_list_types,
5eeee3fa 3934 },
1daa31b9
AL
3935
3936 {
3937 .name = "device-list-properties",
3938 .args_type = "typename:s",
7fad30f0 3939 .mhandler.cmd_new = qmp_marshal_device_list_properties,
1daa31b9
AL
3940 },
3941
01d3c80d
AL
3942 {
3943 .name = "query-machines",
3944 .args_type = "",
7fad30f0 3945 .mhandler.cmd_new = qmp_marshal_query_machines,
01d3c80d
AL
3946 },
3947
e4e31c63
AL
3948 {
3949 .name = "query-cpu-definitions",
3950 .args_type = "",
7fad30f0 3951 .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
e4e31c63
AL
3952 },
3953
e09484ef
DH
3954 {
3955 .name = "query-cpu-model-expansion",
3956 .args_type = "type:s,model:q",
3957 .mhandler.cmd_new = qmp_marshal_query_cpu_model_expansion,
3958 },
3959
0031e0d6
DH
3960 {
3961 .name = "query-cpu-model-comparison",
3962 .args_type = "modela:q,modelb:q",
3963 .mhandler.cmd_new = qmp_marshal_query_cpu_model_comparison,
3964 },
3965
b18b6043
DH
3966 {
3967 .name = "query-cpu-model-baseline",
3968 .args_type = "modela:q,modelb:q",
3969 .mhandler.cmd_new = qmp_marshal_query_cpu_model_baseline,
3970 },
3971
99afc91d
DB
3972 {
3973 .name = "query-target",
3974 .args_type = "",
7fad30f0 3975 .mhandler.cmd_new = qmp_marshal_query_target,
99afc91d 3976 },
f1a1a356 3977
d1a0cf73
SB
3978 {
3979 .name = "query-tpm",
3980 .args_type = "",
7fad30f0 3981 .mhandler.cmd_new = qmp_marshal_query_tpm,
d1a0cf73
SB
3982 },
3983
28c4fa32
CB
3984SQMP
3985query-tpm
3986---------
3987
3988Return information about the TPM device.
3989
3990Arguments: None
3991
3992Example:
3993
3994-> { "execute": "query-tpm" }
3995<- { "return":
3996 [
3997 { "model": "tpm-tis",
3998 "options":
3999 { "type": "passthrough",
4000 "data":
4001 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
4002 "path": "/dev/tpm0"
4003 }
4004 },
4005 "id": "tpm0"
4006 }
4007 ]
4008 }
4009
4010EQMP
4011
d1a0cf73
SB
4012 {
4013 .name = "query-tpm-models",
4014 .args_type = "",
7fad30f0 4015 .mhandler.cmd_new = qmp_marshal_query_tpm_models,
d1a0cf73
SB
4016 },
4017
28c4fa32
CB
4018SQMP
4019query-tpm-models
4020----------------
4021
4022Return a list of supported TPM models.
4023
4024Arguments: None
4025
4026Example:
4027
4028-> { "execute": "query-tpm-models" }
4029<- { "return": [ "tpm-tis" ] }
4030
4031EQMP
4032
d1a0cf73
SB
4033 {
4034 .name = "query-tpm-types",
4035 .args_type = "",
7fad30f0 4036 .mhandler.cmd_new = qmp_marshal_query_tpm_types,
d1a0cf73
SB
4037 },
4038
28c4fa32
CB
4039SQMP
4040query-tpm-types
4041---------------
4042
4043Return a list of supported TPM types.
4044
4045Arguments: None
4046
4047Example:
4048
4049-> { "execute": "query-tpm-types" }
4050<- { "return": [ "passthrough" ] }
4051
4052EQMP
4053
f1a1a356
GH
4054 {
4055 .name = "chardev-add",
4056 .args_type = "id:s,backend:q",
7fad30f0 4057 .mhandler.cmd_new = qmp_marshal_chardev_add,
f1a1a356
GH
4058 },
4059
4060SQMP
4061chardev-add
4062----------------
4063
4064Add a chardev.
4065
4066Arguments:
4067
4068- "id": the chardev's ID, must be unique (json-string)
4069- "backend": chardev backend type + parameters
4070
ffbdbe59 4071Examples:
f1a1a356
GH
4072
4073-> { "execute" : "chardev-add",
4074 "arguments" : { "id" : "foo",
4075 "backend" : { "type" : "null", "data" : {} } } }
4076<- { "return": {} }
4077
ffbdbe59
GH
4078-> { "execute" : "chardev-add",
4079 "arguments" : { "id" : "bar",
4080 "backend" : { "type" : "file",
4081 "data" : { "out" : "/tmp/bar.log" } } } }
4082<- { "return": {} }
4083
0a1a7fab
GH
4084-> { "execute" : "chardev-add",
4085 "arguments" : { "id" : "baz",
4086 "backend" : { "type" : "pty", "data" : {} } } }
4087<- { "return": { "pty" : "/dev/pty/42" } }
4088
f1a1a356
GH
4089EQMP
4090
4091 {
4092 .name = "chardev-remove",
4093 .args_type = "id:s",
7fad30f0 4094 .mhandler.cmd_new = qmp_marshal_chardev_remove,
f1a1a356
GH
4095 },
4096
4097
4098SQMP
4099chardev-remove
4100--------------
4101
4102Remove a chardev.
4103
4104Arguments:
4105
4106- "id": the chardev's ID, must exist and not be in use (json-string)
4107
4108Example:
4109
4110-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
4111<- { "return": {} }
4112
b1be4280
AK
4113EQMP
4114 {
4115 .name = "query-rx-filter",
4116 .args_type = "name:s?",
7fad30f0 4117 .mhandler.cmd_new = qmp_marshal_query_rx_filter,
b1be4280
AK
4118 },
4119
4120SQMP
4121query-rx-filter
4122---------------
4123
4124Show rx-filter information.
4125
4126Returns a json-array of rx-filter information for all NICs (or for the
4127given NIC), returning an error if the given NIC doesn't exist, or
4128given NIC doesn't support rx-filter querying, or given net client
4129isn't a NIC.
4130
4131The query will clear the event notification flag of each NIC, then qemu
4132will start to emit event to QMP monitor.
4133
4134Each array entry contains the following:
4135
4136- "name": net client name (json-string)
4137- "promiscuous": promiscuous mode is enabled (json-bool)
4138- "multicast": multicast receive state (one of 'normal', 'none', 'all')
4139- "unicast": unicast receive state (one of 'normal', 'none', 'all')
f7bc8ef8 4140- "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
b1be4280
AK
4141- "broadcast-allowed": allow to receive broadcast (json-bool)
4142- "multicast-overflow": multicast table is overflowed (json-bool)
4143- "unicast-overflow": unicast table is overflowed (json-bool)
4144- "main-mac": main macaddr string (json-string)
4145- "vlan-table": a json-array of active vlan id
4146- "unicast-table": a json-array of unicast macaddr string
4147- "multicast-table": a json-array of multicast macaddr string
4148
4149Example:
4150
4151-> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
4152<- { "return": [
4153 {
4154 "promiscuous": true,
4155 "name": "vnet0",
4156 "main-mac": "52:54:00:12:34:56",
4157 "unicast": "normal",
f7bc8ef8 4158 "vlan": "normal",
b1be4280
AK
4159 "vlan-table": [
4160 4,
4161 0
4162 ],
4163 "unicast-table": [
4164 ],
4165 "multicast": "normal",
4166 "multicast-overflow": false,
4167 "unicast-overflow": false,
4168 "multicast-table": [
4169 "01:00:5e:00:00:01",
4170 "33:33:00:00:00:01",
4171 "33:33:ff:12:34:56"
4172 ],
4173 "broadcast-allowed": false
4174 }
4175 ]
4176 }
4177
d26c9a15
KW
4178EQMP
4179
4180 {
4181 .name = "blockdev-add",
4182 .args_type = "options:q",
7fad30f0 4183 .mhandler.cmd_new = qmp_marshal_blockdev_add,
d26c9a15
KW
4184 },
4185
4186SQMP
4187blockdev-add
4188------------
4189
4190Add a block device.
4191
da2cf4e8 4192This command is still a work in progress. It doesn't support all
81b936ae
AG
4193block drivers among other things. Stay away from it unless you want
4194to help with its development.
da2cf4e8 4195
d26c9a15
KW
4196Arguments:
4197
4198- "options": block driver options
4199
4200Example (1):
4201
4202-> { "execute": "blockdev-add",
4203 "arguments": { "options" : { "driver": "qcow2",
4204 "file": { "driver": "file",
4205 "filename": "test.qcow2" } } } }
4206<- { "return": {} }
4207
4208Example (2):
4209
4210-> { "execute": "blockdev-add",
4211 "arguments": {
4212 "options": {
4213 "driver": "qcow2",
4214 "id": "my_disk",
4215 "discard": "unmap",
4216 "cache": {
4217 "direct": true,
4218 "writeback": true
4219 },
4220 "file": {
4221 "driver": "file",
4222 "filename": "/tmp/test.qcow2"
4223 },
4224 "backing": {
4225 "driver": "raw",
4226 "file": {
4227 "driver": "file",
4228 "filename": "/dev/fdset/4"
4229 }
4230 }
4231 }
4232 }
4233 }
4234
4235<- { "return": {} }
4236
81b936ae
AG
4237EQMP
4238
4239 {
4240 .name = "x-blockdev-del",
4241 .args_type = "id:s?,node-name:s?",
4242 .mhandler.cmd_new = qmp_marshal_x_blockdev_del,
4243 },
4244
4245SQMP
4246x-blockdev-del
4247------------
4248Since 2.5
4249
4250Deletes a block device thas has been added using blockdev-add.
4251The selected device can be either a block backend or a graph node.
4252
4253In the former case the backend will be destroyed, along with its
4254inserted medium if there's any. The command will fail if the backend
4255or its medium are in use.
4256
4257In the latter case the node will be destroyed. The command will fail
4258if the node is attached to a block backend or is otherwise being
4259used.
4260
4261One of "id" or "node-name" must be specified, but not both.
4262
4263This command is still a work in progress and is considered
4264experimental. Stay away from it unless you want to help with its
4265development.
4266
4267Arguments:
4268
4269- "id": Name of the block backend device to delete (json-string, optional)
4270- "node-name": Name of the graph node to delete (json-string, optional)
4271
4272Example:
4273
4274-> { "execute": "blockdev-add",
4275 "arguments": {
4276 "options": {
4277 "driver": "qcow2",
4278 "id": "drive0",
4279 "file": {
4280 "driver": "file",
4281 "filename": "test.qcow2"
4282 }
4283 }
4284 }
4285 }
4286
4287<- { "return": {} }
4288
4289-> { "execute": "x-blockdev-del",
4290 "arguments": { "id": "drive0" }
4291 }
4292<- { "return": {} }
4293
7d8a9f71
HR
4294EQMP
4295
4296 {
4297 .name = "blockdev-open-tray",
4298 .args_type = "device:s,force:b?",
4299 .mhandler.cmd_new = qmp_marshal_blockdev_open_tray,
4300 },
4301
4302SQMP
4303blockdev-open-tray
4304------------------
4305
4306Opens a block device's tray. If there is a block driver state tree inserted as a
4307medium, it will become inaccessible to the guest (but it will remain associated
4308to the block device, so closing the tray will make it accessible again).
4309
4310If the tray was already open before, this will be a no-op.
4311
4312Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4313which no such event will be generated, these include:
4314- if the guest has locked the tray, @force is false and the guest does not
4315 respond to the eject request
4316- if the BlockBackend denoted by @device does not have a guest device attached
4317 to it
4318- if the guest device does not have an actual tray and is empty, for instance
4319 for floppy disk drives
4320
4321Arguments:
4322
4323- "device": block device name (json-string)
4324- "force": if false (the default), an eject request will be sent to the guest if
4325 it has locked the tray (and the tray will not be opened immediately);
4326 if true, the tray will be opened regardless of whether it is locked
4327 (json-bool, optional)
4328
4329Example:
4330
4331-> { "execute": "blockdev-open-tray",
4332 "arguments": { "device": "ide1-cd0" } }
4333
4334<- { "timestamp": { "seconds": 1418751016,
4335 "microseconds": 716996 },
4336 "event": "DEVICE_TRAY_MOVED",
4337 "data": { "device": "ide1-cd0",
4338 "tray-open": true } }
4339
4340<- { "return": {} }
4341
abaaf59d
HR
4342EQMP
4343
4344 {
4345 .name = "blockdev-close-tray",
4346 .args_type = "device:s",
4347 .mhandler.cmd_new = qmp_marshal_blockdev_close_tray,
4348 },
4349
4350SQMP
4351blockdev-close-tray
4352-------------------
4353
4354Closes a block device's tray. If there is a block driver state tree associated
4355with the block device (which is currently ejected), that tree will be loaded as
4356the medium.
4357
4358If the tray was already closed before, this will be a no-op.
4359
4360Arguments:
4361
4362- "device": block device name (json-string)
4363
4364Example:
4365
4366-> { "execute": "blockdev-close-tray",
4367 "arguments": { "device": "ide1-cd0" } }
4368
4369<- { "timestamp": { "seconds": 1418751345,
4370 "microseconds": 272147 },
4371 "event": "DEVICE_TRAY_MOVED",
4372 "data": { "device": "ide1-cd0",
4373 "tray-open": false } }
4374
4375<- { "return": {} }
4376
2814f672
HR
4377EQMP
4378
4379 {
6e0abc25 4380 .name = "x-blockdev-remove-medium",
2814f672 4381 .args_type = "device:s",
6e0abc25 4382 .mhandler.cmd_new = qmp_marshal_x_blockdev_remove_medium,
2814f672
HR
4383 },
4384
4385SQMP
6e0abc25
HR
4386x-blockdev-remove-medium
4387------------------------
2814f672
HR
4388
4389Removes a medium (a block driver state tree) from a block device. That block
4390device's tray must currently be open (unless there is no attached guest device).
4391
4392If the tray is open and there is no medium inserted, this will be a no-op.
4393
6e0abc25
HR
4394This command is still a work in progress and is considered experimental.
4395Stay away from it unless you want to help with its development.
4396
2814f672
HR
4397Arguments:
4398
4399- "device": block device name (json-string)
4400
4401Example:
4402
6e0abc25 4403-> { "execute": "x-blockdev-remove-medium",
2814f672
HR
4404 "arguments": { "device": "ide1-cd0" } }
4405
4406<- { "error": { "class": "GenericError",
4407 "desc": "Tray of device 'ide1-cd0' is not open" } }
4408
4409-> { "execute": "blockdev-open-tray",
4410 "arguments": { "device": "ide1-cd0" } }
4411
4412<- { "timestamp": { "seconds": 1418751627,
4413 "microseconds": 549958 },
4414 "event": "DEVICE_TRAY_MOVED",
4415 "data": { "device": "ide1-cd0",
4416 "tray-open": true } }
4417
4418<- { "return": {} }
4419
6e0abc25 4420-> { "execute": "x-blockdev-remove-medium",
2814f672
HR
4421 "arguments": { "device": "ide1-cd0" } }
4422
4423<- { "return": {} }
4424
d1299882
HR
4425EQMP
4426
4427 {
6e0abc25 4428 .name = "x-blockdev-insert-medium",
d1299882 4429 .args_type = "device:s,node-name:s",
6e0abc25 4430 .mhandler.cmd_new = qmp_marshal_x_blockdev_insert_medium,
d1299882
HR
4431 },
4432
4433SQMP
6e0abc25
HR
4434x-blockdev-insert-medium
4435------------------------
d1299882
HR
4436
4437Inserts a medium (a block driver state tree) into a block device. That block
4438device's tray must currently be open (unless there is no attached guest device)
4439and there must be no medium inserted already.
4440
6e0abc25
HR
4441This command is still a work in progress and is considered experimental.
4442Stay away from it unless you want to help with its development.
4443
d1299882
HR
4444Arguments:
4445
4446- "device": block device name (json-string)
4447- "node-name": root node of the BDS tree to insert into the block device
4448
4449Example:
4450
4451-> { "execute": "blockdev-add",
4452 "arguments": { "options": { "node-name": "node0",
4453 "driver": "raw",
4454 "file": { "driver": "file",
4455 "filename": "fedora.iso" } } } }
4456
4457<- { "return": {} }
4458
6e0abc25 4459-> { "execute": "x-blockdev-insert-medium",
d1299882
HR
4460 "arguments": { "device": "ide1-cd0",
4461 "node-name": "node0" } }
4462
4463<- { "return": {} }
4464
7f821597
WC
4465EQMP
4466
4467 {
4468 .name = "x-blockdev-change",
4469 .args_type = "parent:B,child:B?,node:B?",
4470 .mhandler.cmd_new = qmp_marshal_x_blockdev_change,
4471 },
4472
4473SQMP
4474x-blockdev-change
4475-----------------
4476
4477Dynamically reconfigure the block driver state graph. It can be used
4478to add, remove, insert or replace a graph node. Currently only the
4479Quorum driver implements this feature to add or remove its child. This
4480is useful to fix a broken quorum child.
4481
4482If @node is specified, it will be inserted under @parent. @child
4483may not be specified in this case. If both @parent and @child are
4484specified but @node is not, @child will be detached from @parent.
4485
4486Arguments:
4487- "parent": the id or name of the parent node (json-string)
4488- "child": the name of a child under the given parent node (json-string, optional)
4489- "node": the name of the node that will be added (json-string, optional)
4490
4491Note: this command is experimental, and not a stable API. It doesn't
4492support all kinds of operations, all kinds of children, nor all block
4493drivers.
4494
4495Warning: The data in a new quorum child MUST be consistent with that of
4496the rest of the array.
4497
4498Example:
4499
4500Add a new node to a quorum
4501-> { "execute": "blockdev-add",
4502 "arguments": { "options": { "driver": "raw",
4503 "node-name": "new_node",
4504 "file": { "driver": "file",
4505 "filename": "test.raw" } } } }
4506<- { "return": {} }
4507-> { "execute": "x-blockdev-change",
4508 "arguments": { "parent": "disk1",
4509 "node": "new_node" } }
4510<- { "return": {} }
4511
4512Delete a quorum's node
4513-> { "execute": "x-blockdev-change",
4514 "arguments": { "parent": "disk1",
4515 "child": "children.1" } }
4516<- { "return": {} }
4517
c13163fb
BC
4518EQMP
4519
4520 {
4521 .name = "query-named-block-nodes",
4522 .args_type = "",
7fad30f0 4523 .mhandler.cmd_new = qmp_marshal_query_named_block_nodes,
c13163fb
BC
4524 },
4525
4526SQMP
4527@query-named-block-nodes
4528------------------------
4529
4530Return a list of BlockDeviceInfo for all the named block driver nodes
4531
4532Example:
4533
4534-> { "execute": "query-named-block-nodes" }
4535<- { "return": [ { "ro":false,
4536 "drv":"qcow2",
4537 "encrypted":false,
4538 "file":"disks/test.qcow2",
4539 "node-name": "my-node",
4540 "backing_file_depth":1,
4541 "bps":1000000,
4542 "bps_rd":0,
4543 "bps_wr":0,
4544 "iops":1000000,
4545 "iops_rd":0,
4546 "iops_wr":0,
4547 "bps_max": 8000000,
4548 "bps_rd_max": 0,
4549 "bps_wr_max": 0,
4550 "iops_max": 0,
4551 "iops_rd_max": 0,
4552 "iops_wr_max": 0,
4553 "iops_size": 0,
e2462113 4554 "write_threshold": 0,
c13163fb
BC
4555 "image":{
4556 "filename":"disks/test.qcow2",
4557 "format":"qcow2",
4558 "virtual-size":2048000,
4559 "backing_file":"base.qcow2",
4560 "full-backing-filename":"disks/base.qcow2",
5403432f 4561 "backing-filename-format":"qcow2",
c13163fb
BC
4562 "snapshots":[
4563 {
4564 "id": "1",
4565 "name": "snapshot1",
4566 "vm-state-size": 0,
4567 "date-sec": 10000200,
4568 "date-nsec": 12,
4569 "vm-clock-sec": 206,
4570 "vm-clock-nsec": 30
4571 }
4572 ],
4573 "backing-image":{
4574 "filename":"disks/base.qcow2",
4575 "format":"qcow2",
4576 "virtual-size":2048000
4577 }
c059451c 4578 } } ] }
c13163fb 4579
24fb4133
HR
4580EQMP
4581
4582 {
4583 .name = "blockdev-change-medium",
39ff43d9 4584 .args_type = "device:B,filename:F,format:s?,read-only-mode:s?",
24fb4133
HR
4585 .mhandler.cmd_new = qmp_marshal_blockdev_change_medium,
4586 },
4587
4588SQMP
4589blockdev-change-medium
4590----------------------
4591
4592Changes the medium inserted into a block device by ejecting the current medium
4593and loading a new image file which is inserted as the new medium.
4594
4595Arguments:
4596
4597- "device": device name (json-string)
4598- "filename": filename of the new image (json-string)
4599- "format": format of the new image (json-string, optional)
39ff43d9
HR
4600- "read-only-mode": new read-only mode (json-string, optional)
4601 - Possible values: "retain" (default), "read-only", "read-write"
24fb4133
HR
4602
4603Examples:
4604
46051. Change a removable medium
4606
4607-> { "execute": "blockdev-change-medium",
4608 "arguments": { "device": "ide1-cd0",
4609 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4610 "format": "raw" } }
4611<- { "return": {} }
4612
39ff43d9
HR
46132. Load a read-only medium into a writable drive
4614
4615-> { "execute": "blockdev-change-medium",
4616 "arguments": { "device": "isa-fd0",
4617 "filename": "/srv/images/ro.img",
4618 "format": "raw",
4619 "read-only-mode": "retain" } }
4620
4621<- { "error":
4622 { "class": "GenericError",
4623 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4624
4625-> { "execute": "blockdev-change-medium",
4626 "arguments": { "device": "isa-fd0",
4627 "filename": "/srv/images/ro.img",
4628 "format": "raw",
4629 "read-only-mode": "read-only" } }
4630
4631<- { "return": {} }
4632
76b5d850
HT
4633EQMP
4634
4635 {
4636 .name = "query-memdev",
4637 .args_type = "",
7fad30f0 4638 .mhandler.cmd_new = qmp_marshal_query_memdev,
76b5d850
HT
4639 },
4640
4641SQMP
4642query-memdev
4643------------
4644
4645Show memory devices information.
4646
4647
4648Example (1):
4649
4650-> { "execute": "query-memdev" }
4651<- { "return": [
4652 {
4653 "size": 536870912,
4654 "merge": false,
4655 "dump": true,
4656 "prealloc": false,
4657 "host-nodes": [0, 1],
4658 "policy": "bind"
4659 },
4660 {
4661 "size": 536870912,
4662 "merge": false,
4663 "dump": true,
4664 "prealloc": true,
4665 "host-nodes": [2, 3],
4666 "policy": "preferred"
4667 }
4668 ]
4669 }
4670
6f2e2730
IM
4671EQMP
4672
4673 {
4674 .name = "query-memory-devices",
4675 .args_type = "",
7fad30f0 4676 .mhandler.cmd_new = qmp_marshal_query_memory_devices,
6f2e2730
IM
4677 },
4678
4679SQMP
4680@query-memory-devices
4681--------------------
4682
4683Return a list of memory devices.
4684
4685Example:
4686-> { "execute": "query-memory-devices" }
4687<- { "return": [ { "data":
4688 { "addr": 5368709120,
4689 "hotpluggable": true,
4690 "hotplugged": true,
4691 "id": "d1",
4692 "memdev": "/objects/memX",
4693 "node": 0,
4694 "size": 1073741824,
4695 "slot": 0},
4696 "type": "dimm"
4697 } ] }
f1a1a356 4698EQMP
02419bcb
IM
4699
4700 {
4701 .name = "query-acpi-ospm-status",
4702 .args_type = "",
7fad30f0 4703 .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status,
02419bcb
IM
4704 },
4705
4706SQMP
4707@query-acpi-ospm-status
4708--------------------
4709
4710Return list of ACPIOSTInfo for devices that support status reporting
4711via ACPI _OST method.
4712
4713Example:
4714-> { "execute": "query-acpi-ospm-status" }
4715<- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4716 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4717 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4718 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4719 ]}
4720EQMP
f2ae8abf
MT
4721
4722#if defined TARGET_I386
4723 {
4724 .name = "rtc-reset-reinjection",
4725 .args_type = "",
7fad30f0 4726 .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection,
f2ae8abf
MT
4727 },
4728#endif
4729
4730SQMP
4731rtc-reset-reinjection
4732---------------------
4733
4734Reset the RTC interrupt reinjection backlog.
4735
4736Arguments: None.
4737
4738Example:
4739
4740-> { "execute": "rtc-reset-reinjection" }
4741<- { "return": {} }
1dde0f48
LV
4742EQMP
4743
4744 {
4745 .name = "trace-event-get-state",
77e2b172 4746 .args_type = "name:s,vcpu:i?",
7fad30f0 4747 .mhandler.cmd_new = qmp_marshal_trace_event_get_state,
1dde0f48
LV
4748 },
4749
4750SQMP
4751trace-event-get-state
4752---------------------
4753
4754Query the state of events.
4755
77e2b172
LV
4756Arguments:
4757
4758- "name": Event name pattern (json-string).
4759- "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
4760
4761An event is returned if:
4762- its name matches the "name" pattern, and
4763- if "vcpu" is given, the event has the "vcpu" property.
4764
4765Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4766returning their state on the specified vCPU. Special case: if "name" is an exact
4767match, "vcpu" is given and the event does not have the "vcpu" property, an error
4768is returned.
4769
1dde0f48
LV
4770Example:
4771
4772-> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4773<- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4774EQMP
4775
4776 {
4777 .name = "trace-event-set-state",
77e2b172 4778 .args_type = "name:s,enable:b,ignore-unavailable:b?,vcpu:i?",
7fad30f0 4779 .mhandler.cmd_new = qmp_marshal_trace_event_set_state,
1dde0f48 4780 },
f2ae8abf 4781
1dde0f48
LV
4782SQMP
4783trace-event-set-state
4784---------------------
4785
4786Set the state of events.
4787
77e2b172
LV
4788Arguments:
4789
4790- "name": Event name pattern (json-string).
4791- "enable": Whether to enable or disable the event (json-bool).
4792- "ignore-unavailable": Whether to ignore errors for events that cannot be
4793 changed (json-bool, optional).
4794- "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
4795
4796An event's state is modified if:
4797- its name matches the "name" pattern, and
4798- if "vcpu" is given, the event has the "vcpu" property.
4799
4800Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4801setting their state on the specified vCPU. Special case: if "name" is an exact
4802match, "vcpu" is given and the event does not have the "vcpu" property, an error
4803is returned.
4804
1dde0f48
LV
4805Example:
4806
4807-> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4808<- { "return": {} }
50c6617f
MT
4809EQMP
4810
4811 {
6575ccdd 4812 .name = "input-send-event",
51fc4476 4813 .args_type = "console:i?,events:q",
6575ccdd 4814 .mhandler.cmd_new = qmp_marshal_input_send_event,
50c6617f
MT
4815 },
4816
4817SQMP
6575ccdd 4818@input-send-event
50c6617f
MT
4819-----------------
4820
4821Send input event to guest.
4822
4823Arguments:
4824
b98d26e3
GH
4825- "device": display device (json-string, optional)
4826- "head": display head (json-int, optional)
4827- "events": list of input events
50c6617f
MT
4828
4829The consoles are visible in the qom tree, under
4830/backend/console[$index]. They have a device link and head property, so
4831it is possible to map which console belongs to which device and display.
4832
4833Example (1):
4834
4835Press left mouse button.
4836
6575ccdd 4837-> { "execute": "input-send-event",
b98d26e3 4838 "arguments": { "device": "video0",
50c6617f 4839 "events": [ { "type": "btn",
f22d0af0 4840 "data" : { "down": true, "button": "left" } } ] } }
50c6617f
MT
4841<- { "return": {} }
4842
6575ccdd 4843-> { "execute": "input-send-event",
b98d26e3 4844 "arguments": { "device": "video0",
50c6617f 4845 "events": [ { "type": "btn",
f22d0af0 4846 "data" : { "down": false, "button": "left" } } ] } }
50c6617f
MT
4847<- { "return": {} }
4848
4849Example (2):
4850
4851Press ctrl-alt-del.
4852
6575ccdd 4853-> { "execute": "input-send-event",
b98d26e3 4854 "arguments": { "events": [
50c6617f
MT
4855 { "type": "key", "data" : { "down": true,
4856 "key": {"type": "qcode", "data": "ctrl" } } },
4857 { "type": "key", "data" : { "down": true,
4858 "key": {"type": "qcode", "data": "alt" } } },
4859 { "type": "key", "data" : { "down": true,
4860 "key": {"type": "qcode", "data": "delete" } } } ] } }
4861<- { "return": {} }
4862
4863Example (3):
4864
4865Move mouse pointer to absolute coordinates (20000, 400).
4866
6575ccdd 4867-> { "execute": "input-send-event" ,
b98d26e3 4868 "arguments": { "events": [
01df5143
GH
4869 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
4870 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
50c6617f
MT
4871<- { "return": {} }
4872
e2462113
FR
4873EQMP
4874
4875 {
4876 .name = "block-set-write-threshold",
4877 .args_type = "node-name:s,write-threshold:l",
7fad30f0 4878 .mhandler.cmd_new = qmp_marshal_block_set_write_threshold,
e2462113
FR
4879 },
4880
4881SQMP
4882block-set-write-threshold
4883------------
4884
4885Change the write threshold for a block drive. The threshold is an offset,
4886thus must be non-negative. Default is no write threshold.
4887Setting the threshold to zero disables it.
4888
4889Arguments:
4890
4891- "node-name": the node name in the block driver state graph (json-string)
4892- "write-threshold": the write threshold in bytes (json-int)
4893
4894Example:
4895
4896-> { "execute": "block-set-write-threshold",
4897 "arguments": { "node-name": "mydev",
4898 "write-threshold": 17179869184 } }
4899<- { "return": {} }
4900
f2ae8abf 4901EQMP
fafa4d50
SF
4902
4903 {
4904 .name = "query-rocker",
4905 .args_type = "name:s",
7fad30f0 4906 .mhandler.cmd_new = qmp_marshal_query_rocker,
fafa4d50
SF
4907 },
4908
4909SQMP
4910Show rocker switch
4911------------------
4912
4913Arguments:
4914
4915- "name": switch name
4916
4917Example:
4918
4919-> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4920<- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4921
4922EQMP
4923
4924 {
4925 .name = "query-rocker-ports",
4926 .args_type = "name:s",
7fad30f0 4927 .mhandler.cmd_new = qmp_marshal_query_rocker_ports,
fafa4d50
SF
4928 },
4929
4930SQMP
4931Show rocker switch ports
4932------------------------
4933
4934Arguments:
4935
4936- "name": switch name
4937
4938Example:
4939
4940-> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4941<- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4942 "autoneg": "off", "link-up": true, "speed": 10000},
4943 {"duplex": "full", "enabled": true, "name": "sw1.2",
4944 "autoneg": "off", "link-up": true, "speed": 10000}
4945 ]}
4946
4947EQMP
4948
4949 {
4950 .name = "query-rocker-of-dpa-flows",
4951 .args_type = "name:s,tbl-id:i?",
7fad30f0 4952 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows,
fafa4d50
SF
4953 },
4954
4955SQMP
4956Show rocker switch OF-DPA flow tables
4957-------------------------------------
4958
4959Arguments:
4960
4961- "name": switch name
4962- "tbl-id": (optional) flow table ID
4963
4964Example:
4965
4966-> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4967<- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4968 "hits": 138,
4969 "cookie": 0,
4970 "action": {"goto-tbl": 10},
4971 "mask": {"in-pport": 4294901760}
4972 },
4973 {...more...},
4974 ]}
4975
4976EQMP
4977
4978 {
4979 .name = "query-rocker-of-dpa-groups",
4980 .args_type = "name:s,type:i?",
7fad30f0 4981 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups,
fafa4d50
SF
4982 },
4983
4984SQMP
4985Show rocker OF-DPA group tables
4986-------------------------------
4987
4988Arguments:
4989
4990- "name": switch name
4991- "type": (optional) group type
4992
4993Example:
4994
4995-> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4996<- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4997 "pop-vlan": 1, "id": 251723778},
4998 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4999 "pop-vlan": 1, "id": 251723776},
5000 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
5001 "pop-vlan": 1, "id": 251658241},
5002 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
5003 "pop-vlan": 1, "id": 251658240}
5004 ]}
ae50a770
PX
5005
5006EQMP
5007
5008#if defined TARGET_ARM
5009 {
5010 .name = "query-gic-capabilities",
5011 .args_type = "",
5012 .mhandler.cmd_new = qmp_marshal_query_gic_capabilities,
5013 },
5014#endif
5015
5016SQMP
5017query-gic-capabilities
5018---------------
5019
5020Return a list of GICCapability objects, describing supported GIC
5021(Generic Interrupt Controller) versions.
5022
5023Arguments: None
5024
5025Example:
5026
5027-> { "execute": "query-gic-capabilities" }
5028<- { "return": [{ "version": 2, "emulated": true, "kernel": false },
5029 { "version": 3, "emulated": false, "kernel": true } ] }
5030
5031EQMP
d4633541
IM
5032
5033 {
5034 .name = "query-hotpluggable-cpus",
5035 .args_type = "",
5036 .mhandler.cmd_new = qmp_marshal_query_hotpluggable_cpus,
5037 },
5038
5039SQMP
5040Show existing/possible CPUs
5041---------------------------
5042
5043Arguments: None.
5044
5045Example for pseries machine type started with
5046-smp 2,cores=2,maxcpus=4 -cpu POWER8:
5047
5048-> { "execute": "query-hotpluggable-cpus" }
5049<- {"return": [
13f5e800 5050 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
d4633541 5051 "vcpus-count": 1 },
13f5e800 5052 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
d4633541
IM
5053 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
5054 ]}'
4d952914
IM
5055
5056Example for pc machine type started with
5057-smp 1,maxcpus=2:
5058 -> { "execute": "query-hotpluggable-cpus" }
5059 <- {"return": [
5060 {
5061 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5062 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
5063 },
5064 {
5065 "qom-path": "/machine/unattached/device[0]",
5066 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5067 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
5068 }
5069 ]}