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