blob: 5a5440636d46a16a7a0607082325f8cfd2bf0efe [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
Markus Armbrusterb8a98322015-09-16 13:06:26 +0200920-> { "execute": "netdev_add",
921 "arguments": { "type": "user", "id": "netdev1",
922 "dnssearch": "example.org" } }
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300923<- { "return": {} }
924
Markus Armbrusteraf347aa2013-02-22 18:31:51 +0100925Note: The supported device options are the same ones supported by the '-netdev'
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300926 command-line argument, which are listed in the '-help' output or QEMU's
927 manual
928
929EQMP
930
931 {
932 .name = "netdev_del",
933 .args_type = "id:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200934 .mhandler.cmd_new = qmp_marshal_netdev_del,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300935 },
936
937SQMP
938netdev_del
939----------
940
941Remove host network device.
942
943Arguments:
944
945- "id": the device's ID, must be unique (json-string)
946
947Example:
948
949-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
950<- { "return": {} }
951
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100952
953EQMP
954
955 {
Paolo Bonzinicff8b2c2013-12-20 23:21:10 +0100956 .name = "object-add",
957 .args_type = "qom-type:s,id:s,props:q?",
Markus Armbruster6eb39372015-09-16 13:06:25 +0200958 .mhandler.cmd_new = qmp_marshal_object_add,
Paolo Bonzinicff8b2c2013-12-20 23:21:10 +0100959 },
960
961SQMP
962object-add
963----------
964
965Create QOM object.
966
967Arguments:
968
969- "qom-type": the object's QOM type, i.e. the class name (json-string)
970- "id": the object's ID, must be unique (json-string)
971- "props": a dictionary of object property values (optional, json-dict)
972
973Example:
974
975-> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
976 "props": { "filename": "/dev/hwrng" } } }
977<- { "return": {} }
978
979EQMP
980
981 {
Paolo Bonziniab2d0532013-12-20 23:21:09 +0100982 .name = "object-del",
983 .args_type = "id:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +0200984 .mhandler.cmd_new = qmp_marshal_object_del,
Paolo Bonziniab2d0532013-12-20 23:21:09 +0100985 },
986
987SQMP
988object-del
989----------
990
991Remove QOM object.
992
993Arguments:
994
995- "id": the object's ID (json-string)
996
997Example:
998
999-> { "execute": "object-del", "arguments": { "id": "rng1" } }
1000<- { "return": {} }
1001
1002
1003EQMP
1004
1005
1006 {
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +01001007 .name = "block_resize",
Benoît Canet3b1dbd12014-01-23 21:31:37 +01001008 .args_type = "device:s?,node-name:s?,size:o",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001009 .mhandler.cmd_new = qmp_marshal_block_resize,
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +01001010 },
1011
1012SQMP
1013block_resize
1014------------
1015
1016Resize a block image while a guest is running.
1017
1018Arguments:
1019
1020- "device": the device's ID, must be unique (json-string)
Benoît Canet3b1dbd12014-01-23 21:31:37 +01001021- "node-name": the node name in the block driver state graph (json-string)
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +01001022- "size": new size
1023
1024Example:
1025
1026-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1027<- { "return": {} }
1028
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001029EQMP
1030
1031 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001032 .name = "block-stream",
Jeff Cody13d8cc52014-06-25 15:40:11 -04001033 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001034 .mhandler.cmd_new = qmp_marshal_block_stream,
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001035 },
1036
Stefan Hajnocziec683d62015-04-15 11:43:42 +01001037SQMP
1038block-stream
1039------------
1040
1041Copy data from a backing file into a block device.
1042
1043Arguments:
1044
1045- "device": The device's ID, must be unique (json-string)
1046- "base": The file name of the backing image above which copying starts
1047 (json-string, optional)
1048- "backing-file": The backing file string to write into the active layer. This
1049 filename is not validated.
1050
1051 If a pathname string is such that it cannot be resolved by
1052 QEMU, that means that subsequent QMP or HMP commands must use
1053 node-names for the image in question, as filename lookup
1054 methods will fail.
1055
1056 If not specified, QEMU will automatically determine the
1057 backing file string to use, or error out if there is no
1058 obvious choice. Care should be taken when specifying the
1059 string, to specify a valid filename or protocol.
1060 (json-string, optional) (Since 2.1)
1061- "speed": the maximum speed, in bytes per second (json-int, optional)
1062- "on-error": the action to take on an error (default 'report'). 'stop' and
1063 'enospc' can only be used if the block device supports io-status.
1064 (json-string, optional) (Since 2.1)
1065
1066Example:
1067
1068-> { "execute": "block-stream", "arguments": { "device": "virtio0",
1069 "base": "/tmp/master.qcow2" } }
1070<- { "return": {} }
1071
1072EQMP
1073
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001074 {
Jeff Codyed61fc12012-09-27 13:29:16 -04001075 .name = "block-commit",
Jeff Cody54e26902014-06-25 15:40:10 -04001076 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001077 .mhandler.cmd_new = qmp_marshal_block_commit,
Jeff Codyed61fc12012-09-27 13:29:16 -04001078 },
1079
Jeff Cody37222902014-01-24 09:02:37 -05001080SQMP
1081block-commit
1082------------
1083
1084Live commit of data from overlay image nodes into backing nodes - i.e., writes
1085data between 'top' and 'base' into 'base'.
1086
1087Arguments:
1088
1089- "device": The device's ID, must be unique (json-string)
1090- "base": The file name of the backing image to write data into.
1091 If not specified, this is the deepest backing image
1092 (json-string, optional)
1093- "top": The file name of the backing image within the image chain,
Jeff Cody7676e2c2014-06-30 15:14:15 +02001094 which contains the topmost data to be committed down. If
1095 not specified, this is the active layer. (json-string, optional)
Jeff Cody37222902014-01-24 09:02:37 -05001096
Jeff Cody54e26902014-06-25 15:40:10 -04001097- backing-file: The backing file string to write into the overlay
1098 image of 'top'. If 'top' is the active layer,
1099 specifying a backing file string is an error. This
1100 filename is not validated.
1101
1102 If a pathname string is such that it cannot be
1103 resolved by QEMU, that means that subsequent QMP or
1104 HMP commands must use node-names for the image in
1105 question, as filename lookup methods will fail.
1106
1107 If not specified, QEMU will automatically determine
1108 the backing file string to use, or error out if
1109 there is no obvious choice. Care should be taken
1110 when specifying the string, to specify a valid
1111 filename or protocol.
1112 (json-string, optional) (Since 2.1)
1113
Jeff Cody37222902014-01-24 09:02:37 -05001114 If top == base, that is an error.
1115 If top == active, the job will not be completed by itself,
1116 user needs to complete the job with the block-job-complete
1117 command after getting the ready event. (Since 2.0)
1118
1119 If the base image is smaller than top, then the base image
1120 will be resized to be the same size as top. If top is
1121 smaller than the base image, the base will not be
1122 truncated. If you want the base image size to match the
1123 size of the smaller top, you can safely truncate it
1124 yourself once the commit operation successfully completes.
1125 (json-string)
1126- "speed": the maximum speed, in bytes per second (json-int, optional)
1127
1128
1129Example:
1130
1131-> { "execute": "block-commit", "arguments": { "device": "virtio0",
1132 "top": "/tmp/snap1.qcow2" } }
1133<- { "return": {} }
1134
1135EQMP
1136
Jeff Codyed61fc12012-09-27 13:29:16 -04001137 {
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001138 .name = "drive-backup",
Stefan Hajnoczib53169e2013-06-26 14:11:57 +02001139 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
John Snowd58d8452015-04-17 19:49:58 -04001140 "bitmap:s?,on-source-error:s?,on-target-error:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001141 .mhandler.cmd_new = qmp_marshal_drive_backup,
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001142 },
1143
1144SQMP
1145drive-backup
1146------------
1147
1148Start a point-in-time copy of a block device to a new destination. The
1149status of ongoing drive-backup operations can be checked with
1150query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1151The operation can be stopped before it has completed using the
1152block-job-cancel command.
1153
1154Arguments:
1155
1156- "device": the name of the device which should be copied.
1157 (json-string)
1158- "target": the target of the new image. If the file exists, or if it is a
1159 device, the existing file/device will be used as the new
1160 destination. If it does not exist, a new file will be created.
1161 (json-string)
1162- "format": the format of the new destination, default is to probe if 'mode' is
1163 'existing', else the format of the source
1164 (json-string, optional)
Stefan Hajnoczib53169e2013-06-26 14:11:57 +02001165- "sync": what parts of the disk image should be copied to the destination;
1166 possibilities include "full" for all the disk, "top" for only the sectors
John Snow4b80ab22015-06-04 20:20:34 -04001167 allocated in the topmost image, "incremental" for only the dirty sectors in
John Snowd58d8452015-04-17 19:49:58 -04001168 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
John Snow4b80ab22015-06-04 20:20:34 -04001169- "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1170 is "incremental", must NOT be present otherwise.
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001171- "mode": whether and how QEMU should create a new image
1172 (NewImageMode, optional, default 'absolute-paths')
1173- "speed": the maximum speed, in bytes per second (json-int, optional)
1174- "on-source-error": the action to take on an error on the source, default
1175 'report'. 'stop' and 'enospc' can only be used
1176 if the block device supports io-status.
1177 (BlockdevOnError, optional)
1178- "on-target-error": the action to take on an error on the target, default
1179 'report' (no limitations, since this applies to
1180 a different block device than device).
1181 (BlockdevOnError, optional)
1182
1183Example:
1184-> { "execute": "drive-backup", "arguments": { "device": "drive0",
Ian Mainfc5d3f82013-07-26 11:39:04 -07001185 "sync": "full",
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001186 "target": "backup.img" } }
1187<- { "return": {} }
Fam Zhengc29c1dd2014-12-18 18:37:05 +08001188
1189EQMP
1190
1191 {
1192 .name = "blockdev-backup",
1193 .args_type = "sync:s,device:B,target:B,speed:i?,"
1194 "on-source-error:s?,on-target-error:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001195 .mhandler.cmd_new = qmp_marshal_blockdev_backup,
Fam Zhengc29c1dd2014-12-18 18:37:05 +08001196 },
1197
1198SQMP
1199blockdev-backup
1200---------------
1201
1202The device version of drive-backup: this command takes an existing named device
1203as backup target.
1204
1205Arguments:
1206
1207- "device": the name of the device which should be copied.
1208 (json-string)
1209- "target": the name of the backup target device. (json-string)
1210- "sync": what parts of the disk image should be copied to the destination;
1211 possibilities include "full" for all the disk, "top" for only the
1212 sectors allocated in the topmost image, or "none" to only replicate
1213 new I/O (MirrorSyncMode).
1214- "speed": the maximum speed, in bytes per second (json-int, optional)
1215- "on-source-error": the action to take on an error on the source, default
1216 'report'. 'stop' and 'enospc' can only be used
1217 if the block device supports io-status.
1218 (BlockdevOnError, optional)
1219- "on-target-error": the action to take on an error on the target, default
1220 'report' (no limitations, since this applies to
1221 a different block device than device).
1222 (BlockdevOnError, optional)
1223
1224Example:
1225-> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1226 "sync": "full",
1227 "target": "tgt-id" } }
1228<- { "return": {} }
1229
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001230EQMP
1231
1232 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001233 .name = "block-job-set-speed",
Stefan Hajnoczi882ec7c2012-04-25 16:51:02 +01001234 .args_type = "device:B,speed:o",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001235 .mhandler.cmd_new = qmp_marshal_block_job_set_speed,
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00001236 },
1237
1238 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001239 .name = "block-job-cancel",
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001240 .args_type = "device:B,force:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001241 .mhandler.cmd_new = qmp_marshal_block_job_cancel,
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00001242 },
Jeff Codyc1864022012-02-28 15:54:07 -05001243 {
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001244 .name = "block-job-pause",
1245 .args_type = "device:B",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001246 .mhandler.cmd_new = qmp_marshal_block_job_pause,
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001247 },
1248 {
1249 .name = "block-job-resume",
1250 .args_type = "device:B",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001251 .mhandler.cmd_new = qmp_marshal_block_job_resume,
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001252 },
1253 {
Paolo Bonziniaeae8832012-10-18 16:49:21 +02001254 .name = "block-job-complete",
1255 .args_type = "device:B",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001256 .mhandler.cmd_new = qmp_marshal_block_job_complete,
Paolo Bonziniaeae8832012-10-18 16:49:21 +02001257 },
1258 {
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001259 .name = "transaction",
Paolo Bonzinib9f89782012-03-22 12:51:11 +01001260 .args_type = "actions:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001261 .mhandler.cmd_new = qmp_marshal_transaction,
Jeff Codyc1864022012-02-28 15:54:07 -05001262 },
1263
1264SQMP
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001265transaction
1266-----------
Jeff Codyc1864022012-02-28 15:54:07 -05001267
Wenchao Xiabbe86012013-09-11 14:04:34 +08001268Atomically operate on one or more block devices. The only supported operations
1269for now are drive-backup, internal and external snapshotting. A list of
1270dictionaries is accepted, that contains the actions to be performed.
1271If there is any failure performing any of the operations, all operations
1272for the group are abandoned.
Jeff Codyc1864022012-02-28 15:54:07 -05001273
Wenchao Xiabbe86012013-09-11 14:04:34 +08001274For external snapshots, the dictionary contains the device, the file to use for
1275the new snapshot, and the format. The default format, if not specified, is
1276qcow2.
Jeff Codyc1864022012-02-28 15:54:07 -05001277
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001278Each new snapshot defaults to being created by QEMU (wiping any
1279contents if the file already exists), but it is also possible to reuse
1280an externally-created file. In the latter case, you should ensure that
1281the new image file has the same contents as the current one; QEMU cannot
1282perform any meaningful check. Typically this is achieved by using the
1283current image file as the backing file for the new image.
1284
Wenchao Xiabbe86012013-09-11 14:04:34 +08001285On failure, the original disks pre-snapshot attempt will be used.
1286
1287For internal snapshots, the dictionary contains the device and the snapshot's
1288name. If an internal snapshot matching name already exists, the request will
1289be rejected. Only some image formats support it, for example, qcow2, rbd,
1290and sheepdog.
1291
1292On failure, qemu will try delete the newly created internal snapshot in the
1293transaction. When an I/O error occurs during deletion, the user needs to fix
1294it later with qemu-img or other command.
1295
Jeff Codyc1864022012-02-28 15:54:07 -05001296Arguments:
1297
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001298actions array:
1299 - "type": the operation to perform. The only supported
1300 value is "blockdev-snapshot-sync". (json-string)
1301 - "data": a dictionary. The contents depend on the value
1302 of "type". When "type" is "blockdev-snapshot-sync":
1303 - "device": device name to snapshot (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001304 - "node-name": graph node name to snapshot (json-string)
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001305 - "snapshot-file": name of new image file (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001306 - "snapshot-node-name": graph node name of the new snapshot (json-string)
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001307 - "format": format of new image (json-string, optional)
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001308 - "mode": whether and how QEMU should create the snapshot file
1309 (NewImageMode, optional, default "absolute-paths")
Wenchao Xiabbe86012013-09-11 14:04:34 +08001310 When "type" is "blockdev-snapshot-internal-sync":
1311 - "device": device name to snapshot (json-string)
1312 - "name": name of the new snapshot (json-string)
Jeff Codyc1864022012-02-28 15:54:07 -05001313
1314Example:
1315
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001316-> { "execute": "transaction",
1317 "arguments": { "actions": [
Eric Blakecd0c5382014-05-06 09:39:03 -06001318 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001319 "snapshot-file": "/some/place/my-image",
1320 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001321 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
Benoît Canet0901f672014-01-23 21:31:38 +01001322 "snapshot-file": "/some/place/my-image2",
1323 "snapshot-node-name": "node3432",
1324 "mode": "existing",
1325 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001326 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001327 "snapshot-file": "/some/place/my-image2",
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001328 "mode": "existing",
Wenchao Xiabbe86012013-09-11 14:04:34 +08001329 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001330 { "type": "blockdev-snapshot-internal-sync", "data" : {
Wenchao Xiabbe86012013-09-11 14:04:34 +08001331 "device": "ide-hd2",
1332 "name": "snapshot0" } } ] } }
Jeff Codyc1864022012-02-28 15:54:07 -05001333<- { "return": {} }
1334
1335EQMP
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00001336
1337 {
John Snow341ebc22015-04-17 19:49:52 -04001338 .name = "block-dirty-bitmap-add",
1339 .args_type = "node:B,name:s,granularity:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001340 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_add,
John Snow341ebc22015-04-17 19:49:52 -04001341 },
1342
1343SQMP
1344
1345block-dirty-bitmap-add
1346----------------------
1347Since 2.4
1348
1349Create a dirty bitmap with a name on the device, and start tracking the writes.
1350
1351Arguments:
1352
1353- "node": device/node on which to create dirty bitmap (json-string)
1354- "name": name of the new dirty bitmap (json-string)
1355- "granularity": granularity to track writes with (int, optional)
1356
1357Example:
1358
1359-> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1360 "name": "bitmap0" } }
1361<- { "return": {} }
1362
1363EQMP
1364
1365 {
1366 .name = "block-dirty-bitmap-remove",
1367 .args_type = "node:B,name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001368 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_remove,
John Snow341ebc22015-04-17 19:49:52 -04001369 },
1370
1371SQMP
1372
1373block-dirty-bitmap-remove
1374-------------------------
1375Since 2.4
1376
1377Stop write tracking and remove the dirty bitmap that was created with
1378block-dirty-bitmap-add.
1379
1380Arguments:
1381
1382- "node": device/node on which to remove dirty bitmap (json-string)
1383- "name": name of the dirty bitmap to remove (json-string)
1384
1385Example:
1386
1387-> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1388 "name": "bitmap0" } }
1389<- { "return": {} }
1390
1391EQMP
1392
1393 {
John Snowe74e6b72015-04-17 19:49:59 -04001394 .name = "block-dirty-bitmap-clear",
1395 .args_type = "node:B,name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001396 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_clear,
John Snowe74e6b72015-04-17 19:49:59 -04001397 },
1398
1399SQMP
1400
1401block-dirty-bitmap-clear
1402------------------------
1403Since 2.4
1404
1405Reset the dirty bitmap associated with a node so that an incremental backup
1406from this point in time forward will only backup clusters modified after this
1407clear operation.
1408
1409Arguments:
1410
1411- "node": device/node on which to remove dirty bitmap (json-string)
1412- "name": name of the dirty bitmap to remove (json-string)
1413
1414Example:
1415
1416-> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1417 "name": "bitmap0" } }
1418<- { "return": {} }
1419
1420EQMP
1421
1422 {
Jes Sorensend967b2f2011-07-11 20:01:09 +02001423 .name = "blockdev-snapshot-sync",
Benoît Canet0901f672014-01-23 21:31:38 +01001424 .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 +02001425 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_sync,
Jes Sorensend967b2f2011-07-11 20:01:09 +02001426 },
1427
1428SQMP
1429blockdev-snapshot-sync
1430----------------------
1431
1432Synchronous snapshot of a block device. snapshot-file specifies the
1433target of the new image. If the file exists, or if it is a device, the
1434snapshot will be created in the existing file/device. If does not
1435exist, a new file will be created. format specifies the format of the
1436snapshot image, default is qcow2.
1437
1438Arguments:
1439
1440- "device": device name to snapshot (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001441- "node-name": graph node name to snapshot (json-string)
Jes Sorensend967b2f2011-07-11 20:01:09 +02001442- "snapshot-file": name of new image file (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001443- "snapshot-node-name": graph node name of the new snapshot (json-string)
Paolo Bonzini6cc2a412012-03-06 18:55:59 +01001444- "mode": whether and how QEMU should create the snapshot file
1445 (NewImageMode, optional, default "absolute-paths")
Jes Sorensend967b2f2011-07-11 20:01:09 +02001446- "format": format of new image (json-string, optional)
1447
1448Example:
1449
Luiz Capitulino7f3850c2011-10-10 17:30:08 -03001450-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1451 "snapshot-file":
1452 "/some/place/my-image",
1453 "format": "qcow2" } }
Jes Sorensend967b2f2011-07-11 20:01:09 +02001454<- { "return": {} }
1455
1456EQMP
1457
1458 {
Wenchao Xiaf323bc92013-09-11 14:04:35 +08001459 .name = "blockdev-snapshot-internal-sync",
1460 .args_type = "device:B,name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001461 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_internal_sync,
Wenchao Xiaf323bc92013-09-11 14:04:35 +08001462 },
1463
1464SQMP
1465blockdev-snapshot-internal-sync
1466-------------------------------
1467
1468Synchronously take an internal snapshot of a block device when the format of
1469image used supports it. If the name is an empty string, or a snapshot with
1470name already exists, the operation will fail.
1471
1472Arguments:
1473
1474- "device": device name to snapshot (json-string)
1475- "name": name of the new snapshot (json-string)
1476
1477Example:
1478
1479-> { "execute": "blockdev-snapshot-internal-sync",
1480 "arguments": { "device": "ide-hd0",
1481 "name": "snapshot0" }
1482 }
1483<- { "return": {} }
1484
1485EQMP
1486
1487 {
Wenchao Xia44e3e052013-09-11 14:04:36 +08001488 .name = "blockdev-snapshot-delete-internal-sync",
1489 .args_type = "device:B,id:s?,name:s?",
1490 .mhandler.cmd_new =
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001491 qmp_marshal_blockdev_snapshot_delete_internal_sync,
Wenchao Xia44e3e052013-09-11 14:04:36 +08001492 },
1493
1494SQMP
1495blockdev-snapshot-delete-internal-sync
1496--------------------------------------
1497
1498Synchronously delete an internal snapshot of a block device when the format of
1499image used supports it. The snapshot is identified by name or id or both. One
1500of name or id is required. If the snapshot is not found, the operation will
1501fail.
1502
1503Arguments:
1504
1505- "device": device name (json-string)
1506- "id": ID of the snapshot (json-string, optional)
1507- "name": name of the snapshot (json-string, optional)
1508
1509Example:
1510
1511-> { "execute": "blockdev-snapshot-delete-internal-sync",
1512 "arguments": { "device": "ide-hd0",
1513 "name": "snapshot0" }
1514 }
1515<- { "return": {
1516 "id": "1",
1517 "name": "snapshot0",
1518 "vm-state-size": 0,
1519 "date-sec": 1000012,
1520 "date-nsec": 10,
1521 "vm-clock-sec": 100,
1522 "vm-clock-nsec": 20
1523 }
1524 }
1525
1526EQMP
1527
1528 {
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001529 .name = "drive-mirror",
Paolo Bonzinib952b552012-10-18 16:49:28 +02001530 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
Benoît Canet09158f02014-06-27 18:25:25 +02001531 "node-name:s?,replaces:s?,"
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001532 "on-source-error:s?,on-target-error:s?,"
Fam Zheng0fc9f8e2015-06-08 13:56:08 +08001533 "unmap:b?,"
Paolo Bonzini08e4ed62013-01-22 09:03:13 +01001534 "granularity:i?,buf-size:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001535 .mhandler.cmd_new = qmp_marshal_drive_mirror,
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001536 },
1537
1538SQMP
1539drive-mirror
1540------------
1541
1542Start mirroring a block device's writes to a new destination. target
1543specifies the target of the new image. If the file exists, or if it is
1544a device, it will be used as the new destination for writes. If it does not
1545exist, a new file will be created. format specifies the format of the
1546mirror image, default is to probe if mode='existing', else the format
1547of the source.
1548
1549Arguments:
1550
1551- "device": device name to operate on (json-string)
1552- "target": name of new image file (json-string)
1553- "format": format of new image (json-string, optional)
Benoît Canet4c828dc2014-06-16 12:00:55 +02001554- "node-name": the name of the new block driver state in the node graph
1555 (json-string, optional)
Benoît Canet09158f02014-06-27 18:25:25 +02001556- "replaces": the block driver node name to replace when finished
1557 (json-string, optional)
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001558- "mode": how an image file should be created into the target
1559 file/device (NewImageMode, optional, default 'absolute-paths')
1560- "speed": maximum speed of the streaming job, in bytes per second
1561 (json-int)
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001562- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
Paolo Bonzini08e4ed62013-01-22 09:03:13 +01001563- "buf_size": maximum amount of data in flight from source to target, in bytes
1564 (json-int, default 10M)
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001565- "sync": what parts of the disk image should be copied to the destination;
1566 possibilities include "full" for all the disk, "top" for only the sectors
1567 allocated in the topmost image, or "none" to only replicate new I/O
1568 (MirrorSyncMode).
Paolo Bonzinib952b552012-10-18 16:49:28 +02001569- "on-source-error": the action to take on an error on the source
1570 (BlockdevOnError, default 'report')
1571- "on-target-error": the action to take on an error on the target
1572 (BlockdevOnError, default 'report')
Fam Zheng0fc9f8e2015-06-08 13:56:08 +08001573- "unmap": whether the target sectors should be discarded where source has only
1574 zeroes. (json-bool, optional, default true)
Paolo Bonzinib952b552012-10-18 16:49:28 +02001575
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001576The default value of the granularity is the image cluster size clamped
1577between 4096 and 65536, if the image format defines one. If the format
1578does not define a cluster size, the default value of the granularity
1579is 65536.
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001580
1581
1582Example:
1583
1584-> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1585 "target": "/some/place/my-image",
1586 "sync": "full",
1587 "format": "qcow2" } }
1588<- { "return": {} }
1589
1590EQMP
1591
1592 {
Jeff Codyfa40e652014-07-01 09:52:16 +02001593 .name = "change-backing-file",
1594 .args_type = "device:s,image-node-name:s,backing-file:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001595 .mhandler.cmd_new = qmp_marshal_change_backing_file,
Jeff Codyfa40e652014-07-01 09:52:16 +02001596 },
1597
1598SQMP
1599change-backing-file
1600-------------------
1601Since: 2.1
1602
1603Change the backing file in the image file metadata. This does not cause
1604QEMU to reopen the image file to reparse the backing filename (it may,
1605however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1606if needed). The new backing file string is written into the image file
1607metadata, and the QEMU internal strings are updated.
1608
1609Arguments:
1610
1611- "image-node-name": The name of the block driver state node of the
1612 image to modify. The "device" is argument is used to
1613 verify "image-node-name" is in the chain described by
1614 "device".
1615 (json-string, optional)
1616
1617- "device": The name of the device.
1618 (json-string)
1619
1620- "backing-file": The string to write as the backing file. This string is
1621 not validated, so care should be taken when specifying
1622 the string or the image chain may not be able to be
1623 reopened again.
1624 (json-string)
1625
1626Returns: Nothing on success
1627 If "device" does not exist or cannot be determined, DeviceNotFound
1628
1629EQMP
1630
1631 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001632 .name = "balloon",
1633 .args_type = "value:M",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001634 .mhandler.cmd_new = qmp_marshal_balloon,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001635 },
1636
1637SQMP
1638balloon
1639-------
1640
1641Request VM to change its memory allocation (in bytes).
1642
1643Arguments:
1644
1645- "value": New memory allocation (json-int)
1646
1647Example:
1648
1649-> { "execute": "balloon", "arguments": { "value": 536870912 } }
1650<- { "return": {} }
1651
1652EQMP
1653
1654 {
1655 .name = "set_link",
1656 .args_type = "name:s,up:b",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001657 .mhandler.cmd_new = qmp_marshal_set_link,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001658 },
1659
1660SQMP
1661set_link
1662--------
1663
1664Change the link status of a network adapter.
1665
1666Arguments:
1667
1668- "name": network device name (json-string)
1669- "up": status is up (json-bool)
1670
1671Example:
1672
1673-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1674<- { "return": {} }
1675
1676EQMP
1677
1678 {
1679 .name = "getfd",
1680 .args_type = "fdname:s",
1681 .params = "getfd name",
1682 .help = "receive a file descriptor via SCM rights and assign it a name",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001683 .mhandler.cmd_new = qmp_marshal_getfd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001684 },
1685
1686SQMP
1687getfd
1688-----
1689
1690Receive a file descriptor via SCM rights and assign it a name.
1691
1692Arguments:
1693
1694- "fdname": file descriptor name (json-string)
1695
1696Example:
1697
1698-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1699<- { "return": {} }
1700
Corey Bryant208c9d12012-06-22 14:36:09 -04001701Notes:
1702
1703(1) If the name specified by the "fdname" argument already exists,
1704 the file descriptor assigned to it will be closed and replaced
1705 by the received file descriptor.
1706(2) The 'closefd' command can be used to explicitly close the file
1707 descriptor when it is no longer needed.
1708
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001709EQMP
1710
1711 {
1712 .name = "closefd",
1713 .args_type = "fdname:s",
1714 .params = "closefd name",
1715 .help = "close a file descriptor previously passed via SCM rights",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001716 .mhandler.cmd_new = qmp_marshal_closefd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001717 },
1718
1719SQMP
1720closefd
1721-------
1722
1723Close a file descriptor previously passed via SCM rights.
1724
1725Arguments:
1726
1727- "fdname": file descriptor name (json-string)
1728
1729Example:
1730
1731-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1732<- { "return": {} }
1733
1734EQMP
1735
Corey Bryantba1c0482012-08-14 16:43:43 -04001736 {
1737 .name = "add-fd",
1738 .args_type = "fdset-id:i?,opaque:s?",
1739 .params = "add-fd fdset-id opaque",
1740 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001741 .mhandler.cmd_new = qmp_marshal_add_fd,
Corey Bryantba1c0482012-08-14 16:43:43 -04001742 },
1743
1744SQMP
1745add-fd
1746-------
1747
1748Add a file descriptor, that was passed via SCM rights, to an fd set.
1749
1750Arguments:
1751
1752- "fdset-id": The ID of the fd set to add the file descriptor to.
1753 (json-int, optional)
1754- "opaque": A free-form string that can be used to describe the fd.
1755 (json-string, optional)
1756
1757Return a json-object with the following information:
1758
1759- "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1760- "fd": The file descriptor that was received via SCM rights and added to the
1761 fd set. (json-int)
1762
1763Example:
1764
1765-> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1766<- { "return": { "fdset-id": 1, "fd": 3 } }
1767
1768Notes:
1769
1770(1) The list of fd sets is shared by all monitor connections.
1771(2) If "fdset-id" is not specified, a new fd set will be created.
1772
1773EQMP
1774
1775 {
1776 .name = "remove-fd",
1777 .args_type = "fdset-id:i,fd:i?",
1778 .params = "remove-fd fdset-id fd",
1779 .help = "Remove a file descriptor from an fd set",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001780 .mhandler.cmd_new = qmp_marshal_remove_fd,
Corey Bryantba1c0482012-08-14 16:43:43 -04001781 },
1782
1783SQMP
1784remove-fd
1785---------
1786
1787Remove a file descriptor from an fd set.
1788
1789Arguments:
1790
1791- "fdset-id": The ID of the fd set that the file descriptor belongs to.
1792 (json-int)
1793- "fd": The file descriptor that is to be removed. (json-int, optional)
1794
1795Example:
1796
1797-> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1798<- { "return": {} }
1799
1800Notes:
1801
1802(1) The list of fd sets is shared by all monitor connections.
1803(2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1804 removed.
1805
1806EQMP
1807
1808 {
1809 .name = "query-fdsets",
1810 .args_type = "",
1811 .help = "Return information describing all fd sets",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001812 .mhandler.cmd_new = qmp_marshal_query_fdsets,
Corey Bryantba1c0482012-08-14 16:43:43 -04001813 },
1814
1815SQMP
1816query-fdsets
1817-------------
1818
1819Return information describing all fd sets.
1820
1821Arguments: None
1822
1823Example:
1824
1825-> { "execute": "query-fdsets" }
1826<- { "return": [
1827 {
1828 "fds": [
1829 {
1830 "fd": 30,
1831 "opaque": "rdonly:/path/to/file"
1832 },
1833 {
1834 "fd": 24,
1835 "opaque": "rdwr:/path/to/file"
1836 }
1837 ],
1838 "fdset-id": 1
1839 },
1840 {
1841 "fds": [
1842 {
1843 "fd": 28
1844 },
1845 {
1846 "fd": 29
1847 }
1848 ],
1849 "fdset-id": 0
1850 }
1851 ]
1852 }
1853
1854Note: The list of fd sets is shared by all monitor connections.
1855
1856EQMP
1857
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001858 {
1859 .name = "block_passwd",
Benoît Canet12d3ba82014-01-23 21:31:35 +01001860 .args_type = "device:s?,node-name:s?,password:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001861 .mhandler.cmd_new = qmp_marshal_block_passwd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001862 },
1863
1864SQMP
1865block_passwd
1866------------
1867
1868Set the password of encrypted block devices.
1869
1870Arguments:
1871
1872- "device": device name (json-string)
Benoît Canet12d3ba82014-01-23 21:31:35 +01001873- "node-name": name in the block driver state graph (json-string)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001874- "password": password (json-string)
1875
1876Example:
1877
1878-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1879 "password": "12345" } }
1880<- { "return": {} }
1881
1882EQMP
1883
1884 {
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001885 .name = "block_set_io_throttle",
Alberto Garcia76f4afb2015-06-08 18:17:44 +02001886 .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 +02001887 .mhandler.cmd_new = qmp_marshal_block_set_io_throttle,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001888 },
1889
1890SQMP
1891block_set_io_throttle
1892------------
1893
1894Change I/O throttle limits for a block drive.
1895
1896Arguments:
1897
1898- "device": device name (json-string)
Eric Blake586b5462013-08-30 14:44:11 -06001899- "bps": total throughput limit in bytes per second (json-int)
1900- "bps_rd": read throughput limit in bytes per second (json-int)
1901- "bps_wr": write throughput limit in bytes per second (json-int)
1902- "iops": total I/O operations per second (json-int)
1903- "iops_rd": read I/O operations per second (json-int)
1904- "iops_wr": write I/O operations per second (json-int)
Benoît Canet3e9fab62013-09-02 14:14:40 +02001905- "bps_max": total max in bytes (json-int)
1906- "bps_rd_max": read max in bytes (json-int)
1907- "bps_wr_max": write max in bytes (json-int)
1908- "iops_max": total I/O operations max (json-int)
1909- "iops_rd_max": read I/O operations max (json-int)
1910- "iops_wr_max": write I/O operations max (json-int)
Benoît Canet2024c1d2013-09-02 14:14:41 +02001911- "iops_size": I/O size in bytes when limiting (json-int)
Alberto Garcia76f4afb2015-06-08 18:17:44 +02001912- "group": throttle group name (json-string)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001913
1914Example:
1915
1916-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
Eric Blake586b5462013-08-30 14:44:11 -06001917 "bps": 1000000,
1918 "bps_rd": 0,
1919 "bps_wr": 0,
1920 "iops": 0,
1921 "iops_rd": 0,
Benoît Canet3e9fab62013-09-02 14:14:40 +02001922 "iops_wr": 0,
1923 "bps_max": 8000000,
1924 "bps_rd_max": 0,
1925 "bps_wr_max": 0,
1926 "iops_max": 0,
1927 "iops_rd_max": 0,
Benoît Canet2024c1d2013-09-02 14:14:41 +02001928 "iops_wr_max": 0,
1929 "iops_size": 0 } }
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001930<- { "return": {} }
1931
1932EQMP
1933
1934 {
Gerd Hoffmann75721502010-10-07 12:22:54 +02001935 .name = "set_password",
1936 .args_type = "protocol:s,password:s,connected:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001937 .mhandler.cmd_new = qmp_marshal_set_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +02001938 },
1939
1940SQMP
1941set_password
1942------------
1943
1944Set the password for vnc/spice protocols.
1945
1946Arguments:
1947
1948- "protocol": protocol name (json-string)
1949- "password": password (json-string)
Alberto Garcia3599d462015-02-26 16:35:07 +02001950- "connected": [ keep | disconnect | fail ] (json-string, optional)
Gerd Hoffmann75721502010-10-07 12:22:54 +02001951
1952Example:
1953
1954-> { "execute": "set_password", "arguments": { "protocol": "vnc",
1955 "password": "secret" } }
1956<- { "return": {} }
1957
1958EQMP
1959
1960 {
1961 .name = "expire_password",
1962 .args_type = "protocol:s,time:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001963 .mhandler.cmd_new = qmp_marshal_expire_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +02001964 },
1965
1966SQMP
1967expire_password
1968---------------
1969
1970Set the password expire time for vnc/spice protocols.
1971
1972Arguments:
1973
1974- "protocol": protocol name (json-string)
1975- "time": [ now | never | +secs | secs ] (json-string)
1976
1977Example:
1978
1979-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1980 "time": "+60" } }
1981<- { "return": {} }
1982
1983EQMP
1984
1985 {
Daniel P. Berrange13661082011-06-23 13:31:42 +01001986 .name = "add_client",
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +00001987 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02001988 .mhandler.cmd_new = qmp_marshal_add_client,
Daniel P. Berrange13661082011-06-23 13:31:42 +01001989 },
1990
1991SQMP
1992add_client
1993----------
1994
1995Add a graphics client
1996
1997Arguments:
1998
1999- "protocol": protocol name (json-string)
2000- "fdname": file descriptor name (json-string)
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +00002001- "skipauth": whether to skip authentication (json-bool, optional)
2002- "tls": whether to perform TLS (json-bool, optional)
Daniel P. Berrange13661082011-06-23 13:31:42 +01002003
2004Example:
2005
2006-> { "execute": "add_client", "arguments": { "protocol": "vnc",
2007 "fdname": "myclient" } }
2008<- { "return": {} }
2009
2010EQMP
2011 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002012 .name = "qmp_capabilities",
2013 .args_type = "",
2014 .params = "",
2015 .help = "enable QMP capabilities",
Markus Armbruster485febc2015-03-13 17:25:50 +01002016 .mhandler.cmd_new = qmp_capabilities,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002017 },
2018
2019SQMP
2020qmp_capabilities
2021----------------
2022
2023Enable QMP capabilities.
2024
2025Arguments: None.
2026
2027Example:
2028
2029-> { "execute": "qmp_capabilities" }
2030<- { "return": {} }
2031
2032Note: This command must be issued before issuing any other command.
2033
Luiz Capitulino0268d972010-10-22 10:08:02 -02002034EQMP
2035
2036 {
2037 .name = "human-monitor-command",
2038 .args_type = "command-line:s,cpu-index:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002039 .mhandler.cmd_new = qmp_marshal_human_monitor_command,
Luiz Capitulino0268d972010-10-22 10:08:02 -02002040 },
2041
2042SQMP
2043human-monitor-command
2044---------------------
2045
2046Execute a Human Monitor command.
2047
2048Arguments:
2049
2050- command-line: the command name and its arguments, just like the
2051 Human Monitor's shell (json-string)
2052- cpu-index: select the CPU number to be used by commands which access CPU
2053 data, like 'info registers'. The Monitor selects CPU 0 if this
2054 argument is not provided (json-int, optional)
2055
2056Example:
2057
2058-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2059<- { "return": "kvm support: enabled\r\n" }
2060
2061Notes:
2062
2063(1) The Human Monitor is NOT an stable interface, this means that command
2064 names, arguments and responses can change or be removed at ANY time.
2065 Applications that rely on long term stability guarantees should NOT
2066 use this command
2067
2068(2) Limitations:
2069
2070 o This command is stateless, this means that commands that depend
2071 on state information (such as getfd) might not work
2072
2073 o Commands that prompt the user for data (eg. 'cont' when the block
2074 device is encrypted) don't currently work
2075
Luiz Capitulino82a56f02010-09-13 12:26:00 -030020763. Query Commands
2077=================
2078
2079HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2080HXCOMM this! We will possibly move query commands definitions inside those
2081HXCOMM sections, just like regular commands.
2082
2083EQMP
2084
2085SQMP
2086query-version
2087-------------
2088
2089Show QEMU version.
2090
2091Return a json-object with the following information:
2092
2093- "qemu": A json-object containing three integer values:
2094 - "major": QEMU's major version (json-int)
2095 - "minor": QEMU's minor version (json-int)
2096 - "micro": QEMU's micro version (json-int)
2097- "package": package's version (json-string)
2098
2099Example:
2100
2101-> { "execute": "query-version" }
2102<- {
2103 "return":{
2104 "qemu":{
2105 "major":0,
2106 "minor":11,
2107 "micro":5
2108 },
2109 "package":""
2110 }
2111 }
2112
2113EQMP
2114
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03002115 {
2116 .name = "query-version",
2117 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002118 .mhandler.cmd_new = qmp_marshal_query_version,
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03002119 },
2120
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002121SQMP
2122query-commands
2123--------------
2124
2125List QMP available commands.
2126
2127Each command is represented by a json-object, the returned value is a json-array
2128of all commands.
2129
2130Each json-object contain:
2131
2132- "name": command's name (json-string)
2133
2134Example:
2135
2136-> { "execute": "query-commands" }
2137<- {
2138 "return":[
2139 {
2140 "name":"query-balloon"
2141 },
2142 {
2143 "name":"system_powerdown"
2144 }
2145 ]
2146 }
2147
2148Note: This example has been shortened as the real response is too long.
2149
2150EQMP
2151
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03002152 {
2153 .name = "query-commands",
2154 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002155 .mhandler.cmd_new = qmp_marshal_query_commands,
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03002156 },
2157
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002158SQMP
Daniel P. Berrange48608532012-05-21 17:59:51 +01002159query-events
2160--------------
2161
2162List QMP available events.
2163
2164Each event is represented by a json-object, the returned value is a json-array
2165of all events.
2166
2167Each json-object contains:
2168
2169- "name": event's name (json-string)
2170
2171Example:
2172
2173-> { "execute": "query-events" }
2174<- {
2175 "return":[
2176 {
2177 "name":"SHUTDOWN"
2178 },
2179 {
2180 "name":"RESET"
2181 }
2182 ]
2183 }
2184
2185Note: This example has been shortened as the real response is too long.
2186
2187EQMP
2188
2189 {
2190 .name = "query-events",
2191 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002192 .mhandler.cmd_new = qmp_marshal_query_events,
Daniel P. Berrange48608532012-05-21 17:59:51 +01002193 },
2194
2195SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002196query-chardev
2197-------------
2198
2199Each device is represented by a json-object. The returned value is a json-array
2200of all devices.
2201
2202Each json-object contain the following:
2203
2204- "label": device's label (json-string)
2205- "filename": device's file (json-string)
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002206- "frontend-open": open/closed state of the frontend device attached to this
2207 backend (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002208
2209Example:
2210
2211-> { "execute": "query-chardev" }
2212<- {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002213 "return": [
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002214 {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002215 "label": "charchannel0",
2216 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2217 "frontend-open": false
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002218 },
2219 {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002220 "label": "charmonitor",
2221 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2222 "frontend-open": true
2223 },
2224 {
2225 "label": "charserial0",
2226 "filename": "pty:/dev/pts/2",
2227 "frontend-open": true
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002228 }
2229 ]
2230 }
2231
2232EQMP
2233
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03002234 {
2235 .name = "query-chardev",
2236 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002237 .mhandler.cmd_new = qmp_marshal_query_chardev,
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03002238 },
2239
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002240SQMP
Martin Kletzander77d1c3c2014-02-01 12:52:42 +01002241query-chardev-backends
2242-------------
2243
2244List available character device backends.
2245
2246Each backend is represented by a json-object, the returned value is a json-array
2247of all backends.
2248
2249Each json-object contains:
2250
2251- "name": backend name (json-string)
2252
2253Example:
2254
2255-> { "execute": "query-chardev-backends" }
2256<- {
2257 "return":[
2258 {
2259 "name":"udp"
2260 },
2261 {
2262 "name":"tcp"
2263 },
2264 {
2265 "name":"unix"
2266 },
2267 {
2268 "name":"spiceport"
2269 }
2270 ]
2271 }
2272
2273EQMP
2274
2275 {
2276 .name = "query-chardev-backends",
2277 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002278 .mhandler.cmd_new = qmp_marshal_query_chardev_backends,
Martin Kletzander77d1c3c2014-02-01 12:52:42 +01002279 },
2280
2281SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002282query-block
2283-----------
2284
2285Show the block devices.
2286
2287Each block device information is stored in a json-object and the returned value
2288is a json-array of all devices.
2289
2290Each json-object contain the following:
2291
2292- "device": device name (json-string)
2293- "type": device type (json-string)
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002294 - deprecated, retained for backward compatibility
2295 - Possible values: "unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002296- "removable": true if the device is removable, false otherwise (json-bool)
2297- "locked": true if the device is locked, false otherwise (json-bool)
Michal Privoznik99f42802013-01-29 17:58:41 +01002298- "tray_open": only present if removable, true if the device has a tray,
Markus Armbrustere4def802011-09-06 18:58:53 +02002299 and it is open (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002300- "inserted": only present if the device is inserted, it is a json-object
2301 containing the following:
2302 - "file": device file name (json-string)
2303 - "ro": true if read-only, false otherwise (json-bool)
2304 - "drv": driver format name (json-string)
Stefan Hajnoczi550830f2014-09-16 15:24:24 +01002305 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002306 "file", "file", "ftp", "ftps", "host_cdrom",
Markus Armbruster92a539d2015-03-17 17:02:20 +01002307 "host_device", "http", "https",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002308 "nbd", "parallels", "qcow", "qcow2", "raw",
2309 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2310 - "backing_file": backing file name (json-string, optional)
Benoît Canet2e3e3312012-08-02 10:22:48 +02002311 - "backing_file_depth": number of files in the backing file chain (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002312 - "encrypted": true if encrypted, false otherwise (json-bool)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002313 - "bps": limit total bytes per second (json-int)
2314 - "bps_rd": limit read bytes per second (json-int)
2315 - "bps_wr": limit write bytes per second (json-int)
2316 - "iops": limit total I/O operations per second (json-int)
2317 - "iops_rd": limit read operations per second (json-int)
2318 - "iops_wr": limit write operations per second (json-int)
Benoît Canet3e9fab62013-09-02 14:14:40 +02002319 - "bps_max": total max in bytes (json-int)
2320 - "bps_rd_max": read max in bytes (json-int)
2321 - "bps_wr_max": write max in bytes (json-int)
2322 - "iops_max": total I/O operations max (json-int)
2323 - "iops_rd_max": read I/O operations max (json-int)
2324 - "iops_wr_max": write I/O operations max (json-int)
Benoît Canet2024c1d2013-09-02 14:14:41 +02002325 - "iops_size": I/O size when limiting by iops (json-int)
Peter Lieven465bee12014-05-18 00:58:19 +02002326 - "detect_zeroes": detect and optimize zero writing (json-string)
2327 - Possible values: "off", "on", "unmap"
Francesco Romanie2462112015-01-12 14:11:13 +01002328 - "write_threshold": write offset threshold in bytes, a event will be
2329 emitted if crossed. Zero if disabled (json-int)
Wenchao Xia553a7e82013-06-06 12:27:59 +08002330 - "image": the detail of the image, it is a json-object containing
2331 the following:
2332 - "filename": image file name (json-string)
2333 - "format": image format (json-string)
2334 - "virtual-size": image capacity in bytes (json-int)
2335 - "dirty-flag": true if image is not cleanly closed, not present
2336 means clean (json-bool, optional)
2337 - "actual-size": actual size on disk in bytes of the image, not
2338 present when image does not support thin
2339 provision (json-int, optional)
2340 - "cluster-size": size of a cluster in bytes, not present if image
2341 format does not support it (json-int, optional)
2342 - "encrypted": true if the image is encrypted, not present means
2343 false or the image format does not support
2344 encryption (json-bool, optional)
2345 - "backing_file": backing file name, not present means no backing
2346 file is used or the image format does not
2347 support backing file chain
2348 (json-string, optional)
2349 - "full-backing-filename": full path of the backing file, not
2350 present if it equals backing_file or no
2351 backing file is used
2352 (json-string, optional)
2353 - "backing-filename-format": the format of the backing file, not
2354 present means unknown or no backing
2355 file (json-string, optional)
2356 - "snapshots": the internal snapshot info, it is an optional list
2357 of json-object containing the following:
2358 - "id": unique snapshot id (json-string)
2359 - "name": snapshot name (json-string)
2360 - "vm-state-size": size of the VM state in bytes (json-int)
2361 - "date-sec": UTC date of the snapshot in seconds (json-int)
2362 - "date-nsec": fractional part in nanoseconds to be used with
Eric Blake586b5462013-08-30 14:44:11 -06002363 date-sec (json-int)
Wenchao Xia553a7e82013-06-06 12:27:59 +08002364 - "vm-clock-sec": VM clock relative to boot in seconds
2365 (json-int)
2366 - "vm-clock-nsec": fractional part in nanoseconds to be used
2367 with vm-clock-sec (json-int)
2368 - "backing-image": the detail of the backing image, it is an
2369 optional json-object only present when a
2370 backing image present for this image
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002371
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002372- "io-status": I/O operation status, only present if the device supports it
2373 and the VM is configured to stop on errors. It's always reset
2374 to "ok" when the "cont" command is issued (json_string, optional)
2375 - Possible values: "ok", "failed", "nospace"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002376
2377Example:
2378
2379-> { "execute": "query-block" }
2380<- {
2381 "return":[
2382 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002383 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002384 "device":"ide0-hd0",
2385 "locked":false,
2386 "removable":false,
2387 "inserted":{
2388 "ro":false,
2389 "drv":"qcow2",
2390 "encrypted":false,
Wenchao Xia553a7e82013-06-06 12:27:59 +08002391 "file":"disks/test.qcow2",
2392 "backing_file_depth":1,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002393 "bps":1000000,
2394 "bps_rd":0,
2395 "bps_wr":0,
2396 "iops":1000000,
2397 "iops_rd":0,
2398 "iops_wr":0,
Benoît Canet3e9fab62013-09-02 14:14:40 +02002399 "bps_max": 8000000,
2400 "bps_rd_max": 0,
2401 "bps_wr_max": 0,
2402 "iops_max": 0,
2403 "iops_rd_max": 0,
2404 "iops_wr_max": 0,
Benoît Canet2024c1d2013-09-02 14:14:41 +02002405 "iops_size": 0,
Peter Lieven465bee12014-05-18 00:58:19 +02002406 "detect_zeroes": "on",
Francesco Romanie2462112015-01-12 14:11:13 +01002407 "write_threshold": 0,
Wenchao Xia553a7e82013-06-06 12:27:59 +08002408 "image":{
2409 "filename":"disks/test.qcow2",
2410 "format":"qcow2",
2411 "virtual-size":2048000,
2412 "backing_file":"base.qcow2",
2413 "full-backing-filename":"disks/base.qcow2",
John Snow54034322015-04-28 15:20:41 -04002414 "backing-filename-format":"qcow2",
Wenchao Xia553a7e82013-06-06 12:27:59 +08002415 "snapshots":[
2416 {
2417 "id": "1",
2418 "name": "snapshot1",
2419 "vm-state-size": 0,
2420 "date-sec": 10000200,
2421 "date-nsec": 12,
2422 "vm-clock-sec": 206,
2423 "vm-clock-nsec": 30
2424 }
2425 ],
2426 "backing-image":{
2427 "filename":"disks/base.qcow2",
2428 "format":"qcow2",
2429 "virtual-size":2048000
2430 }
2431 }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002432 },
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002433 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002434 },
2435 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002436 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002437 "device":"ide1-cd0",
2438 "locked":false,
2439 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002440 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002441 },
2442 {
2443 "device":"floppy0",
2444 "locked":false,
2445 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002446 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002447 },
2448 {
2449 "device":"sd0",
2450 "locked":false,
2451 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002452 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002453 }
2454 ]
2455 }
2456
2457EQMP
2458
Luiz Capitulinob2023812011-09-21 17:16:47 -03002459 {
2460 .name = "query-block",
2461 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002462 .mhandler.cmd_new = qmp_marshal_query_block,
Luiz Capitulinob2023812011-09-21 17:16:47 -03002463 },
2464
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002465SQMP
2466query-blockstats
2467----------------
2468
2469Show block device statistics.
2470
2471Each device statistic information is stored in a json-object and the returned
2472value is a json-array of all devices.
2473
2474Each json-object contain the following:
2475
2476- "device": device name (json-string)
2477- "stats": A json-object with the statistics information, it contains:
2478 - "rd_bytes": bytes read (json-int)
2479 - "wr_bytes": bytes written (json-int)
2480 - "rd_operations": read operations (json-int)
2481 - "wr_operations": write operations (json-int)
Christoph Hellwige8045d62011-08-22 00:25:58 +02002482 - "flush_operations": cache flush operations (json-int)
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002483 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2484 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2485 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002486 - "wr_highest_offset": Highest offset of a sector written since the
2487 BlockDriverState has been opened (json-int)
Peter Lievenf4564d52015-02-02 14:52:18 +01002488 - "rd_merged": number of read requests that have been merged into
2489 another request (json-int)
2490 - "wr_merged": number of write requests that have been merged into
2491 another request (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002492- "parent": Contains recursively the statistics of the underlying
2493 protocol (e.g. the host file for a qcow2 image). If there is
2494 no underlying protocol, this field is omitted
2495 (json-object, optional)
2496
2497Example:
2498
2499-> { "execute": "query-blockstats" }
2500<- {
2501 "return":[
2502 {
2503 "device":"ide0-hd0",
2504 "parent":{
2505 "stats":{
2506 "wr_highest_offset":3686448128,
2507 "wr_bytes":9786368,
2508 "wr_operations":751,
2509 "rd_bytes":122567168,
2510 "rd_operations":36772
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002511 "wr_total_times_ns":313253456
2512 "rd_total_times_ns":3465673657
2513 "flush_total_times_ns":49653
Christoph Hellwige8045d62011-08-22 00:25:58 +02002514 "flush_operations":61,
Peter Lievenf4564d52015-02-02 14:52:18 +01002515 "rd_merged":0,
2516 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002517 }
2518 },
2519 "stats":{
2520 "wr_highest_offset":2821110784,
2521 "wr_bytes":9786368,
2522 "wr_operations":692,
2523 "rd_bytes":122739200,
2524 "rd_operations":36604
Christoph Hellwige8045d62011-08-22 00:25:58 +02002525 "flush_operations":51,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002526 "wr_total_times_ns":313253456
2527 "rd_total_times_ns":3465673657
Peter Lievenf4564d52015-02-02 14:52:18 +01002528 "flush_total_times_ns":49653,
2529 "rd_merged":0,
2530 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002531 }
2532 },
2533 {
2534 "device":"ide1-cd0",
2535 "stats":{
2536 "wr_highest_offset":0,
2537 "wr_bytes":0,
2538 "wr_operations":0,
2539 "rd_bytes":0,
2540 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002541 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002542 "wr_total_times_ns":0
2543 "rd_total_times_ns":0
Peter Lievenf4564d52015-02-02 14:52:18 +01002544 "flush_total_times_ns":0,
2545 "rd_merged":0,
2546 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002547 }
2548 },
2549 {
2550 "device":"floppy0",
2551 "stats":{
2552 "wr_highest_offset":0,
2553 "wr_bytes":0,
2554 "wr_operations":0,
2555 "rd_bytes":0,
2556 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002557 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002558 "wr_total_times_ns":0
2559 "rd_total_times_ns":0
Peter Lievenf4564d52015-02-02 14:52:18 +01002560 "flush_total_times_ns":0,
2561 "rd_merged":0,
2562 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002563 }
2564 },
2565 {
2566 "device":"sd0",
2567 "stats":{
2568 "wr_highest_offset":0,
2569 "wr_bytes":0,
2570 "wr_operations":0,
2571 "rd_bytes":0,
2572 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002573 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002574 "wr_total_times_ns":0
2575 "rd_total_times_ns":0
Peter Lievenf4564d52015-02-02 14:52:18 +01002576 "flush_total_times_ns":0,
2577 "rd_merged":0,
2578 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002579 }
2580 }
2581 ]
2582 }
2583
2584EQMP
2585
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03002586 {
2587 .name = "query-blockstats",
Fam Zhengf71eaa72014-10-31 11:32:57 +08002588 .args_type = "query-nodes:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002589 .mhandler.cmd_new = qmp_marshal_query_blockstats,
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03002590 },
2591
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002592SQMP
2593query-cpus
2594----------
2595
2596Show CPU information.
2597
2598Return a json-array. Each CPU is represented by a json-object, which contains:
2599
2600- "CPU": CPU index (json-int)
2601- "current": true if this is the current CPU, false otherwise (json-bool)
2602- "halted": true if the cpu is halted, false otherwise (json-bool)
Eduardo Habkost58f88d42015-05-08 16:04:22 -03002603- "qom_path": path to the CPU object in the QOM tree (json-str)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002604- Current program counter. The key's name depends on the architecture:
2605 "pc": i386/x86_64 (json-int)
2606 "nip": PPC (json-int)
2607 "pc" and "npc": sparc (json-int)
2608 "PC": mips (json-int)
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002609- "thread_id": ID of the underlying host thread (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002610
2611Example:
2612
2613-> { "execute": "query-cpus" }
2614<- {
2615 "return":[
2616 {
2617 "CPU":0,
2618 "current":true,
2619 "halted":false,
Eduardo Habkost58f88d42015-05-08 16:04:22 -03002620 "qom_path":"/machine/unattached/device[0]",
2621 "pc":3227107138,
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002622 "thread_id":3134
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002623 },
2624 {
2625 "CPU":1,
2626 "current":false,
2627 "halted":true,
Eduardo Habkost58f88d42015-05-08 16:04:22 -03002628 "qom_path":"/machine/unattached/device[2]",
2629 "pc":7108165,
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002630 "thread_id":3135
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002631 }
2632 ]
2633 }
2634
2635EQMP
2636
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03002637 {
2638 .name = "query-cpus",
2639 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002640 .mhandler.cmd_new = qmp_marshal_query_cpus,
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03002641 },
2642
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002643SQMP
Stefan Hajnoczidc3dd0d2014-02-27 11:48:42 +01002644query-iothreads
2645---------------
2646
2647Returns a list of information about each iothread.
2648
2649Note this list excludes the QEMU main loop thread, which is not declared
2650using the -object iothread command-line option. It is always the main thread
2651of the process.
2652
2653Return a json-array. Each iothread is represented by a json-object, which contains:
2654
2655- "id": name of iothread (json-str)
2656- "thread-id": ID of the underlying host thread (json-int)
2657
2658Example:
2659
2660-> { "execute": "query-iothreads" }
2661<- {
2662 "return":[
2663 {
2664 "id":"iothread0",
2665 "thread-id":3134
2666 },
2667 {
2668 "id":"iothread1",
2669 "thread-id":3135
2670 }
2671 ]
2672 }
2673
2674EQMP
2675
2676 {
2677 .name = "query-iothreads",
2678 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002679 .mhandler.cmd_new = qmp_marshal_query_iothreads,
Stefan Hajnoczidc3dd0d2014-02-27 11:48:42 +01002680 },
2681
2682SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002683query-pci
2684---------
2685
2686PCI buses and devices information.
2687
2688The returned value is a json-array of all buses. Each bus is represented by
2689a json-object, which has a key with a json-array of all PCI devices attached
2690to it. Each device is represented by a json-object.
2691
2692The bus json-object contains the following:
2693
2694- "bus": bus number (json-int)
2695- "devices": a json-array of json-objects, each json-object represents a
2696 PCI device
2697
2698The PCI device json-object contains the following:
2699
2700- "bus": identical to the parent's bus number (json-int)
2701- "slot": slot number (json-int)
2702- "function": function number (json-int)
2703- "class_info": a json-object containing:
2704 - "desc": device class description (json-string, optional)
2705 - "class": device class number (json-int)
2706- "id": a json-object containing:
2707 - "device": device ID (json-int)
2708 - "vendor": vendor ID (json-int)
2709- "irq": device's IRQ if assigned (json-int, optional)
2710- "qdev_id": qdev id string (json-string)
2711- "pci_bridge": It's a json-object, only present if this device is a
2712 PCI bridge, contains:
2713 - "bus": bus number (json-int)
2714 - "secondary": secondary bus number (json-int)
2715 - "subordinate": subordinate bus number (json-int)
2716 - "io_range": I/O memory range information, a json-object with the
2717 following members:
2718 - "base": base address, in bytes (json-int)
2719 - "limit": limit address, in bytes (json-int)
2720 - "memory_range": memory range information, a json-object with the
2721 following members:
2722 - "base": base address, in bytes (json-int)
2723 - "limit": limit address, in bytes (json-int)
2724 - "prefetchable_range": Prefetchable memory range information, a
2725 json-object with the following members:
2726 - "base": base address, in bytes (json-int)
2727 - "limit": limit address, in bytes (json-int)
2728 - "devices": a json-array of PCI devices if there's any attached, each
2729 each element is represented by a json-object, which contains
2730 the same members of the 'PCI device json-object' described
2731 above (optional)
2732- "regions": a json-array of json-objects, each json-object represents a
2733 memory region of this device
2734
2735The memory range json-object contains the following:
2736
2737- "base": base memory address (json-int)
2738- "limit": limit value (json-int)
2739
2740The region json-object can be an I/O region or a memory region, an I/O region
2741json-object contains the following:
2742
2743- "type": "io" (json-string, fixed)
2744- "bar": BAR number (json-int)
2745- "address": memory address (json-int)
2746- "size": memory size (json-int)
2747
2748A memory region json-object contains the following:
2749
2750- "type": "memory" (json-string, fixed)
2751- "bar": BAR number (json-int)
2752- "address": memory address (json-int)
2753- "size": memory size (json-int)
2754- "mem_type_64": true or false (json-bool)
2755- "prefetch": true or false (json-bool)
2756
2757Example:
2758
2759-> { "execute": "query-pci" }
2760<- {
2761 "return":[
2762 {
2763 "bus":0,
2764 "devices":[
2765 {
2766 "bus":0,
2767 "qdev_id":"",
2768 "slot":0,
2769 "class_info":{
2770 "class":1536,
2771 "desc":"Host bridge"
2772 },
2773 "id":{
2774 "device":32902,
2775 "vendor":4663
2776 },
2777 "function":0,
2778 "regions":[
2779
2780 ]
2781 },
2782 {
2783 "bus":0,
2784 "qdev_id":"",
2785 "slot":1,
2786 "class_info":{
2787 "class":1537,
2788 "desc":"ISA bridge"
2789 },
2790 "id":{
2791 "device":32902,
2792 "vendor":28672
2793 },
2794 "function":0,
2795 "regions":[
2796
2797 ]
2798 },
2799 {
2800 "bus":0,
2801 "qdev_id":"",
2802 "slot":1,
2803 "class_info":{
2804 "class":257,
2805 "desc":"IDE controller"
2806 },
2807 "id":{
2808 "device":32902,
2809 "vendor":28688
2810 },
2811 "function":1,
2812 "regions":[
2813 {
2814 "bar":4,
2815 "size":16,
2816 "address":49152,
2817 "type":"io"
2818 }
2819 ]
2820 },
2821 {
2822 "bus":0,
2823 "qdev_id":"",
2824 "slot":2,
2825 "class_info":{
2826 "class":768,
2827 "desc":"VGA controller"
2828 },
2829 "id":{
2830 "device":4115,
2831 "vendor":184
2832 },
2833 "function":0,
2834 "regions":[
2835 {
2836 "prefetch":true,
2837 "mem_type_64":false,
2838 "bar":0,
2839 "size":33554432,
2840 "address":4026531840,
2841 "type":"memory"
2842 },
2843 {
2844 "prefetch":false,
2845 "mem_type_64":false,
2846 "bar":1,
2847 "size":4096,
2848 "address":4060086272,
2849 "type":"memory"
2850 },
2851 {
2852 "prefetch":false,
2853 "mem_type_64":false,
2854 "bar":6,
2855 "size":65536,
2856 "address":-1,
2857 "type":"memory"
2858 }
2859 ]
2860 },
2861 {
2862 "bus":0,
2863 "qdev_id":"",
2864 "irq":11,
2865 "slot":4,
2866 "class_info":{
2867 "class":1280,
2868 "desc":"RAM controller"
2869 },
2870 "id":{
2871 "device":6900,
2872 "vendor":4098
2873 },
2874 "function":0,
2875 "regions":[
2876 {
2877 "bar":0,
2878 "size":32,
2879 "address":49280,
2880 "type":"io"
2881 }
2882 ]
2883 }
2884 ]
2885 }
2886 ]
2887 }
2888
2889Note: This example has been shortened as the real response is too long.
2890
2891EQMP
2892
Luiz Capitulino79627472011-10-21 14:15:33 -02002893 {
2894 .name = "query-pci",
2895 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002896 .mhandler.cmd_new = qmp_marshal_query_pci,
Luiz Capitulino79627472011-10-21 14:15:33 -02002897 },
2898
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002899SQMP
2900query-kvm
2901---------
2902
2903Show KVM information.
2904
2905Return a json-object with the following information:
2906
2907- "enabled": true if KVM support is enabled, false otherwise (json-bool)
2908- "present": true if QEMU has KVM support, false otherwise (json-bool)
2909
2910Example:
2911
2912-> { "execute": "query-kvm" }
2913<- { "return": { "enabled": true, "present": true } }
2914
2915EQMP
2916
Luiz Capitulino292a2602011-09-12 15:10:53 -03002917 {
2918 .name = "query-kvm",
2919 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002920 .mhandler.cmd_new = qmp_marshal_query_kvm,
Luiz Capitulino292a2602011-09-12 15:10:53 -03002921 },
2922
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002923SQMP
2924query-status
2925------------
2926
2927Return a json-object with the following information:
2928
2929- "running": true if the VM is running, or false if it is paused (json-bool)
2930- "singlestep": true if the VM is in single step mode,
2931 false otherwise (json-bool)
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03002932- "status": one of the following values (json-string)
2933 "debug" - QEMU is running on a debugger
2934 "inmigrate" - guest is paused waiting for an incoming migration
2935 "internal-error" - An internal error that prevents further guest
2936 execution has occurred
2937 "io-error" - the last IOP has failed and the device is configured
2938 to pause on I/O errors
2939 "paused" - guest has been paused via the 'stop' command
2940 "postmigrate" - guest is paused following a successful 'migrate'
2941 "prelaunch" - QEMU was started with -S and guest has not started
2942 "finish-migrate" - guest is paused to finish the migration process
2943 "restore-vm" - guest is paused to restore VM state
2944 "running" - guest is actively running
2945 "save-vm" - guest is paused to save the VM state
2946 "shutdown" - guest is shut down (and -no-shutdown is in use)
2947 "watchdog" - the watchdog action is configured to pause and
2948 has been triggered
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002949
2950Example:
2951
2952-> { "execute": "query-status" }
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03002953<- { "return": { "running": true, "singlestep": false, "status": "running" } }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002954
2955EQMP
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03002956
2957 {
2958 .name = "query-status",
2959 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02002960 .mhandler.cmd_new = qmp_marshal_query_status,
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03002961 },
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002962
2963SQMP
2964query-mice
2965----------
2966
2967Show VM mice information.
2968
2969Each mouse is represented by a json-object, the returned value is a json-array
2970of all mice.
2971
2972The mouse json-object contains the following:
2973
2974- "name": mouse's name (json-string)
2975- "index": mouse's index (json-int)
2976- "current": true if this mouse is receiving events, false otherwise (json-bool)
2977- "absolute": true if the mouse generates absolute input events (json-bool)
2978
2979Example:
2980
2981-> { "execute": "query-mice" }
2982<- {
2983 "return":[
2984 {
2985 "name":"QEMU Microsoft Mouse",
2986 "index":0,
2987 "current":false,
2988 "absolute":false
2989 },
2990 {
2991 "name":"QEMU PS/2 Mouse",
2992 "index":1,
2993 "current":true,
2994 "absolute":true
2995 }
2996 ]
2997 }
2998
2999EQMP
3000
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03003001 {
3002 .name = "query-mice",
3003 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003004 .mhandler.cmd_new = qmp_marshal_query_mice,
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03003005 },
3006
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003007SQMP
3008query-vnc
3009---------
3010
3011Show VNC server information.
3012
3013Return a json-object with server information. Connected clients are returned
3014as a json-array of json-objects.
3015
3016The main json-object contains the following:
3017
3018- "enabled": true or false (json-bool)
3019- "host": server's IP address (json-string)
3020- "family": address family (json-string)
3021 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3022- "service": server's port number (json-string)
3023- "auth": authentication method (json-string)
3024 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3025 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3026 "vencrypt+plain", "vencrypt+tls+none",
3027 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3028 "vencrypt+tls+vnc", "vencrypt+x509+none",
3029 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3030 "vencrypt+x509+vnc", "vnc"
3031- "clients": a json-array of all connected clients
3032
3033Clients are described by a json-object, each one contain the following:
3034
3035- "host": client's IP address (json-string)
3036- "family": address family (json-string)
3037 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3038- "service": client's port number (json-string)
3039- "x509_dname": TLS dname (json-string, optional)
3040- "sasl_username": SASL username (json-string, optional)
3041
3042Example:
3043
3044-> { "execute": "query-vnc" }
3045<- {
3046 "return":{
3047 "enabled":true,
3048 "host":"0.0.0.0",
3049 "service":"50402",
3050 "auth":"vnc",
3051 "family":"ipv4",
3052 "clients":[
3053 {
3054 "host":"127.0.0.1",
3055 "service":"50401",
3056 "family":"ipv4"
3057 }
3058 ]
3059 }
3060 }
3061
3062EQMP
3063
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02003064 {
3065 .name = "query-vnc",
3066 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003067 .mhandler.cmd_new = qmp_marshal_query_vnc,
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02003068 },
Gerd Hoffmanndf887682014-12-17 15:49:44 +01003069 {
3070 .name = "query-vnc-servers",
3071 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003072 .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
Gerd Hoffmanndf887682014-12-17 15:49:44 +01003073 },
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02003074
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003075SQMP
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01003076query-spice
3077-----------
3078
3079Show SPICE server information.
3080
3081Return a json-object with server information. Connected clients are returned
3082as a json-array of json-objects.
3083
3084The main json-object contains the following:
3085
3086- "enabled": true or false (json-bool)
3087- "host": server's IP address (json-string)
3088- "port": server's port number (json-int, optional)
3089- "tls-port": server's port number (json-int, optional)
3090- "auth": authentication method (json-string)
3091 - Possible values: "none", "spice"
3092- "channels": a json-array of all active channels clients
3093
3094Channels are described by a json-object, each one contain the following:
3095
3096- "host": client's IP address (json-string)
3097- "family": address family (json-string)
3098 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3099- "port": client's port number (json-string)
3100- "connection-id": spice connection id. All channels with the same id
3101 belong to the same spice session (json-int)
3102- "channel-type": channel type. "1" is the main control channel, filter for
3103 this one if you want track spice sessions only (json-int)
3104- "channel-id": channel id. Usually "0", might be different needed when
3105 multiple channels of the same type exist, such as multiple
3106 display channels in a multihead setup (json-int)
Alberto Garcia3599d462015-02-26 16:35:07 +02003107- "tls": whether the channel is encrypted (json-bool)
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01003108
3109Example:
3110
3111-> { "execute": "query-spice" }
3112<- {
3113 "return": {
3114 "enabled": true,
3115 "auth": "spice",
3116 "port": 5920,
3117 "tls-port": 5921,
3118 "host": "0.0.0.0",
3119 "channels": [
3120 {
3121 "port": "54924",
3122 "family": "ipv4",
3123 "channel-type": 1,
3124 "connection-id": 1804289383,
3125 "host": "127.0.0.1",
3126 "channel-id": 0,
3127 "tls": true
3128 },
3129 {
3130 "port": "36710",
3131 "family": "ipv4",
3132 "channel-type": 4,
3133 "connection-id": 1804289383,
3134 "host": "127.0.0.1",
3135 "channel-id": 0,
3136 "tls": false
3137 },
3138 [ ... more channels follow ... ]
3139 ]
3140 }
3141 }
3142
3143EQMP
3144
Luiz Capitulinod1f29642011-10-20 17:01:33 -02003145#if defined(CONFIG_SPICE)
3146 {
3147 .name = "query-spice",
3148 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003149 .mhandler.cmd_new = qmp_marshal_query_spice,
Luiz Capitulinod1f29642011-10-20 17:01:33 -02003150 },
3151#endif
3152
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01003153SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003154query-name
3155----------
3156
3157Show VM name.
3158
3159Return a json-object with the following information:
3160
3161- "name": VM's name (json-string, optional)
3162
3163Example:
3164
3165-> { "execute": "query-name" }
3166<- { "return": { "name": "qemu-name" } }
3167
3168EQMP
3169
Anthony Liguori48a32be2011-09-02 12:34:48 -05003170 {
3171 .name = "query-name",
3172 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003173 .mhandler.cmd_new = qmp_marshal_query_name,
Anthony Liguori48a32be2011-09-02 12:34:48 -05003174 },
3175
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003176SQMP
3177query-uuid
3178----------
3179
3180Show VM UUID.
3181
3182Return a json-object with the following information:
3183
3184- "UUID": Universally Unique Identifier (json-string)
3185
3186Example:
3187
3188-> { "execute": "query-uuid" }
3189<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3190
3191EQMP
3192
Luiz Capitulinoefab7672011-09-13 17:16:25 -03003193 {
3194 .name = "query-uuid",
3195 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003196 .mhandler.cmd_new = qmp_marshal_query_uuid,
Luiz Capitulinoefab7672011-09-13 17:16:25 -03003197 },
3198
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003199SQMP
Amos Kong1f8f9872013-04-25 17:50:35 +08003200query-command-line-options
3201--------------------------
3202
3203Show command line option schema.
3204
3205Return a json-array of command line option schema for all options (or for
3206the given option), returning an error if the given option doesn't exist.
3207
3208Each array entry contains the following:
3209
3210- "option": option name (json-string)
3211- "parameters": a json-array describes all parameters of the option:
3212 - "name": parameter name (json-string)
3213 - "type": parameter type (one of 'string', 'boolean', 'number',
3214 or 'size')
3215 - "help": human readable description of the parameter
3216 (json-string, optional)
Chunyan Liue36af942014-06-05 17:20:43 +08003217 - "default": default value string for the parameter
3218 (json-string, optional)
Amos Kong1f8f9872013-04-25 17:50:35 +08003219
3220Example:
3221
3222-> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3223<- { "return": [
3224 {
3225 "parameters": [
3226 {
3227 "name": "romfile",
3228 "type": "string"
3229 },
3230 {
3231 "name": "bootindex",
3232 "type": "number"
3233 }
3234 ],
3235 "option": "option-rom"
3236 }
3237 ]
3238 }
3239
3240EQMP
3241
3242 {
3243 .name = "query-command-line-options",
3244 .args_type = "option:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003245 .mhandler.cmd_new = qmp_marshal_query_command_line_options,
Amos Kong1f8f9872013-04-25 17:50:35 +08003246 },
3247
3248SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003249query-migrate
3250-------------
3251
3252Migration status.
3253
3254Return a json-object. If migration is active there will be another json-object
3255with RAM migration status and if block migration is active another one with
3256block migration status.
3257
3258The main json-object contains the following:
3259
3260- "status": migration status (json-string)
Peter Feiner3b695952014-05-16 10:40:47 -04003261 - Possible values: "setup", "active", "completed", "failed", "cancelled"
Juan Quintela7aa939a2012-08-18 13:17:10 +02003262- "total-time": total amount of ms since migration started. If
3263 migration has ended, it returns the total migration
Juan Quintela817c6042013-02-11 15:11:10 +01003264 time (json-int)
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003265- "setup-time" amount of setup time in milliseconds _before_ the
3266 iterations begin but _after_ the QMP command is issued.
3267 This is designed to provide an accounting of any activities
3268 (such as RDMA pinning) which may be expensive, but do not
3269 actually occur during the iterative migration rounds
3270 themselves. (json-int)
Juan Quintela9c5a9fc2012-08-13 09:35:16 +02003271- "downtime": only present when migration has finished correctly
3272 total amount in ms for downtime that happened (json-int)
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003273- "expected-downtime": only present while migration is active
3274 total amount in ms for downtime that was calculated on
Juan Quintela817c6042013-02-11 15:11:10 +01003275 the last bitmap round (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003276- "ram": only present if "status" is "active", it is a json-object with the
Juan Quintela817c6042013-02-11 15:11:10 +01003277 following RAM information:
3278 - "transferred": amount transferred in bytes (json-int)
3279 - "remaining": amount remaining to transfer in bytes (json-int)
3280 - "total": total amount of memory in bytes (json-int)
3281 - "duplicate": number of pages filled entirely with the same
3282 byte (json-int)
3283 These are sent over the wire much more efficiently.
Peter Lievenf1c72792013-03-26 10:58:37 +01003284 - "skipped": number of skipped zero pages (json-int)
Stefan Weil805a2502013-04-28 11:49:57 +02003285 - "normal" : number of whole pages transferred. I.e. they
Juan Quintela817c6042013-02-11 15:11:10 +01003286 were not sent as duplicate or xbzrle pages (json-int)
3287 - "normal-bytes" : number of bytes transferred in whole
3288 pages. This is just normal pages times size of one page,
3289 but this way upper levels don't need to care about page
3290 size (json-int)
ChenLiang58570ed2014-04-04 17:57:55 +08003291 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003292- "disk": only present if "status" is "active" and it is a block migration,
Juan Quintela817c6042013-02-11 15:11:10 +01003293 it is a json-object with the following disk information:
3294 - "transferred": amount transferred in bytes (json-int)
3295 - "remaining": amount remaining to transfer in bytes json-int)
3296 - "total": total disk size in bytes (json-int)
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003297- "xbzrle-cache": only present if XBZRLE is active.
3298 It is a json-object with the following XBZRLE information:
Juan Quintela817c6042013-02-11 15:11:10 +01003299 - "cache-size": XBZRLE cache size in bytes
3300 - "bytes": number of bytes transferred for XBZRLE compressed pages
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003301 - "pages": number of XBZRLE compressed pages
Juan Quintela817c6042013-02-11 15:11:10 +01003302 - "cache-miss": number of XBRZRLE page cache misses
ChenLiang8bc39232014-04-04 17:57:56 +08003303 - "cache-miss-rate": rate of XBRZRLE page cache misses
Juan Quintela817c6042013-02-11 15:11:10 +01003304 - "overflow": number of times XBZRLE overflows. This means
3305 that the XBZRLE encoding was bigger than just sent the
3306 whole page, and then we sent the whole page instead (as as
3307 normal page).
3308
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003309Examples:
3310
33111. Before the first migration
3312
3313-> { "execute": "query-migrate" }
3314<- { "return": {} }
3315
33162. Migration is done and has succeeded
3317
3318-> { "execute": "query-migrate" }
Orit Wasserman004d4c12012-08-06 21:42:56 +03003319<- { "return": {
3320 "status": "completed",
3321 "ram":{
3322 "transferred":123,
3323 "remaining":123,
3324 "total":246,
3325 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003326 "setup-time":12345,
Juan Quintela9c5a9fc2012-08-13 09:35:16 +02003327 "downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003328 "duplicate":123,
3329 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003330 "normal-bytes":123456,
3331 "dirty-sync-count":15
Orit Wasserman004d4c12012-08-06 21:42:56 +03003332 }
3333 }
3334 }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003335
33363. Migration is done and has failed
3337
3338-> { "execute": "query-migrate" }
3339<- { "return": { "status": "failed" } }
3340
33414. Migration is being performed and is not a block migration:
3342
3343-> { "execute": "query-migrate" }
3344<- {
3345 "return":{
3346 "status":"active",
3347 "ram":{
3348 "transferred":123,
3349 "remaining":123,
Orit Wasserman62d4e3f2012-08-06 21:42:55 +03003350 "total":246,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003351 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003352 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003353 "expected-downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003354 "duplicate":123,
3355 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003356 "normal-bytes":123456,
3357 "dirty-sync-count":15
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003358 }
3359 }
3360 }
3361
33625. Migration is being performed and is a block migration:
3363
3364-> { "execute": "query-migrate" }
3365<- {
3366 "return":{
3367 "status":"active",
3368 "ram":{
3369 "total":1057024,
3370 "remaining":1053304,
Orit Wasserman62d4e3f2012-08-06 21:42:55 +03003371 "transferred":3720,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003372 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003373 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003374 "expected-downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003375 "duplicate":123,
3376 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003377 "normal-bytes":123456,
3378 "dirty-sync-count":15
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003379 },
3380 "disk":{
3381 "total":20971520,
3382 "remaining":20880384,
3383 "transferred":91136
3384 }
3385 }
3386 }
3387
Orit Wassermanf36d55a2012-08-06 21:42:57 +030033886. Migration is being performed and XBZRLE is active:
3389
3390-> { "execute": "query-migrate" }
3391<- {
3392 "return":{
3393 "status":"active",
3394 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3395 "ram":{
3396 "total":1057024,
3397 "remaining":1053304,
3398 "transferred":3720,
3399 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003400 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003401 "expected-downtime":12345,
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003402 "duplicate":10,
3403 "normal":3333,
ChenLiang58570ed2014-04-04 17:57:55 +08003404 "normal-bytes":3412992,
3405 "dirty-sync-count":15
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003406 },
3407 "xbzrle-cache":{
3408 "cache-size":67108864,
3409 "bytes":20971520,
3410 "pages":2444343,
3411 "cache-miss":2244,
ChenLiang8bc39232014-04-04 17:57:56 +08003412 "cache-miss-rate":0.123,
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003413 "overflow":34434
3414 }
3415 }
3416 }
3417
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003418EQMP
3419
Luiz Capitulino791e7c82011-09-13 17:37:16 -03003420 {
3421 .name = "query-migrate",
3422 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003423 .mhandler.cmd_new = qmp_marshal_query_migrate,
Luiz Capitulino791e7c82011-09-13 17:37:16 -03003424 },
3425
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003426SQMP
Orit Wasserman00458432012-08-06 21:42:48 +03003427migrate-set-capabilities
Juan Quintela817c6042013-02-11 15:11:10 +01003428------------------------
Orit Wasserman00458432012-08-06 21:42:48 +03003429
3430Enable/Disable migration capabilities
3431
Juan Quintela817c6042013-02-11 15:11:10 +01003432- "xbzrle": XBZRLE support
zhanghailiangd6d69732014-12-09 14:38:37 +08003433- "rdma-pin-all": pin all pages when using RDMA during migration
3434- "auto-converge": throttle down guest to help convergence of migration
3435- "zero-blocks": compress zero blocks during block migration
Juan Quintela72e72e12015-07-08 14:13:10 +02003436- "events": generate events for each migration state change
Orit Wasserman00458432012-08-06 21:42:48 +03003437
3438Arguments:
3439
3440Example:
3441
3442-> { "execute": "migrate-set-capabilities" , "arguments":
3443 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3444
3445EQMP
3446
3447 {
3448 .name = "migrate-set-capabilities",
Paolo Bonzini43d0a2c2015-04-15 13:30:04 +02003449 .args_type = "capabilities:q",
Orit Wasserman00458432012-08-06 21:42:48 +03003450 .params = "capability:s,state:b",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003451 .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
Orit Wasserman00458432012-08-06 21:42:48 +03003452 },
3453SQMP
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003454query-migrate-capabilities
Juan Quintela817c6042013-02-11 15:11:10 +01003455--------------------------
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003456
3457Query current migration capabilities
3458
3459- "capabilities": migration capabilities state
3460 - "xbzrle" : XBZRLE state (json-bool)
zhanghailiangd6d69732014-12-09 14:38:37 +08003461 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3462 - "auto-converge" : Auto Converge state (json-bool)
3463 - "zero-blocks" : Zero Blocks state (json-bool)
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003464
3465Arguments:
3466
3467Example:
3468
3469-> { "execute": "query-migrate-capabilities" }
Orit Wassermandbca1b32013-01-31 09:12:17 +02003470<- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3471
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003472EQMP
3473
3474 {
3475 .name = "query-migrate-capabilities",
3476 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003477 .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003478 },
3479
3480SQMP
Liang Li85de8322015-03-23 16:32:28 +08003481migrate-set-parameters
3482----------------------
3483
3484Set migration parameters
3485
3486- "compress-level": set compression level during migration (json-int)
3487- "compress-threads": set compression thread count for migration (json-int)
3488- "decompress-threads": set decompression thread count for migration (json-int)
3489
3490Arguments:
3491
3492Example:
3493
3494-> { "execute": "migrate-set-parameters" , "arguments":
3495 { "compress-level": 1 } }
3496
3497EQMP
3498
3499 {
3500 .name = "migrate-set-parameters",
3501 .args_type =
3502 "compress-level:i?,compress-threads:i?,decompress-threads:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003503 .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
Liang Li85de8322015-03-23 16:32:28 +08003504 },
3505SQMP
3506query-migrate-parameters
3507------------------------
3508
3509Query current migration parameters
3510
3511- "parameters": migration parameters value
3512 - "compress-level" : compression level value (json-int)
3513 - "compress-threads" : compression thread count value (json-int)
3514 - "decompress-threads" : decompression thread count value (json-int)
3515
3516Arguments:
3517
3518Example:
3519
3520-> { "execute": "query-migrate-parameters" }
3521<- {
3522 "return": {
3523 "decompress-threads", 2,
3524 "compress-threads", 8,
3525 "compress-level", 1
3526 }
3527 }
3528
3529EQMP
3530
3531 {
3532 .name = "query-migrate-parameters",
3533 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003534 .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
Liang Li85de8322015-03-23 16:32:28 +08003535 },
3536
3537SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003538query-balloon
3539-------------
3540
3541Show balloon information.
3542
3543Make an asynchronous request for balloon info. When the request completes a
3544json-object will be returned containing the following data:
3545
3546- "actual": current balloon value in bytes (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003547
3548Example:
3549
3550-> { "execute": "query-balloon" }
3551<- {
3552 "return":{
3553 "actual":1073741824,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003554 }
3555 }
3556
3557EQMP
3558
Luiz Capitulino96637bc2011-10-21 11:41:37 -02003559 {
3560 .name = "query-balloon",
3561 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003562 .mhandler.cmd_new = qmp_marshal_query_balloon,
Luiz Capitulino96637bc2011-10-21 11:41:37 -02003563 },
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003564
3565 {
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00003566 .name = "query-block-jobs",
3567 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003568 .mhandler.cmd_new = qmp_marshal_query_block_jobs,
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00003569 },
3570
3571 {
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003572 .name = "qom-list",
3573 .args_type = "path:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003574 .mhandler.cmd_new = qmp_marshal_qom_list,
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003575 },
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003576
3577 {
3578 .name = "qom-set",
Paolo Bonzinib9f89782012-03-22 12:51:11 +01003579 .args_type = "path:s,property:s,value:q",
Markus Armbruster6eb39372015-09-16 13:06:25 +02003580 .mhandler.cmd_new = qmp_marshal_qom_set,
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003581 },
3582
3583 {
3584 .name = "qom-get",
3585 .args_type = "path:s,property:s",
Markus Armbruster6eb39372015-09-16 13:06:25 +02003586 .mhandler.cmd_new = qmp_marshal_qom_get,
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003587 },
Luiz Capitulino270b2432011-12-08 11:45:55 -02003588
3589 {
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003590 .name = "nbd-server-start",
3591 .args_type = "addr:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003592 .mhandler.cmd_new = qmp_marshal_nbd_server_start,
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003593 },
3594 {
3595 .name = "nbd-server-add",
3596 .args_type = "device:B,writable:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003597 .mhandler.cmd_new = qmp_marshal_nbd_server_add,
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003598 },
3599 {
3600 .name = "nbd-server-stop",
3601 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003602 .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003603 },
3604
3605 {
Luiz Capitulino270b2432011-12-08 11:45:55 -02003606 .name = "change-vnc-password",
3607 .args_type = "password:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003608 .mhandler.cmd_new = qmp_marshal_change_vnc_password,
Luiz Capitulino270b2432011-12-08 11:45:55 -02003609 },
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06003610 {
3611 .name = "qom-list-types",
3612 .args_type = "implements:s?,abstract:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003613 .mhandler.cmd_new = qmp_marshal_qom_list_types,
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06003614 },
Anthony Liguori1daa31b2012-08-10 11:04:09 -05003615
3616 {
3617 .name = "device-list-properties",
3618 .args_type = "typename:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003619 .mhandler.cmd_new = qmp_marshal_device_list_properties,
Anthony Liguori1daa31b2012-08-10 11:04:09 -05003620 },
3621
Anthony Liguori01d3c802012-08-10 11:04:11 -05003622 {
3623 .name = "query-machines",
3624 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003625 .mhandler.cmd_new = qmp_marshal_query_machines,
Anthony Liguori01d3c802012-08-10 11:04:11 -05003626 },
3627
Anthony Liguorie4e31c62012-08-10 11:04:13 -05003628 {
3629 .name = "query-cpu-definitions",
3630 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003631 .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
Anthony Liguorie4e31c62012-08-10 11:04:13 -05003632 },
3633
Daniel P. Berrange99afc912012-08-20 15:31:38 +01003634 {
3635 .name = "query-target",
3636 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003637 .mhandler.cmd_new = qmp_marshal_query_target,
Daniel P. Berrange99afc912012-08-20 15:31:38 +01003638 },
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003639
3640 {
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003641 .name = "query-tpm",
3642 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003643 .mhandler.cmd_new = qmp_marshal_query_tpm,
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003644 },
3645
Corey Bryant28c4fa32013-03-20 12:34:49 -04003646SQMP
3647query-tpm
3648---------
3649
3650Return information about the TPM device.
3651
3652Arguments: None
3653
3654Example:
3655
3656-> { "execute": "query-tpm" }
3657<- { "return":
3658 [
3659 { "model": "tpm-tis",
3660 "options":
3661 { "type": "passthrough",
3662 "data":
3663 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3664 "path": "/dev/tpm0"
3665 }
3666 },
3667 "id": "tpm0"
3668 }
3669 ]
3670 }
3671
3672EQMP
3673
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003674 {
3675 .name = "query-tpm-models",
3676 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003677 .mhandler.cmd_new = qmp_marshal_query_tpm_models,
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003678 },
3679
Corey Bryant28c4fa32013-03-20 12:34:49 -04003680SQMP
3681query-tpm-models
3682----------------
3683
3684Return a list of supported TPM models.
3685
3686Arguments: None
3687
3688Example:
3689
3690-> { "execute": "query-tpm-models" }
3691<- { "return": [ "tpm-tis" ] }
3692
3693EQMP
3694
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003695 {
3696 .name = "query-tpm-types",
3697 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003698 .mhandler.cmd_new = qmp_marshal_query_tpm_types,
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003699 },
3700
Corey Bryant28c4fa32013-03-20 12:34:49 -04003701SQMP
3702query-tpm-types
3703---------------
3704
3705Return a list of supported TPM types.
3706
3707Arguments: None
3708
3709Example:
3710
3711-> { "execute": "query-tpm-types" }
3712<- { "return": [ "passthrough" ] }
3713
3714EQMP
3715
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003716 {
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003717 .name = "chardev-add",
3718 .args_type = "id:s,backend:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003719 .mhandler.cmd_new = qmp_marshal_chardev_add,
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003720 },
3721
3722SQMP
3723chardev-add
3724----------------
3725
3726Add a chardev.
3727
3728Arguments:
3729
3730- "id": the chardev's ID, must be unique (json-string)
3731- "backend": chardev backend type + parameters
3732
Gerd Hoffmannffbdbe52012-12-19 13:13:57 +01003733Examples:
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003734
3735-> { "execute" : "chardev-add",
3736 "arguments" : { "id" : "foo",
3737 "backend" : { "type" : "null", "data" : {} } } }
3738<- { "return": {} }
3739
Gerd Hoffmannffbdbe52012-12-19 13:13:57 +01003740-> { "execute" : "chardev-add",
3741 "arguments" : { "id" : "bar",
3742 "backend" : { "type" : "file",
3743 "data" : { "out" : "/tmp/bar.log" } } } }
3744<- { "return": {} }
3745
Gerd Hoffmann0a1a7fa2012-12-20 14:39:13 +01003746-> { "execute" : "chardev-add",
3747 "arguments" : { "id" : "baz",
3748 "backend" : { "type" : "pty", "data" : {} } } }
3749<- { "return": { "pty" : "/dev/pty/42" } }
3750
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003751EQMP
3752
3753 {
3754 .name = "chardev-remove",
3755 .args_type = "id:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003756 .mhandler.cmd_new = qmp_marshal_chardev_remove,
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003757 },
3758
3759
3760SQMP
3761chardev-remove
3762--------------
3763
3764Remove a chardev.
3765
3766Arguments:
3767
3768- "id": the chardev's ID, must exist and not be in use (json-string)
3769
3770Example:
3771
3772-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3773<- { "return": {} }
3774
3775EQMP
Amos Kongb1be4282013-06-14 15:45:52 +08003776 {
3777 .name = "query-rx-filter",
3778 .args_type = "name:s?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003779 .mhandler.cmd_new = qmp_marshal_query_rx_filter,
Amos Kongb1be4282013-06-14 15:45:52 +08003780 },
3781
3782SQMP
3783query-rx-filter
3784---------------
3785
3786Show rx-filter information.
3787
3788Returns a json-array of rx-filter information for all NICs (or for the
3789given NIC), returning an error if the given NIC doesn't exist, or
3790given NIC doesn't support rx-filter querying, or given net client
3791isn't a NIC.
3792
3793The query will clear the event notification flag of each NIC, then qemu
3794will start to emit event to QMP monitor.
3795
3796Each array entry contains the following:
3797
3798- "name": net client name (json-string)
3799- "promiscuous": promiscuous mode is enabled (json-bool)
3800- "multicast": multicast receive state (one of 'normal', 'none', 'all')
3801- "unicast": unicast receive state (one of 'normal', 'none', 'all')
Amos Kongf7bc8ef2014-03-26 08:19:43 +08003802- "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
Amos Kongb1be4282013-06-14 15:45:52 +08003803- "broadcast-allowed": allow to receive broadcast (json-bool)
3804- "multicast-overflow": multicast table is overflowed (json-bool)
3805- "unicast-overflow": unicast table is overflowed (json-bool)
3806- "main-mac": main macaddr string (json-string)
3807- "vlan-table": a json-array of active vlan id
3808- "unicast-table": a json-array of unicast macaddr string
3809- "multicast-table": a json-array of multicast macaddr string
3810
3811Example:
3812
3813-> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3814<- { "return": [
3815 {
3816 "promiscuous": true,
3817 "name": "vnet0",
3818 "main-mac": "52:54:00:12:34:56",
3819 "unicast": "normal",
Amos Kongf7bc8ef2014-03-26 08:19:43 +08003820 "vlan": "normal",
Amos Kongb1be4282013-06-14 15:45:52 +08003821 "vlan-table": [
3822 4,
3823 0
3824 ],
3825 "unicast-table": [
3826 ],
3827 "multicast": "normal",
3828 "multicast-overflow": false,
3829 "unicast-overflow": false,
3830 "multicast-table": [
3831 "01:00:5e:00:00:01",
3832 "33:33:00:00:00:01",
3833 "33:33:ff:12:34:56"
3834 ],
3835 "broadcast-allowed": false
3836 }
3837 ]
3838 }
3839
3840EQMP
Kevin Wolfd26c9a12013-09-23 15:26:03 +02003841
3842 {
3843 .name = "blockdev-add",
3844 .args_type = "options:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003845 .mhandler.cmd_new = qmp_marshal_blockdev_add,
Kevin Wolfd26c9a12013-09-23 15:26:03 +02003846 },
3847
3848SQMP
3849blockdev-add
3850------------
3851
3852Add a block device.
3853
Markus Armbrusterda2cf4e2015-03-20 14:32:17 +01003854This command is still a work in progress. It doesn't support all
3855block drivers, it lacks a matching blockdev-del, and more. Stay away
3856from it unless you want to help with its development.
3857
Kevin Wolfd26c9a12013-09-23 15:26:03 +02003858Arguments:
3859
3860- "options": block driver options
3861
3862Example (1):
3863
3864-> { "execute": "blockdev-add",
3865 "arguments": { "options" : { "driver": "qcow2",
3866 "file": { "driver": "file",
3867 "filename": "test.qcow2" } } } }
3868<- { "return": {} }
3869
3870Example (2):
3871
3872-> { "execute": "blockdev-add",
3873 "arguments": {
3874 "options": {
3875 "driver": "qcow2",
3876 "id": "my_disk",
3877 "discard": "unmap",
3878 "cache": {
3879 "direct": true,
3880 "writeback": true
3881 },
3882 "file": {
3883 "driver": "file",
3884 "filename": "/tmp/test.qcow2"
3885 },
3886 "backing": {
3887 "driver": "raw",
3888 "file": {
3889 "driver": "file",
3890 "filename": "/dev/fdset/4"
3891 }
3892 }
3893 }
3894 }
3895 }
3896
3897<- { "return": {} }
3898
3899EQMP
Benoît Canetc13163f2014-01-23 21:31:34 +01003900
3901 {
3902 .name = "query-named-block-nodes",
3903 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003904 .mhandler.cmd_new = qmp_marshal_query_named_block_nodes,
Benoît Canetc13163f2014-01-23 21:31:34 +01003905 },
3906
3907SQMP
3908@query-named-block-nodes
3909------------------------
3910
3911Return a list of BlockDeviceInfo for all the named block driver nodes
3912
3913Example:
3914
3915-> { "execute": "query-named-block-nodes" }
3916<- { "return": [ { "ro":false,
3917 "drv":"qcow2",
3918 "encrypted":false,
3919 "file":"disks/test.qcow2",
3920 "node-name": "my-node",
3921 "backing_file_depth":1,
3922 "bps":1000000,
3923 "bps_rd":0,
3924 "bps_wr":0,
3925 "iops":1000000,
3926 "iops_rd":0,
3927 "iops_wr":0,
3928 "bps_max": 8000000,
3929 "bps_rd_max": 0,
3930 "bps_wr_max": 0,
3931 "iops_max": 0,
3932 "iops_rd_max": 0,
3933 "iops_wr_max": 0,
3934 "iops_size": 0,
Francesco Romanie2462112015-01-12 14:11:13 +01003935 "write_threshold": 0,
Benoît Canetc13163f2014-01-23 21:31:34 +01003936 "image":{
3937 "filename":"disks/test.qcow2",
3938 "format":"qcow2",
3939 "virtual-size":2048000,
3940 "backing_file":"base.qcow2",
3941 "full-backing-filename":"disks/base.qcow2",
John Snow54034322015-04-28 15:20:41 -04003942 "backing-filename-format":"qcow2",
Benoît Canetc13163f2014-01-23 21:31:34 +01003943 "snapshots":[
3944 {
3945 "id": "1",
3946 "name": "snapshot1",
3947 "vm-state-size": 0,
3948 "date-sec": 10000200,
3949 "date-nsec": 12,
3950 "vm-clock-sec": 206,
3951 "vm-clock-nsec": 30
3952 }
3953 ],
3954 "backing-image":{
3955 "filename":"disks/base.qcow2",
3956 "format":"qcow2",
3957 "virtual-size":2048000
3958 }
Michael S. Tsirkinc0594512014-06-16 15:20:18 +03003959 } } ] }
Benoît Canetc13163f2014-01-23 21:31:34 +01003960
3961EQMP
Hu Tao76b5d852014-06-16 18:05:41 +08003962
3963 {
3964 .name = "query-memdev",
3965 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02003966 .mhandler.cmd_new = qmp_marshal_query_memdev,
Hu Tao76b5d852014-06-16 18:05:41 +08003967 },
3968
3969SQMP
3970query-memdev
3971------------
3972
3973Show memory devices information.
3974
3975
3976Example (1):
3977
3978-> { "execute": "query-memdev" }
3979<- { "return": [
3980 {
3981 "size": 536870912,
3982 "merge": false,
3983 "dump": true,
3984 "prealloc": false,
3985 "host-nodes": [0, 1],
3986 "policy": "bind"
3987 },
3988 {
3989 "size": 536870912,
3990 "merge": false,
3991 "dump": true,
3992 "prealloc": true,
3993 "host-nodes": [2, 3],
3994 "policy": "preferred"
3995 }
3996 ]
3997 }
3998
3999EQMP
Igor Mammedov6f2e2732014-06-16 19:12:25 +02004000
4001 {
4002 .name = "query-memory-devices",
4003 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004004 .mhandler.cmd_new = qmp_marshal_query_memory_devices,
Igor Mammedov6f2e2732014-06-16 19:12:25 +02004005 },
4006
4007SQMP
4008@query-memory-devices
4009--------------------
4010
4011Return a list of memory devices.
4012
4013Example:
4014-> { "execute": "query-memory-devices" }
4015<- { "return": [ { "data":
4016 { "addr": 5368709120,
4017 "hotpluggable": true,
4018 "hotplugged": true,
4019 "id": "d1",
4020 "memdev": "/objects/memX",
4021 "node": 0,
4022 "size": 1073741824,
4023 "slot": 0},
4024 "type": "dimm"
4025 } ] }
4026EQMP
Igor Mammedov02419bc2014-06-16 19:12:28 +02004027
4028 {
4029 .name = "query-acpi-ospm-status",
4030 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004031 .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status,
Igor Mammedov02419bc2014-06-16 19:12:28 +02004032 },
4033
4034SQMP
4035@query-acpi-ospm-status
4036--------------------
4037
4038Return list of ACPIOSTInfo for devices that support status reporting
4039via ACPI _OST method.
4040
4041Example:
4042-> { "execute": "query-acpi-ospm-status" }
4043<- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4044 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4045 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4046 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4047 ]}
4048EQMP
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004049
4050#if defined TARGET_I386
4051 {
4052 .name = "rtc-reset-reinjection",
4053 .args_type = "",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004054 .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection,
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004055 },
4056#endif
4057
4058SQMP
4059rtc-reset-reinjection
4060---------------------
4061
4062Reset the RTC interrupt reinjection backlog.
4063
4064Arguments: None.
4065
4066Example:
4067
4068-> { "execute": "rtc-reset-reinjection" }
4069<- { "return": {} }
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004070EQMP
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004071
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004072 {
4073 .name = "trace-event-get-state",
4074 .args_type = "name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004075 .mhandler.cmd_new = qmp_marshal_trace_event_get_state,
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004076 },
4077
4078SQMP
4079trace-event-get-state
4080---------------------
4081
4082Query the state of events.
4083
4084Example:
4085
4086-> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4087<- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4088EQMP
4089
4090 {
4091 .name = "trace-event-set-state",
4092 .args_type = "name:s,enable:b,ignore-unavailable:b?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004093 .mhandler.cmd_new = qmp_marshal_trace_event_set_state,
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004094 },
4095
4096SQMP
4097trace-event-set-state
4098---------------------
4099
4100Set the state of events.
4101
4102Example:
4103
4104-> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4105<- { "return": {} }
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004106EQMP
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004107
4108 {
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004109 .name = "x-input-send-event",
Amos Kong51fc4472014-11-07 12:41:25 +08004110 .args_type = "console:i?,events:q",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004111 .mhandler.cmd_new = qmp_marshal_x_input_send_event,
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004112 },
4113
4114SQMP
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004115@x-input-send-event
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004116-----------------
4117
4118Send input event to guest.
4119
4120Arguments:
4121
Amos Kong51fc4472014-11-07 12:41:25 +08004122- "console": console index. (json-int, optional)
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004123- "events": list of input events.
4124
4125The consoles are visible in the qom tree, under
4126/backend/console[$index]. They have a device link and head property, so
4127it is possible to map which console belongs to which device and display.
4128
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004129Note: this command is experimental, and not a stable API.
4130
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004131Example (1):
4132
4133Press left mouse button.
4134
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004135-> { "execute": "x-input-send-event",
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004136 "arguments": { "console": 0,
4137 "events": [ { "type": "btn",
Amos Kongb5369dd2014-11-25 16:05:56 +08004138 "data" : { "down": true, "button": "Left" } } ] } }
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004139<- { "return": {} }
4140
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004141-> { "execute": "x-input-send-event",
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004142 "arguments": { "console": 0,
4143 "events": [ { "type": "btn",
Amos Kongb5369dd2014-11-25 16:05:56 +08004144 "data" : { "down": false, "button": "Left" } } ] } }
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004145<- { "return": {} }
4146
4147Example (2):
4148
4149Press ctrl-alt-del.
4150
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004151-> { "execute": "x-input-send-event",
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004152 "arguments": { "console": 0, "events": [
4153 { "type": "key", "data" : { "down": true,
4154 "key": {"type": "qcode", "data": "ctrl" } } },
4155 { "type": "key", "data" : { "down": true,
4156 "key": {"type": "qcode", "data": "alt" } } },
4157 { "type": "key", "data" : { "down": true,
4158 "key": {"type": "qcode", "data": "delete" } } } ] } }
4159<- { "return": {} }
4160
4161Example (3):
4162
4163Move mouse pointer to absolute coordinates (20000, 400).
4164
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004165-> { "execute": "x-input-send-event" ,
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004166 "arguments": { "console": 0, "events": [
4167 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
4168 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
4169<- { "return": {} }
4170
4171EQMP
Francesco Romanie2462112015-01-12 14:11:13 +01004172
4173 {
4174 .name = "block-set-write-threshold",
4175 .args_type = "node-name:s,write-threshold:l",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004176 .mhandler.cmd_new = qmp_marshal_block_set_write_threshold,
Francesco Romanie2462112015-01-12 14:11:13 +01004177 },
4178
4179SQMP
4180block-set-write-threshold
4181------------
4182
4183Change the write threshold for a block drive. The threshold is an offset,
4184thus must be non-negative. Default is no write threshold.
4185Setting the threshold to zero disables it.
4186
4187Arguments:
4188
4189- "node-name": the node name in the block driver state graph (json-string)
4190- "write-threshold": the write threshold in bytes (json-int)
4191
4192Example:
4193
4194-> { "execute": "block-set-write-threshold",
4195 "arguments": { "node-name": "mydev",
4196 "write-threshold": 17179869184 } }
4197<- { "return": {} }
4198
4199EQMP
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004200
4201 {
4202 .name = "query-rocker",
4203 .args_type = "name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004204 .mhandler.cmd_new = qmp_marshal_query_rocker,
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004205 },
4206
4207SQMP
4208Show rocker switch
4209------------------
4210
4211Arguments:
4212
4213- "name": switch name
4214
4215Example:
4216
4217-> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4218<- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4219
4220EQMP
4221
4222 {
4223 .name = "query-rocker-ports",
4224 .args_type = "name:s",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004225 .mhandler.cmd_new = qmp_marshal_query_rocker_ports,
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004226 },
4227
4228SQMP
4229Show rocker switch ports
4230------------------------
4231
4232Arguments:
4233
4234- "name": switch name
4235
4236Example:
4237
4238-> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4239<- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4240 "autoneg": "off", "link-up": true, "speed": 10000},
4241 {"duplex": "full", "enabled": true, "name": "sw1.2",
4242 "autoneg": "off", "link-up": true, "speed": 10000}
4243 ]}
4244
4245EQMP
4246
4247 {
4248 .name = "query-rocker-of-dpa-flows",
4249 .args_type = "name:s,tbl-id:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004250 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows,
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004251 },
4252
4253SQMP
4254Show rocker switch OF-DPA flow tables
4255-------------------------------------
4256
4257Arguments:
4258
4259- "name": switch name
4260- "tbl-id": (optional) flow table ID
4261
4262Example:
4263
4264-> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4265<- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4266 "hits": 138,
4267 "cookie": 0,
4268 "action": {"goto-tbl": 10},
4269 "mask": {"in-pport": 4294901760}
4270 },
4271 {...more...},
4272 ]}
4273
4274EQMP
4275
4276 {
4277 .name = "query-rocker-of-dpa-groups",
4278 .args_type = "name:s,type:i?",
Markus Armbruster7fad30f2015-09-16 13:06:19 +02004279 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups,
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004280 },
4281
4282SQMP
4283Show rocker OF-DPA group tables
4284-------------------------------
4285
4286Arguments:
4287
4288- "name": switch name
4289- "type": (optional) group type
4290
4291Example:
4292
4293-> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4294<- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4295 "pop-vlan": 1, "id": 251723778},
4296 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4297 "pop-vlan": 1, "id": 251723776},
4298 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4299 "pop-vlan": 1, "id": 251658241},
4300 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4301 "pop-vlan": 1, "id": 251658240}
4302 ]}