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