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