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