blob: 7c74e20087a20cc5a7582fe80c2a43adf64ba4fe [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
324- "id": the device's ID (json-string)
325
326Example:
327
328-> { "execute": "device_del", "arguments": { "id": "net1" } }
329<- { "return": {} }
330
331EQMP
332
333 {
Amos Konge4c8f002012-08-31 10:56:26 +0800334 .name = "send-key",
Paolo Bonzini43d0a2c2015-04-15 13:30:04 +0200335 .args_type = "keys:q,hold-time:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200336 .mhandler.cmd_new = qmp_marshal_send_key,
Amos Konge4c8f002012-08-31 10:56:26 +0800337 },
338
339SQMP
340send-key
341----------
342
343Send keys to VM.
344
345Arguments:
346
347keys array:
Amos Kongf9b1d9b2013-07-16 19:52:14 +0800348 - "key": key sequence (a json-array of key union values,
349 union can be number or qcode enum)
Amos Konge4c8f002012-08-31 10:56:26 +0800350
351- hold-time: time to delay key up events, milliseconds. Defaults to 100
352 (json-int, optional)
353
354Example:
355
356-> { "execute": "send-key",
Amos Kongf9b1d9b2013-07-16 19:52:14 +0800357 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
358 { "type": "qcode", "data": "alt" },
359 { "type": "qcode", "data": "delete" } ] } }
Amos Konge4c8f002012-08-31 10:56:26 +0800360<- { "return": {} }
361
362EQMP
363
364 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300365 .name = "cpu",
366 .args_type = "index:i",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200367 .mhandler.cmd_new = qmp_marshal_cpu,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300368 },
369
370SQMP
371cpu
372---
373
374Set the default CPU.
375
376Arguments:
377
378- "index": the CPU's index (json-int)
379
380Example:
381
382-> { "execute": "cpu", "arguments": { "index": 0 } }
383<- { "return": {} }
384
385Note: CPUs' indexes are obtained with the 'query-cpus' command.
386
387EQMP
388
389 {
Igor Mammedov69ca3ea2013-04-30 15:41:25 +0200390 .name = "cpu-add",
391 .args_type = "id:i",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200392 .mhandler.cmd_new = qmp_marshal_cpu_add,
Igor Mammedov69ca3ea2013-04-30 15:41:25 +0200393 },
394
395SQMP
396cpu-add
397-------
398
399Adds virtual cpu
400
401Arguments:
402
403- "id": cpu id (json-int)
404
405Example:
406
407-> { "execute": "cpu-add", "arguments": { "id": 2 } }
408<- { "return": {} }
409
410EQMP
411
412 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300413 .name = "memsave",
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200414 .args_type = "val:l,size:i,filename:s,cpu:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200415 .mhandler.cmd_new = qmp_marshal_memsave,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300416 },
417
418SQMP
419memsave
420-------
421
422Save to disk virtual memory dump starting at 'val' of size 'size'.
423
424Arguments:
425
426- "val": the starting address (json-int)
427- "size": the memory size, in bytes (json-int)
428- "filename": file path (json-string)
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200429- "cpu": virtual CPU index (json-int, optional)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300430
431Example:
432
433-> { "execute": "memsave",
434 "arguments": { "val": 10,
435 "size": 100,
436 "filename": "/tmp/virtual-mem-dump" } }
437<- { "return": {} }
438
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300439EQMP
440
441 {
442 .name = "pmemsave",
443 .args_type = "val:l,size:i,filename:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200444 .mhandler.cmd_new = qmp_marshal_pmemsave,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300445 },
446
447SQMP
448pmemsave
449--------
450
451Save to disk physical memory dump starting at 'val' of size 'size'.
452
453Arguments:
454
455- "val": the starting address (json-int)
456- "size": the memory size, in bytes (json-int)
457- "filename": file path (json-string)
458
459Example:
460
461-> { "execute": "pmemsave",
462 "arguments": { "val": 10,
463 "size": 100,
464 "filename": "/tmp/physical-mem-dump" } }
465<- { "return": {} }
466
467EQMP
468
469 {
Lai Jiangshana4046662011-03-07 17:05:15 +0800470 .name = "inject-nmi",
471 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200472 .mhandler.cmd_new = qmp_marshal_inject_nmi,
Lai Jiangshana4046662011-03-07 17:05:15 +0800473 },
474
475SQMP
476inject-nmi
477----------
478
Alexey Kardashevskiy9cb805f2014-08-20 22:16:33 +1000479Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
Lai Jiangshana4046662011-03-07 17:05:15 +0800480
481Arguments: None.
482
483Example:
484
485-> { "execute": "inject-nmi" }
486<- { "return": {} }
487
Luiz Capitulinode253f12012-07-27 16:18:16 -0300488Note: inject-nmi fails when the guest doesn't support injecting.
Lai Jiangshana4046662011-03-07 17:05:15 +0800489
490EQMP
491
492 {
Markus Armbruster3949e592013-02-06 21:27:24 +0100493 .name = "ringbuf-write",
Markus Armbruster82e59a62013-02-06 21:27:14 +0100494 .args_type = "device:s,data:s,format:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200495 .mhandler.cmd_new = qmp_marshal_ringbuf_write,
Lei Li1f590cf2013-01-25 00:03:20 +0800496 },
497
498SQMP
Markus Armbruster3949e592013-02-06 21:27:24 +0100499ringbuf-write
Lei Li1f590cf2013-01-25 00:03:20 +0800500-------------
501
Markus Armbruster3949e592013-02-06 21:27:24 +0100502Write to a ring buffer character device.
Lei Li1f590cf2013-01-25 00:03:20 +0800503
504Arguments:
505
Markus Armbruster3949e592013-02-06 21:27:24 +0100506- "device": ring buffer character device name (json-string)
507- "data": data to write (json-string)
508- "format": data format (json-string, optional)
509 - Possible values: "utf8" (default), "base64"
510 Bug: invalid base64 is currently not rejected.
511 Whitespace *is* invalid.
Lei Li1f590cf2013-01-25 00:03:20 +0800512
513Example:
514
Markus Armbruster3949e592013-02-06 21:27:24 +0100515-> { "execute": "ringbuf-write",
516 "arguments": { "device": "foo",
Lei Li1f590cf2013-01-25 00:03:20 +0800517 "data": "abcdefgh",
518 "format": "utf8" } }
519<- { "return": {} }
520
521EQMP
522
523 {
Markus Armbruster3949e592013-02-06 21:27:24 +0100524 .name = "ringbuf-read",
Lei Li49b6d722013-01-25 00:03:21 +0800525 .args_type = "device:s,size:i,format:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200526 .mhandler.cmd_new = qmp_marshal_ringbuf_read,
Lei Li49b6d722013-01-25 00:03:21 +0800527 },
528
529SQMP
Markus Armbruster3949e592013-02-06 21:27:24 +0100530ringbuf-read
Lei Li49b6d722013-01-25 00:03:21 +0800531-------------
532
Markus Armbruster3949e592013-02-06 21:27:24 +0100533Read from a ring buffer character device.
Lei Li49b6d722013-01-25 00:03:21 +0800534
535Arguments:
536
Markus Armbruster3949e592013-02-06 21:27:24 +0100537- "device": ring buffer character device name (json-string)
538- "size": how many bytes to read at most (json-int)
539 - Number of data bytes, not number of characters in encoded data
540- "format": data format (json-string, optional)
541 - Possible values: "utf8" (default), "base64"
542 - Naturally, format "utf8" works only when the ring buffer
543 contains valid UTF-8 text. Invalid UTF-8 sequences get
544 replaced. Bug: replacement doesn't work. Bug: can screw
545 up on encountering NUL characters, after the ring buffer
546 lost data, and when reading stops because the size limit
547 is reached.
Lei Li49b6d722013-01-25 00:03:21 +0800548
549Example:
550
Markus Armbruster3949e592013-02-06 21:27:24 +0100551-> { "execute": "ringbuf-read",
552 "arguments": { "device": "foo",
Lei Li49b6d722013-01-25 00:03:21 +0800553 "size": 1000,
554 "format": "utf8" } }
Markus Armbruster3ab651f2013-02-06 21:27:15 +0100555<- {"return": "abcdefgh"}
Lei Li49b6d722013-01-25 00:03:21 +0800556
557EQMP
558
559 {
Stefano Stabellinia7ae8352012-01-25 12:24:51 +0000560 .name = "xen-save-devices-state",
561 .args_type = "filename:F",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200562 .mhandler.cmd_new = qmp_marshal_xen_save_devices_state,
Stefano Stabellinia7ae8352012-01-25 12:24:51 +0000563 },
564
565SQMP
566xen-save-devices-state
567-------
568
569Save the state of all devices to file. The RAM and the block devices
570of the VM are not saved by this command.
571
572Arguments:
573
574- "filename": the file to save the state of the devices to as binary
575data. See xen-save-devices-state.txt for a description of the binary
576format.
577
578Example:
579
580-> { "execute": "xen-save-devices-state",
581 "arguments": { "filename": "/tmp/save" } }
582<- { "return": {} }
583
584EQMP
585
586 {
Anthony PERARD39f42432012-10-03 13:48:19 +0000587 .name = "xen-set-global-dirty-log",
588 .args_type = "enable:b",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200589 .mhandler.cmd_new = qmp_marshal_xen_set_global_dirty_log,
Anthony PERARD39f42432012-10-03 13:48:19 +0000590 },
591
592SQMP
593xen-set-global-dirty-log
594-------
595
596Enable or disable the global dirty log mode.
597
598Arguments:
599
600- "enable": Enable it or disable it.
601
602Example:
603
604-> { "execute": "xen-set-global-dirty-log",
605 "arguments": { "enable": true } }
606<- { "return": {} }
607
608EQMP
609
610 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300611 .name = "migrate",
612 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200613 .mhandler.cmd_new = qmp_marshal_migrate,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300614 },
615
616SQMP
617migrate
618-------
619
620Migrate to URI.
621
622Arguments:
623
624- "blk": block migration, full disk copy (json-bool, optional)
625- "inc": incremental disk copy (json-bool, optional)
626- "uri": Destination URI (json-string)
627
628Example:
629
630-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
631<- { "return": {} }
632
633Notes:
634
635(1) The 'query-migrate' command should be used to check migration's progress
636 and final result (this information is provided by the 'status' member)
637(2) All boolean arguments default to false
638(3) The user Monitor's "detach" argument is invalid in QMP and should not
639 be used
640
641EQMP
642
643 {
644 .name = "migrate_cancel",
645 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200646 .mhandler.cmd_new = qmp_marshal_migrate_cancel,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300647 },
648
649SQMP
650migrate_cancel
651--------------
652
653Cancel the current migration.
654
655Arguments: None.
656
657Example:
658
659-> { "execute": "migrate_cancel" }
660<- { "return": {} }
661
662EQMP
Dr. David Alan Gilbertbf1ae1f2015-02-19 11:40:28 +0000663
664 {
665 .name = "migrate-incoming",
666 .args_type = "uri:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200667 .mhandler.cmd_new = qmp_marshal_migrate_incoming,
Dr. David Alan Gilbertbf1ae1f2015-02-19 11:40:28 +0000668 },
669
670SQMP
671migrate-incoming
672----------------
673
674Continue an incoming migration
675
676Arguments:
677
678- "uri": Source/listening URI (json-string)
679
680Example:
681
682-> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
683<- { "return": {} }
684
685Notes:
686
687(1) QEMU must be started with -incoming defer to allow migrate-incoming to
688 be used
Dr. David Alan Gilbert4aab6282015-06-03 19:43:56 +0100689(2) The uri format is the same as for -incoming
Dr. David Alan Gilbertbf1ae1f2015-02-19 11:40:28 +0000690
691EQMP
692 {
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300693 .name = "migrate-set-cache-size",
694 .args_type = "value:o",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200695 .mhandler.cmd_new = qmp_marshal_migrate_set_cache_size,
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300696 },
697
698SQMP
699migrate-set-cache-size
Juan Quintela817c6042013-02-11 15:11:10 +0100700----------------------
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300701
702Set cache size to be used by XBZRLE migration, the cache size will be rounded
703down to the nearest power of 2
704
705Arguments:
706
707- "value": cache size in bytes (json-int)
708
709Example:
710
711-> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
712<- { "return": {} }
713
714EQMP
715 {
716 .name = "query-migrate-cache-size",
717 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200718 .mhandler.cmd_new = qmp_marshal_query_migrate_cache_size,
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300719 },
720
721SQMP
722query-migrate-cache-size
Juan Quintela817c6042013-02-11 15:11:10 +0100723------------------------
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300724
725Show cache size to be used by XBZRLE migration
726
727returns a json-object with the following information:
728- "size" : json-int
729
730Example:
731
732-> { "execute": "query-migrate-cache-size" }
733<- { "return": 67108864 }
734
735EQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300736
737 {
738 .name = "migrate_set_speed",
Wen Congyang3a019b62010-11-25 09:06:05 +0800739 .args_type = "value:o",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200740 .mhandler.cmd_new = qmp_marshal_migrate_set_speed,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300741 },
742
743SQMP
744migrate_set_speed
745-----------------
746
747Set maximum speed for migrations.
748
749Arguments:
750
Luiz Capitulino5569fd72010-12-15 17:56:18 -0200751- "value": maximum speed, in bytes per second (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300752
753Example:
754
755-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
756<- { "return": {} }
757
758EQMP
759
760 {
761 .name = "migrate_set_downtime",
762 .args_type = "value:T",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200763 .mhandler.cmd_new = qmp_marshal_migrate_set_downtime,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300764 },
765
766SQMP
767migrate_set_downtime
768--------------------
769
770Set maximum tolerated downtime (in seconds) for migrations.
771
772Arguments:
773
774- "value": maximum downtime (json-number)
775
776Example:
777
778-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
779<- { "return": {} }
780
781EQMP
782
783 {
Jes Sorensenff73edf2011-03-09 14:31:06 +0100784 .name = "client_migrate_info",
785 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
786 .params = "protocol hostname port tls-port cert-subject",
Markus Armbruster13cadef2015-03-05 19:16:58 +0100787 .help = "set migration information for remote display",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200788 .mhandler.cmd_new = qmp_marshal_client_migrate_info,
Jes Sorensenff73edf2011-03-09 14:31:06 +0100789 },
790
791SQMP
792client_migrate_info
Markus Armbruster13cadef2015-03-05 19:16:58 +0100793-------------------
Jes Sorensenff73edf2011-03-09 14:31:06 +0100794
Markus Armbruster13cadef2015-03-05 19:16:58 +0100795Set migration information for remote display. This makes the server
796ask the client to automatically reconnect using the new parameters
797once migration finished successfully. Only implemented for SPICE.
Jes Sorensenff73edf2011-03-09 14:31:06 +0100798
799Arguments:
800
Markus Armbruster13cadef2015-03-05 19:16:58 +0100801- "protocol": must be "spice" (json-string)
Jes Sorensenff73edf2011-03-09 14:31:06 +0100802- "hostname": migration target hostname (json-string)
Markus Armbruster13cadef2015-03-05 19:16:58 +0100803- "port": spice tcp port for plaintext channels (json-int, optional)
Jes Sorensenff73edf2011-03-09 14:31:06 +0100804- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
805- "cert-subject": server certificate subject (json-string, optional)
806
807Example:
808
809-> { "execute": "client_migrate_info",
810 "arguments": { "protocol": "spice",
811 "hostname": "virt42.lab.kraxel.org",
812 "port": 1234 } }
813<- { "return": {} }
814
815EQMP
816
817 {
Wen Congyang783e9b42012-05-07 12:10:47 +0800818 .name = "dump-guest-memory",
qiaonuohanb53ccc32014-02-18 14:11:36 +0800819 .args_type = "paging:b,protocol:s,begin:i?,end:i?,format:s?",
820 .params = "-p protocol [begin] [length] [format]",
Wen Congyang783e9b42012-05-07 12:10:47 +0800821 .help = "dump guest memory to file",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200822 .mhandler.cmd_new = qmp_marshal_dump_guest_memory,
Wen Congyang783e9b42012-05-07 12:10:47 +0800823 },
824
825SQMP
826dump
827
828
829Dump guest memory to file. The file can be processed with crash or gdb.
830
831Arguments:
832
833- "paging": do paging to get guest's memory mapping (json-bool)
834- "protocol": destination file(started with "file:") or destination file
835 descriptor (started with "fd:") (json-string)
836- "begin": the starting physical address. It's optional, and should be specified
837 with length together (json-int)
838- "length": the memory size, in bytes. It's optional, and should be specified
839 with begin together (json-int)
qiaonuohanb53ccc32014-02-18 14:11:36 +0800840- "format": the format of guest memory dump. It's optional, and can be
841 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
842 conflict with paging and filter, ie. begin and length (json-string)
Wen Congyang783e9b42012-05-07 12:10:47 +0800843
844Example:
845
846-> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
847<- { "return": {} }
848
849Notes:
850
851(1) All boolean arguments default to false
852
853EQMP
854
855 {
qiaonuohan7d6dc7f2014-02-18 14:11:38 +0800856 .name = "query-dump-guest-memory-capability",
857 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200858 .mhandler.cmd_new = qmp_marshal_query_dump_guest_memory_capability,
qiaonuohan7d6dc7f2014-02-18 14:11:38 +0800859 },
860
861SQMP
862query-dump-guest-memory-capability
863----------
864
865Show available formats for 'dump-guest-memory'
866
867Example:
868
869-> { "execute": "query-dump-guest-memory-capability" }
870<- { "return": { "formats":
871 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
872
873EQMP
874
Jason J. Herne7ee0c3e2015-06-26 14:03:16 -0400875#if defined TARGET_S390X
876 {
877 .name = "dump-skeys",
878 .args_type = "filename:F",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200879 .mhandler.cmd_new = qmp_marshal_dump_skeys,
Jason J. Herne7ee0c3e2015-06-26 14:03:16 -0400880 },
881#endif
882
883SQMP
884dump-skeys
885----------
886
887Save guest storage keys to file.
888
889Arguments:
890
891- "filename": file path (json-string)
892
893Example:
894
895-> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
896<- { "return": {} }
897
898EQMP
899
qiaonuohan7d6dc7f2014-02-18 14:11:38 +0800900 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300901 .name = "netdev_add",
902 .args_type = "netdev:O",
Luiz Capitulino928059a2012-04-18 17:34:15 -0300903 .mhandler.cmd_new = qmp_netdev_add,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300904 },
905
906SQMP
907netdev_add
908----------
909
910Add host network device.
911
912Arguments:
913
914- "type": the device type, "tap", "user", ... (json-string)
915- "id": the device's ID, must be unique (json-string)
916- device options
917
918Example:
919
920-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
921<- { "return": {} }
922
Markus Armbrusteraf347aa2013-02-22 18:31:51 +0100923Note: The supported device options are the same ones supported by the '-netdev'
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300924 command-line argument, which are listed in the '-help' output or QEMU's
925 manual
926
927EQMP
928
929 {
930 .name = "netdev_del",
931 .args_type = "id:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200932 .mhandler.cmd_new = qmp_marshal_netdev_del,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300933 },
934
935SQMP
936netdev_del
937----------
938
939Remove host network device.
940
941Arguments:
942
943- "id": the device's ID, must be unique (json-string)
944
945Example:
946
947-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
948<- { "return": {} }
949
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100950
951EQMP
952
953 {
Paolo Bonzinicff8b2c2013-12-20 23:21:10 +0100954 .name = "object-add",
955 .args_type = "qom-type:s,id:s,props:q?",
Markus Armbruster6eb39372015-09-16 13:06:25 +0200956 .mhandler.cmd_new = qmp_marshal_object_add,
Paolo Bonzinicff8b2c2013-12-20 23:21:10 +0100957 },
958
959SQMP
960object-add
961----------
962
963Create QOM object.
964
965Arguments:
966
967- "qom-type": the object's QOM type, i.e. the class name (json-string)
968- "id": the object's ID, must be unique (json-string)
969- "props": a dictionary of object property values (optional, json-dict)
970
971Example:
972
973-> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
974 "props": { "filename": "/dev/hwrng" } } }
975<- { "return": {} }
976
977EQMP
978
979 {
Paolo Bonziniab2d0532013-12-20 23:21:09 +0100980 .name = "object-del",
981 .args_type = "id:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200982 .mhandler.cmd_new = qmp_marshal_object_del,
Paolo Bonziniab2d0532013-12-20 23:21:09 +0100983 },
984
985SQMP
986object-del
987----------
988
989Remove QOM object.
990
991Arguments:
992
993- "id": the object's ID (json-string)
994
995Example:
996
997-> { "execute": "object-del", "arguments": { "id": "rng1" } }
998<- { "return": {} }
999
1000
1001EQMP
1002
1003
1004 {
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +01001005 .name = "block_resize",
Benoît Canet3b1dbd12014-01-23 21:31:37 +01001006 .args_type = "device:s?,node-name:s?,size:o",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001007 .mhandler.cmd_new = qmp_marshal_block_resize,
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +01001008 },
1009
1010SQMP
1011block_resize
1012------------
1013
1014Resize a block image while a guest is running.
1015
1016Arguments:
1017
1018- "device": the device's ID, must be unique (json-string)
Benoît Canet3b1dbd12014-01-23 21:31:37 +01001019- "node-name": the node name in the block driver state graph (json-string)
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +01001020- "size": new size
1021
1022Example:
1023
1024-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1025<- { "return": {} }
1026
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001027EQMP
1028
1029 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001030 .name = "block-stream",
Jeff Cody13d8cc52014-06-25 15:40:11 -04001031 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001032 .mhandler.cmd_new = qmp_marshal_block_stream,
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001033 },
1034
Stefan Hajnocziec683d62015-04-15 11:43:42 +01001035SQMP
1036block-stream
1037------------
1038
1039Copy data from a backing file into a block device.
1040
1041Arguments:
1042
1043- "device": The device's ID, must be unique (json-string)
1044- "base": The file name of the backing image above which copying starts
1045 (json-string, optional)
1046- "backing-file": The backing file string to write into the active layer. This
1047 filename is not validated.
1048
1049 If a pathname string is such that it cannot be resolved by
1050 QEMU, that means that subsequent QMP or HMP commands must use
1051 node-names for the image in question, as filename lookup
1052 methods will fail.
1053
1054 If not specified, QEMU will automatically determine the
1055 backing file string to use, or error out if there is no
1056 obvious choice. Care should be taken when specifying the
1057 string, to specify a valid filename or protocol.
1058 (json-string, optional) (Since 2.1)
1059- "speed": the maximum speed, in bytes per second (json-int, optional)
1060- "on-error": the action to take on an error (default 'report'). 'stop' and
1061 'enospc' can only be used if the block device supports io-status.
1062 (json-string, optional) (Since 2.1)
1063
1064Example:
1065
1066-> { "execute": "block-stream", "arguments": { "device": "virtio0",
1067 "base": "/tmp/master.qcow2" } }
1068<- { "return": {} }
1069
1070EQMP
1071
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001072 {
Jeff Codyed61fc12012-09-27 13:29:16 -04001073 .name = "block-commit",
Jeff Cody54e26902014-06-25 15:40:10 -04001074 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001075 .mhandler.cmd_new = qmp_marshal_block_commit,
Jeff Codyed61fc12012-09-27 13:29:16 -04001076 },
1077
Jeff Cody37222902014-01-24 09:02:37 -05001078SQMP
1079block-commit
1080------------
1081
1082Live commit of data from overlay image nodes into backing nodes - i.e., writes
1083data between 'top' and 'base' into 'base'.
1084
1085Arguments:
1086
1087- "device": The device's ID, must be unique (json-string)
1088- "base": The file name of the backing image to write data into.
1089 If not specified, this is the deepest backing image
1090 (json-string, optional)
1091- "top": The file name of the backing image within the image chain,
Jeff Cody7676e2c2014-06-30 15:14:15 +02001092 which contains the topmost data to be committed down. If
1093 not specified, this is the active layer. (json-string, optional)
Jeff Cody37222902014-01-24 09:02:37 -05001094
Jeff Cody54e26902014-06-25 15:40:10 -04001095- backing-file: The backing file string to write into the overlay
1096 image of 'top'. If 'top' is the active layer,
1097 specifying a backing file string is an error. This
1098 filename is not validated.
1099
1100 If a pathname string is such that it cannot be
1101 resolved by QEMU, that means that subsequent QMP or
1102 HMP commands must use node-names for the image in
1103 question, as filename lookup methods will fail.
1104
1105 If not specified, QEMU will automatically determine
1106 the backing file string to use, or error out if
1107 there is no obvious choice. Care should be taken
1108 when specifying the string, to specify a valid
1109 filename or protocol.
1110 (json-string, optional) (Since 2.1)
1111
Jeff Cody37222902014-01-24 09:02:37 -05001112 If top == base, that is an error.
1113 If top == active, the job will not be completed by itself,
1114 user needs to complete the job with the block-job-complete
1115 command after getting the ready event. (Since 2.0)
1116
1117 If the base image is smaller than top, then the base image
1118 will be resized to be the same size as top. If top is
1119 smaller than the base image, the base will not be
1120 truncated. If you want the base image size to match the
1121 size of the smaller top, you can safely truncate it
1122 yourself once the commit operation successfully completes.
1123 (json-string)
1124- "speed": the maximum speed, in bytes per second (json-int, optional)
1125
1126
1127Example:
1128
1129-> { "execute": "block-commit", "arguments": { "device": "virtio0",
1130 "top": "/tmp/snap1.qcow2" } }
1131<- { "return": {} }
1132
1133EQMP
1134
Jeff Codyed61fc12012-09-27 13:29:16 -04001135 {
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001136 .name = "drive-backup",
Stefan Hajnoczib53169e2013-06-26 14:11:57 +02001137 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
John Snowd58d8452015-04-17 19:49:58 -04001138 "bitmap:s?,on-source-error:s?,on-target-error:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001139 .mhandler.cmd_new = qmp_marshal_drive_backup,
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001140 },
1141
1142SQMP
1143drive-backup
1144------------
1145
1146Start a point-in-time copy of a block device to a new destination. The
1147status of ongoing drive-backup operations can be checked with
1148query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1149The operation can be stopped before it has completed using the
1150block-job-cancel command.
1151
1152Arguments:
1153
1154- "device": the name of the device which should be copied.
1155 (json-string)
1156- "target": the target of the new image. If the file exists, or if it is a
1157 device, the existing file/device will be used as the new
1158 destination. If it does not exist, a new file will be created.
1159 (json-string)
1160- "format": the format of the new destination, default is to probe if 'mode' is
1161 'existing', else the format of the source
1162 (json-string, optional)
Stefan Hajnoczib53169e2013-06-26 14:11:57 +02001163- "sync": what parts of the disk image should be copied to the destination;
1164 possibilities include "full" for all the disk, "top" for only the sectors
John Snow4b80ab22015-06-04 20:20:34 -04001165 allocated in the topmost image, "incremental" for only the dirty sectors in
John Snowd58d8452015-04-17 19:49:58 -04001166 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
John Snow4b80ab22015-06-04 20:20:34 -04001167- "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1168 is "incremental", must NOT be present otherwise.
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001169- "mode": whether and how QEMU should create a new image
1170 (NewImageMode, optional, default 'absolute-paths')
1171- "speed": the maximum speed, in bytes per second (json-int, optional)
1172- "on-source-error": the action to take on an error on the source, default
1173 'report'. 'stop' and 'enospc' can only be used
1174 if the block device supports io-status.
1175 (BlockdevOnError, optional)
1176- "on-target-error": the action to take on an error on the target, default
1177 'report' (no limitations, since this applies to
1178 a different block device than device).
1179 (BlockdevOnError, optional)
1180
1181Example:
1182-> { "execute": "drive-backup", "arguments": { "device": "drive0",
Ian Mainfc5d3f82013-07-26 11:39:04 -07001183 "sync": "full",
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001184 "target": "backup.img" } }
1185<- { "return": {} }
Fam Zhengc29c1dd2014-12-18 18:37:05 +08001186
1187EQMP
1188
1189 {
1190 .name = "blockdev-backup",
1191 .args_type = "sync:s,device:B,target:B,speed:i?,"
1192 "on-source-error:s?,on-target-error:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001193 .mhandler.cmd_new = qmp_marshal_blockdev_backup,
Fam Zhengc29c1dd2014-12-18 18:37:05 +08001194 },
1195
1196SQMP
1197blockdev-backup
1198---------------
1199
1200The device version of drive-backup: this command takes an existing named device
1201as backup target.
1202
1203Arguments:
1204
1205- "device": the name of the device which should be copied.
1206 (json-string)
1207- "target": the name of the backup target device. (json-string)
1208- "sync": what parts of the disk image should be copied to the destination;
1209 possibilities include "full" for all the disk, "top" for only the
1210 sectors allocated in the topmost image, or "none" to only replicate
1211 new I/O (MirrorSyncMode).
1212- "speed": the maximum speed, in bytes per second (json-int, optional)
1213- "on-source-error": the action to take on an error on the source, default
1214 'report'. 'stop' and 'enospc' can only be used
1215 if the block device supports io-status.
1216 (BlockdevOnError, optional)
1217- "on-target-error": the action to take on an error on the target, default
1218 'report' (no limitations, since this applies to
1219 a different block device than device).
1220 (BlockdevOnError, optional)
1221
1222Example:
1223-> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1224 "sync": "full",
1225 "target": "tgt-id" } }
1226<- { "return": {} }
1227
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001228EQMP
1229
1230 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001231 .name = "block-job-set-speed",
Stefan Hajnoczi882ec7c2012-04-25 16:51:02 +01001232 .args_type = "device:B,speed:o",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001233 .mhandler.cmd_new = qmp_marshal_block_job_set_speed,
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00001234 },
1235
1236 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001237 .name = "block-job-cancel",
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001238 .args_type = "device:B,force:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001239 .mhandler.cmd_new = qmp_marshal_block_job_cancel,
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00001240 },
Jeff Codyc1864022012-02-28 15:54:07 -05001241 {
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001242 .name = "block-job-pause",
1243 .args_type = "device:B",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001244 .mhandler.cmd_new = qmp_marshal_block_job_pause,
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001245 },
1246 {
1247 .name = "block-job-resume",
1248 .args_type = "device:B",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001249 .mhandler.cmd_new = qmp_marshal_block_job_resume,
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001250 },
1251 {
Paolo Bonziniaeae8832012-10-18 16:49:21 +02001252 .name = "block-job-complete",
1253 .args_type = "device:B",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001254 .mhandler.cmd_new = qmp_marshal_block_job_complete,
Paolo Bonziniaeae8832012-10-18 16:49:21 +02001255 },
1256 {
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001257 .name = "transaction",
Paolo Bonzinib9f89782012-03-22 12:51:11 +01001258 .args_type = "actions:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001259 .mhandler.cmd_new = qmp_marshal_transaction,
Jeff Codyc1864022012-02-28 15:54:07 -05001260 },
1261
1262SQMP
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001263transaction
1264-----------
Jeff Codyc1864022012-02-28 15:54:07 -05001265
Wenchao Xiabbe86012013-09-11 14:04:34 +08001266Atomically operate on one or more block devices. The only supported operations
1267for now are drive-backup, internal and external snapshotting. A list of
1268dictionaries is accepted, that contains the actions to be performed.
1269If there is any failure performing any of the operations, all operations
1270for the group are abandoned.
Jeff Codyc1864022012-02-28 15:54:07 -05001271
Wenchao Xiabbe86012013-09-11 14:04:34 +08001272For external snapshots, the dictionary contains the device, the file to use for
1273the new snapshot, and the format. The default format, if not specified, is
1274qcow2.
Jeff Codyc1864022012-02-28 15:54:07 -05001275
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001276Each new snapshot defaults to being created by QEMU (wiping any
1277contents if the file already exists), but it is also possible to reuse
1278an externally-created file. In the latter case, you should ensure that
1279the new image file has the same contents as the current one; QEMU cannot
1280perform any meaningful check. Typically this is achieved by using the
1281current image file as the backing file for the new image.
1282
Wenchao Xiabbe86012013-09-11 14:04:34 +08001283On failure, the original disks pre-snapshot attempt will be used.
1284
1285For internal snapshots, the dictionary contains the device and the snapshot's
1286name. If an internal snapshot matching name already exists, the request will
1287be rejected. Only some image formats support it, for example, qcow2, rbd,
1288and sheepdog.
1289
1290On failure, qemu will try delete the newly created internal snapshot in the
1291transaction. When an I/O error occurs during deletion, the user needs to fix
1292it later with qemu-img or other command.
1293
Jeff Codyc1864022012-02-28 15:54:07 -05001294Arguments:
1295
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001296actions array:
1297 - "type": the operation to perform. The only supported
1298 value is "blockdev-snapshot-sync". (json-string)
1299 - "data": a dictionary. The contents depend on the value
1300 of "type". When "type" is "blockdev-snapshot-sync":
1301 - "device": device name to snapshot (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001302 - "node-name": graph node name to snapshot (json-string)
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001303 - "snapshot-file": name of new image file (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001304 - "snapshot-node-name": graph node name of the new snapshot (json-string)
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001305 - "format": format of new image (json-string, optional)
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001306 - "mode": whether and how QEMU should create the snapshot file
1307 (NewImageMode, optional, default "absolute-paths")
Wenchao Xiabbe86012013-09-11 14:04:34 +08001308 When "type" is "blockdev-snapshot-internal-sync":
1309 - "device": device name to snapshot (json-string)
1310 - "name": name of the new snapshot (json-string)
Jeff Codyc1864022012-02-28 15:54:07 -05001311
1312Example:
1313
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001314-> { "execute": "transaction",
1315 "arguments": { "actions": [
Eric Blakecd0c5382014-05-06 09:39:03 -06001316 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001317 "snapshot-file": "/some/place/my-image",
1318 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001319 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
Benoît Canet0901f672014-01-23 21:31:38 +01001320 "snapshot-file": "/some/place/my-image2",
1321 "snapshot-node-name": "node3432",
1322 "mode": "existing",
1323 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001324 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001325 "snapshot-file": "/some/place/my-image2",
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001326 "mode": "existing",
Wenchao Xiabbe86012013-09-11 14:04:34 +08001327 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001328 { "type": "blockdev-snapshot-internal-sync", "data" : {
Wenchao Xiabbe86012013-09-11 14:04:34 +08001329 "device": "ide-hd2",
1330 "name": "snapshot0" } } ] } }
Jeff Codyc1864022012-02-28 15:54:07 -05001331<- { "return": {} }
1332
1333EQMP
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00001334
1335 {
John Snow341ebc22015-04-17 19:49:52 -04001336 .name = "block-dirty-bitmap-add",
1337 .args_type = "node:B,name:s,granularity:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001338 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_add,
John Snow341ebc22015-04-17 19:49:52 -04001339 },
1340
1341SQMP
1342
1343block-dirty-bitmap-add
1344----------------------
1345Since 2.4
1346
1347Create a dirty bitmap with a name on the device, and start tracking the writes.
1348
1349Arguments:
1350
1351- "node": device/node on which to create dirty bitmap (json-string)
1352- "name": name of the new dirty bitmap (json-string)
1353- "granularity": granularity to track writes with (int, optional)
1354
1355Example:
1356
1357-> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1358 "name": "bitmap0" } }
1359<- { "return": {} }
1360
1361EQMP
1362
1363 {
1364 .name = "block-dirty-bitmap-remove",
1365 .args_type = "node:B,name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001366 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_remove,
John Snow341ebc22015-04-17 19:49:52 -04001367 },
1368
1369SQMP
1370
1371block-dirty-bitmap-remove
1372-------------------------
1373Since 2.4
1374
1375Stop write tracking and remove the dirty bitmap that was created with
1376block-dirty-bitmap-add.
1377
1378Arguments:
1379
1380- "node": device/node on which to remove dirty bitmap (json-string)
1381- "name": name of the dirty bitmap to remove (json-string)
1382
1383Example:
1384
1385-> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1386 "name": "bitmap0" } }
1387<- { "return": {} }
1388
1389EQMP
1390
1391 {
John Snowe74e6b72015-04-17 19:49:59 -04001392 .name = "block-dirty-bitmap-clear",
1393 .args_type = "node:B,name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001394 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_clear,
John Snowe74e6b72015-04-17 19:49:59 -04001395 },
1396
1397SQMP
1398
1399block-dirty-bitmap-clear
1400------------------------
1401Since 2.4
1402
1403Reset the dirty bitmap associated with a node so that an incremental backup
1404from this point in time forward will only backup clusters modified after this
1405clear operation.
1406
1407Arguments:
1408
1409- "node": device/node on which to remove dirty bitmap (json-string)
1410- "name": name of the dirty bitmap to remove (json-string)
1411
1412Example:
1413
1414-> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1415 "name": "bitmap0" } }
1416<- { "return": {} }
1417
1418EQMP
1419
1420 {
Jes Sorensend967b2f2011-07-11 20:01:09 +02001421 .name = "blockdev-snapshot-sync",
Benoît Canet0901f672014-01-23 21:31:38 +01001422 .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 +02001423 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_sync,
Jes Sorensend967b2f2011-07-11 20:01:09 +02001424 },
1425
1426SQMP
1427blockdev-snapshot-sync
1428----------------------
1429
1430Synchronous snapshot of a block device. snapshot-file specifies the
1431target of the new image. If the file exists, or if it is a device, the
1432snapshot will be created in the existing file/device. If does not
1433exist, a new file will be created. format specifies the format of the
1434snapshot image, default is qcow2.
1435
1436Arguments:
1437
1438- "device": device name to snapshot (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001439- "node-name": graph node name to snapshot (json-string)
Jes Sorensend967b2f2011-07-11 20:01:09 +02001440- "snapshot-file": name of new image file (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001441- "snapshot-node-name": graph node name of the new snapshot (json-string)
Paolo Bonzini6cc2a412012-03-06 18:55:59 +01001442- "mode": whether and how QEMU should create the snapshot file
1443 (NewImageMode, optional, default "absolute-paths")
Jes Sorensend967b2f2011-07-11 20:01:09 +02001444- "format": format of new image (json-string, optional)
1445
1446Example:
1447
Luiz Capitulino7f3850c2011-10-10 17:30:08 -03001448-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1449 "snapshot-file":
1450 "/some/place/my-image",
1451 "format": "qcow2" } }
Jes Sorensend967b2f2011-07-11 20:01:09 +02001452<- { "return": {} }
1453
1454EQMP
1455
1456 {
Wenchao Xiaf323bc92013-09-11 14:04:35 +08001457 .name = "blockdev-snapshot-internal-sync",
1458 .args_type = "device:B,name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001459 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_internal_sync,
Wenchao Xiaf323bc92013-09-11 14:04:35 +08001460 },
1461
1462SQMP
1463blockdev-snapshot-internal-sync
1464-------------------------------
1465
1466Synchronously take an internal snapshot of a block device when the format of
1467image used supports it. If the name is an empty string, or a snapshot with
1468name already exists, the operation will fail.
1469
1470Arguments:
1471
1472- "device": device name to snapshot (json-string)
1473- "name": name of the new snapshot (json-string)
1474
1475Example:
1476
1477-> { "execute": "blockdev-snapshot-internal-sync",
1478 "arguments": { "device": "ide-hd0",
1479 "name": "snapshot0" }
1480 }
1481<- { "return": {} }
1482
1483EQMP
1484
1485 {
Wenchao Xia44e3e052013-09-11 14:04:36 +08001486 .name = "blockdev-snapshot-delete-internal-sync",
1487 .args_type = "device:B,id:s?,name:s?",
1488 .mhandler.cmd_new =
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001489 qmp_marshal_blockdev_snapshot_delete_internal_sync,
Wenchao Xia44e3e052013-09-11 14:04:36 +08001490 },
1491
1492SQMP
1493blockdev-snapshot-delete-internal-sync
1494--------------------------------------
1495
1496Synchronously delete an internal snapshot of a block device when the format of
1497image used supports it. The snapshot is identified by name or id or both. One
1498of name or id is required. If the snapshot is not found, the operation will
1499fail.
1500
1501Arguments:
1502
1503- "device": device name (json-string)
1504- "id": ID of the snapshot (json-string, optional)
1505- "name": name of the snapshot (json-string, optional)
1506
1507Example:
1508
1509-> { "execute": "blockdev-snapshot-delete-internal-sync",
1510 "arguments": { "device": "ide-hd0",
1511 "name": "snapshot0" }
1512 }
1513<- { "return": {
1514 "id": "1",
1515 "name": "snapshot0",
1516 "vm-state-size": 0,
1517 "date-sec": 1000012,
1518 "date-nsec": 10,
1519 "vm-clock-sec": 100,
1520 "vm-clock-nsec": 20
1521 }
1522 }
1523
1524EQMP
1525
1526 {
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001527 .name = "drive-mirror",
Paolo Bonzinib952b552012-10-18 16:49:28 +02001528 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
Benoît Canet09158f02014-06-27 18:25:25 +02001529 "node-name:s?,replaces:s?,"
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001530 "on-source-error:s?,on-target-error:s?,"
Fam Zheng0fc9f8e2015-06-08 13:56:08 +08001531 "unmap:b?,"
Paolo Bonzini08e4ed62013-01-22 09:03:13 +01001532 "granularity:i?,buf-size:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001533 .mhandler.cmd_new = qmp_marshal_drive_mirror,
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001534 },
1535
1536SQMP
1537drive-mirror
1538------------
1539
1540Start mirroring a block device's writes to a new destination. target
1541specifies the target of the new image. If the file exists, or if it is
1542a device, it will be used as the new destination for writes. If it does not
1543exist, a new file will be created. format specifies the format of the
1544mirror image, default is to probe if mode='existing', else the format
1545of the source.
1546
1547Arguments:
1548
1549- "device": device name to operate on (json-string)
1550- "target": name of new image file (json-string)
1551- "format": format of new image (json-string, optional)
Benoît Canet4c828dc2014-06-16 12:00:55 +02001552- "node-name": the name of the new block driver state in the node graph
1553 (json-string, optional)
Benoît Canet09158f02014-06-27 18:25:25 +02001554- "replaces": the block driver node name to replace when finished
1555 (json-string, optional)
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001556- "mode": how an image file should be created into the target
1557 file/device (NewImageMode, optional, default 'absolute-paths')
1558- "speed": maximum speed of the streaming job, in bytes per second
1559 (json-int)
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001560- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
Paolo Bonzini08e4ed62013-01-22 09:03:13 +01001561- "buf_size": maximum amount of data in flight from source to target, in bytes
1562 (json-int, default 10M)
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001563- "sync": what parts of the disk image should be copied to the destination;
1564 possibilities include "full" for all the disk, "top" for only the sectors
1565 allocated in the topmost image, or "none" to only replicate new I/O
1566 (MirrorSyncMode).
Paolo Bonzinib952b552012-10-18 16:49:28 +02001567- "on-source-error": the action to take on an error on the source
1568 (BlockdevOnError, default 'report')
1569- "on-target-error": the action to take on an error on the target
1570 (BlockdevOnError, default 'report')
Fam Zheng0fc9f8e2015-06-08 13:56:08 +08001571- "unmap": whether the target sectors should be discarded where source has only
1572 zeroes. (json-bool, optional, default true)
Paolo Bonzinib952b552012-10-18 16:49:28 +02001573
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001574The default value of the granularity is the image cluster size clamped
1575between 4096 and 65536, if the image format defines one. If the format
1576does not define a cluster size, the default value of the granularity
1577is 65536.
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001578
1579
1580Example:
1581
1582-> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1583 "target": "/some/place/my-image",
1584 "sync": "full",
1585 "format": "qcow2" } }
1586<- { "return": {} }
1587
1588EQMP
1589
1590 {
Jeff Codyfa40e652014-07-01 09:52:16 +02001591 .name = "change-backing-file",
1592 .args_type = "device:s,image-node-name:s,backing-file:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001593 .mhandler.cmd_new = qmp_marshal_change_backing_file,
Jeff Codyfa40e652014-07-01 09:52:16 +02001594 },
1595
1596SQMP
1597change-backing-file
1598-------------------
1599Since: 2.1
1600
1601Change the backing file in the image file metadata. This does not cause
1602QEMU to reopen the image file to reparse the backing filename (it may,
1603however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1604if needed). The new backing file string is written into the image file
1605metadata, and the QEMU internal strings are updated.
1606
1607Arguments:
1608
1609- "image-node-name": The name of the block driver state node of the
1610 image to modify. The "device" is argument is used to
1611 verify "image-node-name" is in the chain described by
1612 "device".
1613 (json-string, optional)
1614
1615- "device": The name of the device.
1616 (json-string)
1617
1618- "backing-file": The string to write as the backing file. This string is
1619 not validated, so care should be taken when specifying
1620 the string or the image chain may not be able to be
1621 reopened again.
1622 (json-string)
1623
1624Returns: Nothing on success
1625 If "device" does not exist or cannot be determined, DeviceNotFound
1626
1627EQMP
1628
1629 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001630 .name = "balloon",
1631 .args_type = "value:M",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001632 .mhandler.cmd_new = qmp_marshal_balloon,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001633 },
1634
1635SQMP
1636balloon
1637-------
1638
1639Request VM to change its memory allocation (in bytes).
1640
1641Arguments:
1642
1643- "value": New memory allocation (json-int)
1644
1645Example:
1646
1647-> { "execute": "balloon", "arguments": { "value": 536870912 } }
1648<- { "return": {} }
1649
1650EQMP
1651
1652 {
1653 .name = "set_link",
1654 .args_type = "name:s,up:b",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001655 .mhandler.cmd_new = qmp_marshal_set_link,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001656 },
1657
1658SQMP
1659set_link
1660--------
1661
1662Change the link status of a network adapter.
1663
1664Arguments:
1665
1666- "name": network device name (json-string)
1667- "up": status is up (json-bool)
1668
1669Example:
1670
1671-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1672<- { "return": {} }
1673
1674EQMP
1675
1676 {
1677 .name = "getfd",
1678 .args_type = "fdname:s",
1679 .params = "getfd name",
1680 .help = "receive a file descriptor via SCM rights and assign it a name",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001681 .mhandler.cmd_new = qmp_marshal_getfd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001682 },
1683
1684SQMP
1685getfd
1686-----
1687
1688Receive a file descriptor via SCM rights and assign it a name.
1689
1690Arguments:
1691
1692- "fdname": file descriptor name (json-string)
1693
1694Example:
1695
1696-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1697<- { "return": {} }
1698
Corey Bryant208c9d12012-06-22 14:36:09 -04001699Notes:
1700
1701(1) If the name specified by the "fdname" argument already exists,
1702 the file descriptor assigned to it will be closed and replaced
1703 by the received file descriptor.
1704(2) The 'closefd' command can be used to explicitly close the file
1705 descriptor when it is no longer needed.
1706
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001707EQMP
1708
1709 {
1710 .name = "closefd",
1711 .args_type = "fdname:s",
1712 .params = "closefd name",
1713 .help = "close a file descriptor previously passed via SCM rights",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001714 .mhandler.cmd_new = qmp_marshal_closefd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001715 },
1716
1717SQMP
1718closefd
1719-------
1720
1721Close a file descriptor previously passed via SCM rights.
1722
1723Arguments:
1724
1725- "fdname": file descriptor name (json-string)
1726
1727Example:
1728
1729-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1730<- { "return": {} }
1731
1732EQMP
1733
Corey Bryantba1c0482012-08-14 16:43:43 -04001734 {
1735 .name = "add-fd",
1736 .args_type = "fdset-id:i?,opaque:s?",
1737 .params = "add-fd fdset-id opaque",
1738 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001739 .mhandler.cmd_new = qmp_marshal_add_fd,
Corey Bryantba1c0482012-08-14 16:43:43 -04001740 },
1741
1742SQMP
1743add-fd
1744-------
1745
1746Add a file descriptor, that was passed via SCM rights, to an fd set.
1747
1748Arguments:
1749
1750- "fdset-id": The ID of the fd set to add the file descriptor to.
1751 (json-int, optional)
1752- "opaque": A free-form string that can be used to describe the fd.
1753 (json-string, optional)
1754
1755Return a json-object with the following information:
1756
1757- "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1758- "fd": The file descriptor that was received via SCM rights and added to the
1759 fd set. (json-int)
1760
1761Example:
1762
1763-> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1764<- { "return": { "fdset-id": 1, "fd": 3 } }
1765
1766Notes:
1767
1768(1) The list of fd sets is shared by all monitor connections.
1769(2) If "fdset-id" is not specified, a new fd set will be created.
1770
1771EQMP
1772
1773 {
1774 .name = "remove-fd",
1775 .args_type = "fdset-id:i,fd:i?",
1776 .params = "remove-fd fdset-id fd",
1777 .help = "Remove a file descriptor from an fd set",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001778 .mhandler.cmd_new = qmp_marshal_remove_fd,
Corey Bryantba1c0482012-08-14 16:43:43 -04001779 },
1780
1781SQMP
1782remove-fd
1783---------
1784
1785Remove a file descriptor from an fd set.
1786
1787Arguments:
1788
1789- "fdset-id": The ID of the fd set that the file descriptor belongs to.
1790 (json-int)
1791- "fd": The file descriptor that is to be removed. (json-int, optional)
1792
1793Example:
1794
1795-> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1796<- { "return": {} }
1797
1798Notes:
1799
1800(1) The list of fd sets is shared by all monitor connections.
1801(2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1802 removed.
1803
1804EQMP
1805
1806 {
1807 .name = "query-fdsets",
1808 .args_type = "",
1809 .help = "Return information describing all fd sets",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001810 .mhandler.cmd_new = qmp_marshal_query_fdsets,
Corey Bryantba1c0482012-08-14 16:43:43 -04001811 },
1812
1813SQMP
1814query-fdsets
1815-------------
1816
1817Return information describing all fd sets.
1818
1819Arguments: None
1820
1821Example:
1822
1823-> { "execute": "query-fdsets" }
1824<- { "return": [
1825 {
1826 "fds": [
1827 {
1828 "fd": 30,
1829 "opaque": "rdonly:/path/to/file"
1830 },
1831 {
1832 "fd": 24,
1833 "opaque": "rdwr:/path/to/file"
1834 }
1835 ],
1836 "fdset-id": 1
1837 },
1838 {
1839 "fds": [
1840 {
1841 "fd": 28
1842 },
1843 {
1844 "fd": 29
1845 }
1846 ],
1847 "fdset-id": 0
1848 }
1849 ]
1850 }
1851
1852Note: The list of fd sets is shared by all monitor connections.
1853
1854EQMP
1855
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001856 {
1857 .name = "block_passwd",
Benoît Canet12d3ba82014-01-23 21:31:35 +01001858 .args_type = "device:s?,node-name:s?,password:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001859 .mhandler.cmd_new = qmp_marshal_block_passwd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001860 },
1861
1862SQMP
1863block_passwd
1864------------
1865
1866Set the password of encrypted block devices.
1867
1868Arguments:
1869
1870- "device": device name (json-string)
Benoît Canet12d3ba82014-01-23 21:31:35 +01001871- "node-name": name in the block driver state graph (json-string)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001872- "password": password (json-string)
1873
1874Example:
1875
1876-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1877 "password": "12345" } }
1878<- { "return": {} }
1879
1880EQMP
1881
1882 {
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001883 .name = "block_set_io_throttle",
Alberto Garcia76f4afb2015-06-08 18:17:44 +02001884 .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 +02001885 .mhandler.cmd_new = qmp_marshal_block_set_io_throttle,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001886 },
1887
1888SQMP
1889block_set_io_throttle
1890------------
1891
1892Change I/O throttle limits for a block drive.
1893
1894Arguments:
1895
1896- "device": device name (json-string)
Eric Blake586b5462013-08-30 14:44:11 -06001897- "bps": total throughput limit in bytes per second (json-int)
1898- "bps_rd": read throughput limit in bytes per second (json-int)
1899- "bps_wr": write throughput limit in bytes per second (json-int)
1900- "iops": total I/O operations per second (json-int)
1901- "iops_rd": read I/O operations per second (json-int)
1902- "iops_wr": write I/O operations per second (json-int)
Benoît Canet3e9fab62013-09-02 14:14:40 +02001903- "bps_max": total max in bytes (json-int)
1904- "bps_rd_max": read max in bytes (json-int)
1905- "bps_wr_max": write max in bytes (json-int)
1906- "iops_max": total I/O operations max (json-int)
1907- "iops_rd_max": read I/O operations max (json-int)
1908- "iops_wr_max": write I/O operations max (json-int)
Benoît Canet2024c1d2013-09-02 14:14:41 +02001909- "iops_size": I/O size in bytes when limiting (json-int)
Alberto Garcia76f4afb2015-06-08 18:17:44 +02001910- "group": throttle group name (json-string)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001911
1912Example:
1913
1914-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
Eric Blake586b5462013-08-30 14:44:11 -06001915 "bps": 1000000,
1916 "bps_rd": 0,
1917 "bps_wr": 0,
1918 "iops": 0,
1919 "iops_rd": 0,
Benoît Canet3e9fab62013-09-02 14:14:40 +02001920 "iops_wr": 0,
1921 "bps_max": 8000000,
1922 "bps_rd_max": 0,
1923 "bps_wr_max": 0,
1924 "iops_max": 0,
1925 "iops_rd_max": 0,
Benoît Canet2024c1d2013-09-02 14:14:41 +02001926 "iops_wr_max": 0,
1927 "iops_size": 0 } }
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001928<- { "return": {} }
1929
1930EQMP
1931
1932 {
Gerd Hoffmann75721502010-10-07 12:22:54 +02001933 .name = "set_password",
1934 .args_type = "protocol:s,password:s,connected:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001935 .mhandler.cmd_new = qmp_marshal_set_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +02001936 },
1937
1938SQMP
1939set_password
1940------------
1941
1942Set the password for vnc/spice protocols.
1943
1944Arguments:
1945
1946- "protocol": protocol name (json-string)
1947- "password": password (json-string)
Alberto Garcia3599d462015-02-26 16:35:07 +02001948- "connected": [ keep | disconnect | fail ] (json-string, optional)
Gerd Hoffmann75721502010-10-07 12:22:54 +02001949
1950Example:
1951
1952-> { "execute": "set_password", "arguments": { "protocol": "vnc",
1953 "password": "secret" } }
1954<- { "return": {} }
1955
1956EQMP
1957
1958 {
1959 .name = "expire_password",
1960 .args_type = "protocol:s,time:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001961 .mhandler.cmd_new = qmp_marshal_expire_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +02001962 },
1963
1964SQMP
1965expire_password
1966---------------
1967
1968Set the password expire time for vnc/spice protocols.
1969
1970Arguments:
1971
1972- "protocol": protocol name (json-string)
1973- "time": [ now | never | +secs | secs ] (json-string)
1974
1975Example:
1976
1977-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1978 "time": "+60" } }
1979<- { "return": {} }
1980
1981EQMP
1982
1983 {
Daniel P. Berrange13661082011-06-23 13:31:42 +01001984 .name = "add_client",
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +00001985 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001986 .mhandler.cmd_new = qmp_marshal_add_client,
Daniel P. Berrange13661082011-06-23 13:31:42 +01001987 },
1988
1989SQMP
1990add_client
1991----------
1992
1993Add a graphics client
1994
1995Arguments:
1996
1997- "protocol": protocol name (json-string)
1998- "fdname": file descriptor name (json-string)
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +00001999- "skipauth": whether to skip authentication (json-bool, optional)
2000- "tls": whether to perform TLS (json-bool, optional)
Daniel P. Berrange13661082011-06-23 13:31:42 +01002001
2002Example:
2003
2004-> { "execute": "add_client", "arguments": { "protocol": "vnc",
2005 "fdname": "myclient" } }
2006<- { "return": {} }
2007
2008EQMP
2009 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002010 .name = "qmp_capabilities",
2011 .args_type = "",
2012 .params = "",
2013 .help = "enable QMP capabilities",
Markus Armbruster485febc2015-03-13 17:25:50 +01002014 .mhandler.cmd_new = qmp_capabilities,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002015 },
2016
2017SQMP
2018qmp_capabilities
2019----------------
2020
2021Enable QMP capabilities.
2022
2023Arguments: None.
2024
2025Example:
2026
2027-> { "execute": "qmp_capabilities" }
2028<- { "return": {} }
2029
2030Note: This command must be issued before issuing any other command.
2031
Luiz Capitulino0268d972010-10-22 10:08:02 -02002032EQMP
2033
2034 {
2035 .name = "human-monitor-command",
2036 .args_type = "command-line:s,cpu-index:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002037 .mhandler.cmd_new = qmp_marshal_human_monitor_command,
Luiz Capitulino0268d972010-10-22 10:08:02 -02002038 },
2039
2040SQMP
2041human-monitor-command
2042---------------------
2043
2044Execute a Human Monitor command.
2045
2046Arguments:
2047
2048- command-line: the command name and its arguments, just like the
2049 Human Monitor's shell (json-string)
2050- cpu-index: select the CPU number to be used by commands which access CPU
2051 data, like 'info registers'. The Monitor selects CPU 0 if this
2052 argument is not provided (json-int, optional)
2053
2054Example:
2055
2056-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2057<- { "return": "kvm support: enabled\r\n" }
2058
2059Notes:
2060
2061(1) The Human Monitor is NOT an stable interface, this means that command
2062 names, arguments and responses can change or be removed at ANY time.
2063 Applications that rely on long term stability guarantees should NOT
2064 use this command
2065
2066(2) Limitations:
2067
2068 o This command is stateless, this means that commands that depend
2069 on state information (such as getfd) might not work
2070
2071 o Commands that prompt the user for data (eg. 'cont' when the block
2072 device is encrypted) don't currently work
2073
Luiz Capitulino82a56f02010-09-13 12:26:00 -030020743. Query Commands
2075=================
2076
2077HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2078HXCOMM this! We will possibly move query commands definitions inside those
2079HXCOMM sections, just like regular commands.
2080
2081EQMP
2082
2083SQMP
2084query-version
2085-------------
2086
2087Show QEMU version.
2088
2089Return a json-object with the following information:
2090
2091- "qemu": A json-object containing three integer values:
2092 - "major": QEMU's major version (json-int)
2093 - "minor": QEMU's minor version (json-int)
2094 - "micro": QEMU's micro version (json-int)
2095- "package": package's version (json-string)
2096
2097Example:
2098
2099-> { "execute": "query-version" }
2100<- {
2101 "return":{
2102 "qemu":{
2103 "major":0,
2104 "minor":11,
2105 "micro":5
2106 },
2107 "package":""
2108 }
2109 }
2110
2111EQMP
2112
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03002113 {
2114 .name = "query-version",
2115 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002116 .mhandler.cmd_new = qmp_marshal_query_version,
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03002117 },
2118
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002119SQMP
2120query-commands
2121--------------
2122
2123List QMP available commands.
2124
2125Each command is represented by a json-object, the returned value is a json-array
2126of all commands.
2127
2128Each json-object contain:
2129
2130- "name": command's name (json-string)
2131
2132Example:
2133
2134-> { "execute": "query-commands" }
2135<- {
2136 "return":[
2137 {
2138 "name":"query-balloon"
2139 },
2140 {
2141 "name":"system_powerdown"
2142 }
2143 ]
2144 }
2145
2146Note: This example has been shortened as the real response is too long.
2147
2148EQMP
2149
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03002150 {
2151 .name = "query-commands",
2152 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002153 .mhandler.cmd_new = qmp_marshal_query_commands,
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03002154 },
2155
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002156SQMP
Daniel P. Berrange48608532012-05-21 17:59:51 +01002157query-events
2158--------------
2159
2160List QMP available events.
2161
2162Each event is represented by a json-object, the returned value is a json-array
2163of all events.
2164
2165Each json-object contains:
2166
2167- "name": event's name (json-string)
2168
2169Example:
2170
2171-> { "execute": "query-events" }
2172<- {
2173 "return":[
2174 {
2175 "name":"SHUTDOWN"
2176 },
2177 {
2178 "name":"RESET"
2179 }
2180 ]
2181 }
2182
2183Note: This example has been shortened as the real response is too long.
2184
2185EQMP
2186
2187 {
2188 .name = "query-events",
2189 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002190 .mhandler.cmd_new = qmp_marshal_query_events,
Daniel P. Berrange48608532012-05-21 17:59:51 +01002191 },
2192
2193SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002194query-chardev
2195-------------
2196
2197Each device is represented by a json-object. The returned value is a json-array
2198of all devices.
2199
2200Each json-object contain the following:
2201
2202- "label": device's label (json-string)
2203- "filename": device's file (json-string)
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002204- "frontend-open": open/closed state of the frontend device attached to this
2205 backend (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002206
2207Example:
2208
2209-> { "execute": "query-chardev" }
2210<- {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002211 "return": [
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002212 {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002213 "label": "charchannel0",
2214 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2215 "frontend-open": false
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002216 },
2217 {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002218 "label": "charmonitor",
2219 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2220 "frontend-open": true
2221 },
2222 {
2223 "label": "charserial0",
2224 "filename": "pty:/dev/pts/2",
2225 "frontend-open": true
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002226 }
2227 ]
2228 }
2229
2230EQMP
2231
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03002232 {
2233 .name = "query-chardev",
2234 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002235 .mhandler.cmd_new = qmp_marshal_query_chardev,
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03002236 },
2237
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002238SQMP
Martin Kletzander77d1c3c2014-02-01 12:52:42 +01002239query-chardev-backends
2240-------------
2241
2242List available character device backends.
2243
2244Each backend is represented by a json-object, the returned value is a json-array
2245of all backends.
2246
2247Each json-object contains:
2248
2249- "name": backend name (json-string)
2250
2251Example:
2252
2253-> { "execute": "query-chardev-backends" }
2254<- {
2255 "return":[
2256 {
2257 "name":"udp"
2258 },
2259 {
2260 "name":"tcp"
2261 },
2262 {
2263 "name":"unix"
2264 },
2265 {
2266 "name":"spiceport"
2267 }
2268 ]
2269 }
2270
2271EQMP
2272
2273 {
2274 .name = "query-chardev-backends",
2275 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002276 .mhandler.cmd_new = qmp_marshal_query_chardev_backends,
Martin Kletzander77d1c3c2014-02-01 12:52:42 +01002277 },
2278
2279SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002280query-block
2281-----------
2282
2283Show the block devices.
2284
2285Each block device information is stored in a json-object and the returned value
2286is a json-array of all devices.
2287
2288Each json-object contain the following:
2289
2290- "device": device name (json-string)
2291- "type": device type (json-string)
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002292 - deprecated, retained for backward compatibility
2293 - Possible values: "unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002294- "removable": true if the device is removable, false otherwise (json-bool)
2295- "locked": true if the device is locked, false otherwise (json-bool)
Michal Privoznik99f42802013-01-29 17:58:41 +01002296- "tray_open": only present if removable, true if the device has a tray,
Markus Armbrustere4def802011-09-06 18:58:53 +02002297 and it is open (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002298- "inserted": only present if the device is inserted, it is a json-object
2299 containing the following:
2300 - "file": device file name (json-string)
2301 - "ro": true if read-only, false otherwise (json-bool)
2302 - "drv": driver format name (json-string)
Stefan Hajnoczi550830f2014-09-16 15:24:24 +01002303 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002304 "file", "file", "ftp", "ftps", "host_cdrom",
Markus Armbruster92a539d2015-03-17 17:02:20 +01002305 "host_device", "http", "https",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002306 "nbd", "parallels", "qcow", "qcow2", "raw",
2307 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2308 - "backing_file": backing file name (json-string, optional)
Benoît Canet2e3e3312012-08-02 10:22:48 +02002309 - "backing_file_depth": number of files in the backing file chain (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002310 - "encrypted": true if encrypted, false otherwise (json-bool)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002311 - "bps": limit total bytes per second (json-int)
2312 - "bps_rd": limit read bytes per second (json-int)
2313 - "bps_wr": limit write bytes per second (json-int)
2314 - "iops": limit total I/O operations per second (json-int)
2315 - "iops_rd": limit read operations per second (json-int)
2316 - "iops_wr": limit write operations per second (json-int)
Benoît Canet3e9fab62013-09-02 14:14:40 +02002317 - "bps_max": total max in bytes (json-int)
2318 - "bps_rd_max": read max in bytes (json-int)
2319 - "bps_wr_max": write max in bytes (json-int)
2320 - "iops_max": total I/O operations max (json-int)
2321 - "iops_rd_max": read I/O operations max (json-int)
2322 - "iops_wr_max": write I/O operations max (json-int)
Benoît Canet2024c1d2013-09-02 14:14:41 +02002323 - "iops_size": I/O size when limiting by iops (json-int)
Peter Lieven465bee12014-05-18 00:58:19 +02002324 - "detect_zeroes": detect and optimize zero writing (json-string)
2325 - Possible values: "off", "on", "unmap"
Francesco Romanie2462112015-01-12 14:11:13 +01002326 - "write_threshold": write offset threshold in bytes, a event will be
2327 emitted if crossed. Zero if disabled (json-int)
Wenchao Xia553a7e82013-06-06 12:27:59 +08002328 - "image": the detail of the image, it is a json-object containing
2329 the following:
2330 - "filename": image file name (json-string)
2331 - "format": image format (json-string)
2332 - "virtual-size": image capacity in bytes (json-int)
2333 - "dirty-flag": true if image is not cleanly closed, not present
2334 means clean (json-bool, optional)
2335 - "actual-size": actual size on disk in bytes of the image, not
2336 present when image does not support thin
2337 provision (json-int, optional)
2338 - "cluster-size": size of a cluster in bytes, not present if image
2339 format does not support it (json-int, optional)
2340 - "encrypted": true if the image is encrypted, not present means
2341 false or the image format does not support
2342 encryption (json-bool, optional)
2343 - "backing_file": backing file name, not present means no backing
2344 file is used or the image format does not
2345 support backing file chain
2346 (json-string, optional)
2347 - "full-backing-filename": full path of the backing file, not
2348 present if it equals backing_file or no
2349 backing file is used
2350 (json-string, optional)
2351 - "backing-filename-format": the format of the backing file, not
2352 present means unknown or no backing
2353 file (json-string, optional)
2354 - "snapshots": the internal snapshot info, it is an optional list
2355 of json-object containing the following:
2356 - "id": unique snapshot id (json-string)
2357 - "name": snapshot name (json-string)
2358 - "vm-state-size": size of the VM state in bytes (json-int)
2359 - "date-sec": UTC date of the snapshot in seconds (json-int)
2360 - "date-nsec": fractional part in nanoseconds to be used with
Eric Blake586b5462013-08-30 14:44:11 -06002361 date-sec (json-int)
Wenchao Xia553a7e82013-06-06 12:27:59 +08002362 - "vm-clock-sec": VM clock relative to boot in seconds
2363 (json-int)
2364 - "vm-clock-nsec": fractional part in nanoseconds to be used
2365 with vm-clock-sec (json-int)
2366 - "backing-image": the detail of the backing image, it is an
2367 optional json-object only present when a
2368 backing image present for this image
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002369
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002370- "io-status": I/O operation status, only present if the device supports it
2371 and the VM is configured to stop on errors. It's always reset
2372 to "ok" when the "cont" command is issued (json_string, optional)
2373 - Possible values: "ok", "failed", "nospace"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002374
2375Example:
2376
2377-> { "execute": "query-block" }
2378<- {
2379 "return":[
2380 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002381 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002382 "device":"ide0-hd0",
2383 "locked":false,
2384 "removable":false,
2385 "inserted":{
2386 "ro":false,
2387 "drv":"qcow2",
2388 "encrypted":false,
Wenchao Xia553a7e82013-06-06 12:27:59 +08002389 "file":"disks/test.qcow2",
2390 "backing_file_depth":1,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002391 "bps":1000000,
2392 "bps_rd":0,
2393 "bps_wr":0,
2394 "iops":1000000,
2395 "iops_rd":0,
2396 "iops_wr":0,
Benoît Canet3e9fab62013-09-02 14:14:40 +02002397 "bps_max": 8000000,
2398 "bps_rd_max": 0,
2399 "bps_wr_max": 0,
2400 "iops_max": 0,
2401 "iops_rd_max": 0,
2402 "iops_wr_max": 0,
Benoît Canet2024c1d2013-09-02 14:14:41 +02002403 "iops_size": 0,
Peter Lieven465bee12014-05-18 00:58:19 +02002404 "detect_zeroes": "on",
Francesco Romanie2462112015-01-12 14:11:13 +01002405 "write_threshold": 0,
Wenchao Xia553a7e82013-06-06 12:27:59 +08002406 "image":{
2407 "filename":"disks/test.qcow2",
2408 "format":"qcow2",
2409 "virtual-size":2048000,
2410 "backing_file":"base.qcow2",
2411 "full-backing-filename":"disks/base.qcow2",
John Snow54034322015-04-28 15:20:41 -04002412 "backing-filename-format":"qcow2",
Wenchao Xia553a7e82013-06-06 12:27:59 +08002413 "snapshots":[
2414 {
2415 "id": "1",
2416 "name": "snapshot1",
2417 "vm-state-size": 0,
2418 "date-sec": 10000200,
2419 "date-nsec": 12,
2420 "vm-clock-sec": 206,
2421 "vm-clock-nsec": 30
2422 }
2423 ],
2424 "backing-image":{
2425 "filename":"disks/base.qcow2",
2426 "format":"qcow2",
2427 "virtual-size":2048000
2428 }
2429 }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002430 },
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002431 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002432 },
2433 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002434 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002435 "device":"ide1-cd0",
2436 "locked":false,
2437 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002438 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002439 },
2440 {
2441 "device":"floppy0",
2442 "locked":false,
2443 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002444 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002445 },
2446 {
2447 "device":"sd0",
2448 "locked":false,
2449 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002450 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002451 }
2452 ]
2453 }
2454
2455EQMP
2456
Luiz Capitulinob2023812011-09-21 17:16:47 -03002457 {
2458 .name = "query-block",
2459 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002460 .mhandler.cmd_new = qmp_marshal_query_block,
Luiz Capitulinob2023812011-09-21 17:16:47 -03002461 },
2462
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002463SQMP
2464query-blockstats
2465----------------
2466
2467Show block device statistics.
2468
2469Each device statistic information is stored in a json-object and the returned
2470value is a json-array of all devices.
2471
2472Each json-object contain the following:
2473
2474- "device": device name (json-string)
2475- "stats": A json-object with the statistics information, it contains:
2476 - "rd_bytes": bytes read (json-int)
2477 - "wr_bytes": bytes written (json-int)
2478 - "rd_operations": read operations (json-int)
2479 - "wr_operations": write operations (json-int)
Christoph Hellwige8045d62011-08-22 00:25:58 +02002480 - "flush_operations": cache flush operations (json-int)
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002481 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2482 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2483 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002484 - "wr_highest_offset": Highest offset of a sector written since the
2485 BlockDriverState has been opened (json-int)
Peter Lievenf4564d52015-02-02 14:52:18 +01002486 - "rd_merged": number of read requests that have been merged into
2487 another request (json-int)
2488 - "wr_merged": number of write requests that have been merged into
2489 another request (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002490- "parent": Contains recursively the statistics of the underlying
2491 protocol (e.g. the host file for a qcow2 image). If there is
2492 no underlying protocol, this field is omitted
2493 (json-object, optional)
2494
2495Example:
2496
2497-> { "execute": "query-blockstats" }
2498<- {
2499 "return":[
2500 {
2501 "device":"ide0-hd0",
2502 "parent":{
2503 "stats":{
2504 "wr_highest_offset":3686448128,
2505 "wr_bytes":9786368,
2506 "wr_operations":751,
2507 "rd_bytes":122567168,
2508 "rd_operations":36772
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002509 "wr_total_times_ns":313253456
2510 "rd_total_times_ns":3465673657
2511 "flush_total_times_ns":49653
Christoph Hellwige8045d62011-08-22 00:25:58 +02002512 "flush_operations":61,
Peter Lievenf4564d52015-02-02 14:52:18 +01002513 "rd_merged":0,
2514 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002515 }
2516 },
2517 "stats":{
2518 "wr_highest_offset":2821110784,
2519 "wr_bytes":9786368,
2520 "wr_operations":692,
2521 "rd_bytes":122739200,
2522 "rd_operations":36604
Christoph Hellwige8045d62011-08-22 00:25:58 +02002523 "flush_operations":51,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002524 "wr_total_times_ns":313253456
2525 "rd_total_times_ns":3465673657
Peter Lievenf4564d52015-02-02 14:52:18 +01002526 "flush_total_times_ns":49653,
2527 "rd_merged":0,
2528 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002529 }
2530 },
2531 {
2532 "device":"ide1-cd0",
2533 "stats":{
2534 "wr_highest_offset":0,
2535 "wr_bytes":0,
2536 "wr_operations":0,
2537 "rd_bytes":0,
2538 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002539 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002540 "wr_total_times_ns":0
2541 "rd_total_times_ns":0
Peter Lievenf4564d52015-02-02 14:52:18 +01002542 "flush_total_times_ns":0,
2543 "rd_merged":0,
2544 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002545 }
2546 },
2547 {
2548 "device":"floppy0",
2549 "stats":{
2550 "wr_highest_offset":0,
2551 "wr_bytes":0,
2552 "wr_operations":0,
2553 "rd_bytes":0,
2554 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002555 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002556 "wr_total_times_ns":0
2557 "rd_total_times_ns":0
Peter Lievenf4564d52015-02-02 14:52:18 +01002558 "flush_total_times_ns":0,
2559 "rd_merged":0,
2560 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002561 }
2562 },
2563 {
2564 "device":"sd0",
2565 "stats":{
2566 "wr_highest_offset":0,
2567 "wr_bytes":0,
2568 "wr_operations":0,
2569 "rd_bytes":0,
2570 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002571 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002572 "wr_total_times_ns":0
2573 "rd_total_times_ns":0
Peter Lievenf4564d52015-02-02 14:52:18 +01002574 "flush_total_times_ns":0,
2575 "rd_merged":0,
2576 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002577 }
2578 }
2579 ]
2580 }
2581
2582EQMP
2583
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03002584 {
2585 .name = "query-blockstats",
Fam Zhengf71eaa72014-10-31 11:32:57 +08002586 .args_type = "query-nodes:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002587 .mhandler.cmd_new = qmp_marshal_query_blockstats,
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03002588 },
2589
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002590SQMP
2591query-cpus
2592----------
2593
2594Show CPU information.
2595
2596Return a json-array. Each CPU is represented by a json-object, which contains:
2597
2598- "CPU": CPU index (json-int)
2599- "current": true if this is the current CPU, false otherwise (json-bool)
2600- "halted": true if the cpu is halted, false otherwise (json-bool)
Eduardo Habkost58f88d42015-05-08 16:04:22 -03002601- "qom_path": path to the CPU object in the QOM tree (json-str)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002602- Current program counter. The key's name depends on the architecture:
2603 "pc": i386/x86_64 (json-int)
2604 "nip": PPC (json-int)
2605 "pc" and "npc": sparc (json-int)
2606 "PC": mips (json-int)
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002607- "thread_id": ID of the underlying host thread (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002608
2609Example:
2610
2611-> { "execute": "query-cpus" }
2612<- {
2613 "return":[
2614 {
2615 "CPU":0,
2616 "current":true,
2617 "halted":false,
Eduardo Habkost58f88d42015-05-08 16:04:22 -03002618 "qom_path":"/machine/unattached/device[0]",
2619 "pc":3227107138,
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002620 "thread_id":3134
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002621 },
2622 {
2623 "CPU":1,
2624 "current":false,
2625 "halted":true,
Eduardo Habkost58f88d42015-05-08 16:04:22 -03002626 "qom_path":"/machine/unattached/device[2]",
2627 "pc":7108165,
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002628 "thread_id":3135
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002629 }
2630 ]
2631 }
2632
2633EQMP
2634
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03002635 {
2636 .name = "query-cpus",
2637 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002638 .mhandler.cmd_new = qmp_marshal_query_cpus,
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03002639 },
2640
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002641SQMP
Stefan Hajnoczidc3dd0d2014-02-27 11:48:42 +01002642query-iothreads
2643---------------
2644
2645Returns a list of information about each iothread.
2646
2647Note this list excludes the QEMU main loop thread, which is not declared
2648using the -object iothread command-line option. It is always the main thread
2649of the process.
2650
2651Return a json-array. Each iothread is represented by a json-object, which contains:
2652
2653- "id": name of iothread (json-str)
2654- "thread-id": ID of the underlying host thread (json-int)
2655
2656Example:
2657
2658-> { "execute": "query-iothreads" }
2659<- {
2660 "return":[
2661 {
2662 "id":"iothread0",
2663 "thread-id":3134
2664 },
2665 {
2666 "id":"iothread1",
2667 "thread-id":3135
2668 }
2669 ]
2670 }
2671
2672EQMP
2673
2674 {
2675 .name = "query-iothreads",
2676 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002677 .mhandler.cmd_new = qmp_marshal_query_iothreads,
Stefan Hajnoczidc3dd0d2014-02-27 11:48:42 +01002678 },
2679
2680SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002681query-pci
2682---------
2683
2684PCI buses and devices information.
2685
2686The returned value is a json-array of all buses. Each bus is represented by
2687a json-object, which has a key with a json-array of all PCI devices attached
2688to it. Each device is represented by a json-object.
2689
2690The bus json-object contains the following:
2691
2692- "bus": bus number (json-int)
2693- "devices": a json-array of json-objects, each json-object represents a
2694 PCI device
2695
2696The PCI device json-object contains the following:
2697
2698- "bus": identical to the parent's bus number (json-int)
2699- "slot": slot number (json-int)
2700- "function": function number (json-int)
2701- "class_info": a json-object containing:
2702 - "desc": device class description (json-string, optional)
2703 - "class": device class number (json-int)
2704- "id": a json-object containing:
2705 - "device": device ID (json-int)
2706 - "vendor": vendor ID (json-int)
2707- "irq": device's IRQ if assigned (json-int, optional)
2708- "qdev_id": qdev id string (json-string)
2709- "pci_bridge": It's a json-object, only present if this device is a
2710 PCI bridge, contains:
2711 - "bus": bus number (json-int)
2712 - "secondary": secondary bus number (json-int)
2713 - "subordinate": subordinate bus number (json-int)
2714 - "io_range": I/O memory range information, a json-object with the
2715 following members:
2716 - "base": base address, in bytes (json-int)
2717 - "limit": limit address, in bytes (json-int)
2718 - "memory_range": memory range information, a json-object with the
2719 following members:
2720 - "base": base address, in bytes (json-int)
2721 - "limit": limit address, in bytes (json-int)
2722 - "prefetchable_range": Prefetchable memory range information, a
2723 json-object with the following members:
2724 - "base": base address, in bytes (json-int)
2725 - "limit": limit address, in bytes (json-int)
2726 - "devices": a json-array of PCI devices if there's any attached, each
2727 each element is represented by a json-object, which contains
2728 the same members of the 'PCI device json-object' described
2729 above (optional)
2730- "regions": a json-array of json-objects, each json-object represents a
2731 memory region of this device
2732
2733The memory range json-object contains the following:
2734
2735- "base": base memory address (json-int)
2736- "limit": limit value (json-int)
2737
2738The region json-object can be an I/O region or a memory region, an I/O region
2739json-object contains the following:
2740
2741- "type": "io" (json-string, fixed)
2742- "bar": BAR number (json-int)
2743- "address": memory address (json-int)
2744- "size": memory size (json-int)
2745
2746A memory region json-object contains the following:
2747
2748- "type": "memory" (json-string, fixed)
2749- "bar": BAR number (json-int)
2750- "address": memory address (json-int)
2751- "size": memory size (json-int)
2752- "mem_type_64": true or false (json-bool)
2753- "prefetch": true or false (json-bool)
2754
2755Example:
2756
2757-> { "execute": "query-pci" }
2758<- {
2759 "return":[
2760 {
2761 "bus":0,
2762 "devices":[
2763 {
2764 "bus":0,
2765 "qdev_id":"",
2766 "slot":0,
2767 "class_info":{
2768 "class":1536,
2769 "desc":"Host bridge"
2770 },
2771 "id":{
2772 "device":32902,
2773 "vendor":4663
2774 },
2775 "function":0,
2776 "regions":[
2777
2778 ]
2779 },
2780 {
2781 "bus":0,
2782 "qdev_id":"",
2783 "slot":1,
2784 "class_info":{
2785 "class":1537,
2786 "desc":"ISA bridge"
2787 },
2788 "id":{
2789 "device":32902,
2790 "vendor":28672
2791 },
2792 "function":0,
2793 "regions":[
2794
2795 ]
2796 },
2797 {
2798 "bus":0,
2799 "qdev_id":"",
2800 "slot":1,
2801 "class_info":{
2802 "class":257,
2803 "desc":"IDE controller"
2804 },
2805 "id":{
2806 "device":32902,
2807 "vendor":28688
2808 },
2809 "function":1,
2810 "regions":[
2811 {
2812 "bar":4,
2813 "size":16,
2814 "address":49152,
2815 "type":"io"
2816 }
2817 ]
2818 },
2819 {
2820 "bus":0,
2821 "qdev_id":"",
2822 "slot":2,
2823 "class_info":{
2824 "class":768,
2825 "desc":"VGA controller"
2826 },
2827 "id":{
2828 "device":4115,
2829 "vendor":184
2830 },
2831 "function":0,
2832 "regions":[
2833 {
2834 "prefetch":true,
2835 "mem_type_64":false,
2836 "bar":0,
2837 "size":33554432,
2838 "address":4026531840,
2839 "type":"memory"
2840 },
2841 {
2842 "prefetch":false,
2843 "mem_type_64":false,
2844 "bar":1,
2845 "size":4096,
2846 "address":4060086272,
2847 "type":"memory"
2848 },
2849 {
2850 "prefetch":false,
2851 "mem_type_64":false,
2852 "bar":6,
2853 "size":65536,
2854 "address":-1,
2855 "type":"memory"
2856 }
2857 ]
2858 },
2859 {
2860 "bus":0,
2861 "qdev_id":"",
2862 "irq":11,
2863 "slot":4,
2864 "class_info":{
2865 "class":1280,
2866 "desc":"RAM controller"
2867 },
2868 "id":{
2869 "device":6900,
2870 "vendor":4098
2871 },
2872 "function":0,
2873 "regions":[
2874 {
2875 "bar":0,
2876 "size":32,
2877 "address":49280,
2878 "type":"io"
2879 }
2880 ]
2881 }
2882 ]
2883 }
2884 ]
2885 }
2886
2887Note: This example has been shortened as the real response is too long.
2888
2889EQMP
2890
Luiz Capitulino79627472011-10-21 14:15:33 -02002891 {
2892 .name = "query-pci",
2893 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002894 .mhandler.cmd_new = qmp_marshal_query_pci,
Luiz Capitulino79627472011-10-21 14:15:33 -02002895 },
2896
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002897SQMP
2898query-kvm
2899---------
2900
2901Show KVM information.
2902
2903Return a json-object with the following information:
2904
2905- "enabled": true if KVM support is enabled, false otherwise (json-bool)
2906- "present": true if QEMU has KVM support, false otherwise (json-bool)
2907
2908Example:
2909
2910-> { "execute": "query-kvm" }
2911<- { "return": { "enabled": true, "present": true } }
2912
2913EQMP
2914
Luiz Capitulino292a2602011-09-12 15:10:53 -03002915 {
2916 .name = "query-kvm",
2917 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002918 .mhandler.cmd_new = qmp_marshal_query_kvm,
Luiz Capitulino292a2602011-09-12 15:10:53 -03002919 },
2920
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002921SQMP
2922query-status
2923------------
2924
2925Return a json-object with the following information:
2926
2927- "running": true if the VM is running, or false if it is paused (json-bool)
2928- "singlestep": true if the VM is in single step mode,
2929 false otherwise (json-bool)
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03002930- "status": one of the following values (json-string)
2931 "debug" - QEMU is running on a debugger
2932 "inmigrate" - guest is paused waiting for an incoming migration
2933 "internal-error" - An internal error that prevents further guest
2934 execution has occurred
2935 "io-error" - the last IOP has failed and the device is configured
2936 to pause on I/O errors
2937 "paused" - guest has been paused via the 'stop' command
2938 "postmigrate" - guest is paused following a successful 'migrate'
2939 "prelaunch" - QEMU was started with -S and guest has not started
2940 "finish-migrate" - guest is paused to finish the migration process
2941 "restore-vm" - guest is paused to restore VM state
2942 "running" - guest is actively running
2943 "save-vm" - guest is paused to save the VM state
2944 "shutdown" - guest is shut down (and -no-shutdown is in use)
2945 "watchdog" - the watchdog action is configured to pause and
2946 has been triggered
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002947
2948Example:
2949
2950-> { "execute": "query-status" }
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03002951<- { "return": { "running": true, "singlestep": false, "status": "running" } }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002952
2953EQMP
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03002954
2955 {
2956 .name = "query-status",
2957 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002958 .mhandler.cmd_new = qmp_marshal_query_status,
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03002959 },
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002960
2961SQMP
2962query-mice
2963----------
2964
2965Show VM mice information.
2966
2967Each mouse is represented by a json-object, the returned value is a json-array
2968of all mice.
2969
2970The mouse json-object contains the following:
2971
2972- "name": mouse's name (json-string)
2973- "index": mouse's index (json-int)
2974- "current": true if this mouse is receiving events, false otherwise (json-bool)
2975- "absolute": true if the mouse generates absolute input events (json-bool)
2976
2977Example:
2978
2979-> { "execute": "query-mice" }
2980<- {
2981 "return":[
2982 {
2983 "name":"QEMU Microsoft Mouse",
2984 "index":0,
2985 "current":false,
2986 "absolute":false
2987 },
2988 {
2989 "name":"QEMU PS/2 Mouse",
2990 "index":1,
2991 "current":true,
2992 "absolute":true
2993 }
2994 ]
2995 }
2996
2997EQMP
2998
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03002999 {
3000 .name = "query-mice",
3001 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003002 .mhandler.cmd_new = qmp_marshal_query_mice,
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03003003 },
3004
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003005SQMP
3006query-vnc
3007---------
3008
3009Show VNC server information.
3010
3011Return a json-object with server information. Connected clients are returned
3012as a json-array of json-objects.
3013
3014The main json-object contains the following:
3015
3016- "enabled": true or false (json-bool)
3017- "host": server's IP address (json-string)
3018- "family": address family (json-string)
3019 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3020- "service": server's port number (json-string)
3021- "auth": authentication method (json-string)
3022 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3023 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3024 "vencrypt+plain", "vencrypt+tls+none",
3025 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3026 "vencrypt+tls+vnc", "vencrypt+x509+none",
3027 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3028 "vencrypt+x509+vnc", "vnc"
3029- "clients": a json-array of all connected clients
3030
3031Clients are described by a json-object, each one contain the following:
3032
3033- "host": client's IP address (json-string)
3034- "family": address family (json-string)
3035 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3036- "service": client's port number (json-string)
3037- "x509_dname": TLS dname (json-string, optional)
3038- "sasl_username": SASL username (json-string, optional)
3039
3040Example:
3041
3042-> { "execute": "query-vnc" }
3043<- {
3044 "return":{
3045 "enabled":true,
3046 "host":"0.0.0.0",
3047 "service":"50402",
3048 "auth":"vnc",
3049 "family":"ipv4",
3050 "clients":[
3051 {
3052 "host":"127.0.0.1",
3053 "service":"50401",
3054 "family":"ipv4"
3055 }
3056 ]
3057 }
3058 }
3059
3060EQMP
3061
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02003062 {
3063 .name = "query-vnc",
3064 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003065 .mhandler.cmd_new = qmp_marshal_query_vnc,
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02003066 },
Gerd Hoffmanndf887682014-12-17 15:49:44 +01003067 {
3068 .name = "query-vnc-servers",
3069 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003070 .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
Gerd Hoffmanndf887682014-12-17 15:49:44 +01003071 },
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02003072
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003073SQMP
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01003074query-spice
3075-----------
3076
3077Show SPICE server information.
3078
3079Return a json-object with server information. Connected clients are returned
3080as a json-array of json-objects.
3081
3082The main json-object contains the following:
3083
3084- "enabled": true or false (json-bool)
3085- "host": server's IP address (json-string)
3086- "port": server's port number (json-int, optional)
3087- "tls-port": server's port number (json-int, optional)
3088- "auth": authentication method (json-string)
3089 - Possible values: "none", "spice"
3090- "channels": a json-array of all active channels clients
3091
3092Channels are described by a json-object, each one contain the following:
3093
3094- "host": client's IP address (json-string)
3095- "family": address family (json-string)
3096 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3097- "port": client's port number (json-string)
3098- "connection-id": spice connection id. All channels with the same id
3099 belong to the same spice session (json-int)
3100- "channel-type": channel type. "1" is the main control channel, filter for
3101 this one if you want track spice sessions only (json-int)
3102- "channel-id": channel id. Usually "0", might be different needed when
3103 multiple channels of the same type exist, such as multiple
3104 display channels in a multihead setup (json-int)
Alberto Garcia3599d462015-02-26 16:35:07 +02003105- "tls": whether the channel is encrypted (json-bool)
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01003106
3107Example:
3108
3109-> { "execute": "query-spice" }
3110<- {
3111 "return": {
3112 "enabled": true,
3113 "auth": "spice",
3114 "port": 5920,
3115 "tls-port": 5921,
3116 "host": "0.0.0.0",
3117 "channels": [
3118 {
3119 "port": "54924",
3120 "family": "ipv4",
3121 "channel-type": 1,
3122 "connection-id": 1804289383,
3123 "host": "127.0.0.1",
3124 "channel-id": 0,
3125 "tls": true
3126 },
3127 {
3128 "port": "36710",
3129 "family": "ipv4",
3130 "channel-type": 4,
3131 "connection-id": 1804289383,
3132 "host": "127.0.0.1",
3133 "channel-id": 0,
3134 "tls": false
3135 },
3136 [ ... more channels follow ... ]
3137 ]
3138 }
3139 }
3140
3141EQMP
3142
Luiz Capitulinod1f29642011-10-20 17:01:33 -02003143#if defined(CONFIG_SPICE)
3144 {
3145 .name = "query-spice",
3146 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003147 .mhandler.cmd_new = qmp_marshal_query_spice,
Luiz Capitulinod1f29642011-10-20 17:01:33 -02003148 },
3149#endif
3150
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01003151SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003152query-name
3153----------
3154
3155Show VM name.
3156
3157Return a json-object with the following information:
3158
3159- "name": VM's name (json-string, optional)
3160
3161Example:
3162
3163-> { "execute": "query-name" }
3164<- { "return": { "name": "qemu-name" } }
3165
3166EQMP
3167
Anthony Liguori48a32be2011-09-02 12:34:48 -05003168 {
3169 .name = "query-name",
3170 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003171 .mhandler.cmd_new = qmp_marshal_query_name,
Anthony Liguori48a32be2011-09-02 12:34:48 -05003172 },
3173
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003174SQMP
3175query-uuid
3176----------
3177
3178Show VM UUID.
3179
3180Return a json-object with the following information:
3181
3182- "UUID": Universally Unique Identifier (json-string)
3183
3184Example:
3185
3186-> { "execute": "query-uuid" }
3187<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3188
3189EQMP
3190
Luiz Capitulinoefab7672011-09-13 17:16:25 -03003191 {
3192 .name = "query-uuid",
3193 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003194 .mhandler.cmd_new = qmp_marshal_query_uuid,
Luiz Capitulinoefab7672011-09-13 17:16:25 -03003195 },
3196
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003197SQMP
Amos Kong1f8f9872013-04-25 17:50:35 +08003198query-command-line-options
3199--------------------------
3200
3201Show command line option schema.
3202
3203Return a json-array of command line option schema for all options (or for
3204the given option), returning an error if the given option doesn't exist.
3205
3206Each array entry contains the following:
3207
3208- "option": option name (json-string)
3209- "parameters": a json-array describes all parameters of the option:
3210 - "name": parameter name (json-string)
3211 - "type": parameter type (one of 'string', 'boolean', 'number',
3212 or 'size')
3213 - "help": human readable description of the parameter
3214 (json-string, optional)
Chunyan Liue36af942014-06-05 17:20:43 +08003215 - "default": default value string for the parameter
3216 (json-string, optional)
Amos Kong1f8f9872013-04-25 17:50:35 +08003217
3218Example:
3219
3220-> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3221<- { "return": [
3222 {
3223 "parameters": [
3224 {
3225 "name": "romfile",
3226 "type": "string"
3227 },
3228 {
3229 "name": "bootindex",
3230 "type": "number"
3231 }
3232 ],
3233 "option": "option-rom"
3234 }
3235 ]
3236 }
3237
3238EQMP
3239
3240 {
3241 .name = "query-command-line-options",
3242 .args_type = "option:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003243 .mhandler.cmd_new = qmp_marshal_query_command_line_options,
Amos Kong1f8f9872013-04-25 17:50:35 +08003244 },
3245
3246SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003247query-migrate
3248-------------
3249
3250Migration status.
3251
3252Return a json-object. If migration is active there will be another json-object
3253with RAM migration status and if block migration is active another one with
3254block migration status.
3255
3256The main json-object contains the following:
3257
3258- "status": migration status (json-string)
Peter Feiner3b695952014-05-16 10:40:47 -04003259 - Possible values: "setup", "active", "completed", "failed", "cancelled"
Juan Quintela7aa939a2012-08-18 13:17:10 +02003260- "total-time": total amount of ms since migration started. If
3261 migration has ended, it returns the total migration
Juan Quintela817c6042013-02-11 15:11:10 +01003262 time (json-int)
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003263- "setup-time" amount of setup time in milliseconds _before_ the
3264 iterations begin but _after_ the QMP command is issued.
3265 This is designed to provide an accounting of any activities
3266 (such as RDMA pinning) which may be expensive, but do not
3267 actually occur during the iterative migration rounds
3268 themselves. (json-int)
Juan Quintela9c5a9fc2012-08-13 09:35:16 +02003269- "downtime": only present when migration has finished correctly
3270 total amount in ms for downtime that happened (json-int)
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003271- "expected-downtime": only present while migration is active
3272 total amount in ms for downtime that was calculated on
Juan Quintela817c6042013-02-11 15:11:10 +01003273 the last bitmap round (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003274- "ram": only present if "status" is "active", it is a json-object with the
Juan Quintela817c6042013-02-11 15:11:10 +01003275 following RAM information:
3276 - "transferred": amount transferred in bytes (json-int)
3277 - "remaining": amount remaining to transfer in bytes (json-int)
3278 - "total": total amount of memory in bytes (json-int)
3279 - "duplicate": number of pages filled entirely with the same
3280 byte (json-int)
3281 These are sent over the wire much more efficiently.
Peter Lievenf1c72792013-03-26 10:58:37 +01003282 - "skipped": number of skipped zero pages (json-int)
Stefan Weil805a2502013-04-28 11:49:57 +02003283 - "normal" : number of whole pages transferred. I.e. they
Juan Quintela817c6042013-02-11 15:11:10 +01003284 were not sent as duplicate or xbzrle pages (json-int)
3285 - "normal-bytes" : number of bytes transferred in whole
3286 pages. This is just normal pages times size of one page,
3287 but this way upper levels don't need to care about page
3288 size (json-int)
ChenLiang58570ed2014-04-04 17:57:55 +08003289 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003290- "disk": only present if "status" is "active" and it is a block migration,
Juan Quintela817c6042013-02-11 15:11:10 +01003291 it is a json-object with the following disk information:
3292 - "transferred": amount transferred in bytes (json-int)
3293 - "remaining": amount remaining to transfer in bytes json-int)
3294 - "total": total disk size in bytes (json-int)
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003295- "xbzrle-cache": only present if XBZRLE is active.
3296 It is a json-object with the following XBZRLE information:
Juan Quintela817c6042013-02-11 15:11:10 +01003297 - "cache-size": XBZRLE cache size in bytes
3298 - "bytes": number of bytes transferred for XBZRLE compressed pages
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003299 - "pages": number of XBZRLE compressed pages
Juan Quintela817c6042013-02-11 15:11:10 +01003300 - "cache-miss": number of XBRZRLE page cache misses
ChenLiang8bc39232014-04-04 17:57:56 +08003301 - "cache-miss-rate": rate of XBRZRLE page cache misses
Juan Quintela817c6042013-02-11 15:11:10 +01003302 - "overflow": number of times XBZRLE overflows. This means
3303 that the XBZRLE encoding was bigger than just sent the
3304 whole page, and then we sent the whole page instead (as as
3305 normal page).
3306
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003307Examples:
3308
33091. Before the first migration
3310
3311-> { "execute": "query-migrate" }
3312<- { "return": {} }
3313
33142. Migration is done and has succeeded
3315
3316-> { "execute": "query-migrate" }
Orit Wasserman004d4c12012-08-06 21:42:56 +03003317<- { "return": {
3318 "status": "completed",
3319 "ram":{
3320 "transferred":123,
3321 "remaining":123,
3322 "total":246,
3323 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003324 "setup-time":12345,
Juan Quintela9c5a9fc2012-08-13 09:35:16 +02003325 "downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003326 "duplicate":123,
3327 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003328 "normal-bytes":123456,
3329 "dirty-sync-count":15
Orit Wasserman004d4c12012-08-06 21:42:56 +03003330 }
3331 }
3332 }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003333
33343. Migration is done and has failed
3335
3336-> { "execute": "query-migrate" }
3337<- { "return": { "status": "failed" } }
3338
33394. Migration is being performed and is not a block migration:
3340
3341-> { "execute": "query-migrate" }
3342<- {
3343 "return":{
3344 "status":"active",
3345 "ram":{
3346 "transferred":123,
3347 "remaining":123,
Orit Wasserman62d4e3f2012-08-06 21:42:55 +03003348 "total":246,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003349 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003350 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003351 "expected-downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003352 "duplicate":123,
3353 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003354 "normal-bytes":123456,
3355 "dirty-sync-count":15
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003356 }
3357 }
3358 }
3359
33605. Migration is being performed and is a block migration:
3361
3362-> { "execute": "query-migrate" }
3363<- {
3364 "return":{
3365 "status":"active",
3366 "ram":{
3367 "total":1057024,
3368 "remaining":1053304,
Orit Wasserman62d4e3f2012-08-06 21:42:55 +03003369 "transferred":3720,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003370 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003371 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003372 "expected-downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003373 "duplicate":123,
3374 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003375 "normal-bytes":123456,
3376 "dirty-sync-count":15
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003377 },
3378 "disk":{
3379 "total":20971520,
3380 "remaining":20880384,
3381 "transferred":91136
3382 }
3383 }
3384 }
3385
Orit Wassermanf36d55a2012-08-06 21:42:57 +030033866. Migration is being performed and XBZRLE is active:
3387
3388-> { "execute": "query-migrate" }
3389<- {
3390 "return":{
3391 "status":"active",
3392 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3393 "ram":{
3394 "total":1057024,
3395 "remaining":1053304,
3396 "transferred":3720,
3397 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003398 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003399 "expected-downtime":12345,
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003400 "duplicate":10,
3401 "normal":3333,
ChenLiang58570ed2014-04-04 17:57:55 +08003402 "normal-bytes":3412992,
3403 "dirty-sync-count":15
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003404 },
3405 "xbzrle-cache":{
3406 "cache-size":67108864,
3407 "bytes":20971520,
3408 "pages":2444343,
3409 "cache-miss":2244,
ChenLiang8bc39232014-04-04 17:57:56 +08003410 "cache-miss-rate":0.123,
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003411 "overflow":34434
3412 }
3413 }
3414 }
3415
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003416EQMP
3417
Luiz Capitulino791e7c82011-09-13 17:37:16 -03003418 {
3419 .name = "query-migrate",
3420 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003421 .mhandler.cmd_new = qmp_marshal_query_migrate,
Luiz Capitulino791e7c82011-09-13 17:37:16 -03003422 },
3423
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003424SQMP
Orit Wasserman00458432012-08-06 21:42:48 +03003425migrate-set-capabilities
Juan Quintela817c6042013-02-11 15:11:10 +01003426------------------------
Orit Wasserman00458432012-08-06 21:42:48 +03003427
3428Enable/Disable migration capabilities
3429
Juan Quintela817c6042013-02-11 15:11:10 +01003430- "xbzrle": XBZRLE support
zhanghailiangd6d69732014-12-09 14:38:37 +08003431- "rdma-pin-all": pin all pages when using RDMA during migration
3432- "auto-converge": throttle down guest to help convergence of migration
3433- "zero-blocks": compress zero blocks during block migration
Juan Quintela72e72e12015-07-08 14:13:10 +02003434- "events": generate events for each migration state change
Orit Wasserman00458432012-08-06 21:42:48 +03003435
3436Arguments:
3437
3438Example:
3439
3440-> { "execute": "migrate-set-capabilities" , "arguments":
3441 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3442
3443EQMP
3444
3445 {
3446 .name = "migrate-set-capabilities",
Paolo Bonzini43d0a2c2015-04-15 13:30:04 +02003447 .args_type = "capabilities:q",
Orit Wasserman00458432012-08-06 21:42:48 +03003448 .params = "capability:s,state:b",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003449 .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
Orit Wasserman00458432012-08-06 21:42:48 +03003450 },
3451SQMP
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003452query-migrate-capabilities
Juan Quintela817c6042013-02-11 15:11:10 +01003453--------------------------
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003454
3455Query current migration capabilities
3456
3457- "capabilities": migration capabilities state
3458 - "xbzrle" : XBZRLE state (json-bool)
zhanghailiangd6d69732014-12-09 14:38:37 +08003459 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3460 - "auto-converge" : Auto Converge state (json-bool)
3461 - "zero-blocks" : Zero Blocks state (json-bool)
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003462
3463Arguments:
3464
3465Example:
3466
3467-> { "execute": "query-migrate-capabilities" }
Orit Wassermandbca1b32013-01-31 09:12:17 +02003468<- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3469
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003470EQMP
3471
3472 {
3473 .name = "query-migrate-capabilities",
3474 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003475 .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003476 },
3477
3478SQMP
Liang Li85de8322015-03-23 16:32:28 +08003479migrate-set-parameters
3480----------------------
3481
3482Set migration parameters
3483
3484- "compress-level": set compression level during migration (json-int)
3485- "compress-threads": set compression thread count for migration (json-int)
3486- "decompress-threads": set decompression thread count for migration (json-int)
3487
3488Arguments:
3489
3490Example:
3491
3492-> { "execute": "migrate-set-parameters" , "arguments":
3493 { "compress-level": 1 } }
3494
3495EQMP
3496
3497 {
3498 .name = "migrate-set-parameters",
3499 .args_type =
3500 "compress-level:i?,compress-threads:i?,decompress-threads:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003501 .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
Liang Li85de8322015-03-23 16:32:28 +08003502 },
3503SQMP
3504query-migrate-parameters
3505------------------------
3506
3507Query current migration parameters
3508
3509- "parameters": migration parameters value
3510 - "compress-level" : compression level value (json-int)
3511 - "compress-threads" : compression thread count value (json-int)
3512 - "decompress-threads" : decompression thread count value (json-int)
3513
3514Arguments:
3515
3516Example:
3517
3518-> { "execute": "query-migrate-parameters" }
3519<- {
3520 "return": {
3521 "decompress-threads", 2,
3522 "compress-threads", 8,
3523 "compress-level", 1
3524 }
3525 }
3526
3527EQMP
3528
3529 {
3530 .name = "query-migrate-parameters",
3531 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003532 .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
Liang Li85de8322015-03-23 16:32:28 +08003533 },
3534
3535SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003536query-balloon
3537-------------
3538
3539Show balloon information.
3540
3541Make an asynchronous request for balloon info. When the request completes a
3542json-object will be returned containing the following data:
3543
3544- "actual": current balloon value in bytes (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003545
3546Example:
3547
3548-> { "execute": "query-balloon" }
3549<- {
3550 "return":{
3551 "actual":1073741824,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003552 }
3553 }
3554
3555EQMP
3556
Luiz Capitulino96637bc2011-10-21 11:41:37 -02003557 {
3558 .name = "query-balloon",
3559 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003560 .mhandler.cmd_new = qmp_marshal_query_balloon,
Luiz Capitulino96637bc2011-10-21 11:41:37 -02003561 },
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003562
3563 {
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00003564 .name = "query-block-jobs",
3565 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003566 .mhandler.cmd_new = qmp_marshal_query_block_jobs,
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00003567 },
3568
3569 {
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003570 .name = "qom-list",
3571 .args_type = "path:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003572 .mhandler.cmd_new = qmp_marshal_qom_list,
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003573 },
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003574
3575 {
3576 .name = "qom-set",
Paolo Bonzinib9f89782012-03-22 12:51:11 +01003577 .args_type = "path:s,property:s,value:q",
Markus Armbruster6eb39372015-09-16 13:06:25 +02003578 .mhandler.cmd_new = qmp_marshal_qom_set,
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003579 },
3580
3581 {
3582 .name = "qom-get",
3583 .args_type = "path:s,property:s",
Markus Armbruster6eb39372015-09-16 13:06:25 +02003584 .mhandler.cmd_new = qmp_marshal_qom_get,
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003585 },
Luiz Capitulino270b2432011-12-08 11:45:55 -02003586
3587 {
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003588 .name = "nbd-server-start",
3589 .args_type = "addr:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003590 .mhandler.cmd_new = qmp_marshal_nbd_server_start,
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003591 },
3592 {
3593 .name = "nbd-server-add",
3594 .args_type = "device:B,writable:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003595 .mhandler.cmd_new = qmp_marshal_nbd_server_add,
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003596 },
3597 {
3598 .name = "nbd-server-stop",
3599 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003600 .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003601 },
3602
3603 {
Luiz Capitulino270b2432011-12-08 11:45:55 -02003604 .name = "change-vnc-password",
3605 .args_type = "password:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003606 .mhandler.cmd_new = qmp_marshal_change_vnc_password,
Luiz Capitulino270b2432011-12-08 11:45:55 -02003607 },
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06003608 {
3609 .name = "qom-list-types",
3610 .args_type = "implements:s?,abstract:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003611 .mhandler.cmd_new = qmp_marshal_qom_list_types,
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06003612 },
Anthony Liguori1daa31b2012-08-10 11:04:09 -05003613
3614 {
3615 .name = "device-list-properties",
3616 .args_type = "typename:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003617 .mhandler.cmd_new = qmp_marshal_device_list_properties,
Anthony Liguori1daa31b2012-08-10 11:04:09 -05003618 },
3619
Anthony Liguori01d3c802012-08-10 11:04:11 -05003620 {
3621 .name = "query-machines",
3622 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003623 .mhandler.cmd_new = qmp_marshal_query_machines,
Anthony Liguori01d3c802012-08-10 11:04:11 -05003624 },
3625
Anthony Liguorie4e31c62012-08-10 11:04:13 -05003626 {
3627 .name = "query-cpu-definitions",
3628 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003629 .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
Anthony Liguorie4e31c62012-08-10 11:04:13 -05003630 },
3631
Daniel P. Berrange99afc912012-08-20 15:31:38 +01003632 {
3633 .name = "query-target",
3634 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003635 .mhandler.cmd_new = qmp_marshal_query_target,
Daniel P. Berrange99afc912012-08-20 15:31:38 +01003636 },
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003637
3638 {
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003639 .name = "query-tpm",
3640 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003641 .mhandler.cmd_new = qmp_marshal_query_tpm,
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003642 },
3643
Corey Bryant28c4fa32013-03-20 12:34:49 -04003644SQMP
3645query-tpm
3646---------
3647
3648Return information about the TPM device.
3649
3650Arguments: None
3651
3652Example:
3653
3654-> { "execute": "query-tpm" }
3655<- { "return":
3656 [
3657 { "model": "tpm-tis",
3658 "options":
3659 { "type": "passthrough",
3660 "data":
3661 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3662 "path": "/dev/tpm0"
3663 }
3664 },
3665 "id": "tpm0"
3666 }
3667 ]
3668 }
3669
3670EQMP
3671
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003672 {
3673 .name = "query-tpm-models",
3674 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003675 .mhandler.cmd_new = qmp_marshal_query_tpm_models,
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003676 },
3677
Corey Bryant28c4fa32013-03-20 12:34:49 -04003678SQMP
3679query-tpm-models
3680----------------
3681
3682Return a list of supported TPM models.
3683
3684Arguments: None
3685
3686Example:
3687
3688-> { "execute": "query-tpm-models" }
3689<- { "return": [ "tpm-tis" ] }
3690
3691EQMP
3692
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003693 {
3694 .name = "query-tpm-types",
3695 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003696 .mhandler.cmd_new = qmp_marshal_query_tpm_types,
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003697 },
3698
Corey Bryant28c4fa32013-03-20 12:34:49 -04003699SQMP
3700query-tpm-types
3701---------------
3702
3703Return a list of supported TPM types.
3704
3705Arguments: None
3706
3707Example:
3708
3709-> { "execute": "query-tpm-types" }
3710<- { "return": [ "passthrough" ] }
3711
3712EQMP
3713
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003714 {
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003715 .name = "chardev-add",
3716 .args_type = "id:s,backend:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003717 .mhandler.cmd_new = qmp_marshal_chardev_add,
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003718 },
3719
3720SQMP
3721chardev-add
3722----------------
3723
3724Add a chardev.
3725
3726Arguments:
3727
3728- "id": the chardev's ID, must be unique (json-string)
3729- "backend": chardev backend type + parameters
3730
Gerd Hoffmannffbdbe52012-12-19 13:13:57 +01003731Examples:
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003732
3733-> { "execute" : "chardev-add",
3734 "arguments" : { "id" : "foo",
3735 "backend" : { "type" : "null", "data" : {} } } }
3736<- { "return": {} }
3737
Gerd Hoffmannffbdbe52012-12-19 13:13:57 +01003738-> { "execute" : "chardev-add",
3739 "arguments" : { "id" : "bar",
3740 "backend" : { "type" : "file",
3741 "data" : { "out" : "/tmp/bar.log" } } } }
3742<- { "return": {} }
3743
Gerd Hoffmann0a1a7fa2012-12-20 14:39:13 +01003744-> { "execute" : "chardev-add",
3745 "arguments" : { "id" : "baz",
3746 "backend" : { "type" : "pty", "data" : {} } } }
3747<- { "return": { "pty" : "/dev/pty/42" } }
3748
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003749EQMP
3750
3751 {
3752 .name = "chardev-remove",
3753 .args_type = "id:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003754 .mhandler.cmd_new = qmp_marshal_chardev_remove,
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003755 },
3756
3757
3758SQMP
3759chardev-remove
3760--------------
3761
3762Remove a chardev.
3763
3764Arguments:
3765
3766- "id": the chardev's ID, must exist and not be in use (json-string)
3767
3768Example:
3769
3770-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3771<- { "return": {} }
3772
3773EQMP
Amos Kongb1be4282013-06-14 15:45:52 +08003774 {
3775 .name = "query-rx-filter",
3776 .args_type = "name:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003777 .mhandler.cmd_new = qmp_marshal_query_rx_filter,
Amos Kongb1be4282013-06-14 15:45:52 +08003778 },
3779
3780SQMP
3781query-rx-filter
3782---------------
3783
3784Show rx-filter information.
3785
3786Returns a json-array of rx-filter information for all NICs (or for the
3787given NIC), returning an error if the given NIC doesn't exist, or
3788given NIC doesn't support rx-filter querying, or given net client
3789isn't a NIC.
3790
3791The query will clear the event notification flag of each NIC, then qemu
3792will start to emit event to QMP monitor.
3793
3794Each array entry contains the following:
3795
3796- "name": net client name (json-string)
3797- "promiscuous": promiscuous mode is enabled (json-bool)
3798- "multicast": multicast receive state (one of 'normal', 'none', 'all')
3799- "unicast": unicast receive state (one of 'normal', 'none', 'all')
Amos Kongf7bc8ef2014-03-26 08:19:43 +08003800- "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
Amos Kongb1be4282013-06-14 15:45:52 +08003801- "broadcast-allowed": allow to receive broadcast (json-bool)
3802- "multicast-overflow": multicast table is overflowed (json-bool)
3803- "unicast-overflow": unicast table is overflowed (json-bool)
3804- "main-mac": main macaddr string (json-string)
3805- "vlan-table": a json-array of active vlan id
3806- "unicast-table": a json-array of unicast macaddr string
3807- "multicast-table": a json-array of multicast macaddr string
3808
3809Example:
3810
3811-> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3812<- { "return": [
3813 {
3814 "promiscuous": true,
3815 "name": "vnet0",
3816 "main-mac": "52:54:00:12:34:56",
3817 "unicast": "normal",
Amos Kongf7bc8ef2014-03-26 08:19:43 +08003818 "vlan": "normal",
Amos Kongb1be4282013-06-14 15:45:52 +08003819 "vlan-table": [
3820 4,
3821 0
3822 ],
3823 "unicast-table": [
3824 ],
3825 "multicast": "normal",
3826 "multicast-overflow": false,
3827 "unicast-overflow": false,
3828 "multicast-table": [
3829 "01:00:5e:00:00:01",
3830 "33:33:00:00:00:01",
3831 "33:33:ff:12:34:56"
3832 ],
3833 "broadcast-allowed": false
3834 }
3835 ]
3836 }
3837
3838EQMP
Kevin Wolfd26c9a12013-09-23 15:26:03 +02003839
3840 {
3841 .name = "blockdev-add",
3842 .args_type = "options:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003843 .mhandler.cmd_new = qmp_marshal_blockdev_add,
Kevin Wolfd26c9a12013-09-23 15:26:03 +02003844 },
3845
3846SQMP
3847blockdev-add
3848------------
3849
3850Add a block device.
3851
Markus Armbrusterda2cf4e2015-03-20 14:32:17 +01003852This command is still a work in progress. It doesn't support all
3853block drivers, it lacks a matching blockdev-del, and more. Stay away
3854from it unless you want to help with its development.
3855
Kevin Wolfd26c9a12013-09-23 15:26:03 +02003856Arguments:
3857
3858- "options": block driver options
3859
3860Example (1):
3861
3862-> { "execute": "blockdev-add",
3863 "arguments": { "options" : { "driver": "qcow2",
3864 "file": { "driver": "file",
3865 "filename": "test.qcow2" } } } }
3866<- { "return": {} }
3867
3868Example (2):
3869
3870-> { "execute": "blockdev-add",
3871 "arguments": {
3872 "options": {
3873 "driver": "qcow2",
3874 "id": "my_disk",
3875 "discard": "unmap",
3876 "cache": {
3877 "direct": true,
3878 "writeback": true
3879 },
3880 "file": {
3881 "driver": "file",
3882 "filename": "/tmp/test.qcow2"
3883 },
3884 "backing": {
3885 "driver": "raw",
3886 "file": {
3887 "driver": "file",
3888 "filename": "/dev/fdset/4"
3889 }
3890 }
3891 }
3892 }
3893 }
3894
3895<- { "return": {} }
3896
3897EQMP
Benoît Canetc13163f2014-01-23 21:31:34 +01003898
3899 {
3900 .name = "query-named-block-nodes",
3901 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003902 .mhandler.cmd_new = qmp_marshal_query_named_block_nodes,
Benoît Canetc13163f2014-01-23 21:31:34 +01003903 },
3904
3905SQMP
3906@query-named-block-nodes
3907------------------------
3908
3909Return a list of BlockDeviceInfo for all the named block driver nodes
3910
3911Example:
3912
3913-> { "execute": "query-named-block-nodes" }
3914<- { "return": [ { "ro":false,
3915 "drv":"qcow2",
3916 "encrypted":false,
3917 "file":"disks/test.qcow2",
3918 "node-name": "my-node",
3919 "backing_file_depth":1,
3920 "bps":1000000,
3921 "bps_rd":0,
3922 "bps_wr":0,
3923 "iops":1000000,
3924 "iops_rd":0,
3925 "iops_wr":0,
3926 "bps_max": 8000000,
3927 "bps_rd_max": 0,
3928 "bps_wr_max": 0,
3929 "iops_max": 0,
3930 "iops_rd_max": 0,
3931 "iops_wr_max": 0,
3932 "iops_size": 0,
Francesco Romanie2462112015-01-12 14:11:13 +01003933 "write_threshold": 0,
Benoît Canetc13163f2014-01-23 21:31:34 +01003934 "image":{
3935 "filename":"disks/test.qcow2",
3936 "format":"qcow2",
3937 "virtual-size":2048000,
3938 "backing_file":"base.qcow2",
3939 "full-backing-filename":"disks/base.qcow2",
John Snow54034322015-04-28 15:20:41 -04003940 "backing-filename-format":"qcow2",
Benoît Canetc13163f2014-01-23 21:31:34 +01003941 "snapshots":[
3942 {
3943 "id": "1",
3944 "name": "snapshot1",
3945 "vm-state-size": 0,
3946 "date-sec": 10000200,
3947 "date-nsec": 12,
3948 "vm-clock-sec": 206,
3949 "vm-clock-nsec": 30
3950 }
3951 ],
3952 "backing-image":{
3953 "filename":"disks/base.qcow2",
3954 "format":"qcow2",
3955 "virtual-size":2048000
3956 }
Michael S. Tsirkinc0594512014-06-16 15:20:18 +03003957 } } ] }
Benoît Canetc13163f2014-01-23 21:31:34 +01003958
3959EQMP
Hu Tao76b5d852014-06-16 18:05:41 +08003960
3961 {
3962 .name = "query-memdev",
3963 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003964 .mhandler.cmd_new = qmp_marshal_query_memdev,
Hu Tao76b5d852014-06-16 18:05:41 +08003965 },
3966
3967SQMP
3968query-memdev
3969------------
3970
3971Show memory devices information.
3972
3973
3974Example (1):
3975
3976-> { "execute": "query-memdev" }
3977<- { "return": [
3978 {
3979 "size": 536870912,
3980 "merge": false,
3981 "dump": true,
3982 "prealloc": false,
3983 "host-nodes": [0, 1],
3984 "policy": "bind"
3985 },
3986 {
3987 "size": 536870912,
3988 "merge": false,
3989 "dump": true,
3990 "prealloc": true,
3991 "host-nodes": [2, 3],
3992 "policy": "preferred"
3993 }
3994 ]
3995 }
3996
3997EQMP
Igor Mammedov6f2e2732014-06-16 19:12:25 +02003998
3999 {
4000 .name = "query-memory-devices",
4001 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004002 .mhandler.cmd_new = qmp_marshal_query_memory_devices,
Igor Mammedov6f2e2732014-06-16 19:12:25 +02004003 },
4004
4005SQMP
4006@query-memory-devices
4007--------------------
4008
4009Return a list of memory devices.
4010
4011Example:
4012-> { "execute": "query-memory-devices" }
4013<- { "return": [ { "data":
4014 { "addr": 5368709120,
4015 "hotpluggable": true,
4016 "hotplugged": true,
4017 "id": "d1",
4018 "memdev": "/objects/memX",
4019 "node": 0,
4020 "size": 1073741824,
4021 "slot": 0},
4022 "type": "dimm"
4023 } ] }
4024EQMP
Igor Mammedov02419bc2014-06-16 19:12:28 +02004025
4026 {
4027 .name = "query-acpi-ospm-status",
4028 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004029 .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status,
Igor Mammedov02419bc2014-06-16 19:12:28 +02004030 },
4031
4032SQMP
4033@query-acpi-ospm-status
4034--------------------
4035
4036Return list of ACPIOSTInfo for devices that support status reporting
4037via ACPI _OST method.
4038
4039Example:
4040-> { "execute": "query-acpi-ospm-status" }
4041<- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4042 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4043 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4044 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4045 ]}
4046EQMP
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004047
4048#if defined TARGET_I386
4049 {
4050 .name = "rtc-reset-reinjection",
4051 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004052 .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection,
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004053 },
4054#endif
4055
4056SQMP
4057rtc-reset-reinjection
4058---------------------
4059
4060Reset the RTC interrupt reinjection backlog.
4061
4062Arguments: None.
4063
4064Example:
4065
4066-> { "execute": "rtc-reset-reinjection" }
4067<- { "return": {} }
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004068EQMP
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004069
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004070 {
4071 .name = "trace-event-get-state",
4072 .args_type = "name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004073 .mhandler.cmd_new = qmp_marshal_trace_event_get_state,
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004074 },
4075
4076SQMP
4077trace-event-get-state
4078---------------------
4079
4080Query the state of events.
4081
4082Example:
4083
4084-> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4085<- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4086EQMP
4087
4088 {
4089 .name = "trace-event-set-state",
4090 .args_type = "name:s,enable:b,ignore-unavailable:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004091 .mhandler.cmd_new = qmp_marshal_trace_event_set_state,
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004092 },
4093
4094SQMP
4095trace-event-set-state
4096---------------------
4097
4098Set the state of events.
4099
4100Example:
4101
4102-> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4103<- { "return": {} }
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004104EQMP
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004105
4106 {
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004107 .name = "x-input-send-event",
Amos Kong51fc4472014-11-07 12:41:25 +08004108 .args_type = "console:i?,events:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004109 .mhandler.cmd_new = qmp_marshal_x_input_send_event,
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004110 },
4111
4112SQMP
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004113@x-input-send-event
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004114-----------------
4115
4116Send input event to guest.
4117
4118Arguments:
4119
Amos Kong51fc4472014-11-07 12:41:25 +08004120- "console": console index. (json-int, optional)
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004121- "events": list of input events.
4122
4123The consoles are visible in the qom tree, under
4124/backend/console[$index]. They have a device link and head property, so
4125it is possible to map which console belongs to which device and display.
4126
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004127Note: this command is experimental, and not a stable API.
4128
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004129Example (1):
4130
4131Press left mouse button.
4132
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004133-> { "execute": "x-input-send-event",
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004134 "arguments": { "console": 0,
4135 "events": [ { "type": "btn",
Amos Kongb5369dd2014-11-25 16:05:56 +08004136 "data" : { "down": true, "button": "Left" } } ] } }
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004137<- { "return": {} }
4138
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004139-> { "execute": "x-input-send-event",
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004140 "arguments": { "console": 0,
4141 "events": [ { "type": "btn",
Amos Kongb5369dd2014-11-25 16:05:56 +08004142 "data" : { "down": false, "button": "Left" } } ] } }
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004143<- { "return": {} }
4144
4145Example (2):
4146
4147Press ctrl-alt-del.
4148
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004149-> { "execute": "x-input-send-event",
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004150 "arguments": { "console": 0, "events": [
4151 { "type": "key", "data" : { "down": true,
4152 "key": {"type": "qcode", "data": "ctrl" } } },
4153 { "type": "key", "data" : { "down": true,
4154 "key": {"type": "qcode", "data": "alt" } } },
4155 { "type": "key", "data" : { "down": true,
4156 "key": {"type": "qcode", "data": "delete" } } } ] } }
4157<- { "return": {} }
4158
4159Example (3):
4160
4161Move mouse pointer to absolute coordinates (20000, 400).
4162
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004163-> { "execute": "x-input-send-event" ,
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004164 "arguments": { "console": 0, "events": [
4165 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
4166 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
4167<- { "return": {} }
4168
4169EQMP
Francesco Romanie2462112015-01-12 14:11:13 +01004170
4171 {
4172 .name = "block-set-write-threshold",
4173 .args_type = "node-name:s,write-threshold:l",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004174 .mhandler.cmd_new = qmp_marshal_block_set_write_threshold,
Francesco Romanie2462112015-01-12 14:11:13 +01004175 },
4176
4177SQMP
4178block-set-write-threshold
4179------------
4180
4181Change the write threshold for a block drive. The threshold is an offset,
4182thus must be non-negative. Default is no write threshold.
4183Setting the threshold to zero disables it.
4184
4185Arguments:
4186
4187- "node-name": the node name in the block driver state graph (json-string)
4188- "write-threshold": the write threshold in bytes (json-int)
4189
4190Example:
4191
4192-> { "execute": "block-set-write-threshold",
4193 "arguments": { "node-name": "mydev",
4194 "write-threshold": 17179869184 } }
4195<- { "return": {} }
4196
4197EQMP
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004198
4199 {
4200 .name = "query-rocker",
4201 .args_type = "name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004202 .mhandler.cmd_new = qmp_marshal_query_rocker,
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004203 },
4204
4205SQMP
4206Show rocker switch
4207------------------
4208
4209Arguments:
4210
4211- "name": switch name
4212
4213Example:
4214
4215-> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4216<- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4217
4218EQMP
4219
4220 {
4221 .name = "query-rocker-ports",
4222 .args_type = "name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004223 .mhandler.cmd_new = qmp_marshal_query_rocker_ports,
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004224 },
4225
4226SQMP
4227Show rocker switch ports
4228------------------------
4229
4230Arguments:
4231
4232- "name": switch name
4233
4234Example:
4235
4236-> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4237<- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4238 "autoneg": "off", "link-up": true, "speed": 10000},
4239 {"duplex": "full", "enabled": true, "name": "sw1.2",
4240 "autoneg": "off", "link-up": true, "speed": 10000}
4241 ]}
4242
4243EQMP
4244
4245 {
4246 .name = "query-rocker-of-dpa-flows",
4247 .args_type = "name:s,tbl-id:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004248 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows,
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004249 },
4250
4251SQMP
4252Show rocker switch OF-DPA flow tables
4253-------------------------------------
4254
4255Arguments:
4256
4257- "name": switch name
4258- "tbl-id": (optional) flow table ID
4259
4260Example:
4261
4262-> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4263<- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4264 "hits": 138,
4265 "cookie": 0,
4266 "action": {"goto-tbl": 10},
4267 "mask": {"in-pport": 4294901760}
4268 },
4269 {...more...},
4270 ]}
4271
4272EQMP
4273
4274 {
4275 .name = "query-rocker-of-dpa-groups",
4276 .args_type = "name:s,type:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004277 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups,
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004278 },
4279
4280SQMP
4281Show rocker OF-DPA group tables
4282-------------------------------
4283
4284Arguments:
4285
4286- "name": switch name
4287- "type": (optional) group type
4288
4289Example:
4290
4291-> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4292<- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4293 "pop-vlan": 1, "id": 251723778},
4294 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4295 "pop-vlan": 1, "id": 251723776},
4296 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4297 "pop-vlan": 1, "id": 251658241},
4298 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4299 "pop-vlan": 1, "id": 251658240}
4300 ]}