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