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