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