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