blob: 5c4c16fe9b9d7d4410755437d75042d62fcec2b5 [file] [log] [blame]
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001HXCOMM QMP dispatch table and documentation
Alberto Garcia3599d462015-02-26 16:35:07 +02002HXCOMM Text between SQMP and EQMP is copied to the QMP documentation file and
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003HXCOMM 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
Zhi Yong Wuc20cdf82011-07-27 14:32:56 +080045 1. The deprecation policy will take effect and be documented soon, please
Luiz Capitulino82a56f02010-09-13 12:26:00 -030046 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 = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +020066 .mhandler.cmd_new = qmp_marshal_quit,
Luiz Capitulino82a56f02010-09-13 12:26:00 -030067 },
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",
Markus Armbruster7fad30f2015-09-16 13:06:19 +020087 .mhandler.cmd_new = qmp_marshal_eject,
Luiz Capitulino82a56f02010-09-13 12:26:00 -030088 },
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?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200113 .mhandler.cmd_new = qmp_marshal_change,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300114 },
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",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200149 .mhandler.cmd_new = qmp_marshal_screendump,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300150 },
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 = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200172 .mhandler.cmd_new = qmp_marshal_stop,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300173 },
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 = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200193 .mhandler.cmd_new = qmp_marshal_cont,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300194 },
195
196SQMP
197cont
198----
199
200Resume emulation.
201
202Arguments: None.
203
204Example:
205
206-> { "execute": "cont" }
207<- { "return": {} }
208
209EQMP
210
211 {
Gerd Hoffmann9b9df252012-02-23 13:45:21 +0100212 .name = "system_wakeup",
213 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200214 .mhandler.cmd_new = qmp_marshal_system_wakeup,
Gerd Hoffmann9b9df252012-02-23 13:45:21 +0100215 },
216
217SQMP
218system_wakeup
219-------------
220
221Wakeup guest from suspend.
222
223Arguments: None.
224
225Example:
226
227-> { "execute": "system_wakeup" }
228<- { "return": {} }
229
230EQMP
231
232 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300233 .name = "system_reset",
234 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200235 .mhandler.cmd_new = qmp_marshal_system_reset,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300236 },
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 = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200256 .mhandler.cmd_new = qmp_marshal_system_powerdown,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300257 },
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",
Markus Armbruster485febc2015-03-13 17:25:50 +0100279 .mhandler.cmd_new = qmp_device_add,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300280 },
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",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200313 .mhandler.cmd_new = qmp_marshal_device_del,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300314 },
315
316SQMP
317device_del
318----------
319
320Remove a device.
321
322Arguments:
323
Daniel P. Berrange6287d822015-09-11 13:33:56 +0100324- "id": the device's ID or QOM path (json-string)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300325
326Example:
327
328-> { "execute": "device_del", "arguments": { "id": "net1" } }
329<- { "return": {} }
330
Daniel P. Berrange6287d822015-09-11 13:33:56 +0100331Example:
332
333-> { "execute": "device_del", "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
334<- { "return": {} }
335
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300336EQMP
337
338 {
Amos Konge4c8f002012-08-31 10:56:26 +0800339 .name = "send-key",
Paolo Bonzini43d0a2c2015-04-15 13:30:04 +0200340 .args_type = "keys:q,hold-time:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200341 .mhandler.cmd_new = qmp_marshal_send_key,
Amos Konge4c8f002012-08-31 10:56:26 +0800342 },
343
344SQMP
345send-key
346----------
347
348Send keys to VM.
349
350Arguments:
351
352keys array:
Amos Kongf9b1d9b2013-07-16 19:52:14 +0800353 - "key": key sequence (a json-array of key union values,
354 union can be number or qcode enum)
Amos Konge4c8f002012-08-31 10:56:26 +0800355
356- hold-time: time to delay key up events, milliseconds. Defaults to 100
357 (json-int, optional)
358
359Example:
360
361-> { "execute": "send-key",
Amos Kongf9b1d9b2013-07-16 19:52:14 +0800362 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
363 { "type": "qcode", "data": "alt" },
364 { "type": "qcode", "data": "delete" } ] } }
Amos Konge4c8f002012-08-31 10:56:26 +0800365<- { "return": {} }
366
367EQMP
368
369 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300370 .name = "cpu",
371 .args_type = "index:i",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200372 .mhandler.cmd_new = qmp_marshal_cpu,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300373 },
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
392EQMP
393
394 {
Igor Mammedov69ca3ea2013-04-30 15:41:25 +0200395 .name = "cpu-add",
396 .args_type = "id:i",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200397 .mhandler.cmd_new = qmp_marshal_cpu_add,
Igor Mammedov69ca3ea2013-04-30 15:41:25 +0200398 },
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
415EQMP
416
417 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300418 .name = "memsave",
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200419 .args_type = "val:l,size:i,filename:s,cpu:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200420 .mhandler.cmd_new = qmp_marshal_memsave,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300421 },
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)
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200434- "cpu": virtual CPU index (json-int, optional)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300435
436Example:
437
438-> { "execute": "memsave",
439 "arguments": { "val": 10,
440 "size": 100,
441 "filename": "/tmp/virtual-mem-dump" } }
442<- { "return": {} }
443
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300444EQMP
445
446 {
447 .name = "pmemsave",
448 .args_type = "val:l,size:i,filename:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200449 .mhandler.cmd_new = qmp_marshal_pmemsave,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300450 },
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
472EQMP
473
474 {
Lai Jiangshana4046662011-03-07 17:05:15 +0800475 .name = "inject-nmi",
476 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200477 .mhandler.cmd_new = qmp_marshal_inject_nmi,
Lai Jiangshana4046662011-03-07 17:05:15 +0800478 },
479
480SQMP
481inject-nmi
482----------
483
Alexey Kardashevskiy9cb805f2014-08-20 22:16:33 +1000484Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
Lai Jiangshana4046662011-03-07 17:05:15 +0800485
486Arguments: None.
487
488Example:
489
490-> { "execute": "inject-nmi" }
491<- { "return": {} }
492
Luiz Capitulinode253f12012-07-27 16:18:16 -0300493Note: inject-nmi fails when the guest doesn't support injecting.
Lai Jiangshana4046662011-03-07 17:05:15 +0800494
495EQMP
496
497 {
Markus Armbruster3949e592013-02-06 21:27:24 +0100498 .name = "ringbuf-write",
Markus Armbruster82e59a62013-02-06 21:27:14 +0100499 .args_type = "device:s,data:s,format:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200500 .mhandler.cmd_new = qmp_marshal_ringbuf_write,
Lei Li1f590cf2013-01-25 00:03:20 +0800501 },
502
503SQMP
Markus Armbruster3949e592013-02-06 21:27:24 +0100504ringbuf-write
Lei Li1f590cf2013-01-25 00:03:20 +0800505-------------
506
Markus Armbruster3949e592013-02-06 21:27:24 +0100507Write to a ring buffer character device.
Lei Li1f590cf2013-01-25 00:03:20 +0800508
509Arguments:
510
Markus Armbruster3949e592013-02-06 21:27:24 +0100511- "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.
Lei Li1f590cf2013-01-25 00:03:20 +0800517
518Example:
519
Markus Armbruster3949e592013-02-06 21:27:24 +0100520-> { "execute": "ringbuf-write",
521 "arguments": { "device": "foo",
Lei Li1f590cf2013-01-25 00:03:20 +0800522 "data": "abcdefgh",
523 "format": "utf8" } }
524<- { "return": {} }
525
526EQMP
527
528 {
Markus Armbruster3949e592013-02-06 21:27:24 +0100529 .name = "ringbuf-read",
Lei Li49b6d722013-01-25 00:03:21 +0800530 .args_type = "device:s,size:i,format:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200531 .mhandler.cmd_new = qmp_marshal_ringbuf_read,
Lei Li49b6d722013-01-25 00:03:21 +0800532 },
533
534SQMP
Markus Armbruster3949e592013-02-06 21:27:24 +0100535ringbuf-read
Lei Li49b6d722013-01-25 00:03:21 +0800536-------------
537
Markus Armbruster3949e592013-02-06 21:27:24 +0100538Read from a ring buffer character device.
Lei Li49b6d722013-01-25 00:03:21 +0800539
540Arguments:
541
Markus Armbruster3949e592013-02-06 21:27:24 +0100542- "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.
Lei Li49b6d722013-01-25 00:03:21 +0800553
554Example:
555
Markus Armbruster3949e592013-02-06 21:27:24 +0100556-> { "execute": "ringbuf-read",
557 "arguments": { "device": "foo",
Lei Li49b6d722013-01-25 00:03:21 +0800558 "size": 1000,
559 "format": "utf8" } }
Markus Armbruster3ab651f2013-02-06 21:27:15 +0100560<- {"return": "abcdefgh"}
Lei Li49b6d722013-01-25 00:03:21 +0800561
562EQMP
563
564 {
Stefano Stabellinia7ae8352012-01-25 12:24:51 +0000565 .name = "xen-save-devices-state",
566 .args_type = "filename:F",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200567 .mhandler.cmd_new = qmp_marshal_xen_save_devices_state,
Stefano Stabellinia7ae8352012-01-25 12:24:51 +0000568 },
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
589EQMP
590
591 {
Anthony PERARD39f42432012-10-03 13:48:19 +0000592 .name = "xen-set-global-dirty-log",
593 .args_type = "enable:b",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200594 .mhandler.cmd_new = qmp_marshal_xen_set_global_dirty_log,
Anthony PERARD39f42432012-10-03 13:48:19 +0000595 },
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
613EQMP
614
615 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300616 .name = "migrate",
617 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200618 .mhandler.cmd_new = qmp_marshal_migrate,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300619 },
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 = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200651 .mhandler.cmd_new = qmp_marshal_migrate_cancel,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300652 },
653
654SQMP
655migrate_cancel
656--------------
657
658Cancel the current migration.
659
660Arguments: None.
661
662Example:
663
664-> { "execute": "migrate_cancel" }
665<- { "return": {} }
666
667EQMP
Dr. David Alan Gilbertbf1ae1f2015-02-19 11:40:28 +0000668
669 {
670 .name = "migrate-incoming",
671 .args_type = "uri:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200672 .mhandler.cmd_new = qmp_marshal_migrate_incoming,
Dr. David Alan Gilbertbf1ae1f2015-02-19 11:40:28 +0000673 },
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
Dr. David Alan Gilbert4aab6282015-06-03 19:43:56 +0100694(2) The uri format is the same as for -incoming
Dr. David Alan Gilbertbf1ae1f2015-02-19 11:40:28 +0000695
696EQMP
697 {
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300698 .name = "migrate-set-cache-size",
699 .args_type = "value:o",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200700 .mhandler.cmd_new = qmp_marshal_migrate_set_cache_size,
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300701 },
702
703SQMP
704migrate-set-cache-size
Juan Quintela817c6042013-02-11 15:11:10 +0100705----------------------
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300706
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
720 {
Dr. David Alan Gilbert4886a1b2015-11-05 18:10:56 +0000721 .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
739 {
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300740 .name = "query-migrate-cache-size",
741 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200742 .mhandler.cmd_new = qmp_marshal_query_migrate_cache_size,
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300743 },
744
745SQMP
746query-migrate-cache-size
Juan Quintela817c6042013-02-11 15:11:10 +0100747------------------------
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300748
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
759EQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300760
761 {
762 .name = "migrate_set_speed",
Wen Congyang3a019b62010-11-25 09:06:05 +0800763 .args_type = "value:o",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200764 .mhandler.cmd_new = qmp_marshal_migrate_set_speed,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300765 },
766
767SQMP
768migrate_set_speed
769-----------------
770
771Set maximum speed for migrations.
772
773Arguments:
774
Luiz Capitulino5569fd72010-12-15 17:56:18 -0200775- "value": maximum speed, in bytes per second (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300776
777Example:
778
779-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
780<- { "return": {} }
781
782EQMP
783
784 {
785 .name = "migrate_set_downtime",
786 .args_type = "value:T",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200787 .mhandler.cmd_new = qmp_marshal_migrate_set_downtime,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300788 },
789
790SQMP
791migrate_set_downtime
792--------------------
793
794Set maximum tolerated downtime (in seconds) for migrations.
795
796Arguments:
797
798- "value": maximum downtime (json-number)
799
800Example:
801
802-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
803<- { "return": {} }
804
805EQMP
806
807 {
Jes Sorensenff73edf2011-03-09 14:31:06 +0100808 .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",
Markus Armbruster13cadef2015-03-05 19:16:58 +0100811 .help = "set migration information for remote display",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200812 .mhandler.cmd_new = qmp_marshal_client_migrate_info,
Jes Sorensenff73edf2011-03-09 14:31:06 +0100813 },
814
815SQMP
816client_migrate_info
Markus Armbruster13cadef2015-03-05 19:16:58 +0100817-------------------
Jes Sorensenff73edf2011-03-09 14:31:06 +0100818
Markus Armbruster13cadef2015-03-05 19:16:58 +0100819Set 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.
Jes Sorensenff73edf2011-03-09 14:31:06 +0100822
823Arguments:
824
Markus Armbruster13cadef2015-03-05 19:16:58 +0100825- "protocol": must be "spice" (json-string)
Jes Sorensenff73edf2011-03-09 14:31:06 +0100826- "hostname": migration target hostname (json-string)
Markus Armbruster13cadef2015-03-05 19:16:58 +0100827- "port": spice tcp port for plaintext channels (json-int, optional)
Jes Sorensenff73edf2011-03-09 14:31:06 +0100828- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
829- "cert-subject": server certificate subject (json-string, optional)
830
831Example:
832
833-> { "execute": "client_migrate_info",
834 "arguments": { "protocol": "spice",
835 "hostname": "virt42.lab.kraxel.org",
836 "port": 1234 } }
837<- { "return": {} }
838
839EQMP
840
841 {
Wen Congyang783e9b42012-05-07 12:10:47 +0800842 .name = "dump-guest-memory",
qiaonuohanb53ccc32014-02-18 14:11:36 +0800843 .args_type = "paging:b,protocol:s,begin:i?,end:i?,format:s?",
844 .params = "-p protocol [begin] [length] [format]",
Wen Congyang783e9b42012-05-07 12:10:47 +0800845 .help = "dump guest memory to file",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200846 .mhandler.cmd_new = qmp_marshal_dump_guest_memory,
Wen Congyang783e9b42012-05-07 12:10:47 +0800847 },
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)
qiaonuohanb53ccc32014-02-18 14:11:36 +0800864- "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)
Wen Congyang783e9b42012-05-07 12:10:47 +0800867
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
877EQMP
878
879 {
qiaonuohan7d6dc7f2014-02-18 14:11:38 +0800880 .name = "query-dump-guest-memory-capability",
881 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200882 .mhandler.cmd_new = qmp_marshal_query_dump_guest_memory_capability,
qiaonuohan7d6dc7f2014-02-18 14:11:38 +0800883 },
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
897EQMP
898
Jason J. Herne7ee0c3e2015-06-26 14:03:16 -0400899#if defined TARGET_S390X
900 {
901 .name = "dump-skeys",
902 .args_type = "filename:F",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200903 .mhandler.cmd_new = qmp_marshal_dump_skeys,
Jason J. Herne7ee0c3e2015-06-26 14:03:16 -0400904 },
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
922EQMP
923
qiaonuohan7d6dc7f2014-02-18 14:11:38 +0800924 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300925 .name = "netdev_add",
926 .args_type = "netdev:O",
Luiz Capitulino928059a2012-04-18 17:34:15 -0300927 .mhandler.cmd_new = qmp_netdev_add,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300928 },
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
Markus Armbrusterb8a98322015-09-16 13:06:26 +0200944-> { "execute": "netdev_add",
945 "arguments": { "type": "user", "id": "netdev1",
946 "dnssearch": "example.org" } }
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300947<- { "return": {} }
948
Markus Armbrusteraf347aa2013-02-22 18:31:51 +0100949Note: The supported device options are the same ones supported by the '-netdev'
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300950 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",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200958 .mhandler.cmd_new = qmp_marshal_netdev_del,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300959 },
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
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100976
977EQMP
978
979 {
Paolo Bonzinicff8b2c2013-12-20 23:21:10 +0100980 .name = "object-add",
981 .args_type = "qom-type:s,id:s,props:q?",
Markus Armbruster6eb39372015-09-16 13:06:25 +0200982 .mhandler.cmd_new = qmp_marshal_object_add,
Paolo Bonzinicff8b2c2013-12-20 23:21:10 +0100983 },
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
1003EQMP
1004
1005 {
Paolo Bonziniab2d0532013-12-20 23:21:09 +01001006 .name = "object-del",
1007 .args_type = "id:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001008 .mhandler.cmd_new = qmp_marshal_object_del,
Paolo Bonziniab2d0532013-12-20 23:21:09 +01001009 },
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
1030 {
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +01001031 .name = "block_resize",
Benoît Canet3b1dbd12014-01-23 21:31:37 +01001032 .args_type = "device:s?,node-name:s?,size:o",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001033 .mhandler.cmd_new = qmp_marshal_block_resize,
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +01001034 },
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)
Benoît Canet3b1dbd12014-01-23 21:31:37 +01001045- "node-name": the node name in the block driver state graph (json-string)
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +01001046- "size": new size
1047
1048Example:
1049
1050-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1051<- { "return": {} }
1052
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001053EQMP
1054
1055 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001056 .name = "block-stream",
Jeff Cody13d8cc52014-06-25 15:40:11 -04001057 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001058 .mhandler.cmd_new = qmp_marshal_block_stream,
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001059 },
1060
Stefan Hajnocziec683d62015-04-15 11:43:42 +01001061SQMP
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
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001098 {
Jeff Codyed61fc12012-09-27 13:29:16 -04001099 .name = "block-commit",
Jeff Cody54e26902014-06-25 15:40:10 -04001100 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001101 .mhandler.cmd_new = qmp_marshal_block_commit,
Jeff Codyed61fc12012-09-27 13:29:16 -04001102 },
1103
Jeff Cody37222902014-01-24 09:02:37 -05001104SQMP
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,
Jeff Cody7676e2c2014-06-30 15:14:15 +02001118 which contains the topmost data to be committed down. If
1119 not specified, this is the active layer. (json-string, optional)
Jeff Cody37222902014-01-24 09:02:37 -05001120
Jeff Cody54e26902014-06-25 15:40:10 -04001121- 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
Jeff Cody37222902014-01-24 09:02:37 -05001138 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
Jeff Codyed61fc12012-09-27 13:29:16 -04001161 {
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001162 .name = "drive-backup",
Stefan Hajnoczib53169e2013-06-26 14:11:57 +02001163 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
John Snowd58d8452015-04-17 19:49:58 -04001164 "bitmap:s?,on-source-error:s?,on-target-error:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001165 .mhandler.cmd_new = qmp_marshal_drive_backup,
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001166 },
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)
Stefan Hajnoczib53169e2013-06-26 14:11:57 +02001189- "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
John Snow4b80ab22015-06-04 20:20:34 -04001191 allocated in the topmost image, "incremental" for only the dirty sectors in
John Snowd58d8452015-04-17 19:49:58 -04001192 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
John Snow4b80ab22015-06-04 20:20:34 -04001193- "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1194 is "incremental", must NOT be present otherwise.
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001195- "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",
Ian Mainfc5d3f82013-07-26 11:39:04 -07001209 "sync": "full",
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001210 "target": "backup.img" } }
1211<- { "return": {} }
Fam Zhengc29c1dd2014-12-18 18:37:05 +08001212
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?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001219 .mhandler.cmd_new = qmp_marshal_blockdev_backup,
Fam Zhengc29c1dd2014-12-18 18:37:05 +08001220 },
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
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001254EQMP
1255
1256 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001257 .name = "block-job-set-speed",
Stefan Hajnoczi882ec7c2012-04-25 16:51:02 +01001258 .args_type = "device:B,speed:o",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001259 .mhandler.cmd_new = qmp_marshal_block_job_set_speed,
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00001260 },
1261
1262 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001263 .name = "block-job-cancel",
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001264 .args_type = "device:B,force:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001265 .mhandler.cmd_new = qmp_marshal_block_job_cancel,
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00001266 },
Jeff Codyc1864022012-02-28 15:54:07 -05001267 {
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001268 .name = "block-job-pause",
1269 .args_type = "device:B",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001270 .mhandler.cmd_new = qmp_marshal_block_job_pause,
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001271 },
1272 {
1273 .name = "block-job-resume",
1274 .args_type = "device:B",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001275 .mhandler.cmd_new = qmp_marshal_block_job_resume,
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001276 },
1277 {
Paolo Bonziniaeae8832012-10-18 16:49:21 +02001278 .name = "block-job-complete",
1279 .args_type = "device:B",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001280 .mhandler.cmd_new = qmp_marshal_block_job_complete,
Paolo Bonziniaeae8832012-10-18 16:49:21 +02001281 },
1282 {
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001283 .name = "transaction",
John Snow94d16a62015-11-05 18:13:18 -05001284 .args_type = "actions:q,properties:q?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001285 .mhandler.cmd_new = qmp_marshal_transaction,
Jeff Codyc1864022012-02-28 15:54:07 -05001286 },
1287
1288SQMP
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001289transaction
1290-----------
Jeff Codyc1864022012-02-28 15:54:07 -05001291
Kashyap Chamarthya9105232015-10-02 14:12:34 +02001292Atomically 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.
Jeff Codyc1864022012-02-28 15:54:07 -05001308
Wenchao Xiabbe86012013-09-11 14:04:34 +08001309For 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.
Jeff Codyc1864022012-02-28 15:54:07 -05001312
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001313Each 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
Wenchao Xiabbe86012013-09-11 14:04:34 +08001320On 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
Jeff Codyc1864022012-02-28 15:54:07 -05001331Arguments:
1332
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001333actions array:
Kashyap Chamarthya9105232015-10-02 14:12:34 +02001334 - "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"
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001340 - "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)
Benoît Canet0901f672014-01-23 21:31:38 +01001343 - "node-name": graph node name to snapshot (json-string)
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001344 - "snapshot-file": name of new image file (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001345 - "snapshot-node-name": graph node name of the new snapshot (json-string)
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001346 - "format": format of new image (json-string, optional)
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001347 - "mode": whether and how QEMU should create the snapshot file
1348 (NewImageMode, optional, default "absolute-paths")
Wenchao Xiabbe86012013-09-11 14:04:34 +08001349 When "type" is "blockdev-snapshot-internal-sync":
1350 - "device": device name to snapshot (json-string)
1351 - "name": name of the new snapshot (json-string)
Jeff Codyc1864022012-02-28 15:54:07 -05001352
1353Example:
1354
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001355-> { "execute": "transaction",
1356 "arguments": { "actions": [
Eric Blakecd0c5382014-05-06 09:39:03 -06001357 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001358 "snapshot-file": "/some/place/my-image",
1359 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001360 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
Benoît Canet0901f672014-01-23 21:31:38 +01001361 "snapshot-file": "/some/place/my-image2",
1362 "snapshot-node-name": "node3432",
1363 "mode": "existing",
1364 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001365 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001366 "snapshot-file": "/some/place/my-image2",
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001367 "mode": "existing",
Wenchao Xiabbe86012013-09-11 14:04:34 +08001368 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001369 { "type": "blockdev-snapshot-internal-sync", "data" : {
Wenchao Xiabbe86012013-09-11 14:04:34 +08001370 "device": "ide-hd2",
1371 "name": "snapshot0" } } ] } }
Jeff Codyc1864022012-02-28 15:54:07 -05001372<- { "return": {} }
1373
1374EQMP
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00001375
1376 {
John Snow341ebc22015-04-17 19:49:52 -04001377 .name = "block-dirty-bitmap-add",
1378 .args_type = "node:B,name:s,granularity:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001379 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_add,
John Snow341ebc22015-04-17 19:49:52 -04001380 },
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",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001407 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_remove,
John Snow341ebc22015-04-17 19:49:52 -04001408 },
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
1430EQMP
1431
1432 {
John Snowe74e6b72015-04-17 19:49:59 -04001433 .name = "block-dirty-bitmap-clear",
1434 .args_type = "node:B,name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001435 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_clear,
John Snowe74e6b72015-04-17 19:49:59 -04001436 },
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
1459EQMP
1460
1461 {
Jes Sorensend967b2f2011-07-11 20:01:09 +02001462 .name = "blockdev-snapshot-sync",
Benoît Canet0901f672014-01-23 21:31:38 +01001463 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001464 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_sync,
Jes Sorensend967b2f2011-07-11 20:01:09 +02001465 },
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)
Benoît Canet0901f672014-01-23 21:31:38 +01001480- "node-name": graph node name to snapshot (json-string)
Jes Sorensend967b2f2011-07-11 20:01:09 +02001481- "snapshot-file": name of new image file (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001482- "snapshot-node-name": graph node name of the new snapshot (json-string)
Paolo Bonzini6cc2a412012-03-06 18:55:59 +01001483- "mode": whether and how QEMU should create the snapshot file
1484 (NewImageMode, optional, default "absolute-paths")
Jes Sorensend967b2f2011-07-11 20:01:09 +02001485- "format": format of new image (json-string, optional)
1486
1487Example:
1488
Luiz Capitulino7f3850c2011-10-10 17:30:08 -03001489-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1490 "snapshot-file":
1491 "/some/place/my-image",
1492 "format": "qcow2" } }
Jes Sorensend967b2f2011-07-11 20:01:09 +02001493<- { "return": {} }
1494
1495EQMP
1496
1497 {
Alberto Garcia43de7e22015-10-26 14:27:16 +02001498 .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
1533EQMP
1534
1535 {
Wenchao Xiaf323bc92013-09-11 14:04:35 +08001536 .name = "blockdev-snapshot-internal-sync",
1537 .args_type = "device:B,name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001538 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_internal_sync,
Wenchao Xiaf323bc92013-09-11 14:04:35 +08001539 },
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
1562EQMP
1563
1564 {
Wenchao Xia44e3e052013-09-11 14:04:36 +08001565 .name = "blockdev-snapshot-delete-internal-sync",
1566 .args_type = "device:B,id:s?,name:s?",
1567 .mhandler.cmd_new =
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001568 qmp_marshal_blockdev_snapshot_delete_internal_sync,
Wenchao Xia44e3e052013-09-11 14:04:36 +08001569 },
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
1603EQMP
1604
1605 {
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001606 .name = "drive-mirror",
Paolo Bonzinib952b552012-10-18 16:49:28 +02001607 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
Benoît Canet09158f02014-06-27 18:25:25 +02001608 "node-name:s?,replaces:s?,"
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001609 "on-source-error:s?,on-target-error:s?,"
Fam Zheng0fc9f8e2015-06-08 13:56:08 +08001610 "unmap:b?,"
Paolo Bonzini08e4ed62013-01-22 09:03:13 +01001611 "granularity:i?,buf-size:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001612 .mhandler.cmd_new = qmp_marshal_drive_mirror,
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001613 },
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)
Benoît Canet4c828dc2014-06-16 12:00:55 +02001631- "node-name": the name of the new block driver state in the node graph
1632 (json-string, optional)
Benoît Canet09158f02014-06-27 18:25:25 +02001633- "replaces": the block driver node name to replace when finished
1634 (json-string, optional)
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001635- "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)
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001639- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
Paolo Bonzini08e4ed62013-01-22 09:03:13 +01001640- "buf_size": maximum amount of data in flight from source to target, in bytes
1641 (json-int, default 10M)
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001642- "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).
Paolo Bonzinib952b552012-10-18 16:49:28 +02001646- "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')
Fam Zheng0fc9f8e2015-06-08 13:56:08 +08001650- "unmap": whether the target sectors should be discarded where source has only
1651 zeroes. (json-bool, optional, default true)
Paolo Bonzinib952b552012-10-18 16:49:28 +02001652
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001653The 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.
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001657
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
1667EQMP
1668
1669 {
Jeff Codyfa40e652014-07-01 09:52:16 +02001670 .name = "change-backing-file",
1671 .args_type = "device:s,image-node-name:s,backing-file:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001672 .mhandler.cmd_new = qmp_marshal_change_backing_file,
Jeff Codyfa40e652014-07-01 09:52:16 +02001673 },
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
1706EQMP
1707
1708 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001709 .name = "balloon",
1710 .args_type = "value:M",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001711 .mhandler.cmd_new = qmp_marshal_balloon,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001712 },
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",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001734 .mhandler.cmd_new = qmp_marshal_set_link,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001735 },
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",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001760 .mhandler.cmd_new = qmp_marshal_getfd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001761 },
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
Corey Bryant208c9d12012-06-22 14:36:09 -04001778Notes:
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
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001786EQMP
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",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001793 .mhandler.cmd_new = qmp_marshal_closefd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001794 },
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
1811EQMP
1812
Corey Bryantba1c0482012-08-14 16:43:43 -04001813 {
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",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001818 .mhandler.cmd_new = qmp_marshal_add_fd,
Corey Bryantba1c0482012-08-14 16:43:43 -04001819 },
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",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001857 .mhandler.cmd_new = qmp_marshal_remove_fd,
Corey Bryantba1c0482012-08-14 16:43:43 -04001858 },
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",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001889 .mhandler.cmd_new = qmp_marshal_query_fdsets,
Corey Bryantba1c0482012-08-14 16:43:43 -04001890 },
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
1933EQMP
1934
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001935 {
1936 .name = "block_passwd",
Benoît Canet12d3ba82014-01-23 21:31:35 +01001937 .args_type = "device:s?,node-name:s?,password:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001938 .mhandler.cmd_new = qmp_marshal_block_passwd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001939 },
1940
1941SQMP
1942block_passwd
1943------------
1944
1945Set the password of encrypted block devices.
1946
1947Arguments:
1948
1949- "device": device name (json-string)
Benoît Canet12d3ba82014-01-23 21:31:35 +01001950- "node-name": name in the block driver state graph (json-string)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001951- "password": password (json-string)
1952
1953Example:
1954
1955-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1956 "password": "12345" } }
1957<- { "return": {} }
1958
1959EQMP
1960
1961 {
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001962 .name = "block_set_io_throttle",
Alberto Garcia76f4afb2015-06-08 18:17:44 +02001963 .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?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001964 .mhandler.cmd_new = qmp_marshal_block_set_io_throttle,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001965 },
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)
Eric Blake586b5462013-08-30 14:44:11 -06001976- "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)
Benoît Canet3e9fab62013-09-02 14:14:40 +02001982- "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)
Benoît Canet2024c1d2013-09-02 14:14:41 +02001988- "iops_size": I/O size in bytes when limiting (json-int)
Alberto Garcia76f4afb2015-06-08 18:17:44 +02001989- "group": throttle group name (json-string)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001990
1991Example:
1992
1993-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
Eric Blake586b5462013-08-30 14:44:11 -06001994 "bps": 1000000,
1995 "bps_rd": 0,
1996 "bps_wr": 0,
1997 "iops": 0,
1998 "iops_rd": 0,
Benoît Canet3e9fab62013-09-02 14:14:40 +02001999 "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,
Benoît Canet2024c1d2013-09-02 14:14:41 +02002005 "iops_wr_max": 0,
2006 "iops_size": 0 } }
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002007<- { "return": {} }
2008
2009EQMP
2010
2011 {
Gerd Hoffmann75721502010-10-07 12:22:54 +02002012 .name = "set_password",
2013 .args_type = "protocol:s,password:s,connected:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002014 .mhandler.cmd_new = qmp_marshal_set_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +02002015 },
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)
Alberto Garcia3599d462015-02-26 16:35:07 +02002027- "connected": [ keep | disconnect | fail ] (json-string, optional)
Gerd Hoffmann75721502010-10-07 12:22:54 +02002028
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",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002040 .mhandler.cmd_new = qmp_marshal_expire_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +02002041 },
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
2060EQMP
2061
2062 {
Daniel P. Berrange13661082011-06-23 13:31:42 +01002063 .name = "add_client",
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +00002064 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002065 .mhandler.cmd_new = qmp_marshal_add_client,
Daniel P. Berrange13661082011-06-23 13:31:42 +01002066 },
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)
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +00002078- "skipauth": whether to skip authentication (json-bool, optional)
2079- "tls": whether to perform TLS (json-bool, optional)
Daniel P. Berrange13661082011-06-23 13:31:42 +01002080
2081Example:
2082
2083-> { "execute": "add_client", "arguments": { "protocol": "vnc",
2084 "fdname": "myclient" } }
2085<- { "return": {} }
2086
2087EQMP
2088 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002089 .name = "qmp_capabilities",
2090 .args_type = "",
2091 .params = "",
2092 .help = "enable QMP capabilities",
Markus Armbruster485febc2015-03-13 17:25:50 +01002093 .mhandler.cmd_new = qmp_capabilities,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002094 },
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
Luiz Capitulino0268d972010-10-22 10:08:02 -02002111EQMP
2112
2113 {
2114 .name = "human-monitor-command",
2115 .args_type = "command-line:s,cpu-index:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002116 .mhandler.cmd_new = qmp_marshal_human_monitor_command,
Luiz Capitulino0268d972010-10-22 10:08:02 -02002117 },
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
Luiz Capitulino82a56f02010-09-13 12:26:00 -030021533. 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
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03002192 {
2193 .name = "query-version",
2194 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002195 .mhandler.cmd_new = qmp_marshal_query_version,
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03002196 },
2197
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002198SQMP
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
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03002229 {
2230 .name = "query-commands",
2231 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002232 .mhandler.cmd_new = qmp_marshal_query_commands,
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03002233 },
2234
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002235SQMP
Daniel P. Berrange48608532012-05-21 17:59:51 +01002236query-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 = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002269 .mhandler.cmd_new = qmp_marshal_query_events,
Daniel P. Berrange48608532012-05-21 17:59:51 +01002270 },
2271
2272SQMP
Markus Armbruster39a18152015-09-16 13:06:28 +02002273query-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
2289SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002290query-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)
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002300- "frontend-open": open/closed state of the frontend device attached to this
2301 backend (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002302
2303Example:
2304
2305-> { "execute": "query-chardev" }
2306<- {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002307 "return": [
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002308 {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002309 "label": "charchannel0",
2310 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2311 "frontend-open": false
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002312 },
2313 {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002314 "label": "charmonitor",
2315 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2316 "frontend-open": true
2317 },
2318 {
2319 "label": "charserial0",
2320 "filename": "pty:/dev/pts/2",
2321 "frontend-open": true
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002322 }
2323 ]
2324 }
2325
2326EQMP
2327
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03002328 {
2329 .name = "query-chardev",
2330 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002331 .mhandler.cmd_new = qmp_marshal_query_chardev,
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03002332 },
2333
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002334SQMP
Martin Kletzander77d1c3c2014-02-01 12:52:42 +01002335query-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 = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002372 .mhandler.cmd_new = qmp_marshal_query_chardev_backends,
Martin Kletzander77d1c3c2014-02-01 12:52:42 +01002373 },
2374
2375SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002376query-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)
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002388 - deprecated, retained for backward compatibility
2389 - Possible values: "unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002390- "removable": true if the device is removable, false otherwise (json-bool)
2391- "locked": true if the device is locked, false otherwise (json-bool)
Michal Privoznik99f42802013-01-29 17:58:41 +01002392- "tray_open": only present if removable, true if the device has a tray,
Markus Armbrustere4def802011-09-06 18:58:53 +02002393 and it is open (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002394- "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)
Stefan Hajnoczi550830f2014-09-16 15:24:24 +01002399 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002400 "file", "file", "ftp", "ftps", "host_cdrom",
Markus Armbruster92a539d2015-03-17 17:02:20 +01002401 "host_device", "http", "https",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002402 "nbd", "parallels", "qcow", "qcow2", "raw",
2403 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2404 - "backing_file": backing file name (json-string, optional)
Benoît Canet2e3e3312012-08-02 10:22:48 +02002405 - "backing_file_depth": number of files in the backing file chain (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002406 - "encrypted": true if encrypted, false otherwise (json-bool)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002407 - "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)
Benoît Canet3e9fab62013-09-02 14:14:40 +02002413 - "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)
Benoît Canet2024c1d2013-09-02 14:14:41 +02002419 - "iops_size": I/O size when limiting by iops (json-int)
Peter Lieven465bee12014-05-18 00:58:19 +02002420 - "detect_zeroes": detect and optimize zero writing (json-string)
2421 - Possible values: "off", "on", "unmap"
Francesco Romanie2462112015-01-12 14:11:13 +01002422 - "write_threshold": write offset threshold in bytes, a event will be
2423 emitted if crossed. Zero if disabled (json-int)
Wenchao Xia553a7e82013-06-06 12:27:59 +08002424 - "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
Eric Blake586b5462013-08-30 14:44:11 -06002457 date-sec (json-int)
Wenchao Xia553a7e82013-06-06 12:27:59 +08002458 - "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
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002465
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002466- "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"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002470
2471Example:
2472
2473-> { "execute": "query-block" }
2474<- {
2475 "return":[
2476 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002477 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002478 "device":"ide0-hd0",
2479 "locked":false,
2480 "removable":false,
2481 "inserted":{
2482 "ro":false,
2483 "drv":"qcow2",
2484 "encrypted":false,
Wenchao Xia553a7e82013-06-06 12:27:59 +08002485 "file":"disks/test.qcow2",
2486 "backing_file_depth":1,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002487 "bps":1000000,
2488 "bps_rd":0,
2489 "bps_wr":0,
2490 "iops":1000000,
2491 "iops_rd":0,
2492 "iops_wr":0,
Benoît Canet3e9fab62013-09-02 14:14:40 +02002493 "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,
Benoît Canet2024c1d2013-09-02 14:14:41 +02002499 "iops_size": 0,
Peter Lieven465bee12014-05-18 00:58:19 +02002500 "detect_zeroes": "on",
Francesco Romanie2462112015-01-12 14:11:13 +01002501 "write_threshold": 0,
Wenchao Xia553a7e82013-06-06 12:27:59 +08002502 "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",
John Snow54034322015-04-28 15:20:41 -04002508 "backing-filename-format":"qcow2",
Wenchao Xia553a7e82013-06-06 12:27:59 +08002509 "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 }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002526 },
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002527 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002528 },
2529 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002530 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002531 "device":"ide1-cd0",
2532 "locked":false,
2533 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002534 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002535 },
2536 {
2537 "device":"floppy0",
2538 "locked":false,
2539 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002540 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002541 },
2542 {
2543 "device":"sd0",
2544 "locked":false,
2545 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002546 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002547 }
2548 ]
2549 }
2550
2551EQMP
2552
Luiz Capitulinob2023812011-09-21 17:16:47 -03002553 {
2554 .name = "query-block",
2555 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002556 .mhandler.cmd_new = qmp_marshal_query_block,
Luiz Capitulinob2023812011-09-21 17:16:47 -03002557 },
2558
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002559SQMP
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)
Christoph Hellwige8045d62011-08-22 00:25:58 +02002576 - "flush_operations": cache flush operations (json-int)
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002577 - "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)
Max Reitz53d8f9d2015-10-19 17:53:20 +02002580 - "wr_highest_offset": The offset after the greatest byte written to the
2581 BlockDriverState since it has been opened (json-int)
Peter Lievenf4564d52015-02-02 14:52:18 +01002582 - "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)
Alberto Garciacb38fff2015-10-28 17:33:02 +02002586 - "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)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002590- "parent": Contains recursively the statistics of the underlying
2591 protocol (e.g. the host file for a qcow2 image). If there is
2592 no underlying protocol, this field is omitted
2593 (json-object, optional)
2594
2595Example:
2596
2597-> { "execute": "query-blockstats" }
2598<- {
2599 "return":[
2600 {
2601 "device":"ide0-hd0",
2602 "parent":{
2603 "stats":{
2604 "wr_highest_offset":3686448128,
2605 "wr_bytes":9786368,
2606 "wr_operations":751,
2607 "rd_bytes":122567168,
2608 "rd_operations":36772
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002609 "wr_total_times_ns":313253456
2610 "rd_total_times_ns":3465673657
2611 "flush_total_times_ns":49653
Christoph Hellwige8045d62011-08-22 00:25:58 +02002612 "flush_operations":61,
Peter Lievenf4564d52015-02-02 14:52:18 +01002613 "rd_merged":0,
Alberto Garciacb38fff2015-10-28 17:33:02 +02002614 "wr_merged":0,
2615 "idle_time_ns":2953431879
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002616 }
2617 },
2618 "stats":{
2619 "wr_highest_offset":2821110784,
2620 "wr_bytes":9786368,
2621 "wr_operations":692,
2622 "rd_bytes":122739200,
2623 "rd_operations":36604
Christoph Hellwige8045d62011-08-22 00:25:58 +02002624 "flush_operations":51,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002625 "wr_total_times_ns":313253456
2626 "rd_total_times_ns":3465673657
Peter Lievenf4564d52015-02-02 14:52:18 +01002627 "flush_total_times_ns":49653,
2628 "rd_merged":0,
Alberto Garciacb38fff2015-10-28 17:33:02 +02002629 "wr_merged":0,
2630 "idle_time_ns":2953431879
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002631 }
2632 },
2633 {
2634 "device":"ide1-cd0",
2635 "stats":{
2636 "wr_highest_offset":0,
2637 "wr_bytes":0,
2638 "wr_operations":0,
2639 "rd_bytes":0,
2640 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002641 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002642 "wr_total_times_ns":0
2643 "rd_total_times_ns":0
Peter Lievenf4564d52015-02-02 14:52:18 +01002644 "flush_total_times_ns":0,
2645 "rd_merged":0,
2646 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002647 }
2648 },
2649 {
2650 "device":"floppy0",
2651 "stats":{
2652 "wr_highest_offset":0,
2653 "wr_bytes":0,
2654 "wr_operations":0,
2655 "rd_bytes":0,
2656 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002657 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002658 "wr_total_times_ns":0
2659 "rd_total_times_ns":0
Peter Lievenf4564d52015-02-02 14:52:18 +01002660 "flush_total_times_ns":0,
2661 "rd_merged":0,
2662 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002663 }
2664 },
2665 {
2666 "device":"sd0",
2667 "stats":{
2668 "wr_highest_offset":0,
2669 "wr_bytes":0,
2670 "wr_operations":0,
2671 "rd_bytes":0,
2672 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002673 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002674 "wr_total_times_ns":0
2675 "rd_total_times_ns":0
Peter Lievenf4564d52015-02-02 14:52:18 +01002676 "flush_total_times_ns":0,
2677 "rd_merged":0,
2678 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002679 }
2680 }
2681 ]
2682 }
2683
2684EQMP
2685
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03002686 {
2687 .name = "query-blockstats",
Fam Zhengf71eaa72014-10-31 11:32:57 +08002688 .args_type = "query-nodes:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002689 .mhandler.cmd_new = qmp_marshal_query_blockstats,
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03002690 },
2691
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002692SQMP
2693query-cpus
2694----------
2695
2696Show CPU information.
2697
2698Return a json-array. Each CPU is represented by a json-object, which contains:
2699
2700- "CPU": CPU index (json-int)
2701- "current": true if this is the current CPU, false otherwise (json-bool)
2702- "halted": true if the cpu is halted, false otherwise (json-bool)
Eduardo Habkost58f88d42015-05-08 16:04:22 -03002703- "qom_path": path to the CPU object in the QOM tree (json-str)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002704- Current program counter. The key's name depends on the architecture:
2705 "pc": i386/x86_64 (json-int)
2706 "nip": PPC (json-int)
2707 "pc" and "npc": sparc (json-int)
2708 "PC": mips (json-int)
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002709- "thread_id": ID of the underlying host thread (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002710
2711Example:
2712
2713-> { "execute": "query-cpus" }
2714<- {
2715 "return":[
2716 {
2717 "CPU":0,
2718 "current":true,
2719 "halted":false,
Eduardo Habkost58f88d42015-05-08 16:04:22 -03002720 "qom_path":"/machine/unattached/device[0]",
2721 "pc":3227107138,
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002722 "thread_id":3134
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002723 },
2724 {
2725 "CPU":1,
2726 "current":false,
2727 "halted":true,
Eduardo Habkost58f88d42015-05-08 16:04:22 -03002728 "qom_path":"/machine/unattached/device[2]",
2729 "pc":7108165,
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002730 "thread_id":3135
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002731 }
2732 ]
2733 }
2734
2735EQMP
2736
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03002737 {
2738 .name = "query-cpus",
2739 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002740 .mhandler.cmd_new = qmp_marshal_query_cpus,
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03002741 },
2742
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002743SQMP
Stefan Hajnoczidc3dd0d2014-02-27 11:48:42 +01002744query-iothreads
2745---------------
2746
2747Returns a list of information about each iothread.
2748
2749Note this list excludes the QEMU main loop thread, which is not declared
2750using the -object iothread command-line option. It is always the main thread
2751of the process.
2752
2753Return a json-array. Each iothread is represented by a json-object, which contains:
2754
2755- "id": name of iothread (json-str)
2756- "thread-id": ID of the underlying host thread (json-int)
2757
2758Example:
2759
2760-> { "execute": "query-iothreads" }
2761<- {
2762 "return":[
2763 {
2764 "id":"iothread0",
2765 "thread-id":3134
2766 },
2767 {
2768 "id":"iothread1",
2769 "thread-id":3135
2770 }
2771 ]
2772 }
2773
2774EQMP
2775
2776 {
2777 .name = "query-iothreads",
2778 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002779 .mhandler.cmd_new = qmp_marshal_query_iothreads,
Stefan Hajnoczidc3dd0d2014-02-27 11:48:42 +01002780 },
2781
2782SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002783query-pci
2784---------
2785
2786PCI buses and devices information.
2787
2788The returned value is a json-array of all buses. Each bus is represented by
2789a json-object, which has a key with a json-array of all PCI devices attached
2790to it. Each device is represented by a json-object.
2791
2792The bus json-object contains the following:
2793
2794- "bus": bus number (json-int)
2795- "devices": a json-array of json-objects, each json-object represents a
2796 PCI device
2797
2798The PCI device json-object contains the following:
2799
2800- "bus": identical to the parent's bus number (json-int)
2801- "slot": slot number (json-int)
2802- "function": function number (json-int)
2803- "class_info": a json-object containing:
2804 - "desc": device class description (json-string, optional)
2805 - "class": device class number (json-int)
2806- "id": a json-object containing:
2807 - "device": device ID (json-int)
2808 - "vendor": vendor ID (json-int)
2809- "irq": device's IRQ if assigned (json-int, optional)
2810- "qdev_id": qdev id string (json-string)
2811- "pci_bridge": It's a json-object, only present if this device is a
2812 PCI bridge, contains:
2813 - "bus": bus number (json-int)
2814 - "secondary": secondary bus number (json-int)
2815 - "subordinate": subordinate bus number (json-int)
2816 - "io_range": I/O memory range information, a json-object with the
2817 following members:
2818 - "base": base address, in bytes (json-int)
2819 - "limit": limit address, in bytes (json-int)
2820 - "memory_range": memory range information, a json-object with the
2821 following members:
2822 - "base": base address, in bytes (json-int)
2823 - "limit": limit address, in bytes (json-int)
2824 - "prefetchable_range": Prefetchable memory range information, a
2825 json-object with the following members:
2826 - "base": base address, in bytes (json-int)
2827 - "limit": limit address, in bytes (json-int)
2828 - "devices": a json-array of PCI devices if there's any attached, each
2829 each element is represented by a json-object, which contains
2830 the same members of the 'PCI device json-object' described
2831 above (optional)
2832- "regions": a json-array of json-objects, each json-object represents a
2833 memory region of this device
2834
2835The memory range json-object contains the following:
2836
2837- "base": base memory address (json-int)
2838- "limit": limit value (json-int)
2839
2840The region json-object can be an I/O region or a memory region, an I/O region
2841json-object contains the following:
2842
2843- "type": "io" (json-string, fixed)
2844- "bar": BAR number (json-int)
2845- "address": memory address (json-int)
2846- "size": memory size (json-int)
2847
2848A memory region json-object contains the following:
2849
2850- "type": "memory" (json-string, fixed)
2851- "bar": BAR number (json-int)
2852- "address": memory address (json-int)
2853- "size": memory size (json-int)
2854- "mem_type_64": true or false (json-bool)
2855- "prefetch": true or false (json-bool)
2856
2857Example:
2858
2859-> { "execute": "query-pci" }
2860<- {
2861 "return":[
2862 {
2863 "bus":0,
2864 "devices":[
2865 {
2866 "bus":0,
2867 "qdev_id":"",
2868 "slot":0,
2869 "class_info":{
2870 "class":1536,
2871 "desc":"Host bridge"
2872 },
2873 "id":{
2874 "device":32902,
2875 "vendor":4663
2876 },
2877 "function":0,
2878 "regions":[
2879
2880 ]
2881 },
2882 {
2883 "bus":0,
2884 "qdev_id":"",
2885 "slot":1,
2886 "class_info":{
2887 "class":1537,
2888 "desc":"ISA bridge"
2889 },
2890 "id":{
2891 "device":32902,
2892 "vendor":28672
2893 },
2894 "function":0,
2895 "regions":[
2896
2897 ]
2898 },
2899 {
2900 "bus":0,
2901 "qdev_id":"",
2902 "slot":1,
2903 "class_info":{
2904 "class":257,
2905 "desc":"IDE controller"
2906 },
2907 "id":{
2908 "device":32902,
2909 "vendor":28688
2910 },
2911 "function":1,
2912 "regions":[
2913 {
2914 "bar":4,
2915 "size":16,
2916 "address":49152,
2917 "type":"io"
2918 }
2919 ]
2920 },
2921 {
2922 "bus":0,
2923 "qdev_id":"",
2924 "slot":2,
2925 "class_info":{
2926 "class":768,
2927 "desc":"VGA controller"
2928 },
2929 "id":{
2930 "device":4115,
2931 "vendor":184
2932 },
2933 "function":0,
2934 "regions":[
2935 {
2936 "prefetch":true,
2937 "mem_type_64":false,
2938 "bar":0,
2939 "size":33554432,
2940 "address":4026531840,
2941 "type":"memory"
2942 },
2943 {
2944 "prefetch":false,
2945 "mem_type_64":false,
2946 "bar":1,
2947 "size":4096,
2948 "address":4060086272,
2949 "type":"memory"
2950 },
2951 {
2952 "prefetch":false,
2953 "mem_type_64":false,
2954 "bar":6,
2955 "size":65536,
2956 "address":-1,
2957 "type":"memory"
2958 }
2959 ]
2960 },
2961 {
2962 "bus":0,
2963 "qdev_id":"",
2964 "irq":11,
2965 "slot":4,
2966 "class_info":{
2967 "class":1280,
2968 "desc":"RAM controller"
2969 },
2970 "id":{
2971 "device":6900,
2972 "vendor":4098
2973 },
2974 "function":0,
2975 "regions":[
2976 {
2977 "bar":0,
2978 "size":32,
2979 "address":49280,
2980 "type":"io"
2981 }
2982 ]
2983 }
2984 ]
2985 }
2986 ]
2987 }
2988
2989Note: This example has been shortened as the real response is too long.
2990
2991EQMP
2992
Luiz Capitulino79627472011-10-21 14:15:33 -02002993 {
2994 .name = "query-pci",
2995 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002996 .mhandler.cmd_new = qmp_marshal_query_pci,
Luiz Capitulino79627472011-10-21 14:15:33 -02002997 },
2998
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002999SQMP
3000query-kvm
3001---------
3002
3003Show KVM information.
3004
3005Return a json-object with the following information:
3006
3007- "enabled": true if KVM support is enabled, false otherwise (json-bool)
3008- "present": true if QEMU has KVM support, false otherwise (json-bool)
3009
3010Example:
3011
3012-> { "execute": "query-kvm" }
3013<- { "return": { "enabled": true, "present": true } }
3014
3015EQMP
3016
Luiz Capitulino292a2602011-09-12 15:10:53 -03003017 {
3018 .name = "query-kvm",
3019 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003020 .mhandler.cmd_new = qmp_marshal_query_kvm,
Luiz Capitulino292a2602011-09-12 15:10:53 -03003021 },
3022
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003023SQMP
3024query-status
3025------------
3026
3027Return a json-object with the following information:
3028
3029- "running": true if the VM is running, or false if it is paused (json-bool)
3030- "singlestep": true if the VM is in single step mode,
3031 false otherwise (json-bool)
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03003032- "status": one of the following values (json-string)
3033 "debug" - QEMU is running on a debugger
3034 "inmigrate" - guest is paused waiting for an incoming migration
3035 "internal-error" - An internal error that prevents further guest
3036 execution has occurred
3037 "io-error" - the last IOP has failed and the device is configured
3038 to pause on I/O errors
3039 "paused" - guest has been paused via the 'stop' command
3040 "postmigrate" - guest is paused following a successful 'migrate'
3041 "prelaunch" - QEMU was started with -S and guest has not started
3042 "finish-migrate" - guest is paused to finish the migration process
3043 "restore-vm" - guest is paused to restore VM state
3044 "running" - guest is actively running
3045 "save-vm" - guest is paused to save the VM state
3046 "shutdown" - guest is shut down (and -no-shutdown is in use)
3047 "watchdog" - the watchdog action is configured to pause and
3048 has been triggered
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003049
3050Example:
3051
3052-> { "execute": "query-status" }
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03003053<- { "return": { "running": true, "singlestep": false, "status": "running" } }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003054
3055EQMP
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03003056
3057 {
3058 .name = "query-status",
3059 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003060 .mhandler.cmd_new = qmp_marshal_query_status,
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03003061 },
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003062
3063SQMP
3064query-mice
3065----------
3066
3067Show VM mice information.
3068
3069Each mouse is represented by a json-object, the returned value is a json-array
3070of all mice.
3071
3072The mouse json-object contains the following:
3073
3074- "name": mouse's name (json-string)
3075- "index": mouse's index (json-int)
3076- "current": true if this mouse is receiving events, false otherwise (json-bool)
3077- "absolute": true if the mouse generates absolute input events (json-bool)
3078
3079Example:
3080
3081-> { "execute": "query-mice" }
3082<- {
3083 "return":[
3084 {
3085 "name":"QEMU Microsoft Mouse",
3086 "index":0,
3087 "current":false,
3088 "absolute":false
3089 },
3090 {
3091 "name":"QEMU PS/2 Mouse",
3092 "index":1,
3093 "current":true,
3094 "absolute":true
3095 }
3096 ]
3097 }
3098
3099EQMP
3100
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03003101 {
3102 .name = "query-mice",
3103 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003104 .mhandler.cmd_new = qmp_marshal_query_mice,
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03003105 },
3106
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003107SQMP
3108query-vnc
3109---------
3110
3111Show VNC server information.
3112
3113Return a json-object with server information. Connected clients are returned
3114as a json-array of json-objects.
3115
3116The main json-object contains the following:
3117
3118- "enabled": true or false (json-bool)
3119- "host": server's IP address (json-string)
3120- "family": address family (json-string)
3121 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3122- "service": server's port number (json-string)
3123- "auth": authentication method (json-string)
3124 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3125 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3126 "vencrypt+plain", "vencrypt+tls+none",
3127 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3128 "vencrypt+tls+vnc", "vencrypt+x509+none",
3129 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3130 "vencrypt+x509+vnc", "vnc"
3131- "clients": a json-array of all connected clients
3132
3133Clients are described by a json-object, each one contain the following:
3134
3135- "host": client's IP address (json-string)
3136- "family": address family (json-string)
3137 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3138- "service": client's port number (json-string)
3139- "x509_dname": TLS dname (json-string, optional)
3140- "sasl_username": SASL username (json-string, optional)
3141
3142Example:
3143
3144-> { "execute": "query-vnc" }
3145<- {
3146 "return":{
3147 "enabled":true,
3148 "host":"0.0.0.0",
3149 "service":"50402",
3150 "auth":"vnc",
3151 "family":"ipv4",
3152 "clients":[
3153 {
3154 "host":"127.0.0.1",
3155 "service":"50401",
3156 "family":"ipv4"
3157 }
3158 ]
3159 }
3160 }
3161
3162EQMP
3163
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02003164 {
3165 .name = "query-vnc",
3166 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003167 .mhandler.cmd_new = qmp_marshal_query_vnc,
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02003168 },
Gerd Hoffmanndf887682014-12-17 15:49:44 +01003169 {
3170 .name = "query-vnc-servers",
3171 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003172 .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
Gerd Hoffmanndf887682014-12-17 15:49:44 +01003173 },
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02003174
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003175SQMP
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01003176query-spice
3177-----------
3178
3179Show SPICE server information.
3180
3181Return a json-object with server information. Connected clients are returned
3182as a json-array of json-objects.
3183
3184The main json-object contains the following:
3185
3186- "enabled": true or false (json-bool)
3187- "host": server's IP address (json-string)
3188- "port": server's port number (json-int, optional)
3189- "tls-port": server's port number (json-int, optional)
3190- "auth": authentication method (json-string)
3191 - Possible values: "none", "spice"
3192- "channels": a json-array of all active channels clients
3193
3194Channels are described by a json-object, each one contain the following:
3195
3196- "host": client's IP address (json-string)
3197- "family": address family (json-string)
3198 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3199- "port": client's port number (json-string)
3200- "connection-id": spice connection id. All channels with the same id
3201 belong to the same spice session (json-int)
3202- "channel-type": channel type. "1" is the main control channel, filter for
3203 this one if you want track spice sessions only (json-int)
3204- "channel-id": channel id. Usually "0", might be different needed when
3205 multiple channels of the same type exist, such as multiple
3206 display channels in a multihead setup (json-int)
Alberto Garcia3599d462015-02-26 16:35:07 +02003207- "tls": whether the channel is encrypted (json-bool)
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01003208
3209Example:
3210
3211-> { "execute": "query-spice" }
3212<- {
3213 "return": {
3214 "enabled": true,
3215 "auth": "spice",
3216 "port": 5920,
3217 "tls-port": 5921,
3218 "host": "0.0.0.0",
3219 "channels": [
3220 {
3221 "port": "54924",
3222 "family": "ipv4",
3223 "channel-type": 1,
3224 "connection-id": 1804289383,
3225 "host": "127.0.0.1",
3226 "channel-id": 0,
3227 "tls": true
3228 },
3229 {
3230 "port": "36710",
3231 "family": "ipv4",
3232 "channel-type": 4,
3233 "connection-id": 1804289383,
3234 "host": "127.0.0.1",
3235 "channel-id": 0,
3236 "tls": false
3237 },
3238 [ ... more channels follow ... ]
3239 ]
3240 }
3241 }
3242
3243EQMP
3244
Luiz Capitulinod1f29642011-10-20 17:01:33 -02003245#if defined(CONFIG_SPICE)
3246 {
3247 .name = "query-spice",
3248 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003249 .mhandler.cmd_new = qmp_marshal_query_spice,
Luiz Capitulinod1f29642011-10-20 17:01:33 -02003250 },
3251#endif
3252
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01003253SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003254query-name
3255----------
3256
3257Show VM name.
3258
3259Return a json-object with the following information:
3260
3261- "name": VM's name (json-string, optional)
3262
3263Example:
3264
3265-> { "execute": "query-name" }
3266<- { "return": { "name": "qemu-name" } }
3267
3268EQMP
3269
Anthony Liguori48a32be2011-09-02 12:34:48 -05003270 {
3271 .name = "query-name",
3272 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003273 .mhandler.cmd_new = qmp_marshal_query_name,
Anthony Liguori48a32be2011-09-02 12:34:48 -05003274 },
3275
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003276SQMP
3277query-uuid
3278----------
3279
3280Show VM UUID.
3281
3282Return a json-object with the following information:
3283
3284- "UUID": Universally Unique Identifier (json-string)
3285
3286Example:
3287
3288-> { "execute": "query-uuid" }
3289<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3290
3291EQMP
3292
Luiz Capitulinoefab7672011-09-13 17:16:25 -03003293 {
3294 .name = "query-uuid",
3295 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003296 .mhandler.cmd_new = qmp_marshal_query_uuid,
Luiz Capitulinoefab7672011-09-13 17:16:25 -03003297 },
3298
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003299SQMP
Amos Kong1f8f9872013-04-25 17:50:35 +08003300query-command-line-options
3301--------------------------
3302
3303Show command line option schema.
3304
3305Return a json-array of command line option schema for all options (or for
3306the given option), returning an error if the given option doesn't exist.
3307
3308Each array entry contains the following:
3309
3310- "option": option name (json-string)
3311- "parameters": a json-array describes all parameters of the option:
3312 - "name": parameter name (json-string)
3313 - "type": parameter type (one of 'string', 'boolean', 'number',
3314 or 'size')
3315 - "help": human readable description of the parameter
3316 (json-string, optional)
Chunyan Liue36af942014-06-05 17:20:43 +08003317 - "default": default value string for the parameter
3318 (json-string, optional)
Amos Kong1f8f9872013-04-25 17:50:35 +08003319
3320Example:
3321
3322-> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3323<- { "return": [
3324 {
3325 "parameters": [
3326 {
3327 "name": "romfile",
3328 "type": "string"
3329 },
3330 {
3331 "name": "bootindex",
3332 "type": "number"
3333 }
3334 ],
3335 "option": "option-rom"
3336 }
3337 ]
3338 }
3339
3340EQMP
3341
3342 {
3343 .name = "query-command-line-options",
3344 .args_type = "option:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003345 .mhandler.cmd_new = qmp_marshal_query_command_line_options,
Amos Kong1f8f9872013-04-25 17:50:35 +08003346 },
3347
3348SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003349query-migrate
3350-------------
3351
3352Migration status.
3353
3354Return a json-object. If migration is active there will be another json-object
3355with RAM migration status and if block migration is active another one with
3356block migration status.
3357
3358The main json-object contains the following:
3359
3360- "status": migration status (json-string)
Peter Feiner3b695952014-05-16 10:40:47 -04003361 - Possible values: "setup", "active", "completed", "failed", "cancelled"
Juan Quintela7aa939a2012-08-18 13:17:10 +02003362- "total-time": total amount of ms since migration started. If
3363 migration has ended, it returns the total migration
Juan Quintela817c6042013-02-11 15:11:10 +01003364 time (json-int)
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003365- "setup-time" amount of setup time in milliseconds _before_ the
3366 iterations begin but _after_ the QMP command is issued.
3367 This is designed to provide an accounting of any activities
3368 (such as RDMA pinning) which may be expensive, but do not
3369 actually occur during the iterative migration rounds
3370 themselves. (json-int)
Juan Quintela9c5a9fc2012-08-13 09:35:16 +02003371- "downtime": only present when migration has finished correctly
3372 total amount in ms for downtime that happened (json-int)
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003373- "expected-downtime": only present while migration is active
3374 total amount in ms for downtime that was calculated on
Juan Quintela817c6042013-02-11 15:11:10 +01003375 the last bitmap round (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003376- "ram": only present if "status" is "active", it is a json-object with the
Juan Quintela817c6042013-02-11 15:11:10 +01003377 following RAM information:
3378 - "transferred": amount transferred in bytes (json-int)
3379 - "remaining": amount remaining to transfer in bytes (json-int)
3380 - "total": total amount of memory in bytes (json-int)
3381 - "duplicate": number of pages filled entirely with the same
3382 byte (json-int)
3383 These are sent over the wire much more efficiently.
Peter Lievenf1c72792013-03-26 10:58:37 +01003384 - "skipped": number of skipped zero pages (json-int)
Stefan Weil805a2502013-04-28 11:49:57 +02003385 - "normal" : number of whole pages transferred. I.e. they
Juan Quintela817c6042013-02-11 15:11:10 +01003386 were not sent as duplicate or xbzrle pages (json-int)
3387 - "normal-bytes" : number of bytes transferred in whole
3388 pages. This is just normal pages times size of one page,
3389 but this way upper levels don't need to care about page
3390 size (json-int)
ChenLiang58570ed2014-04-04 17:57:55 +08003391 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003392- "disk": only present if "status" is "active" and it is a block migration,
Juan Quintela817c6042013-02-11 15:11:10 +01003393 it is a json-object with the following disk information:
3394 - "transferred": amount transferred in bytes (json-int)
3395 - "remaining": amount remaining to transfer in bytes json-int)
3396 - "total": total disk size in bytes (json-int)
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003397- "xbzrle-cache": only present if XBZRLE is active.
3398 It is a json-object with the following XBZRLE information:
Juan Quintela817c6042013-02-11 15:11:10 +01003399 - "cache-size": XBZRLE cache size in bytes
3400 - "bytes": number of bytes transferred for XBZRLE compressed pages
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003401 - "pages": number of XBZRLE compressed pages
Juan Quintela817c6042013-02-11 15:11:10 +01003402 - "cache-miss": number of XBRZRLE page cache misses
ChenLiang8bc39232014-04-04 17:57:56 +08003403 - "cache-miss-rate": rate of XBRZRLE page cache misses
Juan Quintela817c6042013-02-11 15:11:10 +01003404 - "overflow": number of times XBZRLE overflows. This means
3405 that the XBZRLE encoding was bigger than just sent the
3406 whole page, and then we sent the whole page instead (as as
3407 normal page).
3408
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003409Examples:
3410
34111. Before the first migration
3412
3413-> { "execute": "query-migrate" }
3414<- { "return": {} }
3415
34162. Migration is done and has succeeded
3417
3418-> { "execute": "query-migrate" }
Orit Wasserman004d4c12012-08-06 21:42:56 +03003419<- { "return": {
3420 "status": "completed",
3421 "ram":{
3422 "transferred":123,
3423 "remaining":123,
3424 "total":246,
3425 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003426 "setup-time":12345,
Juan Quintela9c5a9fc2012-08-13 09:35:16 +02003427 "downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003428 "duplicate":123,
3429 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003430 "normal-bytes":123456,
3431 "dirty-sync-count":15
Orit Wasserman004d4c12012-08-06 21:42:56 +03003432 }
3433 }
3434 }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003435
34363. Migration is done and has failed
3437
3438-> { "execute": "query-migrate" }
3439<- { "return": { "status": "failed" } }
3440
34414. Migration is being performed and is not a block migration:
3442
3443-> { "execute": "query-migrate" }
3444<- {
3445 "return":{
3446 "status":"active",
3447 "ram":{
3448 "transferred":123,
3449 "remaining":123,
Orit Wasserman62d4e3f2012-08-06 21:42:55 +03003450 "total":246,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003451 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003452 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003453 "expected-downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003454 "duplicate":123,
3455 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003456 "normal-bytes":123456,
3457 "dirty-sync-count":15
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003458 }
3459 }
3460 }
3461
34625. Migration is being performed and is a block migration:
3463
3464-> { "execute": "query-migrate" }
3465<- {
3466 "return":{
3467 "status":"active",
3468 "ram":{
3469 "total":1057024,
3470 "remaining":1053304,
Orit Wasserman62d4e3f2012-08-06 21:42:55 +03003471 "transferred":3720,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003472 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003473 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003474 "expected-downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003475 "duplicate":123,
3476 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003477 "normal-bytes":123456,
3478 "dirty-sync-count":15
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003479 },
3480 "disk":{
3481 "total":20971520,
3482 "remaining":20880384,
3483 "transferred":91136
3484 }
3485 }
3486 }
3487
Orit Wassermanf36d55a2012-08-06 21:42:57 +030034886. Migration is being performed and XBZRLE is active:
3489
3490-> { "execute": "query-migrate" }
3491<- {
3492 "return":{
3493 "status":"active",
3494 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3495 "ram":{
3496 "total":1057024,
3497 "remaining":1053304,
3498 "transferred":3720,
3499 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003500 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003501 "expected-downtime":12345,
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003502 "duplicate":10,
3503 "normal":3333,
ChenLiang58570ed2014-04-04 17:57:55 +08003504 "normal-bytes":3412992,
3505 "dirty-sync-count":15
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003506 },
3507 "xbzrle-cache":{
3508 "cache-size":67108864,
3509 "bytes":20971520,
3510 "pages":2444343,
3511 "cache-miss":2244,
ChenLiang8bc39232014-04-04 17:57:56 +08003512 "cache-miss-rate":0.123,
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003513 "overflow":34434
3514 }
3515 }
3516 }
3517
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003518EQMP
3519
Luiz Capitulino791e7c82011-09-13 17:37:16 -03003520 {
3521 .name = "query-migrate",
3522 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003523 .mhandler.cmd_new = qmp_marshal_query_migrate,
Luiz Capitulino791e7c82011-09-13 17:37:16 -03003524 },
3525
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003526SQMP
Orit Wasserman00458432012-08-06 21:42:48 +03003527migrate-set-capabilities
Juan Quintela817c6042013-02-11 15:11:10 +01003528------------------------
Orit Wasserman00458432012-08-06 21:42:48 +03003529
3530Enable/Disable migration capabilities
3531
Juan Quintela817c6042013-02-11 15:11:10 +01003532- "xbzrle": XBZRLE support
zhanghailiangd6d69732014-12-09 14:38:37 +08003533- "rdma-pin-all": pin all pages when using RDMA during migration
3534- "auto-converge": throttle down guest to help convergence of migration
3535- "zero-blocks": compress zero blocks during block migration
Juan Quintela72e72e12015-07-08 14:13:10 +02003536- "events": generate events for each migration state change
Orit Wasserman00458432012-08-06 21:42:48 +03003537
3538Arguments:
3539
3540Example:
3541
3542-> { "execute": "migrate-set-capabilities" , "arguments":
3543 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3544
3545EQMP
3546
3547 {
3548 .name = "migrate-set-capabilities",
Paolo Bonzini43d0a2c2015-04-15 13:30:04 +02003549 .args_type = "capabilities:q",
Orit Wasserman00458432012-08-06 21:42:48 +03003550 .params = "capability:s,state:b",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003551 .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
Orit Wasserman00458432012-08-06 21:42:48 +03003552 },
3553SQMP
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003554query-migrate-capabilities
Juan Quintela817c6042013-02-11 15:11:10 +01003555--------------------------
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003556
3557Query current migration capabilities
3558
3559- "capabilities": migration capabilities state
3560 - "xbzrle" : XBZRLE state (json-bool)
zhanghailiangd6d69732014-12-09 14:38:37 +08003561 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3562 - "auto-converge" : Auto Converge state (json-bool)
3563 - "zero-blocks" : Zero Blocks state (json-bool)
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003564
3565Arguments:
3566
3567Example:
3568
3569-> { "execute": "query-migrate-capabilities" }
Orit Wassermandbca1b32013-01-31 09:12:17 +02003570<- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3571
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003572EQMP
3573
3574 {
3575 .name = "query-migrate-capabilities",
3576 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003577 .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003578 },
3579
3580SQMP
Liang Li85de8322015-03-23 16:32:28 +08003581migrate-set-parameters
3582----------------------
3583
3584Set migration parameters
3585
3586- "compress-level": set compression level during migration (json-int)
3587- "compress-threads": set compression thread count for migration (json-int)
3588- "decompress-threads": set decompression thread count for migration (json-int)
3589
3590Arguments:
3591
3592Example:
3593
3594-> { "execute": "migrate-set-parameters" , "arguments":
3595 { "compress-level": 1 } }
3596
3597EQMP
3598
3599 {
3600 .name = "migrate-set-parameters",
3601 .args_type =
3602 "compress-level:i?,compress-threads:i?,decompress-threads:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003603 .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
Liang Li85de8322015-03-23 16:32:28 +08003604 },
3605SQMP
3606query-migrate-parameters
3607------------------------
3608
3609Query current migration parameters
3610
3611- "parameters": migration parameters value
3612 - "compress-level" : compression level value (json-int)
3613 - "compress-threads" : compression thread count value (json-int)
3614 - "decompress-threads" : decompression thread count value (json-int)
3615
3616Arguments:
3617
3618Example:
3619
3620-> { "execute": "query-migrate-parameters" }
3621<- {
3622 "return": {
3623 "decompress-threads", 2,
3624 "compress-threads", 8,
3625 "compress-level", 1
3626 }
3627 }
3628
3629EQMP
3630
3631 {
3632 .name = "query-migrate-parameters",
3633 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003634 .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
Liang Li85de8322015-03-23 16:32:28 +08003635 },
3636
3637SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003638query-balloon
3639-------------
3640
3641Show balloon information.
3642
3643Make an asynchronous request for balloon info. When the request completes a
3644json-object will be returned containing the following data:
3645
3646- "actual": current balloon value in bytes (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003647
3648Example:
3649
3650-> { "execute": "query-balloon" }
3651<- {
3652 "return":{
3653 "actual":1073741824,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003654 }
3655 }
3656
3657EQMP
3658
Luiz Capitulino96637bc2011-10-21 11:41:37 -02003659 {
3660 .name = "query-balloon",
3661 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003662 .mhandler.cmd_new = qmp_marshal_query_balloon,
Luiz Capitulino96637bc2011-10-21 11:41:37 -02003663 },
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003664
3665 {
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00003666 .name = "query-block-jobs",
3667 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003668 .mhandler.cmd_new = qmp_marshal_query_block_jobs,
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00003669 },
3670
3671 {
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003672 .name = "qom-list",
3673 .args_type = "path:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003674 .mhandler.cmd_new = qmp_marshal_qom_list,
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003675 },
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003676
3677 {
3678 .name = "qom-set",
Paolo Bonzinib9f89782012-03-22 12:51:11 +01003679 .args_type = "path:s,property:s,value:q",
Markus Armbruster6eb39372015-09-16 13:06:25 +02003680 .mhandler.cmd_new = qmp_marshal_qom_set,
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003681 },
3682
3683 {
3684 .name = "qom-get",
3685 .args_type = "path:s,property:s",
Markus Armbruster6eb39372015-09-16 13:06:25 +02003686 .mhandler.cmd_new = qmp_marshal_qom_get,
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003687 },
Luiz Capitulino270b2432011-12-08 11:45:55 -02003688
3689 {
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003690 .name = "nbd-server-start",
3691 .args_type = "addr:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003692 .mhandler.cmd_new = qmp_marshal_nbd_server_start,
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003693 },
3694 {
3695 .name = "nbd-server-add",
3696 .args_type = "device:B,writable:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003697 .mhandler.cmd_new = qmp_marshal_nbd_server_add,
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003698 },
3699 {
3700 .name = "nbd-server-stop",
3701 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003702 .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003703 },
3704
3705 {
Luiz Capitulino270b2432011-12-08 11:45:55 -02003706 .name = "change-vnc-password",
3707 .args_type = "password:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003708 .mhandler.cmd_new = qmp_marshal_change_vnc_password,
Luiz Capitulino270b2432011-12-08 11:45:55 -02003709 },
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06003710 {
3711 .name = "qom-list-types",
3712 .args_type = "implements:s?,abstract:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003713 .mhandler.cmd_new = qmp_marshal_qom_list_types,
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06003714 },
Anthony Liguori1daa31b2012-08-10 11:04:09 -05003715
3716 {
3717 .name = "device-list-properties",
3718 .args_type = "typename:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003719 .mhandler.cmd_new = qmp_marshal_device_list_properties,
Anthony Liguori1daa31b2012-08-10 11:04:09 -05003720 },
3721
Anthony Liguori01d3c802012-08-10 11:04:11 -05003722 {
3723 .name = "query-machines",
3724 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003725 .mhandler.cmd_new = qmp_marshal_query_machines,
Anthony Liguori01d3c802012-08-10 11:04:11 -05003726 },
3727
Anthony Liguorie4e31c62012-08-10 11:04:13 -05003728 {
3729 .name = "query-cpu-definitions",
3730 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003731 .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
Anthony Liguorie4e31c62012-08-10 11:04:13 -05003732 },
3733
Daniel P. Berrange99afc912012-08-20 15:31:38 +01003734 {
3735 .name = "query-target",
3736 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003737 .mhandler.cmd_new = qmp_marshal_query_target,
Daniel P. Berrange99afc912012-08-20 15:31:38 +01003738 },
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003739
3740 {
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003741 .name = "query-tpm",
3742 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003743 .mhandler.cmd_new = qmp_marshal_query_tpm,
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003744 },
3745
Corey Bryant28c4fa32013-03-20 12:34:49 -04003746SQMP
3747query-tpm
3748---------
3749
3750Return information about the TPM device.
3751
3752Arguments: None
3753
3754Example:
3755
3756-> { "execute": "query-tpm" }
3757<- { "return":
3758 [
3759 { "model": "tpm-tis",
3760 "options":
3761 { "type": "passthrough",
3762 "data":
3763 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3764 "path": "/dev/tpm0"
3765 }
3766 },
3767 "id": "tpm0"
3768 }
3769 ]
3770 }
3771
3772EQMP
3773
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003774 {
3775 .name = "query-tpm-models",
3776 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003777 .mhandler.cmd_new = qmp_marshal_query_tpm_models,
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003778 },
3779
Corey Bryant28c4fa32013-03-20 12:34:49 -04003780SQMP
3781query-tpm-models
3782----------------
3783
3784Return a list of supported TPM models.
3785
3786Arguments: None
3787
3788Example:
3789
3790-> { "execute": "query-tpm-models" }
3791<- { "return": [ "tpm-tis" ] }
3792
3793EQMP
3794
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003795 {
3796 .name = "query-tpm-types",
3797 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003798 .mhandler.cmd_new = qmp_marshal_query_tpm_types,
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003799 },
3800
Corey Bryant28c4fa32013-03-20 12:34:49 -04003801SQMP
3802query-tpm-types
3803---------------
3804
3805Return a list of supported TPM types.
3806
3807Arguments: None
3808
3809Example:
3810
3811-> { "execute": "query-tpm-types" }
3812<- { "return": [ "passthrough" ] }
3813
3814EQMP
3815
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003816 {
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003817 .name = "chardev-add",
3818 .args_type = "id:s,backend:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003819 .mhandler.cmd_new = qmp_marshal_chardev_add,
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003820 },
3821
3822SQMP
3823chardev-add
3824----------------
3825
3826Add a chardev.
3827
3828Arguments:
3829
3830- "id": the chardev's ID, must be unique (json-string)
3831- "backend": chardev backend type + parameters
3832
Gerd Hoffmannffbdbe52012-12-19 13:13:57 +01003833Examples:
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003834
3835-> { "execute" : "chardev-add",
3836 "arguments" : { "id" : "foo",
3837 "backend" : { "type" : "null", "data" : {} } } }
3838<- { "return": {} }
3839
Gerd Hoffmannffbdbe52012-12-19 13:13:57 +01003840-> { "execute" : "chardev-add",
3841 "arguments" : { "id" : "bar",
3842 "backend" : { "type" : "file",
3843 "data" : { "out" : "/tmp/bar.log" } } } }
3844<- { "return": {} }
3845
Gerd Hoffmann0a1a7fa2012-12-20 14:39:13 +01003846-> { "execute" : "chardev-add",
3847 "arguments" : { "id" : "baz",
3848 "backend" : { "type" : "pty", "data" : {} } } }
3849<- { "return": { "pty" : "/dev/pty/42" } }
3850
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003851EQMP
3852
3853 {
3854 .name = "chardev-remove",
3855 .args_type = "id:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003856 .mhandler.cmd_new = qmp_marshal_chardev_remove,
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003857 },
3858
3859
3860SQMP
3861chardev-remove
3862--------------
3863
3864Remove a chardev.
3865
3866Arguments:
3867
3868- "id": the chardev's ID, must exist and not be in use (json-string)
3869
3870Example:
3871
3872-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3873<- { "return": {} }
3874
3875EQMP
Amos Kongb1be4282013-06-14 15:45:52 +08003876 {
3877 .name = "query-rx-filter",
3878 .args_type = "name:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003879 .mhandler.cmd_new = qmp_marshal_query_rx_filter,
Amos Kongb1be4282013-06-14 15:45:52 +08003880 },
3881
3882SQMP
3883query-rx-filter
3884---------------
3885
3886Show rx-filter information.
3887
3888Returns a json-array of rx-filter information for all NICs (or for the
3889given NIC), returning an error if the given NIC doesn't exist, or
3890given NIC doesn't support rx-filter querying, or given net client
3891isn't a NIC.
3892
3893The query will clear the event notification flag of each NIC, then qemu
3894will start to emit event to QMP monitor.
3895
3896Each array entry contains the following:
3897
3898- "name": net client name (json-string)
3899- "promiscuous": promiscuous mode is enabled (json-bool)
3900- "multicast": multicast receive state (one of 'normal', 'none', 'all')
3901- "unicast": unicast receive state (one of 'normal', 'none', 'all')
Amos Kongf7bc8ef2014-03-26 08:19:43 +08003902- "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
Amos Kongb1be4282013-06-14 15:45:52 +08003903- "broadcast-allowed": allow to receive broadcast (json-bool)
3904- "multicast-overflow": multicast table is overflowed (json-bool)
3905- "unicast-overflow": unicast table is overflowed (json-bool)
3906- "main-mac": main macaddr string (json-string)
3907- "vlan-table": a json-array of active vlan id
3908- "unicast-table": a json-array of unicast macaddr string
3909- "multicast-table": a json-array of multicast macaddr string
3910
3911Example:
3912
3913-> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3914<- { "return": [
3915 {
3916 "promiscuous": true,
3917 "name": "vnet0",
3918 "main-mac": "52:54:00:12:34:56",
3919 "unicast": "normal",
Amos Kongf7bc8ef2014-03-26 08:19:43 +08003920 "vlan": "normal",
Amos Kongb1be4282013-06-14 15:45:52 +08003921 "vlan-table": [
3922 4,
3923 0
3924 ],
3925 "unicast-table": [
3926 ],
3927 "multicast": "normal",
3928 "multicast-overflow": false,
3929 "unicast-overflow": false,
3930 "multicast-table": [
3931 "01:00:5e:00:00:01",
3932 "33:33:00:00:00:01",
3933 "33:33:ff:12:34:56"
3934 ],
3935 "broadcast-allowed": false
3936 }
3937 ]
3938 }
3939
3940EQMP
Kevin Wolfd26c9a12013-09-23 15:26:03 +02003941
3942 {
3943 .name = "blockdev-add",
3944 .args_type = "options:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003945 .mhandler.cmd_new = qmp_marshal_blockdev_add,
Kevin Wolfd26c9a12013-09-23 15:26:03 +02003946 },
3947
3948SQMP
3949blockdev-add
3950------------
3951
3952Add a block device.
3953
Markus Armbrusterda2cf4e2015-03-20 14:32:17 +01003954This command is still a work in progress. It doesn't support all
Alberto Garcia81b936a2015-11-02 16:51:55 +02003955block drivers among other things. Stay away from it unless you want
3956to help with its development.
Markus Armbrusterda2cf4e2015-03-20 14:32:17 +01003957
Kevin Wolfd26c9a12013-09-23 15:26:03 +02003958Arguments:
3959
3960- "options": block driver options
3961
3962Example (1):
3963
3964-> { "execute": "blockdev-add",
3965 "arguments": { "options" : { "driver": "qcow2",
3966 "file": { "driver": "file",
3967 "filename": "test.qcow2" } } } }
3968<- { "return": {} }
3969
3970Example (2):
3971
3972-> { "execute": "blockdev-add",
3973 "arguments": {
3974 "options": {
3975 "driver": "qcow2",
3976 "id": "my_disk",
3977 "discard": "unmap",
3978 "cache": {
3979 "direct": true,
3980 "writeback": true
3981 },
3982 "file": {
3983 "driver": "file",
3984 "filename": "/tmp/test.qcow2"
3985 },
3986 "backing": {
3987 "driver": "raw",
3988 "file": {
3989 "driver": "file",
3990 "filename": "/dev/fdset/4"
3991 }
3992 }
3993 }
3994 }
3995 }
3996
3997<- { "return": {} }
3998
3999EQMP
Benoît Canetc13163f2014-01-23 21:31:34 +01004000
4001 {
Alberto Garcia81b936a2015-11-02 16:51:55 +02004002 .name = "x-blockdev-del",
4003 .args_type = "id:s?,node-name:s?",
4004 .mhandler.cmd_new = qmp_marshal_x_blockdev_del,
4005 },
4006
4007SQMP
4008x-blockdev-del
4009------------
4010Since 2.5
4011
4012Deletes a block device thas has been added using blockdev-add.
4013The selected device can be either a block backend or a graph node.
4014
4015In the former case the backend will be destroyed, along with its
4016inserted medium if there's any. The command will fail if the backend
4017or its medium are in use.
4018
4019In the latter case the node will be destroyed. The command will fail
4020if the node is attached to a block backend or is otherwise being
4021used.
4022
4023One of "id" or "node-name" must be specified, but not both.
4024
4025This command is still a work in progress and is considered
4026experimental. Stay away from it unless you want to help with its
4027development.
4028
4029Arguments:
4030
4031- "id": Name of the block backend device to delete (json-string, optional)
4032- "node-name": Name of the graph node to delete (json-string, optional)
4033
4034Example:
4035
4036-> { "execute": "blockdev-add",
4037 "arguments": {
4038 "options": {
4039 "driver": "qcow2",
4040 "id": "drive0",
4041 "file": {
4042 "driver": "file",
4043 "filename": "test.qcow2"
4044 }
4045 }
4046 }
4047 }
4048
4049<- { "return": {} }
4050
4051-> { "execute": "x-blockdev-del",
4052 "arguments": { "id": "drive0" }
4053 }
4054<- { "return": {} }
4055
4056EQMP
4057
4058 {
Max Reitz7d8a9f72015-10-26 21:39:08 +01004059 .name = "blockdev-open-tray",
4060 .args_type = "device:s,force:b?",
4061 .mhandler.cmd_new = qmp_marshal_blockdev_open_tray,
4062 },
4063
4064SQMP
4065blockdev-open-tray
4066------------------
4067
4068Opens a block device's tray. If there is a block driver state tree inserted as a
4069medium, it will become inaccessible to the guest (but it will remain associated
4070to the block device, so closing the tray will make it accessible again).
4071
4072If the tray was already open before, this will be a no-op.
4073
4074Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4075which no such event will be generated, these include:
4076- if the guest has locked the tray, @force is false and the guest does not
4077 respond to the eject request
4078- if the BlockBackend denoted by @device does not have a guest device attached
4079 to it
4080- if the guest device does not have an actual tray and is empty, for instance
4081 for floppy disk drives
4082
4083Arguments:
4084
4085- "device": block device name (json-string)
4086- "force": if false (the default), an eject request will be sent to the guest if
4087 it has locked the tray (and the tray will not be opened immediately);
4088 if true, the tray will be opened regardless of whether it is locked
4089 (json-bool, optional)
4090
4091Example:
4092
4093-> { "execute": "blockdev-open-tray",
4094 "arguments": { "device": "ide1-cd0" } }
4095
4096<- { "timestamp": { "seconds": 1418751016,
4097 "microseconds": 716996 },
4098 "event": "DEVICE_TRAY_MOVED",
4099 "data": { "device": "ide1-cd0",
4100 "tray-open": true } }
4101
4102<- { "return": {} }
4103
4104EQMP
4105
4106 {
Max Reitzabaaf592015-10-26 21:39:09 +01004107 .name = "blockdev-close-tray",
4108 .args_type = "device:s",
4109 .mhandler.cmd_new = qmp_marshal_blockdev_close_tray,
4110 },
4111
4112SQMP
4113blockdev-close-tray
4114-------------------
4115
4116Closes a block device's tray. If there is a block driver state tree associated
4117with the block device (which is currently ejected), that tree will be loaded as
4118the medium.
4119
4120If the tray was already closed before, this will be a no-op.
4121
4122Arguments:
4123
4124- "device": block device name (json-string)
4125
4126Example:
4127
4128-> { "execute": "blockdev-close-tray",
4129 "arguments": { "device": "ide1-cd0" } }
4130
4131<- { "timestamp": { "seconds": 1418751345,
4132 "microseconds": 272147 },
4133 "event": "DEVICE_TRAY_MOVED",
4134 "data": { "device": "ide1-cd0",
4135 "tray-open": false } }
4136
4137<- { "return": {} }
4138
4139EQMP
4140
4141 {
Max Reitz2814f672015-10-26 21:39:10 +01004142 .name = "blockdev-remove-medium",
4143 .args_type = "device:s",
4144 .mhandler.cmd_new = qmp_marshal_blockdev_remove_medium,
4145 },
4146
4147SQMP
4148blockdev-remove-medium
4149----------------------
4150
4151Removes a medium (a block driver state tree) from a block device. That block
4152device's tray must currently be open (unless there is no attached guest device).
4153
4154If the tray is open and there is no medium inserted, this will be a no-op.
4155
4156Arguments:
4157
4158- "device": block device name (json-string)
4159
4160Example:
4161
4162-> { "execute": "blockdev-remove-medium",
4163 "arguments": { "device": "ide1-cd0" } }
4164
4165<- { "error": { "class": "GenericError",
4166 "desc": "Tray of device 'ide1-cd0' is not open" } }
4167
4168-> { "execute": "blockdev-open-tray",
4169 "arguments": { "device": "ide1-cd0" } }
4170
4171<- { "timestamp": { "seconds": 1418751627,
4172 "microseconds": 549958 },
4173 "event": "DEVICE_TRAY_MOVED",
4174 "data": { "device": "ide1-cd0",
4175 "tray-open": true } }
4176
4177<- { "return": {} }
4178
4179-> { "execute": "blockdev-remove-medium",
4180 "arguments": { "device": "ide1-cd0" } }
4181
4182<- { "return": {} }
4183
4184EQMP
4185
4186 {
Max Reitzd1299882015-10-26 21:39:11 +01004187 .name = "blockdev-insert-medium",
4188 .args_type = "device:s,node-name:s",
4189 .mhandler.cmd_new = qmp_marshal_blockdev_insert_medium,
4190 },
4191
4192SQMP
4193blockdev-insert-medium
4194----------------------
4195
4196Inserts a medium (a block driver state tree) into a block device. That block
4197device's tray must currently be open (unless there is no attached guest device)
4198and there must be no medium inserted already.
4199
4200Arguments:
4201
4202- "device": block device name (json-string)
4203- "node-name": root node of the BDS tree to insert into the block device
4204
4205Example:
4206
4207-> { "execute": "blockdev-add",
4208 "arguments": { "options": { "node-name": "node0",
4209 "driver": "raw",
4210 "file": { "driver": "file",
4211 "filename": "fedora.iso" } } } }
4212
4213<- { "return": {} }
4214
4215-> { "execute": "blockdev-insert-medium",
4216 "arguments": { "device": "ide1-cd0",
4217 "node-name": "node0" } }
4218
4219<- { "return": {} }
4220
4221EQMP
4222
4223 {
Benoît Canetc13163f2014-01-23 21:31:34 +01004224 .name = "query-named-block-nodes",
4225 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004226 .mhandler.cmd_new = qmp_marshal_query_named_block_nodes,
Benoît Canetc13163f2014-01-23 21:31:34 +01004227 },
4228
4229SQMP
4230@query-named-block-nodes
4231------------------------
4232
4233Return a list of BlockDeviceInfo for all the named block driver nodes
4234
4235Example:
4236
4237-> { "execute": "query-named-block-nodes" }
4238<- { "return": [ { "ro":false,
4239 "drv":"qcow2",
4240 "encrypted":false,
4241 "file":"disks/test.qcow2",
4242 "node-name": "my-node",
4243 "backing_file_depth":1,
4244 "bps":1000000,
4245 "bps_rd":0,
4246 "bps_wr":0,
4247 "iops":1000000,
4248 "iops_rd":0,
4249 "iops_wr":0,
4250 "bps_max": 8000000,
4251 "bps_rd_max": 0,
4252 "bps_wr_max": 0,
4253 "iops_max": 0,
4254 "iops_rd_max": 0,
4255 "iops_wr_max": 0,
4256 "iops_size": 0,
Francesco Romanie2462112015-01-12 14:11:13 +01004257 "write_threshold": 0,
Benoît Canetc13163f2014-01-23 21:31:34 +01004258 "image":{
4259 "filename":"disks/test.qcow2",
4260 "format":"qcow2",
4261 "virtual-size":2048000,
4262 "backing_file":"base.qcow2",
4263 "full-backing-filename":"disks/base.qcow2",
John Snow54034322015-04-28 15:20:41 -04004264 "backing-filename-format":"qcow2",
Benoît Canetc13163f2014-01-23 21:31:34 +01004265 "snapshots":[
4266 {
4267 "id": "1",
4268 "name": "snapshot1",
4269 "vm-state-size": 0,
4270 "date-sec": 10000200,
4271 "date-nsec": 12,
4272 "vm-clock-sec": 206,
4273 "vm-clock-nsec": 30
4274 }
4275 ],
4276 "backing-image":{
4277 "filename":"disks/base.qcow2",
4278 "format":"qcow2",
4279 "virtual-size":2048000
4280 }
Michael S. Tsirkinc0594512014-06-16 15:20:18 +03004281 } } ] }
Benoît Canetc13163f2014-01-23 21:31:34 +01004282
4283EQMP
Hu Tao76b5d852014-06-16 18:05:41 +08004284
4285 {
Max Reitz24fb4132015-11-06 16:27:06 +01004286 .name = "blockdev-change-medium",
Max Reitz39ff43d2015-11-11 04:49:44 +01004287 .args_type = "device:B,filename:F,format:s?,read-only-mode:s?",
Max Reitz24fb4132015-11-06 16:27:06 +01004288 .mhandler.cmd_new = qmp_marshal_blockdev_change_medium,
4289 },
4290
4291SQMP
4292blockdev-change-medium
4293----------------------
4294
4295Changes the medium inserted into a block device by ejecting the current medium
4296and loading a new image file which is inserted as the new medium.
4297
4298Arguments:
4299
4300- "device": device name (json-string)
4301- "filename": filename of the new image (json-string)
4302- "format": format of the new image (json-string, optional)
Max Reitz39ff43d2015-11-11 04:49:44 +01004303- "read-only-mode": new read-only mode (json-string, optional)
4304 - Possible values: "retain" (default), "read-only", "read-write"
Max Reitz24fb4132015-11-06 16:27:06 +01004305
4306Examples:
4307
43081. Change a removable medium
4309
4310-> { "execute": "blockdev-change-medium",
4311 "arguments": { "device": "ide1-cd0",
4312 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4313 "format": "raw" } }
4314<- { "return": {} }
4315
Max Reitz39ff43d2015-11-11 04:49:44 +010043162. Load a read-only medium into a writable drive
4317
4318-> { "execute": "blockdev-change-medium",
4319 "arguments": { "device": "isa-fd0",
4320 "filename": "/srv/images/ro.img",
4321 "format": "raw",
4322 "read-only-mode": "retain" } }
4323
4324<- { "error":
4325 { "class": "GenericError",
4326 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4327
4328-> { "execute": "blockdev-change-medium",
4329 "arguments": { "device": "isa-fd0",
4330 "filename": "/srv/images/ro.img",
4331 "format": "raw",
4332 "read-only-mode": "read-only" } }
4333
4334<- { "return": {} }
4335
Max Reitz24fb4132015-11-06 16:27:06 +01004336EQMP
4337
4338 {
Hu Tao76b5d852014-06-16 18:05:41 +08004339 .name = "query-memdev",
4340 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004341 .mhandler.cmd_new = qmp_marshal_query_memdev,
Hu Tao76b5d852014-06-16 18:05:41 +08004342 },
4343
4344SQMP
4345query-memdev
4346------------
4347
4348Show memory devices information.
4349
4350
4351Example (1):
4352
4353-> { "execute": "query-memdev" }
4354<- { "return": [
4355 {
4356 "size": 536870912,
4357 "merge": false,
4358 "dump": true,
4359 "prealloc": false,
4360 "host-nodes": [0, 1],
4361 "policy": "bind"
4362 },
4363 {
4364 "size": 536870912,
4365 "merge": false,
4366 "dump": true,
4367 "prealloc": true,
4368 "host-nodes": [2, 3],
4369 "policy": "preferred"
4370 }
4371 ]
4372 }
4373
4374EQMP
Igor Mammedov6f2e2732014-06-16 19:12:25 +02004375
4376 {
4377 .name = "query-memory-devices",
4378 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004379 .mhandler.cmd_new = qmp_marshal_query_memory_devices,
Igor Mammedov6f2e2732014-06-16 19:12:25 +02004380 },
4381
4382SQMP
4383@query-memory-devices
4384--------------------
4385
4386Return a list of memory devices.
4387
4388Example:
4389-> { "execute": "query-memory-devices" }
4390<- { "return": [ { "data":
4391 { "addr": 5368709120,
4392 "hotpluggable": true,
4393 "hotplugged": true,
4394 "id": "d1",
4395 "memdev": "/objects/memX",
4396 "node": 0,
4397 "size": 1073741824,
4398 "slot": 0},
4399 "type": "dimm"
4400 } ] }
4401EQMP
Igor Mammedov02419bc2014-06-16 19:12:28 +02004402
4403 {
4404 .name = "query-acpi-ospm-status",
4405 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004406 .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status,
Igor Mammedov02419bc2014-06-16 19:12:28 +02004407 },
4408
4409SQMP
4410@query-acpi-ospm-status
4411--------------------
4412
4413Return list of ACPIOSTInfo for devices that support status reporting
4414via ACPI _OST method.
4415
4416Example:
4417-> { "execute": "query-acpi-ospm-status" }
4418<- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4419 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4420 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4421 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4422 ]}
4423EQMP
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004424
4425#if defined TARGET_I386
4426 {
4427 .name = "rtc-reset-reinjection",
4428 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004429 .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection,
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004430 },
4431#endif
4432
4433SQMP
4434rtc-reset-reinjection
4435---------------------
4436
4437Reset the RTC interrupt reinjection backlog.
4438
4439Arguments: None.
4440
4441Example:
4442
4443-> { "execute": "rtc-reset-reinjection" }
4444<- { "return": {} }
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004445EQMP
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004446
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004447 {
4448 .name = "trace-event-get-state",
4449 .args_type = "name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004450 .mhandler.cmd_new = qmp_marshal_trace_event_get_state,
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004451 },
4452
4453SQMP
4454trace-event-get-state
4455---------------------
4456
4457Query the state of events.
4458
4459Example:
4460
4461-> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4462<- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4463EQMP
4464
4465 {
4466 .name = "trace-event-set-state",
4467 .args_type = "name:s,enable:b,ignore-unavailable:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004468 .mhandler.cmd_new = qmp_marshal_trace_event_set_state,
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004469 },
4470
4471SQMP
4472trace-event-set-state
4473---------------------
4474
4475Set the state of events.
4476
4477Example:
4478
4479-> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4480<- { "return": {} }
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004481EQMP
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004482
4483 {
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004484 .name = "x-input-send-event",
Amos Kong51fc4472014-11-07 12:41:25 +08004485 .args_type = "console:i?,events:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004486 .mhandler.cmd_new = qmp_marshal_x_input_send_event,
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004487 },
4488
4489SQMP
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004490@x-input-send-event
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004491-----------------
4492
4493Send input event to guest.
4494
4495Arguments:
4496
Amos Kong51fc4472014-11-07 12:41:25 +08004497- "console": console index. (json-int, optional)
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004498- "events": list of input events.
4499
4500The consoles are visible in the qom tree, under
4501/backend/console[$index]. They have a device link and head property, so
4502it is possible to map which console belongs to which device and display.
4503
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004504Note: this command is experimental, and not a stable API.
4505
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004506Example (1):
4507
4508Press left mouse button.
4509
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004510-> { "execute": "x-input-send-event",
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004511 "arguments": { "console": 0,
4512 "events": [ { "type": "btn",
Amos Kongb5369dd2014-11-25 16:05:56 +08004513 "data" : { "down": true, "button": "Left" } } ] } }
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004514<- { "return": {} }
4515
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004516-> { "execute": "x-input-send-event",
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004517 "arguments": { "console": 0,
4518 "events": [ { "type": "btn",
Amos Kongb5369dd2014-11-25 16:05:56 +08004519 "data" : { "down": false, "button": "Left" } } ] } }
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004520<- { "return": {} }
4521
4522Example (2):
4523
4524Press ctrl-alt-del.
4525
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004526-> { "execute": "x-input-send-event",
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004527 "arguments": { "console": 0, "events": [
4528 { "type": "key", "data" : { "down": true,
4529 "key": {"type": "qcode", "data": "ctrl" } } },
4530 { "type": "key", "data" : { "down": true,
4531 "key": {"type": "qcode", "data": "alt" } } },
4532 { "type": "key", "data" : { "down": true,
4533 "key": {"type": "qcode", "data": "delete" } } } ] } }
4534<- { "return": {} }
4535
4536Example (3):
4537
4538Move mouse pointer to absolute coordinates (20000, 400).
4539
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004540-> { "execute": "x-input-send-event" ,
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004541 "arguments": { "console": 0, "events": [
4542 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
4543 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
4544<- { "return": {} }
4545
4546EQMP
Francesco Romanie2462112015-01-12 14:11:13 +01004547
4548 {
4549 .name = "block-set-write-threshold",
4550 .args_type = "node-name:s,write-threshold:l",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004551 .mhandler.cmd_new = qmp_marshal_block_set_write_threshold,
Francesco Romanie2462112015-01-12 14:11:13 +01004552 },
4553
4554SQMP
4555block-set-write-threshold
4556------------
4557
4558Change the write threshold for a block drive. The threshold is an offset,
4559thus must be non-negative. Default is no write threshold.
4560Setting the threshold to zero disables it.
4561
4562Arguments:
4563
4564- "node-name": the node name in the block driver state graph (json-string)
4565- "write-threshold": the write threshold in bytes (json-int)
4566
4567Example:
4568
4569-> { "execute": "block-set-write-threshold",
4570 "arguments": { "node-name": "mydev",
4571 "write-threshold": 17179869184 } }
4572<- { "return": {} }
4573
4574EQMP
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004575
4576 {
4577 .name = "query-rocker",
4578 .args_type = "name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004579 .mhandler.cmd_new = qmp_marshal_query_rocker,
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004580 },
4581
4582SQMP
4583Show rocker switch
4584------------------
4585
4586Arguments:
4587
4588- "name": switch name
4589
4590Example:
4591
4592-> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4593<- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4594
4595EQMP
4596
4597 {
4598 .name = "query-rocker-ports",
4599 .args_type = "name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004600 .mhandler.cmd_new = qmp_marshal_query_rocker_ports,
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004601 },
4602
4603SQMP
4604Show rocker switch ports
4605------------------------
4606
4607Arguments:
4608
4609- "name": switch name
4610
4611Example:
4612
4613-> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4614<- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4615 "autoneg": "off", "link-up": true, "speed": 10000},
4616 {"duplex": "full", "enabled": true, "name": "sw1.2",
4617 "autoneg": "off", "link-up": true, "speed": 10000}
4618 ]}
4619
4620EQMP
4621
4622 {
4623 .name = "query-rocker-of-dpa-flows",
4624 .args_type = "name:s,tbl-id:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004625 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows,
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004626 },
4627
4628SQMP
4629Show rocker switch OF-DPA flow tables
4630-------------------------------------
4631
4632Arguments:
4633
4634- "name": switch name
4635- "tbl-id": (optional) flow table ID
4636
4637Example:
4638
4639-> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4640<- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4641 "hits": 138,
4642 "cookie": 0,
4643 "action": {"goto-tbl": 10},
4644 "mask": {"in-pport": 4294901760}
4645 },
4646 {...more...},
4647 ]}
4648
4649EQMP
4650
4651 {
4652 .name = "query-rocker-of-dpa-groups",
4653 .args_type = "name:s,type:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004654 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups,
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004655 },
4656
4657SQMP
4658Show rocker OF-DPA group tables
4659-------------------------------
4660
4661Arguments:
4662
4663- "name": switch name
4664- "type": (optional) group type
4665
4666Example:
4667
4668-> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4669<- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4670 "pop-vlan": 1, "id": 251723778},
4671 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4672 "pop-vlan": 1, "id": 251723776},
4673 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4674 "pop-vlan": 1, "id": 251658241},
4675 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4676 "pop-vlan": 1, "id": 251658240}
4677 ]}